@livelayer/react 0.5.14 → 0.5.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.d.ts +13 -2
- package/dist/index.js +3 -3
- package/dist/index.mjs +977 -953
- package/dist/styles.css +18 -0
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as _, jsx as n, Fragment as
|
|
3
|
-
import { Component as
|
|
4
|
-
import { LiveKitSession as
|
|
5
|
-
import { createLocalAudioTrack as
|
|
6
|
-
class
|
|
2
|
+
import { jsxs as _, jsx as n, Fragment as yt } from "react/jsx-runtime";
|
|
3
|
+
import { Component as pn, useState as S, useRef as N, useEffect as A, useCallback as L, useMemo as ot, forwardRef as vt, createElement as hn } from "react";
|
|
4
|
+
import { LiveKitSession as mn } from "@livelayer/sdk";
|
|
5
|
+
import { createLocalAudioTrack as gn, Track as Xt, createLocalVideoTrack as yn } from "livekit-client";
|
|
6
|
+
class vn extends pn {
|
|
7
7
|
constructor() {
|
|
8
8
|
super(...arguments), this.state = { hasError: !1, error: null }, this.reset = () => {
|
|
9
9
|
this.setState({ hasError: !1, error: null });
|
|
@@ -33,26 +33,26 @@ class mn extends dn {
|
|
|
33
33
|
] }) : this.props.children;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
const [t, r] =
|
|
38
|
-
z.current = e.onDataMessage,
|
|
39
|
-
const
|
|
36
|
+
function bn(e) {
|
|
37
|
+
const [t, r] = S("idle"), [i, o] = S("idle"), [l, c] = S([]), [d, f] = S(null), [g, b] = S(null), [s, a] = S(null), [k, E] = S(!1), [C, v] = S(null), w = N(null), z = N(e.onDataMessage);
|
|
38
|
+
z.current = e.onDataMessage, A(() => {
|
|
39
|
+
const R = {
|
|
40
40
|
onConnectionStateChange: (D) => {
|
|
41
41
|
r(D), D === "connected" && v(null);
|
|
42
42
|
},
|
|
43
43
|
onAgentStateChange: o,
|
|
44
44
|
onTranscript: (D) => c([...D]),
|
|
45
45
|
onAgentConfig: f,
|
|
46
|
-
onAudioTrack: (D) =>
|
|
47
|
-
onVideoTrack: (D) =>
|
|
48
|
-
onVideoTrackRemoved: () =>
|
|
46
|
+
onAudioTrack: (D) => a(D),
|
|
47
|
+
onVideoTrack: (D) => b(D),
|
|
48
|
+
onVideoTrackRemoved: () => b(null),
|
|
49
49
|
onError: (D) => v(D),
|
|
50
50
|
onDataMessage: (D) => {
|
|
51
|
-
var
|
|
52
|
-
(
|
|
51
|
+
var M;
|
|
52
|
+
(M = z.current) == null || M.call(z, D);
|
|
53
53
|
},
|
|
54
|
-
onResumabilityChange:
|
|
55
|
-
}, q = new
|
|
54
|
+
onResumabilityChange: E
|
|
55
|
+
}, q = new mn(
|
|
56
56
|
{
|
|
57
57
|
agentId: e.agentId,
|
|
58
58
|
baseUrl: e.baseUrl,
|
|
@@ -60,11 +60,11 @@ function gn(e) {
|
|
|
60
60
|
sessionEndpoint: e.sessionEndpoint,
|
|
61
61
|
sessionBody: e.sessionBody
|
|
62
62
|
},
|
|
63
|
-
|
|
63
|
+
R
|
|
64
64
|
);
|
|
65
|
-
return
|
|
65
|
+
return w.current = q, r("idle"), o("idle"), c([]), f(null), b(null), a(null), E(!1), v(null), () => {
|
|
66
66
|
var D;
|
|
67
|
-
(D = q.destroy) == null || D.call(q),
|
|
67
|
+
(D = q.destroy) == null || D.call(q), w.current = null;
|
|
68
68
|
};
|
|
69
69
|
}, [
|
|
70
70
|
e.agentId,
|
|
@@ -73,64 +73,64 @@ function gn(e) {
|
|
|
73
73
|
e.sessionEndpoint,
|
|
74
74
|
JSON.stringify(e.sessionBody ?? {})
|
|
75
75
|
]);
|
|
76
|
-
const
|
|
77
|
-
const
|
|
78
|
-
if (
|
|
76
|
+
const I = L(async () => {
|
|
77
|
+
const R = w.current;
|
|
78
|
+
if (R)
|
|
79
79
|
try {
|
|
80
|
-
await
|
|
80
|
+
await R.connect();
|
|
81
81
|
} catch (q) {
|
|
82
82
|
throw v(q instanceof Error ? q.message : String(q)), q;
|
|
83
83
|
}
|
|
84
|
-
}, []), H =
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
}, []), h =
|
|
88
|
-
var
|
|
89
|
-
return ((
|
|
84
|
+
}, []), H = L(() => {
|
|
85
|
+
const R = w.current;
|
|
86
|
+
R && R.disconnect();
|
|
87
|
+
}, []), h = L(() => {
|
|
88
|
+
var R;
|
|
89
|
+
return ((R = w.current) == null ? void 0 : R.getRoom()) ?? null;
|
|
90
90
|
}, []);
|
|
91
91
|
return {
|
|
92
92
|
connectionState: t,
|
|
93
93
|
agentState: i,
|
|
94
94
|
transcript: l,
|
|
95
95
|
agentConfig: d,
|
|
96
|
-
videoElement:
|
|
97
|
-
audioElement:
|
|
98
|
-
canResume:
|
|
99
|
-
error:
|
|
100
|
-
connect:
|
|
96
|
+
videoElement: g,
|
|
97
|
+
audioElement: s,
|
|
98
|
+
canResume: k,
|
|
99
|
+
error: C,
|
|
100
|
+
connect: I,
|
|
101
101
|
disconnect: H,
|
|
102
102
|
getRoom: h,
|
|
103
|
-
session:
|
|
103
|
+
session: w.current
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
|
-
function
|
|
107
|
-
const e =
|
|
108
|
-
const
|
|
109
|
-
if (!
|
|
106
|
+
function wn() {
|
|
107
|
+
const e = N(null), t = N(null), r = N(null), i = N(null), o = N(/* @__PURE__ */ new Set()), l = N(null), c = L(() => {
|
|
108
|
+
const s = t.current;
|
|
109
|
+
if (!s) {
|
|
110
110
|
i.current = null;
|
|
111
111
|
return;
|
|
112
112
|
}
|
|
113
|
-
(!l.current || l.current.length !==
|
|
114
|
-
new ArrayBuffer(
|
|
113
|
+
(!l.current || l.current.length !== s.frequencyBinCount) && (l.current = new Uint8Array(
|
|
114
|
+
new ArrayBuffer(s.frequencyBinCount)
|
|
115
115
|
));
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
let
|
|
119
|
-
for (let
|
|
120
|
-
const
|
|
121
|
-
for (const
|
|
116
|
+
const a = l.current;
|
|
117
|
+
s.getByteFrequencyData(a);
|
|
118
|
+
let k = 0;
|
|
119
|
+
for (let C = 0; C < a.length; C++) k += a[C];
|
|
120
|
+
const E = k / a.length / 255;
|
|
121
|
+
for (const C of o.current)
|
|
122
122
|
try {
|
|
123
|
-
|
|
123
|
+
C(E);
|
|
124
124
|
} catch (v) {
|
|
125
125
|
console.error("[useAudioLevel] subscriber threw:", v);
|
|
126
126
|
}
|
|
127
127
|
i.current = requestAnimationFrame(c);
|
|
128
|
-
}, []), d =
|
|
128
|
+
}, []), d = L(() => {
|
|
129
129
|
if (e.current || typeof window > "u" || typeof AudioContext > "u") return;
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
}, []), f =
|
|
133
|
-
(
|
|
130
|
+
const s = new AudioContext(), a = s.createAnalyser();
|
|
131
|
+
a.fftSize = 64, a.connect(s.destination), e.current = s, t.current = a;
|
|
132
|
+
}, []), f = L(
|
|
133
|
+
(s) => {
|
|
134
134
|
if (d(), !(!e.current || !t.current)) {
|
|
135
135
|
if (r.current) {
|
|
136
136
|
try {
|
|
@@ -140,17 +140,17 @@ function yn() {
|
|
|
140
140
|
r.current = null;
|
|
141
141
|
}
|
|
142
142
|
try {
|
|
143
|
-
const
|
|
144
|
-
|
|
145
|
-
} catch (
|
|
146
|
-
console.warn("[useAudioLevel] createMediaElementSource failed:",
|
|
143
|
+
const a = e.current.createMediaElementSource(s);
|
|
144
|
+
a.connect(t.current), r.current = a;
|
|
145
|
+
} catch (a) {
|
|
146
|
+
console.warn("[useAudioLevel] createMediaElementSource failed:", a);
|
|
147
147
|
return;
|
|
148
148
|
}
|
|
149
149
|
i.current === null && (i.current = requestAnimationFrame(c));
|
|
150
150
|
}
|
|
151
151
|
},
|
|
152
152
|
[d, c]
|
|
153
|
-
),
|
|
153
|
+
), g = L(() => {
|
|
154
154
|
if (i.current !== null && (cancelAnimationFrame(i.current), i.current = null), r.current) {
|
|
155
155
|
try {
|
|
156
156
|
r.current.disconnect();
|
|
@@ -158,11 +158,11 @@ function yn() {
|
|
|
158
158
|
}
|
|
159
159
|
r.current = null;
|
|
160
160
|
}
|
|
161
|
-
}, []),
|
|
162
|
-
o.current.delete(
|
|
161
|
+
}, []), b = L((s) => (o.current.add(s), () => {
|
|
162
|
+
o.current.delete(s);
|
|
163
163
|
}), []);
|
|
164
|
-
return
|
|
165
|
-
if (
|
|
164
|
+
return A(() => () => {
|
|
165
|
+
if (g(), t.current) {
|
|
166
166
|
try {
|
|
167
167
|
t.current.disconnect();
|
|
168
168
|
} catch {
|
|
@@ -177,80 +177,87 @@ function yn() {
|
|
|
177
177
|
e.current = null;
|
|
178
178
|
}
|
|
179
179
|
o.current.clear(), l.current = null;
|
|
180
|
-
}, [
|
|
180
|
+
}, [g]), { attach: f, detach: g, subscribe: b };
|
|
181
181
|
}
|
|
182
|
-
function
|
|
183
|
-
const [e, t] =
|
|
184
|
-
|
|
182
|
+
function _n() {
|
|
183
|
+
const [e, t] = S(!1), [r, i] = S(null), o = N(null), l = N(null), c = L(
|
|
184
|
+
async (s, a) => {
|
|
185
|
+
if (o.current && l.current) {
|
|
186
|
+
try {
|
|
187
|
+
await l.current.localParticipant.unpublishTrack(o.current);
|
|
188
|
+
} catch {
|
|
189
|
+
}
|
|
190
|
+
o.current.stop(), o.current = null;
|
|
191
|
+
}
|
|
192
|
+
l.current = s, i(null);
|
|
185
193
|
try {
|
|
186
|
-
await
|
|
187
|
-
|
|
194
|
+
const k = await gn({
|
|
195
|
+
echoCancellation: !0,
|
|
196
|
+
noiseSuppression: !0
|
|
197
|
+
});
|
|
198
|
+
a != null && a.startMuted && await k.mute(), await s.localParticipant.publishTrack(k), o.current = k, t(k.isMuted);
|
|
199
|
+
} catch (k) {
|
|
200
|
+
const E = k instanceof Error && k.name === "NotAllowedError" ? "Enable your microphone to talk with the agent." : "Microphone unavailable. Check browser permissions and try again.";
|
|
201
|
+
throw i(E), k;
|
|
188
202
|
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
throw i(s), a;
|
|
201
|
-
}
|
|
202
|
-
}, []), d = k(() => {
|
|
203
|
-
const g = o.current;
|
|
204
|
-
g && (g.isMuted ? (g.unmute(), t(!1)) : (g.mute(), t(!0)));
|
|
205
|
-
}, []), f = k(() => {
|
|
206
|
-
const g = o.current, a = l.current;
|
|
207
|
-
if (g && a) {
|
|
203
|
+
},
|
|
204
|
+
[]
|
|
205
|
+
), d = L(() => {
|
|
206
|
+
const s = o.current;
|
|
207
|
+
s && (s.isMuted ? (s.unmute(), t(!1)) : (s.mute(), t(!0)));
|
|
208
|
+
}, []), f = L((s) => {
|
|
209
|
+
const a = o.current;
|
|
210
|
+
a && (s && !a.isMuted ? (a.mute(), t(!0)) : !s && a.isMuted && (a.unmute(), t(!1)));
|
|
211
|
+
}, []), g = L(() => {
|
|
212
|
+
const s = o.current, a = l.current;
|
|
213
|
+
if (s && a) {
|
|
208
214
|
try {
|
|
209
|
-
a.localParticipant.unpublishTrack(
|
|
215
|
+
a.localParticipant.unpublishTrack(s);
|
|
210
216
|
} catch {
|
|
211
217
|
}
|
|
212
|
-
|
|
218
|
+
s.stop();
|
|
213
219
|
}
|
|
214
220
|
o.current = null, l.current = null, t(!1);
|
|
215
|
-
}, []),
|
|
221
|
+
}, []), b = L(() => i(null), []);
|
|
216
222
|
return {
|
|
217
223
|
isMuted: e,
|
|
218
224
|
micError: r,
|
|
219
225
|
toggleMute: d,
|
|
226
|
+
setMuted: f,
|
|
220
227
|
setupMic: c,
|
|
221
|
-
teardownMic:
|
|
222
|
-
clearError:
|
|
228
|
+
teardownMic: g,
|
|
229
|
+
clearError: b
|
|
223
230
|
};
|
|
224
231
|
}
|
|
225
|
-
const
|
|
226
|
-
function
|
|
227
|
-
const [e, t] =
|
|
228
|
-
f.current =
|
|
229
|
-
}, []),
|
|
230
|
-
const
|
|
231
|
-
if (z &&
|
|
232
|
-
const
|
|
233
|
-
if (
|
|
232
|
+
const xn = { resolution: { width: 640, height: 480, frameRate: 24 } };
|
|
233
|
+
function kn() {
|
|
234
|
+
const [e, t] = S(!1), [r, i] = S(null), [o, l] = S(null), [c, d] = S(""), f = N(null), g = N(null), b = L((w) => {
|
|
235
|
+
f.current = w;
|
|
236
|
+
}, []), s = L(() => {
|
|
237
|
+
const w = f.current, z = g.current;
|
|
238
|
+
if (z && w) {
|
|
239
|
+
const I = w.localParticipant.getTrackPublication(Xt.Source.Camera);
|
|
240
|
+
if (I != null && I.track) {
|
|
234
241
|
try {
|
|
235
|
-
|
|
242
|
+
w.localParticipant.unpublishTrack(I.track);
|
|
236
243
|
} catch {
|
|
237
244
|
}
|
|
238
|
-
|
|
245
|
+
I.track.stop();
|
|
239
246
|
} else
|
|
240
247
|
z.stop();
|
|
241
248
|
}
|
|
242
|
-
|
|
243
|
-
}, []),
|
|
249
|
+
g.current = null, l(null), t(!1);
|
|
250
|
+
}, []), a = L(async (w) => {
|
|
244
251
|
const z = f.current;
|
|
245
252
|
if (z) {
|
|
246
253
|
i(null);
|
|
247
254
|
try {
|
|
248
|
-
const
|
|
249
|
-
|
|
250
|
-
const H = await
|
|
251
|
-
await z.localParticipant.publishTrack(H),
|
|
255
|
+
const I = { ...xn };
|
|
256
|
+
w && (I.deviceId = w);
|
|
257
|
+
const H = await yn(I);
|
|
258
|
+
await z.localParticipant.publishTrack(H), g.current = H;
|
|
252
259
|
const h = H.attach();
|
|
253
|
-
l(h), t(!0),
|
|
260
|
+
l(h), t(!0), w && d(w);
|
|
254
261
|
try {
|
|
255
262
|
z.localParticipant.publishData(
|
|
256
263
|
new TextEncoder().encode(JSON.stringify({ type: "user_camera_on" })),
|
|
@@ -258,41 +265,41 @@ function wn() {
|
|
|
258
265
|
);
|
|
259
266
|
} catch {
|
|
260
267
|
}
|
|
261
|
-
} catch (
|
|
262
|
-
const H =
|
|
268
|
+
} catch (I) {
|
|
269
|
+
const H = I instanceof Error && I.name === "NotAllowedError" ? "Enable your camera in the browser to share video." : "Camera unavailable. Check permissions and try again.";
|
|
263
270
|
i(H);
|
|
264
271
|
}
|
|
265
272
|
}
|
|
266
|
-
}, []),
|
|
267
|
-
e ?
|
|
268
|
-
}, [e, c,
|
|
269
|
-
|
|
270
|
-
}, [
|
|
271
|
-
|
|
272
|
-
}, [
|
|
273
|
-
return
|
|
274
|
-
|
|
273
|
+
}, []), k = L(async () => {
|
|
274
|
+
e ? s() : await a(c || void 0);
|
|
275
|
+
}, [e, c, s, a]), E = L(async (w) => {
|
|
276
|
+
s(), await a(w);
|
|
277
|
+
}, [s, a]), C = L(() => {
|
|
278
|
+
s(), f.current = null, i(null), d("");
|
|
279
|
+
}, [s]), v = L(() => i(null), []);
|
|
280
|
+
return A(() => () => {
|
|
281
|
+
g.current && g.current.stop();
|
|
275
282
|
}, []), {
|
|
276
283
|
isEnabled: e,
|
|
277
284
|
error: r,
|
|
278
285
|
previewEl: o,
|
|
279
286
|
activeDeviceId: c,
|
|
280
|
-
toggle:
|
|
281
|
-
switchDevice:
|
|
282
|
-
attachRoom:
|
|
283
|
-
teardown:
|
|
287
|
+
toggle: k,
|
|
288
|
+
switchDevice: E,
|
|
289
|
+
attachRoom: b,
|
|
290
|
+
teardown: C,
|
|
284
291
|
clearError: v
|
|
285
292
|
};
|
|
286
293
|
}
|
|
287
|
-
function
|
|
288
|
-
const [e, t] =
|
|
289
|
-
c.current =
|
|
290
|
-
}, []), f =
|
|
291
|
-
const
|
|
292
|
-
if (
|
|
294
|
+
function Ln() {
|
|
295
|
+
const [e, t] = S(!1), [r, i] = S(null), [o, l] = S(null), c = N(null), d = L((a) => {
|
|
296
|
+
c.current = a;
|
|
297
|
+
}, []), f = L(() => l(null), []), g = L(async () => {
|
|
298
|
+
const a = c.current;
|
|
299
|
+
if (a) {
|
|
293
300
|
if (e) {
|
|
294
301
|
try {
|
|
295
|
-
await
|
|
302
|
+
await a.localParticipant.setScreenShareEnabled(!1);
|
|
296
303
|
} catch {
|
|
297
304
|
}
|
|
298
305
|
f(), t(!1);
|
|
@@ -300,15 +307,15 @@ function _n() {
|
|
|
300
307
|
}
|
|
301
308
|
i(null);
|
|
302
309
|
try {
|
|
303
|
-
await
|
|
304
|
-
let
|
|
305
|
-
const
|
|
306
|
-
const
|
|
307
|
-
if (
|
|
308
|
-
const v =
|
|
310
|
+
await a.localParticipant.setScreenShareEnabled(!0);
|
|
311
|
+
let k = 0;
|
|
312
|
+
const E = () => {
|
|
313
|
+
const C = a.localParticipant.getTrackPublication(Xt.Source.ScreenShare);
|
|
314
|
+
if (C != null && C.track) {
|
|
315
|
+
const v = C.track.attach();
|
|
309
316
|
l(v), t(!0);
|
|
310
317
|
try {
|
|
311
|
-
|
|
318
|
+
a.localParticipant.publishData(
|
|
312
319
|
new TextEncoder().encode(JSON.stringify({ type: "user_screen_share_on" })),
|
|
313
320
|
{ reliable: !0 }
|
|
314
321
|
);
|
|
@@ -316,27 +323,27 @@ function _n() {
|
|
|
316
323
|
}
|
|
317
324
|
return;
|
|
318
325
|
}
|
|
319
|
-
|
|
326
|
+
k++ < 10 ? setTimeout(E, 100) : t(!0);
|
|
320
327
|
};
|
|
321
|
-
|
|
322
|
-
} catch (
|
|
323
|
-
const
|
|
324
|
-
|
|
328
|
+
E();
|
|
329
|
+
} catch (k) {
|
|
330
|
+
const E = k instanceof Error ? k.name : "";
|
|
331
|
+
E !== "NotAllowedError" && E !== "AbortError" && i("Screen share unavailable. Try again."), t(!1);
|
|
325
332
|
}
|
|
326
333
|
}
|
|
327
|
-
}, [e, f]),
|
|
328
|
-
const
|
|
329
|
-
if (
|
|
334
|
+
}, [e, f]), b = L(() => {
|
|
335
|
+
const a = c.current;
|
|
336
|
+
if (a && e)
|
|
330
337
|
try {
|
|
331
|
-
|
|
338
|
+
a.localParticipant.setScreenShareEnabled(!1);
|
|
332
339
|
} catch {
|
|
333
340
|
}
|
|
334
341
|
f(), t(!1), i(null), c.current = null;
|
|
335
|
-
}, [e, f]),
|
|
336
|
-
return { isEnabled: e, error: r, previewEl: o, toggle:
|
|
342
|
+
}, [e, f]), s = L(() => i(null), []);
|
|
343
|
+
return { isEnabled: e, error: r, previewEl: o, toggle: g, attachRoom: d, teardown: b, clearError: s };
|
|
337
344
|
}
|
|
338
|
-
function
|
|
339
|
-
const [e, t] =
|
|
345
|
+
function Sn() {
|
|
346
|
+
const [e, t] = S([]), [r, i] = S([]), o = L(async () => {
|
|
340
347
|
if (!(typeof navigator > "u" || !navigator.mediaDevices))
|
|
341
348
|
try {
|
|
342
349
|
const l = await navigator.mediaDevices.enumerateDevices();
|
|
@@ -344,36 +351,36 @@ function xn() {
|
|
|
344
351
|
} catch {
|
|
345
352
|
}
|
|
346
353
|
}, []);
|
|
347
|
-
return
|
|
354
|
+
return A(() => {
|
|
348
355
|
if (o(), typeof navigator > "u" || !navigator.mediaDevices) return;
|
|
349
356
|
const l = () => void o();
|
|
350
357
|
return navigator.mediaDevices.addEventListener("devicechange", l), () => navigator.mediaDevices.removeEventListener("devicechange", l);
|
|
351
358
|
}, [o]), { mics: e, cameras: r, refresh: o };
|
|
352
359
|
}
|
|
353
|
-
function
|
|
354
|
-
const [i, o] =
|
|
355
|
-
return
|
|
360
|
+
function Cn(e, t, r = !1) {
|
|
361
|
+
const [i, o] = S(null), [l, c] = S(null), [d, f] = S(!r && !!e);
|
|
362
|
+
return A(() => {
|
|
356
363
|
if (r || !e) {
|
|
357
364
|
f(!1);
|
|
358
365
|
return;
|
|
359
366
|
}
|
|
360
|
-
const
|
|
361
|
-
return f(!0), c(null), fetch(`${
|
|
362
|
-
signal:
|
|
363
|
-
}).then(async (
|
|
364
|
-
if (!
|
|
365
|
-
const
|
|
366
|
-
throw new Error(
|
|
367
|
+
const g = new AbortController(), b = t || "https://app.livelayer.studio";
|
|
368
|
+
return f(!0), c(null), fetch(`${b}/api/widget/agent/${encodeURIComponent(e)}`, {
|
|
369
|
+
signal: g.signal
|
|
370
|
+
}).then(async (s) => {
|
|
371
|
+
if (!s.ok) {
|
|
372
|
+
const a = await s.json().catch(() => ({}));
|
|
373
|
+
throw new Error(a.error || `HTTP ${s.status}`);
|
|
367
374
|
}
|
|
368
|
-
return
|
|
369
|
-
}).then((
|
|
370
|
-
|
|
371
|
-
}).catch((
|
|
372
|
-
|
|
373
|
-
}), () =>
|
|
375
|
+
return s.json();
|
|
376
|
+
}).then((s) => {
|
|
377
|
+
g.signal.aborted || (o(s), f(!1));
|
|
378
|
+
}).catch((s) => {
|
|
379
|
+
g.signal.aborted || (c(s instanceof Error ? s.message : "Agent lookup failed"), f(!1));
|
|
380
|
+
}), () => g.abort();
|
|
374
381
|
}, [e, t, r]), { info: i, error: l, loading: d };
|
|
375
382
|
}
|
|
376
|
-
function
|
|
383
|
+
function En(e) {
|
|
377
384
|
if (typeof window > "u") return null;
|
|
378
385
|
try {
|
|
379
386
|
return window.localStorage.getItem(e);
|
|
@@ -381,19 +388,19 @@ function Ln(e) {
|
|
|
381
388
|
return null;
|
|
382
389
|
}
|
|
383
390
|
}
|
|
384
|
-
function
|
|
391
|
+
function Nn(e, t) {
|
|
385
392
|
if (!(typeof window > "u"))
|
|
386
393
|
try {
|
|
387
394
|
window.localStorage.setItem(e, t);
|
|
388
395
|
} catch {
|
|
389
396
|
}
|
|
390
397
|
}
|
|
391
|
-
function
|
|
398
|
+
function An({
|
|
392
399
|
value: e,
|
|
393
400
|
defaultValue: t = "expanded",
|
|
394
401
|
onChange: r
|
|
395
402
|
} = {}) {
|
|
396
|
-
const i = e !== void 0, [o, l] =
|
|
403
|
+
const i = e !== void 0, [o, l] = S(t), c = i ? e : o, d = L(
|
|
397
404
|
(f) => {
|
|
398
405
|
f !== c && (i || l(f), r == null || r(f));
|
|
399
406
|
},
|
|
@@ -401,34 +408,34 @@ function Cn({
|
|
|
401
408
|
);
|
|
402
409
|
return [c, d];
|
|
403
410
|
}
|
|
404
|
-
const
|
|
405
|
-
function
|
|
406
|
-
return e &&
|
|
411
|
+
const Rn = ["hidden", "minimized", "expanded"];
|
|
412
|
+
function Mn(e) {
|
|
413
|
+
return e && Rn.includes(e) ? e : null;
|
|
407
414
|
}
|
|
408
|
-
function
|
|
415
|
+
function In({
|
|
409
416
|
value: e,
|
|
410
417
|
defaultValue: t = "expanded",
|
|
411
418
|
onChange: r,
|
|
412
419
|
persistKey: i = "ll-widget",
|
|
413
420
|
disablePersistence: o = !1
|
|
414
421
|
} = {}) {
|
|
415
|
-
const l = `${i}:display-mode`, c =
|
|
422
|
+
const l = `${i}:display-mode`, c = N(!1), [d, f] = An({
|
|
416
423
|
value: e,
|
|
417
424
|
defaultValue: t,
|
|
418
|
-
onChange: (
|
|
419
|
-
e === void 0 && !o &&
|
|
425
|
+
onChange: (g) => {
|
|
426
|
+
e === void 0 && !o && Nn(l, g), r == null || r(g);
|
|
420
427
|
}
|
|
421
428
|
});
|
|
422
|
-
return
|
|
429
|
+
return A(() => {
|
|
423
430
|
if (c.current || (c.current = !0, o || e !== void 0)) return;
|
|
424
|
-
const
|
|
425
|
-
|
|
431
|
+
const g = Mn(En(l));
|
|
432
|
+
g && g !== d && f(g);
|
|
426
433
|
}, []), [d, f];
|
|
427
434
|
}
|
|
428
|
-
const
|
|
429
|
-
function
|
|
430
|
-
const [t, r] =
|
|
431
|
-
return
|
|
435
|
+
const Tn = 640;
|
|
436
|
+
function Pn(e = Tn) {
|
|
437
|
+
const [t, r] = S(!1);
|
|
438
|
+
return A(() => {
|
|
432
439
|
if (e === !1) {
|
|
433
440
|
r(!1);
|
|
434
441
|
return;
|
|
@@ -441,9 +448,9 @@ function In(e = Rn) {
|
|
|
441
448
|
});
|
|
442
449
|
}, [e]), t;
|
|
443
450
|
}
|
|
444
|
-
const
|
|
445
|
-
function
|
|
446
|
-
if (typeof window > "u" || window.history[
|
|
451
|
+
const Pt = "__llHistoryPatched", lt = "ll:pathname";
|
|
452
|
+
function Dn() {
|
|
453
|
+
if (typeof window > "u" || window.history[Pt]) return;
|
|
447
454
|
const e = window.history.pushState, t = window.history.replaceState;
|
|
448
455
|
window.history.pushState = function(...r) {
|
|
449
456
|
const i = e.apply(this, r);
|
|
@@ -451,57 +458,57 @@ function Mn() {
|
|
|
451
458
|
}, window.history.replaceState = function(...r) {
|
|
452
459
|
const i = t.apply(this, r);
|
|
453
460
|
return window.dispatchEvent(new Event(lt)), i;
|
|
454
|
-
}, window.history[
|
|
461
|
+
}, window.history[Pt] = !0;
|
|
455
462
|
}
|
|
456
|
-
function
|
|
463
|
+
function Dt() {
|
|
457
464
|
return typeof window > "u" ? "/" : window.location.pathname || "/";
|
|
458
465
|
}
|
|
459
|
-
function
|
|
460
|
-
const [t, r] =
|
|
461
|
-
() => e ??
|
|
466
|
+
function $n(e) {
|
|
467
|
+
const [t, r] = S(
|
|
468
|
+
() => e ?? Dt()
|
|
462
469
|
);
|
|
463
|
-
return
|
|
470
|
+
return A(() => {
|
|
464
471
|
if (e !== void 0) return;
|
|
465
|
-
|
|
466
|
-
const i = () => r(
|
|
472
|
+
Dn();
|
|
473
|
+
const i = () => r(Dt());
|
|
467
474
|
return i(), window.addEventListener("popstate", i), window.addEventListener(lt, i), () => {
|
|
468
475
|
window.removeEventListener("popstate", i), window.removeEventListener(lt, i);
|
|
469
476
|
};
|
|
470
477
|
}, [e]), e ?? t;
|
|
471
478
|
}
|
|
472
|
-
const
|
|
473
|
-
function
|
|
474
|
-
return e.replace(
|
|
479
|
+
const $t = /* @__PURE__ */ new Map(), zn = /[\\^$+?.()|{}[\]]/g;
|
|
480
|
+
function Hn(e) {
|
|
481
|
+
return e.replace(zn, "\\$&");
|
|
475
482
|
}
|
|
476
|
-
function
|
|
477
|
-
const t =
|
|
483
|
+
function On(e) {
|
|
484
|
+
const t = $t.get(e);
|
|
478
485
|
if (t) return t;
|
|
479
|
-
const r = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e, i = "", o = "", l = r.replace(/\*\*/g, i).replace(/\*/g, o), d =
|
|
480
|
-
return
|
|
486
|
+
const r = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e, i = "", o = "", l = r.replace(/\*\*/g, i).replace(/\*/g, o), d = Hn(l).replace(new RegExp(`\\/${i}`, "g"), "(?:\\/.*)?").replace(new RegExp(i, "g"), ".*").replace(new RegExp(o, "g"), "[^/]+"), f = new RegExp(`^${d}\\/?$`);
|
|
487
|
+
return $t.set(e, f), f;
|
|
481
488
|
}
|
|
482
|
-
function
|
|
489
|
+
function Bn(e, t) {
|
|
483
490
|
const r = t.length > 1 && t.endsWith("/") ? t.slice(0, -1) : t;
|
|
484
|
-
return
|
|
491
|
+
return On(e).test(r);
|
|
485
492
|
}
|
|
486
|
-
function
|
|
487
|
-
return typeof e == "function" ? e(t) : e instanceof RegExp ? e.test(t) :
|
|
493
|
+
function qn(e, t) {
|
|
494
|
+
return typeof e == "function" ? e(t) : e instanceof RegExp ? e.test(t) : Bn(e, t);
|
|
488
495
|
}
|
|
489
|
-
function
|
|
496
|
+
function zt(e, t) {
|
|
490
497
|
if (!e || e.length === 0) return !1;
|
|
491
498
|
for (const r of e)
|
|
492
|
-
if (
|
|
499
|
+
if (qn(r, t)) return !0;
|
|
493
500
|
return !1;
|
|
494
501
|
}
|
|
495
|
-
function
|
|
496
|
-
return e === void 0 ? !0 :
|
|
502
|
+
function Wn(e, t, r) {
|
|
503
|
+
return e === void 0 ? !0 : zt(r, e) ? !1 : t && t.length > 0 ? zt(t, e) : !0;
|
|
497
504
|
}
|
|
498
|
-
function
|
|
505
|
+
function Fn(e, t, r) {
|
|
499
506
|
return ot(
|
|
500
|
-
() =>
|
|
507
|
+
() => Wn(e, t, r),
|
|
501
508
|
[e, t, r]
|
|
502
509
|
);
|
|
503
510
|
}
|
|
504
|
-
const
|
|
511
|
+
const Ht = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ _(
|
|
505
512
|
"svg",
|
|
506
513
|
{
|
|
507
514
|
className: t,
|
|
@@ -547,7 +554,7 @@ const Dt = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ _(
|
|
|
547
554
|
}
|
|
548
555
|
)
|
|
549
556
|
}
|
|
550
|
-
),
|
|
557
|
+
), Ot = ({ className: e }) => /* @__PURE__ */ n(
|
|
551
558
|
"svg",
|
|
552
559
|
{
|
|
553
560
|
className: e,
|
|
@@ -565,7 +572,7 @@ const Dt = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ _(
|
|
|
565
572
|
}
|
|
566
573
|
)
|
|
567
574
|
}
|
|
568
|
-
),
|
|
575
|
+
), Un = ({ className: e }) => /* @__PURE__ */ n(
|
|
569
576
|
"svg",
|
|
570
577
|
{
|
|
571
578
|
className: e,
|
|
@@ -576,12 +583,12 @@ const Dt = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ _(
|
|
|
576
583
|
"aria-hidden": "true",
|
|
577
584
|
children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
|
|
578
585
|
}
|
|
579
|
-
),
|
|
586
|
+
), jn = {
|
|
580
587
|
left: 180,
|
|
581
588
|
right: 0,
|
|
582
589
|
up: -90,
|
|
583
590
|
down: 90
|
|
584
|
-
},
|
|
591
|
+
}, Bt = ({ direction: e = "right", className: t }) => /* @__PURE__ */ n(
|
|
585
592
|
"svg",
|
|
586
593
|
{
|
|
587
594
|
className: t,
|
|
@@ -589,19 +596,19 @@ const Dt = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ _(
|
|
|
589
596
|
viewBox: "0 0 24 24",
|
|
590
597
|
stroke: "currentColor",
|
|
591
598
|
strokeWidth: 2,
|
|
592
|
-
style: { transform: `rotate(${
|
|
599
|
+
style: { transform: `rotate(${jn[e]}deg)` },
|
|
593
600
|
"aria-hidden": "true",
|
|
594
601
|
children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 6l6 6-6 6" })
|
|
595
602
|
}
|
|
596
603
|
);
|
|
597
|
-
function
|
|
604
|
+
function Vn(e) {
|
|
598
605
|
return e === "top-left" || e === "bottom-left" ? "left" : "right";
|
|
599
606
|
}
|
|
600
|
-
const
|
|
601
|
-
function
|
|
607
|
+
const Qt = "ll-hidden-tab-center-y", Yn = 5, qt = 16;
|
|
608
|
+
function Gn() {
|
|
602
609
|
if (typeof window > "u") return null;
|
|
603
610
|
try {
|
|
604
|
-
const e = window.localStorage.getItem(
|
|
611
|
+
const e = window.localStorage.getItem(Qt);
|
|
605
612
|
if (!e) return null;
|
|
606
613
|
const t = Number.parseFloat(e);
|
|
607
614
|
return Number.isFinite(t) ? t : null;
|
|
@@ -609,14 +616,14 @@ function jn() {
|
|
|
609
616
|
return null;
|
|
610
617
|
}
|
|
611
618
|
}
|
|
612
|
-
function
|
|
619
|
+
function Wt(e) {
|
|
613
620
|
if (!(typeof window > "u"))
|
|
614
621
|
try {
|
|
615
|
-
window.localStorage.setItem(
|
|
622
|
+
window.localStorage.setItem(Qt, String(e));
|
|
616
623
|
} catch {
|
|
617
624
|
}
|
|
618
625
|
}
|
|
619
|
-
const
|
|
626
|
+
const Jn = ({
|
|
620
627
|
position: e,
|
|
621
628
|
isMobile: t,
|
|
622
629
|
isSpeaking: r,
|
|
@@ -625,106 +632,106 @@ const Vn = ({
|
|
|
625
632
|
avatarImageUrl: l,
|
|
626
633
|
agentName: c
|
|
627
634
|
}) => {
|
|
628
|
-
const d =
|
|
629
|
-
(
|
|
630
|
-
if (typeof window > "u") return
|
|
631
|
-
const O =
|
|
632
|
-
return
|
|
635
|
+
const d = Vn(e), f = d === "right" ? "left" : "right", g = t ? 80 : 72, b = !!l, [s, a] = S(null), [k, E] = S(!1), C = N(null), v = N(!1), w = L(
|
|
636
|
+
(M) => {
|
|
637
|
+
if (typeof window > "u") return M;
|
|
638
|
+
const O = g / 2, W = qt + O, J = window.innerHeight - qt - O;
|
|
639
|
+
return J < W ? Math.max(W, M) : Math.max(W, Math.min(J, M));
|
|
633
640
|
},
|
|
634
|
-
[
|
|
641
|
+
[g]
|
|
635
642
|
);
|
|
636
|
-
|
|
637
|
-
const
|
|
638
|
-
|
|
643
|
+
A(() => {
|
|
644
|
+
const M = Gn();
|
|
645
|
+
a(w(M ?? window.innerHeight / 2));
|
|
639
646
|
const O = () => {
|
|
640
|
-
|
|
647
|
+
a((W) => W === null ? null : w(W));
|
|
641
648
|
};
|
|
642
649
|
return window.addEventListener("resize", O), () => window.removeEventListener("resize", O);
|
|
643
|
-
}, [
|
|
644
|
-
const z =
|
|
645
|
-
(
|
|
646
|
-
if (!(
|
|
650
|
+
}, [w]);
|
|
651
|
+
const z = L(
|
|
652
|
+
(M) => {
|
|
653
|
+
if (!(M.pointerType === "mouse" && M.button !== 0) && s !== null) {
|
|
647
654
|
try {
|
|
648
|
-
|
|
655
|
+
M.currentTarget.setPointerCapture(M.pointerId);
|
|
649
656
|
} catch {
|
|
650
657
|
}
|
|
651
|
-
|
|
652
|
-
startClientY:
|
|
653
|
-
startCenterY:
|
|
658
|
+
C.current = {
|
|
659
|
+
startClientY: M.clientY,
|
|
660
|
+
startCenterY: s,
|
|
654
661
|
moved: !1
|
|
655
662
|
};
|
|
656
663
|
}
|
|
657
664
|
},
|
|
658
|
-
[
|
|
659
|
-
),
|
|
660
|
-
(
|
|
661
|
-
const O =
|
|
665
|
+
[s]
|
|
666
|
+
), I = L(
|
|
667
|
+
(M) => {
|
|
668
|
+
const O = C.current;
|
|
662
669
|
if (!O) return;
|
|
663
|
-
const W =
|
|
664
|
-
!O.moved && Math.abs(W) >
|
|
670
|
+
const W = M.clientY - O.startClientY;
|
|
671
|
+
!O.moved && Math.abs(W) > Yn && (O.moved = !0, E(!0)), O.moved && a(w(O.startCenterY + W));
|
|
665
672
|
},
|
|
666
|
-
[
|
|
667
|
-
), H =
|
|
668
|
-
(
|
|
669
|
-
const O =
|
|
673
|
+
[w]
|
|
674
|
+
), H = L(
|
|
675
|
+
(M) => {
|
|
676
|
+
const O = C.current;
|
|
670
677
|
if (O) {
|
|
671
678
|
try {
|
|
672
|
-
|
|
679
|
+
M.currentTarget.releasePointerCapture(M.pointerId);
|
|
673
680
|
} catch {
|
|
674
681
|
}
|
|
675
|
-
|
|
682
|
+
C.current = null, O.moved && (E(!1), v.current = !0, a((W) => (W !== null && Wt(W), W)));
|
|
676
683
|
}
|
|
677
684
|
},
|
|
678
685
|
[]
|
|
679
|
-
), h =
|
|
686
|
+
), h = L(() => {
|
|
680
687
|
if (v.current) {
|
|
681
688
|
v.current = !1;
|
|
682
689
|
return;
|
|
683
690
|
}
|
|
684
691
|
i();
|
|
685
|
-
}, [i]),
|
|
686
|
-
(
|
|
687
|
-
if (
|
|
688
|
-
|
|
689
|
-
const O =
|
|
690
|
-
|
|
692
|
+
}, [i]), R = L(
|
|
693
|
+
(M) => {
|
|
694
|
+
if (M.key === "ArrowUp" || M.key === "ArrowDown") {
|
|
695
|
+
M.preventDefault();
|
|
696
|
+
const O = M.key === "ArrowUp" ? -8 : 8;
|
|
697
|
+
a((W) => {
|
|
691
698
|
if (W === null) return W;
|
|
692
|
-
const
|
|
693
|
-
return
|
|
699
|
+
const J = w(W + O);
|
|
700
|
+
return Wt(J), J;
|
|
694
701
|
});
|
|
695
702
|
}
|
|
696
703
|
},
|
|
697
|
-
[
|
|
704
|
+
[w]
|
|
698
705
|
), q = [
|
|
699
706
|
"ll-hidden",
|
|
700
707
|
`ll-hidden--${d}`,
|
|
701
708
|
t ? "ll-hidden--mobile" : "ll-hidden--desktop",
|
|
702
709
|
r ? "ll-hidden--speaking" : null,
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
].filter(Boolean).join(" "), D =
|
|
710
|
+
k ? "is-dragging" : null,
|
|
711
|
+
b ? "ll-hidden--with-avatar" : null
|
|
712
|
+
].filter(Boolean).join(" "), D = s === null ? void 0 : { top: `${s - g / 2}px`, transform: "none" };
|
|
706
713
|
return /* @__PURE__ */ n(
|
|
707
714
|
"button",
|
|
708
715
|
{
|
|
709
716
|
type: "button",
|
|
710
717
|
className: q,
|
|
711
718
|
onPointerDown: z,
|
|
712
|
-
onPointerMove:
|
|
719
|
+
onPointerMove: I,
|
|
713
720
|
onPointerUp: H,
|
|
714
721
|
onPointerCancel: H,
|
|
715
722
|
onClick: h,
|
|
716
|
-
onKeyDown:
|
|
723
|
+
onKeyDown: R,
|
|
717
724
|
"aria-label": o,
|
|
718
725
|
"data-position": e,
|
|
719
726
|
style: D,
|
|
720
|
-
children:
|
|
727
|
+
children: b ? (
|
|
721
728
|
// Layout: tiny chevron flush against the inward edge (peeks out
|
|
722
729
|
// as the click affordance), then the circular avatar photo
|
|
723
730
|
// taking the rest of the tab. Reinforces "this is an
|
|
724
731
|
// avatar-based experience" even when collapsed.
|
|
725
|
-
/* @__PURE__ */ _(
|
|
732
|
+
/* @__PURE__ */ _(yt, { children: [
|
|
726
733
|
/* @__PURE__ */ n(
|
|
727
|
-
|
|
734
|
+
Bt,
|
|
728
735
|
{
|
|
729
736
|
direction: f,
|
|
730
737
|
className: "ll-hidden__chevron ll-hidden__chevron--mini"
|
|
@@ -741,7 +748,7 @@ const Vn = ({
|
|
|
741
748
|
)
|
|
742
749
|
] })
|
|
743
750
|
) : /* @__PURE__ */ n(
|
|
744
|
-
|
|
751
|
+
Bt,
|
|
745
752
|
{
|
|
746
753
|
direction: f,
|
|
747
754
|
className: "ll-hidden__chevron"
|
|
@@ -749,7 +756,7 @@ const Vn = ({
|
|
|
749
756
|
)
|
|
750
757
|
}
|
|
751
758
|
);
|
|
752
|
-
},
|
|
759
|
+
}, Kn = ({
|
|
753
760
|
audioLevel: e,
|
|
754
761
|
bars: t = 20,
|
|
755
762
|
maxHeight: r = 20,
|
|
@@ -757,31 +764,31 @@ const Vn = ({
|
|
|
757
764
|
className: o,
|
|
758
765
|
barClassName: l
|
|
759
766
|
}) => {
|
|
760
|
-
const c =
|
|
761
|
-
const
|
|
762
|
-
return Array.from({ length: t }, (
|
|
767
|
+
const c = N(null), d = N([]), f = ot(() => {
|
|
768
|
+
const b = (Math.sqrt(5) - 1) / 2;
|
|
769
|
+
return Array.from({ length: t }, (s, a) => 0.5 + a * b % 1 * 0.5);
|
|
763
770
|
}, [t]);
|
|
764
|
-
|
|
765
|
-
for (let
|
|
766
|
-
const
|
|
767
|
-
if (!
|
|
768
|
-
const
|
|
769
|
-
|
|
771
|
+
A(() => e.subscribe((s) => {
|
|
772
|
+
for (let a = 0; a < t; a++) {
|
|
773
|
+
const k = d.current[a];
|
|
774
|
+
if (!k) continue;
|
|
775
|
+
const E = Math.max(i, s * r * f[a]);
|
|
776
|
+
k.style.height = `${E}px`;
|
|
770
777
|
}
|
|
771
778
|
}), [e, t, r, i, f]);
|
|
772
|
-
const
|
|
773
|
-
return /* @__PURE__ */ n("div", { ref: c, className:
|
|
779
|
+
const g = ["ll-waveform", o].filter(Boolean).join(" ");
|
|
780
|
+
return /* @__PURE__ */ n("div", { ref: c, className: g, "aria-hidden": "true", children: Array.from({ length: t }, (b, s) => /* @__PURE__ */ n(
|
|
774
781
|
"div",
|
|
775
782
|
{
|
|
776
|
-
ref: (
|
|
777
|
-
d.current[
|
|
783
|
+
ref: (a) => {
|
|
784
|
+
d.current[s] = a;
|
|
778
785
|
},
|
|
779
786
|
className: ["ll-waveform__bar", l].filter(Boolean).join(" "),
|
|
780
787
|
style: { height: `${i}px` }
|
|
781
788
|
},
|
|
782
|
-
|
|
789
|
+
s
|
|
783
790
|
)) });
|
|
784
|
-
},
|
|
791
|
+
}, Xn = ({
|
|
785
792
|
position: e,
|
|
786
793
|
isMobile: t,
|
|
787
794
|
agentName: r,
|
|
@@ -791,7 +798,7 @@ const Vn = ({
|
|
|
791
798
|
audioLevel: c,
|
|
792
799
|
onExpand: d,
|
|
793
800
|
onToggleMute: f,
|
|
794
|
-
onClose:
|
|
801
|
+
onClose: g
|
|
795
802
|
}) => t ? /* @__PURE__ */ n(
|
|
796
803
|
"div",
|
|
797
804
|
{
|
|
@@ -818,7 +825,7 @@ const Vn = ({
|
|
|
818
825
|
)
|
|
819
826
|
) : /* @__PURE__ */ n("div", { className: "ll-minimized__avatar ll-minimized__avatar--placeholder" }),
|
|
820
827
|
/* @__PURE__ */ n(
|
|
821
|
-
|
|
828
|
+
Kn,
|
|
822
829
|
{
|
|
823
830
|
audioLevel: c,
|
|
824
831
|
bars: 16,
|
|
@@ -834,17 +841,17 @@ const Vn = ({
|
|
|
834
841
|
className: "ll-minimized__btn",
|
|
835
842
|
role: "button",
|
|
836
843
|
tabIndex: 0,
|
|
837
|
-
onClick: (
|
|
838
|
-
|
|
844
|
+
onClick: (b) => {
|
|
845
|
+
b.stopPropagation(), f();
|
|
839
846
|
},
|
|
840
|
-
onKeyDown: (
|
|
841
|
-
(
|
|
847
|
+
onKeyDown: (b) => {
|
|
848
|
+
(b.key === "Enter" || b.key === " ") && (b.stopPropagation(), b.preventDefault(), f());
|
|
842
849
|
},
|
|
843
850
|
"aria-label": l ? "Unmute microphone" : "Mute microphone",
|
|
844
|
-
children: /* @__PURE__ */ n(
|
|
851
|
+
children: /* @__PURE__ */ n(Ht, { muted: l, className: "ll-minimized__icon" })
|
|
845
852
|
}
|
|
846
853
|
),
|
|
847
|
-
/* @__PURE__ */ n(
|
|
854
|
+
/* @__PURE__ */ n(Ot, { className: "ll-minimized__icon ll-minimized__icon--expand" })
|
|
848
855
|
] })
|
|
849
856
|
]
|
|
850
857
|
}
|
|
@@ -881,7 +888,7 @@ const Vn = ({
|
|
|
881
888
|
className: "ll-minimized__btn",
|
|
882
889
|
onClick: f,
|
|
883
890
|
"aria-label": l ? "Unmute microphone" : "Mute microphone",
|
|
884
|
-
children: /* @__PURE__ */ n(
|
|
891
|
+
children: /* @__PURE__ */ n(Ht, { muted: l, className: "ll-minimized__icon" })
|
|
885
892
|
}
|
|
886
893
|
),
|
|
887
894
|
/* @__PURE__ */ n(
|
|
@@ -891,7 +898,7 @@ const Vn = ({
|
|
|
891
898
|
className: "ll-minimized__btn",
|
|
892
899
|
onClick: d,
|
|
893
900
|
"aria-label": `Expand ${r} widget`,
|
|
894
|
-
children: /* @__PURE__ */ n(
|
|
901
|
+
children: /* @__PURE__ */ n(Ot, { className: "ll-minimized__icon" })
|
|
895
902
|
}
|
|
896
903
|
),
|
|
897
904
|
/* @__PURE__ */ n(
|
|
@@ -899,23 +906,23 @@ const Vn = ({
|
|
|
899
906
|
{
|
|
900
907
|
type: "button",
|
|
901
908
|
className: "ll-minimized__btn ll-minimized__btn--close",
|
|
902
|
-
onClick:
|
|
909
|
+
onClick: g,
|
|
903
910
|
"aria-label": "Close widget",
|
|
904
|
-
children: /* @__PURE__ */ n(
|
|
911
|
+
children: /* @__PURE__ */ n(Un, { className: "ll-minimized__icon" })
|
|
905
912
|
}
|
|
906
913
|
)
|
|
907
914
|
] })
|
|
908
915
|
] })
|
|
909
916
|
}
|
|
910
|
-
),
|
|
917
|
+
), Qn = ({
|
|
911
918
|
src: e,
|
|
912
919
|
alt: t,
|
|
913
920
|
preCannedPlaying: r = !1,
|
|
914
921
|
className: i,
|
|
915
922
|
style: o
|
|
916
923
|
}) => {
|
|
917
|
-
const [l, c] =
|
|
918
|
-
if (
|
|
924
|
+
const [l, c] = S(!1), d = N(e);
|
|
925
|
+
if (A(() => {
|
|
919
926
|
d.current !== e && (d.current = e, c(!1));
|
|
920
927
|
}, [e]), !e) return null;
|
|
921
928
|
const f = {
|
|
@@ -945,7 +952,7 @@ const Vn = ({
|
|
|
945
952
|
}
|
|
946
953
|
)
|
|
947
954
|
);
|
|
948
|
-
},
|
|
955
|
+
}, Zn = ({
|
|
949
956
|
position: e,
|
|
950
957
|
isMobile: t,
|
|
951
958
|
agentName: r,
|
|
@@ -955,133 +962,134 @@ const Vn = ({
|
|
|
955
962
|
branding: c,
|
|
956
963
|
teamMembers: d,
|
|
957
964
|
currentTeamMemberId: f,
|
|
958
|
-
isSwitchingTeamMember:
|
|
959
|
-
teamSwitcherOpen:
|
|
960
|
-
onToggleTeamSwitcher:
|
|
961
|
-
onSelectTeamMember:
|
|
962
|
-
languageMenuOpen:
|
|
963
|
-
onToggleLanguageMenu:
|
|
964
|
-
connectionState:
|
|
965
|
+
isSwitchingTeamMember: g,
|
|
966
|
+
teamSwitcherOpen: b,
|
|
967
|
+
onToggleTeamSwitcher: s,
|
|
968
|
+
onSelectTeamMember: a,
|
|
969
|
+
languageMenuOpen: k,
|
|
970
|
+
onToggleLanguageMenu: E,
|
|
971
|
+
connectionState: C,
|
|
965
972
|
agentState: v,
|
|
966
|
-
transcript:
|
|
973
|
+
transcript: w,
|
|
967
974
|
canResume: z,
|
|
968
|
-
needsUserGesture:
|
|
975
|
+
needsUserGesture: I,
|
|
969
976
|
error: H,
|
|
970
977
|
isMuted: h,
|
|
971
|
-
micError:
|
|
978
|
+
micError: R,
|
|
972
979
|
micDevices: q,
|
|
973
980
|
isCameraEnabled: D,
|
|
974
|
-
cameraPreviewEl:
|
|
981
|
+
cameraPreviewEl: M,
|
|
975
982
|
cameraDevices: O,
|
|
976
983
|
activeCameraId: W,
|
|
977
|
-
isScreenShareEnabled:
|
|
978
|
-
screenPreviewEl:
|
|
979
|
-
isSpeakerMuted:
|
|
980
|
-
allowCamera:
|
|
981
|
-
allowScreenShare:
|
|
982
|
-
allowTyping:
|
|
983
|
-
avatarVideoContainerRef:
|
|
984
|
-
agentVideoEl:
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
984
|
+
isScreenShareEnabled: J,
|
|
985
|
+
screenPreviewEl: ne,
|
|
986
|
+
isSpeakerMuted: ye,
|
|
987
|
+
allowCamera: Je,
|
|
988
|
+
allowScreenShare: Ke,
|
|
989
|
+
allowTyping: Xe,
|
|
990
|
+
avatarVideoContainerRef: Qe,
|
|
991
|
+
agentVideoEl: ee,
|
|
992
|
+
micGateOpen: ae,
|
|
993
|
+
onConnect: ve,
|
|
994
|
+
onDisconnect: xe,
|
|
995
|
+
onRetry: ke,
|
|
996
|
+
onResumeAudio: Le,
|
|
997
|
+
onToggleMute: Se,
|
|
998
|
+
onToggleCamera: Ce,
|
|
999
|
+
onSwitchCameraDevice: V,
|
|
1000
|
+
onToggleScreenShare: st,
|
|
1001
|
+
onToggleSpeaker: ct,
|
|
1002
|
+
onSendMessage: Ze,
|
|
1003
|
+
onMinimize: ce,
|
|
1004
|
+
onClose: Ee,
|
|
1005
|
+
onClearMicError: He
|
|
998
1006
|
}) => {
|
|
999
|
-
var
|
|
1000
|
-
const
|
|
1001
|
-
|
|
1002
|
-
if (!
|
|
1003
|
-
|
|
1007
|
+
var Ie;
|
|
1008
|
+
const be = ((d == null ? void 0 : d.length) ?? 0) > 1, Ne = C === "connecting" || C === "connected", G = C === "connected", Q = C === "idle" || C === "disconnected" || C === "error", [Ae, re] = S(!1);
|
|
1009
|
+
A(() => {
|
|
1010
|
+
if (!ee) {
|
|
1011
|
+
re(!1);
|
|
1004
1012
|
return;
|
|
1005
1013
|
}
|
|
1006
|
-
if (!
|
|
1007
|
-
|
|
1014
|
+
if (!ee.paused && ee.readyState >= 2) {
|
|
1015
|
+
re(!0);
|
|
1008
1016
|
return;
|
|
1009
1017
|
}
|
|
1010
|
-
|
|
1011
|
-
const p = () =>
|
|
1012
|
-
return
|
|
1013
|
-
|
|
1018
|
+
re(!1);
|
|
1019
|
+
const p = () => re(!0);
|
|
1020
|
+
return ee.addEventListener("playing", p), ee.addEventListener("loadeddata", p), () => {
|
|
1021
|
+
ee.removeEventListener("playing", p), ee.removeEventListener("loadeddata", p);
|
|
1014
1022
|
};
|
|
1015
|
-
}, [
|
|
1016
|
-
const [
|
|
1017
|
-
|
|
1018
|
-
if (!
|
|
1019
|
-
|
|
1023
|
+
}, [ee]);
|
|
1024
|
+
const [se, we] = S(!1);
|
|
1025
|
+
A(() => {
|
|
1026
|
+
if (!G) {
|
|
1027
|
+
we(!1);
|
|
1020
1028
|
return;
|
|
1021
1029
|
}
|
|
1022
|
-
if (
|
|
1023
|
-
const p = setTimeout(() =>
|
|
1030
|
+
if (Ae) return;
|
|
1031
|
+
const p = setTimeout(() => we(!0), 8e3);
|
|
1024
1032
|
return () => clearTimeout(p);
|
|
1025
|
-
}, [
|
|
1026
|
-
const
|
|
1027
|
-
|
|
1028
|
-
const p =
|
|
1029
|
-
p && (p.innerHTML = "",
|
|
1030
|
-
}, [
|
|
1031
|
-
const p =
|
|
1032
|
-
p && (p.innerHTML = "",
|
|
1033
|
-
}, [
|
|
1034
|
-
const [
|
|
1035
|
-
|
|
1036
|
-
if (!
|
|
1033
|
+
}, [G, Ae]);
|
|
1034
|
+
const Oe = C === "connecting" || G && !!i && !Ae && !se, te = N(null), ie = N(null);
|
|
1035
|
+
A(() => {
|
|
1036
|
+
const p = te.current;
|
|
1037
|
+
p && (p.innerHTML = "", M && (M.style.width = "100%", M.style.height = "100%", M.style.objectFit = "cover", M.style.transform = "scaleX(-1)", p.appendChild(M)));
|
|
1038
|
+
}, [M]), A(() => {
|
|
1039
|
+
const p = ie.current;
|
|
1040
|
+
p && (p.innerHTML = "", ne && (ne.style.width = "100%", ne.style.height = "100%", ne.style.objectFit = "contain", p.appendChild(ne)));
|
|
1041
|
+
}, [ne]);
|
|
1042
|
+
const [oe, de] = S(!1), [Re, ue] = S(!1);
|
|
1043
|
+
A(() => {
|
|
1044
|
+
if (!oe && !Re && !k && !b) return;
|
|
1037
1045
|
const p = () => {
|
|
1038
|
-
|
|
1046
|
+
de(!1), ue(!1), k && E(), b && s();
|
|
1039
1047
|
};
|
|
1040
1048
|
return document.addEventListener("click", p), () => document.removeEventListener("click", p);
|
|
1041
1049
|
}, [
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1050
|
+
oe,
|
|
1051
|
+
Re,
|
|
1052
|
+
k,
|
|
1053
|
+
b,
|
|
1054
|
+
E,
|
|
1055
|
+
s
|
|
1048
1056
|
]);
|
|
1049
|
-
const [
|
|
1057
|
+
const [fe, Be] = S(""), qe = L(
|
|
1050
1058
|
(p) => {
|
|
1051
1059
|
p.preventDefault();
|
|
1052
|
-
const Y =
|
|
1053
|
-
Y && (
|
|
1060
|
+
const Y = fe.trim();
|
|
1061
|
+
Y && (Ze(Y), Be(""));
|
|
1054
1062
|
},
|
|
1055
|
-
[
|
|
1056
|
-
),
|
|
1057
|
-
let
|
|
1058
|
-
for (let p =
|
|
1059
|
-
const Y =
|
|
1060
|
-
if (!
|
|
1063
|
+
[fe, Ze]
|
|
1064
|
+
), We = c.productName || "Live Layer";
|
|
1065
|
+
let pe = null, he = null;
|
|
1066
|
+
for (let p = w.length - 1; p >= 0; p--) {
|
|
1067
|
+
const Y = w[p];
|
|
1068
|
+
if (!pe && Y.role === "agent" ? pe = Y : !he && Y.role === "user" && (he = Y), pe && he) break;
|
|
1061
1069
|
}
|
|
1062
|
-
const
|
|
1070
|
+
const Me = G ? (pe == null ? void 0 : pe.text) || null : l || null, et = G && (he == null ? void 0 : he.text) || null, Fe = [
|
|
1063
1071
|
"ll-expanded",
|
|
1064
1072
|
t ? "ll-expanded--mobile" : "ll-expanded--desktop"
|
|
1065
1073
|
].join(" ");
|
|
1066
1074
|
return /* @__PURE__ */ _(
|
|
1067
1075
|
"div",
|
|
1068
1076
|
{
|
|
1069
|
-
className:
|
|
1077
|
+
className: Fe,
|
|
1070
1078
|
"data-position": e,
|
|
1071
|
-
"data-state":
|
|
1079
|
+
"data-state": G ? "connected" : Ne ? "connecting" : "idle",
|
|
1072
1080
|
role: "dialog",
|
|
1073
1081
|
"aria-label": `${r} widget`,
|
|
1074
1082
|
children: [
|
|
1075
1083
|
/* @__PURE__ */ _("div", { className: "ll-expanded__bg", children: [
|
|
1076
1084
|
i ? /* @__PURE__ */ n(
|
|
1077
|
-
|
|
1085
|
+
Qn,
|
|
1078
1086
|
{
|
|
1079
1087
|
src: i,
|
|
1080
1088
|
alt: r,
|
|
1081
1089
|
className: "ll-expanded__bg-img"
|
|
1082
1090
|
}
|
|
1083
|
-
) : /* @__PURE__ */ n("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ n("span", { className: "ll-expanded__bg-initial", children: ((
|
|
1084
|
-
o && !
|
|
1091
|
+
) : /* @__PURE__ */ n("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ n("span", { className: "ll-expanded__bg-initial", children: ((Ie = r == null ? void 0 : r.charAt(0)) == null ? void 0 : Ie.toUpperCase()) || "A" }) }),
|
|
1092
|
+
o && !G && /* @__PURE__ */ n(
|
|
1085
1093
|
"video",
|
|
1086
1094
|
{
|
|
1087
1095
|
className: "ll-expanded__bg-idle",
|
|
@@ -1093,24 +1101,24 @@ const Vn = ({
|
|
|
1093
1101
|
}
|
|
1094
1102
|
)
|
|
1095
1103
|
] }),
|
|
1096
|
-
/* @__PURE__ */ n("div", { ref:
|
|
1097
|
-
|
|
1104
|
+
/* @__PURE__ */ n("div", { ref: Qe, className: "ll-expanded__video" }),
|
|
1105
|
+
Oe && /* @__PURE__ */ _("div", { className: "ll-expanded__overlay ll-expanded__overlay--connecting", children: [
|
|
1098
1106
|
/* @__PURE__ */ n("div", { className: "ll-expanded__spinner" }),
|
|
1099
|
-
/* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children:
|
|
1107
|
+
/* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children: g ? "Switching..." : "Connecting..." })
|
|
1100
1108
|
] }),
|
|
1101
|
-
|
|
1109
|
+
I && G && /* @__PURE__ */ _(
|
|
1102
1110
|
"button",
|
|
1103
1111
|
{
|
|
1104
1112
|
type: "button",
|
|
1105
1113
|
className: "ll-expanded__overlay ll-expanded__overlay--gesture",
|
|
1106
|
-
onClick:
|
|
1114
|
+
onClick: Le,
|
|
1107
1115
|
children: [
|
|
1108
1116
|
/* @__PURE__ */ n("svg", { width: "32", height: "32", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": !0, children: /* @__PURE__ */ n("path", { d: "M3 9v6h4l5 5V4L7 9H3zm13.54.12a5 5 0 0 1 0 5.76l-1.41-1.41a3 3 0 0 0 0-2.94L16.54 9.12z" }) }),
|
|
1109
1117
|
/* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children: "Tap to enable audio" })
|
|
1110
1118
|
]
|
|
1111
1119
|
}
|
|
1112
1120
|
),
|
|
1113
|
-
|
|
1121
|
+
Ne ? /* @__PURE__ */ _("div", { className: "ll-expanded__topbar", children: [
|
|
1114
1122
|
/* @__PURE__ */ _("div", { className: "ll-expanded__topbar-left", children: [
|
|
1115
1123
|
/* @__PURE__ */ _("div", { className: "ll-expanded__pill-wrap", children: [
|
|
1116
1124
|
/* @__PURE__ */ _(
|
|
@@ -1119,17 +1127,17 @@ const Vn = ({
|
|
|
1119
1127
|
type: "button",
|
|
1120
1128
|
className: "ll-hpill",
|
|
1121
1129
|
onClick: (p) => {
|
|
1122
|
-
|
|
1130
|
+
be && (p.stopPropagation(), s());
|
|
1123
1131
|
},
|
|
1124
|
-
"aria-haspopup":
|
|
1125
|
-
"aria-expanded":
|
|
1132
|
+
"aria-haspopup": be ? "listbox" : void 0,
|
|
1133
|
+
"aria-expanded": be ? b : void 0,
|
|
1126
1134
|
children: [
|
|
1127
1135
|
/* @__PURE__ */ n("span", { className: "ll-hpill__label", children: r }),
|
|
1128
|
-
|
|
1136
|
+
be && /* @__PURE__ */ n(rt, {})
|
|
1129
1137
|
]
|
|
1130
1138
|
}
|
|
1131
1139
|
),
|
|
1132
|
-
|
|
1140
|
+
be && b && /* @__PURE__ */ n(
|
|
1133
1141
|
"div",
|
|
1134
1142
|
{
|
|
1135
1143
|
className: "ll-hmenu",
|
|
@@ -1140,7 +1148,7 @@ const Vn = ({
|
|
|
1140
1148
|
{
|
|
1141
1149
|
type: "button",
|
|
1142
1150
|
className: `ll-hmenu__item ${p.id === f ? "is-active" : ""}`,
|
|
1143
|
-
onClick: () =>
|
|
1151
|
+
onClick: () => a(p.id),
|
|
1144
1152
|
role: "option",
|
|
1145
1153
|
"aria-selected": p.id === f,
|
|
1146
1154
|
children: [
|
|
@@ -1168,10 +1176,10 @@ const Vn = ({
|
|
|
1168
1176
|
type: "button",
|
|
1169
1177
|
className: "ll-hpill ll-hpill--compact",
|
|
1170
1178
|
onClick: (p) => {
|
|
1171
|
-
p.stopPropagation(),
|
|
1179
|
+
p.stopPropagation(), E();
|
|
1172
1180
|
},
|
|
1173
1181
|
"aria-haspopup": "listbox",
|
|
1174
|
-
"aria-expanded":
|
|
1182
|
+
"aria-expanded": k,
|
|
1175
1183
|
"aria-label": "Language: English",
|
|
1176
1184
|
title: "Language: English",
|
|
1177
1185
|
children: [
|
|
@@ -1180,7 +1188,7 @@ const Vn = ({
|
|
|
1180
1188
|
]
|
|
1181
1189
|
}
|
|
1182
1190
|
),
|
|
1183
|
-
|
|
1191
|
+
k && /* @__PURE__ */ n(
|
|
1184
1192
|
"div",
|
|
1185
1193
|
{
|
|
1186
1194
|
className: "ll-hmenu",
|
|
@@ -1213,10 +1221,10 @@ const Vn = ({
|
|
|
1213
1221
|
{
|
|
1214
1222
|
type: "button",
|
|
1215
1223
|
className: "ll-hbtn",
|
|
1216
|
-
onClick:
|
|
1224
|
+
onClick: ce,
|
|
1217
1225
|
"aria-label": "Minimize widget",
|
|
1218
1226
|
title: "Minimize",
|
|
1219
|
-
children: /* @__PURE__ */ n(
|
|
1227
|
+
children: /* @__PURE__ */ n(Ut, {})
|
|
1220
1228
|
}
|
|
1221
1229
|
),
|
|
1222
1230
|
/* @__PURE__ */ n(
|
|
@@ -1224,26 +1232,26 @@ const Vn = ({
|
|
|
1224
1232
|
{
|
|
1225
1233
|
type: "button",
|
|
1226
1234
|
className: "ll-hbtn ll-hbtn--danger",
|
|
1227
|
-
onClick:
|
|
1235
|
+
onClick: Ee,
|
|
1228
1236
|
"aria-label": "End call",
|
|
1229
1237
|
title: "End call",
|
|
1230
|
-
children: /* @__PURE__ */ n(
|
|
1238
|
+
children: /* @__PURE__ */ n(Ft, {})
|
|
1231
1239
|
}
|
|
1232
1240
|
)
|
|
1233
1241
|
] })
|
|
1234
1242
|
] }) : (
|
|
1235
1243
|
// Idle-state header with Live Layer product name + minimize/close
|
|
1236
1244
|
/* @__PURE__ */ _("div", { className: "ll-expanded__header ll-expanded__header--idle", children: [
|
|
1237
|
-
/* @__PURE__ */ n("span", { className: "ll-expanded__brand", children:
|
|
1245
|
+
/* @__PURE__ */ n("span", { className: "ll-expanded__brand", children: We }),
|
|
1238
1246
|
/* @__PURE__ */ _("div", { className: "ll-expanded__header-actions", children: [
|
|
1239
1247
|
/* @__PURE__ */ n(
|
|
1240
1248
|
"button",
|
|
1241
1249
|
{
|
|
1242
1250
|
type: "button",
|
|
1243
1251
|
className: "ll-hbtn ll-hbtn--ghost",
|
|
1244
|
-
onClick:
|
|
1252
|
+
onClick: ce,
|
|
1245
1253
|
"aria-label": "Minimize widget",
|
|
1246
|
-
children: /* @__PURE__ */ n(
|
|
1254
|
+
children: /* @__PURE__ */ n(Ut, {})
|
|
1247
1255
|
}
|
|
1248
1256
|
),
|
|
1249
1257
|
/* @__PURE__ */ n(
|
|
@@ -1251,23 +1259,23 @@ const Vn = ({
|
|
|
1251
1259
|
{
|
|
1252
1260
|
type: "button",
|
|
1253
1261
|
className: "ll-hbtn ll-hbtn--danger",
|
|
1254
|
-
onClick:
|
|
1262
|
+
onClick: Ee,
|
|
1255
1263
|
"aria-label": "Close widget",
|
|
1256
|
-
children: /* @__PURE__ */ n(
|
|
1264
|
+
children: /* @__PURE__ */ n(Ft, {})
|
|
1257
1265
|
}
|
|
1258
1266
|
)
|
|
1259
1267
|
] })
|
|
1260
1268
|
] })
|
|
1261
1269
|
),
|
|
1262
|
-
|
|
1263
|
-
const p = z ? "Restart paused session" :
|
|
1264
|
-
return /* @__PURE__ */ _(
|
|
1265
|
-
|
|
1270
|
+
Q && /* @__PURE__ */ (() => {
|
|
1271
|
+
const p = z ? "Restart paused session" : C === "disconnected" ? "Reconnect to agent" : "Start video call", Y = z ? "Pick up where you left off" : null;
|
|
1272
|
+
return /* @__PURE__ */ _(yt, { children: [
|
|
1273
|
+
C === "idle" && !z && !H && /* @__PURE__ */ _(
|
|
1266
1274
|
"button",
|
|
1267
1275
|
{
|
|
1268
1276
|
type: "button",
|
|
1269
1277
|
className: "ll-expanded__play",
|
|
1270
|
-
onClick:
|
|
1278
|
+
onClick: ve,
|
|
1271
1279
|
"aria-label": p,
|
|
1272
1280
|
children: [
|
|
1273
1281
|
/* @__PURE__ */ n("div", { className: "ll-expanded__play-circle", children: /* @__PURE__ */ n("svg", { width: "22", height: "22", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": !0, children: /* @__PURE__ */ n("polygon", { points: "6 3 20 12 6 21 6 3" }) }) }),
|
|
@@ -1283,7 +1291,7 @@ const Vn = ({
|
|
|
1283
1291
|
{
|
|
1284
1292
|
type: "button",
|
|
1285
1293
|
className: "ll-expanded__cta",
|
|
1286
|
-
onClick:
|
|
1294
|
+
onClick: ve,
|
|
1287
1295
|
"aria-label": p,
|
|
1288
1296
|
children: p
|
|
1289
1297
|
}
|
|
@@ -1294,64 +1302,64 @@ const Vn = ({
|
|
|
1294
1302
|
/* @__PURE__ */ _(
|
|
1295
1303
|
"div",
|
|
1296
1304
|
{
|
|
1297
|
-
className: `ll-expanded__pip ${
|
|
1305
|
+
className: `ll-expanded__pip ${Ne && (D || J) ? "is-visible" : ""}`,
|
|
1298
1306
|
children: [
|
|
1299
1307
|
/* @__PURE__ */ n(
|
|
1300
1308
|
"div",
|
|
1301
1309
|
{
|
|
1302
|
-
ref:
|
|
1303
|
-
className:
|
|
1310
|
+
ref: ie,
|
|
1311
|
+
className: J ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
|
|
1304
1312
|
}
|
|
1305
1313
|
),
|
|
1306
1314
|
/* @__PURE__ */ n(
|
|
1307
1315
|
"div",
|
|
1308
1316
|
{
|
|
1309
|
-
ref:
|
|
1310
|
-
className: !
|
|
1317
|
+
ref: te,
|
|
1318
|
+
className: !J && D ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
|
|
1311
1319
|
}
|
|
1312
1320
|
)
|
|
1313
1321
|
]
|
|
1314
1322
|
}
|
|
1315
1323
|
),
|
|
1316
|
-
|
|
1317
|
-
|
|
1324
|
+
Ne ? /* @__PURE__ */ _("div", { className: "ll-expanded__bottom", children: [
|
|
1325
|
+
Me && /* @__PURE__ */ n(
|
|
1318
1326
|
"div",
|
|
1319
1327
|
{
|
|
1320
1328
|
className: "ll-expanded__transcript ll-expanded__transcript--agent",
|
|
1321
1329
|
"data-role": "agent",
|
|
1322
|
-
children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children:
|
|
1330
|
+
children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: Me })
|
|
1323
1331
|
}
|
|
1324
1332
|
),
|
|
1325
|
-
|
|
1333
|
+
et && /* @__PURE__ */ n(
|
|
1326
1334
|
"div",
|
|
1327
1335
|
{
|
|
1328
1336
|
className: "ll-expanded__transcript ll-expanded__transcript--user",
|
|
1329
1337
|
"data-role": "user",
|
|
1330
|
-
children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children:
|
|
1338
|
+
children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: et })
|
|
1331
1339
|
}
|
|
1332
1340
|
),
|
|
1333
1341
|
/* @__PURE__ */ _("div", { className: "ll-toolbar", onClick: (p) => p.stopPropagation(), children: [
|
|
1334
|
-
|
|
1342
|
+
Ke && /* @__PURE__ */ n(
|
|
1335
1343
|
"button",
|
|
1336
1344
|
{
|
|
1337
1345
|
type: "button",
|
|
1338
|
-
className: `ll-tool ${
|
|
1339
|
-
onClick:
|
|
1340
|
-
"aria-label":
|
|
1341
|
-
title:
|
|
1342
|
-
children: /* @__PURE__ */ n(
|
|
1346
|
+
className: `ll-tool ${J ? "is-on" : ""}`,
|
|
1347
|
+
onClick: st,
|
|
1348
|
+
"aria-label": J ? "Stop sharing screen" : "Share screen",
|
|
1349
|
+
title: J ? "Stop sharing" : "Share screen",
|
|
1350
|
+
children: /* @__PURE__ */ n(er, {})
|
|
1343
1351
|
}
|
|
1344
1352
|
),
|
|
1345
|
-
|
|
1353
|
+
Je && /* @__PURE__ */ _("div", { className: "ll-tool-split", children: [
|
|
1346
1354
|
/* @__PURE__ */ n(
|
|
1347
1355
|
"button",
|
|
1348
1356
|
{
|
|
1349
1357
|
type: "button",
|
|
1350
1358
|
className: `ll-tool ll-tool--left ${D ? "is-on" : ""}`,
|
|
1351
|
-
onClick:
|
|
1359
|
+
onClick: Ce,
|
|
1352
1360
|
"aria-label": D ? "Turn off camera" : "Turn on camera",
|
|
1353
1361
|
title: D ? "Stop camera" : "Start camera",
|
|
1354
|
-
children: /* @__PURE__ */ n(
|
|
1362
|
+
children: /* @__PURE__ */ n(tr, {})
|
|
1355
1363
|
}
|
|
1356
1364
|
),
|
|
1357
1365
|
/* @__PURE__ */ n(
|
|
@@ -1360,71 +1368,78 @@ const Vn = ({
|
|
|
1360
1368
|
type: "button",
|
|
1361
1369
|
className: `ll-tool ll-tool--right ${D ? "is-on" : ""}`,
|
|
1362
1370
|
onClick: (p) => {
|
|
1363
|
-
p.stopPropagation(),
|
|
1371
|
+
p.stopPropagation(), ue((Y) => !Y), de(!1);
|
|
1364
1372
|
},
|
|
1365
1373
|
"aria-label": "Camera devices",
|
|
1366
1374
|
"aria-haspopup": "listbox",
|
|
1367
|
-
"aria-expanded":
|
|
1375
|
+
"aria-expanded": Re,
|
|
1368
1376
|
children: /* @__PURE__ */ n(rt, {})
|
|
1369
1377
|
}
|
|
1370
1378
|
),
|
|
1371
|
-
|
|
1372
|
-
|
|
1379
|
+
Re && O.length > 0 && /* @__PURE__ */ n(
|
|
1380
|
+
jt,
|
|
1373
1381
|
{
|
|
1374
1382
|
label: "Camera",
|
|
1375
1383
|
devices: O,
|
|
1376
1384
|
activeId: W,
|
|
1377
1385
|
onPick: (p) => {
|
|
1378
|
-
|
|
1386
|
+
ue(!1), V(p);
|
|
1379
1387
|
}
|
|
1380
1388
|
}
|
|
1381
1389
|
)
|
|
1382
1390
|
] }),
|
|
1383
|
-
/* @__PURE__ */ _(
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
{
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1391
|
+
/* @__PURE__ */ _(
|
|
1392
|
+
"div",
|
|
1393
|
+
{
|
|
1394
|
+
className: `ll-tool-split${!ae && G ? " ll-tool-split--gated" : ""}`,
|
|
1395
|
+
children: [
|
|
1396
|
+
/* @__PURE__ */ n(
|
|
1397
|
+
"button",
|
|
1398
|
+
{
|
|
1399
|
+
type: "button",
|
|
1400
|
+
className: `ll-tool ll-tool--left ${h ? "is-muted" : ""}`,
|
|
1401
|
+
onClick: Se,
|
|
1402
|
+
disabled: !ae && G,
|
|
1403
|
+
"aria-label": !ae && G ? "Microphone enables once the agent finishes its greeting" : h ? "Unmute microphone" : "Mute microphone",
|
|
1404
|
+
title: !ae && G ? "Mic enables after greeting" : h ? "Unmute" : "Mute",
|
|
1405
|
+
children: /* @__PURE__ */ n(nr, { muted: h })
|
|
1406
|
+
}
|
|
1407
|
+
),
|
|
1408
|
+
/* @__PURE__ */ n(
|
|
1409
|
+
"button",
|
|
1410
|
+
{
|
|
1411
|
+
type: "button",
|
|
1412
|
+
className: `ll-tool ll-tool--right ${h ? "is-muted" : ""}`,
|
|
1413
|
+
onClick: (p) => {
|
|
1414
|
+
p.stopPropagation(), de((Y) => !Y), ue(!1);
|
|
1415
|
+
},
|
|
1416
|
+
"aria-label": "Microphone devices",
|
|
1417
|
+
"aria-haspopup": "listbox",
|
|
1418
|
+
"aria-expanded": oe,
|
|
1419
|
+
children: /* @__PURE__ */ n(rt, {})
|
|
1420
|
+
}
|
|
1421
|
+
),
|
|
1422
|
+
oe && q.length > 0 && /* @__PURE__ */ n(
|
|
1423
|
+
jt,
|
|
1424
|
+
{
|
|
1425
|
+
label: "Microphone",
|
|
1426
|
+
devices: q,
|
|
1427
|
+
activeId: "",
|
|
1428
|
+
onPick: () => de(!1)
|
|
1429
|
+
}
|
|
1430
|
+
)
|
|
1431
|
+
]
|
|
1432
|
+
}
|
|
1433
|
+
),
|
|
1419
1434
|
/* @__PURE__ */ n(
|
|
1420
1435
|
"button",
|
|
1421
1436
|
{
|
|
1422
1437
|
type: "button",
|
|
1423
|
-
className: `ll-tool ${
|
|
1424
|
-
onClick:
|
|
1425
|
-
"aria-label":
|
|
1426
|
-
title:
|
|
1427
|
-
children: /* @__PURE__ */ n(
|
|
1438
|
+
className: `ll-tool ${ye ? "is-muted" : ""}`,
|
|
1439
|
+
onClick: ct,
|
|
1440
|
+
"aria-label": ye ? "Unmute speaker" : "Mute speaker",
|
|
1441
|
+
title: ye ? "Unmute speaker" : "Mute speaker",
|
|
1442
|
+
children: /* @__PURE__ */ n(rr, { muted: ye })
|
|
1428
1443
|
}
|
|
1429
1444
|
),
|
|
1430
1445
|
/* @__PURE__ */ n(
|
|
@@ -1432,52 +1447,52 @@ const Vn = ({
|
|
|
1432
1447
|
{
|
|
1433
1448
|
type: "button",
|
|
1434
1449
|
className: "ll-tool ll-tool--danger",
|
|
1435
|
-
onClick:
|
|
1450
|
+
onClick: xe,
|
|
1436
1451
|
"aria-label": "End conversation",
|
|
1437
1452
|
title: "End conversation",
|
|
1438
|
-
children: /* @__PURE__ */ n(
|
|
1453
|
+
children: /* @__PURE__ */ n(or, {})
|
|
1439
1454
|
}
|
|
1440
1455
|
)
|
|
1441
1456
|
] }),
|
|
1442
|
-
|
|
1457
|
+
Xe && /* @__PURE__ */ _("form", { className: "ll-message-input", onSubmit: qe, children: [
|
|
1443
1458
|
/* @__PURE__ */ n(
|
|
1444
1459
|
"input",
|
|
1445
1460
|
{
|
|
1446
1461
|
type: "text",
|
|
1447
1462
|
className: "ll-message-input__field",
|
|
1448
1463
|
placeholder: "Message...",
|
|
1449
|
-
value:
|
|
1450
|
-
onChange: (p) =>
|
|
1464
|
+
value: fe,
|
|
1465
|
+
onChange: (p) => Be(p.target.value),
|
|
1451
1466
|
"aria-label": "Message the agent"
|
|
1452
1467
|
}
|
|
1453
1468
|
),
|
|
1454
|
-
|
|
1469
|
+
fe.trim() && /* @__PURE__ */ n(
|
|
1455
1470
|
"button",
|
|
1456
1471
|
{
|
|
1457
1472
|
type: "submit",
|
|
1458
1473
|
className: "ll-message-input__send",
|
|
1459
1474
|
"aria-label": "Send message",
|
|
1460
|
-
children: /* @__PURE__ */ n(
|
|
1475
|
+
children: /* @__PURE__ */ n(ir, {})
|
|
1461
1476
|
}
|
|
1462
1477
|
)
|
|
1463
1478
|
] })
|
|
1464
1479
|
] }) : null,
|
|
1465
1480
|
(() => {
|
|
1466
|
-
if (
|
|
1481
|
+
if (R && C !== "error")
|
|
1467
1482
|
return /* @__PURE__ */ _("div", { className: "ll-expanded__banner", role: "alert", children: [
|
|
1468
|
-
/* @__PURE__ */ n("span", { children:
|
|
1483
|
+
/* @__PURE__ */ n("span", { children: R }),
|
|
1469
1484
|
/* @__PURE__ */ n(
|
|
1470
1485
|
"button",
|
|
1471
1486
|
{
|
|
1472
1487
|
type: "button",
|
|
1473
1488
|
className: "ll-expanded__banner-x",
|
|
1474
|
-
onClick:
|
|
1489
|
+
onClick: He,
|
|
1475
1490
|
"aria-label": "Dismiss",
|
|
1476
1491
|
children: "×"
|
|
1477
1492
|
}
|
|
1478
1493
|
)
|
|
1479
1494
|
] });
|
|
1480
|
-
if (!H ||
|
|
1495
|
+
if (!H || C !== "error") return null;
|
|
1481
1496
|
let p = "Failed to connect", Y = "Try again";
|
|
1482
1497
|
return H === "MIC_PERMISSION_DENIED" ? p = "Microphone blocked. Allow access to talk." : H === "MIC_NOT_FOUND" ? p = "No microphone found. Plug one in + retry." : H === "MIC_UNAVAILABLE" ? p = "Mic unavailable. Check other apps using it." : H === "AGENT_TIMEOUT" ? p = "Agent didn't pick up. Try again." : H === "CONNECT_FAILED" ? p = "Connection failed. Check your network." : H.length < 80 && (p = H), /* @__PURE__ */ _("div", { className: "ll-expanded__banner ll-expanded__banner--error", role: "alert", children: [
|
|
1483
1498
|
/* @__PURE__ */ n("span", { children: p }),
|
|
@@ -1486,7 +1501,7 @@ const Vn = ({
|
|
|
1486
1501
|
{
|
|
1487
1502
|
type: "button",
|
|
1488
1503
|
className: "ll-expanded__banner-retry",
|
|
1489
|
-
onClick:
|
|
1504
|
+
onClick: ke,
|
|
1490
1505
|
children: Y
|
|
1491
1506
|
}
|
|
1492
1507
|
)
|
|
@@ -1499,29 +1514,29 @@ const Vn = ({
|
|
|
1499
1514
|
function rt() {
|
|
1500
1515
|
return /* @__PURE__ */ n("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": !0, children: /* @__PURE__ */ n("polyline", { points: "6 9 12 15 18 9" }) });
|
|
1501
1516
|
}
|
|
1502
|
-
function
|
|
1517
|
+
function Ft() {
|
|
1503
1518
|
return /* @__PURE__ */ _("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": !0, children: [
|
|
1504
1519
|
/* @__PURE__ */ n("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
1505
1520
|
/* @__PURE__ */ n("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
1506
1521
|
] });
|
|
1507
1522
|
}
|
|
1508
|
-
function
|
|
1523
|
+
function Ut() {
|
|
1509
1524
|
return /* @__PURE__ */ n("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": !0, children: /* @__PURE__ */ n("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) });
|
|
1510
1525
|
}
|
|
1511
|
-
function
|
|
1526
|
+
function er() {
|
|
1512
1527
|
return /* @__PURE__ */ _("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
|
|
1513
1528
|
/* @__PURE__ */ n("rect", { x: "2", y: "3", width: "20", height: "14", rx: "2" }),
|
|
1514
1529
|
/* @__PURE__ */ n("line", { x1: "8", y1: "21", x2: "16", y2: "21" }),
|
|
1515
1530
|
/* @__PURE__ */ n("line", { x1: "12", y1: "17", x2: "12", y2: "21" })
|
|
1516
1531
|
] });
|
|
1517
1532
|
}
|
|
1518
|
-
function
|
|
1533
|
+
function tr() {
|
|
1519
1534
|
return /* @__PURE__ */ _("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
|
|
1520
1535
|
/* @__PURE__ */ n("path", { d: "M23 7l-7 5 7 5V7z" }),
|
|
1521
1536
|
/* @__PURE__ */ n("rect", { x: "1", y: "5", width: "15", height: "14", rx: "2" })
|
|
1522
1537
|
] });
|
|
1523
1538
|
}
|
|
1524
|
-
function
|
|
1539
|
+
function nr({ muted: e }) {
|
|
1525
1540
|
return /* @__PURE__ */ _("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
|
|
1526
1541
|
/* @__PURE__ */ n("path", { d: "M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z" }),
|
|
1527
1542
|
/* @__PURE__ */ n("path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }),
|
|
@@ -1529,22 +1544,22 @@ function Zn({ muted: e }) {
|
|
|
1529
1544
|
e && /* @__PURE__ */ n("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
|
|
1530
1545
|
] });
|
|
1531
1546
|
}
|
|
1532
|
-
function
|
|
1547
|
+
function rr({ muted: e }) {
|
|
1533
1548
|
return /* @__PURE__ */ _("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
|
|
1534
1549
|
/* @__PURE__ */ n("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
|
|
1535
|
-
e ? /* @__PURE__ */ n("line", { x1: "23", y1: "9", x2: "17", y2: "15" }) : /* @__PURE__ */ _(
|
|
1550
|
+
e ? /* @__PURE__ */ n("line", { x1: "23", y1: "9", x2: "17", y2: "15" }) : /* @__PURE__ */ _(yt, { children: [
|
|
1536
1551
|
/* @__PURE__ */ n("path", { d: "M19.07 4.93a10 10 0 0 1 0 14.14" }),
|
|
1537
1552
|
/* @__PURE__ */ n("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" })
|
|
1538
1553
|
] })
|
|
1539
1554
|
] });
|
|
1540
1555
|
}
|
|
1541
|
-
function
|
|
1556
|
+
function ir() {
|
|
1542
1557
|
return /* @__PURE__ */ _("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
|
|
1543
1558
|
/* @__PURE__ */ n("line", { x1: "5", y1: "12", x2: "19", y2: "12" }),
|
|
1544
1559
|
/* @__PURE__ */ n("polyline", { points: "12 5 19 12 12 19" })
|
|
1545
1560
|
] });
|
|
1546
1561
|
}
|
|
1547
|
-
function
|
|
1562
|
+
function or() {
|
|
1548
1563
|
return /* @__PURE__ */ n("svg", { width: "16", height: "16", viewBox: "-4 -4 32 32", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: /* @__PURE__ */ n(
|
|
1549
1564
|
"path",
|
|
1550
1565
|
{
|
|
@@ -1553,7 +1568,7 @@ function nr() {
|
|
|
1553
1568
|
}
|
|
1554
1569
|
) });
|
|
1555
1570
|
}
|
|
1556
|
-
const
|
|
1571
|
+
const jt = ({ label: e, devices: t, activeId: r, onPick: i }) => /* @__PURE__ */ _(
|
|
1557
1572
|
"div",
|
|
1558
1573
|
{
|
|
1559
1574
|
className: "ll-device-menu",
|
|
@@ -1581,21 +1596,21 @@ const Wt = ({ label: e, devices: t, activeId: r, onPick: i }) => /* @__PURE__ */
|
|
|
1581
1596
|
})
|
|
1582
1597
|
]
|
|
1583
1598
|
}
|
|
1584
|
-
),
|
|
1599
|
+
), lr = [
|
|
1585
1600
|
'[data-ll-private="true"]',
|
|
1586
1601
|
".ll-widget"
|
|
1587
1602
|
];
|
|
1588
|
-
function
|
|
1603
|
+
function bt(e) {
|
|
1589
1604
|
let t = e;
|
|
1590
1605
|
for (; t; ) {
|
|
1591
|
-
for (const r of
|
|
1606
|
+
for (const r of lr)
|
|
1592
1607
|
if (t.matches(r)) return !0;
|
|
1593
1608
|
t = t.parentElement;
|
|
1594
1609
|
}
|
|
1595
1610
|
return !1;
|
|
1596
1611
|
}
|
|
1597
1612
|
function at(e) {
|
|
1598
|
-
if (
|
|
1613
|
+
if (bt(e)) return !1;
|
|
1599
1614
|
if (e instanceof HTMLInputElement) {
|
|
1600
1615
|
if (e.type === "password") return !1;
|
|
1601
1616
|
const t = (e.getAttribute("autocomplete") || "").toLowerCase();
|
|
@@ -1603,7 +1618,7 @@ function at(e) {
|
|
|
1603
1618
|
}
|
|
1604
1619
|
return !0;
|
|
1605
1620
|
}
|
|
1606
|
-
const it = 4096,
|
|
1621
|
+
const it = 4096, ar = 20, sr = 20, cr = 10, dr = 10, ur = 30, Vt = 500, fr = [
|
|
1607
1622
|
'[data-ll-private="true"]',
|
|
1608
1623
|
".ll-widget",
|
|
1609
1624
|
"script",
|
|
@@ -1611,24 +1626,24 @@ const it = 4096, ir = 20, or = 20, lr = 10, ar = 10, sr = 30, Ft = 500, cr = [
|
|
|
1611
1626
|
"noscript",
|
|
1612
1627
|
"iframe"
|
|
1613
1628
|
];
|
|
1614
|
-
function
|
|
1629
|
+
function Ye(e) {
|
|
1615
1630
|
if (e.getAttribute("aria-hidden") === "true" || e.hasAttribute("hidden")) return !0;
|
|
1616
1631
|
let t = e;
|
|
1617
1632
|
for (; t; ) {
|
|
1618
|
-
for (const r of
|
|
1633
|
+
for (const r of fr)
|
|
1619
1634
|
if (t.matches(r)) return !0;
|
|
1620
1635
|
t = t.parentElement;
|
|
1621
1636
|
}
|
|
1622
1637
|
return !1;
|
|
1623
1638
|
}
|
|
1624
|
-
function
|
|
1639
|
+
function Ge(e) {
|
|
1625
1640
|
if (typeof window > "u") return !0;
|
|
1626
1641
|
const t = e.getBoundingClientRect();
|
|
1627
1642
|
if (t.width <= 0 || t.height <= 0) return !1;
|
|
1628
1643
|
const r = window.innerHeight || document.documentElement.clientHeight, i = window.innerWidth || document.documentElement.clientWidth;
|
|
1629
1644
|
return t.bottom > 0 && t.right > 0 && t.top < r && t.left < i;
|
|
1630
1645
|
}
|
|
1631
|
-
function
|
|
1646
|
+
function Yt(e) {
|
|
1632
1647
|
const t = e.getAttribute("id");
|
|
1633
1648
|
if (t) {
|
|
1634
1649
|
const l = document.querySelector(`label[for="${CSS.escape(t)}"]`);
|
|
@@ -1641,13 +1656,13 @@ function Ut(e) {
|
|
|
1641
1656
|
const o = e.closest("label");
|
|
1642
1657
|
return o != null && o.textContent ? o.textContent.trim() : "";
|
|
1643
1658
|
}
|
|
1644
|
-
function
|
|
1659
|
+
function _e(e, t) {
|
|
1645
1660
|
return e.length <= t ? e : e.slice(0, t - 1) + "…";
|
|
1646
1661
|
}
|
|
1647
|
-
function
|
|
1662
|
+
function De(e) {
|
|
1648
1663
|
return e.length;
|
|
1649
1664
|
}
|
|
1650
|
-
function
|
|
1665
|
+
function pr(e, t = {}) {
|
|
1651
1666
|
const r = t.doc ?? (typeof document < "u" ? document : null);
|
|
1652
1667
|
if (!r)
|
|
1653
1668
|
return {
|
|
@@ -1665,101 +1680,101 @@ function dr(e, t = {}) {
|
|
|
1665
1680
|
r.querySelectorAll("[data-ll-region]")
|
|
1666
1681
|
), d = [];
|
|
1667
1682
|
for (const h of c) {
|
|
1668
|
-
if (d.length >=
|
|
1669
|
-
if (
|
|
1670
|
-
const
|
|
1683
|
+
if (d.length >= cr) break;
|
|
1684
|
+
if (Ye(h) || !Ge(h)) continue;
|
|
1685
|
+
const R = h.getAttribute("data-ll-region") ?? "", q = h.getAttribute("data-ll-intent") ?? void 0, D = _e(
|
|
1671
1686
|
(h.innerText || h.textContent || "").trim(),
|
|
1672
|
-
|
|
1687
|
+
Vt * 2
|
|
1673
1688
|
);
|
|
1674
|
-
!
|
|
1689
|
+
!R || !D || d.push({ id: R, intent: q, text: D });
|
|
1675
1690
|
}
|
|
1676
|
-
const f = [],
|
|
1691
|
+
const f = [], g = ["H1", "H2", "H3", "H4", "H5", "H6"], b = Array.from(
|
|
1677
1692
|
r.querySelectorAll("h1, h2, h3, h4, h5, h6")
|
|
1678
1693
|
);
|
|
1679
|
-
for (const h of
|
|
1680
|
-
if (
|
|
1681
|
-
const
|
|
1682
|
-
|
|
1694
|
+
for (const h of b) {
|
|
1695
|
+
if (Ye(h) || !Ge(h)) continue;
|
|
1696
|
+
const R = (h.textContent || "").trim();
|
|
1697
|
+
R && f.push(`${h.tagName}: ${_e(R, 200)}`);
|
|
1683
1698
|
}
|
|
1684
|
-
const
|
|
1685
|
-
for (const h of
|
|
1686
|
-
if (
|
|
1687
|
-
const
|
|
1688
|
-
|
|
1699
|
+
const s = Array.from(r.querySelectorAll("p, li"));
|
|
1700
|
+
for (const h of s) {
|
|
1701
|
+
if (Ye(h) || !Ge(h) || g.includes(h.tagName)) continue;
|
|
1702
|
+
const R = (h.textContent || "").trim();
|
|
1703
|
+
R.length > 10 && f.push(_e(R, Vt));
|
|
1689
1704
|
}
|
|
1690
|
-
const
|
|
1691
|
-
`),
|
|
1692
|
-
for (const h of
|
|
1693
|
-
if (
|
|
1694
|
-
if (
|
|
1695
|
-
const
|
|
1696
|
-
!
|
|
1705
|
+
const a = f.join(`
|
|
1706
|
+
`), k = [], E = Array.from(r.querySelectorAll("a[href]"));
|
|
1707
|
+
for (const h of E) {
|
|
1708
|
+
if (k.length >= ar) break;
|
|
1709
|
+
if (Ye(h) || !Ge(h)) continue;
|
|
1710
|
+
const R = h.getAttribute("href") || "", q = (h.textContent || "").trim();
|
|
1711
|
+
!R || !q || k.push({ href: R, text: _e(q, 100) });
|
|
1697
1712
|
}
|
|
1698
|
-
const
|
|
1713
|
+
const C = [], v = Array.from(
|
|
1699
1714
|
r.querySelectorAll(
|
|
1700
1715
|
"input, textarea, select"
|
|
1701
1716
|
)
|
|
1702
1717
|
);
|
|
1703
1718
|
for (const h of v) {
|
|
1704
|
-
if (
|
|
1705
|
-
if (
|
|
1706
|
-
const
|
|
1707
|
-
|
|
1719
|
+
if (C.length >= sr) break;
|
|
1720
|
+
if (Ye(h) || !at(h) || !Ge(h)) continue;
|
|
1721
|
+
const R = Yt(h), q = h instanceof HTMLInputElement ? h.type : h.tagName.toLowerCase();
|
|
1722
|
+
R && C.push({ label: _e(R, 100), type: q });
|
|
1708
1723
|
}
|
|
1709
|
-
const
|
|
1724
|
+
const w = Array.from(
|
|
1710
1725
|
r.querySelectorAll("[data-ll-form]")
|
|
1711
1726
|
), z = [];
|
|
1712
|
-
for (const h of
|
|
1713
|
-
if (z.length >=
|
|
1714
|
-
if (
|
|
1715
|
-
const
|
|
1716
|
-
if (!
|
|
1727
|
+
for (const h of w) {
|
|
1728
|
+
if (z.length >= dr) break;
|
|
1729
|
+
if (bt(h)) continue;
|
|
1730
|
+
const R = h.getAttribute("data-ll-form") || "";
|
|
1731
|
+
if (!R) continue;
|
|
1717
1732
|
const q = h.getAttribute("data-ll-intent") || void 0, D = Array.from(
|
|
1718
1733
|
h.querySelectorAll(
|
|
1719
1734
|
"[data-ll-field]"
|
|
1720
1735
|
)
|
|
1721
|
-
),
|
|
1736
|
+
), M = [];
|
|
1722
1737
|
for (const O of D) {
|
|
1723
|
-
if (
|
|
1738
|
+
if (M.length >= ur) break;
|
|
1724
1739
|
if (!at(O)) continue;
|
|
1725
1740
|
const W = O.getAttribute("data-ll-field") || "";
|
|
1726
1741
|
if (!W) continue;
|
|
1727
|
-
const
|
|
1728
|
-
|
|
1742
|
+
const J = Yt(O) || W, ne = O instanceof HTMLInputElement ? O.type : O.tagName.toLowerCase();
|
|
1743
|
+
M.push({ name: W, label: _e(J, 100), type: ne });
|
|
1729
1744
|
}
|
|
1730
|
-
z.push({ id:
|
|
1745
|
+
z.push({ id: R, intent: q, fields: M });
|
|
1731
1746
|
}
|
|
1732
|
-
const
|
|
1747
|
+
const I = {
|
|
1733
1748
|
url: i,
|
|
1734
1749
|
title: l,
|
|
1735
1750
|
pathname: o,
|
|
1736
1751
|
regions: d,
|
|
1737
|
-
visibleText:
|
|
1738
|
-
visibleLinks:
|
|
1739
|
-
visibleFields:
|
|
1752
|
+
visibleText: a,
|
|
1753
|
+
visibleLinks: k,
|
|
1754
|
+
visibleFields: C,
|
|
1740
1755
|
forms: z,
|
|
1741
1756
|
extras: e
|
|
1742
1757
|
};
|
|
1743
|
-
let H =
|
|
1744
|
-
for (; H > it &&
|
|
1745
|
-
|
|
1746
|
-
for (; H > it &&
|
|
1747
|
-
|
|
1748
|
-
return
|
|
1749
|
-
}
|
|
1750
|
-
let
|
|
1751
|
-
function
|
|
1758
|
+
let H = De(JSON.stringify(I.regions)) + De(I.visibleText) + De(JSON.stringify(I.visibleLinks)) + De(JSON.stringify(I.visibleFields));
|
|
1759
|
+
for (; H > it && I.visibleFields.length > 0; )
|
|
1760
|
+
I.visibleFields.pop(), H = De(JSON.stringify(I.visibleFields));
|
|
1761
|
+
for (; H > it && I.visibleLinks.length > 0; )
|
|
1762
|
+
I.visibleLinks.pop(), H -= 80;
|
|
1763
|
+
return De(I.visibleText) > it && (I.visibleText = _e(I.visibleText, it - 100)), I;
|
|
1764
|
+
}
|
|
1765
|
+
let $e = null;
|
|
1766
|
+
function Gt(e, t = {}) {
|
|
1752
1767
|
const r = Date.now(), o = `${typeof window < "u" && window.location.pathname || "/"}::${typeof window < "u" ? window.scrollY : 0}`;
|
|
1753
|
-
if (
|
|
1754
|
-
return
|
|
1755
|
-
const l =
|
|
1756
|
-
return
|
|
1768
|
+
if ($e && $e.key === o && r - $e.at < 1e3)
|
|
1769
|
+
return $e.ctx;
|
|
1770
|
+
const l = pr(e, t);
|
|
1771
|
+
return $e = { key: o, at: r, ctx: l }, l;
|
|
1757
1772
|
}
|
|
1758
|
-
function
|
|
1759
|
-
|
|
1773
|
+
function hr() {
|
|
1774
|
+
$e = null;
|
|
1760
1775
|
}
|
|
1761
|
-
const
|
|
1762
|
-
function
|
|
1776
|
+
const mr = 200;
|
|
1777
|
+
function gr(e) {
|
|
1763
1778
|
const t = String(e.href || "");
|
|
1764
1779
|
return {
|
|
1765
1780
|
href: t,
|
|
@@ -1769,51 +1784,51 @@ function pr(e) {
|
|
|
1769
1784
|
description: e.description
|
|
1770
1785
|
};
|
|
1771
1786
|
}
|
|
1772
|
-
function
|
|
1787
|
+
function yr(e) {
|
|
1773
1788
|
return !(!e || e.startsWith("#") || e.startsWith("javascript:") || e.startsWith("mailto:") || e.startsWith("tel:"));
|
|
1774
1789
|
}
|
|
1775
|
-
function
|
|
1790
|
+
function vr(e) {
|
|
1776
1791
|
const t = e ?? (typeof document < "u" ? document : null);
|
|
1777
1792
|
if (!t) return [];
|
|
1778
1793
|
const r = typeof window < "u" && window.location.origin || "", i = /* @__PURE__ */ new Set(), o = [], l = Array.from(t.querySelectorAll("a[href]"));
|
|
1779
1794
|
for (const c of l) {
|
|
1780
|
-
if (o.length >=
|
|
1781
|
-
if (
|
|
1795
|
+
if (o.length >= mr) break;
|
|
1796
|
+
if (bt(c)) continue;
|
|
1782
1797
|
const d = c.getAttribute("href") || "";
|
|
1783
|
-
if (!
|
|
1784
|
-
let f = d,
|
|
1798
|
+
if (!yr(d)) continue;
|
|
1799
|
+
let f = d, g = !0;
|
|
1785
1800
|
try {
|
|
1786
1801
|
if (typeof window < "u") {
|
|
1787
|
-
const
|
|
1788
|
-
|
|
1802
|
+
const s = new URL(d, r);
|
|
1803
|
+
g = s.origin === r, g && d.startsWith("http") && (f = s.pathname + s.search + s.hash);
|
|
1789
1804
|
}
|
|
1790
1805
|
} catch {
|
|
1791
1806
|
continue;
|
|
1792
1807
|
}
|
|
1793
1808
|
if (i.has(f)) continue;
|
|
1794
1809
|
i.add(f);
|
|
1795
|
-
const
|
|
1796
|
-
o.push({ href: f, text:
|
|
1810
|
+
const b = (c.textContent || "").trim().slice(0, 120);
|
|
1811
|
+
o.push({ href: f, text: b, internal: g });
|
|
1797
1812
|
}
|
|
1798
1813
|
return o;
|
|
1799
1814
|
}
|
|
1800
|
-
let
|
|
1801
|
-
const
|
|
1802
|
-
function
|
|
1815
|
+
let ze = null;
|
|
1816
|
+
const br = 5e3;
|
|
1817
|
+
function mt() {
|
|
1803
1818
|
const e = Date.now(), t = typeof window < "u" && window.location.pathname || "/";
|
|
1804
|
-
if (
|
|
1805
|
-
return
|
|
1806
|
-
const r =
|
|
1807
|
-
return
|
|
1819
|
+
if (ze && ze.pathname === t && e - ze.at < br)
|
|
1820
|
+
return ze.routes;
|
|
1821
|
+
const r = vr();
|
|
1822
|
+
return ze = { at: e, pathname: t, routes: r }, r;
|
|
1808
1823
|
}
|
|
1809
|
-
function
|
|
1810
|
-
|
|
1824
|
+
function wr() {
|
|
1825
|
+
ze = null;
|
|
1811
1826
|
}
|
|
1812
|
-
function
|
|
1827
|
+
function _r(e, t) {
|
|
1813
1828
|
const r = e instanceof HTMLInputElement ? HTMLInputElement.prototype : e instanceof HTMLTextAreaElement ? HTMLTextAreaElement.prototype : HTMLSelectElement.prototype, i = Object.getOwnPropertyDescriptor(r, "value"), o = i == null ? void 0 : i.set;
|
|
1814
1829
|
o ? o.call(e, t) : e.value = t;
|
|
1815
1830
|
}
|
|
1816
|
-
function
|
|
1831
|
+
function xr(e, t, r = {}) {
|
|
1817
1832
|
const i = r.triggerInput ?? !0, o = r.triggerChange ?? !0;
|
|
1818
1833
|
if (e instanceof HTMLInputElement && (e.type === "checkbox" || e.type === "radio")) {
|
|
1819
1834
|
const l = Object.getOwnPropertyDescriptor(
|
|
@@ -1823,9 +1838,9 @@ function br(e, t, r = {}) {
|
|
|
1823
1838
|
c ? c.call(e, d) : e.checked = d, i && e.dispatchEvent(new Event("input", { bubbles: !0 })), o && e.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
1824
1839
|
return;
|
|
1825
1840
|
}
|
|
1826
|
-
|
|
1841
|
+
_r(e, t), i && e.dispatchEvent(new Event("input", { bubbles: !0 })), o && e.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
1827
1842
|
}
|
|
1828
|
-
function
|
|
1843
|
+
function kr() {
|
|
1829
1844
|
if (typeof window > "u" || typeof document > "u")
|
|
1830
1845
|
return !1;
|
|
1831
1846
|
const e = document.scrollingElement || document.documentElement;
|
|
@@ -1833,19 +1848,19 @@ function wr() {
|
|
|
1833
1848
|
const t = window.getComputedStyle(e);
|
|
1834
1849
|
return !(t.overflowY === "hidden" || t.overflowY === "clip");
|
|
1835
1850
|
}
|
|
1836
|
-
function
|
|
1851
|
+
function Lr(e) {
|
|
1837
1852
|
if (!(e instanceof HTMLElement)) return !1;
|
|
1838
1853
|
const r = window.getComputedStyle(e).overflowY;
|
|
1839
1854
|
return !(r !== "auto" && r !== "scroll" || e.scrollHeight <= e.clientHeight + 2);
|
|
1840
1855
|
}
|
|
1841
|
-
function
|
|
1856
|
+
function Sr() {
|
|
1842
1857
|
if (typeof document > "u") return null;
|
|
1843
1858
|
const e = Array.from(
|
|
1844
1859
|
document.querySelectorAll("body, body *")
|
|
1845
1860
|
);
|
|
1846
1861
|
let t = null, r = 0;
|
|
1847
1862
|
for (const i of e) {
|
|
1848
|
-
if (!
|
|
1863
|
+
if (!Lr(i)) continue;
|
|
1849
1864
|
const o = i.getBoundingClientRect();
|
|
1850
1865
|
if (o.bottom <= 0 || o.top >= window.innerHeight || o.right <= 0 || o.left >= window.innerWidth || o.width <= 0 || o.height <= 0 || i.closest(".ll-widget")) continue;
|
|
1851
1866
|
const l = o.width * o.height;
|
|
@@ -1853,24 +1868,24 @@ function xr() {
|
|
|
1853
1868
|
}
|
|
1854
1869
|
return t;
|
|
1855
1870
|
}
|
|
1856
|
-
function
|
|
1871
|
+
function Cr() {
|
|
1857
1872
|
if (typeof window > "u")
|
|
1858
1873
|
return null;
|
|
1859
|
-
if (
|
|
1860
|
-
const e =
|
|
1874
|
+
if (kr()) return window;
|
|
1875
|
+
const e = Sr();
|
|
1861
1876
|
return e || window;
|
|
1862
1877
|
}
|
|
1863
|
-
function
|
|
1878
|
+
function Jt(e) {
|
|
1864
1879
|
return e instanceof Window ? e.innerHeight || 0 : e.clientHeight || 0;
|
|
1865
1880
|
}
|
|
1866
|
-
function
|
|
1881
|
+
function Er(e) {
|
|
1867
1882
|
var t, r;
|
|
1868
1883
|
return e instanceof Window ? typeof document > "u" ? 0 : Math.max(
|
|
1869
1884
|
((t = document.body) == null ? void 0 : t.scrollHeight) ?? 0,
|
|
1870
1885
|
((r = document.documentElement) == null ? void 0 : r.scrollHeight) ?? 0
|
|
1871
1886
|
) : e.scrollHeight - e.clientHeight;
|
|
1872
1887
|
}
|
|
1873
|
-
const
|
|
1888
|
+
const Nr = /* @__PURE__ */ new Set([
|
|
1874
1889
|
"agent_state",
|
|
1875
1890
|
"avatar_stream_ready",
|
|
1876
1891
|
"avatar_active",
|
|
@@ -1893,8 +1908,8 @@ const Sr = /* @__PURE__ */ new Set([
|
|
|
1893
1908
|
"submit_form",
|
|
1894
1909
|
"request_routes"
|
|
1895
1910
|
]);
|
|
1896
|
-
function
|
|
1897
|
-
var
|
|
1911
|
+
function Ar(e) {
|
|
1912
|
+
var Ct, Et, Nt, At, Rt, Mt, It;
|
|
1898
1913
|
const {
|
|
1899
1914
|
agentId: t,
|
|
1900
1915
|
apiKey: r,
|
|
@@ -1904,35 +1919,35 @@ function Cr(e) {
|
|
|
1904
1919
|
autoConnect: c = !1,
|
|
1905
1920
|
displayMode: d,
|
|
1906
1921
|
defaultDisplayMode: f = "expanded",
|
|
1907
|
-
onDisplayModeChange:
|
|
1908
|
-
position:
|
|
1909
|
-
mobileBreakpoint:
|
|
1910
|
-
persistKey:
|
|
1911
|
-
disablePersistence:
|
|
1912
|
-
teamMembers:
|
|
1913
|
-
currentTeamMemberId:
|
|
1922
|
+
onDisplayModeChange: g,
|
|
1923
|
+
position: b = "bottom-right",
|
|
1924
|
+
mobileBreakpoint: s = 640,
|
|
1925
|
+
persistKey: a = "ll-widget",
|
|
1926
|
+
disablePersistence: k = !1,
|
|
1927
|
+
teamMembers: E,
|
|
1928
|
+
currentTeamMemberId: C,
|
|
1914
1929
|
onTeamMemberChange: v,
|
|
1915
|
-
idleLoopUrl:
|
|
1930
|
+
idleLoopUrl: w,
|
|
1916
1931
|
greeting: z,
|
|
1917
|
-
avatarImageUrl:
|
|
1932
|
+
avatarImageUrl: I,
|
|
1918
1933
|
agentName: H,
|
|
1919
1934
|
branding: h = {},
|
|
1920
|
-
allowCamera:
|
|
1935
|
+
allowCamera: R = !0,
|
|
1921
1936
|
allowScreenShare: q = !0,
|
|
1922
1937
|
allowTyping: D = !0,
|
|
1923
|
-
showOn:
|
|
1938
|
+
showOn: M,
|
|
1924
1939
|
hideOn: O,
|
|
1925
1940
|
pathname: W,
|
|
1926
|
-
onNavigate:
|
|
1927
|
-
onScrollToSelector:
|
|
1928
|
-
getPageContext:
|
|
1929
|
-
pageContextExtras:
|
|
1930
|
-
getRoutes:
|
|
1931
|
-
onScrollPage:
|
|
1932
|
-
onClick:
|
|
1933
|
-
capabilities:
|
|
1934
|
-
onConnect:
|
|
1935
|
-
onDisconnect:
|
|
1941
|
+
onNavigate: J,
|
|
1942
|
+
onScrollToSelector: ne,
|
|
1943
|
+
getPageContext: ye,
|
|
1944
|
+
pageContextExtras: Je,
|
|
1945
|
+
getRoutes: Ke,
|
|
1946
|
+
onScrollPage: Xe,
|
|
1947
|
+
onClick: Qe,
|
|
1948
|
+
capabilities: ee,
|
|
1949
|
+
onConnect: ae,
|
|
1950
|
+
onDisconnect: ve,
|
|
1936
1951
|
onTranscript: xe,
|
|
1937
1952
|
onAgentState: ke,
|
|
1938
1953
|
onConnectionStateChange: Le,
|
|
@@ -1940,43 +1955,43 @@ function Cr(e) {
|
|
|
1940
1955
|
onAgentCommand: Ce,
|
|
1941
1956
|
controlledSession: V,
|
|
1942
1957
|
className: st,
|
|
1943
|
-
style:
|
|
1944
|
-
zIndex:
|
|
1945
|
-
} = e, ce =
|
|
1946
|
-
|
|
1947
|
-
|
|
1958
|
+
style: ct,
|
|
1959
|
+
zIndex: Ze = 2147483647
|
|
1960
|
+
} = e, ce = $n(W), Ee = Fn(ce, M, O);
|
|
1961
|
+
A(() => {
|
|
1962
|
+
hr(), wr();
|
|
1948
1963
|
}, [ce]);
|
|
1949
|
-
const
|
|
1964
|
+
const He = C !== void 0, [be, Ne] = S(() => {
|
|
1950
1965
|
var m;
|
|
1951
|
-
return
|
|
1952
|
-
}),
|
|
1953
|
-
() => (
|
|
1954
|
-
[
|
|
1955
|
-
),
|
|
1966
|
+
return C ?? ((m = E == null ? void 0 : E[0]) == null ? void 0 : m.id);
|
|
1967
|
+
}), G = He ? C : be, Q = ot(
|
|
1968
|
+
() => (E == null ? void 0 : E.find((m) => m.id === G)) ?? null,
|
|
1969
|
+
[E, G]
|
|
1970
|
+
), Ae = (Q == null ? void 0 : Q.agentId) ?? t, [re, se] = In({
|
|
1956
1971
|
value: d,
|
|
1957
1972
|
defaultValue: f,
|
|
1958
|
-
onChange:
|
|
1959
|
-
persistKey:
|
|
1960
|
-
disablePersistence:
|
|
1961
|
-
}),
|
|
1962
|
-
|
|
1963
|
-
function
|
|
1964
|
-
const u =
|
|
1973
|
+
onChange: g,
|
|
1974
|
+
persistKey: a,
|
|
1975
|
+
disablePersistence: k
|
|
1976
|
+
}), we = Pn(s), Oe = wn(), te = _n(), ie = kn(), oe = Ln(), de = Sn(), [Re, ue] = S(!1), [fe, Be] = S(!1), [qe, We] = S(!1), [pe, he] = S(!1), [Me, et] = S(!1), Fe = N(J), Ie = N(ne), p = N(Xe), Y = N(Qe), dt = N(ye), wt = N(Je), _t = N(Ke), ut = N(ee), le = N(null);
|
|
1977
|
+
Fe.current = J, Ie.current = ne, p.current = Xe, Y.current = Qe, dt.current = ye, wt.current = Je, _t.current = Ke, ut.current = ee;
|
|
1978
|
+
function me(m) {
|
|
1979
|
+
const u = ut.current;
|
|
1965
1980
|
return u ? u.includes(m) : !0;
|
|
1966
1981
|
}
|
|
1967
|
-
function
|
|
1982
|
+
function ge(m, u) {
|
|
1968
1983
|
console.warn(
|
|
1969
1984
|
`[LiveLayer] Agent command "${m}" blocked — capability "${u}" not in allowlist. See https://livelayer.studio/docs/react/capabilities`
|
|
1970
1985
|
);
|
|
1971
1986
|
}
|
|
1972
|
-
const
|
|
1987
|
+
const Ue = L(
|
|
1973
1988
|
(m) => {
|
|
1974
|
-
var K,
|
|
1989
|
+
var K, Te, nt, Tt;
|
|
1975
1990
|
const u = m;
|
|
1976
1991
|
if (!(!u.type || typeof u.type != "string")) {
|
|
1977
1992
|
if (Se == null || Se({ eventName: u.type, data: m }), u.type === "navigate") {
|
|
1978
|
-
if (!
|
|
1979
|
-
|
|
1993
|
+
if (!me("navigate")) {
|
|
1994
|
+
ge("navigate", "navigate");
|
|
1980
1995
|
return;
|
|
1981
1996
|
}
|
|
1982
1997
|
const x = typeof u.href == "string" ? u.href : null;
|
|
@@ -1986,9 +2001,9 @@ function Cr(e) {
|
|
|
1986
2001
|
);
|
|
1987
2002
|
return;
|
|
1988
2003
|
}
|
|
1989
|
-
if (
|
|
2004
|
+
if (Fe.current) {
|
|
1990
2005
|
try {
|
|
1991
|
-
|
|
2006
|
+
Fe.current(x);
|
|
1992
2007
|
} catch (T) {
|
|
1993
2008
|
console.warn(
|
|
1994
2009
|
`[LiveLayer] onNavigate threw for "${x}". Falling back. Error:`,
|
|
@@ -2018,16 +2033,16 @@ function Cr(e) {
|
|
|
2018
2033
|
return;
|
|
2019
2034
|
}
|
|
2020
2035
|
if (u.type === "scroll_to") {
|
|
2021
|
-
if (!
|
|
2022
|
-
|
|
2036
|
+
if (!me("scroll")) {
|
|
2037
|
+
ge("scroll_to", "scroll");
|
|
2023
2038
|
return;
|
|
2024
2039
|
}
|
|
2025
2040
|
const x = typeof u.selector == "string" ? u.selector : null;
|
|
2026
2041
|
if (!x) return;
|
|
2027
2042
|
const T = u.behavior === "instant" ? "instant" : "smooth";
|
|
2028
|
-
if (
|
|
2043
|
+
if (Ie.current) {
|
|
2029
2044
|
try {
|
|
2030
|
-
|
|
2045
|
+
Ie.current(
|
|
2031
2046
|
x,
|
|
2032
2047
|
T
|
|
2033
2048
|
);
|
|
@@ -2060,20 +2075,20 @@ function Cr(e) {
|
|
|
2060
2075
|
return;
|
|
2061
2076
|
}
|
|
2062
2077
|
if (u.type === "request_page_context") {
|
|
2063
|
-
if (!
|
|
2064
|
-
|
|
2078
|
+
if (!me("read_page")) {
|
|
2079
|
+
ge("request_page_context", "read_page");
|
|
2065
2080
|
return;
|
|
2066
2081
|
}
|
|
2067
|
-
const x = typeof u.requestId == "string" ? u.requestId : void 0, T = (K =
|
|
2082
|
+
const x = typeof u.requestId == "string" ? u.requestId : void 0, T = (K = le.current) == null ? void 0 : K.call(le), B = (j) => {
|
|
2068
2083
|
const P = T, X = P == null ? void 0 : P.localParticipant;
|
|
2069
2084
|
if (X != null && X.publishData)
|
|
2070
2085
|
try {
|
|
2071
|
-
const
|
|
2072
|
-
X.publishData(
|
|
2073
|
-
} catch (
|
|
2074
|
-
console.warn("[LiveLayer] publishData failed.",
|
|
2086
|
+
const Z = x ? { ...j, requestId: x } : j, Pe = new TextEncoder().encode(JSON.stringify(Z));
|
|
2087
|
+
X.publishData(Pe, { reliable: !0 });
|
|
2088
|
+
} catch (Z) {
|
|
2089
|
+
console.warn("[LiveLayer] publishData failed.", Z);
|
|
2075
2090
|
}
|
|
2076
|
-
}, $ =
|
|
2091
|
+
}, $ = wt.current, F = dt.current;
|
|
2077
2092
|
try {
|
|
2078
2093
|
if (F) {
|
|
2079
2094
|
const j = F($);
|
|
@@ -2084,7 +2099,7 @@ function Cr(e) {
|
|
|
2084
2099
|
P
|
|
2085
2100
|
), B({
|
|
2086
2101
|
type: "page_context",
|
|
2087
|
-
context:
|
|
2102
|
+
context: Gt($)
|
|
2088
2103
|
});
|
|
2089
2104
|
});
|
|
2090
2105
|
return;
|
|
@@ -2094,7 +2109,7 @@ function Cr(e) {
|
|
|
2094
2109
|
}
|
|
2095
2110
|
B({
|
|
2096
2111
|
type: "page_context",
|
|
2097
|
-
context:
|
|
2112
|
+
context: Gt($)
|
|
2098
2113
|
});
|
|
2099
2114
|
} catch (j) {
|
|
2100
2115
|
console.warn(
|
|
@@ -2108,8 +2123,8 @@ function Cr(e) {
|
|
|
2108
2123
|
return;
|
|
2109
2124
|
}
|
|
2110
2125
|
if (u.type === "scroll_page") {
|
|
2111
|
-
if (!
|
|
2112
|
-
|
|
2126
|
+
if (!me("scroll")) {
|
|
2127
|
+
ge("scroll_page", "scroll");
|
|
2113
2128
|
return;
|
|
2114
2129
|
}
|
|
2115
2130
|
const x = u.direction;
|
|
@@ -2120,9 +2135,9 @@ function Cr(e) {
|
|
|
2120
2135
|
return;
|
|
2121
2136
|
}
|
|
2122
2137
|
const T = u.behavior === "instant" ? "instant" : "smooth";
|
|
2123
|
-
if (
|
|
2138
|
+
if (p.current) {
|
|
2124
2139
|
try {
|
|
2125
|
-
|
|
2140
|
+
p.current(
|
|
2126
2141
|
x,
|
|
2127
2142
|
T
|
|
2128
2143
|
);
|
|
@@ -2132,17 +2147,17 @@ function Cr(e) {
|
|
|
2132
2147
|
return;
|
|
2133
2148
|
}
|
|
2134
2149
|
if (typeof window > "u") return;
|
|
2135
|
-
const B = { behavior: T }, $ =
|
|
2150
|
+
const B = { behavior: T }, $ = Cr(), F = (P) => {
|
|
2136
2151
|
$ instanceof Window ? $.scrollBy({ top: P, ...B }) : $.scrollBy({ top: P, ...B });
|
|
2137
2152
|
}, j = (P) => {
|
|
2138
2153
|
$ instanceof Window ? $.scrollTo({ top: P, ...B }) : $.scrollTo({ top: P, ...B });
|
|
2139
2154
|
};
|
|
2140
|
-
x === "up" ? F(-
|
|
2155
|
+
x === "up" ? F(-Jt($)) : x === "down" ? F(Jt($)) : j(x === "top" ? 0 : Er($));
|
|
2141
2156
|
return;
|
|
2142
2157
|
}
|
|
2143
2158
|
if (u.type === "click") {
|
|
2144
|
-
if (!
|
|
2145
|
-
|
|
2159
|
+
if (!me("click")) {
|
|
2160
|
+
ge("click", "click");
|
|
2146
2161
|
return;
|
|
2147
2162
|
}
|
|
2148
2163
|
const x = typeof u.selector == "string" ? u.selector : null;
|
|
@@ -2150,9 +2165,9 @@ function Cr(e) {
|
|
|
2150
2165
|
console.warn("[LiveLayer] click: missing selector.");
|
|
2151
2166
|
return;
|
|
2152
2167
|
}
|
|
2153
|
-
if (
|
|
2168
|
+
if (Y.current) {
|
|
2154
2169
|
try {
|
|
2155
|
-
|
|
2170
|
+
Y.current(x);
|
|
2156
2171
|
} catch (B) {
|
|
2157
2172
|
console.warn("[LiveLayer] onClick threw.", B);
|
|
2158
2173
|
}
|
|
@@ -2180,12 +2195,12 @@ function Cr(e) {
|
|
|
2180
2195
|
);
|
|
2181
2196
|
return;
|
|
2182
2197
|
}
|
|
2183
|
-
(
|
|
2198
|
+
(Te = T.click) == null || Te.call(T);
|
|
2184
2199
|
return;
|
|
2185
2200
|
}
|
|
2186
2201
|
if (u.type === "fill_form" || u.type === "focus_field") {
|
|
2187
|
-
if (!
|
|
2188
|
-
|
|
2202
|
+
if (!me("fill_forms")) {
|
|
2203
|
+
ge(u.type, "fill_forms");
|
|
2189
2204
|
return;
|
|
2190
2205
|
}
|
|
2191
2206
|
if (typeof document > "u") return;
|
|
@@ -2252,7 +2267,7 @@ function Cr(e) {
|
|
|
2252
2267
|
continue;
|
|
2253
2268
|
}
|
|
2254
2269
|
try {
|
|
2255
|
-
|
|
2270
|
+
xr(j, F);
|
|
2256
2271
|
} catch (P) {
|
|
2257
2272
|
console.warn(
|
|
2258
2273
|
`[LiveLayer] fill_form: failed to set "${$}".`,
|
|
@@ -2263,8 +2278,8 @@ function Cr(e) {
|
|
|
2263
2278
|
return;
|
|
2264
2279
|
}
|
|
2265
2280
|
if (u.type === "submit_form") {
|
|
2266
|
-
if (!
|
|
2267
|
-
|
|
2281
|
+
if (!me("submit_forms")) {
|
|
2282
|
+
ge("submit_form", "submit_forms");
|
|
2268
2283
|
return;
|
|
2269
2284
|
}
|
|
2270
2285
|
if (typeof document > "u") return;
|
|
@@ -2288,12 +2303,12 @@ function Cr(e) {
|
|
|
2288
2303
|
);
|
|
2289
2304
|
return;
|
|
2290
2305
|
}
|
|
2291
|
-
const B = typeof u.requestId == "string" ? u.requestId : void 0, $ = (nt =
|
|
2292
|
-
const
|
|
2293
|
-
if (
|
|
2306
|
+
const B = typeof u.requestId == "string" ? u.requestId : void 0, $ = (nt = le.current) == null ? void 0 : nt.call(le), F = (X) => {
|
|
2307
|
+
const Z = $, Pe = Z == null ? void 0 : Z.localParticipant;
|
|
2308
|
+
if (Pe != null && Pe.publishData)
|
|
2294
2309
|
try {
|
|
2295
|
-
const
|
|
2296
|
-
|
|
2310
|
+
const un = B ? { ...X, requestId: B } : X, fn = new TextEncoder().encode(JSON.stringify(un));
|
|
2311
|
+
Pe.publishData(fn, { reliable: !0 });
|
|
2297
2312
|
} catch {
|
|
2298
2313
|
}
|
|
2299
2314
|
};
|
|
@@ -2322,96 +2337,96 @@ function Cr(e) {
|
|
|
2322
2337
|
return;
|
|
2323
2338
|
}
|
|
2324
2339
|
if (u.type === "request_routes") {
|
|
2325
|
-
if (!
|
|
2326
|
-
|
|
2340
|
+
if (!me("read_page")) {
|
|
2341
|
+
ge("request_routes", "read_page");
|
|
2327
2342
|
return;
|
|
2328
2343
|
}
|
|
2329
|
-
const x = typeof u.requestId == "string" ? u.requestId : void 0, B = (
|
|
2344
|
+
const x = typeof u.requestId == "string" ? u.requestId : void 0, B = (Tt = le.current) == null ? void 0 : Tt.call(le), $ = B == null ? void 0 : B.localParticipant;
|
|
2330
2345
|
if (!($ != null && $.publishData)) return;
|
|
2331
2346
|
const F = (P) => {
|
|
2332
2347
|
try {
|
|
2333
|
-
const X = x ? { type: "routes", routes: P, requestId: x } : { type: "routes", routes: P },
|
|
2334
|
-
$.publishData(
|
|
2348
|
+
const X = x ? { type: "routes", routes: P, requestId: x } : { type: "routes", routes: P }, Z = new TextEncoder().encode(JSON.stringify(X));
|
|
2349
|
+
$.publishData(Z, { reliable: !0 });
|
|
2335
2350
|
} catch (X) {
|
|
2336
2351
|
console.warn("[LiveLayer] request_routes: publishData failed.", X);
|
|
2337
2352
|
}
|
|
2338
|
-
}, j =
|
|
2353
|
+
}, j = _t.current;
|
|
2339
2354
|
if (j) {
|
|
2340
2355
|
try {
|
|
2341
|
-
const P = j(), X = (
|
|
2342
|
-
if (!Array.isArray(
|
|
2356
|
+
const P = j(), X = (Z) => {
|
|
2357
|
+
if (!Array.isArray(Z)) {
|
|
2343
2358
|
F([]);
|
|
2344
2359
|
return;
|
|
2345
2360
|
}
|
|
2346
|
-
F(
|
|
2361
|
+
F(Z.map(gr).slice(0, 200));
|
|
2347
2362
|
};
|
|
2348
|
-
P instanceof Promise ? P.then(X).catch((
|
|
2363
|
+
P instanceof Promise ? P.then(X).catch((Z) => {
|
|
2349
2364
|
console.warn(
|
|
2350
2365
|
"[LiveLayer] getRoutes rejected; falling back to DOM walker.",
|
|
2351
|
-
|
|
2352
|
-
), F(
|
|
2366
|
+
Z
|
|
2367
|
+
), F(mt());
|
|
2353
2368
|
}) : X(P);
|
|
2354
2369
|
} catch (P) {
|
|
2355
2370
|
console.warn(
|
|
2356
2371
|
"[LiveLayer] getRoutes threw; falling back to DOM walker.",
|
|
2357
2372
|
P
|
|
2358
|
-
), F(
|
|
2373
|
+
), F(mt());
|
|
2359
2374
|
}
|
|
2360
2375
|
return;
|
|
2361
2376
|
}
|
|
2362
2377
|
try {
|
|
2363
|
-
F(
|
|
2378
|
+
F(mt());
|
|
2364
2379
|
} catch (P) {
|
|
2365
2380
|
console.warn("[LiveLayer] request_routes: extractRoutes threw.", P);
|
|
2366
2381
|
}
|
|
2367
2382
|
return;
|
|
2368
2383
|
}
|
|
2369
|
-
|
|
2384
|
+
Nr.has(u.type) || Ce == null || Ce(u);
|
|
2370
2385
|
}
|
|
2371
2386
|
},
|
|
2372
2387
|
[Ce, Se]
|
|
2373
|
-
), U =
|
|
2374
|
-
agentId: V ? "__controlled__" :
|
|
2388
|
+
), U = bn({
|
|
2389
|
+
agentId: V ? "__controlled__" : Ae,
|
|
2375
2390
|
baseUrl: i,
|
|
2376
2391
|
apiKey: r,
|
|
2377
2392
|
sessionEndpoint: o,
|
|
2378
2393
|
sessionBody: l,
|
|
2379
|
-
onDataMessage: V ? void 0 :
|
|
2394
|
+
onDataMessage: V ? void 0 : Ue
|
|
2380
2395
|
});
|
|
2381
|
-
|
|
2396
|
+
A(() => {
|
|
2382
2397
|
if (V != null && V.subscribeToDataMessages)
|
|
2383
|
-
return V.subscribeToDataMessages(
|
|
2384
|
-
}, [V,
|
|
2398
|
+
return V.subscribeToDataMessages(Ue);
|
|
2399
|
+
}, [V, Ue]), le.current = () => {
|
|
2385
2400
|
var m;
|
|
2386
2401
|
return (m = U.getRoom) == null ? void 0 : m.call(U);
|
|
2387
|
-
},
|
|
2402
|
+
}, A(() => {
|
|
2388
2403
|
var K;
|
|
2389
2404
|
if (!ce) return;
|
|
2390
2405
|
const m = (K = U.getRoom) == null ? void 0 : K.call(U), u = m == null ? void 0 : m.localParticipant;
|
|
2391
2406
|
if (u != null && u.publishData)
|
|
2392
2407
|
try {
|
|
2393
|
-
const
|
|
2408
|
+
const Te = new TextEncoder().encode(
|
|
2394
2409
|
JSON.stringify({ type: "pathname", pathname: ce })
|
|
2395
2410
|
);
|
|
2396
|
-
u.publishData(
|
|
2411
|
+
u.publishData(Te, { reliable: !0 });
|
|
2397
2412
|
} catch {
|
|
2398
2413
|
}
|
|
2399
|
-
}, [ce, U, U.connectionState]),
|
|
2414
|
+
}, [ce, U, U.connectionState]), A(() => {
|
|
2400
2415
|
var K;
|
|
2401
2416
|
if (typeof window > "u") return;
|
|
2402
2417
|
const m = ((K = window.location) == null ? void 0 : K.hostname) || "";
|
|
2403
2418
|
if (m === "localhost" || m === "127.0.0.1" || m === "0.0.0.0" || m.endsWith(".local") || m.endsWith(".test"))
|
|
2404
|
-
return window.__livelayerSimulateCommand = (
|
|
2419
|
+
return window.__livelayerSimulateCommand = (Te) => {
|
|
2405
2420
|
try {
|
|
2406
|
-
|
|
2421
|
+
Ue(Te);
|
|
2407
2422
|
} catch (nt) {
|
|
2408
2423
|
console.warn("[LiveLayer] simulate-command threw:", nt);
|
|
2409
2424
|
}
|
|
2410
2425
|
}, () => {
|
|
2411
2426
|
delete window.__livelayerSimulateCommand;
|
|
2412
2427
|
};
|
|
2413
|
-
}, [
|
|
2414
|
-
const
|
|
2428
|
+
}, [Ue]);
|
|
2429
|
+
const y = ot(() => V ? {
|
|
2415
2430
|
connectionState: V.connectionState,
|
|
2416
2431
|
agentState: V.agentState,
|
|
2417
2432
|
transcript: V.transcript,
|
|
@@ -2442,37 +2457,45 @@ function Cr(e) {
|
|
|
2442
2457
|
disconnect: U.disconnect,
|
|
2443
2458
|
getRoom: U.getRoom,
|
|
2444
2459
|
isControlled: !1
|
|
2445
|
-
}, [V, U]),
|
|
2446
|
-
|
|
2447
|
-
const m =
|
|
2460
|
+
}, [V, U]), xt = N(null);
|
|
2461
|
+
A(() => {
|
|
2462
|
+
const m = y.videoElement, u = xt.current;
|
|
2448
2463
|
if (!(!m || !u))
|
|
2449
2464
|
return u.appendChild(m), () => {
|
|
2450
2465
|
m.parentNode === u && u.removeChild(m);
|
|
2451
2466
|
};
|
|
2452
|
-
}, [
|
|
2453
|
-
const m =
|
|
2467
|
+
}, [y.videoElement]), A(() => {
|
|
2468
|
+
const m = y.audioElement;
|
|
2454
2469
|
if (!m) return;
|
|
2455
|
-
|
|
2470
|
+
Oe.attach(m);
|
|
2456
2471
|
const u = m.play();
|
|
2457
2472
|
return u && typeof u.catch == "function" && u.catch((K) => {
|
|
2458
2473
|
(K == null ? void 0 : K.name) === "NotAllowedError" && ue(!0);
|
|
2459
2474
|
}), () => {
|
|
2460
|
-
|
|
2475
|
+
Oe.detach();
|
|
2461
2476
|
};
|
|
2462
|
-
}, [
|
|
2463
|
-
if (
|
|
2464
|
-
const m =
|
|
2477
|
+
}, [y.audioElement]), A(() => {
|
|
2478
|
+
if (y.isControlled || y.connectionState !== "connected") return;
|
|
2479
|
+
const m = y.getRoom();
|
|
2465
2480
|
if (m)
|
|
2466
|
-
return
|
|
2467
|
-
}),
|
|
2468
|
-
|
|
2481
|
+
return te.setupMic(m, { startMuted: !0 }).catch(() => {
|
|
2482
|
+
}), ie.attachRoom(m), oe.attachRoom(m), de.refresh(), () => {
|
|
2483
|
+
te.teardownMic(), ie.teardown(), oe.teardown();
|
|
2469
2484
|
};
|
|
2470
|
-
}, [
|
|
2471
|
-
|
|
2485
|
+
}, [y.isControlled, y.connectionState]);
|
|
2486
|
+
const [ft, kt] = S(!1), pt = N("idle");
|
|
2487
|
+
A(() => {
|
|
2488
|
+
if (y.connectionState === "idle" || y.connectionState === "disconnected") {
|
|
2489
|
+
kt(!1), pt.current = "idle";
|
|
2490
|
+
return;
|
|
2491
|
+
}
|
|
2492
|
+
!ft && pt.current === "speaking" && y.agentState !== "speaking" && (kt(!0), te.setMuted(!1)), pt.current = y.agentState;
|
|
2493
|
+
}, [y.agentState, y.connectionState, ft]), A(() => {
|
|
2494
|
+
const m = y.audioElement;
|
|
2472
2495
|
m && (m.muted = Me);
|
|
2473
|
-
}, [
|
|
2474
|
-
const
|
|
2475
|
-
const u =
|
|
2496
|
+
}, [y.audioElement, Me]);
|
|
2497
|
+
const Zt = L((m) => {
|
|
2498
|
+
const u = y.getRoom();
|
|
2476
2499
|
if (u)
|
|
2477
2500
|
try {
|
|
2478
2501
|
const K = new TextEncoder().encode(
|
|
@@ -2481,163 +2504,164 @@ function Cr(e) {
|
|
|
2481
2504
|
u.localParticipant.publishData(K, { reliable: !0 });
|
|
2482
2505
|
} catch {
|
|
2483
2506
|
}
|
|
2484
|
-
}, [
|
|
2485
|
-
|
|
2507
|
+
}, [y]), en = L(() => {
|
|
2508
|
+
et((m) => !m);
|
|
2486
2509
|
}, []);
|
|
2487
|
-
|
|
2488
|
-
Le == null || Le(
|
|
2489
|
-
}, [
|
|
2490
|
-
xe == null || xe(
|
|
2491
|
-
}, [
|
|
2492
|
-
ke == null || ke(
|
|
2493
|
-
}, [
|
|
2494
|
-
const
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
}, [c,
|
|
2498
|
-
const
|
|
2510
|
+
A(() => {
|
|
2511
|
+
Le == null || Le(y.connectionState), y.connectionState === "connected" ? ae == null || ae() : y.connectionState === "disconnected" && (ve == null || ve());
|
|
2512
|
+
}, [y.connectionState, ae, ve, Le]), A(() => {
|
|
2513
|
+
xe == null || xe(y.transcript);
|
|
2514
|
+
}, [y.transcript, xe]), A(() => {
|
|
2515
|
+
ke == null || ke(y.agentState);
|
|
2516
|
+
}, [y.agentState, ke]);
|
|
2517
|
+
const Lt = N(!1);
|
|
2518
|
+
A(() => {
|
|
2519
|
+
y.isControlled || !c || Lt.current || Ee && y.connectionState === "idle" && (Lt.current = !0, y.connect());
|
|
2520
|
+
}, [c, y.connectionState, y, Ee]);
|
|
2521
|
+
const tn = L(
|
|
2499
2522
|
(m) => {
|
|
2500
|
-
const u =
|
|
2501
|
-
u && (
|
|
2523
|
+
const u = E == null ? void 0 : E.find((K) => K.id === m);
|
|
2524
|
+
u && (We(!1), m !== G && (Be(!0), y.disconnect(), He || Ne(m), v == null || v(u)));
|
|
2502
2525
|
},
|
|
2503
2526
|
[
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2527
|
+
E,
|
|
2528
|
+
G,
|
|
2529
|
+
y,
|
|
2530
|
+
He,
|
|
2508
2531
|
v
|
|
2509
2532
|
]
|
|
2510
2533
|
);
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
}, [
|
|
2514
|
-
if (!
|
|
2534
|
+
A(() => {
|
|
2535
|
+
fe && y.connectionState === "connected" && Be(!1);
|
|
2536
|
+
}, [y.connectionState, fe]), A(() => {
|
|
2537
|
+
if (!qe) return;
|
|
2515
2538
|
const m = (u) => {
|
|
2516
|
-
u.key === "Escape" &&
|
|
2539
|
+
u.key === "Escape" && We(!1);
|
|
2517
2540
|
};
|
|
2518
2541
|
return window.addEventListener("keydown", m), () => window.removeEventListener("keydown", m);
|
|
2519
|
-
}, [
|
|
2520
|
-
const
|
|
2521
|
-
|
|
2522
|
-
const tt = (
|
|
2523
|
-
() =>
|
|
2524
|
-
[
|
|
2525
|
-
),
|
|
2526
|
-
|
|
2527
|
-
}, [
|
|
2528
|
-
const m =
|
|
2542
|
+
}, [qe]);
|
|
2543
|
+
const nn = !!I || !!(Q != null && Q.avatarImageUrl) || y.isControlled, je = Cn(Ae, i, nn);
|
|
2544
|
+
ee === void 0 && ((Ct = je.info) != null && Ct.capabilities) && (ut.current = je.info.capabilities);
|
|
2545
|
+
const tt = (Q == null ? void 0 : Q.name) ?? H ?? ((Et = y.agentConfig) == null ? void 0 : Et.name) ?? ((Nt = je.info) == null ? void 0 : Nt.name) ?? "Live Layer", ht = (Q == null ? void 0 : Q.avatarImageUrl) ?? I ?? ((At = y.agentConfig) == null ? void 0 : At.avatarImageUrl) ?? ((Rt = je.info) == null ? void 0 : Rt.avatarImageUrl) ?? null, rn = w ?? ((Mt = y.agentConfig) == null ? void 0 : Mt.idleLoopUrl) ?? ((It = je.info) == null ? void 0 : It.idleLoopUrl) ?? null, on = z ?? null, ln = L(() => se("expanded"), [se]), an = L(
|
|
2546
|
+
() => se("minimized"),
|
|
2547
|
+
[se]
|
|
2548
|
+
), St = L(() => {
|
|
2549
|
+
y.disconnect(), se("hidden");
|
|
2550
|
+
}, [y, se]), sn = L(() => {
|
|
2551
|
+
const m = y.audioElement;
|
|
2529
2552
|
m && m.play().then(() => ue(!1)).catch(() => {
|
|
2530
2553
|
});
|
|
2531
|
-
}, [
|
|
2532
|
-
ue(!1),
|
|
2533
|
-
}, [
|
|
2534
|
-
...
|
|
2535
|
-
zIndex:
|
|
2554
|
+
}, [y.audioElement]), cn = L(() => {
|
|
2555
|
+
ue(!1), y.connect();
|
|
2556
|
+
}, [y]), Ve = {
|
|
2557
|
+
...ct,
|
|
2558
|
+
zIndex: Ze
|
|
2536
2559
|
};
|
|
2537
|
-
h.primaryColor && (
|
|
2538
|
-
const
|
|
2560
|
+
h.primaryColor && (Ve["--ll-color-primary"] = h.primaryColor), h.accentColor && (Ve["--ll-color-accent"] = h.accentColor), h.backgroundColor && (Ve["--ll-color-bg"] = h.backgroundColor), h.textColor && (Ve["--ll-color-fg"] = h.textColor);
|
|
2561
|
+
const dn = [
|
|
2539
2562
|
"ll-widget",
|
|
2540
|
-
`ll-widget--${
|
|
2541
|
-
`ll-widget--${
|
|
2563
|
+
`ll-widget--${re}`,
|
|
2564
|
+
`ll-widget--${we ? "mobile" : "desktop"}`,
|
|
2542
2565
|
st
|
|
2543
2566
|
].filter(Boolean).join(" ");
|
|
2544
|
-
return
|
|
2567
|
+
return Ee ? /* @__PURE__ */ _(
|
|
2545
2568
|
"div",
|
|
2546
2569
|
{
|
|
2547
|
-
className:
|
|
2548
|
-
style:
|
|
2549
|
-
"data-display-mode":
|
|
2550
|
-
"data-position":
|
|
2570
|
+
className: dn,
|
|
2571
|
+
style: Ve,
|
|
2572
|
+
"data-display-mode": re,
|
|
2573
|
+
"data-position": b,
|
|
2551
2574
|
children: [
|
|
2552
|
-
|
|
2553
|
-
|
|
2575
|
+
re === "hidden" && /* @__PURE__ */ n(
|
|
2576
|
+
Jn,
|
|
2554
2577
|
{
|
|
2555
|
-
position:
|
|
2556
|
-
isMobile:
|
|
2557
|
-
isSpeaking:
|
|
2558
|
-
onExpand: () =>
|
|
2578
|
+
position: b,
|
|
2579
|
+
isMobile: we,
|
|
2580
|
+
isSpeaking: y.agentState === "speaking",
|
|
2581
|
+
onExpand: () => se("expanded"),
|
|
2559
2582
|
label: `Open ${tt} widget`,
|
|
2560
|
-
avatarImageUrl:
|
|
2583
|
+
avatarImageUrl: ht,
|
|
2561
2584
|
agentName: tt
|
|
2562
2585
|
}
|
|
2563
2586
|
),
|
|
2564
|
-
|
|
2565
|
-
|
|
2587
|
+
re === "minimized" && /* @__PURE__ */ n(
|
|
2588
|
+
Xn,
|
|
2566
2589
|
{
|
|
2567
|
-
position:
|
|
2568
|
-
isMobile:
|
|
2590
|
+
position: b,
|
|
2591
|
+
isMobile: we,
|
|
2569
2592
|
agentName: tt,
|
|
2570
|
-
avatarImageUrl:
|
|
2571
|
-
agentState:
|
|
2572
|
-
isMuted:
|
|
2573
|
-
audioLevel:
|
|
2574
|
-
onExpand:
|
|
2575
|
-
onToggleMute:
|
|
2576
|
-
onClose:
|
|
2593
|
+
avatarImageUrl: ht,
|
|
2594
|
+
agentState: y.agentState,
|
|
2595
|
+
isMuted: te.isMuted,
|
|
2596
|
+
audioLevel: Oe,
|
|
2597
|
+
onExpand: ln,
|
|
2598
|
+
onToggleMute: te.toggleMute,
|
|
2599
|
+
onClose: St
|
|
2577
2600
|
}
|
|
2578
2601
|
),
|
|
2579
|
-
|
|
2580
|
-
|
|
2602
|
+
re === "expanded" && /* @__PURE__ */ n(
|
|
2603
|
+
Zn,
|
|
2581
2604
|
{
|
|
2582
|
-
position:
|
|
2583
|
-
isMobile:
|
|
2605
|
+
position: b,
|
|
2606
|
+
isMobile: we,
|
|
2584
2607
|
agentName: tt,
|
|
2585
|
-
avatarImageUrl:
|
|
2586
|
-
idleLoopUrl:
|
|
2587
|
-
greeting:
|
|
2608
|
+
avatarImageUrl: ht,
|
|
2609
|
+
idleLoopUrl: rn,
|
|
2610
|
+
greeting: on,
|
|
2588
2611
|
branding: h,
|
|
2589
|
-
teamMembers:
|
|
2590
|
-
currentTeamMemberId:
|
|
2591
|
-
isSwitchingTeamMember:
|
|
2592
|
-
teamSwitcherOpen:
|
|
2593
|
-
onToggleTeamSwitcher: () =>
|
|
2594
|
-
onSelectTeamMember:
|
|
2595
|
-
connectionState:
|
|
2596
|
-
agentState:
|
|
2597
|
-
transcript:
|
|
2598
|
-
isMuted:
|
|
2612
|
+
teamMembers: E,
|
|
2613
|
+
currentTeamMemberId: G,
|
|
2614
|
+
isSwitchingTeamMember: fe,
|
|
2615
|
+
teamSwitcherOpen: qe,
|
|
2616
|
+
onToggleTeamSwitcher: () => We((m) => !m),
|
|
2617
|
+
onSelectTeamMember: tn,
|
|
2618
|
+
connectionState: y.connectionState,
|
|
2619
|
+
agentState: y.agentState,
|
|
2620
|
+
transcript: y.transcript,
|
|
2621
|
+
isMuted: te.isMuted,
|
|
2599
2622
|
micDevices: de.mics,
|
|
2600
|
-
isCameraEnabled:
|
|
2601
|
-
cameraPreviewEl:
|
|
2623
|
+
isCameraEnabled: ie.isEnabled,
|
|
2624
|
+
cameraPreviewEl: ie.previewEl,
|
|
2602
2625
|
cameraDevices: de.cameras,
|
|
2603
|
-
activeCameraId:
|
|
2626
|
+
activeCameraId: ie.activeDeviceId,
|
|
2604
2627
|
isScreenShareEnabled: oe.isEnabled,
|
|
2605
2628
|
screenPreviewEl: oe.previewEl,
|
|
2606
2629
|
isSpeakerMuted: Me,
|
|
2607
|
-
allowCamera:
|
|
2630
|
+
allowCamera: R,
|
|
2608
2631
|
allowScreenShare: q,
|
|
2609
2632
|
allowTyping: D,
|
|
2610
|
-
languageMenuOpen:
|
|
2611
|
-
onToggleLanguageMenu: () =>
|
|
2633
|
+
languageMenuOpen: pe,
|
|
2634
|
+
onToggleLanguageMenu: () => he((m) => !m),
|
|
2612
2635
|
needsUserGesture: Re,
|
|
2613
|
-
canResume:
|
|
2614
|
-
micError:
|
|
2615
|
-
error:
|
|
2616
|
-
avatarVideoContainerRef:
|
|
2617
|
-
agentVideoEl:
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2636
|
+
canResume: y.canResume,
|
|
2637
|
+
micError: te.micError,
|
|
2638
|
+
error: y.error,
|
|
2639
|
+
avatarVideoContainerRef: xt,
|
|
2640
|
+
agentVideoEl: y.videoElement,
|
|
2641
|
+
micGateOpen: y.isControlled ? !0 : ft,
|
|
2642
|
+
onConnect: () => void y.connect(),
|
|
2643
|
+
onDisconnect: () => y.disconnect(),
|
|
2644
|
+
onRetry: cn,
|
|
2645
|
+
onResumeAudio: sn,
|
|
2646
|
+
onToggleMute: te.toggleMute,
|
|
2647
|
+
onToggleCamera: () => void ie.toggle(),
|
|
2648
|
+
onSwitchCameraDevice: (m) => void ie.switchDevice(m),
|
|
2625
2649
|
onToggleScreenShare: () => void oe.toggle(),
|
|
2626
|
-
onToggleSpeaker:
|
|
2627
|
-
onSendMessage:
|
|
2628
|
-
onMinimize:
|
|
2629
|
-
onClose:
|
|
2630
|
-
onClearMicError:
|
|
2650
|
+
onToggleSpeaker: en,
|
|
2651
|
+
onSendMessage: Zt,
|
|
2652
|
+
onMinimize: an,
|
|
2653
|
+
onClose: St,
|
|
2654
|
+
onClearMicError: te.clearError
|
|
2631
2655
|
}
|
|
2632
2656
|
)
|
|
2633
2657
|
]
|
|
2634
2658
|
}
|
|
2635
2659
|
) : null;
|
|
2636
2660
|
}
|
|
2637
|
-
function
|
|
2638
|
-
return /* @__PURE__ */ n(
|
|
2661
|
+
function zr(e) {
|
|
2662
|
+
return /* @__PURE__ */ n(vn, { children: /* @__PURE__ */ n(Ar, { ...e }) });
|
|
2639
2663
|
}
|
|
2640
|
-
const
|
|
2664
|
+
const Hr = ({
|
|
2641
2665
|
agentId: e,
|
|
2642
2666
|
baseUrl: t,
|
|
2643
2667
|
apiKey: r,
|
|
@@ -2646,26 +2670,26 @@ const Dr = ({
|
|
|
2646
2670
|
className: l,
|
|
2647
2671
|
style: c
|
|
2648
2672
|
}) => {
|
|
2649
|
-
const d =
|
|
2650
|
-
|
|
2651
|
-
const
|
|
2652
|
-
var
|
|
2653
|
-
const
|
|
2654
|
-
(
|
|
2673
|
+
const d = N(null), f = N(null), g = N(o);
|
|
2674
|
+
g.current = o;
|
|
2675
|
+
const b = L((s) => {
|
|
2676
|
+
var k;
|
|
2677
|
+
const a = s.detail;
|
|
2678
|
+
(k = g.current) == null || k.call(g, a);
|
|
2655
2679
|
}, []);
|
|
2656
|
-
return
|
|
2657
|
-
const
|
|
2658
|
-
if (!
|
|
2659
|
-
const
|
|
2660
|
-
return
|
|
2661
|
-
|
|
2680
|
+
return A(() => {
|
|
2681
|
+
const s = d.current;
|
|
2682
|
+
if (!s) return;
|
|
2683
|
+
const a = document.createElement("livelayer-widget");
|
|
2684
|
+
return a.setAttribute("agent-id", e), t && a.setAttribute("base-url", t), r && a.setAttribute("api-key", r), i && a.setAttribute("mode", i), a.addEventListener("agent-event", b), s.appendChild(a), f.current = a, () => {
|
|
2685
|
+
a.removeEventListener("agent-event", b), s.removeChild(a), f.current = null;
|
|
2662
2686
|
};
|
|
2663
|
-
}, [e]),
|
|
2687
|
+
}, [e]), A(() => {
|
|
2664
2688
|
f.current && (i ? f.current.setAttribute("mode", i) : f.current.removeAttribute("mode"));
|
|
2665
2689
|
}, [i]), /* @__PURE__ */ n("div", { ref: d, className: l, style: c });
|
|
2666
|
-
},
|
|
2690
|
+
}, Or = vt(
|
|
2667
2691
|
function({ id: t, intent: r, as: i = "div", className: o, style: l, children: c }, d) {
|
|
2668
|
-
return
|
|
2692
|
+
return hn(
|
|
2669
2693
|
i,
|
|
2670
2694
|
{
|
|
2671
2695
|
ref: d,
|
|
@@ -2677,7 +2701,7 @@ const Dr = ({
|
|
|
2677
2701
|
c
|
|
2678
2702
|
);
|
|
2679
2703
|
}
|
|
2680
|
-
),
|
|
2704
|
+
), Br = vt(
|
|
2681
2705
|
function({ id: t, intent: r, children: i, ...o }, l) {
|
|
2682
2706
|
return /* @__PURE__ */ n(
|
|
2683
2707
|
"form",
|
|
@@ -2690,39 +2714,39 @@ const Dr = ({
|
|
|
2690
2714
|
}
|
|
2691
2715
|
);
|
|
2692
2716
|
}
|
|
2693
|
-
),
|
|
2717
|
+
), qr = vt(
|
|
2694
2718
|
function(t, r) {
|
|
2695
2719
|
const { name: i, label: o, labelClassName: l } = t, c = { name: i, "data-ll-field": i };
|
|
2696
2720
|
let d;
|
|
2697
2721
|
if ("as" in t && t.as === "textarea") {
|
|
2698
|
-
const { name: f, label:
|
|
2722
|
+
const { name: f, label: g, labelClassName: b, as: s, ...a } = t;
|
|
2699
2723
|
d = /* @__PURE__ */ n(
|
|
2700
2724
|
"textarea",
|
|
2701
2725
|
{
|
|
2702
2726
|
ref: r,
|
|
2703
2727
|
...c,
|
|
2704
|
-
...
|
|
2728
|
+
...a
|
|
2705
2729
|
}
|
|
2706
2730
|
);
|
|
2707
2731
|
} else if ("as" in t && t.as === "select") {
|
|
2708
|
-
const { name: f, label:
|
|
2732
|
+
const { name: f, label: g, labelClassName: b, as: s, children: a, ...k } = t;
|
|
2709
2733
|
d = /* @__PURE__ */ n(
|
|
2710
2734
|
"select",
|
|
2711
2735
|
{
|
|
2712
2736
|
ref: r,
|
|
2713
2737
|
...c,
|
|
2714
|
-
...
|
|
2715
|
-
children:
|
|
2738
|
+
...k,
|
|
2739
|
+
children: a
|
|
2716
2740
|
}
|
|
2717
2741
|
);
|
|
2718
2742
|
} else {
|
|
2719
|
-
const { name: f, label:
|
|
2743
|
+
const { name: f, label: g, labelClassName: b, as: s, ...a } = t;
|
|
2720
2744
|
d = /* @__PURE__ */ n(
|
|
2721
2745
|
"input",
|
|
2722
2746
|
{
|
|
2723
2747
|
ref: r,
|
|
2724
2748
|
...c,
|
|
2725
|
-
...
|
|
2749
|
+
...a
|
|
2726
2750
|
}
|
|
2727
2751
|
);
|
|
2728
2752
|
}
|
|
@@ -2732,67 +2756,67 @@ const Dr = ({
|
|
|
2732
2756
|
] });
|
|
2733
2757
|
}
|
|
2734
2758
|
);
|
|
2735
|
-
let
|
|
2736
|
-
function
|
|
2759
|
+
let Kt = 1;
|
|
2760
|
+
function Wr({
|
|
2737
2761
|
onMount: e,
|
|
2738
2762
|
defaultOpen: t = !1,
|
|
2739
2763
|
storageKey: r = "ll-debug-open"
|
|
2740
2764
|
}) {
|
|
2741
|
-
const [i, o] =
|
|
2742
|
-
|
|
2765
|
+
const [i, o] = S(t), [l, c] = S([]), [d, f] = S(""), [g, b] = S(!1), s = N(/* @__PURE__ */ new Set()), a = N([]), k = N(g);
|
|
2766
|
+
k.current = g, A(() => {
|
|
2743
2767
|
try {
|
|
2744
2768
|
const v = localStorage.getItem(r);
|
|
2745
2769
|
v === "1" && o(!0), v === "0" && o(!1);
|
|
2746
2770
|
} catch {
|
|
2747
2771
|
}
|
|
2748
|
-
}, [r]),
|
|
2772
|
+
}, [r]), A(() => {
|
|
2749
2773
|
try {
|
|
2750
2774
|
localStorage.setItem(r, i ? "1" : "0");
|
|
2751
2775
|
} catch {
|
|
2752
2776
|
}
|
|
2753
|
-
}, [i, r]),
|
|
2754
|
-
const v = (
|
|
2755
|
-
(
|
|
2777
|
+
}, [i, r]), A(() => {
|
|
2778
|
+
const v = (w) => {
|
|
2779
|
+
(w.metaKey || w.ctrlKey) && w.shiftKey && w.key.toLowerCase() === "l" && (w.preventDefault(), o((z) => !z));
|
|
2756
2780
|
};
|
|
2757
2781
|
return window.addEventListener("keydown", v), () => window.removeEventListener("keydown", v);
|
|
2758
|
-
}, []),
|
|
2782
|
+
}, []), A(() => {
|
|
2759
2783
|
const v = setInterval(() => {
|
|
2760
|
-
if (
|
|
2761
|
-
const
|
|
2784
|
+
if (a.current.length === 0 || k.current) return;
|
|
2785
|
+
const w = a.current.splice(0, a.current.length);
|
|
2762
2786
|
c(
|
|
2763
|
-
(z) => [...
|
|
2787
|
+
(z) => [...w.reverse(), ...z].slice(0, 200)
|
|
2764
2788
|
);
|
|
2765
2789
|
}, 100);
|
|
2766
2790
|
return () => clearInterval(v);
|
|
2767
2791
|
}, []);
|
|
2768
|
-
const
|
|
2769
|
-
if (
|
|
2770
|
-
!e ||
|
|
2771
|
-
|
|
2772
|
-
id:
|
|
2792
|
+
const E = N(!1);
|
|
2793
|
+
if (A(() => {
|
|
2794
|
+
!e || E.current || (E.current = !0, e((v) => {
|
|
2795
|
+
a.current.push({
|
|
2796
|
+
id: Kt++,
|
|
2773
2797
|
ts: Date.now(),
|
|
2774
2798
|
kind: "event",
|
|
2775
2799
|
type: v.eventName,
|
|
2776
2800
|
data: v.data
|
|
2777
2801
|
});
|
|
2778
2802
|
}));
|
|
2779
|
-
}, [e]),
|
|
2780
|
-
const v = console.warn,
|
|
2803
|
+
}, [e]), A(() => {
|
|
2804
|
+
const v = console.warn, w = console.log, z = (I, H) => function(...h) {
|
|
2781
2805
|
try {
|
|
2782
|
-
const
|
|
2783
|
-
|
|
2784
|
-
id:
|
|
2806
|
+
const R = typeof h[0] == "string" ? h[0] : "";
|
|
2807
|
+
R.startsWith("[LiveLayer]") && a.current.push({
|
|
2808
|
+
id: Kt++,
|
|
2785
2809
|
ts: Date.now(),
|
|
2786
|
-
kind:
|
|
2787
|
-
type:
|
|
2788
|
-
data: { args: h.slice(1).map((q) =>
|
|
2810
|
+
kind: I,
|
|
2811
|
+
type: R.slice(0, 120),
|
|
2812
|
+
data: { args: h.slice(1).map((q) => Mr(q)) }
|
|
2789
2813
|
});
|
|
2790
2814
|
} catch {
|
|
2791
2815
|
}
|
|
2792
2816
|
return H.apply(this, h);
|
|
2793
2817
|
};
|
|
2794
|
-
return console.warn = z("warn", v), console.log = z("log",
|
|
2795
|
-
console.warn = v, console.log =
|
|
2818
|
+
return console.warn = z("warn", v), console.log = z("log", w), () => {
|
|
2819
|
+
console.warn = v, console.log = w;
|
|
2796
2820
|
};
|
|
2797
2821
|
}, []), !i)
|
|
2798
2822
|
return /* @__PURE__ */ n(
|
|
@@ -2821,10 +2845,10 @@ function Or({
|
|
|
2821
2845
|
children: "🛰 LL debug"
|
|
2822
2846
|
}
|
|
2823
2847
|
);
|
|
2824
|
-
const
|
|
2848
|
+
const C = l.filter((v) => {
|
|
2825
2849
|
if (!d) return !0;
|
|
2826
|
-
const
|
|
2827
|
-
return v.type.toLowerCase().includes(
|
|
2850
|
+
const w = d.toLowerCase();
|
|
2851
|
+
return v.type.toLowerCase().includes(w) || JSON.stringify(v.data || {}).toLowerCase().includes(w);
|
|
2828
2852
|
});
|
|
2829
2853
|
return /* @__PURE__ */ _(
|
|
2830
2854
|
"div",
|
|
@@ -2871,10 +2895,10 @@ function Or({
|
|
|
2871
2895
|
"button",
|
|
2872
2896
|
{
|
|
2873
2897
|
type: "button",
|
|
2874
|
-
onClick: () =>
|
|
2875
|
-
style:
|
|
2898
|
+
onClick: () => b((v) => !v),
|
|
2899
|
+
style: gt(g ? "#f59e0b" : "transparent"),
|
|
2876
2900
|
title: "Pause / resume capture",
|
|
2877
|
-
children:
|
|
2901
|
+
children: g ? "▶ resume" : "⏸ pause"
|
|
2878
2902
|
}
|
|
2879
2903
|
),
|
|
2880
2904
|
/* @__PURE__ */ n(
|
|
@@ -2882,9 +2906,9 @@ function Or({
|
|
|
2882
2906
|
{
|
|
2883
2907
|
type: "button",
|
|
2884
2908
|
onClick: () => {
|
|
2885
|
-
c([]),
|
|
2909
|
+
c([]), a.current = [];
|
|
2886
2910
|
},
|
|
2887
|
-
style:
|
|
2911
|
+
style: gt("transparent"),
|
|
2888
2912
|
title: "Clear buffer",
|
|
2889
2913
|
children: "clear"
|
|
2890
2914
|
}
|
|
@@ -2894,7 +2918,7 @@ function Or({
|
|
|
2894
2918
|
{
|
|
2895
2919
|
type: "button",
|
|
2896
2920
|
onClick: () => o(!1),
|
|
2897
|
-
style:
|
|
2921
|
+
style: gt("transparent"),
|
|
2898
2922
|
"aria-label": "Close",
|
|
2899
2923
|
title: "Close (Cmd/Ctrl + Shift + L)",
|
|
2900
2924
|
children: "✕"
|
|
@@ -2930,7 +2954,7 @@ function Or({
|
|
|
2930
2954
|
overflowY: "auto",
|
|
2931
2955
|
padding: "0 8px 8px"
|
|
2932
2956
|
},
|
|
2933
|
-
children:
|
|
2957
|
+
children: C.length === 0 ? /* @__PURE__ */ _(
|
|
2934
2958
|
"div",
|
|
2935
2959
|
{
|
|
2936
2960
|
style: {
|
|
@@ -2960,13 +2984,13 @@ function Or({
|
|
|
2960
2984
|
)
|
|
2961
2985
|
]
|
|
2962
2986
|
}
|
|
2963
|
-
) :
|
|
2964
|
-
|
|
2987
|
+
) : C.map((v) => /* @__PURE__ */ n(
|
|
2988
|
+
Rr,
|
|
2965
2989
|
{
|
|
2966
2990
|
entry: v,
|
|
2967
|
-
expanded:
|
|
2991
|
+
expanded: s.current.has(v.id),
|
|
2968
2992
|
onToggle: () => {
|
|
2969
|
-
|
|
2993
|
+
s.current.has(v.id) ? s.current.delete(v.id) : s.current.add(v.id), c((w) => [...w]);
|
|
2970
2994
|
}
|
|
2971
2995
|
},
|
|
2972
2996
|
v.id
|
|
@@ -2977,7 +3001,7 @@ function Or({
|
|
|
2977
3001
|
}
|
|
2978
3002
|
);
|
|
2979
3003
|
}
|
|
2980
|
-
function
|
|
3004
|
+
function Rr({
|
|
2981
3005
|
entry: e,
|
|
2982
3006
|
expanded: t,
|
|
2983
3007
|
onToggle: r
|
|
@@ -3047,7 +3071,7 @@ function Er({
|
|
|
3047
3071
|
}
|
|
3048
3072
|
);
|
|
3049
3073
|
}
|
|
3050
|
-
function
|
|
3074
|
+
function gt(e) {
|
|
3051
3075
|
return {
|
|
3052
3076
|
background: e,
|
|
3053
3077
|
color: "#fff",
|
|
@@ -3058,15 +3082,15 @@ function pt(e) {
|
|
|
3058
3082
|
cursor: "pointer"
|
|
3059
3083
|
};
|
|
3060
3084
|
}
|
|
3061
|
-
function
|
|
3085
|
+
function Mr(e) {
|
|
3062
3086
|
try {
|
|
3063
3087
|
return e instanceof Error ? { message: e.message, stack: e.stack } : (JSON.stringify(e), e);
|
|
3064
3088
|
} catch {
|
|
3065
3089
|
return String(e);
|
|
3066
3090
|
}
|
|
3067
3091
|
}
|
|
3068
|
-
function
|
|
3069
|
-
const [e, t] =
|
|
3092
|
+
function Fr() {
|
|
3093
|
+
const [e, t] = S([]), r = L((o) => {
|
|
3070
3094
|
t((l) => {
|
|
3071
3095
|
const c = l.findIndex((d) => d.id === o.id);
|
|
3072
3096
|
if (c >= 0) {
|
|
@@ -3075,7 +3099,7 @@ function Br() {
|
|
|
3075
3099
|
}
|
|
3076
3100
|
return [...l, o];
|
|
3077
3101
|
});
|
|
3078
|
-
}, []), i =
|
|
3102
|
+
}, []), i = L(() => t([]), []);
|
|
3079
3103
|
return {
|
|
3080
3104
|
entries: e,
|
|
3081
3105
|
pushSegment: r,
|
|
@@ -3084,33 +3108,33 @@ function Br() {
|
|
|
3084
3108
|
};
|
|
3085
3109
|
}
|
|
3086
3110
|
export {
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3111
|
+
zr as AvatarWidget,
|
|
3112
|
+
vn as ErrorBoundary,
|
|
3113
|
+
Wr as LiveLayerDebugPanel,
|
|
3114
|
+
qr as LiveLayerField,
|
|
3115
|
+
Br as LiveLayerForm,
|
|
3116
|
+
Or as LiveLayerRegion,
|
|
3117
|
+
Hr as LiveLayerWidget,
|
|
3118
|
+
hr as clearPageContextCache,
|
|
3119
|
+
wr as clearRoutesCache,
|
|
3120
|
+
pr as extractPageContext,
|
|
3121
|
+
vr as extractRoutes,
|
|
3122
|
+
Gt as getCachedPageContext,
|
|
3123
|
+
mt as getCachedRoutes,
|
|
3124
|
+
qn as matchesPattern,
|
|
3125
|
+
gr as normalizeRouteInput,
|
|
3126
|
+
Wn as shouldRenderAtPath,
|
|
3127
|
+
Cn as useAgentInfo,
|
|
3128
|
+
wn as useAudioLevel,
|
|
3129
|
+
kn as useCameraState,
|
|
3130
|
+
An as useDisplayMode,
|
|
3131
|
+
In as useDisplayModePersistence,
|
|
3132
|
+
Pn as useIsMobile,
|
|
3133
|
+
bn as useLiveKitSession,
|
|
3134
|
+
Sn as useMediaDevices,
|
|
3135
|
+
_n as useMicrophoneState,
|
|
3136
|
+
$n as usePathname,
|
|
3137
|
+
Fn as useRouteMatch,
|
|
3138
|
+
Ln as useScreenShareState,
|
|
3139
|
+
Fr as useTranscript
|
|
3116
3140
|
};
|