@webex/plugin-meetings 3.8.0-web-workers-keepalive.1 → 3.8.1-next.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 (168) hide show
  1. package/dist/breakouts/breakout.js +1 -1
  2. package/dist/breakouts/index.js +70 -6
  3. package/dist/breakouts/index.js.map +1 -1
  4. package/dist/common/errors/webex-errors.js +12 -2
  5. package/dist/common/errors/webex-errors.js.map +1 -1
  6. package/dist/config.js +4 -1
  7. package/dist/config.js.map +1 -1
  8. package/dist/constants.js +22 -123
  9. package/dist/constants.js.map +1 -1
  10. package/dist/controls-options-manager/enums.js +2 -0
  11. package/dist/controls-options-manager/enums.js.map +1 -1
  12. package/dist/controls-options-manager/types.js.map +1 -1
  13. package/dist/controls-options-manager/util.js +52 -0
  14. package/dist/controls-options-manager/util.js.map +1 -1
  15. package/dist/interpretation/index.js +1 -1
  16. package/dist/interpretation/siLanguage.js +1 -1
  17. package/dist/locus-info/controlsUtils.js +30 -10
  18. package/dist/locus-info/controlsUtils.js.map +1 -1
  19. package/dist/locus-info/index.js +83 -12
  20. package/dist/locus-info/index.js.map +1 -1
  21. package/dist/locus-info/selfUtils.js +432 -418
  22. package/dist/locus-info/selfUtils.js.map +1 -1
  23. package/dist/media/index.js +17 -17
  24. package/dist/media/index.js.map +1 -1
  25. package/dist/media/properties.js +94 -6
  26. package/dist/media/properties.js.map +1 -1
  27. package/dist/meeting/brbState.js +9 -2
  28. package/dist/meeting/brbState.js.map +1 -1
  29. package/dist/meeting/in-meeting-actions.js +17 -1
  30. package/dist/meeting/in-meeting-actions.js.map +1 -1
  31. package/dist/meeting/index.js +568 -328
  32. package/dist/meeting/index.js.map +1 -1
  33. package/dist/meeting/locusMediaRequest.js +0 -17
  34. package/dist/meeting/locusMediaRequest.js.map +1 -1
  35. package/dist/meeting/muteState.js +4 -4
  36. package/dist/meeting/muteState.js.map +1 -1
  37. package/dist/meeting/request.js +30 -0
  38. package/dist/meeting/request.js.map +1 -1
  39. package/dist/meeting/request.type.js.map +1 -1
  40. package/dist/meeting/util.js +9 -1
  41. package/dist/meeting/util.js.map +1 -1
  42. package/dist/meeting-info/meeting-info-v2.js +19 -13
  43. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  44. package/dist/meeting-info/utilv2.js +5 -1
  45. package/dist/meeting-info/utilv2.js.map +1 -1
  46. package/dist/meetings/index.js +76 -0
  47. package/dist/meetings/index.js.map +1 -1
  48. package/dist/meetings/util.js +14 -0
  49. package/dist/meetings/util.js.map +1 -1
  50. package/dist/member/index.js +45 -9
  51. package/dist/member/index.js.map +1 -1
  52. package/dist/member/types.js +3 -0
  53. package/dist/member/types.js.map +1 -1
  54. package/dist/member/util.js +335 -356
  55. package/dist/member/util.js.map +1 -1
  56. package/dist/members/collection.js.map +1 -1
  57. package/dist/members/index.js +137 -29
  58. package/dist/members/index.js.map +1 -1
  59. package/dist/members/request.js +38 -0
  60. package/dist/members/request.js.map +1 -1
  61. package/dist/members/util.js +36 -1
  62. package/dist/members/util.js.map +1 -1
  63. package/dist/metrics/constants.js +1 -0
  64. package/dist/metrics/constants.js.map +1 -1
  65. package/dist/reachability/clusterReachability.js +23 -31
  66. package/dist/reachability/clusterReachability.js.map +1 -1
  67. package/dist/reachability/index.js +42 -2
  68. package/dist/reachability/index.js.map +1 -1
  69. package/dist/reconnection-manager/index.js +2 -2
  70. package/dist/reconnection-manager/index.js.map +1 -1
  71. package/dist/roap/index.js.map +1 -1
  72. package/dist/roap/turnDiscovery.js +45 -27
  73. package/dist/roap/turnDiscovery.js.map +1 -1
  74. package/dist/roap/types.js +17 -0
  75. package/dist/roap/types.js.map +1 -0
  76. package/dist/types/common/errors/webex-errors.d.ts +7 -1
  77. package/dist/types/config.d.ts +2 -0
  78. package/dist/types/constants.d.ts +15 -85
  79. package/dist/types/controls-options-manager/enums.d.ts +3 -1
  80. package/dist/types/controls-options-manager/types.d.ts +7 -1
  81. package/dist/types/locus-info/index.d.ts +3 -3
  82. package/dist/types/locus-info/selfUtils.d.ts +216 -1
  83. package/dist/types/media/properties.d.ts +15 -0
  84. package/dist/types/meeting/in-meeting-actions.d.ts +16 -0
  85. package/dist/types/meeting/index.d.ts +35 -1
  86. package/dist/types/meeting/muteState.d.ts +0 -1
  87. package/dist/types/meeting/request.d.ts +12 -1
  88. package/dist/types/meeting/request.type.d.ts +6 -0
  89. package/dist/types/meeting/util.d.ts +3 -1
  90. package/dist/types/meeting-info/meeting-info-v2.d.ts +2 -1
  91. package/dist/types/meetings/index.d.ts +28 -0
  92. package/dist/types/member/index.d.ts +20 -6
  93. package/dist/types/member/types.d.ts +73 -14
  94. package/dist/types/member/util.d.ts +156 -1
  95. package/dist/types/members/collection.d.ts +6 -5
  96. package/dist/types/members/index.d.ts +32 -43
  97. package/dist/types/members/request.d.ts +26 -0
  98. package/dist/types/members/util.d.ts +27 -0
  99. package/dist/types/metrics/constants.d.ts +1 -0
  100. package/dist/types/reachability/clusterReachability.d.ts +2 -6
  101. package/dist/types/reachability/index.d.ts +8 -0
  102. package/dist/types/roap/index.d.ts +3 -2
  103. package/dist/types/roap/turnDiscovery.d.ts +5 -17
  104. package/dist/types/roap/types.d.ts +16 -0
  105. package/dist/webinar/index.js +1 -1
  106. package/package.json +24 -23
  107. package/src/breakouts/index.ts +69 -0
  108. package/src/common/errors/webex-errors.ts +8 -1
  109. package/src/config.ts +2 -0
  110. package/src/constants.ts +23 -90
  111. package/src/controls-options-manager/enums.ts +2 -0
  112. package/src/controls-options-manager/types.ts +11 -1
  113. package/src/controls-options-manager/util.ts +62 -0
  114. package/src/locus-info/controlsUtils.ts +48 -12
  115. package/src/locus-info/index.ts +88 -13
  116. package/src/locus-info/selfUtils.ts +496 -442
  117. package/src/media/index.ts +23 -21
  118. package/src/media/properties.ts +96 -0
  119. package/src/meeting/brbState.ts +11 -2
  120. package/src/meeting/in-meeting-actions.ts +32 -0
  121. package/src/meeting/index.ts +356 -87
  122. package/src/meeting/locusMediaRequest.ts +0 -18
  123. package/src/meeting/muteState.ts +4 -4
  124. package/src/meeting/request.ts +36 -1
  125. package/src/meeting/request.type.ts +7 -0
  126. package/src/meeting/util.ts +9 -1
  127. package/src/meeting-info/meeting-info-v2.ts +7 -2
  128. package/src/meeting-info/utilv2.ts +5 -0
  129. package/src/meetings/index.ts +76 -0
  130. package/src/meetings/util.ts +18 -0
  131. package/src/member/index.ts +57 -22
  132. package/src/member/types.ts +82 -16
  133. package/src/member/util.ts +357 -353
  134. package/src/members/collection.ts +4 -3
  135. package/src/members/index.ts +137 -18
  136. package/src/members/request.ts +44 -0
  137. package/src/members/util.ts +43 -1
  138. package/src/metrics/constants.ts +1 -0
  139. package/src/reachability/clusterReachability.ts +26 -25
  140. package/src/reachability/index.ts +55 -1
  141. package/src/reconnection-manager/index.ts +2 -2
  142. package/src/roap/index.ts +3 -7
  143. package/src/roap/turnDiscovery.ts +34 -39
  144. package/src/roap/types.ts +23 -0
  145. package/test/unit/spec/breakouts/index.ts +167 -95
  146. package/test/unit/spec/controls-options-manager/util.js +120 -0
  147. package/test/unit/spec/locus-info/controlsUtils.js +131 -9
  148. package/test/unit/spec/locus-info/index.js +195 -73
  149. package/test/unit/spec/locus-info/selfUtils.js +98 -24
  150. package/test/unit/spec/media/index.ts +150 -18
  151. package/test/unit/spec/media/properties.ts +130 -0
  152. package/test/unit/spec/meeting/brbState.ts +40 -2
  153. package/test/unit/spec/meeting/in-meeting-actions.ts +19 -4
  154. package/test/unit/spec/meeting/index.js +553 -36
  155. package/test/unit/spec/meeting/locusMediaRequest.ts +0 -30
  156. package/test/unit/spec/meeting/muteState.js +73 -2
  157. package/test/unit/spec/meeting/request.js +32 -1
  158. package/test/unit/spec/meeting/utils.js +79 -33
  159. package/test/unit/spec/meeting-info/meetinginfov2.js +41 -0
  160. package/test/unit/spec/meeting-info/utilv2.js +19 -0
  161. package/test/unit/spec/meetings/index.js +68 -1
  162. package/test/unit/spec/members/index.js +304 -78
  163. package/test/unit/spec/members/request.js +68 -22
  164. package/test/unit/spec/members/utils.js +75 -0
  165. package/test/unit/spec/reachability/clusterReachability.ts +41 -55
  166. package/test/unit/spec/reachability/index.ts +89 -0
  167. package/test/unit/spec/reconnection-manager/index.js +4 -4
  168. package/test/unit/spec/roap/turnDiscovery.ts +110 -28
@@ -9,370 +9,349 @@ exports.default = void 0;
9
9
  var _types = require("./types");
10
10
  var _constants = require("../constants");
11
11
  var _parameter = _interopRequireDefault(require("../common/errors/parameter"));
12
- var MemberUtil = {};
13
-
14
- /**
15
- * @param {Object} participant - The locus participant object.
16
- * @returns {Boolean}
17
- */
18
- MemberUtil.canReclaimHost = function (participant) {
19
- if (!participant) {
20
- throw new _parameter.default('canReclaimHostRole could not be processed, participant is undefined.');
21
- }
22
- return participant.canReclaimHostRole || false;
23
- };
24
-
25
- /**
26
- * @param {Object} participant - The locus participant object.
27
- * @returns {[ServerRoleShape]}
28
- */
29
- MemberUtil.getControlsRoles = function (participant) {
30
- var _participant$controls, _participant$controls2;
31
- return participant === null || participant === void 0 ? void 0 : (_participant$controls = participant.controls) === null || _participant$controls === void 0 ? void 0 : (_participant$controls2 = _participant$controls.role) === null || _participant$controls2 === void 0 ? void 0 : _participant$controls2.roles;
32
- };
33
-
34
- /**
35
- * Checks if the participant has the brb status enabled.
36
- *
37
- * @param {ParticipantWithBrb} participant - The locus participant object.
38
- * @returns {boolean} - True if the participant has brb enabled, false otherwise.
39
- */
40
- MemberUtil.isBrb = function (participant) {
41
- var _participant$controls3, _participant$controls4;
42
- return ((_participant$controls3 = participant.controls) === null || _participant$controls3 === void 0 ? void 0 : (_participant$controls4 = _participant$controls3.brb) === null || _participant$controls4 === void 0 ? void 0 : _participant$controls4.enabled) || false;
43
- };
44
-
45
- /**
46
- * @param {Object} participant - The locus participant object.
47
- * @param {ServerRoles} controlRole the search role
48
- * @returns {Boolean}
49
- */
50
- MemberUtil.hasRole = function (participant, controlRole) {
51
- var _MemberUtil$getContro;
52
- return (_MemberUtil$getContro = MemberUtil.getControlsRoles(participant)) === null || _MemberUtil$getContro === void 0 ? void 0 : _MemberUtil$getContro.some(function (role) {
53
- return role.type === controlRole && role.hasRole;
54
- });
55
- };
56
-
57
- /**
58
- * @param {Object} participant - The locus participant object.
59
- * @returns {Boolean}
60
- */
61
- MemberUtil.hasCohost = function (participant) {
62
- return MemberUtil.hasRole(participant, _types.ServerRoles.Cohost) || false;
63
- };
64
-
65
- /**
66
- * @param {Object} participant - The locus participant object.
67
- * @returns {Boolean}
68
- */
69
- MemberUtil.hasModerator = function (participant) {
70
- return MemberUtil.hasRole(participant, _types.ServerRoles.Moderator) || false;
71
- };
72
-
73
- /**
74
- * @param {Object} participant - The locus participant object.
75
- * @returns {Boolean}
76
- */
77
- MemberUtil.hasPresenter = function (participant) {
78
- return MemberUtil.hasRole(participant, _types.ServerRoles.Presenter) || false;
79
- };
80
-
81
- /**
82
- * @param {Object} participant - The locus participant object.
83
- * @returns {IExternalRoles}
84
- */
85
- MemberUtil.extractControlRoles = function (participant) {
86
- var roles = {
87
- cohost: MemberUtil.hasCohost(participant),
88
- moderator: MemberUtil.hasModerator(participant),
89
- presenter: MemberUtil.hasPresenter(participant)
90
- };
91
- return roles;
92
- };
93
-
94
- /**
95
- * @param {Object} participant - The locus participant object.
96
- * @returns {Boolean}
97
- */
98
- MemberUtil.isUser = function (participant) {
99
- return participant && participant.type === _constants._USER_;
100
- };
101
- MemberUtil.isModerator = function (participant) {
102
- return participant && participant.moderator;
103
- };
104
-
105
- /**
106
- * @param {Object} participant - The locus participant object.
107
- * @returns {Boolean}
108
- */
109
- MemberUtil.isGuest = function (participant) {
110
- return participant && participant.guest;
111
- };
112
-
113
- /**
114
- * @param {Object} participant - The locus participant object.
115
- * @returns {Boolean}
116
- */
117
- MemberUtil.isDevice = function (participant) {
118
- return participant && participant.type === _constants._RESOURCE_ROOM_;
119
- };
120
- MemberUtil.isModeratorAssignmentProhibited = function (participant) {
121
- return participant && participant.moderatorAssignmentNotAllowed;
122
- };
123
- MemberUtil.isPresenterAssignmentProhibited = function (participant) {
124
- return participant && participant.presenterAssignmentNotAllowed;
125
- };
126
-
127
- /**
128
- * checks to see if the participant id is the same as the passed id
129
- * there are multiple ids that can be used
130
- * @param {Object} participant - The locus participant object.
131
- * @param {String} id
132
- * @returns {Boolean}
133
- */
134
- MemberUtil.isSame = function (participant, id) {
135
- return participant && (participant.id === id || participant.person && participant.person.id === id);
136
- };
137
-
138
- /**
139
- * checks to see if the participant id is the same as the passed id for associated devices
140
- * there are multiple ids that can be used
141
- * @param {Object} participant - The locus participant object.
142
- * @param {String} id
143
- * @returns {Boolean}
144
- */
145
- MemberUtil.isAssociatedSame = function (participant, id) {
146
- return participant && participant.associatedUsers && participant.associatedUsers.some(function (user) {
147
- return user.id === id || user.person && user.person.id === id;
148
- });
149
- };
150
-
151
- /**
152
- * @param {Object} participant - The locus participant object.
153
- * @param {Boolean} isGuest
154
- * @param {String} status
155
- * @returns {Boolean}
156
- */
157
- MemberUtil.isNotAdmitted = function (participant, isGuest, status) {
158
- return participant && participant.guest && (participant.devices && participant.devices[0] && participant.devices[0].intent && participant.devices[0].intent.type === _constants._WAIT_ &&
159
- // @ts-ignore
160
- isGuest && status === _constants._IN_LOBBY_ ||
161
- // @ts-ignore
162
- !status === _constants._IN_MEETING_);
163
- };
164
-
165
- /**
166
- * @param {Object} participant - The locus participant object.
167
- * @returns {Boolean}
168
- */
169
- MemberUtil.isAudioMuted = function (participant) {
170
- if (!participant) {
171
- throw new _parameter.default('Audio could not be processed, participant is undefined.');
172
- }
173
- return MemberUtil.isMuted(participant, _constants.AUDIO_STATUS, _constants.AUDIO);
174
- };
175
-
176
- /**
177
- * @param {Object} participant - The locus participant object.
178
- * @returns {Boolean}
179
- */
180
- MemberUtil.isVideoMuted = function (participant) {
181
- if (!participant) {
182
- throw new _parameter.default('Video could not be processed, participant is undefined.');
183
- }
184
- return MemberUtil.isMuted(participant, _constants.VIDEO_STATUS, _constants.VIDEO);
185
- };
186
-
187
- /**
188
- * @param {Object} participant - The locus participant object.
189
- * @returns {Boolean}
190
- */
191
- MemberUtil.isHandRaised = function (participant) {
192
- var _participant$controls5, _participant$controls6;
193
- if (!participant) {
194
- throw new _parameter.default('Raise hand could not be processed, participant is undefined.');
195
- }
196
- return ((_participant$controls5 = participant.controls) === null || _participant$controls5 === void 0 ? void 0 : (_participant$controls6 = _participant$controls5.hand) === null || _participant$controls6 === void 0 ? void 0 : _participant$controls6.raised) || false;
197
- };
198
-
199
- /**
200
- * @param {Object} participant - The locus participant object.
201
- * @returns {Boolean}
202
- */
203
- MemberUtil.isBreakoutsSupported = function (participant) {
204
- if (!participant) {
205
- throw new _parameter.default('Breakout support could not be processed, participant is undefined.');
206
- }
207
- return !participant.doesNotSupportBreakouts;
208
- };
209
-
210
- /**
211
- * @param {Object} participant - The locus participant object.
212
- * @returns {Boolean}
213
- */
214
- MemberUtil.isInterpretationSupported = function (participant) {
215
- if (!participant) {
216
- throw new _parameter.default('Interpretation support could not be processed, participant is undefined.');
217
- }
218
- return !participant.doesNotSupportSiInterpreter;
219
- };
220
-
221
- /**
222
- * @param {Object} participant - The locus participant object.
223
- * @returns {Boolean}
224
- */
225
- MemberUtil.isLiveAnnotationSupported = function (participant) {
226
- if (!participant) {
227
- throw new _parameter.default('LiveAnnotation support could not be processed, participant is undefined.');
228
- }
229
- return !participant.annotatorAssignmentNotAllowed;
230
- };
231
-
232
- /**
233
- * utility method for audio/video muted status
234
- * @param {any} participant
235
- * @param {String} statusAccessor
236
- * @param {String} controlsAccessor
237
- * @returns {Boolean | undefined}
238
- */
239
- MemberUtil.isMuted = function (participant, statusAccessor, controlsAccessor) {
240
- var _participant$controls7, _participant$controls8, _participant$status;
241
- // check remote mute
242
- var remoteMute = participant === null || participant === void 0 ? void 0 : (_participant$controls7 = participant.controls) === null || _participant$controls7 === void 0 ? void 0 : (_participant$controls8 = _participant$controls7[controlsAccessor]) === null || _participant$controls8 === void 0 ? void 0 : _participant$controls8.muted;
243
- if (remoteMute === true) {
244
- return true;
245
- }
246
-
247
- // check local mute
248
- var localStatus = participant === null || participant === void 0 ? void 0 : (_participant$status = participant.status) === null || _participant$status === void 0 ? void 0 : _participant$status[statusAccessor];
249
- if (localStatus === _constants._RECEIVE_ONLY_) {
250
- return true;
251
- }
252
- if (localStatus === _constants._SEND_RECEIVE_) {
253
- return false;
254
- }
255
- return remoteMute;
256
- };
12
+ var MemberUtil = {
13
+ /**
14
+ * @param {Object} participant - The locus participant object.
15
+ * @returns {Boolean}
16
+ */
17
+ canReclaimHost: function canReclaimHost(participant) {
18
+ if (!participant) {
19
+ throw new _parameter.default('canReclaimHostRole could not be processed, participant is undefined.');
20
+ }
21
+ return participant.canReclaimHostRole || false;
22
+ },
23
+ /**
24
+ * @param {Object} participant - The locus participant object.
25
+ * @returns {[ServerRoleShape]}
26
+ */
27
+ getControlsRoles: function getControlsRoles(participant) {
28
+ var _participant$controls, _participant$controls2;
29
+ return participant === null || participant === void 0 ? void 0 : (_participant$controls = participant.controls) === null || _participant$controls === void 0 ? void 0 : (_participant$controls2 = _participant$controls.role) === null || _participant$controls2 === void 0 ? void 0 : _participant$controls2.roles;
30
+ },
31
+ /**
32
+ * Checks if the participant has the brb status enabled.
33
+ *
34
+ * @param {Participant} participant - The locus participant object.
35
+ * @returns {boolean} - True if the participant has brb enabled, false otherwise.
36
+ */
37
+ isBrb: function isBrb(participant) {
38
+ var _participant$controls3, _participant$controls4;
39
+ return ((_participant$controls3 = participant.controls) === null || _participant$controls3 === void 0 ? void 0 : (_participant$controls4 = _participant$controls3.brb) === null || _participant$controls4 === void 0 ? void 0 : _participant$controls4.enabled) || false;
40
+ },
41
+ /**
42
+ * @param {Object} participant - The locus participant object.
43
+ * @param {ServerRoles} controlRole the search role
44
+ * @returns {Boolean}
45
+ */
46
+ hasRole: function hasRole(participant, controlRole) {
47
+ var _MemberUtil$getContro;
48
+ return (_MemberUtil$getContro = MemberUtil.getControlsRoles(participant)) === null || _MemberUtil$getContro === void 0 ? void 0 : _MemberUtil$getContro.some(function (role) {
49
+ return role.type === controlRole && role.hasRole;
50
+ });
51
+ },
52
+ /**
53
+ * @param {Object} participant - The locus participant object.
54
+ * @returns {Boolean}
55
+ */
56
+ hasCohost: function hasCohost(participant) {
57
+ return MemberUtil.hasRole(participant, _types.ServerRoles.Cohost) || false;
58
+ },
59
+ /**
60
+ * @param {Object} participant - The locus participant object.
61
+ * @returns {Boolean}
62
+ */
63
+ hasModerator: function hasModerator(participant) {
64
+ return MemberUtil.hasRole(participant, _types.ServerRoles.Moderator) || false;
65
+ },
66
+ /**
67
+ * @param {Object} participant - The locus participant object.
68
+ * @returns {Boolean}
69
+ */
70
+ hasPresenter: function hasPresenter(participant) {
71
+ return MemberUtil.hasRole(participant, _types.ServerRoles.Presenter) || false;
72
+ },
73
+ /**
74
+ * @param {Object} participant - The locus participant object.
75
+ * @returns {IExternalRoles}
76
+ */
77
+ extractControlRoles: function extractControlRoles(participant) {
78
+ var roles = {
79
+ cohost: MemberUtil.hasCohost(participant),
80
+ moderator: MemberUtil.hasModerator(participant),
81
+ presenter: MemberUtil.hasPresenter(participant)
82
+ };
83
+ return roles;
84
+ },
85
+ /**
86
+ * @param {Object} participant - The locus participant object.
87
+ * @returns {Boolean}
88
+ */
89
+ isUser: function isUser(participant) {
90
+ return participant && participant.type === _constants._USER_;
91
+ },
92
+ isModerator: function isModerator(participant) {
93
+ return participant && participant.moderator;
94
+ },
95
+ /**
96
+ * @param {Object} participant - The locus participant object.
97
+ * @returns {Boolean}
98
+ */
99
+ isGuest: function isGuest(participant) {
100
+ return participant && participant.guest;
101
+ },
102
+ /**
103
+ * @param {Object} participant - The locus participant object.
104
+ * @returns {Boolean}
105
+ */
106
+ isDevice: function isDevice(participant) {
107
+ return participant && participant.type === _constants._RESOURCE_ROOM_;
108
+ },
109
+ isModeratorAssignmentProhibited: function isModeratorAssignmentProhibited(participant) {
110
+ return participant && participant.moderatorAssignmentNotAllowed;
111
+ },
112
+ isPresenterAssignmentProhibited: function isPresenterAssignmentProhibited(participant) {
113
+ return participant && participant.presenterAssignmentNotAllowed;
114
+ },
115
+ /**
116
+ * checks to see if the participant id is the same as the passed id
117
+ * there are multiple ids that can be used
118
+ * @param {Object} participant - The locus participant object.
119
+ * @param {String} id
120
+ * @returns {Boolean}
121
+ */
122
+ isSame: function isSame(participant, id) {
123
+ return participant && (participant.id === id || participant.person && participant.person.id === id);
124
+ },
125
+ /**
126
+ * @param {Object} participant - The locus participant object.
127
+ * @param {Boolean} isGuest
128
+ * @param {String} status
129
+ * @returns {Boolean}
130
+ */
131
+ isNotAdmitted: function isNotAdmitted(participant, isGuest, status) {
132
+ return participant && participant.guest && (participant.devices && participant.devices[0] && participant.devices[0].intent && participant.devices[0].intent.type === _constants._WAIT_ &&
133
+ // @ts-ignore
134
+ isGuest && status === _constants._IN_LOBBY_ ||
135
+ // @ts-ignore
136
+ !status === _constants._IN_MEETING_);
137
+ },
138
+ /**
139
+ * @param {Object} participant - The locus participant object.
140
+ * @returns {Boolean}
141
+ */
142
+ isAudioMuted: function isAudioMuted(participant) {
143
+ if (!participant) {
144
+ throw new _parameter.default('Audio could not be processed, participant is undefined.');
145
+ }
146
+ return MemberUtil.isMuted(participant, _constants.AUDIO_STATUS, _constants.AUDIO);
147
+ },
148
+ /**
149
+ * @param {Object} participant - The locus participant object.
150
+ * @returns {Boolean}
151
+ */
152
+ isVideoMuted: function isVideoMuted(participant) {
153
+ if (!participant) {
154
+ throw new _parameter.default('Video could not be processed, participant is undefined.');
155
+ }
156
+ return MemberUtil.isMuted(participant, _constants.VIDEO_STATUS, _constants.VIDEO);
157
+ },
158
+ /**
159
+ * @param {Object} participant - The locus participant object.
160
+ * @returns {Boolean}
161
+ */
162
+ isHandRaised: function isHandRaised(participant) {
163
+ var _participant$controls5, _participant$controls6;
164
+ if (!participant) {
165
+ throw new _parameter.default('Raise hand could not be processed, participant is undefined.');
166
+ }
167
+ return ((_participant$controls5 = participant.controls) === null || _participant$controls5 === void 0 ? void 0 : (_participant$controls6 = _participant$controls5.hand) === null || _participant$controls6 === void 0 ? void 0 : _participant$controls6.raised) || false;
168
+ },
169
+ /**
170
+ * @param {Object} participant - The locus participant object.
171
+ * @returns {Boolean}
172
+ */
173
+ isBreakoutsSupported: function isBreakoutsSupported(participant) {
174
+ if (!participant) {
175
+ throw new _parameter.default('Breakout support could not be processed, participant is undefined.');
176
+ }
177
+ return !participant.doesNotSupportBreakouts;
178
+ },
179
+ /**
180
+ * @param {Object} participant - The locus participant object.
181
+ * @returns {Boolean}
182
+ */
183
+ isInterpretationSupported: function isInterpretationSupported(participant) {
184
+ if (!participant) {
185
+ throw new _parameter.default('Interpretation support could not be processed, participant is undefined.');
186
+ }
187
+ return !participant.doesNotSupportSiInterpreter;
188
+ },
189
+ /**
190
+ * @param {Object} participant - The locus participant object.
191
+ * @returns {Boolean}
192
+ */
193
+ isLiveAnnotationSupported: function isLiveAnnotationSupported(participant) {
194
+ if (!participant) {
195
+ throw new _parameter.default('LiveAnnotation support could not be processed, participant is undefined.');
196
+ }
197
+ return !participant.annotatorAssignmentNotAllowed;
198
+ },
199
+ /**
200
+ * utility method for audio/video muted status
201
+ * @param {any} participant
202
+ * @param {String} statusAccessor
203
+ * @param {String} controlsAccessor
204
+ * @returns {Boolean | undefined}
205
+ */
206
+ isMuted: function isMuted(participant, statusAccessor, controlsAccessor) {
207
+ var _participant$controls7, _participant$controls8, _participant$status;
208
+ // check remote mute
209
+ var remoteMute = participant === null || participant === void 0 ? void 0 : (_participant$controls7 = participant.controls) === null || _participant$controls7 === void 0 ? void 0 : (_participant$controls8 = _participant$controls7[controlsAccessor]) === null || _participant$controls8 === void 0 ? void 0 : _participant$controls8.muted;
210
+ if (remoteMute === true) {
211
+ return true;
212
+ }
257
213
 
258
- /**
259
- * utility method for getting the recording member for later comparison
260
- * @param {Object} controls
261
- * @returns {String|null}
262
- */
263
- MemberUtil.getRecordingMember = function (controls) {
264
- if (!controls) {
214
+ // check local mute
215
+ var localStatus = participant === null || participant === void 0 ? void 0 : (_participant$status = participant.status) === null || _participant$status === void 0 ? void 0 : _participant$status[statusAccessor];
216
+ if (localStatus === _constants._RECEIVE_ONLY_) {
217
+ return true;
218
+ }
219
+ if (localStatus === _constants._SEND_RECEIVE_) {
220
+ return false;
221
+ }
222
+ return remoteMute;
223
+ },
224
+ /**
225
+ * utility method for getting the recording member for later comparison
226
+ * @param {Object} controls
227
+ * @returns {String|null}
228
+ */
229
+ getRecordingMember: function getRecordingMember(controls) {
230
+ if (!controls) {
231
+ return null;
232
+ }
233
+ if (controls.record && controls.record.recording && controls.record.meta) {
234
+ return controls.record.meta.modifiedBy;
235
+ }
265
236
  return null;
266
- }
267
- if (controls.record && controls.record.recording && controls.record.meta) {
268
- return controls.record.meta.modifiedBy;
269
- }
270
- return null;
271
- };
272
-
273
- /**
274
- * @param {Object} participant - The locus participant object.
275
- * @returns {Boolean}
276
- */
277
- MemberUtil.isRecording = function (participant) {
278
- if (!participant) {
279
- throw new _parameter.default('Recording could not be processed, participant is undefined.');
280
- }
281
- if (participant.controls && participant.controls.localRecord) {
282
- return participant.controls.localRecord.recording;
283
- }
284
- return false;
285
- };
286
- MemberUtil.isRemovable = function (isSelf, isGuest, isInMeeting, type) {
287
- if (isGuest || isSelf) {
288
- return false;
289
- }
290
- if (type === _constants._CALL_) {
291
- return false;
292
- }
293
- if (isInMeeting) {
294
- return true;
295
- }
296
- return false;
297
- };
298
- MemberUtil.isMutable = function (isSelf, isDevice, isInMeeting, isMuted, type) {
299
- if (!isInMeeting) {
237
+ },
238
+ /**
239
+ * @param {Object} participant - The locus participant object.
240
+ * @returns {Boolean}
241
+ */
242
+ isRecording: function isRecording(participant) {
243
+ if (!participant) {
244
+ throw new _parameter.default('Recording could not be processed, participant is undefined.');
245
+ }
246
+ if (participant.controls && participant.controls.localRecord) {
247
+ return participant.controls.localRecord.recording;
248
+ }
300
249
  return false;
301
- }
302
- if (isMuted) {
250
+ },
251
+ isRemovable: function isRemovable(isSelf, isGuest, isInMeeting, type) {
252
+ if (isGuest || isSelf) {
253
+ return false;
254
+ }
255
+ if (type === _constants._CALL_) {
256
+ return false;
257
+ }
258
+ if (isInMeeting) {
259
+ return true;
260
+ }
303
261
  return false;
304
- }
305
- if (type === _constants._CALL_) {
262
+ },
263
+ isMutable: function isMutable(isSelf, isDevice, isInMeeting, isMuted, type) {
264
+ if (!isInMeeting) {
265
+ return false;
266
+ }
267
+ if (isMuted) {
268
+ return false;
269
+ }
270
+ if (type === _constants._CALL_) {
271
+ return false;
272
+ }
273
+ if (isSelf || isDevice) {
274
+ return true;
275
+ }
306
276
  return false;
307
- }
308
- if (isSelf || isDevice) {
309
- return true;
310
- }
311
- return false;
312
- };
313
-
314
- /**
315
- * @param {Object} participant - The locus participant object.
316
- * @returns {String}
317
- */
318
- MemberUtil.extractStatus = function (participant) {
319
- if (!(participant && participant.devices && participant.devices.length)) {
320
- return _constants._NOT_IN_MEETING_;
321
- }
322
- if (participant.state === _constants._JOINED_) {
323
- return _constants._IN_MEETING_;
324
- }
325
- if (participant.state === _constants._IDLE_) {
326
- if (participant.devices && participant.devices.length > 0) {
327
- var foundDevice = participant.devices.find(function (device) {
328
- return device.intent && (device.intent.type === _constants._WAIT_ || device.intent.type === _constants._OBSERVE_);
329
- });
330
- return foundDevice ? _constants._IN_LOBBY_ : _constants._NOT_IN_MEETING_;
277
+ },
278
+ /**
279
+ * @param {Object} participant - The locus participant object.
280
+ * @returns {String}
281
+ */
282
+ extractStatus: function extractStatus(participant) {
283
+ if (!(participant && participant.devices && participant.devices.length)) {
284
+ return _constants._NOT_IN_MEETING_;
285
+ }
286
+ if (participant.state === _constants._JOINED_) {
287
+ return _constants._IN_MEETING_;
288
+ }
289
+ if (participant.state === _constants._IDLE_) {
290
+ if (participant.devices && participant.devices.length > 0) {
291
+ var foundDevice = participant.devices.find(function (device) {
292
+ return device.intent && (device.intent.type === _constants._WAIT_ || device.intent.type === _constants._OBSERVE_);
293
+ });
294
+ return foundDevice ? _constants._IN_LOBBY_ : _constants._NOT_IN_MEETING_;
295
+ }
296
+ return _constants._NOT_IN_MEETING_;
297
+ }
298
+ if (participant.state === _constants._LEFT_) {
299
+ return _constants._NOT_IN_MEETING_;
331
300
  }
332
301
  return _constants._NOT_IN_MEETING_;
302
+ },
303
+ /**
304
+ * @param {Object} participant - The locus participant object.
305
+ * @returns {String}
306
+ */
307
+ extractId: function extractId(participant) {
308
+ if (participant) {
309
+ return participant.id;
310
+ }
311
+ return null;
312
+ },
313
+ /**
314
+ * extracts the media status from nested participant object
315
+ * @param {Object} participant - The locus participant object.
316
+ * @returns {Object}
317
+ */
318
+ extractMediaStatus: function extractMediaStatus(participant) {
319
+ var _participant$status2, _participant$status3;
320
+ if (!participant) {
321
+ throw new _parameter.default('Media status could not be extracted, participant is undefined.');
322
+ }
323
+ return {
324
+ audio: (_participant$status2 = participant.status) === null || _participant$status2 === void 0 ? void 0 : _participant$status2.audioStatus,
325
+ video: (_participant$status3 = participant.status) === null || _participant$status3 === void 0 ? void 0 : _participant$status3.videoStatus
326
+ };
327
+ },
328
+ /**
329
+ * @param {Object} participant - The locus participant object.
330
+ * @returns {String}
331
+ */
332
+ extractName: function extractName(participant) {
333
+ if (participant && participant.person) {
334
+ return participant.person.name;
335
+ }
336
+ return null;
337
+ },
338
+ /**
339
+ * @param {Object} participant - The locus participant object.
340
+ * @returns {String}
341
+ */
342
+ extractPairedWithParticipantUrl: function extractPairedWithParticipantUrl(participant) {
343
+ var _participant$devices;
344
+ var participantUrl;
345
+ participant === null || participant === void 0 ? void 0 : (_participant$devices = participant.devices) === null || _participant$devices === void 0 ? void 0 : _participant$devices.forEach(function (device) {
346
+ var _device$intents;
347
+ device === null || device === void 0 ? void 0 : (_device$intents = device.intents) === null || _device$intents === void 0 ? void 0 : _device$intents.forEach(function (intent) {
348
+ if ((intent === null || intent === void 0 ? void 0 : intent.type) === _constants._OBSERVE_ && intent !== null && intent !== void 0 && intent.associatedWith) {
349
+ participantUrl = intent.associatedWith;
350
+ }
351
+ });
352
+ });
353
+ return participantUrl;
333
354
  }
334
- if (participant.state === _constants._LEFT_) {
335
- return _constants._NOT_IN_MEETING_;
336
- }
337
- return _constants._NOT_IN_MEETING_;
338
- };
339
-
340
- /**
341
- * @param {Object} participant - The locus participant object.
342
- * @returns {String}
343
- */
344
- MemberUtil.extractId = function (participant) {
345
- if (participant) {
346
- return participant.id;
347
- }
348
- return null;
349
- };
350
-
351
- /**
352
- * extracts the media status from nested participant object
353
- * @param {Object} participant - The locus participant object.
354
- * @returns {Object}
355
- */
356
- MemberUtil.extractMediaStatus = function (participant) {
357
- var _participant$status2, _participant$status3;
358
- if (!participant) {
359
- throw new _parameter.default('Media status could not be extracted, participant is undefined.');
360
- }
361
- return {
362
- audio: (_participant$status2 = participant.status) === null || _participant$status2 === void 0 ? void 0 : _participant$status2.audioStatus,
363
- video: (_participant$status3 = participant.status) === null || _participant$status3 === void 0 ? void 0 : _participant$status3.videoStatus
364
- };
365
- };
366
-
367
- /**
368
- * @param {Object} participant - The locus participant object.
369
- * @returns {String}
370
- */
371
- MemberUtil.extractName = function (participant) {
372
- if (participant && participant.person) {
373
- return participant.person.name;
374
- }
375
- return null;
376
355
  };
377
356
  var _default = exports.default = MemberUtil;
378
357
  //# sourceMappingURL=util.js.map