@azure/communication-react 1.0.0 → 1.0.1-alpha-202112142320.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/dist/communication-react.d.ts +214 -0
  2. package/dist/dist-cjs/communication-react/index.js +1225 -178
  3. package/dist/dist-cjs/communication-react/index.js.map +1 -1
  4. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  5. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  6. package/dist/dist-esm/chat-stateful-client/src/ChatContext.js.map +1 -1
  7. package/dist/dist-esm/react-components/src/components/DevicesButton.d.ts.map +1 -1
  8. package/dist/dist-esm/react-components/src/components/DevicesButton.js +3 -0
  9. package/dist/dist-esm/react-components/src/components/DevicesButton.js.map +1 -1
  10. package/dist/dist-esm/react-components/src/components/MessageThread.js +3 -4
  11. package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
  12. package/dist/dist-esm/react-components/src/components/VideoGallery.d.ts.map +1 -1
  13. package/dist/dist-esm/react-components/src/components/VideoGallery.js +10 -6
  14. package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
  15. package/dist/dist-esm/react-components/src/components/styles/ControlBar.styles.d.ts.map +1 -1
  16. package/dist/dist-esm/react-components/src/components/styles/ControlBar.styles.js +8 -2
  17. package/dist/dist-esm/react-components/src/components/styles/ControlBar.styles.js.map +1 -1
  18. package/dist/dist-esm/react-components/src/components/styles/VideoGallery.styles.d.ts +4 -6
  19. package/dist/dist-esm/react-components/src/components/styles/VideoGallery.styles.d.ts.map +1 -1
  20. package/dist/dist-esm/react-components/src/components/styles/VideoGallery.styles.js +11 -6
  21. package/dist/dist-esm/react-components/src/components/styles/VideoGallery.styles.js.map +1 -1
  22. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.d.ts +7 -0
  23. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.d.ts.map +1 -1
  24. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.js.map +1 -1
  25. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.d.ts.map +1 -1
  26. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js +7 -5
  27. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js.map +1 -1
  28. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ParticipantContainer.d.ts +14 -0
  29. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ParticipantContainer.d.ts.map +1 -0
  30. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ParticipantContainer.js +24 -0
  31. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ParticipantContainer.js.map +1 -0
  32. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/ChatButton.d.ts +7 -0
  33. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/ChatButton.d.ts.map +1 -0
  34. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/ChatButton.js +16 -0
  35. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/ChatButton.js.map +1 -0
  36. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/MeetingCallControlBar.d.ts +19 -0
  37. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/MeetingCallControlBar.d.ts.map +1 -0
  38. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/MeetingCallControlBar.js +38 -0
  39. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/MeetingCallControlBar.js.map +1 -0
  40. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/MeetingComposite.d.ts +37 -0
  41. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/MeetingComposite.d.ts.map +1 -0
  42. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/MeetingComposite.js +59 -0
  43. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/MeetingComposite.js.map +1 -0
  44. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/PeopleButton.d.ts +7 -0
  45. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/PeopleButton.d.ts.map +1 -0
  46. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/PeopleButton.js +16 -0
  47. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/PeopleButton.js.map +1 -0
  48. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/SidePane.d.ts +25 -0
  49. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/SidePane.d.ts.map +1 -0
  50. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/SidePane.js +76 -0
  51. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/SidePane.js.map +1 -0
  52. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/adapter/AzureCommunicationMeetingAdapter.d.ts +129 -0
  53. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/adapter/AzureCommunicationMeetingAdapter.d.ts.map +1 -0
  54. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/adapter/AzureCommunicationMeetingAdapter.js +385 -0
  55. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/adapter/AzureCommunicationMeetingAdapter.js.map +1 -0
  56. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/adapter/MeetingAdapter.d.ts +73 -0
  57. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/adapter/MeetingAdapter.d.ts.map +1 -0
  58. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/adapter/MeetingAdapter.js +4 -0
  59. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/adapter/MeetingAdapter.js.map +1 -0
  60. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/adapter/MeetingBackedCallAdapter.d.ts +40 -0
  61. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/adapter/MeetingBackedCallAdapter.d.ts.map +1 -0
  62. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/adapter/MeetingBackedCallAdapter.js +100 -0
  63. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/adapter/MeetingBackedCallAdapter.js.map +1 -0
  64. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/adapter/MeetingBackedChatAdapter.d.ts +30 -0
  65. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/adapter/MeetingBackedChatAdapter.d.ts.map +1 -0
  66. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/adapter/MeetingBackedChatAdapter.js +79 -0
  67. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/adapter/MeetingBackedChatAdapter.js.map +1 -0
  68. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/index.d.ts +10 -0
  69. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/index.d.ts.map +1 -0
  70. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/index.js +5 -0
  71. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/index.js.map +1 -0
  72. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/state/MeetingAdapterState.d.ts +50 -0
  73. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/state/MeetingAdapterState.d.ts.map +1 -0
  74. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/state/MeetingAdapterState.js +50 -0
  75. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/state/MeetingAdapterState.js.map +1 -0
  76. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/state/MeetingCompositePage.d.ts +21 -0
  77. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/state/MeetingCompositePage.d.ts.map +1 -0
  78. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/state/MeetingCompositePage.js +41 -0
  79. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/state/MeetingCompositePage.js.map +1 -0
  80. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/state/MeetingEndReason.d.ts +8 -0
  81. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/state/MeetingEndReason.d.ts.map +1 -0
  82. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/state/MeetingEndReason.js +4 -0
  83. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/state/MeetingEndReason.js.map +1 -0
  84. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/state/MeetingParticipants.d.ts +35 -0
  85. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/state/MeetingParticipants.d.ts.map +1 -0
  86. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/state/MeetingParticipants.js +51 -0
  87. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/state/MeetingParticipants.js.map +1 -0
  88. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/state/MeetingState.d.ts +42 -0
  89. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/state/MeetingState.d.ts.map +1 -0
  90. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/state/MeetingState.js +72 -0
  91. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/state/MeetingState.js.map +1 -0
  92. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/styles/MeetingCompositeStyles.d.ts +6 -0
  93. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/styles/MeetingCompositeStyles.d.ts.map +1 -0
  94. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/styles/MeetingCompositeStyles.js +17 -0
  95. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/styles/MeetingCompositeStyles.js.map +1 -0
  96. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/styles/SidePane.styles.d.ts +38 -0
  97. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/styles/SidePane.styles.d.ts.map +1 -0
  98. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/styles/SidePane.styles.js +63 -0
  99. package/dist/dist-esm/react-composites/src/composites/MeetingComposite/styles/SidePane.styles.js.map +1 -0
  100. package/dist/dist-esm/react-composites/src/composites/index.d.ts +2 -0
  101. package/dist/dist-esm/react-composites/src/composites/index.d.ts.map +1 -1
  102. package/dist/dist-esm/react-composites/src/composites/index.js +4 -0
  103. package/dist/dist-esm/react-composites/src/composites/index.js.map +1 -1
  104. package/package.json +24 -9
@@ -14,6 +14,7 @@ var reactAriaLive = require('react-aria-live');
14
14
  var htmlToReact = require('html-to-react');
15
15
  var Linkify = require('react-linkify');
16
16
  var uuid = require('uuid');
17
+ var reactHooks = require('@fluentui/react-hooks');
17
18
  var copy = require('copy-to-clipboard');
18
19
  var EventEmitter = require('events');
19
20
  var produce = require('immer');
@@ -187,7 +188,7 @@ const fromFlatCommunicationIdentifier = (id) => {
187
188
  // Copyright (c) Microsoft Corporation.
188
189
  // Licensed under the MIT license.
189
190
  // GENERATED FILE. DO NOT EDIT MANUALLY.
190
- var telemetryVersion = '1.0.0';
191
+ var telemetryVersion = '1.0.1-alpha-202112142320.0';
191
192
 
192
193
  // Copyright (c) Microsoft Corporation.
193
194
  /**
@@ -291,7 +292,7 @@ const getDiagnostics = (state, props) => { var _a; return (_a = state.calls[prop
291
292
 
292
293
  // Copyright (c) Microsoft Corporation.
293
294
  // Licensed under the MIT license.
294
- var __awaiter$l = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
295
+ var __awaiter$p = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
295
296
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
296
297
  return new (P || (P = Promise))(function (resolve, reject) {
297
298
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -329,7 +330,7 @@ const _isPreviewOn = (deviceManager) => {
329
330
  *
330
331
  * @private
331
332
  */
332
- const disposeAllLocalPreviewViews = (callClient) => __awaiter$l(void 0, void 0, void 0, function* () {
333
+ const disposeAllLocalPreviewViews = (callClient) => __awaiter$p(void 0, void 0, void 0, function* () {
333
334
  const unparentedViews = callClient.getState().deviceManager.unparentedViews;
334
335
  for (const view of unparentedViews) {
335
336
  yield callClient.disposeView(undefined, undefined, view);
@@ -391,7 +392,7 @@ const devicesButtonSelector = reselect__namespace.createSelector([getDeviceManag
391
392
 
392
393
  // Copyright (c) Microsoft Corporation.
393
394
  // Licensed under the MIT license.
394
- var __awaiter$k = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
395
+ var __awaiter$o = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
395
396
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
396
397
  return new (P || (P = Promise))(function (resolve, reject) {
397
398
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -415,7 +416,7 @@ const areStreamsEqual = (prevStream, newStream) => {
415
416
  * @public
416
417
  */
417
418
  const createDefaultCallingHandlers = memoizeOne__default['default']((callClient, callAgent, deviceManager, call) => {
418
- const onStartLocalVideo = () => __awaiter$k(void 0, void 0, void 0, function* () {
419
+ const onStartLocalVideo = () => __awaiter$o(void 0, void 0, void 0, function* () {
419
420
  // Before the call object creates a stream, dispose of any local preview streams.
420
421
  // @TODO: is there any way to parent the unparented view to the call object instead
421
422
  // of disposing and creating a new stream?
@@ -435,7 +436,7 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
435
436
  yield call.startVideo(stream);
436
437
  }
437
438
  });
438
- const onStopLocalVideo = (stream) => __awaiter$k(void 0, void 0, void 0, function* () {
439
+ const onStopLocalVideo = (stream) => __awaiter$o(void 0, void 0, void 0, function* () {
439
440
  const callId = call === null || call === void 0 ? void 0 : call.id;
440
441
  if (!callId) {
441
442
  return;
@@ -448,7 +449,7 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
448
449
  });
449
450
  }
450
451
  });
451
- const onToggleCamera = (options) => __awaiter$k(void 0, void 0, void 0, function* () {
452
+ const onToggleCamera = (options) => __awaiter$o(void 0, void 0, void 0, function* () {
452
453
  if (call && _isInCall(call.state)) {
453
454
  const stream = call.localVideoStreams.find((stream) => stream.mediaStreamType === 'Video');
454
455
  if (stream) {
@@ -478,19 +479,19 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
478
479
  const onStartCall = (participants, options) => {
479
480
  return callAgent ? callAgent.startCall(participants, options) : undefined;
480
481
  };
481
- const onSelectMicrophone = (device) => __awaiter$k(void 0, void 0, void 0, function* () {
482
+ const onSelectMicrophone = (device) => __awaiter$o(void 0, void 0, void 0, function* () {
482
483
  if (!deviceManager) {
483
484
  return;
484
485
  }
485
486
  return deviceManager.selectMicrophone(device);
486
487
  });
487
- const onSelectSpeaker = (device) => __awaiter$k(void 0, void 0, void 0, function* () {
488
+ const onSelectSpeaker = (device) => __awaiter$o(void 0, void 0, void 0, function* () {
488
489
  if (!deviceManager) {
489
490
  return;
490
491
  }
491
492
  return deviceManager.selectSpeaker(device);
492
493
  });
493
- const onSelectCamera = (device, options) => __awaiter$k(void 0, void 0, void 0, function* () {
494
+ const onSelectCamera = (device, options) => __awaiter$o(void 0, void 0, void 0, function* () {
494
495
  if (!deviceManager) {
495
496
  return;
496
497
  }
@@ -513,17 +514,17 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
513
514
  }, options);
514
515
  }
515
516
  });
516
- const onToggleMicrophone = () => __awaiter$k(void 0, void 0, void 0, function* () {
517
+ const onToggleMicrophone = () => __awaiter$o(void 0, void 0, void 0, function* () {
517
518
  if (!call || !_isInCall(call.state)) {
518
519
  throw new Error(`Please invoke onToggleMicrophone after call is started`);
519
520
  }
520
521
  return call.isMuted ? yield call.unmute() : yield call.mute();
521
522
  });
522
- const onStartScreenShare = () => __awaiter$k(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.startScreenSharing()); });
523
- const onStopScreenShare = () => __awaiter$k(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.stopScreenSharing()); });
524
- const onToggleScreenShare = () => __awaiter$k(void 0, void 0, void 0, function* () { return (call === null || call === void 0 ? void 0 : call.isScreenSharingOn) ? yield onStopScreenShare() : yield onStartScreenShare(); });
525
- const onHangUp = () => __awaiter$k(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.hangUp()); });
526
- const onCreateLocalStreamView = (options) => __awaiter$k(void 0, void 0, void 0, function* () {
523
+ const onStartScreenShare = () => __awaiter$o(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.startScreenSharing()); });
524
+ const onStopScreenShare = () => __awaiter$o(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.stopScreenSharing()); });
525
+ const onToggleScreenShare = () => __awaiter$o(void 0, void 0, void 0, function* () { return (call === null || call === void 0 ? void 0 : call.isScreenSharingOn) ? yield onStopScreenShare() : yield onStartScreenShare(); });
526
+ const onHangUp = () => __awaiter$o(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.hangUp()); });
527
+ const onCreateLocalStreamView = (options) => __awaiter$o(void 0, void 0, void 0, function* () {
527
528
  if (!call || call.localVideoStreams.length === 0) {
528
529
  return;
529
530
  }
@@ -537,7 +538,7 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
537
538
  }
538
539
  return callClient.createView(call.id, undefined, localStream, options);
539
540
  });
540
- const onCreateRemoteStreamView = (userId, options = { scalingMode: 'Crop' }) => __awaiter$k(void 0, void 0, void 0, function* () {
541
+ const onCreateRemoteStreamView = (userId, options = { scalingMode: 'Crop' }) => __awaiter$o(void 0, void 0, void 0, function* () {
541
542
  if (!call) {
542
543
  return;
543
544
  }
@@ -561,7 +562,7 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
561
562
  callClient.createView(call.id, participant.identifier, screenShareStream, { scalingMode: 'Fit' });
562
563
  }
563
564
  });
564
- const onDisposeRemoteStreamView = (userId) => __awaiter$k(void 0, void 0, void 0, function* () {
565
+ const onDisposeRemoteStreamView = (userId) => __awaiter$o(void 0, void 0, void 0, function* () {
565
566
  if (!call) {
566
567
  return;
567
568
  }
@@ -582,13 +583,13 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
582
583
  callClient.disposeView(call.id, participant.identifier, screenShareStream);
583
584
  }
584
585
  });
585
- const onDisposeLocalStreamView = () => __awaiter$k(void 0, void 0, void 0, function* () {
586
+ const onDisposeLocalStreamView = () => __awaiter$o(void 0, void 0, void 0, function* () {
586
587
  // TODO: we need to remember which LocalVideoStream was used for LocalPreview and dispose that one. For now
587
588
  // assume any unparented view is a LocalPreview and stop all since those are only used for LocalPreview
588
589
  // currently.
589
590
  yield disposeAllLocalPreviewViews(callClient);
590
591
  });
591
- const onRemoveParticipant = (userId) => __awaiter$k(void 0, void 0, void 0, function* () {
592
+ const onRemoveParticipant = (userId) => __awaiter$o(void 0, void 0, void 0, function* () {
592
593
  yield (call === null || call === void 0 ? void 0 : call.removeParticipant(fromFlatCommunicationIdentifier(userId)));
593
594
  });
594
595
  return {
@@ -2561,7 +2562,7 @@ const ChatMessageComponentAsMessageBubble = (props) => {
2561
2562
 
2562
2563
  // Copyright (c) Microsoft Corporation.
2563
2564
  // Licensed under the MIT license.
2564
- var __awaiter$j = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
2565
+ var __awaiter$n = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
2565
2566
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
2566
2567
  return new (P || (P = Promise))(function (resolve, reject) {
2567
2568
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -2587,7 +2588,7 @@ const ChatMessageComponent = (props) => {
2587
2588
  return React__default['default'].createElement(React__default['default'].Fragment, null);
2588
2589
  }
2589
2590
  else if (isEditing) {
2590
- return (React__default['default'].createElement(ChatMessageComponentAsEditBox, { initialValue: (_a = props.message.content) !== null && _a !== void 0 ? _a : '', inlineEditButtons: props.inlineAcceptRejectEditButtons, strings: props.strings, onSubmit: (text) => __awaiter$j(void 0, void 0, void 0, function* () {
2591
+ return (React__default['default'].createElement(ChatMessageComponentAsEditBox, { initialValue: (_a = props.message.content) !== null && _a !== void 0 ? _a : '', inlineEditButtons: props.inlineAcceptRejectEditButtons, strings: props.strings, onSubmit: (text) => __awaiter$n(void 0, void 0, void 0, function* () {
2591
2592
  props.onUpdateMessage &&
2592
2593
  props.message.messageId &&
2593
2594
  (yield props.onUpdateMessage(props.message.messageId, text));
@@ -2645,7 +2646,7 @@ const isNarrowWidth = (containerWidthRem) => containerWidthRem <= convertRemToPx
2645
2646
 
2646
2647
  // Copyright (c) Microsoft Corporation.
2647
2648
  // Licensed under the MIT license.
2648
- var __awaiter$i = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
2649
+ var __awaiter$m = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
2649
2650
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
2650
2651
  return new (P || (P = Promise))(function (resolve, reject) {
2651
2652
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -2715,25 +2716,24 @@ const generateParticipantsStr = (participants, defaultName) => participants
2715
2716
  .map((participant) => `${!participant.displayName || participant.displayName === '' ? defaultName : participant.displayName}`)
2716
2717
  .join(', ');
2717
2718
  const ParticipantSystemMessageComponent = ({ message, style, defaultName }) => {
2718
- var _a;
2719
2719
  const { strings } = useLocale$1();
2720
2720
  const participantsStr = generateParticipantsStr(message.participants, defaultName);
2721
2721
  const messageSuffix = message.systemMessageType === 'participantAdded'
2722
2722
  ? strings.messageThread.participantJoined
2723
2723
  : strings.messageThread.participantLeft;
2724
2724
  if (participantsStr !== '') {
2725
- return (React__default['default'].createElement(SystemMessage, { iconName: ((_a = message.iconName) !== null && _a !== void 0 ? _a : ''), content: `${participantsStr} ${messageSuffix}`, containerStyle: style }));
2725
+ return (React__default['default'].createElement(SystemMessage, { iconName: (message.iconName ? message.iconName : ''), content: `${participantsStr} ${messageSuffix}`, containerStyle: style }));
2726
2726
  }
2727
2727
  return React__default['default'].createElement(React__default['default'].Fragment, null);
2728
2728
  };
2729
2729
  const DefaultSystemMessage = (props) => {
2730
- var _a, _b;
2730
+ var _a;
2731
2731
  const message = props.message;
2732
2732
  switch (message.messageType) {
2733
2733
  case 'system':
2734
2734
  switch (message.systemMessageType) {
2735
2735
  case 'content':
2736
- return (React__default['default'].createElement(SystemMessage, { iconName: ((_a = message.iconName) !== null && _a !== void 0 ? _a : ''), content: (_b = message.content) !== null && _b !== void 0 ? _b : '', containerStyle: props === null || props === void 0 ? void 0 : props.messageContainerStyle }));
2736
+ return (React__default['default'].createElement(SystemMessage, { iconName: (message.iconName ? message.iconName : ''), content: (_a = message.content) !== null && _a !== void 0 ? _a : '', containerStyle: props === null || props === void 0 ? void 0 : props.messageContainerStyle }));
2737
2737
  case 'participantAdded':
2738
2738
  case 'participantRemoved':
2739
2739
  return (React__default['default'].createElement(ParticipantSystemMessageComponent, { message: message, style: props.messageContainerStyle, defaultName: props.strings.noDisplayNameSub }));
@@ -2864,7 +2864,7 @@ const MessageThread = (props) => {
2864
2864
  setChatMessagesInitialized(chatMessagesInitialized);
2865
2865
  };
2866
2866
  // we try to only send those message status if user is scrolled to the bottom.
2867
- const sendMessageStatusIfAtBottom = React.useCallback(() => __awaiter$i(void 0, void 0, void 0, function* () {
2867
+ const sendMessageStatusIfAtBottom = React.useCallback(() => __awaiter$m(void 0, void 0, void 0, function* () {
2868
2868
  if (!isAtBottomOfScrollRef.current ||
2869
2869
  !document.hasFocus() ||
2870
2870
  !messagesRef.current ||
@@ -2915,7 +2915,7 @@ const MessageThread = (props) => {
2915
2915
  setIsAtBottomOfScrollRef(atBottom);
2916
2916
  }, [scrollToBottom, sendMessageStatusIfAtBottom]);
2917
2917
  // Infinite scrolling + threadInitialize function
2918
- const fetchNewMessageWhenAtTop = React.useCallback(() => __awaiter$i(void 0, void 0, void 0, function* () {
2918
+ const fetchNewMessageWhenAtTop = React.useCallback(() => __awaiter$m(void 0, void 0, void 0, function* () {
2919
2919
  if (chatScrollDivRef.current && !isLoadingChatMessagesRef.current) {
2920
2920
  if (onLoadPreviousChatMessages) {
2921
2921
  isLoadingChatMessagesRef.current = true;
@@ -3260,7 +3260,7 @@ const ParticipantItem = (props) => {
3260
3260
  /**
3261
3261
  * @private
3262
3262
  */
3263
- const participantListStyle = react.mergeStyles({
3263
+ const participantListStyle$1 = react.mergeStyles({
3264
3264
  height: '100%',
3265
3265
  padding: '0.125rem'
3266
3266
  });
@@ -3353,7 +3353,7 @@ const ParticipantList = (props) => {
3353
3353
  return menuItems;
3354
3354
  };
3355
3355
  const participantItemStyles = react.merge(participantListItemStyle, (_a = props.styles) === null || _a === void 0 ? void 0 : _a.participantItemStyles);
3356
- return (React__default['default'].createElement(react.Stack, { "data-ui-id": ids.participantList, className: react.mergeStyles(participantListStyle, (_b = props.styles) === null || _b === void 0 ? void 0 : _b.root) }, displayedParticipants.map((participant) => onRenderParticipant
3356
+ return (React__default['default'].createElement(react.Stack, { "data-ui-id": ids.participantList, className: react.mergeStyles(participantListStyle$1, (_b = props.styles) === null || _b === void 0 ? void 0 : _b.root) }, displayedParticipants.map((participant) => onRenderParticipant
3357
3357
  ? onRenderParticipant(participant)
3358
3358
  : onRenderParticipantDefault(participant, strings, myUserId, onRemoveParticipant, onRenderAvatar, createParticipantMenuItems, participantItemStyles))));
3359
3359
  };
@@ -3788,12 +3788,6 @@ const videoGalleryOuterDivStyle = react.mergeStyles({ position: 'relative', widt
3788
3788
  const videoGalleryContainerStyle = {
3789
3789
  root: { position: 'relative', height: '100%', width: '100%', padding: '0.5rem' }
3790
3790
  };
3791
- /**
3792
- * @private
3793
- */
3794
- const videoGalleryContainerTokens = {
3795
- childrenGap: '0.5rem'
3796
- };
3797
3791
  /**
3798
3792
  * Small floating modal width and height in rem for small screen
3799
3793
  */
@@ -3882,6 +3876,17 @@ const LARGE_HORIZONTAL_GALLERY_TILE_STYLE = {
3882
3876
  maxHeight: `${LARGE_HORIZONTAL_GALLERY_TILE_SIZE_REM.height}rem`,
3883
3877
  maxWidth: `${LARGE_HORIZONTAL_GALLERY_TILE_SIZE_REM.width}rem`
3884
3878
  };
3879
+ /**
3880
+ * @private
3881
+ */
3882
+ const layerHostStyle = {
3883
+ position: 'absolute',
3884
+ left: 0,
3885
+ top: 0,
3886
+ width: '100%',
3887
+ height: '100%',
3888
+ overflow: 'hidden'
3889
+ };
3885
3890
 
3886
3891
  // Copyright (c) Microsoft Corporation.
3887
3892
  /**
@@ -4003,7 +4008,7 @@ const DRAG_OPTIONS = {
4003
4008
  * @public
4004
4009
  */
4005
4010
  const VideoGallery = (props) => {
4006
- var _a, _b, _c, _d, _e;
4011
+ var _a, _b, _c, _d;
4007
4012
  const { localParticipant, remoteParticipants = [], localVideoViewOptions, remoteVideoViewOptions, dominantSpeakers, onRenderLocalVideoTile, onRenderRemoteVideoTile, onCreateLocalStreamView, onCreateRemoteStreamView, onDisposeRemoteStreamView, styles, layout, onRenderAvatar, showMuteIndicator, maxRemoteVideoStreams = DEFAULT_MAX_REMOTE_VIDEO_STREAMS } = props;
4008
4013
  const ids = useIdentifiers();
4009
4014
  const theme = useTheme();
@@ -4096,13 +4101,16 @@ const VideoGallery = (props) => {
4096
4101
  }
4097
4102
  }, [containerRef]);
4098
4103
  const horizontalGalleryPresent = horizontalGalleryTiles && horizontalGalleryTiles.length > 0;
4104
+ const layerHostId = reactHooks.useId('layerhost');
4099
4105
  return (React__default['default'].createElement("div", { "data-ui-id": ids.videoGallery, ref: containerRef, className: react.mergeStyles(videoGalleryOuterDivStyle, styles === null || styles === void 0 ? void 0 : styles.root) },
4100
4106
  shouldFloatLocalVideo &&
4101
4107
  localParticipant &&
4102
- (horizontalGalleryPresent ? (React__default['default'].createElement(react.Stack, { className: react.mergeStyles(localVideoTileContainerStyle(theme, isNarrow)) }, localVideoTile)) : (React__default['default'].createElement(react.Modal, { isOpen: true, isModeless: true, dragOptions: DRAG_OPTIONS, styles: floatingLocalVideoModalStyle(theme, isNarrow), layerProps: { hostId: (_e = containerRef.current) === null || _e === void 0 ? void 0 : _e.id } }, localVideoTile))),
4103
- React__default['default'].createElement(react.Stack, { horizontal: false, styles: videoGalleryContainerStyle, tokens: videoGalleryContainerTokens },
4108
+ (horizontalGalleryPresent ? (React__default['default'].createElement(react.Stack, { className: react.mergeStyles(localVideoTileContainerStyle(theme, isNarrow)) }, localVideoTile)) : (React__default['default'].createElement(react.Modal, { isOpen: true, isModeless: true, dragOptions: DRAG_OPTIONS, styles: floatingLocalVideoModalStyle(theme, isNarrow), layerProps: { hostId: layerHostId } }, localVideoTile))),
4109
+ React__default['default'].createElement(react.Stack, { horizontal: false, styles: videoGalleryContainerStyle },
4104
4110
  screenShareParticipant ? (remoteScreenShareComponent) : (localParticipant === null || localParticipant === void 0 ? void 0 : localParticipant.isScreenSharingOn) ? (localScreenShareStreamComponent) : (React__default['default'].createElement(GridLayout, { key: "grid-layout", styles: styles === null || styles === void 0 ? void 0 : styles.gridLayout }, gridTiles)),
4105
- horizontalGalleryPresent && (React__default['default'].createElement(ResponsiveHorizontalGallery, { key: "responsive-horizontal-gallery", containerStyles: horizontalGalleryContainerStyle(shouldFloatLocalVideo, isNarrow), horizontalGalleryStyles: react.concatStyleSets(horizontalGalleryStyle(isNarrow), styles === null || styles === void 0 ? void 0 : styles.horizontalGallery), childWidthRem: isNarrow ? SMALL_HORIZONTAL_GALLERY_TILE_SIZE_REM.width : LARGE_HORIZONTAL_GALLERY_TILE_SIZE_REM.width, buttonWidthRem: HORIZONTAL_GALLERY_BUTTON_WIDTH, gapWidthRem: HORIZONTAL_GALLERY_GAP }, horizontalGalleryTiles)))));
4111
+ horizontalGalleryPresent && (React__default['default'].createElement("div", { style: { paddingTop: '0.5rem' } },
4112
+ React__default['default'].createElement(ResponsiveHorizontalGallery, { key: "responsive-horizontal-gallery", containerStyles: horizontalGalleryContainerStyle(shouldFloatLocalVideo, isNarrow), horizontalGalleryStyles: react.concatStyleSets(horizontalGalleryStyle(isNarrow), styles === null || styles === void 0 ? void 0 : styles.horizontalGallery), childWidthRem: isNarrow ? SMALL_HORIZONTAL_GALLERY_TILE_SIZE_REM.width : LARGE_HORIZONTAL_GALLERY_TILE_SIZE_REM.width, buttonWidthRem: HORIZONTAL_GALLERY_BUTTON_WIDTH, gapWidthRem: HORIZONTAL_GALLERY_GAP }, horizontalGalleryTiles))),
4113
+ React__default['default'].createElement(react.LayerHost, { id: layerHostId, className: react.mergeStyles(layerHostStyle) }))));
4106
4114
  };
4107
4115
 
4108
4116
  // Copyright (c) Microsoft Corporation.
@@ -4116,7 +4124,8 @@ const controlBarStyles = {
4116
4124
  },
4117
4125
  vertical: {
4118
4126
  flexFlow: 'column nowrap',
4119
- maxWidth: '3.5rem'
4127
+ width: 'fit-content',
4128
+ maxWidth: '8rem'
4120
4129
  },
4121
4130
  dockedTop: {
4122
4131
  flexFlow: 'row nowrap',
@@ -4207,6 +4216,8 @@ const controlButtonStyles = {
4207
4216
  borderRadius: 0,
4208
4217
  minHeight: '3.5rem',
4209
4218
  minWidth: '3.5rem',
4219
+ width: '100%',
4220
+ maxWidth: '8rem',
4210
4221
  svg: {
4211
4222
  verticalAlign: 'text-top'
4212
4223
  }
@@ -4221,7 +4232,10 @@ const controlButtonStyles = {
4221
4232
  lineHeight: '1rem',
4222
4233
  cursor: 'pointer',
4223
4234
  display: 'block',
4224
- margin: '0rem 0.25rem'
4235
+ margin: '0rem 0.25rem',
4236
+ overflow: 'hidden',
4237
+ textOverflow: 'ellipsis',
4238
+ whiteSpace: 'nowrap'
4225
4239
  }
4226
4240
  };
4227
4241
  /**
@@ -4308,7 +4322,7 @@ const ControlBarButton = (props) => {
4308
4322
 
4309
4323
  // Copyright (c) Microsoft Corporation.
4310
4324
  // Licensed under the MIT license.
4311
- var __awaiter$h = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
4325
+ var __awaiter$l = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
4312
4326
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4313
4327
  return new (P || (P = Promise))(function (resolve, reject) {
4314
4328
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -4336,7 +4350,7 @@ const CameraButton = (props) => {
4336
4350
  const [waitForCamera, setWaitForCamera] = React.useState(false);
4337
4351
  const localeStrings = useLocale$1().strings.cameraButton;
4338
4352
  const strings = Object.assign(Object.assign({}, localeStrings), props.strings);
4339
- const onToggleClick = React.useCallback(() => __awaiter$h(void 0, void 0, void 0, function* () {
4353
+ const onToggleClick = React.useCallback(() => __awaiter$l(void 0, void 0, void 0, function* () {
4340
4354
  // Throttle click on camera, need to await onToggleCamera then allow another click
4341
4355
  if (onToggleCamera) {
4342
4356
  setWaitForCamera(true);
@@ -4510,6 +4524,7 @@ const generateDefaultMenuProps = (props, strings) => {
4510
4524
  itemProps: {
4511
4525
  styles: menuItemStyles
4512
4526
  },
4527
+ role: 'menuitem',
4513
4528
  canCheck: true,
4514
4529
  isChecked: camera.id === (selectedCamera === null || selectedCamera === void 0 ? void 0 : selectedCamera.id),
4515
4530
  onClick: () => {
@@ -4536,6 +4551,7 @@ const generateDefaultMenuProps = (props, strings) => {
4536
4551
  itemProps: {
4537
4552
  styles: menuItemStyles
4538
4553
  },
4554
+ role: 'menuitem',
4539
4555
  canCheck: true,
4540
4556
  isChecked: microphone.id === (selectedMicrophone === null || selectedMicrophone === void 0 ? void 0 : selectedMicrophone.id),
4541
4557
  onClick: () => {
@@ -4562,6 +4578,7 @@ const generateDefaultMenuProps = (props, strings) => {
4562
4578
  itemProps: {
4563
4579
  styles: menuItemStyles
4564
4580
  },
4581
+ role: 'menuitem',
4565
4582
  canCheck: true,
4566
4583
  isChecked: speaker.id === (selectedSpeaker === null || selectedSpeaker === void 0 ? void 0 : selectedSpeaker.id),
4567
4584
  onClick: () => {
@@ -5148,7 +5165,7 @@ const findSelector$1 = (component) => {
5148
5165
 
5149
5166
  // Copyright (c) Microsoft Corporation.
5150
5167
  // Licensed under the MIT license.
5151
- var __awaiter$g = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
5168
+ var __awaiter$k = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
5152
5169
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5153
5170
  return new (P || (P = Promise))(function (resolve, reject) {
5154
5171
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -5170,33 +5187,33 @@ var __awaiter$g = (window && window.__awaiter) || function (thisArg, _arguments,
5170
5187
  const createDefaultChatHandlers = memoizeOne__default['default']((chatClient, chatThreadClient) => {
5171
5188
  let messageIterator = undefined;
5172
5189
  return {
5173
- onSendMessage: (content) => __awaiter$g(void 0, void 0, void 0, function* () {
5190
+ onSendMessage: (content) => __awaiter$k(void 0, void 0, void 0, function* () {
5174
5191
  const sendMessageRequest = {
5175
5192
  content,
5176
5193
  senderDisplayName: chatClient.getState().displayName
5177
5194
  };
5178
5195
  yield chatThreadClient.sendMessage(sendMessageRequest);
5179
5196
  }),
5180
- onUpdateMessage: (messageId, content) => __awaiter$g(void 0, void 0, void 0, function* () {
5197
+ onUpdateMessage: (messageId, content) => __awaiter$k(void 0, void 0, void 0, function* () {
5181
5198
  yield chatThreadClient.updateMessage(messageId, { content });
5182
5199
  }),
5183
- onDeleteMessage: (messageId) => __awaiter$g(void 0, void 0, void 0, function* () {
5200
+ onDeleteMessage: (messageId) => __awaiter$k(void 0, void 0, void 0, function* () {
5184
5201
  yield chatThreadClient.deleteMessage(messageId);
5185
5202
  }),
5186
5203
  // This handler is designed for chatThread to consume
5187
- onMessageSeen: (chatMessageId) => __awaiter$g(void 0, void 0, void 0, function* () {
5204
+ onMessageSeen: (chatMessageId) => __awaiter$k(void 0, void 0, void 0, function* () {
5188
5205
  yield chatThreadClient.sendReadReceipt({ chatMessageId });
5189
5206
  }),
5190
- onTyping: () => __awaiter$g(void 0, void 0, void 0, function* () {
5207
+ onTyping: () => __awaiter$k(void 0, void 0, void 0, function* () {
5191
5208
  yield chatThreadClient.sendTypingNotification();
5192
5209
  }),
5193
- onRemoveParticipant: (userId) => __awaiter$g(void 0, void 0, void 0, function* () {
5210
+ onRemoveParticipant: (userId) => __awaiter$k(void 0, void 0, void 0, function* () {
5194
5211
  yield chatThreadClient.removeParticipant(fromFlatCommunicationIdentifier(userId));
5195
5212
  }),
5196
- updateThreadTopicName: (topicName) => __awaiter$g(void 0, void 0, void 0, function* () {
5213
+ updateThreadTopicName: (topicName) => __awaiter$k(void 0, void 0, void 0, function* () {
5197
5214
  yield chatThreadClient.updateTopic(topicName);
5198
5215
  }),
5199
- onLoadPreviousChatMessages: (messagesToLoad) => __awaiter$g(void 0, void 0, void 0, function* () {
5216
+ onLoadPreviousChatMessages: (messagesToLoad) => __awaiter$k(void 0, void 0, void 0, function* () {
5200
5217
  var _a;
5201
5218
  if (messageIterator === undefined) {
5202
5219
  // Lazy definition so that errors in the method call are reported correctly.
@@ -5805,7 +5822,7 @@ const findSelector = (component) => {
5805
5822
 
5806
5823
  // Copyright (c) Microsoft Corporation.
5807
5824
  // Licensed under the MIT license.
5808
- var __awaiter$f = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
5825
+ var __awaiter$j = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
5809
5826
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5810
5827
  return new (P || (P = Promise))(function (resolve, reject) {
5811
5828
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -5854,10 +5871,10 @@ class ProxyDeviceManager {
5854
5871
  this.selectCamera = (videoDeviceInfo) => {
5855
5872
  this._context.setDeviceManagerSelectedCamera(videoDeviceInfo);
5856
5873
  };
5857
- this.videoDevicesUpdated = () => __awaiter$f(this, void 0, void 0, function* () {
5874
+ this.videoDevicesUpdated = () => __awaiter$j(this, void 0, void 0, function* () {
5858
5875
  this._context.setDeviceManagerCameras(dedupeById(yield this._deviceManager.getCameras()));
5859
5876
  });
5860
- this.audioDevicesUpdated = () => __awaiter$f(this, void 0, void 0, function* () {
5877
+ this.audioDevicesUpdated = () => __awaiter$j(this, void 0, void 0, function* () {
5861
5878
  this._context.setDeviceManagerMicrophones(dedupeById(yield this._deviceManager.getMicrophones()));
5862
5879
  this._context.setDeviceManagerSpeakers(dedupeById(yield this._deviceManager.getSpeakers()));
5863
5880
  });
@@ -5980,7 +5997,7 @@ class CallError extends Error {
5980
5997
 
5981
5998
  // Copyright (c) Microsoft Corporation.
5982
5999
  // Licensed under the MIT license.
5983
- var __awaiter$e = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
6000
+ var __awaiter$i = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
5984
6001
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5985
6002
  return new (P || (P = Promise))(function (resolve, reject) {
5986
6003
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -6469,7 +6486,7 @@ class CallContext$1 {
6469
6486
  * @throws CallError. Exceptions thrown from `f` are tagged with the failed `target.
6470
6487
  */
6471
6488
  withAsyncErrorTeedToState(action, target) {
6472
- return (...args) => __awaiter$e(this, void 0, void 0, function* () {
6489
+ return (...args) => __awaiter$i(this, void 0, void 0, function* () {
6473
6490
  try {
6474
6491
  return yield action(...args);
6475
6492
  }
@@ -6532,7 +6549,7 @@ const findOldestCallEnded = (calls) => {
6532
6549
 
6533
6550
  // Copyright (c) Microsoft Corporation.
6534
6551
  // Licensed under the MIT license.
6535
- var __awaiter$d = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
6552
+ var __awaiter$h = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
6536
6553
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
6537
6554
  return new (P || (P = Promise))(function (resolve, reject) {
6538
6555
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -6552,42 +6569,42 @@ class ProxyCall {
6552
6569
  switch (prop) {
6553
6570
  case 'mute': {
6554
6571
  return this._context.withAsyncErrorTeedToState(function (...args) {
6555
- return __awaiter$d(this, void 0, void 0, function* () {
6572
+ return __awaiter$h(this, void 0, void 0, function* () {
6556
6573
  return yield target.mute(...args);
6557
6574
  });
6558
6575
  }, 'Call.mute');
6559
6576
  }
6560
6577
  case 'unmute': {
6561
6578
  return this._context.withAsyncErrorTeedToState(function (...args) {
6562
- return __awaiter$d(this, void 0, void 0, function* () {
6579
+ return __awaiter$h(this, void 0, void 0, function* () {
6563
6580
  return yield target.unmute(...args);
6564
6581
  });
6565
6582
  }, 'Call.unmute');
6566
6583
  }
6567
6584
  case 'startVideo': {
6568
6585
  return this._context.withAsyncErrorTeedToState(function (...args) {
6569
- return __awaiter$d(this, void 0, void 0, function* () {
6586
+ return __awaiter$h(this, void 0, void 0, function* () {
6570
6587
  return yield target.startVideo(...args);
6571
6588
  });
6572
6589
  }, 'Call.startVideo');
6573
6590
  }
6574
6591
  case 'stopVideo': {
6575
6592
  return this._context.withAsyncErrorTeedToState(function (...args) {
6576
- return __awaiter$d(this, void 0, void 0, function* () {
6593
+ return __awaiter$h(this, void 0, void 0, function* () {
6577
6594
  return yield target.stopVideo(...args);
6578
6595
  });
6579
6596
  }, 'Call.stopVideo');
6580
6597
  }
6581
6598
  case 'startScreenSharing': {
6582
6599
  return this._context.withAsyncErrorTeedToState(function (...args) {
6583
- return __awaiter$d(this, void 0, void 0, function* () {
6600
+ return __awaiter$h(this, void 0, void 0, function* () {
6584
6601
  return yield target.startScreenSharing(...args);
6585
6602
  });
6586
6603
  }, 'Call.startScreenSharing');
6587
6604
  }
6588
6605
  case 'stopScreenSharing': {
6589
6606
  return this._context.withAsyncErrorTeedToState(function (...args) {
6590
- return __awaiter$d(this, void 0, void 0, function* () {
6607
+ return __awaiter$h(this, void 0, void 0, function* () {
6591
6608
  return yield target.stopScreenSharing(...args);
6592
6609
  });
6593
6610
  }, 'Call.stopScreenSharing');
@@ -6785,7 +6802,7 @@ class RemoteVideoStreamSubscriber {
6785
6802
 
6786
6803
  // Copyright (c) Microsoft Corporation.
6787
6804
  // Licensed under the MIT license.
6788
- var __awaiter$c = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
6805
+ var __awaiter$g = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
6789
6806
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
6790
6807
  return new (P || (P = Promise))(function (resolve, reject) {
6791
6808
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -6795,7 +6812,7 @@ var __awaiter$c = (window && window.__awaiter) || function (thisArg, _arguments,
6795
6812
  });
6796
6813
  };
6797
6814
  function createViewRemoteVideo(context, internalContext, callId, participantId, stream, options) {
6798
- return __awaiter$c(this, void 0, void 0, function* () {
6815
+ return __awaiter$g(this, void 0, void 0, function* () {
6799
6816
  // Render RemoteVideoStream that is part of a Call
6800
6817
  const streamId = stream.id;
6801
6818
  let participantKey;
@@ -6856,7 +6873,7 @@ function createViewRemoteVideo(context, internalContext, callId, participantId,
6856
6873
  });
6857
6874
  }
6858
6875
  function createViewLocalVideo(context, internalContext, callId, options) {
6859
- return __awaiter$c(this, void 0, void 0, function* () {
6876
+ return __awaiter$g(this, void 0, void 0, function* () {
6860
6877
  // Render LocalVideoStream that is part of a Call
6861
6878
  const renderInfo = internalContext.getLocalRenderInfo(callId);
6862
6879
  if (!renderInfo) {
@@ -6911,7 +6928,7 @@ function createViewLocalVideo(context, internalContext, callId, options) {
6911
6928
  });
6912
6929
  }
6913
6930
  function createViewUnparentedVideo(context, internalContext, stream, options) {
6914
- return __awaiter$c(this, void 0, void 0, function* () {
6931
+ return __awaiter$g(this, void 0, void 0, function* () {
6915
6932
  const renderInfo = internalContext.getUnparentedRenderInfo(stream);
6916
6933
  if (renderInfo && renderInfo.status === 'Rendered') {
6917
6934
  console.warn('Unparented LocalVideoStream is already rendered');
@@ -7733,7 +7750,7 @@ class InternalCallContext {
7733
7750
 
7734
7751
  // Copyright (c) Microsoft Corporation.
7735
7752
  // Licensed under the MIT license.
7736
- var __awaiter$b = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
7753
+ var __awaiter$f = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
7737
7754
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
7738
7755
  return new (P || (P = Promise))(function (resolve, reject) {
7739
7756
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -7755,7 +7772,7 @@ class ProxyCallClient {
7755
7772
  get(target, prop) {
7756
7773
  switch (prop) {
7757
7774
  case 'createCallAgent': {
7758
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$b(this, void 0, void 0, function* () {
7775
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$f(this, void 0, void 0, function* () {
7759
7776
  // createCallAgent will throw an exception if the previous callAgent was not disposed. If the previous
7760
7777
  // callAgent was disposed then it would have unsubscribed to events so we can just create a new declarative
7761
7778
  // callAgent if the createCallAgent succeeds.
@@ -7766,7 +7783,7 @@ class ProxyCallClient {
7766
7783
  }), 'CallClient.createCallAgent');
7767
7784
  }
7768
7785
  case 'getDeviceManager': {
7769
- return this._context.withAsyncErrorTeedToState(() => __awaiter$b(this, void 0, void 0, function* () {
7786
+ return this._context.withAsyncErrorTeedToState(() => __awaiter$f(this, void 0, void 0, function* () {
7770
7787
  // As of writing, the SDK always returns the same instance of DeviceManager so we keep a reference of
7771
7788
  // DeviceManager and if it does not change we return the cached DeclarativeDeviceManager. If it does not we'll
7772
7789
  // throw an error that indicate we need to fix this issue as our implementation has diverged from the SDK.
@@ -7881,7 +7898,7 @@ const Constants = {
7881
7898
 
7882
7899
  // Copyright (c) Microsoft Corporation.
7883
7900
  // Licensed under the MIT license.
7884
- var __awaiter$a = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
7901
+ var __awaiter$e = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
7885
7902
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
7886
7903
  return new (P || (P = Promise))(function (resolve, reject) {
7887
7904
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -8158,7 +8175,7 @@ class ChatContext$1 {
8158
8175
  * @throws ChatError. Exceptions thrown from `f` are tagged with the failed `target.
8159
8176
  */
8160
8177
  withAsyncErrorTeedToState(f, target) {
8161
- return (...args) => __awaiter$a(this, void 0, void 0, function* () {
8178
+ return (...args) => __awaiter$e(this, void 0, void 0, function* () {
8162
8179
  try {
8163
8180
  return yield f(...args);
8164
8181
  }
@@ -8261,7 +8278,7 @@ const convertChatMessage = (message, status = 'delivered', clientMessageId) => {
8261
8278
 
8262
8279
  // Copyright (c) Microsoft Corporation.
8263
8280
  // Licensed under the MIT license.
8264
- var __awaiter$9 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
8281
+ var __awaiter$d = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
8265
8282
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
8266
8283
  return new (P || (P = Promise))(function (resolve, reject) {
8267
8284
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -8344,7 +8361,7 @@ class EventSubscriber {
8344
8361
  this.fetchLastParticipantMessage(event.threadId, 'participantAdded');
8345
8362
  };
8346
8363
  // This is a hot fix that no participant message is received for onChatMessageReceived event, which should be handled by JS SDK
8347
- this.fetchLastParticipantMessage = (threadId, actionType) => __awaiter$9(this, void 0, void 0, function* () {
8364
+ this.fetchLastParticipantMessage = (threadId, actionType) => __awaiter$d(this, void 0, void 0, function* () {
8348
8365
  var e_1, _a;
8349
8366
  try {
8350
8367
  for (var _b = __asyncValues$1(this.chatClient
@@ -8430,7 +8447,7 @@ class EventSubscriber {
8430
8447
 
8431
8448
  // Copyright (c) Microsoft Corporation.
8432
8449
  // Licensed under the MIT license.
8433
- var __awaiter$8 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
8450
+ var __awaiter$c = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
8434
8451
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
8435
8452
  return new (P || (P = Promise))(function (resolve, reject) {
8436
8453
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -8452,7 +8469,7 @@ const createDecoratedIterator = (iteratorCreator, context, decorateFn) => {
8452
8469
  const threadsIterator = iteratorCreator(...args);
8453
8470
  return {
8454
8471
  next() {
8455
- return __awaiter$8(this, void 0, void 0, function* () {
8472
+ return __awaiter$c(this, void 0, void 0, function* () {
8456
8473
  const result = yield threadsIterator.next();
8457
8474
  if (!result.done && result.value) {
8458
8475
  decorateFn(result.value, context);
@@ -8467,7 +8484,7 @@ const createDecoratedIterator = (iteratorCreator, context, decorateFn) => {
8467
8484
  const pages = threadsIterator.byPage(settings);
8468
8485
  return {
8469
8486
  next() {
8470
- return __awaiter$8(this, void 0, void 0, function* () {
8487
+ return __awaiter$c(this, void 0, void 0, function* () {
8471
8488
  const result = yield pages.next();
8472
8489
  const page = result.value;
8473
8490
  if (!result.done && result.value) {
@@ -8551,7 +8568,7 @@ const createDecoratedListParticipants = (chatThreadClient, context) => {
8551
8568
 
8552
8569
  // Copyright (c) Microsoft Corporation.
8553
8570
  // Licensed under the MIT license.
8554
- var __awaiter$7 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
8571
+ var __awaiter$b = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
8555
8572
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
8556
8573
  return new (P || (P = Promise))(function (resolve, reject) {
8557
8574
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -8570,14 +8587,14 @@ class ProxyChatThreadClient {
8570
8587
  return createDecoratedListMessages(chatThreadClient, this._context);
8571
8588
  }
8572
8589
  case 'getMessage': {
8573
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$7(this, void 0, void 0, function* () {
8590
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$b(this, void 0, void 0, function* () {
8574
8591
  const message = yield chatThreadClient.getMessage(...args);
8575
8592
  this._context.setChatMessage(chatThreadClient.threadId, convertChatMessage(message));
8576
8593
  return message;
8577
8594
  }), 'ChatThreadClient.getMessage');
8578
8595
  }
8579
8596
  case 'sendMessage': {
8580
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$7(this, void 0, void 0, function* () {
8597
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$b(this, void 0, void 0, function* () {
8581
8598
  // Retry logic?
8582
8599
  const { content } = args[0];
8583
8600
  const clientMessageId = nanoid.nanoid(); // Generate a local short uuid for message
@@ -8615,7 +8632,7 @@ class ProxyChatThreadClient {
8615
8632
  }), 'ChatThreadClient.sendMessage');
8616
8633
  }
8617
8634
  case 'addParticipants': {
8618
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$7(this, void 0, void 0, function* () {
8635
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$b(this, void 0, void 0, function* () {
8619
8636
  const result = yield chatThreadClient.addParticipants(...args);
8620
8637
  const [addRequest] = args;
8621
8638
  const participantsToAdd = addRequest.participants;
@@ -8624,7 +8641,7 @@ class ProxyChatThreadClient {
8624
8641
  }), 'ChatThreadClient.addParticipants');
8625
8642
  }
8626
8643
  case 'deleteMessage': {
8627
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$7(this, void 0, void 0, function* () {
8644
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$b(this, void 0, void 0, function* () {
8628
8645
  // DeleteMessage is able to either delete local one(for failed message) or synced message
8629
8646
  const [messageId] = args;
8630
8647
  if (this._context.deleteLocalMessage(chatThreadClient.threadId, messageId)) {
@@ -8642,7 +8659,7 @@ class ProxyChatThreadClient {
8642
8659
  return createDecoratedListReadReceipts(chatThreadClient, this._context);
8643
8660
  }
8644
8661
  case 'removeParticipant': {
8645
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$7(this, void 0, void 0, function* () {
8662
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$b(this, void 0, void 0, function* () {
8646
8663
  const result = yield chatThreadClient.removeParticipant(...args);
8647
8664
  const [removeIdentifier] = args;
8648
8665
  this._context.deleteParticipant(chatThreadClient.threadId, communicationCommon.getIdentifierKind(removeIdentifier));
@@ -8650,7 +8667,7 @@ class ProxyChatThreadClient {
8650
8667
  }), 'ChatThreadClient.removeParticipant');
8651
8668
  }
8652
8669
  case 'updateMessage': {
8653
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$7(this, void 0, void 0, function* () {
8670
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$b(this, void 0, void 0, function* () {
8654
8671
  const result = yield chatThreadClient.updateMessage(...args);
8655
8672
  const [messageId, updateOption] = args;
8656
8673
  this._context.updateChatMessageContent(chatThreadClient.threadId, messageId, updateOption === null || updateOption === void 0 ? void 0 : updateOption.content);
@@ -8658,7 +8675,7 @@ class ProxyChatThreadClient {
8658
8675
  }), 'ChatThreadClient.updateMessage');
8659
8676
  }
8660
8677
  case 'updateTopic': {
8661
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$7(this, void 0, void 0, function* () {
8678
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$b(this, void 0, void 0, function* () {
8662
8679
  const result = yield chatThreadClient.updateTopic(...args);
8663
8680
  const [topic] = args;
8664
8681
  this._context.updateThreadTopic(chatThreadClient.threadId, topic);
@@ -8666,7 +8683,7 @@ class ProxyChatThreadClient {
8666
8683
  }), 'ChatThreadClient.updateTopic');
8667
8684
  }
8668
8685
  case 'getProperties': {
8669
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$7(this, void 0, void 0, function* () {
8686
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$b(this, void 0, void 0, function* () {
8670
8687
  const result = yield chatThreadClient.getProperties(...args);
8671
8688
  this._context.updateThread(chatThreadClient.threadId, result);
8672
8689
  return result;
@@ -8703,7 +8720,7 @@ const createDecoratedListThreads = (chatClient, context) => {
8703
8720
 
8704
8721
  // Copyright (c) Microsoft Corporation.
8705
8722
  // Licensed under the MIT license.
8706
- var __awaiter$6 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
8723
+ var __awaiter$a = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
8707
8724
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
8708
8725
  return new (P || (P = Promise))(function (resolve, reject) {
8709
8726
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -8722,7 +8739,7 @@ const proxyChatClient = {
8722
8739
  switch (prop) {
8723
8740
  case 'createChatThread': {
8724
8741
  return context.withAsyncErrorTeedToState(function (...args) {
8725
- return __awaiter$6(this, void 0, void 0, function* () {
8742
+ return __awaiter$a(this, void 0, void 0, function* () {
8726
8743
  const result = yield chatClient.createChatThread(...args);
8727
8744
  const thread = result.chatThread;
8728
8745
  if (thread) {
@@ -8735,7 +8752,7 @@ const proxyChatClient = {
8735
8752
  }
8736
8753
  case 'deleteChatThread': {
8737
8754
  return context.withAsyncErrorTeedToState(function (...args) {
8738
- return __awaiter$6(this, void 0, void 0, function* () {
8755
+ return __awaiter$a(this, void 0, void 0, function* () {
8739
8756
  const result = yield chatClient.deleteChatThread(...args);
8740
8757
  context.deleteThread(args[0]);
8741
8758
  return result;
@@ -8755,7 +8772,7 @@ const proxyChatClient = {
8755
8772
  }
8756
8773
  case 'startRealtimeNotifications': {
8757
8774
  return context.withAsyncErrorTeedToState(function (...args) {
8758
- return __awaiter$6(this, void 0, void 0, function* () {
8775
+ return __awaiter$a(this, void 0, void 0, function* () {
8759
8776
  const ret = yield chatClient.startRealtimeNotifications(...args);
8760
8777
  if (!receiver.eventSubscriber) {
8761
8778
  receiver.eventSubscriber = new EventSubscriber(chatClient, context);
@@ -8766,7 +8783,7 @@ const proxyChatClient = {
8766
8783
  }
8767
8784
  case 'stopRealtimeNotifications': {
8768
8785
  return context.withAsyncErrorTeedToState(function (...args) {
8769
- return __awaiter$6(this, void 0, void 0, function* () {
8786
+ return __awaiter$a(this, void 0, void 0, function* () {
8770
8787
  const ret = yield chatClient.stopRealtimeNotifications(...args);
8771
8788
  if (receiver.eventSubscriber) {
8772
8789
  receiver.eventSubscriber.unsubscribe();
@@ -8830,7 +8847,7 @@ const createStatefulChatClientWithDeps = (chatClient, args, options) => {
8830
8847
 
8831
8848
  // Copyright (c) Microsoft Corporation.
8832
8849
  // Licensed under the MIT license.
8833
- var __awaiter$5 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
8850
+ var __awaiter$9 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
8834
8851
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
8835
8852
  return new (P || (P = Promise))(function (resolve, reject) {
8836
8853
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -8935,7 +8952,7 @@ class AzureCommunicationChatAdapter {
8935
8952
  }
8936
8953
  fetchInitialData() {
8937
8954
  var e_1, _a;
8938
- return __awaiter$5(this, void 0, void 0, function* () {
8955
+ return __awaiter$9(this, void 0, void 0, function* () {
8939
8956
  try {
8940
8957
  yield this.chatThreadClient.getProperties();
8941
8958
  }
@@ -8977,55 +8994,55 @@ class AzureCommunicationChatAdapter {
8977
8994
  this.context.offStateChange(handler);
8978
8995
  }
8979
8996
  sendMessage(content) {
8980
- return __awaiter$5(this, void 0, void 0, function* () {
8981
- yield this.asyncTeeErrorToEventEmitter(() => __awaiter$5(this, void 0, void 0, function* () {
8997
+ return __awaiter$9(this, void 0, void 0, function* () {
8998
+ yield this.asyncTeeErrorToEventEmitter(() => __awaiter$9(this, void 0, void 0, function* () {
8982
8999
  yield this.handlers.onSendMessage(content);
8983
9000
  }));
8984
9001
  });
8985
9002
  }
8986
9003
  sendReadReceipt(chatMessageId) {
8987
- return __awaiter$5(this, void 0, void 0, function* () {
8988
- yield this.asyncTeeErrorToEventEmitter(() => __awaiter$5(this, void 0, void 0, function* () {
9004
+ return __awaiter$9(this, void 0, void 0, function* () {
9005
+ yield this.asyncTeeErrorToEventEmitter(() => __awaiter$9(this, void 0, void 0, function* () {
8989
9006
  yield this.handlers.onMessageSeen(chatMessageId);
8990
9007
  }));
8991
9008
  });
8992
9009
  }
8993
9010
  sendTypingIndicator() {
8994
- return __awaiter$5(this, void 0, void 0, function* () {
9011
+ return __awaiter$9(this, void 0, void 0, function* () {
8995
9012
  yield this.handlers.onTyping();
8996
9013
  });
8997
9014
  }
8998
9015
  removeParticipant(userId) {
8999
- return __awaiter$5(this, void 0, void 0, function* () {
9000
- yield this.asyncTeeErrorToEventEmitter(() => __awaiter$5(this, void 0, void 0, function* () {
9016
+ return __awaiter$9(this, void 0, void 0, function* () {
9017
+ yield this.asyncTeeErrorToEventEmitter(() => __awaiter$9(this, void 0, void 0, function* () {
9001
9018
  yield this.handlers.onRemoveParticipant(userId);
9002
9019
  }));
9003
9020
  });
9004
9021
  }
9005
9022
  setTopic(topicName) {
9006
- return __awaiter$5(this, void 0, void 0, function* () {
9007
- yield this.asyncTeeErrorToEventEmitter(() => __awaiter$5(this, void 0, void 0, function* () {
9023
+ return __awaiter$9(this, void 0, void 0, function* () {
9024
+ yield this.asyncTeeErrorToEventEmitter(() => __awaiter$9(this, void 0, void 0, function* () {
9008
9025
  yield this.handlers.updateThreadTopicName(topicName);
9009
9026
  }));
9010
9027
  });
9011
9028
  }
9012
9029
  loadPreviousChatMessages(messagesToLoad) {
9013
- return __awaiter$5(this, void 0, void 0, function* () {
9014
- return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$5(this, void 0, void 0, function* () {
9030
+ return __awaiter$9(this, void 0, void 0, function* () {
9031
+ return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$9(this, void 0, void 0, function* () {
9015
9032
  return yield this.handlers.onLoadPreviousChatMessages(messagesToLoad);
9016
9033
  }));
9017
9034
  });
9018
9035
  }
9019
9036
  updateMessage(messageId, content) {
9020
- return __awaiter$5(this, void 0, void 0, function* () {
9021
- return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$5(this, void 0, void 0, function* () {
9037
+ return __awaiter$9(this, void 0, void 0, function* () {
9038
+ return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$9(this, void 0, void 0, function* () {
9022
9039
  return yield this.handlers.onUpdateMessage(messageId, content);
9023
9040
  }));
9024
9041
  });
9025
9042
  }
9026
9043
  deleteMessage(messageId) {
9027
- return __awaiter$5(this, void 0, void 0, function* () {
9028
- return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$5(this, void 0, void 0, function* () {
9044
+ return __awaiter$9(this, void 0, void 0, function* () {
9045
+ return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$9(this, void 0, void 0, function* () {
9029
9046
  return yield this.handlers.onDeleteMessage(messageId);
9030
9047
  }));
9031
9048
  });
@@ -9078,7 +9095,7 @@ class AzureCommunicationChatAdapter {
9078
9095
  this.emitter.off(event, listener);
9079
9096
  }
9080
9097
  asyncTeeErrorToEventEmitter(f) {
9081
- return __awaiter$5(this, void 0, void 0, function* () {
9098
+ return __awaiter$9(this, void 0, void 0, function* () {
9082
9099
  try {
9083
9100
  return yield f();
9084
9101
  }
@@ -9120,7 +9137,7 @@ const convertEventType = (type) => {
9120
9137
  *
9121
9138
  * @public
9122
9139
  */
9123
- const createAzureCommunicationChatAdapter = ({ endpoint: endpointUrl, userId, displayName, credential, threadId }) => __awaiter$5(void 0, void 0, void 0, function* () {
9140
+ const createAzureCommunicationChatAdapter = ({ endpoint: endpointUrl, userId, displayName, credential, threadId }) => __awaiter$9(void 0, void 0, void 0, function* () {
9124
9141
  const chatClient = createStatefulChatClient({
9125
9142
  userId,
9126
9143
  displayName,
@@ -9141,7 +9158,7 @@ const createAzureCommunicationChatAdapter = ({ endpoint: endpointUrl, userId, di
9141
9158
  *
9142
9159
  * @public
9143
9160
  */
9144
- const createAzureCommunicationChatAdapterFromClient = (chatClient, chatThreadClient) => __awaiter$5(void 0, void 0, void 0, function* () {
9161
+ const createAzureCommunicationChatAdapterFromClient = (chatClient, chatThreadClient) => __awaiter$9(void 0, void 0, void 0, function* () {
9145
9162
  return new AzureCommunicationChatAdapter(chatClient, chatThreadClient);
9146
9163
  });
9147
9164
  const isChatError = (e) => {
@@ -9481,7 +9498,7 @@ const topicNameLabelStyle = react.mergeStyles({
9481
9498
  /**
9482
9499
  * @private
9483
9500
  */
9484
- react.mergeStyles({
9501
+ const participantListWrapper = react.mergeStyles({
9485
9502
  boxShadow: '0px 0.3px 0.9px rgba(0, 0, 0, 0.1), 0px 1.6px 3.6px rgba(0, 0, 0, 0.13)',
9486
9503
  width: '20rem',
9487
9504
  // max width at 50% of view so the People Pane is not squeezing the Message Pane to almost nothing when on small screen or high zoom in
@@ -9495,20 +9512,20 @@ const participantListContainerPadding = { childrenGap: '0.5rem' };
9495
9512
  /**
9496
9513
  * @private
9497
9514
  */
9498
- react.mergeStyles({
9515
+ const listHeader = react.mergeStyles({
9499
9516
  fontSize: '1rem',
9500
9517
  margin: '1rem'
9501
9518
  });
9502
9519
  /**
9503
9520
  * @private
9504
9521
  */
9505
- react.mergeStyles({
9522
+ const participantListStack = react.mergeStyles({
9506
9523
  height: '100%'
9507
9524
  });
9508
9525
  /**
9509
9526
  * @private
9510
9527
  */
9511
- react.mergeStyles({
9528
+ const participantListStyle = react.mergeStyles({
9512
9529
  height: '100%',
9513
9530
  overflow: 'auto'
9514
9531
  });
@@ -9540,7 +9557,7 @@ const typingIndicatorContainerStyles = {
9540
9557
 
9541
9558
  // Copyright (c) Microsoft Corporation.
9542
9559
  // Licensed under the MIT license.
9543
- var __awaiter$4 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
9560
+ var __awaiter$8 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
9544
9561
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
9545
9562
  return new (P || (P = Promise))(function (resolve, reject) {
9546
9563
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -9561,7 +9578,7 @@ const AvatarPersona = (props) => {
9561
9578
  const { userId, dataProvider } = props;
9562
9579
  const [data, setData] = React__default['default'].useState();
9563
9580
  React.useEffect(() => {
9564
- (() => __awaiter$4(void 0, void 0, void 0, function* () {
9581
+ (() => __awaiter$8(void 0, void 0, void 0, function* () {
9565
9582
  if (dataProvider && userId) {
9566
9583
  const data = yield dataProvider(userId);
9567
9584
  setData(data);
@@ -9694,14 +9711,28 @@ const usePropsFor$2 = (component) => {
9694
9711
  return Object.assign(Object.assign({}, useAdaptedSelector$1(selector)), useHandlers$1());
9695
9712
  };
9696
9713
 
9714
+ // Copyright (c) Microsoft Corporation.
9715
+ /**
9716
+ * @private
9717
+ */
9718
+ const ParticipantContainer = (props) => {
9719
+ const { onFetchAvatarPersonaData, onFetchParticipantMenuItems } = props;
9720
+ const participantListProps = usePropsFor$2(ParticipantList);
9721
+ const locale = useLocale();
9722
+ const chatListHeader = locale.strings.chat.chatListHeader;
9723
+ return (React__default['default'].createElement(react.Stack, { className: participantListWrapper },
9724
+ React__default['default'].createElement(react.Stack, { className: participantListStack },
9725
+ React__default['default'].createElement(react.Stack.Item, { className: listHeader }, chatListHeader),
9726
+ React__default['default'].createElement(react.FocusZone, { className: participantListStyle },
9727
+ React__default['default'].createElement(ParticipantList, Object.assign({}, participantListProps, { onRenderAvatar: (userId, options) => (React__default['default'].createElement(AvatarPersona, Object.assign({ "data-ui-id": "chat-composite-participant-custom-avatar", userId: userId }, options, { dataProvider: onFetchAvatarPersonaData }))), onFetchParticipantMenuItems: onFetchParticipantMenuItems }))))));
9728
+ };
9729
+
9697
9730
  // Copyright (c) Microsoft Corporation.
9698
9731
  /**
9699
9732
  * @private
9700
9733
  */
9701
9734
  const ChatScreen = (props) => {
9702
- const { onFetchAvatarPersonaData, onRenderMessage, onRenderTypingIndicator,
9703
- // onFetchParticipantMenuItems, // Removed for GA release
9704
- options, styles } = props;
9735
+ const { onFetchAvatarPersonaData, onRenderMessage, onRenderTypingIndicator, options, styles } = props;
9705
9736
  const defaultNumberOfChatMessagesToReload = 5;
9706
9737
  const sendBoxParentStyle = react.mergeStyles({ width: '100%' });
9707
9738
  const adapter = useAdapter$1();
@@ -9727,7 +9758,9 @@ const ChatScreen = (props) => {
9727
9758
  React__default['default'].createElement(MessageThread, Object.assign({}, messageThreadProps, { onRenderAvatar: onRenderAvatarCallback, onRenderMessage: onRenderMessage, numberOfChatMessagesToReload: defaultNumberOfChatMessagesToReload, styles: messageThreadStyles })),
9728
9759
  React__default['default'].createElement(react.Stack, { className: sendBoxParentStyle },
9729
9760
  React__default['default'].createElement("div", { className: react.mergeStyles(typingIndicatorContainerStyles) }, onRenderTypingIndicator ? (onRenderTypingIndicator(typingIndicatorProps.typingUsers)) : (React__default['default'].createElement(TypingIndicator, Object.assign({}, typingIndicatorProps, { styles: typingIndicatorStyles })))),
9730
- React__default['default'].createElement(SendBox, Object.assign({}, sendBoxProps, { styles: sendBoxStyles })))))));
9761
+ React__default['default'].createElement(SendBox, Object.assign({}, sendBoxProps, { styles: sendBoxStyles })))),
9762
+ /* @conditional-compile-remove-from(stable) */
9763
+ (options === null || options === void 0 ? void 0 : options.participantPane) === true && (React__default['default'].createElement(ParticipantContainer, { onFetchAvatarPersonaData: onFetchAvatarPersonaData, onFetchParticipantMenuItems: props.onFetchParticipantMenuItems })))));
9731
9764
  };
9732
9765
 
9733
9766
  // Copyright (c) Microsoft Corporation.
@@ -9955,7 +9988,7 @@ const getCallCompositePage = (call, previousCall) => {
9955
9988
 
9956
9989
  // Copyright (c) Microsoft Corporation.
9957
9990
  // Licensed under the MIT license.
9958
- var __awaiter$3 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
9991
+ var __awaiter$7 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
9959
9992
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
9960
9993
  return new (P || (P = Promise))(function (resolve, reject) {
9961
9994
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -9974,59 +10007,59 @@ _component) => {
9974
10007
  return createCompositeHandlers(useAdapter());
9975
10008
  };
9976
10009
  const createCompositeHandlers = memoizeOne__default['default']((adapter) => ({
9977
- onCreateLocalStreamView: (options) => __awaiter$3(void 0, void 0, void 0, function* () {
10010
+ onCreateLocalStreamView: (options) => __awaiter$7(void 0, void 0, void 0, function* () {
9978
10011
  yield adapter.createStreamView(undefined, options);
9979
10012
  }),
9980
- onCreateRemoteStreamView: (userId, options) => __awaiter$3(void 0, void 0, void 0, function* () {
10013
+ onCreateRemoteStreamView: (userId, options) => __awaiter$7(void 0, void 0, void 0, function* () {
9981
10014
  yield adapter.createStreamView(userId, options);
9982
10015
  }),
9983
- onHangUp: () => __awaiter$3(void 0, void 0, void 0, function* () {
10016
+ onHangUp: () => __awaiter$7(void 0, void 0, void 0, function* () {
9984
10017
  yield adapter.leaveCall();
9985
10018
  }),
9986
- onRemoveParticipant: (userId) => __awaiter$3(void 0, void 0, void 0, function* () {
10019
+ onRemoveParticipant: (userId) => __awaiter$7(void 0, void 0, void 0, function* () {
9987
10020
  yield adapter.removeParticipant(userId);
9988
10021
  }),
9989
- onSelectCamera: (deviceInfo, options) => __awaiter$3(void 0, void 0, void 0, function* () {
10022
+ onSelectCamera: (deviceInfo, options) => __awaiter$7(void 0, void 0, void 0, function* () {
9990
10023
  yield adapter.setCamera(deviceInfo, options);
9991
10024
  }),
9992
- onSelectMicrophone: (deviceInfo) => __awaiter$3(void 0, void 0, void 0, function* () {
10025
+ onSelectMicrophone: (deviceInfo) => __awaiter$7(void 0, void 0, void 0, function* () {
9993
10026
  yield adapter.setMicrophone(deviceInfo);
9994
10027
  }),
9995
- onSelectSpeaker: (deviceInfo) => __awaiter$3(void 0, void 0, void 0, function* () {
10028
+ onSelectSpeaker: (deviceInfo) => __awaiter$7(void 0, void 0, void 0, function* () {
9996
10029
  yield adapter.setSpeaker(deviceInfo);
9997
10030
  }),
9998
10031
  onStartCall: (participants) => {
9999
10032
  const rawIds = participants.map((participant) => toFlatCommunicationIdentifier(participant));
10000
10033
  return adapter.startCall(rawIds);
10001
10034
  },
10002
- onStartScreenShare: () => __awaiter$3(void 0, void 0, void 0, function* () {
10035
+ onStartScreenShare: () => __awaiter$7(void 0, void 0, void 0, function* () {
10003
10036
  yield adapter.startScreenShare();
10004
10037
  }),
10005
- onStopScreenShare: () => __awaiter$3(void 0, void 0, void 0, function* () {
10038
+ onStopScreenShare: () => __awaiter$7(void 0, void 0, void 0, function* () {
10006
10039
  yield adapter.stopScreenShare();
10007
10040
  }),
10008
- onToggleCamera: (options) => __awaiter$3(void 0, void 0, void 0, function* () {
10041
+ onToggleCamera: (options) => __awaiter$7(void 0, void 0, void 0, function* () {
10009
10042
  isCameraOn(adapter.getState()) ? yield adapter.stopCamera() : yield adapter.startCamera(options);
10010
10043
  }),
10011
- onToggleMicrophone: () => __awaiter$3(void 0, void 0, void 0, function* () {
10044
+ onToggleMicrophone: () => __awaiter$7(void 0, void 0, void 0, function* () {
10012
10045
  var _a;
10013
10046
  return ((_a = adapter.getState().call) === null || _a === void 0 ? void 0 : _a.isMuted) ? yield adapter.unmute() : yield adapter.mute();
10014
10047
  }),
10015
- onToggleScreenShare: () => __awaiter$3(void 0, void 0, void 0, function* () {
10048
+ onToggleScreenShare: () => __awaiter$7(void 0, void 0, void 0, function* () {
10016
10049
  var _b;
10017
10050
  return ((_b = adapter.getState().call) === null || _b === void 0 ? void 0 : _b.isScreenSharingOn)
10018
10051
  ? yield adapter.stopScreenShare()
10019
10052
  : yield adapter.startScreenShare();
10020
10053
  }),
10021
- onStartLocalVideo: () => __awaiter$3(void 0, void 0, void 0, function* () {
10054
+ onStartLocalVideo: () => __awaiter$7(void 0, void 0, void 0, function* () {
10022
10055
  if (adapter.getState().call) {
10023
10056
  return adapter.startCamera();
10024
10057
  }
10025
10058
  }),
10026
- onDisposeLocalStreamView: () => __awaiter$3(void 0, void 0, void 0, function* () {
10059
+ onDisposeLocalStreamView: () => __awaiter$7(void 0, void 0, void 0, function* () {
10027
10060
  return adapter.disposeStreamView();
10028
10061
  }),
10029
- onDisposeRemoteStreamView: (userId) => __awaiter$3(void 0, void 0, void 0, function* () {
10062
+ onDisposeRemoteStreamView: (userId) => __awaiter$7(void 0, void 0, void 0, function* () {
10030
10063
  return adapter.disposeStreamView(userId);
10031
10064
  })
10032
10065
  }));
@@ -11065,7 +11098,7 @@ const localPreviewTileStyle = {
11065
11098
 
11066
11099
  // Copyright (c) Microsoft Corporation.
11067
11100
  // Licensed under the MIT license.
11068
- var __awaiter$2 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
11101
+ var __awaiter$6 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
11069
11102
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
11070
11103
  return new (P || (P = Promise))(function (resolve, reject) {
11071
11104
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -11085,7 +11118,7 @@ const LocalPreview = (props) => {
11085
11118
  const { audio: microphonePermissionGranted, video: cameraPermissionGranted } = useSelector$1(devicePermissionSelector);
11086
11119
  const isLocalMicrophoneEnabled = useSelector$1(getLocalMicrophoneEnabled);
11087
11120
  const adapter = useAdapter();
11088
- const onToggleMic = React.useCallback(() => __awaiter$2(void 0, void 0, void 0, function* () {
11121
+ const onToggleMic = React.useCallback(() => __awaiter$6(void 0, void 0, void 0, function* () {
11089
11122
  isLocalMicrophoneEnabled ? adapter.mute() : adapter.unmute();
11090
11123
  }), [adapter, isLocalMicrophoneEnabled]);
11091
11124
  const theme = useTheme();
@@ -11409,7 +11442,7 @@ const mainScreenContainerStyleMobile = react.mergeStyles(Object.assign(Object.as
11409
11442
 
11410
11443
  // Copyright (c) Microsoft Corporation.
11411
11444
  // Licensed under the MIT license.
11412
- var __awaiter$1 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
11445
+ var __awaiter$5 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
11413
11446
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
11414
11447
  return new (P || (P = Promise))(function (resolve, reject) {
11415
11448
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -11456,7 +11489,7 @@ const MainScreen = (props) => {
11456
11489
  const CallComposite = (props) => {
11457
11490
  const { adapter, callInvitationUrl, onFetchAvatarPersonaData, onFetchParticipantMenuItems, options, formFactor = 'desktop' } = props;
11458
11491
  React.useEffect(() => {
11459
- (() => __awaiter$1(void 0, void 0, void 0, function* () {
11492
+ (() => __awaiter$5(void 0, void 0, void 0, function* () {
11460
11493
  yield adapter.askDevicePermission({ video: true, audio: true });
11461
11494
  adapter.queryCameras();
11462
11495
  adapter.queryMicrophones();
@@ -11547,7 +11580,7 @@ class DiagnosticsForwarder {
11547
11580
 
11548
11581
  // Copyright (c) Microsoft Corporation.
11549
11582
  // Licensed under the MIT license.
11550
- var __awaiter = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
11583
+ var __awaiter$4 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
11551
11584
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
11552
11585
  return new (P || (P = Promise))(function (resolve, reject) {
11553
11586
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -11685,29 +11718,29 @@ class AzureCommunicationCallAdapter {
11685
11718
  this.callAgent.dispose();
11686
11719
  }
11687
11720
  queryCameras() {
11688
- return __awaiter(this, void 0, void 0, function* () {
11689
- return yield this.asyncTeeErrorToEventEmitter(() => __awaiter(this, void 0, void 0, function* () {
11721
+ return __awaiter$4(this, void 0, void 0, function* () {
11722
+ return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$4(this, void 0, void 0, function* () {
11690
11723
  return this.deviceManager.getCameras();
11691
11724
  }));
11692
11725
  });
11693
11726
  }
11694
11727
  queryMicrophones() {
11695
- return __awaiter(this, void 0, void 0, function* () {
11696
- return yield this.asyncTeeErrorToEventEmitter(() => __awaiter(this, void 0, void 0, function* () {
11728
+ return __awaiter$4(this, void 0, void 0, function* () {
11729
+ return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$4(this, void 0, void 0, function* () {
11697
11730
  return this.deviceManager.getMicrophones();
11698
11731
  }));
11699
11732
  });
11700
11733
  }
11701
11734
  querySpeakers() {
11702
- return __awaiter(this, void 0, void 0, function* () {
11703
- return yield this.asyncTeeErrorToEventEmitter(() => __awaiter(this, void 0, void 0, function* () {
11735
+ return __awaiter$4(this, void 0, void 0, function* () {
11736
+ return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$4(this, void 0, void 0, function* () {
11704
11737
  return this.deviceManager.isSpeakerSelectionAvailable ? this.deviceManager.getSpeakers() : [];
11705
11738
  }));
11706
11739
  });
11707
11740
  }
11708
11741
  askDevicePermission(constrain) {
11709
- return __awaiter(this, void 0, void 0, function* () {
11710
- return yield this.asyncTeeErrorToEventEmitter(() => __awaiter(this, void 0, void 0, function* () {
11742
+ return __awaiter$4(this, void 0, void 0, function* () {
11743
+ return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$4(this, void 0, void 0, function* () {
11711
11744
  yield this.deviceManager.askDevicePermission(constrain);
11712
11745
  }));
11713
11746
  });
@@ -11743,7 +11776,7 @@ class AzureCommunicationCallAdapter {
11743
11776
  }
11744
11777
  }
11745
11778
  createStreamView(remoteUserId, options) {
11746
- return __awaiter(this, void 0, void 0, function* () {
11779
+ return __awaiter$4(this, void 0, void 0, function* () {
11747
11780
  if (remoteUserId === undefined) {
11748
11781
  yield this.handlers.onCreateLocalStreamView(options);
11749
11782
  }
@@ -11753,7 +11786,7 @@ class AzureCommunicationCallAdapter {
11753
11786
  });
11754
11787
  }
11755
11788
  disposeStreamView(remoteUserId) {
11756
- return __awaiter(this, void 0, void 0, function* () {
11789
+ return __awaiter$4(this, void 0, void 0, function* () {
11757
11790
  if (remoteUserId === undefined) {
11758
11791
  yield this.handlers.onDisposeLocalStreamView();
11759
11792
  }
@@ -11764,7 +11797,7 @@ class AzureCommunicationCallAdapter {
11764
11797
  }
11765
11798
  leaveCall() {
11766
11799
  var _a;
11767
- return __awaiter(this, void 0, void 0, function* () {
11800
+ return __awaiter$4(this, void 0, void 0, function* () {
11768
11801
  const callId = (_a = this.call) === null || _a === void 0 ? void 0 : _a.id;
11769
11802
  yield this.handlers.onHangUp();
11770
11803
  this.unsubscribeCallEvents();
@@ -11779,29 +11812,29 @@ class AzureCommunicationCallAdapter {
11779
11812
  });
11780
11813
  }
11781
11814
  setCamera(device, options) {
11782
- return __awaiter(this, void 0, void 0, function* () {
11783
- return yield this.asyncTeeErrorToEventEmitter(() => __awaiter(this, void 0, void 0, function* () {
11815
+ return __awaiter$4(this, void 0, void 0, function* () {
11816
+ return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$4(this, void 0, void 0, function* () {
11784
11817
  yield this.handlers.onSelectCamera(device, options);
11785
11818
  }));
11786
11819
  });
11787
11820
  }
11788
11821
  setMicrophone(device) {
11789
- return __awaiter(this, void 0, void 0, function* () {
11790
- return yield this.asyncTeeErrorToEventEmitter(() => __awaiter(this, void 0, void 0, function* () {
11822
+ return __awaiter$4(this, void 0, void 0, function* () {
11823
+ return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$4(this, void 0, void 0, function* () {
11791
11824
  yield this.handlers.onSelectMicrophone(device);
11792
11825
  }));
11793
11826
  });
11794
11827
  }
11795
11828
  setSpeaker(device) {
11796
- return __awaiter(this, void 0, void 0, function* () {
11797
- return yield this.asyncTeeErrorToEventEmitter(() => __awaiter(this, void 0, void 0, function* () {
11829
+ return __awaiter$4(this, void 0, void 0, function* () {
11830
+ return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$4(this, void 0, void 0, function* () {
11798
11831
  yield this.handlers.onSelectSpeaker(device);
11799
11832
  }));
11800
11833
  });
11801
11834
  }
11802
11835
  startCamera(options) {
11803
- return __awaiter(this, void 0, void 0, function* () {
11804
- return yield this.asyncTeeErrorToEventEmitter(() => __awaiter(this, void 0, void 0, function* () {
11836
+ return __awaiter$4(this, void 0, void 0, function* () {
11837
+ return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$4(this, void 0, void 0, function* () {
11805
11838
  if (!isCameraOn(this.getState())) {
11806
11839
  yield this.handlers.onToggleCamera(options);
11807
11840
  }
@@ -11809,8 +11842,8 @@ class AzureCommunicationCallAdapter {
11809
11842
  });
11810
11843
  }
11811
11844
  stopCamera() {
11812
- return __awaiter(this, void 0, void 0, function* () {
11813
- return yield this.asyncTeeErrorToEventEmitter(() => __awaiter(this, void 0, void 0, function* () {
11845
+ return __awaiter$4(this, void 0, void 0, function* () {
11846
+ return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$4(this, void 0, void 0, function* () {
11814
11847
  if (isCameraOn(this.getState())) {
11815
11848
  yield this.handlers.onToggleCamera();
11816
11849
  }
@@ -11818,8 +11851,8 @@ class AzureCommunicationCallAdapter {
11818
11851
  });
11819
11852
  }
11820
11853
  mute() {
11821
- return __awaiter(this, void 0, void 0, function* () {
11822
- return yield this.asyncTeeErrorToEventEmitter(() => __awaiter(this, void 0, void 0, function* () {
11854
+ return __awaiter$4(this, void 0, void 0, function* () {
11855
+ return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$4(this, void 0, void 0, function* () {
11823
11856
  var _a, _b;
11824
11857
  this.context.setIsLocalMicrophoneEnabled(false);
11825
11858
  if (_isInCall((_a = this.call) === null || _a === void 0 ? void 0 : _a.state) && !((_b = this.call) === null || _b === void 0 ? void 0 : _b.isMuted)) {
@@ -11829,8 +11862,8 @@ class AzureCommunicationCallAdapter {
11829
11862
  });
11830
11863
  }
11831
11864
  unmute() {
11832
- return __awaiter(this, void 0, void 0, function* () {
11833
- return yield this.asyncTeeErrorToEventEmitter(() => __awaiter(this, void 0, void 0, function* () {
11865
+ return __awaiter$4(this, void 0, void 0, function* () {
11866
+ return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$4(this, void 0, void 0, function* () {
11834
11867
  var _a, _b;
11835
11868
  this.context.setIsLocalMicrophoneEnabled(true);
11836
11869
  if (_isInCall((_a = this.call) === null || _a === void 0 ? void 0 : _a.state) && ((_b = this.call) === null || _b === void 0 ? void 0 : _b.isMuted)) {
@@ -11840,8 +11873,8 @@ class AzureCommunicationCallAdapter {
11840
11873
  });
11841
11874
  }
11842
11875
  startScreenShare() {
11843
- return __awaiter(this, void 0, void 0, function* () {
11844
- return yield this.asyncTeeErrorToEventEmitter(() => __awaiter(this, void 0, void 0, function* () {
11876
+ return __awaiter$4(this, void 0, void 0, function* () {
11877
+ return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$4(this, void 0, void 0, function* () {
11845
11878
  var _a;
11846
11879
  if (!((_a = this.call) === null || _a === void 0 ? void 0 : _a.isScreenSharingOn)) {
11847
11880
  yield this.handlers.onToggleScreenShare();
@@ -11850,8 +11883,8 @@ class AzureCommunicationCallAdapter {
11850
11883
  });
11851
11884
  }
11852
11885
  stopScreenShare() {
11853
- return __awaiter(this, void 0, void 0, function* () {
11854
- return yield this.asyncTeeErrorToEventEmitter(() => __awaiter(this, void 0, void 0, function* () {
11886
+ return __awaiter$4(this, void 0, void 0, function* () {
11887
+ return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$4(this, void 0, void 0, function* () {
11855
11888
  var _a;
11856
11889
  if ((_a = this.call) === null || _a === void 0 ? void 0 : _a.isScreenSharingOn) {
11857
11890
  yield this.handlers.onToggleScreenShare();
@@ -11870,7 +11903,7 @@ class AzureCommunicationCallAdapter {
11870
11903
  return this.handlers.onStartCall(idsToAdd);
11871
11904
  }
11872
11905
  removeParticipant(userId) {
11873
- return __awaiter(this, void 0, void 0, function* () {
11906
+ return __awaiter$4(this, void 0, void 0, function* () {
11874
11907
  this.handlers.onRemoveParticipant(userId);
11875
11908
  });
11876
11909
  }
@@ -11945,7 +11978,7 @@ class AzureCommunicationCallAdapter {
11945
11978
  this.emitter.off(event, listener);
11946
11979
  }
11947
11980
  asyncTeeErrorToEventEmitter(f) {
11948
- return __awaiter(this, void 0, void 0, function* () {
11981
+ return __awaiter$4(this, void 0, void 0, function* () {
11949
11982
  try {
11950
11983
  return yield f();
11951
11984
  }
@@ -11967,7 +12000,7 @@ class AzureCommunicationCallAdapter {
11967
12000
  *
11968
12001
  * @public
11969
12002
  */
11970
- const createAzureCommunicationCallAdapter = ({ userId, displayName, credential, locator }) => __awaiter(void 0, void 0, void 0, function* () {
12003
+ const createAzureCommunicationCallAdapter = ({ userId, displayName, credential, locator }) => __awaiter$4(void 0, void 0, void 0, function* () {
11971
12004
  const callClient = createStatefulCallClient({ userId });
11972
12005
  const callAgent = yield callClient.createCallAgent(credential, { displayName });
11973
12006
  const adapter = createAzureCommunicationCallAdapterFromClient(callClient, callAgent, locator);
@@ -11981,7 +12014,7 @@ const createAzureCommunicationCallAdapter = ({ userId, displayName, credential,
11981
12014
  *
11982
12015
  * @public
11983
12016
  */
11984
- const createAzureCommunicationCallAdapterFromClient = (callClient, callAgent, locator) => __awaiter(void 0, void 0, void 0, function* () {
12017
+ const createAzureCommunicationCallAdapterFromClient = (callClient, callAgent, locator) => __awaiter$4(void 0, void 0, void 0, function* () {
11985
12018
  const deviceManager = (yield callClient.getDeviceManager());
11986
12019
  return new AzureCommunicationCallAdapter(callClient, locator, callAgent, deviceManager);
11987
12020
  });
@@ -11989,6 +12022,1018 @@ const isCallError = (e) => {
11989
12022
  return e['target'] !== undefined && e['innerError'] !== undefined;
11990
12023
  };
11991
12024
 
12025
+ // Copyright (c) Microsoft Corporation.
12026
+ // Licensed under the MIT license.
12027
+ /**
12028
+ * @private
12029
+ */
12030
+ const sidePaneContainerStyles = {
12031
+ root: {
12032
+ height: '100%',
12033
+ paddingTop: '0.5rem',
12034
+ paddingBottom: '0.5rem',
12035
+ width: '21.5rem'
12036
+ }
12037
+ };
12038
+ /**
12039
+ * @private
12040
+ */
12041
+ const sidePaneContainerHiddenStyles = {
12042
+ root: Object.assign(Object.assign({}, sidePaneContainerStyles), { display: 'none' })
12043
+ };
12044
+ /**
12045
+ * @private
12046
+ */
12047
+ const sidePaneContainerTokens = {
12048
+ childrenGap: '0.5rem'
12049
+ };
12050
+ /**
12051
+ * @private
12052
+ */
12053
+ const sidePaneHeaderStyles = {
12054
+ root: {
12055
+ fontSize: '0.825rem',
12056
+ lineHeight: '1.25rem',
12057
+ padding: '0.25rem',
12058
+ fontWeight: '600'
12059
+ }
12060
+ };
12061
+ /**
12062
+ * @private
12063
+ */
12064
+ const paneBodyContainer = { root: { flexDirection: 'column', display: 'flex' } };
12065
+ /**
12066
+ * @private
12067
+ */
12068
+ const scrollableContainer = { root: { flexBasis: '0', flexGrow: '1', overflowY: 'auto' } };
12069
+ /**
12070
+ * @private
12071
+ */
12072
+ const scrollableContainerContents = { root: { flexGrow: '1', flexBasis: '0' } };
12073
+ /**
12074
+ * @private
12075
+ */
12076
+ const peopleSubheadingStyle = {
12077
+ root: {
12078
+ fontSize: '0.75rem'
12079
+ }
12080
+ };
12081
+ /**
12082
+ * @private
12083
+ */
12084
+ const peoplePaneContainerTokens = {
12085
+ childrenGap: '0.5rem'
12086
+ };
12087
+
12088
+ var __awaiter$3 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
12089
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
12090
+ return new (P || (P = Promise))(function (resolve, reject) {
12091
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
12092
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
12093
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
12094
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
12095
+ });
12096
+ };
12097
+ const SidePane = (props) => {
12098
+ // We hide the side pane instead of not rendering the entire pane to persist certain elements
12099
+ // between renders. An example of this is composing a chat message - a chat message that has been
12100
+ // typed but not sent should not be lost if the side panel is closed and then reopened.
12101
+ const sidePaneStyles = props.hidden ? sidePaneContainerHiddenStyles : sidePaneContainerStyles;
12102
+ const theme = useTheme();
12103
+ const sidePaneCloseButtonStyles = {
12104
+ icon: { color: theme.palette.neutralSecondary },
12105
+ iconHovered: { color: theme.palette.neutralSecondary },
12106
+ iconPressed: { color: theme.palette.neutralSecondary }
12107
+ };
12108
+ return (React__default['default'].createElement(react.Stack.Item, { disableShrink: true, verticalFill: true, styles: sidePaneStyles, tokens: sidePaneContainerTokens },
12109
+ React__default['default'].createElement(react.Stack, { verticalFill: true, "data-ui-id": props.dataUiId },
12110
+ React__default['default'].createElement(react.Stack, { horizontal: true, horizontalAlign: "space-between", styles: sidePaneHeaderStyles },
12111
+ React__default['default'].createElement(react.Stack.Item, null, props.headingText),
12112
+ React__default['default'].createElement(react.CommandBarButton, { styles: sidePaneCloseButtonStyles, iconProps: { iconName: 'cancel' }, onClick: props.onClose })),
12113
+ React__default['default'].createElement(react.Stack.Item, { verticalFill: true, grow: true, styles: paneBodyContainer },
12114
+ React__default['default'].createElement(react.Stack, { horizontal: true, styles: scrollableContainer },
12115
+ React__default['default'].createElement(react.Stack.Item, { verticalFill: true, styles: scrollableContainerContents }, props.children))))));
12116
+ };
12117
+ /**
12118
+ * In a Meeting when a participant is removed, we must remove them from both
12119
+ * the call and the chat thread.
12120
+ */
12121
+ const removeParticipantFromMeeting = (callAdapter, chatAdapter, participantId) => __awaiter$3(void 0, void 0, void 0, function* () {
12122
+ yield callAdapter.removeParticipant(participantId);
12123
+ yield chatAdapter.removeParticipant(participantId);
12124
+ });
12125
+ /**
12126
+ * @private
12127
+ */
12128
+ const EmbeddedPeoplePane = (props) => {
12129
+ const { callAdapter, chatAdapter, inviteLink } = props;
12130
+ const participantListDefaultProps = usePropsFor$1(ParticipantList);
12131
+ const participantListProps = React.useMemo(() => {
12132
+ const onRemoveParticipant = (participantId) => __awaiter$3(void 0, void 0, void 0, function* () { return removeParticipantFromMeeting(callAdapter, chatAdapter, participantId); });
12133
+ return Object.assign(Object.assign({}, participantListDefaultProps), { onRemoveParticipant });
12134
+ }, [participantListDefaultProps, callAdapter, chatAdapter]);
12135
+ const theme = useTheme();
12136
+ const peopleSubheadingStyleThemed = react.concatStyleSets(peopleSubheadingStyle, {
12137
+ root: {
12138
+ color: theme.palette.neutralSecondary
12139
+ }
12140
+ });
12141
+ return (React__default['default'].createElement(SidePane, { hidden: props.hidden, headingText: 'People', onClose: props.onClose, dataUiId: 'meeting-composite-people-pane' },
12142
+ React__default['default'].createElement(react.Stack, { tokens: peoplePaneContainerTokens },
12143
+ inviteLink && (React__default['default'].createElement(react.DefaultButton, { text: "Copy invite link", iconProps: { iconName: 'Link' }, onClick: () => copy__default['default'](inviteLink) })),
12144
+ React__default['default'].createElement(react.Stack.Item, { styles: peopleSubheadingStyleThemed }, "In this call"),
12145
+ React__default['default'].createElement(ParticipantList, Object.assign({}, participantListProps)))));
12146
+ };
12147
+ /**
12148
+ * @private
12149
+ */
12150
+ const EmbeddedChatPane = (props) => {
12151
+ return (React__default['default'].createElement(SidePane, { hidden: props.hidden, headingText: 'Chat', onClose: props.onClose, dataUiId: 'meeting-composite-chat-pane' },
12152
+ React__default['default'].createElement(ChatComposite, Object.assign({}, props.chatCompositeProps, { adapter: props.chatAdapter, fluentTheme: props.fluentTheme, options: { topic: false, /* @conditional-compile-remove-from(stable) */ participantPane: false } }))));
12153
+ };
12154
+
12155
+ // Copyright (c) Microsoft Corporation.
12156
+ const onRenderOnIcon$1 = () => React__default['default'].createElement(reactIcons.Chat20Filled, { key: 'chatOnIconKey', primaryFill: "currentColor" });
12157
+ const onRenderOffIcon$1 = () => React__default['default'].createElement(reactIcons.Chat20Regular, { key: 'chatOffIconKey', primaryFill: "currentColor" });
12158
+ /**
12159
+ * @private
12160
+ */
12161
+ const ChatButton = (props) => {
12162
+ var _a, _b;
12163
+ const strings = Object.assign({ label: 'Chat' }, props.strings);
12164
+ return (React__default['default'].createElement(ControlBarButton, Object.assign({}, props, { labelKey: 'chatButtonLabelKey', strings: strings, onRenderOnIcon: (_a = props.onRenderOnIcon) !== null && _a !== void 0 ? _a : onRenderOnIcon$1, onRenderOffIcon: (_b = props.onRenderOffIcon) !== null && _b !== void 0 ? _b : onRenderOffIcon$1, onClick: props.onClick })));
12165
+ };
12166
+
12167
+ // Copyright (c) Microsoft Corporation.
12168
+ const onRenderOnIcon = () => React__default['default'].createElement(reactIcons.People20Filled, { key: 'peopleOnIconKey', primaryFill: "currentColor" });
12169
+ const onRenderOffIcon = () => React__default['default'].createElement(reactIcons.People20Regular, { key: 'peopleOffIconKey', primaryFill: "currentColor" });
12170
+ /**
12171
+ * @private
12172
+ */
12173
+ const PeopleButton = (props) => {
12174
+ var _a, _b;
12175
+ const strings = Object.assign({ label: 'People' }, props.strings);
12176
+ return (React__default['default'].createElement(ControlBarButton, Object.assign({}, props, { strings: strings, labelKey: 'peopleButtonLabelKey', onRenderOnIcon: (_a = props.onRenderOnIcon) !== null && _a !== void 0 ? _a : onRenderOnIcon, onRenderOffIcon: (_b = props.onRenderOffIcon) !== null && _b !== void 0 ? _b : onRenderOffIcon, onClick: props.onClick })));
12177
+ };
12178
+
12179
+ // Copyright (c) Microsoft Corporation.
12180
+ /**
12181
+ * @private
12182
+ */
12183
+ const MeetingCallControlBar = (props) => {
12184
+ // Disable the default participants button as meetings composite has its own participants button.
12185
+ let callControlsOptions = {
12186
+ participantsButton: false,
12187
+ screenShareButton: props.mobileView ? false : { disabled: props.disableButtonsForLobbyPage }
12188
+ };
12189
+ // Reduce the controls shown when mobile view is enabled.
12190
+ if (props.mobileView) {
12191
+ callControlsOptions = reduceCallControlsForMobile(callControlsOptions);
12192
+ }
12193
+ /**
12194
+ * Until mobile meetings is worked on, statically set the width of the
12195
+ * control bar such that all controls can be accessed.
12196
+ */
12197
+ const temporaryMeetingControlBarStyles = props.mobileView ? { width: '23.5rem' } : undefined;
12198
+ return (React__default['default'].createElement(react.Stack, { horizontal: true, className: react.mergeStyles(temporaryMeetingControlBarStyles, callControlsContainerStyles, controlBarContainerStyles) },
12199
+ React__default['default'].createElement(react.Stack.Item, { grow: true },
12200
+ React__default['default'].createElement(CallAdapterProvider, { adapter: props.callAdapter },
12201
+ React__default['default'].createElement(CallControls, { options: callControlsOptions, increaseFlyoutItemSize: props.mobileView }))),
12202
+ React__default['default'].createElement(react.Stack.Item, null,
12203
+ React__default['default'].createElement(ChatButton, { checked: props.chatButtonChecked, showLabel: true, onClick: props.onChatButtonClicked, "data-ui-id": "meeting-composite-chat-button", disabled: props.disableButtonsForLobbyPage }),
12204
+ React__default['default'].createElement(PeopleButton, { checked: props.peopleButtonChecked, showLabel: true, onClick: props.onPeopleButtonClicked, "data-ui-id": "meeting-composite-people-button", disabled: props.disableButtonsForLobbyPage }))));
12205
+ };
12206
+
12207
+ // Copyright (c) Microsoft Corporation.
12208
+ // Licensed under the MIT license.
12209
+ /**
12210
+ * @private
12211
+ */
12212
+ const compositeOuterContainerStyles = {
12213
+ root: {
12214
+ width: '100%',
12215
+ // This allows the composite to correctly contain the call composite by calculating a height for the available space.
12216
+ // Items inside the call composite that fill 100% of the height will now fill the height of this container instead
12217
+ // of the height of the child items.
12218
+ // If this css property is to be removed, test the participant pane correctly uses the scroll overflow when there a lot
12219
+ // of participants (i.e. beyond screen height) and where one participant is sharing their screen.
12220
+ flexWrap: 'wrap'
12221
+ }
12222
+ };
12223
+
12224
+ // Copyright (c) Microsoft Corporation.
12225
+ // Licensed under the MIT license.
12226
+ /**
12227
+ * @private
12228
+ */
12229
+ function callPageToMeetingPage(page) {
12230
+ switch (page) {
12231
+ case 'call':
12232
+ return 'meeting';
12233
+ case 'leftCall':
12234
+ return 'leftMeeting';
12235
+ case 'removedFromCall':
12236
+ return 'removedFromMeeting';
12237
+ case 'joinCallFailedDueToNoNetwork':
12238
+ return 'joinMeetingFailedDueToNoNetwork';
12239
+ default:
12240
+ return page;
12241
+ }
12242
+ }
12243
+ /**
12244
+ * @private
12245
+ */
12246
+ function meetingPageToCallPage(page) {
12247
+ switch (page) {
12248
+ case 'meeting':
12249
+ return 'call';
12250
+ case 'leftMeeting':
12251
+ return 'leftCall';
12252
+ case 'removedFromMeeting':
12253
+ return 'removedFromCall';
12254
+ case 'joinMeetingFailedDueToNoNetwork':
12255
+ return 'joinCallFailedDueToNoNetwork';
12256
+ default:
12257
+ return page;
12258
+ }
12259
+ }
12260
+ /**
12261
+ * @private
12262
+ */
12263
+ const hasJoinedCall = (page, callStatus) => page === 'meeting' && callStatus === 'Connected';
12264
+
12265
+ // Copyright (c) Microsoft Corporation.
12266
+ // Licensed under the MIT license.
12267
+ /**
12268
+ * @private
12269
+ */
12270
+ function meetingParticipantFromCallParticipant(callParticipant) {
12271
+ return {
12272
+ id: callParticipant.identifier,
12273
+ meetingEndReason: callParticipant.callEndReason,
12274
+ displayName: callParticipant.displayName,
12275
+ state: callParticipant.state,
12276
+ videoStreams: callParticipant.videoStreams,
12277
+ isMuted: callParticipant.isMuted,
12278
+ isSpeaking: callParticipant.isSpeaking
12279
+ };
12280
+ }
12281
+ /**
12282
+ * @private
12283
+ */
12284
+ function callParticipantFromMeetingParticipant(meetingParticipant) {
12285
+ return {
12286
+ identifier: meetingParticipant.id,
12287
+ callEndReason: meetingParticipant.meetingEndReason,
12288
+ displayName: meetingParticipant.displayName,
12289
+ state: meetingParticipant.state,
12290
+ videoStreams: meetingParticipant.videoStreams,
12291
+ isMuted: meetingParticipant.isMuted,
12292
+ isSpeaking: meetingParticipant.isSpeaking
12293
+ };
12294
+ }
12295
+ /**
12296
+ * @private
12297
+ */
12298
+ function meetingParticipantsFromCallParticipants(callParticipants) {
12299
+ const meetingParticipants = {};
12300
+ for (const [key, value] of Object.entries(callParticipants)) {
12301
+ meetingParticipants[key] = meetingParticipantFromCallParticipant(value);
12302
+ }
12303
+ return meetingParticipants;
12304
+ }
12305
+ /**
12306
+ * @private
12307
+ */
12308
+ function callParticipantsFromMeetingParticipants(meetingParticipants) {
12309
+ const callParticipants = {};
12310
+ for (const [key, value] of Object.entries(meetingParticipants)) {
12311
+ callParticipants[key] = callParticipantFromMeetingParticipant(value);
12312
+ }
12313
+ return callParticipants;
12314
+ }
12315
+
12316
+ // Copyright (c) Microsoft Corporation.
12317
+ // Licensed under the MIT license.
12318
+ var __awaiter$2 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
12319
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
12320
+ return new (P || (P = Promise))(function (resolve, reject) {
12321
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
12322
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
12323
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
12324
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
12325
+ });
12326
+ };
12327
+ /* eslint-disable @typescript-eslint/no-explicit-any */
12328
+ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */
12329
+ function callStateFromMeetingState(meetingState) {
12330
+ return {
12331
+ id: meetingState.id,
12332
+ callerInfo: meetingState.callerInfo,
12333
+ state: meetingState.state,
12334
+ callEndReason: meetingState.meetingEndReason,
12335
+ direction: 'Incoming',
12336
+ isMuted: meetingState.isMuted,
12337
+ isScreenSharingOn: meetingState.isScreenSharingOn,
12338
+ localVideoStreams: meetingState.localVideoStreams,
12339
+ transcription: meetingState.transcription,
12340
+ recording: meetingState.recording,
12341
+ screenShareRemoteParticipant: meetingState.screenShareRemoteParticipant,
12342
+ startTime: meetingState.startTime,
12343
+ endTime: meetingState.endTime,
12344
+ diagnostics: meetingState.diagnostics,
12345
+ remoteParticipants: callParticipantsFromMeetingParticipants(meetingState.participants),
12346
+ remoteParticipantsEnded: callParticipantsFromMeetingParticipants(meetingState.participantsEnded),
12347
+ dominantSpeakers: meetingState.dominantSpeakers
12348
+ };
12349
+ }
12350
+ function callAdapterStateFromMeetingAdapterState(meetingState) {
12351
+ return {
12352
+ isLocalPreviewMicrophoneEnabled: meetingState.isLocalPreviewMicrophoneEnabled,
12353
+ page: meetingPageToCallPage(meetingState.page),
12354
+ userId: meetingState.userId,
12355
+ displayName: meetingState.displayName,
12356
+ call: meetingState.meeting ? callStateFromMeetingState(meetingState.meeting) : undefined,
12357
+ devices: meetingState.devices,
12358
+ isTeamsCall: meetingState.isTeamsCall,
12359
+ latestErrors: {} //@TODO: latest errors not supported in meeting composite yet.
12360
+ };
12361
+ }
12362
+ /**
12363
+ * Facade around the MeetingAdapter to satisfy the call adapter interface.
12364
+ *
12365
+ * @private
12366
+ */
12367
+ class MeetingBackedCallAdapter {
12368
+ constructor(meetingAdapter) {
12369
+ // For onStateChange we must convert meeting state to chat state. This involves creating a new handler to be passed into the onStateChange.
12370
+ // In order to unsubscribe the handler when offStateChange is called we must have a mapping of the original handler to the newly created handler.
12371
+ this.eventStore = new Map();
12372
+ this.on = (event, listener) => this.meetingAdapter.on(event, listener);
12373
+ this.off = (event, listener) => this.meetingAdapter.off(event, listener);
12374
+ this.onStateChange = (handler) => {
12375
+ const convertedHandler = (state) => {
12376
+ handler(callAdapterStateFromMeetingAdapterState(state));
12377
+ };
12378
+ this.meetingAdapter.onStateChange(convertedHandler);
12379
+ this.eventStore.set(handler, convertedHandler);
12380
+ };
12381
+ this.offStateChange = (handler) => {
12382
+ const convertedHandler = this.eventStore.get(handler);
12383
+ convertedHandler && this.meetingAdapter.offStateChange(convertedHandler);
12384
+ };
12385
+ this.getState = () => callAdapterStateFromMeetingAdapterState(this.meetingAdapter.getState());
12386
+ this.dispose = () => this.meetingAdapter.dispose();
12387
+ this.joinCall = (microphoneOn) => {
12388
+ return this.meetingAdapter.joinMeeting(microphoneOn);
12389
+ };
12390
+ this.leaveCall = () => __awaiter$2(this, void 0, void 0, function* () { return yield this.meetingAdapter.leaveMeeting(); });
12391
+ this.startCall = (participants) => {
12392
+ return this.meetingAdapter.startMeeting(participants);
12393
+ };
12394
+ this.setCamera = (sourceId, options) => __awaiter$2(this, void 0, void 0, function* () { return yield this.meetingAdapter.setCamera(sourceId, options); });
12395
+ this.setMicrophone = (sourceId) => __awaiter$2(this, void 0, void 0, function* () { return yield this.meetingAdapter.setMicrophone(sourceId); });
12396
+ this.setSpeaker = (sourceId) => __awaiter$2(this, void 0, void 0, function* () { return yield this.meetingAdapter.setSpeaker(sourceId); });
12397
+ this.askDevicePermission = (constraints) => __awaiter$2(this, void 0, void 0, function* () { return yield this.meetingAdapter.askDevicePermission(constraints); });
12398
+ this.queryCameras = () => __awaiter$2(this, void 0, void 0, function* () { return yield this.meetingAdapter.queryCameras(); });
12399
+ this.queryMicrophones = () => __awaiter$2(this, void 0, void 0, function* () { return yield this.meetingAdapter.queryMicrophones(); });
12400
+ this.querySpeakers = () => __awaiter$2(this, void 0, void 0, function* () { return yield this.meetingAdapter.querySpeakers(); });
12401
+ this.startCamera = (options) => __awaiter$2(this, void 0, void 0, function* () { return yield this.meetingAdapter.startCamera(options); });
12402
+ this.stopCamera = () => __awaiter$2(this, void 0, void 0, function* () { return yield this.meetingAdapter.stopCamera(); });
12403
+ this.mute = () => __awaiter$2(this, void 0, void 0, function* () { return yield this.meetingAdapter.mute(); });
12404
+ this.unmute = () => __awaiter$2(this, void 0, void 0, function* () { return yield this.meetingAdapter.unmute(); });
12405
+ this.startScreenShare = () => __awaiter$2(this, void 0, void 0, function* () { return yield this.meetingAdapter.startScreenShare(); });
12406
+ this.stopScreenShare = () => __awaiter$2(this, void 0, void 0, function* () { return yield this.meetingAdapter.stopScreenShare(); });
12407
+ this.removeParticipant = (userId) => __awaiter$2(this, void 0, void 0, function* () { return yield this.meetingAdapter.removeParticipant(userId); });
12408
+ this.createStreamView = (remoteUserId, options) => __awaiter$2(this, void 0, void 0, function* () { return yield this.meetingAdapter.createStreamView(remoteUserId, options); });
12409
+ this.disposeStreamView = (remoteUserId, options) => __awaiter$2(this, void 0, void 0, function* () { return yield this.meetingAdapter.disposeStreamView(remoteUserId, options); });
12410
+ this.meetingAdapter = meetingAdapter;
12411
+ }
12412
+ }
12413
+
12414
+ // Copyright (c) Microsoft Corporation.
12415
+ // Licensed under the MIT license.
12416
+ var __awaiter$1 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
12417
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
12418
+ return new (P || (P = Promise))(function (resolve, reject) {
12419
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
12420
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
12421
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
12422
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
12423
+ });
12424
+ };
12425
+ /* eslint-disable @typescript-eslint/no-explicit-any */
12426
+ /* eslint-disable @typescript-eslint/no-unused-vars */
12427
+ function chatThreadStateFromMeetingState(meetingState) {
12428
+ return {
12429
+ chatMessages: meetingState.chatMessages,
12430
+ participants: meetingState.participants,
12431
+ threadId: meetingState.threadId,
12432
+ properties: meetingState.properties,
12433
+ readReceipts: meetingState.readReceipts,
12434
+ typingIndicators: meetingState.typingIndicators,
12435
+ latestReadTime: meetingState.latestReadTime
12436
+ };
12437
+ }
12438
+ function ChatAdapterStateFromMeetingAdapterState(meetingState) {
12439
+ if (!meetingState.meeting) {
12440
+ throw 'Cannot get chat adapter state. Meeting state is undefined.';
12441
+ }
12442
+ return {
12443
+ userId: meetingState.userId,
12444
+ displayName: meetingState.displayName || '',
12445
+ thread: chatThreadStateFromMeetingState(meetingState.meeting),
12446
+ latestErrors: {} //@TODO: latest errors not supported in meeting composite yet.
12447
+ };
12448
+ }
12449
+ /**
12450
+ * Facade around the MeetingAdapter to satisfy the chat adapter interface.
12451
+ *
12452
+ * @private
12453
+ */
12454
+ class MeetingBackedChatAdapter {
12455
+ constructor(meetingAdapter) {
12456
+ // For onStateChange we must convert meeting state to chat state. This involves creating a new handler to be passed into the onStateChange.
12457
+ // In order to unsubscribe the handler when offStateChange is called we must have a mapping of the original handler to the newly created handler.
12458
+ this.eventStore = new Map();
12459
+ this.fetchInitialData = () => __awaiter$1(this, void 0, void 0, function* () { return yield this.meetingAdapter.fetchInitialData(); });
12460
+ this.sendMessage = (content) => __awaiter$1(this, void 0, void 0, function* () { return yield this.meetingAdapter.sendMessage(content); });
12461
+ this.sendReadReceipt = (chatMessageId) => __awaiter$1(this, void 0, void 0, function* () { return yield this.meetingAdapter.sendReadReceipt(chatMessageId); });
12462
+ this.sendTypingIndicator = () => __awaiter$1(this, void 0, void 0, function* () { return yield this.meetingAdapter.sendTypingIndicator(); });
12463
+ this.removeParticipant = (userId) => __awaiter$1(this, void 0, void 0, function* () { return yield this.meetingAdapter.removeParticipant(userId); });
12464
+ this.loadPreviousChatMessages = (messagesToLoad) => __awaiter$1(this, void 0, void 0, function* () { return yield this.meetingAdapter.loadPreviousChatMessages(messagesToLoad); });
12465
+ this.dispose = () => this.meetingAdapter.dispose();
12466
+ this.onStateChange = (handler) => {
12467
+ const convertedHandler = (state) => {
12468
+ handler(ChatAdapterStateFromMeetingAdapterState(state));
12469
+ };
12470
+ this.meetingAdapter.onStateChange(convertedHandler);
12471
+ this.eventStore.set(handler, convertedHandler);
12472
+ };
12473
+ this.offStateChange = (handler) => {
12474
+ const convertedHandler = this.eventStore.get(handler);
12475
+ convertedHandler && this.meetingAdapter.offStateChange(convertedHandler);
12476
+ };
12477
+ this.getState = () => ChatAdapterStateFromMeetingAdapterState(this.meetingAdapter.getState());
12478
+ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */
12479
+ this.on = (event, listener) => this.meetingAdapter.on(event, listener);
12480
+ this.off = (event, listener) => this.meetingAdapter.off(event, listener);
12481
+ this.updateMessage = (messageId, content) => __awaiter$1(this, void 0, void 0, function* () { return yield this.meetingAdapter.updateMessage(messageId, content); });
12482
+ this.deleteMessage = (messageId) => __awaiter$1(this, void 0, void 0, function* () { return yield this.meetingAdapter.deleteMessage(messageId); });
12483
+ this.clearErrors = (errorTypes) => {
12484
+ throw `Method not supported in meetings.`;
12485
+ };
12486
+ this.setTopic = (topicName) => __awaiter$1(this, void 0, void 0, function* () {
12487
+ throw `Chat Topics are not supported in meetings.`;
12488
+ });
12489
+ this.meetingAdapter = meetingAdapter;
12490
+ }
12491
+ }
12492
+
12493
+ // Copyright (c) Microsoft Corporation.
12494
+ /**
12495
+ * Meeting Composite brings together key components to provide a full meeting experience out of the box.
12496
+ *
12497
+ * @beta
12498
+ */
12499
+ const MeetingComposite = (props) => {
12500
+ const { meetingAdapter, fluentTheme, formFactor = 'desktop' } = props;
12501
+ if (!meetingAdapter) {
12502
+ throw 'Meeting adapter is undefined';
12503
+ }
12504
+ const callAdapter = React.useMemo(() => new MeetingBackedCallAdapter(meetingAdapter), [meetingAdapter]);
12505
+ const chatAdapter = React.useMemo(() => new MeetingBackedChatAdapter(meetingAdapter), [meetingAdapter]);
12506
+ const [currentMeetingState, setCurrentMeetingState] = React.useState();
12507
+ const [currentPage, setCurrentPage] = React.useState();
12508
+ meetingAdapter.onStateChange((newState) => {
12509
+ var _a;
12510
+ setCurrentPage(newState.page);
12511
+ setCurrentMeetingState((_a = newState.meeting) === null || _a === void 0 ? void 0 : _a.state);
12512
+ });
12513
+ const [showChat, setShowChat] = React.useState(false);
12514
+ const [showPeople, setShowPeople] = React.useState(false);
12515
+ const closePane = React.useCallback(() => {
12516
+ setShowChat(false);
12517
+ setShowPeople(false);
12518
+ }, []);
12519
+ const toggleChat = React.useCallback(() => {
12520
+ setShowPeople(false);
12521
+ setShowChat(!showChat);
12522
+ }, [showChat]);
12523
+ const togglePeople = React.useCallback(() => {
12524
+ setShowChat(false);
12525
+ setShowPeople(!showPeople);
12526
+ }, [showPeople]);
12527
+ const isInLobbyOrConnecting = currentPage === 'lobby';
12528
+ const hasJoinedCall$1 = !!(currentPage && hasJoinedCall(currentPage, currentMeetingState !== null && currentMeetingState !== void 0 ? currentMeetingState : 'None'));
12529
+ return (React__default['default'].createElement(FluentThemeProvider, { fluentTheme: fluentTheme },
12530
+ React__default['default'].createElement(react.Stack, { verticalFill: true, grow: true, styles: compositeOuterContainerStyles },
12531
+ React__default['default'].createElement(react.Stack, { horizontal: true, grow: true },
12532
+ React__default['default'].createElement(react.Stack.Item, { grow: true },
12533
+ React__default['default'].createElement(CallComposite, Object.assign({}, props, { formFactor: formFactor, options: { callControls: false }, adapter: callAdapter, fluentTheme: fluentTheme }))),
12534
+ chatAdapter && hasJoinedCall$1 && (React__default['default'].createElement(EmbeddedChatPane, { chatCompositeProps: props, hidden: !showChat, chatAdapter: chatAdapter, fluentTheme: fluentTheme, onClose: closePane })),
12535
+ callAdapter && chatAdapter && hasJoinedCall$1 && (React__default['default'].createElement(CallAdapterProvider, { adapter: callAdapter },
12536
+ React__default['default'].createElement(EmbeddedPeoplePane, { hidden: !showPeople, inviteLink: props.meetingInvitationURL, onClose: closePane, chatAdapter: chatAdapter, callAdapter: callAdapter })))),
12537
+ (isInLobbyOrConnecting || hasJoinedCall$1) && (React__default['default'].createElement(MeetingCallControlBar, { callAdapter: callAdapter, chatButtonChecked: showChat, onChatButtonClicked: toggleChat, peopleButtonChecked: showPeople, onPeopleButtonClicked: togglePeople, mobileView: props.formFactor === 'mobile', disableButtonsForLobbyPage: isInLobbyOrConnecting })))));
12538
+ };
12539
+
12540
+ // Copyright (c) Microsoft Corporation.
12541
+ /**
12542
+ * Return properties from call state that are used in meeting state.
12543
+ *
12544
+ * @private
12545
+ */
12546
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
12547
+ const meetingPropsFromCallState = (callState) => ({
12548
+ id: callState.id,
12549
+ callerInfo: callState.callerInfo,
12550
+ state: callState.state,
12551
+ isMuted: callState.isMuted,
12552
+ isScreenSharingOn: callState.isScreenSharingOn,
12553
+ localVideoStreams: callState.localVideoStreams,
12554
+ transcription: callState.transcription,
12555
+ recording: callState.recording,
12556
+ screenShareRemoteParticipant: callState.screenShareRemoteParticipant,
12557
+ startTime: callState.startTime,
12558
+ endTime: callState.endTime,
12559
+ meetingEndReason: callState.callEndReason,
12560
+ diagnostics: callState.diagnostics,
12561
+ dominantSpeakers: callState.dominantSpeakers,
12562
+ // For meetings we only use participants from the call in a meeting
12563
+ participants: meetingParticipantsFromCallParticipants(callState.remoteParticipants),
12564
+ participantsEnded: meetingParticipantsFromCallParticipants(callState.remoteParticipantsEnded)
12565
+ });
12566
+ /**
12567
+ * Return properties from chat state that are used in meeting state.
12568
+ *
12569
+ * @private
12570
+ */
12571
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
12572
+ const meetingPropsFromChatState = (chatState) => ({
12573
+ chatMessages: chatState.chatMessages,
12574
+ threadId: chatState.threadId,
12575
+ properties: chatState.properties,
12576
+ readReceipts: chatState.readReceipts,
12577
+ typingIndicators: chatState.typingIndicators,
12578
+ latestReadTime: chatState.latestReadTime
12579
+ });
12580
+ /**
12581
+ * Helper function to return meeting state created from call and chat states
12582
+ *
12583
+ * @private
12584
+ */
12585
+ function meetingStateFromBackingStates(callState, chatState) {
12586
+ return Object.assign(Object.assign({}, meetingPropsFromCallState(callState)), meetingPropsFromChatState(chatState));
12587
+ }
12588
+ /**
12589
+ * Helper function to return an updated meeting state with new chat state applied
12590
+ *
12591
+ * @private
12592
+ */
12593
+ function mergeChatStateIntoMeetingState(meetingState, chatState) {
12594
+ return Object.assign(Object.assign({}, meetingState), meetingPropsFromChatState(chatState));
12595
+ }
12596
+ /**
12597
+ * Helper function to return an updated meeting state with new call state applied
12598
+ *
12599
+ * @private
12600
+ */
12601
+ function mergeCallStateIntoMeetingState(meetingState, callState) {
12602
+ // If we have no existing meeting state, populate chat fields with defaults to merge and make a new state.
12603
+ // This is because calls are constructed before chat state is created.
12604
+ if (!meetingState) {
12605
+ return Object.assign({ chatMessages: {}, threadId: '', properties: {}, readReceipts: [], typingIndicators: [], latestReadTime: new Date(0) }, meetingPropsFromCallState(callState));
12606
+ }
12607
+ return Object.assign(Object.assign({}, meetingState), meetingPropsFromCallState(callState));
12608
+ }
12609
+
12610
+ // Copyright (c) Microsoft Corporation.
12611
+ /**
12612
+ * @private
12613
+ */
12614
+ function meetingAdapterStateFromBackingStates(callAdapter, chatAdapter) {
12615
+ const callAdapterState = callAdapter.getState();
12616
+ const chatAdapterState = chatAdapter.getState();
12617
+ const meeting = callAdapterState.call
12618
+ ? meetingStateFromBackingStates(callAdapterState.call, chatAdapterState.thread)
12619
+ : undefined;
12620
+ return {
12621
+ meeting,
12622
+ userId: callAdapterState.userId,
12623
+ page: callPageToMeetingPage(callAdapterState.page),
12624
+ displayName: callAdapterState.displayName,
12625
+ devices: callAdapterState.devices,
12626
+ isLocalPreviewMicrophoneEnabled: callAdapterState.isLocalPreviewMicrophoneEnabled,
12627
+ isTeamsCall: callAdapterState.isTeamsCall
12628
+ };
12629
+ }
12630
+ /**
12631
+ * @private
12632
+ */
12633
+ function mergeChatAdapterStateIntoMeetingAdapterState(meetingAdapterState, chatAdapterState) {
12634
+ const newMeetingState = meetingAdapterState.meeting
12635
+ ? mergeChatStateIntoMeetingState(meetingAdapterState.meeting, chatAdapterState.thread)
12636
+ : undefined;
12637
+ return Object.assign(Object.assign({}, meetingAdapterState), { meeting: newMeetingState });
12638
+ }
12639
+ /**
12640
+ * @private
12641
+ */
12642
+ function mergeCallAdapterStateIntoMeetingAdapterState(meetingAdapterState, callAdapterState) {
12643
+ const newMeetingState = callAdapterState.call
12644
+ ? mergeCallStateIntoMeetingState(meetingAdapterState.meeting, callAdapterState.call)
12645
+ : undefined;
12646
+ return {
12647
+ userId: callAdapterState.userId,
12648
+ page: callPageToMeetingPage(callAdapterState.page),
12649
+ displayName: callAdapterState.displayName,
12650
+ devices: callAdapterState.devices,
12651
+ meeting: newMeetingState,
12652
+ isLocalPreviewMicrophoneEnabled: callAdapterState.isLocalPreviewMicrophoneEnabled,
12653
+ isTeamsCall: callAdapterState.isTeamsCall
12654
+ };
12655
+ }
12656
+
12657
+ // Copyright (c) Microsoft Corporation.
12658
+ // Licensed under the MIT license.
12659
+ var __awaiter = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
12660
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
12661
+ return new (P || (P = Promise))(function (resolve, reject) {
12662
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
12663
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
12664
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
12665
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
12666
+ });
12667
+ };
12668
+ /** Context of meeting, which is a centralized context for all state updates */
12669
+ class MeetingContext {
12670
+ constructor(clientState) {
12671
+ this.emitter = new EventEmitter.EventEmitter();
12672
+ this.state = clientState;
12673
+ }
12674
+ onStateChange(handler) {
12675
+ this.emitter.on('stateChanged', handler);
12676
+ }
12677
+ offStateChange(handler) {
12678
+ this.emitter.off('stateChanged', handler);
12679
+ }
12680
+ setState(state) {
12681
+ this.state = state;
12682
+ this.emitter.emit('stateChanged', this.state);
12683
+ }
12684
+ getState() {
12685
+ return this.state;
12686
+ }
12687
+ updateClientState(clientState) {
12688
+ this.setState(clientState);
12689
+ }
12690
+ updateClientStateWithChatState(chatAdapterState) {
12691
+ this.updateClientState(mergeChatAdapterStateIntoMeetingAdapterState(this.state, chatAdapterState));
12692
+ }
12693
+ updateClientStateWithCallState(callAdapterState) {
12694
+ this.updateClientState(mergeCallAdapterStateIntoMeetingAdapterState(this.state, callAdapterState));
12695
+ }
12696
+ }
12697
+ /**
12698
+ * Meeting adapter backed by Azure Communication Services.
12699
+ * Created for easy use with the Meeting Composite.
12700
+ */
12701
+ class AzureCommunicationMeetingAdapter {
12702
+ constructor(callAdapter, chatAdapter) {
12703
+ this.bindPublicMethods();
12704
+ this.callAdapter = callAdapter;
12705
+ this.chatAdapter = chatAdapter;
12706
+ this.context = new MeetingContext(meetingAdapterStateFromBackingStates(callAdapter, chatAdapter));
12707
+ const onChatStateChange = (newChatAdapterState) => {
12708
+ this.context.updateClientStateWithChatState(newChatAdapterState);
12709
+ };
12710
+ this.chatAdapter.onStateChange(onChatStateChange);
12711
+ this.onChatStateChange = onChatStateChange;
12712
+ const onCallStateChange = (newCallAdapterState) => {
12713
+ this.context.updateClientStateWithCallState(newCallAdapterState);
12714
+ };
12715
+ this.callAdapter.onStateChange(onCallStateChange);
12716
+ this.onCallStateChange = onCallStateChange;
12717
+ }
12718
+ bindPublicMethods() {
12719
+ this.joinMeeting.bind(this);
12720
+ this.leaveMeeting.bind(this);
12721
+ this.startMeeting.bind(this);
12722
+ this.onStateChange.bind(this);
12723
+ this.offStateChange.bind(this);
12724
+ this.getState.bind(this);
12725
+ this.dispose.bind(this);
12726
+ this.setCamera.bind(this);
12727
+ this.setMicrophone.bind(this);
12728
+ this.setSpeaker.bind(this);
12729
+ this.askDevicePermission.bind(this);
12730
+ this.queryCameras.bind(this);
12731
+ this.queryMicrophones.bind(this);
12732
+ this.querySpeakers.bind(this);
12733
+ this.startCamera.bind(this);
12734
+ this.stopCamera.bind(this);
12735
+ this.mute.bind(this);
12736
+ this.unmute.bind(this);
12737
+ this.startScreenShare.bind(this);
12738
+ this.stopScreenShare.bind(this);
12739
+ this.removeParticipant.bind(this);
12740
+ this.createStreamView.bind(this);
12741
+ this.disposeStreamView.bind(this);
12742
+ this.fetchInitialData.bind(this);
12743
+ this.sendMessage.bind(this);
12744
+ this.sendReadReceipt.bind(this);
12745
+ this.sendTypingIndicator.bind(this);
12746
+ this.loadPreviousChatMessages.bind(this);
12747
+ this.updateMessage.bind(this);
12748
+ this.deleteMessage.bind(this);
12749
+ this.on.bind(this);
12750
+ this.off.bind(this);
12751
+ }
12752
+ /** Join existing Meeting. */
12753
+ joinMeeting(microphoneOn) {
12754
+ return this.callAdapter.joinCall(microphoneOn);
12755
+ }
12756
+ /** Leave current Meeting. */
12757
+ leaveMeeting() {
12758
+ return __awaiter(this, void 0, void 0, function* () {
12759
+ yield this.chatAdapter.removeParticipant(toFlatCommunicationIdentifier(this.chatAdapter.getState().userId));
12760
+ yield this.callAdapter.leaveCall();
12761
+ });
12762
+ }
12763
+ /** Start a new Meeting. */
12764
+ startMeeting(participants) {
12765
+ return this.callAdapter.startCall(participants);
12766
+ }
12767
+ /**
12768
+ * Subscribe to state change events.
12769
+ * @param handler - handler to be called when the state changes. This is passed the new state.
12770
+ */
12771
+ onStateChange(handler) {
12772
+ this.context.onStateChange(handler);
12773
+ }
12774
+ /**
12775
+ * Unsubscribe to state change events.
12776
+ * @param handler - handler to be no longer called when state changes.
12777
+ */
12778
+ offStateChange(handler) {
12779
+ this.context.offStateChange(handler);
12780
+ }
12781
+ /** Get current Meeting state. */
12782
+ getState() {
12783
+ return this.context.getState();
12784
+ }
12785
+ /** Dispose of the current Meeting Adapter. */
12786
+ dispose() {
12787
+ this.chatAdapter.offStateChange(this.onChatStateChange);
12788
+ this.callAdapter.offStateChange(this.onCallStateChange);
12789
+ this.chatAdapter.dispose();
12790
+ this.callAdapter.dispose();
12791
+ }
12792
+ /** Remove a participant from the Meeting. */
12793
+ removeParticipant(userId) {
12794
+ return __awaiter(this, void 0, void 0, function* () {
12795
+ yield this.chatAdapter.removeParticipant(userId);
12796
+ yield this.callAdapter.removeParticipant(userId);
12797
+ });
12798
+ }
12799
+ setCamera(device, options) {
12800
+ return __awaiter(this, void 0, void 0, function* () {
12801
+ yield this.callAdapter.setCamera(device, options);
12802
+ });
12803
+ }
12804
+ /** Set the microphone to be used in the meeting. */
12805
+ setMicrophone(device) {
12806
+ return __awaiter(this, void 0, void 0, function* () {
12807
+ yield this.callAdapter.setMicrophone(device);
12808
+ });
12809
+ }
12810
+ /** Set the speaker to be used in the meeting. */
12811
+ setSpeaker(device) {
12812
+ return __awaiter(this, void 0, void 0, function* () {
12813
+ yield this.callAdapter.setSpeaker(device);
12814
+ });
12815
+ }
12816
+ askDevicePermission(constraints) {
12817
+ return __awaiter(this, void 0, void 0, function* () {
12818
+ yield this.callAdapter.askDevicePermission(constraints);
12819
+ });
12820
+ }
12821
+ /** Query for available cameras. */
12822
+ queryCameras() {
12823
+ return __awaiter(this, void 0, void 0, function* () {
12824
+ return yield this.callAdapter.queryCameras();
12825
+ });
12826
+ }
12827
+ /** Query for available microphones. */
12828
+ queryMicrophones() {
12829
+ return __awaiter(this, void 0, void 0, function* () {
12830
+ return yield this.callAdapter.queryMicrophones();
12831
+ });
12832
+ }
12833
+ /** Query for available speakers. */
12834
+ querySpeakers() {
12835
+ return __awaiter(this, void 0, void 0, function* () {
12836
+ return yield this.callAdapter.querySpeakers();
12837
+ });
12838
+ }
12839
+ /** Start the camera for the user in the Meeting. */
12840
+ startCamera(options) {
12841
+ return __awaiter(this, void 0, void 0, function* () {
12842
+ yield this.callAdapter.startCamera(options);
12843
+ });
12844
+ }
12845
+ /** Stop the camera for the user in the Meeting. */
12846
+ stopCamera() {
12847
+ return __awaiter(this, void 0, void 0, function* () {
12848
+ yield this.callAdapter.stopCamera();
12849
+ });
12850
+ }
12851
+ /** Mute the user in the Meeting. */
12852
+ mute() {
12853
+ return __awaiter(this, void 0, void 0, function* () {
12854
+ yield this.callAdapter.mute();
12855
+ });
12856
+ }
12857
+ /** Unmute the user in the Meeting. */
12858
+ unmute() {
12859
+ return __awaiter(this, void 0, void 0, function* () {
12860
+ yield this.callAdapter.unmute();
12861
+ });
12862
+ }
12863
+ /** Trigger the user to start screen share. */
12864
+ startScreenShare() {
12865
+ return __awaiter(this, void 0, void 0, function* () {
12866
+ yield this.callAdapter.startScreenShare();
12867
+ });
12868
+ }
12869
+ /** Stop the current active screen share. */
12870
+ stopScreenShare() {
12871
+ return __awaiter(this, void 0, void 0, function* () {
12872
+ yield this.callAdapter.stopScreenShare();
12873
+ });
12874
+ }
12875
+ /** Create a stream view for a remote participants video feed. */
12876
+ createStreamView(remoteUserId, options) {
12877
+ return __awaiter(this, void 0, void 0, function* () {
12878
+ yield this.callAdapter.createStreamView(remoteUserId, options);
12879
+ });
12880
+ }
12881
+ /** Dispose of a created stream view of a remote participants video feed. */
12882
+ disposeStreamView(remoteUserId, options) {
12883
+ return __awaiter(this, void 0, void 0, function* () {
12884
+ yield this.callAdapter.disposeStreamView(remoteUserId, options);
12885
+ });
12886
+ }
12887
+ /** Fetch initial Meeting data such as chat messages. */
12888
+ fetchInitialData() {
12889
+ return __awaiter(this, void 0, void 0, function* () {
12890
+ yield this.chatAdapter.fetchInitialData();
12891
+ });
12892
+ }
12893
+ /** Send a chat message. */
12894
+ sendMessage(content) {
12895
+ return __awaiter(this, void 0, void 0, function* () {
12896
+ yield this.chatAdapter.sendMessage(content);
12897
+ });
12898
+ }
12899
+ /** Send a chat read receipt. */
12900
+ sendReadReceipt(chatMessageId) {
12901
+ return __awaiter(this, void 0, void 0, function* () {
12902
+ yield this.chatAdapter.sendReadReceipt(chatMessageId);
12903
+ });
12904
+ }
12905
+ /** Send an isTyping indicator. */
12906
+ sendTypingIndicator() {
12907
+ return __awaiter(this, void 0, void 0, function* () {
12908
+ yield this.chatAdapter.sendTypingIndicator();
12909
+ });
12910
+ }
12911
+ /** Load previous Meeting chat messages. */
12912
+ loadPreviousChatMessages(messagesToLoad) {
12913
+ return __awaiter(this, void 0, void 0, function* () {
12914
+ return yield this.chatAdapter.loadPreviousChatMessages(messagesToLoad);
12915
+ });
12916
+ }
12917
+ /** Update an existing message. */
12918
+ updateMessage(messageId, content) {
12919
+ return __awaiter(this, void 0, void 0, function* () {
12920
+ return yield this.chatAdapter.updateMessage(messageId, content);
12921
+ });
12922
+ }
12923
+ /** Delete an existing message. */
12924
+ deleteMessage(messageId) {
12925
+ return __awaiter(this, void 0, void 0, function* () {
12926
+ return yield this.chatAdapter.deleteMessage(messageId);
12927
+ });
12928
+ }
12929
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
12930
+ on(event, listener) {
12931
+ switch (event) {
12932
+ case 'participantsJoined':
12933
+ this.callAdapter.on(event, listener);
12934
+ break;
12935
+ case 'participantsLeft':
12936
+ this.callAdapter.on('participantsLeft', listener);
12937
+ break;
12938
+ case 'meetingEnded':
12939
+ this.callAdapter.on('callEnded', listener);
12940
+ break;
12941
+ case 'isMutedChanged':
12942
+ this.callAdapter.on('isMutedChanged', listener);
12943
+ break;
12944
+ case 'callIdChanged':
12945
+ this.callAdapter.on('callIdChanged', listener);
12946
+ break;
12947
+ case 'isLocalScreenSharingActiveChanged':
12948
+ this.callAdapter.on('isLocalScreenSharingActiveChanged', listener);
12949
+ break;
12950
+ case 'displayNameChanged':
12951
+ this.callAdapter.on('displayNameChanged', listener);
12952
+ break;
12953
+ case 'isSpeakingChanged':
12954
+ this.callAdapter.on('isSpeakingChanged', listener);
12955
+ break;
12956
+ case 'messageReceived':
12957
+ this.chatAdapter.on('messageReceived', listener);
12958
+ break;
12959
+ case 'messageSent':
12960
+ this.chatAdapter.on('messageSent', listener);
12961
+ break;
12962
+ case 'messageRead':
12963
+ this.chatAdapter.on('messageRead', listener);
12964
+ break;
12965
+ case 'error':
12966
+ throw 'on(Error) not implemented yet.';
12967
+ default:
12968
+ throw `Unknown MeetingEvent: ${event}`;
12969
+ }
12970
+ }
12971
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
12972
+ off(event, listener) {
12973
+ switch (event) {
12974
+ case 'participantsJoined':
12975
+ this.callAdapter.off(event, listener);
12976
+ break;
12977
+ case 'participantsLeft':
12978
+ this.callAdapter.off('participantsLeft', listener);
12979
+ break;
12980
+ case 'meetingEnded':
12981
+ this.callAdapter.off('callEnded', listener);
12982
+ break;
12983
+ case 'isMutedChanged':
12984
+ this.callAdapter.off('isMutedChanged', listener);
12985
+ break;
12986
+ case 'callIdChanged':
12987
+ this.callAdapter.off('callIdChanged', listener);
12988
+ break;
12989
+ case 'isLocalScreenSharingActiveChanged':
12990
+ this.callAdapter.off('isLocalScreenSharingActiveChanged', listener);
12991
+ break;
12992
+ case 'displayNameChanged':
12993
+ this.callAdapter.off('displayNameChanged', listener);
12994
+ break;
12995
+ case 'isSpeakingChanged':
12996
+ this.callAdapter.off('isSpeakingChanged', listener);
12997
+ break;
12998
+ case 'messageReceived':
12999
+ this.chatAdapter.off('messageReceived', listener);
13000
+ break;
13001
+ case 'messageSent':
13002
+ this.chatAdapter.off('messageSent', listener);
13003
+ break;
13004
+ case 'messageRead':
13005
+ this.chatAdapter.off('messageRead', listener);
13006
+ break;
13007
+ case 'error':
13008
+ throw 'on(Error) not implemented yet.';
13009
+ default:
13010
+ throw `Unknown MeetingEvent: ${event}`;
13011
+ }
13012
+ }
13013
+ }
13014
+ /**
13015
+ * Create a meeting adapter backed by Azure Communication services
13016
+ * to plug into the Meeting Composite.
13017
+ *
13018
+ * @beta
13019
+ */
13020
+ const createAzureCommunicationMeetingAdapter = ({ userId, displayName, credential, endpoint, chatThreadId, callLocator }) => __awaiter(void 0, void 0, void 0, function* () {
13021
+ const callAdapter = yield createAzureCommunicationCallAdapter({
13022
+ userId,
13023
+ displayName,
13024
+ credential,
13025
+ locator: callLocator
13026
+ });
13027
+ const chatAdapter = yield createAzureCommunicationChatAdapter({
13028
+ endpoint,
13029
+ userId,
13030
+ displayName,
13031
+ credential,
13032
+ threadId: chatThreadId
13033
+ });
13034
+ return new AzureCommunicationMeetingAdapter(callAdapter, chatAdapter);
13035
+ });
13036
+
11992
13037
  // Copyright (c) Microsoft Corporation.
11993
13038
  /**
11994
13039
  * Hook to obtain a selector for a specified component.
@@ -12095,6 +13140,7 @@ exports.ErrorBar = ErrorBar;
12095
13140
  exports.FluentThemeProvider = FluentThemeProvider;
12096
13141
  exports.GridLayout = GridLayout;
12097
13142
  exports.LocalizationProvider = LocalizationProvider$1;
13143
+ exports.MeetingComposite = MeetingComposite;
12098
13144
  exports.MessageStatusIndicator = MessageStatusIndicator;
12099
13145
  exports.MessageThread = MessageThread;
12100
13146
  exports.MicrophoneButton = MicrophoneButton;
@@ -12112,6 +13158,7 @@ exports.createAzureCommunicationCallAdapter = createAzureCommunicationCallAdapte
12112
13158
  exports.createAzureCommunicationCallAdapterFromClient = createAzureCommunicationCallAdapterFromClient;
12113
13159
  exports.createAzureCommunicationChatAdapter = createAzureCommunicationChatAdapter;
12114
13160
  exports.createAzureCommunicationChatAdapterFromClient = createAzureCommunicationChatAdapterFromClient;
13161
+ exports.createAzureCommunicationMeetingAdapter = createAzureCommunicationMeetingAdapter;
12115
13162
  exports.createDefaultCallingHandlers = createDefaultCallingHandlers;
12116
13163
  exports.createDefaultChatHandlers = createDefaultChatHandlers;
12117
13164
  exports.createStatefulCallClient = createStatefulCallClient;