@burdenoff/fe-libs 2026.1024.3 → 2026.1024.4
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/shared/assistant/avatar/live/LiveAvatarMinutes.d.ts +24 -0
- package/dist/shared/assistant/avatar/live/LiveAvatarMinutes.js +161 -0
- package/dist/shared/assistant/avatar/live/LiveAvatarStage.js +95 -73
- package/dist/shared/assistant/avatar/live/LiveAvatarTabView.d.ts +6 -0
- package/dist/shared/assistant/avatar/live/LiveAvatarTabView.js +195 -171
- package/dist/shared/assistant/avatar/live/avatarSessionClient.d.ts +77 -1
- package/dist/shared/assistant/avatar/live/avatarSessionClient.js +193 -72
- package/dist/shared/assistant/avatar/live/createLiveAvatarSeam.d.ts +14 -1
- package/dist/shared/assistant/avatar/live/createLiveAvatarSeam.js +65 -40
- package/dist/shared/assistant/avatar/live/liveAvatarController.d.ts +64 -2
- package/dist/shared/assistant/avatar/live/liveAvatarController.js +403 -242
- package/dist/shared/assistant/avatar/live/liveAvatarMinutesView.d.ts +127 -0
- package/dist/shared/assistant/avatar/live/liveAvatarMinutesView.js +168 -0
- package/dist/shared/assistant/avatar/live/liveAvatarStatus.d.ts +3 -0
- package/dist/shared/assistant/avatar/live/liveAvatarStatus.js +11 -7
- package/dist/shared/assistant/avatar/useAvatarCopy.d.ts +127 -2
- package/dist/shared/assistant/avatar/useAvatarCopy.js +116 -7
- package/dist/shared/assistant/i18nManifest.d.ts +32 -1
- package/dist/shared/assistant/i18nManifest.js +55 -24
- package/dist/shared/assistant/index.d.ts +2 -0
- package/dist/shared/assistant/ui/AssistantChatArea.js +17 -17
- package/dist/shared/assistant/ui/AssistantMarkdownRenderer.d.ts +5 -2
- package/dist/shared/assistant/ui/assistantLiveAvatarSeam.d.ts +10 -2
- package/dist/shared/assistant/ui/avatar/AssistantAvatarTab.js +78 -76
- package/dist/shared/assistant/ui/avatar/avatarAskGate.d.ts +2 -0
- package/dist/shared/assistant/ui/avatar/avatarAskGate.js +1 -0
- package/dist/shared/events/index.d.ts +2 -1
- package/dist/shared-assistant.js +227 -225
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { AvatarNotReadyError as e, LiveKitAvatarTransport as t } from "./avatarTransport.js";
|
|
2
2
|
import { createAvatarTransportPort as n } from "./avatarTransportPort.js";
|
|
3
3
|
import { createAvatarReplyOutputs as r } from "./avatarReplyOutputs.js";
|
|
4
|
-
import { AvatarApiError as i, avatarAvailabilityRefusal as a,
|
|
4
|
+
import { AvatarApiError as i, avatarAvailabilityRefusal as a, avatarMinutesRefusal as o, avatarRefusalFor as s } from "./avatarSessionClient.js";
|
|
5
5
|
//#region src/shared/assistant/avatar/live/liveAvatarController.ts
|
|
6
|
-
var
|
|
6
|
+
var c = 12e4, l = 1e4, u = 8e3, ee = 5e3, d = 2e4, f = 15e3, te = 2, ne = 5, p = 6e3, m = 1e3, re = {
|
|
7
7
|
voiceLive: !1,
|
|
8
8
|
offered: !1,
|
|
9
9
|
tabOpen: !1,
|
|
@@ -19,9 +19,14 @@ var s = 12e4, c = 1e4, l = 8e3, ee = 5e3, u = 2e4, te = 1e3, d = {
|
|
|
19
19
|
budgetScope: null,
|
|
20
20
|
notice: null,
|
|
21
21
|
audioBlocked: !1,
|
|
22
|
-
videoReady: !1
|
|
22
|
+
videoReady: !1,
|
|
23
|
+
minutes: null,
|
|
24
|
+
minutesReason: null,
|
|
25
|
+
sessionMinutes: null,
|
|
26
|
+
sessionEndsAt: null,
|
|
27
|
+
purchase: "idle"
|
|
23
28
|
};
|
|
24
|
-
function
|
|
29
|
+
function ie(e) {
|
|
25
30
|
switch (e) {
|
|
26
31
|
case "permission_revoked": return {
|
|
27
32
|
problem: "unavailable",
|
|
@@ -57,88 +62,97 @@ function f(e) {
|
|
|
57
62
|
};
|
|
58
63
|
}
|
|
59
64
|
}
|
|
60
|
-
var
|
|
65
|
+
var ae = new Set(["playback-blocked", "needs-hosted-voice"]), oe = {
|
|
61
66
|
problem: "unavailable",
|
|
62
67
|
hide: !0
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
}, se = new Set([
|
|
69
|
+
"minutes-exhausted",
|
|
70
|
+
"minutes-in-use",
|
|
71
|
+
"minutes-in-use-self",
|
|
72
|
+
"minutes-unavailable"
|
|
73
|
+
]), ce = new Set([
|
|
74
|
+
"minutes-exhausted",
|
|
75
|
+
"minutes-in-use",
|
|
76
|
+
"minutes-in-use-self"
|
|
77
|
+
]);
|
|
78
|
+
function h(c) {
|
|
79
|
+
let { scheduler: l, preferences: u } = c, d = c.idleMs ?? 12e4, te = c.endBeforeDeadlineMs ?? 1e4, ne = c.connectTimeoutMs ?? 2e4, m = c.requestTimeoutMs ?? 8e3, h = {
|
|
80
|
+
...re,
|
|
81
|
+
tabOffered: c.browserSupported()
|
|
82
|
+
}, g = /* @__PURE__ */ new Set(), _ = !1, le = null, ue = 0, v = !1, y = !1, b = 0, x = null, S = null, C = [], de = 0, fe = !1, pe = "user", w = !1, T = !1, E = null, D = null, O = null, k = null, A = !1, me = 0, j = 0, M = null, N = !1, P = !1, F = null, I = null, L = 0, R = 0, he = !1, z = 0, B = null, V = !1;
|
|
83
|
+
function H(e) {
|
|
70
84
|
try {
|
|
71
|
-
|
|
85
|
+
c.onLog?.(e);
|
|
72
86
|
} catch {}
|
|
73
87
|
}
|
|
74
|
-
function
|
|
75
|
-
return !
|
|
88
|
+
function ge() {
|
|
89
|
+
return !_ && c.browserSupported();
|
|
76
90
|
}
|
|
77
|
-
function
|
|
78
|
-
return (e || t) &&
|
|
91
|
+
function _e(e, t) {
|
|
92
|
+
return (e || t) && ge();
|
|
79
93
|
}
|
|
80
|
-
function
|
|
81
|
-
return
|
|
94
|
+
function U() {
|
|
95
|
+
return h.retryAt !== null && c.now() < h.retryAt;
|
|
82
96
|
}
|
|
83
|
-
function
|
|
97
|
+
function W(e) {
|
|
84
98
|
let t = {
|
|
85
|
-
...
|
|
99
|
+
...h,
|
|
86
100
|
...e
|
|
87
101
|
};
|
|
88
|
-
e.problem !== void 0 && e.problem !==
|
|
102
|
+
e.problem !== void 0 && e.problem !== h.problem && (e.retryAt === void 0 && (t.retryAt = null), e.budgetScope === void 0 && (t.budgetScope = null), e.minutesReason === void 0 && (t.minutesReason = null));
|
|
89
103
|
let n = {
|
|
90
104
|
...t,
|
|
91
|
-
offered:
|
|
92
|
-
tabOffered:
|
|
93
|
-
heldByVoice:
|
|
105
|
+
offered: _e(t.voiceLive, t.tabOpen),
|
|
106
|
+
tabOffered: ge(),
|
|
107
|
+
heldByVoice: T && t.voiceLive
|
|
94
108
|
};
|
|
95
|
-
if (!Object.keys(n).every((e) => n[e] ===
|
|
96
|
-
n.retryAt !==
|
|
97
|
-
for (let e of [...
|
|
109
|
+
if (!Object.keys(n).every((e) => n[e] === h[e])) {
|
|
110
|
+
n.retryAt !== h.retryAt && (k?.(), k = null), h = n;
|
|
111
|
+
for (let e of [...g]) try {
|
|
98
112
|
e();
|
|
99
113
|
} catch {}
|
|
100
114
|
}
|
|
101
115
|
}
|
|
102
|
-
function
|
|
103
|
-
return
|
|
116
|
+
function ve() {
|
|
117
|
+
return fe && !w ? "voice_end" : "user";
|
|
104
118
|
}
|
|
105
|
-
function
|
|
106
|
-
|
|
119
|
+
function G() {
|
|
120
|
+
u.getState().avatarEnabled !== v && u.setAvatarEnabled(v);
|
|
107
121
|
}
|
|
108
|
-
let
|
|
122
|
+
let ye = {
|
|
109
123
|
positionSec: null,
|
|
110
124
|
synthetic: !0,
|
|
111
125
|
rpc: "none"
|
|
112
|
-
},
|
|
126
|
+
}, K = r({
|
|
113
127
|
port: {
|
|
114
|
-
isActive: () =>
|
|
115
|
-
isAudioBlocked: () =>
|
|
116
|
-
connectionId: () =>
|
|
117
|
-
isMeterHealthy: () =>
|
|
118
|
-
isMeterAudible: () =>
|
|
119
|
-
openSegment: () =>
|
|
120
|
-
clearBuffer: (e) =>
|
|
121
|
-
setOutputMuted: (e) =>
|
|
122
|
-
subscribe: (e) =>
|
|
128
|
+
isActive: () => S !== null && S.port.isActive(),
|
|
129
|
+
isAudioBlocked: () => S?.port.isAudioBlocked() ?? !1,
|
|
130
|
+
connectionId: () => S?.port.connectionId() ?? 0,
|
|
131
|
+
isMeterHealthy: () => S?.port.isMeterHealthy() ?? !1,
|
|
132
|
+
isMeterAudible: () => S?.port.isMeterAudible() ?? !1,
|
|
133
|
+
openSegment: () => S ? S.port.openSegment() : Promise.reject(new e("connection")),
|
|
134
|
+
clearBuffer: (e) => S ? S.port.clearBuffer(e) : Promise.resolve(ye),
|
|
135
|
+
setOutputMuted: (e) => S?.port.setOutputMuted(e),
|
|
136
|
+
subscribe: (e) => S ? S.port.subscribe(e) : () => void 0
|
|
123
137
|
},
|
|
124
|
-
scheduler:
|
|
125
|
-
decode:
|
|
126
|
-
...
|
|
127
|
-
...
|
|
128
|
-
...
|
|
138
|
+
scheduler: l,
|
|
139
|
+
decode: c.decode,
|
|
140
|
+
...c.trackerConfig ? { trackerConfig: c.trackerConfig } : {},
|
|
141
|
+
...c.maxDrainMs === void 0 ? {} : { maxDrainMs: c.maxDrainMs },
|
|
142
|
+
...c.stallMs === void 0 ? {} : { stallMs: c.stallMs },
|
|
129
143
|
onNotice: (e) => {
|
|
130
|
-
switch (
|
|
144
|
+
switch (H({
|
|
131
145
|
event: "notice",
|
|
132
146
|
notice: e
|
|
133
147
|
}), e.kind) {
|
|
134
148
|
case "interrupted":
|
|
135
|
-
|
|
149
|
+
W({ notice: "interrupted" });
|
|
136
150
|
return;
|
|
137
151
|
case "voice-fallback":
|
|
138
|
-
|
|
152
|
+
v && W({ notice: "voice-only" });
|
|
139
153
|
return;
|
|
140
154
|
case "audio-blocked":
|
|
141
|
-
|
|
155
|
+
W({
|
|
142
156
|
audioBlocked: !0,
|
|
143
157
|
problem: "playback-blocked"
|
|
144
158
|
});
|
|
@@ -148,28 +162,31 @@ function h(s) {
|
|
|
148
162
|
},
|
|
149
163
|
onActivity: (e) => {
|
|
150
164
|
if (e) {
|
|
151
|
-
|
|
165
|
+
D?.(), D = null;
|
|
152
166
|
return;
|
|
153
167
|
}
|
|
154
|
-
if (
|
|
155
|
-
|
|
168
|
+
if (y) {
|
|
169
|
+
q("user", { notice: be() });
|
|
156
170
|
return;
|
|
157
171
|
}
|
|
158
|
-
|
|
172
|
+
xe();
|
|
159
173
|
}
|
|
160
174
|
});
|
|
161
|
-
function
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
175
|
+
function be() {
|
|
176
|
+
return he ? "minutes-ended" : "time-limit";
|
|
177
|
+
}
|
|
178
|
+
function xe() {
|
|
179
|
+
D?.(), D = null, h.phase === "ready" && (D = l.setTimeout(() => {
|
|
180
|
+
D = null, h.phase === "ready" && !K.isBusy() && q("idle", {});
|
|
181
|
+
}, d));
|
|
165
182
|
}
|
|
166
|
-
function
|
|
167
|
-
|
|
183
|
+
function Se() {
|
|
184
|
+
D?.(), D = null, O?.(), O = null;
|
|
168
185
|
}
|
|
169
|
-
function
|
|
170
|
-
|
|
171
|
-
let e =
|
|
172
|
-
if (
|
|
186
|
+
function Ce() {
|
|
187
|
+
K.leave();
|
|
188
|
+
let e = S;
|
|
189
|
+
if (S = null, e !== null) {
|
|
173
190
|
if (e.unsubscribe?.(), e.meter !== null) {
|
|
174
191
|
if (e.meterAudible) {
|
|
175
192
|
e.meterAudible = !1;
|
|
@@ -177,153 +194,246 @@ function h(s) {
|
|
|
177
194
|
}
|
|
178
195
|
e.meter.stop();
|
|
179
196
|
}
|
|
180
|
-
e.videoTrack?.detach(), e.transport.dispose(), e.audioElement !== null &&
|
|
197
|
+
e.videoTrack?.detach(), e.transport.dispose(), e.audioElement !== null && c.releaseAudioElement(e.audioElement);
|
|
181
198
|
}
|
|
182
199
|
}
|
|
183
|
-
function
|
|
184
|
-
|
|
185
|
-
let n =
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
200
|
+
function q(e, t) {
|
|
201
|
+
b += 1, pe = e, v = !1, y = !1, T = !1, E = null, he = !1, Ce(), Se();
|
|
202
|
+
let n = x;
|
|
203
|
+
if (x = null, G(), n !== null) {
|
|
204
|
+
H({
|
|
205
|
+
event: "session-ended",
|
|
206
|
+
reason: e
|
|
207
|
+
});
|
|
208
|
+
let r = c.client(), i = () => ze(e);
|
|
209
|
+
r?.end(n, {
|
|
210
|
+
reason: e,
|
|
211
|
+
keepalive: t.keepalive === !0
|
|
212
|
+
}).then(i, i);
|
|
213
|
+
}
|
|
214
|
+
W({
|
|
193
215
|
phase: "off",
|
|
194
216
|
closing: !1,
|
|
195
217
|
audioBlocked: !1,
|
|
196
218
|
videoReady: !1,
|
|
197
|
-
|
|
219
|
+
sessionMinutes: null,
|
|
220
|
+
sessionEndsAt: null,
|
|
221
|
+
...t.problem === void 0 ? h.problem !== null && ae.has(h.problem) ? { problem: null } : {} : { problem: t.problem },
|
|
198
222
|
...t.notice === void 0 ? {} : { notice: t.notice }
|
|
199
223
|
});
|
|
200
224
|
}
|
|
201
|
-
function
|
|
202
|
-
let t =
|
|
203
|
-
t.hide && (
|
|
225
|
+
function we(e) {
|
|
226
|
+
let t = s(e);
|
|
227
|
+
t.hide && (_ = !0), e instanceof i && H({
|
|
204
228
|
event: "refused",
|
|
205
229
|
status: e.status,
|
|
206
230
|
code: e.code
|
|
207
|
-
}),
|
|
208
|
-
let n = t.retryAfterSeconds !== void 0 && t.retryAfterSeconds > 0 ? t.retryAfterSeconds * 1e3 : 0, r = n > 0 ?
|
|
209
|
-
return
|
|
231
|
+
}), v = !1, T = !1, E = null, G();
|
|
232
|
+
let n = t.retryAfterSeconds !== void 0 && t.retryAfterSeconds > 0 ? t.retryAfterSeconds * 1e3 : 0, r = n > 0 ? c.now() + n : null;
|
|
233
|
+
return W({
|
|
210
234
|
phase: "off",
|
|
211
235
|
problem: t.problem,
|
|
212
236
|
retryAt: r,
|
|
213
|
-
budgetScope: t.scope ?? null
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
237
|
+
budgetScope: t.scope ?? null,
|
|
238
|
+
minutesReason: t.minutesReason ?? null
|
|
239
|
+
}), r !== null && h.retryAt === r && (k = l.setTimeout(() => {
|
|
240
|
+
k = null, Te(r);
|
|
241
|
+
}, n)), t.problem !== null && se.has(t.problem) && X(!0), t;
|
|
217
242
|
}
|
|
218
|
-
function
|
|
219
|
-
|
|
243
|
+
function Te(e) {
|
|
244
|
+
h.retryAt === e && W({
|
|
220
245
|
problem: null,
|
|
221
246
|
retryAt: null
|
|
222
247
|
});
|
|
223
248
|
}
|
|
224
|
-
function
|
|
225
|
-
let e =
|
|
226
|
-
|
|
249
|
+
function Ee() {
|
|
250
|
+
let e = h.retryAt;
|
|
251
|
+
A || e === null || U() || Te(e);
|
|
227
252
|
}
|
|
228
|
-
function
|
|
229
|
-
e.hide && (
|
|
253
|
+
function J(e = oe) {
|
|
254
|
+
e.hide && (_ = !0), v = !1, T = !1, E = null, G(), Pe(), W({
|
|
230
255
|
phase: "off",
|
|
231
256
|
problem: e.problem,
|
|
232
257
|
retryAt: null,
|
|
233
|
-
avatars: []
|
|
258
|
+
avatars: [],
|
|
259
|
+
minutes: null,
|
|
260
|
+
minutesReason: null
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
function De(e) {
|
|
264
|
+
E = null, W({
|
|
265
|
+
phase: "off",
|
|
266
|
+
problem: e.problem,
|
|
267
|
+
retryAt: null,
|
|
268
|
+
minutesReason: e.minutesReason ?? null
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
function Oe() {
|
|
272
|
+
return M = l.now(), me += 1, me;
|
|
273
|
+
}
|
|
274
|
+
function ke(e) {
|
|
275
|
+
return e <= j ? !1 : (j = e, !0);
|
|
276
|
+
}
|
|
277
|
+
function Ae(e, t) {
|
|
278
|
+
return ke(e) ? { minutes: t } : {};
|
|
279
|
+
}
|
|
280
|
+
function je(e, t) {
|
|
281
|
+
if (!ke(e)) return {};
|
|
282
|
+
let { problem: n } = h;
|
|
283
|
+
if (!(n !== null && ce.has(n) && h.retryAt === null && h.minutesReason !== "ZERO_SESSION_LIMIT")) return { minutes: t };
|
|
284
|
+
let r = o(t);
|
|
285
|
+
return {
|
|
286
|
+
minutes: t,
|
|
287
|
+
problem: r?.problem ?? null,
|
|
288
|
+
minutesReason: r?.minutesReason ?? null
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
function Me() {
|
|
292
|
+
return c.isPageVisible?.() ?? !0;
|
|
293
|
+
}
|
|
294
|
+
function Ne() {
|
|
295
|
+
F?.(), F = null, I = null;
|
|
296
|
+
}
|
|
297
|
+
function Y() {
|
|
298
|
+
z += 1, B?.(), B = null, h.purchase !== "idle" && W({ purchase: "idle" });
|
|
299
|
+
}
|
|
300
|
+
function Pe() {
|
|
301
|
+
j = me, P = !1, L = 0, Ne(), Y();
|
|
302
|
+
}
|
|
303
|
+
function Fe() {
|
|
304
|
+
return !A && h.minutes !== null && h.offered && (h.phase === "off" || h.phase === "choosing");
|
|
305
|
+
}
|
|
306
|
+
function X(e) {
|
|
307
|
+
if (e && (L = 0), !Fe() || !Me()) return;
|
|
308
|
+
if (N) {
|
|
309
|
+
P = !0;
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
let t = l.now(), n = Math.max(M === null ? t : M + f, R);
|
|
313
|
+
if (t < n) {
|
|
314
|
+
Ie(n);
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
let r = c.client();
|
|
318
|
+
r !== null && Re(r);
|
|
319
|
+
}
|
|
320
|
+
function Ie(e) {
|
|
321
|
+
F !== null && I !== null && I <= e || (Ne(), I = e, F = l.setTimeout(() => {
|
|
322
|
+
F = null, I = null, X(!1);
|
|
323
|
+
}, e - l.now()));
|
|
324
|
+
}
|
|
325
|
+
function Le(e) {
|
|
326
|
+
return !(e instanceof i) || e.status !== 429 ? !1 : (R = Math.max(R, l.now() + Math.max(0, e.retryAfterSeconds ?? 0) * 1e3), !0);
|
|
327
|
+
}
|
|
328
|
+
function Re(e) {
|
|
329
|
+
let t = Oe();
|
|
330
|
+
N = !0, Z((t) => e.availability(t)).then((e) => {
|
|
331
|
+
A || (L = 0, W(je(t, e.available ? e.minutes ?? null : null)));
|
|
332
|
+
}, (e) => {
|
|
333
|
+
A || Le(e) && t > j && L < 2 && (L += 1, P = !0);
|
|
334
|
+
}).finally(() => {
|
|
335
|
+
N = !1, P && (P = !1, X(!1));
|
|
234
336
|
});
|
|
235
337
|
}
|
|
236
|
-
function
|
|
338
|
+
function ze(e) {
|
|
339
|
+
e === "workspace_switch" || e === "page_hide" || X(!0);
|
|
340
|
+
}
|
|
341
|
+
function Be(e) {
|
|
237
342
|
switch (e.type) {
|
|
238
343
|
case "audioPlayback":
|
|
239
|
-
e.canPlay ?
|
|
344
|
+
e.canPlay ? h.problem === "playback-blocked" ? W({
|
|
240
345
|
audioBlocked: !1,
|
|
241
346
|
problem: null
|
|
242
|
-
}) :
|
|
347
|
+
}) : W({ audioBlocked: !1 }) : W({
|
|
243
348
|
audioBlocked: !0,
|
|
244
349
|
problem: "playback-blocked"
|
|
245
350
|
});
|
|
246
351
|
return;
|
|
247
352
|
case "avatarLeft":
|
|
248
353
|
case "disconnected":
|
|
249
|
-
|
|
354
|
+
Ve();
|
|
250
355
|
return;
|
|
251
356
|
default: return;
|
|
252
357
|
}
|
|
253
358
|
}
|
|
254
|
-
async function
|
|
255
|
-
let e =
|
|
256
|
-
if (e === null ||
|
|
257
|
-
let t =
|
|
258
|
-
|
|
359
|
+
async function Ve() {
|
|
360
|
+
let e = x;
|
|
361
|
+
if (e === null || h.phase === "ending" || h.phase === "off") return;
|
|
362
|
+
let t = b;
|
|
363
|
+
W({ phase: "ending" });
|
|
259
364
|
let n = null, r = !1;
|
|
260
365
|
try {
|
|
261
|
-
let t =
|
|
366
|
+
let t = c.client(), i = t === null ? void 0 : await Z((n) => t.status(e, n));
|
|
262
367
|
n = i?.endedReason ?? null, r = i !== void 0 && [
|
|
263
368
|
"ended",
|
|
264
369
|
"failed",
|
|
265
370
|
"canceled"
|
|
266
371
|
].includes(i.state);
|
|
267
372
|
} catch {}
|
|
268
|
-
if (
|
|
269
|
-
let i =
|
|
270
|
-
i.hide && (
|
|
373
|
+
if (b !== t) return;
|
|
374
|
+
let i = ie(n);
|
|
375
|
+
i.hide && (_ = !0), r && (x = null, H({
|
|
271
376
|
event: "session-ended",
|
|
272
377
|
reason: "server"
|
|
273
|
-
}))
|
|
378
|
+
}));
|
|
379
|
+
let a = i.notice === "time-limit" ? be() : i.notice;
|
|
380
|
+
q("client_error", {
|
|
381
|
+
problem: i.problem,
|
|
382
|
+
notice: a
|
|
383
|
+
}), r && ze("client_error");
|
|
274
384
|
}
|
|
275
|
-
async function
|
|
276
|
-
let i =
|
|
385
|
+
async function He(e, r) {
|
|
386
|
+
let i = c.client();
|
|
277
387
|
if (i === null) {
|
|
278
|
-
|
|
388
|
+
J();
|
|
279
389
|
return;
|
|
280
390
|
}
|
|
281
|
-
let a = ++
|
|
282
|
-
|
|
391
|
+
let a = ++b;
|
|
392
|
+
W({
|
|
283
393
|
phase: "starting",
|
|
284
394
|
problem: null,
|
|
285
395
|
notice: null
|
|
286
396
|
});
|
|
287
397
|
let o;
|
|
288
398
|
try {
|
|
289
|
-
o = await
|
|
399
|
+
o = await c.openRoom();
|
|
290
400
|
} catch {
|
|
291
|
-
|
|
401
|
+
b === a && J();
|
|
292
402
|
return;
|
|
293
403
|
}
|
|
294
|
-
let
|
|
404
|
+
let s = () => {
|
|
295
405
|
o.disconnect().catch(() => void 0);
|
|
296
406
|
};
|
|
297
|
-
if (
|
|
298
|
-
|
|
407
|
+
if (b !== a) {
|
|
408
|
+
s();
|
|
299
409
|
return;
|
|
300
410
|
}
|
|
301
|
-
let u =
|
|
411
|
+
let u = l.now(), d;
|
|
302
412
|
try {
|
|
303
413
|
d = await i.create({
|
|
304
414
|
avatarId: e,
|
|
305
415
|
consentVersion: r,
|
|
306
|
-
idempotencyKey:
|
|
416
|
+
idempotencyKey: c.newIdempotencyKey()
|
|
307
417
|
});
|
|
308
418
|
} catch (e) {
|
|
309
|
-
if (
|
|
310
|
-
|
|
419
|
+
if (s(), b !== a) return;
|
|
420
|
+
we(e).showDisclosure && (le = null, $.requestOn({ start: !1 }));
|
|
311
421
|
return;
|
|
312
422
|
}
|
|
313
|
-
if (
|
|
314
|
-
|
|
423
|
+
if (b !== a) {
|
|
424
|
+
s(), i.end(d.sessionId, { reason: pe === "voice_end" ? "voice_end" : "user" }).catch(() => void 0);
|
|
315
425
|
return;
|
|
316
426
|
}
|
|
317
|
-
|
|
427
|
+
x = d.sessionId, W({ phase: "connecting" });
|
|
318
428
|
let f = new t({
|
|
319
429
|
room: o,
|
|
320
430
|
avatarIdentity: d.avatarIdentity,
|
|
321
|
-
scheduler:
|
|
322
|
-
...
|
|
431
|
+
scheduler: l,
|
|
432
|
+
...c.readinessProbe === void 0 ? {} : { readinessProbe: c.readinessProbe }
|
|
323
433
|
}), p = /* @__PURE__ */ new Set(), m = {
|
|
324
434
|
session: d,
|
|
325
435
|
transport: f,
|
|
326
|
-
audioElement:
|
|
436
|
+
audioElement: c.createAudioElement(),
|
|
327
437
|
meter: null,
|
|
328
438
|
meterAudible: !1,
|
|
329
439
|
meterListeners: p,
|
|
@@ -331,22 +441,22 @@ function h(s) {
|
|
|
331
441
|
unsubscribe: null,
|
|
332
442
|
port: n({
|
|
333
443
|
transport: f,
|
|
334
|
-
isEnabled: () =>
|
|
444
|
+
isEnabled: () => v && !y,
|
|
335
445
|
subscribeMeter: (e) => (p.add(e), () => {
|
|
336
446
|
p.delete(e);
|
|
337
447
|
}),
|
|
338
448
|
isMeterHealthy: () => m.meter?.isRunning() ?? !1
|
|
339
449
|
})
|
|
340
450
|
};
|
|
341
|
-
|
|
451
|
+
S = m, m.unsubscribe = f.subscribe(Be);
|
|
342
452
|
try {
|
|
343
|
-
await
|
|
453
|
+
await Ue(f.connect({
|
|
344
454
|
url: d.livekitUrl,
|
|
345
455
|
token: d.participantToken,
|
|
346
456
|
audioElement: m.audioElement,
|
|
347
457
|
onAvatarAudio: (e) => {
|
|
348
458
|
if (!(e.mediaStreamTrack === null || m.meter !== null)) try {
|
|
349
|
-
m.meter =
|
|
459
|
+
m.meter = c.startMeter(e.mediaStreamTrack, (e) => {
|
|
350
460
|
m.meterAudible = e;
|
|
351
461
|
for (let t of [...p]) t(e);
|
|
352
462
|
});
|
|
@@ -356,35 +466,38 @@ function h(s) {
|
|
|
356
466
|
},
|
|
357
467
|
onAvatarVideo: (e) => {
|
|
358
468
|
m.videoTrack = e;
|
|
359
|
-
let t =
|
|
360
|
-
t !== null && e.attach(t),
|
|
469
|
+
let t = We();
|
|
470
|
+
t !== null && e.attach(t), S === m && W({ videoReady: !0 });
|
|
361
471
|
}
|
|
362
|
-
}),
|
|
472
|
+
}), ne);
|
|
363
473
|
} catch (e) {
|
|
364
|
-
if (
|
|
365
|
-
|
|
474
|
+
if (b !== a) return;
|
|
475
|
+
H({
|
|
366
476
|
event: "connect-failed",
|
|
367
477
|
error: e instanceof Error ? e.name : "error"
|
|
368
|
-
}),
|
|
478
|
+
}), q("client_error", { problem: "connection" });
|
|
369
479
|
return;
|
|
370
480
|
}
|
|
371
|
-
if (
|
|
372
|
-
|
|
481
|
+
if (b !== a || S !== m) return;
|
|
482
|
+
let re = d.maxSessionSeconds === void 0 ? ue : d.maxSessionSeconds * 1e3, ie = re > 0 ? u + re - ee - l.now() : d.endsAt - c.now();
|
|
483
|
+
he = d.minutes?.limitedByBalance === !0, W({
|
|
373
484
|
phase: "ready",
|
|
374
485
|
audioBlocked: f.audioBlocked,
|
|
375
|
-
...f.audioBlocked ? { problem: "playback-blocked" } : {}
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
486
|
+
...f.audioBlocked ? { problem: "playback-blocked" } : {},
|
|
487
|
+
sessionMinutes: d.minutes ?? null,
|
|
488
|
+
sessionEndsAt: d.maxSessionSeconds === void 0 ? null : c.now() + ie
|
|
489
|
+
}), xe();
|
|
490
|
+
let ae = Math.max(0, ie - te);
|
|
491
|
+
O = l.setTimeout(() => {
|
|
492
|
+
O = null, b === a && (y = !0, W({ closing: !0 }), K.isBusy() || q("user", { notice: be() }));
|
|
493
|
+
}, ae);
|
|
494
|
+
}
|
|
495
|
+
function Z(t) {
|
|
383
496
|
let n = new AbortController();
|
|
384
497
|
return new Promise((r, i) => {
|
|
385
|
-
let a =
|
|
498
|
+
let a = l.setTimeout(() => {
|
|
386
499
|
n.abort(), i(new e("connection"));
|
|
387
|
-
},
|
|
500
|
+
}, m);
|
|
388
501
|
t(n.signal).then((e) => {
|
|
389
502
|
a(), r(e);
|
|
390
503
|
}, (e) => {
|
|
@@ -392,9 +505,9 @@ function h(s) {
|
|
|
392
505
|
});
|
|
393
506
|
});
|
|
394
507
|
}
|
|
395
|
-
function
|
|
508
|
+
function Ue(t, n) {
|
|
396
509
|
return new Promise((r, i) => {
|
|
397
|
-
let a =
|
|
510
|
+
let a = l.setTimeout(() => i(new e("connection")), n);
|
|
398
511
|
t.then((e) => {
|
|
399
512
|
a(), r(e);
|
|
400
513
|
}, (e) => {
|
|
@@ -402,192 +515,240 @@ function h(s) {
|
|
|
402
515
|
});
|
|
403
516
|
});
|
|
404
517
|
}
|
|
405
|
-
function
|
|
406
|
-
return
|
|
518
|
+
function We() {
|
|
519
|
+
return C[C.length - 1] ?? null;
|
|
407
520
|
}
|
|
408
|
-
function
|
|
409
|
-
let t =
|
|
521
|
+
function Ge(e) {
|
|
522
|
+
let t = C.indexOf(e);
|
|
410
523
|
if (t === -1) return;
|
|
411
|
-
let n = t ===
|
|
412
|
-
|
|
413
|
-
let r =
|
|
524
|
+
let n = t === C.length - 1;
|
|
525
|
+
C.splice(t, 1);
|
|
526
|
+
let r = S?.videoTrack ?? null;
|
|
414
527
|
if (!n || r === null) return;
|
|
415
528
|
r.detach();
|
|
416
|
-
let i =
|
|
529
|
+
let i = We();
|
|
417
530
|
i !== null && r.attach(i);
|
|
418
531
|
}
|
|
419
532
|
let Q = [];
|
|
420
|
-
Q.push(
|
|
421
|
-
let e =
|
|
422
|
-
if (e !==
|
|
533
|
+
Q.push(u.subscribe(() => {
|
|
534
|
+
let e = u.getState().avatarEnabled;
|
|
535
|
+
if (e !== v) {
|
|
423
536
|
if (e) {
|
|
424
|
-
|
|
537
|
+
u.setAvatarEnabled(!1);
|
|
425
538
|
return;
|
|
426
539
|
}
|
|
427
|
-
|
|
540
|
+
h.phase !== "off" && h.phase !== "checking" && h.phase !== "choosing" ? q(ve(), {}) : v = !1;
|
|
428
541
|
}
|
|
429
|
-
})),
|
|
430
|
-
if (
|
|
542
|
+
})), c.subscribeWorkspaceChange && Q.push(c.subscribeWorkspaceChange(() => {
|
|
543
|
+
if (_ = !1, Pe(), h.phase === "off" ? W({
|
|
431
544
|
problem: null,
|
|
432
545
|
avatars: [],
|
|
433
|
-
consentVersion: null
|
|
434
|
-
|
|
546
|
+
consentVersion: null,
|
|
547
|
+
minutes: null
|
|
548
|
+
}) : (q("workspace_switch", { problem: null }), W({
|
|
435
549
|
avatars: [],
|
|
436
|
-
consentVersion: null
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
550
|
+
consentVersion: null,
|
|
551
|
+
minutes: null
|
|
552
|
+
})), w) {
|
|
553
|
+
let e = b;
|
|
554
|
+
l.setTimeout(() => {
|
|
555
|
+
w && b === e && $.requestOn({ start: !1 });
|
|
441
556
|
}, 0);
|
|
442
557
|
}
|
|
443
|
-
})),
|
|
444
|
-
(
|
|
445
|
-
})),
|
|
558
|
+
})), c.subscribePageHide && Q.push(c.subscribePageHide(() => {
|
|
559
|
+
(x !== null || h.phase !== "off") && q("page_hide", { keepalive: !0 });
|
|
560
|
+
})), c.subscribePageVisible && Q.push(c.subscribePageVisible(() => {
|
|
561
|
+
N || X(!0);
|
|
562
|
+
})), c.subscribePageShow && Q.push(c.subscribePageShow(Ee));
|
|
446
563
|
let $ = {
|
|
447
564
|
subscribe(e) {
|
|
448
|
-
return
|
|
449
|
-
|
|
565
|
+
return g.add(e), () => {
|
|
566
|
+
g.delete(e);
|
|
450
567
|
};
|
|
451
568
|
},
|
|
452
|
-
getSnapshot: () =>
|
|
569
|
+
getSnapshot: () => h,
|
|
453
570
|
setVoiceLive(e) {
|
|
454
|
-
if (
|
|
455
|
-
|
|
571
|
+
if (fe = !e, e) {
|
|
572
|
+
W({
|
|
456
573
|
voiceLive: !0,
|
|
457
|
-
problem:
|
|
574
|
+
problem: _ || w && U() ? h.problem : null,
|
|
458
575
|
notice: null
|
|
459
576
|
});
|
|
460
577
|
return;
|
|
461
578
|
}
|
|
462
|
-
if (
|
|
463
|
-
|
|
579
|
+
if (T = !1, w) {
|
|
580
|
+
W({ voiceLive: !1 });
|
|
464
581
|
return;
|
|
465
582
|
}
|
|
466
|
-
(
|
|
583
|
+
(x !== null || h.phase !== "off") && (h.phase === "checking" || h.phase === "choosing" ? (b += 1, W({ phase: "off" })) : q("voice_end", {})), W({
|
|
467
584
|
voiceLive: !1,
|
|
468
585
|
notice: null
|
|
469
586
|
});
|
|
470
587
|
},
|
|
471
588
|
requestOn(e = {}) {
|
|
472
|
-
if (
|
|
589
|
+
if (A || !h.offered || h.phase !== "off") return;
|
|
473
590
|
let t = e.start === void 0 ? "auto" : e.start ? "start" : "choose";
|
|
474
|
-
if (t === "start" &&
|
|
475
|
-
let n = e.avatarId ??
|
|
591
|
+
if (t === "start" && U()) return;
|
|
592
|
+
let n = e.avatarId ?? h.selectedAvatarId, r = h.consentVersion, i = c.client();
|
|
476
593
|
if (i === null) {
|
|
477
|
-
|
|
594
|
+
J();
|
|
478
595
|
return;
|
|
479
596
|
}
|
|
480
|
-
t === "start" && (
|
|
481
|
-
let o = ++
|
|
482
|
-
|
|
597
|
+
t === "start" && (E = l.now());
|
|
598
|
+
let o = ++b, s = Oe();
|
|
599
|
+
P = !1, Ne(), W({
|
|
483
600
|
phase: "checking",
|
|
484
|
-
problem:
|
|
601
|
+
problem: U() ? h.problem : null,
|
|
485
602
|
notice: null
|
|
486
|
-
}),
|
|
487
|
-
if (
|
|
603
|
+
}), Z((e) => i.availability(e)).then((e) => {
|
|
604
|
+
if (b !== o) return;
|
|
488
605
|
if (!e.available) {
|
|
489
|
-
|
|
606
|
+
J(a(e.reason));
|
|
490
607
|
return;
|
|
491
608
|
}
|
|
492
|
-
|
|
493
|
-
let i = t === "start" && n !== null && e.avatars.includes(n),
|
|
494
|
-
switch (
|
|
609
|
+
ue = e.maxSessionSeconds * 1e3;
|
|
610
|
+
let i = t === "start" && n !== null && e.avatars.includes(n), c = u.getState().avatarId, l = i ? n : c !== null && e.avatars.includes(c) ? c : e.avatars[0] ?? null;
|
|
611
|
+
switch (W({
|
|
495
612
|
phase: "choosing",
|
|
496
613
|
avatars: e.avatars,
|
|
497
|
-
selectedAvatarId:
|
|
498
|
-
consentVersion: e.consentVersion
|
|
614
|
+
selectedAvatarId: l,
|
|
615
|
+
consentVersion: e.consentVersion,
|
|
616
|
+
...Ae(s, e.minutes ?? null)
|
|
499
617
|
}), t) {
|
|
500
618
|
case "auto":
|
|
501
|
-
|
|
619
|
+
le === e.consentVersion && e.avatars.length === 1 && $.confirm();
|
|
502
620
|
return;
|
|
503
621
|
case "start":
|
|
504
|
-
i && r === e.consentVersion ? $.confirm() :
|
|
622
|
+
i && r === e.consentVersion ? $.confirm() : E = null;
|
|
505
623
|
return;
|
|
506
624
|
case "choose": return;
|
|
507
625
|
}
|
|
508
626
|
}, (e) => {
|
|
509
|
-
|
|
627
|
+
Le(e), b === o && we(e);
|
|
510
628
|
});
|
|
511
629
|
},
|
|
512
630
|
confirm() {
|
|
513
|
-
if (
|
|
514
|
-
let e =
|
|
515
|
-
|
|
631
|
+
if (h.phase !== "choosing" || !(h.voiceLive || w) || U()) return;
|
|
632
|
+
let e = o(h.minutes);
|
|
633
|
+
if (e !== null) {
|
|
634
|
+
De(e);
|
|
635
|
+
return;
|
|
636
|
+
}
|
|
637
|
+
let t = h.selectedAvatarId, n = h.consentVersion;
|
|
638
|
+
t === null || n === null || (le = n, u.setAvatarId(t), v = !0, T = !w, w && (E ??= l.now()), G(), He(t, n));
|
|
516
639
|
},
|
|
517
|
-
recheckRetry:
|
|
640
|
+
recheckRetry: Ee,
|
|
518
641
|
cancelChoice() {
|
|
519
|
-
|
|
642
|
+
h.phase === "choosing" && (b += 1, E = null, W({ phase: "off" }));
|
|
643
|
+
},
|
|
644
|
+
refreshMinutes() {
|
|
645
|
+
X(!0);
|
|
646
|
+
},
|
|
647
|
+
checkMinutesPurchase() {
|
|
648
|
+
if (A || h.minutes === null) return;
|
|
649
|
+
let e = c.client();
|
|
650
|
+
if (e === null) return;
|
|
651
|
+
Y();
|
|
652
|
+
let t = z, n = l.now(), r = M === null ? n : Math.max(n, M + p), i = h.minutes.balance?.availableMinutes ?? 0, a = 0;
|
|
653
|
+
W({ purchase: "checking" });
|
|
654
|
+
let o = () => {
|
|
655
|
+
if (B = null, t !== z) return;
|
|
656
|
+
a += 1;
|
|
657
|
+
let n = a >= 5;
|
|
658
|
+
if (h.phase !== "off" && h.phase !== "choosing" && h.phase !== "checking") {
|
|
659
|
+
Y();
|
|
660
|
+
return;
|
|
661
|
+
}
|
|
662
|
+
if (n || (B = l.setTimeout(o, r + a * p - l.now())), !Me() || h.phase === "checking" || N || V || l.now() < R) {
|
|
663
|
+
n && Y();
|
|
664
|
+
return;
|
|
665
|
+
}
|
|
666
|
+
V = !0;
|
|
667
|
+
let s = Oe();
|
|
668
|
+
Z((t) => e.availability(t)).then((e) => {
|
|
669
|
+
if (V = !1, A) return;
|
|
670
|
+
let r = e.available ? e.minutes ?? null : null;
|
|
671
|
+
W(je(s, r)), t === z && ((r?.balance?.availableMinutes ?? 0) > i || n) && Y();
|
|
672
|
+
}, (e) => {
|
|
673
|
+
V = !1, !A && (Le(e), t === z && n && Y());
|
|
674
|
+
});
|
|
675
|
+
};
|
|
676
|
+
r > n ? B = l.setTimeout(o, r - n) : o();
|
|
520
677
|
},
|
|
521
678
|
setTabOpen(e) {
|
|
522
|
-
if (
|
|
523
|
-
if (
|
|
524
|
-
|
|
679
|
+
if (A || e === w) return;
|
|
680
|
+
if (w = e, e) {
|
|
681
|
+
if (W({ tabOpen: !0 }), h.phase === "checking") {
|
|
682
|
+
b += 1, W({ phase: "off" }), $.requestOn({ start: !1 });
|
|
683
|
+
return;
|
|
684
|
+
}
|
|
685
|
+
X(!0);
|
|
525
686
|
return;
|
|
526
687
|
}
|
|
527
|
-
|
|
528
|
-
let t =
|
|
688
|
+
E = null;
|
|
689
|
+
let t = h.phase;
|
|
529
690
|
if (t === "checking" || t === "choosing") {
|
|
530
|
-
|
|
691
|
+
b += 1, W({
|
|
531
692
|
tabOpen: !1,
|
|
532
693
|
phase: "off"
|
|
533
694
|
});
|
|
534
695
|
return;
|
|
535
696
|
}
|
|
536
|
-
(
|
|
697
|
+
(x !== null || t !== "off") && !h.heldByVoice && q("user", {}), W({ tabOpen: !1 });
|
|
537
698
|
},
|
|
538
699
|
selectAvatar(e) {
|
|
539
|
-
|
|
700
|
+
h.avatars.includes(e) && W({ selectedAvatarId: e });
|
|
540
701
|
},
|
|
541
702
|
switchOff() {
|
|
542
|
-
let { phase: e } =
|
|
543
|
-
if (!(
|
|
703
|
+
let { phase: e } = h;
|
|
704
|
+
if (!(w && E !== null && (e === "checking" || e === "starting" || e === "connecting") && l.now() - E < 1e3)) {
|
|
544
705
|
if (e === "checking" || e === "choosing") {
|
|
545
|
-
|
|
706
|
+
b += 1, E = null, W({ phase: "off" });
|
|
546
707
|
return;
|
|
547
708
|
}
|
|
548
|
-
if (e === "off" && !
|
|
549
|
-
|
|
709
|
+
if (e === "off" && !v) {
|
|
710
|
+
G();
|
|
550
711
|
return;
|
|
551
712
|
}
|
|
552
|
-
|
|
713
|
+
q(ve(), {});
|
|
553
714
|
}
|
|
554
715
|
},
|
|
555
716
|
resumeAudio() {
|
|
556
|
-
let e =
|
|
717
|
+
let e = S;
|
|
557
718
|
e !== null && (e.transport.resumeAudio().catch(() => void 0), e.meter?.resume().catch(() => void 0));
|
|
558
719
|
},
|
|
559
720
|
setStageMounted(e) {
|
|
560
|
-
|
|
721
|
+
de = Math.max(0, de + (e ? 1 : -1));
|
|
561
722
|
},
|
|
562
723
|
attachVideo(e) {
|
|
563
724
|
if (e === null) {
|
|
564
|
-
let e =
|
|
565
|
-
e !== null &&
|
|
725
|
+
let e = We();
|
|
726
|
+
e !== null && Ge(e);
|
|
566
727
|
return;
|
|
567
728
|
}
|
|
568
|
-
let t =
|
|
569
|
-
t !== -1 &&
|
|
570
|
-
let n =
|
|
571
|
-
return n !== null && (n.detach(), n.attach(e)), () =>
|
|
729
|
+
let t = C.indexOf(e);
|
|
730
|
+
t !== -1 && C.splice(t, 1), C.push(e);
|
|
731
|
+
let n = S?.videoTrack ?? null;
|
|
732
|
+
return n !== null && (n.detach(), n.attach(e)), () => Ge(e);
|
|
572
733
|
},
|
|
573
734
|
route(e, t) {
|
|
574
|
-
if (
|
|
735
|
+
if (h.phase !== "ready" || y || !v || de === 0 || S === null || S.port.isAudioBlocked() || e.fallback === !1) return "speakers";
|
|
575
736
|
let n = e.voice;
|
|
576
|
-
return n !== null && n.source !== "hosted" || !t.listVoices().some((e) => e.source === "hosted") ? (
|
|
737
|
+
return n !== null && n.source !== "hosted" || !t.listVoices().some((e) => e.source === "hosted") ? (H({
|
|
577
738
|
event: "notice",
|
|
578
739
|
notice: { kind: "needs-hosted-voice" }
|
|
579
|
-
}),
|
|
740
|
+
}), W({ problem: "needs-hosted-voice" }), "speakers") : (h.problem === "needs-hosted-voice" && W({ problem: null }), "avatar");
|
|
580
741
|
},
|
|
581
|
-
createOutput: () =>
|
|
742
|
+
createOutput: () => K.createOutput(),
|
|
582
743
|
dispose() {
|
|
583
|
-
if (!
|
|
584
|
-
|
|
744
|
+
if (!A) {
|
|
745
|
+
A = !0, (x !== null || h.phase !== "off") && q("user", {}), k?.(), k = null, Ne(), z += 1, B?.(), B = null;
|
|
585
746
|
for (let e of Q.splice(0)) e();
|
|
586
|
-
|
|
747
|
+
g.clear();
|
|
587
748
|
}
|
|
588
749
|
}
|
|
589
750
|
};
|
|
590
751
|
return $;
|
|
591
752
|
}
|
|
592
753
|
//#endregion
|
|
593
|
-
export {
|
|
754
|
+
export { d as LIVE_AVATAR_CONNECT_TIMEOUT_MS, l as LIVE_AVATAR_END_BEFORE_DEADLINE_MS, c as LIVE_AVATAR_IDLE_MS, te as LIVE_AVATAR_MINUTES_BUSY_RETRIES, f as LIVE_AVATAR_MINUTES_REFRESH_MS, ne as LIVE_AVATAR_PURCHASE_POLLS, p as LIVE_AVATAR_PURCHASE_POLL_MS, u as LIVE_AVATAR_REQUEST_TIMEOUT_MS, m as LIVE_AVATAR_TAB_OFF_GUARD_MS, h as createLiveAvatarController };
|