@livelayer/react 0.5.22 → 0.5.24-debug.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -3
- package/dist/index.mjs +1045 -997
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as _, jsx as n, Fragment as
|
|
3
|
-
import { Component as mn, useState as S, useRef as
|
|
2
|
+
import { jsxs as _, jsx as n, Fragment as St } from "react/jsx-runtime";
|
|
3
|
+
import { Component as mn, useState as S, useRef as M, useEffect as R, useCallback as L, useMemo as ut, forwardRef as Et, createElement as gn } from "react";
|
|
4
4
|
import { LiveKitSession as yn } from "@livelayer/sdk";
|
|
5
5
|
import { createLocalAudioTrack as vn, Track as en, createLocalVideoTrack as bn } from "livekit-client";
|
|
6
6
|
class wn extends mn {
|
|
@@ -13,8 +13,8 @@ class wn extends mn {
|
|
|
13
13
|
return { hasError: !0, error: t };
|
|
14
14
|
}
|
|
15
15
|
componentDidCatch(t, r) {
|
|
16
|
-
var
|
|
17
|
-
(
|
|
16
|
+
var o, i;
|
|
17
|
+
(i = (o = this.props).onError) == null || i.call(o, t, r);
|
|
18
18
|
}
|
|
19
19
|
render() {
|
|
20
20
|
var t;
|
|
@@ -34,25 +34,25 @@ class wn extends mn {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
function _n(e) {
|
|
37
|
-
const [t, r] = S("idle"), [
|
|
38
|
-
|
|
39
|
-
const
|
|
37
|
+
const [t, r] = S("idle"), [o, i] = S("idle"), [l, d] = S([]), [u, f] = S(null), [y, b] = S(null), [s, a] = S(null), [k, N] = S(!1), [E, v] = S(null), w = M(null), O = M(e.onDataMessage);
|
|
38
|
+
O.current = e.onDataMessage, R(() => {
|
|
39
|
+
const D = {
|
|
40
40
|
onConnectionStateChange: (z) => {
|
|
41
41
|
r(z), z === "connected" && v(null);
|
|
42
42
|
},
|
|
43
|
-
onAgentStateChange:
|
|
44
|
-
onTranscript: (z) =>
|
|
43
|
+
onAgentStateChange: i,
|
|
44
|
+
onTranscript: (z) => d([...z]),
|
|
45
45
|
onAgentConfig: f,
|
|
46
46
|
onAudioTrack: (z) => a(z),
|
|
47
47
|
onVideoTrack: (z) => b(z),
|
|
48
48
|
onVideoTrackRemoved: () => b(null),
|
|
49
49
|
onError: (z) => v(z),
|
|
50
50
|
onDataMessage: (z) => {
|
|
51
|
-
var
|
|
52
|
-
(
|
|
51
|
+
var T;
|
|
52
|
+
(T = O.current) == null || T.call(O, z);
|
|
53
53
|
},
|
|
54
|
-
onResumabilityChange:
|
|
55
|
-
},
|
|
54
|
+
onResumabilityChange: N
|
|
55
|
+
}, V = new yn(
|
|
56
56
|
{
|
|
57
57
|
agentId: e.agentId,
|
|
58
58
|
baseUrl: e.baseUrl,
|
|
@@ -60,11 +60,11 @@ function _n(e) {
|
|
|
60
60
|
sessionEndpoint: e.sessionEndpoint,
|
|
61
61
|
sessionBody: e.sessionBody
|
|
62
62
|
},
|
|
63
|
-
|
|
63
|
+
D
|
|
64
64
|
);
|
|
65
|
-
return w.current =
|
|
65
|
+
return w.current = V, r("idle"), i("idle"), d([]), f(null), b(null), a(null), N(!1), v(null), () => {
|
|
66
66
|
var z;
|
|
67
|
-
(z =
|
|
67
|
+
(z = V.destroy) == null || z.call(V), w.current = null;
|
|
68
68
|
};
|
|
69
69
|
}, [
|
|
70
70
|
e.agentId,
|
|
@@ -73,41 +73,41 @@ function _n(e) {
|
|
|
73
73
|
e.sessionEndpoint,
|
|
74
74
|
JSON.stringify(e.sessionBody ?? {})
|
|
75
75
|
]);
|
|
76
|
-
const
|
|
77
|
-
const
|
|
78
|
-
if (
|
|
76
|
+
const $ = L(async () => {
|
|
77
|
+
const D = w.current;
|
|
78
|
+
if (D)
|
|
79
79
|
try {
|
|
80
|
-
await
|
|
81
|
-
} catch (
|
|
82
|
-
throw v(
|
|
80
|
+
await D.connect();
|
|
81
|
+
} catch (V) {
|
|
82
|
+
throw v(V instanceof Error ? V.message : String(V)), V;
|
|
83
83
|
}
|
|
84
|
-
}, []),
|
|
85
|
-
const
|
|
86
|
-
|
|
84
|
+
}, []), U = L(() => {
|
|
85
|
+
const D = w.current;
|
|
86
|
+
D && D.disconnect();
|
|
87
87
|
}, []), m = L(() => {
|
|
88
|
-
var
|
|
89
|
-
return ((
|
|
88
|
+
var D;
|
|
89
|
+
return ((D = w.current) == null ? void 0 : D.getRoom()) ?? null;
|
|
90
90
|
}, []);
|
|
91
91
|
return {
|
|
92
92
|
connectionState: t,
|
|
93
|
-
agentState:
|
|
93
|
+
agentState: o,
|
|
94
94
|
transcript: l,
|
|
95
95
|
agentConfig: u,
|
|
96
96
|
videoElement: y,
|
|
97
97
|
audioElement: s,
|
|
98
|
-
canResume:
|
|
99
|
-
error:
|
|
100
|
-
connect:
|
|
101
|
-
disconnect:
|
|
98
|
+
canResume: k,
|
|
99
|
+
error: E,
|
|
100
|
+
connect: $,
|
|
101
|
+
disconnect: U,
|
|
102
102
|
getRoom: m,
|
|
103
103
|
session: w.current
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
106
|
function xn() {
|
|
107
|
-
const e =
|
|
107
|
+
const e = M(null), t = M(null), r = M(null), o = M(null), i = M(/* @__PURE__ */ new Set()), l = M(null), d = L(() => {
|
|
108
108
|
const s = t.current;
|
|
109
109
|
if (!s) {
|
|
110
|
-
|
|
110
|
+
o.current = null;
|
|
111
111
|
return;
|
|
112
112
|
}
|
|
113
113
|
(!l.current || l.current.length !== s.frequencyBinCount) && (l.current = new Uint8Array(
|
|
@@ -115,16 +115,16 @@ function xn() {
|
|
|
115
115
|
));
|
|
116
116
|
const a = l.current;
|
|
117
117
|
s.getByteFrequencyData(a);
|
|
118
|
-
let
|
|
119
|
-
for (let
|
|
120
|
-
const
|
|
121
|
-
for (const
|
|
118
|
+
let k = 0;
|
|
119
|
+
for (let E = 0; E < a.length; E++) k += a[E];
|
|
120
|
+
const N = k / a.length / 255;
|
|
121
|
+
for (const E of i.current)
|
|
122
122
|
try {
|
|
123
|
-
|
|
123
|
+
E(N);
|
|
124
124
|
} catch (v) {
|
|
125
125
|
console.error("[useAudioLevel] subscriber threw:", v);
|
|
126
126
|
}
|
|
127
|
-
|
|
127
|
+
o.current = requestAnimationFrame(d);
|
|
128
128
|
}, []), u = L(() => {
|
|
129
129
|
if (e.current || typeof window > "u" || typeof AudioContext > "u") return;
|
|
130
130
|
const s = new AudioContext(), a = s.createAnalyser();
|
|
@@ -146,22 +146,22 @@ function xn() {
|
|
|
146
146
|
console.warn("[useAudioLevel] createMediaElementSource failed:", a);
|
|
147
147
|
return;
|
|
148
148
|
}
|
|
149
|
-
|
|
149
|
+
o.current === null && (o.current = requestAnimationFrame(d));
|
|
150
150
|
}
|
|
151
151
|
},
|
|
152
|
-
[u,
|
|
152
|
+
[u, d]
|
|
153
153
|
), y = L(() => {
|
|
154
|
-
if (
|
|
154
|
+
if (o.current !== null && (cancelAnimationFrame(o.current), o.current = null), r.current) {
|
|
155
155
|
try {
|
|
156
156
|
r.current.disconnect();
|
|
157
157
|
} catch {
|
|
158
158
|
}
|
|
159
159
|
r.current = null;
|
|
160
160
|
}
|
|
161
|
-
}, []), b = L((s) => (
|
|
162
|
-
|
|
161
|
+
}, []), b = L((s) => (i.current.add(s), () => {
|
|
162
|
+
i.current.delete(s);
|
|
163
163
|
}), []);
|
|
164
|
-
return
|
|
164
|
+
return R(() => () => {
|
|
165
165
|
if (y(), t.current) {
|
|
166
166
|
try {
|
|
167
167
|
t.current.disconnect();
|
|
@@ -176,40 +176,40 @@ function xn() {
|
|
|
176
176
|
}
|
|
177
177
|
e.current = null;
|
|
178
178
|
}
|
|
179
|
-
|
|
179
|
+
i.current.clear(), l.current = null;
|
|
180
180
|
}, [y]), { attach: f, detach: y, subscribe: b };
|
|
181
181
|
}
|
|
182
182
|
function kn() {
|
|
183
|
-
const [e, t] = S(!1), [r,
|
|
183
|
+
const [e, t] = S(!1), [r, o] = S(null), i = M(null), l = M(null), d = L(
|
|
184
184
|
async (s, a) => {
|
|
185
|
-
if (
|
|
185
|
+
if (i.current && l.current) {
|
|
186
186
|
try {
|
|
187
|
-
await l.current.localParticipant.unpublishTrack(
|
|
187
|
+
await l.current.localParticipant.unpublishTrack(i.current);
|
|
188
188
|
} catch {
|
|
189
189
|
}
|
|
190
|
-
|
|
190
|
+
i.current.stop(), i.current = null;
|
|
191
191
|
}
|
|
192
|
-
l.current = s,
|
|
192
|
+
l.current = s, o(null);
|
|
193
193
|
try {
|
|
194
|
-
const
|
|
194
|
+
const k = await vn({
|
|
195
195
|
echoCancellation: !0,
|
|
196
196
|
noiseSuppression: !0
|
|
197
197
|
});
|
|
198
|
-
a != null && a.startMuted && await
|
|
199
|
-
} catch (
|
|
200
|
-
const
|
|
201
|
-
throw
|
|
198
|
+
a != null && a.startMuted && await k.mute(), await s.localParticipant.publishTrack(k), i.current = k, t(k.isMuted);
|
|
199
|
+
} catch (k) {
|
|
200
|
+
const N = k instanceof Error && k.name === "NotAllowedError" ? "Enable your microphone to talk with the agent." : "Microphone unavailable. Check browser permissions and try again.";
|
|
201
|
+
throw o(N), k;
|
|
202
202
|
}
|
|
203
203
|
},
|
|
204
204
|
[]
|
|
205
205
|
), u = L(() => {
|
|
206
|
-
const s =
|
|
206
|
+
const s = i.current;
|
|
207
207
|
s && (s.isMuted ? (s.unmute(), t(!1)) : (s.mute(), t(!0)));
|
|
208
208
|
}, []), f = L((s) => {
|
|
209
|
-
const a =
|
|
209
|
+
const a = i.current;
|
|
210
210
|
a && (s && !a.isMuted ? (a.mute(), t(!0)) : !s && a.isMuted && (a.unmute(), t(!1)));
|
|
211
211
|
}, []), y = L(() => {
|
|
212
|
-
const s =
|
|
212
|
+
const s = i.current, a = l.current;
|
|
213
213
|
if (s && a) {
|
|
214
214
|
try {
|
|
215
215
|
a.localParticipant.unpublishTrack(s);
|
|
@@ -217,85 +217,85 @@ function kn() {
|
|
|
217
217
|
}
|
|
218
218
|
s.stop();
|
|
219
219
|
}
|
|
220
|
-
|
|
221
|
-
}, []), b = L(() =>
|
|
220
|
+
i.current = null, l.current = null, t(!1);
|
|
221
|
+
}, []), b = L(() => o(null), []);
|
|
222
222
|
return {
|
|
223
223
|
isMuted: e,
|
|
224
224
|
micError: r,
|
|
225
225
|
toggleMute: u,
|
|
226
226
|
setMuted: f,
|
|
227
|
-
setupMic:
|
|
227
|
+
setupMic: d,
|
|
228
228
|
teardownMic: y,
|
|
229
229
|
clearError: b
|
|
230
230
|
};
|
|
231
231
|
}
|
|
232
232
|
const Ln = { resolution: { width: 640, height: 480, frameRate: 24 } };
|
|
233
233
|
function Sn() {
|
|
234
|
-
const [e, t] = S(!1), [r,
|
|
234
|
+
const [e, t] = S(!1), [r, o] = S(null), [i, l] = S(null), [d, u] = S(""), f = M(null), y = M(null), b = L((w) => {
|
|
235
235
|
f.current = w;
|
|
236
236
|
}, []), s = L(() => {
|
|
237
|
-
const w = f.current,
|
|
238
|
-
if (
|
|
239
|
-
const
|
|
240
|
-
if (
|
|
237
|
+
const w = f.current, O = y.current;
|
|
238
|
+
if (O && w) {
|
|
239
|
+
const $ = w.localParticipant.getTrackPublication(en.Source.Camera);
|
|
240
|
+
if ($ != null && $.track) {
|
|
241
241
|
try {
|
|
242
|
-
w.localParticipant.unpublishTrack(
|
|
242
|
+
w.localParticipant.unpublishTrack($.track);
|
|
243
243
|
} catch {
|
|
244
244
|
}
|
|
245
|
-
|
|
245
|
+
$.track.stop();
|
|
246
246
|
} else
|
|
247
|
-
|
|
247
|
+
O.stop();
|
|
248
248
|
}
|
|
249
249
|
y.current = null, l(null), t(!1);
|
|
250
250
|
}, []), a = L(async (w) => {
|
|
251
|
-
const
|
|
252
|
-
if (
|
|
253
|
-
|
|
251
|
+
const O = f.current;
|
|
252
|
+
if (O) {
|
|
253
|
+
o(null);
|
|
254
254
|
try {
|
|
255
|
-
const
|
|
256
|
-
w && (
|
|
257
|
-
const
|
|
258
|
-
await
|
|
259
|
-
const m =
|
|
255
|
+
const $ = { ...Ln };
|
|
256
|
+
w && ($.deviceId = w);
|
|
257
|
+
const U = await bn($);
|
|
258
|
+
await O.localParticipant.publishTrack(U), y.current = U;
|
|
259
|
+
const m = U.attach();
|
|
260
260
|
l(m), t(!0), w && u(w);
|
|
261
261
|
try {
|
|
262
|
-
|
|
262
|
+
O.localParticipant.publishData(
|
|
263
263
|
new TextEncoder().encode(JSON.stringify({ type: "user_camera_on" })),
|
|
264
264
|
{ reliable: !0 }
|
|
265
265
|
);
|
|
266
266
|
} catch {
|
|
267
267
|
}
|
|
268
|
-
} catch (
|
|
269
|
-
const
|
|
270
|
-
|
|
268
|
+
} catch ($) {
|
|
269
|
+
const U = $ instanceof Error && $.name === "NotAllowedError" ? "Enable your camera in the browser to share video." : "Camera unavailable. Check permissions and try again.";
|
|
270
|
+
o(U);
|
|
271
271
|
}
|
|
272
272
|
}
|
|
273
|
-
}, []),
|
|
274
|
-
e ? s() : await a(
|
|
275
|
-
}, [e,
|
|
273
|
+
}, []), k = L(async () => {
|
|
274
|
+
e ? s() : await a(d || void 0);
|
|
275
|
+
}, [e, d, s, a]), N = L(async (w) => {
|
|
276
276
|
s(), await a(w);
|
|
277
|
-
}, [s, a]),
|
|
278
|
-
s(), f.current = null,
|
|
279
|
-
}, [s]), v = L(() =>
|
|
280
|
-
return
|
|
277
|
+
}, [s, a]), E = L(() => {
|
|
278
|
+
s(), f.current = null, o(null), u("");
|
|
279
|
+
}, [s]), v = L(() => o(null), []);
|
|
280
|
+
return R(() => () => {
|
|
281
281
|
y.current && y.current.stop();
|
|
282
282
|
}, []), {
|
|
283
283
|
isEnabled: e,
|
|
284
284
|
error: r,
|
|
285
|
-
previewEl:
|
|
286
|
-
activeDeviceId:
|
|
287
|
-
toggle:
|
|
288
|
-
switchDevice:
|
|
285
|
+
previewEl: i,
|
|
286
|
+
activeDeviceId: d,
|
|
287
|
+
toggle: k,
|
|
288
|
+
switchDevice: N,
|
|
289
289
|
attachRoom: b,
|
|
290
|
-
teardown:
|
|
290
|
+
teardown: E,
|
|
291
291
|
clearError: v
|
|
292
292
|
};
|
|
293
293
|
}
|
|
294
|
-
function
|
|
295
|
-
const [e, t] = S(!1), [r,
|
|
296
|
-
|
|
294
|
+
function En() {
|
|
295
|
+
const [e, t] = S(!1), [r, o] = S(null), [i, l] = S(null), d = M(null), u = L((a) => {
|
|
296
|
+
d.current = a;
|
|
297
297
|
}, []), f = L(() => l(null), []), y = L(async () => {
|
|
298
|
-
const a =
|
|
298
|
+
const a = d.current;
|
|
299
299
|
if (a) {
|
|
300
300
|
if (e) {
|
|
301
301
|
try {
|
|
@@ -305,14 +305,14 @@ function Cn() {
|
|
|
305
305
|
f(), t(!1);
|
|
306
306
|
return;
|
|
307
307
|
}
|
|
308
|
-
|
|
308
|
+
o(null);
|
|
309
309
|
try {
|
|
310
310
|
await a.localParticipant.setScreenShareEnabled(!0);
|
|
311
|
-
let
|
|
312
|
-
const
|
|
313
|
-
const
|
|
314
|
-
if (
|
|
315
|
-
const v =
|
|
311
|
+
let k = 0;
|
|
312
|
+
const N = () => {
|
|
313
|
+
const E = a.localParticipant.getTrackPublication(en.Source.ScreenShare);
|
|
314
|
+
if (E != null && E.track) {
|
|
315
|
+
const v = E.track.attach();
|
|
316
316
|
l(v), t(!0);
|
|
317
317
|
try {
|
|
318
318
|
a.localParticipant.publishData(
|
|
@@ -323,49 +323,49 @@ function Cn() {
|
|
|
323
323
|
}
|
|
324
324
|
return;
|
|
325
325
|
}
|
|
326
|
-
|
|
326
|
+
k++ < 10 ? setTimeout(N, 100) : t(!0);
|
|
327
327
|
};
|
|
328
|
-
|
|
329
|
-
} catch (
|
|
330
|
-
const
|
|
331
|
-
|
|
328
|
+
N();
|
|
329
|
+
} catch (k) {
|
|
330
|
+
const N = k instanceof Error ? k.name : "";
|
|
331
|
+
N !== "NotAllowedError" && N !== "AbortError" && o("Screen share unavailable. Try again."), t(!1);
|
|
332
332
|
}
|
|
333
333
|
}
|
|
334
334
|
}, [e, f]), b = L(() => {
|
|
335
|
-
const a =
|
|
335
|
+
const a = d.current;
|
|
336
336
|
if (a && e)
|
|
337
337
|
try {
|
|
338
338
|
a.localParticipant.setScreenShareEnabled(!1);
|
|
339
339
|
} catch {
|
|
340
340
|
}
|
|
341
|
-
f(), t(!1),
|
|
342
|
-
}, [e, f]), s = L(() =>
|
|
343
|
-
return { isEnabled: e, error: r, previewEl:
|
|
341
|
+
f(), t(!1), o(null), d.current = null;
|
|
342
|
+
}, [e, f]), s = L(() => o(null), []);
|
|
343
|
+
return { isEnabled: e, error: r, previewEl: i, toggle: y, attachRoom: u, teardown: b, clearError: s };
|
|
344
344
|
}
|
|
345
|
-
function
|
|
346
|
-
const [e, t] = S([]), [r,
|
|
345
|
+
function Cn() {
|
|
346
|
+
const [e, t] = S([]), [r, o] = S([]), i = L(async () => {
|
|
347
347
|
if (!(typeof navigator > "u" || !navigator.mediaDevices))
|
|
348
348
|
try {
|
|
349
349
|
const l = await navigator.mediaDevices.enumerateDevices();
|
|
350
|
-
t(l.filter((
|
|
350
|
+
t(l.filter((d) => d.kind === "audioinput")), o(l.filter((d) => d.kind === "videoinput"));
|
|
351
351
|
} catch {
|
|
352
352
|
}
|
|
353
353
|
}, []);
|
|
354
|
-
return
|
|
355
|
-
if (
|
|
356
|
-
const l = () => void
|
|
354
|
+
return R(() => {
|
|
355
|
+
if (i(), typeof navigator > "u" || !navigator.mediaDevices) return;
|
|
356
|
+
const l = () => void i();
|
|
357
357
|
return navigator.mediaDevices.addEventListener("devicechange", l), () => navigator.mediaDevices.removeEventListener("devicechange", l);
|
|
358
|
-
}, [
|
|
358
|
+
}, [i]), { mics: e, cameras: r, refresh: i };
|
|
359
359
|
}
|
|
360
360
|
function Nn(e, t, r = !1) {
|
|
361
|
-
const [
|
|
362
|
-
return
|
|
361
|
+
const [o, i] = S(null), [l, d] = S(null), [u, f] = S(!r && !!e);
|
|
362
|
+
return R(() => {
|
|
363
363
|
if (r || !e) {
|
|
364
364
|
f(!1);
|
|
365
365
|
return;
|
|
366
366
|
}
|
|
367
367
|
const y = new AbortController(), b = t || "https://app.livelayer.studio";
|
|
368
|
-
return f(!0),
|
|
368
|
+
return f(!0), d(null), fetch(`${b}/api/widget/agent/${encodeURIComponent(e)}`, {
|
|
369
369
|
signal: y.signal
|
|
370
370
|
}).then(async (s) => {
|
|
371
371
|
if (!s.ok) {
|
|
@@ -374,11 +374,11 @@ function Nn(e, t, r = !1) {
|
|
|
374
374
|
}
|
|
375
375
|
return s.json();
|
|
376
376
|
}).then((s) => {
|
|
377
|
-
y.signal.aborted || (
|
|
377
|
+
y.signal.aborted || (i(s), f(!1));
|
|
378
378
|
}).catch((s) => {
|
|
379
|
-
y.signal.aborted || (
|
|
379
|
+
y.signal.aborted || (d(s instanceof Error ? s.message : "Agent lookup failed"), f(!1));
|
|
380
380
|
}), () => y.abort();
|
|
381
|
-
}, [e, t, r]), { info:
|
|
381
|
+
}, [e, t, r]), { info: o, error: l, loading: u };
|
|
382
382
|
}
|
|
383
383
|
function An(e) {
|
|
384
384
|
if (typeof window > "u") return null;
|
|
@@ -400,34 +400,34 @@ function Mn({
|
|
|
400
400
|
defaultValue: t = "expanded",
|
|
401
401
|
onChange: r
|
|
402
402
|
} = {}) {
|
|
403
|
-
const
|
|
403
|
+
const o = e !== void 0, [i, l] = S(t), d = o ? e : i, u = L(
|
|
404
404
|
(f) => {
|
|
405
|
-
f !==
|
|
405
|
+
f !== d && (o || l(f), r == null || r(f));
|
|
406
406
|
},
|
|
407
|
-
[
|
|
407
|
+
[d, o, r]
|
|
408
408
|
);
|
|
409
|
-
return [
|
|
409
|
+
return [d, u];
|
|
410
410
|
}
|
|
411
|
-
const
|
|
411
|
+
const Dn = ["hidden", "minimized", "expanded"];
|
|
412
412
|
function Tn(e) {
|
|
413
|
-
return e &&
|
|
413
|
+
return e && Dn.includes(e) ? e : null;
|
|
414
414
|
}
|
|
415
|
-
function
|
|
415
|
+
function In({
|
|
416
416
|
value: e,
|
|
417
417
|
defaultValue: t = "expanded",
|
|
418
418
|
onChange: r,
|
|
419
|
-
persistKey:
|
|
420
|
-
disablePersistence:
|
|
419
|
+
persistKey: o = "ll-widget",
|
|
420
|
+
disablePersistence: i = !1
|
|
421
421
|
} = {}) {
|
|
422
|
-
const l = `${
|
|
422
|
+
const l = `${o}:display-mode`, d = M(!1), [u, f] = Mn({
|
|
423
423
|
value: e,
|
|
424
424
|
defaultValue: t,
|
|
425
425
|
onChange: (y) => {
|
|
426
|
-
e === void 0 && !
|
|
426
|
+
e === void 0 && !i && Rn(l, y), r == null || r(y);
|
|
427
427
|
}
|
|
428
428
|
});
|
|
429
|
-
return
|
|
430
|
-
if (
|
|
429
|
+
return R(() => {
|
|
430
|
+
if (d.current || (d.current = !0, i || e !== void 0)) return;
|
|
431
431
|
const y = Tn(An(l));
|
|
432
432
|
y && y !== u && f(y);
|
|
433
433
|
}, []), [u, f];
|
|
@@ -435,80 +435,80 @@ function Dn({
|
|
|
435
435
|
const Pn = 640;
|
|
436
436
|
function $n(e = Pn) {
|
|
437
437
|
const [t, r] = S(!1);
|
|
438
|
-
return
|
|
438
|
+
return R(() => {
|
|
439
439
|
if (e === !1) {
|
|
440
440
|
r(!1);
|
|
441
441
|
return;
|
|
442
442
|
}
|
|
443
443
|
if (typeof window > "u" || typeof window.matchMedia > "u")
|
|
444
444
|
return;
|
|
445
|
-
const
|
|
446
|
-
return l(), typeof
|
|
447
|
-
|
|
445
|
+
const o = `(max-width: ${e - 1}px)`, i = window.matchMedia(o), l = () => r(i.matches);
|
|
446
|
+
return l(), typeof i.addEventListener == "function" ? (i.addEventListener("change", l), () => i.removeEventListener("change", l)) : (i.addListener(l), () => {
|
|
447
|
+
i.removeListener(l);
|
|
448
448
|
});
|
|
449
449
|
}, [e]), t;
|
|
450
450
|
}
|
|
451
|
-
const
|
|
452
|
-
function
|
|
453
|
-
if (typeof window > "u" || window.history[
|
|
451
|
+
const zt = "__llHistoryPatched", ft = "ll:pathname";
|
|
452
|
+
function Bn() {
|
|
453
|
+
if (typeof window > "u" || window.history[zt]) return;
|
|
454
454
|
const e = window.history.pushState, t = window.history.replaceState;
|
|
455
455
|
window.history.pushState = function(...r) {
|
|
456
|
-
const
|
|
457
|
-
return window.dispatchEvent(new Event(
|
|
456
|
+
const o = e.apply(this, r);
|
|
457
|
+
return window.dispatchEvent(new Event(ft)), o;
|
|
458
458
|
}, window.history.replaceState = function(...r) {
|
|
459
|
-
const
|
|
460
|
-
return window.dispatchEvent(new Event(
|
|
461
|
-
}, window.history[
|
|
459
|
+
const o = t.apply(this, r);
|
|
460
|
+
return window.dispatchEvent(new Event(ft)), o;
|
|
461
|
+
}, window.history[zt] = !0;
|
|
462
462
|
}
|
|
463
|
-
function
|
|
463
|
+
function Ot() {
|
|
464
464
|
return typeof window > "u" ? "/" : window.location.pathname || "/";
|
|
465
465
|
}
|
|
466
|
-
function
|
|
466
|
+
function zn(e) {
|
|
467
467
|
const [t, r] = S(
|
|
468
|
-
() => e ??
|
|
468
|
+
() => e ?? Ot()
|
|
469
469
|
);
|
|
470
|
-
return
|
|
470
|
+
return R(() => {
|
|
471
471
|
if (e !== void 0) return;
|
|
472
|
-
|
|
473
|
-
const
|
|
474
|
-
return
|
|
475
|
-
window.removeEventListener("popstate",
|
|
472
|
+
Bn();
|
|
473
|
+
const o = () => r(Ot());
|
|
474
|
+
return o(), window.addEventListener("popstate", o), window.addEventListener(ft, o), () => {
|
|
475
|
+
window.removeEventListener("popstate", o), window.removeEventListener(ft, o);
|
|
476
476
|
};
|
|
477
477
|
}, [e]), e ?? t;
|
|
478
478
|
}
|
|
479
|
-
const
|
|
480
|
-
function
|
|
481
|
-
return e.replace(
|
|
479
|
+
const Ht = /* @__PURE__ */ new Map(), On = /[\\^$+?.()|{}[\]]/g;
|
|
480
|
+
function Hn(e) {
|
|
481
|
+
return e.replace(On, "\\$&");
|
|
482
482
|
}
|
|
483
|
-
function
|
|
484
|
-
const t =
|
|
483
|
+
function Un(e) {
|
|
484
|
+
const t = Ht.get(e);
|
|
485
485
|
if (t) return t;
|
|
486
|
-
const r = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e,
|
|
487
|
-
return
|
|
486
|
+
const r = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e, o = "", i = "", l = r.replace(/\*\*/g, o).replace(/\*/g, i), u = Hn(l).replace(new RegExp(`\\/${o}`, "g"), "(?:\\/.*)?").replace(new RegExp(o, "g"), ".*").replace(new RegExp(i, "g"), "[^/]+"), f = new RegExp(`^${u}\\/?$`);
|
|
487
|
+
return Ht.set(e, f), f;
|
|
488
488
|
}
|
|
489
|
-
function
|
|
489
|
+
function qn(e, t) {
|
|
490
490
|
const r = t.length > 1 && t.endsWith("/") ? t.slice(0, -1) : t;
|
|
491
|
-
return
|
|
491
|
+
return Un(e).test(r);
|
|
492
492
|
}
|
|
493
|
-
function
|
|
494
|
-
return typeof e == "function" ? e(t) : e instanceof RegExp ? e.test(t) :
|
|
493
|
+
function Vn(e, t) {
|
|
494
|
+
return typeof e == "function" ? e(t) : e instanceof RegExp ? e.test(t) : qn(e, t);
|
|
495
495
|
}
|
|
496
|
-
function
|
|
496
|
+
function Ut(e, t) {
|
|
497
497
|
if (!e || e.length === 0) return !1;
|
|
498
498
|
for (const r of e)
|
|
499
|
-
if (
|
|
499
|
+
if (Vn(r, t)) return !0;
|
|
500
500
|
return !1;
|
|
501
501
|
}
|
|
502
|
-
function
|
|
503
|
-
return e === void 0 ? !0 :
|
|
502
|
+
function Wn(e, t, r) {
|
|
503
|
+
return e === void 0 ? !0 : Ut(r, e) ? !1 : t && t.length > 0 ? Ut(t, e) : !0;
|
|
504
504
|
}
|
|
505
|
-
function
|
|
506
|
-
return
|
|
507
|
-
() =>
|
|
505
|
+
function Fn(e, t, r) {
|
|
506
|
+
return ut(
|
|
507
|
+
() => Wn(e, t, r),
|
|
508
508
|
[e, t, r]
|
|
509
509
|
);
|
|
510
510
|
}
|
|
511
|
-
const
|
|
511
|
+
const qt = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ _(
|
|
512
512
|
"svg",
|
|
513
513
|
{
|
|
514
514
|
className: t,
|
|
@@ -554,7 +554,7 @@ const Wt = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ _(
|
|
|
554
554
|
}
|
|
555
555
|
)
|
|
556
556
|
}
|
|
557
|
-
),
|
|
557
|
+
), Vt = ({ className: e }) => /* @__PURE__ */ n(
|
|
558
558
|
"svg",
|
|
559
559
|
{
|
|
560
560
|
className: e,
|
|
@@ -572,7 +572,7 @@ const Wt = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ _(
|
|
|
572
572
|
}
|
|
573
573
|
)
|
|
574
574
|
}
|
|
575
|
-
),
|
|
575
|
+
), jn = ({ className: e }) => /* @__PURE__ */ n(
|
|
576
576
|
"svg",
|
|
577
577
|
{
|
|
578
578
|
className: e,
|
|
@@ -583,12 +583,12 @@ const Wt = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ _(
|
|
|
583
583
|
"aria-hidden": "true",
|
|
584
584
|
children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
|
|
585
585
|
}
|
|
586
|
-
),
|
|
586
|
+
), Gn = {
|
|
587
587
|
left: 180,
|
|
588
588
|
right: 0,
|
|
589
589
|
up: -90,
|
|
590
590
|
down: 90
|
|
591
|
-
},
|
|
591
|
+
}, Wt = ({ direction: e = "right", className: t }) => /* @__PURE__ */ n(
|
|
592
592
|
"svg",
|
|
593
593
|
{
|
|
594
594
|
className: t,
|
|
@@ -596,16 +596,16 @@ const Wt = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ _(
|
|
|
596
596
|
viewBox: "0 0 24 24",
|
|
597
597
|
stroke: "currentColor",
|
|
598
598
|
strokeWidth: 2,
|
|
599
|
-
style: { transform: `rotate(${
|
|
599
|
+
style: { transform: `rotate(${Gn[e]}deg)` },
|
|
600
600
|
"aria-hidden": "true",
|
|
601
601
|
children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 6l6 6-6 6" })
|
|
602
602
|
}
|
|
603
603
|
);
|
|
604
|
-
function
|
|
604
|
+
function Yn(e) {
|
|
605
605
|
return e === "top-left" || e === "bottom-left" ? "left" : "right";
|
|
606
606
|
}
|
|
607
|
-
const tn = "ll-hidden-tab-center-y",
|
|
608
|
-
function
|
|
607
|
+
const tn = "ll-hidden-tab-center-y", Jn = 5, Ft = 16;
|
|
608
|
+
function Kn() {
|
|
609
609
|
if (typeof window > "u") return null;
|
|
610
610
|
try {
|
|
611
611
|
const e = window.localStorage.getItem(tn);
|
|
@@ -616,70 +616,70 @@ function Xn() {
|
|
|
616
616
|
return null;
|
|
617
617
|
}
|
|
618
618
|
}
|
|
619
|
-
function
|
|
619
|
+
function jt(e) {
|
|
620
620
|
if (!(typeof window > "u"))
|
|
621
621
|
try {
|
|
622
622
|
window.localStorage.setItem(tn, String(e));
|
|
623
623
|
} catch {
|
|
624
624
|
}
|
|
625
625
|
}
|
|
626
|
-
const
|
|
626
|
+
const Xn = ({
|
|
627
627
|
position: e,
|
|
628
628
|
isMobile: t,
|
|
629
629
|
isSpeaking: r,
|
|
630
|
-
onExpand:
|
|
631
|
-
label:
|
|
630
|
+
onExpand: o,
|
|
631
|
+
label: i = "Open widget",
|
|
632
632
|
avatarImageUrl: l,
|
|
633
|
-
agentName:
|
|
633
|
+
agentName: d
|
|
634
634
|
}) => {
|
|
635
|
-
const u =
|
|
636
|
-
(
|
|
637
|
-
if (typeof window > "u") return
|
|
638
|
-
const
|
|
639
|
-
return
|
|
635
|
+
const u = Yn(e), f = u === "right" ? "left" : "right", y = t ? 80 : 72, b = !!l, [s, a] = S(null), [k, N] = S(!1), E = M(null), v = M(!1), w = L(
|
|
636
|
+
(T) => {
|
|
637
|
+
if (typeof window > "u") return T;
|
|
638
|
+
const q = y / 2, j = Ft + q, X = window.innerHeight - Ft - q;
|
|
639
|
+
return X < j ? Math.max(j, T) : Math.max(j, Math.min(X, T));
|
|
640
640
|
},
|
|
641
641
|
[y]
|
|
642
642
|
);
|
|
643
|
-
|
|
644
|
-
const
|
|
645
|
-
a(w(
|
|
646
|
-
const
|
|
647
|
-
a((
|
|
643
|
+
R(() => {
|
|
644
|
+
const T = Kn();
|
|
645
|
+
a(w(T ?? window.innerHeight / 2));
|
|
646
|
+
const q = () => {
|
|
647
|
+
a((j) => j === null ? null : w(j));
|
|
648
648
|
};
|
|
649
|
-
return window.addEventListener("resize",
|
|
649
|
+
return window.addEventListener("resize", q), () => window.removeEventListener("resize", q);
|
|
650
650
|
}, [w]);
|
|
651
|
-
const
|
|
652
|
-
(
|
|
653
|
-
if (!(
|
|
651
|
+
const O = L(
|
|
652
|
+
(T) => {
|
|
653
|
+
if (!(T.pointerType === "mouse" && T.button !== 0) && s !== null) {
|
|
654
654
|
try {
|
|
655
|
-
|
|
655
|
+
T.currentTarget.setPointerCapture(T.pointerId);
|
|
656
656
|
} catch {
|
|
657
657
|
}
|
|
658
|
-
|
|
659
|
-
startClientY:
|
|
658
|
+
E.current = {
|
|
659
|
+
startClientY: T.clientY,
|
|
660
660
|
startCenterY: s,
|
|
661
661
|
moved: !1
|
|
662
662
|
};
|
|
663
663
|
}
|
|
664
664
|
},
|
|
665
665
|
[s]
|
|
666
|
-
),
|
|
667
|
-
(
|
|
668
|
-
const
|
|
669
|
-
if (!
|
|
670
|
-
const
|
|
671
|
-
!
|
|
666
|
+
), $ = L(
|
|
667
|
+
(T) => {
|
|
668
|
+
const q = E.current;
|
|
669
|
+
if (!q) return;
|
|
670
|
+
const j = T.clientY - q.startClientY;
|
|
671
|
+
!q.moved && Math.abs(j) > Jn && (q.moved = !0, N(!0)), q.moved && a(w(q.startCenterY + j));
|
|
672
672
|
},
|
|
673
673
|
[w]
|
|
674
|
-
),
|
|
675
|
-
(
|
|
676
|
-
const
|
|
677
|
-
if (
|
|
674
|
+
), U = L(
|
|
675
|
+
(T) => {
|
|
676
|
+
const q = E.current;
|
|
677
|
+
if (q) {
|
|
678
678
|
try {
|
|
679
|
-
|
|
679
|
+
T.currentTarget.releasePointerCapture(T.pointerId);
|
|
680
680
|
} catch {
|
|
681
681
|
}
|
|
682
|
-
|
|
682
|
+
E.current = null, q.moved && (N(!1), v.current = !0, a((j) => (j !== null && jt(j), j)));
|
|
683
683
|
}
|
|
684
684
|
},
|
|
685
685
|
[]
|
|
@@ -688,40 +688,40 @@ const Gn = ({
|
|
|
688
688
|
v.current = !1;
|
|
689
689
|
return;
|
|
690
690
|
}
|
|
691
|
-
|
|
692
|
-
}, [
|
|
693
|
-
(
|
|
694
|
-
if (
|
|
695
|
-
|
|
696
|
-
const
|
|
697
|
-
a((
|
|
698
|
-
if (
|
|
699
|
-
const
|
|
700
|
-
return
|
|
691
|
+
o();
|
|
692
|
+
}, [o]), D = L(
|
|
693
|
+
(T) => {
|
|
694
|
+
if (T.key === "ArrowUp" || T.key === "ArrowDown") {
|
|
695
|
+
T.preventDefault();
|
|
696
|
+
const q = T.key === "ArrowUp" ? -8 : 8;
|
|
697
|
+
a((j) => {
|
|
698
|
+
if (j === null) return j;
|
|
699
|
+
const X = w(j + q);
|
|
700
|
+
return jt(X), X;
|
|
701
701
|
});
|
|
702
702
|
}
|
|
703
703
|
},
|
|
704
704
|
[w]
|
|
705
|
-
),
|
|
705
|
+
), V = [
|
|
706
706
|
"ll-hidden",
|
|
707
707
|
`ll-hidden--${u}`,
|
|
708
708
|
t ? "ll-hidden--mobile" : "ll-hidden--desktop",
|
|
709
709
|
r ? "ll-hidden--speaking" : null,
|
|
710
|
-
|
|
710
|
+
k ? "is-dragging" : null,
|
|
711
711
|
b ? "ll-hidden--with-avatar" : null
|
|
712
712
|
].filter(Boolean).join(" "), z = s === null ? void 0 : { top: `${s - y / 2}px`, transform: "none" };
|
|
713
713
|
return /* @__PURE__ */ n(
|
|
714
714
|
"button",
|
|
715
715
|
{
|
|
716
716
|
type: "button",
|
|
717
|
-
className:
|
|
718
|
-
onPointerDown:
|
|
719
|
-
onPointerMove:
|
|
720
|
-
onPointerUp:
|
|
721
|
-
onPointerCancel:
|
|
717
|
+
className: V,
|
|
718
|
+
onPointerDown: O,
|
|
719
|
+
onPointerMove: $,
|
|
720
|
+
onPointerUp: U,
|
|
721
|
+
onPointerCancel: U,
|
|
722
722
|
onClick: m,
|
|
723
|
-
onKeyDown:
|
|
724
|
-
"aria-label":
|
|
723
|
+
onKeyDown: D,
|
|
724
|
+
"aria-label": i,
|
|
725
725
|
"data-position": e,
|
|
726
726
|
style: z,
|
|
727
727
|
children: b ? (
|
|
@@ -729,9 +729,9 @@ const Gn = ({
|
|
|
729
729
|
// as the click affordance), then the circular avatar photo
|
|
730
730
|
// taking the rest of the tab. Reinforces "this is an
|
|
731
731
|
// avatar-based experience" even when collapsed.
|
|
732
|
-
/* @__PURE__ */ _(
|
|
732
|
+
/* @__PURE__ */ _(St, { children: [
|
|
733
733
|
/* @__PURE__ */ n(
|
|
734
|
-
|
|
734
|
+
Wt,
|
|
735
735
|
{
|
|
736
736
|
direction: f,
|
|
737
737
|
className: "ll-hidden__chevron ll-hidden__chevron--mini"
|
|
@@ -741,14 +741,14 @@ const Gn = ({
|
|
|
741
741
|
"img",
|
|
742
742
|
{
|
|
743
743
|
src: l,
|
|
744
|
-
alt:
|
|
744
|
+
alt: d ? `${d} avatar` : "Agent avatar",
|
|
745
745
|
className: "ll-hidden__avatar",
|
|
746
746
|
draggable: !1
|
|
747
747
|
}
|
|
748
748
|
)
|
|
749
749
|
] })
|
|
750
750
|
) : /* @__PURE__ */ n(
|
|
751
|
-
|
|
751
|
+
Wt,
|
|
752
752
|
{
|
|
753
753
|
direction: f,
|
|
754
754
|
className: "ll-hidden__chevron"
|
|
@@ -760,31 +760,31 @@ const Gn = ({
|
|
|
760
760
|
audioLevel: e,
|
|
761
761
|
bars: t = 20,
|
|
762
762
|
maxHeight: r = 20,
|
|
763
|
-
minHeight:
|
|
764
|
-
className:
|
|
763
|
+
minHeight: o = 4,
|
|
764
|
+
className: i,
|
|
765
765
|
barClassName: l
|
|
766
766
|
}) => {
|
|
767
|
-
const
|
|
767
|
+
const d = M(null), u = M([]), f = ut(() => {
|
|
768
768
|
const b = (Math.sqrt(5) - 1) / 2;
|
|
769
769
|
return Array.from({ length: t }, (s, a) => 0.5 + a * b % 1 * 0.5);
|
|
770
770
|
}, [t]);
|
|
771
|
-
|
|
771
|
+
R(() => e.subscribe((s) => {
|
|
772
772
|
for (let a = 0; a < t; a++) {
|
|
773
|
-
const
|
|
774
|
-
if (!
|
|
775
|
-
const
|
|
776
|
-
|
|
773
|
+
const k = u.current[a];
|
|
774
|
+
if (!k) continue;
|
|
775
|
+
const N = Math.max(o, s * r * f[a]);
|
|
776
|
+
k.style.height = `${N}px`;
|
|
777
777
|
}
|
|
778
|
-
}), [e, t, r,
|
|
779
|
-
const y = ["ll-waveform",
|
|
780
|
-
return /* @__PURE__ */ n("div", { ref:
|
|
778
|
+
}), [e, t, r, o, f]);
|
|
779
|
+
const y = ["ll-waveform", i].filter(Boolean).join(" ");
|
|
780
|
+
return /* @__PURE__ */ n("div", { ref: d, className: y, "aria-hidden": "true", children: Array.from({ length: t }, (b, s) => /* @__PURE__ */ n(
|
|
781
781
|
"div",
|
|
782
782
|
{
|
|
783
783
|
ref: (a) => {
|
|
784
784
|
u.current[s] = a;
|
|
785
785
|
},
|
|
786
786
|
className: ["ll-waveform__bar", l].filter(Boolean).join(" "),
|
|
787
|
-
style: { height: `${
|
|
787
|
+
style: { height: `${o}px` }
|
|
788
788
|
},
|
|
789
789
|
s
|
|
790
790
|
)) });
|
|
@@ -792,10 +792,10 @@ const Gn = ({
|
|
|
792
792
|
position: e,
|
|
793
793
|
isMobile: t,
|
|
794
794
|
agentName: r,
|
|
795
|
-
avatarImageUrl:
|
|
796
|
-
agentState:
|
|
795
|
+
avatarImageUrl: o,
|
|
796
|
+
agentState: i,
|
|
797
797
|
isMuted: l,
|
|
798
|
-
audioLevel:
|
|
798
|
+
audioLevel: d,
|
|
799
799
|
onExpand: u,
|
|
800
800
|
onToggleMute: f,
|
|
801
801
|
onClose: y
|
|
@@ -813,12 +813,12 @@ const Gn = ({
|
|
|
813
813
|
onClick: u,
|
|
814
814
|
"aria-label": `Expand ${r} widget`,
|
|
815
815
|
children: [
|
|
816
|
-
|
|
816
|
+
o ? (
|
|
817
817
|
// eslint-disable-next-line @next/next/no-img-element
|
|
818
818
|
/* @__PURE__ */ n(
|
|
819
819
|
"img",
|
|
820
820
|
{
|
|
821
|
-
src:
|
|
821
|
+
src: o,
|
|
822
822
|
alt: r,
|
|
823
823
|
className: "ll-minimized__avatar"
|
|
824
824
|
}
|
|
@@ -827,7 +827,7 @@ const Gn = ({
|
|
|
827
827
|
/* @__PURE__ */ n(
|
|
828
828
|
Qn,
|
|
829
829
|
{
|
|
830
|
-
audioLevel:
|
|
830
|
+
audioLevel: d,
|
|
831
831
|
bars: 16,
|
|
832
832
|
maxHeight: 18,
|
|
833
833
|
className: "ll-minimized__waveform"
|
|
@@ -848,10 +848,10 @@ const Gn = ({
|
|
|
848
848
|
(b.key === "Enter" || b.key === " ") && (b.stopPropagation(), b.preventDefault(), f());
|
|
849
849
|
},
|
|
850
850
|
"aria-label": l ? "Unmute microphone" : "Mute microphone",
|
|
851
|
-
children: /* @__PURE__ */ n(
|
|
851
|
+
children: /* @__PURE__ */ n(qt, { muted: l, className: "ll-minimized__icon" })
|
|
852
852
|
}
|
|
853
853
|
),
|
|
854
|
-
/* @__PURE__ */ n(
|
|
854
|
+
/* @__PURE__ */ n(Vt, { className: "ll-minimized__icon ll-minimized__icon--expand" })
|
|
855
855
|
] })
|
|
856
856
|
]
|
|
857
857
|
}
|
|
@@ -865,12 +865,12 @@ const Gn = ({
|
|
|
865
865
|
role: "region",
|
|
866
866
|
"aria-label": `${r} widget`,
|
|
867
867
|
children: /* @__PURE__ */ _("div", { className: "ll-minimized__surface", children: [
|
|
868
|
-
|
|
868
|
+
o ? (
|
|
869
869
|
// eslint-disable-next-line @next/next/no-img-element
|
|
870
870
|
/* @__PURE__ */ n(
|
|
871
871
|
"img",
|
|
872
872
|
{
|
|
873
|
-
src:
|
|
873
|
+
src: o,
|
|
874
874
|
alt: r,
|
|
875
875
|
className: "ll-minimized__avatar"
|
|
876
876
|
}
|
|
@@ -878,7 +878,7 @@ const Gn = ({
|
|
|
878
878
|
) : /* @__PURE__ */ n("div", { className: "ll-minimized__avatar ll-minimized__avatar--placeholder" }),
|
|
879
879
|
/* @__PURE__ */ _("div", { className: "ll-minimized__meta", children: [
|
|
880
880
|
/* @__PURE__ */ n("span", { className: "ll-minimized__name", children: r }),
|
|
881
|
-
/* @__PURE__ */ n("span", { className: "ll-minimized__state", children:
|
|
881
|
+
/* @__PURE__ */ n("span", { className: "ll-minimized__state", children: i === "speaking" ? "Speaking" : i === "thinking" ? "Thinking" : "Listening" })
|
|
882
882
|
] }),
|
|
883
883
|
/* @__PURE__ */ _("div", { className: "ll-minimized__controls", children: [
|
|
884
884
|
/* @__PURE__ */ n(
|
|
@@ -888,7 +888,7 @@ const Gn = ({
|
|
|
888
888
|
className: "ll-minimized__btn",
|
|
889
889
|
onClick: f,
|
|
890
890
|
"aria-label": l ? "Unmute microphone" : "Mute microphone",
|
|
891
|
-
children: /* @__PURE__ */ n(
|
|
891
|
+
children: /* @__PURE__ */ n(qt, { muted: l, className: "ll-minimized__icon" })
|
|
892
892
|
}
|
|
893
893
|
),
|
|
894
894
|
/* @__PURE__ */ n(
|
|
@@ -898,7 +898,7 @@ const Gn = ({
|
|
|
898
898
|
className: "ll-minimized__btn",
|
|
899
899
|
onClick: u,
|
|
900
900
|
"aria-label": `Expand ${r} widget`,
|
|
901
|
-
children: /* @__PURE__ */ n(
|
|
901
|
+
children: /* @__PURE__ */ n(Vt, { className: "ll-minimized__icon" })
|
|
902
902
|
}
|
|
903
903
|
),
|
|
904
904
|
/* @__PURE__ */ n(
|
|
@@ -908,7 +908,7 @@ const Gn = ({
|
|
|
908
908
|
className: "ll-minimized__btn ll-minimized__btn--close",
|
|
909
909
|
onClick: y,
|
|
910
910
|
"aria-label": "Close widget",
|
|
911
|
-
children: /* @__PURE__ */ n(
|
|
911
|
+
children: /* @__PURE__ */ n(jn, { className: "ll-minimized__icon" })
|
|
912
912
|
}
|
|
913
913
|
)
|
|
914
914
|
] })
|
|
@@ -918,12 +918,12 @@ const Gn = ({
|
|
|
918
918
|
src: e,
|
|
919
919
|
alt: t,
|
|
920
920
|
preCannedPlaying: r = !1,
|
|
921
|
-
className:
|
|
922
|
-
style:
|
|
921
|
+
className: o,
|
|
922
|
+
style: i
|
|
923
923
|
}) => {
|
|
924
|
-
const [l,
|
|
925
|
-
if (
|
|
926
|
-
u.current !== e && (u.current = e,
|
|
924
|
+
const [l, d] = S(!1), u = M(e);
|
|
925
|
+
if (R(() => {
|
|
926
|
+
u.current !== e && (u.current = e, d(!1));
|
|
927
927
|
}, [e]), !e) return null;
|
|
928
928
|
const f = {
|
|
929
929
|
position: "absolute",
|
|
@@ -935,7 +935,7 @@ const Gn = ({
|
|
|
935
935
|
transition: "opacity 500ms ease, transform 500ms ease",
|
|
936
936
|
transform: r ? "scale(1.02)" : "scale(1)",
|
|
937
937
|
opacity: l ? 1 : 0,
|
|
938
|
-
...
|
|
938
|
+
...i
|
|
939
939
|
};
|
|
940
940
|
return (
|
|
941
941
|
// eslint-disable-next-line @next/next/no-img-element
|
|
@@ -944,11 +944,11 @@ const Gn = ({
|
|
|
944
944
|
{
|
|
945
945
|
src: e,
|
|
946
946
|
alt: t,
|
|
947
|
-
className:
|
|
947
|
+
className: o,
|
|
948
948
|
style: f,
|
|
949
949
|
loading: "eager",
|
|
950
950
|
fetchPriority: "high",
|
|
951
|
-
onLoad: () =>
|
|
951
|
+
onLoad: () => d(!0)
|
|
952
952
|
}
|
|
953
953
|
)
|
|
954
954
|
);
|
|
@@ -956,144 +956,144 @@ const Gn = ({
|
|
|
956
956
|
position: e,
|
|
957
957
|
isMobile: t,
|
|
958
958
|
agentName: r,
|
|
959
|
-
avatarImageUrl:
|
|
960
|
-
idleLoopUrl:
|
|
959
|
+
avatarImageUrl: o,
|
|
960
|
+
idleLoopUrl: i,
|
|
961
961
|
greeting: l,
|
|
962
|
-
branding:
|
|
962
|
+
branding: d,
|
|
963
963
|
teamMembers: u,
|
|
964
964
|
currentTeamMemberId: f,
|
|
965
965
|
isSwitchingTeamMember: y,
|
|
966
966
|
teamSwitcherOpen: b,
|
|
967
967
|
onToggleTeamSwitcher: s,
|
|
968
968
|
onSelectTeamMember: a,
|
|
969
|
-
languageMenuOpen:
|
|
970
|
-
onToggleLanguageMenu:
|
|
971
|
-
connectionState:
|
|
969
|
+
languageMenuOpen: k,
|
|
970
|
+
onToggleLanguageMenu: N,
|
|
971
|
+
connectionState: E,
|
|
972
972
|
agentState: v,
|
|
973
973
|
transcript: w,
|
|
974
|
-
canResume:
|
|
975
|
-
needsUserGesture:
|
|
976
|
-
error:
|
|
974
|
+
canResume: O,
|
|
975
|
+
needsUserGesture: $,
|
|
976
|
+
error: U,
|
|
977
977
|
isMuted: m,
|
|
978
|
-
micError:
|
|
979
|
-
micDevices:
|
|
978
|
+
micError: D,
|
|
979
|
+
micDevices: V,
|
|
980
980
|
isCameraEnabled: z,
|
|
981
|
-
cameraPreviewEl:
|
|
982
|
-
cameraDevices:
|
|
983
|
-
activeCameraId:
|
|
984
|
-
isScreenShareEnabled:
|
|
981
|
+
cameraPreviewEl: T,
|
|
982
|
+
cameraDevices: q,
|
|
983
|
+
activeCameraId: j,
|
|
984
|
+
isScreenShareEnabled: X,
|
|
985
985
|
screenPreviewEl: ie,
|
|
986
986
|
isSpeakerMuted: we,
|
|
987
987
|
allowCamera: tt,
|
|
988
988
|
allowScreenShare: nt,
|
|
989
989
|
allowTyping: rt,
|
|
990
|
-
avatarVideoContainerRef:
|
|
990
|
+
avatarVideoContainerRef: ot,
|
|
991
991
|
agentVideoEl: re,
|
|
992
|
-
micGateOpen:
|
|
992
|
+
micGateOpen: ue,
|
|
993
993
|
onConnect: _e,
|
|
994
|
-
onDisconnect:
|
|
995
|
-
onRetry:
|
|
996
|
-
onResumeAudio:
|
|
997
|
-
onToggleMute:
|
|
998
|
-
onToggleCamera:
|
|
999
|
-
onSwitchCameraDevice:
|
|
1000
|
-
onToggleScreenShare:
|
|
1001
|
-
onToggleSpeaker:
|
|
1002
|
-
onSendMessage:
|
|
1003
|
-
onMinimize:
|
|
1004
|
-
onClose:
|
|
1005
|
-
onClearMicError:
|
|
994
|
+
onDisconnect: Ce,
|
|
995
|
+
onRetry: Ne,
|
|
996
|
+
onResumeAudio: Ae,
|
|
997
|
+
onToggleMute: Re,
|
|
998
|
+
onToggleCamera: Me,
|
|
999
|
+
onSwitchCameraDevice: Y,
|
|
1000
|
+
onToggleScreenShare: ht,
|
|
1001
|
+
onToggleSpeaker: mt,
|
|
1002
|
+
onSendMessage: it,
|
|
1003
|
+
onMinimize: le,
|
|
1004
|
+
onClose: De,
|
|
1005
|
+
onClearMicError: Ue
|
|
1006
1006
|
}) => {
|
|
1007
|
-
var
|
|
1008
|
-
const xe = ((u == null ? void 0 : u.length) ?? 0) > 1,
|
|
1009
|
-
|
|
1007
|
+
var Be;
|
|
1008
|
+
const xe = ((u == null ? void 0 : u.length) ?? 0) > 1, Te = E === "connecting" || E === "connected", K = E === "connected", ee = E === "idle" || E === "disconnected" || E === "error", [Ie, ae] = S(!1);
|
|
1009
|
+
R(() => {
|
|
1010
1010
|
if (!re) {
|
|
1011
|
-
|
|
1011
|
+
ae(!1);
|
|
1012
1012
|
return;
|
|
1013
1013
|
}
|
|
1014
1014
|
if (!re.paused && re.readyState >= 2) {
|
|
1015
|
-
|
|
1015
|
+
ae(!0);
|
|
1016
1016
|
return;
|
|
1017
1017
|
}
|
|
1018
|
-
|
|
1019
|
-
const p = () =>
|
|
1018
|
+
ae(!1);
|
|
1019
|
+
const p = () => ae(!0);
|
|
1020
1020
|
return re.addEventListener("playing", p), re.addEventListener("loadeddata", p), () => {
|
|
1021
1021
|
re.removeEventListener("playing", p), re.removeEventListener("loadeddata", p);
|
|
1022
1022
|
};
|
|
1023
1023
|
}, [re]);
|
|
1024
|
-
const [
|
|
1025
|
-
|
|
1026
|
-
if (!
|
|
1024
|
+
const [fe, ke] = S(!1);
|
|
1025
|
+
R(() => {
|
|
1026
|
+
if (!K) {
|
|
1027
1027
|
ke(!1);
|
|
1028
1028
|
return;
|
|
1029
1029
|
}
|
|
1030
|
-
if (
|
|
1030
|
+
if (Ie) return;
|
|
1031
1031
|
const p = setTimeout(() => ke(!0), 8e3);
|
|
1032
1032
|
return () => clearTimeout(p);
|
|
1033
|
-
}, [
|
|
1034
|
-
const
|
|
1035
|
-
|
|
1033
|
+
}, [K, Ie]);
|
|
1034
|
+
const qe = E === "connecting" || K && !!o && !Ie && !fe, te = M(null), se = M(null);
|
|
1035
|
+
R(() => {
|
|
1036
1036
|
const p = te.current;
|
|
1037
|
-
p && (p.innerHTML = "",
|
|
1038
|
-
}, [
|
|
1039
|
-
const p =
|
|
1037
|
+
p && (p.innerHTML = "", T && (T.style.width = "100%", T.style.height = "100%", T.style.objectFit = "cover", T.style.transform = "scaleX(-1)", p.appendChild(T)));
|
|
1038
|
+
}, [T]), R(() => {
|
|
1039
|
+
const p = se.current;
|
|
1040
1040
|
p && (p.innerHTML = "", ie && (ie.style.width = "100%", ie.style.height = "100%", ie.style.objectFit = "contain", p.appendChild(ie)));
|
|
1041
1041
|
}, [ie]);
|
|
1042
|
-
const [
|
|
1043
|
-
|
|
1044
|
-
if (!
|
|
1042
|
+
const [ce, pe] = S(!1), [Pe, he] = S(!1);
|
|
1043
|
+
R(() => {
|
|
1044
|
+
if (!ce && !Pe && !k && !b) return;
|
|
1045
1045
|
const p = () => {
|
|
1046
|
-
pe(!1), he(!1),
|
|
1046
|
+
pe(!1), he(!1), k && N(), b && s();
|
|
1047
1047
|
};
|
|
1048
1048
|
return document.addEventListener("click", p), () => document.removeEventListener("click", p);
|
|
1049
1049
|
}, [
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1050
|
+
ce,
|
|
1051
|
+
Pe,
|
|
1052
|
+
k,
|
|
1053
1053
|
b,
|
|
1054
|
-
|
|
1054
|
+
N,
|
|
1055
1055
|
s
|
|
1056
1056
|
]);
|
|
1057
|
-
const [me,
|
|
1057
|
+
const [me, Ve] = S(""), We = L(
|
|
1058
1058
|
(p) => {
|
|
1059
1059
|
p.preventDefault();
|
|
1060
|
-
const
|
|
1061
|
-
|
|
1060
|
+
const J = me.trim();
|
|
1061
|
+
J && (it(J), Ve(""));
|
|
1062
1062
|
},
|
|
1063
|
-
[me,
|
|
1064
|
-
),
|
|
1063
|
+
[me, it]
|
|
1064
|
+
), Fe = d.productName || "Live Layer";
|
|
1065
1065
|
let ge = null, ye = null;
|
|
1066
1066
|
for (let p = w.length - 1; p >= 0; p--) {
|
|
1067
|
-
const
|
|
1068
|
-
if (!ge &&
|
|
1067
|
+
const J = w[p];
|
|
1068
|
+
if (!ge && J.role === "agent" ? ge = J : !ye && J.role === "user" && (ye = J), ge && ye) break;
|
|
1069
1069
|
}
|
|
1070
|
-
const
|
|
1070
|
+
const $e = K ? (ge == null ? void 0 : ge.text) || null : l || null, lt = K && (ye == null ? void 0 : ye.text) || null, je = [
|
|
1071
1071
|
"ll-expanded",
|
|
1072
1072
|
t ? "ll-expanded--mobile" : "ll-expanded--desktop"
|
|
1073
1073
|
].join(" ");
|
|
1074
1074
|
return /* @__PURE__ */ _(
|
|
1075
1075
|
"div",
|
|
1076
1076
|
{
|
|
1077
|
-
className:
|
|
1077
|
+
className: je,
|
|
1078
1078
|
"data-position": e,
|
|
1079
|
-
"data-state":
|
|
1079
|
+
"data-state": K ? "connected" : Te ? "connecting" : "idle",
|
|
1080
1080
|
role: "dialog",
|
|
1081
1081
|
"aria-label": `${r} widget`,
|
|
1082
1082
|
children: [
|
|
1083
1083
|
/* @__PURE__ */ _("div", { className: "ll-expanded__bg", children: [
|
|
1084
|
-
|
|
1084
|
+
o ? /* @__PURE__ */ n(
|
|
1085
1085
|
er,
|
|
1086
1086
|
{
|
|
1087
|
-
src:
|
|
1087
|
+
src: o,
|
|
1088
1088
|
alt: r,
|
|
1089
1089
|
className: "ll-expanded__bg-img"
|
|
1090
1090
|
}
|
|
1091
|
-
) : /* @__PURE__ */ n("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ n("span", { className: "ll-expanded__bg-initial", children: ((
|
|
1092
|
-
|
|
1091
|
+
) : /* @__PURE__ */ n("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ n("span", { className: "ll-expanded__bg-initial", children: ((Be = r == null ? void 0 : r.charAt(0)) == null ? void 0 : Be.toUpperCase()) || "A" }) }),
|
|
1092
|
+
i && !K && /* @__PURE__ */ n(
|
|
1093
1093
|
"video",
|
|
1094
1094
|
{
|
|
1095
1095
|
className: "ll-expanded__bg-idle",
|
|
1096
|
-
src:
|
|
1096
|
+
src: i,
|
|
1097
1097
|
autoPlay: !0,
|
|
1098
1098
|
loop: !0,
|
|
1099
1099
|
muted: !0,
|
|
@@ -1101,24 +1101,24 @@ const Gn = ({
|
|
|
1101
1101
|
}
|
|
1102
1102
|
)
|
|
1103
1103
|
] }),
|
|
1104
|
-
/* @__PURE__ */ n("div", { ref:
|
|
1105
|
-
|
|
1104
|
+
/* @__PURE__ */ n("div", { ref: ot, className: "ll-expanded__video" }),
|
|
1105
|
+
qe && /* @__PURE__ */ _("div", { className: "ll-expanded__overlay ll-expanded__overlay--connecting", children: [
|
|
1106
1106
|
/* @__PURE__ */ n("div", { className: "ll-expanded__spinner" }),
|
|
1107
1107
|
/* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children: y ? "Switching..." : "Connecting..." })
|
|
1108
1108
|
] }),
|
|
1109
|
-
|
|
1109
|
+
$ && K && /* @__PURE__ */ _(
|
|
1110
1110
|
"button",
|
|
1111
1111
|
{
|
|
1112
1112
|
type: "button",
|
|
1113
1113
|
className: "ll-expanded__overlay ll-expanded__overlay--gesture",
|
|
1114
|
-
onClick:
|
|
1114
|
+
onClick: Ae,
|
|
1115
1115
|
children: [
|
|
1116
1116
|
/* @__PURE__ */ n("svg", { width: "32", height: "32", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": !0, children: /* @__PURE__ */ n("path", { d: "M3 9v6h4l5 5V4L7 9H3zm13.54.12a5 5 0 0 1 0 5.76l-1.41-1.41a3 3 0 0 0 0-2.94L16.54 9.12z" }) }),
|
|
1117
1117
|
/* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children: "Tap to enable audio" })
|
|
1118
1118
|
]
|
|
1119
1119
|
}
|
|
1120
1120
|
),
|
|
1121
|
-
|
|
1121
|
+
Te ? /* @__PURE__ */ _("div", { className: "ll-expanded__topbar", children: [
|
|
1122
1122
|
/* @__PURE__ */ _("div", { className: "ll-expanded__topbar-left", children: [
|
|
1123
1123
|
/* @__PURE__ */ _("div", { className: "ll-expanded__pill-wrap", children: [
|
|
1124
1124
|
/* @__PURE__ */ _(
|
|
@@ -1176,10 +1176,10 @@ const Gn = ({
|
|
|
1176
1176
|
type: "button",
|
|
1177
1177
|
className: "ll-hpill ll-hpill--compact",
|
|
1178
1178
|
onClick: (p) => {
|
|
1179
|
-
p.stopPropagation(),
|
|
1179
|
+
p.stopPropagation(), N();
|
|
1180
1180
|
},
|
|
1181
1181
|
"aria-haspopup": "listbox",
|
|
1182
|
-
"aria-expanded":
|
|
1182
|
+
"aria-expanded": k,
|
|
1183
1183
|
"aria-label": "Language: English",
|
|
1184
1184
|
title: "Language: English",
|
|
1185
1185
|
children: [
|
|
@@ -1188,7 +1188,7 @@ const Gn = ({
|
|
|
1188
1188
|
]
|
|
1189
1189
|
}
|
|
1190
1190
|
),
|
|
1191
|
-
|
|
1191
|
+
k && /* @__PURE__ */ n(
|
|
1192
1192
|
"div",
|
|
1193
1193
|
{
|
|
1194
1194
|
className: "ll-hmenu",
|
|
@@ -1221,10 +1221,10 @@ const Gn = ({
|
|
|
1221
1221
|
{
|
|
1222
1222
|
type: "button",
|
|
1223
1223
|
className: "ll-hbtn",
|
|
1224
|
-
onClick:
|
|
1224
|
+
onClick: le,
|
|
1225
1225
|
"aria-label": "Minimize widget",
|
|
1226
1226
|
title: "Minimize",
|
|
1227
|
-
children: /* @__PURE__ */ n(
|
|
1227
|
+
children: /* @__PURE__ */ n(Yt, {})
|
|
1228
1228
|
}
|
|
1229
1229
|
),
|
|
1230
1230
|
/* @__PURE__ */ n(
|
|
@@ -1232,26 +1232,26 @@ const Gn = ({
|
|
|
1232
1232
|
{
|
|
1233
1233
|
type: "button",
|
|
1234
1234
|
className: "ll-hbtn ll-hbtn--danger",
|
|
1235
|
-
onClick:
|
|
1235
|
+
onClick: De,
|
|
1236
1236
|
"aria-label": "End call",
|
|
1237
1237
|
title: "End call",
|
|
1238
|
-
children: /* @__PURE__ */ n(
|
|
1238
|
+
children: /* @__PURE__ */ n(Gt, {})
|
|
1239
1239
|
}
|
|
1240
1240
|
)
|
|
1241
1241
|
] })
|
|
1242
1242
|
] }) : (
|
|
1243
1243
|
// Idle-state header with Live Layer product name + minimize/close
|
|
1244
1244
|
/* @__PURE__ */ _("div", { className: "ll-expanded__header ll-expanded__header--idle", children: [
|
|
1245
|
-
/* @__PURE__ */ n("span", { className: "ll-expanded__brand", children:
|
|
1245
|
+
/* @__PURE__ */ n("span", { className: "ll-expanded__brand", children: Fe }),
|
|
1246
1246
|
/* @__PURE__ */ _("div", { className: "ll-expanded__header-actions", children: [
|
|
1247
1247
|
/* @__PURE__ */ n(
|
|
1248
1248
|
"button",
|
|
1249
1249
|
{
|
|
1250
1250
|
type: "button",
|
|
1251
1251
|
className: "ll-hbtn ll-hbtn--ghost",
|
|
1252
|
-
onClick:
|
|
1252
|
+
onClick: le,
|
|
1253
1253
|
"aria-label": "Minimize widget",
|
|
1254
|
-
children: /* @__PURE__ */ n(
|
|
1254
|
+
children: /* @__PURE__ */ n(Yt, {})
|
|
1255
1255
|
}
|
|
1256
1256
|
),
|
|
1257
1257
|
/* @__PURE__ */ n(
|
|
@@ -1259,18 +1259,18 @@ const Gn = ({
|
|
|
1259
1259
|
{
|
|
1260
1260
|
type: "button",
|
|
1261
1261
|
className: "ll-hbtn ll-hbtn--danger",
|
|
1262
|
-
onClick:
|
|
1262
|
+
onClick: De,
|
|
1263
1263
|
"aria-label": "Close widget",
|
|
1264
|
-
children: /* @__PURE__ */ n(
|
|
1264
|
+
children: /* @__PURE__ */ n(Gt, {})
|
|
1265
1265
|
}
|
|
1266
1266
|
)
|
|
1267
1267
|
] })
|
|
1268
1268
|
] })
|
|
1269
1269
|
),
|
|
1270
1270
|
ee && /* @__PURE__ */ (() => {
|
|
1271
|
-
const p =
|
|
1272
|
-
return /* @__PURE__ */ _(
|
|
1273
|
-
|
|
1271
|
+
const p = O ? "Restart paused session" : E === "disconnected" ? "Reconnect to agent" : "Start video call", J = O ? "Pick up where you left off" : null;
|
|
1272
|
+
return /* @__PURE__ */ _(St, { children: [
|
|
1273
|
+
E === "idle" && !O && !U && /* @__PURE__ */ _(
|
|
1274
1274
|
"button",
|
|
1275
1275
|
{
|
|
1276
1276
|
type: "button",
|
|
@@ -1285,7 +1285,7 @@ const Gn = ({
|
|
|
1285
1285
|
),
|
|
1286
1286
|
/* @__PURE__ */ _("div", { className: "ll-expanded__bottom ll-expanded__bottom--idle", children: [
|
|
1287
1287
|
l && /* @__PURE__ */ n("div", { className: "ll-expanded__transcript", children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: l }) }),
|
|
1288
|
-
|
|
1288
|
+
J && /* @__PURE__ */ n("p", { className: "ll-expanded__cta-sublabel", children: J }),
|
|
1289
1289
|
/* @__PURE__ */ n(
|
|
1290
1290
|
"button",
|
|
1291
1291
|
{
|
|
@@ -1302,32 +1302,32 @@ const Gn = ({
|
|
|
1302
1302
|
/* @__PURE__ */ _(
|
|
1303
1303
|
"div",
|
|
1304
1304
|
{
|
|
1305
|
-
className: `ll-expanded__pip ${
|
|
1305
|
+
className: `ll-expanded__pip ${Te && (z || X) ? "is-visible" : ""}`,
|
|
1306
1306
|
children: [
|
|
1307
1307
|
/* @__PURE__ */ n(
|
|
1308
1308
|
"div",
|
|
1309
1309
|
{
|
|
1310
|
-
ref:
|
|
1311
|
-
className:
|
|
1310
|
+
ref: se,
|
|
1311
|
+
className: X ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
|
|
1312
1312
|
}
|
|
1313
1313
|
),
|
|
1314
1314
|
/* @__PURE__ */ n(
|
|
1315
1315
|
"div",
|
|
1316
1316
|
{
|
|
1317
1317
|
ref: te,
|
|
1318
|
-
className: !
|
|
1318
|
+
className: !X && z ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
|
|
1319
1319
|
}
|
|
1320
1320
|
)
|
|
1321
1321
|
]
|
|
1322
1322
|
}
|
|
1323
1323
|
),
|
|
1324
|
-
|
|
1325
|
-
|
|
1324
|
+
Te ? /* @__PURE__ */ _("div", { className: "ll-expanded__bottom", children: [
|
|
1325
|
+
$e && /* @__PURE__ */ n(
|
|
1326
1326
|
"div",
|
|
1327
1327
|
{
|
|
1328
1328
|
className: "ll-expanded__transcript ll-expanded__transcript--agent",
|
|
1329
1329
|
"data-role": "agent",
|
|
1330
|
-
children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children:
|
|
1330
|
+
children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: $e })
|
|
1331
1331
|
}
|
|
1332
1332
|
),
|
|
1333
1333
|
lt && /* @__PURE__ */ n(
|
|
@@ -1343,10 +1343,10 @@ const Gn = ({
|
|
|
1343
1343
|
"button",
|
|
1344
1344
|
{
|
|
1345
1345
|
type: "button",
|
|
1346
|
-
className: `ll-tool ${
|
|
1347
|
-
onClick:
|
|
1348
|
-
"aria-label":
|
|
1349
|
-
title:
|
|
1346
|
+
className: `ll-tool ${X ? "is-on" : ""}`,
|
|
1347
|
+
onClick: ht,
|
|
1348
|
+
"aria-label": X ? "Stop sharing screen" : "Share screen",
|
|
1349
|
+
title: X ? "Stop sharing" : "Share screen",
|
|
1350
1350
|
children: /* @__PURE__ */ n(nr, {})
|
|
1351
1351
|
}
|
|
1352
1352
|
),
|
|
@@ -1356,7 +1356,7 @@ const Gn = ({
|
|
|
1356
1356
|
{
|
|
1357
1357
|
type: "button",
|
|
1358
1358
|
className: `ll-tool ll-tool--left ${z ? "is-on" : ""}`,
|
|
1359
|
-
onClick:
|
|
1359
|
+
onClick: Me,
|
|
1360
1360
|
"aria-label": z ? "Turn off camera" : "Turn on camera",
|
|
1361
1361
|
title: z ? "Stop camera" : "Start camera",
|
|
1362
1362
|
children: /* @__PURE__ */ n(rr, {})
|
|
@@ -1368,22 +1368,22 @@ const Gn = ({
|
|
|
1368
1368
|
type: "button",
|
|
1369
1369
|
className: `ll-tool ll-tool--right ${z ? "is-on" : ""}`,
|
|
1370
1370
|
onClick: (p) => {
|
|
1371
|
-
p.stopPropagation(), he((
|
|
1371
|
+
p.stopPropagation(), he((J) => !J), pe(!1);
|
|
1372
1372
|
},
|
|
1373
1373
|
"aria-label": "Camera devices",
|
|
1374
1374
|
"aria-haspopup": "listbox",
|
|
1375
|
-
"aria-expanded":
|
|
1375
|
+
"aria-expanded": Pe,
|
|
1376
1376
|
children: /* @__PURE__ */ n(st, {})
|
|
1377
1377
|
}
|
|
1378
1378
|
),
|
|
1379
|
-
|
|
1380
|
-
|
|
1379
|
+
Pe && q.length > 0 && /* @__PURE__ */ n(
|
|
1380
|
+
Jt,
|
|
1381
1381
|
{
|
|
1382
1382
|
label: "Camera",
|
|
1383
|
-
devices:
|
|
1384
|
-
activeId:
|
|
1383
|
+
devices: q,
|
|
1384
|
+
activeId: j,
|
|
1385
1385
|
onPick: (p) => {
|
|
1386
|
-
he(!1),
|
|
1386
|
+
he(!1), Y(p);
|
|
1387
1387
|
}
|
|
1388
1388
|
}
|
|
1389
1389
|
)
|
|
@@ -1391,18 +1391,18 @@ const Gn = ({
|
|
|
1391
1391
|
/* @__PURE__ */ _(
|
|
1392
1392
|
"div",
|
|
1393
1393
|
{
|
|
1394
|
-
className: `ll-tool-split${!
|
|
1394
|
+
className: `ll-tool-split${!ue && K ? " ll-tool-split--gated" : ""}`,
|
|
1395
1395
|
children: [
|
|
1396
1396
|
/* @__PURE__ */ n(
|
|
1397
1397
|
"button",
|
|
1398
1398
|
{
|
|
1399
1399
|
type: "button",
|
|
1400
1400
|
className: `ll-tool ll-tool--left ${m ? "is-muted" : ""}`,
|
|
1401
|
-
onClick:
|
|
1402
|
-
disabled: !
|
|
1403
|
-
"aria-label": !
|
|
1404
|
-
title: !
|
|
1405
|
-
children: /* @__PURE__ */ n(
|
|
1401
|
+
onClick: Re,
|
|
1402
|
+
disabled: !ue && K,
|
|
1403
|
+
"aria-label": !ue && K ? "Microphone enables once the agent finishes its greeting" : m ? "Unmute microphone" : "Mute microphone",
|
|
1404
|
+
title: !ue && K ? "Mic enables after greeting" : m ? "Unmute" : "Mute",
|
|
1405
|
+
children: /* @__PURE__ */ n(or, { muted: m })
|
|
1406
1406
|
}
|
|
1407
1407
|
),
|
|
1408
1408
|
/* @__PURE__ */ n(
|
|
@@ -1411,19 +1411,19 @@ const Gn = ({
|
|
|
1411
1411
|
type: "button",
|
|
1412
1412
|
className: `ll-tool ll-tool--right ${m ? "is-muted" : ""}`,
|
|
1413
1413
|
onClick: (p) => {
|
|
1414
|
-
p.stopPropagation(), pe((
|
|
1414
|
+
p.stopPropagation(), pe((J) => !J), he(!1);
|
|
1415
1415
|
},
|
|
1416
1416
|
"aria-label": "Microphone devices",
|
|
1417
1417
|
"aria-haspopup": "listbox",
|
|
1418
|
-
"aria-expanded":
|
|
1418
|
+
"aria-expanded": ce,
|
|
1419
1419
|
children: /* @__PURE__ */ n(st, {})
|
|
1420
1420
|
}
|
|
1421
1421
|
),
|
|
1422
|
-
|
|
1423
|
-
|
|
1422
|
+
ce && V.length > 0 && /* @__PURE__ */ n(
|
|
1423
|
+
Jt,
|
|
1424
1424
|
{
|
|
1425
1425
|
label: "Microphone",
|
|
1426
|
-
devices:
|
|
1426
|
+
devices: V,
|
|
1427
1427
|
activeId: "",
|
|
1428
1428
|
onPick: () => pe(!1)
|
|
1429
1429
|
}
|
|
@@ -1436,10 +1436,10 @@ const Gn = ({
|
|
|
1436
1436
|
{
|
|
1437
1437
|
type: "button",
|
|
1438
1438
|
className: `ll-tool ${we ? "is-muted" : ""}`,
|
|
1439
|
-
onClick:
|
|
1439
|
+
onClick: mt,
|
|
1440
1440
|
"aria-label": we ? "Unmute speaker" : "Mute speaker",
|
|
1441
1441
|
title: we ? "Unmute speaker" : "Mute speaker",
|
|
1442
|
-
children: /* @__PURE__ */ n(
|
|
1442
|
+
children: /* @__PURE__ */ n(ir, { muted: we })
|
|
1443
1443
|
}
|
|
1444
1444
|
),
|
|
1445
1445
|
/* @__PURE__ */ n(
|
|
@@ -1447,14 +1447,14 @@ const Gn = ({
|
|
|
1447
1447
|
{
|
|
1448
1448
|
type: "button",
|
|
1449
1449
|
className: "ll-tool ll-tool--danger",
|
|
1450
|
-
onClick:
|
|
1450
|
+
onClick: Ce,
|
|
1451
1451
|
"aria-label": "End conversation",
|
|
1452
1452
|
title: "End conversation",
|
|
1453
1453
|
children: /* @__PURE__ */ n(ar, {})
|
|
1454
1454
|
}
|
|
1455
1455
|
)
|
|
1456
1456
|
] }),
|
|
1457
|
-
rt && /* @__PURE__ */ _("form", { className: "ll-message-input", onSubmit:
|
|
1457
|
+
rt && /* @__PURE__ */ _("form", { className: "ll-message-input", onSubmit: We, children: [
|
|
1458
1458
|
/* @__PURE__ */ n(
|
|
1459
1459
|
"input",
|
|
1460
1460
|
{
|
|
@@ -1462,7 +1462,7 @@ const Gn = ({
|
|
|
1462
1462
|
className: "ll-message-input__field",
|
|
1463
1463
|
placeholder: "Message...",
|
|
1464
1464
|
value: me,
|
|
1465
|
-
onChange: (p) =>
|
|
1465
|
+
onChange: (p) => Ve(p.target.value),
|
|
1466
1466
|
"aria-label": "Message the agent"
|
|
1467
1467
|
}
|
|
1468
1468
|
),
|
|
@@ -1478,31 +1478,31 @@ const Gn = ({
|
|
|
1478
1478
|
] })
|
|
1479
1479
|
] }) : null,
|
|
1480
1480
|
(() => {
|
|
1481
|
-
if (
|
|
1481
|
+
if (D && E !== "error")
|
|
1482
1482
|
return /* @__PURE__ */ _("div", { className: "ll-expanded__banner", role: "alert", children: [
|
|
1483
|
-
/* @__PURE__ */ n("span", { children:
|
|
1483
|
+
/* @__PURE__ */ n("span", { children: D }),
|
|
1484
1484
|
/* @__PURE__ */ n(
|
|
1485
1485
|
"button",
|
|
1486
1486
|
{
|
|
1487
1487
|
type: "button",
|
|
1488
1488
|
className: "ll-expanded__banner-x",
|
|
1489
|
-
onClick:
|
|
1489
|
+
onClick: Ue,
|
|
1490
1490
|
"aria-label": "Dismiss",
|
|
1491
1491
|
children: "×"
|
|
1492
1492
|
}
|
|
1493
1493
|
)
|
|
1494
1494
|
] });
|
|
1495
|
-
if (!
|
|
1496
|
-
let p = "Failed to connect",
|
|
1497
|
-
return
|
|
1495
|
+
if (!U || E !== "error") return null;
|
|
1496
|
+
let p = "Failed to connect", J = "Try again";
|
|
1497
|
+
return U === "MIC_PERMISSION_DENIED" ? p = "Microphone blocked. Allow access to talk." : U === "MIC_NOT_FOUND" ? p = "No microphone found. Plug one in + retry." : U === "MIC_UNAVAILABLE" ? p = "Mic unavailable. Check other apps using it." : U === "AGENT_TIMEOUT" ? p = "Agent didn't pick up. Try again." : U === "CONNECT_FAILED" ? p = "Connection failed. Check your network." : U.length < 80 && (p = U), /* @__PURE__ */ _("div", { className: "ll-expanded__banner ll-expanded__banner--error", role: "alert", children: [
|
|
1498
1498
|
/* @__PURE__ */ n("span", { children: p }),
|
|
1499
1499
|
/* @__PURE__ */ n(
|
|
1500
1500
|
"button",
|
|
1501
1501
|
{
|
|
1502
1502
|
type: "button",
|
|
1503
1503
|
className: "ll-expanded__banner-retry",
|
|
1504
|
-
onClick:
|
|
1505
|
-
children:
|
|
1504
|
+
onClick: Ne,
|
|
1505
|
+
children: J
|
|
1506
1506
|
}
|
|
1507
1507
|
)
|
|
1508
1508
|
] });
|
|
@@ -1514,13 +1514,13 @@ const Gn = ({
|
|
|
1514
1514
|
function st() {
|
|
1515
1515
|
return /* @__PURE__ */ n("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": !0, children: /* @__PURE__ */ n("polyline", { points: "6 9 12 15 18 9" }) });
|
|
1516
1516
|
}
|
|
1517
|
-
function
|
|
1517
|
+
function Gt() {
|
|
1518
1518
|
return /* @__PURE__ */ _("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": !0, children: [
|
|
1519
1519
|
/* @__PURE__ */ n("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
1520
1520
|
/* @__PURE__ */ n("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
1521
1521
|
] });
|
|
1522
1522
|
}
|
|
1523
|
-
function
|
|
1523
|
+
function Yt() {
|
|
1524
1524
|
return /* @__PURE__ */ n("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": !0, children: /* @__PURE__ */ n("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) });
|
|
1525
1525
|
}
|
|
1526
1526
|
function nr() {
|
|
@@ -1536,7 +1536,7 @@ function rr() {
|
|
|
1536
1536
|
/* @__PURE__ */ n("rect", { x: "1", y: "5", width: "15", height: "14", rx: "2" })
|
|
1537
1537
|
] });
|
|
1538
1538
|
}
|
|
1539
|
-
function
|
|
1539
|
+
function or({ muted: e }) {
|
|
1540
1540
|
return /* @__PURE__ */ _("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
|
|
1541
1541
|
/* @__PURE__ */ n("path", { d: "M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z" }),
|
|
1542
1542
|
/* @__PURE__ */ n("path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }),
|
|
@@ -1544,10 +1544,10 @@ function ir({ muted: e }) {
|
|
|
1544
1544
|
e && /* @__PURE__ */ n("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
|
|
1545
1545
|
] });
|
|
1546
1546
|
}
|
|
1547
|
-
function
|
|
1547
|
+
function ir({ muted: e }) {
|
|
1548
1548
|
return /* @__PURE__ */ _("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
|
|
1549
1549
|
/* @__PURE__ */ n("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
|
|
1550
|
-
e ? /* @__PURE__ */ n("line", { x1: "23", y1: "9", x2: "17", y2: "15" }) : /* @__PURE__ */ _(
|
|
1550
|
+
e ? /* @__PURE__ */ n("line", { x1: "23", y1: "9", x2: "17", y2: "15" }) : /* @__PURE__ */ _(St, { children: [
|
|
1551
1551
|
/* @__PURE__ */ n("path", { d: "M19.07 4.93a10 10 0 0 1 0 14.14" }),
|
|
1552
1552
|
/* @__PURE__ */ n("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" })
|
|
1553
1553
|
] })
|
|
@@ -1568,30 +1568,30 @@ function ar() {
|
|
|
1568
1568
|
}
|
|
1569
1569
|
) });
|
|
1570
1570
|
}
|
|
1571
|
-
const
|
|
1571
|
+
const Jt = ({ label: e, devices: t, activeId: r, onPick: o }) => /* @__PURE__ */ _(
|
|
1572
1572
|
"div",
|
|
1573
1573
|
{
|
|
1574
1574
|
className: "ll-device-menu",
|
|
1575
|
-
onClick: (
|
|
1575
|
+
onClick: (i) => i.stopPropagation(),
|
|
1576
1576
|
role: "listbox",
|
|
1577
1577
|
children: [
|
|
1578
1578
|
/* @__PURE__ */ n("p", { className: "ll-device-menu__label", children: e }),
|
|
1579
|
-
t.map((
|
|
1580
|
-
const
|
|
1579
|
+
t.map((i, l) => {
|
|
1580
|
+
const d = r === i.deviceId;
|
|
1581
1581
|
return /* @__PURE__ */ _(
|
|
1582
1582
|
"button",
|
|
1583
1583
|
{
|
|
1584
1584
|
type: "button",
|
|
1585
|
-
className: `ll-device-menu__item ${
|
|
1586
|
-
onClick: () => i
|
|
1585
|
+
className: `ll-device-menu__item ${d ? "is-active" : ""}`,
|
|
1586
|
+
onClick: () => o(i.deviceId),
|
|
1587
1587
|
role: "option",
|
|
1588
|
-
"aria-selected":
|
|
1588
|
+
"aria-selected": d,
|
|
1589
1589
|
children: [
|
|
1590
|
-
|
|
1591
|
-
/* @__PURE__ */ n("span", { className: "ll-device-menu__name", children:
|
|
1590
|
+
d && /* @__PURE__ */ n("span", { className: "ll-device-menu__dot", children: "●" }),
|
|
1591
|
+
/* @__PURE__ */ n("span", { className: "ll-device-menu__name", children: i.label || `${e} ${l + 1}` })
|
|
1592
1592
|
]
|
|
1593
1593
|
},
|
|
1594
|
-
|
|
1594
|
+
i.deviceId || l
|
|
1595
1595
|
);
|
|
1596
1596
|
})
|
|
1597
1597
|
]
|
|
@@ -1609,7 +1609,7 @@ function Ct(e) {
|
|
|
1609
1609
|
}
|
|
1610
1610
|
return !1;
|
|
1611
1611
|
}
|
|
1612
|
-
function
|
|
1612
|
+
function pt(e) {
|
|
1613
1613
|
if (Ct(e)) return !1;
|
|
1614
1614
|
if (e instanceof HTMLInputElement) {
|
|
1615
1615
|
if (e.type === "password") return !1;
|
|
@@ -1618,7 +1618,7 @@ function ft(e) {
|
|
|
1618
1618
|
}
|
|
1619
1619
|
return !0;
|
|
1620
1620
|
}
|
|
1621
|
-
const ct = 4096, cr = 20, dr = 20, ur = 10, fr = 10, pr = 30,
|
|
1621
|
+
const ct = 4096, cr = 20, dr = 20, ur = 10, fr = 10, pr = 30, Kt = 500, hr = [
|
|
1622
1622
|
'[data-ll-private="true"]',
|
|
1623
1623
|
".ll-widget",
|
|
1624
1624
|
"script",
|
|
@@ -1640,10 +1640,10 @@ function et(e) {
|
|
|
1640
1640
|
if (typeof window > "u") return !0;
|
|
1641
1641
|
const t = e.getBoundingClientRect();
|
|
1642
1642
|
if (t.width <= 0 || t.height <= 0) return !1;
|
|
1643
|
-
const r = window.innerHeight || document.documentElement.clientHeight,
|
|
1644
|
-
return t.bottom > 0 && t.right > 0 && t.top < r && t.left <
|
|
1643
|
+
const r = window.innerHeight || document.documentElement.clientHeight, o = window.innerWidth || document.documentElement.clientWidth;
|
|
1644
|
+
return t.bottom > 0 && t.right > 0 && t.top < r && t.left < o;
|
|
1645
1645
|
}
|
|
1646
|
-
function
|
|
1646
|
+
function Xt(e) {
|
|
1647
1647
|
const t = e.getAttribute("id");
|
|
1648
1648
|
if (t) {
|
|
1649
1649
|
const l = document.querySelector(`label[for="${CSS.escape(t)}"]`);
|
|
@@ -1651,15 +1651,15 @@ function Gt(e) {
|
|
|
1651
1651
|
}
|
|
1652
1652
|
const r = e.getAttribute("aria-label");
|
|
1653
1653
|
if (r) return r.trim();
|
|
1654
|
-
const
|
|
1655
|
-
if (
|
|
1656
|
-
const
|
|
1657
|
-
return
|
|
1654
|
+
const o = e.getAttribute("placeholder");
|
|
1655
|
+
if (o) return o.trim();
|
|
1656
|
+
const i = e.closest("label");
|
|
1657
|
+
return i != null && i.textContent ? i.textContent.trim() : "";
|
|
1658
1658
|
}
|
|
1659
1659
|
function Ee(e, t) {
|
|
1660
1660
|
return e.length <= t ? e : e.slice(0, t - 1) + "…";
|
|
1661
1661
|
}
|
|
1662
|
-
function
|
|
1662
|
+
function ze(e) {
|
|
1663
1663
|
return e.length;
|
|
1664
1664
|
}
|
|
1665
1665
|
function mr(e, t = {}) {
|
|
@@ -1676,102 +1676,102 @@ function mr(e, t = {}) {
|
|
|
1676
1676
|
forms: [],
|
|
1677
1677
|
extras: e
|
|
1678
1678
|
};
|
|
1679
|
-
const
|
|
1679
|
+
const o = typeof window < "u" && window.location.href || "", i = typeof window < "u" && window.location.pathname || "/", l = r.title || "", d = Array.from(
|
|
1680
1680
|
r.querySelectorAll("[data-ll-region]")
|
|
1681
1681
|
), u = [];
|
|
1682
|
-
for (const m of
|
|
1682
|
+
for (const m of d) {
|
|
1683
1683
|
if (u.length >= ur) break;
|
|
1684
1684
|
if (Ze(m) || !et(m)) continue;
|
|
1685
|
-
const
|
|
1685
|
+
const D = m.getAttribute("data-ll-region") ?? "", V = m.getAttribute("data-ll-intent") ?? void 0, z = Ee(
|
|
1686
1686
|
(m.innerText || m.textContent || "").trim(),
|
|
1687
|
-
|
|
1687
|
+
Kt * 2
|
|
1688
1688
|
);
|
|
1689
|
-
!
|
|
1689
|
+
!D || !z || u.push({ id: D, intent: V, text: z });
|
|
1690
1690
|
}
|
|
1691
1691
|
const f = [], y = ["H1", "H2", "H3", "H4", "H5", "H6"], b = Array.from(
|
|
1692
1692
|
r.querySelectorAll("h1, h2, h3, h4, h5, h6")
|
|
1693
1693
|
);
|
|
1694
1694
|
for (const m of b) {
|
|
1695
1695
|
if (Ze(m) || !et(m)) continue;
|
|
1696
|
-
const
|
|
1697
|
-
|
|
1696
|
+
const D = (m.textContent || "").trim();
|
|
1697
|
+
D && f.push(`${m.tagName}: ${Ee(D, 200)}`);
|
|
1698
1698
|
}
|
|
1699
1699
|
const s = Array.from(r.querySelectorAll("p, li"));
|
|
1700
1700
|
for (const m of s) {
|
|
1701
1701
|
if (Ze(m) || !et(m) || y.includes(m.tagName)) continue;
|
|
1702
|
-
const
|
|
1703
|
-
|
|
1702
|
+
const D = (m.textContent || "").trim();
|
|
1703
|
+
D.length > 10 && f.push(Ee(D, Kt));
|
|
1704
1704
|
}
|
|
1705
1705
|
const a = f.join(`
|
|
1706
|
-
`),
|
|
1707
|
-
for (const m of
|
|
1708
|
-
if (
|
|
1706
|
+
`), k = [], N = Array.from(r.querySelectorAll("a[href]"));
|
|
1707
|
+
for (const m of N) {
|
|
1708
|
+
if (k.length >= cr) break;
|
|
1709
1709
|
if (Ze(m) || !et(m)) continue;
|
|
1710
|
-
const
|
|
1711
|
-
!
|
|
1710
|
+
const D = m.getAttribute("href") || "", V = (m.textContent || "").trim();
|
|
1711
|
+
!D || !V || k.push({ href: D, text: Ee(V, 100) });
|
|
1712
1712
|
}
|
|
1713
|
-
const
|
|
1713
|
+
const E = [], v = Array.from(
|
|
1714
1714
|
r.querySelectorAll(
|
|
1715
1715
|
"input, textarea, select"
|
|
1716
1716
|
)
|
|
1717
1717
|
);
|
|
1718
1718
|
for (const m of v) {
|
|
1719
|
-
if (
|
|
1720
|
-
if (Ze(m) || !
|
|
1721
|
-
const
|
|
1722
|
-
|
|
1719
|
+
if (E.length >= dr) break;
|
|
1720
|
+
if (Ze(m) || !pt(m) || !et(m)) continue;
|
|
1721
|
+
const D = Xt(m), V = m instanceof HTMLInputElement ? m.type : m.tagName.toLowerCase();
|
|
1722
|
+
D && E.push({ label: Ee(D, 100), type: V });
|
|
1723
1723
|
}
|
|
1724
1724
|
const w = Array.from(
|
|
1725
1725
|
r.querySelectorAll("[data-ll-form]")
|
|
1726
|
-
),
|
|
1726
|
+
), O = [];
|
|
1727
1727
|
for (const m of w) {
|
|
1728
|
-
if (
|
|
1728
|
+
if (O.length >= fr) break;
|
|
1729
1729
|
if (Ct(m)) continue;
|
|
1730
|
-
const
|
|
1731
|
-
if (!
|
|
1732
|
-
const
|
|
1730
|
+
const D = m.getAttribute("data-ll-form") || "";
|
|
1731
|
+
if (!D) continue;
|
|
1732
|
+
const V = m.getAttribute("data-ll-intent") || void 0, z = Array.from(
|
|
1733
1733
|
m.querySelectorAll(
|
|
1734
1734
|
"[data-ll-field]"
|
|
1735
1735
|
)
|
|
1736
|
-
),
|
|
1737
|
-
for (const
|
|
1738
|
-
if (
|
|
1739
|
-
if (!
|
|
1740
|
-
const
|
|
1741
|
-
if (!
|
|
1742
|
-
const
|
|
1743
|
-
|
|
1736
|
+
), T = [];
|
|
1737
|
+
for (const q of z) {
|
|
1738
|
+
if (T.length >= pr) break;
|
|
1739
|
+
if (!pt(q)) continue;
|
|
1740
|
+
const j = q.getAttribute("data-ll-field") || "";
|
|
1741
|
+
if (!j) continue;
|
|
1742
|
+
const X = Xt(q) || j, ie = q instanceof HTMLInputElement ? q.type : q.tagName.toLowerCase();
|
|
1743
|
+
T.push({ name: j, label: Ee(X, 100), type: ie });
|
|
1744
1744
|
}
|
|
1745
|
-
|
|
1745
|
+
O.push({ id: D, intent: V, fields: T });
|
|
1746
1746
|
}
|
|
1747
|
-
const
|
|
1748
|
-
url:
|
|
1747
|
+
const $ = {
|
|
1748
|
+
url: o,
|
|
1749
1749
|
title: l,
|
|
1750
|
-
pathname:
|
|
1750
|
+
pathname: i,
|
|
1751
1751
|
regions: u,
|
|
1752
1752
|
visibleText: a,
|
|
1753
|
-
visibleLinks:
|
|
1754
|
-
visibleFields:
|
|
1755
|
-
forms:
|
|
1753
|
+
visibleLinks: k,
|
|
1754
|
+
visibleFields: E,
|
|
1755
|
+
forms: O,
|
|
1756
1756
|
extras: e
|
|
1757
1757
|
};
|
|
1758
|
-
let
|
|
1759
|
-
for (;
|
|
1760
|
-
|
|
1761
|
-
for (;
|
|
1762
|
-
|
|
1763
|
-
return
|
|
1764
|
-
}
|
|
1765
|
-
let
|
|
1766
|
-
function
|
|
1767
|
-
const r = Date.now(),
|
|
1768
|
-
if (
|
|
1769
|
-
return
|
|
1758
|
+
let U = ze(JSON.stringify($.regions)) + ze($.visibleText) + ze(JSON.stringify($.visibleLinks)) + ze(JSON.stringify($.visibleFields));
|
|
1759
|
+
for (; U > ct && $.visibleFields.length > 0; )
|
|
1760
|
+
$.visibleFields.pop(), U = ze(JSON.stringify($.visibleFields));
|
|
1761
|
+
for (; U > ct && $.visibleLinks.length > 0; )
|
|
1762
|
+
$.visibleLinks.pop(), U -= 80;
|
|
1763
|
+
return ze($.visibleText) > ct && ($.visibleText = Ee($.visibleText, ct - 100)), $;
|
|
1764
|
+
}
|
|
1765
|
+
let Oe = null;
|
|
1766
|
+
function kt(e, t = {}) {
|
|
1767
|
+
const r = Date.now(), i = `${typeof window < "u" && window.location.pathname || "/"}::${typeof window < "u" ? window.scrollY : 0}`;
|
|
1768
|
+
if (Oe && Oe.key === i && r - Oe.at < 1e3)
|
|
1769
|
+
return Oe.ctx;
|
|
1770
1770
|
const l = mr(e, t);
|
|
1771
|
-
return
|
|
1771
|
+
return Oe = { key: i, at: r, ctx: l }, l;
|
|
1772
1772
|
}
|
|
1773
1773
|
function gr() {
|
|
1774
|
-
|
|
1774
|
+
Oe = null;
|
|
1775
1775
|
}
|
|
1776
1776
|
const yr = 200;
|
|
1777
1777
|
function vr(e) {
|
|
@@ -1790,11 +1790,11 @@ function br(e) {
|
|
|
1790
1790
|
function wr(e) {
|
|
1791
1791
|
const t = e ?? (typeof document < "u" ? document : null);
|
|
1792
1792
|
if (!t) return [];
|
|
1793
|
-
const r = typeof window < "u" && window.location.origin || "",
|
|
1794
|
-
for (const
|
|
1795
|
-
if (
|
|
1796
|
-
if (Ct(
|
|
1797
|
-
const u =
|
|
1793
|
+
const r = typeof window < "u" && window.location.origin || "", o = /* @__PURE__ */ new Set(), i = [], l = Array.from(t.querySelectorAll("a[href]"));
|
|
1794
|
+
for (const d of l) {
|
|
1795
|
+
if (i.length >= yr) break;
|
|
1796
|
+
if (Ct(d)) continue;
|
|
1797
|
+
const u = d.getAttribute("href") || "";
|
|
1798
1798
|
if (!br(u)) continue;
|
|
1799
1799
|
let f = u, y = !0;
|
|
1800
1800
|
try {
|
|
@@ -1805,40 +1805,40 @@ function wr(e) {
|
|
|
1805
1805
|
} catch {
|
|
1806
1806
|
continue;
|
|
1807
1807
|
}
|
|
1808
|
-
if (
|
|
1809
|
-
|
|
1810
|
-
const b = (
|
|
1811
|
-
|
|
1808
|
+
if (o.has(f)) continue;
|
|
1809
|
+
o.add(f);
|
|
1810
|
+
const b = (d.textContent || "").trim().slice(0, 120);
|
|
1811
|
+
i.push({ href: f, text: b, internal: y });
|
|
1812
1812
|
}
|
|
1813
|
-
return
|
|
1813
|
+
return i;
|
|
1814
1814
|
}
|
|
1815
|
-
let
|
|
1815
|
+
let He = null;
|
|
1816
1816
|
const _r = 5e3;
|
|
1817
|
-
function
|
|
1817
|
+
function dt() {
|
|
1818
1818
|
const e = Date.now(), t = typeof window < "u" && window.location.pathname || "/";
|
|
1819
|
-
if (
|
|
1820
|
-
return
|
|
1819
|
+
if (He && He.pathname === t && e - He.at < _r)
|
|
1820
|
+
return He.routes;
|
|
1821
1821
|
const r = wr();
|
|
1822
|
-
return
|
|
1822
|
+
return He = { at: e, pathname: t, routes: r }, r;
|
|
1823
1823
|
}
|
|
1824
1824
|
function xr() {
|
|
1825
|
-
|
|
1825
|
+
He = null;
|
|
1826
1826
|
}
|
|
1827
1827
|
function kr(e, t) {
|
|
1828
|
-
const r = e instanceof HTMLInputElement ? HTMLInputElement.prototype : e instanceof HTMLTextAreaElement ? HTMLTextAreaElement.prototype : HTMLSelectElement.prototype,
|
|
1829
|
-
|
|
1828
|
+
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;
|
|
1829
|
+
i ? i.call(e, t) : e.value = t;
|
|
1830
1830
|
}
|
|
1831
1831
|
function Lr(e, t, r = {}) {
|
|
1832
|
-
const
|
|
1832
|
+
const o = r.triggerInput ?? !0, i = r.triggerChange ?? !0;
|
|
1833
1833
|
if (e instanceof HTMLInputElement && (e.type === "checkbox" || e.type === "radio")) {
|
|
1834
1834
|
const l = Object.getOwnPropertyDescriptor(
|
|
1835
1835
|
HTMLInputElement.prototype,
|
|
1836
1836
|
"checked"
|
|
1837
|
-
),
|
|
1838
|
-
|
|
1837
|
+
), d = l == null ? void 0 : l.set, u = t === "true" || t === "1" || t === "on";
|
|
1838
|
+
d ? d.call(e, u) : e.checked = u, o && e.dispatchEvent(new Event("input", { bubbles: !0 })), i && e.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
1839
1839
|
return;
|
|
1840
1840
|
}
|
|
1841
|
-
kr(e, t),
|
|
1841
|
+
kr(e, t), o && e.dispatchEvent(new Event("input", { bubbles: !0 })), i && e.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
1842
1842
|
}
|
|
1843
1843
|
function Sr() {
|
|
1844
1844
|
if (typeof window > "u" || typeof document > "u")
|
|
@@ -1848,23 +1848,23 @@ function Sr() {
|
|
|
1848
1848
|
const t = window.getComputedStyle(e);
|
|
1849
1849
|
return !(t.overflowY === "hidden" || t.overflowY === "clip");
|
|
1850
1850
|
}
|
|
1851
|
-
function
|
|
1851
|
+
function Er(e) {
|
|
1852
1852
|
if (!(e instanceof HTMLElement)) return !1;
|
|
1853
1853
|
const r = window.getComputedStyle(e).overflowY;
|
|
1854
1854
|
return !(r !== "auto" && r !== "scroll" || e.scrollHeight <= e.clientHeight + 2);
|
|
1855
1855
|
}
|
|
1856
|
-
function
|
|
1856
|
+
function Cr() {
|
|
1857
1857
|
if (typeof document > "u") return null;
|
|
1858
1858
|
const e = Array.from(
|
|
1859
1859
|
document.querySelectorAll("body, body *")
|
|
1860
1860
|
);
|
|
1861
1861
|
let t = null, r = 0;
|
|
1862
|
-
for (const
|
|
1863
|
-
if (!
|
|
1864
|
-
const
|
|
1865
|
-
if (
|
|
1866
|
-
const l =
|
|
1867
|
-
l > r && (r = l, t =
|
|
1862
|
+
for (const o of e) {
|
|
1863
|
+
if (!Er(o)) continue;
|
|
1864
|
+
const i = o.getBoundingClientRect();
|
|
1865
|
+
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;
|
|
1866
|
+
const l = i.width * i.height;
|
|
1867
|
+
l > r && (r = l, t = o);
|
|
1868
1868
|
}
|
|
1869
1869
|
return t;
|
|
1870
1870
|
}
|
|
@@ -1872,7 +1872,7 @@ function Nr() {
|
|
|
1872
1872
|
if (typeof window > "u")
|
|
1873
1873
|
return null;
|
|
1874
1874
|
if (Sr()) return window;
|
|
1875
|
-
const e =
|
|
1875
|
+
const e = Cr();
|
|
1876
1876
|
return e || window;
|
|
1877
1877
|
}
|
|
1878
1878
|
function Qt(e) {
|
|
@@ -1909,797 +1909,845 @@ const Rr = /* @__PURE__ */ new Set([
|
|
|
1909
1909
|
"request_routes"
|
|
1910
1910
|
]);
|
|
1911
1911
|
function Mr(e) {
|
|
1912
|
-
var Mt,
|
|
1912
|
+
var Mt, Dt, Tt, It, Pt, $t, Bt;
|
|
1913
1913
|
const {
|
|
1914
1914
|
agentId: t,
|
|
1915
1915
|
apiKey: r,
|
|
1916
|
-
baseUrl:
|
|
1917
|
-
sessionEndpoint:
|
|
1916
|
+
baseUrl: o = "https://app.livelayer.studio",
|
|
1917
|
+
sessionEndpoint: i,
|
|
1918
1918
|
sessionBody: l,
|
|
1919
|
-
autoConnect:
|
|
1919
|
+
autoConnect: d = !1,
|
|
1920
1920
|
displayMode: u,
|
|
1921
1921
|
defaultDisplayMode: f = "expanded",
|
|
1922
1922
|
onDisplayModeChange: y,
|
|
1923
1923
|
position: b = "bottom-right",
|
|
1924
1924
|
mobileBreakpoint: s = 640,
|
|
1925
1925
|
persistKey: a = "ll-widget",
|
|
1926
|
-
disablePersistence:
|
|
1927
|
-
teamMembers:
|
|
1928
|
-
currentTeamMemberId:
|
|
1926
|
+
disablePersistence: k = !1,
|
|
1927
|
+
teamMembers: N,
|
|
1928
|
+
currentTeamMemberId: E,
|
|
1929
1929
|
onTeamMemberChange: v,
|
|
1930
1930
|
idleLoopUrl: w,
|
|
1931
|
-
greeting:
|
|
1932
|
-
avatarImageUrl:
|
|
1933
|
-
agentName:
|
|
1931
|
+
greeting: O,
|
|
1932
|
+
avatarImageUrl: $,
|
|
1933
|
+
agentName: U,
|
|
1934
1934
|
branding: m = {},
|
|
1935
|
-
allowCamera:
|
|
1936
|
-
allowScreenShare:
|
|
1935
|
+
allowCamera: D = !0,
|
|
1936
|
+
allowScreenShare: V = !0,
|
|
1937
1937
|
allowTyping: z = !0,
|
|
1938
|
-
showOn:
|
|
1939
|
-
hideOn:
|
|
1940
|
-
pathname:
|
|
1941
|
-
onNavigate:
|
|
1938
|
+
showOn: T,
|
|
1939
|
+
hideOn: q,
|
|
1940
|
+
pathname: j,
|
|
1941
|
+
onNavigate: X,
|
|
1942
1942
|
onScrollToSelector: ie,
|
|
1943
1943
|
getPageContext: we,
|
|
1944
1944
|
pageContextExtras: tt,
|
|
1945
1945
|
getRoutes: nt,
|
|
1946
1946
|
onScrollPage: rt,
|
|
1947
|
-
onClick:
|
|
1947
|
+
onClick: ot,
|
|
1948
1948
|
capabilities: re,
|
|
1949
|
-
onConnect:
|
|
1949
|
+
onConnect: ue,
|
|
1950
1950
|
onDisconnect: _e,
|
|
1951
|
-
onTranscript:
|
|
1952
|
-
onAgentState:
|
|
1953
|
-
onConnectionStateChange:
|
|
1954
|
-
onAgentEvent:
|
|
1955
|
-
onAgentCommand:
|
|
1956
|
-
controlledSession:
|
|
1957
|
-
className:
|
|
1958
|
-
style:
|
|
1959
|
-
zIndex:
|
|
1960
|
-
} = e,
|
|
1961
|
-
|
|
1951
|
+
onTranscript: Ce,
|
|
1952
|
+
onAgentState: Ne,
|
|
1953
|
+
onConnectionStateChange: Ae,
|
|
1954
|
+
onAgentEvent: Re,
|
|
1955
|
+
onAgentCommand: Me,
|
|
1956
|
+
controlledSession: Y,
|
|
1957
|
+
className: ht,
|
|
1958
|
+
style: mt,
|
|
1959
|
+
zIndex: it = 2147483647
|
|
1960
|
+
} = e, le = zn(j), De = Fn(le, T, q);
|
|
1961
|
+
R(() => {
|
|
1962
1962
|
gr(), xr();
|
|
1963
|
-
}, [
|
|
1964
|
-
const
|
|
1963
|
+
}, [le]);
|
|
1964
|
+
const Ue = E !== void 0, [xe, Te] = S(() => {
|
|
1965
1965
|
var h;
|
|
1966
|
-
return
|
|
1967
|
-
}),
|
|
1968
|
-
() => (
|
|
1969
|
-
[
|
|
1970
|
-
),
|
|
1966
|
+
return E ?? ((h = N == null ? void 0 : N[0]) == null ? void 0 : h.id);
|
|
1967
|
+
}), K = Ue ? E : xe, ee = ut(
|
|
1968
|
+
() => (N == null ? void 0 : N.find((h) => h.id === K)) ?? null,
|
|
1969
|
+
[N, K]
|
|
1970
|
+
), Ie = (ee == null ? void 0 : ee.agentId) ?? t, [ae, fe] = In({
|
|
1971
1971
|
value: u,
|
|
1972
1972
|
defaultValue: f,
|
|
1973
1973
|
onChange: y,
|
|
1974
1974
|
persistKey: a,
|
|
1975
|
-
disablePersistence:
|
|
1976
|
-
}), ke = $n(s),
|
|
1977
|
-
|
|
1975
|
+
disablePersistence: k
|
|
1976
|
+
}), ke = $n(s), qe = xn(), te = kn(), se = Sn(), ce = En(), pe = Cn(), [Pe, he] = S(!1), [me, Ve] = S(!1), [We, Fe] = S(!1), [ge, ye] = S(!1), [$e, lt] = S(!1), je = M(X), Be = M(ie), p = M(rt), J = M(ot), gt = M(we), yt = M(tt), vt = M(nt), bt = M(re), ne = M(null);
|
|
1977
|
+
je.current = X, Be.current = ie, p.current = rt, J.current = ot, gt.current = we, yt.current = tt, vt.current = nt, bt.current = re;
|
|
1978
1978
|
function ve(h) {
|
|
1979
|
-
const
|
|
1980
|
-
return
|
|
1979
|
+
const c = bt.current;
|
|
1980
|
+
return c ? c.includes(h) : !0;
|
|
1981
1981
|
}
|
|
1982
|
-
function be(h,
|
|
1982
|
+
function be(h, c) {
|
|
1983
1983
|
console.warn(
|
|
1984
|
-
`[LiveLayer] Agent command "${h}" blocked — capability "${
|
|
1984
|
+
`[LiveLayer] Agent command "${h}" blocked — capability "${c}" not in allowlist. See https://livelayer.studio/docs/react/capabilities`
|
|
1985
1985
|
);
|
|
1986
1986
|
}
|
|
1987
|
-
const
|
|
1987
|
+
const Ge = L(
|
|
1988
1988
|
(h) => {
|
|
1989
|
-
var Z, Le,
|
|
1990
|
-
const
|
|
1991
|
-
if (!(!
|
|
1992
|
-
if (
|
|
1989
|
+
var Z, Le, oe, Xe, Qe;
|
|
1990
|
+
const c = h;
|
|
1991
|
+
if (!(!c.type || typeof c.type != "string")) {
|
|
1992
|
+
if (Re == null || Re({ eventName: c.type, data: h }), c.type === "navigate") {
|
|
1993
1993
|
if (!ve("navigate")) {
|
|
1994
1994
|
be("navigate", "navigate");
|
|
1995
1995
|
return;
|
|
1996
1996
|
}
|
|
1997
|
-
const
|
|
1998
|
-
if (!
|
|
1997
|
+
const x = typeof c.href == "string" ? c.href : null;
|
|
1998
|
+
if (!x) {
|
|
1999
1999
|
console.warn(
|
|
2000
2000
|
`[LiveLayer] Agent emitted "navigate" without href. Skipping. Check your agent's tool schema. See https://livelayer.studio/docs/errors/navigate-missing-href`
|
|
2001
2001
|
);
|
|
2002
2002
|
return;
|
|
2003
2003
|
}
|
|
2004
|
-
if (
|
|
2004
|
+
if (je.current) {
|
|
2005
2005
|
try {
|
|
2006
|
-
|
|
2007
|
-
} catch (
|
|
2006
|
+
je.current(x);
|
|
2007
|
+
} catch (A) {
|
|
2008
2008
|
console.warn(
|
|
2009
|
-
`[LiveLayer] onNavigate threw for "${
|
|
2010
|
-
|
|
2009
|
+
`[LiveLayer] onNavigate threw for "${x}". Falling back. Error:`,
|
|
2010
|
+
A
|
|
2011
2011
|
);
|
|
2012
2012
|
}
|
|
2013
2013
|
return;
|
|
2014
2014
|
}
|
|
2015
2015
|
if (typeof document < "u") {
|
|
2016
|
-
const
|
|
2017
|
-
`a[href="${
|
|
2016
|
+
const A = document.querySelector(
|
|
2017
|
+
`a[href="${x.replace(/"/g, '\\"')}"]`
|
|
2018
2018
|
);
|
|
2019
|
-
if (
|
|
2020
|
-
|
|
2019
|
+
if (A) {
|
|
2020
|
+
A.click();
|
|
2021
2021
|
return;
|
|
2022
2022
|
}
|
|
2023
2023
|
}
|
|
2024
2024
|
if (typeof window < "u" && typeof history < "u")
|
|
2025
2025
|
try {
|
|
2026
|
-
history.pushState({}, "",
|
|
2027
|
-
} catch (
|
|
2026
|
+
history.pushState({}, "", x), window.dispatchEvent(new PopStateEvent("popstate"));
|
|
2027
|
+
} catch (A) {
|
|
2028
2028
|
console.warn(
|
|
2029
|
-
`[LiveLayer] history.pushState fallback failed for "${
|
|
2030
|
-
|
|
2029
|
+
`[LiveLayer] history.pushState fallback failed for "${x}". Pass an onNavigate prop to use your router directly. See https://livelayer.studio/docs/react/navigation`,
|
|
2030
|
+
A
|
|
2031
2031
|
);
|
|
2032
2032
|
}
|
|
2033
2033
|
return;
|
|
2034
2034
|
}
|
|
2035
|
-
if (
|
|
2035
|
+
if (c.type === "scroll_to") {
|
|
2036
2036
|
if (!ve("scroll")) {
|
|
2037
2037
|
be("scroll_to", "scroll");
|
|
2038
2038
|
return;
|
|
2039
2039
|
}
|
|
2040
|
-
const
|
|
2041
|
-
if (!
|
|
2042
|
-
const
|
|
2043
|
-
if (
|
|
2040
|
+
const x = typeof c.selector == "string" ? c.selector : null;
|
|
2041
|
+
if (!x) return;
|
|
2042
|
+
const A = c.behavior === "instant" ? "instant" : "smooth";
|
|
2043
|
+
if (Be.current) {
|
|
2044
2044
|
try {
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2045
|
+
Be.current(
|
|
2046
|
+
x,
|
|
2047
|
+
A
|
|
2048
2048
|
);
|
|
2049
|
-
} catch (
|
|
2050
|
-
console.warn("[LiveLayer] onScrollToSelector threw.",
|
|
2049
|
+
} catch (C) {
|
|
2050
|
+
console.warn("[LiveLayer] onScrollToSelector threw.", C);
|
|
2051
2051
|
}
|
|
2052
2052
|
return;
|
|
2053
2053
|
}
|
|
2054
2054
|
if (typeof document < "u") {
|
|
2055
|
-
let
|
|
2055
|
+
let C = null;
|
|
2056
2056
|
try {
|
|
2057
|
-
|
|
2057
|
+
C = document.querySelector(x);
|
|
2058
2058
|
} catch {
|
|
2059
2059
|
console.warn(
|
|
2060
|
-
`[LiveLayer] scroll_to: invalid selector "${
|
|
2060
|
+
`[LiveLayer] scroll_to: invalid selector "${x}".`
|
|
2061
2061
|
);
|
|
2062
2062
|
return;
|
|
2063
2063
|
}
|
|
2064
|
-
if (!
|
|
2064
|
+
if (!C) {
|
|
2065
2065
|
console.warn(
|
|
2066
|
-
`[LiveLayer] scroll_to: no element matched "${
|
|
2066
|
+
`[LiveLayer] scroll_to: no element matched "${x}". The user may be on a different page. See https://livelayer.studio/docs/errors/scroll-no-match`
|
|
2067
2067
|
);
|
|
2068
2068
|
return;
|
|
2069
2069
|
}
|
|
2070
|
-
|
|
2071
|
-
behavior:
|
|
2070
|
+
C.scrollIntoView({
|
|
2071
|
+
behavior: A,
|
|
2072
2072
|
block: "start"
|
|
2073
2073
|
});
|
|
2074
2074
|
}
|
|
2075
2075
|
return;
|
|
2076
2076
|
}
|
|
2077
|
-
if (
|
|
2077
|
+
if (c.type === "request_page_context") {
|
|
2078
2078
|
if (!ve("read_page")) {
|
|
2079
2079
|
be("request_page_context", "read_page");
|
|
2080
2080
|
return;
|
|
2081
2081
|
}
|
|
2082
|
-
const
|
|
2083
|
-
const
|
|
2084
|
-
if (
|
|
2082
|
+
const x = typeof c.requestId == "string" ? c.requestId : void 0, A = (Z = ne.current) == null ? void 0 : Z.call(ne), C = (W) => {
|
|
2083
|
+
const I = A, F = I == null ? void 0 : I.localParticipant;
|
|
2084
|
+
if (F != null && F.publishData)
|
|
2085
2085
|
try {
|
|
2086
|
-
const
|
|
2087
|
-
|
|
2088
|
-
} catch (
|
|
2089
|
-
console.warn("[LiveLayer] publishData failed.",
|
|
2086
|
+
const B = x ? { ...W, requestId: x } : W, Q = new TextEncoder().encode(JSON.stringify(B));
|
|
2087
|
+
F.publishData(Q, { reliable: !0 });
|
|
2088
|
+
} catch (B) {
|
|
2089
|
+
console.warn("[LiveLayer] publishData failed.", B);
|
|
2090
2090
|
}
|
|
2091
|
-
},
|
|
2091
|
+
}, P = yt.current, H = gt.current;
|
|
2092
2092
|
try {
|
|
2093
|
-
if (
|
|
2094
|
-
const
|
|
2095
|
-
if (
|
|
2096
|
-
|
|
2093
|
+
if (H) {
|
|
2094
|
+
const W = H(P);
|
|
2095
|
+
if (W instanceof Promise) {
|
|
2096
|
+
C({ type: "page_context_pending" }), W.then((I) => C({ type: "page_context", context: I })).catch((I) => {
|
|
2097
2097
|
console.warn(
|
|
2098
2098
|
"[LiveLayer] getPageContext rejected; falling back to default walker.",
|
|
2099
|
-
|
|
2100
|
-
),
|
|
2099
|
+
I
|
|
2100
|
+
), C({
|
|
2101
2101
|
type: "page_context",
|
|
2102
|
-
context:
|
|
2102
|
+
context: kt(P)
|
|
2103
2103
|
});
|
|
2104
2104
|
});
|
|
2105
2105
|
return;
|
|
2106
2106
|
}
|
|
2107
|
-
|
|
2107
|
+
C({ type: "page_context", context: W });
|
|
2108
2108
|
return;
|
|
2109
2109
|
}
|
|
2110
|
-
|
|
2110
|
+
C({
|
|
2111
2111
|
type: "page_context",
|
|
2112
|
-
context:
|
|
2112
|
+
context: kt(P)
|
|
2113
2113
|
});
|
|
2114
|
-
} catch (
|
|
2114
|
+
} catch (W) {
|
|
2115
2115
|
console.warn(
|
|
2116
2116
|
"[LiveLayer] page-context extraction threw. Sending empty context.",
|
|
2117
|
-
|
|
2118
|
-
),
|
|
2117
|
+
W
|
|
2118
|
+
), C({
|
|
2119
2119
|
type: "page_context",
|
|
2120
|
-
context: { url: "", title: "", pathname: "/", regions: [], visibleText: "", visibleLinks: [], visibleFields: [], forms: [], extras:
|
|
2120
|
+
context: { url: "", title: "", pathname: "/", regions: [], visibleText: "", visibleLinks: [], visibleFields: [], forms: [], extras: P }
|
|
2121
2121
|
});
|
|
2122
2122
|
}
|
|
2123
2123
|
return;
|
|
2124
2124
|
}
|
|
2125
|
-
if (
|
|
2125
|
+
if (c.type === "scroll_page") {
|
|
2126
2126
|
if (!ve("scroll")) {
|
|
2127
2127
|
be("scroll_page", "scroll");
|
|
2128
2128
|
return;
|
|
2129
2129
|
}
|
|
2130
|
-
const
|
|
2131
|
-
if (
|
|
2130
|
+
const x = c.direction;
|
|
2131
|
+
if (x !== "up" && x !== "down" && x !== "top" && x !== "bottom") {
|
|
2132
2132
|
console.warn(
|
|
2133
|
-
`[LiveLayer] scroll_page: invalid direction "${String(
|
|
2133
|
+
`[LiveLayer] scroll_page: invalid direction "${String(x)}". Expected up | down | top | bottom.`
|
|
2134
2134
|
);
|
|
2135
2135
|
return;
|
|
2136
2136
|
}
|
|
2137
|
-
const
|
|
2137
|
+
const A = c.behavior === "instant" ? "instant" : "smooth";
|
|
2138
2138
|
if (p.current) {
|
|
2139
2139
|
try {
|
|
2140
2140
|
p.current(
|
|
2141
|
-
|
|
2142
|
-
|
|
2141
|
+
x,
|
|
2142
|
+
A
|
|
2143
2143
|
);
|
|
2144
|
-
} catch (
|
|
2145
|
-
console.warn("[LiveLayer] onScrollPage threw.",
|
|
2144
|
+
} catch (I) {
|
|
2145
|
+
console.warn("[LiveLayer] onScrollPage threw.", I);
|
|
2146
2146
|
}
|
|
2147
2147
|
return;
|
|
2148
2148
|
}
|
|
2149
2149
|
if (typeof window > "u") return;
|
|
2150
|
-
const
|
|
2151
|
-
|
|
2152
|
-
},
|
|
2153
|
-
|
|
2150
|
+
const C = { behavior: A }, P = Nr(), H = (I) => {
|
|
2151
|
+
P instanceof Window ? P.scrollBy({ top: I, ...C }) : P.scrollBy({ top: I, ...C });
|
|
2152
|
+
}, W = (I) => {
|
|
2153
|
+
P instanceof Window ? P.scrollTo({ top: I, ...C }) : P.scrollTo({ top: I, ...C });
|
|
2154
2154
|
};
|
|
2155
|
-
|
|
2155
|
+
x === "up" ? H(-Qt(P)) : x === "down" ? H(Qt(P)) : W(x === "top" ? 0 : Ar(P));
|
|
2156
2156
|
return;
|
|
2157
2157
|
}
|
|
2158
|
-
if (
|
|
2158
|
+
if (c.type === "click") {
|
|
2159
2159
|
if (!ve("click")) {
|
|
2160
2160
|
be("click", "click");
|
|
2161
2161
|
return;
|
|
2162
2162
|
}
|
|
2163
|
-
const
|
|
2164
|
-
if (!
|
|
2163
|
+
const x = typeof c.selector == "string" ? c.selector : null;
|
|
2164
|
+
if (!x) {
|
|
2165
2165
|
console.warn("[LiveLayer] click: missing selector.");
|
|
2166
2166
|
return;
|
|
2167
2167
|
}
|
|
2168
|
-
if (
|
|
2168
|
+
if (J.current) {
|
|
2169
2169
|
try {
|
|
2170
|
-
|
|
2171
|
-
} catch (
|
|
2172
|
-
console.warn("[LiveLayer] onClick threw.",
|
|
2170
|
+
J.current(x);
|
|
2171
|
+
} catch (C) {
|
|
2172
|
+
console.warn("[LiveLayer] onClick threw.", C);
|
|
2173
2173
|
}
|
|
2174
2174
|
return;
|
|
2175
2175
|
}
|
|
2176
2176
|
if (typeof document > "u") return;
|
|
2177
|
-
let
|
|
2177
|
+
let A = null;
|
|
2178
2178
|
try {
|
|
2179
|
-
|
|
2179
|
+
A = document.querySelector(x);
|
|
2180
2180
|
} catch {
|
|
2181
2181
|
console.warn(
|
|
2182
|
-
`[LiveLayer] click: invalid selector "${
|
|
2182
|
+
`[LiveLayer] click: invalid selector "${x}".`
|
|
2183
2183
|
);
|
|
2184
2184
|
return;
|
|
2185
2185
|
}
|
|
2186
|
-
if (!
|
|
2186
|
+
if (!A) {
|
|
2187
2187
|
console.warn(
|
|
2188
|
-
`[LiveLayer] click: no element matched "${
|
|
2188
|
+
`[LiveLayer] click: no element matched "${x}". See https://livelayer.studio/docs/errors/click-no-match`
|
|
2189
2189
|
);
|
|
2190
2190
|
return;
|
|
2191
2191
|
}
|
|
2192
|
-
if (
|
|
2192
|
+
if (A.closest('[data-ll-private="true"], .ll-widget')) {
|
|
2193
2193
|
console.warn(
|
|
2194
2194
|
"[LiveLayer] click: refusing to click element inside a private subtree."
|
|
2195
2195
|
);
|
|
2196
2196
|
return;
|
|
2197
2197
|
}
|
|
2198
|
-
(Le =
|
|
2198
|
+
(Le = A.click) == null || Le.call(A);
|
|
2199
2199
|
return;
|
|
2200
2200
|
}
|
|
2201
|
-
if (
|
|
2201
|
+
if (c.type === "fill_form" || c.type === "focus_field") {
|
|
2202
2202
|
if (!ve("fill_forms")) {
|
|
2203
|
-
be(
|
|
2203
|
+
be(c.type, "fill_forms");
|
|
2204
2204
|
return;
|
|
2205
2205
|
}
|
|
2206
2206
|
if (typeof document > "u") return;
|
|
2207
|
-
const
|
|
2208
|
-
if (
|
|
2209
|
-
const Q =
|
|
2210
|
-
if (
|
|
2207
|
+
const x = typeof c.requestId == "string" ? c.requestId : void 0, A = (oe = ne.current) == null ? void 0 : oe.call(ne), C = (B) => {
|
|
2208
|
+
if (c.type !== "fill_form") return;
|
|
2209
|
+
const Q = A, de = Q == null ? void 0 : Q.localParticipant;
|
|
2210
|
+
if (de != null && de.publishData)
|
|
2211
2211
|
try {
|
|
2212
|
-
const
|
|
2213
|
-
|
|
2214
|
-
} catch (
|
|
2215
|
-
console.warn("[LiveLayer] publishData failed.",
|
|
2212
|
+
const Se = x ? { ...B, requestId: x } : B, hn = new TextEncoder().encode(JSON.stringify(Se));
|
|
2213
|
+
de.publishData(hn, { reliable: !0 });
|
|
2214
|
+
} catch (Se) {
|
|
2215
|
+
console.warn("[LiveLayer] publishData failed.", Se);
|
|
2216
2216
|
}
|
|
2217
|
-
},
|
|
2218
|
-
if (
|
|
2219
|
-
console.warn(`[LiveLayer] ${
|
|
2217
|
+
}, P = typeof c.formId == "string" ? c.formId : null;
|
|
2218
|
+
if (!P) {
|
|
2219
|
+
console.warn(`[LiveLayer] ${c.type}: missing formId.`), C({ type: "fill_form_result", ok: !1, reason: "missing formId" });
|
|
2220
2220
|
return;
|
|
2221
2221
|
}
|
|
2222
|
-
const
|
|
2223
|
-
`[data-ll-form="${
|
|
2222
|
+
const H = document.querySelector(
|
|
2223
|
+
`[data-ll-form="${P.replace(/"/g, '\\"')}"]`
|
|
2224
2224
|
);
|
|
2225
|
-
if (!
|
|
2225
|
+
if (!H) {
|
|
2226
2226
|
console.warn(
|
|
2227
|
-
`[LiveLayer] ${
|
|
2228
|
-
),
|
|
2227
|
+
`[LiveLayer] ${c.type}: no form with data-ll-form="${P}". Tag your form with <LiveLayerForm id> or data-ll-form. See https://livelayer.studio/docs/react/forms`
|
|
2228
|
+
), C({
|
|
2229
2229
|
type: "fill_form_result",
|
|
2230
2230
|
ok: !1,
|
|
2231
|
-
reason: `no form with data-ll-form="${
|
|
2232
|
-
formId:
|
|
2231
|
+
reason: `no form with data-ll-form="${P}" on this page`,
|
|
2232
|
+
formId: P
|
|
2233
2233
|
});
|
|
2234
2234
|
return;
|
|
2235
2235
|
}
|
|
2236
|
-
if (
|
|
2236
|
+
if (H.closest('[data-ll-private="true"], .ll-widget')) {
|
|
2237
2237
|
console.warn(
|
|
2238
|
-
`[LiveLayer] ${
|
|
2239
|
-
),
|
|
2238
|
+
`[LiveLayer] ${c.type}: refusing to touch a form in a private subtree.`
|
|
2239
|
+
), C({
|
|
2240
2240
|
type: "fill_form_result",
|
|
2241
2241
|
ok: !1,
|
|
2242
2242
|
reason: "form is in a private subtree (data-ll-private)",
|
|
2243
|
-
formId:
|
|
2243
|
+
formId: P
|
|
2244
2244
|
});
|
|
2245
2245
|
return;
|
|
2246
2246
|
}
|
|
2247
|
-
if (
|
|
2248
|
-
const
|
|
2249
|
-
if (!
|
|
2247
|
+
if (c.type === "focus_field") {
|
|
2248
|
+
const B = typeof c.fieldName == "string" ? c.fieldName : null;
|
|
2249
|
+
if (!B) {
|
|
2250
2250
|
console.warn("[LiveLayer] focus_field: missing fieldName.");
|
|
2251
2251
|
return;
|
|
2252
2252
|
}
|
|
2253
|
-
const Q =
|
|
2253
|
+
const Q = H.querySelector(`[data-ll-field="${B.replace(/"/g, '\\"')}"]`);
|
|
2254
2254
|
if (!Q) {
|
|
2255
2255
|
console.warn(
|
|
2256
|
-
`[LiveLayer] focus_field: no field "${
|
|
2256
|
+
`[LiveLayer] focus_field: no field "${B}" in form "${P}".`
|
|
2257
2257
|
);
|
|
2258
2258
|
return;
|
|
2259
2259
|
}
|
|
2260
|
-
if (!
|
|
2260
|
+
if (!pt(Q)) {
|
|
2261
2261
|
console.warn(
|
|
2262
|
-
`[LiveLayer] focus_field: field "${
|
|
2262
|
+
`[LiveLayer] focus_field: field "${B}" is privacy-protected and not focusable.`
|
|
2263
2263
|
);
|
|
2264
2264
|
return;
|
|
2265
2265
|
}
|
|
2266
2266
|
Q.focus();
|
|
2267
2267
|
return;
|
|
2268
2268
|
}
|
|
2269
|
-
const
|
|
2270
|
-
if (!
|
|
2271
|
-
console.warn("[LiveLayer] fill_form: missing or invalid values."),
|
|
2269
|
+
const W = c.values && typeof c.values == "object" ? c.values : null;
|
|
2270
|
+
if (!W) {
|
|
2271
|
+
console.warn("[LiveLayer] fill_form: missing or invalid values."), C({
|
|
2272
2272
|
type: "fill_form_result",
|
|
2273
2273
|
ok: !1,
|
|
2274
2274
|
reason: "missing or invalid values",
|
|
2275
|
-
formId:
|
|
2275
|
+
formId: P
|
|
2276
2276
|
});
|
|
2277
2277
|
return;
|
|
2278
2278
|
}
|
|
2279
|
-
const
|
|
2280
|
-
for (const [
|
|
2279
|
+
const I = [], F = [];
|
|
2280
|
+
for (const [B, Q] of Object.entries(W)) {
|
|
2281
2281
|
if (typeof Q != "string") continue;
|
|
2282
|
-
const
|
|
2283
|
-
if (!
|
|
2282
|
+
const de = H.querySelector(`[data-ll-field="${B.replace(/"/g, '\\"')}"]`);
|
|
2283
|
+
if (!de) {
|
|
2284
2284
|
console.warn(
|
|
2285
|
-
`[LiveLayer] fill_form: no field "${
|
|
2286
|
-
),
|
|
2285
|
+
`[LiveLayer] fill_form: no field "${B}" in form "${P}". Skipping.`
|
|
2286
|
+
), F.push(B);
|
|
2287
2287
|
continue;
|
|
2288
2288
|
}
|
|
2289
|
-
if (!
|
|
2289
|
+
if (!pt(de)) {
|
|
2290
2290
|
console.warn(
|
|
2291
|
-
`[LiveLayer] fill_form: field "${
|
|
2292
|
-
),
|
|
2291
|
+
`[LiveLayer] fill_form: field "${B}" is privacy-protected (password / cc-* / private). Skipping.`
|
|
2292
|
+
), F.push(B);
|
|
2293
2293
|
continue;
|
|
2294
2294
|
}
|
|
2295
2295
|
try {
|
|
2296
|
-
Lr(
|
|
2297
|
-
} catch (
|
|
2296
|
+
Lr(de, Q), I.push(B);
|
|
2297
|
+
} catch (Se) {
|
|
2298
2298
|
console.warn(
|
|
2299
|
-
`[LiveLayer] fill_form: failed to set "${
|
|
2300
|
-
|
|
2301
|
-
),
|
|
2299
|
+
`[LiveLayer] fill_form: failed to set "${B}".`,
|
|
2300
|
+
Se
|
|
2301
|
+
), F.push(B);
|
|
2302
2302
|
}
|
|
2303
2303
|
}
|
|
2304
|
-
|
|
2304
|
+
C({
|
|
2305
2305
|
type: "fill_form_result",
|
|
2306
|
-
ok:
|
|
2307
|
-
formId:
|
|
2308
|
-
filled:
|
|
2309
|
-
skipped:
|
|
2310
|
-
reason:
|
|
2306
|
+
ok: I.length > 0,
|
|
2307
|
+
formId: P,
|
|
2308
|
+
filled: I,
|
|
2309
|
+
skipped: F,
|
|
2310
|
+
reason: I.length === 0 ? `none of the requested fields exist on this form (skipped: ${F.join(", ")})` : void 0
|
|
2311
2311
|
});
|
|
2312
2312
|
return;
|
|
2313
2313
|
}
|
|
2314
|
-
if (
|
|
2314
|
+
if (c.type === "submit_form") {
|
|
2315
2315
|
if (!ve("submit_forms")) {
|
|
2316
2316
|
be("submit_form", "submit_forms");
|
|
2317
2317
|
return;
|
|
2318
2318
|
}
|
|
2319
2319
|
if (typeof document > "u") return;
|
|
2320
|
-
const
|
|
2321
|
-
if (!
|
|
2320
|
+
const x = typeof c.formId == "string" ? c.formId : null;
|
|
2321
|
+
if (!x) {
|
|
2322
2322
|
console.warn("[LiveLayer] submit_form: missing formId.");
|
|
2323
2323
|
return;
|
|
2324
2324
|
}
|
|
2325
|
-
const
|
|
2326
|
-
`[data-ll-form="${
|
|
2325
|
+
const A = document.querySelector(
|
|
2326
|
+
`[data-ll-form="${x.replace(/"/g, '\\"')}"]`
|
|
2327
2327
|
);
|
|
2328
|
-
if (!
|
|
2328
|
+
if (!A) {
|
|
2329
2329
|
console.warn(
|
|
2330
|
-
`[LiveLayer] submit_form: no form with data-ll-form="${
|
|
2330
|
+
`[LiveLayer] submit_form: no form with data-ll-form="${x}".`
|
|
2331
2331
|
);
|
|
2332
2332
|
return;
|
|
2333
2333
|
}
|
|
2334
|
-
if (
|
|
2334
|
+
if (A.closest('[data-ll-private="true"], .ll-widget')) {
|
|
2335
2335
|
console.warn(
|
|
2336
2336
|
"[LiveLayer] submit_form: refusing to submit a form in a private subtree."
|
|
2337
2337
|
);
|
|
2338
2338
|
return;
|
|
2339
2339
|
}
|
|
2340
|
-
const
|
|
2341
|
-
const
|
|
2340
|
+
const C = typeof c.requestId == "string" ? c.requestId : void 0, P = (Xe = ne.current) == null ? void 0 : Xe.call(ne), H = (F) => {
|
|
2341
|
+
const B = P, Q = B == null ? void 0 : B.localParticipant;
|
|
2342
2342
|
if (Q != null && Q.publishData)
|
|
2343
2343
|
try {
|
|
2344
|
-
const
|
|
2345
|
-
Q.publishData(
|
|
2344
|
+
const de = C ? { ...F, requestId: C } : F, Se = new TextEncoder().encode(JSON.stringify(de));
|
|
2345
|
+
Q.publishData(Se, { reliable: !0 });
|
|
2346
2346
|
} catch {
|
|
2347
2347
|
}
|
|
2348
2348
|
};
|
|
2349
|
-
let
|
|
2350
|
-
const
|
|
2351
|
-
|
|
2349
|
+
let W = !1;
|
|
2350
|
+
const I = () => {
|
|
2351
|
+
W = !0, H({ type: "form_submitted", formId: x });
|
|
2352
2352
|
};
|
|
2353
|
-
|
|
2353
|
+
A.addEventListener("submit", I, { once: !0 });
|
|
2354
2354
|
try {
|
|
2355
|
-
typeof
|
|
2356
|
-
} catch (
|
|
2357
|
-
console.warn("[LiveLayer] submit_form: requestSubmit threw.",
|
|
2355
|
+
typeof A.requestSubmit == "function" ? A.requestSubmit() : A.submit();
|
|
2356
|
+
} catch (F) {
|
|
2357
|
+
console.warn("[LiveLayer] submit_form: requestSubmit threw.", F), A.removeEventListener("submit", I), H({
|
|
2358
2358
|
type: "form_submit_blocked",
|
|
2359
|
-
formId:
|
|
2359
|
+
formId: x,
|
|
2360
2360
|
reason: "exception"
|
|
2361
2361
|
});
|
|
2362
2362
|
return;
|
|
2363
2363
|
}
|
|
2364
2364
|
setTimeout(() => {
|
|
2365
|
-
|
|
2365
|
+
W || (A.removeEventListener("submit", I), H({
|
|
2366
2366
|
type: "form_submit_blocked",
|
|
2367
|
-
formId:
|
|
2367
|
+
formId: x,
|
|
2368
2368
|
reason: "validation"
|
|
2369
2369
|
}));
|
|
2370
2370
|
}, 500);
|
|
2371
2371
|
return;
|
|
2372
2372
|
}
|
|
2373
|
-
if (
|
|
2373
|
+
if (c.type === "request_routes") {
|
|
2374
2374
|
if (!ve("read_page")) {
|
|
2375
2375
|
be("request_routes", "read_page");
|
|
2376
2376
|
return;
|
|
2377
2377
|
}
|
|
2378
|
-
const
|
|
2379
|
-
if (!(
|
|
2380
|
-
const
|
|
2378
|
+
const x = typeof c.requestId == "string" ? c.requestId : void 0, C = (Qe = ne.current) == null ? void 0 : Qe.call(ne), P = C == null ? void 0 : C.localParticipant;
|
|
2379
|
+
if (!(P != null && P.publishData)) return;
|
|
2380
|
+
const H = (I) => {
|
|
2381
2381
|
try {
|
|
2382
|
-
const
|
|
2383
|
-
|
|
2384
|
-
} catch (
|
|
2385
|
-
console.warn("[LiveLayer] request_routes: publishData failed.",
|
|
2382
|
+
const F = x ? { type: "routes", routes: I, requestId: x } : { type: "routes", routes: I }, B = new TextEncoder().encode(JSON.stringify(F));
|
|
2383
|
+
P.publishData(B, { reliable: !0 });
|
|
2384
|
+
} catch (F) {
|
|
2385
|
+
console.warn("[LiveLayer] request_routes: publishData failed.", F);
|
|
2386
2386
|
}
|
|
2387
|
-
},
|
|
2388
|
-
if (
|
|
2387
|
+
}, W = vt.current;
|
|
2388
|
+
if (W) {
|
|
2389
2389
|
try {
|
|
2390
|
-
const
|
|
2391
|
-
if (!Array.isArray(
|
|
2392
|
-
|
|
2390
|
+
const I = W(), F = (B) => {
|
|
2391
|
+
if (!Array.isArray(B)) {
|
|
2392
|
+
H([]);
|
|
2393
2393
|
return;
|
|
2394
2394
|
}
|
|
2395
|
-
|
|
2395
|
+
H(B.map(vr).slice(0, 200));
|
|
2396
2396
|
};
|
|
2397
|
-
|
|
2397
|
+
I instanceof Promise ? I.then(F).catch((B) => {
|
|
2398
2398
|
console.warn(
|
|
2399
2399
|
"[LiveLayer] getRoutes rejected; falling back to DOM walker.",
|
|
2400
|
-
|
|
2401
|
-
),
|
|
2402
|
-
}) :
|
|
2403
|
-
} catch (
|
|
2400
|
+
B
|
|
2401
|
+
), H(dt());
|
|
2402
|
+
}) : F(I);
|
|
2403
|
+
} catch (I) {
|
|
2404
2404
|
console.warn(
|
|
2405
2405
|
"[LiveLayer] getRoutes threw; falling back to DOM walker.",
|
|
2406
|
-
|
|
2407
|
-
),
|
|
2406
|
+
I
|
|
2407
|
+
), H(dt());
|
|
2408
2408
|
}
|
|
2409
2409
|
return;
|
|
2410
2410
|
}
|
|
2411
2411
|
try {
|
|
2412
|
-
|
|
2413
|
-
} catch (
|
|
2414
|
-
console.warn("[LiveLayer] request_routes: extractRoutes threw.",
|
|
2412
|
+
H(dt());
|
|
2413
|
+
} catch (I) {
|
|
2414
|
+
console.warn("[LiveLayer] request_routes: extractRoutes threw.", I);
|
|
2415
2415
|
}
|
|
2416
2416
|
return;
|
|
2417
2417
|
}
|
|
2418
|
-
Rr.has(
|
|
2418
|
+
Rr.has(c.type) || Me == null || Me(c);
|
|
2419
2419
|
}
|
|
2420
2420
|
},
|
|
2421
|
-
[
|
|
2422
|
-
),
|
|
2423
|
-
agentId:
|
|
2424
|
-
baseUrl:
|
|
2421
|
+
[Me, Re]
|
|
2422
|
+
), G = _n({
|
|
2423
|
+
agentId: Y ? "__controlled__" : Ie,
|
|
2424
|
+
baseUrl: o,
|
|
2425
2425
|
apiKey: r,
|
|
2426
|
-
sessionEndpoint:
|
|
2426
|
+
sessionEndpoint: i,
|
|
2427
2427
|
sessionBody: l,
|
|
2428
|
-
onDataMessage:
|
|
2428
|
+
onDataMessage: Y ? void 0 : Ge
|
|
2429
2429
|
});
|
|
2430
|
-
|
|
2431
|
-
if (
|
|
2432
|
-
return
|
|
2433
|
-
}, [
|
|
2430
|
+
R(() => {
|
|
2431
|
+
if (Y != null && Y.subscribeToDataMessages)
|
|
2432
|
+
return Y.subscribeToDataMessages(Ge);
|
|
2433
|
+
}, [Y, Ge]), ne.current = () => {
|
|
2434
2434
|
var h;
|
|
2435
|
-
return (h =
|
|
2436
|
-
},
|
|
2435
|
+
return (h = G.getRoom) == null ? void 0 : h.call(G);
|
|
2436
|
+
}, R(() => {
|
|
2437
2437
|
var Le;
|
|
2438
|
-
if (
|
|
2439
|
-
|
|
2440
|
-
|
|
2438
|
+
if (console.log(
|
|
2439
|
+
`[NAV-DEBUG][widget] pathname-effect fired pathname=${le} connState=${G.connectionState} t=${Date.now()}`
|
|
2440
|
+
), !le) {
|
|
2441
|
+
console.log("[NAV-DEBUG][widget] effect bailed: no pathname");
|
|
2442
|
+
return;
|
|
2443
|
+
}
|
|
2444
|
+
const h = (Le = G.getRoom) == null ? void 0 : Le.call(G), c = h == null ? void 0 : h.localParticipant;
|
|
2445
|
+
if (console.log(
|
|
2446
|
+
`[NAV-DEBUG][widget] immediate-push state: room=${!!h} lp=${!!c} publishData=${!!(c != null && c.publishData)}`
|
|
2447
|
+
), !(c != null && c.publishData)) {
|
|
2448
|
+
console.log("[NAV-DEBUG][widget] effect bailed: no publishData (not connected yet)");
|
|
2449
|
+
return;
|
|
2450
|
+
}
|
|
2441
2451
|
try {
|
|
2442
|
-
const
|
|
2443
|
-
JSON.stringify({ type: "pathname", pathname:
|
|
2452
|
+
const oe = new TextEncoder().encode(
|
|
2453
|
+
JSON.stringify({ type: "pathname", pathname: le })
|
|
2444
2454
|
);
|
|
2445
|
-
|
|
2446
|
-
} catch {
|
|
2455
|
+
c.publishData(oe, { reliable: !0 }), console.log(`[NAV-DEBUG][widget] pathname push sent (${oe.byteLength} bytes)`);
|
|
2456
|
+
} catch (oe) {
|
|
2457
|
+
console.warn("[NAV-DEBUG][widget] pathname push threw:", oe);
|
|
2447
2458
|
}
|
|
2448
|
-
const Z = setTimeout(() => {
|
|
2449
|
-
var
|
|
2459
|
+
const Z = setTimeout(async () => {
|
|
2460
|
+
var oe, Xe, Qe, x;
|
|
2461
|
+
console.log("[NAV-DEBUG][widget] settle timer fired (250ms after pathname-effect)");
|
|
2450
2462
|
try {
|
|
2451
|
-
const
|
|
2452
|
-
if (
|
|
2453
|
-
|
|
2454
|
-
|
|
2463
|
+
const A = (oe = G.getRoom) == null ? void 0 : oe.call(G), C = A == null ? void 0 : A.localParticipant;
|
|
2464
|
+
if (console.log(
|
|
2465
|
+
`[NAV-DEBUG][widget] settle-time state: room=${!!A} lp=${!!C} publishData=${!!(C != null && C.publishData)}`
|
|
2466
|
+
), !(C != null && C.publishData)) {
|
|
2467
|
+
console.log("[NAV-DEBUG][widget] settle bailed: no publishData");
|
|
2468
|
+
return;
|
|
2469
|
+
}
|
|
2470
|
+
const P = kt(yt.current);
|
|
2471
|
+
console.log(
|
|
2472
|
+
`[NAV-DEBUG][widget] page_context built: regions=${((Xe = P.regions) == null ? void 0 : Xe.length) ?? 0} forms=${((Qe = P.forms) == null ? void 0 : Qe.length) ?? 0} links=${((x = P.visibleLinks) == null ? void 0 : x.length) ?? 0}`
|
|
2455
2473
|
);
|
|
2456
|
-
|
|
2457
|
-
|
|
2474
|
+
try {
|
|
2475
|
+
const H = new TextEncoder().encode(
|
|
2476
|
+
JSON.stringify({ type: "page_context_push", pathname: le, context: P })
|
|
2477
|
+
);
|
|
2478
|
+
C.publishData(H, { reliable: !0 }), console.log(
|
|
2479
|
+
`[NAV-DEBUG][widget] page_context_push SENT (${H.byteLength} bytes)`
|
|
2480
|
+
);
|
|
2481
|
+
} catch (H) {
|
|
2482
|
+
console.warn("[NAV-DEBUG][widget] page_context_push threw:", H);
|
|
2483
|
+
}
|
|
2484
|
+
try {
|
|
2485
|
+
const H = vt.current;
|
|
2486
|
+
let W = [];
|
|
2487
|
+
if (H) {
|
|
2488
|
+
console.log("[NAV-DEBUG][widget] routes: calling custom getRoutes()");
|
|
2489
|
+
const F = H(), B = F instanceof Promise ? await F : F;
|
|
2490
|
+
W = Array.isArray(B) ? B.slice(0, 200) : [], console.log(`[NAV-DEBUG][widget] routes: custom returned ${W.length}`);
|
|
2491
|
+
} else
|
|
2492
|
+
console.log("[NAV-DEBUG][widget] routes: walking DOM (no custom getRoutes)"), W = dt(), console.log(`[NAV-DEBUG][widget] routes: DOM walk returned ${W.length}`);
|
|
2493
|
+
const I = new TextEncoder().encode(
|
|
2494
|
+
JSON.stringify({ type: "routes_push", routes: W })
|
|
2495
|
+
);
|
|
2496
|
+
C.publishData(I, { reliable: !0 }), console.log(
|
|
2497
|
+
`[NAV-DEBUG][widget] routes_push SENT (${I.byteLength} bytes, ${W.length} routes)`
|
|
2498
|
+
);
|
|
2499
|
+
} catch (H) {
|
|
2500
|
+
console.warn("[NAV-DEBUG][widget] routes_push threw:", H);
|
|
2501
|
+
}
|
|
2502
|
+
} catch (A) {
|
|
2503
|
+
console.warn("[NAV-DEBUG][widget] settle outer threw:", A);
|
|
2458
2504
|
}
|
|
2459
2505
|
}, 250);
|
|
2460
|
-
return () =>
|
|
2461
|
-
|
|
2506
|
+
return () => {
|
|
2507
|
+
clearTimeout(Z);
|
|
2508
|
+
};
|
|
2509
|
+
}, [le, G, G.connectionState]), R(() => {
|
|
2462
2510
|
var Z;
|
|
2463
2511
|
if (typeof window > "u") return;
|
|
2464
2512
|
const h = ((Z = window.location) == null ? void 0 : Z.hostname) || "";
|
|
2465
2513
|
if (h === "localhost" || h === "127.0.0.1" || h === "0.0.0.0" || h.endsWith(".local") || h.endsWith(".test"))
|
|
2466
2514
|
return window.__livelayerSimulateCommand = (Le) => {
|
|
2467
2515
|
try {
|
|
2468
|
-
|
|
2469
|
-
} catch (
|
|
2470
|
-
console.warn("[LiveLayer] simulate-command threw:",
|
|
2516
|
+
Ge(Le);
|
|
2517
|
+
} catch (oe) {
|
|
2518
|
+
console.warn("[LiveLayer] simulate-command threw:", oe);
|
|
2471
2519
|
}
|
|
2472
2520
|
}, () => {
|
|
2473
2521
|
delete window.__livelayerSimulateCommand;
|
|
2474
2522
|
};
|
|
2475
|
-
}, [
|
|
2476
|
-
const g =
|
|
2477
|
-
connectionState:
|
|
2478
|
-
agentState:
|
|
2479
|
-
transcript:
|
|
2480
|
-
videoElement:
|
|
2481
|
-
audioElement:
|
|
2482
|
-
canResume:
|
|
2483
|
-
error:
|
|
2523
|
+
}, [Ge]);
|
|
2524
|
+
const g = ut(() => Y ? {
|
|
2525
|
+
connectionState: Y.connectionState,
|
|
2526
|
+
agentState: Y.agentState,
|
|
2527
|
+
transcript: Y.transcript,
|
|
2528
|
+
videoElement: Y.videoElement,
|
|
2529
|
+
audioElement: Y.audioElement,
|
|
2530
|
+
canResume: Y.canResume,
|
|
2531
|
+
error: Y.error,
|
|
2484
2532
|
agentConfig: null,
|
|
2485
2533
|
connect: async () => {
|
|
2486
|
-
await
|
|
2534
|
+
await Y.onConnect();
|
|
2487
2535
|
},
|
|
2488
|
-
disconnect: () =>
|
|
2536
|
+
disconnect: () => Y.onDisconnect(),
|
|
2489
2537
|
// Dummy getRoom for shape compatibility — controlled consumers own the Room.
|
|
2490
2538
|
// Internal session's getRoom returns null when no real connect has happened,
|
|
2491
2539
|
// so we reuse its reference for type consistency.
|
|
2492
|
-
getRoom:
|
|
2540
|
+
getRoom: G.getRoom,
|
|
2493
2541
|
isControlled: !0
|
|
2494
2542
|
} : {
|
|
2495
|
-
connectionState:
|
|
2496
|
-
agentState:
|
|
2497
|
-
transcript:
|
|
2498
|
-
videoElement:
|
|
2499
|
-
audioElement:
|
|
2500
|
-
canResume:
|
|
2501
|
-
error:
|
|
2502
|
-
agentConfig:
|
|
2503
|
-
connect:
|
|
2504
|
-
disconnect:
|
|
2505
|
-
getRoom:
|
|
2543
|
+
connectionState: G.connectionState,
|
|
2544
|
+
agentState: G.agentState,
|
|
2545
|
+
transcript: G.transcript,
|
|
2546
|
+
videoElement: G.videoElement,
|
|
2547
|
+
audioElement: G.audioElement,
|
|
2548
|
+
canResume: G.canResume,
|
|
2549
|
+
error: G.error,
|
|
2550
|
+
agentConfig: G.agentConfig,
|
|
2551
|
+
connect: G.connect,
|
|
2552
|
+
disconnect: G.disconnect,
|
|
2553
|
+
getRoom: G.getRoom,
|
|
2506
2554
|
isControlled: !1
|
|
2507
|
-
}, [
|
|
2508
|
-
|
|
2509
|
-
const h = g.videoElement,
|
|
2510
|
-
if (!(!h || !
|
|
2511
|
-
return
|
|
2512
|
-
h.parentNode ===
|
|
2555
|
+
}, [Y, G]), Nt = M(null);
|
|
2556
|
+
R(() => {
|
|
2557
|
+
const h = g.videoElement, c = Nt.current;
|
|
2558
|
+
if (!(!h || !c))
|
|
2559
|
+
return c.appendChild(h), () => {
|
|
2560
|
+
h.parentNode === c && c.removeChild(h);
|
|
2513
2561
|
};
|
|
2514
|
-
}, [g.videoElement]),
|
|
2562
|
+
}, [g.videoElement]), R(() => {
|
|
2515
2563
|
const h = g.audioElement;
|
|
2516
2564
|
if (!h) return;
|
|
2517
|
-
|
|
2518
|
-
const
|
|
2519
|
-
return
|
|
2565
|
+
qe.attach(h);
|
|
2566
|
+
const c = h.play();
|
|
2567
|
+
return c && typeof c.catch == "function" && c.catch((Z) => {
|
|
2520
2568
|
(Z == null ? void 0 : Z.name) === "NotAllowedError" && he(!0);
|
|
2521
2569
|
}), () => {
|
|
2522
|
-
|
|
2570
|
+
qe.detach();
|
|
2523
2571
|
};
|
|
2524
|
-
}, [g.audioElement]),
|
|
2572
|
+
}, [g.audioElement]), R(() => {
|
|
2525
2573
|
if (g.isControlled || g.connectionState !== "connected") return;
|
|
2526
2574
|
const h = g.getRoom();
|
|
2527
2575
|
if (h)
|
|
2528
2576
|
return te.setupMic(h, { startMuted: !0 }).catch(() => {
|
|
2529
|
-
}),
|
|
2530
|
-
te.teardownMic(),
|
|
2577
|
+
}), se.attachRoom(h), ce.attachRoom(h), pe.refresh(), () => {
|
|
2578
|
+
te.teardownMic(), se.teardown(), ce.teardown();
|
|
2531
2579
|
};
|
|
2532
2580
|
}, [g.isControlled, g.connectionState]);
|
|
2533
|
-
const [
|
|
2534
|
-
|
|
2581
|
+
const [Ye, wt] = S(!1), _t = M("idle");
|
|
2582
|
+
R(() => {
|
|
2535
2583
|
if (g.connectionState === "idle" || g.connectionState === "disconnected") {
|
|
2536
|
-
|
|
2584
|
+
wt(!1), _t.current = "idle";
|
|
2537
2585
|
return;
|
|
2538
2586
|
}
|
|
2539
|
-
!
|
|
2540
|
-
}, [g.agentState, g.connectionState,
|
|
2541
|
-
if (g.connectionState !== "connected" ||
|
|
2587
|
+
!Ye && _t.current === "speaking" && g.agentState !== "speaking" && (wt(!0), te.setMuted(!1)), _t.current = g.agentState;
|
|
2588
|
+
}, [g.agentState, g.connectionState, Ye]), R(() => {
|
|
2589
|
+
if (g.connectionState !== "connected" || Ye) return;
|
|
2542
2590
|
const h = setTimeout(() => {
|
|
2543
|
-
|
|
2591
|
+
wt(!0), te.setMuted(!1);
|
|
2544
2592
|
}, 4e3);
|
|
2545
2593
|
return () => clearTimeout(h);
|
|
2546
|
-
}, [g.connectionState,
|
|
2594
|
+
}, [g.connectionState, Ye]), R(() => {
|
|
2547
2595
|
const h = g.audioElement;
|
|
2548
|
-
h && (h.muted =
|
|
2549
|
-
}, [g.audioElement,
|
|
2596
|
+
h && (h.muted = $e);
|
|
2597
|
+
}, [g.audioElement, $e]);
|
|
2550
2598
|
const nn = L((h) => {
|
|
2551
|
-
const
|
|
2552
|
-
if (
|
|
2599
|
+
const c = g.getRoom();
|
|
2600
|
+
if (c)
|
|
2553
2601
|
try {
|
|
2554
2602
|
const Z = new TextEncoder().encode(
|
|
2555
2603
|
JSON.stringify({ type: "user_message", text: h })
|
|
2556
2604
|
);
|
|
2557
|
-
|
|
2605
|
+
c.localParticipant.publishData(Z, { reliable: !0 });
|
|
2558
2606
|
} catch {
|
|
2559
2607
|
}
|
|
2560
2608
|
}, [g]), rn = L(() => {
|
|
2561
2609
|
lt((h) => !h);
|
|
2562
2610
|
}, []);
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
}, [g.connectionState,
|
|
2566
|
-
|
|
2567
|
-
}, [g.transcript,
|
|
2568
|
-
|
|
2569
|
-
}, [g.agentState,
|
|
2570
|
-
const At =
|
|
2571
|
-
|
|
2572
|
-
g.isControlled || !
|
|
2573
|
-
}, [
|
|
2611
|
+
R(() => {
|
|
2612
|
+
Ae == null || Ae(g.connectionState), g.connectionState === "connected" ? ue == null || ue() : g.connectionState === "disconnected" && (_e == null || _e());
|
|
2613
|
+
}, [g.connectionState, ue, _e, Ae]), R(() => {
|
|
2614
|
+
Ce == null || Ce(g.transcript);
|
|
2615
|
+
}, [g.transcript, Ce]), R(() => {
|
|
2616
|
+
Ne == null || Ne(g.agentState);
|
|
2617
|
+
}, [g.agentState, Ne]);
|
|
2618
|
+
const At = M(!1);
|
|
2619
|
+
R(() => {
|
|
2620
|
+
g.isControlled || !d || At.current || De && g.connectionState === "idle" && (At.current = !0, g.connect());
|
|
2621
|
+
}, [d, g.connectionState, g, De]);
|
|
2574
2622
|
const on = L(
|
|
2575
2623
|
(h) => {
|
|
2576
|
-
const
|
|
2577
|
-
|
|
2624
|
+
const c = N == null ? void 0 : N.find((Z) => Z.id === h);
|
|
2625
|
+
c && (Fe(!1), h !== K && (Ve(!0), g.disconnect(), Ue || Te(h), v == null || v(c)));
|
|
2578
2626
|
},
|
|
2579
2627
|
[
|
|
2580
|
-
|
|
2581
|
-
|
|
2628
|
+
N,
|
|
2629
|
+
K,
|
|
2582
2630
|
g,
|
|
2583
|
-
|
|
2631
|
+
Ue,
|
|
2584
2632
|
v
|
|
2585
2633
|
]
|
|
2586
2634
|
);
|
|
2587
|
-
|
|
2588
|
-
me && g.connectionState === "connected" &&
|
|
2589
|
-
}, [g.connectionState, me]),
|
|
2590
|
-
if (!
|
|
2591
|
-
const h = (
|
|
2592
|
-
|
|
2635
|
+
R(() => {
|
|
2636
|
+
me && g.connectionState === "connected" && Ve(!1);
|
|
2637
|
+
}, [g.connectionState, me]), R(() => {
|
|
2638
|
+
if (!We) return;
|
|
2639
|
+
const h = (c) => {
|
|
2640
|
+
c.key === "Escape" && Fe(!1);
|
|
2593
2641
|
};
|
|
2594
2642
|
return window.addEventListener("keydown", h), () => window.removeEventListener("keydown", h);
|
|
2595
|
-
}, [
|
|
2596
|
-
const ln =
|
|
2597
|
-
re === void 0 && ((Mt =
|
|
2598
|
-
const at = (ee == null ? void 0 : ee.name) ??
|
|
2599
|
-
() =>
|
|
2600
|
-
[
|
|
2643
|
+
}, [We]);
|
|
2644
|
+
const ln = !!$ || !!(ee != null && ee.avatarImageUrl) || g.isControlled, Je = Nn(Ie, o, ln);
|
|
2645
|
+
re === void 0 && ((Mt = Je.info) != null && Mt.capabilities) && (bt.current = Je.info.capabilities);
|
|
2646
|
+
const at = (ee == null ? void 0 : ee.name) ?? U ?? ((Dt = g.agentConfig) == null ? void 0 : Dt.name) ?? ((Tt = Je.info) == null ? void 0 : Tt.name) ?? "Live Layer", xt = (ee == null ? void 0 : ee.avatarImageUrl) ?? $ ?? ((It = g.agentConfig) == null ? void 0 : It.avatarImageUrl) ?? ((Pt = Je.info) == null ? void 0 : Pt.avatarImageUrl) ?? null, an = w ?? (($t = g.agentConfig) == null ? void 0 : $t.idleLoopUrl) ?? ((Bt = Je.info) == null ? void 0 : Bt.idleLoopUrl) ?? null, sn = O ?? null, cn = L(() => fe("expanded"), [fe]), dn = L(
|
|
2647
|
+
() => fe("minimized"),
|
|
2648
|
+
[fe]
|
|
2601
2649
|
), Rt = L(() => {
|
|
2602
|
-
g.disconnect(),
|
|
2603
|
-
}, [g,
|
|
2650
|
+
g.disconnect(), fe("hidden");
|
|
2651
|
+
}, [g, fe]), un = L(() => {
|
|
2604
2652
|
const h = g.audioElement;
|
|
2605
2653
|
h && h.play().then(() => he(!1)).catch(() => {
|
|
2606
2654
|
});
|
|
2607
2655
|
}, [g.audioElement]), fn = L(() => {
|
|
2608
2656
|
he(!1), g.connect();
|
|
2609
|
-
}, [g]),
|
|
2610
|
-
...
|
|
2611
|
-
zIndex:
|
|
2657
|
+
}, [g]), Ke = {
|
|
2658
|
+
...mt,
|
|
2659
|
+
zIndex: it
|
|
2612
2660
|
};
|
|
2613
|
-
m.primaryColor && (
|
|
2661
|
+
m.primaryColor && (Ke["--ll-color-primary"] = m.primaryColor), m.accentColor && (Ke["--ll-color-accent"] = m.accentColor), m.backgroundColor && (Ke["--ll-color-bg"] = m.backgroundColor), m.textColor && (Ke["--ll-color-fg"] = m.textColor);
|
|
2614
2662
|
const pn = [
|
|
2615
2663
|
"ll-widget",
|
|
2616
|
-
`ll-widget--${
|
|
2664
|
+
`ll-widget--${ae}`,
|
|
2617
2665
|
`ll-widget--${ke ? "mobile" : "desktop"}`,
|
|
2618
|
-
|
|
2666
|
+
ht
|
|
2619
2667
|
].filter(Boolean).join(" ");
|
|
2620
|
-
return
|
|
2668
|
+
return De ? /* @__PURE__ */ _(
|
|
2621
2669
|
"div",
|
|
2622
2670
|
{
|
|
2623
2671
|
className: pn,
|
|
2624
|
-
style:
|
|
2625
|
-
"data-display-mode":
|
|
2672
|
+
style: Ke,
|
|
2673
|
+
"data-display-mode": ae,
|
|
2626
2674
|
"data-position": b,
|
|
2627
2675
|
children: [
|
|
2628
|
-
|
|
2629
|
-
|
|
2676
|
+
ae === "hidden" && /* @__PURE__ */ n(
|
|
2677
|
+
Xn,
|
|
2630
2678
|
{
|
|
2631
2679
|
position: b,
|
|
2632
2680
|
isMobile: ke,
|
|
2633
2681
|
isSpeaking: g.agentState === "speaking",
|
|
2634
|
-
onExpand: () =>
|
|
2682
|
+
onExpand: () => fe("expanded"),
|
|
2635
2683
|
label: `Open ${at} widget`,
|
|
2636
|
-
avatarImageUrl:
|
|
2684
|
+
avatarImageUrl: xt,
|
|
2637
2685
|
agentName: at
|
|
2638
2686
|
}
|
|
2639
2687
|
),
|
|
2640
|
-
|
|
2688
|
+
ae === "minimized" && /* @__PURE__ */ n(
|
|
2641
2689
|
Zn,
|
|
2642
2690
|
{
|
|
2643
2691
|
position: b,
|
|
2644
2692
|
isMobile: ke,
|
|
2645
2693
|
agentName: at,
|
|
2646
|
-
avatarImageUrl:
|
|
2694
|
+
avatarImageUrl: xt,
|
|
2647
2695
|
agentState: g.agentState,
|
|
2648
2696
|
isMuted: te.isMuted,
|
|
2649
|
-
audioLevel:
|
|
2697
|
+
audioLevel: qe,
|
|
2650
2698
|
onExpand: cn,
|
|
2651
2699
|
onToggleMute: te.toggleMute,
|
|
2652
2700
|
onClose: Rt
|
|
2653
2701
|
}
|
|
2654
2702
|
),
|
|
2655
|
-
|
|
2703
|
+
ae === "expanded" && /* @__PURE__ */ n(
|
|
2656
2704
|
tr,
|
|
2657
2705
|
{
|
|
2658
2706
|
position: b,
|
|
2659
2707
|
isMobile: ke,
|
|
2660
2708
|
agentName: at,
|
|
2661
|
-
avatarImageUrl:
|
|
2709
|
+
avatarImageUrl: xt,
|
|
2662
2710
|
idleLoopUrl: an,
|
|
2663
2711
|
greeting: sn,
|
|
2664
2712
|
branding: m,
|
|
2665
|
-
teamMembers:
|
|
2666
|
-
currentTeamMemberId:
|
|
2713
|
+
teamMembers: N,
|
|
2714
|
+
currentTeamMemberId: K,
|
|
2667
2715
|
isSwitchingTeamMember: me,
|
|
2668
|
-
teamSwitcherOpen:
|
|
2669
|
-
onToggleTeamSwitcher: () =>
|
|
2716
|
+
teamSwitcherOpen: We,
|
|
2717
|
+
onToggleTeamSwitcher: () => Fe((h) => !h),
|
|
2670
2718
|
onSelectTeamMember: on,
|
|
2671
2719
|
connectionState: g.connectionState,
|
|
2672
2720
|
agentState: g.agentState,
|
|
2673
2721
|
transcript: g.transcript,
|
|
2674
2722
|
isMuted: te.isMuted,
|
|
2675
2723
|
micDevices: pe.mics,
|
|
2676
|
-
isCameraEnabled:
|
|
2677
|
-
cameraPreviewEl:
|
|
2724
|
+
isCameraEnabled: se.isEnabled,
|
|
2725
|
+
cameraPreviewEl: se.previewEl,
|
|
2678
2726
|
cameraDevices: pe.cameras,
|
|
2679
|
-
activeCameraId:
|
|
2680
|
-
isScreenShareEnabled:
|
|
2681
|
-
screenPreviewEl:
|
|
2682
|
-
isSpeakerMuted:
|
|
2683
|
-
allowCamera:
|
|
2684
|
-
allowScreenShare:
|
|
2727
|
+
activeCameraId: se.activeDeviceId,
|
|
2728
|
+
isScreenShareEnabled: ce.isEnabled,
|
|
2729
|
+
screenPreviewEl: ce.previewEl,
|
|
2730
|
+
isSpeakerMuted: $e,
|
|
2731
|
+
allowCamera: D,
|
|
2732
|
+
allowScreenShare: V,
|
|
2685
2733
|
allowTyping: z,
|
|
2686
2734
|
languageMenuOpen: ge,
|
|
2687
2735
|
onToggleLanguageMenu: () => ye((h) => !h),
|
|
2688
|
-
needsUserGesture:
|
|
2736
|
+
needsUserGesture: Pe,
|
|
2689
2737
|
canResume: g.canResume,
|
|
2690
2738
|
micError: te.micError,
|
|
2691
2739
|
error: g.error,
|
|
2692
2740
|
avatarVideoContainerRef: Nt,
|
|
2693
2741
|
agentVideoEl: g.videoElement,
|
|
2694
|
-
micGateOpen: g.isControlled ? !0 :
|
|
2742
|
+
micGateOpen: g.isControlled ? !0 : Ye,
|
|
2695
2743
|
onConnect: () => void g.connect(),
|
|
2696
2744
|
onDisconnect: () => g.disconnect(),
|
|
2697
2745
|
onRetry: fn,
|
|
2698
2746
|
onResumeAudio: un,
|
|
2699
2747
|
onToggleMute: te.toggleMute,
|
|
2700
|
-
onToggleCamera: () => void
|
|
2701
|
-
onSwitchCameraDevice: (h) => void
|
|
2702
|
-
onToggleScreenShare: () => void
|
|
2748
|
+
onToggleCamera: () => void se.toggle(),
|
|
2749
|
+
onSwitchCameraDevice: (h) => void se.switchDevice(h),
|
|
2750
|
+
onToggleScreenShare: () => void ce.toggle(),
|
|
2703
2751
|
onToggleSpeaker: rn,
|
|
2704
2752
|
onSendMessage: nn,
|
|
2705
2753
|
onMinimize: dn,
|
|
@@ -2711,65 +2759,65 @@ function Mr(e) {
|
|
|
2711
2759
|
}
|
|
2712
2760
|
) : null;
|
|
2713
2761
|
}
|
|
2714
|
-
function
|
|
2762
|
+
function Or(e) {
|
|
2715
2763
|
return /* @__PURE__ */ n(wn, { children: /* @__PURE__ */ n(Mr, { ...e }) });
|
|
2716
2764
|
}
|
|
2717
|
-
const
|
|
2765
|
+
const Hr = ({
|
|
2718
2766
|
agentId: e,
|
|
2719
2767
|
baseUrl: t,
|
|
2720
2768
|
apiKey: r,
|
|
2721
|
-
mode:
|
|
2722
|
-
onAgentEvent:
|
|
2769
|
+
mode: o,
|
|
2770
|
+
onAgentEvent: i,
|
|
2723
2771
|
className: l,
|
|
2724
|
-
style:
|
|
2772
|
+
style: d
|
|
2725
2773
|
}) => {
|
|
2726
|
-
const u =
|
|
2727
|
-
y.current =
|
|
2774
|
+
const u = M(null), f = M(null), y = M(i);
|
|
2775
|
+
y.current = i;
|
|
2728
2776
|
const b = L((s) => {
|
|
2729
|
-
var
|
|
2777
|
+
var k;
|
|
2730
2778
|
const a = s.detail;
|
|
2731
|
-
(
|
|
2779
|
+
(k = y.current) == null || k.call(y, a);
|
|
2732
2780
|
}, []);
|
|
2733
|
-
return
|
|
2781
|
+
return R(() => {
|
|
2734
2782
|
const s = u.current;
|
|
2735
2783
|
if (!s) return;
|
|
2736
2784
|
const a = document.createElement("livelayer-widget");
|
|
2737
|
-
return a.setAttribute("agent-id", e), t && a.setAttribute("base-url", t), r && a.setAttribute("api-key", r),
|
|
2785
|
+
return a.setAttribute("agent-id", e), t && a.setAttribute("base-url", t), r && a.setAttribute("api-key", r), o && a.setAttribute("mode", o), a.addEventListener("agent-event", b), s.appendChild(a), f.current = a, () => {
|
|
2738
2786
|
a.removeEventListener("agent-event", b), s.removeChild(a), f.current = null;
|
|
2739
2787
|
};
|
|
2740
|
-
}, [e]),
|
|
2741
|
-
f.current && (
|
|
2742
|
-
}, [
|
|
2743
|
-
},
|
|
2744
|
-
function({ id: t, intent: r, as:
|
|
2788
|
+
}, [e]), R(() => {
|
|
2789
|
+
f.current && (o ? f.current.setAttribute("mode", o) : f.current.removeAttribute("mode"));
|
|
2790
|
+
}, [o]), /* @__PURE__ */ n("div", { ref: u, className: l, style: d });
|
|
2791
|
+
}, Ur = Et(
|
|
2792
|
+
function({ id: t, intent: r, as: o = "div", className: i, style: l, children: d }, u) {
|
|
2745
2793
|
return gn(
|
|
2746
|
-
|
|
2794
|
+
o,
|
|
2747
2795
|
{
|
|
2748
2796
|
ref: u,
|
|
2749
2797
|
"data-ll-region": t,
|
|
2750
2798
|
"data-ll-intent": r,
|
|
2751
|
-
className:
|
|
2799
|
+
className: i,
|
|
2752
2800
|
style: l
|
|
2753
2801
|
},
|
|
2754
|
-
|
|
2802
|
+
d
|
|
2755
2803
|
);
|
|
2756
2804
|
}
|
|
2757
|
-
),
|
|
2758
|
-
function({ id: t, intent: r, children:
|
|
2805
|
+
), qr = Et(
|
|
2806
|
+
function({ id: t, intent: r, children: o, ...i }, l) {
|
|
2759
2807
|
return /* @__PURE__ */ n(
|
|
2760
2808
|
"form",
|
|
2761
2809
|
{
|
|
2762
2810
|
ref: l,
|
|
2763
2811
|
"data-ll-form": t,
|
|
2764
2812
|
"data-ll-intent": r,
|
|
2765
|
-
...
|
|
2766
|
-
children:
|
|
2813
|
+
...i,
|
|
2814
|
+
children: o
|
|
2767
2815
|
}
|
|
2768
2816
|
);
|
|
2769
2817
|
}
|
|
2770
|
-
),
|
|
2818
|
+
), Vr = Et(
|
|
2771
2819
|
function(t, r) {
|
|
2772
|
-
const { name:
|
|
2820
|
+
const { name: o, label: i, labelClassName: l } = t, d = { name: o, "data-ll-field": o };
|
|
2773
2821
|
let u;
|
|
2774
2822
|
if ("as" in t && t.as === "textarea") {
|
|
2775
2823
|
const { name: f, label: y, labelClassName: b, as: s, ...a } = t;
|
|
@@ -2777,18 +2825,18 @@ const qr = ({
|
|
|
2777
2825
|
"textarea",
|
|
2778
2826
|
{
|
|
2779
2827
|
ref: r,
|
|
2780
|
-
...
|
|
2828
|
+
...d,
|
|
2781
2829
|
...a
|
|
2782
2830
|
}
|
|
2783
2831
|
);
|
|
2784
2832
|
} else if ("as" in t && t.as === "select") {
|
|
2785
|
-
const { name: f, label: y, labelClassName: b, as: s, children: a, ...
|
|
2833
|
+
const { name: f, label: y, labelClassName: b, as: s, children: a, ...k } = t;
|
|
2786
2834
|
u = /* @__PURE__ */ n(
|
|
2787
2835
|
"select",
|
|
2788
2836
|
{
|
|
2789
2837
|
ref: r,
|
|
2790
|
-
...
|
|
2791
|
-
...
|
|
2838
|
+
...d,
|
|
2839
|
+
...k,
|
|
2792
2840
|
children: a
|
|
2793
2841
|
}
|
|
2794
2842
|
);
|
|
@@ -2798,53 +2846,53 @@ const qr = ({
|
|
|
2798
2846
|
"input",
|
|
2799
2847
|
{
|
|
2800
2848
|
ref: r,
|
|
2801
|
-
...
|
|
2849
|
+
...d,
|
|
2802
2850
|
...a
|
|
2803
2851
|
}
|
|
2804
2852
|
);
|
|
2805
2853
|
}
|
|
2806
|
-
return
|
|
2807
|
-
|
|
2854
|
+
return i === void 0 ? u : /* @__PURE__ */ _("label", { className: l, children: [
|
|
2855
|
+
i,
|
|
2808
2856
|
u
|
|
2809
2857
|
] });
|
|
2810
2858
|
}
|
|
2811
2859
|
);
|
|
2812
2860
|
let Zt = 1;
|
|
2813
|
-
function
|
|
2861
|
+
function Wr({
|
|
2814
2862
|
onMount: e,
|
|
2815
2863
|
defaultOpen: t = !1,
|
|
2816
2864
|
storageKey: r = "ll-debug-open"
|
|
2817
2865
|
}) {
|
|
2818
|
-
const [
|
|
2819
|
-
|
|
2866
|
+
const [o, i] = S(t), [l, d] = S([]), [u, f] = S(""), [y, b] = S(!1), s = M(/* @__PURE__ */ new Set()), a = M([]), k = M(y);
|
|
2867
|
+
k.current = y, R(() => {
|
|
2820
2868
|
try {
|
|
2821
2869
|
const v = localStorage.getItem(r);
|
|
2822
|
-
v === "1" &&
|
|
2870
|
+
v === "1" && i(!0), v === "0" && i(!1);
|
|
2823
2871
|
} catch {
|
|
2824
2872
|
}
|
|
2825
|
-
}, [r]),
|
|
2873
|
+
}, [r]), R(() => {
|
|
2826
2874
|
try {
|
|
2827
|
-
localStorage.setItem(r,
|
|
2875
|
+
localStorage.setItem(r, o ? "1" : "0");
|
|
2828
2876
|
} catch {
|
|
2829
2877
|
}
|
|
2830
|
-
}, [
|
|
2878
|
+
}, [o, r]), R(() => {
|
|
2831
2879
|
const v = (w) => {
|
|
2832
|
-
(w.metaKey || w.ctrlKey) && w.shiftKey && w.key.toLowerCase() === "l" && (w.preventDefault(),
|
|
2880
|
+
(w.metaKey || w.ctrlKey) && w.shiftKey && w.key.toLowerCase() === "l" && (w.preventDefault(), i((O) => !O));
|
|
2833
2881
|
};
|
|
2834
2882
|
return window.addEventListener("keydown", v), () => window.removeEventListener("keydown", v);
|
|
2835
|
-
}, []),
|
|
2883
|
+
}, []), R(() => {
|
|
2836
2884
|
const v = setInterval(() => {
|
|
2837
|
-
if (a.current.length === 0 ||
|
|
2885
|
+
if (a.current.length === 0 || k.current) return;
|
|
2838
2886
|
const w = a.current.splice(0, a.current.length);
|
|
2839
|
-
|
|
2840
|
-
(
|
|
2887
|
+
d(
|
|
2888
|
+
(O) => [...w.reverse(), ...O].slice(0, 200)
|
|
2841
2889
|
);
|
|
2842
2890
|
}, 100);
|
|
2843
2891
|
return () => clearInterval(v);
|
|
2844
2892
|
}, []);
|
|
2845
|
-
const
|
|
2846
|
-
if (
|
|
2847
|
-
!e ||
|
|
2893
|
+
const N = M(!1);
|
|
2894
|
+
if (R(() => {
|
|
2895
|
+
!e || N.current || (N.current = !0, e((v) => {
|
|
2848
2896
|
a.current.push({
|
|
2849
2897
|
id: Zt++,
|
|
2850
2898
|
ts: Date.now(),
|
|
@@ -2853,30 +2901,30 @@ function Ur({
|
|
|
2853
2901
|
data: v.data
|
|
2854
2902
|
});
|
|
2855
2903
|
}));
|
|
2856
|
-
}, [e]),
|
|
2857
|
-
const v = console.warn, w = console.log,
|
|
2904
|
+
}, [e]), R(() => {
|
|
2905
|
+
const v = console.warn, w = console.log, O = ($, U) => function(...m) {
|
|
2858
2906
|
try {
|
|
2859
|
-
const
|
|
2860
|
-
|
|
2907
|
+
const D = typeof m[0] == "string" ? m[0] : "";
|
|
2908
|
+
D.startsWith("[LiveLayer]") && a.current.push({
|
|
2861
2909
|
id: Zt++,
|
|
2862
2910
|
ts: Date.now(),
|
|
2863
|
-
kind:
|
|
2864
|
-
type:
|
|
2865
|
-
data: { args: m.slice(1).map((
|
|
2911
|
+
kind: $,
|
|
2912
|
+
type: D.slice(0, 120),
|
|
2913
|
+
data: { args: m.slice(1).map((V) => Tr(V)) }
|
|
2866
2914
|
});
|
|
2867
2915
|
} catch {
|
|
2868
2916
|
}
|
|
2869
|
-
return
|
|
2917
|
+
return U.apply(this, m);
|
|
2870
2918
|
};
|
|
2871
|
-
return console.warn =
|
|
2919
|
+
return console.warn = O("warn", v), console.log = O("log", w), () => {
|
|
2872
2920
|
console.warn = v, console.log = w;
|
|
2873
2921
|
};
|
|
2874
|
-
}, []), !
|
|
2922
|
+
}, []), !o)
|
|
2875
2923
|
return /* @__PURE__ */ n(
|
|
2876
2924
|
"button",
|
|
2877
2925
|
{
|
|
2878
2926
|
type: "button",
|
|
2879
|
-
onClick: () =>
|
|
2927
|
+
onClick: () => i(!0),
|
|
2880
2928
|
title: "Open LiveLayer debug panel (Cmd/Ctrl + Shift + L)",
|
|
2881
2929
|
"aria-label": "Open LiveLayer debug panel",
|
|
2882
2930
|
style: {
|
|
@@ -2898,7 +2946,7 @@ function Ur({
|
|
|
2898
2946
|
children: "🛰 LL debug"
|
|
2899
2947
|
}
|
|
2900
2948
|
);
|
|
2901
|
-
const
|
|
2949
|
+
const E = l.filter((v) => {
|
|
2902
2950
|
if (!u) return !0;
|
|
2903
2951
|
const w = u.toLowerCase();
|
|
2904
2952
|
return v.type.toLowerCase().includes(w) || JSON.stringify(v.data || {}).toLowerCase().includes(w);
|
|
@@ -2949,7 +2997,7 @@ function Ur({
|
|
|
2949
2997
|
{
|
|
2950
2998
|
type: "button",
|
|
2951
2999
|
onClick: () => b((v) => !v),
|
|
2952
|
-
style:
|
|
3000
|
+
style: Lt(y ? "#f59e0b" : "transparent"),
|
|
2953
3001
|
title: "Pause / resume capture",
|
|
2954
3002
|
children: y ? "▶ resume" : "⏸ pause"
|
|
2955
3003
|
}
|
|
@@ -2959,9 +3007,9 @@ function Ur({
|
|
|
2959
3007
|
{
|
|
2960
3008
|
type: "button",
|
|
2961
3009
|
onClick: () => {
|
|
2962
|
-
|
|
3010
|
+
d([]), a.current = [];
|
|
2963
3011
|
},
|
|
2964
|
-
style:
|
|
3012
|
+
style: Lt("transparent"),
|
|
2965
3013
|
title: "Clear buffer",
|
|
2966
3014
|
children: "clear"
|
|
2967
3015
|
}
|
|
@@ -2970,8 +3018,8 @@ function Ur({
|
|
|
2970
3018
|
"button",
|
|
2971
3019
|
{
|
|
2972
3020
|
type: "button",
|
|
2973
|
-
onClick: () =>
|
|
2974
|
-
style:
|
|
3021
|
+
onClick: () => i(!1),
|
|
3022
|
+
style: Lt("transparent"),
|
|
2975
3023
|
"aria-label": "Close",
|
|
2976
3024
|
title: "Close (Cmd/Ctrl + Shift + L)",
|
|
2977
3025
|
children: "✕"
|
|
@@ -3007,7 +3055,7 @@ function Ur({
|
|
|
3007
3055
|
overflowY: "auto",
|
|
3008
3056
|
padding: "0 8px 8px"
|
|
3009
3057
|
},
|
|
3010
|
-
children:
|
|
3058
|
+
children: E.length === 0 ? /* @__PURE__ */ _(
|
|
3011
3059
|
"div",
|
|
3012
3060
|
{
|
|
3013
3061
|
style: {
|
|
@@ -3037,13 +3085,13 @@ function Ur({
|
|
|
3037
3085
|
)
|
|
3038
3086
|
]
|
|
3039
3087
|
}
|
|
3040
|
-
) :
|
|
3041
|
-
|
|
3088
|
+
) : E.map((v) => /* @__PURE__ */ n(
|
|
3089
|
+
Dr,
|
|
3042
3090
|
{
|
|
3043
3091
|
entry: v,
|
|
3044
3092
|
expanded: s.current.has(v.id),
|
|
3045
3093
|
onToggle: () => {
|
|
3046
|
-
s.current.has(v.id) ? s.current.delete(v.id) : s.current.add(v.id),
|
|
3094
|
+
s.current.has(v.id) ? s.current.delete(v.id) : s.current.add(v.id), d((w) => [...w]);
|
|
3047
3095
|
}
|
|
3048
3096
|
},
|
|
3049
3097
|
v.id
|
|
@@ -3054,12 +3102,12 @@ function Ur({
|
|
|
3054
3102
|
}
|
|
3055
3103
|
);
|
|
3056
3104
|
}
|
|
3057
|
-
function
|
|
3105
|
+
function Dr({
|
|
3058
3106
|
entry: e,
|
|
3059
3107
|
expanded: t,
|
|
3060
3108
|
onToggle: r
|
|
3061
3109
|
}) {
|
|
3062
|
-
const
|
|
3110
|
+
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", {
|
|
3063
3111
|
hour12: !1
|
|
3064
3112
|
});
|
|
3065
3113
|
return /* @__PURE__ */ _(
|
|
@@ -3089,14 +3137,14 @@ function Ir({
|
|
|
3089
3137
|
fontVariantNumeric: "tabular-nums",
|
|
3090
3138
|
fontSize: 10
|
|
3091
3139
|
},
|
|
3092
|
-
children:
|
|
3140
|
+
children: i
|
|
3093
3141
|
}
|
|
3094
3142
|
),
|
|
3095
3143
|
/* @__PURE__ */ n(
|
|
3096
3144
|
"span",
|
|
3097
3145
|
{
|
|
3098
3146
|
style: {
|
|
3099
|
-
color:
|
|
3147
|
+
color: o,
|
|
3100
3148
|
fontWeight: 600,
|
|
3101
3149
|
flexShrink: 0
|
|
3102
3150
|
},
|
|
@@ -3124,7 +3172,7 @@ function Ir({
|
|
|
3124
3172
|
}
|
|
3125
3173
|
);
|
|
3126
3174
|
}
|
|
3127
|
-
function
|
|
3175
|
+
function Lt(e) {
|
|
3128
3176
|
return {
|
|
3129
3177
|
background: e,
|
|
3130
3178
|
color: "#fff",
|
|
@@ -3142,52 +3190,52 @@ function Tr(e) {
|
|
|
3142
3190
|
return String(e);
|
|
3143
3191
|
}
|
|
3144
3192
|
}
|
|
3145
|
-
function
|
|
3146
|
-
const [e, t] = S([]), r = L((
|
|
3193
|
+
function Fr() {
|
|
3194
|
+
const [e, t] = S([]), r = L((i) => {
|
|
3147
3195
|
t((l) => {
|
|
3148
|
-
const
|
|
3149
|
-
if (
|
|
3196
|
+
const d = l.findIndex((u) => u.id === i.id);
|
|
3197
|
+
if (d >= 0) {
|
|
3150
3198
|
const u = l.slice();
|
|
3151
|
-
return u[
|
|
3199
|
+
return u[d] = i, u;
|
|
3152
3200
|
}
|
|
3153
|
-
return [...l,
|
|
3201
|
+
return [...l, i];
|
|
3154
3202
|
});
|
|
3155
|
-
}, []),
|
|
3203
|
+
}, []), o = L(() => t([]), []);
|
|
3156
3204
|
return {
|
|
3157
3205
|
entries: e,
|
|
3158
3206
|
pushSegment: r,
|
|
3159
|
-
clear:
|
|
3207
|
+
clear: o,
|
|
3160
3208
|
latest: e.length > 0 ? e[e.length - 1] : null
|
|
3161
3209
|
};
|
|
3162
3210
|
}
|
|
3163
3211
|
export {
|
|
3164
|
-
|
|
3212
|
+
Or as AvatarWidget,
|
|
3165
3213
|
wn as ErrorBoundary,
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3214
|
+
Wr as LiveLayerDebugPanel,
|
|
3215
|
+
Vr as LiveLayerField,
|
|
3216
|
+
qr as LiveLayerForm,
|
|
3217
|
+
Ur as LiveLayerRegion,
|
|
3218
|
+
Hr as LiveLayerWidget,
|
|
3171
3219
|
gr as clearPageContextCache,
|
|
3172
3220
|
xr as clearRoutesCache,
|
|
3173
3221
|
mr as extractPageContext,
|
|
3174
3222
|
wr as extractRoutes,
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3223
|
+
kt as getCachedPageContext,
|
|
3224
|
+
dt as getCachedRoutes,
|
|
3225
|
+
Vn as matchesPattern,
|
|
3178
3226
|
vr as normalizeRouteInput,
|
|
3179
|
-
|
|
3227
|
+
Wn as shouldRenderAtPath,
|
|
3180
3228
|
Nn as useAgentInfo,
|
|
3181
3229
|
xn as useAudioLevel,
|
|
3182
3230
|
Sn as useCameraState,
|
|
3183
3231
|
Mn as useDisplayMode,
|
|
3184
|
-
|
|
3232
|
+
In as useDisplayModePersistence,
|
|
3185
3233
|
$n as useIsMobile,
|
|
3186
3234
|
_n as useLiveKitSession,
|
|
3187
|
-
|
|
3235
|
+
Cn as useMediaDevices,
|
|
3188
3236
|
kn as useMicrophoneState,
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3237
|
+
zn as usePathname,
|
|
3238
|
+
Fn as useRouteMatch,
|
|
3239
|
+
En as useScreenShareState,
|
|
3240
|
+
Fr as useTranscript
|
|
3193
3241
|
};
|