@azure/communication-react 1.5.1-alpha-202305050017 → 1.5.1-alpha-202305060013

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 (55) hide show
  1. package/dist/communication-react.d.ts +84 -67
  2. package/dist/dist-cjs/communication-react/index.js +1400 -149
  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 +3 -3
  9. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.js +7 -2
  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/ChatMessageComponentAsEditBox.d.ts +2 -0
  12. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.js +5 -1
  13. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.js.map +1 -1
  14. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.d.ts +4 -4
  15. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.js +3 -1
  16. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.js.map +1 -1
  17. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.d.ts +2 -2
  18. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js +56 -35
  19. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js.map +1 -1
  20. package/dist/dist-esm/react-components/src/components/ChatMessage/MentionRenderer.d.ts +10 -0
  21. package/dist/dist-esm/react-components/src/components/ChatMessage/MentionRenderer.js +15 -0
  22. package/dist/dist-esm/react-components/src/components/ChatMessage/MentionRenderer.js.map +1 -0
  23. package/dist/dist-esm/react-components/src/components/InputBoxComponent.d.ts +3 -3
  24. package/dist/dist-esm/react-components/src/components/InputBoxComponent.js +1038 -5
  25. package/dist/dist-esm/react-components/src/components/InputBoxComponent.js.map +1 -1
  26. package/dist/dist-esm/react-components/src/components/MentionPopover.d.ts +121 -0
  27. package/dist/dist-esm/react-components/src/components/MentionPopover.js +125 -0
  28. package/dist/dist-esm/react-components/src/components/MentionPopover.js.map +1 -0
  29. package/dist/dist-esm/react-components/src/components/MessageThread.d.ts +4 -4
  30. package/dist/dist-esm/react-components/src/components/MessageThread.js +9 -3
  31. package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
  32. package/dist/dist-esm/react-components/src/components/SendBox.d.ts +7 -7
  33. package/dist/dist-esm/react-components/src/components/SendBox.js +15 -9
  34. package/dist/dist-esm/react-components/src/components/SendBox.js.map +1 -1
  35. package/dist/dist-esm/react-components/src/components/index.d.ts +2 -2
  36. package/dist/dist-esm/react-components/src/components/index.js +2 -2
  37. package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
  38. package/dist/dist-esm/react-components/src/components/styles/{AtMentionFlyout.style.d.ts → MentionPopover.style.d.ts} +4 -4
  39. package/dist/dist-esm/react-components/src/components/styles/{AtMentionFlyout.style.js → MentionPopover.style.js} +11 -13
  40. package/dist/dist-esm/react-components/src/components/styles/MentionPopover.style.js.map +1 -0
  41. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js +5 -1
  42. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js.map +1 -1
  43. package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.d.ts +4 -4
  44. package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.js +4 -4
  45. package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.js.map +1 -1
  46. package/dist/dist-esm/react-components/src/localization/LocalizationProvider.d.ts +3 -0
  47. package/dist/dist-esm/react-components/src/localization/LocalizationProvider.js.map +1 -1
  48. package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +3 -0
  49. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +2 -1
  50. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
  51. package/package.json +11 -9
  52. package/dist/dist-esm/react-components/src/components/AtMentionFlyout.d.ts +0 -91
  53. package/dist/dist-esm/react-components/src/components/AtMentionFlyout.js +0 -58
  54. package/dist/dist-esm/react-components/src/components/AtMentionFlyout.js.map +0 -1
  55. package/dist/dist-esm/react-components/src/components/styles/AtMentionFlyout.style.js.map +0 -1
@@ -14,6 +14,8 @@ var React = require('react');
14
14
  var react = require('@fluentui/react');
15
15
  var reactNorthstar = require('@fluentui/react-northstar');
16
16
  var reactIcons = require('@fluentui/react-icons');
17
+ var textareaCaretTs = require('textarea-caret-ts');
18
+ var useDebounce = require('use-debounce');
17
19
  var reactFileTypeIcons = require('@fluentui/react-file-type-icons');
18
20
  var reactAriaLive = require('react-aria-live');
19
21
  var htmlToReact = require('html-to-react');
@@ -162,7 +164,7 @@ const _toCommunicationIdentifier = (id) => {
162
164
  // Copyright (c) Microsoft Corporation.
163
165
  // Licensed under the MIT license.
164
166
  // GENERATED FILE. DO NOT EDIT MANUALLY.
165
- var telemetryVersion = '1.5.1-alpha-202305050017';
167
+ var telemetryVersion = '1.5.1-alpha-202305060013';
166
168
 
167
169
  // Copyright (c) Microsoft Corporation.
168
170
  /**
@@ -408,7 +410,7 @@ const getSupportedSpokenLanguages = (state, props) => {
408
410
 
409
411
  // Copyright (c) Microsoft Corporation.
410
412
  // Licensed under the MIT license.
411
- var __awaiter$H = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
413
+ var __awaiter$I = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
412
414
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
413
415
  return new (P || (P = Promise))(function (resolve, reject) {
414
416
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -446,7 +448,7 @@ const _isPreviewOn = (deviceManager) => {
446
448
  *
447
449
  * @private
448
450
  */
449
- const disposeAllLocalPreviewViews = (callClient) => __awaiter$H(void 0, void 0, void 0, function* () {
451
+ const disposeAllLocalPreviewViews = (callClient) => __awaiter$I(void 0, void 0, void 0, function* () {
450
452
  const unparentedViews = callClient.getState().deviceManager.unparentedViews;
451
453
  for (const view of unparentedViews) {
452
454
  yield callClient.disposeView(undefined, undefined, view);
@@ -572,7 +574,7 @@ const holdButtonSelector = reselect__namespace.createSelector([getCallState], (c
572
574
 
573
575
  // Copyright (c) Microsoft Corporation.
574
576
  // Licensed under the MIT license.
575
- var __awaiter$G = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
577
+ var __awaiter$H = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
576
578
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
577
579
  return new (P || (P = Promise))(function (resolve, reject) {
578
580
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -593,7 +595,7 @@ const areStreamsEqual = (prevStream, newStream) => {
593
595
  * @private
594
596
  */
595
597
  const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callClient, deviceManager, call) => {
596
- const onStartLocalVideo = () => __awaiter$G(void 0, void 0, void 0, function* () {
598
+ const onStartLocalVideo = () => __awaiter$H(void 0, void 0, void 0, function* () {
597
599
  // Before the call object creates a stream, dispose of any local preview streams.
598
600
  // @TODO: is there any way to parent the unparented view to the call object instead
599
601
  // of disposing and creating a new stream?
@@ -613,7 +615,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
613
615
  yield call.startVideo(stream);
614
616
  }
615
617
  });
616
- const onStopLocalVideo = (stream) => __awaiter$G(void 0, void 0, void 0, function* () {
618
+ const onStopLocalVideo = (stream) => __awaiter$H(void 0, void 0, void 0, function* () {
617
619
  const callId = call === null || call === void 0 ? void 0 : call.id;
618
620
  if (!callId) {
619
621
  return;
@@ -622,7 +624,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
622
624
  yield call.stopVideo(stream);
623
625
  }
624
626
  });
625
- const onToggleCamera = (options) => __awaiter$G(void 0, void 0, void 0, function* () {
627
+ const onToggleCamera = (options) => __awaiter$H(void 0, void 0, void 0, function* () {
626
628
  const previewOn = _isPreviewOn(callClient.getState().deviceManager);
627
629
  if (previewOn && call && call.state === 'Connecting') {
628
630
  // This is to workaround: https://skype.visualstudio.com/SPOOL/_workitems/edit/3030558.
@@ -670,19 +672,19 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
670
672
  }
671
673
  }
672
674
  });
673
- const onSelectMicrophone = (device) => __awaiter$G(void 0, void 0, void 0, function* () {
675
+ const onSelectMicrophone = (device) => __awaiter$H(void 0, void 0, void 0, function* () {
674
676
  if (!deviceManager) {
675
677
  return;
676
678
  }
677
679
  return deviceManager.selectMicrophone(device);
678
680
  });
679
- const onSelectSpeaker = (device) => __awaiter$G(void 0, void 0, void 0, function* () {
681
+ const onSelectSpeaker = (device) => __awaiter$H(void 0, void 0, void 0, function* () {
680
682
  if (!deviceManager) {
681
683
  return;
682
684
  }
683
685
  return deviceManager.selectSpeaker(device);
684
686
  });
685
- const onSelectCamera = (device, options) => __awaiter$G(void 0, void 0, void 0, function* () {
687
+ const onSelectCamera = (device, options) => __awaiter$H(void 0, void 0, void 0, function* () {
686
688
  if (!deviceManager) {
687
689
  return;
688
690
  }
@@ -705,19 +707,19 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
705
707
  }, options);
706
708
  }
707
709
  });
708
- const onToggleMicrophone = () => __awaiter$G(void 0, void 0, void 0, function* () {
710
+ const onToggleMicrophone = () => __awaiter$H(void 0, void 0, void 0, function* () {
709
711
  if (!call || !_isInCall(call.state)) {
710
712
  throw new Error(`Please invoke onToggleMicrophone after call is started`);
711
713
  }
712
714
  return call.isMuted ? yield call.unmute() : yield call.mute();
713
715
  });
714
- const onStartScreenShare = () => __awaiter$G(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.startScreenSharing()); });
715
- const onStopScreenShare = () => __awaiter$G(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.stopScreenSharing()); });
716
- const onToggleScreenShare = () => __awaiter$G(void 0, void 0, void 0, function* () { return (call === null || call === void 0 ? void 0 : call.isScreenSharingOn) ? yield onStopScreenShare() : yield onStartScreenShare(); });
717
- const onHangUp = (forEveryone) => __awaiter$G(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.hangUp({ forEveryone: forEveryone === true ? true : false })); });
716
+ const onStartScreenShare = () => __awaiter$H(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.startScreenSharing()); });
717
+ const onStopScreenShare = () => __awaiter$H(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.stopScreenSharing()); });
718
+ const onToggleScreenShare = () => __awaiter$H(void 0, void 0, void 0, function* () { return (call === null || call === void 0 ? void 0 : call.isScreenSharingOn) ? yield onStopScreenShare() : yield onStartScreenShare(); });
719
+ const onHangUp = (forEveryone) => __awaiter$H(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.hangUp({ forEveryone: forEveryone === true ? true : false })); });
718
720
  /* @conditional-compile-remove(PSTN-calls) */
719
- const onToggleHold = () => __awaiter$G(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()); });
720
- const onCreateLocalStreamView = (options = { scalingMode: 'Crop', isMirrored: true }) => __awaiter$G(void 0, void 0, void 0, function* () {
721
+ const onToggleHold = () => __awaiter$H(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()); });
722
+ const onCreateLocalStreamView = (options = { scalingMode: 'Crop', isMirrored: true }) => __awaiter$H(void 0, void 0, void 0, function* () {
721
723
  var _a;
722
724
  if (!call || call.localVideoStreams.length === 0) {
723
725
  return;
@@ -733,7 +735,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
733
735
  const { view } = (_a = (yield callClient.createView(call.id, undefined, localStream, options))) !== null && _a !== void 0 ? _a : {};
734
736
  return view ? { view } : undefined;
735
737
  });
736
- const onCreateRemoteStreamView = (userId, options = { scalingMode: 'Crop' }) => __awaiter$G(void 0, void 0, void 0, function* () {
738
+ const onCreateRemoteStreamView = (userId, options = { scalingMode: 'Crop' }) => __awaiter$H(void 0, void 0, void 0, function* () {
737
739
  if (!call) {
738
740
  return;
739
741
  }
@@ -764,7 +766,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
764
766
  }
765
767
  return (createViewResult === null || createViewResult === void 0 ? void 0 : createViewResult.view) ? { view: createViewResult === null || createViewResult === void 0 ? void 0 : createViewResult.view } : undefined;
766
768
  });
767
- const onDisposeRemoteStreamView = (userId) => __awaiter$G(void 0, void 0, void 0, function* () {
769
+ const onDisposeRemoteStreamView = (userId) => __awaiter$H(void 0, void 0, void 0, function* () {
768
770
  if (!call) {
769
771
  return;
770
772
  }
@@ -785,7 +787,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
785
787
  callClient.disposeView(call.id, participant.identifier, screenShareStream);
786
788
  }
787
789
  });
788
- const onDisposeLocalStreamView = () => __awaiter$G(void 0, void 0, void 0, function* () {
790
+ const onDisposeLocalStreamView = () => __awaiter$H(void 0, void 0, void 0, function* () {
789
791
  // If the user is currently in a call, dispose of the local stream view attached to that call.
790
792
  const callState = call && callClient.getState().calls[call.id];
791
793
  const localStream = callState === null || callState === void 0 ? void 0 : callState.localVideoStreams.find((item) => item.mediaStreamType === 'Video');
@@ -798,18 +800,18 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
798
800
  yield disposeAllLocalPreviewViews(callClient);
799
801
  });
800
802
  /* @conditional-compile-remove(dialpad) */ /* @conditional-compile-remove(PSTN-calls) */
801
- const onSendDtmfTone = (dtmfTone) => __awaiter$G(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.sendDtmf(dtmfTone)); });
803
+ const onSendDtmfTone = (dtmfTone) => __awaiter$H(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.sendDtmf(dtmfTone)); });
802
804
  const notImplemented = () => {
803
805
  throw new Error('Not implemented, cannot call a method from an abstract object');
804
806
  };
805
807
  /* @conditional-compile-remove(call-readiness) */
806
- const askDevicePermission = (constrain) => __awaiter$G(void 0, void 0, void 0, function* () {
808
+ const askDevicePermission = (constrain) => __awaiter$H(void 0, void 0, void 0, function* () {
807
809
  if (deviceManager) {
808
810
  yield (deviceManager === null || deviceManager === void 0 ? void 0 : deviceManager.askDevicePermission(constrain));
809
811
  }
810
812
  });
811
813
  /* @conditional-compile-remove(video-background-effects) */
812
- const onRemoveVideoBackgroundEffects = () => __awaiter$G(void 0, void 0, void 0, function* () {
814
+ const onRemoveVideoBackgroundEffects = () => __awaiter$H(void 0, void 0, void 0, function* () {
813
815
  const stream = (call === null || call === void 0 ? void 0 : call.localVideoStreams.find((stream) => stream.mediaStreamType === 'Video')) ||
814
816
  (deviceManager === null || deviceManager === void 0 ? void 0 : deviceManager.getUnparentedVideoStreams().find((stream) => stream.mediaStreamType === 'Video'));
815
817
  if (stream) {
@@ -817,7 +819,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
817
819
  }
818
820
  });
819
821
  /* @conditional-compile-remove(video-background-effects) */
820
- const onBlurVideoBackground = (backgroundBlurConfig) => __awaiter$G(void 0, void 0, void 0, function* () {
822
+ const onBlurVideoBackground = (backgroundBlurConfig) => __awaiter$H(void 0, void 0, void 0, function* () {
821
823
  const stream = (call === null || call === void 0 ? void 0 : call.localVideoStreams.find((stream) => stream.mediaStreamType === 'Video')) ||
822
824
  (deviceManager === null || deviceManager === void 0 ? void 0 : deviceManager.getUnparentedVideoStreams().find((stream) => stream.mediaStreamType === 'Video'));
823
825
  if (stream) {
@@ -825,7 +827,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
825
827
  }
826
828
  });
827
829
  /* @conditional-compile-remove(video-background-effects) */
828
- const onReplaceVideoBackground = (backgroundReplacementConfig) => __awaiter$G(void 0, void 0, void 0, function* () {
830
+ const onReplaceVideoBackground = (backgroundReplacementConfig) => __awaiter$H(void 0, void 0, void 0, function* () {
829
831
  const stream = (call === null || call === void 0 ? void 0 : call.localVideoStreams.find((stream) => stream.mediaStreamType === 'Video')) ||
830
832
  (deviceManager === null || deviceManager === void 0 ? void 0 : deviceManager.getUnparentedVideoStreams().find((stream) => stream.mediaStreamType === 'Video'));
831
833
  if (stream) {
@@ -835,19 +837,19 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
835
837
  }
836
838
  });
837
839
  /* @conditional-compile-remove(close-captions) */
838
- const onStartCaptions = (options) => __awaiter$G(void 0, void 0, void 0, function* () {
840
+ const onStartCaptions = (options) => __awaiter$H(void 0, void 0, void 0, function* () {
839
841
  yield (call === null || call === void 0 ? void 0 : call.feature(communicationCalling.Features.TeamsCaptions).startCaptions(options));
840
842
  });
841
843
  /* @conditional-compile-remove(close-captions) */
842
- const onStopCaptions = () => __awaiter$G(void 0, void 0, void 0, function* () {
844
+ const onStopCaptions = () => __awaiter$H(void 0, void 0, void 0, function* () {
843
845
  yield (call === null || call === void 0 ? void 0 : call.feature(communicationCalling.Features.TeamsCaptions).stopCaptions());
844
846
  });
845
847
  /* @conditional-compile-remove(close-captions) */
846
- const onSetSpokenLanguage = (language) => __awaiter$G(void 0, void 0, void 0, function* () {
848
+ const onSetSpokenLanguage = (language) => __awaiter$H(void 0, void 0, void 0, function* () {
847
849
  yield (call === null || call === void 0 ? void 0 : call.feature(communicationCalling.Features.TeamsCaptions).setSpokenLanguage(language));
848
850
  });
849
851
  /* @conditional-compile-remove(close-captions) */
850
- const onSetCaptionLanguage = (language) => __awaiter$G(void 0, void 0, void 0, function* () {
852
+ const onSetCaptionLanguage = (language) => __awaiter$H(void 0, void 0, void 0, function* () {
851
853
  yield (call === null || call === void 0 ? void 0 : call.feature(communicationCalling.Features.TeamsCaptions).setCaptionLanguage(language));
852
854
  });
853
855
  return {
@@ -893,7 +895,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
893
895
 
894
896
  // Copyright (c) Microsoft Corporation.
895
897
  // Licensed under the MIT license.
896
- var __awaiter$F = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
898
+ var __awaiter$G = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
897
899
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
898
900
  return new (P || (P = Promise))(function (resolve, reject) {
899
901
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -918,7 +920,7 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
918
920
  return callAgent === null || callAgent === void 0 ? void 0 : callAgent.startCall(participants, options);
919
921
  },
920
922
  /* @conditional-compile-remove(PSTN-calls) */
921
- onAddParticipant: (userId, options) => __awaiter$F(void 0, void 0, void 0, function* () {
923
+ onAddParticipant: (userId, options) => __awaiter$G(void 0, void 0, void 0, function* () {
922
924
  const participant = _toCommunicationIdentifier(userId);
923
925
  if (communicationCommon.isPhoneNumberIdentifier(participant)) {
924
926
  call === null || call === void 0 ? void 0 : call.addParticipant(participant, options);
@@ -926,7 +928,7 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
926
928
  else if (communicationCommon.isCommunicationUserIdentifier(participant) || communicationCommon.isMicrosoftTeamsUserIdentifier(participant)) {
927
929
  call === null || call === void 0 ? void 0 : call.addParticipant(participant);
928
930
  }
929
- }), onRemoveParticipant: (userId) => __awaiter$F(void 0, void 0, void 0, function* () {
931
+ }), onRemoveParticipant: (userId) => __awaiter$G(void 0, void 0, void 0, function* () {
930
932
  const participant = _toCommunicationIdentifier(userId);
931
933
  yield (call === null || call === void 0 ? void 0 : call.removeParticipant(participant));
932
934
  }) });
@@ -934,7 +936,7 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
934
936
 
935
937
  // Copyright (c) Microsoft Corporation.
936
938
  // Licensed under the MIT license.
937
- var __awaiter$E = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
939
+ var __awaiter$F = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
938
940
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
939
941
  return new (P || (P = Promise))(function (resolve, reject) {
940
942
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -966,7 +968,7 @@ const createDefaultTeamsCallingHandlers = memoizeOne__default['default']((callCl
966
968
  },
967
969
  /* @conditional-compile-remove(teams-identity-support) */
968
970
  /* @conditional-compile-remove(PSTN-calls) */
969
- onAddParticipant: (userId, options) => __awaiter$E(void 0, void 0, void 0, function* () {
971
+ onAddParticipant: (userId, options) => __awaiter$F(void 0, void 0, void 0, function* () {
970
972
  const participant = _toCommunicationIdentifier(userId);
971
973
  /* @conditional-compile-remove(teams-identity-support) */
972
974
  const threadId = options === null || options === void 0 ? void 0 : options.threadId;
@@ -979,7 +981,7 @@ const createDefaultTeamsCallingHandlers = memoizeOne__default['default']((callCl
979
981
  }
980
982
  /* @conditional-compile-remove(teams-identity-support) */
981
983
  call === null || call === void 0 ? void 0 : call.addParticipant(participant);
982
- }), onRemoveParticipant: (userId) => __awaiter$E(void 0, void 0, void 0, function* () {
984
+ }), onRemoveParticipant: (userId) => __awaiter$F(void 0, void 0, void 0, function* () {
983
985
  const participant = _toCommunicationIdentifier(userId);
984
986
  if (communicationCommon.isCommunicationUserIdentifier(participant)) {
985
987
  throw new Error('CommunicationIdentifier in Teams call is not supported!');
@@ -1041,7 +1043,7 @@ const _captionsBannerSelector = reselect__namespace.createSelector([getCaptions,
1041
1043
 
1042
1044
  // Copyright (c) Microsoft Corporation.
1043
1045
  // Licensed under the MIT license.
1044
- var __awaiter$D = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
1046
+ var __awaiter$E = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
1045
1047
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1046
1048
  return new (P || (P = Promise))(function (resolve, reject) {
1047
1049
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -1090,13 +1092,13 @@ class ProxyDeviceManager {
1090
1092
  this.selectCamera = (videoDeviceInfo) => {
1091
1093
  this._context.setDeviceManagerSelectedCamera(videoDeviceInfo);
1092
1094
  };
1093
- this.videoDevicesUpdated = () => __awaiter$D(this, void 0, void 0, function* () {
1095
+ this.videoDevicesUpdated = () => __awaiter$E(this, void 0, void 0, function* () {
1094
1096
  // Device Manager always has a camera with '' name if there are no real camera devices available.
1095
1097
  // We don't want to show that in the UI.
1096
1098
  const realCameras = (yield this._deviceManager.getCameras()).filter((c) => !!c.name);
1097
1099
  this._context.setDeviceManagerCameras(dedupeById(realCameras));
1098
1100
  });
1099
- this.audioDevicesUpdated = () => __awaiter$D(this, void 0, void 0, function* () {
1101
+ this.audioDevicesUpdated = () => __awaiter$E(this, void 0, void 0, function* () {
1100
1102
  this._context.setDeviceManagerMicrophones(dedupeById(yield this._deviceManager.getMicrophones()));
1101
1103
  this._context.setDeviceManagerSpeakers(dedupeById(yield this._deviceManager.getSpeakers()));
1102
1104
  });
@@ -1462,7 +1464,7 @@ function convertFromSDKToCaptionInfoState(caption) {
1462
1464
 
1463
1465
  // Copyright (c) Microsoft Corporation.
1464
1466
  // Licensed under the MIT license.
1465
- var __awaiter$C = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
1467
+ var __awaiter$D = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
1466
1468
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1467
1469
  return new (P || (P = Promise))(function (resolve, reject) {
1468
1470
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -2125,7 +2127,7 @@ class CallContext$2 {
2125
2127
  * @throws CallError. Exceptions thrown from `f` are tagged with the failed `target.
2126
2128
  */
2127
2129
  withAsyncErrorTeedToState(action, target) {
2128
- return (...args) => __awaiter$C(this, void 0, void 0, function* () {
2130
+ return (...args) => __awaiter$D(this, void 0, void 0, function* () {
2129
2131
  try {
2130
2132
  return yield action(...args);
2131
2133
  }
@@ -2553,7 +2555,7 @@ function _logStreamEvent(eventName, streamLogInfo, error) {
2553
2555
 
2554
2556
  // Copyright (c) Microsoft Corporation.
2555
2557
  // Licensed under the MIT license.
2556
- var __awaiter$B = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
2558
+ var __awaiter$C = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
2557
2559
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
2558
2560
  return new (P || (P = Promise))(function (resolve, reject) {
2559
2561
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -2563,7 +2565,7 @@ var __awaiter$B = (window && window.__awaiter) || function (thisArg, _arguments,
2563
2565
  });
2564
2566
  };
2565
2567
  function createViewVideo(context, internalContext, callId, stream, participantId, options) {
2566
- return __awaiter$B(this, void 0, void 0, function* () {
2568
+ return __awaiter$C(this, void 0, void 0, function* () {
2567
2569
  // we can only have 3 types of createView
2568
2570
  let streamEventType;
2569
2571
  // we will reuse these for local as well but we need to make sure the remote stream is passed in like before.
@@ -2685,7 +2687,7 @@ function createViewVideo(context, internalContext, callId, stream, participantId
2685
2687
  });
2686
2688
  }
2687
2689
  function createViewUnparentedVideo(context, internalContext, stream, options) {
2688
- return __awaiter$B(this, void 0, void 0, function* () {
2690
+ return __awaiter$C(this, void 0, void 0, function* () {
2689
2691
  const renderInfo = internalContext.getUnparentedRenderInfo(stream);
2690
2692
  if (renderInfo && renderInfo.status === 'Rendered') {
2691
2693
  console.warn('Unparented LocalVideoStream is already rendered');
@@ -2853,7 +2855,7 @@ function createView(context, internalContext, callId, participantId, stream, opt
2853
2855
  // Render LocalVideoStream that is not part of a Call
2854
2856
  // 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).
2855
2857
  // We do not have a startLocalPreviewVideo function, so as a workaround we ensure any errors are propagated here.
2856
- return context.withAsyncErrorTeedToState(() => __awaiter$B(this, void 0, void 0, function* () { return yield createViewUnparentedVideo(context, internalContext, stream, options); }), 'Call.startVideo')();
2858
+ return context.withAsyncErrorTeedToState(() => __awaiter$C(this, void 0, void 0, function* () { return yield createViewUnparentedVideo(context, internalContext, stream, options); }), 'Call.startVideo')();
2857
2859
  }
2858
2860
  else {
2859
2861
  _logStreamEvent(EventNames.CREATE_STREAM_INVALID_PARAMS, { streamType });
@@ -3302,7 +3304,7 @@ class CallSubscriber {
3302
3304
 
3303
3305
  // Copyright (c) Microsoft Corporation.
3304
3306
  // Licensed under the MIT license.
3305
- var __awaiter$A = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3307
+ var __awaiter$B = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3306
3308
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3307
3309
  return new (P || (P = Promise))(function (resolve, reject) {
3308
3310
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -3322,14 +3324,14 @@ class ProxyIncomingCall {
3322
3324
  switch (prop) {
3323
3325
  case 'accept': {
3324
3326
  return this._context.withAsyncErrorTeedToState(function (...args) {
3325
- return __awaiter$A(this, void 0, void 0, function* () {
3327
+ return __awaiter$B(this, void 0, void 0, function* () {
3326
3328
  return yield target.accept(...args);
3327
3329
  });
3328
3330
  }, 'IncomingCall.accept');
3329
3331
  }
3330
3332
  case 'reject': {
3331
3333
  return this._context.withAsyncErrorTeedToState(function (...args) {
3332
- return __awaiter$A(this, void 0, void 0, function* () {
3334
+ return __awaiter$B(this, void 0, void 0, function* () {
3333
3335
  return yield target.reject(...args);
3334
3336
  });
3335
3337
  }, 'IncomingCall.reject');
@@ -3566,7 +3568,7 @@ const clearCallRelatedState = (context, internalContext) => {
3566
3568
 
3567
3569
  // Copyright (c) Microsoft Corporation.
3568
3570
  // Licensed under the MIT license.
3569
- var __awaiter$z = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3571
+ var __awaiter$A = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3570
3572
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3571
3573
  return new (P || (P = Promise))(function (resolve, reject) {
3572
3574
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -3592,56 +3594,56 @@ class ProxyCallCommon {
3592
3594
  switch (prop) {
3593
3595
  case 'mute': {
3594
3596
  return this._context.withAsyncErrorTeedToState(function (...args) {
3595
- return __awaiter$z(this, void 0, void 0, function* () {
3597
+ return __awaiter$A(this, void 0, void 0, function* () {
3596
3598
  return yield target.mute(...args);
3597
3599
  });
3598
3600
  }, 'Call.mute');
3599
3601
  }
3600
3602
  case 'unmute': {
3601
3603
  return this._context.withAsyncErrorTeedToState(function (...args) {
3602
- return __awaiter$z(this, void 0, void 0, function* () {
3604
+ return __awaiter$A(this, void 0, void 0, function* () {
3603
3605
  return yield target.unmute(...args);
3604
3606
  });
3605
3607
  }, 'Call.unmute');
3606
3608
  }
3607
3609
  case 'startVideo': {
3608
3610
  return this._context.withAsyncErrorTeedToState(function (...args) {
3609
- return __awaiter$z(this, void 0, void 0, function* () {
3611
+ return __awaiter$A(this, void 0, void 0, function* () {
3610
3612
  return yield target.startVideo(...args);
3611
3613
  });
3612
3614
  }, 'Call.startVideo');
3613
3615
  }
3614
3616
  case 'stopVideo': {
3615
3617
  return this._context.withAsyncErrorTeedToState(function (...args) {
3616
- return __awaiter$z(this, void 0, void 0, function* () {
3618
+ return __awaiter$A(this, void 0, void 0, function* () {
3617
3619
  return yield target.stopVideo(...args);
3618
3620
  });
3619
3621
  }, 'Call.stopVideo');
3620
3622
  }
3621
3623
  case 'startScreenSharing': {
3622
3624
  return this._context.withAsyncErrorTeedToState(function (...args) {
3623
- return __awaiter$z(this, void 0, void 0, function* () {
3625
+ return __awaiter$A(this, void 0, void 0, function* () {
3624
3626
  return yield target.startScreenSharing(...args);
3625
3627
  });
3626
3628
  }, 'Call.startScreenSharing');
3627
3629
  }
3628
3630
  case 'stopScreenSharing': {
3629
3631
  return this._context.withAsyncErrorTeedToState(function (...args) {
3630
- return __awaiter$z(this, void 0, void 0, function* () {
3632
+ return __awaiter$A(this, void 0, void 0, function* () {
3631
3633
  return yield target.stopScreenSharing(...args);
3632
3634
  });
3633
3635
  }, 'Call.stopScreenSharing');
3634
3636
  }
3635
3637
  case 'hold': {
3636
3638
  return this._context.withAsyncErrorTeedToState(function (...args) {
3637
- return __awaiter$z(this, void 0, void 0, function* () {
3639
+ return __awaiter$A(this, void 0, void 0, function* () {
3638
3640
  return yield target.hold(...args);
3639
3641
  });
3640
3642
  }, 'Call.hold');
3641
3643
  }
3642
3644
  case 'resume': {
3643
3645
  return this._context.withAsyncErrorTeedToState(function (...args) {
3644
- return __awaiter$z(this, void 0, void 0, function* () {
3646
+ return __awaiter$A(this, void 0, void 0, function* () {
3645
3647
  return yield target.resume(...args);
3646
3648
  });
3647
3649
  }, 'Call.resume');
@@ -3675,7 +3677,7 @@ class ProxyTeamsCaptionsFeature {
3675
3677
  get(target, prop) {
3676
3678
  switch (prop) {
3677
3679
  case 'startCaptions':
3678
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$z(this, void 0, void 0, function* () {
3680
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$A(this, void 0, void 0, function* () {
3679
3681
  var _a, _b;
3680
3682
  const ret = yield target.startCaptions(...args);
3681
3683
  this._context.setIsCaptionActive(this._call.id, true);
@@ -3683,19 +3685,19 @@ class ProxyTeamsCaptionsFeature {
3683
3685
  return ret;
3684
3686
  }), 'Call.feature');
3685
3687
  case 'stopCaptions':
3686
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$z(this, void 0, void 0, function* () {
3688
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$A(this, void 0, void 0, function* () {
3687
3689
  const ret = yield target.stopCaptions(...args);
3688
3690
  this._context.setIsCaptionActive(this._call.id, false);
3689
3691
  return ret;
3690
3692
  }), 'Call.feature');
3691
3693
  case 'setSpokenLanguage':
3692
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$z(this, void 0, void 0, function* () {
3694
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$A(this, void 0, void 0, function* () {
3693
3695
  const ret = yield target.setSpokenLanguage(...args);
3694
3696
  this._context.setSelectedSpokenLanguage(this._call.id, args[0]);
3695
3697
  return ret;
3696
3698
  }), 'Call.feature');
3697
3699
  case 'setCaptionLanguage':
3698
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$z(this, void 0, void 0, function* () {
3700
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$A(this, void 0, void 0, function* () {
3699
3701
  const ret = yield target.setCaptionLanguage(...args);
3700
3702
  this._context.setSelectedCaptionLanguage(this._call.id, args[0]);
3701
3703
  return ret;
@@ -3708,7 +3710,7 @@ class ProxyTeamsCaptionsFeature {
3708
3710
 
3709
3711
  // Copyright (c) Microsoft Corporation.
3710
3712
  // Licensed under the MIT license.
3711
- var __awaiter$y = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3713
+ var __awaiter$z = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3712
3714
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3713
3715
  return new (P || (P = Promise))(function (resolve, reject) {
3714
3716
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -3722,7 +3724,7 @@ class ProxyCall extends ProxyCallCommon {
3722
3724
  switch (prop) {
3723
3725
  case 'addParticipant': {
3724
3726
  return this.getContext().withAsyncErrorTeedToState(function (...args) {
3725
- return __awaiter$y(this, void 0, void 0, function* () {
3727
+ return __awaiter$z(this, void 0, void 0, function* () {
3726
3728
  return yield target.addParticipant(...args);
3727
3729
  });
3728
3730
  }, 'Call.addParticipant');
@@ -3943,7 +3945,7 @@ class InternalCallContext {
3943
3945
 
3944
3946
  // Copyright (c) Microsoft Corporation.
3945
3947
  // Licensed under the MIT license.
3946
- var __awaiter$x = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3948
+ var __awaiter$y = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3947
3949
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3948
3950
  return new (P || (P = Promise))(function (resolve, reject) {
3949
3951
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -3958,7 +3960,7 @@ class ProxyTeamsCall extends ProxyCallCommon {
3958
3960
  switch (prop) {
3959
3961
  case 'addParticipant': {
3960
3962
  return this.getContext().withAsyncErrorTeedToState(function (...args) {
3961
- return __awaiter$x(this, void 0, void 0, function* () {
3963
+ return __awaiter$y(this, void 0, void 0, function* () {
3962
3964
  return yield target.addParticipant(...args);
3963
3965
  });
3964
3966
  }, 'TeamsCall.addParticipant');
@@ -4073,7 +4075,7 @@ const teamsCallAgentDeclaratify = (callAgent, context, internalContext) => {
4073
4075
 
4074
4076
  // Copyright (c) Microsoft Corporation.
4075
4077
  // Licensed under the MIT license.
4076
- var __awaiter$w = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
4078
+ var __awaiter$x = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
4077
4079
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4078
4080
  return new (P || (P = Promise))(function (resolve, reject) {
4079
4081
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -4095,7 +4097,7 @@ class ProxyVideoStreamRendererView {
4095
4097
  get(target, prop) {
4096
4098
  switch (prop) {
4097
4099
  case 'updateScalingMode': {
4098
- return (...args) => __awaiter$w(this, void 0, void 0, function* () {
4100
+ return (...args) => __awaiter$x(this, void 0, void 0, function* () {
4099
4101
  yield target.updateScalingMode(...args);
4100
4102
  this._context.setRemoteVideoStreamViewScalingMode(this._callId, this._participantId, this._streamId, args[0]);
4101
4103
  });
@@ -4116,7 +4118,7 @@ const videoStreamRendererViewDeclaratify = (view, context, callId, participantId
4116
4118
 
4117
4119
  // Copyright (c) Microsoft Corporation.
4118
4120
  // Licensed under the MIT license.
4119
- var __awaiter$v = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
4121
+ var __awaiter$w = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
4120
4122
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4121
4123
  return new (P || (P = Promise))(function (resolve, reject) {
4122
4124
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -4138,7 +4140,7 @@ class ProxyCallClient {
4138
4140
  get(target, prop) {
4139
4141
  switch (prop) {
4140
4142
  case 'createCallAgent': {
4141
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$v(this, void 0, void 0, function* () {
4143
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$w(this, void 0, void 0, function* () {
4142
4144
  // createCallAgent will throw an exception if the previous callAgent was not disposed. If the previous
4143
4145
  // callAgent was disposed then it would have unsubscribed to events so we can just create a new declarative
4144
4146
  // callAgent if the createCallAgent succeeds.
@@ -4151,7 +4153,7 @@ class ProxyCallClient {
4151
4153
  }), 'CallClient.createCallAgent');
4152
4154
  }
4153
4155
  case 'createTeamsCallAgent': {
4154
- /* @conditional-compile-remove(teams-identity-support) */ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$v(this, void 0, void 0, function* () {
4156
+ /* @conditional-compile-remove(teams-identity-support) */ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$w(this, void 0, void 0, function* () {
4155
4157
  // createCallAgent will throw an exception if the previous callAgent was not disposed. If the previous
4156
4158
  // callAgent was disposed then it would have unsubscribed to events so we can just create a new declarative
4157
4159
  // callAgent if the createCallAgent succeeds.
@@ -4164,7 +4166,7 @@ class ProxyCallClient {
4164
4166
  }), 'CallClient.createTeamsCallAgent');
4165
4167
  }
4166
4168
  case 'getDeviceManager': {
4167
- return this._context.withAsyncErrorTeedToState(() => __awaiter$v(this, void 0, void 0, function* () {
4169
+ return this._context.withAsyncErrorTeedToState(() => __awaiter$w(this, void 0, void 0, function* () {
4168
4170
  // As of writing, the SDK always returns the same instance of DeviceManager so we keep a reference of
4169
4171
  // DeviceManager and if it does not change we return the cached DeclarativeDeviceManager. If it does not we'll
4170
4172
  // throw an error that indicate we need to fix this issue as our implementation has diverged from the SDK.
@@ -4193,7 +4195,7 @@ class ProxyCallClient {
4193
4195
  /**
4194
4196
  * add to this object if we want to proxy anything else off the DebugInfo feature object.
4195
4197
  */
4196
- return Object.assign(Object.assign({}, feature), { getEnvironmentInfo: () => __awaiter$v(this, void 0, void 0, function* () {
4198
+ return Object.assign(Object.assign({}, feature), { getEnvironmentInfo: () => __awaiter$w(this, void 0, void 0, function* () {
4197
4199
  const environmentInfo = yield feature.getEnvironmentInfo();
4198
4200
  this._context.setEnvironmentInfo(environmentInfo);
4199
4201
  return environmentInfo;
@@ -4246,7 +4248,7 @@ const createStatefulCallClientWithDeps = (callClient, context, internalContext)
4246
4248
  });
4247
4249
  Object.defineProperty(callClient, 'createView', {
4248
4250
  configurable: false,
4249
- value: (callId, participantId, stream, options) => __awaiter$v(void 0, void 0, void 0, function* () {
4251
+ value: (callId, participantId, stream, options) => __awaiter$w(void 0, void 0, void 0, function* () {
4250
4252
  const participantIdKind = participantId ? communicationCommon.getIdentifierKind(participantId) : undefined;
4251
4253
  const result = yield createView(context, internalContext, callId, participantIdKind, stream, options);
4252
4254
  // We only need to declaratify the VideoStreamRendererView object for remote participants. Because the updateScalingMode only needs to be called on remote participant stream views.
@@ -4475,7 +4477,7 @@ const typingIndicatorStringStyle = react.mergeStyles({
4475
4477
  wordBreak: 'break-word'
4476
4478
  });
4477
4479
 
4478
- var participantItem$d={isMeText:"(you)",menuTitle:"More Options",removeButtonLabel:"Remove",sharingIconLabel:"Sharing",mutedIconLabel:"Muted",displayNamePlaceholder:"Unnamed participant",participantStateRinging:"Calling...",participantStateHold:"On hold"};var typingIndicator$d={singleUser:"{user} is typing ...",multipleUsers:"{users} are typing ...",multipleUsersAbbreviateOne:"{users} and 1 other are typing ...",multipleUsersAbbreviateMany:"{users} and {numOthers} others are typing ...",delimiter:", "};var sendBox$d={placeholderText:"Enter a message",textTooLong:"Your message length is over the maximum limit.",sendButtonAriaLabel:"Send message",fileUploadsPendingError:"Uploading... Please wait.",removeFile:"Remove file",uploading:"Uploading",uploadCompleted:"Upload completed"};var messageStatusIndicator$d={deliveredAriaLabel:"Message sent",deliveredTooltipText:"Sent",seenAriaLabel:"Message seen by others",seenTooltipText:"Seen",readByTooltipText:"Read by {messageThreadReadCount} of {remoteParticipantsCount}",sendingAriaLabel:"Message sending",sendingTooltipText:"Sending",failedToSendAriaLabel:"Message failed to send",failedToSendTooltipText:"Failed to send"};var endCallButton$d={label:"Leave",tooltipContent:"Leave call"};var cameraButton$d={onLabel:"Turn off",offLabel:"Turn on",tooltipDisabledContent:"Camera is disabled",tooltipOnContent:"Turn off camera",tooltipOffContent:"Turn on camera",tooltipVideoLoadingContent:"Video is loading",cameraMenuTitle:"Camera",cameraMenuTooltip:"Choose camera",cameraButtonSplitRoleDescription:"Split button",onSplitButtonAriaLabel:"Turn off camera and camera options",offSplitButtonAriaLabel:"Turn on camera and camera options",cameraActionTurnedOnAnnouncement:"Your camera has been turned on",cameraActionTurnedOffAnnouncement:"Your camera has been turned off",onSplitButtonPrimaryActionCamera:"Turn off camera",offSplitButtonPrimaryActionCamera:"Turn on camera",cameraPrimaryActionSplitButtonTitle:"Use camera"};var microphoneButton$d={onLabel:"Mute",offLabel:"Unmute",tooltipDisabledContent:"Microphone is disabled",tooltipOnContent:"Mute microphone",tooltipOffContent:"Unmute microphone",microphoneMenuTitle:"Microphone",microphoneMenuTooltip:"Choose microphone",speakerMenuTitle:"Speaker",speakerMenuTooltip:"Choose speaker",microphoneButtonSplitRoleDescription:"Split button",onSplitButtonAriaLabel:"Mute microphone and audio options",offSplitButtonAriaLabel:"Unmute microphone and audio options",microphoneActionTurnedOnAnnouncement:"Your microphone has been turned on",microphoneActionTurnedOffAnnouncement:"Your microphone has been turned off",offSplitButtonMicrophonePrimaryAction:"Unmute microphone",onSplitButtonMicrophonePrimaryAction:"Mute microphone",micPrimaryActionSplitButtonTitle:"Use microphone"};var devicesButton$d={label:"Devices",tooltipContent:"Manage devices",cameraMenuTitle:"Camera",cameraMenuTooltip:"Choose camera",audioDeviceMenuTitle:"Audio Device",audioDeviceMenuTooltip:"Choose audio device",microphoneMenuTitle:"Microphone",microphoneMenuTooltip:"Choose microphone",speakerMenuTitle:"Speaker",speakerMenuTooltip:"Choose speaker"};var participantsButton$d={label:"People",tooltipContent:"Show participants",menuHeader:"In this call",participantsListButtonLabel:"{numParticipants} people",muteAllButtonLabel:"Mute all",copyInviteLinkButtonLabel:"Copy invite link",copyInviteLinkActionedAriaLabel:"Invite link copied"};var screenShareButton$d={onLabel:"Stop presenting",offLabel:"Present",tooltipDisabledContent:"Presenting is disabled",tooltipOnContent:"Presenting your screen",tooltipOffContent:"Present your screen"};var messageThread$d={yesterday:"Yesterday",sunday:"Sunday",monday:"Monday",tuesday:"Tuesday",wednesday:"Wednesday",thursday:"Thursday",friday:"Friday",saturday:"Saturday",participantJoined:"joined the chat.",participantLeft:"left the chat.",editMessage:"Edit",removeMessage:"Delete",resendMessage:"Try sending again",failToSendTag:"Failed to send",editedTag:"Edited",liveAuthorIntro:"{author} says",messageContentAriaText:"{author} said {message}",messageContentMineAriaText:"You said {message}",editBoxTextLimit:"Your message is over the limit of {limitNumber} characters",editBoxPlaceholderText:"Edit your message",newMessagesIndicator:"New messages",noDisplayNameSub:"No name",editBoxCancelButton:"Cancel",editBoxSubmitButton:"Submit",messageReadCount:"Read by {messageReadByCount} of {remoteParticipantsCount}",actionMenuMoreOptions:"More Options",downloadFile:"Download file",blockedWarningText:"This message was deleted due to organizational policy.",blockedWarningLinkText:"Details"};var errorBar$d={unableToReachChatService:"You are offline",accessDenied:"Unable to access chat services - please check the user credentials provided",userNotInChatThread:"You are no longer in this chat thread",sendMessageNotInChatThread:"Failed to send message because you are no longer in this chat thread",sendMessageGeneric:"Failed to send message",callingNetworkFailure:"Troubling connecting call - you seem to be offline",startVideoGeneric:"Failed to start video",stopVideoGeneric:"Failed to stop video",muteGeneric:"Failed to mute microphone",unmuteGeneric:"Failed to unmute microphone",speakingWhileMuted:"Your microphone is muted",startScreenShareGeneric:"Failed to start screen sharing",stopScreenShareGeneric:"Failed to stop screen sharing",callNetworkQualityLow:"Network quality is low.",callNoSpeakerFound:"No speakers or headphones found. Connect an audio device to hear the call.",callNoMicrophoneFound:"No microphones found. Connect an audio input device.",callMicrophoneAccessDenied:"Unable to access microphone. Click the lock in the address bar to grant permission to this webpage.",callMicrophoneAccessDeniedSafari:"Unable to access microphone. Refresh the page to allow permissions, or check this browser’s settings and verify permissions are enabled for this website.",callMicrophoneMutedBySystem:"You are muted by your system.",callMicrophoneUnmutedBySystem:"Your microphone recovered and you were unmuted by your system.",callMacOsMicrophoneAccessDenied:"Unable to access microphone. Grant microphone permission in your macOS privacy settings.",callLocalVideoFreeze:"Network bandwidth is poor. Your video may appear paused for others on the call.",callCameraAccessDenied:"Unable to access camera. Click the lock in the address bar to grant permission to this webpage.",callCameraAccessDeniedSafari:"Unable to access camera. Refresh the page to allow permissions, or check this browser’s settings and verify permissions are enabled for this website.",callCameraAlreadyInUse:"Unable to access camera. It may already be in use by another application.",callVideoStoppedBySystem:"Your video has been stopped by your system.",callVideoRecoveredBySystem:"Your video has resumed.",callMacOsCameraAccessDenied:"MacOS is blocking access to your camera. Update your privacy settings to allow this browser to access your camera.",callMacOsScreenShareAccessDenied:"MacOS is blocking screen sharing. Update your privacy settings to allow this browser to record your screen.",dismissButtonAriaLabel:"Close",failedToJoinCallGeneric:"Failed to join call.",failedToJoinCallInvalidMeetingLink:"Unable to join Meeting. Invalid Link.",startScreenSharingGeneric:"There was an issue starting screen share.",cameraFrozenForRemoteParticipants:"Users in the call are having issues seeing your video. Please check your devices and network.",unableToStartVideoEffect:"Unable to apply video effect."};var videoGallery$d={screenIsBeingSharedMessage:"You are sharing your screen",screenShareLoadingMessage:"Loading {participant}'s screen",localVideoLabel:"You",localVideoCameraSwitcherLabel:"Switch camera",localVideoMovementLabel:"Movable Local Video Tile",localVideoSelectedDescription:"{cameraName} selected",displayNamePlaceholder:"Unnamed participant",fitRemoteParticipantToFrame:"Fit to frame",fillRemoteParticipantFrame:"Fill frame",pinParticipantForMe:"Pin for me",pinParticipantForMeLimitReached:"Pin (limit reached)",unpinParticipantForMe:"Unpin",pinParticipantMenuItemAriaLabel:"Pin {participantName}",unpinParticipantMenuItemAriaLabel:"Unpin {participantName}",pinnedParticipantAnnouncementAriaLabel:"Pinned {participantName}",unpinnedParticipantAnnouncementAriaLabel:"Unpinned {participantName}"};var dialpad$d={placeholderText:"Enter phone number",deleteButtonAriaLabel:"Delete"};var holdButton$d={onLabel:"Resume",offLabel:"Hold",tooltipOnContent:"Resume call",tooltipOffContent:"Hold call"};var videoTile$d={participantStateRinging:"Calling...",participantStateHold:"On hold"};var CameraAndMicrophoneSitePermissionsRequest$d={primaryText:"Allow {appName} to use your camera and microphone",secondaryText:"This is so participants can see and hear you.",linkText:"Need help? Get troubleshooting help",primaryButtonText:"Continue without camera and microphone",ariaLabel:"Allow camera and microphone access"};var CameraSitePermissionsRequest$d={primaryText:"Allow {appName} to use your camera",secondaryText:"This is so participants can see you.",linkText:"Need help? Get troubleshooting help",primaryButtonText:"Continue without camera",ariaLabel:"Allow camera access"};var MicrophoneSitePermissionsRequest$d={primaryText:"Allow {appName} to use your microphone",secondaryText:"This is so participants can hear you.",linkText:"Need help? Get troubleshooting help",primaryButtonText:"Continue without microphone",ariaLabel:"Allow microphone access"};var CameraAndMicrophoneSitePermissionsCheck$d={primaryText:"Checking for camera and microphone access",secondaryText:"Allow access if prompted. This is so participants can see and hear you.",linkText:"Need help? Get troubleshooting help",primaryButtonText:"Continue without camera and microphone",ariaLabel:"Checking for camera and microphone access. Allow access if prompted."};var CameraSitePermissionsCheck$d={primaryText:"Checking for camera access",secondaryText:"Allow access if prompted. This is so participants can see you.",linkText:"Need help? Get troubleshooting help",primaryButtonText:"Continue without camera",ariaLabel:"Checking for camera access. Allow access if prompted."};var MicrophoneSitePermissionsCheck$d={primaryText:"Checking for microphone access",secondaryText:"Allow access if prompted. This is so participants can hear you.",linkText:"Need help? Get troubleshooting help",primaryButtonText:"Continue without microphone",ariaLabel:"Checking for microphone access. Allow access if prompted."};var CameraAndMicrophoneSitePermissionsDenied$d={primaryText:"Unable to access camera and microphone",secondaryText:"Click the lock icon in the address bar to grant microphone permissions to this webpage. A page refresh may be required.",primaryButtonText:"Continue without camera and microphone",linkText:"Need help? Get troubleshooting help"};var CameraAndMicrophoneSitePermissionsDeniedSafari$d={primaryText:"Unable to access camera and microphone",secondaryText:"Refresh the page to allow permissions, or check this browser’s settings and verify permissions are enabled for this website.",primaryButtonText:"Continue without camera and microphone",linkText:"Need help? Get troubleshooting help"};var CameraSitePermissionsDenied$d={primaryText:"Unable to access camera",secondaryText:"Click the lock icon in the address bar to grant camera permissions to this webpage. A page refresh may be required.",primaryButtonText:"Continue without camera",linkText:"Need help? Get troubleshooting help"};var MicrophoneSitePermissionsDenied$d={primaryText:"Unable to access microphone",secondaryText:"Click the lock icon in the address bar to grant microphone permissions to this webpage. A page refresh may be required.",primaryButtonText:"Continue without microphone",linkText:"Need help? Get troubleshooting help"};var CameraSitePermissionsDeniedSafari$d={primaryText:"Unable to access camera",secondaryText:"Refresh the page to allow permissions, or check this browser’s settings and verify permissions are enabled for this website.",primaryButtonText:"Continue without camera",linkText:"Need help? Get troubleshooting help"};var MicrophoneSitePermissionsDeniedSafari$d={primaryText:"Unable to access microphone",secondaryText:"Refresh the page to allow permissions, or check this browser’s settings and verify permissions are enabled for this website.",primaryButtonText:"Continue without microphone",linkText:"Need help? Get troubleshooting help"};var UnsupportedBrowser$e={primaryText:"Browser not supported",secondaryText:"Please join this call using a compatible browser.",moreHelpLinkText:"See compatibility requirements"};var UnsupportedBrowserVersion$e={primaryText:"Browser update needed",secondaryText:"To ensure the best call possible, please update your browser and then try joining the call again.",moreHelpLinkText:"See compatibility requirements",continueAnywayButtonText:"Start call without updating"};var UnsupportedOperatingSystem$e={primaryText:"Operating system not supported",secondaryText:"Please join this call using a device with a compatible operating system.",moreHelpLinkText:"See compatibility requirements"};var BrowserPermissionDenied$d={primaryText:"Can't use your camera or microphone",secondaryText:"Your browser might not have access to your camera or microphone. To fix this, open System Preferences.",primaryButtonText:"Try again",linkText:"Need help? Get troubleshooting help"};var BrowserPermissionDeniedIOS$d={primaryText:"Allow microphone access to continue",secondaryText:"So other participants can hear you.",primaryButtonText:"Try again",imageAltText:"Microphone and camera device permission location for iOS",linkText:"Need help? Get troubleshooting help",step1Text:"Go to the Settings app",step2Text:"Scroll down to settings for this browser",step3Text:"Turn on Microphone (Camera optional)",step4Text:"Try joining the call again",step1DigitText:"1",step2DigitText:"2",step3DigitText:"3",step4DigitText:"4"};var VerticalGallery$e={leftNavButtonAriaLabel:"previous page",rightNavButtonAriaLabel:"next page"};var en_US$1 = {participantItem:participantItem$d,typingIndicator:typingIndicator$d,sendBox:sendBox$d,messageStatusIndicator:messageStatusIndicator$d,endCallButton:endCallButton$d,cameraButton:cameraButton$d,microphoneButton:microphoneButton$d,devicesButton:devicesButton$d,participantsButton:participantsButton$d,screenShareButton:screenShareButton$d,messageThread:messageThread$d,errorBar:errorBar$d,videoGallery:videoGallery$d,dialpad:dialpad$d,holdButton:holdButton$d,videoTile:videoTile$d,CameraAndMicrophoneSitePermissionsRequest:CameraAndMicrophoneSitePermissionsRequest$d,CameraSitePermissionsRequest:CameraSitePermissionsRequest$d,MicrophoneSitePermissionsRequest:MicrophoneSitePermissionsRequest$d,CameraAndMicrophoneSitePermissionsCheck:CameraAndMicrophoneSitePermissionsCheck$d,CameraSitePermissionsCheck:CameraSitePermissionsCheck$d,MicrophoneSitePermissionsCheck:MicrophoneSitePermissionsCheck$d,CameraAndMicrophoneSitePermissionsDenied:CameraAndMicrophoneSitePermissionsDenied$d,CameraAndMicrophoneSitePermissionsDeniedSafari:CameraAndMicrophoneSitePermissionsDeniedSafari$d,CameraSitePermissionsDenied:CameraSitePermissionsDenied$d,MicrophoneSitePermissionsDenied:MicrophoneSitePermissionsDenied$d,CameraSitePermissionsDeniedSafari:CameraSitePermissionsDeniedSafari$d,MicrophoneSitePermissionsDeniedSafari:MicrophoneSitePermissionsDeniedSafari$d,UnsupportedBrowser:UnsupportedBrowser$e,UnsupportedBrowserVersion:UnsupportedBrowserVersion$e,UnsupportedOperatingSystem:UnsupportedOperatingSystem$e,BrowserPermissionDenied:BrowserPermissionDenied$d,BrowserPermissionDeniedIOS:BrowserPermissionDeniedIOS$d,VerticalGallery:VerticalGallery$e};
4480
+ var participantItem$d={isMeText:"(you)",menuTitle:"More Options",removeButtonLabel:"Remove",sharingIconLabel:"Sharing",mutedIconLabel:"Muted",displayNamePlaceholder:"Unnamed participant",participantStateRinging:"Calling...",participantStateHold:"On hold"};var typingIndicator$d={singleUser:"{user} is typing ...",multipleUsers:"{users} are typing ...",multipleUsersAbbreviateOne:"{users} and 1 other are typing ...",multipleUsersAbbreviateMany:"{users} and {numOthers} others are typing ...",delimiter:", "};var sendBox$d={placeholderText:"Enter a message",textTooLong:"Your message length is over the maximum limit.",sendButtonAriaLabel:"Send message",fileUploadsPendingError:"Uploading... Please wait.",removeFile:"Remove file",uploading:"Uploading",uploadCompleted:"Upload completed"};var mentionPopover={mentionPopoverHeader:"Suggestions"};var messageStatusIndicator$d={deliveredAriaLabel:"Message sent",deliveredTooltipText:"Sent",seenAriaLabel:"Message seen by others",seenTooltipText:"Seen",readByTooltipText:"Read by {messageThreadReadCount} of {remoteParticipantsCount}",sendingAriaLabel:"Message sending",sendingTooltipText:"Sending",failedToSendAriaLabel:"Message failed to send",failedToSendTooltipText:"Failed to send"};var endCallButton$d={label:"Leave",tooltipContent:"Leave call"};var cameraButton$d={onLabel:"Turn off",offLabel:"Turn on",tooltipDisabledContent:"Camera is disabled",tooltipOnContent:"Turn off camera",tooltipOffContent:"Turn on camera",tooltipVideoLoadingContent:"Video is loading",cameraMenuTitle:"Camera",cameraMenuTooltip:"Choose camera",cameraButtonSplitRoleDescription:"Split button",onSplitButtonAriaLabel:"Turn off camera and camera options",offSplitButtonAriaLabel:"Turn on camera and camera options",cameraActionTurnedOnAnnouncement:"Your camera has been turned on",cameraActionTurnedOffAnnouncement:"Your camera has been turned off",onSplitButtonPrimaryActionCamera:"Turn off camera",offSplitButtonPrimaryActionCamera:"Turn on camera",cameraPrimaryActionSplitButtonTitle:"Use camera"};var microphoneButton$d={onLabel:"Mute",offLabel:"Unmute",tooltipDisabledContent:"Microphone is disabled",tooltipOnContent:"Mute microphone",tooltipOffContent:"Unmute microphone",microphoneMenuTitle:"Microphone",microphoneMenuTooltip:"Choose microphone",speakerMenuTitle:"Speaker",speakerMenuTooltip:"Choose speaker",microphoneButtonSplitRoleDescription:"Split button",onSplitButtonAriaLabel:"Mute microphone and audio options",offSplitButtonAriaLabel:"Unmute microphone and audio options",microphoneActionTurnedOnAnnouncement:"Your microphone has been turned on",microphoneActionTurnedOffAnnouncement:"Your microphone has been turned off",offSplitButtonMicrophonePrimaryAction:"Unmute microphone",onSplitButtonMicrophonePrimaryAction:"Mute microphone",micPrimaryActionSplitButtonTitle:"Use microphone"};var devicesButton$d={label:"Devices",tooltipContent:"Manage devices",cameraMenuTitle:"Camera",cameraMenuTooltip:"Choose camera",audioDeviceMenuTitle:"Audio Device",audioDeviceMenuTooltip:"Choose audio device",microphoneMenuTitle:"Microphone",microphoneMenuTooltip:"Choose microphone",speakerMenuTitle:"Speaker",speakerMenuTooltip:"Choose speaker"};var participantsButton$d={label:"People",tooltipContent:"Show participants",menuHeader:"In this call",participantsListButtonLabel:"{numParticipants} people",muteAllButtonLabel:"Mute all",copyInviteLinkButtonLabel:"Copy invite link",copyInviteLinkActionedAriaLabel:"Invite link copied"};var screenShareButton$d={onLabel:"Stop presenting",offLabel:"Present",tooltipDisabledContent:"Presenting is disabled",tooltipOnContent:"Presenting your screen",tooltipOffContent:"Present your screen"};var messageThread$d={yesterday:"Yesterday",sunday:"Sunday",monday:"Monday",tuesday:"Tuesday",wednesday:"Wednesday",thursday:"Thursday",friday:"Friday",saturday:"Saturday",participantJoined:"joined the chat.",participantLeft:"left the chat.",editMessage:"Edit",removeMessage:"Delete",resendMessage:"Try sending again",failToSendTag:"Failed to send",editedTag:"Edited",liveAuthorIntro:"{author} says",messageContentAriaText:"{author} said {message}",messageContentMineAriaText:"You said {message}",editBoxTextLimit:"Your message is over the limit of {limitNumber} characters",editBoxPlaceholderText:"Edit your message",newMessagesIndicator:"New messages",noDisplayNameSub:"No name",editBoxCancelButton:"Cancel",editBoxSubmitButton:"Submit",messageReadCount:"Read by {messageReadByCount} of {remoteParticipantsCount}",actionMenuMoreOptions:"More Options",downloadFile:"Download file",blockedWarningText:"This message was deleted due to organizational policy.",blockedWarningLinkText:"Details"};var errorBar$d={unableToReachChatService:"You are offline",accessDenied:"Unable to access chat services - please check the user credentials provided",userNotInChatThread:"You are no longer in this chat thread",sendMessageNotInChatThread:"Failed to send message because you are no longer in this chat thread",sendMessageGeneric:"Failed to send message",callingNetworkFailure:"Troubling connecting call - you seem to be offline",startVideoGeneric:"Failed to start video",stopVideoGeneric:"Failed to stop video",muteGeneric:"Failed to mute microphone",unmuteGeneric:"Failed to unmute microphone",speakingWhileMuted:"Your microphone is muted",startScreenShareGeneric:"Failed to start screen sharing",stopScreenShareGeneric:"Failed to stop screen sharing",callNetworkQualityLow:"Network quality is low.",callNoSpeakerFound:"No speakers or headphones found. Connect an audio device to hear the call.",callNoMicrophoneFound:"No microphones found. Connect an audio input device.",callMicrophoneAccessDenied:"Unable to access microphone. Click the lock in the address bar to grant permission to this webpage.",callMicrophoneAccessDeniedSafari:"Unable to access microphone. Refresh the page to allow permissions, or check this browser’s settings and verify permissions are enabled for this website.",callMicrophoneMutedBySystem:"You are muted by your system.",callMicrophoneUnmutedBySystem:"Your microphone recovered and you were unmuted by your system.",callMacOsMicrophoneAccessDenied:"Unable to access microphone. Grant microphone permission in your macOS privacy settings.",callLocalVideoFreeze:"Network bandwidth is poor. Your video may appear paused for others on the call.",callCameraAccessDenied:"Unable to access camera. Click the lock in the address bar to grant permission to this webpage.",callCameraAccessDeniedSafari:"Unable to access camera. Refresh the page to allow permissions, or check this browser’s settings and verify permissions are enabled for this website.",callCameraAlreadyInUse:"Unable to access camera. It may already be in use by another application.",callVideoStoppedBySystem:"Your video has been stopped by your system.",callVideoRecoveredBySystem:"Your video has resumed.",callMacOsCameraAccessDenied:"MacOS is blocking access to your camera. Update your privacy settings to allow this browser to access your camera.",callMacOsScreenShareAccessDenied:"MacOS is blocking screen sharing. Update your privacy settings to allow this browser to record your screen.",dismissButtonAriaLabel:"Close",failedToJoinCallGeneric:"Failed to join call.",failedToJoinCallInvalidMeetingLink:"Unable to join Meeting. Invalid Link.",startScreenSharingGeneric:"There was an issue starting screen share.",cameraFrozenForRemoteParticipants:"Users in the call are having issues seeing your video. Please check your devices and network.",unableToStartVideoEffect:"Unable to apply video effect."};var videoGallery$d={screenIsBeingSharedMessage:"You are sharing your screen",screenShareLoadingMessage:"Loading {participant}'s screen",localVideoLabel:"You",localVideoCameraSwitcherLabel:"Switch camera",localVideoMovementLabel:"Movable Local Video Tile",localVideoSelectedDescription:"{cameraName} selected",displayNamePlaceholder:"Unnamed participant",fitRemoteParticipantToFrame:"Fit to frame",fillRemoteParticipantFrame:"Fill frame",pinParticipantForMe:"Pin for me",pinParticipantForMeLimitReached:"Pin (limit reached)",unpinParticipantForMe:"Unpin",pinParticipantMenuItemAriaLabel:"Pin {participantName}",unpinParticipantMenuItemAriaLabel:"Unpin {participantName}",pinnedParticipantAnnouncementAriaLabel:"Pinned {participantName}",unpinnedParticipantAnnouncementAriaLabel:"Unpinned {participantName}"};var dialpad$d={placeholderText:"Enter phone number",deleteButtonAriaLabel:"Delete"};var holdButton$d={onLabel:"Resume",offLabel:"Hold",tooltipOnContent:"Resume call",tooltipOffContent:"Hold call"};var videoTile$d={participantStateRinging:"Calling...",participantStateHold:"On hold"};var CameraAndMicrophoneSitePermissionsRequest$d={primaryText:"Allow {appName} to use your camera and microphone",secondaryText:"This is so participants can see and hear you.",linkText:"Need help? Get troubleshooting help",primaryButtonText:"Continue without camera and microphone",ariaLabel:"Allow camera and microphone access"};var CameraSitePermissionsRequest$d={primaryText:"Allow {appName} to use your camera",secondaryText:"This is so participants can see you.",linkText:"Need help? Get troubleshooting help",primaryButtonText:"Continue without camera",ariaLabel:"Allow camera access"};var MicrophoneSitePermissionsRequest$d={primaryText:"Allow {appName} to use your microphone",secondaryText:"This is so participants can hear you.",linkText:"Need help? Get troubleshooting help",primaryButtonText:"Continue without microphone",ariaLabel:"Allow microphone access"};var CameraAndMicrophoneSitePermissionsCheck$d={primaryText:"Checking for camera and microphone access",secondaryText:"Allow access if prompted. This is so participants can see and hear you.",linkText:"Need help? Get troubleshooting help",primaryButtonText:"Continue without camera and microphone",ariaLabel:"Checking for camera and microphone access. Allow access if prompted."};var CameraSitePermissionsCheck$d={primaryText:"Checking for camera access",secondaryText:"Allow access if prompted. This is so participants can see you.",linkText:"Need help? Get troubleshooting help",primaryButtonText:"Continue without camera",ariaLabel:"Checking for camera access. Allow access if prompted."};var MicrophoneSitePermissionsCheck$d={primaryText:"Checking for microphone access",secondaryText:"Allow access if prompted. This is so participants can hear you.",linkText:"Need help? Get troubleshooting help",primaryButtonText:"Continue without microphone",ariaLabel:"Checking for microphone access. Allow access if prompted."};var CameraAndMicrophoneSitePermissionsDenied$d={primaryText:"Unable to access camera and microphone",secondaryText:"Click the lock icon in the address bar to grant microphone permissions to this webpage. A page refresh may be required.",primaryButtonText:"Continue without camera and microphone",linkText:"Need help? Get troubleshooting help"};var CameraAndMicrophoneSitePermissionsDeniedSafari$d={primaryText:"Unable to access camera and microphone",secondaryText:"Refresh the page to allow permissions, or check this browser’s settings and verify permissions are enabled for this website.",primaryButtonText:"Continue without camera and microphone",linkText:"Need help? Get troubleshooting help"};var CameraSitePermissionsDenied$d={primaryText:"Unable to access camera",secondaryText:"Click the lock icon in the address bar to grant camera permissions to this webpage. A page refresh may be required.",primaryButtonText:"Continue without camera",linkText:"Need help? Get troubleshooting help"};var MicrophoneSitePermissionsDenied$d={primaryText:"Unable to access microphone",secondaryText:"Click the lock icon in the address bar to grant microphone permissions to this webpage. A page refresh may be required.",primaryButtonText:"Continue without microphone",linkText:"Need help? Get troubleshooting help"};var CameraSitePermissionsDeniedSafari$d={primaryText:"Unable to access camera",secondaryText:"Refresh the page to allow permissions, or check this browser’s settings and verify permissions are enabled for this website.",primaryButtonText:"Continue without camera",linkText:"Need help? Get troubleshooting help"};var MicrophoneSitePermissionsDeniedSafari$d={primaryText:"Unable to access microphone",secondaryText:"Refresh the page to allow permissions, or check this browser’s settings and verify permissions are enabled for this website.",primaryButtonText:"Continue without microphone",linkText:"Need help? Get troubleshooting help"};var UnsupportedBrowser$e={primaryText:"Browser not supported",secondaryText:"Please join this call using a compatible browser.",moreHelpLinkText:"See compatibility requirements"};var UnsupportedBrowserVersion$e={primaryText:"Browser update needed",secondaryText:"To ensure the best call possible, please update your browser and then try joining the call again.",moreHelpLinkText:"See compatibility requirements",continueAnywayButtonText:"Start call without updating"};var UnsupportedOperatingSystem$e={primaryText:"Operating system not supported",secondaryText:"Please join this call using a device with a compatible operating system.",moreHelpLinkText:"See compatibility requirements"};var BrowserPermissionDenied$d={primaryText:"Can't use your camera or microphone",secondaryText:"Your browser might not have access to your camera or microphone. To fix this, open System Preferences.",primaryButtonText:"Try again",linkText:"Need help? Get troubleshooting help"};var BrowserPermissionDeniedIOS$d={primaryText:"Allow microphone access to continue",secondaryText:"So other participants can hear you.",primaryButtonText:"Try again",imageAltText:"Microphone and camera device permission location for iOS",linkText:"Need help? Get troubleshooting help",step1Text:"Go to the Settings app",step2Text:"Scroll down to settings for this browser",step3Text:"Turn on Microphone (Camera optional)",step4Text:"Try joining the call again",step1DigitText:"1",step2DigitText:"2",step3DigitText:"3",step4DigitText:"4"};var VerticalGallery$e={leftNavButtonAriaLabel:"previous page",rightNavButtonAriaLabel:"next page"};var en_US$1 = {participantItem:participantItem$d,typingIndicator:typingIndicator$d,sendBox:sendBox$d,mentionPopover:mentionPopover,messageStatusIndicator:messageStatusIndicator$d,endCallButton:endCallButton$d,cameraButton:cameraButton$d,microphoneButton:microphoneButton$d,devicesButton:devicesButton$d,participantsButton:participantsButton$d,screenShareButton:screenShareButton$d,messageThread:messageThread$d,errorBar:errorBar$d,videoGallery:videoGallery$d,dialpad:dialpad$d,holdButton:holdButton$d,videoTile:videoTile$d,CameraAndMicrophoneSitePermissionsRequest:CameraAndMicrophoneSitePermissionsRequest$d,CameraSitePermissionsRequest:CameraSitePermissionsRequest$d,MicrophoneSitePermissionsRequest:MicrophoneSitePermissionsRequest$d,CameraAndMicrophoneSitePermissionsCheck:CameraAndMicrophoneSitePermissionsCheck$d,CameraSitePermissionsCheck:CameraSitePermissionsCheck$d,MicrophoneSitePermissionsCheck:MicrophoneSitePermissionsCheck$d,CameraAndMicrophoneSitePermissionsDenied:CameraAndMicrophoneSitePermissionsDenied$d,CameraAndMicrophoneSitePermissionsDeniedSafari:CameraAndMicrophoneSitePermissionsDeniedSafari$d,CameraSitePermissionsDenied:CameraSitePermissionsDenied$d,MicrophoneSitePermissionsDenied:MicrophoneSitePermissionsDenied$d,CameraSitePermissionsDeniedSafari:CameraSitePermissionsDeniedSafari$d,MicrophoneSitePermissionsDeniedSafari:MicrophoneSitePermissionsDeniedSafari$d,UnsupportedBrowser:UnsupportedBrowser$e,UnsupportedBrowserVersion:UnsupportedBrowserVersion$e,UnsupportedOperatingSystem:UnsupportedOperatingSystem$e,BrowserPermissionDenied:BrowserPermissionDenied$d,BrowserPermissionDeniedIOS:BrowserPermissionDeniedIOS$d,VerticalGallery:VerticalGallery$e};
4479
4481
 
4480
4482
  var participantItem$c={isMeText:"(you)",menuTitle:"More Options",removeButtonLabel:"Remove",sharingIconLabel:"Sharing",mutedIconLabel:"Muted",displayNamePlaceholder:"Unnamed participant",participantStateRinging:"Calling...",participantStateHold:"On hold"};var typingIndicator$c={singleUser:"{user} is typing ...",multipleUsers:"{users} are typing ...",multipleUsersAbbreviateOne:"{users} and 1 other are typing ...",multipleUsersAbbreviateMany:"{users} and {numOthers} others are typing ...",delimiter:", "};var sendBox$c={placeholderText:"Enter a message",textTooLong:"Your message length is over the maximum limit.",sendButtonAriaLabel:"Send message",fileUploadsPendingError:"Uploading... Please wait.",removeFile:"Remove file",uploading:"Uploading",uploadCompleted:"Upload completed"};var messageStatusIndicator$c={deliveredAriaLabel:"Message sent",deliveredTooltipText:"Sent",seenAriaLabel:"Message seen by others",seenTooltipText:"Seen",readByTooltipText:"Read by {messageThreadReadCount} of {remoteParticipantsCount}",sendingAriaLabel:"Message sending",sendingTooltipText:"Sending",failedToSendAriaLabel:"Message failed to send",failedToSendTooltipText:"Failed to send"};var endCallButton$c={label:"Leave",tooltipContent:"Leave call"};var cameraButton$c={onLabel:"Turn off",offLabel:"Turn on",tooltipDisabledContent:"Camera is disabled",tooltipOnContent:"Turn off camera",tooltipOffContent:"Turn on camera",tooltipVideoLoadingContent:"Video is loading",cameraMenuTitle:"Camera",cameraMenuTooltip:"Choose camera",cameraButtonSplitRoleDescription:"Split button",onSplitButtonAriaLabel:"Turn off camera and camera options",offSplitButtonAriaLabel:"Turn on camera and camera options",cameraActionTurnedOnAnnouncement:"Your camera has been turned on",cameraActionTurnedOffAnnouncement:"Your camera has been turned off",onSplitButtonPrimaryActionCamera:"Turn off camera",offSplitButtonPrimaryActionCamera:"Turn on camera",cameraPrimaryActionSplitButtonTitle:"Use camera"};var microphoneButton$c={onLabel:"Mute",offLabel:"Unmute",tooltipDisabledContent:"Microphone is disabled",tooltipOnContent:"Mute microphone",tooltipOffContent:"Unmute microphone",microphoneMenuTitle:"Microphone",microphoneMenuTooltip:"Choose microphone",speakerMenuTitle:"Speaker",speakerMenuTooltip:"Choose speaker",microphoneButtonSplitRoleDescription:"Split button",onSplitButtonAriaLabel:"Mute microphone and audio options",offSplitButtonAriaLabel:"Unmute microphone and audio options",microphoneActionTurnedOnAnnouncement:"Your microphone has been turned on",microphoneActionTurnedOffAnnouncement:"Your microphone has been turned off",offSplitButtonMicrophonePrimaryAction:"Unmute microphone",onSplitButtonMicrophonePrimaryAction:"Mute microphone",micPrimaryActionSplitButtonTitle:"Use microphone"};var devicesButton$c={label:"Devices",tooltipContent:"Manage devices",cameraMenuTitle:"Camera",cameraMenuTooltip:"Choose camera",audioDeviceMenuTitle:"Audio Device",audioDeviceMenuTooltip:"Choose audio device",microphoneMenuTitle:"Microphone",microphoneMenuTooltip:"Choose microphone",speakerMenuTitle:"Speaker",speakerMenuTooltip:"Choose speaker"};var participantsButton$c={label:"People",tooltipContent:"Show participants",menuHeader:"In this call",participantsListButtonLabel:"{numParticipants} people",muteAllButtonLabel:"Mute all",copyInviteLinkButtonLabel:"Copy invite link",copyInviteLinkActionedAriaLabel:"Invite link copied"};var screenShareButton$c={onLabel:"Stop presenting",offLabel:"Present",tooltipDisabledContent:"Presenting is disabled",tooltipOnContent:"Presenting your screen",tooltipOffContent:"Present your screen"};var messageThread$c={yesterday:"Yesterday",sunday:"Sunday",monday:"Monday",tuesday:"Tuesday",wednesday:"Wednesday",thursday:"Thursday",friday:"Friday",saturday:"Saturday",participantJoined:"joined the chat.",participantLeft:"left the chat.",editMessage:"Edit",removeMessage:"Delete",resendMessage:"Try sending again",failToSendTag:"Failed to send",editedTag:"Edited",liveAuthorIntro:"{author} says",messageContentAriaText:"{author} said {message}",messageContentMineAriaText:"You said {message}",editBoxTextLimit:"Your message is over the limit of {limitNumber} characters",editBoxPlaceholderText:"Edit your message",newMessagesIndicator:"New messages",noDisplayNameSub:"No name",editBoxCancelButton:"Cancel",editBoxSubmitButton:"Submit",messageReadCount:"Read by {messageReadByCount} of {remoteParticipantsCount}",actionMenuMoreOptions:"More Options",downloadFile:"Download file",blockedWarningText:"This message was deleted due to organisational policy.",blockedWarningLinkText:"Details"};var errorBar$c={unableToReachChatService:"You are offline",accessDenied:"Unable to access chat services - please check the user credentials provided",userNotInChatThread:"You are no longer in this chat thread",sendMessageNotInChatThread:"Failed to send message because you are no longer in this chat thread",sendMessageGeneric:"Failed to send message",callingNetworkFailure:"Troubling connecting call - you seem to be offline",startVideoGeneric:"Failed to start video",stopVideoGeneric:"Failed to stop video",muteGeneric:"Failed to mute microphone",unmuteGeneric:"Failed to unmute microphone",speakingWhileMuted:"Your microphone is muted",startScreenShareGeneric:"Failed to start screen sharing",stopScreenShareGeneric:"Failed to stop screen sharing",callNetworkQualityLow:"Network quality is low.",callNoSpeakerFound:"No speakers or headphones found. Connect an audio device to hear the call.",callNoMicrophoneFound:"No microphones found. Connect an audio input device.",callMicrophoneAccessDenied:"Unable to access microphone. Click the lock in the address bar to grant permission to this webpage.",callMicrophoneAccessDeniedSafari:"Unable to access microphone. Refresh the page to allow permissions, or check this browser’s settings and verify permissions are enabled for this website.",callMicrophoneMutedBySystem:"You are muted by your system.",callMicrophoneUnmutedBySystem:"Your microphone recovered and you were unmuted by your system.",callMacOsMicrophoneAccessDenied:"Unable to access microphone. Grant microphone permission in your macOS privacy settings.",callLocalVideoFreeze:"Network bandwidth is poor. Your video may appear paused for others on the call.",callCameraAccessDenied:"Unable to access camera. Click the lock in the address bar to grant permission to this webpage.",callCameraAccessDeniedSafari:"Unable to access camera. Refresh the page to allow permissions, or check this browser’s settings and verify permissions are enabled for this website.",callCameraAlreadyInUse:"Unable to access camera. It may already be in use by another application.",callVideoStoppedBySystem:"Your video has been stopped by your system.",callVideoRecoveredBySystem:"Your video has resumed.",callMacOsCameraAccessDenied:"MacOS is blocking access to your camera. Update your privacy settings to allow this browser to access your camera.",callMacOsScreenShareAccessDenied:"MacOS is blocking screen sharing. Update your privacy settings to allow this browser to record your screen.",dismissButtonAriaLabel:"Close",failedToJoinCallGeneric:"Failed to join call.",failedToJoinCallInvalidMeetingLink:"Unable to join Meeting. Invalid Link.",startScreenSharingGeneric:"There was an issue starting screen share.",cameraFrozenForRemoteParticipants:"Users in the call are having issues seeing your video. Please check your devices and network."};var videoGallery$c={screenIsBeingSharedMessage:"You are sharing your screen",screenShareLoadingMessage:"Loading {participant}'s screen",localVideoLabel:"You",localVideoCameraSwitcherLabel:"Switch camera",localVideoMovementLabel:"Movable Local Video Tile",localVideoSelectedDescription:"{cameraName} selected",displayNamePlaceholder:"Unnamed participant",fitRemoteParticipantToFrame:"Fit to frame",fillRemoteParticipantFrame:"Fill frame",pinParticipantForMe:"Pin for me",pinParticipantForMeLimitReached:"Pin (limit reached)",unpinParticipantForMe:"Unpin",pinParticipantMenuItemAriaLabel:"Pin {participantName}",unpinParticipantMenuItemAriaLabel:"Unpin {participantName}",pinnedParticipantAnnouncementAriaLabel:"Pinned {participantName}",unpinnedParticipantAnnouncementAriaLabel:"Unpinned {participantName}"};var dialpad$c={placeholderText:"Enter phone number",deleteButtonAriaLabel:"Delete"};var holdButton$c={onLabel:"Resume",offLabel:"Hold",tooltipOnContent:"Resume call",tooltipOffContent:"Hold call"};var videoTile$c={participantStateRinging:"Calling...",participantStateHold:"On hold"};var CameraAndMicrophoneSitePermissionsRequest$c={primaryText:"Allow {appName} to use your camera and microphone",secondaryText:"This is so participants can see and hear you.",linkText:"Need help? Get troubleshooting help",primaryButtonText:"Continue without camera and microphone",ariaLabel:"Allow camera and microphone access"};var CameraSitePermissionsRequest$c={primaryText:"Allow {appName} to use your camera",secondaryText:"This is so participants can see you.",linkText:"Need help? Get troubleshooting help",primaryButtonText:"Continue without camera",ariaLabel:"Allow camera access"};var MicrophoneSitePermissionsRequest$c={primaryText:"Allow {appName} to use your microphone",secondaryText:"This is so participants can hear you.",linkText:"Need help? Get troubleshooting help",primaryButtonText:"Continue without microphone",ariaLabel:"Allow microphone access"};var CameraAndMicrophoneSitePermissionsCheck$c={primaryText:"Checking for camera and microphone access",secondaryText:"Allow access if prompted. This is so participants can see and hear you.",linkText:"Need help? Get troubleshooting help",primaryButtonText:"Continue without camera and microphone",ariaLabel:"Checking for camera and microphone access. Allow access if prompted."};var CameraSitePermissionsCheck$c={primaryText:"Checking for camera access",secondaryText:"Allow access if prompted. This is so participants can see you.",linkText:"Need help? Get troubleshooting help",primaryButtonText:"Continue without camera",ariaLabel:"Checking for camera access. Allow access if prompted."};var MicrophoneSitePermissionsCheck$c={primaryText:"Checking for microphone access",secondaryText:"Allow access if prompted. This is so participants can hear you.",linkText:"Need help? Get troubleshooting help",primaryButtonText:"Continue without microphone",ariaLabel:"Checking for microphone access. Allow access if prompted."};var CameraAndMicrophoneSitePermissionsDenied$c={primaryText:"Unable to access camera and microphone",secondaryText:"Click the lock icon in the address bar to grant microphone permissions to this webpage. A page refresh may be required.",primaryButtonText:"Continue without camera and microphone",linkText:"Need help? Get troubleshooting help"};var CameraAndMicrophoneSitePermissionsDeniedSafari$c={primaryText:"Unable to access camera and microphone",secondaryText:"Refresh the page to allow permissions, or check this browser’s settings and verify permissions are enabled for this website.",primaryButtonText:"Continue without camera and microphone",linkText:"Need help? Get troubleshooting help"};var CameraSitePermissionsDenied$c={primaryText:"Unable to access camera",secondaryText:"Click the lock icon in the address bar to grant camera permissions to this webpage. A page refresh may be required.",primaryButtonText:"Continue without camera",linkText:"Need help? Get troubleshooting help"};var MicrophoneSitePermissionsDenied$c={primaryText:"Unable to access microphone",secondaryText:"Click the lock icon in the address bar to grant microphone permissions to this webpage. A page refresh may be required.",primaryButtonText:"Continue without microphone",linkText:"Need help? Get troubleshooting help"};var CameraSitePermissionsDeniedSafari$c={primaryText:"Unable to access camera",secondaryText:"Refresh the page to allow permissions, or check this browser’s settings and verify permissions are enabled for this website.",primaryButtonText:"Continue without camera",linkText:"Need help? Get troubleshooting help"};var MicrophoneSitePermissionsDeniedSafari$c={primaryText:"Unable to access microphone",secondaryText:"Refresh the page to allow permissions, or check this browser’s settings and verify permissions are enabled for this website.",primaryButtonText:"Continue without microphone",linkText:"Need help? Get troubleshooting help"};var UnsupportedBrowser$d={primaryText:"Browser not supported",secondaryText:"Please join this call using a compatible browser.",moreHelpLinkText:"See compatibility requirements"};var UnsupportedBrowserVersion$d={primaryText:"Browser update needed",secondaryText:"To ensure the best call possible, please update your browser and then try joining the call again.",moreHelpLinkText:"See compatibility requirements",continueAnywayButtonText:"Start call without updating"};var UnsupportedOperatingSystem$d={primaryText:"Operating system not supported",secondaryText:"Please join this call using a device with a compatible operating system.",moreHelpLinkText:"See compatibility requirements"};var BrowserPermissionDenied$c={primaryText:"Can't use your camera or microphone",secondaryText:"Your browser might not have access to your camera or microphone. To fix this, open System Preferences.",primaryButtonText:"Try again",linkText:"Need help? Get troubleshooting help"};var BrowserPermissionDeniedIOS$c={primaryText:"Allow microphone access to continue",secondaryText:"So other participants can hear you.",primaryButtonText:"Try again",imageAltText:"Microphone and camera device permission location for iOS",linkText:"Need help? Get troubleshooting help",step1Text:"Go to the Settings app",step2Text:"Scroll down to settings for this browser",step3Text:"Turn on Microphone (Camera optional)",step4Text:"Try joining the call again",step1DigitText:"1",step2DigitText:"2",step3DigitText:"3",step4DigitText:"4"};var VerticalGallery$d={leftNavButtonAriaLabel:"previous page",rightNavButtonAriaLabel:"next page"};var en_GB$1 = {participantItem:participantItem$c,typingIndicator:typingIndicator$c,sendBox:sendBox$c,messageStatusIndicator:messageStatusIndicator$c,endCallButton:endCallButton$c,cameraButton:cameraButton$c,microphoneButton:microphoneButton$c,devicesButton:devicesButton$c,participantsButton:participantsButton$c,screenShareButton:screenShareButton$c,messageThread:messageThread$c,errorBar:errorBar$c,videoGallery:videoGallery$c,dialpad:dialpad$c,holdButton:holdButton$c,videoTile:videoTile$c,CameraAndMicrophoneSitePermissionsRequest:CameraAndMicrophoneSitePermissionsRequest$c,CameraSitePermissionsRequest:CameraSitePermissionsRequest$c,MicrophoneSitePermissionsRequest:MicrophoneSitePermissionsRequest$c,CameraAndMicrophoneSitePermissionsCheck:CameraAndMicrophoneSitePermissionsCheck$c,CameraSitePermissionsCheck:CameraSitePermissionsCheck$c,MicrophoneSitePermissionsCheck:MicrophoneSitePermissionsCheck$c,CameraAndMicrophoneSitePermissionsDenied:CameraAndMicrophoneSitePermissionsDenied$c,CameraAndMicrophoneSitePermissionsDeniedSafari:CameraAndMicrophoneSitePermissionsDeniedSafari$c,CameraSitePermissionsDenied:CameraSitePermissionsDenied$c,MicrophoneSitePermissionsDenied:MicrophoneSitePermissionsDenied$c,CameraSitePermissionsDeniedSafari:CameraSitePermissionsDeniedSafari$c,MicrophoneSitePermissionsDeniedSafari:MicrophoneSitePermissionsDeniedSafari$c,UnsupportedBrowser:UnsupportedBrowser$d,UnsupportedBrowserVersion:UnsupportedBrowserVersion$d,UnsupportedOperatingSystem:UnsupportedOperatingSystem$d,BrowserPermissionDenied:BrowserPermissionDenied$c,BrowserPermissionDeniedIOS:BrowserPermissionDeniedIOS$c,VerticalGallery:VerticalGallery$d};
4481
4483
 
@@ -4638,10 +4640,10 @@ const defaultIdentifiers = {
4638
4640
  horizontalGalleryVideoTile: 'horizontal-gallery-video-tile',
4639
4641
  /* @conditional-compile-remove(vertical-gallery) */
4640
4642
  verticalGalleryPageCounter: 'vertical-gallery-page-counter',
4641
- /* @conditional-compile-remove(at-mention) */
4642
- atMentionSuggestionList: 'at-mention-suggestion-list',
4643
- /* @conditional-compile-remove(at-mention) */
4644
- atMentionSuggestionItem: 'at-mention-suggestion-item'
4643
+ /* @conditional-compile-remove(mention) */
4644
+ mentionSuggestionList: 'mention-suggestion-list',
4645
+ /* @conditional-compile-remove(mention) */
4646
+ mentionSuggestionItem: 'mention-suggestion-item'
4645
4647
  };
4646
4648
  /**
4647
4649
  * @private
@@ -5835,11 +5837,253 @@ const getPerceptualBrightnessOfHexColor = (hexColor) => {
5835
5837
  };
5836
5838
 
5837
5839
  // Copyright (c) Microsoft Corporation.
5840
+ /**
5841
+ * @private
5842
+ * z-index to ensure that chat container has lower z-index than mention popover
5843
+ */
5844
+ const CHAT_CONTAINER_ZINDEX$1 = 1;
5845
+ /**
5846
+ * @private
5847
+ */
5848
+ const mentionPopoverContainerStyle = (theme) => react.mergeStyles({
5849
+ boxShadow: theme.effects.elevation16,
5850
+ background: theme.semanticColors.bodyBackground,
5851
+ overflow: 'visible',
5852
+ // zIndex to set the mentionPopover above the chat container
5853
+ zIndex: CHAT_CONTAINER_ZINDEX$1 + 1
5854
+ });
5855
+ /**
5856
+ * @private
5857
+ */
5858
+ const headerStyleThemed = (theme) => {
5859
+ return {
5860
+ root: {
5861
+ color: theme.palette.neutralSecondary,
5862
+ margin: '0.5rem 1rem 0.25rem',
5863
+ fontSize: theme.fonts.smallPlus.fontSize
5864
+ }
5865
+ };
5866
+ };
5867
+ /**
5868
+ * @private
5869
+ */
5870
+ react.mergeStyles({
5871
+ height: '100%',
5872
+ overflowY: 'visible',
5873
+ overflowX: 'hidden'
5874
+ });
5875
+ /**
5876
+ * @private
5877
+ */
5878
+ const suggestionListStyle = react.mergeStyles({
5879
+ padding: '0.25rem 0rem 0',
5880
+ overflow: 'visible'
5881
+ });
5882
+ /**
5883
+ * @private
5884
+ */
5885
+ const suggestionItemWrapperStyle = (theme) => {
5886
+ return react.mergeStyles({
5887
+ margin: '0.05rem 0.1rem',
5888
+ '&:focus-visible': {
5889
+ outline: `${theme.palette.black} solid 0.1rem`
5890
+ }
5891
+ });
5892
+ };
5893
+ /**
5894
+ * @private
5895
+ */
5896
+ const suggestionItemStackStyle = (theme, isSuggestionHovered, activeBorder) => {
5897
+ return react.mergeStyles({
5898
+ width: '10rem',
5899
+ alignItems: 'center',
5900
+ height: '36px',
5901
+ padding: '0 0.75rem',
5902
+ background: isSuggestionHovered ? theme.palette.neutralLight : theme.palette.white,
5903
+ border: activeBorder ? `0.0625rem solid ${theme.palette.neutralSecondary}` : 'none'
5904
+ });
5905
+ };
5906
+
5907
+ // Copyright (c) Microsoft Corporation.
5908
+ /**
5909
+ * Component to render a pop-up of mention suggestions.
5910
+ *
5911
+ * @internal
5912
+ */
5913
+ const _MentionPopover = (props) => {
5914
+ const { suggestions, activeSuggestionIndex, title, target, targetPositionOffset, onRenderSuggestionItem, onSuggestionSelected, onDismiss, location } = props;
5915
+ const theme = react.useTheme();
5916
+ /* @conditional-compile-remove(mention) */
5917
+ const ids = useIdentifiers();
5918
+ const localeStrings = useLocale$1().strings;
5919
+ const popoverRef = React.useRef();
5920
+ const [position, setPosition] = React.useState({ left: 0 });
5921
+ const [hoveredSuggestion, setHoveredSuggestion] = React.useState(undefined);
5922
+ const [changedSelection, setChangedSelection] = React.useState(undefined); // Selection UI as per teams
5923
+ const dismissPopoverWhenClickingOutside = React.useCallback((e) => {
5924
+ const target = e.target;
5925
+ if (popoverRef.current && !popoverRef.current.contains(target)) {
5926
+ onDismiss && onDismiss();
5927
+ }
5928
+ }, [onDismiss]);
5929
+ React.useEffect(() => {
5930
+ if (changedSelection === undefined) {
5931
+ setChangedSelection(false);
5932
+ }
5933
+ else if (changedSelection === false) {
5934
+ setChangedSelection(true);
5935
+ }
5936
+ }, [activeSuggestionIndex, changedSelection]);
5937
+ React.useEffect(() => {
5938
+ window && window.addEventListener('click', dismissPopoverWhenClickingOutside);
5939
+ return () => {
5940
+ window && window.removeEventListener('click', dismissPopoverWhenClickingOutside);
5941
+ };
5942
+ }, [dismissPopoverWhenClickingOutside]);
5943
+ // Determine popover position
5944
+ React.useEffect(() => {
5945
+ var _a, _b, _c, _d, _e, _f, _g, _h;
5946
+ const rect = (_a = target === null || target === void 0 ? void 0 : target.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
5947
+ const maxWidth = 200;
5948
+ const finalPosition = { maxWidth };
5949
+ // Figure out whether it will fit horizontally
5950
+ const leftOffset = (_b = targetPositionOffset === null || targetPositionOffset === void 0 ? void 0 : targetPositionOffset.left) !== null && _b !== void 0 ? _b : 0;
5951
+ if (leftOffset + maxWidth > ((_c = rect === null || rect === void 0 ? void 0 : rect.width) !== null && _c !== void 0 ? _c : 0)) {
5952
+ finalPosition.right = ((_d = rect === null || rect === void 0 ? void 0 : rect.width) !== null && _d !== void 0 ? _d : 0) - leftOffset;
5953
+ }
5954
+ else {
5955
+ finalPosition.left = leftOffset;
5956
+ }
5957
+ if (location === 'below') {
5958
+ finalPosition.top = ((_e = rect === null || rect === void 0 ? void 0 : rect.height) !== null && _e !== void 0 ? _e : 0) + ((_f = targetPositionOffset === null || targetPositionOffset === void 0 ? void 0 : targetPositionOffset.top) !== null && _f !== void 0 ? _f : 0);
5959
+ }
5960
+ else {
5961
+ // (location === 'above')
5962
+ finalPosition.bottom = ((_g = rect === null || rect === void 0 ? void 0 : rect.height) !== null && _g !== void 0 ? _g : 0) - ((_h = targetPositionOffset === null || targetPositionOffset === void 0 ? void 0 : targetPositionOffset.top) !== null && _h !== void 0 ? _h : 0);
5963
+ }
5964
+ setPosition(finalPosition);
5965
+ }, [location, target, targetPositionOffset]);
5966
+ const handleOnKeyDown = React.useCallback((e) => {
5967
+ switch (e.key) {
5968
+ case 'Escape':
5969
+ onDismiss && onDismiss();
5970
+ break;
5971
+ }
5972
+ }, [onDismiss]);
5973
+ const personaRenderer = React.useCallback((displayName) => {
5974
+ const displayNamePlaceholder = localeStrings.participantItem.displayNamePlaceholder;
5975
+ const avatarOptions = {
5976
+ text: (displayName === null || displayName === void 0 ? void 0 : displayName.trim()) || displayNamePlaceholder,
5977
+ size: react.PersonaSize.size24,
5978
+ initialsColor: theme.palette.neutralLight,
5979
+ initialsTextColor: theme.palette.neutralSecondary,
5980
+ showOverflowTooltip: false,
5981
+ showUnknownPersonaCoin: !(displayName === null || displayName === void 0 ? void 0 : displayName.trim()) || displayName === displayNamePlaceholder
5982
+ };
5983
+ return React__default['default'].createElement(react.Persona, Object.assign({}, avatarOptions));
5984
+ }, [localeStrings, theme]);
5985
+ const defaultOnRenderSuggestionItem = React.useCallback((suggestion, onSuggestionSelected, active) => {
5986
+ return (React__default['default'].createElement("div", { "data-is-focusable": true, "data-ui-id": ids.mentionSuggestionItem, key: suggestion.id, onClick: () => onSuggestionSelected(suggestion), onMouseEnter: () => setHoveredSuggestion(suggestion), onMouseLeave: () => setHoveredSuggestion(undefined), onKeyDown: (e) => {
5987
+ handleOnKeyDown(e);
5988
+ }, className: suggestionItemWrapperStyle(theme) },
5989
+ React__default['default'].createElement(react.Stack, { horizontal: true, className: suggestionItemStackStyle(theme, (hoveredSuggestion === null || hoveredSuggestion === void 0 ? void 0 : hoveredSuggestion.id) === suggestion.id, (changedSelection !== null && changedSelection !== void 0 ? changedSelection : false) && active) }, personaRenderer(suggestion.displayText))));
5990
+ }, [
5991
+ handleOnKeyDown,
5992
+ theme,
5993
+ /* @conditional-compile-remove(mention) */
5994
+ ids,
5995
+ hoveredSuggestion,
5996
+ changedSelection,
5997
+ personaRenderer
5998
+ ]);
5999
+ const getHeaderTitle = React.useCallback(() => {
6000
+ if (title) {
6001
+ return title;
6002
+ }
6003
+ /* @conditional-compile-remove(mention) */
6004
+ return localeStrings.mentionPopover.mentionPopoverHeader;
6005
+ }, [localeStrings, title]);
6006
+ return (React__default['default'].createElement("div", { ref: popoverRef },
6007
+ React__default['default'].createElement(react.Stack, { className: react.mergeStyles({
6008
+ maxHeight: 212,
6009
+ maxWidth: position.maxWidth
6010
+ }, mentionPopoverContainerStyle(theme), Object.assign(Object.assign({}, position), { position: 'absolute' })) },
6011
+ React__default['default'].createElement(react.Stack.Item, { styles: headerStyleThemed(theme), "aria-label": title }, getHeaderTitle()),
6012
+ React__default['default'].createElement(react.Stack
6013
+ /* @conditional-compile-remove(mention) */
6014
+ , { "data-ui-id": ids.mentionSuggestionList, className: suggestionListStyle }, suggestions.map((suggestion, index) => {
6015
+ const active = index === activeSuggestionIndex;
6016
+ return onRenderSuggestionItem
6017
+ ? onRenderSuggestionItem(suggestion, onSuggestionSelected, active)
6018
+ : defaultOnRenderSuggestionItem(suggestion, onSuggestionSelected, active);
6019
+ })))));
6020
+ };
6021
+
6022
+ // Copyright (c) Microsoft Corporation.
6023
+ // Licensed under the MIT license.
6024
+ var __awaiter$v = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
6025
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
6026
+ return new (P || (P = Promise))(function (resolve, reject) {
6027
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6028
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6029
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
6030
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
6031
+ });
6032
+ };
6033
+ /* @conditional-compile-remove(mention) */
6034
+ const defaultMentionTrigger = '@';
5838
6035
  /**
5839
6036
  * @private
5840
6037
  */
5841
6038
  const InputBoxComponent = (props) => {
5842
- const { styles, id, 'data-ui-id': dataUiId, textValue, onChange, textFieldRef, placeholderText, onKeyDown, onEnterKeyDown, supportNewline, inputClassName, errorMessage, disabled, children } = props;
6039
+ const { styles, id, 'data-ui-id': dataUiId, textValue, onChange, textFieldRef, placeholderText, onKeyDown, onEnterKeyDown, supportNewline, inputClassName, errorMessage, disabled, children,
6040
+ /* @conditional-compile-remove(mention) */
6041
+ mentionLookupOptions } = props;
6042
+ const inputBoxRef = React.useRef(null);
6043
+ /* @conditional-compile-remove(mention) */
6044
+ // Current suggestion list, provided by the callback
6045
+ const [mentionSuggestions, setMentionSuggestions] = React.useState([]);
6046
+ /* @conditional-compile-remove(mention) */
6047
+ // Current suggestion list, provided by the callback
6048
+ const [activeSuggestionIndex, setActiveSuggestionIndex] = React.useState(undefined);
6049
+ /* @conditional-compile-remove(mention) */
6050
+ // Index of the current trigger character in the text field
6051
+ const [currentTriggerStartIndex, setCurrentTriggerStartIndex] = React.useState(-1);
6052
+ /* @conditional-compile-remove(mention) */
6053
+ const [inputTextValue, setInputTextValue] = React.useState('');
6054
+ /* @conditional-compile-remove(mention) */
6055
+ const [tagsValue, setTagsValue] = React.useState([]);
6056
+ /* @conditional-compile-remove(mention) */
6057
+ const [selectionStartValue, setSelectionStartValue] = React.useState(null);
6058
+ /* @conditional-compile-remove(mention) */
6059
+ const [selectionEndValue, setSelectionEndValue] = React.useState(null);
6060
+ /* @conditional-compile-remove(mention) */
6061
+ const [shouldHandleOnMouseDownDuringSelect, setShouldHandleOnMouseDownDuringSelect] = React.useState(true);
6062
+ /* @conditional-compile-remove(mention) */
6063
+ // Caret position in the text field
6064
+ const [caretPosition, setCaretPosition] = React.useState(undefined);
6065
+ /* @conditional-compile-remove(mention) */
6066
+ // Index of where the caret is in the text field
6067
+ const [caretIndex, setCaretIndex] = React.useState(undefined);
6068
+ /* @conditional-compile-remove(mention) */
6069
+ const localeStrings = useLocale$1().strings;
6070
+ /* @conditional-compile-remove(mention) */
6071
+ const updateMentionSuggestions = React.useCallback((suggestions) => {
6072
+ var _a;
6073
+ setMentionSuggestions(suggestions);
6074
+ if (caretIndex !== undefined) {
6075
+ (_a = textFieldRef === null || textFieldRef === void 0 ? void 0 : textFieldRef.current) === null || _a === void 0 ? void 0 : _a.setSelectionEnd(caretIndex);
6076
+ }
6077
+ }, [textFieldRef, caretIndex]);
6078
+ /* @conditional-compile-remove(mention) */
6079
+ // Parse the text and get the plain text version to display in the input box
6080
+ React.useEffect(() => {
6081
+ const trigger = (mentionLookupOptions === null || mentionLookupOptions === void 0 ? void 0 : mentionLookupOptions.trigger) || defaultMentionTrigger;
6082
+ const [tags, plainText] = textToTagParser(textValue, trigger);
6083
+ setInputTextValue(plainText);
6084
+ setTagsValue(tags);
6085
+ updateMentionSuggestions([]);
6086
+ }, [textValue, mentionLookupOptions === null || mentionLookupOptions === void 0 ? void 0 : mentionLookupOptions.trigger, updateMentionSuggestions]);
5843
6087
  const mergedRootStyle = react.mergeStyles(inputBoxWrapperStyle, styles === null || styles === void 0 ? void 0 : styles.root);
5844
6088
  const mergedTextFiledStyle = react.mergeStyles(inputBoxStyle, inputClassName, props.inlineChildren ? {} : inputBoxNewLineSpaceAffordance);
5845
6089
  const mergedTextContainerStyle = react.mergeStyles(textContainerStyle, styles === null || styles === void 0 ? void 0 : styles.textFieldContainer);
@@ -5847,20 +6091,307 @@ const InputBoxComponent = (props) => {
5847
6091
  fieldGroup: styles === null || styles === void 0 ? void 0 : styles.textField,
5848
6092
  errorMessage: styles === null || styles === void 0 ? void 0 : styles.systemMessage
5849
6093
  });
5850
- const onTexFieldKeyDown = React.useCallback((ev) => {
6094
+ /* @conditional-compile-remove(mention) */
6095
+ const onSuggestionSelected = React.useCallback((suggestion) => {
6096
+ var _a, _b;
6097
+ let selectionEnd = ((_a = textFieldRef === null || textFieldRef === void 0 ? void 0 : textFieldRef.current) === null || _a === void 0 ? void 0 : _a.selectionEnd) || -1;
6098
+ if (selectionEnd < 0) {
6099
+ selectionEnd = 0;
6100
+ }
6101
+ else if (selectionEnd > inputTextValue.length) {
6102
+ selectionEnd = inputTextValue.length;
6103
+ }
6104
+ const oldPlainText = inputTextValue;
6105
+ const mention = htmlStringForMentionSuggestion(suggestion, localeStrings);
6106
+ // update plain text with the mention html text
6107
+ const newPlainText = inputTextValue.substring(0, currentTriggerStartIndex) + mention + inputTextValue.substring(selectionEnd);
6108
+ const triggerText = (_b = mentionLookupOptions === null || mentionLookupOptions === void 0 ? void 0 : mentionLookupOptions.trigger) !== null && _b !== void 0 ? _b : defaultMentionTrigger;
6109
+ // update html text with updated plain text
6110
+ const [updatedHTML] = updateHTML(textValue, oldPlainText, newPlainText, tagsValue, currentTriggerStartIndex, selectionEnd, mention, triggerText);
6111
+ const displayName = getDisplayNameForMentionSuggestion(suggestion, localeStrings);
6112
+ // Move the caret in the text field to the end of the mention plain text
6113
+ setCaretIndex(selectionEnd + displayName.length);
6114
+ setCurrentTriggerStartIndex(-1);
6115
+ updateMentionSuggestions([]);
6116
+ setActiveSuggestionIndex(undefined);
6117
+ onChange && onChange(undefined, updatedHTML);
6118
+ }, [
6119
+ textFieldRef,
6120
+ inputTextValue,
6121
+ currentTriggerStartIndex,
6122
+ mentionLookupOptions === null || mentionLookupOptions === void 0 ? void 0 : mentionLookupOptions.trigger,
6123
+ onChange,
6124
+ textValue,
6125
+ tagsValue,
6126
+ /* @conditional-compile-remove(mention) */
6127
+ updateMentionSuggestions,
6128
+ /* @conditional-compile-remove(mention) */
6129
+ localeStrings
6130
+ ]);
6131
+ const onTextFieldKeyDown = React.useCallback((ev) => {
5851
6132
  // Uses KeyCode 229 and which code 229 to determine if the press of the enter key is from a composition session or not (Safari only)
5852
6133
  if (ev.nativeEvent.isComposing || ev.nativeEvent.keyCode === 229 || ev.nativeEvent.which === 229) {
5853
6134
  return;
5854
6135
  }
6136
+ if (ev.key === 'ArrowUp') {
6137
+ ev.preventDefault();
6138
+ /* @conditional-compile-remove(mention) */
6139
+ if (mentionSuggestions.length > 0) {
6140
+ const newActiveIndex = activeSuggestionIndex === undefined
6141
+ ? mentionSuggestions.length - 1
6142
+ : Math.max(activeSuggestionIndex - 1, 0);
6143
+ setActiveSuggestionIndex(newActiveIndex);
6144
+ }
6145
+ }
6146
+ else if (ev.key === 'ArrowDown') {
6147
+ ev.preventDefault();
6148
+ /* @conditional-compile-remove(mention) */
6149
+ if (mentionSuggestions.length > 0) {
6150
+ const newActiveIndex = activeSuggestionIndex === undefined
6151
+ ? 0
6152
+ : Math.min(activeSuggestionIndex + 1, mentionSuggestions.length - 1);
6153
+ setActiveSuggestionIndex(newActiveIndex);
6154
+ }
6155
+ }
5855
6156
  if (ev.key === 'Enter' && (ev.shiftKey === false || !supportNewline)) {
5856
6157
  ev.preventDefault();
6158
+ // If we are looking up a mention, select the focused suggestion
6159
+ /* @conditional-compile-remove(mention) */
6160
+ if (mentionSuggestions.length > 0 && activeSuggestionIndex !== undefined) {
6161
+ const selectedMention = mentionSuggestions[activeSuggestionIndex];
6162
+ if (selectedMention) {
6163
+ onSuggestionSelected(selectedMention);
6164
+ return;
6165
+ }
6166
+ }
5857
6167
  onEnterKeyDown && onEnterKeyDown();
5858
6168
  }
5859
6169
  onKeyDown && onKeyDown(ev);
5860
- }, [onEnterKeyDown, onKeyDown, supportNewline]);
6170
+ }, [
6171
+ onEnterKeyDown,
6172
+ onKeyDown,
6173
+ supportNewline,
6174
+ /* @conditional-compile-remove(mention) */
6175
+ mentionSuggestions,
6176
+ /* @conditional-compile-remove(mention) */
6177
+ activeSuggestionIndex,
6178
+ /* @conditional-compile-remove(mention) */
6179
+ onSuggestionSelected
6180
+ ]);
6181
+ /* @conditional-compile-remove(mention) */
6182
+ const debouncedQueryUpdate = useDebounce.useDebouncedCallback((query) => __awaiter$v(void 0, void 0, void 0, function* () {
6183
+ var _a;
6184
+ const suggestions = (_a = (yield (mentionLookupOptions === null || mentionLookupOptions === void 0 ? void 0 : mentionLookupOptions.onQueryUpdated(query)))) !== null && _a !== void 0 ? _a : [];
6185
+ if (suggestions.length === 0) {
6186
+ setActiveSuggestionIndex(undefined);
6187
+ }
6188
+ else if (activeSuggestionIndex === undefined) {
6189
+ setActiveSuggestionIndex(0);
6190
+ }
6191
+ updateMentionSuggestions(suggestions);
6192
+ }), 500);
6193
+ /* @conditional-compile-remove(mention) */
6194
+ React.useEffect(() => {
6195
+ return () => {
6196
+ debouncedQueryUpdate.cancel();
6197
+ };
6198
+ }, [debouncedQueryUpdate]);
6199
+ /* @conditional-compile-remove(mention) */
6200
+ const handleOnChange = React.useCallback((event, updatedValue) => __awaiter$v(void 0, void 0, void 0, function* () {
6201
+ var _b, _c;
6202
+ const newValue = updatedValue !== null && updatedValue !== void 0 ? updatedValue : '';
6203
+ const triggerText = (_b = mentionLookupOptions === null || mentionLookupOptions === void 0 ? void 0 : mentionLookupOptions.trigger) !== null && _b !== void 0 ? _b : defaultMentionTrigger;
6204
+ const newTextLength = newValue.length;
6205
+ let selectionEnd = ((_c = textFieldRef === null || textFieldRef === void 0 ? void 0 : textFieldRef.current) === null || _c === void 0 ? void 0 : _c.selectionEnd) || -1;
6206
+ selectionEnd = Math.max(0, selectionEnd);
6207
+ selectionEnd = Math.min(selectionEnd, newTextLength - 1);
6208
+ // If we are enabled for lookups,
6209
+ if (mentionLookupOptions !== undefined) {
6210
+ // Look at the range of the change for a trigger character
6211
+ const triggerPriorIndex = newValue.lastIndexOf(triggerText, selectionEnd - 1);
6212
+ // Update the caret position, if not doing a lookup
6213
+ setCaretPosition(textareaCaretTs.Caret.getRelativePosition(event.currentTarget));
6214
+ if (triggerPriorIndex !== undefined) {
6215
+ // trigger is found
6216
+ const isSpaceBeforeTrigger = newValue.substring(triggerPriorIndex - 1, triggerPriorIndex) === ' ';
6217
+ const wordAtSelection = newValue.substring(triggerPriorIndex, selectionEnd);
6218
+ let tagIndex = currentTriggerStartIndex;
6219
+ if (!isSpaceBeforeTrigger && triggerPriorIndex !== 0) {
6220
+ //no space before the trigger <- continuation of the previous word
6221
+ tagIndex = -1;
6222
+ setCurrentTriggerStartIndex(tagIndex);
6223
+ }
6224
+ else if (wordAtSelection === triggerText) {
6225
+ // start of the mention
6226
+ tagIndex = selectionEnd - triggerText.length;
6227
+ if (tagIndex < 0) {
6228
+ tagIndex = 0;
6229
+ }
6230
+ setCurrentTriggerStartIndex(tagIndex);
6231
+ }
6232
+ if (tagIndex === -1) {
6233
+ updateMentionSuggestions([]);
6234
+ }
6235
+ else {
6236
+ // In the middle of a @mention lookup
6237
+ if (tagIndex > -1) {
6238
+ const query = wordAtSelection.substring(triggerText.length, wordAtSelection.length);
6239
+ if (query !== undefined) {
6240
+ yield debouncedQueryUpdate(query);
6241
+ }
6242
+ }
6243
+ }
6244
+ }
6245
+ }
6246
+ let result = '';
6247
+ if (tagsValue.length === 0) {
6248
+ // no tags in the string, textValue is a sting
6249
+ result = newValue;
6250
+ }
6251
+ else {
6252
+ // there are tags in the text value, textValue is html string
6253
+ const { changeStart, oldChangeEnd, newChangeEnd } = findStringsDiffIndexes(inputTextValue, newValue, selectionEnd);
6254
+ // get updated html string
6255
+ const change = newValue.substring(changeStart, newChangeEnd);
6256
+ const [updatedHTML, updatedChangeNewEndIndex] = updateHTML(textValue, inputTextValue, newValue, tagsValue, changeStart, oldChangeEnd, change, triggerText);
6257
+ result = updatedHTML;
6258
+ if (updatedChangeNewEndIndex !== null) {
6259
+ if ((change.length === 1 && event.currentTarget.selectionStart === event.currentTarget.selectionEnd) || // simple input
6260
+ (change.length === 0 && newChangeEnd === changeStart) //delete
6261
+ ) {
6262
+ setCaretIndex(updatedChangeNewEndIndex);
6263
+ }
6264
+ }
6265
+ }
6266
+ onChange && onChange(event, result);
6267
+ }), [
6268
+ onChange,
6269
+ mentionLookupOptions,
6270
+ tagsValue,
6271
+ textValue,
6272
+ inputTextValue,
6273
+ currentTriggerStartIndex,
6274
+ setCaretIndex,
6275
+ setCaretPosition,
6276
+ updateMentionSuggestions,
6277
+ debouncedQueryUpdate,
6278
+ textFieldRef
6279
+ ]);
6280
+ /* @conditional-compile-remove(mention) */
6281
+ const updateSelectionIndexesWithMentionIfNeeded = (event) => {
6282
+ var _a;
6283
+ let updatedStartIndex = event.currentTarget.selectionStart;
6284
+ let updatedEndIndex = event.currentTarget.selectionEnd;
6285
+ if (event.currentTarget.selectionStart === event.currentTarget.selectionEnd &&
6286
+ event.currentTarget.selectionStart !== null &&
6287
+ event.currentTarget.selectionStart !== -1) {
6288
+ const mentionTag = findMentionTagForSelection(tagsValue, event.currentTarget.selectionStart);
6289
+ if (mentionTag !== undefined && mentionTag.plainTextBeginIndex !== undefined) {
6290
+ if (selectionStartValue === null) {
6291
+ updatedStartIndex = mentionTag.plainTextBeginIndex;
6292
+ updatedEndIndex = (_a = mentionTag.plainTextEndIndex) !== null && _a !== void 0 ? _a : mentionTag.plainTextBeginIndex;
6293
+ }
6294
+ else {
6295
+ const newSelectionIndex = findNewSelectionIndexForMention(mentionTag, inputTextValue, event.currentTarget.selectionStart, selectionStartValue);
6296
+ updatedStartIndex = newSelectionIndex;
6297
+ updatedEndIndex = newSelectionIndex;
6298
+ }
6299
+ }
6300
+ }
6301
+ else if (event.currentTarget.selectionStart !== event.currentTarget.selectionEnd) {
6302
+ // Both e.currentTarget.selectionStart !== selectionStartValue and e.currentTarget.selectionEnd !== selectionEndValue can be true when a user selects a text by double click
6303
+ if (event.currentTarget.selectionStart !== null && event.currentTarget.selectionStart !== selectionStartValue) {
6304
+ // the selection start is changed
6305
+ const mentionTag = findMentionTagForSelection(tagsValue, event.currentTarget.selectionStart);
6306
+ if (mentionTag !== undefined && mentionTag.plainTextBeginIndex !== undefined) {
6307
+ //TODO: here it takes -1 when it shouldn't, update selectionstart and end with mouse move and or touch move
6308
+ updatedStartIndex = findNewSelectionIndexForMention(mentionTag, inputTextValue, event.currentTarget.selectionStart, selectionStartValue !== null && selectionStartValue !== void 0 ? selectionStartValue : -1);
6309
+ }
6310
+ }
6311
+ if (event.currentTarget.selectionEnd !== null && event.currentTarget.selectionEnd !== selectionEndValue) {
6312
+ // the selection end is changed
6313
+ const mentionTag = findMentionTagForSelection(tagsValue, event.currentTarget.selectionEnd);
6314
+ if (mentionTag !== undefined && mentionTag.plainTextBeginIndex !== undefined) {
6315
+ //TODO: here it takes -1 when it shouldn't, update selectionstart and end with mouse move and or touch move
6316
+ updatedEndIndex = findNewSelectionIndexForMention(mentionTag, inputTextValue, event.currentTarget.selectionEnd, selectionEndValue !== null && selectionEndValue !== void 0 ? selectionEndValue : -1);
6317
+ }
6318
+ }
6319
+ }
6320
+ // e.currentTarget.selectionDirection should be set to handle shift + arrow keys
6321
+ if (event.currentTarget.selectionDirection === null) {
6322
+ event.currentTarget.setSelectionRange(updatedStartIndex, updatedEndIndex);
6323
+ }
6324
+ else {
6325
+ event.currentTarget.setSelectionRange(updatedStartIndex, updatedEndIndex, event.currentTarget.selectionDirection);
6326
+ }
6327
+ setSelectionStartValue(updatedStartIndex);
6328
+ setSelectionEndValue(updatedEndIndex);
6329
+ };
6330
+ const getInputFieldTextValue = () => {
6331
+ /* @conditional-compile-remove(mention) */
6332
+ return inputTextValue;
6333
+ };
5861
6334
  return (React__default['default'].createElement(react.Stack, { className: mergedRootStyle },
5862
6335
  React__default['default'].createElement("div", { className: mergedTextContainerStyle },
5863
- React__default['default'].createElement(react.TextField, { autoFocus: props.autoFocus === 'sendBoxTextField', "data-ui-id": dataUiId, multiline: true, autoAdjustHeight: true, multiple: false, resizable: false, componentRef: textFieldRef, id: id, inputClassName: mergedTextFiledStyle, placeholder: placeholderText, value: textValue, onChange: onChange, autoComplete: "off", onKeyDown: onTexFieldKeyDown, styles: mergedTextFieldStyle, disabled: disabled, errorMessage: errorMessage }),
6336
+ /* @conditional-compile-remove(mention) */ mentionSuggestions.length > 0 && (React__default['default'].createElement(_MentionPopover, { suggestions: mentionSuggestions, activeSuggestionIndex: activeSuggestionIndex, target: inputBoxRef, targetPositionOffset: caretPosition, onRenderSuggestionItem: mentionLookupOptions === null || mentionLookupOptions === void 0 ? void 0 : mentionLookupOptions.onRenderSuggestionItem, onSuggestionSelected: onSuggestionSelected, onDismiss: () => {
6337
+ updateMentionSuggestions([]);
6338
+ } })),
6339
+ React__default['default'].createElement(react.TextField, { autoFocus: props.autoFocus === 'sendBoxTextField', "data-ui-id": dataUiId, multiline: true, autoAdjustHeight: true, multiple: false, resizable: false, componentRef: textFieldRef, id: id, inputClassName: mergedTextFiledStyle, placeholder: placeholderText, value: getInputFieldTextValue(), onChange: (e, newValue) => {
6340
+ /* @conditional-compile-remove(mention) */
6341
+ setInputTextValue(newValue !== null && newValue !== void 0 ? newValue : '');
6342
+ /* @conditional-compile-remove(mention) */
6343
+ handleOnChange(e, newValue);
6344
+ /* @conditional-compile-remove(mention) */
6345
+ return;
6346
+ },
6347
+ /* @conditional-compile-remove(mention) */
6348
+ onSelect: (e) => {
6349
+ var _a, _b, _c;
6350
+ if (caretIndex !== undefined) {
6351
+ e.currentTarget.setSelectionRange(caretIndex, caretIndex);
6352
+ setCaretIndex(undefined);
6353
+ return;
6354
+ }
6355
+ //TODO: need to check to navigate before/after space correctly in tag + when selecting by mouse
6356
+ /* @conditional-compile-remove(mention) */
6357
+ if (shouldHandleOnMouseDownDuringSelect &&
6358
+ e.currentTarget.selectionStart !== null &&
6359
+ e.currentTarget.selectionStart === e.currentTarget.selectionEnd) {
6360
+ // handle mention click
6361
+ const mentionTag = findMentionTagForSelection(tagsValue, e.currentTarget.selectionStart);
6362
+ if (mentionTag !== undefined && mentionTag.plainTextBeginIndex !== undefined) {
6363
+ if (e.currentTarget.selectionDirection === null) {
6364
+ e.currentTarget.setSelectionRange(mentionTag.plainTextBeginIndex, (_a = mentionTag.plainTextEndIndex) !== null && _a !== void 0 ? _a : mentionTag.plainTextBeginIndex);
6365
+ }
6366
+ else {
6367
+ e.currentTarget.setSelectionRange(mentionTag.plainTextBeginIndex, (_b = mentionTag.plainTextEndIndex) !== null && _b !== void 0 ? _b : mentionTag.plainTextBeginIndex, e.currentTarget.selectionDirection);
6368
+ }
6369
+ setSelectionStartValue(mentionTag.plainTextBeginIndex);
6370
+ setSelectionEndValue((_c = mentionTag.plainTextEndIndex) !== null && _c !== void 0 ? _c : mentionTag.plainTextBeginIndex);
6371
+ }
6372
+ else {
6373
+ setSelectionStartValue(e.currentTarget.selectionStart);
6374
+ setSelectionEndValue(e.currentTarget.selectionEnd);
6375
+ }
6376
+ }
6377
+ else {
6378
+ updateSelectionIndexesWithMentionIfNeeded(e);
6379
+ }
6380
+ /* @conditional-compile-remove(mention) */
6381
+ setShouldHandleOnMouseDownDuringSelect(false);
6382
+ }, onMouseDown: () => {
6383
+ // as events order is onMouseDown -> onSelect -> onClick
6384
+ // onClick and onMouseDown can't handle clicking on mention event because
6385
+ // onClick has wrong range as it's called after onSelect
6386
+ // onMouseDown doesn't have correct selectionRange yet
6387
+ // so we need to handle onMouseDown to prevent onSelect default behavior
6388
+ /* @conditional-compile-remove(mention) */
6389
+ setShouldHandleOnMouseDownDuringSelect(true);
6390
+ }, onTouchStart: () => {
6391
+ // see onMouseDown for more details
6392
+ /* @conditional-compile-remove(mention) */
6393
+ setShouldHandleOnMouseDownDuringSelect(true);
6394
+ }, autoComplete: "off", onKeyDown: onTextFieldKeyDown, styles: mergedTextFieldStyle, disabled: disabled, errorMessage: errorMessage, elementRef: inputBoxRef }),
5864
6395
  React__default['default'].createElement(react.Stack, { horizontal: true, className: react.mergeStyles(props.inlineChildren ? inlineButtonsContainerStyle : newLineButtonsContainerStyle) }, children))));
5865
6396
  };
5866
6397
  /**
@@ -5885,6 +6416,682 @@ const InputBoxButton = (props) => {
5885
6416
  setIsHover(false);
5886
6417
  }, onRenderIcon: () => onRenderIcon(isHover) })));
5887
6418
  };
6419
+ /* @conditional-compile-remove(mention) */
6420
+ /**
6421
+ * Find mention tag if selection is inside of it
6422
+ *
6423
+ * @private
6424
+ */
6425
+ const findMentionTagForSelection = (tags, selection) => {
6426
+ let mentionTag = undefined;
6427
+ for (let i = 0; i < tags.length; i++) {
6428
+ const tag = tags[i];
6429
+ let plainTextEndIndex = 0;
6430
+ if (tag.plainTextEndIndex !== undefined && tag.closeTagIdx !== undefined) {
6431
+ // close tag exists
6432
+ plainTextEndIndex = tag.plainTextEndIndex;
6433
+ }
6434
+ else if (tag.plainTextBeginIndex !== undefined) {
6435
+ //no close tag
6436
+ plainTextEndIndex = tag.plainTextBeginIndex;
6437
+ }
6438
+ if (tag.subTags !== undefined && tag.subTags.length !== 0) {
6439
+ const selectedTag = findMentionTagForSelection(tag.subTags, selection);
6440
+ if (selectedTag !== undefined) {
6441
+ mentionTag = selectedTag;
6442
+ break;
6443
+ }
6444
+ }
6445
+ else if (tag.tagType === 'msft-mention' &&
6446
+ tag.plainTextBeginIndex !== undefined &&
6447
+ tag.plainTextBeginIndex < selection &&
6448
+ selection < plainTextEndIndex) {
6449
+ mentionTag = tag;
6450
+ break;
6451
+ }
6452
+ }
6453
+ return mentionTag;
6454
+ };
6455
+ /* @conditional-compile-remove(mention) */
6456
+ /**
6457
+ * Go through tags and find a new the selection index if it is inside of a mention tag
6458
+ *
6459
+ * @private
6460
+ */
6461
+ const findNewSelectionIndexForMention = (tag, textValue, selection, previousSelection) => {
6462
+ var _a;
6463
+ if (tag.plainTextBeginIndex === undefined ||
6464
+ tag.tagType !== 'msft-mention' ||
6465
+ selection === previousSelection ||
6466
+ tag.plainTextEndIndex === undefined) {
6467
+ return selection;
6468
+ }
6469
+ let spaceIndex = 0;
6470
+ if (selection <= previousSelection) {
6471
+ // the cursor is moved to the left
6472
+ spaceIndex = textValue.lastIndexOf(' ', selection !== null && selection !== void 0 ? selection : 0);
6473
+ if (spaceIndex === -1) {
6474
+ // no space before the selection
6475
+ spaceIndex = tag.plainTextBeginIndex;
6476
+ }
6477
+ }
6478
+ else {
6479
+ // the cursor is moved to the right
6480
+ spaceIndex = textValue.indexOf(' ', selection !== null && selection !== void 0 ? selection : 0);
6481
+ if (spaceIndex === -1) {
6482
+ // no space after the selection
6483
+ spaceIndex = (_a = tag.plainTextEndIndex) !== null && _a !== void 0 ? _a : tag.plainTextBeginIndex;
6484
+ }
6485
+ }
6486
+ if (spaceIndex < tag.plainTextBeginIndex) {
6487
+ spaceIndex = tag.plainTextBeginIndex;
6488
+ }
6489
+ else if (spaceIndex > tag.plainTextEndIndex) {
6490
+ spaceIndex = tag.plainTextEndIndex;
6491
+ }
6492
+ return spaceIndex;
6493
+ };
6494
+ /* @conditional-compile-remove(mention) */
6495
+ /**
6496
+ * Handle mention tag edit and by word deleting
6497
+ *
6498
+ * @private
6499
+ */
6500
+ const handleMentionTagUpdate = (htmlText, oldPlainText, lastProcessedHTMLIndex, processedChange, tag, closeTagIdx, closeTagLength, plainTextEndIndex, startIndex, oldPlainTextEndIndex, mentionTagLength) => {
6501
+ if (tag.tagType !== 'msft-mention' || tag.plainTextBeginIndex === undefined) {
6502
+ return ['', processedChange, lastProcessedHTMLIndex, null];
6503
+ }
6504
+ let result = '';
6505
+ let plainTextSelectionEndIndex = null;
6506
+ let rangeStart;
6507
+ let rangeEnd;
6508
+ // check if space symbol is handled in case if string looks like '<1 2 3>'
6509
+ let isSpaceLengthHandled = false;
6510
+ rangeStart = oldPlainText.lastIndexOf(' ', startIndex);
6511
+ if (rangeStart !== -1 && rangeStart !== undefined && rangeStart > tag.plainTextBeginIndex) {
6512
+ isSpaceLengthHandled = true;
6513
+ }
6514
+ rangeEnd = oldPlainText.indexOf(' ', oldPlainTextEndIndex);
6515
+ if (rangeEnd === -1 || rangeEnd === undefined) {
6516
+ // check if space symbol is not found
6517
+ rangeEnd = plainTextEndIndex;
6518
+ }
6519
+ else if (!isSpaceLengthHandled) {
6520
+ // +1 to include the space symbol
6521
+ rangeEnd += 1;
6522
+ }
6523
+ isSpaceLengthHandled = true;
6524
+ if (rangeStart === -1 || rangeStart === undefined || rangeStart < tag.plainTextBeginIndex) {
6525
+ rangeStart = tag.plainTextBeginIndex;
6526
+ }
6527
+ if (rangeEnd > plainTextEndIndex) {
6528
+ rangeEnd = plainTextEndIndex;
6529
+ }
6530
+ if (rangeStart === tag.plainTextBeginIndex && rangeEnd === plainTextEndIndex) {
6531
+ // the whole tag should be removed
6532
+ result += htmlText.substring(lastProcessedHTMLIndex, tag.openTagIdx) + processedChange;
6533
+ plainTextSelectionEndIndex = tag.plainTextBeginIndex + processedChange.length;
6534
+ processedChange = '';
6535
+ lastProcessedHTMLIndex = closeTagIdx + closeTagLength;
6536
+ }
6537
+ else {
6538
+ // only part of the tag should be removed
6539
+ let startChangeDiff = 0;
6540
+ let endChangeDiff = 0;
6541
+ // need to check only rangeStart > tag.plainTextBeginIndex as when rangeStart === tag.plainTextBeginIndex startChangeDiff = 0 and mentionTagLength shouldn't be subtracted
6542
+ if (rangeStart > tag.plainTextBeginIndex) {
6543
+ startChangeDiff = rangeStart - tag.plainTextBeginIndex - mentionTagLength;
6544
+ }
6545
+ endChangeDiff = rangeEnd - tag.plainTextBeginIndex - mentionTagLength;
6546
+ result += htmlText.substring(lastProcessedHTMLIndex, tag.openTagIdx + tag.openTagBody.length + startChangeDiff);
6547
+ // plainTextSelectionEndIndex = rangeStart + processedChange.length;
6548
+ lastProcessedHTMLIndex = tag.openTagIdx + tag.openTagBody.length + endChangeDiff;
6549
+ // processed change should not be changed as it should be added after the tag
6550
+ }
6551
+ return [result, processedChange, lastProcessedHTMLIndex, plainTextSelectionEndIndex];
6552
+ };
6553
+ /* @conditional-compile-remove(mention) */
6554
+ /**
6555
+ * Go through the text and update it with the changed text
6556
+ *
6557
+ * @private
6558
+ */
6559
+ const updateHTML = (htmlText, oldPlainText, newPlainText, tags, startIndex, oldPlainTextEndIndex, change, mentionTrigger) => {
6560
+ let result = '';
6561
+ if (tags.length === 0) {
6562
+ // no tags added yet
6563
+ return [newPlainText, null];
6564
+ }
6565
+ if (startIndex === 0 && oldPlainTextEndIndex === oldPlainText.length) {
6566
+ // the whole text is changed
6567
+ return [newPlainText, null];
6568
+ }
6569
+ let lastProcessedHTMLIndex = 0;
6570
+ // the value can be updated with empty string when the change covers more than 1 place (tag + before or after the tag)
6571
+ // in this case change won't be added as part of the tag
6572
+ // e.g.: change is before and partially in tag => change will be added before the tag and outdated text in the tag will be removed
6573
+ // e.g.: change is after and partially in tag => change will be added after the tag and outdated text in the tag will be removed
6574
+ // e.g.: change is on the beginning of the tag => change will be added before the tag
6575
+ // e.g.: change is on the end of the tag => change will be added to the tag if it's not mention and after the tag if it's mention
6576
+ let processedChange = change;
6577
+ // end tag plain text index of the last processed tag
6578
+ let lastProcessedPlainTextTagEndIndex = 0;
6579
+ // as some tags/text can be removed fully, selectionEnd should be updated correctly
6580
+ let changeNewEndIndex = null;
6581
+ for (let i = 0; i < tags.length; i++) {
6582
+ const tag = tags[i];
6583
+ if (tag.plainTextBeginIndex === undefined) {
6584
+ continue;
6585
+ }
6586
+ // all plain text indexes includes trigger length for the mention that shouldn't be included in
6587
+ // htmlText.substring because html strings don't include the trigger
6588
+ // mentionTagLength will be set only for 'msft-mention', otherwise should be 0
6589
+ let mentionTagLength = 0;
6590
+ let isMentionTag = false;
6591
+ if (tag.tagType === 'msft-mention') {
6592
+ mentionTagLength = mentionTrigger.length;
6593
+ isMentionTag = true;
6594
+ }
6595
+ //change start is before the open tag
6596
+ if (startIndex <= tag.plainTextBeginIndex) {
6597
+ // Math.max(lastProcessedPlainTextTagEndIndex, startIndex) is used as startIndex may not be in [[previous tag].plainTextEndIndex - tag.plainTextBeginIndex] range
6598
+ const startChangeDiff = tag.plainTextBeginIndex - Math.max(lastProcessedPlainTextTagEndIndex, startIndex);
6599
+ result += htmlText.substring(lastProcessedHTMLIndex, tag.openTagIdx - startChangeDiff) + processedChange;
6600
+ if (oldPlainTextEndIndex <= tag.plainTextBeginIndex) {
6601
+ // the whole change is before tag start
6602
+ // oldPlainTextEndIndex already includes mentionTag length
6603
+ const endChangeDiff = tag.plainTextBeginIndex - oldPlainTextEndIndex;
6604
+ lastProcessedHTMLIndex = tag.openTagIdx - endChangeDiff;
6605
+ processedChange = '';
6606
+ // the change is handled; exit
6607
+ break;
6608
+ }
6609
+ else {
6610
+ // change continues in the tag
6611
+ lastProcessedHTMLIndex = tag.openTagIdx;
6612
+ processedChange = '';
6613
+ // proceed to the next check
6614
+ }
6615
+ }
6616
+ let plainTextEndIndex = 0;
6617
+ let closeTagIdx = 0;
6618
+ let closeTagLength = 0;
6619
+ if (tag.plainTextEndIndex !== undefined && tag.closeTagIdx !== undefined) {
6620
+ // close tag exists
6621
+ plainTextEndIndex = tag.plainTextEndIndex;
6622
+ closeTagIdx = tag.closeTagIdx;
6623
+ // tag.tagType.length + </>
6624
+ closeTagLength = tag.tagType.length + 3;
6625
+ }
6626
+ else {
6627
+ // no close tag
6628
+ plainTextEndIndex = tag.plainTextBeginIndex;
6629
+ closeTagIdx = tag.openTagIdx + tag.openTagBody.length;
6630
+ closeTagLength = 0;
6631
+ }
6632
+ if (startIndex < plainTextEndIndex) {
6633
+ // change started before the end tag
6634
+ if (startIndex <= tag.plainTextBeginIndex && oldPlainTextEndIndex === plainTextEndIndex) {
6635
+ // the change is a tag or starts before the tag
6636
+ // tag should be removed, no matter if there are subtags
6637
+ result += htmlText.substring(lastProcessedHTMLIndex, tag.openTagIdx) + processedChange;
6638
+ processedChange = '';
6639
+ lastProcessedHTMLIndex = closeTagIdx + closeTagLength;
6640
+ // the change is handled; exit
6641
+ break;
6642
+ }
6643
+ else if (startIndex >= tag.plainTextBeginIndex && oldPlainTextEndIndex < plainTextEndIndex) {
6644
+ // edge case: the change is between tag
6645
+ if (isMentionTag) {
6646
+ if (change !== '') {
6647
+ // mention tag should be deleted when user tries to edit it
6648
+ result += htmlText.substring(lastProcessedHTMLIndex, tag.openTagIdx) + processedChange;
6649
+ changeNewEndIndex = tag.plainTextBeginIndex + processedChange.length;
6650
+ processedChange = '';
6651
+ lastProcessedHTMLIndex = closeTagIdx + closeTagLength;
6652
+ }
6653
+ else {
6654
+ const [resultValue, updatedChange, htmlIndex, plainTextSelectionEndIndex] = handleMentionTagUpdate(htmlText, oldPlainText, lastProcessedHTMLIndex, processedChange, tag, closeTagIdx, closeTagLength, plainTextEndIndex, startIndex, oldPlainTextEndIndex, mentionTagLength);
6655
+ result += resultValue;
6656
+ changeNewEndIndex = plainTextSelectionEndIndex;
6657
+ processedChange = updatedChange;
6658
+ lastProcessedHTMLIndex = htmlIndex;
6659
+ }
6660
+ // the change is handled; exit
6661
+ break;
6662
+ }
6663
+ else if (tag.subTags !== undefined && tag.subTags.length !== 0 && tag.content) {
6664
+ // with subtags
6665
+ // before the tag content
6666
+ const stringBefore = htmlText.substring(lastProcessedHTMLIndex, tag.openTagIdx + tag.openTagBody.length);
6667
+ lastProcessedHTMLIndex = closeTagIdx;
6668
+ const [content, updatedChangeNewEndIndex] = updateHTML(tag.content, oldPlainText, newPlainText, tag.subTags, startIndex - mentionTagLength, oldPlainTextEndIndex - mentionTagLength, processedChange, mentionTrigger);
6669
+ result += stringBefore + content;
6670
+ changeNewEndIndex = updatedChangeNewEndIndex;
6671
+ break;
6672
+ }
6673
+ else {
6674
+ // no subtags
6675
+ const startChangeDiff = startIndex - tag.plainTextBeginIndex - mentionTagLength;
6676
+ const endChangeDiff = oldPlainTextEndIndex - tag.plainTextBeginIndex - mentionTagLength;
6677
+ result +=
6678
+ htmlText.substring(lastProcessedHTMLIndex, tag.openTagIdx + tag.openTagBody.length + startChangeDiff) +
6679
+ processedChange;
6680
+ processedChange = '';
6681
+ lastProcessedHTMLIndex = tag.openTagIdx + tag.openTagBody.length + endChangeDiff;
6682
+ // the change is handled; exit
6683
+ break;
6684
+ }
6685
+ }
6686
+ else if (startIndex > tag.plainTextBeginIndex && oldPlainTextEndIndex > plainTextEndIndex) {
6687
+ //the change started in the tag but finishes somewhere further
6688
+ const startChangeDiff = startIndex - tag.plainTextBeginIndex - mentionTagLength;
6689
+ if (isMentionTag) {
6690
+ const [resultValue, updatedChange, htmlIndex] = handleMentionTagUpdate(htmlText, oldPlainText, lastProcessedHTMLIndex, oldPlainText.substring(startIndex, startIndex + 1) !== ' ' && change === '' ? ' ' : '', // if substring !== ' ' && change is empty -> the change should be " " and not empty string but " " wasn't included in change; otherwise the part of mention should be just deleted without processedChange update
6691
+ tag, closeTagIdx, closeTagLength, plainTextEndIndex, startIndex, oldPlainTextEndIndex, mentionTagLength);
6692
+ result += resultValue;
6693
+ lastProcessedHTMLIndex = htmlIndex;
6694
+ processedChange = updatedChange;
6695
+ // no need to handle plainTextSelectionEndIndex as the change will be added later
6696
+ // proceed with the next calculations
6697
+ }
6698
+ else if (tag.subTags !== undefined && tag.subTags.length !== 0 && tag.content !== undefined) {
6699
+ // with subtags
6700
+ // before the tag content
6701
+ const stringBefore = htmlText.substring(lastProcessedHTMLIndex, tag.openTagIdx + tag.openTagBody.length);
6702
+ lastProcessedHTMLIndex = closeTagIdx;
6703
+ const [content] = updateHTML(tag.content, oldPlainText, newPlainText, tag.subTags, startIndex - mentionTagLength, oldPlainTextEndIndex - mentionTagLength, '', // the part of the tag should be just deleted without processedChange update and change will be added after this tag
6704
+ mentionTrigger);
6705
+ result += stringBefore + content;
6706
+ // proceed with the next calculations
6707
+ }
6708
+ else {
6709
+ // no subtags
6710
+ result += htmlText.substring(lastProcessedHTMLIndex, tag.openTagIdx + tag.openTagBody.length + startChangeDiff);
6711
+ lastProcessedHTMLIndex = closeTagIdx;
6712
+ // proceed with the next calculations
6713
+ }
6714
+ }
6715
+ else if (startIndex < tag.plainTextBeginIndex && oldPlainTextEndIndex > plainTextEndIndex) {
6716
+ // the change starts before the tag and finishes after it
6717
+ // tag should be removed, no matter if there are subtags
6718
+ // no need to save anything between lastProcessedHTMLIndex and closeTagIdx + closeTagLength
6719
+ lastProcessedHTMLIndex = closeTagIdx + closeTagLength;
6720
+ // proceed with the next calculations
6721
+ }
6722
+ else if (startIndex === tag.plainTextBeginIndex && oldPlainTextEndIndex > plainTextEndIndex) {
6723
+ // the change starts in the tag and finishes after it
6724
+ // tag should be removed, no matter if there are subtags
6725
+ result += htmlText.substring(lastProcessedHTMLIndex, tag.openTagIdx);
6726
+ // processedChange shouldn't be updated as it will be added after the tag
6727
+ lastProcessedHTMLIndex = closeTagIdx + closeTagLength;
6728
+ // proceed with the next calculations
6729
+ }
6730
+ else if (startIndex < tag.plainTextBeginIndex && oldPlainTextEndIndex < plainTextEndIndex) {
6731
+ // the change starts before the tag and ends in a tag
6732
+ if (isMentionTag) {
6733
+ const [resultValue, , htmlIndex] = handleMentionTagUpdate(htmlText, oldPlainText, lastProcessedHTMLIndex, '', // the part of mention should be just deleted without processedChange update
6734
+ tag, closeTagIdx, closeTagLength, plainTextEndIndex, startIndex, oldPlainTextEndIndex, mentionTagLength);
6735
+ changeNewEndIndex = tag.plainTextBeginIndex;
6736
+ result += resultValue;
6737
+ lastProcessedHTMLIndex = htmlIndex;
6738
+ }
6739
+ else if (tag.subTags !== undefined && tag.subTags.length !== 0 && tag.content !== undefined) {
6740
+ // with subtags
6741
+ // before the tag content
6742
+ const stringBefore = htmlText.substring(lastProcessedHTMLIndex, tag.openTagIdx + tag.openTagBody.length);
6743
+ lastProcessedHTMLIndex = closeTagIdx;
6744
+ const [content] = updateHTML(tag.content, oldPlainText, newPlainText, tag.subTags, startIndex - mentionTagLength, oldPlainTextEndIndex - mentionTagLength, processedChange, // processedChange should equal '' and the part of the tag should be deleted as the change was handled before this tag
6745
+ mentionTrigger);
6746
+ result += stringBefore + content;
6747
+ }
6748
+ else {
6749
+ // no subtags
6750
+ result +=
6751
+ htmlText.substring(lastProcessedHTMLIndex, tag.openTagIdx + tag.openTagBody.length) + processedChange;
6752
+ processedChange = '';
6753
+ // oldPlainTextEndIndex already includes mentionTag length
6754
+ const endChangeDiff = plainTextEndIndex - oldPlainTextEndIndex;
6755
+ // as change may be before the end of the tag, we need to add the rest of the tag
6756
+ lastProcessedHTMLIndex = closeTagIdx - endChangeDiff;
6757
+ }
6758
+ // the change is handled; exit
6759
+ break;
6760
+ }
6761
+ else if (startIndex > tag.plainTextBeginIndex && oldPlainTextEndIndex === plainTextEndIndex) {
6762
+ // the change starts in the tag and ends at the end of a tag
6763
+ if (isMentionTag) {
6764
+ if (change !== '' && startIndex === plainTextEndIndex) {
6765
+ // non empty change at the end of the mention tag to be added after the mention tag
6766
+ result += htmlText.substring(lastProcessedHTMLIndex, closeTagIdx + closeTagLength) + processedChange;
6767
+ changeNewEndIndex = plainTextEndIndex + processedChange.length;
6768
+ processedChange = '';
6769
+ lastProcessedHTMLIndex = closeTagIdx + closeTagLength;
6770
+ }
6771
+ else if (change !== '') {
6772
+ // mention tag should be deleted when user tries to edit it
6773
+ result += htmlText.substring(lastProcessedHTMLIndex, tag.openTagIdx) + processedChange;
6774
+ changeNewEndIndex = tag.plainTextBeginIndex + processedChange.length;
6775
+ processedChange = '';
6776
+ lastProcessedHTMLIndex = closeTagIdx + closeTagLength;
6777
+ }
6778
+ else {
6779
+ const [resultValue, updatedChange, htmlIndex, plainTextSelectionEndIndex] = handleMentionTagUpdate(htmlText, oldPlainText, lastProcessedHTMLIndex, processedChange, tag, closeTagIdx, closeTagLength, plainTextEndIndex, startIndex, oldPlainTextEndIndex, mentionTagLength);
6780
+ result += resultValue;
6781
+ processedChange = updatedChange;
6782
+ lastProcessedHTMLIndex = htmlIndex;
6783
+ changeNewEndIndex = plainTextSelectionEndIndex;
6784
+ }
6785
+ // the change is handled; exit
6786
+ break;
6787
+ }
6788
+ else if (tag.subTags !== undefined && tag.subTags.length !== 0 && tag.content !== undefined) {
6789
+ // with subtags
6790
+ // before the tag content
6791
+ const stringBefore = htmlText.substring(lastProcessedHTMLIndex, tag.openTagIdx + tag.openTagBody.length);
6792
+ lastProcessedHTMLIndex = closeTagIdx;
6793
+ const [content, updatedChangeNewEndIndex] = updateHTML(tag.content, oldPlainText, newPlainText, tag.subTags, startIndex - mentionTagLength, oldPlainTextEndIndex - mentionTagLength, processedChange, mentionTrigger);
6794
+ result += stringBefore + content;
6795
+ changeNewEndIndex = updatedChangeNewEndIndex;
6796
+ break;
6797
+ }
6798
+ else {
6799
+ // no subtags
6800
+ const startChangeDiff = startIndex - tag.plainTextBeginIndex - mentionTagLength;
6801
+ result +=
6802
+ htmlText.substring(lastProcessedHTMLIndex, tag.openTagIdx + tag.openTagBody.length + startChangeDiff) +
6803
+ processedChange;
6804
+ processedChange = '';
6805
+ lastProcessedHTMLIndex = closeTagIdx;
6806
+ // the change is handled; exit
6807
+ break;
6808
+ }
6809
+ }
6810
+ lastProcessedPlainTextTagEndIndex = plainTextEndIndex;
6811
+ }
6812
+ if (i === tags.length - 1 && oldPlainTextEndIndex >= plainTextEndIndex) {
6813
+ // the last tag should handle the end of the change if needed
6814
+ // oldPlainTextEndIndex already includes mentionTag length
6815
+ const endChangeDiff = oldPlainTextEndIndex - plainTextEndIndex;
6816
+ if (startIndex >= plainTextEndIndex) {
6817
+ const startChangeDiff = startIndex - plainTextEndIndex;
6818
+ result +=
6819
+ htmlText.substring(lastProcessedHTMLIndex, closeTagIdx + closeTagLength + startChangeDiff) + processedChange;
6820
+ }
6821
+ else {
6822
+ result += htmlText.substring(lastProcessedHTMLIndex, closeTagIdx + closeTagLength) + processedChange;
6823
+ }
6824
+ processedChange = '';
6825
+ lastProcessedHTMLIndex = closeTagIdx + closeTagLength + endChangeDiff;
6826
+ // the change is handled; exit
6827
+ // break is not required here as this is the last element but added for consistency
6828
+ break;
6829
+ }
6830
+ }
6831
+ if (lastProcessedHTMLIndex < htmlText.length) {
6832
+ result += htmlText.substring(lastProcessedHTMLIndex);
6833
+ }
6834
+ return [result, changeNewEndIndex];
6835
+ };
6836
+ /* @conditional-compile-remove(mention) */
6837
+ /**
6838
+ * Given the oldText and newText, find the start index, old end index and new end index for the changes
6839
+ *
6840
+ * @param oldText - the old text
6841
+ * @param newText - the new text
6842
+ * @param selectionEnd - the end of the selection
6843
+ * @returns change start index, old end index and new end index. The old and new end indexes are exclusive.
6844
+ * @private
6845
+ */
6846
+ const findStringsDiffIndexes = (oldText, newText, selectionEnd // should be a valid position in the input field
6847
+ ) => {
6848
+ const newTextLength = newText.length;
6849
+ const oldTextLength = oldText.length;
6850
+ let changeStart = 0;
6851
+ let newChangeEnd = newTextLength;
6852
+ let oldChangeEnd = oldTextLength;
6853
+ const length = Math.min(newTextLength, oldTextLength, selectionEnd);
6854
+ for (let i = 0; i < length; i++) {
6855
+ if (newText[i] !== oldText[i]) {
6856
+ // the symbol with changeStart index is updated
6857
+ changeStart = i;
6858
+ break;
6859
+ }
6860
+ else if (i === length - 1 && newText[i] === oldText[i]) {
6861
+ // the symbol is added at the end of inputTextValue
6862
+ changeStart = length;
6863
+ break;
6864
+ }
6865
+ }
6866
+ if (oldTextLength < newTextLength) {
6867
+ //insert or replacement
6868
+ if (oldTextLength === changeStart) {
6869
+ // when change was at the end of string
6870
+ // Change is found
6871
+ newChangeEnd = newTextLength;
6872
+ oldChangeEnd = oldTextLength;
6873
+ }
6874
+ else {
6875
+ for (let i = 1; i < newTextLength && oldTextLength - i >= changeStart; i++) {
6876
+ newChangeEnd = newTextLength - i - 1;
6877
+ oldChangeEnd = oldTextLength - i - 1;
6878
+ if (newText[newChangeEnd] !== oldText[oldChangeEnd]) {
6879
+ // Change is found
6880
+ break;
6881
+ }
6882
+ }
6883
+ // make indexes exclusive
6884
+ newChangeEnd += 1;
6885
+ oldChangeEnd += 1;
6886
+ }
6887
+ }
6888
+ else if (oldTextLength > newTextLength) {
6889
+ //deletion or replacement
6890
+ if (newTextLength === changeStart) {
6891
+ // when change was at the end of string
6892
+ // Change is found
6893
+ newChangeEnd = newTextLength;
6894
+ oldChangeEnd = oldTextLength;
6895
+ }
6896
+ else {
6897
+ for (let i = 1; i < oldTextLength && newTextLength - i >= changeStart; i++) {
6898
+ newChangeEnd = newTextLength - i - 1;
6899
+ oldChangeEnd = oldTextLength - i - 1;
6900
+ if (newText[newChangeEnd] !== oldText[oldChangeEnd]) {
6901
+ // Change is found
6902
+ break;
6903
+ }
6904
+ }
6905
+ // make indexes exclusive
6906
+ newChangeEnd += 1;
6907
+ oldChangeEnd += 1;
6908
+ }
6909
+ }
6910
+ else {
6911
+ //replacement
6912
+ for (let i = 1; i < oldTextLength && oldTextLength - i >= changeStart; i++) {
6913
+ newChangeEnd = newTextLength - i - 1;
6914
+ oldChangeEnd = oldTextLength - i - 1;
6915
+ if (newText[newChangeEnd] !== oldText[oldChangeEnd]) {
6916
+ // Change is found
6917
+ break;
6918
+ }
6919
+ }
6920
+ // make indexes exclusive if they aren't equal to the length of the string
6921
+ if (newChangeEnd !== newText.length) {
6922
+ newChangeEnd += 1;
6923
+ }
6924
+ if (oldChangeEnd !== oldText.length) {
6925
+ oldChangeEnd += 1;
6926
+ }
6927
+ }
6928
+ return { changeStart, oldChangeEnd, newChangeEnd };
6929
+ };
6930
+ /* @conditional-compile-remove(mention) */
6931
+ const htmlStringForMentionSuggestion = (suggestion, localeStrings) => {
6932
+ const idHTML = ' id ="' + suggestion.id + '"';
6933
+ const displayTextHTML = ' displayText ="' + suggestion.displayText + '"';
6934
+ const displayText = getDisplayNameForMentionSuggestion(suggestion, localeStrings);
6935
+ return '<msft-mention' + idHTML + displayTextHTML + '>' + displayText + '</msft-mention>';
6936
+ };
6937
+ /* @conditional-compile-remove(mention) */
6938
+ const getDisplayNameForMentionSuggestion = (suggestion, localeStrings) => {
6939
+ const displayNamePlaceholder = localeStrings.participantItem.displayNamePlaceholder;
6940
+ return suggestion.displayText !== '' ? suggestion.displayText : displayNamePlaceholder !== null && displayNamePlaceholder !== void 0 ? displayNamePlaceholder : '';
6941
+ };
6942
+ /* @conditional-compile-remove(mention) */
6943
+ /**
6944
+ * Parse the text and return the tags and the plain text in one go
6945
+ * @param text - The text to parse for HTML tags
6946
+ * @param trigger The trigger to show for the msft-mention tag in plain text
6947
+ *
6948
+ * @returns An array of tags and the plain text representation
6949
+ */
6950
+ const textToTagParser = (text, trigger) => {
6951
+ var _a, _b;
6952
+ const tags = []; // Tags passed back to the caller
6953
+ const tagParseStack = []; // Local stack to use while parsing
6954
+ let plainTextRepresentation = '';
6955
+ let parseIndex = 0;
6956
+ while (parseIndex < text.length) {
6957
+ const foundHtmlTag = findNextHtmlTag(text, parseIndex);
6958
+ if (!foundHtmlTag) {
6959
+ if (parseIndex !== 0) {
6960
+ // Add the remaining text to the plain text representation
6961
+ plainTextRepresentation += text.substring(parseIndex);
6962
+ }
6963
+ else {
6964
+ plainTextRepresentation = text;
6965
+ }
6966
+ break;
6967
+ }
6968
+ if (foundHtmlTag.type === 'open' || foundHtmlTag.type === 'self-closing') {
6969
+ const nextTag = parseOpenTag(foundHtmlTag.content, foundHtmlTag.startIdx);
6970
+ // Add the plain text between the last tag and this one found
6971
+ plainTextRepresentation += text.substring(parseIndex, foundHtmlTag.startIdx);
6972
+ nextTag.plainTextBeginIndex = plainTextRepresentation.length;
6973
+ if (foundHtmlTag.type === 'open') {
6974
+ tagParseStack.push(nextTag);
6975
+ }
6976
+ else {
6977
+ nextTag.content = '';
6978
+ nextTag.plainTextBeginIndex = plainTextRepresentation.length;
6979
+ nextTag.plainTextEndIndex = plainTextRepresentation.length;
6980
+ addTag(nextTag, tagParseStack, tags);
6981
+ }
6982
+ }
6983
+ if (foundHtmlTag.type === 'close') {
6984
+ const currentOpenTag = tagParseStack.pop();
6985
+ const closeTagType = foundHtmlTag.content.substring(2, foundHtmlTag.content.length - 1).toLowerCase();
6986
+ if (currentOpenTag && currentOpenTag.tagType === closeTagType) {
6987
+ // Tag startIdx is absolute to the text. This is updated later to be relative to the parent tag
6988
+ currentOpenTag.content = text.substring(currentOpenTag.openTagIdx + currentOpenTag.openTagBody.length, foundHtmlTag.startIdx);
6989
+ // Insert the plain text pieces for the sub tags
6990
+ if (currentOpenTag.tagType === 'msft-mention') {
6991
+ plainTextRepresentation =
6992
+ plainTextRepresentation.slice(0, currentOpenTag.plainTextBeginIndex) +
6993
+ trigger +
6994
+ plainTextRepresentation.slice(currentOpenTag.plainTextBeginIndex);
6995
+ }
6996
+ if (!currentOpenTag.subTags) {
6997
+ plainTextRepresentation += currentOpenTag.content;
6998
+ }
6999
+ else if (currentOpenTag.subTags.length > 0) {
7000
+ // Add text after the last tag
7001
+ const lastSubTag = currentOpenTag.subTags[currentOpenTag.subTags.length - 1];
7002
+ const startOfRemainingText = ((_a = lastSubTag.closeTagIdx) !== null && _a !== void 0 ? _a : lastSubTag.openTagIdx) + lastSubTag.tagType.length + 3;
7003
+ const trailingText = currentOpenTag.content.substring(startOfRemainingText);
7004
+ plainTextRepresentation += trailingText;
7005
+ }
7006
+ currentOpenTag.plainTextEndIndex = plainTextRepresentation.length;
7007
+ addTag(currentOpenTag, tagParseStack, tags);
7008
+ }
7009
+ else {
7010
+ console.error('Unexpected close tag found. Got "' +
7011
+ closeTagType +
7012
+ '" but expected "' +
7013
+ ((_b = tagParseStack[tagParseStack.length - 1]) === null || _b === void 0 ? void 0 : _b.tagType) +
7014
+ '"');
7015
+ }
7016
+ }
7017
+ // Update parsing index; move past the end of the close tag
7018
+ parseIndex = foundHtmlTag.startIdx + foundHtmlTag.content.length;
7019
+ } // While parseIndex < text.length loop
7020
+ return [tags, plainTextRepresentation];
7021
+ };
7022
+ /* @conditional-compile-remove(mention) */
7023
+ const parseOpenTag = (tag, startIdx) => {
7024
+ const tagType = tag
7025
+ .substring(1, tag.length - 1)
7026
+ .split(' ')[0]
7027
+ .toLowerCase()
7028
+ .replace('/', '');
7029
+ return {
7030
+ tagType,
7031
+ openTagIdx: startIdx,
7032
+ openTagBody: tag
7033
+ };
7034
+ };
7035
+ /* @conditional-compile-remove(mention) */
7036
+ const findNextHtmlTag = (text, startIndex) => {
7037
+ const tagStartIndex = text.indexOf('<', startIndex);
7038
+ if (tagStartIndex === -1) {
7039
+ // No more tags
7040
+ return undefined;
7041
+ }
7042
+ const tagEndIndex = text.indexOf('>', tagStartIndex);
7043
+ if (tagEndIndex === -1) {
7044
+ // No close tag
7045
+ return undefined;
7046
+ }
7047
+ const tag = text.substring(tagStartIndex, tagEndIndex + 1);
7048
+ let type = 'open';
7049
+ if (tag[1] === '/') {
7050
+ type = 'close';
7051
+ }
7052
+ else if (tag[tag.length - 2] === '/') {
7053
+ type = 'self-closing';
7054
+ }
7055
+ return {
7056
+ content: tag,
7057
+ startIdx: tagStartIndex,
7058
+ type
7059
+ };
7060
+ };
7061
+ /* @conditional-compile-remove(mention) */
7062
+ const addTag = (tag, parseStack, tags) => {
7063
+ var _a;
7064
+ // Add as sub-tag to the parent stack tag, if there is one
7065
+ const parentTag = parseStack[parseStack.length - 1];
7066
+ if (parentTag) {
7067
+ // Adjust the open tag index to be relative to the parent tag
7068
+ const parentContentStartIdx = parentTag.openTagIdx + parentTag.openTagBody.length;
7069
+ const relativeIdx = tag.openTagIdx - parentContentStartIdx;
7070
+ tag.openTagIdx = relativeIdx;
7071
+ }
7072
+ if (!tag.closeTagIdx) {
7073
+ // If the tag is self-closing, the close tag is the same as the open tag
7074
+ if (tag.openTagBody[tag.openTagBody.length - 2] === '/') {
7075
+ tag.closeTagIdx = tag.openTagIdx;
7076
+ }
7077
+ else {
7078
+ // Otherwise, the close tag index is the open tag index + the open tag body + the content length
7079
+ tag.closeTagIdx = tag.openTagIdx + tag.openTagBody.length + ((_a = tag.content) !== null && _a !== void 0 ? _a : []).length;
7080
+ }
7081
+ }
7082
+ // Put the tag where it belongs
7083
+ if (!parentTag) {
7084
+ tags.push(tag);
7085
+ }
7086
+ else {
7087
+ if (!parentTag.subTags) {
7088
+ parentTag.subTags = [tag];
7089
+ }
7090
+ else {
7091
+ parentTag.subTags.push(tag);
7092
+ }
7093
+ }
7094
+ };
5888
7095
 
5889
7096
  // Copyright (c) Microsoft Corporation.
5890
7097
  /**
@@ -6189,7 +7396,9 @@ const MAXIMUM_LENGTH_OF_MESSAGE$1 = 8000;
6189
7396
  * @public
6190
7397
  */
6191
7398
  const SendBox = (props) => {
6192
- const { disabled, systemMessage, supportNewline, onSendMessage, onTyping, onRenderIcon, onRenderSystemMessage, styles, autoFocus } = props;
7399
+ const { disabled, systemMessage, supportNewline, onSendMessage, onTyping, onRenderIcon, onRenderSystemMessage, styles, autoFocus,
7400
+ /* @conditional-compile-remove(mention) */
7401
+ mentionLookupOptions } = props;
6193
7402
  const theme = useTheme();
6194
7403
  const localeStrings = useLocale$1().strings.sendBox;
6195
7404
  const strings = Object.assign(Object.assign({}, localeStrings), props.strings);
@@ -6212,15 +7421,16 @@ const SendBox = (props) => {
6212
7421
  setFileUploadsPendingError({ message: strings.fileUploadsPendingError, timestamp: Date.now() });
6213
7422
  return;
6214
7423
  }
6215
- // we dont want to send empty messages including spaces, newlines, tabs
7424
+ const message = textValue;
7425
+ // we don't want to send empty messages including spaces, newlines, tabs
6216
7426
  // Message can be empty if there is a valid file upload
6217
- if (!EMPTY_MESSAGE_REGEX.test(textValue) || hasFile(props)) {
6218
- onSendMessage && onSendMessage(sanitizeText(textValue));
7427
+ if (!EMPTY_MESSAGE_REGEX.test(message) || hasFile(props)) {
7428
+ onSendMessage && onSendMessage(sanitizeText(message));
6219
7429
  setTextValue('');
6220
7430
  }
6221
7431
  (_a = sendTextFieldRef.current) === null || _a === void 0 ? void 0 : _a.focus();
6222
7432
  };
6223
- const setText = (event, newValue) => {
7433
+ const setText = (newValue) => {
6224
7434
  if (newValue === undefined) {
6225
7435
  return;
6226
7436
  }
@@ -6242,7 +7452,7 @@ const SendBox = (props) => {
6242
7452
  color: !!errorMessage || !hasTextOrFile ? theme.palette.neutralTertiary : theme.palette.themePrimary
6243
7453
  }, styles === null || styles === void 0 ? void 0 : styles.sendMessageIcon), [errorMessage, hasTextOrFile, theme, styles === null || styles === void 0 ? void 0 : styles.sendMessageIcon]);
6244
7454
  const onRenderSendIcon = React.useCallback((isHover) => onRenderIcon ? (onRenderIcon(isHover)) : (React__default['default'].createElement(react.Icon, { iconName: isHover && textValue ? 'SendBoxSendHovered' : 'SendBoxSend', className: mergedSendIconStyle })), [mergedSendIconStyle, onRenderIcon, textValue]);
6245
- // Ensure that errors are cleared when there are no files in sendbox
7455
+ // Ensure that errors are cleared when there are no files in sendBox
6246
7456
  React__default['default'].useEffect(() => {
6247
7457
  if (!(activeFileUploads === null || activeFileUploads === void 0 ? void 0 : activeFileUploads.filter((upload) => !upload.error).length)) {
6248
7458
  setFileUploadsPendingError(undefined);
@@ -6268,21 +7478,24 @@ const SendBox = (props) => {
6268
7478
  uploadCompleted: (_f = (_e = props.strings) === null || _e === void 0 ? void 0 : _e.uploadCompleted) !== null && _f !== void 0 ? _f : localeStrings.uploadCompleted
6269
7479
  } })));
6270
7480
  }, [activeFileUploads, props, localeStrings]);
6271
- return (React__default['default'].createElement(react.Stack, { className: react.mergeStyles(sendBoxWrapperStyles) },
7481
+ return (React__default['default'].createElement(react.Stack, { className: react.mergeStyles(sendBoxWrapperStyles, { overflow: 'visible' } // This is needed for the mention popup to be visible
7482
+ ) },
6272
7483
  React__default['default'].createElement(SendBoxErrors, Object.assign({}, sendBoxErrorsProps)),
6273
7484
  React__default['default'].createElement(react.Stack, { className: react.mergeStyles(borderAndBoxShadowStyle({
6274
7485
  theme,
6275
7486
  hasErrorMessage: !!errorMessage,
6276
7487
  disabled: !!disabled
6277
7488
  })) },
6278
- React__default['default'].createElement(InputBoxComponent, { autoFocus: autoFocus, "data-ui-id": ids.sendboxTextField, inlineChildren: true, disabled: disabled, errorMessage: onRenderSystemMessage ? onRenderSystemMessage(errorMessage) : errorMessage, textFieldRef: sendTextFieldRef, id: "sendbox", inputClassName: sendBoxStyle, placeholderText: strings.placeholderText, textValue: textValue, onChange: setText, onKeyDown: (ev) => {
7489
+ React__default['default'].createElement(InputBoxComponent, { autoFocus: autoFocus, "data-ui-id": ids.sendboxTextField, inlineChildren: true, disabled: disabled, errorMessage: onRenderSystemMessage ? onRenderSystemMessage(errorMessage) : errorMessage, textFieldRef: sendTextFieldRef, id: "sendbox", inputClassName: sendBoxStyle, placeholderText: strings.placeholderText, textValue: textValue, onChange: (_, newValue) => setText(newValue), onKeyDown: (ev) => {
6279
7490
  const keyWasSendingMessage = ev.key === 'Enter' && (ev.shiftKey === false || !supportNewline);
6280
7491
  if (!keyWasSendingMessage) {
6281
7492
  onTyping === null || onTyping === void 0 ? void 0 : onTyping();
6282
7493
  }
6283
7494
  }, onEnterKeyDown: () => {
6284
7495
  sendMessageOnClick();
6285
- }, styles: mergedStyles, supportNewline: supportNewline, maxLength: MAXIMUM_LENGTH_OF_MESSAGE$1 },
7496
+ }, styles: mergedStyles, supportNewline: supportNewline, maxLength: MAXIMUM_LENGTH_OF_MESSAGE$1,
7497
+ /* @conditional-compile-remove(mention) */
7498
+ mentionLookupOptions: mentionLookupOptions },
6286
7499
  React__default['default'].createElement(VoiceOverButton, { onRenderIcon: onRenderSendIcon, onClick: (e) => {
6287
7500
  if (!textValueOverflow) {
6288
7501
  sendMessageOnClick();
@@ -6317,22 +7530,6 @@ const activeFileUploadsTrampoline = (props) => {
6317
7530
  return props.activeFileUploads;
6318
7531
  };
6319
7532
 
6320
- // Copyright (c) Microsoft Corporation.
6321
- /**
6322
- * @private
6323
- */
6324
- react.mergeStyles({
6325
- height: '100%',
6326
- overflowY: 'auto',
6327
- overflowX: 'hidden'
6328
- });
6329
- /**
6330
- * @private
6331
- */
6332
- react.mergeStyles({
6333
- padding: '0.25rem 0rem 0'
6334
- });
6335
-
6336
7533
  // Copyright (c) Microsoft Corporation.
6337
7534
  /** @private */
6338
7535
  const MESSAGE_STATUS_INDICATOR_SIZE_REM = 1;
@@ -6486,7 +7683,11 @@ const defaultChatItemMessageContainer = (overlapAvatarAndMessage) => {
6486
7683
  marginRight: '0rem',
6487
7684
  marginLeft: `${messageAvatarGap}rem`,
6488
7685
  width: `calc(100% - ${AVATAR_WIDTH_REM + MESSAGE_AMOUNT_OUT_FROM_EDGE_REM + messageAvatarGap}rem)`,
6489
- zIndex: CHAT_MESSAGE_ZINDEX
7686
+ zIndex: CHAT_MESSAGE_ZINDEX,
7687
+ '& msft-mention': {
7688
+ color: '#D83B01',
7689
+ fontWeight: 600
7690
+ }
6490
7691
  };
6491
7692
  };
6492
7693
  /**
@@ -6810,6 +8011,8 @@ const onRenderSubmitIcon = (color) => {
6810
8011
  */
6811
8012
  const ChatMessageComponentAsEditBox = (props) => {
6812
8013
  const { onCancel, onSubmit, strings, message } = props;
8014
+ /* @conditional-compile-remove(mention) */
8015
+ const { mentionLookupOptions } = props;
6813
8016
  const [textValue, setTextValue] = React.useState(message.content || '');
6814
8017
  const [attachedFilesMetadata, setAttachedFilesMetadata] = React__default['default'].useState(getMessageAttachedFilesMetadata(message));
6815
8018
  const editTextFieldRef = React__default['default'].useRef(null);
@@ -6851,7 +8054,9 @@ const ChatMessageComponentAsEditBox = (props) => {
6851
8054
  onSubmit(textValue, message.metadata, {
6852
8055
  attachedFilesMetadata
6853
8056
  });
6854
- }, supportNewline: false, maxLength: MAXIMUM_LENGTH_OF_MESSAGE, errorMessage: textTooLongMessage, styles: editBoxStyles },
8057
+ }, supportNewline: false, maxLength: MAXIMUM_LENGTH_OF_MESSAGE, errorMessage: textTooLongMessage, styles: editBoxStyles,
8058
+ /* @conditional-compile-remove(mention) */
8059
+ mentionLookupOptions: mentionLookupOptions },
6855
8060
  React__default['default'].createElement(InputBoxButton, { className: editingButtonStyle, ariaLabel: strings.editBoxCancelButton, tooltipContent: strings.editBoxCancelButton, onRenderIcon: onRenderThemedCancelIcon, onClick: () => {
6856
8061
  onCancel && onCancel(message.messageId);
6857
8062
  }, id: 'dismissIconWrapper' }),
@@ -7137,8 +8342,19 @@ const preventUnwantedDismissProps = {
7137
8342
  };
7138
8343
 
7139
8344
  // Copyright (c) Microsoft Corporation.
7140
- const processNodeDefinitions = new htmlToReact.ProcessNodeDefinitions(React__default['default']);
7141
- const isValidNode = () => true;
8345
+ /**
8346
+ * Provides the default implementation for rendering an Mention in a message thread
8347
+ * @param mention - The mention to render
8348
+ *
8349
+ * @private
8350
+ */
8351
+ const defaultOnMentionRender = (mention) => {
8352
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
8353
+ const MsftMention = 'msft-mention';
8354
+ return (React__default['default'].createElement(MsftMention, { id: mention.id, displayText: mention.displayText }, mention.displayText));
8355
+ };
8356
+
8357
+ // Copyright (c) Microsoft Corporation.
7142
8358
  /** @private */
7143
8359
  const ChatMessageContent = (props) => {
7144
8360
  switch (props.message.contentType) {
@@ -7214,44 +8430,65 @@ const messageContentAriaText = (props) => {
7214
8430
  })
7215
8431
  : undefined;
7216
8432
  };
7217
- const processHtmlToReact = (props) => {
7218
- const htmlToReactParser = new htmlToReact.Parser();
7219
- /* @conditional-compile-remove(teams-inline-images) */
7220
- const processInlineImage = {
7221
- // Custom <img> processing
7222
- shouldProcessNode: (node) => {
7223
- var _a;
7224
- // Process img node with id in attachments list
7225
- return (node.name &&
7226
- node.name === 'img' &&
7227
- node.attribs &&
7228
- node.attribs.id &&
7229
- ((_a = props.message.attachedFilesMetadata) === null || _a === void 0 ? void 0 : _a.find((f) => f.id === node.attribs.id)));
7230
- },
7231
- processNode: (node, children, index) => {
7232
- // logic to check id in map/list
7233
- if (props.attachmentsMap && node.attribs.id in props.attachmentsMap) {
7234
- node.attribs = Object.assign(Object.assign({}, node.attribs), { src: props.attachmentsMap[node.attribs.id] });
7235
- }
7236
- return processNodeDefinitions.processDefaultNode(node, children, index);
8433
+ const processNodeDefinitions = htmlToReact.ProcessNodeDefinitions();
8434
+ const htmlToReactParser = htmlToReact.Parser();
8435
+ /* @conditional-compile-remove(teams-inline-images) */
8436
+ const processInlineImage = (props) => ({
8437
+ // Custom <img> processing
8438
+ shouldProcessNode: (node) => {
8439
+ var _a;
8440
+ // Process img node with id in attachments list
8441
+ return (node.name &&
8442
+ node.name === 'img' &&
8443
+ node.attribs &&
8444
+ node.attribs.id &&
8445
+ ((_a = props.message.attachedFilesMetadata) === null || _a === void 0 ? void 0 : _a.find((f) => f.id === node.attribs.id)));
8446
+ },
8447
+ processNode: (node, children, index) => {
8448
+ // logic to check id in map/list
8449
+ if (props.attachmentsMap && node.attribs.id in props.attachmentsMap) {
8450
+ node.attribs = Object.assign(Object.assign({}, node.attribs), { src: props.attachmentsMap[node.attribs.id] });
7237
8451
  }
7238
- };
7239
- const addProcessingStep = () => {
7240
- const steps = [];
8452
+ return processNodeDefinitions.processDefaultNode(node, children, index);
8453
+ }
8454
+ });
8455
+ /* @conditional-compile-remove(mention) */
8456
+ const processMention = (props) => ({
8457
+ shouldProcessNode: (node) => {
8458
+ var _a;
8459
+ if ((_a = props.mentionDisplayOptions) === null || _a === void 0 ? void 0 : _a.onRenderMention) {
8460
+ // Override the handling of the <msft-mention> tag in the HTML if there's a custom renderer
8461
+ return node.name === 'msft-mention';
8462
+ }
8463
+ return false;
8464
+ },
8465
+ processNode: (node) => {
8466
+ var _a;
8467
+ if ((_a = props.mentionDisplayOptions) === null || _a === void 0 ? void 0 : _a.onRenderMention) {
8468
+ const { id, displaytext } = node.attribs;
8469
+ const mention = {
8470
+ id: id,
8471
+ displayText: displaytext
8472
+ };
8473
+ return props.mentionDisplayOptions.onRenderMention(mention, defaultOnMentionRender);
8474
+ }
8475
+ return processNodeDefinitions.processDefaultNode;
8476
+ }
8477
+ });
8478
+ const processHtmlToReact = (props) => {
8479
+ var _a;
8480
+ const steps = [
7241
8481
  /* @conditional-compile-remove(teams-inline-images) */
7242
- steps.push(processInlineImage);
7243
- return steps;
7244
- };
7245
- const processingInstructions = [
7246
- ...addProcessingStep(),
8482
+ processInlineImage(props),
8483
+ /* @conditional-compile-remove(mention) */
8484
+ processMention(props),
7247
8485
  {
7248
- shouldProcessNode: () => {
7249
- return true;
7250
- },
8486
+ // Process everything else in the default way
8487
+ shouldProcessNode: htmlToReact.IsValidNodeDefinitions.alwaysValid,
7251
8488
  processNode: processNodeDefinitions.processDefaultNode
7252
8489
  }
7253
8490
  ];
7254
- return htmlToReactParser.parseWithInstructions(props.message.content, isValidNode, processingInstructions);
8491
+ return htmlToReactParser.parseWithInstructions((_a = props.message.content) !== null && _a !== void 0 ? _a : '', htmlToReact.IsValidNodeDefinitions.alwaysValid, steps);
7255
8492
  };
7256
8493
 
7257
8494
  // Copyright (c) Microsoft Corporation.
@@ -7453,7 +8690,9 @@ const MessageBubble = (props) => {
7453
8690
  /* @conditional-compile-remove(teams-inline-images) */
7454
8691
  onFetchAttachment: props.onFetchAttachments,
7455
8692
  /* @conditional-compile-remove(teams-inline-images) */
7456
- attachmentsMap: props.attachmentsMap }),
8693
+ attachmentsMap: props.attachmentsMap,
8694
+ /* @conditional-compile-remove(mention) */
8695
+ mentionDisplayOptions: props.mentionDisplayOptions }),
7457
8696
  props.onRenderFileDownloads ? props.onRenderFileDownloads(userId, message) : defaultOnRenderFileDownloads()));
7458
8697
  }, [defaultOnRenderFileDownloads, message, props, strings, userId]);
7459
8698
  const chatMessage = (React__default['default'].createElement(React__default['default'].Fragment, null,
@@ -7493,6 +8732,7 @@ var __awaiter$t = (window && window.__awaiter) || function (thisArg, _arguments,
7493
8732
  * @private
7494
8733
  */
7495
8734
  const ChatMessageComponent = (props) => {
8735
+ var _a, _b;
7496
8736
  const [isEditing, setIsEditing] = React.useState(false);
7497
8737
  const onEditClick = React.useCallback(() => setIsEditing(true), [setIsEditing]);
7498
8738
  const { onDeleteMessage, onSendMessage, message } = props;
@@ -7520,7 +8760,9 @@ const ChatMessageComponent = (props) => {
7520
8760
  }), onCancel: (messageId) => {
7521
8761
  props.onCancelMessageEdit && props.onCancelMessageEdit(messageId);
7522
8762
  setIsEditing(false);
7523
- } }));
8763
+ },
8764
+ /* @conditional-compile-remove(mention) */
8765
+ mentionLookupOptions: (_a = props.mentionOptions) === null || _a === void 0 ? void 0 : _a.lookupOptions }));
7524
8766
  }
7525
8767
  else {
7526
8768
  return (React__default['default'].createElement(ChatMessageComponentAsMessageBubble, Object.assign({}, props, { onRemoveClick: onRemoveClick, onEditClick: onEditClick, onResendClick: onResendClick, onRenderAvatar: props.onRenderAvatar,
@@ -7529,7 +8771,9 @@ const ChatMessageComponent = (props) => {
7529
8771
  /* @conditional-compile-remove(teams-inline-images) */
7530
8772
  onFetchAttachments: props.onFetchAttachments,
7531
8773
  /* @conditional-compile-remove(teams-inline-images) */
7532
- attachmentsMap: props.attachmentsMap })));
8774
+ attachmentsMap: props.attachmentsMap,
8775
+ /* @conditional-compile-remove(mention) */
8776
+ mentionDisplayOptions: (_b = props.mentionOptions) === null || _b === void 0 ? void 0 : _b.displayOptions })));
7533
8777
  }
7534
8778
  };
7535
8779
 
@@ -7823,7 +9067,9 @@ const MessageThread = (props) => {
7823
9067
  /* @conditional-compile-remove(date-time-customization) */
7824
9068
  onDisplayDateTimeString,
7825
9069
  /* @conditional-compile-remove(teams-inline-images) */
7826
- onFetchAttachments } = props;
9070
+ onFetchAttachments,
9071
+ /* @conditional-compile-remove(mention) */
9072
+ mentionOptions } = props;
7827
9073
  const onRenderFileDownloads = onRenderFileDownloadsTrampoline(props);
7828
9074
  const [messages, setMessages] = React.useState([]);
7829
9075
  // We need this state to wait for one tick and scroll to bottom after messages have been initialized.
@@ -8067,7 +9313,9 @@ const MessageThread = (props) => {
8067
9313
  /* @conditional-compile-remove(teams-inline-images) */
8068
9314
  onFetchAttachments: onFetchInlineAttachment,
8069
9315
  /* @conditional-compile-remove(teams-inline-images) */
8070
- attachmentsMap: inlineAttachments })));
9316
+ attachmentsMap: inlineAttachments,
9317
+ /* @conditional-compile-remove(mention) */
9318
+ mentionOptions: mentionOptions })));
8071
9319
  }
8072
9320
  return React__default['default'].createElement(React__default['default'].Fragment, null);
8073
9321
  }, [
@@ -8085,7 +9333,9 @@ const MessageThread = (props) => {
8085
9333
  /* @conditional-compile-remove(teams-inline-images) */
8086
9334
  onFetchInlineAttachment,
8087
9335
  /* @conditional-compile-remove(teams-inline-images) */
8088
- inlineAttachments
9336
+ inlineAttachments,
9337
+ /* @conditional-compile-remove(mention) */
9338
+ mentionOptions
8089
9339
  ]);
8090
9340
  const defaultStatusRenderer = React.useCallback((message, status, participantCount, readCount) => {
8091
9341
  const onToggleToolTip = (isToggled) => {
@@ -22153,7 +23403,8 @@ const CallArrangement = (props) => {
22153
23403
  display: isMobileWithActivePane ? 'none' : 'flex',
22154
23404
  minWidth: props.mobileView ? 'unset' : `${compositeMinWidthRem}rem`,
22155
23405
  width: '100%',
22156
- height: '100%'
23406
+ height: '100%',
23407
+ position: 'relative'
22157
23408
  };
22158
23409
  }, [isMobileWithActivePane, props.mobileView]);
22159
23410
  /* @conditional-compile-remove(PSTN-calls) */