@azure/communication-react 1.7.0-alpha-202307280013 → 1.7.0-alpha-202307300015

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/dist/communication-react.d.ts +7 -22
  2. package/dist/dist-cjs/communication-react/index.js +206 -241
  3. package/dist/dist-cjs/communication-react/index.js.map +1 -1
  4. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  5. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  6. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js +6 -2
  7. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js.map +1 -1
  8. package/dist/dist-esm/calling-component-bindings/src/callControlSelectors.js +19 -6
  9. package/dist/dist-esm/calling-component-bindings/src/callControlSelectors.js.map +1 -1
  10. package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js +19 -5
  11. package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js.map +1 -1
  12. package/dist/dist-esm/calling-component-bindings/src/utils/participantListSelectorUtils.d.ts +2 -3
  13. package/dist/dist-esm/calling-component-bindings/src/utils/participantListSelectorUtils.js +10 -8
  14. package/dist/dist-esm/calling-component-bindings/src/utils/participantListSelectorUtils.js.map +1 -1
  15. package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.d.ts +2 -1
  16. package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.js +5 -2
  17. package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.js.map +1 -1
  18. package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.js +11 -3
  19. package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.js.map +1 -1
  20. package/dist/dist-esm/communication-react/src/index.d.ts +0 -1
  21. package/dist/dist-esm/communication-react/src/index.js.map +1 -1
  22. package/dist/dist-esm/react-components/src/components/ParticipantList.js +1 -5
  23. package/dist/dist-esm/react-components/src/components/ParticipantList.js.map +1 -1
  24. package/dist/dist-esm/react-components/src/components/ParticipantsButton.js.map +1 -1
  25. package/dist/dist-esm/react-components/src/components/VideoGallery.js +7 -10
  26. package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
  27. package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
  28. package/dist/dist-esm/react-components/src/index.d.ts +0 -2
  29. package/dist/dist-esm/react-components/src/index.js +0 -2
  30. package/dist/dist-esm/react-components/src/index.js.map +1 -1
  31. package/dist/dist-esm/react-components/src/types/ParticipantListParticipant.d.ts +0 -3
  32. package/dist/dist-esm/react-components/src/types/ParticipantListParticipant.js.map +1 -1
  33. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js +5 -20
  34. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
  35. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +1 -9
  36. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +10 -18
  37. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  38. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts +4 -7
  39. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
  40. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.js.map +1 -1
  41. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +9 -11
  42. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
  43. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.d.ts +2 -1
  44. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js +9 -19
  45. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js.map +1 -1
  46. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js +8 -10
  47. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js.map +1 -1
  48. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js +32 -18
  49. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js.map +1 -1
  50. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Camera.js +10 -1
  51. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Camera.js.map +1 -1
  52. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Devices.js +13 -10
  53. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Devices.js.map +1 -1
  54. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Microphone.js +10 -1
  55. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Microphone.js.map +1 -1
  56. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/People.js.map +1 -1
  57. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/ScreenShare.js +10 -1
  58. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/ScreenShare.js.map +1 -1
  59. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.js.map +1 -1
  60. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js +7 -10
  61. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js.map +1 -1
  62. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +5 -5
  63. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  64. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js +2 -0
  65. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
  66. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.d.ts +2 -0
  67. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js +2 -0
  68. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js.map +1 -1
  69. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js +3 -13
  70. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js.map +1 -1
  71. package/dist/dist-esm/react-composites/src/composites/common/ModalLocalAndRemotePIP.js +11 -11
  72. package/dist/dist-esm/react-composites/src/composites/common/ModalLocalAndRemotePIP.js.map +1 -1
  73. package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.js +4 -5
  74. package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.js.map +1 -1
  75. package/package.json +8 -8
  76. package/dist/dist-esm/react-components/src/permissions/PermissionsProvider.d.ts +0 -61
  77. package/dist/dist-esm/react-components/src/permissions/PermissionsProvider.js +0 -74
  78. package/dist/dist-esm/react-components/src/permissions/PermissionsProvider.js.map +0 -1
  79. package/dist/dist-esm/react-components/src/permissions/index.d.ts +0 -2
  80. package/dist/dist-esm/react-components/src/permissions/index.js +0 -4
  81. package/dist/dist-esm/react-components/src/permissions/index.js.map +0 -1
@@ -178,7 +178,7 @@ const _isValidIdentifier = (identifier) => {
178
178
  // Copyright (c) Microsoft Corporation.
179
179
  // Licensed under the MIT license.
180
180
  // GENERATED FILE. DO NOT EDIT MANUALLY.
181
- var telemetryVersion = '1.7.0-alpha-202307280013';
181
+ var telemetryVersion = '1.7.0-alpha-202307300015';
182
182
 
183
183
  // Copyright (c) Microsoft Corporation.
184
184
  /**
@@ -332,6 +332,14 @@ const _logEvent = (logger, event) => {
332
332
  * @private
333
333
  */
334
334
  const getDeviceManager$1 = (state) => state.deviceManager;
335
+ /**
336
+ * @private
337
+ */
338
+ const getRole = (state, props) => {
339
+ var _a;
340
+ /* @conditional-compile-remove(rooms) */
341
+ return (_a = state.calls[props.callId]) === null || _a === void 0 ? void 0 : _a.role;
342
+ };
335
343
  /**
336
344
  * @private
337
345
  */
@@ -535,10 +543,10 @@ const _isRingingPSTNParticipant = (participant) => {
535
543
  *
536
544
  * @public
537
545
  */
538
- const microphoneButtonSelector = reselect__namespace.createSelector([getCallExists, getIsMuted, getDeviceManager$1], (callExists, isMuted, deviceManager) => {
546
+ const microphoneButtonSelector = reselect__namespace.createSelector([getCallExists, getIsMuted, getDeviceManager$1, /* @conditional-compile-remove(rooms) */ getRole], (callExists, isMuted, deviceManager, /* @conditional-compile-remove(rooms) */ role) => {
539
547
  const permission = deviceManager.deviceAccess ? deviceManager.deviceAccess.audio : true;
540
548
  return {
541
- disabled: !callExists || !permission,
549
+ disabled: !callExists || !permission || /* @conditional-compile-remove(rooms) */ role === 'Consumer',
542
550
  checked: callExists ? !isMuted : false,
543
551
  microphones: deviceManager.microphones,
544
552
  speakers: deviceManager.speakers,
@@ -551,12 +559,15 @@ const microphoneButtonSelector = reselect__namespace.createSelector([getCallExis
551
559
  *
552
560
  * @public
553
561
  */
554
- const cameraButtonSelector = reselect__namespace.createSelector([getLocalVideoStreams$1, getDeviceManager$1], (localVideoStreams, deviceManager) => {
562
+ const cameraButtonSelector = reselect__namespace.createSelector([getLocalVideoStreams$1, getDeviceManager$1, /* @conditional-compile-remove(rooms) */ getRole], (localVideoStreams, deviceManager, /* @conditional-compile-remove(rooms) */ role) => {
555
563
  const previewOn = _isPreviewOn(deviceManager);
556
564
  const localVideoFromCall = localVideoStreams === null || localVideoStreams === void 0 ? void 0 : localVideoStreams.find((stream) => stream.mediaStreamType === 'Video');
557
565
  const permission = deviceManager.deviceAccess ? deviceManager.deviceAccess.video : true;
558
566
  return {
559
- disabled: !deviceManager.selectedCamera || !permission || !deviceManager.cameras.length,
567
+ disabled: !deviceManager.selectedCamera ||
568
+ !permission ||
569
+ !deviceManager.cameras.length ||
570
+ /* @conditional-compile-remove(rooms) */ role === 'Consumer',
560
571
  checked: localVideoStreams !== undefined && localVideoStreams.length > 0 ? !!localVideoFromCall : previewOn,
561
572
  cameras: deviceManager.cameras,
562
573
  selectedCamera: deviceManager.selectedCamera
@@ -567,12 +578,20 @@ const cameraButtonSelector = reselect__namespace.createSelector([getLocalVideoSt
567
578
  *
568
579
  * @public
569
580
  */
570
- const screenShareButtonSelector = reselect__namespace.createSelector([getIsScreenSharingOn, /* @conditional-compile-remove(PSTN-calls) */ getCallState], (isScreenSharingOn, /* @conditional-compile-remove(PSTN-calls) */ callState) => {
581
+ const screenShareButtonSelector = reselect__namespace.createSelector([
582
+ getIsScreenSharingOn,
583
+ /* @conditional-compile-remove(PSTN-calls) */ getCallState,
584
+ /* @conditional-compile-remove(rooms) */ getRole
585
+ ], (isScreenSharingOn,
586
+ /* @conditional-compile-remove(PSTN-calls) */ callState,
587
+ /* @conditional-compile-remove(rooms) */ role) => {
571
588
  var _a;
572
589
  return {
573
590
  checked: isScreenSharingOn,
574
591
  /* @conditional-compile-remove(PSTN-calls) */
575
- disabled: callState === 'InLobby' ? true : (_a = callState === 'Connecting') !== null && _a !== void 0 ? _a : false
592
+ disabled: (callState === 'InLobby' ? true : (_a = callState === 'Connecting') !== null && _a !== void 0 ? _a : false) ||
593
+ /* @conditional-compile-remove(rooms) */ role === 'Consumer' ||
594
+ /* @conditional-compile-remove(rooms) */ role === 'Attendee'
576
595
  };
577
596
  });
578
597
  /**
@@ -10555,78 +10574,6 @@ const participantStateStringTrampoline$1 = (props, strings) => {
10555
10574
  : undefined;
10556
10575
  };
10557
10576
 
10558
- // Copyright (c) Microsoft Corporation.
10559
- /**
10560
- * @internal
10561
- */
10562
- const defaultPermissions = {
10563
- cameraButton: true,
10564
- microphoneButton: true,
10565
- screenShare: true,
10566
- removeParticipantButton: true
10567
- };
10568
- /**
10569
- * @internal
10570
- */
10571
- const presenterPermissions = {
10572
- role: 'Presenter',
10573
- cameraButton: true,
10574
- microphoneButton: true,
10575
- screenShare: true,
10576
- removeParticipantButton: true
10577
- };
10578
- /**
10579
- * @internal
10580
- */
10581
- const consumerPermissions = {
10582
- role: 'Consumer',
10583
- cameraButton: false,
10584
- microphoneButton: false,
10585
- screenShare: false,
10586
- removeParticipantButton: false
10587
- };
10588
- /**
10589
- * @internal
10590
- */
10591
- const attendeePermissions = {
10592
- role: 'Attendee',
10593
- cameraButton: true,
10594
- microphoneButton: true,
10595
- screenShare: false,
10596
- removeParticipantButton: false
10597
- };
10598
- /**
10599
- * @internal
10600
- */
10601
- const PermissionsContext = React.createContext(defaultPermissions);
10602
- /**
10603
- * @internal
10604
- */
10605
- const _PermissionsProvider = (props) => {
10606
- const { permissions, children } = props;
10607
- return React__default['default'].createElement(PermissionsContext.Provider, { value: permissions }, children);
10608
- };
10609
- /**
10610
- * @internal
10611
- * React hook to access permissions
10612
- */
10613
- const _usePermissions = () => React.useContext(PermissionsContext);
10614
- /**
10615
- * @internal
10616
- */
10617
- const _getPermissions = (role) => {
10618
- if (role === 'Consumer') {
10619
- return consumerPermissions;
10620
- }
10621
- else if (role === 'Attendee') {
10622
- return attendeePermissions;
10623
- }
10624
- else if (role === 'Presenter') {
10625
- return presenterPermissions;
10626
- }
10627
- return defaultPermissions;
10628
- };
10629
-
10630
10577
  // Copyright (c) Microsoft Corporation.
10631
10578
  /**
10632
10579
  * @private
@@ -10715,9 +10662,7 @@ const ParticipantList = (props) => {
10715
10662
  const createParticipantMenuItems = React.useCallback((participant) => {
10716
10663
  var _a, _b;
10717
10664
  let menuItems = [];
10718
- let participantIsRemovable = participant.isRemovable;
10719
- /* @conditional-compile-remove(rooms) */
10720
- participantIsRemovable = _usePermissions().removeParticipantButton && participantIsRemovable;
10665
+ const participantIsRemovable = participant.isRemovable;
10721
10666
  if (participant.userId !== myUserId && onRemoveParticipant && participantIsRemovable) {
10722
10667
  menuItems.push({
10723
10668
  key: 'remove',
@@ -13874,7 +13819,7 @@ const VideoGallery = (props) => {
13874
13819
  remoteVideoTileMenuOptions = DEFAULT_REMOTE_VIDEO_TILE_MENU_OPTIONS,
13875
13820
  /* @conditional-compile-remove(vertical-gallery) */
13876
13821
  overflowGalleryPosition = 'HorizontalBottom',
13877
- /* @conditional-compile-remove(click-to-call) */
13822
+ /* @conditional-compile-remove(rooms) */
13878
13823
  localVideoTileSize = 'followDeviceOrientation' } = props;
13879
13824
  const ids = useIdentifiers();
13880
13825
  const theme = useTheme();
@@ -13907,15 +13852,13 @@ const VideoGallery = (props) => {
13907
13852
  /* @conditional-compile-remove(pinned-participants) */
13908
13853
  // Use pinnedParticipants from props but if it is not defined use the maintained state of pinned participants
13909
13854
  const pinnedParticipants = (_a = props.pinnedParticipants) !== null && _a !== void 0 ? _a : pinnedParticipantsState;
13910
- /* @conditional-compile-remove(rooms) */
13911
- const permissions = _usePermissions();
13912
13855
  /**
13913
13856
  * Utility function for memoized rendering of LocalParticipant.
13914
13857
  */
13915
13858
  const localVideoTile = React.useMemo(() => {
13916
13859
  var _a, _b;
13917
- /* @conditional-compile-remove(rooms) */
13918
- if (!permissions.cameraButton || /* @conditional-compile-remove(click-to-call) */ localVideoTileSize === 'hidden') {
13860
+ /* @conditional-compile-remove(click-to-call) */
13861
+ if (localVideoTileSize === 'hidden') {
13919
13862
  return undefined;
13920
13863
  }
13921
13864
  if (onRenderLocalVideoTile) {
@@ -13927,7 +13870,8 @@ const VideoGallery = (props) => {
13927
13870
  const initialsName = !localParticipant.displayName ? '' : localParticipant.displayName;
13928
13871
  return (React__default['default'].createElement(react.Stack, { styles: localVideoTileContainerStyles, key: "local-video-tile-key", tabIndex: 0, "aria-label": strings.localVideoMovementLabel, role: 'dialog' },
13929
13872
  React__default['default'].createElement(_LocalVideoTile, { userId: localParticipant.userId, onCreateLocalStreamView: onCreateLocalStreamView, onDisposeLocalStreamView: onDisposeLocalStreamView, isAvailable: (_a = localParticipant === null || localParticipant === void 0 ? void 0 : localParticipant.videoStream) === null || _a === void 0 ? void 0 : _a.isAvailable, isMuted: localParticipant.isMuted, renderElement: (_b = localParticipant === null || localParticipant === void 0 ? void 0 : localParticipant.videoStream) === null || _b === void 0 ? void 0 : _b.renderElement, displayName: isNarrow ? '' : strings.localVideoLabel, initialsName: initialsName, localVideoViewOptions: localVideoViewOptions, onRenderAvatar: onRenderAvatar, showLabel: !((shouldFloatLocalVideo && isNarrow) ||
13930
- /*@conditional-compile-remove(click-to-call) */ localVideoTileSize === '9:16'), showMuteIndicator: showMuteIndicator, showCameraSwitcherInLocalPreview: showCameraSwitcherInLocalPreview, localVideoCameraCycleButtonProps: localVideoCameraCycleButtonProps, localVideoCameraSwitcherLabel: strings.localVideoCameraSwitcherLabel, localVideoSelectedDescription: strings.localVideoSelectedDescription, styles: localVideoTileStyles })));
13873
+ /*@conditional-compile-remove(click-to-call) */ /* @conditional-compile-remove(rooms) */ localVideoTileSize ===
13874
+ '9:16'), showMuteIndicator: showMuteIndicator, showCameraSwitcherInLocalPreview: showCameraSwitcherInLocalPreview, localVideoCameraCycleButtonProps: localVideoCameraCycleButtonProps, localVideoCameraSwitcherLabel: strings.localVideoCameraSwitcherLabel, localVideoSelectedDescription: strings.localVideoSelectedDescription, styles: localVideoTileStyles })));
13931
13875
  }, [
13932
13876
  isNarrow,
13933
13877
  localParticipant,
@@ -13946,8 +13890,8 @@ const VideoGallery = (props) => {
13946
13890
  strings.localVideoSelectedDescription,
13947
13891
  styles === null || styles === void 0 ? void 0 : styles.localVideo,
13948
13892
  theme.effects.roundedCorner4,
13949
- /* @conditional-compile-remove(rooms) */ permissions.cameraButton,
13950
- /* @conditional-compile-remove(click-to-call) */ localVideoTileSize
13893
+ /*@conditional-compile-remove(click-to-call) */
13894
+ localVideoTileSize
13951
13895
  ]);
13952
13896
  /* @conditional-compile-remove(pinned-participants) */
13953
13897
  const onPinParticipant = React.useCallback((userId) => {
@@ -16615,7 +16559,8 @@ const convertRemoteVideoStreamToVideoGalleryStream = (stream) => {
16615
16559
  };
16616
16560
  };
16617
16561
  /** @private */
16618
- const memoizeLocalParticipant = memoizeOne__default['default']((identifier, displayName, isMuted, isScreenSharingOn, localVideoStream) => {
16562
+ const memoizeLocalParticipant = memoizeOne__default['default']((identifier, displayName, isMuted, isScreenSharingOn, localVideoStream,
16563
+ /* @conditional-compile-remove(rooms) */ role) => {
16619
16564
  var _a, _b;
16620
16565
  return ({
16621
16566
  userId: identifier,
@@ -16626,7 +16571,9 @@ const memoizeLocalParticipant = memoizeOne__default['default']((identifier, disp
16626
16571
  isAvailable: !!localVideoStream,
16627
16572
  isMirrored: (_a = localVideoStream === null || localVideoStream === void 0 ? void 0 : localVideoStream.view) === null || _a === void 0 ? void 0 : _a.isMirrored,
16628
16573
  renderElement: (_b = localVideoStream === null || localVideoStream === void 0 ? void 0 : localVideoStream.view) === null || _b === void 0 ? void 0 : _b.target
16629
- }
16574
+ },
16575
+ /* @conditional-compile-remove(rooms) */
16576
+ role
16630
16577
  });
16631
16578
  });
16632
16579
 
@@ -16645,10 +16592,14 @@ const videoGallerySelector = reselect.createSelector([
16645
16592
  getIdentifier,
16646
16593
  getDominantSpeakers,
16647
16594
  /* @conditional-compile-remove(optimal-video-count) */
16648
- getOptimalVideoCount
16595
+ getOptimalVideoCount,
16596
+ /* @conditional-compile-remove(rooms) */
16597
+ getRole
16649
16598
  ], (screenShareRemoteParticipantId, remoteParticipants, localVideoStreams, isMuted, isScreenSharingOn, displayName, identifier, dominantSpeakers,
16650
16599
  /* @conditional-compile-remove(optimal-video-count) */
16651
- optimalVideoCount) => {
16600
+ optimalVideoCount,
16601
+ /* @conditional-compile-remove(rooms) */
16602
+ role) => {
16652
16603
  const screenShareRemoteParticipant = screenShareRemoteParticipantId && remoteParticipants
16653
16604
  ? remoteParticipants[screenShareRemoteParticipantId]
16654
16605
  : undefined;
@@ -16660,7 +16611,9 @@ optimalVideoCount) => {
16660
16611
  screenShareParticipant: screenShareRemoteParticipant
16661
16612
  ? convertRemoteParticipantToVideoGalleryRemoteParticipant(toFlatCommunicationIdentifier(screenShareRemoteParticipant.identifier), screenShareRemoteParticipant.isMuted, checkIsSpeaking(screenShareRemoteParticipant), screenShareRemoteParticipant.videoStreams, screenShareRemoteParticipant.state, screenShareRemoteParticipant.displayName)
16662
16613
  : undefined,
16663
- localParticipant: memoizeLocalParticipant(identifier, displayName, isMuted, isScreenSharingOn, localVideoStream),
16614
+ localParticipant: memoizeLocalParticipant(identifier, displayName, isMuted, isScreenSharingOn, localVideoStream,
16615
+ /* @conditional-compile-remove(rooms) */
16616
+ role),
16664
16617
  remoteParticipants: _videoGalleryRemoteParticipantsMemo(updateUserDisplayNamesTrampoline$2(remoteParticipants ? Object.values(remoteParticipants) : noRemoteParticipants)),
16665
16618
  dominantSpeakers: dominantSpeakerIds,
16666
16619
  /* @conditional-compile-remove(optimal-video-count) */
@@ -16673,7 +16626,7 @@ const updateUserDisplayNamesTrampoline$2 = (remoteParticipants) => {
16673
16626
  };
16674
16627
 
16675
16628
  // Copyright (c) Microsoft Corporation.
16676
- const convertRemoteParticipantToParticipantListParticipant = (userId, displayName, state, isMuted, isScreenSharing, isSpeaking) => {
16629
+ const convertRemoteParticipantToParticipantListParticipant = (userId, displayName, state, isMuted, isScreenSharing, isSpeaking, localUserCanRemoveOthers) => {
16677
16630
  const identifier = fromFlatCommunicationIdentifier(userId);
16678
16631
  return {
16679
16632
  userId,
@@ -16684,23 +16637,25 @@ const convertRemoteParticipantToParticipantListParticipant = (userId, displayNam
16684
16637
  isSpeaking,
16685
16638
  // ACS users can not remove Teams users.
16686
16639
  // Removing unknown types of users is undefined.
16687
- isRemovable: communicationCommon.getIdentifierKind(identifier).kind === 'communicationUser' || communicationCommon.getIdentifierKind(identifier).kind === 'phoneNumber'
16640
+ isRemovable: (communicationCommon.getIdentifierKind(identifier).kind === 'communicationUser' ||
16641
+ communicationCommon.getIdentifierKind(identifier).kind === 'phoneNumber') &&
16642
+ localUserCanRemoveOthers
16688
16643
  };
16689
16644
  };
16690
16645
  /* @conditional-compile-remove(rooms) */
16691
16646
  /**
16692
16647
  * @private
16693
16648
  */
16694
- const memoizedConvertAllremoteParticipantsBeta = memoizeFnAll((userId, displayName, state, isMuted, isScreenSharing, isSpeaking, role) => {
16695
- return convertRemoteParticipantToParticipantListParticipantBeta(userId, displayName, state, isMuted, isScreenSharing, isSpeaking, role);
16649
+ const memoizedConvertAllremoteParticipantsBeta = memoizeFnAll((userId, displayName, state, isMuted, isScreenSharing, isSpeaking, localUserCanRemoveOthers) => {
16650
+ return convertRemoteParticipantToParticipantListParticipantBeta(userId, displayName, state, isMuted, isScreenSharing, isSpeaking, localUserCanRemoveOthers);
16696
16651
  });
16697
16652
  /* @conditional-compile-remove(rooms) */
16698
- const convertRemoteParticipantToParticipantListParticipantBeta = (userId, displayName, state, isMuted, isScreenSharing, isSpeaking, role) => {
16699
- return Object.assign(Object.assign({}, convertRemoteParticipantToParticipantListParticipant(userId, displayName, state, isMuted, isScreenSharing, isSpeaking)), { role });
16653
+ const convertRemoteParticipantToParticipantListParticipantBeta = (userId, displayName, state, isMuted, isScreenSharing, isSpeaking, localUserCanRemoveOthers) => {
16654
+ return Object.assign({}, convertRemoteParticipantToParticipantListParticipant(userId, displayName, state, isMuted, isScreenSharing, isSpeaking, localUserCanRemoveOthers));
16700
16655
  };
16701
16656
 
16702
16657
  // Copyright (c) Microsoft Corporation.
16703
- const convertRemoteParticipantsToParticipantListParticipants = (remoteParticipants) => {
16658
+ const convertRemoteParticipantsToParticipantListParticipants = (remoteParticipants, localUserCanRemoveOthers) => {
16704
16659
  /* eslint-disable @typescript-eslint/explicit-function-return-type */
16705
16660
  const conversionCallback = (memoizeFn) => {
16706
16661
  return (remoteParticipants
@@ -16724,8 +16679,7 @@ const convertRemoteParticipantsToParticipantListParticipants = (remoteParticipan
16724
16679
  * and mapping their state to be 'Ringing'
16725
16680
  */
16726
16681
  const state = _isRingingPSTNParticipant(participant);
16727
- return memoizeFn(toFlatCommunicationIdentifier(participant.identifier), participant.displayName, state, participant.isMuted, isScreenSharing, participant.isSpeaking,
16728
- /* @conditional-compile-remove(rooms) */ participant.role);
16682
+ return memoizeFn(toFlatCommunicationIdentifier(participant.identifier), participant.displayName, state, participant.isMuted, isScreenSharing, participant.isSpeaking, localUserCanRemoveOthers);
16729
16683
  })
16730
16684
  .sort((a, b) => {
16731
16685
  var _a, _b;
@@ -16750,9 +16704,18 @@ const convertRemoteParticipantsToParticipantListParticipants = (remoteParticipan
16750
16704
  *
16751
16705
  * @public
16752
16706
  */
16753
- const participantListSelector = reselect.createSelector([getIdentifier, getDisplayName$2, getRemoteParticipants$1, getIsScreenSharingOn, getIsMuted, getParticipantCount], (userId, displayName, remoteParticipants, isScreenSharingOn, isMuted, partitipantCount) => {
16707
+ const participantListSelector = reselect.createSelector([
16708
+ getIdentifier,
16709
+ getDisplayName$2,
16710
+ getRemoteParticipants$1,
16711
+ getIsScreenSharingOn,
16712
+ getIsMuted,
16713
+ getRole,
16714
+ getParticipantCount
16715
+ ], (userId, displayName, remoteParticipants, isScreenSharingOn, isMuted, role, partitipantCount) => {
16716
+ const localUserCanRemoveOthers = localUserCanRemoveOthersTrampoline(role);
16754
16717
  const participants = remoteParticipants
16755
- ? convertRemoteParticipantsToParticipantListParticipants(updateUserDisplayNamesTrampoline$1(Object.values(remoteParticipants)))
16718
+ ? convertRemoteParticipantsToParticipantListParticipants(updateUserDisplayNamesTrampoline$1(Object.values(remoteParticipants)), localUserCanRemoveOthers)
16756
16719
  : [];
16757
16720
  participants.push({
16758
16721
  userId: userId,
@@ -16776,6 +16739,10 @@ const updateUserDisplayNamesTrampoline$1 = (remoteParticipants) => {
16776
16739
  /* @conditional-compile-remove(PSTN-calls) */
16777
16740
  return _updateUserDisplayNames(remoteParticipants);
16778
16741
  };
16742
+ const localUserCanRemoveOthersTrampoline = (role) => {
16743
+ /* @conditional-compile-remove(rooms) */
16744
+ return role === 'Presenter' || role === 'Unknown' || role === undefined;
16745
+ };
16779
16746
 
16780
16747
  // Copyright (c) Microsoft Corporation.
16781
16748
  /**
@@ -21773,9 +21740,16 @@ const usePropsFor$1 = (component) => {
21773
21740
  * @private
21774
21741
  */
21775
21742
  const Camera = (props) => {
21743
+ var _a;
21776
21744
  const cameraButtonProps = usePropsFor$1(CameraButton);
21777
21745
  const styles = React.useMemo(() => { var _a; return concatButtonBaseStyles((_a = props.styles) !== null && _a !== void 0 ? _a : {}); }, [props.styles]);
21778
- return (React__default['default'].createElement(CameraButton, Object.assign({ "data-ui-id": "call-composite-camera-button" }, cameraButtonProps, { showLabel: props.displayType !== 'compact', styles: styles, enableDeviceSelectionMenu: props.splitButtonsForDeviceSelection, disabled: cameraButtonProps.disabled || props.disabled,
21746
+ /* @conditional-compile-remove(rooms) */
21747
+ const adapter = useAdapter();
21748
+ /* @conditional-compile-remove(rooms) */
21749
+ const isRoomsCall = adapter.getState().isRoomsCall;
21750
+ return (React__default['default'].createElement(CameraButton, Object.assign({ "data-ui-id": "call-composite-camera-button" }, cameraButtonProps, { showLabel: props.displayType !== 'compact', styles: styles, enableDeviceSelectionMenu: props.splitButtonsForDeviceSelection, disabled: cameraButtonProps.disabled ||
21751
+ props.disabled ||
21752
+ /* @conditional-compile-remove(rooms) */ (isRoomsCall && ((_a = adapter.getState().call) === null || _a === void 0 ? void 0 : _a.role) === 'Unknown'),
21779
21753
  /* @conditional-compile-remove(video-background-effects) */
21780
21754
  onShowVideoEffectsPicker: props.onShowVideoEffectsPicker })));
21781
21755
  };
@@ -21813,17 +21787,20 @@ const onFetchCustomButtonPropsTrampoline$1 = (options) => {
21813
21787
  // Copyright (c) Microsoft Corporation.
21814
21788
  /** @private */
21815
21789
  const Devices = (props) => {
21790
+ var _a, _b;
21816
21791
  const devicesButtonProps = usePropsFor$1(DevicesButton);
21817
21792
  /* @conditional-compile-remove(rooms) */
21818
- const permissions = _usePermissions();
21793
+ const adapter = useAdapter();
21794
+ /* @conditional-compile-remove(rooms) */
21795
+ const role = (_b = (_a = adapter.getState().call) === null || _a === void 0 ? void 0 : _a.role) !== null && _b !== void 0 ? _b : 'Unknown';
21819
21796
  const augmentedDeviceButtonProps = React.useMemo(() => (Object.assign(Object.assign({}, devicesButtonProps), {
21820
21797
  /* @conditional-compile-remove(rooms) */
21821
- microphones: !permissions.microphoneButton ? [] : devicesButtonProps.microphones,
21798
+ microphones: role === 'Consumer' ? [] : devicesButtonProps.microphones,
21822
21799
  /* @conditional-compile-remove(rooms) */
21823
- cameras: !permissions.cameraButton ? [] : devicesButtonProps.cameras })), [
21800
+ cameras: role === 'Consumer' ? [] : devicesButtonProps.cameras })), [
21824
21801
  devicesButtonProps,
21825
21802
  /* @conditional-compile-remove(rooms) */
21826
- permissions
21803
+ role
21827
21804
  ]);
21828
21805
  const styles = React.useMemo(() => {
21829
21806
  var _a;
@@ -21832,7 +21809,7 @@ const Devices = (props) => {
21832
21809
  /* @conditional-compile-remove(rooms) */
21833
21810
  const locale = useLocale();
21834
21811
  /* @conditional-compile-remove(rooms) */
21835
- const onlyManageSpeakers = !permissions.microphoneButton && !permissions.cameraButton;
21812
+ const onlyManageSpeakers = role === 'Consumer';
21836
21813
  /* @conditional-compile-remove(rooms) */
21837
21814
  const onRenderDevicesIcon = () => {
21838
21815
  return React__default['default'].createElement(_HighContrastAwareIcon, { disabled: props.disabled, iconName: "OptionsSpeaker" });
@@ -21843,13 +21820,13 @@ const Devices = (props) => {
21843
21820
  /* By setting `persistMenu?` to true, we prevent options menu from getting hidden every time a participant joins or leaves. */
21844
21821
  persistMenu: true }, augmentedDeviceButtonProps, { showLabel: props.displayType !== 'compact', styles: styles, "data-ui-id": "calling-composite-devices-button", disabled: props.disabled,
21845
21822
  /* @conditional-compile-remove(rooms) */
21846
- strings: getLabelFromPermissions(permissions, locale),
21823
+ strings: getLabelFromRole(role, locale),
21847
21824
  /* @conditional-compile-remove(rooms) */
21848
21825
  onRenderIcon: onlyManageSpeakers ? onRenderDevicesIcon : undefined })));
21849
21826
  };
21850
21827
  /* @conditional-compile-remove(rooms) */
21851
- const getLabelFromPermissions = (permissions, locale) => {
21852
- if (!permissions.cameraButton && !permissions.microphoneButton) {
21828
+ const getLabelFromRole = (role, locale) => {
21829
+ if (role === 'Consumer') {
21853
21830
  return { label: locale.component.strings.microphoneButton.speakerMenuTitle };
21854
21831
  }
21855
21832
  return undefined;
@@ -21901,11 +21878,6 @@ const getIsScreenShareOn = (state) => { var _a, _b; return (_b = (_a = state.cal
21901
21878
  * @private
21902
21879
  */
21903
21880
  const getIsPreviewCameraOn = (state) => _isPreviewOn(state.devices);
21904
- /* @conditional-compile-remove(rooms) */
21905
- /**
21906
- * @private
21907
- */
21908
- const getRole = (state) => { var _a; return (_a = state.call) === null || _a === void 0 ? void 0 : _a.role; };
21909
21881
  /**
21910
21882
  * @private
21911
21883
  */
@@ -21959,10 +21931,15 @@ const getIsTeamsCall = (state) => state.isTeamsCall;
21959
21931
  * @private
21960
21932
  */
21961
21933
  const Microphone = (props) => {
21934
+ var _a;
21962
21935
  const microphoneButtonProps = usePropsFor$1(MicrophoneButton);
21963
21936
  const callStatus = useSelector$1(getCallStatus);
21964
21937
  const isLocalMicrophoneEnabled = useSelector$1(getLocalMicrophoneEnabled);
21965
21938
  const strings = useLocale().strings.call;
21939
+ /* @conditional-compile-remove(rooms) */
21940
+ const adapter = useAdapter();
21941
+ /* @conditional-compile-remove(rooms) */
21942
+ const isRoomsCall = adapter.getState().isRoomsCall;
21966
21943
  /**
21967
21944
  * When call is in Lobby, microphone button should be disabled.
21968
21945
  * This is due to to headless limitation where a call can not be muted/unmuted in lobby.
@@ -21983,7 +21960,9 @@ const Microphone = (props) => {
21983
21960
  : {};
21984
21961
  const styles = React.useMemo(() => { var _a; return concatButtonBaseStyles((_a = props.styles) !== null && _a !== void 0 ? _a : {}); }, [props.styles]);
21985
21962
  // tab focus on MicrophoneButton on page load
21986
- return (React__default['default'].createElement(MicrophoneButton, Object.assign({ "data-ui-id": "call-composite-microphone-button" }, microphoneButtonProps, { showLabel: props.displayType !== 'compact', styles: styles }, microphoneButtonStrings, { enableDeviceSelectionMenu: props.splitButtonsForDeviceSelection, disabled: microphoneButtonProps.disabled || props.disabled })));
21963
+ return (React__default['default'].createElement(MicrophoneButton, Object.assign({ "data-ui-id": "call-composite-microphone-button" }, microphoneButtonProps, { showLabel: props.displayType !== 'compact', styles: styles }, microphoneButtonStrings, { enableDeviceSelectionMenu: props.splitButtonsForDeviceSelection, disabled: microphoneButtonProps.disabled ||
21964
+ props.disabled ||
21965
+ /* @conditional-compile-remove(rooms) */ (isRoomsCall && ((_a = adapter.getState().call) === null || _a === void 0 ? void 0 : _a.role) === 'Unknown') })));
21987
21966
  };
21988
21967
 
21989
21968
  // Copyright (c) Microsoft Corporation.
@@ -22006,13 +21985,20 @@ const isDisabled$1 = (option) => {
22006
21985
  // Copyright (c) Microsoft Corporation.
22007
21986
  /** @private */
22008
21987
  const ScreenShare = (props) => {
21988
+ var _a;
22009
21989
  const screenShareButtonProps = usePropsFor$1(ScreenShareButton);
22010
21990
  const styles = React.useMemo(() => { var _a; return concatButtonBaseStyles((_a = props.styles) !== null && _a !== void 0 ? _a : {}); }, [props.styles]);
21991
+ /* @conditional-compile-remove(rooms) */
21992
+ const adapter = useAdapter();
21993
+ /* @conditional-compile-remove(rooms) */
21994
+ const isRoomsCall = adapter.getState().isRoomsCall;
22011
21995
  const screenShareButtonDisabled = () => {
22012
21996
  /* @conditional-compile-remove(PSTN-calls) */
22013
21997
  return (screenShareButtonProps === null || screenShareButtonProps === void 0 ? void 0 : screenShareButtonProps.disabled) ? screenShareButtonProps.disabled : isDisabled(props.option);
22014
21998
  };
22015
- return (React__default['default'].createElement(ScreenShareButton, Object.assign({ "data-ui-id": "call-composite-screenshare-button" }, screenShareButtonProps, { showLabel: props.displayType !== 'compact', disabled: screenShareButtonDisabled() || props.disabled, styles: styles })));
21999
+ return (React__default['default'].createElement(ScreenShareButton, Object.assign({ "data-ui-id": "call-composite-screenshare-button" }, screenShareButtonProps, { showLabel: props.displayType !== 'compact', disabled: screenShareButtonDisabled() ||
22000
+ props.disabled ||
22001
+ /* @conditional-compile-remove(rooms) */ (isRoomsCall && ((_a = adapter.getState().call) === null || _a === void 0 ? void 0 : _a.role) === 'Unknown'), styles: styles })));
22016
22002
  };
22017
22003
  const isDisabled = (option) => {
22018
22004
  if (option === undefined || option === true || option === false) {
@@ -22257,6 +22243,8 @@ const controlBarStyles = react.memoizeFunction((background) => ({ root: { backgr
22257
22243
  */
22258
22244
  const CallControls = (props) => {
22259
22245
  const options = React.useMemo(() => (typeof props.options === 'boolean' ? {} : props.options), [props.options]);
22246
+ /* @conditional-compile-remove(new-call-control-bar) */
22247
+ const adapter = useAdapter();
22260
22248
  /* @conditional-compile-remove(one-to-n-calling) @conditional-compile-remove(PSTN-calls) */
22261
22249
  const localeStrings = useLocale();
22262
22250
  /* @conditional-compile-remove(one-to-n-calling) @conditional-compile-remove(PSTN-calls) */
@@ -22301,7 +22289,7 @@ const CallControls = (props) => {
22301
22289
  });
22302
22290
  }
22303
22291
  /* @conditional-compile-remove(one-to-n-calling) */ /* @conditional-compile-remove(PSTN-calls) */
22304
- if (!isRoomsCallTrampoline()) {
22292
+ if (!isRoomsCallTrampoline(adapter)) {
22305
22293
  items.push({
22306
22294
  key: 'holdButtonKey',
22307
22295
  text: localeStrings.component.strings.holdButton.tooltipOffContent,
@@ -22345,17 +22333,9 @@ const CallControls = (props) => {
22345
22333
  const onDismissDialpad = () => {
22346
22334
  setShowDialpad(false);
22347
22335
  };
22348
- /* @conditional-compile-remove(rooms) */
22349
- const rolePermissions = _usePermissions();
22350
- let screenShareButtonIsEnabled = isEnabled$2(options === null || options === void 0 ? void 0 : options.screenShareButton);
22351
- /* @conditional-compile-remove(rooms) */
22352
- screenShareButtonIsEnabled = rolePermissions.screenShare && screenShareButtonIsEnabled;
22353
- let microphoneButtonIsEnabled = isEnabled$2(options === null || options === void 0 ? void 0 : options.microphoneButton);
22354
- /* @conditional-compile-remove(rooms) */
22355
- microphoneButtonIsEnabled = rolePermissions.microphoneButton && microphoneButtonIsEnabled;
22356
- let cameraButtonIsEnabled = isEnabled$2(options === null || options === void 0 ? void 0 : options.cameraButton);
22357
- /* @conditional-compile-remove(rooms) */
22358
- cameraButtonIsEnabled = rolePermissions.cameraButton && cameraButtonIsEnabled;
22336
+ const screenShareButtonIsEnabled = isEnabled$2(options === null || options === void 0 ? void 0 : options.screenShareButton);
22337
+ const microphoneButtonIsEnabled = isEnabled$2(options === null || options === void 0 ? void 0 : options.microphoneButton);
22338
+ const cameraButtonIsEnabled = isEnabled$2(options === null || options === void 0 ? void 0 : options.cameraButton);
22359
22339
  return (React__default['default'].createElement(react.Stack, { horizontalAlign: "center", className: callControlsContainerStyles },
22360
22340
  /* @conditional-compile-remove(PSTN-calls) */
22361
22341
  React__default['default'].createElement(SendDtmfDialpad, { isMobile: !!props.isMobile, strings: dialpadStrings, showDialpad: showDialpad, onDismissDialpad: onDismissDialpad }),
@@ -22377,11 +22357,9 @@ const CallControls = (props) => {
22377
22357
  };
22378
22358
  const isEnabled$2 = (option) => option !== false;
22379
22359
  /** @private */
22380
- const isRoomsCallTrampoline = () => {
22381
- /* @conditional-compile-remove(rooms) */
22382
- const rolePermissions = _usePermissions();
22360
+ const isRoomsCallTrampoline = (adapter) => {
22383
22361
  /* @conditional-compile-remove(rooms) */
22384
- return !!rolePermissions.role;
22362
+ return adapter.getState().isRoomsCall;
22385
22363
  };
22386
22364
 
22387
22365
  // Copyright (c) Microsoft Corporation.
@@ -22799,18 +22777,10 @@ const CommonCallControlBar = (props) => {
22799
22777
  if (options === false) {
22800
22778
  return React__default['default'].createElement(React__default['default'].Fragment, null);
22801
22779
  }
22802
- /* @conditional-compile-remove(rooms) */
22803
- const rolePermissions = _usePermissions();
22804
22780
  const sideButtonsPresent = isEnabled$1(options.peopleButton) || isEnabled$1(options.chatButton) || customButtons['secondary'] !== undefined;
22805
- let screenShareButtonIsEnabled = isEnabled$1(options === null || options === void 0 ? void 0 : options.screenShareButton);
22806
- /* @conditional-compile-remove(rooms) */
22807
- screenShareButtonIsEnabled = rolePermissions.screenShare && screenShareButtonIsEnabled;
22808
- let microphoneButtonIsEnabled = isEnabled$1(options === null || options === void 0 ? void 0 : options.microphoneButton);
22809
- /* @conditional-compile-remove(rooms) */
22810
- microphoneButtonIsEnabled = rolePermissions.microphoneButton && microphoneButtonIsEnabled;
22811
- let cameraButtonIsEnabled = isEnabled$1(options === null || options === void 0 ? void 0 : options.cameraButton);
22812
- /* @conditional-compile-remove(rooms) */
22813
- cameraButtonIsEnabled = rolePermissions.cameraButton && cameraButtonIsEnabled;
22781
+ const screenShareButtonIsEnabled = isEnabled$1(options === null || options === void 0 ? void 0 : options.screenShareButton);
22782
+ const microphoneButtonIsEnabled = isEnabled$1(options === null || options === void 0 ? void 0 : options.microphoneButton);
22783
+ const cameraButtonIsEnabled = isEnabled$1(options === null || options === void 0 ? void 0 : options.cameraButton);
22814
22784
  return (React__default['default'].createElement("div", { ref: controlBarSizeRef },
22815
22785
  React__default['default'].createElement(CallAdapterProvider, { adapter: props.callAdapter },
22816
22786
  /* @conditional-compile-remove(close-captions) */ showCaptionsSettingsModal && (React__default['default'].createElement(CaptionsSettingsModal, { showCaptionsSettingsModal: showCaptionsSettingsModal, onDismissCaptionsSettings: onDismissCaptionsSettings }))),
@@ -23953,7 +23923,7 @@ const PeoplePaneContent = (props) => {
23953
23923
  /* @conditional-compile-remove(PSTN-calls) */
23954
23924
  const alternateCallerId = adapter.getState().alternateCallerId;
23955
23925
  const participantListDefaultProps = usePropsFor$1(ParticipantList);
23956
- const removeButtonAllowed = hasRemoveParticipantsPermissionTrampoline();
23926
+ const removeButtonAllowed = hasRemoveParticipantsPermissionTrampoline(adapter);
23957
23927
  const setDrawerMenuItemsForParticipant = React.useMemo(() => {
23958
23928
  return (participant) => {
23959
23929
  if (participant) {
@@ -24026,9 +23996,10 @@ const createDefaultContextualMenuItems = (participant, strings, onRemoveParticip
24026
23996
  /**
24027
23997
  * @private
24028
23998
  */
24029
- const hasRemoveParticipantsPermissionTrampoline = () => {
23999
+ const hasRemoveParticipantsPermissionTrampoline = (adapter) => {
24000
+ var _a;
24030
24001
  /* @conditional-compile-remove(rooms) */
24031
- return _usePermissions().removeParticipantButton;
24002
+ return ((_a = adapter.getState().call) === null || _a === void 0 ? void 0 : _a.role) === 'Presenter';
24032
24003
  };
24033
24004
 
24034
24005
  // Copyright (c) Microsoft Corporation.
@@ -24526,29 +24497,27 @@ const DRAG_OPTIONS = {
24526
24497
  * @private
24527
24498
  */
24528
24499
  const ModalLocalAndRemotePIP = (props) => {
24529
- var _a;
24500
+ var _a, _b;
24530
24501
  const rootStyles = props.hidden ? hiddenStyle : PIPContainerStyle;
24531
24502
  /* @conditional-compile-remove(rooms) */
24532
- const rolePermissions = _usePermissions();
24503
+ const adapter = useAdapter();
24504
+ /* @conditional-compile-remove(rooms) */
24505
+ const role = (_a = adapter.getState().call) === null || _a === void 0 ? void 0 : _a.role;
24533
24506
  const pictureInPictureProps = useSelector$1(localAndRemotePIPSelector);
24534
24507
  const pictureInPictureHandlers = useHandlers();
24535
24508
  const localAndRemotePIP = React.useMemo(() => {
24536
24509
  var _a;
24537
24510
  /* @conditional-compile-remove(rooms) */
24538
- if (!rolePermissions.cameraButton && ((_a = pictureInPictureProps.dominantRemoteParticipant) === null || _a === void 0 ? void 0 : _a.userId)) {
24511
+ if (role === 'Consumer' && ((_a = pictureInPictureProps.dominantRemoteParticipant) === null || _a === void 0 ? void 0 : _a.userId)) {
24539
24512
  return (React__default['default'].createElement(_RemoteVideoTile, Object.assign({}, pictureInPictureProps.dominantRemoteParticipant, { remoteParticipant: pictureInPictureProps.dominantRemoteParticipant })));
24540
24513
  }
24541
24514
  return React__default['default'].createElement(LocalAndRemotePIP, Object.assign({}, pictureInPictureProps, pictureInPictureHandlers));
24542
- }, [
24543
- pictureInPictureProps,
24544
- pictureInPictureHandlers,
24545
- /* @conditional-compile-remove(rooms) */ rolePermissions.cameraButton
24546
- ]);
24515
+ }, [pictureInPictureProps, pictureInPictureHandlers, /* @conditional-compile-remove(rooms) */ role]);
24547
24516
  /* @conditional-compile-remove(rooms) */
24548
- if (!rolePermissions.cameraButton && !pictureInPictureProps.dominantRemoteParticipant) {
24517
+ if (role === 'Consumer' && !pictureInPictureProps.dominantRemoteParticipant) {
24549
24518
  return null;
24550
24519
  }
24551
- const modalStylesThemed = react.concatStyleSets(modalStyle, (_a = props.styles) === null || _a === void 0 ? void 0 : _a.modal);
24520
+ const modalStylesThemed = react.concatStyleSets(modalStyle, (_b = props.styles) === null || _b === void 0 ? void 0 : _b.modal);
24552
24521
  return (React__default['default'].createElement(react.Stack, { styles: rootStyles },
24553
24522
  React__default['default'].createElement(_ModalClone, { isOpen: true, isModeless: true, dragOptions: DRAG_OPTIONS, styles: modalStylesThemed, layerProps: { hostId: props.modalLayerHostId }, minDragPosition: props.minDragPosition, maxDragPosition: props.maxDragPosition },
24554
24523
  // Only render LocalAndRemotePIP when this component is NOT hidden because VideoGallery needs to have
@@ -24589,7 +24558,7 @@ const useMinMaxDragPosition = (modalLayerHostId, rtl) => {
24589
24558
  * @private
24590
24559
  */
24591
24560
  const CallArrangement = (props) => {
24592
- var _a, _b, _c, _d, _e, _f, _g, _h;
24561
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
24593
24562
  const containerClassName = React.useMemo(() => {
24594
24563
  return props.mobileView ? containerStyleMobile : containerStyleDesktop;
24595
24564
  }, [props.mobileView]);
@@ -24685,16 +24654,16 @@ const CallArrangement = (props) => {
24685
24654
  };
24686
24655
  const drawerContainerStylesValue = React.useMemo(() => drawerContainerStyles(DRAWER_Z_INDEX), []);
24687
24656
  /* @conditional-compile-remove(rooms) */
24688
- const rolePermissions = _usePermissions();
24657
+ const role = (_b = adapter.getState().call) === null || _b === void 0 ? void 0 : _b.role;
24689
24658
  let canUnmute = true;
24690
24659
  /* @conditional-compile-remove(rooms) */
24691
- canUnmute = rolePermissions.microphoneButton;
24660
+ canUnmute = role !== 'Consumer' ? true : false;
24692
24661
  let filteredLatestErrors = props.errorBarProps !== false ? props.latestErrors : [];
24693
24662
  /* @conditional-compile-remove(video-background-effects) */
24694
24663
  const isCameraOn = useSelector$1(localVideoSelector).isAvailable;
24695
24664
  /* @conditional-compile-remove(rooms) */
24696
24665
  // TODO: move this logic to the error bar selector once role is plumbed from the headless SDK
24697
- if (!rolePermissions.cameraButton && props.errorBarProps) {
24666
+ if (role === 'Consumer' && props.errorBarProps) {
24698
24667
  filteredLatestErrors = filteredLatestErrors.filter((e) => e.type !== 'callCameraAccessDenied' && e.type !== 'callCameraAccessDeniedSafari');
24699
24668
  }
24700
24669
  /* @conditional-compile-remove(video-background-effects) */
@@ -24713,10 +24682,10 @@ const CallArrangement = (props) => {
24713
24682
  return (React__default['default'].createElement("div", { ref: containerRef, className: react.mergeStyles(containerDivStyles), id: props.id },
24714
24683
  React__default['default'].createElement(react.Stack, { verticalFill: true, horizontalAlign: "stretch", className: containerClassName, "data-ui-id": props.dataUiId },
24715
24684
  React__default['default'].createElement(react.Stack, { reversed: true, horizontal: verticalControlBar, grow: true, styles: callArrangementContainerStyles(verticalControlBar) },
24716
- ((_b = props.callControlProps) === null || _b === void 0 ? void 0 : _b.options) !== false && !isMobileWithActivePane && (React__default['default'].createElement(react.Stack, { verticalAlign: 'center', className: react.mergeStyles({
24685
+ ((_c = props.callControlProps) === null || _c === void 0 ? void 0 : _c.options) !== false && !isMobileWithActivePane && (React__default['default'].createElement(react.Stack, { verticalAlign: 'center', className: react.mergeStyles({
24717
24686
  zIndex: CONTROL_BAR_Z_INDEX,
24718
24687
  padding: verticalControlBar ? '0.25rem' : 'unset'
24719
- }) }, isLegacyCallControlEnabled((_c = props.callControlProps) === null || _c === void 0 ? void 0 : _c.options) ? (React__default['default'].createElement(CallControls, Object.assign({}, props.callControlProps, { containerWidth: containerWidth, containerHeight: containerHeight, isMobile: props.mobileView,
24688
+ }) }, isLegacyCallControlEnabled((_d = props.callControlProps) === null || _d === void 0 ? void 0 : _d.options) ? (React__default['default'].createElement(CallControls, Object.assign({}, props.callControlProps, { containerWidth: containerWidth, containerHeight: containerHeight, isMobile: props.mobileView,
24720
24689
  /* @conditional-compile-remove(one-to-n-calling) */
24721
24690
  peopleButtonChecked: isPeoplePaneOpen,
24722
24691
  /* @conditional-compile-remove(one-to-n-calling) */
@@ -24729,7 +24698,7 @@ const CallArrangement = (props) => {
24729
24698
  onShowVideoEffectsPicker: openVideoEffectsPane,
24730
24699
  /* @conditional-compile-remove(PSTN-calls) */
24731
24700
  onClickShowDialpad: alternateCallerId ? onClickShowDialpad : undefined, displayVertical: verticalControlBar }))))),
24732
- ((_d = props.callControlProps) === null || _d === void 0 ? void 0 : _d.options) !== false && showDrawer && (React__default['default'].createElement(react.Stack, { styles: drawerContainerStylesValue },
24701
+ ((_e = props.callControlProps) === null || _e === void 0 ? void 0 : _e.options) !== false && showDrawer && (React__default['default'].createElement(react.Stack, { styles: drawerContainerStylesValue },
24733
24702
  React__default['default'].createElement(PreparedMoreDrawer, { callControls: props.callControlProps.options, onLightDismiss: closeDrawer, onPeopleButtonClicked: onMoreDrawerPeopleClicked,
24734
24703
  /* @conditional-compile-remove(PSTN-calls) */
24735
24704
  onClickShowDialpad: alternateCallerId ? onClickShowDialpad : undefined,
@@ -24738,7 +24707,7 @@ const CallArrangement = (props) => {
24738
24707
  /* @conditional-compile-remove(close-captions) */
24739
24708
  isCaptionsSupported: isTeamsCall && hasJoinedCall }))),
24740
24709
  /* @conditional-compile-remove(PSTN-calls) */
24741
- ((_e = props.callControlProps) === null || _e === void 0 ? void 0 : _e.options) !== false && showDtmfDialpad && (React__default['default'].createElement(react.Stack, { styles: drawerContainerStylesValue },
24710
+ ((_f = props.callControlProps) === null || _f === void 0 ? void 0 : _f.options) !== false && showDtmfDialpad && (React__default['default'].createElement(react.Stack, { styles: drawerContainerStylesValue },
24742
24711
  React__default['default'].createElement(SendDtmfDialpad, { isMobile: props.mobileView, strings: dialpadStrings, showDialpad: showDtmfDialpad, onDismissDialpad: onDismissDtmfDialpad }))),
24743
24712
  React__default['default'].createElement(react.Stack, { horizontal: true, grow: true },
24744
24713
  React__default['default'].createElement(react.Stack.Item, { style: callCompositeContainerCSS },
@@ -24758,7 +24727,7 @@ const CallArrangement = (props) => {
24758
24727
  maxWidth: isVideoPaneOpen ? `${VIDEO_EFFECTS_SIDE_PANE_WIDTH_REM}rem` : undefined, updateSidePaneRenderer: props.updateSidePaneRenderer, onPeopleButtonClicked: props.mobileView && !shouldShowPeopleTabHeaderButton(props.callControlProps.options)
24759
24728
  ? undefined
24760
24729
  : togglePeoplePane, disablePeopleButton: typeof props.callControlProps.options !== 'boolean' &&
24761
- isDisabled$2((_f = props.callControlProps.options) === null || _f === void 0 ? void 0 : _f.participantsButton), onChatButtonClicked: (_g = props.mobileChatTabHeader) === null || _g === void 0 ? void 0 : _g.onClick, disableChatButton: (_h = props.mobileChatTabHeader) === null || _h === void 0 ? void 0 : _h.disabled }),
24730
+ isDisabled$2((_g = props.callControlProps.options) === null || _g === void 0 ? void 0 : _g.participantsButton), onChatButtonClicked: (_h = props.mobileChatTabHeader) === null || _h === void 0 ? void 0 : _h.onClick, disableChatButton: (_j = props.mobileChatTabHeader) === null || _j === void 0 ? void 0 : _j.disabled }),
24762
24731
  props.mobileView && (React__default['default'].createElement(ModalLocalAndRemotePIP, { modalLayerHostId: props.modalLayerHostId, hidden: !isSidePaneOpen, styles: pipStyles, minDragPosition: minMaxDragPosition.minDragPosition, maxDragPosition: minMaxDragPosition.maxDragPosition })),
24763
24732
  drawerMenuItems.length > 0 && (React__default['default'].createElement(react.Stack, { styles: drawerContainerStyles() },
24764
24733
  React__default['default'].createElement(_DrawerMenu, { onLightDismiss: () => setDrawerMenuItems([]), items: drawerMenuItems }))))))));
@@ -24941,21 +24910,27 @@ const remoteVideoViewOptions = {
24941
24910
  * @private
24942
24911
  */
24943
24912
  const MediaGallery = (props) => {
24944
- var _a, _b;
24913
+ var _a, _b, _c;
24945
24914
  const videoGalleryProps = usePropsFor$1(VideoGallery);
24946
24915
  const cameraSwitcherCameras = useSelector$1(localVideoCameraCycleButtonSelector);
24947
24916
  const cameraSwitcherCallback = useHandlers();
24948
24917
  const announcerString = useParticipantChangedAnnouncement();
24949
- /* @conditional-compile-remove(vertical-gallery) */
24918
+ /* @conditional-compile-remove(rooms) */
24919
+ const adapter = useAdapter();
24920
+ /* @conditional-compile-remove(rooms) */
24921
+ const userRole = (_a = adapter.getState().call) === null || _a === void 0 ? void 0 : _a.role;
24922
+ /* @conditional-compile-remove(rooms) */
24923
+ const isRoomsCall = adapter.getState().isRoomsCall;
24924
+ /* @conditional-compile-remove(vertical-gallery) */ /* @conditional-compile-remove(rooms) */
24950
24925
  const containerRef = React.useRef(null);
24951
- /* @conditional-compile-remove(vertical-gallery) */
24926
+ /* @conditional-compile-remove(vertical-gallery) */ /* @conditional-compile-remove(rooms) */
24952
24927
  const containerWidth = _useContainerWidth(containerRef);
24953
- /* @conditional-compile-remove(vertical-gallery) */
24928
+ /* @conditional-compile-remove(vertical-gallery) */ /* @conditional-compile-remove(rooms) */
24954
24929
  const containerHeight = _useContainerHeight(containerRef);
24955
- /* @conditional-compile-remove(click-to-call) */
24930
+ /* @conditional-compile-remove(click-to-call) */ /* @conditional-compile-remove(rooms) */
24956
24931
  const containerAspectRatio = containerWidth && containerHeight ? containerWidth / containerHeight : 0;
24957
24932
  const layoutBasedOnTilePosition = localVideoTileLayoutTrampoline(
24958
- /* @conditional-compile-remove(click-to-call) */ (_a = props.localVideoTileOptions) === null || _a === void 0 ? void 0 : _a.position);
24933
+ /* @conditional-compile-remove(click-to-call) */ (_b = props.localVideoTileOptions) === null || _b === void 0 ? void 0 : _b.position);
24959
24934
  const cameraSwitcherProps = React.useMemo(() => {
24960
24935
  return Object.assign(Object.assign({}, cameraSwitcherCallback), cameraSwitcherCameras);
24961
24936
  }, [cameraSwitcherCallback, cameraSwitcherCameras]);
@@ -24972,7 +24947,7 @@ const MediaGallery = (props) => {
24972
24947
  : props.isMobile
24973
24948
  ? { kind: 'drawer', hostId: props.drawerMenuHostId }
24974
24949
  : { kind: 'contextual' };
24975
- }, [(_b = props.remoteVideoTileMenuOptions) === null || _b === void 0 ? void 0 : _b.isHidden, props.isMobile, props.drawerMenuHostId]);
24950
+ }, [(_c = props.remoteVideoTileMenuOptions) === null || _c === void 0 ? void 0 : _c.isHidden, props.isMobile, props.drawerMenuHostId]);
24976
24951
  /* @conditional-compile-remove(vertical-gallery) */
24977
24952
  const overflowGalleryPosition = React.useMemo(() => containerWidth && containerHeight && containerWidth / containerHeight >= 16 / 9
24978
24953
  ? 'VerticalRight'
@@ -24984,24 +24959,30 @@ const MediaGallery = (props) => {
24984
24959
  remoteVideoTileMenuOptions: remoteVideoTileMenuOptions,
24985
24960
  /* @conditional-compile-remove(vertical-gallery) */
24986
24961
  overflowGalleryPosition: overflowGalleryPosition,
24987
- /* @conditional-compile-remove(click-to-call) */
24988
- localVideoTileSize: props.localVideoTileOptions === false
24962
+ /* @conditional-compile-remove(rooms) */
24963
+ localVideoTileSize: props.localVideoTileOptions === false || userRole === 'Consumer' || (isRoomsCall && userRole === 'Unknown')
24989
24964
  ? 'hidden'
24990
24965
  : props.isMobile && containerAspectRatio < 1
24991
24966
  ? '9:16'
24992
24967
  : '16:9' })));
24993
24968
  }, [
24994
24969
  videoGalleryProps,
24970
+ layoutBasedOnTilePosition,
24995
24971
  props.isMobile,
24996
24972
  props.onRenderAvatar,
24997
- onRenderAvatar,
24973
+ /* @conditional-compile-remove(rooms) */ /* @conditional-compile-remove(click-to-call) */
24974
+ props.localVideoTileOptions,
24998
24975
  cameraSwitcherProps,
24999
- /* @conditional-compile-remove(pinned-participants) */ remoteVideoTileMenuOptions,
25000
- /* @conditional-compile-remove(vertical-gallery) */ overflowGalleryPosition,
25001
- /* @conditional-compile-remove(click-to-call) */ props.localVideoTileOptions,
25002
- layoutBasedOnTilePosition,
25003
- /* @conditional-compile-remove(click-to-call) */
25004
- containerAspectRatio
24976
+ onRenderAvatar,
24977
+ /* @conditional-compile-remove(pinned-participants) */
24978
+ remoteVideoTileMenuOptions,
24979
+ /* @conditional-compile-remove(vertical-gallery) */
24980
+ overflowGalleryPosition,
24981
+ /* @conditional-compile-remove(rooms) */
24982
+ isRoomsCall,
24983
+ /* @conditional-compile-remove(rooms) */
24984
+ userRole,
24985
+ /* @conditional-compile-remove(click-to-call) */ /* @conditional-compile-remove(rooms) */ containerAspectRatio
25005
24986
  ]);
25006
24987
  return (React__default['default'].createElement("div", { ref: containerRef, style: mediaGalleryContainerStyles },
25007
24988
  React__default['default'].createElement(Announcer$1, { announcementString: announcerString, ariaLive: 'polite' }),
@@ -25552,10 +25533,10 @@ const localVideoViewOptions = {
25552
25533
  * @private
25553
25534
  */
25554
25535
  const LocalDeviceSettings = (props) => {
25555
- var _a;
25536
+ var _a, _b;
25556
25537
  const theme = useTheme();
25557
25538
  const locale = useLocale();
25558
- /* @conditional-compile-remove(call-readiness) */
25539
+ /* @conditional-compile-remove(call-readiness) */ /* @conditional-compile-remove(rooms) */
25559
25540
  const adapter = useAdapter();
25560
25541
  const defaultPlaceHolder = locale.strings.call.defaultPlaceHolder;
25561
25542
  const cameraLabel = locale.strings.call.cameraLabel;
@@ -25563,16 +25544,16 @@ const LocalDeviceSettings = (props) => {
25563
25544
  const noSpeakersLabel = locale.strings.call.noSpeakersLabel;
25564
25545
  const noCameraLabel = locale.strings.call.noCamerasLabel;
25565
25546
  const noMicLabel = locale.strings.call.noMicrophonesLabel;
25547
+ /* @conditional-compile-remove(rooms) */
25548
+ const role = (_a = adapter.getState().call) === null || _a === void 0 ? void 0 : _a.role;
25566
25549
  const cameraPermissionGranted = props.cameraPermissionGranted;
25567
25550
  const micPermissionGranted = props.microphonePermissionGranted;
25568
25551
  let roleCanUseCamera = true;
25569
25552
  let roleCanUseMic = true;
25570
25553
  /* @conditional-compile-remove(rooms) */
25571
- const rolePermissions = _usePermissions();
25572
- /* @conditional-compile-remove(rooms) */
25573
- roleCanUseCamera = rolePermissions.cameraButton;
25554
+ roleCanUseCamera = role === 'Consumer' ? false : true;
25574
25555
  /* @conditional-compile-remove(rooms) */
25575
- roleCanUseMic = rolePermissions.microphoneButton;
25556
+ roleCanUseMic = role === 'Consumer' ? false : true;
25576
25557
  // TODO: speaker permission is tied to microphone permission (when you request 'audio' permission using the SDK) its
25577
25558
  // actually granting access to query both microphone and speaker. However the browser popup asks you explicity for
25578
25559
  // 'microphone'. This needs investigation on how we want to handle this and maybe needs follow up with SDK team.
@@ -25597,7 +25578,7 @@ const LocalDeviceSettings = (props) => {
25597
25578
  ? props.selectedCamera
25598
25579
  ? props.selectedCamera.id
25599
25580
  : props.cameras
25600
- ? (_a = props.cameras[0]) === null || _a === void 0 ? void 0 : _a.id
25581
+ ? (_b = props.cameras[0]) === null || _b === void 0 ? void 0 : _b.id
25601
25582
  : ''
25602
25583
  : 'deniedOrUnknown', onChange: (event, option, index) => {
25603
25584
  props.onSelectCamera(props.cameras[index !== null && index !== void 0 ? index : 0], localVideoViewOptions);
@@ -26057,7 +26038,7 @@ var __awaiter$7 = (window && window.__awaiter) || function (thisArg, _arguments,
26057
26038
  * @private
26058
26039
  */
26059
26040
  const ConfigurationPage = (props) => {
26060
- var _a, _b;
26041
+ var _a, _b, _c;
26061
26042
  const { startCallHandler, mobileView, modalLayerHostId,
26062
26043
  /* @conditional-compile-remove(call-readiness) */ deviceChecks,
26063
26044
  /* @conditional-compile-remove(call-readiness) */ onPermissionsTroubleshootingClick,
@@ -26079,13 +26060,13 @@ const ConfigurationPage = (props) => {
26079
26060
  const environmentInfo = adapter.getState().environmentInfo;
26080
26061
  let disableStartCallButton = !microphonePermissionGranted || ((_a = deviceState.microphones) === null || _a === void 0 ? void 0 : _a.length) === 0;
26081
26062
  /* @conditional-compile-remove(rooms) */
26082
- const rolePermissions = _usePermissions();
26063
+ const role = (_b = adapter.getState().call) === null || _b === void 0 ? void 0 : _b.role;
26083
26064
  /* @conditional-compile-remove(video-background-effects) */
26084
26065
  const isCameraOn = useSelector$1(localVideoSelector).isAvailable;
26085
26066
  let filteredLatestErrors = props.latestErrors;
26086
26067
  /* @conditional-compile-remove(rooms) */
26087
26068
  // TODO: move this logic to the error bar selector once role is plumbed from the headless SDK
26088
- if (!rolePermissions.cameraButton) {
26069
+ if (role !== 'Consumer') {
26089
26070
  filteredLatestErrors = filteredLatestErrors.filter((e) => e.type !== 'callCameraAccessDenied' && e.type !== 'callCameraAccessDeniedSafari');
26090
26071
  }
26091
26072
  /* @conditional-compile-remove(video-background-effects) */
@@ -26093,7 +26074,7 @@ const ConfigurationPage = (props) => {
26093
26074
  filteredLatestErrors = filteredLatestErrors.filter((e) => e.type !== 'unableToStartVideoEffect');
26094
26075
  }
26095
26076
  /* @conditional-compile-remove(rooms) */
26096
- if (!rolePermissions.microphoneButton) {
26077
+ if (role === 'Consumer') {
26097
26078
  // If user's role permissions do not allow access to the microphone button then DO NOT disable the start call button
26098
26079
  // because microphone device permission is not needed for the user's role
26099
26080
  disableStartCallButton = false;
@@ -26106,7 +26087,7 @@ const ConfigurationPage = (props) => {
26106
26087
  disableStartCallButton = false;
26107
26088
  }
26108
26089
  else if (deviceChecks.camera === 'required') {
26109
- disableStartCallButton = !cameraPermissionGranted || ((_b = deviceState.cameras) === null || _b === void 0 ? void 0 : _b.length) === 0;
26090
+ disableStartCallButton = !cameraPermissionGranted || ((_c = deviceState.cameras) === null || _c === void 0 ? void 0 : _c.length) === 0;
26110
26091
  }
26111
26092
  }
26112
26093
  const locale = useLocale();
@@ -26114,7 +26095,7 @@ const ConfigurationPage = (props) => {
26114
26095
  const callDescription = locale.strings.call.configurationPageCallDetails && (React__default['default'].createElement(react.Stack.Item, { className: mobileView ? callDetailsStyleMobile : callDetailsStyleDesktop }, locale.strings.call.configurationPageCallDetails));
26115
26096
  let mobileWithPreview = mobileView;
26116
26097
  /* @conditional-compile-remove(rooms) */
26117
- mobileWithPreview = mobileWithPreview && rolePermissions.cameraButton;
26098
+ mobileWithPreview = mobileWithPreview && role !== 'Consumer';
26118
26099
  /* @conditional-compile-remove(call-readiness) */
26119
26100
  const permissionsState = {
26120
26101
  // fall back to using cameraPermissionGranted and microphonePermissionGranted if permission API is not supported
@@ -26196,8 +26177,7 @@ const ConfigurationPage = (props) => {
26196
26177
  mobileWithPreview && (React__default['default'].createElement(react.Stack.Item, null,
26197
26178
  title,
26198
26179
  callDescription)),
26199
- localPreviewTrampoline(mobileWithPreview,
26200
- /* @conditional-compile-remove(rooms) */ !rolePermissions.cameraButton),
26180
+ localPreviewTrampoline(mobileWithPreview, /* @conditional-compile-remove(rooms) */ !!(role === 'Consumer')),
26201
26181
  React__default['default'].createElement(react.Stack, { className: mobileView ? undefined : selectionContainerStyle },
26202
26182
  !mobileWithPreview && (React__default['default'].createElement(React__default['default'].Fragment, null,
26203
26183
  React__default['default'].createElement(react.Stack.Item, { styles: callDetailsContainerStylesDesktop },
@@ -26838,8 +26818,6 @@ const MainScreen = (props) => {
26838
26818
  const locale = useLocale();
26839
26819
  const palette = useTheme().palette;
26840
26820
  const leavePageStyle = React.useMemo(() => leavingPageStyle(palette), [palette]);
26841
- /* @conditional-compile-remove(rooms) */
26842
- const role = useSelector$1(getRole);
26843
26821
  let pageElement;
26844
26822
  /* @conditional-compile-remove(rooms) */
26845
26823
  switch (page) {
@@ -26905,13 +26883,7 @@ const MainScreen = (props) => {
26905
26883
  if (!pageElement) {
26906
26884
  throw new Error('Invalid call composite page');
26907
26885
  }
26908
- /* @conditional-compile-remove(rooms) */
26909
- const permissions = _getPermissions(role === 'Unknown' || role === undefined ? props.roleHint : role);
26910
- // default retElement for stable version
26911
- let retElement = pageElement;
26912
- /* @conditional-compile-remove(rooms) */
26913
- retElement = React__default['default'].createElement(_PermissionsProvider, { permissions: permissions }, pageElement);
26914
- return (React__default['default'].createElement(SidePaneProvider, { sidePaneRenderer: sidePaneRenderer, overrideSidePane: injectedSidePaneProps }, retElement));
26886
+ return (React__default['default'].createElement(SidePaneProvider, { sidePaneRenderer: sidePaneRenderer, overrideSidePane: injectedSidePaneProps }, pageElement));
26915
26887
  };
26916
26888
  /**
26917
26889
  * A customizable UI composite for calling experience.
@@ -26926,19 +26898,18 @@ const CallComposite = (props) => React__default['default'].createElement(CallCom
26926
26898
  /** @private */
26927
26899
  const CallCompositeInner = (props) => {
26928
26900
  const { adapter, callInvitationUrl, onFetchAvatarPersonaData, onFetchParticipantMenuItems, options, formFactor = 'desktop' } = props;
26929
- /* @conditional-compile-remove(rooms) */
26930
- const roleHint = adapter.getState().roleHint;
26931
26901
  React.useEffect(() => {
26932
26902
  (() => __awaiter$5(void 0, void 0, void 0, function* () {
26903
+ var _a;
26933
26904
  const constrain = getQueryOptions({
26934
- /* @conditional-compile-remove(rooms) */ role: roleHint
26905
+ /* @conditional-compile-remove(rooms) */ role: (_a = adapter.getState().call) === null || _a === void 0 ? void 0 : _a.role
26935
26906
  });
26936
26907
  yield adapter.askDevicePermission(constrain);
26937
26908
  adapter.queryCameras();
26938
26909
  adapter.queryMicrophones();
26939
26910
  adapter.querySpeakers();
26940
26911
  }))();
26941
- }, [adapter, /* @conditional-compile-remove(rooms) */ roleHint]);
26912
+ }, [adapter]);
26942
26913
  const mobileView = formFactor === 'mobile';
26943
26914
  const modalLayerHostId = reactHooks.useId('modalLayerhost');
26944
26915
  const mainScreenContainerClassName = React.useMemo(() => {
@@ -26947,9 +26918,7 @@ const CallCompositeInner = (props) => {
26947
26918
  return (React__default['default'].createElement("div", { className: mainScreenContainerClassName },
26948
26919
  React__default['default'].createElement(BaseProvider, Object.assign({}, props),
26949
26920
  React__default['default'].createElement(CallAdapterProvider, { adapter: adapter },
26950
- React__default['default'].createElement(MainScreen, { callInvitationUrl: callInvitationUrl, onFetchAvatarPersonaData: onFetchAvatarPersonaData, onFetchParticipantMenuItems: onFetchParticipantMenuItems, mobileView: mobileView, modalLayerHostId: modalLayerHostId, options: options,
26951
- /* @conditional-compile-remove(rooms) */
26952
- roleHint: roleHint, onSidePaneIdChange: props.onSidePaneIdChange, overrideSidePane: props.overrideSidePane, mobileChatTabHeader: props.mobileChatTabHeader }),
26921
+ React__default['default'].createElement(MainScreen, { callInvitationUrl: callInvitationUrl, onFetchAvatarPersonaData: onFetchAvatarPersonaData, onFetchParticipantMenuItems: onFetchParticipantMenuItems, mobileView: mobileView, modalLayerHostId: modalLayerHostId, options: options, onSidePaneIdChange: props.onSidePaneIdChange, overrideSidePane: props.overrideSidePane, mobileChatTabHeader: props.mobileChatTabHeader }),
26953
26922
  // This layer host is for ModalLocalAndRemotePIP in SidePane. This LayerHost cannot be inside the SidePane
26954
26923
  // because when the SidePane is hidden, ie. style property display is 'none', it takes up no space. This causes problems when dragging
26955
26924
  // the Modal because the draggable bounds thinks it has no space and will always return to its initial position after dragging.
@@ -27162,7 +27131,9 @@ var __awaiter$3 = (window && window.__awaiter) || function (thisArg, _arguments,
27162
27131
  };
27163
27132
  /** Context of call, which is a centralized context for all state updates */
27164
27133
  class CallContext {
27165
- constructor(clientState, isTeamsCall, options) {
27134
+ constructor(clientState, isTeamsCall,
27135
+ /* @conditional-compile-remove(rooms) */
27136
+ isRoomsCall, options) {
27166
27137
  var _a, _b;
27167
27138
  this.emitter = new EventEmitter.EventEmitter();
27168
27139
  this.state = {
@@ -27174,10 +27145,10 @@ class CallContext {
27174
27145
  page: 'configuration',
27175
27146
  latestErrors: clientState.latestErrors,
27176
27147
  isTeamsCall,
27148
+ /* @conditional-compile-remove(rooms) */ isRoomsCall,
27177
27149
  /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId: clientState.alternateCallerId,
27178
27150
  /* @conditional-compile-remove(unsupported-browser) */ environmentInfo: clientState.environmentInfo,
27179
27151
  /* @conditional-compile-remove(unsupported-browser) */ unsupportedBrowserVersionsAllowed: false,
27180
- /* @conditional-compile-remove(rooms) */ roleHint: options === null || options === void 0 ? void 0 : options.roleHint,
27181
27152
  /* @conditional-compile-remove(video-background-effects) */ videoBackgroundImages: options === null || options === void 0 ? void 0 : options.videoBackgroundImages,
27182
27153
  /* @conditional-compile-remove(video-background-effects) */ selectedVideoBackgroundEffect: undefined,
27183
27154
  cameraStatus: undefined
@@ -27323,13 +27294,9 @@ class AzureCommunicationCallAdapter {
27323
27294
  const isTeamsMeeting = 'meetingLink' in this.locator;
27324
27295
  /* @conditional-compile-remove(rooms) */
27325
27296
  const isRoomsCall = 'roomId' in this.locator;
27326
- /* @conditional-compile-remove(rooms) */
27327
- // to prevent showing components that depend on role such as local video tile, camera button, etc. in a rooms call
27328
- // we set the default roleHint as 'Consumer' when roleHint is undefined since it has the lowest level of permissions
27329
- if (isRoomsCall && (options === null || options === void 0 ? void 0 : options.roleHint) === undefined) {
27330
- options = Object.assign(Object.assign({}, options), { roleHint: 'Consumer' });
27331
- }
27332
- this.context = new CallContext(callClient.getState(), isTeamsMeeting, options);
27297
+ this.context = new CallContext(callClient.getState(), isTeamsMeeting,
27298
+ /* @conditional-compile-remove(rooms) */ isRoomsCall,
27299
+ /* @conditional-compile-remove(video-background-effects) */ options);
27333
27300
  this.context.onCallEnded((endCallData) => this.emitter.emit('callEnded', endCallData));
27334
27301
  const onStateChange = (clientState) => {
27335
27302
  var _a, _b;
@@ -28094,7 +28061,7 @@ const useAzureCommunicationCallAdapterGeneric = (args, afterCreate, beforeDispos
28094
28061
  const displayName = 'displayName' in args ? args.displayName : undefined;
28095
28062
  /* @conditional-compile-remove(PSTN-calls) */
28096
28063
  const alternateCallerId = 'alternateCallerId' in args ? args.alternateCallerId : undefined;
28097
- /* @conditional-compile-remove(rooms) */
28064
+ /* @conditional-compile-remove(video-background-effects) */
28098
28065
  const options = 'options' in args ? args.options : undefined;
28099
28066
  // State update needed to rerender the parent component when a new adapter is created.
28100
28067
  const [adapter, setAdapter] = React.useState(undefined);
@@ -28135,11 +28102,6 @@ const useAzureCommunicationCallAdapterGeneric = (args, afterCreate, beforeDispos
28135
28102
  if (!displayName) {
28136
28103
  throw new Error('Unreachable code, displayName already checked above.');
28137
28104
  }
28138
- // This is just the type check to ensure that roleHint is defined.
28139
- /* @conditional-compile-remove(rooms) */
28140
- if (options && !('roleHint' in options)) {
28141
- throw new Error('Unreachable code, provided a options without roleHint.');
28142
- }
28143
28105
  if (creatingAdapterRef.current) {
28144
28106
  console.warn('Adapter is already being created, please see storybook for more information: https://azure.github.io/communication-ui-library/?path=/story/troubleshooting--page');
28145
28107
  return;
@@ -28151,7 +28113,7 @@ const useAzureCommunicationCallAdapterGeneric = (args, afterCreate, beforeDispos
28151
28113
  locator,
28152
28114
  userId: userId,
28153
28115
  /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId,
28154
- /* @conditional-compile-remove(rooms) */ options
28116
+ /* @conditional-compile-remove(video-background-effects) */ options
28155
28117
  }));
28156
28118
  }
28157
28119
  else if (adapterKind === 'Teams') {
@@ -28194,7 +28156,6 @@ const useAzureCommunicationCallAdapterGeneric = (args, afterCreate, beforeDispos
28194
28156
  displayName,
28195
28157
  /* @conditional-compile-remove(PSTN-calls) */
28196
28158
  alternateCallerId,
28197
- /* @conditional-compile-remove(rooms) */
28198
28159
  /* @conditional-compile-remove(teams-identity-support) */
28199
28160
  options
28200
28161
  ]);
@@ -28304,7 +28265,7 @@ const createAzureCommunicationCallAdapterFromClient = (callClient, callAgent, lo
28304
28265
  /* @conditional-compile-remove(unsupported-browser) */
28305
28266
  yield callClient.feature(communicationCalling.Features.DebugInfo).getEnvironmentInfo();
28306
28267
  return new AzureCommunicationCallAdapter(callClient, locator, callAgent, deviceManager,
28307
- /* @conditional-compile-remove(rooms) */ options);
28268
+ /* @conditional-compile-remove(video-background-effects) */ options);
28308
28269
  });
28309
28270
  /* @conditional-compile-remove(teams-identity-support) */
28310
28271
  /**
@@ -28544,6 +28505,8 @@ function callAdapterStateFromCallWithChatAdapterState(callWithChatAdapterState)
28544
28505
  call: callWithChatAdapterState.call,
28545
28506
  devices: callWithChatAdapterState.devices,
28546
28507
  isTeamsCall: callWithChatAdapterState.isTeamsCall,
28508
+ /* @conditional-compile-remove(rooms) */
28509
+ isRoomsCall: callWithChatAdapterState.isRoomsCall,
28547
28510
  latestErrors: callWithChatAdapterState.latestCallErrors,
28548
28511
  /* @conditional-compile-remove(PSTN-calls) */
28549
28512
  alternateCallerId: callWithChatAdapterState.alternateCallerId,
@@ -29034,6 +28997,8 @@ function callWithChatAdapterStateFromBackingStates(callAdapter, chatAdapter) {
29034
28997
  devices: callAdapterState.devices,
29035
28998
  isLocalPreviewMicrophoneEnabled: callAdapterState.isLocalPreviewMicrophoneEnabled,
29036
28999
  isTeamsCall: callAdapterState.isTeamsCall,
29000
+ /* @conditional-compile-remove(rooms) */
29001
+ isRoomsCall: callAdapterState.isRoomsCall,
29037
29002
  latestCallErrors: callAdapterState.latestErrors,
29038
29003
  latestChatErrors: chatAdapterState.latestErrors,
29039
29004
  /* @conditional-compile-remove(file-sharing) */
@@ -29693,7 +29658,7 @@ class AzureCommunicationCallWithChatAdapter {
29693
29658
  */
29694
29659
  const createAzureCommunicationCallWithChatAdapter = ({ userId, displayName, credential, endpoint, locator,
29695
29660
  /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId,
29696
- /* @conditional-compile-remove(rooms) */ /* @conditional-compile-remove(video-background-effects) */ callAdapterOptions }) => __awaiter(void 0, void 0, void 0, function* () {
29661
+ /* @conditional-compile-remove(video-background-effects) */ callAdapterOptions }) => __awaiter(void 0, void 0, void 0, function* () {
29697
29662
  const callAdapterLocator = isTeamsMeetingLinkLocator(locator) ? locator : locator.callLocator;
29698
29663
  const createCallAdapterPromise = createAzureCommunicationCallAdapter({
29699
29664
  userId,
@@ -29701,7 +29666,7 @@ const createAzureCommunicationCallWithChatAdapter = ({ userId, displayName, cred
29701
29666
  credential,
29702
29667
  locator: callAdapterLocator,
29703
29668
  /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId,
29704
- /* @conditional-compile-remove(rooms) */ options: callAdapterOptions
29669
+ /* @conditional-compile-remove(video-background-effects) */ options: callAdapterOptions
29705
29670
  });
29706
29671
  const threadId = isTeamsMeetingLinkLocator(locator)
29707
29672
  ? getChatThreadFromTeamsLink(locator.meetingLink)
@@ -29752,7 +29717,7 @@ afterCreate,
29752
29717
  beforeDispose) => {
29753
29718
  const { credential, displayName, endpoint, locator, userId,
29754
29719
  /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId,
29755
- /* @conditional-compile-remove(rooms) */ callAdapterOptions } = args;
29720
+ /* @conditional-compile-remove(video-background-effects) */ callAdapterOptions } = args;
29756
29721
  // State update needed to rerender the parent component when a new adapter is created.
29757
29722
  const [adapter, setAdapter] = React.useState(undefined);
29758
29723
  // Ref needed for cleanup to access the old adapter created asynchronously.
@@ -29789,7 +29754,7 @@ beforeDispose) => {
29789
29754
  locator,
29790
29755
  userId,
29791
29756
  /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId,
29792
- /* @conditional-compile-remove(rooms) */ callAdapterOptions
29757
+ /* @conditional-compile-remove(video-background-effects) */ callAdapterOptions
29793
29758
  });
29794
29759
  if (afterCreateRef.current) {
29795
29760
  newAdapter = yield afterCreateRef.current(newAdapter);
@@ -29809,7 +29774,7 @@ beforeDispose) => {
29809
29774
  endpoint,
29810
29775
  locator,
29811
29776
  userId,
29812
- /* @conditional-compile-remove(rooms) */ callAdapterOptions
29777
+ /* @conditional-compile-remove(video-background-effects) */ callAdapterOptions
29813
29778
  ]);
29814
29779
  // Dispose any existing adapter when the component unmounts.
29815
29780
  React.useEffect(() => {