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