@livelayer/react 0.10.7 → 0.12.6
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/LICENSE +21 -0
- package/README.md +72 -22
- package/dist/index.d.ts +105 -41
- package/dist/index.js +3 -3
- package/dist/index.mjs +1571 -1452
- package/package.json +23 -10
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { Component as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { LiveKitSession as
|
|
6
|
-
import { createLocalAudioTrack as
|
|
7
|
-
class
|
|
2
|
+
import { jsxs as w, jsx as n, Fragment as Ye } from "react/jsx-runtime";
|
|
3
|
+
import { Component as Un, useState as E, useRef as N, useEffect as R, useCallback as C, useMemo as Ge, useLayoutEffect as wn, forwardRef as Dt, useImperativeHandle as jn, createElement as Vn } from "react";
|
|
4
|
+
import { createPortal as Pt } from "react-dom";
|
|
5
|
+
import { LiveKitSession as Yn } from "@livelayer/sdk";
|
|
6
|
+
import { createLocalAudioTrack as Gn, Track as _n, createLocalVideoTrack as Jn } from "livekit-client";
|
|
7
|
+
class Kn extends Un {
|
|
8
8
|
constructor() {
|
|
9
9
|
super(...arguments), this.state = { hasError: !1, error: null }, this.reset = () => {
|
|
10
10
|
this.setState({ hasError: !1, error: null });
|
|
@@ -19,7 +19,7 @@ class Un extends On {
|
|
|
19
19
|
}
|
|
20
20
|
render() {
|
|
21
21
|
var t;
|
|
22
|
-
return this.state.hasError ? this.props.fallback ? this.props.fallback : /* @__PURE__ */
|
|
22
|
+
return this.state.hasError ? this.props.fallback ? this.props.fallback : /* @__PURE__ */ w("div", { className: "ll-error-boundary", role: "alert", children: [
|
|
23
23
|
/* @__PURE__ */ n("p", { className: "ll-error-boundary__title", children: "Widget crashed" }),
|
|
24
24
|
/* @__PURE__ */ n("p", { className: "ll-error-boundary__message", children: ((t = this.state.error) == null ? void 0 : t.message) || "Something went wrong." }),
|
|
25
25
|
/* @__PURE__ */ n(
|
|
@@ -34,26 +34,26 @@ class Un extends On {
|
|
|
34
34
|
] }) : this.props.children;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
const [t, r] =
|
|
39
|
-
S.current = e.onDataMessage,
|
|
40
|
-
const
|
|
41
|
-
onConnectionStateChange: (
|
|
42
|
-
r(
|
|
37
|
+
function Xn(e) {
|
|
38
|
+
const [t, r] = E("idle"), [o, i] = E("idle"), [l, c] = E([]), [a, s] = E(null), [p, v] = E(null), [f, u] = E(null), [I, L] = E(!1), [_, h] = E(null), b = N(null), S = N(e.onDataMessage);
|
|
39
|
+
S.current = e.onDataMessage, R(() => {
|
|
40
|
+
const g = {
|
|
41
|
+
onConnectionStateChange: (H) => {
|
|
42
|
+
r(H), H === "connected" && h(null);
|
|
43
43
|
},
|
|
44
44
|
onAgentStateChange: i,
|
|
45
|
-
onTranscript: (
|
|
45
|
+
onTranscript: (H) => c([...H]),
|
|
46
46
|
onAgentConfig: s,
|
|
47
|
-
onAudioTrack: (
|
|
48
|
-
onVideoTrack: (
|
|
49
|
-
onVideoTrackRemoved: () =>
|
|
50
|
-
onError: (
|
|
51
|
-
onDataMessage: (
|
|
52
|
-
var
|
|
53
|
-
(
|
|
47
|
+
onAudioTrack: (H) => u(H),
|
|
48
|
+
onVideoTrack: (H) => v(H),
|
|
49
|
+
onVideoTrackRemoved: () => v(null),
|
|
50
|
+
onError: (H) => h(H),
|
|
51
|
+
onDataMessage: (H) => {
|
|
52
|
+
var q;
|
|
53
|
+
(q = S.current) == null || q.call(S, H);
|
|
54
54
|
},
|
|
55
|
-
onResumabilityChange:
|
|
56
|
-
},
|
|
55
|
+
onResumabilityChange: L
|
|
56
|
+
}, P = new Yn(
|
|
57
57
|
{
|
|
58
58
|
agentId: e.agentId,
|
|
59
59
|
baseUrl: e.baseUrl,
|
|
@@ -61,11 +61,11 @@ function jn(e) {
|
|
|
61
61
|
sessionEndpoint: e.sessionEndpoint,
|
|
62
62
|
sessionBody: e.sessionBody
|
|
63
63
|
},
|
|
64
|
-
|
|
64
|
+
g
|
|
65
65
|
);
|
|
66
|
-
return b.current =
|
|
67
|
-
var
|
|
68
|
-
(
|
|
66
|
+
return b.current = P, r("idle"), i("idle"), c([]), s(null), v(null), u(null), L(!1), h(null), () => {
|
|
67
|
+
var H;
|
|
68
|
+
(H = P.destroy) == null || H.call(P), b.current = null;
|
|
69
69
|
};
|
|
70
70
|
}, [
|
|
71
71
|
e.agentId,
|
|
@@ -74,38 +74,38 @@ function jn(e) {
|
|
|
74
74
|
e.sessionEndpoint,
|
|
75
75
|
JSON.stringify(e.sessionBody ?? {})
|
|
76
76
|
]);
|
|
77
|
-
const
|
|
78
|
-
const
|
|
79
|
-
if (
|
|
77
|
+
const T = C(async () => {
|
|
78
|
+
const g = b.current;
|
|
79
|
+
if (g)
|
|
80
80
|
try {
|
|
81
|
-
await
|
|
82
|
-
} catch (
|
|
83
|
-
throw
|
|
81
|
+
await g.connect();
|
|
82
|
+
} catch (P) {
|
|
83
|
+
throw h(P instanceof Error ? P.message : String(P)), P;
|
|
84
84
|
}
|
|
85
|
-
}, []),
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
}, []),
|
|
89
|
-
var
|
|
90
|
-
return ((
|
|
85
|
+
}, []), A = C(() => {
|
|
86
|
+
const g = b.current;
|
|
87
|
+
g && g.disconnect();
|
|
88
|
+
}, []), F = C(() => {
|
|
89
|
+
var g;
|
|
90
|
+
return ((g = b.current) == null ? void 0 : g.getRoom()) ?? null;
|
|
91
91
|
}, []);
|
|
92
92
|
return {
|
|
93
93
|
connectionState: t,
|
|
94
94
|
agentState: o,
|
|
95
95
|
transcript: l,
|
|
96
96
|
agentConfig: a,
|
|
97
|
-
videoElement:
|
|
97
|
+
videoElement: p,
|
|
98
98
|
audioElement: f,
|
|
99
|
-
canResume:
|
|
99
|
+
canResume: I,
|
|
100
100
|
error: _,
|
|
101
|
-
connect:
|
|
102
|
-
disconnect:
|
|
103
|
-
getRoom:
|
|
101
|
+
connect: T,
|
|
102
|
+
disconnect: A,
|
|
103
|
+
getRoom: F,
|
|
104
104
|
session: b.current
|
|
105
105
|
};
|
|
106
106
|
}
|
|
107
|
-
function
|
|
108
|
-
const e = N(null), t = N(null), r = N(null), o = N(null), i = N(/* @__PURE__ */ new Set()), l = N(null),
|
|
107
|
+
function Qn() {
|
|
108
|
+
const e = N(null), t = N(null), r = N(null), o = N(null), i = N(/* @__PURE__ */ new Set()), l = N(null), c = C(() => {
|
|
109
109
|
const f = t.current;
|
|
110
110
|
if (!f) {
|
|
111
111
|
o.current = null;
|
|
@@ -114,23 +114,23 @@ function Vn() {
|
|
|
114
114
|
(!l.current || l.current.length !== f.frequencyBinCount) && (l.current = new Uint8Array(
|
|
115
115
|
new ArrayBuffer(f.frequencyBinCount)
|
|
116
116
|
));
|
|
117
|
-
const
|
|
118
|
-
f.getByteFrequencyData(
|
|
119
|
-
let
|
|
120
|
-
for (let _ = 0; _ <
|
|
121
|
-
const
|
|
117
|
+
const u = l.current;
|
|
118
|
+
f.getByteFrequencyData(u);
|
|
119
|
+
let I = 0;
|
|
120
|
+
for (let _ = 0; _ < u.length; _++) I += u[_];
|
|
121
|
+
const L = I / u.length / 255;
|
|
122
122
|
for (const _ of i.current)
|
|
123
123
|
try {
|
|
124
|
-
_(
|
|
125
|
-
} catch (
|
|
126
|
-
console.error("[useAudioLevel] subscriber threw:",
|
|
124
|
+
_(L);
|
|
125
|
+
} catch (h) {
|
|
126
|
+
console.error("[useAudioLevel] subscriber threw:", h);
|
|
127
127
|
}
|
|
128
|
-
o.current = requestAnimationFrame(
|
|
129
|
-
}, []), a =
|
|
128
|
+
o.current = requestAnimationFrame(c);
|
|
129
|
+
}, []), a = C(() => {
|
|
130
130
|
if (e.current || typeof window > "u" || typeof AudioContext > "u") return;
|
|
131
|
-
const f = new AudioContext(),
|
|
132
|
-
|
|
133
|
-
}, []), s =
|
|
131
|
+
const f = new AudioContext(), u = f.createAnalyser();
|
|
132
|
+
u.fftSize = 64, u.connect(f.destination), e.current = f, t.current = u;
|
|
133
|
+
}, []), s = C(
|
|
134
134
|
(f) => {
|
|
135
135
|
if (a(), !(!e.current || !t.current)) {
|
|
136
136
|
if (r.current) {
|
|
@@ -141,17 +141,17 @@ function Vn() {
|
|
|
141
141
|
r.current = null;
|
|
142
142
|
}
|
|
143
143
|
try {
|
|
144
|
-
const
|
|
145
|
-
|
|
146
|
-
} catch (
|
|
147
|
-
console.warn("[useAudioLevel] createMediaElementSource failed:",
|
|
144
|
+
const u = e.current.createMediaElementSource(f);
|
|
145
|
+
u.connect(t.current), r.current = u;
|
|
146
|
+
} catch (u) {
|
|
147
|
+
console.warn("[useAudioLevel] createMediaElementSource failed:", u);
|
|
148
148
|
return;
|
|
149
149
|
}
|
|
150
|
-
o.current === null && (o.current = requestAnimationFrame(
|
|
150
|
+
o.current === null && (o.current = requestAnimationFrame(c));
|
|
151
151
|
}
|
|
152
152
|
},
|
|
153
|
-
[a,
|
|
154
|
-
),
|
|
153
|
+
[a, c]
|
|
154
|
+
), p = C(() => {
|
|
155
155
|
if (o.current !== null && (cancelAnimationFrame(o.current), o.current = null), r.current) {
|
|
156
156
|
try {
|
|
157
157
|
r.current.disconnect();
|
|
@@ -159,11 +159,11 @@ function Vn() {
|
|
|
159
159
|
}
|
|
160
160
|
r.current = null;
|
|
161
161
|
}
|
|
162
|
-
}, []),
|
|
162
|
+
}, []), v = C((f) => (i.current.add(f), () => {
|
|
163
163
|
i.current.delete(f);
|
|
164
164
|
}), []);
|
|
165
|
-
return
|
|
166
|
-
if (
|
|
165
|
+
return R(() => () => {
|
|
166
|
+
if (p(), t.current) {
|
|
167
167
|
try {
|
|
168
168
|
t.current.disconnect();
|
|
169
169
|
} catch {
|
|
@@ -178,102 +178,102 @@ function Vn() {
|
|
|
178
178
|
e.current = null;
|
|
179
179
|
}
|
|
180
180
|
i.current.clear(), l.current = null;
|
|
181
|
-
}, [
|
|
181
|
+
}, [p]), { attach: s, detach: p, subscribe: v };
|
|
182
182
|
}
|
|
183
|
-
function
|
|
184
|
-
const [e, t] =
|
|
185
|
-
var _,
|
|
186
|
-
if (
|
|
183
|
+
function Zn() {
|
|
184
|
+
const [e, t] = E(!1), [r, o] = E(""), [i, l] = E(null), c = N(null), a = N(null), s = C(async (L) => {
|
|
185
|
+
var _, h;
|
|
186
|
+
if (c.current && a.current) {
|
|
187
187
|
try {
|
|
188
|
-
await a.current.localParticipant.unpublishTrack(
|
|
188
|
+
await a.current.localParticipant.unpublishTrack(c.current);
|
|
189
189
|
} catch {
|
|
190
190
|
}
|
|
191
|
-
|
|
191
|
+
c.current.stop(), c.current = null;
|
|
192
192
|
}
|
|
193
|
-
a.current =
|
|
193
|
+
a.current = L, l(null);
|
|
194
194
|
try {
|
|
195
|
-
const b = await
|
|
195
|
+
const b = await Gn({
|
|
196
196
|
echoCancellation: !0,
|
|
197
197
|
noiseSuppression: !0
|
|
198
198
|
});
|
|
199
|
-
await
|
|
200
|
-
const S = (
|
|
199
|
+
await L.localParticipant.publishTrack(b), c.current = b, t(b.isMuted);
|
|
200
|
+
const S = (h = (_ = b.mediaStreamTrack) == null ? void 0 : _.getSettings) == null ? void 0 : h.call(_);
|
|
201
201
|
S != null && S.deviceId && o(S.deviceId);
|
|
202
202
|
} catch (b) {
|
|
203
203
|
const S = b instanceof Error && b.name === "NotAllowedError" ? "Enable your microphone to talk with the agent." : "Microphone unavailable. Check browser permissions and try again.";
|
|
204
204
|
throw l(S), b;
|
|
205
205
|
}
|
|
206
|
-
}, []),
|
|
207
|
-
a.current =
|
|
208
|
-
}, []),
|
|
206
|
+
}, []), p = C((L) => {
|
|
207
|
+
a.current = L;
|
|
208
|
+
}, []), v = C(async (L) => {
|
|
209
209
|
const _ = a.current;
|
|
210
210
|
if (_)
|
|
211
211
|
try {
|
|
212
|
-
await _.switchActiveDevice("audioinput",
|
|
213
|
-
} catch (
|
|
214
|
-
console.warn("[useMicrophoneState] switchDevice failed:",
|
|
212
|
+
await _.switchActiveDevice("audioinput", L), o(L);
|
|
213
|
+
} catch (h) {
|
|
214
|
+
console.warn("[useMicrophoneState] switchDevice failed:", h);
|
|
215
215
|
}
|
|
216
|
-
}, []), f =
|
|
217
|
-
const
|
|
218
|
-
if (t(_), !!
|
|
216
|
+
}, []), f = C(async () => {
|
|
217
|
+
const L = a.current, _ = !e;
|
|
218
|
+
if (t(_), !!L)
|
|
219
219
|
try {
|
|
220
|
-
await
|
|
221
|
-
} catch (
|
|
222
|
-
console.warn("[useMicrophoneState] setMicrophoneEnabled failed:",
|
|
220
|
+
await L.localParticipant.setMicrophoneEnabled(!_);
|
|
221
|
+
} catch (h) {
|
|
222
|
+
console.warn("[useMicrophoneState] setMicrophoneEnabled failed:", h), t(!_);
|
|
223
223
|
}
|
|
224
|
-
}, [e]),
|
|
225
|
-
const
|
|
226
|
-
if (
|
|
224
|
+
}, [e]), u = C(() => {
|
|
225
|
+
const L = c.current, _ = a.current;
|
|
226
|
+
if (L && _) {
|
|
227
227
|
try {
|
|
228
|
-
_.localParticipant.unpublishTrack(
|
|
228
|
+
_.localParticipant.unpublishTrack(L);
|
|
229
229
|
} catch {
|
|
230
230
|
}
|
|
231
|
-
|
|
231
|
+
L.stop();
|
|
232
232
|
}
|
|
233
|
-
|
|
234
|
-
}, []),
|
|
233
|
+
c.current = null, a.current = null, t(!1), o("");
|
|
234
|
+
}, []), I = C(() => l(null), []);
|
|
235
235
|
return {
|
|
236
236
|
isMuted: e,
|
|
237
237
|
activeDeviceId: r,
|
|
238
238
|
micError: i,
|
|
239
239
|
toggleMute: f,
|
|
240
240
|
setupMic: s,
|
|
241
|
-
attachRoom:
|
|
242
|
-
switchDevice:
|
|
243
|
-
teardownMic:
|
|
244
|
-
clearError:
|
|
241
|
+
attachRoom: p,
|
|
242
|
+
switchDevice: v,
|
|
243
|
+
teardownMic: u,
|
|
244
|
+
clearError: I
|
|
245
245
|
};
|
|
246
246
|
}
|
|
247
|
-
const
|
|
248
|
-
function
|
|
249
|
-
const [e, t] =
|
|
247
|
+
const er = { resolution: { width: 640, height: 480, frameRate: 24 } };
|
|
248
|
+
function tr() {
|
|
249
|
+
const [e, t] = E(!1), [r, o] = E(null), [i, l] = E(null), [c, a] = E(""), s = N(null), p = N(null), v = C((b) => {
|
|
250
250
|
s.current = b;
|
|
251
|
-
}, []), f =
|
|
252
|
-
var
|
|
253
|
-
const b = s.current, S =
|
|
251
|
+
}, []), f = C(() => {
|
|
252
|
+
var T;
|
|
253
|
+
const b = s.current, S = p.current;
|
|
254
254
|
if (S && b) {
|
|
255
|
-
const
|
|
255
|
+
const A = b.localParticipant.getTrackPublication(_n.Source.Camera), g = (A == null ? void 0 : A.track) ?? S;
|
|
256
256
|
try {
|
|
257
|
-
b.localParticipant.unpublishTrack(
|
|
257
|
+
b.localParticipant.unpublishTrack(g);
|
|
258
258
|
} catch {
|
|
259
259
|
}
|
|
260
260
|
try {
|
|
261
|
-
(
|
|
261
|
+
(T = g.stop) == null || T.call(g);
|
|
262
262
|
} catch {
|
|
263
263
|
}
|
|
264
264
|
}
|
|
265
|
-
|
|
266
|
-
}, []),
|
|
265
|
+
p.current = null, l(null), t(!1);
|
|
266
|
+
}, []), u = C(async (b) => {
|
|
267
267
|
const S = s.current;
|
|
268
268
|
if (S) {
|
|
269
269
|
o(null);
|
|
270
270
|
try {
|
|
271
|
-
const
|
|
272
|
-
b && (
|
|
273
|
-
const
|
|
274
|
-
await S.localParticipant.publishTrack(
|
|
275
|
-
const
|
|
276
|
-
l(
|
|
271
|
+
const T = { ...er };
|
|
272
|
+
b && (T.deviceId = b);
|
|
273
|
+
const A = await Jn(T);
|
|
274
|
+
await S.localParticipant.publishTrack(A), p.current = A;
|
|
275
|
+
const F = A.attach();
|
|
276
|
+
l(F), t(!0), b && a(b);
|
|
277
277
|
try {
|
|
278
278
|
S.localParticipant.publishData(
|
|
279
279
|
new TextEncoder().encode(JSON.stringify({ type: "user_camera_on" })),
|
|
@@ -281,41 +281,41 @@ function Jn() {
|
|
|
281
281
|
);
|
|
282
282
|
} catch {
|
|
283
283
|
}
|
|
284
|
-
} catch (
|
|
285
|
-
const
|
|
286
|
-
o(
|
|
284
|
+
} catch (T) {
|
|
285
|
+
const A = T instanceof Error && T.name === "NotAllowedError" ? "Enable your camera in the browser to share video." : "Camera unavailable. Check permissions and try again.";
|
|
286
|
+
o(A);
|
|
287
287
|
}
|
|
288
288
|
}
|
|
289
|
-
}, []),
|
|
290
|
-
e ? f() : await c
|
|
291
|
-
}, [e,
|
|
292
|
-
f(), await
|
|
293
|
-
}, [f,
|
|
289
|
+
}, []), I = C(async () => {
|
|
290
|
+
e ? f() : await u(c || void 0);
|
|
291
|
+
}, [e, c, f, u]), L = C(async (b) => {
|
|
292
|
+
f(), await u(b);
|
|
293
|
+
}, [f, u]), _ = C(() => {
|
|
294
294
|
f(), s.current = null, o(null), a("");
|
|
295
|
-
}, [f]),
|
|
296
|
-
return
|
|
297
|
-
|
|
295
|
+
}, [f]), h = C(() => o(null), []);
|
|
296
|
+
return R(() => () => {
|
|
297
|
+
p.current && p.current.stop();
|
|
298
298
|
}, []), {
|
|
299
299
|
isEnabled: e,
|
|
300
300
|
error: r,
|
|
301
301
|
previewEl: i,
|
|
302
|
-
activeDeviceId:
|
|
303
|
-
toggle:
|
|
304
|
-
switchDevice:
|
|
305
|
-
attachRoom:
|
|
302
|
+
activeDeviceId: c,
|
|
303
|
+
toggle: I,
|
|
304
|
+
switchDevice: L,
|
|
305
|
+
attachRoom: v,
|
|
306
306
|
teardown: _,
|
|
307
|
-
clearError:
|
|
307
|
+
clearError: h
|
|
308
308
|
};
|
|
309
309
|
}
|
|
310
|
-
function
|
|
311
|
-
const [e, t] =
|
|
312
|
-
|
|
313
|
-
}, []), s =
|
|
314
|
-
const
|
|
315
|
-
if (
|
|
310
|
+
function nr() {
|
|
311
|
+
const [e, t] = E(!1), [r, o] = E(null), [i, l] = E(null), c = N(null), a = C((u) => {
|
|
312
|
+
c.current = u;
|
|
313
|
+
}, []), s = C(() => l(null), []), p = C(async () => {
|
|
314
|
+
const u = c.current;
|
|
315
|
+
if (u) {
|
|
316
316
|
if (e) {
|
|
317
317
|
try {
|
|
318
|
-
await
|
|
318
|
+
await u.localParticipant.setScreenShareEnabled(!1);
|
|
319
319
|
} catch {
|
|
320
320
|
}
|
|
321
321
|
s(), t(!1);
|
|
@@ -323,15 +323,15 @@ function Kn() {
|
|
|
323
323
|
}
|
|
324
324
|
o(null);
|
|
325
325
|
try {
|
|
326
|
-
await
|
|
327
|
-
let
|
|
328
|
-
const
|
|
329
|
-
const _ =
|
|
326
|
+
await u.localParticipant.setScreenShareEnabled(!0);
|
|
327
|
+
let I = 0;
|
|
328
|
+
const L = () => {
|
|
329
|
+
const _ = u.localParticipant.getTrackPublication(_n.Source.ScreenShare);
|
|
330
330
|
if (_ != null && _.track) {
|
|
331
|
-
const
|
|
332
|
-
l(
|
|
331
|
+
const h = _.track.attach();
|
|
332
|
+
l(h), t(!0);
|
|
333
333
|
try {
|
|
334
|
-
|
|
334
|
+
u.localParticipant.publishData(
|
|
335
335
|
new TextEncoder().encode(JSON.stringify({ type: "user_screen_share_on" })),
|
|
336
336
|
{ reliable: !0 }
|
|
337
337
|
);
|
|
@@ -339,64 +339,64 @@ function Kn() {
|
|
|
339
339
|
}
|
|
340
340
|
return;
|
|
341
341
|
}
|
|
342
|
-
|
|
342
|
+
I++ < 10 ? setTimeout(L, 100) : t(!0);
|
|
343
343
|
};
|
|
344
|
-
|
|
345
|
-
} catch (
|
|
346
|
-
const
|
|
347
|
-
|
|
344
|
+
L();
|
|
345
|
+
} catch (I) {
|
|
346
|
+
const L = I instanceof Error ? I.name : "";
|
|
347
|
+
L !== "NotAllowedError" && L !== "AbortError" && o("Screen share unavailable. Try again."), t(!1);
|
|
348
348
|
}
|
|
349
349
|
}
|
|
350
|
-
}, [e, s]),
|
|
351
|
-
const
|
|
352
|
-
if (
|
|
350
|
+
}, [e, s]), v = C(() => {
|
|
351
|
+
const u = c.current;
|
|
352
|
+
if (u && e)
|
|
353
353
|
try {
|
|
354
|
-
|
|
354
|
+
u.localParticipant.setScreenShareEnabled(!1);
|
|
355
355
|
} catch {
|
|
356
356
|
}
|
|
357
|
-
s(), t(!1), o(null),
|
|
358
|
-
}, [e, s]), f =
|
|
359
|
-
return { isEnabled: e, error: r, previewEl: i, toggle:
|
|
357
|
+
s(), t(!1), o(null), c.current = null;
|
|
358
|
+
}, [e, s]), f = C(() => o(null), []);
|
|
359
|
+
return { isEnabled: e, error: r, previewEl: i, toggle: p, attachRoom: a, teardown: v, clearError: f };
|
|
360
360
|
}
|
|
361
|
-
function
|
|
362
|
-
const [e, t] =
|
|
361
|
+
function rr() {
|
|
362
|
+
const [e, t] = E([]), [r, o] = E([]), i = C(async () => {
|
|
363
363
|
if (!(typeof navigator > "u" || !navigator.mediaDevices))
|
|
364
364
|
try {
|
|
365
365
|
const l = await navigator.mediaDevices.enumerateDevices();
|
|
366
|
-
t(l.filter((
|
|
366
|
+
t(l.filter((c) => c.kind === "audioinput")), o(l.filter((c) => c.kind === "videoinput"));
|
|
367
367
|
} catch {
|
|
368
368
|
}
|
|
369
369
|
}, []);
|
|
370
|
-
return
|
|
370
|
+
return R(() => {
|
|
371
371
|
if (i(), typeof navigator > "u" || !navigator.mediaDevices) return;
|
|
372
372
|
const l = () => void i();
|
|
373
373
|
return navigator.mediaDevices.addEventListener("devicechange", l), () => navigator.mediaDevices.removeEventListener("devicechange", l);
|
|
374
374
|
}, [i]), { mics: e, cameras: r, refresh: i };
|
|
375
375
|
}
|
|
376
|
-
function
|
|
377
|
-
const [o, i] =
|
|
378
|
-
return
|
|
376
|
+
function or(e, t, r = !1) {
|
|
377
|
+
const [o, i] = E(null), [l, c] = E(null), [a, s] = E(!r && !!e);
|
|
378
|
+
return R(() => {
|
|
379
379
|
if (r || !e) {
|
|
380
380
|
s(!1);
|
|
381
381
|
return;
|
|
382
382
|
}
|
|
383
|
-
const
|
|
384
|
-
return s(!0),
|
|
385
|
-
signal:
|
|
383
|
+
const p = new AbortController(), v = t || "https://app.livelayer.studio";
|
|
384
|
+
return s(!0), c(null), fetch(`${v}/api/widget/agent/${encodeURIComponent(e)}`, {
|
|
385
|
+
signal: p.signal
|
|
386
386
|
}).then(async (f) => {
|
|
387
387
|
if (!f.ok) {
|
|
388
|
-
const
|
|
389
|
-
throw new Error(
|
|
388
|
+
const u = await f.json().catch(() => ({}));
|
|
389
|
+
throw new Error(u.error || `HTTP ${f.status}`);
|
|
390
390
|
}
|
|
391
391
|
return f.json();
|
|
392
392
|
}).then((f) => {
|
|
393
|
-
|
|
393
|
+
p.signal.aborted || (i(f), s(!1));
|
|
394
394
|
}).catch((f) => {
|
|
395
|
-
|
|
396
|
-
}), () =>
|
|
395
|
+
p.signal.aborted || (c(f instanceof Error ? f.message : "Agent lookup failed"), s(!1));
|
|
396
|
+
}), () => p.abort();
|
|
397
397
|
}, [e, t, r]), { info: o, error: l, loading: a };
|
|
398
398
|
}
|
|
399
|
-
function
|
|
399
|
+
function ir(e) {
|
|
400
400
|
if (typeof window > "u") return null;
|
|
401
401
|
try {
|
|
402
402
|
return window.localStorage.getItem(e);
|
|
@@ -404,54 +404,54 @@ function Zn(e) {
|
|
|
404
404
|
return null;
|
|
405
405
|
}
|
|
406
406
|
}
|
|
407
|
-
function
|
|
407
|
+
function lr(e, t) {
|
|
408
408
|
if (!(typeof window > "u"))
|
|
409
409
|
try {
|
|
410
410
|
window.localStorage.setItem(e, t);
|
|
411
411
|
} catch {
|
|
412
412
|
}
|
|
413
413
|
}
|
|
414
|
-
function
|
|
414
|
+
function ar({
|
|
415
415
|
value: e,
|
|
416
416
|
defaultValue: t = "expanded",
|
|
417
417
|
onChange: r
|
|
418
418
|
} = {}) {
|
|
419
|
-
const o = e !== void 0, [i, l] =
|
|
419
|
+
const o = e !== void 0, [i, l] = E(t), c = o ? e : i, a = C(
|
|
420
420
|
(s) => {
|
|
421
|
-
s !==
|
|
421
|
+
s !== c && (o || l(s), r == null || r(s));
|
|
422
422
|
},
|
|
423
|
-
[
|
|
423
|
+
[c, o, r]
|
|
424
424
|
);
|
|
425
|
-
return [
|
|
425
|
+
return [c, a];
|
|
426
426
|
}
|
|
427
|
-
const
|
|
428
|
-
function
|
|
429
|
-
return e &&
|
|
427
|
+
const cr = ["hidden", "minimized", "expanded"];
|
|
428
|
+
function sr(e) {
|
|
429
|
+
return e && cr.includes(e) ? e : null;
|
|
430
430
|
}
|
|
431
|
-
function
|
|
431
|
+
function dr({
|
|
432
432
|
value: e,
|
|
433
433
|
defaultValue: t = "expanded",
|
|
434
434
|
onChange: r,
|
|
435
435
|
persistKey: o = "ll-widget",
|
|
436
436
|
disablePersistence: i = !1
|
|
437
437
|
} = {}) {
|
|
438
|
-
const l = `${o}:display-mode`,
|
|
438
|
+
const l = `${o}:display-mode`, c = N(!1), [a, s] = ar({
|
|
439
439
|
value: e,
|
|
440
440
|
defaultValue: t,
|
|
441
|
-
onChange: (
|
|
442
|
-
e === void 0 && !i &&
|
|
441
|
+
onChange: (p) => {
|
|
442
|
+
e === void 0 && !i && lr(l, p), r == null || r(p);
|
|
443
443
|
}
|
|
444
444
|
});
|
|
445
|
-
return
|
|
446
|
-
if (
|
|
447
|
-
const
|
|
448
|
-
|
|
445
|
+
return R(() => {
|
|
446
|
+
if (c.current || (c.current = !0, i || e !== void 0)) return;
|
|
447
|
+
const p = sr(ir(l));
|
|
448
|
+
p && p !== a && s(p);
|
|
449
449
|
}, []), [a, s];
|
|
450
450
|
}
|
|
451
|
-
const
|
|
452
|
-
function
|
|
453
|
-
const [t, r] =
|
|
454
|
-
return
|
|
451
|
+
const ur = 640;
|
|
452
|
+
function fr(e = ur) {
|
|
453
|
+
const [t, r] = E(!1);
|
|
454
|
+
return R(() => {
|
|
455
455
|
if (e === !1) {
|
|
456
456
|
r(!1);
|
|
457
457
|
return;
|
|
@@ -464,9 +464,9 @@ function lr(e = ir) {
|
|
|
464
464
|
});
|
|
465
465
|
}, [e]), t;
|
|
466
466
|
}
|
|
467
|
-
const
|
|
468
|
-
function
|
|
469
|
-
if (typeof window > "u" || window.history[
|
|
467
|
+
const en = "__llHistoryPatched", _t = "ll:pathname";
|
|
468
|
+
function pr() {
|
|
469
|
+
if (typeof window > "u" || window.history[en]) return;
|
|
470
470
|
const e = window.history.pushState, t = window.history.replaceState;
|
|
471
471
|
window.history.pushState = function(...r) {
|
|
472
472
|
const o = e.apply(this, r);
|
|
@@ -474,65 +474,65 @@ function ar() {
|
|
|
474
474
|
}, window.history.replaceState = function(...r) {
|
|
475
475
|
const o = t.apply(this, r);
|
|
476
476
|
return window.dispatchEvent(new Event(_t)), o;
|
|
477
|
-
}, window.history[
|
|
477
|
+
}, window.history[en] = !0;
|
|
478
478
|
}
|
|
479
|
-
function
|
|
479
|
+
function tn() {
|
|
480
480
|
return typeof window > "u" ? "/" : window.location.pathname || "/";
|
|
481
481
|
}
|
|
482
|
-
function
|
|
483
|
-
const [t, r] =
|
|
484
|
-
() => e ??
|
|
482
|
+
function hr(e) {
|
|
483
|
+
const [t, r] = E(
|
|
484
|
+
() => e ?? tn()
|
|
485
485
|
);
|
|
486
|
-
return
|
|
486
|
+
return R(() => {
|
|
487
487
|
if (e !== void 0) return;
|
|
488
|
-
|
|
489
|
-
const o = () => r(
|
|
488
|
+
pr();
|
|
489
|
+
const o = () => r(tn());
|
|
490
490
|
return o(), window.addEventListener("popstate", o), window.addEventListener(_t, o), () => {
|
|
491
491
|
window.removeEventListener("popstate", o), window.removeEventListener(_t, o);
|
|
492
492
|
};
|
|
493
493
|
}, [e]), e ?? t;
|
|
494
494
|
}
|
|
495
|
-
const
|
|
496
|
-
function
|
|
497
|
-
return e.replace(
|
|
495
|
+
const nn = /* @__PURE__ */ new Map(), mr = /[\\^$+?.()|{}[\]]/g;
|
|
496
|
+
function gr(e) {
|
|
497
|
+
return e.replace(mr, "\\$&");
|
|
498
498
|
}
|
|
499
|
-
function
|
|
500
|
-
const t =
|
|
499
|
+
function yr(e) {
|
|
500
|
+
const t = nn.get(e);
|
|
501
501
|
if (t) return t;
|
|
502
|
-
const r = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e, o = "", i = "", l = r.replace(/\*\*/g, o).replace(/\*/g, i), a =
|
|
503
|
-
return
|
|
502
|
+
const r = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e, o = "", i = "", l = r.replace(/\*\*/g, o).replace(/\*/g, i), a = gr(l).replace(new RegExp(`\\/${o}`, "g"), "(?:\\/.*)?").replace(new RegExp(o, "g"), ".*").replace(new RegExp(i, "g"), "[^/]+"), s = new RegExp(`^${a}\\/?$`);
|
|
503
|
+
return nn.set(e, s), s;
|
|
504
504
|
}
|
|
505
|
-
function
|
|
505
|
+
function vr(e, t) {
|
|
506
506
|
const r = t.length > 1 && t.endsWith("/") ? t.slice(0, -1) : t;
|
|
507
|
-
return
|
|
507
|
+
return yr(e).test(r);
|
|
508
508
|
}
|
|
509
|
-
function
|
|
510
|
-
return typeof e == "function" ? e(t) : e instanceof RegExp ? e.test(t) :
|
|
509
|
+
function br(e, t) {
|
|
510
|
+
return typeof e == "function" ? e(t) : e instanceof RegExp ? e.test(t) : vr(e, t);
|
|
511
511
|
}
|
|
512
|
-
function
|
|
512
|
+
function rn(e, t) {
|
|
513
513
|
if (!e || e.length === 0) return !1;
|
|
514
514
|
for (const r of e)
|
|
515
|
-
if (
|
|
515
|
+
if (br(r, t)) return !0;
|
|
516
516
|
return !1;
|
|
517
517
|
}
|
|
518
|
-
function
|
|
519
|
-
return e === void 0 ? !0 :
|
|
518
|
+
function wr(e, t, r) {
|
|
519
|
+
return e === void 0 ? !0 : rn(r, e) ? !1 : t && t.length > 0 ? rn(t, e) : !0;
|
|
520
520
|
}
|
|
521
|
-
function
|
|
521
|
+
function _r(e, t, r) {
|
|
522
522
|
return Ge(
|
|
523
|
-
() =>
|
|
523
|
+
() => wr(e, t, r),
|
|
524
524
|
[e, t, r]
|
|
525
525
|
);
|
|
526
526
|
}
|
|
527
|
-
function
|
|
527
|
+
function xr(e) {
|
|
528
528
|
return e === !1 ? { navigate: !1, thinking: !1, action: !1 } : e === void 0 || e === !0 ? { navigate: !0, thinking: !0, action: !0 } : {
|
|
529
529
|
navigate: e.navigate !== !1,
|
|
530
530
|
thinking: e.thinking !== !1,
|
|
531
531
|
action: e.action !== !1
|
|
532
532
|
};
|
|
533
533
|
}
|
|
534
|
-
function
|
|
535
|
-
const t = Ge(() =>
|
|
534
|
+
function kr(e) {
|
|
535
|
+
const t = Ge(() => xr(e.config), [e.config]), r = e.baseUrl.replace(/\/+$/, ""), o = N(null), i = C(
|
|
536
536
|
(s) => {
|
|
537
537
|
try {
|
|
538
538
|
new Audio(`${r}${s}`).play().catch(() => {
|
|
@@ -541,11 +541,11 @@ function yr(e) {
|
|
|
541
541
|
}
|
|
542
542
|
},
|
|
543
543
|
[r]
|
|
544
|
-
), l =
|
|
544
|
+
), l = C(() => {
|
|
545
545
|
t.navigate && i("/audio/page-change-sound.mp3");
|
|
546
|
-
}, [t.navigate, i]),
|
|
546
|
+
}, [t.navigate, i]), c = C(() => {
|
|
547
547
|
t.action && i("/audio/confirmation-sound.mp3");
|
|
548
|
-
}, [t.action, i]), a =
|
|
548
|
+
}, [t.action, i]), a = C(
|
|
549
549
|
(s) => {
|
|
550
550
|
if (!t.thinking) {
|
|
551
551
|
if (o.current) {
|
|
@@ -560,10 +560,10 @@ function yr(e) {
|
|
|
560
560
|
if (s) {
|
|
561
561
|
if (o.current) return;
|
|
562
562
|
try {
|
|
563
|
-
const
|
|
564
|
-
|
|
563
|
+
const p = new Audio(`${r}/audio/thinking-sound.mp3`);
|
|
564
|
+
p.loop = !0, p.volume = 0.3, p.play().catch(() => {
|
|
565
565
|
o.current = null;
|
|
566
|
-
}), o.current =
|
|
566
|
+
}), o.current = p;
|
|
567
567
|
} catch {
|
|
568
568
|
}
|
|
569
569
|
} else if (o.current) {
|
|
@@ -576,7 +576,7 @@ function yr(e) {
|
|
|
576
576
|
},
|
|
577
577
|
[r, t.thinking]
|
|
578
578
|
);
|
|
579
|
-
return
|
|
579
|
+
return R(() => () => {
|
|
580
580
|
if (o.current) {
|
|
581
581
|
try {
|
|
582
582
|
o.current.pause();
|
|
@@ -585,11 +585,11 @@ function yr(e) {
|
|
|
585
585
|
o.current = null;
|
|
586
586
|
}
|
|
587
587
|
}, []), Ge(
|
|
588
|
-
() => ({ playPageChange: l, playConfirmation:
|
|
589
|
-
[l,
|
|
588
|
+
() => ({ playPageChange: l, playConfirmation: c, setThinking: a }),
|
|
589
|
+
[l, c, a]
|
|
590
590
|
);
|
|
591
591
|
}
|
|
592
|
-
const
|
|
592
|
+
const on = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ w(
|
|
593
593
|
"svg",
|
|
594
594
|
{
|
|
595
595
|
className: t,
|
|
@@ -635,7 +635,7 @@ const en = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ g(
|
|
|
635
635
|
}
|
|
636
636
|
)
|
|
637
637
|
}
|
|
638
|
-
),
|
|
638
|
+
), ln = ({ className: e }) => /* @__PURE__ */ n(
|
|
639
639
|
"svg",
|
|
640
640
|
{
|
|
641
641
|
className: e,
|
|
@@ -653,7 +653,7 @@ const en = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ g(
|
|
|
653
653
|
}
|
|
654
654
|
)
|
|
655
655
|
}
|
|
656
|
-
),
|
|
656
|
+
), Lr = ({ className: e }) => /* @__PURE__ */ n(
|
|
657
657
|
"svg",
|
|
658
658
|
{
|
|
659
659
|
className: e,
|
|
@@ -664,12 +664,12 @@ const en = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ g(
|
|
|
664
664
|
"aria-hidden": "true",
|
|
665
665
|
children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
|
|
666
666
|
}
|
|
667
|
-
),
|
|
667
|
+
), Cr = {
|
|
668
668
|
left: 180,
|
|
669
669
|
right: 0,
|
|
670
670
|
up: -90,
|
|
671
671
|
down: 90
|
|
672
|
-
},
|
|
672
|
+
}, an = ({ direction: e = "right", className: t }) => /* @__PURE__ */ n(
|
|
673
673
|
"svg",
|
|
674
674
|
{
|
|
675
675
|
className: t,
|
|
@@ -677,19 +677,19 @@ const en = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ g(
|
|
|
677
677
|
viewBox: "0 0 24 24",
|
|
678
678
|
stroke: "currentColor",
|
|
679
679
|
strokeWidth: 2,
|
|
680
|
-
style: { transform: `rotate(${
|
|
680
|
+
style: { transform: `rotate(${Cr[e]}deg)` },
|
|
681
681
|
"aria-hidden": "true",
|
|
682
682
|
children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 6l6 6-6 6" })
|
|
683
683
|
}
|
|
684
684
|
);
|
|
685
|
-
function
|
|
685
|
+
function Er(e) {
|
|
686
686
|
return e === "top-left" || e === "bottom-left" ? "left" : "right";
|
|
687
687
|
}
|
|
688
|
-
const
|
|
689
|
-
function
|
|
688
|
+
const xn = "ll-hidden-tab-center-y", Sr = 5, cn = 16;
|
|
689
|
+
function Nr() {
|
|
690
690
|
if (typeof window > "u") return null;
|
|
691
691
|
try {
|
|
692
|
-
const e = window.localStorage.getItem(
|
|
692
|
+
const e = window.localStorage.getItem(xn);
|
|
693
693
|
if (!e) return null;
|
|
694
694
|
const t = Number.parseFloat(e);
|
|
695
695
|
return Number.isFinite(t) ? t : null;
|
|
@@ -697,130 +697,130 @@ function xr() {
|
|
|
697
697
|
return null;
|
|
698
698
|
}
|
|
699
699
|
}
|
|
700
|
-
function
|
|
700
|
+
function sn(e) {
|
|
701
701
|
if (!(typeof window > "u"))
|
|
702
702
|
try {
|
|
703
|
-
window.localStorage.setItem(
|
|
703
|
+
window.localStorage.setItem(xn, String(e));
|
|
704
704
|
} catch {
|
|
705
705
|
}
|
|
706
706
|
}
|
|
707
|
-
const
|
|
707
|
+
const Ar = ({
|
|
708
708
|
position: e,
|
|
709
709
|
isMobile: t,
|
|
710
710
|
isSpeaking: r,
|
|
711
711
|
onExpand: o,
|
|
712
712
|
label: i = "Open widget",
|
|
713
713
|
avatarImageUrl: l,
|
|
714
|
-
agentName:
|
|
714
|
+
agentName: c,
|
|
715
715
|
containerEl: a
|
|
716
716
|
}) => {
|
|
717
|
-
const s =
|
|
718
|
-
(
|
|
719
|
-
if (typeof window > "u") return
|
|
720
|
-
const
|
|
721
|
-
return
|
|
717
|
+
const s = Er(e), p = s === "right" ? "left" : "right", v = t ? 80 : 72, f = !!l, u = !!a, [I, L] = E(null), [_, h] = E(!1), b = N(null), S = N(!1), T = C(
|
|
718
|
+
(M) => {
|
|
719
|
+
if (typeof window > "u") return M;
|
|
720
|
+
const U = v / 2, B = cn + U, J = window.innerHeight - cn - U;
|
|
721
|
+
return J < B ? Math.max(B, M) : Math.max(B, Math.min(J, M));
|
|
722
722
|
},
|
|
723
|
-
[
|
|
723
|
+
[v]
|
|
724
724
|
);
|
|
725
|
-
|
|
726
|
-
if (
|
|
727
|
-
|
|
725
|
+
R(() => {
|
|
726
|
+
if (u) {
|
|
727
|
+
L(null);
|
|
728
728
|
return;
|
|
729
729
|
}
|
|
730
|
-
const
|
|
731
|
-
|
|
732
|
-
const
|
|
733
|
-
|
|
730
|
+
const M = Nr();
|
|
731
|
+
L(T(M ?? window.innerHeight / 2));
|
|
732
|
+
const U = () => {
|
|
733
|
+
L((B) => B === null ? null : T(B));
|
|
734
734
|
};
|
|
735
|
-
return window.addEventListener("resize",
|
|
736
|
-
}, [
|
|
737
|
-
const
|
|
738
|
-
(
|
|
739
|
-
if (!
|
|
735
|
+
return window.addEventListener("resize", U), () => window.removeEventListener("resize", U);
|
|
736
|
+
}, [T, u]);
|
|
737
|
+
const A = C(
|
|
738
|
+
(M) => {
|
|
739
|
+
if (!u && !(M.pointerType === "mouse" && M.button !== 0) && I !== null) {
|
|
740
740
|
try {
|
|
741
|
-
|
|
741
|
+
M.currentTarget.setPointerCapture(M.pointerId);
|
|
742
742
|
} catch {
|
|
743
743
|
}
|
|
744
744
|
b.current = {
|
|
745
|
-
startClientY:
|
|
746
|
-
startCenterY:
|
|
745
|
+
startClientY: M.clientY,
|
|
746
|
+
startCenterY: I,
|
|
747
747
|
moved: !1
|
|
748
748
|
};
|
|
749
749
|
}
|
|
750
750
|
},
|
|
751
|
-
[
|
|
752
|
-
),
|
|
753
|
-
(
|
|
754
|
-
const
|
|
755
|
-
if (!
|
|
756
|
-
const
|
|
757
|
-
!
|
|
751
|
+
[I, u]
|
|
752
|
+
), F = C(
|
|
753
|
+
(M) => {
|
|
754
|
+
const U = b.current;
|
|
755
|
+
if (!U) return;
|
|
756
|
+
const B = M.clientY - U.startClientY;
|
|
757
|
+
!U.moved && Math.abs(B) > Sr && (U.moved = !0, h(!0)), U.moved && L(T(U.startCenterY + B));
|
|
758
758
|
},
|
|
759
|
-
[
|
|
760
|
-
),
|
|
761
|
-
(
|
|
762
|
-
const
|
|
763
|
-
if (
|
|
759
|
+
[T]
|
|
760
|
+
), g = C(
|
|
761
|
+
(M) => {
|
|
762
|
+
const U = b.current;
|
|
763
|
+
if (U) {
|
|
764
764
|
try {
|
|
765
|
-
|
|
765
|
+
M.currentTarget.releasePointerCapture(M.pointerId);
|
|
766
766
|
} catch {
|
|
767
767
|
}
|
|
768
|
-
b.current = null,
|
|
768
|
+
b.current = null, U.moved && (h(!1), S.current = !0, L((B) => (B !== null && sn(B), B)));
|
|
769
769
|
}
|
|
770
770
|
},
|
|
771
771
|
[]
|
|
772
|
-
),
|
|
772
|
+
), P = C(() => {
|
|
773
773
|
if (S.current) {
|
|
774
774
|
S.current = !1;
|
|
775
775
|
return;
|
|
776
776
|
}
|
|
777
777
|
o();
|
|
778
|
-
}, [o]),
|
|
779
|
-
(
|
|
780
|
-
if (
|
|
781
|
-
|
|
782
|
-
const
|
|
783
|
-
|
|
784
|
-
if (
|
|
785
|
-
const
|
|
786
|
-
return
|
|
778
|
+
}, [o]), H = C(
|
|
779
|
+
(M) => {
|
|
780
|
+
if (M.key === "ArrowUp" || M.key === "ArrowDown") {
|
|
781
|
+
M.preventDefault();
|
|
782
|
+
const U = M.key === "ArrowUp" ? -8 : 8;
|
|
783
|
+
L((B) => {
|
|
784
|
+
if (B === null) return B;
|
|
785
|
+
const J = T(B + U);
|
|
786
|
+
return sn(J), J;
|
|
787
787
|
});
|
|
788
788
|
}
|
|
789
789
|
},
|
|
790
|
-
[
|
|
791
|
-
),
|
|
790
|
+
[T]
|
|
791
|
+
), q = [
|
|
792
792
|
"ll-hidden",
|
|
793
793
|
`ll-hidden--${s}`,
|
|
794
794
|
t ? "ll-hidden--mobile" : "ll-hidden--desktop",
|
|
795
795
|
r ? "ll-hidden--speaking" : null,
|
|
796
796
|
_ ? "is-dragging" : null,
|
|
797
797
|
f ? "ll-hidden--with-avatar" : null,
|
|
798
|
-
|
|
799
|
-
].filter(Boolean).join(" "),
|
|
798
|
+
u ? "ll-hidden--scoped" : null
|
|
799
|
+
].filter(Boolean).join(" "), Z = I === null ? void 0 : { top: `${I - v / 2}px`, transform: "none" };
|
|
800
800
|
return /* @__PURE__ */ n(
|
|
801
801
|
"button",
|
|
802
802
|
{
|
|
803
803
|
type: "button",
|
|
804
|
-
className:
|
|
805
|
-
onPointerDown:
|
|
806
|
-
onPointerMove:
|
|
807
|
-
onPointerUp:
|
|
808
|
-
onPointerCancel:
|
|
809
|
-
onClick:
|
|
810
|
-
onKeyDown:
|
|
804
|
+
className: q,
|
|
805
|
+
onPointerDown: A,
|
|
806
|
+
onPointerMove: F,
|
|
807
|
+
onPointerUp: g,
|
|
808
|
+
onPointerCancel: g,
|
|
809
|
+
onClick: P,
|
|
810
|
+
onKeyDown: H,
|
|
811
811
|
"aria-label": i,
|
|
812
812
|
"data-position": e,
|
|
813
|
-
style:
|
|
813
|
+
style: Z,
|
|
814
814
|
children: f ? (
|
|
815
815
|
// Layout: tiny chevron flush against the inward edge (peeks out
|
|
816
816
|
// as the click affordance), then the circular avatar photo
|
|
817
817
|
// taking the rest of the tab. Reinforces "this is an
|
|
818
818
|
// avatar-based experience" even when collapsed.
|
|
819
|
-
/* @__PURE__ */
|
|
819
|
+
/* @__PURE__ */ w(Ye, { children: [
|
|
820
820
|
/* @__PURE__ */ n(
|
|
821
|
-
|
|
821
|
+
an,
|
|
822
822
|
{
|
|
823
|
-
direction:
|
|
823
|
+
direction: p,
|
|
824
824
|
className: "ll-hidden__chevron ll-hidden__chevron--mini"
|
|
825
825
|
}
|
|
826
826
|
),
|
|
@@ -828,22 +828,22 @@ const kr = ({
|
|
|
828
828
|
"img",
|
|
829
829
|
{
|
|
830
830
|
src: l,
|
|
831
|
-
alt:
|
|
831
|
+
alt: c ? `${c} avatar` : "Agent avatar",
|
|
832
832
|
className: "ll-hidden__avatar",
|
|
833
833
|
draggable: !1
|
|
834
834
|
}
|
|
835
835
|
)
|
|
836
836
|
] })
|
|
837
837
|
) : /* @__PURE__ */ n(
|
|
838
|
-
|
|
838
|
+
an,
|
|
839
839
|
{
|
|
840
|
-
direction:
|
|
840
|
+
direction: p,
|
|
841
841
|
className: "ll-hidden__chevron"
|
|
842
842
|
}
|
|
843
843
|
)
|
|
844
844
|
}
|
|
845
845
|
);
|
|
846
|
-
},
|
|
846
|
+
}, Ir = ({
|
|
847
847
|
audioLevel: e,
|
|
848
848
|
bars: t = 20,
|
|
849
849
|
maxHeight: r = 20,
|
|
@@ -851,48 +851,48 @@ const kr = ({
|
|
|
851
851
|
className: i,
|
|
852
852
|
barClassName: l
|
|
853
853
|
}) => {
|
|
854
|
-
const
|
|
855
|
-
const
|
|
856
|
-
return Array.from({ length: t }, (f,
|
|
854
|
+
const c = N(null), a = N([]), s = Ge(() => {
|
|
855
|
+
const v = (Math.sqrt(5) - 1) / 2;
|
|
856
|
+
return Array.from({ length: t }, (f, u) => 0.5 + u * v % 1 * 0.5);
|
|
857
857
|
}, [t]);
|
|
858
|
-
|
|
859
|
-
for (let
|
|
860
|
-
const
|
|
861
|
-
if (!
|
|
862
|
-
const
|
|
863
|
-
|
|
858
|
+
R(() => e.subscribe((f) => {
|
|
859
|
+
for (let u = 0; u < t; u++) {
|
|
860
|
+
const I = a.current[u];
|
|
861
|
+
if (!I) continue;
|
|
862
|
+
const L = Math.max(o, f * r * s[u]);
|
|
863
|
+
I.style.height = `${L}px`;
|
|
864
864
|
}
|
|
865
865
|
}), [e, t, r, o, s]);
|
|
866
|
-
const
|
|
867
|
-
return /* @__PURE__ */ n("div", { ref:
|
|
866
|
+
const p = ["ll-waveform", i].filter(Boolean).join(" ");
|
|
867
|
+
return /* @__PURE__ */ n("div", { ref: c, className: p, "aria-hidden": "true", children: Array.from({ length: t }, (v, f) => /* @__PURE__ */ n(
|
|
868
868
|
"div",
|
|
869
869
|
{
|
|
870
|
-
ref: (
|
|
871
|
-
a.current[f] =
|
|
870
|
+
ref: (u) => {
|
|
871
|
+
a.current[f] = u;
|
|
872
872
|
},
|
|
873
873
|
className: ["ll-waveform__bar", l].filter(Boolean).join(" "),
|
|
874
874
|
style: { height: `${o}px` }
|
|
875
875
|
},
|
|
876
876
|
f
|
|
877
877
|
)) });
|
|
878
|
-
},
|
|
878
|
+
}, Rr = ({
|
|
879
879
|
position: e,
|
|
880
880
|
isMobile: t,
|
|
881
881
|
agentName: r,
|
|
882
882
|
avatarImageUrl: o,
|
|
883
883
|
agentState: i,
|
|
884
884
|
isMuted: l,
|
|
885
|
-
audioLevel:
|
|
885
|
+
audioLevel: c,
|
|
886
886
|
onExpand: a,
|
|
887
887
|
onToggleMute: s,
|
|
888
|
-
onClose:
|
|
888
|
+
onClose: p
|
|
889
889
|
}) => t ? /* @__PURE__ */ n(
|
|
890
890
|
"div",
|
|
891
891
|
{
|
|
892
892
|
className: "ll-minimized ll-minimized--mobile",
|
|
893
893
|
role: "region",
|
|
894
894
|
"aria-label": `${r} widget`,
|
|
895
|
-
children: /* @__PURE__ */
|
|
895
|
+
children: /* @__PURE__ */ w(
|
|
896
896
|
"button",
|
|
897
897
|
{
|
|
898
898
|
type: "button",
|
|
@@ -912,33 +912,33 @@ const kr = ({
|
|
|
912
912
|
)
|
|
913
913
|
) : /* @__PURE__ */ n("div", { className: "ll-minimized__avatar ll-minimized__avatar--placeholder" }),
|
|
914
914
|
/* @__PURE__ */ n(
|
|
915
|
-
|
|
915
|
+
Ir,
|
|
916
916
|
{
|
|
917
|
-
audioLevel:
|
|
917
|
+
audioLevel: c,
|
|
918
918
|
bars: 16,
|
|
919
919
|
maxHeight: 18,
|
|
920
920
|
className: "ll-minimized__waveform"
|
|
921
921
|
}
|
|
922
922
|
),
|
|
923
923
|
/* @__PURE__ */ n("span", { className: "ll-minimized__name", children: r }),
|
|
924
|
-
/* @__PURE__ */
|
|
924
|
+
/* @__PURE__ */ w("div", { className: "ll-minimized__controls", children: [
|
|
925
925
|
/* @__PURE__ */ n(
|
|
926
926
|
"span",
|
|
927
927
|
{
|
|
928
928
|
className: "ll-minimized__btn",
|
|
929
929
|
role: "button",
|
|
930
930
|
tabIndex: 0,
|
|
931
|
-
onClick: (
|
|
932
|
-
|
|
931
|
+
onClick: (v) => {
|
|
932
|
+
v.stopPropagation(), s();
|
|
933
933
|
},
|
|
934
|
-
onKeyDown: (
|
|
935
|
-
(
|
|
934
|
+
onKeyDown: (v) => {
|
|
935
|
+
(v.key === "Enter" || v.key === " ") && (v.stopPropagation(), v.preventDefault(), s());
|
|
936
936
|
},
|
|
937
937
|
"aria-label": l ? "Unmute microphone" : "Mute microphone",
|
|
938
|
-
children: /* @__PURE__ */ n(
|
|
938
|
+
children: /* @__PURE__ */ n(on, { muted: l, className: "ll-minimized__icon" })
|
|
939
939
|
}
|
|
940
940
|
),
|
|
941
|
-
/* @__PURE__ */ n(
|
|
941
|
+
/* @__PURE__ */ n(ln, { className: "ll-minimized__icon ll-minimized__icon--expand" })
|
|
942
942
|
] })
|
|
943
943
|
]
|
|
944
944
|
}
|
|
@@ -951,7 +951,7 @@ const kr = ({
|
|
|
951
951
|
"data-position": e,
|
|
952
952
|
role: "region",
|
|
953
953
|
"aria-label": `${r} widget`,
|
|
954
|
-
children: /* @__PURE__ */
|
|
954
|
+
children: /* @__PURE__ */ w("div", { className: "ll-minimized__surface", children: [
|
|
955
955
|
o ? (
|
|
956
956
|
// eslint-disable-next-line @next/next/no-img-element
|
|
957
957
|
/* @__PURE__ */ n(
|
|
@@ -963,11 +963,11 @@ const kr = ({
|
|
|
963
963
|
}
|
|
964
964
|
)
|
|
965
965
|
) : /* @__PURE__ */ n("div", { className: "ll-minimized__avatar ll-minimized__avatar--placeholder" }),
|
|
966
|
-
/* @__PURE__ */
|
|
966
|
+
/* @__PURE__ */ w("div", { className: "ll-minimized__meta", children: [
|
|
967
967
|
/* @__PURE__ */ n("span", { className: "ll-minimized__name", children: r }),
|
|
968
968
|
/* @__PURE__ */ n("span", { className: "ll-minimized__state", children: i === "speaking" ? "Speaking" : i === "thinking" ? "Thinking" : "Listening" })
|
|
969
969
|
] }),
|
|
970
|
-
/* @__PURE__ */
|
|
970
|
+
/* @__PURE__ */ w("div", { className: "ll-minimized__controls", children: [
|
|
971
971
|
/* @__PURE__ */ n(
|
|
972
972
|
"button",
|
|
973
973
|
{
|
|
@@ -975,7 +975,7 @@ const kr = ({
|
|
|
975
975
|
className: "ll-minimized__btn",
|
|
976
976
|
onClick: s,
|
|
977
977
|
"aria-label": l ? "Unmute microphone" : "Mute microphone",
|
|
978
|
-
children: /* @__PURE__ */ n(
|
|
978
|
+
children: /* @__PURE__ */ n(on, { muted: l, className: "ll-minimized__icon" })
|
|
979
979
|
}
|
|
980
980
|
),
|
|
981
981
|
/* @__PURE__ */ n(
|
|
@@ -985,7 +985,7 @@ const kr = ({
|
|
|
985
985
|
className: "ll-minimized__btn",
|
|
986
986
|
onClick: a,
|
|
987
987
|
"aria-label": `Expand ${r} widget`,
|
|
988
|
-
children: /* @__PURE__ */ n(
|
|
988
|
+
children: /* @__PURE__ */ n(ln, { className: "ll-minimized__icon" })
|
|
989
989
|
}
|
|
990
990
|
),
|
|
991
991
|
/* @__PURE__ */ n(
|
|
@@ -993,24 +993,24 @@ const kr = ({
|
|
|
993
993
|
{
|
|
994
994
|
type: "button",
|
|
995
995
|
className: "ll-minimized__btn ll-minimized__btn--close",
|
|
996
|
-
onClick:
|
|
996
|
+
onClick: p,
|
|
997
997
|
"aria-label": "Close widget",
|
|
998
|
-
children: /* @__PURE__ */ n(
|
|
998
|
+
children: /* @__PURE__ */ n(Lr, { className: "ll-minimized__icon" })
|
|
999
999
|
}
|
|
1000
1000
|
)
|
|
1001
1001
|
] })
|
|
1002
1002
|
] })
|
|
1003
1003
|
}
|
|
1004
|
-
),
|
|
1004
|
+
), Mr = ({
|
|
1005
1005
|
src: e,
|
|
1006
1006
|
alt: t,
|
|
1007
1007
|
preCannedPlaying: r = !1,
|
|
1008
1008
|
className: o,
|
|
1009
1009
|
style: i
|
|
1010
1010
|
}) => {
|
|
1011
|
-
const [l,
|
|
1012
|
-
if (
|
|
1013
|
-
a.current !== e && (a.current = e,
|
|
1011
|
+
const [l, c] = E(!1), a = N(e);
|
|
1012
|
+
if (R(() => {
|
|
1013
|
+
a.current !== e && (a.current = e, c(!1));
|
|
1014
1014
|
}, [e]), !e) return null;
|
|
1015
1015
|
const s = {
|
|
1016
1016
|
position: "absolute",
|
|
@@ -1035,46 +1035,46 @@ const kr = ({
|
|
|
1035
1035
|
style: s,
|
|
1036
1036
|
loading: "eager",
|
|
1037
1037
|
fetchPriority: "high",
|
|
1038
|
-
onLoad: () =>
|
|
1038
|
+
onLoad: () => c(!0)
|
|
1039
1039
|
}
|
|
1040
1040
|
)
|
|
1041
1041
|
);
|
|
1042
|
-
},
|
|
1042
|
+
}, Tr = 8, dn = 8, Dr = ({
|
|
1043
1043
|
open: e,
|
|
1044
1044
|
onClose: t,
|
|
1045
1045
|
anchorRef: r,
|
|
1046
1046
|
children: o
|
|
1047
1047
|
}) => {
|
|
1048
|
-
const i = N(null), [l,
|
|
1049
|
-
return
|
|
1048
|
+
const i = N(null), [l, c] = E(null);
|
|
1049
|
+
return wn(() => {
|
|
1050
1050
|
if (!e) {
|
|
1051
|
-
|
|
1051
|
+
c(null);
|
|
1052
1052
|
return;
|
|
1053
1053
|
}
|
|
1054
1054
|
const a = r.current;
|
|
1055
1055
|
if (!a) return;
|
|
1056
1056
|
const s = () => {
|
|
1057
|
-
const
|
|
1058
|
-
top:
|
|
1059
|
-
left:
|
|
1060
|
-
}, f =
|
|
1061
|
-
|
|
1057
|
+
const p = a.getBoundingClientRect(), v = {
|
|
1058
|
+
top: p.top - Tr,
|
|
1059
|
+
left: p.left + p.width / 2
|
|
1060
|
+
}, f = dn + 90, u = window.innerWidth - dn - 90;
|
|
1061
|
+
v.left < f && (v.left = f), v.left > u && (v.left = u), c(v);
|
|
1062
1062
|
};
|
|
1063
1063
|
return s(), window.addEventListener("scroll", s, !0), window.addEventListener("resize", s), () => {
|
|
1064
1064
|
window.removeEventListener("scroll", s, !0), window.removeEventListener("resize", s);
|
|
1065
1065
|
};
|
|
1066
|
-
}, [e, r]),
|
|
1066
|
+
}, [e, r]), R(() => {
|
|
1067
1067
|
if (!e) return;
|
|
1068
|
-
const a = (
|
|
1069
|
-
const
|
|
1070
|
-
f && f.contains(
|
|
1071
|
-
}, s = (
|
|
1072
|
-
|
|
1068
|
+
const a = (p) => {
|
|
1069
|
+
const v = p.target, f = i.current, u = r.current;
|
|
1070
|
+
f && f.contains(v) || u && u.contains(v) || t();
|
|
1071
|
+
}, s = (p) => {
|
|
1072
|
+
p.key === "Escape" && (p.stopPropagation(), t());
|
|
1073
1073
|
};
|
|
1074
1074
|
return document.addEventListener("mousedown", a), document.addEventListener("keydown", s), () => {
|
|
1075
1075
|
document.removeEventListener("mousedown", a), document.removeEventListener("keydown", s);
|
|
1076
1076
|
};
|
|
1077
|
-
}, [e, t, r]), !e || l === null || typeof document > "u" ? null :
|
|
1077
|
+
}, [e, t, r]), !e || l === null || typeof document > "u" ? null : Pt(
|
|
1078
1078
|
/* @__PURE__ */ n(
|
|
1079
1079
|
"div",
|
|
1080
1080
|
{
|
|
@@ -1094,25 +1094,25 @@ const kr = ({
|
|
|
1094
1094
|
),
|
|
1095
1095
|
document.body
|
|
1096
1096
|
);
|
|
1097
|
-
},
|
|
1097
|
+
}, Pr = ({
|
|
1098
1098
|
isMuted: e,
|
|
1099
1099
|
onToggleMute: t,
|
|
1100
1100
|
isCameraEnabled: r,
|
|
1101
1101
|
onToggleCamera: o,
|
|
1102
1102
|
allowCamera: i,
|
|
1103
1103
|
isScreenShareEnabled: l,
|
|
1104
|
-
onToggleScreenShare:
|
|
1104
|
+
onToggleScreenShare: c,
|
|
1105
1105
|
allowScreenShare: a,
|
|
1106
1106
|
isSpeakerMuted: s,
|
|
1107
|
-
onToggleSpeaker:
|
|
1108
|
-
allowTyping:
|
|
1107
|
+
onToggleSpeaker: p,
|
|
1108
|
+
allowTyping: v,
|
|
1109
1109
|
isTypingOpen: f,
|
|
1110
|
-
onToggleTyping:
|
|
1111
|
-
onDisconnect:
|
|
1110
|
+
onToggleTyping: u,
|
|
1111
|
+
onDisconnect: I
|
|
1112
1112
|
}) => {
|
|
1113
|
-
const [
|
|
1114
|
-
return /* @__PURE__ */
|
|
1115
|
-
/* @__PURE__ */
|
|
1113
|
+
const [L, _] = E(!1), h = N(null);
|
|
1114
|
+
return /* @__PURE__ */ w(Ye, { children: [
|
|
1115
|
+
/* @__PURE__ */ w(
|
|
1116
1116
|
"div",
|
|
1117
1117
|
{
|
|
1118
1118
|
className: "ll-toolbar ll-toolbar--compact",
|
|
@@ -1126,20 +1126,20 @@ const kr = ({
|
|
|
1126
1126
|
className: `ll-tool ${e ? "is-muted" : ""}`,
|
|
1127
1127
|
onClick: t,
|
|
1128
1128
|
"aria-label": e ? "Unmute microphone" : "Mute microphone",
|
|
1129
|
-
children: /* @__PURE__ */ n(
|
|
1129
|
+
children: /* @__PURE__ */ n(Cn, { muted: e })
|
|
1130
1130
|
}
|
|
1131
1131
|
),
|
|
1132
1132
|
/* @__PURE__ */ n(
|
|
1133
1133
|
"button",
|
|
1134
1134
|
{
|
|
1135
|
-
ref:
|
|
1135
|
+
ref: h,
|
|
1136
1136
|
type: "button",
|
|
1137
|
-
className: `ll-tool ${
|
|
1137
|
+
className: `ll-tool ${L ? "is-on" : ""}`,
|
|
1138
1138
|
onClick: () => _((b) => !b),
|
|
1139
1139
|
"aria-label": "More controls",
|
|
1140
1140
|
"aria-haspopup": "menu",
|
|
1141
|
-
"aria-expanded":
|
|
1142
|
-
children: /* @__PURE__ */ n(
|
|
1141
|
+
"aria-expanded": L,
|
|
1142
|
+
children: /* @__PURE__ */ n($r, {})
|
|
1143
1143
|
}
|
|
1144
1144
|
),
|
|
1145
1145
|
/* @__PURE__ */ n(
|
|
@@ -1147,22 +1147,22 @@ const kr = ({
|
|
|
1147
1147
|
{
|
|
1148
1148
|
type: "button",
|
|
1149
1149
|
className: "ll-tool ll-tool--danger",
|
|
1150
|
-
onClick:
|
|
1150
|
+
onClick: I,
|
|
1151
1151
|
"aria-label": "End conversation",
|
|
1152
|
-
children: /* @__PURE__ */ n(
|
|
1152
|
+
children: /* @__PURE__ */ n(Sn, {})
|
|
1153
1153
|
}
|
|
1154
1154
|
)
|
|
1155
1155
|
]
|
|
1156
1156
|
}
|
|
1157
1157
|
),
|
|
1158
|
-
/* @__PURE__ */
|
|
1159
|
-
|
|
1158
|
+
/* @__PURE__ */ w(
|
|
1159
|
+
Dr,
|
|
1160
1160
|
{
|
|
1161
|
-
open:
|
|
1161
|
+
open: L,
|
|
1162
1162
|
onClose: () => _(!1),
|
|
1163
|
-
anchorRef:
|
|
1163
|
+
anchorRef: h,
|
|
1164
1164
|
children: [
|
|
1165
|
-
i && /* @__PURE__ */
|
|
1165
|
+
i && /* @__PURE__ */ w(
|
|
1166
1166
|
"button",
|
|
1167
1167
|
{
|
|
1168
1168
|
type: "button",
|
|
@@ -1171,54 +1171,54 @@ const kr = ({
|
|
|
1171
1171
|
o(), _(!1);
|
|
1172
1172
|
},
|
|
1173
1173
|
children: [
|
|
1174
|
-
/* @__PURE__ */ n(
|
|
1174
|
+
/* @__PURE__ */ n(Ln, {}),
|
|
1175
1175
|
/* @__PURE__ */ n("span", { children: r ? "Stop camera" : "Start camera" })
|
|
1176
1176
|
]
|
|
1177
1177
|
}
|
|
1178
1178
|
),
|
|
1179
|
-
a && /* @__PURE__ */
|
|
1179
|
+
a && /* @__PURE__ */ w(
|
|
1180
1180
|
"button",
|
|
1181
1181
|
{
|
|
1182
1182
|
type: "button",
|
|
1183
1183
|
className: `ll-overflow-popover__item ${l ? "is-on" : ""}`,
|
|
1184
1184
|
onClick: () => {
|
|
1185
|
-
|
|
1185
|
+
c(), _(!1);
|
|
1186
1186
|
},
|
|
1187
1187
|
children: [
|
|
1188
|
-
/* @__PURE__ */ n(
|
|
1188
|
+
/* @__PURE__ */ n(kn, {}),
|
|
1189
1189
|
/* @__PURE__ */ n("span", { children: l ? "Stop sharing" : "Share screen" })
|
|
1190
1190
|
]
|
|
1191
1191
|
}
|
|
1192
1192
|
),
|
|
1193
|
-
/* @__PURE__ */
|
|
1193
|
+
/* @__PURE__ */ w(
|
|
1194
1194
|
"button",
|
|
1195
1195
|
{
|
|
1196
1196
|
type: "button",
|
|
1197
1197
|
className: `ll-overflow-popover__item ${s ? "is-on" : ""}`,
|
|
1198
1198
|
onClick: () => {
|
|
1199
|
-
|
|
1199
|
+
p(), _(!1);
|
|
1200
1200
|
},
|
|
1201
1201
|
children: [
|
|
1202
|
-
/* @__PURE__ */ n(
|
|
1202
|
+
/* @__PURE__ */ n(En, { muted: s }),
|
|
1203
1203
|
/* @__PURE__ */ n("span", { children: s ? "Unmute speaker" : "Mute speaker" })
|
|
1204
1204
|
]
|
|
1205
1205
|
}
|
|
1206
1206
|
),
|
|
1207
|
-
|
|
1207
|
+
v && /* @__PURE__ */ w(
|
|
1208
1208
|
"button",
|
|
1209
1209
|
{
|
|
1210
1210
|
type: "button",
|
|
1211
1211
|
className: `ll-overflow-popover__item ${f ? "is-on" : ""}`,
|
|
1212
1212
|
onClick: () => {
|
|
1213
|
-
|
|
1213
|
+
u(), _(!1);
|
|
1214
1214
|
},
|
|
1215
1215
|
children: [
|
|
1216
|
-
/* @__PURE__ */ n(
|
|
1216
|
+
/* @__PURE__ */ n(zr, {}),
|
|
1217
1217
|
/* @__PURE__ */ n("span", { children: f ? "Hide typing" : "Type a message" })
|
|
1218
1218
|
]
|
|
1219
1219
|
}
|
|
1220
1220
|
),
|
|
1221
|
-
/* @__PURE__ */
|
|
1221
|
+
/* @__PURE__ */ w(
|
|
1222
1222
|
"button",
|
|
1223
1223
|
{
|
|
1224
1224
|
type: "button",
|
|
@@ -1236,8 +1236,8 @@ const kr = ({
|
|
|
1236
1236
|
)
|
|
1237
1237
|
] });
|
|
1238
1238
|
};
|
|
1239
|
-
function
|
|
1240
|
-
return /* @__PURE__ */
|
|
1239
|
+
function $r() {
|
|
1240
|
+
return /* @__PURE__ */ w(
|
|
1241
1241
|
"svg",
|
|
1242
1242
|
{
|
|
1243
1243
|
width: "16",
|
|
@@ -1253,7 +1253,7 @@ function Rr() {
|
|
|
1253
1253
|
}
|
|
1254
1254
|
);
|
|
1255
1255
|
}
|
|
1256
|
-
function
|
|
1256
|
+
function zr() {
|
|
1257
1257
|
return /* @__PURE__ */ n(
|
|
1258
1258
|
"svg",
|
|
1259
1259
|
{
|
|
@@ -1270,151 +1270,151 @@ function Ir() {
|
|
|
1270
1270
|
}
|
|
1271
1271
|
);
|
|
1272
1272
|
}
|
|
1273
|
-
const
|
|
1273
|
+
const Or = ({
|
|
1274
1274
|
position: e,
|
|
1275
1275
|
isMobile: t,
|
|
1276
1276
|
agentName: r,
|
|
1277
1277
|
avatarImageUrl: o,
|
|
1278
1278
|
idleLoopUrl: i,
|
|
1279
1279
|
greeting: l,
|
|
1280
|
-
branding:
|
|
1280
|
+
branding: c,
|
|
1281
1281
|
teamMembers: a,
|
|
1282
1282
|
currentTeamMemberId: s,
|
|
1283
|
-
isSwitchingTeamMember:
|
|
1284
|
-
teamSwitcherOpen:
|
|
1283
|
+
isSwitchingTeamMember: p,
|
|
1284
|
+
teamSwitcherOpen: v,
|
|
1285
1285
|
onToggleTeamSwitcher: f,
|
|
1286
|
-
onSelectTeamMember:
|
|
1287
|
-
languageMenuOpen:
|
|
1288
|
-
onToggleLanguageMenu:
|
|
1286
|
+
onSelectTeamMember: u,
|
|
1287
|
+
languageMenuOpen: I,
|
|
1288
|
+
onToggleLanguageMenu: L,
|
|
1289
1289
|
connectionState: _,
|
|
1290
|
-
agentState:
|
|
1290
|
+
agentState: h,
|
|
1291
1291
|
transcript: b,
|
|
1292
1292
|
canResume: S,
|
|
1293
|
-
needsUserGesture:
|
|
1294
|
-
error:
|
|
1295
|
-
isMuted:
|
|
1296
|
-
micError:
|
|
1297
|
-
micDevices:
|
|
1298
|
-
activeMicId:
|
|
1299
|
-
isCameraEnabled:
|
|
1300
|
-
cameraPreviewEl:
|
|
1301
|
-
cameraDevices:
|
|
1302
|
-
activeCameraId:
|
|
1303
|
-
isScreenShareEnabled:
|
|
1304
|
-
screenPreviewEl:
|
|
1305
|
-
isSpeakerMuted:
|
|
1306
|
-
allowCamera:
|
|
1307
|
-
allowScreenShare:
|
|
1308
|
-
allowTyping:
|
|
1293
|
+
needsUserGesture: T,
|
|
1294
|
+
error: A,
|
|
1295
|
+
isMuted: F,
|
|
1296
|
+
micError: g,
|
|
1297
|
+
micDevices: P,
|
|
1298
|
+
activeMicId: H,
|
|
1299
|
+
isCameraEnabled: q,
|
|
1300
|
+
cameraPreviewEl: Z,
|
|
1301
|
+
cameraDevices: M,
|
|
1302
|
+
activeCameraId: U,
|
|
1303
|
+
isScreenShareEnabled: B,
|
|
1304
|
+
screenPreviewEl: J,
|
|
1305
|
+
isSpeakerMuted: oe,
|
|
1306
|
+
allowCamera: _e,
|
|
1307
|
+
allowScreenShare: K,
|
|
1308
|
+
allowTyping: xe,
|
|
1309
1309
|
showMinimize: ye = !0,
|
|
1310
|
-
showClose:
|
|
1311
|
-
chromeless:
|
|
1312
|
-
compactControls:
|
|
1313
|
-
transforming:
|
|
1310
|
+
showClose: ke = !0,
|
|
1311
|
+
chromeless: ve = !1,
|
|
1312
|
+
compactControls: ie = !1,
|
|
1313
|
+
transforming: dt,
|
|
1314
1314
|
transformingLabel: Je,
|
|
1315
|
-
avatarVideoContainerRef:
|
|
1316
|
-
agentVideoEl:
|
|
1315
|
+
avatarVideoContainerRef: ut,
|
|
1316
|
+
agentVideoEl: ce,
|
|
1317
1317
|
onConnect: Ke,
|
|
1318
1318
|
onDisconnect: Xe,
|
|
1319
|
-
onRetry:
|
|
1319
|
+
onRetry: ft,
|
|
1320
1320
|
onResumeAudio: Qe,
|
|
1321
|
-
onToggleMute:
|
|
1322
|
-
onSwitchMicDevice:
|
|
1323
|
-
onToggleCamera:
|
|
1324
|
-
onSwitchCameraDevice:
|
|
1325
|
-
onToggleScreenShare:
|
|
1326
|
-
onToggleSpeaker:
|
|
1321
|
+
onToggleMute: Se,
|
|
1322
|
+
onSwitchMicDevice: Pe,
|
|
1323
|
+
onToggleCamera: Ne,
|
|
1324
|
+
onSwitchCameraDevice: $e,
|
|
1325
|
+
onToggleScreenShare: Ae,
|
|
1326
|
+
onToggleSpeaker: Ie,
|
|
1327
1327
|
onSendMessage: Re,
|
|
1328
|
-
onMinimize:
|
|
1329
|
-
onClose:
|
|
1328
|
+
onMinimize: Me,
|
|
1329
|
+
onClose: $,
|
|
1330
1330
|
onClearMicError: kt
|
|
1331
1331
|
}) => {
|
|
1332
|
-
var
|
|
1333
|
-
const
|
|
1334
|
-
|
|
1335
|
-
if (!
|
|
1332
|
+
var mt;
|
|
1333
|
+
const Te = ((a == null ? void 0 : a.length) ?? 0) > 1, ze = _ === "connecting" || _ === "connected", se = _ === "connected", Ze = _ === "idle" || _ === "disconnected" || _ === "error", [De, Oe] = E(!1);
|
|
1334
|
+
R(() => {
|
|
1335
|
+
if (!ce) {
|
|
1336
1336
|
Oe(!1);
|
|
1337
1337
|
return;
|
|
1338
1338
|
}
|
|
1339
|
-
if (!
|
|
1339
|
+
if (!ce.paused && ce.readyState >= 2) {
|
|
1340
1340
|
Oe(!0);
|
|
1341
1341
|
return;
|
|
1342
1342
|
}
|
|
1343
1343
|
Oe(!1);
|
|
1344
|
-
const
|
|
1345
|
-
return
|
|
1346
|
-
|
|
1344
|
+
const m = () => Oe(!0);
|
|
1345
|
+
return ce.addEventListener("playing", m), ce.addEventListener("loadeddata", m), () => {
|
|
1346
|
+
ce.removeEventListener("playing", m), ce.removeEventListener("loadeddata", m);
|
|
1347
1347
|
};
|
|
1348
|
-
}, [
|
|
1349
|
-
const [
|
|
1350
|
-
|
|
1351
|
-
if (!
|
|
1352
|
-
|
|
1348
|
+
}, [ce]);
|
|
1349
|
+
const [Lt, Le] = E(!1);
|
|
1350
|
+
R(() => {
|
|
1351
|
+
if (!se) {
|
|
1352
|
+
Le(!1);
|
|
1353
1353
|
return;
|
|
1354
1354
|
}
|
|
1355
|
-
if (
|
|
1356
|
-
const
|
|
1357
|
-
return () => clearTimeout(
|
|
1358
|
-
}, [
|
|
1359
|
-
const
|
|
1360
|
-
|
|
1361
|
-
const
|
|
1362
|
-
|
|
1363
|
-
}, [
|
|
1364
|
-
const
|
|
1365
|
-
|
|
1366
|
-
}, [
|
|
1367
|
-
const [
|
|
1368
|
-
|
|
1369
|
-
if (!
|
|
1370
|
-
const
|
|
1371
|
-
|
|
1355
|
+
if (De) return;
|
|
1356
|
+
const m = setTimeout(() => Le(!0), 8e3);
|
|
1357
|
+
return () => clearTimeout(m);
|
|
1358
|
+
}, [se, De]);
|
|
1359
|
+
const ee = _ === "connecting" || se && !!o && !De && !Lt, et = N(null), ue = N(null);
|
|
1360
|
+
R(() => {
|
|
1361
|
+
const m = et.current;
|
|
1362
|
+
m && (m.innerHTML = "", Z && (Z.style.width = "100%", Z.style.height = "100%", Z.style.objectFit = "cover", Z.style.transform = "scaleX(-1)", m.appendChild(Z)));
|
|
1363
|
+
}, [Z]), R(() => {
|
|
1364
|
+
const m = ue.current;
|
|
1365
|
+
m && (m.innerHTML = "", J && (J.style.width = "100%", J.style.height = "100%", J.style.objectFit = "contain", m.appendChild(J)));
|
|
1366
|
+
}, [J]);
|
|
1367
|
+
const [He, Be] = E(!1), [te, le] = E(!1), pt = N(null), ht = N(null);
|
|
1368
|
+
R(() => {
|
|
1369
|
+
if (!He && !te && !I && !v) return;
|
|
1370
|
+
const m = () => {
|
|
1371
|
+
Be(!1), le(!1), I && L(), v && f();
|
|
1372
1372
|
};
|
|
1373
|
-
return document.addEventListener("click",
|
|
1373
|
+
return document.addEventListener("click", m), () => document.removeEventListener("click", m);
|
|
1374
1374
|
}, [
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1375
|
+
He,
|
|
1376
|
+
te,
|
|
1377
|
+
I,
|
|
1378
|
+
v,
|
|
1379
|
+
L,
|
|
1380
1380
|
f
|
|
1381
1381
|
]);
|
|
1382
|
-
const [
|
|
1383
|
-
(
|
|
1384
|
-
|
|
1385
|
-
const
|
|
1386
|
-
|
|
1382
|
+
const [Ce, tt] = E(!1), re = C(() => tt((m) => !m), []), [ae, Ee] = E(""), nt = C(
|
|
1383
|
+
(m) => {
|
|
1384
|
+
m.preventDefault();
|
|
1385
|
+
const Y = ae.trim();
|
|
1386
|
+
Y && (Re(Y), Ee(""));
|
|
1387
1387
|
},
|
|
1388
|
-
[
|
|
1389
|
-
),
|
|
1390
|
-
let
|
|
1391
|
-
for (let
|
|
1392
|
-
const
|
|
1393
|
-
if (!
|
|
1388
|
+
[ae, Re]
|
|
1389
|
+
), Ct = c.productName || "Live Layer";
|
|
1390
|
+
let fe = null, pe = null;
|
|
1391
|
+
for (let m = b.length - 1; m >= 0; m--) {
|
|
1392
|
+
const Y = b[m];
|
|
1393
|
+
if (!fe && Y.role === "agent" ? fe = Y : !pe && Y.role === "user" && (pe = Y), fe && pe) break;
|
|
1394
1394
|
}
|
|
1395
|
-
const
|
|
1395
|
+
const rt = se ? (fe == null ? void 0 : fe.text) || null : l || null, We = se && (pe == null ? void 0 : pe.text) || null, ot = [
|
|
1396
1396
|
"ll-expanded",
|
|
1397
1397
|
t ? "ll-expanded--mobile" : "ll-expanded--desktop"
|
|
1398
1398
|
].join(" ");
|
|
1399
|
-
return /* @__PURE__ */
|
|
1399
|
+
return /* @__PURE__ */ w(
|
|
1400
1400
|
"div",
|
|
1401
1401
|
{
|
|
1402
|
-
className:
|
|
1402
|
+
className: ot,
|
|
1403
1403
|
"data-position": e,
|
|
1404
|
-
"data-state":
|
|
1404
|
+
"data-state": se ? "connected" : ze ? "connecting" : "idle",
|
|
1405
1405
|
role: "dialog",
|
|
1406
1406
|
"aria-label": `${r} widget`,
|
|
1407
1407
|
children: [
|
|
1408
|
-
/* @__PURE__ */
|
|
1408
|
+
/* @__PURE__ */ w("div", { className: "ll-expanded__bg", children: [
|
|
1409
1409
|
o ? /* @__PURE__ */ n(
|
|
1410
|
-
|
|
1410
|
+
Mr,
|
|
1411
1411
|
{
|
|
1412
1412
|
src: o,
|
|
1413
1413
|
alt: r,
|
|
1414
1414
|
className: "ll-expanded__bg-img"
|
|
1415
1415
|
}
|
|
1416
|
-
) : /* @__PURE__ */ n("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ n("span", { className: "ll-expanded__bg-initial", children: ((
|
|
1417
|
-
i && !
|
|
1416
|
+
) : /* @__PURE__ */ n("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ n("span", { className: "ll-expanded__bg-initial", children: ((mt = r == null ? void 0 : r.charAt(0)) == null ? void 0 : mt.toUpperCase()) || "A" }) }),
|
|
1417
|
+
i && !se && /* @__PURE__ */ n(
|
|
1418
1418
|
"video",
|
|
1419
1419
|
{
|
|
1420
1420
|
className: "ll-expanded__bg-idle",
|
|
@@ -1426,12 +1426,12 @@ const Mr = ({
|
|
|
1426
1426
|
}
|
|
1427
1427
|
)
|
|
1428
1428
|
] }),
|
|
1429
|
-
/* @__PURE__ */ n("div", { ref:
|
|
1430
|
-
|
|
1429
|
+
/* @__PURE__ */ n("div", { ref: ut, className: "ll-expanded__video" }),
|
|
1430
|
+
ee && /* @__PURE__ */ w("div", { className: "ll-expanded__overlay ll-expanded__overlay--connecting", children: [
|
|
1431
1431
|
/* @__PURE__ */ n("div", { className: "ll-expanded__spinner" }),
|
|
1432
|
-
/* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children:
|
|
1432
|
+
/* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children: p ? "Switching..." : "Connecting..." })
|
|
1433
1433
|
] }),
|
|
1434
|
-
|
|
1434
|
+
T && se && /* @__PURE__ */ w(
|
|
1435
1435
|
"button",
|
|
1436
1436
|
{
|
|
1437
1437
|
type: "button",
|
|
@@ -1443,7 +1443,7 @@ const Mr = ({
|
|
|
1443
1443
|
]
|
|
1444
1444
|
}
|
|
1445
1445
|
),
|
|
1446
|
-
|
|
1446
|
+
dt && /* @__PURE__ */ w(
|
|
1447
1447
|
"div",
|
|
1448
1448
|
{
|
|
1449
1449
|
className: "ll-expanded__overlay ll-expanded__overlay--transforming",
|
|
@@ -1456,69 +1456,69 @@ const Mr = ({
|
|
|
1456
1456
|
]
|
|
1457
1457
|
}
|
|
1458
1458
|
),
|
|
1459
|
-
|
|
1460
|
-
!
|
|
1461
|
-
!
|
|
1462
|
-
/* @__PURE__ */
|
|
1463
|
-
/* @__PURE__ */
|
|
1459
|
+
ze ? /* @__PURE__ */ w(Ye, { children: [
|
|
1460
|
+
!ie && /* @__PURE__ */ w("div", { className: "ll-expanded__topbar", children: [
|
|
1461
|
+
!ve && /* @__PURE__ */ w("div", { className: "ll-expanded__topbar-left", children: [
|
|
1462
|
+
/* @__PURE__ */ w("div", { className: "ll-expanded__pill-wrap", children: [
|
|
1463
|
+
/* @__PURE__ */ w(
|
|
1464
1464
|
"button",
|
|
1465
1465
|
{
|
|
1466
1466
|
type: "button",
|
|
1467
1467
|
className: "ll-hpill",
|
|
1468
|
-
onClick: (
|
|
1469
|
-
|
|
1468
|
+
onClick: (m) => {
|
|
1469
|
+
Te && (m.stopPropagation(), f());
|
|
1470
1470
|
},
|
|
1471
|
-
"aria-haspopup":
|
|
1472
|
-
"aria-expanded":
|
|
1471
|
+
"aria-haspopup": Te ? "listbox" : void 0,
|
|
1472
|
+
"aria-expanded": Te ? v : void 0,
|
|
1473
1473
|
children: [
|
|
1474
1474
|
/* @__PURE__ */ n("span", { className: "ll-hpill__label", children: r }),
|
|
1475
|
-
|
|
1475
|
+
Te && /* @__PURE__ */ n(bt, {})
|
|
1476
1476
|
]
|
|
1477
1477
|
}
|
|
1478
1478
|
),
|
|
1479
|
-
|
|
1479
|
+
Te && v && /* @__PURE__ */ n(
|
|
1480
1480
|
"div",
|
|
1481
1481
|
{
|
|
1482
1482
|
className: "ll-hmenu",
|
|
1483
|
-
onClick: (
|
|
1483
|
+
onClick: (m) => m.stopPropagation(),
|
|
1484
1484
|
role: "listbox",
|
|
1485
|
-
children: a == null ? void 0 : a.map((
|
|
1485
|
+
children: a == null ? void 0 : a.map((m) => /* @__PURE__ */ w(
|
|
1486
1486
|
"button",
|
|
1487
1487
|
{
|
|
1488
1488
|
type: "button",
|
|
1489
|
-
className: `ll-hmenu__item ${
|
|
1490
|
-
onClick: () =>
|
|
1489
|
+
className: `ll-hmenu__item ${m.id === s ? "is-active" : ""}`,
|
|
1490
|
+
onClick: () => u(m.id),
|
|
1491
1491
|
role: "option",
|
|
1492
|
-
"aria-selected":
|
|
1492
|
+
"aria-selected": m.id === s,
|
|
1493
1493
|
children: [
|
|
1494
|
-
|
|
1494
|
+
m.avatarImageUrl && /* @__PURE__ */ n(
|
|
1495
1495
|
"img",
|
|
1496
1496
|
{
|
|
1497
|
-
src:
|
|
1497
|
+
src: m.avatarImageUrl,
|
|
1498
1498
|
alt: "",
|
|
1499
1499
|
className: "ll-hmenu__avatar"
|
|
1500
1500
|
}
|
|
1501
1501
|
),
|
|
1502
|
-
/* @__PURE__ */ n("span", { className: "ll-hmenu__name", children:
|
|
1503
|
-
|
|
1502
|
+
/* @__PURE__ */ n("span", { className: "ll-hmenu__name", children: m.name }),
|
|
1503
|
+
m.role && /* @__PURE__ */ n("span", { className: "ll-hmenu__role", children: m.role })
|
|
1504
1504
|
]
|
|
1505
1505
|
},
|
|
1506
|
-
|
|
1506
|
+
m.id
|
|
1507
1507
|
))
|
|
1508
1508
|
}
|
|
1509
1509
|
)
|
|
1510
1510
|
] }),
|
|
1511
|
-
/* @__PURE__ */
|
|
1512
|
-
/* @__PURE__ */
|
|
1511
|
+
/* @__PURE__ */ w("div", { className: "ll-expanded__pill-wrap", children: [
|
|
1512
|
+
/* @__PURE__ */ w(
|
|
1513
1513
|
"button",
|
|
1514
1514
|
{
|
|
1515
1515
|
type: "button",
|
|
1516
1516
|
className: "ll-hpill ll-hpill--compact",
|
|
1517
|
-
onClick: (
|
|
1518
|
-
|
|
1517
|
+
onClick: (m) => {
|
|
1518
|
+
m.stopPropagation(), L();
|
|
1519
1519
|
},
|
|
1520
1520
|
"aria-haspopup": "listbox",
|
|
1521
|
-
"aria-expanded":
|
|
1521
|
+
"aria-expanded": I,
|
|
1522
1522
|
"aria-label": "Language: English",
|
|
1523
1523
|
title: "Language: English",
|
|
1524
1524
|
children: [
|
|
@@ -1527,11 +1527,11 @@ const Mr = ({
|
|
|
1527
1527
|
]
|
|
1528
1528
|
}
|
|
1529
1529
|
),
|
|
1530
|
-
|
|
1530
|
+
I && /* @__PURE__ */ n(
|
|
1531
1531
|
"div",
|
|
1532
1532
|
{
|
|
1533
1533
|
className: "ll-hmenu",
|
|
1534
|
-
onClick: (
|
|
1534
|
+
onClick: (m) => m.stopPropagation(),
|
|
1535
1535
|
role: "listbox",
|
|
1536
1536
|
children: /* @__PURE__ */ n(
|
|
1537
1537
|
"button",
|
|
@@ -1549,88 +1549,88 @@ const Mr = ({
|
|
|
1549
1549
|
/* @__PURE__ */ n(
|
|
1550
1550
|
"span",
|
|
1551
1551
|
{
|
|
1552
|
-
className: `ll-expanded__state ll-expanded__state--${
|
|
1553
|
-
children:
|
|
1552
|
+
className: `ll-expanded__state ll-expanded__state--${h}`,
|
|
1553
|
+
children: h
|
|
1554
1554
|
}
|
|
1555
1555
|
)
|
|
1556
1556
|
] }),
|
|
1557
|
-
/* @__PURE__ */
|
|
1557
|
+
/* @__PURE__ */ w("div", { className: "ll-expanded__header-actions", children: [
|
|
1558
1558
|
ye !== !1 && /* @__PURE__ */ n(
|
|
1559
1559
|
"button",
|
|
1560
1560
|
{
|
|
1561
1561
|
type: "button",
|
|
1562
1562
|
className: "ll-hbtn",
|
|
1563
|
-
onClick:
|
|
1563
|
+
onClick: Me,
|
|
1564
1564
|
"aria-label": "Minimize widget",
|
|
1565
1565
|
title: "Minimize",
|
|
1566
|
-
children: /* @__PURE__ */ n(
|
|
1566
|
+
children: /* @__PURE__ */ n(fn, {})
|
|
1567
1567
|
}
|
|
1568
1568
|
),
|
|
1569
|
-
|
|
1569
|
+
ke !== !1 && /* @__PURE__ */ n(
|
|
1570
1570
|
"button",
|
|
1571
1571
|
{
|
|
1572
1572
|
type: "button",
|
|
1573
1573
|
className: "ll-hbtn ll-hbtn--danger",
|
|
1574
|
-
onClick:
|
|
1574
|
+
onClick: $,
|
|
1575
1575
|
"aria-label": "End call",
|
|
1576
1576
|
title: "End call",
|
|
1577
|
-
children: /* @__PURE__ */ n(
|
|
1577
|
+
children: /* @__PURE__ */ n(un, {})
|
|
1578
1578
|
}
|
|
1579
1579
|
)
|
|
1580
1580
|
] })
|
|
1581
1581
|
] }),
|
|
1582
|
-
|
|
1582
|
+
ie && /* @__PURE__ */ w("div", { className: "ll-compact-status", "data-state": h, children: [
|
|
1583
1583
|
/* @__PURE__ */ n("span", { className: "ll-compact-status__dot", "aria-hidden": !0 }),
|
|
1584
|
-
/* @__PURE__ */ n("span", { className: "ll-compact-status__label", children:
|
|
1584
|
+
/* @__PURE__ */ n("span", { className: "ll-compact-status__label", children: h })
|
|
1585
1585
|
] })
|
|
1586
1586
|
] }) : (
|
|
1587
1587
|
// Idle-state header with Live Layer product name + minimize/close.
|
|
1588
1588
|
// Hidden in compact mode — on a 140×210 docked slot the brand pill
|
|
1589
1589
|
// and 40px buttons crowded out the central "Start video call"
|
|
1590
1590
|
// affordance. The user can dismiss by scrolling past the slot.
|
|
1591
|
-
!
|
|
1592
|
-
/* @__PURE__ */ n("span", { className: "ll-expanded__brand", children:
|
|
1593
|
-
/* @__PURE__ */
|
|
1591
|
+
!ie && /* @__PURE__ */ w("div", { className: "ll-expanded__header ll-expanded__header--idle", children: [
|
|
1592
|
+
/* @__PURE__ */ n("span", { className: "ll-expanded__brand", children: Ct }),
|
|
1593
|
+
/* @__PURE__ */ w("div", { className: "ll-expanded__header-actions", children: [
|
|
1594
1594
|
ye !== !1 && /* @__PURE__ */ n(
|
|
1595
1595
|
"button",
|
|
1596
1596
|
{
|
|
1597
1597
|
type: "button",
|
|
1598
1598
|
className: "ll-hbtn ll-hbtn--ghost",
|
|
1599
|
-
onClick:
|
|
1599
|
+
onClick: Me,
|
|
1600
1600
|
"aria-label": "Minimize widget",
|
|
1601
|
-
children: /* @__PURE__ */ n(
|
|
1601
|
+
children: /* @__PURE__ */ n(fn, {})
|
|
1602
1602
|
}
|
|
1603
1603
|
),
|
|
1604
|
-
|
|
1604
|
+
ke !== !1 && /* @__PURE__ */ n(
|
|
1605
1605
|
"button",
|
|
1606
1606
|
{
|
|
1607
1607
|
type: "button",
|
|
1608
1608
|
className: "ll-hbtn ll-hbtn--danger",
|
|
1609
|
-
onClick:
|
|
1609
|
+
onClick: $,
|
|
1610
1610
|
"aria-label": "Close widget",
|
|
1611
|
-
children: /* @__PURE__ */ n(
|
|
1611
|
+
children: /* @__PURE__ */ n(un, {})
|
|
1612
1612
|
}
|
|
1613
1613
|
)
|
|
1614
1614
|
] })
|
|
1615
1615
|
] })
|
|
1616
1616
|
),
|
|
1617
1617
|
Ze && /* @__PURE__ */ (() => {
|
|
1618
|
-
const
|
|
1619
|
-
return /* @__PURE__ */
|
|
1620
|
-
!
|
|
1618
|
+
const m = S ? "Resume session" : _ === "disconnected" ? "Reconnect to agent" : "Start video call";
|
|
1619
|
+
return /* @__PURE__ */ w(Ye, { children: [
|
|
1620
|
+
!A && /* @__PURE__ */ w(
|
|
1621
1621
|
"button",
|
|
1622
1622
|
{
|
|
1623
1623
|
type: "button",
|
|
1624
1624
|
className: "ll-expanded__play",
|
|
1625
1625
|
onClick: Ke,
|
|
1626
|
-
"aria-label":
|
|
1626
|
+
"aria-label": m,
|
|
1627
1627
|
children: [
|
|
1628
1628
|
/* @__PURE__ */ n("div", { className: "ll-expanded__play-circle", children: /* @__PURE__ */ n("svg", { width: "22", height: "22", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": !0, children: /* @__PURE__ */ n("polygon", { points: "6 3 20 12 6 21 6 3" }) }) }),
|
|
1629
|
-
|
|
1629
|
+
ie && /* @__PURE__ */ n("span", { className: "ll-expanded__play-label", children: m })
|
|
1630
1630
|
]
|
|
1631
1631
|
}
|
|
1632
1632
|
),
|
|
1633
|
-
!
|
|
1633
|
+
!ie && /* @__PURE__ */ w("div", { className: "ll-expanded__bottom ll-expanded__bottom--idle", children: [
|
|
1634
1634
|
l && /* @__PURE__ */ n("div", { className: "ll-expanded__transcript", children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: l }) }),
|
|
1635
1635
|
/* @__PURE__ */ n(
|
|
1636
1636
|
"button",
|
|
@@ -1638,140 +1638,140 @@ const Mr = ({
|
|
|
1638
1638
|
type: "button",
|
|
1639
1639
|
className: "ll-expanded__cta",
|
|
1640
1640
|
onClick: Ke,
|
|
1641
|
-
"aria-label":
|
|
1642
|
-
children:
|
|
1641
|
+
"aria-label": m,
|
|
1642
|
+
children: m
|
|
1643
1643
|
}
|
|
1644
1644
|
)
|
|
1645
1645
|
] })
|
|
1646
1646
|
] });
|
|
1647
1647
|
})(),
|
|
1648
|
-
/* @__PURE__ */
|
|
1648
|
+
/* @__PURE__ */ w(
|
|
1649
1649
|
"div",
|
|
1650
1650
|
{
|
|
1651
|
-
className: `ll-expanded__pip ${
|
|
1651
|
+
className: `ll-expanded__pip ${ze && (q || B) ? "is-visible" : ""}`,
|
|
1652
1652
|
children: [
|
|
1653
1653
|
/* @__PURE__ */ n(
|
|
1654
1654
|
"div",
|
|
1655
1655
|
{
|
|
1656
|
-
ref:
|
|
1657
|
-
className:
|
|
1656
|
+
ref: ue,
|
|
1657
|
+
className: B ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
|
|
1658
1658
|
}
|
|
1659
1659
|
),
|
|
1660
1660
|
/* @__PURE__ */ n(
|
|
1661
1661
|
"div",
|
|
1662
1662
|
{
|
|
1663
|
-
ref:
|
|
1664
|
-
className: !
|
|
1663
|
+
ref: et,
|
|
1664
|
+
className: !B && q ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
|
|
1665
1665
|
}
|
|
1666
1666
|
)
|
|
1667
1667
|
]
|
|
1668
1668
|
}
|
|
1669
1669
|
),
|
|
1670
|
-
|
|
1671
|
-
!
|
|
1670
|
+
ze ? /* @__PURE__ */ w("div", { className: "ll-expanded__bottom", children: [
|
|
1671
|
+
!ie && rt && /* @__PURE__ */ n(
|
|
1672
1672
|
"div",
|
|
1673
1673
|
{
|
|
1674
1674
|
className: "ll-expanded__transcript ll-expanded__transcript--agent",
|
|
1675
1675
|
"data-role": "agent",
|
|
1676
|
-
children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children:
|
|
1676
|
+
children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: rt })
|
|
1677
1677
|
}
|
|
1678
1678
|
),
|
|
1679
|
-
!
|
|
1679
|
+
!ie && We && /* @__PURE__ */ n(
|
|
1680
1680
|
"div",
|
|
1681
1681
|
{
|
|
1682
1682
|
className: "ll-expanded__transcript ll-expanded__transcript--user",
|
|
1683
1683
|
"data-role": "user",
|
|
1684
|
-
children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children:
|
|
1684
|
+
children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: We })
|
|
1685
1685
|
}
|
|
1686
1686
|
),
|
|
1687
|
-
!
|
|
1688
|
-
|
|
1687
|
+
!ve && !ie && /* @__PURE__ */ w("div", { className: "ll-toolbar", onClick: (m) => m.stopPropagation(), children: [
|
|
1688
|
+
K && /* @__PURE__ */ n(
|
|
1689
1689
|
"button",
|
|
1690
1690
|
{
|
|
1691
1691
|
type: "button",
|
|
1692
|
-
className: `ll-tool ${
|
|
1693
|
-
onClick:
|
|
1694
|
-
"aria-label":
|
|
1695
|
-
title:
|
|
1696
|
-
children: /* @__PURE__ */ n(
|
|
1692
|
+
className: `ll-tool ${B ? "is-on" : ""}`,
|
|
1693
|
+
onClick: Ae,
|
|
1694
|
+
"aria-label": B ? "Stop sharing screen" : "Share screen",
|
|
1695
|
+
title: B ? "Stop sharing" : "Share screen",
|
|
1696
|
+
children: /* @__PURE__ */ n(kn, {})
|
|
1697
1697
|
}
|
|
1698
1698
|
),
|
|
1699
|
-
|
|
1699
|
+
_e && /* @__PURE__ */ w("div", { className: "ll-tool-split", children: [
|
|
1700
1700
|
/* @__PURE__ */ n(
|
|
1701
1701
|
"button",
|
|
1702
1702
|
{
|
|
1703
1703
|
type: "button",
|
|
1704
|
-
className: `ll-tool ll-tool--left ${
|
|
1705
|
-
onClick:
|
|
1706
|
-
"aria-label":
|
|
1707
|
-
title:
|
|
1708
|
-
children: /* @__PURE__ */ n(
|
|
1704
|
+
className: `ll-tool ll-tool--left ${q ? "is-on" : ""}`,
|
|
1705
|
+
onClick: Ne,
|
|
1706
|
+
"aria-label": q ? "Turn off camera" : "Turn on camera",
|
|
1707
|
+
title: q ? "Stop camera" : "Start camera",
|
|
1708
|
+
children: /* @__PURE__ */ n(Ln, {})
|
|
1709
1709
|
}
|
|
1710
1710
|
),
|
|
1711
1711
|
/* @__PURE__ */ n(
|
|
1712
1712
|
"button",
|
|
1713
1713
|
{
|
|
1714
|
-
ref:
|
|
1714
|
+
ref: ht,
|
|
1715
1715
|
type: "button",
|
|
1716
|
-
className: `ll-tool ll-tool--right ${
|
|
1717
|
-
onClick: (
|
|
1718
|
-
|
|
1716
|
+
className: `ll-tool ll-tool--right ${q ? "is-on" : ""}`,
|
|
1717
|
+
onClick: (m) => {
|
|
1718
|
+
m.stopPropagation(), le((Y) => !Y), Be(!1);
|
|
1719
1719
|
},
|
|
1720
1720
|
"aria-label": "Camera devices",
|
|
1721
1721
|
"aria-haspopup": "listbox",
|
|
1722
|
-
"aria-expanded":
|
|
1722
|
+
"aria-expanded": te,
|
|
1723
1723
|
children: /* @__PURE__ */ n(bt, {})
|
|
1724
1724
|
}
|
|
1725
1725
|
),
|
|
1726
|
-
|
|
1727
|
-
|
|
1726
|
+
te && M.length > 0 && /* @__PURE__ */ n(
|
|
1727
|
+
pn,
|
|
1728
1728
|
{
|
|
1729
1729
|
label: "Camera",
|
|
1730
|
-
devices:
|
|
1731
|
-
activeId:
|
|
1732
|
-
anchorRef:
|
|
1733
|
-
onPick: (
|
|
1734
|
-
|
|
1730
|
+
devices: M,
|
|
1731
|
+
activeId: U,
|
|
1732
|
+
anchorRef: ht,
|
|
1733
|
+
onPick: (m) => {
|
|
1734
|
+
le(!1), $e(m);
|
|
1735
1735
|
}
|
|
1736
1736
|
}
|
|
1737
1737
|
)
|
|
1738
1738
|
] }),
|
|
1739
|
-
/* @__PURE__ */
|
|
1739
|
+
/* @__PURE__ */ w("div", { className: "ll-tool-split", children: [
|
|
1740
1740
|
/* @__PURE__ */ n(
|
|
1741
1741
|
"button",
|
|
1742
1742
|
{
|
|
1743
1743
|
type: "button",
|
|
1744
|
-
className: `ll-tool ll-tool--left ${
|
|
1745
|
-
onClick:
|
|
1746
|
-
"aria-label":
|
|
1747
|
-
title:
|
|
1748
|
-
children: /* @__PURE__ */ n(
|
|
1744
|
+
className: `ll-tool ll-tool--left ${F ? "is-muted" : ""}`,
|
|
1745
|
+
onClick: Se,
|
|
1746
|
+
"aria-label": F ? "Unmute microphone" : "Mute microphone",
|
|
1747
|
+
title: F ? "Unmute" : "Mute",
|
|
1748
|
+
children: /* @__PURE__ */ n(Cn, { muted: F })
|
|
1749
1749
|
}
|
|
1750
1750
|
),
|
|
1751
1751
|
/* @__PURE__ */ n(
|
|
1752
1752
|
"button",
|
|
1753
1753
|
{
|
|
1754
|
-
ref:
|
|
1754
|
+
ref: pt,
|
|
1755
1755
|
type: "button",
|
|
1756
|
-
className: `ll-tool ll-tool--right ${
|
|
1757
|
-
onClick: (
|
|
1758
|
-
|
|
1756
|
+
className: `ll-tool ll-tool--right ${F ? "is-muted" : ""}`,
|
|
1757
|
+
onClick: (m) => {
|
|
1758
|
+
m.stopPropagation(), Be((Y) => !Y), le(!1);
|
|
1759
1759
|
},
|
|
1760
1760
|
"aria-label": "Microphone devices",
|
|
1761
1761
|
"aria-haspopup": "listbox",
|
|
1762
|
-
"aria-expanded":
|
|
1762
|
+
"aria-expanded": He,
|
|
1763
1763
|
children: /* @__PURE__ */ n(bt, {})
|
|
1764
1764
|
}
|
|
1765
1765
|
),
|
|
1766
|
-
|
|
1767
|
-
|
|
1766
|
+
He && P.length > 0 && /* @__PURE__ */ n(
|
|
1767
|
+
pn,
|
|
1768
1768
|
{
|
|
1769
1769
|
label: "Microphone",
|
|
1770
|
-
devices:
|
|
1771
|
-
activeId:
|
|
1772
|
-
anchorRef:
|
|
1773
|
-
onPick: (
|
|
1774
|
-
|
|
1770
|
+
devices: P,
|
|
1771
|
+
activeId: H,
|
|
1772
|
+
anchorRef: pt,
|
|
1773
|
+
onPick: (m) => {
|
|
1774
|
+
Be(!1), Pe(m);
|
|
1775
1775
|
}
|
|
1776
1776
|
}
|
|
1777
1777
|
)
|
|
@@ -1780,11 +1780,11 @@ const Mr = ({
|
|
|
1780
1780
|
"button",
|
|
1781
1781
|
{
|
|
1782
1782
|
type: "button",
|
|
1783
|
-
className: `ll-tool ${
|
|
1784
|
-
onClick:
|
|
1785
|
-
"aria-label":
|
|
1786
|
-
title:
|
|
1787
|
-
children: /* @__PURE__ */ n(
|
|
1783
|
+
className: `ll-tool ${oe ? "is-muted" : ""}`,
|
|
1784
|
+
onClick: Ie,
|
|
1785
|
+
"aria-label": oe ? "Unmute speaker" : "Mute speaker",
|
|
1786
|
+
title: oe ? "Unmute speaker" : "Mute speaker",
|
|
1787
|
+
children: /* @__PURE__ */ n(En, { muted: oe })
|
|
1788
1788
|
}
|
|
1789
1789
|
),
|
|
1790
1790
|
/* @__PURE__ */ n(
|
|
@@ -1795,56 +1795,56 @@ const Mr = ({
|
|
|
1795
1795
|
onClick: Xe,
|
|
1796
1796
|
"aria-label": "End conversation",
|
|
1797
1797
|
title: "End conversation",
|
|
1798
|
-
children: /* @__PURE__ */ n(
|
|
1798
|
+
children: /* @__PURE__ */ n(Sn, {})
|
|
1799
1799
|
}
|
|
1800
1800
|
)
|
|
1801
1801
|
] }),
|
|
1802
|
-
!
|
|
1803
|
-
|
|
1802
|
+
!ve && ie && /* @__PURE__ */ n(
|
|
1803
|
+
Pr,
|
|
1804
1804
|
{
|
|
1805
|
-
isMuted:
|
|
1806
|
-
onToggleMute:
|
|
1807
|
-
isCameraEnabled:
|
|
1808
|
-
onToggleCamera:
|
|
1809
|
-
allowCamera:
|
|
1810
|
-
isScreenShareEnabled:
|
|
1811
|
-
onToggleScreenShare:
|
|
1812
|
-
allowScreenShare:
|
|
1813
|
-
isSpeakerMuted:
|
|
1814
|
-
onToggleSpeaker:
|
|
1815
|
-
allowTyping:
|
|
1816
|
-
isTypingOpen:
|
|
1817
|
-
onToggleTyping:
|
|
1805
|
+
isMuted: F,
|
|
1806
|
+
onToggleMute: Se,
|
|
1807
|
+
isCameraEnabled: q,
|
|
1808
|
+
onToggleCamera: Ne,
|
|
1809
|
+
allowCamera: _e,
|
|
1810
|
+
isScreenShareEnabled: B,
|
|
1811
|
+
onToggleScreenShare: Ae,
|
|
1812
|
+
allowScreenShare: K,
|
|
1813
|
+
isSpeakerMuted: oe,
|
|
1814
|
+
onToggleSpeaker: Ie,
|
|
1815
|
+
allowTyping: xe,
|
|
1816
|
+
isTypingOpen: Ce,
|
|
1817
|
+
onToggleTyping: re,
|
|
1818
1818
|
onDisconnect: Xe
|
|
1819
1819
|
}
|
|
1820
1820
|
),
|
|
1821
|
-
!
|
|
1821
|
+
!ve && xe && (ie ? Ce : !0) && /* @__PURE__ */ w("form", { className: "ll-message-input", onSubmit: nt, children: [
|
|
1822
1822
|
/* @__PURE__ */ n(
|
|
1823
1823
|
"input",
|
|
1824
1824
|
{
|
|
1825
1825
|
type: "text",
|
|
1826
1826
|
className: "ll-message-input__field",
|
|
1827
1827
|
placeholder: "Message...",
|
|
1828
|
-
value:
|
|
1829
|
-
onChange: (
|
|
1828
|
+
value: ae,
|
|
1829
|
+
onChange: (m) => Ee(m.target.value),
|
|
1830
1830
|
"aria-label": "Message the agent"
|
|
1831
1831
|
}
|
|
1832
1832
|
),
|
|
1833
|
-
|
|
1833
|
+
ae.trim() && /* @__PURE__ */ n(
|
|
1834
1834
|
"button",
|
|
1835
1835
|
{
|
|
1836
1836
|
type: "submit",
|
|
1837
1837
|
className: "ll-message-input__send",
|
|
1838
1838
|
"aria-label": "Send message",
|
|
1839
|
-
children: /* @__PURE__ */ n(
|
|
1839
|
+
children: /* @__PURE__ */ n(Hr, {})
|
|
1840
1840
|
}
|
|
1841
1841
|
)
|
|
1842
1842
|
] })
|
|
1843
1843
|
] }) : null,
|
|
1844
1844
|
(() => {
|
|
1845
|
-
if (
|
|
1846
|
-
return /* @__PURE__ */
|
|
1847
|
-
/* @__PURE__ */ n("span", { children:
|
|
1845
|
+
if (g && _ !== "error")
|
|
1846
|
+
return /* @__PURE__ */ w("div", { className: "ll-expanded__banner", role: "alert", children: [
|
|
1847
|
+
/* @__PURE__ */ n("span", { children: g }),
|
|
1848
1848
|
/* @__PURE__ */ n(
|
|
1849
1849
|
"button",
|
|
1850
1850
|
{
|
|
@@ -1856,17 +1856,17 @@ const Mr = ({
|
|
|
1856
1856
|
}
|
|
1857
1857
|
)
|
|
1858
1858
|
] });
|
|
1859
|
-
if (!
|
|
1860
|
-
let
|
|
1861
|
-
return
|
|
1862
|
-
/* @__PURE__ */ n("span", { children:
|
|
1859
|
+
if (!A || _ !== "error") return null;
|
|
1860
|
+
let m = "Failed to connect", Y = "Try again";
|
|
1861
|
+
return A === "MIC_PERMISSION_DENIED" ? m = "Microphone blocked. Allow access to talk." : A === "MIC_NOT_FOUND" ? m = "No microphone found. Plug one in + retry." : A === "MIC_UNAVAILABLE" ? m = "Mic unavailable. Check other apps using it." : A === "AGENT_TIMEOUT" ? m = "Agent didn't pick up. Try again." : A === "CONNECT_FAILED" ? m = "Connection failed. Check your network." : A.length < 80 && (m = A), /* @__PURE__ */ w("div", { className: "ll-expanded__banner ll-expanded__banner--error", role: "alert", children: [
|
|
1862
|
+
/* @__PURE__ */ n("span", { children: m }),
|
|
1863
1863
|
/* @__PURE__ */ n(
|
|
1864
1864
|
"button",
|
|
1865
1865
|
{
|
|
1866
1866
|
type: "button",
|
|
1867
1867
|
className: "ll-expanded__banner-retry",
|
|
1868
|
-
onClick:
|
|
1869
|
-
children:
|
|
1868
|
+
onClick: ft,
|
|
1869
|
+
children: Y
|
|
1870
1870
|
}
|
|
1871
1871
|
)
|
|
1872
1872
|
] });
|
|
@@ -1878,52 +1878,52 @@ const Mr = ({
|
|
|
1878
1878
|
function bt() {
|
|
1879
1879
|
return /* @__PURE__ */ n("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": !0, children: /* @__PURE__ */ n("polyline", { points: "6 9 12 15 18 9" }) });
|
|
1880
1880
|
}
|
|
1881
|
-
function
|
|
1882
|
-
return /* @__PURE__ */
|
|
1881
|
+
function un() {
|
|
1882
|
+
return /* @__PURE__ */ w("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": !0, children: [
|
|
1883
1883
|
/* @__PURE__ */ n("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
1884
1884
|
/* @__PURE__ */ n("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
1885
1885
|
] });
|
|
1886
1886
|
}
|
|
1887
|
-
function
|
|
1887
|
+
function fn() {
|
|
1888
1888
|
return /* @__PURE__ */ n("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": !0, children: /* @__PURE__ */ n("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) });
|
|
1889
1889
|
}
|
|
1890
|
-
function
|
|
1891
|
-
return /* @__PURE__ */
|
|
1890
|
+
function kn() {
|
|
1891
|
+
return /* @__PURE__ */ w("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: [
|
|
1892
1892
|
/* @__PURE__ */ n("rect", { x: "2", y: "3", width: "20", height: "14", rx: "2" }),
|
|
1893
1893
|
/* @__PURE__ */ n("line", { x1: "8", y1: "21", x2: "16", y2: "21" }),
|
|
1894
1894
|
/* @__PURE__ */ n("line", { x1: "12", y1: "17", x2: "12", y2: "21" })
|
|
1895
1895
|
] });
|
|
1896
1896
|
}
|
|
1897
|
-
function
|
|
1898
|
-
return /* @__PURE__ */
|
|
1897
|
+
function Ln() {
|
|
1898
|
+
return /* @__PURE__ */ w("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: [
|
|
1899
1899
|
/* @__PURE__ */ n("path", { d: "M23 7l-7 5 7 5V7z" }),
|
|
1900
1900
|
/* @__PURE__ */ n("rect", { x: "1", y: "5", width: "15", height: "14", rx: "2" })
|
|
1901
1901
|
] });
|
|
1902
1902
|
}
|
|
1903
|
-
function
|
|
1904
|
-
return /* @__PURE__ */
|
|
1903
|
+
function Cn({ muted: e }) {
|
|
1904
|
+
return /* @__PURE__ */ w("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: [
|
|
1905
1905
|
/* @__PURE__ */ n("path", { d: "M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z" }),
|
|
1906
1906
|
/* @__PURE__ */ n("path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }),
|
|
1907
1907
|
/* @__PURE__ */ n("line", { x1: "12", y1: "19", x2: "12", y2: "23" }),
|
|
1908
1908
|
e && /* @__PURE__ */ n("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
|
|
1909
1909
|
] });
|
|
1910
1910
|
}
|
|
1911
|
-
function
|
|
1912
|
-
return /* @__PURE__ */
|
|
1911
|
+
function En({ muted: e }) {
|
|
1912
|
+
return /* @__PURE__ */ w("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: [
|
|
1913
1913
|
/* @__PURE__ */ n("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
|
|
1914
|
-
e ? /* @__PURE__ */ n("line", { x1: "23", y1: "9", x2: "17", y2: "15" }) : /* @__PURE__ */
|
|
1914
|
+
e ? /* @__PURE__ */ n("line", { x1: "23", y1: "9", x2: "17", y2: "15" }) : /* @__PURE__ */ w(Ye, { children: [
|
|
1915
1915
|
/* @__PURE__ */ n("path", { d: "M19.07 4.93a10 10 0 0 1 0 14.14" }),
|
|
1916
1916
|
/* @__PURE__ */ n("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" })
|
|
1917
1917
|
] })
|
|
1918
1918
|
] });
|
|
1919
1919
|
}
|
|
1920
|
-
function
|
|
1921
|
-
return /* @__PURE__ */
|
|
1920
|
+
function Hr() {
|
|
1921
|
+
return /* @__PURE__ */ w("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
|
|
1922
1922
|
/* @__PURE__ */ n("line", { x1: "5", y1: "12", x2: "19", y2: "12" }),
|
|
1923
1923
|
/* @__PURE__ */ n("polyline", { points: "12 5 19 12 12 19" })
|
|
1924
1924
|
] });
|
|
1925
1925
|
}
|
|
1926
|
-
function
|
|
1926
|
+
function Sn() {
|
|
1927
1927
|
return /* @__PURE__ */ n("svg", { width: "16", height: "16", viewBox: "-4 -4 32 32", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: /* @__PURE__ */ n(
|
|
1928
1928
|
"path",
|
|
1929
1929
|
{
|
|
@@ -1932,29 +1932,29 @@ function xn() {
|
|
|
1932
1932
|
}
|
|
1933
1933
|
) });
|
|
1934
1934
|
}
|
|
1935
|
-
const
|
|
1935
|
+
const pn = ({
|
|
1936
1936
|
label: e,
|
|
1937
1937
|
devices: t,
|
|
1938
1938
|
activeId: r,
|
|
1939
1939
|
onPick: o,
|
|
1940
1940
|
anchorRef: i
|
|
1941
1941
|
}) => {
|
|
1942
|
-
const [l,
|
|
1943
|
-
return
|
|
1942
|
+
const [l, c] = E(null);
|
|
1943
|
+
return wn(() => {
|
|
1944
1944
|
const a = () => {
|
|
1945
1945
|
const s = i.current;
|
|
1946
1946
|
if (!s) return;
|
|
1947
|
-
const
|
|
1948
|
-
|
|
1949
|
-
top:
|
|
1950
|
-
left: Math.max(
|
|
1947
|
+
const p = s.getBoundingClientRect(), v = 126, f = window.innerWidth - 16 - 110, u = p.left + p.width / 2;
|
|
1948
|
+
c({
|
|
1949
|
+
top: p.top - 8,
|
|
1950
|
+
left: Math.max(v, Math.min(f, u))
|
|
1951
1951
|
});
|
|
1952
1952
|
};
|
|
1953
1953
|
return a(), window.addEventListener("scroll", a, !0), window.addEventListener("resize", a), () => {
|
|
1954
1954
|
window.removeEventListener("scroll", a, !0), window.removeEventListener("resize", a);
|
|
1955
1955
|
};
|
|
1956
|
-
}, [i]), l === null || typeof document > "u" ? null :
|
|
1957
|
-
/* @__PURE__ */
|
|
1956
|
+
}, [i]), l === null || typeof document > "u" ? null : Pt(
|
|
1957
|
+
/* @__PURE__ */ w(
|
|
1958
1958
|
"div",
|
|
1959
1959
|
{
|
|
1960
1960
|
className: "ll-device-menu ll-device-menu--floating",
|
|
@@ -1970,17 +1970,17 @@ const sn = ({
|
|
|
1970
1970
|
children: [
|
|
1971
1971
|
/* @__PURE__ */ n("p", { className: "ll-device-menu__label", children: e }),
|
|
1972
1972
|
t.map((a, s) => {
|
|
1973
|
-
const
|
|
1974
|
-
return /* @__PURE__ */
|
|
1973
|
+
const p = r === a.deviceId;
|
|
1974
|
+
return /* @__PURE__ */ w(
|
|
1975
1975
|
"button",
|
|
1976
1976
|
{
|
|
1977
1977
|
type: "button",
|
|
1978
|
-
className: `ll-device-menu__item ${
|
|
1978
|
+
className: `ll-device-menu__item ${p ? "is-active" : ""}`,
|
|
1979
1979
|
onClick: () => o(a.deviceId),
|
|
1980
1980
|
role: "option",
|
|
1981
|
-
"aria-selected":
|
|
1981
|
+
"aria-selected": p,
|
|
1982
1982
|
children: [
|
|
1983
|
-
|
|
1983
|
+
p && /* @__PURE__ */ n("span", { className: "ll-device-menu__dot", children: "●" }),
|
|
1984
1984
|
/* @__PURE__ */ n("span", { className: "ll-device-menu__name", children: a.label || `${e} ${s + 1}` })
|
|
1985
1985
|
]
|
|
1986
1986
|
},
|
|
@@ -1992,21 +1992,25 @@ const sn = ({
|
|
|
1992
1992
|
),
|
|
1993
1993
|
document.body
|
|
1994
1994
|
);
|
|
1995
|
-
},
|
|
1996
|
-
|
|
1995
|
+
}, Br = [
|
|
1996
|
+
// Accept any value (or empty) — `<input data-ll-private />` and
|
|
1997
|
+
// `<input data-ll-private="true" />` both opt out. The bare attribute
|
|
1998
|
+
// is the recommended spelling; "true" is preserved for back-compat.
|
|
1999
|
+
"[data-ll-private]",
|
|
2000
|
+
"[data-ll-skip]",
|
|
1997
2001
|
".ll-widget"
|
|
1998
2002
|
];
|
|
1999
|
-
function
|
|
2003
|
+
function $t(e) {
|
|
2000
2004
|
let t = e;
|
|
2001
2005
|
for (; t; ) {
|
|
2002
|
-
for (const r of
|
|
2006
|
+
for (const r of Br)
|
|
2003
2007
|
if (t.matches(r)) return !0;
|
|
2004
2008
|
t = t.parentElement;
|
|
2005
2009
|
}
|
|
2006
2010
|
return !1;
|
|
2007
2011
|
}
|
|
2008
2012
|
function xt(e) {
|
|
2009
|
-
if (
|
|
2013
|
+
if ($t(e)) return !1;
|
|
2010
2014
|
if (e instanceof HTMLInputElement) {
|
|
2011
2015
|
if (e.type === "password") return !1;
|
|
2012
2016
|
const t = (e.getAttribute("autocomplete") || "").toLowerCase();
|
|
@@ -2014,7 +2018,7 @@ function xt(e) {
|
|
|
2014
2018
|
}
|
|
2015
2019
|
return !0;
|
|
2016
2020
|
}
|
|
2017
|
-
const wt = 4096,
|
|
2021
|
+
const wt = 4096, Wr = 20, qr = 20, Fr = 10, Ur = 10, jr = 30, Vr = 20, hn = 500, Yr = [
|
|
2018
2022
|
'[data-ll-private="true"]',
|
|
2019
2023
|
".ll-widget",
|
|
2020
2024
|
"script",
|
|
@@ -2022,28 +2026,28 @@ const wt = 4096, Pr = 20, $r = 20, zr = 10, Or = 10, Hr = 30, Wr = 20, dn = 500,
|
|
|
2022
2026
|
"noscript",
|
|
2023
2027
|
"iframe"
|
|
2024
2028
|
];
|
|
2025
|
-
function
|
|
2029
|
+
function ct(e) {
|
|
2026
2030
|
if (e.getAttribute("aria-hidden") === "true" || e.hasAttribute("hidden")) return !0;
|
|
2027
2031
|
let t = e;
|
|
2028
2032
|
for (; t; ) {
|
|
2029
|
-
for (const r of
|
|
2033
|
+
for (const r of Yr)
|
|
2030
2034
|
if (t.matches(r)) return !0;
|
|
2031
2035
|
t = t.parentElement;
|
|
2032
2036
|
}
|
|
2033
2037
|
return !1;
|
|
2034
2038
|
}
|
|
2035
|
-
function
|
|
2039
|
+
function st(e) {
|
|
2036
2040
|
if (typeof window > "u") return !0;
|
|
2037
2041
|
const t = e.getBoundingClientRect();
|
|
2038
2042
|
if (t.width <= 0 || t.height <= 0) return !1;
|
|
2039
2043
|
const r = window.innerHeight || document.documentElement.clientHeight, o = window.innerWidth || document.documentElement.clientWidth;
|
|
2040
2044
|
return t.bottom > 0 && t.right > 0 && t.top < r && t.left < o;
|
|
2041
2045
|
}
|
|
2042
|
-
function
|
|
2046
|
+
function mn(e) {
|
|
2043
2047
|
const t = e.getAttribute("id");
|
|
2044
2048
|
if (t) {
|
|
2045
|
-
const l = document.querySelector(`label[for="${
|
|
2046
|
-
if (
|
|
2049
|
+
const l = typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(t) : t.replace(/"/g, '\\"'), c = document.querySelector(`label[for="${l}"]`);
|
|
2050
|
+
if (c != null && c.textContent) return c.textContent.trim();
|
|
2047
2051
|
}
|
|
2048
2052
|
const r = e.getAttribute("aria-label");
|
|
2049
2053
|
if (r) return r.trim();
|
|
@@ -2052,13 +2056,42 @@ function un(e) {
|
|
|
2052
2056
|
const i = e.closest("label");
|
|
2053
2057
|
return i != null && i.textContent ? i.textContent.trim() : "";
|
|
2054
2058
|
}
|
|
2055
|
-
function
|
|
2059
|
+
function we(e, t) {
|
|
2056
2060
|
return e.length <= t ? e : e.slice(0, t - 1) + "…";
|
|
2057
2061
|
}
|
|
2062
|
+
function Gr(e) {
|
|
2063
|
+
return e && e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60) || null;
|
|
2064
|
+
}
|
|
2065
|
+
function Jr(e) {
|
|
2066
|
+
const t = e.getAttribute("aria-label");
|
|
2067
|
+
if (t) return t.trim().slice(0, 80);
|
|
2068
|
+
const r = e.getAttribute("aria-labelledby");
|
|
2069
|
+
if (r) {
|
|
2070
|
+
const l = document.getElementById(r);
|
|
2071
|
+
if (l != null && l.textContent) return l.textContent.trim().slice(0, 80);
|
|
2072
|
+
}
|
|
2073
|
+
const o = e.querySelector(
|
|
2074
|
+
'button[type="submit"], input[type="submit"], button:not([type])'
|
|
2075
|
+
);
|
|
2076
|
+
if (o) {
|
|
2077
|
+
const l = o instanceof HTMLInputElement ? o.value : (o.textContent ?? "").trim();
|
|
2078
|
+
if (l && l.length < 60 && !/^(submit|ok|continue)$/i.test(l))
|
|
2079
|
+
return l;
|
|
2080
|
+
}
|
|
2081
|
+
let i = e.parentElement;
|
|
2082
|
+
for (let l = 0; i && l < 4; l++, i = i.parentElement) {
|
|
2083
|
+
const c = i.querySelector("h1, h2, h3, h4");
|
|
2084
|
+
if (c != null && c.textContent) {
|
|
2085
|
+
const a = c.textContent.trim();
|
|
2086
|
+
if (a && a.length < 80) return a;
|
|
2087
|
+
}
|
|
2088
|
+
}
|
|
2089
|
+
return null;
|
|
2090
|
+
}
|
|
2058
2091
|
function Ue(e) {
|
|
2059
2092
|
return e.length;
|
|
2060
2093
|
}
|
|
2061
|
-
function
|
|
2094
|
+
function Kr(e, t = {}) {
|
|
2062
2095
|
const r = t.doc ?? (typeof document < "u" ? document : null);
|
|
2063
2096
|
if (!r)
|
|
2064
2097
|
return {
|
|
@@ -2072,120 +2105,121 @@ function qr(e, t = {}) {
|
|
|
2072
2105
|
forms: [],
|
|
2073
2106
|
extras: e
|
|
2074
2107
|
};
|
|
2075
|
-
const o = typeof window < "u" && window.location.href || "", i = typeof window < "u" && window.location.pathname || "/", l = r.title || "",
|
|
2108
|
+
const o = typeof window < "u" && window.location.href || "", i = typeof window < "u" && window.location.pathname || "/", l = r.title || "", c = Array.from(
|
|
2076
2109
|
r.querySelectorAll("[data-ll-region]")
|
|
2077
2110
|
), a = [];
|
|
2078
|
-
for (const
|
|
2079
|
-
if (a.length >=
|
|
2080
|
-
if (
|
|
2081
|
-
const
|
|
2082
|
-
(
|
|
2083
|
-
|
|
2111
|
+
for (const g of c) {
|
|
2112
|
+
if (a.length >= Fr) break;
|
|
2113
|
+
if (ct(g) || !st(g)) continue;
|
|
2114
|
+
const P = g.getAttribute("data-ll-region") ?? "", H = g.getAttribute("data-ll-intent") ?? void 0, q = we(
|
|
2115
|
+
(g.innerText || g.textContent || "").trim(),
|
|
2116
|
+
hn * 2
|
|
2084
2117
|
);
|
|
2085
|
-
!
|
|
2118
|
+
!P || !q || a.push({ id: P, intent: H, text: q });
|
|
2086
2119
|
}
|
|
2087
|
-
const s = [],
|
|
2120
|
+
const s = [], p = ["H1", "H2", "H3", "H4", "H5", "H6"], v = Array.from(
|
|
2088
2121
|
r.querySelectorAll("h1, h2, h3, h4, h5, h6")
|
|
2089
2122
|
);
|
|
2090
|
-
for (const
|
|
2091
|
-
if (
|
|
2092
|
-
const
|
|
2093
|
-
|
|
2123
|
+
for (const g of v) {
|
|
2124
|
+
if (ct(g) || !st(g)) continue;
|
|
2125
|
+
const P = (g.textContent || "").trim();
|
|
2126
|
+
P && s.push(`${g.tagName}: ${we(P, 200)}`);
|
|
2094
2127
|
}
|
|
2095
2128
|
const f = Array.from(r.querySelectorAll("p, li"));
|
|
2096
|
-
for (const
|
|
2097
|
-
if (
|
|
2098
|
-
const
|
|
2099
|
-
|
|
2129
|
+
for (const g of f) {
|
|
2130
|
+
if (ct(g) || !st(g) || p.includes(g.tagName)) continue;
|
|
2131
|
+
const P = (g.textContent || "").trim();
|
|
2132
|
+
P.length > 10 && s.push(we(P, hn));
|
|
2100
2133
|
}
|
|
2101
|
-
const
|
|
2102
|
-
`),
|
|
2103
|
-
for (const
|
|
2104
|
-
if (
|
|
2105
|
-
if (
|
|
2106
|
-
const
|
|
2107
|
-
!
|
|
2134
|
+
const u = s.join(`
|
|
2135
|
+
`), I = [], L = Array.from(r.querySelectorAll("a[href]"));
|
|
2136
|
+
for (const g of L) {
|
|
2137
|
+
if (I.length >= Wr) break;
|
|
2138
|
+
if (ct(g) || !st(g)) continue;
|
|
2139
|
+
const P = g.getAttribute("href") || "", H = (g.textContent || "").trim();
|
|
2140
|
+
!P || !H || I.push({ href: P, text: we(H, 100) });
|
|
2108
2141
|
}
|
|
2109
|
-
const _ = [],
|
|
2142
|
+
const _ = [], h = Array.from(
|
|
2110
2143
|
r.querySelectorAll(
|
|
2111
2144
|
"input, textarea, select"
|
|
2112
2145
|
)
|
|
2113
2146
|
);
|
|
2114
|
-
for (const
|
|
2115
|
-
if (_.length >=
|
|
2116
|
-
if (
|
|
2117
|
-
const
|
|
2118
|
-
|
|
2147
|
+
for (const g of h) {
|
|
2148
|
+
if (_.length >= qr) break;
|
|
2149
|
+
if (ct(g) || !xt(g) || !st(g)) continue;
|
|
2150
|
+
const P = mn(g), H = g instanceof HTMLInputElement ? g.type : g.tagName.toLowerCase();
|
|
2151
|
+
P && _.push({ label: we(P, 100), type: H });
|
|
2119
2152
|
}
|
|
2120
|
-
const b = Array.from(
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
if (
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
const B = k.getAttribute("data-ll-intent") || void 0, q = Array.from(
|
|
2129
|
-
k.querySelectorAll(
|
|
2130
|
-
"[data-ll-field]"
|
|
2153
|
+
const b = Array.from(r.querySelectorAll("form")), S = [];
|
|
2154
|
+
let T = 0;
|
|
2155
|
+
for (const g of b) {
|
|
2156
|
+
if (S.length >= Ur) break;
|
|
2157
|
+
if ($t(g) || g.matches(".ll-widget *, .ll-widget")) continue;
|
|
2158
|
+
const P = g.getAttribute("id") || g.getAttribute("name") || Gr(g.getAttribute("data-ll-intent")) || `form_${T++}`, H = g.getAttribute("data-ll-intent") || Jr(g) || void 0, q = Array.from(
|
|
2159
|
+
g.querySelectorAll(
|
|
2160
|
+
"input[name], textarea[name], select[name]"
|
|
2131
2161
|
)
|
|
2132
|
-
),
|
|
2133
|
-
for (const
|
|
2134
|
-
if (
|
|
2135
|
-
if (!xt(
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2162
|
+
), Z = [];
|
|
2163
|
+
for (const M of q) {
|
|
2164
|
+
if (Z.length >= jr) break;
|
|
2165
|
+
if (!xt(M)) continue;
|
|
2166
|
+
if (M instanceof HTMLInputElement) {
|
|
2167
|
+
const K = M.type;
|
|
2168
|
+
if (K === "submit" || K === "button" || K === "reset" || K === "hidden" || K === "image" || K === "file") continue;
|
|
2169
|
+
}
|
|
2170
|
+
const U = M.getAttribute("name") || "";
|
|
2171
|
+
if (!U) continue;
|
|
2172
|
+
const B = mn(M) || U, J = M instanceof HTMLInputElement ? M.type : M.tagName.toLowerCase(), oe = {
|
|
2173
|
+
name: U,
|
|
2174
|
+
label: we(B, 100),
|
|
2175
|
+
type: J
|
|
2142
2176
|
};
|
|
2143
|
-
if (
|
|
2144
|
-
const
|
|
2145
|
-
for (let
|
|
2146
|
-
const
|
|
2147
|
-
if (!
|
|
2148
|
-
const
|
|
2149
|
-
!
|
|
2177
|
+
if (M.required === !0 && (oe.required = !0), M instanceof HTMLSelectElement) {
|
|
2178
|
+
const K = [];
|
|
2179
|
+
for (let xe = 0; xe < M.options.length && !(K.length >= Vr); xe++) {
|
|
2180
|
+
const ye = M.options[xe];
|
|
2181
|
+
if (!ye || ye.disabled) continue;
|
|
2182
|
+
const ke = ye.value || "", ve = (ye.textContent || "").trim() || ke;
|
|
2183
|
+
!ke && !ve || K.push({ value: ke, label: we(ve, 60) });
|
|
2150
2184
|
}
|
|
2151
|
-
|
|
2185
|
+
K.length > 0 && (oe.options = K);
|
|
2152
2186
|
}
|
|
2153
|
-
const
|
|
2154
|
-
|
|
2187
|
+
const _e = typeof M.validationMessage == "string" ? M.validationMessage : "";
|
|
2188
|
+
_e && (oe.validationMessage = we(_e, 200)), Z.push(oe);
|
|
2155
2189
|
}
|
|
2156
|
-
S.push({ id:
|
|
2190
|
+
S.push({ id: P, intent: H, fields: Z });
|
|
2157
2191
|
}
|
|
2158
|
-
const
|
|
2192
|
+
const A = {
|
|
2159
2193
|
url: o,
|
|
2160
2194
|
title: l,
|
|
2161
2195
|
pathname: i,
|
|
2162
2196
|
regions: a,
|
|
2163
|
-
visibleText:
|
|
2164
|
-
visibleLinks:
|
|
2197
|
+
visibleText: u,
|
|
2198
|
+
visibleLinks: I,
|
|
2165
2199
|
visibleFields: _,
|
|
2166
2200
|
forms: S,
|
|
2167
2201
|
extras: e
|
|
2168
2202
|
};
|
|
2169
|
-
let
|
|
2170
|
-
for (;
|
|
2171
|
-
|
|
2172
|
-
for (;
|
|
2173
|
-
|
|
2174
|
-
return Ue(
|
|
2203
|
+
let F = Ue(JSON.stringify(A.regions)) + Ue(A.visibleText) + Ue(JSON.stringify(A.visibleLinks)) + Ue(JSON.stringify(A.visibleFields));
|
|
2204
|
+
for (; F > wt && A.visibleFields.length > 0; )
|
|
2205
|
+
A.visibleFields.pop(), F = Ue(JSON.stringify(A.visibleFields));
|
|
2206
|
+
for (; F > wt && A.visibleLinks.length > 0; )
|
|
2207
|
+
A.visibleLinks.pop(), F -= 80;
|
|
2208
|
+
return Ue(A.visibleText) > wt && (A.visibleText = we(A.visibleText, wt - 100)), A;
|
|
2175
2209
|
}
|
|
2176
2210
|
let je = null;
|
|
2177
|
-
function
|
|
2211
|
+
function gn(e, t = {}) {
|
|
2178
2212
|
const r = Date.now(), i = `${typeof window < "u" && window.location.pathname || "/"}::${typeof window < "u" ? window.scrollY : 0}`;
|
|
2179
2213
|
if (je && je.key === i && r - je.at < 1e3)
|
|
2180
2214
|
return je.ctx;
|
|
2181
|
-
const l =
|
|
2215
|
+
const l = Kr(e, t);
|
|
2182
2216
|
return je = { key: i, at: r, ctx: l }, l;
|
|
2183
2217
|
}
|
|
2184
|
-
function
|
|
2218
|
+
function Xr() {
|
|
2185
2219
|
je = null;
|
|
2186
2220
|
}
|
|
2187
|
-
const
|
|
2188
|
-
function
|
|
2221
|
+
const Qr = 200;
|
|
2222
|
+
function Zr(e) {
|
|
2189
2223
|
const t = String(e.href || "");
|
|
2190
2224
|
return {
|
|
2191
2225
|
href: t,
|
|
@@ -2195,63 +2229,100 @@ function jr(e) {
|
|
|
2195
2229
|
description: e.description
|
|
2196
2230
|
};
|
|
2197
2231
|
}
|
|
2198
|
-
function
|
|
2232
|
+
function eo(e) {
|
|
2199
2233
|
return !(!e || e.startsWith("#") || e.startsWith("javascript:") || e.startsWith("mailto:") || e.startsWith("tel:"));
|
|
2200
2234
|
}
|
|
2201
|
-
function
|
|
2235
|
+
function to(e) {
|
|
2202
2236
|
const t = e ?? (typeof document < "u" ? document : null);
|
|
2203
2237
|
if (!t) return [];
|
|
2204
2238
|
const r = typeof window < "u" && window.location.origin || "", o = /* @__PURE__ */ new Set(), i = [], l = Array.from(t.querySelectorAll("a[href]"));
|
|
2205
|
-
for (const
|
|
2206
|
-
if (i.length >=
|
|
2207
|
-
if (
|
|
2208
|
-
const a =
|
|
2209
|
-
if (!
|
|
2210
|
-
let s = a,
|
|
2239
|
+
for (const c of l) {
|
|
2240
|
+
if (i.length >= Qr) break;
|
|
2241
|
+
if ($t(c)) continue;
|
|
2242
|
+
const a = c.getAttribute("href") || "";
|
|
2243
|
+
if (!eo(a)) continue;
|
|
2244
|
+
let s = a, p = !0;
|
|
2211
2245
|
try {
|
|
2212
2246
|
if (typeof window < "u") {
|
|
2213
2247
|
const f = new URL(a, r);
|
|
2214
|
-
|
|
2248
|
+
p = f.origin === r, p && a.startsWith("http") && (s = f.pathname + f.search + f.hash);
|
|
2215
2249
|
}
|
|
2216
2250
|
} catch {
|
|
2217
2251
|
continue;
|
|
2218
2252
|
}
|
|
2219
2253
|
if (o.has(s)) continue;
|
|
2220
2254
|
o.add(s);
|
|
2221
|
-
const
|
|
2222
|
-
i.push({ href: s, text:
|
|
2255
|
+
const v = (c.textContent || "").trim().slice(0, 120);
|
|
2256
|
+
i.push({ href: s, text: v, internal: p });
|
|
2223
2257
|
}
|
|
2224
2258
|
return i;
|
|
2225
2259
|
}
|
|
2226
2260
|
let Ve = null;
|
|
2227
|
-
const
|
|
2228
|
-
function
|
|
2261
|
+
const no = 5e3;
|
|
2262
|
+
function Mt() {
|
|
2229
2263
|
const e = Date.now(), t = typeof window < "u" && window.location.pathname || "/";
|
|
2230
|
-
if (Ve && Ve.pathname === t && e - Ve.at <
|
|
2264
|
+
if (Ve && Ve.pathname === t && e - Ve.at < no)
|
|
2231
2265
|
return Ve.routes;
|
|
2232
|
-
const r =
|
|
2266
|
+
const r = to();
|
|
2233
2267
|
return Ve = { at: e, pathname: t, routes: r }, r;
|
|
2234
2268
|
}
|
|
2235
|
-
function
|
|
2269
|
+
function ro() {
|
|
2236
2270
|
Ve = null;
|
|
2237
2271
|
}
|
|
2238
|
-
function
|
|
2272
|
+
function oo(e, t) {
|
|
2239
2273
|
const r = e instanceof HTMLInputElement ? HTMLInputElement.prototype : e instanceof HTMLTextAreaElement ? HTMLTextAreaElement.prototype : HTMLSelectElement.prototype, o = Object.getOwnPropertyDescriptor(r, "value"), i = o == null ? void 0 : o.set;
|
|
2240
2274
|
i ? i.call(e, t) : e.value = t;
|
|
2241
2275
|
}
|
|
2242
|
-
function
|
|
2276
|
+
function io(e, t, r = {}) {
|
|
2243
2277
|
const o = r.triggerInput ?? !0, i = r.triggerChange ?? !0;
|
|
2244
2278
|
if (e instanceof HTMLInputElement && (e.type === "checkbox" || e.type === "radio")) {
|
|
2245
2279
|
const l = Object.getOwnPropertyDescriptor(
|
|
2246
2280
|
HTMLInputElement.prototype,
|
|
2247
2281
|
"checked"
|
|
2248
|
-
),
|
|
2249
|
-
|
|
2282
|
+
), c = l == null ? void 0 : l.set, a = t === "true" || t === "1" || t === "on";
|
|
2283
|
+
c ? c.call(e, a) : e.checked = a, o && e.dispatchEvent(new Event("input", { bubbles: !0 })), i && e.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
2250
2284
|
return;
|
|
2251
2285
|
}
|
|
2252
|
-
|
|
2286
|
+
oo(e, t), o && e.dispatchEvent(new Event("input", { bubbles: !0 })), i && e.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
2253
2287
|
}
|
|
2254
|
-
function
|
|
2288
|
+
function yn(e, t) {
|
|
2289
|
+
if (!t) return null;
|
|
2290
|
+
const r = t.replace(/"/g, '\\"');
|
|
2291
|
+
try {
|
|
2292
|
+
const c = e.querySelector(
|
|
2293
|
+
`form#${CSS.escape(t)}`
|
|
2294
|
+
);
|
|
2295
|
+
if (c) return c;
|
|
2296
|
+
} catch {
|
|
2297
|
+
}
|
|
2298
|
+
const o = e.querySelector(
|
|
2299
|
+
`form[name="${r}"]`
|
|
2300
|
+
);
|
|
2301
|
+
if (o) return o;
|
|
2302
|
+
const i = e.querySelector(
|
|
2303
|
+
`form[data-ll-intent="${r}"]`
|
|
2304
|
+
);
|
|
2305
|
+
if (i) return i;
|
|
2306
|
+
const l = Array.from(e.querySelectorAll("form"));
|
|
2307
|
+
for (const c of l) {
|
|
2308
|
+
const a = c.getAttribute("data-ll-intent");
|
|
2309
|
+
if (a && lo(a) === t) return c;
|
|
2310
|
+
}
|
|
2311
|
+
if (/^form_\d+$/.test(t)) {
|
|
2312
|
+
const c = parseInt(t.slice(5), 10);
|
|
2313
|
+
let a = 0;
|
|
2314
|
+
for (const s of l)
|
|
2315
|
+
if (!(s.id || s.getAttribute("name") || s.getAttribute("data-ll-intent"))) {
|
|
2316
|
+
if (a === c) return s;
|
|
2317
|
+
a++;
|
|
2318
|
+
}
|
|
2319
|
+
}
|
|
2320
|
+
return null;
|
|
2321
|
+
}
|
|
2322
|
+
function lo(e) {
|
|
2323
|
+
return e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60) || null;
|
|
2324
|
+
}
|
|
2325
|
+
function ao() {
|
|
2255
2326
|
if (typeof window > "u" || typeof document > "u")
|
|
2256
2327
|
return !1;
|
|
2257
2328
|
const e = document.scrollingElement || document.documentElement;
|
|
@@ -2259,19 +2330,19 @@ function Qr() {
|
|
|
2259
2330
|
const t = window.getComputedStyle(e);
|
|
2260
2331
|
return !(t.overflowY === "hidden" || t.overflowY === "clip");
|
|
2261
2332
|
}
|
|
2262
|
-
function
|
|
2333
|
+
function co(e) {
|
|
2263
2334
|
if (!(e instanceof HTMLElement)) return !1;
|
|
2264
2335
|
const r = window.getComputedStyle(e).overflowY;
|
|
2265
2336
|
return !(r !== "auto" && r !== "scroll" || e.scrollHeight <= e.clientHeight + 2);
|
|
2266
2337
|
}
|
|
2267
|
-
function
|
|
2338
|
+
function so() {
|
|
2268
2339
|
if (typeof document > "u") return null;
|
|
2269
2340
|
const e = Array.from(
|
|
2270
2341
|
document.querySelectorAll("body, body *")
|
|
2271
2342
|
);
|
|
2272
2343
|
let t = null, r = 0;
|
|
2273
2344
|
for (const o of e) {
|
|
2274
|
-
if (!
|
|
2345
|
+
if (!co(o)) continue;
|
|
2275
2346
|
const i = o.getBoundingClientRect();
|
|
2276
2347
|
if (i.bottom <= 0 || i.top >= window.innerHeight || i.right <= 0 || i.left >= window.innerWidth || i.width <= 0 || i.height <= 0 || o.closest(".ll-widget")) continue;
|
|
2277
2348
|
const l = i.width * i.height;
|
|
@@ -2279,24 +2350,24 @@ function eo() {
|
|
|
2279
2350
|
}
|
|
2280
2351
|
return t;
|
|
2281
2352
|
}
|
|
2282
|
-
function
|
|
2353
|
+
function uo() {
|
|
2283
2354
|
if (typeof window > "u")
|
|
2284
2355
|
return null;
|
|
2285
|
-
if (
|
|
2286
|
-
const e =
|
|
2356
|
+
if (ao()) return window;
|
|
2357
|
+
const e = so();
|
|
2287
2358
|
return e || window;
|
|
2288
2359
|
}
|
|
2289
|
-
function
|
|
2360
|
+
function vn(e) {
|
|
2290
2361
|
return e instanceof Window ? e.innerHeight || 0 : e.clientHeight || 0;
|
|
2291
2362
|
}
|
|
2292
|
-
function
|
|
2363
|
+
function fo(e) {
|
|
2293
2364
|
var t, r;
|
|
2294
2365
|
return e instanceof Window ? typeof document > "u" ? 0 : Math.max(
|
|
2295
2366
|
((t = document.body) == null ? void 0 : t.scrollHeight) ?? 0,
|
|
2296
2367
|
((r = document.documentElement) == null ? void 0 : r.scrollHeight) ?? 0
|
|
2297
2368
|
) : e.scrollHeight - e.clientHeight;
|
|
2298
2369
|
}
|
|
2299
|
-
const
|
|
2370
|
+
const po = /* @__PURE__ */ new Set([
|
|
2300
2371
|
"agent_state",
|
|
2301
2372
|
"avatar_stream_ready",
|
|
2302
2373
|
"avatar_active",
|
|
@@ -2317,156 +2388,166 @@ const ro = /* @__PURE__ */ new Set([
|
|
|
2317
2388
|
"fill_form",
|
|
2318
2389
|
"focus_field",
|
|
2319
2390
|
"submit_form",
|
|
2320
|
-
"request_routes"
|
|
2321
|
-
|
|
2391
|
+
"request_routes",
|
|
2392
|
+
// 0.12.0 — structured collection (unified API).
|
|
2393
|
+
// Both `task_field_updated` and `task_completed` data-channel commands
|
|
2394
|
+
// fan out into a single document-level `ll-collected` CustomEvent
|
|
2395
|
+
// (discriminated on phase) that `useCollect()` listens for, plus
|
|
2396
|
+
// `onCollect` on AvatarWidget for one-shot delivery. Not bubbled
|
|
2397
|
+
// to onAgentCommand.
|
|
2398
|
+
"task_field_updated",
|
|
2399
|
+
"task_completed"
|
|
2400
|
+
]), Nn = Dt(
|
|
2322
2401
|
function(t, r) {
|
|
2323
|
-
var
|
|
2402
|
+
var Yt, Gt, Jt, Kt, Xt, Qt, Zt;
|
|
2324
2403
|
const {
|
|
2325
2404
|
agentId: o,
|
|
2326
2405
|
apiKey: i,
|
|
2327
2406
|
baseUrl: l = "https://app.livelayer.studio",
|
|
2328
|
-
sessionEndpoint:
|
|
2407
|
+
sessionEndpoint: c,
|
|
2329
2408
|
sessionBody: a,
|
|
2330
2409
|
soundEffects: s,
|
|
2331
|
-
experienceMode:
|
|
2332
|
-
autoConnect:
|
|
2410
|
+
experienceMode: p = "WIDGET",
|
|
2411
|
+
autoConnect: v = !1,
|
|
2333
2412
|
displayMode: f,
|
|
2334
|
-
defaultDisplayMode:
|
|
2335
|
-
onDisplayModeChange:
|
|
2336
|
-
position:
|
|
2413
|
+
defaultDisplayMode: u = "expanded",
|
|
2414
|
+
onDisplayModeChange: I,
|
|
2415
|
+
position: L = "bottom-right",
|
|
2337
2416
|
mobileBreakpoint: _ = 640,
|
|
2338
|
-
persistKey:
|
|
2417
|
+
persistKey: h = "ll-widget",
|
|
2339
2418
|
disablePersistence: b = !1,
|
|
2340
2419
|
teamMembers: S,
|
|
2341
|
-
currentTeamMemberId:
|
|
2342
|
-
onTeamMemberChange:
|
|
2343
|
-
idleLoopUrl:
|
|
2344
|
-
greeting:
|
|
2345
|
-
avatarImageUrl:
|
|
2346
|
-
agentName:
|
|
2347
|
-
branding:
|
|
2348
|
-
allowCamera:
|
|
2349
|
-
allowScreenShare:
|
|
2350
|
-
allowTyping:
|
|
2351
|
-
showMinimize:
|
|
2352
|
-
showClose:
|
|
2353
|
-
chromeless:
|
|
2354
|
-
floatingChromeContainer:
|
|
2355
|
-
compactControls:
|
|
2356
|
-
transforming:
|
|
2420
|
+
currentTeamMemberId: T,
|
|
2421
|
+
onTeamMemberChange: A,
|
|
2422
|
+
idleLoopUrl: F,
|
|
2423
|
+
greeting: g,
|
|
2424
|
+
avatarImageUrl: P,
|
|
2425
|
+
agentName: H,
|
|
2426
|
+
branding: q = {},
|
|
2427
|
+
allowCamera: Z = !0,
|
|
2428
|
+
allowScreenShare: M = !0,
|
|
2429
|
+
allowTyping: U = !0,
|
|
2430
|
+
showMinimize: B,
|
|
2431
|
+
showClose: J,
|
|
2432
|
+
chromeless: oe = !1,
|
|
2433
|
+
floatingChromeContainer: _e = null,
|
|
2434
|
+
compactControls: K = !1,
|
|
2435
|
+
transforming: xe = !1,
|
|
2357
2436
|
transformingLabel: ye = "Transforming…",
|
|
2358
|
-
showOn:
|
|
2359
|
-
hideOn:
|
|
2360
|
-
pathname:
|
|
2361
|
-
onNavigate:
|
|
2437
|
+
showOn: ke,
|
|
2438
|
+
hideOn: ve,
|
|
2439
|
+
pathname: ie,
|
|
2440
|
+
onNavigate: dt,
|
|
2362
2441
|
onScrollToSelector: Je,
|
|
2363
|
-
getPageContext:
|
|
2364
|
-
pageContextExtras:
|
|
2442
|
+
getPageContext: ut,
|
|
2443
|
+
pageContextExtras: ce,
|
|
2365
2444
|
getRoutes: Ke,
|
|
2366
2445
|
onScrollPage: Xe,
|
|
2367
|
-
onClick:
|
|
2446
|
+
onClick: ft,
|
|
2368
2447
|
capabilities: Qe,
|
|
2369
|
-
onConnect:
|
|
2370
|
-
onDisconnect:
|
|
2371
|
-
onTranscript:
|
|
2372
|
-
onAgentState:
|
|
2373
|
-
onConnectionStateChange:
|
|
2374
|
-
onAgentEvent:
|
|
2448
|
+
onConnect: Se,
|
|
2449
|
+
onDisconnect: Pe,
|
|
2450
|
+
onTranscript: Ne,
|
|
2451
|
+
onAgentState: $e,
|
|
2452
|
+
onConnectionStateChange: Ae,
|
|
2453
|
+
onAgentEvent: Ie,
|
|
2375
2454
|
onAgentCommand: Re,
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2455
|
+
onCollect: Me,
|
|
2456
|
+
controlledSession: $,
|
|
2457
|
+
className: kt,
|
|
2458
|
+
style: Te,
|
|
2459
|
+
zIndex: ze = 2147483647
|
|
2460
|
+
} = t, se = hr(ie), Ze = _r(se, ke, ve);
|
|
2461
|
+
R(() => {
|
|
2462
|
+
Xr(), ro();
|
|
2463
|
+
}, [se]);
|
|
2464
|
+
const De = T !== void 0, [Oe, Lt] = E(() => {
|
|
2465
|
+
var y;
|
|
2466
|
+
return T ?? ((y = S == null ? void 0 : S[0]) == null ? void 0 : y.id);
|
|
2467
|
+
}), Le = De ? T : Oe, ee = Ge(
|
|
2468
|
+
() => (S == null ? void 0 : S.find((y) => y.id === Le)) ?? null,
|
|
2469
|
+
[S, Le]
|
|
2470
|
+
), et = (ee == null ? void 0 : ee.agentId) ?? o, ue = p === "EMBEDDED", [He, Be] = dr({
|
|
2391
2471
|
value: f,
|
|
2392
|
-
defaultValue:
|
|
2393
|
-
onChange:
|
|
2394
|
-
persistKey:
|
|
2395
|
-
disablePersistence:
|
|
2396
|
-
}),
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2472
|
+
defaultValue: u,
|
|
2473
|
+
onChange: I,
|
|
2474
|
+
persistKey: h,
|
|
2475
|
+
disablePersistence: ue || b
|
|
2476
|
+
}), te = ue ? "expanded" : He, le = ue ? () => {
|
|
2477
|
+
} : Be, pt = B ?? !ue, ht = J ?? !ue, Ce = fr(_), tt = Qn(), re = Zn(), ae = tr(), Ee = nr(), nt = rr(), [Ct, fe] = E(!1), [pe, rt] = E(!1), [We, ot] = E(!1), [mt, m] = E(!1), [Y, An] = E(!1), gt = kr({ baseUrl: l, config: s }), yt = N(gt);
|
|
2478
|
+
yt.current = gt;
|
|
2479
|
+
const Et = N(dt), St = N(Je), Nt = N(Xe), At = N(ft), zt = N(ut), Ot = N(ce), Ht = N(Ke), It = N(Qe), he = N(null);
|
|
2480
|
+
Et.current = dt, St.current = Je, Nt.current = Xe, At.current = ft, zt.current = ut, Ot.current = ce, Ht.current = Ke, It.current = Qe;
|
|
2481
|
+
function me(y) {
|
|
2482
|
+
const d = It.current;
|
|
2483
|
+
return d ? d.includes(y) : !0;
|
|
2403
2484
|
}
|
|
2404
|
-
function
|
|
2485
|
+
function ge(y, d) {
|
|
2405
2486
|
console.warn(
|
|
2406
|
-
`[LiveLayer] Agent command "${
|
|
2487
|
+
`[LiveLayer] Agent command "${y}" blocked — capability "${d}" not in allowlist. See https://livelayer.studio/docs/react/capabilities`
|
|
2407
2488
|
);
|
|
2408
2489
|
}
|
|
2409
|
-
const
|
|
2410
|
-
(
|
|
2411
|
-
var
|
|
2412
|
-
const
|
|
2413
|
-
if (!(!
|
|
2414
|
-
if (
|
|
2415
|
-
if (!
|
|
2416
|
-
|
|
2490
|
+
const it = C(
|
|
2491
|
+
(y) => {
|
|
2492
|
+
var G, de, be, at;
|
|
2493
|
+
const d = y;
|
|
2494
|
+
if (!(!d.type || typeof d.type != "string")) {
|
|
2495
|
+
if (Ie == null || Ie({ eventName: d.type, data: y }), d.type === "navigate") {
|
|
2496
|
+
if (!me("navigate")) {
|
|
2497
|
+
ge("navigate", "navigate");
|
|
2417
2498
|
return;
|
|
2418
2499
|
}
|
|
2419
|
-
const
|
|
2420
|
-
if (!
|
|
2500
|
+
const x = typeof d.href == "string" ? d.href : null;
|
|
2501
|
+
if (!x) {
|
|
2421
2502
|
console.warn(
|
|
2422
2503
|
`[LiveLayer] Agent emitted "navigate" without href. Skipping. Check your agent's tool schema. See https://livelayer.studio/docs/errors/navigate-missing-href`
|
|
2423
2504
|
);
|
|
2424
2505
|
return;
|
|
2425
2506
|
}
|
|
2426
|
-
if (
|
|
2507
|
+
if (yt.current.playPageChange(), Et.current) {
|
|
2427
2508
|
try {
|
|
2428
|
-
|
|
2429
|
-
} catch (
|
|
2509
|
+
Et.current(x);
|
|
2510
|
+
} catch (D) {
|
|
2430
2511
|
console.warn(
|
|
2431
|
-
`[LiveLayer] onNavigate threw for "${
|
|
2432
|
-
|
|
2512
|
+
`[LiveLayer] onNavigate threw for "${x}". Falling back. Error:`,
|
|
2513
|
+
D
|
|
2433
2514
|
);
|
|
2434
2515
|
}
|
|
2435
2516
|
return;
|
|
2436
2517
|
}
|
|
2437
2518
|
if (typeof document < "u") {
|
|
2438
|
-
const
|
|
2439
|
-
`a[href="${
|
|
2519
|
+
const D = document.querySelector(
|
|
2520
|
+
`a[href="${x.replace(/"/g, '\\"')}"]`
|
|
2440
2521
|
);
|
|
2441
|
-
if (
|
|
2442
|
-
|
|
2522
|
+
if (D) {
|
|
2523
|
+
D.click();
|
|
2443
2524
|
return;
|
|
2444
2525
|
}
|
|
2445
2526
|
}
|
|
2446
2527
|
if (typeof window < "u" && typeof history < "u")
|
|
2447
2528
|
try {
|
|
2448
|
-
history.pushState({}, "",
|
|
2449
|
-
} catch (
|
|
2529
|
+
history.pushState({}, "", x), window.dispatchEvent(new PopStateEvent("popstate"));
|
|
2530
|
+
} catch (D) {
|
|
2450
2531
|
console.warn(
|
|
2451
|
-
`[LiveLayer] history.pushState fallback failed for "${
|
|
2452
|
-
|
|
2532
|
+
`[LiveLayer] history.pushState fallback failed for "${x}". Pass an onNavigate prop to use your router directly. See https://livelayer.studio/docs/react/navigation`,
|
|
2533
|
+
D
|
|
2453
2534
|
);
|
|
2454
2535
|
}
|
|
2455
2536
|
return;
|
|
2456
2537
|
}
|
|
2457
|
-
if (
|
|
2458
|
-
if (!
|
|
2459
|
-
|
|
2538
|
+
if (d.type === "scroll_to") {
|
|
2539
|
+
if (!me("scroll")) {
|
|
2540
|
+
ge("scroll_to", "scroll");
|
|
2460
2541
|
return;
|
|
2461
2542
|
}
|
|
2462
|
-
const
|
|
2463
|
-
if (!
|
|
2464
|
-
const
|
|
2465
|
-
if (
|
|
2543
|
+
const x = typeof d.selector == "string" ? d.selector : null;
|
|
2544
|
+
if (!x) return;
|
|
2545
|
+
const D = d.behavior === "instant" ? "instant" : "smooth";
|
|
2546
|
+
if (St.current) {
|
|
2466
2547
|
try {
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2548
|
+
St.current(
|
|
2549
|
+
x,
|
|
2550
|
+
D
|
|
2470
2551
|
);
|
|
2471
2552
|
} catch (W) {
|
|
2472
2553
|
console.warn("[LiveLayer] onScrollToSelector threw.", W);
|
|
@@ -2476,701 +2557,751 @@ const ro = /* @__PURE__ */ new Set([
|
|
|
2476
2557
|
if (typeof document < "u") {
|
|
2477
2558
|
let W = null;
|
|
2478
2559
|
try {
|
|
2479
|
-
W = document.querySelector(
|
|
2560
|
+
W = document.querySelector(x);
|
|
2480
2561
|
} catch {
|
|
2481
2562
|
console.warn(
|
|
2482
|
-
`[LiveLayer] scroll_to: invalid selector "${
|
|
2563
|
+
`[LiveLayer] scroll_to: invalid selector "${x}".`
|
|
2483
2564
|
);
|
|
2484
2565
|
return;
|
|
2485
2566
|
}
|
|
2486
2567
|
if (!W) {
|
|
2487
2568
|
console.warn(
|
|
2488
|
-
`[LiveLayer] scroll_to: no element matched "${
|
|
2569
|
+
`[LiveLayer] scroll_to: no element matched "${x}". The user may be on a different page. See https://livelayer.studio/docs/errors/scroll-no-match`
|
|
2489
2570
|
);
|
|
2490
2571
|
return;
|
|
2491
2572
|
}
|
|
2492
2573
|
W.scrollIntoView({
|
|
2493
|
-
behavior:
|
|
2574
|
+
behavior: D,
|
|
2494
2575
|
block: "start"
|
|
2495
2576
|
});
|
|
2496
2577
|
}
|
|
2497
2578
|
return;
|
|
2498
2579
|
}
|
|
2499
|
-
if (
|
|
2500
|
-
if (!
|
|
2501
|
-
|
|
2580
|
+
if (d.type === "request_page_context") {
|
|
2581
|
+
if (!me("read_page")) {
|
|
2582
|
+
ge("request_page_context", "read_page");
|
|
2502
2583
|
return;
|
|
2503
2584
|
}
|
|
2504
|
-
const
|
|
2505
|
-
const
|
|
2506
|
-
if (
|
|
2585
|
+
const x = typeof d.requestId == "string" ? d.requestId : void 0, D = (G = he.current) == null ? void 0 : G.call(he), W = (V) => {
|
|
2586
|
+
const z = D, Q = z == null ? void 0 : z.localParticipant;
|
|
2587
|
+
if (Q != null && Q.publishData)
|
|
2507
2588
|
try {
|
|
2508
|
-
const
|
|
2509
|
-
|
|
2510
|
-
} catch (
|
|
2511
|
-
console.warn("[LiveLayer] publishData failed.",
|
|
2589
|
+
const ne = x ? { ...V, requestId: x } : V, Fe = new TextEncoder().encode(JSON.stringify(ne));
|
|
2590
|
+
Q.publishData(Fe, { reliable: !0 });
|
|
2591
|
+
} catch (ne) {
|
|
2592
|
+
console.warn("[LiveLayer] publishData failed.", ne);
|
|
2512
2593
|
}
|
|
2513
|
-
},
|
|
2594
|
+
}, O = Ot.current, j = zt.current;
|
|
2514
2595
|
try {
|
|
2515
|
-
if (
|
|
2516
|
-
const
|
|
2517
|
-
if (
|
|
2518
|
-
W({ type: "page_context_pending" }),
|
|
2596
|
+
if (j) {
|
|
2597
|
+
const V = j(O);
|
|
2598
|
+
if (V instanceof Promise) {
|
|
2599
|
+
W({ type: "page_context_pending" }), V.then((z) => W({ type: "page_context", context: z })).catch((z) => {
|
|
2519
2600
|
console.warn(
|
|
2520
2601
|
"[LiveLayer] getPageContext rejected; falling back to default walker.",
|
|
2521
|
-
|
|
2602
|
+
z
|
|
2522
2603
|
), W({
|
|
2523
2604
|
type: "page_context",
|
|
2524
|
-
context:
|
|
2605
|
+
context: gn(O)
|
|
2525
2606
|
});
|
|
2526
2607
|
});
|
|
2527
2608
|
return;
|
|
2528
2609
|
}
|
|
2529
|
-
W({ type: "page_context", context:
|
|
2610
|
+
W({ type: "page_context", context: V });
|
|
2530
2611
|
return;
|
|
2531
2612
|
}
|
|
2532
2613
|
W({
|
|
2533
2614
|
type: "page_context",
|
|
2534
|
-
context:
|
|
2615
|
+
context: gn(O)
|
|
2535
2616
|
});
|
|
2536
|
-
} catch (
|
|
2617
|
+
} catch (V) {
|
|
2537
2618
|
console.warn(
|
|
2538
2619
|
"[LiveLayer] page-context extraction threw. Sending empty context.",
|
|
2539
|
-
|
|
2620
|
+
V
|
|
2540
2621
|
), W({
|
|
2541
2622
|
type: "page_context",
|
|
2542
|
-
context: { url: "", title: "", pathname: "/", regions: [], visibleText: "", visibleLinks: [], visibleFields: [], forms: [], extras:
|
|
2623
|
+
context: { url: "", title: "", pathname: "/", regions: [], visibleText: "", visibleLinks: [], visibleFields: [], forms: [], extras: O }
|
|
2543
2624
|
});
|
|
2544
2625
|
}
|
|
2545
2626
|
return;
|
|
2546
2627
|
}
|
|
2547
|
-
if (
|
|
2548
|
-
if (!
|
|
2549
|
-
|
|
2628
|
+
if (d.type === "scroll_page") {
|
|
2629
|
+
if (!me("scroll")) {
|
|
2630
|
+
ge("scroll_page", "scroll");
|
|
2550
2631
|
return;
|
|
2551
2632
|
}
|
|
2552
|
-
const
|
|
2553
|
-
if (
|
|
2633
|
+
const x = d.direction;
|
|
2634
|
+
if (x !== "up" && x !== "down" && x !== "top" && x !== "bottom") {
|
|
2554
2635
|
console.warn(
|
|
2555
|
-
`[LiveLayer] scroll_page: invalid direction "${String(
|
|
2636
|
+
`[LiveLayer] scroll_page: invalid direction "${String(x)}". Expected up | down | top | bottom.`
|
|
2556
2637
|
);
|
|
2557
2638
|
return;
|
|
2558
2639
|
}
|
|
2559
|
-
const
|
|
2560
|
-
if (
|
|
2640
|
+
const D = d.behavior === "instant" ? "instant" : "smooth";
|
|
2641
|
+
if (Nt.current) {
|
|
2561
2642
|
try {
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2643
|
+
Nt.current(
|
|
2644
|
+
x,
|
|
2645
|
+
D
|
|
2565
2646
|
);
|
|
2566
|
-
} catch (
|
|
2567
|
-
console.warn("[LiveLayer] onScrollPage threw.",
|
|
2647
|
+
} catch (z) {
|
|
2648
|
+
console.warn("[LiveLayer] onScrollPage threw.", z);
|
|
2568
2649
|
}
|
|
2569
2650
|
return;
|
|
2570
2651
|
}
|
|
2571
2652
|
if (typeof window > "u") return;
|
|
2572
|
-
const W = { behavior:
|
|
2573
|
-
|
|
2574
|
-
},
|
|
2575
|
-
|
|
2653
|
+
const W = { behavior: D }, O = uo(), j = (z) => {
|
|
2654
|
+
O instanceof Window ? O.scrollBy({ top: z, ...W }) : O.scrollBy({ top: z, ...W });
|
|
2655
|
+
}, V = (z) => {
|
|
2656
|
+
O instanceof Window ? O.scrollTo({ top: z, ...W }) : O.scrollTo({ top: z, ...W });
|
|
2576
2657
|
};
|
|
2577
|
-
|
|
2658
|
+
x === "up" ? j(-vn(O)) : x === "down" ? j(vn(O)) : V(x === "top" ? 0 : fo(O));
|
|
2578
2659
|
return;
|
|
2579
2660
|
}
|
|
2580
|
-
if (
|
|
2581
|
-
if (!
|
|
2582
|
-
|
|
2661
|
+
if (d.type === "click") {
|
|
2662
|
+
if (!me("click")) {
|
|
2663
|
+
ge("click", "click");
|
|
2583
2664
|
return;
|
|
2584
2665
|
}
|
|
2585
|
-
const
|
|
2586
|
-
if (!
|
|
2666
|
+
const x = typeof d.selector == "string" ? d.selector : null;
|
|
2667
|
+
if (!x) {
|
|
2587
2668
|
console.warn("[LiveLayer] click: missing selector.");
|
|
2588
2669
|
return;
|
|
2589
2670
|
}
|
|
2590
|
-
if (
|
|
2671
|
+
if (At.current) {
|
|
2591
2672
|
try {
|
|
2592
|
-
|
|
2673
|
+
At.current(x);
|
|
2593
2674
|
} catch (W) {
|
|
2594
2675
|
console.warn("[LiveLayer] onClick threw.", W);
|
|
2595
2676
|
}
|
|
2596
2677
|
return;
|
|
2597
2678
|
}
|
|
2598
2679
|
if (typeof document > "u") return;
|
|
2599
|
-
let
|
|
2680
|
+
let D = null;
|
|
2600
2681
|
try {
|
|
2601
|
-
|
|
2682
|
+
D = document.querySelector(x);
|
|
2602
2683
|
} catch {
|
|
2603
2684
|
console.warn(
|
|
2604
|
-
`[LiveLayer] click: invalid selector "${
|
|
2685
|
+
`[LiveLayer] click: invalid selector "${x}".`
|
|
2605
2686
|
);
|
|
2606
2687
|
return;
|
|
2607
2688
|
}
|
|
2608
|
-
if (!
|
|
2689
|
+
if (!D) {
|
|
2609
2690
|
console.warn(
|
|
2610
|
-
`[LiveLayer] click: no element matched "${
|
|
2691
|
+
`[LiveLayer] click: no element matched "${x}". See https://livelayer.studio/docs/errors/click-no-match`
|
|
2611
2692
|
);
|
|
2612
2693
|
return;
|
|
2613
2694
|
}
|
|
2614
|
-
if (
|
|
2695
|
+
if (D.closest('[data-ll-private="true"], .ll-widget')) {
|
|
2615
2696
|
console.warn(
|
|
2616
2697
|
"[LiveLayer] click: refusing to click element inside a private subtree."
|
|
2617
2698
|
);
|
|
2618
2699
|
return;
|
|
2619
2700
|
}
|
|
2620
|
-
(
|
|
2701
|
+
(de = D.click) == null || de.call(D);
|
|
2621
2702
|
return;
|
|
2622
2703
|
}
|
|
2623
|
-
if (
|
|
2624
|
-
if (!
|
|
2625
|
-
|
|
2704
|
+
if (d.type === "fill_form" || d.type === "focus_field") {
|
|
2705
|
+
if (!me("fill_forms")) {
|
|
2706
|
+
ge(d.type, "fill_forms");
|
|
2626
2707
|
return;
|
|
2627
2708
|
}
|
|
2628
2709
|
if (typeof document > "u") return;
|
|
2629
|
-
|
|
2630
|
-
const
|
|
2631
|
-
if (!
|
|
2632
|
-
console.warn(`[LiveLayer] ${
|
|
2710
|
+
d.type === "fill_form" && yt.current.playConfirmation();
|
|
2711
|
+
const x = typeof d.formId == "string" ? d.formId : null;
|
|
2712
|
+
if (!x) {
|
|
2713
|
+
console.warn(`[LiveLayer] ${d.type}: missing formId.`);
|
|
2633
2714
|
return;
|
|
2634
2715
|
}
|
|
2635
|
-
const
|
|
2636
|
-
|
|
2637
|
-
);
|
|
2638
|
-
if (!T) {
|
|
2716
|
+
const D = yn(document, x);
|
|
2717
|
+
if (!D) {
|
|
2639
2718
|
console.warn(
|
|
2640
|
-
`[LiveLayer] ${
|
|
2719
|
+
`[LiveLayer] ${d.type}: no <form> matched id="${x}" (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.`
|
|
2641
2720
|
);
|
|
2642
2721
|
return;
|
|
2643
2722
|
}
|
|
2644
|
-
if (
|
|
2723
|
+
if (D.closest('[data-ll-private="true"], [data-ll-skip], .ll-widget')) {
|
|
2645
2724
|
console.warn(
|
|
2646
|
-
`[LiveLayer] ${
|
|
2725
|
+
`[LiveLayer] ${d.type}: refusing to touch a form in a private / opted-out subtree.`
|
|
2647
2726
|
);
|
|
2648
2727
|
return;
|
|
2649
2728
|
}
|
|
2650
|
-
if (
|
|
2651
|
-
const
|
|
2652
|
-
if (!
|
|
2729
|
+
if (d.type === "focus_field") {
|
|
2730
|
+
const O = typeof d.fieldName == "string" ? d.fieldName : null;
|
|
2731
|
+
if (!O) {
|
|
2653
2732
|
console.warn("[LiveLayer] focus_field: missing fieldName.");
|
|
2654
2733
|
return;
|
|
2655
2734
|
}
|
|
2656
|
-
const
|
|
2657
|
-
if (!
|
|
2735
|
+
const j = D.querySelector(`[name="${O.replace(/"/g, '\\"')}"]`);
|
|
2736
|
+
if (!j) {
|
|
2658
2737
|
console.warn(
|
|
2659
|
-
`[LiveLayer] focus_field: no
|
|
2738
|
+
`[LiveLayer] focus_field: no input with name="${O}" in form "${x}".`
|
|
2660
2739
|
);
|
|
2661
2740
|
return;
|
|
2662
2741
|
}
|
|
2663
|
-
if (!xt(
|
|
2742
|
+
if (!xt(j)) {
|
|
2664
2743
|
console.warn(
|
|
2665
|
-
`[LiveLayer] focus_field: field "${
|
|
2744
|
+
`[LiveLayer] focus_field: field "${O}" is privacy-protected and not focusable.`
|
|
2666
2745
|
);
|
|
2667
2746
|
return;
|
|
2668
2747
|
}
|
|
2669
|
-
|
|
2748
|
+
j.focus();
|
|
2670
2749
|
return;
|
|
2671
2750
|
}
|
|
2672
|
-
const W =
|
|
2751
|
+
const W = d.values && typeof d.values == "object" ? d.values : null;
|
|
2673
2752
|
if (!W) {
|
|
2674
2753
|
console.warn("[LiveLayer] fill_form: missing or invalid values.");
|
|
2675
2754
|
return;
|
|
2676
2755
|
}
|
|
2677
|
-
for (const [
|
|
2678
|
-
if (typeof
|
|
2679
|
-
const
|
|
2680
|
-
if (!
|
|
2756
|
+
for (const [O, j] of Object.entries(W)) {
|
|
2757
|
+
if (typeof j != "string") continue;
|
|
2758
|
+
const V = D.querySelector(`[name="${O.replace(/"/g, '\\"')}"]`);
|
|
2759
|
+
if (!V) {
|
|
2681
2760
|
console.warn(
|
|
2682
|
-
`[LiveLayer] fill_form: no
|
|
2761
|
+
`[LiveLayer] fill_form: no input with name="${O}" in form "${x}". Skipping.`
|
|
2683
2762
|
);
|
|
2684
2763
|
continue;
|
|
2685
2764
|
}
|
|
2686
|
-
if (!xt(
|
|
2765
|
+
if (!xt(V)) {
|
|
2687
2766
|
console.warn(
|
|
2688
|
-
`[LiveLayer] fill_form: field "${
|
|
2767
|
+
`[LiveLayer] fill_form: field "${O}" is privacy-protected (password / cc-* / private). Skipping.`
|
|
2689
2768
|
);
|
|
2690
2769
|
continue;
|
|
2691
2770
|
}
|
|
2692
2771
|
try {
|
|
2693
|
-
|
|
2694
|
-
} catch (
|
|
2772
|
+
io(V, j);
|
|
2773
|
+
} catch (z) {
|
|
2695
2774
|
console.warn(
|
|
2696
|
-
`[LiveLayer] fill_form: failed to set "${
|
|
2697
|
-
|
|
2775
|
+
`[LiveLayer] fill_form: failed to set "${O}".`,
|
|
2776
|
+
z
|
|
2698
2777
|
);
|
|
2699
2778
|
}
|
|
2700
2779
|
}
|
|
2701
2780
|
return;
|
|
2702
2781
|
}
|
|
2703
|
-
if (
|
|
2704
|
-
if (!
|
|
2705
|
-
|
|
2782
|
+
if (d.type === "submit_form") {
|
|
2783
|
+
if (!me("submit_forms")) {
|
|
2784
|
+
ge("submit_form", "submit_forms");
|
|
2706
2785
|
return;
|
|
2707
2786
|
}
|
|
2708
2787
|
if (typeof document > "u") return;
|
|
2709
|
-
const
|
|
2710
|
-
if (!
|
|
2788
|
+
const x = typeof d.formId == "string" ? d.formId : null;
|
|
2789
|
+
if (!x) {
|
|
2711
2790
|
console.warn("[LiveLayer] submit_form: missing formId.");
|
|
2712
2791
|
return;
|
|
2713
2792
|
}
|
|
2714
|
-
|
|
2715
|
-
const
|
|
2716
|
-
|
|
2717
|
-
);
|
|
2718
|
-
if (!T) {
|
|
2793
|
+
yt.current.playConfirmation();
|
|
2794
|
+
const D = yn(document, x);
|
|
2795
|
+
if (!D) {
|
|
2719
2796
|
console.warn(
|
|
2720
|
-
`[LiveLayer] submit_form: no form
|
|
2797
|
+
`[LiveLayer] submit_form: no <form> matched id="${x}" (or matching name / data-ll-intent slug).`
|
|
2721
2798
|
);
|
|
2722
2799
|
return;
|
|
2723
2800
|
}
|
|
2724
|
-
if (
|
|
2801
|
+
if (D.closest('[data-ll-private="true"], [data-ll-skip], .ll-widget')) {
|
|
2725
2802
|
console.warn(
|
|
2726
|
-
"[LiveLayer] submit_form: refusing to submit a form in a private subtree."
|
|
2803
|
+
"[LiveLayer] submit_form: refusing to submit a form in a private / opted-out subtree."
|
|
2727
2804
|
);
|
|
2728
2805
|
return;
|
|
2729
2806
|
}
|
|
2730
|
-
const W = typeof
|
|
2731
|
-
const
|
|
2807
|
+
const W = typeof d.requestId == "string" ? d.requestId : void 0, O = (be = he.current) == null ? void 0 : be.call(he), j = (Q) => {
|
|
2808
|
+
const ne = O, Fe = ne == null ? void 0 : ne.localParticipant;
|
|
2732
2809
|
if (Fe != null && Fe.publishData)
|
|
2733
2810
|
try {
|
|
2734
|
-
const
|
|
2735
|
-
Fe.publishData(
|
|
2811
|
+
const qn = W ? { ...Q, requestId: W } : Q, Fn = new TextEncoder().encode(JSON.stringify(qn));
|
|
2812
|
+
Fe.publishData(Fn, { reliable: !0 });
|
|
2736
2813
|
} catch {
|
|
2737
2814
|
}
|
|
2738
2815
|
};
|
|
2739
|
-
let
|
|
2740
|
-
const
|
|
2741
|
-
|
|
2816
|
+
let V = !1;
|
|
2817
|
+
const z = () => {
|
|
2818
|
+
V = !0, j({ type: "form_submitted", formId: x });
|
|
2742
2819
|
};
|
|
2743
|
-
|
|
2820
|
+
D.addEventListener("submit", z, { once: !0 });
|
|
2744
2821
|
try {
|
|
2745
|
-
typeof
|
|
2746
|
-
} catch (
|
|
2747
|
-
console.warn("[LiveLayer] submit_form: requestSubmit threw.",
|
|
2822
|
+
typeof D.requestSubmit == "function" ? D.requestSubmit() : D.submit();
|
|
2823
|
+
} catch (Q) {
|
|
2824
|
+
console.warn("[LiveLayer] submit_form: requestSubmit threw.", Q), D.removeEventListener("submit", z), j({
|
|
2748
2825
|
type: "form_submit_blocked",
|
|
2749
|
-
formId:
|
|
2826
|
+
formId: x,
|
|
2750
2827
|
reason: "exception"
|
|
2751
2828
|
});
|
|
2752
2829
|
return;
|
|
2753
2830
|
}
|
|
2754
2831
|
setTimeout(() => {
|
|
2755
|
-
|
|
2832
|
+
V || (D.removeEventListener("submit", z), j({
|
|
2756
2833
|
type: "form_submit_blocked",
|
|
2757
|
-
formId:
|
|
2834
|
+
formId: x,
|
|
2758
2835
|
reason: "validation"
|
|
2759
2836
|
}));
|
|
2760
2837
|
}, 500);
|
|
2761
2838
|
return;
|
|
2762
2839
|
}
|
|
2763
|
-
if (
|
|
2764
|
-
if (!
|
|
2765
|
-
|
|
2840
|
+
if (d.type === "request_routes") {
|
|
2841
|
+
if (!me("read_page")) {
|
|
2842
|
+
ge("request_routes", "read_page");
|
|
2766
2843
|
return;
|
|
2767
2844
|
}
|
|
2768
|
-
const
|
|
2769
|
-
if (!(
|
|
2770
|
-
const
|
|
2845
|
+
const x = typeof d.requestId == "string" ? d.requestId : void 0, W = (at = he.current) == null ? void 0 : at.call(he), O = W == null ? void 0 : W.localParticipant;
|
|
2846
|
+
if (!(O != null && O.publishData)) return;
|
|
2847
|
+
const j = (z) => {
|
|
2771
2848
|
try {
|
|
2772
|
-
const
|
|
2773
|
-
|
|
2774
|
-
} catch (
|
|
2775
|
-
console.warn("[LiveLayer] request_routes: publishData failed.",
|
|
2849
|
+
const Q = x ? { type: "routes", routes: z, requestId: x } : { type: "routes", routes: z }, ne = new TextEncoder().encode(JSON.stringify(Q));
|
|
2850
|
+
O.publishData(ne, { reliable: !0 });
|
|
2851
|
+
} catch (Q) {
|
|
2852
|
+
console.warn("[LiveLayer] request_routes: publishData failed.", Q);
|
|
2776
2853
|
}
|
|
2777
|
-
},
|
|
2778
|
-
if (
|
|
2854
|
+
}, V = Ht.current;
|
|
2855
|
+
if (V) {
|
|
2779
2856
|
try {
|
|
2780
|
-
const
|
|
2781
|
-
if (!Array.isArray(
|
|
2782
|
-
|
|
2857
|
+
const z = V(), Q = (ne) => {
|
|
2858
|
+
if (!Array.isArray(ne)) {
|
|
2859
|
+
j([]);
|
|
2783
2860
|
return;
|
|
2784
2861
|
}
|
|
2785
|
-
|
|
2862
|
+
j(ne.map(Zr).slice(0, 200));
|
|
2786
2863
|
};
|
|
2787
|
-
|
|
2864
|
+
z instanceof Promise ? z.then(Q).catch((ne) => {
|
|
2788
2865
|
console.warn(
|
|
2789
2866
|
"[LiveLayer] getRoutes rejected; falling back to DOM walker.",
|
|
2790
|
-
|
|
2791
|
-
),
|
|
2792
|
-
}) :
|
|
2793
|
-
} catch (
|
|
2867
|
+
ne
|
|
2868
|
+
), j(Mt());
|
|
2869
|
+
}) : Q(z);
|
|
2870
|
+
} catch (z) {
|
|
2794
2871
|
console.warn(
|
|
2795
2872
|
"[LiveLayer] getRoutes threw; falling back to DOM walker.",
|
|
2796
|
-
|
|
2797
|
-
),
|
|
2873
|
+
z
|
|
2874
|
+
), j(Mt());
|
|
2875
|
+
}
|
|
2876
|
+
return;
|
|
2877
|
+
}
|
|
2878
|
+
try {
|
|
2879
|
+
j(Mt());
|
|
2880
|
+
} catch (z) {
|
|
2881
|
+
console.warn("[LiveLayer] request_routes: extractRoutes threw.", z);
|
|
2882
|
+
}
|
|
2883
|
+
return;
|
|
2884
|
+
}
|
|
2885
|
+
if (d.type === "task_field_updated") {
|
|
2886
|
+
if (!me("collect_data")) {
|
|
2887
|
+
ge("task_field_updated", "collect_data");
|
|
2888
|
+
return;
|
|
2889
|
+
}
|
|
2890
|
+
const x = {
|
|
2891
|
+
phase: "field",
|
|
2892
|
+
fieldId: typeof d.fieldId == "string" ? d.fieldId : "",
|
|
2893
|
+
fieldName: typeof d.fieldName == "string" ? d.fieldName : typeof d.fieldId == "string" ? d.fieldId : "",
|
|
2894
|
+
value: typeof d.value == "string" ? d.value : "",
|
|
2895
|
+
kind: typeof d.kind == "string" ? d.kind : "text",
|
|
2896
|
+
source: d.source === "slide" ? "slide" : d.source === "page" ? "page" : "agent",
|
|
2897
|
+
...typeof d.slideId == "string" ? { slideId: d.slideId } : {},
|
|
2898
|
+
...typeof d.formId == "string" ? { formId: d.formId } : {}
|
|
2899
|
+
};
|
|
2900
|
+
if (typeof document < "u")
|
|
2901
|
+
try {
|
|
2902
|
+
document.dispatchEvent(
|
|
2903
|
+
new CustomEvent("ll-collected", { detail: x })
|
|
2904
|
+
);
|
|
2905
|
+
} catch {
|
|
2798
2906
|
}
|
|
2907
|
+
return;
|
|
2908
|
+
}
|
|
2909
|
+
if (d.type === "task_completed") {
|
|
2910
|
+
if (!me("collect_data")) {
|
|
2911
|
+
ge("task_completed", "collect_data");
|
|
2912
|
+
return;
|
|
2913
|
+
}
|
|
2914
|
+
const x = d.result;
|
|
2915
|
+
if (!x || typeof x != "object") {
|
|
2916
|
+
console.warn(
|
|
2917
|
+
"[LiveLayer] task_completed missing `result` payload."
|
|
2918
|
+
);
|
|
2799
2919
|
return;
|
|
2800
2920
|
}
|
|
2921
|
+
if (typeof document < "u")
|
|
2922
|
+
try {
|
|
2923
|
+
document.dispatchEvent(
|
|
2924
|
+
new CustomEvent("ll-collected", {
|
|
2925
|
+
detail: { phase: "complete", result: x }
|
|
2926
|
+
})
|
|
2927
|
+
);
|
|
2928
|
+
} catch {
|
|
2929
|
+
}
|
|
2801
2930
|
try {
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2931
|
+
Me == null || Me(
|
|
2932
|
+
x
|
|
2933
|
+
);
|
|
2934
|
+
} catch (D) {
|
|
2935
|
+
console.warn("[LiveLayer] onCollect threw.", D);
|
|
2805
2936
|
}
|
|
2806
2937
|
return;
|
|
2807
2938
|
}
|
|
2808
|
-
|
|
2939
|
+
po.has(d.type) || Re == null || Re(d);
|
|
2809
2940
|
}
|
|
2810
2941
|
},
|
|
2811
|
-
[Re,
|
|
2812
|
-
),
|
|
2813
|
-
agentId:
|
|
2942
|
+
[Re, Ie, Me]
|
|
2943
|
+
), X = Xn({
|
|
2944
|
+
agentId: $ ? "__controlled__" : et,
|
|
2814
2945
|
baseUrl: l,
|
|
2815
2946
|
apiKey: i,
|
|
2816
|
-
sessionEndpoint:
|
|
2947
|
+
sessionEndpoint: c,
|
|
2817
2948
|
sessionBody: a,
|
|
2818
|
-
onDataMessage:
|
|
2949
|
+
onDataMessage: $ ? void 0 : it
|
|
2819
2950
|
});
|
|
2820
|
-
|
|
2821
|
-
if (
|
|
2822
|
-
return
|
|
2823
|
-
}, [
|
|
2824
|
-
var
|
|
2825
|
-
return (
|
|
2826
|
-
},
|
|
2827
|
-
var
|
|
2951
|
+
R(() => {
|
|
2952
|
+
if ($ != null && $.subscribeToDataMessages)
|
|
2953
|
+
return $.subscribeToDataMessages(it);
|
|
2954
|
+
}, [$, it]), he.current = () => {
|
|
2955
|
+
var y;
|
|
2956
|
+
return (y = X.getRoom) == null ? void 0 : y.call(X);
|
|
2957
|
+
}, R(() => {
|
|
2958
|
+
var G;
|
|
2828
2959
|
if (typeof window > "u") return;
|
|
2829
|
-
const
|
|
2830
|
-
if (
|
|
2831
|
-
return window.__livelayerSimulateCommand = (
|
|
2960
|
+
const y = ((G = window.location) == null ? void 0 : G.hostname) || "";
|
|
2961
|
+
if (y === "localhost" || y === "127.0.0.1" || y === "0.0.0.0" || y.endsWith(".local") || y.endsWith(".test"))
|
|
2962
|
+
return window.__livelayerSimulateCommand = (de) => {
|
|
2832
2963
|
try {
|
|
2833
|
-
|
|
2834
|
-
} catch (
|
|
2835
|
-
console.warn("[LiveLayer] simulate-command threw:",
|
|
2964
|
+
it(de);
|
|
2965
|
+
} catch (be) {
|
|
2966
|
+
console.warn("[LiveLayer] simulate-command threw:", be);
|
|
2836
2967
|
}
|
|
2837
2968
|
}, () => {
|
|
2838
2969
|
delete window.__livelayerSimulateCommand;
|
|
2839
2970
|
};
|
|
2840
|
-
}, [
|
|
2841
|
-
const
|
|
2842
|
-
connectionState:
|
|
2843
|
-
agentState:
|
|
2844
|
-
transcript:
|
|
2845
|
-
videoElement:
|
|
2846
|
-
audioElement:
|
|
2847
|
-
canResume:
|
|
2848
|
-
error:
|
|
2971
|
+
}, [it]);
|
|
2972
|
+
const k = Ge(() => $ ? {
|
|
2973
|
+
connectionState: $.connectionState,
|
|
2974
|
+
agentState: $.agentState,
|
|
2975
|
+
transcript: $.transcript,
|
|
2976
|
+
videoElement: $.videoElement,
|
|
2977
|
+
audioElement: $.audioElement,
|
|
2978
|
+
canResume: $.canResume,
|
|
2979
|
+
error: $.error,
|
|
2849
2980
|
agentConfig: null,
|
|
2850
2981
|
connect: async () => {
|
|
2851
|
-
await
|
|
2982
|
+
await $.onConnect();
|
|
2852
2983
|
},
|
|
2853
|
-
disconnect: () =>
|
|
2984
|
+
disconnect: () => $.onDisconnect(),
|
|
2854
2985
|
// Dummy getRoom for shape compatibility — controlled consumers own the Room.
|
|
2855
2986
|
// Internal session's getRoom returns null when no real connect has happened,
|
|
2856
2987
|
// so we reuse its reference for type consistency.
|
|
2857
|
-
getRoom:
|
|
2988
|
+
getRoom: X.getRoom,
|
|
2858
2989
|
isControlled: !0
|
|
2859
2990
|
} : {
|
|
2860
|
-
connectionState:
|
|
2861
|
-
agentState:
|
|
2862
|
-
transcript:
|
|
2863
|
-
videoElement:
|
|
2864
|
-
audioElement:
|
|
2865
|
-
canResume:
|
|
2866
|
-
error:
|
|
2867
|
-
agentConfig:
|
|
2868
|
-
connect:
|
|
2869
|
-
disconnect:
|
|
2870
|
-
getRoom:
|
|
2991
|
+
connectionState: X.connectionState,
|
|
2992
|
+
agentState: X.agentState,
|
|
2993
|
+
transcript: X.transcript,
|
|
2994
|
+
videoElement: X.videoElement,
|
|
2995
|
+
audioElement: X.audioElement,
|
|
2996
|
+
canResume: X.canResume,
|
|
2997
|
+
error: X.error,
|
|
2998
|
+
agentConfig: X.agentConfig,
|
|
2999
|
+
connect: X.connect,
|
|
3000
|
+
disconnect: X.disconnect,
|
|
3001
|
+
getRoom: X.getRoom,
|
|
2871
3002
|
isControlled: !1
|
|
2872
|
-
}, [
|
|
2873
|
-
|
|
2874
|
-
const
|
|
2875
|
-
|
|
3003
|
+
}, [$, X]), Bt = N(k);
|
|
3004
|
+
Bt.current = k;
|
|
3005
|
+
const Wt = N($);
|
|
3006
|
+
Wt.current = $, jn(
|
|
2876
3007
|
r,
|
|
2877
3008
|
() => ({
|
|
2878
|
-
sendData: async (
|
|
2879
|
-
var
|
|
2880
|
-
const
|
|
2881
|
-
if (
|
|
3009
|
+
sendData: async (y) => {
|
|
3010
|
+
var be, at;
|
|
3011
|
+
const d = Wt.current;
|
|
3012
|
+
if (d != null && d.publishData) {
|
|
2882
3013
|
try {
|
|
2883
|
-
await
|
|
2884
|
-
} catch (
|
|
2885
|
-
console.warn("[AvatarWidget] sendData (controlled) failed:",
|
|
3014
|
+
await d.publishData(y);
|
|
3015
|
+
} catch (x) {
|
|
3016
|
+
console.warn("[AvatarWidget] sendData (controlled) failed:", x);
|
|
2886
3017
|
}
|
|
2887
3018
|
return;
|
|
2888
3019
|
}
|
|
2889
|
-
const
|
|
2890
|
-
if (
|
|
3020
|
+
const G = (at = (be = Bt.current) == null ? void 0 : be.getRoom) == null ? void 0 : at.call(be), de = G == null ? void 0 : G.localParticipant;
|
|
3021
|
+
if (de != null && de.publishData)
|
|
2891
3022
|
try {
|
|
2892
|
-
const
|
|
2893
|
-
await
|
|
2894
|
-
} catch (
|
|
2895
|
-
console.warn("[AvatarWidget] sendData failed:",
|
|
3023
|
+
const x = new TextEncoder().encode(JSON.stringify(y));
|
|
3024
|
+
await de.publishData(x, { reliable: !0 });
|
|
3025
|
+
} catch (x) {
|
|
3026
|
+
console.warn("[AvatarWidget] sendData failed:", x);
|
|
2896
3027
|
}
|
|
2897
3028
|
}
|
|
2898
3029
|
}),
|
|
2899
3030
|
[]
|
|
2900
3031
|
);
|
|
2901
|
-
const
|
|
2902
|
-
|
|
2903
|
-
const
|
|
2904
|
-
if (!(!
|
|
2905
|
-
return
|
|
2906
|
-
|
|
3032
|
+
const qt = N(null);
|
|
3033
|
+
R(() => {
|
|
3034
|
+
const y = k.videoElement, d = qt.current;
|
|
3035
|
+
if (!(!y || !d))
|
|
3036
|
+
return d.appendChild(y), () => {
|
|
3037
|
+
y.parentNode === d && d.removeChild(y);
|
|
2907
3038
|
};
|
|
2908
|
-
}, [
|
|
2909
|
-
const
|
|
2910
|
-
if (!
|
|
2911
|
-
|
|
2912
|
-
const
|
|
2913
|
-
return
|
|
2914
|
-
(
|
|
3039
|
+
}, [k.videoElement]), R(() => {
|
|
3040
|
+
const y = k.audioElement;
|
|
3041
|
+
if (!y) return;
|
|
3042
|
+
tt.attach(y);
|
|
3043
|
+
const d = y.play();
|
|
3044
|
+
return d && typeof d.catch == "function" && d.catch((G) => {
|
|
3045
|
+
(G == null ? void 0 : G.name) === "NotAllowedError" && fe(!0);
|
|
2915
3046
|
}), () => {
|
|
2916
|
-
|
|
3047
|
+
tt.detach();
|
|
2917
3048
|
};
|
|
2918
|
-
}, [
|
|
2919
|
-
if (
|
|
2920
|
-
const
|
|
2921
|
-
if (
|
|
2922
|
-
return
|
|
3049
|
+
}, [k.audioElement]), R(() => {
|
|
3050
|
+
if (k.isControlled || k.connectionState !== "connected") return;
|
|
3051
|
+
const y = k.getRoom();
|
|
3052
|
+
if (y)
|
|
3053
|
+
return re.setupMic(y).catch(() => {
|
|
2923
3054
|
}), () => {
|
|
2924
|
-
|
|
3055
|
+
re.teardownMic();
|
|
2925
3056
|
};
|
|
2926
|
-
}, [
|
|
2927
|
-
var
|
|
2928
|
-
if (
|
|
2929
|
-
const
|
|
2930
|
-
if (
|
|
2931
|
-
return
|
|
2932
|
-
|
|
3057
|
+
}, [k.isControlled, k.connectionState]), R(() => {
|
|
3058
|
+
var d;
|
|
3059
|
+
if (k.connectionState !== "connected") return;
|
|
3060
|
+
const y = k.isControlled ? (d = $ == null ? void 0 : $.getRoom) == null ? void 0 : d.call($) : k.getRoom();
|
|
3061
|
+
if (y)
|
|
3062
|
+
return ae.attachRoom(y), Ee.attachRoom(y), k.isControlled && re.attachRoom(y), nt.refresh(), () => {
|
|
3063
|
+
ae.teardown(), Ee.teardown();
|
|
2933
3064
|
};
|
|
2934
|
-
}, [
|
|
2935
|
-
const
|
|
2936
|
-
|
|
2937
|
-
}, [
|
|
2938
|
-
const
|
|
2939
|
-
const
|
|
2940
|
-
if (
|
|
3065
|
+
}, [k.isControlled, k.connectionState, $]), R(() => {
|
|
3066
|
+
const y = k.audioElement;
|
|
3067
|
+
y && (y.muted = Y);
|
|
3068
|
+
}, [k.audioElement, Y]);
|
|
3069
|
+
const In = C((y) => {
|
|
3070
|
+
const d = { type: "user_message", text: y };
|
|
3071
|
+
if ($ != null && $.publishData) {
|
|
2941
3072
|
try {
|
|
2942
|
-
|
|
3073
|
+
$.publishData(d);
|
|
2943
3074
|
} catch {
|
|
2944
3075
|
}
|
|
2945
3076
|
return;
|
|
2946
3077
|
}
|
|
2947
|
-
const
|
|
2948
|
-
if (
|
|
3078
|
+
const G = k.getRoom();
|
|
3079
|
+
if (G)
|
|
2949
3080
|
try {
|
|
2950
|
-
const
|
|
2951
|
-
|
|
3081
|
+
const de = new TextEncoder().encode(JSON.stringify(d));
|
|
3082
|
+
G.localParticipant.publishData(de, { reliable: !0 });
|
|
2952
3083
|
} catch {
|
|
2953
3084
|
}
|
|
2954
|
-
}, [
|
|
2955
|
-
|
|
3085
|
+
}, [k, $]), Rn = C(() => {
|
|
3086
|
+
An((y) => !y);
|
|
2956
3087
|
}, []);
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
}, [
|
|
2960
|
-
|
|
2961
|
-
}, [
|
|
2962
|
-
|
|
2963
|
-
}, [
|
|
2964
|
-
|
|
2965
|
-
}, [
|
|
2966
|
-
const
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
}, [
|
|
2970
|
-
const
|
|
2971
|
-
(
|
|
2972
|
-
const
|
|
2973
|
-
|
|
3088
|
+
R(() => {
|
|
3089
|
+
Ae == null || Ae(k.connectionState), k.connectionState === "connected" ? Se == null || Se() : k.connectionState === "disconnected" && (Pe == null || Pe());
|
|
3090
|
+
}, [k.connectionState, Se, Pe, Ae]), R(() => {
|
|
3091
|
+
Ne == null || Ne(k.transcript);
|
|
3092
|
+
}, [k.transcript, Ne]), R(() => {
|
|
3093
|
+
$e == null || $e(k.agentState);
|
|
3094
|
+
}, [k.agentState, $e]), R(() => {
|
|
3095
|
+
gt.setThinking(k.agentState === "thinking");
|
|
3096
|
+
}, [k.agentState, gt]);
|
|
3097
|
+
const Ft = N(!1);
|
|
3098
|
+
R(() => {
|
|
3099
|
+
!v || Ft.current || Ze && k.connectionState === "idle" && (Ft.current = !0, k.connect());
|
|
3100
|
+
}, [v, k.connectionState, k, Ze]);
|
|
3101
|
+
const Mn = C(
|
|
3102
|
+
(y) => {
|
|
3103
|
+
const d = S == null ? void 0 : S.find((G) => G.id === y);
|
|
3104
|
+
d && (ot(!1), y !== Le && (rt(!0), k.disconnect(), De || Lt(y), A == null || A(d)));
|
|
2974
3105
|
},
|
|
2975
3106
|
[
|
|
2976
3107
|
S,
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
3108
|
+
Le,
|
|
3109
|
+
k,
|
|
3110
|
+
De,
|
|
3111
|
+
A
|
|
2981
3112
|
]
|
|
2982
3113
|
);
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
}, [
|
|
2986
|
-
if (!
|
|
2987
|
-
const
|
|
2988
|
-
|
|
3114
|
+
R(() => {
|
|
3115
|
+
pe && k.connectionState === "connected" && rt(!1);
|
|
3116
|
+
}, [k.connectionState, pe]), R(() => {
|
|
3117
|
+
if (!We) return;
|
|
3118
|
+
const y = (d) => {
|
|
3119
|
+
d.key === "Escape" && ot(!1);
|
|
2989
3120
|
};
|
|
2990
|
-
return window.addEventListener("keydown",
|
|
2991
|
-
}, [
|
|
2992
|
-
const
|
|
2993
|
-
Qe === void 0 && ((
|
|
2994
|
-
const vt = (ee == null ? void 0 : ee.name) ??
|
|
2995
|
-
() =>
|
|
2996
|
-
[
|
|
2997
|
-
),
|
|
2998
|
-
|
|
2999
|
-
}, [
|
|
3000
|
-
const
|
|
3001
|
-
|
|
3121
|
+
return window.addEventListener("keydown", y), () => window.removeEventListener("keydown", y);
|
|
3122
|
+
}, [We]);
|
|
3123
|
+
const Tn = !!P || !!(ee != null && ee.avatarImageUrl) || k.isControlled, lt = or(et, l, Tn);
|
|
3124
|
+
Qe === void 0 && ((Yt = lt.info) != null && Yt.capabilities) && (It.current = lt.info.capabilities);
|
|
3125
|
+
const vt = (ee == null ? void 0 : ee.name) ?? H ?? ((Gt = k.agentConfig) == null ? void 0 : Gt.name) ?? ((Jt = lt.info) == null ? void 0 : Jt.name) ?? "Live Layer", Rt = (ee == null ? void 0 : ee.avatarImageUrl) ?? P ?? ((Kt = k.agentConfig) == null ? void 0 : Kt.avatarImageUrl) ?? ((Xt = lt.info) == null ? void 0 : Xt.avatarImageUrl) ?? null, Dn = F ?? ((Qt = k.agentConfig) == null ? void 0 : Qt.idleLoopUrl) ?? ((Zt = lt.info) == null ? void 0 : Zt.idleLoopUrl) ?? null, Pn = g ?? null, $n = C(() => le("expanded"), [le]), zn = C(
|
|
3126
|
+
() => le("minimized"),
|
|
3127
|
+
[le]
|
|
3128
|
+
), Ut = C(() => {
|
|
3129
|
+
k.disconnect(), le("hidden");
|
|
3130
|
+
}, [k, le]), On = C(() => {
|
|
3131
|
+
const y = k.audioElement;
|
|
3132
|
+
y && y.play().then(() => fe(!1)).catch(() => {
|
|
3002
3133
|
});
|
|
3003
|
-
}, [
|
|
3004
|
-
|
|
3005
|
-
}, [
|
|
3006
|
-
...
|
|
3007
|
-
...
|
|
3134
|
+
}, [k.audioElement]), Hn = C(() => {
|
|
3135
|
+
fe(!1), k.connect();
|
|
3136
|
+
}, [k]), qe = {
|
|
3137
|
+
...Te,
|
|
3138
|
+
...ue ? {} : { zIndex: ze }
|
|
3008
3139
|
};
|
|
3009
|
-
|
|
3010
|
-
const
|
|
3140
|
+
q.primaryColor && (qe["--ll-color-primary"] = q.primaryColor), q.accentColor && (qe["--ll-color-accent"] = q.accentColor), q.backgroundColor && (qe["--ll-color-bg"] = q.backgroundColor), q.textColor && (qe["--ll-color-fg"] = q.textColor);
|
|
3141
|
+
const Bn = [
|
|
3011
3142
|
"ll-widget",
|
|
3012
|
-
`ll-widget--${
|
|
3013
|
-
`ll-widget--${
|
|
3014
|
-
|
|
3143
|
+
`ll-widget--${te}`,
|
|
3144
|
+
`ll-widget--${Ce ? "mobile" : "desktop"}`,
|
|
3145
|
+
kt
|
|
3015
3146
|
].filter(Boolean).join(" ");
|
|
3016
|
-
if (!
|
|
3017
|
-
const
|
|
3147
|
+
if (!Ze) return null;
|
|
3148
|
+
const Wn = /* @__PURE__ */ n(
|
|
3018
3149
|
"div",
|
|
3019
3150
|
{
|
|
3020
|
-
className:
|
|
3151
|
+
className: Bn,
|
|
3021
3152
|
style: qe,
|
|
3022
|
-
"data-display-mode":
|
|
3023
|
-
"data-position":
|
|
3024
|
-
"data-experience-mode":
|
|
3025
|
-
children:
|
|
3026
|
-
|
|
3153
|
+
"data-display-mode": te,
|
|
3154
|
+
"data-position": L,
|
|
3155
|
+
"data-experience-mode": p === "EMBEDDED" ? "embedded" : "widget",
|
|
3156
|
+
children: te === "expanded" && /* @__PURE__ */ n(
|
|
3157
|
+
Or,
|
|
3027
3158
|
{
|
|
3028
|
-
position:
|
|
3029
|
-
isMobile:
|
|
3159
|
+
position: L,
|
|
3160
|
+
isMobile: Ce,
|
|
3030
3161
|
agentName: vt,
|
|
3031
|
-
avatarImageUrl:
|
|
3032
|
-
idleLoopUrl:
|
|
3033
|
-
greeting:
|
|
3034
|
-
branding:
|
|
3162
|
+
avatarImageUrl: Rt,
|
|
3163
|
+
idleLoopUrl: Dn,
|
|
3164
|
+
greeting: Pn,
|
|
3165
|
+
branding: q,
|
|
3035
3166
|
teamMembers: S,
|
|
3036
|
-
currentTeamMemberId:
|
|
3037
|
-
isSwitchingTeamMember:
|
|
3038
|
-
teamSwitcherOpen:
|
|
3039
|
-
onToggleTeamSwitcher: () =>
|
|
3040
|
-
onSelectTeamMember:
|
|
3041
|
-
connectionState:
|
|
3042
|
-
agentState:
|
|
3043
|
-
transcript:
|
|
3044
|
-
isMuted:
|
|
3045
|
-
micDevices:
|
|
3046
|
-
activeMicId:
|
|
3047
|
-
isCameraEnabled:
|
|
3048
|
-
cameraPreviewEl:
|
|
3049
|
-
cameraDevices:
|
|
3050
|
-
activeCameraId:
|
|
3051
|
-
isScreenShareEnabled:
|
|
3052
|
-
screenPreviewEl:
|
|
3053
|
-
isSpeakerMuted:
|
|
3054
|
-
allowCamera:
|
|
3055
|
-
allowScreenShare:
|
|
3056
|
-
allowTyping:
|
|
3057
|
-
showMinimize:
|
|
3058
|
-
showClose:
|
|
3059
|
-
chromeless:
|
|
3060
|
-
compactControls:
|
|
3061
|
-
transforming:
|
|
3167
|
+
currentTeamMemberId: Le,
|
|
3168
|
+
isSwitchingTeamMember: pe,
|
|
3169
|
+
teamSwitcherOpen: We,
|
|
3170
|
+
onToggleTeamSwitcher: () => ot((y) => !y),
|
|
3171
|
+
onSelectTeamMember: Mn,
|
|
3172
|
+
connectionState: k.connectionState,
|
|
3173
|
+
agentState: k.agentState,
|
|
3174
|
+
transcript: k.transcript,
|
|
3175
|
+
isMuted: re.isMuted,
|
|
3176
|
+
micDevices: nt.mics,
|
|
3177
|
+
activeMicId: re.activeDeviceId,
|
|
3178
|
+
isCameraEnabled: ae.isEnabled,
|
|
3179
|
+
cameraPreviewEl: ae.previewEl,
|
|
3180
|
+
cameraDevices: nt.cameras,
|
|
3181
|
+
activeCameraId: ae.activeDeviceId,
|
|
3182
|
+
isScreenShareEnabled: Ee.isEnabled,
|
|
3183
|
+
screenPreviewEl: Ee.previewEl,
|
|
3184
|
+
isSpeakerMuted: Y,
|
|
3185
|
+
allowCamera: Z,
|
|
3186
|
+
allowScreenShare: M,
|
|
3187
|
+
allowTyping: U,
|
|
3188
|
+
showMinimize: pt,
|
|
3189
|
+
showClose: ht,
|
|
3190
|
+
chromeless: oe,
|
|
3191
|
+
compactControls: K,
|
|
3192
|
+
transforming: xe,
|
|
3062
3193
|
transformingLabel: ye,
|
|
3063
|
-
languageMenuOpen:
|
|
3064
|
-
onToggleLanguageMenu: () =>
|
|
3065
|
-
needsUserGesture:
|
|
3066
|
-
canResume:
|
|
3067
|
-
micError:
|
|
3068
|
-
error:
|
|
3069
|
-
avatarVideoContainerRef:
|
|
3070
|
-
agentVideoEl:
|
|
3071
|
-
onConnect: () => void
|
|
3072
|
-
onDisconnect: () =>
|
|
3073
|
-
onRetry:
|
|
3074
|
-
onResumeAudio:
|
|
3075
|
-
onToggleMute:
|
|
3076
|
-
onSwitchMicDevice: (
|
|
3077
|
-
onToggleCamera: () => void
|
|
3078
|
-
onSwitchCameraDevice: (
|
|
3079
|
-
onToggleScreenShare: () => void
|
|
3080
|
-
onToggleSpeaker:
|
|
3081
|
-
onSendMessage:
|
|
3082
|
-
onMinimize:
|
|
3083
|
-
onClose:
|
|
3084
|
-
onClearMicError:
|
|
3194
|
+
languageMenuOpen: mt,
|
|
3195
|
+
onToggleLanguageMenu: () => m((y) => !y),
|
|
3196
|
+
needsUserGesture: Ct,
|
|
3197
|
+
canResume: k.canResume,
|
|
3198
|
+
micError: re.micError,
|
|
3199
|
+
error: k.error,
|
|
3200
|
+
avatarVideoContainerRef: qt,
|
|
3201
|
+
agentVideoEl: k.videoElement,
|
|
3202
|
+
onConnect: () => void k.connect(),
|
|
3203
|
+
onDisconnect: () => k.disconnect(),
|
|
3204
|
+
onRetry: Hn,
|
|
3205
|
+
onResumeAudio: On,
|
|
3206
|
+
onToggleMute: re.toggleMute,
|
|
3207
|
+
onSwitchMicDevice: (y) => void re.switchDevice(y),
|
|
3208
|
+
onToggleCamera: () => void ae.toggle(),
|
|
3209
|
+
onSwitchCameraDevice: (y) => void ae.switchDevice(y),
|
|
3210
|
+
onToggleScreenShare: () => void Ee.toggle(),
|
|
3211
|
+
onToggleSpeaker: Rn,
|
|
3212
|
+
onSendMessage: In,
|
|
3213
|
+
onMinimize: zn,
|
|
3214
|
+
onClose: Ut,
|
|
3215
|
+
onClearMicError: re.clearError
|
|
3085
3216
|
}
|
|
3086
3217
|
)
|
|
3087
3218
|
}
|
|
3088
|
-
),
|
|
3219
|
+
), jt = !ue && (te === "hidden" || te === "minimized") ? /* @__PURE__ */ w(
|
|
3089
3220
|
"div",
|
|
3090
3221
|
{
|
|
3091
3222
|
className: [
|
|
3092
3223
|
"ll-widget",
|
|
3093
3224
|
"ll-widget--floating",
|
|
3094
|
-
`ll-widget--${
|
|
3095
|
-
`ll-widget--${
|
|
3225
|
+
`ll-widget--${te}`,
|
|
3226
|
+
`ll-widget--${Ce ? "mobile" : "desktop"}`
|
|
3096
3227
|
].join(" "),
|
|
3097
3228
|
style: qe,
|
|
3098
|
-
"data-display-mode":
|
|
3099
|
-
"data-position":
|
|
3229
|
+
"data-display-mode": te,
|
|
3230
|
+
"data-position": L,
|
|
3100
3231
|
children: [
|
|
3101
|
-
|
|
3102
|
-
|
|
3232
|
+
te === "hidden" && /* @__PURE__ */ n(
|
|
3233
|
+
Ar,
|
|
3103
3234
|
{
|
|
3104
|
-
position:
|
|
3105
|
-
isMobile:
|
|
3106
|
-
isSpeaking:
|
|
3107
|
-
onExpand: () =>
|
|
3235
|
+
position: L,
|
|
3236
|
+
isMobile: Ce,
|
|
3237
|
+
isSpeaking: k.agentState === "speaking",
|
|
3238
|
+
onExpand: () => le("expanded"),
|
|
3108
3239
|
label: `Open ${vt} widget`,
|
|
3109
|
-
avatarImageUrl:
|
|
3240
|
+
avatarImageUrl: Rt,
|
|
3110
3241
|
agentName: vt,
|
|
3111
|
-
containerEl:
|
|
3242
|
+
containerEl: _e
|
|
3112
3243
|
}
|
|
3113
3244
|
),
|
|
3114
|
-
|
|
3115
|
-
|
|
3245
|
+
te === "minimized" && /* @__PURE__ */ n(
|
|
3246
|
+
Rr,
|
|
3116
3247
|
{
|
|
3117
|
-
position:
|
|
3118
|
-
isMobile:
|
|
3248
|
+
position: L,
|
|
3249
|
+
isMobile: Ce,
|
|
3119
3250
|
agentName: vt,
|
|
3120
|
-
avatarImageUrl:
|
|
3121
|
-
agentState:
|
|
3122
|
-
isMuted:
|
|
3123
|
-
audioLevel:
|
|
3124
|
-
onExpand:
|
|
3125
|
-
onToggleMute:
|
|
3126
|
-
onClose:
|
|
3251
|
+
avatarImageUrl: Rt,
|
|
3252
|
+
agentState: k.agentState,
|
|
3253
|
+
isMuted: re.isMuted,
|
|
3254
|
+
audioLevel: tt,
|
|
3255
|
+
onExpand: $n,
|
|
3256
|
+
onToggleMute: re.toggleMute,
|
|
3257
|
+
onClose: Ut
|
|
3127
3258
|
}
|
|
3128
3259
|
)
|
|
3129
3260
|
]
|
|
3130
3261
|
}
|
|
3131
|
-
) : null,
|
|
3132
|
-
return /* @__PURE__ */
|
|
3133
|
-
|
|
3134
|
-
|
|
3262
|
+
) : null, Vt = _e ?? (typeof document < "u" ? document.body : null);
|
|
3263
|
+
return /* @__PURE__ */ w(Ye, { children: [
|
|
3264
|
+
Wn,
|
|
3265
|
+
jt && Vt && Pt(jt, Vt)
|
|
3135
3266
|
] });
|
|
3136
3267
|
}
|
|
3137
3268
|
);
|
|
3138
|
-
|
|
3139
|
-
const
|
|
3269
|
+
Nn.displayName = "AvatarWidgetInner";
|
|
3270
|
+
const ho = Dt(
|
|
3140
3271
|
function(t, r) {
|
|
3141
|
-
return /* @__PURE__ */ n(
|
|
3272
|
+
return /* @__PURE__ */ n(Kn, { children: /* @__PURE__ */ n(Nn, { ...t, ref: r }) });
|
|
3142
3273
|
}
|
|
3143
3274
|
);
|
|
3144
|
-
|
|
3145
|
-
const
|
|
3275
|
+
ho.displayName = "AvatarWidget";
|
|
3276
|
+
const Lo = ({
|
|
3146
3277
|
agentId: e,
|
|
3147
3278
|
baseUrl: t,
|
|
3148
3279
|
apiKey: r,
|
|
3149
3280
|
mode: o,
|
|
3150
3281
|
onAgentEvent: i,
|
|
3151
3282
|
className: l,
|
|
3152
|
-
style:
|
|
3283
|
+
style: c
|
|
3153
3284
|
}) => {
|
|
3154
|
-
const a = N(null), s = N(null),
|
|
3155
|
-
|
|
3156
|
-
const
|
|
3157
|
-
var
|
|
3158
|
-
const
|
|
3159
|
-
(
|
|
3285
|
+
const a = N(null), s = N(null), p = N(i);
|
|
3286
|
+
p.current = i;
|
|
3287
|
+
const v = C((f) => {
|
|
3288
|
+
var I;
|
|
3289
|
+
const u = f.detail;
|
|
3290
|
+
(I = p.current) == null || I.call(p, u);
|
|
3160
3291
|
}, []);
|
|
3161
|
-
return
|
|
3292
|
+
return R(() => {
|
|
3162
3293
|
const f = a.current;
|
|
3163
3294
|
if (!f) return;
|
|
3164
|
-
const
|
|
3165
|
-
return
|
|
3166
|
-
|
|
3295
|
+
const u = document.createElement("livelayer-widget");
|
|
3296
|
+
return u.setAttribute("agent-id", e), t && u.setAttribute("base-url", t), r && u.setAttribute("api-key", r), o && u.setAttribute("mode", o), u.addEventListener("agent-event", v), f.appendChild(u), s.current = u, () => {
|
|
3297
|
+
u.removeEventListener("agent-event", v), f.removeChild(u), s.current = null;
|
|
3167
3298
|
};
|
|
3168
|
-
}, [e]),
|
|
3299
|
+
}, [e]), R(() => {
|
|
3169
3300
|
s.current && (o ? s.current.setAttribute("mode", o) : s.current.removeAttribute("mode"));
|
|
3170
|
-
}, [o]), /* @__PURE__ */ n("div", { ref: a, className: l, style:
|
|
3171
|
-
},
|
|
3172
|
-
function({ id: t, intent: r, as: o = "div", className: i, style: l, children:
|
|
3173
|
-
return
|
|
3301
|
+
}, [o]), /* @__PURE__ */ n("div", { ref: a, className: l, style: c });
|
|
3302
|
+
}, Co = Dt(
|
|
3303
|
+
function({ id: t, intent: r, as: o = "div", className: i, style: l, children: c }, a) {
|
|
3304
|
+
return Vn(
|
|
3174
3305
|
o,
|
|
3175
3306
|
{
|
|
3176
3307
|
ref: a,
|
|
@@ -3179,125 +3310,114 @@ const mo = ({
|
|
|
3179
3310
|
className: i,
|
|
3180
3311
|
style: l
|
|
3181
3312
|
},
|
|
3182
|
-
|
|
3313
|
+
c
|
|
3183
3314
|
);
|
|
3184
3315
|
}
|
|
3185
|
-
)
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
)
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
} else if ("as" in t && t.as === "select") {
|
|
3213
|
-
const { name: s, label: u, labelClassName: y, as: f, children: c, ...A } = t;
|
|
3214
|
-
a = /* @__PURE__ */ n(
|
|
3215
|
-
"select",
|
|
3216
|
-
{
|
|
3217
|
-
ref: r,
|
|
3218
|
-
...d,
|
|
3219
|
-
...A,
|
|
3220
|
-
children: c
|
|
3316
|
+
);
|
|
3317
|
+
function Eo(e = {}) {
|
|
3318
|
+
const { onFieldUpdate: t, onComplete: r, source: o = "all" } = e, [i, l] = E({}), [c, a] = E(!1), [s, p] = E(null), v = N(t), f = N(r), u = N(o);
|
|
3319
|
+
R(() => {
|
|
3320
|
+
v.current = t, f.current = r, u.current = o;
|
|
3321
|
+
}, [t, r, o]);
|
|
3322
|
+
const I = C(() => {
|
|
3323
|
+
l({}), a(!1);
|
|
3324
|
+
}, []);
|
|
3325
|
+
return R(() => {
|
|
3326
|
+
if (typeof window > "u") return;
|
|
3327
|
+
const L = (_) => {
|
|
3328
|
+
var b, S;
|
|
3329
|
+
const h = _.detail;
|
|
3330
|
+
if (h) {
|
|
3331
|
+
if (h.phase === "field") {
|
|
3332
|
+
if (u.current !== "all" && h.source !== u.current)
|
|
3333
|
+
return;
|
|
3334
|
+
a(!0), l(
|
|
3335
|
+
(T) => T[h.fieldName] === h.value ? T : { ...T, [h.fieldName]: h.value }
|
|
3336
|
+
);
|
|
3337
|
+
try {
|
|
3338
|
+
(b = v.current) == null || b.call(v, h);
|
|
3339
|
+
} catch (T) {
|
|
3340
|
+
console.warn("[LiveLayer] useCollect onFieldUpdate threw.", T);
|
|
3341
|
+
}
|
|
3342
|
+
return;
|
|
3221
3343
|
}
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3344
|
+
if (h.phase === "complete") {
|
|
3345
|
+
const T = h.result;
|
|
3346
|
+
if (u.current !== "all" && T.source !== u.current)
|
|
3347
|
+
return;
|
|
3348
|
+
p(T), a(!1);
|
|
3349
|
+
try {
|
|
3350
|
+
(S = f.current) == null || S.call(f, T);
|
|
3351
|
+
} catch (A) {
|
|
3352
|
+
console.warn("[LiveLayer] useCollect onComplete threw.", A);
|
|
3353
|
+
}
|
|
3231
3354
|
}
|
|
3232
|
-
|
|
3233
|
-
}
|
|
3234
|
-
return
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
);
|
|
3240
|
-
let hn = 1;
|
|
3241
|
-
function bo({
|
|
3355
|
+
}
|
|
3356
|
+
};
|
|
3357
|
+
return document.addEventListener("ll-collected", L), () => document.removeEventListener("ll-collected", L);
|
|
3358
|
+
}, []), { fields: i, isCollecting: c, lastResult: s, reset: I };
|
|
3359
|
+
}
|
|
3360
|
+
let bn = 1;
|
|
3361
|
+
function So({
|
|
3242
3362
|
onMount: e,
|
|
3243
3363
|
defaultOpen: t = !1,
|
|
3244
3364
|
storageKey: r = "ll-debug-open"
|
|
3245
3365
|
}) {
|
|
3246
|
-
const [o, i] =
|
|
3247
|
-
|
|
3366
|
+
const [o, i] = E(t), [l, c] = E([]), [a, s] = E(""), [p, v] = E(!1), f = N(/* @__PURE__ */ new Set()), u = N([]), I = N(p);
|
|
3367
|
+
I.current = p, R(() => {
|
|
3248
3368
|
try {
|
|
3249
|
-
const
|
|
3250
|
-
|
|
3369
|
+
const h = localStorage.getItem(r);
|
|
3370
|
+
h === "1" && i(!0), h === "0" && i(!1);
|
|
3251
3371
|
} catch {
|
|
3252
3372
|
}
|
|
3253
|
-
}, [r]),
|
|
3373
|
+
}, [r]), R(() => {
|
|
3254
3374
|
try {
|
|
3255
3375
|
localStorage.setItem(r, o ? "1" : "0");
|
|
3256
3376
|
} catch {
|
|
3257
3377
|
}
|
|
3258
|
-
}, [o, r]),
|
|
3259
|
-
const
|
|
3378
|
+
}, [o, r]), R(() => {
|
|
3379
|
+
const h = (b) => {
|
|
3260
3380
|
(b.metaKey || b.ctrlKey) && b.shiftKey && b.key.toLowerCase() === "l" && (b.preventDefault(), i((S) => !S));
|
|
3261
3381
|
};
|
|
3262
|
-
return window.addEventListener("keydown",
|
|
3263
|
-
}, []),
|
|
3264
|
-
const
|
|
3265
|
-
if (
|
|
3266
|
-
const b =
|
|
3267
|
-
|
|
3382
|
+
return window.addEventListener("keydown", h), () => window.removeEventListener("keydown", h);
|
|
3383
|
+
}, []), R(() => {
|
|
3384
|
+
const h = setInterval(() => {
|
|
3385
|
+
if (u.current.length === 0 || I.current) return;
|
|
3386
|
+
const b = u.current.splice(0, u.current.length);
|
|
3387
|
+
c(
|
|
3268
3388
|
(S) => [...b.reverse(), ...S].slice(0, 200)
|
|
3269
3389
|
);
|
|
3270
3390
|
}, 100);
|
|
3271
|
-
return () => clearInterval(
|
|
3391
|
+
return () => clearInterval(h);
|
|
3272
3392
|
}, []);
|
|
3273
|
-
const
|
|
3274
|
-
if (
|
|
3275
|
-
!e ||
|
|
3276
|
-
|
|
3277
|
-
id:
|
|
3393
|
+
const L = N(!1);
|
|
3394
|
+
if (R(() => {
|
|
3395
|
+
!e || L.current || (L.current = !0, e((h) => {
|
|
3396
|
+
u.current.push({
|
|
3397
|
+
id: bn++,
|
|
3278
3398
|
ts: Date.now(),
|
|
3279
3399
|
kind: "event",
|
|
3280
|
-
type:
|
|
3281
|
-
data:
|
|
3400
|
+
type: h.eventName,
|
|
3401
|
+
data: h.data
|
|
3282
3402
|
});
|
|
3283
3403
|
}));
|
|
3284
|
-
}, [e]),
|
|
3285
|
-
const
|
|
3404
|
+
}, [e]), R(() => {
|
|
3405
|
+
const h = console.warn, b = console.log, S = (T, A) => function(...F) {
|
|
3286
3406
|
try {
|
|
3287
|
-
const
|
|
3288
|
-
|
|
3289
|
-
id:
|
|
3407
|
+
const g = typeof F[0] == "string" ? F[0] : "";
|
|
3408
|
+
g.startsWith("[LiveLayer]") && u.current.push({
|
|
3409
|
+
id: bn++,
|
|
3290
3410
|
ts: Date.now(),
|
|
3291
|
-
kind:
|
|
3292
|
-
type:
|
|
3293
|
-
data: { args:
|
|
3411
|
+
kind: T,
|
|
3412
|
+
type: g.slice(0, 120),
|
|
3413
|
+
data: { args: F.slice(1).map((P) => go(P)) }
|
|
3294
3414
|
});
|
|
3295
3415
|
} catch {
|
|
3296
3416
|
}
|
|
3297
|
-
return
|
|
3417
|
+
return A.apply(this, F);
|
|
3298
3418
|
};
|
|
3299
|
-
return console.warn = S("warn",
|
|
3300
|
-
console.warn =
|
|
3419
|
+
return console.warn = S("warn", h), console.log = S("log", b), () => {
|
|
3420
|
+
console.warn = h, console.log = b;
|
|
3301
3421
|
};
|
|
3302
3422
|
}, []), !o)
|
|
3303
3423
|
return /* @__PURE__ */ n(
|
|
@@ -3326,12 +3446,12 @@ function bo({
|
|
|
3326
3446
|
children: "🛰 LL debug"
|
|
3327
3447
|
}
|
|
3328
3448
|
);
|
|
3329
|
-
const _ = l.filter((
|
|
3449
|
+
const _ = l.filter((h) => {
|
|
3330
3450
|
if (!a) return !0;
|
|
3331
3451
|
const b = a.toLowerCase();
|
|
3332
|
-
return
|
|
3452
|
+
return h.type.toLowerCase().includes(b) || JSON.stringify(h.data || {}).toLowerCase().includes(b);
|
|
3333
3453
|
});
|
|
3334
|
-
return /* @__PURE__ */
|
|
3454
|
+
return /* @__PURE__ */ w(
|
|
3335
3455
|
"div",
|
|
3336
3456
|
{
|
|
3337
3457
|
style: {
|
|
@@ -3353,7 +3473,7 @@ function bo({
|
|
|
3353
3473
|
overflow: "hidden"
|
|
3354
3474
|
},
|
|
3355
3475
|
children: [
|
|
3356
|
-
/* @__PURE__ */
|
|
3476
|
+
/* @__PURE__ */ w(
|
|
3357
3477
|
"div",
|
|
3358
3478
|
{
|
|
3359
3479
|
style: {
|
|
@@ -3366,7 +3486,7 @@ function bo({
|
|
|
3366
3486
|
},
|
|
3367
3487
|
children: [
|
|
3368
3488
|
/* @__PURE__ */ n("span", { style: { fontWeight: 600, fontSize: 12 }, children: "LiveLayer debug" }),
|
|
3369
|
-
/* @__PURE__ */
|
|
3489
|
+
/* @__PURE__ */ w("span", { style: { fontSize: 10, color: "rgba(255,255,255,0.4)" }, children: [
|
|
3370
3490
|
l.length,
|
|
3371
3491
|
" event",
|
|
3372
3492
|
l.length === 1 ? "" : "s"
|
|
@@ -3376,10 +3496,10 @@ function bo({
|
|
|
3376
3496
|
"button",
|
|
3377
3497
|
{
|
|
3378
3498
|
type: "button",
|
|
3379
|
-
onClick: () =>
|
|
3380
|
-
style:
|
|
3499
|
+
onClick: () => v((h) => !h),
|
|
3500
|
+
style: Tt(p ? "#f59e0b" : "transparent"),
|
|
3381
3501
|
title: "Pause / resume capture",
|
|
3382
|
-
children:
|
|
3502
|
+
children: p ? "▶ resume" : "⏸ pause"
|
|
3383
3503
|
}
|
|
3384
3504
|
),
|
|
3385
3505
|
/* @__PURE__ */ n(
|
|
@@ -3387,9 +3507,9 @@ function bo({
|
|
|
3387
3507
|
{
|
|
3388
3508
|
type: "button",
|
|
3389
3509
|
onClick: () => {
|
|
3390
|
-
|
|
3510
|
+
c([]), u.current = [];
|
|
3391
3511
|
},
|
|
3392
|
-
style:
|
|
3512
|
+
style: Tt("transparent"),
|
|
3393
3513
|
title: "Clear buffer",
|
|
3394
3514
|
children: "clear"
|
|
3395
3515
|
}
|
|
@@ -3399,7 +3519,7 @@ function bo({
|
|
|
3399
3519
|
{
|
|
3400
3520
|
type: "button",
|
|
3401
3521
|
onClick: () => i(!1),
|
|
3402
|
-
style:
|
|
3522
|
+
style: Tt("transparent"),
|
|
3403
3523
|
"aria-label": "Close",
|
|
3404
3524
|
title: "Close (Cmd/Ctrl + Shift + L)",
|
|
3405
3525
|
children: "✕"
|
|
@@ -3413,7 +3533,7 @@ function bo({
|
|
|
3413
3533
|
{
|
|
3414
3534
|
type: "text",
|
|
3415
3535
|
value: a,
|
|
3416
|
-
onChange: (
|
|
3536
|
+
onChange: (h) => s(h.target.value),
|
|
3417
3537
|
placeholder: "filter by type or data…",
|
|
3418
3538
|
style: {
|
|
3419
3539
|
margin: 8,
|
|
@@ -3435,7 +3555,7 @@ function bo({
|
|
|
3435
3555
|
overflowY: "auto",
|
|
3436
3556
|
padding: "0 8px 8px"
|
|
3437
3557
|
},
|
|
3438
|
-
children: _.length === 0 ? /* @__PURE__ */
|
|
3558
|
+
children: _.length === 0 ? /* @__PURE__ */ w(
|
|
3439
3559
|
"div",
|
|
3440
3560
|
{
|
|
3441
3561
|
style: {
|
|
@@ -3465,16 +3585,16 @@ function bo({
|
|
|
3465
3585
|
)
|
|
3466
3586
|
]
|
|
3467
3587
|
}
|
|
3468
|
-
) : _.map((
|
|
3469
|
-
|
|
3588
|
+
) : _.map((h) => /* @__PURE__ */ n(
|
|
3589
|
+
mo,
|
|
3470
3590
|
{
|
|
3471
|
-
entry:
|
|
3472
|
-
expanded: f.current.has(
|
|
3591
|
+
entry: h,
|
|
3592
|
+
expanded: f.current.has(h.id),
|
|
3473
3593
|
onToggle: () => {
|
|
3474
|
-
f.current.has(
|
|
3594
|
+
f.current.has(h.id) ? f.current.delete(h.id) : f.current.add(h.id), c((b) => [...b]);
|
|
3475
3595
|
}
|
|
3476
3596
|
},
|
|
3477
|
-
|
|
3597
|
+
h.id
|
|
3478
3598
|
))
|
|
3479
3599
|
}
|
|
3480
3600
|
)
|
|
@@ -3482,7 +3602,7 @@ function bo({
|
|
|
3482
3602
|
}
|
|
3483
3603
|
);
|
|
3484
3604
|
}
|
|
3485
|
-
function
|
|
3605
|
+
function mo({
|
|
3486
3606
|
entry: e,
|
|
3487
3607
|
expanded: t,
|
|
3488
3608
|
onToggle: r
|
|
@@ -3490,7 +3610,7 @@ function io({
|
|
|
3490
3610
|
const o = 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", i = new Date(e.ts).toLocaleTimeString("en-US", {
|
|
3491
3611
|
hour12: !1
|
|
3492
3612
|
});
|
|
3493
|
-
return /* @__PURE__ */
|
|
3613
|
+
return /* @__PURE__ */ w(
|
|
3494
3614
|
"button",
|
|
3495
3615
|
{
|
|
3496
3616
|
type: "button",
|
|
@@ -3508,7 +3628,7 @@ function io({
|
|
|
3508
3628
|
lineHeight: 1.4
|
|
3509
3629
|
},
|
|
3510
3630
|
children: [
|
|
3511
|
-
/* @__PURE__ */
|
|
3631
|
+
/* @__PURE__ */ w("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
|
|
3512
3632
|
/* @__PURE__ */ n(
|
|
3513
3633
|
"span",
|
|
3514
3634
|
{
|
|
@@ -3552,7 +3672,7 @@ function io({
|
|
|
3552
3672
|
}
|
|
3553
3673
|
);
|
|
3554
3674
|
}
|
|
3555
|
-
function
|
|
3675
|
+
function Tt(e) {
|
|
3556
3676
|
return {
|
|
3557
3677
|
background: e,
|
|
3558
3678
|
color: "#fff",
|
|
@@ -3563,24 +3683,24 @@ function Rt(e) {
|
|
|
3563
3683
|
cursor: "pointer"
|
|
3564
3684
|
};
|
|
3565
3685
|
}
|
|
3566
|
-
function
|
|
3686
|
+
function go(e) {
|
|
3567
3687
|
try {
|
|
3568
3688
|
return e instanceof Error ? { message: e.message, stack: e.stack } : (JSON.stringify(e), e);
|
|
3569
3689
|
} catch {
|
|
3570
3690
|
return String(e);
|
|
3571
3691
|
}
|
|
3572
3692
|
}
|
|
3573
|
-
function
|
|
3574
|
-
const [e, t] =
|
|
3693
|
+
function No() {
|
|
3694
|
+
const [e, t] = E([]), r = C((i) => {
|
|
3575
3695
|
t((l) => {
|
|
3576
|
-
const
|
|
3577
|
-
if (
|
|
3696
|
+
const c = l.findIndex((a) => a.id === i.id);
|
|
3697
|
+
if (c >= 0) {
|
|
3578
3698
|
const a = l.slice();
|
|
3579
|
-
return a[
|
|
3699
|
+
return a[c] = i, a;
|
|
3580
3700
|
}
|
|
3581
3701
|
return [...l, i];
|
|
3582
3702
|
});
|
|
3583
|
-
}, []), o =
|
|
3703
|
+
}, []), o = C(() => t([]), []);
|
|
3584
3704
|
return {
|
|
3585
3705
|
entries: e,
|
|
3586
3706
|
pushSegment: r,
|
|
@@ -3589,33 +3709,32 @@ function wo() {
|
|
|
3589
3709
|
};
|
|
3590
3710
|
}
|
|
3591
3711
|
export {
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
wo as useTranscript
|
|
3712
|
+
ho as AvatarWidget,
|
|
3713
|
+
Kn as ErrorBoundary,
|
|
3714
|
+
So as LiveLayerDebugPanel,
|
|
3715
|
+
Co as LiveLayerRegion,
|
|
3716
|
+
Lo as LiveLayerWidget,
|
|
3717
|
+
Xr as clearPageContextCache,
|
|
3718
|
+
ro as clearRoutesCache,
|
|
3719
|
+
Kr as extractPageContext,
|
|
3720
|
+
to as extractRoutes,
|
|
3721
|
+
gn as getCachedPageContext,
|
|
3722
|
+
Mt as getCachedRoutes,
|
|
3723
|
+
br as matchesPattern,
|
|
3724
|
+
Zr as normalizeRouteInput,
|
|
3725
|
+
wr as shouldRenderAtPath,
|
|
3726
|
+
or as useAgentInfo,
|
|
3727
|
+
Qn as useAudioLevel,
|
|
3728
|
+
tr as useCameraState,
|
|
3729
|
+
Eo as useCollect,
|
|
3730
|
+
ar as useDisplayMode,
|
|
3731
|
+
dr as useDisplayModePersistence,
|
|
3732
|
+
fr as useIsMobile,
|
|
3733
|
+
Xn as useLiveKitSession,
|
|
3734
|
+
rr as useMediaDevices,
|
|
3735
|
+
Zn as useMicrophoneState,
|
|
3736
|
+
hr as usePathname,
|
|
3737
|
+
_r as useRouteMatch,
|
|
3738
|
+
nr as useScreenShareState,
|
|
3739
|
+
No as useTranscript
|
|
3621
3740
|
};
|