sip-connector 14.1.0-alpha.0 → 14.1.0-alpha.2

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 (127) hide show
  1. package/dist/@SipConnector-CrRymJFW.cjs +1 -0
  2. package/dist/{SipConnector-CK3GgjXE.js → @SipConnector-hNVaYCWj.js} +295 -522
  3. package/dist/{src/ApiManager → ApiManager}/@ApiManager.d.ts +2 -2
  4. package/dist/{src/CallManager → CallManager}/causes.d.ts +2 -1
  5. package/dist/{src/IncomingCallManager → IncomingCallManager}/@IncomingCallManager.d.ts +3 -2
  6. package/dist/{src/PresentationManager → PresentationManager}/@PresentationManager.d.ts +2 -2
  7. package/dist/{src/SipConnector.d.ts → SipConnector/@SipConnector.d.ts} +19 -30
  8. package/dist/SipConnector/eventNames.d.ts +4 -0
  9. package/dist/SipConnector/index.d.ts +2 -0
  10. package/dist/{src/SipConnectorFacade → SipConnectorFacade}/SipConnectorFacade.d.ts +6 -26
  11. package/dist/{src/__fixtures__ → __fixtures__}/BaseSession.mock.d.ts +1 -1
  12. package/dist/{src → __fixtures__}/eventNames.d.ts +1 -1
  13. package/dist/doMock.cjs +1 -1
  14. package/dist/{src/doMock.d.ts → doMock.d.ts} +1 -1
  15. package/dist/doMock.js +212 -130
  16. package/dist/index.cjs +1 -1
  17. package/dist/{src/index.d.ts → index.d.ts} +1 -5
  18. package/dist/index.js +328 -366
  19. package/dist/{src/tools → tools}/__fixtures__/processRequest.d.ts +1 -1
  20. package/dist/{src/tools → tools}/syncMediaState/index.d.ts +1 -1
  21. package/dist/{src/tools → tools}/syncMediaState/resolveOnStartMainCam.d.ts +1 -1
  22. package/dist/{src/tools → tools}/syncMediaState/resolveOnStartMic.d.ts +1 -1
  23. package/dist/{src/tools → tools}/syncMediaState/resolveOnStopMainCam.d.ts +1 -1
  24. package/dist/{src/tools → tools}/syncMediaState/resolveOnStopMic.d.ts +1 -1
  25. package/dist/{src/types.d.ts → types.d.ts} +1 -24
  26. package/dist/{src/videoSendingBalancer → videoSendingBalancer}/index.d.ts +1 -1
  27. package/package.json +12 -21
  28. package/dist/SipConnector-CwI8aFEA.cjs +0 -1
  29. package/dist/src/causes.d.ts +0 -23
  30. /package/dist/{src/ApiManager → ApiManager}/constants.d.ts +0 -0
  31. /package/dist/{src/ApiManager → ApiManager}/eventNames.d.ts +0 -0
  32. /package/dist/{src/ApiManager → ApiManager}/index.d.ts +0 -0
  33. /package/dist/{src/ApiManager → ApiManager}/types.d.ts +0 -0
  34. /package/dist/{src/CallManager → CallManager}/@CallManager.d.ts +0 -0
  35. /package/dist/{src/CallManager → CallManager}/AbstractCallStrategy.d.ts +0 -0
  36. /package/dist/{src/CallManager → CallManager}/MCUCallStrategy.d.ts +0 -0
  37. /package/dist/{src/CallManager → CallManager}/RemoteStreamsManager.d.ts +0 -0
  38. /package/dist/{src/CallManager → CallManager}/eventNames.d.ts +0 -0
  39. /package/dist/{src/CallManager → CallManager}/hasCanceledCallError.d.ts +0 -0
  40. /package/dist/{src/CallManager → CallManager}/index.d.ts +0 -0
  41. /package/dist/{src/CallManager → CallManager}/types.d.ts +0 -0
  42. /package/dist/{src/ConnectionManager → ConnectionManager}/@ConnectionManager.d.ts +0 -0
  43. /package/dist/{src/ConnectionManager → ConnectionManager}/ConfigurationManager.d.ts +0 -0
  44. /package/dist/{src/ConnectionManager → ConnectionManager}/ConnectionFlow.d.ts +0 -0
  45. /package/dist/{src/ConnectionManager → ConnectionManager}/ConnectionStateMachine.d.ts +0 -0
  46. /package/dist/{src/ConnectionManager → ConnectionManager}/RegistrationManager.d.ts +0 -0
  47. /package/dist/{src/ConnectionManager → ConnectionManager}/SipOperations.d.ts +0 -0
  48. /package/dist/{src/ConnectionManager → ConnectionManager}/UAFactory.d.ts +0 -0
  49. /package/dist/{src/ConnectionManager → ConnectionManager}/eventNames.d.ts +0 -0
  50. /package/dist/{src/ConnectionManager → ConnectionManager}/index.d.ts +0 -0
  51. /package/dist/{src/IncomingCallManager → IncomingCallManager}/eventNames.d.ts +0 -0
  52. /package/dist/{src/IncomingCallManager → IncomingCallManager}/index.d.ts +0 -0
  53. /package/dist/{src/PresentationManager → PresentationManager}/constants.d.ts +0 -0
  54. /package/dist/{src/PresentationManager → PresentationManager}/eventNames.d.ts +0 -0
  55. /package/dist/{src/PresentationManager → PresentationManager}/index.d.ts +0 -0
  56. /package/dist/{src/PresentationManager → PresentationManager}/types.d.ts +0 -0
  57. /package/dist/{src/SipConnectorFacade → SipConnectorFacade}/index.d.ts +0 -0
  58. /package/dist/{src/__fixtures__ → __fixtures__}/RTCPeerConnectionMock.d.ts +0 -0
  59. /package/dist/{src/__fixtures__ → __fixtures__}/RTCRtpSenderMock.d.ts +0 -0
  60. /package/dist/{src/__fixtures__ → __fixtures__}/RTCSessionMock.d.ts +0 -0
  61. /package/dist/{src/__fixtures__ → __fixtures__}/Registrator.mock.d.ts +0 -0
  62. /package/dist/{src/__fixtures__ → __fixtures__}/Request.mock.d.ts +0 -0
  63. /package/dist/{src/__fixtures__ → __fixtures__}/UA.mock.d.ts +0 -0
  64. /package/dist/{src/__fixtures__ → __fixtures__}/WebSocketInterface.mock.d.ts +0 -0
  65. /package/dist/{src/__fixtures__ → __fixtures__}/accountNotify.d.ts +0 -0
  66. /package/dist/{src/__fixtures__ → __fixtures__}/channels.d.ts +0 -0
  67. /package/dist/{src/__fixtures__ → __fixtures__}/channelsNotify.d.ts +0 -0
  68. /package/dist/{src/__fixtures__ → __fixtures__}/conferenceParticipantTokenIssuedNotify.d.ts +0 -0
  69. /package/dist/{src → __fixtures__}/constants.d.ts +0 -0
  70. /package/dist/{src/__fixtures__ → __fixtures__}/delayPromise.d.ts +0 -0
  71. /package/dist/{src/__fixtures__ → __fixtures__}/enterRoom.d.ts +0 -0
  72. /package/dist/{src/__fixtures__ → __fixtures__}/index.d.ts +0 -0
  73. /package/dist/{src/__fixtures__ → __fixtures__}/jssip.mock.d.ts +0 -0
  74. /package/dist/{src/__fixtures__ → __fixtures__}/mediaState.d.ts +0 -0
  75. /package/dist/{src/__fixtures__ → __fixtures__}/participantMoveRequests.d.ts +0 -0
  76. /package/dist/{src/__fixtures__ → __fixtures__}/participantNotify.d.ts +0 -0
  77. /package/dist/{src/__fixtures__ → __fixtures__}/remoteCallerData.d.ts +0 -0
  78. /package/dist/{src/__fixtures__ → __fixtures__}/utils.d.ts +0 -0
  79. /package/dist/{src/__fixtures__ → __fixtures__}/webcastNotify.d.ts +0 -0
  80. /package/dist/{src/getExtraHeadersRemoteAddress.d.ts → getExtraHeadersRemoteAddress.d.ts} +0 -0
  81. /package/dist/{src/headers.d.ts → headers.d.ts} +0 -0
  82. /package/dist/{src/logger.d.ts → logger.d.ts} +0 -0
  83. /package/dist/{src/setParametersToSender → setParametersToSender}/configureDegradationPreference.d.ts +0 -0
  84. /package/dist/{src/setParametersToSender → setParametersToSender}/configureEmptyEncodings.d.ts +0 -0
  85. /package/dist/{src/setParametersToSender → setParametersToSender}/configureEncodings.d.ts +0 -0
  86. /package/dist/{src/setParametersToSender → setParametersToSender}/configureMaxBitrate.d.ts +0 -0
  87. /package/dist/{src/setParametersToSender → setParametersToSender}/configureScaleResolutionDownBy.d.ts +0 -0
  88. /package/dist/{src/setParametersToSender → setParametersToSender}/hasChangedRTCRtpSendParameters.d.ts +0 -0
  89. /package/dist/{src/setParametersToSender → setParametersToSender}/index.d.ts +0 -0
  90. /package/dist/{src/setParametersToSender → setParametersToSender}/resolveHasNeedToUpdateItemEncoding.d.ts +0 -0
  91. /package/dist/{src/setParametersToSender → setParametersToSender}/setParametersToSender.d.ts +0 -0
  92. /package/dist/{src/tools → tools}/__fixtures__/call.d.ts +0 -0
  93. /package/dist/{src/tools → tools}/__fixtures__/connectToServer.d.ts +0 -0
  94. /package/dist/{src/tools → tools}/__fixtures__/hasValidUri.d.ts +0 -0
  95. /package/dist/{src/tools → tools}/__fixtures__/permissions.d.ts +0 -0
  96. /package/dist/{src/tools → tools}/__tests-utils__/parseObject.d.ts +0 -0
  97. /package/dist/{src/tools → tools}/__tests-utils__/resolveParseArray.d.ts +0 -0
  98. /package/dist/{src/tools → tools}/error/getLinkError.d.ts +0 -0
  99. /package/dist/{src/tools → tools}/error/getTypeFromError.d.ts +0 -0
  100. /package/dist/{src/tools → tools}/error/getValuesFromError.d.ts +0 -0
  101. /package/dist/{src/tools → tools}/error/index.d.ts +0 -0
  102. /package/dist/{src/tools → tools}/error/stringifyMessage.d.ts +0 -0
  103. /package/dist/{src/tools → tools}/generateSimulcastEncodings.d.ts +0 -0
  104. /package/dist/{src/tools → tools}/getExtraHeaders.d.ts +0 -0
  105. /package/dist/{src/tools → tools}/getUserAgent.d.ts +0 -0
  106. /package/dist/{src/tools → tools}/hasPurgatory.d.ts +0 -0
  107. /package/dist/{src/tools → tools}/index.d.ts +0 -0
  108. /package/dist/{src/tools → tools}/prepareMediaStream.d.ts +0 -0
  109. /package/dist/{src/tools → tools}/resolveUpdateTransceiver.d.ts +0 -0
  110. /package/dist/{src/tools → tools}/sendDtmfFAccumulated.d.ts +0 -0
  111. /package/dist/{src/tools → tools}/setVideoTrackContentHints.d.ts +0 -0
  112. /package/dist/{src/utils → utils}/errors.d.ts +0 -0
  113. /package/dist/{src/utils → utils}/findSenderByStream.d.ts +0 -0
  114. /package/dist/{src/utils → utils}/findVideoSender.d.ts +0 -0
  115. /package/dist/{src/utils → utils}/findVideoTrack.d.ts +0 -0
  116. /package/dist/{src/utils → utils}/getCodecFromSender.d.ts +0 -0
  117. /package/dist/{src/utils → utils}/replaceForbiddenSymbolsWithUnderscore.d.ts +0 -0
  118. /package/dist/{src/videoSendingBalancer → videoSendingBalancer}/balance.d.ts +0 -0
  119. /package/dist/{src/videoSendingBalancer → videoSendingBalancer}/getMaxBitrateByWidth.d.ts +0 -0
  120. /package/dist/{src/videoSendingBalancer → videoSendingBalancer}/getMaxBitrateByWidthAndCodec.d.ts +0 -0
  121. /package/dist/{src/videoSendingBalancer → videoSendingBalancer}/hasAv1Codec.d.ts +0 -0
  122. /package/dist/{src/videoSendingBalancer → videoSendingBalancer}/hasIncludesString.d.ts +0 -0
  123. /package/dist/{src/videoSendingBalancer → videoSendingBalancer}/processSender.d.ts +0 -0
  124. /package/dist/{src/videoSendingBalancer → videoSendingBalancer}/scaleBitrate.d.ts +0 -0
  125. /package/dist/{src/videoSendingBalancer → videoSendingBalancer}/scaleBitrateByCodec.d.ts +0 -0
  126. /package/dist/{src/videoSendingBalancer → videoSendingBalancer}/scaleResolutionAndBitrate.d.ts +0 -0
  127. /package/dist/{src/videoSendingBalancer → videoSendingBalancer}/setEncodingsToSender.d.ts +0 -0
@@ -1,206 +1,15 @@
1
- import D from "events-constructor";
1
+ import O from "events-constructor";
2
2
  import "@krivega/cancelable-promise";
3
- import W from "debug";
4
- import { hasCanceledError as ht, repeatedCallsAsync as G } from "repeated-calls";
5
- import { setup as lt, createActor as Ct } from "xstate";
6
- const Nt = "Connection Error", At = "Request Timeout", _t = "SIP Failure Code", ut = "Internal Error", It = "Busy", Rt = "Rejected", Mt = "Redirected", Ot = "Unavailable", pt = "Not Found", Pt = "Address Incomplete", mt = "Incompatible SDP", ft = "Missing SDP", Dt = "Authentication Error", vt = "Terminated", yt = "WebRTC Error", Ut = "Canceled", bt = "No Answer", wt = "Expires", Lt = "No ACK", Ft = "Dialog Error", $t = "User Denied Media Access", Wt = "Bad Media Description", kt = "RTP Timeout", yn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
7
- __proto__: null,
8
- ADDRESS_INCOMPLETE: Pt,
9
- AUTHENTICATION_ERROR: Dt,
10
- BAD_MEDIA_DESCRIPTION: Wt,
11
- BUSY: It,
12
- BYE: vt,
13
- CANCELED: Ut,
14
- CONNECTION_ERROR: Nt,
15
- DIALOG_ERROR: Ft,
16
- EXPIRES: wt,
17
- INCOMPATIBLE_SDP: mt,
18
- INTERNAL_ERROR: ut,
19
- MISSING_SDP: ft,
20
- NOT_FOUND: pt,
21
- NO_ACK: Lt,
22
- NO_ANSWER: bt,
23
- REDIRECTED: Mt,
24
- REJECTED: Rt,
25
- REQUEST_TIMEOUT: At,
26
- RTP_TIMEOUT: kt,
27
- SIP_FAILURE_CODE: _t,
28
- UNAVAILABLE: Ot,
29
- USER_DENIED_MEDIA_ACCESS: $t,
30
- WEBRTC_ERROR: yt
31
- }, Symbol.toStringTag, { value: "Module" })), H = "incomingCall", B = "declinedIncomingCall", Y = "failedIncomingCall", q = "terminatedIncomingCall", k = "connecting", x = "connected", Q = "disconnected", z = "newRTCSession", J = "registered", X = "unregistered", j = "registrationFailed", K = "newMessage", Z = "sipEvent", ee = "availableSecondRemoteStream", te = "notAvailableSecondRemoteStream", ne = "mustStopPresentation", se = "shareState", ie = "enterRoom", re = "useLicense", ae = "peerconnection:confirmed", oe = "peerconnection:ontrack", ce = "channels", Te = "channels:notify", Ee = "ended:fromserver", ge = "main-cam-control", Se = "admin-stop-main-cam", de = "admin-start-main-cam", he = "admin-stop-mic", le = "admin-start-mic", Ce = "admin-force-sync-media-state", Ne = "participant:added-to-list-moderators", Ae = "participant:removed-from-list-moderators", _e = "participant:move-request-to-stream", ue = "participant:move-request-to-spectators", Ie = "participant:move-request-to-participants", Re = "participation:accepting-word-request", Me = "participation:cancelling-word-request", Oe = "webcast:started", pe = "webcast:stopped", Pe = "account:changed", me = "account:deleted", fe = "conference:participant-token-issued", De = "ended", ve = "sending", ye = "reinvite", Ue = "replaces", be = "refer", we = "progress", Le = "accepted", Fe = "confirmed", $e = "peerconnection", We = "failed", ke = "muted", Ve = "unmuted", Ge = "newDTMF", He = "newInfo", Be = "hold", Ye = "unhold", qe = "update", xe = "sdp", Qe = "icecandidate", ze = "getusermediafailed", Je = "peerconnection:createofferfailed", Xe = "peerconnection:createanswerfailed", je = "peerconnection:setlocaldescriptionfailed", Ke = "peerconnection:setremotedescriptionfailed", Ze = "presentation:start", et = "presentation:started", tt = "presentation:end", nt = "presentation:ended", st = "presentation:failed", Vt = "SPECTATOR", Gt = "PARTICIPANT", Ht = 1e6;
32
- var it = /* @__PURE__ */ ((n) => (n.LOCAL = "local", n.REMOTE = "remote", n.SYSTEM = "system", n))(it || {});
33
- const Un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
34
- __proto__: null,
35
- ACCEPTED: Le,
36
- ACCOUNT_CHANGED: Pe,
37
- ACCOUNT_DELETED: me,
38
- ADMIN_FORCE_SYNC_MEDIA_STATE: Ce,
39
- ADMIN_START_MAIN_CAM: de,
40
- ADMIN_START_MIC: le,
41
- ADMIN_STOP_MAIN_CAM: Se,
42
- ADMIN_STOP_MIC: he,
43
- AVAILABLE_SECOND_REMOTE_STREAM_EVENT: ee,
44
- CHANNELS: ce,
45
- CHANNELS_NOTIFY: Te,
46
- CONFERENCE_PARTICIPANT_TOKEN_ISSUED: fe,
47
- CONFIRMED: Fe,
48
- CONNECTED: x,
49
- CONNECTING: k,
50
- DECLINED_INCOMING_CALL: B,
51
- DISCONNECTED: Q,
52
- ENDED: De,
53
- ENDED_FROM_SERVER: Ee,
54
- ENTER_ROOM: ie,
55
- FAILED: We,
56
- FAILED_INCOMING_CALL: Y,
57
- GET_USER_MEDIA_FAILED: ze,
58
- HOLD: Be,
59
- ICE_CANDIDATE: Qe,
60
- INCOMING_CALL: H,
61
- MAIN_CAM_CONTROL: ge,
62
- MUST_STOP_PRESENTATION_EVENT: ne,
63
- MUTED: ke,
64
- NEW_DTMF: Ge,
65
- NEW_INFO: He,
66
- NEW_MESSAGE: K,
67
- NEW_RTC_SESSION: z,
68
- NOT_AVAILABLE_SECOND_REMOTE_STREAM_EVENT: te,
69
- ONE_MEGABIT_IN_BITS: Ht,
70
- Originator: it,
71
- PARTICIPANT: Gt,
72
- PARTICIPANT_ADDED_TO_LIST_MODERATORS: Ne,
73
- PARTICIPANT_MOVE_REQUEST_TO_PARTICIPANTS: Ie,
74
- PARTICIPANT_MOVE_REQUEST_TO_SPECTATORS: ue,
75
- PARTICIPANT_MOVE_REQUEST_TO_STREAM: _e,
76
- PARTICIPANT_REMOVED_FROM_LIST_MODERATORS: Ae,
77
- PARTICIPATION_ACCEPTING_WORD_REQUEST: Re,
78
- PARTICIPATION_CANCELLING_WORD_REQUEST: Me,
79
- PEER_CONNECTION: $e,
80
- PEER_CONNECTION_CONFIRMED: ae,
81
- PEER_CONNECTION_CREATE_ANSWER_FAILED: Xe,
82
- PEER_CONNECTION_CREATE_OFFER_FAILED: Je,
83
- PEER_CONNECTION_ONTRACK: oe,
84
- PEER_CONNECTION_SET_LOCAL_DESCRIPTION_FAILED: je,
85
- PEER_CONNECTION_SET_REMOTE_DESCRIPTION_FAILED: Ke,
86
- PRESENTATION_END: tt,
87
- PRESENTATION_ENDED: nt,
88
- PRESENTATION_FAILED: st,
89
- PRESENTATION_START: Ze,
90
- PRESENTATION_STARTED: et,
91
- PROGRESS: we,
92
- REFER: be,
93
- REGISTERED: J,
94
- REGISTRATION_FAILED: j,
95
- REINVITE: ye,
96
- REPLACES: Ue,
97
- SDP: xe,
98
- SENDING: ve,
99
- SHARE_STATE: se,
100
- SIP_EVENT: Z,
101
- SPECTATOR: Vt,
102
- TERMINATED_INCOMING_CALL: q,
103
- UNHOLD: Ye,
104
- UNMUTED: Ve,
105
- UNREGISTERED: X,
106
- UPDATE: qe,
107
- USE_LICENSE: re,
108
- WEBCAST_STARTED: Oe,
109
- WEBCAST_STOPPED: pe
110
- }, Symbol.toStringTag, { value: "Module" })), rt = [
111
- H,
112
- B,
113
- q,
114
- Y,
115
- Re,
116
- Me,
117
- _e,
118
- Te,
119
- fe,
120
- Pe,
121
- me,
122
- Oe,
123
- pe,
124
- Ne,
125
- Ae
126
- ], at = [
127
- k,
128
- x,
129
- Q,
130
- z,
131
- J,
132
- X,
133
- j,
134
- K,
135
- Z
136
- ], ot = [
137
- ee,
138
- te,
139
- ne,
140
- se,
141
- ie,
142
- re,
143
- ae,
144
- oe,
145
- ce,
146
- Ee,
147
- ge,
148
- de,
149
- Se,
150
- he,
151
- le,
152
- Ce,
153
- ue,
154
- Ie
155
- ], ct = [
156
- De,
157
- k,
158
- ve,
159
- ye,
160
- Ue,
161
- be,
162
- we,
163
- Le,
164
- Fe,
165
- $e,
166
- We,
167
- ke,
168
- Ve,
169
- Ge,
170
- He,
171
- Be,
172
- Ye,
173
- qe,
174
- xe,
175
- Qe,
176
- ze,
177
- Je,
178
- Xe,
179
- je,
180
- Ke,
181
- Ze,
182
- et,
183
- tt,
184
- nt,
185
- st
186
- ], Bt = [...at, ...rt], Yt = [
187
- ...ct,
188
- ...ot
189
- ], bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
190
- __proto__: null,
191
- SESSION_EVENT_NAMES: Yt,
192
- SESSION_JSSIP_EVENT_NAMES: ct,
193
- SESSION_SYNTHETICS_EVENT_NAMES: ot,
194
- UA_EVENT_NAMES: Bt,
195
- UA_JSSIP_EVENT_NAMES: at,
196
- UA_SYNTHETICS_EVENT_NAMES: rt
197
- }, Symbol.toStringTag, { value: "Module" })), V = "sip-connector", P = W(V), wn = () => {
198
- W.enable(V);
199
- }, Ln = () => {
200
- W.enable(`-${V}`);
3
+ import k from "debug";
4
+ import { hasCanceledError as K, repeatedCallsAsync as V } from "repeated-calls";
5
+ import { setup as j, createActor as Z } from "xstate";
6
+ const W = "sip-connector", P = k(W), Ve = () => {
7
+ k.enable(W);
8
+ }, He = () => {
9
+ k.enable(`-${W}`);
201
10
  };
202
- var N = /* @__PURE__ */ ((n) => (n.PEER_CONNECTION = "peerconnection", n.CONNECTING = "connecting", n.SENDING = "sending", n.PROGRESS = "progress", n.ACCEPTED = "accepted", n.CONFIRMED = "confirmed", n.ENDED = "ended", n.FAILED = "failed", n.NEW_DTMF = "newDTMF", n.NEW_INFO = "newInfo", n.HOLD = "hold", n.UNHOLD = "unhold", n.MUTED = "muted", n.UNMUTED = "unmuted", n.REINVITE = "reinvite", n.UPDATE = "update", n.REFER = "refer", n.REPLACES = "replaces", n.SDP = "sdp", n.ICE_CANDIDATE = "icecandidate", n.GET_USER_MEDIA_FAILED = "getusermediafailed", n.PEER_CONNECTION_CREATE_OFFER_FAILED = "peerconnection:createofferfailed", n.PEER_CONNECTION_CREATE_ANSWER_FAILED = "peerconnection:createanswerfailed", n.PEER_CONNECTION_SET_LOCAL_DESCRIPTION_FAILED = "peerconnection:setlocaldescriptionfailed", n.PEER_CONNECTION_SET_REMOTE_DESCRIPTION_FAILED = "peerconnection:setremotedescriptionfailed", n.START_PRESENTATION = "presentation:start", n.STARTED_PRESENTATION = "presentation:started", n.END_PRESENTATION = "presentation:end", n.ENDED_PRESENTATION = "presentation:ended", n.FAILED_PRESENTATION = "presentation:failed", n.PEER_CONNECTION_CONFIRMED = "peerconnection:confirmed", n.PEER_CONNECTION_ONTRACK = "peerconnection:ontrack", n.ENDED_FROM_SERVER = "ended:fromserver", n))(N || {}), U = /* @__PURE__ */ ((n) => (n.LOCAL = "local", n.REMOTE = "remote", n.SYSTEM = "system", n))(U || {});
203
- const Tt = [
11
+ var H = /* @__PURE__ */ ((n) => (n.BYE = "Terminated", n.WEBRTC_ERROR = "WebRTC Error", n.CANCELED = "Canceled", n.REQUEST_TIMEOUT = "Request Timeout", n.REJECTED = "Rejected", n.REDIRECTED = "Redirected", n.UNAVAILABLE = "Unavailable", n.NOT_FOUND = "Not Found", n.ADDRESS_INCOMPLETE = "Address Incomplete", n.INCOMPATIBLE_SDP = "Incompatible SDP", n.BAD_MEDIA_DESCRIPTION = "Bad Media Description", n))(H || {}), N = /* @__PURE__ */ ((n) => (n.PEER_CONNECTION = "peerconnection", n.CONNECTING = "connecting", n.SENDING = "sending", n.PROGRESS = "progress", n.ACCEPTED = "accepted", n.CONFIRMED = "confirmed", n.ENDED = "ended", n.FAILED = "failed", n.NEW_DTMF = "newDTMF", n.NEW_INFO = "newInfo", n.HOLD = "hold", n.UNHOLD = "unhold", n.MUTED = "muted", n.UNMUTED = "unmuted", n.REINVITE = "reinvite", n.UPDATE = "update", n.REFER = "refer", n.REPLACES = "replaces", n.SDP = "sdp", n.ICE_CANDIDATE = "icecandidate", n.GET_USER_MEDIA_FAILED = "getusermediafailed", n.PEER_CONNECTION_CREATE_OFFER_FAILED = "peerconnection:createofferfailed", n.PEER_CONNECTION_CREATE_ANSWER_FAILED = "peerconnection:createanswerfailed", n.PEER_CONNECTION_SET_LOCAL_DESCRIPTION_FAILED = "peerconnection:setlocaldescriptionfailed", n.PEER_CONNECTION_SET_REMOTE_DESCRIPTION_FAILED = "peerconnection:setremotedescriptionfailed", n.START_PRESENTATION = "presentation:start", n.STARTED_PRESENTATION = "presentation:started", n.END_PRESENTATION = "presentation:end", n.ENDED_PRESENTATION = "presentation:ended", n.FAILED_PRESENTATION = "presentation:failed", n.PEER_CONNECTION_CONFIRMED = "peerconnection:confirmed", n.PEER_CONNECTION_ONTRACK = "peerconnection:ontrack", n.ENDED_FROM_SERVER = "ended:fromserver", n))(N || {}), U = /* @__PURE__ */ ((n) => (n.LOCAL = "local", n.REMOTE = "remote", n.SYSTEM = "system", n))(U || {});
12
+ const G = [
204
13
  "peerconnection",
205
14
  "connecting",
206
15
  "sending",
@@ -227,21 +36,21 @@ const Tt = [
227
36
  "peerconnection:createanswerfailed",
228
37
  "peerconnection:setlocaldescriptionfailed",
229
38
  "peerconnection:setremotedescriptionfailed"
230
- ], qt = [
39
+ ], ee = [
231
40
  "peerconnection:confirmed",
232
41
  "peerconnection:ontrack",
233
42
  "ended:fromserver"
234
- ], xt = [
235
- ...Tt,
236
- ...qt
43
+ ], B = [
44
+ ...G,
45
+ ...ee
237
46
  ];
238
- function Qt(n) {
47
+ function te(n) {
239
48
  return (e) => `sip:${e}@${n}`;
240
49
  }
241
- const zt = (n, e) => () => Math.floor(Math.random() * (e - n)) + n, Et = (n) => n.trim().replaceAll(" ", "_"), Jt = zt(1e5, 99999999), Xt = (n) => n.some((t) => {
50
+ const ne = (n, e) => () => Math.floor(Math.random() * (e - n)) + n, x = (n) => n.trim().replaceAll(" ", "_"), se = ne(1e5, 99999999), ie = (n) => n.some((t) => {
242
51
  const { kind: s } = t;
243
52
  return s === "video";
244
- }), jt = (n, e) => {
53
+ }), re = (n, e) => {
245
54
  n.getVideoTracks().forEach((s) => {
246
55
  "contentHint" in s && s.contentHint !== e && (s.contentHint = e);
247
56
  });
@@ -253,9 +62,9 @@ const zt = (n, e) => () => Math.floor(Math.random() * (e - n)) + n, Et = (n) =>
253
62
  if (!n || e === "recvonly" && t === "recvonly")
254
63
  return;
255
64
  const i = t === "recvonly" ? [] : n.getAudioTracks(), r = e === "recvonly" ? [] : n.getVideoTracks(), a = [...i, ...r], o = new MediaStream(a);
256
- return o.getTracks = () => [...o.getAudioTracks(), ...o.getVideoTracks()], s && s !== "none" && jt(o, s), o;
65
+ return o.getTracks = () => [...o.getAudioTracks(), ...o.getVideoTracks()], s && s !== "none" && re(o, s), o;
257
66
  };
258
- class Kt {
67
+ class ae {
259
68
  isPendingCall = !1;
260
69
  isPendingAnswer = !1;
261
70
  rtcSession;
@@ -266,8 +75,7 @@ class Kt {
266
75
  this.events = e;
267
76
  }
268
77
  }
269
- var gt = /* @__PURE__ */ ((n) => (n.BYE = "Terminated", n.WEBRTC_ERROR = "WebRTC Error", n.CANCELED = "Canceled", n.REQUEST_TIMEOUT = "Request Timeout", n.REJECTED = "Rejected", n.REDIRECTED = "Redirected", n.UNAVAILABLE = "Unavailable", n.NOT_FOUND = "Not Found", n.ADDRESS_INCOMPLETE = "Address Incomplete", n.INCOMPATIBLE_SDP = "Incompatible SDP", n))(gt || {});
270
- class Zt {
78
+ class oe {
271
79
  remoteStreams = {};
272
80
  reset() {
273
81
  this.remoteStreams = {};
@@ -296,8 +104,8 @@ class Zt {
296
104
  return e.map((t) => this.generateAudioStream(t));
297
105
  }
298
106
  }
299
- class en extends Kt {
300
- remoteStreamsManager = new Zt();
107
+ class ce extends ae {
108
+ remoteStreamsManager = new oe();
301
109
  disposers = /* @__PURE__ */ new Set();
302
110
  constructor(e) {
303
111
  super(e), e.on(N.FAILED, this.handleEnded), e.on(N.ENDED, this.handleEnded);
@@ -321,32 +129,32 @@ class en extends Kt {
321
129
  ontrack: a,
322
130
  iceServers: o,
323
131
  directionVideo: c,
324
- directionAudio: T,
325
- contentHint: S,
326
- offerToReceiveAudio: l = !0,
327
- offerToReceiveVideo: d = !0,
328
- sendEncodings: h,
132
+ directionAudio: g,
133
+ contentHint: d,
134
+ offerToReceiveAudio: S = !0,
135
+ offerToReceiveVideo: l = !0,
136
+ sendEncodings: E,
329
137
  onAddedTransceiver: I
330
- }) => (this.isPendingCall = !0, new Promise((C, O) => {
138
+ }) => (this.isPendingCall = !0, new Promise((C, p) => {
331
139
  this.callConfiguration.number = s, this.callConfiguration.answer = !1, this.handleCall({ ontrack: a }).then(C).catch((b) => {
332
- O(b);
140
+ p(b);
333
141
  }), this.rtcSession = e.call(t(s), {
334
142
  extraHeaders: r,
335
143
  mediaStream: v(i, {
336
144
  directionVideo: c,
337
- directionAudio: T,
338
- contentHint: S
145
+ directionAudio: g,
146
+ contentHint: d
339
147
  }),
340
148
  directionVideo: c,
341
- directionAudio: T,
149
+ directionAudio: g,
342
150
  pcConfig: {
343
151
  iceServers: o
344
152
  },
345
153
  rtcOfferConstraints: {
346
- offerToReceiveAudio: l,
347
- offerToReceiveVideo: d
154
+ offerToReceiveAudio: S,
155
+ offerToReceiveVideo: l
348
156
  },
349
- sendEncodings: h,
157
+ sendEncodings: E,
350
158
  onAddedTransceiver: I
351
159
  }), this.subscribeToSessionEvents(this.rtcSession);
352
160
  }).finally(() => {
@@ -356,7 +164,7 @@ class en extends Kt {
356
164
  const { rtcSession: e } = this;
357
165
  if (e && !e.isEnded())
358
166
  return e.terminateAsync({
359
- cause: gt.CANCELED
167
+ cause: H.CANCELED
360
168
  }).finally(() => {
361
169
  this.reset();
362
170
  });
@@ -370,35 +178,35 @@ class en extends Kt {
370
178
  directionVideo: a,
371
179
  directionAudio: o,
372
180
  offerToReceiveAudio: c,
373
- offerToReceiveVideo: T,
374
- contentHint: S,
375
- sendEncodings: l,
376
- onAddedTransceiver: d
377
- }) => (this.isPendingAnswer = !0, new Promise((h, I) => {
181
+ offerToReceiveVideo: g,
182
+ contentHint: d,
183
+ sendEncodings: S,
184
+ onAddedTransceiver: l
185
+ }) => (this.isPendingAnswer = !0, new Promise((E, I) => {
378
186
  try {
379
187
  const C = e();
380
- this.rtcSession = C, this.subscribeToSessionEvents(C), this.callConfiguration.answer = !0, this.callConfiguration.number = C.remote_identity.uri.user, this.handleCall({ ontrack: s }).then(h).catch((b) => {
188
+ this.rtcSession = C, this.subscribeToSessionEvents(C), this.callConfiguration.answer = !0, this.callConfiguration.number = C.remote_identity.uri.user, this.handleCall({ ontrack: s }).then(E).catch((b) => {
381
189
  I(b);
382
190
  });
383
- const O = v(t, {
191
+ const p = v(t, {
384
192
  directionVideo: a,
385
193
  directionAudio: o,
386
- contentHint: S
194
+ contentHint: d
387
195
  });
388
196
  C.answer({
389
197
  extraHeaders: i,
390
198
  directionVideo: a,
391
199
  directionAudio: o,
392
- mediaStream: O,
200
+ mediaStream: p,
393
201
  pcConfig: {
394
202
  iceServers: r
395
203
  },
396
204
  rtcOfferConstraints: {
397
205
  offerToReceiveAudio: c,
398
- offerToReceiveVideo: T
206
+ offerToReceiveVideo: g
399
207
  },
400
- sendEncodings: l,
401
- onAddedTransceiver: d
208
+ sendEncodings: S,
209
+ onAddedTransceiver: l
402
210
  });
403
211
  } catch (C) {
404
212
  I(C);
@@ -416,7 +224,7 @@ class en extends Kt {
416
224
  if (!this.connection)
417
225
  return;
418
226
  const t = this.connection.getReceivers().map(({ track: s }) => s);
419
- return Xt(t) ? this.remoteStreamsManager.generateStreams(t) : this.remoteStreamsManager.generateAudioStreams(t);
227
+ return ie(t) ? this.remoteStreamsManager.generateStreams(t) : this.remoteStreamsManager.generateAudioStreams(t);
420
228
  }
421
229
  async replaceMediaStream(e, t) {
422
230
  if (!this.rtcSession)
@@ -430,33 +238,33 @@ class en extends Kt {
430
238
  ontrack: e
431
239
  }) => new Promise((t, s) => {
432
240
  const i = () => {
433
- this.events.on(N.PEER_CONNECTION, S), this.events.on(N.CONFIRMED, l);
241
+ this.events.on(N.PEER_CONNECTION, d), this.events.on(N.CONFIRMED, S);
434
242
  }, r = () => {
435
- this.events.off(N.PEER_CONNECTION, S), this.events.off(N.CONFIRMED, l);
243
+ this.events.off(N.PEER_CONNECTION, d), this.events.off(N.CONFIRMED, S);
436
244
  }, a = () => {
437
245
  this.events.on(N.FAILED, c), this.events.on(N.ENDED, c);
438
246
  }, o = () => {
439
247
  this.events.off(N.FAILED, c), this.events.off(N.ENDED, c);
440
- }, c = (d) => {
441
- r(), o(), s(d);
248
+ }, c = (l) => {
249
+ r(), o(), s(l);
442
250
  };
443
- let T;
444
- const S = ({ peerconnection: d }) => {
445
- T = d;
446
- const h = (I) => {
447
- this.events.trigger(N.PEER_CONNECTION_ONTRACK, d), e && e(I);
251
+ let g;
252
+ const d = ({ peerconnection: l }) => {
253
+ g = l;
254
+ const E = (I) => {
255
+ this.events.trigger(N.PEER_CONNECTION_ONTRACK, l), e && e(I);
448
256
  };
449
- d.addEventListener("track", h), this.disposers.add(() => {
450
- d.removeEventListener("track", h);
257
+ l.addEventListener("track", E), this.disposers.add(() => {
258
+ l.removeEventListener("track", E);
451
259
  });
452
- }, l = () => {
453
- T !== void 0 && this.events.trigger(N.PEER_CONNECTION_CONFIRMED, T), r(), o(), t(T);
260
+ }, S = () => {
261
+ g !== void 0 && this.events.trigger(N.PEER_CONNECTION_CONFIRMED, g), r(), o(), t(g);
454
262
  };
455
263
  i(), a();
456
264
  });
457
265
  subscribeToSessionEvents(e) {
458
266
  this.events.eachTriggers((t, s) => {
459
- const i = Tt.find((r) => r === s);
267
+ const i = G.find((r) => r === s);
460
268
  i && (e.on(i, t), this.disposers.add(() => {
461
269
  e.off(i, t);
462
270
  }));
@@ -475,11 +283,11 @@ class en extends Kt {
475
283
  delete this.rtcSession, this.remoteStreamsManager.reset(), this.unsubscribeFromSessionEvents(), this.callConfiguration.number = void 0, this.callConfiguration.answer = !1;
476
284
  };
477
285
  }
478
- class tn {
286
+ class ge {
479
287
  events;
480
288
  strategy;
481
289
  constructor(e) {
482
- this.events = new D(xt), this.strategy = e ?? new en(this.events);
290
+ this.events = new O(B), this.strategy = e ?? new ce(this.events);
483
291
  }
484
292
  get requested() {
485
293
  return this.strategy.requested;
@@ -524,22 +332,22 @@ class tn {
524
332
  replaceMediaStream = async (...e) => this.strategy.replaceMediaStream(...e);
525
333
  }
526
334
  var R = /* @__PURE__ */ ((n) => (n.START_PRESENTATION = "presentation:start", n.STARTED_PRESENTATION = "presentation:started", n.END_PRESENTATION = "presentation:end", n.ENDED_PRESENTATION = "presentation:ended", n.FAILED_PRESENTATION = "presentation:failed", n))(R || {});
527
- const nn = [
335
+ const q = [
528
336
  "presentation:start",
529
337
  "presentation:started",
530
338
  "presentation:end",
531
339
  "presentation:ended",
532
340
  "presentation:failed"
533
- ], sn = 1, Fn = (n) => ht(n);
534
- class rn {
341
+ ], he = 1, Ge = (n) => K(n);
342
+ class Te {
343
+ events;
535
344
  promisePendingStartPresentation;
536
345
  promisePendingStopPresentation;
537
346
  streamPresentationCurrent;
538
- events;
539
347
  cancelableSendPresentationWithRepeatedCalls;
540
348
  callManager;
541
349
  constructor({ callManager: e }) {
542
- this.callManager = e, this.events = new D(nn), this.subscribe();
350
+ this.callManager = e, this.events = new O(q), this.subscribe();
543
351
  }
544
352
  get isPendingPresentation() {
545
353
  return !!this.promisePendingStartPresentation || !!this.promisePendingStopPresentation;
@@ -552,11 +360,11 @@ class rn {
552
360
  sendEncodings: a,
553
361
  onAddedTransceiver: o
554
362
  } = {}, c) {
555
- const T = this.getRtcSessionProtected();
363
+ const g = this.getRtcSessionProtected();
556
364
  if (this.streamPresentationCurrent)
557
365
  throw new Error("Presentation is already started");
558
366
  return this.sendPresentationWithDuplicatedCalls(e, {
559
- rtcSession: T,
367
+ rtcSession: g,
560
368
  stream: t,
561
369
  presentationOptions: {
562
370
  isNeedReinvite: s,
@@ -636,7 +444,7 @@ class rn {
636
444
  stream: s,
637
445
  presentationOptions: i,
638
446
  options: r = {
639
- callLimit: sn
447
+ callLimit: he
640
448
  }
641
449
  }) {
642
450
  const a = async () => this.sendPresentation(
@@ -645,7 +453,7 @@ class rn {
645
453
  s,
646
454
  i
647
455
  ), o = () => !!this.streamPresentationCurrent;
648
- return this.cancelableSendPresentationWithRepeatedCalls = G({
456
+ return this.cancelableSendPresentationWithRepeatedCalls = V({
649
457
  targetFunction: a,
650
458
  isComplete: o,
651
459
  isRejectAsValid: !0,
@@ -664,13 +472,13 @@ class rn {
664
472
  if (c === void 0)
665
473
  throw new Error("No streamPresentationTarget");
666
474
  this.streamPresentationCurrent = c;
667
- const T = e().then(async () => t.startPresentation(c, i, {
475
+ const g = e().then(async () => t.startPresentation(c, i, {
668
476
  sendEncodings: a,
669
477
  onAddedTransceiver: o
670
- })).then(() => s).catch((S) => {
671
- throw this.removeStreamPresentationCurrent(), this.events.trigger(R.FAILED_PRESENTATION, S), S;
478
+ })).then(() => s).catch((d) => {
479
+ throw this.removeStreamPresentationCurrent(), this.events.trigger(R.FAILED_PRESENTATION, d), d;
672
480
  });
673
- return this.promisePendingStartPresentation = T, T.finally(() => {
481
+ return this.promisePendingStartPresentation = g, g.finally(() => {
674
482
  this.promisePendingStartPresentation = void 0;
675
483
  });
676
484
  }
@@ -693,9 +501,9 @@ class rn {
693
501
  delete this.streamPresentationCurrent;
694
502
  }
695
503
  }
696
- const an = "Error decline with 603", on = 1006, cn = (n) => typeof n == "object" && n !== null && "code" in n && n.code === on, Tn = (n) => n.message === an;
697
- var g = /* @__PURE__ */ ((n) => (n.CONTENT_TYPE_NAME = "content-type", n.CONTENT_ENTER_ROOM = "x-webrtc-enter-room", n.CONTENT_USE_LICENSE = "X-WEBRTC-USE-LICENSE", n.PARTICIPANT_NAME = "X-WEBRTC-PARTICIPANT-NAME", n.INPUT_CHANNELS = "X-WEBRTC-INPUT-CHANNELS", n.OUTPUT_CHANNELS = "X-WEBRTC-OUTPUT-CHANNELS", n.MAIN_CAM = "X-WEBRTC-MAINCAM", n.MIC = "X-WEBRTC-MIC", n.MEDIA_SYNC = "X-WEBRTC-SYNC", n.MAIN_CAM_RESOLUTION = "X-WEBRTC-MAINCAM-RESOLUTION", n.MEDIA_STATE = "X-WEBRTC-MEDIA-STATE", n.MEDIA_TYPE = "X-Vinteo-Media-Type", n.MAIN_CAM_STATE = "X-Vinteo-MainCam-State", n.MIC_STATE = "X-Vinteo-Mic-State", n.CONTENT_PARTICIPANT_STATE = "X-WEBRTC-PARTSTATE", n.NOTIFY = "X-VINTEO-NOTIFY", n.CONTENT_ENABLE_MEDIA_DEVICE = "X-WEBRTC-REQUEST-ENABLE-MEDIA-DEVICE", n.CONTENT_SHARE_STATE = "x-webrtc-share-state", n.MUST_STOP_PRESENTATION_P2P = "x-webrtc-share-state: YOUMUSTSTOPSENDCONTENT", n.START_PRESENTATION_P2P = "x-webrtc-share-state: YOUCANRECEIVECONTENT", n.STOP_PRESENTATION_P2P = "x-webrtc-share-state: CONTENTEND", n.STOP_PRESENTATION = "x-webrtc-share-state: STOPPRESENTATION", n.START_PRESENTATION = "x-webrtc-share-state: LETMESTARTPRESENTATION", n.ENABLE_MAIN_CAM = "X-WEBRTC-REQUEST-ENABLE-MEDIA-DEVICE: LETMESTARTMAINCAM", n))(g || {}), y = /* @__PURE__ */ ((n) => (n.AVAILABLE_SECOND_REMOTE_STREAM = "YOUCANRECEIVECONTENT", n.NOT_AVAILABLE_SECOND_REMOTE_STREAM = "CONTENTEND", n.MUST_STOP_PRESENTATION = "YOUMUSTSTOPSENDCONTENT", n))(y || {}), w = /* @__PURE__ */ ((n) => (n.SPECTATOR = "SPECTATOR", n.PARTICIPANT = "PARTICIPANT", n))(w || {}), M = /* @__PURE__ */ ((n) => (n.ENTER_ROOM = "application/vinteo.webrtc.roomname", n.MIC = "application/vinteo.webrtc.mic", n.USE_LICENSE = "application/vinteo.webrtc.uselic", n.PARTICIPANT_STATE = "application/vinteo.webrtc.partstate", n.NOTIFY = "application/vinteo.webrtc.notify", n.SHARE_STATE = "application/vinteo.webrtc.sharedesktop", n.MAIN_CAM = "application/vinteo.webrtc.maincam", n))(M || {}), u = /* @__PURE__ */ ((n) => (n.CHANNELS = "application/vinteo.webrtc.channels", n.MEDIA_STATE = "application/vinteo.webrtc.mediastate", n.REFUSAL = "application/vinteo.webrtc.refusal", n.SHARE_STATE = "application/vinteo.webrtc.sharedesktop", n.MAIN_CAM = "application/vinteo.webrtc.maincam", n))(u || {}), m = /* @__PURE__ */ ((n) => (n.PAUSE_MAIN_CAM = "PAUSEMAINCAM", n.RESUME_MAIN_CAM = "RESUMEMAINCAM", n.MAX_MAIN_CAM_RESOLUTION = "MAXMAINCAMRESOLUTION", n.ADMIN_STOP_MAIN_CAM = "ADMINSTOPMAINCAM", n.ADMIN_START_MAIN_CAM = "ADMINSTARTMAINCAM", n))(m || {}), L = /* @__PURE__ */ ((n) => (n.ADMIN_STOP_MIC = "ADMINSTOPMIC", n.ADMIN_START_MIC = "ADMINSTARTMIC", n))(L || {}), F = /* @__PURE__ */ ((n) => (n.ADMIN_SYNC_FORCED = "1", n.ADMIN_SYNC_NOT_FORCED = "0", n))(F || {}), E = /* @__PURE__ */ ((n) => (n.CHANNELS_NOTIFY = "channels:notify", n.PARTICIPANT_ADDED_TO_LIST_MODERATORS = "participant:added-to-list-moderators", n.PARTICIPANT_REMOVED_FROM_LIST_MODERATORS = "participant:removed-from-list-moderators", n.PARTICIPANT_MOVE_REQUEST_TO_STREAM = "participant:move-request-to-stream", n.PARTICIPANT_MOVE_REQUEST_TO_SPECTATORS = "participant:move-request-to-spectators", n.PARTICIPANT_MOVE_REQUEST_TO_PARTICIPANTS = "participant:move-request-to-participants", n.PARTICIPATION_ACCEPTING_WORD_REQUEST = "participation:accepting-word-request", n.PARTICIPATION_CANCELLING_WORD_REQUEST = "participation:cancelling-word-request", n.WEBCAST_STARTED = "webcast:started", n.WEBCAST_STOPPED = "webcast:stopped", n.ACCOUNT_CHANGED = "account:changed", n.ACCOUNT_DELETED = "account:deleted", n.CONFERENCE_PARTICIPANT_TOKEN_ISSUED = "conference:participant-token-issued", n.CHANNELS = "channels", n.ENTER_ROOM = "enterRoom", n.SHARE_STATE = "shareState", n.MAIN_CAM_CONTROL = "main-cam-control", n.USE_LICENSE = "useLicense", n.ADMIN_START_MAIN_CAM = "admin-start-main-cam", n.ADMIN_STOP_MAIN_CAM = "admin-stop-main-cam", n.ADMIN_START_MIC = "admin-start-mic", n.ADMIN_STOP_MIC = "admin-stop-mic", n.ADMIN_FORCE_SYNC_MEDIA_STATE = "admin-force-sync-media-state", n.AVAILABLE_SECOND_REMOTE_STREAM = "availableSecondRemoteStream", n.NOT_AVAILABLE_SECOND_REMOTE_STREAM = "notAvailableSecondRemoteStream", n.MUST_STOP_PRESENTATION = "mustStopPresentation", n.NEW_DTMF = "newDTMF", n))(E || {});
698
- const En = [
504
+ const de = "Error decline with 603", le = 1006, Ee = (n) => typeof n == "object" && n !== null && "code" in n && n.code === le, Se = (n) => n.message === de;
505
+ var T = /* @__PURE__ */ ((n) => (n.CONTENT_TYPE_NAME = "content-type", n.CONTENT_ENTER_ROOM = "x-webrtc-enter-room", n.CONTENT_USE_LICENSE = "X-WEBRTC-USE-LICENSE", n.PARTICIPANT_NAME = "X-WEBRTC-PARTICIPANT-NAME", n.INPUT_CHANNELS = "X-WEBRTC-INPUT-CHANNELS", n.OUTPUT_CHANNELS = "X-WEBRTC-OUTPUT-CHANNELS", n.MAIN_CAM = "X-WEBRTC-MAINCAM", n.MIC = "X-WEBRTC-MIC", n.MEDIA_SYNC = "X-WEBRTC-SYNC", n.MAIN_CAM_RESOLUTION = "X-WEBRTC-MAINCAM-RESOLUTION", n.MEDIA_STATE = "X-WEBRTC-MEDIA-STATE", n.MEDIA_TYPE = "X-Vinteo-Media-Type", n.MAIN_CAM_STATE = "X-Vinteo-MainCam-State", n.MIC_STATE = "X-Vinteo-Mic-State", n.CONTENT_PARTICIPANT_STATE = "X-WEBRTC-PARTSTATE", n.NOTIFY = "X-VINTEO-NOTIFY", n.CONTENT_ENABLE_MEDIA_DEVICE = "X-WEBRTC-REQUEST-ENABLE-MEDIA-DEVICE", n.CONTENT_SHARE_STATE = "x-webrtc-share-state", n.MUST_STOP_PRESENTATION_P2P = "x-webrtc-share-state: YOUMUSTSTOPSENDCONTENT", n.START_PRESENTATION_P2P = "x-webrtc-share-state: YOUCANRECEIVECONTENT", n.STOP_PRESENTATION_P2P = "x-webrtc-share-state: CONTENTEND", n.STOP_PRESENTATION = "x-webrtc-share-state: STOPPRESENTATION", n.START_PRESENTATION = "x-webrtc-share-state: LETMESTARTPRESENTATION", n.ENABLE_MAIN_CAM = "X-WEBRTC-REQUEST-ENABLE-MEDIA-DEVICE: LETMESTARTMAINCAM", n))(T || {}), y = /* @__PURE__ */ ((n) => (n.AVAILABLE_SECOND_REMOTE_STREAM = "YOUCANRECEIVECONTENT", n.NOT_AVAILABLE_SECOND_REMOTE_STREAM = "CONTENTEND", n.MUST_STOP_PRESENTATION = "YOUMUSTSTOPSENDCONTENT", n))(y || {}), w = /* @__PURE__ */ ((n) => (n.SPECTATOR = "SPECTATOR", n.PARTICIPANT = "PARTICIPANT", n))(w || {}), M = /* @__PURE__ */ ((n) => (n.ENTER_ROOM = "application/vinteo.webrtc.roomname", n.MIC = "application/vinteo.webrtc.mic", n.USE_LICENSE = "application/vinteo.webrtc.uselic", n.PARTICIPANT_STATE = "application/vinteo.webrtc.partstate", n.NOTIFY = "application/vinteo.webrtc.notify", n.SHARE_STATE = "application/vinteo.webrtc.sharedesktop", n.MAIN_CAM = "application/vinteo.webrtc.maincam", n))(M || {}), _ = /* @__PURE__ */ ((n) => (n.CHANNELS = "application/vinteo.webrtc.channels", n.MEDIA_STATE = "application/vinteo.webrtc.mediastate", n.REFUSAL = "application/vinteo.webrtc.refusal", n.SHARE_STATE = "application/vinteo.webrtc.sharedesktop", n.MAIN_CAM = "application/vinteo.webrtc.maincam", n))(_ || {}), f = /* @__PURE__ */ ((n) => (n.PAUSE_MAIN_CAM = "PAUSEMAINCAM", n.RESUME_MAIN_CAM = "RESUMEMAINCAM", n.MAX_MAIN_CAM_RESOLUTION = "MAXMAINCAMRESOLUTION", n.ADMIN_STOP_MAIN_CAM = "ADMINSTOPMAINCAM", n.ADMIN_START_MAIN_CAM = "ADMINSTARTMAINCAM", n))(f || {}), L = /* @__PURE__ */ ((n) => (n.ADMIN_STOP_MIC = "ADMINSTOPMIC", n.ADMIN_START_MIC = "ADMINSTARTMIC", n))(L || {}), F = /* @__PURE__ */ ((n) => (n.ADMIN_SYNC_FORCED = "1", n.ADMIN_SYNC_NOT_FORCED = "0", n))(F || {}), h = /* @__PURE__ */ ((n) => (n.CHANNELS_NOTIFY = "channels:notify", n.PARTICIPANT_ADDED_TO_LIST_MODERATORS = "participant:added-to-list-moderators", n.PARTICIPANT_REMOVED_FROM_LIST_MODERATORS = "participant:removed-from-list-moderators", n.PARTICIPANT_MOVE_REQUEST_TO_STREAM = "participant:move-request-to-stream", n.PARTICIPANT_MOVE_REQUEST_TO_SPECTATORS = "participant:move-request-to-spectators", n.PARTICIPANT_MOVE_REQUEST_TO_PARTICIPANTS = "participant:move-request-to-participants", n.PARTICIPATION_ACCEPTING_WORD_REQUEST = "participation:accepting-word-request", n.PARTICIPATION_CANCELLING_WORD_REQUEST = "participation:cancelling-word-request", n.WEBCAST_STARTED = "webcast:started", n.WEBCAST_STOPPED = "webcast:stopped", n.ACCOUNT_CHANGED = "account:changed", n.ACCOUNT_DELETED = "account:deleted", n.CONFERENCE_PARTICIPANT_TOKEN_ISSUED = "conference:participant-token-issued", n.CHANNELS = "channels", n.ENTER_ROOM = "enterRoom", n.SHARE_STATE = "shareState", n.MAIN_CAM_CONTROL = "main-cam-control", n.USE_LICENSE = "useLicense", n.ADMIN_START_MAIN_CAM = "admin-start-main-cam", n.ADMIN_STOP_MAIN_CAM = "admin-stop-main-cam", n.ADMIN_START_MIC = "admin-start-mic", n.ADMIN_STOP_MIC = "admin-stop-mic", n.ADMIN_FORCE_SYNC_MEDIA_STATE = "admin-force-sync-media-state", n.AVAILABLE_SECOND_REMOTE_STREAM = "availableSecondRemoteStream", n.NOT_AVAILABLE_SECOND_REMOTE_STREAM = "notAvailableSecondRemoteStream", n.MUST_STOP_PRESENTATION = "mustStopPresentation", n.NEW_DTMF = "newDTMF", n))(h || {});
506
+ const Y = [
699
507
  "participation:accepting-word-request",
700
508
  "participation:cancelling-word-request",
701
509
  "participant:move-request-to-stream",
@@ -724,8 +532,8 @@ const En = [
724
532
  "mustStopPresentation",
725
533
  "newDTMF"
726
534
  ];
727
- var _ = /* @__PURE__ */ ((n) => (n.CHANNELS = "channels", n.WEBCAST_STARTED = "WebcastStarted", n.WEBCAST_STOPPED = "WebcastStopped", n.ACCOUNT_CHANGED = "accountChanged", n.ACCOUNT_DELETED = "accountDeleted", n.ADDED_TO_LIST_MODERATORS = "addedToListModerators", n.REMOVED_FROM_LIST_MODERATORS = "removedFromListModerators", n.ACCEPTING_WORD_REQUEST = "ParticipationRequestAccepted", n.CANCELLING_WORD_REQUEST = "ParticipationRequestRejected", n.MOVE_REQUEST_TO_STREAM = "ParticipantMovedToWebcast", n.CONFERENCE_PARTICIPANT_TOKEN_ISSUED = "ConferenceParticipantTokenIssued", n))(_ || {});
728
- class gn {
535
+ var A = /* @__PURE__ */ ((n) => (n.CHANNELS = "channels", n.WEBCAST_STARTED = "WebcastStarted", n.WEBCAST_STOPPED = "WebcastStopped", n.ACCOUNT_CHANGED = "accountChanged", n.ACCOUNT_DELETED = "accountDeleted", n.ADDED_TO_LIST_MODERATORS = "addedToListModerators", n.REMOVED_FROM_LIST_MODERATORS = "removedFromListModerators", n.ACCEPTING_WORD_REQUEST = "ParticipationRequestAccepted", n.CANCELLING_WORD_REQUEST = "ParticipationRequestRejected", n.MOVE_REQUEST_TO_STREAM = "ParticipantMovedToWebcast", n.CONFERENCE_PARTICIPANT_TOKEN_ISSUED = "ConferenceParticipantTokenIssued", n))(A || {});
536
+ class Ce {
729
537
  events;
730
538
  connectionManager;
731
539
  callManager;
@@ -733,13 +541,13 @@ class gn {
733
541
  connectionManager: e,
734
542
  callManager: t
735
543
  }) {
736
- this.connectionManager = e, this.callManager = t, this.events = new D(En), this.subscribe();
544
+ this.connectionManager = e, this.callManager = t, this.events = new O(Y), this.subscribe();
737
545
  }
738
546
  async waitChannels() {
739
- return this.wait(E.CHANNELS);
547
+ return this.wait(h.CHANNELS);
740
548
  }
741
549
  async waitSyncMediaState() {
742
- return this.wait(E.ADMIN_FORCE_SYNC_MEDIA_STATE);
550
+ return this.wait(h.ADMIN_FORCE_SYNC_MEDIA_STATE);
743
551
  }
744
552
  async sendDTMF(e) {
745
553
  return new Promise((t, s) => {
@@ -760,22 +568,22 @@ class gn {
760
568
  const s = this.callManager.getEstablishedRTCSession();
761
569
  if (!s)
762
570
  throw new Error("No rtcSession established");
763
- const i = `${g.INPUT_CHANNELS}: ${e}`, r = `${g.OUTPUT_CHANNELS}: ${t}`, a = [
571
+ const i = `${T.INPUT_CHANNELS}: ${e}`, r = `${T.OUTPUT_CHANNELS}: ${t}`, a = [
764
572
  i,
765
573
  r
766
574
  ];
767
- return s.sendInfo(u.CHANNELS, void 0, { extraHeaders: a });
575
+ return s.sendInfo(_.CHANNELS, void 0, { extraHeaders: a });
768
576
  }
769
577
  async sendMediaState({ cam: e, mic: t }, s = {}) {
770
578
  const i = this.callManager.getEstablishedRTCSession();
771
579
  if (!i)
772
580
  throw new Error("No rtcSession established");
773
- const r = `${g.MEDIA_STATE}: currentstate`, a = `${g.MAIN_CAM_STATE}: ${Number(e)}`, o = `${g.MIC_STATE}: ${Number(t)}`, c = [
581
+ const r = `${T.MEDIA_STATE}: currentstate`, a = `${T.MAIN_CAM_STATE}: ${Number(e)}`, o = `${T.MIC_STATE}: ${Number(t)}`, c = [
774
582
  r,
775
583
  a,
776
584
  o
777
585
  ];
778
- return i.sendInfo(u.MEDIA_STATE, void 0, {
586
+ return i.sendInfo(_.MEDIA_STATE, void 0, {
779
587
  noTerminateWhenError: !0,
780
588
  ...s,
781
589
  extraHeaders: c
@@ -785,8 +593,8 @@ class gn {
785
593
  const s = this.callManager.getEstablishedRTCSession();
786
594
  if (!s)
787
595
  throw new Error("No rtcSession established");
788
- const a = e === "mic" ? 0 : 1, c = [`${g.MEDIA_TYPE}: ${a}`];
789
- return s.sendInfo(u.REFUSAL, void 0, {
596
+ const a = e === "mic" ? 0 : 1, c = [`${T.MEDIA_TYPE}: ${a}`];
597
+ return s.sendInfo(_.REFUSAL, void 0, {
790
598
  noTerminateWhenError: !0,
791
599
  ...t,
792
600
  extraHeaders: c
@@ -806,53 +614,53 @@ class gn {
806
614
  const e = this.callManager.getEstablishedRTCSession();
807
615
  if (!e)
808
616
  throw new Error("No rtcSession established");
809
- await e.sendInfo(u.SHARE_STATE, void 0, {
810
- extraHeaders: [g.MUST_STOP_PRESENTATION_P2P]
617
+ await e.sendInfo(_.SHARE_STATE, void 0, {
618
+ extraHeaders: [T.MUST_STOP_PRESENTATION_P2P]
811
619
  });
812
620
  }
813
621
  async sendStoppedPresentationP2P() {
814
622
  const e = this.callManager.getEstablishedRTCSession();
815
623
  if (!e)
816
624
  throw new Error("No rtcSession established");
817
- await e.sendInfo(u.SHARE_STATE, void 0, {
818
- extraHeaders: [g.STOP_PRESENTATION_P2P]
625
+ await e.sendInfo(_.SHARE_STATE, void 0, {
626
+ extraHeaders: [T.STOP_PRESENTATION_P2P]
819
627
  });
820
628
  }
821
629
  async sendStoppedPresentation() {
822
630
  const e = this.callManager.getEstablishedRTCSession();
823
631
  if (!e)
824
632
  throw new Error("No rtcSession established");
825
- await e.sendInfo(u.SHARE_STATE, void 0, {
826
- extraHeaders: [g.STOP_PRESENTATION]
633
+ await e.sendInfo(_.SHARE_STATE, void 0, {
634
+ extraHeaders: [T.STOP_PRESENTATION]
827
635
  });
828
636
  }
829
637
  async askPermissionToStartPresentationP2P() {
830
638
  const e = this.callManager.getEstablishedRTCSession();
831
639
  if (!e)
832
640
  throw new Error("No rtcSession established");
833
- await e.sendInfo(u.SHARE_STATE, void 0, {
834
- extraHeaders: [g.START_PRESENTATION_P2P]
641
+ await e.sendInfo(_.SHARE_STATE, void 0, {
642
+ extraHeaders: [T.START_PRESENTATION_P2P]
835
643
  });
836
644
  }
837
645
  async askPermissionToStartPresentation() {
838
646
  const e = this.callManager.getEstablishedRTCSession();
839
647
  if (!e)
840
648
  throw new Error("No rtcSession established");
841
- await e.sendInfo(u.SHARE_STATE, void 0, {
842
- extraHeaders: [g.START_PRESENTATION]
649
+ await e.sendInfo(_.SHARE_STATE, void 0, {
650
+ extraHeaders: [T.START_PRESENTATION]
843
651
  });
844
652
  }
845
653
  async askPermissionToEnableCam(e = {}) {
846
654
  const t = this.callManager.getEstablishedRTCSession();
847
655
  if (!t)
848
656
  throw new Error("No rtcSession established");
849
- const s = [g.ENABLE_MAIN_CAM];
850
- return t.sendInfo(u.MAIN_CAM, void 0, {
657
+ const s = [T.ENABLE_MAIN_CAM];
658
+ return t.sendInfo(_.MAIN_CAM, void 0, {
851
659
  noTerminateWhenError: !0,
852
660
  ...e,
853
661
  extraHeaders: s
854
662
  }).catch((i) => {
855
- if (Tn(i))
663
+ if (Se(i))
856
664
  throw i;
857
665
  });
858
666
  }
@@ -885,7 +693,7 @@ class gn {
885
693
  };
886
694
  maybeHandleNotify = (e) => {
887
695
  try {
888
- const t = e.getHeader(g.NOTIFY);
696
+ const t = e.getHeader(T.NOTIFY);
889
697
  if (t) {
890
698
  const s = JSON.parse(t);
891
699
  this.handleNotify(s);
@@ -896,55 +704,55 @@ class gn {
896
704
  };
897
705
  handleNotify = (e) => {
898
706
  switch (e.cmd) {
899
- case _.CHANNELS: {
707
+ case A.CHANNELS: {
900
708
  const t = e;
901
709
  this.triggerChannelsNotify(t);
902
710
  break;
903
711
  }
904
- case _.WEBCAST_STARTED: {
712
+ case A.WEBCAST_STARTED: {
905
713
  const t = e;
906
714
  this.triggerWebcastStartedNotify(t);
907
715
  break;
908
716
  }
909
- case _.WEBCAST_STOPPED: {
717
+ case A.WEBCAST_STOPPED: {
910
718
  const t = e;
911
719
  this.triggerWebcastStoppedNotify(t);
912
720
  break;
913
721
  }
914
- case _.ADDED_TO_LIST_MODERATORS: {
722
+ case A.ADDED_TO_LIST_MODERATORS: {
915
723
  const t = e;
916
724
  this.triggerAddedToListModeratorsNotify(t);
917
725
  break;
918
726
  }
919
- case _.REMOVED_FROM_LIST_MODERATORS: {
727
+ case A.REMOVED_FROM_LIST_MODERATORS: {
920
728
  const t = e;
921
729
  this.triggerRemovedFromListModeratorsNotify(t);
922
730
  break;
923
731
  }
924
- case _.ACCEPTING_WORD_REQUEST: {
732
+ case A.ACCEPTING_WORD_REQUEST: {
925
733
  const t = e;
926
734
  this.triggerParticipationAcceptingWordRequest(t);
927
735
  break;
928
736
  }
929
- case _.CANCELLING_WORD_REQUEST: {
737
+ case A.CANCELLING_WORD_REQUEST: {
930
738
  const t = e;
931
739
  this.triggerParticipationCancellingWordRequest(t);
932
740
  break;
933
741
  }
934
- case _.MOVE_REQUEST_TO_STREAM: {
742
+ case A.MOVE_REQUEST_TO_STREAM: {
935
743
  const t = e;
936
744
  this.triggerParticipantMoveRequestToStream(t);
937
745
  break;
938
746
  }
939
- case _.ACCOUNT_CHANGED: {
747
+ case A.ACCOUNT_CHANGED: {
940
748
  this.triggerAccountChangedNotify();
941
749
  break;
942
750
  }
943
- case _.ACCOUNT_DELETED: {
751
+ case A.ACCOUNT_DELETED: {
944
752
  this.triggerAccountDeletedNotify();
945
753
  break;
946
754
  }
947
- case _.CONFERENCE_PARTICIPANT_TOKEN_ISSUED: {
755
+ case A.CONFERENCE_PARTICIPANT_TOKEN_ISSUED: {
948
756
  const t = e;
949
757
  this.triggerConferenceParticipantTokenIssued(t);
950
758
  break;
@@ -957,7 +765,7 @@ class gn {
957
765
  const { originator: t } = e;
958
766
  if (t !== U.REMOTE)
959
767
  return;
960
- const { request: s } = e, i = s.getHeader(g.CONTENT_TYPE_NAME);
768
+ const { request: s } = e, i = s.getHeader(T.CONTENT_TYPE_NAME);
961
769
  if (i !== void 0)
962
770
  switch (i) {
963
771
  case M.ENTER_ROOM: {
@@ -995,7 +803,7 @@ class gn {
995
803
  inputChannels: t,
996
804
  outputChannels: s
997
805
  };
998
- this.events.trigger(E.CHANNELS_NOTIFY, i);
806
+ this.events.trigger(h.CHANNELS_NOTIFY, i);
999
807
  };
1000
808
  triggerWebcastStartedNotify = ({
1001
809
  body: { conference: e, type: t }
@@ -1004,7 +812,7 @@ class gn {
1004
812
  conference: e,
1005
813
  type: t
1006
814
  };
1007
- this.events.trigger(E.WEBCAST_STARTED, s);
815
+ this.events.trigger(h.WEBCAST_STARTED, s);
1008
816
  };
1009
817
  triggerWebcastStoppedNotify = ({
1010
818
  body: { conference: e, type: t }
@@ -1013,7 +821,7 @@ class gn {
1013
821
  conference: e,
1014
822
  type: t
1015
823
  };
1016
- this.events.trigger(E.WEBCAST_STOPPED, s);
824
+ this.events.trigger(h.WEBCAST_STOPPED, s);
1017
825
  };
1018
826
  triggerAddedToListModeratorsNotify = ({
1019
827
  conference: e
@@ -1022,7 +830,7 @@ class gn {
1022
830
  conference: e
1023
831
  };
1024
832
  this.events.trigger(
1025
- E.PARTICIPANT_ADDED_TO_LIST_MODERATORS,
833
+ h.PARTICIPANT_ADDED_TO_LIST_MODERATORS,
1026
834
  t
1027
835
  );
1028
836
  };
@@ -1033,7 +841,7 @@ class gn {
1033
841
  conference: e
1034
842
  };
1035
843
  this.events.trigger(
1036
- E.PARTICIPANT_REMOVED_FROM_LIST_MODERATORS,
844
+ h.PARTICIPANT_REMOVED_FROM_LIST_MODERATORS,
1037
845
  t
1038
846
  );
1039
847
  };
@@ -1043,7 +851,7 @@ class gn {
1043
851
  const t = {
1044
852
  conference: e
1045
853
  };
1046
- this.events.trigger(E.PARTICIPATION_ACCEPTING_WORD_REQUEST, t);
854
+ this.events.trigger(h.PARTICIPATION_ACCEPTING_WORD_REQUEST, t);
1047
855
  };
1048
856
  triggerParticipationCancellingWordRequest = ({
1049
857
  body: { conference: e }
@@ -1051,7 +859,7 @@ class gn {
1051
859
  const t = {
1052
860
  conference: e
1053
861
  };
1054
- this.events.trigger(E.PARTICIPATION_CANCELLING_WORD_REQUEST, t);
862
+ this.events.trigger(h.PARTICIPATION_CANCELLING_WORD_REQUEST, t);
1055
863
  };
1056
864
  triggerParticipantMoveRequestToStream = ({
1057
865
  body: { conference: e }
@@ -1059,13 +867,13 @@ class gn {
1059
867
  const t = {
1060
868
  conference: e
1061
869
  };
1062
- this.events.trigger(E.PARTICIPANT_MOVE_REQUEST_TO_STREAM, t);
870
+ this.events.trigger(h.PARTICIPANT_MOVE_REQUEST_TO_STREAM, t);
1063
871
  };
1064
872
  triggerAccountChangedNotify = () => {
1065
- this.events.trigger(E.ACCOUNT_CHANGED, void 0);
873
+ this.events.trigger(h.ACCOUNT_CHANGED, void 0);
1066
874
  };
1067
875
  triggerAccountDeletedNotify = () => {
1068
- this.events.trigger(E.ACCOUNT_DELETED, void 0);
876
+ this.events.trigger(h.ACCOUNT_DELETED, void 0);
1069
877
  };
1070
878
  triggerConferenceParticipantTokenIssued = ({
1071
879
  body: { conference: e, participant: t, jwt: s }
@@ -1076,73 +884,73 @@ class gn {
1076
884
  jwt: s
1077
885
  };
1078
886
  this.events.trigger(
1079
- E.CONFERENCE_PARTICIPANT_TOKEN_ISSUED,
887
+ h.CONFERENCE_PARTICIPANT_TOKEN_ISSUED,
1080
888
  i
1081
889
  );
1082
890
  };
1083
891
  maybeTriggerChannels = (e) => {
1084
- const t = e.getHeader(g.INPUT_CHANNELS), s = e.getHeader(g.OUTPUT_CHANNELS);
892
+ const t = e.getHeader(T.INPUT_CHANNELS), s = e.getHeader(T.OUTPUT_CHANNELS);
1085
893
  if (t && s) {
1086
894
  const i = {
1087
895
  inputChannels: t,
1088
896
  outputChannels: s
1089
897
  };
1090
- this.events.trigger(E.CHANNELS, i);
898
+ this.events.trigger(h.CHANNELS, i);
1091
899
  }
1092
900
  };
1093
901
  triggerEnterRoom = (e) => {
1094
- const t = e.getHeader(g.CONTENT_ENTER_ROOM), s = e.getHeader(g.PARTICIPANT_NAME);
1095
- this.events.trigger(E.ENTER_ROOM, { room: t, participantName: s });
902
+ const t = e.getHeader(T.CONTENT_ENTER_ROOM), s = e.getHeader(T.PARTICIPANT_NAME);
903
+ this.events.trigger(h.ENTER_ROOM, { room: t, participantName: s });
1096
904
  };
1097
905
  triggerShareState = (e) => {
1098
- const t = e.getHeader(g.CONTENT_SHARE_STATE);
906
+ const t = e.getHeader(T.CONTENT_SHARE_STATE);
1099
907
  if (t !== void 0)
1100
908
  switch (t) {
1101
909
  case y.AVAILABLE_SECOND_REMOTE_STREAM: {
1102
- this.events.trigger(E.AVAILABLE_SECOND_REMOTE_STREAM, void 0);
910
+ this.events.trigger(h.AVAILABLE_SECOND_REMOTE_STREAM, void 0);
1103
911
  break;
1104
912
  }
1105
913
  case y.NOT_AVAILABLE_SECOND_REMOTE_STREAM: {
1106
- this.events.trigger(E.NOT_AVAILABLE_SECOND_REMOTE_STREAM, void 0);
914
+ this.events.trigger(h.NOT_AVAILABLE_SECOND_REMOTE_STREAM, void 0);
1107
915
  break;
1108
916
  }
1109
917
  case y.MUST_STOP_PRESENTATION: {
1110
- this.events.trigger(E.MUST_STOP_PRESENTATION, void 0);
918
+ this.events.trigger(h.MUST_STOP_PRESENTATION, void 0);
1111
919
  break;
1112
920
  }
1113
921
  }
1114
922
  };
1115
923
  maybeTriggerParticipantMoveRequest = (e) => {
1116
- const t = e.getHeader(g.CONTENT_PARTICIPANT_STATE);
1117
- t === w.SPECTATOR && this.events.trigger(E.PARTICIPANT_MOVE_REQUEST_TO_SPECTATORS, void 0), t === w.PARTICIPANT && this.events.trigger(E.PARTICIPANT_MOVE_REQUEST_TO_PARTICIPANTS, void 0);
924
+ const t = e.getHeader(T.CONTENT_PARTICIPANT_STATE);
925
+ t === w.SPECTATOR && this.events.trigger(h.PARTICIPANT_MOVE_REQUEST_TO_SPECTATORS, void 0), t === w.PARTICIPANT && this.events.trigger(h.PARTICIPANT_MOVE_REQUEST_TO_PARTICIPANTS, void 0);
1118
926
  };
1119
927
  triggerMainCamControl = (e) => {
1120
- const t = e.getHeader(g.MAIN_CAM), s = e.getHeader(g.MEDIA_SYNC), i = s === F.ADMIN_SYNC_FORCED;
1121
- if (t === m.ADMIN_START_MAIN_CAM) {
1122
- this.events.trigger(E.ADMIN_START_MAIN_CAM, { isSyncForced: i });
928
+ const t = e.getHeader(T.MAIN_CAM), s = e.getHeader(T.MEDIA_SYNC), i = s === F.ADMIN_SYNC_FORCED;
929
+ if (t === f.ADMIN_START_MAIN_CAM) {
930
+ this.events.trigger(h.ADMIN_START_MAIN_CAM, { isSyncForced: i });
1123
931
  return;
1124
932
  }
1125
- if (t === m.ADMIN_STOP_MAIN_CAM) {
1126
- this.events.trigger(E.ADMIN_STOP_MAIN_CAM, { isSyncForced: i });
933
+ if (t === f.ADMIN_STOP_MAIN_CAM) {
934
+ this.events.trigger(h.ADMIN_STOP_MAIN_CAM, { isSyncForced: i });
1127
935
  return;
1128
936
  }
1129
- (t === m.RESUME_MAIN_CAM || t === m.PAUSE_MAIN_CAM) && s !== void 0 && this.events.trigger(E.ADMIN_FORCE_SYNC_MEDIA_STATE, { isSyncForced: i });
1130
- const r = e.getHeader(g.MAIN_CAM_RESOLUTION);
1131
- this.events.trigger(E.MAIN_CAM_CONTROL, {
937
+ (t === f.RESUME_MAIN_CAM || t === f.PAUSE_MAIN_CAM) && s !== void 0 && this.events.trigger(h.ADMIN_FORCE_SYNC_MEDIA_STATE, { isSyncForced: i });
938
+ const r = e.getHeader(T.MAIN_CAM_RESOLUTION);
939
+ this.events.trigger(h.MAIN_CAM_CONTROL, {
1132
940
  mainCam: t,
1133
941
  resolutionMainCam: r
1134
942
  });
1135
943
  };
1136
944
  triggerMicControl = (e) => {
1137
- const t = e.getHeader(g.MIC), i = e.getHeader(g.MEDIA_SYNC) === F.ADMIN_SYNC_FORCED;
1138
- t === L.ADMIN_START_MIC ? this.events.trigger(E.ADMIN_START_MIC, { isSyncForced: i }) : t === L.ADMIN_STOP_MIC && this.events.trigger(E.ADMIN_STOP_MIC, { isSyncForced: i });
945
+ const t = e.getHeader(T.MIC), i = e.getHeader(T.MEDIA_SYNC) === F.ADMIN_SYNC_FORCED;
946
+ t === L.ADMIN_START_MIC ? this.events.trigger(h.ADMIN_START_MIC, { isSyncForced: i }) : t === L.ADMIN_STOP_MIC && this.events.trigger(h.ADMIN_STOP_MIC, { isSyncForced: i });
1139
947
  };
1140
948
  triggerUseLicense = (e) => {
1141
- const t = e.getHeader(g.CONTENT_USE_LICENSE);
1142
- this.events.trigger(E.USE_LICENSE, t);
949
+ const t = e.getHeader(T.CONTENT_USE_LICENSE);
950
+ this.events.trigger(h.USE_LICENSE, t);
1143
951
  };
1144
952
  }
1145
- class Sn {
953
+ class Ne {
1146
954
  data = {};
1147
955
  getUa;
1148
956
  constructor(e) {
@@ -1215,8 +1023,8 @@ class Sn {
1215
1023
  return this.data.register === !0;
1216
1024
  }
1217
1025
  }
1218
- var A = /* @__PURE__ */ ((n) => (n.CONNECTING = "connecting", n.CONNECTED = "connected", n.DISCONNECTED = "disconnected", n.NEW_RTC_SESSION = "newRTCSession", n.REGISTERED = "registered", n.UNREGISTERED = "unregistered", n.REGISTRATION_FAILED = "registrationFailed", n.NEW_MESSAGE = "newMessage", n.SIP_EVENT = "sipEvent", n))(A || {});
1219
- const St = [
1026
+ var u = /* @__PURE__ */ ((n) => (n.CONNECTING = "connecting", n.CONNECTED = "connected", n.DISCONNECTED = "disconnected", n.NEW_RTC_SESSION = "newRTCSession", n.REGISTERED = "registered", n.UNREGISTERED = "unregistered", n.REGISTRATION_FAILED = "registrationFailed", n.NEW_MESSAGE = "newMessage", n.SIP_EVENT = "sipEvent", n))(u || {});
1027
+ const z = [
1220
1028
  "connecting",
1221
1029
  "connected",
1222
1030
  "disconnected",
@@ -1226,8 +1034,8 @@ const St = [
1226
1034
  "registrationFailed",
1227
1035
  "newMessage",
1228
1036
  "sipEvent"
1229
- ], dn = [...St], hn = 3;
1230
- class ln {
1037
+ ], Q = [...z], ue = 3;
1038
+ class Ae {
1231
1039
  cancelableConnectWithRepeatedCalls;
1232
1040
  JsSIP;
1233
1041
  events;
@@ -1253,29 +1061,29 @@ class ln {
1253
1061
  }
1254
1062
  let r = !1;
1255
1063
  const a = this.getConnectionConfiguration();
1256
- e !== void 0 && e !== a.displayName && (r = i.set("display_name", Et(e)), this.updateConnectionConfiguration("displayName", e));
1064
+ e !== void 0 && e !== a.displayName && (r = i.set("display_name", x(e)), this.updateConnectionConfiguration("displayName", e));
1257
1065
  const o = r;
1258
1066
  o ? t(o) : s(new Error("nothing changed"));
1259
1067
  });
1260
1068
  disconnect = async () => {
1261
1069
  const e = new Promise((s) => {
1262
- this.events.once(A.DISCONNECTED, () => {
1070
+ this.events.once(u.DISCONNECTED, () => {
1263
1071
  s();
1264
1072
  });
1265
1073
  }), t = this.getUa();
1266
- return t ? t.stop() : this.events.trigger(A.DISCONNECTED, void 0), e.finally(() => {
1074
+ return t ? t.stop() : this.events.trigger(u.DISCONNECTED, void 0), e.finally(() => {
1267
1075
  this.setUa(void 0), this.stateMachine.reset();
1268
1076
  });
1269
1077
  };
1270
1078
  cancelRequests() {
1271
1079
  this.cancelConnectWithRepeatedCalls();
1272
1080
  }
1273
- connectWithDuplicatedCalls = async (e, { callLimit: t = hn } = {}) => {
1081
+ connectWithDuplicatedCalls = async (e, { callLimit: t = ue } = {}) => {
1274
1082
  const s = async () => this.connectInner(e), i = (r) => {
1275
- const c = this.getUa()?.isConnected() === !0 && this.hasEqualConnectionConfiguration(e), T = r != null && !cn(r);
1276
- return c || T;
1083
+ const c = this.getUa()?.isConnected() === !0 && this.hasEqualConnectionConfiguration(e), g = r != null && !Ee(r);
1084
+ return c || g;
1277
1085
  };
1278
- return this.stateMachine.startConnect(), this.cancelableConnectWithRepeatedCalls = G({
1086
+ return this.stateMachine.startConnect(), this.cancelableConnectWithRepeatedCalls = V({
1279
1087
  targetFunction: s,
1280
1088
  isComplete: i,
1281
1089
  callLimit: t,
@@ -1301,38 +1109,38 @@ class ln {
1301
1109
  sessionTimers: a,
1302
1110
  registerExpires: o,
1303
1111
  connectionRecoveryMinInterval: c,
1304
- connectionRecoveryMaxInterval: T,
1305
- userAgent: S,
1306
- displayName: l = "",
1307
- register: d = !1,
1308
- extraHeaders: h = []
1112
+ connectionRecoveryMaxInterval: g,
1113
+ userAgent: d,
1114
+ displayName: S = "",
1115
+ register: l = !1,
1116
+ extraHeaders: E = []
1309
1117
  }) => {
1310
1118
  this.stateMachine.startInitUa(), this.setConnectionConfiguration({
1311
1119
  sipServerUrl: s,
1312
- displayName: l,
1313
- register: d,
1120
+ displayName: S,
1121
+ register: l,
1314
1122
  user: e,
1315
1123
  password: t
1316
1124
  }), this.getUa() && await this.disconnect();
1317
- const { ua: C, helpers: O } = this.uaFactory.createUAWithConfiguration(
1125
+ const { ua: C, helpers: p } = this.uaFactory.createUAWithConfiguration(
1318
1126
  {
1319
1127
  user: e,
1320
1128
  password: t,
1321
1129
  sipServerUrl: s,
1322
1130
  sipWebSocketServerURL: i,
1323
- displayName: l,
1324
- register: d,
1131
+ displayName: S,
1132
+ register: l,
1325
1133
  sessionTimers: a,
1326
1134
  registerExpires: o,
1327
1135
  connectionRecoveryMinInterval: c,
1328
- connectionRecoveryMaxInterval: T,
1329
- userAgent: S,
1136
+ connectionRecoveryMaxInterval: g,
1137
+ userAgent: d,
1330
1138
  remoteAddress: r,
1331
- extraHeaders: h
1139
+ extraHeaders: E
1332
1140
  },
1333
1141
  this.events
1334
1142
  );
1335
- return this.setUa(C), this.setSipServerUrl(O.getSipServerUrl), this.setSocket(O.socket), C;
1143
+ return this.setUa(C), this.setSipServerUrl(p.getSipServerUrl), this.setSocket(p.socket), C;
1336
1144
  };
1337
1145
  start = async () => new Promise((e, t) => {
1338
1146
  const s = this.getUa();
@@ -1341,15 +1149,15 @@ class ln {
1341
1149
  return;
1342
1150
  }
1343
1151
  let i;
1344
- i = ((c, T) => {
1152
+ i = ((c, g) => {
1345
1153
  if (this.getConnectionConfiguration().register === !0)
1346
- return this.registrationManager.subscribeToStartEvents(c, T);
1347
- const l = A.CONNECTED, d = [A.DISCONNECTED];
1348
- return this.events.on(l, c), d.forEach((h) => {
1349
- this.events.on(h, T);
1154
+ return this.registrationManager.subscribeToStartEvents(c, g);
1155
+ const S = u.CONNECTED, l = [u.DISCONNECTED];
1156
+ return this.events.on(S, c), l.forEach((E) => {
1157
+ this.events.on(E, g);
1350
1158
  }), () => {
1351
- this.events.off(l, c), d.forEach((h) => {
1352
- this.events.off(h, T);
1159
+ this.events.off(S, c), l.forEach((E) => {
1160
+ this.events.off(E, g);
1353
1161
  });
1354
1162
  };
1355
1163
  })(() => {
@@ -1362,8 +1170,8 @@ class ln {
1362
1170
  this.cancelableConnectWithRepeatedCalls?.cancel();
1363
1171
  }
1364
1172
  }
1365
- var dt = /* @__PURE__ */ ((n) => (n.START_CONNECT = "START_CONNECT", n.START_INIT_UA = "START_INIT_UA", n.UA_CONNECTED = "UA_CONNECTED", n.UA_REGISTERED = "UA_REGISTERED", n.UA_UNREGISTERED = "UA_UNREGISTERED", n.UA_DISCONNECTED = "UA_DISCONNECTED", n.CONNECTION_FAILED = "CONNECTION_FAILED", n.RESET = "RESET", n))(dt || {});
1366
- const Cn = lt({
1173
+ var X = /* @__PURE__ */ ((n) => (n.START_CONNECT = "START_CONNECT", n.START_INIT_UA = "START_INIT_UA", n.UA_CONNECTED = "UA_CONNECTED", n.UA_REGISTERED = "UA_REGISTERED", n.UA_UNREGISTERED = "UA_UNREGISTERED", n.UA_DISCONNECTED = "UA_DISCONNECTED", n.CONNECTION_FAILED = "CONNECTION_FAILED", n.RESET = "RESET", n))(X || {});
1174
+ const _e = j({
1367
1175
  types: {
1368
1176
  context: {},
1369
1177
  events: {}
@@ -1677,14 +1485,14 @@ const Cn = lt({
1677
1485
  }
1678
1486
  }
1679
1487
  });
1680
- class Nn {
1488
+ class Ie {
1681
1489
  actor;
1682
1490
  stateChangeListeners = /* @__PURE__ */ new Set();
1683
1491
  events;
1684
1492
  unsubscribeFromEvents;
1685
1493
  actorSubscription;
1686
1494
  constructor(e) {
1687
- this.events = e, this.actor = Ct(Cn), this.actorSubscription = this.actor.subscribe((t) => {
1495
+ this.events = e, this.actor = Z(_e), this.actorSubscription = this.actor.subscribe((t) => {
1688
1496
  const s = t.value;
1689
1497
  this.stateChangeListeners.forEach((i) => {
1690
1498
  i(s);
@@ -1770,7 +1578,7 @@ class Nn {
1770
1578
  return this.actor.getSnapshot().can({ type: e });
1771
1579
  }
1772
1580
  getValidEvents() {
1773
- return Object.values(dt).filter((e) => this.canTransition(e));
1581
+ return Object.values(X).filter((e) => this.canTransition(e));
1774
1582
  }
1775
1583
  hasState(e) {
1776
1584
  return this.actor.getSnapshot().matches(e);
@@ -1839,7 +1647,7 @@ class Nn {
1839
1647
  };
1840
1648
  }
1841
1649
  }
1842
- class An {
1650
+ class Re {
1843
1651
  events;
1844
1652
  getUaProtected;
1845
1653
  constructor(e) {
@@ -1848,13 +1656,13 @@ class An {
1848
1656
  async register() {
1849
1657
  const e = this.getUaProtected();
1850
1658
  return new Promise((t, s) => {
1851
- e.on(A.REGISTERED, t), e.on(A.REGISTRATION_FAILED, s), e.register();
1659
+ e.on(u.REGISTERED, t), e.on(u.REGISTRATION_FAILED, s), e.register();
1852
1660
  });
1853
1661
  }
1854
1662
  async unregister() {
1855
1663
  const e = this.getUaProtected();
1856
1664
  return new Promise((t) => {
1857
- e.on(A.UNREGISTERED, t), e.unregister();
1665
+ e.on(u.UNREGISTERED, t), e.unregister();
1858
1666
  });
1859
1667
  }
1860
1668
  async tryRegister() {
@@ -1866,7 +1674,7 @@ class An {
1866
1674
  return this.register();
1867
1675
  }
1868
1676
  subscribeToStartEvents(e, t) {
1869
- const s = A.REGISTERED, i = [A.REGISTRATION_FAILED, A.DISCONNECTED];
1677
+ const s = u.REGISTERED, i = [u.REGISTRATION_FAILED, u.DISCONNECTED];
1870
1678
  return this.events.on(s, e), i.forEach((r) => {
1871
1679
  this.events.on(r, t);
1872
1680
  }), () => {
@@ -1876,7 +1684,7 @@ class An {
1876
1684
  };
1877
1685
  }
1878
1686
  }
1879
- class _n {
1687
+ class Me {
1880
1688
  uaFactory;
1881
1689
  getUaProtected;
1882
1690
  constructor(e) {
@@ -1922,30 +1730,30 @@ class _n {
1922
1730
  extraHeaders: a
1923
1731
  }) {
1924
1732
  return new Promise((o, c) => {
1925
- const { configuration: T } = this.uaFactory.createConfiguration({
1733
+ const { configuration: g } = this.uaFactory.createConfiguration({
1926
1734
  sipWebSocketServerURL: i,
1927
1735
  displayName: t,
1928
1736
  userAgent: e,
1929
1737
  sipServerUrl: s
1930
- }), S = this.uaFactory.createUA({ ...T, remoteAddress: r, extraHeaders: a }), l = () => {
1931
- const h = new Error("Telephony is not available");
1932
- c(h);
1738
+ }), d = this.uaFactory.createUA({ ...g, remoteAddress: r, extraHeaders: a }), S = () => {
1739
+ const E = new Error("Telephony is not available");
1740
+ c(E);
1933
1741
  };
1934
- S.once(A.DISCONNECTED, l);
1935
- const d = () => {
1936
- S.removeAllListeners(), S.once(A.DISCONNECTED, () => {
1742
+ d.once(u.DISCONNECTED, S);
1743
+ const l = () => {
1744
+ d.removeAllListeners(), d.once(u.DISCONNECTED, () => {
1937
1745
  o();
1938
- }), S.stop();
1746
+ }), d.stop();
1939
1747
  };
1940
- S.once(A.CONNECTED, d), S.start();
1748
+ d.once(u.CONNECTED, l), d.start();
1941
1749
  });
1942
1750
  }
1943
1751
  }
1944
- const un = (n) => {
1752
+ const pe = (n) => {
1945
1753
  const e = [];
1946
1754
  return n !== void 0 && n !== "" && e.push(`X-Vinteo-Remote: ${n}`), e;
1947
1755
  };
1948
- class p {
1756
+ class m {
1949
1757
  JsSIP;
1950
1758
  constructor(e) {
1951
1759
  this.JsSIP = e;
@@ -1970,10 +1778,10 @@ class p {
1970
1778
  throw new Error("user is required for authorized connection");
1971
1779
  }
1972
1780
  static resolveAuthorizationUser(e, t) {
1973
- return e && t !== void 0 && t.trim() !== "" ? t.trim() : `${Jt()}`;
1781
+ return e && t !== void 0 && t.trim() !== "" ? t.trim() : `${se()}`;
1974
1782
  }
1975
1783
  static buildExtraHeaders(e, t) {
1976
- const s = e !== void 0 && e !== "" ? un(e) : [];
1784
+ const s = e !== void 0 && e !== "" ? pe(e) : [];
1977
1785
  return t === void 0 ? s : [...s, ...t];
1978
1786
  }
1979
1787
  createConfiguration({
@@ -1986,40 +1794,40 @@ class p {
1986
1794
  sessionTimers: o = !1,
1987
1795
  registerExpires: c = 300,
1988
1796
  // 5 minutes in sec
1989
- connectionRecoveryMinInterval: T = 2,
1990
- connectionRecoveryMaxInterval: S = 6,
1991
- userAgent: l
1797
+ connectionRecoveryMinInterval: g = 2,
1798
+ connectionRecoveryMaxInterval: d = 6,
1799
+ userAgent: S
1992
1800
  }) {
1993
- p.validateConfiguration({
1801
+ m.validateConfiguration({
1994
1802
  register: a,
1995
1803
  password: t,
1996
1804
  user: e,
1997
1805
  sipServerUrl: r,
1998
1806
  sipWebSocketServerURL: s
1999
1807
  });
2000
- const d = p.resolveAuthorizationUser(a, e), h = Qt(r), I = h(d), C = new this.JsSIP.WebSocketInterface(s);
1808
+ const l = m.resolveAuthorizationUser(a, e), E = te(r), I = E(l), C = new this.JsSIP.WebSocketInterface(s);
2001
1809
  return {
2002
1810
  configuration: {
2003
1811
  password: t,
2004
1812
  register: a,
2005
1813
  uri: I,
2006
- display_name: Et(i),
2007
- user_agent: l,
1814
+ display_name: x(i),
1815
+ user_agent: S,
2008
1816
  sdpSemantics: "unified-plan",
2009
1817
  sockets: [C],
2010
1818
  session_timers: o,
2011
1819
  register_expires: c,
2012
- connection_recovery_min_interval: T,
2013
- connection_recovery_max_interval: S
1820
+ connection_recovery_min_interval: g,
1821
+ connection_recovery_max_interval: d
2014
1822
  },
2015
1823
  helpers: {
2016
1824
  socket: C,
2017
- getSipServerUrl: h
1825
+ getSipServerUrl: E
2018
1826
  }
2019
1827
  };
2020
1828
  }
2021
1829
  createUA({ remoteAddress: e, extraHeaders: t, ...s }) {
2022
- const i = new this.JsSIP.UA(s), r = p.buildExtraHeaders(e, t);
1830
+ const i = new this.JsSIP.UA(s), r = m.buildExtraHeaders(e, t);
2023
1831
  return r.length > 0 && i.registrator().setExtraHeaders(r), i;
2024
1832
  }
2025
1833
  /**
@@ -2032,12 +1840,12 @@ class p {
2032
1840
  extraHeaders: e.extraHeaders
2033
1841
  });
2034
1842
  return t.eachTriggers((a, o) => {
2035
- const c = St.find((T) => T === o);
1843
+ const c = z.find((g) => g === o);
2036
1844
  c && r.on(c, a);
2037
1845
  }), { ua: r, helpers: i };
2038
1846
  }
2039
1847
  }
2040
- class In {
1848
+ class me {
2041
1849
  events;
2042
1850
  ua;
2043
1851
  socket;
@@ -2049,15 +1857,15 @@ class In {
2049
1857
  configurationManager;
2050
1858
  JsSIP;
2051
1859
  constructor({ JsSIP: e }) {
2052
- this.JsSIP = e, this.events = new D(dn), this.uaFactory = new p(e), this.registrationManager = new An({
1860
+ this.JsSIP = e, this.events = new O(Q), this.uaFactory = new m(e), this.registrationManager = new Re({
2053
1861
  events: this.events,
2054
1862
  getUaProtected: this.getUaProtected
2055
- }), this.stateMachine = new Nn(this.events), this.configurationManager = new Sn({
1863
+ }), this.stateMachine = new Ie(this.events), this.configurationManager = new Ne({
2056
1864
  getUa: this.getUa
2057
- }), this.sipOperations = new _n({
1865
+ }), this.sipOperations = new Me({
2058
1866
  uaFactory: this.uaFactory,
2059
1867
  getUaProtected: this.getUaProtected
2060
- }), this.connectionFlow = new ln({
1868
+ }), this.connectionFlow = new Ae({
2061
1869
  JsSIP: this.JsSIP,
2062
1870
  events: this.events,
2063
1871
  uaFactory: this.uaFactory,
@@ -2095,7 +1903,7 @@ class In {
2095
1903
  return this.stateMachine.state;
2096
1904
  }
2097
1905
  get isRegistered() {
2098
- return p.isRegisteredUA(this.ua);
1906
+ return m.isRegisteredUA(this.ua);
2099
1907
  }
2100
1908
  get isRegisterConfig() {
2101
1909
  return this.configurationManager.isRegister();
@@ -2148,19 +1956,19 @@ class In {
2148
1956
  };
2149
1957
  getUa = () => this.ua;
2150
1958
  }
2151
- var f = /* @__PURE__ */ ((n) => (n.INCOMING_CALL = "incomingCall", n.DECLINED_INCOMING_CALL = "declinedIncomingCall", n.TERMINATED_INCOMING_CALL = "terminatedIncomingCall", n.FAILED_INCOMING_CALL = "failedIncomingCall", n))(f || {}), $ = /* @__PURE__ */ ((n) => (n.LOCAL = "local", n.REMOTE = "remote", n.SYSTEM = "system", n))($ || {});
2152
- const Rn = [
1959
+ var D = /* @__PURE__ */ ((n) => (n.INCOMING_CALL = "incomingCall", n.DECLINED_INCOMING_CALL = "declinedIncomingCall", n.TERMINATED_INCOMING_CALL = "terminatedIncomingCall", n.FAILED_INCOMING_CALL = "failedIncomingCall", n))(D || {}), $ = /* @__PURE__ */ ((n) => (n.LOCAL = "local", n.REMOTE = "remote", n.SYSTEM = "system", n))($ || {});
1960
+ const J = [
2153
1961
  "incomingCall",
2154
1962
  "declinedIncomingCall",
2155
1963
  "terminatedIncomingCall",
2156
1964
  "failedIncomingCall"
2157
- ], Mn = 486, On = 487;
2158
- class pn {
1965
+ ], Pe = 486, Oe = 487;
1966
+ class fe {
1967
+ events;
2159
1968
  incomingRTCSession;
2160
1969
  connectionManager;
2161
- events;
2162
1970
  constructor(e) {
2163
- this.connectionManager = e, this.events = new D(Rn), this.start();
1971
+ this.connectionManager = e, this.events = new O(J), this.start();
2164
1972
  }
2165
1973
  get remoteCallerData() {
2166
1974
  return {
@@ -2190,19 +1998,19 @@ class pn {
2190
1998
  return this.removeIncomingSession(), e;
2191
1999
  };
2192
2000
  async declineToIncomingCall({
2193
- statusCode: e = On
2001
+ statusCode: e = Oe
2194
2002
  } = {}) {
2195
2003
  return new Promise((t, s) => {
2196
2004
  try {
2197
2005
  const i = this.getIncomingRTCSession(), r = this.remoteCallerData;
2198
- this.removeIncomingSession(), this.events.trigger(f.DECLINED_INCOMING_CALL, r), i.terminate({ status_code: e }), t();
2006
+ this.removeIncomingSession(), this.events.trigger(D.DECLINED_INCOMING_CALL, r), i.terminate({ status_code: e }), t();
2199
2007
  } catch (i) {
2200
2008
  s(i);
2201
2009
  }
2202
2010
  });
2203
2011
  }
2204
2012
  async busyIncomingCall() {
2205
- return this.declineToIncomingCall({ statusCode: Mn });
2013
+ return this.declineToIncomingCall({ statusCode: Pe });
2206
2014
  }
2207
2015
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
2208
2016
  on(e, t) {
@@ -2239,26 +2047,34 @@ class pn {
2239
2047
  this.incomingRTCSession = e;
2240
2048
  const t = this.remoteCallerData;
2241
2049
  e.on("failed", (s) => {
2242
- this.removeIncomingSession(), s.originator === $.LOCAL ? this.events.trigger(f.TERMINATED_INCOMING_CALL, t) : this.events.trigger(f.FAILED_INCOMING_CALL, t);
2243
- }), this.events.trigger(f.INCOMING_CALL, t);
2050
+ this.removeIncomingSession(), s.originator === $.LOCAL ? this.events.trigger(D.TERMINATED_INCOMING_CALL, t) : this.events.trigger(D.FAILED_INCOMING_CALL, t);
2051
+ }), this.events.trigger(D.INCOMING_CALL, t);
2244
2052
  }
2245
2053
  removeIncomingSession() {
2246
2054
  delete this.incomingRTCSession;
2247
2055
  }
2248
2056
  }
2249
- class $n {
2057
+ const De = Q.map((n) => `connection:${n}`), ve = B.map((n) => `call:${n}`), ye = Y.map((n) => `api:${n}`), Ue = J.map((n) => `incoming-call:${n}`), be = q.map((n) => `presentation:${n}`), we = [
2058
+ ...De,
2059
+ ...ve,
2060
+ ...ye,
2061
+ ...Ue,
2062
+ ...be
2063
+ ];
2064
+ class Be {
2065
+ events;
2250
2066
  connectionManager;
2251
2067
  callManager;
2252
2068
  apiManager;
2253
2069
  incomingCallManager;
2254
2070
  presentationManager;
2255
2071
  constructor({ JsSIP: e }) {
2256
- this.connectionManager = new In({ JsSIP: e }), this.callManager = new tn(), this.apiManager = new gn({
2072
+ this.events = new O(we), this.connectionManager = new me({ JsSIP: e }), this.callManager = new ge(), this.apiManager = new Ce({
2257
2073
  connectionManager: this.connectionManager,
2258
2074
  callManager: this.callManager
2259
- }), this.incomingCallManager = new pn(this.connectionManager), this.presentationManager = new rn({
2075
+ }), this.incomingCallManager = new fe(this.connectionManager), this.presentationManager = new Te({
2260
2076
  callManager: this.callManager
2261
- });
2077
+ }), this.subscribe();
2262
2078
  }
2263
2079
  get requestedConnection() {
2264
2080
  return this.connectionManager.requested;
@@ -2299,34 +2115,34 @@ class $n {
2299
2115
  get isAvailableIncomingCall() {
2300
2116
  return this.incomingCallManager.isAvailableIncomingCall;
2301
2117
  }
2302
- connect = async (...e) => this.connectionManager.connect(...e);
2303
- set = async (...e) => this.connectionManager.set(...e);
2304
- disconnect = async () => this.connectionManager.disconnect();
2305
- register = async () => this.connectionManager.register();
2306
- unregister = async () => this.connectionManager.unregister();
2307
- tryRegister = async () => this.connectionManager.tryRegister();
2308
- sendOptions = async (e, t, s) => this.connectionManager.sendOptions(e, t, s);
2309
- ping = async (e, t) => this.connectionManager.ping(e, t);
2310
- checkTelephony = async (e) => this.connectionManager.checkTelephony(e);
2311
2118
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
2312
- onConnection(e, t) {
2313
- return this.connectionManager.on(e, t);
2119
+ on(e, t) {
2120
+ return this.events.on(e, t);
2314
2121
  }
2315
2122
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
2316
- onceConnection(e, t) {
2317
- return this.connectionManager.once(e, t);
2123
+ once(e, t) {
2124
+ return this.events.once(e, t);
2318
2125
  }
2319
2126
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
2320
- onceRaceConnection(e, t) {
2321
- return this.connectionManager.onceRace(e, t);
2127
+ onceRace(e, t) {
2128
+ return this.events.onceRace(e, t);
2322
2129
  }
2323
- async waitConnection(e) {
2324
- return this.connectionManager.wait(e);
2130
+ async wait(e) {
2131
+ return this.events.wait(e);
2325
2132
  }
2326
2133
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
2327
- offConnection(e, t) {
2328
- this.connectionManager.off(e, t);
2134
+ off(e, t) {
2135
+ this.events.off(e, t);
2329
2136
  }
2137
+ connect = async (...e) => this.connectionManager.connect(...e);
2138
+ set = async (...e) => this.connectionManager.set(...e);
2139
+ disconnect = async () => this.connectionManager.disconnect();
2140
+ register = async () => this.connectionManager.register();
2141
+ unregister = async () => this.connectionManager.unregister();
2142
+ tryRegister = async () => this.connectionManager.tryRegister();
2143
+ sendOptions = async (e, t, s) => this.connectionManager.sendOptions(e, t, s);
2144
+ ping = async (e, t) => this.connectionManager.ping(e, t);
2145
+ checkTelephony = async (e) => this.connectionManager.checkTelephony(e);
2330
2146
  isConfigured = () => this.connectionManager.isConfigured();
2331
2147
  getConnectionConfiguration = () => this.connectionManager.getConnectionConfiguration();
2332
2148
  getSipServerUrl = (e) => this.connectionManager.getSipServerUrl(e);
@@ -2345,44 +2161,6 @@ class $n {
2345
2161
  getCallConfiguration = () => this.callManager.getCallConfiguration();
2346
2162
  getRemoteStreams = () => this.callManager.getRemoteStreams();
2347
2163
  replaceMediaStream = async (...e) => this.callManager.replaceMediaStream(...e);
2348
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
2349
- onCall(e, t) {
2350
- return this.callManager.on(e, t);
2351
- }
2352
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
2353
- onceCall(e, t) {
2354
- return this.callManager.once(e, t);
2355
- }
2356
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
2357
- onceRaceCall(e, t) {
2358
- return this.callManager.onceRace(e, t);
2359
- }
2360
- async waitCall(e) {
2361
- return this.callManager.wait(e);
2362
- }
2363
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
2364
- offIncomingCall(e, t) {
2365
- this.incomingCallManager.off(e, t);
2366
- }
2367
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
2368
- onIncomingCall(e, t) {
2369
- return this.incomingCallManager.on(e, t);
2370
- }
2371
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
2372
- onceIncomingCall(e, t) {
2373
- return this.incomingCallManager.once(e, t);
2374
- }
2375
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
2376
- onceRaceIncomingCall(e, t) {
2377
- return this.incomingCallManager.onceRace(e, t);
2378
- }
2379
- async waitIncomingCall(e) {
2380
- return this.incomingCallManager.wait(e);
2381
- }
2382
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
2383
- offCall(e, t) {
2384
- this.callManager.off(e, t);
2385
- }
2386
2164
  async startPresentation(e, t = {}) {
2387
2165
  const { isP2P: s, callLimit: i, ...r } = t;
2388
2166
  return this.presentationManager.startPresentation(
@@ -2452,41 +2230,36 @@ class $n {
2452
2230
  async askPermissionToEnableCam(...e) {
2453
2231
  return this.apiManager.askPermissionToEnableCam(...e);
2454
2232
  }
2455
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
2456
- onApi(e, t) {
2457
- return this.apiManager.on(e, t);
2458
- }
2459
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
2460
- onceApi(e, t) {
2461
- return this.apiManager.once(e, t);
2462
- }
2463
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
2464
- onceRaceApi(e, t) {
2465
- return this.apiManager.onceRace(e, t);
2466
- }
2467
- async waitApi(e) {
2468
- return this.apiManager.wait(e);
2469
- }
2470
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
2471
- offApi(e, t) {
2472
- this.apiManager.off(e, t);
2233
+ subscribe() {
2234
+ this.connectionManager.events.eachTriggers((e, t) => {
2235
+ this.connectionManager.on(t, (s) => {
2236
+ this.events.trigger(`connection:${t}`, s);
2237
+ });
2238
+ }), this.callManager.events.eachTriggers((e, t) => {
2239
+ this.callManager.on(t, (s) => {
2240
+ this.events.trigger(`call:${t}`, s);
2241
+ });
2242
+ }), this.apiManager.events.eachTriggers((e, t) => {
2243
+ this.apiManager.on(t, (s) => {
2244
+ this.events.trigger(`api:${t}`, s);
2245
+ });
2246
+ }), this.incomingCallManager.events.eachTriggers((e, t) => {
2247
+ this.incomingCallManager.on(t, (s) => {
2248
+ this.events.trigger(`incoming-call:${t}`, s);
2249
+ });
2250
+ }), this.presentationManager.events.eachTriggers((e, t) => {
2251
+ this.presentationManager.on(t, (s) => {
2252
+ this.events.trigger(`presentation:${t}`, s);
2253
+ });
2254
+ });
2473
2255
  }
2474
2256
  }
2475
2257
  export {
2476
- Wt as B,
2477
- gt as E,
2478
- pt as N,
2479
- it as O,
2480
- Rt as R,
2481
- $n as S,
2482
- at as U,
2483
- Un as a,
2484
- wn as b,
2485
- yn as c,
2486
- Ln as d,
2487
- bn as e,
2488
- Yt as f,
2489
- U as g,
2490
- Fn as h,
2258
+ H as E,
2259
+ U as O,
2260
+ Be as S,
2261
+ He as d,
2262
+ Ve as e,
2263
+ Ge as h,
2491
2264
  P as l
2492
2265
  };