@azure/communication-react 1.5.1-alpha-202304110013 → 1.5.1-alpha-202304130012

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 (61) hide show
  1. package/dist/communication-react.d.ts +82 -2
  2. package/dist/dist-cjs/communication-react/index.js +309 -178
  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/communication-react/src/index.d.ts +1 -1
  7. package/dist/dist-esm/communication-react/src/index.js.map +1 -1
  8. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.d.ts +9 -0
  9. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.js +5 -1
  10. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.js.map +1 -1
  11. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.d.ts +9 -0
  12. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.js +5 -1
  13. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.js.map +1 -1
  14. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.d.ts +3 -0
  15. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js +54 -3
  16. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js.map +1 -1
  17. package/dist/dist-esm/react-components/src/components/FileDownloadCards.d.ts +6 -0
  18. package/dist/dist-esm/react-components/src/components/FileDownloadCards.js.map +1 -1
  19. package/dist/dist-esm/react-components/src/components/MessageThread.d.ts +7 -0
  20. package/dist/dist-esm/react-components/src/components/MessageThread.js +23 -3
  21. package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
  22. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +2 -1
  23. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +13 -0
  24. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  25. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts +57 -0
  26. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
  27. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.d.ts +1 -1
  28. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.js.map +1 -1
  29. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/LobbyTile.styles.js +4 -4
  30. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/LobbyTile.styles.js.map +1 -1
  31. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.d.ts +5 -0
  32. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js +18 -0
  33. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js.map +1 -1
  34. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +2 -1
  35. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +4 -0
  36. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  37. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +9 -2
  38. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
  39. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.d.ts +2 -1
  40. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js +4 -0
  41. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
  42. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/parseTeamsUrl.js +4 -0
  43. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/parseTeamsUrl.js.map +1 -1
  44. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.d.ts +3 -1
  45. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js +38 -15
  46. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js.map +1 -1
  47. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationFileUploadAdapter.d.ts +1 -4
  48. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationFileUploadAdapter.js +1 -29
  49. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationFileUploadAdapter.js.map +1 -1
  50. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapter.d.ts +2 -0
  51. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapter.js.map +1 -1
  52. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js +1 -0
  53. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js.map +1 -1
  54. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js +17 -4
  55. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js.map +1 -1
  56. package/dist/dist-esm/react-composites/src/composites/common/constants.d.ts +9 -0
  57. package/dist/dist-esm/react-composites/src/composites/common/constants.js +11 -0
  58. package/dist/dist-esm/react-composites/src/composites/common/constants.js.map +1 -0
  59. package/dist/dist-esm/react-composites/src/composites/common/icons.js +4 -10
  60. package/dist/dist-esm/react-composites/src/composites/common/icons.js.map +1 -1
  61. package/package.json +10 -10
@@ -162,7 +162,7 @@ const _toCommunicationIdentifier = (id) => {
162
162
  // Copyright (c) Microsoft Corporation.
163
163
  // Licensed under the MIT license.
164
164
  // GENERATED FILE. DO NOT EDIT MANUALLY.
165
- var telemetryVersion = '1.5.1-alpha-202304110013';
165
+ var telemetryVersion = '1.5.1-alpha-202304130012';
166
166
 
167
167
  // Copyright (c) Microsoft Corporation.
168
168
  /**
@@ -378,7 +378,7 @@ const getEnvironmentInfo = (state) => {
378
378
 
379
379
  // Copyright (c) Microsoft Corporation.
380
380
  // Licensed under the MIT license.
381
- var __awaiter$G = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
381
+ var __awaiter$F = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
382
382
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
383
383
  return new (P || (P = Promise))(function (resolve, reject) {
384
384
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -416,7 +416,7 @@ const _isPreviewOn = (deviceManager) => {
416
416
  *
417
417
  * @private
418
418
  */
419
- const disposeAllLocalPreviewViews = (callClient) => __awaiter$G(void 0, void 0, void 0, function* () {
419
+ const disposeAllLocalPreviewViews = (callClient) => __awaiter$F(void 0, void 0, void 0, function* () {
420
420
  const unparentedViews = callClient.getState().deviceManager.unparentedViews;
421
421
  for (const view of unparentedViews) {
422
422
  yield callClient.disposeView(undefined, undefined, view);
@@ -549,7 +549,7 @@ const holdButtonSelector = reselect__namespace.createSelector([getCallState], (c
549
549
 
550
550
  // Copyright (c) Microsoft Corporation.
551
551
  // Licensed under the MIT license.
552
- var __awaiter$F = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
552
+ var __awaiter$E = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
553
553
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
554
554
  return new (P || (P = Promise))(function (resolve, reject) {
555
555
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -570,7 +570,7 @@ const areStreamsEqual = (prevStream, newStream) => {
570
570
  * @private
571
571
  */
572
572
  const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callClient, deviceManager, call) => {
573
- const onStartLocalVideo = () => __awaiter$F(void 0, void 0, void 0, function* () {
573
+ const onStartLocalVideo = () => __awaiter$E(void 0, void 0, void 0, function* () {
574
574
  // Before the call object creates a stream, dispose of any local preview streams.
575
575
  // @TODO: is there any way to parent the unparented view to the call object instead
576
576
  // of disposing and creating a new stream?
@@ -590,7 +590,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
590
590
  yield call.startVideo(stream);
591
591
  }
592
592
  });
593
- const onStopLocalVideo = (stream) => __awaiter$F(void 0, void 0, void 0, function* () {
593
+ const onStopLocalVideo = (stream) => __awaiter$E(void 0, void 0, void 0, function* () {
594
594
  const callId = call === null || call === void 0 ? void 0 : call.id;
595
595
  if (!callId) {
596
596
  return;
@@ -599,7 +599,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
599
599
  yield call.stopVideo(stream);
600
600
  }
601
601
  });
602
- const onToggleCamera = (options) => __awaiter$F(void 0, void 0, void 0, function* () {
602
+ const onToggleCamera = (options) => __awaiter$E(void 0, void 0, void 0, function* () {
603
603
  const previewOn = _isPreviewOn(callClient.getState().deviceManager);
604
604
  if (previewOn && call && call.state === 'Connecting') {
605
605
  // This is to workaround: https://skype.visualstudio.com/SPOOL/_workitems/edit/3030558.
@@ -647,19 +647,19 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
647
647
  }
648
648
  }
649
649
  });
650
- const onSelectMicrophone = (device) => __awaiter$F(void 0, void 0, void 0, function* () {
650
+ const onSelectMicrophone = (device) => __awaiter$E(void 0, void 0, void 0, function* () {
651
651
  if (!deviceManager) {
652
652
  return;
653
653
  }
654
654
  return deviceManager.selectMicrophone(device);
655
655
  });
656
- const onSelectSpeaker = (device) => __awaiter$F(void 0, void 0, void 0, function* () {
656
+ const onSelectSpeaker = (device) => __awaiter$E(void 0, void 0, void 0, function* () {
657
657
  if (!deviceManager) {
658
658
  return;
659
659
  }
660
660
  return deviceManager.selectSpeaker(device);
661
661
  });
662
- const onSelectCamera = (device, options) => __awaiter$F(void 0, void 0, void 0, function* () {
662
+ const onSelectCamera = (device, options) => __awaiter$E(void 0, void 0, void 0, function* () {
663
663
  if (!deviceManager) {
664
664
  return;
665
665
  }
@@ -682,19 +682,19 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
682
682
  }, options);
683
683
  }
684
684
  });
685
- const onToggleMicrophone = () => __awaiter$F(void 0, void 0, void 0, function* () {
685
+ const onToggleMicrophone = () => __awaiter$E(void 0, void 0, void 0, function* () {
686
686
  if (!call || !_isInCall(call.state)) {
687
687
  throw new Error(`Please invoke onToggleMicrophone after call is started`);
688
688
  }
689
689
  return call.isMuted ? yield call.unmute() : yield call.mute();
690
690
  });
691
- const onStartScreenShare = () => __awaiter$F(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.startScreenSharing()); });
692
- const onStopScreenShare = () => __awaiter$F(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.stopScreenSharing()); });
693
- const onToggleScreenShare = () => __awaiter$F(void 0, void 0, void 0, function* () { return (call === null || call === void 0 ? void 0 : call.isScreenSharingOn) ? yield onStopScreenShare() : yield onStartScreenShare(); });
694
- const onHangUp = (forEveryone) => __awaiter$F(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.hangUp({ forEveryone: forEveryone === true ? true : false })); });
691
+ const onStartScreenShare = () => __awaiter$E(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.startScreenSharing()); });
692
+ const onStopScreenShare = () => __awaiter$E(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.stopScreenSharing()); });
693
+ const onToggleScreenShare = () => __awaiter$E(void 0, void 0, void 0, function* () { return (call === null || call === void 0 ? void 0 : call.isScreenSharingOn) ? yield onStopScreenShare() : yield onStartScreenShare(); });
694
+ const onHangUp = (forEveryone) => __awaiter$E(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.hangUp({ forEveryone: forEveryone === true ? true : false })); });
695
695
  /* @conditional-compile-remove(PSTN-calls) */
696
- const onToggleHold = () => __awaiter$F(void 0, void 0, void 0, function* () { return (call === null || call === void 0 ? void 0 : call.state) === 'LocalHold' ? yield (call === null || call === void 0 ? void 0 : call.resume()) : yield (call === null || call === void 0 ? void 0 : call.hold()); });
697
- const onCreateLocalStreamView = (options = { scalingMode: 'Crop', isMirrored: true }) => __awaiter$F(void 0, void 0, void 0, function* () {
696
+ const onToggleHold = () => __awaiter$E(void 0, void 0, void 0, function* () { return (call === null || call === void 0 ? void 0 : call.state) === 'LocalHold' ? yield (call === null || call === void 0 ? void 0 : call.resume()) : yield (call === null || call === void 0 ? void 0 : call.hold()); });
697
+ const onCreateLocalStreamView = (options = { scalingMode: 'Crop', isMirrored: true }) => __awaiter$E(void 0, void 0, void 0, function* () {
698
698
  var _a;
699
699
  if (!call || call.localVideoStreams.length === 0) {
700
700
  return;
@@ -710,7 +710,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
710
710
  const { view } = (_a = (yield callClient.createView(call.id, undefined, localStream, options))) !== null && _a !== void 0 ? _a : {};
711
711
  return view ? { view } : undefined;
712
712
  });
713
- const onCreateRemoteStreamView = (userId, options = { scalingMode: 'Crop' }) => __awaiter$F(void 0, void 0, void 0, function* () {
713
+ const onCreateRemoteStreamView = (userId, options = { scalingMode: 'Crop' }) => __awaiter$E(void 0, void 0, void 0, function* () {
714
714
  if (!call) {
715
715
  return;
716
716
  }
@@ -741,7 +741,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
741
741
  }
742
742
  return (createViewResult === null || createViewResult === void 0 ? void 0 : createViewResult.view) ? { view: createViewResult === null || createViewResult === void 0 ? void 0 : createViewResult.view } : undefined;
743
743
  });
744
- const onDisposeRemoteStreamView = (userId) => __awaiter$F(void 0, void 0, void 0, function* () {
744
+ const onDisposeRemoteStreamView = (userId) => __awaiter$E(void 0, void 0, void 0, function* () {
745
745
  if (!call) {
746
746
  return;
747
747
  }
@@ -762,7 +762,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
762
762
  callClient.disposeView(call.id, participant.identifier, screenShareStream);
763
763
  }
764
764
  });
765
- const onDisposeLocalStreamView = () => __awaiter$F(void 0, void 0, void 0, function* () {
765
+ const onDisposeLocalStreamView = () => __awaiter$E(void 0, void 0, void 0, function* () {
766
766
  // If the user is currently in a call, dispose of the local stream view attached to that call.
767
767
  const callState = call && callClient.getState().calls[call.id];
768
768
  const localStream = callState === null || callState === void 0 ? void 0 : callState.localVideoStreams.find((item) => item.mediaStreamType === 'Video');
@@ -775,18 +775,18 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
775
775
  yield disposeAllLocalPreviewViews(callClient);
776
776
  });
777
777
  /* @conditional-compile-remove(dialpad) */ /* @conditional-compile-remove(PSTN-calls) */
778
- const onSendDtmfTone = (dtmfTone) => __awaiter$F(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.sendDtmf(dtmfTone)); });
778
+ const onSendDtmfTone = (dtmfTone) => __awaiter$E(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.sendDtmf(dtmfTone)); });
779
779
  const notImplemented = () => {
780
780
  throw new Error('Not implemented, cannot call a method from an abstract object');
781
781
  };
782
782
  /* @conditional-compile-remove(call-readiness) */
783
- const askDevicePermission = (constrain) => __awaiter$F(void 0, void 0, void 0, function* () {
783
+ const askDevicePermission = (constrain) => __awaiter$E(void 0, void 0, void 0, function* () {
784
784
  if (deviceManager) {
785
785
  yield (deviceManager === null || deviceManager === void 0 ? void 0 : deviceManager.askDevicePermission(constrain));
786
786
  }
787
787
  });
788
788
  /* @conditional-compile-remove(video-background-effects) */
789
- const onRemoveVideoBackgroundEffects = () => __awaiter$F(void 0, void 0, void 0, function* () {
789
+ const onRemoveVideoBackgroundEffects = () => __awaiter$E(void 0, void 0, void 0, function* () {
790
790
  const stream = (call === null || call === void 0 ? void 0 : call.localVideoStreams.find((stream) => stream.mediaStreamType === 'Video')) ||
791
791
  (deviceManager === null || deviceManager === void 0 ? void 0 : deviceManager.getUnparentedVideoStreams().find((stream) => stream.mediaStreamType === 'Video'));
792
792
  if (stream) {
@@ -794,7 +794,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
794
794
  }
795
795
  });
796
796
  /* @conditional-compile-remove(video-background-effects) */
797
- const onBlurVideoBackground = (backgroundBlurConfig) => __awaiter$F(void 0, void 0, void 0, function* () {
797
+ const onBlurVideoBackground = (backgroundBlurConfig) => __awaiter$E(void 0, void 0, void 0, function* () {
798
798
  const stream = (call === null || call === void 0 ? void 0 : call.localVideoStreams.find((stream) => stream.mediaStreamType === 'Video')) ||
799
799
  (deviceManager === null || deviceManager === void 0 ? void 0 : deviceManager.getUnparentedVideoStreams().find((stream) => stream.mediaStreamType === 'Video'));
800
800
  if (stream) {
@@ -802,7 +802,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
802
802
  }
803
803
  });
804
804
  /* @conditional-compile-remove(video-background-effects) */
805
- const onReplaceVideoBackground = (backgroundReplacementConfig) => __awaiter$F(void 0, void 0, void 0, function* () {
805
+ const onReplaceVideoBackground = (backgroundReplacementConfig) => __awaiter$E(void 0, void 0, void 0, function* () {
806
806
  const stream = (call === null || call === void 0 ? void 0 : call.localVideoStreams.find((stream) => stream.mediaStreamType === 'Video')) ||
807
807
  (deviceManager === null || deviceManager === void 0 ? void 0 : deviceManager.getUnparentedVideoStreams().find((stream) => stream.mediaStreamType === 'Video'));
808
808
  if (stream) {
@@ -846,7 +846,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
846
846
 
847
847
  // Copyright (c) Microsoft Corporation.
848
848
  // Licensed under the MIT license.
849
- var __awaiter$E = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
849
+ var __awaiter$D = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
850
850
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
851
851
  return new (P || (P = Promise))(function (resolve, reject) {
852
852
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -873,7 +873,7 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
873
873
  return callAgent ? callAgent.startCall(participants, options) : undefined;
874
874
  },
875
875
  /* @conditional-compile-remove(PSTN-calls) */
876
- onAddParticipant: (userId, options) => __awaiter$E(void 0, void 0, void 0, function* () {
876
+ onAddParticipant: (userId, options) => __awaiter$D(void 0, void 0, void 0, function* () {
877
877
  const participant = _toCommunicationIdentifier(userId);
878
878
  if (communicationCommon.isPhoneNumberIdentifier(participant)) {
879
879
  call === null || call === void 0 ? void 0 : call.addParticipant(participant, options);
@@ -881,7 +881,7 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
881
881
  else if (communicationCommon.isCommunicationUserIdentifier(participant) || communicationCommon.isMicrosoftTeamsUserIdentifier(participant)) {
882
882
  call === null || call === void 0 ? void 0 : call.addParticipant(participant);
883
883
  }
884
- }), onRemoveParticipant: (userId) => __awaiter$E(void 0, void 0, void 0, function* () {
884
+ }), onRemoveParticipant: (userId) => __awaiter$D(void 0, void 0, void 0, function* () {
885
885
  const participant = _toCommunicationIdentifier(userId);
886
886
  yield (call === null || call === void 0 ? void 0 : call.removeParticipant(participant));
887
887
  }) });
@@ -889,7 +889,7 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
889
889
 
890
890
  // Copyright (c) Microsoft Corporation.
891
891
  // Licensed under the MIT license.
892
- var __awaiter$D = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
892
+ var __awaiter$C = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
893
893
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
894
894
  return new (P || (P = Promise))(function (resolve, reject) {
895
895
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -921,7 +921,7 @@ const createDefaultTeamsCallingHandlers = memoizeOne__default['default']((callCl
921
921
  },
922
922
  /* @conditional-compile-remove(teams-identity-support) */
923
923
  /* @conditional-compile-remove(PSTN-calls) */
924
- onAddParticipant: (userId, options) => __awaiter$D(void 0, void 0, void 0, function* () {
924
+ onAddParticipant: (userId, options) => __awaiter$C(void 0, void 0, void 0, function* () {
925
925
  const participant = _toCommunicationIdentifier(userId);
926
926
  /* @conditional-compile-remove(teams-identity-support) */
927
927
  const threadId = options === null || options === void 0 ? void 0 : options.threadId;
@@ -934,7 +934,7 @@ const createDefaultTeamsCallingHandlers = memoizeOne__default['default']((callCl
934
934
  }
935
935
  /* @conditional-compile-remove(teams-identity-support) */
936
936
  call === null || call === void 0 ? void 0 : call.addParticipant(participant);
937
- }), onRemoveParticipant: (userId) => __awaiter$D(void 0, void 0, void 0, function* () {
937
+ }), onRemoveParticipant: (userId) => __awaiter$C(void 0, void 0, void 0, function* () {
938
938
  const participant = _toCommunicationIdentifier(userId);
939
939
  if (communicationCommon.isCommunicationUserIdentifier(participant)) {
940
940
  throw new Error('CommunicationIdentifier in Teams call is not supported!');
@@ -946,7 +946,7 @@ const createDefaultTeamsCallingHandlers = memoizeOne__default['default']((callCl
946
946
 
947
947
  // Copyright (c) Microsoft Corporation.
948
948
  // Licensed under the MIT license.
949
- var __awaiter$C = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
949
+ var __awaiter$B = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
950
950
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
951
951
  return new (P || (P = Promise))(function (resolve, reject) {
952
952
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -995,13 +995,13 @@ class ProxyDeviceManager {
995
995
  this.selectCamera = (videoDeviceInfo) => {
996
996
  this._context.setDeviceManagerSelectedCamera(videoDeviceInfo);
997
997
  };
998
- this.videoDevicesUpdated = () => __awaiter$C(this, void 0, void 0, function* () {
998
+ this.videoDevicesUpdated = () => __awaiter$B(this, void 0, void 0, function* () {
999
999
  // Device Manager always has a camera with '' name if there are no real camera devices available.
1000
1000
  // We don't want to show that in the UI.
1001
1001
  const realCameras = (yield this._deviceManager.getCameras()).filter((c) => !!c.name);
1002
1002
  this._context.setDeviceManagerCameras(dedupeById(realCameras));
1003
1003
  });
1004
- this.audioDevicesUpdated = () => __awaiter$C(this, void 0, void 0, function* () {
1004
+ this.audioDevicesUpdated = () => __awaiter$B(this, void 0, void 0, function* () {
1005
1005
  this._context.setDeviceManagerMicrophones(dedupeById(yield this._deviceManager.getMicrophones()));
1006
1006
  this._context.setDeviceManagerSpeakers(dedupeById(yield this._deviceManager.getSpeakers()));
1007
1007
  });
@@ -1204,7 +1204,7 @@ class CallIdHistory {
1204
1204
 
1205
1205
  // Copyright (c) Microsoft Corporation.
1206
1206
  // Licensed under the MIT license.
1207
- var __awaiter$B = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
1207
+ var __awaiter$A = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
1208
1208
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1209
1209
  return new (P || (P = Promise))(function (resolve, reject) {
1210
1210
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -1788,7 +1788,7 @@ class CallContext$2 {
1788
1788
  * @throws CallError. Exceptions thrown from `f` are tagged with the failed `target.
1789
1789
  */
1790
1790
  withAsyncErrorTeedToState(action, target) {
1791
- return (...args) => __awaiter$B(this, void 0, void 0, function* () {
1791
+ return (...args) => __awaiter$A(this, void 0, void 0, function* () {
1792
1792
  try {
1793
1793
  return yield action(...args);
1794
1794
  }
@@ -2315,7 +2315,7 @@ function _logStreamEvent(eventName, streamLogInfo, error) {
2315
2315
 
2316
2316
  // Copyright (c) Microsoft Corporation.
2317
2317
  // Licensed under the MIT license.
2318
- var __awaiter$A = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
2318
+ var __awaiter$z = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
2319
2319
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
2320
2320
  return new (P || (P = Promise))(function (resolve, reject) {
2321
2321
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -2325,7 +2325,7 @@ var __awaiter$A = (window && window.__awaiter) || function (thisArg, _arguments,
2325
2325
  });
2326
2326
  };
2327
2327
  function createViewVideo(context, internalContext, callId, stream, participantId, options) {
2328
- return __awaiter$A(this, void 0, void 0, function* () {
2328
+ return __awaiter$z(this, void 0, void 0, function* () {
2329
2329
  // we can only have 3 types of createView
2330
2330
  let streamEventType;
2331
2331
  // we will reuse these for local as well but we need to make sure the remote stream is passed in like before.
@@ -2447,7 +2447,7 @@ function createViewVideo(context, internalContext, callId, stream, participantId
2447
2447
  });
2448
2448
  }
2449
2449
  function createViewUnparentedVideo(context, internalContext, stream, options) {
2450
- return __awaiter$A(this, void 0, void 0, function* () {
2450
+ return __awaiter$z(this, void 0, void 0, function* () {
2451
2451
  const renderInfo = internalContext.getUnparentedRenderInfo(stream);
2452
2452
  if (renderInfo && renderInfo.status === 'Rendered') {
2453
2453
  console.warn('Unparented LocalVideoStream is already rendered');
@@ -2615,7 +2615,7 @@ function createView(context, internalContext, callId, participantId, stream, opt
2615
2615
  // Render LocalVideoStream that is not part of a Call
2616
2616
  // Because it is not part of the call we don't tee errors to state naturally (e.g. via a Call Client function such as startVideo).
2617
2617
  // We do not have a startLocalPreviewVideo function, so as a workaround we ensure any errors are propagated here.
2618
- return context.withAsyncErrorTeedToState(() => __awaiter$A(this, void 0, void 0, function* () { return yield createViewUnparentedVideo(context, internalContext, stream, options); }), 'Call.startVideo')();
2618
+ return context.withAsyncErrorTeedToState(() => __awaiter$z(this, void 0, void 0, function* () { return yield createViewUnparentedVideo(context, internalContext, stream, options); }), 'Call.startVideo')();
2619
2619
  }
2620
2620
  else {
2621
2621
  _logStreamEvent(EventNames.CREATE_STREAM_INVALID_PARAMS, { streamType });
@@ -3049,7 +3049,7 @@ class CallSubscriber {
3049
3049
 
3050
3050
  // Copyright (c) Microsoft Corporation.
3051
3051
  // Licensed under the MIT license.
3052
- var __awaiter$z = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3052
+ var __awaiter$y = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3053
3053
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3054
3054
  return new (P || (P = Promise))(function (resolve, reject) {
3055
3055
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -3069,14 +3069,14 @@ class ProxyIncomingCall {
3069
3069
  switch (prop) {
3070
3070
  case 'accept': {
3071
3071
  return this._context.withAsyncErrorTeedToState(function (...args) {
3072
- return __awaiter$z(this, void 0, void 0, function* () {
3072
+ return __awaiter$y(this, void 0, void 0, function* () {
3073
3073
  return yield target.accept(...args);
3074
3074
  });
3075
3075
  }, 'IncomingCall.accept');
3076
3076
  }
3077
3077
  case 'reject': {
3078
3078
  return this._context.withAsyncErrorTeedToState(function (...args) {
3079
- return __awaiter$z(this, void 0, void 0, function* () {
3079
+ return __awaiter$y(this, void 0, void 0, function* () {
3080
3080
  return yield target.reject(...args);
3081
3081
  });
3082
3082
  }, 'IncomingCall.reject');
@@ -3313,7 +3313,7 @@ const clearCallRelatedState = (context, internalContext) => {
3313
3313
 
3314
3314
  // Copyright (c) Microsoft Corporation.
3315
3315
  // Licensed under the MIT license.
3316
- var __awaiter$y = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3316
+ var __awaiter$x = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3317
3317
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3318
3318
  return new (P || (P = Promise))(function (resolve, reject) {
3319
3319
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -3339,56 +3339,56 @@ class ProxyCallCommon {
3339
3339
  switch (prop) {
3340
3340
  case 'mute': {
3341
3341
  return this._context.withAsyncErrorTeedToState(function (...args) {
3342
- return __awaiter$y(this, void 0, void 0, function* () {
3342
+ return __awaiter$x(this, void 0, void 0, function* () {
3343
3343
  return yield target.mute(...args);
3344
3344
  });
3345
3345
  }, 'Call.mute');
3346
3346
  }
3347
3347
  case 'unmute': {
3348
3348
  return this._context.withAsyncErrorTeedToState(function (...args) {
3349
- return __awaiter$y(this, void 0, void 0, function* () {
3349
+ return __awaiter$x(this, void 0, void 0, function* () {
3350
3350
  return yield target.unmute(...args);
3351
3351
  });
3352
3352
  }, 'Call.unmute');
3353
3353
  }
3354
3354
  case 'startVideo': {
3355
3355
  return this._context.withAsyncErrorTeedToState(function (...args) {
3356
- return __awaiter$y(this, void 0, void 0, function* () {
3356
+ return __awaiter$x(this, void 0, void 0, function* () {
3357
3357
  return yield target.startVideo(...args);
3358
3358
  });
3359
3359
  }, 'Call.startVideo');
3360
3360
  }
3361
3361
  case 'stopVideo': {
3362
3362
  return this._context.withAsyncErrorTeedToState(function (...args) {
3363
- return __awaiter$y(this, void 0, void 0, function* () {
3363
+ return __awaiter$x(this, void 0, void 0, function* () {
3364
3364
  return yield target.stopVideo(...args);
3365
3365
  });
3366
3366
  }, 'Call.stopVideo');
3367
3367
  }
3368
3368
  case 'startScreenSharing': {
3369
3369
  return this._context.withAsyncErrorTeedToState(function (...args) {
3370
- return __awaiter$y(this, void 0, void 0, function* () {
3370
+ return __awaiter$x(this, void 0, void 0, function* () {
3371
3371
  return yield target.startScreenSharing(...args);
3372
3372
  });
3373
3373
  }, 'Call.startScreenSharing');
3374
3374
  }
3375
3375
  case 'stopScreenSharing': {
3376
3376
  return this._context.withAsyncErrorTeedToState(function (...args) {
3377
- return __awaiter$y(this, void 0, void 0, function* () {
3377
+ return __awaiter$x(this, void 0, void 0, function* () {
3378
3378
  return yield target.stopScreenSharing(...args);
3379
3379
  });
3380
3380
  }, 'Call.stopScreenSharing');
3381
3381
  }
3382
3382
  case 'hold': {
3383
3383
  return this._context.withAsyncErrorTeedToState(function (...args) {
3384
- return __awaiter$y(this, void 0, void 0, function* () {
3384
+ return __awaiter$x(this, void 0, void 0, function* () {
3385
3385
  return yield target.hold(...args);
3386
3386
  });
3387
3387
  }, 'Call.hold');
3388
3388
  }
3389
3389
  case 'resume': {
3390
3390
  return this._context.withAsyncErrorTeedToState(function (...args) {
3391
- return __awaiter$y(this, void 0, void 0, function* () {
3391
+ return __awaiter$x(this, void 0, void 0, function* () {
3392
3392
  return yield target.resume(...args);
3393
3393
  });
3394
3394
  }, 'Call.resume');
@@ -3401,7 +3401,7 @@ class ProxyCallCommon {
3401
3401
 
3402
3402
  // Copyright (c) Microsoft Corporation.
3403
3403
  // Licensed under the MIT license.
3404
- var __awaiter$x = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3404
+ var __awaiter$w = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3405
3405
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3406
3406
  return new (P || (P = Promise))(function (resolve, reject) {
3407
3407
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -3415,7 +3415,7 @@ class ProxyCall extends ProxyCallCommon {
3415
3415
  switch (prop) {
3416
3416
  case 'addParticipant': {
3417
3417
  return this.getContext().withAsyncErrorTeedToState(function (...args) {
3418
- return __awaiter$x(this, void 0, void 0, function* () {
3418
+ return __awaiter$w(this, void 0, void 0, function* () {
3419
3419
  return yield target.addParticipant(...args);
3420
3420
  });
3421
3421
  }, 'Call.addParticipant');
@@ -3636,7 +3636,7 @@ class InternalCallContext {
3636
3636
 
3637
3637
  // Copyright (c) Microsoft Corporation.
3638
3638
  // Licensed under the MIT license.
3639
- var __awaiter$w = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3639
+ var __awaiter$v = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3640
3640
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3641
3641
  return new (P || (P = Promise))(function (resolve, reject) {
3642
3642
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -3651,7 +3651,7 @@ class ProxyTeamsCall extends ProxyCallCommon {
3651
3651
  switch (prop) {
3652
3652
  case 'addParticipant': {
3653
3653
  return this.getContext().withAsyncErrorTeedToState(function (...args) {
3654
- return __awaiter$w(this, void 0, void 0, function* () {
3654
+ return __awaiter$v(this, void 0, void 0, function* () {
3655
3655
  return yield target.addParticipant(...args);
3656
3656
  });
3657
3657
  }, 'TeamsCall.addParticipant');
@@ -3766,7 +3766,7 @@ const teamsCallAgentDeclaratify = (callAgent, context, internalContext) => {
3766
3766
 
3767
3767
  // Copyright (c) Microsoft Corporation.
3768
3768
  // Licensed under the MIT license.
3769
- var __awaiter$v = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3769
+ var __awaiter$u = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3770
3770
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3771
3771
  return new (P || (P = Promise))(function (resolve, reject) {
3772
3772
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -3788,7 +3788,7 @@ class ProxyVideoStreamRendererView {
3788
3788
  get(target, prop) {
3789
3789
  switch (prop) {
3790
3790
  case 'updateScalingMode': {
3791
- return (...args) => __awaiter$v(this, void 0, void 0, function* () {
3791
+ return (...args) => __awaiter$u(this, void 0, void 0, function* () {
3792
3792
  yield target.updateScalingMode(...args);
3793
3793
  this._context.setRemoteVideoStreamViewScalingMode(this._callId, this._participantId, this._streamId, args[0]);
3794
3794
  });
@@ -3809,7 +3809,7 @@ const videoStreamRendererViewDeclaratify = (view, context, callId, participantId
3809
3809
 
3810
3810
  // Copyright (c) Microsoft Corporation.
3811
3811
  // Licensed under the MIT license.
3812
- var __awaiter$u = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3812
+ var __awaiter$t = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3813
3813
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3814
3814
  return new (P || (P = Promise))(function (resolve, reject) {
3815
3815
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -3831,7 +3831,7 @@ class ProxyCallClient {
3831
3831
  get(target, prop) {
3832
3832
  switch (prop) {
3833
3833
  case 'createCallAgent': {
3834
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$u(this, void 0, void 0, function* () {
3834
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$t(this, void 0, void 0, function* () {
3835
3835
  // createCallAgent will throw an exception if the previous callAgent was not disposed. If the previous
3836
3836
  // callAgent was disposed then it would have unsubscribed to events so we can just create a new declarative
3837
3837
  // callAgent if the createCallAgent succeeds.
@@ -3844,7 +3844,7 @@ class ProxyCallClient {
3844
3844
  }), 'CallClient.createCallAgent');
3845
3845
  }
3846
3846
  case 'createTeamsCallAgent': {
3847
- /* @conditional-compile-remove(teams-identity-support) */ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$u(this, void 0, void 0, function* () {
3847
+ /* @conditional-compile-remove(teams-identity-support) */ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$t(this, void 0, void 0, function* () {
3848
3848
  // createCallAgent will throw an exception if the previous callAgent was not disposed. If the previous
3849
3849
  // callAgent was disposed then it would have unsubscribed to events so we can just create a new declarative
3850
3850
  // callAgent if the createCallAgent succeeds.
@@ -3857,7 +3857,7 @@ class ProxyCallClient {
3857
3857
  }), 'CallClient.createTeamsCallAgent');
3858
3858
  }
3859
3859
  case 'getDeviceManager': {
3860
- return this._context.withAsyncErrorTeedToState(() => __awaiter$u(this, void 0, void 0, function* () {
3860
+ return this._context.withAsyncErrorTeedToState(() => __awaiter$t(this, void 0, void 0, function* () {
3861
3861
  // As of writing, the SDK always returns the same instance of DeviceManager so we keep a reference of
3862
3862
  // DeviceManager and if it does not change we return the cached DeclarativeDeviceManager. If it does not we'll
3863
3863
  // throw an error that indicate we need to fix this issue as our implementation has diverged from the SDK.
@@ -3886,7 +3886,7 @@ class ProxyCallClient {
3886
3886
  /**
3887
3887
  * add to this object if we want to proxy anything else off the DebugInfo feature object.
3888
3888
  */
3889
- return Object.assign(Object.assign({}, feature), { getEnvironmentInfo: () => __awaiter$u(this, void 0, void 0, function* () {
3889
+ return Object.assign(Object.assign({}, feature), { getEnvironmentInfo: () => __awaiter$t(this, void 0, void 0, function* () {
3890
3890
  const environmentInfo = yield feature.getEnvironmentInfo();
3891
3891
  this._context.setEnvironmentInfo(environmentInfo);
3892
3892
  return environmentInfo;
@@ -3939,7 +3939,7 @@ const createStatefulCallClientWithDeps = (callClient, context, internalContext)
3939
3939
  });
3940
3940
  Object.defineProperty(callClient, 'createView', {
3941
3941
  configurable: false,
3942
- value: (callId, participantId, stream, options) => __awaiter$u(void 0, void 0, void 0, function* () {
3942
+ value: (callId, participantId, stream, options) => __awaiter$t(void 0, void 0, void 0, function* () {
3943
3943
  const participantIdKind = participantId ? communicationCommon.getIdentifierKind(participantId) : undefined;
3944
3944
  const result = yield createView(context, internalContext, callId, participantIdKind, stream, options);
3945
3945
  // We only need to declaratify the VideoStreamRendererView object for remote participants. Because the updateScalingMode only needs to be called on remote participant stream views.
@@ -6786,6 +6786,8 @@ const preventUnwantedDismissProps = {
6786
6786
  };
6787
6787
 
6788
6788
  // Copyright (c) Microsoft Corporation.
6789
+ const processNodeDefinitions = new htmlToReact.ProcessNodeDefinitions(React__default['default']);
6790
+ const isValidNode = () => true;
6789
6791
  /** @private */
6790
6792
  const ChatMessageContent = (props) => {
6791
6793
  switch (props.message.contentType) {
@@ -6806,9 +6808,8 @@ const MessageContentWithLiveAria = (props) => {
6806
6808
  props.content));
6807
6809
  };
6808
6810
  const MessageContentAsRichTextHTML = (props) => {
6809
- const htmlToReactParser = new htmlToReact.Parser();
6810
6811
  const liveAuthor = _formatString(props.strings.liveAuthorIntro, { author: `${props.message.senderDisplayName}` });
6811
- return (React__default['default'].createElement(MessageContentWithLiveAria, { message: props.message, liveMessage: `${props.message.mine ? '' : liveAuthor} ${extractContent(props.message.content || '')}`, ariaLabel: messageContentAriaText(props), content: htmlToReactParser.parse(props.message.content) }));
6812
+ return (React__default['default'].createElement(MessageContentWithLiveAria, { message: props.message, liveMessage: `${props.message.mine ? '' : liveAuthor} ${extractContent(props.message.content || '')}`, ariaLabel: messageContentAriaText(props), content: processHtmlToReact(props) }));
6812
6813
  };
6813
6814
  const MessageContentAsText = (props) => {
6814
6815
  const liveAuthor = _formatString(props.strings.liveAuthorIntro, { author: `${props.message.senderDisplayName}` });
@@ -6857,6 +6858,56 @@ const messageContentAriaText = (props) => {
6857
6858
  })
6858
6859
  : undefined;
6859
6860
  };
6861
+ const processHtmlToReact = (props) => {
6862
+ const htmlToReactParser = new htmlToReact.Parser();
6863
+ /* @conditional-compile-remove(teams-inline-images) */
6864
+ const processInlineImage = {
6865
+ // Custom <img> processing
6866
+ shouldProcessNode: (node) => {
6867
+ var _a;
6868
+ // Process img node with id in attachments list
6869
+ return (node.name &&
6870
+ node.name === 'img' &&
6871
+ node.attribs &&
6872
+ node.attribs.id &&
6873
+ ((_a = props.message.attachedFilesMetadata) === null || _a === void 0 ? void 0 : _a.find((f) => f.id === node.attribs.id)));
6874
+ },
6875
+ processNode: (node, children, index) => {
6876
+ var _a;
6877
+ // logic to check id in map/list
6878
+ const fileMetadata = (_a = props.message.attachedFilesMetadata) === null || _a === void 0 ? void 0 : _a.find((f) => f.id === node.attribs.id);
6879
+ // if in cache, early return
6880
+ if (props.attachmentsMap && node.attribs.id in props.attachmentsMap) {
6881
+ node.attribs = Object.assign(Object.assign({}, node.attribs), { src: props.attachmentsMap[node.attribs.id] });
6882
+ return processNodeDefinitions.processDefaultNode(node, children, index);
6883
+ }
6884
+ // not yet in cache
6885
+ if (fileMetadata && props.onFetchAttachment && props.attachmentsMap) {
6886
+ props.onFetchAttachment(fileMetadata);
6887
+ if (node.attribs.id in props.attachmentsMap) {
6888
+ node.attribs = Object.assign(Object.assign({}, node.attribs), { src: props.attachmentsMap[node.attribs.id] });
6889
+ }
6890
+ }
6891
+ return processNodeDefinitions.processDefaultNode(node, children, index);
6892
+ }
6893
+ };
6894
+ const addProcessingStep = () => {
6895
+ const steps = [];
6896
+ /* @conditional-compile-remove(teams-inline-images) */
6897
+ steps.push(processInlineImage);
6898
+ return steps;
6899
+ };
6900
+ const processingInstructions = [
6901
+ ...addProcessingStep(),
6902
+ {
6903
+ shouldProcessNode: () => {
6904
+ return true;
6905
+ },
6906
+ processNode: processNodeDefinitions.processDefaultNode
6907
+ }
6908
+ ];
6909
+ return htmlToReactParser.parseWithInstructions(props.message.content, isValidNode, processingInstructions);
6910
+ };
6860
6911
 
6861
6912
  // Copyright (c) Microsoft Corporation.
6862
6913
  /**
@@ -6890,7 +6941,7 @@ const chatMessageActionMenuProps = (menuProps) => {
6890
6941
  return actionMenuProps;
6891
6942
  };
6892
6943
 
6893
- var __awaiter$t = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
6944
+ var __awaiter$s = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
6894
6945
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
6895
6946
  return new (P || (P = Promise))(function (resolve, reject) {
6896
6947
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -6915,7 +6966,7 @@ const _FileDownloadCards = (props) => {
6915
6966
  var _a, _b;
6916
6967
  return (_b = (_a = props.strings) === null || _a === void 0 ? void 0 : _a.downloadFile) !== null && _b !== void 0 ? _b : localeStrings.downloadFile;
6917
6968
  }, [(_a = props.strings) === null || _a === void 0 ? void 0 : _a.downloadFile, localeStrings.downloadFile]);
6918
- const fileDownloadHandler = React.useCallback((userId, file) => __awaiter$t(void 0, void 0, void 0, function* () {
6969
+ const fileDownloadHandler = React.useCallback((userId, file) => __awaiter$s(void 0, void 0, void 0, function* () {
6919
6970
  if (!props.downloadHandler) {
6920
6971
  window.open(file.url, '_blank', 'noopener,noreferrer');
6921
6972
  }
@@ -7053,7 +7104,11 @@ const MessageBubble = (props) => {
7053
7104
  React__default['default'].createElement(BlockedMessageContent, { message: message, strings: strings })));
7054
7105
  }
7055
7106
  return (React__default['default'].createElement("div", { tabIndex: 0 },
7056
- React__default['default'].createElement(ChatMessageContent, { message: message, strings: strings }),
7107
+ React__default['default'].createElement(ChatMessageContent, { message: message, strings: strings,
7108
+ /* @conditional-compile-remove(teams-inline-images) */
7109
+ onFetchAttachment: props.onFetchAttachments,
7110
+ /* @conditional-compile-remove(teams-inline-images) */
7111
+ attachmentsMap: props.attachmentsMap }),
7057
7112
  props.onRenderFileDownloads ? props.onRenderFileDownloads(userId, message) : defaultOnRenderFileDownloads()));
7058
7113
  }, [defaultOnRenderFileDownloads, message, props, strings, userId]);
7059
7114
  const chatMessage = (React__default['default'].createElement(React__default['default'].Fragment, null,
@@ -7080,7 +7135,7 @@ const ChatMessageComponentAsMessageBubble = React__default['default'].memo(Messa
7080
7135
 
7081
7136
  // Copyright (c) Microsoft Corporation.
7082
7137
  // Licensed under the MIT license.
7083
- var __awaiter$s = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
7138
+ var __awaiter$r = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
7084
7139
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
7085
7140
  return new (P || (P = Promise))(function (resolve, reject) {
7086
7141
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -7112,7 +7167,7 @@ const ChatMessageComponent = (props) => {
7112
7167
  onSendMessage && onSendMessage(content !== undefined ? content : '');
7113
7168
  }, [clientMessageId, content, onSendMessage, onDeleteMessage]);
7114
7169
  if (isEditing && message.messageType === 'chat') {
7115
- return (React__default['default'].createElement(ChatMessageComponentAsEditBox, { message: message, inlineEditButtons: props.inlineAcceptRejectEditButtons, strings: props.strings, onSubmit: (text, metadata, options) => __awaiter$s(void 0, void 0, void 0, function* () {
7170
+ return (React__default['default'].createElement(ChatMessageComponentAsEditBox, { message: message, inlineEditButtons: props.inlineAcceptRejectEditButtons, strings: props.strings, onSubmit: (text, metadata, options) => __awaiter$r(void 0, void 0, void 0, function* () {
7116
7171
  props.onUpdateMessage &&
7117
7172
  message.messageId &&
7118
7173
  (yield props.onUpdateMessage(message.messageId, text, metadata, options));
@@ -7125,7 +7180,11 @@ const ChatMessageComponent = (props) => {
7125
7180
  else {
7126
7181
  return (React__default['default'].createElement(ChatMessageComponentAsMessageBubble, Object.assign({}, props, { onRemoveClick: onRemoveClick, onEditClick: onEditClick, onResendClick: onResendClick, onRenderAvatar: props.onRenderAvatar,
7127
7182
  /* @conditional-compile-remove(date-time-customization) */
7128
- onDisplayDateTimeString: props.onDisplayDateTimeString, strings: props.strings })));
7183
+ onDisplayDateTimeString: props.onDisplayDateTimeString, strings: props.strings,
7184
+ /* @conditional-compile-remove(teams-inline-images) */
7185
+ onFetchAttachments: props.onFetchAttachments,
7186
+ /* @conditional-compile-remove(teams-inline-images) */
7187
+ attachmentsMap: props.attachmentsMap })));
7129
7188
  }
7130
7189
  };
7131
7190
 
@@ -7219,7 +7278,7 @@ var getParticipantsWhoHaveReadMessage = (message, readReceiptsBySenderId) => {
7219
7278
 
7220
7279
  // Copyright (c) Microsoft Corporation.
7221
7280
  // Licensed under the MIT license.
7222
- var __awaiter$r = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
7281
+ var __awaiter$q = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
7223
7282
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
7224
7283
  return new (P || (P = Promise))(function (resolve, reject) {
7225
7284
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -7417,7 +7476,9 @@ const MessageThread = (props) => {
7417
7476
  var _a;
7418
7477
  const { messages: newMessages, userId, participantCount, readReceiptsBySenderId, styles, disableJumpToNewMessageButton = false, showMessageDate = false, showMessageStatus = false, numberOfChatMessagesToReload = 5, onMessageSeen, onRenderMessageStatus, onRenderAvatar, onLoadPreviousChatMessages, onRenderJumpToNewMessageButton, onRenderMessage, onUpdateMessage, onCancelMessageEdit, onDeleteMessage, onSendMessage,
7419
7478
  /* @conditional-compile-remove(date-time-customization) */
7420
- onDisplayDateTimeString } = props;
7479
+ onDisplayDateTimeString,
7480
+ /* @conditional-compile-remove(teams-inline-images) */
7481
+ onFetchAttachments } = props;
7421
7482
  const onRenderFileDownloads = onRenderFileDownloadsTrampoline(props);
7422
7483
  const [messages, setMessages] = React.useState([]);
7423
7484
  // We need this state to wait for one tick and scroll to bottom after messages have been initialized.
@@ -7434,6 +7495,16 @@ const MessageThread = (props) => {
7434
7495
  const [lastSendingChatMessage, setLastSendingChatMessage] = React.useState(undefined);
7435
7496
  // readCount and participantCount will only need to be updated on-fly when user hover on an indicator
7436
7497
  const [readCountForHoveredIndicator, setReadCountForHoveredIndicator] = React.useState(undefined);
7498
+ /* @conditional-compile-remove(teams-inline-images) */
7499
+ const [inlineAttachments, setInlineAttachments] = React.useState({});
7500
+ /* @conditional-compile-remove(teams-inline-images) */
7501
+ const onFetchInlineAttachment = React.useCallback((attachment) => __awaiter$q(void 0, void 0, void 0, function* () {
7502
+ if (!onFetchAttachments || attachment.id in inlineAttachments) {
7503
+ return;
7504
+ }
7505
+ const attachmentDownloadResult = yield onFetchAttachments(attachment);
7506
+ setInlineAttachments((prev) => (Object.assign(Object.assign({}, prev), { [attachment.id]: attachmentDownloadResult.blobUrl })));
7507
+ }), [inlineAttachments, onFetchAttachments]);
7437
7508
  const isAllChatMessagesLoadedRef = React.useRef(false);
7438
7509
  // isAllChatMessagesLoadedRef needs to be updated every time when a new adapter is set in order to display correct data
7439
7510
  // onLoadPreviousChatMessages is updated when a new adapter is set
@@ -7469,7 +7540,7 @@ const MessageThread = (props) => {
7469
7540
  setChatMessagesInitialized(chatMessagesInitialized);
7470
7541
  };
7471
7542
  // we try to only send those message status if user is scrolled to the bottom.
7472
- const sendMessageStatusIfAtBottom = React.useCallback(() => __awaiter$r(void 0, void 0, void 0, function* () {
7543
+ const sendMessageStatusIfAtBottom = React.useCallback(() => __awaiter$q(void 0, void 0, void 0, function* () {
7473
7544
  if (!isAtBottomOfScrollRef.current ||
7474
7545
  !document.hasFocus() ||
7475
7546
  !messagesRef.current ||
@@ -7520,7 +7591,7 @@ const MessageThread = (props) => {
7520
7591
  setIsAtBottomOfScrollRef(atBottom);
7521
7592
  }, [scrollToBottom, sendMessageStatusIfAtBottom]);
7522
7593
  // Infinite scrolling + threadInitialize function
7523
- const fetchNewMessageWhenAtTop = React.useCallback(() => __awaiter$r(void 0, void 0, void 0, function* () {
7594
+ const fetchNewMessageWhenAtTop = React.useCallback(() => __awaiter$q(void 0, void 0, void 0, function* () {
7524
7595
  if (!isLoadingChatMessagesRef.current) {
7525
7596
  if (onLoadPreviousChatMessages) {
7526
7597
  isLoadingChatMessagesRef.current = true;
@@ -7644,7 +7715,11 @@ const MessageThread = (props) => {
7644
7715
  /* @conditional-compile-remove(file-sharing) */
7645
7716
  strings: strings, message: messageProps.message, userId: props.userId, remoteParticipantsCount: participantCount ? participantCount - 1 : 0, inlineAcceptRejectEditButtons: !isNarrow, onRenderAvatar: onRenderAvatar, showMessageStatus: showMessageStatus, messageStatus: messageProps.message.status, onActionButtonClick: onActionButtonClickMemo,
7646
7717
  /* @conditional-compile-remove(date-time-customization) */
7647
- onDisplayDateTimeString: onDisplayDateTimeString })));
7718
+ onDisplayDateTimeString: onDisplayDateTimeString,
7719
+ /* @conditional-compile-remove(teams-inline-images) */
7720
+ onFetchAttachments: onFetchInlineAttachment,
7721
+ /* @conditional-compile-remove(teams-inline-images) */
7722
+ attachmentsMap: inlineAttachments })));
7648
7723
  }
7649
7724
  return React__default['default'].createElement(React__default['default'].Fragment, null);
7650
7725
  }, [
@@ -7658,7 +7733,11 @@ const MessageThread = (props) => {
7658
7733
  showMessageStatus,
7659
7734
  onActionButtonClickMemo,
7660
7735
  /* @conditional-compile-remove(date-time-customization) */
7661
- onDisplayDateTimeString
7736
+ onDisplayDateTimeString,
7737
+ /* @conditional-compile-remove(teams-inline-images) */
7738
+ onFetchInlineAttachment,
7739
+ /* @conditional-compile-remove(teams-inline-images) */
7740
+ inlineAttachments
7662
7741
  ]);
7663
7742
  const defaultStatusRenderer = React.useCallback((message, status, participantCount, readCount) => {
7664
7743
  const onToggleToolTip = (isToggled) => {
@@ -11843,7 +11922,7 @@ const DevicesButton = (props) => {
11843
11922
 
11844
11923
  // Copyright (c) Microsoft Corporation.
11845
11924
  // Licensed under the MIT license.
11846
- var __awaiter$q = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
11925
+ var __awaiter$p = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
11847
11926
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
11848
11927
  return new (P || (P = Promise))(function (resolve, reject) {
11849
11928
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -11881,7 +11960,7 @@ const CameraButton = (props) => {
11881
11960
  const toggleAnnouncerString = React.useCallback((isCameraOn) => {
11882
11961
  setAnnouncerString(!isCameraOn ? strings.cameraActionTurnedOffAnnouncement : strings.cameraActionTurnedOnAnnouncement);
11883
11962
  }, [strings.cameraActionTurnedOffAnnouncement, strings.cameraActionTurnedOnAnnouncement]);
11884
- const onToggleClick = React.useCallback(() => __awaiter$q(void 0, void 0, void 0, function* () {
11963
+ const onToggleClick = React.useCallback(() => __awaiter$p(void 0, void 0, void 0, function* () {
11885
11964
  // Throttle click on camera, need to await onToggleCamera then allow another click
11886
11965
  if (onToggleCamera) {
11887
11966
  setWaitForCamera(true);
@@ -12049,7 +12128,7 @@ const lightThemeCallButtonStyles = {
12049
12128
 
12050
12129
  // Copyright (c) Microsoft Corporation.
12051
12130
  // Licensed under the MIT license.
12052
- var __awaiter$p = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
12131
+ var __awaiter$o = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
12053
12132
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
12054
12133
  return new (P || (P = Promise))(function (resolve, reject) {
12055
12134
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -12090,7 +12169,7 @@ const MicrophoneButton = (props) => {
12090
12169
  const toggleAnnouncerString = React.useCallback((isMicOn) => {
12091
12170
  setAnnouncerString(!isMicOn ? strings.microphoneActionTurnedOffAnnouncement : strings.microphoneActionTurnedOnAnnouncement);
12092
12171
  }, [strings.microphoneActionTurnedOffAnnouncement, strings.microphoneActionTurnedOnAnnouncement]);
12093
- const onToggleClick = React.useCallback(() => __awaiter$p(void 0, void 0, void 0, function* () {
12172
+ const onToggleClick = React.useCallback(() => __awaiter$o(void 0, void 0, void 0, function* () {
12094
12173
  if (onToggleMicrophone) {
12095
12174
  try {
12096
12175
  yield onToggleMicrophone();
@@ -12978,7 +13057,7 @@ const formatPhoneNumber = (phoneNumber) => {
12978
13057
 
12979
13058
  // Copyright (c) Microsoft Corporation.
12980
13059
  // Licensed under the MIT license.
12981
- var __awaiter$o = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
13060
+ var __awaiter$n = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
12982
13061
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
12983
13062
  return new (P || (P = Promise))(function (resolve, reject) {
12984
13063
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -13020,10 +13099,10 @@ const DialpadButton = (props) => {
13020
13099
  const theme = react.useTheme();
13021
13100
  const { digit, index, onClick, onLongPress, isMobile = false } = props;
13022
13101
  const useLongPressProps = React__default['default'].useMemo(() => ({
13023
- onClick: () => __awaiter$o(void 0, void 0, void 0, function* () {
13102
+ onClick: () => __awaiter$n(void 0, void 0, void 0, function* () {
13024
13103
  onClick(digit, index);
13025
13104
  }),
13026
- onLongPress: () => __awaiter$o(void 0, void 0, void 0, function* () {
13105
+ onLongPress: () => __awaiter$n(void 0, void 0, void 0, function* () {
13027
13106
  onLongPress(digit, index);
13028
13107
  }),
13029
13108
  touchEventsOnly: isMobile
@@ -14101,7 +14180,7 @@ const findConditionalCompiledSelector = (component) => {
14101
14180
 
14102
14181
  // Copyright (c) Microsoft Corporation.
14103
14182
  // Licensed under the MIT license.
14104
- var __awaiter$n = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
14183
+ var __awaiter$m = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
14105
14184
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14106
14185
  return new (P || (P = Promise))(function (resolve, reject) {
14107
14186
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -14124,35 +14203,35 @@ const createDefaultChatHandlers = memoizeOne__default['default']((chatClient, ch
14124
14203
  let messageIterator = undefined;
14125
14204
  let readReceiptIterator = undefined;
14126
14205
  return {
14127
- onSendMessage: (content, options) => __awaiter$n(void 0, void 0, void 0, function* () {
14206
+ onSendMessage: (content, options) => __awaiter$m(void 0, void 0, void 0, function* () {
14128
14207
  const sendMessageRequest = {
14129
14208
  content,
14130
14209
  senderDisplayName: chatClient.getState().displayName
14131
14210
  };
14132
14211
  yield chatThreadClient.sendMessage(sendMessageRequest, options);
14133
14212
  }),
14134
- onUpdateMessage: (messageId, content, metadata, options) => __awaiter$n(void 0, void 0, void 0, function* () {
14213
+ onUpdateMessage: (messageId, content, metadata, options) => __awaiter$m(void 0, void 0, void 0, function* () {
14135
14214
  const updatedMetadata = metadata ? Object.assign({}, metadata) : {};
14136
14215
  updatedMetadata['fileSharingMetadata'] = JSON.stringify((options === null || options === void 0 ? void 0 : options.attachedFilesMetadata) || []);
14137
14216
  yield chatThreadClient.updateMessage(messageId, { content, metadata: updatedMetadata });
14138
14217
  }),
14139
- onDeleteMessage: (messageId) => __awaiter$n(void 0, void 0, void 0, function* () {
14218
+ onDeleteMessage: (messageId) => __awaiter$m(void 0, void 0, void 0, function* () {
14140
14219
  yield chatThreadClient.deleteMessage(messageId);
14141
14220
  }),
14142
14221
  // This handler is designed for chatThread to consume
14143
- onMessageSeen: (chatMessageId) => __awaiter$n(void 0, void 0, void 0, function* () {
14222
+ onMessageSeen: (chatMessageId) => __awaiter$m(void 0, void 0, void 0, function* () {
14144
14223
  yield chatThreadClient.sendReadReceipt({ chatMessageId });
14145
14224
  }),
14146
- onTyping: () => __awaiter$n(void 0, void 0, void 0, function* () {
14225
+ onTyping: () => __awaiter$m(void 0, void 0, void 0, function* () {
14147
14226
  yield chatThreadClient.sendTypingNotification();
14148
14227
  }),
14149
- onRemoveParticipant: (userId) => __awaiter$n(void 0, void 0, void 0, function* () {
14228
+ onRemoveParticipant: (userId) => __awaiter$m(void 0, void 0, void 0, function* () {
14150
14229
  yield chatThreadClient.removeParticipant(fromFlatCommunicationIdentifier(userId));
14151
14230
  }),
14152
- updateThreadTopicName: (topicName) => __awaiter$n(void 0, void 0, void 0, function* () {
14231
+ updateThreadTopicName: (topicName) => __awaiter$m(void 0, void 0, void 0, function* () {
14153
14232
  yield chatThreadClient.updateTopic(topicName);
14154
14233
  }),
14155
- onLoadPreviousChatMessages: (messagesToLoad) => __awaiter$n(void 0, void 0, void 0, function* () {
14234
+ onLoadPreviousChatMessages: (messagesToLoad) => __awaiter$m(void 0, void 0, void 0, function* () {
14156
14235
  var _a, _b, _c;
14157
14236
  if (messageIterator === undefined) {
14158
14237
  // Lazy definition so that errors in the method call are reported correctly.
@@ -14924,7 +15003,7 @@ const chatStatefulLogger = logger.createClientLogger('communication-react:chat-s
14924
15003
 
14925
15004
  // Copyright (c) Microsoft Corporation.
14926
15005
  // Licensed under the MIT license.
14927
- var __awaiter$m = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
15006
+ var __awaiter$l = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
14928
15007
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14929
15008
  return new (P || (P = Promise))(function (resolve, reject) {
14930
15009
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -15199,7 +15278,7 @@ class ChatContext$1 {
15199
15278
  * @throws ChatError. Exceptions thrown from `f` are tagged with the failed `target.
15200
15279
  */
15201
15280
  withAsyncErrorTeedToState(f, target) {
15202
- return (...args) => __awaiter$m(this, void 0, void 0, function* () {
15281
+ return (...args) => __awaiter$l(this, void 0, void 0, function* () {
15203
15282
  try {
15204
15283
  return yield f(...args);
15205
15284
  }
@@ -15311,7 +15390,7 @@ const convertChatMessage = (message, status = 'delivered', clientMessageId) => {
15311
15390
 
15312
15391
  // Copyright (c) Microsoft Corporation.
15313
15392
  // Licensed under the MIT license.
15314
- var __awaiter$l = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
15393
+ var __awaiter$k = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
15315
15394
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15316
15395
  return new (P || (P = Promise))(function (resolve, reject) {
15317
15396
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -15396,7 +15475,7 @@ class EventSubscriber {
15396
15475
  };
15397
15476
  // This is a temporary fix that no participant message is received for onChatMessageReceived event, which should be handled by JS SDK.
15398
15477
  // Without the temporary fix, there are missing 'participant joined' and 'participant left' system messages in the chat thread.
15399
- this.fetchLastParticipantMessage = (threadId, actionType) => __awaiter$l(this, void 0, void 0, function* () {
15478
+ this.fetchLastParticipantMessage = (threadId, actionType) => __awaiter$k(this, void 0, void 0, function* () {
15400
15479
  var e_1, _a;
15401
15480
  try {
15402
15481
  for (var _b = __asyncValues$1(this.chatClient
@@ -15488,7 +15567,7 @@ class EventSubscriber {
15488
15567
 
15489
15568
  // Copyright (c) Microsoft Corporation.
15490
15569
  // Licensed under the MIT license.
15491
- var __awaiter$k = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
15570
+ var __awaiter$j = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
15492
15571
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15493
15572
  return new (P || (P = Promise))(function (resolve, reject) {
15494
15573
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -15510,7 +15589,7 @@ const createDecoratedIterator = (iteratorCreator, context, decorateFn) => {
15510
15589
  const threadsIterator = iteratorCreator(...args);
15511
15590
  return {
15512
15591
  next() {
15513
- return __awaiter$k(this, void 0, void 0, function* () {
15592
+ return __awaiter$j(this, void 0, void 0, function* () {
15514
15593
  const result = yield threadsIterator.next();
15515
15594
  if (!result.done && result.value) {
15516
15595
  decorateFn(result.value, context);
@@ -15525,7 +15604,7 @@ const createDecoratedIterator = (iteratorCreator, context, decorateFn) => {
15525
15604
  const pages = threadsIterator.byPage(settings);
15526
15605
  return {
15527
15606
  next() {
15528
- return __awaiter$k(this, void 0, void 0, function* () {
15607
+ return __awaiter$j(this, void 0, void 0, function* () {
15529
15608
  const result = yield pages.next();
15530
15609
  const page = result.value;
15531
15610
  if (!result.done && result.value) {
@@ -15609,7 +15688,7 @@ const createDecoratedListParticipants = (chatThreadClient, context) => {
15609
15688
 
15610
15689
  // Copyright (c) Microsoft Corporation.
15611
15690
  // Licensed under the MIT license.
15612
- var __awaiter$j = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
15691
+ var __awaiter$i = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
15613
15692
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15614
15693
  return new (P || (P = Promise))(function (resolve, reject) {
15615
15694
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -15628,14 +15707,14 @@ class ProxyChatThreadClient {
15628
15707
  return createDecoratedListMessages(chatThreadClient, this._context);
15629
15708
  }
15630
15709
  case 'getMessage': {
15631
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$j(this, void 0, void 0, function* () {
15710
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$i(this, void 0, void 0, function* () {
15632
15711
  const message = yield chatThreadClient.getMessage(...args);
15633
15712
  this._context.setChatMessage(chatThreadClient.threadId, convertChatMessage(message));
15634
15713
  return message;
15635
15714
  }), 'ChatThreadClient.getMessage');
15636
15715
  }
15637
15716
  case 'sendMessage': {
15638
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$j(this, void 0, void 0, function* () {
15717
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$i(this, void 0, void 0, function* () {
15639
15718
  // Retry logic?
15640
15719
  const [request, options] = args;
15641
15720
  const { content } = request;
@@ -15675,7 +15754,7 @@ class ProxyChatThreadClient {
15675
15754
  }), 'ChatThreadClient.sendMessage');
15676
15755
  }
15677
15756
  case 'addParticipants': {
15678
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$j(this, void 0, void 0, function* () {
15757
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$i(this, void 0, void 0, function* () {
15679
15758
  const result = yield chatThreadClient.addParticipants(...args);
15680
15759
  const [addRequest] = args;
15681
15760
  const participantsToAdd = addRequest.participants;
@@ -15684,7 +15763,7 @@ class ProxyChatThreadClient {
15684
15763
  }), 'ChatThreadClient.addParticipants');
15685
15764
  }
15686
15765
  case 'deleteMessage': {
15687
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$j(this, void 0, void 0, function* () {
15766
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$i(this, void 0, void 0, function* () {
15688
15767
  // DeleteMessage is able to either delete local one(for failed message) or synced message
15689
15768
  const [messageId] = args;
15690
15769
  if (this._context.deleteLocalMessage(chatThreadClient.threadId, messageId)) {
@@ -15702,12 +15781,12 @@ class ProxyChatThreadClient {
15702
15781
  return createDecoratedListReadReceipts(chatThreadClient, this._context);
15703
15782
  }
15704
15783
  case 'sendTypingNotification': {
15705
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$j(this, void 0, void 0, function* () {
15784
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$i(this, void 0, void 0, function* () {
15706
15785
  return yield chatThreadClient.sendTypingNotification(...args);
15707
15786
  }), 'ChatThreadClient.sendTypingNotification');
15708
15787
  }
15709
15788
  case 'removeParticipant': {
15710
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$j(this, void 0, void 0, function* () {
15789
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$i(this, void 0, void 0, function* () {
15711
15790
  const result = yield chatThreadClient.removeParticipant(...args);
15712
15791
  const [removeIdentifier] = args;
15713
15792
  this._context.deleteParticipant(chatThreadClient.threadId, communicationCommon.getIdentifierKind(removeIdentifier));
@@ -15715,7 +15794,7 @@ class ProxyChatThreadClient {
15715
15794
  }), 'ChatThreadClient.removeParticipant');
15716
15795
  }
15717
15796
  case 'updateMessage': {
15718
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$j(this, void 0, void 0, function* () {
15797
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$i(this, void 0, void 0, function* () {
15719
15798
  const result = yield chatThreadClient.updateMessage(...args);
15720
15799
  const [messageId, updateOption] = args;
15721
15800
  this._context.updateChatMessageContent(chatThreadClient.threadId, messageId, updateOption === null || updateOption === void 0 ? void 0 : updateOption.content);
@@ -15723,7 +15802,7 @@ class ProxyChatThreadClient {
15723
15802
  }), 'ChatThreadClient.updateMessage');
15724
15803
  }
15725
15804
  case 'updateTopic': {
15726
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$j(this, void 0, void 0, function* () {
15805
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$i(this, void 0, void 0, function* () {
15727
15806
  const result = yield chatThreadClient.updateTopic(...args);
15728
15807
  const [topic] = args;
15729
15808
  this._context.updateThreadTopic(chatThreadClient.threadId, topic);
@@ -15731,7 +15810,7 @@ class ProxyChatThreadClient {
15731
15810
  }), 'ChatThreadClient.updateTopic');
15732
15811
  }
15733
15812
  case 'getProperties': {
15734
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$j(this, void 0, void 0, function* () {
15813
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$i(this, void 0, void 0, function* () {
15735
15814
  const result = yield chatThreadClient.getProperties(...args);
15736
15815
  this._context.updateThread(chatThreadClient.threadId, result);
15737
15816
  return result;
@@ -15768,7 +15847,7 @@ const createDecoratedListThreads = (chatClient, context) => {
15768
15847
 
15769
15848
  // Copyright (c) Microsoft Corporation.
15770
15849
  // Licensed under the MIT license.
15771
- var __awaiter$i = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
15850
+ var __awaiter$h = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
15772
15851
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15773
15852
  return new (P || (P = Promise))(function (resolve, reject) {
15774
15853
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -15787,7 +15866,7 @@ const proxyChatClient = {
15787
15866
  switch (prop) {
15788
15867
  case 'createChatThread': {
15789
15868
  return context.withAsyncErrorTeedToState(function (...args) {
15790
- return __awaiter$i(this, void 0, void 0, function* () {
15869
+ return __awaiter$h(this, void 0, void 0, function* () {
15791
15870
  const result = yield chatClient.createChatThread(...args);
15792
15871
  const thread = result.chatThread;
15793
15872
  if (thread) {
@@ -15800,7 +15879,7 @@ const proxyChatClient = {
15800
15879
  }
15801
15880
  case 'deleteChatThread': {
15802
15881
  return context.withAsyncErrorTeedToState(function (...args) {
15803
- return __awaiter$i(this, void 0, void 0, function* () {
15882
+ return __awaiter$h(this, void 0, void 0, function* () {
15804
15883
  const result = yield chatClient.deleteChatThread(...args);
15805
15884
  context.deleteThread(args[0]);
15806
15885
  return result;
@@ -15820,7 +15899,7 @@ const proxyChatClient = {
15820
15899
  }
15821
15900
  case 'startRealtimeNotifications': {
15822
15901
  return context.withAsyncErrorTeedToState(function (...args) {
15823
- return __awaiter$i(this, void 0, void 0, function* () {
15902
+ return __awaiter$h(this, void 0, void 0, function* () {
15824
15903
  const ret = yield chatClient.startRealtimeNotifications(...args);
15825
15904
  if (!receiver.eventSubscriber) {
15826
15905
  receiver.eventSubscriber = new EventSubscriber(chatClient, context);
@@ -15831,7 +15910,7 @@ const proxyChatClient = {
15831
15910
  }
15832
15911
  case 'stopRealtimeNotifications': {
15833
15912
  return context.withAsyncErrorTeedToState(function (...args) {
15834
- return __awaiter$i(this, void 0, void 0, function* () {
15913
+ return __awaiter$h(this, void 0, void 0, function* () {
15835
15914
  const ret = yield chatClient.stopRealtimeNotifications(...args);
15836
15915
  if (receiver.eventSubscriber) {
15837
15916
  receiver.eventSubscriber.unsubscribe();
@@ -15942,13 +16021,7 @@ class FileUpload {
15942
16021
  }
15943
16022
 
15944
16023
  // Copyright (c) Microsoft Corporation.
15945
- const CoffeeIcon = () => (React__default['default'].createElement(react.Text, { className: react.mergeStyles(coffeeIconStyle), "aria-hidden": true }, "\u2615"));
15946
- const coffeeIconStyle = {
15947
- // Fluent wraps all icons with <i> so we must force the fontStyle back to normal.
15948
- fontStyle: 'normal',
15949
- // By default our icons are 20px x 20px (for 1rem = 16px), make this a bit bigger for lobby.
15950
- fontSize: '2rem'
15951
- };
16024
+ const SpinnerIcon = () => React__default['default'].createElement(react.Spinner, { size: react.SpinnerSize.large });
15952
16025
  /**
15953
16026
  * The default set of icons used by the composites directly (i.e. not via the components defined in this library).
15954
16027
  *
@@ -15957,8 +16030,8 @@ const coffeeIconStyle = {
15957
16030
  const COMPOSITE_ONLY_ICONS = {
15958
16031
  ChevronLeft: undefined,
15959
16032
  Link: undefined,
15960
- LobbyScreenConnectingToCall: React__default['default'].createElement(CoffeeIcon, null),
15961
- LobbyScreenWaitingToBeAdmitted: React__default['default'].createElement(CoffeeIcon, null),
16033
+ LobbyScreenConnectingToCall: React__default['default'].createElement(SpinnerIcon, null),
16034
+ LobbyScreenWaitingToBeAdmitted: React__default['default'].createElement(SpinnerIcon, null),
15962
16035
  LocalDeviceSettingsCamera: React__default['default'].createElement(reactIcons.Video20Filled, null),
15963
16036
  LocalDeviceSettingsMic: React__default['default'].createElement(reactIcons.Mic20Filled, null),
15964
16037
  LocalDeviceSettingsSpeaker: React__default['default'].createElement(reactIcons.Speaker220Filled, null),
@@ -16273,16 +16346,6 @@ const uploadFileButtonStringTrampoline = () => {
16273
16346
  };
16274
16347
 
16275
16348
  // Copyright (c) Microsoft Corporation.
16276
- // Licensed under the MIT license.
16277
- var __awaiter$h = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
16278
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16279
- return new (P || (P = Promise))(function (resolve, reject) {
16280
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16281
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
16282
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
16283
- step((generator = generator.apply(thisArg, _arguments || [])).next());
16284
- });
16285
- };
16286
16349
  /* @conditional-compile-remove(file-sharing) */
16287
16350
  /**
16288
16351
  * @internal
@@ -16328,10 +16391,9 @@ class FileUploadContext {
16328
16391
  * @internal
16329
16392
  */
16330
16393
  class AzureCommunicationFileUploadAdapter {
16331
- constructor(chatContext, getAuthToken) {
16394
+ constructor(chatContext) {
16332
16395
  this.fileUploads = [];
16333
16396
  this.context = new FileUploadContext(chatContext);
16334
- this.getAuthToken = getAuthToken;
16335
16397
  }
16336
16398
  findFileUpload(id) {
16337
16399
  return this.fileUploads.find((fileUpload) => fileUpload.id === id);
@@ -16391,24 +16453,6 @@ class AzureCommunicationFileUploadAdapter {
16391
16453
  updateFileUploadMetadata(id, metadata) {
16392
16454
  this.context.updateFileUpload(id, { progress: 1, metadata });
16393
16455
  }
16394
- /* @conditional-compile-remove(teams-inline-images) */
16395
- downloadAuthenticatedAttachment(attachmentUrl) {
16396
- return __awaiter$h(this, void 0, void 0, function* () {
16397
- function fetchWithAuthentication(url, token) {
16398
- const headers = new Headers();
16399
- headers.append('Authorization', `Bearer ${token}`);
16400
- return fetch(url, { headers });
16401
- }
16402
- if (!this.getAuthToken) {
16403
- return '';
16404
- }
16405
- // ToDo InlineAttachments: If GET fails might need to send failure up to contoso
16406
- const token = yield this.getAuthToken();
16407
- const response = yield fetchWithAuthentication(attachmentUrl !== null && attachmentUrl !== void 0 ? attachmentUrl : '', token);
16408
- const blob = yield response.blob();
16409
- return URL.createObjectURL(blob);
16410
- });
16411
- }
16412
16456
  subscribeAllEvents(fileUpload) {
16413
16457
  fileUpload.on('uploadProgressChange', this.updateFileUploadProgress.bind(this));
16414
16458
  fileUpload.on('uploadComplete', this.updateFileUploadMetadata.bind(this));
@@ -16503,6 +16547,24 @@ const isCameraOn = (state) => {
16503
16547
  }
16504
16548
  return false;
16505
16549
  };
16550
+ /* @conditional-compile-remove(video-background-effects) */
16551
+ /**
16552
+ * @private
16553
+ */
16554
+ const startSelectedVideoEffect = (adapter) => __awaiter$g(void 0, void 0, void 0, function* () {
16555
+ if (adapter.getState().selectedVideoBackgroundEffect) {
16556
+ const selectedVideoBackgroundEffect = adapter.getState().selectedVideoBackgroundEffect;
16557
+ if ((selectedVideoBackgroundEffect === null || selectedVideoBackgroundEffect === void 0 ? void 0 : selectedVideoBackgroundEffect.effectName) === 'blur') {
16558
+ yield adapter.blurVideoBackground();
16559
+ }
16560
+ else if ((selectedVideoBackgroundEffect === null || selectedVideoBackgroundEffect === void 0 ? void 0 : selectedVideoBackgroundEffect.effectName) === 'none') {
16561
+ yield adapter.stopVideoBackgroundEffect();
16562
+ }
16563
+ else if ((selectedVideoBackgroundEffect === null || selectedVideoBackgroundEffect === void 0 ? void 0 : selectedVideoBackgroundEffect.effectName) === 'replacement') {
16564
+ yield adapter.replaceVideoBackground({ backgroundImageUrl: selectedVideoBackgroundEffect.backgroundImageUrl });
16565
+ }
16566
+ }
16567
+ });
16506
16568
  /**
16507
16569
  * Reduce the set of call controls visible on mobile.
16508
16570
  * For example do not show screenshare button.
@@ -16874,25 +16936,19 @@ class ChatContext {
16874
16936
  class AzureCommunicationChatAdapter {
16875
16937
  constructor(chatClient, chatThreadClient,
16876
16938
  /* @conditional-compile-remove(teams-inline-images) */ options) {
16939
+ /* @conditional-compile-remove(teams-inline-images) */
16940
+ this.credential = undefined;
16877
16941
  this.emitter = new EventEmitter__default['default']();
16878
16942
  this.bindAllPublicMethods();
16879
16943
  this.chatClient = chatClient;
16880
16944
  this.chatThreadClient = chatThreadClient;
16881
16945
  this.context = new ChatContext(chatClient.getState(), chatThreadClient.threadId);
16882
16946
  /* @conditional-compile-remove(teams-inline-images) */
16883
- const credential = options === null || options === void 0 ? void 0 : options.credential;
16884
- /* @conditional-compile-remove(file-sharing) */ /* @conditional-compile-remove(teams-inline-images) */
16885
- let getAuthToken = undefined;
16886
- /* @conditional-compile-remove(teams-inline-images) */
16887
- if (credential) {
16888
- /* @conditional-compile-remove(teams-inline-images) */
16889
- getAuthToken = () => __awaiter$f(this, void 0, void 0, function* () {
16890
- const accessToken = yield credential.getToken();
16891
- return accessToken.token;
16892
- });
16947
+ if (options && options.credential) {
16948
+ this.credential = options.credential;
16893
16949
  }
16894
16950
  /* @conditional-compile-remove(file-sharing) */ /* @conditional-compile-remove(teams-inline-images) */
16895
- this.fileUploadAdapter = new AzureCommunicationFileUploadAdapter(this.context, getAuthToken);
16951
+ this.fileUploadAdapter = new AzureCommunicationFileUploadAdapter(this.context);
16896
16952
  const onStateChange = (clientState) => {
16897
16953
  // unsubscribe when the instance gets disposed
16898
16954
  if (!this) {
@@ -17076,10 +17132,39 @@ class AzureCommunicationChatAdapter {
17076
17132
  /* @conditional-compile-remove(teams-inline-images) */
17077
17133
  downloadAuthenticatedAttachment(attachmentUrl) {
17078
17134
  return __awaiter$f(this, void 0, void 0, function* () {
17079
- if (!this.fileUploadAdapter.downloadAuthenticatedAttachment) {
17080
- return '';
17081
- }
17082
- return yield this.fileUploadAdapter.downloadAuthenticatedAttachment(attachmentUrl);
17135
+ return this.asyncTeeErrorToEventEmitter(() => __awaiter$f(this, void 0, void 0, function* () {
17136
+ if (this.credential === undefined) {
17137
+ const e = new Error();
17138
+ e['target'] = 'ChatThreadClient.getMessage';
17139
+ e['innerError'] = new Error('AccessToken is null');
17140
+ throw e;
17141
+ }
17142
+ const accessToken = yield this.credential.getToken();
17143
+ if (!accessToken) {
17144
+ const e = new Error();
17145
+ e['target'] = 'ChatThreadClient.getMessage';
17146
+ e['innerError'] = new Error('AccessToken is null');
17147
+ throw e;
17148
+ }
17149
+ function fetchWithAuthentication(url, token) {
17150
+ return __awaiter$f(this, void 0, void 0, function* () {
17151
+ const headers = new Headers();
17152
+ headers.append('Authorization', `Bearer ${token}`);
17153
+ try {
17154
+ return yield fetch(url, { headers });
17155
+ }
17156
+ catch (err) {
17157
+ const e = new Error();
17158
+ e['target'] = 'ChatThreadClient.getMessage';
17159
+ e['innerError'] = err;
17160
+ throw e;
17161
+ }
17162
+ });
17163
+ }
17164
+ const response = yield fetchWithAuthentication(attachmentUrl, accessToken.token);
17165
+ const blob = yield response.blob();
17166
+ return { blobUrl: URL.createObjectURL(blob) };
17167
+ }));
17083
17168
  });
17084
17169
  }
17085
17170
  messageReceivedListener(event) {
@@ -20577,6 +20662,7 @@ const MoreDrawer = (props) => {
20577
20662
  text: localeStrings.component.strings.holdButton.tooltipOffContent,
20578
20663
  onItemClick: () => {
20579
20664
  holdButtonProps.onToggleHold();
20665
+ onLightDismiss();
20580
20666
  },
20581
20667
  iconProps: { iconName: 'HoldCallContextualMenuItem', styles: { root: { lineHeight: 0 } } }
20582
20668
  });
@@ -20704,19 +20790,32 @@ const VideoEffectsPane = (props) => {
20704
20790
  }, [strings, props.adapter]);
20705
20791
  /* @conditional-compile-remove(video-background-effects) */
20706
20792
  const onEffectChange = React.useCallback((effectKey) => __awaiter$9(void 0, void 0, void 0, function* () {
20707
- console.log(props.adapter.getState());
20708
20793
  if (effectKey === 'blur') {
20709
- props.adapter.blurVideoBackground();
20794
+ const blurEffect = {
20795
+ effectName: effectKey
20796
+ };
20797
+ props.adapter.updateSelectedVideoBackgroundEffect(blurEffect);
20798
+ yield props.adapter.blurVideoBackground();
20710
20799
  }
20711
20800
  else if (effectKey === 'none') {
20712
- props.adapter.stopVideoBackgroundEffect();
20801
+ const noneEffect = {
20802
+ effectName: effectKey
20803
+ };
20804
+ props.adapter.updateSelectedVideoBackgroundEffect(noneEffect);
20805
+ yield props.adapter.stopVideoBackgroundEffect();
20713
20806
  }
20714
20807
  else {
20715
20808
  const backgroundImg = selectableVideoEffects.find((effect) => {
20716
20809
  return effect.key === effectKey;
20717
20810
  });
20718
20811
  if (backgroundImg && backgroundImg.backgroundProps) {
20719
- props.adapter.replaceVideoBackground({ backgroundImageUrl: backgroundImg.backgroundProps.url });
20812
+ const replaceEffect = {
20813
+ effectName: 'replacement',
20814
+ effectKey,
20815
+ backgroundImageUrl: backgroundImg.backgroundProps.url
20816
+ };
20817
+ props.adapter.updateSelectedVideoBackgroundEffect(replaceEffect);
20818
+ yield props.adapter.replaceVideoBackground({ backgroundImageUrl: backgroundImg.backgroundProps.url });
20720
20819
  }
20721
20820
  }
20722
20821
  }), [props.adapter, selectableVideoEffects]);
@@ -22300,8 +22399,8 @@ const overlayContainerStyle = {
22300
22399
  */
22301
22400
  const titleStyle = (palette, isVideoReady) => {
22302
22401
  return {
22303
- fontSize: '1.75rem',
22304
- color: isVideoReady ? 'white' : palette.neutralPrimary,
22402
+ fontSize: '1rem',
22403
+ color: isVideoReady ? 'white' : palette.blue,
22305
22404
  textAlign: 'center'
22306
22405
  };
22307
22406
  };
@@ -22309,8 +22408,8 @@ const titleStyle = (palette, isVideoReady) => {
22309
22408
  * @private
22310
22409
  */
22311
22410
  const moreDetailsStyle = (palette, isVideoReady) => ({
22312
- fontSize: '1rem',
22313
- color: isVideoReady ? 'white' : palette.neutralPrimary,
22411
+ fontSize: '0.75rem',
22412
+ color: isVideoReady ? 'white' : palette.blue,
22314
22413
  textAlign: 'center'
22315
22414
  });
22316
22415
 
@@ -22951,6 +23050,7 @@ class CallContext {
22951
23050
  /* @conditional-compile-remove(unsupported-browser) */ unsupportedBrowserVersionsAllowed: false,
22952
23051
  /* @conditional-compile-remove(rooms) */ roleHint: options === null || options === void 0 ? void 0 : options.roleHint,
22953
23052
  /* @conditional-compile-remove(video-background-effects) */ videoBackgroundImages: options === null || options === void 0 ? void 0 : options.videoBackgroundImages,
23053
+ /* @conditional-compile-remove(video-background-effects) */ selectedVideoBackgroundEffect: undefined,
22954
23054
  cameraStatus: undefined
22955
23055
  };
22956
23056
  this.emitter.setMaxListeners((_b = options === null || options === void 0 ? void 0 : options.maxListeners) !== null && _b !== void 0 ? _b : 50);
@@ -23026,6 +23126,10 @@ class CallContext {
23026
23126
  setBackroundPickerImages(videoBackgroundImages) {
23027
23127
  this.setState(Object.assign(Object.assign({}, this.state), { videoBackgroundImages }));
23028
23128
  }
23129
+ /* @conditional-compile-remove(video-background-effects) */
23130
+ setSelectedVideoBackgroundEffect(selectedVideoBackgroundEffect) {
23131
+ this.setState(Object.assign(Object.assign({}, this.state), { selectedVideoBackgroundEffect }));
23132
+ }
23029
23133
  }
23030
23134
  const findLatestEndedCall = (calls) => {
23031
23135
  var _a, _b, _c, _d;
@@ -23294,6 +23398,8 @@ class AzureCommunicationCallAdapter {
23294
23398
  return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$4(this, void 0, void 0, function* () {
23295
23399
  if (!isCameraOn(this.getState())) {
23296
23400
  yield this.handlers.onToggleCamera(options);
23401
+ /* @conditional-compile-remove(video-background-effects) */
23402
+ yield startSelectedVideoEffect(this);
23297
23403
  }
23298
23404
  }));
23299
23405
  });
@@ -23376,6 +23482,10 @@ class AzureCommunicationCallAdapter {
23376
23482
  updateBackgroundPickerImages(backgroundImages) {
23377
23483
  this.context.setBackroundPickerImages(backgroundImages);
23378
23484
  }
23485
+ /* @conditional-compile-remove(video-background-effects) */
23486
+ updateSelectedVideoBackgroundEffect(selectedVideoBackground) {
23487
+ this.context.setSelectedVideoBackgroundEffect(selectedVideoBackground);
23488
+ }
23379
23489
  startCall(participants, options) {
23380
23490
  var _a, _b;
23381
23491
  if (_isInCall((_b = (_a = this.getState().call) === null || _a === void 0 ? void 0 : _a.state) !== null && _b !== void 0 ? _b : 'None')) {
@@ -23991,6 +24101,10 @@ class CallWithChatBackedCallAdapter {
23991
24101
  updateBackgroundPickerImages(backgroundImages) {
23992
24102
  return this.callWithChatAdapter.updateBackgroundPickerImages(backgroundImages);
23993
24103
  }
24104
+ /* @conditional-compile-remove(video-background-effects) */
24105
+ updateSelectedVideoBackgroundEffect(selectedVideoBackground) {
24106
+ return this.callWithChatAdapter.updateSelectedVideoBackgroundEffect(selectedVideoBackground);
24107
+ }
23994
24108
  }
23995
24109
  function callAdapterStateFromCallWithChatAdapterState(callWithChatAdapterState) {
23996
24110
  return {
@@ -24476,6 +24590,16 @@ function mergeCallAdapterStateIntoCallWithChatAdapterState(existingCallWithChatA
24476
24590
 
24477
24591
  // Copyright (c) Microsoft Corporation.
24478
24592
  // Licensed under the MIT license.
24593
+ /**
24594
+ * @private
24595
+ */
24596
+ const UNSUPPORTED_CHAT_THREAD_TYPE = ['@thread.tacv2', '@thread.skype'];
24597
+ /**
24598
+ * @private
24599
+ */
24600
+ const TEAMS_LIMITATION_LEARN_MORE = 'https://learn.microsoft.com/en-us/azure/communication-services/concepts/join-teams-meeting#limitations-and-known-issues';
24601
+
24602
+ // Copyright (c) Microsoft Corporation.
24479
24603
  /**
24480
24604
  * Get chat thread from a teams url.
24481
24605
  * As per documented on the Chat SDK: https://docs.microsoft.com/en-us/azure/communication-services/quickstarts/chat/meeting-interop?pivots=platform-web#get-a-teams-meeting-chat-thread-for-a-communication-services-user
@@ -24490,6 +24614,9 @@ const getChatThreadFromTeamsLink = (teamsMeetingLink) => {
24490
24614
  // Extract just the chat guid from the link, stripping away the call locator ID
24491
24615
  threadId = threadId.split(/^(.*?@thread\.v2)/gm)[1];
24492
24616
  if (!threadId || threadId.length === 0) {
24617
+ if (UNSUPPORTED_CHAT_THREAD_TYPE.some((t) => teamsMeetingLink.includes(t))) {
24618
+ throw new Error(`Teams Channel Meetings are not currently supported, read more ${TEAMS_LIMITATION_LEARN_MORE}`);
24619
+ }
24493
24620
  throw new Error('Could not get chat thread from teams link');
24494
24621
  }
24495
24622
  return threadId;
@@ -24888,6 +25015,10 @@ class AzureCommunicationCallWithChatAdapter {
24888
25015
  updateBackgroundPickerImages(backgroundImages) {
24889
25016
  return this.callAdapter.updateBackgroundPickerImages(backgroundImages);
24890
25017
  }
25018
+ /* @conditional-compile-remove(video-background-effects) */
25019
+ updateSelectedVideoBackgroundEffect(selectedVideoBackground) {
25020
+ return this.callAdapter.updateSelectedVideoBackgroundEffect(selectedVideoBackground);
25021
+ }
24891
25022
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
24892
25023
  on(event, listener) {
24893
25024
  switch (event) {