@webex/plugin-meetings 3.11.0-webex-services-ready.1 → 3.12.0-llmrefactor.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 +58 -13
  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 +124 -7
  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 +332 -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 +2286 -1129
  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 +2 -2
  83. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  84. package/dist/meetings/index.js +369 -162
  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 +121 -83
  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/annotation/index.d.ts +19 -0
  130. package/dist/types/common/errors/webex-errors.d.ts +32 -2
  131. package/dist/types/config.d.ts +6 -2
  132. package/dist/types/constants.d.ts +35 -1
  133. package/dist/types/controls-options-manager/constants.d.ts +6 -1
  134. package/dist/types/controls-options-manager/index.d.ts +16 -0
  135. package/dist/types/hashTree/constants.d.ts +3 -0
  136. package/dist/types/hashTree/hashTree.d.ts +7 -0
  137. package/dist/types/hashTree/hashTreeParser.d.ts +315 -30
  138. package/dist/types/hashTree/types.d.ts +3 -0
  139. package/dist/types/hashTree/utils.d.ts +24 -0
  140. package/dist/types/index.d.ts +4 -0
  141. package/dist/types/interceptors/constant.d.ts +5 -0
  142. package/dist/types/interceptors/dataChannelAuthToken.d.ts +43 -0
  143. package/dist/types/interceptors/index.d.ts +2 -1
  144. package/dist/types/interceptors/locusRetry.d.ts +4 -4
  145. package/dist/types/interceptors/utils.d.ts +1 -0
  146. package/dist/types/interpretation/interpretation.types.d.ts +10 -0
  147. package/dist/types/locus-info/index.d.ts +126 -15
  148. package/dist/types/locus-info/infoUtils.d.ts +8 -0
  149. package/dist/types/locus-info/types.d.ts +28 -1
  150. package/dist/types/media/MediaConnectionAwaiter.d.ts +20 -2
  151. package/dist/types/media/properties.d.ts +8 -3
  152. package/dist/types/meeting/in-meeting-actions.d.ts +10 -0
  153. package/dist/types/meeting/index.d.ts +271 -16
  154. package/dist/types/meeting/locusMediaRequest.d.ts +12 -0
  155. package/dist/types/meeting/request.d.ts +17 -1
  156. package/dist/types/meeting/request.type.d.ts +5 -0
  157. package/dist/types/meeting/util.d.ts +40 -0
  158. package/dist/types/meetings/index.d.ts +42 -20
  159. package/dist/types/meetings/meetings.types.d.ts +15 -0
  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 +611 -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 +62 -12
  185. package/src/breakouts/breakout.ts +3 -1
  186. package/src/breakouts/events.ts +33 -11
  187. package/src/breakouts/index.ts +143 -3
  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 +217 -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 +1244 -224
  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 +4 -2
  223. package/src/meetings/index.ts +319 -117
  224. package/src/meetings/meetings.types.ts +19 -0
  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 +47 -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 +415 -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 +228 -134
  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 +305 -18
  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 +388 -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 +3573 -353
  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 +19 -10
  277. package/test/unit/spec/meetings/index.js +1138 -86
  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 +128 -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 +1087 -167
  294. package/test/unit/spec/webinar/utils.ts +39 -0
@@ -29,6 +29,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/he
29
29
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
30
30
  var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
31
31
  var _lodash = require("lodash");
32
+ var _webCapabilities = require("@webex/web-capabilities");
32
33
  require("@webex/internal-plugin-mercury");
33
34
  require("@webex/internal-plugin-conversation");
34
35
  require("@webex/internal-plugin-metrics");
@@ -48,7 +49,7 @@ var _constants = require("../constants");
48
49
  var _constants2 = _interopRequireDefault(require("../metrics/constants"));
49
50
  var _meetingInfo = _interopRequireDefault(require("../meeting-info"));
50
51
  var _meetingInfoV = _interopRequireDefault(require("../meeting-info/meeting-info-v2"));
51
- var _meeting = _interopRequireDefault(require("../meeting"));
52
+ var _meeting = _interopRequireWildcard(require("../meeting"));
52
53
  var _personalMeetingRoom = _interopRequireDefault(require("../personal-meeting-room"));
53
54
  var _reachability = _interopRequireDefault(require("../reachability"));
54
55
  var _request2 = _interopRequireDefault(require("./request"));
@@ -63,7 +64,8 @@ var _webexErrors = require("../common/errors/webex-errors");
63
64
  var _noMeetingInfo = _interopRequireDefault(require("../common/errors/no-meeting-info"));
64
65
  var _joinForbiddenError = _interopRequireDefault(require("../common/errors/join-forbidden-error"));
65
66
  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); }
67
+ var _locusInfo = require("../locus-info");
68
+ 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
69
  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
70
  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
71
  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 +196,8 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
194
196
  (0, _defineProperty2.default)(_this, "preferredWebexSite", void 0);
195
197
  (0, _defineProperty2.default)(_this, "reachability", void 0);
196
198
  (0, _defineProperty2.default)(_this, "registered", void 0);
199
+ (0, _defineProperty2.default)(_this, "registrationPromise", void 0);
200
+ (0, _defineProperty2.default)(_this, "unregistrationPromise", void 0);
197
201
  (0, _defineProperty2.default)(_this, "request", void 0);
198
202
  (0, _defineProperty2.default)(_this, "geoHintInfo", void 0);
199
203
  (0, _defineProperty2.default)(_this, "meetingInfo", void 0);
@@ -201,6 +205,29 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
201
205
  (0, _defineProperty2.default)(_this, "breakoutLocusForHandleLater", void 0);
202
206
  (0, _defineProperty2.default)(_this, "namespace", _constants.MEETINGS);
203
207
  (0, _defineProperty2.default)(_this, "registrationStatus", void 0);
208
+ /**
209
+ * Emits a metric describing how well this browser runs WebAssembly, used to spot browsers
210
+ * where real-time WASM effects (e.g. background noise removal) run poorly.
211
+ *
212
+ * @param {string} correlationId - correlation id to report the result against
213
+ * @returns {void}
214
+ */
215
+ (0, _defineProperty2.default)(_this, "emitWasmRuntimePerformance", (0, _lodash.once)(function (correlationId) {
216
+ // This check is designed to swallow any probe/metrics failure so it can never break meeting
217
+ // creation, while still reporting the status so we can track browsers with WASM issues.
218
+ _webCapabilities.WasmRuntimeProbe.check().then(function (result) {
219
+ _loggerProxy.default.logger.log("Meetings:index#emitWasmRuntimePerformance --> WASM runtime performance status: ".concat(result.status, ", ratio: ").concat(result.ratio, ", wasmMs: ").concat(result.wasmMs, ", jsMs: ").concat(result.jsMs));
220
+ return _metrics.default.sendBehavioralMetric(_constants2.default.WASM_RUNTIME_PERFORMANCE, {
221
+ status: result.status,
222
+ ratio: result.ratio,
223
+ wasmMs: result.wasmMs,
224
+ jsMs: result.jsMs,
225
+ correlation_id: correlationId
226
+ });
227
+ }).catch(function (error) {
228
+ _loggerProxy.default.logger.error("Meetings:index#emitWasmRuntimePerformance --> ERROR, failed to probe or report WASM runtime performance: ".concat(error.message));
229
+ });
230
+ }));
204
231
  /**
205
232
  * Creates a noise reduction effect
206
233
  *
@@ -351,11 +378,11 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
351
378
  return (0, _createClass2.default)(Meetings, [{
352
379
  key: "isNeedHandleMainLocus",
353
380
  value: function isNeedHandleMainLocus(meeting, newLocus) {
354
- var _newLocus$controls, _newLocus$controls$br, _newLocus$self, _newLocus$self2, _newLocus$self3, _breakoutLocus$joined, _newLocus$self4;
381
+ var _newLocus$controls, _newLocus$controls$br, _newLocus$self, _breakoutLocus$joined, _newLocus$self2;
355
382
  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
383
  var breakoutLocus = this.meetingCollection.getActiveBreakoutLocus(breakoutUrl);
357
384
  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_;
385
+ var isSelfMoved = _util2.default.isSelfMovedOrBreakoutEnded(newLocus);
359
386
  // @ts-ignore
360
387
  var deviceFromNewLocus = _util2.default.getThisDevice(newLocus, this.webex.internal.device.url);
361
388
  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 +407,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
380
407
  _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
408
  return false;
382
409
  }
383
- if (isSelfMoved && (newLocus !== null && newLocus !== void 0 && (_newLocus$self4 = newLocus.self) !== null && _newLocus$self4 !== void 0 && _newLocus$self4.removed || isResourceMovedOnThisDevice)) {
410
+ if (isSelfMoved && (newLocus !== null && newLocus !== void 0 && (_newLocus$self2 = newLocus.self) !== null && _newLocus$self2 !== void 0 && _newLocus$self2.removed || isResourceMovedOnThisDevice)) {
384
411
  _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
412
  return false;
386
413
  }
@@ -404,15 +431,15 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
404
431
  key: "isNeedHandleLocusDTO",
405
432
  value: function isNeedHandleLocusDTO(meeting, newLocus) {
406
433
  if (newLocus) {
407
- var _newLocus$self5, _newLocus$self6, _newLocus$self7, _newLocus$self7$devic, _newLocus$self7$devic2, _newLocus$self8, _newLocus$self8$devic, _newLocus$self8$devic2;
434
+ var _newLocus$self3, _newLocus$self3$devic, _newLocus$self3$devic2, _newLocus$self4, _newLocus$self4$devic, _newLocus$self4$devic2;
408
435
  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_;
436
+ var isSelfMoved = _util2.default.isSelfMovedOrBreakoutEnded(newLocus);
437
+ 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
438
  if (!meeting) {
412
439
  if (isNewLocusAsBreakout) {
413
- var _newLocus$fullState, _newLocus$self9;
440
+ var _newLocus$fullState, _newLocus$self5;
414
441
  _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_;
442
+ return ((_newLocus$self5 = newLocus.self) === null || _newLocus$self5 === void 0 ? void 0 : _newLocus$self5.state) === _constants._JOINED_;
416
443
  }
417
444
  return this.isNeedHandleMainLocus(meeting, newLocus);
418
445
  }
@@ -446,6 +473,13 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
446
473
  if (existingMeeting) {
447
474
  return existingMeeting;
448
475
  }
476
+ if (data.eventType === _constants.LOCUSEVENT.HASH_TREE_DATA_UPDATED) {
477
+ // need to check if maybe this event indicates a move to/from breakout
478
+ var meetingForHashTreeMessage = (0, _locusInfo.findMeetingForHashTreeMessage)(data === null || data === void 0 ? void 0 : data.stateElementsMessage, this.meetingCollection);
479
+ if (meetingForHashTreeMessage) {
480
+ return meetingForHashTreeMessage;
481
+ }
482
+ }
449
483
 
450
484
  // if that didn't work, fallback to other fields like correlationId, sipUri, etc
451
485
 
@@ -481,6 +515,10 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
481
515
  var _this2 = this;
482
516
  var useRandomDelayForInfo = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
483
517
  var meeting = this.getCorrespondingMeetingByLocus(data);
518
+ // @ts-ignore
519
+ if (this.config.experimental.storeLocusHashTreeEventsForDebugging) {
520
+ (0, _meeting.storeEventForDebugging)('mercury', data);
521
+ }
484
522
 
485
523
  // Special case when locus has got replaced, This only happend once if a replace locus exists
486
524
  // https://sqbu-github.cisco.com/WebExSquared/locus/wiki/Locus-changing-mid-call
@@ -492,7 +530,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
492
530
  meeting = this.meetingCollection.getByKey(_meetings.MEETING_KEY.LOCUS_URL, data.locus.replaces[data.locus.replaces.length - 1].locusUrl);
493
531
  }
494
532
  if (meeting && !_util2.default.isBreakoutLocusDTO(data.locus)) {
495
- meeting.locusInfo.updateMainSessionLocusCache(data.locus);
533
+ meeting.locusInfo.updateMainSessionLocusCache(data.locus); // here data.locus will never be a complete locus
496
534
  }
497
535
  if (!this.isNeedHandleLocusDTO(meeting, data.locus)) {
498
536
  _loggerProxy.default.logger.log("Meetings:index#handleLocusEvent --> doesn't need to process locus event");
@@ -519,25 +557,29 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
519
557
  // };
520
558
  // rather then locus object change to locus url
521
559
 
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
- }
560
+ if (data.eventType === _constants.LOCUSEVENT.HASH_TREE_DATA_UPDATED) {
561
+ // We're about to create a new meeting object from this hash tree message.
562
+ // There is some existing (pre-hash trees) SDK logic here that requires a locus object
563
+ // (at the very minimum we need locus.url to be set)
564
+ // so we try to create locus from the received hash tree message
565
+ // it will not be complete, in most cases it will only have the self part, but that's still better than nothing
566
+ var _createLocusFromHashT = (0, _locusInfo.createLocusFromHashTreeMessage)(data.stateElementsMessage),
567
+ locus = _createLocusFromHashT.locus;
568
+ data.locus = locus;
569
+ }
570
+ if (data.locus && data.locus.fullState && data.locus.fullState.state === _constants.LOCUS.STATE.INACTIVE) {
571
+ // just ignore the event as its already ended and not active
572
+ _loggerProxy.default.logger.warn('Meetings:index#handleLocusEvent --> Locus event received for meeting, after it was ended.');
573
+ return;
574
+ }
528
575
 
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
576
+ // When its wireless share or guest and user leaves the meeting we dont have to keep the meeting object
577
+ // Any future events will be neglected
531
578
 
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);
579
+ if (data.locus && data.locus.self && data.locus.self.state === _constants._LEFT_ && data.locus.self.removed === true) {
580
+ // just ignore the event as its already ended and not active
581
+ _loggerProxy.default.logger.warn('Meetings:index#handleLocusEvent --> Locus event received for meeting, after it was ended.');
582
+ return;
541
583
  }
542
584
  this.create(data.locus, _constants.DESTINATION_TYPE.LOCUS_ID, useRandomDelayForInfo).then(/*#__PURE__*/function () {
543
585
  var _ref3 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3(newMeeting) {
@@ -552,6 +594,8 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
552
594
  trigger: data.eventType === _constants.LOCUSEVENT.SDK_LOCUS_FROM_SYNC_MEETINGS ? 'get-loci-response' : 'locus-message',
553
595
  locus: data.locus,
554
596
  hashTreeMessage: data.stateElementsMessage
597
+ }, function (locus) {
598
+ meeting.finalizeMeetingAfterInitialLocusSetup(locus);
555
599
  });
556
600
  case 2:
557
601
  _context3.next = 4;
@@ -608,7 +652,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
608
652
  }
609
653
 
610
654
  /**
611
- * handles locus events through mercury that are not roap
655
+ * handles locus events through mercury that are not roap or approval request events
612
656
  * @param {Object} envelope
613
657
  * @param {Object} envelope.data
614
658
  * @param {String} envelope.data.eventType
@@ -622,7 +666,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
622
666
  var data = envelope.data;
623
667
  // eslint-disable-next-line @typescript-eslint/no-shadow
624
668
  var eventType = data.eventType;
625
- if (eventType && eventType !== _constants.LOCUSEVENT.MESSAGE_ROAP) {
669
+ if (eventType && eventType !== _constants.LOCUSEVENT.MESSAGE_ROAP && eventType !== _constants.LOCUSEVENT.APPROVAL_REQUEST) {
626
670
  this.handleLocusEvent(data, true);
627
671
  }
628
672
  }
@@ -804,46 +848,6 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
804
848
  }
805
849
  }
806
850
 
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
851
  /**
848
852
  * API to toggle backend ipv6 native support config, needs to be called before webex.meetings.register()
849
853
  *
@@ -909,6 +913,29 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
909
913
  }
910
914
  }
911
915
 
916
+ /**
917
+ * API to toggle AV1 codec support for video slides in multistream,
918
+ * needs to be called before webex.meetings.joinWithMedia()
919
+ *
920
+ * @param {Boolean} newValue
921
+ * @private
922
+ * @memberof Meetings
923
+ * @returns {undefined}
924
+ */
925
+ }, {
926
+ key: "_toggleEnableAv1SlidesSupport",
927
+ value: function _toggleEnableAv1SlidesSupport(newValue) {
928
+ if (typeof newValue !== 'boolean') {
929
+ return;
930
+ }
931
+
932
+ // @ts-ignore
933
+ if (this.config.enableAv1SlidesSupport !== newValue) {
934
+ // @ts-ignore
935
+ this.config.enableAv1SlidesSupport = newValue;
936
+ }
937
+ }
938
+
912
939
  /**
913
940
  * API to toggle stopping ICE Candidates Gathering after first relay candidate,
914
941
  * needs to be called before webex.meetings.joinWithMedia()
@@ -943,7 +970,11 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
943
970
  value: function executeRegistrationStep(step, stepName) {
944
971
  var _this5 = this;
945
972
  return step().then(function () {
973
+ _loggerProxy.default.logger.info("Meetings:index#executeRegistrationStep --> INFO, ".concat(stepName, " completed"));
946
974
  _this5.registrationStatus[stepName] = true;
975
+ }).catch(function (error) {
976
+ _loggerProxy.default.logger.error("Meetings:index#executeRegistrationStep --> ERROR, ".concat(stepName, " failed: ").concat(error.message));
977
+ return _promise.default.reject(error);
947
978
  });
948
979
  }
949
980
 
@@ -960,7 +991,20 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
960
991
  key: "register",
961
992
  value: function register(deviceRegistrationOptions) {
962
993
  var _this6 = this;
963
- this.registrationStatus = (0, _lodash.clone)(_constants.INITIAL_REGISTRATION_STATUS);
994
+ if (this.unregistrationPromise) {
995
+ _loggerProxy.default.logger.info('Meetings:index#register --> INFO, Meetings plugin unregistration in progress, waiting to register');
996
+ this.registrationPromise = this.unregistrationPromise.catch(function () {}) // It doesn't matter what happened during unregistration
997
+ .finally(function () {
998
+ _loggerProxy.default.logger.info('Meetings:index#register --> INFO, Meetings plugin unregistration completed, proceeding to register');
999
+ _this6.registrationPromise = null;
1000
+ return _this6.register(deviceRegistrationOptions);
1001
+ });
1002
+ return this.registrationPromise;
1003
+ }
1004
+ if (this.registrationPromise) {
1005
+ _loggerProxy.default.logger.info('Meetings:index#register --> INFO, Meetings plugin registration in progress, returning existing promise');
1006
+ return this.registrationPromise;
1007
+ }
964
1008
 
965
1009
  // @ts-ignore
966
1010
  if (!this.webex.canAuthorize) {
@@ -971,7 +1015,9 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
971
1015
  _loggerProxy.default.logger.info('Meetings:index#register --> INFO, Meetings plugin already registered');
972
1016
  return _promise.default.resolve();
973
1017
  }
974
- return _promise.default.all([this.executeRegistrationStep(function () {
1018
+ _loggerProxy.default.logger.info('Meetings:index#register --> INFO, Registering Meetings plugin');
1019
+ this.registrationStatus = (0, _lodash.clone)(_constants.INITIAL_REGISTRATION_STATUS);
1020
+ this.registrationPromise = _promise.default.all([this.executeRegistrationStep(function () {
975
1021
  return _this6.fetchUserPreferredWebexSite();
976
1022
  }, 'fetchWebexSite'), this.executeRegistrationStep(function () {
977
1023
  return _this6.getGeoHint();
@@ -1012,7 +1058,10 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1012
1058
  stack: error.stack
1013
1059
  });
1014
1060
  return _promise.default.reject(error);
1061
+ }).finally(function () {
1062
+ _this6.registrationPromise = null;
1015
1063
  });
1064
+ return this.registrationPromise;
1016
1065
  }
1017
1066
 
1018
1067
  /**
@@ -1027,35 +1076,61 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1027
1076
  key: "unregister",
1028
1077
  value: function unregister() {
1029
1078
  var _this7 = this;
1079
+ if (this.unregistrationPromise) {
1080
+ _loggerProxy.default.logger.info('Meetings:index#unregister --> INFO, Meetings plugin unregistration in progress, returning existing promise');
1081
+ return this.unregistrationPromise;
1082
+ }
1083
+ if (this.registrationPromise) {
1084
+ _loggerProxy.default.logger.info('Meetings:index#unregister --> INFO, Meetings plugin registration in progress, waiting to unregister');
1085
+
1086
+ // Wait for registration to complete (success or failure), then call unregister again
1087
+ this.unregistrationPromise = this.registrationPromise.catch(function () {}) // It doesn't matter what happened during registration
1088
+ .finally(function () {
1089
+ _loggerProxy.default.logger.info('Meetings:index#unregister --> INFO, Meetings plugin registration completed, proceeding to unregister');
1090
+ _this7.unregistrationPromise = null;
1091
+ return _this7.unregister();
1092
+ });
1093
+ return this.unregistrationPromise;
1094
+ }
1030
1095
  if (!this.registered) {
1031
1096
  _loggerProxy.default.logger.info('Meetings:index#unregister --> INFO, Meetings plugin already unregistered');
1032
1097
  return _promise.default.resolve();
1033
1098
  }
1034
1099
  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
- );
1100
+ this.unregistrationPromise =
1101
+ // @ts-ignore
1102
+ this.webex.internal.mercury
1103
+ // Use code 3050 with a non-reconnecting reason to prevent Mercury auto-reconnect
1104
+ // during unregister. Without this, disconnect() defaults to code 1000/"Done" which
1105
+ // force-closes as "Done (forced)" - a normalReconnectReason that triggers auto-reconnect,
1106
+ // causing a race condition with device.unregister().
1107
+ .disconnect({
1108
+ code: 3050,
1109
+ reason: 'meetings unregister'
1110
+ })
1111
+ // @ts-ignore
1112
+ .then(function () {
1113
+ return _this7.webex.internal.device.unregister();
1114
+ }).catch(function (error) {
1115
+ // If error status code is 404, continue the chain
1116
+ if (error.statusCode === 404) {
1117
+ _loggerProxy.default.logger.info('Meetings:index#unregister --> 404 error during device unregister, proceeding normally');
1118
+ return; // returning undefined allows the chain to continue
1119
+ }
1120
+ // For any other status code, break the chain by rethrowing
1121
+ _loggerProxy.default.logger.error("Meetings:index#unregister --> Failed to unregister device: ".concat(error.message));
1122
+ throw error; // rethrow to break the promise chain
1123
+ }).then(function () {
1124
+ _triggerProxy.default.trigger(_this7, {
1125
+ file: 'meetings',
1126
+ function: 'unregister'
1127
+ }, _constants.EVENT_TRIGGERS.MEETINGS_UNREGISTERED);
1128
+ _this7.registered = false;
1129
+ _this7.registrationStatus = (0, _lodash.clone)(_constants.INITIAL_REGISTRATION_STATUS);
1130
+ }).finally(function () {
1131
+ _this7.unregistrationPromise = null;
1132
+ });
1133
+ return this.unregistrationPromise;
1059
1134
  }
1060
1135
  }, {
1061
1136
  key: "uploadLogs",
@@ -1206,6 +1281,31 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1206
1281
  return this.personalMeetingRoom;
1207
1282
  }
1208
1283
 
1284
+ /**
1285
+ * Fetches site preferences for the provided Webex site, or the preferred Webex site.
1286
+ * This is used to determine capabilities of the site, such as whether scheduling a webinar is supported.
1287
+ *
1288
+ * @param {object} [options]
1289
+ * @param {string} [options.siteUrl] - Webex site URL. Defaults to preferredWebexSite, for example "cisco.webex.com".
1290
+ * @param {string} [options.siteName] - Site name query override. Defaults to the site name derived from siteUrl, for example "cisco" for "cisco.webex.com".
1291
+ * @param {SitePreferenceSelectOption[]} [options.selectOptions] - Preference sections to fetch. Defaults to 'scheduling'.
1292
+ * @returns {Promise<SitePreferencesResponse>} site preferences response body
1293
+ * @throws {ParameterError}
1294
+ * @public
1295
+ * @memberof Meetings
1296
+ * @example
1297
+ * const preferences = await webex.meetings.fetchSitePreferencesMeViaSite();
1298
+ * const supportScheduleWebinar = preferences?.scheduling?.supportScheduleWebinar;
1299
+ */
1300
+ }, {
1301
+ key: "fetchSitePreferencesMeViaSite",
1302
+ value: function fetchSitePreferencesMeViaSite() {
1303
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1304
+ return this.request.fetchSitePreferencesMeViaSite(_objectSpread(_objectSpread({}, options), {}, {
1305
+ siteUrl: options.siteUrl || this.preferredWebexSite
1306
+ }));
1307
+ }
1308
+
1209
1309
  /**
1210
1310
  * Returns basic information about a meeting that exists or
1211
1311
  * used to exist in the MeetingCollection
@@ -1401,6 +1501,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1401
1501
  });
1402
1502
  }
1403
1503
  });
1504
+ _this1.emitWasmRuntimePerformance(createdMeeting.correlationId);
1404
1505
  } else {
1405
1506
  _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
1507
  }
@@ -1498,6 +1599,8 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1498
1599
  isMeetingActive,
1499
1600
  enableUnifiedMeetings,
1500
1601
  meetingInfoOptions,
1602
+ shouldDeferMeetingInfoFetch,
1603
+ isOneOnOneCallLocus,
1501
1604
  meetingAddedType,
1502
1605
  _args4 = arguments,
1503
1606
  _t2;
@@ -1552,16 +1655,18 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1552
1655
  extraParams: infoExtraParams,
1553
1656
  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
1657
  };
1658
+ shouldDeferMeetingInfoFetch = type === _constants.DESTINATION_TYPE.LOCUS_ID && !(destination !== null && destination !== void 0 && destination.info);
1659
+ isOneOnOneCallLocus = type === _constants.DESTINATION_TYPE.LOCUS_ID && _util2.default.isOneOnOneCall(destination);
1555
1660
  if (!meetingInfo) {
1556
1661
  _context4.next = 2;
1557
1662
  break;
1558
1663
  }
1559
1664
  meeting.injectMeetingInfo(meetingInfo, meetingInfoOptions, meetingLookupUrl);
1560
- _context4.next = 4;
1665
+ _context4.next = 6;
1561
1666
  break;
1562
1667
  case 2:
1563
- if (!(type !== _constants.DESTINATION_TYPE.ONE_ON_ONE_CALL)) {
1564
- _context4.next = 4;
1668
+ if (!(type !== _constants.DESTINATION_TYPE.ONE_ON_ONE_CALL && !isOneOnOneCallLocus)) {
1669
+ _context4.next = 6;
1565
1670
  break;
1566
1671
  }
1567
1672
  if (!(enableUnifiedMeetings && !isMeetingActive && useRandomDelayForInfo && waitingTime > 0)) {
@@ -1572,41 +1677,54 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1572
1677
  return meeting.fetchMeetingInfo(meetingInfoOptions);
1573
1678
  }, waitingTime);
1574
1679
  meeting.parseMeetingInfo(undefined, destination);
1575
- _context4.next = 4;
1680
+ _context4.next = 6;
1576
1681
  break;
1577
1682
  case 3:
1683
+ if (shouldDeferMeetingInfoFetch) {
1684
+ _context4.next = 5;
1685
+ break;
1686
+ }
1578
1687
  _context4.next = 4;
1579
1688
  return meeting.fetchMeetingInfo(meetingInfoOptions);
1580
1689
  case 4:
1581
- _context4.next = 8;
1690
+ _context4.next = 6;
1582
1691
  break;
1583
1692
  case 5:
1584
- _context4.prev = 5;
1693
+ _loggerProxy.default.logger.info('Meetings:index#createMeeting --> defer fetchMeetingInfo for incomplete locus, will do it after locus initialSetup');
1694
+ case 6:
1695
+ _context4.next = 10;
1696
+ break;
1697
+ case 7:
1698
+ _context4.prev = 7;
1585
1699
  _t2 = _context4["catch"](1);
1586
1700
  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;
1701
+ _context4.next = 9;
1588
1702
  break;
1589
1703
  }
1590
1704
  _loggerProxy.default.logger.info("Meetings:index#createMeeting --> Info Unable to fetch meeting info for ".concat(destination, "."));
1591
1705
  if (!failOnMissingMeetingInfo) {
1592
- _context4.next = 6;
1706
+ _context4.next = 8;
1593
1707
  break;
1594
1708
  }
1595
1709
  _loggerProxy.default.logger.info("Meetings:index#createMeeting --> Destroying meeting due to missing meeting info.");
1596
1710
  // @ts-ignore
1597
1711
  this.destroy(meeting, _constants.MEETING_REMOVED_REASON.MISSING_MEETING_INFO);
1598
1712
  throw new _noMeetingInfo.default();
1599
- case 6:
1713
+ case 8:
1600
1714
  // if there is no meeting info and no error should be thrown then we assume its a 1:1 call or wireless share
1601
1715
  _loggerProxy.default.logger.info('Meetings:index#createMeeting --> Info assuming this destination is a 1:1 or wireless share');
1602
- case 7:
1716
+ case 9:
1603
1717
  _loggerProxy.default.logger.debug("Meetings:index#createMeeting --> Debug ".concat(_t2, " fetching /meetingInfo for creation."));
1604
- case 8:
1605
- _context4.prev = 8;
1718
+ case 10:
1719
+ _context4.prev = 10;
1606
1720
  // For type LOCUS_ID we need to parse the locus object to get the information
1607
1721
  // about the caller and callee
1608
1722
  // Meeting Added event will be created in `handleLocusEvent`
1609
- if (type !== _constants.DESTINATION_TYPE.LOCUS_ID) {
1723
+ // Only emit MEETING_ADDED if the meeting still exists in the collection.
1724
+ // If fetchMeetingInfo failed and the meeting was destroyed in the catch block,
1725
+ // skip emitting to prevent orphaned meeting references on the consumer side.
1726
+ // @ts-ignore - getMeetingByType types value as object but accepts strings (same as handleLocusEvent)
1727
+ if (type !== _constants.DESTINATION_TYPE.LOCUS_ID && this.getMeetingByType(_constants._ID_, meeting.id)) {
1610
1728
  if (!meeting.sipUri) {
1611
1729
  meeting.setSipUri(destination);
1612
1730
  }
@@ -1622,14 +1740,14 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1622
1740
  type: meetingAddedType
1623
1741
  });
1624
1742
  }
1625
- return _context4.finish(8);
1626
- case 9:
1743
+ return _context4.finish(10);
1744
+ case 11:
1627
1745
  return _context4.abrupt("return", meeting);
1628
- case 10:
1746
+ case 12:
1629
1747
  case "end":
1630
1748
  return _context4.stop();
1631
1749
  }
1632
- }, _callee4, this, [[1, 5, 8, 9]]);
1750
+ }, _callee4, this, [[1, 7, 10, 11]]);
1633
1751
  }));
1634
1752
  function createMeeting(_x4) {
1635
1753
  return _createMeeting.apply(this, arguments);
@@ -1672,51 +1790,141 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1672
1790
  */
1673
1791
  }, {
1674
1792
  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
- }
1793
+ value: (function () {
1794
+ var _syncMeetings = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee5() {
1795
+ var _this11 = this;
1796
+ var _ref4,
1797
+ _ref4$keepOnlyLocusMe,
1798
+ keepOnlyLocusMeetings,
1799
+ _ref4$skipHashTreeSyn,
1800
+ skipHashTreeSync,
1801
+ locusArray,
1802
+ activeLocusUrl,
1803
+ lociToUpdate,
1804
+ meetingsCollection,
1805
+ _loop,
1806
+ _i,
1807
+ _Object$values,
1808
+ remainingMeetings,
1809
+ syncPromises,
1810
+ _i2,
1811
+ _arr,
1812
+ meeting,
1813
+ _args6 = arguments,
1814
+ _t3;
1815
+ return _regenerator.default.wrap(function (_context6) {
1816
+ while (1) switch (_context6.prev = _context6.next) {
1817
+ case 0:
1818
+ _ref4 = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {}, _ref4$keepOnlyLocusMe = _ref4.keepOnlyLocusMeetings, keepOnlyLocusMeetings = _ref4$keepOnlyLocusMe === void 0 ? true : _ref4$keepOnlyLocusMe, _ref4$skipHashTreeSyn = _ref4.skipHashTreeSync, skipHashTreeSync = _ref4$skipHashTreeSyn === void 0 ? false : _ref4$skipHashTreeSyn;
1819
+ if (!this.webex.credentials.isUnverifiedGuest) {
1820
+ _context6.next = 1;
1821
+ break;
1822
+ }
1823
+ _loggerProxy.default.logger.info('Meetings:index#syncMeetings --> user is unverified guest, skipping calling Locus for meeting sync');
1824
+ _context6.next = 7;
1825
+ break;
1826
+ case 1:
1827
+ _context6.prev = 1;
1828
+ _context6.next = 2;
1829
+ return this.request.getActiveMeetings();
1830
+ case 2:
1831
+ locusArray = _context6.sent;
1832
+ activeLocusUrl = [];
1833
+ if (locusArray !== null && locusArray !== void 0 && locusArray.loci && locusArray.loci.length > 0) {
1834
+ lociToUpdate = this.sortLocusArrayToUpdate(locusArray.loci);
1835
+ lociToUpdate.forEach(function (locus) {
1836
+ activeLocusUrl.push(locus.url);
1837
+ _this11.handleLocusEvent({
1838
+ eventType: _constants.LOCUSEVENT.SDK_LOCUS_FROM_SYNC_MEETINGS,
1839
+ locus: locus,
1840
+ locusUrl: locus.url
1841
+ });
1842
+ });
1843
+ }
1844
+ meetingsCollection = this.meetingCollection.getAll();
1845
+ if (!((0, _keys.default)(meetingsCollection).length > 0)) {
1846
+ _context6.next = 5;
1847
+ break;
1848
+ }
1849
+ _loop = /*#__PURE__*/_regenerator.default.mark(function _loop() {
1850
+ var meeting, locusUrl, locusInfo, _locusInfo$info, _locusArray$loci, globalMeetingId;
1851
+ return _regenerator.default.wrap(function (_context5) {
1852
+ while (1) switch (_context5.prev = _context5.next) {
1853
+ case 0:
1854
+ meeting = _Object$values[_i];
1855
+ // @ts-ignore
1856
+ locusUrl = meeting.locusUrl, locusInfo = meeting.locusInfo;
1857
+ if ((keepOnlyLocusMeetings || locusUrl) && !activeLocusUrl.includes(locusUrl)) {
1858
+ globalMeetingId = locusInfo === null || locusInfo === void 0 ? void 0 : (_locusInfo$info = locusInfo.info) === null || _locusInfo$info === void 0 ? void 0 : _locusInfo$info.globalMeetingId;
1859
+ if (globalMeetingId && locusArray !== null && locusArray !== void 0 && (_locusArray$loci = locusArray.loci) !== null && _locusArray$loci !== void 0 && _locusArray$loci.some(function (locus) {
1860
+ var _locus$info;
1861
+ return ((_locus$info = locus.info) === null || _locus$info === void 0 ? void 0 : _locus$info.globalMeetingId) === globalMeetingId;
1862
+ })) {
1863
+ // don't destroy the meeting as Locus API still returned some Locus that shares
1864
+ // the same globalMeetingId - that happens for example if a webinar user (who hasn't scheduled it)
1865
+ // is in a breakout and gets moved to a different breakout while we were offline
1866
+ } else {
1867
+ // destroy function also uploads logs
1868
+ // @ts-ignore
1869
+ _this11.destroy(meeting, _constants.MEETING_REMOVED_REASON.NO_MEETINGS_TO_SYNC);
1870
+ }
1871
+ }
1872
+ case 1:
1873
+ case "end":
1874
+ return _context5.stop();
1875
+ }
1876
+ }, _loop);
1877
+ });
1878
+ _i = 0, _Object$values = (0, _values.default)(meetingsCollection);
1879
+ case 3:
1880
+ if (!(_i < _Object$values.length)) {
1881
+ _context6.next = 5;
1882
+ break;
1883
+ }
1884
+ return _context6.delegateYield(_loop(), "t0", 4);
1885
+ case 4:
1886
+ _i++;
1887
+ _context6.next = 3;
1888
+ break;
1889
+ case 5:
1890
+ _context6.next = 7;
1891
+ break;
1892
+ case 6:
1893
+ _context6.prev = 6;
1894
+ _t3 = _context6["catch"](1);
1895
+ _loggerProxy.default.logger.error("Meetings:index#syncMeetings --> failed to sync meetings, ".concat(_t3));
1896
+ throw _t3;
1897
+ case 7:
1898
+ if (skipHashTreeSync) {
1899
+ _context6.next = 8;
1900
+ break;
1901
+ }
1902
+ // Trigger hash tree syncs for all remaining meetings
1903
+ remainingMeetings = this.meetingCollection.getAll();
1904
+ syncPromises = [];
1905
+ for (_i2 = 0, _arr = (0, _values.default)(remainingMeetings); _i2 < _arr.length; _i2++) {
1906
+ meeting = _arr[_i2];
1907
+ if (meeting.locusInfo) {
1908
+ syncPromises.push(meeting.locusInfo.syncAllHashTreeDatasets());
1909
+ }
1910
+ }
1911
+ if (!(syncPromises.length > 0)) {
1912
+ _context6.next = 8;
1913
+ break;
1914
+ }
1915
+ _context6.next = 8;
1916
+ return _promise.default.all(syncPromises);
1917
+ case 8:
1918
+ case "end":
1919
+ return _context6.stop();
1712
1920
  }
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
-
1921
+ }, _callee5, this, [[1, 6]]);
1922
+ }));
1923
+ function syncMeetings() {
1924
+ return _syncMeetings.apply(this, arguments);
1925
+ }
1926
+ return syncMeetings;
1927
+ }()
1720
1928
  /**
1721
1929
  * sort out locus array for initial creating
1722
1930
  * @param {Array} loci original locus array
@@ -1724,6 +1932,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1724
1932
  * @public
1725
1933
  * @memberof Meetings
1726
1934
  */
1935
+ )
1727
1936
  }, {
1728
1937
  key: "sortLocusArrayToUpdate",
1729
1938
  value: function sortLocusArrayToUpdate(loci) {
@@ -1738,8 +1947,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1738
1947
  var lociToUpdate = (0, _toConsumableArray2.default)(mainLoci);
1739
1948
  breakoutLoci.forEach(function (breakoutLocus) {
1740
1949
  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);
1950
+ return _util2.default.isMainAssociatedWithBreakout(mainLocus, breakoutLocus);
1743
1951
  });
1744
1952
  var existCorrespondingMeeting = _this12.getCorrespondingMeetingByLocus({
1745
1953
  eventType: _constants.LOCUSEVENT.SDK_NO_EVENT,
@@ -1775,15 +1983,14 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1775
1983
  return;
1776
1984
  }
1777
1985
  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);
1986
+ return _util2.default.isMainAssociatedWithBreakout(newCreatedLocus, breakoutLocus);
1780
1987
  });
1781
1988
  if (existIndex < 0) {
1782
1989
  return;
1783
1990
  }
1784
1991
  var associateBreakoutLocus = this.breakoutLocusForHandleLater[existIndex];
1785
1992
  this.handleLocusEvent({
1786
- eventType: _constants.LOCUSEVENT.SDK_NO_EVENT,
1993
+ eventType: _constants.LOCUSEVENT.SDK_LOCUS_FROM_SYNC_MEETINGS,
1787
1994
  locus: associateBreakoutLocus,
1788
1995
  locusUrl: associateBreakoutLocus.url
1789
1996
  });