@100mslive/roomkit-react 0.1.7 → 0.1.8-alpha.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/AudioLevel/AudioLevel.d.ts +5 -8
- package/dist/AudioLevel/index.d.ts +2 -1
- package/dist/AudioLevel/useBorderAudioLevel.d.ts +8 -0
- package/dist/{HLSView-3S74KF3A.js → HLSView-IQRPLYNH.js} +5 -4
- package/dist/{HLSView-3S74KF3A.js.map → HLSView-IQRPLYNH.js.map} +2 -2
- package/dist/Prebuilt/components/Chip.d.ts +12 -0
- package/dist/Prebuilt/components/PrebuiltDialogPortal.d.ts +4 -0
- package/dist/{VirtualBackground-3TI5NA4V.js → VirtualBackground-GP4ATXD3.js} +3 -3
- package/dist/{chunk-36X4ZCLC.js → chunk-2H5NIZB7.js} +2 -2
- package/dist/{chunk-Z7P5WITU.js → chunk-GLYGPYNS.js} +560 -1190
- package/dist/chunk-GLYGPYNS.js.map +7 -0
- package/dist/{chunk-5DQ3WTED.js → chunk-Z3O2WGWV.js} +2 -2
- package/dist/{chunk-5DQ3WTED.js.map → chunk-Z3O2WGWV.js.map} +1 -1
- package/dist/{conference-JNABIZBG.js → conference-JD35TNH4.js} +1351 -662
- package/dist/conference-JD35TNH4.js.map +7 -0
- package/dist/index.cjs.js +3387 -3297
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.js +4 -2
- package/dist/meta.cjs.json +1001 -826
- package/dist/meta.esbuild.json +1053 -877
- package/package.json +6 -6
- package/src/AudioLevel/AudioLevel.tsx +79 -30
- package/src/AudioLevel/audio-level.png +0 -0
- package/src/AudioLevel/index.ts +2 -1
- package/src/AudioLevel/useBorderAudioLevel.tsx +34 -0
- package/src/Prebuilt/App.tsx +1 -0
- package/src/Prebuilt/common/utils.js +0 -7
- package/src/Prebuilt/components/{Chip.jsx → Chip.tsx} +13 -2
- package/src/Prebuilt/components/Footer/ParticipantList.jsx +23 -12
- package/src/Prebuilt/components/Footer/RoleAccordion.tsx +43 -3
- package/src/Prebuilt/components/Leave/DesktopLeaveRoom.tsx +7 -4
- package/src/Prebuilt/components/MoreSettings/ChangeNameModal.jsx +3 -2
- package/src/Prebuilt/components/MoreSettings/EmbedUrl.jsx +3 -2
- package/src/Prebuilt/components/MwebLandscapePrompt.jsx +58 -0
- package/src/Prebuilt/components/Notifications/HLSFailureModal.jsx +3 -2
- package/src/Prebuilt/components/Notifications/PermissionErrorModal.jsx +3 -2
- package/src/Prebuilt/components/PrebuiltDialogPortal.tsx +6 -0
- package/src/Prebuilt/components/Preview/PreviewJoin.tsx +4 -3
- package/src/Prebuilt/components/RoleChangeModal.jsx +3 -2
- package/src/Prebuilt/components/RoleChangeRequest/RequestPrompt.tsx +3 -2
- package/src/Prebuilt/components/Settings/SettingsModal.jsx +3 -2
- package/src/Prebuilt/components/Settings/StartRecording.jsx +3 -2
- package/src/Prebuilt/components/StatsForNerds.jsx +3 -2
- package/src/Prebuilt/components/VideoTile.jsx +22 -69
- package/src/Prebuilt/components/pdfAnnotator/pdfFileOptions.jsx +3 -2
- package/src/Prebuilt/components/pdfAnnotator/shareScreenOptions.jsx +4 -29
- package/src/Prebuilt/components/pdfAnnotator/uploadedFile.jsx +3 -2
- package/src/Prebuilt/layouts/HLSView.jsx +1 -0
- package/src/Prebuilt/primitives/DialogContent.jsx +5 -4
- package/dist/chunk-Z7P5WITU.js.map +0 -7
- package/dist/conference-JNABIZBG.js.map +0 -7
- /package/dist/{VirtualBackground-3TI5NA4V.js.map → VirtualBackground-GP4ATXD3.js.map} +0 -0
- /package/dist/{chunk-36X4ZCLC.js.map → chunk-2H5NIZB7.js.map} +0 -0
@@ -35,7 +35,7 @@ import {
|
|
35
35
|
textEllipsis,
|
36
36
|
theme,
|
37
37
|
toastAnimation
|
38
|
-
} from "./chunk-
|
38
|
+
} from "./chunk-Z3O2WGWV.js";
|
39
39
|
|
40
40
|
// src/Button/Button.tsx
|
41
41
|
import React2 from "react";
|
@@ -1221,7 +1221,7 @@ var StyledMenuTile = {
|
|
1221
1221
|
RemoveItem: RemoveMenuItem
|
1222
1222
|
};
|
1223
1223
|
|
1224
|
-
// src/AudioLevel/
|
1224
|
+
// src/AudioLevel/useBorderAudioLevel.tsx
|
1225
1225
|
import { useCallback as useCallback2, useRef as useRef2 } from "react";
|
1226
1226
|
import { useAudioLevelStyles } from "@100mslive/react-sdk";
|
1227
1227
|
function useBorderAudioLevel(audioTrackId) {
|
@@ -1249,6 +1249,83 @@ var sigmoid = (z) => {
|
|
1249
1249
|
return 1 / (1 + Math.exp(-z));
|
1250
1250
|
};
|
1251
1251
|
|
1252
|
+
// src/AudioLevel/AudioLevel.tsx
|
1253
|
+
import React10, { useEffect as useEffect3, useRef as useRef3 } from "react";
|
1254
|
+
import { selectTrackAudioByID, useHMSVanillaStore } from "@100mslive/react-sdk";
|
1255
|
+
|
1256
|
+
// src/AudioLevel/audio-level.png
|
1257
|
+
var audio_level_default = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAABABAMAAAAHc7SNAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAtUExURQAAAP///////////////////////////////////////////////////////6FIq5sAAAAOdFJOUwA/QJqbnJ2euLnc3d7+2IFKrQAAAa9JREFUaN7dmcFRxDAMRXNgW4AbV24ZSkgrlAAFUAqlpITtgT0QnB22BnY3iWXHSlYz5H/NoJNO8bP8JTlyVW1k923/MveYdnc623PuUe3jsux37tEDcN24eFR7HJb9TD2qvQ/LfqUexR7a41Xx7bDsMfWo2j+NlnpU7TsBiOKdAOqoeCcAUTwFYFK8pn0GgFLttWVxAEq1pwJo1Z4KoFV7KoBW7YEAT0uK729pfxuAZcX/3Fr2TwAx05cVDwWIu11RPBQg7lZ0XlR7JIDsdkXxCIDp5GXf2v0GBxBP3pTfAIB48qb83h7AWtlhANbKDgOwVnYYgLWywwCsn/u/AO5HMIqwcwOovdNwLESNG8BQioNfKa52YwBsakC04/MF9C1Rw4HdjhU1SCyKqOCvZCGLhXgMgKgGiUWRI9hr+aSG+bU8sP4LyliIxwW4xOI1j8pKZlB/Tjt794ANpKzdAzOgaOzdAzKiCVpmkACWM4MEIFVCyQzfQWXnPao9eA+rG+dxfXB8L1jNB4pN+bCfd4re59Gqoz9alflQ+zzb7ZROwTWlUziEIO8UZCs7hc1+AbiVW6XSE8knAAAAAElFTkSuQmCC";
|
1258
|
+
|
1259
|
+
// src/AudioLevel/AudioLevel.tsx
|
1260
|
+
var positionValues = new Array(101).fill(0).reduce((acc, _, index) => {
|
1261
|
+
acc[index] = Math.round(index / 100 * 4) / 4;
|
1262
|
+
return acc;
|
1263
|
+
}, {});
|
1264
|
+
var barAnimation = keyframes({
|
1265
|
+
from: {
|
1266
|
+
maskSize: "4em .8em",
|
1267
|
+
"-webkit-mask-position-y": ".1em",
|
1268
|
+
maskPosition: "initial .1em"
|
1269
|
+
},
|
1270
|
+
"50%": {
|
1271
|
+
maskSize: "4em 1em",
|
1272
|
+
"-webkit-mask-position-y": 0,
|
1273
|
+
maskPosition: "initial 0"
|
1274
|
+
},
|
1275
|
+
to: {
|
1276
|
+
maskSize: "4em .8em",
|
1277
|
+
"-webkit-mask-position-y": ".1em",
|
1278
|
+
maskPosition: "initial 0"
|
1279
|
+
}
|
1280
|
+
});
|
1281
|
+
var AudioBar = () => {
|
1282
|
+
return /* @__PURE__ */ React10.createElement(
|
1283
|
+
Box,
|
1284
|
+
{
|
1285
|
+
css: {
|
1286
|
+
width: ".25em",
|
1287
|
+
height: "1em",
|
1288
|
+
maskImage: `url(${audio_level_default})`,
|
1289
|
+
"-webkit-mask-repeat": "no-repeat",
|
1290
|
+
backgroundColor: "$on_primary_high",
|
1291
|
+
maskSize: "4em 1em"
|
1292
|
+
}
|
1293
|
+
}
|
1294
|
+
);
|
1295
|
+
};
|
1296
|
+
var AudioLevel = ({ trackId, size }) => {
|
1297
|
+
const ref = useRef3(null);
|
1298
|
+
const vanillaStore = useHMSVanillaStore();
|
1299
|
+
useEffect3(() => {
|
1300
|
+
const unsubscribe = vanillaStore.subscribe((audioLevel) => {
|
1301
|
+
if (ref.current) {
|
1302
|
+
let index = 0;
|
1303
|
+
for (const child of ref.current.children) {
|
1304
|
+
const positionX = `-${positionValues[audioLevel] * (index === 1 ? 2.5 : 1.25)}em`;
|
1305
|
+
child.style["-webkit-mask-position-x"] = positionX;
|
1306
|
+
child.style["mask-position"] = `${positionX} 0`;
|
1307
|
+
child.style["animation"] = positionValues[audioLevel] > 0 ? `${barAnimation} 0.6s steps(3,jump-none) 0s infinite` : "none";
|
1308
|
+
index++;
|
1309
|
+
}
|
1310
|
+
}
|
1311
|
+
}, selectTrackAudioByID(trackId));
|
1312
|
+
return unsubscribe;
|
1313
|
+
}, [vanillaStore, trackId]);
|
1314
|
+
return /* @__PURE__ */ React10.createElement(
|
1315
|
+
Flex,
|
1316
|
+
{
|
1317
|
+
ref,
|
1318
|
+
css: {
|
1319
|
+
fontSize: size === "small" ? "0.75rem" : "1rem",
|
1320
|
+
gap: size === "small" ? "$1" : "$2"
|
1321
|
+
}
|
1322
|
+
},
|
1323
|
+
/* @__PURE__ */ React10.createElement(AudioBar, null),
|
1324
|
+
/* @__PURE__ */ React10.createElement(AudioBar, null),
|
1325
|
+
/* @__PURE__ */ React10.createElement(AudioBar, null)
|
1326
|
+
);
|
1327
|
+
};
|
1328
|
+
|
1252
1329
|
// src/Popover/index.tsx
|
1253
1330
|
import { Arrow as Arrow2, Close as Close2, Content as Content4, Popover as Root12, Portal as Portal3, Trigger as Trigger4 } from "@radix-ui/react-popover";
|
1254
1331
|
var StyledContent2 = styled(Content4, __spreadValues({
|
@@ -1270,7 +1347,7 @@ var Popover2 = {
|
|
1270
1347
|
};
|
1271
1348
|
|
1272
1349
|
// src/Stats/Stats.tsx
|
1273
|
-
import
|
1350
|
+
import React11, { Fragment } from "react";
|
1274
1351
|
import {
|
1275
1352
|
selectConnectionQualityByPeerID,
|
1276
1353
|
selectHMSStats,
|
@@ -1350,7 +1427,7 @@ function VideoTileStats({ videoTrackID, audioTrackID, peerID, isLocal = false })
|
|
1350
1427
|
if (!(audioTrackStats || videoTrackStats)) {
|
1351
1428
|
return null;
|
1352
1429
|
}
|
1353
|
-
return /* @__PURE__ */
|
1430
|
+
return /* @__PURE__ */ React11.createElement(Stats.Root, null, /* @__PURE__ */ React11.createElement("table", null, /* @__PURE__ */ React11.createElement("tbody", null, isLocal ? /* @__PURE__ */ React11.createElement(Fragment, null, /* @__PURE__ */ React11.createElement(
|
1354
1431
|
StatsRow,
|
1355
1432
|
{
|
1356
1433
|
show: isNotNullishAndNot0(availableOutgoingBitrate),
|
@@ -1364,71 +1441,71 @@ function VideoTileStats({ videoTrackID, audioTrackID, peerID, isLocal = false })
|
|
1364
1441
|
return null;
|
1365
1442
|
}
|
1366
1443
|
const layer = stat.rid ? simulcastMapping[stat.rid] : "";
|
1367
|
-
return /* @__PURE__ */
|
1444
|
+
return /* @__PURE__ */ React11.createElement(Fragment, null, layer && /* @__PURE__ */ React11.createElement(StatsRow, { label: layer.toUpperCase(), value: "" }), /* @__PURE__ */ React11.createElement(
|
1368
1445
|
StatsRow,
|
1369
1446
|
{
|
1370
1447
|
show: isNotNullishAndNot0(stat.frameWidth),
|
1371
1448
|
label: "Width",
|
1372
1449
|
value: (_a8 = stat.frameWidth) == null ? void 0 : _a8.toString()
|
1373
1450
|
}
|
1374
|
-
), /* @__PURE__ */
|
1451
|
+
), /* @__PURE__ */ React11.createElement(
|
1375
1452
|
StatsRow,
|
1376
1453
|
{
|
1377
1454
|
show: isNotNullishAndNot0(stat.frameHeight),
|
1378
1455
|
label: "Height",
|
1379
1456
|
value: (_b8 = stat.frameHeight) == null ? void 0 : _b8.toString()
|
1380
1457
|
}
|
1381
|
-
), /* @__PURE__ */
|
1458
|
+
), /* @__PURE__ */ React11.createElement(
|
1382
1459
|
StatsRow,
|
1383
1460
|
{
|
1384
1461
|
show: isNotNullishAndNot0(stat.framesPerSecond),
|
1385
1462
|
label: "FPS",
|
1386
1463
|
value: `${stat.framesPerSecond} ${isNotNullishAndNot0(stat.framesDropped) ? `(${stat.framesDropped} dropped)` : ""}`
|
1387
1464
|
}
|
1388
|
-
), /* @__PURE__ */
|
1465
|
+
), /* @__PURE__ */ React11.createElement(
|
1389
1466
|
StatsRow,
|
1390
1467
|
{
|
1391
1468
|
show: isNotNullish(stat.bitrate),
|
1392
1469
|
label: "Bitrate(V)",
|
1393
1470
|
value: formatBytes(stat.bitrate, "b/s")
|
1394
1471
|
}
|
1395
|
-
), /* @__PURE__ */
|
1396
|
-
})) : /* @__PURE__ */
|
1472
|
+
), /* @__PURE__ */ React11.createElement(Stats.Gap, null));
|
1473
|
+
})) : /* @__PURE__ */ React11.createElement(Fragment, null, /* @__PURE__ */ React11.createElement(
|
1397
1474
|
StatsRow,
|
1398
1475
|
{
|
1399
1476
|
show: isNotNullishAndNot0(videoTrackStats == null ? void 0 : videoTrackStats.frameWidth),
|
1400
1477
|
label: "Width",
|
1401
1478
|
value: (_b7 = videoTrackStats == null ? void 0 : videoTrackStats.frameWidth) == null ? void 0 : _b7.toString()
|
1402
1479
|
}
|
1403
|
-
), /* @__PURE__ */
|
1480
|
+
), /* @__PURE__ */ React11.createElement(
|
1404
1481
|
StatsRow,
|
1405
1482
|
{
|
1406
1483
|
show: isNotNullishAndNot0(videoTrackStats == null ? void 0 : videoTrackStats.frameHeight),
|
1407
1484
|
label: "Height",
|
1408
1485
|
value: (_c = videoTrackStats == null ? void 0 : videoTrackStats.frameHeight) == null ? void 0 : _c.toString()
|
1409
1486
|
}
|
1410
|
-
), /* @__PURE__ */
|
1487
|
+
), /* @__PURE__ */ React11.createElement(
|
1411
1488
|
StatsRow,
|
1412
1489
|
{
|
1413
1490
|
show: isNotNullishAndNot0(videoTrackStats == null ? void 0 : videoTrackStats.framesPerSecond),
|
1414
1491
|
label: "FPS",
|
1415
1492
|
value: `${videoTrackStats == null ? void 0 : videoTrackStats.framesPerSecond} ${isNotNullishAndNot0(videoTrackStats == null ? void 0 : videoTrackStats.framesDropped) ? `(${videoTrackStats == null ? void 0 : videoTrackStats.framesDropped} dropped)` : ""}`
|
1416
1493
|
}
|
1417
|
-
), /* @__PURE__ */
|
1494
|
+
), /* @__PURE__ */ React11.createElement(
|
1418
1495
|
StatsRow,
|
1419
1496
|
{
|
1420
1497
|
show: isNotNullish(videoTrackStats == null ? void 0 : videoTrackStats.bitrate),
|
1421
1498
|
label: "Bitrate(V)",
|
1422
1499
|
value: formatBytes(videoTrackStats == null ? void 0 : videoTrackStats.bitrate, "b/s")
|
1423
1500
|
}
|
1424
|
-
)), /* @__PURE__ */
|
1501
|
+
)), /* @__PURE__ */ React11.createElement(
|
1425
1502
|
StatsRow,
|
1426
1503
|
{
|
1427
1504
|
show: isNotNullish(audioTrackStats == null ? void 0 : audioTrackStats.bitrate),
|
1428
1505
|
label: "Bitrate(A)",
|
1429
1506
|
value: formatBytes(audioTrackStats == null ? void 0 : audioTrackStats.bitrate, "b/s")
|
1430
1507
|
}
|
1431
|
-
), /* @__PURE__ */
|
1508
|
+
), /* @__PURE__ */ React11.createElement(StatsRow, { show: isNotNullish(downlinkScore), label: "Downlink", value: downlinkScore }), /* @__PURE__ */ React11.createElement(StatsRow, { show: isNotNullish(videoTrackStats == null ? void 0 : videoTrackStats.codec), label: "Codec(V)", value: videoTrackStats == null ? void 0 : videoTrackStats.codec }), /* @__PURE__ */ React11.createElement(StatsRow, { show: isNotNullish(audioTrackStats == null ? void 0 : audioTrackStats.codec), label: "Codec(A)", value: audioTrackStats == null ? void 0 : audioTrackStats.codec }), /* @__PURE__ */ React11.createElement(PacketLostAndJitter, { audioTrackStats, videoTrackStats }))));
|
1432
1509
|
}
|
1433
1510
|
var PacketLostAndJitter = ({
|
1434
1511
|
audioTrackStats,
|
@@ -1438,14 +1515,14 @@ var PacketLostAndJitter = ({
|
|
1438
1515
|
const isLocalPeer = (audioTrackStats == null ? void 0 : audioTrackStats.type.includes("outbound")) || (videoTrackStats == null ? void 0 : videoTrackStats.type.includes("outbound"));
|
1439
1516
|
const audioStats = isLocalPeer ? audioTrackStats == null ? void 0 : audioTrackStats.remote : audioTrackStats;
|
1440
1517
|
const videoStats = isLocalPeer ? videoTrackStats == null ? void 0 : videoTrackStats.remote : videoTrackStats;
|
1441
|
-
return /* @__PURE__ */
|
1518
|
+
return /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement(TrackPacketsLostRow, { label: "Packet Loss(V)", stats: videoStats }), /* @__PURE__ */ React11.createElement(TrackPacketsLostRow, { label: "Packet Loss(A)", stats: audioStats }), /* @__PURE__ */ React11.createElement(StatsRow, { show: isNotNullish(videoStats == null ? void 0 : videoStats.jitter), label: "Jitter(V)", value: (_a7 = videoStats == null ? void 0 : videoStats.jitter) == null ? void 0 : _a7.toFixed(4) }), /* @__PURE__ */ React11.createElement(StatsRow, { show: isNotNullish(audioStats == null ? void 0 : audioStats.jitter), label: "Jitter(A)", value: (_b7 = audioStats == null ? void 0 : audioStats.jitter) == null ? void 0 : _b7.toFixed(4) }));
|
1442
1519
|
};
|
1443
1520
|
var TrackPacketsLostRow = ({
|
1444
1521
|
stats,
|
1445
1522
|
label
|
1446
1523
|
}) => {
|
1447
1524
|
const packetsLostRate = `${(stats == null ? void 0 : stats.packetsLostRate) ? stats.packetsLostRate.toFixed(2) : 0}/s`;
|
1448
|
-
return /* @__PURE__ */
|
1525
|
+
return /* @__PURE__ */ React11.createElement(
|
1449
1526
|
StatsRow,
|
1450
1527
|
{
|
1451
1528
|
show: isNotNullishAndNot0(stats == null ? void 0 : stats.packetsLost),
|
@@ -1460,10 +1537,10 @@ var RawStatsRow = ({
|
|
1460
1537
|
tooltip = "",
|
1461
1538
|
show = true
|
1462
1539
|
}) => {
|
1463
|
-
const statsLabel = /* @__PURE__ */
|
1464
|
-
return /* @__PURE__ */
|
1540
|
+
const statsLabel = /* @__PURE__ */ React11.createElement(Stats.Label, { css: { fontWeight: !value ? "$semiBold" : "$regular" } }, label);
|
1541
|
+
return /* @__PURE__ */ React11.createElement(React11.Fragment, null, show ? /* @__PURE__ */ React11.createElement(Stats.Row, null, tooltip ? /* @__PURE__ */ React11.createElement(Tooltip, { side: "top", title: tooltip }, statsLabel) : statsLabel, value === "" ? /* @__PURE__ */ React11.createElement(Stats.Value, null) : /* @__PURE__ */ React11.createElement(Stats.Value, null, value)) : null);
|
1465
1542
|
};
|
1466
|
-
var StatsRow =
|
1543
|
+
var StatsRow = React11.memo(RawStatsRow);
|
1467
1544
|
function isNotNullishAndNot0(value) {
|
1468
1545
|
return isNotNullish(value) && value !== 0;
|
1469
1546
|
}
|
@@ -1542,7 +1619,7 @@ var RadioGroup = {
|
|
1542
1619
|
};
|
1543
1620
|
|
1544
1621
|
// src/Toast/Toast.tsx
|
1545
|
-
import
|
1622
|
+
import React12 from "react";
|
1546
1623
|
import * as ToastPrimitives from "@radix-ui/react-toast";
|
1547
1624
|
import { CrossIcon as CrossIcon2 } from "@100mslive/react-icons";
|
1548
1625
|
var getToastVariant = (base) => {
|
@@ -1633,7 +1710,7 @@ var ToastViewport = styled(ToastPrimitives.Viewport, {
|
|
1633
1710
|
zIndex: 1e3
|
1634
1711
|
});
|
1635
1712
|
var DefaultClose = ({ css: css2 }) => {
|
1636
|
-
return /* @__PURE__ */
|
1713
|
+
return /* @__PURE__ */ React12.createElement(ToastClose, { css: css2, asChild: true }, /* @__PURE__ */ React12.createElement(IconButton, null, /* @__PURE__ */ React12.createElement(CrossIcon2, null)));
|
1637
1714
|
};
|
1638
1715
|
var HMSToast = (_a7) => {
|
1639
1716
|
var _b7 = _a7, {
|
@@ -1651,7 +1728,7 @@ var HMSToast = (_a7) => {
|
|
1651
1728
|
"action",
|
1652
1729
|
"inlineAction"
|
1653
1730
|
]);
|
1654
|
-
return /* @__PURE__ */
|
1731
|
+
return /* @__PURE__ */ React12.createElement(React12.Fragment, null, /* @__PURE__ */ React12.createElement(ToastRoot, __spreadValues({}, props), /* @__PURE__ */ React12.createElement(ToastTitle, null, /* @__PURE__ */ React12.createElement(Flex, { align: "center", css: { gap: "$4", flex: "1 1 0", minWidth: 0 } }, icon ? /* @__PURE__ */ React12.createElement(Box, { css: { w: "$10", h: "$10", alignSelf: "start", mt: "$2" } }, icon) : null, /* @__PURE__ */ React12.createElement(Text, { variant: "sub1", css: { c: "inherit", wordBreak: "break-word" } }, title)), isClosable ? /* @__PURE__ */ React12.createElement(DefaultClose, null) : null, !isClosable && inlineAction && action ? /* @__PURE__ */ React12.createElement(ToastAction, { altText: `${title}Action` }, action) : null), description ? /* @__PURE__ */ React12.createElement(ToastDescription, null, /* @__PURE__ */ React12.createElement(Text, { variant: "body1", css: { fontWeight: "$regular", c: "$on_surface_medium" } }, description)) : null, !inlineAction && action ? /* @__PURE__ */ React12.createElement(ToastAction, { altText: `${title}Action`, css: { mt: "$10" } }, action) : null));
|
1655
1732
|
};
|
1656
1733
|
var Toast = {
|
1657
1734
|
Provider: ToastPrimitives.Provider,
|
@@ -1665,7 +1742,7 @@ var Toast = {
|
|
1665
1742
|
};
|
1666
1743
|
|
1667
1744
|
// src/Accordion/Accordion.tsx
|
1668
|
-
import
|
1745
|
+
import React13 from "react";
|
1669
1746
|
import * as BaseAccordion from "@radix-ui/react-accordion";
|
1670
1747
|
import { ChevronUpIcon } from "@100mslive/react-icons";
|
1671
1748
|
var StyledAccordion = styled(BaseAccordion.Root, {});
|
@@ -1717,14 +1794,14 @@ var StyledChevron = styled(ChevronUpIcon, {
|
|
1717
1794
|
});
|
1718
1795
|
var AccordionRoot = StyledAccordion;
|
1719
1796
|
var AccordionItem = StyledItem;
|
1720
|
-
var AccordionHeader =
|
1797
|
+
var AccordionHeader = React13.forwardRef((_a7, forwardedRef) => {
|
1721
1798
|
var _b7 = _a7, { children, iconStyles, css: css2 } = _b7, props = __objRest(_b7, ["children", "iconStyles", "css"]);
|
1722
|
-
return /* @__PURE__ */
|
1799
|
+
return /* @__PURE__ */ React13.createElement(StyledHeader, { css: css2 }, /* @__PURE__ */ React13.createElement(StyledTrigger3, __spreadProps(__spreadValues({}, props), { ref: forwardedRef }), children, /* @__PURE__ */ React13.createElement(StyledChevron, { "aria-hidden": true, css: iconStyles })));
|
1723
1800
|
});
|
1724
|
-
var AccordionContent =
|
1801
|
+
var AccordionContent = React13.forwardRef(
|
1725
1802
|
(_a7, forwardedRef) => {
|
1726
1803
|
var _b7 = _a7, { children, contentStyles } = _b7, props = __objRest(_b7, ["children", "contentStyles"]);
|
1727
|
-
return /* @__PURE__ */
|
1804
|
+
return /* @__PURE__ */ React13.createElement(StyledContent3, __spreadProps(__spreadValues({}, props), { ref: forwardedRef }), /* @__PURE__ */ React13.createElement(Box, { css: contentStyles }, children));
|
1728
1805
|
}
|
1729
1806
|
);
|
1730
1807
|
|
@@ -1918,14 +1995,14 @@ var Tabs = {
|
|
1918
1995
|
};
|
1919
1996
|
|
1920
1997
|
// src/QRCode/QRCode.tsx
|
1921
|
-
import
|
1998
|
+
import React14 from "react";
|
1922
1999
|
import { QRCodeSVG } from "qrcode.react";
|
1923
2000
|
var QRCode = (props) => {
|
1924
|
-
return /* @__PURE__ */
|
2001
|
+
return /* @__PURE__ */ React14.createElement(QRCodeSVG, __spreadValues({ style: { width: "100%", height: "100%" } }, props));
|
1925
2002
|
};
|
1926
2003
|
|
1927
2004
|
// src/Link/Link.tsx
|
1928
|
-
import
|
2005
|
+
import React15 from "react";
|
1929
2006
|
import * as icons from "@100mslive/react-icons";
|
1930
2007
|
var LinkComponent = styled("a", {
|
1931
2008
|
textDecoration: "none",
|
@@ -1951,9 +2028,9 @@ var LinkComponent = styled("a", {
|
|
1951
2028
|
});
|
1952
2029
|
var Link = (_a7) => {
|
1953
2030
|
var _b7 = _a7, { iconSide = "left", icon, color = "primary", children } = _b7, rest = __objRest(_b7, ["iconSide", "icon", "color", "children"]);
|
1954
|
-
const Icon2 = icon ? icons[icon] :
|
1955
|
-
const renderedIcon = icon ? /* @__PURE__ */
|
1956
|
-
return /* @__PURE__ */
|
2031
|
+
const Icon2 = icon ? icons[icon] : React15.Fragment;
|
2032
|
+
const renderedIcon = icon ? /* @__PURE__ */ React15.createElement(Flex, { as: "span" }, /* @__PURE__ */ React15.createElement(Icon2, { height: 13.33, width: 13.33 }), " ") : null;
|
2033
|
+
return /* @__PURE__ */ React15.createElement(LinkComponent, __spreadProps(__spreadValues({}, rest), { color }), iconSide === "left" && renderedIcon, /* @__PURE__ */ React15.createElement(Text, { as: "span", variant: "body2", css: { color: "inherit" } }, children), iconSide === "right" && renderedIcon);
|
1957
2034
|
};
|
1958
2035
|
|
1959
2036
|
// src/Collapsible/Collapsible.tsx
|
@@ -1987,18 +2064,18 @@ var Collapsible = {
|
|
1987
2064
|
};
|
1988
2065
|
|
1989
2066
|
// src/Prebuilt/App.tsx
|
1990
|
-
import
|
2067
|
+
import React58, { Suspense as Suspense2, useEffect as useEffect28, useRef as useRef10 } from "react";
|
1991
2068
|
import { BrowserRouter, MemoryRouter, Navigate, Route, Routes, useParams as useParams5 } from "react-router-dom";
|
1992
2069
|
import {
|
1993
2070
|
HMSReactiveStore,
|
1994
2071
|
HMSRoomProvider,
|
1995
2072
|
selectIsConnectedToRoom as selectIsConnectedToRoom6,
|
1996
|
-
useHMSActions as
|
1997
|
-
useHMSStore as
|
2073
|
+
useHMSActions as useHMSActions18,
|
2074
|
+
useHMSStore as useHMSStore26
|
1998
2075
|
} from "@100mslive/react-sdk";
|
1999
2076
|
|
2000
2077
|
// src/Prebuilt/components/AppData/AppData.jsx
|
2001
|
-
import
|
2078
|
+
import React16, { useEffect as useEffect4 } from "react";
|
2002
2079
|
import {
|
2003
2080
|
HMSRoomState,
|
2004
2081
|
selectAvailableRoleNames,
|
@@ -2084,7 +2161,7 @@ var useUserPreferences = (key, defaultPreference) => {
|
|
2084
2161
|
|
2085
2162
|
// src/Prebuilt/components/AppData/useSidepane.js
|
2086
2163
|
import { useCallback as useCallback3 } from "react";
|
2087
|
-
import { selectAppData, useHMSActions, useHMSStore as useHMSStore2, useHMSVanillaStore } from "@100mslive/react-sdk";
|
2164
|
+
import { selectAppData, useHMSActions, useHMSStore as useHMSStore2, useHMSVanillaStore as useHMSVanillaStore2 } from "@100mslive/react-sdk";
|
2088
2165
|
|
2089
2166
|
// src/Prebuilt/common/constants.js
|
2090
2167
|
import { parsedUserAgent } from "@100mslive/react-sdk";
|
@@ -2182,7 +2259,7 @@ var useSidepaneState = () => {
|
|
2182
2259
|
};
|
2183
2260
|
var useSidepaneToggle = (sidepaneType) => {
|
2184
2261
|
const hmsActions = useHMSActions();
|
2185
|
-
const vanillaStore =
|
2262
|
+
const vanillaStore = useHMSVanillaStore2();
|
2186
2263
|
const toggleSidepane = useCallback3(() => {
|
2187
2264
|
const isOpen = vanillaStore.getState(selectAppData(APP_DATA.sidePane)) === sidepaneType;
|
2188
2265
|
hmsActions.setAppData(APP_DATA.sidePane, !isOpen ? sidepaneType : "");
|
@@ -2208,7 +2285,7 @@ import {
|
|
2208
2285
|
selectVideoTrackByPeerID,
|
2209
2286
|
useHMSActions as useHMSActions2,
|
2210
2287
|
useHMSStore as useHMSStore3,
|
2211
|
-
useHMSVanillaStore as
|
2288
|
+
useHMSVanillaStore as useHMSVanillaStore3
|
2212
2289
|
} from "@100mslive/react-sdk";
|
2213
2290
|
var useUISettings = (uiSettingKey) => {
|
2214
2291
|
const uiSettings = useHMSStore3(selectAppDataByPath(APP_DATA.uiSettings, uiSettingKey));
|
@@ -2288,7 +2365,7 @@ var useSetAppDataByKey = (appDataKey) => {
|
|
2288
2365
|
};
|
2289
2366
|
var useSetAppData = ({ key1, key2 }) => {
|
2290
2367
|
const actions = useHMSActions2();
|
2291
|
-
const store =
|
2368
|
+
const store = useHMSVanillaStore3();
|
2292
2369
|
const [, setPreferences] = useUserPreferences(UserPreferencesKeys.UI_SETTINGS);
|
2293
2370
|
const setValue = useCallback4(
|
2294
2371
|
(value) => {
|
@@ -2353,7 +2430,7 @@ var initialAppData = {
|
|
2353
2430
|
[APP_DATA.activeScreensharePeerId]: "",
|
2354
2431
|
[APP_DATA.disableNotificiations]: false
|
2355
2432
|
};
|
2356
|
-
var AppData =
|
2433
|
+
var AppData = React16.memo(({ appDetails, tokenEndpoint }) => {
|
2357
2434
|
const hmsActions = useHMSActions3();
|
2358
2435
|
const isConnected = useHMSStore4(selectIsConnectedToRoom);
|
2359
2436
|
const sidePane = useSidepaneState();
|
@@ -2363,27 +2440,27 @@ var AppData = React15.memo(({ appDetails, tokenEndpoint }) => {
|
|
2363
2440
|
const rolesMap = useHMSStore4(selectRolesMap);
|
2364
2441
|
const localPeerRole = useHMSStore4(selectLocalPeerRoleName);
|
2365
2442
|
const appData = useHMSStore4(selectFullAppData);
|
2366
|
-
|
2443
|
+
useEffect4(() => {
|
2367
2444
|
if (!isConnected && sidePane && sidePane !== SIDE_PANE_OPTIONS.PARTICIPANTS) {
|
2368
2445
|
resetSidePane();
|
2369
2446
|
}
|
2370
2447
|
}, [isConnected, sidePane, resetSidePane]);
|
2371
|
-
|
2448
|
+
useEffect4(() => {
|
2372
2449
|
hmsActions.initAppData(__spreadValues(__spreadValues({}, initialAppData), appData));
|
2373
2450
|
hmsActions.setFrameworkInfo({
|
2374
2451
|
type: "react-web",
|
2375
2452
|
isPrebuilt: true,
|
2376
|
-
version:
|
2453
|
+
version: React16.version
|
2377
2454
|
});
|
2378
2455
|
}, [hmsActions]);
|
2379
|
-
|
2456
|
+
useEffect4(() => {
|
2380
2457
|
const uiSettings = preferences || {};
|
2381
2458
|
const updatedSettings = __spreadProps(__spreadValues({}, uiSettings), {
|
2382
2459
|
[UI_SETTINGS.uiViewMode]: uiSettings.uiViewMode || UI_MODE_GRID
|
2383
2460
|
});
|
2384
2461
|
hmsActions.setAppData(APP_DATA.uiSettings, updatedSettings, true);
|
2385
2462
|
}, [preferences, hmsActions]);
|
2386
|
-
|
2463
|
+
useEffect4(() => {
|
2387
2464
|
const appData2 = {
|
2388
2465
|
[APP_DATA.tokenEndpoint]: tokenEndpoint,
|
2389
2466
|
[APP_DATA.appConfig]: getAppDetails(appDetails)
|
@@ -2392,19 +2469,19 @@ var AppData = React15.memo(({ appDetails, tokenEndpoint }) => {
|
|
2392
2469
|
hmsActions.setAppData([key], appData2[key]);
|
2393
2470
|
}
|
2394
2471
|
}, [appDetails, tokenEndpoint, hmsActions]);
|
2395
|
-
|
2472
|
+
useEffect4(() => {
|
2396
2473
|
if (!preferences.subscribedNotifications) {
|
2397
2474
|
return;
|
2398
2475
|
}
|
2399
2476
|
hmsActions.setAppData(APP_DATA.subscribedNotifications, preferences.subscribedNotifications, true);
|
2400
2477
|
}, [preferences.subscribedNotifications, hmsActions]);
|
2401
|
-
|
2478
|
+
useEffect4(() => {
|
2402
2479
|
if (localPeerRole) {
|
2403
2480
|
const config2 = normalizeAppPolicyConfig(roleNames, rolesMap);
|
2404
2481
|
hmsActions.setAppData(APP_DATA.appLayout, config2[localPeerRole]);
|
2405
2482
|
}
|
2406
2483
|
}, [roleNames, rolesMap, localPeerRole, hmsActions]);
|
2407
|
-
return /* @__PURE__ */
|
2484
|
+
return /* @__PURE__ */ React16.createElement(ResetStreamingStart, null);
|
2408
2485
|
});
|
2409
2486
|
var ResetStreamingStart = () => {
|
2410
2487
|
const { isHLSRunning, isRTMPRunning, isBrowserRecordingOn } = useRecordingStreaming();
|
@@ -2416,19 +2493,19 @@ var ResetStreamingStart = () => {
|
|
2416
2493
|
const [rtmpStarted, setRTMPStarted] = useSetAppDataByKey(APP_DATA.rtmpStarted);
|
2417
2494
|
const toggleStreaming = useSidepaneToggle(SIDE_PANE_OPTIONS.STREAMING);
|
2418
2495
|
const isStreamingOpen = useIsSidepaneTypeOpen(SIDE_PANE_OPTIONS.STREAMING);
|
2419
|
-
|
2496
|
+
useEffect4(() => {
|
2420
2497
|
if (isBrowserRecordingOn && recordingStarted) {
|
2421
2498
|
setRecordingStarted(false);
|
2422
2499
|
}
|
2423
2500
|
}, [isBrowserRecordingOn, recordingStarted, setRecordingStarted]);
|
2424
|
-
|
2501
|
+
useEffect4(() => {
|
2425
2502
|
if (roomState === HMSRoomState.Disconnected) {
|
2426
2503
|
setHLSStarted(false);
|
2427
2504
|
setRecordingStarted(false);
|
2428
2505
|
setRTMPStarted(false);
|
2429
2506
|
}
|
2430
2507
|
}, [roomState, setHLSStarted, setRTMPStarted, setRecordingStarted]);
|
2431
|
-
|
2508
|
+
useEffect4(() => {
|
2432
2509
|
if (isHLSRunning || hlsError) {
|
2433
2510
|
if (hlsStarted) {
|
2434
2511
|
setHLSStarted(false);
|
@@ -2438,7 +2515,7 @@ var ResetStreamingStart = () => {
|
|
2438
2515
|
}
|
2439
2516
|
}
|
2440
2517
|
}, [isHLSRunning, hlsStarted, setHLSStarted, hlsError, isStreamingOpen, toggleStreaming]);
|
2441
|
-
|
2518
|
+
useEffect4(() => {
|
2442
2519
|
if (isRTMPRunning || rtmpError || isBrowserRecordingOn) {
|
2443
2520
|
if (rtmpStarted) {
|
2444
2521
|
setRTMPStarted(false);
|
@@ -2452,12 +2529,12 @@ var ResetStreamingStart = () => {
|
|
2452
2529
|
};
|
2453
2530
|
|
2454
2531
|
// src/Prebuilt/components/AuthToken.jsx
|
2455
|
-
import
|
2532
|
+
import React20, { useEffect as useEffect5, useState as useState4 } from "react";
|
2456
2533
|
import { useHMSActions as useHMSActions4 } from "@100mslive/react-sdk";
|
2457
2534
|
|
2458
2535
|
// src/Prebuilt/AppContext.tsx
|
2459
|
-
import
|
2460
|
-
var HMSPrebuiltContext =
|
2536
|
+
import React17, { useContext } from "react";
|
2537
|
+
var HMSPrebuiltContext = React17.createContext({
|
2461
2538
|
roomCode: "",
|
2462
2539
|
userName: "",
|
2463
2540
|
userId: "",
|
@@ -2474,15 +2551,21 @@ var useHMSPrebuiltContext = () => {
|
|
2474
2551
|
};
|
2475
2552
|
|
2476
2553
|
// src/Prebuilt/primitives/DialogContent.jsx
|
2477
|
-
import
|
2554
|
+
import React19, { useRef as useRef4 } from "react";
|
2478
2555
|
import { CheckIcon, CloudUploadIcon, CrossIcon as CrossIcon3 } from "@100mslive/react-icons";
|
2556
|
+
|
2557
|
+
// src/Prebuilt/components/PrebuiltDialogPortal.tsx
|
2558
|
+
import React18 from "react";
|
2559
|
+
var PrebuiltDialogPortal = ({ children }) => /* @__PURE__ */ React18.createElement(Dialog.Portal, { container: document.getElementById("prebuilt-container") }, children);
|
2560
|
+
|
2561
|
+
// src/Prebuilt/primitives/DialogContent.jsx
|
2479
2562
|
var DialogContent = (_a7) => {
|
2480
2563
|
var _b7 = _a7, { Icon: Icon2, title, closeable = true, children, css: css2, iconCSS = {} } = _b7, props = __objRest(_b7, ["Icon", "title", "closeable", "children", "css", "iconCSS"]);
|
2481
|
-
return /* @__PURE__ */
|
2564
|
+
return /* @__PURE__ */ React19.createElement(PrebuiltDialogPortal, null, /* @__PURE__ */ React19.createElement(Dialog.Overlay, null), /* @__PURE__ */ React19.createElement(Dialog.Content, __spreadValues({ css: __spreadValues({ width: "min(600px, 100%)" }, css2) }, props), /* @__PURE__ */ React19.createElement(Dialog.Title, null, /* @__PURE__ */ React19.createElement(Flex, { justify: "between" }, /* @__PURE__ */ React19.createElement(Flex, { align: "center", css: { mb: "$1" } }, Icon2 ? /* @__PURE__ */ React19.createElement(Box, { css: __spreadValues({ mr: "$2", color: "$on_primary_high" }, iconCSS) }, /* @__PURE__ */ React19.createElement(Icon2, null)) : null, /* @__PURE__ */ React19.createElement(Text, { variant: "h6", inline: true }, title)), closeable && /* @__PURE__ */ React19.createElement(Dialog.DefaultClose, { "data-testid": "dialoge_cross_icon" }))), /* @__PURE__ */ React19.createElement(HorizontalDivider, { css: { mt: "0.8rem" } }), /* @__PURE__ */ React19.createElement(Box, null, children)));
|
2482
2565
|
};
|
2483
2566
|
var ErrorDialog = (_a7) => {
|
2484
2567
|
var _b7 = _a7, { open = true, onOpenChange, title, children } = _b7, props = __objRest(_b7, ["open", "onOpenChange", "title", "children"]);
|
2485
|
-
return /* @__PURE__ */
|
2568
|
+
return /* @__PURE__ */ React19.createElement(Dialog.Root, { open, onOpenChange }, /* @__PURE__ */ React19.createElement(
|
2486
2569
|
DialogContent,
|
2487
2570
|
__spreadValues({
|
2488
2571
|
Icon: CrossIcon3,
|
@@ -2493,10 +2576,10 @@ var ErrorDialog = (_a7) => {
|
|
2493
2576
|
closeable: false,
|
2494
2577
|
iconCSS: { color: "$alert_error_default" }
|
2495
2578
|
}, props),
|
2496
|
-
/* @__PURE__ */
|
2579
|
+
/* @__PURE__ */ React19.createElement(Box, { css: { mt: "$lg" } }, children)
|
2497
2580
|
));
|
2498
2581
|
};
|
2499
|
-
var RequestDialog = ({ open = true, onOpenChange, title, body, actionText = "Accept", onAction, Icon: Icon2 }) => /* @__PURE__ */
|
2582
|
+
var RequestDialog = ({ open = true, onOpenChange, title, body, actionText = "Accept", onAction, Icon: Icon2 }) => /* @__PURE__ */ React19.createElement(Dialog.Root, { open, onOpenChange }, /* @__PURE__ */ React19.createElement(PrebuiltDialogPortal, null, /* @__PURE__ */ React19.createElement(Dialog.Overlay, null), /* @__PURE__ */ React19.createElement(Dialog.Content, { css: { width: "min(400px,80%)", p: "$10" } }, /* @__PURE__ */ React19.createElement(Dialog.Title, { css: { p: 0, display: "flex", flexDirection: "row", gap: "$md" } }, Icon2 ? Icon2 : null, /* @__PURE__ */ React19.createElement(Text, { variant: "h6" }, title)), typeof body === "string" ? /* @__PURE__ */ React19.createElement(
|
2500
2583
|
Text,
|
2501
2584
|
{
|
2502
2585
|
variant: "md",
|
@@ -2508,7 +2591,7 @@ var RequestDialog = ({ open = true, onOpenChange, title, body, actionText = "Acc
|
|
2508
2591
|
}
|
2509
2592
|
},
|
2510
2593
|
body
|
2511
|
-
) : /* @__PURE__ */
|
2594
|
+
) : /* @__PURE__ */ React19.createElement(Box, { css: { mt: "$4", mb: "$10" } }, body), /* @__PURE__ */ React19.createElement(Flex, { justify: "center", align: "center", css: { width: "100%", gap: "$md" } }, /* @__PURE__ */ React19.createElement(Box, { css: { width: "50%" } }, /* @__PURE__ */ React19.createElement(Dialog.Close, { css: { width: "100%" } }, /* @__PURE__ */ React19.createElement(Button, { variant: "standard", outlined: true, css: { width: "100%" } }, "Cancel"))), /* @__PURE__ */ React19.createElement(Box, { css: { width: "50%" } }, /* @__PURE__ */ React19.createElement(Button, { variant: "primary", css: { width: "100%" }, onClick: onAction }, actionText))))));
|
2512
2595
|
var DialogRow = ({ children, breakSm = false, css: css2, justify = "between" }) => {
|
2513
2596
|
let finalCSS = {
|
2514
2597
|
margin: "$10 0",
|
@@ -2523,7 +2606,7 @@ var DialogRow = ({ children, breakSm = false, css: css2, justify = "between" })
|
|
2523
2606
|
if (css2) {
|
2524
2607
|
finalCSS = Object.assign(finalCSS, css2);
|
2525
2608
|
}
|
2526
|
-
return /* @__PURE__ */
|
2609
|
+
return /* @__PURE__ */ React19.createElement(Flex, { align: "center", justify, css: finalCSS }, children);
|
2527
2610
|
};
|
2528
2611
|
var DialogCol = (_a7) => {
|
2529
2612
|
var _b7 = _a7, { children, breakSm = false, css: css2, align = "center", justify = "between" } = _b7, props = __objRest(_b7, ["children", "breakSm", "css", "align", "justify"]);
|
@@ -2539,20 +2622,20 @@ var DialogCol = (_a7) => {
|
|
2539
2622
|
if (css2) {
|
2540
2623
|
finalCSS = Object.assign(finalCSS, css2);
|
2541
2624
|
}
|
2542
|
-
return /* @__PURE__ */
|
2625
|
+
return /* @__PURE__ */ React19.createElement(Flex, __spreadValues({ direction: "column", align, justify, css: finalCSS }, props), children);
|
2543
2626
|
};
|
2544
2627
|
var DialogSelect = (_a7) => {
|
2545
2628
|
var _b7 = _a7, { title, options, keyField, labelField, selected, onChange } = _b7, props = __objRest(_b7, ["title", "options", "keyField", "labelField", "selected", "onChange"]);
|
2546
|
-
return /* @__PURE__ */
|
2629
|
+
return /* @__PURE__ */ React19.createElement(DialogRow, { breakSm: true }, /* @__PURE__ */ React19.createElement(Label3, null, title), /* @__PURE__ */ React19.createElement(Select.Root, __spreadValues({ "data-testid": `dialog_select_${title}`, css: { width: "70%", "@sm": { width: "100%" } } }, props), /* @__PURE__ */ React19.createElement(Select.DefaultDownIcon, null), /* @__PURE__ */ React19.createElement(Select.Select, { onChange: (e) => onChange(e.target.value), value: selected, css: { width: "100%" } }, options.map((option) => {
|
2547
2630
|
const id = keyField ? option[keyField] : option;
|
2548
2631
|
const label = labelField ? option[labelField] : option;
|
2549
|
-
return /* @__PURE__ */
|
2632
|
+
return /* @__PURE__ */ React19.createElement("option", { value: id, key: id }, label);
|
2550
2633
|
}))));
|
2551
2634
|
};
|
2552
2635
|
var DialogInputFile = (_a7) => {
|
2553
2636
|
var _b7 = _a7, { value, onChange, placeholder, disabled, type } = _b7, props = __objRest(_b7, ["value", "onChange", "placeholder", "disabled", "type"]);
|
2554
|
-
const inputRef =
|
2555
|
-
return /* @__PURE__ */
|
2637
|
+
const inputRef = useRef4();
|
2638
|
+
return /* @__PURE__ */ React19.createElement(
|
2556
2639
|
DialogCol,
|
2557
2640
|
{
|
2558
2641
|
breakSm: true,
|
@@ -2573,7 +2656,7 @@ var DialogInputFile = (_a7) => {
|
|
2573
2656
|
},
|
2574
2657
|
gap: "8"
|
2575
2658
|
},
|
2576
|
-
/* @__PURE__ */
|
2659
|
+
/* @__PURE__ */ React19.createElement(
|
2577
2660
|
IconButton,
|
2578
2661
|
{
|
2579
2662
|
variant: "standard",
|
@@ -2587,7 +2670,7 @@ var DialogInputFile = (_a7) => {
|
|
2587
2670
|
}
|
2588
2671
|
}
|
2589
2672
|
},
|
2590
|
-
/* @__PURE__ */
|
2673
|
+
/* @__PURE__ */ React19.createElement(
|
2591
2674
|
CloudUploadIcon,
|
2592
2675
|
{
|
2593
2676
|
style: {
|
@@ -2597,7 +2680,7 @@ var DialogInputFile = (_a7) => {
|
|
2597
2680
|
}
|
2598
2681
|
)
|
2599
2682
|
),
|
2600
|
-
/* @__PURE__ */
|
2683
|
+
/* @__PURE__ */ React19.createElement(Flex, { direction: "row" }, /* @__PURE__ */ React19.createElement(
|
2601
2684
|
Input,
|
2602
2685
|
__spreadValues({
|
2603
2686
|
ref: inputRef,
|
@@ -2609,7 +2692,7 @@ var DialogInputFile = (_a7) => {
|
|
2609
2692
|
type,
|
2610
2693
|
hidden: true
|
2611
2694
|
}, props)
|
2612
|
-
), /* @__PURE__ */
|
2695
|
+
), /* @__PURE__ */ React19.createElement(
|
2613
2696
|
IconButton,
|
2614
2697
|
{
|
2615
2698
|
variant: "standard",
|
@@ -2623,20 +2706,20 @@ var DialogInputFile = (_a7) => {
|
|
2623
2706
|
}
|
2624
2707
|
}
|
2625
2708
|
},
|
2626
|
-
/* @__PURE__ */
|
2709
|
+
/* @__PURE__ */ React19.createElement(Text, { variant: "md" }, placeholder)
|
2627
2710
|
))
|
2628
2711
|
);
|
2629
2712
|
};
|
2630
2713
|
|
2631
2714
|
// src/Prebuilt/components/AuthToken.jsx
|
2632
|
-
var AuthToken =
|
2715
|
+
var AuthToken = React20.memo(({ authTokenByRoomCodeEndpoint, defaultAuthToken }) => {
|
2633
2716
|
const hmsActions = useHMSActions4();
|
2634
2717
|
const tokenEndpoint = useTokenEndpoint();
|
2635
2718
|
const { roomCode, userId } = useHMSPrebuiltContext();
|
2636
2719
|
const [error, setError] = useState4({ title: "", body: "" });
|
2637
2720
|
let authToken = defaultAuthToken;
|
2638
2721
|
const [, setAuthTokenInAppData] = useSetAppDataByKey(APP_DATA.authToken);
|
2639
|
-
|
2722
|
+
useEffect5(() => {
|
2640
2723
|
if (authToken) {
|
2641
2724
|
setAuthTokenInAppData(authToken);
|
2642
2725
|
return;
|
@@ -2647,7 +2730,7 @@ var AuthToken = React18.memo(({ authTokenByRoomCodeEndpoint, defaultAuthToken })
|
|
2647
2730
|
hmsActions.getAuthTokenByRoomCode({ roomCode, userId }, { endpoint: authTokenByRoomCodeEndpoint }).then((token) => setAuthTokenInAppData(token)).catch((error2) => setError(convertError(error2)));
|
2648
2731
|
}, [hmsActions, tokenEndpoint, authToken, authTokenByRoomCodeEndpoint, setAuthTokenInAppData, roomCode, userId]);
|
2649
2732
|
if (error.title) {
|
2650
|
-
return /* @__PURE__ */
|
2733
|
+
return /* @__PURE__ */ React20.createElement(ErrorDialog, { title: error.title }, error.body);
|
2651
2734
|
}
|
2652
2735
|
return null;
|
2653
2736
|
});
|
@@ -2691,11 +2774,11 @@ var convertError = (error) => {
|
|
2691
2774
|
var Link2 = styled("a", {
|
2692
2775
|
color: "#2f80e1"
|
2693
2776
|
});
|
2694
|
-
var ErrorWithSupportLink = (errorMessage) => /* @__PURE__ */
|
2777
|
+
var ErrorWithSupportLink = (errorMessage) => /* @__PURE__ */ React20.createElement("div", null, errorMessage, " If you think this is a mistake on our side, please create", " ", /* @__PURE__ */ React20.createElement(Link2, { target: "_blank", href: "https://github.com/100mslive/100ms-web/issues", rel: "noreferrer" }, "an issue"), " ", "or reach out over", " ", /* @__PURE__ */ React20.createElement(Link2, { target: "_blank", href: "https://discord.com/invite/kGdmszyzq2", rel: "noreferrer" }, "Discord"), ".");
|
2695
2778
|
var AuthToken_default = AuthToken;
|
2696
2779
|
|
2697
2780
|
// src/Prebuilt/components/ErrorBoundary.jsx
|
2698
|
-
import
|
2781
|
+
import React21, { Component } from "react";
|
2699
2782
|
import { CopyIcon as CopyIcon2 } from "@100mslive/react-icons";
|
2700
2783
|
var ErrorBoundary = class extends Component {
|
2701
2784
|
constructor(props) {
|
@@ -2711,7 +2794,7 @@ var ErrorBoundary = class extends Component {
|
|
2711
2794
|
}
|
2712
2795
|
render() {
|
2713
2796
|
if (this.state.errorInfo) {
|
2714
|
-
return /* @__PURE__ */
|
2797
|
+
return /* @__PURE__ */ React21.createElement(
|
2715
2798
|
Flex,
|
2716
2799
|
{
|
2717
2800
|
align: "center",
|
@@ -2724,7 +2807,7 @@ var ErrorBoundary = class extends Component {
|
|
2724
2807
|
backgroundColor: "$background_default"
|
2725
2808
|
}
|
2726
2809
|
},
|
2727
|
-
/* @__PURE__ */
|
2810
|
+
/* @__PURE__ */ React21.createElement(Box, { css: { position: "relative", overflow: "hidden", r: "$3", height: "100%", width: "100%" } }, /* @__PURE__ */ React21.createElement(
|
2728
2811
|
Flex,
|
2729
2812
|
{
|
2730
2813
|
direction: "column",
|
@@ -2735,8 +2818,8 @@ var ErrorBoundary = class extends Component {
|
|
2735
2818
|
left: 0
|
2736
2819
|
}
|
2737
2820
|
},
|
2738
|
-
/* @__PURE__ */
|
2739
|
-
/* @__PURE__ */
|
2821
|
+
/* @__PURE__ */ React21.createElement("div", { style: { margin: "1.5rem", width: "100%" } }, /* @__PURE__ */ React21.createElement(Text, null, "Something went wrong"), /* @__PURE__ */ React21.createElement(Text, null, "Message: $", this.state.error), /* @__PURE__ */ React21.createElement("br", null), ErrorWithSupportLink(`Please reload to see if it works.`)),
|
2822
|
+
/* @__PURE__ */ React21.createElement(Flex, null, /* @__PURE__ */ React21.createElement(Tooltip, { title: "Reload page" }, /* @__PURE__ */ React21.createElement(
|
2740
2823
|
Button,
|
2741
2824
|
{
|
2742
2825
|
onClick: () => {
|
@@ -2746,7 +2829,7 @@ var ErrorBoundary = class extends Component {
|
|
2746
2829
|
"data-testid": "join_again_btn"
|
2747
2830
|
},
|
2748
2831
|
"Reload"
|
2749
|
-
)), /* @__PURE__ */
|
2832
|
+
)), /* @__PURE__ */ React21.createElement(Tooltip, { title: "Copy error details to clipboard" }, /* @__PURE__ */ React21.createElement(
|
2750
2833
|
Button,
|
2751
2834
|
{
|
2752
2835
|
onClick: () => {
|
@@ -2762,11 +2845,11 @@ var ErrorBoundary = class extends Component {
|
|
2762
2845
|
css: { mx: "$8" },
|
2763
2846
|
"data-testid": "join_again_btn"
|
2764
2847
|
},
|
2765
|
-
/* @__PURE__ */
|
2848
|
+
/* @__PURE__ */ React21.createElement(CopyIcon2, null),
|
2766
2849
|
" ",
|
2767
2850
|
this.state.isErrorCopied ? "Copied" : "Copy Details"
|
2768
2851
|
))),
|
2769
|
-
/* @__PURE__ */
|
2852
|
+
/* @__PURE__ */ React21.createElement("details", { style: { whiteSpace: "pre-wrap", margin: "1.5rem" } }, /* @__PURE__ */ React21.createElement(Text, null, this.state.error && this.state.error.toString()), /* @__PURE__ */ React21.createElement("br", null), /* @__PURE__ */ React21.createElement(Text, null, JSON.stringify(this.state.errorInfo)))
|
2770
2853
|
))
|
2771
2854
|
);
|
2772
2855
|
}
|
@@ -2775,15 +2858,15 @@ var ErrorBoundary = class extends Component {
|
|
2775
2858
|
};
|
2776
2859
|
|
2777
2860
|
// src/Prebuilt/components/FullPageProgress.jsx
|
2778
|
-
import
|
2779
|
-
var FullPageProgress = ({ loaderColor = "$primary_default", text = "", css: css2 = {} }) => /* @__PURE__ */
|
2861
|
+
import React22 from "react";
|
2862
|
+
var FullPageProgress = ({ loaderColor = "$primary_default", text = "", css: css2 = {} }) => /* @__PURE__ */ React22.createElement(Flex, { direction: "column", justify: "center", align: "center", css: __spreadValues({ size: "100%", color: loaderColor }, css2) }, /* @__PURE__ */ React22.createElement(Loading, { color: "currentColor", size: 100 }), text ? /* @__PURE__ */ React22.createElement(Text, { css: { mt: "$10", color: "$on_surface_high" } }, text) : null);
|
2780
2863
|
var FullPageProgress_default = FullPageProgress;
|
2781
2864
|
|
2782
2865
|
// src/Prebuilt/components/init/Init.jsx
|
2783
|
-
import
|
2866
|
+
import React23, { useEffect as useEffect7 } from "react";
|
2784
2867
|
|
2785
2868
|
// src/Prebuilt/services/FeatureFlags.jsx
|
2786
|
-
import { useEffect as
|
2869
|
+
import { useEffect as useEffect6 } from "react";
|
2787
2870
|
import { selectRoomID, useHMSStore as useHMSStore5 } from "@100mslive/react-sdk";
|
2788
2871
|
var FeatureFlags = class {
|
2789
2872
|
static init(roomId) {
|
@@ -2810,7 +2893,7 @@ __publicField(FeatureFlags, "enableStatsForNerds", define_process_env_default.RE
|
|
2810
2893
|
__publicField(FeatureFlags, "enableWhiteboard", define_process_env_default.REACT_APP_ENABLE_WHITEBOARD && define_process_env_default.REACT_APP_PUSHER_APP_KEY && define_process_env_default.REACT_APP_PUSHER_AUTHENDPOINT);
|
2811
2894
|
function FeatureFlagsInit() {
|
2812
2895
|
const roomId = useHMSStore5(selectRoomID);
|
2813
|
-
|
2896
|
+
useEffect6(() => {
|
2814
2897
|
if (roomId) {
|
2815
2898
|
FeatureFlags.init(roomId);
|
2816
2899
|
}
|
@@ -2821,10 +2904,10 @@ function FeatureFlagsInit() {
|
|
2821
2904
|
// src/Prebuilt/components/init/Init.jsx
|
2822
2905
|
var Init = () => {
|
2823
2906
|
const { toggleTheme } = useTheme();
|
2824
|
-
|
2907
|
+
useEffect7(() => {
|
2825
2908
|
window.toggleUiTheme = toggleTheme;
|
2826
2909
|
}, [toggleTheme]);
|
2827
|
-
|
2910
|
+
useEffect7(() => {
|
2828
2911
|
function resetHeight() {
|
2829
2912
|
var _a7;
|
2830
2913
|
document.body.style.height = `${((_a7 = window.visualViewport) == null ? void 0 : _a7.height) || window.innerHeight}px`;
|
@@ -2835,17 +2918,17 @@ var Init = () => {
|
|
2835
2918
|
window.removeEventListener("resize", resetHeight);
|
2836
2919
|
};
|
2837
2920
|
}, []);
|
2838
|
-
return /* @__PURE__ */
|
2921
|
+
return /* @__PURE__ */ React23.createElement(FeatureFlagsInit, null);
|
2839
2922
|
};
|
2840
2923
|
|
2841
2924
|
// src/Prebuilt/components/Input/KeyboardInputManager.js
|
2842
|
-
import { useEffect as
|
2925
|
+
import { useEffect as useEffect8 } from "react";
|
2843
2926
|
import {
|
2844
2927
|
selectAppData as selectAppData3,
|
2845
2928
|
selectIsLocalAudioEnabled,
|
2846
2929
|
selectIsLocalVideoEnabled,
|
2847
2930
|
useHMSActions as useHMSActions5,
|
2848
|
-
useHMSVanillaStore as
|
2931
|
+
useHMSVanillaStore as useHMSVanillaStore4
|
2849
2932
|
} from "@100mslive/react-sdk";
|
2850
2933
|
var isEvenListenersAttached = false;
|
2851
2934
|
var _actions, _store, _toggleAudio, _toggleVideo, _hideSidepane, _toggleStatsForNerds, _toggleHlsStats, _keyDownHandler, _bind, _unbind;
|
@@ -2932,9 +3015,9 @@ _keyDownHandler = new WeakMap();
|
|
2932
3015
|
_bind = new WeakMap();
|
2933
3016
|
_unbind = new WeakMap();
|
2934
3017
|
var KeyboardHandler = () => {
|
2935
|
-
const store =
|
3018
|
+
const store = useHMSVanillaStore4();
|
2936
3019
|
const actions = useHMSActions5();
|
2937
|
-
|
3020
|
+
useEffect8(() => {
|
2938
3021
|
const keyboardManager = new KeyboardInputManager(store, actions);
|
2939
3022
|
keyboardManager.bindAllShortcuts();
|
2940
3023
|
return keyboardManager.unbindAllShortcuts;
|
@@ -2943,7 +3026,7 @@ var KeyboardHandler = () => {
|
|
2943
3026
|
};
|
2944
3027
|
|
2945
3028
|
// src/Prebuilt/components/Notifications/Notifications.jsx
|
2946
|
-
import
|
3029
|
+
import React32, { useCallback as useCallback8, useEffect as useEffect17 } from "react";
|
2947
3030
|
import { useNavigate as useNavigate2, useParams as useParams2 } from "react-router-dom";
|
2948
3031
|
import {
|
2949
3032
|
HMSNotificationTypes as HMSNotificationTypes7,
|
@@ -2953,15 +3036,15 @@ import {
|
|
2953
3036
|
useCustomEvent,
|
2954
3037
|
useHMSNotifications as useHMSNotifications7,
|
2955
3038
|
useHMSStore as useHMSStore7,
|
2956
|
-
useHMSVanillaStore as
|
3039
|
+
useHMSVanillaStore as useHMSVanillaStore5
|
2957
3040
|
} from "@100mslive/react-sdk";
|
2958
3041
|
|
2959
3042
|
// src/Prebuilt/provider/roomLayoutProvider/index.tsx
|
2960
|
-
import
|
3043
|
+
import React24 from "react";
|
2961
3044
|
import merge from "lodash.merge";
|
2962
3045
|
|
2963
3046
|
// src/Prebuilt/provider/roomLayoutProvider/hooks/useFetchRoomLayout.ts
|
2964
|
-
import { useCallback as useCallback5, useEffect as
|
3047
|
+
import { useCallback as useCallback5, useEffect as useEffect9, useRef as useRef5, useState as useState5 } from "react";
|
2965
3048
|
|
2966
3049
|
// src/Prebuilt/provider/roomLayoutProvider/constants/index.ts
|
2967
3050
|
import { JoinForm_JoinBtnType } from "@100mslive/types-prebuilt/elements/join_form";
|
@@ -3030,8 +3113,8 @@ var useFetchRoomLayout = ({
|
|
3030
3113
|
authToken = ""
|
3031
3114
|
}) => {
|
3032
3115
|
const [layout, setLayout] = useState5(void 0);
|
3033
|
-
const layoutResp =
|
3034
|
-
const isFetchInProgress =
|
3116
|
+
const layoutResp = useRef5();
|
3117
|
+
const isFetchInProgress = useRef5(false);
|
3035
3118
|
const updateRoomLayoutForRole = useCallback5((role) => {
|
3036
3119
|
var _a7;
|
3037
3120
|
if (!layoutResp.current) {
|
@@ -3042,7 +3125,7 @@ var useFetchRoomLayout = ({
|
|
3042
3125
|
setLayout(layout2);
|
3043
3126
|
}
|
3044
3127
|
}, []);
|
3045
|
-
|
3128
|
+
useEffect9(() => {
|
3046
3129
|
(() => __async(void 0, null, function* () {
|
3047
3130
|
var _a7, _b7;
|
3048
3131
|
if (isFetchInProgress.current || !authToken) {
|
@@ -3078,7 +3161,7 @@ var useFetchRoomLayout = ({
|
|
3078
3161
|
};
|
3079
3162
|
|
3080
3163
|
// src/Prebuilt/provider/roomLayoutProvider/index.tsx
|
3081
|
-
var RoomLayoutContext =
|
3164
|
+
var RoomLayoutContext = React24.createContext(void 0);
|
3082
3165
|
var RoomLayoutProvider = ({
|
3083
3166
|
children,
|
3084
3167
|
roomLayoutEndpoint,
|
@@ -3087,19 +3170,19 @@ var RoomLayoutProvider = ({
|
|
3087
3170
|
const authToken = useAuthToken();
|
3088
3171
|
const { layout, updateRoomLayoutForRole } = useFetchRoomLayout({ authToken, endpoint: roomLayoutEndpoint });
|
3089
3172
|
const mergedLayout = authToken && layout ? merge(layout, overrideLayout) : layout;
|
3090
|
-
return /* @__PURE__ */
|
3173
|
+
return /* @__PURE__ */ React24.createElement(RoomLayoutContext.Provider, { value: { layout: mergedLayout, updateRoomLayoutForRole } }, children);
|
3091
3174
|
};
|
3092
3175
|
var useRoomLayout = () => {
|
3093
3176
|
var _a7;
|
3094
|
-
return (_a7 =
|
3177
|
+
return (_a7 = React24.useContext(RoomLayoutContext)) == null ? void 0 : _a7.layout;
|
3095
3178
|
};
|
3096
3179
|
var useUpdateRoomLayout = () => {
|
3097
3180
|
var _a7;
|
3098
|
-
return (_a7 =
|
3181
|
+
return (_a7 = React24.useContext(RoomLayoutContext)) == null ? void 0 : _a7.updateRoomLayoutForRole;
|
3099
3182
|
};
|
3100
3183
|
|
3101
3184
|
// src/Prebuilt/components/Toast/ToastConfig.jsx
|
3102
|
-
import
|
3185
|
+
import React25, { useCallback as useCallback6 } from "react";
|
3103
3186
|
import { selectPeerByID, useHMSActions as useHMSActions6, useHMSStore as useHMSStore6 } from "@100mslive/react-sdk";
|
3104
3187
|
import {
|
3105
3188
|
ChatUnreadIcon,
|
@@ -3109,15 +3192,15 @@ import {
|
|
3109
3192
|
PeopleRemoveIcon,
|
3110
3193
|
PoorConnectivityIcon
|
3111
3194
|
} from "@100mslive/react-icons";
|
3112
|
-
var ChatAction =
|
3195
|
+
var ChatAction = React25.forwardRef((_, ref) => {
|
3113
3196
|
const toggleChat = useSidepaneToggle(SIDE_PANE_OPTIONS.CHAT);
|
3114
3197
|
const isChatOpen = useIsSidepaneTypeOpen(SIDE_PANE_OPTIONS.CHAT);
|
3115
3198
|
if (isChatOpen) {
|
3116
3199
|
return null;
|
3117
3200
|
}
|
3118
|
-
return /* @__PURE__ */
|
3201
|
+
return /* @__PURE__ */ React25.createElement(Button, { outlined: true, as: "div", variant: "standard", css: { w: "max-content" }, onClick: toggleChat, ref }, "Open Chat");
|
3119
3202
|
});
|
3120
|
-
var HandRaiseAction =
|
3203
|
+
var HandRaiseAction = React25.forwardRef(({ id = "", isSingleHandRaise = true }, ref) => {
|
3121
3204
|
var _a7, _b7, _c;
|
3122
3205
|
const hmsActions = useHMSActions6();
|
3123
3206
|
const toggleSidepane = useSidepaneToggle(SIDE_PANE_OPTIONS.PARTICIPANTS);
|
@@ -3139,7 +3222,7 @@ var HandRaiseAction = React23.forwardRef(({ id = "", isSingleHandRaise = true },
|
|
3139
3222
|
if (isSingleHandRaise && (!peer || !off_stage_roles.includes(peer.roleName))) {
|
3140
3223
|
return null;
|
3141
3224
|
}
|
3142
|
-
return /* @__PURE__ */
|
3225
|
+
return /* @__PURE__ */ React25.createElement(Button, { outlined: true, as: "div", variant: "standard", css: { w: "max-content" }, onClick: onClickHandler, ref }, isSingleHandRaise ? bring_to_stage_label : "View");
|
3143
3226
|
});
|
3144
3227
|
var ToastConfig = {
|
3145
3228
|
PEER_LIST: {
|
@@ -3148,18 +3231,18 @@ var ToastConfig = {
|
|
3148
3231
|
if (notification.data.length === 1) {
|
3149
3232
|
return {
|
3150
3233
|
title: `${(_a7 = notification.data[0]) == null ? void 0 : _a7.name} joined`,
|
3151
|
-
icon: /* @__PURE__ */
|
3234
|
+
icon: /* @__PURE__ */ React25.createElement(PeopleAddIcon, null)
|
3152
3235
|
};
|
3153
3236
|
}
|
3154
3237
|
return {
|
3155
3238
|
title: `${(_b7 = notification.data[notification.data.length - 1]) == null ? void 0 : _b7.name} and ${notification.data.length - 1} others joined`,
|
3156
|
-
icon: /* @__PURE__ */
|
3239
|
+
icon: /* @__PURE__ */ React25.createElement(PeopleAddIcon, null)
|
3157
3240
|
};
|
3158
3241
|
},
|
3159
3242
|
multiple: (notifications) => {
|
3160
3243
|
return {
|
3161
3244
|
title: `${notifications[0].data.name} and ${notifications.length - 1} others joined`,
|
3162
|
-
icon: /* @__PURE__ */
|
3245
|
+
icon: /* @__PURE__ */ React25.createElement(PeopleAddIcon, null)
|
3163
3246
|
};
|
3164
3247
|
}
|
3165
3248
|
},
|
@@ -3168,13 +3251,13 @@ var ToastConfig = {
|
|
3168
3251
|
var _a7;
|
3169
3252
|
return {
|
3170
3253
|
title: `${(_a7 = notification.data) == null ? void 0 : _a7.name} joined`,
|
3171
|
-
icon: /* @__PURE__ */
|
3254
|
+
icon: /* @__PURE__ */ React25.createElement(PeopleAddIcon, null)
|
3172
3255
|
};
|
3173
3256
|
},
|
3174
3257
|
multiple: function(notifications) {
|
3175
3258
|
return {
|
3176
3259
|
title: `${notifications[notifications.length - 1].data.name} and ${notifications.length - 1} others joined`,
|
3177
|
-
icon: /* @__PURE__ */
|
3260
|
+
icon: /* @__PURE__ */ React25.createElement(PeopleAddIcon, null)
|
3178
3261
|
};
|
3179
3262
|
}
|
3180
3263
|
},
|
@@ -3183,13 +3266,13 @@ var ToastConfig = {
|
|
3183
3266
|
var _a7;
|
3184
3267
|
return {
|
3185
3268
|
title: `${(_a7 = notification.data) == null ? void 0 : _a7.name} left`,
|
3186
|
-
icon: /* @__PURE__ */
|
3269
|
+
icon: /* @__PURE__ */ React25.createElement(PeopleRemoveIcon, null)
|
3187
3270
|
};
|
3188
3271
|
},
|
3189
3272
|
multiple: function(notifications) {
|
3190
3273
|
return {
|
3191
3274
|
title: `${notifications[notifications.length - 1].data.name} and ${notifications.length - 1} others left`,
|
3192
|
-
icon: /* @__PURE__ */
|
3275
|
+
icon: /* @__PURE__ */ React25.createElement(PeopleRemoveIcon, null)
|
3193
3276
|
};
|
3194
3277
|
}
|
3195
3278
|
},
|
@@ -3198,8 +3281,8 @@ var ToastConfig = {
|
|
3198
3281
|
var _a7, _b7;
|
3199
3282
|
return {
|
3200
3283
|
title: `${(_a7 = notification.data) == null ? void 0 : _a7.name} raised hand`,
|
3201
|
-
icon: /* @__PURE__ */
|
3202
|
-
action: /* @__PURE__ */
|
3284
|
+
icon: /* @__PURE__ */ React25.createElement(HandIcon, null),
|
3285
|
+
action: /* @__PURE__ */ React25.createElement(HandRaiseAction, { id: (_b7 = notification.data) == null ? void 0 : _b7.id })
|
3203
3286
|
};
|
3204
3287
|
},
|
3205
3288
|
multiple: (notifications) => {
|
@@ -3210,8 +3293,8 @@ var ToastConfig = {
|
|
3210
3293
|
})).size;
|
3211
3294
|
return {
|
3212
3295
|
title: `${(_a7 = notifications[notifications.length - 1].data) == null ? void 0 : _a7.name} ${count > 1 ? `${count} and others` : ""} raised hand`,
|
3213
|
-
icon: /* @__PURE__ */
|
3214
|
-
action: /* @__PURE__ */
|
3296
|
+
icon: /* @__PURE__ */ React25.createElement(HandIcon, null),
|
3297
|
+
action: /* @__PURE__ */ React25.createElement(HandRaiseAction, { isSingleHandRaise: false })
|
3215
3298
|
};
|
3216
3299
|
}
|
3217
3300
|
},
|
@@ -3220,15 +3303,15 @@ var ToastConfig = {
|
|
3220
3303
|
var _a7;
|
3221
3304
|
return {
|
3222
3305
|
title: `New message from ${(_a7 = notification.data) == null ? void 0 : _a7.senderName}`,
|
3223
|
-
icon: /* @__PURE__ */
|
3224
|
-
action: /* @__PURE__ */
|
3306
|
+
icon: /* @__PURE__ */ React25.createElement(ChatUnreadIcon, null),
|
3307
|
+
action: /* @__PURE__ */ React25.createElement(ChatAction, null)
|
3225
3308
|
};
|
3226
3309
|
},
|
3227
3310
|
multiple: (notifications) => {
|
3228
3311
|
return {
|
3229
3312
|
title: `${notifications.length} new messages`,
|
3230
|
-
icon: /* @__PURE__ */
|
3231
|
-
action: /* @__PURE__ */
|
3313
|
+
icon: /* @__PURE__ */ React25.createElement(ChatUnreadIcon, null),
|
3314
|
+
action: /* @__PURE__ */ React25.createElement(ChatAction, null)
|
3232
3315
|
};
|
3233
3316
|
}
|
3234
3317
|
},
|
@@ -3236,7 +3319,7 @@ var ToastConfig = {
|
|
3236
3319
|
single: () => {
|
3237
3320
|
return {
|
3238
3321
|
title: `You are now connected`,
|
3239
|
-
icon: /* @__PURE__ */
|
3322
|
+
icon: /* @__PURE__ */ React25.createElement(ConnectivityIcon, null),
|
3240
3323
|
variant: "success",
|
3241
3324
|
duration: 3e3
|
3242
3325
|
};
|
@@ -3248,7 +3331,7 @@ var ToastConfig = {
|
|
3248
3331
|
title: `You are offline for now. while we try to reconnect, please check
|
3249
3332
|
your internet connection. ${message}.
|
3250
3333
|
`,
|
3251
|
-
icon: /* @__PURE__ */
|
3334
|
+
icon: /* @__PURE__ */ React25.createElement(PoorConnectivityIcon, null),
|
3252
3335
|
variant: "warning",
|
3253
3336
|
duration: 3e4
|
3254
3337
|
};
|
@@ -3353,11 +3436,11 @@ var ToastBatcher = {
|
|
3353
3436
|
ToastManager.addListener(ToastBatcher.syncUItoast.bind(ToastBatcher));
|
3354
3437
|
|
3355
3438
|
// src/Prebuilt/components/Notifications/AutoplayBlockedModal.jsx
|
3356
|
-
import
|
3439
|
+
import React26 from "react";
|
3357
3440
|
import { useAutoplayError } from "@100mslive/react-sdk";
|
3358
3441
|
function AutoplayBlockedModal() {
|
3359
3442
|
const { error, resetError, unblockAudio } = useAutoplayError();
|
3360
|
-
return /* @__PURE__ */
|
3443
|
+
return /* @__PURE__ */ React26.createElement(
|
3361
3444
|
Dialog.Root,
|
3362
3445
|
{
|
3363
3446
|
open: !!error,
|
@@ -3368,7 +3451,7 @@ function AutoplayBlockedModal() {
|
|
3368
3451
|
resetError();
|
3369
3452
|
}
|
3370
3453
|
},
|
3371
|
-
/* @__PURE__ */
|
3454
|
+
/* @__PURE__ */ React26.createElement(DialogContent, { title: "Permission Error", closeable: false }, /* @__PURE__ */ React26.createElement(DialogRow, null, /* @__PURE__ */ React26.createElement(Text, { variant: "md" }, "The browser wants us to get a confirmation for playing the Audio. Please allow audio to proceed.")), /* @__PURE__ */ React26.createElement(DialogRow, { justify: "end" }, /* @__PURE__ */ React26.createElement(
|
3372
3455
|
Button,
|
3373
3456
|
{
|
3374
3457
|
variant: "primary",
|
@@ -3383,11 +3466,11 @@ function AutoplayBlockedModal() {
|
|
3383
3466
|
}
|
3384
3467
|
|
3385
3468
|
// src/Prebuilt/components/Notifications/InitErrorModal.jsx
|
3386
|
-
import
|
3469
|
+
import React27, { useEffect as useEffect10, useState as useState6 } from "react";
|
3387
3470
|
var InitErrorModal = ({ notification }) => {
|
3388
3471
|
const [showModal, setShowModal] = useState6(false);
|
3389
3472
|
const [info, setInfo] = useState6({ title: "Init Error", description: "" });
|
3390
|
-
|
3473
|
+
useEffect10(() => {
|
3391
3474
|
const data = notification == null ? void 0 : notification.data;
|
3392
3475
|
if (!data || data.action !== "INIT") {
|
3393
3476
|
return;
|
@@ -3407,11 +3490,11 @@ var InitErrorModal = ({ notification }) => {
|
|
3407
3490
|
setInfo({ title, description });
|
3408
3491
|
setShowModal(true);
|
3409
3492
|
}, [notification]);
|
3410
|
-
return /* @__PURE__ */
|
3493
|
+
return /* @__PURE__ */ React27.createElement(ErrorDialog, { open: showModal, onOpenChange: setShowModal, title: info.title }, /* @__PURE__ */ React27.createElement(Text, { variant: "sm", css: { wordBreak: "break-word" } }, info.description, " ", /* @__PURE__ */ React27.createElement("br", null), "Current URL - ", window.location.href));
|
3411
3494
|
};
|
3412
3495
|
|
3413
3496
|
// src/Prebuilt/components/Notifications/PeerNotifications.jsx
|
3414
|
-
import { useEffect as
|
3497
|
+
import { useEffect as useEffect11 } from "react";
|
3415
3498
|
import { HMSNotificationTypes, useHMSNotifications } from "@100mslive/react-sdk";
|
3416
3499
|
var notificationTypes = [
|
3417
3500
|
HMSNotificationTypes.PEER_LIST,
|
@@ -3422,7 +3505,7 @@ var PeerNotifications = () => {
|
|
3422
3505
|
const notification = useHMSNotifications(notificationTypes);
|
3423
3506
|
const isPeerJoinSubscribed = useSubscribedNotifications(SUBSCRIBED_NOTIFICATIONS.PEER_JOINED);
|
3424
3507
|
const isPeerLeftSubscribed = useSubscribedNotifications(SUBSCRIBED_NOTIFICATIONS.PEER_LEFT);
|
3425
|
-
|
3508
|
+
useEffect11(() => {
|
3426
3509
|
if (!(notification == null ? void 0 : notification.data)) {
|
3427
3510
|
return;
|
3428
3511
|
}
|
@@ -3452,7 +3535,7 @@ var PeerNotifications = () => {
|
|
3452
3535
|
};
|
3453
3536
|
|
3454
3537
|
// src/Prebuilt/components/Notifications/PermissionErrorModal.jsx
|
3455
|
-
import
|
3538
|
+
import React28, { useEffect as useEffect12, useState as useState7 } from "react";
|
3456
3539
|
import { useMedia } from "react-use";
|
3457
3540
|
import { HMSNotificationTypes as HMSNotificationTypes2, useHMSNotifications as useHMSNotifications2 } from "@100mslive/react-sdk";
|
3458
3541
|
|
@@ -3468,7 +3551,7 @@ function PermissionErrorModal() {
|
|
3468
3551
|
const [deviceType, setDeviceType] = useState7("");
|
3469
3552
|
const [isSystemError, setIsSystemError] = useState7(false);
|
3470
3553
|
const isMobile = useMedia(config.media.md);
|
3471
|
-
|
3554
|
+
useEffect12(() => {
|
3472
3555
|
var _a7, _b7, _c, _d, _e;
|
3473
3556
|
if (!notification || ((_a7 = notification.data) == null ? void 0 : _a7.code) !== 3001 && ((_b7 = notification.data) == null ? void 0 : _b7.code) !== 3011 || ((_c = notification.data) == null ? void 0 : _c.code) === 3001 && ((_d = notification.data) == null ? void 0 : _d.message.includes("screen"))) {
|
3474
3557
|
return;
|
@@ -3489,15 +3572,15 @@ function PermissionErrorModal() {
|
|
3489
3572
|
}
|
3490
3573
|
setIsSystemError(notification.data.code === 3011);
|
3491
3574
|
}, [notification]);
|
3492
|
-
return deviceType ? /* @__PURE__ */
|
3575
|
+
return deviceType ? /* @__PURE__ */ React28.createElement(Dialog.Root, { open: !!deviceType }, /* @__PURE__ */ React28.createElement(PrebuiltDialogPortal, null, /* @__PURE__ */ React28.createElement(Dialog.Overlay, null), /* @__PURE__ */ React28.createElement(Dialog.Content, { css: { w: "min(380px, 90%)", p: "$8" } }, /* @__PURE__ */ React28.createElement(
|
3493
3576
|
Dialog.Title,
|
3494
3577
|
{
|
3495
3578
|
css: {
|
3496
3579
|
borderBottom: "1px solid $border_default"
|
3497
3580
|
}
|
3498
3581
|
},
|
3499
|
-
isMobile && isIOS ? /* @__PURE__ */
|
3500
|
-
isMobile && isAndroid ? /* @__PURE__ */
|
3582
|
+
isMobile && isIOS ? /* @__PURE__ */ React28.createElement("img", { style: { maxWidth: "100%", maxHeight: "100%" }, src: ios_perm_0_default, alt: "iOS Permission flow" }) : null,
|
3583
|
+
isMobile && isAndroid ? /* @__PURE__ */ React28.createElement(
|
3501
3584
|
"img",
|
3502
3585
|
{
|
3503
3586
|
src: android_perm_1_default,
|
@@ -3505,12 +3588,12 @@ function PermissionErrorModal() {
|
|
3505
3588
|
alt: "Android Permission flow "
|
3506
3589
|
}
|
3507
3590
|
) : null,
|
3508
|
-
/* @__PURE__ */
|
3509
|
-
), /* @__PURE__ */
|
3591
|
+
/* @__PURE__ */ React28.createElement(Text, { variant: "h6" }, "We can't access your ", deviceType)
|
3592
|
+
), /* @__PURE__ */ React28.createElement(Text, { variant: "sm", css: { pt: "$4", pb: "$10", color: "$on_surface_medium" } }, isMobile && isIOS ? 'Enable permissions by reloading this page and clicking "Allow" on the pop-up, or change settings from the address bar.' : null, isMobile && isAndroid ? `To allow other users to see and hear you, click the blocked camera icon in your browser's address bar.` : null, !isMobile ? `Access to ${deviceType} is required. ` : null, isSystemError && !isMobile ? `Enable permissions for ${deviceType}${deviceType === "screen" ? "share" : ""} from sytem settings` : null, !isSystemError && !isMobile ? `Enable permissions for ${deviceType}${deviceType === "screen" ? "share" : ""} from address bar or browser settings.` : null), isMobile && isIOS ? /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement(Button, { onClick: () => window.location.reload(), css: { w: "100%", mb: "$6" } }, "Reload"), /* @__PURE__ */ React28.createElement(Button, { outlined: true, variant: "standard", onClick: () => setDeviceType(""), css: { w: "100%" } }, "Continue anyway")) : null, isMobile && isAndroid ? /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement(Button, { onClick: () => setDeviceType(""), css: { w: "100%", mb: "$6" } }, "I've allowed access"), /* @__PURE__ */ React28.createElement(Button, { outlined: true, variant: "standard", onClick: () => setDeviceType(""), css: { w: "100%" } }, "Continue anyway")) : null, !isMobile ? /* @__PURE__ */ React28.createElement(Flex, { justify: "end", css: { w: "100%" } }, /* @__PURE__ */ React28.createElement(Button, { outlined: true, variant: "standard", onClick: () => setDeviceType("") }, "Dismiss")) : null))) : null;
|
3510
3593
|
}
|
3511
3594
|
|
3512
3595
|
// src/Prebuilt/components/Notifications/ReconnectNotifications.jsx
|
3513
|
-
import
|
3596
|
+
import React29, { useEffect as useEffect13, useState as useState8 } from "react";
|
3514
3597
|
import { HMSNotificationTypes as HMSNotificationTypes3, useHMSNotifications as useHMSNotifications3 } from "@100mslive/react-sdk";
|
3515
3598
|
var notificationTypes2 = [
|
3516
3599
|
HMSNotificationTypes3.RECONNECTED,
|
@@ -3521,7 +3604,7 @@ var notificationId = null;
|
|
3521
3604
|
var ReconnectNotifications = () => {
|
3522
3605
|
const notification = useHMSNotifications3(notificationTypes2);
|
3523
3606
|
const [open, setOpen] = useState8(false);
|
3524
|
-
|
3607
|
+
useEffect13(() => {
|
3525
3608
|
var _a7;
|
3526
3609
|
if ((notification == null ? void 0 : notification.type) === HMSNotificationTypes3.ERROR && ((_a7 = notification == null ? void 0 : notification.data) == null ? void 0 : _a7.isTerminal)) {
|
3527
3610
|
setOpen(false);
|
@@ -3537,7 +3620,7 @@ var ReconnectNotifications = () => {
|
|
3537
3620
|
}, [notification]);
|
3538
3621
|
if (!open)
|
3539
3622
|
return null;
|
3540
|
-
return /* @__PURE__ */
|
3623
|
+
return /* @__PURE__ */ React29.createElement(Dialog.Root, { open, modal: true }, /* @__PURE__ */ React29.createElement(Dialog.Portal, { container: document.getElementById("conferencing") }, /* @__PURE__ */ React29.createElement(Dialog.Overlay, null), /* @__PURE__ */ React29.createElement(
|
3541
3624
|
Dialog.Content,
|
3542
3625
|
{
|
3543
3626
|
css: {
|
@@ -3551,12 +3634,12 @@ var ReconnectNotifications = () => {
|
|
3551
3634
|
animation: "none !important"
|
3552
3635
|
}
|
3553
3636
|
},
|
3554
|
-
/* @__PURE__ */
|
3637
|
+
/* @__PURE__ */ React29.createElement(Flex, { align: "center" }, /* @__PURE__ */ React29.createElement("div", { style: { display: "inline", margin: "0.25rem" } }, /* @__PURE__ */ React29.createElement(Loading, { size: 16 })), /* @__PURE__ */ React29.createElement(Text, { css: { fontSize: "$space$8", color: "$on_surface_high" } }, "You lost your network connection. Trying to reconnect."))
|
3555
3638
|
)));
|
3556
3639
|
};
|
3557
3640
|
|
3558
3641
|
// src/Prebuilt/components/Notifications/TrackBulkUnmuteModal.jsx
|
3559
|
-
import
|
3642
|
+
import React30, { useEffect as useEffect14, useState as useState9 } from "react";
|
3560
3643
|
import { HMSNotificationTypes as HMSNotificationTypes4, useHMSActions as useHMSActions7, useHMSNotifications as useHMSNotifications4 } from "@100mslive/react-sdk";
|
3561
3644
|
import { MicOnIcon } from "@100mslive/react-icons";
|
3562
3645
|
var TrackBulkUnmuteModal = () => {
|
@@ -3567,7 +3650,7 @@ var TrackBulkUnmuteModal = () => {
|
|
3567
3650
|
HMSNotificationTypes4.ROOM_ENDED,
|
3568
3651
|
HMSNotificationTypes4.REMOVED_FROM_ROOM
|
3569
3652
|
]);
|
3570
|
-
|
3653
|
+
useEffect14(() => {
|
3571
3654
|
switch (notification == null ? void 0 : notification.type) {
|
3572
3655
|
case HMSNotificationTypes4.REMOVED_FROM_ROOM:
|
3573
3656
|
case HMSNotificationTypes4.ROOM_ENDED:
|
@@ -3586,7 +3669,7 @@ var TrackBulkUnmuteModal = () => {
|
|
3586
3669
|
return null;
|
3587
3670
|
}
|
3588
3671
|
const { requestedBy: peer, tracks, enabled } = muteNotification;
|
3589
|
-
return /* @__PURE__ */
|
3672
|
+
return /* @__PURE__ */ React30.createElement(
|
3590
3673
|
RequestDialog,
|
3591
3674
|
{
|
3592
3675
|
title: "Track Unmute Request",
|
@@ -3604,7 +3687,7 @@ var TrackBulkUnmuteModal = () => {
|
|
3604
3687
|
};
|
3605
3688
|
|
3606
3689
|
// src/Prebuilt/components/Notifications/TrackNotifications.jsx
|
3607
|
-
import { useEffect as
|
3690
|
+
import { useEffect as useEffect15 } from "react";
|
3608
3691
|
import { HMSNotificationTypes as HMSNotificationTypes5, useHMSNotifications as useHMSNotifications5 } from "@100mslive/react-sdk";
|
3609
3692
|
var notificationTypes3 = [
|
3610
3693
|
HMSNotificationTypes5.TRACK_ADDED,
|
@@ -3614,7 +3697,7 @@ var notificationTypes3 = [
|
|
3614
3697
|
];
|
3615
3698
|
var TrackNotifications = () => {
|
3616
3699
|
const notification = useHMSNotifications5(notificationTypes3);
|
3617
|
-
|
3700
|
+
useEffect15(() => {
|
3618
3701
|
if (notification) {
|
3619
3702
|
console.debug(`[${notification.type}]`, notification);
|
3620
3703
|
}
|
@@ -3623,7 +3706,7 @@ var TrackNotifications = () => {
|
|
3623
3706
|
};
|
3624
3707
|
|
3625
3708
|
// src/Prebuilt/components/Notifications/TrackUnmuteModal.jsx
|
3626
|
-
import
|
3709
|
+
import React31, { useEffect as useEffect16, useState as useState10 } from "react";
|
3627
3710
|
import { HMSNotificationTypes as HMSNotificationTypes6, useHMSActions as useHMSActions8, useHMSNotifications as useHMSNotifications6 } from "@100mslive/react-sdk";
|
3628
3711
|
import { MicOnIcon as MicOnIcon2 } from "@100mslive/react-icons";
|
3629
3712
|
var TrackUnmuteModal = () => {
|
@@ -3634,7 +3717,7 @@ var TrackUnmuteModal = () => {
|
|
3634
3717
|
HMSNotificationTypes6.REMOVED_FROM_ROOM
|
3635
3718
|
]);
|
3636
3719
|
const [muteNotification, setMuteNotification] = useState10(null);
|
3637
|
-
|
3720
|
+
useEffect16(() => {
|
3638
3721
|
switch (notification == null ? void 0 : notification.type) {
|
3639
3722
|
case HMSNotificationTypes6.REMOVED_FROM_ROOM:
|
3640
3723
|
case HMSNotificationTypes6.ROOM_ENDED:
|
@@ -3653,7 +3736,7 @@ var TrackUnmuteModal = () => {
|
|
3653
3736
|
return null;
|
3654
3737
|
}
|
3655
3738
|
const { requestedBy: peer, track, enabled } = muteNotification;
|
3656
|
-
return /* @__PURE__ */
|
3739
|
+
return /* @__PURE__ */ React31.createElement(
|
3657
3740
|
RequestDialog,
|
3658
3741
|
{
|
3659
3742
|
title: "Track Unmute Request",
|
@@ -4162,12 +4245,6 @@ var formatTime = (timeInSeconds) => {
|
|
4162
4245
|
const hour = hours !== 0 ? `${hours < 10 ? "0" : ""}${hours}:` : "";
|
4163
4246
|
return `${hour}${minutes < 10 ? "0" : ""}${minutes}:${seconds < 10 ? "0" : ""}${seconds}`;
|
4164
4247
|
};
|
4165
|
-
var getAttributeBoxSize = (width, height) => {
|
4166
|
-
if (!width || !height) {
|
4167
|
-
return "";
|
4168
|
-
}
|
4169
|
-
return width < 180 || height < 180 ? "small" : "medium";
|
4170
|
-
};
|
4171
4248
|
|
4172
4249
|
// src/Prebuilt/components/Notifications/Notifications.jsx
|
4173
4250
|
function Notifications() {
|
@@ -4179,7 +4256,7 @@ function Notifications() {
|
|
4179
4256
|
const updateRoomLayoutForRole = useUpdateRoomLayout();
|
4180
4257
|
const isNotificationDisabled = useIsNotificationDisabled();
|
4181
4258
|
const { redirectToLeave } = useRedirectToLeave();
|
4182
|
-
const vanillaStore =
|
4259
|
+
const vanillaStore = useHMSVanillaStore5();
|
4183
4260
|
const handleRoleChangeDenied = useCallback8((request) => {
|
4184
4261
|
ToastManager.addToast({
|
4185
4262
|
title: `${request.peerName} denied your request to join the ${request.role.name} role`,
|
@@ -4187,7 +4264,7 @@ function Notifications() {
|
|
4187
4264
|
});
|
4188
4265
|
}, []);
|
4189
4266
|
useCustomEvent({ type: ROLE_CHANGE_DECLINED, onEvent: handleRoleChangeDenied });
|
4190
|
-
|
4267
|
+
useEffect17(() => {
|
4191
4268
|
var _a7, _b7, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
|
4192
4269
|
if (!notification || isNotificationDisabled) {
|
4193
4270
|
return;
|
@@ -4228,7 +4305,7 @@ function Notifications() {
|
|
4228
4305
|
const toastId = ToastManager.addToast({
|
4229
4306
|
title: ((_f = notification.data) == null ? void 0 : _f.message) || "We couldn\u2019t reconnect you. When you\u2019re back online, try joining the room.",
|
4230
4307
|
inlineAction: true,
|
4231
|
-
action: /* @__PURE__ */
|
4308
|
+
action: /* @__PURE__ */ React32.createElement(
|
4232
4309
|
Button,
|
4233
4310
|
{
|
4234
4311
|
onClick: () => {
|
@@ -4294,35 +4371,35 @@ function Notifications() {
|
|
4294
4371
|
if (isNotificationDisabled) {
|
4295
4372
|
return null;
|
4296
4373
|
}
|
4297
|
-
return /* @__PURE__ */
|
4374
|
+
return /* @__PURE__ */ React32.createElement(React32.Fragment, null, /* @__PURE__ */ React32.createElement(TrackUnmuteModal, null), /* @__PURE__ */ React32.createElement(TrackBulkUnmuteModal, null), /* @__PURE__ */ React32.createElement(TrackNotifications, null), roomState === HMSRoomState2.Connected ? /* @__PURE__ */ React32.createElement(PeerNotifications, null) : null, /* @__PURE__ */ React32.createElement(ReconnectNotifications, null), /* @__PURE__ */ React32.createElement(AutoplayBlockedModal, null), /* @__PURE__ */ React32.createElement(PermissionErrorModal, null), /* @__PURE__ */ React32.createElement(InitErrorModal, { notification }));
|
4298
4375
|
}
|
4299
4376
|
|
4300
4377
|
// src/Prebuilt/components/PostLeave.jsx
|
4301
|
-
import
|
4378
|
+
import React39 from "react";
|
4302
4379
|
import { useNavigate as useNavigate3, useParams as useParams3 } from "react-router-dom";
|
4303
4380
|
import { ExitIcon } from "@100mslive/react-icons";
|
4304
4381
|
|
4305
4382
|
// src/Prebuilt/components/Header/Header.tsx
|
4306
|
-
import
|
4383
|
+
import React38 from "react";
|
4307
4384
|
import { useMedia as useMedia3 } from "react-use";
|
4308
4385
|
import { HMSRoomState as HMSRoomState4, selectRoomState as selectRoomState4, useHMSStore as useHMSStore16 } from "@100mslive/react-sdk";
|
4309
4386
|
|
4310
4387
|
// src/Prebuilt/components/Header/HeaderComponents.jsx
|
4311
|
-
import
|
4388
|
+
import React33, { useEffect as useEffect18, useState as useState11 } from "react";
|
4312
4389
|
import { selectDominantSpeaker, useHMSStore as useHMSStore8 } from "@100mslive/react-sdk";
|
4313
4390
|
import { VolumeOneIcon } from "@100mslive/react-icons";
|
4314
4391
|
var SpeakerTag = () => {
|
4315
4392
|
const dominantSpeaker = useHMSStore8(selectDominantSpeaker);
|
4316
|
-
return dominantSpeaker && dominantSpeaker.name && /* @__PURE__ */
|
4393
|
+
return dominantSpeaker && dominantSpeaker.name && /* @__PURE__ */ React33.createElement(
|
4317
4394
|
Flex,
|
4318
4395
|
{
|
4319
4396
|
align: "center",
|
4320
4397
|
justify: "center",
|
4321
4398
|
css: { flex: "1 1 0", color: "$on_primary_high", "@md": { display: "none" } }
|
4322
4399
|
},
|
4323
|
-
/* @__PURE__ */
|
4324
|
-
/* @__PURE__ */
|
4325
|
-
/* @__PURE__ */
|
4400
|
+
/* @__PURE__ */ React33.createElement(VerticalDivider, { css: { ml: "$8" } }),
|
4401
|
+
/* @__PURE__ */ React33.createElement(VolumeOneIcon, null),
|
4402
|
+
/* @__PURE__ */ React33.createElement(Text, { variant: "md", css: __spreadProps(__spreadValues({}, textEllipsis(200)), { ml: "$2" }), title: dominantSpeaker.name }, dominantSpeaker.name)
|
4326
4403
|
);
|
4327
4404
|
};
|
4328
4405
|
var LogoImg = styled("img", {
|
@@ -4338,12 +4415,12 @@ var Logo = () => {
|
|
4338
4415
|
const roomLayout = useRoomLayout();
|
4339
4416
|
const logo = (_a7 = roomLayout == null ? void 0 : roomLayout.logo) == null ? void 0 : _a7.url;
|
4340
4417
|
const [hideImage, setHideImage] = useState11(false);
|
4341
|
-
|
4418
|
+
useEffect18(() => {
|
4342
4419
|
if (hideImage) {
|
4343
4420
|
setHideImage(false);
|
4344
4421
|
}
|
4345
4422
|
}, [logo]);
|
4346
|
-
return logo && !hideImage ? /* @__PURE__ */
|
4423
|
+
return logo && !hideImage ? /* @__PURE__ */ React33.createElement(
|
4347
4424
|
LogoImg,
|
4348
4425
|
{
|
4349
4426
|
src: logo,
|
@@ -4357,7 +4434,7 @@ var Logo = () => {
|
|
4357
4434
|
};
|
4358
4435
|
|
4359
4436
|
// src/Prebuilt/components/Header/StreamActions.tsx
|
4360
|
-
import
|
4437
|
+
import React36, { useCallback as useCallback13, useEffect as useEffect20, useRef as useRef6, useState as useState13 } from "react";
|
4361
4438
|
import { useMedia as useMedia2 } from "react-use";
|
4362
4439
|
import {
|
4363
4440
|
HMSRoomState as HMSRoomState3,
|
@@ -4372,7 +4449,7 @@ import {
|
|
4372
4449
|
import { AlertTriangleIcon, CrossIcon as CrossIcon4, RecordIcon } from "@100mslive/react-icons";
|
4373
4450
|
|
4374
4451
|
// src/Sheet/Sheet.tsx
|
4375
|
-
import
|
4452
|
+
import React34 from "react";
|
4376
4453
|
import * as DialogPrimitive2 from "@radix-ui/react-dialog";
|
4377
4454
|
var SheetRoot = styled(DialogPrimitive2.Root, {
|
4378
4455
|
minHeight: "240px",
|
@@ -4446,10 +4523,10 @@ var StyledContent6 = styled(DialogPrimitive2.Content, {
|
|
4446
4523
|
side: "bottom"
|
4447
4524
|
}
|
4448
4525
|
});
|
4449
|
-
var SheetContent =
|
4526
|
+
var SheetContent = React34.forwardRef(
|
4450
4527
|
(_a7, forwardedRef) => {
|
4451
4528
|
var _b7 = _a7, { children } = _b7, props = __objRest(_b7, ["children"]);
|
4452
|
-
return /* @__PURE__ */
|
4529
|
+
return /* @__PURE__ */ React34.createElement(Dialog.Portal, null, /* @__PURE__ */ React34.createElement(StyledOverlay, null), /* @__PURE__ */ React34.createElement(StyledContent6, __spreadProps(__spreadValues({}, props), { ref: forwardedRef }), children));
|
4453
4530
|
}
|
4454
4531
|
);
|
4455
4532
|
var SheetClose = Dialog.Close;
|
@@ -4469,7 +4546,7 @@ var Sheet = {
|
|
4469
4546
|
};
|
4470
4547
|
|
4471
4548
|
// src/Prebuilt/components/Header/AdditionalRoomState.jsx
|
4472
|
-
import
|
4549
|
+
import React35, { useState as useState12 } from "react";
|
4473
4550
|
import { selectLocalPeerID as selectLocalPeerID3, selectPeerSharingVideoPlaylist, useHMSStore as useHMSStore13, useScreenShare } from "@100mslive/react-sdk";
|
4474
4551
|
import {
|
4475
4552
|
AudioPlayerIcon,
|
@@ -4482,7 +4559,7 @@ import {
|
|
4482
4559
|
} from "@100mslive/react-icons";
|
4483
4560
|
|
4484
4561
|
// src/Prebuilt/plugins/whiteboard/useWhiteboardMetadata.js
|
4485
|
-
import { useCallback as useCallback10, useEffect as
|
4562
|
+
import { useCallback as useCallback10, useEffect as useEffect19, useMemo as useMemo2 } from "react";
|
4486
4563
|
import { selectLocalPeerID as selectLocalPeerID2, selectPeerByCondition, useHMSStore as useHMSStore10 } from "@100mslive/react-sdk";
|
4487
4564
|
|
4488
4565
|
// src/Prebuilt/components/hooks/useMetadata.jsx
|
@@ -4493,12 +4570,12 @@ import {
|
|
4493
4570
|
selectPeerMetadata,
|
4494
4571
|
useHMSActions as useHMSActions9,
|
4495
4572
|
useHMSStore as useHMSStore9,
|
4496
|
-
useHMSVanillaStore as
|
4573
|
+
useHMSVanillaStore as useHMSVanillaStore6
|
4497
4574
|
} from "@100mslive/react-sdk";
|
4498
4575
|
var useMyMetadata = () => {
|
4499
4576
|
const hmsActions = useHMSActions9();
|
4500
4577
|
const localPeerId = useHMSStore9(selectLocalPeerID);
|
4501
|
-
const vanillaStore =
|
4578
|
+
const vanillaStore = useHMSVanillaStore6();
|
4502
4579
|
const metaData = useHMSStore9(selectPeerMetadata(localPeerId));
|
4503
4580
|
const isHandRaised = useHMSStore9(selectHasPeerHandRaised2(localPeerId));
|
4504
4581
|
const update = (updatedFields) => __async(void 0, null, function* () {
|
@@ -4564,7 +4641,7 @@ var useWhiteboardMetadata = () => {
|
|
4564
4641
|
console.error("failed to toggle whiteboard to ", !whiteboardOwner, error);
|
4565
4642
|
}
|
4566
4643
|
}), [whiteboardOwner, updateMetaData, amIWhiteboardOwner]);
|
4567
|
-
|
4644
|
+
useEffect19(() => {
|
4568
4645
|
window.toggleWhiteboard = toggleWhiteboard;
|
4569
4646
|
}, [toggleWhiteboard]);
|
4570
4647
|
return {
|
@@ -4678,7 +4755,7 @@ var AdditionalRoomState = () => {
|
|
4678
4755
|
if (isPlaylistInactive && isAudioshareInactive && !shouldShowScreenShareState && !shouldShowVideoState && !whiteboardOwner) {
|
4679
4756
|
return null;
|
4680
4757
|
}
|
4681
|
-
return /* @__PURE__ */
|
4758
|
+
return /* @__PURE__ */ React35.createElement(Dropdown.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React35.createElement(Dropdown.Trigger, { asChild: true }, /* @__PURE__ */ React35.createElement(
|
4682
4759
|
Flex,
|
4683
4760
|
{
|
4684
4761
|
align: "center",
|
@@ -4691,13 +4768,13 @@ var AdditionalRoomState = () => {
|
|
4691
4768
|
},
|
4692
4769
|
"data-testid": "record_status_dropdown"
|
4693
4770
|
},
|
4694
|
-
!isAudioshareInactive && /* @__PURE__ */
|
4695
|
-
shouldShowScreenShareState && /* @__PURE__ */
|
4696
|
-
shouldShowVideoState && /* @__PURE__ */
|
4697
|
-
!isPlaylistInactive && /* @__PURE__ */
|
4698
|
-
whiteboardOwner && /* @__PURE__ */
|
4699
|
-
/* @__PURE__ */
|
4700
|
-
)), /* @__PURE__ */
|
4771
|
+
!isAudioshareInactive && /* @__PURE__ */ React35.createElement(Tooltip, { title: "Screenshare Audio" }, /* @__PURE__ */ React35.createElement(Flex, { align: "center", css: { color: "$on_primary_high", mx: "$2" } }, /* @__PURE__ */ React35.createElement(MusicIcon, { width: 24, height: 24 }))),
|
4772
|
+
shouldShowScreenShareState && /* @__PURE__ */ React35.createElement(Tooltip, { title: "Screenshare" }, /* @__PURE__ */ React35.createElement(Flex, { align: "center", css: { color: "$on_primary_high", mx: "$2" } }, /* @__PURE__ */ React35.createElement(ShareScreenIcon, { width: 24, height: 24 }))),
|
4773
|
+
shouldShowVideoState && /* @__PURE__ */ React35.createElement(Tooltip, { title: "video playlist" }, /* @__PURE__ */ React35.createElement(Flex, { align: "center", css: { color: "$on_primary_high", mx: "$2" } }, /* @__PURE__ */ React35.createElement(VideoPlayerIcon, { width: 24, height: 24 }))),
|
4774
|
+
!isPlaylistInactive && /* @__PURE__ */ React35.createElement(Tooltip, { title: "Playlist Music" }, /* @__PURE__ */ React35.createElement(Flex, { align: "center", css: { color: "$on_primary_high", mx: "$2" } }, /* @__PURE__ */ React35.createElement(AudioPlayerIcon, { width: 24, height: 24 }))),
|
4775
|
+
whiteboardOwner && /* @__PURE__ */ React35.createElement(Tooltip, { title: "Whiteboard" }, /* @__PURE__ */ React35.createElement(Flex, { align: "center", css: { color: "$on_primary_high", mx: "$2" } }, /* @__PURE__ */ React35.createElement(PencilDrawIcon, { width: 24, height: 24 }))),
|
4776
|
+
/* @__PURE__ */ React35.createElement(Box, { css: { "@lg": { display: "none" }, color: "$on_surface_low" } }, open ? /* @__PURE__ */ React35.createElement(ChevronUpIcon2, null) : /* @__PURE__ */ React35.createElement(ChevronDownIcon2, null))
|
4777
|
+
)), /* @__PURE__ */ React35.createElement(Dropdown.Content, { sideOffset: 5, align: "end", css: { w: "$60" } }, !isPlaylistInactive && /* @__PURE__ */ React35.createElement(Dropdown.Item, { css: { color: "$on_primary_high" } }, /* @__PURE__ */ React35.createElement(AudioPlayerIcon, { width: 24, height: 24 }), /* @__PURE__ */ React35.createElement(Text, { variant: "sm", css: { ml: "$2", flex: "1 1 0" } }, "Playlist is playing"), playlist.peer.isLocal ? /* @__PURE__ */ React35.createElement(
|
4701
4778
|
Text,
|
4702
4779
|
{
|
4703
4780
|
variant: "sm",
|
@@ -4708,7 +4785,7 @@ var AdditionalRoomState = () => {
|
|
4708
4785
|
}
|
4709
4786
|
},
|
4710
4787
|
playlist.selection.playing ? "Pause" : "Play"
|
4711
|
-
) : /* @__PURE__ */
|
4788
|
+
) : /* @__PURE__ */ React35.createElement(
|
4712
4789
|
Text,
|
4713
4790
|
{
|
4714
4791
|
variant: "sm",
|
@@ -4719,7 +4796,7 @@ var AdditionalRoomState = () => {
|
|
4719
4796
|
}
|
4720
4797
|
},
|
4721
4798
|
playlist.track.volume === 0 ? "Unmute" : "Mute"
|
4722
|
-
)), !isAudioshareInactive && /* @__PURE__ */
|
4799
|
+
)), !isAudioshareInactive && /* @__PURE__ */ React35.createElement(Dropdown.Item, { css: { color: "$on_primary_high" } }, /* @__PURE__ */ React35.createElement(MusicIcon, { width: 24, height: 24 }), /* @__PURE__ */ React35.createElement(Text, { variant: "sm", css: { ml: "$2", flex: "1 1 0" } }, "Music is playing"), /* @__PURE__ */ React35.createElement(
|
4723
4800
|
Text,
|
4724
4801
|
{
|
4725
4802
|
variant: "sm",
|
@@ -4730,7 +4807,7 @@ var AdditionalRoomState = () => {
|
|
4730
4807
|
}
|
4731
4808
|
},
|
4732
4809
|
screenshareAudio.muted ? "Unmute" : "Mute"
|
4733
|
-
)), shouldShowScreenShareState && /* @__PURE__ */
|
4810
|
+
)), shouldShowScreenShareState && /* @__PURE__ */ React35.createElement(Dropdown.Item, { css: { color: "$on_primary_high" } }, /* @__PURE__ */ React35.createElement(ShareScreenIcon, { width: 24, height: 24 }), /* @__PURE__ */ React35.createElement(Text, { variant: "sm", css: { ml: "$2", flex: "1 1 0" } }, `Shared by: ${screenSharingPeerId === localPeerID ? "You" : screenSharingPeerName}`)), shouldShowVideoState && /* @__PURE__ */ React35.createElement(Dropdown.Item, { css: { color: "$on_primary_high" } }, /* @__PURE__ */ React35.createElement(VideoPlayerIcon, { width: 24, height: 24 }), /* @__PURE__ */ React35.createElement(Text, { variant: "sm", css: { ml: "$2", flex: "1 1 0" } }, `Shared by: ${peerSharingPlaylist.id === localPeerID ? "You" : peerSharingPlaylist.name}`)), whiteboardOwner && /* @__PURE__ */ React35.createElement(Dropdown.Item, { css: { color: "$on_primary_high" } }, /* @__PURE__ */ React35.createElement(PencilDrawIcon, { width: 24, height: 24 }), /* @__PURE__ */ React35.createElement(Text, { variant: "sm", css: { ml: "$2", flex: "1 1 0" } }, "Whiteboard Owner - ", whiteboardOwner.name, amIWhiteboardOwner && "(You)"), amIWhiteboardOwner && /* @__PURE__ */ React35.createElement(
|
4734
4811
|
Text,
|
4735
4812
|
{
|
4736
4813
|
variant: "sm",
|
@@ -4750,7 +4827,7 @@ var LiveStatus = () => {
|
|
4750
4827
|
const { isHLSRunning, isRTMPRunning } = useRecordingStreaming2();
|
4751
4828
|
const hlsState = useHMSStore14(selectHLSState2);
|
4752
4829
|
const isMobile = useMedia2(config.media.md);
|
4753
|
-
const intervalRef =
|
4830
|
+
const intervalRef = useRef6(null);
|
4754
4831
|
const [liveTime, setLiveTime] = useState13(0);
|
4755
4832
|
const startTimer = useCallback13(() => {
|
4756
4833
|
intervalRef.current = setInterval(() => {
|
@@ -4760,7 +4837,7 @@ var LiveStatus = () => {
|
|
4760
4837
|
}
|
4761
4838
|
}, 1e3);
|
4762
4839
|
}, [hlsState == null ? void 0 : hlsState.running, hlsState == null ? void 0 : hlsState.variants]);
|
4763
|
-
|
4840
|
+
useEffect20(() => {
|
4764
4841
|
if (hlsState == null ? void 0 : hlsState.running) {
|
4765
4842
|
startTimer();
|
4766
4843
|
}
|
@@ -4776,7 +4853,7 @@ var LiveStatus = () => {
|
|
4776
4853
|
if (!isHLSRunning && !isRTMPRunning) {
|
4777
4854
|
return null;
|
4778
4855
|
}
|
4779
|
-
return /* @__PURE__ */
|
4856
|
+
return /* @__PURE__ */ React36.createElement(
|
4780
4857
|
Flex,
|
4781
4858
|
{
|
4782
4859
|
align: "center",
|
@@ -4787,8 +4864,8 @@ var LiveStatus = () => {
|
|
4787
4864
|
borderRadius: "$1"
|
4788
4865
|
}
|
4789
4866
|
},
|
4790
|
-
/* @__PURE__ */
|
4791
|
-
/* @__PURE__ */
|
4867
|
+
/* @__PURE__ */ React36.createElement(Box, { css: { w: "$4", h: "$4", r: "$round", bg: "$alert_error_default", mr: "$2" } }),
|
4868
|
+
/* @__PURE__ */ React36.createElement(Flex, { align: "center", gap: "2" }, /* @__PURE__ */ React36.createElement(Text, { variant: !isMobile ? "button" : "body2" }, "LIVE"), /* @__PURE__ */ React36.createElement(Text, { variant: "caption" }, ((_a7 = hlsState == null ? void 0 : hlsState.variants) == null ? void 0 : _a7.length) > 0 ? formatTime(liveTime) : ""))
|
4792
4869
|
);
|
4793
4870
|
};
|
4794
4871
|
var RecordingStatus = () => {
|
@@ -4803,7 +4880,7 @@ var RecordingStatus = () => {
|
|
4803
4880
|
if (!(isMobile && isRecordingOn))
|
4804
4881
|
return null;
|
4805
4882
|
}
|
4806
|
-
return /* @__PURE__ */
|
4883
|
+
return /* @__PURE__ */ React36.createElement(
|
4807
4884
|
Tooltip,
|
4808
4885
|
{
|
4809
4886
|
boxCss: { zIndex: 1 },
|
@@ -4813,7 +4890,7 @@ var RecordingStatus = () => {
|
|
4813
4890
|
isHLSRecordingOn
|
4814
4891
|
})
|
4815
4892
|
},
|
4816
|
-
/* @__PURE__ */
|
4893
|
+
/* @__PURE__ */ React36.createElement(
|
4817
4894
|
Flex,
|
4818
4895
|
{
|
4819
4896
|
css: {
|
@@ -4821,7 +4898,7 @@ var RecordingStatus = () => {
|
|
4821
4898
|
alignItems: "center"
|
4822
4899
|
}
|
4823
4900
|
},
|
4824
|
-
/* @__PURE__ */
|
4901
|
+
/* @__PURE__ */ React36.createElement(RecordIcon, { width: 24, height: 24 })
|
4825
4902
|
)
|
4826
4903
|
);
|
4827
4904
|
};
|
@@ -4835,7 +4912,7 @@ var StartRecording = () => {
|
|
4835
4912
|
return null;
|
4836
4913
|
}
|
4837
4914
|
if (isBrowserRecordingOn) {
|
4838
|
-
return /* @__PURE__ */
|
4915
|
+
return /* @__PURE__ */ React36.createElement(Popover2.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React36.createElement(Popover2.Trigger, { asChild: true }, /* @__PURE__ */ React36.createElement(Button, { variant: "danger", "data-testid": "stop_recording", icon: true, outlined: true, onClick: () => setOpen(true) }, /* @__PURE__ */ React36.createElement(RecordIcon, null), /* @__PURE__ */ React36.createElement(Text, { as: "span", css: { "@md": { display: "none" }, color: "currentColor" } }, "Stop Recording"))), /* @__PURE__ */ React36.createElement(Popover2.Portal, null, /* @__PURE__ */ React36.createElement(Popover2.Content, { align: "end", sideOffset: 8, css: { w: "$64" } }, /* @__PURE__ */ React36.createElement(Text, { variant: "body1", css: { color: "$on_surface_medium" } }, "Are you sure you want to end the recording?"), /* @__PURE__ */ React36.createElement(
|
4839
4916
|
Button,
|
4840
4917
|
{
|
4841
4918
|
"data-testid": "stop_recording_confirm",
|
@@ -4858,7 +4935,7 @@ var StartRecording = () => {
|
|
4858
4935
|
"Stop"
|
4859
4936
|
))));
|
4860
4937
|
}
|
4861
|
-
return /* @__PURE__ */
|
4938
|
+
return /* @__PURE__ */ React36.createElement(
|
4862
4939
|
Button,
|
4863
4940
|
{
|
4864
4941
|
"data-testid": "start_recording",
|
@@ -4888,21 +4965,21 @@ var StartRecording = () => {
|
|
4888
4965
|
}
|
4889
4966
|
})
|
4890
4967
|
},
|
4891
|
-
recordingStarted ? /* @__PURE__ */
|
4892
|
-
/* @__PURE__ */
|
4968
|
+
recordingStarted ? /* @__PURE__ */ React36.createElement(Loading, { size: 24, color: "currentColor" }) : /* @__PURE__ */ React36.createElement(RecordIcon, null),
|
4969
|
+
/* @__PURE__ */ React36.createElement(Text, { as: "span", css: { "@md": { display: "none" }, color: "currentColor" } }, recordingStarted ? "Starting" : "Start", " Recording")
|
4893
4970
|
);
|
4894
4971
|
};
|
4895
4972
|
var StreamActions = () => {
|
4896
4973
|
const isConnected = useHMSStore14(selectIsConnectedToRoom2);
|
4897
4974
|
const isMobile = useMedia2(config.media.md);
|
4898
4975
|
const roomState = useHMSStore14(selectRoomState3);
|
4899
|
-
return /* @__PURE__ */
|
4976
|
+
return /* @__PURE__ */ React36.createElement(Flex, { align: "center", css: { gap: "$4" } }, /* @__PURE__ */ React36.createElement(AdditionalRoomState, null), !isMobile && /* @__PURE__ */ React36.createElement(Flex, { align: "center", css: { gap: "$4" } }, /* @__PURE__ */ React36.createElement(RecordingStatus, null), roomState !== HMSRoomState3.Preview ? /* @__PURE__ */ React36.createElement(LiveStatus, null) : null), isConnected && !isMobile ? /* @__PURE__ */ React36.createElement(StartRecording, null) : null);
|
4900
4977
|
};
|
4901
4978
|
var StopRecordingInSheet = ({
|
4902
4979
|
onStopRecording,
|
4903
4980
|
onClose
|
4904
4981
|
}) => {
|
4905
|
-
return /* @__PURE__ */
|
4982
|
+
return /* @__PURE__ */ React36.createElement(Sheet.Root, { open: true }, /* @__PURE__ */ React36.createElement(Sheet.Content, null, /* @__PURE__ */ React36.createElement(Sheet.Title, { css: { p: "$10" } }, /* @__PURE__ */ React36.createElement(Flex, { direction: "row", justify: "between", css: { w: "100%", c: "$alert_error_default" } }, /* @__PURE__ */ React36.createElement(Flex, { justify: "start", align: "center", gap: "3" }, /* @__PURE__ */ React36.createElement(AlertTriangleIcon, null), /* @__PURE__ */ React36.createElement(Text, { variant: "h5", css: { c: "$alert_error_default" } }, "Stop Recording")), /* @__PURE__ */ React36.createElement(Sheet.Close, { css: { color: "white" }, onClick: onClose }, /* @__PURE__ */ React36.createElement(CrossIcon4, null)))), /* @__PURE__ */ React36.createElement(HorizontalDivider, null), /* @__PURE__ */ React36.createElement(Box, { as: "div", css: { p: "$10", overflowY: "scroll", maxHeight: "70vh" } }, /* @__PURE__ */ React36.createElement(Text, { variant: "caption", css: { c: "$on_surface_medium", pb: "$8" } }, "Are you sure you want to stop recording? You can\u2019t undo this action."), /* @__PURE__ */ React36.createElement(
|
4906
4983
|
Button,
|
4907
4984
|
{
|
4908
4985
|
variant: "danger",
|
@@ -4916,7 +4993,7 @@ var StopRecordingInSheet = ({
|
|
4916
4993
|
};
|
4917
4994
|
|
4918
4995
|
// src/Prebuilt/components/Header/common.jsx
|
4919
|
-
import
|
4996
|
+
import React37 from "react";
|
4920
4997
|
import {
|
4921
4998
|
DeviceType,
|
4922
4999
|
selectIsLocalVideoEnabled as selectIsLocalVideoEnabled2,
|
@@ -4937,7 +5014,7 @@ var CamaraFlipActions = () => {
|
|
4937
5014
|
if (!videoInput || !(videoInput == null ? void 0 : videoInput.length) || !(localVideoTrack == null ? void 0 : localVideoTrack.facingMode)) {
|
4938
5015
|
return null;
|
4939
5016
|
}
|
4940
|
-
return /* @__PURE__ */
|
5017
|
+
return /* @__PURE__ */ React37.createElement(Box, null, /* @__PURE__ */ React37.createElement(
|
4941
5018
|
IconButton_default,
|
4942
5019
|
{
|
4943
5020
|
disabled: !isVideoOn,
|
@@ -4952,7 +5029,7 @@ var CamaraFlipActions = () => {
|
|
4952
5029
|
}
|
4953
5030
|
})
|
4954
5031
|
},
|
4955
|
-
/* @__PURE__ */
|
5032
|
+
/* @__PURE__ */ React37.createElement(CameraFlipIcon, null)
|
4956
5033
|
));
|
4957
5034
|
};
|
4958
5035
|
var AudioOutputActions = () => {
|
@@ -4964,7 +5041,7 @@ var AudioOutputActions = () => {
|
|
4964
5041
|
if (!shouldShowAudioOutput || !(audioOutputFiltered == null ? void 0 : audioOutputFiltered.length) > 0) {
|
4965
5042
|
return null;
|
4966
5043
|
}
|
4967
|
-
return /* @__PURE__ */
|
5044
|
+
return /* @__PURE__ */ React37.createElement(
|
4968
5045
|
AudioOutputSelectionSheet,
|
4969
5046
|
{
|
4970
5047
|
outputDevices: audioOutput,
|
@@ -4983,11 +5060,11 @@ var AudioOutputActions = () => {
|
|
4983
5060
|
}
|
4984
5061
|
})
|
4985
5062
|
},
|
4986
|
-
/* @__PURE__ */
|
5063
|
+
/* @__PURE__ */ React37.createElement(Box, null, /* @__PURE__ */ React37.createElement(IconButton_default, null, /* @__PURE__ */ React37.createElement(SpeakerIcon, null)))
|
4987
5064
|
);
|
4988
5065
|
};
|
4989
5066
|
var AudioOutputSelectionSheet = ({ outputDevices, outputSelected, onChange, children }) => {
|
4990
|
-
return /* @__PURE__ */
|
5067
|
+
return /* @__PURE__ */ React37.createElement(Sheet.Root, null, /* @__PURE__ */ React37.createElement(Sheet.Trigger, { asChild: true }, children), /* @__PURE__ */ React37.createElement(Sheet.Content, null, /* @__PURE__ */ React37.createElement(Sheet.Title, { css: { py: "$10", px: "$8", alignItems: "center" } }, /* @__PURE__ */ React37.createElement(Flex, { direction: "row", justify: "between", css: { w: "100%" } }, /* @__PURE__ */ React37.createElement(Text, { variant: "h6", css: { display: "flex" } }, "Audio Output"), /* @__PURE__ */ React37.createElement(Sheet.Close, null, /* @__PURE__ */ React37.createElement(IconButton_default, { as: "div", "data-testid": "dialog_cross_icon" }, /* @__PURE__ */ React37.createElement(CrossIcon5, null))))), /* @__PURE__ */ React37.createElement(HorizontalDivider, null), /* @__PURE__ */ React37.createElement(
|
4991
5068
|
Flex,
|
4992
5069
|
{
|
4993
5070
|
direction: "column",
|
@@ -4998,7 +5075,7 @@ var AudioOutputSelectionSheet = ({ outputDevices, outputSelected, onChange, chil
|
|
4998
5075
|
}
|
4999
5076
|
},
|
5000
5077
|
outputDevices.map((audioDevice) => {
|
5001
|
-
return /* @__PURE__ */
|
5078
|
+
return /* @__PURE__ */ React37.createElement(
|
5002
5079
|
SelectWithLabel,
|
5003
5080
|
{
|
5004
5081
|
key: audioDevice.deviceId,
|
@@ -5011,8 +5088,8 @@ var AudioOutputSelectionSheet = ({ outputDevices, outputSelected, onChange, chil
|
|
5011
5088
|
})
|
5012
5089
|
)));
|
5013
5090
|
};
|
5014
|
-
var SelectWithLabel = ({ label, icon = /* @__PURE__ */
|
5015
|
-
return /* @__PURE__ */
|
5091
|
+
var SelectWithLabel = ({ label, icon = /* @__PURE__ */ React37.createElement(React37.Fragment, null), checked, id, onChange }) => {
|
5092
|
+
return /* @__PURE__ */ React37.createElement(
|
5016
5093
|
Flex,
|
5017
5094
|
{
|
5018
5095
|
align: "center",
|
@@ -5024,7 +5101,7 @@ var SelectWithLabel = ({ label, icon = /* @__PURE__ */ React35.createElement(Rea
|
|
5024
5101
|
},
|
5025
5102
|
onClick: onChange
|
5026
5103
|
},
|
5027
|
-
/* @__PURE__ */
|
5104
|
+
/* @__PURE__ */ React37.createElement(
|
5028
5105
|
Label3,
|
5029
5106
|
{
|
5030
5107
|
htmlFor: id,
|
@@ -5042,7 +5119,7 @@ var SelectWithLabel = ({ label, icon = /* @__PURE__ */ React35.createElement(Rea
|
|
5042
5119
|
icon,
|
5043
5120
|
label
|
5044
5121
|
),
|
5045
|
-
checked && /* @__PURE__ */
|
5122
|
+
checked && /* @__PURE__ */ React37.createElement(CheckIcon2, { width: 24, height: 24 })
|
5046
5123
|
);
|
5047
5124
|
};
|
5048
5125
|
|
@@ -5051,9 +5128,9 @@ var Header2 = () => {
|
|
5051
5128
|
const roomState = useHMSStore16(selectRoomState4);
|
5052
5129
|
const isMobile = useMedia3(config.media.md);
|
5053
5130
|
if (roomState !== HMSRoomState4.Connected) {
|
5054
|
-
return /* @__PURE__ */
|
5131
|
+
return /* @__PURE__ */ React38.createElement(React38.Fragment, null);
|
5055
5132
|
}
|
5056
|
-
return /* @__PURE__ */
|
5133
|
+
return /* @__PURE__ */ React38.createElement(Flex, { justify: "between", align: "center", css: { position: "relative", height: "100%" } }, /* @__PURE__ */ React38.createElement(Flex, { align: "center", gap: "2", css: { position: "absolute", left: "$10" } }, /* @__PURE__ */ React38.createElement(Logo, null), /* @__PURE__ */ React38.createElement(SpeakerTag, null), isMobile && /* @__PURE__ */ React38.createElement(Flex, { align: "center", css: { gap: "$4" } }, /* @__PURE__ */ React38.createElement(LiveStatus, null), /* @__PURE__ */ React38.createElement(RecordingStatus, null))), /* @__PURE__ */ React38.createElement(
|
5057
5134
|
Flex,
|
5058
5135
|
{
|
5059
5136
|
align: "center",
|
@@ -5063,8 +5140,8 @@ var Header2 = () => {
|
|
5063
5140
|
gap: "$4"
|
5064
5141
|
}
|
5065
5142
|
},
|
5066
|
-
/* @__PURE__ */
|
5067
|
-
isMobile ? /* @__PURE__ */
|
5143
|
+
/* @__PURE__ */ React38.createElement(StreamActions, null),
|
5144
|
+
isMobile ? /* @__PURE__ */ React38.createElement(React38.Fragment, null, /* @__PURE__ */ React38.createElement(CamaraFlipActions, null), /* @__PURE__ */ React38.createElement(AudioOutputActions, null)) : null
|
5068
5145
|
));
|
5069
5146
|
};
|
5070
5147
|
|
@@ -5075,7 +5152,7 @@ var PostLeave = () => {
|
|
5075
5152
|
const { roomCode } = useHMSPrebuiltContext();
|
5076
5153
|
const { roomId, role } = useParams3();
|
5077
5154
|
const [previewPreference] = useUserPreferences(UserPreferencesKeys.PREVIEW, defaultPreviewPreference);
|
5078
|
-
return /* @__PURE__ */
|
5155
|
+
return /* @__PURE__ */ React39.createElement(Flex, { direction: "column", css: { size: "100%" } }, /* @__PURE__ */ React39.createElement(Box, { css: { h: "$18", "@md": { h: "$17" } }, "data-testid": "header" }, /* @__PURE__ */ React39.createElement(Header2, null)), /* @__PURE__ */ React39.createElement(
|
5079
5156
|
Flex,
|
5080
5157
|
{
|
5081
5158
|
justify: "center",
|
@@ -5083,9 +5160,9 @@ var PostLeave = () => {
|
|
5083
5160
|
align: "center",
|
5084
5161
|
css: { bg: "$background_dim", flex: "1 1 0", position: "relative" }
|
5085
5162
|
},
|
5086
|
-
/* @__PURE__ */
|
5087
|
-
/* @__PURE__ */
|
5088
|
-
/* @__PURE__ */
|
5163
|
+
/* @__PURE__ */ React39.createElement(Text, { variant: "h2", css: { fontWeight: "$semiBold" } }, "\u{1F44B}"),
|
5164
|
+
/* @__PURE__ */ React39.createElement(Text, { variant: "h4", css: { color: "$on_surface_high", fontWeight: "$semiBold", mt: "$12" } }, "You left the room"),
|
5165
|
+
/* @__PURE__ */ React39.createElement(
|
5089
5166
|
Text,
|
5090
5167
|
{
|
5091
5168
|
variant: "body1",
|
@@ -5097,10 +5174,10 @@ var PostLeave = () => {
|
|
5097
5174
|
}
|
5098
5175
|
},
|
5099
5176
|
"Have a nice day",
|
5100
|
-
previewPreference.name && /* @__PURE__ */
|
5177
|
+
previewPreference.name && /* @__PURE__ */ React39.createElement(Box, { as: "span", css: __spreadValues({}, textEllipsis(100)) }, ", ", previewPreference.name),
|
5101
5178
|
"!"
|
5102
5179
|
),
|
5103
|
-
/* @__PURE__ */
|
5180
|
+
/* @__PURE__ */ React39.createElement(Flex, { css: { mt: "$14", gap: "$10", alignItems: "center" } }, /* @__PURE__ */ React39.createElement(Text, { variant: "body1", css: { color: "$on_surface_medium", fontWeight: "$regular" } }, "Left by mistake?"), /* @__PURE__ */ React39.createElement(
|
5104
5181
|
Button,
|
5105
5182
|
{
|
5106
5183
|
onClick: () => {
|
@@ -5112,37 +5189,37 @@ var PostLeave = () => {
|
|
5112
5189
|
},
|
5113
5190
|
"data-testid": "join_again_btn"
|
5114
5191
|
},
|
5115
|
-
/* @__PURE__ */
|
5116
|
-
/* @__PURE__ */
|
5192
|
+
/* @__PURE__ */ React39.createElement(ExitIcon, null),
|
5193
|
+
/* @__PURE__ */ React39.createElement(Text, { css: { ml: "$3", fontWeight: "$semiBold", color: "inherit" } }, "Rejoin")
|
5117
5194
|
))
|
5118
5195
|
));
|
5119
5196
|
};
|
5120
5197
|
var PostLeave_default = PostLeave;
|
5121
5198
|
|
5122
5199
|
// src/Prebuilt/components/Preview/PreviewContainer.tsx
|
5123
|
-
import
|
5200
|
+
import React53 from "react";
|
5124
5201
|
import { useNavigate as useNavigate4, useParams as useParams4 } from "react-router-dom";
|
5125
5202
|
import { useSearchParam } from "react-use";
|
5126
5203
|
|
5127
5204
|
// src/Prebuilt/components/Preview/PreviewJoin.tsx
|
5128
|
-
import
|
5129
|
-
import { useMedia as
|
5205
|
+
import React52, { Fragment as Fragment4, Suspense, useCallback as useCallback16, useEffect as useEffect23, useState as useState16 } from "react";
|
5206
|
+
import { useMedia as useMedia6 } from "react-use";
|
5130
5207
|
import {
|
5131
5208
|
HMSRoomState as HMSRoomState6,
|
5132
5209
|
selectIsLocalVideoEnabled as selectIsLocalVideoEnabled5,
|
5133
5210
|
selectLocalPeer,
|
5134
5211
|
selectRoomState as selectRoomState6,
|
5135
|
-
selectVideoTrackByID as
|
5212
|
+
selectVideoTrackByID as selectVideoTrackByID4,
|
5136
5213
|
useAVToggle as useAVToggle2,
|
5137
|
-
useHMSStore as
|
5214
|
+
useHMSStore as useHMSStore21,
|
5138
5215
|
useParticipants,
|
5139
5216
|
usePreviewJoin,
|
5140
5217
|
useRecordingStreaming as useRecordingStreaming4
|
5141
5218
|
} from "@100mslive/react-sdk";
|
5142
|
-
import { MicOffIcon as
|
5219
|
+
import { MicOffIcon as MicOffIcon2, SettingsIcon as SettingsIcon2 } from "@100mslive/react-icons";
|
5143
5220
|
|
5144
5221
|
// src/Prebuilt/components/AudioVideoToggle.jsx
|
5145
|
-
import
|
5222
|
+
import React41, { Fragment as Fragment2 } from "react";
|
5146
5223
|
import {
|
5147
5224
|
DeviceType as DeviceType2,
|
5148
5225
|
HMSRoomState as HMSRoomState5,
|
@@ -5157,7 +5234,7 @@ import {
|
|
5157
5234
|
import { CameraFlipIcon as CameraFlipIcon2, MicOffIcon, MicOnIcon as MicOnIcon3, VideoOffIcon, VideoOnIcon } from "@100mslive/react-icons";
|
5158
5235
|
|
5159
5236
|
// src/Prebuilt/components/IconButtonWithOptions/IconButtonWithOptions.jsx
|
5160
|
-
import
|
5237
|
+
import React40 from "react";
|
5161
5238
|
import { VerticalMenuIcon } from "@100mslive/react-icons";
|
5162
5239
|
var IconSection = styled(IconButton_default, {
|
5163
5240
|
w: "unset",
|
@@ -5209,7 +5286,7 @@ var IconButtonWithOptions = ({
|
|
5209
5286
|
}) => {
|
5210
5287
|
const bgCss = { backgroundColor: disabled ? "$surface_brighter" : active ? "$transparent" : "$secondary_dim" };
|
5211
5288
|
const iconCss = { color: disabled ? "$on_surface_low" : active ? "$on_surface_high" : "$on_primary_high" };
|
5212
|
-
return /* @__PURE__ */
|
5289
|
+
return /* @__PURE__ */ React40.createElement(Flex, null, /* @__PURE__ */ React40.createElement(IconSection, { css: bgCss, onClick }, /* @__PURE__ */ React40.createElement(Tooltip, { disabled: !tooltipMessage, title: tooltipMessage }, /* @__PURE__ */ React40.createElement(Flex, { align: "center", justify: "center", css: iconCss }, icon))), /* @__PURE__ */ React40.createElement(Dropdown.Root, null, /* @__PURE__ */ React40.createElement(
|
5213
5290
|
Dropdown.Trigger,
|
5214
5291
|
{
|
5215
5292
|
asChild: true,
|
@@ -5220,8 +5297,8 @@ var IconButtonWithOptions = ({
|
|
5220
5297
|
}
|
5221
5298
|
}
|
5222
5299
|
},
|
5223
|
-
/* @__PURE__ */
|
5224
|
-
), /* @__PURE__ */
|
5300
|
+
/* @__PURE__ */ React40.createElement(OptionsSection, { css: bgCss }, /* @__PURE__ */ React40.createElement(Tooltip, { title: "View Options" }, /* @__PURE__ */ React40.createElement(Box, { css: iconCss }, /* @__PURE__ */ React40.createElement(VerticalMenuIcon, null))))
|
5301
|
+
), /* @__PURE__ */ React40.createElement(
|
5225
5302
|
Dropdown.Content,
|
5226
5303
|
{
|
5227
5304
|
sideOffset: 5,
|
@@ -5233,7 +5310,7 @@ var IconButtonWithOptions = ({
|
|
5233
5310
|
border: "none"
|
5234
5311
|
}
|
5235
5312
|
},
|
5236
|
-
options.map((option, index) => /* @__PURE__ */
|
5313
|
+
options.map((option, index) => /* @__PURE__ */ React40.createElement(
|
5237
5314
|
Dropdown.Item,
|
5238
5315
|
{
|
5239
5316
|
key: option.title,
|
@@ -5260,7 +5337,7 @@ var AudioVideoToggle = ({ hideOptions = false }) => {
|
|
5260
5337
|
const { videoInput, audioInput } = allDevices;
|
5261
5338
|
const formattedVideoInputList = videoInput == null ? void 0 : videoInput.map((videoInput2) => ({
|
5262
5339
|
active: selectedDeviceIDs.videoInput === videoInput2.deviceId,
|
5263
|
-
content: /* @__PURE__ */
|
5340
|
+
content: /* @__PURE__ */ React41.createElement(
|
5264
5341
|
Text,
|
5265
5342
|
{
|
5266
5343
|
variant: "sm",
|
@@ -5276,7 +5353,7 @@ var AudioVideoToggle = ({ hideOptions = false }) => {
|
|
5276
5353
|
}));
|
5277
5354
|
const formattedAudioInputList = audioInput == null ? void 0 : audioInput.map((audioInput2) => ({
|
5278
5355
|
active: selectedDeviceIDs.audioInput === audioInput2.deviceId,
|
5279
|
-
content: /* @__PURE__ */
|
5356
|
+
content: /* @__PURE__ */ React41.createElement(
|
5280
5357
|
Text,
|
5281
5358
|
{
|
5282
5359
|
variant: "sm",
|
@@ -5297,7 +5374,7 @@ var AudioVideoToggle = ({ hideOptions = false }) => {
|
|
5297
5374
|
const roomState = useHMSStore17(selectRoomState5);
|
5298
5375
|
const hasAudioDevices = (audioInput == null ? void 0 : audioInput.length) > 0;
|
5299
5376
|
const hasVideoDevices = (videoInput == null ? void 0 : videoInput.length) > 0;
|
5300
|
-
return /* @__PURE__ */
|
5377
|
+
return /* @__PURE__ */ React41.createElement(Fragment2, null, toggleAudio ? hideOptions || !hasAudioDevices ? /* @__PURE__ */ React41.createElement(Tooltip, { title: `Turn ${isLocalAudioEnabled ? "off" : "on"} audio (${isMacOS ? "\u2318" : "ctrl"} + d)` }, /* @__PURE__ */ React41.createElement(
|
5301
5378
|
IconButton_default,
|
5302
5379
|
{
|
5303
5380
|
active: isLocalAudioEnabled,
|
@@ -5307,20 +5384,20 @@ var AudioVideoToggle = ({ hideOptions = false }) => {
|
|
5307
5384
|
"data-testid": "audio_btn",
|
5308
5385
|
className: "__cancel-drag-event"
|
5309
5386
|
},
|
5310
|
-
!isLocalAudioEnabled ? /* @__PURE__ */
|
5311
|
-
)) : /* @__PURE__ */
|
5387
|
+
!isLocalAudioEnabled ? /* @__PURE__ */ React41.createElement(MicOffIcon, { "data-testid": "audio_off_btn" }) : /* @__PURE__ */ React41.createElement(MicOnIcon3, { "data-testid": "audio_on_btn" })
|
5388
|
+
)) : /* @__PURE__ */ React41.createElement(
|
5312
5389
|
IconButtonWithOptions,
|
5313
5390
|
{
|
5314
5391
|
options: formattedAudioInputList,
|
5315
5392
|
disabled: !toggleAudio,
|
5316
5393
|
onDisabledClick: toggleAudio,
|
5317
5394
|
tooltipMessage: `Turn ${isLocalAudioEnabled ? "off" : "on"} audio (${isMacOS ? "\u2318" : "ctrl"} + d)`,
|
5318
|
-
icon: !isLocalAudioEnabled ? /* @__PURE__ */
|
5395
|
+
icon: !isLocalAudioEnabled ? /* @__PURE__ */ React41.createElement(MicOffIcon, { "data-testid": "audio_off_btn" }) : /* @__PURE__ */ React41.createElement(MicOnIcon3, { "data-testid": "audio_on_btn" }),
|
5319
5396
|
active: isLocalAudioEnabled,
|
5320
5397
|
onClick: toggleAudio,
|
5321
5398
|
key: "toggleAudio"
|
5322
5399
|
}
|
5323
|
-
) : null, toggleVideo ? hideOptions || !hasVideoDevices ? /* @__PURE__ */
|
5400
|
+
) : null, toggleVideo ? hideOptions || !hasVideoDevices ? /* @__PURE__ */ React41.createElement(Tooltip, { title: `Turn ${isLocalVideoEnabled ? "off" : "on"} video (${isMacOS ? "\u2318" : "ctrl"} + e)` }, /* @__PURE__ */ React41.createElement(
|
5324
5401
|
IconButton_default,
|
5325
5402
|
{
|
5326
5403
|
key: "toggleVideo",
|
@@ -5330,20 +5407,20 @@ var AudioVideoToggle = ({ hideOptions = false }) => {
|
|
5330
5407
|
"data-testid": "video_btn",
|
5331
5408
|
className: "__cancel-drag-event"
|
5332
5409
|
},
|
5333
|
-
!isLocalVideoEnabled ? /* @__PURE__ */
|
5334
|
-
)) : /* @__PURE__ */
|
5410
|
+
!isLocalVideoEnabled ? /* @__PURE__ */ React41.createElement(VideoOffIcon, { "data-testid": "video_off_btn" }) : /* @__PURE__ */ React41.createElement(VideoOnIcon, { "data-testid": "video_on_btn" })
|
5411
|
+
)) : /* @__PURE__ */ React41.createElement(
|
5335
5412
|
IconButtonWithOptions,
|
5336
5413
|
{
|
5337
5414
|
disabled: !toggleVideo,
|
5338
5415
|
onDisabledClick: toggleVideo,
|
5339
5416
|
options: formattedVideoInputList,
|
5340
5417
|
tooltipMessage: `Turn ${isLocalVideoEnabled ? "off" : "on"} video (${isMacOS ? "\u2318" : "ctrl"} + e)`,
|
5341
|
-
icon: !isLocalVideoEnabled ? /* @__PURE__ */
|
5418
|
+
icon: !isLocalVideoEnabled ? /* @__PURE__ */ React41.createElement(VideoOffIcon, { "data-testid": "video_off_btn" }) : /* @__PURE__ */ React41.createElement(VideoOnIcon, { "data-testid": "video_on_btn" }),
|
5342
5419
|
key: "toggleVideo",
|
5343
5420
|
active: isLocalVideoEnabled,
|
5344
5421
|
onClick: toggleVideo
|
5345
5422
|
}
|
5346
|
-
) : null, (localVideoTrack == null ? void 0 : localVideoTrack.facingMode) && roomState === HMSRoomState5.Preview ? /* @__PURE__ */
|
5423
|
+
) : null, (localVideoTrack == null ? void 0 : localVideoTrack.facingMode) && roomState === HMSRoomState5.Preview ? /* @__PURE__ */ React41.createElement(Tooltip, { title: "Switch Camera", key: "switchCamera" }, /* @__PURE__ */ React41.createElement(
|
5347
5424
|
IconButton_default,
|
5348
5425
|
{
|
5349
5426
|
onClick: () => __async(void 0, null, function* () {
|
@@ -5357,32 +5434,34 @@ var AudioVideoToggle = ({ hideOptions = false }) => {
|
|
5357
5434
|
}
|
5358
5435
|
})
|
5359
5436
|
},
|
5360
|
-
/* @__PURE__ */
|
5437
|
+
/* @__PURE__ */ React41.createElement(CameraFlipIcon2, null)
|
5361
5438
|
)) : null);
|
5362
5439
|
};
|
5363
5440
|
|
5364
|
-
// src/Prebuilt/components/Chip.
|
5365
|
-
import
|
5441
|
+
// src/Prebuilt/components/Chip.tsx
|
5442
|
+
import React42 from "react";
|
5366
5443
|
var Chip = ({
|
5367
|
-
icon = /* @__PURE__ */
|
5444
|
+
icon = /* @__PURE__ */ React42.createElement(React42.Fragment, null),
|
5368
5445
|
content = "",
|
5369
5446
|
backgroundColor = "$surface_default",
|
5370
5447
|
textColor = "$on_surface_high",
|
5371
|
-
hideIfNoContent = false
|
5448
|
+
hideIfNoContent = false,
|
5449
|
+
onClick,
|
5450
|
+
css: css2 = {}
|
5372
5451
|
}) => {
|
5373
5452
|
if (hideIfNoContent && !content) {
|
5374
|
-
return;
|
5453
|
+
return null;
|
5375
5454
|
}
|
5376
|
-
return /* @__PURE__ */
|
5455
|
+
return /* @__PURE__ */ React42.createElement(Flex, { align: "center", css: __spreadValues({ backgroundColor, p: "$4 $6", borderRadius: "$4" }, css2), onClick: () => onClick == null ? void 0 : onClick() }, icon, /* @__PURE__ */ React42.createElement(Text, { variant: "sm", css: { fontWeight: "$semiBold", color: textColor, ml: "$2" } }, content));
|
5377
5456
|
};
|
5378
5457
|
var Chip_default = Chip;
|
5379
5458
|
|
5380
5459
|
// src/Prebuilt/components/Connection/TileConnection.tsx
|
5381
|
-
import
|
5460
|
+
import React44 from "react";
|
5382
5461
|
import { PinIcon, SpotlightIcon } from "@100mslive/react-icons";
|
5383
5462
|
|
5384
5463
|
// src/Prebuilt/components/Connection/ConnectionIndicator.tsx
|
5385
|
-
import
|
5464
|
+
import React43 from "react";
|
5386
5465
|
import { selectConnectionQualityByPeerID as selectConnectionQualityByPeerID2, useHMSStore as useHMSStore18 } from "@100mslive/react-sdk";
|
5387
5466
|
import { PoorConnectivityIcon as PoorConnectivityIcon2 } from "@100mslive/react-icons";
|
5388
5467
|
|
@@ -5444,10 +5523,10 @@ var ConnectionIndicator = ({
|
|
5444
5523
|
return null;
|
5445
5524
|
}
|
5446
5525
|
if (downlinkQuality === 0) {
|
5447
|
-
return /* @__PURE__ */
|
5526
|
+
return /* @__PURE__ */ React43.createElement(Tooltip, { title: getTooltipText(downlinkQuality) }, /* @__PURE__ */ React43.createElement(Wrapper, { isTile, css: { color: "#ED4C5A" }, "data-testid": "tile_network" }, /* @__PURE__ */ React43.createElement(PoorConnectivityIcon2, null)));
|
5448
5527
|
}
|
5449
5528
|
const size = isTile ? 12 : 16;
|
5450
|
-
return /* @__PURE__ */
|
5529
|
+
return /* @__PURE__ */ React43.createElement(Tooltip, { title: getTooltipText(downlinkQuality) }, /* @__PURE__ */ React43.createElement(Wrapper, { isTile, "data-testid": "tile_network", css: { backgroundColor: hideBg ? "" : "$surface_bright" } }, /* @__PURE__ */ React43.createElement(
|
5451
5530
|
"svg",
|
5452
5531
|
{
|
5453
5532
|
width: size,
|
@@ -5462,7 +5541,7 @@ var ConnectionIndicator = ({
|
|
5462
5541
|
strokeMiterlimit: 2
|
5463
5542
|
}
|
5464
5543
|
},
|
5465
|
-
/* @__PURE__ */
|
5544
|
+
/* @__PURE__ */ React43.createElement(
|
5466
5545
|
"path",
|
5467
5546
|
{
|
5468
5547
|
d: "M6.875 0c2.549.035 4.679.902 6.445 2.648.366.362.45.796.216 1.096-.239.306-.714.34-1.142.072a2.28 2.28 0 0 1-.341-.271C9.24.862 4.924.775 1.992 3.346c-.284.249-.594.419-.983.393-.272-.019-.49-.135-.613-.388-.125-.261-.05-.498.114-.713.073-.092.156-.177.245-.254C2.516.804 4.591.039 6.875 0Z",
|
@@ -5470,7 +5549,7 @@ var ConnectionIndicator = ({
|
|
5470
5549
|
transform: "translate(-.333)"
|
5471
5550
|
}
|
5472
5551
|
),
|
5473
|
-
/* @__PURE__ */
|
5552
|
+
/* @__PURE__ */ React43.createElement(
|
5474
5553
|
"path",
|
5475
5554
|
{
|
5476
5555
|
d: "M7.056 2.964c1.756.035 3.208.7 4.499 1.763.162.134.277.315.354.512.098.251.114.503-.075.72-.193.222-.452.259-.725.198-.293-.066-.518-.247-.738-.443a4.859 4.859 0 0 0-6.198-.26c-.166.127-.318.271-.475.409-.242.211-.513.343-.843.317-.43-.034-.679-.397-.561-.81.062-.211.181-.4.345-.546 1.265-1.162 2.733-1.836 4.417-1.86Z",
|
@@ -5478,14 +5557,14 @@ var ConnectionIndicator = ({
|
|
5478
5557
|
transform: "translate(-.333)"
|
5479
5558
|
}
|
5480
5559
|
),
|
5481
|
-
/* @__PURE__ */
|
5560
|
+
/* @__PURE__ */ React43.createElement(
|
5482
5561
|
"path",
|
5483
5562
|
{
|
5484
5563
|
d: "M7.384,6.052C8.293,6.068 9.157,6.449 9.783,7.108C10.005,7.339 10.157,7.6 10.07,7.942C9.959,8.377 9.435,8.581 9.071,8.243C7.935,7.191 6.356,7.183 5.152,8.183C4.816,8.462 4.6,8.485 4.332,8.27C4.063,8.055 3.998,7.691 4.177,7.358C4.273,7.179 4.414,7.038 4.57,6.911C5.26,6.349 6.149,6.05 7.384,6.052L7.384,6.052Z",
|
5485
5564
|
fill: getColor(2, downlinkQuality, defaultColor, theme2)
|
5486
5565
|
}
|
5487
5566
|
),
|
5488
|
-
/* @__PURE__ */
|
5567
|
+
/* @__PURE__ */ React43.createElement(
|
5489
5568
|
"path",
|
5490
5569
|
{
|
5491
5570
|
d: "M8.214,9.941C8.214,10.234 8.097,10.515 7.888,10.721C7.68,10.928 7.398,11.042 7.104,11.039C6.471,11.036 5.982,10.541 5.993,9.912C6.004,9.259 6.499,8.766 7.133,8.779C7.744,8.791 8.22,9.301 8.214,9.941Z",
|
@@ -5504,7 +5583,7 @@ var TileConnection = ({
|
|
5504
5583
|
spotlighted,
|
5505
5584
|
pinned
|
5506
5585
|
}) => {
|
5507
|
-
return /* @__PURE__ */
|
5586
|
+
return /* @__PURE__ */ React44.createElement(Wrapper2, null, !hideLabel ? /* @__PURE__ */ React44.createElement(React44.Fragment, null, /* @__PURE__ */ React44.createElement(Flex, { align: "center" }, pinned && /* @__PURE__ */ React44.createElement(IconWrapper, null, /* @__PURE__ */ React44.createElement(PinIcon, { width: "15", height: "15" })), spotlighted && /* @__PURE__ */ React44.createElement(IconWrapper, null, /* @__PURE__ */ React44.createElement(SpotlightIcon, { width: "15", height: "15" })), /* @__PURE__ */ React44.createElement(
|
5508
5587
|
Text,
|
5509
5588
|
{
|
5510
5589
|
css: __spreadValues({
|
@@ -5514,7 +5593,7 @@ var TileConnection = ({
|
|
5514
5593
|
variant: "xs"
|
5515
5594
|
},
|
5516
5595
|
name
|
5517
|
-
)), /* @__PURE__ */
|
5596
|
+
)), /* @__PURE__ */ React44.createElement(ConnectionIndicator, { isTile: true, peerId, hideBg: true })) : null);
|
5518
5597
|
};
|
5519
5598
|
var IconWrapper = styled("div", { c: "$on_surface_high", ml: "$3", mt: "$1" });
|
5520
5599
|
var Wrapper2 = styled("div", {
|
@@ -5534,7 +5613,7 @@ var Wrapper2 = styled("div", {
|
|
5534
5613
|
var TileConnection_default = TileConnection;
|
5535
5614
|
|
5536
5615
|
// src/Prebuilt/components/Settings/SettingsModal.jsx
|
5537
|
-
import
|
5616
|
+
import React50, { useCallback as useCallback15, useEffect as useEffect22, useState as useState15 } from "react";
|
5538
5617
|
import { useMedia as useMedia4 } from "react-use";
|
5539
5618
|
import { ChevronLeftIcon, CrossIcon as CrossIcon6 } from "@100mslive/react-icons";
|
5540
5619
|
|
@@ -5542,7 +5621,7 @@ import { ChevronLeftIcon, CrossIcon as CrossIcon6 } from "@100mslive/react-icons
|
|
5542
5621
|
import { GridFourIcon, NotificationsIcon, SettingsIcon } from "@100mslive/react-icons";
|
5543
5622
|
|
5544
5623
|
// src/Prebuilt/components/Settings/DeviceSettings.jsx
|
5545
|
-
import
|
5624
|
+
import React46, { Fragment as Fragment3, useEffect as useEffect21, useRef as useRef7, useState as useState14 } from "react";
|
5546
5625
|
import {
|
5547
5626
|
DeviceType as DeviceType3,
|
5548
5627
|
selectIsLocalVideoEnabled as selectIsLocalVideoEnabled3,
|
@@ -5554,10 +5633,10 @@ import {
|
|
5554
5633
|
import { MicOnIcon as MicOnIcon4, SpeakerIcon as SpeakerIcon2, VideoOnIcon as VideoOnIcon2 } from "@100mslive/react-icons";
|
5555
5634
|
|
5556
5635
|
// src/Prebuilt/primitives/DropdownTrigger.jsx
|
5557
|
-
import
|
5636
|
+
import React45 from "react";
|
5558
5637
|
import { ChevronDownIcon as ChevronDownIcon3, ChevronUpIcon as ChevronUpIcon3 } from "@100mslive/react-icons";
|
5559
|
-
var DialogDropdownTrigger =
|
5560
|
-
return /* @__PURE__ */
|
5638
|
+
var DialogDropdownTrigger = React45.forwardRef(({ title, css: css2, open, icon, titleCSS = {} }, ref) => {
|
5639
|
+
return /* @__PURE__ */ React45.createElement(
|
5561
5640
|
Dropdown.Trigger,
|
5562
5641
|
{
|
5563
5642
|
asChild: true,
|
@@ -5571,7 +5650,7 @@ var DialogDropdownTrigger = React43.forwardRef(({ title, css: css2, open, icon,
|
|
5571
5650
|
}, css2),
|
5572
5651
|
ref
|
5573
5652
|
},
|
5574
|
-
/* @__PURE__ */
|
5653
|
+
/* @__PURE__ */ React45.createElement(
|
5575
5654
|
Flex,
|
5576
5655
|
{
|
5577
5656
|
css: {
|
@@ -5582,7 +5661,7 @@ var DialogDropdownTrigger = React43.forwardRef(({ title, css: css2, open, icon,
|
|
5582
5661
|
}
|
5583
5662
|
},
|
5584
5663
|
icon,
|
5585
|
-
/* @__PURE__ */
|
5664
|
+
/* @__PURE__ */ React45.createElement(
|
5586
5665
|
Text,
|
5587
5666
|
{
|
5588
5667
|
css: __spreadValues(__spreadProps(__spreadValues({
|
@@ -5594,7 +5673,7 @@ var DialogDropdownTrigger = React43.forwardRef(({ title, css: css2, open, icon,
|
|
5594
5673
|
},
|
5595
5674
|
title
|
5596
5675
|
),
|
5597
|
-
open ? /* @__PURE__ */
|
5676
|
+
open ? /* @__PURE__ */ React45.createElement(ChevronUpIcon3, null) : /* @__PURE__ */ React45.createElement(ChevronDownIcon3, null)
|
5598
5677
|
)
|
5599
5678
|
);
|
5600
5679
|
});
|
@@ -5619,7 +5698,7 @@ var Settings = ({ setHide }) => {
|
|
5619
5698
|
if (!(videoInput == null ? void 0 : videoInput.length) && !(audioInput == null ? void 0 : audioInput.length) && !(audioOutputFiltered == null ? void 0 : audioOutputFiltered.length)) {
|
5620
5699
|
setHide(true);
|
5621
5700
|
}
|
5622
|
-
return /* @__PURE__ */
|
5701
|
+
return /* @__PURE__ */ React46.createElement(Box, { className: settingOverflow() }, (videoInput == null ? void 0 : videoInput.length) ? /* @__PURE__ */ React46.createElement(Fragment3, null, isVideoOn && /* @__PURE__ */ React46.createElement(
|
5623
5702
|
StyledVideoTile.Container,
|
5624
5703
|
{
|
5625
5704
|
css: {
|
@@ -5630,24 +5709,24 @@ var Settings = ({ setHide }) => {
|
|
5630
5709
|
m: "$10 auto"
|
5631
5710
|
}
|
5632
5711
|
},
|
5633
|
-
/* @__PURE__ */
|
5634
|
-
), /* @__PURE__ */
|
5712
|
+
/* @__PURE__ */ React46.createElement(Video, { trackId: videoTrackId, mirror: (track == null ? void 0 : track.facingMode) !== "environment" && mirrorLocalVideo })
|
5713
|
+
), /* @__PURE__ */ React46.createElement(
|
5635
5714
|
DeviceSelector,
|
5636
5715
|
{
|
5637
5716
|
title: "Video",
|
5638
5717
|
devices: videoInput,
|
5639
|
-
icon: /* @__PURE__ */
|
5718
|
+
icon: /* @__PURE__ */ React46.createElement(VideoOnIcon2, null),
|
5640
5719
|
selection: selectedDeviceIDs.videoInput,
|
5641
5720
|
onChange: (deviceId) => updateDevice({
|
5642
5721
|
deviceId,
|
5643
5722
|
deviceType: DeviceType3.videoInput
|
5644
5723
|
})
|
5645
5724
|
}
|
5646
|
-
)) : null, (audioInput == null ? void 0 : audioInput.length) ? /* @__PURE__ */
|
5725
|
+
)) : null, (audioInput == null ? void 0 : audioInput.length) ? /* @__PURE__ */ React46.createElement(
|
5647
5726
|
DeviceSelector,
|
5648
5727
|
{
|
5649
5728
|
title: shouldShowAudioOutput ? "Microphone" : "Audio",
|
5650
|
-
icon: /* @__PURE__ */
|
5729
|
+
icon: /* @__PURE__ */ React46.createElement(MicOnIcon4, null),
|
5651
5730
|
devices: audioInput,
|
5652
5731
|
selection: selectedDeviceIDs.audioInput,
|
5653
5732
|
onChange: (deviceId) => updateDevice({
|
@@ -5655,11 +5734,11 @@ var Settings = ({ setHide }) => {
|
|
5655
5734
|
deviceType: DeviceType3.audioInput
|
5656
5735
|
})
|
5657
5736
|
}
|
5658
|
-
) : null, (audioOutputFiltered == null ? void 0 : audioOutputFiltered.length) && shouldShowAudioOutput ? /* @__PURE__ */
|
5737
|
+
) : null, (audioOutputFiltered == null ? void 0 : audioOutputFiltered.length) && shouldShowAudioOutput ? /* @__PURE__ */ React46.createElement(
|
5659
5738
|
DeviceSelector,
|
5660
5739
|
{
|
5661
5740
|
title: "Speaker",
|
5662
|
-
icon: /* @__PURE__ */
|
5741
|
+
icon: /* @__PURE__ */ React46.createElement(SpeakerIcon2, null),
|
5663
5742
|
devices: audioOutput,
|
5664
5743
|
selection: selectedDeviceIDs.audioOutput,
|
5665
5744
|
onChange: (deviceId) => updateDevice({
|
@@ -5667,15 +5746,15 @@ var Settings = ({ setHide }) => {
|
|
5667
5746
|
deviceType: DeviceType3.audioOutput
|
5668
5747
|
})
|
5669
5748
|
},
|
5670
|
-
/* @__PURE__ */
|
5749
|
+
/* @__PURE__ */ React46.createElement(TestAudio, { id: selectedDeviceIDs.audioOutput })
|
5671
5750
|
) : null);
|
5672
5751
|
};
|
5673
5752
|
var DeviceSelector = ({ title, devices, selection, onChange, icon, children = null }) => {
|
5674
5753
|
var _a7, _b7;
|
5675
5754
|
const [open, setOpen] = useState14(false);
|
5676
5755
|
const selectionBg = useDropdownSelection();
|
5677
|
-
const ref =
|
5678
|
-
return /* @__PURE__ */
|
5756
|
+
const ref = useRef7(null);
|
5757
|
+
return /* @__PURE__ */ React46.createElement(Box, { css: { mb: "$10" } }, /* @__PURE__ */ React46.createElement(Text, { css: { mb: "$4" } }, title), /* @__PURE__ */ React46.createElement(
|
5679
5758
|
Flex,
|
5680
5759
|
{
|
5681
5760
|
align: "center",
|
@@ -5687,7 +5766,7 @@ var DeviceSelector = ({ title, devices, selection, onChange, icon, children = nu
|
|
5687
5766
|
}
|
5688
5767
|
}
|
5689
5768
|
},
|
5690
|
-
/* @__PURE__ */
|
5769
|
+
/* @__PURE__ */ React46.createElement(
|
5691
5770
|
Box,
|
5692
5771
|
{
|
5693
5772
|
css: {
|
@@ -5701,7 +5780,7 @@ var DeviceSelector = ({ title, devices, selection, onChange, icon, children = nu
|
|
5701
5780
|
}
|
5702
5781
|
}
|
5703
5782
|
},
|
5704
|
-
/* @__PURE__ */
|
5783
|
+
/* @__PURE__ */ React46.createElement(Dropdown.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React46.createElement(
|
5705
5784
|
DialogDropdownTrigger,
|
5706
5785
|
{
|
5707
5786
|
ref,
|
@@ -5709,8 +5788,8 @@ var DeviceSelector = ({ title, devices, selection, onChange, icon, children = nu
|
|
5709
5788
|
title: ((_a7 = devices.find(({ deviceId }) => deviceId === selection)) == null ? void 0 : _a7.label) || "Select device from list",
|
5710
5789
|
open
|
5711
5790
|
}
|
5712
|
-
), /* @__PURE__ */
|
5713
|
-
return /* @__PURE__ */
|
5791
|
+
), /* @__PURE__ */ React46.createElement(Dropdown.Portal, null, /* @__PURE__ */ React46.createElement(Dropdown.Content, { align: "start", sideOffset: 8, css: { w: (_b7 = ref.current) == null ? void 0 : _b7.clientWidth, zIndex: 1001 } }, devices.map((device) => {
|
5792
|
+
return /* @__PURE__ */ React46.createElement(
|
5714
5793
|
Dropdown.Item,
|
5715
5794
|
{
|
5716
5795
|
key: device.label,
|
@@ -5729,9 +5808,9 @@ var DeviceSelector = ({ title, devices, selection, onChange, icon, children = nu
|
|
5729
5808
|
};
|
5730
5809
|
var TEST_AUDIO_URL = "https://100ms.live/test-audio.wav";
|
5731
5810
|
var TestAudio = ({ id }) => {
|
5732
|
-
const audioRef =
|
5811
|
+
const audioRef = useRef7(null);
|
5733
5812
|
const [playing, setPlaying] = useState14(false);
|
5734
|
-
|
5813
|
+
useEffect21(() => {
|
5735
5814
|
if (audioRef.current && id) {
|
5736
5815
|
try {
|
5737
5816
|
if (typeof audioRef.current.setSinkId !== "undefined") {
|
@@ -5742,7 +5821,7 @@ var TestAudio = ({ id }) => {
|
|
5742
5821
|
}
|
5743
5822
|
}
|
5744
5823
|
}, [id]);
|
5745
|
-
return /* @__PURE__ */
|
5824
|
+
return /* @__PURE__ */ React46.createElement(React46.Fragment, null, /* @__PURE__ */ React46.createElement(
|
5746
5825
|
Button,
|
5747
5826
|
{
|
5748
5827
|
variant: "standard",
|
@@ -5759,22 +5838,22 @@ var TestAudio = ({ id }) => {
|
|
5759
5838
|
},
|
5760
5839
|
disabled: playing
|
5761
5840
|
},
|
5762
|
-
/* @__PURE__ */
|
5841
|
+
/* @__PURE__ */ React46.createElement(SpeakerIcon2, null),
|
5763
5842
|
"\xA0Test",
|
5764
5843
|
" ",
|
5765
|
-
/* @__PURE__ */
|
5766
|
-
), /* @__PURE__ */
|
5844
|
+
/* @__PURE__ */ React46.createElement(Text, { as: "span", css: { display: "none", "@md": { display: "inline" } } }, "\xA0 speaker")
|
5845
|
+
), /* @__PURE__ */ React46.createElement("audio", { ref: audioRef, src: TEST_AUDIO_URL, onEnded: () => setPlaying(false), onPlay: () => setPlaying(true) }));
|
5767
5846
|
};
|
5768
5847
|
var DeviceSettings_default = Settings;
|
5769
5848
|
|
5770
5849
|
// src/Prebuilt/components/Settings/LayoutSettings.jsx
|
5771
|
-
import
|
5850
|
+
import React48, { useCallback as useCallback14 } from "react";
|
5772
5851
|
import { selectIsLocalScreenShared, selectIsLocalVideoEnabled as selectIsLocalVideoEnabled4, useHMSActions as useHMSActions15, useHMSStore as useHMSStore20 } from "@100mslive/react-sdk";
|
5773
5852
|
|
5774
5853
|
// src/Prebuilt/components/Settings/SwitchWithLabel.jsx
|
5775
|
-
import
|
5854
|
+
import React47 from "react";
|
5776
5855
|
var SwitchWithLabel = ({ label, icon, id, onChange, checked, hide = false }) => {
|
5777
|
-
return /* @__PURE__ */
|
5856
|
+
return /* @__PURE__ */ React47.createElement(
|
5778
5857
|
Flex,
|
5779
5858
|
{
|
5780
5859
|
align: "center",
|
@@ -5786,7 +5865,7 @@ var SwitchWithLabel = ({ label, icon, id, onChange, checked, hide = false }) =>
|
|
5786
5865
|
display: hide ? "none" : "flex"
|
5787
5866
|
}
|
5788
5867
|
},
|
5789
|
-
/* @__PURE__ */
|
5868
|
+
/* @__PURE__ */ React47.createElement(
|
5790
5869
|
Label3,
|
5791
5870
|
{
|
5792
5871
|
htmlFor: id,
|
@@ -5804,7 +5883,7 @@ var SwitchWithLabel = ({ label, icon, id, onChange, checked, hide = false }) =>
|
|
5804
5883
|
icon,
|
5805
5884
|
label
|
5806
5885
|
),
|
5807
|
-
/* @__PURE__ */
|
5886
|
+
/* @__PURE__ */ React47.createElement(Switch, { id, checked, onCheckedChange: onChange })
|
5808
5887
|
);
|
5809
5888
|
};
|
5810
5889
|
var SwitchWithLabel_default = SwitchWithLabel;
|
@@ -5825,7 +5904,7 @@ var LayoutSettings = () => {
|
|
5825
5904
|
}),
|
5826
5905
|
[hmsActions, isLocalVideoEnabled, isLocalScreenShared, setUISettings]
|
5827
5906
|
);
|
5828
|
-
return /* @__PURE__ */
|
5907
|
+
return /* @__PURE__ */ React48.createElement(Box, { className: settingOverflow() }, /* @__PURE__ */ React48.createElement(SwitchWithLabel_default, { label: "Audio Only Mode", id: "audioOnlyMode", checked: isAudioOnly, onChange: toggleIsAudioOnly }), /* @__PURE__ */ React48.createElement(
|
5829
5908
|
SwitchWithLabel_default,
|
5830
5909
|
{
|
5831
5910
|
label: "Mirror Local Video",
|
@@ -5837,7 +5916,7 @@ var LayoutSettings = () => {
|
|
5837
5916
|
});
|
5838
5917
|
}
|
5839
5918
|
}
|
5840
|
-
), /* @__PURE__ */
|
5919
|
+
), /* @__PURE__ */ React48.createElement(Flex, { align: "center", css: { w: "100%", my: "$2", py: "$8", "@md": { display: "none" } } }, /* @__PURE__ */ React48.createElement(Text, { variant: "md", css: { fontWeight: "$semiBold" } }, "Tiles In View(", maxTileCount, ")"), /* @__PURE__ */ React48.createElement(Flex, { justify: "end", css: { flex: "1 1 0" } }, /* @__PURE__ */ React48.createElement(
|
5841
5920
|
Slider,
|
5842
5921
|
{
|
5843
5922
|
step: 1,
|
@@ -5853,11 +5932,11 @@ var LayoutSettings = () => {
|
|
5853
5932
|
};
|
5854
5933
|
|
5855
5934
|
// src/Prebuilt/components/Settings/NotificationSettings.jsx
|
5856
|
-
import
|
5935
|
+
import React49 from "react";
|
5857
5936
|
import { AlertOctagonIcon, HandIcon as HandIcon2, PeopleAddIcon as PeopleAddIcon2, PeopleRemoveIcon as PeopleRemoveIcon2 } from "@100mslive/react-icons";
|
5858
5937
|
var NotificationItem = ({ type, label, icon, checked }) => {
|
5859
5938
|
const [, setSubscribedNotifications] = useSetSubscribedNotifications(type);
|
5860
|
-
return /* @__PURE__ */
|
5939
|
+
return /* @__PURE__ */ React49.createElement(
|
5861
5940
|
SwitchWithLabel_default,
|
5862
5941
|
{
|
5863
5942
|
label,
|
@@ -5872,36 +5951,36 @@ var NotificationItem = ({ type, label, icon, checked }) => {
|
|
5872
5951
|
};
|
5873
5952
|
var NotificationSettings = () => {
|
5874
5953
|
const subscribedNotifications = useSubscribedNotifications();
|
5875
|
-
return /* @__PURE__ */
|
5954
|
+
return /* @__PURE__ */ React49.createElement(Box, { className: settingOverflow() }, /* @__PURE__ */ React49.createElement(
|
5876
5955
|
NotificationItem,
|
5877
5956
|
{
|
5878
5957
|
label: "Peer Joined",
|
5879
5958
|
type: SUBSCRIBED_NOTIFICATIONS.PEER_JOINED,
|
5880
|
-
icon: /* @__PURE__ */
|
5959
|
+
icon: /* @__PURE__ */ React49.createElement(PeopleAddIcon2, null),
|
5881
5960
|
checked: subscribedNotifications.PEER_JOINED
|
5882
5961
|
}
|
5883
|
-
), /* @__PURE__ */
|
5962
|
+
), /* @__PURE__ */ React49.createElement(
|
5884
5963
|
NotificationItem,
|
5885
5964
|
{
|
5886
5965
|
label: "Peer Leave",
|
5887
5966
|
type: SUBSCRIBED_NOTIFICATIONS.PEER_LEFT,
|
5888
|
-
icon: /* @__PURE__ */
|
5967
|
+
icon: /* @__PURE__ */ React49.createElement(PeopleRemoveIcon2, null),
|
5889
5968
|
checked: subscribedNotifications.PEER_LEFT
|
5890
5969
|
}
|
5891
|
-
), /* @__PURE__ */
|
5970
|
+
), /* @__PURE__ */ React49.createElement(
|
5892
5971
|
NotificationItem,
|
5893
5972
|
{
|
5894
5973
|
label: "Hand Raised",
|
5895
5974
|
type: SUBSCRIBED_NOTIFICATIONS.METADATA_UPDATED,
|
5896
|
-
icon: /* @__PURE__ */
|
5975
|
+
icon: /* @__PURE__ */ React49.createElement(HandIcon2, null),
|
5897
5976
|
checked: subscribedNotifications.METADATA_UPDATED
|
5898
5977
|
}
|
5899
|
-
), /* @__PURE__ */
|
5978
|
+
), /* @__PURE__ */ React49.createElement(
|
5900
5979
|
NotificationItem,
|
5901
5980
|
{
|
5902
5981
|
label: "Error",
|
5903
5982
|
type: SUBSCRIBED_NOTIFICATIONS.ERROR,
|
5904
|
-
icon: /* @__PURE__ */
|
5983
|
+
icon: /* @__PURE__ */ React49.createElement(AlertOctagonIcon, null),
|
5905
5984
|
checked: subscribedNotifications.ERROR
|
5906
5985
|
}
|
5907
5986
|
));
|
@@ -5943,7 +6022,7 @@ var settingsList = [
|
|
5943
6022
|
];
|
5944
6023
|
|
5945
6024
|
// src/Prebuilt/components/Settings/SettingsModal.jsx
|
5946
|
-
var SettingsModal = ({ open, onOpenChange, screenType, children = /* @__PURE__ */
|
6025
|
+
var SettingsModal = ({ open, onOpenChange, screenType, children = /* @__PURE__ */ React50.createElement(React50.Fragment, null) }) => {
|
5947
6026
|
const mediaQueryLg = config.media.md;
|
5948
6027
|
const isMobile = useMedia4(mediaQueryLg);
|
5949
6028
|
const [showSetting, setShowSetting] = useState15(
|
@@ -5953,7 +6032,7 @@ var SettingsModal = ({ open, onOpenChange, screenType, children = /* @__PURE__ *
|
|
5953
6032
|
(key) => (hide) => setShowSetting((prev) => __spreadProps(__spreadValues({}, prev), { [key]: !hide })),
|
5954
6033
|
[setShowSetting]
|
5955
6034
|
);
|
5956
|
-
|
6035
|
+
useEffect22(() => {
|
5957
6036
|
if (screenType === "hls_live_streaming") {
|
5958
6037
|
hideSettingByTabName("layout")(true);
|
5959
6038
|
}
|
@@ -5965,7 +6044,7 @@ var SettingsModal = ({ open, onOpenChange, screenType, children = /* @__PURE__ *
|
|
5965
6044
|
const resetSelection = useCallback15(() => {
|
5966
6045
|
setSelection("");
|
5967
6046
|
}, []);
|
5968
|
-
|
6047
|
+
useEffect22(() => {
|
5969
6048
|
var _a7;
|
5970
6049
|
if (isMobile) {
|
5971
6050
|
setSelection("");
|
@@ -5974,7 +6053,7 @@ var SettingsModal = ({ open, onOpenChange, screenType, children = /* @__PURE__ *
|
|
5974
6053
|
setSelection(firstNotHiddenTabName);
|
5975
6054
|
}
|
5976
6055
|
}, [isMobile, showSetting]);
|
5977
|
-
return isMobile ? /* @__PURE__ */
|
6056
|
+
return isMobile ? /* @__PURE__ */ React50.createElement(
|
5978
6057
|
MobileSettingModal,
|
5979
6058
|
{
|
5980
6059
|
open,
|
@@ -5986,7 +6065,7 @@ var SettingsModal = ({ open, onOpenChange, screenType, children = /* @__PURE__ *
|
|
5986
6065
|
resetSelection,
|
5987
6066
|
children
|
5988
6067
|
}
|
5989
|
-
) : /* @__PURE__ */
|
6068
|
+
) : /* @__PURE__ */ React50.createElement(
|
5990
6069
|
DesktopSettingModal,
|
5991
6070
|
{
|
5992
6071
|
open,
|
@@ -6008,9 +6087,9 @@ var MobileSettingModal = ({
|
|
6008
6087
|
showSetting,
|
6009
6088
|
hideSettingByTabName,
|
6010
6089
|
resetSelection,
|
6011
|
-
children = /* @__PURE__ */
|
6090
|
+
children = /* @__PURE__ */ React50.createElement(React50.Fragment, null)
|
6012
6091
|
}) => {
|
6013
|
-
return /* @__PURE__ */
|
6092
|
+
return /* @__PURE__ */ React50.createElement(Sheet.Root, { open, onOpenChange }, /* @__PURE__ */ React50.createElement(Sheet.Trigger, { asChild: true }, children), /* @__PURE__ */ React50.createElement(
|
6014
6093
|
Sheet.Content,
|
6015
6094
|
{
|
6016
6095
|
css: {
|
@@ -6018,9 +6097,9 @@ var MobileSettingModal = ({
|
|
6018
6097
|
overflowY: "auto"
|
6019
6098
|
}
|
6020
6099
|
},
|
6021
|
-
/* @__PURE__ */
|
6022
|
-
/* @__PURE__ */
|
6023
|
-
!selection ? /* @__PURE__ */
|
6100
|
+
/* @__PURE__ */ React50.createElement(Sheet.Title, { css: { py: "$10", px: "$8", alignItems: "center" } }, /* @__PURE__ */ React50.createElement(Flex, { direction: "row", justify: "between", css: { w: "100%" } }, !selection ? /* @__PURE__ */ React50.createElement(Text, { variant: "h6", css: { display: "flex" } }, "Settings") : /* @__PURE__ */ React50.createElement(Text, { variant: "h6", css: { display: "flex" } }, /* @__PURE__ */ React50.createElement(Box, { as: "span", css: { r: "$round", mr: "$2" }, onClick: resetSelection }, /* @__PURE__ */ React50.createElement(ChevronLeftIcon, null)), (selection == null ? void 0 : selection.charAt(0).toUpperCase()) + selection.slice(1)), /* @__PURE__ */ React50.createElement(Sheet.Close, null, /* @__PURE__ */ React50.createElement(IconButton, { as: "div", "data-testid": "dialog_cross_icon" }, /* @__PURE__ */ React50.createElement(CrossIcon6, null))))),
|
6101
|
+
/* @__PURE__ */ React50.createElement(HorizontalDivider, null),
|
6102
|
+
!selection ? /* @__PURE__ */ React50.createElement(
|
6024
6103
|
Flex,
|
6025
6104
|
{
|
6026
6105
|
direction: "column",
|
@@ -6031,7 +6110,7 @@ var MobileSettingModal = ({
|
|
6031
6110
|
}
|
6032
6111
|
},
|
6033
6112
|
settingsList.filter(({ tabName }) => showSetting[tabName]).map(({ icon: Icon2, tabName, title }) => {
|
6034
|
-
return /* @__PURE__ */
|
6113
|
+
return /* @__PURE__ */ React50.createElement(
|
6035
6114
|
Box,
|
6036
6115
|
{
|
6037
6116
|
key: tabName,
|
@@ -6061,18 +6140,18 @@ var MobileSettingModal = ({
|
|
6061
6140
|
borderBottom: "1px solid $border_default"
|
6062
6141
|
}
|
6063
6142
|
},
|
6064
|
-
/* @__PURE__ */
|
6143
|
+
/* @__PURE__ */ React50.createElement(Icon2, null),
|
6065
6144
|
title
|
6066
6145
|
);
|
6067
6146
|
})
|
6068
|
-
) : /* @__PURE__ */
|
6147
|
+
) : /* @__PURE__ */ React50.createElement(
|
6069
6148
|
Box,
|
6070
6149
|
{
|
6071
6150
|
direction: "column",
|
6072
6151
|
css: { overflowY: "scroll", px: "$8", py: "$10", maxHeight: "70vh", overflowX: "hidden" }
|
6073
6152
|
},
|
6074
6153
|
settingsList.filter(({ tabName }) => showSetting[tabName] && selection === tabName).map(({ content: Content10, title, tabName }) => {
|
6075
|
-
return /* @__PURE__ */
|
6154
|
+
return /* @__PURE__ */ React50.createElement(Content10, { key: title, setHide: hideSettingByTabName(tabName) });
|
6076
6155
|
})
|
6077
6156
|
)
|
6078
6157
|
));
|
@@ -6085,9 +6164,9 @@ var DesktopSettingModal = ({
|
|
6085
6164
|
showSetting,
|
6086
6165
|
hideSettingByTabName,
|
6087
6166
|
resetSelection,
|
6088
|
-
children = /* @__PURE__ */
|
6167
|
+
children = /* @__PURE__ */ React50.createElement(React50.Fragment, null)
|
6089
6168
|
}) => {
|
6090
|
-
return /* @__PURE__ */
|
6169
|
+
return /* @__PURE__ */ React50.createElement(Dialog.Root, { open, onOpenChange }, /* @__PURE__ */ React50.createElement(Dialog.Trigger, { asChild: true }, children), /* @__PURE__ */ React50.createElement(PrebuiltDialogPortal, null, /* @__PURE__ */ React50.createElement(Dialog.Overlay, null), /* @__PURE__ */ React50.createElement(
|
6091
6170
|
Dialog.Content,
|
6092
6171
|
{
|
6093
6172
|
css: {
|
@@ -6097,7 +6176,7 @@ var DesktopSettingModal = ({
|
|
6097
6176
|
r: "$4"
|
6098
6177
|
}
|
6099
6178
|
},
|
6100
|
-
/* @__PURE__ */
|
6179
|
+
/* @__PURE__ */ React50.createElement(
|
6101
6180
|
Tabs.Root,
|
6102
6181
|
{
|
6103
6182
|
value: selection,
|
@@ -6105,7 +6184,7 @@ var DesktopSettingModal = ({
|
|
6105
6184
|
onValueChange: setSelection,
|
6106
6185
|
css: { size: "100%", position: "relative" }
|
6107
6186
|
},
|
6108
|
-
/* @__PURE__ */
|
6187
|
+
/* @__PURE__ */ React50.createElement(
|
6109
6188
|
Tabs.List,
|
6110
6189
|
{
|
6111
6190
|
css: {
|
@@ -6117,12 +6196,12 @@ var DesktopSettingModal = ({
|
|
6117
6196
|
borderBottomLeftRadius: "$4"
|
6118
6197
|
}
|
6119
6198
|
},
|
6120
|
-
/* @__PURE__ */
|
6121
|
-
/* @__PURE__ */
|
6122
|
-
return /* @__PURE__ */
|
6199
|
+
/* @__PURE__ */ React50.createElement(Text, { variant: "h5" }, "Settings "),
|
6200
|
+
/* @__PURE__ */ React50.createElement(Flex, { direction: "column", css: { mx: 0, overflowY: "auto", pt: "$10" } }, settingsList.filter(({ tabName }) => showSetting[tabName]).map(({ icon: Icon2, tabName, title }) => {
|
6201
|
+
return /* @__PURE__ */ React50.createElement(Tabs.Trigger, { key: tabName, value: tabName, css: { gap: "$8" } }, /* @__PURE__ */ React50.createElement(Icon2, null), title);
|
6123
6202
|
}))
|
6124
6203
|
),
|
6125
|
-
selection && /* @__PURE__ */
|
6204
|
+
selection && /* @__PURE__ */ React50.createElement(
|
6126
6205
|
Flex,
|
6127
6206
|
{
|
6128
6207
|
direction: "column",
|
@@ -6133,731 +6212,21 @@ var DesktopSettingModal = ({
|
|
6133
6212
|
}
|
6134
6213
|
},
|
6135
6214
|
settingsList.filter(({ tabName }) => showSetting[tabName]).map(({ content: Content10, title, tabName }) => {
|
6136
|
-
return /* @__PURE__ */
|
6215
|
+
return /* @__PURE__ */ React50.createElement(Tabs.Content, { key: tabName, value: tabName, className: settingContent() }, /* @__PURE__ */ React50.createElement(SettingsContentHeader, { onBack: resetSelection, isMobile: false }, title), /* @__PURE__ */ React50.createElement(Content10, { setHide: hideSettingByTabName(tabName) }));
|
6137
6216
|
})
|
6138
6217
|
)
|
6139
6218
|
),
|
6140
|
-
/* @__PURE__ */
|
6219
|
+
/* @__PURE__ */ React50.createElement(Dialog.Close, { css: { position: "absolute", right: "$10", top: "$10" } }, /* @__PURE__ */ React50.createElement(IconButton, { as: "div", "data-testid": "dialog_cross_icon" }, /* @__PURE__ */ React50.createElement(CrossIcon6, null)))
|
6141
6220
|
)));
|
6142
6221
|
};
|
6143
6222
|
var SettingsContentHeader = ({ children, isMobile, onBack }) => {
|
6144
|
-
return /* @__PURE__ */
|
6223
|
+
return /* @__PURE__ */ React50.createElement(Text, { variant: "h6", css: { mb: "$12", display: "flex", alignItems: "center" } }, isMobile && /* @__PURE__ */ React50.createElement(Box, { as: "span", css: { bg: "$surface_bright", mr: "$4", r: "$round", p: "$2" }, onClick: onBack }, /* @__PURE__ */ React50.createElement(ChevronLeftIcon, null)), children);
|
6145
6224
|
};
|
6146
6225
|
var SettingsModal_default = SettingsModal;
|
6147
6226
|
|
6148
|
-
// src/Prebuilt/components/VideoTile.jsx
|
6149
|
-
import React53, { Fragment as Fragment5, useCallback as useCallback16, useEffect as useEffect23, useMemo as useMemo3, useRef as useRef7, useState as useState18 } from "react";
|
6150
|
-
import { useMedia as useMedia8 } from "react-use";
|
6151
|
-
import {
|
6152
|
-
selectAudioTrackByPeerID as selectAudioTrackByPeerID2,
|
6153
|
-
selectHasPeerHandRaised as selectHasPeerHandRaised3,
|
6154
|
-
selectIsPeerAudioEnabled,
|
6155
|
-
selectLocalPeerID as selectLocalPeerID5,
|
6156
|
-
selectPeerMetadata as selectPeerMetadata2,
|
6157
|
-
selectPeerNameByID,
|
6158
|
-
selectSessionStore as selectSessionStore3,
|
6159
|
-
selectTrackAudioByID,
|
6160
|
-
selectVideoTrackByID as selectVideoTrackByID4,
|
6161
|
-
selectVideoTrackByPeerID as selectVideoTrackByPeerID3,
|
6162
|
-
useHMSStore as useHMSStore24,
|
6163
|
-
useHMSVanillaStore as useHMSVanillaStore6
|
6164
|
-
} from "@100mslive/react-sdk";
|
6165
|
-
import { BrbTileIcon, HandIcon as HandIcon3, MicOffIcon as MicOffIcon3 } from "@100mslive/react-icons";
|
6166
|
-
|
6167
|
-
// src/Prebuilt/components/TileMenu/TileMenu.jsx
|
6168
|
-
import React52, { useState as useState17 } from "react";
|
6169
|
-
import { useMedia as useMedia7 } from "react-use";
|
6170
|
-
import {
|
6171
|
-
selectLocalPeerID as selectLocalPeerID4,
|
6172
|
-
selectPeerByID as selectPeerByID2,
|
6173
|
-
selectPermissions as selectPermissions3,
|
6174
|
-
selectTrackByID as selectTrackByID3,
|
6175
|
-
selectVideoTrackByPeerID as selectVideoTrackByPeerID2,
|
6176
|
-
useHMSStore as useHMSStore23,
|
6177
|
-
useRemoteAVToggle as useRemoteAVToggle2
|
6178
|
-
} from "@100mslive/react-sdk";
|
6179
|
-
import { CrossIcon as CrossIcon8, VerticalMenuIcon as VerticalMenuIcon2 } from "@100mslive/react-icons";
|
6180
|
-
|
6181
|
-
// src/Prebuilt/components/MoreSettings/ChangeNameModal.jsx
|
6182
|
-
import React50, { useState as useState16 } from "react";
|
6183
|
-
import { useMedia as useMedia5 } from "react-use";
|
6184
|
-
import { selectLocalPeerName, useHMSActions as useHMSActions16, useHMSStore as useHMSStore21 } from "@100mslive/react-sdk";
|
6185
|
-
|
6186
|
-
// src/Prebuilt/components/MoreSettings/ChangeNameContent.jsx
|
6187
|
-
import React49 from "react";
|
6188
|
-
import { ChevronLeftIcon as ChevronLeftIcon2, CrossIcon as CrossIcon7 } from "@100mslive/react-icons";
|
6189
|
-
var ChangeNameContent = ({
|
6190
|
-
changeName,
|
6191
|
-
setCurrentName,
|
6192
|
-
currentName,
|
6193
|
-
localPeerName,
|
6194
|
-
isMobile,
|
6195
|
-
onExit,
|
6196
|
-
onBackClick
|
6197
|
-
}) => {
|
6198
|
-
return /* @__PURE__ */ React49.createElement(
|
6199
|
-
"form",
|
6200
|
-
{
|
6201
|
-
onSubmit: (e) => __async(void 0, null, function* () {
|
6202
|
-
e.preventDefault();
|
6203
|
-
yield changeName();
|
6204
|
-
})
|
6205
|
-
},
|
6206
|
-
/* @__PURE__ */ React49.createElement(
|
6207
|
-
Text,
|
6208
|
-
{
|
6209
|
-
variant: isMobile ? "md" : "lg",
|
6210
|
-
css: {
|
6211
|
-
color: "$on_surface_high",
|
6212
|
-
fontWeight: "$semiBold",
|
6213
|
-
display: "flex",
|
6214
|
-
pb: "$4",
|
6215
|
-
"@md": { px: "$8", borderBottom: "1px solid $border_default" }
|
6216
|
-
}
|
6217
|
-
},
|
6218
|
-
isMobile ? /* @__PURE__ */ React49.createElement(ChevronLeftIcon2, { onClick: onBackClick, style: { marginRight: "0.5rem" } }) : null,
|
6219
|
-
"Change Name",
|
6220
|
-
/* @__PURE__ */ React49.createElement(
|
6221
|
-
Box,
|
6222
|
-
{
|
6223
|
-
css: { color: "inherit", ml: "auto", "&:hover": { color: "$on_surface_medium", cursor: "pointer" } },
|
6224
|
-
onClick: onExit
|
6225
|
-
},
|
6226
|
-
/* @__PURE__ */ React49.createElement(CrossIcon7, null)
|
6227
|
-
)
|
6228
|
-
),
|
6229
|
-
/* @__PURE__ */ React49.createElement(Text, { variant: "sm", css: { color: "$on_surface_medium", pb: "$6", mb: "$8", "@md": { px: "$8", mt: "$4" } } }, "Your name will be visible to other participants in the session."),
|
6230
|
-
/* @__PURE__ */ React49.createElement(Flex, { justify: "center", align: "center", css: { my: "$8", w: "100%", "@md": { px: "$8" } } }, /* @__PURE__ */ React49.createElement(
|
6231
|
-
Input,
|
6232
|
-
{
|
6233
|
-
css: { width: "100%", bg: "$surface_default" },
|
6234
|
-
value: currentName,
|
6235
|
-
type: isMobile ? "search" : "text",
|
6236
|
-
onChange: (e) => {
|
6237
|
-
setCurrentName(e.target.value);
|
6238
|
-
},
|
6239
|
-
autoComplete: "name",
|
6240
|
-
required: true,
|
6241
|
-
"data-testid": "change_name_field",
|
6242
|
-
onKeyDown: (e) => __async(void 0, null, function* () {
|
6243
|
-
if (e.key === "Enter" && currentName.trim().length > 0 && currentName !== localPeerName) {
|
6244
|
-
e.preventDefault();
|
6245
|
-
if (isMobile) {
|
6246
|
-
return;
|
6247
|
-
}
|
6248
|
-
changeName();
|
6249
|
-
}
|
6250
|
-
})
|
6251
|
-
}
|
6252
|
-
)),
|
6253
|
-
/* @__PURE__ */ React49.createElement(
|
6254
|
-
Flex,
|
6255
|
-
{
|
6256
|
-
justify: "between",
|
6257
|
-
align: "center",
|
6258
|
-
css: {
|
6259
|
-
width: "100%",
|
6260
|
-
gap: "$md",
|
6261
|
-
mt: "$10",
|
6262
|
-
"@md": { px: "$4" }
|
6263
|
-
}
|
6264
|
-
},
|
6265
|
-
isMobile ? null : /* @__PURE__ */ React49.createElement(
|
6266
|
-
Button,
|
6267
|
-
{
|
6268
|
-
variant: "standard",
|
6269
|
-
css: { w: "100%" },
|
6270
|
-
outlined: true,
|
6271
|
-
type: "submit",
|
6272
|
-
disabled: !localPeerName,
|
6273
|
-
onClick: onExit
|
6274
|
-
},
|
6275
|
-
"Cancel"
|
6276
|
-
),
|
6277
|
-
/* @__PURE__ */ React49.createElement(
|
6278
|
-
Button,
|
6279
|
-
{
|
6280
|
-
variant: "primary",
|
6281
|
-
css: { width: "100%" },
|
6282
|
-
type: "submit",
|
6283
|
-
disabled: !currentName.trim() || currentName.trim() === localPeerName,
|
6284
|
-
"data-testid": "popup_change_btn"
|
6285
|
-
},
|
6286
|
-
"Change"
|
6287
|
-
)
|
6288
|
-
)
|
6289
|
-
);
|
6290
|
-
};
|
6291
|
-
|
6292
|
-
// src/Prebuilt/components/MoreSettings/ChangeNameModal.jsx
|
6293
|
-
var ChangeNameModal = ({ onOpenChange, openParentSheet = null }) => {
|
6294
|
-
const [previewPreference, setPreviewPreference] = useUserPreferences(UserPreferencesKeys.PREVIEW);
|
6295
|
-
const hmsActions = useHMSActions16();
|
6296
|
-
const localPeerName = useHMSStore21(selectLocalPeerName);
|
6297
|
-
const [currentName, setCurrentName] = useState16(localPeerName);
|
6298
|
-
const isMobile = useMedia5(config.media.md);
|
6299
|
-
const changeName = () => __async(void 0, null, function* () {
|
6300
|
-
const name = currentName.trim();
|
6301
|
-
if (!name || name === localPeerName) {
|
6302
|
-
return;
|
6303
|
-
}
|
6304
|
-
try {
|
6305
|
-
yield hmsActions.changeName(name);
|
6306
|
-
setPreviewPreference(__spreadProps(__spreadValues({}, previewPreference || {}), {
|
6307
|
-
name
|
6308
|
-
}));
|
6309
|
-
} catch (error) {
|
6310
|
-
console.error("failed to update name", error);
|
6311
|
-
ToastManager.addToast({ title: error.message });
|
6312
|
-
} finally {
|
6313
|
-
onOpenChange(false);
|
6314
|
-
}
|
6315
|
-
});
|
6316
|
-
const props = {
|
6317
|
-
changeName,
|
6318
|
-
setCurrentName,
|
6319
|
-
currentName,
|
6320
|
-
localPeerName,
|
6321
|
-
isMobile,
|
6322
|
-
onExit: () => onOpenChange(false),
|
6323
|
-
onBackClick: () => {
|
6324
|
-
onOpenChange(false);
|
6325
|
-
openParentSheet();
|
6326
|
-
}
|
6327
|
-
};
|
6328
|
-
if (isMobile) {
|
6329
|
-
return /* @__PURE__ */ React50.createElement(Sheet.Root, { defaultOpen: true, onOpenChange }, /* @__PURE__ */ React50.createElement(Sheet.Content, { css: { bg: "$surface_dim", p: "$8 0" } }, /* @__PURE__ */ React50.createElement(ChangeNameContent, __spreadValues({}, props))));
|
6330
|
-
}
|
6331
|
-
return /* @__PURE__ */ React50.createElement(Dialog.Root, { defaultOpen: true, onOpenChange }, /* @__PURE__ */ React50.createElement(Dialog.Portal, null, /* @__PURE__ */ React50.createElement(Dialog.Overlay, null), /* @__PURE__ */ React50.createElement(Dialog.Content, { css: { bg: "$surface_dim", width: "min(400px,80%)", p: "$10" } }, /* @__PURE__ */ React50.createElement(ChangeNameContent, __spreadValues({}, props)))));
|
6332
|
-
};
|
6333
|
-
|
6334
|
-
// src/Prebuilt/components/TileMenu/TileMenuContent.jsx
|
6335
|
-
import React51, { Fragment as Fragment4 } from "react";
|
6336
|
-
import { useMedia as useMedia6 } from "react-use";
|
6337
|
-
import {
|
6338
|
-
selectPermissions as selectPermissions2,
|
6339
|
-
selectSessionStore as selectSessionStore2,
|
6340
|
-
selectTrackByID as selectTrackByID2,
|
6341
|
-
useCustomEvent as useCustomEvent2,
|
6342
|
-
useHMSActions as useHMSActions17,
|
6343
|
-
useHMSStore as useHMSStore22,
|
6344
|
-
useRemoteAVToggle
|
6345
|
-
} from "@100mslive/react-sdk";
|
6346
|
-
import {
|
6347
|
-
MicOffIcon as MicOffIcon2,
|
6348
|
-
MicOnIcon as MicOnIcon5,
|
6349
|
-
PencilIcon,
|
6350
|
-
PinIcon as PinIcon2,
|
6351
|
-
RemoveUserIcon,
|
6352
|
-
ShareScreenIcon as ShareScreenIcon2,
|
6353
|
-
ShrinkIcon,
|
6354
|
-
SpeakerIcon as SpeakerIcon3,
|
6355
|
-
StarIcon,
|
6356
|
-
VideoOffIcon as VideoOffIcon2,
|
6357
|
-
VideoOnIcon as VideoOnIcon3
|
6358
|
-
} from "@100mslive/react-icons";
|
6359
|
-
var isSameTile = ({ trackId, videoTrackID, audioTrackID }) => trackId && (videoTrackID && videoTrackID === trackId || audioTrackID && audioTrackID === trackId);
|
6360
|
-
var spacingCSS = { "@md": { my: "$8", fontWeight: "$semiBold", fontSize: "sm" } };
|
6361
|
-
var SpotlightActions = ({
|
6362
|
-
peerId,
|
6363
|
-
onSpotLightClick = () => {
|
6364
|
-
return;
|
6365
|
-
}
|
6366
|
-
}) => {
|
6367
|
-
const hmsActions = useHMSActions17();
|
6368
|
-
const spotlightPeerId = useHMSStore22(selectSessionStore2(SESSION_STORE_KEY.SPOTLIGHT));
|
6369
|
-
const isTileSpotlighted = spotlightPeerId === peerId;
|
6370
|
-
const setSpotlightPeerId = (peer) => hmsActions.sessionStore.set(SESSION_STORE_KEY.SPOTLIGHT, peer).catch((err) => ToastManager.addToast({ title: err.description }));
|
6371
|
-
return /* @__PURE__ */ React51.createElement(
|
6372
|
-
StyledMenuTile.ItemButton,
|
6373
|
-
{
|
6374
|
-
css: spacingCSS,
|
6375
|
-
onClick: () => {
|
6376
|
-
if (isTileSpotlighted) {
|
6377
|
-
setSpotlightPeerId();
|
6378
|
-
} else {
|
6379
|
-
setSpotlightPeerId(peerId);
|
6380
|
-
}
|
6381
|
-
onSpotLightClick();
|
6382
|
-
}
|
6383
|
-
},
|
6384
|
-
/* @__PURE__ */ React51.createElement(StarIcon, { height: 20, width: 20 }),
|
6385
|
-
/* @__PURE__ */ React51.createElement("span", null, isTileSpotlighted ? "Remove from Spotlight" : "Spotlight Tile for everyone")
|
6386
|
-
);
|
6387
|
-
};
|
6388
|
-
var PinActions = ({ audioTrackID, videoTrackID }) => {
|
6389
|
-
const [pinnedTrackId, setPinnedTrackId] = useSetAppDataByKey(APP_DATA.pinnedTrackId);
|
6390
|
-
const isTilePinned = isSameTile({
|
6391
|
-
trackId: pinnedTrackId,
|
6392
|
-
videoTrackID,
|
6393
|
-
audioTrackID
|
6394
|
-
});
|
6395
|
-
return /* @__PURE__ */ React51.createElement(React51.Fragment, null, /* @__PURE__ */ React51.createElement(
|
6396
|
-
StyledMenuTile.ItemButton,
|
6397
|
-
{
|
6398
|
-
css: spacingCSS,
|
6399
|
-
onClick: () => isTilePinned ? setPinnedTrackId() : setPinnedTrackId(videoTrackID || audioTrackID)
|
6400
|
-
},
|
6401
|
-
/* @__PURE__ */ React51.createElement(PinIcon2, { height: 20, width: 20 }),
|
6402
|
-
/* @__PURE__ */ React51.createElement("span", null, isTilePinned ? "Unpin" : "Pin", " Tile for myself")
|
6403
|
-
));
|
6404
|
-
};
|
6405
|
-
var MinimiseInset = () => {
|
6406
|
-
const [minimised, setMinimised] = useSetAppDataByKey(APP_DATA.minimiseInset);
|
6407
|
-
return /* @__PURE__ */ React51.createElement(React51.Fragment, null, /* @__PURE__ */ React51.createElement(StyledMenuTile.ItemButton, { css: spacingCSS, onClick: () => setMinimised(!minimised) }, /* @__PURE__ */ React51.createElement(ShrinkIcon, { height: 20, width: 20 }), /* @__PURE__ */ React51.createElement("span", null, minimised ? "Show" : "Minimise", " your video")));
|
6408
|
-
};
|
6409
|
-
var SimulcastLayers = ({ trackId }) => {
|
6410
|
-
var _a7;
|
6411
|
-
const track = useHMSStore22(selectTrackByID2(trackId));
|
6412
|
-
const actions = useHMSActions17();
|
6413
|
-
const bg = useDropdownSelection();
|
6414
|
-
if (!((_a7 = track == null ? void 0 : track.layerDefinitions) == null ? void 0 : _a7.length) || track.degraded || !track.enabled) {
|
6415
|
-
return null;
|
6416
|
-
}
|
6417
|
-
const currentLayer = track.layerDefinitions.find((layer) => layer.layer === track.layer);
|
6418
|
-
return /* @__PURE__ */ React51.createElement(Fragment4, null, /* @__PURE__ */ React51.createElement(StyledMenuTile.ItemButton, { css: { color: "$on_surface_medium", cursor: "default" } }, "Select maximum resolution"), track.layerDefinitions.map((layer) => {
|
6419
|
-
return /* @__PURE__ */ React51.createElement(
|
6420
|
-
StyledMenuTile.ItemButton,
|
6421
|
-
{
|
6422
|
-
key: layer.layer,
|
6423
|
-
onClick: () => __async(void 0, null, function* () {
|
6424
|
-
yield actions.setPreferredLayer(trackId, layer.layer);
|
6425
|
-
}),
|
6426
|
-
css: {
|
6427
|
-
justifyContent: "space-between",
|
6428
|
-
bg: track.preferredLayer === layer.layer ? bg : void 0,
|
6429
|
-
"&:hover": {
|
6430
|
-
bg: track.preferredLayer === layer.layer ? bg : void 0
|
6431
|
-
}
|
6432
|
-
}
|
6433
|
-
},
|
6434
|
-
/* @__PURE__ */ React51.createElement(
|
6435
|
-
Text,
|
6436
|
-
{
|
6437
|
-
as: "span",
|
6438
|
-
css: {
|
6439
|
-
textTransform: "capitalize",
|
6440
|
-
mr: "$2",
|
6441
|
-
fontWeight: track.preferredLayer === layer.layer ? "$semiBold" : "$regular",
|
6442
|
-
color: track.preferredLayer === layer.layer ? "$on_primary_high" : "$on_surface_high"
|
6443
|
-
}
|
6444
|
-
},
|
6445
|
-
layer.layer
|
6446
|
-
),
|
6447
|
-
/* @__PURE__ */ React51.createElement(
|
6448
|
-
Text,
|
6449
|
-
{
|
6450
|
-
as: "span",
|
6451
|
-
variant: "xs",
|
6452
|
-
css: {
|
6453
|
-
color: track.preferredLayer === layer.layer ? "$on_primary_high" : "$on_surface_high"
|
6454
|
-
}
|
6455
|
-
},
|
6456
|
-
layer.resolution.width,
|
6457
|
-
"x",
|
6458
|
-
layer.resolution.height
|
6459
|
-
)
|
6460
|
-
);
|
6461
|
-
}), /* @__PURE__ */ React51.createElement(StyledMenuTile.ItemButton, null, /* @__PURE__ */ React51.createElement(Text, { as: "span", variant: "xs", css: { color: "$on_surface_medium" } }, "Currently streaming:", /* @__PURE__ */ React51.createElement(
|
6462
|
-
Text,
|
6463
|
-
{
|
6464
|
-
as: "span",
|
6465
|
-
variant: "xs",
|
6466
|
-
css: {
|
6467
|
-
fontWeight: "$semiBold",
|
6468
|
-
textTransform: "capitalize",
|
6469
|
-
color: "$on_surface_medium",
|
6470
|
-
ml: "$2"
|
6471
|
-
}
|
6472
|
-
},
|
6473
|
-
currentLayer ? /* @__PURE__ */ React51.createElement(React51.Fragment, null, track.layer, " (", currentLayer.resolution.width, "x", currentLayer.resolution.height, ")") : "-"
|
6474
|
-
))));
|
6475
|
-
};
|
6476
|
-
var TileMenuContent = (props) => {
|
6477
|
-
const actions = useHMSActions17();
|
6478
|
-
const { removeOthers } = useHMSStore22(selectPermissions2);
|
6479
|
-
const {
|
6480
|
-
videoTrackID,
|
6481
|
-
audioTrackID,
|
6482
|
-
isLocal,
|
6483
|
-
isScreenshare,
|
6484
|
-
showSpotlight,
|
6485
|
-
showPinAction,
|
6486
|
-
peerID,
|
6487
|
-
canMinimise,
|
6488
|
-
closeSheetOnClick = () => {
|
6489
|
-
return;
|
6490
|
-
},
|
6491
|
-
openNameChangeModal = () => {
|
6492
|
-
return;
|
6493
|
-
}
|
6494
|
-
} = props;
|
6495
|
-
const { isAudioEnabled, isVideoEnabled, setVolume, toggleAudio, toggleVideo, volume } = useRemoteAVToggle(
|
6496
|
-
audioTrackID,
|
6497
|
-
videoTrackID
|
6498
|
-
);
|
6499
|
-
const { sendEvent } = useCustomEvent2({
|
6500
|
-
type: REMOTE_STOP_SCREENSHARE_TYPE
|
6501
|
-
});
|
6502
|
-
const isMobile = useMedia6(config.media.md);
|
6503
|
-
return isLocal ? (showPinAction || canMinimise) && /* @__PURE__ */ React51.createElement(React51.Fragment, null, showPinAction && /* @__PURE__ */ React51.createElement(PinActions, { audioTrackID, videoTrackID }), showSpotlight && /* @__PURE__ */ React51.createElement(SpotlightActions, { peerId: peerID, onSpotLightClick: () => closeSheetOnClick() }), canMinimise && /* @__PURE__ */ React51.createElement(MinimiseInset, null), /* @__PURE__ */ React51.createElement(
|
6504
|
-
StyledMenuTile.ItemButton,
|
6505
|
-
{
|
6506
|
-
onClick: () => {
|
6507
|
-
openNameChangeModal();
|
6508
|
-
closeSheetOnClick();
|
6509
|
-
}
|
6510
|
-
},
|
6511
|
-
/* @__PURE__ */ React51.createElement(PencilIcon, { height: 20, width: 20 }),
|
6512
|
-
/* @__PURE__ */ React51.createElement(Text, { variant: "sm", css: { "@md": { fontWeight: "$semiBold" }, c: "$on_surface_high" } }, "Change Name")
|
6513
|
-
)) : /* @__PURE__ */ React51.createElement(React51.Fragment, null, toggleVideo ? /* @__PURE__ */ React51.createElement(
|
6514
|
-
StyledMenuTile.ItemButton,
|
6515
|
-
{
|
6516
|
-
css: spacingCSS,
|
6517
|
-
onClick: () => {
|
6518
|
-
toggleVideo();
|
6519
|
-
closeSheetOnClick();
|
6520
|
-
},
|
6521
|
-
"data-testid": isVideoEnabled ? "mute_video_participant_btn" : "unmute_video_participant_btn"
|
6522
|
-
},
|
6523
|
-
isVideoEnabled ? /* @__PURE__ */ React51.createElement(VideoOnIcon3, { height: 20, width: 20 }) : /* @__PURE__ */ React51.createElement(VideoOffIcon2, { height: 20, width: 20 }),
|
6524
|
-
/* @__PURE__ */ React51.createElement("span", null, isVideoEnabled ? "Mute" : "Request Unmute")
|
6525
|
-
) : null, toggleAudio ? /* @__PURE__ */ React51.createElement(
|
6526
|
-
StyledMenuTile.ItemButton,
|
6527
|
-
{
|
6528
|
-
css: spacingCSS,
|
6529
|
-
onClick: () => {
|
6530
|
-
toggleAudio();
|
6531
|
-
closeSheetOnClick();
|
6532
|
-
},
|
6533
|
-
"data-testid": isVideoEnabled ? "mute_audio_participant_btn" : "unmute_audio_participant_btn"
|
6534
|
-
},
|
6535
|
-
isAudioEnabled ? /* @__PURE__ */ React51.createElement(MicOnIcon5, { height: 20, width: 20 }) : /* @__PURE__ */ React51.createElement(MicOffIcon2, { height: 20, width: 20 }),
|
6536
|
-
/* @__PURE__ */ React51.createElement("span", null, isAudioEnabled ? "Mute" : "Request Unmute")
|
6537
|
-
) : null, audioTrackID ? /* @__PURE__ */ React51.createElement(StyledMenuTile.VolumeItem, { "data-testid": "participant_volume_slider", css: __spreadProps(__spreadValues({}, spacingCSS), { mb: "$0" }) }, /* @__PURE__ */ React51.createElement(Flex, { align: "center", gap: 1 }, /* @__PURE__ */ React51.createElement(SpeakerIcon3, { height: 20, width: 20 }), /* @__PURE__ */ React51.createElement(Box, { as: "span", css: { ml: "$4" } }, "Volume (", volume, ")")), /* @__PURE__ */ React51.createElement(Slider, { css: { my: "0.5rem" }, step: 5, value: [volume], onValueChange: (e) => setVolume(e[0]) })) : null, showPinAction && /* @__PURE__ */ React51.createElement(React51.Fragment, null, /* @__PURE__ */ React51.createElement(PinActions, { audioTrackID, videoTrackID }), showSpotlight && /* @__PURE__ */ React51.createElement(SpotlightActions, { peerId: peerID, onSpotLightClick: () => closeSheetOnClick() })), isMobile ? null : /* @__PURE__ */ React51.createElement(SimulcastLayers, { trackId: videoTrackID }), removeOthers ? /* @__PURE__ */ React51.createElement(
|
6538
|
-
StyledMenuTile.RemoveItem,
|
6539
|
-
{
|
6540
|
-
css: __spreadProps(__spreadValues({}, spacingCSS), { borderTop: "none" }),
|
6541
|
-
onClick: () => __async(void 0, null, function* () {
|
6542
|
-
try {
|
6543
|
-
yield actions.removePeer(peerID, "");
|
6544
|
-
} catch (error) {
|
6545
|
-
}
|
6546
|
-
closeSheetOnClick();
|
6547
|
-
}),
|
6548
|
-
"data-testid": "remove_participant_btn"
|
6549
|
-
},
|
6550
|
-
/* @__PURE__ */ React51.createElement(RemoveUserIcon, { height: 20, width: 20 }),
|
6551
|
-
/* @__PURE__ */ React51.createElement("span", null, "Remove Participant")
|
6552
|
-
) : null, removeOthers && isScreenshare ? /* @__PURE__ */ React51.createElement(
|
6553
|
-
StyledMenuTile.RemoveItem,
|
6554
|
-
{
|
6555
|
-
onClick: () => {
|
6556
|
-
sendEvent({});
|
6557
|
-
closeSheetOnClick();
|
6558
|
-
},
|
6559
|
-
css: spacingCSS
|
6560
|
-
},
|
6561
|
-
/* @__PURE__ */ React51.createElement(ShareScreenIcon2, { height: 20, width: 20 }),
|
6562
|
-
/* @__PURE__ */ React51.createElement("span", null, "Stop Screenshare")
|
6563
|
-
) : null);
|
6564
|
-
};
|
6565
|
-
|
6566
|
-
// src/Prebuilt/components/hooks/useDropdownList.jsx
|
6567
|
-
import { useEffect as useEffect22 } from "react";
|
6568
|
-
var useDropdownList = ({ name, open }) => {
|
6569
|
-
const [dropdownList = [], setDropdownList] = useSetAppDataByKey(APP_DATA.dropdownList);
|
6570
|
-
useEffect22(() => {
|
6571
|
-
if (open) {
|
6572
|
-
if (!dropdownList.includes(name)) {
|
6573
|
-
setDropdownList([...dropdownList, name]);
|
6574
|
-
}
|
6575
|
-
} else {
|
6576
|
-
const index = dropdownList.indexOf(name);
|
6577
|
-
if (index >= 0) {
|
6578
|
-
const newDropdownList = [...dropdownList];
|
6579
|
-
newDropdownList.splice(index, 1);
|
6580
|
-
setDropdownList(newDropdownList);
|
6581
|
-
}
|
6582
|
-
}
|
6583
|
-
}, [open, name]);
|
6584
|
-
};
|
6585
|
-
|
6586
|
-
// src/Prebuilt/components/TileMenu/TileMenu.jsx
|
6587
|
-
var TileMenu = ({
|
6588
|
-
audioTrackID,
|
6589
|
-
videoTrackID,
|
6590
|
-
peerID,
|
6591
|
-
isScreenshare = false,
|
6592
|
-
canMinimise,
|
6593
|
-
enableSpotlightingPeer = true
|
6594
|
-
}) => {
|
6595
|
-
var _a7, _b7;
|
6596
|
-
const [open, setOpen] = useState17(false);
|
6597
|
-
const { theme: theme2 } = useTheme();
|
6598
|
-
const localPeerID = useHMSStore23(selectLocalPeerID4);
|
6599
|
-
const isLocal = localPeerID === peerID;
|
6600
|
-
const { removeOthers } = useHMSStore23(selectPermissions3);
|
6601
|
-
const { setVolume, toggleAudio, toggleVideo } = useRemoteAVToggle2(audioTrackID, videoTrackID);
|
6602
|
-
const showSpotlight = enableSpotlightingPeer;
|
6603
|
-
const isPrimaryVideoTrack = ((_a7 = useHMSStore23(selectVideoTrackByPeerID2(peerID))) == null ? void 0 : _a7.id) === videoTrackID;
|
6604
|
-
const showPinAction = audioTrackID || videoTrackID && isPrimaryVideoTrack;
|
6605
|
-
const track = useHMSStore23(selectTrackByID3(videoTrackID));
|
6606
|
-
const hideSimulcastLayers = !((_b7 = track == null ? void 0 : track.layerDefinitions) == null ? void 0 : _b7.length) || track.degraded || !track.enabled;
|
6607
|
-
const isMobile = useMedia7(config.media.md);
|
6608
|
-
const peer = useHMSStore23(selectPeerByID2(peerID));
|
6609
|
-
const [showNameChangeModal, setShowNameChangeModal] = useState17(false);
|
6610
|
-
useDropdownList({ open, name: "TileMenu" });
|
6611
|
-
if (!(removeOthers || toggleAudio || toggleVideo || setVolume || showPinAction) && hideSimulcastLayers) {
|
6612
|
-
return null;
|
6613
|
-
}
|
6614
|
-
const openNameChangeModal = () => setShowNameChangeModal(true);
|
6615
|
-
const props = {
|
6616
|
-
isLocal,
|
6617
|
-
isScreenshare,
|
6618
|
-
audioTrackID,
|
6619
|
-
videoTrackID,
|
6620
|
-
peerID,
|
6621
|
-
isPrimaryVideoTrack,
|
6622
|
-
showSpotlight,
|
6623
|
-
showPinAction,
|
6624
|
-
canMinimise,
|
6625
|
-
openNameChangeModal
|
6626
|
-
};
|
6627
|
-
return /* @__PURE__ */ React52.createElement(React52.Fragment, null, /* @__PURE__ */ React52.createElement(StyledMenuTile.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React52.createElement(
|
6628
|
-
StyledMenuTile.Trigger,
|
6629
|
-
{
|
6630
|
-
"data-testid": "participant_menu_btn",
|
6631
|
-
css: { bg: `${theme2.colors.background_dim.value}A3`, p: "$2", w: "unset", h: "unset" },
|
6632
|
-
onClick: (e) => e.stopPropagation(),
|
6633
|
-
className: isMobile ? "__cancel-drag-event" : ""
|
6634
|
-
},
|
6635
|
-
/* @__PURE__ */ React52.createElement(VerticalMenuIcon2, { width: 20, height: 20 })
|
6636
|
-
), isMobile ? /* @__PURE__ */ React52.createElement(Sheet.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React52.createElement(Sheet.Content, { css: { bg: "$surface_dim", pt: "$8" } }, /* @__PURE__ */ React52.createElement(
|
6637
|
-
Flex,
|
6638
|
-
{
|
6639
|
-
css: {
|
6640
|
-
color: "$on_surface_high",
|
6641
|
-
display: "flex",
|
6642
|
-
w: "100%",
|
6643
|
-
justifyContent: "space-between",
|
6644
|
-
alignItems: "center",
|
6645
|
-
px: "$10",
|
6646
|
-
pb: "$8",
|
6647
|
-
borderBottom: "1px solid $border_default"
|
6648
|
-
}
|
6649
|
-
},
|
6650
|
-
/* @__PURE__ */ React52.createElement(Box, null, /* @__PURE__ */ React52.createElement(Text, { css: { color: "$on_surface_high", fontWeight: "$semiBold" } }, peer.name, isLocal ? ` (You)` : null), (peer == null ? void 0 : peer.roleName) ? /* @__PURE__ */ React52.createElement(Text, { variant: "xs", css: { color: "$on_surface_low", mt: "$2" } }, peer.roleName) : null),
|
6651
|
-
/* @__PURE__ */ React52.createElement(Sheet.Close, { css: { color: "inherit" } }, /* @__PURE__ */ React52.createElement(CrossIcon8, null))
|
6652
|
-
), /* @__PURE__ */ React52.createElement(Box, { css: { px: "$8", pb: "$8", maxHeight: "80vh", overflowY: "auto" } }, /* @__PURE__ */ React52.createElement(TileMenuContent, __spreadProps(__spreadValues({}, props), { closeSheetOnClick: () => setOpen(false) }))))) : /* @__PURE__ */ React52.createElement(StyledMenuTile.Content, { side: "top", align: "end", css: { maxHeight: "$80", overflowY: "auto" } }, /* @__PURE__ */ React52.createElement(TileMenuContent, __spreadValues({}, props)))), showNameChangeModal && /* @__PURE__ */ React52.createElement(ChangeNameModal, { onOpenChange: setShowNameChangeModal }));
|
6653
|
-
};
|
6654
|
-
var TileMenu_default = TileMenu;
|
6655
|
-
|
6656
|
-
// src/Prebuilt/components/peerTileUtils.jsx
|
6657
|
-
var PEER_NAME_PLACEHOLDER = "peerName";
|
6658
|
-
var labelMap = /* @__PURE__ */ new Map([
|
6659
|
-
[[true, "screen"].toString(), "Your Screen"],
|
6660
|
-
[[true, "regular"].toString(), `You (${PEER_NAME_PLACEHOLDER})`],
|
6661
|
-
[[false, "screen"].toString(), `${PEER_NAME_PLACEHOLDER}'s Screen`],
|
6662
|
-
[[false, "regular"].toString(), PEER_NAME_PLACEHOLDER],
|
6663
|
-
[[true, void 0].toString(), `You (${PEER_NAME_PLACEHOLDER})`],
|
6664
|
-
[[false, void 0].toString(), `${PEER_NAME_PLACEHOLDER}`]
|
6665
|
-
]);
|
6666
|
-
var getVideoTileLabel = ({ peerName, isLocal, track }) => {
|
6667
|
-
const isPeerPresent = peerName !== void 0;
|
6668
|
-
if (!isPeerPresent || !track) {
|
6669
|
-
return isPeerPresent ? labelMap.get([isLocal, void 0].toString()).replace(PEER_NAME_PLACEHOLDER, peerName) : "";
|
6670
|
-
}
|
6671
|
-
const isLocallyMuted = track.volume === 0;
|
6672
|
-
let label = labelMap.get([isLocal, track.source].toString());
|
6673
|
-
if (label) {
|
6674
|
-
label = label.replace(PEER_NAME_PLACEHOLDER, peerName);
|
6675
|
-
} else {
|
6676
|
-
label = `${peerName} ${track.source}`;
|
6677
|
-
}
|
6678
|
-
return `${label}${isLocallyMuted ? " (Muted for you)" : ""}`;
|
6679
|
-
};
|
6680
|
-
|
6681
|
-
// src/Prebuilt/components/VideoTile.jsx
|
6682
|
-
var Tile = ({
|
6683
|
-
peerId,
|
6684
|
-
trackId,
|
6685
|
-
width,
|
6686
|
-
height,
|
6687
|
-
objectFit = "cover",
|
6688
|
-
canMinimise = false,
|
6689
|
-
isDragabble = false,
|
6690
|
-
rootCSS = {},
|
6691
|
-
containerCSS = {},
|
6692
|
-
enableSpotlightingPeer = true,
|
6693
|
-
hideParticipantNameOnTile = false,
|
6694
|
-
roundedVideoTile = true,
|
6695
|
-
hideAudioMuteOnTile = false,
|
6696
|
-
hideMetadataOnTile = false
|
6697
|
-
}) => {
|
6698
|
-
var _a7, _b7;
|
6699
|
-
const trackSelector = trackId ? selectVideoTrackByID4(trackId) : selectVideoTrackByPeerID3(peerId);
|
6700
|
-
const track = useHMSStore24(trackSelector);
|
6701
|
-
const isMobile = useMedia8(config.media.md);
|
6702
|
-
const peerName = useHMSStore24(selectPeerNameByID(peerId));
|
6703
|
-
const audioTrack = useHMSStore24(selectAudioTrackByPeerID2(peerId));
|
6704
|
-
const localPeerID = useHMSStore24(selectLocalPeerID5);
|
6705
|
-
const isAudioOnly = useUISettings(UI_SETTINGS.isAudioOnly);
|
6706
|
-
const mirrorLocalVideo = useUISettings(UI_SETTINGS.mirrorLocalVideo);
|
6707
|
-
const showStatsOnTiles = useUISettings(UI_SETTINGS.showStatsOnTiles);
|
6708
|
-
const isAudioMuted = !useHMSStore24(selectIsPeerAudioEnabled(peerId));
|
6709
|
-
const isVideoMuted = !(track == null ? void 0 : track.enabled);
|
6710
|
-
const [isMouseHovered, setIsMouseHovered] = useState18(false);
|
6711
|
-
const isVideoDegraded = track == null ? void 0 : track.degraded;
|
6712
|
-
const isLocal = localPeerID === peerId;
|
6713
|
-
const [pinnedTrackId] = useSetAppDataByKey(APP_DATA.pinnedTrackId);
|
6714
|
-
const pinned = isSameTile({
|
6715
|
-
trackId: pinnedTrackId,
|
6716
|
-
videoTrackID: track == null ? void 0 : track.id,
|
6717
|
-
audioTrackID: audioTrack == null ? void 0 : audioTrack.id
|
6718
|
-
});
|
6719
|
-
const spotlighted = useHMSStore24(selectSessionStore3(SESSION_STORE_KEY.SPOTLIGHT)) === peerId;
|
6720
|
-
const label = getVideoTileLabel({
|
6721
|
-
peerName,
|
6722
|
-
track,
|
6723
|
-
isLocal
|
6724
|
-
});
|
6725
|
-
const onHoverHandler = useCallback16((event) => {
|
6726
|
-
setIsMouseHovered(event.type === "mouseenter");
|
6727
|
-
}, []);
|
6728
|
-
const ref = useRef7(null);
|
6729
|
-
const calculatedHeight = ((_a7 = ref.current) == null ? void 0 : _a7.clientHeight) || "";
|
6730
|
-
const calculatedWidth = ((_b7 = ref.current) == null ? void 0 : _b7.clientWidth) || "";
|
6731
|
-
const isTileBigEnoughToShowStats = calculatedHeight >= 180 && calculatedWidth >= 180;
|
6732
|
-
const avatarSize = useMemo3(() => {
|
6733
|
-
if (!calculatedWidth || !calculatedHeight) {
|
6734
|
-
return void 0;
|
6735
|
-
}
|
6736
|
-
if (calculatedWidth <= 150 || calculatedHeight <= 150) {
|
6737
|
-
return "small";
|
6738
|
-
} else if (calculatedWidth <= 300 || calculatedHeight <= 300) {
|
6739
|
-
return "medium";
|
6740
|
-
}
|
6741
|
-
return "large";
|
6742
|
-
}, [calculatedWidth, calculatedHeight]);
|
6743
|
-
return /* @__PURE__ */ React53.createElement(
|
6744
|
-
StyledVideoTile.Root,
|
6745
|
-
{
|
6746
|
-
ref,
|
6747
|
-
css: __spreadValues({
|
6748
|
-
width,
|
6749
|
-
height
|
6750
|
-
}, rootCSS),
|
6751
|
-
"data-testid": `participant_tile_${peerName}`
|
6752
|
-
},
|
6753
|
-
peerName !== void 0 ? /* @__PURE__ */ React53.createElement(
|
6754
|
-
StyledVideoTile.Container,
|
6755
|
-
{
|
6756
|
-
onMouseEnter: onHoverHandler,
|
6757
|
-
onMouseLeave: onHoverHandler,
|
6758
|
-
noRadius: !roundedVideoTile,
|
6759
|
-
css: containerCSS
|
6760
|
-
},
|
6761
|
-
showStatsOnTiles && isTileBigEnoughToShowStats ? /* @__PURE__ */ React53.createElement(VideoTileStats, { audioTrackID: audioTrack == null ? void 0 : audioTrack.id, videoTrackID: track == null ? void 0 : track.id, peerID: peerId, isLocal }) : null,
|
6762
|
-
/* @__PURE__ */ React53.createElement(
|
6763
|
-
Video,
|
6764
|
-
{
|
6765
|
-
trackId: track == null ? void 0 : track.id,
|
6766
|
-
attach: isLocal ? void 0 : !isAudioOnly,
|
6767
|
-
mirror: mirrorLocalVideo && peerId === localPeerID && (track == null ? void 0 : track.source) === "regular" && (track == null ? void 0 : track.facingMode) !== "environment",
|
6768
|
-
noRadius: !roundedVideoTile,
|
6769
|
-
"data-testid": "participant_video_tile",
|
6770
|
-
css: {
|
6771
|
-
objectFit,
|
6772
|
-
filter: isVideoDegraded ? "blur($space$2)" : void 0,
|
6773
|
-
bg: "transparent"
|
6774
|
-
}
|
6775
|
-
}
|
6776
|
-
),
|
6777
|
-
isVideoMuted || !isLocal && isAudioOnly ? /* @__PURE__ */ React53.createElement(StyledVideoTile.AvatarContainer, null, /* @__PURE__ */ React53.createElement(Avatar, { name: peerName || "", "data-testid": "participant_avatar_icon", size: avatarSize })) : null,
|
6778
|
-
!hideAudioMuteOnTile ? isAudioMuted ? /* @__PURE__ */ React53.createElement(
|
6779
|
-
StyledVideoTile.AudioIndicator,
|
6780
|
-
{
|
6781
|
-
"data-testid": "participant_audio_mute_icon",
|
6782
|
-
size: getAttributeBoxSize(calculatedWidth, calculatedHeight)
|
6783
|
-
},
|
6784
|
-
/* @__PURE__ */ React53.createElement(MicOffIcon3, null)
|
6785
|
-
) : /* @__PURE__ */ React53.createElement(AudioLevel, { trackId: audioTrack == null ? void 0 : audioTrack.id }) : null,
|
6786
|
-
isMouseHovered || isDragabble && isMobile ? /* @__PURE__ */ React53.createElement(
|
6787
|
-
TileMenu_default,
|
6788
|
-
{
|
6789
|
-
peerID: peerId,
|
6790
|
-
audioTrackID: audioTrack == null ? void 0 : audioTrack.id,
|
6791
|
-
videoTrackID: track == null ? void 0 : track.id,
|
6792
|
-
canMinimise,
|
6793
|
-
enableSpotlightingPeer
|
6794
|
-
}
|
6795
|
-
) : null,
|
6796
|
-
!hideMetadataOnTile && /* @__PURE__ */ React53.createElement(PeerMetadata, { peerId, height: calculatedHeight, width: calculatedWidth }),
|
6797
|
-
/* @__PURE__ */ React53.createElement(
|
6798
|
-
TileConnection_default,
|
6799
|
-
{
|
6800
|
-
hideLabel: hideParticipantNameOnTile,
|
6801
|
-
name: label,
|
6802
|
-
isTile: true,
|
6803
|
-
peerId,
|
6804
|
-
width,
|
6805
|
-
pinned,
|
6806
|
-
spotlighted
|
6807
|
-
}
|
6808
|
-
)
|
6809
|
-
) : null
|
6810
|
-
);
|
6811
|
-
};
|
6812
|
-
var heightAnimation = (value) => keyframes({
|
6813
|
-
"50%": {
|
6814
|
-
transform: `scale3d(1,${value},1)`
|
6815
|
-
},
|
6816
|
-
"100%": {
|
6817
|
-
transform: `scale3d(1,1,1)`
|
6818
|
-
}
|
6819
|
-
});
|
6820
|
-
var AudioLevelIndicator = ({ trackId, value, delay }) => {
|
6821
|
-
const vanillaStore = useHMSVanillaStore6();
|
6822
|
-
const ref = useRef7();
|
6823
|
-
useEffect23(() => {
|
6824
|
-
const unsubscribe = vanillaStore.subscribe((audioLevel) => {
|
6825
|
-
if (ref.current) {
|
6826
|
-
ref.current.style["animation"] = `${heightAnimation(
|
6827
|
-
audioLevel ? value : 1
|
6828
|
-
)} 0.3s cubic-bezier(0.61, 1, 0.88, 1) infinite ${delay}s`;
|
6829
|
-
}
|
6830
|
-
}, selectTrackAudioByID(trackId));
|
6831
|
-
return unsubscribe;
|
6832
|
-
}, [vanillaStore, trackId, value, delay]);
|
6833
|
-
return /* @__PURE__ */ React53.createElement(
|
6834
|
-
Box,
|
6835
|
-
{
|
6836
|
-
ref,
|
6837
|
-
css: {
|
6838
|
-
w: 4,
|
6839
|
-
height: 6,
|
6840
|
-
r: 2,
|
6841
|
-
bg: "$on_primary_high"
|
6842
|
-
}
|
6843
|
-
}
|
6844
|
-
);
|
6845
|
-
};
|
6846
|
-
var AudioLevel = ({ trackId }) => {
|
6847
|
-
return /* @__PURE__ */ React53.createElement(StyledVideoTile.AudioIndicator, null, /* @__PURE__ */ React53.createElement(Flex, { align: "center", justify: "center", css: { gap: "$2" } }, [3, 2, 3].map((v, i) => /* @__PURE__ */ React53.createElement(AudioLevelIndicator, { trackId, value: v, delay: i * 0.15, key: i }))));
|
6848
|
-
};
|
6849
|
-
var PeerMetadata = ({ peerId, height, width }) => {
|
6850
|
-
const metaData = useHMSStore24(selectPeerMetadata2(peerId));
|
6851
|
-
const isBRB = (metaData == null ? void 0 : metaData.isBRBOn) || false;
|
6852
|
-
const isHandRaised = useHMSStore24(selectHasPeerHandRaised3(peerId));
|
6853
|
-
return /* @__PURE__ */ React53.createElement(Fragment5, null, isHandRaised ? /* @__PURE__ */ React53.createElement(StyledVideoTile.AttributeBox, { size: getAttributeBoxSize(width, height), "data-testid": "raiseHand_icon_onTile" }, /* @__PURE__ */ React53.createElement(HandIcon3, { width: 24, height: 24 })) : null, isBRB ? /* @__PURE__ */ React53.createElement(StyledVideoTile.AttributeBox, { size: getAttributeBoxSize(width, height), "data-testid": "brb_icon_onTile" }, /* @__PURE__ */ React53.createElement(BrbTileIcon, { width: 22, height: 22 })) : null);
|
6854
|
-
};
|
6855
|
-
var VideoTile = React53.memo(Tile);
|
6856
|
-
var VideoTile_default = VideoTile;
|
6857
|
-
|
6858
6227
|
// src/Prebuilt/components/Preview/PreviewForm.tsx
|
6859
|
-
import
|
6860
|
-
import { useMedia as
|
6228
|
+
import React51 from "react";
|
6229
|
+
import { useMedia as useMedia5 } from "react-use";
|
6861
6230
|
import { JoinForm_JoinBtnType as JoinForm_JoinBtnType2 } from "@100mslive/types-prebuilt/elements/join_form";
|
6862
6231
|
import { useRecordingStreaming as useRecordingStreaming3 } from "@100mslive/react-sdk";
|
6863
6232
|
import { RadioIcon } from "@100mslive/react-icons";
|
@@ -6873,18 +6242,18 @@ var PreviewForm = ({
|
|
6873
6242
|
const formSubmit = (e) => {
|
6874
6243
|
e.preventDefault();
|
6875
6244
|
};
|
6876
|
-
const isMobile =
|
6245
|
+
const isMobile = useMedia5(config.media.md);
|
6877
6246
|
const { isHLSRunning } = useRecordingStreaming3();
|
6878
6247
|
const layout = useRoomLayout();
|
6879
6248
|
const { join_form: joinForm = {} } = ((_c = (_b7 = (_a7 = layout == null ? void 0 : layout.screens) == null ? void 0 : _a7.preview) == null ? void 0 : _b7.default) == null ? void 0 : _c.elements) || {};
|
6880
6249
|
const showGoLive = (joinForm == null ? void 0 : joinForm.join_btn_type) === JoinForm_JoinBtnType2.JOIN_BTN_TYPE_JOIN_AND_GO_LIVE && !isHLSRunning;
|
6881
|
-
return /* @__PURE__ */
|
6250
|
+
return /* @__PURE__ */ React51.createElement(
|
6882
6251
|
Form,
|
6883
6252
|
{
|
6884
6253
|
css: { flexDirection: cannotPublishVideo ? "column" : "row", "@md": { flexDirection: "row" } },
|
6885
6254
|
onSubmit: formSubmit
|
6886
6255
|
},
|
6887
|
-
/* @__PURE__ */
|
6256
|
+
/* @__PURE__ */ React51.createElement(Flex, { align: "center", css: { gap: "$8", w: "100%" } }, /* @__PURE__ */ React51.createElement(
|
6888
6257
|
Input,
|
6889
6258
|
{
|
6890
6259
|
required: true,
|
@@ -6905,8 +6274,8 @@ var PreviewForm = ({
|
|
6905
6274
|
}
|
6906
6275
|
}
|
6907
6276
|
}
|
6908
|
-
), cannotPublishAudio && cannotPublishVideo && !isMobile ? /* @__PURE__ */
|
6909
|
-
/* @__PURE__ */
|
6277
|
+
), cannotPublishAudio && cannotPublishVideo && !isMobile ? /* @__PURE__ */ React51.createElement(PreviewSettings, null) : null),
|
6278
|
+
/* @__PURE__ */ React51.createElement(Button, { type: "submit", icon: true, disabled: !name || !enableJoin, onClick: onJoin }, showGoLive ? /* @__PURE__ */ React51.createElement(RadioIcon, { height: 18, width: 18 }) : null, showGoLive ? joinForm.go_live_btn_label : joinForm.join_btn_label)
|
6910
6279
|
);
|
6911
6280
|
};
|
6912
6281
|
var Form = styled("form", {
|
@@ -6923,7 +6292,7 @@ var Form = styled("form", {
|
|
6923
6292
|
var PreviewForm_default = PreviewForm;
|
6924
6293
|
|
6925
6294
|
// src/Prebuilt/components/Preview/PreviewJoin.tsx
|
6926
|
-
var VirtualBackground =
|
6295
|
+
var VirtualBackground = React52.lazy(() => import("./VirtualBackground-GP4ATXD3.js"));
|
6927
6296
|
var getParticipantChipContent = (peerCount = 0) => {
|
6928
6297
|
if (peerCount === 0) {
|
6929
6298
|
return "You are the first to join";
|
@@ -6944,9 +6313,9 @@ var PreviewJoin = ({
|
|
6944
6313
|
);
|
6945
6314
|
const { isStreamingOn } = useRecordingStreaming4();
|
6946
6315
|
const authToken = useAuthToken();
|
6947
|
-
const [name, setName] =
|
6316
|
+
const [name, setName] = useState16(initialName || previewPreference.name);
|
6948
6317
|
const { toggleAudio, toggleVideo } = useAVToggle2();
|
6949
|
-
const [previewError, setPreviewError] =
|
6318
|
+
const [previewError, setPreviewError] = useState16(false);
|
6950
6319
|
const { endpoints } = useHMSPrebuiltContext();
|
6951
6320
|
const { peerCount } = useParticipants();
|
6952
6321
|
const { enableJoin, preview, join } = usePreviewJoin({
|
@@ -6966,8 +6335,8 @@ var PreviewJoin = ({
|
|
6966
6335
|
},
|
6967
6336
|
asRole
|
6968
6337
|
});
|
6969
|
-
const roomState =
|
6970
|
-
const savePreferenceAndJoin =
|
6338
|
+
const roomState = useHMSStore21(selectRoomState6);
|
6339
|
+
const savePreferenceAndJoin = useCallback16(() => {
|
6971
6340
|
setPreviewPreference({
|
6972
6341
|
name
|
6973
6342
|
});
|
@@ -6976,11 +6345,11 @@ var PreviewJoin = ({
|
|
6976
6345
|
}, [join, name, setPreviewPreference, onJoin]);
|
6977
6346
|
const roomLayout = useRoomLayout();
|
6978
6347
|
const { preview_header: previewHeader = {} } = ((_c = (_b7 = (_a7 = roomLayout == null ? void 0 : roomLayout.screens) == null ? void 0 : _a7.preview) == null ? void 0 : _b7.default) == null ? void 0 : _c.elements) || {};
|
6979
|
-
const localPeer =
|
6980
|
-
const videoTrack =
|
6981
|
-
const isMobile =
|
6348
|
+
const localPeer = useHMSStore21(selectLocalPeer);
|
6349
|
+
const videoTrack = useHMSStore21(selectVideoTrackByID4(localPeer == null ? void 0 : localPeer.videoTrack));
|
6350
|
+
const isMobile = useMedia6(config.media.md);
|
6982
6351
|
const aspectRatio = (videoTrack == null ? void 0 : videoTrack.width) && (videoTrack == null ? void 0 : videoTrack.height) ? videoTrack.width / videoTrack.height : isMobile ? 9 / 16 : 16 / 9;
|
6983
|
-
|
6352
|
+
useEffect23(() => {
|
6984
6353
|
if (authToken) {
|
6985
6354
|
if (skipPreview) {
|
6986
6355
|
savePreferenceAndJoin();
|
@@ -6989,34 +6358,34 @@ var PreviewJoin = ({
|
|
6989
6358
|
}
|
6990
6359
|
}
|
6991
6360
|
}, [authToken, skipPreview]);
|
6992
|
-
|
6361
|
+
useEffect23(() => {
|
6993
6362
|
if (initialName) {
|
6994
6363
|
setName(initialName);
|
6995
6364
|
}
|
6996
6365
|
}, [initialName]);
|
6997
|
-
return roomState === HMSRoomState6.Preview ? /* @__PURE__ */
|
6366
|
+
return roomState === HMSRoomState6.Preview ? /* @__PURE__ */ React52.createElement(Container3, { css: { h: "100%", pt: "$10", "@md": { justifyContent: "space-between" } } }, toggleVideo ? null : /* @__PURE__ */ React52.createElement(Box, null), /* @__PURE__ */ React52.createElement(Flex, { direction: "column", justify: "center", css: { w: "100%", maxWidth: "640px" } }, /* @__PURE__ */ React52.createElement(Logo, null), /* @__PURE__ */ React52.createElement(
|
6998
6367
|
Text,
|
6999
6368
|
{
|
7000
6369
|
variant: "h4",
|
7001
6370
|
css: { wordBreak: "break-word", textAlign: "center", mt: "$14", mb: "$4", "@md": { mt: "$8", mb: "$2" } }
|
7002
6371
|
},
|
7003
6372
|
previewHeader.title
|
7004
|
-
), /* @__PURE__ */
|
6373
|
+
), /* @__PURE__ */ React52.createElement(
|
7005
6374
|
Text,
|
7006
6375
|
{
|
7007
6376
|
css: { c: "$on_surface_medium", my: "0", textAlign: "center", maxWidth: "100%", wordWrap: "break-word" },
|
7008
6377
|
variant: "sm"
|
7009
6378
|
},
|
7010
6379
|
previewHeader.sub_title
|
7011
|
-
), /* @__PURE__ */
|
6380
|
+
), /* @__PURE__ */ React52.createElement(Flex, { justify: "center", css: { mt: "$14", "@md": { mt: "$8", mb: "0" }, gap: "$4" } }, isStreamingOn ? /* @__PURE__ */ React52.createElement(
|
7012
6381
|
Chip_default,
|
7013
6382
|
{
|
7014
6383
|
content: "LIVE",
|
7015
6384
|
backgroundColor: "$alert_error_default",
|
7016
6385
|
textColor: "#FFF",
|
7017
|
-
icon: /* @__PURE__ */
|
6386
|
+
icon: /* @__PURE__ */ React52.createElement(Box, { css: { h: "$sm", w: "$sm", backgroundColor: "$on_primary_high", borderRadius: "$round" } })
|
7018
6387
|
}
|
7019
|
-
) : null, /* @__PURE__ */
|
6388
|
+
) : null, /* @__PURE__ */ React52.createElement(Chip_default, { content: getParticipantChipContent(peerCount), hideIfNoContent: true }))), toggleVideo ? /* @__PURE__ */ React52.createElement(
|
7020
6389
|
Flex,
|
7021
6390
|
{
|
7022
6391
|
align: "center",
|
@@ -7028,8 +6397,8 @@ var PreviewJoin = ({
|
|
7028
6397
|
flexDirection: "column"
|
7029
6398
|
}
|
7030
6399
|
},
|
7031
|
-
/* @__PURE__ */
|
7032
|
-
) : null, /* @__PURE__ */
|
6400
|
+
/* @__PURE__ */ React52.createElement(PreviewTile, { name, error: previewError })
|
6401
|
+
) : null, /* @__PURE__ */ React52.createElement(Box, { css: { w: "100%", maxWidth: `${Math.max(aspectRatio, 1) * 360}px` } }, /* @__PURE__ */ React52.createElement(PreviewControls, { hideSettings: !toggleVideo && !toggleAudio }), /* @__PURE__ */ React52.createElement(
|
7033
6402
|
PreviewForm_default,
|
7034
6403
|
{
|
7035
6404
|
name,
|
@@ -7039,7 +6408,7 @@ var PreviewJoin = ({
|
|
7039
6408
|
cannotPublishVideo: !toggleVideo,
|
7040
6409
|
cannotPublishAudio: !toggleAudio
|
7041
6410
|
}
|
7042
|
-
))) : /* @__PURE__ */
|
6411
|
+
))) : /* @__PURE__ */ React52.createElement(FullPageProgress_default, null);
|
7043
6412
|
};
|
7044
6413
|
var Container3 = styled("div", __spreadProps(__spreadValues({
|
7045
6414
|
width: "100%"
|
@@ -7048,17 +6417,17 @@ var Container3 = styled("div", __spreadProps(__spreadValues({
|
|
7048
6417
|
px: "$10"
|
7049
6418
|
}));
|
7050
6419
|
var PreviewTile = ({ name, error }) => {
|
7051
|
-
const localPeer =
|
6420
|
+
const localPeer = useHMSStore21(selectLocalPeer);
|
7052
6421
|
const { isLocalAudioEnabled, toggleAudio } = useAVToggle2();
|
7053
|
-
const isVideoOn =
|
6422
|
+
const isVideoOn = useHMSStore21(selectIsLocalVideoEnabled5);
|
7054
6423
|
const mirrorLocalVideo = useUISettings(UI_SETTINGS.mirrorLocalVideo);
|
7055
|
-
const trackSelector =
|
7056
|
-
const track =
|
6424
|
+
const trackSelector = selectVideoTrackByID4(localPeer == null ? void 0 : localPeer.videoTrack);
|
6425
|
+
const track = useHMSStore21(trackSelector);
|
7057
6426
|
const showMuteIcon = !isLocalAudioEnabled || !toggleAudio;
|
7058
|
-
const videoTrack =
|
7059
|
-
const isMobile =
|
6427
|
+
const videoTrack = useHMSStore21(selectVideoTrackByID4(localPeer == null ? void 0 : localPeer.videoTrack));
|
6428
|
+
const isMobile = useMedia6(config.media.md);
|
7060
6429
|
const aspectRatio = (videoTrack == null ? void 0 : videoTrack.width) && (videoTrack == null ? void 0 : videoTrack.height) ? videoTrack.width / videoTrack.height : isMobile ? 9 / 16 : 16 / 9;
|
7061
|
-
return /* @__PURE__ */
|
6430
|
+
return /* @__PURE__ */ React52.createElement(
|
7062
6431
|
StyledVideoTile.Container,
|
7063
6432
|
{
|
7064
6433
|
css: {
|
@@ -7074,20 +6443,20 @@ var PreviewTile = ({ name, error }) => {
|
|
7074
6443
|
}
|
7075
6444
|
}
|
7076
6445
|
},
|
7077
|
-
localPeer ? /* @__PURE__ */
|
6446
|
+
localPeer ? /* @__PURE__ */ React52.createElement(React52.Fragment, null, /* @__PURE__ */ React52.createElement(TileConnection_default, { name, peerId: localPeer.id, hideLabel: true }), /* @__PURE__ */ React52.createElement(
|
7078
6447
|
Video,
|
7079
6448
|
{
|
7080
6449
|
mirror: (track == null ? void 0 : track.facingMode) !== "environment" && mirrorLocalVideo,
|
7081
6450
|
trackId: localPeer.videoTrack,
|
7082
6451
|
"data-testid": "preview_tile"
|
7083
6452
|
}
|
7084
|
-
), !isVideoOn ? /* @__PURE__ */
|
7085
|
-
showMuteIcon ? /* @__PURE__ */
|
6453
|
+
), !isVideoOn ? /* @__PURE__ */ React52.createElement(StyledVideoTile.AvatarContainer, null, /* @__PURE__ */ React52.createElement(Avatar, { name, "data-testid": "preview_avatar_tile" })) : null) : !error ? /* @__PURE__ */ React52.createElement(FullPageProgress_default, null) : null,
|
6454
|
+
showMuteIcon ? /* @__PURE__ */ React52.createElement(StyledVideoTile.AudioIndicator, null, /* @__PURE__ */ React52.createElement(MicOffIcon2, null)) : /* @__PURE__ */ React52.createElement(StyledVideoTile.AudioIndicator, { size: "medium" }, /* @__PURE__ */ React52.createElement(AudioLevel, { trackId: localPeer == null ? void 0 : localPeer.audioTrack }))
|
7086
6455
|
);
|
7087
6456
|
};
|
7088
6457
|
var PreviewControls = ({ hideSettings }) => {
|
7089
|
-
const isMobile =
|
7090
|
-
return /* @__PURE__ */
|
6458
|
+
const isMobile = useMedia6(config.media.md);
|
6459
|
+
return /* @__PURE__ */ React52.createElement(
|
7091
6460
|
Flex,
|
7092
6461
|
{
|
7093
6462
|
justify: hideSettings && isMobile ? "center" : "between",
|
@@ -7096,13 +6465,13 @@ var PreviewControls = ({ hideSettings }) => {
|
|
7096
6465
|
mt: "$8"
|
7097
6466
|
}
|
7098
6467
|
},
|
7099
|
-
/* @__PURE__ */
|
7100
|
-
!hideSettings ? /* @__PURE__ */
|
6468
|
+
/* @__PURE__ */ React52.createElement(Flex, { css: { gap: "$4" } }, /* @__PURE__ */ React52.createElement(AudioVideoToggle, null), /* @__PURE__ */ React52.createElement(Suspense, { fallback: "" }, !isMobile ? /* @__PURE__ */ React52.createElement(VirtualBackground, null) : null)),
|
6469
|
+
!hideSettings ? /* @__PURE__ */ React52.createElement(PreviewSettings, null) : null
|
7101
6470
|
);
|
7102
6471
|
};
|
7103
|
-
var PreviewSettings =
|
7104
|
-
const [open, setOpen] =
|
7105
|
-
return /* @__PURE__ */
|
6472
|
+
var PreviewSettings = React52.memo(() => {
|
6473
|
+
const [open, setOpen] = useState16(false);
|
6474
|
+
return /* @__PURE__ */ React52.createElement(Fragment4, null, /* @__PURE__ */ React52.createElement(IconButton_default, { "data-testid": "preview_setting_btn", css: { flexShrink: 0 }, onClick: () => setOpen((value) => !value) }, /* @__PURE__ */ React52.createElement(SettingsIcon2, null)), open && /* @__PURE__ */ React52.createElement(SettingsModal_default, { open, onOpenChange: setOpen }));
|
7106
6475
|
});
|
7107
6476
|
var PreviewJoin_default = PreviewJoin;
|
7108
6477
|
|
@@ -7126,14 +6495,14 @@ var PreviewContainer = () => {
|
|
7126
6495
|
}
|
7127
6496
|
navigate(meetingURL);
|
7128
6497
|
};
|
7129
|
-
return /* @__PURE__ */
|
6498
|
+
return /* @__PURE__ */ React53.createElement(Flex, { direction: "column", css: { size: "100%" } }, /* @__PURE__ */ React53.createElement(
|
7130
6499
|
Flex,
|
7131
6500
|
{
|
7132
6501
|
css: { flex: "1 1 0", position: "relative", overflowY: "auto", color: "$primary_default" },
|
7133
6502
|
justify: "center",
|
7134
6503
|
align: "center"
|
7135
6504
|
},
|
7136
|
-
authToken && Object.keys(previewHeader).length > 0 ? /* @__PURE__ */
|
6505
|
+
authToken && Object.keys(previewHeader).length > 0 ? /* @__PURE__ */ React53.createElement(
|
7137
6506
|
PreviewJoin_default,
|
7138
6507
|
{
|
7139
6508
|
initialName,
|
@@ -7141,20 +6510,20 @@ var PreviewContainer = () => {
|
|
7141
6510
|
asRole: previewAsRole != null ? previewAsRole : void 0,
|
7142
6511
|
onJoin
|
7143
6512
|
}
|
7144
|
-
) : /* @__PURE__ */
|
6513
|
+
) : /* @__PURE__ */ React53.createElement(FullPageProgress_default, null)
|
7145
6514
|
));
|
7146
6515
|
};
|
7147
6516
|
var PreviewContainer_default = PreviewContainer;
|
7148
6517
|
|
7149
6518
|
// src/Prebuilt/components/Toast/ToastContainer.jsx
|
7150
|
-
import
|
7151
|
-
import { selectIsConnectedToRoom as selectIsConnectedToRoom3, useHMSStore as
|
6519
|
+
import React55, { useEffect as useEffect24, useState as useState17 } from "react";
|
6520
|
+
import { selectIsConnectedToRoom as selectIsConnectedToRoom3, useHMSStore as useHMSStore22 } from "@100mslive/react-sdk";
|
7152
6521
|
|
7153
6522
|
// src/Prebuilt/components/Toast/Toast.jsx
|
7154
|
-
import
|
6523
|
+
import React54 from "react";
|
7155
6524
|
var Toast2 = (_a7) => {
|
7156
6525
|
var _b7 = _a7, { title, description, close = true, open, duration, onOpenChange, icon } = _b7, props = __objRest(_b7, ["title", "description", "close", "open", "duration", "onOpenChange", "icon"]);
|
7157
|
-
return /* @__PURE__ */
|
6526
|
+
return /* @__PURE__ */ React54.createElement(
|
7158
6527
|
Toast.HMSToast,
|
7159
6528
|
__spreadValues({
|
7160
6529
|
title,
|
@@ -7170,17 +6539,17 @@ var Toast2 = (_a7) => {
|
|
7170
6539
|
|
7171
6540
|
// src/Prebuilt/components/Toast/ToastContainer.jsx
|
7172
6541
|
var ToastContainer = () => {
|
7173
|
-
const isConnected =
|
7174
|
-
const [toasts, setToast] =
|
7175
|
-
|
6542
|
+
const isConnected = useHMSStore22(selectIsConnectedToRoom3);
|
6543
|
+
const [toasts, setToast] = useState17([]);
|
6544
|
+
useEffect24(() => {
|
7176
6545
|
ToastManager.addListener(setToast);
|
7177
6546
|
return () => {
|
7178
6547
|
ToastManager.removeListener(setToast);
|
7179
6548
|
};
|
7180
6549
|
}, []);
|
7181
|
-
return /* @__PURE__ */
|
7182
|
-
return /* @__PURE__ */
|
7183
|
-
}), /* @__PURE__ */
|
6550
|
+
return /* @__PURE__ */ React55.createElement(Toast.Provider, { swipeDirection: "left", duration: 3e3 }, toasts.slice(0, MAX_TOASTS).map((toast) => {
|
6551
|
+
return /* @__PURE__ */ React55.createElement(Toast2, __spreadProps(__spreadValues({ key: toast.id }, toast), { onOpenChange: (value) => !value && ToastManager.removeToast(toast.id) }));
|
6552
|
+
}), /* @__PURE__ */ React55.createElement(
|
7184
6553
|
Toast.Viewport,
|
7185
6554
|
{
|
7186
6555
|
css: __spreadValues({
|
@@ -7191,13 +6560,13 @@ var ToastContainer = () => {
|
|
7191
6560
|
};
|
7192
6561
|
|
7193
6562
|
// src/Prebuilt/plugins/FlyingEmoji.jsx
|
7194
|
-
import
|
7195
|
-
import { useMedia as
|
6563
|
+
import React56, { useCallback as useCallback17, useEffect as useEffect25, useMemo as useMemo3, useState as useState18 } from "react";
|
6564
|
+
import { useMedia as useMedia7 } from "react-use";
|
7196
6565
|
import {
|
7197
|
-
selectLocalPeerID as
|
7198
|
-
selectPeerNameByID
|
7199
|
-
useCustomEvent as
|
7200
|
-
useHMSStore as
|
6566
|
+
selectLocalPeerID as selectLocalPeerID4,
|
6567
|
+
selectPeerNameByID,
|
6568
|
+
useCustomEvent as useCustomEvent2,
|
6569
|
+
useHMSStore as useHMSStore23,
|
7201
6570
|
useHMSVanillaStore as useHMSVanillaStore7
|
7202
6571
|
} from "@100mslive/react-sdk";
|
7203
6572
|
var emojiCount = 1;
|
@@ -7224,17 +6593,17 @@ var getStartingPoints = (isMobile) => {
|
|
7224
6593
|
return arr;
|
7225
6594
|
};
|
7226
6595
|
function FlyingEmoji() {
|
7227
|
-
const localPeerId =
|
6596
|
+
const localPeerId = useHMSStore23(selectLocalPeerID4);
|
7228
6597
|
const vanillaStore = useHMSVanillaStore7();
|
7229
|
-
const [emojis, setEmojis] =
|
7230
|
-
const isMobile =
|
7231
|
-
const startingPoints =
|
7232
|
-
const showFlyingEmoji =
|
6598
|
+
const [emojis, setEmojis] = useState18([]);
|
6599
|
+
const isMobile = useMedia7(config.media.md);
|
6600
|
+
const startingPoints = useMemo3(() => getStartingPoints(isMobile), [isMobile]);
|
6601
|
+
const showFlyingEmoji = useCallback17(
|
7233
6602
|
({ emojiId, senderId }) => {
|
7234
6603
|
if (!emojiId || !senderId || document.hidden) {
|
7235
6604
|
return;
|
7236
6605
|
}
|
7237
|
-
const senderPeerName = vanillaStore.getState(
|
6606
|
+
const senderPeerName = vanillaStore.getState(selectPeerNameByID(senderId));
|
7238
6607
|
const nameToShow = localPeerId === senderId ? "You" : senderPeerName;
|
7239
6608
|
const startingPoint = startingPoints[emojiCount % startingPoints.length];
|
7240
6609
|
const id = emojiCount++;
|
@@ -7253,14 +6622,14 @@ function FlyingEmoji() {
|
|
7253
6622
|
},
|
7254
6623
|
[localPeerId, vanillaStore, startingPoints]
|
7255
6624
|
);
|
7256
|
-
|
6625
|
+
useCustomEvent2({
|
7257
6626
|
type: EMOJI_REACTION_TYPE,
|
7258
6627
|
onEvent: showFlyingEmoji
|
7259
6628
|
});
|
7260
|
-
|
6629
|
+
useEffect25(() => {
|
7261
6630
|
window.showFlyingEmoji = showFlyingEmoji;
|
7262
6631
|
}, [showFlyingEmoji]);
|
7263
|
-
return /* @__PURE__ */
|
6632
|
+
return /* @__PURE__ */ React56.createElement(
|
7264
6633
|
Box,
|
7265
6634
|
{
|
7266
6635
|
css: {
|
@@ -7276,7 +6645,7 @@ function FlyingEmoji() {
|
|
7276
6645
|
}
|
7277
6646
|
},
|
7278
6647
|
emojis.map((emoji) => {
|
7279
|
-
return /* @__PURE__ */
|
6648
|
+
return /* @__PURE__ */ React56.createElement(
|
7280
6649
|
Flex,
|
7281
6650
|
{
|
7282
6651
|
key: emoji.id,
|
@@ -7292,8 +6661,8 @@ function FlyingEmoji() {
|
|
7292
6661
|
setEmojis(emojis.filter((item) => item.id !== emoji.id));
|
7293
6662
|
}
|
7294
6663
|
},
|
7295
|
-
/* @__PURE__ */
|
7296
|
-
/* @__PURE__ */
|
6664
|
+
/* @__PURE__ */ React56.createElement(Box, null, /* @__PURE__ */ React56.createElement("em-emoji", { id: emoji.emojiId, size: "48px", set: "apple" })),
|
6665
|
+
/* @__PURE__ */ React56.createElement(
|
7297
6666
|
Box,
|
7298
6667
|
{
|
7299
6668
|
css: {
|
@@ -7303,7 +6672,7 @@ function FlyingEmoji() {
|
|
7303
6672
|
borderRadius: "$1"
|
7304
6673
|
}
|
7305
6674
|
},
|
7306
|
-
/* @__PURE__ */
|
6675
|
+
/* @__PURE__ */ React56.createElement(
|
7307
6676
|
Text,
|
7308
6677
|
{
|
7309
6678
|
css: {
|
@@ -7321,45 +6690,45 @@ function FlyingEmoji() {
|
|
7321
6690
|
}
|
7322
6691
|
|
7323
6692
|
// src/Prebuilt/plugins/RemoteStopScreenshare.jsx
|
7324
|
-
import
|
7325
|
-
import { useCustomEvent as
|
6693
|
+
import React57, { useCallback as useCallback18 } from "react";
|
6694
|
+
import { useCustomEvent as useCustomEvent3, useHMSActions as useHMSActions16 } from "@100mslive/react-sdk";
|
7326
6695
|
function RemoteStopScreenshare() {
|
7327
|
-
const actions =
|
7328
|
-
const onRemoteStopScreenshare =
|
6696
|
+
const actions = useHMSActions16();
|
6697
|
+
const onRemoteStopScreenshare = useCallback18(() => __async(this, null, function* () {
|
7329
6698
|
yield actions.setScreenShareEnabled(false);
|
7330
6699
|
}), [actions]);
|
7331
|
-
|
6700
|
+
useCustomEvent3({
|
7332
6701
|
type: REMOTE_STOP_SCREENSHARE_TYPE,
|
7333
6702
|
onEvent: onRemoteStopScreenshare
|
7334
6703
|
});
|
7335
|
-
return /* @__PURE__ */
|
6704
|
+
return /* @__PURE__ */ React57.createElement(React57.Fragment, null);
|
7336
6705
|
}
|
7337
6706
|
|
7338
6707
|
// src/Prebuilt/components/hooks/useAutoStartStreaming.tsx
|
7339
|
-
import { useCallback as
|
6708
|
+
import { useCallback as useCallback19, useEffect as useEffect27, useRef as useRef9 } from "react";
|
7340
6709
|
import {
|
7341
6710
|
selectIsConnectedToRoom as selectIsConnectedToRoom5,
|
7342
|
-
selectPermissions as
|
7343
|
-
useHMSActions as
|
7344
|
-
useHMSStore as
|
6711
|
+
selectPermissions as selectPermissions2,
|
6712
|
+
useHMSActions as useHMSActions17,
|
6713
|
+
useHMSStore as useHMSStore25,
|
7345
6714
|
useRecordingStreaming as useRecordingStreaming5
|
7346
6715
|
} from "@100mslive/react-sdk";
|
7347
6716
|
|
7348
6717
|
// src/Prebuilt/common/hooks.js
|
7349
|
-
import { useEffect as
|
6718
|
+
import { useEffect as useEffect26, useRef as useRef8, useState as useState19 } from "react";
|
7350
6719
|
import { JoinForm_JoinBtnType as JoinForm_JoinBtnType3 } from "@100mslive/types-prebuilt/elements/join_form";
|
7351
6720
|
import {
|
7352
6721
|
selectAvailableRoleNames as selectAvailableRoleNames2,
|
7353
6722
|
selectIsConnectedToRoom as selectIsConnectedToRoom4,
|
7354
6723
|
selectPeerCount,
|
7355
|
-
selectPeerMetadata as
|
6724
|
+
selectPeerMetadata as selectPeerMetadata2,
|
7356
6725
|
selectPeers,
|
7357
6726
|
selectRemotePeers,
|
7358
|
-
useHMSStore as
|
6727
|
+
useHMSStore as useHMSStore24,
|
7359
6728
|
useHMSVanillaStore as useHMSVanillaStore8
|
7360
6729
|
} from "@100mslive/react-sdk";
|
7361
6730
|
var useFilteredRoles = () => {
|
7362
|
-
const roles =
|
6731
|
+
const roles = useHMSStore24(selectAvailableRoleNames2);
|
7363
6732
|
return roles;
|
7364
6733
|
};
|
7365
6734
|
var useShowStreamingUI = () => {
|
@@ -7370,15 +6739,15 @@ var useShowStreamingUI = () => {
|
|
7370
6739
|
};
|
7371
6740
|
var useParticipants2 = (params) => {
|
7372
6741
|
var _a7;
|
7373
|
-
const isConnected =
|
7374
|
-
const peerCount =
|
7375
|
-
const availableRoles =
|
7376
|
-
let participantList =
|
6742
|
+
const isConnected = useHMSStore24(selectIsConnectedToRoom4);
|
6743
|
+
const peerCount = useHMSStore24(selectPeerCount);
|
6744
|
+
const availableRoles = useHMSStore24(selectAvailableRoleNames2);
|
6745
|
+
let participantList = useHMSStore24(isConnected ? selectPeers : selectRemotePeers);
|
7377
6746
|
const rolesWithParticipants = Array.from(new Set(participantList.map((peer) => peer.roleName)));
|
7378
6747
|
const vanillaStore = useHMSVanillaStore8();
|
7379
6748
|
if ((_a7 = params == null ? void 0 : params.metadata) == null ? void 0 : _a7.isHandRaised) {
|
7380
6749
|
participantList = participantList.filter((peer) => {
|
7381
|
-
return vanillaStore.getState(
|
6750
|
+
return vanillaStore.getState(selectPeerMetadata2(peer.id)).isHandRaised;
|
7382
6751
|
});
|
7383
6752
|
}
|
7384
6753
|
if ((params == null ? void 0 : params.role) && availableRoles.includes(params.role)) {
|
@@ -7394,13 +6763,13 @@ var useParticipants2 = (params) => {
|
|
7394
6763
|
// src/Prebuilt/components/hooks/useAutoStartStreaming.tsx
|
7395
6764
|
var useAutoStartStreaming = () => {
|
7396
6765
|
const [isHLSStarted, setHLSStarted] = useSetAppDataByKey(APP_DATA.hlsStarted);
|
7397
|
-
const permissions =
|
6766
|
+
const permissions = useHMSStore25(selectPermissions2);
|
7398
6767
|
const showStreamingUI = useShowStreamingUI();
|
7399
|
-
const hmsActions =
|
7400
|
-
const isConnected =
|
6768
|
+
const hmsActions = useHMSActions17();
|
6769
|
+
const isConnected = useHMSStore25(selectIsConnectedToRoom5);
|
7401
6770
|
const { isHLSRunning } = useRecordingStreaming5();
|
7402
6771
|
const streamStartedRef = useRef9(false);
|
7403
|
-
const startHLS =
|
6772
|
+
const startHLS = useCallback19(() => __async(void 0, null, function* () {
|
7404
6773
|
var _a7;
|
7405
6774
|
try {
|
7406
6775
|
if (isHLSStarted || !showStreamingUI || isHLSRunning) {
|
@@ -7417,12 +6786,12 @@ var useAutoStartStreaming = () => {
|
|
7417
6786
|
setHLSStarted(false);
|
7418
6787
|
}
|
7419
6788
|
}), [hmsActions, isHLSRunning, isHLSStarted, setHLSStarted, showStreamingUI]);
|
7420
|
-
|
6789
|
+
useEffect27(() => {
|
7421
6790
|
if (!isHLSStarted && !isHLSRunning) {
|
7422
6791
|
streamStartedRef.current = false;
|
7423
6792
|
}
|
7424
6793
|
}, [isHLSStarted, isHLSRunning]);
|
7425
|
-
|
6794
|
+
useEffect27(() => {
|
7426
6795
|
if (!isConnected || streamStartedRef.current || !(permissions == null ? void 0 : permissions.hlsStreaming)) {
|
7427
6796
|
return;
|
7428
6797
|
}
|
@@ -7431,8 +6800,8 @@ var useAutoStartStreaming = () => {
|
|
7431
6800
|
};
|
7432
6801
|
|
7433
6802
|
// src/Prebuilt/App.tsx
|
7434
|
-
var Conference =
|
7435
|
-
var HMSPrebuilt =
|
6803
|
+
var Conference = React58.lazy(() => import("./conference-JD35TNH4.js"));
|
6804
|
+
var HMSPrebuilt = React58.forwardRef(
|
7436
6805
|
({
|
7437
6806
|
roomCode = "",
|
7438
6807
|
authToken = "",
|
@@ -7448,8 +6817,8 @@ var HMSPrebuilt = React61.forwardRef(
|
|
7448
6817
|
var _a7, _b7, _c, _d;
|
7449
6818
|
const metadata = "";
|
7450
6819
|
const reactiveStore = useRef10();
|
7451
|
-
const [hydrated, setHydrated] =
|
7452
|
-
|
6820
|
+
const [hydrated, setHydrated] = React58.useState(false);
|
6821
|
+
useEffect28(() => {
|
7453
6822
|
setHydrated(true);
|
7454
6823
|
const hms = new HMSReactiveStore();
|
7455
6824
|
const hmsStore = hms.getStore();
|
@@ -7464,13 +6833,13 @@ var HMSPrebuilt = React61.forwardRef(
|
|
7464
6833
|
hmsNotifications
|
7465
6834
|
};
|
7466
6835
|
}, []);
|
7467
|
-
|
6836
|
+
useEffect28(() => {
|
7468
6837
|
if (!ref || !reactiveStore.current) {
|
7469
6838
|
return;
|
7470
6839
|
}
|
7471
6840
|
ref.current = __spreadValues({}, reactiveStore.current);
|
7472
6841
|
}, [ref]);
|
7473
|
-
|
6842
|
+
useEffect28(
|
7474
6843
|
() => () => {
|
7475
6844
|
var _a8;
|
7476
6845
|
(_a8 = reactiveStore == null ? void 0 : reactiveStore.current) == null ? void 0 : _a8.hmsActions.leave();
|
@@ -7500,7 +6869,7 @@ var HMSPrebuilt = React61.forwardRef(
|
|
7500
6869
|
return null;
|
7501
6870
|
}
|
7502
6871
|
globalStyles();
|
7503
|
-
return /* @__PURE__ */
|
6872
|
+
return /* @__PURE__ */ React58.createElement(ErrorBoundary, null, /* @__PURE__ */ React58.createElement(
|
7504
6873
|
HMSPrebuiltContext.Provider,
|
7505
6874
|
{
|
7506
6875
|
value: {
|
@@ -7518,7 +6887,7 @@ var HMSPrebuilt = React61.forwardRef(
|
|
7518
6887
|
}
|
7519
6888
|
}
|
7520
6889
|
},
|
7521
|
-
/* @__PURE__ */
|
6890
|
+
/* @__PURE__ */ React58.createElement(
|
7522
6891
|
HMSRoomProvider,
|
7523
6892
|
{
|
7524
6893
|
isHMSStatsOn: FeatureFlags.enableStatsForNerds,
|
@@ -7527,7 +6896,7 @@ var HMSPrebuilt = React61.forwardRef(
|
|
7527
6896
|
notifications: (_c = reactiveStore.current) == null ? void 0 : _c.hmsNotifications,
|
7528
6897
|
stats: (_d = reactiveStore.current) == null ? void 0 : _d.hmsStats
|
7529
6898
|
},
|
7530
|
-
/* @__PURE__ */
|
6899
|
+
/* @__PURE__ */ React58.createElement(RoomLayoutProvider, { roomLayoutEndpoint, overrideLayout }, /* @__PURE__ */ React58.createElement(RoomLayoutContext.Consumer, null, (data) => {
|
7531
6900
|
var _a8;
|
7532
6901
|
const layout = data == null ? void 0 : data.layout;
|
7533
6902
|
const theme2 = ((_a8 = layout == null ? void 0 : layout.themes) == null ? void 0 : _a8[0]) || {};
|
@@ -7536,7 +6905,7 @@ var HMSPrebuilt = React61.forwardRef(
|
|
7536
6905
|
if (typography2 == null ? void 0 : typography2.font_family) {
|
7537
6906
|
fontFamily = [`${typography2 == null ? void 0 : typography2.font_family}`, ...fontFamily];
|
7538
6907
|
}
|
7539
|
-
return /* @__PURE__ */
|
6908
|
+
return /* @__PURE__ */ React58.createElement(
|
7540
6909
|
HMSThemeProvider,
|
7541
6910
|
{
|
7542
6911
|
themeType: `${theme2.name}-${Date.now()}`,
|
@@ -7549,11 +6918,12 @@ var HMSPrebuilt = React61.forwardRef(
|
|
7549
6918
|
}
|
7550
6919
|
}
|
7551
6920
|
},
|
7552
|
-
/* @__PURE__ */
|
7553
|
-
/* @__PURE__ */
|
7554
|
-
/* @__PURE__ */
|
6921
|
+
/* @__PURE__ */ React58.createElement(AppData, { appDetails: metadata, tokenEndpoint: tokenByRoomIdRoleEndpoint }),
|
6922
|
+
/* @__PURE__ */ React58.createElement(Init, null),
|
6923
|
+
/* @__PURE__ */ React58.createElement(
|
7555
6924
|
Box,
|
7556
6925
|
{
|
6926
|
+
id: "prebuilt-container",
|
7557
6927
|
css: {
|
7558
6928
|
bg: "$background_dim",
|
7559
6929
|
size: "100%",
|
@@ -7561,7 +6931,7 @@ var HMSPrebuilt = React61.forwardRef(
|
|
7561
6931
|
"-webkit-text-size-adjust": "100%"
|
7562
6932
|
}
|
7563
6933
|
},
|
7564
|
-
/* @__PURE__ */
|
6934
|
+
/* @__PURE__ */ React58.createElement(AppRoutes, { authTokenByRoomCodeEndpoint: tokenByRoomCodeEndpoint, defaultAuthToken: authToken })
|
7565
6935
|
)
|
7566
6936
|
);
|
7567
6937
|
}))
|
@@ -7572,42 +6942,42 @@ var HMSPrebuilt = React61.forwardRef(
|
|
7572
6942
|
HMSPrebuilt.displayName = "HMSPrebuilt";
|
7573
6943
|
var Redirector = ({ showPreview }) => {
|
7574
6944
|
const { roomId, role } = useParams5();
|
7575
|
-
return /* @__PURE__ */
|
6945
|
+
return /* @__PURE__ */ React58.createElement(Navigate, { to: `/${showPreview ? "preview" : "meeting"}/${roomId}/${role || ""}` });
|
7576
6946
|
};
|
7577
6947
|
var RouteList = () => {
|
7578
6948
|
const { isPreviewScreenEnabled } = useRoomLayoutPreviewScreen();
|
7579
6949
|
const { isLeaveScreenEnabled } = useRoomLayoutLeaveScreen();
|
7580
6950
|
useAutoStartStreaming();
|
7581
|
-
return /* @__PURE__ */
|
6951
|
+
return /* @__PURE__ */ React58.createElement(Routes, null, isPreviewScreenEnabled ? /* @__PURE__ */ React58.createElement(Route, { path: "preview" }, /* @__PURE__ */ React58.createElement(
|
7582
6952
|
Route,
|
7583
6953
|
{
|
7584
6954
|
path: ":roomId/:role",
|
7585
|
-
element: /* @__PURE__ */
|
6955
|
+
element: /* @__PURE__ */ React58.createElement(Suspense2, { fallback: /* @__PURE__ */ React58.createElement(FullPageProgress_default, { text: "Loading preview..." }) }, /* @__PURE__ */ React58.createElement(PreviewContainer_default, null))
|
7586
6956
|
}
|
7587
|
-
), /* @__PURE__ */
|
6957
|
+
), /* @__PURE__ */ React58.createElement(
|
7588
6958
|
Route,
|
7589
6959
|
{
|
7590
6960
|
path: ":roomId",
|
7591
|
-
element: /* @__PURE__ */
|
6961
|
+
element: /* @__PURE__ */ React58.createElement(Suspense2, { fallback: /* @__PURE__ */ React58.createElement(FullPageProgress_default, { text: "Loading preview..." }) }, /* @__PURE__ */ React58.createElement(PreviewContainer_default, null))
|
7592
6962
|
}
|
7593
|
-
)) : null, /* @__PURE__ */
|
6963
|
+
)) : null, /* @__PURE__ */ React58.createElement(Route, { path: "meeting" }, /* @__PURE__ */ React58.createElement(
|
7594
6964
|
Route,
|
7595
6965
|
{
|
7596
6966
|
path: ":roomId/:role",
|
7597
|
-
element: /* @__PURE__ */
|
6967
|
+
element: /* @__PURE__ */ React58.createElement(Suspense2, { fallback: /* @__PURE__ */ React58.createElement(FullPageProgress_default, { text: "Joining..." }) }, /* @__PURE__ */ React58.createElement(Conference, null))
|
7598
6968
|
}
|
7599
|
-
), /* @__PURE__ */
|
6969
|
+
), /* @__PURE__ */ React58.createElement(
|
7600
6970
|
Route,
|
7601
6971
|
{
|
7602
6972
|
path: ":roomId",
|
7603
|
-
element: /* @__PURE__ */
|
6973
|
+
element: /* @__PURE__ */ React58.createElement(Suspense2, { fallback: /* @__PURE__ */ React58.createElement(FullPageProgress_default, { text: "Joining..." }) }, /* @__PURE__ */ React58.createElement(Conference, null))
|
7604
6974
|
}
|
7605
|
-
)), isLeaveScreenEnabled ? /* @__PURE__ */
|
6975
|
+
)), isLeaveScreenEnabled ? /* @__PURE__ */ React58.createElement(Route, { path: "leave" }, /* @__PURE__ */ React58.createElement(Route, { path: ":roomId/:role", element: /* @__PURE__ */ React58.createElement(PostLeave_default, null) }), /* @__PURE__ */ React58.createElement(Route, { path: ":roomId", element: /* @__PURE__ */ React58.createElement(PostLeave_default, null) })) : null, /* @__PURE__ */ React58.createElement(Route, { path: "/:roomId/:role", element: /* @__PURE__ */ React58.createElement(Redirector, { showPreview: isPreviewScreenEnabled }) }), /* @__PURE__ */ React58.createElement(Route, { path: "/:roomId/", element: /* @__PURE__ */ React58.createElement(Redirector, { showPreview: isPreviewScreenEnabled }) }));
|
7606
6976
|
};
|
7607
6977
|
var BackSwipe = () => {
|
7608
|
-
const isConnectedToRoom =
|
7609
|
-
const hmsActions =
|
7610
|
-
|
6978
|
+
const isConnectedToRoom = useHMSStore26(selectIsConnectedToRoom6);
|
6979
|
+
const hmsActions = useHMSActions18();
|
6980
|
+
useEffect28(() => {
|
7611
6981
|
const onRouteLeave = () => __async(void 0, null, function* () {
|
7612
6982
|
if (isConnectedToRoom) {
|
7613
6983
|
yield hmsActions.leave();
|
@@ -7622,7 +6992,7 @@ var BackSwipe = () => {
|
|
7622
6992
|
};
|
7623
6993
|
var Router = ({ children }) => {
|
7624
6994
|
const { roomId, role, roomCode } = useHMSPrebuiltContext();
|
7625
|
-
return [roomId, role, roomCode].every((value) => !value) ? /* @__PURE__ */
|
6995
|
+
return [roomId, role, roomCode].every((value) => !value) ? /* @__PURE__ */ React58.createElement(BrowserRouter, null, children) : /* @__PURE__ */ React58.createElement(MemoryRouter, { initialEntries: [`/${roomCode ? roomCode : `${roomId}/${role || ""}`}`], initialIndex: 0 }, children);
|
7626
6996
|
};
|
7627
6997
|
function AppRoutes({
|
7628
6998
|
authTokenByRoomCodeEndpoint,
|
@@ -7630,7 +7000,7 @@ function AppRoutes({
|
|
7630
7000
|
}) {
|
7631
7001
|
const roomLayout = useRoomLayout();
|
7632
7002
|
const isNotificationsDisabled = useIsNotificationDisabled();
|
7633
|
-
return /* @__PURE__ */
|
7003
|
+
return /* @__PURE__ */ React58.createElement(Router, null, /* @__PURE__ */ React58.createElement(React58.Fragment, null, /* @__PURE__ */ React58.createElement(ToastContainer, null), /* @__PURE__ */ React58.createElement(Notifications, null), /* @__PURE__ */ React58.createElement(BackSwipe, null), !isNotificationsDisabled && /* @__PURE__ */ React58.createElement(FlyingEmoji, null), /* @__PURE__ */ React58.createElement(RemoteStopScreenshare, null), /* @__PURE__ */ React58.createElement(KeyboardHandler, null), /* @__PURE__ */ React58.createElement(AuthToken_default, { authTokenByRoomCodeEndpoint, defaultAuthToken }), roomLayout && /* @__PURE__ */ React58.createElement(Routes, null, /* @__PURE__ */ React58.createElement(Route, { path: "/*", element: /* @__PURE__ */ React58.createElement(RouteList, null) }))));
|
7634
7004
|
}
|
7635
7005
|
|
7636
7006
|
// src/Progress/index.tsx
|
@@ -7673,6 +7043,7 @@ export {
|
|
7673
7043
|
Video,
|
7674
7044
|
StyledMenuTile,
|
7675
7045
|
useBorderAudioLevel,
|
7046
|
+
AudioLevel,
|
7676
7047
|
Popover2 as Popover,
|
7677
7048
|
VideoTileStats,
|
7678
7049
|
Checkbox,
|
@@ -7697,6 +7068,7 @@ export {
|
|
7697
7068
|
APP_DATA,
|
7698
7069
|
UI_SETTINGS,
|
7699
7070
|
SIDE_PANE_OPTIONS,
|
7071
|
+
REMOTE_STOP_SCREENSHARE_TYPE,
|
7700
7072
|
isChrome,
|
7701
7073
|
isIOS,
|
7702
7074
|
isMacOS,
|
@@ -7717,6 +7089,7 @@ export {
|
|
7717
7089
|
useSetSubscribedChatSelector,
|
7718
7090
|
useSetAppDataByKey,
|
7719
7091
|
useHMSPrebuiltContext,
|
7092
|
+
PrebuiltDialogPortal,
|
7720
7093
|
DialogContent,
|
7721
7094
|
DialogRow,
|
7722
7095
|
DialogCol,
|
@@ -7736,15 +7109,12 @@ export {
|
|
7736
7109
|
StopRecordingInSheet,
|
7737
7110
|
Header2 as Header,
|
7738
7111
|
AudioVideoToggle,
|
7112
|
+
Chip_default,
|
7739
7113
|
ConnectionIndicator,
|
7114
|
+
TileConnection_default,
|
7740
7115
|
DialogDropdownTrigger,
|
7741
7116
|
useDropdownSelection,
|
7742
7117
|
SettingsModal_default,
|
7743
|
-
ChangeNameModal,
|
7744
|
-
useDropdownList,
|
7745
|
-
TileMenu_default,
|
7746
|
-
getVideoTileLabel,
|
7747
|
-
VideoTile_default,
|
7748
7118
|
PreviewTile,
|
7749
7119
|
PreviewControls,
|
7750
7120
|
useFilteredRoles,
|
@@ -7752,4 +7122,4 @@ export {
|
|
7752
7122
|
HMSPrebuilt,
|
7753
7123
|
Progress
|
7754
7124
|
};
|
7755
|
-
//# sourceMappingURL=chunk-
|
7125
|
+
//# sourceMappingURL=chunk-GLYGPYNS.js.map
|