@realsee/live 0.6.13 → 0.6.15
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.
- package/dist/index.cjs.js +9 -9
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +776 -622
- package/dist/index.es.js.map +1 -1
- package/dist/live/controller.d.ts +28 -0
- package/dist/live/createLiveReact.d.ts +1 -1
- package/dist/live/live.d.ts +6 -1
- package/dist/rtc/VRWebViewRTC.d.ts +84 -9
- package/dist/typings/live/GetVoiceSign.d.ts +33 -5
- package/dist/typings/live/LiveConnectOptions.d.ts +17 -0
- package/dist/typings/live/LiveMsg.d.ts +14 -0
- package/dist/typings/rtc/eventType.d.ts +22 -7
- package/dist/typings/rtc/joinedInfo.d.ts +5 -1
- package/dist/typings/rtc/protocol.d.ts +4 -0
- package/dist/utils/RobustWebSocket.d.ts +3 -0
- package/docs/assets/search.js +1 -1
- package/docs/classes/Live.html +812 -0
- package/docs/classes/VRWebViewRTC.html +212 -21
- package/docs/enums/Command.html +24 -8
- package/docs/enums/MicroStatus.html +8 -4
- package/docs/enums/RTCJoinedInfoCodeEnum.html +11 -2
- package/docs/functions/_clearLiveInstanceIfNeed.html +98 -0
- package/docs/functions/createLive.html +8 -4
- package/docs/functions/createLiveReact.html +18 -14
- package/docs/functions/parseLiveMsg.html +7 -3
- package/docs/functions/parseWSClsErr.html +6 -2
- package/docs/index.html +6 -2
- package/docs/interfaces/RTCJoinedInfo.html +6 -6
- package/docs/interfaces/RTCProtocol.html +16 -4
- package/docs/modules.html +11 -3
- package/docs/types/BuiltinMsg.html +6 -2
- package/docs/types/EventType.html +6 -2
- package/docs/types/GetVoiceSign.html +12 -27
- package/docs/types/GetVoiceSignParams.html +111 -0
- package/docs/types/GetVoiceSignReturnType.html +115 -0
- package/docs/types/KeyframeTypes.html +6 -2
- package/docs/types/LiveBuiltInData.html +117 -0
- package/docs/types/LiveConnectOptions.html +22 -6
- package/docs/types/LiveEventType.html +6 -2
- package/docs/types/LiveMsg.html +7 -3
- package/docs/types/LiveProviderPropTypes.html +8 -4
- package/docs/types/RTCActionReactCallback.html +6 -2
- package/docs/types/RTCEventType.html +58 -3
- package/docs/types/ReqLiveMsg.html +6 -2
- package/docs/types/RoomInfo.html +6 -2
- package/docs/types/UserInfo.html +6 -2
- package/docs/types/UserInfoExt.html +6 -2
- package/docs/types/UserVolume.html +6 -2
- package/docs/types/WebSocketError.html +6 -2
- package/package.json +1 -1
- package/docs/interfaces/GetVoiceSignReturnType.html +0 -90
package/dist/index.es.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
var
|
|
2
|
-
var $t = (r,
|
|
3
|
-
var
|
|
1
|
+
var Dt = Object.defineProperty;
|
|
2
|
+
var $t = (r, o, e) => o in r ? Dt(r, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[o] = e;
|
|
3
|
+
var s = (r, o, e) => ($t(r, typeof o != "symbol" ? o + "" : o, e), e);
|
|
4
4
|
import xt from "@realsee/jsbridge-x";
|
|
5
|
-
import
|
|
6
|
-
import { ConsoleLogger as Ut, LogLevel as
|
|
7
|
-
import
|
|
8
|
-
const
|
|
9
|
-
function
|
|
10
|
-
return r[
|
|
5
|
+
import je from "trtc-js-sdk";
|
|
6
|
+
import { ConsoleLogger as Ut, LogLevel as Wt, DefaultDeviceController as Ft, MeetingSessionConfiguration as Bt, DefaultMeetingSession as Kt, DefaultModality as rt, MeetingSessionStatusCode as qt } from "amazon-chime-sdk-js";
|
|
7
|
+
import M, { createContext as Gt } from "react";
|
|
8
|
+
const ue = Symbol("$$REALSEE_LIVE_EVENT$$");
|
|
9
|
+
function Ee(r) {
|
|
10
|
+
return r[ue] || (r[ue] = {}), r[ue];
|
|
11
11
|
}
|
|
12
12
|
function Yt(r) {
|
|
13
|
-
r[
|
|
13
|
+
r[ue] || delete r[ue];
|
|
14
14
|
}
|
|
15
|
-
class
|
|
15
|
+
class le {
|
|
16
16
|
/**
|
|
17
17
|
* 判断是否注册了事件
|
|
18
18
|
* @param name 事件类型
|
|
19
19
|
*/
|
|
20
|
-
hasListener(
|
|
21
|
-
const e =
|
|
22
|
-
return e && e[
|
|
20
|
+
hasListener(o) {
|
|
21
|
+
const e = Ee(this);
|
|
22
|
+
return e && e[o] && e[o].length > 0;
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
25
|
* 注册事件
|
|
@@ -30,9 +30,9 @@ class ue {
|
|
|
30
30
|
* @template K 预设的监听事件名称
|
|
31
31
|
* @template C 回调函数函数上下文
|
|
32
32
|
*/
|
|
33
|
-
on(
|
|
34
|
-
const n =
|
|
35
|
-
return n[
|
|
33
|
+
on(o, e, i) {
|
|
34
|
+
const n = Ee(this);
|
|
35
|
+
return n[o] || (n[o] = []), n[o].push([e, i || !1]), () => this.off(o, e);
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
38
38
|
* 注册事件(是否只执行一次)
|
|
@@ -42,8 +42,8 @@ class ue {
|
|
|
42
42
|
* @template K 预设的监听事件名称
|
|
43
43
|
* @template C 回调函数函数上下文
|
|
44
44
|
*/
|
|
45
|
-
once(
|
|
46
|
-
return this.on(
|
|
45
|
+
once(o, e) {
|
|
46
|
+
return this.on(o, e, !0);
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
49
|
* 解除事件
|
|
@@ -54,20 +54,20 @@ class ue {
|
|
|
54
54
|
* @param callback 事件回调函数
|
|
55
55
|
* @template K 预设的监听事件名称
|
|
56
56
|
*/
|
|
57
|
-
off(
|
|
58
|
-
if (
|
|
57
|
+
off(o, e) {
|
|
58
|
+
if (o === void 0) {
|
|
59
59
|
Yt(this);
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
|
-
const i =
|
|
63
|
-
if (i[
|
|
64
|
-
i[
|
|
62
|
+
const i = Ee(this);
|
|
63
|
+
if (i[o] || (i[o] = []), e === void 0) {
|
|
64
|
+
i[o].length = 0;
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
67
|
let n = 0;
|
|
68
|
-
for (; n < i[
|
|
68
|
+
for (; n < i[o].length && i[o][n][0] !== e; n++)
|
|
69
69
|
;
|
|
70
|
-
n < i[
|
|
70
|
+
n < i[o].length && i[o].splice(n, 1);
|
|
71
71
|
}
|
|
72
72
|
/**
|
|
73
73
|
* 触发事件
|
|
@@ -76,35 +76,35 @@ class ue {
|
|
|
76
76
|
* @returns canceled 是否被触发取消
|
|
77
77
|
* @template K 预设的监听事件名称
|
|
78
78
|
*/
|
|
79
|
-
emit(
|
|
79
|
+
emit(o, ...e) {
|
|
80
80
|
let i = !1;
|
|
81
|
-
const
|
|
82
|
-
for (let u of
|
|
83
|
-
const [d, g = !1] = u,
|
|
84
|
-
g && this.off(
|
|
81
|
+
const a = Ee(this)[o] || [];
|
|
82
|
+
for (let u of a.slice()) {
|
|
83
|
+
const [d, g = !1] = u, _ = d(...e);
|
|
84
|
+
g && this.off(o, d), _ === !1 && (i = !0);
|
|
85
85
|
}
|
|
86
86
|
return i;
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
-
class Me extends
|
|
89
|
+
class Me extends le {
|
|
90
90
|
}
|
|
91
|
-
var Q = /* @__PURE__ */ ((r) => (r.RealseeBrowserRTC = "RealseeBrowserRTC", r.RealseeVRWebViewRTC = "RealseeVRWebViewRTC", r.RealseeBrowserChimeRTC = "RealseeBrowserChimeRTC", r))(Q || {}),
|
|
92
|
-
const
|
|
93
|
-
const r = new Date(),
|
|
94
|
-
return `[${
|
|
95
|
-
},
|
|
96
|
-
switch (
|
|
91
|
+
var Q = /* @__PURE__ */ ((r) => (r.RealseeBrowserRTC = "RealseeBrowserRTC", r.RealseeVRWebViewRTC = "RealseeVRWebViewRTC", r.RealseeBrowserChimeRTC = "RealseeBrowserChimeRTC", r))(Q || {}), lt = /* @__PURE__ */ ((r) => (r.RealseeXTRTC = "trtc", r.RealseeXChimeRTC = "chime", r))(lt || {});
|
|
92
|
+
const Jt = () => {
|
|
93
|
+
const r = new Date(), o = r.getFullYear(), e = (r.getMonth() + 1).toString().padStart(2, "0"), i = r.getDate().toString().padStart(2, "0"), n = r.getHours().toString().padStart(2, "0"), a = r.getMinutes().toString().padStart(2, "0"), u = r.getSeconds().toString().padStart(2, "0"), d = r.getMilliseconds();
|
|
94
|
+
return `[${o}-${e}-${i} ${n}:${a}:${u}.${d}]`;
|
|
95
|
+
}, Se = (r, o = []) => {
|
|
96
|
+
switch (o.unshift(`Realsee Live ${Jt()} <${r}> `), r) {
|
|
97
97
|
case "INFO":
|
|
98
|
-
return console.info(...
|
|
98
|
+
return console.info(...o);
|
|
99
99
|
case "ERROR":
|
|
100
|
-
return console.error(...
|
|
100
|
+
return console.error(...o);
|
|
101
101
|
case "WARN":
|
|
102
|
-
return console.warn(...
|
|
102
|
+
return console.warn(...o);
|
|
103
103
|
default:
|
|
104
|
-
return console.log(...
|
|
104
|
+
return console.log(...o);
|
|
105
105
|
}
|
|
106
|
-
},
|
|
107
|
-
log:
|
|
106
|
+
}, Ht = (...r) => Se("LOG", r), zt = (...r) => Se("INFO", r), Xt = (...r) => Se("ERROR", r), Zt = (...r) => Se("WARN", r), Qt = {
|
|
107
|
+
log: Ht,
|
|
108
108
|
info: zt,
|
|
109
109
|
error: Xt,
|
|
110
110
|
warn: Zt
|
|
@@ -112,44 +112,44 @@ const Ht = () => {
|
|
|
112
112
|
function X() {
|
|
113
113
|
return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function ye() {
|
|
116
116
|
return (X() + X() + "-" + X() + "-4" + X().substr(0, 3) + "-" + X() + "-" + X() + X() + X()).toLowerCase();
|
|
117
117
|
}
|
|
118
|
-
class
|
|
118
|
+
class it extends Me {
|
|
119
119
|
constructor(e) {
|
|
120
120
|
super();
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
121
|
+
s(this, "type", Q.RealseeBrowserRTC);
|
|
122
|
+
s(this, "joined", !1);
|
|
123
|
+
s(this, "micro", !1);
|
|
124
|
+
s(this, "voiceId", "");
|
|
125
|
+
s(this, "_getVoiceSign", () => {
|
|
126
126
|
throw new Error("方法 getVoiceSign 未实现");
|
|
127
127
|
});
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
128
|
+
s(this, "_autoPlayConfirm");
|
|
129
|
+
s(this, "checkRequirement", () => je.checkSystemRequirements());
|
|
130
|
+
s(this, "$dom", document.createElement("div"));
|
|
131
|
+
s(this, "_trtc", {
|
|
132
132
|
client: null,
|
|
133
133
|
stream: null
|
|
134
134
|
});
|
|
135
|
-
|
|
136
|
-
var
|
|
135
|
+
s(this, "join", async (e) => {
|
|
136
|
+
var a;
|
|
137
137
|
this.emit("joinWillStart");
|
|
138
138
|
const i = await this._getVoiceSign({
|
|
139
139
|
voiceId: e.voiceId,
|
|
140
140
|
roomId: e.roomId,
|
|
141
141
|
userId: e.userId
|
|
142
142
|
});
|
|
143
|
-
this._trtc.client =
|
|
143
|
+
this._trtc.client = je.createClient({
|
|
144
144
|
mode: "rtc",
|
|
145
145
|
...i,
|
|
146
146
|
enableAutoPlayDialog: typeof this._autoPlayConfirm != "function"
|
|
147
|
-
}), (
|
|
147
|
+
}), (a = this._trtc.client) == null || a.enableAudioVolumeEvaluation(), this._registerRtcEvent();
|
|
148
148
|
let n = await new Promise((u) => {
|
|
149
149
|
var d;
|
|
150
150
|
(d = this._trtc.client) == null || d.join({ roomId: Number(e.voiceId) }).then(() => u(!0)).catch(() => u(!1));
|
|
151
151
|
});
|
|
152
|
-
return this.joined = n, n ? (this._trtc.stream =
|
|
152
|
+
return this.joined = n, n ? (this._trtc.stream = je.createStream({
|
|
153
153
|
userId: i.userId,
|
|
154
154
|
audio: !0,
|
|
155
155
|
video: !1
|
|
@@ -161,27 +161,27 @@ class rt extends Me {
|
|
|
161
161
|
(d = this._trtc.client) == null || d.publish(this._trtc.stream).then(() => u(!0)).catch(() => u(!1));
|
|
162
162
|
}), this.joined = n, this.joined && this.emit("joined"), n) : !1;
|
|
163
163
|
});
|
|
164
|
-
|
|
164
|
+
s(this, "_handleStreamAdded", (e) => {
|
|
165
165
|
var n;
|
|
166
166
|
const i = e.stream;
|
|
167
167
|
console.log("远端流增加: " + i.getId()), (n = this._trtc.client) == null || n.subscribe(i);
|
|
168
168
|
});
|
|
169
|
-
|
|
169
|
+
s(this, "_handleStreamSubscribed", (e) => {
|
|
170
170
|
const i = e.stream;
|
|
171
171
|
console.log("远端流订阅成功:" + i.getId());
|
|
172
|
-
const
|
|
173
|
-
u.id =
|
|
172
|
+
const a = `rs-rtc-remote_stream-${i.getId()}`, u = document.createElement("div");
|
|
173
|
+
u.id = a, this.$dom.appendChild(u), typeof this._autoPlayConfirm == "function" ? (i.play(a).catch((d) => {
|
|
174
174
|
}), i.on("error", (d) => {
|
|
175
175
|
if (d.getCode() === 16451) {
|
|
176
|
-
const
|
|
177
|
-
this._autoPlayConfirm({ onConfirm:
|
|
176
|
+
const _ = () => i.resume();
|
|
177
|
+
this._autoPlayConfirm({ onConfirm: _ });
|
|
178
178
|
}
|
|
179
|
-
})) : i.play(
|
|
179
|
+
})) : i.play(a);
|
|
180
180
|
});
|
|
181
181
|
this._getVoiceSign = e.getVoiceSign, this._autoPlayConfirm = e.autoPlayConfirm, this._initParentDom();
|
|
182
182
|
}
|
|
183
183
|
_initParentDom() {
|
|
184
|
-
this.$dom.id = `rs-rtc-${
|
|
184
|
+
this.$dom.id = `rs-rtc-${ye()}`, this.$dom.style.display = "none", document.body.appendChild(this.$dom);
|
|
185
185
|
}
|
|
186
186
|
quit() {
|
|
187
187
|
return new Promise(async (e) => {
|
|
@@ -202,16 +202,16 @@ class rt extends Me {
|
|
|
202
202
|
});
|
|
203
203
|
}
|
|
204
204
|
toggleMicro(e) {
|
|
205
|
-
var i, n,
|
|
205
|
+
var i, n, a, u;
|
|
206
206
|
return Promise.resolve(
|
|
207
|
-
(e ? (n = (i = this._trtc) == null ? void 0 : i.stream) == null ? void 0 : n.unmuteAudio() : (u = (
|
|
207
|
+
(e ? (n = (i = this._trtc) == null ? void 0 : i.stream) == null ? void 0 : n.unmuteAudio() : (u = (a = this._trtc) == null ? void 0 : a.stream) == null ? void 0 : u.muteAudio()) || !1
|
|
208
208
|
);
|
|
209
209
|
}
|
|
210
210
|
shock() {
|
|
211
211
|
throw new Error("Method not implemented.");
|
|
212
212
|
}
|
|
213
213
|
_registerRtcEvent() {
|
|
214
|
-
var e, i, n,
|
|
214
|
+
var e, i, n, a;
|
|
215
215
|
(e = this._trtc.client) == null || e.on("stream-added", this._handleStreamAdded), (i = this._trtc.client) == null || i.on("stream-subscribed", this._handleStreamSubscribed), (n = this._trtc.client) == null || n.on(
|
|
216
216
|
"audio-volume",
|
|
217
217
|
(u) => this.emit(
|
|
@@ -221,41 +221,41 @@ class rt extends Me {
|
|
|
221
221
|
audioVolume: g
|
|
222
222
|
}))
|
|
223
223
|
)
|
|
224
|
-
), (
|
|
224
|
+
), (a = this._trtc.client) == null || a.on("error", (u) => this.emit("error", u));
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
|
-
class
|
|
227
|
+
class nt extends Me {
|
|
228
228
|
constructor(e) {
|
|
229
229
|
super();
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
230
|
+
s(this, "type", Q.RealseeBrowserChimeRTC);
|
|
231
|
+
s(this, "joined", !1);
|
|
232
|
+
s(this, "micro", !1);
|
|
233
|
+
s(this, "voiceId", "");
|
|
234
|
+
s(this, "userId", "");
|
|
235
|
+
s(this, "logger");
|
|
236
|
+
s(this, "deviceController");
|
|
237
|
+
s(this, "meetingSession");
|
|
238
|
+
s(this, "audioInput");
|
|
239
|
+
s(this, "audioOutput");
|
|
240
|
+
s(this, "deviceChangeObserver", {});
|
|
241
|
+
s(this, "audioVideoObserver", {});
|
|
242
|
+
s(this, "audioMixObserver");
|
|
243
|
+
s(this, "_getVoiceSign", () => {
|
|
244
244
|
throw new Error("方法 getVoiceSign 未实现");
|
|
245
245
|
});
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
246
|
+
s(this, "_autoPlayConfirm");
|
|
247
|
+
s(this, "$dom", document.createElement("div"));
|
|
248
|
+
s(this, "$audio", document.createElement("audio"));
|
|
249
249
|
/**
|
|
250
250
|
* 对audio标签初始化
|
|
251
251
|
*/
|
|
252
|
-
|
|
253
|
-
this.$audio.id = `rs-rtc-${
|
|
252
|
+
s(this, "_initDom", () => {
|
|
253
|
+
this.$audio.id = `rs-rtc-${ye()}`, this.$dom.id = `rs-rtc-${ye()}`, this.$dom.appendChild(this.$audio), document.body.appendChild(this.$dom);
|
|
254
254
|
});
|
|
255
255
|
/**
|
|
256
256
|
* 初始化事件监听器
|
|
257
257
|
*/
|
|
258
|
-
|
|
258
|
+
s(this, "initObservers", () => {
|
|
259
259
|
this.deviceChangeObserver = {
|
|
260
260
|
audioInputsChanged: (e) => {
|
|
261
261
|
this.logger.info(`audioInputsChanged ${typeof e}`), e == null || e.forEach((i) => {
|
|
@@ -289,8 +289,8 @@ class it extends Me {
|
|
|
289
289
|
const i = () => this.$audio.play().then(() => {
|
|
290
290
|
}).catch((n) => {
|
|
291
291
|
if (O.error("播放远端流失败!", n), typeof this._autoPlayConfirm == "function") {
|
|
292
|
-
const
|
|
293
|
-
this._autoPlayConfirm({ onConfirm:
|
|
292
|
+
const a = () => i();
|
|
293
|
+
this._autoPlayConfirm({ onConfirm: a });
|
|
294
294
|
}
|
|
295
295
|
});
|
|
296
296
|
i();
|
|
@@ -303,13 +303,13 @@ class it extends Me {
|
|
|
303
303
|
/**
|
|
304
304
|
* 注册rtc事件
|
|
305
305
|
*/
|
|
306
|
-
|
|
307
|
-
var i, n,
|
|
308
|
-
const e = ((
|
|
306
|
+
s(this, "_registerRtcEvent", () => {
|
|
307
|
+
var i, n, a, u, d, g;
|
|
308
|
+
const e = ((a = (n = (i = this.meetingSession) == null ? void 0 : i.configuration) == null ? void 0 : n.credentials) == null ? void 0 : a.attendeeId) || "";
|
|
309
309
|
if (e) {
|
|
310
|
-
const
|
|
310
|
+
const _ = /* @__PURE__ */ new Map(), E = () => {
|
|
311
311
|
const y = [];
|
|
312
|
-
return
|
|
312
|
+
return _.forEach((I, m) => {
|
|
313
313
|
y.push({
|
|
314
314
|
userId: I.userId,
|
|
315
315
|
volume: I.muted || I.signalStrength === 0 || !Boolean(I.volume) ? 0 : I.volume
|
|
@@ -317,17 +317,17 @@ class it extends Me {
|
|
|
317
317
|
}), y;
|
|
318
318
|
};
|
|
319
319
|
(u = this.meetingSession) == null || u.audioVideo.realtimeSubscribeToAttendeeIdPresence(
|
|
320
|
-
(y, I,
|
|
321
|
-
var
|
|
320
|
+
(y, I, m) => {
|
|
321
|
+
var D;
|
|
322
322
|
if (!I) {
|
|
323
|
-
|
|
323
|
+
_.delete(y), this.emit("userVolumes", E());
|
|
324
324
|
return;
|
|
325
325
|
}
|
|
326
|
-
(
|
|
326
|
+
(D = this.meetingSession) == null || D.audioVideo.realtimeSubscribeToVolumeIndicator(
|
|
327
327
|
y,
|
|
328
|
-
(
|
|
329
|
-
new
|
|
330
|
-
userId:
|
|
328
|
+
(w, k, U, P) => {
|
|
329
|
+
new rt(w).base() === w && (_.set(w, {
|
|
330
|
+
userId: m || w,
|
|
331
331
|
volume: k,
|
|
332
332
|
muted: U,
|
|
333
333
|
signalStrength: P
|
|
@@ -337,13 +337,13 @@ class it extends Me {
|
|
|
337
337
|
}
|
|
338
338
|
), (d = this.meetingSession) == null || d.audioVideo.realtimeSubscribeToVolumeIndicator(
|
|
339
339
|
e,
|
|
340
|
-
(y, I,
|
|
341
|
-
new
|
|
340
|
+
(y, I, m, D) => {
|
|
341
|
+
new rt(y).base() === y && D !== null && D !== 1 && this.emit("weakNetwork");
|
|
342
342
|
}
|
|
343
343
|
), (g = this.meetingSession) == null || g.audioVideo.realtimeSubscribeToFatalError((y) => this.emit("error", y));
|
|
344
344
|
}
|
|
345
345
|
});
|
|
346
|
-
this._getVoiceSign = e.getVoiceSign, this._autoPlayConfirm = e.autoPlayConfirm, this._initDom(), this.logger = new Ut("WebRTCLogger", e.logLevel ||
|
|
346
|
+
this._getVoiceSign = e.getVoiceSign, this._autoPlayConfirm = e.autoPlayConfirm, this._initDom(), this.logger = new Ut("WebRTCLogger", e.logLevel || Wt.INFO), this.deviceController = new Ft(this.logger), this.initObservers();
|
|
347
347
|
}
|
|
348
348
|
/**
|
|
349
349
|
* 加入语音会议
|
|
@@ -352,17 +352,17 @@ class it extends Me {
|
|
|
352
352
|
*/
|
|
353
353
|
async join(e) {
|
|
354
354
|
return new Promise(async (i, n) => {
|
|
355
|
-
var
|
|
355
|
+
var a, u;
|
|
356
356
|
this.emit("joinWillStart");
|
|
357
357
|
try {
|
|
358
|
-
const { sdkAppId: d, userId: g, roomId:
|
|
358
|
+
const { sdkAppId: d, userId: g, roomId: _, userSig: E } = await this._getVoiceSign({
|
|
359
359
|
...e,
|
|
360
360
|
roomId: e.roomId || 0
|
|
361
361
|
});
|
|
362
362
|
this.userId = g;
|
|
363
363
|
const { attendence: y, vendor_wrapper: I } = JSON.parse(
|
|
364
364
|
decodeURIComponent(E)
|
|
365
|
-
),
|
|
365
|
+
), m = new Bt(
|
|
366
366
|
{
|
|
367
367
|
Meeting: I
|
|
368
368
|
},
|
|
@@ -374,34 +374,34 @@ class it extends Me {
|
|
|
374
374
|
}
|
|
375
375
|
}
|
|
376
376
|
);
|
|
377
|
-
this.meetingSession = new Kt(
|
|
378
|
-
const
|
|
377
|
+
this.meetingSession = new Kt(m, this.logger, this.deviceController), this._registerRtcEvent(), this.meetingSession.audioVideo.addDeviceChangeObserver(this.deviceChangeObserver), this.meetingSession.audioVideo.addObserver(this.audioVideoObserver), this.meetingSession.audioVideo.bindAudioElement(this.$audio);
|
|
378
|
+
const D = {
|
|
379
379
|
audioVideoDidStart: () => {
|
|
380
|
-
var
|
|
381
|
-
(
|
|
380
|
+
var w;
|
|
381
|
+
(w = this.meetingSession) == null || w.audioVideo.realtimeMuteLocalAudio(), this.joined = !0, this.emit("joined"), i(!0);
|
|
382
382
|
},
|
|
383
383
|
audioVideoDidStop: () => {
|
|
384
384
|
this.joined = !1, i(!1);
|
|
385
385
|
}
|
|
386
386
|
};
|
|
387
|
-
this.meetingSession.audioVideo.addObserver(
|
|
387
|
+
this.meetingSession.audioVideo.addObserver(D), this.audioMixObserver && this.meetingSession.audioVideo.addAudioMixObserver(this.audioMixObserver), this.meetingSession.audioVideo.setDeviceLabelTrigger(
|
|
388
388
|
async () => await navigator.mediaDevices.getUserMedia({ audio: !0, video: !1 })
|
|
389
389
|
);
|
|
390
390
|
try {
|
|
391
|
-
const
|
|
392
|
-
O.info("audioInputDevices ===>",
|
|
393
|
-
const k = ((
|
|
391
|
+
const w = await this.meetingSession.audioVideo.listAudioInputDevices();
|
|
392
|
+
O.info("audioInputDevices ===>", w);
|
|
393
|
+
const k = ((a = w[0]) == null ? void 0 : a.deviceId) || "default";
|
|
394
394
|
await this.meetingSession.audioVideo.startAudioInput(k);
|
|
395
|
-
} catch (
|
|
396
|
-
O.error(`设置语音输入设备失败:${
|
|
395
|
+
} catch (w) {
|
|
396
|
+
O.error(`设置语音输入设备失败:${w.message}`);
|
|
397
397
|
}
|
|
398
398
|
try {
|
|
399
|
-
const
|
|
400
|
-
O.info("audioOutputDevices ===>",
|
|
401
|
-
const k = ((u =
|
|
399
|
+
const w = await this.meetingSession.audioVideo.listAudioOutputDevices();
|
|
400
|
+
O.info("audioOutputDevices ===>", w);
|
|
401
|
+
const k = ((u = w[0]) == null ? void 0 : u.deviceId) || "default";
|
|
402
402
|
await this.meetingSession.audioVideo.chooseAudioOutput(k);
|
|
403
|
-
} catch (
|
|
404
|
-
O.error(`设置语音输出设备失败:${
|
|
403
|
+
} catch (w) {
|
|
404
|
+
O.error(`设置语音输出设备失败:${w.message}`);
|
|
405
405
|
}
|
|
406
406
|
this.meetingSession.audioVideo.start();
|
|
407
407
|
} catch (d) {
|
|
@@ -411,16 +411,16 @@ class it extends Me {
|
|
|
411
411
|
}
|
|
412
412
|
quit() {
|
|
413
413
|
return this.joined ? new Promise((e, i) => {
|
|
414
|
-
var
|
|
414
|
+
var a, u;
|
|
415
415
|
this.joined = !1;
|
|
416
416
|
const n = {
|
|
417
417
|
audioVideoDidStop: async (d) => {
|
|
418
|
-
var
|
|
418
|
+
var _;
|
|
419
419
|
const g = d.statusCode();
|
|
420
|
-
(
|
|
420
|
+
(_ = this.meetingSession) == null || _.deviceController.destroy(), g === qt.Left ? (this.logger.info("You left the session"), e(!0)) : (this.logger.info(`Stopped with a session status code: ${g}`), e(!0));
|
|
421
421
|
}
|
|
422
422
|
};
|
|
423
|
-
(
|
|
423
|
+
(a = this.meetingSession) == null || a.audioVideo.addObserver(n), (u = this.meetingSession) == null || u.audioVideo.stop();
|
|
424
424
|
}) : Promise.resolve(!0);
|
|
425
425
|
}
|
|
426
426
|
async detectMicro() {
|
|
@@ -434,8 +434,8 @@ class it extends Me {
|
|
|
434
434
|
});
|
|
435
435
|
}
|
|
436
436
|
async toggleMicro(e) {
|
|
437
|
-
var n,
|
|
438
|
-
e ? (n = this.meetingSession) == null || n.audioVideo.realtimeUnmuteLocalAudio() : (
|
|
437
|
+
var n, a, u;
|
|
438
|
+
e ? (n = this.meetingSession) == null || n.audioVideo.realtimeUnmuteLocalAudio() : (a = this.meetingSession) == null || a.audioVideo.realtimeMuteLocalAudio();
|
|
439
439
|
const i = (u = this.meetingSession) == null ? void 0 : u.audioVideo.realtimeIsLocalAudioMuted();
|
|
440
440
|
return i !== void 0 ? e !== i : !1;
|
|
441
441
|
}
|
|
@@ -443,77 +443,226 @@ class it extends Me {
|
|
|
443
443
|
throw new Error("Method not implemented.");
|
|
444
444
|
}
|
|
445
445
|
}
|
|
446
|
-
var
|
|
447
|
-
class
|
|
446
|
+
var ne = /* @__PURE__ */ ((r) => (r[r.Success = 0] = "Success", r[r.Failure = 1] = "Failure", r[r.ReJoin = 2] = "ReJoin", r[r.NoMicroPermission = 3] = "NoMicroPermission", r[r.Unknown = 500] = "Unknown", r))(ne || {});
|
|
447
|
+
class st extends Me {
|
|
448
448
|
constructor({ jsBridge: e, getVoiceSign: i }) {
|
|
449
449
|
super();
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
450
|
+
s(this, "type", Q.RealseeVRWebViewRTC);
|
|
451
|
+
s(this, "joined", !1);
|
|
452
|
+
s(this, "micro", !1);
|
|
453
|
+
s(this, "voiceId", "");
|
|
454
|
+
/**
|
|
455
|
+
* 保留加入房间参数,用于重连
|
|
456
|
+
*/
|
|
457
|
+
s(this, "_joinOptions", null);
|
|
458
|
+
s(this, "options");
|
|
459
|
+
/**
|
|
460
|
+
* 处理用户音量
|
|
461
|
+
* @param userVolumes
|
|
462
|
+
*/
|
|
463
|
+
s(this, "handleUserVolumes", (e) => {
|
|
464
|
+
this.emit("userVolumes", e);
|
|
459
465
|
});
|
|
466
|
+
/**
|
|
467
|
+
* 处理弱网络情况
|
|
468
|
+
* @param weakNetwork
|
|
469
|
+
*/
|
|
470
|
+
s(this, "handleWeakNetwork", (e) => {
|
|
471
|
+
e && this.emit("weakNetwork");
|
|
472
|
+
});
|
|
473
|
+
/**
|
|
474
|
+
* 加入语音房间
|
|
475
|
+
* @param options
|
|
476
|
+
* @returns
|
|
477
|
+
*/
|
|
478
|
+
s(this, "join", async (e) => {
|
|
479
|
+
this._joinOptions = e, this.emit("joinWillStart");
|
|
480
|
+
const { sdkAppId: i, userId: n, userSig: a } = await this.getVoiceSignOrEmitError(
|
|
481
|
+
e
|
|
482
|
+
);
|
|
483
|
+
return !i || !n || !a ? !1 : (this.type = e.type, this.jsBridge.webViewType === "WxMiniProgramWebView" ? this.handleWxMiniProgramWebViewJoin({
|
|
484
|
+
sdkAppId: i,
|
|
485
|
+
userId: n,
|
|
486
|
+
userSig: a,
|
|
487
|
+
voiceId: e.voiceId
|
|
488
|
+
}) : this.handleAppWebViewJoin({
|
|
489
|
+
sdkAppId: i,
|
|
490
|
+
userId: n,
|
|
491
|
+
userSig: a,
|
|
492
|
+
voiceId: e.voiceId
|
|
493
|
+
}));
|
|
494
|
+
});
|
|
495
|
+
/**
|
|
496
|
+
* 重连
|
|
497
|
+
* @returns
|
|
498
|
+
*/
|
|
499
|
+
s(this, "reJoin", async () => this._joinOptions ? this.join({
|
|
500
|
+
voiceId: this._joinOptions.voiceId,
|
|
501
|
+
userId: this._joinOptions.userId,
|
|
502
|
+
roomId: this._joinOptions.roomId,
|
|
503
|
+
type: this._joinOptions.type
|
|
504
|
+
}) : (this.emitErrorAndSetJoinedFalse("重连失败:未找到加入房间参数。"), !1));
|
|
505
|
+
/**
|
|
506
|
+
* 获取 rtc 签名
|
|
507
|
+
* @param params
|
|
508
|
+
* @returns
|
|
509
|
+
*/
|
|
510
|
+
s(this, "getVoiceSignOrEmitError", async (e) => {
|
|
511
|
+
try {
|
|
512
|
+
return await this.options.getVoiceSign(e);
|
|
513
|
+
} catch (i) {
|
|
514
|
+
return this.emitErrorAndSetJoinedFalse("加入房间失败:rtc 签名请求异常"), {};
|
|
515
|
+
}
|
|
516
|
+
});
|
|
517
|
+
/**
|
|
518
|
+
* 处理小程序的加入房间
|
|
519
|
+
* @param options
|
|
520
|
+
* @returns
|
|
521
|
+
*/
|
|
522
|
+
s(this, "handleWxMiniProgramWebViewJoin", async (e) => {
|
|
523
|
+
const [i, n] = await this.joinRoomOrEmitError(e);
|
|
524
|
+
return n ? !1 : this.handleJoinResult(i);
|
|
525
|
+
});
|
|
526
|
+
/**
|
|
527
|
+
* 处理App WebView的加入房间
|
|
528
|
+
* @param options
|
|
529
|
+
* @returns
|
|
530
|
+
*/
|
|
531
|
+
s(this, "handleAppWebViewJoin", (e) => new Promise((i) => {
|
|
532
|
+
this.off("inner.rtc.success");
|
|
533
|
+
const n = (a) => {
|
|
534
|
+
this.off("inner.rtc.fail", n), this.off("inner.rtc.success", n), i(this.handleJoinResult(a));
|
|
535
|
+
};
|
|
536
|
+
this.once("inner.rtc.fail", n), this.once("inner.rtc.success", n);
|
|
537
|
+
try {
|
|
538
|
+
const { sdkAppId: a, userId: u, userSig: d, voiceId: g } = e;
|
|
539
|
+
this.jsBridge.callAndListen(
|
|
540
|
+
`live/join?sdkAppID=${a}&userID=${u}&roomID=${g}&userSig=${d}`,
|
|
541
|
+
(_) => {
|
|
542
|
+
_ === !0 ? this.emit("inner.rtc.success", _) : typeof _ == "object" ? _.code === ne.Success || _.code === ne.ReJoin ? this.emit("inner.rtc.success", _) : this.emit("inner.rtc.fail", _) : this.emit("inner.rtc.fail", _);
|
|
543
|
+
}
|
|
544
|
+
);
|
|
545
|
+
} catch (a) {
|
|
546
|
+
i(
|
|
547
|
+
this.handleJoinResult({
|
|
548
|
+
message: a.message,
|
|
549
|
+
code: ne.Unknown
|
|
550
|
+
})
|
|
551
|
+
);
|
|
552
|
+
}
|
|
553
|
+
}));
|
|
554
|
+
/**
|
|
555
|
+
* 加入语音房间,给小程序使用
|
|
556
|
+
* @param param0
|
|
557
|
+
* @returns
|
|
558
|
+
*/
|
|
559
|
+
s(this, "joinRoomOrEmitError", async ({
|
|
560
|
+
sdkAppId: e,
|
|
561
|
+
userId: i,
|
|
562
|
+
voiceId: n,
|
|
563
|
+
userSig: a
|
|
564
|
+
}) => {
|
|
565
|
+
try {
|
|
566
|
+
return await this.jsBridge.callAndBackfeed(
|
|
567
|
+
`live/join?sdkAppID=${e}&userID=${i}&roomID=${Number(
|
|
568
|
+
n
|
|
569
|
+
)}&userSig=${a}`
|
|
570
|
+
);
|
|
571
|
+
} catch (u) {
|
|
572
|
+
return this.emitErrorAndSetJoinedFalse("加入房间失败:" + u.message), [null, u];
|
|
573
|
+
}
|
|
574
|
+
});
|
|
575
|
+
/**
|
|
576
|
+
* 处理加入语音房间结果
|
|
577
|
+
* @param res
|
|
578
|
+
* @returns
|
|
579
|
+
*/
|
|
580
|
+
s(this, "handleJoinResult", (e) => {
|
|
581
|
+
switch (!0) {
|
|
582
|
+
case e === !0:
|
|
583
|
+
case (typeof e == "object" && e.code === ne.Success):
|
|
584
|
+
case (typeof e == "object" && e.code === ne.ReJoin): {
|
|
585
|
+
this.emit("joined"), this.joined = !0;
|
|
586
|
+
break;
|
|
587
|
+
}
|
|
588
|
+
default: {
|
|
589
|
+
this.joined = !1;
|
|
590
|
+
const i = typeof e == "object" ? e.message : "加入房间失败:未知异常。";
|
|
591
|
+
this.emit("error", new Error(i, { cause: e }));
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
return this.joined;
|
|
595
|
+
});
|
|
596
|
+
/**
|
|
597
|
+
* 将错误信息发送出去,并将 joined 置为 false
|
|
598
|
+
* @param message
|
|
599
|
+
*/
|
|
600
|
+
s(this, "emitErrorAndSetJoinedFalse", (e) => {
|
|
601
|
+
this.emit("error", new Error(e)), this.joined = !1;
|
|
602
|
+
});
|
|
603
|
+
/**
|
|
604
|
+
* 退出房间
|
|
605
|
+
* @returns
|
|
606
|
+
*/
|
|
607
|
+
s(this, "quit", async () => {
|
|
608
|
+
const [e, i] = await this.jsBridge.callAndBackfeed(
|
|
609
|
+
"live/quit"
|
|
610
|
+
);
|
|
611
|
+
return e === null && this.emit("error", i || new Error("退出房间失败:未知异常。")), this.joined = !1, !!e;
|
|
612
|
+
});
|
|
613
|
+
/**
|
|
614
|
+
* 监测麦克风权限
|
|
615
|
+
* @returns
|
|
616
|
+
*/
|
|
617
|
+
s(this, "detectMicro", async () => {
|
|
618
|
+
const [e, i] = await this.jsBridge.detectMicro();
|
|
619
|
+
return e === null ? (this.emit("error", i || new Error("麦克风监测异常!")), !1) : e;
|
|
620
|
+
});
|
|
621
|
+
/**
|
|
622
|
+
* 修改麦克风状态
|
|
623
|
+
* @param flag
|
|
624
|
+
* @returns
|
|
625
|
+
*/
|
|
626
|
+
s(this, "toggleMicro", async (e) => {
|
|
627
|
+
const [i, n] = await this.jsBridge.callAndBackfeed(
|
|
628
|
+
`live/toggleMicro?flag=${Boolean(e) ? 1 : 0}`
|
|
629
|
+
);
|
|
630
|
+
return i === null ? (this.emit("error", n || new Error("麦克风监测异常!")), !1) : (this.micro = i, i);
|
|
631
|
+
});
|
|
632
|
+
/**
|
|
633
|
+
* 震动
|
|
634
|
+
*/
|
|
635
|
+
s(this, "shock", () => {
|
|
636
|
+
this.jsBridge.shock(1);
|
|
637
|
+
});
|
|
638
|
+
this.options = { jsBridge: e, getVoiceSign: i }, this.jsBridge.webViewType !== "WxMiniProgramWebView" && this.jsBridge.callAndListen("live/userVolumes", this.handleUserVolumes), this.jsBridge.callAndListen("live/weakNetwork", this.handleWeakNetwork), this.on("inner.rtc.fail", this.handleJoinResult);
|
|
460
639
|
}
|
|
461
640
|
get jsBridge() {
|
|
462
641
|
return this.options.jsBridge;
|
|
463
642
|
}
|
|
464
|
-
async join(e) {
|
|
465
|
-
try {
|
|
466
|
-
this.emit("joinWillStart");
|
|
467
|
-
const { sdkAppId: i, userId: n, userSig: c } = await this.options.getVoiceSign(e);
|
|
468
|
-
if (!(Boolean(i) && Boolean(n) && Boolean(c)))
|
|
469
|
-
return this.emit("error", new Error("加入房间失败:rtc 签名请求异常")), this.joined = !1, this.joined;
|
|
470
|
-
this.type = e.type;
|
|
471
|
-
const [u, d] = await this.jsBridge.callAndBackfeed(
|
|
472
|
-
`live/join?sdkAppID=${i}&userID=${n}&roomID=${Number(e.voiceId)}&userSig=${c}`
|
|
473
|
-
);
|
|
474
|
-
return u === !0 ? (this.emit("joined"), this.joined = !0) : u ? u.code === lt.Success ? (this.emit("joined"), this.joined = !0) : (this.emit("error", u), this.joined = !1) : (this.emit("error", d || new Error("加入房间失败:未知异常。")), this.joined = !1), this.joined;
|
|
475
|
-
} catch (i) {
|
|
476
|
-
return this.emit("error", new Error("加入房间失败:" + i.message)), this.joined = !1, this.joined;
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
async quit() {
|
|
480
|
-
const [e, i] = await this.jsBridge.callAndBackfeed("live/quit");
|
|
481
|
-
return e === null && this.emit("error", i || new Error("退出房间失败:未知异常。")), this.joined = !1, !!e;
|
|
482
|
-
}
|
|
483
|
-
async detectMicro() {
|
|
484
|
-
const [e, i] = await this.jsBridge.detectMicro();
|
|
485
|
-
return e === null ? (this.emit("error", i || new Error("麦克风监测异常!")), !1) : e;
|
|
486
|
-
}
|
|
487
|
-
async toggleMicro(e) {
|
|
488
|
-
const [i, n] = await this.jsBridge.callAndBackfeed(`live/toggleMicro?flag=${e ? 1 : 0}`);
|
|
489
|
-
return i === null ? (this.emit("error", n || new Error("麦克风监测异常!")), !1) : (this.micro = i, i);
|
|
490
|
-
}
|
|
491
|
-
shock() {
|
|
492
|
-
this.jsBridge.shock(1);
|
|
493
|
-
}
|
|
494
643
|
}
|
|
495
|
-
var K = /* @__PURE__ */ ((r) => (r.SelfUserInfo = "SELF_USER_INFO", r.RoomInfo = "ROOM_INFO", r.RTCInfo = "RTC_INFO", r.UserList = "USER_LIST", r.BuiltinMsg = "BUILTIN_MSG", r.CustomEvent = "CUSTOM_EVENT", r.KeyframeSync = "KEYFRAME_SYNC", r.UserKickOut = "USER_KICK_OUT", r))(K || {}), q = /* @__PURE__ */ ((r) => (r.UserChange = "user_change", r.RoomChange = "room_change", r))(q || {}),
|
|
644
|
+
var K = /* @__PURE__ */ ((r) => (r.SelfUserInfo = "SELF_USER_INFO", r.RoomInfo = "ROOM_INFO", r.RTCInfo = "RTC_INFO", r.UserList = "USER_LIST", r.BuiltinMsg = "BUILTIN_MSG", r.CustomEvent = "CUSTOM_EVENT", r.KeyframeSync = "KEYFRAME_SYNC", r.UserKickOut = "USER_KICK_OUT", r))(K || {}), q = /* @__PURE__ */ ((r) => (r.UserChange = "user_change", r.RoomChange = "room_change", r))(q || {}), J = /* @__PURE__ */ ((r) => (r.UserMicroStatus = "change_micro_status", r.UserMicroStatusSync = "sync_micro_status", r.UserPermission = "change_permission", r.UserStatus = "change_status", r.UserInfo = "change_info", r.RoomClose = "close", r))(J || {}), Z = /* @__PURE__ */ ((r) => (r.OPEN = "OPEN", r.CLOSE = "CLOSE", r))(Z || {});
|
|
496
645
|
function Nr(r) {
|
|
497
646
|
try {
|
|
498
|
-
const
|
|
499
|
-
code:
|
|
500
|
-
message:
|
|
501
|
-
command:
|
|
502
|
-
roomCode:
|
|
503
|
-
appID:
|
|
504
|
-
requestId:
|
|
505
|
-
frontRequestId:
|
|
506
|
-
triggerUserID:
|
|
507
|
-
data:
|
|
647
|
+
const o = JSON.parse(r), e = {
|
|
648
|
+
code: o.code,
|
|
649
|
+
message: o.message,
|
|
650
|
+
command: o.command,
|
|
651
|
+
roomCode: o.room_code,
|
|
652
|
+
appID: o.app_id,
|
|
653
|
+
requestId: o.request_id,
|
|
654
|
+
frontRequestId: o.front_request_id,
|
|
655
|
+
triggerUserID: o.trigger_user_id,
|
|
656
|
+
data: o.data || {}
|
|
508
657
|
}, i = Object.keys(e).filter(
|
|
509
658
|
(n) => e[n] === void 0
|
|
510
659
|
);
|
|
511
660
|
return i.length > 0 && console.warn(`推送数据格式异常:${i.join(" ")} 值不存在!`), e;
|
|
512
|
-
} catch (
|
|
661
|
+
} catch (o) {
|
|
513
662
|
return !1;
|
|
514
663
|
}
|
|
515
664
|
}
|
|
516
|
-
var x = /* @__PURE__ */ ((r) => (r[r.NOTINITIALIZED = -1] = "NOTINITIALIZED", r[r.CONNECTING = 0] = "CONNECTING", r[r.OPEN = 1] = "OPEN", r[r.CLOSED = 3] = "CLOSED", r))(x || {}), er = /* @__PURE__ */ ((r) => (r[r.Normal = 0] = "Normal", r[r.Removed = 1] = "Removed", r[r.Replaced = 2] = "Replaced", r))(er || {}), tr = /* @__PURE__ */ ((r) => (r.WAIT_ENTER = "WAIT_ENTER", r.ONLINE = "ONLINE", r.LEAVE = "LEAVE", r.KICK_OUT = "KICK_OUT", r.BE_REPLACE = "BE_REPLACE", r.EXCEPTION = "EXCEPTION", r))(tr || {}),
|
|
665
|
+
var x = /* @__PURE__ */ ((r) => (r[r.NOTINITIALIZED = -1] = "NOTINITIALIZED", r[r.CONNECTING = 0] = "CONNECTING", r[r.OPEN = 1] = "OPEN", r[r.CLOSED = 3] = "CLOSED", r))(x || {}), er = /* @__PURE__ */ ((r) => (r[r.Normal = 0] = "Normal", r[r.Removed = 1] = "Removed", r[r.Replaced = 2] = "Replaced", r))(er || {}), tr = /* @__PURE__ */ ((r) => (r.WAIT_ENTER = "WAIT_ENTER", r.ONLINE = "ONLINE", r.LEAVE = "LEAVE", r.KICK_OUT = "KICK_OUT", r.BE_REPLACE = "BE_REPLACE", r.EXCEPTION = "EXCEPTION", r))(tr || {}), Ae = /* @__PURE__ */ ((r) => (r[r.NOTINITIALIZED = -1] = "NOTINITIALIZED", r[r.CONNECTING = 0] = "CONNECTING", r[r.OPEN = 1] = "OPEN", r[r.CLOSING = 2] = "CLOSING", r[r.CLOSED = 3] = "CLOSED", r))(Ae || {}), rr = /* @__PURE__ */ ((r) => (r.Error = "Error", r.Close = "Close", r.MicroAuth = "MicroAuth", r.DuplicateConnect = "DuplicateConnect", r.IllegalURL = "IllegalURL", r.Unknown = "Unknown", r.IllegalArgs = "IllegalArgs", r))(rr || {}), ir = /* @__PURE__ */ ((r) => (r.Err_1000 = "CLOSE_NORMAL", r.Err_1001 = "CLOSE_GOING_AWAY", r.Err_1002 = "CLOSE_PROTOCOL_ERROR", r.Err_1003 = "CLOSE_UNSUPPORTED", r.Err_1006 = "CLOSE_ABNORMAL", r.Err_1007 = "Unsupported Data", r.Err_1008 = "Policy Violation", r.Err_1009 = "CLOSE_TOO_LARGE", r.Err_unknown = "unknown", r))(ir || {});
|
|
517
666
|
function nr(r) {
|
|
518
667
|
switch (r) {
|
|
519
668
|
case 1e3:
|
|
@@ -541,81 +690,81 @@ function sr(r) {
|
|
|
541
690
|
var ft = {};
|
|
542
691
|
(function(r) {
|
|
543
692
|
Object.defineProperty(r, "__esModule", { value: !0 }), r.LogLevel = void 0;
|
|
544
|
-
var
|
|
693
|
+
var o;
|
|
545
694
|
(function(e) {
|
|
546
695
|
e[e.DEBUG = 0] = "DEBUG", e[e.INFO = 1] = "INFO", e[e.WARN = 2] = "WARN", e[e.ERROR = 3] = "ERROR", e[e.OFF = 4] = "OFF";
|
|
547
|
-
})(
|
|
696
|
+
})(o = r.LogLevel || (r.LogLevel = {})), r.default = o;
|
|
548
697
|
})(ft);
|
|
549
|
-
const
|
|
550
|
-
function or(r,
|
|
551
|
-
const e = r.indexOf("?") !== -1, i = Object.keys(
|
|
552
|
-
(n,
|
|
698
|
+
const ot = /* @__PURE__ */ sr(ft);
|
|
699
|
+
function or(r, o = {}) {
|
|
700
|
+
const e = r.indexOf("?") !== -1, i = Object.keys(o).reduce(
|
|
701
|
+
(n, a, u) => `${n}${u === 0 && !e ? "?" : "&"}${a}=${o[a]}`,
|
|
553
702
|
""
|
|
554
703
|
);
|
|
555
704
|
return r + i;
|
|
556
705
|
}
|
|
557
|
-
const
|
|
558
|
-
function
|
|
706
|
+
const fe = globalThis.navigator.userAgent, ar = /android/gi.test(fe), cr = /iPhone|iPad\s+OS/gi.test(fe), ur = /MicroMessenger/gi.test(fe) && /miniProgram/gi.test(fe), lr = /realsee/gi.test(fe);
|
|
707
|
+
function be(r) {
|
|
559
708
|
return Object.prototype.toString.call(r) === "[object Object]";
|
|
560
709
|
}
|
|
561
|
-
function
|
|
562
|
-
return r ===
|
|
710
|
+
function we(r, o) {
|
|
711
|
+
return r === o ? !0 : typeof r != typeof o ? !1 : !!(Number.isNaN(r) && Number.isNaN(o));
|
|
563
712
|
}
|
|
564
|
-
function fr(r,
|
|
565
|
-
const e = Object.getOwnPropertyNames(r), i = Object.getOwnPropertyNames(
|
|
713
|
+
function fr(r, o) {
|
|
714
|
+
const e = Object.getOwnPropertyNames(r), i = Object.getOwnPropertyNames(o);
|
|
566
715
|
if (e.length !== i.length)
|
|
567
716
|
return !1;
|
|
568
|
-
for (let n = 0,
|
|
717
|
+
for (let n = 0, a = e.length; n < a; n++) {
|
|
569
718
|
const u = e[n];
|
|
570
|
-
if (!
|
|
719
|
+
if (!we(r[u], o[u]))
|
|
571
720
|
return !1;
|
|
572
721
|
}
|
|
573
722
|
return !0;
|
|
574
723
|
}
|
|
575
|
-
function dr(r,
|
|
576
|
-
if (r.length !==
|
|
724
|
+
function dr(r, o) {
|
|
725
|
+
if (r.length !== o.length)
|
|
577
726
|
return !1;
|
|
578
727
|
for (let e = 0, i = r.length; e < i; e++)
|
|
579
|
-
if (!
|
|
728
|
+
if (!we(r[e], o[e]))
|
|
580
729
|
return !1;
|
|
581
730
|
return !0;
|
|
582
731
|
}
|
|
583
|
-
function hr(r,
|
|
584
|
-
return
|
|
732
|
+
function hr(r, o) {
|
|
733
|
+
return we(r, o) ? !0 : be(r) && be(o) ? fr(r, o) : Array.isArray(r) && Array.isArray(o) ? dr(r, o) : !1;
|
|
585
734
|
}
|
|
586
|
-
function De(r,
|
|
587
|
-
return
|
|
735
|
+
function De(r, o) {
|
|
736
|
+
return we(r, o) ? !0 : be(r) && be(o) ? gr(r, o) : Array.isArray(r) && Array.isArray(o) ? _r(r, o) : !1;
|
|
588
737
|
}
|
|
589
|
-
function _r(r,
|
|
590
|
-
if (r.length !==
|
|
738
|
+
function _r(r, o) {
|
|
739
|
+
if (r.length !== o.length)
|
|
591
740
|
return !1;
|
|
592
741
|
for (let e = 0, i = r.length; e < i; e++)
|
|
593
|
-
if (!De(r[e],
|
|
742
|
+
if (!De(r[e], o[e]))
|
|
594
743
|
return !1;
|
|
595
744
|
return !0;
|
|
596
745
|
}
|
|
597
|
-
function gr(r,
|
|
598
|
-
const e = Object.getOwnPropertyNames(r), i = Object.getOwnPropertyNames(
|
|
746
|
+
function gr(r, o) {
|
|
747
|
+
const e = Object.getOwnPropertyNames(r), i = Object.getOwnPropertyNames(o);
|
|
599
748
|
if (e.length !== i.length)
|
|
600
749
|
return !1;
|
|
601
|
-
for (let n = 0,
|
|
750
|
+
for (let n = 0, a = e.length; n < a; n++) {
|
|
602
751
|
const u = e[n];
|
|
603
|
-
if (!De(r[u],
|
|
752
|
+
if (!De(r[u], o[u]))
|
|
604
753
|
return !1;
|
|
605
754
|
}
|
|
606
755
|
return !0;
|
|
607
756
|
}
|
|
608
|
-
function
|
|
609
|
-
return e.deep ? De(r,
|
|
757
|
+
function at(r, o, e = { deep: !1 }) {
|
|
758
|
+
return e.deep ? De(r, o) : hr(r, o);
|
|
610
759
|
}
|
|
611
|
-
class mr extends
|
|
760
|
+
class mr extends le {
|
|
612
761
|
constructor(e) {
|
|
613
762
|
super();
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
763
|
+
s(this, "_realWebSocket");
|
|
764
|
+
s(this, "_url");
|
|
765
|
+
s(this, "_protocols");
|
|
766
|
+
s(this, "_readyState", Ae.NOTINITIALIZED);
|
|
767
|
+
s(this, "_options", {
|
|
619
768
|
timeout: 1e4,
|
|
620
769
|
shouldReconnect: (e, i) => {
|
|
621
770
|
if (!(e.code === 1008 || e.code === 1011))
|
|
@@ -625,74 +774,74 @@ class mr extends ue {
|
|
|
625
774
|
ignoreConnectivityEvents: !1,
|
|
626
775
|
automaticOpen: !1
|
|
627
776
|
});
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
777
|
+
s(this, "_connectTimeout");
|
|
778
|
+
s(this, "_attempts", 0);
|
|
779
|
+
s(this, "_reconnects", -1);
|
|
780
|
+
s(this, "_reconnectWhenOnlineAgain", !1);
|
|
781
|
+
s(this, "_explicitlyClosed", !1);
|
|
782
|
+
s(this, "_pendingReconnect");
|
|
783
|
+
s(this, "_connectivityEventsAttached", !1);
|
|
784
|
+
s(this, "_heathCheckTimer");
|
|
636
785
|
/**
|
|
637
786
|
* 做一个健康检查
|
|
638
787
|
*/
|
|
639
|
-
|
|
640
|
-
this._realWebSocket && this._realWebSocket.readyState !== this._readyState && (this._readyState = this._realWebSocket.readyState, this._readyState ===
|
|
788
|
+
s(this, "_healthCheck", async () => {
|
|
789
|
+
this._realWebSocket && this._realWebSocket.readyState !== this._readyState && (this._readyState = this._realWebSocket.readyState, this._readyState === Ae.CLOSING && this.emit("closing")), await new Promise((e) => setTimeout(e, 2e3)), this._heathCheckTimer = requestAnimationFrame(this._healthCheck);
|
|
641
790
|
});
|
|
642
791
|
/**
|
|
643
792
|
* 清理超时计时器
|
|
644
793
|
*/
|
|
645
|
-
|
|
794
|
+
s(this, "_clearConnectTimeoutIfNeed", () => {
|
|
646
795
|
this._connectTimeout && (clearTimeout(this._connectTimeout), this._connectTimeout = void 0);
|
|
647
796
|
});
|
|
648
797
|
/**
|
|
649
798
|
* 清理健康检查
|
|
650
799
|
*/
|
|
651
|
-
|
|
800
|
+
s(this, "_clearHeathCheckIfNeed", () => {
|
|
652
801
|
this._heathCheckTimer && (cancelAnimationFrame(this._heathCheckTimer), this._heathCheckTimer = void 0);
|
|
653
802
|
});
|
|
654
803
|
/**
|
|
655
804
|
* 开启健康检查
|
|
656
805
|
*/
|
|
657
|
-
|
|
806
|
+
s(this, "_startHealthCheck", () => {
|
|
658
807
|
this._clearHeathCheckIfNeed(), this._heathCheckTimer = requestAnimationFrame(this._healthCheck);
|
|
659
808
|
});
|
|
660
809
|
/**
|
|
661
810
|
* 停止健康检查
|
|
662
811
|
*/
|
|
663
|
-
|
|
812
|
+
s(this, "_stopHealthCheck", () => {
|
|
664
813
|
this._clearHeathCheckIfNeed();
|
|
665
814
|
});
|
|
666
815
|
/**
|
|
667
816
|
* 清理连接中的请求
|
|
668
817
|
*/
|
|
669
|
-
|
|
818
|
+
s(this, "_clearPendingReconnectIfNeeded", () => {
|
|
670
819
|
this._pendingReconnect && (clearTimeout(this._pendingReconnect), this._pendingReconnect = void 0);
|
|
671
820
|
});
|
|
672
821
|
/**
|
|
673
822
|
* 当网页连接上网络进行重连
|
|
674
823
|
* @param event
|
|
675
824
|
*/
|
|
676
|
-
|
|
825
|
+
s(this, "_online", (e) => {
|
|
677
826
|
this._reconnectWhenOnlineAgain && (this._clearPendingReconnectIfNeeded(), this._reconnect(e));
|
|
678
827
|
});
|
|
679
828
|
/**
|
|
680
829
|
* 当网页断开网络进行关闭
|
|
681
830
|
*/
|
|
682
|
-
|
|
831
|
+
s(this, "_offline", () => {
|
|
683
832
|
var e;
|
|
684
833
|
this._reconnectWhenOnlineAgain = !0, (e = this._realWebSocket) == null || e.close(1e3, "offline");
|
|
685
834
|
});
|
|
686
835
|
/**
|
|
687
836
|
* 解除网络监听事件
|
|
688
837
|
*/
|
|
689
|
-
|
|
838
|
+
s(this, "_detachConnectivityEvents", () => {
|
|
690
839
|
this._connectivityEventsAttached && (globalThis == null || globalThis.removeEventListener("online", this._online), globalThis == null || globalThis.removeEventListener("offline", this._offline), this._connectivityEventsAttached = !1);
|
|
691
840
|
});
|
|
692
841
|
/**
|
|
693
842
|
* 注册网络监听事件
|
|
694
843
|
*/
|
|
695
|
-
|
|
844
|
+
s(this, "_attachConnectivityEvents", () => {
|
|
696
845
|
this._connectivityEventsAttached || (globalThis == null || globalThis.addEventListener("online", this._online), globalThis == null || globalThis.addEventListener("offline", this._offline), this._connectivityEventsAttached = !0);
|
|
697
846
|
});
|
|
698
847
|
/**
|
|
@@ -700,9 +849,9 @@ class mr extends ue {
|
|
|
700
849
|
* @param data
|
|
701
850
|
* @returns
|
|
702
851
|
*/
|
|
703
|
-
|
|
704
|
-
var i, n,
|
|
705
|
-
((i = this._realWebSocket) == null ? void 0 : i.readyState) === ((n = this._realWebSocket) == null ? void 0 : n.OPEN) && ((
|
|
852
|
+
s(this, "send", (e) => {
|
|
853
|
+
var i, n, a;
|
|
854
|
+
((i = this._realWebSocket) == null ? void 0 : i.readyState) === ((n = this._realWebSocket) == null ? void 0 : n.OPEN) && ((a = this._realWebSocket) == null || a.send(e));
|
|
706
855
|
});
|
|
707
856
|
/**
|
|
708
857
|
* 关闭连接
|
|
@@ -710,22 +859,22 @@ class mr extends ue {
|
|
|
710
859
|
* @param reason 原因
|
|
711
860
|
* @returns
|
|
712
861
|
*/
|
|
713
|
-
|
|
862
|
+
s(this, "close", (e, i) => {
|
|
714
863
|
var n;
|
|
715
864
|
return typeof e != "number" && (i = e, e = 1e3), this._clearPendingReconnectIfNeeded(), this._reconnectWhenOnlineAgain = !1, this._explicitlyClosed = !0, this._detachConnectivityEvents(), (n = this._realWebSocket) == null ? void 0 : n.close(e, i);
|
|
716
865
|
});
|
|
717
866
|
/**
|
|
718
867
|
* 进行ws连接
|
|
719
868
|
*/
|
|
720
|
-
|
|
869
|
+
s(this, "open", (e) => {
|
|
721
870
|
var i, n;
|
|
722
871
|
e && (this._url = e), ((i = this._realWebSocket) == null ? void 0 : i.readyState) !== WebSocket.OPEN && ((n = this._realWebSocket) == null ? void 0 : n.readyState) !== WebSocket.CONNECTING && (this._clearPendingReconnectIfNeeded(), this._reconnectWhenOnlineAgain = !1, this._explicitlyClosed = !1, this._createWebSocket());
|
|
723
872
|
});
|
|
724
873
|
/**
|
|
725
874
|
* 创建ws连接
|
|
726
875
|
*/
|
|
727
|
-
|
|
728
|
-
var n,
|
|
876
|
+
s(this, "_createWebSocket", () => {
|
|
877
|
+
var n, a, u;
|
|
729
878
|
const e = typeof this._url == "string" ? this._url : (n = this._url) == null ? void 0 : n.call(this, this);
|
|
730
879
|
if (!e)
|
|
731
880
|
return;
|
|
@@ -746,27 +895,27 @@ class mr extends ue {
|
|
|
746
895
|
})
|
|
747
896
|
);
|
|
748
897
|
};
|
|
749
|
-
this._connectTimeout = setTimeout(i, (
|
|
898
|
+
this._connectTimeout = setTimeout(i, (a = this._options) == null ? void 0 : a.timeout), this._dispatchWebSocketEvent(), (u = this._options) != null && u.ignoreConnectivityEvents || this._attachConnectivityEvents();
|
|
750
899
|
});
|
|
751
900
|
/**
|
|
752
901
|
* 断开ws事件
|
|
753
902
|
*/
|
|
754
|
-
|
|
755
|
-
var e, i, n,
|
|
756
|
-
(e = this._realWebSocket) == null || e.removeEventListener("open", this._webSocketOpenHandler), (i = this._realWebSocket) == null || i.removeEventListener("close", this._webSocketCloseHandler), (n = this._realWebSocket) == null || n.removeEventListener("error", this._webSocketErrorHandler), (
|
|
903
|
+
s(this, "_removeWebSocketEvent", () => {
|
|
904
|
+
var e, i, n, a;
|
|
905
|
+
(e = this._realWebSocket) == null || e.removeEventListener("open", this._webSocketOpenHandler), (i = this._realWebSocket) == null || i.removeEventListener("close", this._webSocketCloseHandler), (n = this._realWebSocket) == null || n.removeEventListener("error", this._webSocketErrorHandler), (a = this._realWebSocket) == null || a.removeEventListener("message", this._webSocketMessageHandler);
|
|
757
906
|
});
|
|
758
907
|
/**
|
|
759
908
|
* 分发ws事件
|
|
760
909
|
*/
|
|
761
|
-
|
|
762
|
-
var e, i, n,
|
|
763
|
-
(e = this._realWebSocket) == null || e.addEventListener("open", this._webSocketOpenHandler), (i = this._realWebSocket) == null || i.addEventListener("close", this._webSocketCloseHandler), (n = this._realWebSocket) == null || n.addEventListener("error", this._webSocketErrorHandler), (
|
|
910
|
+
s(this, "_dispatchWebSocketEvent", () => {
|
|
911
|
+
var e, i, n, a;
|
|
912
|
+
(e = this._realWebSocket) == null || e.addEventListener("open", this._webSocketOpenHandler), (i = this._realWebSocket) == null || i.addEventListener("close", this._webSocketCloseHandler), (n = this._realWebSocket) == null || n.addEventListener("error", this._webSocketErrorHandler), (a = this._realWebSocket) == null || a.addEventListener("message", this._webSocketMessageHandler);
|
|
764
913
|
});
|
|
765
914
|
/**
|
|
766
915
|
* ws连接事件
|
|
767
916
|
* @returns
|
|
768
917
|
*/
|
|
769
|
-
|
|
918
|
+
s(this, "_webSocketOpenHandler", (e) => {
|
|
770
919
|
this._connectTimeout && (clearTimeout(this._connectTimeout), this._connectTimeout = void 0);
|
|
771
920
|
const i = ++this._reconnects, n = this._attempts;
|
|
772
921
|
return this._attempts = 0, this._reconnectWhenOnlineAgain = !1, this._startHealthCheck(), this.emit("open", Object.assign(e, { detail: { reconnects: i, attempts: n } }));
|
|
@@ -776,19 +925,19 @@ class mr extends ue {
|
|
|
776
925
|
* @param event
|
|
777
926
|
* @returns
|
|
778
927
|
*/
|
|
779
|
-
|
|
928
|
+
s(this, "_webSocketCloseHandler", (e) => (this._reconnect(e), this._stopHealthCheck(), this.emit("close", e)));
|
|
780
929
|
/**
|
|
781
930
|
* ws 异常
|
|
782
931
|
* @param event
|
|
783
932
|
* @returns
|
|
784
933
|
*/
|
|
785
|
-
|
|
934
|
+
s(this, "_webSocketErrorHandler", (e) => this.emit("error", new CustomEvent("error", { detail: { error: e } })));
|
|
786
935
|
/**
|
|
787
936
|
* ws消息
|
|
788
937
|
* @param event
|
|
789
938
|
* @returns
|
|
790
939
|
*/
|
|
791
|
-
|
|
940
|
+
s(this, "_webSocketMessageHandler", (e) => this.emit("message", e));
|
|
792
941
|
e && this.setOptions(e), this._startHealthCheck();
|
|
793
942
|
}
|
|
794
943
|
get attempts() {
|
|
@@ -813,12 +962,12 @@ class mr extends ue {
|
|
|
813
962
|
* @returns
|
|
814
963
|
*/
|
|
815
964
|
_reconnect(e) {
|
|
816
|
-
var n,
|
|
965
|
+
var n, a, u, d;
|
|
817
966
|
if (!((n = this._options) != null && n.should1000Reconnect) && e.code === 1e3 || this._explicitlyClosed) {
|
|
818
967
|
this._attempts = 0;
|
|
819
968
|
return;
|
|
820
969
|
}
|
|
821
|
-
if (this._connectivityEventsAttached && ((
|
|
970
|
+
if (this._connectivityEventsAttached && ((a = globalThis == null ? void 0 : globalThis.navigator) == null ? void 0 : a.onLine) === !1) {
|
|
822
971
|
this._reconnectWhenOnlineAgain = !0;
|
|
823
972
|
return;
|
|
824
973
|
}
|
|
@@ -826,45 +975,43 @@ class mr extends ue {
|
|
|
826
975
|
typeof i == "number" && (this._pendingReconnect = setTimeout(this._createWebSocket, i));
|
|
827
976
|
}
|
|
828
977
|
}
|
|
829
|
-
class vr extends
|
|
978
|
+
class vr extends le {
|
|
830
979
|
constructor() {
|
|
831
980
|
super();
|
|
832
981
|
/**
|
|
833
982
|
* ws代理器
|
|
834
983
|
*/
|
|
835
|
-
|
|
984
|
+
s(this, "_ws", new mr({
|
|
836
985
|
url: "",
|
|
837
986
|
robustOptions: { should1000Reconnect: !0, ignoreConnectivityEvents: !0 }
|
|
838
987
|
}));
|
|
839
988
|
/**
|
|
840
989
|
* 带看连接状态
|
|
841
990
|
*/
|
|
842
|
-
|
|
991
|
+
s(this, "_state", x.NOTINITIALIZED);
|
|
843
992
|
/**
|
|
844
993
|
* 添加事件监听
|
|
845
994
|
*/
|
|
846
|
-
|
|
995
|
+
s(this, "_addWebSocketEventListeners", () => {
|
|
847
996
|
this._ws.on("close", this._handleCloseEvent), this._ws.on("closing", this._handleClosingEvent), this._ws.on("connecting", this._handleConnectingEvent), this._ws.on("error", this._handleErrorEvent), this._ws.on("message", this._handleMessageEvent), this._ws.on("open", this._handleOpenEvent), this._ws.on("timeout", this._handleTimeoutEvent);
|
|
848
997
|
});
|
|
849
998
|
/**
|
|
850
999
|
* 移除事件监听
|
|
851
1000
|
*/
|
|
852
|
-
|
|
1001
|
+
s(this, "_removeWebSocketEventListeners", () => {
|
|
853
1002
|
this._ws.off("close", this._handleCloseEvent), this._ws.off("closing", this._handleClosingEvent), this._ws.off("connecting", this._handleConnectingEvent), this._ws.off("error", this._handleErrorEvent), this._ws.off("message", this._handleMessageEvent), this._ws.off("open", this._handleOpenEvent), this._ws.off("timeout", this._handleTimeoutEvent);
|
|
854
1003
|
});
|
|
855
1004
|
/**
|
|
856
1005
|
* 处理房间关闭事件
|
|
857
1006
|
* @param event
|
|
858
1007
|
*/
|
|
859
|
-
|
|
860
|
-
O.info(
|
|
861
|
-
`live room closed bacause of ${e.code}-${e.reason || nr(e.code)}`
|
|
862
|
-
), this.state = x.CLOSED;
|
|
1008
|
+
s(this, "_handleCloseEvent", (e) => {
|
|
1009
|
+
O.info(`live room closed bacause of ${e.code}-${e.reason || nr(e.code)}`), this.state = x.CLOSED;
|
|
863
1010
|
});
|
|
864
1011
|
/**
|
|
865
1012
|
* 处理房间正在关闭事件(这个时候可能是断网了)
|
|
866
1013
|
*/
|
|
867
|
-
|
|
1014
|
+
s(this, "_handleClosingEvent", () => {
|
|
868
1015
|
var e;
|
|
869
1016
|
O.info("live room is closing, onLine:", (e = globalThis == null ? void 0 : globalThis.navigator) == null ? void 0 : e.onLine), this.state = x.CLOSED;
|
|
870
1017
|
});
|
|
@@ -872,21 +1019,21 @@ class vr extends ue {
|
|
|
872
1019
|
* 连接中
|
|
873
1020
|
* @param event
|
|
874
1021
|
*/
|
|
875
|
-
|
|
876
|
-
O.info("live room is connecting"), this.state = x.CONNECTING;
|
|
1022
|
+
s(this, "_handleConnectingEvent", (e) => {
|
|
1023
|
+
O.info("live room is connecting"), this.state = x.CONNECTING, e.detail.reconnects > 0 && this.emit("reconnecting", e.detail);
|
|
877
1024
|
});
|
|
878
1025
|
/**
|
|
879
1026
|
* 连接发送异常
|
|
880
1027
|
* @param event
|
|
881
1028
|
*/
|
|
882
|
-
|
|
1029
|
+
s(this, "_handleErrorEvent", (e) => {
|
|
883
1030
|
O.error("live room error", e), this.state = x.CLOSED;
|
|
884
1031
|
});
|
|
885
1032
|
/**
|
|
886
1033
|
* 接收到消息
|
|
887
1034
|
* @param event
|
|
888
1035
|
*/
|
|
889
|
-
|
|
1036
|
+
s(this, "_handleMessageEvent", (e) => {
|
|
890
1037
|
let i = (() => {
|
|
891
1038
|
try {
|
|
892
1039
|
return JSON.parse(e.data);
|
|
@@ -900,33 +1047,33 @@ class vr extends ue {
|
|
|
900
1047
|
* 连接建立成功
|
|
901
1048
|
* @param event
|
|
902
1049
|
*/
|
|
903
|
-
|
|
1050
|
+
s(this, "_handleOpenEvent", (e) => {
|
|
904
1051
|
O.info("live room open", e.detail), this.state = x.OPEN, e.detail.reconnects > 0 && this.emit("reconnected", e.detail);
|
|
905
1052
|
});
|
|
906
1053
|
/**
|
|
907
1054
|
* 处理超时
|
|
908
1055
|
* @param event
|
|
909
1056
|
*/
|
|
910
|
-
|
|
1057
|
+
s(this, "_handleTimeoutEvent", (e) => {
|
|
911
1058
|
O.error("live room connect timeout!", e.detail), this.state = x.CLOSED;
|
|
912
1059
|
});
|
|
913
1060
|
/**
|
|
914
1061
|
* 释放资源,释放之后需要重新实例化
|
|
915
1062
|
* @returns
|
|
916
1063
|
*/
|
|
917
|
-
|
|
1064
|
+
s(this, "dispose", async () => (this._removeWebSocketEventListeners(), await this.close("live room close by controller disposed!")));
|
|
918
1065
|
/**
|
|
919
1066
|
* 开启房间链接
|
|
920
1067
|
* @param url 房间链接
|
|
921
1068
|
* @returns
|
|
922
1069
|
*/
|
|
923
|
-
|
|
1070
|
+
s(this, "open", (e) => this._ws.open(e));
|
|
924
1071
|
/**
|
|
925
1072
|
* 关闭房间
|
|
926
1073
|
* @param code
|
|
927
1074
|
* @param reason
|
|
928
1075
|
*/
|
|
929
|
-
|
|
1076
|
+
s(this, "close", (e, i) => new Promise((n) => {
|
|
930
1077
|
this._ws.once("close", () => n(!0)), this._ws.close(e, i);
|
|
931
1078
|
}));
|
|
932
1079
|
this._addWebSocketEventListeners();
|
|
@@ -956,33 +1103,33 @@ class vr extends ue {
|
|
|
956
1103
|
this._ws && (this._ws._explicitlyClosed = !0);
|
|
957
1104
|
}
|
|
958
1105
|
}
|
|
959
|
-
const pr = (r) => Promise.reject("unimplemented method GetVoiceSign"),
|
|
1106
|
+
const pr = (r) => Promise.reject("unimplemented method GetVoiceSign"), Le = (r, o = {}, e = []) => ({
|
|
960
1107
|
command: r,
|
|
961
|
-
front_request_id:
|
|
1108
|
+
front_request_id: ye(),
|
|
962
1109
|
data: {
|
|
963
|
-
...
|
|
1110
|
+
...o,
|
|
964
1111
|
to_user_ids: Array.isArray(e) ? e : [e]
|
|
965
1112
|
}
|
|
966
1113
|
}), Er = () => {
|
|
967
|
-
var r,
|
|
968
|
-
window != null && window.__Realsee_Live__ && ((
|
|
1114
|
+
var r, o;
|
|
1115
|
+
window != null && window.__Realsee_Live__ && ((o = (r = window == null ? void 0 : window.__Realsee_Live__) == null ? void 0 : r.dispose) == null || o.call(r), window.__Realsee_Live__ = null);
|
|
969
1116
|
};
|
|
970
|
-
class yr extends
|
|
1117
|
+
class yr extends le {
|
|
971
1118
|
constructor(e) {
|
|
972
1119
|
var i;
|
|
973
1120
|
super();
|
|
974
1121
|
/**
|
|
975
1122
|
* 带看的配置
|
|
976
1123
|
*/
|
|
977
|
-
|
|
1124
|
+
s(this, "_options", {});
|
|
978
1125
|
/**
|
|
979
1126
|
* 帧数据监听
|
|
980
1127
|
*/
|
|
981
|
-
|
|
1128
|
+
s(this, "keyframes", new le());
|
|
982
1129
|
/**
|
|
983
1130
|
* 内置的一些数据
|
|
984
1131
|
*/
|
|
985
|
-
|
|
1132
|
+
s(this, "_buildInData", {
|
|
986
1133
|
keyframes: {}
|
|
987
1134
|
});
|
|
988
1135
|
/**
|
|
@@ -990,41 +1137,41 @@ class yr extends ue {
|
|
|
990
1137
|
* @param key 帧数据的键值
|
|
991
1138
|
* @returns
|
|
992
1139
|
*/
|
|
993
|
-
|
|
1140
|
+
s(this, "getFramesByKey", (e) => this.snapshot[e]);
|
|
994
1141
|
/**
|
|
995
1142
|
* 发送帧数据(需要能够被序列化)
|
|
996
1143
|
* @param key 帧数据键值
|
|
997
1144
|
* @param frame 帧数据本体
|
|
998
1145
|
* @returns
|
|
999
1146
|
*/
|
|
1000
|
-
|
|
1147
|
+
s(this, "sendKeyframe", (e, i) => {
|
|
1001
1148
|
if (this.state !== x.OPEN)
|
|
1002
1149
|
return !1;
|
|
1003
1150
|
this._buildInData.keyframes = {
|
|
1004
1151
|
...this._buildInData.keyframes,
|
|
1005
1152
|
[e]: i
|
|
1006
1153
|
};
|
|
1007
|
-
const n =
|
|
1154
|
+
const n = Le(K.KeyframeSync, this.snapshot);
|
|
1008
1155
|
try {
|
|
1009
1156
|
return this._controller.sendMessage(n), !0;
|
|
1010
|
-
} catch (
|
|
1011
|
-
return O.error(
|
|
1157
|
+
} catch (a) {
|
|
1158
|
+
return O.error(a), !1;
|
|
1012
1159
|
}
|
|
1013
1160
|
});
|
|
1014
1161
|
/**
|
|
1015
1162
|
* 带看控制器
|
|
1016
1163
|
*/
|
|
1017
|
-
|
|
1164
|
+
s(this, "_controller", new vr());
|
|
1018
1165
|
/**
|
|
1019
1166
|
* 添加带看控制的事件监听
|
|
1020
1167
|
*/
|
|
1021
|
-
|
|
1168
|
+
s(this, "_addLiveControllerEventListeners", () => {
|
|
1022
1169
|
this._controller.on("stateChange", this._handleStateChange), this._controller.on("message", this._handleMessage);
|
|
1023
1170
|
});
|
|
1024
1171
|
/**
|
|
1025
1172
|
* 移除带看控制的事件监听
|
|
1026
1173
|
*/
|
|
1027
|
-
|
|
1174
|
+
s(this, "_removeLiveControllerEventListeners", () => {
|
|
1028
1175
|
this._controller.off("stateChange", this._handleStateChange), this._controller.off("message", this._handleMessage);
|
|
1029
1176
|
});
|
|
1030
1177
|
/**
|
|
@@ -1032,36 +1179,36 @@ class yr extends ue {
|
|
|
1032
1179
|
* @param state
|
|
1033
1180
|
* @returns
|
|
1034
1181
|
*/
|
|
1035
|
-
|
|
1182
|
+
s(this, "_handleStateChange", (e, i) => this.emit("stateChange", e, i));
|
|
1036
1183
|
/**
|
|
1037
1184
|
* 消息接收
|
|
1038
1185
|
* @param liveMsg
|
|
1039
1186
|
*/
|
|
1040
|
-
|
|
1041
|
-
var i, n,
|
|
1187
|
+
s(this, "_handleMessage", async (e) => {
|
|
1188
|
+
var i, n, a, u, d;
|
|
1042
1189
|
if (typeof e == "object") {
|
|
1043
|
-
const { command: g, data:
|
|
1190
|
+
const { command: g, data: _ = {}, frontRequestId: E, code: y, message: I } = e;
|
|
1044
1191
|
if (y === "SUCCESS")
|
|
1045
1192
|
switch (g) {
|
|
1046
1193
|
case K.SelfUserInfo: {
|
|
1047
|
-
const
|
|
1048
|
-
|
|
1194
|
+
const m = _;
|
|
1195
|
+
at(this.selfInfo, m, { deep: !0 }) || (this._buildInData.selfInfo = m, this.emit("selfInfoUpdate", this._buildInData.selfInfo, E));
|
|
1049
1196
|
break;
|
|
1050
1197
|
}
|
|
1051
1198
|
case K.RoomInfo: {
|
|
1052
|
-
const
|
|
1053
|
-
this._buildInData.roomInfo = Object.assign({},
|
|
1199
|
+
const m = _;
|
|
1200
|
+
this._buildInData.roomInfo = Object.assign({}, m), this.emit("readyKeyframeSync", m.last_frame || {});
|
|
1054
1201
|
break;
|
|
1055
1202
|
}
|
|
1056
1203
|
case K.RTCInfo: {
|
|
1057
|
-
const { voice_id:
|
|
1058
|
-
if (this._buildInData.rtcInfo = { voiceId:
|
|
1204
|
+
const { voice_id: m, type: D } = _;
|
|
1205
|
+
if (this._buildInData.rtcInfo = { voiceId: m, type: D }, (i = this.$RTC) != null && i.joined)
|
|
1059
1206
|
O.warn("已加入语音房间,无需重复加入!");
|
|
1060
1207
|
else if (await ((u = this.$RTC) == null ? void 0 : u.join({
|
|
1061
|
-
voiceId:
|
|
1208
|
+
voiceId: m,
|
|
1062
1209
|
userId: ((n = this.selfInfo) == null ? void 0 : n.id) || "",
|
|
1063
|
-
roomId: (
|
|
1064
|
-
type:
|
|
1210
|
+
roomId: (a = this.roomInfo) == null ? void 0 : a.info.room_code,
|
|
1211
|
+
type: D
|
|
1065
1212
|
}))) {
|
|
1066
1213
|
const k = (d = this._options.initialMicroStatus) != null ? d : Z.OPEN;
|
|
1067
1214
|
await this.toggleMicro(k === Z.OPEN);
|
|
@@ -1070,36 +1217,36 @@ class yr extends ue {
|
|
|
1070
1217
|
break;
|
|
1071
1218
|
}
|
|
1072
1219
|
case K.UserList: {
|
|
1073
|
-
const
|
|
1074
|
-
this._buildInData.userList =
|
|
1220
|
+
const m = _;
|
|
1221
|
+
this._buildInData.userList = m, this.emit("userListUpdate", this.userList, E);
|
|
1075
1222
|
break;
|
|
1076
1223
|
}
|
|
1077
1224
|
case K.CustomEvent: {
|
|
1078
|
-
const
|
|
1079
|
-
this.emit("broadcast",
|
|
1225
|
+
const m = _;
|
|
1226
|
+
this.emit("broadcast", m, E);
|
|
1080
1227
|
break;
|
|
1081
1228
|
}
|
|
1082
1229
|
case K.KeyframeSync: {
|
|
1083
|
-
const
|
|
1084
|
-
(
|
|
1085
|
-
if (
|
|
1230
|
+
const m = _, D = Object.keys(m).reduce(
|
|
1231
|
+
(w, k) => {
|
|
1232
|
+
if (at(m[k], this._buildInData.keyframes[k], {
|
|
1086
1233
|
deep: !0
|
|
1087
1234
|
}))
|
|
1088
|
-
return
|
|
1089
|
-
const U = [
|
|
1235
|
+
return w;
|
|
1236
|
+
const U = [m[k], this._buildInData.keyframes[k], E], P = k;
|
|
1090
1237
|
return this.keyframes.emit(
|
|
1091
1238
|
P,
|
|
1092
1239
|
...U
|
|
1093
|
-
), this._buildInData.keyframes[k] =
|
|
1240
|
+
), this._buildInData.keyframes[k] = m[k], w[k] = m[k], w;
|
|
1094
1241
|
},
|
|
1095
1242
|
{}
|
|
1096
1243
|
);
|
|
1097
|
-
this.emit("keyframes",
|
|
1244
|
+
this.emit("keyframes", D, E);
|
|
1098
1245
|
break;
|
|
1099
1246
|
}
|
|
1100
1247
|
case K.BuiltinMsg: {
|
|
1101
|
-
const
|
|
1102
|
-
this.emit("builtinEvent",
|
|
1248
|
+
const m = _;
|
|
1249
|
+
this.emit("builtinEvent", m), m.event_type === q.UserChange && this.emit("userChange", m), m.event_type === q.RoomChange && this.emit("roomChange", m), m.event_type === q.UserChange && m.action === J.UserMicroStatus && await this.toggleMicro(m.data.status === Z.OPEN), m.event_type === q.RoomChange && m.action === J.RoomClose && await this._exit();
|
|
1103
1250
|
break;
|
|
1104
1251
|
}
|
|
1105
1252
|
case K.UserKickOut: {
|
|
@@ -1116,7 +1263,7 @@ class yr extends ue {
|
|
|
1116
1263
|
/**
|
|
1117
1264
|
* 清理带看缓存的数据
|
|
1118
1265
|
*/
|
|
1119
|
-
|
|
1266
|
+
s(this, "_clearLiveData", () => {
|
|
1120
1267
|
this._buildInData = { keyframes: {} };
|
|
1121
1268
|
});
|
|
1122
1269
|
/**
|
|
@@ -1124,9 +1271,9 @@ class yr extends ue {
|
|
|
1124
1271
|
* @param options
|
|
1125
1272
|
* @returns
|
|
1126
1273
|
*/
|
|
1127
|
-
|
|
1128
|
-
var u, d, g,
|
|
1129
|
-
if (this._options.url = (d = (u = e.url) != null ? u : this._options.url) != null ? d : "", this._options.getTicket = (g = e.getTicket) != null ? g : this._options.getTicket, this._options.initialMicroStatus = (
|
|
1274
|
+
s(this, "connect", async (e = {}) => {
|
|
1275
|
+
var u, d, g, _;
|
|
1276
|
+
if (this._options.url = (d = (u = e.url) != null ? u : this._options.url) != null ? d : "", this._options.getTicket = (g = e.getTicket) != null ? g : this._options.getTicket, this._options.initialMicroStatus = (_ = e.rtcMicStatus) != null ? _ : this._options.initialMicroStatus, !/^ws(s):\/\//.test(this._options.url) || typeof this._options.getTicket != "function")
|
|
1130
1277
|
return /^ws(s):\/\//.test(this._options.url) ? typeof this._options.getTicket != "function" ? new Error("getTicket muse be function") : !1 : new Error("Illegal realsee live room link");
|
|
1131
1278
|
const { force: i = !1 } = e;
|
|
1132
1279
|
if (this._options.rtc && !await this._options.rtc.detectMicro())
|
|
@@ -1142,17 +1289,17 @@ class yr extends ue {
|
|
|
1142
1289
|
else
|
|
1143
1290
|
return new Error("已有Live实例正在连接中,请勿重复连接!");
|
|
1144
1291
|
this._clearLiveData();
|
|
1145
|
-
const
|
|
1292
|
+
const a = or(this._options.url, {
|
|
1146
1293
|
ticket: await this._options.getTicket(),
|
|
1147
1294
|
force: Number(!!i)
|
|
1148
1295
|
});
|
|
1149
|
-
return this._controller.open(
|
|
1296
|
+
return this._controller.open(a), !0;
|
|
1150
1297
|
});
|
|
1151
1298
|
/**
|
|
1152
1299
|
* 退出带看
|
|
1153
1300
|
* @returns
|
|
1154
1301
|
*/
|
|
1155
|
-
|
|
1302
|
+
s(this, "_exit", async () => {
|
|
1156
1303
|
var e;
|
|
1157
1304
|
this._clearLiveData();
|
|
1158
1305
|
try {
|
|
@@ -1162,13 +1309,18 @@ class yr extends ue {
|
|
|
1162
1309
|
}
|
|
1163
1310
|
return this.state !== x.OPEN ? !0 : await this._controller.close();
|
|
1164
1311
|
});
|
|
1312
|
+
/**
|
|
1313
|
+
* 退出带看
|
|
1314
|
+
* @returns
|
|
1315
|
+
*/
|
|
1316
|
+
s(this, "exit", async () => this.close());
|
|
1165
1317
|
/**
|
|
1166
1318
|
* 关闭带看房间
|
|
1167
1319
|
* @param code
|
|
1168
1320
|
* @param reason
|
|
1169
1321
|
* @returns
|
|
1170
1322
|
*/
|
|
1171
|
-
|
|
1323
|
+
s(this, "close", async () => {
|
|
1172
1324
|
var e;
|
|
1173
1325
|
await this._controller.readyClose();
|
|
1174
1326
|
try {
|
|
@@ -1176,28 +1328,28 @@ class yr extends ue {
|
|
|
1176
1328
|
} catch (i) {
|
|
1177
1329
|
O.warn(i);
|
|
1178
1330
|
}
|
|
1179
|
-
await this.updateStatus(q.RoomChange,
|
|
1331
|
+
await this.updateStatus(q.RoomChange, J.RoomClose, {});
|
|
1180
1332
|
});
|
|
1181
1333
|
/**
|
|
1182
1334
|
* 销毁带看
|
|
1183
1335
|
* @returns
|
|
1184
1336
|
*/
|
|
1185
|
-
|
|
1337
|
+
s(this, "dispose", async () => (this._removeLiveControllerEventListeners(), this._clearLiveData(), await this._controller.dispose()));
|
|
1186
1338
|
/**
|
|
1187
1339
|
* 设置自己的用户信息
|
|
1188
1340
|
* @param userInfo
|
|
1189
1341
|
* @returns
|
|
1190
1342
|
*/
|
|
1191
|
-
|
|
1343
|
+
s(this, "setSelfInfo", async (e) => await this.updateStatus(q.UserChange, J.UserInfo, e));
|
|
1192
1344
|
// 仅用于用户自己的麦克风控制
|
|
1193
|
-
|
|
1194
|
-
var n,
|
|
1195
|
-
if (!((
|
|
1345
|
+
s(this, "toggleMicro", async (e) => {
|
|
1346
|
+
var n, a, u;
|
|
1347
|
+
if (!((a = (n = this.selfInfo) == null ? void 0 : n.permission) != null && a.control_own_micro))
|
|
1196
1348
|
return !1;
|
|
1197
1349
|
const i = await ((u = this.$RTC) == null ? void 0 : u.toggleMicro(e));
|
|
1198
1350
|
return i && await this.updateStatus(
|
|
1199
1351
|
q.UserChange,
|
|
1200
|
-
|
|
1352
|
+
J.UserMicroStatus,
|
|
1201
1353
|
{
|
|
1202
1354
|
status: e ? Z.OPEN : Z.CLOSE
|
|
1203
1355
|
},
|
|
@@ -1210,11 +1362,11 @@ class yr extends ue {
|
|
|
1210
1362
|
* @param toUserIds
|
|
1211
1363
|
* @returns
|
|
1212
1364
|
*/
|
|
1213
|
-
|
|
1214
|
-
var n,
|
|
1215
|
-
return typeof this._options.canForbidUserMicro == "function" && !this._options.canForbidUserMicro(i) || !((
|
|
1365
|
+
s(this, "forbidMicro", async (e, i) => {
|
|
1366
|
+
var n, a;
|
|
1367
|
+
return typeof this._options.canForbidUserMicro == "function" && !this._options.canForbidUserMicro(i) || !((a = (n = this.selfInfo) == null ? void 0 : n.permission) != null && a.control_other_micro) ? !1 : await this.updateStatus(
|
|
1216
1368
|
q.UserChange,
|
|
1217
|
-
|
|
1369
|
+
J.UserMicroStatus,
|
|
1218
1370
|
{
|
|
1219
1371
|
status: e
|
|
1220
1372
|
},
|
|
@@ -1227,11 +1379,11 @@ class yr extends ue {
|
|
|
1227
1379
|
* @param toUserIds
|
|
1228
1380
|
* @returns
|
|
1229
1381
|
*/
|
|
1230
|
-
|
|
1231
|
-
var n,
|
|
1232
|
-
return typeof this._options.canForbidUserSync == "function" && !this._options.canForbidUserSync(i) || !((
|
|
1382
|
+
s(this, "forbidSync", async (e, i) => {
|
|
1383
|
+
var n, a;
|
|
1384
|
+
return typeof this._options.canForbidUserSync == "function" && !this._options.canForbidUserSync(i) || !((a = (n = this.selfInfo) == null ? void 0 : n.permission) != null && a.control_other_sync) ? !1 : await this.updateStatus(
|
|
1233
1385
|
q.UserChange,
|
|
1234
|
-
|
|
1386
|
+
J.UserPermission,
|
|
1235
1387
|
{ sync_frame: e },
|
|
1236
1388
|
i
|
|
1237
1389
|
);
|
|
@@ -1241,11 +1393,11 @@ class yr extends ue {
|
|
|
1241
1393
|
* @param toUserIds
|
|
1242
1394
|
* @returns
|
|
1243
1395
|
*/
|
|
1244
|
-
|
|
1396
|
+
s(this, "kick", async (e) => {
|
|
1245
1397
|
var i, n;
|
|
1246
1398
|
return typeof this._options.canForbidUserKick == "function" && !this._options.canForbidUserKick(e) || !((n = (i = this.selfInfo) == null ? void 0 : i.permission) != null && n.change_other_status) ? !1 : await this.updateStatus(
|
|
1247
1399
|
q.UserChange,
|
|
1248
|
-
|
|
1400
|
+
J.UserStatus,
|
|
1249
1401
|
{
|
|
1250
1402
|
status: "KICK_OUT"
|
|
1251
1403
|
},
|
|
@@ -1264,7 +1416,7 @@ class yr extends ue {
|
|
|
1264
1416
|
switch (e.getVoiceSign || O.error("GetVoiceSign method must be passed when using built-in RTC instances"), e.rtcType) {
|
|
1265
1417
|
case Q.RealseeVRWebViewRTC: {
|
|
1266
1418
|
if (this._options.jsBridge)
|
|
1267
|
-
return new
|
|
1419
|
+
return new st({
|
|
1268
1420
|
jsBridge: this._options.jsBridge,
|
|
1269
1421
|
getVoiceSign: this._options.getVoiceSign
|
|
1270
1422
|
});
|
|
@@ -1272,12 +1424,12 @@ class yr extends ue {
|
|
|
1272
1424
|
return;
|
|
1273
1425
|
}
|
|
1274
1426
|
case Q.RealseeBrowserChimeRTC:
|
|
1275
|
-
return new
|
|
1427
|
+
return new nt({
|
|
1276
1428
|
getVoiceSign: this._options.getVoiceSign,
|
|
1277
|
-
logLevel: e.__debug__ ?
|
|
1429
|
+
logLevel: e.__debug__ ? ot.DEBUG : ot.INFO
|
|
1278
1430
|
});
|
|
1279
1431
|
case Q.RealseeBrowserRTC:
|
|
1280
|
-
return this._options.autoPlayConfirm || O.error("autoPlayConfirm method must be passed when using built-in RealseeBrowserRTC instances"), new
|
|
1432
|
+
return this._options.autoPlayConfirm || O.error("autoPlayConfirm method must be passed when using built-in RealseeBrowserRTC instances"), new it({
|
|
1281
1433
|
getVoiceSign: this._options.getVoiceSign,
|
|
1282
1434
|
autoPlayConfirm: this._options.autoPlayConfirm
|
|
1283
1435
|
});
|
|
@@ -1288,12 +1440,12 @@ class yr extends ue {
|
|
|
1288
1440
|
}
|
|
1289
1441
|
if (e.useBuiltInRTC) {
|
|
1290
1442
|
if (e.getVoiceSign || O.error("GetVoiceSign method must be passed when using built-in RTC instances"), this._options.jsBridge)
|
|
1291
|
-
return lr && (ar || cr) || ur ? new
|
|
1443
|
+
return lr && (ar || cr) || ur ? new st({
|
|
1292
1444
|
jsBridge: this._options.jsBridge,
|
|
1293
1445
|
getVoiceSign: this._options.getVoiceSign
|
|
1294
|
-
}) : e.builtInRTCType ===
|
|
1446
|
+
}) : e.builtInRTCType === lt.RealseeXChimeRTC ? new nt({
|
|
1295
1447
|
getVoiceSign: this._options.getVoiceSign
|
|
1296
|
-
}) : new
|
|
1448
|
+
}) : new it({
|
|
1297
1449
|
getVoiceSign: this._options.getVoiceSign,
|
|
1298
1450
|
autoPlayConfirm: this._options.autoPlayConfirm
|
|
1299
1451
|
});
|
|
@@ -1369,10 +1521,10 @@ class yr extends ue {
|
|
|
1369
1521
|
* @param toUserIds
|
|
1370
1522
|
* @returns
|
|
1371
1523
|
*/
|
|
1372
|
-
async updateStatus(e, i, n,
|
|
1524
|
+
async updateStatus(e, i, n, a) {
|
|
1373
1525
|
if (this.state !== x.OPEN)
|
|
1374
1526
|
return !1;
|
|
1375
|
-
const u = Object.assign({ event_type: e, action: i }, { data: n }), d =
|
|
1527
|
+
const u = Object.assign({ event_type: e, action: i }, { data: n }), d = Le(K.BuiltinMsg, u, a);
|
|
1376
1528
|
try {
|
|
1377
1529
|
return this._controller.sendMessage(d), !0;
|
|
1378
1530
|
} catch (g) {
|
|
@@ -1387,11 +1539,11 @@ class yr extends ue {
|
|
|
1387
1539
|
* @returns
|
|
1388
1540
|
*/
|
|
1389
1541
|
broadcast(e, i, n) {
|
|
1390
|
-
return this.state !== x.OPEN ? !1 : new Promise((
|
|
1391
|
-
const d =
|
|
1542
|
+
return this.state !== x.OPEN ? !1 : new Promise((a, u) => {
|
|
1543
|
+
const d = Le(K.CustomEvent, e, i), g = d.front_request_id, _ = n ? setTimeout(() => {
|
|
1392
1544
|
u(new Error("RESPONSE TIMEOUT")), this.off("broadcast", E);
|
|
1393
1545
|
}, n) : void 0, E = (y, I) => {
|
|
1394
|
-
I === g && (
|
|
1546
|
+
I === g && (_ && clearTimeout(_), this.off("broadcast", E), a(y));
|
|
1395
1547
|
};
|
|
1396
1548
|
this.on("broadcast", E);
|
|
1397
1549
|
try {
|
|
@@ -1403,14 +1555,14 @@ class yr extends ue {
|
|
|
1403
1555
|
}
|
|
1404
1556
|
}
|
|
1405
1557
|
const br = (r) => (Er(), new yr(r));
|
|
1406
|
-
var
|
|
1558
|
+
var Ve = {}, Sr = {
|
|
1407
1559
|
get exports() {
|
|
1408
|
-
return
|
|
1560
|
+
return Ve;
|
|
1409
1561
|
},
|
|
1410
1562
|
set exports(r) {
|
|
1411
|
-
|
|
1563
|
+
Ve = r;
|
|
1412
1564
|
}
|
|
1413
|
-
},
|
|
1565
|
+
}, ae = {};
|
|
1414
1566
|
/**
|
|
1415
1567
|
* @license React
|
|
1416
1568
|
* react-jsx-runtime.production.min.js
|
|
@@ -1420,25 +1572,25 @@ var Ae = {}, Sr = {
|
|
|
1420
1572
|
* This source code is licensed under the MIT license found in the
|
|
1421
1573
|
* LICENSE file in the root directory of this source tree.
|
|
1422
1574
|
*/
|
|
1423
|
-
var
|
|
1424
|
-
function
|
|
1425
|
-
if (
|
|
1426
|
-
return
|
|
1427
|
-
|
|
1428
|
-
var r =
|
|
1429
|
-
function u(d, g,
|
|
1430
|
-
var E, y = {}, I = null,
|
|
1431
|
-
|
|
1575
|
+
var ct;
|
|
1576
|
+
function wr() {
|
|
1577
|
+
if (ct)
|
|
1578
|
+
return ae;
|
|
1579
|
+
ct = 1;
|
|
1580
|
+
var r = M, o = Symbol.for("react.element"), e = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, n = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, a = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
1581
|
+
function u(d, g, _) {
|
|
1582
|
+
var E, y = {}, I = null, m = null;
|
|
1583
|
+
_ !== void 0 && (I = "" + _), g.key !== void 0 && (I = "" + g.key), g.ref !== void 0 && (m = g.ref);
|
|
1432
1584
|
for (E in g)
|
|
1433
|
-
i.call(g, E) && !
|
|
1585
|
+
i.call(g, E) && !a.hasOwnProperty(E) && (y[E] = g[E]);
|
|
1434
1586
|
if (d && d.defaultProps)
|
|
1435
1587
|
for (E in g = d.defaultProps, g)
|
|
1436
1588
|
y[E] === void 0 && (y[E] = g[E]);
|
|
1437
|
-
return { $$typeof:
|
|
1589
|
+
return { $$typeof: o, type: d, key: I, ref: m, props: y, _owner: n.current };
|
|
1438
1590
|
}
|
|
1439
|
-
return
|
|
1591
|
+
return ae.Fragment = e, ae.jsx = u, ae.jsxs = u, ae;
|
|
1440
1592
|
}
|
|
1441
|
-
var
|
|
1593
|
+
var ce = {};
|
|
1442
1594
|
/**
|
|
1443
1595
|
* @license React
|
|
1444
1596
|
* react-jsx-runtime.development.js
|
|
@@ -1448,51 +1600,51 @@ var ae = {};
|
|
|
1448
1600
|
* This source code is licensed under the MIT license found in the
|
|
1449
1601
|
* LICENSE file in the root directory of this source tree.
|
|
1450
1602
|
*/
|
|
1451
|
-
var
|
|
1452
|
-
function
|
|
1453
|
-
return
|
|
1454
|
-
var r =
|
|
1603
|
+
var ut;
|
|
1604
|
+
function Cr() {
|
|
1605
|
+
return ut || (ut = 1, process.env.NODE_ENV !== "production" && function() {
|
|
1606
|
+
var r = M, o = Symbol.for("react.element"), e = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), n = Symbol.for("react.strict_mode"), a = Symbol.for("react.profiler"), u = Symbol.for("react.provider"), d = Symbol.for("react.context"), g = Symbol.for("react.forward_ref"), _ = Symbol.for("react.suspense"), E = Symbol.for("react.suspense_list"), y = Symbol.for("react.memo"), I = Symbol.for("react.lazy"), m = Symbol.for("react.offscreen"), D = Symbol.iterator, w = "@@iterator";
|
|
1455
1607
|
function k(t) {
|
|
1456
1608
|
if (t === null || typeof t != "object")
|
|
1457
1609
|
return null;
|
|
1458
|
-
var
|
|
1459
|
-
return typeof
|
|
1610
|
+
var c = D && t[D] || t[w];
|
|
1611
|
+
return typeof c == "function" ? c : null;
|
|
1460
1612
|
}
|
|
1461
1613
|
var U = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
1462
1614
|
function P(t) {
|
|
1463
1615
|
{
|
|
1464
|
-
for (var
|
|
1616
|
+
for (var c = arguments.length, l = new Array(c > 1 ? c - 1 : 0), h = 1; h < c; h++)
|
|
1465
1617
|
l[h - 1] = arguments[h];
|
|
1466
|
-
|
|
1618
|
+
de("error", t, l);
|
|
1467
1619
|
}
|
|
1468
1620
|
}
|
|
1469
|
-
function
|
|
1621
|
+
function de(t, c, l) {
|
|
1470
1622
|
{
|
|
1471
1623
|
var h = U.ReactDebugCurrentFrame, b = h.getStackAddendum();
|
|
1472
|
-
b !== "" && (
|
|
1624
|
+
b !== "" && (c += "%s", l = l.concat([b]));
|
|
1473
1625
|
var R = l.map(function(p) {
|
|
1474
1626
|
return String(p);
|
|
1475
1627
|
});
|
|
1476
|
-
R.unshift("Warning: " +
|
|
1628
|
+
R.unshift("Warning: " + c), Function.prototype.apply.call(console[t], console, R);
|
|
1477
1629
|
}
|
|
1478
1630
|
}
|
|
1479
|
-
var f = !1,
|
|
1480
|
-
|
|
1481
|
-
function
|
|
1482
|
-
return !!(typeof t == "string" || typeof t == "function" || t === i || t ===
|
|
1631
|
+
var f = !1, C = !1, A = !1, S = !1, N = !1, V;
|
|
1632
|
+
V = Symbol.for("react.module.reference");
|
|
1633
|
+
function W(t) {
|
|
1634
|
+
return !!(typeof t == "string" || typeof t == "function" || t === i || t === a || N || t === n || t === _ || t === E || S || t === m || f || C || A || typeof t == "object" && t !== null && (t.$$typeof === I || t.$$typeof === y || t.$$typeof === u || t.$$typeof === d || t.$$typeof === g || // This needs to include all possible module reference object
|
|
1483
1635
|
// types supported by any Flight configuration anywhere since
|
|
1484
1636
|
// we don't know which Flight build this will end up being used
|
|
1485
1637
|
// with.
|
|
1486
|
-
t.$$typeof ===
|
|
1638
|
+
t.$$typeof === V || t.getModuleId !== void 0));
|
|
1487
1639
|
}
|
|
1488
|
-
function
|
|
1640
|
+
function H(t, c, l) {
|
|
1489
1641
|
var h = t.displayName;
|
|
1490
1642
|
if (h)
|
|
1491
1643
|
return h;
|
|
1492
|
-
var b =
|
|
1644
|
+
var b = c.displayName || c.name || "";
|
|
1493
1645
|
return b !== "" ? l + "(" + b + ")" : l;
|
|
1494
1646
|
}
|
|
1495
|
-
function
|
|
1647
|
+
function se(t) {
|
|
1496
1648
|
return t.displayName || "Context";
|
|
1497
1649
|
}
|
|
1498
1650
|
function G(t) {
|
|
@@ -1507,11 +1659,11 @@ function wr() {
|
|
|
1507
1659
|
return "Fragment";
|
|
1508
1660
|
case e:
|
|
1509
1661
|
return "Portal";
|
|
1510
|
-
case
|
|
1662
|
+
case a:
|
|
1511
1663
|
return "Profiler";
|
|
1512
1664
|
case n:
|
|
1513
1665
|
return "StrictMode";
|
|
1514
|
-
case
|
|
1666
|
+
case _:
|
|
1515
1667
|
return "Suspense";
|
|
1516
1668
|
case E:
|
|
1517
1669
|
return "SuspenseList";
|
|
@@ -1519,13 +1671,13 @@ function wr() {
|
|
|
1519
1671
|
if (typeof t == "object")
|
|
1520
1672
|
switch (t.$$typeof) {
|
|
1521
1673
|
case d:
|
|
1522
|
-
var
|
|
1523
|
-
return
|
|
1674
|
+
var c = t;
|
|
1675
|
+
return se(c) + ".Consumer";
|
|
1524
1676
|
case u:
|
|
1525
1677
|
var l = t;
|
|
1526
|
-
return
|
|
1678
|
+
return se(l._context) + ".Provider";
|
|
1527
1679
|
case g:
|
|
1528
|
-
return
|
|
1680
|
+
return H(t, t.render, "ForwardRef");
|
|
1529
1681
|
case y:
|
|
1530
1682
|
var h = t.displayName || null;
|
|
1531
1683
|
return h !== null ? h : G(t.type) || "Memo";
|
|
@@ -1533,25 +1685,25 @@ function wr() {
|
|
|
1533
1685
|
var b = t, R = b._payload, p = b._init;
|
|
1534
1686
|
try {
|
|
1535
1687
|
return G(p(R));
|
|
1536
|
-
} catch (
|
|
1688
|
+
} catch (v) {
|
|
1537
1689
|
return null;
|
|
1538
1690
|
}
|
|
1539
1691
|
}
|
|
1540
1692
|
}
|
|
1541
1693
|
return null;
|
|
1542
1694
|
}
|
|
1543
|
-
var z = Object.assign, ee = 0, T,
|
|
1544
|
-
function
|
|
1695
|
+
var z = Object.assign, ee = 0, T, F, te, he, $e, xe, Ue;
|
|
1696
|
+
function We() {
|
|
1545
1697
|
}
|
|
1546
|
-
|
|
1698
|
+
We.__reactDisabledLog = !0;
|
|
1547
1699
|
function dt() {
|
|
1548
1700
|
{
|
|
1549
1701
|
if (ee === 0) {
|
|
1550
|
-
T = console.log,
|
|
1702
|
+
T = console.log, F = console.info, te = console.warn, he = console.error, $e = console.group, xe = console.groupCollapsed, Ue = console.groupEnd;
|
|
1551
1703
|
var t = {
|
|
1552
1704
|
configurable: !0,
|
|
1553
1705
|
enumerable: !0,
|
|
1554
|
-
value:
|
|
1706
|
+
value: We,
|
|
1555
1707
|
writable: !0
|
|
1556
1708
|
};
|
|
1557
1709
|
Object.defineProperties(console, {
|
|
@@ -1580,63 +1732,63 @@ function wr() {
|
|
|
1580
1732
|
value: T
|
|
1581
1733
|
}),
|
|
1582
1734
|
info: z({}, t, {
|
|
1583
|
-
value:
|
|
1735
|
+
value: F
|
|
1584
1736
|
}),
|
|
1585
1737
|
warn: z({}, t, {
|
|
1586
1738
|
value: te
|
|
1587
1739
|
}),
|
|
1588
1740
|
error: z({}, t, {
|
|
1589
|
-
value:
|
|
1741
|
+
value: he
|
|
1590
1742
|
}),
|
|
1591
1743
|
group: z({}, t, {
|
|
1592
|
-
value:
|
|
1744
|
+
value: $e
|
|
1593
1745
|
}),
|
|
1594
1746
|
groupCollapsed: z({}, t, {
|
|
1595
|
-
value:
|
|
1747
|
+
value: xe
|
|
1596
1748
|
}),
|
|
1597
1749
|
groupEnd: z({}, t, {
|
|
1598
|
-
value:
|
|
1750
|
+
value: Ue
|
|
1599
1751
|
})
|
|
1600
1752
|
});
|
|
1601
1753
|
}
|
|
1602
1754
|
ee < 0 && P("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
1603
1755
|
}
|
|
1604
1756
|
}
|
|
1605
|
-
var Ce = U.ReactCurrentDispatcher,
|
|
1606
|
-
function
|
|
1757
|
+
var Ce = U.ReactCurrentDispatcher, Re;
|
|
1758
|
+
function _e(t, c, l) {
|
|
1607
1759
|
{
|
|
1608
|
-
if (
|
|
1760
|
+
if (Re === void 0)
|
|
1609
1761
|
try {
|
|
1610
1762
|
throw Error();
|
|
1611
1763
|
} catch (b) {
|
|
1612
1764
|
var h = b.stack.trim().match(/\n( *(at )?)/);
|
|
1613
|
-
|
|
1765
|
+
Re = h && h[1] || "";
|
|
1614
1766
|
}
|
|
1615
1767
|
return `
|
|
1616
|
-
` +
|
|
1768
|
+
` + Re + t;
|
|
1617
1769
|
}
|
|
1618
1770
|
}
|
|
1619
|
-
var
|
|
1771
|
+
var Oe = !1, ge;
|
|
1620
1772
|
{
|
|
1621
1773
|
var _t = typeof WeakMap == "function" ? WeakMap : Map;
|
|
1622
|
-
|
|
1774
|
+
ge = new _t();
|
|
1623
1775
|
}
|
|
1624
|
-
function Fe(t,
|
|
1625
|
-
if (!t ||
|
|
1776
|
+
function Fe(t, c) {
|
|
1777
|
+
if (!t || Oe)
|
|
1626
1778
|
return "";
|
|
1627
1779
|
{
|
|
1628
|
-
var l =
|
|
1780
|
+
var l = ge.get(t);
|
|
1629
1781
|
if (l !== void 0)
|
|
1630
1782
|
return l;
|
|
1631
1783
|
}
|
|
1632
1784
|
var h;
|
|
1633
|
-
|
|
1785
|
+
Oe = !0;
|
|
1634
1786
|
var b = Error.prepareStackTrace;
|
|
1635
1787
|
Error.prepareStackTrace = void 0;
|
|
1636
1788
|
var R;
|
|
1637
1789
|
R = Ce.current, Ce.current = null, dt();
|
|
1638
1790
|
try {
|
|
1639
|
-
if (
|
|
1791
|
+
if (c) {
|
|
1640
1792
|
var p = function() {
|
|
1641
1793
|
throw Error();
|
|
1642
1794
|
};
|
|
@@ -1669,149 +1821,149 @@ function wr() {
|
|
|
1669
1821
|
}
|
|
1670
1822
|
} catch (Y) {
|
|
1671
1823
|
if (Y && h && typeof Y.stack == "string") {
|
|
1672
|
-
for (var
|
|
1824
|
+
for (var v = Y.stack.split(`
|
|
1673
1825
|
`), $ = h.stack.split(`
|
|
1674
|
-
`), j =
|
|
1826
|
+
`), j = v.length - 1, L = $.length - 1; j >= 1 && L >= 0 && v[j] !== $[L]; )
|
|
1675
1827
|
L--;
|
|
1676
1828
|
for (; j >= 1 && L >= 0; j--, L--)
|
|
1677
|
-
if (
|
|
1829
|
+
if (v[j] !== $[L]) {
|
|
1678
1830
|
if (j !== 1 || L !== 1)
|
|
1679
1831
|
do
|
|
1680
|
-
if (j--, L--, L < 0 ||
|
|
1681
|
-
var
|
|
1682
|
-
` +
|
|
1683
|
-
return t.displayName &&
|
|
1832
|
+
if (j--, L--, L < 0 || v[j] !== $[L]) {
|
|
1833
|
+
var B = `
|
|
1834
|
+
` + v[j].replace(" at new ", " at ");
|
|
1835
|
+
return t.displayName && B.includes("<anonymous>") && (B = B.replace("<anonymous>", t.displayName)), typeof t == "function" && ge.set(t, B), B;
|
|
1684
1836
|
}
|
|
1685
1837
|
while (j >= 1 && L >= 0);
|
|
1686
1838
|
break;
|
|
1687
1839
|
}
|
|
1688
1840
|
}
|
|
1689
1841
|
} finally {
|
|
1690
|
-
|
|
1842
|
+
Oe = !1, Ce.current = R, ht(), Error.prepareStackTrace = b;
|
|
1691
1843
|
}
|
|
1692
|
-
var ie = t ? t.displayName || t.name : "",
|
|
1693
|
-
return typeof t == "function" &&
|
|
1844
|
+
var ie = t ? t.displayName || t.name : "", tt = ie ? _e(ie) : "";
|
|
1845
|
+
return typeof t == "function" && ge.set(t, tt), tt;
|
|
1694
1846
|
}
|
|
1695
|
-
function gt(t,
|
|
1847
|
+
function gt(t, c, l) {
|
|
1696
1848
|
return Fe(t, !1);
|
|
1697
1849
|
}
|
|
1698
1850
|
function mt(t) {
|
|
1699
|
-
var
|
|
1700
|
-
return !!(
|
|
1851
|
+
var c = t.prototype;
|
|
1852
|
+
return !!(c && c.isReactComponent);
|
|
1701
1853
|
}
|
|
1702
|
-
function
|
|
1854
|
+
function me(t, c, l) {
|
|
1703
1855
|
if (t == null)
|
|
1704
1856
|
return "";
|
|
1705
1857
|
if (typeof t == "function")
|
|
1706
1858
|
return Fe(t, mt(t));
|
|
1707
1859
|
if (typeof t == "string")
|
|
1708
|
-
return
|
|
1860
|
+
return _e(t);
|
|
1709
1861
|
switch (t) {
|
|
1710
|
-
case
|
|
1711
|
-
return
|
|
1862
|
+
case _:
|
|
1863
|
+
return _e("Suspense");
|
|
1712
1864
|
case E:
|
|
1713
|
-
return
|
|
1865
|
+
return _e("SuspenseList");
|
|
1714
1866
|
}
|
|
1715
1867
|
if (typeof t == "object")
|
|
1716
1868
|
switch (t.$$typeof) {
|
|
1717
1869
|
case g:
|
|
1718
1870
|
return gt(t.render);
|
|
1719
1871
|
case y:
|
|
1720
|
-
return
|
|
1872
|
+
return me(t.type, c, l);
|
|
1721
1873
|
case I: {
|
|
1722
1874
|
var h = t, b = h._payload, R = h._init;
|
|
1723
1875
|
try {
|
|
1724
|
-
return
|
|
1876
|
+
return me(R(b), c, l);
|
|
1725
1877
|
} catch (p) {
|
|
1726
1878
|
}
|
|
1727
1879
|
}
|
|
1728
1880
|
}
|
|
1729
1881
|
return "";
|
|
1730
1882
|
}
|
|
1731
|
-
var
|
|
1732
|
-
function
|
|
1883
|
+
var ve = Object.prototype.hasOwnProperty, Be = {}, Ke = U.ReactDebugCurrentFrame;
|
|
1884
|
+
function pe(t) {
|
|
1733
1885
|
if (t) {
|
|
1734
|
-
var
|
|
1735
|
-
|
|
1886
|
+
var c = t._owner, l = me(t.type, t._source, c ? c.type : null);
|
|
1887
|
+
Ke.setExtraStackFrame(l);
|
|
1736
1888
|
} else
|
|
1737
|
-
|
|
1889
|
+
Ke.setExtraStackFrame(null);
|
|
1738
1890
|
}
|
|
1739
|
-
function vt(t,
|
|
1891
|
+
function vt(t, c, l, h, b) {
|
|
1740
1892
|
{
|
|
1741
|
-
var R = Function.call.bind(
|
|
1893
|
+
var R = Function.call.bind(ve);
|
|
1742
1894
|
for (var p in t)
|
|
1743
1895
|
if (R(t, p)) {
|
|
1744
|
-
var
|
|
1896
|
+
var v = void 0;
|
|
1745
1897
|
try {
|
|
1746
1898
|
if (typeof t[p] != "function") {
|
|
1747
1899
|
var $ = Error((h || "React class") + ": " + l + " type `" + p + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof t[p] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
1748
1900
|
throw $.name = "Invariant Violation", $;
|
|
1749
1901
|
}
|
|
1750
|
-
|
|
1902
|
+
v = t[p](c, p, h, l, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
1751
1903
|
} catch (j) {
|
|
1752
|
-
|
|
1904
|
+
v = j;
|
|
1753
1905
|
}
|
|
1754
|
-
|
|
1906
|
+
v && !(v instanceof Error) && (pe(b), P("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", h || "React class", l, p, typeof v), pe(null)), v instanceof Error && !(v.message in Be) && (Be[v.message] = !0, pe(b), P("Failed %s type: %s", l, v.message), pe(null));
|
|
1755
1907
|
}
|
|
1756
1908
|
}
|
|
1757
1909
|
}
|
|
1758
1910
|
var pt = Array.isArray;
|
|
1759
|
-
function
|
|
1911
|
+
function Ie(t) {
|
|
1760
1912
|
return pt(t);
|
|
1761
1913
|
}
|
|
1762
1914
|
function Et(t) {
|
|
1763
1915
|
{
|
|
1764
|
-
var
|
|
1916
|
+
var c = typeof Symbol == "function" && Symbol.toStringTag, l = c && t[Symbol.toStringTag] || t.constructor.name || "Object";
|
|
1765
1917
|
return l;
|
|
1766
1918
|
}
|
|
1767
1919
|
}
|
|
1768
1920
|
function yt(t) {
|
|
1769
1921
|
try {
|
|
1770
|
-
return
|
|
1771
|
-
} catch (
|
|
1922
|
+
return qe(t), !1;
|
|
1923
|
+
} catch (c) {
|
|
1772
1924
|
return !0;
|
|
1773
1925
|
}
|
|
1774
1926
|
}
|
|
1775
|
-
function
|
|
1927
|
+
function qe(t) {
|
|
1776
1928
|
return "" + t;
|
|
1777
1929
|
}
|
|
1778
|
-
function
|
|
1930
|
+
function Ge(t) {
|
|
1779
1931
|
if (yt(t))
|
|
1780
|
-
return P("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Et(t)),
|
|
1932
|
+
return P("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Et(t)), qe(t);
|
|
1781
1933
|
}
|
|
1782
|
-
var
|
|
1934
|
+
var oe = U.ReactCurrentOwner, bt = {
|
|
1783
1935
|
key: !0,
|
|
1784
1936
|
ref: !0,
|
|
1785
1937
|
__self: !0,
|
|
1786
1938
|
__source: !0
|
|
1787
|
-
},
|
|
1788
|
-
|
|
1939
|
+
}, Ye, Je, Te;
|
|
1940
|
+
Te = {};
|
|
1789
1941
|
function St(t) {
|
|
1790
|
-
if (
|
|
1791
|
-
var
|
|
1792
|
-
if (
|
|
1942
|
+
if (ve.call(t, "ref")) {
|
|
1943
|
+
var c = Object.getOwnPropertyDescriptor(t, "ref").get;
|
|
1944
|
+
if (c && c.isReactWarning)
|
|
1793
1945
|
return !1;
|
|
1794
1946
|
}
|
|
1795
1947
|
return t.ref !== void 0;
|
|
1796
1948
|
}
|
|
1797
|
-
function
|
|
1798
|
-
if (
|
|
1799
|
-
var
|
|
1800
|
-
if (
|
|
1949
|
+
function wt(t) {
|
|
1950
|
+
if (ve.call(t, "key")) {
|
|
1951
|
+
var c = Object.getOwnPropertyDescriptor(t, "key").get;
|
|
1952
|
+
if (c && c.isReactWarning)
|
|
1801
1953
|
return !1;
|
|
1802
1954
|
}
|
|
1803
1955
|
return t.key !== void 0;
|
|
1804
1956
|
}
|
|
1805
|
-
function
|
|
1806
|
-
if (typeof t.ref == "string" &&
|
|
1807
|
-
var l = G(
|
|
1808
|
-
|
|
1957
|
+
function Ct(t, c) {
|
|
1958
|
+
if (typeof t.ref == "string" && oe.current && c && oe.current.stateNode !== c) {
|
|
1959
|
+
var l = G(oe.current.type);
|
|
1960
|
+
Te[l] || (P('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', G(oe.current.type), t.ref), Te[l] = !0);
|
|
1809
1961
|
}
|
|
1810
1962
|
}
|
|
1811
|
-
function Rt(t,
|
|
1963
|
+
function Rt(t, c) {
|
|
1812
1964
|
{
|
|
1813
1965
|
var l = function() {
|
|
1814
|
-
|
|
1966
|
+
Ye || (Ye = !0, P("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", c));
|
|
1815
1967
|
};
|
|
1816
1968
|
l.isReactWarning = !0, Object.defineProperty(t, "key", {
|
|
1817
1969
|
get: l,
|
|
@@ -1819,10 +1971,10 @@ function wr() {
|
|
|
1819
1971
|
});
|
|
1820
1972
|
}
|
|
1821
1973
|
}
|
|
1822
|
-
function Ot(t,
|
|
1974
|
+
function Ot(t, c) {
|
|
1823
1975
|
{
|
|
1824
1976
|
var l = function() {
|
|
1825
|
-
|
|
1977
|
+
Je || (Je = !0, P("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", c));
|
|
1826
1978
|
};
|
|
1827
1979
|
l.isReactWarning = !0, Object.defineProperty(t, "ref", {
|
|
1828
1980
|
get: l,
|
|
@@ -1830,70 +1982,70 @@ function wr() {
|
|
|
1830
1982
|
});
|
|
1831
1983
|
}
|
|
1832
1984
|
}
|
|
1833
|
-
var It = function(t,
|
|
1834
|
-
var
|
|
1985
|
+
var It = function(t, c, l, h, b, R, p) {
|
|
1986
|
+
var v = {
|
|
1835
1987
|
// This tag allows us to uniquely identify this as a React Element
|
|
1836
|
-
$$typeof:
|
|
1988
|
+
$$typeof: o,
|
|
1837
1989
|
// Built-in properties that belong on the element
|
|
1838
1990
|
type: t,
|
|
1839
|
-
key:
|
|
1991
|
+
key: c,
|
|
1840
1992
|
ref: l,
|
|
1841
1993
|
props: p,
|
|
1842
1994
|
// Record the component responsible for creating this element.
|
|
1843
1995
|
_owner: R
|
|
1844
1996
|
};
|
|
1845
|
-
return
|
|
1997
|
+
return v._store = {}, Object.defineProperty(v._store, "validated", {
|
|
1846
1998
|
configurable: !1,
|
|
1847
1999
|
enumerable: !1,
|
|
1848
2000
|
writable: !0,
|
|
1849
2001
|
value: !1
|
|
1850
|
-
}), Object.defineProperty(
|
|
2002
|
+
}), Object.defineProperty(v, "_self", {
|
|
1851
2003
|
configurable: !1,
|
|
1852
2004
|
enumerable: !1,
|
|
1853
2005
|
writable: !1,
|
|
1854
2006
|
value: h
|
|
1855
|
-
}), Object.defineProperty(
|
|
2007
|
+
}), Object.defineProperty(v, "_source", {
|
|
1856
2008
|
configurable: !1,
|
|
1857
2009
|
enumerable: !1,
|
|
1858
2010
|
writable: !1,
|
|
1859
2011
|
value: b
|
|
1860
|
-
}), Object.freeze && (Object.freeze(
|
|
2012
|
+
}), Object.freeze && (Object.freeze(v.props), Object.freeze(v)), v;
|
|
1861
2013
|
};
|
|
1862
|
-
function Tt(t,
|
|
2014
|
+
function Tt(t, c, l, h, b) {
|
|
1863
2015
|
{
|
|
1864
|
-
var R, p = {},
|
|
1865
|
-
l !== void 0 && (
|
|
1866
|
-
for (R in
|
|
1867
|
-
|
|
2016
|
+
var R, p = {}, v = null, $ = null;
|
|
2017
|
+
l !== void 0 && (Ge(l), v = "" + l), wt(c) && (Ge(c.key), v = "" + c.key), St(c) && ($ = c.ref, Ct(c, b));
|
|
2018
|
+
for (R in c)
|
|
2019
|
+
ve.call(c, R) && !bt.hasOwnProperty(R) && (p[R] = c[R]);
|
|
1868
2020
|
if (t && t.defaultProps) {
|
|
1869
2021
|
var j = t.defaultProps;
|
|
1870
2022
|
for (R in j)
|
|
1871
2023
|
p[R] === void 0 && (p[R] = j[R]);
|
|
1872
2024
|
}
|
|
1873
|
-
if (
|
|
2025
|
+
if (v || $) {
|
|
1874
2026
|
var L = typeof t == "function" ? t.displayName || t.name || "Unknown" : t;
|
|
1875
|
-
|
|
2027
|
+
v && Rt(p, L), $ && Ot(p, L);
|
|
1876
2028
|
}
|
|
1877
|
-
return It(t,
|
|
2029
|
+
return It(t, v, $, b, h, oe.current, p);
|
|
1878
2030
|
}
|
|
1879
2031
|
}
|
|
1880
|
-
var
|
|
2032
|
+
var ke = U.ReactCurrentOwner, He = U.ReactDebugCurrentFrame;
|
|
1881
2033
|
function re(t) {
|
|
1882
2034
|
if (t) {
|
|
1883
|
-
var
|
|
2035
|
+
var c = t._owner, l = me(t.type, t._source, c ? c.type : null);
|
|
1884
2036
|
He.setExtraStackFrame(l);
|
|
1885
2037
|
} else
|
|
1886
2038
|
He.setExtraStackFrame(null);
|
|
1887
2039
|
}
|
|
1888
|
-
var
|
|
1889
|
-
|
|
1890
|
-
function
|
|
1891
|
-
return typeof t == "object" && t !== null && t.$$typeof ===
|
|
2040
|
+
var Pe;
|
|
2041
|
+
Pe = !1;
|
|
2042
|
+
function Ne(t) {
|
|
2043
|
+
return typeof t == "object" && t !== null && t.$$typeof === o;
|
|
1892
2044
|
}
|
|
1893
|
-
function
|
|
2045
|
+
function ze() {
|
|
1894
2046
|
{
|
|
1895
|
-
if (
|
|
1896
|
-
var t = G(
|
|
2047
|
+
if (ke.current) {
|
|
2048
|
+
var t = G(ke.current.type);
|
|
1897
2049
|
if (t)
|
|
1898
2050
|
return `
|
|
1899
2051
|
|
|
@@ -1905,88 +2057,88 @@ Check the render method of \`` + t + "`.";
|
|
|
1905
2057
|
function kt(t) {
|
|
1906
2058
|
{
|
|
1907
2059
|
if (t !== void 0) {
|
|
1908
|
-
var
|
|
2060
|
+
var c = t.fileName.replace(/^.*[\\\/]/, ""), l = t.lineNumber;
|
|
1909
2061
|
return `
|
|
1910
2062
|
|
|
1911
|
-
Check your code at ` +
|
|
2063
|
+
Check your code at ` + c + ":" + l + ".";
|
|
1912
2064
|
}
|
|
1913
2065
|
return "";
|
|
1914
2066
|
}
|
|
1915
2067
|
}
|
|
1916
|
-
var
|
|
2068
|
+
var Xe = {};
|
|
1917
2069
|
function Pt(t) {
|
|
1918
2070
|
{
|
|
1919
|
-
var
|
|
1920
|
-
if (!
|
|
2071
|
+
var c = ze();
|
|
2072
|
+
if (!c) {
|
|
1921
2073
|
var l = typeof t == "string" ? t : t.displayName || t.name;
|
|
1922
|
-
l && (
|
|
2074
|
+
l && (c = `
|
|
1923
2075
|
|
|
1924
2076
|
Check the top-level render call using <` + l + ">.");
|
|
1925
2077
|
}
|
|
1926
|
-
return
|
|
2078
|
+
return c;
|
|
1927
2079
|
}
|
|
1928
2080
|
}
|
|
1929
|
-
function
|
|
2081
|
+
function Ze(t, c) {
|
|
1930
2082
|
{
|
|
1931
2083
|
if (!t._store || t._store.validated || t.key != null)
|
|
1932
2084
|
return;
|
|
1933
2085
|
t._store.validated = !0;
|
|
1934
|
-
var l = Pt(
|
|
1935
|
-
if (
|
|
2086
|
+
var l = Pt(c);
|
|
2087
|
+
if (Xe[l])
|
|
1936
2088
|
return;
|
|
1937
|
-
|
|
2089
|
+
Xe[l] = !0;
|
|
1938
2090
|
var h = "";
|
|
1939
|
-
t && t._owner && t._owner !==
|
|
2091
|
+
t && t._owner && t._owner !== ke.current && (h = " It was passed a child from " + G(t._owner.type) + "."), re(t), P('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', l, h), re(null);
|
|
1940
2092
|
}
|
|
1941
2093
|
}
|
|
1942
|
-
function
|
|
2094
|
+
function Qe(t, c) {
|
|
1943
2095
|
{
|
|
1944
2096
|
if (typeof t != "object")
|
|
1945
2097
|
return;
|
|
1946
|
-
if (
|
|
2098
|
+
if (Ie(t))
|
|
1947
2099
|
for (var l = 0; l < t.length; l++) {
|
|
1948
2100
|
var h = t[l];
|
|
1949
|
-
|
|
2101
|
+
Ne(h) && Ze(h, c);
|
|
1950
2102
|
}
|
|
1951
|
-
else if (
|
|
2103
|
+
else if (Ne(t))
|
|
1952
2104
|
t._store && (t._store.validated = !0);
|
|
1953
2105
|
else if (t) {
|
|
1954
2106
|
var b = k(t);
|
|
1955
2107
|
if (typeof b == "function" && b !== t.entries)
|
|
1956
2108
|
for (var R = b.call(t), p; !(p = R.next()).done; )
|
|
1957
|
-
|
|
2109
|
+
Ne(p.value) && Ze(p.value, c);
|
|
1958
2110
|
}
|
|
1959
2111
|
}
|
|
1960
2112
|
}
|
|
1961
2113
|
function Nt(t) {
|
|
1962
2114
|
{
|
|
1963
|
-
var
|
|
1964
|
-
if (
|
|
2115
|
+
var c = t.type;
|
|
2116
|
+
if (c == null || typeof c == "string")
|
|
1965
2117
|
return;
|
|
1966
2118
|
var l;
|
|
1967
|
-
if (typeof
|
|
1968
|
-
l =
|
|
1969
|
-
else if (typeof
|
|
2119
|
+
if (typeof c == "function")
|
|
2120
|
+
l = c.propTypes;
|
|
2121
|
+
else if (typeof c == "object" && (c.$$typeof === g || // Note: Memo only checks outer props here.
|
|
1970
2122
|
// Inner props are checked in the reconciler.
|
|
1971
|
-
|
|
1972
|
-
l =
|
|
2123
|
+
c.$$typeof === y))
|
|
2124
|
+
l = c.propTypes;
|
|
1973
2125
|
else
|
|
1974
2126
|
return;
|
|
1975
2127
|
if (l) {
|
|
1976
|
-
var h = G(
|
|
2128
|
+
var h = G(c);
|
|
1977
2129
|
vt(l, t.props, "prop", h, t);
|
|
1978
|
-
} else if (
|
|
1979
|
-
|
|
1980
|
-
var b = G(
|
|
2130
|
+
} else if (c.PropTypes !== void 0 && !Pe) {
|
|
2131
|
+
Pe = !0;
|
|
2132
|
+
var b = G(c);
|
|
1981
2133
|
P("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", b || "Unknown");
|
|
1982
2134
|
}
|
|
1983
|
-
typeof
|
|
2135
|
+
typeof c.getDefaultProps == "function" && !c.getDefaultProps.isReactClassApproved && P("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
1984
2136
|
}
|
|
1985
2137
|
}
|
|
1986
2138
|
function jt(t) {
|
|
1987
2139
|
{
|
|
1988
|
-
for (var
|
|
1989
|
-
var h =
|
|
2140
|
+
for (var c = Object.keys(t.props), l = 0; l < c.length; l++) {
|
|
2141
|
+
var h = c[l];
|
|
1990
2142
|
if (h !== "children" && h !== "key") {
|
|
1991
2143
|
re(t), P("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", h), re(null);
|
|
1992
2144
|
break;
|
|
@@ -1995,140 +2147,140 @@ Check the top-level render call using <` + l + ">.");
|
|
|
1995
2147
|
t.ref !== null && (re(t), P("Invalid attribute `ref` supplied to `React.Fragment`."), re(null));
|
|
1996
2148
|
}
|
|
1997
2149
|
}
|
|
1998
|
-
function
|
|
2150
|
+
function et(t, c, l, h, b, R) {
|
|
1999
2151
|
{
|
|
2000
|
-
var p =
|
|
2152
|
+
var p = W(t);
|
|
2001
2153
|
if (!p) {
|
|
2002
|
-
var
|
|
2003
|
-
(t === void 0 || typeof t == "object" && t !== null && Object.keys(t).length === 0) && (
|
|
2154
|
+
var v = "";
|
|
2155
|
+
(t === void 0 || typeof t == "object" && t !== null && Object.keys(t).length === 0) && (v += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
2004
2156
|
var $ = kt(b);
|
|
2005
|
-
$ ?
|
|
2157
|
+
$ ? v += $ : v += ze();
|
|
2006
2158
|
var j;
|
|
2007
|
-
t === null ? j = "null" :
|
|
2159
|
+
t === null ? j = "null" : Ie(t) ? j = "array" : t !== void 0 && t.$$typeof === o ? (j = "<" + (G(t.type) || "Unknown") + " />", v = " Did you accidentally export a JSX literal instead of a component?") : j = typeof t, P("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", j, v);
|
|
2008
2160
|
}
|
|
2009
|
-
var L = Tt(t,
|
|
2161
|
+
var L = Tt(t, c, l, b, R);
|
|
2010
2162
|
if (L == null)
|
|
2011
2163
|
return L;
|
|
2012
2164
|
if (p) {
|
|
2013
|
-
var
|
|
2014
|
-
if (
|
|
2165
|
+
var B = c.children;
|
|
2166
|
+
if (B !== void 0)
|
|
2015
2167
|
if (h)
|
|
2016
|
-
if (
|
|
2017
|
-
for (var ie = 0; ie <
|
|
2018
|
-
|
|
2019
|
-
Object.freeze && Object.freeze(
|
|
2168
|
+
if (Ie(B)) {
|
|
2169
|
+
for (var ie = 0; ie < B.length; ie++)
|
|
2170
|
+
Qe(B[ie], t);
|
|
2171
|
+
Object.freeze && Object.freeze(B);
|
|
2020
2172
|
} else
|
|
2021
2173
|
P("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
2022
2174
|
else
|
|
2023
|
-
|
|
2175
|
+
Qe(B, t);
|
|
2024
2176
|
}
|
|
2025
2177
|
return t === i ? jt(L) : Nt(L), L;
|
|
2026
2178
|
}
|
|
2027
2179
|
}
|
|
2028
|
-
function Lt(t,
|
|
2029
|
-
return
|
|
2180
|
+
function Lt(t, c, l) {
|
|
2181
|
+
return et(t, c, l, !0);
|
|
2030
2182
|
}
|
|
2031
|
-
function At(t,
|
|
2032
|
-
return
|
|
2183
|
+
function At(t, c, l) {
|
|
2184
|
+
return et(t, c, l, !1);
|
|
2033
2185
|
}
|
|
2034
|
-
var
|
|
2035
|
-
|
|
2036
|
-
}()),
|
|
2186
|
+
var Vt = At, Mt = Lt;
|
|
2187
|
+
ce.Fragment = i, ce.jsx = Vt, ce.jsxs = Mt;
|
|
2188
|
+
}()), ce;
|
|
2037
2189
|
}
|
|
2038
2190
|
(function(r) {
|
|
2039
|
-
process.env.NODE_ENV === "production" ? r.exports =
|
|
2191
|
+
process.env.NODE_ENV === "production" ? r.exports = wr() : r.exports = Cr();
|
|
2040
2192
|
})(Sr);
|
|
2041
|
-
const Rr =
|
|
2193
|
+
const Rr = Ve.jsx;
|
|
2042
2194
|
function jr(r) {
|
|
2043
|
-
const
|
|
2044
|
-
const f =
|
|
2195
|
+
const o = Gt(null), e = br(r), i = e.jsBridge, n = (f) => /* @__PURE__ */ Rr(o.Provider, { value: e, children: f.children }), a = () => {
|
|
2196
|
+
const f = M.useContext(o);
|
|
2045
2197
|
if (!f)
|
|
2046
2198
|
throw new Error("LiveProvider never found.");
|
|
2047
2199
|
return f;
|
|
2048
|
-
}, u = () => e, d = () => e.$RTC, g = () => d(),
|
|
2049
|
-
function E(f,
|
|
2050
|
-
const S =
|
|
2051
|
-
return
|
|
2200
|
+
}, u = () => e, d = () => e.$RTC, g = () => d(), _ = () => async (f) => await e.connect(f);
|
|
2201
|
+
function E(f, C, A = []) {
|
|
2202
|
+
const S = a(), N = [S, name, ...A], V = () => S.keyframes.off(f, C);
|
|
2203
|
+
return M.useEffect(() => (S.keyframes.on(f, C), V), N), V;
|
|
2052
2204
|
}
|
|
2053
2205
|
function y() {
|
|
2054
|
-
const f =
|
|
2206
|
+
const f = a();
|
|
2055
2207
|
return {
|
|
2056
2208
|
connect: async (T) => await f.connect(T),
|
|
2057
|
-
broadcast: async (T,
|
|
2209
|
+
broadcast: async (T, F, te = 0) => await f.broadcast(T, F, te),
|
|
2058
2210
|
exit: async () => await f.exit(),
|
|
2059
2211
|
kick: async (T) => await f.kick(T),
|
|
2060
2212
|
toggleMicro: (T) => f.toggleMicro(T),
|
|
2061
|
-
forbidMicro: async (T,
|
|
2062
|
-
forbidSync: (T,
|
|
2063
|
-
sendKeyframe: (T,
|
|
2213
|
+
forbidMicro: async (T, F = []) => await f.forbidMicro(T, F),
|
|
2214
|
+
forbidSync: (T, F = []) => f.forbidSync(T, F),
|
|
2215
|
+
sendKeyframe: (T, F) => f.sendKeyframe(T, F),
|
|
2064
2216
|
getFramesByKey: (T) => f.getFramesByKey(T),
|
|
2065
2217
|
setSelfInfo: (T) => f.setSelfInfo(T),
|
|
2066
|
-
updateStatus: (T,
|
|
2218
|
+
updateStatus: (T, F, te, he) => f.updateStatus(T, F, te, he)
|
|
2067
2219
|
};
|
|
2068
2220
|
}
|
|
2069
2221
|
function I(f) {
|
|
2070
|
-
const
|
|
2071
|
-
|
|
2072
|
-
const
|
|
2073
|
-
return
|
|
2074
|
-
}, [
|
|
2075
|
-
const N =
|
|
2076
|
-
(
|
|
2077
|
-
[
|
|
2222
|
+
const C = a(), [A, S] = M.useState(C.getFramesByKey(f));
|
|
2223
|
+
M.useEffect(() => {
|
|
2224
|
+
const V = (se) => S(se), W = f, H = V;
|
|
2225
|
+
return C.keyframes.on(W, H), () => C.keyframes.off(W, H);
|
|
2226
|
+
}, [C]);
|
|
2227
|
+
const N = M.useCallback(
|
|
2228
|
+
(V) => C.sendKeyframe(f, V),
|
|
2229
|
+
[C]
|
|
2078
2230
|
);
|
|
2079
2231
|
return [A, N];
|
|
2080
2232
|
}
|
|
2081
|
-
function
|
|
2082
|
-
const S =
|
|
2083
|
-
return
|
|
2233
|
+
function m(f, C, A = []) {
|
|
2234
|
+
const S = a(), N = () => S.off(f, C), V = [S, f, ...A];
|
|
2235
|
+
return M.useEffect(() => (S.on(f, C), N), V), N;
|
|
2084
2236
|
}
|
|
2085
|
-
function
|
|
2086
|
-
const f =
|
|
2087
|
-
return
|
|
2237
|
+
function D() {
|
|
2238
|
+
const f = a(), [C, A] = M.useState(f.state);
|
|
2239
|
+
return M.useEffect(() => {
|
|
2088
2240
|
const S = (N) => A(N);
|
|
2089
2241
|
return f.on("stateChange", S), () => f.off("stateChange", S);
|
|
2090
|
-
}, [f]),
|
|
2242
|
+
}, [f]), C;
|
|
2091
2243
|
}
|
|
2092
|
-
function
|
|
2093
|
-
const f =
|
|
2244
|
+
function w() {
|
|
2245
|
+
const f = a();
|
|
2094
2246
|
return {
|
|
2095
|
-
join: (
|
|
2247
|
+
join: (W) => f.$RTC.join(W),
|
|
2096
2248
|
quit: () => f.$RTC.quit(),
|
|
2097
2249
|
shock: () => {
|
|
2098
|
-
var
|
|
2099
|
-
return (
|
|
2250
|
+
var W, H;
|
|
2251
|
+
return (H = (W = f.$RTC).shock) == null ? void 0 : H.call(W);
|
|
2100
2252
|
},
|
|
2101
|
-
toggleMicro: (
|
|
2253
|
+
toggleMicro: (W) => f.$RTC.toggleMicro(W),
|
|
2102
2254
|
detectMicro: () => f.$RTC.detectMicro()
|
|
2103
2255
|
};
|
|
2104
2256
|
}
|
|
2105
|
-
function k(f,
|
|
2106
|
-
const S =
|
|
2107
|
-
return
|
|
2257
|
+
function k(f, C, A = []) {
|
|
2258
|
+
const S = a(), N = () => S.$RTC.off(f, C), V = [S, f, ...A];
|
|
2259
|
+
return M.useEffect(() => (S.$RTC.on(f, C), N), V), N;
|
|
2108
2260
|
}
|
|
2109
2261
|
function U() {
|
|
2110
|
-
const f =
|
|
2262
|
+
const f = a(), [C, A] = M.useState(
|
|
2111
2263
|
f.selfInfo || {}
|
|
2112
|
-
), S = (
|
|
2113
|
-
|
|
2114
|
-
const N =
|
|
2115
|
-
async (
|
|
2264
|
+
), S = (V) => A(V);
|
|
2265
|
+
M.useEffect(() => (f.on("selfInfoUpdate", S), () => f.off("selfInfoUpdate", S)), [f]);
|
|
2266
|
+
const N = M.useCallback(
|
|
2267
|
+
async (V) => await f.setSelfInfo(V),
|
|
2116
2268
|
[f]
|
|
2117
2269
|
);
|
|
2118
|
-
return [
|
|
2270
|
+
return [C, N];
|
|
2119
2271
|
}
|
|
2120
2272
|
function P() {
|
|
2121
|
-
const f =
|
|
2273
|
+
const f = a(), [C, A] = M.useState(
|
|
2122
2274
|
f.snapshot
|
|
2123
2275
|
);
|
|
2124
|
-
return
|
|
2276
|
+
return M.useEffect(() => {
|
|
2125
2277
|
const S = (N) => A(N);
|
|
2126
2278
|
return f.on("keyframes", S), () => f.off("keyframes", S);
|
|
2127
|
-
}),
|
|
2279
|
+
}), C;
|
|
2128
2280
|
}
|
|
2129
|
-
function
|
|
2130
|
-
const f =
|
|
2131
|
-
return
|
|
2281
|
+
function de() {
|
|
2282
|
+
const f = a(), [C, A] = M.useState(f.userList), S = (N) => A(N);
|
|
2283
|
+
return M.useEffect(() => (f.on("userListUpdate", S), () => f.off("userListUpdate", S)), [f]), C;
|
|
2132
2284
|
}
|
|
2133
2285
|
return {
|
|
2134
2286
|
live: e,
|
|
@@ -2136,37 +2288,39 @@ function jr(r) {
|
|
|
2136
2288
|
LiveProvider: n,
|
|
2137
2289
|
unsafe__useLiveInstance: u,
|
|
2138
2290
|
unsafe__useRTCInstance: g,
|
|
2139
|
-
useConnect:
|
|
2291
|
+
useConnect: _,
|
|
2140
2292
|
useKeyframe: I,
|
|
2141
2293
|
useKeyframeUpdateCallback: E,
|
|
2142
2294
|
useLiveAction: y,
|
|
2143
|
-
useLiveEventCallback:
|
|
2144
|
-
useLiveState:
|
|
2145
|
-
useRTCAction:
|
|
2295
|
+
useLiveEventCallback: m,
|
|
2296
|
+
useLiveState: D,
|
|
2297
|
+
useRTCAction: w,
|
|
2146
2298
|
useRTCEventCallback: k,
|
|
2147
2299
|
useSelfInfo: U,
|
|
2148
2300
|
useKeyframesSnapshot: P,
|
|
2149
|
-
useUserList:
|
|
2301
|
+
useUserList: de
|
|
2150
2302
|
};
|
|
2151
2303
|
}
|
|
2152
2304
|
export {
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2305
|
+
it as BrowserRTC,
|
|
2306
|
+
nt as BrowserRTC4Chime,
|
|
2307
|
+
lt as BuiltInRTCType,
|
|
2308
|
+
J as BuiltinActionType,
|
|
2157
2309
|
q as BuiltinEventType,
|
|
2158
2310
|
K as Command,
|
|
2159
2311
|
Me as CoreRTC,
|
|
2312
|
+
yr as Live,
|
|
2160
2313
|
x as LiveState,
|
|
2161
2314
|
tr as MemUserStatus,
|
|
2162
2315
|
Z as MicroStatus,
|
|
2163
|
-
|
|
2316
|
+
ne as RTCJoinedInfoCodeEnum,
|
|
2164
2317
|
Q as RTCType,
|
|
2165
2318
|
er as UserStatus,
|
|
2166
|
-
|
|
2319
|
+
st as VRWebViewRTC,
|
|
2167
2320
|
ir as WebSocketCloseError,
|
|
2168
2321
|
rr as WebSocketErrorType,
|
|
2169
|
-
|
|
2322
|
+
Ae as WebSocketState,
|
|
2323
|
+
Er as _clearLiveInstanceIfNeed,
|
|
2170
2324
|
br as createLive,
|
|
2171
2325
|
jr as createLiveReact,
|
|
2172
2326
|
Nr as parseLiveMsg,
|