@webex/plugin-meetings 3.11.0 → 3.12.0-auth-prejoin-fetch.1

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 (294) hide show
  1. package/AGENTS.md +9 -0
  2. package/dist/aiEnableRequest/index.js +197 -0
  3. package/dist/aiEnableRequest/index.js.map +1 -0
  4. package/dist/aiEnableRequest/utils.js +36 -0
  5. package/dist/aiEnableRequest/utils.js.map +1 -0
  6. package/dist/annotation/index.js +16 -7
  7. package/dist/annotation/index.js.map +1 -1
  8. package/dist/breakouts/breakout.js +8 -3
  9. package/dist/breakouts/breakout.js.map +1 -1
  10. package/dist/breakouts/events.js +29 -14
  11. package/dist/breakouts/events.js.map +1 -1
  12. package/dist/breakouts/index.js +99 -4
  13. package/dist/breakouts/index.js.map +1 -1
  14. package/dist/common/errors/webex-errors.js +49 -5
  15. package/dist/common/errors/webex-errors.js.map +1 -1
  16. package/dist/config.js +8 -3
  17. package/dist/config.js.map +1 -1
  18. package/dist/constants.js +60 -11
  19. package/dist/constants.js.map +1 -1
  20. package/dist/controls-options-manager/constants.js +11 -1
  21. package/dist/controls-options-manager/constants.js.map +1 -1
  22. package/dist/controls-options-manager/index.js +67 -29
  23. package/dist/controls-options-manager/index.js.map +1 -1
  24. package/dist/controls-options-manager/util.js +91 -0
  25. package/dist/controls-options-manager/util.js.map +1 -1
  26. package/dist/hashTree/constants.js +16 -2
  27. package/dist/hashTree/constants.js.map +1 -1
  28. package/dist/hashTree/hashTree.js +18 -0
  29. package/dist/hashTree/hashTree.js.map +1 -1
  30. package/dist/hashTree/hashTreeParser.js +1655 -538
  31. package/dist/hashTree/hashTreeParser.js.map +1 -1
  32. package/dist/hashTree/types.js +4 -2
  33. package/dist/hashTree/types.js.map +1 -1
  34. package/dist/hashTree/utils.js +52 -0
  35. package/dist/hashTree/utils.js.map +1 -1
  36. package/dist/index.js +18 -2
  37. package/dist/index.js.map +1 -1
  38. package/dist/interceptors/constant.js +12 -0
  39. package/dist/interceptors/constant.js.map +1 -0
  40. package/dist/interceptors/dataChannelAuthToken.js +350 -0
  41. package/dist/interceptors/dataChannelAuthToken.js.map +1 -0
  42. package/dist/interceptors/index.js +7 -0
  43. package/dist/interceptors/index.js.map +1 -1
  44. package/dist/interceptors/locusRetry.js +23 -8
  45. package/dist/interceptors/locusRetry.js.map +1 -1
  46. package/dist/interceptors/utils.js +27 -0
  47. package/dist/interceptors/utils.js.map +1 -0
  48. package/dist/interpretation/index.js +11 -2
  49. package/dist/interpretation/index.js.map +1 -1
  50. package/dist/interpretation/interpretation.types.js +7 -0
  51. package/dist/interpretation/interpretation.types.js.map +1 -0
  52. package/dist/interpretation/siLanguage.js +1 -1
  53. package/dist/locus-info/controlsUtils.js +9 -4
  54. package/dist/locus-info/controlsUtils.js.map +1 -1
  55. package/dist/locus-info/index.js +914 -212
  56. package/dist/locus-info/index.js.map +1 -1
  57. package/dist/locus-info/infoUtils.js +36 -5
  58. package/dist/locus-info/infoUtils.js.map +1 -1
  59. package/dist/locus-info/selfUtils.js +1 -0
  60. package/dist/locus-info/selfUtils.js.map +1 -1
  61. package/dist/locus-info/types.js +19 -0
  62. package/dist/locus-info/types.js.map +1 -1
  63. package/dist/media/MediaConnectionAwaiter.js +72 -3
  64. package/dist/media/MediaConnectionAwaiter.js.map +1 -1
  65. package/dist/media/index.js +8 -2
  66. package/dist/media/index.js.map +1 -1
  67. package/dist/media/properties.js +8 -7
  68. package/dist/media/properties.js.map +1 -1
  69. package/dist/meeting/in-meeting-actions.js +11 -1
  70. package/dist/meeting/in-meeting-actions.js.map +1 -1
  71. package/dist/meeting/index.js +2357 -1094
  72. package/dist/meeting/index.js.map +1 -1
  73. package/dist/meeting/locusMediaRequest.js +229 -82
  74. package/dist/meeting/locusMediaRequest.js.map +1 -1
  75. package/dist/meeting/muteState.js +10 -1
  76. package/dist/meeting/muteState.js.map +1 -1
  77. package/dist/meeting/request.js +55 -2
  78. package/dist/meeting/request.js.map +1 -1
  79. package/dist/meeting/request.type.js.map +1 -1
  80. package/dist/meeting/util.js +168 -5
  81. package/dist/meeting/util.js.map +1 -1
  82. package/dist/meeting-info/meeting-info-v2.js +100 -38
  83. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  84. package/dist/meetings/index.js +466 -174
  85. package/dist/meetings/index.js.map +1 -1
  86. package/dist/meetings/meetings.types.js +6 -1
  87. package/dist/meetings/meetings.types.js.map +1 -1
  88. package/dist/meetings/request.js +39 -0
  89. package/dist/meetings/request.js.map +1 -1
  90. package/dist/meetings/util.js +116 -18
  91. package/dist/meetings/util.js.map +1 -1
  92. package/dist/member/index.js +20 -0
  93. package/dist/member/index.js.map +1 -1
  94. package/dist/member/types.js.map +1 -1
  95. package/dist/member/util.js +40 -0
  96. package/dist/member/util.js.map +1 -1
  97. package/dist/members/index.js +101 -43
  98. package/dist/members/index.js.map +1 -1
  99. package/dist/members/util.js +8 -1
  100. package/dist/members/util.js.map +1 -1
  101. package/dist/metrics/constants.js +12 -1
  102. package/dist/metrics/constants.js.map +1 -1
  103. package/dist/multistream/codec/constants.js +63 -0
  104. package/dist/multistream/codec/constants.js.map +1 -0
  105. package/dist/multistream/mediaRequestManager.js +64 -68
  106. package/dist/multistream/mediaRequestManager.js.map +1 -1
  107. package/dist/multistream/receiveSlot.js +9 -0
  108. package/dist/multistream/receiveSlot.js.map +1 -1
  109. package/dist/multistream/remoteMediaManager.js +11 -0
  110. package/dist/multistream/remoteMediaManager.js.map +1 -1
  111. package/dist/multistream/sendSlotManager.js +116 -2
  112. package/dist/multistream/sendSlotManager.js.map +1 -1
  113. package/dist/reachability/clusterReachability.js.map +1 -1
  114. package/dist/reachability/index.js +139 -93
  115. package/dist/reachability/index.js.map +1 -1
  116. package/dist/reachability/reachability.types.js +2 -0
  117. package/dist/reachability/reachability.types.js.map +1 -1
  118. package/dist/reachability/util.js +45 -0
  119. package/dist/reachability/util.js.map +1 -1
  120. package/dist/reactions/reactions.type.js.map +1 -1
  121. package/dist/reconnection-manager/index.js +0 -1
  122. package/dist/reconnection-manager/index.js.map +1 -1
  123. package/dist/recording-controller/index.js +1 -3
  124. package/dist/recording-controller/index.js.map +1 -1
  125. package/dist/roap/turnDiscovery.js +8 -1
  126. package/dist/roap/turnDiscovery.js.map +1 -1
  127. package/dist/types/aiEnableRequest/index.d.ts +5 -0
  128. package/dist/types/aiEnableRequest/utils.d.ts +2 -0
  129. package/dist/types/common/errors/webex-errors.d.ts +32 -2
  130. package/dist/types/config.d.ts +6 -2
  131. package/dist/types/constants.d.ts +35 -1
  132. package/dist/types/controls-options-manager/constants.d.ts +6 -1
  133. package/dist/types/controls-options-manager/index.d.ts +16 -0
  134. package/dist/types/hashTree/constants.d.ts +3 -0
  135. package/dist/types/hashTree/hashTree.d.ts +7 -0
  136. package/dist/types/hashTree/hashTreeParser.d.ts +315 -30
  137. package/dist/types/hashTree/types.d.ts +3 -0
  138. package/dist/types/hashTree/utils.d.ts +24 -0
  139. package/dist/types/index.d.ts +4 -0
  140. package/dist/types/interceptors/constant.d.ts +5 -0
  141. package/dist/types/interceptors/dataChannelAuthToken.d.ts +43 -0
  142. package/dist/types/interceptors/index.d.ts +2 -1
  143. package/dist/types/interceptors/locusRetry.d.ts +4 -4
  144. package/dist/types/interceptors/utils.d.ts +1 -0
  145. package/dist/types/interpretation/interpretation.types.d.ts +10 -0
  146. package/dist/types/locus-info/index.d.ts +126 -15
  147. package/dist/types/locus-info/infoUtils.d.ts +8 -0
  148. package/dist/types/locus-info/types.d.ts +28 -1
  149. package/dist/types/media/MediaConnectionAwaiter.d.ts +20 -2
  150. package/dist/types/media/properties.d.ts +8 -3
  151. package/dist/types/meeting/in-meeting-actions.d.ts +10 -0
  152. package/dist/types/meeting/index.d.ts +253 -16
  153. package/dist/types/meeting/locusMediaRequest.d.ts +12 -0
  154. package/dist/types/meeting/request.d.ts +17 -1
  155. package/dist/types/meeting/request.type.d.ts +5 -0
  156. package/dist/types/meeting/util.d.ts +40 -0
  157. package/dist/types/meeting-info/meeting-info-v2.d.ts +25 -1
  158. package/dist/types/meetings/index.d.ts +54 -21
  159. package/dist/types/meetings/meetings.types.d.ts +30 -1
  160. package/dist/types/meetings/request.d.ts +14 -0
  161. package/dist/types/member/index.d.ts +2 -0
  162. package/dist/types/member/types.d.ts +1 -0
  163. package/dist/types/member/util.d.ts +14 -0
  164. package/dist/types/members/index.d.ts +15 -2
  165. package/dist/types/members/util.d.ts +1 -5
  166. package/dist/types/metrics/constants.d.ts +11 -0
  167. package/dist/types/multistream/codec/constants.d.ts +7 -0
  168. package/dist/types/multistream/mediaRequestManager.d.ts +20 -26
  169. package/dist/types/multistream/sendSlotManager.d.ts +23 -1
  170. package/dist/types/reachability/clusterReachability.d.ts +3 -3
  171. package/dist/types/reachability/index.d.ts +10 -3
  172. package/dist/types/reachability/reachability.types.d.ts +7 -0
  173. package/dist/types/reachability/util.d.ts +17 -0
  174. package/dist/types/reactions/reactions.type.d.ts +4 -0
  175. package/dist/types/webinar/utils.d.ts +6 -0
  176. package/dist/webinar/index.js +585 -164
  177. package/dist/webinar/index.js.map +1 -1
  178. package/dist/webinar/utils.js +25 -0
  179. package/dist/webinar/utils.js.map +1 -0
  180. package/package.json +24 -23
  181. package/src/aiEnableRequest/README.md +84 -0
  182. package/src/aiEnableRequest/index.ts +186 -0
  183. package/src/aiEnableRequest/utils.ts +25 -0
  184. package/src/annotation/index.ts +32 -10
  185. package/src/breakouts/breakout.ts +3 -1
  186. package/src/breakouts/events.ts +33 -11
  187. package/src/breakouts/index.ts +122 -2
  188. package/src/common/errors/webex-errors.ts +50 -3
  189. package/src/config.ts +6 -2
  190. package/src/constants.ts +49 -3
  191. package/src/controls-options-manager/constants.ts +14 -1
  192. package/src/controls-options-manager/index.ts +87 -28
  193. package/src/controls-options-manager/util.ts +81 -1
  194. package/src/hashTree/constants.ts +17 -0
  195. package/src/hashTree/hashTree.ts +17 -0
  196. package/src/hashTree/hashTreeParser.ts +1482 -361
  197. package/src/hashTree/types.ts +4 -0
  198. package/src/hashTree/utils.ts +45 -0
  199. package/src/index.ts +14 -1
  200. package/src/interceptors/constant.ts +6 -0
  201. package/src/interceptors/dataChannelAuthToken.ts +246 -0
  202. package/src/interceptors/index.ts +2 -1
  203. package/src/interceptors/locusRetry.ts +25 -4
  204. package/src/interceptors/utils.ts +16 -0
  205. package/src/interpretation/index.ts +29 -11
  206. package/src/interpretation/interpretation.types.ts +11 -0
  207. package/src/locus-info/controlsUtils.ts +14 -1
  208. package/src/locus-info/index.ts +976 -203
  209. package/src/locus-info/infoUtils.ts +41 -6
  210. package/src/locus-info/selfUtils.ts +1 -0
  211. package/src/locus-info/types.ts +33 -1
  212. package/src/media/MediaConnectionAwaiter.ts +62 -5
  213. package/src/media/index.ts +10 -1
  214. package/src/media/properties.ts +11 -4
  215. package/src/meeting/in-meeting-actions.ts +20 -0
  216. package/src/meeting/index.ts +1314 -178
  217. package/src/meeting/locusMediaRequest.ts +106 -6
  218. package/src/meeting/muteState.ts +10 -1
  219. package/src/meeting/request.ts +53 -0
  220. package/src/meeting/request.type.ts +6 -0
  221. package/src/meeting/util.ts +207 -7
  222. package/src/meeting-info/meeting-info-v2.ts +83 -21
  223. package/src/meetings/index.ts +402 -121
  224. package/src/meetings/meetings.types.ts +36 -1
  225. package/src/meetings/request.ts +43 -0
  226. package/src/meetings/util.ts +117 -4
  227. package/src/member/index.ts +20 -0
  228. package/src/member/types.ts +1 -0
  229. package/src/member/util.ts +41 -0
  230. package/src/members/index.ts +70 -7
  231. package/src/members/util.ts +12 -4
  232. package/src/metrics/constants.ts +12 -0
  233. package/src/multistream/codec/constants.ts +58 -0
  234. package/src/multistream/mediaRequestManager.ts +117 -76
  235. package/src/multistream/receiveSlot.ts +18 -0
  236. package/src/multistream/remoteMediaManager.ts +13 -0
  237. package/src/multistream/sendSlotManager.ts +97 -3
  238. package/src/reachability/clusterReachability.ts +3 -2
  239. package/src/reachability/index.ts +56 -16
  240. package/src/reachability/reachability.types.ts +11 -0
  241. package/src/reachability/util.ts +36 -0
  242. package/src/reactions/reactions.type.ts +4 -0
  243. package/src/reconnection-manager/index.ts +0 -1
  244. package/src/recording-controller/index.ts +1 -2
  245. package/src/roap/turnDiscovery.ts +9 -1
  246. package/src/webinar/index.ts +448 -11
  247. package/src/webinar/utils.ts +16 -0
  248. package/test/unit/spec/aiEnableRequest/index.ts +1067 -0
  249. package/test/unit/spec/aiEnableRequest/utils.ts +130 -0
  250. package/test/unit/spec/annotation/index.ts +70 -8
  251. package/test/unit/spec/breakouts/breakout.ts +9 -3
  252. package/test/unit/spec/breakouts/events.ts +120 -2
  253. package/test/unit/spec/breakouts/index.ts +223 -3
  254. package/test/unit/spec/common/errors/webex-errors.ts +78 -0
  255. package/test/unit/spec/controls-options-manager/index.js +244 -29
  256. package/test/unit/spec/controls-options-manager/util.js +165 -0
  257. package/test/unit/spec/hashTree/hashTree.ts +66 -0
  258. package/test/unit/spec/hashTree/hashTreeParser.ts +4528 -171
  259. package/test/unit/spec/hashTree/utils.ts +125 -1
  260. package/test/unit/spec/interceptors/dataChannelAuthToken.ts +406 -0
  261. package/test/unit/spec/interceptors/locusRetry.ts +205 -4
  262. package/test/unit/spec/interceptors/utils.ts +75 -0
  263. package/test/unit/spec/interpretation/index.ts +26 -4
  264. package/test/unit/spec/locus-info/controlsUtils.js +200 -56
  265. package/test/unit/spec/locus-info/index.js +1861 -149
  266. package/test/unit/spec/locus-info/infoUtils.js +184 -1
  267. package/test/unit/spec/media/MediaConnectionAwaiter.ts +96 -1
  268. package/test/unit/spec/media/index.ts +92 -0
  269. package/test/unit/spec/media/properties.ts +35 -26
  270. package/test/unit/spec/meeting/in-meeting-actions.ts +12 -2
  271. package/test/unit/spec/meeting/index.js +3766 -417
  272. package/test/unit/spec/meeting/locusMediaRequest.ts +406 -4
  273. package/test/unit/spec/meeting/muteState.js +81 -0
  274. package/test/unit/spec/meeting/request.js +82 -0
  275. package/test/unit/spec/meeting/utils.js +595 -27
  276. package/test/unit/spec/meeting-info/meetinginfov2.js +286 -10
  277. package/test/unit/spec/meetings/index.js +1400 -78
  278. package/test/unit/spec/meetings/request.js +141 -0
  279. package/test/unit/spec/meetings/utils.js +402 -51
  280. package/test/unit/spec/member/index.js +35 -4
  281. package/test/unit/spec/member/util.js +154 -27
  282. package/test/unit/spec/members/index.js +216 -0
  283. package/test/unit/spec/members/request.js +37 -1
  284. package/test/unit/spec/members/utils.js +63 -0
  285. package/test/unit/spec/multistream/mediaRequestManager.ts +503 -122
  286. package/test/unit/spec/multistream/remoteMediaManager.ts +30 -0
  287. package/test/unit/spec/multistream/sendSlotManager.ts +135 -36
  288. package/test/unit/spec/reachability/index.ts +151 -46
  289. package/test/unit/spec/reachability/util.ts +31 -0
  290. package/test/unit/spec/reconnection-manager/index.js +4 -8
  291. package/test/unit/spec/recording-controller/index.js +9 -8
  292. package/test/unit/spec/roap/turnDiscovery.ts +20 -0
  293. package/test/unit/spec/webinar/index.ts +837 -39
  294. package/test/unit/spec/webinar/utils.ts +39 -0
@@ -14,12 +14,13 @@ _Object$defineProperty(exports, "__esModule", {
14
14
  value: true
15
15
  });
16
16
  exports.default = void 0;
17
+ var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
18
+ var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
17
19
  var _map = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/map"));
18
20
  var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
19
21
  var _now = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/date/now"));
20
22
  var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/keys"));
21
23
  var _values = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/values"));
22
- var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
23
24
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/toConsumableArray"));
24
25
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
25
26
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/possibleConstructorReturn"));
@@ -29,6 +30,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/he
29
30
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
30
31
  var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
31
32
  var _lodash = require("lodash");
33
+ var _webCapabilities = require("@webex/web-capabilities");
32
34
  require("@webex/internal-plugin-mercury");
33
35
  require("@webex/internal-plugin-conversation");
34
36
  require("@webex/internal-plugin-metrics");
@@ -48,7 +50,7 @@ var _constants = require("../constants");
48
50
  var _constants2 = _interopRequireDefault(require("../metrics/constants"));
49
51
  var _meetingInfo = _interopRequireDefault(require("../meeting-info"));
50
52
  var _meetingInfoV = _interopRequireDefault(require("../meeting-info/meeting-info-v2"));
51
- var _meeting = _interopRequireDefault(require("../meeting"));
53
+ var _meeting = _interopRequireWildcard(require("../meeting"));
52
54
  var _personalMeetingRoom = _interopRequireDefault(require("../personal-meeting-room"));
53
55
  var _reachability = _interopRequireDefault(require("../reachability"));
54
56
  var _request2 = _interopRequireDefault(require("./request"));
@@ -63,7 +65,8 @@ var _webexErrors = require("../common/errors/webex-errors");
63
65
  var _noMeetingInfo = _interopRequireDefault(require("../common/errors/no-meeting-info"));
64
66
  var _joinForbiddenError = _interopRequireDefault(require("../common/errors/join-forbidden-error"));
65
67
  var _utils = require("../hashTree/utils");
66
- function _interopRequireWildcard(e, t) { if ("function" == typeof _WeakMap) var r = new _WeakMap(), n = new _WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t3 in e) "default" !== _t3 && {}.hasOwnProperty.call(e, _t3) && ((i = (o = _Object$defineProperty) && _Object$getOwnPropertyDescriptor(e, _t3)) && (i.get || i.set) ? o(f, _t3, i) : f[_t3] = e[_t3]); return f; })(e, t); }
68
+ var _locusInfo = require("../locus-info");
69
+ function _interopRequireWildcard(e, t) { if ("function" == typeof _WeakMap) var r = new _WeakMap(), n = new _WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t4 in e) "default" !== _t4 && {}.hasOwnProperty.call(e, _t4) && ((i = (o = _Object$defineProperty) && _Object$getOwnPropertyDescriptor(e, _t4)) && (i.get || i.set) ? o(f, _t4, i) : f[_t4] = e[_t4]); return f; })(e, t); }
67
70
  function ownKeys(e, r) { var t = _Object$keys2(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
68
71
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
69
72
  function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
@@ -194,6 +197,8 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
194
197
  (0, _defineProperty2.default)(_this, "preferredWebexSite", void 0);
195
198
  (0, _defineProperty2.default)(_this, "reachability", void 0);
196
199
  (0, _defineProperty2.default)(_this, "registered", void 0);
200
+ (0, _defineProperty2.default)(_this, "registrationPromise", void 0);
201
+ (0, _defineProperty2.default)(_this, "unregistrationPromise", void 0);
197
202
  (0, _defineProperty2.default)(_this, "request", void 0);
198
203
  (0, _defineProperty2.default)(_this, "geoHintInfo", void 0);
199
204
  (0, _defineProperty2.default)(_this, "meetingInfo", void 0);
@@ -201,6 +206,51 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
201
206
  (0, _defineProperty2.default)(_this, "breakoutLocusForHandleLater", void 0);
202
207
  (0, _defineProperty2.default)(_this, "namespace", _constants.MEETINGS);
203
208
  (0, _defineProperty2.default)(_this, "registrationStatus", void 0);
209
+ /**
210
+ * Emits a metric describing how well this browser runs WebAssembly, used to spot browsers
211
+ * where real-time WASM effects (e.g. background noise removal) run poorly.
212
+ *
213
+ * @param {string} correlationId - correlation id to report the result against
214
+ * @returns {void}
215
+ */
216
+ (0, _defineProperty2.default)(_this, "emitWasmRuntimePerformance", (0, _lodash.once)(function (correlationId) {
217
+ // Probe and telemetry failures must not prevent meeting creation.
218
+ _webCapabilities.WasmRuntimeProbe.check().then(function (result) {
219
+ var status = result.status,
220
+ capability = result.capability,
221
+ reason = result.reason,
222
+ measurements = result.measurements;
223
+ var _ref = measurements !== null && measurements !== void 0 ? measurements : {},
224
+ _ref$divRatio = _ref.divRatio,
225
+ divRatio = _ref$divRatio === void 0 ? null : _ref$divRatio,
226
+ _ref$sqrtRatio = _ref.sqrtRatio,
227
+ sqrtRatio = _ref$sqrtRatio === void 0 ? null : _ref$sqrtRatio,
228
+ _ref$addNsPerOp = _ref.addNsPerOp,
229
+ addNsPerOp = _ref$addNsPerOp === void 0 ? null : _ref$addNsPerOp,
230
+ _ref$addMedianMs = _ref.addMedianMs,
231
+ addMedianMs = _ref$addMedianMs === void 0 ? null : _ref$addMedianMs,
232
+ _ref$divMedianMs = _ref.divMedianMs,
233
+ divMedianMs = _ref$divMedianMs === void 0 ? null : _ref$divMedianMs,
234
+ _ref$sqrtMedianMs = _ref.sqrtMedianMs,
235
+ sqrtMedianMs = _ref$sqrtMedianMs === void 0 ? null : _ref$sqrtMedianMs;
236
+ var measurementsLog = (0, _stringify.default)(measurements);
237
+ _loggerProxy.default.logger.log("Meetings:index#emitWasmRuntimePerformance --> WASM runtime performance status: ".concat(status, ", capability: ").concat(capability, ", reason: ").concat(reason, ", measurements: ").concat(measurementsLog));
238
+ return _metrics.default.sendBehavioralMetric(_constants2.default.WASM_RUNTIME_PERFORMANCE, {
239
+ status: status,
240
+ capability: capability,
241
+ reason: reason,
242
+ divRatio: divRatio,
243
+ sqrtRatio: sqrtRatio,
244
+ addNsPerOp: addNsPerOp,
245
+ addMedianMs: addMedianMs,
246
+ divMedianMs: divMedianMs,
247
+ sqrtMedianMs: sqrtMedianMs,
248
+ correlation_id: correlationId
249
+ });
250
+ }).catch(function (error) {
251
+ _loggerProxy.default.logger.error("Meetings:index#emitWasmRuntimePerformance --> ERROR, failed to probe or report WASM runtime performance: ".concat(error.message));
252
+ });
253
+ }));
204
254
  /**
205
255
  * Creates a noise reduction effect
206
256
  *
@@ -210,7 +260,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
210
260
  * @memberof Meetings
211
261
  */
212
262
  (0, _defineProperty2.default)(_this, "createNoiseReductionEffect", /*#__PURE__*/function () {
213
- var _ref = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(options) {
263
+ var _ref2 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(options) {
214
264
  var authToken;
215
265
  return _regenerator.default.wrap(function (_context) {
216
266
  while (1) switch (_context.prev = _context.next) {
@@ -227,7 +277,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
227
277
  }, _callee);
228
278
  }));
229
279
  return function (_x) {
230
- return _ref.apply(this, arguments);
280
+ return _ref2.apply(this, arguments);
231
281
  };
232
282
  }());
233
283
  /**
@@ -239,7 +289,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
239
289
  * @memberof Meetings
240
290
  */
241
291
  (0, _defineProperty2.default)(_this, "createVirtualBackgroundEffect", /*#__PURE__*/function () {
242
- var _ref2 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2(options) {
292
+ var _ref3 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2(options) {
243
293
  var authToken;
244
294
  return _regenerator.default.wrap(function (_context2) {
245
295
  while (1) switch (_context2.prev = _context2.next) {
@@ -256,7 +306,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
256
306
  }, _callee2);
257
307
  }));
258
308
  return function (_x2) {
259
- return _ref2.apply(this, arguments);
309
+ return _ref3.apply(this, arguments);
260
310
  };
261
311
  }());
262
312
  _this.mediaHelpers = mediaHelpersModule;
@@ -351,11 +401,11 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
351
401
  return (0, _createClass2.default)(Meetings, [{
352
402
  key: "isNeedHandleMainLocus",
353
403
  value: function isNeedHandleMainLocus(meeting, newLocus) {
354
- var _newLocus$controls, _newLocus$controls$br, _newLocus$self, _newLocus$self2, _newLocus$self3, _breakoutLocus$joined, _newLocus$self4;
404
+ var _newLocus$controls, _newLocus$controls$br, _newLocus$self, _breakoutLocus$joined, _newLocus$self2;
355
405
  var breakoutUrl = (_newLocus$controls = newLocus.controls) === null || _newLocus$controls === void 0 ? void 0 : (_newLocus$controls$br = _newLocus$controls.breakout) === null || _newLocus$controls$br === void 0 ? void 0 : _newLocus$controls$br.url;
356
406
  var breakoutLocus = this.meetingCollection.getActiveBreakoutLocus(breakoutUrl);
357
407
  var isSelfJoined = (newLocus === null || newLocus === void 0 ? void 0 : (_newLocus$self = newLocus.self) === null || _newLocus$self === void 0 ? void 0 : _newLocus$self.state) === _constants._JOINED_;
358
- var isSelfMoved = (newLocus === null || newLocus === void 0 ? void 0 : (_newLocus$self2 = newLocus.self) === null || _newLocus$self2 === void 0 ? void 0 : _newLocus$self2.state) === _constants._LEFT_ && (newLocus === null || newLocus === void 0 ? void 0 : (_newLocus$self3 = newLocus.self) === null || _newLocus$self3 === void 0 ? void 0 : _newLocus$self3.reason) === _constants._MOVED_;
408
+ var isSelfMoved = _util2.default.isSelfMovedOrBreakoutEnded(newLocus);
359
409
  // @ts-ignore
360
410
  var deviceFromNewLocus = _util2.default.getThisDevice(newLocus, this.webex.internal.device.url);
361
411
  var isResourceMovedOnThisDevice = (deviceFromNewLocus === null || deviceFromNewLocus === void 0 ? void 0 : deviceFromNewLocus.state) === _constants._LEFT_ && (deviceFromNewLocus === null || deviceFromNewLocus === void 0 ? void 0 : deviceFromNewLocus.reason) === _constants._MOVED_;
@@ -380,7 +430,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
380
430
  _loggerProxy.default.logger.log("Meetings:index#isNeedHandleMainLocus --> there is active breakout session and joined on this device, and don't need to handle main session: ".concat(breakoutUrl));
381
431
  return false;
382
432
  }
383
- if (isSelfMoved && (newLocus !== null && newLocus !== void 0 && (_newLocus$self4 = newLocus.self) !== null && _newLocus$self4 !== void 0 && _newLocus$self4.removed || isResourceMovedOnThisDevice)) {
433
+ if (isSelfMoved && (newLocus !== null && newLocus !== void 0 && (_newLocus$self2 = newLocus.self) !== null && _newLocus$self2 !== void 0 && _newLocus$self2.removed || isResourceMovedOnThisDevice)) {
384
434
  _loggerProxy.default.logger.log('Meetings:index#isNeedHandleMainLocus --> self moved main locus with self removed status or with device resource moved, not need to handle');
385
435
  return false;
386
436
  }
@@ -404,15 +454,15 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
404
454
  key: "isNeedHandleLocusDTO",
405
455
  value: function isNeedHandleLocusDTO(meeting, newLocus) {
406
456
  if (newLocus) {
407
- var _newLocus$self5, _newLocus$self6, _newLocus$self7, _newLocus$self7$devic, _newLocus$self7$devic2, _newLocus$self8, _newLocus$self8$devic, _newLocus$self8$devic2;
457
+ var _newLocus$self3, _newLocus$self3$devic, _newLocus$self3$devic2, _newLocus$self4, _newLocus$self4$devic, _newLocus$self4$devic2;
408
458
  var isNewLocusAsBreakout = _util2.default.isBreakoutLocusDTO(newLocus);
409
- var isSelfMoved = (newLocus === null || newLocus === void 0 ? void 0 : (_newLocus$self5 = newLocus.self) === null || _newLocus$self5 === void 0 ? void 0 : _newLocus$self5.state) === _constants._LEFT_ && (newLocus === null || newLocus === void 0 ? void 0 : (_newLocus$self6 = newLocus.self) === null || _newLocus$self6 === void 0 ? void 0 : _newLocus$self6.reason) === _constants._MOVED_;
410
- var isSelfMovedToLobby = (newLocus === null || newLocus === void 0 ? void 0 : (_newLocus$self7 = newLocus.self) === null || _newLocus$self7 === void 0 ? void 0 : (_newLocus$self7$devic = _newLocus$self7.devices[0]) === null || _newLocus$self7$devic === void 0 ? void 0 : (_newLocus$self7$devic2 = _newLocus$self7$devic.intent) === null || _newLocus$self7$devic2 === void 0 ? void 0 : _newLocus$self7$devic2.reason) === _constants._ON_HOLD_LOBBY_ && (newLocus === null || newLocus === void 0 ? void 0 : (_newLocus$self8 = newLocus.self) === null || _newLocus$self8 === void 0 ? void 0 : (_newLocus$self8$devic = _newLocus$self8.devices[0]) === null || _newLocus$self8$devic === void 0 ? void 0 : (_newLocus$self8$devic2 = _newLocus$self8$devic.intent) === null || _newLocus$self8$devic2 === void 0 ? void 0 : _newLocus$self8$devic2.type) === _constants._WAIT_;
459
+ var isSelfMoved = _util2.default.isSelfMovedOrBreakoutEnded(newLocus);
460
+ var isSelfMovedToLobby = (newLocus === null || newLocus === void 0 ? void 0 : (_newLocus$self3 = newLocus.self) === null || _newLocus$self3 === void 0 ? void 0 : (_newLocus$self3$devic = _newLocus$self3.devices[0]) === null || _newLocus$self3$devic === void 0 ? void 0 : (_newLocus$self3$devic2 = _newLocus$self3$devic.intent) === null || _newLocus$self3$devic2 === void 0 ? void 0 : _newLocus$self3$devic2.reason) === _constants._ON_HOLD_LOBBY_ && (newLocus === null || newLocus === void 0 ? void 0 : (_newLocus$self4 = newLocus.self) === null || _newLocus$self4 === void 0 ? void 0 : (_newLocus$self4$devic = _newLocus$self4.devices[0]) === null || _newLocus$self4$devic === void 0 ? void 0 : (_newLocus$self4$devic2 = _newLocus$self4$devic.intent) === null || _newLocus$self4$devic2 === void 0 ? void 0 : _newLocus$self4$devic2.type) === _constants._WAIT_;
411
461
  if (!meeting) {
412
462
  if (isNewLocusAsBreakout) {
413
- var _newLocus$fullState, _newLocus$self9;
463
+ var _newLocus$fullState, _newLocus$self5;
414
464
  _loggerProxy.default.logger.log("Meetings:index#isNeedHandleLocusDTO --> the first breakout session locusDTO active status: ".concat((_newLocus$fullState = newLocus.fullState) === null || _newLocus$fullState === void 0 ? void 0 : _newLocus$fullState.active));
415
- return ((_newLocus$self9 = newLocus.self) === null || _newLocus$self9 === void 0 ? void 0 : _newLocus$self9.state) === _constants._JOINED_;
465
+ return ((_newLocus$self5 = newLocus.self) === null || _newLocus$self5 === void 0 ? void 0 : _newLocus$self5.state) === _constants._JOINED_;
416
466
  }
417
467
  return this.isNeedHandleMainLocus(meeting, newLocus);
418
468
  }
@@ -446,6 +496,13 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
446
496
  if (existingMeeting) {
447
497
  return existingMeeting;
448
498
  }
499
+ if (data.eventType === _constants.LOCUSEVENT.HASH_TREE_DATA_UPDATED) {
500
+ // need to check if maybe this event indicates a move to/from breakout
501
+ var meetingForHashTreeMessage = (0, _locusInfo.findMeetingForHashTreeMessage)(data === null || data === void 0 ? void 0 : data.stateElementsMessage, this.meetingCollection);
502
+ if (meetingForHashTreeMessage) {
503
+ return meetingForHashTreeMessage;
504
+ }
505
+ }
449
506
 
450
507
  // if that didn't work, fallback to other fields like correlationId, sipUri, etc
451
508
 
@@ -481,6 +538,10 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
481
538
  var _this2 = this;
482
539
  var useRandomDelayForInfo = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
483
540
  var meeting = this.getCorrespondingMeetingByLocus(data);
541
+ // @ts-ignore
542
+ if (this.config.experimental.storeLocusHashTreeEventsForDebugging) {
543
+ (0, _meeting.storeEventForDebugging)('mercury', data);
544
+ }
484
545
 
485
546
  // Special case when locus has got replaced, This only happend once if a replace locus exists
486
547
  // https://sqbu-github.cisco.com/WebExSquared/locus/wiki/Locus-changing-mid-call
@@ -492,7 +553,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
492
553
  meeting = this.meetingCollection.getByKey(_meetings.MEETING_KEY.LOCUS_URL, data.locus.replaces[data.locus.replaces.length - 1].locusUrl);
493
554
  }
494
555
  if (meeting && !_util2.default.isBreakoutLocusDTO(data.locus)) {
495
- meeting.locusInfo.updateMainSessionLocusCache(data.locus);
556
+ meeting.locusInfo.updateMainSessionLocusCache(data.locus); // here data.locus will never be a complete locus
496
557
  }
497
558
  if (!this.isNeedHandleLocusDTO(meeting, data.locus)) {
498
559
  _loggerProxy.default.logger.log("Meetings:index#handleLocusEvent --> doesn't need to process locus event");
@@ -519,28 +580,32 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
519
580
  // };
520
581
  // rather then locus object change to locus url
521
582
 
522
- if (data.eventType !== _constants.LOCUSEVENT.HASH_TREE_DATA_UPDATED) {
523
- if (data.locus && data.locus.fullState && data.locus.fullState.state === _constants.LOCUS.STATE.INACTIVE) {
524
- // just ignore the event as its already ended and not active
525
- _loggerProxy.default.logger.warn('Meetings:index#handleLocusEvent --> Locus event received for meeting, after it was ended.');
526
- return;
527
- }
583
+ if (data.eventType === _constants.LOCUSEVENT.HASH_TREE_DATA_UPDATED) {
584
+ // We're about to create a new meeting object from this hash tree message.
585
+ // There is some existing (pre-hash trees) SDK logic here that requires a locus object
586
+ // (at the very minimum we need locus.url to be set)
587
+ // so we try to create locus from the received hash tree message
588
+ // it will not be complete, in most cases it will only have the self part, but that's still better than nothing
589
+ var _createLocusFromHashT = (0, _locusInfo.createLocusFromHashTreeMessage)(data.stateElementsMessage),
590
+ locus = _createLocusFromHashT.locus;
591
+ data.locus = locus;
592
+ }
593
+ if (data.locus && data.locus.fullState && data.locus.fullState.state === _constants.LOCUS.STATE.INACTIVE) {
594
+ // just ignore the event as its already ended and not active
595
+ _loggerProxy.default.logger.warn('Meetings:index#handleLocusEvent --> Locus event received for meeting, after it was ended.');
596
+ return;
597
+ }
528
598
 
529
- // When its wireless share or guest and user leaves the meeting we dont have to keep the meeting object
530
- // Any future events will be neglected
599
+ // When its wireless share or guest and user leaves the meeting we dont have to keep the meeting object
600
+ // Any future events will be neglected
531
601
 
532
- if (data.locus && data.locus.self && data.locus.self.state === _constants._LEFT_ && data.locus.self.removed === true) {
533
- // just ignore the event as its already ended and not active
534
- _loggerProxy.default.logger.warn('Meetings:index#handleLocusEvent --> Locus event received for meeting, after it was ended.');
535
- return;
536
- }
537
- }
538
- if (data.eventType === _constants.LOCUSEVENT.HASH_TREE_DATA_UPDATED) {
539
- // in hash tree messages we don't ge the locus object, but the meeting constructor needs at least locus.url
540
- (0, _lodash.set)(data, 'locus.url', data.stateElementsMessage.locusUrl);
602
+ if (data.locus && data.locus.self && data.locus.self.state === _constants._LEFT_ && data.locus.self.removed === true) {
603
+ // just ignore the event as its already ended and not active
604
+ _loggerProxy.default.logger.warn('Meetings:index#handleLocusEvent --> Locus event received for meeting, after it was ended.');
605
+ return;
541
606
  }
542
607
  this.create(data.locus, _constants.DESTINATION_TYPE.LOCUS_ID, useRandomDelayForInfo).then(/*#__PURE__*/function () {
543
- var _ref3 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3(newMeeting) {
608
+ var _ref4 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3(newMeeting) {
544
609
  var _t;
545
610
  return _regenerator.default.wrap(function (_context3) {
546
611
  while (1) switch (_context3.prev = _context3.next) {
@@ -552,6 +617,8 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
552
617
  trigger: data.eventType === _constants.LOCUSEVENT.SDK_LOCUS_FROM_SYNC_MEETINGS ? 'get-loci-response' : 'locus-message',
553
618
  locus: data.locus,
554
619
  hashTreeMessage: data.stateElementsMessage
620
+ }, function (locus) {
621
+ meeting.finalizeMeetingAfterInitialLocusSetup(locus);
555
622
  });
556
623
  case 2:
557
624
  _context3.next = 4;
@@ -571,7 +638,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
571
638
  }, _callee3, null, [[1, 3]]);
572
639
  }));
573
640
  return function (_x3) {
574
- return _ref3.apply(this, arguments);
641
+ return _ref4.apply(this, arguments);
575
642
  };
576
643
  }()).catch(function (e) {
577
644
  _loggerProxy.default.logger.error(e);
@@ -608,7 +675,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
608
675
  }
609
676
 
610
677
  /**
611
- * handles locus events through mercury that are not roap
678
+ * handles locus events through mercury that are not roap or approval request events
612
679
  * @param {Object} envelope
613
680
  * @param {Object} envelope.data
614
681
  * @param {String} envelope.data.eventType
@@ -622,7 +689,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
622
689
  var data = envelope.data;
623
690
  // eslint-disable-next-line @typescript-eslint/no-shadow
624
691
  var eventType = data.eventType;
625
- if (eventType && eventType !== _constants.LOCUSEVENT.MESSAGE_ROAP) {
692
+ if (eventType && eventType !== _constants.LOCUSEVENT.MESSAGE_ROAP && eventType !== _constants.LOCUSEVENT.APPROVAL_REQUEST) {
626
693
  this.handleLocusEvent(data, true);
627
694
  }
628
695
  }
@@ -804,46 +871,6 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
804
871
  }
805
872
  }
806
873
 
807
- /**
808
- * API to toggle TCP reachability, needs to be called before webex.meetings.register()
809
- * @param {Boolean} newValue
810
- * @private
811
- * @memberof Meetings
812
- * @returns {undefined}
813
- */
814
- }, {
815
- key: "_toggleTcpReachability",
816
- value: function _toggleTcpReachability(newValue) {
817
- if (typeof newValue !== 'boolean') {
818
- return;
819
- }
820
- // @ts-ignore
821
- if (this.config.experimental.enableTcpReachability !== newValue) {
822
- // @ts-ignore
823
- this.config.experimental.enableTcpReachability = newValue;
824
- }
825
- }
826
-
827
- /**
828
- * API to toggle TLS reachability, needs to be called before webex.meetings.register()
829
- * @param {Boolean} newValue
830
- * @private
831
- * @memberof Meetings
832
- * @returns {undefined}
833
- */
834
- }, {
835
- key: "_toggleTlsReachability",
836
- value: function _toggleTlsReachability(newValue) {
837
- if (typeof newValue !== 'boolean') {
838
- return;
839
- }
840
- // @ts-ignore
841
- if (this.config.experimental.enableTlsReachability !== newValue) {
842
- // @ts-ignore
843
- this.config.experimental.enableTlsReachability = newValue;
844
- }
845
- }
846
-
847
874
  /**
848
875
  * API to toggle backend ipv6 native support config, needs to be called before webex.meetings.register()
849
876
  *
@@ -909,6 +936,29 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
909
936
  }
910
937
  }
911
938
 
939
+ /**
940
+ * API to toggle AV1 codec support for video slides in multistream,
941
+ * needs to be called before webex.meetings.joinWithMedia()
942
+ *
943
+ * @param {Boolean} newValue
944
+ * @private
945
+ * @memberof Meetings
946
+ * @returns {undefined}
947
+ */
948
+ }, {
949
+ key: "_toggleEnableAv1SlidesSupport",
950
+ value: function _toggleEnableAv1SlidesSupport(newValue) {
951
+ if (typeof newValue !== 'boolean') {
952
+ return;
953
+ }
954
+
955
+ // @ts-ignore
956
+ if (this.config.enableAv1SlidesSupport !== newValue) {
957
+ // @ts-ignore
958
+ this.config.enableAv1SlidesSupport = newValue;
959
+ }
960
+ }
961
+
912
962
  /**
913
963
  * API to toggle stopping ICE Candidates Gathering after first relay candidate,
914
964
  * needs to be called before webex.meetings.joinWithMedia()
@@ -943,7 +993,11 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
943
993
  value: function executeRegistrationStep(step, stepName) {
944
994
  var _this5 = this;
945
995
  return step().then(function () {
996
+ _loggerProxy.default.logger.info("Meetings:index#executeRegistrationStep --> INFO, ".concat(stepName, " completed"));
946
997
  _this5.registrationStatus[stepName] = true;
998
+ }).catch(function (error) {
999
+ _loggerProxy.default.logger.error("Meetings:index#executeRegistrationStep --> ERROR, ".concat(stepName, " failed: ").concat(error.message));
1000
+ return _promise.default.reject(error);
947
1001
  });
948
1002
  }
949
1003
 
@@ -960,7 +1014,20 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
960
1014
  key: "register",
961
1015
  value: function register(deviceRegistrationOptions) {
962
1016
  var _this6 = this;
963
- this.registrationStatus = (0, _lodash.clone)(_constants.INITIAL_REGISTRATION_STATUS);
1017
+ if (this.unregistrationPromise) {
1018
+ _loggerProxy.default.logger.info('Meetings:index#register --> INFO, Meetings plugin unregistration in progress, waiting to register');
1019
+ this.registrationPromise = this.unregistrationPromise.catch(function () {}) // It doesn't matter what happened during unregistration
1020
+ .finally(function () {
1021
+ _loggerProxy.default.logger.info('Meetings:index#register --> INFO, Meetings plugin unregistration completed, proceeding to register');
1022
+ _this6.registrationPromise = null;
1023
+ return _this6.register(deviceRegistrationOptions);
1024
+ });
1025
+ return this.registrationPromise;
1026
+ }
1027
+ if (this.registrationPromise) {
1028
+ _loggerProxy.default.logger.info('Meetings:index#register --> INFO, Meetings plugin registration in progress, returning existing promise');
1029
+ return this.registrationPromise;
1030
+ }
964
1031
 
965
1032
  // @ts-ignore
966
1033
  if (!this.webex.canAuthorize) {
@@ -971,7 +1038,9 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
971
1038
  _loggerProxy.default.logger.info('Meetings:index#register --> INFO, Meetings plugin already registered');
972
1039
  return _promise.default.resolve();
973
1040
  }
974
- return _promise.default.all([this.executeRegistrationStep(function () {
1041
+ _loggerProxy.default.logger.info('Meetings:index#register --> INFO, Registering Meetings plugin');
1042
+ this.registrationStatus = (0, _lodash.clone)(_constants.INITIAL_REGISTRATION_STATUS);
1043
+ this.registrationPromise = _promise.default.all([this.executeRegistrationStep(function () {
975
1044
  return _this6.fetchUserPreferredWebexSite();
976
1045
  }, 'fetchWebexSite'), this.executeRegistrationStep(function () {
977
1046
  return _this6.getGeoHint();
@@ -1012,7 +1081,10 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1012
1081
  stack: error.stack
1013
1082
  });
1014
1083
  return _promise.default.reject(error);
1084
+ }).finally(function () {
1085
+ _this6.registrationPromise = null;
1015
1086
  });
1087
+ return this.registrationPromise;
1016
1088
  }
1017
1089
 
1018
1090
  /**
@@ -1027,35 +1099,61 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1027
1099
  key: "unregister",
1028
1100
  value: function unregister() {
1029
1101
  var _this7 = this;
1102
+ if (this.unregistrationPromise) {
1103
+ _loggerProxy.default.logger.info('Meetings:index#unregister --> INFO, Meetings plugin unregistration in progress, returning existing promise');
1104
+ return this.unregistrationPromise;
1105
+ }
1106
+ if (this.registrationPromise) {
1107
+ _loggerProxy.default.logger.info('Meetings:index#unregister --> INFO, Meetings plugin registration in progress, waiting to unregister');
1108
+
1109
+ // Wait for registration to complete (success or failure), then call unregister again
1110
+ this.unregistrationPromise = this.registrationPromise.catch(function () {}) // It doesn't matter what happened during registration
1111
+ .finally(function () {
1112
+ _loggerProxy.default.logger.info('Meetings:index#unregister --> INFO, Meetings plugin registration completed, proceeding to unregister');
1113
+ _this7.unregistrationPromise = null;
1114
+ return _this7.unregister();
1115
+ });
1116
+ return this.unregistrationPromise;
1117
+ }
1030
1118
  if (!this.registered) {
1031
1119
  _loggerProxy.default.logger.info('Meetings:index#unregister --> INFO, Meetings plugin already unregistered');
1032
1120
  return _promise.default.resolve();
1033
1121
  }
1034
1122
  this.stopListeningForEvents();
1035
- return (
1036
- // @ts-ignore
1037
- this.webex.internal.mercury.disconnect()
1038
- // @ts-ignore
1039
- .then(function () {
1040
- return _this7.webex.internal.device.unregister();
1041
- }).catch(function (error) {
1042
- // If error status code is 404, continue the chain
1043
- if (error.statusCode === 404) {
1044
- _loggerProxy.default.logger.info('Meetings:index#unregister --> 404 error during device unregister, proceeding normally');
1045
- return; // returning undefined allows the chain to continue
1046
- }
1047
- // For any other status code, break the chain by rethrowing
1048
- _loggerProxy.default.logger.error("Meetings:index#unregister --> Failed to unregister device: ".concat(error.message));
1049
- throw error; // rethrow to break the promise chain
1050
- }).then(function () {
1051
- _triggerProxy.default.trigger(_this7, {
1052
- file: 'meetings',
1053
- function: 'unregister'
1054
- }, _constants.EVENT_TRIGGERS.MEETINGS_UNREGISTERED);
1055
- _this7.registered = false;
1056
- _this7.registrationStatus = (0, _lodash.clone)(_constants.INITIAL_REGISTRATION_STATUS);
1057
- })
1058
- );
1123
+ this.unregistrationPromise =
1124
+ // @ts-ignore
1125
+ this.webex.internal.mercury
1126
+ // Use code 3050 with a non-reconnecting reason to prevent Mercury auto-reconnect
1127
+ // during unregister. Without this, disconnect() defaults to code 1000/"Done" which
1128
+ // force-closes as "Done (forced)" - a normalReconnectReason that triggers auto-reconnect,
1129
+ // causing a race condition with device.unregister().
1130
+ .disconnect({
1131
+ code: 3050,
1132
+ reason: 'meetings unregister'
1133
+ })
1134
+ // @ts-ignore
1135
+ .then(function () {
1136
+ return _this7.webex.internal.device.unregister();
1137
+ }).catch(function (error) {
1138
+ // If error status code is 404, continue the chain
1139
+ if (error.statusCode === 404) {
1140
+ _loggerProxy.default.logger.info('Meetings:index#unregister --> 404 error during device unregister, proceeding normally');
1141
+ return; // returning undefined allows the chain to continue
1142
+ }
1143
+ // For any other status code, break the chain by rethrowing
1144
+ _loggerProxy.default.logger.error("Meetings:index#unregister --> Failed to unregister device: ".concat(error.message));
1145
+ throw error; // rethrow to break the promise chain
1146
+ }).then(function () {
1147
+ _triggerProxy.default.trigger(_this7, {
1148
+ file: 'meetings',
1149
+ function: 'unregister'
1150
+ }, _constants.EVENT_TRIGGERS.MEETINGS_UNREGISTERED);
1151
+ _this7.registered = false;
1152
+ _this7.registrationStatus = (0, _lodash.clone)(_constants.INITIAL_REGISTRATION_STATUS);
1153
+ }).finally(function () {
1154
+ _this7.unregistrationPromise = null;
1155
+ });
1156
+ return this.unregistrationPromise;
1059
1157
  }
1060
1158
  }, {
1061
1159
  key: "uploadLogs",
@@ -1206,6 +1304,31 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1206
1304
  return this.personalMeetingRoom;
1207
1305
  }
1208
1306
 
1307
+ /**
1308
+ * Fetches site preferences for the provided Webex site, or the preferred Webex site.
1309
+ * This is used to determine capabilities of the site, such as whether scheduling a webinar is supported.
1310
+ *
1311
+ * @param {object} [options]
1312
+ * @param {string} [options.siteUrl] - Webex site URL. Defaults to preferredWebexSite, for example "cisco.webex.com".
1313
+ * @param {string} [options.siteName] - Site name query override. Defaults to the site name derived from siteUrl, for example "cisco" for "cisco.webex.com".
1314
+ * @param {SitePreferenceSelectOption[]} [options.selectOptions] - Preference sections to fetch. Defaults to 'scheduling'.
1315
+ * @returns {Promise<SitePreferencesResponse>} site preferences response body
1316
+ * @throws {ParameterError}
1317
+ * @public
1318
+ * @memberof Meetings
1319
+ * @example
1320
+ * const preferences = await webex.meetings.fetchSitePreferencesMeViaSite();
1321
+ * const supportScheduleWebinar = preferences?.scheduling?.supportScheduleWebinar;
1322
+ */
1323
+ }, {
1324
+ key: "fetchSitePreferencesMeViaSite",
1325
+ value: function fetchSitePreferencesMeViaSite() {
1326
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1327
+ return this.request.fetchSitePreferencesMeViaSite(_objectSpread(_objectSpread({}, options), {}, {
1328
+ siteUrl: options.siteUrl || this.preferredWebexSite
1329
+ }));
1330
+ }
1331
+
1209
1332
  /**
1210
1333
  * Returns basic information about a meeting that exists or
1211
1334
  * used to exist in the MeetingCollection
@@ -1298,6 +1421,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1298
1421
  * @param {String} [meetingLookupUrl] - meeting info prefetch url
1299
1422
  * @param {string} sessionCorrelationId - the optional specified sessionCorrelationId (callStateForMetrics.sessionCorrelationId) can be provided instead
1300
1423
  * @param {String} classificationId - If space support classification, it will provide it while start instant meeting
1424
+ * @param {PrefetchedMeetingInfo} prefetchedMeetingInfo - meeting information requested before creating the Meeting
1301
1425
  * @returns {Promise<Meeting>} A new Meeting.
1302
1426
  * @public
1303
1427
  * @memberof Meetings
@@ -1316,6 +1440,11 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1316
1440
  var meetingLookupUrl = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : undefined;
1317
1441
  var sessionCorrelationId = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : undefined;
1318
1442
  var classificationId = arguments.length > 10 && arguments[10] !== undefined ? arguments[10] : undefined;
1443
+ var prefetchedMeetingInfo = arguments.length > 11 && arguments[11] !== undefined ? arguments[11] : undefined;
1444
+ if (meetingInfo && prefetchedMeetingInfo) {
1445
+ return _promise.default.reject(new Error('meetingInfo and prefetchedMeetingInfo cannot both be provided'));
1446
+ }
1447
+
1319
1448
  // Validate meeting information based on the provided destination and
1320
1449
  // type. This must be performed prior to determining if the meeting is
1321
1450
  // found in the collection, as we mutate the destination for hydra person
@@ -1366,7 +1495,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1366
1495
  // Validate if a meeting was found.
1367
1496
  if (!meeting) {
1368
1497
  // Create a meeting based on the normalized destination and type.
1369
- return _this1.createMeeting(targetDest, type, useRandomDelayForInfo, infoExtraParams, callStateForMetrics, failOnMissingMeetingInfo, meetingInfo, meetingLookupUrl, classificationId).then(function (createdMeeting) {
1498
+ return _this1.createMeeting(targetDest, type, useRandomDelayForInfo, infoExtraParams, callStateForMetrics, failOnMissingMeetingInfo, meetingInfo, meetingLookupUrl, classificationId, prefetchedMeetingInfo).then(function (createdMeeting) {
1370
1499
  // If the meeting was successfully created.
1371
1500
  if (createdMeeting && createdMeeting.on) {
1372
1501
  // Create a destruction event for the meeting.
@@ -1401,6 +1530,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1401
1530
  });
1402
1531
  }
1403
1532
  });
1533
+ _this1.emitWasmRuntimePerformance(createdMeeting.correlationId);
1404
1534
  } else {
1405
1535
  _loggerProxy.default.logger.error("Meetings:index#create --> ERROR, meeting does not have on method, will not be destroyed, meeting cleanup impossible for meeting: ".concat(meeting));
1406
1536
  }
@@ -1410,12 +1540,55 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1410
1540
  });
1411
1541
  }
1412
1542
  meeting.updateCallStateForMetrics(callStateForMetrics);
1543
+ if (prefetchedMeetingInfo && (0, _lodash.isEmpty)(meeting.meetingInfo)) {
1544
+ return meeting.consumePrefetchedMeetingInfo(prefetchedMeetingInfo).then(function () {
1545
+ return meeting;
1546
+ });
1547
+ }
1413
1548
 
1414
1549
  // Return the existing meeting.
1415
1550
  return _promise.default.resolve(meeting);
1416
1551
  });
1417
1552
  }
1418
1553
 
1554
+ /**
1555
+ * Starts meeting-information retrieval without creating or registering a Meeting.
1556
+ *
1557
+ * @param {PrefetchMeetingInfoParams} params request destination and metric identifiers
1558
+ * @returns {PrefetchedMeetingInfo} opaque handle consumed later by create() or Meeting
1559
+ * @public
1560
+ * @memberof Meetings
1561
+ */
1562
+ }, {
1563
+ key: "prefetchMeetingInfo",
1564
+ value: function prefetchMeetingInfo(_ref5) {
1565
+ var destination = _ref5.destination,
1566
+ _ref5$type = _ref5.type,
1567
+ type = _ref5$type === void 0 ? null : _ref5$type,
1568
+ _ref5$extraParams = _ref5.extraParams,
1569
+ extraParams = _ref5$extraParams === void 0 ? {} : _ref5$extraParams,
1570
+ preJoinContext = _ref5.preJoinContext,
1571
+ _ref5$classificationI = _ref5.classificationId,
1572
+ classificationId = _ref5$classificationI === void 0 ? undefined : _ref5$classificationI;
1573
+ var sendCAevents = !!preJoinContext.correlationId;
1574
+ // @ts-ignore - parent SDK instance inherited from WebexPlugin
1575
+ var webex = this.webex;
1576
+ var meetingInfoProvider = _meetingInfoV.default.createPreJoinProvider(webex, preJoinContext);
1577
+ var request = meetingInfoProvider.fetchMeetingInfo(destination, type, null, null,
1578
+ // @ts-ignore - config coming from registerPlugin
1579
+ this.config.installedOrgID, null, extraParams, {
1580
+ sendCAevents: sendCAevents
1581
+ }, null, null, classificationId);
1582
+ request.catch(function () {
1583
+ return undefined;
1584
+ });
1585
+ return {
1586
+ request: request,
1587
+ provider: meetingInfoProvider,
1588
+ extraParams: extraParams
1589
+ };
1590
+ }
1591
+
1419
1592
  /**
1420
1593
  * Enable static meeting links for given conversation url.
1421
1594
  *
@@ -1470,6 +1643,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1470
1643
  * @param {Object} [meetingInfo] - Pre-fetched complete meeting info
1471
1644
  * @param {String} [meetingLookupUrl] - meeting info prefetch url
1472
1645
  * @param {String} classificationId see create()
1646
+ * @param {PrefetchedMeetingInfo} prefetchedMeetingInfo - meeting information requested before creating the Meeting
1473
1647
  * @returns {Promise} a new meeting instance complete with meeting info and destination
1474
1648
  * @private
1475
1649
  * @memberof Meetings
@@ -1487,6 +1661,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1487
1661
  meetingInfo,
1488
1662
  meetingLookupUrl,
1489
1663
  classificationId,
1664
+ prefetchedMeetingInfo,
1490
1665
  meeting,
1491
1666
  _destination$fullStat,
1492
1667
  waitingTime,
@@ -1498,6 +1673,8 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1498
1673
  isMeetingActive,
1499
1674
  enableUnifiedMeetings,
1500
1675
  meetingInfoOptions,
1676
+ shouldDeferMeetingInfoFetch,
1677
+ isOneOnOneCallLocus,
1501
1678
  meetingAddedType,
1502
1679
  _args4 = arguments,
1503
1680
  _t2;
@@ -1512,6 +1689,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1512
1689
  meetingInfo = _args4.length > 6 && _args4[6] !== undefined ? _args4[6] : undefined;
1513
1690
  meetingLookupUrl = _args4.length > 7 && _args4[7] !== undefined ? _args4[7] : undefined;
1514
1691
  classificationId = _args4.length > 8 && _args4[8] !== undefined ? _args4[8] : undefined;
1692
+ prefetchedMeetingInfo = _args4.length > 9 && _args4[9] !== undefined ? _args4[9] : undefined;
1515
1693
  meeting = new _meeting.default({
1516
1694
  // @ts-ignore
1517
1695
  userId: this.webex.internal.device.userId,
@@ -1552,61 +1730,86 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1552
1730
  extraParams: infoExtraParams,
1553
1731
  sendCAevents: !!(callStateForMetrics !== null && callStateForMetrics !== void 0 && callStateForMetrics.correlationId) // if client sends correlation id as argument of public create(), then it means that this meeting creation is part of a pre-join intent from user
1554
1732
  };
1733
+ shouldDeferMeetingInfoFetch = type === _constants.DESTINATION_TYPE.LOCUS_ID && !(destination !== null && destination !== void 0 && destination.info);
1734
+ isOneOnOneCallLocus = type === _constants.DESTINATION_TYPE.LOCUS_ID && _util2.default.isOneOnOneCall(destination);
1555
1735
  if (!meetingInfo) {
1556
1736
  _context4.next = 2;
1557
1737
  break;
1558
1738
  }
1559
1739
  meeting.injectMeetingInfo(meetingInfo, meetingInfoOptions, meetingLookupUrl);
1560
- _context4.next = 4;
1740
+ _context4.next = 8;
1561
1741
  break;
1562
1742
  case 2:
1563
- if (!(type !== _constants.DESTINATION_TYPE.ONE_ON_ONE_CALL)) {
1743
+ if (!prefetchedMeetingInfo) {
1564
1744
  _context4.next = 4;
1565
1745
  break;
1566
1746
  }
1747
+ _context4.next = 3;
1748
+ return meeting.consumePrefetchedMeetingInfo(prefetchedMeetingInfo);
1749
+ case 3:
1750
+ _context4.next = 8;
1751
+ break;
1752
+ case 4:
1753
+ if (!(type !== _constants.DESTINATION_TYPE.ONE_ON_ONE_CALL && !isOneOnOneCallLocus)) {
1754
+ _context4.next = 8;
1755
+ break;
1756
+ }
1567
1757
  if (!(enableUnifiedMeetings && !isMeetingActive && useRandomDelayForInfo && waitingTime > 0)) {
1568
- _context4.next = 3;
1758
+ _context4.next = 5;
1569
1759
  break;
1570
1760
  }
1571
1761
  meeting.fetchMeetingInfoTimeoutId = setTimeout(function () {
1572
1762
  return meeting.fetchMeetingInfo(meetingInfoOptions);
1573
1763
  }, waitingTime);
1574
1764
  meeting.parseMeetingInfo(undefined, destination);
1575
- _context4.next = 4;
1765
+ _context4.next = 8;
1576
1766
  break;
1577
- case 3:
1578
- _context4.next = 4;
1767
+ case 5:
1768
+ if (shouldDeferMeetingInfoFetch) {
1769
+ _context4.next = 7;
1770
+ break;
1771
+ }
1772
+ _context4.next = 6;
1579
1773
  return meeting.fetchMeetingInfo(meetingInfoOptions);
1580
- case 4:
1774
+ case 6:
1581
1775
  _context4.next = 8;
1582
1776
  break;
1583
- case 5:
1584
- _context4.prev = 5;
1777
+ case 7:
1778
+ _loggerProxy.default.logger.info('Meetings:index#createMeeting --> defer fetchMeetingInfo for incomplete locus, will do it after locus initialSetup');
1779
+ case 8:
1780
+ _context4.next = 12;
1781
+ break;
1782
+ case 9:
1783
+ _context4.prev = 9;
1585
1784
  _t2 = _context4["catch"](1);
1586
1785
  if (!(!(_t2 instanceof _captchaError.default) && !(_t2 instanceof _passwordError.default) && !(_t2 instanceof _permission.default) && !(_t2 instanceof _joinWebinarError.default) && !(_t2 instanceof _joinForbiddenError.default))) {
1587
- _context4.next = 7;
1786
+ _context4.next = 11;
1588
1787
  break;
1589
1788
  }
1590
1789
  _loggerProxy.default.logger.info("Meetings:index#createMeeting --> Info Unable to fetch meeting info for ".concat(destination, "."));
1591
1790
  if (!failOnMissingMeetingInfo) {
1592
- _context4.next = 6;
1791
+ _context4.next = 10;
1593
1792
  break;
1594
1793
  }
1595
1794
  _loggerProxy.default.logger.info("Meetings:index#createMeeting --> Destroying meeting due to missing meeting info.");
1596
1795
  // @ts-ignore
1597
1796
  this.destroy(meeting, _constants.MEETING_REMOVED_REASON.MISSING_MEETING_INFO);
1598
1797
  throw new _noMeetingInfo.default();
1599
- case 6:
1798
+ case 10:
1600
1799
  // if there is no meeting info and no error should be thrown then we assume its a 1:1 call or wireless share
1601
1800
  _loggerProxy.default.logger.info('Meetings:index#createMeeting --> Info assuming this destination is a 1:1 or wireless share');
1602
- case 7:
1603
- _loggerProxy.default.logger.debug("Meetings:index#createMeeting --> Debug ".concat(_t2, " fetching /meetingInfo for creation."));
1604
- case 8:
1605
- _context4.prev = 8;
1801
+ case 11:
1802
+ _loggerProxy.default.logger.debug("Meetings:index#createMeeting --> Debug ".concat(_t2, " fetching meeting info for creation."));
1803
+ case 12:
1804
+ _context4.prev = 12;
1606
1805
  // For type LOCUS_ID we need to parse the locus object to get the information
1607
1806
  // about the caller and callee
1608
1807
  // Meeting Added event will be created in `handleLocusEvent`
1609
- if (type !== _constants.DESTINATION_TYPE.LOCUS_ID) {
1808
+ // Only emit MEETING_ADDED if the meeting still exists in the collection.
1809
+ // If fetchMeetingInfo failed and the meeting was destroyed in the catch block,
1810
+ // skip emitting to prevent orphaned meeting references on the consumer side.
1811
+ // @ts-ignore - getMeetingByType types value as object but accepts strings (same as handleLocusEvent)
1812
+ if (type !== _constants.DESTINATION_TYPE.LOCUS_ID && this.getMeetingByType(_constants._ID_, meeting.id)) {
1610
1813
  if (!meeting.sipUri) {
1611
1814
  meeting.setSipUri(destination);
1612
1815
  }
@@ -1622,14 +1825,14 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1622
1825
  type: meetingAddedType
1623
1826
  });
1624
1827
  }
1625
- return _context4.finish(8);
1626
- case 9:
1828
+ return _context4.finish(12);
1829
+ case 13:
1627
1830
  return _context4.abrupt("return", meeting);
1628
- case 10:
1831
+ case 14:
1629
1832
  case "end":
1630
1833
  return _context4.stop();
1631
1834
  }
1632
- }, _callee4, this, [[1, 5, 8, 9]]);
1835
+ }, _callee4, this, [[1, 9, 12, 13]]);
1633
1836
  }));
1634
1837
  function createMeeting(_x4) {
1635
1838
  return _createMeeting.apply(this, arguments);
@@ -1672,51 +1875,141 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1672
1875
  */
1673
1876
  }, {
1674
1877
  key: "syncMeetings",
1675
- value: function syncMeetings() {
1676
- var _this11 = this;
1677
- var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
1678
- _ref4$keepOnlyLocusMe = _ref4.keepOnlyLocusMeetings,
1679
- keepOnlyLocusMeetings = _ref4$keepOnlyLocusMe === void 0 ? true : _ref4$keepOnlyLocusMe;
1680
- // @ts-ignore
1681
- if (this.webex.credentials.isUnverifiedGuest) {
1682
- _loggerProxy.default.logger.info('Meetings:index#syncMeetings --> skipping meeting sync as unverified guest');
1683
- return _promise.default.resolve();
1684
- }
1685
- return this.request.getActiveMeetings().then(function (locusArray) {
1686
- var activeLocusUrl = [];
1687
- if (locusArray !== null && locusArray !== void 0 && locusArray.loci && locusArray.loci.length > 0) {
1688
- var lociToUpdate = _this11.sortLocusArrayToUpdate(locusArray.loci);
1689
- lociToUpdate.forEach(function (locus) {
1690
- activeLocusUrl.push(locus.url);
1691
- _this11.handleLocusEvent({
1692
- eventType: _constants.LOCUSEVENT.SDK_LOCUS_FROM_SYNC_MEETINGS,
1693
- locus: locus,
1694
- locusUrl: locus.url
1695
- });
1696
- });
1697
- }
1698
- var meetingsCollection = _this11.meetingCollection.getAll();
1699
- if ((0, _keys.default)(meetingsCollection).length > 0) {
1700
- // Sometimes the mercury events are lost after mercury reconnect
1701
- // Remove any Locus meetings that are not returned by Locus
1702
- // (they had a locusUrl previously but are no longer active) in the sync
1703
- for (var _i = 0, _Object$values = (0, _values.default)(meetingsCollection); _i < _Object$values.length; _i++) {
1704
- var meeting = _Object$values[_i];
1705
- // @ts-ignore
1706
- var locusUrl = meeting.locusUrl;
1707
- if ((keepOnlyLocusMeetings || locusUrl) && !activeLocusUrl.includes(locusUrl)) {
1708
- // destroy function also uploads logs
1709
- // @ts-ignore
1710
- _this11.destroy(meeting, _constants.MEETING_REMOVED_REASON.NO_MEETINGS_TO_SYNC);
1711
- }
1878
+ value: (function () {
1879
+ var _syncMeetings = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee5() {
1880
+ var _this11 = this;
1881
+ var _ref6,
1882
+ _ref6$keepOnlyLocusMe,
1883
+ keepOnlyLocusMeetings,
1884
+ _ref6$skipHashTreeSyn,
1885
+ skipHashTreeSync,
1886
+ locusArray,
1887
+ activeLocusUrl,
1888
+ lociToUpdate,
1889
+ meetingsCollection,
1890
+ _loop,
1891
+ _i,
1892
+ _Object$values,
1893
+ remainingMeetings,
1894
+ syncPromises,
1895
+ _i2,
1896
+ _arr,
1897
+ meeting,
1898
+ _args6 = arguments,
1899
+ _t3;
1900
+ return _regenerator.default.wrap(function (_context6) {
1901
+ while (1) switch (_context6.prev = _context6.next) {
1902
+ case 0:
1903
+ _ref6 = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {}, _ref6$keepOnlyLocusMe = _ref6.keepOnlyLocusMeetings, keepOnlyLocusMeetings = _ref6$keepOnlyLocusMe === void 0 ? true : _ref6$keepOnlyLocusMe, _ref6$skipHashTreeSyn = _ref6.skipHashTreeSync, skipHashTreeSync = _ref6$skipHashTreeSyn === void 0 ? false : _ref6$skipHashTreeSyn;
1904
+ if (!this.webex.credentials.isUnverifiedGuest) {
1905
+ _context6.next = 1;
1906
+ break;
1907
+ }
1908
+ _loggerProxy.default.logger.info('Meetings:index#syncMeetings --> user is unverified guest, skipping calling Locus for meeting sync');
1909
+ _context6.next = 7;
1910
+ break;
1911
+ case 1:
1912
+ _context6.prev = 1;
1913
+ _context6.next = 2;
1914
+ return this.request.getActiveMeetings();
1915
+ case 2:
1916
+ locusArray = _context6.sent;
1917
+ activeLocusUrl = [];
1918
+ if (locusArray !== null && locusArray !== void 0 && locusArray.loci && locusArray.loci.length > 0) {
1919
+ lociToUpdate = this.sortLocusArrayToUpdate(locusArray.loci);
1920
+ lociToUpdate.forEach(function (locus) {
1921
+ activeLocusUrl.push(locus.url);
1922
+ _this11.handleLocusEvent({
1923
+ eventType: _constants.LOCUSEVENT.SDK_LOCUS_FROM_SYNC_MEETINGS,
1924
+ locus: locus,
1925
+ locusUrl: locus.url
1926
+ });
1927
+ });
1928
+ }
1929
+ meetingsCollection = this.meetingCollection.getAll();
1930
+ if (!((0, _keys.default)(meetingsCollection).length > 0)) {
1931
+ _context6.next = 5;
1932
+ break;
1933
+ }
1934
+ _loop = /*#__PURE__*/_regenerator.default.mark(function _loop() {
1935
+ var meeting, locusUrl, locusInfo, _locusInfo$info, _locusArray$loci, globalMeetingId;
1936
+ return _regenerator.default.wrap(function (_context5) {
1937
+ while (1) switch (_context5.prev = _context5.next) {
1938
+ case 0:
1939
+ meeting = _Object$values[_i];
1940
+ // @ts-ignore
1941
+ locusUrl = meeting.locusUrl, locusInfo = meeting.locusInfo;
1942
+ if ((keepOnlyLocusMeetings || locusUrl) && !activeLocusUrl.includes(locusUrl)) {
1943
+ globalMeetingId = locusInfo === null || locusInfo === void 0 ? void 0 : (_locusInfo$info = locusInfo.info) === null || _locusInfo$info === void 0 ? void 0 : _locusInfo$info.globalMeetingId;
1944
+ if (globalMeetingId && locusArray !== null && locusArray !== void 0 && (_locusArray$loci = locusArray.loci) !== null && _locusArray$loci !== void 0 && _locusArray$loci.some(function (locus) {
1945
+ var _locus$info;
1946
+ return ((_locus$info = locus.info) === null || _locus$info === void 0 ? void 0 : _locus$info.globalMeetingId) === globalMeetingId;
1947
+ })) {
1948
+ // don't destroy the meeting as Locus API still returned some Locus that shares
1949
+ // the same globalMeetingId - that happens for example if a webinar user (who hasn't scheduled it)
1950
+ // is in a breakout and gets moved to a different breakout while we were offline
1951
+ } else {
1952
+ // destroy function also uploads logs
1953
+ // @ts-ignore
1954
+ _this11.destroy(meeting, _constants.MEETING_REMOVED_REASON.NO_MEETINGS_TO_SYNC);
1955
+ }
1956
+ }
1957
+ case 1:
1958
+ case "end":
1959
+ return _context5.stop();
1960
+ }
1961
+ }, _loop);
1962
+ });
1963
+ _i = 0, _Object$values = (0, _values.default)(meetingsCollection);
1964
+ case 3:
1965
+ if (!(_i < _Object$values.length)) {
1966
+ _context6.next = 5;
1967
+ break;
1968
+ }
1969
+ return _context6.delegateYield(_loop(), "t0", 4);
1970
+ case 4:
1971
+ _i++;
1972
+ _context6.next = 3;
1973
+ break;
1974
+ case 5:
1975
+ _context6.next = 7;
1976
+ break;
1977
+ case 6:
1978
+ _context6.prev = 6;
1979
+ _t3 = _context6["catch"](1);
1980
+ _loggerProxy.default.logger.error("Meetings:index#syncMeetings --> failed to sync meetings, ".concat(_t3));
1981
+ throw _t3;
1982
+ case 7:
1983
+ if (skipHashTreeSync) {
1984
+ _context6.next = 8;
1985
+ break;
1986
+ }
1987
+ // Trigger hash tree syncs for all remaining meetings
1988
+ remainingMeetings = this.meetingCollection.getAll();
1989
+ syncPromises = [];
1990
+ for (_i2 = 0, _arr = (0, _values.default)(remainingMeetings); _i2 < _arr.length; _i2++) {
1991
+ meeting = _arr[_i2];
1992
+ if (meeting.locusInfo) {
1993
+ syncPromises.push(meeting.locusInfo.syncAllHashTreeDatasets());
1994
+ }
1995
+ }
1996
+ if (!(syncPromises.length > 0)) {
1997
+ _context6.next = 8;
1998
+ break;
1999
+ }
2000
+ _context6.next = 8;
2001
+ return _promise.default.all(syncPromises);
2002
+ case 8:
2003
+ case "end":
2004
+ return _context6.stop();
1712
2005
  }
1713
- }
1714
- }).catch(function (error) {
1715
- _loggerProxy.default.logger.error("Meetings:index#syncMeetings --> failed to sync meetings, ".concat(error));
1716
- throw new Error(error);
1717
- });
1718
- }
1719
-
2006
+ }, _callee5, this, [[1, 6]]);
2007
+ }));
2008
+ function syncMeetings() {
2009
+ return _syncMeetings.apply(this, arguments);
2010
+ }
2011
+ return syncMeetings;
2012
+ }()
1720
2013
  /**
1721
2014
  * sort out locus array for initial creating
1722
2015
  * @param {Array} loci original locus array
@@ -1724,6 +2017,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1724
2017
  * @public
1725
2018
  * @memberof Meetings
1726
2019
  */
2020
+ )
1727
2021
  }, {
1728
2022
  key: "sortLocusArrayToUpdate",
1729
2023
  value: function sortLocusArrayToUpdate(loci) {
@@ -1738,8 +2032,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1738
2032
  var lociToUpdate = (0, _toConsumableArray2.default)(mainLoci);
1739
2033
  breakoutLoci.forEach(function (breakoutLocus) {
1740
2034
  var associateMainLocus = mainLoci.find(function (mainLocus) {
1741
- var _mainLocus$controls, _mainLocus$controls$b, _breakoutLocus$contro, _breakoutLocus$contro2;
1742
- return ((_mainLocus$controls = mainLocus.controls) === null || _mainLocus$controls === void 0 ? void 0 : (_mainLocus$controls$b = _mainLocus$controls.breakout) === null || _mainLocus$controls$b === void 0 ? void 0 : _mainLocus$controls$b.url) === ((_breakoutLocus$contro = breakoutLocus.controls) === null || _breakoutLocus$contro === void 0 ? void 0 : (_breakoutLocus$contro2 = _breakoutLocus$contro.breakout) === null || _breakoutLocus$contro2 === void 0 ? void 0 : _breakoutLocus$contro2.url);
2035
+ return _util2.default.isMainAssociatedWithBreakout(mainLocus, breakoutLocus);
1743
2036
  });
1744
2037
  var existCorrespondingMeeting = _this12.getCorrespondingMeetingByLocus({
1745
2038
  eventType: _constants.LOCUSEVENT.SDK_NO_EVENT,
@@ -1775,15 +2068,14 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1775
2068
  return;
1776
2069
  }
1777
2070
  var existIndex = this.breakoutLocusForHandleLater.findIndex(function (breakoutLocus) {
1778
- var _breakoutLocus$contro3, _breakoutLocus$contro4, _newCreatedLocus$cont, _newCreatedLocus$cont2;
1779
- return ((_breakoutLocus$contro3 = breakoutLocus.controls) === null || _breakoutLocus$contro3 === void 0 ? void 0 : (_breakoutLocus$contro4 = _breakoutLocus$contro3.breakout) === null || _breakoutLocus$contro4 === void 0 ? void 0 : _breakoutLocus$contro4.url) === ((_newCreatedLocus$cont = newCreatedLocus.controls) === null || _newCreatedLocus$cont === void 0 ? void 0 : (_newCreatedLocus$cont2 = _newCreatedLocus$cont.breakout) === null || _newCreatedLocus$cont2 === void 0 ? void 0 : _newCreatedLocus$cont2.url);
2071
+ return _util2.default.isMainAssociatedWithBreakout(newCreatedLocus, breakoutLocus);
1780
2072
  });
1781
2073
  if (existIndex < 0) {
1782
2074
  return;
1783
2075
  }
1784
2076
  var associateBreakoutLocus = this.breakoutLocusForHandleLater[existIndex];
1785
2077
  this.handleLocusEvent({
1786
- eventType: _constants.LOCUSEVENT.SDK_NO_EVENT,
2078
+ eventType: _constants.LOCUSEVENT.SDK_LOCUS_FROM_SYNC_MEETINGS,
1787
2079
  locus: associateBreakoutLocus,
1788
2080
  locusUrl: associateBreakoutLocus.url
1789
2081
  });