@whereby.com/core 1.16.3 → 1.18.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.
@@ -2,8 +2,8 @@
2
2
 
3
3
  var toolkit = require('@reduxjs/toolkit');
4
4
  var media = require('@whereby.com/media');
5
- var uuid = require('uuid');
6
5
  var events$1 = require('events');
6
+ var uuid = require('uuid');
7
7
  var nodeBtoa = require('btoa');
8
8
  var axios = require('axios');
9
9
 
@@ -76,7 +76,7 @@ const createReactor = (selectors, callback) => {
76
76
  });
77
77
  };
78
78
 
79
- const coreVersion = "1.16.3";
79
+ const coreVersion = "1.18.0";
80
80
 
81
81
  function decodeRoomName(roomName) {
82
82
  if (!roomName) {
@@ -141,6 +141,9 @@ const signalEvents = {
141
141
  breakoutMoveToGroup: createSignalEventAction("breakoutMoveToGroup"),
142
142
  breakoutMoveToMain: createSignalEventAction("breakoutMoveToMain"),
143
143
  breakoutSessionUpdated: createSignalEventAction("breakoutSessionUpdated"),
144
+ breakoutEnding: createSignalEventAction("breakoutEnding"),
145
+ breakoutTimerEnded: createSignalEventAction("breakoutTimerEnded"),
146
+ breakoutTimerExtended: createSignalEventAction("breakoutTimerExtended"),
144
147
  chatMessage: createSignalEventAction("chatMessage"),
145
148
  chatMessageRemoved: createSignalEventAction("chatMessageRemoved"),
146
149
  fileSharingError: createSignalEventAction("fileSharingError"),
@@ -181,6 +184,7 @@ const ROOM_ACTION_PERMISSIONS_BY_ROLE = {
181
184
  canEndMeeting: ["host"],
182
185
  canAskToSpeak: ["host"],
183
186
  canSpotlight: ["host"],
187
+ canManageBreakout: ["host"],
184
188
  };
185
189
  const authorizationSliceInitialState = {
186
190
  roomKey: null,
@@ -223,6 +227,7 @@ const selectIsAuthorizedToKickClient = toolkit.createSelector(selectAuthorizatio
223
227
  const selectIsAuthorizedToEndMeeting = toolkit.createSelector(selectAuthorizationRoleName, (localParticipantRole) => ROOM_ACTION_PERMISSIONS_BY_ROLE.canEndMeeting.includes(localParticipantRole));
224
228
  const selectIsAuthorizedToAskToSpeak = toolkit.createSelector(selectAuthorizationRoleName, (localParticipantRole) => ROOM_ACTION_PERMISSIONS_BY_ROLE.canAskToSpeak.includes(localParticipantRole));
225
229
  const selectIsAuthorizedToSpotlight = toolkit.createSelector(selectAuthorizationRoleName, (localParticipantRole) => ROOM_ACTION_PERMISSIONS_BY_ROLE.canSpotlight.includes(localParticipantRole));
230
+ const selectIsAuthorizedToManageBreakout = toolkit.createSelector(selectAuthorizationRoleName, (localParticipantRole) => ROOM_ACTION_PERMISSIONS_BY_ROLE.canManageBreakout.includes(localParticipantRole));
226
231
 
227
232
  /******************************************************************************
228
233
  Copyright (c) Microsoft Corporation.
@@ -354,6 +359,9 @@ function forwardSocketEvents(socket, dispatch) {
354
359
  socket.on("breakout_session_updated", (payload) => dispatch(signalEvents.breakoutSessionUpdated(payload)));
355
360
  socket.on("breakout_move_to_group", () => dispatch(signalEvents.breakoutMoveToGroup()));
356
361
  socket.on("breakout_move_to_main", () => dispatch(signalEvents.breakoutMoveToMain()));
362
+ socket.on("breakout_ending", () => dispatch(signalEvents.breakoutEnding()));
363
+ socket.on("breakout_timer_ended", () => dispatch(signalEvents.breakoutTimerEnded()));
364
+ socket.on("breakout_timer_extended", () => dispatch(signalEvents.breakoutTimerExtended()));
357
365
  }
358
366
  const SIGNAL_BASE_URL = "wss://signal.appearin.net";
359
367
  function createSocket() {
@@ -1076,208 +1084,6 @@ const selectLocalParticipantView = toolkit.createSelector(selectLocalParticipant
1076
1084
  return clientView;
1077
1085
  });
1078
1086
 
1079
- function createBreakout({ assignments, groups, startedAt, initiatedBy, breakoutStartedAt, breakoutEndedAt, breakoutNotification, breakoutTimerDuration, autoMoveToGroup, moveToGroupGracePeriod, autoMoveToMain, moveToMainGracePeriod, enforceAssignment, breakoutTimerSetting, } = {}) {
1080
- return {
1081
- assignments: assignments || null,
1082
- groups: groups || null,
1083
- startedAt: startedAt ? new Date(startedAt) : null,
1084
- initiatedBy,
1085
- breakoutStartedAt: breakoutStartedAt || null,
1086
- breakoutEndedAt: breakoutEndedAt || null,
1087
- breakoutNotification: breakoutNotification || null,
1088
- breakoutTimerDuration: breakoutTimerDuration || 1800,
1089
- autoMoveToGroup: autoMoveToGroup || false,
1090
- moveToGroupGracePeriod: moveToGroupGracePeriod || 10,
1091
- autoMoveToMain: autoMoveToMain || false,
1092
- moveToMainGracePeriod: moveToMainGracePeriod || 30,
1093
- enforceAssignment: enforceAssignment || false,
1094
- breakoutTimerSetting: breakoutTimerSetting || false,
1095
- };
1096
- }
1097
- const breakoutSliceInitialState = Object.assign(Object.assign({}, createBreakout()), { groupId: null });
1098
- const breakoutSlice = toolkit.createSlice({
1099
- name: "breakout",
1100
- initialState: breakoutSliceInitialState,
1101
- reducers: {},
1102
- extraReducers: (builder) => {
1103
- builder.addCase(signalEvents.roomJoined, (state, action) => {
1104
- if ("error" in action.payload) {
1105
- return state;
1106
- }
1107
- const { breakout } = action.payload || {};
1108
- if (breakout) {
1109
- return Object.assign(Object.assign({}, state), createBreakout(breakout));
1110
- }
1111
- return state;
1112
- });
1113
- builder.addCase(signalEvents.breakoutSessionUpdated, (state, action) => {
1114
- return Object.assign(Object.assign({}, state), createBreakout(action.payload));
1115
- });
1116
- builder.addCase(signalEvents.breakoutGroupJoined, (state, action) => {
1117
- var _a;
1118
- if (((_a = action.meta) === null || _a === void 0 ? void 0 : _a.localParticipantId) !== action.payload.clientId) {
1119
- return state;
1120
- }
1121
- return Object.assign(Object.assign({}, state), { groupId: action.payload.group });
1122
- });
1123
- },
1124
- });
1125
- const doBreakoutJoin = createAppThunk((payload) => (_, getState) => {
1126
- const state = getState();
1127
- const { socket } = selectSignalConnectionRaw(state);
1128
- socket === null || socket === void 0 ? void 0 : socket.emit("join_breakout_group", { group: payload.group });
1129
- });
1130
- const selectBreakoutRaw = (state) => state.breakout;
1131
- const selectBreakoutInitiatedBy = (state) => state.breakout.initiatedBy;
1132
- const selectBreakoutActive = (state) => !!state.breakout.startedAt;
1133
- const selectBreakoutAssignments = (state) => state.breakout.assignments;
1134
- const selectBreakoutGroups = (state) => state.breakout.groups;
1135
- const selectBreakoutCurrentId = toolkit.createSelector(selectBreakoutRaw, selectLocalParticipantBreakoutGroup, (raw, localParticipantBreakoutGroup) => {
1136
- return raw.groupId || localParticipantBreakoutGroup || "";
1137
- });
1138
- const selectBreakoutCurrentGroup = toolkit.createSelector(selectBreakoutRaw, selectBreakoutCurrentId, (raw, breakoutCurrentId) => {
1139
- var _a;
1140
- const name = (_a = raw.groups) === null || _a === void 0 ? void 0 : _a[breakoutCurrentId];
1141
- if (!name)
1142
- return null;
1143
- return { id: breakoutCurrentId, name };
1144
- });
1145
- startAppListening({
1146
- actionCreator: signalEvents.breakoutMoveToGroup,
1147
- effect: (_, { dispatch, getState }) => {
1148
- const state = getState();
1149
- const localParticipant = selectLocalParticipantRaw(state);
1150
- const breakoutGroupAssigned = localParticipant.breakoutGroupAssigned;
1151
- if (breakoutGroupAssigned) {
1152
- dispatch(doBreakoutJoin({ group: breakoutGroupAssigned }));
1153
- }
1154
- },
1155
- });
1156
- startAppListening({
1157
- actionCreator: signalEvents.breakoutMoveToMain,
1158
- effect: (_, { dispatch }) => {
1159
- dispatch(doBreakoutJoin({ group: "" }));
1160
- },
1161
- });
1162
- startAppListening({
1163
- actionCreator: signalEvents.breakoutSessionUpdated,
1164
- effect: ({ payload }, { dispatch, getState }) => {
1165
- var _a;
1166
- const state = getState();
1167
- const autoMoveToMain = selectBreakoutRaw(state).autoMoveToMain;
1168
- if (((_a = payload.initiatedBy) === null || _a === void 0 ? void 0 : _a.active) === false) {
1169
- if (!autoMoveToMain) {
1170
- dispatch(doBreakoutJoin({ group: "" }));
1171
- }
1172
- }
1173
- },
1174
- });
1175
-
1176
- const chatSliceInitialState = {
1177
- chatMessages: [],
1178
- };
1179
- const chatSlice = toolkit.createSlice({
1180
- name: "chat",
1181
- initialState: chatSliceInitialState,
1182
- reducers: {},
1183
- extraReducers(builder) {
1184
- builder.addCase(signalEvents.chatMessage, (state, action) => {
1185
- const message = Object.assign({ id: action.payload.id, senderId: action.payload.senderId, parentId: action.payload.parentId, timestamp: action.payload.timestamp, text: action.payload.text, sig: action.payload.sig, removed: false }, (action.payload.file && { file: action.payload.file }));
1186
- return Object.assign(Object.assign({}, state), { chatMessages: [...state.chatMessages, message] });
1187
- });
1188
- builder.addCase(signalEvents.chatMessageRemoved, (state, action) => {
1189
- return Object.assign(Object.assign({}, state), { chatMessages: state.chatMessages.map((m) => {
1190
- return Object.assign(Object.assign({}, m), (m.id === action.payload.id && {
1191
- removed: true,
1192
- }));
1193
- }) });
1194
- });
1195
- },
1196
- });
1197
- const doSendChatMessage = createRoomConnectedThunk((payload) => (_, getState) => {
1198
- const state = getState();
1199
- const socket = selectSignalConnectionRaw(state).socket;
1200
- const breakoutCurrentId = selectBreakoutCurrentId(state);
1201
- socket === null || socket === void 0 ? void 0 : socket.emit("chat_message", Object.assign(Object.assign(Object.assign({ text: payload.text }, (payload.parentId && { parentId: payload.parentId })), (breakoutCurrentId && { breakoutGroup: breakoutCurrentId })), (payload.isBroadcast && { broadcast: true })));
1202
- });
1203
- const doRemoveChatMessage = createRoomConnectedThunk(({ id, sig }) => (_, getState) => {
1204
- const state = getState();
1205
- const socket = selectSignalConnectionRaw(state).socket;
1206
- socket === null || socket === void 0 ? void 0 : socket.emit("remove_chat_message", {
1207
- id,
1208
- sig,
1209
- });
1210
- });
1211
- const selectChatRaw = (state) => state.chat;
1212
- const selectChatMessages = (state) => state.chat.chatMessages;
1213
-
1214
- const initialCloudRecordingState = {
1215
- isInitiator: false,
1216
- isRecording: false,
1217
- startedAt: undefined,
1218
- };
1219
- const cloudRecordingSlice = toolkit.createSlice({
1220
- name: "cloudRecording",
1221
- initialState: initialCloudRecordingState,
1222
- reducers: {
1223
- recordingRequestStarted: (state) => {
1224
- return Object.assign(Object.assign({}, state), { isInitiator: true, status: "requested" });
1225
- },
1226
- },
1227
- extraReducers: (builder) => {
1228
- builder.addCase(signalEvents.cloudRecordingStopped, (state) => {
1229
- return Object.assign(Object.assign({}, state), { isInitiator: false, isRecording: false, status: undefined });
1230
- });
1231
- builder.addCase(signalEvents.cloudRecordingStarted, (state, action) => {
1232
- const { payload } = action;
1233
- if (!payload.error) {
1234
- return state;
1235
- }
1236
- return Object.assign(Object.assign({}, state), { isInitiator: false, isRecording: false, status: "error", error: payload.error });
1237
- });
1238
- builder.addCase(signalEvents.newClient, (state, { payload }) => {
1239
- var _a;
1240
- const { client } = payload;
1241
- if (((_a = client.role) === null || _a === void 0 ? void 0 : _a.roleName) === "recorder") {
1242
- return Object.assign(Object.assign({}, state), { isRecording: true, status: "recording", startedAt: client.startedCloudRecordingAt
1243
- ? new Date(client.startedCloudRecordingAt).getTime()
1244
- : new Date().getTime() });
1245
- }
1246
- return state;
1247
- });
1248
- },
1249
- });
1250
- const { recordingRequestStarted } = cloudRecordingSlice.actions;
1251
- const doStartCloudRecording = createRoomConnectedThunk(() => (dispatch, getState) => {
1252
- const state = getState();
1253
- const socket = selectSignalConnectionRaw(state).socket;
1254
- const status = selectCloudRecordingStatus(state);
1255
- if (status && ["recording", "requested"].includes(status)) {
1256
- return;
1257
- }
1258
- socket === null || socket === void 0 ? void 0 : socket.emit("start_recording", {
1259
- recording: "cloud",
1260
- });
1261
- dispatch(recordingRequestStarted());
1262
- });
1263
- const doStopCloudRecording = createRoomConnectedThunk(() => (dispatch, getState) => {
1264
- const state = getState();
1265
- const socket = selectSignalConnectionRaw(state).socket;
1266
- socket === null || socket === void 0 ? void 0 : socket.emit("stop_recording");
1267
- });
1268
- const selectCloudRecordingRaw = (state) => state.cloudRecording;
1269
- const selectCloudRecordingStatus = (state) => state.cloudRecording.status;
1270
- const selectCloudRecordingStartedAt = (state) => state.cloudRecording.startedAt;
1271
- const selectCloudRecordingError = (state) => state.cloudRecording.error;
1272
- const selectIsCloudRecording = (state) => state.cloudRecording.isRecording;
1273
- const selectCloudRecordingIsInitiator = (state) => state.cloudRecording.isInitiator;
1274
-
1275
- const selectRoomConnectionRaw = (state) => state.roomConnection;
1276
- const selectRoomConnectionSession = (state) => state.roomConnection.session;
1277
- const selectRoomConnectionSessionId = (state) => { var _a; return (_a = state.roomConnection.session) === null || _a === void 0 ? void 0 : _a.id; };
1278
- const selectRoomConnectionStatus = (state) => state.roomConnection.status;
1279
- const selectRoomConnectionError = (state) => state.roomConnection.error;
1280
-
1281
1087
  function createRtcEventAction(name) {
1282
1088
  return toolkit.createAction(`rtcConnection/event/${name}`);
1283
1089
  }
@@ -1440,60 +1246,638 @@ const remoteParticipantsSlice = toolkit.createSlice({
1440
1246
  isVideoEnabled,
1441
1247
  });
1442
1248
  });
1443
- builder.addCase(signalEvents.clientMetadataReceived, (state, action) => {
1444
- const { error, payload } = action.payload;
1445
- if (error || !payload) {
1446
- console.warn(error || "Client metadata error received");
1249
+ builder.addCase(signalEvents.clientMetadataReceived, (state, action) => {
1250
+ const { error, payload } = action.payload;
1251
+ if (error || !payload) {
1252
+ console.warn(error || "Client metadata error received");
1253
+ return state;
1254
+ }
1255
+ const { clientId, displayName, stickyReaction } = payload;
1256
+ return updateParticipant(state, clientId, {
1257
+ displayName,
1258
+ stickyReaction,
1259
+ });
1260
+ });
1261
+ builder.addCase(signalEvents.breakoutGroupJoined, (state, action) => {
1262
+ const { clientId, group } = action.payload;
1263
+ if (!findParticipant(state, clientId).participant) {
1264
+ return state;
1265
+ }
1266
+ return updateParticipant(state, clientId, {
1267
+ breakoutGroup: group || null,
1268
+ });
1269
+ });
1270
+ builder.addCase(signalEvents.screenshareStarted, (state, action) => {
1271
+ const { clientId, streamId } = action.payload;
1272
+ return addStreamId(state, clientId, streamId);
1273
+ });
1274
+ builder.addCase(signalEvents.screenshareStopped, (state, action) => {
1275
+ const { clientId, streamId } = action.payload;
1276
+ return removeStreamId(state, clientId, streamId);
1277
+ });
1278
+ },
1279
+ });
1280
+ const { participantStreamAdded, participantStreamIdAdded, streamStatusUpdated } = remoteParticipantsSlice.actions;
1281
+ const doRequestAudioEnable = createAuthorizedRoomConnectedThunk((state) => selectIsAuthorizedToRequestAudioEnable(state), (payload) => (_, getState) => {
1282
+ const state = getState();
1283
+ const canEnableRemoteAudio = selectIsAuthorizedToAskToSpeak(state);
1284
+ if (payload.enable && !canEnableRemoteAudio) {
1285
+ console.warn("Not authorized to perform this action");
1286
+ return;
1287
+ }
1288
+ const socket = selectSignalConnectionRaw(state).socket;
1289
+ socket === null || socket === void 0 ? void 0 : socket.emit("request_audio_enable", payload);
1290
+ });
1291
+ const doRequestVideoEnable = createAuthorizedRoomConnectedThunk((state) => selectIsAuthorizedToRequestVideoEnable(state), (payload) => (_, getState) => {
1292
+ const state = getState();
1293
+ const socket = selectSignalConnectionRaw(state).socket;
1294
+ socket === null || socket === void 0 ? void 0 : socket.emit("request_video_enable", payload);
1295
+ });
1296
+ const selectRemoteParticipantsRaw = (state) => state.remoteParticipants;
1297
+ const selectRemoteClients = (state) => state.remoteParticipants.remoteParticipants;
1298
+ const selectRemoteParticipants = toolkit.createSelector(selectRemoteClients, (clients) => clients.filter((c) => !NON_PERSON_ROLES.includes(c.roleName)));
1299
+ const selectNumClients = toolkit.createSelector(selectRemoteClients, (clients) => clients.length + 1);
1300
+ const selectNumParticipants = toolkit.createSelector(selectRemoteParticipants, selectLocalParticipantRaw, (clients, localParticipant) => {
1301
+ if (NON_PERSON_ROLES.includes(localParticipant.roleName)) {
1302
+ return clients.length;
1303
+ }
1304
+ return clients.length + 1;
1305
+ });
1306
+
1307
+ const selectRoomConnectionRaw = (state) => state.roomConnection;
1308
+ const selectRoomConnectionSession = (state) => state.roomConnection.session;
1309
+ const selectRoomConnectionSessionId = (state) => { var _a; return (_a = state.roomConnection.session) === null || _a === void 0 ? void 0 : _a.id; };
1310
+ const selectRoomConnectionStatus = (state) => state.roomConnection.status;
1311
+ const selectRoomConnectionError = (state) => state.roomConnection.error;
1312
+ const selectRoomConnectionKnockResponse = (state) => state.roomConnection.knockResponse;
1313
+
1314
+ const emitter = new events$1.EventEmitter();
1315
+ function createNotificationEvent(payload) {
1316
+ const notificationEvent = Object.assign(Object.assign({}, payload), { timestamp: Date.now() });
1317
+ return notificationEvent;
1318
+ }
1319
+ const initialNotificationsState = {
1320
+ emitter,
1321
+ events: [],
1322
+ };
1323
+ const notificationsSlice = toolkit.createSlice({
1324
+ name: "notifications",
1325
+ initialState: initialNotificationsState,
1326
+ reducers: {
1327
+ addNotification: (state, action) => {
1328
+ return Object.assign(Object.assign({}, state), { events: [...state.events, Object.assign({}, action.payload)] });
1329
+ },
1330
+ doClearNotifications: (state) => {
1331
+ return Object.assign(Object.assign({}, state), { events: [] });
1332
+ },
1333
+ },
1334
+ });
1335
+ const { doClearNotifications } = notificationsSlice.actions;
1336
+ const doSetNotification = createAppThunk((payload) => (dispatch, getState) => {
1337
+ dispatch(notificationsSlice.actions.addNotification(payload));
1338
+ const state = getState();
1339
+ const emitter = selectNotificationsEmitter(state);
1340
+ emitter.emit(payload.type, payload);
1341
+ emitter.emit("*", payload);
1342
+ });
1343
+ const selectNotificationsRaw = (state) => state.notifications;
1344
+ const selectNotificationsEvents = (state) => state.notifications.events;
1345
+ const selectNotificationsEmitter = (state) => state.notifications.emitter;
1346
+ startAppListening({
1347
+ actionCreator: signalEvents.chatMessage,
1348
+ effect: ({ payload }, { dispatch, getState }) => {
1349
+ const state = getState();
1350
+ const selfId = selectSelfId(state);
1351
+ if (selfId === payload.senderId) {
1352
+ return;
1353
+ }
1354
+ const client = selectRemoteParticipants(state).find(({ id }) => id === payload.senderId);
1355
+ if (!client) {
1356
+ console.warn("Could not find remote client that sent chat message");
1357
+ return;
1358
+ }
1359
+ dispatch(doSetNotification(createNotificationEvent({
1360
+ type: "chatMessageReceived",
1361
+ message: `${client.displayName} says: ${payload.text}`,
1362
+ props: {
1363
+ client,
1364
+ chatMessage: {
1365
+ id: payload.id,
1366
+ senderId: payload.senderId,
1367
+ parentId: payload.parentId,
1368
+ timestamp: payload.timestamp,
1369
+ text: payload.text,
1370
+ sig: payload.sig,
1371
+ removed: false,
1372
+ },
1373
+ },
1374
+ })));
1375
+ },
1376
+ });
1377
+ startAppListening({
1378
+ actionCreator: signalEvents.audioEnableRequested,
1379
+ effect: ({ payload }, { dispatch, getState }) => {
1380
+ const { enable, requestedByClientId } = payload;
1381
+ const state = getState();
1382
+ const client = selectRemoteParticipants(state).find(({ id }) => id === requestedByClientId);
1383
+ if (!client) {
1384
+ console.warn("Could not find remote client that requested a local audio change");
1385
+ return;
1386
+ }
1387
+ dispatch(doSetNotification(createNotificationEvent({
1388
+ type: enable ? "requestAudioEnable" : "requestAudioDisable",
1389
+ message: enable
1390
+ ? `${client.displayName} has requested for you to speak`
1391
+ : `${client.displayName} has muted your microphone`,
1392
+ props: {
1393
+ client,
1394
+ enable,
1395
+ },
1396
+ })));
1397
+ },
1398
+ });
1399
+ startAppListening({
1400
+ actionCreator: signalEvents.videoEnableRequested,
1401
+ effect: ({ payload }, { dispatch, getState }) => {
1402
+ const { enable, requestedByClientId } = payload;
1403
+ const state = getState();
1404
+ const client = selectRemoteParticipants(state).find(({ id }) => id === requestedByClientId);
1405
+ if (!client) {
1406
+ console.warn("Could not find remote client that requested a local video change");
1407
+ return;
1408
+ }
1409
+ dispatch(doSetNotification(createNotificationEvent({
1410
+ type: enable ? "requestVideoEnable" : "requestVideoDisable",
1411
+ message: enable
1412
+ ? `${client.displayName} has requested for you to start video`
1413
+ : `${client.displayName} has stopped your video`,
1414
+ props: {
1415
+ client,
1416
+ enable,
1417
+ },
1418
+ })));
1419
+ },
1420
+ });
1421
+ startAppListening({
1422
+ actionCreator: signalEvents.clientMetadataReceived,
1423
+ effect: (action, { dispatch, getOriginalState, getState }) => {
1424
+ var _a;
1425
+ const { error, payload } = action.payload;
1426
+ if (error || !payload) {
1427
+ return;
1428
+ }
1429
+ const { clientId, stickyReaction } = payload;
1430
+ const state = getState();
1431
+ const canAskToSpeak = selectIsAuthorizedToAskToSpeak(state);
1432
+ if (!canAskToSpeak) {
1433
+ return;
1434
+ }
1435
+ const client = selectRemoteParticipants(state).find(({ id }) => id === clientId);
1436
+ if (!client) {
1437
+ console.warn("Could not find remote client that provided updated metadata");
1438
+ return;
1439
+ }
1440
+ const previousState = getOriginalState();
1441
+ const previousClient = selectRemoteParticipants(previousState).find(({ id }) => id === clientId);
1442
+ if ((!stickyReaction && !(previousClient === null || previousClient === void 0 ? void 0 : previousClient.stickyReaction)) ||
1443
+ (stickyReaction === null || stickyReaction === void 0 ? void 0 : stickyReaction.timestamp) === ((_a = previousClient === null || previousClient === void 0 ? void 0 : previousClient.stickyReaction) === null || _a === void 0 ? void 0 : _a.timestamp)) {
1444
+ return;
1445
+ }
1446
+ dispatch(doSetNotification(createNotificationEvent({
1447
+ type: stickyReaction ? "remoteHandRaised" : "remoteHandLowered",
1448
+ message: `${client.displayName} ${stickyReaction ? "raised" : "lowered"} their hand`,
1449
+ props: {
1450
+ client,
1451
+ stickyReaction,
1452
+ },
1453
+ })));
1454
+ },
1455
+ });
1456
+ createReactor([selectSignalStatus], ({ dispatch, getState }, signalStatus) => {
1457
+ const state = getState();
1458
+ const roomConnectionStatus = selectRoomConnectionStatus(state);
1459
+ if (["left", "kicked"].includes(roomConnectionStatus)) {
1460
+ return;
1461
+ }
1462
+ if (signalStatus === "disconnected") {
1463
+ dispatch(doSetNotification(createNotificationEvent({
1464
+ type: "signalTrouble",
1465
+ message: `Network connection lost. Trying to reconnect you...`,
1466
+ props: {},
1467
+ })));
1468
+ }
1469
+ else if (signalStatus === "connected") {
1470
+ dispatch(doSetNotification(createNotificationEvent({
1471
+ type: "signalOk",
1472
+ message: `Network connection available`,
1473
+ props: {},
1474
+ })));
1475
+ }
1476
+ });
1477
+ startAppListening({
1478
+ actionCreator: signalEvents.clientUnableToJoin,
1479
+ effect: (action, { dispatch }) => {
1480
+ var _a;
1481
+ if (((_a = action.payload) === null || _a === void 0 ? void 0 : _a.error) === "room_full") {
1482
+ dispatch(doSetNotification(createNotificationEvent({
1483
+ type: "clientUnableToJoinFullRoom",
1484
+ message: "Someone tried to join but the room is full and at capacity.",
1485
+ props: {},
1486
+ })));
1487
+ }
1488
+ },
1489
+ });
1490
+
1491
+ const DEFAULT_BREAKOUT_TIMER_DURATION = 1800;
1492
+ function createBreakout({ assignments, groups, startedAt, initiatedBy, breakoutStartedAt, breakoutEndedAt, breakoutNotification, breakoutTimerDuration, autoMoveToGroup, moveToGroupGracePeriod, autoMoveToMain, moveToMainGracePeriod, enforceAssignment, breakoutTimerSetting, } = {}) {
1493
+ return {
1494
+ assignments: assignments || null,
1495
+ groups: groups || null,
1496
+ startedAt: startedAt ? new Date(startedAt) : null,
1497
+ initiatedBy,
1498
+ breakoutStartedAt: breakoutStartedAt || null,
1499
+ breakoutEndedAt: breakoutEndedAt || null,
1500
+ breakoutNotification: breakoutNotification || null,
1501
+ breakoutTimerDuration: breakoutTimerDuration || DEFAULT_BREAKOUT_TIMER_DURATION,
1502
+ autoMoveToGroup: autoMoveToGroup || false,
1503
+ moveToGroupGracePeriod: moveToGroupGracePeriod || 10,
1504
+ autoMoveToMain: autoMoveToMain || false,
1505
+ moveToMainGracePeriod: moveToMainGracePeriod || 30,
1506
+ enforceAssignment: enforceAssignment || false,
1507
+ breakoutTimerSetting: breakoutTimerSetting || false,
1508
+ };
1509
+ }
1510
+ const breakoutSliceInitialState = Object.assign(Object.assign({}, createBreakout()), { error: null });
1511
+ const BREAKOUT_UNAVAILABLE_ERROR = "Breakout groups are not available in peer-to-peer rooms";
1512
+ const breakoutSlice = toolkit.createSlice({
1513
+ name: "breakout",
1514
+ initialState: breakoutSliceInitialState,
1515
+ reducers: {
1516
+ setBreakoutError: (state, action) => {
1517
+ return Object.assign(Object.assign({}, state), { error: action.payload.error });
1518
+ },
1519
+ },
1520
+ extraReducers: (builder) => {
1521
+ builder.addCase(signalEvents.roomJoined, (state, action) => {
1522
+ if ("error" in action.payload) {
1523
+ return state;
1524
+ }
1525
+ const { breakout } = action.payload || {};
1526
+ state = Object.assign(Object.assign({}, state), { error: null });
1527
+ if (breakout) {
1528
+ return Object.assign(Object.assign({}, state), createBreakout(breakout));
1529
+ }
1530
+ return state;
1531
+ });
1532
+ builder.addCase(signalEvents.breakoutSessionUpdated, (state, action) => {
1533
+ return Object.assign(Object.assign({}, state), createBreakout(action.payload));
1534
+ });
1535
+ },
1536
+ });
1537
+ const { setBreakoutError } = breakoutSlice.actions;
1538
+ const doBreakoutJoin = createAppThunk((payload) => (_, getState) => {
1539
+ const state = getState();
1540
+ const { socket } = selectSignalConnectionRaw(state);
1541
+ socket === null || socket === void 0 ? void 0 : socket.emit("join_breakout_group", { group: payload.group });
1542
+ });
1543
+ function ensureDefaults(state, payload) {
1544
+ const { moveToGroupGracePeriod, moveToMainGracePeriod, breakoutTimerDuration } = state.breakout;
1545
+ const next = Object.assign({}, payload);
1546
+ if (next.autoMoveToGroup === true && next.moveToGroupGracePeriod == null) {
1547
+ next.moveToGroupGracePeriod = moveToGroupGracePeriod !== null && moveToGroupGracePeriod !== void 0 ? moveToGroupGracePeriod : 10;
1548
+ }
1549
+ if (next.autoMoveToMain === true && next.moveToMainGracePeriod == null) {
1550
+ next.moveToMainGracePeriod = moveToMainGracePeriod !== null && moveToMainGracePeriod !== void 0 ? moveToMainGracePeriod : 30;
1551
+ }
1552
+ if (next.breakoutTimerSetting === true && !next.breakoutTimerDuration) {
1553
+ next.breakoutTimerDuration = breakoutTimerDuration || DEFAULT_BREAKOUT_TIMER_DURATION;
1554
+ }
1555
+ return next;
1556
+ }
1557
+ function emitBreakoutSessionUpdate(state, payload) {
1558
+ const { socket } = selectSignalConnectionRaw(state);
1559
+ socket === null || socket === void 0 ? void 0 : socket.emit("update_breakout_session", ensureDefaults(state, payload));
1560
+ }
1561
+ function resolveClientAssignmentsToDeviceAssignments(state, clientAssignments) {
1562
+ const deviceIdByClientId = {};
1563
+ for (const participant of selectRemoteParticipants(state)) {
1564
+ deviceIdByClientId[participant.id] = participant.deviceId;
1565
+ }
1566
+ const localParticipant = selectLocalParticipantRaw(state);
1567
+ const localDeviceId = selectDeviceId(state);
1568
+ if (localParticipant.id && localDeviceId) {
1569
+ deviceIdByClientId[localParticipant.id] = localDeviceId;
1570
+ }
1571
+ const deviceAssignments = {};
1572
+ for (const [clientId, group] of Object.entries(clientAssignments)) {
1573
+ const deviceId = deviceIdByClientId[clientId];
1574
+ if (deviceId) {
1575
+ deviceAssignments[deviceId] = group;
1576
+ }
1577
+ }
1578
+ return deviceAssignments;
1579
+ }
1580
+ const doStartBreakoutSession = createAppAuthorizedThunk((state) => selectIsAuthorizedToManageBreakout(state), (payload) => (dispatch, getState) => {
1581
+ const state = getState();
1582
+ if (!selectBreakoutIsAvailable(state)) {
1583
+ dispatch(setBreakoutError({ error: BREAKOUT_UNAVAILABLE_ERROR }));
1584
+ console.warn(BREAKOUT_UNAVAILABLE_ERROR);
1585
+ return;
1586
+ }
1587
+ dispatch(setBreakoutError({ error: null }));
1588
+ const { assignments } = payload, rest = __rest(payload, ["assignments"]);
1589
+ emitBreakoutSessionUpdate(state, Object.assign(Object.assign(Object.assign({}, rest), (assignments ? { assignments: resolveClientAssignmentsToDeviceAssignments(state, assignments) } : {})), { active: true }));
1590
+ });
1591
+ const doUpdateBreakoutSession = createAppAuthorizedThunk((state) => selectIsAuthorizedToManageBreakout(state), (payload) => (_, getState) => {
1592
+ const state = getState();
1593
+ const { assignments } = payload, rest = __rest(payload, ["assignments"]);
1594
+ emitBreakoutSessionUpdate(state, Object.assign(Object.assign({}, rest), (assignments ? { assignments: resolveClientAssignmentsToDeviceAssignments(state, assignments) } : {})));
1595
+ });
1596
+ const doStopBreakoutSession = createAppAuthorizedThunk((state) => selectIsAuthorizedToManageBreakout(state), () => (_, getState) => {
1597
+ emitBreakoutSessionUpdate(getState(), { active: false });
1598
+ });
1599
+ const doAssignBreakoutParticipants = createAppAuthorizedThunk((state) => selectIsAuthorizedToManageBreakout(state), (payload) => (_, getState) => {
1600
+ const state = getState();
1601
+ const deviceAssignments = resolveClientAssignmentsToDeviceAssignments(state, payload.assignments);
1602
+ const mergedAssignments = Object.assign(Object.assign({}, (selectBreakoutAssignments(state) || {})), deviceAssignments);
1603
+ emitBreakoutSessionUpdate(state, { assignments: mergedAssignments });
1604
+ });
1605
+ const BREAKOUT_GROUPS_MIN_MAX = [2, 20];
1606
+ const GROUP_ID_ALPHABET = "abcdefghijklmnopqrstuvwxyz";
1607
+ function defaultBreakoutGroupName(groupId) {
1608
+ return `Group ${groupId.toUpperCase()}`;
1609
+ }
1610
+ function createBreakoutGroups(count = BREAKOUT_GROUPS_MIN_MAX[0]) {
1611
+ const [min, max] = BREAKOUT_GROUPS_MIN_MAX;
1612
+ const amount = Math.min(Math.max(count, min), max);
1613
+ const groups = {};
1614
+ for (let i = 0; i < amount; i++) {
1615
+ const id = GROUP_ID_ALPHABET[i];
1616
+ groups[id] = defaultBreakoutGroupName(id);
1617
+ }
1618
+ return groups;
1619
+ }
1620
+ function shuffle(items) {
1621
+ return [...items].sort(() => Math.random() - 0.5);
1622
+ }
1623
+ function chunk(items, chunkCount) {
1624
+ let remaining = [...items];
1625
+ let count = chunkCount;
1626
+ const chunks = [];
1627
+ while (remaining.length && count > 0) {
1628
+ const size = Math.ceil(remaining.length / count);
1629
+ chunks.push(remaining.slice(0, size));
1630
+ remaining = remaining.slice(size);
1631
+ count -= 1;
1632
+ }
1633
+ return chunks;
1634
+ }
1635
+ function randomizeAssignments(deviceIds, groupIds) {
1636
+ const assignments = {};
1637
+ chunk(deviceIds, groupIds.length).forEach((chunkOfDevices, index) => {
1638
+ chunkOfDevices.forEach((deviceId) => {
1639
+ assignments[deviceId] = groupIds[index];
1640
+ });
1641
+ });
1642
+ return assignments;
1643
+ }
1644
+ const doAssignAllBreakoutParticipants = createAppAuthorizedThunk((state) => selectIsAuthorizedToManageBreakout(state), () => (_, getState) => {
1645
+ const state = getState();
1646
+ const groupIds = Object.keys(selectBreakoutGroups(state) || {});
1647
+ if (!groupIds.length)
1648
+ return;
1649
+ const deviceIds = shuffle(selectRemoteParticipants(state).map((participant) => participant.deviceId));
1650
+ emitBreakoutSessionUpdate(state, { assignments: randomizeAssignments(deviceIds, groupIds) });
1651
+ });
1652
+ const doUnassignAllBreakoutParticipants = createAppAuthorizedThunk((state) => selectIsAuthorizedToManageBreakout(state), () => (_, getState) => {
1653
+ const state = getState();
1654
+ const assignments = selectBreakoutAssignments(state) || {};
1655
+ const cleared = Object.keys(assignments).reduce((acc, deviceId) => {
1656
+ acc[deviceId] = "";
1657
+ return acc;
1658
+ }, {});
1659
+ emitBreakoutSessionUpdate(state, { assignments: cleared });
1660
+ });
1661
+ const doShuffleBreakoutParticipants = createAppAuthorizedThunk((state) => selectIsAuthorizedToManageBreakout(state), () => (_, getState) => {
1662
+ const state = getState();
1663
+ const groupIds = Object.keys(selectBreakoutGroups(state) || {});
1664
+ if (!groupIds.length)
1665
+ return;
1666
+ const assignments = selectBreakoutAssignments(state) || {};
1667
+ const deviceIds = shuffle(Object.entries(assignments)
1668
+ .filter(([, groupId]) => !!groupId)
1669
+ .map(([deviceId]) => deviceId));
1670
+ emitBreakoutSessionUpdate(state, { assignments: randomizeAssignments(deviceIds, groupIds) });
1671
+ });
1672
+ const doExtendBreakoutTimer = createAppAuthorizedThunk((state) => selectIsAuthorizedToManageBreakout(state), (payload) => (_, getState) => {
1673
+ var _a;
1674
+ const state = getState();
1675
+ const additionalSeconds = (_a = payload === null || payload === void 0 ? void 0 : payload.seconds) !== null && _a !== void 0 ? _a : 60;
1676
+ const breakoutTimerDuration = (selectBreakoutTimerDuration(state) || 0) + additionalSeconds;
1677
+ emitBreakoutSessionUpdate(state, { breakoutTimerDuration });
1678
+ });
1679
+ const doStopBreakoutTimer = createAppAuthorizedThunk((state) => selectIsAuthorizedToManageBreakout(state), () => (_, getState) => {
1680
+ emitBreakoutSessionUpdate(getState(), { breakoutTimerSetting: false });
1681
+ });
1682
+ const selectBreakoutRaw = (state) => state.breakout;
1683
+ const selectBreakoutError = (state) => state.breakout.error;
1684
+ const selectBreakoutIsAvailable = (state) => state.room.mode === "group";
1685
+ const selectBreakoutInitiatedBy = (state) => state.breakout.initiatedBy;
1686
+ const selectBreakoutActive = (state) => !!state.breakout.startedAt;
1687
+ const selectBreakoutAssignments = (state) => state.breakout.assignments;
1688
+ const selectBreakoutGroups = (state) => state.breakout.groups;
1689
+ const selectBreakoutEnforceAssignment = (state) => state.breakout.enforceAssignment;
1690
+ const selectBreakoutTimerSetting = (state) => state.breakout.breakoutTimerSetting;
1691
+ const selectBreakoutTimerDuration = (state) => state.breakout.breakoutTimerDuration;
1692
+ const selectBreakoutAutoMoveToGroup = (state) => state.breakout.autoMoveToGroup;
1693
+ const selectBreakoutMoveToGroupGracePeriod = (state) => state.breakout.moveToGroupGracePeriod;
1694
+ const selectBreakoutAutoMoveToMain = (state) => state.breakout.autoMoveToMain;
1695
+ const selectBreakoutMoveToMainGracePeriod = (state) => state.breakout.moveToMainGracePeriod;
1696
+ const selectBreakoutStartedAt = (state) => state.breakout.startedAt;
1697
+ const selectBreakoutEndTime = toolkit.createSelector(selectBreakoutRaw, (raw) => {
1698
+ if (!raw.breakoutStartedAt)
1699
+ return null;
1700
+ const startTime = new Date(raw.breakoutStartedAt).getTime();
1701
+ const gracePeriod = raw.autoMoveToGroup ? raw.moveToGroupGracePeriod || 0 : 0;
1702
+ return startTime + ((raw.breakoutTimerDuration || 0) + gracePeriod) * 1000;
1703
+ });
1704
+ const selectBreakoutMoveToGroupAt = toolkit.createSelector(selectBreakoutRaw, (raw) => {
1705
+ if (!raw.autoMoveToGroup || !raw.breakoutStartedAt)
1706
+ return null;
1707
+ return new Date(raw.breakoutStartedAt).getTime() + (raw.moveToGroupGracePeriod || 0) * 1000;
1708
+ });
1709
+ const selectBreakoutMoveToMainAt = toolkit.createSelector(selectBreakoutRaw, (raw) => {
1710
+ if (!raw.autoMoveToMain || !raw.breakoutEndedAt)
1711
+ return null;
1712
+ return new Date(raw.breakoutEndedAt).getTime() + (raw.moveToMainGracePeriod || 0) * 1000;
1713
+ });
1714
+ const selectBreakoutCurrentId = toolkit.createSelector(selectLocalParticipantBreakoutGroup, (localParticipantBreakoutGroup) => localParticipantBreakoutGroup || "");
1715
+ const selectBreakoutCurrentGroup = toolkit.createSelector(selectBreakoutRaw, selectBreakoutCurrentId, (raw, breakoutCurrentId) => {
1716
+ var _a;
1717
+ const name = (_a = raw.groups) === null || _a === void 0 ? void 0 : _a[breakoutCurrentId];
1718
+ if (!name)
1719
+ return null;
1720
+ return { id: breakoutCurrentId, name };
1721
+ });
1722
+ startAppListening({
1723
+ actionCreator: signalEvents.breakoutMoveToGroup,
1724
+ effect: (_, { dispatch, getState }) => {
1725
+ const state = getState();
1726
+ const localParticipant = selectLocalParticipantRaw(state);
1727
+ const breakoutGroupAssigned = localParticipant.breakoutGroupAssigned;
1728
+ if (breakoutGroupAssigned) {
1729
+ dispatch(doBreakoutJoin({ group: breakoutGroupAssigned }));
1730
+ }
1731
+ },
1732
+ });
1733
+ startAppListening({
1734
+ actionCreator: signalEvents.breakoutMoveToMain,
1735
+ effect: (_, { dispatch }) => {
1736
+ dispatch(doBreakoutJoin({ group: "" }));
1737
+ },
1738
+ });
1739
+ startAppListening({
1740
+ actionCreator: signalEvents.breakoutSessionUpdated,
1741
+ effect: ({ payload }, { dispatch, getState }) => {
1742
+ var _a;
1743
+ const state = getState();
1744
+ const autoMoveToMain = selectBreakoutRaw(state).autoMoveToMain;
1745
+ if (((_a = payload.initiatedBy) === null || _a === void 0 ? void 0 : _a.active) === false) {
1746
+ if (!autoMoveToMain) {
1747
+ dispatch(doBreakoutJoin({ group: "" }));
1748
+ }
1749
+ }
1750
+ },
1751
+ });
1752
+ startAppListening({
1753
+ actionCreator: signalEvents.breakoutEnding,
1754
+ effect: (_, { dispatch }) => {
1755
+ dispatch(doSetNotification(createNotificationEvent({
1756
+ type: "breakoutTimerEnding",
1757
+ message: "The breakout session is ending soon",
1758
+ props: {},
1759
+ })));
1760
+ },
1761
+ });
1762
+ startAppListening({
1763
+ actionCreator: signalEvents.breakoutTimerExtended,
1764
+ effect: (_, { dispatch }) => {
1765
+ dispatch(doSetNotification(createNotificationEvent({
1766
+ type: "breakoutTimerExtended",
1767
+ message: "The breakout timer was extended",
1768
+ props: {},
1769
+ })));
1770
+ },
1771
+ });
1772
+ startAppListening({
1773
+ actionCreator: signalEvents.breakoutTimerEnded,
1774
+ effect: (_, { dispatch }) => {
1775
+ dispatch(doSetNotification(createNotificationEvent({
1776
+ type: "breakoutTimerEnded",
1777
+ message: "The breakout timer ended",
1778
+ props: {},
1779
+ })));
1780
+ },
1781
+ });
1782
+
1783
+ const chatSliceInitialState = {
1784
+ chatMessages: [],
1785
+ };
1786
+ const chatSlice = toolkit.createSlice({
1787
+ name: "chat",
1788
+ initialState: chatSliceInitialState,
1789
+ reducers: {},
1790
+ extraReducers(builder) {
1791
+ builder.addCase(signalEvents.chatMessage, (state, action) => {
1792
+ const message = Object.assign({ id: action.payload.id, senderId: action.payload.senderId, parentId: action.payload.parentId, timestamp: action.payload.timestamp, text: action.payload.text, sig: action.payload.sig, removed: false }, (action.payload.file && { file: action.payload.file }));
1793
+ return Object.assign(Object.assign({}, state), { chatMessages: [...state.chatMessages, message] });
1794
+ });
1795
+ builder.addCase(signalEvents.chatMessageRemoved, (state, action) => {
1796
+ return Object.assign(Object.assign({}, state), { chatMessages: state.chatMessages.map((m) => {
1797
+ return Object.assign(Object.assign({}, m), (m.id === action.payload.id && {
1798
+ removed: true,
1799
+ }));
1800
+ }) });
1801
+ });
1802
+ },
1803
+ });
1804
+ const doSendChatMessage = createRoomConnectedThunk((payload) => (_, getState) => {
1805
+ const state = getState();
1806
+ const socket = selectSignalConnectionRaw(state).socket;
1807
+ const breakoutCurrentId = selectBreakoutCurrentId(state);
1808
+ socket === null || socket === void 0 ? void 0 : socket.emit("chat_message", Object.assign(Object.assign(Object.assign({ text: payload.text }, (payload.parentId && { parentId: payload.parentId })), (breakoutCurrentId && { breakoutGroup: breakoutCurrentId })), (payload.isBroadcast && { broadcast: true })));
1809
+ });
1810
+ const doRemoveChatMessage = createRoomConnectedThunk(({ id, sig }) => (_, getState) => {
1811
+ const state = getState();
1812
+ const socket = selectSignalConnectionRaw(state).socket;
1813
+ socket === null || socket === void 0 ? void 0 : socket.emit("remove_chat_message", {
1814
+ id,
1815
+ sig,
1816
+ });
1817
+ });
1818
+ const selectChatRaw = (state) => state.chat;
1819
+ const selectChatMessages = (state) => state.chat.chatMessages;
1820
+
1821
+ const initialCloudRecordingState = {
1822
+ isInitiator: false,
1823
+ isRecording: false,
1824
+ startedAt: undefined,
1825
+ };
1826
+ const cloudRecordingSlice = toolkit.createSlice({
1827
+ name: "cloudRecording",
1828
+ initialState: initialCloudRecordingState,
1829
+ reducers: {
1830
+ recordingRequestStarted: (state) => {
1831
+ return Object.assign(Object.assign({}, state), { isInitiator: true, status: "requested" });
1832
+ },
1833
+ },
1834
+ extraReducers: (builder) => {
1835
+ builder.addCase(signalEvents.cloudRecordingStopped, (state) => {
1836
+ return Object.assign(Object.assign({}, state), { isInitiator: false, isRecording: false, status: undefined });
1837
+ });
1838
+ builder.addCase(signalEvents.cloudRecordingStarted, (state, action) => {
1839
+ const { payload } = action;
1840
+ if (!payload.error) {
1447
1841
  return state;
1448
1842
  }
1449
- const { clientId, displayName, stickyReaction } = payload;
1450
- return updateParticipant(state, clientId, {
1451
- displayName,
1452
- stickyReaction,
1453
- });
1454
- });
1455
- builder.addCase(signalEvents.breakoutGroupJoined, (state, action) => {
1456
- const { clientId, group } = action.payload;
1457
- return updateParticipant(state, clientId, {
1458
- breakoutGroup: group || null,
1459
- });
1460
- });
1461
- builder.addCase(signalEvents.screenshareStarted, (state, action) => {
1462
- const { clientId, streamId } = action.payload;
1463
- return addStreamId(state, clientId, streamId);
1843
+ return Object.assign(Object.assign({}, state), { isInitiator: false, isRecording: false, status: "error", error: payload.error });
1464
1844
  });
1465
- builder.addCase(signalEvents.screenshareStopped, (state, action) => {
1466
- const { clientId, streamId } = action.payload;
1467
- return removeStreamId(state, clientId, streamId);
1845
+ builder.addCase(signalEvents.newClient, (state, { payload }) => {
1846
+ var _a;
1847
+ const { client } = payload;
1848
+ if (((_a = client.role) === null || _a === void 0 ? void 0 : _a.roleName) === "recorder") {
1849
+ return Object.assign(Object.assign({}, state), { isRecording: true, status: "recording", startedAt: client.startedCloudRecordingAt
1850
+ ? new Date(client.startedCloudRecordingAt).getTime()
1851
+ : new Date().getTime() });
1852
+ }
1853
+ return state;
1468
1854
  });
1469
1855
  },
1470
1856
  });
1471
- const { participantStreamAdded, participantStreamIdAdded, streamStatusUpdated } = remoteParticipantsSlice.actions;
1472
- const doRequestAudioEnable = createAuthorizedRoomConnectedThunk((state) => selectIsAuthorizedToRequestAudioEnable(state), (payload) => (_, getState) => {
1857
+ const { recordingRequestStarted } = cloudRecordingSlice.actions;
1858
+ const doStartCloudRecording = createRoomConnectedThunk(() => (dispatch, getState) => {
1473
1859
  const state = getState();
1474
- const canEnableRemoteAudio = selectIsAuthorizedToAskToSpeak(state);
1475
- if (payload.enable && !canEnableRemoteAudio) {
1476
- console.warn("Not authorized to perform this action");
1860
+ const socket = selectSignalConnectionRaw(state).socket;
1861
+ const status = selectCloudRecordingStatus(state);
1862
+ if (status && ["recording", "requested"].includes(status)) {
1477
1863
  return;
1478
1864
  }
1479
- const socket = selectSignalConnectionRaw(state).socket;
1480
- socket === null || socket === void 0 ? void 0 : socket.emit("request_audio_enable", payload);
1865
+ socket === null || socket === void 0 ? void 0 : socket.emit("start_recording", {
1866
+ recording: "cloud",
1867
+ });
1868
+ dispatch(recordingRequestStarted());
1481
1869
  });
1482
- const doRequestVideoEnable = createAuthorizedRoomConnectedThunk((state) => selectIsAuthorizedToRequestVideoEnable(state), (payload) => (_, getState) => {
1870
+ const doStopCloudRecording = createRoomConnectedThunk(() => (dispatch, getState) => {
1483
1871
  const state = getState();
1484
1872
  const socket = selectSignalConnectionRaw(state).socket;
1485
- socket === null || socket === void 0 ? void 0 : socket.emit("request_video_enable", payload);
1486
- });
1487
- const selectRemoteParticipantsRaw = (state) => state.remoteParticipants;
1488
- const selectRemoteClients = (state) => state.remoteParticipants.remoteParticipants;
1489
- const selectRemoteParticipants = toolkit.createSelector(selectRemoteClients, (clients) => clients.filter((c) => !NON_PERSON_ROLES.includes(c.roleName)));
1490
- const selectNumClients = toolkit.createSelector(selectRemoteClients, (clients) => clients.length + 1);
1491
- const selectNumParticipants = toolkit.createSelector(selectRemoteParticipants, selectLocalParticipantRaw, (clients, localParticipant) => {
1492
- if (NON_PERSON_ROLES.includes(localParticipant.roleName)) {
1493
- return clients.length;
1494
- }
1495
- return clients.length + 1;
1873
+ socket === null || socket === void 0 ? void 0 : socket.emit("stop_recording");
1496
1874
  });
1875
+ const selectCloudRecordingRaw = (state) => state.cloudRecording;
1876
+ const selectCloudRecordingStatus = (state) => state.cloudRecording.status;
1877
+ const selectCloudRecordingStartedAt = (state) => state.cloudRecording.startedAt;
1878
+ const selectCloudRecordingError = (state) => state.cloudRecording.error;
1879
+ const selectIsCloudRecording = (state) => state.cloudRecording.isRecording;
1880
+ const selectCloudRecordingIsInitiator = (state) => state.cloudRecording.isInitiator;
1497
1881
 
1498
1882
  const localScreenshareSliceInitialState = {
1499
1883
  status: "inactive",
@@ -1589,6 +1973,7 @@ function isRecorderClient(client) {
1589
1973
  }
1590
1974
  const roomSliceInitialState = {
1591
1975
  isLocked: false,
1976
+ mode: null,
1592
1977
  };
1593
1978
  const roomSlice = toolkit.createSlice({
1594
1979
  name: "room",
@@ -1596,6 +1981,7 @@ const roomSlice = toolkit.createSlice({
1596
1981
  reducers: {},
1597
1982
  extraReducers: (builder) => {
1598
1983
  builder.addCase(signalEvents.roomJoined, (state, action) => {
1984
+ var _a;
1599
1985
  if ("error" in action.payload) {
1600
1986
  if (action.payload.error === "room_locked") {
1601
1987
  return Object.assign(Object.assign({}, state), { isLocked: Boolean(action.payload.isLocked) });
@@ -1603,7 +1989,7 @@ const roomSlice = toolkit.createSlice({
1603
1989
  return state;
1604
1990
  }
1605
1991
  const { room } = action.payload;
1606
- return Object.assign(Object.assign({}, state), { isLocked: Boolean(room.isLocked) });
1992
+ return Object.assign(Object.assign({}, state), { isLocked: Boolean(room.isLocked), mode: (_a = room.mode) !== null && _a !== void 0 ? _a : (room.sfuServer ? "group" : "normal") });
1607
1993
  });
1608
1994
  builder.addCase(signalEvents.roomLocked, (state, action) => {
1609
1995
  const { isLocked } = action.payload;
@@ -1633,6 +2019,7 @@ const doEndMeeting = createAppAuthorizedThunk((state) => selectIsAuthorizedToEnd
1633
2019
  }
1634
2020
  });
1635
2021
  const selectRoomIsLocked = (state) => state.room.isLocked;
2022
+ const selectRoomMode = (state) => state.room.mode;
1636
2023
  const selectScreenshares = toolkit.createSelector(selectLocalScreenshareStream, selectLocalParticipantRaw, selectRemoteParticipants, (localScreenshareStream, localParticipant, remoteParticipants) => {
1637
2024
  const screenshares = [];
1638
2025
  if (localScreenshareStream) {
@@ -1974,8 +2361,7 @@ const doHandleAcceptStreams = createAppThunk((payload) => (dispatch, getState) =
1974
2361
  const participant = remoteClients.find((p) => p.id === clientId);
1975
2362
  if (!participant)
1976
2363
  continue;
1977
- if (state === "to_accept" ||
1978
- (state === "new_accept" && shouldAcceptNewClients)) {
2364
+ if (state === "to_accept" || (state === "new_accept" && shouldAcceptNewClients)) {
1979
2365
  rtcManager.acceptNewStream({
1980
2366
  streamId: streamId === media.CAMERA_STREAM_ID ? clientId : streamId,
1981
2367
  clientId,
@@ -2018,7 +2404,10 @@ const doRtcManagerInitialize = createAppThunk(() => (dispatch, getState) => {
2018
2404
  const isCameraEnabled = selectIsCameraEnabled(getState());
2019
2405
  const isMicrophoneEnabled = selectIsMicrophoneEnabled(getState());
2020
2406
  if (localMediaStream && rtcManager) {
2021
- rtcManager.addCameraStream(localMediaStream, { audioPaused: !isMicrophoneEnabled, videoPaused: !isCameraEnabled });
2407
+ rtcManager.addCameraStream(localMediaStream, {
2408
+ audioPaused: !isMicrophoneEnabled,
2409
+ videoPaused: !isCameraEnabled,
2410
+ });
2022
2411
  }
2023
2412
  dispatch(rtcManagerInitialized());
2024
2413
  });
@@ -2161,7 +2550,7 @@ const selectStreamsToAccept = toolkit.createSelector(selectRtcStatus, selectRemo
2161
2550
  }
2162
2551
  if ((!client.breakoutGroup && !breakoutCurrentId) ||
2163
2552
  client.breakoutGroup === breakoutCurrentId ||
2164
- ("" === client.breakoutGroup && clientSpotlight) ||
2553
+ (!client.breakoutGroup && clientSpotlight) ||
2165
2554
  ignoreBreakoutGroups) {
2166
2555
  if (state === "done_accept")
2167
2556
  continue;
@@ -2747,190 +3136,21 @@ createReactor([
2747
3136
  dispatch(doSendClientMetadata());
2748
3137
  }
2749
3138
  });
2750
- createReactor([selectBreakoutAssignments, selectDeviceId, selectLocalParticipantRaw], ({ dispatch }, breakoutAssignments, deviceId, localParticipant) => {
3139
+ createReactor([selectBreakoutAssignments, selectDeviceId, selectLocalParticipantRaw, selectBreakoutGroups, selectBreakoutActive], ({ dispatch }, breakoutAssignments, deviceId, localParticipant, breakoutGroups, breakoutActive) => {
2751
3140
  const breakoutGroupAssigned = (breakoutAssignments === null || breakoutAssignments === void 0 ? void 0 : breakoutAssignments[deviceId || ""]) || "";
2752
3141
  if (localParticipant.breakoutGroupAssigned === breakoutGroupAssigned) {
2753
3142
  return;
2754
3143
  }
2755
3144
  dispatch(setBreakoutGroupAssigned({ breakoutGroupAssigned }));
2756
- });
2757
-
2758
- const emitter = new events$1.EventEmitter();
2759
- function createNotificationEvent(payload) {
2760
- const notificationEvent = Object.assign(Object.assign({}, payload), { timestamp: Date.now() });
2761
- return notificationEvent;
2762
- }
2763
- const initialNotificationsState = {
2764
- emitter,
2765
- events: [],
2766
- };
2767
- const notificationsSlice = toolkit.createSlice({
2768
- name: "notifications",
2769
- initialState: initialNotificationsState,
2770
- reducers: {
2771
- addNotification: (state, action) => {
2772
- return Object.assign(Object.assign({}, state), { events: [...state.events, Object.assign({}, action.payload)] });
2773
- },
2774
- doClearNotifications: (state) => {
2775
- return Object.assign(Object.assign({}, state), { events: [] });
2776
- },
2777
- },
2778
- });
2779
- const { doClearNotifications } = notificationsSlice.actions;
2780
- const doSetNotification = createAppThunk((payload) => (dispatch, getState) => {
2781
- dispatch(notificationsSlice.actions.addNotification(payload));
2782
- const state = getState();
2783
- const emitter = selectNotificationsEmitter(state);
2784
- emitter.emit(payload.type, payload);
2785
- emitter.emit("*", payload);
2786
- });
2787
- const selectNotificationsRaw = (state) => state.notifications;
2788
- const selectNotificationsEvents = (state) => state.notifications.events;
2789
- const selectNotificationsEmitter = (state) => state.notifications.emitter;
2790
- startAppListening({
2791
- actionCreator: signalEvents.chatMessage,
2792
- effect: ({ payload }, { dispatch, getState }) => {
2793
- const state = getState();
2794
- const selfId = selectSelfId(state);
2795
- if (selfId === payload.senderId) {
2796
- return;
2797
- }
2798
- const client = selectRemoteParticipants(state).find(({ id }) => id === payload.senderId);
2799
- if (!client) {
2800
- console.warn("Could not find remote client that sent chat message");
2801
- return;
2802
- }
2803
- dispatch(doSetNotification(createNotificationEvent({
2804
- type: "chatMessageReceived",
2805
- message: `${client.displayName} says: ${payload.text}`,
2806
- props: {
2807
- client,
2808
- chatMessage: {
2809
- id: payload.id,
2810
- senderId: payload.senderId,
2811
- parentId: payload.parentId,
2812
- timestamp: payload.timestamp,
2813
- text: payload.text,
2814
- sig: payload.sig,
2815
- removed: false,
2816
- },
2817
- },
2818
- })));
2819
- },
2820
- });
2821
- startAppListening({
2822
- actionCreator: signalEvents.audioEnableRequested,
2823
- effect: ({ payload }, { dispatch, getState }) => {
2824
- const { enable, requestedByClientId } = payload;
2825
- const state = getState();
2826
- const client = selectRemoteParticipants(state).find(({ id }) => id === requestedByClientId);
2827
- if (!client) {
2828
- console.warn("Could not find remote client that requested a local audio change");
2829
- return;
2830
- }
2831
- dispatch(doSetNotification(createNotificationEvent({
2832
- type: enable ? "requestAudioEnable" : "requestAudioDisable",
2833
- message: enable
2834
- ? `${client.displayName} has requested for you to speak`
2835
- : `${client.displayName} has muted your microphone`,
2836
- props: {
2837
- client,
2838
- enable,
2839
- },
2840
- })));
2841
- },
2842
- });
2843
- startAppListening({
2844
- actionCreator: signalEvents.videoEnableRequested,
2845
- effect: ({ payload }, { dispatch, getState }) => {
2846
- const { enable, requestedByClientId } = payload;
2847
- const state = getState();
2848
- const client = selectRemoteParticipants(state).find(({ id }) => id === requestedByClientId);
2849
- if (!client) {
2850
- console.warn("Could not find remote client that requested a local video change");
2851
- return;
2852
- }
2853
- dispatch(doSetNotification(createNotificationEvent({
2854
- type: enable ? "requestVideoEnable" : "requestVideoDisable",
2855
- message: enable
2856
- ? `${client.displayName} has requested for you to start video`
2857
- : `${client.displayName} has stopped your video`,
2858
- props: {
2859
- client,
2860
- enable,
2861
- },
2862
- })));
2863
- },
2864
- });
2865
- startAppListening({
2866
- actionCreator: signalEvents.clientMetadataReceived,
2867
- effect: (action, { dispatch, getOriginalState, getState }) => {
2868
- var _a;
2869
- const { error, payload } = action.payload;
2870
- if (error || !payload) {
2871
- return;
2872
- }
2873
- const { clientId, stickyReaction } = payload;
2874
- const state = getState();
2875
- const canAskToSpeak = selectIsAuthorizedToAskToSpeak(state);
2876
- if (!canAskToSpeak) {
2877
- return;
2878
- }
2879
- const client = selectRemoteParticipants(state).find(({ id }) => id === clientId);
2880
- if (!client) {
2881
- console.warn("Could not find remote client that provided updated metadata");
2882
- return;
2883
- }
2884
- const previousState = getOriginalState();
2885
- const previousClient = selectRemoteParticipants(previousState).find(({ id }) => id === clientId);
2886
- if ((!stickyReaction && !(previousClient === null || previousClient === void 0 ? void 0 : previousClient.stickyReaction)) ||
2887
- (stickyReaction === null || stickyReaction === void 0 ? void 0 : stickyReaction.timestamp) === ((_a = previousClient === null || previousClient === void 0 ? void 0 : previousClient.stickyReaction) === null || _a === void 0 ? void 0 : _a.timestamp)) {
2888
- return;
2889
- }
2890
- dispatch(doSetNotification(createNotificationEvent({
2891
- type: stickyReaction ? "remoteHandRaised" : "remoteHandLowered",
2892
- message: `${client.displayName} ${stickyReaction ? "raised" : "lowered"} their hand`,
2893
- props: {
2894
- client,
2895
- stickyReaction,
2896
- },
2897
- })));
2898
- },
2899
- });
2900
- createReactor([selectSignalStatus], ({ dispatch, getState }, signalStatus) => {
2901
- const state = getState();
2902
- const roomConnectionStatus = selectRoomConnectionStatus(state);
2903
- if (["left", "kicked"].includes(roomConnectionStatus)) {
2904
- return;
2905
- }
2906
- if (signalStatus === "disconnected") {
3145
+ if (breakoutGroupAssigned && breakoutActive) {
3146
+ const groupName = (breakoutGroups === null || breakoutGroups === void 0 ? void 0 : breakoutGroups[breakoutGroupAssigned]) || "";
2907
3147
  dispatch(doSetNotification(createNotificationEvent({
2908
- type: "signalTrouble",
2909
- message: `Network connection lost. Trying to reconnect you...`,
2910
- props: {},
2911
- })));
2912
- }
2913
- else if (signalStatus === "connected") {
2914
- dispatch(doSetNotification(createNotificationEvent({
2915
- type: "signalOk",
2916
- message: `Network connection available`,
2917
- props: {},
3148
+ type: "breakoutGroupAssigned",
3149
+ message: groupName ? `You've been assigned to ${groupName}` : "You've been assigned to a group",
3150
+ props: { group: breakoutGroupAssigned, groupName },
2918
3151
  })));
2919
3152
  }
2920
3153
  });
2921
- startAppListening({
2922
- actionCreator: signalEvents.clientUnableToJoin,
2923
- effect: (action, { dispatch }) => {
2924
- var _a;
2925
- if (((_a = action.payload) === null || _a === void 0 ? void 0 : _a.error) === "room_full") {
2926
- dispatch(doSetNotification(createNotificationEvent({
2927
- type: "clientUnableToJoinFullRoom",
2928
- message: "Someone tried to join but the room is full and at capacity.",
2929
- props: {},
2930
- })));
2931
- }
2932
- },
2933
- });
2934
3154
 
2935
3155
  const organizationSliceInitialState = {
2936
3156
  data: null,
@@ -2991,6 +3211,7 @@ const roomConnectionSliceInitialState = {
2991
3211
  session: null,
2992
3212
  status: "ready",
2993
3213
  error: null,
3214
+ knockResponse: null,
2994
3215
  };
2995
3216
  const roomConnectionSlice = toolkit.createSlice({
2996
3217
  name: "roomConnection",
@@ -2999,6 +3220,9 @@ const roomConnectionSlice = toolkit.createSlice({
2999
3220
  connectionStatusChanged: (state, action) => {
3000
3221
  return Object.assign(Object.assign({}, state), { status: action.payload });
3001
3222
  },
3223
+ knockResponseReceived: (state, action) => {
3224
+ return Object.assign(Object.assign({}, state), { knockResponse: action.payload });
3225
+ },
3002
3226
  },
3003
3227
  extraReducers: (builder) => {
3004
3228
  builder.addCase(signalEvents.roomJoined, (state, action) => {
@@ -3040,7 +3264,7 @@ const roomConnectionSlice = toolkit.createSlice({
3040
3264
  });
3041
3265
  },
3042
3266
  });
3043
- const { connectionStatusChanged } = roomConnectionSlice.actions;
3267
+ const { connectionStatusChanged, knockResponseReceived } = roomConnectionSlice.actions;
3044
3268
  const doKnockRoom = createAppThunk(() => (dispatch, getState) => {
3045
3269
  const state = getState();
3046
3270
  const socket = selectSignalConnectionRaw(state).socket;
@@ -3133,6 +3357,7 @@ createReactor([selectShouldConnectRoom], ({ dispatch }, shouldConnectRoom) => {
3133
3357
  startAppListening({
3134
3358
  actionCreator: signalEvents.knockHandled,
3135
3359
  effect: ({ payload }, { dispatch, getState }) => {
3360
+ var _a, _b;
3136
3361
  const { clientId, resolution } = payload;
3137
3362
  const state = getState();
3138
3363
  const selfId = selectSelfId(state);
@@ -3143,7 +3368,12 @@ startAppListening({
3143
3368
  dispatch(setRoomKey(payload.metadata.roomKey));
3144
3369
  dispatch(doConnectRoom());
3145
3370
  }
3371
+ else if (resolution === "on_hold") {
3372
+ dispatch(knockResponseReceived((_a = payload.knockResponse) !== null && _a !== void 0 ? _a : null));
3373
+ dispatch(connectionStatusChanged("knock_on_hold"));
3374
+ }
3146
3375
  else if (resolution === "rejected") {
3376
+ dispatch(knockResponseReceived((_b = payload.knockResponse) !== null && _b !== void 0 ? _b : null));
3147
3377
  dispatch(connectionStatusChanged("knock_rejected"));
3148
3378
  }
3149
3379
  },
@@ -3422,17 +3652,33 @@ const doAcceptWaitingParticipant = createRoomConnectedThunk((payload) => (dispat
3422
3652
  socket === null || socket === void 0 ? void 0 : socket.emit("handle_knock", {
3423
3653
  action: "accept",
3424
3654
  clientId: participantId,
3425
- response: {},
3655
+ knockResponse: {},
3656
+ });
3657
+ });
3658
+ const doHoldWaitingParticipant = createRoomConnectedThunk((payload) => (dispatch, getState) => {
3659
+ const { participantId, response } = payload;
3660
+ const state = getState();
3661
+ const socket = selectSignalConnectionSocket(state);
3662
+ const message = response === null || response === void 0 ? void 0 : response.trim();
3663
+ const knockResponse = message
3664
+ ? { message, sender: { displayName: selectLocalParticipantDisplayName(state) } }
3665
+ : {};
3666
+ socket === null || socket === void 0 ? void 0 : socket.emit("handle_knock", {
3667
+ action: "hold",
3668
+ clientId: participantId,
3669
+ knockResponse,
3426
3670
  });
3427
3671
  });
3428
3672
  const doRejectWaitingParticipant = createRoomConnectedThunk((payload) => (dispatch, getState) => {
3429
- const { participantId } = payload;
3673
+ const { participantId, response } = payload;
3430
3674
  const state = getState();
3431
3675
  const socket = selectSignalConnectionSocket(state);
3676
+ const message = response === null || response === void 0 ? void 0 : response.trim();
3677
+ const knockResponse = message ? { message, sender: {} } : {};
3432
3678
  socket === null || socket === void 0 ? void 0 : socket.emit("handle_knock", {
3433
3679
  action: "reject",
3434
3680
  clientId: participantId,
3435
- response: {},
3681
+ knockResponse,
3436
3682
  });
3437
3683
  });
3438
3684
  const selectWaitingParticipantsRaw = (state) => state.waitingParticipants;
@@ -4534,6 +4780,9 @@ function createServices() {
4534
4780
  }
4535
4781
 
4536
4782
  exports.ACCEPTED_FILE_TYPES = ACCEPTED_FILE_TYPES;
4783
+ exports.BREAKOUT_GROUPS_MIN_MAX = BREAKOUT_GROUPS_MIN_MAX;
4784
+ exports.BREAKOUT_UNAVAILABLE_ERROR = BREAKOUT_UNAVAILABLE_ERROR;
4785
+ exports.DEFAULT_BREAKOUT_TIMER_DURATION = DEFAULT_BREAKOUT_TIMER_DURATION;
4537
4786
  exports.MAX_FILES_PER_UPLOAD = MAX_FILES_PER_UPLOAD;
4538
4787
  exports.MAX_FILE_SIZE = MAX_FILE_SIZE;
4539
4788
  exports.addAppListener = addAppListener;
@@ -4558,12 +4807,15 @@ exports.createAppAuthorizedThunk = createAppAuthorizedThunk;
4558
4807
  exports.createAppThunk = createAppThunk;
4559
4808
  exports.createAsyncRoomConnectedThunk = createAsyncRoomConnectedThunk;
4560
4809
  exports.createAuthorizedRoomConnectedThunk = createAuthorizedRoomConnectedThunk;
4810
+ exports.createBreakoutGroups = createBreakoutGroups;
4811
+ exports.createNotificationEvent = createNotificationEvent;
4561
4812
  exports.createReactor = createReactor;
4562
4813
  exports.createRemoteParticipant = createRemoteParticipant;
4563
4814
  exports.createRoomConnectedThunk = createRoomConnectedThunk;
4564
4815
  exports.createServices = createServices;
4565
4816
  exports.createStore = createStore;
4566
4817
  exports.createWebRtcEmitter = createWebRtcEmitter;
4818
+ exports.defaultBreakoutGroupName = defaultBreakoutGroupName;
4567
4819
  exports.deviceBusy = deviceBusy;
4568
4820
  exports.deviceCredentialsSlice = deviceCredentialsSlice;
4569
4821
  exports.deviceCredentialsSliceInitialState = deviceCredentialsSliceInitialState;
@@ -4572,6 +4824,8 @@ exports.deviceIdentifying = deviceIdentifying;
4572
4824
  exports.doAcceptWaitingParticipant = doAcceptWaitingParticipant;
4573
4825
  exports.doAppStart = doAppStart;
4574
4826
  exports.doAppStop = doAppStop;
4827
+ exports.doAssignAllBreakoutParticipants = doAssignAllBreakoutParticipants;
4828
+ exports.doAssignBreakoutParticipants = doAssignBreakoutParticipants;
4575
4829
  exports.doBreakoutJoin = doBreakoutJoin;
4576
4830
  exports.doCancelKnock = doCancelKnock;
4577
4831
  exports.doClearNotifications = doClearNotifications;
@@ -4582,10 +4836,12 @@ exports.doDownloadFile = doDownloadFile;
4582
4836
  exports.doEnableAudio = doEnableAudio;
4583
4837
  exports.doEnableVideo = doEnableVideo;
4584
4838
  exports.doEndMeeting = doEndMeeting;
4839
+ exports.doExtendBreakoutTimer = doExtendBreakoutTimer;
4585
4840
  exports.doGetDeviceCredentials = doGetDeviceCredentials;
4586
4841
  exports.doHandleAcceptStreams = doHandleAcceptStreams;
4587
4842
  exports.doHandleStreamingStarted = doHandleStreamingStarted;
4588
4843
  exports.doHandleStreamingStopped = doHandleStreamingStopped;
4844
+ exports.doHoldWaitingParticipant = doHoldWaitingParticipant;
4589
4845
  exports.doKickParticipant = doKickParticipant;
4590
4846
  exports.doKnockRoom = doKnockRoom;
4591
4847
  exports.doLocalStreamEffect = doLocalStreamEffect;
@@ -4607,16 +4863,20 @@ exports.doSetDevice = doSetDevice;
4607
4863
  exports.doSetDisplayName = doSetDisplayName;
4608
4864
  exports.doSetLocalStickyReaction = doSetLocalStickyReaction;
4609
4865
  exports.doSetNotification = doSetNotification;
4866
+ exports.doShuffleBreakoutParticipants = doShuffleBreakoutParticipants;
4610
4867
  exports.doSignalConnect = doSignalConnect;
4611
4868
  exports.doSignalDisconnect = doSignalDisconnect;
4612
4869
  exports.doSignalIdentifyDevice = doSignalIdentifyDevice;
4613
4870
  exports.doSpotlightParticipant = doSpotlightParticipant;
4871
+ exports.doStartBreakoutSession = doStartBreakoutSession;
4614
4872
  exports.doStartCloudRecording = doStartCloudRecording;
4615
4873
  exports.doStartConnectionMonitor = doStartConnectionMonitor;
4616
4874
  exports.doStartLiveCaptions = doStartLiveCaptions;
4617
4875
  exports.doStartLiveTranscription = doStartLiveTranscription;
4618
4876
  exports.doStartLocalMedia = doStartLocalMedia;
4619
4877
  exports.doStartScreenshare = doStartScreenshare;
4878
+ exports.doStopBreakoutSession = doStopBreakoutSession;
4879
+ exports.doStopBreakoutTimer = doStopBreakoutTimer;
4620
4880
  exports.doStopCloudRecording = doStopCloudRecording;
4621
4881
  exports.doStopConnectionMonitor = doStopConnectionMonitor;
4622
4882
  exports.doStopLiveCaptions = doStopLiveCaptions;
@@ -4626,6 +4886,8 @@ exports.doStopScreenshare = doStopScreenshare;
4626
4886
  exports.doSwitchLocalStream = doSwitchLocalStream;
4627
4887
  exports.doToggleCamera = doToggleCamera;
4628
4888
  exports.doTriggerLocalStreamRefresh = doTriggerLocalStreamRefresh;
4889
+ exports.doUnassignAllBreakoutParticipants = doUnassignAllBreakoutParticipants;
4890
+ exports.doUpdateBreakoutSession = doUpdateBreakoutSession;
4629
4891
  exports.doUpdateDeviceList = doUpdateDeviceList;
4630
4892
  exports.fileShareRequestSettled = fileShareRequestSettled;
4631
4893
  exports.fileShareSlice = fileShareSlice;
@@ -4698,12 +4960,25 @@ exports.selectAssistantKey = selectAssistantKey;
4698
4960
  exports.selectAuthorizationRoleName = selectAuthorizationRoleName;
4699
4961
  exports.selectBreakoutActive = selectBreakoutActive;
4700
4962
  exports.selectBreakoutAssignments = selectBreakoutAssignments;
4963
+ exports.selectBreakoutAutoMoveToGroup = selectBreakoutAutoMoveToGroup;
4964
+ exports.selectBreakoutAutoMoveToMain = selectBreakoutAutoMoveToMain;
4701
4965
  exports.selectBreakoutCurrentGroup = selectBreakoutCurrentGroup;
4702
4966
  exports.selectBreakoutCurrentId = selectBreakoutCurrentId;
4967
+ exports.selectBreakoutEndTime = selectBreakoutEndTime;
4968
+ exports.selectBreakoutEnforceAssignment = selectBreakoutEnforceAssignment;
4969
+ exports.selectBreakoutError = selectBreakoutError;
4703
4970
  exports.selectBreakoutGroupedParticipants = selectBreakoutGroupedParticipants;
4704
4971
  exports.selectBreakoutGroups = selectBreakoutGroups;
4705
4972
  exports.selectBreakoutInitiatedBy = selectBreakoutInitiatedBy;
4973
+ exports.selectBreakoutIsAvailable = selectBreakoutIsAvailable;
4974
+ exports.selectBreakoutMoveToGroupAt = selectBreakoutMoveToGroupAt;
4975
+ exports.selectBreakoutMoveToGroupGracePeriod = selectBreakoutMoveToGroupGracePeriod;
4976
+ exports.selectBreakoutMoveToMainAt = selectBreakoutMoveToMainAt;
4977
+ exports.selectBreakoutMoveToMainGracePeriod = selectBreakoutMoveToMainGracePeriod;
4706
4978
  exports.selectBreakoutRaw = selectBreakoutRaw;
4979
+ exports.selectBreakoutStartedAt = selectBreakoutStartedAt;
4980
+ exports.selectBreakoutTimerDuration = selectBreakoutTimerDuration;
4981
+ exports.selectBreakoutTimerSetting = selectBreakoutTimerSetting;
4707
4982
  exports.selectBusyDeviceIds = selectBusyDeviceIds;
4708
4983
  exports.selectCameraDeviceError = selectCameraDeviceError;
4709
4984
  exports.selectCameraDevices = selectCameraDevices;
@@ -4729,6 +5004,7 @@ exports.selectIsAuthorizedToAskToSpeak = selectIsAuthorizedToAskToSpeak;
4729
5004
  exports.selectIsAuthorizedToEndMeeting = selectIsAuthorizedToEndMeeting;
4730
5005
  exports.selectIsAuthorizedToKickClient = selectIsAuthorizedToKickClient;
4731
5006
  exports.selectIsAuthorizedToLockRoom = selectIsAuthorizedToLockRoom;
5007
+ exports.selectIsAuthorizedToManageBreakout = selectIsAuthorizedToManageBreakout;
4732
5008
  exports.selectIsAuthorizedToRequestAudioEnable = selectIsAuthorizedToRequestAudioEnable;
4733
5009
  exports.selectIsAuthorizedToRequestVideoEnable = selectIsAuthorizedToRequestVideoEnable;
4734
5010
  exports.selectIsAuthorizedToSpotlight = selectIsAuthorizedToSpotlight;
@@ -4793,12 +5069,14 @@ exports.selectRemoteClients = selectRemoteClients;
4793
5069
  exports.selectRemoteParticipants = selectRemoteParticipants;
4794
5070
  exports.selectRemoteParticipantsRaw = selectRemoteParticipantsRaw;
4795
5071
  exports.selectRoomConnectionError = selectRoomConnectionError;
5072
+ exports.selectRoomConnectionKnockResponse = selectRoomConnectionKnockResponse;
4796
5073
  exports.selectRoomConnectionRaw = selectRoomConnectionRaw;
4797
5074
  exports.selectRoomConnectionSession = selectRoomConnectionSession;
4798
5075
  exports.selectRoomConnectionSessionId = selectRoomConnectionSessionId;
4799
5076
  exports.selectRoomConnectionStatus = selectRoomConnectionStatus;
4800
5077
  exports.selectRoomIsLocked = selectRoomIsLocked;
4801
5078
  exports.selectRoomKey = selectRoomKey;
5079
+ exports.selectRoomMode = selectRoomMode;
4802
5080
  exports.selectRtcConnectionRaw = selectRtcConnectionRaw;
4803
5081
  exports.selectRtcDispatcherCreated = selectRtcDispatcherCreated;
4804
5082
  exports.selectRtcIsCreatingDispatcher = selectRtcIsCreatingDispatcher;
@@ -4831,6 +5109,7 @@ exports.selectStreamingRaw = selectStreamingRaw;
4831
5109
  exports.selectStreamsToAccept = selectStreamsToAccept;
4832
5110
  exports.selectWaitingParticipants = selectWaitingParticipants;
4833
5111
  exports.selectWaitingParticipantsRaw = selectWaitingParticipantsRaw;
5112
+ exports.setBreakoutError = setBreakoutError;
4834
5113
  exports.setBreakoutGroupAssigned = setBreakoutGroupAssigned;
4835
5114
  exports.setCurrentCameraDeviceId = setCurrentCameraDeviceId;
4836
5115
  exports.setCurrentMicrophoneDeviceId = setCurrentMicrophoneDeviceId;