@webex/plugin-meetings 3.12.0-next.9 → 3.12.0-next.90

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 (213) hide show
  1. package/AGENTS.md +9 -0
  2. package/dist/aiEnableRequest/index.js +15 -2
  3. package/dist/aiEnableRequest/index.js.map +1 -1
  4. package/dist/breakouts/breakout.js +8 -3
  5. package/dist/breakouts/breakout.js.map +1 -1
  6. package/dist/breakouts/index.js +26 -2
  7. package/dist/breakouts/index.js.map +1 -1
  8. package/dist/config.js +2 -2
  9. package/dist/config.js.map +1 -1
  10. package/dist/constants.js +35 -9
  11. package/dist/constants.js.map +1 -1
  12. package/dist/controls-options-manager/constants.js +11 -1
  13. package/dist/controls-options-manager/constants.js.map +1 -1
  14. package/dist/controls-options-manager/index.js +67 -29
  15. package/dist/controls-options-manager/index.js.map +1 -1
  16. package/dist/controls-options-manager/util.js +91 -0
  17. package/dist/controls-options-manager/util.js.map +1 -1
  18. package/dist/hashTree/constants.js +13 -1
  19. package/dist/hashTree/constants.js.map +1 -1
  20. package/dist/hashTree/hashTreeParser.js +880 -382
  21. package/dist/hashTree/hashTreeParser.js.map +1 -1
  22. package/dist/hashTree/utils.js +42 -0
  23. package/dist/hashTree/utils.js.map +1 -1
  24. package/dist/index.js +7 -0
  25. package/dist/index.js.map +1 -1
  26. package/dist/interceptors/dataChannelAuthToken.js +75 -15
  27. package/dist/interceptors/dataChannelAuthToken.js.map +1 -1
  28. package/dist/interceptors/locusRetry.js +23 -8
  29. package/dist/interceptors/locusRetry.js.map +1 -1
  30. package/dist/interpretation/index.js +10 -1
  31. package/dist/interpretation/index.js.map +1 -1
  32. package/dist/interpretation/interpretation.types.js +7 -0
  33. package/dist/interpretation/interpretation.types.js.map +1 -0
  34. package/dist/interpretation/siLanguage.js +1 -1
  35. package/dist/locus-info/controlsUtils.js +4 -1
  36. package/dist/locus-info/controlsUtils.js.map +1 -1
  37. package/dist/locus-info/index.js +303 -88
  38. package/dist/locus-info/index.js.map +1 -1
  39. package/dist/locus-info/infoUtils.js +36 -5
  40. package/dist/locus-info/infoUtils.js.map +1 -1
  41. package/dist/locus-info/types.js +19 -0
  42. package/dist/locus-info/types.js.map +1 -1
  43. package/dist/media/index.js +3 -1
  44. package/dist/media/index.js.map +1 -1
  45. package/dist/media/properties.js +1 -0
  46. package/dist/media/properties.js.map +1 -1
  47. package/dist/meeting/in-meeting-actions.js +5 -1
  48. package/dist/meeting/in-meeting-actions.js.map +1 -1
  49. package/dist/meeting/index.js +1233 -793
  50. package/dist/meeting/index.js.map +1 -1
  51. package/dist/meeting/locusMediaRequest.js +229 -82
  52. package/dist/meeting/locusMediaRequest.js.map +1 -1
  53. package/dist/meeting/muteState.js +10 -1
  54. package/dist/meeting/muteState.js.map +1 -1
  55. package/dist/meeting/request.js +5 -2
  56. package/dist/meeting/request.js.map +1 -1
  57. package/dist/meeting/util.js +35 -2
  58. package/dist/meeting/util.js.map +1 -1
  59. package/dist/meeting-info/meeting-info-v2.js +2 -2
  60. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  61. package/dist/meetings/index.js +231 -118
  62. package/dist/meetings/index.js.map +1 -1
  63. package/dist/meetings/meetings.types.js +6 -1
  64. package/dist/meetings/meetings.types.js.map +1 -1
  65. package/dist/meetings/request.js +39 -0
  66. package/dist/meetings/request.js.map +1 -1
  67. package/dist/meetings/util.js +79 -5
  68. package/dist/meetings/util.js.map +1 -1
  69. package/dist/member/index.js +10 -0
  70. package/dist/member/index.js.map +1 -1
  71. package/dist/member/types.js.map +1 -1
  72. package/dist/member/util.js +30 -0
  73. package/dist/member/util.js.map +1 -1
  74. package/dist/members/index.js +101 -43
  75. package/dist/members/index.js.map +1 -1
  76. package/dist/members/util.js +8 -1
  77. package/dist/members/util.js.map +1 -1
  78. package/dist/metrics/constants.js +5 -1
  79. package/dist/metrics/constants.js.map +1 -1
  80. package/dist/multistream/codec/constants.js +63 -0
  81. package/dist/multistream/codec/constants.js.map +1 -0
  82. package/dist/multistream/mediaRequestManager.js +62 -15
  83. package/dist/multistream/mediaRequestManager.js.map +1 -1
  84. package/dist/multistream/receiveSlot.js +9 -0
  85. package/dist/multistream/receiveSlot.js.map +1 -1
  86. package/dist/reachability/index.js +10 -13
  87. package/dist/reachability/index.js.map +1 -1
  88. package/dist/reachability/reachability.types.js +2 -0
  89. package/dist/reachability/reachability.types.js.map +1 -1
  90. package/dist/reachability/util.js +45 -0
  91. package/dist/reachability/util.js.map +1 -1
  92. package/dist/reactions/reactions.type.js.map +1 -1
  93. package/dist/recording-controller/index.js +1 -3
  94. package/dist/recording-controller/index.js.map +1 -1
  95. package/dist/types/config.d.ts +2 -2
  96. package/dist/types/constants.d.ts +12 -1
  97. package/dist/types/controls-options-manager/constants.d.ts +6 -1
  98. package/dist/types/controls-options-manager/index.d.ts +16 -0
  99. package/dist/types/hashTree/constants.d.ts +2 -0
  100. package/dist/types/hashTree/hashTreeParser.d.ts +146 -17
  101. package/dist/types/hashTree/utils.d.ts +18 -0
  102. package/dist/types/index.d.ts +3 -0
  103. package/dist/types/interceptors/locusRetry.d.ts +4 -4
  104. package/dist/types/interpretation/interpretation.types.d.ts +10 -0
  105. package/dist/types/locus-info/index.d.ts +50 -6
  106. package/dist/types/locus-info/infoUtils.d.ts +8 -0
  107. package/dist/types/locus-info/types.d.ts +21 -1
  108. package/dist/types/media/properties.d.ts +1 -0
  109. package/dist/types/meeting/in-meeting-actions.d.ts +4 -0
  110. package/dist/types/meeting/index.d.ts +94 -7
  111. package/dist/types/meeting/locusMediaRequest.d.ts +12 -0
  112. package/dist/types/meeting/request.d.ts +1 -0
  113. package/dist/types/meeting/util.d.ts +9 -0
  114. package/dist/types/meetings/index.d.ts +30 -18
  115. package/dist/types/meetings/meetings.types.d.ts +15 -0
  116. package/dist/types/meetings/request.d.ts +14 -0
  117. package/dist/types/member/index.d.ts +1 -0
  118. package/dist/types/member/types.d.ts +1 -0
  119. package/dist/types/member/util.d.ts +9 -0
  120. package/dist/types/members/index.d.ts +15 -2
  121. package/dist/types/members/util.d.ts +1 -5
  122. package/dist/types/metrics/constants.d.ts +4 -0
  123. package/dist/types/multistream/codec/constants.d.ts +7 -0
  124. package/dist/types/multistream/mediaRequestManager.d.ts +22 -5
  125. package/dist/types/reachability/index.d.ts +1 -1
  126. package/dist/types/reachability/reachability.types.d.ts +7 -0
  127. package/dist/types/reachability/util.d.ts +17 -0
  128. package/dist/types/reactions/reactions.type.d.ts +3 -0
  129. package/dist/webinar/index.js +305 -159
  130. package/dist/webinar/index.js.map +1 -1
  131. package/package.json +22 -22
  132. package/src/aiEnableRequest/index.ts +16 -0
  133. package/src/breakouts/breakout.ts +3 -1
  134. package/src/breakouts/index.ts +31 -0
  135. package/src/config.ts +2 -2
  136. package/src/constants.ts +20 -3
  137. package/src/controls-options-manager/constants.ts +14 -1
  138. package/src/controls-options-manager/index.ts +87 -28
  139. package/src/controls-options-manager/util.ts +81 -1
  140. package/src/hashTree/constants.ts +16 -0
  141. package/src/hashTree/hashTreeParser.ts +580 -196
  142. package/src/hashTree/utils.ts +36 -0
  143. package/src/index.ts +6 -0
  144. package/src/interceptors/dataChannelAuthToken.ts +88 -12
  145. package/src/interceptors/locusRetry.ts +25 -4
  146. package/src/interpretation/index.ts +27 -9
  147. package/src/interpretation/interpretation.types.ts +11 -0
  148. package/src/locus-info/controlsUtils.ts +3 -1
  149. package/src/locus-info/index.ts +304 -100
  150. package/src/locus-info/infoUtils.ts +41 -6
  151. package/src/locus-info/types.ts +25 -1
  152. package/src/media/index.ts +3 -0
  153. package/src/media/properties.ts +1 -0
  154. package/src/meeting/in-meeting-actions.ts +8 -0
  155. package/src/meeting/index.ts +494 -67
  156. package/src/meeting/locusMediaRequest.ts +106 -6
  157. package/src/meeting/muteState.ts +10 -1
  158. package/src/meeting/request.ts +11 -0
  159. package/src/meeting/util.ts +47 -5
  160. package/src/meeting-info/meeting-info-v2.ts +4 -2
  161. package/src/meetings/index.ts +133 -78
  162. package/src/meetings/meetings.types.ts +19 -0
  163. package/src/meetings/request.ts +43 -0
  164. package/src/meetings/util.ts +97 -1
  165. package/src/member/index.ts +10 -0
  166. package/src/member/types.ts +1 -0
  167. package/src/member/util.ts +29 -0
  168. package/src/members/index.ts +70 -7
  169. package/src/members/util.ts +12 -4
  170. package/src/metrics/constants.ts +4 -0
  171. package/src/multistream/codec/constants.ts +58 -0
  172. package/src/multistream/mediaRequestManager.ts +119 -28
  173. package/src/multistream/receiveSlot.ts +18 -0
  174. package/src/reachability/index.ts +19 -15
  175. package/src/reachability/reachability.types.ts +11 -0
  176. package/src/reachability/util.ts +36 -0
  177. package/src/reactions/reactions.type.ts +3 -0
  178. package/src/recording-controller/index.ts +1 -2
  179. package/src/webinar/index.ts +214 -36
  180. package/test/unit/spec/aiEnableRequest/index.ts +86 -0
  181. package/test/unit/spec/breakouts/breakout.ts +9 -3
  182. package/test/unit/spec/breakouts/index.ts +49 -0
  183. package/test/unit/spec/controls-options-manager/index.js +244 -29
  184. package/test/unit/spec/controls-options-manager/util.js +165 -0
  185. package/test/unit/spec/hashTree/hashTreeParser.ts +1838 -180
  186. package/test/unit/spec/hashTree/utils.ts +125 -1
  187. package/test/unit/spec/interceptors/dataChannelAuthToken.ts +196 -0
  188. package/test/unit/spec/interceptors/locusRetry.ts +205 -4
  189. package/test/unit/spec/interpretation/index.ts +26 -4
  190. package/test/unit/spec/locus-info/controlsUtils.js +172 -57
  191. package/test/unit/spec/locus-info/index.js +499 -81
  192. package/test/unit/spec/locus-info/infoUtils.js +184 -1
  193. package/test/unit/spec/media/index.ts +31 -0
  194. package/test/unit/spec/meeting/in-meeting-actions.ts +4 -0
  195. package/test/unit/spec/meeting/index.js +1615 -42
  196. package/test/unit/spec/meeting/locusMediaRequest.ts +302 -4
  197. package/test/unit/spec/meeting/muteState.js +81 -0
  198. package/test/unit/spec/meeting/request.js +12 -0
  199. package/test/unit/spec/meeting/utils.js +157 -1
  200. package/test/unit/spec/meeting-info/meetinginfov2.js +19 -10
  201. package/test/unit/spec/meetings/index.js +363 -36
  202. package/test/unit/spec/meetings/request.js +141 -0
  203. package/test/unit/spec/meetings/utils.js +189 -0
  204. package/test/unit/spec/member/index.js +7 -0
  205. package/test/unit/spec/member/util.js +89 -0
  206. package/test/unit/spec/members/index.js +216 -0
  207. package/test/unit/spec/members/request.js +37 -1
  208. package/test/unit/spec/members/utils.js +63 -0
  209. package/test/unit/spec/multistream/mediaRequestManager.ts +501 -37
  210. package/test/unit/spec/reachability/index.ts +59 -46
  211. package/test/unit/spec/reachability/util.ts +31 -0
  212. package/test/unit/spec/recording-controller/index.js +9 -8
  213. package/test/unit/spec/webinar/index.ts +329 -28
@@ -111,6 +111,7 @@ var DEFAULT_ICE_PHASE_CALLBACK = function DEFAULT_ICE_PHASE_CALLBACK() {
111
111
  return 'JOIN_MEETING_FINAL';
112
112
  };
113
113
  var LLM_HEALTHCHECK_TIMER_MS = 3 * 60 * 1000;
114
+ var JOIN_WITH_MEDIA_RETRY_MAX_COUNT = 2;
114
115
  var logRequest = function logRequest(request, _ref) {
115
116
  var _ref$logText = _ref.logText,
116
117
  logText = _ref$logText === void 0 ? '' : _ref$logText;
@@ -496,6 +497,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
496
497
  (0, _defineProperty3.default)(_this, "floorGrantPending", void 0);
497
498
  (0, _defineProperty3.default)(_this, "hasJoinedOnce", void 0);
498
499
  (0, _defineProperty3.default)(_this, "hasWebsocketConnected", void 0);
500
+ (0, _defineProperty3.default)(_this, "mercuryOnlineHandler", void 0);
501
+ (0, _defineProperty3.default)(_this, "mercuryOfflineHandler", void 0);
499
502
  (0, _defineProperty3.default)(_this, "inMeetingActions", void 0);
500
503
  (0, _defineProperty3.default)(_this, "isLocalShareLive", void 0);
501
504
  (0, _defineProperty3.default)(_this, "isRoapInProgress", void 0);
@@ -507,6 +510,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
507
510
  (0, _defineProperty3.default)(_this, "joinedWith", void 0);
508
511
  (0, _defineProperty3.default)(_this, "selfId", void 0);
509
512
  (0, _defineProperty3.default)(_this, "roles", void 0);
513
+ (0, _defineProperty3.default)(_this, "canNotViewTheParticipantList", void 0);
510
514
  // ... there is more ... see SelfUtils.parse()
511
515
  // end of the group
512
516
  (0, _defineProperty3.default)(_this, "locusMediaRequest", void 0);
@@ -568,6 +572,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
568
572
  (0, _defineProperty3.default)(_this, "isMoveToInProgress", false);
569
573
  (0, _defineProperty3.default)(_this, "registrationIdStatus", void 0);
570
574
  (0, _defineProperty3.default)(_this, "brbState", void 0);
575
+ (0, _defineProperty3.default)(_this, "promisesWaitingForPropUpdate", {});
571
576
  (0, _defineProperty3.default)(_this, "voiceaListenerCallbacks", (0, _defineProperty3.default)((0, _defineProperty3.default)((0, _defineProperty3.default)((0, _defineProperty3.default)({}, _internalPluginVoicea.EVENT_TRIGGERS.VOICEA_ANNOUNCEMENT, function (payload) {
572
577
  _this.transcription.languageOptions = payload;
573
578
  _loggerProxy.default.logger.debug("".concat(_util.default.getScopeLog({
@@ -641,6 +646,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
641
646
  * @returns {void}
642
647
  */
643
648
  (0, _defineProperty3.default)(_this, "processRelayEvent", function (e) {
649
+ if (!_this.isRelayEventRouteValid(e)) {
650
+ return;
651
+ }
644
652
  switch (e.data.relayType) {
645
653
  case _constants3.REACTION_RELAY_TYPES.REACTION:
646
654
  if (
@@ -680,6 +688,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
680
688
  */
681
689
  (0, _defineProperty3.default)(_this, "handleLLMOnline", function () {
682
690
  _this.restoreLLMSubscriptionsIfNeeded();
691
+ _this.locusInfo.syncAllHashTreeDatasets({
692
+ onlyLLM: true
693
+ });
683
694
  _triggerProxy.default.trigger(_this, {
684
695
  file: 'meeting/index',
685
696
  function: 'handleLLMOnline'
@@ -687,6 +698,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
687
698
  });
688
699
  /**
689
700
  * Disconnects and cleans up the default LLM session listeners/timers.
701
+ *
702
+ * Ownership-aware: only calls `disconnectLLM` when this meeting is the
703
+ * current owner of the default LLM session (or when no owner is recorded).
704
+ * Event listeners belonging to this meeting instance are always detached
705
+ * so they do not receive another meeting's relay events.
706
+ *
690
707
  * @param {Object} options
691
708
  * @param {boolean} [options.removeOnlineListener=true] removes the one-time online listener
692
709
  * @param {boolean} [options.throwOnError=true] rethrows disconnect errors when true
@@ -698,47 +715,74 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
698
715
  removeOnlineListener,
699
716
  _ref3$throwOnError,
700
717
  throwOnError,
718
+ _this$webex$internal$,
719
+ currentOwner,
720
+ isOwner,
721
+ _this$webex$internal$2,
722
+ currentOwnerAfterCleanup,
723
+ _this$webex$internal$3,
724
+ _this$webex$internal$4,
701
725
  _args = arguments,
702
726
  _t;
703
727
  return _regenerator.default.wrap(function (_context) {
704
728
  while (1) switch (_context.prev = _context.next) {
705
729
  case 0:
706
730
  _ref3 = _args.length > 0 && _args[0] !== undefined ? _args[0] : {}, _ref3$removeOnlineLis = _ref3.removeOnlineListener, removeOnlineListener = _ref3$removeOnlineLis === void 0 ? true : _ref3$removeOnlineLis, _ref3$throwOnError = _ref3.throwOnError, throwOnError = _ref3$throwOnError === void 0 ? true : _ref3$throwOnError;
731
+ // @ts-ignore - Fix type
732
+ // @ts-ignore - Fix type
733
+ _this$webex$internal$ = _this.webex.internal.llm.resolveSessionOwnership(_this.id, _constants.LLM_DEFAULT_SESSION), currentOwner = _this$webex$internal$.currentOwner, isOwner = _this$webex$internal$.isOwner;
707
734
  _context.prev = 1;
735
+ if (!isOwner) {
736
+ _context.next = 3;
737
+ break;
738
+ }
708
739
  _context.next = 2;
709
740
  return _this.webex.internal.llm.disconnectLLM({
710
741
  code: 3050,
711
742
  reason: 'done (permanent)'
712
- });
743
+ }, _constants.LLM_DEFAULT_SESSION, _this.id);
713
744
  case 2:
714
745
  _context.next = 4;
715
746
  break;
716
747
  case 3:
717
- _context.prev = 3;
748
+ _loggerProxy.default.logger.info("Meeting:index#cleanupLLMConneciton --> skipping disconnect; LLM owned by meeting ".concat(currentOwner, ", not ").concat(_this.id));
749
+ case 4:
750
+ _context.next = 6;
751
+ break;
752
+ case 5:
753
+ _context.prev = 5;
718
754
  _t = _context["catch"](1);
719
755
  _loggerProxy.default.logger.error('Meeting:index#cleanupLLMConneciton --> Failed to disconnect default LLM session', _t);
720
756
  if (!throwOnError) {
721
- _context.next = 4;
757
+ _context.next = 6;
722
758
  break;
723
759
  }
724
760
  throw _t;
725
- case 4:
726
- _context.prev = 4;
761
+ case 6:
762
+ _context.prev = 6;
727
763
  if (removeOnlineListener) {
728
764
  // @ts-ignore - Fix type
729
765
  _this.webex.internal.llm.off('online', _this.handleLLMOnline);
730
766
  }
731
- // @ts-ignore - fix types
732
- _this.webex.internal.llm.off('event:relay.event', _this.processRelayEvent);
733
- // @ts-ignore - Fix type
734
- _this.webex.internal.llm.off(_constants.LOCUS_LLM_EVENT, _this.processLocusLLMEvent);
735
- _this.clearLLMHealthCheckTimer();
736
- return _context.finish(4);
737
- case 5:
767
+ _this.stopListeningForLLMEvents();
768
+
769
+ // Re-check ownership after awaiting disconnectLLM. If ownership changed
770
+ // while cleanup was in flight, do not clear another meeting's owner tag.
771
+ if (isOwner) {
772
+ _this$webex$internal$2 =
773
+ // @ts-ignore - Fix type
774
+ _this.webex.internal.llm.resolveSessionOwnership(_this.id, _constants.LLM_DEFAULT_SESSION), currentOwnerAfterCleanup = _this$webex$internal$2.currentOwner;
775
+ if (currentOwnerAfterCleanup === _this.id) {
776
+ // @ts-ignore - Fix type
777
+ (_this$webex$internal$3 = (_this$webex$internal$4 = _this.webex.internal.llm).setOwnerMeetingId) === null || _this$webex$internal$3 === void 0 ? void 0 : _this$webex$internal$3.call(_this$webex$internal$4, undefined);
778
+ }
779
+ }
780
+ return _context.finish(6);
781
+ case 7:
738
782
  case "end":
739
783
  return _context.stop();
740
784
  }
741
- }, _callee, null, [[1, 3, 4, 5]]);
785
+ }, _callee, null, [[1, 5, 6, 7]]);
742
786
  })));
743
787
  /**
744
788
  * Handles ROAP_FAILURE event from the webrtc media connection
@@ -1321,6 +1365,37 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1321
1365
  }
1322
1366
  }
1323
1367
  });
1368
+ _this.statsAnalyzer.on(_internalMediaCore.StatsAnalyzerEventNames.STATS_UPDATE, function (data) {
1369
+ // Extract srtpCipher from transport stats
1370
+ var srtpCipher;
1371
+ var _iterator = _createForOfIteratorHelper(data.stats.values()),
1372
+ _step;
1373
+ try {
1374
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
1375
+ var stats = _step.value;
1376
+ if (stats.type === 'transport' && stats.srtpCipher) {
1377
+ srtpCipher = stats.srtpCipher;
1378
+ break;
1379
+ }
1380
+ }
1381
+
1382
+ // Only emit event if srtpCipher has changed
1383
+ } catch (err) {
1384
+ _iterator.e(err);
1385
+ } finally {
1386
+ _iterator.f();
1387
+ }
1388
+ if (srtpCipher && srtpCipher !== _this.mediaProperties.srtpCipher) {
1389
+ _loggerProxy.default.logger.info("Meeting:index#setupStatsAnalyzerEventHandlers --> SRTP cipher changed from ".concat(_this.mediaProperties.srtpCipher, " to ").concat(srtpCipher));
1390
+ _this.mediaProperties.srtpCipher = srtpCipher;
1391
+ _triggerProxy.default.trigger(_this, {
1392
+ file: 'meeting/index',
1393
+ function: 'setupStatsAnalyzerEventHandlers'
1394
+ }, _constants.EVENT_TRIGGERS.MEETING_SRTP_CIPHER_UPDATED, {
1395
+ srtpCipher: srtpCipher
1396
+ });
1397
+ }
1398
+ });
1324
1399
  });
1325
1400
  /**
1326
1401
  * media failed, so collect a stats report from webrtc using the wcme connection to grab the rtc stats report
@@ -1549,9 +1624,14 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1549
1624
  _this.shareStatus = _constants.SHARE_STATUS.NO_SHARE;
1550
1625
  }
1551
1626
  _this.queuedMediaUpdates = [];
1552
- _this.stopTranscription();
1553
- _this.transcription = undefined;
1554
- _this.annotation.deregisterEvents();
1627
+
1628
+ // Listener teardown (transcription, annotation, llm/mercury) runs in
1629
+ // stopListeningForMeetingEvents() before /leave and /end so events
1630
+ // received mid-teardown do not trigger Locus syncs. Calling it here
1631
+ // again would double-emit MEETING_STOPPED_RECEIVING_TRANSCRIPTION
1632
+ // because stopTranscription() always fires its trigger.
1633
+ //
1634
+ // Ownership-aware token clear is encapsulated inside clearDataChannelToken().
1555
1635
  _this.clearDataChannelToken();
1556
1636
  _context5.next = 1;
1557
1637
  return _this.cleanupLLMConneciton({
@@ -1727,7 +1807,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1727
1807
  });
1728
1808
 
1729
1809
  // @ts-ignore
1730
- _this.aiEnableRequest = new _aiEnableRequest.default({}, {
1810
+ _this.aiEnableRequest = new _aiEnableRequest.default({
1811
+ locusUrl: _this.locusUrl
1812
+ }, {
1731
1813
  parent: _this.webex
1732
1814
  });
1733
1815
 
@@ -1766,6 +1848,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1766
1848
  var _this$members$findMem2;
1767
1849
  return (_this$members$findMem2 = _this.members.findMemberByCsi(csi)) === null || _this$members$findMem2 === void 0 ? void 0 : _this$members$findMem2.id;
1768
1850
  });
1851
+
1769
1852
  /**
1770
1853
  * Object containing helper classes for managing media requests for audio/video/screenshare (for multistream media connections)
1771
1854
  * All multistream media requests sent out for this meeting have to go through them.
@@ -1777,7 +1860,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1777
1860
  return;
1778
1861
  }
1779
1862
  _this.mediaProperties.webrtcMediaConnection.requestMedia(_internalMediaCore.MediaType.AudioMain, mediaRequests);
1780
- }, {
1863
+ }, _this.getIngressPayloadTypeCallback.bind(_this), {
1781
1864
  // @ts-ignore - config coming from registerPlugin
1782
1865
  degradationPreferences: _this.config.degradationPreferences,
1783
1866
  kind: 'audio',
@@ -1789,7 +1872,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1789
1872
  return;
1790
1873
  }
1791
1874
  _this.mediaProperties.webrtcMediaConnection.requestMedia(_internalMediaCore.MediaType.VideoMain, mediaRequests);
1792
- }, {
1875
+ }, _this.getIngressPayloadTypeCallback.bind(_this), {
1793
1876
  // @ts-ignore - config coming from registerPlugin
1794
1877
  degradationPreferences: _this.config.degradationPreferences,
1795
1878
  kind: 'video',
@@ -1801,7 +1884,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1801
1884
  return;
1802
1885
  }
1803
1886
  _this.mediaProperties.webrtcMediaConnection.requestMedia(_internalMediaCore.MediaType.AudioSlides, mediaRequests);
1804
- }, {
1887
+ }, _this.getIngressPayloadTypeCallback.bind(_this), {
1805
1888
  // @ts-ignore - config coming from registerPlugin
1806
1889
  degradationPreferences: _this.config.degradationPreferences,
1807
1890
  kind: 'audio',
@@ -1813,11 +1896,13 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1813
1896
  return;
1814
1897
  }
1815
1898
  _this.mediaProperties.webrtcMediaConnection.requestMedia(_internalMediaCore.MediaType.VideoSlides, mediaRequests);
1816
- }, {
1899
+ }, _this.getIngressPayloadTypeCallback.bind(_this), {
1817
1900
  // @ts-ignore - config coming from registerPlugin
1818
1901
  degradationPreferences: _this.config.degradationPreferences,
1819
1902
  kind: 'video',
1820
- trimRequestsToNumOfSources: false
1903
+ trimRequestsToNumOfSources: false,
1904
+ // @ts-ignore - config coming from registerPlugin
1905
+ enableAv1: _this.config.enableAv1SlidesSupport
1821
1906
  })
1822
1907
  };
1823
1908
  /**
@@ -2325,7 +2410,15 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
2325
2410
  */
2326
2411
  _this.controlsOptionsManager = new _controlsOptionsManager.default(_this.meetingRequest, {
2327
2412
  locusUrl: (_this$locusInfo5 = _this.locusInfo) === null || _this$locusInfo5 === void 0 ? void 0 : _this$locusInfo5.url,
2328
- displayHints: []
2413
+ displayHints: [],
2414
+ getControls: function getControls() {
2415
+ var _this$locusInfo6;
2416
+ return (_this$locusInfo6 = _this.locusInfo) === null || _this$locusInfo6 === void 0 ? void 0 : _this$locusInfo6.controls;
2417
+ },
2418
+ isWebinar: function isWebinar() {
2419
+ var _this$locusInfo7, _this$locusInfo7$info;
2420
+ return (_this$locusInfo7 = _this.locusInfo) === null || _this$locusInfo7 === void 0 ? void 0 : (_this$locusInfo7$info = _this$locusInfo7.info) === null || _this$locusInfo7$info === void 0 ? void 0 : _this$locusInfo7$info.isWebinar;
2421
+ }
2329
2422
  });
2330
2423
  _this.setUpLocusInfoListeners();
2331
2424
  _this.locusInfo.init(attrs.locus ? attrs.locus : {});
@@ -2423,12 +2516,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
2423
2516
  /**
2424
2517
  * Information needed for a retry of a call to joinWithMedia
2425
2518
  * @instance
2426
- * @type {{isRetry: boolean; prevJoinResponse?: any}}
2519
+ * @type {{retryCount: number; prevJoinResponse?: any}}
2427
2520
  * @private
2428
2521
  * @memberof Meeting
2429
2522
  */
2430
2523
  _this.joinWithMediaRetryInfo = {
2431
- isRetry: false,
2524
+ retryCount: 0,
2432
2525
  prevJoinResponse: undefined
2433
2526
  };
2434
2527
 
@@ -2486,14 +2579,36 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
2486
2579
  }
2487
2580
 
2488
2581
  /**
2489
- * Temporary func to return webex object,
2490
- * in order to access internal plugin metrics
2491
- * in the utils file.
2492
- * @internal
2493
- * @returns {object} webex object
2582
+ * Get the ingress payload type for a given media type and codec mime type
2583
+ * @param {MediaType} mediaType - The media type
2584
+ * @param {MediaCodecMimeType} codecMimeType - The codec mime type
2585
+ * @returns {number | undefined} - The ingress payload type
2586
+ * @private
2587
+ * @memberof Meeting
2494
2588
  */
2495
2589
  (0, _inherits2.default)(Meeting, _StatelessWebexPlugin);
2496
2590
  return (0, _createClass2.default)(Meeting, [{
2591
+ key: "getIngressPayloadTypeCallback",
2592
+ value: function getIngressPayloadTypeCallback(mediaType, codecMimeType) {
2593
+ if (this.isMultistream) {
2594
+ try {
2595
+ return this.mediaProperties.webrtcMediaConnection.getIngressPayloadType(mediaType, codecMimeType);
2596
+ } catch (error) {
2597
+ _loggerProxy.default.logger.info("Meeting:index#mediaRequestManager --> failed to get ingress payload type for mediaType=".concat(mediaType, ", codecMimeType=").concat(codecMimeType), error);
2598
+ return undefined;
2599
+ }
2600
+ }
2601
+ return undefined;
2602
+ }
2603
+
2604
+ /**
2605
+ * Temporary func to return webex object,
2606
+ * in order to access internal plugin metrics
2607
+ * in the utils file.
2608
+ * @internal
2609
+ * @returns {object} webex object
2610
+ */
2611
+ }, {
2497
2612
  key: "getWebexObject",
2498
2613
  value: function getWebexObject() {
2499
2614
  // @ts-ignore
@@ -3525,7 +3640,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
3525
3640
  this.locusInfo.on(_constants.LOCUSINFO.EVENTS.CONTROLS_RECORDING_UPDATED, function (_ref10) {
3526
3641
  var state = _ref10.state,
3527
3642
  modifiedBy = _ref10.modifiedBy,
3528
- lastModified = _ref10.lastModified;
3643
+ lastModified = _ref10.lastModified,
3644
+ modifiedByServiceAppName = _ref10.modifiedByServiceAppName,
3645
+ modifiedByServiceAppId = _ref10.modifiedByServiceAppId;
3529
3646
  var event;
3530
3647
  switch (state) {
3531
3648
  case _constants.RECORDING_STATE.RECORDING:
@@ -3549,7 +3666,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
3549
3666
  _this12.recording = {
3550
3667
  state: state === _constants.RECORDING_STATE.RESUMED ? _constants.RECORDING_STATE.RECORDING : state,
3551
3668
  modifiedBy: modifiedBy,
3552
- lastModified: lastModified
3669
+ lastModified: lastModified,
3670
+ modifiedByServiceAppName: modifiedByServiceAppName,
3671
+ modifiedByServiceAppId: modifiedByServiceAppId
3553
3672
  };
3554
3673
  _triggerProxy.default.trigger(_this12, {
3555
3674
  file: 'meeting/index',
@@ -4086,15 +4205,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4086
4205
  _this14.breakouts.locusUrlUpdate(url);
4087
4206
  _this14.simultaneousInterpretation.locusUrlUpdate(url);
4088
4207
  _this14.annotation.locusUrlUpdate(url);
4208
+ _this14.aiEnableRequest.locusUrlUpdate(url);
4089
4209
  _this14.locusUrl = url;
4090
4210
  _this14.locusId = (_this14$locusUrl = _this14.locusUrl) === null || _this14$locusUrl === void 0 ? void 0 : _this14$locusUrl.split('/').pop();
4091
4211
  _this14.recordingController.setLocusUrl(_this14.locusUrl);
4092
4212
  _this14.controlsOptionsManager.setLocusUrl(_this14.locusUrl, !!isMainLocus);
4093
4213
  _this14.webinar.locusUrlUpdate(url);
4094
- // @ts-ignore
4095
- _this14.webex.internal.llm.setRefreshHandler(function () {
4096
- return _this14.refreshDataChannelToken();
4097
- });
4098
4214
  _triggerProxy.default.trigger(_this14, {
4099
4215
  file: 'meeting/index',
4100
4216
  function: 'setUpLocusSelfListener'
@@ -4324,34 +4440,56 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4324
4440
  });
4325
4441
  _this19.updateLLMConnection();
4326
4442
  });
4327
- this.locusInfo.on(_constants.LOCUSINFO.EVENTS.SELF_ADMITTED_GUEST, function (payload) {
4328
- var _this19$rtcMetrics;
4329
- _this19.stopKeepAlive();
4330
- if (payload) {
4331
- _triggerProxy.default.trigger(_this19, {
4332
- file: 'meeting/index',
4333
- function: 'setUpLocusInfoSelfListener'
4334
- }, _constants.EVENT_TRIGGERS.MEETING_SELF_GUEST_ADMITTED, {
4335
- payload: payload
4336
- });
4443
+ this.locusInfo.on(_constants.LOCUSINFO.EVENTS.SELF_ADMITTED_GUEST, /*#__PURE__*/function () {
4444
+ var _ref37 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee1(payload) {
4445
+ var _this19$rtcMetrics;
4446
+ var _t9;
4447
+ return _regenerator.default.wrap(function (_context1) {
4448
+ while (1) switch (_context1.prev = _context1.next) {
4449
+ case 0:
4450
+ _this19.stopKeepAlive();
4451
+ if (payload) {
4452
+ _triggerProxy.default.trigger(_this19, {
4453
+ file: 'meeting/index',
4454
+ function: 'setUpLocusInfoSelfListener'
4455
+ }, _constants.EVENT_TRIGGERS.MEETING_SELF_GUEST_ADMITTED, {
4456
+ payload: payload
4457
+ });
4337
4458
 
4338
- // @ts-ignore
4339
- _this19.webex.internal.newMetrics.submitClientEvent({
4340
- name: 'client.lobby.exited',
4341
- options: {
4342
- meetingId: _this19.id
4459
+ // @ts-ignore
4460
+ _this19.webex.internal.newMetrics.submitClientEvent({
4461
+ name: 'client.lobby.exited',
4462
+ options: {
4463
+ meetingId: _this19.id
4464
+ }
4465
+ });
4466
+ _metrics.default.sendBehavioralMetric(_constants2.default.GUEST_EXITED_LOBBY, {
4467
+ correlation_id: _this19.correlationId
4468
+ });
4469
+ }
4470
+ (_this19$rtcMetrics = _this19.rtcMetrics) === null || _this19$rtcMetrics === void 0 ? void 0 : _this19$rtcMetrics.sendNextMetrics();
4471
+ _context1.prev = 1;
4472
+ _context1.next = 2;
4473
+ return _this19.ensureDefaultDatachannelTokenAfterAdmit();
4474
+ case 2:
4475
+ _context1.next = 4;
4476
+ break;
4477
+ case 3:
4478
+ _context1.prev = 3;
4479
+ _t9 = _context1["catch"](1);
4480
+ _loggerProxy.default.logger.warn("Meeting:index#setUpLocusInfoSelfListener --> failed post-admit token prefetch flow: ".concat((_t9 === null || _t9 === void 0 ? void 0 : _t9.message) || String(_t9)));
4481
+ case 4:
4482
+ _this19.updateLLMConnection();
4483
+ case 5:
4484
+ case "end":
4485
+ return _context1.stop();
4343
4486
  }
4344
- });
4345
- _metrics.default.sendBehavioralMetric(_constants2.default.GUEST_EXITED_LOBBY, {
4346
- correlation_id: _this19.correlationId
4347
- });
4348
- }
4349
- (_this19$rtcMetrics = _this19.rtcMetrics) === null || _this19$rtcMetrics === void 0 ? void 0 : _this19$rtcMetrics.sendNextMetrics();
4350
- _this19.ensureDefaultDatachannelTokenAfterAdmit().catch(function (error) {
4351
- _loggerProxy.default.logger.warn("Meeting:index#setUpLocusInfoSelfListener --> failed post-admit token prefetch flow: ".concat((error === null || error === void 0 ? void 0 : error.message) || String(error)));
4352
- });
4353
- _this19.updateLLMConnection();
4354
- });
4487
+ }, _callee1, null, [[1, 3]]);
4488
+ }));
4489
+ return function (_x9) {
4490
+ return _ref37.apply(this, arguments);
4491
+ };
4492
+ }());
4355
4493
 
4356
4494
  // @ts-ignore - check if MEDIA_INACTIVITY exists
4357
4495
  this.locusInfo.on(_constants.LOCUSINFO.EVENTS.MEDIA_INACTIVITY, function () {
@@ -4387,6 +4525,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4387
4525
  }
4388
4526
  });
4389
4527
  this.locusInfo.on(_constants.LOCUSINFO.EVENTS.SELF_CANNOT_VIEW_PARTICIPANT_LIST_CHANGE, function (payload) {
4528
+ // canViewTheParticipantList meeting action depends on this value, so we need to update meeting actions
4529
+ _this19.updateMeetingActions();
4390
4530
  _triggerProxy.default.trigger(_this19, {
4391
4531
  file: 'meeting/index',
4392
4532
  function: 'setUpLocusInfoSelfListener'
@@ -4471,49 +4611,49 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4471
4611
  }
4472
4612
  });
4473
4613
  this.locusInfo.on(_constants.EVENTS.DESTROY_MEETING, /*#__PURE__*/function () {
4474
- var _ref37 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee1(payload) {
4475
- var _t9;
4476
- return _regenerator.default.wrap(function (_context1) {
4477
- while (1) switch (_context1.prev = _context1.next) {
4614
+ var _ref38 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee10(payload) {
4615
+ var _t0;
4616
+ return _regenerator.default.wrap(function (_context10) {
4617
+ while (1) switch (_context10.prev = _context10.next) {
4478
4618
  case 0:
4479
4619
  if (!_this20.wirelessShare) {
4480
- _context1.next = 2;
4620
+ _context10.next = 2;
4481
4621
  break;
4482
4622
  }
4483
4623
  if (!_this20.mediaProperties.shareVideoStream) {
4484
- _context1.next = 1;
4624
+ _context10.next = 1;
4485
4625
  break;
4486
4626
  }
4487
- _context1.next = 1;
4627
+ _context10.next = 1;
4488
4628
  return _this20.setLocalShareVideoStream(undefined);
4489
4629
  case 1:
4490
4630
  if (!_this20.mediaProperties.shareAudioStream) {
4491
- _context1.next = 2;
4631
+ _context10.next = 2;
4492
4632
  break;
4493
4633
  }
4494
- _context1.next = 2;
4634
+ _context10.next = 2;
4495
4635
  return _this20.setLocalShareAudioStream(undefined);
4496
4636
  case 2:
4497
4637
  if (!payload.shouldLeave) {
4498
- _context1.next = 7;
4638
+ _context10.next = 7;
4499
4639
  break;
4500
4640
  }
4501
- _context1.prev = 3;
4502
- _context1.next = 4;
4641
+ _context10.prev = 3;
4642
+ _context10.next = 4;
4503
4643
  return _this20.leave({
4504
4644
  reason: payload.reason
4505
4645
  });
4506
4646
  case 4:
4507
4647
  _loggerProxy.default.logger.warn('Meeting:index#setUpLocusInfoMeetingListener --> DESTROY_MEETING. The meeting has been left, but has not been destroyed, you should see a later event for leave.');
4508
- _context1.next = 6;
4648
+ _context10.next = 6;
4509
4649
  break;
4510
4650
  case 5:
4511
- _context1.prev = 5;
4512
- _t9 = _context1["catch"](3);
4651
+ _context10.prev = 5;
4652
+ _t0 = _context10["catch"](3);
4513
4653
  // @ts-ignore
4514
- _loggerProxy.default.logger.error("Meeting:index#setUpLocusInfoMeetingListener --> DESTROY_MEETING. Issue with leave for meeting, meeting still in collection: ".concat(_this20, ", error: ").concat(_t9));
4654
+ _loggerProxy.default.logger.error("Meeting:index#setUpLocusInfoMeetingListener --> DESTROY_MEETING. Issue with leave for meeting, meeting still in collection: ".concat(_this20, ", error: ").concat(_t0));
4515
4655
  case 6:
4516
- _context1.next = 8;
4656
+ _context10.next = 8;
4517
4657
  break;
4518
4658
  case 7:
4519
4659
  _loggerProxy.default.logger.info('Meeting:index#setUpLocusInfoMeetingListener --> MEETING_REMOVED_REASON', payload.reason);
@@ -4527,12 +4667,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4527
4667
  });
4528
4668
  case 8:
4529
4669
  case "end":
4530
- return _context1.stop();
4670
+ return _context10.stop();
4531
4671
  }
4532
- }, _callee1, null, [[3, 5]]);
4672
+ }, _callee10, null, [[3, 5]]);
4533
4673
  }));
4534
- return function (_x9) {
4535
- return _ref37.apply(this, arguments);
4674
+ return function (_x0) {
4675
+ return _ref38.apply(this, arguments);
4536
4676
  };
4537
4677
  }());
4538
4678
  }
@@ -4554,7 +4694,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4554
4694
  // is not changed by any delta event
4555
4695
  if (object && (0, _keys.default)(object).length) {
4556
4696
  (0, _keys.default)(object).forEach(function (key) {
4697
+ var previousValue = _this21[key];
4557
4698
  _this21[key] = object[key];
4699
+ if (_this21.promisesWaitingForPropUpdate[key] && previousValue !== object[key]) {
4700
+ _this21.promisesWaitingForPropUpdate[key].resolve();
4701
+ delete _this21.promisesWaitingForPropUpdate[key];
4702
+ }
4558
4703
  });
4559
4704
  }
4560
4705
  }
@@ -4650,31 +4795,31 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4650
4795
  }, {
4651
4796
  key: "beRightBack",
4652
4797
  value: (function () {
4653
- var _beRightBack = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee10(enabled) {
4798
+ var _beRightBack = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee11(enabled) {
4654
4799
  var _this22 = this;
4655
4800
  var errorMessage, error, _errorMessage, _error;
4656
- return _regenerator.default.wrap(function (_context10) {
4657
- while (1) switch (_context10.prev = _context10.next) {
4801
+ return _regenerator.default.wrap(function (_context11) {
4802
+ while (1) switch (_context11.prev = _context11.next) {
4658
4803
  case 0:
4659
4804
  if (this.isMultistream) {
4660
- _context10.next = 1;
4805
+ _context11.next = 1;
4661
4806
  break;
4662
4807
  }
4663
4808
  errorMessage = 'Meeting:index#beRightBack --> Not a multistream meeting';
4664
4809
  error = new Error(errorMessage);
4665
4810
  _loggerProxy.default.logger.error(error);
4666
- return _context10.abrupt("return", _promise.default.reject(error));
4811
+ return _context11.abrupt("return", _promise.default.reject(error));
4667
4812
  case 1:
4668
4813
  if (this.mediaProperties.webrtcMediaConnection) {
4669
- _context10.next = 2;
4814
+ _context11.next = 2;
4670
4815
  break;
4671
4816
  }
4672
4817
  _errorMessage = 'Meeting:index#beRightBack --> WebRTC media connection is not defined';
4673
4818
  _error = new Error(_errorMessage);
4674
4819
  _loggerProxy.default.logger.error(_error);
4675
- return _context10.abrupt("return", _promise.default.reject(_error));
4820
+ return _context11.abrupt("return", _promise.default.reject(_error));
4676
4821
  case 2:
4677
- return _context10.abrupt("return", this.brbState.enable(enabled, this.sendSlotManager).then(function () {
4822
+ return _context11.abrupt("return", this.brbState.enable(enabled, this.sendSlotManager).then(function () {
4678
4823
  if (_this22.audio && enabled) {
4679
4824
  // locus mutes the participant with brb enabled request,
4680
4825
  // so we need to explicitly update remote mute for correct logic flow
@@ -4685,11 +4830,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4685
4830
  }));
4686
4831
  case 3:
4687
4832
  case "end":
4688
- return _context10.stop();
4833
+ return _context11.stop();
4689
4834
  }
4690
- }, _callee10, this);
4835
+ }, _callee11, this);
4691
4836
  }));
4692
- function beRightBack(_x0) {
4837
+ function beRightBack(_x1) {
4693
4838
  return _beRightBack.apply(this, arguments);
4694
4839
  }
4695
4840
  return beRightBack;
@@ -4724,7 +4869,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4724
4869
  }
4725
4870
 
4726
4871
  /**
4727
- * Transfer the moderator role to another eligible member
4872
+ * Transfer the moderator role to another eligible member.
4873
+ *
4874
+ * If the target member is currently joined in the current session, the request is
4875
+ * sent against the current locus. Otherwise, we search the breakout sessions and,
4876
+ * when the member is found in one, we send the request against that breakout
4877
+ * session's locus url instead.
4728
4878
  * @param {String} memberId
4729
4879
  * @param {Boolean} moderator
4730
4880
  * @returns {Promise} see #members.transferHostToMember
@@ -4734,8 +4884,19 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4734
4884
  }, {
4735
4885
  key: "transfer",
4736
4886
  value: function transfer(memberId) {
4887
+ var _this$breakouts2, _this$breakouts2$brea, _this$breakouts2$brea2, _breakout$breakoutRos;
4737
4888
  var moderator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
4738
- return this.members.transferHostToMember(memberId, moderator);
4889
+ var targetMember = this.members.membersCollection.get(memberId);
4890
+ if (targetMember !== null && targetMember !== void 0 && targetMember.isInMeeting) {
4891
+ return this.members.transferHostToMember(memberId, moderator);
4892
+ }
4893
+ var breakout = (_this$breakouts2 = this.breakouts) === null || _this$breakouts2 === void 0 ? void 0 : (_this$breakouts2$brea = _this$breakouts2.breakouts) === null || _this$breakouts2$brea === void 0 ? void 0 : (_this$breakouts2$brea2 = _this$breakouts2$brea.models) === null || _this$breakouts2$brea2 === void 0 ? void 0 : _this$breakouts2$brea2.find(function (bo) {
4894
+ var _bo$members, _bo$members$membersCo;
4895
+ var breakoutMember = (_bo$members = bo.members) === null || _bo$members === void 0 ? void 0 : (_bo$members$membersCo = _bo$members.membersCollection) === null || _bo$members$membersCo === void 0 ? void 0 : _bo$members$membersCo.get(memberId);
4896
+ return breakoutMember === null || breakoutMember === void 0 ? void 0 : breakoutMember.isInMeeting;
4897
+ });
4898
+ var breakoutLocusUrl = breakout === null || breakout === void 0 ? void 0 : (_breakout$breakoutRos = breakout.breakoutRosterLocus) === null || _breakout$breakoutRos === void 0 ? void 0 : _breakout$breakoutRos.url;
4899
+ return this.members.transferHostToMember(memberId, moderator, breakoutLocusUrl);
4739
4900
  }
4740
4901
 
4741
4902
  /**
@@ -4863,6 +5024,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4863
5024
  }) && ((_this$meetingInfo5 = this.meetingInfo) === null || _this$meetingInfo5 === void 0 ? void 0 : (_this$meetingInfo5$vi = _this$meetingInfo5.video) === null || _this$meetingInfo5$vi === void 0 ? void 0 : _this$meetingInfo5$vi.supportHQV) || !this.arePolicyRestrictionsSupported()
4864
5025
  });
4865
5026
  if (this.userDisplayHints !== undefined) {
5027
+ var _this$canNotViewThePa;
4866
5028
  changed = this.inMeetingActions.set({
4867
5029
  canInviteNewParticipants: _util2.default.canInviteNewParticipants(this.userDisplayHints),
4868
5030
  canAdmitParticipant: _util2.default.canAdmitParticipant(this.userDisplayHints),
@@ -5117,7 +5279,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5117
5279
  displayHints: this.userDisplayHints
5118
5280
  }),
5119
5281
  canAttendeeRequestAiAssistantEnabled: _util2.default.canAttendeeRequestAiAssistantEnabled(this.userDisplayHints, this.roles),
5120
- isAttendeeRequestAiAssistantDeclinedAll: _util2.default.attendeeRequestAiAssistantDeclinedAll(this.userDisplayHints)
5282
+ isAttendeeRequestAiAssistantDeclinedAll: _util2.default.attendeeRequestAiAssistantDeclinedAll(this.userDisplayHints),
5283
+ isAnonymizeDisplayNamesEnabled: _util2.default.isAnonymizeDisplayNamesEnabled(this.userDisplayHints),
5284
+ canViewTheParticipantList: _util2.default.canViewTheParticipantList(this.userDisplayHints, (_this$canNotViewThePa = this.canNotViewTheParticipantList) !== null && _this$canNotViewThePa !== void 0 ? _this$canNotViewThePa : false)
5121
5285
  }) || changed;
5122
5286
  }
5123
5287
  if (changed) {
@@ -5168,6 +5332,51 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5168
5332
  this.sipUri = sipUri;
5169
5333
  }
5170
5334
 
5335
+ /**
5336
+ * After initial locus setup, refreshes destination with synced locus data and optionally
5337
+ * performs deferred meeting info fetch when initial locus was incomplete.
5338
+ * @param {LocusDTO} locus
5339
+ * @returns {void}
5340
+ */
5341
+ }, {
5342
+ key: "finalizeMeetingAfterInitialLocusSetup",
5343
+ value: (function () {
5344
+ var _finalizeMeetingAfterInitialLocusSetup = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee12(locus) {
5345
+ var _this$destination;
5346
+ var _t1;
5347
+ return _regenerator.default.wrap(function (_context12) {
5348
+ while (1) switch (_context12.prev = _context12.next) {
5349
+ case 0:
5350
+ if (locus && (this === null || this === void 0 ? void 0 : this.destinationType) === _constants.DESTINATION_TYPE.LOCUS_ID) {
5351
+ // destination is initialized from the initial locus snapshot in constructor,
5352
+ // so refresh it after locus sync to avoid stale partial hash-tree data.
5353
+ this.destination = locus;
5354
+ }
5355
+ if (!((!this.meetingInfo || (0, _lodash.isEmpty)(this.meetingInfo)) && (_this$destination = this.destination) !== null && _this$destination !== void 0 && _this$destination.info && !this.fetchMeetingInfoTimeoutId && !_util3.default.isOneOnOneCall(locus))) {
5356
+ _context12.next = 4;
5357
+ break;
5358
+ }
5359
+ _context12.prev = 1;
5360
+ _context12.next = 2;
5361
+ return this.fetchMeetingInfo({});
5362
+ case 2:
5363
+ _context12.next = 4;
5364
+ break;
5365
+ case 3:
5366
+ _context12.prev = 3;
5367
+ _t1 = _context12["catch"](1);
5368
+ _loggerProxy.default.logger.info("Meeting:index#finalizeMeetingAfterInitialLocusSetup --> deferred fetchMeetingInfo failed: ".concat(_t1.message));
5369
+ case 4:
5370
+ case "end":
5371
+ return _context12.stop();
5372
+ }
5373
+ }, _callee12, this, [[1, 3]]);
5374
+ }));
5375
+ function finalizeMeetingAfterInitialLocusSetup(_x10) {
5376
+ return _finalizeMeetingAfterInitialLocusSetup.apply(this, arguments);
5377
+ }
5378
+ return finalizeMeetingAfterInitialLocusSetup;
5379
+ }()
5171
5380
  /**
5172
5381
  * Set the locus info the class instance. Should be called with the parsed locus
5173
5382
  * we got in the join response.
@@ -5183,6 +5392,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5183
5392
  * @private
5184
5393
  * @memberof Meeting
5185
5394
  */
5395
+ )
5186
5396
  }, {
5187
5397
  key: "setLocus",
5188
5398
  value: function setLocus(data) {
@@ -5362,11 +5572,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5362
5572
  }, {
5363
5573
  key: "setLocalAudioStream",
5364
5574
  value: (function () {
5365
- var _setLocalAudioStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee11(localStream) {
5575
+ var _setLocalAudioStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee13(localStream) {
5366
5576
  var _this$audio2;
5367
5577
  var oldStream;
5368
- return _regenerator.default.wrap(function (_context11) {
5369
- while (1) switch (_context11.prev = _context11.next) {
5578
+ return _regenerator.default.wrap(function (_context13) {
5579
+ while (1) switch (_context13.prev = _context13.next) {
5370
5580
  case 0:
5371
5581
  oldStream = this.mediaProperties.audioStream;
5372
5582
  oldStream === null || oldStream === void 0 ? void 0 : oldStream.off(_mediaHelpers.LocalStreamEventNames.UserMuteStateChange, this.localAudioStreamMuteStateHandler);
@@ -5380,21 +5590,21 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5380
5590
  localStream === null || localStream === void 0 ? void 0 : localStream.on(_mediaHelpers.LocalStreamEventNames.SystemMuteStateChange, this.localAudioStreamMuteStateHandler);
5381
5591
  localStream === null || localStream === void 0 ? void 0 : localStream.on(_mediaHelpers.LocalStreamEventNames.OutputTrackChange, this.localOutputTrackChangeHandler);
5382
5592
  if (!(!this.isMultistream || !localStream)) {
5383
- _context11.next = 1;
5593
+ _context13.next = 1;
5384
5594
  break;
5385
5595
  }
5386
- _context11.next = 1;
5596
+ _context13.next = 1;
5387
5597
  return this.unpublishStream(_internalMediaCore.MediaType.AudioMain, oldStream);
5388
5598
  case 1:
5389
- _context11.next = 2;
5599
+ _context13.next = 2;
5390
5600
  return this.publishStream(_internalMediaCore.MediaType.AudioMain, this.mediaProperties.audioStream);
5391
5601
  case 2:
5392
5602
  case "end":
5393
- return _context11.stop();
5603
+ return _context13.stop();
5394
5604
  }
5395
- }, _callee11, this);
5605
+ }, _callee13, this);
5396
5606
  }));
5397
- function setLocalAudioStream(_x1) {
5607
+ function setLocalAudioStream(_x11) {
5398
5608
  return _setLocalAudioStream.apply(this, arguments);
5399
5609
  }
5400
5610
  return setLocalAudioStream;
@@ -5410,11 +5620,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5410
5620
  }, {
5411
5621
  key: "setLocalVideoStream",
5412
5622
  value: (function () {
5413
- var _setLocalVideoStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee12(localStream) {
5623
+ var _setLocalVideoStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee14(localStream) {
5414
5624
  var _this$video2;
5415
5625
  var oldStream;
5416
- return _regenerator.default.wrap(function (_context12) {
5417
- while (1) switch (_context12.prev = _context12.next) {
5626
+ return _regenerator.default.wrap(function (_context14) {
5627
+ while (1) switch (_context14.prev = _context14.next) {
5418
5628
  case 0:
5419
5629
  oldStream = this.mediaProperties.videoStream;
5420
5630
  oldStream === null || oldStream === void 0 ? void 0 : oldStream.off(_mediaHelpers.LocalStreamEventNames.UserMuteStateChange, this.localVideoStreamMuteStateHandler);
@@ -5430,21 +5640,21 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5430
5640
  localStream === null || localStream === void 0 ? void 0 : localStream.on(_mediaHelpers.LocalStreamEventNames.OutputTrackChange, this.localOutputTrackChangeHandler);
5431
5641
  localStream === null || localStream === void 0 ? void 0 : localStream.on(_mediaHelpers.LocalStreamEventNames.ConstraintsChange, this.localConstraintsChangeHandler);
5432
5642
  if (!(!this.isMultistream || !localStream)) {
5433
- _context12.next = 1;
5643
+ _context14.next = 1;
5434
5644
  break;
5435
5645
  }
5436
- _context12.next = 1;
5646
+ _context14.next = 1;
5437
5647
  return this.unpublishStream(_internalMediaCore.MediaType.VideoMain, oldStream);
5438
5648
  case 1:
5439
- _context12.next = 2;
5649
+ _context14.next = 2;
5440
5650
  return this.publishStream(_internalMediaCore.MediaType.VideoMain, this.mediaProperties.videoStream);
5441
5651
  case 2:
5442
5652
  case "end":
5443
- return _context12.stop();
5653
+ return _context14.stop();
5444
5654
  }
5445
- }, _callee12, this);
5655
+ }, _callee14, this);
5446
5656
  }));
5447
- function setLocalVideoStream(_x10) {
5657
+ function setLocalVideoStream(_x12) {
5448
5658
  return _setLocalVideoStream.apply(this, arguments);
5449
5659
  }
5450
5660
  return setLocalVideoStream;
@@ -5461,10 +5671,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5461
5671
  }, {
5462
5672
  key: "setLocalShareVideoStream",
5463
5673
  value: (function () {
5464
- var _setLocalShareVideoStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee13(localDisplayStream) {
5674
+ var _setLocalShareVideoStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee15(localDisplayStream) {
5465
5675
  var oldStream;
5466
- return _regenerator.default.wrap(function (_context13) {
5467
- while (1) switch (_context13.prev = _context13.next) {
5676
+ return _regenerator.default.wrap(function (_context15) {
5677
+ while (1) switch (_context15.prev = _context15.next) {
5468
5678
  case 0:
5469
5679
  oldStream = this.mediaProperties.shareVideoStream;
5470
5680
  oldStream === null || oldStream === void 0 ? void 0 : oldStream.off(_mediaHelpers.LocalStreamEventNames.SystemMuteStateChange, this.handleShareVideoStreamMuteStateChange);
@@ -5476,21 +5686,21 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5476
5686
  localDisplayStream === null || localDisplayStream === void 0 ? void 0 : localDisplayStream.on(_mediaHelpers.LocalStreamEventNames.OutputTrackChange, this.localOutputTrackChangeHandler);
5477
5687
  this.mediaProperties.mediaDirection.sendShare = this.mediaProperties.hasLocalShareStream();
5478
5688
  if (!(!this.isMultistream || !localDisplayStream)) {
5479
- _context13.next = 1;
5689
+ _context15.next = 1;
5480
5690
  break;
5481
5691
  }
5482
- _context13.next = 1;
5692
+ _context15.next = 1;
5483
5693
  return this.unpublishStream(_internalMediaCore.MediaType.VideoSlides, oldStream);
5484
5694
  case 1:
5485
- _context13.next = 2;
5695
+ _context15.next = 2;
5486
5696
  return this.publishStream(_internalMediaCore.MediaType.VideoSlides, this.mediaProperties.shareVideoStream);
5487
5697
  case 2:
5488
5698
  case "end":
5489
- return _context13.stop();
5699
+ return _context15.stop();
5490
5700
  }
5491
- }, _callee13, this);
5701
+ }, _callee15, this);
5492
5702
  }));
5493
- function setLocalShareVideoStream(_x11) {
5703
+ function setLocalShareVideoStream(_x13) {
5494
5704
  return _setLocalShareVideoStream.apply(this, arguments);
5495
5705
  }
5496
5706
  return setLocalShareVideoStream;
@@ -5506,10 +5716,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5506
5716
  }, {
5507
5717
  key: "setLocalShareAudioStream",
5508
5718
  value: (function () {
5509
- var _setLocalShareAudioStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee14(localSystemAudioStream) {
5719
+ var _setLocalShareAudioStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee16(localSystemAudioStream) {
5510
5720
  var oldStream;
5511
- return _regenerator.default.wrap(function (_context14) {
5512
- while (1) switch (_context14.prev = _context14.next) {
5721
+ return _regenerator.default.wrap(function (_context16) {
5722
+ while (1) switch (_context16.prev = _context16.next) {
5513
5723
  case 0:
5514
5724
  oldStream = this.mediaProperties.shareAudioStream;
5515
5725
  oldStream === null || oldStream === void 0 ? void 0 : oldStream.off(_mediaHelpers.StreamEventNames.Ended, this.handleShareAudioStreamEnded);
@@ -5519,21 +5729,21 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5519
5729
  localSystemAudioStream === null || localSystemAudioStream === void 0 ? void 0 : localSystemAudioStream.on(_mediaHelpers.LocalStreamEventNames.OutputTrackChange, this.localOutputTrackChangeHandler);
5520
5730
  this.mediaProperties.mediaDirection.sendShare = this.mediaProperties.hasLocalShareStream();
5521
5731
  if (!(!this.isMultistream || !localSystemAudioStream)) {
5522
- _context14.next = 1;
5732
+ _context16.next = 1;
5523
5733
  break;
5524
5734
  }
5525
- _context14.next = 1;
5735
+ _context16.next = 1;
5526
5736
  return this.unpublishStream(_internalMediaCore.MediaType.AudioSlides, oldStream);
5527
5737
  case 1:
5528
- _context14.next = 2;
5738
+ _context16.next = 2;
5529
5739
  return this.publishStream(_internalMediaCore.MediaType.AudioSlides, this.mediaProperties.shareAudioStream);
5530
5740
  case 2:
5531
5741
  case "end":
5532
- return _context14.stop();
5742
+ return _context16.stop();
5533
5743
  }
5534
- }, _callee14, this);
5744
+ }, _callee16, this);
5535
5745
  }));
5536
- function setLocalShareAudioStream(_x12) {
5746
+ function setLocalShareAudioStream(_x14) {
5537
5747
  return _setLocalShareAudioStream.apply(this, arguments);
5538
5748
  }
5539
5749
  return setLocalShareAudioStream;
@@ -5642,8 +5852,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5642
5852
  var _this25 = this;
5643
5853
  // Client will have a socket manager and handle reconnecting to mercury, when we reconnect to mercury
5644
5854
  // if the meeting has active peer connections, it should try to reconnect.
5645
- // @ts-ignore
5646
- this.webex.internal.mercury.on(_constants.ONLINE, function () {
5855
+ this.mercuryOnlineHandler = function () {
5647
5856
  _loggerProxy.default.logger.info('Meeting:index#setMercuryListener --> Web socket online');
5648
5857
 
5649
5858
  // Only send restore event when it was disconnected before and for connected later
@@ -5653,15 +5862,48 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5653
5862
  });
5654
5863
  }
5655
5864
  _this25.hasWebsocketConnected = true;
5656
- });
5657
-
5658
- // @ts-ignore
5659
- this.webex.internal.mercury.on(_constants.OFFLINE, function () {
5865
+ };
5866
+ this.mercuryOfflineHandler = function () {
5660
5867
  _loggerProxy.default.logger.error('Meeting:index#setMercuryListener --> Web socket offline');
5661
5868
  _metrics.default.sendBehavioralMetric(_constants2.default.MERCURY_CONNECTION_FAILURE, {
5662
5869
  correlation_id: _this25.correlationId
5663
5870
  });
5664
- });
5871
+ };
5872
+
5873
+ // @ts-ignore
5874
+ this.webex.internal.mercury.on(_constants.ONLINE, this.mercuryOnlineHandler);
5875
+ // @ts-ignore
5876
+ this.webex.internal.mercury.on(_constants.OFFLINE, this.mercuryOfflineHandler);
5877
+ }
5878
+
5879
+ /**
5880
+ * Removes this meeting's Mercury ONLINE/OFFLINE event listeners registered
5881
+ * by setMercuryListener(). Must be called before Locus /leave to avoid
5882
+ * unnecessary syncs/metrics triggered by events received while leaving
5883
+ * (per Locus team recommendation).
5884
+ *
5885
+ * Mercury is a process-wide singleton shared with other plugins, so we
5886
+ * pass the bound handler refs to .off() to avoid clearing every listener
5887
+ * for ONLINE/OFFLINE on the shared emitter.
5888
+ *
5889
+ * Idempotent: subsequent calls are no-ops because the handler refs are
5890
+ * cleared after detaching.
5891
+ * @private
5892
+ * @returns {void}
5893
+ */
5894
+ }, {
5895
+ key: "stopListeningForMercuryEvents",
5896
+ value: function stopListeningForMercuryEvents() {
5897
+ if (this.mercuryOnlineHandler) {
5898
+ // @ts-ignore
5899
+ this.webex.internal.mercury.off(_constants.ONLINE, this.mercuryOnlineHandler);
5900
+ this.mercuryOnlineHandler = undefined;
5901
+ }
5902
+ if (this.mercuryOfflineHandler) {
5903
+ // @ts-ignore
5904
+ this.webex.internal.mercury.off(_constants.OFFLINE, this.mercuryOfflineHandler);
5905
+ this.mercuryOfflineHandler = undefined;
5906
+ }
5665
5907
  }
5666
5908
 
5667
5909
  /**
@@ -5972,17 +6214,19 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5972
6214
  }, {
5973
6215
  key: "joinWithMedia",
5974
6216
  value: (function () {
5975
- var _joinWithMedia = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee15() {
6217
+ var _joinWithMedia = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee17() {
5976
6218
  var _this30 = this;
5977
6219
  var options,
5978
6220
  mediaOptions,
5979
6221
  _options$joinOptions,
5980
6222
  joinOptions,
5981
6223
  _this$joinWithMediaRe,
5982
- isRetry,
6224
+ retryCount,
5983
6225
  prevJoinResponse,
6226
+ prevError,
5984
6227
  joined,
5985
6228
  joinResponse,
6229
+ shouldJoin,
5986
6230
  turnServerInfo,
5987
6231
  turnDiscoverySkippedReason,
5988
6232
  forceTurnDiscovery,
@@ -5995,20 +6239,21 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5995
6239
  shouldRetry,
5996
6240
  _error2,
5997
6241
  _error3,
5998
- _args15 = arguments,
5999
- _t0,
6000
- _t1;
6001
- return _regenerator.default.wrap(function (_context15) {
6002
- while (1) switch (_context15.prev = _context15.next) {
6242
+ firstError,
6243
+ _args17 = arguments,
6244
+ _t10,
6245
+ _t11;
6246
+ return _regenerator.default.wrap(function (_context17) {
6247
+ while (1) switch (_context17.prev = _context17.next) {
6003
6248
  case 0:
6004
- options = _args15.length > 0 && _args15[0] !== undefined ? _args15[0] : {};
6249
+ options = _args17.length > 0 && _args17[0] !== undefined ? _args17[0] : {};
6005
6250
  mediaOptions = options.mediaOptions, _options$joinOptions = options.joinOptions, joinOptions = _options$joinOptions === void 0 ? {} : _options$joinOptions;
6006
- _this$joinWithMediaRe = this.joinWithMediaRetryInfo, isRetry = _this$joinWithMediaRe.isRetry, prevJoinResponse = _this$joinWithMediaRe.prevJoinResponse;
6251
+ _this$joinWithMediaRe = this.joinWithMediaRetryInfo, retryCount = _this$joinWithMediaRe.retryCount, prevJoinResponse = _this$joinWithMediaRe.prevJoinResponse, prevError = _this$joinWithMediaRe.prevError;
6007
6252
  if (mediaOptions !== null && mediaOptions !== void 0 && mediaOptions.allowMediaInLobby) {
6008
- _context15.next = 1;
6253
+ _context17.next = 1;
6009
6254
  break;
6010
6255
  }
6011
- return _context15.abrupt("return", _promise.default.reject(new _parameter.default('joinWithMedia() can only be used with allowMediaInLobby set to true')));
6256
+ return _context17.abrupt("return", _promise.default.reject(new _parameter.default('joinWithMedia() can only be used with allowMediaInLobby set to true')));
6012
6257
  case 1:
6013
6258
  this.allowMediaInLobby = true;
6014
6259
  _loggerProxy.default.logger.info('Meeting:index#joinWithMedia called');
@@ -6020,39 +6265,44 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6020
6265
  in case WebRTC is not available at all.
6021
6266
  */
6022
6267
  if (!(_webCapabilities.WebCapabilities.supportsRTCPeerConnection() === _webCapabilities.CapabilityState.NOT_CAPABLE)) {
6023
- _context15.next = 2;
6268
+ _context17.next = 2;
6024
6269
  break;
6025
6270
  }
6026
6271
  throw new _internalMediaCore.Errors.WebrtcApiNotAvailableError('RTCPeerConnection API is not available in this environment');
6027
6272
  case 2:
6028
- _context15.prev = 2;
6273
+ shouldJoin = !joinResponse ||
6274
+ // first try, when the join response is empty
6275
+ prevError && prevError instanceof _webexErrors.UserNotJoinedError ||
6276
+ // last try failed with UserNotJoinedError
6277
+ _util2.default.isUserInLeftState(this.locusInfo); // locus dropped the connection before we can re-try addMedia
6278
+ _context17.prev = 3;
6029
6279
  forceTurnDiscovery = false;
6030
- if (joinResponse) {
6031
- _context15.next = 7;
6280
+ if (!shouldJoin) {
6281
+ _context17.next = 8;
6032
6282
  break;
6033
6283
  }
6034
- _context15.next = 3;
6284
+ _context17.next = 4;
6035
6285
  return this.roap.generateTurnDiscoveryRequestMessage(this, true);
6036
- case 3:
6037
- turnDiscoveryRequest = _context15.sent;
6286
+ case 4:
6287
+ turnDiscoveryRequest = _context17.sent;
6038
6288
  turnDiscoverySkippedReason = turnDiscoveryRequest.turnDiscoverySkippedReason;
6039
6289
  joinOptions.roapMessage = turnDiscoveryRequest.roapMessage;
6040
6290
  _loggerProxy.default.logger.info('Meeting:index#joinWithMedia ---> calling join with joinOptions, ', joinOptions);
6041
- _context15.next = 4;
6291
+ _context17.next = 5;
6042
6292
  return this.join(joinOptions);
6043
- case 4:
6044
- joinResponse = _context15.sent;
6293
+ case 5:
6294
+ joinResponse = _context17.sent;
6045
6295
  joined = true;
6046
6296
 
6047
6297
  // if we sent out TURN discovery Roap message with join, process the TURN discovery response
6048
6298
  if (!joinOptions.roapMessage) {
6049
- _context15.next = 6;
6299
+ _context17.next = 7;
6050
6300
  break;
6051
6301
  }
6052
- _context15.next = 5;
6302
+ _context17.next = 6;
6053
6303
  return this.roap.handleTurnDiscoveryHttpResponse(this, joinResponse);
6054
- case 5:
6055
- _yield$this$roap$hand = _context15.sent;
6304
+ case 6:
6305
+ _yield$this$roap$hand = _context17.sent;
6056
6306
  turnServerInfo = _yield$this$roap$hand.turnServerInfo;
6057
6307
  turnDiscoverySkippedReason = _yield$this$roap$hand.turnDiscoverySkippedReason;
6058
6308
  this.turnDiscoverySkippedReason = turnDiscoverySkippedReason;
@@ -6060,107 +6310,115 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6060
6310
  if (turnServerInfo === undefined) {
6061
6311
  this.roap.abortTurnDiscovery();
6062
6312
  }
6063
- case 6:
6064
- _context15.next = 8;
6065
- break;
6066
6313
  case 7:
6314
+ _context17.next = 9;
6315
+ break;
6316
+ case 8:
6067
6317
  // This is a retry, when join succeeded but addMedia failed, so we'll just call addMedia() again,
6068
6318
  // but we need to ensure that it also does a new TURN discovery
6069
6319
  forceTurnDiscovery = true;
6070
6320
  joined = true;
6071
- case 8:
6072
- _context15.next = 9;
6321
+ case 9:
6322
+ _context17.next = 10;
6073
6323
  return this.addMediaInternal(function () {
6074
- return _this30.joinWithMediaRetryInfo.isRetry ? 'JOIN_MEETING_FINAL' : 'JOIN_MEETING_RETRY';
6324
+ // callback is not called when UserNotJoinedError is thrown
6325
+ return _this30.joinWithMediaRetryInfo.retryCount >= 1 ? 'JOIN_MEETING_FINAL' : 'JOIN_MEETING_RETRY';
6075
6326
  }, turnServerInfo, forceTurnDiscovery, mediaOptions);
6076
- case 9:
6077
- mediaResponse = _context15.sent;
6327
+ case 10:
6328
+ mediaResponse = _context17.sent;
6078
6329
  this.joinWithMediaRetryInfo = {
6079
- isRetry: false,
6330
+ retryCount: 0,
6080
6331
  prevJoinResponse: undefined
6081
6332
  };
6082
- return _context15.abrupt("return", {
6333
+ return _context17.abrupt("return", {
6083
6334
  join: joinResponse,
6084
6335
  media: mediaResponse,
6085
6336
  multistreamEnabled: this.isMultistream
6086
6337
  });
6087
- case 10:
6088
- _context15.prev = 10;
6089
- _t0 = _context15["catch"](2);
6090
- _loggerProxy.default.logger.error('Meeting:index#joinWithMedia --> ', _t0);
6338
+ case 11:
6339
+ _context17.prev = 11;
6340
+ _t10 = _context17["catch"](3);
6341
+ _loggerProxy.default.logger.error('Meeting:index#joinWithMedia --> ', _t10);
6091
6342
  this.roap.abortTurnDiscovery();
6092
6343
 
6093
- // if this was the first attempt, let's do a retry
6094
- shouldRetry = !isRetry;
6095
- if (_internalPluginMetrics.CallDiagnosticUtils.isSdpOfferCreationError(_t0) || _internalPluginMetrics.CallDiagnosticUtils.isWebrtcApiNotAvailableError(_t0)) {
6344
+ // let's do a retry
6345
+ shouldRetry = retryCount < 1 || _t10 instanceof _webexErrors.UserNotJoinedError && retryCount < JOIN_WITH_MEDIA_RETRY_MAX_COUNT;
6346
+ if (_internalPluginMetrics.CallDiagnosticUtils.isSdpOfferCreationError(_t10) || _internalPluginMetrics.CallDiagnosticUtils.isWebrtcApiNotAvailableError(_t10)) {
6096
6347
  // errors related to offer creation (for example missing H264 codec) will happen again no matter how many times we try,
6097
6348
  // so there is no point doing a retry
6098
6349
  shouldRetry = false;
6099
6350
  }
6100
- if (_internalPluginMetrics.CallDiagnosticUtils.isBrowserMediaError(_t0)) {
6351
+ if (_internalPluginMetrics.CallDiagnosticUtils.isBrowserMediaError(_t10)) {
6101
6352
  shouldRetry = false;
6102
6353
  // eslint-disable-next-line no-ex-assign
6103
- _t0 = (0, _lodash.merge)({
6354
+ _t10 = (0, _lodash.merge)({
6104
6355
  error: {
6105
6356
  body: {
6106
- errorCode: _internalPluginMetrics.CallDiagnosticUtils.getBrowserMediaErrorCode(_t0),
6107
- message: (_error2 = _t0) === null || _error2 === void 0 ? void 0 : _error2.message,
6108
- name: (_error3 = _t0) === null || _error3 === void 0 ? void 0 : _error3.name
6357
+ errorCode: _internalPluginMetrics.CallDiagnosticUtils.getBrowserMediaErrorCode(_t10),
6358
+ message: (_error2 = _t10) === null || _error2 === void 0 ? void 0 : _error2.message,
6359
+ name: (_error3 = _t10) === null || _error3 === void 0 ? void 0 : _error3.name
6109
6360
  }
6110
6361
  }
6111
6362
  });
6112
6363
  }
6113
6364
 
6114
- // we only want to call leave if join was successful and this was a retry or we won't be doing any more retries
6115
- if (!(joined && (isRetry || !shouldRetry))) {
6116
- _context15.next = 14;
6365
+ // we only want to call leave if join was successful, and we won't be doing any more retries
6366
+ if (!(joined && !shouldRetry)) {
6367
+ _context17.next = 15;
6117
6368
  break;
6118
6369
  }
6119
- _context15.prev = 11;
6120
- _context15.next = 12;
6370
+ _context17.prev = 12;
6371
+ _context17.next = 13;
6121
6372
  return this.leave({
6122
6373
  resourceId: joinOptions === null || joinOptions === void 0 ? void 0 : joinOptions.resourceId,
6123
6374
  reason: 'joinWithMedia failure'
6124
6375
  });
6125
- case 12:
6126
- _context15.next = 14;
6127
- break;
6128
6376
  case 13:
6129
- _context15.prev = 13;
6130
- _t1 = _context15["catch"](11);
6131
- _loggerProxy.default.logger.error('Meeting:index#joinWithMedia --> leave error', _t1);
6132
- leaveError = _t1;
6377
+ _context17.next = 15;
6378
+ break;
6133
6379
  case 14:
6380
+ _context17.prev = 14;
6381
+ _t11 = _context17["catch"](12);
6382
+ _loggerProxy.default.logger.error('Meeting:index#joinWithMedia --> leave error', _t11);
6383
+ leaveError = _t11;
6384
+ case 15:
6134
6385
  _metrics.default.sendBehavioralMetric(_constants2.default.JOIN_WITH_MEDIA_FAILURE, {
6135
6386
  correlation_id: this.correlationId,
6136
6387
  locus_id: (_this$locusUrl = this.locusUrl) === null || _this$locusUrl === void 0 ? void 0 : _this$locusUrl.split('/').pop(),
6137
6388
  // if join fails, we may end up with no locusUrl
6138
- reason: _t0.message,
6139
- stack: _t0.stack,
6389
+ reason: _t10.message,
6390
+ stack: _t10.stack,
6140
6391
  leaveErrorReason: (_leaveError = leaveError) === null || _leaveError === void 0 ? void 0 : _leaveError.message,
6141
- isRetry: isRetry
6392
+ isRetry: retryCount > 0
6142
6393
  }, {
6143
- type: _t0.name
6394
+ type: _t10.name
6144
6395
  });
6145
6396
  if (!shouldRetry) {
6146
- _context15.next = 15;
6397
+ _context17.next = 16;
6147
6398
  break;
6148
6399
  }
6149
6400
  _loggerProxy.default.logger.warn('Meeting:index#joinWithMedia --> retrying call to joinWithMedia');
6150
- this.joinWithMediaRetryInfo.isRetry = true;
6401
+ this.joinWithMediaRetryInfo.retryCount = retryCount + 1;
6151
6402
  this.joinWithMediaRetryInfo.prevJoinResponse = joinResponse;
6152
- return _context15.abrupt("return", this.joinWithMedia(options));
6153
- case 15:
6403
+ this.joinWithMediaRetryInfo.prevError = _t10;
6404
+ if (!this.joinWithMediaRetryInfo.firstError) {
6405
+ this.joinWithMediaRetryInfo.firstError = _t10;
6406
+ }
6407
+ return _context17.abrupt("return", this.joinWithMedia(options));
6408
+ case 16:
6409
+ firstError = this.joinWithMediaRetryInfo.firstError;
6154
6410
  this.joinWithMediaRetryInfo = {
6155
- isRetry: false,
6156
- prevJoinResponse: undefined
6411
+ retryCount: 0,
6412
+ prevJoinResponse: undefined,
6413
+ firstError: undefined,
6414
+ prevError: undefined
6157
6415
  };
6158
- throw _t0;
6159
- case 16:
6416
+ throw firstError !== null && firstError !== void 0 ? firstError : _t10;
6417
+ case 17:
6160
6418
  case "end":
6161
- return _context15.stop();
6419
+ return _context17.stop();
6162
6420
  }
6163
- }, _callee15, this, [[2, 10], [11, 13]]);
6421
+ }, _callee17, this, [[3, 11], [12, 14]]);
6164
6422
  }));
6165
6423
  function joinWithMedia() {
6166
6424
  return _joinWithMedia.apply(this, arguments);
@@ -6190,20 +6448,20 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6190
6448
  return _promise.default.reject(new _parameter.default('Cannot reconnect, Media has not established to reconnect'));
6191
6449
  }
6192
6450
  this.cleanUpBeforeReconnection();
6193
- return this.reconnectionManager.reconnect(options, /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee16() {
6194
- return _regenerator.default.wrap(function (_context16) {
6195
- while (1) switch (_context16.prev = _context16.next) {
6196
- case 0:
6197
- _context16.next = 1;
6451
+ return this.reconnectionManager.reconnect(options, /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee18() {
6452
+ return _regenerator.default.wrap(function (_context18) {
6453
+ while (1) switch (_context18.prev = _context18.next) {
6454
+ case 0:
6455
+ _context18.next = 1;
6198
6456
  return _this31.waitForRemoteSDPAnswer();
6199
6457
  case 1:
6200
- _context16.next = 2;
6458
+ _context18.next = 2;
6201
6459
  return _this31.waitForMediaConnectionConnected();
6202
6460
  case 2:
6203
6461
  case "end":
6204
- return _context16.stop();
6462
+ return _context18.stop();
6205
6463
  }
6206
- }, _callee16);
6464
+ }, _callee18);
6207
6465
  }))).then(function () {
6208
6466
  _loggerProxy.default.logger.log('Meeting:index#reconnect --> Meeting reconnect success');
6209
6467
  }).catch(function (error) {
@@ -6243,8 +6501,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6243
6501
  }, {
6244
6502
  key: "isReactionsSupported",
6245
6503
  value: function isReactionsSupported() {
6246
- var _this$locusInfo6, _this$locusInfo6$cont;
6247
- if ((_this$locusInfo6 = this.locusInfo) !== null && _this$locusInfo6 !== void 0 && (_this$locusInfo6$cont = _this$locusInfo6.controls) !== null && _this$locusInfo6$cont !== void 0 && _this$locusInfo6$cont.reactions.enabled) {
6504
+ var _this$locusInfo8, _this$locusInfo8$cont;
6505
+ if ((_this$locusInfo8 = this.locusInfo) !== null && _this$locusInfo8 !== void 0 && (_this$locusInfo8$cont = _this$locusInfo8.controls) !== null && _this$locusInfo8$cont !== void 0 && _this$locusInfo8$cont.reactions.enabled) {
6248
6506
  return true;
6249
6507
  }
6250
6508
  _loggerProxy.default.logger.error('Meeting:index#isReactionsSupported --> Reactions is not supported');
@@ -6344,53 +6602,75 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6344
6602
  }, {
6345
6603
  key: "startTranscription",
6346
6604
  value: (function () {
6347
- var _startTranscription = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee17(options) {
6348
- var _t10;
6349
- return _regenerator.default.wrap(function (_context17) {
6350
- while (1) switch (_context17.prev = _context17.next) {
6605
+ var _startTranscription = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee19(options) {
6606
+ var _t12;
6607
+ return _regenerator.default.wrap(function (_context19) {
6608
+ while (1) switch (_context19.prev = _context19.next) {
6351
6609
  case 0:
6352
6610
  if (!this.isJoined()) {
6353
- _context17.next = 5;
6611
+ _context19.next = 5;
6354
6612
  break;
6355
6613
  }
6356
6614
  _loggerProxy.default.logger.info('Meeting:index#startTranscription --> Attempting to enable transcription!');
6357
- _context17.prev = 1;
6615
+ _context19.prev = 1;
6358
6616
  if (!this.areVoiceaEventsSetup) {
6359
6617
  this.setUpVoiceaListeners();
6360
6618
  }
6361
6619
 
6362
6620
  // @ts-ignore
6363
- _context17.next = 2;
6621
+ _context19.next = 2;
6364
6622
  return this.webex.internal.voicea.turnOnCaptions(options === null || options === void 0 ? void 0 : options.spokenLanguage);
6365
6623
  case 2:
6366
- _context17.next = 4;
6624
+ _context19.next = 4;
6367
6625
  break;
6368
6626
  case 3:
6369
- _context17.prev = 3;
6370
- _t10 = _context17["catch"](1);
6371
- _loggerProxy.default.logger.error("Meeting:index#startTranscription --> ".concat(_t10));
6627
+ _context19.prev = 3;
6628
+ _t12 = _context19["catch"](1);
6629
+ _loggerProxy.default.logger.error("Meeting:index#startTranscription --> ".concat(_t12));
6372
6630
  _metrics.default.sendBehavioralMetric(_constants2.default.RECEIVE_TRANSCRIPTION_FAILURE, {
6373
6631
  correlation_id: this.correlationId,
6374
- reason: _t10.message,
6375
- stack: _t10.stack
6632
+ reason: _t12.message,
6633
+ stack: _t12.stack
6376
6634
  });
6377
6635
  case 4:
6378
- _context17.next = 6;
6636
+ _context19.next = 6;
6379
6637
  break;
6380
6638
  case 5:
6381
6639
  _loggerProxy.default.logger.error("Meeting:index#startTranscription --> meeting joined : ".concat(this.isJoined()));
6382
6640
  throw new Error('Meeting is not joined');
6383
6641
  case 6:
6384
6642
  case "end":
6385
- return _context17.stop();
6643
+ return _context19.stop();
6386
6644
  }
6387
- }, _callee17, this, [[1, 3]]);
6645
+ }, _callee19, this, [[1, 3]]);
6388
6646
  }));
6389
- function startTranscription(_x13) {
6647
+ function startTranscription(_x15) {
6390
6648
  return _startTranscription.apply(this, arguments);
6391
6649
  }
6392
6650
  return startTranscription;
6393
6651
  }())
6652
+ }, {
6653
+ key: "isRelayEventRouteValid",
6654
+ value:
6655
+ /**
6656
+ * Verifies the relay event was delivered for the active LLM session binding.
6657
+ * @param {RelayEvent} event Event object coming from LLM Connection
6658
+ * @returns {boolean}
6659
+ */
6660
+ function isRelayEventRouteValid(event) {
6661
+ var _event$headers;
6662
+ var route = event === null || event === void 0 ? void 0 : (_event$headers = event.headers) === null || _event$headers === void 0 ? void 0 : _event$headers.route;
6663
+ if (!route) {
6664
+ return true;
6665
+ }
6666
+ var llm = this.webex.internal.llm;
6667
+ var isPracticeSession = llm.isConnected(_constants.LLM_PRACTICE_SESSION);
6668
+ var expectedBinding = isPracticeSession ? llm.getBinding(_constants.LLM_PRACTICE_SESSION) : llm.getBinding();
6669
+ if (!expectedBinding || route === expectedBinding) {
6670
+ return true;
6671
+ }
6672
+ return false;
6673
+ }
6394
6674
  }, {
6395
6675
  key: "stopTranscription",
6396
6676
  value:
@@ -6441,9 +6721,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6441
6721
  key: "restoreLLMSubscriptionsIfNeeded",
6442
6722
  value: function restoreLLMSubscriptionsIfNeeded() {
6443
6723
  try {
6444
- var _this$webex$internal$, _this$webex$internal$2;
6724
+ var _this$webex$internal$5, _this$webex$internal$6;
6445
6725
  // @ts-ignore
6446
- var isCaptionBoxOn = (_this$webex$internal$ = this.webex.internal.voicea) === null || _this$webex$internal$ === void 0 ? void 0 : (_this$webex$internal$2 = _this$webex$internal$.getIsCaptionBoxOn) === null || _this$webex$internal$2 === void 0 ? void 0 : _this$webex$internal$2.call(_this$webex$internal$);
6726
+ var isCaptionBoxOn = (_this$webex$internal$5 = this.webex.internal.voicea) === null || _this$webex$internal$5 === void 0 ? void 0 : (_this$webex$internal$6 = _this$webex$internal$5.getIsCaptionBoxOn) === null || _this$webex$internal$6 === void 0 ? void 0 : _this$webex$internal$6.call(_this$webex$internal$5);
6447
6727
  if (!isCaptionBoxOn) {
6448
6728
  return;
6449
6729
  }
@@ -6473,7 +6753,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6473
6753
  * Scenario D: Joining any other way (sip, pstn, conversationUrl, link just need to specify resourceId)
6474
6754
  */
6475
6755
  function () {
6476
- var _join = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee18() {
6756
+ var _join = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee20() {
6477
6757
  var _this34 = this;
6478
6758
  var options,
6479
6759
  errorMessage,
@@ -6484,26 +6764,26 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6484
6764
  _error4,
6485
6765
  _errorMessage3,
6486
6766
  _error5,
6487
- _args18 = arguments,
6488
- _t11;
6489
- return _regenerator.default.wrap(function (_context18) {
6490
- while (1) switch (_context18.prev = _context18.next) {
6767
+ _args20 = arguments,
6768
+ _t13;
6769
+ return _regenerator.default.wrap(function (_context20) {
6770
+ while (1) switch (_context20.prev = _context20.next) {
6491
6771
  case 0:
6492
- options = _args18.length > 0 && _args18[0] !== undefined ? _args18[0] : {};
6772
+ options = _args20.length > 0 && _args20[0] !== undefined ? _args20[0] : {};
6493
6773
  if (this.webex.meetings.registered) {
6494
- _context18.next = 1;
6774
+ _context20.next = 1;
6495
6775
  break;
6496
6776
  }
6497
6777
  errorMessage = 'Meeting:index#join --> Device not registered';
6498
6778
  error = new Error(errorMessage);
6499
6779
  _loggerProxy.default.logger.error(errorMessage);
6500
- return _context18.abrupt("return", _promise.default.reject(error));
6780
+ return _context20.abrupt("return", _promise.default.reject(error));
6501
6781
  case 1:
6502
6782
  if (!this.deferJoin) {
6503
- _context18.next = 2;
6783
+ _context20.next = 2;
6504
6784
  break;
6505
6785
  }
6506
- return _context18.abrupt("return", this.deferJoin);
6786
+ return _context20.abrupt("return", this.deferJoin);
6507
6787
  case 2:
6508
6788
  // Create a deferred promise for a consistent resolve value from utils.
6509
6789
  // This also prevents redundant API calls.
@@ -6555,15 +6835,15 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6555
6835
  this.wirelessShare = true;
6556
6836
  }
6557
6837
  if (!options.meetingQuality) {
6558
- _context18.next = 6;
6838
+ _context20.next = 6;
6559
6839
  break;
6560
6840
  }
6561
6841
  if (!(typeof options.meetingQuality === 'string')) {
6562
- _context18.next = 4;
6842
+ _context20.next = 4;
6563
6843
  break;
6564
6844
  }
6565
6845
  if (_constants.QUALITY_LEVELS[options.meetingQuality]) {
6566
- _context18.next = 3;
6846
+ _context20.next = 3;
6567
6847
  break;
6568
6848
  }
6569
6849
  _errorMessage2 = "Meeting:index#join --> ".concat(options.meetingQuality, " not defined");
@@ -6571,16 +6851,16 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6571
6851
  _loggerProxy.default.logger.error(_errorMessage2);
6572
6852
  joinFailed(_error4);
6573
6853
  this.deferJoin = undefined;
6574
- return _context18.abrupt("return", _promise.default.reject(_error4));
6854
+ return _context20.abrupt("return", _promise.default.reject(_error4));
6575
6855
  case 3:
6576
6856
  this.mediaProperties.setRemoteQualityLevel(options.meetingQuality);
6577
6857
  case 4:
6578
6858
  if (!((0, _typeof2.default)(options.meetingQuality) === 'object')) {
6579
- _context18.next = 6;
6859
+ _context20.next = 6;
6580
6860
  break;
6581
6861
  }
6582
6862
  if (_constants.QUALITY_LEVELS[options.meetingQuality.remote]) {
6583
- _context18.next = 5;
6863
+ _context20.next = 5;
6584
6864
  break;
6585
6865
  }
6586
6866
  _errorMessage3 = "Meeting:index#join --> ".concat(options.meetingQuality.remote, " not defined");
@@ -6588,42 +6868,42 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6588
6868
  _error5 = new Error(_errorMessage3);
6589
6869
  joinFailed(_error5);
6590
6870
  this.deferJoin = undefined;
6591
- return _context18.abrupt("return", _promise.default.reject(new Error(_errorMessage3)));
6871
+ return _context20.abrupt("return", _promise.default.reject(new Error(_errorMessage3)));
6592
6872
  case 5:
6593
6873
  if (options.meetingQuality.remote) {
6594
6874
  this.mediaProperties.setRemoteQualityLevel(options.meetingQuality.remote);
6595
6875
  }
6596
6876
  case 6:
6597
6877
  this.isMultistream = !!options.enableMultistream;
6598
- _context18.prev = 7;
6599
- _context18.next = 8;
6878
+ _context20.prev = 7;
6879
+ _context20.next = 8;
6600
6880
  return this.checkAndRefreshPermissionToken(_constants.MEETING_PERMISSION_TOKEN_REFRESH_THRESHOLD_IN_SEC, _constants.MEETING_PERMISSION_TOKEN_REFRESH_REASON);
6601
6881
  case 8:
6602
- _context18.next = 10;
6882
+ _context20.next = 10;
6603
6883
  break;
6604
6884
  case 9:
6605
- _context18.prev = 9;
6606
- _t11 = _context18["catch"](7);
6607
- _loggerProxy.default.logger.error('Meeting:index#join --> Failed to refresh permission token:', _t11);
6608
- if (!(_t11 instanceof _captchaError.default || _t11 instanceof _passwordError.default || _t11 instanceof _permission.default)) {
6609
- _context18.next = 10;
6885
+ _context20.prev = 9;
6886
+ _t13 = _context20["catch"](7);
6887
+ _loggerProxy.default.logger.error('Meeting:index#join --> Failed to refresh permission token:', _t13);
6888
+ if (!(_t13 instanceof _captchaError.default || _t13 instanceof _passwordError.default || _t13 instanceof _permission.default)) {
6889
+ _context20.next = 10;
6610
6890
  break;
6611
6891
  }
6612
- this.meetingFiniteStateMachine.fail(_t11);
6892
+ this.meetingFiniteStateMachine.fail(_t13);
6613
6893
 
6614
6894
  // Upload logs on refreshpermissionToken refresh Failure
6615
6895
  _triggerProxy.default.trigger(this, {
6616
6896
  file: 'meeting/index',
6617
6897
  function: 'join'
6618
6898
  }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, this);
6619
- joinFailed(_t11);
6899
+ joinFailed(_t13);
6620
6900
  this.deferJoin = undefined;
6621
6901
 
6622
6902
  // if refresh permission token requires captcha, password or permission, we are throwing the errors
6623
6903
  // and bubble it up to client
6624
- return _context18.abrupt("return", _promise.default.reject(_t11));
6904
+ return _context20.abrupt("return", _promise.default.reject(_t13));
6625
6905
  case 10:
6626
- return _context18.abrupt("return", _util2.default.joinMeetingOptions(this, options).then(function (join) {
6906
+ return _context20.abrupt("return", _util2.default.joinMeetingOptions(this, options).then(function (join) {
6627
6907
  _this34.meetingFiniteStateMachine.join();
6628
6908
  _this34.setupLocusMediaRequest();
6629
6909
 
@@ -6679,9 +6959,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6679
6959
  }));
6680
6960
  case 11:
6681
6961
  case "end":
6682
- return _context18.stop();
6962
+ return _context20.stop();
6683
6963
  }
6684
- }, _callee18, this, [[7, 9]]);
6964
+ }, _callee20, this, [[7, 9]]);
6685
6965
  }));
6686
6966
  function join() {
6687
6967
  return _join.apply(this, arguments);
@@ -6730,17 +7010,66 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6730
7010
  this.llmHealthCheckTimer = undefined;
6731
7011
  }
6732
7012
  }
7013
+
7014
+ /**
7015
+ * Removes LLM event listeners and clears the health check timer.
7016
+ * Must be called before Locus /leave to avoid unnecessary syncs triggered
7017
+ * by events received while leaving (per Locus team recommendation).
7018
+ * Idempotent: safe to call multiple times; .off() is a no-op when no
7019
+ * matching listener is registered.
7020
+ * @private
7021
+ * @returns {void}
7022
+ */
7023
+ }, {
7024
+ key: "stopListeningForLLMEvents",
7025
+ value: function stopListeningForLLMEvents() {
7026
+ // @ts-ignore - fix types
7027
+ this.webex.internal.llm.off('event:relay.event', this.processRelayEvent);
7028
+ // @ts-ignore - fix types
7029
+ this.webex.internal.llm.off(_constants.LOCUS_LLM_EVENT, this.processLocusLLMEvent);
7030
+ this.clearLLMHealthCheckTimer();
7031
+ }
7032
+
7033
+ /**
7034
+ * Stops listening on every event bus (LLM, Mercury, voicea/transcription,
7035
+ * annotation) that could otherwise deliver events to this meeting while
7036
+ * Locus is processing /leave or /end. Per the Locus team recommendation,
7037
+ * this must run before the Locus request is dispatched to avoid
7038
+ * unnecessary syncs triggered by in-flight events.
7039
+ *
7040
+ * Voicea (transcription) subscribes to llm 'event:relay.event' internally,
7041
+ * and the annotation plugin subscribes to both mercury and llm, so both
7042
+ * must be torn down alongside the direct LLM/Mercury listeners.
7043
+ *
7044
+ * Idempotent: safe to call multiple times; .off() is a no-op when no
7045
+ * matching listener is registered, and stopTranscription is guarded.
7046
+ * @private
7047
+ * @returns {void}
7048
+ */
7049
+ }, {
7050
+ key: "stopListeningForMeetingEvents",
7051
+ value: function stopListeningForMeetingEvents() {
7052
+ this.stopListeningForLLMEvents();
7053
+ this.stopListeningForMercuryEvents();
7054
+ if (this.transcription) {
7055
+ this.stopTranscription();
7056
+ this.transcription = undefined;
7057
+ }
7058
+ this.annotation.deregisterEvents();
7059
+ }
6733
7060
  }, {
6734
7061
  key: "clearDataChannelToken",
6735
7062
  value:
6736
7063
  /**
6737
- * Clears all data channel tokens stored in LLM.
6738
- * Called during meeting cleanup to ensure stale tokens are not reused.
7064
+ * Clears data channel tokens associated with this meeting ownership.
7065
+ * Ownership checks are enforced in internal-plugin-llm.
6739
7066
  * @returns {void}
6740
7067
  */
6741
7068
  function clearDataChannelToken() {
6742
7069
  // @ts-ignore
6743
- this.webex.internal.llm.resetDatachannelTokens();
7070
+ this.webex.internal.llm.clearDatachannelToken(_constants.LLM_DEFAULT_SESSION, this.id);
7071
+ // @ts-ignore
7072
+ this.webex.internal.llm.clearDatachannelToken(_constants.LLM_PRACTICE_SESSION, this.id);
6744
7073
  }
6745
7074
 
6746
7075
  /**
@@ -6757,11 +7086,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6757
7086
  var practiceSessionDatachannelToken = join === null || join === void 0 ? void 0 : (_join$locus2 = join.locus) === null || _join$locus2 === void 0 ? void 0 : (_join$locus2$self = _join$locus2.self) === null || _join$locus2$self === void 0 ? void 0 : _join$locus2$self.practiceSessionDatachannelToken;
6758
7087
  if (datachannelToken) {
6759
7088
  // @ts-ignore
6760
- this.webex.internal.llm.setDatachannelToken(datachannelToken, _internalPluginLlm.DataChannelTokenType.Default);
7089
+ this.webex.internal.llm.setDatachannelToken(datachannelToken, _constants.LLM_DEFAULT_SESSION, this.id);
6761
7090
  }
6762
7091
  if (practiceSessionDatachannelToken) {
6763
7092
  // @ts-ignore
6764
- this.webex.internal.llm.setDatachannelToken(practiceSessionDatachannelToken, _internalPluginLlm.DataChannelTokenType.PracticeSession);
7093
+ this.webex.internal.llm.setDatachannelToken(practiceSessionDatachannelToken, _constants.LLM_PRACTICE_SESSION, this.id);
6765
7094
  }
6766
7095
  }
6767
7096
 
@@ -6773,55 +7102,55 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6773
7102
  }, {
6774
7103
  key: "ensureDefaultDatachannelTokenAfterAdmit",
6775
7104
  value: (function () {
6776
- var _ensureDefaultDatachannelTokenAfterAdmit = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee19() {
6777
- var _response$body, datachannelToken, isDataChannelTokenEnabled, response, fetchedDatachannelToken, msg, _t12;
6778
- return _regenerator.default.wrap(function (_context19) {
6779
- while (1) switch (_context19.prev = _context19.next) {
7105
+ var _ensureDefaultDatachannelTokenAfterAdmit = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee21() {
7106
+ var _response$body, datachannelToken, isDataChannelTokenEnabled, response, fetchedDatachannelToken, msg, _t14;
7107
+ return _regenerator.default.wrap(function (_context21) {
7108
+ while (1) switch (_context21.prev = _context21.next) {
6780
7109
  case 0:
6781
- _context19.prev = 0;
7110
+ _context21.prev = 0;
6782
7111
  // @ts-ignore
6783
- datachannelToken = this.webex.internal.llm.getDatachannelToken(); // @ts-ignore
6784
- _context19.next = 1;
7112
+ datachannelToken = this.webex.internal.llm.getDatachannelToken(_constants.LLM_DEFAULT_SESSION, this.id); // @ts-ignore
7113
+ _context21.next = 1;
6785
7114
  return this.webex.internal.llm.isDataChannelTokenEnabled();
6786
7115
  case 1:
6787
- isDataChannelTokenEnabled = _context19.sent;
7116
+ isDataChannelTokenEnabled = _context21.sent;
6788
7117
  if (!(!isDataChannelTokenEnabled || datachannelToken)) {
6789
- _context19.next = 2;
7118
+ _context21.next = 2;
6790
7119
  break;
6791
7120
  }
6792
- return _context19.abrupt("return", false);
7121
+ return _context21.abrupt("return", false);
6793
7122
  case 2:
6794
- _context19.next = 3;
7123
+ _context21.next = 3;
6795
7124
  return this.meetingRequest.fetchDatachannelToken({
6796
7125
  locusUrl: this.locusUrl,
6797
7126
  requestingParticipantId: this.members.selfId,
6798
7127
  isPracticeSession: false
6799
7128
  });
6800
7129
  case 3:
6801
- response = _context19.sent;
7130
+ response = _context21.sent;
6802
7131
  fetchedDatachannelToken = response === null || response === void 0 ? void 0 : (_response$body = response.body) === null || _response$body === void 0 ? void 0 : _response$body.datachannelToken;
6803
7132
  if (fetchedDatachannelToken) {
6804
- _context19.next = 4;
7133
+ _context21.next = 4;
6805
7134
  break;
6806
7135
  }
6807
- return _context19.abrupt("return", false);
7136
+ return _context21.abrupt("return", false);
6808
7137
  case 4:
6809
7138
  // @ts-ignore
6810
- this.webex.internal.llm.setDatachannelToken(fetchedDatachannelToken, _internalPluginLlm.DataChannelTokenType.Default);
6811
- return _context19.abrupt("return", true);
7139
+ this.webex.internal.llm.setDatachannelToken(fetchedDatachannelToken, _constants.LLM_DEFAULT_SESSION, this.id);
7140
+ return _context21.abrupt("return", true);
6812
7141
  case 5:
6813
- _context19.prev = 5;
6814
- _t12 = _context19["catch"](0);
6815
- msg = (_t12 === null || _t12 === void 0 ? void 0 : _t12.message) || String(_t12);
7142
+ _context21.prev = 5;
7143
+ _t14 = _context21["catch"](0);
7144
+ msg = (_t14 === null || _t14 === void 0 ? void 0 : _t14.message) || String(_t14);
6816
7145
  _loggerProxy.default.logger.warn("Meeting:index#ensureDefaultDatachannelTokenAfterAdmit --> failed to proactively fetch default data channel token after admit: ".concat(msg), {
6817
- statusCode: _t12 === null || _t12 === void 0 ? void 0 : _t12.statusCode
7146
+ statusCode: _t14 === null || _t14 === void 0 ? void 0 : _t14.statusCode
6818
7147
  });
6819
- return _context19.abrupt("return", false);
7148
+ return _context21.abrupt("return", false);
6820
7149
  case 6:
6821
7150
  case "end":
6822
- return _context19.stop();
7151
+ return _context21.stop();
6823
7152
  }
6824
- }, _callee19, this, [[0, 5]]);
7153
+ }, _callee21, this, [[0, 5]]);
6825
7154
  }));
6826
7155
  function ensureDefaultDatachannelTokenAfterAdmit() {
6827
7156
  return _ensureDefaultDatachannelTokenAfterAdmit.apply(this, arguments);
@@ -6837,43 +7166,120 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6837
7166
  }, {
6838
7167
  key: "updateLLMConnection",
6839
7168
  value: (function () {
6840
- var _updateLLMConnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee20() {
7169
+ var _updateLLMConnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee22() {
6841
7170
  var _this36 = this;
6842
- var _ref39, _ref39$url, url, _ref39$info, _ref39$info2, _ref39$info2$datachan, datachannelUrl, isJoined, datachannelToken, dataChannelUrl;
6843
- return _regenerator.default.wrap(function (_context20) {
6844
- while (1) switch (_context20.prev = _context20.next) {
7171
+ var _ref40, _ref40$url, url, _ref40$info, _ref40$info2, _ref40$info2$datachan, datachannelUrl, isJoined, dataChannelUrl, _this$webex$internal$7, currentOwner, wasConnected, datachannelToken, refreshHandlerOwnerMeetingId, shouldAlignRefreshHandlerAfterOwnershipClaim;
7172
+ return _regenerator.default.wrap(function (_context22) {
7173
+ while (1) switch (_context22.prev = _context22.next) {
6845
7174
  case 0:
6846
7175
  // @ts-ignore - Fix type
6847
- _ref39 = this.locusInfo || {}, _ref39$url = _ref39.url, url = _ref39$url === void 0 ? undefined : _ref39$url, _ref39$info = _ref39.info, _ref39$info2 = _ref39$info === void 0 ? {} : _ref39$info, _ref39$info2$datachan = _ref39$info2.datachannelUrl, datachannelUrl = _ref39$info2$datachan === void 0 ? undefined : _ref39$info2$datachan;
6848
- isJoined = this.isJoined(); // @ts-ignore
6849
- datachannelToken = this.webex.internal.llm.getDatachannelToken(_internalPluginLlm.DataChannelTokenType.Default);
6850
- dataChannelUrl = datachannelUrl; // @ts-ignore - Fix type
6851
- if (!this.webex.internal.llm.isConnected()) {
6852
- _context20.next = 2;
7176
+ _ref40 = this.locusInfo || {}, _ref40$url = _ref40.url, url = _ref40$url === void 0 ? undefined : _ref40$url, _ref40$info = _ref40.info, _ref40$info2 = _ref40$info === void 0 ? {} : _ref40$info, _ref40$info2$datachan = _ref40$info2.datachannelUrl, datachannelUrl = _ref40$info2$datachan === void 0 ? undefined : _ref40$info2$datachan;
7177
+ isJoined = this.isJoined();
7178
+ dataChannelUrl = datachannelUrl; // Ownership guard: when the default LLM session is already connected and
7179
+ // owned by a *different* Meeting instance, do not disconnect or reconfigure
7180
+ // it. Another meeting's `updateLLMConnection` must be ignored here to
7181
+ // avoid killing the socket it relies on. We only proceed to manage the
7182
+ // connection when this meeting is the current owner, or when no owner is
7183
+ // set yet (first claim).
7184
+ // @ts-ignore - Fix type
7185
+ _this$webex$internal$7 = this.webex.internal.llm.resolveSessionOwnership(this.id, _constants.LLM_DEFAULT_SESSION), currentOwner = _this$webex$internal$7.currentOwner; // Capture connectivity before any reconnect attempt. If LLM was already
7186
+ // connected, we must respect current ownership. If it was disconnected,
7187
+ // this flow may reclaim stale owner tags after a fresh connect.
7188
+ // @ts-ignore - Fix type
7189
+ wasConnected = this.webex.internal.llm.isConnected(); // Prefer ownership-scoped token read. For disconnected stale-owner reclaim
7190
+ // flows, fallback to ownerless read so initial register can still carry a
7191
+ // token and recover from stale ownership without 401/403 dead-end.
7192
+ // @ts-ignore - Fix type
7193
+ datachannelToken = this.webex.internal.llm.getDatachannelToken(_constants.LLM_DEFAULT_SESSION, this.id);
7194
+ if (!datachannelToken && !wasConnected && currentOwner && currentOwner !== this.id) {
7195
+ // @ts-ignore - Fix type
7196
+ datachannelToken = this.webex.internal.llm.getDatachannelToken(_constants.LLM_DEFAULT_SESSION);
7197
+ }
7198
+
7199
+ // @ts-ignore - Fix type
7200
+ if (!wasConnected) {
7201
+ _context22.next = 3;
6853
7202
  break;
6854
7203
  }
7204
+ if (!(currentOwner && currentOwner !== this.id)) {
7205
+ _context22.next = 1;
7206
+ break;
7207
+ }
7208
+ // Another meeting owns the live LLM socket. We must not disconnect
7209
+ // or reconfigure it -- doing so would tear down a session the
7210
+ // owning meeting still relies on. Locus/datachannel URL mismatch is
7211
+ // expected here (each meeting has its own locus URL) and is NOT a
7212
+ // valid signal of staleness, so we never reclaim from this path.
7213
+ // The only safe reclaim mechanism is the `finally`-block owner-tag
7214
+ // release in `cleanupLLMConneciton`, which fires when this meeting
7215
+ // itself is being torn down.
7216
+ _loggerProxy.default.logger.info("Meeting:index#updateLLMConnection --> skipping; LLM owned by meeting ".concat(currentOwner, ", not ").concat(this.id));
7217
+ return _context22.abrupt("return", undefined);
7218
+ case 1:
6855
7219
  if (!(
6856
7220
  // @ts-ignore - Fix type
6857
7221
  url === this.webex.internal.llm.getLocusUrl() &&
6858
7222
  // @ts-ignore - Fix type
6859
7223
  dataChannelUrl === this.webex.internal.llm.getDatachannelUrl() && isJoined)) {
6860
- _context20.next = 1;
7224
+ _context22.next = 2;
6861
7225
  break;
6862
7226
  }
6863
- return _context20.abrupt("return", undefined);
6864
- case 1:
6865
- _context20.next = 2;
7227
+ return _context22.abrupt("return", undefined);
7228
+ case 2:
7229
+ _context22.next = 3;
6866
7230
  return this.cleanupLLMConneciton({
6867
7231
  removeOnlineListener: false
6868
7232
  });
6869
- case 2:
7233
+ case 3:
6870
7234
  if (isJoined) {
6871
- _context20.next = 3;
7235
+ _context22.next = 4;
6872
7236
  break;
6873
7237
  }
6874
- return _context20.abrupt("return", undefined);
6875
- case 3:
6876
- return _context20.abrupt("return", this.webex.internal.llm.registerAndConnect(url, dataChannelUrl, datachannelToken).then(function (registerAndConnectResult) {
7238
+ return _context22.abrupt("return", undefined);
7239
+ case 4:
7240
+ // Bind refresh handler before registration so interceptor-triggered token
7241
+ // refresh during register POST can resolve a valid handler.
7242
+ // Prefer this meeting as owner, but allow owner-less fallback when a stale
7243
+ // foreign owner tag is present on a disconnected session.
7244
+ refreshHandlerOwnerMeetingId = currentOwner && currentOwner !== this.id ? undefined : this.id;
7245
+ shouldAlignRefreshHandlerAfterOwnershipClaim = refreshHandlerOwnerMeetingId !== this.id; // @ts-ignore - Fix type
7246
+ this.webex.internal.llm.setRefreshHandler(function () {
7247
+ return _this36.refreshDataChannelToken();
7248
+ }, _constants.LLM_DEFAULT_SESSION, refreshHandlerOwnerMeetingId);
7249
+
7250
+ // @ts-ignore - Fix type
7251
+ return _context22.abrupt("return", this.webex.internal.llm.registerAndConnect(url, dataChannelUrl, datachannelToken).then(function (registerAndConnectResult) {
7252
+ _this36.locusInfo.syncAllHashTreeDatasets({
7253
+ onlyLLM: true
7254
+ });
7255
+ // Record ownership of the default LLM session for this meeting so
7256
+ // subsequent cross-meeting `updateLLMConnection` / `cleanupLLMConneciton`
7257
+ // calls can detect and skip work that doesn't belong to them.
7258
+ // @ts-ignore - Fix type
7259
+ var _this36$webex$interna = _this36.webex.internal.llm.resolveSessionOwnership(_this36.id, _constants.LLM_DEFAULT_SESSION),
7260
+ isOwner = _this36$webex$interna.isOwner;
7261
+ var canReclaimAfterDisconnectedStart = !wasConnected;
7262
+
7263
+ // Refresh handler is pre-bound before registerAndConnect so token
7264
+ // refresh can work even during the registration request itself.
7265
+ if (isOwner || canReclaimAfterDisconnectedStart) {
7266
+ var _this36$webex$interna2, _this36$webex$interna3;
7267
+ // Record ownership of the default LLM session for this meeting so
7268
+ // subsequent cross-meeting `updateLLMConnection` / `cleanupLLMConneciton`
7269
+ // calls can detect and skip work that doesn't belong to them.
7270
+ // @ts-ignore - Fix type
7271
+ (_this36$webex$interna2 = (_this36$webex$interna3 = _this36.webex.internal.llm).setOwnerMeetingId) === null || _this36$webex$interna2 === void 0 ? void 0 : _this36$webex$interna2.call(_this36$webex$interna3, _this36.id);
7272
+
7273
+ // If we pre-bound refresh ownerlessly (stale-owner reclaim path),
7274
+ // align the handler with the newly claimed owner immediately after
7275
+ // ownership is updated.
7276
+ if (shouldAlignRefreshHandlerAfterOwnershipClaim) {
7277
+ // @ts-ignore - Fix type
7278
+ _this36.webex.internal.llm.setRefreshHandler(function () {
7279
+ return _this36.refreshDataChannelToken();
7280
+ }, _constants.LLM_DEFAULT_SESSION, _this36.id);
7281
+ }
7282
+ }
6877
7283
  // @ts-ignore - Fix type
6878
7284
  _this36.webex.internal.llm.off('event:relay.event', _this36.processRelayEvent);
6879
7285
  // @ts-ignore - Fix type
@@ -6886,11 +7292,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6886
7292
  _this36.startLLMHealthCheckTimer();
6887
7293
  return _promise.default.resolve(registerAndConnectResult);
6888
7294
  }));
6889
- case 4:
7295
+ case 5:
6890
7296
  case "end":
6891
- return _context20.stop();
7297
+ return _context22.stop();
6892
7298
  }
6893
- }, _callee20, this);
7299
+ }, _callee22, this);
6894
7300
  }));
6895
7301
  function updateLLMConnection() {
6896
7302
  return _updateLLMConnection.apply(this, arguments);
@@ -7076,17 +7482,17 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7076
7482
  meetingId: this.id
7077
7483
  }
7078
7484
  });
7079
- this.locusInfo.once(_constants.LOCUSINFO.EVENTS.SELF_OBSERVING, /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee21() {
7080
- var mediaSettings, _t13;
7081
- return _regenerator.default.wrap(function (_context21) {
7082
- while (1) switch (_context21.prev = _context21.next) {
7485
+ this.locusInfo.once(_constants.LOCUSINFO.EVENTS.SELF_OBSERVING, /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee23() {
7486
+ var mediaSettings, _t15;
7487
+ return _regenerator.default.wrap(function (_context23) {
7488
+ while (1) switch (_context23.prev = _context23.next) {
7083
7489
  case 0:
7084
- _context21.prev = 0;
7490
+ _context23.prev = 0;
7085
7491
  if (!(_this40.screenShareFloorState === ScreenShareFloorStatus.GRANTED)) {
7086
- _context21.next = 1;
7492
+ _context23.next = 1;
7087
7493
  break;
7088
7494
  }
7089
- _context21.next = 1;
7495
+ _context23.next = 1;
7090
7496
  return _this40.releaseScreenShareFloor();
7091
7497
  case 1:
7092
7498
  mediaSettings = {
@@ -7105,23 +7511,23 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7105
7511
  // when a move to is intiated by the client , Locus delets the existing media node from the server as soon the device answers the meeting
7106
7512
  // once the device answers we close the old connection and create new media server connection with only share enabled
7107
7513
  if (!_this40.statsAnalyzer) {
7108
- _context21.next = 2;
7514
+ _context23.next = 2;
7109
7515
  break;
7110
7516
  }
7111
- _context21.next = 2;
7517
+ _context23.next = 2;
7112
7518
  return _this40.statsAnalyzer.stopAnalyzer();
7113
7519
  case 2:
7114
- _context21.next = 3;
7520
+ _context23.next = 3;
7115
7521
  return _this40.closeRemoteStreams();
7116
7522
  case 3:
7117
- _context21.next = 4;
7523
+ _context23.next = 4;
7118
7524
  return _this40.closePeerConnections();
7119
7525
  case 4:
7120
7526
  _this40.cleanupLocalStreams();
7121
7527
  _this40.unsetRemoteStreams();
7122
7528
  _this40.unsetPeerConnections();
7123
7529
  _this40.reconnectionManager.cleanUp();
7124
- _context21.next = 5;
7530
+ _context23.next = 5;
7125
7531
  return _this40.addMedia({
7126
7532
  audioEnabled: false,
7127
7533
  videoEnabled: false,
@@ -7130,24 +7536,24 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7130
7536
  case 5:
7131
7537
  _metrics.default.sendBehavioralMetric(_constants2.default.MOVE_TO_SUCCESS);
7132
7538
  _this40.isMoveToInProgress = false;
7133
- _context21.next = 7;
7539
+ _context23.next = 7;
7134
7540
  break;
7135
7541
  case 6:
7136
- _context21.prev = 6;
7137
- _t13 = _context21["catch"](0);
7138
- _loggerProxy.default.logger.error('Meeting:index#moveTo --> Failed to moveTo resourceId', _t13);
7542
+ _context23.prev = 6;
7543
+ _t15 = _context23["catch"](0);
7544
+ _loggerProxy.default.logger.error('Meeting:index#moveTo --> Failed to moveTo resourceId', _t15);
7139
7545
  _metrics.default.sendBehavioralMetric(_constants2.default.MOVE_TO_FAILURE, {
7140
7546
  correlation_id: _this40.correlationId,
7141
7547
  locus_id: _this40.locusUrl.split('/').pop(),
7142
- reason: _t13.message,
7143
- stack: _t13.stack
7548
+ reason: _t15.message,
7549
+ stack: _t15.stack
7144
7550
  });
7145
7551
  _this40.isMoveToInProgress = false;
7146
7552
  case 7:
7147
7553
  case "end":
7148
- return _context21.stop();
7554
+ return _context23.stop();
7149
7555
  }
7150
- }, _callee21, null, [[0, 6]]);
7556
+ }, _callee23, null, [[0, 6]]);
7151
7557
  })));
7152
7558
  _loggerProxy.default.logger.info('Meeting:index#moveTo --> Initated moved to using resourceId', resourceId);
7153
7559
 
@@ -7235,10 +7641,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7235
7641
  }, {
7236
7642
  key: "createMediaConnection",
7237
7643
  value: (function () {
7238
- var _createMediaConnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee22(turnServerInfo, bundlePolicy) {
7644
+ var _createMediaConnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee24(turnServerInfo, bundlePolicy) {
7239
7645
  var mc, audioEnabled, videoEnabled, shareEnabled;
7240
- return _regenerator.default.wrap(function (_context22) {
7241
- while (1) switch (_context22.prev = _context22.next) {
7646
+ return _regenerator.default.wrap(function (_context24) {
7647
+ while (1) switch (_context24.prev = _context24.next) {
7242
7648
  case 0:
7243
7649
  this.rtcMetrics = this.isMultistream ?
7244
7650
  // @ts-ignore
@@ -7264,6 +7670,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7264
7670
  disableAudioMainDtx: this.config.experimental.disableAudioMainDtx,
7265
7671
  // @ts-ignore - config coming from registerPlugin
7266
7672
  enableAudioTwcc: this.config.enableAudioTwccForMultistream,
7673
+ // @ts-ignore - config coming from registerPlugin
7674
+ enableAv1SlidesSupport: this.config.enableAv1SlidesSupport,
7267
7675
  stopIceGatheringAfterFirstRelayCandidate:
7268
7676
  // @ts-ignore - config coming from registerPlugin
7269
7677
  this.config.stopIceGatheringAfterFirstRelayCandidate
@@ -7280,42 +7688,42 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7280
7688
 
7281
7689
  // publish the streams
7282
7690
  if (!this.mediaProperties.audioStream) {
7283
- _context22.next = 1;
7691
+ _context24.next = 1;
7284
7692
  break;
7285
7693
  }
7286
7694
  this.setSendNamedMediaGroup(_internalMediaCore.MediaType.AudioMain);
7287
- _context22.next = 1;
7695
+ _context24.next = 1;
7288
7696
  return this.publishStream(_internalMediaCore.MediaType.AudioMain, this.mediaProperties.audioStream);
7289
7697
  case 1:
7290
7698
  if (!this.mediaProperties.videoStream) {
7291
- _context22.next = 2;
7699
+ _context24.next = 2;
7292
7700
  break;
7293
7701
  }
7294
- _context22.next = 2;
7702
+ _context24.next = 2;
7295
7703
  return this.publishStream(_internalMediaCore.MediaType.VideoMain, this.mediaProperties.videoStream);
7296
7704
  case 2:
7297
7705
  if (!this.mediaProperties.shareVideoStream) {
7298
- _context22.next = 3;
7706
+ _context24.next = 3;
7299
7707
  break;
7300
7708
  }
7301
- _context22.next = 3;
7709
+ _context24.next = 3;
7302
7710
  return this.publishStream(_internalMediaCore.MediaType.VideoSlides, this.mediaProperties.shareVideoStream);
7303
7711
  case 3:
7304
7712
  if (!(this.isMultistream && this.mediaProperties.shareAudioStream)) {
7305
- _context22.next = 4;
7713
+ _context24.next = 4;
7306
7714
  break;
7307
7715
  }
7308
- _context22.next = 4;
7716
+ _context24.next = 4;
7309
7717
  return this.publishStream(_internalMediaCore.MediaType.AudioSlides, this.mediaProperties.shareAudioStream);
7310
7718
  case 4:
7311
- return _context22.abrupt("return", mc);
7719
+ return _context24.abrupt("return", mc);
7312
7720
  case 5:
7313
7721
  case "end":
7314
- return _context22.stop();
7722
+ return _context24.stop();
7315
7723
  }
7316
- }, _callee22, this);
7724
+ }, _callee24, this);
7317
7725
  }));
7318
- function createMediaConnection(_x14, _x15) {
7726
+ function createMediaConnection(_x16, _x17) {
7319
7727
  return _createMediaConnection.apply(this, arguments);
7320
7728
  }
7321
7729
  return createMediaConnection;
@@ -7353,11 +7761,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7353
7761
  }, {
7354
7762
  key: "setUpLocalStreamReferences",
7355
7763
  value: (function () {
7356
- var _setUpLocalStreamReferences = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee23(localStreams) {
7764
+ var _setUpLocalStreamReferences = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee25(localStreams) {
7357
7765
  var _localStreams$microph, _localStreams$camera, _localStreams$screenS, _localStreams$screenS2, _localStreams$screenS3, _localStreams$screenS4, _localStreams$screenS5, _localStreams$screenS6;
7358
- var setUpStreamPromises, _t14;
7359
- return _regenerator.default.wrap(function (_context23) {
7360
- while (1) switch (_context23.prev = _context23.next) {
7766
+ var setUpStreamPromises, _t16;
7767
+ return _regenerator.default.wrap(function (_context25) {
7768
+ while (1) switch (_context25.prev = _context25.next) {
7361
7769
  case 0:
7362
7770
  setUpStreamPromises = [];
7363
7771
  if (localStreams !== null && localStreams !== void 0 && localStreams.microphone && (localStreams === null || localStreams === void 0 ? void 0 : (_localStreams$microph = localStreams.microphone) === null || _localStreams$microph === void 0 ? void 0 : _localStreams$microph.readyState) !== 'ended') {
@@ -7372,24 +7780,24 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7372
7780
  if (localStreams !== null && localStreams !== void 0 && (_localStreams$screenS4 = localStreams.screenShare) !== null && _localStreams$screenS4 !== void 0 && _localStreams$screenS4.audio && (localStreams === null || localStreams === void 0 ? void 0 : (_localStreams$screenS5 = localStreams.screenShare) === null || _localStreams$screenS5 === void 0 ? void 0 : (_localStreams$screenS6 = _localStreams$screenS5.audio) === null || _localStreams$screenS6 === void 0 ? void 0 : _localStreams$screenS6.readyState) !== 'ended') {
7373
7781
  setUpStreamPromises.push(this.setLocalShareAudioStream(localStreams.screenShare.audio));
7374
7782
  }
7375
- _context23.prev = 1;
7376
- _context23.next = 2;
7783
+ _context25.prev = 1;
7784
+ _context25.next = 2;
7377
7785
  return _promise.default.all(setUpStreamPromises);
7378
7786
  case 2:
7379
- _context23.next = 4;
7787
+ _context25.next = 4;
7380
7788
  break;
7381
7789
  case 3:
7382
- _context23.prev = 3;
7383
- _t14 = _context23["catch"](1);
7384
- _loggerProxy.default.logger.error("Meeting:index#addMedia():setUpLocalStreamReferences --> Error , ", _t14);
7385
- throw _t14;
7790
+ _context25.prev = 3;
7791
+ _t16 = _context25["catch"](1);
7792
+ _loggerProxy.default.logger.error("Meeting:index#addMedia():setUpLocalStreamReferences --> Error , ", _t16);
7793
+ throw _t16;
7386
7794
  case 4:
7387
7795
  case "end":
7388
- return _context23.stop();
7796
+ return _context25.stop();
7389
7797
  }
7390
- }, _callee23, this, [[1, 3]]);
7798
+ }, _callee25, this, [[1, 3]]);
7391
7799
  }));
7392
- function setUpLocalStreamReferences(_x16) {
7800
+ function setUpLocalStreamReferences(_x18) {
7393
7801
  return _setUpLocalStreamReferences.apply(this, arguments);
7394
7802
  }
7395
7803
  return setUpLocalStreamReferences;
@@ -7404,72 +7812,72 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7404
7812
  }, {
7405
7813
  key: "waitForMediaConnectionConnected",
7406
7814
  value: (function () {
7407
- var _waitForMediaConnectionConnected = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee24() {
7408
- var iceConnected, _this$mediaProperties9, _this$mediaProperties0, _this$mediaProperties1, _this$mediaProperties10, _this$mediaProperties11, _this$mediaProperties12, _this$mediaProperties13, timedOutError, _t15, _t16, _t17, _t18, _t19, _t20, _t21, _t22, _t23, _t24, _t25, _t26, _t27, _t28, _t29;
7409
- return _regenerator.default.wrap(function (_context24) {
7410
- while (1) switch (_context24.prev = _context24.next) {
7815
+ var _waitForMediaConnectionConnected = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee26() {
7816
+ var iceConnected, _this$mediaProperties9, _this$mediaProperties0, _this$mediaProperties1, _this$mediaProperties10, _this$mediaProperties11, _this$mediaProperties12, _this$mediaProperties13, timedOutError, _t17, _t18, _t19, _t20, _t21, _t22, _t23, _t24, _t25, _t26, _t27, _t28, _t29, _t30, _t31;
7817
+ return _regenerator.default.wrap(function (_context26) {
7818
+ while (1) switch (_context26.prev = _context26.next) {
7411
7819
  case 0:
7412
- _context24.prev = 0;
7413
- _context24.next = 1;
7820
+ _context26.prev = 0;
7821
+ _context26.next = 1;
7414
7822
  return this.mediaProperties.waitForMediaConnectionConnected(this.correlationId);
7415
7823
  case 1:
7416
- _context24.next = 5;
7824
+ _context26.next = 5;
7417
7825
  break;
7418
7826
  case 2:
7419
- _context24.prev = 2;
7420
- _t15 = _context24["catch"](0);
7421
- iceConnected = _t15.iceConnected;
7827
+ _context26.prev = 2;
7828
+ _t17 = _context26["catch"](0);
7829
+ iceConnected = _t17.iceConnected;
7422
7830
  if (this.hasMediaConnectionConnectedAtLeastOnce) {
7423
- _context24.next = 4;
7831
+ _context26.next = 4;
7424
7832
  break;
7425
7833
  }
7426
- _t16 = this.webex.internal.newMetrics;
7427
- _t17 = !this.turnServerUsed;
7428
- _t18 = this.addMediaData.icePhaseCallback();
7429
- _t19 = this.webex.internal.newMetrics.callDiagnosticMetrics;
7430
- _t20 = _internalPluginMetrics.CallDiagnosticUtils;
7431
- _t21 = ((_this$mediaProperties9 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties9 === void 0 ? void 0 : (_this$mediaProperties0 = _this$mediaProperties9.multistreamConnection) === null || _this$mediaProperties0 === void 0 ? void 0 : (_this$mediaProperties1 = _this$mediaProperties0.pc) === null || _this$mediaProperties1 === void 0 ? void 0 : (_this$mediaProperties10 = _this$mediaProperties1.pc) === null || _this$mediaProperties10 === void 0 ? void 0 : _this$mediaProperties10.signalingState) || ((_this$mediaProperties11 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties11 === void 0 ? void 0 : (_this$mediaProperties12 = _this$mediaProperties11.mediaConnection) === null || _this$mediaProperties12 === void 0 ? void 0 : (_this$mediaProperties13 = _this$mediaProperties12.pc) === null || _this$mediaProperties13 === void 0 ? void 0 : _this$mediaProperties13.signalingState) || 'unknown';
7432
- _t22 = iceConnected;
7433
- _t23 = this.turnServerUsed;
7434
- _context24.next = 3;
7834
+ _t18 = this.webex.internal.newMetrics;
7835
+ _t19 = !this.turnServerUsed;
7836
+ _t20 = this.addMediaData.icePhaseCallback();
7837
+ _t21 = this.webex.internal.newMetrics.callDiagnosticMetrics;
7838
+ _t22 = _internalPluginMetrics.CallDiagnosticUtils;
7839
+ _t23 = ((_this$mediaProperties9 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties9 === void 0 ? void 0 : (_this$mediaProperties0 = _this$mediaProperties9.multistreamConnection) === null || _this$mediaProperties0 === void 0 ? void 0 : (_this$mediaProperties1 = _this$mediaProperties0.pc) === null || _this$mediaProperties1 === void 0 ? void 0 : (_this$mediaProperties10 = _this$mediaProperties1.pc) === null || _this$mediaProperties10 === void 0 ? void 0 : _this$mediaProperties10.signalingState) || ((_this$mediaProperties11 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties11 === void 0 ? void 0 : (_this$mediaProperties12 = _this$mediaProperties11.mediaConnection) === null || _this$mediaProperties12 === void 0 ? void 0 : (_this$mediaProperties13 = _this$mediaProperties12.pc) === null || _this$mediaProperties13 === void 0 ? void 0 : _this$mediaProperties13.signalingState) || 'unknown';
7840
+ _t24 = iceConnected;
7841
+ _t25 = this.turnServerUsed;
7842
+ _context26.next = 3;
7435
7843
  return this.webex.meetings.reachability.isWebexMediaBackendUnreachable().catch(function () {
7436
7844
  return false;
7437
7845
  });
7438
7846
  case 3:
7439
- _t24 = _context24.sent;
7440
- _t25 = _t20.generateClientErrorCodeForIceFailure.call(_t20, {
7441
- signalingState: _t21,
7442
- iceConnected: _t22,
7443
- turnServerUsed: _t23,
7444
- unreachable: _t24
7847
+ _t26 = _context26.sent;
7848
+ _t27 = _t22.generateClientErrorCodeForIceFailure.call(_t22, {
7849
+ signalingState: _t23,
7850
+ iceConnected: _t24,
7851
+ turnServerUsed: _t25,
7852
+ unreachable: _t26
7445
7853
  });
7446
- _t26 = _t19.getErrorPayloadForClientErrorCode.call(_t19, {
7447
- clientErrorCode: _t25
7854
+ _t28 = _t21.getErrorPayloadForClientErrorCode.call(_t21, {
7855
+ clientErrorCode: _t27
7448
7856
  });
7449
- _t27 = [_t26];
7450
- _t28 = {
7451
- canProceed: _t17,
7452
- icePhase: _t18,
7453
- errors: _t27
7857
+ _t29 = [_t28];
7858
+ _t30 = {
7859
+ canProceed: _t19,
7860
+ icePhase: _t20,
7861
+ errors: _t29
7454
7862
  };
7455
- _t29 = {
7863
+ _t31 = {
7456
7864
  meetingId: this.id,
7457
- rawError: _t15
7865
+ rawError: _t17
7458
7866
  };
7459
- _t16.submitClientEvent.call(_t16, {
7867
+ _t18.submitClientEvent.call(_t18, {
7460
7868
  name: 'client.ice.end',
7461
- payload: _t28,
7462
- options: _t29
7869
+ payload: _t30,
7870
+ options: _t31
7463
7871
  });
7464
7872
  case 4:
7465
7873
  timedOutError = new Error("Timed out waiting for media connection to be connected, correlationId=".concat(this.correlationId));
7466
- timedOutError.cause = _t15;
7874
+ timedOutError.cause = _t17;
7467
7875
  throw timedOutError;
7468
7876
  case 5:
7469
7877
  case "end":
7470
- return _context24.stop();
7878
+ return _context26.stop();
7471
7879
  }
7472
- }, _callee24, this, [[0, 2]]);
7880
+ }, _callee26, this, [[0, 2]]);
7473
7881
  }));
7474
7882
  function waitForMediaConnectionConnected() {
7475
7883
  return _waitForMediaConnectionConnected.apply(this, arguments);
@@ -7536,19 +7944,19 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7536
7944
  }, {
7537
7945
  key: "waitForRemoteSDPAnswer",
7538
7946
  value: (function () {
7539
- var _waitForRemoteSDPAnswer = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee25() {
7947
+ var _waitForRemoteSDPAnswer = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee27() {
7540
7948
  var _this44 = this;
7541
7949
  var LOG_HEADER, deferSDPAnswer;
7542
- return _regenerator.default.wrap(function (_context25) {
7543
- while (1) switch (_context25.prev = _context25.next) {
7950
+ return _regenerator.default.wrap(function (_context27) {
7951
+ while (1) switch (_context27.prev = _context27.next) {
7544
7952
  case 0:
7545
7953
  LOG_HEADER = 'Meeting:index#addMedia():waitForRemoteSDPAnswer -->';
7546
7954
  if (this.deferSDPAnswer) {
7547
- _context25.next = 1;
7955
+ _context27.next = 1;
7548
7956
  break;
7549
7957
  }
7550
7958
  _loggerProxy.default.logger.warn("".concat(LOG_HEADER, " offer not created yet"));
7551
- return _context25.abrupt("return", _promise.default.reject(new Error('waitForRemoteSDPAnswer() called before local sdp offer created')));
7959
+ return _context27.abrupt("return", _promise.default.reject(new Error('waitForRemoteSDPAnswer() called before local sdp offer created')));
7552
7960
  case 1:
7553
7961
  deferSDPAnswer = this.deferSDPAnswer;
7554
7962
  this.sdpResponseTimer = setTimeout(function () {
@@ -7574,12 +7982,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7574
7982
  deferSDPAnswer.reject(error);
7575
7983
  }, _constants.ROAP_OFFER_ANSWER_EXCHANGE_TIMEOUT);
7576
7984
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " waiting for REMOTE SDP ANSWER..."));
7577
- return _context25.abrupt("return", deferSDPAnswer.promise);
7985
+ return _context27.abrupt("return", deferSDPAnswer.promise);
7578
7986
  case 2:
7579
7987
  case "end":
7580
- return _context25.stop();
7988
+ return _context27.stop();
7581
7989
  }
7582
- }, _callee25, this);
7990
+ }, _callee27, this);
7583
7991
  }));
7584
7992
  function waitForRemoteSDPAnswer() {
7585
7993
  return _waitForRemoteSDPAnswer.apply(this, arguments);
@@ -7598,30 +8006,30 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7598
8006
  }, {
7599
8007
  key: "retryEstablishMediaConnectionWithForcedTurnDiscovery",
7600
8008
  value: (function () {
7601
- var _retryEstablishMediaConnectionWithForcedTurnDiscovery = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee26(remoteMediaManagerConfig, bundlePolicy) {
7602
- var LOG_HEADER, _t30;
7603
- return _regenerator.default.wrap(function (_context26) {
7604
- while (1) switch (_context26.prev = _context26.next) {
8009
+ var _retryEstablishMediaConnectionWithForcedTurnDiscovery = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee28(remoteMediaManagerConfig, bundlePolicy) {
8010
+ var LOG_HEADER, _t32;
8011
+ return _regenerator.default.wrap(function (_context28) {
8012
+ while (1) switch (_context28.prev = _context28.next) {
7605
8013
  case 0:
7606
8014
  LOG_HEADER = 'Meeting:index#addMedia():retryEstablishMediaConnectionWithForcedTurnDiscovery -->';
7607
- _context26.prev = 1;
7608
- _context26.next = 2;
8015
+ _context28.prev = 1;
8016
+ _context28.next = 2;
7609
8017
  return this.establishMediaConnection(remoteMediaManagerConfig, bundlePolicy, true);
7610
8018
  case 2:
7611
- _context26.next = 4;
8019
+ _context28.next = 4;
7612
8020
  break;
7613
8021
  case 3:
7614
- _context26.prev = 3;
7615
- _t30 = _context26["catch"](1);
7616
- _loggerProxy.default.logger.error("".concat(LOG_HEADER, " retry with TURN-TLS failed, media connection unable to connect, "), _t30);
7617
- throw _t30;
8022
+ _context28.prev = 3;
8023
+ _t32 = _context28["catch"](1);
8024
+ _loggerProxy.default.logger.error("".concat(LOG_HEADER, " retry with TURN-TLS failed, media connection unable to connect, "), _t32);
8025
+ throw _t32;
7618
8026
  case 4:
7619
8027
  case "end":
7620
- return _context26.stop();
8028
+ return _context28.stop();
7621
8029
  }
7622
- }, _callee26, this, [[1, 3]]);
8030
+ }, _callee28, this, [[1, 3]]);
7623
8031
  }));
7624
- function retryEstablishMediaConnectionWithForcedTurnDiscovery(_x17, _x18) {
8032
+ function retryEstablishMediaConnectionWithForcedTurnDiscovery(_x19, _x20) {
7625
8033
  return _retryEstablishMediaConnectionWithForcedTurnDiscovery.apply(this, arguments);
7626
8034
  }
7627
8035
  return retryEstablishMediaConnectionWithForcedTurnDiscovery;
@@ -7639,14 +8047,14 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7639
8047
  }, {
7640
8048
  key: "retryWithForcedTurnDiscovery",
7641
8049
  value: (function () {
7642
- var _retryWithForcedTurnDiscovery = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee27(remoteMediaManagerConfig, bundlePolicy) {
8050
+ var _retryWithForcedTurnDiscovery = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee29(remoteMediaManagerConfig, bundlePolicy) {
7643
8051
  var LOG_HEADER;
7644
- return _regenerator.default.wrap(function (_context27) {
7645
- while (1) switch (_context27.prev = _context27.next) {
8052
+ return _regenerator.default.wrap(function (_context29) {
8053
+ while (1) switch (_context29.prev = _context29.next) {
7646
8054
  case 0:
7647
8055
  this.addMediaData.retriedWithTurnServer = true;
7648
8056
  LOG_HEADER = 'Meeting:index#addMedia():retryWithForcedTurnDiscovery -->';
7649
- _context27.next = 1;
8057
+ _context29.next = 1;
7650
8058
  return this.cleanUpBeforeRetryWithTurnServer();
7651
8059
  case 1:
7652
8060
  _metrics.default.sendBehavioralMetric(_constants2.default.ADD_MEDIA_RETRY, {
@@ -7656,24 +8064,24 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7656
8064
  reason: 'forcingTurnTls'
7657
8065
  });
7658
8066
  if (!(this.state === _constants.MEETING_STATE.STATES.LEFT)) {
7659
- _context27.next = 2;
8067
+ _context29.next = 2;
7660
8068
  break;
7661
8069
  }
7662
8070
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " meeting state was LEFT after first attempt to establish media connection. Attempting to rejoin. "));
7663
- _context27.next = 2;
8071
+ _context29.next = 2;
7664
8072
  return this.join({
7665
8073
  rejoin: true
7666
8074
  });
7667
8075
  case 2:
7668
- _context27.next = 3;
8076
+ _context29.next = 3;
7669
8077
  return this.retryEstablishMediaConnectionWithForcedTurnDiscovery(remoteMediaManagerConfig, bundlePolicy);
7670
8078
  case 3:
7671
8079
  case "end":
7672
- return _context27.stop();
8080
+ return _context29.stop();
7673
8081
  }
7674
- }, _callee27, this);
8082
+ }, _callee29, this);
7675
8083
  }));
7676
- function retryWithForcedTurnDiscovery(_x19, _x20) {
8084
+ function retryWithForcedTurnDiscovery(_x21, _x22) {
7677
8085
  return _retryWithForcedTurnDiscovery.apply(this, arguments);
7678
8086
  }
7679
8087
  return retryWithForcedTurnDiscovery;
@@ -7693,32 +8101,32 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7693
8101
  }, {
7694
8102
  key: "handleWaitForMediaConnectionConnectedError",
7695
8103
  value: (function () {
7696
- var _handleWaitForMediaConnectionConnectedError = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee28(error, remoteMediaManagerConfig, bundlePolicy) {
8104
+ var _handleWaitForMediaConnectionConnectedError = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee30(error, remoteMediaManagerConfig, bundlePolicy) {
7697
8105
  var LOG_HEADER;
7698
- return _regenerator.default.wrap(function (_context28) {
7699
- while (1) switch (_context28.prev = _context28.next) {
8106
+ return _regenerator.default.wrap(function (_context30) {
8107
+ while (1) switch (_context30.prev = _context30.next) {
7700
8108
  case 0:
7701
8109
  LOG_HEADER = 'Meeting:index#addMedia():handleWaitForMediaConnectionConnectedError -->'; // @ts-ignore - config coming from registerPlugin
7702
8110
  if (this.turnServerUsed) {
7703
- _context28.next = 2;
8111
+ _context30.next = 2;
7704
8112
  break;
7705
8113
  }
7706
8114
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " error waiting for media to connect on UDP, TCP, retrying using TURN-TLS, "), error);
7707
- _context28.next = 1;
8115
+ _context30.next = 1;
7708
8116
  return this.retryWithForcedTurnDiscovery(remoteMediaManagerConfig, bundlePolicy);
7709
8117
  case 1:
7710
- _context28.next = 3;
8118
+ _context30.next = 3;
7711
8119
  break;
7712
8120
  case 2:
7713
8121
  _loggerProxy.default.logger.error("".concat(LOG_HEADER, " error waiting for media to connect using UDP, TCP and TURN-TLS"), error);
7714
8122
  throw new _webexErrors.AddMediaFailed(error);
7715
8123
  case 3:
7716
8124
  case "end":
7717
- return _context28.stop();
8125
+ return _context30.stop();
7718
8126
  }
7719
- }, _callee28, this);
8127
+ }, _callee30, this);
7720
8128
  }));
7721
- function handleWaitForMediaConnectionConnectedError(_x21, _x22, _x23) {
8129
+ function handleWaitForMediaConnectionConnectedError(_x23, _x24, _x25) {
7722
8130
  return _handleWaitForMediaConnectionConnectedError.apply(this, arguments);
7723
8131
  }
7724
8132
  return handleWaitForMediaConnectionConnectedError;
@@ -7734,20 +8142,20 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7734
8142
  }, {
7735
8143
  key: "doTurnDiscovery",
7736
8144
  value: (function () {
7737
- var _doTurnDiscovery = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee29(isReconnecting, isForced) {
8145
+ var _doTurnDiscovery = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee31(isReconnecting, isForced) {
7738
8146
  var cdl, turnDiscoveryResult;
7739
- return _regenerator.default.wrap(function (_context29) {
7740
- while (1) switch (_context29.prev = _context29.next) {
8147
+ return _regenerator.default.wrap(function (_context31) {
8148
+ while (1) switch (_context31.prev = _context31.next) {
7741
8149
  case 0:
7742
8150
  // @ts-ignore
7743
8151
  cdl = this.webex.internal.newMetrics.callDiagnosticLatencies; // @ts-ignore
7744
8152
  this.webex.internal.newMetrics.submitInternalEvent({
7745
8153
  name: 'internal.client.add-media.turn-discovery.start'
7746
8154
  });
7747
- _context29.next = 1;
8155
+ _context31.next = 1;
7748
8156
  return this.roap.doTurnDiscovery(this, isReconnecting, isForced);
7749
8157
  case 1:
7750
- turnDiscoveryResult = _context29.sent;
8158
+ turnDiscoveryResult = _context31.sent;
7751
8159
  this.turnDiscoverySkippedReason = turnDiscoveryResult === null || turnDiscoveryResult === void 0 ? void 0 : turnDiscoveryResult.turnDiscoverySkippedReason;
7752
8160
  this.turnServerUsed = !this.turnDiscoverySkippedReason;
7753
8161
 
@@ -7763,14 +8171,14 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7763
8171
  retriedWithTurnServer: this.addMediaData.retriedWithTurnServer
7764
8172
  });
7765
8173
  }
7766
- return _context29.abrupt("return", turnDiscoveryResult);
8174
+ return _context31.abrupt("return", turnDiscoveryResult);
7767
8175
  case 2:
7768
8176
  case "end":
7769
- return _context29.stop();
8177
+ return _context31.stop();
7770
8178
  }
7771
- }, _callee29, this);
8179
+ }, _callee31, this);
7772
8180
  }));
7773
- function doTurnDiscovery(_x24, _x25) {
8181
+ function doTurnDiscovery(_x26, _x27) {
7774
8182
  return _doTurnDiscovery.apply(this, arguments);
7775
8183
  }
7776
8184
  return doTurnDiscovery;
@@ -7789,35 +8197,35 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7789
8197
  }, {
7790
8198
  key: "establishMediaConnection",
7791
8199
  value: (function () {
7792
- var _establishMediaConnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee30(remoteMediaManagerConfig, bundlePolicy, isForced, turnServerInfo) {
8200
+ var _establishMediaConnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee32(remoteMediaManagerConfig, bundlePolicy, isForced, turnServerInfo) {
7793
8201
  var _this$locusMediaReque;
7794
- var LOG_HEADER, isReconnecting, _yield$this$doTurnDis, mc, _t31, _t32;
7795
- return _regenerator.default.wrap(function (_context30) {
7796
- while (1) switch (_context30.prev = _context30.next) {
8202
+ var LOG_HEADER, isReconnecting, _yield$this$doTurnDis, mc, _t33, _t34;
8203
+ return _regenerator.default.wrap(function (_context32) {
8204
+ while (1) switch (_context32.prev = _context32.next) {
7797
8205
  case 0:
7798
8206
  LOG_HEADER = 'Meeting:index#addMedia():establishMediaConnection -->';
7799
8207
  isReconnecting = this.isMoveToInProgress || !!((_this$locusMediaReque = this.locusMediaRequest) !== null && _this$locusMediaReque !== void 0 && _this$locusMediaReque.isConfluenceCreated()); // We are forcing turn discovery if the case is moveTo and a turn server was used already
7800
8208
  if (this.isMoveToInProgress && this.turnServerUsed) {
7801
8209
  isForced = true;
7802
8210
  }
7803
- _context30.prev = 1;
8211
+ _context32.prev = 1;
7804
8212
  if (turnServerInfo) {
7805
- _context30.next = 3;
8213
+ _context32.next = 3;
7806
8214
  break;
7807
8215
  }
7808
- _context30.next = 2;
8216
+ _context32.next = 2;
7809
8217
  return this.doTurnDiscovery(isReconnecting, isForced);
7810
8218
  case 2:
7811
- _yield$this$doTurnDis = _context30.sent;
8219
+ _yield$this$doTurnDis = _context32.sent;
7812
8220
  turnServerInfo = _yield$this$doTurnDis.turnServerInfo;
7813
8221
  case 3:
7814
- _context30.next = 4;
8222
+ _context32.next = 4;
7815
8223
  return this.createMediaConnection(turnServerInfo, bundlePolicy);
7816
8224
  case 4:
7817
- mc = _context30.sent;
8225
+ mc = _context32.sent;
7818
8226
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " media connection created this.isMultistream=").concat(this.isMultistream));
7819
8227
  if (!this.isMultistream) {
7820
- _context30.next = 5;
8228
+ _context32.next = 5;
7821
8229
  break;
7822
8230
  }
7823
8231
  this.remoteMediaManager = new _remoteMediaManager.RemoteMediaManager(this.receiveSlotManager, this.mediaRequestManagers, remoteMediaManagerConfig);
@@ -7825,42 +8233,42 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7825
8233
  this.forwardEvent(this.remoteMediaManager, _remoteMediaManager.Event.InterpretationAudioCreated, _constants.EVENT_TRIGGERS.REMOTE_MEDIA_INTERPRETATION_AUDIO_CREATED);
7826
8234
  this.forwardEvent(this.remoteMediaManager, _remoteMediaManager.Event.ScreenShareAudioCreated, _constants.EVENT_TRIGGERS.REMOTE_MEDIA_SCREEN_SHARE_AUDIO_CREATED);
7827
8235
  this.forwardEvent(this.remoteMediaManager, _remoteMediaManager.Event.VideoLayoutChanged, _constants.EVENT_TRIGGERS.REMOTE_MEDIA_VIDEO_LAYOUT_CHANGED);
7828
- _context30.next = 5;
8236
+ _context32.next = 5;
7829
8237
  return this.remoteMediaManager.start();
7830
8238
  case 5:
7831
- _context30.next = 6;
8239
+ _context32.next = 6;
7832
8240
  return mc.initiateOffer();
7833
8241
  case 6:
7834
- _context30.next = 7;
8242
+ _context32.next = 7;
7835
8243
  return this.waitForRemoteSDPAnswer();
7836
8244
  case 7:
7837
8245
  this.handleMediaLogging(this.mediaProperties);
7838
- _context30.next = 9;
8246
+ _context32.next = 9;
7839
8247
  break;
7840
8248
  case 8:
7841
- _context30.prev = 8;
7842
- _t31 = _context30["catch"](1);
7843
- _loggerProxy.default.logger.error("".concat(LOG_HEADER, " error establishing media connection, "), _t31);
7844
- throw _t31;
8249
+ _context32.prev = 8;
8250
+ _t33 = _context32["catch"](1);
8251
+ _loggerProxy.default.logger.error("".concat(LOG_HEADER, " error establishing media connection, "), _t33);
8252
+ throw _t33;
7845
8253
  case 9:
7846
- _context30.prev = 9;
7847
- _context30.next = 10;
8254
+ _context32.prev = 9;
8255
+ _context32.next = 10;
7848
8256
  return this.waitForMediaConnectionConnected();
7849
8257
  case 10:
7850
- _context30.next = 12;
8258
+ _context32.next = 12;
7851
8259
  break;
7852
8260
  case 11:
7853
- _context30.prev = 11;
7854
- _t32 = _context30["catch"](9);
7855
- _context30.next = 12;
7856
- return this.handleWaitForMediaConnectionConnectedError(_t32, remoteMediaManagerConfig, bundlePolicy);
8261
+ _context32.prev = 11;
8262
+ _t34 = _context32["catch"](9);
8263
+ _context32.next = 12;
8264
+ return this.handleWaitForMediaConnectionConnectedError(_t34, remoteMediaManagerConfig, bundlePolicy);
7857
8265
  case 12:
7858
8266
  case "end":
7859
- return _context30.stop();
8267
+ return _context32.stop();
7860
8268
  }
7861
- }, _callee30, this, [[1, 8], [9, 11]]);
8269
+ }, _callee32, this, [[1, 8], [9, 11]]);
7862
8270
  }));
7863
- function establishMediaConnection(_x26, _x27, _x28, _x29) {
8271
+ function establishMediaConnection(_x28, _x29, _x30, _x31) {
7864
8272
  return _establishMediaConnection.apply(this, arguments);
7865
8273
  }
7866
8274
  return establishMediaConnection;
@@ -7875,16 +8283,16 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7875
8283
  }, {
7876
8284
  key: "cleanUpOnAddMediaFailure",
7877
8285
  value: (function () {
7878
- var _cleanUpOnAddMediaFailure = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee31() {
8286
+ var _cleanUpOnAddMediaFailure = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee33() {
7879
8287
  var _this$networkQualityM, _this$statsMonitor;
7880
- return _regenerator.default.wrap(function (_context31) {
7881
- while (1) switch (_context31.prev = _context31.next) {
8288
+ return _regenerator.default.wrap(function (_context33) {
8289
+ while (1) switch (_context33.prev = _context33.next) {
7882
8290
  case 0:
7883
8291
  if (!this.statsAnalyzer) {
7884
- _context31.next = 1;
8292
+ _context33.next = 1;
7885
8293
  break;
7886
8294
  }
7887
- _context31.next = 1;
8295
+ _context33.next = 1;
7888
8296
  return this.statsAnalyzer.stopAnalyzer();
7889
8297
  case 1:
7890
8298
  this.statsAnalyzer = null;
@@ -7895,7 +8303,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7895
8303
 
7896
8304
  // when media fails, we want to upload a webrtc dump to see whats going on
7897
8305
  // this function is async, but returns once the stats have been gathered
7898
- _context31.next = 2;
8306
+ _context33.next = 2;
7899
8307
  return this.forceSendStatsReport({
7900
8308
  callFrom: 'addMedia'
7901
8309
  });
@@ -7906,9 +8314,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7906
8314
  }
7907
8315
  case 3:
7908
8316
  case "end":
7909
- return _context31.stop();
8317
+ return _context33.stop();
7910
8318
  }
7911
- }, _callee31, this);
8319
+ }, _callee33, this);
7912
8320
  }));
7913
8321
  function cleanUpOnAddMediaFailure() {
7914
8322
  return _cleanUpOnAddMediaFailure.apply(this, arguments);
@@ -7926,16 +8334,16 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7926
8334
  }, {
7927
8335
  key: "downgradeFromMultistreamToTranscoded",
7928
8336
  value: (function () {
7929
- var _downgradeFromMultistreamToTranscoded = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee32() {
8337
+ var _downgradeFromMultistreamToTranscoded = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee34() {
7930
8338
  var _this$networkQualityM2, _this$statsMonitor2, _this$locusMediaReque2;
7931
- return _regenerator.default.wrap(function (_context32) {
7932
- while (1) switch (_context32.prev = _context32.next) {
8339
+ return _regenerator.default.wrap(function (_context34) {
8340
+ while (1) switch (_context34.prev = _context34.next) {
7933
8341
  case 0:
7934
8342
  if (!this.statsAnalyzer) {
7935
- _context32.next = 1;
8343
+ _context34.next = 1;
7936
8344
  break;
7937
8345
  }
7938
- _context32.next = 1;
8346
+ _context34.next = 1;
7939
8347
  return this.statsAnalyzer.stopAnalyzer();
7940
8348
  case 1:
7941
8349
  this.statsAnalyzer = null;
@@ -7953,9 +8361,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7953
8361
  this.createStatsAnalyzer();
7954
8362
  case 2:
7955
8363
  case "end":
7956
- return _context32.stop();
8364
+ return _context34.stop();
7957
8365
  }
7958
- }, _callee32, this);
8366
+ }, _callee34, this);
7959
8367
  }));
7960
8368
  function downgradeFromMultistreamToTranscoded() {
7961
8369
  return _downgradeFromMultistreamToTranscoded.apply(this, arguments);
@@ -7973,11 +8381,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7973
8381
  }, {
7974
8382
  key: "cleanUpBeforeRetryWithTurnServer",
7975
8383
  value: (function () {
7976
- var _cleanUpBeforeRetryWithTurnServer = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee33() {
7977
- return _regenerator.default.wrap(function (_context33) {
7978
- while (1) switch (_context33.prev = _context33.next) {
8384
+ var _cleanUpBeforeRetryWithTurnServer = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee35() {
8385
+ return _regenerator.default.wrap(function (_context35) {
8386
+ while (1) switch (_context35.prev = _context35.next) {
7979
8387
  case 0:
7980
- _context33.next = 1;
8388
+ _context35.next = 1;
7981
8389
  return this.forceSendStatsReport({
7982
8390
  callFrom: 'cleanUpBeforeRetryWithTurnServer'
7983
8391
  });
@@ -7997,9 +8405,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7997
8405
  }
7998
8406
  case 2:
7999
8407
  case "end":
8000
- return _context33.stop();
8408
+ return _context35.stop();
8001
8409
  }
8002
- }, _callee33, this);
8410
+ }, _callee35, this);
8003
8411
  }));
8004
8412
  function cleanUpBeforeRetryWithTurnServer() {
8005
8413
  return _cleanUpBeforeRetryWithTurnServer.apply(this, arguments);
@@ -8009,35 +8417,35 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8009
8417
  }, {
8010
8418
  key: "cleanUpBeforeReconnection",
8011
8419
  value: function () {
8012
- var _cleanUpBeforeReconnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee34() {
8013
- var _t33;
8014
- return _regenerator.default.wrap(function (_context34) {
8015
- while (1) switch (_context34.prev = _context34.next) {
8420
+ var _cleanUpBeforeReconnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee36() {
8421
+ var _t35;
8422
+ return _regenerator.default.wrap(function (_context36) {
8423
+ while (1) switch (_context36.prev = _context36.next) {
8016
8424
  case 0:
8017
- _context34.prev = 0;
8018
- _context34.next = 1;
8425
+ _context36.prev = 0;
8426
+ _context36.next = 1;
8019
8427
  return this.forceSendStatsReport({
8020
8428
  callFrom: 'cleanUpBeforeReconnection'
8021
8429
  });
8022
8430
  case 1:
8023
8431
  if (!this.statsAnalyzer) {
8024
- _context34.next = 2;
8432
+ _context36.next = 2;
8025
8433
  break;
8026
8434
  }
8027
- _context34.next = 2;
8435
+ _context36.next = 2;
8028
8436
  return this.statsAnalyzer.stopAnalyzer();
8029
8437
  case 2:
8030
- _context34.next = 4;
8438
+ _context36.next = 4;
8031
8439
  break;
8032
8440
  case 3:
8033
- _context34.prev = 3;
8034
- _t33 = _context34["catch"](0);
8035
- _loggerProxy.default.logger.error('Meeting:index#cleanUpBeforeReconnection --> Error during cleanup: ', _t33);
8441
+ _context36.prev = 3;
8442
+ _t35 = _context36["catch"](0);
8443
+ _loggerProxy.default.logger.error('Meeting:index#cleanUpBeforeReconnection --> Error during cleanup: ', _t35);
8036
8444
  case 4:
8037
8445
  case "end":
8038
- return _context34.stop();
8446
+ return _context36.stop();
8039
8447
  }
8040
- }, _callee34, this, [[0, 3]]);
8448
+ }, _callee36, this, [[0, 3]]);
8041
8449
  }));
8042
8450
  function cleanUpBeforeReconnection() {
8043
8451
  return _cleanUpBeforeReconnection.apply(this, arguments);
@@ -8053,7 +8461,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8053
8461
  }, {
8054
8462
  key: "setupLocusMediaRequest",
8055
8463
  value: function setupLocusMediaRequest() {
8056
- var _this$webex$meetings$2, _this$webex$meetings$3;
8464
+ var _this$webex$meetings$2,
8465
+ _this$webex$meetings$3,
8466
+ _this45 = this;
8057
8467
  this.locusMediaRequest = new _locusMediaRequest.LocusMediaRequest({
8058
8468
  correlationId: this.correlationId,
8059
8469
  meetingId: this.id,
@@ -8066,13 +8476,42 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8066
8476
  // @ts-ignore
8067
8477
  regionCode: (_this$webex$meetings$3 = this.webex.meetings.geoHintInfo) === null || _this$webex$meetings$3 === void 0 ? void 0 : _this$webex$meetings$3.regionCode
8068
8478
  },
8069
- preferTranscoding: !this.isMultistream
8479
+ preferTranscoding: !this.isMultistream,
8480
+ getCurrentSelfUrl: function getCurrentSelfUrl() {
8481
+ return _this45.selfUrl;
8482
+ },
8483
+ waitForSelfUrlChange: function waitForSelfUrlChange() {
8484
+ return _this45.waitForSelfUrlChange();
8485
+ }
8070
8486
  }, {
8071
8487
  // @ts-ignore
8072
8488
  parent: this.webex
8073
8489
  });
8074
8490
  }
8075
8491
 
8492
+ /**
8493
+ * Waits for LocusInfo to update meeting.selfUrl, with a timeout fallback.
8494
+ * @returns {Promise<void>}
8495
+ * @private
8496
+ * @memberof Meeting
8497
+ */
8498
+ }, {
8499
+ key: "waitForSelfUrlChange",
8500
+ value: function waitForSelfUrlChange() {
8501
+ var _this46 = this;
8502
+ if (!this.promisesWaitingForPropUpdate.selfUrl) {
8503
+ var pendingSelfUrlUpdate = new _common.Defer();
8504
+ this.promisesWaitingForPropUpdate.selfUrl = pendingSelfUrlUpdate;
8505
+ setTimeout(function () {
8506
+ if (_this46.promisesWaitingForPropUpdate.selfUrl === pendingSelfUrlUpdate) {
8507
+ delete _this46.promisesWaitingForPropUpdate.selfUrl;
8508
+ pendingSelfUrlUpdate.resolve();
8509
+ }
8510
+ }, 5000);
8511
+ }
8512
+ return this.promisesWaitingForPropUpdate.selfUrl.promise;
8513
+ }
8514
+
8076
8515
  /**
8077
8516
  * Creates a media connection to the server. Media connection is required for sending or receiving any audio/video.
8078
8517
  *
@@ -8084,10 +8523,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8084
8523
  }, {
8085
8524
  key: "addMedia",
8086
8525
  value: function addMedia() {
8087
- var _this45 = this;
8526
+ var _this47 = this;
8088
8527
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
8089
8528
  return this.addMediaInternal(function () {
8090
- return _this45.turnServerUsed ? 'JOIN_MEETING_FINAL' : 'JOIN_MEETING_RETRY';
8529
+ return _this47.turnServerUsed ? 'JOIN_MEETING_FINAL' : 'JOIN_MEETING_RETRY';
8091
8530
  }, undefined, false, options);
8092
8531
  }
8093
8532
 
@@ -8105,7 +8544,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8105
8544
  }, {
8106
8545
  key: "addMediaInternal",
8107
8546
  value: (function () {
8108
- var _addMediaInternal = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee35(icePhaseCallback, turnServerInfo, forceTurnDiscovery) {
8547
+ var _addMediaInternal = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee37(icePhaseCallback, turnServerInfo, forceTurnDiscovery) {
8109
8548
  var options,
8110
8549
  LOG_HEADER,
8111
8550
  localStreams,
@@ -8167,26 +8606,26 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8167
8606
  _selectedCandidatePairChanges,
8168
8607
  _numTransports,
8169
8608
  _iceCandidateErrors,
8170
- _args35 = arguments,
8171
- _t34,
8172
- _t35;
8173
- return _regenerator.default.wrap(function (_context35) {
8174
- while (1) switch (_context35.prev = _context35.next) {
8609
+ _args37 = arguments,
8610
+ _t36,
8611
+ _t37;
8612
+ return _regenerator.default.wrap(function (_context37) {
8613
+ while (1) switch (_context37.prev = _context37.next) {
8175
8614
  case 0:
8176
- options = _args35.length > 3 && _args35[3] !== undefined ? _args35[3] : {};
8615
+ options = _args37.length > 3 && _args37[3] !== undefined ? _args37[3] : {};
8177
8616
  this.addMediaData.retriedWithTurnServer = false;
8178
8617
  this.addMediaData.icePhaseCallback = icePhaseCallback;
8179
8618
  this.hasMediaConnectionConnectedAtLeastOnce = false;
8180
8619
  LOG_HEADER = 'Meeting:index#addMedia -->';
8181
8620
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " called with: options=").concat((0, _stringify.default)(options), ", turnServerInfo=").concat((0, _stringify.default)(turnServerInfo), ", forceTurnDiscovery=").concat(forceTurnDiscovery));
8182
8621
  if (!(options.allowMediaInLobby !== true && this.meetingState !== _constants.FULL_STATE.ACTIVE)) {
8183
- _context35.next = 1;
8622
+ _context37.next = 1;
8184
8623
  break;
8185
8624
  }
8186
8625
  throw new _webexErrors.MeetingNotActiveError();
8187
8626
  case 1:
8188
8627
  if (!_util2.default.isUserInLeftState(this.locusInfo)) {
8189
- _context35.next = 2;
8628
+ _context37.next = 2;
8190
8629
  break;
8191
8630
  }
8192
8631
  throw new _webexErrors.UserNotJoinedError();
@@ -8203,7 +8642,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8203
8642
  ipver = _util2.default.getIpVersion(this.webex); // used just for metrics
8204
8643
  // If the user is unjoined or guest waiting in lobby dont allow the user to addMedia
8205
8644
  if (!(this.isUserUnadmitted && !this.wirelessShare && !this.allowMediaInLobby)) {
8206
- _context35.next = 3;
8645
+ _context37.next = 3;
8207
8646
  break;
8208
8647
  }
8209
8648
  throw new _webexErrors.UserInLobbyError();
@@ -8247,62 +8686,62 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8247
8686
  this.audio = (0, _muteState.createMuteState)(_constants.AUDIO, this, audioEnabled);
8248
8687
  this.video = (0, _muteState.createMuteState)(_constants.VIDEO, this, videoEnabled);
8249
8688
  this.brbState = (0, _brbState.createBrbState)(this, false);
8250
- _context35.prev = 4;
8689
+ _context37.prev = 4;
8251
8690
  if (!(allowPublishMediaInLobby || !this.isUserUnadmitted)) {
8252
- _context35.next = 5;
8691
+ _context37.next = 5;
8253
8692
  break;
8254
8693
  }
8255
- _context35.next = 5;
8694
+ _context37.next = 5;
8256
8695
  return this.setUpLocalStreamReferences(localStreams);
8257
8696
  case 5:
8258
8697
  this.setMercuryListener();
8259
8698
  this.createStatsAnalyzer();
8260
- _context35.prev = 6;
8261
- _context35.next = 7;
8699
+ _context37.prev = 6;
8700
+ _context37.next = 7;
8262
8701
  return this.establishMediaConnection(remoteMediaManagerConfig, bundlePolicy, forceTurnDiscovery, turnServerInfo);
8263
8702
  case 7:
8264
- _context35.next = 12;
8703
+ _context37.next = 12;
8265
8704
  break;
8266
8705
  case 8:
8267
- _context35.prev = 8;
8268
- _t34 = _context35["catch"](6);
8269
- if (!(_t34 instanceof _multistreamNotSupportedError.default)) {
8270
- _context35.next = 11;
8706
+ _context37.prev = 8;
8707
+ _t36 = _context37["catch"](6);
8708
+ if (!(_t36 instanceof _multistreamNotSupportedError.default)) {
8709
+ _context37.next = 11;
8271
8710
  break;
8272
8711
  }
8273
8712
  _loggerProxy.default.logger.warn("".concat(LOG_HEADER, " we asked for multistream backend (Homer), but got transcoded backend, recreating media connection..."));
8274
- _context35.next = 9;
8713
+ _context37.next = 9;
8275
8714
  return this.downgradeFromMultistreamToTranscoded();
8276
8715
  case 9:
8277
- _context35.next = 10;
8716
+ _context37.next = 10;
8278
8717
  return this.establishMediaConnection(remoteMediaManagerConfig, bundlePolicy, true, undefined);
8279
8718
  case 10:
8280
- _context35.next = 12;
8719
+ _context37.next = 12;
8281
8720
  break;
8282
8721
  case 11:
8283
- throw _t34;
8722
+ throw _t36;
8284
8723
  case 12:
8285
8724
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " media connected, finalizing..."));
8286
8725
  if (!this.mediaProperties.hasLocalShareStream()) {
8287
- _context35.next = 13;
8726
+ _context37.next = 13;
8288
8727
  break;
8289
8728
  }
8290
- _context35.next = 13;
8729
+ _context37.next = 13;
8291
8730
  return this.enqueueScreenShareFloorRequest();
8292
8731
  case 13:
8293
- _context35.next = 14;
8732
+ _context37.next = 14;
8294
8733
  return this.mediaProperties.getCurrentConnectionInfo();
8295
8734
  case 14:
8296
- _yield$this$mediaProp = _context35.sent;
8735
+ _yield$this$mediaProp = _context37.sent;
8297
8736
  connectionType = _yield$this$mediaProp.connectionType;
8298
8737
  ipVersion = _yield$this$mediaProp.ipVersion;
8299
8738
  selectedCandidatePairChanges = _yield$this$mediaProp.selectedCandidatePairChanges;
8300
8739
  numTransports = _yield$this$mediaProp.numTransports;
8301
8740
  iceCandidateErrors = Object.fromEntries(this.iceCandidateErrors);
8302
- _context35.next = 15;
8741
+ _context37.next = 15;
8303
8742
  return this.getMediaReachabilityMetricFields();
8304
8743
  case 15:
8305
- reachabilityMetrics = _context35.sent;
8744
+ reachabilityMetrics = _context37.sent;
8306
8745
  _metrics.default.sendBehavioralMetric(_constants2.default.ADD_MEDIA_SUCCESS, _objectSpread(_objectSpread(_objectSpread({
8307
8746
  correlation_id: this.correlationId,
8308
8747
  locus_id: this.locusUrl.split('/').pop(),
@@ -8313,7 +8752,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8313
8752
  numTransports: numTransports,
8314
8753
  isMultistream: this.isMultistream,
8315
8754
  retriedWithTurnServer: this.addMediaData.retriedWithTurnServer,
8316
- isJoinWithMediaRetry: this.joinWithMediaRetryInfo.isRetry
8755
+ isJoinWithMediaRetry: this.joinWithMediaRetryInfo.retryCount > 0
8317
8756
  }, reachabilityMetrics), iceCandidateErrors), {}, {
8318
8757
  iceCandidatesCount: this.iceCandidatesCount
8319
8758
  }));
@@ -8332,38 +8771,38 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8332
8771
  // We can log ReceiveSlot SSRCs only after the SDP exchange, so doing it here:
8333
8772
  (_this$remoteMediaMana = this.remoteMediaManager) === null || _this$remoteMediaMana === void 0 ? void 0 : _this$remoteMediaMana.logAllReceiveSlots();
8334
8773
  this.startPeriodicLogUpload();
8335
- _context35.next = 20;
8774
+ _context37.next = 20;
8336
8775
  break;
8337
8776
  case 16:
8338
- _context35.prev = 16;
8339
- _t35 = _context35["catch"](4);
8340
- _loggerProxy.default.logger.error("".concat(LOG_HEADER, " failed to establish media connection: "), _t35);
8777
+ _context37.prev = 16;
8778
+ _t37 = _context37["catch"](4);
8779
+ _loggerProxy.default.logger.error("".concat(LOG_HEADER, " failed to establish media connection: "), _t37);
8341
8780
 
8342
8781
  // @ts-ignore
8343
- _context35.next = 17;
8782
+ _context37.next = 17;
8344
8783
  return this.getMediaReachabilityMetricFields();
8345
8784
  case 17:
8346
- _reachabilityMetrics = _context35.sent;
8347
- _context35.next = 18;
8785
+ _reachabilityMetrics = _context37.sent;
8786
+ _context37.next = 18;
8348
8787
  return this.mediaProperties.getCurrentConnectionInfo();
8349
8788
  case 18:
8350
- _yield$this$mediaProp2 = _context35.sent;
8789
+ _yield$this$mediaProp2 = _context37.sent;
8351
8790
  _selectedCandidatePairChanges = _yield$this$mediaProp2.selectedCandidatePairChanges;
8352
8791
  _numTransports = _yield$this$mediaProp2.numTransports;
8353
8792
  _iceCandidateErrors = Object.fromEntries(this.iceCandidateErrors);
8354
8793
  _metrics.default.sendBehavioralMetric(_constants2.default.ADD_MEDIA_FAILURE, _objectSpread(_objectSpread(_objectSpread({
8355
8794
  correlation_id: this.correlationId,
8356
8795
  locus_id: this.locusUrl.split('/').pop(),
8357
- reason: _t35.message,
8358
- stack: _t35.stack,
8359
- code: _t35.code,
8796
+ reason: _t37.message,
8797
+ stack: _t37.stack,
8798
+ code: _t37.code,
8360
8799
  selectedCandidatePairChanges: _selectedCandidatePairChanges,
8361
8800
  numTransports: _numTransports,
8362
8801
  turnDiscoverySkippedReason: this.turnDiscoverySkippedReason,
8363
8802
  turnServerUsed: this.turnServerUsed,
8364
8803
  retriedWithTurnServer: this.addMediaData.retriedWithTurnServer,
8365
8804
  isMultistream: this.isMultistream,
8366
- isJoinWithMediaRetry: this.joinWithMediaRetryInfo.isRetry,
8805
+ isJoinWithMediaRetry: this.joinWithMediaRetryInfo.retryCount > 0,
8367
8806
  signalingState: ((_this$mediaProperties14 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties14 === void 0 ? void 0 : (_this$mediaProperties15 = _this$mediaProperties14.multistreamConnection) === null || _this$mediaProperties15 === void 0 ? void 0 : (_this$mediaProperties16 = _this$mediaProperties15.pc) === null || _this$mediaProperties16 === void 0 ? void 0 : (_this$mediaProperties17 = _this$mediaProperties16.pc) === null || _this$mediaProperties17 === void 0 ? void 0 : _this$mediaProperties17.signalingState) || ((_this$mediaProperties18 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties18 === void 0 ? void 0 : (_this$mediaProperties19 = _this$mediaProperties18.mediaConnection) === null || _this$mediaProperties19 === void 0 ? void 0 : (_this$mediaProperties20 = _this$mediaProperties19.pc) === null || _this$mediaProperties20 === void 0 ? void 0 : _this$mediaProperties20.signalingState) || 'unknown',
8368
8807
  connectionState: ((_this$mediaProperties21 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties21 === void 0 ? void 0 : (_this$mediaProperties22 = _this$mediaProperties21.multistreamConnection) === null || _this$mediaProperties22 === void 0 ? void 0 : (_this$mediaProperties23 = _this$mediaProperties22.pc) === null || _this$mediaProperties23 === void 0 ? void 0 : (_this$mediaProperties24 = _this$mediaProperties23.pc) === null || _this$mediaProperties24 === void 0 ? void 0 : _this$mediaProperties24.connectionState) || ((_this$mediaProperties25 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties25 === void 0 ? void 0 : (_this$mediaProperties26 = _this$mediaProperties25.mediaConnection) === null || _this$mediaProperties26 === void 0 ? void 0 : (_this$mediaProperties27 = _this$mediaProperties26.pc) === null || _this$mediaProperties27 === void 0 ? void 0 : _this$mediaProperties27.connectionState) || 'unknown',
8369
8808
  iceConnectionState: ((_this$mediaProperties28 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties28 === void 0 ? void 0 : (_this$mediaProperties29 = _this$mediaProperties28.multistreamConnection) === null || _this$mediaProperties29 === void 0 ? void 0 : (_this$mediaProperties30 = _this$mediaProperties29.pc) === null || _this$mediaProperties30 === void 0 ? void 0 : (_this$mediaProperties31 = _this$mediaProperties30.pc) === null || _this$mediaProperties31 === void 0 ? void 0 : _this$mediaProperties31.iceConnectionState) || ((_this$mediaProperties32 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties32 === void 0 ? void 0 : (_this$mediaProperties33 = _this$mediaProperties32.mediaConnection) === null || _this$mediaProperties33 === void 0 ? void 0 : (_this$mediaProperties34 = _this$mediaProperties33.pc) === null || _this$mediaProperties34 === void 0 ? void 0 : _this$mediaProperties34.iceConnectionState) || 'unknown'
@@ -8371,7 +8810,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8371
8810
  iceCandidatesCount: this.iceCandidatesCount,
8372
8811
  ipver: ipver
8373
8812
  }));
8374
- _context35.next = 19;
8813
+ _context37.next = 19;
8375
8814
  return this.cleanUpOnAddMediaFailure();
8376
8815
  case 19:
8377
8816
  // Upload logs on error while adding media
@@ -8379,23 +8818,23 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8379
8818
  file: 'meeting/index',
8380
8819
  function: 'addMedia'
8381
8820
  }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, this);
8382
- if (_t35 instanceof _internalMediaCore.Errors.SdpError) {
8821
+ if (_t37 instanceof _internalMediaCore.Errors.SdpError) {
8383
8822
  this.leave({
8384
8823
  reason: _constants.MEETING_REMOVED_REASON.MEETING_CONNECTION_FAILED
8385
8824
  });
8386
8825
  }
8387
- throw _t35;
8826
+ throw _t37;
8388
8827
  case 20:
8389
- _context35.prev = 20;
8828
+ _context37.prev = 20;
8390
8829
  this.addMediaData.icePhaseCallback = DEFAULT_ICE_PHASE_CALLBACK;
8391
- return _context35.finish(20);
8830
+ return _context37.finish(20);
8392
8831
  case 21:
8393
8832
  case "end":
8394
- return _context35.stop();
8833
+ return _context37.stop();
8395
8834
  }
8396
- }, _callee35, this, [[4, 16, 20, 21], [6, 8]]);
8835
+ }, _callee37, this, [[4, 16, 20, 21], [6, 8]]);
8397
8836
  }));
8398
- function addMediaInternal(_x30, _x31, _x32) {
8837
+ function addMediaInternal(_x32, _x33, _x34) {
8399
8838
  return _addMediaInternal.apply(this, arguments);
8400
8839
  }
8401
8840
  return addMediaInternal;
@@ -8425,7 +8864,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8425
8864
  * @memberof Meeting
8426
8865
  */
8427
8866
  function enqueueMediaUpdate(mediaUpdateType) {
8428
- var _this46 = this;
8867
+ var _this48 = this;
8429
8868
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
8430
8869
  var canUpdateMediaNow = this.canUpdateMedia();
8431
8870
  return new _promise.default(function (resolve, reject) {
@@ -8436,9 +8875,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8436
8875
  options: options
8437
8876
  };
8438
8877
  _loggerProxy.default.logger.log("Meeting:index#enqueueMediaUpdate --> enqueuing media update type=".concat(mediaUpdateType));
8439
- _this46.queuedMediaUpdates.push(queueItem);
8878
+ _this48.queuedMediaUpdates.push(queueItem);
8440
8879
  if (canUpdateMediaNow) {
8441
- _this46.processNextQueuedMediaUpdate();
8880
+ _this48.processNextQueuedMediaUpdate();
8442
8881
  }
8443
8882
  });
8444
8883
  }
@@ -8461,35 +8900,35 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8461
8900
  * @memberof Meeting
8462
8901
  */
8463
8902
  function () {
8464
- var _updateMedia = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee36(options) {
8903
+ var _updateMedia = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee38(options) {
8465
8904
  var audioEnabled, videoEnabled, shareAudioEnabled, shareVideoEnabled, _this$audio3, _this$video3;
8466
- return _regenerator.default.wrap(function (_context36) {
8467
- while (1) switch (_context36.prev = _context36.next) {
8905
+ return _regenerator.default.wrap(function (_context38) {
8906
+ while (1) switch (_context38.prev = _context38.next) {
8468
8907
  case 0:
8469
8908
  this.checkMediaConnection();
8470
8909
  audioEnabled = options.audioEnabled, videoEnabled = options.videoEnabled, shareAudioEnabled = options.shareAudioEnabled, shareVideoEnabled = options.shareVideoEnabled;
8471
8910
  _loggerProxy.default.logger.log("Meeting:index#updateMedia --> called with options=".concat((0, _stringify.default)(options)));
8472
8911
  if (this.canUpdateMedia()) {
8473
- _context36.next = 1;
8912
+ _context38.next = 1;
8474
8913
  break;
8475
8914
  }
8476
- return _context36.abrupt("return", this.enqueueMediaUpdate(MEDIA_UPDATE_TYPE.UPDATE_MEDIA, options));
8915
+ return _context38.abrupt("return", this.enqueueMediaUpdate(MEDIA_UPDATE_TYPE.UPDATE_MEDIA, options));
8477
8916
  case 1:
8478
8917
  if (!this.isMultistream) {
8479
- _context36.next = 3;
8918
+ _context38.next = 3;
8480
8919
  break;
8481
8920
  }
8482
8921
  if (!(shareAudioEnabled !== undefined || shareVideoEnabled !== undefined)) {
8483
- _context36.next = 2;
8922
+ _context38.next = 2;
8484
8923
  break;
8485
8924
  }
8486
8925
  throw new Error('toggling shareAudioEnabled or shareVideoEnabled in a multistream meeting is not supported, to control receiving screen share call meeting.remoteMediaManager.setLayout() with appropriate layout');
8487
8926
  case 2:
8488
- _context36.next = 4;
8927
+ _context38.next = 4;
8489
8928
  break;
8490
8929
  case 3:
8491
8930
  if (!(shareAudioEnabled !== undefined)) {
8492
- _context36.next = 4;
8931
+ _context38.next = 4;
8493
8932
  break;
8494
8933
  }
8495
8934
  throw new Error('toggling shareAudioEnabled in a transcoded meeting is not supported as of now');
@@ -8514,20 +8953,20 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8514
8953
  this.mediaProperties.mediaDirection.receiveShare = !!(shareAudioEnabled || shareVideoEnabled);
8515
8954
  }
8516
8955
  if (this.isMultistream) {
8517
- _context36.next = 5;
8956
+ _context38.next = 5;
8518
8957
  break;
8519
8958
  }
8520
- _context36.next = 5;
8959
+ _context38.next = 5;
8521
8960
  return this.updateTranscodedMediaConnection();
8522
8961
  case 5:
8523
- return _context36.abrupt("return", undefined);
8962
+ return _context38.abrupt("return", undefined);
8524
8963
  case 6:
8525
8964
  case "end":
8526
- return _context36.stop();
8965
+ return _context38.stop();
8527
8966
  }
8528
- }, _callee36, this);
8967
+ }, _callee38, this);
8529
8968
  }));
8530
- function updateMedia(_x33) {
8969
+ function updateMedia(_x35) {
8531
8970
  return _updateMedia.apply(this, arguments);
8532
8971
  }
8533
8972
  return updateMedia;
@@ -8543,7 +8982,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8543
8982
  }, {
8544
8983
  key: "acknowledge",
8545
8984
  value: function acknowledge(type) {
8546
- var _this47 = this;
8985
+ var _this49 = this;
8547
8986
  if (!type) {
8548
8987
  return _promise.default.reject(new _parameter.default('Type must be set to acknowledge the meeting.'));
8549
8988
  }
@@ -8555,12 +8994,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8555
8994
  }).then(function (response) {
8556
8995
  return _promise.default.resolve(response);
8557
8996
  }).then(function (response) {
8558
- _this47.meetingFiniteStateMachine.ring(type);
8997
+ _this49.meetingFiniteStateMachine.ring(type);
8559
8998
  // @ts-ignore
8560
- _this47.webex.internal.newMetrics.submitClientEvent({
8999
+ _this49.webex.internal.newMetrics.submitClientEvent({
8561
9000
  name: 'client.alert.displayed',
8562
9001
  options: {
8563
- meetingId: _this47.id
9002
+ meetingId: _this49.id
8564
9003
  }
8565
9004
  });
8566
9005
  return _promise.default.resolve({
@@ -8585,12 +9024,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8585
9024
  }, {
8586
9025
  key: "decline",
8587
9026
  value: function decline(reason) {
8588
- var _this48 = this;
9027
+ var _this50 = this;
8589
9028
  return _util2.default.declineMeeting(this, reason).then(function (decline) {
8590
- _this48.meetingFiniteStateMachine.decline();
9029
+ _this50.meetingFiniteStateMachine.decline();
8591
9030
  return _promise.default.resolve(decline);
8592
9031
  }).catch(function (error) {
8593
- _this48.meetingFiniteStateMachine.fail(error);
9032
+ _this50.meetingFiniteStateMachine.fail(error);
8594
9033
  return _promise.default.reject(error);
8595
9034
  });
8596
9035
  }
@@ -8641,7 +9080,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8641
9080
  }, {
8642
9081
  key: "leave",
8643
9082
  value: function leave() {
8644
- var _this49 = this;
9083
+ var _this51 = this;
8645
9084
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
8646
9085
  var leaveReason = options.reason || _constants.MEETING_REMOVED_REASON.CLIENT_LEAVE_REQUEST;
8647
9086
 
@@ -8653,7 +9092,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8653
9092
  var payload = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
8654
9093
  return (
8655
9094
  // @ts-ignore
8656
- _this49.webex.internal.newMetrics.submitClientEvent({
9095
+ _this51.webex.internal.newMetrics.submitClientEvent({
8657
9096
  name: 'client.call.leave',
8658
9097
  payload: _objectSpread({
8659
9098
  trigger: 'user-interaction',
@@ -8661,50 +9100,51 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8661
9100
  leaveReason: options.clientEventLeaveReason
8662
9101
  }, payload),
8663
9102
  options: {
8664
- meetingId: _this49.id
9103
+ meetingId: _this51.id
8665
9104
  }
8666
9105
  })
8667
9106
  );
8668
9107
  };
8669
9108
  _loggerProxy.default.logger.log('Meeting:index#leave --> Leaving a meeting');
9109
+ this.stopListeningForMeetingEvents();
8670
9110
  return _util2.default.leaveMeeting(this, options).then(/*#__PURE__*/function () {
8671
- var _ref41 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee37(leave) {
8672
- return _regenerator.default.wrap(function (_context37) {
8673
- while (1) switch (_context37.prev = _context37.next) {
9111
+ var _ref42 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee39(leave) {
9112
+ return _regenerator.default.wrap(function (_context39) {
9113
+ while (1) switch (_context39.prev = _context39.next) {
8674
9114
  case 0:
8675
9115
  // CA team recommends submitting this *after* locus /leave
8676
9116
  submitLeaveMetric();
8677
- _this49.meetingFiniteStateMachine.leave();
8678
- _context37.next = 1;
8679
- return _this49.clearMeetingData();
9117
+ _this51.meetingFiniteStateMachine.leave();
9118
+ _context39.next = 1;
9119
+ return _this51.clearMeetingData();
8680
9120
  case 1:
8681
9121
  // upload logs on leave irrespective of meeting delete
8682
- _triggerProxy.default.trigger(_this49, {
9122
+ _triggerProxy.default.trigger(_this51, {
8683
9123
  file: 'meeting/index',
8684
9124
  function: 'leave'
8685
- }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this49);
9125
+ }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this51);
8686
9126
 
8687
9127
  // TODO: more testing before we remove this code, we are not sure the scenarios for destroy here
8688
- if (_this49.wirelessShare || _this49.guest) {
9128
+ if (_this51.wirelessShare || _this51.guest) {
8689
9129
  // If screen sharing clean the meeting object
8690
- _triggerProxy.default.trigger(_this49, {
9130
+ _triggerProxy.default.trigger(_this51, {
8691
9131
  file: 'meeting/index',
8692
9132
  function: 'leave'
8693
9133
  }, _constants.EVENTS.DESTROY_MEETING, {
8694
9134
  reason: options.reason,
8695
- meetingId: _this49.id
9135
+ meetingId: _this51.id
8696
9136
  });
8697
9137
  }
8698
9138
  _loggerProxy.default.logger.log('Meeting:index#leave --> LEAVE REASON ', leaveReason);
8699
- return _context37.abrupt("return", leave);
9139
+ return _context39.abrupt("return", leave);
8700
9140
  case 2:
8701
9141
  case "end":
8702
- return _context37.stop();
9142
+ return _context39.stop();
8703
9143
  }
8704
- }, _callee37);
9144
+ }, _callee39);
8705
9145
  }));
8706
- return function (_x34) {
8707
- return _ref41.apply(this, arguments);
9146
+ return function (_x36) {
9147
+ return _ref42.apply(this, arguments);
8708
9148
  };
8709
9149
  }()).catch(function (error) {
8710
9150
  // CA team recommends submitting this *after* locus /leave
@@ -8718,16 +9158,16 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8718
9158
  shownToUser: false
8719
9159
  }]
8720
9160
  });
8721
- _this49.meetingFiniteStateMachine.fail(error);
9161
+ _this51.meetingFiniteStateMachine.fail(error);
8722
9162
  _loggerProxy.default.logger.error('Meeting:index#leave --> Failed to leave ', error);
8723
9163
  // upload logs on leave irrespective of meeting delete
8724
- _triggerProxy.default.trigger(_this49, {
9164
+ _triggerProxy.default.trigger(_this51, {
8725
9165
  file: 'meeting/index',
8726
9166
  function: 'leave'
8727
- }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this49);
9167
+ }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this51);
8728
9168
  _metrics.default.sendBehavioralMetric(_constants2.default.MEETING_LEAVE_FAILURE, {
8729
- correlation_id: _this49.correlationId,
8730
- locus_id: _this49.locusUrl.split('/').pop(),
9169
+ correlation_id: _this51.correlationId,
9170
+ locus_id: _this51.locusUrl.split('/').pop(),
8731
9171
  reason: error.message,
8732
9172
  stack: error.stack,
8733
9173
  code: error.code
@@ -8747,7 +9187,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8747
9187
  }, {
8748
9188
  key: "startWhiteboardShare",
8749
9189
  value: function startWhiteboardShare(channelUrl, resourceToken) {
8750
- var _this50 = this;
9190
+ var _this52 = this;
8751
9191
  var whiteboard = this.locusInfo.mediaShares.find(function (element) {
8752
9192
  return element.name === 'whiteboard';
8753
9193
  });
@@ -8780,13 +9220,13 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8780
9220
  body.resourceToken = resourceToken;
8781
9221
  }
8782
9222
  return this.meetingRequest.changeMeetingFloor(body).then(function () {
8783
- _this50.screenShareFloorState = ScreenShareFloorStatus.RELEASED;
9223
+ _this52.screenShareFloorState = ScreenShareFloorStatus.RELEASED;
8784
9224
  return _promise.default.resolve();
8785
9225
  }).catch(function (error) {
8786
9226
  _loggerProxy.default.logger.error('Meeting:index#startWhiteboardShare --> Error ', error);
8787
9227
  _metrics.default.sendBehavioralMetric(_constants2.default.MEETING_START_WHITEBOARD_SHARE_FAILURE, {
8788
- correlation_id: _this50.correlationId,
8789
- locus_id: _this50.locusUrl.split('/').pop(),
9228
+ correlation_id: _this52.correlationId,
9229
+ locus_id: _this52.locusUrl.split('/').pop(),
8790
9230
  reason: error.message,
8791
9231
  stack: error.stack,
8792
9232
  board: {
@@ -8809,7 +9249,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8809
9249
  }, {
8810
9250
  key: "stopWhiteboardShare",
8811
9251
  value: function stopWhiteboardShare(channelUrl) {
8812
- var _this51 = this;
9252
+ var _this53 = this;
8813
9253
  var whiteboard = this.locusInfo.mediaShares.find(function (element) {
8814
9254
  return element.name === 'whiteboard';
8815
9255
  });
@@ -8838,8 +9278,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8838
9278
  }).catch(function (error) {
8839
9279
  _loggerProxy.default.logger.error('Meeting:index#stopWhiteboardShare --> Error ', error);
8840
9280
  _metrics.default.sendBehavioralMetric(_constants2.default.MEETING_STOP_WHITEBOARD_SHARE_FAILURE, {
8841
- correlation_id: _this51.correlationId,
8842
- locus_id: _this51.locusUrl.split('/').pop(),
9281
+ correlation_id: _this53.correlationId,
9282
+ locus_id: _this53.locusUrl.split('/').pop(),
8843
9283
  reason: error.message,
8844
9284
  stack: error.stack,
8845
9285
  board: {
@@ -8861,7 +9301,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8861
9301
  }, {
8862
9302
  key: "requestScreenShareFloor",
8863
9303
  value: function requestScreenShareFloor() {
8864
- var _this52 = this;
9304
+ var _this54 = this;
8865
9305
  if (!this.mediaProperties.hasLocalShareStream() || !this.mediaProperties.mediaDirection.sendShare) {
8866
9306
  _loggerProxy.default.logger.log("Meeting:index#requestScreenShareFloor --> NOT requesting floor, because we don't have the share stream anymore (shareStream=".concat(this.mediaProperties.shareVideoStream ? 'yes' : 'no', ", sendShare=").concat(this.mediaProperties.mediaDirection.sendShare, ")"));
8867
9307
  this.screenShareFloorState = ScreenShareFloorStatus.RELEASED;
@@ -8892,34 +9332,34 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8892
9332
  resourceUrl: this.resourceUrl,
8893
9333
  shareInstanceId: this.localShareInstanceId
8894
9334
  }).then(function () {
8895
- _this52.screenShareFloorState = ScreenShareFloorStatus.GRANTED;
9335
+ _this54.screenShareFloorState = ScreenShareFloorStatus.GRANTED;
8896
9336
  _metrics.default.sendBehavioralMetric(_constants2.default.MEETING_SHARE_SUCCESS, {
8897
- correlation_id: _this52.correlationId,
8898
- locus_id: _this52.locusUrl.split('/').pop()
9337
+ correlation_id: _this54.correlationId,
9338
+ locus_id: _this54.locusUrl.split('/').pop()
8899
9339
  });
8900
9340
  return _promise.default.resolve();
8901
9341
  }).catch(function (error) {
8902
9342
  _loggerProxy.default.logger.error('Meeting:index#share --> Error ', error);
8903
9343
  _metrics.default.sendBehavioralMetric(_constants2.default.MEETING_SHARE_FAILURE, {
8904
- correlation_id: _this52.correlationId,
8905
- locus_id: _this52.locusUrl.split('/').pop(),
9344
+ correlation_id: _this54.correlationId,
9345
+ locus_id: _this54.locusUrl.split('/').pop(),
8906
9346
  reason: error.message,
8907
9347
  stack: error.stack
8908
9348
  });
8909
9349
 
8910
9350
  // @ts-ignore
8911
- _this52.webex.internal.newMetrics.submitClientEvent({
9351
+ _this54.webex.internal.newMetrics.submitClientEvent({
8912
9352
  name: 'client.share.floor-granted.local',
8913
9353
  payload: {
8914
9354
  mediaType: 'share',
8915
9355
  errors: _util2.default.getChangeMeetingFloorErrorPayload(error.message),
8916
- shareInstanceId: _this52.localShareInstanceId
9356
+ shareInstanceId: _this54.localShareInstanceId
8917
9357
  },
8918
9358
  options: {
8919
- meetingId: _this52.id
9359
+ meetingId: _this54.id
8920
9360
  }
8921
9361
  });
8922
- _this52.screenShareFloorState = ScreenShareFloorStatus.RELEASED;
9362
+ _this54.screenShareFloorState = ScreenShareFloorStatus.RELEASED;
8923
9363
  return _promise.default.reject(error);
8924
9364
  });
8925
9365
  }
@@ -8942,10 +9382,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8942
9382
  }, {
8943
9383
  key: "requestScreenShareFloorIfPending",
8944
9384
  value: function requestScreenShareFloorIfPending() {
8945
- var _this53 = this;
9385
+ var _this55 = this;
8946
9386
  if (this.floorGrantPending && this.state === _constants.MEETING_STATE.STATES.JOINED) {
8947
9387
  this.requestScreenShareFloor().then(function () {
8948
- _this53.floorGrantPending = false;
9388
+ _this55.floorGrantPending = false;
8949
9389
  });
8950
9390
  }
8951
9391
  }
@@ -8959,7 +9399,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8959
9399
  }, {
8960
9400
  key: "releaseScreenShareFloor",
8961
9401
  value: function releaseScreenShareFloor() {
8962
- var _this54 = this;
9402
+ var _this56 = this;
8963
9403
  var content = this.locusInfo.mediaShares.find(function (element) {
8964
9404
  return element.name === _constants.CONTENT;
8965
9405
  });
@@ -9000,8 +9440,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9000
9440
  }).catch(function (error) {
9001
9441
  _loggerProxy.default.logger.error('Meeting:index#releaseScreenShareFloor --> Error ', error);
9002
9442
  _metrics.default.sendBehavioralMetric(_constants2.default.STOP_FLOOR_REQUEST_FAILURE, {
9003
- correlation_id: _this54.correlationId,
9004
- locus_id: _this54.locusUrl.split('/').pop(),
9443
+ correlation_id: _this56.correlationId,
9444
+ locus_id: _this56.locusUrl.split('/').pop(),
9005
9445
  reason: error.message,
9006
9446
  stack: error.stack
9007
9447
  });
@@ -9181,7 +9621,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9181
9621
  }, {
9182
9622
  key: "changeVideoLayout",
9183
9623
  value: function changeVideoLayout(layoutType) {
9184
- var _this55 = this;
9624
+ var _this57 = this;
9185
9625
  var renderInfo = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
9186
9626
  var main = renderInfo.main,
9187
9627
  content = renderInfo.content;
@@ -9235,7 +9675,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9235
9675
  }
9236
9676
  this.lastVideoLayoutInfo = (0, _lodash.cloneDeep)(layoutInfo);
9237
9677
  this.locusInfo.once(_constants.LOCUSINFO.EVENTS.CONTROLS_MEETING_LAYOUT_UPDATED, function (envelope) {
9238
- _triggerProxy.default.trigger(_this55, {
9678
+ _triggerProxy.default.trigger(_this57, {
9239
9679
  file: 'meeting/index',
9240
9680
  function: 'changeVideoLayout'
9241
9681
  }, _constants.EVENT_TRIGGERS.MEETING_CONTROLS_LAYOUT_UPDATE, {
@@ -9351,7 +9791,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9351
9791
  }, {
9352
9792
  key: "endMeetingForAll",
9353
9793
  value: function endMeetingForAll() {
9354
- var _this56 = this;
9794
+ var _this58 = this;
9355
9795
  // @ts-ignore
9356
9796
  this.webex.internal.newMetrics.submitClientEvent({
9357
9797
  name: 'client.call.leave',
@@ -9368,41 +9808,42 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9368
9808
  correlation_id: this.correlationId,
9369
9809
  locus_id: this.locusId
9370
9810
  });
9811
+ this.stopListeningForMeetingEvents();
9371
9812
  return _util2.default.endMeetingForAll(this).then(/*#__PURE__*/function () {
9372
- var _ref42 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee38(end) {
9373
- return _regenerator.default.wrap(function (_context38) {
9374
- while (1) switch (_context38.prev = _context38.next) {
9813
+ var _ref43 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee40(end) {
9814
+ return _regenerator.default.wrap(function (_context40) {
9815
+ while (1) switch (_context40.prev = _context40.next) {
9375
9816
  case 0:
9376
- _this56.meetingFiniteStateMachine.end();
9377
- _context38.next = 1;
9378
- return _this56.clearMeetingData();
9817
+ _this58.meetingFiniteStateMachine.end();
9818
+ _context40.next = 1;
9819
+ return _this58.clearMeetingData();
9379
9820
  case 1:
9380
9821
  // upload logs on leave irrespective of meeting delete
9381
- _triggerProxy.default.trigger(_this56, {
9822
+ _triggerProxy.default.trigger(_this58, {
9382
9823
  file: 'meeting/index',
9383
9824
  function: 'endMeetingForAll'
9384
- }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this56);
9385
- return _context38.abrupt("return", end);
9825
+ }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this58);
9826
+ return _context40.abrupt("return", end);
9386
9827
  case 2:
9387
9828
  case "end":
9388
- return _context38.stop();
9829
+ return _context40.stop();
9389
9830
  }
9390
- }, _callee38);
9831
+ }, _callee40);
9391
9832
  }));
9392
- return function (_x35) {
9393
- return _ref42.apply(this, arguments);
9833
+ return function (_x37) {
9834
+ return _ref43.apply(this, arguments);
9394
9835
  };
9395
9836
  }()).catch(function (error) {
9396
- _this56.meetingFiniteStateMachine.fail(error);
9837
+ _this58.meetingFiniteStateMachine.fail(error);
9397
9838
  _loggerProxy.default.logger.error('Meeting:index#endMeetingForAll --> Failed to end meeting ', error);
9398
9839
  // upload logs on leave irrespective of meeting delete
9399
- _triggerProxy.default.trigger(_this56, {
9840
+ _triggerProxy.default.trigger(_this58, {
9400
9841
  file: 'meeting/index',
9401
9842
  function: 'endMeetingForAll'
9402
- }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this56);
9843
+ }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this58);
9403
9844
  _metrics.default.sendBehavioralMetric(_constants2.default.MEETING_END_ALL_FAILURE, {
9404
- correlation_id: _this56.correlationId,
9405
- locus_id: _this56.locusUrl.split('/').pop(),
9845
+ correlation_id: _this58.correlationId,
9846
+ locus_id: _this58.locusUrl.split('/').pop(),
9406
9847
  reason: error.message,
9407
9848
  stack: error.stack,
9408
9849
  code: error.code
@@ -9423,13 +9864,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9423
9864
  * @memberof Meeting
9424
9865
  */
9425
9866
  function sendReaction(reactionType, skinToneType) {
9426
- var _this$locusInfo7, _this$locusInfo7$cont, _this$locusInfo7$cont2;
9427
- var reactionChannelUrl = (_this$locusInfo7 = this.locusInfo) === null || _this$locusInfo7 === void 0 ? void 0 : (_this$locusInfo7$cont = _this$locusInfo7.controls) === null || _this$locusInfo7$cont === void 0 ? void 0 : (_this$locusInfo7$cont2 = _this$locusInfo7$cont.reactions) === null || _this$locusInfo7$cont2 === void 0 ? void 0 : _this$locusInfo7$cont2.reactionChannelUrl;
9867
+ var _this$locusInfo9, _this$locusInfo9$cont, _this$locusInfo9$cont2;
9868
+ var reactionChannelUrl = (_this$locusInfo9 = this.locusInfo) === null || _this$locusInfo9 === void 0 ? void 0 : (_this$locusInfo9$cont = _this$locusInfo9.controls) === null || _this$locusInfo9$cont === void 0 ? void 0 : (_this$locusInfo9$cont2 = _this$locusInfo9$cont.reactions) === null || _this$locusInfo9$cont2 === void 0 ? void 0 : _this$locusInfo9$cont2.reactionChannelUrl;
9428
9869
  var participantId = this.members.selfId;
9429
- var reactionData = _reactions.Reactions[reactionType];
9430
- if (!reactionData) {
9431
- return _promise.default.reject(new Error("".concat(reactionType, " is not a valid reaction.")));
9432
- }
9870
+ var reactionData = _reactions.Reactions[reactionType] || {
9871
+ type: reactionType
9872
+ };
9433
9873
  var skinToneData = _reactions.SkinTones[skinToneType] || _reactions.SkinTones.normal;
9434
9874
  var reaction = _objectSpread(_objectSpread({}, reactionData), {}, {
9435
9875
  tone: skinToneData
@@ -9454,12 +9894,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9454
9894
  */
9455
9895
  }, {
9456
9896
  key: "extendMeeting",
9457
- value: function extendMeeting(_ref43) {
9458
- var meetingPolicyUrl = _ref43.meetingPolicyUrl,
9459
- meetingInstanceId = _ref43.meetingInstanceId,
9460
- participantId = _ref43.participantId,
9461
- _ref43$extensionMinut = _ref43.extensionMinutes,
9462
- extensionMinutes = _ref43$extensionMinut === void 0 ? 30 : _ref43$extensionMinut;
9897
+ value: function extendMeeting(_ref44) {
9898
+ var meetingPolicyUrl = _ref44.meetingPolicyUrl,
9899
+ meetingInstanceId = _ref44.meetingInstanceId,
9900
+ participantId = _ref44.participantId,
9901
+ _ref44$extensionMinut = _ref44.extensionMinutes,
9902
+ extensionMinutes = _ref44$extensionMinut === void 0 ? 30 : _ref44$extensionMinut;
9463
9903
  if (!meetingInstanceId || !participantId) {
9464
9904
  return _promise.default.reject(new Error('Missing meetingInstanceId or participantId'));
9465
9905
  }
@@ -9485,8 +9925,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9485
9925
  }, {
9486
9926
  key: "toggleReactions",
9487
9927
  value: function toggleReactions(enable) {
9488
- var _this$locusInfo8, _this$locusInfo8$cont, _this$locusInfo8$cont2;
9489
- var isEnabled = (_this$locusInfo8 = this.locusInfo) === null || _this$locusInfo8 === void 0 ? void 0 : (_this$locusInfo8$cont = _this$locusInfo8.controls) === null || _this$locusInfo8$cont === void 0 ? void 0 : (_this$locusInfo8$cont2 = _this$locusInfo8$cont.reactions) === null || _this$locusInfo8$cont2 === void 0 ? void 0 : _this$locusInfo8$cont2.enabled;
9928
+ var _this$locusInfo0, _this$locusInfo0$cont, _this$locusInfo0$cont2;
9929
+ var isEnabled = (_this$locusInfo0 = this.locusInfo) === null || _this$locusInfo0 === void 0 ? void 0 : (_this$locusInfo0$cont = _this$locusInfo0.controls) === null || _this$locusInfo0$cont === void 0 ? void 0 : (_this$locusInfo0$cont2 = _this$locusInfo0$cont.reactions) === null || _this$locusInfo0$cont2 === void 0 ? void 0 : _this$locusInfo0$cont2.enabled;
9490
9930
  if (isEnabled && enable || !isEnabled && !enable) {
9491
9931
  return _promise.default.resolve("Reactions are already ".concat(isEnabled ? 'enabled' : 'disabled', "."));
9492
9932
  }
@@ -9540,39 +9980,39 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9540
9980
  }, {
9541
9981
  key: "enableMusicMode",
9542
9982
  value: (function () {
9543
- var _enableMusicMode = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee39(shouldEnableMusicMode) {
9544
- return _regenerator.default.wrap(function (_context39) {
9545
- while (1) switch (_context39.prev = _context39.next) {
9983
+ var _enableMusicMode = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee41(shouldEnableMusicMode) {
9984
+ return _regenerator.default.wrap(function (_context41) {
9985
+ while (1) switch (_context41.prev = _context41.next) {
9546
9986
  case 0:
9547
9987
  this.checkMediaConnection();
9548
9988
  if (this.isMultistream) {
9549
- _context39.next = 1;
9989
+ _context41.next = 1;
9550
9990
  break;
9551
9991
  }
9552
9992
  throw new Error('enableMusicMode() only supported with multistream');
9553
9993
  case 1:
9554
9994
  if (!shouldEnableMusicMode) {
9555
- _context39.next = 3;
9995
+ _context41.next = 3;
9556
9996
  break;
9557
9997
  }
9558
- _context39.next = 2;
9998
+ _context41.next = 2;
9559
9999
  return this.sendSlotManager.setCustomCodecParameters(_internalMediaCore.MediaType.AudioMain, _internalMediaCore.MediaCodecMimeType.OPUS, {
9560
10000
  maxaveragebitrate: '64000',
9561
10001
  maxplaybackrate: '48000'
9562
10002
  });
9563
10003
  case 2:
9564
- _context39.next = 4;
10004
+ _context41.next = 4;
9565
10005
  break;
9566
10006
  case 3:
9567
- _context39.next = 4;
10007
+ _context41.next = 4;
9568
10008
  return this.sendSlotManager.markCustomCodecParametersForDeletion(_internalMediaCore.MediaType.AudioMain, _internalMediaCore.MediaCodecMimeType.OPUS, ['maxaveragebitrate', 'maxplaybackrate']);
9569
10009
  case 4:
9570
10010
  case "end":
9571
- return _context39.stop();
10011
+ return _context41.stop();
9572
10012
  }
9573
- }, _callee39, this);
10013
+ }, _callee41, this);
9574
10014
  }));
9575
- function enableMusicMode(_x36) {
10015
+ function enableMusicMode(_x38) {
9576
10016
  return _enableMusicMode.apply(this, arguments);
9577
10017
  }
9578
10018
  return enableMusicMode;
@@ -9593,7 +10033,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9593
10033
  _this$mediaProperties42,
9594
10034
  _this$mediaProperties43,
9595
10035
  _this$mediaProperties44,
9596
- _this57 = this;
10036
+ _this59 = this;
9597
10037
  var LOG_HEADER = 'Meeting:index#updateTranscodedMediaConnection -->';
9598
10038
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " starting"));
9599
10039
  if (!this.canUpdateMedia()) {
@@ -9618,8 +10058,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9618
10058
  }).catch(function (error) {
9619
10059
  _loggerProxy.default.logger.error("".concat(LOG_HEADER, " Error: "), error);
9620
10060
  _metrics.default.sendBehavioralMetric(_constants2.default.UPDATE_MEDIA_FAILURE, {
9621
- correlation_id: _this57.correlationId,
9622
- locus_id: _this57.locusUrl.split('/').pop(),
10061
+ correlation_id: _this59.correlationId,
10062
+ locus_id: _this59.locusUrl.split('/').pop(),
9623
10063
  reason: error.message,
9624
10064
  stack: error.stack
9625
10065
  });
@@ -9663,25 +10103,25 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9663
10103
  }, {
9664
10104
  key: "publishStream",
9665
10105
  value: (function () {
9666
- var _publishStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee40(mediaType, stream) {
9667
- return _regenerator.default.wrap(function (_context40) {
9668
- while (1) switch (_context40.prev = _context40.next) {
10106
+ var _publishStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee42(mediaType, stream) {
10107
+ return _regenerator.default.wrap(function (_context42) {
10108
+ while (1) switch (_context42.prev = _context42.next) {
9669
10109
  case 0:
9670
10110
  if (stream) {
9671
- _context40.next = 1;
10111
+ _context42.next = 1;
9672
10112
  break;
9673
10113
  }
9674
- return _context40.abrupt("return");
10114
+ return _context42.abrupt("return");
9675
10115
  case 1:
9676
10116
  if (!this.mediaProperties.webrtcMediaConnection) {
9677
- _context40.next = 3;
10117
+ _context42.next = 3;
9678
10118
  break;
9679
10119
  }
9680
10120
  if (!(this.isMultistream && this.mediaProperties.webrtcMediaConnection)) {
9681
- _context40.next = 2;
10121
+ _context42.next = 2;
9682
10122
  break;
9683
10123
  }
9684
- _context40.next = 2;
10124
+ _context42.next = 2;
9685
10125
  return this.sendSlotManager.publishStream(mediaType, stream);
9686
10126
  case 2:
9687
10127
  this.emitPublishStateChangeEvent({
@@ -9692,11 +10132,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9692
10132
  });
9693
10133
  case 3:
9694
10134
  case "end":
9695
- return _context40.stop();
10135
+ return _context42.stop();
9696
10136
  }
9697
- }, _callee40, this);
10137
+ }, _callee42, this);
9698
10138
  }));
9699
- function publishStream(_x37, _x38) {
10139
+ function publishStream(_x39, _x40) {
9700
10140
  return _publishStream.apply(this, arguments);
9701
10141
  }
9702
10142
  return publishStream;
@@ -9712,21 +10152,21 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9712
10152
  }, {
9713
10153
  key: "unpublishStream",
9714
10154
  value: (function () {
9715
- var _unpublishStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee41(mediaType, stream) {
9716
- return _regenerator.default.wrap(function (_context41) {
9717
- while (1) switch (_context41.prev = _context41.next) {
10155
+ var _unpublishStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee43(mediaType, stream) {
10156
+ return _regenerator.default.wrap(function (_context43) {
10157
+ while (1) switch (_context43.prev = _context43.next) {
9718
10158
  case 0:
9719
10159
  if (stream) {
9720
- _context41.next = 1;
10160
+ _context43.next = 1;
9721
10161
  break;
9722
10162
  }
9723
- return _context41.abrupt("return");
10163
+ return _context43.abrupt("return");
9724
10164
  case 1:
9725
10165
  if (!(this.isMultistream && this.mediaProperties.webrtcMediaConnection)) {
9726
- _context41.next = 2;
10166
+ _context43.next = 2;
9727
10167
  break;
9728
10168
  }
9729
- _context41.next = 2;
10169
+ _context43.next = 2;
9730
10170
  return this.sendSlotManager.unpublishStream(mediaType);
9731
10171
  case 2:
9732
10172
  this.emitPublishStateChangeEvent({
@@ -9737,11 +10177,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9737
10177
  });
9738
10178
  case 3:
9739
10179
  case "end":
9740
- return _context41.stop();
10180
+ return _context43.stop();
9741
10181
  }
9742
- }, _callee41, this);
10182
+ }, _callee43, this);
9743
10183
  }));
9744
- function unpublishStream(_x39, _x40) {
10184
+ function unpublishStream(_x41, _x42) {
9745
10185
  return _unpublishStream.apply(this, arguments);
9746
10186
  }
9747
10187
  return unpublishStream;
@@ -9756,19 +10196,19 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9756
10196
  }, {
9757
10197
  key: "publishStreams",
9758
10198
  value: (function () {
9759
- var _publishStreams = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee42(streams) {
10199
+ var _publishStreams = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee44(streams) {
9760
10200
  var _streams$screenShare, _streams$screenShare2, _streams$screenShare3, _streams$screenShare4, _streams$screenShare5, _streams$screenShare6;
9761
10201
  var streamChecks, _i, _streamChecks, _streamChecks$_i, stream, name, floorRequestNeeded, _streams$screenShare7;
9762
- return _regenerator.default.wrap(function (_context42) {
9763
- while (1) switch (_context42.prev = _context42.next) {
10202
+ return _regenerator.default.wrap(function (_context44) {
10203
+ while (1) switch (_context44.prev = _context44.next) {
9764
10204
  case 0:
9765
10205
  _loggerProxy.default.logger.info("Meeting:index#publishStreams --> called with: ".concat((0, _stringify.default)(streams)));
9766
10206
  this.checkMediaConnection();
9767
10207
  if (!(!streams.microphone && !streams.camera && !((_streams$screenShare = streams.screenShare) !== null && _streams$screenShare !== void 0 && _streams$screenShare.audio) && !((_streams$screenShare2 = streams.screenShare) !== null && _streams$screenShare2 !== void 0 && _streams$screenShare2.video))) {
9768
- _context42.next = 1;
10208
+ _context44.next = 1;
9769
10209
  break;
9770
10210
  }
9771
- return _context42.abrupt("return");
10211
+ return _context44.abrupt("return");
9772
10212
  case 1:
9773
10213
  streamChecks = [{
9774
10214
  stream: streams === null || streams === void 0 ? void 0 : streams.microphone,
@@ -9786,62 +10226,62 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9786
10226
  _i = 0, _streamChecks = streamChecks;
9787
10227
  case 2:
9788
10228
  if (!(_i < _streamChecks.length)) {
9789
- _context42.next = 4;
10229
+ _context44.next = 4;
9790
10230
  break;
9791
10231
  }
9792
10232
  _streamChecks$_i = _streamChecks[_i], stream = _streamChecks$_i.stream, name = _streamChecks$_i.name;
9793
10233
  if (!((stream === null || stream === void 0 ? void 0 : stream.readyState) === 'ended')) {
9794
- _context42.next = 3;
10234
+ _context44.next = 3;
9795
10235
  break;
9796
10236
  }
9797
10237
  throw new Error("Attempted to publish ".concat(name, " stream with ended readyState, correlationId=").concat(this.correlationId));
9798
10238
  case 3:
9799
10239
  _i++;
9800
- _context42.next = 2;
10240
+ _context44.next = 2;
9801
10241
  break;
9802
10242
  case 4:
9803
10243
  floorRequestNeeded = false; // Screenshare Audio is supported only in multi stream. So we check for screenshare audio presence only if it's a multi stream meeting
9804
10244
  if (!(this.isMultistream && (_streams$screenShare5 = streams.screenShare) !== null && _streams$screenShare5 !== void 0 && _streams$screenShare5.audio)) {
9805
- _context42.next = 6;
10245
+ _context44.next = 6;
9806
10246
  break;
9807
10247
  }
9808
- _context42.next = 5;
10248
+ _context44.next = 5;
9809
10249
  return this.setLocalShareAudioStream(streams.screenShare.audio);
9810
10250
  case 5:
9811
10251
  floorRequestNeeded = this.screenShareFloorState === ScreenShareFloorStatus.RELEASED;
9812
10252
  case 6:
9813
10253
  if (!((_streams$screenShare6 = streams.screenShare) !== null && _streams$screenShare6 !== void 0 && _streams$screenShare6.video)) {
9814
- _context42.next = 8;
10254
+ _context44.next = 8;
9815
10255
  break;
9816
10256
  }
9817
- _context42.next = 7;
10257
+ _context44.next = 7;
9818
10258
  return this.setLocalShareVideoStream((_streams$screenShare7 = streams.screenShare) === null || _streams$screenShare7 === void 0 ? void 0 : _streams$screenShare7.video);
9819
10259
  case 7:
9820
10260
  floorRequestNeeded = this.screenShareFloorState === ScreenShareFloorStatus.RELEASED;
9821
10261
  case 8:
9822
10262
  if (!streams.microphone) {
9823
- _context42.next = 9;
10263
+ _context44.next = 9;
9824
10264
  break;
9825
10265
  }
9826
- _context42.next = 9;
10266
+ _context44.next = 9;
9827
10267
  return this.setLocalAudioStream(streams.microphone);
9828
10268
  case 9:
9829
10269
  if (!streams.camera) {
9830
- _context42.next = 10;
10270
+ _context44.next = 10;
9831
10271
  break;
9832
10272
  }
9833
- _context42.next = 10;
10273
+ _context44.next = 10;
9834
10274
  return this.setLocalVideoStream(streams.camera);
9835
10275
  case 10:
9836
10276
  if (this.isMultistream) {
9837
- _context42.next = 11;
10277
+ _context44.next = 11;
9838
10278
  break;
9839
10279
  }
9840
- _context42.next = 11;
10280
+ _context44.next = 11;
9841
10281
  return this.updateTranscodedMediaConnection();
9842
10282
  case 11:
9843
10283
  if (!floorRequestNeeded) {
9844
- _context42.next = 12;
10284
+ _context44.next = 12;
9845
10285
  break;
9846
10286
  }
9847
10287
  this.localShareInstanceId = _uuid.default.v4();
@@ -9872,15 +10312,15 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9872
10312
  // we're sending the http request to Locus to request the screen share floor
9873
10313
  // only after the SDP update, because that's how it's always been done for transcoded meetings
9874
10314
  // and also if sharing from the start, we need confluence to have been created
9875
- _context42.next = 12;
10315
+ _context44.next = 12;
9876
10316
  return this.enqueueScreenShareFloorRequest();
9877
10317
  case 12:
9878
10318
  case "end":
9879
- return _context42.stop();
10319
+ return _context44.stop();
9880
10320
  }
9881
- }, _callee42, this);
10321
+ }, _callee44, this);
9882
10322
  }));
9883
- function publishStreams(_x41) {
10323
+ function publishStreams(_x43) {
9884
10324
  return _publishStreams.apply(this, arguments);
9885
10325
  }
9886
10326
  return publishStreams;
@@ -9895,20 +10335,20 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9895
10335
  }, {
9896
10336
  key: "unpublishStreams",
9897
10337
  value: (function () {
9898
- var _unpublishStreams = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee43(streams) {
9899
- var promises, _iterator, _step, stream;
9900
- return _regenerator.default.wrap(function (_context43) {
9901
- while (1) switch (_context43.prev = _context43.next) {
10338
+ var _unpublishStreams = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee45(streams) {
10339
+ var promises, _iterator2, _step2, stream;
10340
+ return _regenerator.default.wrap(function (_context45) {
10341
+ while (1) switch (_context45.prev = _context45.next) {
9902
10342
  case 0:
9903
10343
  _loggerProxy.default.logger.info("Meeting:index#unpublishStreams --> called with: ".concat((0, _stringify.default)(streams)));
9904
10344
  this.checkMediaConnection();
9905
10345
  promises = [];
9906
- _iterator = _createForOfIteratorHelper(streams.filter(function (t) {
10346
+ _iterator2 = _createForOfIteratorHelper(streams.filter(function (t) {
9907
10347
  return !!t;
9908
10348
  }));
9909
10349
  try {
9910
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
9911
- stream = _step.value;
10350
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
10351
+ stream = _step2.value;
9912
10352
  if (stream === this.mediaProperties.shareAudioStream) {
9913
10353
  promises.push(this.setLocalShareAudioStream(undefined));
9914
10354
  }
@@ -9923,14 +10363,14 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9923
10363
  }
9924
10364
  }
9925
10365
  } catch (err) {
9926
- _iterator.e(err);
10366
+ _iterator2.e(err);
9927
10367
  } finally {
9928
- _iterator.f();
10368
+ _iterator2.f();
9929
10369
  }
9930
10370
  if (!this.isMultistream) {
9931
10371
  promises.push(this.updateTranscodedMediaConnection());
9932
10372
  }
9933
- _context43.next = 1;
10373
+ _context45.next = 1;
9934
10374
  return _promise.default.all(promises);
9935
10375
  case 1:
9936
10376
  // we're allowing for the SDK to support just audio share as well
@@ -9951,11 +10391,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9951
10391
  }
9952
10392
  case 2:
9953
10393
  case "end":
9954
- return _context43.stop();
10394
+ return _context45.stop();
9955
10395
  }
9956
- }, _callee43, this);
10396
+ }, _callee45, this);
9957
10397
  }));
9958
- function unpublishStreams(_x42) {
10398
+ function unpublishStreams(_x44) {
9959
10399
  return _unpublishStreams.apply(this, arguments);
9960
10400
  }
9961
10401
  return unpublishStreams;
@@ -10021,16 +10461,16 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
10021
10461
  }, {
10022
10462
  key: "getMediaReachabilityMetricFields",
10023
10463
  value: (function () {
10024
- var _getMediaReachabilityMetricFields = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee44() {
10464
+ var _getMediaReachabilityMetricFields = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee46() {
10025
10465
  var _this$mediaServerIp, _this$mediaConnection, _this$mediaConnection2, _this$mediaConnection3;
10026
10466
  var reachabilityMetrics, successKeys, totalSuccessCases, selectedSubnetFirstOctet, isSubnetReachable, selectedCluster;
10027
- return _regenerator.default.wrap(function (_context44) {
10028
- while (1) switch (_context44.prev = _context44.next) {
10467
+ return _regenerator.default.wrap(function (_context46) {
10468
+ while (1) switch (_context46.prev = _context46.next) {
10029
10469
  case 0:
10030
- _context44.next = 1;
10470
+ _context46.next = 1;
10031
10471
  return this.webex.meetings.reachability.getReachabilityMetrics();
10032
10472
  case 1:
10033
- reachabilityMetrics = _context44.sent;
10473
+ reachabilityMetrics = _context46.sent;
10034
10474
  successKeys = ['reachability_public_udp_success', 'reachability_public_tcp_success', 'reachability_public_xtls_success', 'reachability_vmn_udp_success', 'reachability_vmn_tcp_success', 'reachability_vmn_xtls_success'];
10035
10475
  totalSuccessCases = successKeys.reduce(function (total, key) {
10036
10476
  var value = reachabilityMetrics[key];
@@ -10047,16 +10487,16 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
10047
10487
  this.webex.meetings.reachability.isSubnetReachable(selectedSubnetFirstOctet);
10048
10488
  }
10049
10489
  selectedCluster = (_this$mediaConnection = (_this$mediaConnection2 = this.mediaConnections) === null || _this$mediaConnection2 === void 0 ? void 0 : (_this$mediaConnection3 = _this$mediaConnection2[0]) === null || _this$mediaConnection3 === void 0 ? void 0 : _this$mediaConnection3.mediaAgentCluster) !== null && _this$mediaConnection !== void 0 ? _this$mediaConnection : null;
10050
- return _context44.abrupt("return", _objectSpread(_objectSpread({}, reachabilityMetrics), {}, {
10490
+ return _context46.abrupt("return", _objectSpread(_objectSpread({}, reachabilityMetrics), {}, {
10051
10491
  subnet_reachable: isSubnetReachable,
10052
10492
  selected_cluster: selectedCluster,
10053
10493
  selected_subnet: selectedSubnetFirstOctet ? "".concat(selectedSubnetFirstOctet, ".X.X.X") : null
10054
10494
  }));
10055
10495
  case 2:
10056
10496
  case "end":
10057
- return _context44.stop();
10497
+ return _context46.stop();
10058
10498
  }
10059
- }, _callee44, this);
10499
+ }, _callee46, this);
10060
10500
  }));
10061
10501
  function getMediaReachabilityMetricFields() {
10062
10502
  return _getMediaReachabilityMetricFields.apply(this, arguments);
@@ -10073,17 +10513,17 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
10073
10513
  }, {
10074
10514
  key: "setStage",
10075
10515
  value: function setStage() {
10076
- var _ref44 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
10077
- _ref44$activeSpeakerP = _ref44.activeSpeakerProportion,
10078
- activeSpeakerProportion = _ref44$activeSpeakerP === void 0 ? 0.5 : _ref44$activeSpeakerP,
10079
- customBackground = _ref44.customBackground,
10080
- customLogo = _ref44.customLogo,
10081
- customNameLabel = _ref44.customNameLabel,
10082
- importantParticipants = _ref44.importantParticipants,
10083
- _ref44$lockAttendeeVi = _ref44.lockAttendeeViewOnStage,
10084
- lockAttendeeViewOnStage = _ref44$lockAttendeeVi === void 0 ? false : _ref44$lockAttendeeVi,
10085
- _ref44$showActiveSpea = _ref44.showActiveSpeaker,
10086
- showActiveSpeaker = _ref44$showActiveSpea === void 0 ? false : _ref44$showActiveSpea;
10516
+ var _ref45 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
10517
+ _ref45$activeSpeakerP = _ref45.activeSpeakerProportion,
10518
+ activeSpeakerProportion = _ref45$activeSpeakerP === void 0 ? 0.5 : _ref45$activeSpeakerP,
10519
+ customBackground = _ref45.customBackground,
10520
+ customLogo = _ref45.customLogo,
10521
+ customNameLabel = _ref45.customNameLabel,
10522
+ importantParticipants = _ref45.importantParticipants,
10523
+ _ref45$lockAttendeeVi = _ref45.lockAttendeeViewOnStage,
10524
+ lockAttendeeViewOnStage = _ref45$lockAttendeeVi === void 0 ? false : _ref45$lockAttendeeVi,
10525
+ _ref45$showActiveSpea = _ref45.showActiveSpeaker,
10526
+ showActiveSpeaker = _ref45$showActiveSpea === void 0 ? false : _ref45$showActiveSpea;
10087
10527
  var videoLayout = {
10088
10528
  overrideDefault: true,
10089
10529
  lockAttendeeViewOnStageOnly: lockAttendeeViewOnStage,
@@ -10187,41 +10627,41 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
10187
10627
  }, {
10188
10628
  key: "refreshDataChannelToken",
10189
10629
  value: (function () {
10190
- var _refreshDataChannelToken = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee45() {
10191
- var isPracticeSession, dataChannelTokenType, res, msg, _t36;
10192
- return _regenerator.default.wrap(function (_context45) {
10193
- while (1) switch (_context45.prev = _context45.next) {
10630
+ var _refreshDataChannelToken = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee47() {
10631
+ var isPracticeSession, dataChannelTokenType, res, msg, _t38;
10632
+ return _regenerator.default.wrap(function (_context47) {
10633
+ while (1) switch (_context47.prev = _context47.next) {
10194
10634
  case 0:
10195
10635
  isPracticeSession = this.webinar.isJoinPracticeSessionDataChannel();
10196
10636
  dataChannelTokenType = this.getDataChannelTokenType();
10197
- _context45.prev = 1;
10198
- _context45.next = 2;
10637
+ _context47.prev = 1;
10638
+ _context47.next = 2;
10199
10639
  return this.meetingRequest.fetchDatachannelToken({
10200
10640
  locusUrl: this.locusUrl,
10201
10641
  requestingParticipantId: this.members.selfId,
10202
10642
  isPracticeSession: isPracticeSession
10203
10643
  });
10204
10644
  case 2:
10205
- res = _context45.sent;
10206
- return _context45.abrupt("return", {
10645
+ res = _context47.sent;
10646
+ return _context47.abrupt("return", {
10207
10647
  body: {
10208
10648
  datachannelToken: res.body.datachannelToken,
10209
10649
  dataChannelTokenType: dataChannelTokenType
10210
10650
  }
10211
10651
  });
10212
10652
  case 3:
10213
- _context45.prev = 3;
10214
- _t36 = _context45["catch"](1);
10215
- msg = (_t36 === null || _t36 === void 0 ? void 0 : _t36.message) || String(_t36);
10653
+ _context47.prev = 3;
10654
+ _t38 = _context47["catch"](1);
10655
+ msg = (_t38 === null || _t38 === void 0 ? void 0 : _t38.message) || String(_t38);
10216
10656
  _loggerProxy.default.logger.warn("Meeting:index#refreshDataChannelToken --> DataChannel token refresh failed (likely locus changed or participant left): ".concat(msg), {
10217
- statusCode: _t36 === null || _t36 === void 0 ? void 0 : _t36.statusCode
10657
+ statusCode: _t38 === null || _t38 === void 0 ? void 0 : _t38.statusCode
10218
10658
  });
10219
- return _context45.abrupt("return", null);
10659
+ return _context47.abrupt("return", null);
10220
10660
  case 4:
10221
10661
  case "end":
10222
- return _context45.stop();
10662
+ return _context47.stop();
10223
10663
  }
10224
- }, _callee45, this, [[1, 3]]);
10664
+ }, _callee47, this, [[1, 3]]);
10225
10665
  }));
10226
10666
  function refreshDataChannelToken() {
10227
10667
  return _refreshDataChannelToken.apply(this, arguments);