@webex/plugin-meetings 3.0.0-beta.34 → 3.0.0-beta.340

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 (392) hide show
  1. package/README.md +46 -8
  2. package/dist/annotation/annotation.types.js +7 -0
  3. package/dist/annotation/annotation.types.js.map +1 -0
  4. package/dist/annotation/constants.js +49 -0
  5. package/dist/annotation/constants.js.map +1 -0
  6. package/dist/annotation/index.js +342 -0
  7. package/dist/annotation/index.js.map +1 -0
  8. package/dist/breakouts/breakout.js +94 -15
  9. package/dist/breakouts/breakout.js.map +1 -1
  10. package/dist/breakouts/edit-lock-error.js +52 -0
  11. package/dist/breakouts/edit-lock-error.js.map +1 -0
  12. package/dist/breakouts/events.js +45 -0
  13. package/dist/breakouts/events.js.map +1 -0
  14. package/dist/breakouts/index.js +709 -35
  15. package/dist/breakouts/index.js.map +1 -1
  16. package/dist/breakouts/utils.js +45 -1
  17. package/dist/breakouts/utils.js.map +1 -1
  18. package/dist/common/errors/no-meeting-info.js +51 -0
  19. package/dist/common/errors/no-meeting-info.js.map +1 -0
  20. package/dist/common/errors/reclaim-host-role-errors.js +158 -0
  21. package/dist/common/errors/reclaim-host-role-errors.js.map +1 -0
  22. package/dist/common/errors/webex-errors.js +48 -7
  23. package/dist/common/errors/webex-errors.js.map +1 -1
  24. package/dist/common/logs/logger-proxy.js +1 -1
  25. package/dist/common/logs/logger-proxy.js.map +1 -1
  26. package/dist/common/logs/request.js +5 -1
  27. package/dist/common/logs/request.js.map +1 -1
  28. package/dist/common/queue.js +24 -9
  29. package/dist/common/queue.js.map +1 -1
  30. package/dist/config.js +5 -10
  31. package/dist/config.js.map +1 -1
  32. package/dist/constants.js +233 -29
  33. package/dist/constants.js.map +1 -1
  34. package/dist/controls-options-manager/enums.js +14 -2
  35. package/dist/controls-options-manager/enums.js.map +1 -1
  36. package/dist/controls-options-manager/index.js +109 -15
  37. package/dist/controls-options-manager/index.js.map +1 -1
  38. package/dist/controls-options-manager/types.js +7 -0
  39. package/dist/controls-options-manager/types.js.map +1 -0
  40. package/dist/controls-options-manager/util.js +309 -18
  41. package/dist/controls-options-manager/util.js.map +1 -1
  42. package/dist/index.js +112 -1
  43. package/dist/index.js.map +1 -1
  44. package/dist/interpretation/collection.js +23 -0
  45. package/dist/interpretation/collection.js.map +1 -0
  46. package/dist/interpretation/index.js +366 -0
  47. package/dist/interpretation/index.js.map +1 -0
  48. package/dist/interpretation/siLanguage.js +25 -0
  49. package/dist/interpretation/siLanguage.js.map +1 -0
  50. package/dist/locus-info/controlsUtils.js +91 -2
  51. package/dist/locus-info/controlsUtils.js.map +1 -1
  52. package/dist/locus-info/index.js +383 -62
  53. package/dist/locus-info/index.js.map +1 -1
  54. package/dist/locus-info/infoUtils.js +7 -1
  55. package/dist/locus-info/infoUtils.js.map +1 -1
  56. package/dist/locus-info/mediaSharesUtils.js +57 -1
  57. package/dist/locus-info/mediaSharesUtils.js.map +1 -1
  58. package/dist/locus-info/parser.js +249 -72
  59. package/dist/locus-info/parser.js.map +1 -1
  60. package/dist/locus-info/selfUtils.js +89 -14
  61. package/dist/locus-info/selfUtils.js.map +1 -1
  62. package/dist/media/index.js +62 -116
  63. package/dist/media/index.js.map +1 -1
  64. package/dist/media/properties.js +73 -124
  65. package/dist/media/properties.js.map +1 -1
  66. package/dist/mediaQualityMetrics/config.js +1 -204
  67. package/dist/mediaQualityMetrics/config.js.map +1 -1
  68. package/dist/meeting/in-meeting-actions.js +86 -2
  69. package/dist/meeting/in-meeting-actions.js.map +1 -1
  70. package/dist/meeting/index.js +3927 -2960
  71. package/dist/meeting/index.js.map +1 -1
  72. package/dist/meeting/locusMediaRequest.js +292 -0
  73. package/dist/meeting/locusMediaRequest.js.map +1 -0
  74. package/dist/meeting/muteState.js +224 -131
  75. package/dist/meeting/muteState.js.map +1 -1
  76. package/dist/meeting/request.js +260 -196
  77. package/dist/meeting/request.js.map +1 -1
  78. package/dist/meeting/util.js +601 -417
  79. package/dist/meeting/util.js.map +1 -1
  80. package/dist/meeting-info/index.js +73 -7
  81. package/dist/meeting-info/index.js.map +1 -1
  82. package/dist/meeting-info/meeting-info-v2.js +192 -51
  83. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  84. package/dist/meeting-info/util.js +1 -1
  85. package/dist/meeting-info/util.js.map +1 -1
  86. package/dist/meeting-info/utilv2.js +36 -36
  87. package/dist/meeting-info/utilv2.js.map +1 -1
  88. package/dist/meetings/collection.js +39 -0
  89. package/dist/meetings/collection.js.map +1 -1
  90. package/dist/meetings/index.js +424 -116
  91. package/dist/meetings/index.js.map +1 -1
  92. package/dist/meetings/meetings.types.js +7 -0
  93. package/dist/meetings/meetings.types.js.map +1 -0
  94. package/dist/meetings/request.js +2 -0
  95. package/dist/meetings/request.js.map +1 -1
  96. package/dist/meetings/util.js +72 -6
  97. package/dist/meetings/util.js.map +1 -1
  98. package/dist/member/index.js +58 -0
  99. package/dist/member/index.js.map +1 -1
  100. package/dist/member/types.js +25 -0
  101. package/dist/member/types.js.map +1 -0
  102. package/dist/member/util.js +132 -25
  103. package/dist/member/util.js.map +1 -1
  104. package/dist/members/collection.js +10 -0
  105. package/dist/members/collection.js.map +1 -1
  106. package/dist/members/index.js +102 -6
  107. package/dist/members/index.js.map +1 -1
  108. package/dist/members/request.js +106 -38
  109. package/dist/members/request.js.map +1 -1
  110. package/dist/members/types.js +15 -0
  111. package/dist/members/types.js.map +1 -0
  112. package/dist/members/util.js +326 -232
  113. package/dist/members/util.js.map +1 -1
  114. package/dist/metrics/constants.js +16 -5
  115. package/dist/metrics/constants.js.map +1 -1
  116. package/dist/metrics/index.js +1 -446
  117. package/dist/metrics/index.js.map +1 -1
  118. package/dist/multistream/mediaRequestManager.js +228 -58
  119. package/dist/multistream/mediaRequestManager.js.map +1 -1
  120. package/dist/multistream/receiveSlot.js +29 -16
  121. package/dist/multistream/receiveSlot.js.map +1 -1
  122. package/dist/multistream/receiveSlotManager.js +39 -36
  123. package/dist/multistream/receiveSlotManager.js.map +1 -1
  124. package/dist/multistream/remoteMedia.js +44 -18
  125. package/dist/multistream/remoteMedia.js.map +1 -1
  126. package/dist/multistream/remoteMediaGroup.js +60 -3
  127. package/dist/multistream/remoteMediaGroup.js.map +1 -1
  128. package/dist/multistream/remoteMediaManager.js +209 -59
  129. package/dist/multistream/remoteMediaManager.js.map +1 -1
  130. package/dist/multistream/sendSlotManager.js +233 -0
  131. package/dist/multistream/sendSlotManager.js.map +1 -0
  132. package/dist/reachability/clusterReachability.js +356 -0
  133. package/dist/reachability/clusterReachability.js.map +1 -0
  134. package/dist/reachability/index.js +273 -391
  135. package/dist/reachability/index.js.map +1 -1
  136. package/dist/reachability/request.js +17 -8
  137. package/dist/reachability/request.js.map +1 -1
  138. package/dist/reachability/util.js +29 -0
  139. package/dist/reachability/util.js.map +1 -0
  140. package/dist/reconnection-manager/index.js +214 -170
  141. package/dist/reconnection-manager/index.js.map +1 -1
  142. package/dist/recording-controller/index.js +21 -2
  143. package/dist/recording-controller/index.js.map +1 -1
  144. package/dist/recording-controller/util.js +9 -8
  145. package/dist/recording-controller/util.js.map +1 -1
  146. package/dist/roap/index.js +62 -35
  147. package/dist/roap/index.js.map +1 -1
  148. package/dist/roap/request.js +112 -97
  149. package/dist/roap/request.js.map +1 -1
  150. package/dist/roap/turnDiscovery.js +95 -38
  151. package/dist/roap/turnDiscovery.js.map +1 -1
  152. package/dist/rtcMetrics/constants.js +12 -0
  153. package/dist/rtcMetrics/constants.js.map +1 -0
  154. package/dist/rtcMetrics/index.js +142 -0
  155. package/dist/rtcMetrics/index.js.map +1 -0
  156. package/dist/statsAnalyzer/index.js +181 -214
  157. package/dist/statsAnalyzer/index.js.map +1 -1
  158. package/dist/statsAnalyzer/mqaUtil.js +22 -18
  159. package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
  160. package/dist/types/annotation/annotation.types.d.ts +42 -0
  161. package/dist/types/annotation/constants.d.ts +31 -0
  162. package/dist/types/annotation/index.d.ts +117 -0
  163. package/dist/types/breakouts/edit-lock-error.d.ts +15 -0
  164. package/dist/types/breakouts/events.d.ts +8 -0
  165. package/dist/types/breakouts/utils.d.ts +14 -0
  166. package/dist/types/common/errors/no-meeting-info.d.ts +14 -0
  167. package/dist/types/common/errors/reclaim-host-role-errors.d.ts +60 -0
  168. package/dist/types/common/errors/webex-errors.d.ts +25 -1
  169. package/dist/types/common/logs/request.d.ts +2 -0
  170. package/dist/types/common/queue.d.ts +9 -7
  171. package/dist/types/config.d.ts +2 -7
  172. package/dist/types/constants.d.ts +201 -30
  173. package/dist/types/controls-options-manager/enums.d.ts +11 -1
  174. package/dist/types/controls-options-manager/index.d.ts +17 -1
  175. package/dist/types/controls-options-manager/types.d.ts +43 -0
  176. package/dist/types/controls-options-manager/util.d.ts +1 -7
  177. package/dist/types/index.d.ts +6 -4
  178. package/dist/types/interpretation/collection.d.ts +5 -0
  179. package/dist/types/interpretation/index.d.ts +5 -0
  180. package/dist/types/interpretation/siLanguage.d.ts +5 -0
  181. package/dist/types/locus-info/index.d.ts +57 -4
  182. package/dist/types/locus-info/parser.d.ts +66 -6
  183. package/dist/types/media/index.d.ts +2 -0
  184. package/dist/types/media/properties.d.ts +34 -48
  185. package/dist/types/mediaQualityMetrics/config.d.ts +0 -128
  186. package/dist/types/meeting/in-meeting-actions.d.ts +86 -2
  187. package/dist/types/meeting/index.d.ts +506 -512
  188. package/dist/types/meeting/locusMediaRequest.d.ts +74 -0
  189. package/dist/types/meeting/muteState.d.ts +93 -25
  190. package/dist/types/meeting/request.d.ts +72 -43
  191. package/dist/types/meeting/util.d.ts +101 -1
  192. package/dist/types/meeting-info/index.d.ts +13 -1
  193. package/dist/types/meeting-info/meeting-info-v2.d.ts +31 -1
  194. package/dist/types/meetings/collection.d.ts +17 -0
  195. package/dist/types/meetings/index.d.ts +91 -21
  196. package/dist/types/meetings/meetings.types.d.ts +4 -0
  197. package/dist/types/member/index.d.ts +14 -0
  198. package/dist/types/member/types.d.ts +32 -0
  199. package/dist/types/members/collection.d.ts +5 -0
  200. package/dist/types/members/index.d.ts +35 -2
  201. package/dist/types/members/request.d.ts +73 -9
  202. package/dist/types/members/types.d.ts +25 -0
  203. package/dist/types/members/util.d.ts +214 -1
  204. package/dist/types/metrics/constants.d.ts +15 -4
  205. package/dist/types/metrics/index.d.ts +4 -111
  206. package/dist/types/multistream/mediaRequestManager.d.ts +72 -5
  207. package/dist/types/multistream/receiveSlot.d.ts +13 -11
  208. package/dist/types/multistream/receiveSlotManager.d.ts +14 -4
  209. package/dist/types/multistream/remoteMedia.d.ts +8 -29
  210. package/dist/types/multistream/remoteMediaGroup.d.ts +0 -9
  211. package/dist/types/multistream/remoteMediaManager.d.ts +46 -2
  212. package/dist/types/multistream/sendSlotManager.d.ts +61 -0
  213. package/dist/types/reachability/clusterReachability.d.ts +109 -0
  214. package/dist/types/reachability/index.d.ts +60 -95
  215. package/dist/types/reachability/request.d.ts +7 -3
  216. package/dist/types/reachability/util.d.ts +8 -0
  217. package/dist/types/reconnection-manager/index.d.ts +19 -0
  218. package/dist/types/recording-controller/index.d.ts +15 -1
  219. package/dist/types/recording-controller/util.d.ts +5 -4
  220. package/dist/types/roap/index.d.ts +2 -1
  221. package/dist/types/roap/request.d.ts +15 -11
  222. package/dist/types/roap/turnDiscovery.d.ts +21 -3
  223. package/dist/types/rtcMetrics/constants.d.ts +4 -0
  224. package/dist/types/rtcMetrics/index.d.ts +54 -0
  225. package/dist/types/statsAnalyzer/index.d.ts +29 -11
  226. package/dist/types/webinar/collection.d.ts +16 -0
  227. package/dist/types/webinar/index.d.ts +5 -0
  228. package/dist/webinar/collection.js +44 -0
  229. package/dist/webinar/collection.js.map +1 -0
  230. package/dist/webinar/index.js +69 -0
  231. package/dist/webinar/index.js.map +1 -0
  232. package/package.json +22 -19
  233. package/src/annotation/annotation.types.ts +50 -0
  234. package/src/annotation/constants.ts +36 -0
  235. package/src/annotation/index.ts +328 -0
  236. package/src/breakouts/README.md +42 -12
  237. package/src/breakouts/breakout.ts +67 -9
  238. package/src/breakouts/edit-lock-error.ts +25 -0
  239. package/src/breakouts/events.ts +56 -0
  240. package/src/breakouts/index.ts +592 -20
  241. package/src/breakouts/utils.ts +42 -0
  242. package/src/common/errors/no-meeting-info.ts +24 -0
  243. package/src/common/errors/reclaim-host-role-errors.ts +134 -0
  244. package/src/common/errors/webex-errors.ts +44 -2
  245. package/src/common/logs/logger-proxy.ts +1 -1
  246. package/src/common/logs/request.ts +5 -1
  247. package/src/common/queue.ts +22 -8
  248. package/src/config.ts +4 -9
  249. package/src/constants.ts +224 -20
  250. package/src/controls-options-manager/enums.ts +12 -0
  251. package/src/controls-options-manager/index.ts +116 -21
  252. package/src/controls-options-manager/types.ts +59 -0
  253. package/src/controls-options-manager/util.ts +294 -14
  254. package/src/index.ts +40 -0
  255. package/src/interpretation/README.md +60 -0
  256. package/src/interpretation/collection.ts +19 -0
  257. package/src/interpretation/index.ts +332 -0
  258. package/src/interpretation/siLanguage.ts +18 -0
  259. package/src/locus-info/controlsUtils.ts +108 -0
  260. package/src/locus-info/index.ts +413 -59
  261. package/src/locus-info/infoUtils.ts +10 -2
  262. package/src/locus-info/mediaSharesUtils.ts +64 -0
  263. package/src/locus-info/parser.ts +258 -47
  264. package/src/locus-info/selfUtils.ts +81 -5
  265. package/src/media/index.ts +102 -122
  266. package/src/media/properties.ts +87 -110
  267. package/src/mediaQualityMetrics/config.ts +0 -135
  268. package/src/meeting/in-meeting-actions.ts +171 -3
  269. package/src/meeting/index.ts +3276 -2555
  270. package/src/meeting/locusMediaRequest.ts +313 -0
  271. package/src/meeting/muteState.ts +223 -136
  272. package/src/meeting/request.ts +177 -121
  273. package/src/meeting/util.ts +588 -394
  274. package/src/meeting-info/index.ts +81 -8
  275. package/src/meeting-info/meeting-info-v2.ts +170 -14
  276. package/src/meeting-info/util.ts +1 -1
  277. package/src/meeting-info/utilv2.ts +23 -23
  278. package/src/meetings/collection.ts +33 -0
  279. package/src/meetings/index.ts +454 -125
  280. package/src/meetings/meetings.types.ts +12 -0
  281. package/src/meetings/request.ts +2 -0
  282. package/src/meetings/util.ts +80 -11
  283. package/src/member/index.ts +58 -0
  284. package/src/member/types.ts +38 -0
  285. package/src/member/util.ts +141 -25
  286. package/src/members/collection.ts +8 -0
  287. package/src/members/index.ts +134 -8
  288. package/src/members/request.ts +97 -17
  289. package/src/members/types.ts +29 -0
  290. package/src/members/util.ts +333 -240
  291. package/src/metrics/constants.ts +15 -4
  292. package/src/metrics/index.ts +1 -469
  293. package/src/multistream/mediaRequestManager.ts +277 -82
  294. package/src/multistream/receiveSlot.ts +31 -17
  295. package/src/multistream/receiveSlotManager.ts +34 -24
  296. package/src/multistream/remoteMedia.ts +27 -2
  297. package/src/multistream/remoteMediaGroup.ts +59 -0
  298. package/src/multistream/remoteMediaManager.ts +148 -30
  299. package/src/multistream/sendSlotManager.ts +170 -0
  300. package/src/reachability/clusterReachability.ts +320 -0
  301. package/src/reachability/index.ts +236 -342
  302. package/src/reachability/request.ts +17 -8
  303. package/src/reachability/util.ts +24 -0
  304. package/src/reconnection-manager/index.ts +128 -106
  305. package/src/recording-controller/index.ts +20 -3
  306. package/src/recording-controller/util.ts +26 -9
  307. package/src/roap/index.ts +63 -32
  308. package/src/roap/request.ts +100 -104
  309. package/src/roap/turnDiscovery.ts +48 -26
  310. package/src/rtcMetrics/constants.ts +3 -0
  311. package/src/rtcMetrics/index.ts +124 -0
  312. package/src/statsAnalyzer/index.ts +218 -289
  313. package/src/statsAnalyzer/mqaUtil.ts +28 -30
  314. package/src/webinar/collection.ts +31 -0
  315. package/src/webinar/index.ts +62 -0
  316. package/test/integration/spec/converged-space-meetings.js +60 -3
  317. package/test/integration/spec/journey.js +320 -261
  318. package/test/integration/spec/space-meeting.js +76 -3
  319. package/test/unit/spec/annotation/index.ts +418 -0
  320. package/test/unit/spec/breakouts/breakout.ts +118 -28
  321. package/test/unit/spec/breakouts/edit-lock-error.ts +30 -0
  322. package/test/unit/spec/breakouts/events.ts +89 -0
  323. package/test/unit/spec/breakouts/index.ts +1395 -69
  324. package/test/unit/spec/breakouts/utils.js +52 -1
  325. package/test/unit/spec/common/queue.js +31 -2
  326. package/test/unit/spec/controls-options-manager/index.js +163 -0
  327. package/test/unit/spec/controls-options-manager/util.js +576 -60
  328. package/test/unit/spec/fixture/locus.js +1 -0
  329. package/test/unit/spec/interpretation/collection.ts +15 -0
  330. package/test/unit/spec/interpretation/index.ts +589 -0
  331. package/test/unit/spec/interpretation/siLanguage.ts +28 -0
  332. package/test/unit/spec/locus-info/controlsUtils.js +316 -43
  333. package/test/unit/spec/locus-info/index.js +1304 -33
  334. package/test/unit/spec/locus-info/infoUtils.js +37 -15
  335. package/test/unit/spec/locus-info/lib/SeqCmp.json +16 -0
  336. package/test/unit/spec/locus-info/mediaSharesUtils.ts +32 -0
  337. package/test/unit/spec/locus-info/parser.js +116 -35
  338. package/test/unit/spec/locus-info/selfConstant.js +27 -4
  339. package/test/unit/spec/locus-info/selfUtils.js +208 -17
  340. package/test/unit/spec/media/index.ts +120 -37
  341. package/test/unit/spec/media/properties.ts +2 -2
  342. package/test/unit/spec/meeting/in-meeting-actions.ts +85 -3
  343. package/test/unit/spec/meeting/index.js +5849 -2014
  344. package/test/unit/spec/meeting/locusMediaRequest.ts +442 -0
  345. package/test/unit/spec/meeting/muteState.js +402 -213
  346. package/test/unit/spec/meeting/request.js +483 -49
  347. package/test/unit/spec/meeting/utils.js +679 -64
  348. package/test/unit/spec/meeting-info/index.js +300 -0
  349. package/test/unit/spec/meeting-info/meetinginfov2.js +526 -5
  350. package/test/unit/spec/meeting-info/utilv2.js +21 -0
  351. package/test/unit/spec/meetings/collection.js +26 -0
  352. package/test/unit/spec/meetings/index.js +1231 -212
  353. package/test/unit/spec/meetings/utils.js +202 -2
  354. package/test/unit/spec/member/index.js +61 -6
  355. package/test/unit/spec/member/util.js +510 -34
  356. package/test/unit/spec/members/index.js +432 -1
  357. package/test/unit/spec/members/request.js +206 -27
  358. package/test/unit/spec/members/utils.js +210 -0
  359. package/test/unit/spec/metrics/index.js +1 -50
  360. package/test/unit/spec/multistream/mediaRequestManager.ts +776 -162
  361. package/test/unit/spec/multistream/receiveSlot.ts +28 -20
  362. package/test/unit/spec/multistream/receiveSlotManager.ts +32 -30
  363. package/test/unit/spec/multistream/remoteMedia.ts +30 -0
  364. package/test/unit/spec/multistream/remoteMediaGroup.ts +266 -0
  365. package/test/unit/spec/multistream/remoteMediaManager.ts +326 -0
  366. package/test/unit/spec/multistream/sendSlotManager.ts +242 -0
  367. package/test/unit/spec/reachability/clusterReachability.ts +279 -0
  368. package/test/unit/spec/reachability/index.ts +486 -13
  369. package/test/unit/spec/reachability/request.js +68 -0
  370. package/test/unit/spec/reachability/util.ts +40 -0
  371. package/test/unit/spec/reconnection-manager/index.js +117 -11
  372. package/test/unit/spec/recording-controller/index.js +294 -218
  373. package/test/unit/spec/recording-controller/util.js +223 -96
  374. package/test/unit/spec/roap/index.ts +174 -63
  375. package/test/unit/spec/roap/request.ts +226 -85
  376. package/test/unit/spec/roap/turnDiscovery.ts +76 -34
  377. package/test/unit/spec/rtcMetrics/index.ts +93 -0
  378. package/test/unit/spec/stats-analyzer/index.js +231 -7
  379. package/test/unit/spec/webinar/collection.ts +13 -0
  380. package/test/unit/spec/webinar/index.ts +60 -0
  381. package/test/utils/integrationTestUtils.js +46 -0
  382. package/test/utils/testUtils.js +0 -52
  383. package/dist/meeting/effectsState.js +0 -262
  384. package/dist/meeting/effectsState.js.map +0 -1
  385. package/dist/metrics/config.js +0 -289
  386. package/dist/metrics/config.js.map +0 -1
  387. package/dist/types/meeting/effectsState.d.ts +0 -42
  388. package/dist/types/metrics/config.d.ts +0 -169
  389. package/src/index.js +0 -16
  390. package/src/meeting/effectsState.ts +0 -211
  391. package/src/metrics/config.ts +0 -485
  392. package/test/unit/spec/meeting/effectsState.js +0 -285
@@ -0,0 +1,356 @@
1
+ "use strict";
2
+
3
+ var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
4
+ var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
5
+ _Object$defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.ClusterReachability = void 0;
9
+ var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
10
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
11
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/toConsumableArray"));
12
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
13
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
14
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
15
+ var _common = require("@webex/common");
16
+ var _loggerProxy = _interopRequireDefault(require("../common/logs/logger-proxy"));
17
+ var _util = require("./util");
18
+ var _constants = require("../constants");
19
+ var DEFAULT_TIMEOUT = 3000;
20
+ var VIDEO_MESH_TIMEOUT = 1000;
21
+
22
+ // result for a specific transport protocol (like udp or tcp)
23
+ /**
24
+ * A class that handles reachability checks for a single cluster.
25
+ */
26
+ var ClusterReachability = /*#__PURE__*/function () {
27
+ // this defer is resolved once reachability checks for this cluster are completed
28
+
29
+ /**
30
+ * Constructor for ClusterReachability
31
+ * @param {string} name cluster name
32
+ * @param {ClusterNode} clusterInfo information about the media cluster
33
+ */
34
+ function ClusterReachability(name, clusterInfo) {
35
+ (0, _classCallCheck2.default)(this, ClusterReachability);
36
+ (0, _defineProperty2.default)(this, "numUdpUrls", void 0);
37
+ (0, _defineProperty2.default)(this, "numTcpUrls", void 0);
38
+ (0, _defineProperty2.default)(this, "result", void 0);
39
+ (0, _defineProperty2.default)(this, "pc", void 0);
40
+ (0, _defineProperty2.default)(this, "defer", void 0);
41
+ (0, _defineProperty2.default)(this, "startTimestamp", void 0);
42
+ (0, _defineProperty2.default)(this, "isVideoMesh", void 0);
43
+ (0, _defineProperty2.default)(this, "name", void 0);
44
+ this.name = name;
45
+ this.isVideoMesh = clusterInfo.isVideoMesh;
46
+ this.numUdpUrls = clusterInfo.udp.length;
47
+ this.numTcpUrls = clusterInfo.tcp.length;
48
+ this.pc = this.createPeerConnection(clusterInfo);
49
+ this.defer = new _common.Defer();
50
+ this.result = {
51
+ udp: {
52
+ result: 'untested'
53
+ },
54
+ tcp: {
55
+ result: 'untested'
56
+ },
57
+ xtls: {
58
+ result: 'untested'
59
+ }
60
+ };
61
+ }
62
+
63
+ /**
64
+ * Gets total elapsed time, can be called only after start() is called
65
+ * @returns {Number} Milliseconds
66
+ */
67
+ (0, _createClass2.default)(ClusterReachability, [{
68
+ key: "getElapsedTime",
69
+ value: function getElapsedTime() {
70
+ return Math.round(performance.now() - this.startTimestamp);
71
+ }
72
+
73
+ /**
74
+ * Generate peerConnection config settings
75
+ * @param {ClusterNode} cluster
76
+ * @returns {RTCConfiguration} peerConnectionConfig
77
+ */
78
+ }, {
79
+ key: "buildPeerConnectionConfig",
80
+ value: function buildPeerConnectionConfig(cluster) {
81
+ var udpIceServers = cluster.udp.map(function (url) {
82
+ return {
83
+ username: '',
84
+ credential: '',
85
+ urls: [url]
86
+ };
87
+ });
88
+
89
+ // STUN servers are contacted only using UDP, so in order to test TCP reachability
90
+ // we pretend that Linus is a TURN server, because we can explicitly say "transport=tcp" in TURN urls.
91
+ // We then check for relay candidates to know if TURN-TCP worked (see registerIceCandidateListener()).
92
+ var tcpIceServers = cluster.tcp.map(function (urlString) {
93
+ return {
94
+ username: 'webexturnreachuser',
95
+ credential: 'webexturnreachpwd',
96
+ urls: [(0, _util.convertStunUrlToTurn)(urlString, 'tcp')]
97
+ };
98
+ });
99
+ return {
100
+ iceServers: [].concat((0, _toConsumableArray2.default)(udpIceServers), (0, _toConsumableArray2.default)(tcpIceServers)),
101
+ iceCandidatePoolSize: 0,
102
+ iceTransportPolicy: 'all'
103
+ };
104
+ }
105
+
106
+ /**
107
+ * Creates an RTCPeerConnection
108
+ * @param {ClusterNode} clusterInfo information about the media cluster
109
+ * @returns {RTCPeerConnection} peerConnection
110
+ */
111
+ }, {
112
+ key: "createPeerConnection",
113
+ value: function createPeerConnection(clusterInfo) {
114
+ try {
115
+ var config = this.buildPeerConnectionConfig(clusterInfo);
116
+ var peerConnection = new RTCPeerConnection(config);
117
+ return peerConnection;
118
+ } catch (peerConnectionError) {
119
+ _loggerProxy.default.logger.warn("Reachability:index#createPeerConnection --> Error creating peerConnection:", peerConnectionError);
120
+ return undefined;
121
+ }
122
+ }
123
+
124
+ /**
125
+ * @returns {ClusterReachabilityResult} reachability result for this cluster
126
+ */
127
+ }, {
128
+ key: "getResult",
129
+ value: function getResult() {
130
+ return this.result;
131
+ }
132
+
133
+ /**
134
+ * Closes the peerConnection
135
+ *
136
+ * @returns {void}
137
+ */
138
+ }, {
139
+ key: "closePeerConnection",
140
+ value: function closePeerConnection() {
141
+ if (this.pc) {
142
+ this.pc.onicecandidate = null;
143
+ this.pc.onicegatheringstatechange = null;
144
+ this.pc.close();
145
+ }
146
+ }
147
+
148
+ /**
149
+ * Resolves the defer, indicating that reachability checks for this cluster are completed
150
+ *
151
+ * @returns {void}
152
+ */
153
+ }, {
154
+ key: "finishReachabilityCheck",
155
+ value: function finishReachabilityCheck() {
156
+ this.defer.resolve();
157
+ }
158
+
159
+ /**
160
+ * Adds public IP (client media IPs)
161
+ * @param {string} protocol
162
+ * @param {string} publicIP
163
+ * @returns {void}
164
+ */
165
+ }, {
166
+ key: "addPublicIP",
167
+ value: function addPublicIP(protocol, publicIP) {
168
+ var result = this.result[protocol];
169
+ if (publicIP) {
170
+ if (result.clientMediaIPs) {
171
+ if (!result.clientMediaIPs.includes(publicIP)) {
172
+ result.clientMediaIPs.push(publicIP);
173
+ }
174
+ } else {
175
+ result.clientMediaIPs = [publicIP];
176
+ }
177
+ }
178
+ }
179
+
180
+ /**
181
+ * Registers a listener for the iceGatheringStateChange event
182
+ *
183
+ * @returns {void}
184
+ */
185
+ }, {
186
+ key: "registerIceGatheringStateChangeListener",
187
+ value: function registerIceGatheringStateChangeListener() {
188
+ var _this = this;
189
+ this.pc.onicegatheringstatechange = function () {
190
+ var COMPLETE = _constants.ICE_GATHERING_STATE.COMPLETE;
191
+ if (_this.pc.iceConnectionState === COMPLETE) {
192
+ _this.closePeerConnection();
193
+ _this.finishReachabilityCheck();
194
+ }
195
+ };
196
+ }
197
+
198
+ /**
199
+ * Checks if we have the results for all the protocols (UDP and TCP)
200
+ *
201
+ * @returns {boolean} true if we have all results, false otherwise
202
+ */
203
+ }, {
204
+ key: "haveWeGotAllResults",
205
+ value: function haveWeGotAllResults() {
206
+ var _this2 = this;
207
+ return ['udp', 'tcp'].every(function (protocol) {
208
+ return _this2.result[protocol].result === 'reachable' || _this2.result[protocol].result === 'untested';
209
+ });
210
+ }
211
+
212
+ /**
213
+ * Stores the latency in the result for the given protocol and marks it as reachable
214
+ *
215
+ * @param {string} protocol
216
+ * @param {number} latency
217
+ * @returns {void}
218
+ */
219
+ }, {
220
+ key: "storeLatencyResult",
221
+ value: function storeLatencyResult(protocol, latency) {
222
+ var result = this.result[protocol];
223
+ if (result.latencyInMilliseconds === undefined) {
224
+ _loggerProxy.default.logger.log( // @ts-ignore
225
+ "Reachability:index#storeLatencyResult --> Successfully reached ".concat(this.name, " over ").concat(protocol, ": ").concat(latency, "ms"));
226
+ result.latencyInMilliseconds = latency;
227
+ result.result = 'reachable';
228
+ }
229
+ }
230
+
231
+ /**
232
+ * Registers a listener for the icecandidate event
233
+ *
234
+ * @returns {void}
235
+ */
236
+ }, {
237
+ key: "registerIceCandidateListener",
238
+ value: function registerIceCandidateListener() {
239
+ var _this3 = this;
240
+ this.pc.onicecandidate = function (e) {
241
+ var CANDIDATE_TYPES = {
242
+ SERVER_REFLEXIVE: 'srflx',
243
+ RELAY: 'relay'
244
+ };
245
+ if (e.candidate) {
246
+ if (e.candidate.type === CANDIDATE_TYPES.SERVER_REFLEXIVE) {
247
+ _this3.storeLatencyResult('udp', _this3.getElapsedTime());
248
+ _this3.addPublicIP('udp', e.candidate.address);
249
+ }
250
+ if (e.candidate.type === CANDIDATE_TYPES.RELAY) {
251
+ _this3.storeLatencyResult('tcp', _this3.getElapsedTime());
252
+ // we don't add public IP for TCP, because in the case of relay candidates
253
+ // e.candidate.address is the TURN server address, not the client's public IP
254
+ }
255
+
256
+ if (_this3.haveWeGotAllResults()) {
257
+ _this3.closePeerConnection();
258
+ _this3.finishReachabilityCheck();
259
+ }
260
+ }
261
+ };
262
+ }
263
+
264
+ /**
265
+ * Starts the process of doing UDP and TCP reachability checks on the media cluster.
266
+ * XTLS reachability checking is not supported.
267
+ *
268
+ * @returns {Promise}
269
+ */
270
+ }, {
271
+ key: "start",
272
+ value: function () {
273
+ var _start = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
274
+ var offer;
275
+ return _regenerator.default.wrap(function _callee$(_context) {
276
+ while (1) switch (_context.prev = _context.next) {
277
+ case 0:
278
+ if (this.pc) {
279
+ _context.next = 3;
280
+ break;
281
+ }
282
+ _loggerProxy.default.logger.warn("Reachability:ClusterReachability#start --> Error: peerConnection is undefined");
283
+ return _context.abrupt("return", this.result);
284
+ case 3:
285
+ // Initialize this.result as saying that nothing is reachable.
286
+ // It will get updated as we go along and successfully gather ICE candidates.
287
+ this.result.udp = {
288
+ result: this.numUdpUrls > 0 ? 'unreachable' : 'untested'
289
+ };
290
+ this.result.tcp = {
291
+ result: this.numTcpUrls > 0 ? 'unreachable' : 'untested'
292
+ };
293
+ _context.prev = 5;
294
+ _context.next = 8;
295
+ return this.pc.createOffer({
296
+ offerToReceiveAudio: true
297
+ });
298
+ case 8:
299
+ offer = _context.sent;
300
+ this.startTimestamp = performance.now();
301
+
302
+ // not awaiting the next call on purpose, because we're not sending the offer anywhere and there won't be any answer
303
+ // we just need to make this call to trigger the ICE gathering process
304
+ this.pc.setLocalDescription(offer);
305
+ _context.next = 13;
306
+ return this.gatherIceCandidates();
307
+ case 13:
308
+ _context.next = 18;
309
+ break;
310
+ case 15:
311
+ _context.prev = 15;
312
+ _context.t0 = _context["catch"](5);
313
+ _loggerProxy.default.logger.warn("Reachability:ClusterReachability#start --> Error: ", _context.t0);
314
+ case 18:
315
+ return _context.abrupt("return", this.result);
316
+ case 19:
317
+ case "end":
318
+ return _context.stop();
319
+ }
320
+ }, _callee, this, [[5, 15]]);
321
+ }));
322
+ function start() {
323
+ return _start.apply(this, arguments);
324
+ }
325
+ return start;
326
+ }()
327
+ /**
328
+ * Starts the process of gathering ICE candidates
329
+ *
330
+ * @returns {Promise} promise that's resolved once reachability checks for this cluster are completed or timeout is reached
331
+ */
332
+ }, {
333
+ key: "gatherIceCandidates",
334
+ value: function gatherIceCandidates() {
335
+ var _this4 = this;
336
+ var timeout = this.isVideoMesh ? VIDEO_MESH_TIMEOUT : DEFAULT_TIMEOUT;
337
+ this.registerIceGatheringStateChangeListener();
338
+ this.registerIceCandidateListener();
339
+
340
+ // Set maximum timeout
341
+ setTimeout(function () {
342
+ var CLOSED = _constants.CONNECTION_STATE.CLOSED;
343
+
344
+ // Close any open peerConnections
345
+ if (_this4.pc.connectionState !== CLOSED) {
346
+ _this4.closePeerConnection();
347
+ _this4.finishReachabilityCheck();
348
+ }
349
+ }, timeout);
350
+ return this.defer.promise;
351
+ }
352
+ }]);
353
+ return ClusterReachability;
354
+ }();
355
+ exports.ClusterReachability = ClusterReachability;
356
+ //# sourceMappingURL=clusterReachability.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["DEFAULT_TIMEOUT","VIDEO_MESH_TIMEOUT","ClusterReachability","name","clusterInfo","isVideoMesh","numUdpUrls","udp","length","numTcpUrls","tcp","pc","createPeerConnection","defer","Defer","result","xtls","Math","round","performance","now","startTimestamp","cluster","udpIceServers","map","url","username","credential","urls","tcpIceServers","urlString","convertStunUrlToTurn","iceServers","iceCandidatePoolSize","iceTransportPolicy","config","buildPeerConnectionConfig","peerConnection","RTCPeerConnection","peerConnectionError","LoggerProxy","logger","warn","undefined","onicecandidate","onicegatheringstatechange","close","resolve","protocol","publicIP","clientMediaIPs","includes","push","COMPLETE","ICE_GATHERING_STATE","iceConnectionState","closePeerConnection","finishReachabilityCheck","every","latency","latencyInMilliseconds","log","e","CANDIDATE_TYPES","SERVER_REFLEXIVE","RELAY","candidate","type","storeLatencyResult","getElapsedTime","addPublicIP","address","haveWeGotAllResults","createOffer","offerToReceiveAudio","offer","setLocalDescription","gatherIceCandidates","timeout","registerIceGatheringStateChangeListener","registerIceCandidateListener","setTimeout","CLOSED","CONNECTION_STATE","connectionState","promise"],"sources":["clusterReachability.ts"],"sourcesContent":["import {Defer} from '@webex/common';\n\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport {ClusterNode} from './request';\nimport {convertStunUrlToTurn} from './util';\n\nimport {ICE_GATHERING_STATE, CONNECTION_STATE} from '../constants';\n\nconst DEFAULT_TIMEOUT = 3000;\nconst VIDEO_MESH_TIMEOUT = 1000;\n\n// result for a specific transport protocol (like udp or tcp)\nexport type TransportResult = {\n result: 'reachable' | 'unreachable' | 'untested';\n latencyInMilliseconds?: number; // amount of time it took to get the first ICE candidate\n clientMediaIPs?: string[];\n};\n\n// reachability result for a specific media cluster\nexport type ClusterReachabilityResult = {\n udp: TransportResult;\n tcp: TransportResult;\n xtls: TransportResult;\n};\n\n/**\n * A class that handles reachability checks for a single cluster.\n */\nexport class ClusterReachability {\n private numUdpUrls: number;\n private numTcpUrls: number;\n private result: ClusterReachabilityResult;\n private pc?: RTCPeerConnection;\n private defer: Defer; // this defer is resolved once reachability checks for this cluster are completed\n private startTimestamp: number;\n public readonly isVideoMesh: boolean;\n public readonly name;\n\n /**\n * Constructor for ClusterReachability\n * @param {string} name cluster name\n * @param {ClusterNode} clusterInfo information about the media cluster\n */\n constructor(name: string, clusterInfo: ClusterNode) {\n this.name = name;\n this.isVideoMesh = clusterInfo.isVideoMesh;\n this.numUdpUrls = clusterInfo.udp.length;\n this.numTcpUrls = clusterInfo.tcp.length;\n\n this.pc = this.createPeerConnection(clusterInfo);\n\n this.defer = new Defer();\n this.result = {\n udp: {\n result: 'untested',\n },\n tcp: {\n result: 'untested',\n },\n xtls: {\n result: 'untested',\n },\n };\n }\n\n /**\n * Gets total elapsed time, can be called only after start() is called\n * @returns {Number} Milliseconds\n */\n private getElapsedTime() {\n return Math.round(performance.now() - this.startTimestamp);\n }\n\n /**\n * Generate peerConnection config settings\n * @param {ClusterNode} cluster\n * @returns {RTCConfiguration} peerConnectionConfig\n */\n private buildPeerConnectionConfig(cluster: ClusterNode): RTCConfiguration {\n const udpIceServers = cluster.udp.map((url) => ({\n username: '',\n credential: '',\n urls: [url],\n }));\n\n // STUN servers are contacted only using UDP, so in order to test TCP reachability\n // we pretend that Linus is a TURN server, because we can explicitly say \"transport=tcp\" in TURN urls.\n // We then check for relay candidates to know if TURN-TCP worked (see registerIceCandidateListener()).\n const tcpIceServers = cluster.tcp.map((urlString: string) => {\n return {\n username: 'webexturnreachuser',\n credential: 'webexturnreachpwd',\n urls: [convertStunUrlToTurn(urlString, 'tcp')],\n };\n });\n\n return {\n iceServers: [...udpIceServers, ...tcpIceServers],\n iceCandidatePoolSize: 0,\n iceTransportPolicy: 'all',\n };\n }\n\n /**\n * Creates an RTCPeerConnection\n * @param {ClusterNode} clusterInfo information about the media cluster\n * @returns {RTCPeerConnection} peerConnection\n */\n private createPeerConnection(clusterInfo: ClusterNode) {\n try {\n const config = this.buildPeerConnectionConfig(clusterInfo);\n\n const peerConnection = new RTCPeerConnection(config);\n\n return peerConnection;\n } catch (peerConnectionError) {\n LoggerProxy.logger.warn(\n `Reachability:index#createPeerConnection --> Error creating peerConnection:`,\n peerConnectionError\n );\n\n return undefined;\n }\n }\n\n /**\n * @returns {ClusterReachabilityResult} reachability result for this cluster\n */\n getResult() {\n return this.result;\n }\n\n /**\n * Closes the peerConnection\n *\n * @returns {void}\n */\n private closePeerConnection() {\n if (this.pc) {\n this.pc.onicecandidate = null;\n this.pc.onicegatheringstatechange = null;\n this.pc.close();\n }\n }\n\n /**\n * Resolves the defer, indicating that reachability checks for this cluster are completed\n *\n * @returns {void}\n */\n private finishReachabilityCheck() {\n this.defer.resolve();\n }\n\n /**\n * Adds public IP (client media IPs)\n * @param {string} protocol\n * @param {string} publicIP\n * @returns {void}\n */\n private addPublicIP(protocol: 'udp' | 'tcp', publicIP?: string | null) {\n const result = this.result[protocol];\n\n if (publicIP) {\n if (result.clientMediaIPs) {\n if (!result.clientMediaIPs.includes(publicIP)) {\n result.clientMediaIPs.push(publicIP);\n }\n } else {\n result.clientMediaIPs = [publicIP];\n }\n }\n }\n\n /**\n * Registers a listener for the iceGatheringStateChange event\n *\n * @returns {void}\n */\n private registerIceGatheringStateChangeListener() {\n this.pc.onicegatheringstatechange = () => {\n const {COMPLETE} = ICE_GATHERING_STATE;\n\n if (this.pc.iceConnectionState === COMPLETE) {\n this.closePeerConnection();\n this.finishReachabilityCheck();\n }\n };\n }\n\n /**\n * Checks if we have the results for all the protocols (UDP and TCP)\n *\n * @returns {boolean} true if we have all results, false otherwise\n */\n private haveWeGotAllResults(): boolean {\n return ['udp', 'tcp'].every(\n (protocol) =>\n this.result[protocol].result === 'reachable' || this.result[protocol].result === 'untested'\n );\n }\n\n /**\n * Stores the latency in the result for the given protocol and marks it as reachable\n *\n * @param {string} protocol\n * @param {number} latency\n * @returns {void}\n */\n private storeLatencyResult(protocol: 'udp' | 'tcp', latency: number) {\n const result = this.result[protocol];\n\n if (result.latencyInMilliseconds === undefined) {\n LoggerProxy.logger.log(\n // @ts-ignore\n `Reachability:index#storeLatencyResult --> Successfully reached ${this.name} over ${protocol}: ${latency}ms`\n );\n result.latencyInMilliseconds = latency;\n result.result = 'reachable';\n }\n }\n\n /**\n * Registers a listener for the icecandidate event\n *\n * @returns {void}\n */\n private registerIceCandidateListener() {\n this.pc.onicecandidate = (e) => {\n const CANDIDATE_TYPES = {\n SERVER_REFLEXIVE: 'srflx',\n RELAY: 'relay',\n };\n\n if (e.candidate) {\n if (e.candidate.type === CANDIDATE_TYPES.SERVER_REFLEXIVE) {\n this.storeLatencyResult('udp', this.getElapsedTime());\n this.addPublicIP('udp', e.candidate.address);\n }\n\n if (e.candidate.type === CANDIDATE_TYPES.RELAY) {\n this.storeLatencyResult('tcp', this.getElapsedTime());\n // we don't add public IP for TCP, because in the case of relay candidates\n // e.candidate.address is the TURN server address, not the client's public IP\n }\n\n if (this.haveWeGotAllResults()) {\n this.closePeerConnection();\n this.finishReachabilityCheck();\n }\n }\n };\n }\n\n /**\n * Starts the process of doing UDP and TCP reachability checks on the media cluster.\n * XTLS reachability checking is not supported.\n *\n * @returns {Promise}\n */\n async start(): Promise<ClusterReachabilityResult> {\n if (!this.pc) {\n LoggerProxy.logger.warn(\n `Reachability:ClusterReachability#start --> Error: peerConnection is undefined`\n );\n\n return this.result;\n }\n\n // Initialize this.result as saying that nothing is reachable.\n // It will get updated as we go along and successfully gather ICE candidates.\n this.result.udp = {\n result: this.numUdpUrls > 0 ? 'unreachable' : 'untested',\n };\n this.result.tcp = {\n result: this.numTcpUrls > 0 ? 'unreachable' : 'untested',\n };\n\n try {\n const offer = await this.pc.createOffer({offerToReceiveAudio: true});\n\n this.startTimestamp = performance.now();\n\n // not awaiting the next call on purpose, because we're not sending the offer anywhere and there won't be any answer\n // we just need to make this call to trigger the ICE gathering process\n this.pc.setLocalDescription(offer);\n\n await this.gatherIceCandidates();\n } catch (error) {\n LoggerProxy.logger.warn(`Reachability:ClusterReachability#start --> Error: `, error);\n }\n\n return this.result;\n }\n\n /**\n * Starts the process of gathering ICE candidates\n *\n * @returns {Promise} promise that's resolved once reachability checks for this cluster are completed or timeout is reached\n */\n private gatherIceCandidates() {\n const timeout = this.isVideoMesh ? VIDEO_MESH_TIMEOUT : DEFAULT_TIMEOUT;\n\n this.registerIceGatheringStateChangeListener();\n this.registerIceCandidateListener();\n\n // Set maximum timeout\n setTimeout(() => {\n const {CLOSED} = CONNECTION_STATE;\n\n // Close any open peerConnections\n if (this.pc.connectionState !== CLOSED) {\n this.closePeerConnection();\n this.finishReachabilityCheck();\n }\n }, timeout);\n\n return this.defer.promise;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAEA;AAEA;AAEA;AAEA,IAAMA,eAAe,GAAG,IAAI;AAC5B,IAAMC,kBAAkB,GAAG,IAAI;;AAE/B;AAcA;AACA;AACA;AAFA,IAGaC,mBAAmB;EAKR;;EAKtB;AACF;AACA;AACA;AACA;EACE,6BAAYC,IAAY,EAAEC,WAAwB,EAAE;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAClD,IAAI,CAACD,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACE,WAAW,GAAGD,WAAW,CAACC,WAAW;IAC1C,IAAI,CAACC,UAAU,GAAGF,WAAW,CAACG,GAAG,CAACC,MAAM;IACxC,IAAI,CAACC,UAAU,GAAGL,WAAW,CAACM,GAAG,CAACF,MAAM;IAExC,IAAI,CAACG,EAAE,GAAG,IAAI,CAACC,oBAAoB,CAACR,WAAW,CAAC;IAEhD,IAAI,CAACS,KAAK,GAAG,IAAIC,aAAK,EAAE;IACxB,IAAI,CAACC,MAAM,GAAG;MACZR,GAAG,EAAE;QACHQ,MAAM,EAAE;MACV,CAAC;MACDL,GAAG,EAAE;QACHK,MAAM,EAAE;MACV,CAAC;MACDC,IAAI,EAAE;QACJD,MAAM,EAAE;MACV;IACF,CAAC;EACH;;EAEA;AACF;AACA;AACA;EAHE;IAAA;IAAA,OAIA,0BAAyB;MACvB,OAAOE,IAAI,CAACC,KAAK,CAACC,WAAW,CAACC,GAAG,EAAE,GAAG,IAAI,CAACC,cAAc,CAAC;IAC5D;;IAEA;AACF;AACA;AACA;AACA;EAJE;IAAA;IAAA,OAKA,mCAAkCC,OAAoB,EAAoB;MACxE,IAAMC,aAAa,GAAGD,OAAO,CAACf,GAAG,CAACiB,GAAG,CAAC,UAACC,GAAG;QAAA,OAAM;UAC9CC,QAAQ,EAA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