@livelayer/react 0.21.2 → 0.21.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -3
- package/dist/index.mjs +1253 -1202
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as k, jsx as
|
|
3
|
-
import { Component as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { LiveKitSession as
|
|
6
|
-
import { clearFieldRegistry as
|
|
7
|
-
import { createLocalAudioTrack as
|
|
8
|
-
class
|
|
2
|
+
import { jsxs as k, jsx as r, Fragment as We } from "react/jsx-runtime";
|
|
3
|
+
import { Component as ur, useState as M, useRef as I, useEffect as T, useCallback as C, useMemo as tt, useLayoutEffect as Dn, forwardRef as Gt, useImperativeHandle as dr, createElement as fr } from "react";
|
|
4
|
+
import { createPortal as Xt } from "react-dom";
|
|
5
|
+
import { LiveKitSession as pr, registerFields as hr } from "@livelayer/sdk";
|
|
6
|
+
import { clearFieldRegistry as po, getRegisteredFields as ho, registerFields as mo, setFieldValue as go } from "@livelayer/sdk";
|
|
7
|
+
import { createLocalAudioTrack as mr, Track as zn, createLocalVideoTrack as gr } from "livekit-client";
|
|
8
|
+
class yr extends ur {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments), this.state = { hasError: !1, error: null }, this.reset = () => {
|
|
11
11
|
this.setState({ hasError: !1, error: null });
|
|
@@ -14,16 +14,16 @@ class mr extends sr {
|
|
|
14
14
|
static getDerivedStateFromError(t) {
|
|
15
15
|
return { hasError: !0, error: t };
|
|
16
16
|
}
|
|
17
|
-
componentDidCatch(t,
|
|
17
|
+
componentDidCatch(t, n) {
|
|
18
18
|
var i, a;
|
|
19
|
-
(a = (i = this.props).onError) == null || a.call(i, t,
|
|
19
|
+
(a = (i = this.props).onError) == null || a.call(i, t, n);
|
|
20
20
|
}
|
|
21
21
|
render() {
|
|
22
22
|
var t;
|
|
23
23
|
return this.state.hasError ? this.props.fallback ? this.props.fallback : /* @__PURE__ */ k("div", { className: "ll-error-boundary", role: "alert", children: [
|
|
24
|
-
/* @__PURE__ */
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
/* @__PURE__ */
|
|
24
|
+
/* @__PURE__ */ r("p", { className: "ll-error-boundary__title", children: "Widget crashed" }),
|
|
25
|
+
/* @__PURE__ */ r("p", { className: "ll-error-boundary__message", children: ((t = this.state.error) == null ? void 0 : t.message) || "Something went wrong." }),
|
|
26
|
+
/* @__PURE__ */ r(
|
|
27
27
|
"button",
|
|
28
28
|
{
|
|
29
29
|
type: "button",
|
|
@@ -35,26 +35,26 @@ class mr extends sr {
|
|
|
35
35
|
] }) : this.props.children;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
function
|
|
39
|
-
const [t,
|
|
38
|
+
function vr(e) {
|
|
39
|
+
const [t, n] = M("idle"), [i, a] = M("idle"), [o, s] = M([]), [l, c] = M(null), [u, m] = M(null), [p, h] = M(null), [P, x] = M(!1), [E, y] = M(null), w = I(null), R = I(e.onDataMessage);
|
|
40
40
|
R.current = e.onDataMessage, T(() => {
|
|
41
|
-
const
|
|
41
|
+
const g = {
|
|
42
42
|
onConnectionStateChange: (W) => {
|
|
43
|
-
|
|
43
|
+
n(W), W === "connected" && y(null);
|
|
44
44
|
},
|
|
45
45
|
onAgentStateChange: a,
|
|
46
|
-
onTranscript: (W) =>
|
|
47
|
-
onAgentConfig:
|
|
46
|
+
onTranscript: (W) => s([...W]),
|
|
47
|
+
onAgentConfig: c,
|
|
48
48
|
onAudioTrack: (W) => h(W),
|
|
49
|
-
onVideoTrack: (W) =>
|
|
50
|
-
onVideoTrackRemoved: () =>
|
|
51
|
-
onError: (W) =>
|
|
49
|
+
onVideoTrack: (W) => m(W),
|
|
50
|
+
onVideoTrackRemoved: () => m(null),
|
|
51
|
+
onError: (W) => y(W),
|
|
52
52
|
onDataMessage: (W) => {
|
|
53
53
|
var K;
|
|
54
54
|
(K = R.current) == null || K.call(R, W);
|
|
55
55
|
},
|
|
56
56
|
onResumabilityChange: x
|
|
57
|
-
}, D = new
|
|
57
|
+
}, D = new pr(
|
|
58
58
|
{
|
|
59
59
|
agentId: e.agentId,
|
|
60
60
|
baseUrl: e.baseUrl,
|
|
@@ -62,9 +62,9 @@ function gr(e) {
|
|
|
62
62
|
sessionEndpoint: e.sessionEndpoint,
|
|
63
63
|
sessionBody: e.sessionBody
|
|
64
64
|
},
|
|
65
|
-
|
|
65
|
+
g
|
|
66
66
|
);
|
|
67
|
-
return w.current = D,
|
|
67
|
+
return w.current = D, n("idle"), a("idle"), s([]), c(null), m(null), h(null), x(!1), y(null), () => {
|
|
68
68
|
var W;
|
|
69
69
|
(W = D.destroy) == null || W.call(D), w.current = null;
|
|
70
70
|
};
|
|
@@ -76,19 +76,19 @@ function gr(e) {
|
|
|
76
76
|
JSON.stringify(e.sessionBody ?? {})
|
|
77
77
|
]);
|
|
78
78
|
const S = C(async () => {
|
|
79
|
-
const
|
|
80
|
-
if (
|
|
79
|
+
const g = w.current;
|
|
80
|
+
if (g)
|
|
81
81
|
try {
|
|
82
|
-
await
|
|
82
|
+
await g.connect();
|
|
83
83
|
} catch (D) {
|
|
84
|
-
throw
|
|
84
|
+
throw y(D instanceof Error ? D.message : String(D)), D;
|
|
85
85
|
}
|
|
86
|
-
}, []),
|
|
87
|
-
const
|
|
88
|
-
|
|
86
|
+
}, []), v = C(() => {
|
|
87
|
+
const g = w.current;
|
|
88
|
+
g && g.disconnect();
|
|
89
89
|
}, []), O = C(() => {
|
|
90
|
-
var
|
|
91
|
-
return ((
|
|
90
|
+
var g;
|
|
91
|
+
return ((g = w.current) == null ? void 0 : g.getRoom()) ?? null;
|
|
92
92
|
}, []);
|
|
93
93
|
return {
|
|
94
94
|
connectionState: t,
|
|
@@ -100,35 +100,35 @@ function gr(e) {
|
|
|
100
100
|
canResume: P,
|
|
101
101
|
error: E,
|
|
102
102
|
connect: S,
|
|
103
|
-
disconnect:
|
|
103
|
+
disconnect: v,
|
|
104
104
|
getRoom: O,
|
|
105
105
|
session: w.current
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
|
-
function
|
|
109
|
-
const e = I(null), t = I(/* @__PURE__ */ new Map()),
|
|
108
|
+
function br() {
|
|
109
|
+
const e = I(null), t = I(/* @__PURE__ */ new Map()), n = I(null), i = I(/* @__PURE__ */ new Set()), a = C(() => {
|
|
110
110
|
const x = t.current;
|
|
111
111
|
if (x.size === 0) {
|
|
112
|
-
|
|
112
|
+
n.current = null;
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
115
|
let E = 0;
|
|
116
|
-
for (const { analyser:
|
|
117
|
-
|
|
116
|
+
for (const { analyser: y, buffer: w } of x.values()) {
|
|
117
|
+
y.getByteFrequencyData(w);
|
|
118
118
|
let R = 0;
|
|
119
|
-
for (let
|
|
119
|
+
for (let v = 0; v < w.length; v++) R += w[v];
|
|
120
120
|
const S = R / w.length / 255;
|
|
121
121
|
S > E && (E = S);
|
|
122
122
|
}
|
|
123
|
-
for (const
|
|
123
|
+
for (const y of i.current)
|
|
124
124
|
try {
|
|
125
|
-
|
|
125
|
+
y(E);
|
|
126
126
|
} catch (w) {
|
|
127
127
|
console.error("[useAudioLevel] subscriber threw:", w);
|
|
128
128
|
}
|
|
129
|
-
|
|
130
|
-
}, []), o = C(() => e.current ? e.current : typeof window > "u" || typeof AudioContext > "u" ? null : (e.current = new AudioContext(), e.current), []),
|
|
131
|
-
|
|
129
|
+
n.current = requestAnimationFrame(a);
|
|
130
|
+
}, []), o = C(() => e.current ? e.current : typeof window > "u" || typeof AudioContext > "u" ? null : (e.current = new AudioContext(), e.current), []), s = C(() => {
|
|
131
|
+
n.current === null && t.current.size > 0 && (n.current = requestAnimationFrame(a));
|
|
132
132
|
}, [a]), l = C((x) => {
|
|
133
133
|
const E = t.current.get(x);
|
|
134
134
|
if (E) {
|
|
@@ -142,14 +142,14 @@ function yr() {
|
|
|
142
142
|
}
|
|
143
143
|
t.current.delete(x);
|
|
144
144
|
}
|
|
145
|
-
}, []),
|
|
145
|
+
}, []), c = C(
|
|
146
146
|
(x, E) => {
|
|
147
|
-
const
|
|
148
|
-
if (!
|
|
147
|
+
const y = o();
|
|
148
|
+
if (!y) return;
|
|
149
149
|
l(x);
|
|
150
|
-
const w = E(
|
|
150
|
+
const w = E(y);
|
|
151
151
|
if (!w) return;
|
|
152
|
-
const R =
|
|
152
|
+
const R = y.createAnalyser();
|
|
153
153
|
R.fftSize = 64;
|
|
154
154
|
try {
|
|
155
155
|
w.connect(R);
|
|
@@ -161,14 +161,14 @@ function yr() {
|
|
|
161
161
|
analyser: R,
|
|
162
162
|
node: w,
|
|
163
163
|
buffer: new Uint8Array(new ArrayBuffer(R.frequencyBinCount))
|
|
164
|
-
}),
|
|
164
|
+
}), s();
|
|
165
165
|
},
|
|
166
|
-
[l, o,
|
|
166
|
+
[l, o, s]
|
|
167
167
|
), u = C(
|
|
168
168
|
(x, E = "agent") => {
|
|
169
|
-
|
|
169
|
+
c(E, (y) => {
|
|
170
170
|
try {
|
|
171
|
-
return
|
|
171
|
+
return y.createMediaElementSource(x);
|
|
172
172
|
} catch (w) {
|
|
173
173
|
return console.warn(
|
|
174
174
|
"[useAudioLevel] createMediaElementSource failed for slot",
|
|
@@ -178,12 +178,12 @@ function yr() {
|
|
|
178
178
|
}
|
|
179
179
|
});
|
|
180
180
|
},
|
|
181
|
-
[
|
|
182
|
-
),
|
|
181
|
+
[c]
|
|
182
|
+
), m = C(
|
|
183
183
|
(x, E = "mic") => {
|
|
184
|
-
|
|
184
|
+
c(E, (y) => {
|
|
185
185
|
try {
|
|
186
|
-
return
|
|
186
|
+
return y.createMediaStreamSource(x);
|
|
187
187
|
} catch (w) {
|
|
188
188
|
return console.warn(
|
|
189
189
|
"[useAudioLevel] createMediaStreamSource failed for slot",
|
|
@@ -193,14 +193,14 @@ function yr() {
|
|
|
193
193
|
}
|
|
194
194
|
});
|
|
195
195
|
},
|
|
196
|
-
[
|
|
196
|
+
[c]
|
|
197
197
|
), p = C(
|
|
198
198
|
(x) => {
|
|
199
|
-
l(x), t.current.size === 0 &&
|
|
199
|
+
l(x), t.current.size === 0 && n.current !== null && (cancelAnimationFrame(n.current), n.current = null);
|
|
200
200
|
},
|
|
201
201
|
[l]
|
|
202
202
|
), h = C(() => {
|
|
203
|
-
|
|
203
|
+
n.current !== null && (cancelAnimationFrame(n.current), n.current = null);
|
|
204
204
|
for (const x of Array.from(t.current.keys()))
|
|
205
205
|
l(x);
|
|
206
206
|
}, [l]), P = C((x) => (i.current.add(x), () => {
|
|
@@ -215,77 +215,77 @@ function yr() {
|
|
|
215
215
|
e.current = null;
|
|
216
216
|
}
|
|
217
217
|
i.current.clear();
|
|
218
|
-
}, [h]), { attach: u, attachStream:
|
|
218
|
+
}, [h]), { attach: u, attachStream: m, detach: h, detachSlot: p, subscribe: P };
|
|
219
219
|
}
|
|
220
|
-
function
|
|
220
|
+
function wr(e) {
|
|
221
221
|
const t = e == null ? void 0 : e.mediaStreamTrack;
|
|
222
222
|
return t ? new MediaStream([t]) : null;
|
|
223
223
|
}
|
|
224
|
-
function
|
|
225
|
-
const t = e.gateUntilAgentReady ?? !1,
|
|
224
|
+
function _r(e = {}) {
|
|
225
|
+
const t = e.gateUntilAgentReady ?? !1, n = e.agentState ?? null, [i, a] = M(t), [o, s] = M(""), [l, c] = M(null), u = I(null), m = I(null), p = I({
|
|
226
226
|
active: t,
|
|
227
227
|
lastAutoIntent: null
|
|
228
228
|
}), h = C(async (S) => {
|
|
229
|
-
var
|
|
230
|
-
if (u.current &&
|
|
229
|
+
var v, O;
|
|
230
|
+
if (u.current && m.current) {
|
|
231
231
|
try {
|
|
232
|
-
await
|
|
232
|
+
await m.current.localParticipant.unpublishTrack(u.current);
|
|
233
233
|
} catch {
|
|
234
234
|
}
|
|
235
235
|
u.current.stop(), u.current = null;
|
|
236
236
|
}
|
|
237
|
-
|
|
237
|
+
m.current = S, c(null);
|
|
238
238
|
try {
|
|
239
|
-
const
|
|
239
|
+
const g = await mr({
|
|
240
240
|
echoCancellation: !0,
|
|
241
241
|
noiseSuppression: !0
|
|
242
242
|
});
|
|
243
|
-
await S.localParticipant.publishTrack(
|
|
244
|
-
const D = (O = (
|
|
245
|
-
D != null && D.deviceId &&
|
|
246
|
-
} catch (
|
|
247
|
-
const D =
|
|
248
|
-
throw
|
|
243
|
+
await S.localParticipant.publishTrack(g), u.current = g, p.current.active ? (await S.localParticipant.setMicrophoneEnabled(!1), p.current.lastAutoIntent = !1, a(!0)) : a(g.isMuted);
|
|
244
|
+
const D = (O = (v = g.mediaStreamTrack) == null ? void 0 : v.getSettings) == null ? void 0 : O.call(v);
|
|
245
|
+
D != null && D.deviceId && s(D.deviceId);
|
|
246
|
+
} catch (g) {
|
|
247
|
+
const D = g instanceof Error && g.name === "NotAllowedError" ? "Enable your microphone to talk with the agent." : "Microphone unavailable. Check browser permissions and try again.";
|
|
248
|
+
throw c(D), g;
|
|
249
249
|
}
|
|
250
250
|
}, []), P = C((S) => {
|
|
251
|
-
|
|
251
|
+
m.current = S;
|
|
252
252
|
}, []), x = C(async (S) => {
|
|
253
|
-
const
|
|
254
|
-
if (
|
|
253
|
+
const v = m.current;
|
|
254
|
+
if (v)
|
|
255
255
|
try {
|
|
256
|
-
await
|
|
256
|
+
await v.switchActiveDevice("audioinput", S), s(S);
|
|
257
257
|
} catch (O) {
|
|
258
258
|
console.warn("[useMicrophoneState] switchDevice failed:", O);
|
|
259
259
|
}
|
|
260
260
|
}, []), E = C(async () => {
|
|
261
|
-
const S =
|
|
262
|
-
if (a(
|
|
261
|
+
const S = m.current, v = !i;
|
|
262
|
+
if (a(v), p.current.active = !1, !!S)
|
|
263
263
|
try {
|
|
264
|
-
await S.localParticipant.setMicrophoneEnabled(!
|
|
264
|
+
await S.localParticipant.setMicrophoneEnabled(!v);
|
|
265
265
|
} catch (O) {
|
|
266
|
-
console.warn("[useMicrophoneState] setMicrophoneEnabled failed:", O), a(!
|
|
266
|
+
console.warn("[useMicrophoneState] setMicrophoneEnabled failed:", O), a(!v);
|
|
267
267
|
}
|
|
268
268
|
}, [i]);
|
|
269
269
|
T(() => {
|
|
270
|
-
if (!p.current.active ||
|
|
271
|
-
const S =
|
|
272
|
-
if (!
|
|
270
|
+
if (!p.current.active || n !== "listening") return;
|
|
271
|
+
const S = m.current, v = S == null ? void 0 : S.localParticipant;
|
|
272
|
+
if (!v) {
|
|
273
273
|
p.current.active = !1;
|
|
274
274
|
return;
|
|
275
275
|
}
|
|
276
|
-
|
|
277
|
-
}, [
|
|
278
|
-
const
|
|
279
|
-
const S = u.current,
|
|
280
|
-
if (S &&
|
|
276
|
+
v.isMicrophoneEnabled === p.current.lastAutoIntent && (v.setMicrophoneEnabled(!0), p.current.lastAutoIntent = !0, a(!1)), p.current.active = !1;
|
|
277
|
+
}, [n]);
|
|
278
|
+
const y = C(() => {
|
|
279
|
+
const S = u.current, v = m.current;
|
|
280
|
+
if (S && v) {
|
|
281
281
|
try {
|
|
282
|
-
|
|
282
|
+
v.localParticipant.unpublishTrack(S);
|
|
283
283
|
} catch {
|
|
284
284
|
}
|
|
285
285
|
S.stop();
|
|
286
286
|
}
|
|
287
|
-
u.current = null,
|
|
288
|
-
}, [t]), w = C(() =>
|
|
287
|
+
u.current = null, m.current = null, p.current = { active: t, lastAutoIntent: null }, a(t), s("");
|
|
288
|
+
}, [t]), w = C(() => c(null), []), R = C(() => wr(u.current), []);
|
|
289
289
|
return {
|
|
290
290
|
isMuted: i,
|
|
291
291
|
activeDeviceId: o,
|
|
@@ -294,40 +294,40 @@ function br(e = {}) {
|
|
|
294
294
|
setupMic: h,
|
|
295
295
|
attachRoom: P,
|
|
296
296
|
switchDevice: x,
|
|
297
|
-
teardownMic:
|
|
297
|
+
teardownMic: y,
|
|
298
298
|
clearError: w,
|
|
299
299
|
getMicStream: R
|
|
300
300
|
};
|
|
301
301
|
}
|
|
302
|
-
const
|
|
303
|
-
function
|
|
304
|
-
const [e, t] = M(!1), [
|
|
305
|
-
|
|
302
|
+
const xr = { resolution: { width: 640, height: 480, frameRate: 24 } };
|
|
303
|
+
function Lr() {
|
|
304
|
+
const [e, t] = M(!1), [n, i] = M(null), [a, o] = M(null), [s, l] = M(""), c = I(null), u = I(null), m = C((w) => {
|
|
305
|
+
c.current = w;
|
|
306
306
|
}, []), p = C(() => {
|
|
307
307
|
var S;
|
|
308
|
-
const w =
|
|
308
|
+
const w = c.current, R = u.current;
|
|
309
309
|
if (R && w) {
|
|
310
|
-
const
|
|
310
|
+
const v = w.localParticipant.getTrackPublication(zn.Source.Camera), g = (v == null ? void 0 : v.track) ?? R;
|
|
311
311
|
try {
|
|
312
|
-
w.localParticipant.unpublishTrack(
|
|
312
|
+
w.localParticipant.unpublishTrack(g);
|
|
313
313
|
} catch {
|
|
314
314
|
}
|
|
315
315
|
try {
|
|
316
|
-
(S =
|
|
316
|
+
(S = g.stop) == null || S.call(g);
|
|
317
317
|
} catch {
|
|
318
318
|
}
|
|
319
319
|
}
|
|
320
320
|
u.current = null, o(null), t(!1);
|
|
321
321
|
}, []), h = C(async (w) => {
|
|
322
|
-
const R =
|
|
322
|
+
const R = c.current;
|
|
323
323
|
if (R) {
|
|
324
324
|
i(null);
|
|
325
325
|
try {
|
|
326
|
-
const S = { ...
|
|
326
|
+
const S = { ...xr };
|
|
327
327
|
w && (S.deviceId = w);
|
|
328
|
-
const
|
|
329
|
-
await R.localParticipant.publishTrack(
|
|
330
|
-
const O =
|
|
328
|
+
const v = await gr(S);
|
|
329
|
+
await R.localParticipant.publishTrack(v), u.current = v;
|
|
330
|
+
const O = v.attach();
|
|
331
331
|
o(O), t(!0), w && l(w);
|
|
332
332
|
try {
|
|
333
333
|
R.localParticipant.publishData(
|
|
@@ -337,43 +337,43 @@ function _r() {
|
|
|
337
337
|
} catch {
|
|
338
338
|
}
|
|
339
339
|
} catch (S) {
|
|
340
|
-
const
|
|
341
|
-
i(
|
|
340
|
+
const v = S instanceof Error && S.name === "NotAllowedError" ? "Enable your camera in the browser to share video." : "Camera unavailable. Check permissions and try again.";
|
|
341
|
+
i(v);
|
|
342
342
|
}
|
|
343
343
|
}
|
|
344
344
|
}, []), P = C(async () => {
|
|
345
|
-
e ? p() : await h(
|
|
346
|
-
}, [e,
|
|
345
|
+
e ? p() : await h(s || void 0);
|
|
346
|
+
}, [e, s, p, h]), x = C(async (w) => {
|
|
347
347
|
p(), await h(w);
|
|
348
348
|
}, [p, h]), E = C(() => {
|
|
349
|
-
p(),
|
|
350
|
-
}, [p]),
|
|
349
|
+
p(), c.current = null, i(null), l("");
|
|
350
|
+
}, [p]), y = C(() => i(null), []);
|
|
351
351
|
return T(() => () => {
|
|
352
352
|
u.current && u.current.stop();
|
|
353
353
|
}, []), {
|
|
354
354
|
isEnabled: e,
|
|
355
|
-
error:
|
|
355
|
+
error: n,
|
|
356
356
|
previewEl: a,
|
|
357
|
-
activeDeviceId:
|
|
357
|
+
activeDeviceId: s,
|
|
358
358
|
toggle: P,
|
|
359
359
|
switchDevice: x,
|
|
360
|
-
attachRoom:
|
|
360
|
+
attachRoom: m,
|
|
361
361
|
teardown: E,
|
|
362
|
-
clearError:
|
|
362
|
+
clearError: y
|
|
363
363
|
};
|
|
364
364
|
}
|
|
365
|
-
function
|
|
366
|
-
const [e, t] = M(!1), [
|
|
367
|
-
|
|
368
|
-
}, []),
|
|
369
|
-
const h =
|
|
365
|
+
function Cr() {
|
|
366
|
+
const [e, t] = M(!1), [n, i] = M(null), [a, o] = M(null), s = I(null), l = C((h) => {
|
|
367
|
+
s.current = h;
|
|
368
|
+
}, []), c = C(() => o(null), []), u = C(async () => {
|
|
369
|
+
const h = s.current;
|
|
370
370
|
if (h) {
|
|
371
371
|
if (e) {
|
|
372
372
|
try {
|
|
373
373
|
await h.localParticipant.setScreenShareEnabled(!1);
|
|
374
374
|
} catch {
|
|
375
375
|
}
|
|
376
|
-
|
|
376
|
+
c(), t(!1);
|
|
377
377
|
return;
|
|
378
378
|
}
|
|
379
379
|
i(null);
|
|
@@ -381,10 +381,10 @@ function xr() {
|
|
|
381
381
|
await h.localParticipant.setScreenShareEnabled(!0);
|
|
382
382
|
let P = 0;
|
|
383
383
|
const x = () => {
|
|
384
|
-
const E = h.localParticipant.getTrackPublication(
|
|
384
|
+
const E = h.localParticipant.getTrackPublication(zn.Source.ScreenShare);
|
|
385
385
|
if (E != null && E.track) {
|
|
386
|
-
const
|
|
387
|
-
o(
|
|
386
|
+
const y = E.track.attach();
|
|
387
|
+
o(y), t(!0);
|
|
388
388
|
try {
|
|
389
389
|
h.localParticipant.publishData(
|
|
390
390
|
new TextEncoder().encode(JSON.stringify({ type: "user_screen_share_on" })),
|
|
@@ -402,23 +402,23 @@ function xr() {
|
|
|
402
402
|
x !== "NotAllowedError" && x !== "AbortError" && i("Screen share unavailable. Try again."), t(!1);
|
|
403
403
|
}
|
|
404
404
|
}
|
|
405
|
-
}, [e,
|
|
406
|
-
const h =
|
|
405
|
+
}, [e, c]), m = C(() => {
|
|
406
|
+
const h = s.current;
|
|
407
407
|
if (h && e)
|
|
408
408
|
try {
|
|
409
409
|
h.localParticipant.setScreenShareEnabled(!1);
|
|
410
410
|
} catch {
|
|
411
411
|
}
|
|
412
|
-
|
|
413
|
-
}, [e,
|
|
414
|
-
return { isEnabled: e, error:
|
|
412
|
+
c(), t(!1), i(null), s.current = null;
|
|
413
|
+
}, [e, c]), p = C(() => i(null), []);
|
|
414
|
+
return { isEnabled: e, error: n, previewEl: a, toggle: u, attachRoom: l, teardown: m, clearError: p };
|
|
415
415
|
}
|
|
416
|
-
function
|
|
417
|
-
const [e, t] = M([]), [
|
|
416
|
+
function kr() {
|
|
417
|
+
const [e, t] = M([]), [n, i] = M([]), a = C(async () => {
|
|
418
418
|
if (!(typeof navigator > "u" || !navigator.mediaDevices))
|
|
419
419
|
try {
|
|
420
420
|
const o = await navigator.mediaDevices.enumerateDevices();
|
|
421
|
-
t(o.filter((
|
|
421
|
+
t(o.filter((s) => s.kind === "audioinput")), i(o.filter((s) => s.kind === "videoinput"));
|
|
422
422
|
} catch {
|
|
423
423
|
}
|
|
424
424
|
}, []);
|
|
@@ -426,17 +426,17 @@ function Lr() {
|
|
|
426
426
|
if (a(), typeof navigator > "u" || !navigator.mediaDevices) return;
|
|
427
427
|
const o = () => void a();
|
|
428
428
|
return navigator.mediaDevices.addEventListener("devicechange", o), () => navigator.mediaDevices.removeEventListener("devicechange", o);
|
|
429
|
-
}, [a]), { mics: e, cameras:
|
|
429
|
+
}, [a]), { mics: e, cameras: n, refresh: a };
|
|
430
430
|
}
|
|
431
|
-
function
|
|
432
|
-
const [i, a] = M(null), [o,
|
|
431
|
+
function Sr(e, t, n = !1) {
|
|
432
|
+
const [i, a] = M(null), [o, s] = M(null), [l, c] = M(!n && !!e);
|
|
433
433
|
return T(() => {
|
|
434
|
-
if (
|
|
435
|
-
|
|
434
|
+
if (n || !e) {
|
|
435
|
+
c(!1);
|
|
436
436
|
return;
|
|
437
437
|
}
|
|
438
|
-
const u = new AbortController(),
|
|
439
|
-
return
|
|
438
|
+
const u = new AbortController(), m = t || "https://app.livelayer.studio";
|
|
439
|
+
return c(!0), s(null), fetch(`${m}/api/widget/agent/${encodeURIComponent(e)}`, {
|
|
440
440
|
signal: u.signal
|
|
441
441
|
}).then(async (p) => {
|
|
442
442
|
if (!p.ok) {
|
|
@@ -445,13 +445,13 @@ function Cr(e, t, r = !1) {
|
|
|
445
445
|
}
|
|
446
446
|
return p.json();
|
|
447
447
|
}).then((p) => {
|
|
448
|
-
u.signal.aborted || (a(p),
|
|
448
|
+
u.signal.aborted || (a(p), c(!1));
|
|
449
449
|
}).catch((p) => {
|
|
450
|
-
u.signal.aborted || (
|
|
450
|
+
u.signal.aborted || (s(p instanceof Error ? p.message : "Agent lookup failed"), c(!1));
|
|
451
451
|
}), () => u.abort();
|
|
452
|
-
}, [e, t,
|
|
452
|
+
}, [e, t, n]), { info: i, error: o, loading: l };
|
|
453
453
|
}
|
|
454
|
-
function
|
|
454
|
+
function $n(e) {
|
|
455
455
|
if (typeof window > "u") return null;
|
|
456
456
|
try {
|
|
457
457
|
return window.localStorage.getItem(e);
|
|
@@ -459,78 +459,78 @@ function Dn(e) {
|
|
|
459
459
|
return null;
|
|
460
460
|
}
|
|
461
461
|
}
|
|
462
|
-
function
|
|
462
|
+
function Hn(e, t) {
|
|
463
463
|
if (!(typeof window > "u"))
|
|
464
464
|
try {
|
|
465
465
|
window.localStorage.setItem(e, t);
|
|
466
466
|
} catch {
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
|
-
function
|
|
469
|
+
function Er(e) {
|
|
470
470
|
if (!(typeof window > "u"))
|
|
471
471
|
try {
|
|
472
472
|
window.localStorage.removeItem(e);
|
|
473
473
|
} catch {
|
|
474
474
|
}
|
|
475
475
|
}
|
|
476
|
-
function
|
|
476
|
+
function Nr({
|
|
477
477
|
value: e,
|
|
478
478
|
defaultValue: t = "expanded",
|
|
479
|
-
onChange:
|
|
479
|
+
onChange: n
|
|
480
480
|
} = {}) {
|
|
481
|
-
const i = e !== void 0, [a, o] = M(t),
|
|
482
|
-
(
|
|
483
|
-
|
|
481
|
+
const i = e !== void 0, [a, o] = M(t), s = i ? e : a, l = C(
|
|
482
|
+
(c) => {
|
|
483
|
+
c !== s && (i || o(c), n == null || n(c));
|
|
484
484
|
},
|
|
485
|
-
[
|
|
485
|
+
[s, i, n]
|
|
486
486
|
);
|
|
487
|
-
return [
|
|
487
|
+
return [s, l];
|
|
488
488
|
}
|
|
489
|
-
const
|
|
490
|
-
function
|
|
491
|
-
return e &&
|
|
489
|
+
const Ar = ["hidden", "minimized", "expanded"];
|
|
490
|
+
function Mr(e) {
|
|
491
|
+
return e && Ar.includes(e) ? e : null;
|
|
492
492
|
}
|
|
493
|
-
function
|
|
493
|
+
function Ir({
|
|
494
494
|
value: e,
|
|
495
495
|
defaultValue: t = "expanded",
|
|
496
|
-
onChange:
|
|
496
|
+
onChange: n,
|
|
497
497
|
persistKey: i = "ll-widget",
|
|
498
498
|
disablePersistence: a = !1
|
|
499
499
|
} = {}) {
|
|
500
|
-
const o = `${i}:display-mode`,
|
|
500
|
+
const o = `${i}:display-mode`, s = I(!1), [l, c] = Nr({
|
|
501
501
|
value: e,
|
|
502
502
|
defaultValue: t,
|
|
503
503
|
onChange: (u) => {
|
|
504
|
-
e === void 0 && !a &&
|
|
504
|
+
e === void 0 && !a && Hn(o, u), n == null || n(u);
|
|
505
505
|
}
|
|
506
506
|
});
|
|
507
507
|
return T(() => {
|
|
508
|
-
if (
|
|
509
|
-
const u =
|
|
510
|
-
u && u !== l &&
|
|
511
|
-
}, []), [l,
|
|
508
|
+
if (s.current || (s.current = !0, a || e !== void 0)) return;
|
|
509
|
+
const u = Mr($n(o));
|
|
510
|
+
u && u !== l && c(u);
|
|
511
|
+
}, []), [l, c];
|
|
512
512
|
}
|
|
513
|
-
const
|
|
514
|
-
function
|
|
515
|
-
const [t,
|
|
513
|
+
const Rr = 640;
|
|
514
|
+
function Tr(e = Rr) {
|
|
515
|
+
const [t, n] = M(!1);
|
|
516
516
|
return T(() => {
|
|
517
517
|
if (e === !1) {
|
|
518
|
-
|
|
518
|
+
n(!1);
|
|
519
519
|
return;
|
|
520
520
|
}
|
|
521
521
|
if (typeof window > "u" || typeof window.matchMedia > "u")
|
|
522
522
|
return;
|
|
523
|
-
const i = `(max-width: ${e - 1}px)`, a = window.matchMedia(i), o = () =>
|
|
523
|
+
const i = `(max-width: ${e - 1}px)`, a = window.matchMedia(i), o = () => n(a.matches);
|
|
524
524
|
return o(), typeof a.addEventListener == "function" ? (a.addEventListener("change", o), () => a.removeEventListener("change", o)) : (a.addListener(o), () => {
|
|
525
525
|
a.removeListener(o);
|
|
526
526
|
});
|
|
527
527
|
}, [e]), t;
|
|
528
528
|
}
|
|
529
|
-
const
|
|
530
|
-
function
|
|
529
|
+
const Pr = 280, Dr = 380, zr = 8, $r = 4;
|
|
530
|
+
function Ft(e) {
|
|
531
531
|
return `${e}:geometry`;
|
|
532
532
|
}
|
|
533
|
-
function
|
|
533
|
+
function Hr(e) {
|
|
534
534
|
if (!e) return null;
|
|
535
535
|
let t;
|
|
536
536
|
try {
|
|
@@ -539,54 +539,54 @@ function zr(e) {
|
|
|
539
539
|
return null;
|
|
540
540
|
}
|
|
541
541
|
if (typeof t != "object" || t === null) return null;
|
|
542
|
-
const
|
|
543
|
-
return typeof i != "number" || typeof a != "number" || typeof o != "number" || typeof
|
|
542
|
+
const n = t, { top: i, left: a, width: o, height: s } = n;
|
|
543
|
+
return typeof i != "number" || typeof a != "number" || typeof o != "number" || typeof s != "number" || !Number.isFinite(i) || !Number.isFinite(a) || !Number.isFinite(o) || !Number.isFinite(s) ? null : { top: i, left: a, width: o, height: s };
|
|
544
544
|
}
|
|
545
|
-
function
|
|
545
|
+
function kt() {
|
|
546
546
|
return typeof window > "u" ? { vw: 0, vh: 0 } : { vw: window.innerWidth, vh: window.innerHeight };
|
|
547
547
|
}
|
|
548
|
-
function
|
|
549
|
-
const { minWidth: i, minHeight: a, edgeMargin: o, vw:
|
|
548
|
+
function Wt(e, t, n) {
|
|
549
|
+
const { minWidth: i, minHeight: a, edgeMargin: o, vw: s, vh: l } = n, c = Math.max(i, s - o * 2), u = Math.max(a, l - o * 2);
|
|
550
550
|
return {
|
|
551
|
-
width: Math.max(i, Math.min(
|
|
551
|
+
width: Math.max(i, Math.min(c, e)),
|
|
552
552
|
height: Math.max(a, Math.min(u, t))
|
|
553
553
|
};
|
|
554
554
|
}
|
|
555
|
-
function
|
|
556
|
-
const { edgeMargin: o, vw:
|
|
555
|
+
function Bt(e, t, n, i, a) {
|
|
556
|
+
const { edgeMargin: o, vw: s, vh: l } = a, c = o, u = o, m = Math.max(c, s - n - o), p = Math.max(u, l - i - o);
|
|
557
557
|
return {
|
|
558
558
|
top: Math.max(u, Math.min(p, e)),
|
|
559
|
-
left: Math.max(
|
|
559
|
+
left: Math.max(c, Math.min(m, t))
|
|
560
560
|
};
|
|
561
561
|
}
|
|
562
|
-
function
|
|
562
|
+
function Or(e) {
|
|
563
563
|
const {
|
|
564
564
|
draggable: t,
|
|
565
|
-
resizable:
|
|
565
|
+
resizable: n,
|
|
566
566
|
persistKey: i,
|
|
567
567
|
disablePersistence: a,
|
|
568
|
-
minWidth: o =
|
|
569
|
-
minHeight:
|
|
570
|
-
edgeMargin: l =
|
|
571
|
-
} = e, [
|
|
572
|
-
w.current =
|
|
568
|
+
minWidth: o = Pr,
|
|
569
|
+
minHeight: s = Dr,
|
|
570
|
+
edgeMargin: l = zr
|
|
571
|
+
} = e, [c, u] = M(null), [m, p] = M(!1), [h, P] = M(!1), x = I(null), E = I(null), y = I(!1), w = I(null);
|
|
572
|
+
w.current = c;
|
|
573
573
|
const R = C(
|
|
574
574
|
(f) => {
|
|
575
|
-
a || (f === null ?
|
|
575
|
+
a || (f === null ? Er(Ft(i)) : Hn(Ft(i), JSON.stringify(f)));
|
|
576
576
|
},
|
|
577
577
|
[a, i]
|
|
578
578
|
);
|
|
579
579
|
T(() => {
|
|
580
|
-
if (
|
|
581
|
-
const f =
|
|
580
|
+
if (y.current || (y.current = !0, a)) return;
|
|
581
|
+
const f = Hr($n(Ft(i)));
|
|
582
582
|
if (!f) return;
|
|
583
|
-
const { vw: N, vh: z } =
|
|
583
|
+
const { vw: N, vh: z } = kt(), q = Wt(f.width, f.height, {
|
|
584
584
|
minWidth: o,
|
|
585
|
-
minHeight:
|
|
585
|
+
minHeight: s,
|
|
586
586
|
edgeMargin: l,
|
|
587
587
|
vw: N,
|
|
588
588
|
vh: z
|
|
589
|
-
}), X =
|
|
589
|
+
}), X = Bt(f.top, f.left, q.width, q.height, {
|
|
590
590
|
edgeMargin: l,
|
|
591
591
|
vw: N,
|
|
592
592
|
vh: z
|
|
@@ -597,14 +597,14 @@ function $r(e) {
|
|
|
597
597
|
const f = () => {
|
|
598
598
|
u((N) => {
|
|
599
599
|
if (N === null) return null;
|
|
600
|
-
const { vw: z, vh: q } =
|
|
600
|
+
const { vw: z, vh: q } = kt(), X = Wt(N.width, N.height, {
|
|
601
601
|
minWidth: o,
|
|
602
|
-
minHeight:
|
|
602
|
+
minHeight: s,
|
|
603
603
|
edgeMargin: l,
|
|
604
604
|
vw: z,
|
|
605
605
|
vh: q
|
|
606
606
|
});
|
|
607
|
-
return { ...
|
|
607
|
+
return { ...Bt(N.top, N.left, X.width, X.height, {
|
|
608
608
|
edgeMargin: l,
|
|
609
609
|
vw: z,
|
|
610
610
|
vh: q
|
|
@@ -612,7 +612,7 @@ function $r(e) {
|
|
|
612
612
|
});
|
|
613
613
|
};
|
|
614
614
|
return window.addEventListener("resize", f), () => window.removeEventListener("resize", f);
|
|
615
|
-
}, [o,
|
|
615
|
+
}, [o, s, l]);
|
|
616
616
|
const S = C(
|
|
617
617
|
(f) => {
|
|
618
618
|
if (!t || f.pointerType === "mouse" && f.button !== 0) return;
|
|
@@ -643,13 +643,13 @@ function $r(e) {
|
|
|
643
643
|
};
|
|
644
644
|
},
|
|
645
645
|
[t]
|
|
646
|
-
),
|
|
646
|
+
), v = C(
|
|
647
647
|
(f) => {
|
|
648
648
|
const N = x.current;
|
|
649
649
|
if (!N) return;
|
|
650
650
|
const z = f.clientX - N.startClientX, q = f.clientY - N.startClientY;
|
|
651
|
-
if (!N.moved && Math.abs(z) + Math.abs(q) >
|
|
652
|
-
const { vw: X, vh: ee } =
|
|
651
|
+
if (!N.moved && Math.abs(z) + Math.abs(q) > $r && (N.moved = !0, p(!0)), !N.moved) return;
|
|
652
|
+
const { vw: X, vh: ee } = kt(), V = Bt(
|
|
653
653
|
N.startTop + q,
|
|
654
654
|
N.startLeft + z,
|
|
655
655
|
N.width,
|
|
@@ -671,11 +671,11 @@ function $r(e) {
|
|
|
671
671
|
}
|
|
672
672
|
},
|
|
673
673
|
[R]
|
|
674
|
-
),
|
|
674
|
+
), g = C(() => {
|
|
675
675
|
x.current = null, E.current = null, p(!1), P(!1), u(null), R(null);
|
|
676
676
|
}, [R]), D = C(
|
|
677
677
|
(f) => {
|
|
678
|
-
if (!
|
|
678
|
+
if (!n || f.pointerType === "mouse" && f.button !== 0) return;
|
|
679
679
|
f.stopPropagation();
|
|
680
680
|
let N, z, q, X;
|
|
681
681
|
const ee = w.current;
|
|
@@ -699,14 +699,14 @@ function $r(e) {
|
|
|
699
699
|
left: z
|
|
700
700
|
}, P(!0);
|
|
701
701
|
},
|
|
702
|
-
[
|
|
702
|
+
[n]
|
|
703
703
|
), W = C(
|
|
704
704
|
(f) => {
|
|
705
705
|
const N = E.current;
|
|
706
706
|
if (!N) return;
|
|
707
|
-
const z = f.clientX - N.startClientX, q = f.clientY - N.startClientY, { vw: X, vh: ee } =
|
|
707
|
+
const z = f.clientX - N.startClientX, q = f.clientY - N.startClientY, { vw: X, vh: ee } = kt(), V = X - N.left - l, te = ee - N.top - l, oe = Wt(N.startWidth + z, N.startHeight + q, {
|
|
708
708
|
minWidth: o,
|
|
709
|
-
minHeight:
|
|
709
|
+
minHeight: s,
|
|
710
710
|
edgeMargin: l,
|
|
711
711
|
// Clamp the available viewport to the room from the anchored corner
|
|
712
712
|
// so the widget can't grow past the bottom/right edge.
|
|
@@ -715,7 +715,7 @@ function $r(e) {
|
|
|
715
715
|
});
|
|
716
716
|
u({ top: N.top, left: N.left, ...oe });
|
|
717
717
|
},
|
|
718
|
-
[l, o,
|
|
718
|
+
[l, o, s]
|
|
719
719
|
), K = C(
|
|
720
720
|
(f) => {
|
|
721
721
|
if (E.current) {
|
|
@@ -729,24 +729,24 @@ function $r(e) {
|
|
|
729
729
|
[R]
|
|
730
730
|
);
|
|
731
731
|
return {
|
|
732
|
-
style:
|
|
732
|
+
style: c === null ? {} : {
|
|
733
733
|
position: "fixed",
|
|
734
|
-
top: `${
|
|
735
|
-
left: `${
|
|
734
|
+
top: `${c.top}px`,
|
|
735
|
+
left: `${c.left}px`,
|
|
736
736
|
right: "auto",
|
|
737
737
|
bottom: "auto",
|
|
738
|
-
width: `${
|
|
739
|
-
height: `${
|
|
738
|
+
width: `${c.width}px`,
|
|
739
|
+
height: `${c.height}px`
|
|
740
740
|
},
|
|
741
|
-
hasGeometry:
|
|
742
|
-
isDragging:
|
|
741
|
+
hasGeometry: c !== null,
|
|
742
|
+
isDragging: m,
|
|
743
743
|
isResizing: h,
|
|
744
744
|
dragHandleProps: {
|
|
745
745
|
onPointerDown: S,
|
|
746
|
-
onPointerMove:
|
|
746
|
+
onPointerMove: v,
|
|
747
747
|
onPointerUp: O,
|
|
748
748
|
onPointerCancel: O,
|
|
749
|
-
onDoubleClick:
|
|
749
|
+
onDoubleClick: g,
|
|
750
750
|
"data-ll-drag-handle": t ? "" : void 0
|
|
751
751
|
},
|
|
752
752
|
resizeHandleProps: {
|
|
@@ -754,94 +754,94 @@ function $r(e) {
|
|
|
754
754
|
onPointerMove: W,
|
|
755
755
|
onPointerUp: K,
|
|
756
756
|
onPointerCancel: K,
|
|
757
|
-
"data-ll-resize-handle":
|
|
757
|
+
"data-ll-resize-handle": n ? "" : void 0
|
|
758
758
|
},
|
|
759
|
-
reset:
|
|
759
|
+
reset: g
|
|
760
760
|
};
|
|
761
761
|
}
|
|
762
|
-
const
|
|
763
|
-
function
|
|
764
|
-
if (typeof window > "u" || window.history[
|
|
762
|
+
const mn = "__llHistoryPatched", Nt = "ll:pathname";
|
|
763
|
+
function Fr() {
|
|
764
|
+
if (typeof window > "u" || window.history[mn]) return;
|
|
765
765
|
const e = window.history.pushState, t = window.history.replaceState;
|
|
766
|
-
window.history.pushState = function(...
|
|
767
|
-
const i = e.apply(this,
|
|
768
|
-
return window.dispatchEvent(new Event(
|
|
769
|
-
}, window.history.replaceState = function(...
|
|
770
|
-
const i = t.apply(this,
|
|
771
|
-
return window.dispatchEvent(new Event(
|
|
772
|
-
}, window.history[
|
|
766
|
+
window.history.pushState = function(...n) {
|
|
767
|
+
const i = e.apply(this, n);
|
|
768
|
+
return window.dispatchEvent(new Event(Nt)), i;
|
|
769
|
+
}, window.history.replaceState = function(...n) {
|
|
770
|
+
const i = t.apply(this, n);
|
|
771
|
+
return window.dispatchEvent(new Event(Nt)), i;
|
|
772
|
+
}, window.history[mn] = !0;
|
|
773
773
|
}
|
|
774
|
-
function
|
|
774
|
+
function gn() {
|
|
775
775
|
return typeof window > "u" ? "/" : window.location.pathname || "/";
|
|
776
776
|
}
|
|
777
|
-
function
|
|
778
|
-
const [t,
|
|
779
|
-
() => e ??
|
|
777
|
+
function Wr(e) {
|
|
778
|
+
const [t, n] = M(
|
|
779
|
+
() => e ?? gn()
|
|
780
780
|
);
|
|
781
781
|
return T(() => {
|
|
782
782
|
if (e !== void 0) return;
|
|
783
|
-
|
|
784
|
-
const i = () =>
|
|
785
|
-
return i(), window.addEventListener("popstate", i), window.addEventListener(
|
|
786
|
-
window.removeEventListener("popstate", i), window.removeEventListener(
|
|
783
|
+
Fr();
|
|
784
|
+
const i = () => n(gn());
|
|
785
|
+
return i(), window.addEventListener("popstate", i), window.addEventListener(Nt, i), () => {
|
|
786
|
+
window.removeEventListener("popstate", i), window.removeEventListener(Nt, i);
|
|
787
787
|
};
|
|
788
788
|
}, [e]), e ?? t;
|
|
789
789
|
}
|
|
790
|
-
const
|
|
791
|
-
function
|
|
792
|
-
return e.replace(
|
|
790
|
+
const yn = /* @__PURE__ */ new Map(), Br = /[\\^$+?.()|{}[\]]/g;
|
|
791
|
+
function qr(e) {
|
|
792
|
+
return e.replace(Br, "\\$&");
|
|
793
793
|
}
|
|
794
|
-
function
|
|
795
|
-
const t =
|
|
794
|
+
function Ur(e) {
|
|
795
|
+
const t = yn.get(e);
|
|
796
796
|
if (t) return t;
|
|
797
|
-
const
|
|
798
|
-
return
|
|
797
|
+
const n = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e, i = "", a = "", o = n.replace(/\*\*/g, i).replace(/\*/g, a), l = qr(o).replace(new RegExp(`\\/${i}`, "g"), "(?:\\/.*)?").replace(new RegExp(i, "g"), ".*").replace(new RegExp(a, "g"), "[^/]+"), c = new RegExp(`^${l}\\/?$`);
|
|
798
|
+
return yn.set(e, c), c;
|
|
799
799
|
}
|
|
800
|
-
function
|
|
801
|
-
const
|
|
802
|
-
return
|
|
800
|
+
function jr(e, t) {
|
|
801
|
+
const n = t.length > 1 && t.endsWith("/") ? t.slice(0, -1) : t;
|
|
802
|
+
return Ur(e).test(n);
|
|
803
803
|
}
|
|
804
|
-
function
|
|
805
|
-
return typeof e == "function" ? e(t) : e instanceof RegExp ? e.test(t) :
|
|
804
|
+
function Vr(e, t) {
|
|
805
|
+
return typeof e == "function" ? e(t) : e instanceof RegExp ? e.test(t) : jr(e, t);
|
|
806
806
|
}
|
|
807
|
-
function
|
|
807
|
+
function vn(e, t) {
|
|
808
808
|
if (!e || e.length === 0) return !1;
|
|
809
|
-
for (const
|
|
810
|
-
if (
|
|
809
|
+
for (const n of e)
|
|
810
|
+
if (Vr(n, t)) return !0;
|
|
811
811
|
return !1;
|
|
812
812
|
}
|
|
813
|
-
function
|
|
814
|
-
return e === void 0 ? !0 :
|
|
813
|
+
function Yr(e, t, n) {
|
|
814
|
+
return e === void 0 ? !0 : vn(n, e) ? !1 : t && t.length > 0 ? vn(t, e) : !0;
|
|
815
815
|
}
|
|
816
|
-
function
|
|
817
|
-
return
|
|
818
|
-
() =>
|
|
819
|
-
[e, t,
|
|
816
|
+
function Gr(e, t, n) {
|
|
817
|
+
return tt(
|
|
818
|
+
() => Yr(e, t, n),
|
|
819
|
+
[e, t, n]
|
|
820
820
|
);
|
|
821
821
|
}
|
|
822
|
-
function
|
|
822
|
+
function Xr(e) {
|
|
823
823
|
return e === !1 ? { navigate: !1, thinking: !1, action: !1 } : e === void 0 || e === !0 ? { navigate: !0, thinking: !0, action: !0 } : {
|
|
824
824
|
navigate: e.navigate !== !1,
|
|
825
825
|
thinking: e.thinking !== !1,
|
|
826
826
|
action: e.action !== !1
|
|
827
827
|
};
|
|
828
828
|
}
|
|
829
|
-
function
|
|
830
|
-
const t =
|
|
831
|
-
(
|
|
829
|
+
function Kr(e) {
|
|
830
|
+
const t = tt(() => Xr(e.config), [e.config]), n = e.baseUrl.replace(/\/+$/, ""), i = I(null), a = C(
|
|
831
|
+
(c) => {
|
|
832
832
|
try {
|
|
833
|
-
new Audio(`${
|
|
833
|
+
new Audio(`${n}${c}`).play().catch(() => {
|
|
834
834
|
});
|
|
835
835
|
} catch {
|
|
836
836
|
}
|
|
837
837
|
},
|
|
838
|
-
[
|
|
838
|
+
[n]
|
|
839
839
|
), o = C(() => {
|
|
840
840
|
t.navigate && a("/audio/page-change-sound.mp3");
|
|
841
|
-
}, [t.navigate, a]),
|
|
841
|
+
}, [t.navigate, a]), s = C(() => {
|
|
842
842
|
t.action && a("/audio/confirmation-sound.mp3");
|
|
843
843
|
}, [t.action, a]), l = C(
|
|
844
|
-
(
|
|
844
|
+
(c) => {
|
|
845
845
|
if (!t.thinking) {
|
|
846
846
|
if (i.current) {
|
|
847
847
|
try {
|
|
@@ -852,10 +852,10 @@ function Gr(e) {
|
|
|
852
852
|
}
|
|
853
853
|
return;
|
|
854
854
|
}
|
|
855
|
-
if (
|
|
855
|
+
if (c) {
|
|
856
856
|
if (i.current) return;
|
|
857
857
|
try {
|
|
858
|
-
const u = new Audio(`${
|
|
858
|
+
const u = new Audio(`${n}/audio/thinking-sound.mp3`);
|
|
859
859
|
u.loop = !0, u.volume = 0.3, u.play().catch(() => {
|
|
860
860
|
i.current = null;
|
|
861
861
|
}), i.current = u;
|
|
@@ -869,7 +869,7 @@ function Gr(e) {
|
|
|
869
869
|
i.current = null;
|
|
870
870
|
}
|
|
871
871
|
},
|
|
872
|
-
[
|
|
872
|
+
[n, t.thinking]
|
|
873
873
|
);
|
|
874
874
|
return T(() => () => {
|
|
875
875
|
if (i.current) {
|
|
@@ -879,12 +879,12 @@ function Gr(e) {
|
|
|
879
879
|
}
|
|
880
880
|
i.current = null;
|
|
881
881
|
}
|
|
882
|
-
}, []),
|
|
883
|
-
() => ({ playPageChange: o, playConfirmation:
|
|
884
|
-
[o,
|
|
882
|
+
}, []), tt(
|
|
883
|
+
() => ({ playPageChange: o, playConfirmation: s, setThinking: l }),
|
|
884
|
+
[o, s, l]
|
|
885
885
|
);
|
|
886
886
|
}
|
|
887
|
-
const
|
|
887
|
+
const bn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ k(
|
|
888
888
|
"svg",
|
|
889
889
|
{
|
|
890
890
|
className: t,
|
|
@@ -894,7 +894,7 @@ const gn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ k(
|
|
|
894
894
|
strokeWidth: 2,
|
|
895
895
|
"aria-hidden": "true",
|
|
896
896
|
children: [
|
|
897
|
-
/* @__PURE__ */
|
|
897
|
+
/* @__PURE__ */ r(
|
|
898
898
|
"path",
|
|
899
899
|
{
|
|
900
900
|
strokeLinecap: "round",
|
|
@@ -902,7 +902,7 @@ const gn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ k(
|
|
|
902
902
|
d: "M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z"
|
|
903
903
|
}
|
|
904
904
|
),
|
|
905
|
-
/* @__PURE__ */
|
|
905
|
+
/* @__PURE__ */ r(
|
|
906
906
|
"path",
|
|
907
907
|
{
|
|
908
908
|
strokeLinecap: "round",
|
|
@@ -912,7 +912,7 @@ const gn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ k(
|
|
|
912
912
|
)
|
|
913
913
|
]
|
|
914
914
|
}
|
|
915
|
-
) : /* @__PURE__ */
|
|
915
|
+
) : /* @__PURE__ */ r(
|
|
916
916
|
"svg",
|
|
917
917
|
{
|
|
918
918
|
className: t,
|
|
@@ -921,7 +921,7 @@ const gn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ k(
|
|
|
921
921
|
stroke: "currentColor",
|
|
922
922
|
strokeWidth: 2,
|
|
923
923
|
"aria-hidden": "true",
|
|
924
|
-
children: /* @__PURE__ */
|
|
924
|
+
children: /* @__PURE__ */ r(
|
|
925
925
|
"path",
|
|
926
926
|
{
|
|
927
927
|
strokeLinecap: "round",
|
|
@@ -930,7 +930,7 @@ const gn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ k(
|
|
|
930
930
|
}
|
|
931
931
|
)
|
|
932
932
|
}
|
|
933
|
-
),
|
|
933
|
+
), wn = ({ className: e }) => /* @__PURE__ */ r(
|
|
934
934
|
"svg",
|
|
935
935
|
{
|
|
936
936
|
className: e,
|
|
@@ -939,7 +939,7 @@ const gn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ k(
|
|
|
939
939
|
stroke: "currentColor",
|
|
940
940
|
strokeWidth: 2,
|
|
941
941
|
"aria-hidden": "true",
|
|
942
|
-
children: /* @__PURE__ */
|
|
942
|
+
children: /* @__PURE__ */ r(
|
|
943
943
|
"path",
|
|
944
944
|
{
|
|
945
945
|
strokeLinecap: "round",
|
|
@@ -948,7 +948,7 @@ const gn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ k(
|
|
|
948
948
|
}
|
|
949
949
|
)
|
|
950
950
|
}
|
|
951
|
-
),
|
|
951
|
+
), Jr = ({ className: e }) => /* @__PURE__ */ r(
|
|
952
952
|
"svg",
|
|
953
953
|
{
|
|
954
954
|
className: e,
|
|
@@ -957,14 +957,14 @@ const gn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ k(
|
|
|
957
957
|
stroke: "currentColor",
|
|
958
958
|
strokeWidth: 2,
|
|
959
959
|
"aria-hidden": "true",
|
|
960
|
-
children: /* @__PURE__ */
|
|
960
|
+
children: /* @__PURE__ */ r("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
|
|
961
961
|
}
|
|
962
|
-
),
|
|
962
|
+
), Zr = {
|
|
963
963
|
left: 180,
|
|
964
964
|
right: 0,
|
|
965
965
|
up: -90,
|
|
966
966
|
down: 90
|
|
967
|
-
},
|
|
967
|
+
}, _n = ({ direction: e = "right", className: t }) => /* @__PURE__ */ r(
|
|
968
968
|
"svg",
|
|
969
969
|
{
|
|
970
970
|
className: t,
|
|
@@ -972,19 +972,19 @@ const gn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ k(
|
|
|
972
972
|
viewBox: "0 0 24 24",
|
|
973
973
|
stroke: "currentColor",
|
|
974
974
|
strokeWidth: 2,
|
|
975
|
-
style: { transform: `rotate(${
|
|
975
|
+
style: { transform: `rotate(${Zr[e]}deg)` },
|
|
976
976
|
"aria-hidden": "true",
|
|
977
|
-
children: /* @__PURE__ */
|
|
977
|
+
children: /* @__PURE__ */ r("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 6l6 6-6 6" })
|
|
978
978
|
}
|
|
979
979
|
);
|
|
980
|
-
function
|
|
980
|
+
function Qr(e) {
|
|
981
981
|
return e === "top-left" || e === "bottom-left" ? "left" : "right";
|
|
982
982
|
}
|
|
983
|
-
const
|
|
984
|
-
function
|
|
983
|
+
const On = "ll-hidden-tab-center-y", ei = 5, xn = 16;
|
|
984
|
+
function ti() {
|
|
985
985
|
if (typeof window > "u") return null;
|
|
986
986
|
try {
|
|
987
|
-
const e = window.localStorage.getItem(
|
|
987
|
+
const e = window.localStorage.getItem(On);
|
|
988
988
|
if (!e) return null;
|
|
989
989
|
const t = Number.parseFloat(e);
|
|
990
990
|
return Number.isFinite(t) ? t : null;
|
|
@@ -992,44 +992,44 @@ function Qr() {
|
|
|
992
992
|
return null;
|
|
993
993
|
}
|
|
994
994
|
}
|
|
995
|
-
function
|
|
995
|
+
function Ln(e) {
|
|
996
996
|
if (!(typeof window > "u"))
|
|
997
997
|
try {
|
|
998
|
-
window.localStorage.setItem(
|
|
998
|
+
window.localStorage.setItem(On, String(e));
|
|
999
999
|
} catch {
|
|
1000
1000
|
}
|
|
1001
1001
|
}
|
|
1002
|
-
const
|
|
1002
|
+
const ni = ({
|
|
1003
1003
|
position: e,
|
|
1004
1004
|
isMobile: t,
|
|
1005
|
-
isSpeaking:
|
|
1005
|
+
isSpeaking: n,
|
|
1006
1006
|
onExpand: i,
|
|
1007
1007
|
label: a = "Open widget",
|
|
1008
1008
|
avatarImageUrl: o,
|
|
1009
|
-
agentName:
|
|
1009
|
+
agentName: s,
|
|
1010
1010
|
containerEl: l
|
|
1011
1011
|
}) => {
|
|
1012
|
-
const
|
|
1012
|
+
const c = Qr(e), u = c === "right" ? "left" : "right", m = t ? 80 : 72, p = !!o, h = !!l, [P, x] = M(null), [E, y] = M(!1), w = I(null), R = I(!1), S = C(
|
|
1013
1013
|
($) => {
|
|
1014
1014
|
if (typeof window > "u") return $;
|
|
1015
|
-
const G =
|
|
1015
|
+
const G = m / 2, f = xn + G, N = window.innerHeight - xn - G;
|
|
1016
1016
|
return N < f ? Math.max(f, $) : Math.max(f, Math.min(N, $));
|
|
1017
1017
|
},
|
|
1018
|
-
[
|
|
1018
|
+
[m]
|
|
1019
1019
|
);
|
|
1020
1020
|
T(() => {
|
|
1021
1021
|
if (h) {
|
|
1022
1022
|
x(null);
|
|
1023
1023
|
return;
|
|
1024
1024
|
}
|
|
1025
|
-
const $ =
|
|
1025
|
+
const $ = ti();
|
|
1026
1026
|
x(S($ ?? window.innerHeight / 2));
|
|
1027
1027
|
const G = () => {
|
|
1028
1028
|
x((f) => f === null ? null : S(f));
|
|
1029
1029
|
};
|
|
1030
1030
|
return window.addEventListener("resize", G), () => window.removeEventListener("resize", G);
|
|
1031
1031
|
}, [S, h]);
|
|
1032
|
-
const
|
|
1032
|
+
const v = C(
|
|
1033
1033
|
($) => {
|
|
1034
1034
|
if (!h && !($.pointerType === "mouse" && $.button !== 0) && P !== null) {
|
|
1035
1035
|
try {
|
|
@@ -1049,10 +1049,10 @@ const ei = ({
|
|
|
1049
1049
|
const G = w.current;
|
|
1050
1050
|
if (!G) return;
|
|
1051
1051
|
const f = $.clientY - G.startClientY;
|
|
1052
|
-
!G.moved && Math.abs(f) >
|
|
1052
|
+
!G.moved && Math.abs(f) > ei && (G.moved = !0, y(!0)), G.moved && x(S(G.startCenterY + f));
|
|
1053
1053
|
},
|
|
1054
1054
|
[S]
|
|
1055
|
-
),
|
|
1055
|
+
), g = C(
|
|
1056
1056
|
($) => {
|
|
1057
1057
|
const G = w.current;
|
|
1058
1058
|
if (G) {
|
|
@@ -1060,7 +1060,7 @@ const ei = ({
|
|
|
1060
1060
|
$.currentTarget.releasePointerCapture($.pointerId);
|
|
1061
1061
|
} catch {
|
|
1062
1062
|
}
|
|
1063
|
-
w.current = null, G.moved && (
|
|
1063
|
+
w.current = null, G.moved && (y(!1), R.current = !0, x((f) => (f !== null && Ln(f), f)));
|
|
1064
1064
|
}
|
|
1065
1065
|
},
|
|
1066
1066
|
[]
|
|
@@ -1078,29 +1078,29 @@ const ei = ({
|
|
|
1078
1078
|
x((f) => {
|
|
1079
1079
|
if (f === null) return f;
|
|
1080
1080
|
const N = S(f + G);
|
|
1081
|
-
return
|
|
1081
|
+
return Ln(N), N;
|
|
1082
1082
|
});
|
|
1083
1083
|
}
|
|
1084
1084
|
},
|
|
1085
1085
|
[S]
|
|
1086
1086
|
), K = [
|
|
1087
1087
|
"ll-hidden",
|
|
1088
|
-
`ll-hidden--${
|
|
1088
|
+
`ll-hidden--${c}`,
|
|
1089
1089
|
t ? "ll-hidden--mobile" : "ll-hidden--desktop",
|
|
1090
|
-
|
|
1090
|
+
n ? "ll-hidden--speaking" : null,
|
|
1091
1091
|
E ? "is-dragging" : null,
|
|
1092
1092
|
p ? "ll-hidden--with-avatar" : null,
|
|
1093
1093
|
h ? "ll-hidden--scoped" : null
|
|
1094
|
-
].filter(Boolean).join(" "), ae = P === null ? void 0 : { top: `${P -
|
|
1095
|
-
return /* @__PURE__ */
|
|
1094
|
+
].filter(Boolean).join(" "), ae = P === null ? void 0 : { top: `${P - m / 2}px`, transform: "none" };
|
|
1095
|
+
return /* @__PURE__ */ r(
|
|
1096
1096
|
"button",
|
|
1097
1097
|
{
|
|
1098
1098
|
type: "button",
|
|
1099
1099
|
className: K,
|
|
1100
|
-
onPointerDown:
|
|
1100
|
+
onPointerDown: v,
|
|
1101
1101
|
onPointerMove: O,
|
|
1102
|
-
onPointerUp:
|
|
1103
|
-
onPointerCancel:
|
|
1102
|
+
onPointerUp: g,
|
|
1103
|
+
onPointerCancel: g,
|
|
1104
1104
|
onClick: D,
|
|
1105
1105
|
onKeyDown: W,
|
|
1106
1106
|
"aria-label": a,
|
|
@@ -1111,26 +1111,26 @@ const ei = ({
|
|
|
1111
1111
|
// as the click affordance), then the circular avatar photo
|
|
1112
1112
|
// taking the rest of the tab. Reinforces "this is an
|
|
1113
1113
|
// avatar-based experience" even when collapsed.
|
|
1114
|
-
/* @__PURE__ */ k(
|
|
1115
|
-
/* @__PURE__ */
|
|
1116
|
-
|
|
1114
|
+
/* @__PURE__ */ k(We, { children: [
|
|
1115
|
+
/* @__PURE__ */ r(
|
|
1116
|
+
_n,
|
|
1117
1117
|
{
|
|
1118
1118
|
direction: u,
|
|
1119
1119
|
className: "ll-hidden__chevron ll-hidden__chevron--mini"
|
|
1120
1120
|
}
|
|
1121
1121
|
),
|
|
1122
|
-
/* @__PURE__ */
|
|
1122
|
+
/* @__PURE__ */ r(
|
|
1123
1123
|
"img",
|
|
1124
1124
|
{
|
|
1125
1125
|
src: o,
|
|
1126
|
-
alt:
|
|
1126
|
+
alt: s ? `${s} avatar` : "Agent avatar",
|
|
1127
1127
|
className: "ll-hidden__avatar",
|
|
1128
1128
|
draggable: !1
|
|
1129
1129
|
}
|
|
1130
1130
|
)
|
|
1131
1131
|
] })
|
|
1132
|
-
) : /* @__PURE__ */
|
|
1133
|
-
|
|
1132
|
+
) : /* @__PURE__ */ r(
|
|
1133
|
+
_n,
|
|
1134
1134
|
{
|
|
1135
1135
|
direction: u,
|
|
1136
1136
|
className: "ll-hidden__chevron"
|
|
@@ -1138,28 +1138,28 @@ const ei = ({
|
|
|
1138
1138
|
)
|
|
1139
1139
|
}
|
|
1140
1140
|
);
|
|
1141
|
-
},
|
|
1141
|
+
}, ri = ({
|
|
1142
1142
|
audioLevel: e,
|
|
1143
1143
|
bars: t = 20,
|
|
1144
|
-
maxHeight:
|
|
1144
|
+
maxHeight: n = 20,
|
|
1145
1145
|
minHeight: i = 4,
|
|
1146
1146
|
className: a,
|
|
1147
1147
|
barClassName: o
|
|
1148
1148
|
}) => {
|
|
1149
|
-
const
|
|
1150
|
-
const
|
|
1151
|
-
return Array.from({ length: t }, (p, h) => 0.5 + h *
|
|
1149
|
+
const s = I(null), l = I([]), c = tt(() => {
|
|
1150
|
+
const m = (Math.sqrt(5) - 1) / 2;
|
|
1151
|
+
return Array.from({ length: t }, (p, h) => 0.5 + h * m % 1 * 0.5);
|
|
1152
1152
|
}, [t]);
|
|
1153
1153
|
T(() => e.subscribe((p) => {
|
|
1154
1154
|
for (let h = 0; h < t; h++) {
|
|
1155
1155
|
const P = l.current[h];
|
|
1156
1156
|
if (!P) continue;
|
|
1157
|
-
const x = Math.max(i, p *
|
|
1157
|
+
const x = Math.max(i, p * n * c[h]);
|
|
1158
1158
|
P.style.height = `${x}px`;
|
|
1159
1159
|
}
|
|
1160
|
-
}), [e, t,
|
|
1160
|
+
}), [e, t, n, i, c]);
|
|
1161
1161
|
const u = ["ll-waveform", a].filter(Boolean).join(" ");
|
|
1162
|
-
return /* @__PURE__ */
|
|
1162
|
+
return /* @__PURE__ */ r("div", { ref: s, className: u, "aria-hidden": "true", children: Array.from({ length: t }, (m, p) => /* @__PURE__ */ r(
|
|
1163
1163
|
"div",
|
|
1164
1164
|
{
|
|
1165
1165
|
ref: (h) => {
|
|
@@ -1170,144 +1170,144 @@ const ei = ({
|
|
|
1170
1170
|
},
|
|
1171
1171
|
p
|
|
1172
1172
|
)) });
|
|
1173
|
-
},
|
|
1173
|
+
}, ii = ({
|
|
1174
1174
|
position: e,
|
|
1175
1175
|
isMobile: t,
|
|
1176
|
-
agentName:
|
|
1176
|
+
agentName: n,
|
|
1177
1177
|
avatarImageUrl: i,
|
|
1178
1178
|
agentState: a,
|
|
1179
1179
|
isMuted: o,
|
|
1180
|
-
audioLevel:
|
|
1180
|
+
audioLevel: s,
|
|
1181
1181
|
onExpand: l,
|
|
1182
|
-
onToggleMute:
|
|
1182
|
+
onToggleMute: c,
|
|
1183
1183
|
onClose: u
|
|
1184
|
-
}) => t ? /* @__PURE__ */
|
|
1184
|
+
}) => t ? /* @__PURE__ */ r(
|
|
1185
1185
|
"div",
|
|
1186
1186
|
{
|
|
1187
1187
|
className: "ll-minimized ll-minimized--mobile",
|
|
1188
1188
|
role: "region",
|
|
1189
|
-
"aria-label": `${
|
|
1189
|
+
"aria-label": `${n} widget`,
|
|
1190
1190
|
children: /* @__PURE__ */ k(
|
|
1191
1191
|
"button",
|
|
1192
1192
|
{
|
|
1193
1193
|
type: "button",
|
|
1194
1194
|
className: "ll-minimized__surface",
|
|
1195
1195
|
onClick: l,
|
|
1196
|
-
"aria-label": `Expand ${
|
|
1196
|
+
"aria-label": `Expand ${n} widget`,
|
|
1197
1197
|
children: [
|
|
1198
1198
|
i ? (
|
|
1199
1199
|
// eslint-disable-next-line @next/next/no-img-element
|
|
1200
|
-
/* @__PURE__ */
|
|
1200
|
+
/* @__PURE__ */ r(
|
|
1201
1201
|
"img",
|
|
1202
1202
|
{
|
|
1203
1203
|
src: i,
|
|
1204
|
-
alt:
|
|
1204
|
+
alt: n,
|
|
1205
1205
|
className: "ll-minimized__avatar"
|
|
1206
1206
|
}
|
|
1207
1207
|
)
|
|
1208
|
-
) : /* @__PURE__ */
|
|
1209
|
-
/* @__PURE__ */
|
|
1210
|
-
|
|
1208
|
+
) : /* @__PURE__ */ r("div", { className: "ll-minimized__avatar ll-minimized__avatar--placeholder" }),
|
|
1209
|
+
/* @__PURE__ */ r(
|
|
1210
|
+
ri,
|
|
1211
1211
|
{
|
|
1212
|
-
audioLevel:
|
|
1212
|
+
audioLevel: s,
|
|
1213
1213
|
bars: 16,
|
|
1214
1214
|
maxHeight: 18,
|
|
1215
1215
|
className: "ll-minimized__waveform"
|
|
1216
1216
|
}
|
|
1217
1217
|
),
|
|
1218
|
-
/* @__PURE__ */
|
|
1218
|
+
/* @__PURE__ */ r("span", { className: "ll-minimized__name", children: n }),
|
|
1219
1219
|
/* @__PURE__ */ k("div", { className: "ll-minimized__controls", children: [
|
|
1220
|
-
/* @__PURE__ */
|
|
1220
|
+
/* @__PURE__ */ r(
|
|
1221
1221
|
"span",
|
|
1222
1222
|
{
|
|
1223
1223
|
className: "ll-minimized__btn",
|
|
1224
1224
|
role: "button",
|
|
1225
1225
|
tabIndex: 0,
|
|
1226
|
-
onClick: (
|
|
1227
|
-
|
|
1226
|
+
onClick: (m) => {
|
|
1227
|
+
m.stopPropagation(), c();
|
|
1228
1228
|
},
|
|
1229
|
-
onKeyDown: (
|
|
1230
|
-
(
|
|
1229
|
+
onKeyDown: (m) => {
|
|
1230
|
+
(m.key === "Enter" || m.key === " ") && (m.stopPropagation(), m.preventDefault(), c());
|
|
1231
1231
|
},
|
|
1232
1232
|
"aria-label": o ? "Unmute microphone" : "Mute microphone",
|
|
1233
|
-
children: /* @__PURE__ */
|
|
1233
|
+
children: /* @__PURE__ */ r(bn, { muted: o, className: "ll-minimized__icon" })
|
|
1234
1234
|
}
|
|
1235
1235
|
),
|
|
1236
|
-
/* @__PURE__ */
|
|
1236
|
+
/* @__PURE__ */ r(wn, { className: "ll-minimized__icon ll-minimized__icon--expand" })
|
|
1237
1237
|
] })
|
|
1238
1238
|
]
|
|
1239
1239
|
}
|
|
1240
1240
|
)
|
|
1241
1241
|
}
|
|
1242
|
-
) : /* @__PURE__ */
|
|
1242
|
+
) : /* @__PURE__ */ r(
|
|
1243
1243
|
"div",
|
|
1244
1244
|
{
|
|
1245
1245
|
className: "ll-minimized ll-minimized--desktop",
|
|
1246
1246
|
"data-position": e,
|
|
1247
1247
|
role: "region",
|
|
1248
|
-
"aria-label": `${
|
|
1248
|
+
"aria-label": `${n} widget`,
|
|
1249
1249
|
children: /* @__PURE__ */ k("div", { className: "ll-minimized__surface", children: [
|
|
1250
1250
|
i ? (
|
|
1251
1251
|
// eslint-disable-next-line @next/next/no-img-element
|
|
1252
|
-
/* @__PURE__ */
|
|
1252
|
+
/* @__PURE__ */ r(
|
|
1253
1253
|
"img",
|
|
1254
1254
|
{
|
|
1255
1255
|
src: i,
|
|
1256
|
-
alt:
|
|
1256
|
+
alt: n,
|
|
1257
1257
|
className: "ll-minimized__avatar"
|
|
1258
1258
|
}
|
|
1259
1259
|
)
|
|
1260
|
-
) : /* @__PURE__ */
|
|
1260
|
+
) : /* @__PURE__ */ r("div", { className: "ll-minimized__avatar ll-minimized__avatar--placeholder" }),
|
|
1261
1261
|
/* @__PURE__ */ k("div", { className: "ll-minimized__meta", children: [
|
|
1262
|
-
/* @__PURE__ */
|
|
1263
|
-
/* @__PURE__ */
|
|
1262
|
+
/* @__PURE__ */ r("span", { className: "ll-minimized__name", children: n }),
|
|
1263
|
+
/* @__PURE__ */ r("span", { className: "ll-minimized__state", children: a === "speaking" ? "Speaking" : a === "thinking" ? "Thinking" : "Listening" })
|
|
1264
1264
|
] }),
|
|
1265
1265
|
/* @__PURE__ */ k("div", { className: "ll-minimized__controls", children: [
|
|
1266
|
-
/* @__PURE__ */
|
|
1266
|
+
/* @__PURE__ */ r(
|
|
1267
1267
|
"button",
|
|
1268
1268
|
{
|
|
1269
1269
|
type: "button",
|
|
1270
1270
|
className: "ll-minimized__btn",
|
|
1271
|
-
onClick:
|
|
1271
|
+
onClick: c,
|
|
1272
1272
|
"aria-label": o ? "Unmute microphone" : "Mute microphone",
|
|
1273
|
-
children: /* @__PURE__ */
|
|
1273
|
+
children: /* @__PURE__ */ r(bn, { muted: o, className: "ll-minimized__icon" })
|
|
1274
1274
|
}
|
|
1275
1275
|
),
|
|
1276
|
-
/* @__PURE__ */
|
|
1276
|
+
/* @__PURE__ */ r(
|
|
1277
1277
|
"button",
|
|
1278
1278
|
{
|
|
1279
1279
|
type: "button",
|
|
1280
1280
|
className: "ll-minimized__btn",
|
|
1281
1281
|
onClick: l,
|
|
1282
|
-
"aria-label": `Expand ${
|
|
1283
|
-
children: /* @__PURE__ */
|
|
1282
|
+
"aria-label": `Expand ${n} widget`,
|
|
1283
|
+
children: /* @__PURE__ */ r(wn, { className: "ll-minimized__icon" })
|
|
1284
1284
|
}
|
|
1285
1285
|
),
|
|
1286
|
-
/* @__PURE__ */
|
|
1286
|
+
/* @__PURE__ */ r(
|
|
1287
1287
|
"button",
|
|
1288
1288
|
{
|
|
1289
1289
|
type: "button",
|
|
1290
1290
|
className: "ll-minimized__btn ll-minimized__btn--close",
|
|
1291
1291
|
onClick: u,
|
|
1292
1292
|
"aria-label": "Close widget",
|
|
1293
|
-
children: /* @__PURE__ */
|
|
1293
|
+
children: /* @__PURE__ */ r(Jr, { className: "ll-minimized__icon" })
|
|
1294
1294
|
}
|
|
1295
1295
|
)
|
|
1296
1296
|
] })
|
|
1297
1297
|
] })
|
|
1298
1298
|
}
|
|
1299
|
-
),
|
|
1299
|
+
), oi = ({
|
|
1300
1300
|
src: e,
|
|
1301
1301
|
alt: t,
|
|
1302
|
-
preCannedPlaying:
|
|
1302
|
+
preCannedPlaying: n = !1,
|
|
1303
1303
|
className: i,
|
|
1304
1304
|
style: a
|
|
1305
1305
|
}) => {
|
|
1306
|
-
const [o,
|
|
1306
|
+
const [o, s] = M(!1), l = I(e);
|
|
1307
1307
|
if (T(() => {
|
|
1308
|
-
l.current !== e && (l.current = e,
|
|
1308
|
+
l.current !== e && (l.current = e, s(!1));
|
|
1309
1309
|
}, [e]), !e) return null;
|
|
1310
|
-
const
|
|
1310
|
+
const c = {
|
|
1311
1311
|
position: "absolute",
|
|
1312
1312
|
inset: 0,
|
|
1313
1313
|
width: "100%",
|
|
@@ -1315,30 +1315,30 @@ const ei = ({
|
|
|
1315
1315
|
objectFit: "cover",
|
|
1316
1316
|
objectPosition: "top",
|
|
1317
1317
|
transition: "opacity 500ms ease, transform 500ms ease",
|
|
1318
|
-
transform:
|
|
1318
|
+
transform: n ? "scale(1.02)" : "scale(1)",
|
|
1319
1319
|
opacity: o ? 1 : 0,
|
|
1320
1320
|
...a
|
|
1321
1321
|
};
|
|
1322
1322
|
return (
|
|
1323
1323
|
// eslint-disable-next-line @next/next/no-img-element
|
|
1324
|
-
/* @__PURE__ */
|
|
1324
|
+
/* @__PURE__ */ r(
|
|
1325
1325
|
"img",
|
|
1326
1326
|
{
|
|
1327
1327
|
src: e,
|
|
1328
1328
|
alt: t,
|
|
1329
1329
|
className: i,
|
|
1330
|
-
style:
|
|
1330
|
+
style: c,
|
|
1331
1331
|
loading: "eager",
|
|
1332
1332
|
fetchPriority: "high",
|
|
1333
|
-
onLoad: () =>
|
|
1333
|
+
onLoad: () => s(!0)
|
|
1334
1334
|
}
|
|
1335
1335
|
)
|
|
1336
1336
|
);
|
|
1337
|
-
},
|
|
1338
|
-
function
|
|
1337
|
+
}, li = "#E06540";
|
|
1338
|
+
function ai({
|
|
1339
1339
|
size: e = 14,
|
|
1340
1340
|
className: t,
|
|
1341
|
-
fill:
|
|
1341
|
+
fill: n = li
|
|
1342
1342
|
}) {
|
|
1343
1343
|
return /* @__PURE__ */ k(
|
|
1344
1344
|
"svg",
|
|
@@ -1351,68 +1351,68 @@ function oi({
|
|
|
1351
1351
|
className: t,
|
|
1352
1352
|
"aria-hidden": !0,
|
|
1353
1353
|
children: [
|
|
1354
|
-
/* @__PURE__ */
|
|
1354
|
+
/* @__PURE__ */ r(
|
|
1355
1355
|
"path",
|
|
1356
1356
|
{
|
|
1357
1357
|
d: "M44.5714 26C44.5714 23.5612 44.0908 21.146 43.1575 18.8928C42.2242 16.6397 40.8565 14.5924 39.132 12.868C37.4076 11.1435 35.3603 9.77577 33.1072 8.84247C30.854 7.90917 28.4388 7.42857 26 7.42857C23.5612 7.42857 21.146 7.90916 18.8928 8.84247C16.6397 9.77577 14.5924 11.1435 12.868 12.868C11.1435 14.5924 9.77577 16.6397 8.84247 18.8928C7.90917 21.146 7.42857 23.5612 7.42857 26C7.42857 28.4388 7.90916 30.854 8.84247 33.1072C9.77577 35.3603 11.1435 37.4076 12.868 39.132C14.5924 40.8565 16.6397 42.2242 18.8928 43.1575C21.146 44.0908 23.5612 44.5714 26 44.5714H48.2857C50.3371 44.5714 52 46.2344 52 48.2857C52 50.3371 50.3371 52 48.2857 52H26C22.5857 52 19.2049 51.3275 16.0505 50.021C12.896 48.7144 10.0293 46.7993 7.61501 44.385C5.20069 41.9707 3.28564 39.104 1.97902 35.9495C0.67247 32.7951 -3.54212e-07 29.4143 0 26C-1.68163e-07 22.5857 0.672469 19.2049 1.97902 16.0505C3.28564 12.896 5.20069 10.0293 7.61501 7.61501C10.0293 5.20069 12.896 3.28564 16.0505 1.97902C19.2049 0.67247 22.5857 0 26 0C29.4143 1.86048e-07 32.7951 0.67247 35.9495 1.97902C39.104 3.28564 41.9707 5.20069 44.385 7.61501C46.7993 10.0293 48.7144 12.896 50.021 16.0505C51.3275 19.2049 52 22.5857 52 26C52 28.0513 50.3371 29.7143 48.2857 29.7143C46.2344 29.7143 44.5714 28.0513 44.5714 26Z",
|
|
1358
|
-
fill:
|
|
1358
|
+
fill: n
|
|
1359
1359
|
}
|
|
1360
1360
|
),
|
|
1361
|
-
/* @__PURE__ */
|
|
1361
|
+
/* @__PURE__ */ r(
|
|
1362
1362
|
"path",
|
|
1363
1363
|
{
|
|
1364
1364
|
d: "M28.9717 23.7714C28.9717 21.3098 30.9672 19.3143 33.4288 19.3143C35.8904 19.3143 37.886 21.3098 37.886 23.7714C37.886 26.233 35.8904 28.2286 33.4288 28.2286C30.9672 28.2286 28.9717 26.233 28.9717 23.7714Z",
|
|
1365
|
-
fill:
|
|
1365
|
+
fill: n
|
|
1366
1366
|
}
|
|
1367
1367
|
),
|
|
1368
|
-
/* @__PURE__ */
|
|
1368
|
+
/* @__PURE__ */ r(
|
|
1369
1369
|
"path",
|
|
1370
1370
|
{
|
|
1371
1371
|
d: "M18.5714 19.3143C16.1098 19.3143 14.1143 21.3098 14.1143 23.7714C14.1143 26.233 16.1098 28.2286 18.5714 28.2286C21.033 28.2286 23.0285 26.233 23.0285 23.7714C23.0285 21.3098 21.033 19.3143 18.5714 19.3143Z",
|
|
1372
|
-
fill:
|
|
1372
|
+
fill: n
|
|
1373
1373
|
}
|
|
1374
1374
|
)
|
|
1375
1375
|
]
|
|
1376
1376
|
}
|
|
1377
1377
|
);
|
|
1378
1378
|
}
|
|
1379
|
-
const
|
|
1379
|
+
const si = 8, Cn = 8, ci = ({
|
|
1380
1380
|
open: e,
|
|
1381
1381
|
onClose: t,
|
|
1382
|
-
anchorRef:
|
|
1382
|
+
anchorRef: n,
|
|
1383
1383
|
children: i
|
|
1384
1384
|
}) => {
|
|
1385
|
-
const a = I(null), [o,
|
|
1386
|
-
return
|
|
1385
|
+
const a = I(null), [o, s] = M(null);
|
|
1386
|
+
return Dn(() => {
|
|
1387
1387
|
if (!e) {
|
|
1388
|
-
|
|
1388
|
+
s(null);
|
|
1389
1389
|
return;
|
|
1390
1390
|
}
|
|
1391
|
-
const l =
|
|
1391
|
+
const l = n.current;
|
|
1392
1392
|
if (!l) return;
|
|
1393
|
-
const
|
|
1394
|
-
const u = l.getBoundingClientRect(),
|
|
1395
|
-
top: u.top -
|
|
1393
|
+
const c = () => {
|
|
1394
|
+
const u = l.getBoundingClientRect(), m = {
|
|
1395
|
+
top: u.top - si,
|
|
1396
1396
|
left: u.left + u.width / 2
|
|
1397
|
-
}, p =
|
|
1398
|
-
|
|
1397
|
+
}, p = Cn + 90, h = window.innerWidth - Cn - 90;
|
|
1398
|
+
m.left < p && (m.left = p), m.left > h && (m.left = h), s(m);
|
|
1399
1399
|
};
|
|
1400
|
-
return
|
|
1401
|
-
window.removeEventListener("scroll",
|
|
1400
|
+
return c(), window.addEventListener("scroll", c, !0), window.addEventListener("resize", c), () => {
|
|
1401
|
+
window.removeEventListener("scroll", c, !0), window.removeEventListener("resize", c);
|
|
1402
1402
|
};
|
|
1403
|
-
}, [e,
|
|
1403
|
+
}, [e, n]), T(() => {
|
|
1404
1404
|
if (!e) return;
|
|
1405
1405
|
const l = (u) => {
|
|
1406
|
-
const
|
|
1407
|
-
p && p.contains(
|
|
1408
|
-
},
|
|
1406
|
+
const m = u.target, p = a.current, h = n.current;
|
|
1407
|
+
p && p.contains(m) || h && h.contains(m) || t();
|
|
1408
|
+
}, c = (u) => {
|
|
1409
1409
|
u.key === "Escape" && (u.stopPropagation(), t());
|
|
1410
1410
|
};
|
|
1411
|
-
return document.addEventListener("mousedown", l), document.addEventListener("keydown",
|
|
1412
|
-
document.removeEventListener("mousedown", l), document.removeEventListener("keydown",
|
|
1411
|
+
return document.addEventListener("mousedown", l), document.addEventListener("keydown", c), () => {
|
|
1412
|
+
document.removeEventListener("mousedown", l), document.removeEventListener("keydown", c);
|
|
1413
1413
|
};
|
|
1414
|
-
}, [e, t,
|
|
1415
|
-
/* @__PURE__ */
|
|
1414
|
+
}, [e, t, n]), !e || o === null || typeof document > "u" ? null : Xt(
|
|
1415
|
+
/* @__PURE__ */ r(
|
|
1416
1416
|
"div",
|
|
1417
1417
|
{
|
|
1418
1418
|
ref: a,
|
|
@@ -1431,24 +1431,24 @@ const li = 8, _n = 8, ai = ({
|
|
|
1431
1431
|
),
|
|
1432
1432
|
document.body
|
|
1433
1433
|
);
|
|
1434
|
-
},
|
|
1434
|
+
}, ui = ({
|
|
1435
1435
|
isMuted: e,
|
|
1436
1436
|
onToggleMute: t,
|
|
1437
|
-
isCameraEnabled:
|
|
1437
|
+
isCameraEnabled: n,
|
|
1438
1438
|
onToggleCamera: i,
|
|
1439
1439
|
allowCamera: a,
|
|
1440
1440
|
isScreenShareEnabled: o,
|
|
1441
|
-
onToggleScreenShare:
|
|
1441
|
+
onToggleScreenShare: s,
|
|
1442
1442
|
allowScreenShare: l,
|
|
1443
|
-
isSpeakerMuted:
|
|
1443
|
+
isSpeakerMuted: c,
|
|
1444
1444
|
onToggleSpeaker: u,
|
|
1445
|
-
allowTyping:
|
|
1445
|
+
allowTyping: m,
|
|
1446
1446
|
isTypingOpen: p,
|
|
1447
1447
|
onToggleTyping: h,
|
|
1448
1448
|
onDisconnect: P
|
|
1449
1449
|
}) => {
|
|
1450
|
-
const [x, E] = M(!1),
|
|
1451
|
-
return /* @__PURE__ */ k(
|
|
1450
|
+
const [x, E] = M(!1), y = I(null);
|
|
1451
|
+
return /* @__PURE__ */ k(We, { children: [
|
|
1452
1452
|
/* @__PURE__ */ k(
|
|
1453
1453
|
"div",
|
|
1454
1454
|
{
|
|
@@ -1456,60 +1456,60 @@ const li = 8, _n = 8, ai = ({
|
|
|
1456
1456
|
"data-testid": "compact-toolbar",
|
|
1457
1457
|
onClick: (w) => w.stopPropagation(),
|
|
1458
1458
|
children: [
|
|
1459
|
-
/* @__PURE__ */
|
|
1459
|
+
/* @__PURE__ */ r(
|
|
1460
1460
|
"button",
|
|
1461
1461
|
{
|
|
1462
1462
|
type: "button",
|
|
1463
1463
|
className: `ll-tool ${e ? "is-muted" : ""}`,
|
|
1464
1464
|
onClick: t,
|
|
1465
1465
|
"aria-label": e ? "Unmute microphone" : "Mute microphone",
|
|
1466
|
-
children: /* @__PURE__ */
|
|
1466
|
+
children: /* @__PURE__ */ r(Bn, { muted: e })
|
|
1467
1467
|
}
|
|
1468
1468
|
),
|
|
1469
|
-
/* @__PURE__ */
|
|
1469
|
+
/* @__PURE__ */ r(
|
|
1470
1470
|
"button",
|
|
1471
1471
|
{
|
|
1472
|
-
ref:
|
|
1472
|
+
ref: y,
|
|
1473
1473
|
type: "button",
|
|
1474
1474
|
className: `ll-tool ${x ? "is-on" : ""}`,
|
|
1475
1475
|
onClick: () => E((w) => !w),
|
|
1476
1476
|
"aria-label": "More controls",
|
|
1477
1477
|
"aria-haspopup": "menu",
|
|
1478
1478
|
"aria-expanded": x,
|
|
1479
|
-
children: /* @__PURE__ */
|
|
1479
|
+
children: /* @__PURE__ */ r(di, {})
|
|
1480
1480
|
}
|
|
1481
1481
|
),
|
|
1482
|
-
/* @__PURE__ */
|
|
1482
|
+
/* @__PURE__ */ r(
|
|
1483
1483
|
"button",
|
|
1484
1484
|
{
|
|
1485
1485
|
type: "button",
|
|
1486
1486
|
className: "ll-tool ll-tool--danger",
|
|
1487
1487
|
onClick: P,
|
|
1488
1488
|
"aria-label": "End conversation",
|
|
1489
|
-
children: /* @__PURE__ */
|
|
1489
|
+
children: /* @__PURE__ */ r(Un, {})
|
|
1490
1490
|
}
|
|
1491
1491
|
)
|
|
1492
1492
|
]
|
|
1493
1493
|
}
|
|
1494
1494
|
),
|
|
1495
1495
|
/* @__PURE__ */ k(
|
|
1496
|
-
|
|
1496
|
+
ci,
|
|
1497
1497
|
{
|
|
1498
1498
|
open: x,
|
|
1499
1499
|
onClose: () => E(!1),
|
|
1500
|
-
anchorRef:
|
|
1500
|
+
anchorRef: y,
|
|
1501
1501
|
children: [
|
|
1502
1502
|
a && /* @__PURE__ */ k(
|
|
1503
1503
|
"button",
|
|
1504
1504
|
{
|
|
1505
1505
|
type: "button",
|
|
1506
|
-
className: `ll-overflow-popover__item ${
|
|
1506
|
+
className: `ll-overflow-popover__item ${n ? "is-on" : ""}`,
|
|
1507
1507
|
onClick: () => {
|
|
1508
1508
|
i(), E(!1);
|
|
1509
1509
|
},
|
|
1510
1510
|
children: [
|
|
1511
|
-
/* @__PURE__ */
|
|
1512
|
-
/* @__PURE__ */
|
|
1511
|
+
/* @__PURE__ */ r(Wn, {}),
|
|
1512
|
+
/* @__PURE__ */ r("span", { children: n ? "Stop camera" : "Start camera" })
|
|
1513
1513
|
]
|
|
1514
1514
|
}
|
|
1515
1515
|
),
|
|
@@ -1519,11 +1519,11 @@ const li = 8, _n = 8, ai = ({
|
|
|
1519
1519
|
type: "button",
|
|
1520
1520
|
className: `ll-overflow-popover__item ${o ? "is-on" : ""}`,
|
|
1521
1521
|
onClick: () => {
|
|
1522
|
-
|
|
1522
|
+
s(), E(!1);
|
|
1523
1523
|
},
|
|
1524
1524
|
children: [
|
|
1525
|
-
/* @__PURE__ */
|
|
1526
|
-
/* @__PURE__ */
|
|
1525
|
+
/* @__PURE__ */ r(Fn, {}),
|
|
1526
|
+
/* @__PURE__ */ r("span", { children: o ? "Stop sharing" : "Share screen" })
|
|
1527
1527
|
]
|
|
1528
1528
|
}
|
|
1529
1529
|
),
|
|
@@ -1531,17 +1531,17 @@ const li = 8, _n = 8, ai = ({
|
|
|
1531
1531
|
"button",
|
|
1532
1532
|
{
|
|
1533
1533
|
type: "button",
|
|
1534
|
-
className: `ll-overflow-popover__item ${
|
|
1534
|
+
className: `ll-overflow-popover__item ${c ? "is-on" : ""}`,
|
|
1535
1535
|
onClick: () => {
|
|
1536
1536
|
u(), E(!1);
|
|
1537
1537
|
},
|
|
1538
1538
|
children: [
|
|
1539
|
-
/* @__PURE__ */
|
|
1540
|
-
/* @__PURE__ */
|
|
1539
|
+
/* @__PURE__ */ r(qn, { muted: c }),
|
|
1540
|
+
/* @__PURE__ */ r("span", { children: c ? "Unmute speaker" : "Mute speaker" })
|
|
1541
1541
|
]
|
|
1542
1542
|
}
|
|
1543
1543
|
),
|
|
1544
|
-
|
|
1544
|
+
m && /* @__PURE__ */ k(
|
|
1545
1545
|
"button",
|
|
1546
1546
|
{
|
|
1547
1547
|
type: "button",
|
|
@@ -1550,8 +1550,8 @@ const li = 8, _n = 8, ai = ({
|
|
|
1550
1550
|
h(), E(!1);
|
|
1551
1551
|
},
|
|
1552
1552
|
children: [
|
|
1553
|
-
/* @__PURE__ */
|
|
1554
|
-
/* @__PURE__ */
|
|
1553
|
+
/* @__PURE__ */ r(fi, {}),
|
|
1554
|
+
/* @__PURE__ */ r("span", { children: p ? "Hide typing" : "Type a message" })
|
|
1555
1555
|
]
|
|
1556
1556
|
}
|
|
1557
1557
|
),
|
|
@@ -1563,8 +1563,8 @@ const li = 8, _n = 8, ai = ({
|
|
|
1563
1563
|
disabled: !0,
|
|
1564
1564
|
"aria-current": "true",
|
|
1565
1565
|
children: [
|
|
1566
|
-
/* @__PURE__ */
|
|
1567
|
-
/* @__PURE__ */
|
|
1566
|
+
/* @__PURE__ */ r("span", { className: "ll-overflow-popover__lang-code", children: "EN" }),
|
|
1567
|
+
/* @__PURE__ */ r("span", { children: "English" })
|
|
1568
1568
|
]
|
|
1569
1569
|
}
|
|
1570
1570
|
)
|
|
@@ -1573,7 +1573,7 @@ const li = 8, _n = 8, ai = ({
|
|
|
1573
1573
|
)
|
|
1574
1574
|
] });
|
|
1575
1575
|
};
|
|
1576
|
-
function
|
|
1576
|
+
function di() {
|
|
1577
1577
|
return /* @__PURE__ */ k(
|
|
1578
1578
|
"svg",
|
|
1579
1579
|
{
|
|
@@ -1583,15 +1583,15 @@ function ci() {
|
|
|
1583
1583
|
fill: "currentColor",
|
|
1584
1584
|
"aria-hidden": !0,
|
|
1585
1585
|
children: [
|
|
1586
|
-
/* @__PURE__ */
|
|
1587
|
-
/* @__PURE__ */
|
|
1588
|
-
/* @__PURE__ */
|
|
1586
|
+
/* @__PURE__ */ r("circle", { cx: "6", cy: "12", r: "1.5" }),
|
|
1587
|
+
/* @__PURE__ */ r("circle", { cx: "12", cy: "12", r: "1.5" }),
|
|
1588
|
+
/* @__PURE__ */ r("circle", { cx: "18", cy: "12", r: "1.5" })
|
|
1589
1589
|
]
|
|
1590
1590
|
}
|
|
1591
1591
|
);
|
|
1592
1592
|
}
|
|
1593
|
-
function
|
|
1594
|
-
return /* @__PURE__ */
|
|
1593
|
+
function fi() {
|
|
1594
|
+
return /* @__PURE__ */ r(
|
|
1595
1595
|
"svg",
|
|
1596
1596
|
{
|
|
1597
1597
|
width: "16",
|
|
@@ -1603,34 +1603,34 @@ function ui() {
|
|
|
1603
1603
|
strokeLinecap: "round",
|
|
1604
1604
|
strokeLinejoin: "round",
|
|
1605
1605
|
"aria-hidden": !0,
|
|
1606
|
-
children: /* @__PURE__ */
|
|
1606
|
+
children: /* @__PURE__ */ r("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" })
|
|
1607
1607
|
}
|
|
1608
1608
|
);
|
|
1609
1609
|
}
|
|
1610
|
-
const
|
|
1610
|
+
const pi = ({
|
|
1611
1611
|
position: e,
|
|
1612
1612
|
isMobile: t,
|
|
1613
|
-
agentName:
|
|
1613
|
+
agentName: n,
|
|
1614
1614
|
avatarImageUrl: i,
|
|
1615
1615
|
idleLoopUrl: a,
|
|
1616
1616
|
greeting: o,
|
|
1617
|
-
branding:
|
|
1617
|
+
branding: s,
|
|
1618
1618
|
teamMembers: l,
|
|
1619
|
-
currentTeamMemberId:
|
|
1619
|
+
currentTeamMemberId: c,
|
|
1620
1620
|
isSwitchingTeamMember: u,
|
|
1621
|
-
teamSwitcherOpen:
|
|
1621
|
+
teamSwitcherOpen: m,
|
|
1622
1622
|
onToggleTeamSwitcher: p,
|
|
1623
1623
|
onSelectTeamMember: h,
|
|
1624
1624
|
languageMenuOpen: P,
|
|
1625
1625
|
onToggleLanguageMenu: x,
|
|
1626
1626
|
connectionState: E,
|
|
1627
|
-
agentState:
|
|
1627
|
+
agentState: y,
|
|
1628
1628
|
transcript: w,
|
|
1629
1629
|
canResume: R,
|
|
1630
1630
|
needsUserGesture: S,
|
|
1631
|
-
error:
|
|
1631
|
+
error: v,
|
|
1632
1632
|
isMuted: O,
|
|
1633
|
-
micError:
|
|
1633
|
+
micError: g,
|
|
1634
1634
|
micDevices: D,
|
|
1635
1635
|
activeMicId: W,
|
|
1636
1636
|
isCameraEnabled: K,
|
|
@@ -1651,25 +1651,25 @@ const di = ({
|
|
|
1651
1651
|
transformingLabel: Q,
|
|
1652
1652
|
avatarVideoContainerRef: be,
|
|
1653
1653
|
agentVideoEl: ne,
|
|
1654
|
-
onConnect:
|
|
1655
|
-
onDisconnect:
|
|
1656
|
-
onRetry:
|
|
1657
|
-
onResumeAudio:
|
|
1658
|
-
onToggleMute:
|
|
1659
|
-
onSwitchMicDevice:
|
|
1660
|
-
onToggleCamera:
|
|
1661
|
-
onSwitchCameraDevice:
|
|
1662
|
-
onToggleScreenShare:
|
|
1663
|
-
onToggleSpeaker:
|
|
1664
|
-
onSendMessage:
|
|
1665
|
-
onMinimize:
|
|
1666
|
-
onClose:
|
|
1667
|
-
onClearMicError:
|
|
1668
|
-
dragHandleProps:
|
|
1654
|
+
onConnect: nt,
|
|
1655
|
+
onDisconnect: rt,
|
|
1656
|
+
onRetry: ht,
|
|
1657
|
+
onResumeAudio: mt,
|
|
1658
|
+
onToggleMute: it,
|
|
1659
|
+
onSwitchMicDevice: gt,
|
|
1660
|
+
onToggleCamera: Be,
|
|
1661
|
+
onSwitchCameraDevice: qe,
|
|
1662
|
+
onToggleScreenShare: Re,
|
|
1663
|
+
onToggleSpeaker: Te,
|
|
1664
|
+
onSendMessage: Pe,
|
|
1665
|
+
onMinimize: De,
|
|
1666
|
+
onClose: ze,
|
|
1667
|
+
onClearMicError: Ue,
|
|
1668
|
+
dragHandleProps: $e,
|
|
1669
1669
|
resizeHandleProps: F
|
|
1670
1670
|
}) => {
|
|
1671
|
-
var
|
|
1672
|
-
const
|
|
1671
|
+
var st;
|
|
1672
|
+
const He = ((l == null ? void 0 : l.length) ?? 0) > 1, je = E === "connecting" || E === "connected", we = E === "connected", yt = E === "idle" || E === "disconnected" || E === "error", [Oe, Ne] = M(!1);
|
|
1673
1673
|
T(() => {
|
|
1674
1674
|
if (!ne) {
|
|
1675
1675
|
Ne(!1);
|
|
@@ -1685,75 +1685,75 @@ const di = ({
|
|
|
1685
1685
|
ne.removeEventListener("playing", _), ne.removeEventListener("loadeddata", _);
|
|
1686
1686
|
};
|
|
1687
1687
|
}, [ne]);
|
|
1688
|
-
const [
|
|
1688
|
+
const [At, vt] = M(!1);
|
|
1689
1689
|
T(() => {
|
|
1690
1690
|
if (!we) {
|
|
1691
|
-
|
|
1691
|
+
vt(!1);
|
|
1692
1692
|
return;
|
|
1693
1693
|
}
|
|
1694
|
-
if (
|
|
1695
|
-
const _ = setTimeout(() =>
|
|
1694
|
+
if (Oe) return;
|
|
1695
|
+
const _ = setTimeout(() => vt(!0), 8e3);
|
|
1696
1696
|
return () => clearTimeout(_);
|
|
1697
|
-
}, [we,
|
|
1698
|
-
const
|
|
1697
|
+
}, [we, Oe]);
|
|
1698
|
+
const Fe = E === "connecting" || we && !!i && !Oe && !At, ue = I(null), ot = I(null);
|
|
1699
1699
|
T(() => {
|
|
1700
1700
|
const _ = ue.current;
|
|
1701
1701
|
_ && (_.innerHTML = "", ae && (ae.style.width = "100%", ae.style.height = "100%", ae.style.objectFit = "cover", ae.style.transform = "scaleX(-1)", _.appendChild(ae)));
|
|
1702
1702
|
}, [ae]), T(() => {
|
|
1703
|
-
const _ =
|
|
1703
|
+
const _ = ot.current;
|
|
1704
1704
|
_ && (_.innerHTML = "", N && (N.style.width = "100%", N.style.height = "100%", N.style.objectFit = "contain", _.appendChild(N)));
|
|
1705
1705
|
}, [N]);
|
|
1706
|
-
const [le, pe] = M(!1), [
|
|
1706
|
+
const [le, pe] = M(!1), [Ve, Ye] = M(!1), ge = I(null), _e = I(null);
|
|
1707
1707
|
T(() => {
|
|
1708
|
-
if (!le && !
|
|
1708
|
+
if (!le && !Ve && !P && !m) return;
|
|
1709
1709
|
const _ = () => {
|
|
1710
|
-
pe(!1),
|
|
1710
|
+
pe(!1), Ye(!1), P && x(), m && p();
|
|
1711
1711
|
};
|
|
1712
1712
|
return document.addEventListener("click", _), () => document.removeEventListener("click", _);
|
|
1713
1713
|
}, [
|
|
1714
1714
|
le,
|
|
1715
|
-
|
|
1715
|
+
Ve,
|
|
1716
1716
|
P,
|
|
1717
|
-
|
|
1717
|
+
m,
|
|
1718
1718
|
x,
|
|
1719
1719
|
p
|
|
1720
1720
|
]);
|
|
1721
|
-
const [
|
|
1721
|
+
const [bt, Mt] = M(!1), It = C(() => Mt((_) => !_), []), [lt, Rt] = M(""), Ae = C(
|
|
1722
1722
|
(_) => {
|
|
1723
1723
|
_.preventDefault();
|
|
1724
|
-
const re =
|
|
1725
|
-
re && (
|
|
1724
|
+
const re = lt.trim();
|
|
1725
|
+
re && (Pe(re), Rt(""));
|
|
1726
1726
|
},
|
|
1727
|
-
[
|
|
1728
|
-
), Me =
|
|
1727
|
+
[lt, Pe]
|
|
1728
|
+
), Me = s.productName || "Live Layer", Se = !s.productName;
|
|
1729
1729
|
let ye = null, xe = null;
|
|
1730
1730
|
for (let _ = w.length - 1; _ >= 0; _--) {
|
|
1731
1731
|
const re = w[_];
|
|
1732
1732
|
if (!ye && re.role === "agent" ? ye = re : !xe && re.role === "user" && (xe = re), ye && xe) break;
|
|
1733
1733
|
}
|
|
1734
|
-
const
|
|
1734
|
+
const wt = we ? (ye == null ? void 0 : ye.text) || null : o || null, Ge = we && (xe == null ? void 0 : xe.text) || null, at = [
|
|
1735
1735
|
"ll-expanded",
|
|
1736
1736
|
t ? "ll-expanded--mobile" : "ll-expanded--desktop"
|
|
1737
1737
|
].join(" ");
|
|
1738
1738
|
return /* @__PURE__ */ k(
|
|
1739
1739
|
"div",
|
|
1740
1740
|
{
|
|
1741
|
-
className:
|
|
1741
|
+
className: at,
|
|
1742
1742
|
"data-position": e,
|
|
1743
|
-
"data-state": we ? "connected" :
|
|
1743
|
+
"data-state": we ? "connected" : je ? "connecting" : "idle",
|
|
1744
1744
|
role: "dialog",
|
|
1745
|
-
"aria-label": `${
|
|
1745
|
+
"aria-label": `${n} widget`,
|
|
1746
1746
|
children: [
|
|
1747
1747
|
/* @__PURE__ */ k("div", { className: "ll-expanded__bg", children: [
|
|
1748
|
-
i ? /* @__PURE__ */
|
|
1749
|
-
|
|
1748
|
+
i ? /* @__PURE__ */ r(
|
|
1749
|
+
oi,
|
|
1750
1750
|
{
|
|
1751
1751
|
src: i,
|
|
1752
|
-
alt:
|
|
1752
|
+
alt: n,
|
|
1753
1753
|
className: "ll-expanded__bg-img"
|
|
1754
1754
|
}
|
|
1755
|
-
) : /* @__PURE__ */
|
|
1756
|
-
a && !we && /* @__PURE__ */
|
|
1755
|
+
) : /* @__PURE__ */ r("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ r("span", { className: "ll-expanded__bg-initial", children: ((st = n == null ? void 0 : n.charAt(0)) == null ? void 0 : st.toUpperCase()) || "A" }) }),
|
|
1756
|
+
a && !we && /* @__PURE__ */ r(
|
|
1757
1757
|
"video",
|
|
1758
1758
|
{
|
|
1759
1759
|
className: "ll-expanded__bg-idle",
|
|
@@ -1765,20 +1765,20 @@ const di = ({
|
|
|
1765
1765
|
}
|
|
1766
1766
|
)
|
|
1767
1767
|
] }),
|
|
1768
|
-
/* @__PURE__ */
|
|
1769
|
-
|
|
1770
|
-
/* @__PURE__ */
|
|
1771
|
-
/* @__PURE__ */
|
|
1768
|
+
/* @__PURE__ */ r("div", { ref: be, className: "ll-expanded__video" }),
|
|
1769
|
+
Fe && /* @__PURE__ */ k("div", { className: "ll-expanded__overlay ll-expanded__overlay--connecting", children: [
|
|
1770
|
+
/* @__PURE__ */ r("div", { className: "ll-expanded__spinner" }),
|
|
1771
|
+
/* @__PURE__ */ r("p", { className: "ll-expanded__overlay-text", children: u ? "Switching..." : "Connecting..." })
|
|
1772
1772
|
] }),
|
|
1773
1773
|
S && we && /* @__PURE__ */ k(
|
|
1774
1774
|
"button",
|
|
1775
1775
|
{
|
|
1776
1776
|
type: "button",
|
|
1777
1777
|
className: "ll-expanded__overlay ll-expanded__overlay--gesture",
|
|
1778
|
-
onClick:
|
|
1778
|
+
onClick: mt,
|
|
1779
1779
|
children: [
|
|
1780
|
-
/* @__PURE__ */
|
|
1781
|
-
/* @__PURE__ */
|
|
1780
|
+
/* @__PURE__ */ r("svg", { width: "32", height: "32", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": !0, children: /* @__PURE__ */ r("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" }) }),
|
|
1781
|
+
/* @__PURE__ */ r("p", { className: "ll-expanded__overlay-text", children: "Tap to enable audio" })
|
|
1782
1782
|
]
|
|
1783
1783
|
}
|
|
1784
1784
|
),
|
|
@@ -1790,13 +1790,13 @@ const di = ({
|
|
|
1790
1790
|
"aria-live": "polite",
|
|
1791
1791
|
"aria-label": Q,
|
|
1792
1792
|
children: [
|
|
1793
|
-
/* @__PURE__ */
|
|
1794
|
-
/* @__PURE__ */
|
|
1793
|
+
/* @__PURE__ */ r("div", { className: "ll-expanded__spinner" }),
|
|
1794
|
+
/* @__PURE__ */ r("p", { className: "ll-expanded__overlay-text", children: Q })
|
|
1795
1795
|
]
|
|
1796
1796
|
}
|
|
1797
1797
|
),
|
|
1798
|
-
|
|
1799
|
-
!U && /* @__PURE__ */ k("div", { className: "ll-expanded__topbar",
|
|
1798
|
+
je ? /* @__PURE__ */ k(We, { children: [
|
|
1799
|
+
!U && /* @__PURE__ */ k("div", { className: "ll-expanded__topbar", ...$e, children: [
|
|
1800
1800
|
!oe && /* @__PURE__ */ k("div", { className: "ll-expanded__topbar-left", children: [
|
|
1801
1801
|
/* @__PURE__ */ k("div", { className: "ll-expanded__pill-wrap", children: [
|
|
1802
1802
|
/* @__PURE__ */ k(
|
|
@@ -1805,17 +1805,17 @@ const di = ({
|
|
|
1805
1805
|
type: "button",
|
|
1806
1806
|
className: "ll-hpill",
|
|
1807
1807
|
onClick: (_) => {
|
|
1808
|
-
|
|
1808
|
+
He && (_.stopPropagation(), p());
|
|
1809
1809
|
},
|
|
1810
|
-
"aria-haspopup":
|
|
1811
|
-
"aria-expanded":
|
|
1810
|
+
"aria-haspopup": He ? "listbox" : void 0,
|
|
1811
|
+
"aria-expanded": He ? m : void 0,
|
|
1812
1812
|
children: [
|
|
1813
|
-
/* @__PURE__ */
|
|
1814
|
-
|
|
1813
|
+
/* @__PURE__ */ r("span", { className: "ll-hpill__label", children: n }),
|
|
1814
|
+
He && /* @__PURE__ */ r(St, {})
|
|
1815
1815
|
]
|
|
1816
1816
|
}
|
|
1817
1817
|
),
|
|
1818
|
-
|
|
1818
|
+
He && m && /* @__PURE__ */ r(
|
|
1819
1819
|
"div",
|
|
1820
1820
|
{
|
|
1821
1821
|
className: "ll-hmenu",
|
|
@@ -1825,12 +1825,12 @@ const di = ({
|
|
|
1825
1825
|
"button",
|
|
1826
1826
|
{
|
|
1827
1827
|
type: "button",
|
|
1828
|
-
className: `ll-hmenu__item ${_.id ===
|
|
1828
|
+
className: `ll-hmenu__item ${_.id === c ? "is-active" : ""}`,
|
|
1829
1829
|
onClick: () => h(_.id),
|
|
1830
1830
|
role: "option",
|
|
1831
|
-
"aria-selected": _.id ===
|
|
1831
|
+
"aria-selected": _.id === c,
|
|
1832
1832
|
children: [
|
|
1833
|
-
_.avatarImageUrl && /* @__PURE__ */
|
|
1833
|
+
_.avatarImageUrl && /* @__PURE__ */ r(
|
|
1834
1834
|
"img",
|
|
1835
1835
|
{
|
|
1836
1836
|
src: _.avatarImageUrl,
|
|
@@ -1838,8 +1838,8 @@ const di = ({
|
|
|
1838
1838
|
className: "ll-hmenu__avatar"
|
|
1839
1839
|
}
|
|
1840
1840
|
),
|
|
1841
|
-
/* @__PURE__ */
|
|
1842
|
-
_.role && /* @__PURE__ */
|
|
1841
|
+
/* @__PURE__ */ r("span", { className: "ll-hmenu__name", children: _.name }),
|
|
1842
|
+
_.role && /* @__PURE__ */ r("span", { className: "ll-hmenu__role", children: _.role })
|
|
1843
1843
|
]
|
|
1844
1844
|
},
|
|
1845
1845
|
_.id
|
|
@@ -1861,66 +1861,66 @@ const di = ({
|
|
|
1861
1861
|
"aria-label": "Language: English",
|
|
1862
1862
|
title: "Language: English",
|
|
1863
1863
|
children: [
|
|
1864
|
-
/* @__PURE__ */
|
|
1865
|
-
/* @__PURE__ */
|
|
1864
|
+
/* @__PURE__ */ r("span", { className: "ll-hpill__label", children: "EN" }),
|
|
1865
|
+
/* @__PURE__ */ r(St, {})
|
|
1866
1866
|
]
|
|
1867
1867
|
}
|
|
1868
1868
|
),
|
|
1869
|
-
P && /* @__PURE__ */
|
|
1869
|
+
P && /* @__PURE__ */ r(
|
|
1870
1870
|
"div",
|
|
1871
1871
|
{
|
|
1872
1872
|
className: "ll-hmenu",
|
|
1873
1873
|
onClick: (_) => _.stopPropagation(),
|
|
1874
1874
|
role: "listbox",
|
|
1875
|
-
children: /* @__PURE__ */
|
|
1875
|
+
children: /* @__PURE__ */ r(
|
|
1876
1876
|
"button",
|
|
1877
1877
|
{
|
|
1878
1878
|
type: "button",
|
|
1879
1879
|
className: "ll-hmenu__item is-active",
|
|
1880
1880
|
role: "option",
|
|
1881
1881
|
"aria-selected": !0,
|
|
1882
|
-
children: /* @__PURE__ */
|
|
1882
|
+
children: /* @__PURE__ */ r("span", { className: "ll-hmenu__name", children: "English" })
|
|
1883
1883
|
}
|
|
1884
1884
|
)
|
|
1885
1885
|
}
|
|
1886
1886
|
)
|
|
1887
1887
|
] }),
|
|
1888
|
-
/* @__PURE__ */
|
|
1888
|
+
/* @__PURE__ */ r(
|
|
1889
1889
|
"span",
|
|
1890
1890
|
{
|
|
1891
|
-
className: `ll-expanded__state ll-expanded__state--${
|
|
1892
|
-
children:
|
|
1891
|
+
className: `ll-expanded__state ll-expanded__state--${y}`,
|
|
1892
|
+
children: y
|
|
1893
1893
|
}
|
|
1894
1894
|
)
|
|
1895
1895
|
] }),
|
|
1896
1896
|
/* @__PURE__ */ k("div", { className: "ll-expanded__header-actions", children: [
|
|
1897
|
-
V !== !1 && /* @__PURE__ */
|
|
1897
|
+
V !== !1 && /* @__PURE__ */ r(
|
|
1898
1898
|
"button",
|
|
1899
1899
|
{
|
|
1900
1900
|
type: "button",
|
|
1901
1901
|
className: "ll-hbtn",
|
|
1902
|
-
onClick:
|
|
1902
|
+
onClick: De,
|
|
1903
1903
|
"aria-label": "Minimize widget",
|
|
1904
1904
|
title: "Minimize",
|
|
1905
|
-
children: /* @__PURE__ */
|
|
1905
|
+
children: /* @__PURE__ */ r(Sn, {})
|
|
1906
1906
|
}
|
|
1907
1907
|
),
|
|
1908
|
-
te !== !1 && /* @__PURE__ */
|
|
1908
|
+
te !== !1 && /* @__PURE__ */ r(
|
|
1909
1909
|
"button",
|
|
1910
1910
|
{
|
|
1911
1911
|
type: "button",
|
|
1912
1912
|
className: "ll-hbtn ll-hbtn--danger",
|
|
1913
|
-
onClick:
|
|
1913
|
+
onClick: ze,
|
|
1914
1914
|
"aria-label": "End call",
|
|
1915
1915
|
title: "End call",
|
|
1916
|
-
children: /* @__PURE__ */
|
|
1916
|
+
children: /* @__PURE__ */ r(kn, {})
|
|
1917
1917
|
}
|
|
1918
1918
|
)
|
|
1919
1919
|
] })
|
|
1920
1920
|
] }),
|
|
1921
|
-
U && /* @__PURE__ */ k("div", { className: "ll-compact-status", "data-state":
|
|
1922
|
-
/* @__PURE__ */
|
|
1923
|
-
/* @__PURE__ */
|
|
1921
|
+
U && /* @__PURE__ */ k("div", { className: "ll-compact-status", "data-state": y, children: [
|
|
1922
|
+
/* @__PURE__ */ r("span", { className: "ll-compact-status__dot", "aria-hidden": !0 }),
|
|
1923
|
+
/* @__PURE__ */ r("span", { className: "ll-compact-status__label", children: y })
|
|
1924
1924
|
] })
|
|
1925
1925
|
] }) : (
|
|
1926
1926
|
// Idle-state header. In compactControls mode (mobile WIDGET +
|
|
@@ -1931,7 +1931,7 @@ const di = ({
|
|
|
1931
1931
|
// can always dismiss; making the whole header disappear (the
|
|
1932
1932
|
// pre-0.18.0 behavior) left users no way out short of scrolling
|
|
1933
1933
|
// the page itself.
|
|
1934
|
-
/* @__PURE__ */ k("div", { className: "ll-expanded__header ll-expanded__header--idle",
|
|
1934
|
+
/* @__PURE__ */ k("div", { className: "ll-expanded__header ll-expanded__header--idle", ...$e, children: [
|
|
1935
1935
|
!U && (Se ? /* @__PURE__ */ k(
|
|
1936
1936
|
"a",
|
|
1937
1937
|
{
|
|
@@ -1942,59 +1942,59 @@ const di = ({
|
|
|
1942
1942
|
"aria-label": "Powered by LiveLayer — opens livelayer.studio in a new tab",
|
|
1943
1943
|
title: "Powered by LiveLayer — visit livelayer.studio",
|
|
1944
1944
|
children: [
|
|
1945
|
-
/* @__PURE__ */
|
|
1946
|
-
/* @__PURE__ */
|
|
1945
|
+
/* @__PURE__ */ r(ai, { size: 14, className: "ll-expanded__brand-mark" }),
|
|
1946
|
+
/* @__PURE__ */ r("span", { children: Me })
|
|
1947
1947
|
]
|
|
1948
1948
|
}
|
|
1949
|
-
) : /* @__PURE__ */
|
|
1949
|
+
) : /* @__PURE__ */ r("span", { className: "ll-expanded__brand", children: Me })),
|
|
1950
1950
|
/* @__PURE__ */ k("div", { className: "ll-expanded__header-actions", children: [
|
|
1951
|
-
!U && V !== !1 && /* @__PURE__ */
|
|
1951
|
+
!U && V !== !1 && /* @__PURE__ */ r(
|
|
1952
1952
|
"button",
|
|
1953
1953
|
{
|
|
1954
1954
|
type: "button",
|
|
1955
1955
|
className: "ll-hbtn ll-hbtn--ghost",
|
|
1956
|
-
onClick:
|
|
1956
|
+
onClick: De,
|
|
1957
1957
|
"aria-label": "Minimize widget",
|
|
1958
|
-
children: /* @__PURE__ */
|
|
1958
|
+
children: /* @__PURE__ */ r(Sn, {})
|
|
1959
1959
|
}
|
|
1960
1960
|
),
|
|
1961
|
-
te !== !1 && /* @__PURE__ */
|
|
1961
|
+
te !== !1 && /* @__PURE__ */ r(
|
|
1962
1962
|
"button",
|
|
1963
1963
|
{
|
|
1964
1964
|
type: "button",
|
|
1965
1965
|
className: "ll-hbtn ll-hbtn--danger",
|
|
1966
|
-
onClick:
|
|
1966
|
+
onClick: ze,
|
|
1967
1967
|
"aria-label": "Close widget",
|
|
1968
|
-
children: /* @__PURE__ */
|
|
1968
|
+
children: /* @__PURE__ */ r(kn, {})
|
|
1969
1969
|
}
|
|
1970
1970
|
)
|
|
1971
1971
|
] })
|
|
1972
1972
|
] })
|
|
1973
1973
|
),
|
|
1974
|
-
|
|
1974
|
+
yt && /* @__PURE__ */ (() => {
|
|
1975
1975
|
const _ = R ? "Resume session" : E === "disconnected" ? "Reconnect to agent" : "Start video call";
|
|
1976
|
-
return /* @__PURE__ */ k(
|
|
1977
|
-
!
|
|
1976
|
+
return /* @__PURE__ */ k(We, { children: [
|
|
1977
|
+
!v && /* @__PURE__ */ k(
|
|
1978
1978
|
"button",
|
|
1979
1979
|
{
|
|
1980
1980
|
type: "button",
|
|
1981
1981
|
className: "ll-expanded__play",
|
|
1982
|
-
onClick:
|
|
1982
|
+
onClick: nt,
|
|
1983
1983
|
"aria-label": _,
|
|
1984
1984
|
children: [
|
|
1985
|
-
/* @__PURE__ */
|
|
1986
|
-
U && /* @__PURE__ */
|
|
1985
|
+
/* @__PURE__ */ r("div", { className: "ll-expanded__play-circle", children: /* @__PURE__ */ r("svg", { width: "22", height: "22", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": !0, children: /* @__PURE__ */ r("polygon", { points: "6 3 20 12 6 21 6 3" }) }) }),
|
|
1986
|
+
U && /* @__PURE__ */ r("span", { className: "ll-expanded__play-label", children: _ })
|
|
1987
1987
|
]
|
|
1988
1988
|
}
|
|
1989
1989
|
),
|
|
1990
1990
|
!U && /* @__PURE__ */ k("div", { className: "ll-expanded__bottom ll-expanded__bottom--idle", children: [
|
|
1991
|
-
o && /* @__PURE__ */
|
|
1992
|
-
/* @__PURE__ */
|
|
1991
|
+
o && /* @__PURE__ */ r("div", { className: "ll-expanded__transcript", children: /* @__PURE__ */ r("p", { className: "ll-expanded__transcript-text", children: o }) }),
|
|
1992
|
+
/* @__PURE__ */ r(
|
|
1993
1993
|
"button",
|
|
1994
1994
|
{
|
|
1995
1995
|
type: "button",
|
|
1996
1996
|
className: "ll-expanded__cta",
|
|
1997
|
-
onClick:
|
|
1997
|
+
onClick: nt,
|
|
1998
1998
|
"aria-label": _,
|
|
1999
1999
|
children: _
|
|
2000
2000
|
}
|
|
@@ -2005,16 +2005,16 @@ const di = ({
|
|
|
2005
2005
|
/* @__PURE__ */ k(
|
|
2006
2006
|
"div",
|
|
2007
2007
|
{
|
|
2008
|
-
className: `ll-expanded__pip ${
|
|
2008
|
+
className: `ll-expanded__pip ${je && (K || f) ? "is-visible" : ""}`,
|
|
2009
2009
|
children: [
|
|
2010
|
-
/* @__PURE__ */
|
|
2010
|
+
/* @__PURE__ */ r(
|
|
2011
2011
|
"div",
|
|
2012
2012
|
{
|
|
2013
|
-
ref:
|
|
2013
|
+
ref: ot,
|
|
2014
2014
|
className: f ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
|
|
2015
2015
|
}
|
|
2016
2016
|
),
|
|
2017
|
-
/* @__PURE__ */
|
|
2017
|
+
/* @__PURE__ */ r(
|
|
2018
2018
|
"div",
|
|
2019
2019
|
{
|
|
2020
2020
|
ref: ue,
|
|
@@ -2024,219 +2024,219 @@ const di = ({
|
|
|
2024
2024
|
]
|
|
2025
2025
|
}
|
|
2026
2026
|
),
|
|
2027
|
-
|
|
2028
|
-
!U &&
|
|
2027
|
+
je ? /* @__PURE__ */ k("div", { className: "ll-expanded__bottom", children: [
|
|
2028
|
+
!U && wt && /* @__PURE__ */ r(
|
|
2029
2029
|
"div",
|
|
2030
2030
|
{
|
|
2031
2031
|
className: "ll-expanded__transcript ll-expanded__transcript--agent",
|
|
2032
2032
|
"data-role": "agent",
|
|
2033
|
-
children: /* @__PURE__ */
|
|
2033
|
+
children: /* @__PURE__ */ r("p", { className: "ll-expanded__transcript-text", children: wt })
|
|
2034
2034
|
}
|
|
2035
2035
|
),
|
|
2036
|
-
!U &&
|
|
2036
|
+
!U && Ge && /* @__PURE__ */ r(
|
|
2037
2037
|
"div",
|
|
2038
2038
|
{
|
|
2039
2039
|
className: "ll-expanded__transcript ll-expanded__transcript--user",
|
|
2040
2040
|
"data-role": "user",
|
|
2041
|
-
children: /* @__PURE__ */
|
|
2041
|
+
children: /* @__PURE__ */ r("p", { className: "ll-expanded__transcript-text", children: Ge })
|
|
2042
2042
|
}
|
|
2043
2043
|
),
|
|
2044
2044
|
!oe && !U && /* @__PURE__ */ k("div", { className: "ll-toolbar", onClick: (_) => _.stopPropagation(), children: [
|
|
2045
|
-
X && /* @__PURE__ */
|
|
2045
|
+
X && /* @__PURE__ */ r(
|
|
2046
2046
|
"button",
|
|
2047
2047
|
{
|
|
2048
2048
|
type: "button",
|
|
2049
2049
|
className: `ll-tool ${f ? "is-on" : ""}`,
|
|
2050
|
-
onClick:
|
|
2050
|
+
onClick: Re,
|
|
2051
2051
|
"aria-label": f ? "Stop sharing screen" : "Share screen",
|
|
2052
2052
|
title: f ? "Stop sharing" : "Share screen",
|
|
2053
|
-
children: /* @__PURE__ */
|
|
2053
|
+
children: /* @__PURE__ */ r(Fn, {})
|
|
2054
2054
|
}
|
|
2055
2055
|
),
|
|
2056
2056
|
q && /* @__PURE__ */ k("div", { className: "ll-tool-split", children: [
|
|
2057
|
-
/* @__PURE__ */
|
|
2057
|
+
/* @__PURE__ */ r(
|
|
2058
2058
|
"button",
|
|
2059
2059
|
{
|
|
2060
2060
|
type: "button",
|
|
2061
2061
|
className: `ll-tool ll-tool--left ${K ? "is-on" : ""}`,
|
|
2062
|
-
onClick:
|
|
2062
|
+
onClick: Be,
|
|
2063
2063
|
"aria-label": K ? "Turn off camera" : "Turn on camera",
|
|
2064
2064
|
title: K ? "Stop camera" : "Start camera",
|
|
2065
|
-
children: /* @__PURE__ */
|
|
2065
|
+
children: /* @__PURE__ */ r(Wn, {})
|
|
2066
2066
|
}
|
|
2067
2067
|
),
|
|
2068
|
-
/* @__PURE__ */
|
|
2068
|
+
/* @__PURE__ */ r(
|
|
2069
2069
|
"button",
|
|
2070
2070
|
{
|
|
2071
2071
|
ref: _e,
|
|
2072
2072
|
type: "button",
|
|
2073
2073
|
className: `ll-tool ll-tool--right ${K ? "is-on" : ""}`,
|
|
2074
2074
|
onClick: (_) => {
|
|
2075
|
-
_.stopPropagation(),
|
|
2075
|
+
_.stopPropagation(), Ye((re) => !re), pe(!1);
|
|
2076
2076
|
},
|
|
2077
2077
|
"aria-label": "Camera devices",
|
|
2078
2078
|
"aria-haspopup": "listbox",
|
|
2079
|
-
"aria-expanded":
|
|
2080
|
-
children: /* @__PURE__ */
|
|
2079
|
+
"aria-expanded": Ve,
|
|
2080
|
+
children: /* @__PURE__ */ r(St, {})
|
|
2081
2081
|
}
|
|
2082
2082
|
),
|
|
2083
|
-
|
|
2084
|
-
|
|
2083
|
+
Ve && $.length > 0 && /* @__PURE__ */ r(
|
|
2084
|
+
En,
|
|
2085
2085
|
{
|
|
2086
2086
|
label: "Camera",
|
|
2087
2087
|
devices: $,
|
|
2088
2088
|
activeId: G,
|
|
2089
2089
|
anchorRef: _e,
|
|
2090
2090
|
onPick: (_) => {
|
|
2091
|
-
|
|
2091
|
+
Ye(!1), qe(_);
|
|
2092
2092
|
}
|
|
2093
2093
|
}
|
|
2094
2094
|
)
|
|
2095
2095
|
] }),
|
|
2096
2096
|
/* @__PURE__ */ k("div", { className: "ll-tool-split", children: [
|
|
2097
|
-
/* @__PURE__ */
|
|
2097
|
+
/* @__PURE__ */ r(
|
|
2098
2098
|
"button",
|
|
2099
2099
|
{
|
|
2100
2100
|
type: "button",
|
|
2101
2101
|
className: `ll-tool ll-tool--left ${O ? "is-muted" : ""}`,
|
|
2102
|
-
onClick:
|
|
2102
|
+
onClick: it,
|
|
2103
2103
|
"aria-label": O ? "Unmute microphone" : "Mute microphone",
|
|
2104
2104
|
title: O ? "Unmute" : "Mute",
|
|
2105
|
-
children: /* @__PURE__ */
|
|
2105
|
+
children: /* @__PURE__ */ r(Bn, { muted: O })
|
|
2106
2106
|
}
|
|
2107
2107
|
),
|
|
2108
|
-
/* @__PURE__ */
|
|
2108
|
+
/* @__PURE__ */ r(
|
|
2109
2109
|
"button",
|
|
2110
2110
|
{
|
|
2111
2111
|
ref: ge,
|
|
2112
2112
|
type: "button",
|
|
2113
2113
|
className: `ll-tool ll-tool--right ${O ? "is-muted" : ""}`,
|
|
2114
2114
|
onClick: (_) => {
|
|
2115
|
-
_.stopPropagation(), pe((re) => !re),
|
|
2115
|
+
_.stopPropagation(), pe((re) => !re), Ye(!1);
|
|
2116
2116
|
},
|
|
2117
2117
|
"aria-label": "Microphone devices",
|
|
2118
2118
|
"aria-haspopup": "listbox",
|
|
2119
2119
|
"aria-expanded": le,
|
|
2120
|
-
children: /* @__PURE__ */
|
|
2120
|
+
children: /* @__PURE__ */ r(St, {})
|
|
2121
2121
|
}
|
|
2122
2122
|
),
|
|
2123
|
-
le && D.length > 0 && /* @__PURE__ */
|
|
2124
|
-
|
|
2123
|
+
le && D.length > 0 && /* @__PURE__ */ r(
|
|
2124
|
+
En,
|
|
2125
2125
|
{
|
|
2126
2126
|
label: "Microphone",
|
|
2127
2127
|
devices: D,
|
|
2128
2128
|
activeId: W,
|
|
2129
2129
|
anchorRef: ge,
|
|
2130
2130
|
onPick: (_) => {
|
|
2131
|
-
pe(!1),
|
|
2131
|
+
pe(!1), gt(_);
|
|
2132
2132
|
}
|
|
2133
2133
|
}
|
|
2134
2134
|
)
|
|
2135
2135
|
] }),
|
|
2136
|
-
/* @__PURE__ */
|
|
2136
|
+
/* @__PURE__ */ r(
|
|
2137
2137
|
"button",
|
|
2138
2138
|
{
|
|
2139
2139
|
type: "button",
|
|
2140
2140
|
className: `ll-tool ${z ? "is-muted" : ""}`,
|
|
2141
|
-
onClick:
|
|
2141
|
+
onClick: Te,
|
|
2142
2142
|
"aria-label": z ? "Unmute speaker" : "Mute speaker",
|
|
2143
2143
|
title: z ? "Unmute speaker" : "Mute speaker",
|
|
2144
|
-
children: /* @__PURE__ */
|
|
2144
|
+
children: /* @__PURE__ */ r(qn, { muted: z })
|
|
2145
2145
|
}
|
|
2146
2146
|
),
|
|
2147
|
-
/* @__PURE__ */
|
|
2147
|
+
/* @__PURE__ */ r(
|
|
2148
2148
|
"button",
|
|
2149
2149
|
{
|
|
2150
2150
|
type: "button",
|
|
2151
2151
|
className: "ll-tool ll-tool--danger",
|
|
2152
|
-
onClick:
|
|
2152
|
+
onClick: rt,
|
|
2153
2153
|
"aria-label": "End conversation",
|
|
2154
2154
|
title: "End conversation",
|
|
2155
|
-
children: /* @__PURE__ */
|
|
2155
|
+
children: /* @__PURE__ */ r(Un, {})
|
|
2156
2156
|
}
|
|
2157
2157
|
)
|
|
2158
2158
|
] }),
|
|
2159
|
-
!oe && U && /* @__PURE__ */
|
|
2160
|
-
|
|
2159
|
+
!oe && U && /* @__PURE__ */ r(
|
|
2160
|
+
ui,
|
|
2161
2161
|
{
|
|
2162
2162
|
isMuted: O,
|
|
2163
|
-
onToggleMute:
|
|
2163
|
+
onToggleMute: it,
|
|
2164
2164
|
isCameraEnabled: K,
|
|
2165
|
-
onToggleCamera:
|
|
2165
|
+
onToggleCamera: Be,
|
|
2166
2166
|
allowCamera: q,
|
|
2167
2167
|
isScreenShareEnabled: f,
|
|
2168
|
-
onToggleScreenShare:
|
|
2168
|
+
onToggleScreenShare: Re,
|
|
2169
2169
|
allowScreenShare: X,
|
|
2170
2170
|
isSpeakerMuted: z,
|
|
2171
|
-
onToggleSpeaker:
|
|
2171
|
+
onToggleSpeaker: Te,
|
|
2172
2172
|
allowTyping: ee,
|
|
2173
|
-
isTypingOpen:
|
|
2174
|
-
onToggleTyping:
|
|
2175
|
-
onDisconnect:
|
|
2173
|
+
isTypingOpen: bt,
|
|
2174
|
+
onToggleTyping: It,
|
|
2175
|
+
onDisconnect: rt
|
|
2176
2176
|
}
|
|
2177
2177
|
),
|
|
2178
|
-
!oe && ee && (U ?
|
|
2179
|
-
/* @__PURE__ */
|
|
2178
|
+
!oe && ee && (U ? bt : !0) && /* @__PURE__ */ k("form", { className: "ll-message-input", onSubmit: Ae, children: [
|
|
2179
|
+
/* @__PURE__ */ r(
|
|
2180
2180
|
"input",
|
|
2181
2181
|
{
|
|
2182
2182
|
type: "text",
|
|
2183
2183
|
className: "ll-message-input__field",
|
|
2184
2184
|
placeholder: "Message...",
|
|
2185
|
-
value:
|
|
2186
|
-
onChange: (_) =>
|
|
2185
|
+
value: lt,
|
|
2186
|
+
onChange: (_) => Rt(_.target.value),
|
|
2187
2187
|
"aria-label": "Message the agent"
|
|
2188
2188
|
}
|
|
2189
2189
|
),
|
|
2190
|
-
|
|
2190
|
+
lt.trim() && /* @__PURE__ */ r(
|
|
2191
2191
|
"button",
|
|
2192
2192
|
{
|
|
2193
2193
|
type: "submit",
|
|
2194
2194
|
className: "ll-message-input__send",
|
|
2195
2195
|
"aria-label": "Send message",
|
|
2196
|
-
children: /* @__PURE__ */
|
|
2196
|
+
children: /* @__PURE__ */ r(hi, {})
|
|
2197
2197
|
}
|
|
2198
2198
|
)
|
|
2199
2199
|
] })
|
|
2200
2200
|
] }) : null,
|
|
2201
2201
|
(() => {
|
|
2202
|
-
if (
|
|
2202
|
+
if (g && E !== "error")
|
|
2203
2203
|
return /* @__PURE__ */ k("div", { className: "ll-expanded__banner", role: "alert", children: [
|
|
2204
|
-
/* @__PURE__ */
|
|
2205
|
-
/* @__PURE__ */
|
|
2204
|
+
/* @__PURE__ */ r("span", { children: g }),
|
|
2205
|
+
/* @__PURE__ */ r(
|
|
2206
2206
|
"button",
|
|
2207
2207
|
{
|
|
2208
2208
|
type: "button",
|
|
2209
2209
|
className: "ll-expanded__banner-x",
|
|
2210
|
-
onClick:
|
|
2210
|
+
onClick: Ue,
|
|
2211
2211
|
"aria-label": "Dismiss",
|
|
2212
2212
|
children: "×"
|
|
2213
2213
|
}
|
|
2214
2214
|
)
|
|
2215
2215
|
] });
|
|
2216
|
-
if (!
|
|
2216
|
+
if (!v || E !== "error") return null;
|
|
2217
2217
|
let _ = "Failed to connect", re = "Try again";
|
|
2218
|
-
return
|
|
2219
|
-
/* @__PURE__ */
|
|
2220
|
-
/* @__PURE__ */
|
|
2218
|
+
return v === "MIC_PERMISSION_DENIED" ? _ = "Microphone blocked. Allow access to talk." : v === "MIC_NOT_FOUND" ? _ = "No microphone found. Plug one in + retry." : v === "MIC_UNAVAILABLE" ? _ = "Mic unavailable. Check other apps using it." : v === "AGENT_TIMEOUT" ? _ = "Agent didn't pick up. Try again." : v === "CONNECT_FAILED" ? _ = "Connection failed. Check your network." : v.length < 80 && (_ = v), /* @__PURE__ */ k("div", { className: "ll-expanded__banner ll-expanded__banner--error", role: "alert", children: [
|
|
2219
|
+
/* @__PURE__ */ r("span", { children: _ }),
|
|
2220
|
+
/* @__PURE__ */ r(
|
|
2221
2221
|
"button",
|
|
2222
2222
|
{
|
|
2223
2223
|
type: "button",
|
|
2224
2224
|
className: "ll-expanded__banner-retry",
|
|
2225
|
-
onClick:
|
|
2225
|
+
onClick: ht,
|
|
2226
2226
|
children: re
|
|
2227
2227
|
}
|
|
2228
2228
|
)
|
|
2229
2229
|
] });
|
|
2230
2230
|
})(),
|
|
2231
|
-
(F == null ? void 0 : F["data-ll-resize-handle"]) !== void 0 && /* @__PURE__ */
|
|
2231
|
+
(F == null ? void 0 : F["data-ll-resize-handle"]) !== void 0 && /* @__PURE__ */ r(
|
|
2232
2232
|
"div",
|
|
2233
2233
|
{
|
|
2234
2234
|
className: "ll-expanded__resize-grip",
|
|
2235
2235
|
...F,
|
|
2236
2236
|
"aria-hidden": !0,
|
|
2237
2237
|
children: /* @__PURE__ */ k("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", children: [
|
|
2238
|
-
/* @__PURE__ */
|
|
2239
|
-
/* @__PURE__ */
|
|
2238
|
+
/* @__PURE__ */ r("line", { x1: "11", y1: "4", x2: "4", y2: "11" }),
|
|
2239
|
+
/* @__PURE__ */ r("line", { x1: "11", y1: "8", x2: "8", y2: "11" })
|
|
2240
2240
|
] })
|
|
2241
2241
|
}
|
|
2242
2242
|
)
|
|
@@ -2244,56 +2244,56 @@ const di = ({
|
|
|
2244
2244
|
}
|
|
2245
2245
|
);
|
|
2246
2246
|
};
|
|
2247
|
-
function
|
|
2248
|
-
return /* @__PURE__ */
|
|
2247
|
+
function St() {
|
|
2248
|
+
return /* @__PURE__ */ r("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": !0, children: /* @__PURE__ */ r("polyline", { points: "6 9 12 15 18 9" }) });
|
|
2249
2249
|
}
|
|
2250
|
-
function
|
|
2250
|
+
function kn() {
|
|
2251
2251
|
return /* @__PURE__ */ k("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": !0, children: [
|
|
2252
|
-
/* @__PURE__ */
|
|
2253
|
-
/* @__PURE__ */
|
|
2252
|
+
/* @__PURE__ */ r("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
2253
|
+
/* @__PURE__ */ r("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
2254
2254
|
] });
|
|
2255
2255
|
}
|
|
2256
|
-
function
|
|
2257
|
-
return /* @__PURE__ */
|
|
2256
|
+
function Sn() {
|
|
2257
|
+
return /* @__PURE__ */ r("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": !0, children: /* @__PURE__ */ r("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) });
|
|
2258
2258
|
}
|
|
2259
|
-
function
|
|
2259
|
+
function Fn() {
|
|
2260
2260
|
return /* @__PURE__ */ k("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: [
|
|
2261
|
-
/* @__PURE__ */
|
|
2262
|
-
/* @__PURE__ */
|
|
2263
|
-
/* @__PURE__ */
|
|
2261
|
+
/* @__PURE__ */ r("rect", { x: "2", y: "3", width: "20", height: "14", rx: "2" }),
|
|
2262
|
+
/* @__PURE__ */ r("line", { x1: "8", y1: "21", x2: "16", y2: "21" }),
|
|
2263
|
+
/* @__PURE__ */ r("line", { x1: "12", y1: "17", x2: "12", y2: "21" })
|
|
2264
2264
|
] });
|
|
2265
2265
|
}
|
|
2266
|
-
function
|
|
2266
|
+
function Wn() {
|
|
2267
2267
|
return /* @__PURE__ */ k("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: [
|
|
2268
|
-
/* @__PURE__ */
|
|
2269
|
-
/* @__PURE__ */
|
|
2268
|
+
/* @__PURE__ */ r("path", { d: "M23 7l-7 5 7 5V7z" }),
|
|
2269
|
+
/* @__PURE__ */ r("rect", { x: "1", y: "5", width: "15", height: "14", rx: "2" })
|
|
2270
2270
|
] });
|
|
2271
2271
|
}
|
|
2272
|
-
function
|
|
2272
|
+
function Bn({ muted: e }) {
|
|
2273
2273
|
return /* @__PURE__ */ k("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: [
|
|
2274
|
-
/* @__PURE__ */
|
|
2275
|
-
/* @__PURE__ */
|
|
2276
|
-
/* @__PURE__ */
|
|
2277
|
-
e && /* @__PURE__ */
|
|
2274
|
+
/* @__PURE__ */ r("path", { d: "M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z" }),
|
|
2275
|
+
/* @__PURE__ */ r("path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }),
|
|
2276
|
+
/* @__PURE__ */ r("line", { x1: "12", y1: "19", x2: "12", y2: "23" }),
|
|
2277
|
+
e && /* @__PURE__ */ r("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
|
|
2278
2278
|
] });
|
|
2279
2279
|
}
|
|
2280
|
-
function
|
|
2280
|
+
function qn({ muted: e }) {
|
|
2281
2281
|
return /* @__PURE__ */ k("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: [
|
|
2282
|
-
/* @__PURE__ */
|
|
2283
|
-
e ? /* @__PURE__ */
|
|
2284
|
-
/* @__PURE__ */
|
|
2285
|
-
/* @__PURE__ */
|
|
2282
|
+
/* @__PURE__ */ r("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
|
|
2283
|
+
e ? /* @__PURE__ */ r("line", { x1: "23", y1: "9", x2: "17", y2: "15" }) : /* @__PURE__ */ k(We, { children: [
|
|
2284
|
+
/* @__PURE__ */ r("path", { d: "M19.07 4.93a10 10 0 0 1 0 14.14" }),
|
|
2285
|
+
/* @__PURE__ */ r("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" })
|
|
2286
2286
|
] })
|
|
2287
2287
|
] });
|
|
2288
2288
|
}
|
|
2289
|
-
function
|
|
2289
|
+
function hi() {
|
|
2290
2290
|
return /* @__PURE__ */ k("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
|
|
2291
|
-
/* @__PURE__ */
|
|
2292
|
-
/* @__PURE__ */
|
|
2291
|
+
/* @__PURE__ */ r("line", { x1: "5", y1: "12", x2: "19", y2: "12" }),
|
|
2292
|
+
/* @__PURE__ */ r("polyline", { points: "12 5 19 12 12 19" })
|
|
2293
2293
|
] });
|
|
2294
2294
|
}
|
|
2295
|
-
function
|
|
2296
|
-
return /* @__PURE__ */
|
|
2295
|
+
function Un() {
|
|
2296
|
+
return /* @__PURE__ */ r("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__ */ r(
|
|
2297
2297
|
"path",
|
|
2298
2298
|
{
|
|
2299
2299
|
d: "M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.13.93.37 1.84.71 2.7a2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.38-1.38a2 2 0 0 1 2.11-.45c.86.34 1.77.58 2.7.71A2 2 0 0 1 22 16.92z",
|
|
@@ -2301,28 +2301,28 @@ function Bn() {
|
|
|
2301
2301
|
}
|
|
2302
2302
|
) });
|
|
2303
2303
|
}
|
|
2304
|
-
const
|
|
2304
|
+
const En = ({
|
|
2305
2305
|
label: e,
|
|
2306
2306
|
devices: t,
|
|
2307
|
-
activeId:
|
|
2307
|
+
activeId: n,
|
|
2308
2308
|
onPick: i,
|
|
2309
2309
|
anchorRef: a
|
|
2310
2310
|
}) => {
|
|
2311
|
-
const [o,
|
|
2312
|
-
return
|
|
2311
|
+
const [o, s] = M(null);
|
|
2312
|
+
return Dn(() => {
|
|
2313
2313
|
const l = () => {
|
|
2314
|
-
const
|
|
2315
|
-
if (!
|
|
2316
|
-
const u =
|
|
2317
|
-
|
|
2314
|
+
const c = a.current;
|
|
2315
|
+
if (!c) return;
|
|
2316
|
+
const u = c.getBoundingClientRect(), m = 126, p = window.innerWidth - 16 - 110, h = u.left + u.width / 2;
|
|
2317
|
+
s({
|
|
2318
2318
|
top: u.top - 8,
|
|
2319
|
-
left: Math.max(
|
|
2319
|
+
left: Math.max(m, Math.min(p, h))
|
|
2320
2320
|
});
|
|
2321
2321
|
};
|
|
2322
2322
|
return l(), window.addEventListener("scroll", l, !0), window.addEventListener("resize", l), () => {
|
|
2323
2323
|
window.removeEventListener("scroll", l, !0), window.removeEventListener("resize", l);
|
|
2324
2324
|
};
|
|
2325
|
-
}, [a]), o === null || typeof document > "u" ? null :
|
|
2325
|
+
}, [a]), o === null || typeof document > "u" ? null : Xt(
|
|
2326
2326
|
/* @__PURE__ */ k(
|
|
2327
2327
|
"div",
|
|
2328
2328
|
{
|
|
@@ -2337,9 +2337,9 @@ const Cn = ({
|
|
|
2337
2337
|
transform: "translate(-50%, -100%)"
|
|
2338
2338
|
},
|
|
2339
2339
|
children: [
|
|
2340
|
-
/* @__PURE__ */
|
|
2341
|
-
t.map((l,
|
|
2342
|
-
const u =
|
|
2340
|
+
/* @__PURE__ */ r("p", { className: "ll-device-menu__label", children: e }),
|
|
2341
|
+
t.map((l, c) => {
|
|
2342
|
+
const u = n === l.deviceId;
|
|
2343
2343
|
return /* @__PURE__ */ k(
|
|
2344
2344
|
"button",
|
|
2345
2345
|
{
|
|
@@ -2349,11 +2349,11 @@ const Cn = ({
|
|
|
2349
2349
|
role: "option",
|
|
2350
2350
|
"aria-selected": u,
|
|
2351
2351
|
children: [
|
|
2352
|
-
u && /* @__PURE__ */
|
|
2353
|
-
/* @__PURE__ */
|
|
2352
|
+
u && /* @__PURE__ */ r("span", { className: "ll-device-menu__dot", children: "●" }),
|
|
2353
|
+
/* @__PURE__ */ r("span", { className: "ll-device-menu__name", children: l.label || `${e} ${c + 1}` })
|
|
2354
2354
|
]
|
|
2355
2355
|
},
|
|
2356
|
-
l.deviceId ||
|
|
2356
|
+
l.deviceId || c
|
|
2357
2357
|
);
|
|
2358
2358
|
})
|
|
2359
2359
|
]
|
|
@@ -2361,7 +2361,7 @@ const Cn = ({
|
|
|
2361
2361
|
),
|
|
2362
2362
|
document.body
|
|
2363
2363
|
);
|
|
2364
|
-
},
|
|
2364
|
+
}, mi = [
|
|
2365
2365
|
// Accept any value (or empty) — `<input data-ll-private />` and
|
|
2366
2366
|
// `<input data-ll-private="true" />` both opt out. The bare attribute
|
|
2367
2367
|
// is the recommended spelling; "true" is preserved for back-compat.
|
|
@@ -2369,17 +2369,17 @@ const Cn = ({
|
|
|
2369
2369
|
"[data-ll-skip]",
|
|
2370
2370
|
".ll-widget"
|
|
2371
2371
|
];
|
|
2372
|
-
function
|
|
2372
|
+
function Kt(e) {
|
|
2373
2373
|
let t = e;
|
|
2374
2374
|
for (; t; ) {
|
|
2375
|
-
for (const
|
|
2376
|
-
if (t.matches(
|
|
2375
|
+
for (const n of mi)
|
|
2376
|
+
if (t.matches(n)) return !0;
|
|
2377
2377
|
t = t.parentElement;
|
|
2378
2378
|
}
|
|
2379
2379
|
return !1;
|
|
2380
2380
|
}
|
|
2381
|
-
function
|
|
2382
|
-
if (
|
|
2381
|
+
function Vt(e) {
|
|
2382
|
+
if (Kt(e)) return !1;
|
|
2383
2383
|
if (e instanceof HTMLInputElement) {
|
|
2384
2384
|
if (e.type === "password") return !1;
|
|
2385
2385
|
const t = (e.getAttribute("autocomplete") || "").toLowerCase();
|
|
@@ -2387,7 +2387,7 @@ function Ut(e) {
|
|
|
2387
2387
|
}
|
|
2388
2388
|
return !0;
|
|
2389
2389
|
}
|
|
2390
|
-
const
|
|
2390
|
+
const Et = 4096, gi = 20, yi = 20, vi = 10, bi = 10, wi = 30, _i = 20, Nn = 500, xi = [
|
|
2391
2391
|
'[data-ll-private="true"]',
|
|
2392
2392
|
".ll-widget",
|
|
2393
2393
|
"script",
|
|
@@ -2395,46 +2395,46 @@ const St = 4096, hi = 20, mi = 20, gi = 10, yi = 10, vi = 30, bi = 20, kn = 500,
|
|
|
2395
2395
|
"noscript",
|
|
2396
2396
|
"iframe"
|
|
2397
2397
|
];
|
|
2398
|
-
function
|
|
2398
|
+
function ft(e) {
|
|
2399
2399
|
if (e.getAttribute("aria-hidden") === "true" || e.hasAttribute("hidden")) return !0;
|
|
2400
2400
|
let t = e;
|
|
2401
2401
|
for (; t; ) {
|
|
2402
|
-
for (const
|
|
2403
|
-
if (t.matches(
|
|
2402
|
+
for (const n of xi)
|
|
2403
|
+
if (t.matches(n)) return !0;
|
|
2404
2404
|
t = t.parentElement;
|
|
2405
2405
|
}
|
|
2406
2406
|
return !1;
|
|
2407
2407
|
}
|
|
2408
|
-
function
|
|
2408
|
+
function pt(e) {
|
|
2409
2409
|
if (typeof window > "u") return !0;
|
|
2410
2410
|
const t = e.getBoundingClientRect();
|
|
2411
2411
|
if (t.width <= 0 || t.height <= 0) return !1;
|
|
2412
|
-
const
|
|
2413
|
-
return t.bottom > 0 && t.right > 0 && t.top <
|
|
2412
|
+
const n = window.innerHeight || document.documentElement.clientHeight, i = window.innerWidth || document.documentElement.clientWidth;
|
|
2413
|
+
return t.bottom > 0 && t.right > 0 && t.top < n && t.left < i;
|
|
2414
2414
|
}
|
|
2415
|
-
function
|
|
2415
|
+
function An(e) {
|
|
2416
2416
|
const t = e.getAttribute("id");
|
|
2417
2417
|
if (t) {
|
|
2418
|
-
const o = typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(t) : t.replace(/"/g, '\\"'),
|
|
2419
|
-
if (
|
|
2418
|
+
const o = typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(t) : t.replace(/"/g, '\\"'), s = document.querySelector(`label[for="${o}"]`);
|
|
2419
|
+
if (s != null && s.textContent) return s.textContent.trim();
|
|
2420
2420
|
}
|
|
2421
|
-
const
|
|
2422
|
-
if (
|
|
2421
|
+
const n = e.getAttribute("aria-label");
|
|
2422
|
+
if (n) return n.trim();
|
|
2423
2423
|
const i = e.closest("label");
|
|
2424
2424
|
if (i) {
|
|
2425
2425
|
const o = [];
|
|
2426
2426
|
for (const l of Array.from(i.childNodes))
|
|
2427
2427
|
if (l.nodeType === Node.TEXT_NODE) {
|
|
2428
|
-
const
|
|
2429
|
-
|
|
2428
|
+
const c = (l.textContent || "").trim();
|
|
2429
|
+
c && o.push(c);
|
|
2430
2430
|
} else if (l instanceof HTMLElement) {
|
|
2431
2431
|
if (l instanceof HTMLInputElement || l instanceof HTMLTextAreaElement || l instanceof HTMLSelectElement || l instanceof HTMLButtonElement)
|
|
2432
2432
|
continue;
|
|
2433
|
-
const
|
|
2434
|
-
|
|
2433
|
+
const c = (l.textContent || "").trim();
|
|
2434
|
+
c && o.push(c);
|
|
2435
2435
|
}
|
|
2436
|
-
const
|
|
2437
|
-
if (
|
|
2436
|
+
const s = o.join(" ").trim();
|
|
2437
|
+
if (s) return s;
|
|
2438
2438
|
}
|
|
2439
2439
|
const a = e.getAttribute("placeholder");
|
|
2440
2440
|
return a ? a.trim() : "";
|
|
@@ -2442,15 +2442,15 @@ function Sn(e) {
|
|
|
2442
2442
|
function fe(e, t) {
|
|
2443
2443
|
return e.length <= t ? e : e.slice(0, t - 1) + "…";
|
|
2444
2444
|
}
|
|
2445
|
-
function
|
|
2445
|
+
function Li(e) {
|
|
2446
2446
|
return e && e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60) || null;
|
|
2447
2447
|
}
|
|
2448
|
-
function
|
|
2448
|
+
function Ci(e) {
|
|
2449
2449
|
const t = e.getAttribute("aria-label");
|
|
2450
2450
|
if (t) return t.trim().slice(0, 80);
|
|
2451
|
-
const
|
|
2452
|
-
if (
|
|
2453
|
-
const o = document.getElementById(
|
|
2451
|
+
const n = e.getAttribute("aria-labelledby");
|
|
2452
|
+
if (n) {
|
|
2453
|
+
const o = document.getElementById(n);
|
|
2454
2454
|
if (o != null && o.textContent) return o.textContent.trim().slice(0, 80);
|
|
2455
2455
|
}
|
|
2456
2456
|
const i = e.querySelector(
|
|
@@ -2463,20 +2463,20 @@ function xi(e) {
|
|
|
2463
2463
|
}
|
|
2464
2464
|
let a = e.parentElement;
|
|
2465
2465
|
for (let o = 0; a && o < 4; o++, a = a.parentElement) {
|
|
2466
|
-
const
|
|
2467
|
-
if (
|
|
2468
|
-
const l =
|
|
2466
|
+
const s = a.querySelector("h1, h2, h3, h4");
|
|
2467
|
+
if (s != null && s.textContent) {
|
|
2468
|
+
const l = s.textContent.trim();
|
|
2469
2469
|
if (l && l.length < 80) return l;
|
|
2470
2470
|
}
|
|
2471
2471
|
}
|
|
2472
2472
|
return null;
|
|
2473
2473
|
}
|
|
2474
|
-
function
|
|
2474
|
+
function Ze(e) {
|
|
2475
2475
|
return e.length;
|
|
2476
2476
|
}
|
|
2477
|
-
function
|
|
2478
|
-
const
|
|
2479
|
-
if (!
|
|
2477
|
+
function ki(e, t = {}) {
|
|
2478
|
+
const n = t.doc ?? (typeof document < "u" ? document : null);
|
|
2479
|
+
if (!n)
|
|
2480
2480
|
return {
|
|
2481
2481
|
url: "",
|
|
2482
2482
|
title: "",
|
|
@@ -2488,66 +2488,66 @@ function Li(e, t = {}) {
|
|
|
2488
2488
|
forms: [],
|
|
2489
2489
|
extras: e
|
|
2490
2490
|
};
|
|
2491
|
-
const i = typeof window < "u" && window.location.href || "", a = typeof window < "u" && window.location.pathname || "/", o =
|
|
2492
|
-
|
|
2491
|
+
const i = typeof window < "u" && window.location.href || "", a = typeof window < "u" && window.location.pathname || "/", o = n.title || "", s = Array.from(
|
|
2492
|
+
n.querySelectorAll("[data-ll-region]")
|
|
2493
2493
|
), l = [];
|
|
2494
|
-
for (const
|
|
2495
|
-
if (l.length >=
|
|
2496
|
-
if (
|
|
2497
|
-
const D =
|
|
2498
|
-
(
|
|
2499
|
-
|
|
2494
|
+
for (const g of s) {
|
|
2495
|
+
if (l.length >= vi) break;
|
|
2496
|
+
if (ft(g) || !pt(g)) continue;
|
|
2497
|
+
const D = g.getAttribute("data-ll-region") ?? "", W = g.getAttribute("data-ll-intent") ?? void 0, K = fe(
|
|
2498
|
+
(g.innerText || g.textContent || "").trim(),
|
|
2499
|
+
Nn * 2
|
|
2500
2500
|
);
|
|
2501
2501
|
!D || !K || l.push({ id: D, intent: W, text: K });
|
|
2502
2502
|
}
|
|
2503
|
-
const
|
|
2504
|
-
|
|
2503
|
+
const c = [], u = ["H1", "H2", "H3", "H4", "H5", "H6"], m = Array.from(
|
|
2504
|
+
n.querySelectorAll("h1, h2, h3, h4, h5, h6")
|
|
2505
2505
|
);
|
|
2506
|
-
for (const
|
|
2507
|
-
if (
|
|
2508
|
-
const D = (
|
|
2509
|
-
D &&
|
|
2506
|
+
for (const g of m) {
|
|
2507
|
+
if (ft(g) || !pt(g)) continue;
|
|
2508
|
+
const D = (g.textContent || "").trim();
|
|
2509
|
+
D && c.push(`${g.tagName}: ${fe(D, 200)}`);
|
|
2510
2510
|
}
|
|
2511
|
-
const p = Array.from(
|
|
2512
|
-
for (const
|
|
2513
|
-
if (
|
|
2514
|
-
const D = (
|
|
2515
|
-
D.length > 10 &&
|
|
2511
|
+
const p = Array.from(n.querySelectorAll("p, li"));
|
|
2512
|
+
for (const g of p) {
|
|
2513
|
+
if (ft(g) || !pt(g) || u.includes(g.tagName)) continue;
|
|
2514
|
+
const D = (g.textContent || "").trim();
|
|
2515
|
+
D.length > 10 && c.push(fe(D, Nn));
|
|
2516
2516
|
}
|
|
2517
|
-
const h =
|
|
2518
|
-
`), P = [], x = Array.from(
|
|
2519
|
-
for (const
|
|
2520
|
-
if (P.length >=
|
|
2521
|
-
if (
|
|
2522
|
-
const D =
|
|
2517
|
+
const h = c.join(`
|
|
2518
|
+
`), P = [], x = Array.from(n.querySelectorAll("a[href]"));
|
|
2519
|
+
for (const g of x) {
|
|
2520
|
+
if (P.length >= gi) break;
|
|
2521
|
+
if (ft(g) || !pt(g)) continue;
|
|
2522
|
+
const D = g.getAttribute("href") || "", W = (g.textContent || "").trim();
|
|
2523
2523
|
!D || !W || P.push({ href: D, text: fe(W, 100) });
|
|
2524
2524
|
}
|
|
2525
|
-
const E = [],
|
|
2526
|
-
|
|
2525
|
+
const E = [], y = Array.from(
|
|
2526
|
+
n.querySelectorAll(
|
|
2527
2527
|
"input, textarea, select"
|
|
2528
2528
|
)
|
|
2529
2529
|
);
|
|
2530
|
-
for (const
|
|
2531
|
-
if (E.length >=
|
|
2532
|
-
if (
|
|
2533
|
-
const D =
|
|
2530
|
+
for (const g of y) {
|
|
2531
|
+
if (E.length >= yi) break;
|
|
2532
|
+
if (ft(g) || !Vt(g) || !pt(g)) continue;
|
|
2533
|
+
const D = An(g), W = g instanceof HTMLInputElement ? g.type : g.tagName.toLowerCase();
|
|
2534
2534
|
D && E.push({ label: fe(D, 100), type: W });
|
|
2535
2535
|
}
|
|
2536
|
-
const w = Array.from(
|
|
2536
|
+
const w = Array.from(n.querySelectorAll("form")), R = [];
|
|
2537
2537
|
let S = 0;
|
|
2538
|
-
for (const
|
|
2539
|
-
if (R.length >=
|
|
2540
|
-
if (
|
|
2541
|
-
const D =
|
|
2542
|
-
|
|
2538
|
+
for (const g of w) {
|
|
2539
|
+
if (R.length >= bi) break;
|
|
2540
|
+
if (Kt(g) || g.matches(".ll-widget *, .ll-widget")) continue;
|
|
2541
|
+
const D = g.getAttribute("id") || g.getAttribute("name") || Li(g.getAttribute("data-ll-intent")) || `form_${S++}`, W = g.getAttribute("data-ll-intent") || Ci(g) || void 0, K = Array.from(
|
|
2542
|
+
g.querySelectorAll(
|
|
2543
2543
|
"input, textarea, select"
|
|
2544
2544
|
)
|
|
2545
2545
|
), ae = [];
|
|
2546
2546
|
let $ = 0;
|
|
2547
2547
|
const G = /* @__PURE__ */ new Set();
|
|
2548
2548
|
for (const f of K) {
|
|
2549
|
-
if (ae.length >=
|
|
2550
|
-
if (!
|
|
2549
|
+
if (ae.length >= wi) break;
|
|
2550
|
+
if (!Vt(f)) continue;
|
|
2551
2551
|
if (f instanceof HTMLInputElement) {
|
|
2552
2552
|
const U = f.type;
|
|
2553
2553
|
if (U === "submit" || U === "button" || U === "reset" || U === "hidden" || U === "image" || U === "file") continue;
|
|
@@ -2555,7 +2555,7 @@ function Li(e, t = {}) {
|
|
|
2555
2555
|
const N = f.getAttribute("name") || "", z = f.getAttribute("id") || "";
|
|
2556
2556
|
let q = N || z || `field_${$}`;
|
|
2557
2557
|
G.has(q) && (q = `${q}__${$}`), G.add(q), $++;
|
|
2558
|
-
const X =
|
|
2558
|
+
const X = An(f) || q, ee = f instanceof HTMLInputElement ? f.type : f.tagName.toLowerCase(), V = {
|
|
2559
2559
|
name: q,
|
|
2560
2560
|
label: fe(X, 100),
|
|
2561
2561
|
type: ee
|
|
@@ -2588,7 +2588,7 @@ function Li(e, t = {}) {
|
|
|
2588
2588
|
}
|
|
2589
2589
|
if (f instanceof HTMLSelectElement) {
|
|
2590
2590
|
const U = [];
|
|
2591
|
-
for (let me = 0; me < f.options.length && !(U.length >=
|
|
2591
|
+
for (let me = 0; me < f.options.length && !(U.length >= _i); me++) {
|
|
2592
2592
|
const Q = f.options[me];
|
|
2593
2593
|
if (!Q || Q.disabled) continue;
|
|
2594
2594
|
const be = Q.value || "", ne = (Q.textContent || "").trim() || be;
|
|
@@ -2601,7 +2601,7 @@ function Li(e, t = {}) {
|
|
|
2601
2601
|
}
|
|
2602
2602
|
R.push({ id: D, intent: W, fields: ae });
|
|
2603
2603
|
}
|
|
2604
|
-
const
|
|
2604
|
+
const v = {
|
|
2605
2605
|
url: i,
|
|
2606
2606
|
title: o,
|
|
2607
2607
|
pathname: a,
|
|
@@ -2612,26 +2612,33 @@ function Li(e, t = {}) {
|
|
|
2612
2612
|
forms: R,
|
|
2613
2613
|
extras: e
|
|
2614
2614
|
};
|
|
2615
|
-
let O =
|
|
2616
|
-
for (; O >
|
|
2617
|
-
|
|
2618
|
-
for (; O >
|
|
2619
|
-
|
|
2620
|
-
return
|
|
2615
|
+
let O = Ze(JSON.stringify(v.regions)) + Ze(v.visibleText) + Ze(JSON.stringify(v.visibleLinks)) + Ze(JSON.stringify(v.visibleFields));
|
|
2616
|
+
for (; O > Et && v.visibleFields.length > 0; )
|
|
2617
|
+
v.visibleFields.pop(), O = Ze(JSON.stringify(v.visibleFields));
|
|
2618
|
+
for (; O > Et && v.visibleLinks.length > 0; )
|
|
2619
|
+
v.visibleLinks.pop(), O -= 80;
|
|
2620
|
+
return Ze(v.visibleText) > Et && (v.visibleText = fe(v.visibleText, Et - 100)), v;
|
|
2621
2621
|
}
|
|
2622
|
-
let
|
|
2623
|
-
function
|
|
2624
|
-
const
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2622
|
+
let Qe = null;
|
|
2623
|
+
function Si(e) {
|
|
2624
|
+
const t = e.querySelectorAll("form");
|
|
2625
|
+
let n = `f${t.length}`;
|
|
2626
|
+
return t.forEach((i) => {
|
|
2627
|
+
n += `|${i.id || i.getAttribute("name") || ""}:${i.querySelectorAll("input,select,textarea").length}`;
|
|
2628
|
+
}), n;
|
|
2629
2629
|
}
|
|
2630
|
-
function
|
|
2631
|
-
|
|
2630
|
+
function Mn(e, t = {}) {
|
|
2631
|
+
const n = Date.now(), i = t.doc ?? (typeof document < "u" ? document : null), a = typeof window < "u" && window.location.pathname || "/", o = typeof window < "u" ? window.scrollY : 0, s = `${a}::${o}::${i ? Si(i) : ""}`;
|
|
2632
|
+
if (Qe && Qe.key === s && n - Qe.at < 1e3)
|
|
2633
|
+
return Qe.ctx;
|
|
2634
|
+
const l = ki(e, t);
|
|
2635
|
+
return Qe = { key: s, at: n, ctx: l }, l;
|
|
2632
2636
|
}
|
|
2633
|
-
|
|
2634
|
-
|
|
2637
|
+
function Ei() {
|
|
2638
|
+
Qe = null;
|
|
2639
|
+
}
|
|
2640
|
+
const Ni = 200;
|
|
2641
|
+
function Ai(e) {
|
|
2635
2642
|
const t = String(e.href || "");
|
|
2636
2643
|
return {
|
|
2637
2644
|
href: t,
|
|
@@ -2641,47 +2648,47 @@ function Si(e) {
|
|
|
2641
2648
|
description: e.description
|
|
2642
2649
|
};
|
|
2643
2650
|
}
|
|
2644
|
-
function
|
|
2651
|
+
function Mi(e) {
|
|
2645
2652
|
return !(!e || e.startsWith("#") || e.startsWith("javascript:") || e.startsWith("mailto:") || e.startsWith("tel:"));
|
|
2646
2653
|
}
|
|
2647
|
-
function
|
|
2654
|
+
function Ii(e) {
|
|
2648
2655
|
const t = e ?? (typeof document < "u" ? document : null);
|
|
2649
2656
|
if (!t) return [];
|
|
2650
|
-
const
|
|
2651
|
-
for (const
|
|
2652
|
-
if (a.length >=
|
|
2653
|
-
if (
|
|
2654
|
-
const l =
|
|
2655
|
-
if (!
|
|
2656
|
-
let
|
|
2657
|
+
const n = typeof window < "u" && window.location.origin || "", i = /* @__PURE__ */ new Set(), a = [], o = Array.from(t.querySelectorAll("a[href]"));
|
|
2658
|
+
for (const s of o) {
|
|
2659
|
+
if (a.length >= Ni) break;
|
|
2660
|
+
if (Kt(s)) continue;
|
|
2661
|
+
const l = s.getAttribute("href") || "";
|
|
2662
|
+
if (!Mi(l)) continue;
|
|
2663
|
+
let c = l, u = !0;
|
|
2657
2664
|
try {
|
|
2658
2665
|
if (typeof window < "u") {
|
|
2659
|
-
const p = new URL(l,
|
|
2660
|
-
u = p.origin ===
|
|
2666
|
+
const p = new URL(l, n);
|
|
2667
|
+
u = p.origin === n, u && l.startsWith("http") && (c = p.pathname + p.search + p.hash);
|
|
2661
2668
|
}
|
|
2662
2669
|
} catch {
|
|
2663
2670
|
continue;
|
|
2664
2671
|
}
|
|
2665
|
-
if (i.has(
|
|
2666
|
-
i.add(
|
|
2667
|
-
const
|
|
2668
|
-
a.push({ href:
|
|
2672
|
+
if (i.has(c)) continue;
|
|
2673
|
+
i.add(c);
|
|
2674
|
+
const m = (s.textContent || "").trim().slice(0, 120);
|
|
2675
|
+
a.push({ href: c, text: m, internal: u });
|
|
2669
2676
|
}
|
|
2670
2677
|
return a;
|
|
2671
2678
|
}
|
|
2672
|
-
let
|
|
2673
|
-
const
|
|
2674
|
-
function
|
|
2679
|
+
let et = null;
|
|
2680
|
+
const Ri = 5e3;
|
|
2681
|
+
function qt() {
|
|
2675
2682
|
const e = Date.now(), t = typeof window < "u" && window.location.pathname || "/";
|
|
2676
|
-
if (
|
|
2677
|
-
return
|
|
2678
|
-
const
|
|
2679
|
-
return
|
|
2683
|
+
if (et && et.pathname === t && e - et.at < Ri)
|
|
2684
|
+
return et.routes;
|
|
2685
|
+
const n = Ii();
|
|
2686
|
+
return et = { at: e, pathname: t, routes: n }, n;
|
|
2680
2687
|
}
|
|
2681
|
-
function
|
|
2682
|
-
|
|
2688
|
+
function Ti() {
|
|
2689
|
+
et = null;
|
|
2683
2690
|
}
|
|
2684
|
-
function
|
|
2691
|
+
function Yt(e) {
|
|
2685
2692
|
if (e instanceof HTMLInputElement) {
|
|
2686
2693
|
const t = e.type;
|
|
2687
2694
|
if (t === "submit" || t === "button" || t === "reset" || t === "hidden" || t === "image" || t === "file")
|
|
@@ -2689,55 +2696,99 @@ function Nn(e) {
|
|
|
2689
2696
|
}
|
|
2690
2697
|
return !0;
|
|
2691
2698
|
}
|
|
2692
|
-
function
|
|
2699
|
+
function Pi(e, t) {
|
|
2693
2700
|
return e.getAttribute("name") || e.getAttribute("id") || `field_${t}`;
|
|
2694
2701
|
}
|
|
2695
|
-
function
|
|
2702
|
+
function Ie(e) {
|
|
2703
|
+
return e.toLowerCase().replace(/[^a-z0-9]+/g, "");
|
|
2704
|
+
}
|
|
2705
|
+
function Ut(e) {
|
|
2706
|
+
const t = e.lastIndexOf(".");
|
|
2707
|
+
return t >= 0 ? e.slice(t + 1) : e;
|
|
2708
|
+
}
|
|
2709
|
+
function Di(e) {
|
|
2710
|
+
var i;
|
|
2711
|
+
const t = e.getAttribute("id");
|
|
2712
|
+
if (t)
|
|
2713
|
+
try {
|
|
2714
|
+
const a = (i = e.ownerDocument) == null ? void 0 : i.querySelector(
|
|
2715
|
+
`label[for="${t.replace(/"/g, '\\"')}"]`
|
|
2716
|
+
);
|
|
2717
|
+
if (a != null && a.textContent) return a.textContent;
|
|
2718
|
+
} catch {
|
|
2719
|
+
}
|
|
2720
|
+
const n = e.closest("label");
|
|
2721
|
+
return n != null && n.textContent ? n.textContent : e.getAttribute("aria-label") || e.getAttribute("placeholder") || "";
|
|
2722
|
+
}
|
|
2723
|
+
function zi(e, t) {
|
|
2724
|
+
const n = Ie(t);
|
|
2725
|
+
if (n.length < 2) return null;
|
|
2726
|
+
let i = null, a = 0;
|
|
2727
|
+
for (const o of Array.from(
|
|
2728
|
+
e.querySelectorAll("input, textarea, select")
|
|
2729
|
+
)) {
|
|
2730
|
+
if (!Yt(o)) continue;
|
|
2731
|
+
const s = o.getAttribute("name") || "", l = o.getAttribute("id") || "", c = [
|
|
2732
|
+
Ie(Ut(s)),
|
|
2733
|
+
Ie(Ut(l)),
|
|
2734
|
+
Ie(s),
|
|
2735
|
+
Ie(l)
|
|
2736
|
+
];
|
|
2737
|
+
let u = 0;
|
|
2738
|
+
c.some((m) => m.length >= 2 && m === n) ? u = 4 : [
|
|
2739
|
+
Ie(s),
|
|
2740
|
+
Ie(Ut(s)),
|
|
2741
|
+
Ie(Di(o))
|
|
2742
|
+
].some((p) => p.length >= 3 && (p.includes(n) || n.includes(p))) && (u = 2), u > a && (a = u, i = o);
|
|
2743
|
+
}
|
|
2744
|
+
return a >= 2 ? i : null;
|
|
2745
|
+
}
|
|
2746
|
+
function $i(e, t) {
|
|
2696
2747
|
if (!t) return null;
|
|
2697
2748
|
try {
|
|
2698
2749
|
const o = e.querySelector(
|
|
2699
2750
|
`[name="${t.replace(/"/g, '\\"')}"]`
|
|
2700
2751
|
);
|
|
2701
|
-
if (o &&
|
|
2752
|
+
if (o && Yt(o)) return o;
|
|
2702
2753
|
} catch {
|
|
2703
2754
|
}
|
|
2704
|
-
const
|
|
2755
|
+
const n = Array.from(
|
|
2705
2756
|
e.querySelectorAll("input, textarea, select")
|
|
2706
2757
|
);
|
|
2707
2758
|
let i = 0;
|
|
2708
2759
|
const a = /* @__PURE__ */ new Map();
|
|
2709
|
-
for (const o of
|
|
2710
|
-
if (!
|
|
2711
|
-
const
|
|
2712
|
-
let l =
|
|
2713
|
-
if (a.has(
|
|
2714
|
-
a.set(
|
|
2760
|
+
for (const o of n) {
|
|
2761
|
+
if (!Yt(o)) continue;
|
|
2762
|
+
const s = Pi(o, i);
|
|
2763
|
+
let l = s;
|
|
2764
|
+
if (a.has(s) && (l = `${s}__${i}`), l === t) return o;
|
|
2765
|
+
a.set(s, o), i++;
|
|
2715
2766
|
}
|
|
2716
|
-
return
|
|
2767
|
+
return zi(e, t);
|
|
2717
2768
|
}
|
|
2718
|
-
function
|
|
2719
|
-
const
|
|
2720
|
-
return
|
|
2769
|
+
function In(e, t) {
|
|
2770
|
+
const n = $i(e, t);
|
|
2771
|
+
return n ? Vt(n) ? { el: n } : { el: null, reason: "private" } : { el: null, reason: "not_found" };
|
|
2721
2772
|
}
|
|
2722
|
-
function
|
|
2723
|
-
const
|
|
2773
|
+
function Hi(e, t) {
|
|
2774
|
+
const n = e instanceof HTMLInputElement ? HTMLInputElement.prototype : e instanceof HTMLTextAreaElement ? HTMLTextAreaElement.prototype : HTMLSelectElement.prototype, i = Object.getOwnPropertyDescriptor(n, "value"), a = i == null ? void 0 : i.set;
|
|
2724
2775
|
a ? a.call(e, t) : e.value = t;
|
|
2725
2776
|
}
|
|
2726
|
-
function
|
|
2727
|
-
const i =
|
|
2777
|
+
function Oi(e, t, n = {}) {
|
|
2778
|
+
const i = n.triggerInput ?? !0, a = n.triggerChange ?? !0;
|
|
2728
2779
|
if (e instanceof HTMLInputElement && (e.type === "checkbox" || e.type === "radio")) {
|
|
2729
2780
|
const o = Object.getOwnPropertyDescriptor(
|
|
2730
2781
|
HTMLInputElement.prototype,
|
|
2731
2782
|
"checked"
|
|
2732
|
-
),
|
|
2733
|
-
|
|
2783
|
+
), s = o == null ? void 0 : o.set, l = t === "true" || t === "1" || t === "on";
|
|
2784
|
+
s ? s.call(e, l) : e.checked = l, i && e.dispatchEvent(new Event("input", { bubbles: !0 })), a && e.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
2734
2785
|
return;
|
|
2735
2786
|
}
|
|
2736
|
-
|
|
2787
|
+
Hi(e, t), i && e.dispatchEvent(new Event("input", { bubbles: !0 })), a && e.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
2737
2788
|
}
|
|
2738
|
-
function
|
|
2789
|
+
function Rn(e, t) {
|
|
2739
2790
|
if (!t) return null;
|
|
2740
|
-
const
|
|
2791
|
+
const n = t.replace(/"/g, '\\"'), i = (l) => l.closest('[data-ll-private="true"], [data-ll-skip], .ll-widget') !== null;
|
|
2741
2792
|
try {
|
|
2742
2793
|
const l = e.querySelector(
|
|
2743
2794
|
`form#${CSS.escape(t)}`
|
|
@@ -2746,35 +2797,35 @@ function Mn(e, t) {
|
|
|
2746
2797
|
} catch {
|
|
2747
2798
|
}
|
|
2748
2799
|
const a = e.querySelector(
|
|
2749
|
-
`form[name="${
|
|
2800
|
+
`form[name="${n}"]`
|
|
2750
2801
|
);
|
|
2751
2802
|
if (a && !i(a)) return a;
|
|
2752
2803
|
const o = e.querySelector(
|
|
2753
|
-
`form[data-ll-intent="${
|
|
2804
|
+
`form[data-ll-intent="${n}"]`
|
|
2754
2805
|
);
|
|
2755
2806
|
if (o && !i(o)) return o;
|
|
2756
|
-
const
|
|
2807
|
+
const s = Array.from(
|
|
2757
2808
|
e.querySelectorAll("form")
|
|
2758
2809
|
).filter((l) => !i(l));
|
|
2759
|
-
for (const l of
|
|
2760
|
-
const
|
|
2761
|
-
if (
|
|
2810
|
+
for (const l of s) {
|
|
2811
|
+
const c = l.getAttribute("data-ll-intent");
|
|
2812
|
+
if (c && Fi(c) === t) return l;
|
|
2762
2813
|
}
|
|
2763
2814
|
if (/^form_\d+$/.test(t)) {
|
|
2764
2815
|
const l = parseInt(t.slice(5), 10);
|
|
2765
|
-
let
|
|
2766
|
-
for (const u of
|
|
2816
|
+
let c = 0;
|
|
2817
|
+
for (const u of s)
|
|
2767
2818
|
if (!(u.id || u.getAttribute("name") || u.getAttribute("data-ll-intent"))) {
|
|
2768
|
-
if (
|
|
2769
|
-
|
|
2819
|
+
if (c === l) return u;
|
|
2820
|
+
c++;
|
|
2770
2821
|
}
|
|
2771
2822
|
}
|
|
2772
|
-
return
|
|
2823
|
+
return s.length === 1 ? s[0] : null;
|
|
2773
2824
|
}
|
|
2774
|
-
function
|
|
2825
|
+
function Fi(e) {
|
|
2775
2826
|
return e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60) || null;
|
|
2776
2827
|
}
|
|
2777
|
-
function
|
|
2828
|
+
function Wi() {
|
|
2778
2829
|
if (typeof window > "u" || typeof document > "u")
|
|
2779
2830
|
return !1;
|
|
2780
2831
|
const e = document.scrollingElement || document.documentElement;
|
|
@@ -2782,44 +2833,44 @@ function zi() {
|
|
|
2782
2833
|
const t = window.getComputedStyle(e);
|
|
2783
2834
|
return !(t.overflowY === "hidden" || t.overflowY === "clip");
|
|
2784
2835
|
}
|
|
2785
|
-
function
|
|
2836
|
+
function Bi(e) {
|
|
2786
2837
|
if (!(e instanceof HTMLElement)) return !1;
|
|
2787
|
-
const
|
|
2788
|
-
return !(
|
|
2838
|
+
const n = window.getComputedStyle(e).overflowY;
|
|
2839
|
+
return !(n !== "auto" && n !== "scroll" || e.scrollHeight <= e.clientHeight + 2);
|
|
2789
2840
|
}
|
|
2790
|
-
function
|
|
2841
|
+
function qi() {
|
|
2791
2842
|
if (typeof document > "u") return null;
|
|
2792
2843
|
const e = Array.from(
|
|
2793
2844
|
document.querySelectorAll("body, body *")
|
|
2794
2845
|
);
|
|
2795
|
-
let t = null,
|
|
2846
|
+
let t = null, n = 0;
|
|
2796
2847
|
for (const i of e) {
|
|
2797
|
-
if (
|
|
2848
|
+
if (!Bi(i)) continue;
|
|
2798
2849
|
const a = i.getBoundingClientRect();
|
|
2799
2850
|
if (a.bottom <= 0 || a.top >= window.innerHeight || a.right <= 0 || a.left >= window.innerWidth || a.width <= 0 || a.height <= 0 || i.closest(".ll-widget")) continue;
|
|
2800
2851
|
const o = a.width * a.height;
|
|
2801
|
-
o >
|
|
2852
|
+
o > n && (n = o, t = i);
|
|
2802
2853
|
}
|
|
2803
2854
|
return t;
|
|
2804
2855
|
}
|
|
2805
|
-
function
|
|
2856
|
+
function Ui() {
|
|
2806
2857
|
if (typeof window > "u")
|
|
2807
2858
|
return null;
|
|
2808
|
-
if (
|
|
2809
|
-
const e =
|
|
2859
|
+
if (Wi()) return window;
|
|
2860
|
+
const e = qi();
|
|
2810
2861
|
return e || window;
|
|
2811
2862
|
}
|
|
2812
|
-
function
|
|
2863
|
+
function Tn(e) {
|
|
2813
2864
|
return e instanceof Window ? e.innerHeight || 0 : e.clientHeight || 0;
|
|
2814
2865
|
}
|
|
2815
|
-
function
|
|
2816
|
-
var t,
|
|
2866
|
+
function ji(e) {
|
|
2867
|
+
var t, n;
|
|
2817
2868
|
return e instanceof Window ? typeof document > "u" ? 0 : Math.max(
|
|
2818
2869
|
((t = document.body) == null ? void 0 : t.scrollHeight) ?? 0,
|
|
2819
|
-
((
|
|
2870
|
+
((n = document.documentElement) == null ? void 0 : n.scrollHeight) ?? 0
|
|
2820
2871
|
) : e.scrollHeight - e.clientHeight;
|
|
2821
2872
|
}
|
|
2822
|
-
const
|
|
2873
|
+
const Vi = /* @__PURE__ */ new Set([
|
|
2823
2874
|
"agent_state",
|
|
2824
2875
|
"avatar_stream_ready",
|
|
2825
2876
|
"avatar_active",
|
|
@@ -2849,18 +2900,18 @@ const Wi = /* @__PURE__ */ new Set([
|
|
|
2849
2900
|
// to onAgentCommand.
|
|
2850
2901
|
"task_field_updated",
|
|
2851
2902
|
"task_completed"
|
|
2852
|
-
]),
|
|
2853
|
-
function(t,
|
|
2854
|
-
var
|
|
2903
|
+
]), jn = Gt(
|
|
2904
|
+
function(t, n) {
|
|
2905
|
+
var sn, cn, un, dn, fn, pn, hn;
|
|
2855
2906
|
const {
|
|
2856
2907
|
agentId: i,
|
|
2857
2908
|
apiKey: a,
|
|
2858
2909
|
baseUrl: o = "https://app.livelayer.studio",
|
|
2859
|
-
sessionEndpoint:
|
|
2910
|
+
sessionEndpoint: s,
|
|
2860
2911
|
sessionBody: l,
|
|
2861
|
-
soundEffects:
|
|
2912
|
+
soundEffects: c,
|
|
2862
2913
|
experienceMode: u = "WIDGET",
|
|
2863
|
-
autoConnect:
|
|
2914
|
+
autoConnect: m = !1,
|
|
2864
2915
|
displayMode: p,
|
|
2865
2916
|
// Initial display mode. Mobile gets a smaller card layout (not the
|
|
2866
2917
|
// full-screen sheet) so "expanded" is the right default on every
|
|
@@ -2873,13 +2924,13 @@ const Wi = /* @__PURE__ */ new Set([
|
|
|
2873
2924
|
onDisplayModeChange: P,
|
|
2874
2925
|
position: x = "bottom-right",
|
|
2875
2926
|
mobileBreakpoint: E = 640,
|
|
2876
|
-
draggable:
|
|
2927
|
+
draggable: y,
|
|
2877
2928
|
resizable: w,
|
|
2878
2929
|
persistKey: R = "ll-widget",
|
|
2879
2930
|
disablePersistence: S = !1,
|
|
2880
|
-
teamMembers:
|
|
2931
|
+
teamMembers: v,
|
|
2881
2932
|
currentTeamMemberId: O,
|
|
2882
|
-
onTeamMemberChange:
|
|
2933
|
+
onTeamMemberChange: g,
|
|
2883
2934
|
idleLoopUrl: D,
|
|
2884
2935
|
greeting: W,
|
|
2885
2936
|
avatarImageUrl: K,
|
|
@@ -2900,66 +2951,66 @@ const Wi = /* @__PURE__ */ new Set([
|
|
|
2900
2951
|
hideOn: Q,
|
|
2901
2952
|
pathname: be,
|
|
2902
2953
|
onNavigate: ne,
|
|
2903
|
-
onScrollToSelector:
|
|
2904
|
-
getPageContext:
|
|
2905
|
-
pageContextExtras:
|
|
2906
|
-
getRoutes:
|
|
2907
|
-
onScrollPage:
|
|
2908
|
-
onClick:
|
|
2909
|
-
capabilities:
|
|
2910
|
-
onConnect:
|
|
2911
|
-
onDisconnect:
|
|
2912
|
-
onTranscript:
|
|
2913
|
-
onAgentState:
|
|
2914
|
-
onConnectionStateChange:
|
|
2915
|
-
onAgentEvent:
|
|
2916
|
-
onAgentCommand:
|
|
2917
|
-
onCollect:
|
|
2954
|
+
onScrollToSelector: nt,
|
|
2955
|
+
getPageContext: rt,
|
|
2956
|
+
pageContextExtras: ht,
|
|
2957
|
+
getRoutes: mt,
|
|
2958
|
+
onScrollPage: it,
|
|
2959
|
+
onClick: gt,
|
|
2960
|
+
capabilities: Be,
|
|
2961
|
+
onConnect: qe,
|
|
2962
|
+
onDisconnect: Re,
|
|
2963
|
+
onTranscript: Te,
|
|
2964
|
+
onAgentState: Pe,
|
|
2965
|
+
onConnectionStateChange: De,
|
|
2966
|
+
onAgentEvent: ze,
|
|
2967
|
+
onAgentCommand: Ue,
|
|
2968
|
+
onCollect: $e,
|
|
2918
2969
|
controlledSession: F,
|
|
2919
|
-
className:
|
|
2920
|
-
style:
|
|
2970
|
+
className: He,
|
|
2971
|
+
style: je,
|
|
2921
2972
|
zIndex: we = 2147483647
|
|
2922
|
-
} = t,
|
|
2973
|
+
} = t, yt = Wr(be), Oe = Gr(yt, me, Q);
|
|
2923
2974
|
T(() => {
|
|
2924
|
-
|
|
2925
|
-
}, [
|
|
2926
|
-
const Ne = O !== void 0, [
|
|
2927
|
-
var
|
|
2928
|
-
return O ?? ((
|
|
2929
|
-
}),
|
|
2930
|
-
() => (
|
|
2931
|
-
[
|
|
2932
|
-
),
|
|
2975
|
+
Ei(), Ti();
|
|
2976
|
+
}, [yt]);
|
|
2977
|
+
const Ne = O !== void 0, [At, vt] = M(() => {
|
|
2978
|
+
var b;
|
|
2979
|
+
return O ?? ((b = v == null ? void 0 : v[0]) == null ? void 0 : b.id);
|
|
2980
|
+
}), Fe = Ne ? O : At, ue = tt(
|
|
2981
|
+
() => (v == null ? void 0 : v.find((b) => b.id === Fe)) ?? null,
|
|
2982
|
+
[v, Fe]
|
|
2983
|
+
), ot = (ue == null ? void 0 : ue.agentId) ?? i, le = u === "EMBEDDED", pe = Tr(E), [Ve, Ye] = Ir({
|
|
2933
2984
|
value: p,
|
|
2934
2985
|
defaultValue: h,
|
|
2935
2986
|
onChange: P,
|
|
2936
2987
|
persistKey: R,
|
|
2937
2988
|
disablePersistence: le || S
|
|
2938
|
-
}), ge = le ? "expanded" :
|
|
2939
|
-
} :
|
|
2940
|
-
draggable: !le && (
|
|
2989
|
+
}), ge = le ? "expanded" : Ve, _e = le ? () => {
|
|
2990
|
+
} : Ye, bt = q ?? !le, Mt = X ?? !le, It = te || !le && pe, Ae = Or({
|
|
2991
|
+
draggable: !le && (y ?? !pe),
|
|
2941
2992
|
resizable: !le && (w ?? !pe),
|
|
2942
2993
|
persistKey: R,
|
|
2943
2994
|
disablePersistence: le || S
|
|
2944
|
-
}), Me =
|
|
2945
|
-
|
|
2946
|
-
const
|
|
2947
|
-
|
|
2948
|
-
function Ce(
|
|
2949
|
-
const d =
|
|
2950
|
-
return d ? d.includes(
|
|
2995
|
+
}), Me = br(), Se = Lr(), ye = Cr(), xe = kr(), [wt, Ge] = M(!1), [at, st] = M(!1), [_, re] = M(!1), [Vn, Yn] = M(!1), [Tt, Gn] = M(!1), _t = Kr({ baseUrl: o, config: c }), xt = I(_t);
|
|
2996
|
+
xt.current = _t;
|
|
2997
|
+
const Pt = I(ne), Dt = I(nt), zt = I(it), $t = I(gt), Jt = I(rt), Zt = I(ht), Qt = I(mt), Ht = I(Be), Le = I(null);
|
|
2998
|
+
Pt.current = ne, Dt.current = nt, zt.current = it, $t.current = gt, Jt.current = rt, Zt.current = ht, Qt.current = mt, Ht.current = Be;
|
|
2999
|
+
function Ce(b) {
|
|
3000
|
+
const d = Ht.current;
|
|
3001
|
+
return d ? d.includes(b) : !0;
|
|
2951
3002
|
}
|
|
2952
|
-
function ke(
|
|
3003
|
+
function ke(b, d) {
|
|
2953
3004
|
console.warn(
|
|
2954
|
-
`[LiveLayer] Agent command "${
|
|
3005
|
+
`[LiveLayer] Agent command "${b}" blocked — capability "${d}" not in allowlist. See https://livelayer.studio/docs/react/capabilities`
|
|
2955
3006
|
);
|
|
2956
3007
|
}
|
|
2957
|
-
const
|
|
2958
|
-
(
|
|
2959
|
-
var ie, de, Ee,
|
|
2960
|
-
const d =
|
|
3008
|
+
const ct = C(
|
|
3009
|
+
(b) => {
|
|
3010
|
+
var ie, de, Ee, dt;
|
|
3011
|
+
const d = b;
|
|
2961
3012
|
if (!(!d.type || typeof d.type != "string")) {
|
|
2962
|
-
if (
|
|
3013
|
+
if (ze == null || ze({ eventName: d.type, data: b }), d.type === "navigate") {
|
|
2963
3014
|
if (!Ce("navigate")) {
|
|
2964
3015
|
ke("navigate", "navigate");
|
|
2965
3016
|
return;
|
|
@@ -2971,9 +3022,9 @@ const Wi = /* @__PURE__ */ new Set([
|
|
|
2971
3022
|
);
|
|
2972
3023
|
return;
|
|
2973
3024
|
}
|
|
2974
|
-
if (
|
|
3025
|
+
if (xt.current.playPageChange(), Pt.current) {
|
|
2975
3026
|
try {
|
|
2976
|
-
|
|
3027
|
+
Pt.current(A);
|
|
2977
3028
|
} catch (H) {
|
|
2978
3029
|
console.warn(
|
|
2979
3030
|
`[LiveLayer] onNavigate threw for "${A}". Falling back. Error:`,
|
|
@@ -3010,9 +3061,9 @@ const Wi = /* @__PURE__ */ new Set([
|
|
|
3010
3061
|
const A = typeof d.selector == "string" ? d.selector : null;
|
|
3011
3062
|
if (!A) return;
|
|
3012
3063
|
const H = d.behavior === "instant" ? "instant" : "smooth";
|
|
3013
|
-
if (
|
|
3064
|
+
if (Dt.current) {
|
|
3014
3065
|
try {
|
|
3015
|
-
|
|
3066
|
+
Dt.current(
|
|
3016
3067
|
A,
|
|
3017
3068
|
H
|
|
3018
3069
|
);
|
|
@@ -3053,12 +3104,12 @@ const Wi = /* @__PURE__ */ new Set([
|
|
|
3053
3104
|
const B = H, ce = B == null ? void 0 : B.localParticipant;
|
|
3054
3105
|
if (ce != null && ce.publishData)
|
|
3055
3106
|
try {
|
|
3056
|
-
const he = A ? { ...Z, requestId: A } : Z,
|
|
3057
|
-
ce.publishData(
|
|
3107
|
+
const he = A ? { ...Z, requestId: A } : Z, Je = new TextEncoder().encode(JSON.stringify(he));
|
|
3108
|
+
ce.publishData(Je, { reliable: !0 });
|
|
3058
3109
|
} catch (he) {
|
|
3059
3110
|
console.warn("[LiveLayer] publishData failed.", he);
|
|
3060
3111
|
}
|
|
3061
|
-
}, j =
|
|
3112
|
+
}, j = Zt.current, J = Jt.current;
|
|
3062
3113
|
try {
|
|
3063
3114
|
if (J) {
|
|
3064
3115
|
const Z = J(j);
|
|
@@ -3069,7 +3120,7 @@ const Wi = /* @__PURE__ */ new Set([
|
|
|
3069
3120
|
B
|
|
3070
3121
|
), Y({
|
|
3071
3122
|
type: "page_context",
|
|
3072
|
-
context:
|
|
3123
|
+
context: Mn(j)
|
|
3073
3124
|
});
|
|
3074
3125
|
});
|
|
3075
3126
|
return;
|
|
@@ -3079,7 +3130,7 @@ const Wi = /* @__PURE__ */ new Set([
|
|
|
3079
3130
|
}
|
|
3080
3131
|
Y({
|
|
3081
3132
|
type: "page_context",
|
|
3082
|
-
context:
|
|
3133
|
+
context: Mn(j)
|
|
3083
3134
|
});
|
|
3084
3135
|
} catch (Z) {
|
|
3085
3136
|
console.warn(
|
|
@@ -3105,9 +3156,9 @@ const Wi = /* @__PURE__ */ new Set([
|
|
|
3105
3156
|
return;
|
|
3106
3157
|
}
|
|
3107
3158
|
const H = d.behavior === "instant" ? "instant" : "smooth";
|
|
3108
|
-
if (
|
|
3159
|
+
if (zt.current) {
|
|
3109
3160
|
try {
|
|
3110
|
-
|
|
3161
|
+
zt.current(
|
|
3111
3162
|
A,
|
|
3112
3163
|
H
|
|
3113
3164
|
);
|
|
@@ -3117,12 +3168,12 @@ const Wi = /* @__PURE__ */ new Set([
|
|
|
3117
3168
|
return;
|
|
3118
3169
|
}
|
|
3119
3170
|
if (typeof window > "u") return;
|
|
3120
|
-
const Y = { behavior: H }, j =
|
|
3171
|
+
const Y = { behavior: H }, j = Ui(), J = (B) => {
|
|
3121
3172
|
j instanceof Window ? j.scrollBy({ top: B, ...Y }) : j.scrollBy({ top: B, ...Y });
|
|
3122
3173
|
}, Z = (B) => {
|
|
3123
3174
|
j instanceof Window ? j.scrollTo({ top: B, ...Y }) : j.scrollTo({ top: B, ...Y });
|
|
3124
3175
|
};
|
|
3125
|
-
A === "up" ? J(-
|
|
3176
|
+
A === "up" ? J(-Tn(j)) : A === "down" ? J(Tn(j)) : Z(A === "top" ? 0 : ji(j));
|
|
3126
3177
|
return;
|
|
3127
3178
|
}
|
|
3128
3179
|
if (d.type === "click") {
|
|
@@ -3135,9 +3186,9 @@ const Wi = /* @__PURE__ */ new Set([
|
|
|
3135
3186
|
console.warn("[LiveLayer] click: missing selector.");
|
|
3136
3187
|
return;
|
|
3137
3188
|
}
|
|
3138
|
-
if (
|
|
3189
|
+
if ($t.current) {
|
|
3139
3190
|
try {
|
|
3140
|
-
|
|
3191
|
+
$t.current(A);
|
|
3141
3192
|
} catch (Y) {
|
|
3142
3193
|
console.warn("[LiveLayer] onClick threw.", Y);
|
|
3143
3194
|
}
|
|
@@ -3174,13 +3225,13 @@ const Wi = /* @__PURE__ */ new Set([
|
|
|
3174
3225
|
return;
|
|
3175
3226
|
}
|
|
3176
3227
|
if (typeof document > "u") return;
|
|
3177
|
-
d.type === "fill_form" &&
|
|
3228
|
+
d.type === "fill_form" && xt.current.playConfirmation();
|
|
3178
3229
|
const A = typeof d.formId == "string" ? d.formId : null;
|
|
3179
3230
|
if (!A) {
|
|
3180
3231
|
console.warn(`[LiveLayer] ${d.type}: missing formId.`);
|
|
3181
3232
|
return;
|
|
3182
3233
|
}
|
|
3183
|
-
const H =
|
|
3234
|
+
const H = Rn(document, A);
|
|
3184
3235
|
if (!H) {
|
|
3185
3236
|
console.warn(
|
|
3186
3237
|
`[LiveLayer] ${d.type}: no <form> matched id="${A}" (or matching name / data-ll-intent slug). Forms are auto-discovered — make sure the form has an \`id\`, \`name\`, or \`data-ll-intent\` attribute the agent observed in PageContext.forms.`
|
|
@@ -3199,7 +3250,7 @@ const Wi = /* @__PURE__ */ new Set([
|
|
|
3199
3250
|
console.warn("[LiveLayer] focus_field: missing fieldName.");
|
|
3200
3251
|
return;
|
|
3201
3252
|
}
|
|
3202
|
-
const J =
|
|
3253
|
+
const J = In(H, j);
|
|
3203
3254
|
if (J.el === null) {
|
|
3204
3255
|
J.reason === "private" ? console.warn(
|
|
3205
3256
|
`[LiveLayer] focus_field: field "${j}" is privacy-protected and not focusable.`
|
|
@@ -3218,7 +3269,7 @@ const Wi = /* @__PURE__ */ new Set([
|
|
|
3218
3269
|
}
|
|
3219
3270
|
for (const [j, J] of Object.entries(Y)) {
|
|
3220
3271
|
if (typeof J != "string") continue;
|
|
3221
|
-
const Z =
|
|
3272
|
+
const Z = In(H, j);
|
|
3222
3273
|
if (Z.el === null) {
|
|
3223
3274
|
Z.reason === "private" ? console.warn(
|
|
3224
3275
|
`[LiveLayer] fill_form: field "${j}" is privacy-protected (password / cc-* / data-ll-private). Skipping.`
|
|
@@ -3228,7 +3279,7 @@ const Wi = /* @__PURE__ */ new Set([
|
|
|
3228
3279
|
continue;
|
|
3229
3280
|
}
|
|
3230
3281
|
try {
|
|
3231
|
-
|
|
3282
|
+
Oi(Z.el, J);
|
|
3232
3283
|
} catch (B) {
|
|
3233
3284
|
console.warn(
|
|
3234
3285
|
`[LiveLayer] fill_form: failed to set "${j}".`,
|
|
@@ -3249,8 +3300,8 @@ const Wi = /* @__PURE__ */ new Set([
|
|
|
3249
3300
|
console.warn("[LiveLayer] submit_form: missing formId.");
|
|
3250
3301
|
return;
|
|
3251
3302
|
}
|
|
3252
|
-
|
|
3253
|
-
const H =
|
|
3303
|
+
xt.current.playConfirmation();
|
|
3304
|
+
const H = Rn(document, A);
|
|
3254
3305
|
if (!H) {
|
|
3255
3306
|
console.warn(
|
|
3256
3307
|
`[LiveLayer] submit_form: no <form> matched id="${A}" (or matching name / data-ll-intent slug).`
|
|
@@ -3264,11 +3315,11 @@ const Wi = /* @__PURE__ */ new Set([
|
|
|
3264
3315
|
return;
|
|
3265
3316
|
}
|
|
3266
3317
|
const Y = typeof d.requestId == "string" ? d.requestId : void 0, j = (Ee = Le.current) == null ? void 0 : Ee.call(Le), J = (ce) => {
|
|
3267
|
-
const he = j,
|
|
3268
|
-
if (
|
|
3318
|
+
const he = j, Je = he == null ? void 0 : he.localParticipant;
|
|
3319
|
+
if (Je != null && Je.publishData)
|
|
3269
3320
|
try {
|
|
3270
|
-
const
|
|
3271
|
-
|
|
3321
|
+
const sr = Y ? { ...ce, requestId: Y } : ce, cr = new TextEncoder().encode(JSON.stringify(sr));
|
|
3322
|
+
Je.publishData(cr, { reliable: !0 });
|
|
3272
3323
|
} catch {
|
|
3273
3324
|
}
|
|
3274
3325
|
};
|
|
@@ -3301,7 +3352,7 @@ const Wi = /* @__PURE__ */ new Set([
|
|
|
3301
3352
|
ke("request_routes", "read_page");
|
|
3302
3353
|
return;
|
|
3303
3354
|
}
|
|
3304
|
-
const A = typeof d.requestId == "string" ? d.requestId : void 0, Y = (
|
|
3355
|
+
const A = typeof d.requestId == "string" ? d.requestId : void 0, Y = (dt = Le.current) == null ? void 0 : dt.call(Le), j = Y == null ? void 0 : Y.localParticipant;
|
|
3305
3356
|
if (!(j != null && j.publishData)) return;
|
|
3306
3357
|
const J = (B) => {
|
|
3307
3358
|
try {
|
|
@@ -3310,7 +3361,7 @@ const Wi = /* @__PURE__ */ new Set([
|
|
|
3310
3361
|
} catch (ce) {
|
|
3311
3362
|
console.warn("[LiveLayer] request_routes: publishData failed.", ce);
|
|
3312
3363
|
}
|
|
3313
|
-
}, Z =
|
|
3364
|
+
}, Z = Qt.current;
|
|
3314
3365
|
if (Z) {
|
|
3315
3366
|
try {
|
|
3316
3367
|
const B = Z(), ce = (he) => {
|
|
@@ -3318,24 +3369,24 @@ const Wi = /* @__PURE__ */ new Set([
|
|
|
3318
3369
|
J([]);
|
|
3319
3370
|
return;
|
|
3320
3371
|
}
|
|
3321
|
-
J(he.map(
|
|
3372
|
+
J(he.map(Ai).slice(0, 200));
|
|
3322
3373
|
};
|
|
3323
3374
|
B instanceof Promise ? B.then(ce).catch((he) => {
|
|
3324
3375
|
console.warn(
|
|
3325
3376
|
"[LiveLayer] getRoutes rejected; falling back to DOM walker.",
|
|
3326
3377
|
he
|
|
3327
|
-
), J(
|
|
3378
|
+
), J(qt());
|
|
3328
3379
|
}) : ce(B);
|
|
3329
3380
|
} catch (B) {
|
|
3330
3381
|
console.warn(
|
|
3331
3382
|
"[LiveLayer] getRoutes threw; falling back to DOM walker.",
|
|
3332
3383
|
B
|
|
3333
|
-
), J(
|
|
3384
|
+
), J(qt());
|
|
3334
3385
|
}
|
|
3335
3386
|
return;
|
|
3336
3387
|
}
|
|
3337
3388
|
try {
|
|
3338
|
-
J(
|
|
3389
|
+
J(qt());
|
|
3339
3390
|
} catch (B) {
|
|
3340
3391
|
console.warn("[LiveLayer] request_routes: extractRoutes threw.", B);
|
|
3341
3392
|
}
|
|
@@ -3387,7 +3438,7 @@ const Wi = /* @__PURE__ */ new Set([
|
|
|
3387
3438
|
} catch {
|
|
3388
3439
|
}
|
|
3389
3440
|
try {
|
|
3390
|
-
|
|
3441
|
+
$e == null || $e(
|
|
3391
3442
|
A
|
|
3392
3443
|
);
|
|
3393
3444
|
} catch (H) {
|
|
@@ -3395,40 +3446,40 @@ const Wi = /* @__PURE__ */ new Set([
|
|
|
3395
3446
|
}
|
|
3396
3447
|
return;
|
|
3397
3448
|
}
|
|
3398
|
-
|
|
3449
|
+
Vi.has(d.type) || Ue == null || Ue(d);
|
|
3399
3450
|
}
|
|
3400
3451
|
},
|
|
3401
|
-
[
|
|
3402
|
-
), se =
|
|
3403
|
-
agentId: F ? "__controlled__" :
|
|
3452
|
+
[Ue, ze, $e]
|
|
3453
|
+
), se = vr({
|
|
3454
|
+
agentId: F ? "__controlled__" : ot,
|
|
3404
3455
|
baseUrl: o,
|
|
3405
3456
|
apiKey: a,
|
|
3406
|
-
sessionEndpoint:
|
|
3457
|
+
sessionEndpoint: s,
|
|
3407
3458
|
sessionBody: l,
|
|
3408
|
-
onDataMessage: F ? void 0 :
|
|
3459
|
+
onDataMessage: F ? void 0 : ct
|
|
3409
3460
|
});
|
|
3410
3461
|
T(() => {
|
|
3411
3462
|
if (F != null && F.subscribeToDataMessages)
|
|
3412
|
-
return F.subscribeToDataMessages(
|
|
3413
|
-
}, [F,
|
|
3414
|
-
var
|
|
3415
|
-
return (
|
|
3463
|
+
return F.subscribeToDataMessages(ct);
|
|
3464
|
+
}, [F, ct]), Le.current = () => {
|
|
3465
|
+
var b;
|
|
3466
|
+
return (b = se.getRoom) == null ? void 0 : b.call(se);
|
|
3416
3467
|
}, T(() => {
|
|
3417
3468
|
var ie;
|
|
3418
3469
|
if (typeof window > "u") return;
|
|
3419
|
-
const
|
|
3420
|
-
if (
|
|
3470
|
+
const b = ((ie = window.location) == null ? void 0 : ie.hostname) || "";
|
|
3471
|
+
if (b === "localhost" || b === "127.0.0.1" || b === "0.0.0.0" || b.endsWith(".local") || b.endsWith(".test"))
|
|
3421
3472
|
return window.__livelayerSimulateCommand = (de) => {
|
|
3422
3473
|
try {
|
|
3423
|
-
|
|
3474
|
+
ct(de);
|
|
3424
3475
|
} catch (Ee) {
|
|
3425
3476
|
console.warn("[LiveLayer] simulate-command threw:", Ee);
|
|
3426
3477
|
}
|
|
3427
3478
|
}, () => {
|
|
3428
3479
|
delete window.__livelayerSimulateCommand;
|
|
3429
3480
|
};
|
|
3430
|
-
}, [
|
|
3431
|
-
const L =
|
|
3481
|
+
}, [ct]);
|
|
3482
|
+
const L = tt(() => F ? {
|
|
3432
3483
|
connectionState: F.connectionState,
|
|
3433
3484
|
agentState: F.agentState,
|
|
3434
3485
|
transcript: F.transcript,
|
|
@@ -3459,27 +3510,27 @@ const Wi = /* @__PURE__ */ new Set([
|
|
|
3459
3510
|
disconnect: se.disconnect,
|
|
3460
3511
|
getRoom: se.getRoom,
|
|
3461
3512
|
isControlled: !1
|
|
3462
|
-
}, [F, se]),
|
|
3463
|
-
|
|
3464
|
-
const
|
|
3465
|
-
|
|
3466
|
-
|
|
3513
|
+
}, [F, se]), en = I(L);
|
|
3514
|
+
en.current = L;
|
|
3515
|
+
const tn = I(F);
|
|
3516
|
+
tn.current = F, dr(
|
|
3517
|
+
n,
|
|
3467
3518
|
() => ({
|
|
3468
|
-
sendData: async (
|
|
3469
|
-
var Ee,
|
|
3470
|
-
const d =
|
|
3519
|
+
sendData: async (b) => {
|
|
3520
|
+
var Ee, dt;
|
|
3521
|
+
const d = tn.current;
|
|
3471
3522
|
if (d != null && d.publishData) {
|
|
3472
3523
|
try {
|
|
3473
|
-
await d.publishData(
|
|
3524
|
+
await d.publishData(b);
|
|
3474
3525
|
} catch (A) {
|
|
3475
3526
|
console.warn("[AvatarWidget] sendData (controlled) failed:", A);
|
|
3476
3527
|
}
|
|
3477
3528
|
return;
|
|
3478
3529
|
}
|
|
3479
|
-
const ie = (
|
|
3530
|
+
const ie = (dt = (Ee = en.current) == null ? void 0 : Ee.getRoom) == null ? void 0 : dt.call(Ee), de = ie == null ? void 0 : ie.localParticipant;
|
|
3480
3531
|
if (de != null && de.publishData)
|
|
3481
3532
|
try {
|
|
3482
|
-
const A = new TextEncoder().encode(JSON.stringify(
|
|
3533
|
+
const A = new TextEncoder().encode(JSON.stringify(b));
|
|
3483
3534
|
await de.publishData(A, { reliable: !0 });
|
|
3484
3535
|
} catch (A) {
|
|
3485
3536
|
console.warn("[AvatarWidget] sendData failed:", A);
|
|
@@ -3488,59 +3539,59 @@ const Wi = /* @__PURE__ */ new Set([
|
|
|
3488
3539
|
}),
|
|
3489
3540
|
[]
|
|
3490
3541
|
);
|
|
3491
|
-
const
|
|
3542
|
+
const nn = I(null);
|
|
3492
3543
|
T(() => {
|
|
3493
|
-
const
|
|
3494
|
-
if (!(!
|
|
3495
|
-
return d.appendChild(
|
|
3496
|
-
|
|
3544
|
+
const b = L.videoElement, d = nn.current;
|
|
3545
|
+
if (!(!b || !d))
|
|
3546
|
+
return d.appendChild(b), () => {
|
|
3547
|
+
b.parentNode === d && d.removeChild(b);
|
|
3497
3548
|
};
|
|
3498
3549
|
}, [L.videoElement]);
|
|
3499
|
-
const [
|
|
3550
|
+
const [Xe, Lt] = M(!1);
|
|
3500
3551
|
T(() => {
|
|
3501
3552
|
if (!z) {
|
|
3502
|
-
|
|
3553
|
+
Lt(!0);
|
|
3503
3554
|
return;
|
|
3504
3555
|
}
|
|
3505
|
-
L.agentState === "speaking" && !
|
|
3506
|
-
}, [z, L.agentState,
|
|
3556
|
+
L.agentState === "speaking" && !Xe && Lt(!0);
|
|
3557
|
+
}, [z, L.agentState, Xe]), T(() => {
|
|
3507
3558
|
if (!z) return;
|
|
3508
|
-
const
|
|
3509
|
-
(
|
|
3559
|
+
const b = L.connectionState;
|
|
3560
|
+
(b === "disconnected" || b === "idle") && Lt(!1);
|
|
3510
3561
|
}, [z, L.connectionState]), T(() => {
|
|
3511
|
-
if (!z || !L.videoElement ||
|
|
3512
|
-
const
|
|
3513
|
-
return () => clearTimeout(
|
|
3514
|
-
}, [z, L.videoElement,
|
|
3515
|
-
const
|
|
3516
|
-
if (
|
|
3562
|
+
if (!z || !L.videoElement || Xe) return;
|
|
3563
|
+
const b = setTimeout(() => Lt(!0), 5e3);
|
|
3564
|
+
return () => clearTimeout(b);
|
|
3565
|
+
}, [z, L.videoElement, Xe]), T(() => {
|
|
3566
|
+
const b = L.videoElement;
|
|
3567
|
+
if (b) {
|
|
3517
3568
|
if (!z) {
|
|
3518
|
-
|
|
3569
|
+
b.style.filter = "";
|
|
3519
3570
|
return;
|
|
3520
3571
|
}
|
|
3521
|
-
|
|
3572
|
+
b.style.transition = "filter 500ms ease-out", b.style.filter = Xe ? "" : "blur(8px)";
|
|
3522
3573
|
}
|
|
3523
|
-
}, [z, L.videoElement,
|
|
3524
|
-
const
|
|
3525
|
-
if (!
|
|
3574
|
+
}, [z, L.videoElement, Xe]), T(() => {
|
|
3575
|
+
const b = L.audioElement;
|
|
3576
|
+
if (!b) return;
|
|
3526
3577
|
const d = document.createElement("div");
|
|
3527
|
-
d.className = "ll-audio-sink", d.setAttribute("aria-hidden", "true"), d.style.cssText = "position:absolute;width:0;height:0;overflow:hidden;clip:rect(0 0 0 0);pointer-events:none;", d.appendChild(
|
|
3528
|
-
const ie =
|
|
3578
|
+
d.className = "ll-audio-sink", d.setAttribute("aria-hidden", "true"), d.style.cssText = "position:absolute;width:0;height:0;overflow:hidden;clip:rect(0 0 0 0);pointer-events:none;", d.appendChild(b), document.body.appendChild(d), Me.attach(b);
|
|
3579
|
+
const ie = b.play();
|
|
3529
3580
|
return ie && typeof ie.catch == "function" && ie.catch((de) => {
|
|
3530
|
-
(de == null ? void 0 : de.name) === "NotAllowedError" &&
|
|
3581
|
+
(de == null ? void 0 : de.name) === "NotAllowedError" && Ge(!0);
|
|
3531
3582
|
}), () => {
|
|
3532
|
-
Me.detach(),
|
|
3583
|
+
Me.detach(), b.parentNode === d && d.removeChild(b), d.parentNode === document.body && document.body.removeChild(d);
|
|
3533
3584
|
};
|
|
3534
3585
|
}, [L.audioElement]);
|
|
3535
|
-
const ve =
|
|
3586
|
+
const ve = _r({
|
|
3536
3587
|
gateUntilAgentReady: !0,
|
|
3537
3588
|
agentState: L.agentState
|
|
3538
3589
|
});
|
|
3539
3590
|
T(() => {
|
|
3540
3591
|
if (L.isControlled || L.connectionState !== "connected") return;
|
|
3541
|
-
const
|
|
3542
|
-
if (
|
|
3543
|
-
return ve.setupMic(
|
|
3592
|
+
const b = L.getRoom();
|
|
3593
|
+
if (b)
|
|
3594
|
+
return ve.setupMic(b).then(() => {
|
|
3544
3595
|
const d = ve.getMicStream();
|
|
3545
3596
|
d && Me.attachStream(d, "mic");
|
|
3546
3597
|
}).catch(() => {
|
|
@@ -3550,17 +3601,17 @@ const Wi = /* @__PURE__ */ new Set([
|
|
|
3550
3601
|
}, [L.isControlled, L.connectionState]), T(() => {
|
|
3551
3602
|
var d;
|
|
3552
3603
|
if (L.connectionState !== "connected") return;
|
|
3553
|
-
const
|
|
3554
|
-
if (
|
|
3555
|
-
return Se.attachRoom(
|
|
3604
|
+
const b = L.isControlled ? (d = F == null ? void 0 : F.getRoom) == null ? void 0 : d.call(F) : L.getRoom();
|
|
3605
|
+
if (b)
|
|
3606
|
+
return Se.attachRoom(b), ye.attachRoom(b), L.isControlled && ve.attachRoom(b), xe.refresh(), () => {
|
|
3556
3607
|
Se.teardown(), ye.teardown();
|
|
3557
3608
|
};
|
|
3558
3609
|
}, [L.isControlled, L.connectionState, F]), T(() => {
|
|
3559
|
-
const
|
|
3560
|
-
|
|
3561
|
-
}, [L.audioElement,
|
|
3562
|
-
const
|
|
3563
|
-
const d = { type: "user_message", text:
|
|
3610
|
+
const b = L.audioElement;
|
|
3611
|
+
b && (b.muted = Tt);
|
|
3612
|
+
}, [L.audioElement, Tt]);
|
|
3613
|
+
const Xn = C((b) => {
|
|
3614
|
+
const d = { type: "user_message", text: b };
|
|
3564
3615
|
if (F != null && F.publishData) {
|
|
3565
3616
|
try {
|
|
3566
3617
|
F.publishData(d);
|
|
@@ -3575,99 +3626,99 @@ const Wi = /* @__PURE__ */ new Set([
|
|
|
3575
3626
|
ie.localParticipant.publishData(de, { reliable: !0 });
|
|
3576
3627
|
} catch {
|
|
3577
3628
|
}
|
|
3578
|
-
}, [L, F]),
|
|
3579
|
-
|
|
3629
|
+
}, [L, F]), Kn = C(() => {
|
|
3630
|
+
Gn((b) => !b);
|
|
3580
3631
|
}, []);
|
|
3581
3632
|
T(() => {
|
|
3582
|
-
|
|
3583
|
-
}, [L.connectionState,
|
|
3584
|
-
|
|
3585
|
-
}, [L.transcript,
|
|
3586
|
-
|
|
3587
|
-
}, [L.agentState,
|
|
3588
|
-
|
|
3589
|
-
}, [L.agentState,
|
|
3590
|
-
const
|
|
3633
|
+
De == null || De(L.connectionState), L.connectionState === "connected" ? qe == null || qe() : L.connectionState === "disconnected" && (Re == null || Re());
|
|
3634
|
+
}, [L.connectionState, qe, Re, De]), T(() => {
|
|
3635
|
+
Te == null || Te(L.transcript);
|
|
3636
|
+
}, [L.transcript, Te]), T(() => {
|
|
3637
|
+
Pe == null || Pe(L.agentState);
|
|
3638
|
+
}, [L.agentState, Pe]), T(() => {
|
|
3639
|
+
_t.setThinking(L.agentState === "thinking");
|
|
3640
|
+
}, [L.agentState, _t]);
|
|
3641
|
+
const rn = I(!1);
|
|
3591
3642
|
T(() => {
|
|
3592
|
-
!
|
|
3593
|
-
}, [
|
|
3594
|
-
const
|
|
3595
|
-
(
|
|
3596
|
-
const d =
|
|
3597
|
-
d && (re(!1),
|
|
3643
|
+
!m || rn.current || Oe && L.connectionState === "idle" && (rn.current = !0, L.connect());
|
|
3644
|
+
}, [m, L.connectionState, L, Oe]);
|
|
3645
|
+
const Jn = C(
|
|
3646
|
+
(b) => {
|
|
3647
|
+
const d = v == null ? void 0 : v.find((ie) => ie.id === b);
|
|
3648
|
+
d && (re(!1), b !== Fe && (st(!0), L.disconnect(), Ne || vt(b), g == null || g(d)));
|
|
3598
3649
|
},
|
|
3599
3650
|
[
|
|
3600
|
-
|
|
3601
|
-
|
|
3651
|
+
v,
|
|
3652
|
+
Fe,
|
|
3602
3653
|
L,
|
|
3603
3654
|
Ne,
|
|
3604
|
-
|
|
3655
|
+
g
|
|
3605
3656
|
]
|
|
3606
3657
|
);
|
|
3607
3658
|
T(() => {
|
|
3608
|
-
|
|
3609
|
-
}, [L.connectionState,
|
|
3659
|
+
at && L.connectionState === "connected" && st(!1);
|
|
3660
|
+
}, [L.connectionState, at]), T(() => {
|
|
3610
3661
|
if (!_) return;
|
|
3611
|
-
const
|
|
3662
|
+
const b = (d) => {
|
|
3612
3663
|
d.key === "Escape" && re(!1);
|
|
3613
3664
|
};
|
|
3614
|
-
return window.addEventListener("keydown",
|
|
3665
|
+
return window.addEventListener("keydown", b), () => window.removeEventListener("keydown", b);
|
|
3615
3666
|
}, [_]);
|
|
3616
|
-
const
|
|
3617
|
-
|
|
3618
|
-
const
|
|
3667
|
+
const Zn = !!K || !!(ue != null && ue.avatarImageUrl) || L.isControlled, ut = Sr(ot, o, Zn);
|
|
3668
|
+
Be === void 0 && ((sn = ut.info) != null && sn.capabilities) && (Ht.current = ut.info.capabilities);
|
|
3669
|
+
const Ct = (ue == null ? void 0 : ue.name) ?? ae ?? ((cn = L.agentConfig) == null ? void 0 : cn.name) ?? ((un = ut.info) == null ? void 0 : un.name) ?? "Live Layer", Ot = (ue == null ? void 0 : ue.avatarImageUrl) ?? K ?? ((dn = L.agentConfig) == null ? void 0 : dn.avatarImageUrl) ?? ((fn = ut.info) == null ? void 0 : fn.avatarImageUrl) ?? null, Qn = D ?? ((pn = L.agentConfig) == null ? void 0 : pn.idleLoopUrl) ?? ((hn = ut.info) == null ? void 0 : hn.idleLoopUrl) ?? null, er = W ?? null, tr = C(() => _e("expanded"), [_e]), nr = C(
|
|
3619
3670
|
() => _e("minimized"),
|
|
3620
3671
|
[_e]
|
|
3621
|
-
),
|
|
3672
|
+
), on = C(() => {
|
|
3622
3673
|
L.disconnect(), _e("hidden");
|
|
3623
|
-
}, [L, _e]),
|
|
3624
|
-
const
|
|
3625
|
-
|
|
3674
|
+
}, [L, _e]), rr = C(() => {
|
|
3675
|
+
const b = L.audioElement;
|
|
3676
|
+
b && b.play().then(() => Ge(!1)).catch(() => {
|
|
3626
3677
|
});
|
|
3627
|
-
}, [L.audioElement]),
|
|
3628
|
-
|
|
3629
|
-
}, [L]),
|
|
3630
|
-
...
|
|
3678
|
+
}, [L.audioElement]), ir = C(() => {
|
|
3679
|
+
Ge(!1), L.connect();
|
|
3680
|
+
}, [L]), Ke = {
|
|
3681
|
+
...je,
|
|
3631
3682
|
...le ? {} : { zIndex: we }
|
|
3632
3683
|
};
|
|
3633
|
-
$.primaryColor && (
|
|
3634
|
-
const
|
|
3635
|
-
...
|
|
3684
|
+
$.primaryColor && (Ke["--ll-color-primary"] = $.primaryColor), $.accentColor && (Ke["--ll-color-accent"] = $.accentColor), $.backgroundColor && (Ke["--ll-color-bg"] = $.backgroundColor), $.textColor && (Ke["--ll-color-fg"] = $.textColor);
|
|
3685
|
+
const or = {
|
|
3686
|
+
...Ke,
|
|
3636
3687
|
...Ae.style
|
|
3637
|
-
},
|
|
3688
|
+
}, lr = [
|
|
3638
3689
|
"ll-widget",
|
|
3639
3690
|
`ll-widget--${ge}`,
|
|
3640
3691
|
`ll-widget--${pe ? "mobile" : "desktop"}`,
|
|
3641
3692
|
Ae.hasGeometry ? "ll-widget--has-geometry" : null,
|
|
3642
3693
|
Ae.isDragging ? "is-dragging" : null,
|
|
3643
3694
|
Ae.isResizing ? "is-resizing" : null,
|
|
3644
|
-
|
|
3695
|
+
He
|
|
3645
3696
|
].filter(Boolean).join(" ");
|
|
3646
|
-
if (!
|
|
3647
|
-
const
|
|
3697
|
+
if (!Oe) return null;
|
|
3698
|
+
const ar = /* @__PURE__ */ r(
|
|
3648
3699
|
"div",
|
|
3649
3700
|
{
|
|
3650
|
-
className:
|
|
3651
|
-
style:
|
|
3701
|
+
className: lr,
|
|
3702
|
+
style: or,
|
|
3652
3703
|
"data-display-mode": ge,
|
|
3653
3704
|
"data-position": x,
|
|
3654
3705
|
"data-experience-mode": u === "EMBEDDED" ? "embedded" : "widget",
|
|
3655
|
-
children: ge === "expanded" && /* @__PURE__ */
|
|
3656
|
-
|
|
3706
|
+
children: ge === "expanded" && /* @__PURE__ */ r(
|
|
3707
|
+
pi,
|
|
3657
3708
|
{
|
|
3658
3709
|
position: x,
|
|
3659
3710
|
isMobile: pe,
|
|
3660
|
-
agentName:
|
|
3661
|
-
avatarImageUrl:
|
|
3662
|
-
idleLoopUrl:
|
|
3663
|
-
greeting:
|
|
3711
|
+
agentName: Ct,
|
|
3712
|
+
avatarImageUrl: Ot,
|
|
3713
|
+
idleLoopUrl: Qn,
|
|
3714
|
+
greeting: er,
|
|
3664
3715
|
branding: $,
|
|
3665
|
-
teamMembers:
|
|
3666
|
-
currentTeamMemberId:
|
|
3667
|
-
isSwitchingTeamMember:
|
|
3716
|
+
teamMembers: v,
|
|
3717
|
+
currentTeamMemberId: Fe,
|
|
3718
|
+
isSwitchingTeamMember: at,
|
|
3668
3719
|
teamSwitcherOpen: _,
|
|
3669
|
-
onToggleTeamSwitcher: () => re((
|
|
3670
|
-
onSelectTeamMember:
|
|
3720
|
+
onToggleTeamSwitcher: () => re((b) => !b),
|
|
3721
|
+
onSelectTeamMember: Jn,
|
|
3671
3722
|
connectionState: L.connectionState,
|
|
3672
3723
|
agentState: L.agentState,
|
|
3673
3724
|
transcript: L.transcript,
|
|
@@ -3680,44 +3731,44 @@ const Wi = /* @__PURE__ */ new Set([
|
|
|
3680
3731
|
activeCameraId: Se.activeDeviceId,
|
|
3681
3732
|
isScreenShareEnabled: ye.isEnabled,
|
|
3682
3733
|
screenPreviewEl: ye.previewEl,
|
|
3683
|
-
isSpeakerMuted:
|
|
3734
|
+
isSpeakerMuted: Tt,
|
|
3684
3735
|
allowCamera: G,
|
|
3685
3736
|
allowScreenShare: f,
|
|
3686
3737
|
allowTyping: N,
|
|
3687
|
-
showMinimize: pe && !le ? !1 :
|
|
3688
|
-
showClose:
|
|
3738
|
+
showMinimize: pe && !le ? !1 : bt,
|
|
3739
|
+
showClose: Mt,
|
|
3689
3740
|
chromeless: ee,
|
|
3690
|
-
compactControls:
|
|
3741
|
+
compactControls: It,
|
|
3691
3742
|
transforming: oe,
|
|
3692
3743
|
transformingLabel: U,
|
|
3693
|
-
languageMenuOpen:
|
|
3694
|
-
onToggleLanguageMenu: () =>
|
|
3695
|
-
needsUserGesture:
|
|
3744
|
+
languageMenuOpen: Vn,
|
|
3745
|
+
onToggleLanguageMenu: () => Yn((b) => !b),
|
|
3746
|
+
needsUserGesture: wt,
|
|
3696
3747
|
canResume: L.canResume,
|
|
3697
3748
|
micError: ve.micError,
|
|
3698
3749
|
error: L.error,
|
|
3699
|
-
avatarVideoContainerRef:
|
|
3750
|
+
avatarVideoContainerRef: nn,
|
|
3700
3751
|
agentVideoEl: L.videoElement,
|
|
3701
3752
|
onConnect: () => void L.connect(),
|
|
3702
3753
|
onDisconnect: () => L.disconnect(),
|
|
3703
|
-
onRetry:
|
|
3704
|
-
onResumeAudio:
|
|
3754
|
+
onRetry: ir,
|
|
3755
|
+
onResumeAudio: rr,
|
|
3705
3756
|
onToggleMute: ve.toggleMute,
|
|
3706
|
-
onSwitchMicDevice: (
|
|
3757
|
+
onSwitchMicDevice: (b) => void ve.switchDevice(b),
|
|
3707
3758
|
onToggleCamera: () => void Se.toggle(),
|
|
3708
|
-
onSwitchCameraDevice: (
|
|
3759
|
+
onSwitchCameraDevice: (b) => void Se.switchDevice(b),
|
|
3709
3760
|
onToggleScreenShare: () => void ye.toggle(),
|
|
3710
|
-
onToggleSpeaker:
|
|
3711
|
-
onSendMessage:
|
|
3712
|
-
onMinimize:
|
|
3713
|
-
onClose:
|
|
3761
|
+
onToggleSpeaker: Kn,
|
|
3762
|
+
onSendMessage: Xn,
|
|
3763
|
+
onMinimize: nr,
|
|
3764
|
+
onClose: on,
|
|
3714
3765
|
onClearMicError: ve.clearError,
|
|
3715
3766
|
dragHandleProps: Ae.dragHandleProps,
|
|
3716
3767
|
resizeHandleProps: Ae.resizeHandleProps
|
|
3717
3768
|
}
|
|
3718
3769
|
)
|
|
3719
3770
|
}
|
|
3720
|
-
),
|
|
3771
|
+
), ln = !le && (ge === "hidden" || ge === "minimized") ? /* @__PURE__ */ k(
|
|
3721
3772
|
"div",
|
|
3722
3773
|
{
|
|
3723
3774
|
className: [
|
|
@@ -3726,66 +3777,66 @@ const Wi = /* @__PURE__ */ new Set([
|
|
|
3726
3777
|
`ll-widget--${ge}`,
|
|
3727
3778
|
`ll-widget--${pe ? "mobile" : "desktop"}`
|
|
3728
3779
|
].join(" "),
|
|
3729
|
-
style:
|
|
3780
|
+
style: Ke,
|
|
3730
3781
|
"data-display-mode": ge,
|
|
3731
3782
|
"data-position": x,
|
|
3732
3783
|
children: [
|
|
3733
|
-
ge === "hidden" && /* @__PURE__ */
|
|
3734
|
-
|
|
3784
|
+
ge === "hidden" && /* @__PURE__ */ r(
|
|
3785
|
+
ni,
|
|
3735
3786
|
{
|
|
3736
3787
|
position: x,
|
|
3737
3788
|
isMobile: pe,
|
|
3738
3789
|
isSpeaking: L.agentState === "speaking",
|
|
3739
3790
|
onExpand: () => _e("expanded"),
|
|
3740
|
-
label: `Open ${
|
|
3741
|
-
avatarImageUrl:
|
|
3742
|
-
agentName:
|
|
3791
|
+
label: `Open ${Ct} widget`,
|
|
3792
|
+
avatarImageUrl: Ot,
|
|
3793
|
+
agentName: Ct,
|
|
3743
3794
|
containerEl: V
|
|
3744
3795
|
}
|
|
3745
3796
|
),
|
|
3746
|
-
ge === "minimized" && /* @__PURE__ */
|
|
3747
|
-
|
|
3797
|
+
ge === "minimized" && /* @__PURE__ */ r(
|
|
3798
|
+
ii,
|
|
3748
3799
|
{
|
|
3749
3800
|
position: x,
|
|
3750
3801
|
isMobile: pe,
|
|
3751
|
-
agentName:
|
|
3752
|
-
avatarImageUrl:
|
|
3802
|
+
agentName: Ct,
|
|
3803
|
+
avatarImageUrl: Ot,
|
|
3753
3804
|
agentState: L.agentState,
|
|
3754
3805
|
isMuted: ve.isMuted,
|
|
3755
3806
|
audioLevel: Me,
|
|
3756
|
-
onExpand:
|
|
3807
|
+
onExpand: tr,
|
|
3757
3808
|
onToggleMute: ve.toggleMute,
|
|
3758
|
-
onClose:
|
|
3809
|
+
onClose: on
|
|
3759
3810
|
}
|
|
3760
3811
|
)
|
|
3761
3812
|
]
|
|
3762
3813
|
}
|
|
3763
|
-
) : null,
|
|
3764
|
-
return /* @__PURE__ */ k(
|
|
3765
|
-
|
|
3766
|
-
|
|
3814
|
+
) : null, an = V ?? (typeof document < "u" ? document.body : null);
|
|
3815
|
+
return /* @__PURE__ */ k(We, { children: [
|
|
3816
|
+
ar,
|
|
3817
|
+
ln && an && Xt(ln, an)
|
|
3767
3818
|
] });
|
|
3768
3819
|
}
|
|
3769
3820
|
);
|
|
3770
|
-
|
|
3771
|
-
const
|
|
3772
|
-
function(t,
|
|
3773
|
-
return /* @__PURE__ */
|
|
3821
|
+
jn.displayName = "AvatarWidgetInner";
|
|
3822
|
+
const Yi = Gt(
|
|
3823
|
+
function(t, n) {
|
|
3824
|
+
return /* @__PURE__ */ r(yr, { children: /* @__PURE__ */ r(jn, { ...t, ref: n }) });
|
|
3774
3825
|
}
|
|
3775
3826
|
);
|
|
3776
|
-
|
|
3777
|
-
const
|
|
3827
|
+
Yi.displayName = "AvatarWidget";
|
|
3828
|
+
const io = ({
|
|
3778
3829
|
agentId: e,
|
|
3779
3830
|
baseUrl: t,
|
|
3780
|
-
apiKey:
|
|
3831
|
+
apiKey: n,
|
|
3781
3832
|
mode: i,
|
|
3782
3833
|
onAgentEvent: a,
|
|
3783
3834
|
className: o,
|
|
3784
|
-
style:
|
|
3835
|
+
style: s
|
|
3785
3836
|
}) => {
|
|
3786
|
-
const l = I(null),
|
|
3837
|
+
const l = I(null), c = I(null), u = I(a);
|
|
3787
3838
|
u.current = a;
|
|
3788
|
-
const
|
|
3839
|
+
const m = C((p) => {
|
|
3789
3840
|
var P;
|
|
3790
3841
|
const h = p.detail;
|
|
3791
3842
|
(P = u.current) == null || P.call(u, h);
|
|
@@ -3794,32 +3845,32 @@ const Qi = ({
|
|
|
3794
3845
|
const p = l.current;
|
|
3795
3846
|
if (!p) return;
|
|
3796
3847
|
const h = document.createElement("livelayer-widget");
|
|
3797
|
-
return h.setAttribute("agent-id", e), t && h.setAttribute("base-url", t),
|
|
3798
|
-
h.removeEventListener("agent-event",
|
|
3848
|
+
return h.setAttribute("agent-id", e), t && h.setAttribute("base-url", t), n && h.setAttribute("api-key", n), i && h.setAttribute("mode", i), h.addEventListener("agent-event", m), p.appendChild(h), c.current = h, () => {
|
|
3849
|
+
h.removeEventListener("agent-event", m), p.removeChild(h), c.current = null;
|
|
3799
3850
|
};
|
|
3800
3851
|
}, [e]), T(() => {
|
|
3801
|
-
|
|
3802
|
-
}, [i]), /* @__PURE__ */
|
|
3803
|
-
},
|
|
3804
|
-
function({ id: t, intent:
|
|
3805
|
-
return
|
|
3852
|
+
c.current && (i ? c.current.setAttribute("mode", i) : c.current.removeAttribute("mode"));
|
|
3853
|
+
}, [i]), /* @__PURE__ */ r("div", { ref: l, className: o, style: s });
|
|
3854
|
+
}, oo = Gt(
|
|
3855
|
+
function({ id: t, intent: n, as: i = "div", className: a, style: o, children: s }, l) {
|
|
3856
|
+
return fr(
|
|
3806
3857
|
i,
|
|
3807
3858
|
{
|
|
3808
3859
|
ref: l,
|
|
3809
3860
|
"data-ll-region": t,
|
|
3810
|
-
"data-ll-intent":
|
|
3861
|
+
"data-ll-intent": n,
|
|
3811
3862
|
className: a,
|
|
3812
3863
|
style: o
|
|
3813
3864
|
},
|
|
3814
|
-
|
|
3865
|
+
s
|
|
3815
3866
|
);
|
|
3816
3867
|
}
|
|
3817
3868
|
);
|
|
3818
|
-
function
|
|
3819
|
-
const { onFieldUpdate: t, onComplete:
|
|
3869
|
+
function lo(e = {}) {
|
|
3870
|
+
const { onFieldUpdate: t, onComplete: n, source: i = "all" } = e, [a, o] = M({}), [s, l] = M(!1), [c, u] = M(null), m = I(t), p = I(n), h = I(i);
|
|
3820
3871
|
T(() => {
|
|
3821
|
-
|
|
3822
|
-
}, [t,
|
|
3872
|
+
m.current = t, p.current = n, h.current = i;
|
|
3873
|
+
}, [t, n, i]);
|
|
3823
3874
|
const P = C(() => {
|
|
3824
3875
|
o({}), l(!1);
|
|
3825
3876
|
}, []);
|
|
@@ -3827,101 +3878,101 @@ function to(e = {}) {
|
|
|
3827
3878
|
if (typeof window > "u") return;
|
|
3828
3879
|
const x = (E) => {
|
|
3829
3880
|
var w, R;
|
|
3830
|
-
const
|
|
3831
|
-
if (
|
|
3832
|
-
if (
|
|
3833
|
-
if (h.current !== "all" &&
|
|
3881
|
+
const y = E.detail;
|
|
3882
|
+
if (y) {
|
|
3883
|
+
if (y.phase === "field") {
|
|
3884
|
+
if (h.current !== "all" && y.source !== h.current)
|
|
3834
3885
|
return;
|
|
3835
3886
|
l(!0), o(
|
|
3836
|
-
(S) => S[
|
|
3887
|
+
(S) => S[y.fieldName] === y.value ? S : { ...S, [y.fieldName]: y.value }
|
|
3837
3888
|
);
|
|
3838
3889
|
try {
|
|
3839
|
-
(w =
|
|
3890
|
+
(w = m.current) == null || w.call(m, y);
|
|
3840
3891
|
} catch (S) {
|
|
3841
3892
|
console.warn("[LiveLayer] useCollect onFieldUpdate threw.", S);
|
|
3842
3893
|
}
|
|
3843
3894
|
return;
|
|
3844
3895
|
}
|
|
3845
|
-
if (
|
|
3846
|
-
const S =
|
|
3896
|
+
if (y.phase === "complete") {
|
|
3897
|
+
const S = y.result;
|
|
3847
3898
|
if (h.current !== "all" && S.source !== h.current)
|
|
3848
3899
|
return;
|
|
3849
3900
|
u(S), l(!1);
|
|
3850
3901
|
try {
|
|
3851
3902
|
(R = p.current) == null || R.call(p, S);
|
|
3852
|
-
} catch (
|
|
3853
|
-
console.warn("[LiveLayer] useCollect onComplete threw.",
|
|
3903
|
+
} catch (v) {
|
|
3904
|
+
console.warn("[LiveLayer] useCollect onComplete threw.", v);
|
|
3854
3905
|
}
|
|
3855
3906
|
}
|
|
3856
3907
|
}
|
|
3857
3908
|
};
|
|
3858
3909
|
return document.addEventListener("ll-collected", x), () => document.removeEventListener("ll-collected", x);
|
|
3859
|
-
}, []), { fields: a, isCollecting:
|
|
3910
|
+
}, []), { fields: a, isCollecting: s, lastResult: c, reset: P };
|
|
3860
3911
|
}
|
|
3861
|
-
let
|
|
3862
|
-
function
|
|
3912
|
+
let Pn = 1;
|
|
3913
|
+
function ao({
|
|
3863
3914
|
onMount: e,
|
|
3864
3915
|
defaultOpen: t = !1,
|
|
3865
|
-
storageKey:
|
|
3916
|
+
storageKey: n = "ll-debug-open"
|
|
3866
3917
|
}) {
|
|
3867
|
-
const [i, a] = M(t), [o,
|
|
3918
|
+
const [i, a] = M(t), [o, s] = M([]), [l, c] = M(""), [u, m] = M(!1), p = I(/* @__PURE__ */ new Set()), h = I([]), P = I(u);
|
|
3868
3919
|
P.current = u, T(() => {
|
|
3869
3920
|
try {
|
|
3870
|
-
const
|
|
3871
|
-
|
|
3921
|
+
const y = localStorage.getItem(n);
|
|
3922
|
+
y === "1" && a(!0), y === "0" && a(!1);
|
|
3872
3923
|
} catch {
|
|
3873
3924
|
}
|
|
3874
|
-
}, [
|
|
3925
|
+
}, [n]), T(() => {
|
|
3875
3926
|
try {
|
|
3876
|
-
localStorage.setItem(
|
|
3927
|
+
localStorage.setItem(n, i ? "1" : "0");
|
|
3877
3928
|
} catch {
|
|
3878
3929
|
}
|
|
3879
|
-
}, [i,
|
|
3880
|
-
const
|
|
3930
|
+
}, [i, n]), T(() => {
|
|
3931
|
+
const y = (w) => {
|
|
3881
3932
|
(w.metaKey || w.ctrlKey) && w.shiftKey && w.key.toLowerCase() === "l" && (w.preventDefault(), a((R) => !R));
|
|
3882
3933
|
};
|
|
3883
|
-
return window.addEventListener("keydown",
|
|
3934
|
+
return window.addEventListener("keydown", y), () => window.removeEventListener("keydown", y);
|
|
3884
3935
|
}, []), T(() => {
|
|
3885
|
-
const
|
|
3936
|
+
const y = setInterval(() => {
|
|
3886
3937
|
if (h.current.length === 0 || P.current) return;
|
|
3887
3938
|
const w = h.current.splice(0, h.current.length);
|
|
3888
|
-
|
|
3939
|
+
s(
|
|
3889
3940
|
(R) => [...w.reverse(), ...R].slice(0, 200)
|
|
3890
3941
|
);
|
|
3891
3942
|
}, 100);
|
|
3892
|
-
return () => clearInterval(
|
|
3943
|
+
return () => clearInterval(y);
|
|
3893
3944
|
}, []);
|
|
3894
3945
|
const x = I(!1);
|
|
3895
3946
|
if (T(() => {
|
|
3896
|
-
!e || x.current || (x.current = !0, e((
|
|
3947
|
+
!e || x.current || (x.current = !0, e((y) => {
|
|
3897
3948
|
h.current.push({
|
|
3898
|
-
id:
|
|
3949
|
+
id: Pn++,
|
|
3899
3950
|
ts: Date.now(),
|
|
3900
3951
|
kind: "event",
|
|
3901
|
-
type:
|
|
3902
|
-
data:
|
|
3952
|
+
type: y.eventName,
|
|
3953
|
+
data: y.data
|
|
3903
3954
|
});
|
|
3904
3955
|
}));
|
|
3905
3956
|
}, [e]), T(() => {
|
|
3906
|
-
const
|
|
3957
|
+
const y = console.warn, w = console.log, R = (S, v) => function(...O) {
|
|
3907
3958
|
try {
|
|
3908
|
-
const
|
|
3909
|
-
|
|
3910
|
-
id:
|
|
3959
|
+
const g = typeof O[0] == "string" ? O[0] : "";
|
|
3960
|
+
g.startsWith("[LiveLayer]") && h.current.push({
|
|
3961
|
+
id: Pn++,
|
|
3911
3962
|
ts: Date.now(),
|
|
3912
3963
|
kind: S,
|
|
3913
|
-
type:
|
|
3914
|
-
data: { args: O.slice(1).map((D) =>
|
|
3964
|
+
type: g.slice(0, 120),
|
|
3965
|
+
data: { args: O.slice(1).map((D) => Xi(D)) }
|
|
3915
3966
|
});
|
|
3916
3967
|
} catch {
|
|
3917
3968
|
}
|
|
3918
|
-
return
|
|
3969
|
+
return v.apply(this, O);
|
|
3919
3970
|
};
|
|
3920
|
-
return console.warn = R("warn",
|
|
3921
|
-
console.warn =
|
|
3971
|
+
return console.warn = R("warn", y), console.log = R("log", w), () => {
|
|
3972
|
+
console.warn = y, console.log = w;
|
|
3922
3973
|
};
|
|
3923
3974
|
}, []), !i)
|
|
3924
|
-
return /* @__PURE__ */
|
|
3975
|
+
return /* @__PURE__ */ r(
|
|
3925
3976
|
"button",
|
|
3926
3977
|
{
|
|
3927
3978
|
type: "button",
|
|
@@ -3947,10 +3998,10 @@ function no({
|
|
|
3947
3998
|
children: "🛰 LL debug"
|
|
3948
3999
|
}
|
|
3949
4000
|
);
|
|
3950
|
-
const E = o.filter((
|
|
4001
|
+
const E = o.filter((y) => {
|
|
3951
4002
|
if (!l) return !0;
|
|
3952
4003
|
const w = l.toLowerCase();
|
|
3953
|
-
return
|
|
4004
|
+
return y.type.toLowerCase().includes(w) || JSON.stringify(y.data || {}).toLowerCase().includes(w);
|
|
3954
4005
|
});
|
|
3955
4006
|
return /* @__PURE__ */ k(
|
|
3956
4007
|
"div",
|
|
@@ -3986,41 +4037,41 @@ function no({
|
|
|
3986
4037
|
gap: 8
|
|
3987
4038
|
},
|
|
3988
4039
|
children: [
|
|
3989
|
-
/* @__PURE__ */
|
|
4040
|
+
/* @__PURE__ */ r("span", { style: { fontWeight: 600, fontSize: 12 }, children: "LiveLayer debug" }),
|
|
3990
4041
|
/* @__PURE__ */ k("span", { style: { fontSize: 10, color: "rgba(255,255,255,0.4)" }, children: [
|
|
3991
4042
|
o.length,
|
|
3992
4043
|
" event",
|
|
3993
4044
|
o.length === 1 ? "" : "s"
|
|
3994
4045
|
] }),
|
|
3995
|
-
/* @__PURE__ */
|
|
3996
|
-
/* @__PURE__ */
|
|
4046
|
+
/* @__PURE__ */ r("span", { style: { flex: 1 } }),
|
|
4047
|
+
/* @__PURE__ */ r(
|
|
3997
4048
|
"button",
|
|
3998
4049
|
{
|
|
3999
4050
|
type: "button",
|
|
4000
|
-
onClick: () =>
|
|
4001
|
-
style:
|
|
4051
|
+
onClick: () => m((y) => !y),
|
|
4052
|
+
style: jt(u ? "#f59e0b" : "transparent"),
|
|
4002
4053
|
title: "Pause / resume capture",
|
|
4003
4054
|
children: u ? "▶ resume" : "⏸ pause"
|
|
4004
4055
|
}
|
|
4005
4056
|
),
|
|
4006
|
-
/* @__PURE__ */
|
|
4057
|
+
/* @__PURE__ */ r(
|
|
4007
4058
|
"button",
|
|
4008
4059
|
{
|
|
4009
4060
|
type: "button",
|
|
4010
4061
|
onClick: () => {
|
|
4011
|
-
|
|
4062
|
+
s([]), h.current = [];
|
|
4012
4063
|
},
|
|
4013
|
-
style:
|
|
4064
|
+
style: jt("transparent"),
|
|
4014
4065
|
title: "Clear buffer",
|
|
4015
4066
|
children: "clear"
|
|
4016
4067
|
}
|
|
4017
4068
|
),
|
|
4018
|
-
/* @__PURE__ */
|
|
4069
|
+
/* @__PURE__ */ r(
|
|
4019
4070
|
"button",
|
|
4020
4071
|
{
|
|
4021
4072
|
type: "button",
|
|
4022
4073
|
onClick: () => a(!1),
|
|
4023
|
-
style:
|
|
4074
|
+
style: jt("transparent"),
|
|
4024
4075
|
"aria-label": "Close",
|
|
4025
4076
|
title: "Close (Cmd/Ctrl + Shift + L)",
|
|
4026
4077
|
children: "✕"
|
|
@@ -4029,12 +4080,12 @@ function no({
|
|
|
4029
4080
|
]
|
|
4030
4081
|
}
|
|
4031
4082
|
),
|
|
4032
|
-
/* @__PURE__ */
|
|
4083
|
+
/* @__PURE__ */ r(
|
|
4033
4084
|
"input",
|
|
4034
4085
|
{
|
|
4035
4086
|
type: "text",
|
|
4036
4087
|
value: l,
|
|
4037
|
-
onChange: (
|
|
4088
|
+
onChange: (y) => c(y.target.value),
|
|
4038
4089
|
placeholder: "filter by type or data…",
|
|
4039
4090
|
style: {
|
|
4040
4091
|
margin: 8,
|
|
@@ -4048,7 +4099,7 @@ function no({
|
|
|
4048
4099
|
}
|
|
4049
4100
|
}
|
|
4050
4101
|
),
|
|
4051
|
-
/* @__PURE__ */
|
|
4102
|
+
/* @__PURE__ */ r(
|
|
4052
4103
|
"div",
|
|
4053
4104
|
{
|
|
4054
4105
|
style: {
|
|
@@ -4067,7 +4118,7 @@ function no({
|
|
|
4067
4118
|
},
|
|
4068
4119
|
children: [
|
|
4069
4120
|
"No events yet. Connect to the agent and trigger a tool call — the events will stream in here. You can also dispatch commands manually in DevTools:",
|
|
4070
|
-
/* @__PURE__ */
|
|
4121
|
+
/* @__PURE__ */ r(
|
|
4071
4122
|
"pre",
|
|
4072
4123
|
{
|
|
4073
4124
|
style: {
|
|
@@ -4086,16 +4137,16 @@ function no({
|
|
|
4086
4137
|
)
|
|
4087
4138
|
]
|
|
4088
4139
|
}
|
|
4089
|
-
) : E.map((
|
|
4090
|
-
|
|
4140
|
+
) : E.map((y) => /* @__PURE__ */ r(
|
|
4141
|
+
Gi,
|
|
4091
4142
|
{
|
|
4092
|
-
entry:
|
|
4093
|
-
expanded: p.current.has(
|
|
4143
|
+
entry: y,
|
|
4144
|
+
expanded: p.current.has(y.id),
|
|
4094
4145
|
onToggle: () => {
|
|
4095
|
-
p.current.has(
|
|
4146
|
+
p.current.has(y.id) ? p.current.delete(y.id) : p.current.add(y.id), s((w) => [...w]);
|
|
4096
4147
|
}
|
|
4097
4148
|
},
|
|
4098
|
-
|
|
4149
|
+
y.id
|
|
4099
4150
|
))
|
|
4100
4151
|
}
|
|
4101
4152
|
)
|
|
@@ -4103,10 +4154,10 @@ function no({
|
|
|
4103
4154
|
}
|
|
4104
4155
|
);
|
|
4105
4156
|
}
|
|
4106
|
-
function
|
|
4157
|
+
function Gi({
|
|
4107
4158
|
entry: e,
|
|
4108
4159
|
expanded: t,
|
|
4109
|
-
onToggle:
|
|
4160
|
+
onToggle: n
|
|
4110
4161
|
}) {
|
|
4111
4162
|
const i = e.kind === "warn" ? "#f59e0b" : e.type.startsWith("[LiveLayer]") ? "#94a3b8" : e.type === "navigate" || e.type === "scroll_page" || e.type === "scroll_to" || e.type === "click" ? "#22c55e" : e.type === "fill_form" || e.type === "submit_form" || e.type === "focus_field" ? "#a78bfa" : e.type === "request_page_context" || e.type === "request_routes" ? "#38bdf8" : e.type === "agent_state" ? "#facc15" : "#cbd5e1", a = new Date(e.ts).toLocaleTimeString("en-US", {
|
|
4112
4163
|
hour12: !1
|
|
@@ -4115,7 +4166,7 @@ function qi({
|
|
|
4115
4166
|
"button",
|
|
4116
4167
|
{
|
|
4117
4168
|
type: "button",
|
|
4118
|
-
onClick:
|
|
4169
|
+
onClick: n,
|
|
4119
4170
|
style: {
|
|
4120
4171
|
textAlign: "left",
|
|
4121
4172
|
background: "transparent",
|
|
@@ -4130,7 +4181,7 @@ function qi({
|
|
|
4130
4181
|
},
|
|
4131
4182
|
children: [
|
|
4132
4183
|
/* @__PURE__ */ k("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
|
|
4133
|
-
/* @__PURE__ */
|
|
4184
|
+
/* @__PURE__ */ r(
|
|
4134
4185
|
"span",
|
|
4135
4186
|
{
|
|
4136
4187
|
style: {
|
|
@@ -4141,7 +4192,7 @@ function qi({
|
|
|
4141
4192
|
children: a
|
|
4142
4193
|
}
|
|
4143
4194
|
),
|
|
4144
|
-
/* @__PURE__ */
|
|
4195
|
+
/* @__PURE__ */ r(
|
|
4145
4196
|
"span",
|
|
4146
4197
|
{
|
|
4147
4198
|
style: {
|
|
@@ -4153,7 +4204,7 @@ function qi({
|
|
|
4153
4204
|
}
|
|
4154
4205
|
)
|
|
4155
4206
|
] }),
|
|
4156
|
-
t && e.data && /* @__PURE__ */
|
|
4207
|
+
t && e.data && /* @__PURE__ */ r(
|
|
4157
4208
|
"pre",
|
|
4158
4209
|
{
|
|
4159
4210
|
style: {
|
|
@@ -4173,7 +4224,7 @@ function qi({
|
|
|
4173
4224
|
}
|
|
4174
4225
|
);
|
|
4175
4226
|
}
|
|
4176
|
-
function
|
|
4227
|
+
function jt(e) {
|
|
4177
4228
|
return {
|
|
4178
4229
|
background: e,
|
|
4179
4230
|
color: "#fff",
|
|
@@ -4184,71 +4235,71 @@ function qt(e) {
|
|
|
4184
4235
|
cursor: "pointer"
|
|
4185
4236
|
};
|
|
4186
4237
|
}
|
|
4187
|
-
function
|
|
4238
|
+
function Xi(e) {
|
|
4188
4239
|
try {
|
|
4189
4240
|
return e instanceof Error ? { message: e.message, stack: e.stack } : (JSON.stringify(e), e);
|
|
4190
4241
|
} catch {
|
|
4191
4242
|
return String(e);
|
|
4192
4243
|
}
|
|
4193
4244
|
}
|
|
4194
|
-
function
|
|
4245
|
+
function Ki(e) {
|
|
4195
4246
|
const t = JSON.stringify(e);
|
|
4196
|
-
T(() =>
|
|
4247
|
+
T(() => hr(e), [t]);
|
|
4197
4248
|
}
|
|
4198
|
-
function
|
|
4199
|
-
return
|
|
4249
|
+
function so({ fields: e, children: t }) {
|
|
4250
|
+
return Ki(e), /* @__PURE__ */ r(We, { children: t });
|
|
4200
4251
|
}
|
|
4201
|
-
function
|
|
4202
|
-
const [e, t] = M([]),
|
|
4252
|
+
function co() {
|
|
4253
|
+
const [e, t] = M([]), n = C((a) => {
|
|
4203
4254
|
t((o) => {
|
|
4204
|
-
const
|
|
4205
|
-
if (
|
|
4255
|
+
const s = o.findIndex((l) => l.id === a.id);
|
|
4256
|
+
if (s >= 0) {
|
|
4206
4257
|
const l = o.slice();
|
|
4207
|
-
return l[
|
|
4258
|
+
return l[s] = a, l;
|
|
4208
4259
|
}
|
|
4209
4260
|
return [...o, a];
|
|
4210
4261
|
});
|
|
4211
4262
|
}, []), i = C(() => t([]), []);
|
|
4212
4263
|
return {
|
|
4213
4264
|
entries: e,
|
|
4214
|
-
pushSegment:
|
|
4265
|
+
pushSegment: n,
|
|
4215
4266
|
clear: i,
|
|
4216
4267
|
latest: e.length > 0 ? e[e.length - 1] : null
|
|
4217
4268
|
};
|
|
4218
4269
|
}
|
|
4219
4270
|
export {
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4271
|
+
Yi as AvatarWidget,
|
|
4272
|
+
yr as ErrorBoundary,
|
|
4273
|
+
so as FieldProvider,
|
|
4274
|
+
ao as LiveLayerDebugPanel,
|
|
4275
|
+
oo as LiveLayerRegion,
|
|
4276
|
+
io as LiveLayerWidget,
|
|
4277
|
+
po as clearFieldRegistry,
|
|
4278
|
+
Ei as clearPageContextCache,
|
|
4279
|
+
Ti as clearRoutesCache,
|
|
4280
|
+
ki as extractPageContext,
|
|
4281
|
+
Ii as extractRoutes,
|
|
4282
|
+
Mn as getCachedPageContext,
|
|
4283
|
+
qt as getCachedRoutes,
|
|
4284
|
+
ho as getRegisteredFields,
|
|
4285
|
+
Vr as matchesPattern,
|
|
4286
|
+
Ai as normalizeRouteInput,
|
|
4287
|
+
mo as registerFields,
|
|
4288
|
+
go as setFieldValue,
|
|
4289
|
+
Yr as shouldRenderAtPath,
|
|
4290
|
+
Sr as useAgentInfo,
|
|
4291
|
+
br as useAudioLevel,
|
|
4292
|
+
Lr as useCameraState,
|
|
4293
|
+
lo as useCollect,
|
|
4294
|
+
Nr as useDisplayMode,
|
|
4295
|
+
Ir as useDisplayModePersistence,
|
|
4296
|
+
Tr as useIsMobile,
|
|
4297
|
+
vr as useLiveKitSession,
|
|
4298
|
+
kr as useMediaDevices,
|
|
4299
|
+
_r as useMicrophoneState,
|
|
4300
|
+
Wr as usePathname,
|
|
4301
|
+
Ki as useRegisterFields,
|
|
4302
|
+
Gr as useRouteMatch,
|
|
4303
|
+
Cr as useScreenShareState,
|
|
4304
|
+
co as useTranscript
|
|
4254
4305
|
};
|