@livelayer/react 0.5.20 → 0.5.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -3
- package/dist/index.mjs +516 -522
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as _, jsx as n, Fragment as
|
|
3
|
-
import { Component as
|
|
4
|
-
import { LiveKitSession as
|
|
5
|
-
import { createLocalAudioTrack as
|
|
6
|
-
class
|
|
2
|
+
import { jsxs as _, jsx as n, Fragment as wt } from "react/jsx-runtime";
|
|
3
|
+
import { Component as mn, useState as L, useRef as A, useEffect as N, useCallback as k, useMemo as st, forwardRef as _t, createElement as gn } from "react";
|
|
4
|
+
import { LiveKitSession as yn } from "@livelayer/sdk";
|
|
5
|
+
import { createLocalAudioTrack as vn, Track as en, createLocalVideoTrack as bn } from "livekit-client";
|
|
6
|
+
class wn extends mn {
|
|
7
7
|
constructor() {
|
|
8
8
|
super(...arguments), this.state = { hasError: !1, error: null }, this.reset = () => {
|
|
9
9
|
this.setState({ hasError: !1, error: null });
|
|
@@ -33,9 +33,9 @@ class xn extends yn {
|
|
|
33
33
|
] }) : this.props.children;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
const [t, r] = L("idle"), [i, o] = L("idle"), [l, c] = L([]), [u, f] = L(null), [y, b] = L(null), [s, a] = L(null), [x,
|
|
38
|
-
O.current = e.onDataMessage,
|
|
36
|
+
function _n(e) {
|
|
37
|
+
const [t, r] = L("idle"), [i, o] = L("idle"), [l, c] = L([]), [u, f] = L(null), [y, b] = L(null), [s, a] = L(null), [x, E] = L(!1), [C, v] = L(null), w = A(null), O = A(e.onDataMessage);
|
|
38
|
+
O.current = e.onDataMessage, N(() => {
|
|
39
39
|
const R = {
|
|
40
40
|
onConnectionStateChange: (z) => {
|
|
41
41
|
r(z), z === "connected" && v(null);
|
|
@@ -51,8 +51,8 @@ function kn(e) {
|
|
|
51
51
|
var M;
|
|
52
52
|
(M = O.current) == null || M.call(O, z);
|
|
53
53
|
},
|
|
54
|
-
onResumabilityChange:
|
|
55
|
-
}, W = new
|
|
54
|
+
onResumabilityChange: E
|
|
55
|
+
}, W = new yn(
|
|
56
56
|
{
|
|
57
57
|
agentId: e.agentId,
|
|
58
58
|
baseUrl: e.baseUrl,
|
|
@@ -62,7 +62,7 @@ function kn(e) {
|
|
|
62
62
|
},
|
|
63
63
|
R
|
|
64
64
|
);
|
|
65
|
-
return w.current = W, r("idle"), o("idle"), c([]), f(null), b(null), a(null),
|
|
65
|
+
return w.current = W, r("idle"), o("idle"), c([]), f(null), b(null), a(null), E(!1), v(null), () => {
|
|
66
66
|
var z;
|
|
67
67
|
(z = W.destroy) == null || z.call(W), w.current = null;
|
|
68
68
|
};
|
|
@@ -103,8 +103,8 @@ function kn(e) {
|
|
|
103
103
|
session: w.current
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
|
-
function
|
|
107
|
-
const e =
|
|
106
|
+
function xn() {
|
|
107
|
+
const e = A(null), t = A(null), r = A(null), i = A(null), o = A(/* @__PURE__ */ new Set()), l = A(null), c = k(() => {
|
|
108
108
|
const s = t.current;
|
|
109
109
|
if (!s) {
|
|
110
110
|
i.current = null;
|
|
@@ -117,10 +117,10 @@ function Ln() {
|
|
|
117
117
|
s.getByteFrequencyData(a);
|
|
118
118
|
let x = 0;
|
|
119
119
|
for (let C = 0; C < a.length; C++) x += a[C];
|
|
120
|
-
const
|
|
120
|
+
const E = x / a.length / 255;
|
|
121
121
|
for (const C of o.current)
|
|
122
122
|
try {
|
|
123
|
-
C(
|
|
123
|
+
C(E);
|
|
124
124
|
} catch (v) {
|
|
125
125
|
console.error("[useAudioLevel] subscriber threw:", v);
|
|
126
126
|
}
|
|
@@ -161,7 +161,7 @@ function Ln() {
|
|
|
161
161
|
}, []), b = k((s) => (o.current.add(s), () => {
|
|
162
162
|
o.current.delete(s);
|
|
163
163
|
}), []);
|
|
164
|
-
return
|
|
164
|
+
return N(() => () => {
|
|
165
165
|
if (y(), t.current) {
|
|
166
166
|
try {
|
|
167
167
|
t.current.disconnect();
|
|
@@ -179,8 +179,8 @@ function Ln() {
|
|
|
179
179
|
o.current.clear(), l.current = null;
|
|
180
180
|
}, [y]), { attach: f, detach: y, subscribe: b };
|
|
181
181
|
}
|
|
182
|
-
function
|
|
183
|
-
const [e, t] = L(!1), [r, i] = L(null), o =
|
|
182
|
+
function kn() {
|
|
183
|
+
const [e, t] = L(!1), [r, i] = L(null), o = A(null), l = A(null), c = k(
|
|
184
184
|
async (s, a) => {
|
|
185
185
|
if (o.current && l.current) {
|
|
186
186
|
try {
|
|
@@ -191,14 +191,14 @@ function Sn() {
|
|
|
191
191
|
}
|
|
192
192
|
l.current = s, i(null);
|
|
193
193
|
try {
|
|
194
|
-
const x = await
|
|
194
|
+
const x = await vn({
|
|
195
195
|
echoCancellation: !0,
|
|
196
196
|
noiseSuppression: !0
|
|
197
197
|
});
|
|
198
198
|
a != null && a.startMuted && await x.mute(), await s.localParticipant.publishTrack(x), o.current = x, t(x.isMuted);
|
|
199
199
|
} catch (x) {
|
|
200
|
-
const
|
|
201
|
-
throw i(
|
|
200
|
+
const E = x instanceof Error && x.name === "NotAllowedError" ? "Enable your microphone to talk with the agent." : "Microphone unavailable. Check browser permissions and try again.";
|
|
201
|
+
throw i(E), x;
|
|
202
202
|
}
|
|
203
203
|
},
|
|
204
204
|
[]
|
|
@@ -229,14 +229,14 @@ function Sn() {
|
|
|
229
229
|
clearError: b
|
|
230
230
|
};
|
|
231
231
|
}
|
|
232
|
-
const
|
|
233
|
-
function
|
|
234
|
-
const [e, t] = L(!1), [r, i] = L(null), [o, l] = L(null), [c, u] = L(""), f =
|
|
232
|
+
const Ln = { resolution: { width: 640, height: 480, frameRate: 24 } };
|
|
233
|
+
function Sn() {
|
|
234
|
+
const [e, t] = L(!1), [r, i] = L(null), [o, l] = L(null), [c, u] = L(""), f = A(null), y = A(null), b = k((w) => {
|
|
235
235
|
f.current = w;
|
|
236
236
|
}, []), s = k(() => {
|
|
237
237
|
const w = f.current, O = y.current;
|
|
238
238
|
if (O && w) {
|
|
239
|
-
const I = w.localParticipant.getTrackPublication(
|
|
239
|
+
const I = w.localParticipant.getTrackPublication(en.Source.Camera);
|
|
240
240
|
if (I != null && I.track) {
|
|
241
241
|
try {
|
|
242
242
|
w.localParticipant.unpublishTrack(I.track);
|
|
@@ -252,9 +252,9 @@ function En() {
|
|
|
252
252
|
if (O) {
|
|
253
253
|
i(null);
|
|
254
254
|
try {
|
|
255
|
-
const I = { ...
|
|
255
|
+
const I = { ...Ln };
|
|
256
256
|
w && (I.deviceId = w);
|
|
257
|
-
const q = await
|
|
257
|
+
const q = await bn(I);
|
|
258
258
|
await O.localParticipant.publishTrack(q), y.current = q;
|
|
259
259
|
const m = q.attach();
|
|
260
260
|
l(m), t(!0), w && u(w);
|
|
@@ -272,12 +272,12 @@ function En() {
|
|
|
272
272
|
}
|
|
273
273
|
}, []), x = k(async () => {
|
|
274
274
|
e ? s() : await a(c || void 0);
|
|
275
|
-
}, [e, c, s, a]),
|
|
275
|
+
}, [e, c, s, a]), E = k(async (w) => {
|
|
276
276
|
s(), await a(w);
|
|
277
277
|
}, [s, a]), C = k(() => {
|
|
278
278
|
s(), f.current = null, i(null), u("");
|
|
279
279
|
}, [s]), v = k(() => i(null), []);
|
|
280
|
-
return
|
|
280
|
+
return N(() => () => {
|
|
281
281
|
y.current && y.current.stop();
|
|
282
282
|
}, []), {
|
|
283
283
|
isEnabled: e,
|
|
@@ -285,14 +285,14 @@ function En() {
|
|
|
285
285
|
previewEl: o,
|
|
286
286
|
activeDeviceId: c,
|
|
287
287
|
toggle: x,
|
|
288
|
-
switchDevice:
|
|
288
|
+
switchDevice: E,
|
|
289
289
|
attachRoom: b,
|
|
290
290
|
teardown: C,
|
|
291
291
|
clearError: v
|
|
292
292
|
};
|
|
293
293
|
}
|
|
294
|
-
function
|
|
295
|
-
const [e, t] = L(!1), [r, i] = L(null), [o, l] = L(null), c =
|
|
294
|
+
function Cn() {
|
|
295
|
+
const [e, t] = L(!1), [r, i] = L(null), [o, l] = L(null), c = A(null), u = k((a) => {
|
|
296
296
|
c.current = a;
|
|
297
297
|
}, []), f = k(() => l(null), []), y = k(async () => {
|
|
298
298
|
const a = c.current;
|
|
@@ -309,8 +309,8 @@ function Nn() {
|
|
|
309
309
|
try {
|
|
310
310
|
await a.localParticipant.setScreenShareEnabled(!0);
|
|
311
311
|
let x = 0;
|
|
312
|
-
const
|
|
313
|
-
const C = a.localParticipant.getTrackPublication(
|
|
312
|
+
const E = () => {
|
|
313
|
+
const C = a.localParticipant.getTrackPublication(en.Source.ScreenShare);
|
|
314
314
|
if (C != null && C.track) {
|
|
315
315
|
const v = C.track.attach();
|
|
316
316
|
l(v), t(!0);
|
|
@@ -323,12 +323,12 @@ function Nn() {
|
|
|
323
323
|
}
|
|
324
324
|
return;
|
|
325
325
|
}
|
|
326
|
-
x++ < 10 ? setTimeout(
|
|
326
|
+
x++ < 10 ? setTimeout(E, 100) : t(!0);
|
|
327
327
|
};
|
|
328
|
-
|
|
328
|
+
E();
|
|
329
329
|
} catch (x) {
|
|
330
|
-
const
|
|
331
|
-
|
|
330
|
+
const E = x instanceof Error ? x.name : "";
|
|
331
|
+
E !== "NotAllowedError" && E !== "AbortError" && i("Screen share unavailable. Try again."), t(!1);
|
|
332
332
|
}
|
|
333
333
|
}
|
|
334
334
|
}, [e, f]), b = k(() => {
|
|
@@ -342,7 +342,7 @@ function Nn() {
|
|
|
342
342
|
}, [e, f]), s = k(() => i(null), []);
|
|
343
343
|
return { isEnabled: e, error: r, previewEl: o, toggle: y, attachRoom: u, teardown: b, clearError: s };
|
|
344
344
|
}
|
|
345
|
-
function
|
|
345
|
+
function En() {
|
|
346
346
|
const [e, t] = L([]), [r, i] = L([]), o = k(async () => {
|
|
347
347
|
if (!(typeof navigator > "u" || !navigator.mediaDevices))
|
|
348
348
|
try {
|
|
@@ -351,15 +351,15 @@ function An() {
|
|
|
351
351
|
} catch {
|
|
352
352
|
}
|
|
353
353
|
}, []);
|
|
354
|
-
return
|
|
354
|
+
return N(() => {
|
|
355
355
|
if (o(), typeof navigator > "u" || !navigator.mediaDevices) return;
|
|
356
356
|
const l = () => void o();
|
|
357
357
|
return navigator.mediaDevices.addEventListener("devicechange", l), () => navigator.mediaDevices.removeEventListener("devicechange", l);
|
|
358
358
|
}, [o]), { mics: e, cameras: r, refresh: o };
|
|
359
359
|
}
|
|
360
|
-
function
|
|
360
|
+
function Nn(e, t, r = !1) {
|
|
361
361
|
const [i, o] = L(null), [l, c] = L(null), [u, f] = L(!r && !!e);
|
|
362
|
-
return
|
|
362
|
+
return N(() => {
|
|
363
363
|
if (r || !e) {
|
|
364
364
|
f(!1);
|
|
365
365
|
return;
|
|
@@ -380,7 +380,7 @@ function Rn(e, t, r = !1) {
|
|
|
380
380
|
}), () => y.abort();
|
|
381
381
|
}, [e, t, r]), { info: i, error: l, loading: u };
|
|
382
382
|
}
|
|
383
|
-
function
|
|
383
|
+
function An(e) {
|
|
384
384
|
if (typeof window > "u") return null;
|
|
385
385
|
try {
|
|
386
386
|
return window.localStorage.getItem(e);
|
|
@@ -388,14 +388,14 @@ function Mn(e) {
|
|
|
388
388
|
return null;
|
|
389
389
|
}
|
|
390
390
|
}
|
|
391
|
-
function
|
|
391
|
+
function Rn(e, t) {
|
|
392
392
|
if (!(typeof window > "u"))
|
|
393
393
|
try {
|
|
394
394
|
window.localStorage.setItem(e, t);
|
|
395
395
|
} catch {
|
|
396
396
|
}
|
|
397
397
|
}
|
|
398
|
-
function
|
|
398
|
+
function Mn({
|
|
399
399
|
value: e,
|
|
400
400
|
defaultValue: t = "expanded",
|
|
401
401
|
onChange: r
|
|
@@ -408,34 +408,34 @@ function Tn({
|
|
|
408
408
|
);
|
|
409
409
|
return [c, u];
|
|
410
410
|
}
|
|
411
|
-
const
|
|
412
|
-
function
|
|
413
|
-
return e &&
|
|
411
|
+
const In = ["hidden", "minimized", "expanded"];
|
|
412
|
+
function Tn(e) {
|
|
413
|
+
return e && In.includes(e) ? e : null;
|
|
414
414
|
}
|
|
415
|
-
function
|
|
415
|
+
function Pn({
|
|
416
416
|
value: e,
|
|
417
417
|
defaultValue: t = "expanded",
|
|
418
418
|
onChange: r,
|
|
419
419
|
persistKey: i = "ll-widget",
|
|
420
420
|
disablePersistence: o = !1
|
|
421
421
|
} = {}) {
|
|
422
|
-
const l = `${i}:display-mode`, c =
|
|
422
|
+
const l = `${i}:display-mode`, c = A(!1), [u, f] = Mn({
|
|
423
423
|
value: e,
|
|
424
424
|
defaultValue: t,
|
|
425
425
|
onChange: (y) => {
|
|
426
|
-
e === void 0 && !o &&
|
|
426
|
+
e === void 0 && !o && Rn(l, y), r == null || r(y);
|
|
427
427
|
}
|
|
428
428
|
});
|
|
429
|
-
return
|
|
429
|
+
return N(() => {
|
|
430
430
|
if (c.current || (c.current = !0, o || e !== void 0)) return;
|
|
431
|
-
const y =
|
|
431
|
+
const y = Tn(An(l));
|
|
432
432
|
y && y !== u && f(y);
|
|
433
433
|
}, []), [u, f];
|
|
434
434
|
}
|
|
435
|
-
const
|
|
436
|
-
function
|
|
435
|
+
const Dn = 640;
|
|
436
|
+
function $n(e = Dn) {
|
|
437
437
|
const [t, r] = L(!1);
|
|
438
|
-
return
|
|
438
|
+
return N(() => {
|
|
439
439
|
if (e === !1) {
|
|
440
440
|
r(!1);
|
|
441
441
|
return;
|
|
@@ -448,67 +448,67 @@ function Hn(e = zn) {
|
|
|
448
448
|
});
|
|
449
449
|
}, [e]), t;
|
|
450
450
|
}
|
|
451
|
-
const
|
|
452
|
-
function
|
|
453
|
-
if (typeof window > "u" || window.history[
|
|
451
|
+
const zt = "__llHistoryPatched", ct = "ll:pathname";
|
|
452
|
+
function zn() {
|
|
453
|
+
if (typeof window > "u" || window.history[zt]) return;
|
|
454
454
|
const e = window.history.pushState, t = window.history.replaceState;
|
|
455
455
|
window.history.pushState = function(...r) {
|
|
456
456
|
const i = e.apply(this, r);
|
|
457
|
-
return window.dispatchEvent(new Event(
|
|
457
|
+
return window.dispatchEvent(new Event(ct)), i;
|
|
458
458
|
}, window.history.replaceState = function(...r) {
|
|
459
459
|
const i = t.apply(this, r);
|
|
460
|
-
return window.dispatchEvent(new Event(
|
|
461
|
-
}, window.history[
|
|
460
|
+
return window.dispatchEvent(new Event(ct)), i;
|
|
461
|
+
}, window.history[zt] = !0;
|
|
462
462
|
}
|
|
463
|
-
function
|
|
463
|
+
function Ht() {
|
|
464
464
|
return typeof window > "u" ? "/" : window.location.pathname || "/";
|
|
465
465
|
}
|
|
466
|
-
function
|
|
466
|
+
function Hn(e) {
|
|
467
467
|
const [t, r] = L(
|
|
468
|
-
() => e ??
|
|
468
|
+
() => e ?? Ht()
|
|
469
469
|
);
|
|
470
|
-
return
|
|
470
|
+
return N(() => {
|
|
471
471
|
if (e !== void 0) return;
|
|
472
|
-
|
|
473
|
-
const i = () => r(
|
|
474
|
-
return i(), window.addEventListener("popstate", i), window.addEventListener(
|
|
475
|
-
window.removeEventListener("popstate", i), window.removeEventListener(
|
|
472
|
+
zn();
|
|
473
|
+
const i = () => r(Ht());
|
|
474
|
+
return i(), window.addEventListener("popstate", i), window.addEventListener(ct, i), () => {
|
|
475
|
+
window.removeEventListener("popstate", i), window.removeEventListener(ct, i);
|
|
476
476
|
};
|
|
477
477
|
}, [e]), e ?? t;
|
|
478
478
|
}
|
|
479
|
-
const
|
|
480
|
-
function
|
|
481
|
-
return e.replace(
|
|
479
|
+
const Ot = /* @__PURE__ */ new Map(), On = /[\\^$+?.()|{}[\]]/g;
|
|
480
|
+
function qn(e) {
|
|
481
|
+
return e.replace(On, "\\$&");
|
|
482
482
|
}
|
|
483
|
-
function
|
|
484
|
-
const t =
|
|
483
|
+
function Bn(e) {
|
|
484
|
+
const t = Ot.get(e);
|
|
485
485
|
if (t) return t;
|
|
486
|
-
const r = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e, i = "", o = "", l = r.replace(/\*\*/g, i).replace(/\*/g, o), u =
|
|
487
|
-
return
|
|
486
|
+
const r = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e, i = "", o = "", l = r.replace(/\*\*/g, i).replace(/\*/g, o), u = qn(l).replace(new RegExp(`\\/${i}`, "g"), "(?:\\/.*)?").replace(new RegExp(i, "g"), ".*").replace(new RegExp(o, "g"), "[^/]+"), f = new RegExp(`^${u}\\/?$`);
|
|
487
|
+
return Ot.set(e, f), f;
|
|
488
488
|
}
|
|
489
|
-
function
|
|
489
|
+
function Wn(e, t) {
|
|
490
490
|
const r = t.length > 1 && t.endsWith("/") ? t.slice(0, -1) : t;
|
|
491
|
-
return
|
|
491
|
+
return Bn(e).test(r);
|
|
492
492
|
}
|
|
493
|
-
function
|
|
494
|
-
return typeof e == "function" ? e(t) : e instanceof RegExp ? e.test(t) :
|
|
493
|
+
function Fn(e, t) {
|
|
494
|
+
return typeof e == "function" ? e(t) : e instanceof RegExp ? e.test(t) : Wn(e, t);
|
|
495
495
|
}
|
|
496
|
-
function
|
|
496
|
+
function qt(e, t) {
|
|
497
497
|
if (!e || e.length === 0) return !1;
|
|
498
498
|
for (const r of e)
|
|
499
|
-
if (
|
|
499
|
+
if (Fn(r, t)) return !0;
|
|
500
500
|
return !1;
|
|
501
501
|
}
|
|
502
|
-
function
|
|
503
|
-
return e === void 0 ? !0 :
|
|
502
|
+
function Un(e, t, r) {
|
|
503
|
+
return e === void 0 ? !0 : qt(r, e) ? !1 : t && t.length > 0 ? qt(t, e) : !0;
|
|
504
504
|
}
|
|
505
|
-
function
|
|
506
|
-
return
|
|
507
|
-
() =>
|
|
505
|
+
function jn(e, t, r) {
|
|
506
|
+
return st(
|
|
507
|
+
() => Un(e, t, r),
|
|
508
508
|
[e, t, r]
|
|
509
509
|
);
|
|
510
510
|
}
|
|
511
|
-
const
|
|
511
|
+
const Bt = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ _(
|
|
512
512
|
"svg",
|
|
513
513
|
{
|
|
514
514
|
className: t,
|
|
@@ -554,7 +554,7 @@ const Ft = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ _(
|
|
|
554
554
|
}
|
|
555
555
|
)
|
|
556
556
|
}
|
|
557
|
-
),
|
|
557
|
+
), Wt = ({ className: e }) => /* @__PURE__ */ n(
|
|
558
558
|
"svg",
|
|
559
559
|
{
|
|
560
560
|
className: e,
|
|
@@ -572,7 +572,7 @@ const Ft = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ _(
|
|
|
572
572
|
}
|
|
573
573
|
)
|
|
574
574
|
}
|
|
575
|
-
),
|
|
575
|
+
), Vn = ({ className: e }) => /* @__PURE__ */ n(
|
|
576
576
|
"svg",
|
|
577
577
|
{
|
|
578
578
|
className: e,
|
|
@@ -583,12 +583,12 @@ const Ft = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ _(
|
|
|
583
583
|
"aria-hidden": "true",
|
|
584
584
|
children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
|
|
585
585
|
}
|
|
586
|
-
),
|
|
586
|
+
), Yn = {
|
|
587
587
|
left: 180,
|
|
588
588
|
right: 0,
|
|
589
589
|
up: -90,
|
|
590
590
|
down: 90
|
|
591
|
-
},
|
|
591
|
+
}, Ft = ({ direction: e = "right", className: t }) => /* @__PURE__ */ n(
|
|
592
592
|
"svg",
|
|
593
593
|
{
|
|
594
594
|
className: t,
|
|
@@ -596,19 +596,19 @@ const Ft = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ _(
|
|
|
596
596
|
viewBox: "0 0 24 24",
|
|
597
597
|
stroke: "currentColor",
|
|
598
598
|
strokeWidth: 2,
|
|
599
|
-
style: { transform: `rotate(${
|
|
599
|
+
style: { transform: `rotate(${Yn[e]}deg)` },
|
|
600
600
|
"aria-hidden": "true",
|
|
601
601
|
children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 6l6 6-6 6" })
|
|
602
602
|
}
|
|
603
603
|
);
|
|
604
|
-
function
|
|
604
|
+
function Jn(e) {
|
|
605
605
|
return e === "top-left" || e === "bottom-left" ? "left" : "right";
|
|
606
606
|
}
|
|
607
|
-
const
|
|
608
|
-
function
|
|
607
|
+
const tn = "ll-hidden-tab-center-y", Kn = 5, Ut = 16;
|
|
608
|
+
function Xn() {
|
|
609
609
|
if (typeof window > "u") return null;
|
|
610
610
|
try {
|
|
611
|
-
const e = window.localStorage.getItem(
|
|
611
|
+
const e = window.localStorage.getItem(tn);
|
|
612
612
|
if (!e) return null;
|
|
613
613
|
const t = Number.parseFloat(e);
|
|
614
614
|
return Number.isFinite(t) ? t : null;
|
|
@@ -616,14 +616,14 @@ function Qn() {
|
|
|
616
616
|
return null;
|
|
617
617
|
}
|
|
618
618
|
}
|
|
619
|
-
function
|
|
619
|
+
function jt(e) {
|
|
620
620
|
if (!(typeof window > "u"))
|
|
621
621
|
try {
|
|
622
|
-
window.localStorage.setItem(
|
|
622
|
+
window.localStorage.setItem(tn, String(e));
|
|
623
623
|
} catch {
|
|
624
624
|
}
|
|
625
625
|
}
|
|
626
|
-
const
|
|
626
|
+
const Gn = ({
|
|
627
627
|
position: e,
|
|
628
628
|
isMobile: t,
|
|
629
629
|
isSpeaking: r,
|
|
@@ -632,16 +632,16 @@ const Zn = ({
|
|
|
632
632
|
avatarImageUrl: l,
|
|
633
633
|
agentName: c
|
|
634
634
|
}) => {
|
|
635
|
-
const u =
|
|
635
|
+
const u = Jn(e), f = u === "right" ? "left" : "right", y = t ? 80 : 72, b = !!l, [s, a] = L(null), [x, E] = L(!1), C = A(null), v = A(!1), w = k(
|
|
636
636
|
(M) => {
|
|
637
637
|
if (typeof window > "u") return M;
|
|
638
|
-
const B = y / 2, F =
|
|
638
|
+
const B = y / 2, F = Ut + B, G = window.innerHeight - Ut - B;
|
|
639
639
|
return G < F ? Math.max(F, M) : Math.max(F, Math.min(G, M));
|
|
640
640
|
},
|
|
641
641
|
[y]
|
|
642
642
|
);
|
|
643
|
-
|
|
644
|
-
const M =
|
|
643
|
+
N(() => {
|
|
644
|
+
const M = Xn();
|
|
645
645
|
a(w(M ?? window.innerHeight / 2));
|
|
646
646
|
const B = () => {
|
|
647
647
|
a((F) => F === null ? null : w(F));
|
|
@@ -668,7 +668,7 @@ const Zn = ({
|
|
|
668
668
|
const B = C.current;
|
|
669
669
|
if (!B) return;
|
|
670
670
|
const F = M.clientY - B.startClientY;
|
|
671
|
-
!B.moved && Math.abs(F) >
|
|
671
|
+
!B.moved && Math.abs(F) > Kn && (B.moved = !0, E(!0)), B.moved && a(w(B.startCenterY + F));
|
|
672
672
|
},
|
|
673
673
|
[w]
|
|
674
674
|
), q = k(
|
|
@@ -679,7 +679,7 @@ const Zn = ({
|
|
|
679
679
|
M.currentTarget.releasePointerCapture(M.pointerId);
|
|
680
680
|
} catch {
|
|
681
681
|
}
|
|
682
|
-
C.current = null, B.moved && (
|
|
682
|
+
C.current = null, B.moved && (E(!1), v.current = !0, a((F) => (F !== null && jt(F), F)));
|
|
683
683
|
}
|
|
684
684
|
},
|
|
685
685
|
[]
|
|
@@ -697,7 +697,7 @@ const Zn = ({
|
|
|
697
697
|
a((F) => {
|
|
698
698
|
if (F === null) return F;
|
|
699
699
|
const G = w(F + B);
|
|
700
|
-
return
|
|
700
|
+
return jt(G), G;
|
|
701
701
|
});
|
|
702
702
|
}
|
|
703
703
|
},
|
|
@@ -729,9 +729,9 @@ const Zn = ({
|
|
|
729
729
|
// as the click affordance), then the circular avatar photo
|
|
730
730
|
// taking the rest of the tab. Reinforces "this is an
|
|
731
731
|
// avatar-based experience" even when collapsed.
|
|
732
|
-
/* @__PURE__ */ _(
|
|
732
|
+
/* @__PURE__ */ _(wt, { children: [
|
|
733
733
|
/* @__PURE__ */ n(
|
|
734
|
-
|
|
734
|
+
Ft,
|
|
735
735
|
{
|
|
736
736
|
direction: f,
|
|
737
737
|
className: "ll-hidden__chevron ll-hidden__chevron--mini"
|
|
@@ -748,7 +748,7 @@ const Zn = ({
|
|
|
748
748
|
)
|
|
749
749
|
] })
|
|
750
750
|
) : /* @__PURE__ */ n(
|
|
751
|
-
|
|
751
|
+
Ft,
|
|
752
752
|
{
|
|
753
753
|
direction: f,
|
|
754
754
|
className: "ll-hidden__chevron"
|
|
@@ -756,7 +756,7 @@ const Zn = ({
|
|
|
756
756
|
)
|
|
757
757
|
}
|
|
758
758
|
);
|
|
759
|
-
},
|
|
759
|
+
}, Qn = ({
|
|
760
760
|
audioLevel: e,
|
|
761
761
|
bars: t = 20,
|
|
762
762
|
maxHeight: r = 20,
|
|
@@ -764,16 +764,16 @@ const Zn = ({
|
|
|
764
764
|
className: o,
|
|
765
765
|
barClassName: l
|
|
766
766
|
}) => {
|
|
767
|
-
const c =
|
|
767
|
+
const c = A(null), u = A([]), f = st(() => {
|
|
768
768
|
const b = (Math.sqrt(5) - 1) / 2;
|
|
769
769
|
return Array.from({ length: t }, (s, a) => 0.5 + a * b % 1 * 0.5);
|
|
770
770
|
}, [t]);
|
|
771
|
-
|
|
771
|
+
N(() => e.subscribe((s) => {
|
|
772
772
|
for (let a = 0; a < t; a++) {
|
|
773
773
|
const x = u.current[a];
|
|
774
774
|
if (!x) continue;
|
|
775
|
-
const
|
|
776
|
-
x.style.height = `${
|
|
775
|
+
const E = Math.max(i, s * r * f[a]);
|
|
776
|
+
x.style.height = `${E}px`;
|
|
777
777
|
}
|
|
778
778
|
}), [e, t, r, i, f]);
|
|
779
779
|
const y = ["ll-waveform", o].filter(Boolean).join(" ");
|
|
@@ -788,7 +788,7 @@ const Zn = ({
|
|
|
788
788
|
},
|
|
789
789
|
s
|
|
790
790
|
)) });
|
|
791
|
-
},
|
|
791
|
+
}, Zn = ({
|
|
792
792
|
position: e,
|
|
793
793
|
isMobile: t,
|
|
794
794
|
agentName: r,
|
|
@@ -825,7 +825,7 @@ const Zn = ({
|
|
|
825
825
|
)
|
|
826
826
|
) : /* @__PURE__ */ n("div", { className: "ll-minimized__avatar ll-minimized__avatar--placeholder" }),
|
|
827
827
|
/* @__PURE__ */ n(
|
|
828
|
-
|
|
828
|
+
Qn,
|
|
829
829
|
{
|
|
830
830
|
audioLevel: c,
|
|
831
831
|
bars: 16,
|
|
@@ -848,10 +848,10 @@ const Zn = ({
|
|
|
848
848
|
(b.key === "Enter" || b.key === " ") && (b.stopPropagation(), b.preventDefault(), f());
|
|
849
849
|
},
|
|
850
850
|
"aria-label": l ? "Unmute microphone" : "Mute microphone",
|
|
851
|
-
children: /* @__PURE__ */ n(
|
|
851
|
+
children: /* @__PURE__ */ n(Bt, { muted: l, className: "ll-minimized__icon" })
|
|
852
852
|
}
|
|
853
853
|
),
|
|
854
|
-
/* @__PURE__ */ n(
|
|
854
|
+
/* @__PURE__ */ n(Wt, { className: "ll-minimized__icon ll-minimized__icon--expand" })
|
|
855
855
|
] })
|
|
856
856
|
]
|
|
857
857
|
}
|
|
@@ -888,7 +888,7 @@ const Zn = ({
|
|
|
888
888
|
className: "ll-minimized__btn",
|
|
889
889
|
onClick: f,
|
|
890
890
|
"aria-label": l ? "Unmute microphone" : "Mute microphone",
|
|
891
|
-
children: /* @__PURE__ */ n(
|
|
891
|
+
children: /* @__PURE__ */ n(Bt, { muted: l, className: "ll-minimized__icon" })
|
|
892
892
|
}
|
|
893
893
|
),
|
|
894
894
|
/* @__PURE__ */ n(
|
|
@@ -898,7 +898,7 @@ const Zn = ({
|
|
|
898
898
|
className: "ll-minimized__btn",
|
|
899
899
|
onClick: u,
|
|
900
900
|
"aria-label": `Expand ${r} widget`,
|
|
901
|
-
children: /* @__PURE__ */ n(
|
|
901
|
+
children: /* @__PURE__ */ n(Wt, { className: "ll-minimized__icon" })
|
|
902
902
|
}
|
|
903
903
|
),
|
|
904
904
|
/* @__PURE__ */ n(
|
|
@@ -908,21 +908,21 @@ const Zn = ({
|
|
|
908
908
|
className: "ll-minimized__btn ll-minimized__btn--close",
|
|
909
909
|
onClick: y,
|
|
910
910
|
"aria-label": "Close widget",
|
|
911
|
-
children: /* @__PURE__ */ n(
|
|
911
|
+
children: /* @__PURE__ */ n(Vn, { className: "ll-minimized__icon" })
|
|
912
912
|
}
|
|
913
913
|
)
|
|
914
914
|
] })
|
|
915
915
|
] })
|
|
916
916
|
}
|
|
917
|
-
),
|
|
917
|
+
), er = ({
|
|
918
918
|
src: e,
|
|
919
919
|
alt: t,
|
|
920
920
|
preCannedPlaying: r = !1,
|
|
921
921
|
className: i,
|
|
922
922
|
style: o
|
|
923
923
|
}) => {
|
|
924
|
-
const [l, c] = L(!1), u =
|
|
925
|
-
if (
|
|
924
|
+
const [l, c] = L(!1), u = A(e);
|
|
925
|
+
if (N(() => {
|
|
926
926
|
u.current !== e && (u.current = e, c(!1));
|
|
927
927
|
}, [e]), !e) return null;
|
|
928
928
|
const f = {
|
|
@@ -952,7 +952,7 @@ const Zn = ({
|
|
|
952
952
|
}
|
|
953
953
|
)
|
|
954
954
|
);
|
|
955
|
-
},
|
|
955
|
+
}, tr = ({
|
|
956
956
|
position: e,
|
|
957
957
|
isMobile: t,
|
|
958
958
|
agentName: r,
|
|
@@ -967,7 +967,7 @@ const Zn = ({
|
|
|
967
967
|
onToggleTeamSwitcher: s,
|
|
968
968
|
onSelectTeamMember: a,
|
|
969
969
|
languageMenuOpen: x,
|
|
970
|
-
onToggleLanguageMenu:
|
|
970
|
+
onToggleLanguageMenu: E,
|
|
971
971
|
connectionState: C,
|
|
972
972
|
agentState: v,
|
|
973
973
|
transcript: w,
|
|
@@ -991,22 +991,22 @@ const Zn = ({
|
|
|
991
991
|
agentVideoEl: re,
|
|
992
992
|
micGateOpen: ce,
|
|
993
993
|
onConnect: we,
|
|
994
|
-
onDisconnect:
|
|
995
|
-
onRetry:
|
|
996
|
-
onResumeAudio:
|
|
997
|
-
onToggleMute:
|
|
998
|
-
onToggleCamera:
|
|
994
|
+
onDisconnect: Se,
|
|
995
|
+
onRetry: Ce,
|
|
996
|
+
onResumeAudio: Ee,
|
|
997
|
+
onToggleMute: Ne,
|
|
998
|
+
onToggleCamera: Ae,
|
|
999
999
|
onSwitchCameraDevice: V,
|
|
1000
|
-
onToggleScreenShare:
|
|
1001
|
-
onToggleSpeaker:
|
|
1000
|
+
onToggleScreenShare: ut,
|
|
1001
|
+
onToggleSpeaker: ft,
|
|
1002
1002
|
onSendMessage: nt,
|
|
1003
1003
|
onMinimize: ue,
|
|
1004
|
-
onClose:
|
|
1005
|
-
onClearMicError:
|
|
1004
|
+
onClose: Re,
|
|
1005
|
+
onClearMicError: qe
|
|
1006
1006
|
}) => {
|
|
1007
|
-
var
|
|
1008
|
-
const _e = ((u == null ? void 0 : u.length) ?? 0) > 1,
|
|
1009
|
-
|
|
1007
|
+
var De;
|
|
1008
|
+
const _e = ((u == null ? void 0 : u.length) ?? 0) > 1, Me = C === "connecting" || C === "connected", X = C === "connected", ee = C === "idle" || C === "disconnected" || C === "error", [Ie, oe] = L(!1);
|
|
1009
|
+
N(() => {
|
|
1010
1010
|
if (!re) {
|
|
1011
1011
|
oe(!1);
|
|
1012
1012
|
return;
|
|
@@ -1022,73 +1022,73 @@ const Zn = ({
|
|
|
1022
1022
|
};
|
|
1023
1023
|
}, [re]);
|
|
1024
1024
|
const [de, xe] = L(!1);
|
|
1025
|
-
|
|
1025
|
+
N(() => {
|
|
1026
1026
|
if (!X) {
|
|
1027
1027
|
xe(!1);
|
|
1028
1028
|
return;
|
|
1029
1029
|
}
|
|
1030
|
-
if (
|
|
1030
|
+
if (Ie) return;
|
|
1031
1031
|
const p = setTimeout(() => xe(!0), 8e3);
|
|
1032
1032
|
return () => clearTimeout(p);
|
|
1033
|
-
}, [X,
|
|
1034
|
-
const
|
|
1035
|
-
|
|
1036
|
-
const p =
|
|
1033
|
+
}, [X, Ie]);
|
|
1034
|
+
const Be = C === "connecting" || X && !!i && !Ie && !de, te = A(null), le = A(null);
|
|
1035
|
+
N(() => {
|
|
1036
|
+
const p = te.current;
|
|
1037
1037
|
p && (p.innerHTML = "", M && (M.style.width = "100%", M.style.height = "100%", M.style.objectFit = "cover", M.style.transform = "scaleX(-1)", p.appendChild(M)));
|
|
1038
|
-
}, [M]),
|
|
1038
|
+
}, [M]), N(() => {
|
|
1039
1039
|
const p = le.current;
|
|
1040
1040
|
p && (p.innerHTML = "", ie && (ie.style.width = "100%", ie.style.height = "100%", ie.style.objectFit = "contain", p.appendChild(ie)));
|
|
1041
1041
|
}, [ie]);
|
|
1042
|
-
const [ae, fe] = L(!1), [
|
|
1043
|
-
|
|
1044
|
-
if (!ae && !
|
|
1042
|
+
const [ae, fe] = L(!1), [Te, pe] = L(!1);
|
|
1043
|
+
N(() => {
|
|
1044
|
+
if (!ae && !Te && !x && !b) return;
|
|
1045
1045
|
const p = () => {
|
|
1046
|
-
fe(!1), pe(!1), x &&
|
|
1046
|
+
fe(!1), pe(!1), x && E(), b && s();
|
|
1047
1047
|
};
|
|
1048
1048
|
return document.addEventListener("click", p), () => document.removeEventListener("click", p);
|
|
1049
1049
|
}, [
|
|
1050
1050
|
ae,
|
|
1051
|
-
|
|
1051
|
+
Te,
|
|
1052
1052
|
x,
|
|
1053
1053
|
b,
|
|
1054
|
-
|
|
1054
|
+
E,
|
|
1055
1055
|
s
|
|
1056
1056
|
]);
|
|
1057
|
-
const [he,
|
|
1057
|
+
const [he, We] = L(""), Fe = k(
|
|
1058
1058
|
(p) => {
|
|
1059
1059
|
p.preventDefault();
|
|
1060
1060
|
const Y = he.trim();
|
|
1061
|
-
Y && (nt(Y),
|
|
1061
|
+
Y && (nt(Y), We(""));
|
|
1062
1062
|
},
|
|
1063
1063
|
[he, nt]
|
|
1064
|
-
),
|
|
1064
|
+
), Ue = c.productName || "Live Layer";
|
|
1065
1065
|
let me = null, ge = null;
|
|
1066
1066
|
for (let p = w.length - 1; p >= 0; p--) {
|
|
1067
1067
|
const Y = w[p];
|
|
1068
1068
|
if (!me && Y.role === "agent" ? me = Y : !ge && Y.role === "user" && (ge = Y), me && ge) break;
|
|
1069
1069
|
}
|
|
1070
|
-
const
|
|
1070
|
+
const Pe = X ? (me == null ? void 0 : me.text) || null : l || null, rt = X && (ge == null ? void 0 : ge.text) || null, je = [
|
|
1071
1071
|
"ll-expanded",
|
|
1072
1072
|
t ? "ll-expanded--mobile" : "ll-expanded--desktop"
|
|
1073
1073
|
].join(" ");
|
|
1074
1074
|
return /* @__PURE__ */ _(
|
|
1075
1075
|
"div",
|
|
1076
1076
|
{
|
|
1077
|
-
className:
|
|
1077
|
+
className: je,
|
|
1078
1078
|
"data-position": e,
|
|
1079
|
-
"data-state": X ? "connected" :
|
|
1079
|
+
"data-state": X ? "connected" : Me ? "connecting" : "idle",
|
|
1080
1080
|
role: "dialog",
|
|
1081
1081
|
"aria-label": `${r} widget`,
|
|
1082
1082
|
children: [
|
|
1083
1083
|
/* @__PURE__ */ _("div", { className: "ll-expanded__bg", children: [
|
|
1084
1084
|
i ? /* @__PURE__ */ n(
|
|
1085
|
-
|
|
1085
|
+
er,
|
|
1086
1086
|
{
|
|
1087
1087
|
src: i,
|
|
1088
1088
|
alt: r,
|
|
1089
1089
|
className: "ll-expanded__bg-img"
|
|
1090
1090
|
}
|
|
1091
|
-
) : /* @__PURE__ */ n("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ n("span", { className: "ll-expanded__bg-initial", children: ((
|
|
1091
|
+
) : /* @__PURE__ */ n("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ n("span", { className: "ll-expanded__bg-initial", children: ((De = r == null ? void 0 : r.charAt(0)) == null ? void 0 : De.toUpperCase()) || "A" }) }),
|
|
1092
1092
|
o && !X && /* @__PURE__ */ n(
|
|
1093
1093
|
"video",
|
|
1094
1094
|
{
|
|
@@ -1102,7 +1102,7 @@ const Zn = ({
|
|
|
1102
1102
|
)
|
|
1103
1103
|
] }),
|
|
1104
1104
|
/* @__PURE__ */ n("div", { ref: tt, className: "ll-expanded__video" }),
|
|
1105
|
-
|
|
1105
|
+
Be && /* @__PURE__ */ _("div", { className: "ll-expanded__overlay ll-expanded__overlay--connecting", children: [
|
|
1106
1106
|
/* @__PURE__ */ n("div", { className: "ll-expanded__spinner" }),
|
|
1107
1107
|
/* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children: y ? "Switching..." : "Connecting..." })
|
|
1108
1108
|
] }),
|
|
@@ -1111,14 +1111,14 @@ const Zn = ({
|
|
|
1111
1111
|
{
|
|
1112
1112
|
type: "button",
|
|
1113
1113
|
className: "ll-expanded__overlay ll-expanded__overlay--gesture",
|
|
1114
|
-
onClick:
|
|
1114
|
+
onClick: Ee,
|
|
1115
1115
|
children: [
|
|
1116
1116
|
/* @__PURE__ */ n("svg", { width: "32", height: "32", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": !0, children: /* @__PURE__ */ n("path", { d: "M3 9v6h4l5 5V4L7 9H3zm13.54.12a5 5 0 0 1 0 5.76l-1.41-1.41a3 3 0 0 0 0-2.94L16.54 9.12z" }) }),
|
|
1117
1117
|
/* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children: "Tap to enable audio" })
|
|
1118
1118
|
]
|
|
1119
1119
|
}
|
|
1120
1120
|
),
|
|
1121
|
-
|
|
1121
|
+
Me ? /* @__PURE__ */ _("div", { className: "ll-expanded__topbar", children: [
|
|
1122
1122
|
/* @__PURE__ */ _("div", { className: "ll-expanded__topbar-left", children: [
|
|
1123
1123
|
/* @__PURE__ */ _("div", { className: "ll-expanded__pill-wrap", children: [
|
|
1124
1124
|
/* @__PURE__ */ _(
|
|
@@ -1133,7 +1133,7 @@ const Zn = ({
|
|
|
1133
1133
|
"aria-expanded": _e ? b : void 0,
|
|
1134
1134
|
children: [
|
|
1135
1135
|
/* @__PURE__ */ n("span", { className: "ll-hpill__label", children: r }),
|
|
1136
|
-
_e && /* @__PURE__ */ n(
|
|
1136
|
+
_e && /* @__PURE__ */ n(lt, {})
|
|
1137
1137
|
]
|
|
1138
1138
|
}
|
|
1139
1139
|
),
|
|
@@ -1176,7 +1176,7 @@ const Zn = ({
|
|
|
1176
1176
|
type: "button",
|
|
1177
1177
|
className: "ll-hpill ll-hpill--compact",
|
|
1178
1178
|
onClick: (p) => {
|
|
1179
|
-
p.stopPropagation(),
|
|
1179
|
+
p.stopPropagation(), E();
|
|
1180
1180
|
},
|
|
1181
1181
|
"aria-haspopup": "listbox",
|
|
1182
1182
|
"aria-expanded": x,
|
|
@@ -1184,7 +1184,7 @@ const Zn = ({
|
|
|
1184
1184
|
title: "Language: English",
|
|
1185
1185
|
children: [
|
|
1186
1186
|
/* @__PURE__ */ n("span", { className: "ll-hpill__label", children: "EN" }),
|
|
1187
|
-
/* @__PURE__ */ n(
|
|
1187
|
+
/* @__PURE__ */ n(lt, {})
|
|
1188
1188
|
]
|
|
1189
1189
|
}
|
|
1190
1190
|
),
|
|
@@ -1224,7 +1224,7 @@ const Zn = ({
|
|
|
1224
1224
|
onClick: ue,
|
|
1225
1225
|
"aria-label": "Minimize widget",
|
|
1226
1226
|
title: "Minimize",
|
|
1227
|
-
children: /* @__PURE__ */ n(
|
|
1227
|
+
children: /* @__PURE__ */ n(Yt, {})
|
|
1228
1228
|
}
|
|
1229
1229
|
),
|
|
1230
1230
|
/* @__PURE__ */ n(
|
|
@@ -1232,17 +1232,17 @@ const Zn = ({
|
|
|
1232
1232
|
{
|
|
1233
1233
|
type: "button",
|
|
1234
1234
|
className: "ll-hbtn ll-hbtn--danger",
|
|
1235
|
-
onClick:
|
|
1235
|
+
onClick: Re,
|
|
1236
1236
|
"aria-label": "End call",
|
|
1237
1237
|
title: "End call",
|
|
1238
|
-
children: /* @__PURE__ */ n(
|
|
1238
|
+
children: /* @__PURE__ */ n(Vt, {})
|
|
1239
1239
|
}
|
|
1240
1240
|
)
|
|
1241
1241
|
] })
|
|
1242
1242
|
] }) : (
|
|
1243
1243
|
// Idle-state header with Live Layer product name + minimize/close
|
|
1244
1244
|
/* @__PURE__ */ _("div", { className: "ll-expanded__header ll-expanded__header--idle", children: [
|
|
1245
|
-
/* @__PURE__ */ n("span", { className: "ll-expanded__brand", children:
|
|
1245
|
+
/* @__PURE__ */ n("span", { className: "ll-expanded__brand", children: Ue }),
|
|
1246
1246
|
/* @__PURE__ */ _("div", { className: "ll-expanded__header-actions", children: [
|
|
1247
1247
|
/* @__PURE__ */ n(
|
|
1248
1248
|
"button",
|
|
@@ -1251,7 +1251,7 @@ const Zn = ({
|
|
|
1251
1251
|
className: "ll-hbtn ll-hbtn--ghost",
|
|
1252
1252
|
onClick: ue,
|
|
1253
1253
|
"aria-label": "Minimize widget",
|
|
1254
|
-
children: /* @__PURE__ */ n(
|
|
1254
|
+
children: /* @__PURE__ */ n(Yt, {})
|
|
1255
1255
|
}
|
|
1256
1256
|
),
|
|
1257
1257
|
/* @__PURE__ */ n(
|
|
@@ -1259,17 +1259,17 @@ const Zn = ({
|
|
|
1259
1259
|
{
|
|
1260
1260
|
type: "button",
|
|
1261
1261
|
className: "ll-hbtn ll-hbtn--danger",
|
|
1262
|
-
onClick:
|
|
1262
|
+
onClick: Re,
|
|
1263
1263
|
"aria-label": "Close widget",
|
|
1264
|
-
children: /* @__PURE__ */ n(
|
|
1264
|
+
children: /* @__PURE__ */ n(Vt, {})
|
|
1265
1265
|
}
|
|
1266
1266
|
)
|
|
1267
1267
|
] })
|
|
1268
1268
|
] })
|
|
1269
1269
|
),
|
|
1270
|
-
|
|
1270
|
+
ee && /* @__PURE__ */ (() => {
|
|
1271
1271
|
const p = O ? "Restart paused session" : C === "disconnected" ? "Reconnect to agent" : "Start video call", Y = O ? "Pick up where you left off" : null;
|
|
1272
|
-
return /* @__PURE__ */ _(
|
|
1272
|
+
return /* @__PURE__ */ _(wt, { children: [
|
|
1273
1273
|
C === "idle" && !O && !q && /* @__PURE__ */ _(
|
|
1274
1274
|
"button",
|
|
1275
1275
|
{
|
|
@@ -1302,7 +1302,7 @@ const Zn = ({
|
|
|
1302
1302
|
/* @__PURE__ */ _(
|
|
1303
1303
|
"div",
|
|
1304
1304
|
{
|
|
1305
|
-
className: `ll-expanded__pip ${
|
|
1305
|
+
className: `ll-expanded__pip ${Me && (z || G) ? "is-visible" : ""}`,
|
|
1306
1306
|
children: [
|
|
1307
1307
|
/* @__PURE__ */ n(
|
|
1308
1308
|
"div",
|
|
@@ -1314,20 +1314,20 @@ const Zn = ({
|
|
|
1314
1314
|
/* @__PURE__ */ n(
|
|
1315
1315
|
"div",
|
|
1316
1316
|
{
|
|
1317
|
-
ref:
|
|
1317
|
+
ref: te,
|
|
1318
1318
|
className: !G && z ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
|
|
1319
1319
|
}
|
|
1320
1320
|
)
|
|
1321
1321
|
]
|
|
1322
1322
|
}
|
|
1323
1323
|
),
|
|
1324
|
-
|
|
1325
|
-
|
|
1324
|
+
Me ? /* @__PURE__ */ _("div", { className: "ll-expanded__bottom", children: [
|
|
1325
|
+
Pe && /* @__PURE__ */ n(
|
|
1326
1326
|
"div",
|
|
1327
1327
|
{
|
|
1328
1328
|
className: "ll-expanded__transcript ll-expanded__transcript--agent",
|
|
1329
1329
|
"data-role": "agent",
|
|
1330
|
-
children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children:
|
|
1330
|
+
children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: Pe })
|
|
1331
1331
|
}
|
|
1332
1332
|
),
|
|
1333
1333
|
rt && /* @__PURE__ */ n(
|
|
@@ -1344,10 +1344,10 @@ const Zn = ({
|
|
|
1344
1344
|
{
|
|
1345
1345
|
type: "button",
|
|
1346
1346
|
className: `ll-tool ${G ? "is-on" : ""}`,
|
|
1347
|
-
onClick:
|
|
1347
|
+
onClick: ut,
|
|
1348
1348
|
"aria-label": G ? "Stop sharing screen" : "Share screen",
|
|
1349
1349
|
title: G ? "Stop sharing" : "Share screen",
|
|
1350
|
-
children: /* @__PURE__ */ n(
|
|
1350
|
+
children: /* @__PURE__ */ n(nr, {})
|
|
1351
1351
|
}
|
|
1352
1352
|
),
|
|
1353
1353
|
Qe && /* @__PURE__ */ _("div", { className: "ll-tool-split", children: [
|
|
@@ -1356,10 +1356,10 @@ const Zn = ({
|
|
|
1356
1356
|
{
|
|
1357
1357
|
type: "button",
|
|
1358
1358
|
className: `ll-tool ll-tool--left ${z ? "is-on" : ""}`,
|
|
1359
|
-
onClick:
|
|
1359
|
+
onClick: Ae,
|
|
1360
1360
|
"aria-label": z ? "Turn off camera" : "Turn on camera",
|
|
1361
1361
|
title: z ? "Stop camera" : "Start camera",
|
|
1362
|
-
children: /* @__PURE__ */ n(
|
|
1362
|
+
children: /* @__PURE__ */ n(rr, {})
|
|
1363
1363
|
}
|
|
1364
1364
|
),
|
|
1365
1365
|
/* @__PURE__ */ n(
|
|
@@ -1372,12 +1372,12 @@ const Zn = ({
|
|
|
1372
1372
|
},
|
|
1373
1373
|
"aria-label": "Camera devices",
|
|
1374
1374
|
"aria-haspopup": "listbox",
|
|
1375
|
-
"aria-expanded":
|
|
1376
|
-
children: /* @__PURE__ */ n(
|
|
1375
|
+
"aria-expanded": Te,
|
|
1376
|
+
children: /* @__PURE__ */ n(lt, {})
|
|
1377
1377
|
}
|
|
1378
1378
|
),
|
|
1379
|
-
|
|
1380
|
-
|
|
1379
|
+
Te && B.length > 0 && /* @__PURE__ */ n(
|
|
1380
|
+
Jt,
|
|
1381
1381
|
{
|
|
1382
1382
|
label: "Camera",
|
|
1383
1383
|
devices: B,
|
|
@@ -1398,11 +1398,11 @@ const Zn = ({
|
|
|
1398
1398
|
{
|
|
1399
1399
|
type: "button",
|
|
1400
1400
|
className: `ll-tool ll-tool--left ${m ? "is-muted" : ""}`,
|
|
1401
|
-
onClick:
|
|
1401
|
+
onClick: Ne,
|
|
1402
1402
|
disabled: !ce && X,
|
|
1403
1403
|
"aria-label": !ce && X ? "Microphone enables once the agent finishes its greeting" : m ? "Unmute microphone" : "Mute microphone",
|
|
1404
1404
|
title: !ce && X ? "Mic enables after greeting" : m ? "Unmute" : "Mute",
|
|
1405
|
-
children: /* @__PURE__ */ n(
|
|
1405
|
+
children: /* @__PURE__ */ n(ir, { muted: m })
|
|
1406
1406
|
}
|
|
1407
1407
|
),
|
|
1408
1408
|
/* @__PURE__ */ n(
|
|
@@ -1416,11 +1416,11 @@ const Zn = ({
|
|
|
1416
1416
|
"aria-label": "Microphone devices",
|
|
1417
1417
|
"aria-haspopup": "listbox",
|
|
1418
1418
|
"aria-expanded": ae,
|
|
1419
|
-
children: /* @__PURE__ */ n(
|
|
1419
|
+
children: /* @__PURE__ */ n(lt, {})
|
|
1420
1420
|
}
|
|
1421
1421
|
),
|
|
1422
1422
|
ae && W.length > 0 && /* @__PURE__ */ n(
|
|
1423
|
-
|
|
1423
|
+
Jt,
|
|
1424
1424
|
{
|
|
1425
1425
|
label: "Microphone",
|
|
1426
1426
|
devices: W,
|
|
@@ -1436,10 +1436,10 @@ const Zn = ({
|
|
|
1436
1436
|
{
|
|
1437
1437
|
type: "button",
|
|
1438
1438
|
className: `ll-tool ${be ? "is-muted" : ""}`,
|
|
1439
|
-
onClick:
|
|
1439
|
+
onClick: ft,
|
|
1440
1440
|
"aria-label": be ? "Unmute speaker" : "Mute speaker",
|
|
1441
1441
|
title: be ? "Unmute speaker" : "Mute speaker",
|
|
1442
|
-
children: /* @__PURE__ */ n(
|
|
1442
|
+
children: /* @__PURE__ */ n(or, { muted: be })
|
|
1443
1443
|
}
|
|
1444
1444
|
),
|
|
1445
1445
|
/* @__PURE__ */ n(
|
|
@@ -1447,14 +1447,14 @@ const Zn = ({
|
|
|
1447
1447
|
{
|
|
1448
1448
|
type: "button",
|
|
1449
1449
|
className: "ll-tool ll-tool--danger",
|
|
1450
|
-
onClick:
|
|
1450
|
+
onClick: Se,
|
|
1451
1451
|
"aria-label": "End conversation",
|
|
1452
1452
|
title: "End conversation",
|
|
1453
|
-
children: /* @__PURE__ */ n(
|
|
1453
|
+
children: /* @__PURE__ */ n(ar, {})
|
|
1454
1454
|
}
|
|
1455
1455
|
)
|
|
1456
1456
|
] }),
|
|
1457
|
-
et && /* @__PURE__ */ _("form", { className: "ll-message-input", onSubmit:
|
|
1457
|
+
et && /* @__PURE__ */ _("form", { className: "ll-message-input", onSubmit: Fe, children: [
|
|
1458
1458
|
/* @__PURE__ */ n(
|
|
1459
1459
|
"input",
|
|
1460
1460
|
{
|
|
@@ -1462,7 +1462,7 @@ const Zn = ({
|
|
|
1462
1462
|
className: "ll-message-input__field",
|
|
1463
1463
|
placeholder: "Message...",
|
|
1464
1464
|
value: he,
|
|
1465
|
-
onChange: (p) =>
|
|
1465
|
+
onChange: (p) => We(p.target.value),
|
|
1466
1466
|
"aria-label": "Message the agent"
|
|
1467
1467
|
}
|
|
1468
1468
|
),
|
|
@@ -1472,7 +1472,7 @@ const Zn = ({
|
|
|
1472
1472
|
type: "submit",
|
|
1473
1473
|
className: "ll-message-input__send",
|
|
1474
1474
|
"aria-label": "Send message",
|
|
1475
|
-
children: /* @__PURE__ */ n(
|
|
1475
|
+
children: /* @__PURE__ */ n(lr, {})
|
|
1476
1476
|
}
|
|
1477
1477
|
)
|
|
1478
1478
|
] })
|
|
@@ -1486,7 +1486,7 @@ const Zn = ({
|
|
|
1486
1486
|
{
|
|
1487
1487
|
type: "button",
|
|
1488
1488
|
className: "ll-expanded__banner-x",
|
|
1489
|
-
onClick:
|
|
1489
|
+
onClick: qe,
|
|
1490
1490
|
"aria-label": "Dismiss",
|
|
1491
1491
|
children: "×"
|
|
1492
1492
|
}
|
|
@@ -1501,7 +1501,7 @@ const Zn = ({
|
|
|
1501
1501
|
{
|
|
1502
1502
|
type: "button",
|
|
1503
1503
|
className: "ll-expanded__banner-retry",
|
|
1504
|
-
onClick:
|
|
1504
|
+
onClick: Ce,
|
|
1505
1505
|
children: Y
|
|
1506
1506
|
}
|
|
1507
1507
|
)
|
|
@@ -1511,32 +1511,32 @@ const Zn = ({
|
|
|
1511
1511
|
}
|
|
1512
1512
|
);
|
|
1513
1513
|
};
|
|
1514
|
-
function
|
|
1514
|
+
function lt() {
|
|
1515
1515
|
return /* @__PURE__ */ n("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": !0, children: /* @__PURE__ */ n("polyline", { points: "6 9 12 15 18 9" }) });
|
|
1516
1516
|
}
|
|
1517
|
-
function
|
|
1517
|
+
function Vt() {
|
|
1518
1518
|
return /* @__PURE__ */ _("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": !0, children: [
|
|
1519
1519
|
/* @__PURE__ */ n("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
1520
1520
|
/* @__PURE__ */ n("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
1521
1521
|
] });
|
|
1522
1522
|
}
|
|
1523
|
-
function
|
|
1523
|
+
function Yt() {
|
|
1524
1524
|
return /* @__PURE__ */ n("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": !0, children: /* @__PURE__ */ n("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) });
|
|
1525
1525
|
}
|
|
1526
|
-
function
|
|
1526
|
+
function nr() {
|
|
1527
1527
|
return /* @__PURE__ */ _("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
|
|
1528
1528
|
/* @__PURE__ */ n("rect", { x: "2", y: "3", width: "20", height: "14", rx: "2" }),
|
|
1529
1529
|
/* @__PURE__ */ n("line", { x1: "8", y1: "21", x2: "16", y2: "21" }),
|
|
1530
1530
|
/* @__PURE__ */ n("line", { x1: "12", y1: "17", x2: "12", y2: "21" })
|
|
1531
1531
|
] });
|
|
1532
1532
|
}
|
|
1533
|
-
function
|
|
1533
|
+
function rr() {
|
|
1534
1534
|
return /* @__PURE__ */ _("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
|
|
1535
1535
|
/* @__PURE__ */ n("path", { d: "M23 7l-7 5 7 5V7z" }),
|
|
1536
1536
|
/* @__PURE__ */ n("rect", { x: "1", y: "5", width: "15", height: "14", rx: "2" })
|
|
1537
1537
|
] });
|
|
1538
1538
|
}
|
|
1539
|
-
function
|
|
1539
|
+
function ir({ muted: e }) {
|
|
1540
1540
|
return /* @__PURE__ */ _("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
|
|
1541
1541
|
/* @__PURE__ */ n("path", { d: "M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z" }),
|
|
1542
1542
|
/* @__PURE__ */ n("path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }),
|
|
@@ -1544,22 +1544,22 @@ function lr({ muted: e }) {
|
|
|
1544
1544
|
e && /* @__PURE__ */ n("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
|
|
1545
1545
|
] });
|
|
1546
1546
|
}
|
|
1547
|
-
function
|
|
1547
|
+
function or({ muted: e }) {
|
|
1548
1548
|
return /* @__PURE__ */ _("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
|
|
1549
1549
|
/* @__PURE__ */ n("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
|
|
1550
|
-
e ? /* @__PURE__ */ n("line", { x1: "23", y1: "9", x2: "17", y2: "15" }) : /* @__PURE__ */ _(
|
|
1550
|
+
e ? /* @__PURE__ */ n("line", { x1: "23", y1: "9", x2: "17", y2: "15" }) : /* @__PURE__ */ _(wt, { children: [
|
|
1551
1551
|
/* @__PURE__ */ n("path", { d: "M19.07 4.93a10 10 0 0 1 0 14.14" }),
|
|
1552
1552
|
/* @__PURE__ */ n("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" })
|
|
1553
1553
|
] })
|
|
1554
1554
|
] });
|
|
1555
1555
|
}
|
|
1556
|
-
function
|
|
1556
|
+
function lr() {
|
|
1557
1557
|
return /* @__PURE__ */ _("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
|
|
1558
1558
|
/* @__PURE__ */ n("line", { x1: "5", y1: "12", x2: "19", y2: "12" }),
|
|
1559
1559
|
/* @__PURE__ */ n("polyline", { points: "12 5 19 12 12 19" })
|
|
1560
1560
|
] });
|
|
1561
1561
|
}
|
|
1562
|
-
function
|
|
1562
|
+
function ar() {
|
|
1563
1563
|
return /* @__PURE__ */ n("svg", { width: "16", height: "16", viewBox: "-4 -4 32 32", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: /* @__PURE__ */ n(
|
|
1564
1564
|
"path",
|
|
1565
1565
|
{
|
|
@@ -1568,7 +1568,7 @@ function cr() {
|
|
|
1568
1568
|
}
|
|
1569
1569
|
) });
|
|
1570
1570
|
}
|
|
1571
|
-
const
|
|
1571
|
+
const Jt = ({ label: e, devices: t, activeId: r, onPick: i }) => /* @__PURE__ */ _(
|
|
1572
1572
|
"div",
|
|
1573
1573
|
{
|
|
1574
1574
|
className: "ll-device-menu",
|
|
@@ -1596,21 +1596,21 @@ const Xt = ({ label: e, devices: t, activeId: r, onPick: i }) => /* @__PURE__ */
|
|
|
1596
1596
|
})
|
|
1597
1597
|
]
|
|
1598
1598
|
}
|
|
1599
|
-
),
|
|
1599
|
+
), sr = [
|
|
1600
1600
|
'[data-ll-private="true"]',
|
|
1601
1601
|
".ll-widget"
|
|
1602
1602
|
];
|
|
1603
|
-
function
|
|
1603
|
+
function xt(e) {
|
|
1604
1604
|
let t = e;
|
|
1605
1605
|
for (; t; ) {
|
|
1606
|
-
for (const r of
|
|
1606
|
+
for (const r of sr)
|
|
1607
1607
|
if (t.matches(r)) return !0;
|
|
1608
1608
|
t = t.parentElement;
|
|
1609
1609
|
}
|
|
1610
1610
|
return !1;
|
|
1611
1611
|
}
|
|
1612
|
-
function
|
|
1613
|
-
if (
|
|
1612
|
+
function dt(e) {
|
|
1613
|
+
if (xt(e)) return !1;
|
|
1614
1614
|
if (e instanceof HTMLInputElement) {
|
|
1615
1615
|
if (e.type === "password") return !1;
|
|
1616
1616
|
const t = (e.getAttribute("autocomplete") || "").toLowerCase();
|
|
@@ -1618,7 +1618,7 @@ function ut(e) {
|
|
|
1618
1618
|
}
|
|
1619
1619
|
return !0;
|
|
1620
1620
|
}
|
|
1621
|
-
const
|
|
1621
|
+
const at = 4096, cr = 20, dr = 20, ur = 10, fr = 10, pr = 30, Kt = 500, hr = [
|
|
1622
1622
|
'[data-ll-private="true"]',
|
|
1623
1623
|
".ll-widget",
|
|
1624
1624
|
"script",
|
|
@@ -1630,7 +1630,7 @@ function Xe(e) {
|
|
|
1630
1630
|
if (e.getAttribute("aria-hidden") === "true" || e.hasAttribute("hidden")) return !0;
|
|
1631
1631
|
let t = e;
|
|
1632
1632
|
for (; t; ) {
|
|
1633
|
-
for (const r of
|
|
1633
|
+
for (const r of hr)
|
|
1634
1634
|
if (t.matches(r)) return !0;
|
|
1635
1635
|
t = t.parentElement;
|
|
1636
1636
|
}
|
|
@@ -1643,7 +1643,7 @@ function Ge(e) {
|
|
|
1643
1643
|
const r = window.innerHeight || document.documentElement.clientHeight, i = window.innerWidth || document.documentElement.clientWidth;
|
|
1644
1644
|
return t.bottom > 0 && t.right > 0 && t.top < r && t.left < i;
|
|
1645
1645
|
}
|
|
1646
|
-
function
|
|
1646
|
+
function Xt(e) {
|
|
1647
1647
|
const t = e.getAttribute("id");
|
|
1648
1648
|
if (t) {
|
|
1649
1649
|
const l = document.querySelector(`label[for="${CSS.escape(t)}"]`);
|
|
@@ -1656,13 +1656,13 @@ function Qt(e) {
|
|
|
1656
1656
|
const o = e.closest("label");
|
|
1657
1657
|
return o != null && o.textContent ? o.textContent.trim() : "";
|
|
1658
1658
|
}
|
|
1659
|
-
function
|
|
1659
|
+
function Le(e, t) {
|
|
1660
1660
|
return e.length <= t ? e : e.slice(0, t - 1) + "…";
|
|
1661
1661
|
}
|
|
1662
|
-
function
|
|
1662
|
+
function ze(e) {
|
|
1663
1663
|
return e.length;
|
|
1664
1664
|
}
|
|
1665
|
-
function
|
|
1665
|
+
function mr(e, t = {}) {
|
|
1666
1666
|
const r = t.doc ?? (typeof document < "u" ? document : null);
|
|
1667
1667
|
if (!r)
|
|
1668
1668
|
return {
|
|
@@ -1680,11 +1680,11 @@ function yr(e, t = {}) {
|
|
|
1680
1680
|
r.querySelectorAll("[data-ll-region]")
|
|
1681
1681
|
), u = [];
|
|
1682
1682
|
for (const m of c) {
|
|
1683
|
-
if (u.length >=
|
|
1683
|
+
if (u.length >= ur) break;
|
|
1684
1684
|
if (Xe(m) || !Ge(m)) continue;
|
|
1685
|
-
const R = m.getAttribute("data-ll-region") ?? "", W = m.getAttribute("data-ll-intent") ?? void 0, z =
|
|
1685
|
+
const R = m.getAttribute("data-ll-region") ?? "", W = m.getAttribute("data-ll-intent") ?? void 0, z = Le(
|
|
1686
1686
|
(m.innerText || m.textContent || "").trim(),
|
|
1687
|
-
|
|
1687
|
+
Kt * 2
|
|
1688
1688
|
);
|
|
1689
1689
|
!R || !z || u.push({ id: R, intent: W, text: z });
|
|
1690
1690
|
}
|
|
@@ -1694,21 +1694,21 @@ function yr(e, t = {}) {
|
|
|
1694
1694
|
for (const m of b) {
|
|
1695
1695
|
if (Xe(m) || !Ge(m)) continue;
|
|
1696
1696
|
const R = (m.textContent || "").trim();
|
|
1697
|
-
R && f.push(`${m.tagName}: ${
|
|
1697
|
+
R && f.push(`${m.tagName}: ${Le(R, 200)}`);
|
|
1698
1698
|
}
|
|
1699
1699
|
const s = Array.from(r.querySelectorAll("p, li"));
|
|
1700
1700
|
for (const m of s) {
|
|
1701
1701
|
if (Xe(m) || !Ge(m) || y.includes(m.tagName)) continue;
|
|
1702
1702
|
const R = (m.textContent || "").trim();
|
|
1703
|
-
R.length > 10 && f.push(
|
|
1703
|
+
R.length > 10 && f.push(Le(R, Kt));
|
|
1704
1704
|
}
|
|
1705
1705
|
const a = f.join(`
|
|
1706
|
-
`), x = [],
|
|
1707
|
-
for (const m of
|
|
1708
|
-
if (x.length >=
|
|
1706
|
+
`), x = [], E = Array.from(r.querySelectorAll("a[href]"));
|
|
1707
|
+
for (const m of E) {
|
|
1708
|
+
if (x.length >= cr) break;
|
|
1709
1709
|
if (Xe(m) || !Ge(m)) continue;
|
|
1710
1710
|
const R = m.getAttribute("href") || "", W = (m.textContent || "").trim();
|
|
1711
|
-
!R || !W || x.push({ href: R, text:
|
|
1711
|
+
!R || !W || x.push({ href: R, text: Le(W, 100) });
|
|
1712
1712
|
}
|
|
1713
1713
|
const C = [], v = Array.from(
|
|
1714
1714
|
r.querySelectorAll(
|
|
@@ -1716,17 +1716,17 @@ function yr(e, t = {}) {
|
|
|
1716
1716
|
)
|
|
1717
1717
|
);
|
|
1718
1718
|
for (const m of v) {
|
|
1719
|
-
if (C.length >=
|
|
1720
|
-
if (Xe(m) || !
|
|
1721
|
-
const R =
|
|
1722
|
-
R && C.push({ label:
|
|
1719
|
+
if (C.length >= dr) break;
|
|
1720
|
+
if (Xe(m) || !dt(m) || !Ge(m)) continue;
|
|
1721
|
+
const R = Xt(m), W = m instanceof HTMLInputElement ? m.type : m.tagName.toLowerCase();
|
|
1722
|
+
R && C.push({ label: Le(R, 100), type: W });
|
|
1723
1723
|
}
|
|
1724
1724
|
const w = Array.from(
|
|
1725
1725
|
r.querySelectorAll("[data-ll-form]")
|
|
1726
1726
|
), O = [];
|
|
1727
1727
|
for (const m of w) {
|
|
1728
|
-
if (O.length >=
|
|
1729
|
-
if (
|
|
1728
|
+
if (O.length >= fr) break;
|
|
1729
|
+
if (xt(m)) continue;
|
|
1730
1730
|
const R = m.getAttribute("data-ll-form") || "";
|
|
1731
1731
|
if (!R) continue;
|
|
1732
1732
|
const W = m.getAttribute("data-ll-intent") || void 0, z = Array.from(
|
|
@@ -1735,12 +1735,12 @@ function yr(e, t = {}) {
|
|
|
1735
1735
|
)
|
|
1736
1736
|
), M = [];
|
|
1737
1737
|
for (const B of z) {
|
|
1738
|
-
if (M.length >=
|
|
1739
|
-
if (!
|
|
1738
|
+
if (M.length >= pr) break;
|
|
1739
|
+
if (!dt(B)) continue;
|
|
1740
1740
|
const F = B.getAttribute("data-ll-field") || "";
|
|
1741
1741
|
if (!F) continue;
|
|
1742
|
-
const G =
|
|
1743
|
-
M.push({ name: F, label:
|
|
1742
|
+
const G = Xt(B) || F, ie = B instanceof HTMLInputElement ? B.type : B.tagName.toLowerCase();
|
|
1743
|
+
M.push({ name: F, label: Le(G, 100), type: ie });
|
|
1744
1744
|
}
|
|
1745
1745
|
O.push({ id: R, intent: W, fields: M });
|
|
1746
1746
|
}
|
|
@@ -1755,26 +1755,26 @@ function yr(e, t = {}) {
|
|
|
1755
1755
|
forms: O,
|
|
1756
1756
|
extras: e
|
|
1757
1757
|
};
|
|
1758
|
-
let q =
|
|
1759
|
-
for (; q >
|
|
1760
|
-
I.visibleFields.pop(), q =
|
|
1761
|
-
for (; q >
|
|
1758
|
+
let q = ze(JSON.stringify(I.regions)) + ze(I.visibleText) + ze(JSON.stringify(I.visibleLinks)) + ze(JSON.stringify(I.visibleFields));
|
|
1759
|
+
for (; q > at && I.visibleFields.length > 0; )
|
|
1760
|
+
I.visibleFields.pop(), q = ze(JSON.stringify(I.visibleFields));
|
|
1761
|
+
for (; q > at && I.visibleLinks.length > 0; )
|
|
1762
1762
|
I.visibleLinks.pop(), q -= 80;
|
|
1763
|
-
return
|
|
1763
|
+
return ze(I.visibleText) > at && (I.visibleText = Le(I.visibleText, at - 100)), I;
|
|
1764
1764
|
}
|
|
1765
|
-
let
|
|
1766
|
-
function
|
|
1765
|
+
let He = null;
|
|
1766
|
+
function Gt(e, t = {}) {
|
|
1767
1767
|
const r = Date.now(), o = `${typeof window < "u" && window.location.pathname || "/"}::${typeof window < "u" ? window.scrollY : 0}`;
|
|
1768
|
-
if (
|
|
1769
|
-
return
|
|
1770
|
-
const l =
|
|
1771
|
-
return
|
|
1768
|
+
if (He && He.key === o && r - He.at < 1e3)
|
|
1769
|
+
return He.ctx;
|
|
1770
|
+
const l = mr(e, t);
|
|
1771
|
+
return He = { key: o, at: r, ctx: l }, l;
|
|
1772
1772
|
}
|
|
1773
|
-
function
|
|
1774
|
-
|
|
1773
|
+
function gr() {
|
|
1774
|
+
He = null;
|
|
1775
1775
|
}
|
|
1776
|
-
const
|
|
1777
|
-
function
|
|
1776
|
+
const yr = 200;
|
|
1777
|
+
function vr(e) {
|
|
1778
1778
|
const t = String(e.href || "");
|
|
1779
1779
|
return {
|
|
1780
1780
|
href: t,
|
|
@@ -1784,18 +1784,18 @@ function wr(e) {
|
|
|
1784
1784
|
description: e.description
|
|
1785
1785
|
};
|
|
1786
1786
|
}
|
|
1787
|
-
function
|
|
1787
|
+
function br(e) {
|
|
1788
1788
|
return !(!e || e.startsWith("#") || e.startsWith("javascript:") || e.startsWith("mailto:") || e.startsWith("tel:"));
|
|
1789
1789
|
}
|
|
1790
|
-
function
|
|
1790
|
+
function wr(e) {
|
|
1791
1791
|
const t = e ?? (typeof document < "u" ? document : null);
|
|
1792
1792
|
if (!t) return [];
|
|
1793
1793
|
const r = typeof window < "u" && window.location.origin || "", i = /* @__PURE__ */ new Set(), o = [], l = Array.from(t.querySelectorAll("a[href]"));
|
|
1794
1794
|
for (const c of l) {
|
|
1795
|
-
if (o.length >=
|
|
1796
|
-
if (
|
|
1795
|
+
if (o.length >= yr) break;
|
|
1796
|
+
if (xt(c)) continue;
|
|
1797
1797
|
const u = c.getAttribute("href") || "";
|
|
1798
|
-
if (!
|
|
1798
|
+
if (!br(u)) continue;
|
|
1799
1799
|
let f = u, y = !0;
|
|
1800
1800
|
try {
|
|
1801
1801
|
if (typeof window < "u") {
|
|
@@ -1812,23 +1812,23 @@ function xr(e) {
|
|
|
1812
1812
|
}
|
|
1813
1813
|
return o;
|
|
1814
1814
|
}
|
|
1815
|
-
let
|
|
1816
|
-
const
|
|
1817
|
-
function
|
|
1815
|
+
let Oe = null;
|
|
1816
|
+
const _r = 5e3;
|
|
1817
|
+
function vt() {
|
|
1818
1818
|
const e = Date.now(), t = typeof window < "u" && window.location.pathname || "/";
|
|
1819
|
-
if (
|
|
1820
|
-
return
|
|
1821
|
-
const r =
|
|
1822
|
-
return
|
|
1819
|
+
if (Oe && Oe.pathname === t && e - Oe.at < _r)
|
|
1820
|
+
return Oe.routes;
|
|
1821
|
+
const r = wr();
|
|
1822
|
+
return Oe = { at: e, pathname: t, routes: r }, r;
|
|
1823
1823
|
}
|
|
1824
|
-
function
|
|
1825
|
-
|
|
1824
|
+
function xr() {
|
|
1825
|
+
Oe = null;
|
|
1826
1826
|
}
|
|
1827
|
-
function
|
|
1827
|
+
function kr(e, t) {
|
|
1828
1828
|
const r = e instanceof HTMLInputElement ? HTMLInputElement.prototype : e instanceof HTMLTextAreaElement ? HTMLTextAreaElement.prototype : HTMLSelectElement.prototype, i = Object.getOwnPropertyDescriptor(r, "value"), o = i == null ? void 0 : i.set;
|
|
1829
1829
|
o ? o.call(e, t) : e.value = t;
|
|
1830
1830
|
}
|
|
1831
|
-
function
|
|
1831
|
+
function Lr(e, t, r = {}) {
|
|
1832
1832
|
const i = r.triggerInput ?? !0, o = r.triggerChange ?? !0;
|
|
1833
1833
|
if (e instanceof HTMLInputElement && (e.type === "checkbox" || e.type === "radio")) {
|
|
1834
1834
|
const l = Object.getOwnPropertyDescriptor(
|
|
@@ -1838,9 +1838,9 @@ function Cr(e, t, r = {}) {
|
|
|
1838
1838
|
c ? c.call(e, u) : e.checked = u, i && e.dispatchEvent(new Event("input", { bubbles: !0 })), o && e.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
1839
1839
|
return;
|
|
1840
1840
|
}
|
|
1841
|
-
|
|
1841
|
+
kr(e, t), i && e.dispatchEvent(new Event("input", { bubbles: !0 })), o && e.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
1842
1842
|
}
|
|
1843
|
-
function
|
|
1843
|
+
function Sr() {
|
|
1844
1844
|
if (typeof window > "u" || typeof document > "u")
|
|
1845
1845
|
return !1;
|
|
1846
1846
|
const e = document.scrollingElement || document.documentElement;
|
|
@@ -1848,19 +1848,19 @@ function Er() {
|
|
|
1848
1848
|
const t = window.getComputedStyle(e);
|
|
1849
1849
|
return !(t.overflowY === "hidden" || t.overflowY === "clip");
|
|
1850
1850
|
}
|
|
1851
|
-
function
|
|
1851
|
+
function Cr(e) {
|
|
1852
1852
|
if (!(e instanceof HTMLElement)) return !1;
|
|
1853
1853
|
const r = window.getComputedStyle(e).overflowY;
|
|
1854
1854
|
return !(r !== "auto" && r !== "scroll" || e.scrollHeight <= e.clientHeight + 2);
|
|
1855
1855
|
}
|
|
1856
|
-
function
|
|
1856
|
+
function Er() {
|
|
1857
1857
|
if (typeof document > "u") return null;
|
|
1858
1858
|
const e = Array.from(
|
|
1859
1859
|
document.querySelectorAll("body, body *")
|
|
1860
1860
|
);
|
|
1861
1861
|
let t = null, r = 0;
|
|
1862
1862
|
for (const i of e) {
|
|
1863
|
-
if (!
|
|
1863
|
+
if (!Cr(i)) continue;
|
|
1864
1864
|
const o = i.getBoundingClientRect();
|
|
1865
1865
|
if (o.bottom <= 0 || o.top >= window.innerHeight || o.right <= 0 || o.left >= window.innerWidth || o.width <= 0 || o.height <= 0 || i.closest(".ll-widget")) continue;
|
|
1866
1866
|
const l = o.width * o.height;
|
|
@@ -1868,24 +1868,24 @@ function Ar() {
|
|
|
1868
1868
|
}
|
|
1869
1869
|
return t;
|
|
1870
1870
|
}
|
|
1871
|
-
function
|
|
1871
|
+
function Nr() {
|
|
1872
1872
|
if (typeof window > "u")
|
|
1873
1873
|
return null;
|
|
1874
|
-
if (
|
|
1875
|
-
const e =
|
|
1874
|
+
if (Sr()) return window;
|
|
1875
|
+
const e = Er();
|
|
1876
1876
|
return e || window;
|
|
1877
1877
|
}
|
|
1878
|
-
function
|
|
1878
|
+
function Qt(e) {
|
|
1879
1879
|
return e instanceof Window ? e.innerHeight || 0 : e.clientHeight || 0;
|
|
1880
1880
|
}
|
|
1881
|
-
function
|
|
1881
|
+
function Ar(e) {
|
|
1882
1882
|
var t, r;
|
|
1883
1883
|
return e instanceof Window ? typeof document > "u" ? 0 : Math.max(
|
|
1884
1884
|
((t = document.body) == null ? void 0 : t.scrollHeight) ?? 0,
|
|
1885
1885
|
((r = document.documentElement) == null ? void 0 : r.scrollHeight) ?? 0
|
|
1886
1886
|
) : e.scrollHeight - e.clientHeight;
|
|
1887
1887
|
}
|
|
1888
|
-
const
|
|
1888
|
+
const Rr = /* @__PURE__ */ new Set([
|
|
1889
1889
|
"agent_state",
|
|
1890
1890
|
"avatar_stream_ready",
|
|
1891
1891
|
"avatar_active",
|
|
@@ -1908,8 +1908,8 @@ const Ir = /* @__PURE__ */ new Set([
|
|
|
1908
1908
|
"submit_form",
|
|
1909
1909
|
"request_routes"
|
|
1910
1910
|
]);
|
|
1911
|
-
function
|
|
1912
|
-
var Rt, Mt, It, Tt, Pt
|
|
1911
|
+
function Mr(e) {
|
|
1912
|
+
var Nt, At, Rt, Mt, It, Tt, Pt;
|
|
1913
1913
|
const {
|
|
1914
1914
|
agentId: t,
|
|
1915
1915
|
apiKey: r,
|
|
@@ -1924,7 +1924,7 @@ function Tr(e) {
|
|
|
1924
1924
|
mobileBreakpoint: s = 640,
|
|
1925
1925
|
persistKey: a = "ll-widget",
|
|
1926
1926
|
disablePersistence: x = !1,
|
|
1927
|
-
teamMembers:
|
|
1927
|
+
teamMembers: E,
|
|
1928
1928
|
currentTeamMemberId: C,
|
|
1929
1929
|
onTeamMemberChange: v,
|
|
1930
1930
|
idleLoopUrl: w,
|
|
@@ -1948,35 +1948,35 @@ function Tr(e) {
|
|
|
1948
1948
|
capabilities: re,
|
|
1949
1949
|
onConnect: ce,
|
|
1950
1950
|
onDisconnect: we,
|
|
1951
|
-
onTranscript:
|
|
1952
|
-
onAgentState:
|
|
1953
|
-
onConnectionStateChange:
|
|
1954
|
-
onAgentEvent:
|
|
1955
|
-
onAgentCommand:
|
|
1951
|
+
onTranscript: Se,
|
|
1952
|
+
onAgentState: Ce,
|
|
1953
|
+
onConnectionStateChange: Ee,
|
|
1954
|
+
onAgentEvent: Ne,
|
|
1955
|
+
onAgentCommand: Ae,
|
|
1956
1956
|
controlledSession: V,
|
|
1957
|
-
className:
|
|
1958
|
-
style:
|
|
1957
|
+
className: ut,
|
|
1958
|
+
style: ft,
|
|
1959
1959
|
zIndex: nt = 2147483647
|
|
1960
|
-
} = e, ue =
|
|
1961
|
-
|
|
1962
|
-
|
|
1960
|
+
} = e, ue = Hn(F), Re = jn(ue, M, B);
|
|
1961
|
+
N(() => {
|
|
1962
|
+
gr(), xr();
|
|
1963
1963
|
}, [ue]);
|
|
1964
|
-
const
|
|
1964
|
+
const qe = C !== void 0, [_e, Me] = L(() => {
|
|
1965
1965
|
var h;
|
|
1966
|
-
return C ?? ((h =
|
|
1967
|
-
}), X =
|
|
1968
|
-
() => (
|
|
1969
|
-
[
|
|
1970
|
-
),
|
|
1966
|
+
return C ?? ((h = E == null ? void 0 : E[0]) == null ? void 0 : h.id);
|
|
1967
|
+
}), X = qe ? C : _e, ee = st(
|
|
1968
|
+
() => (E == null ? void 0 : E.find((h) => h.id === X)) ?? null,
|
|
1969
|
+
[E, X]
|
|
1970
|
+
), Ie = (ee == null ? void 0 : ee.agentId) ?? t, [oe, de] = Pn({
|
|
1971
1971
|
value: u,
|
|
1972
1972
|
defaultValue: f,
|
|
1973
1973
|
onChange: y,
|
|
1974
1974
|
persistKey: a,
|
|
1975
1975
|
disablePersistence: x
|
|
1976
|
-
}), xe =
|
|
1977
|
-
|
|
1976
|
+
}), xe = $n(s), Be = xn(), te = kn(), le = Sn(), ae = Cn(), fe = En(), [Te, pe] = L(!1), [he, We] = L(!1), [Fe, Ue] = L(!1), [me, ge] = L(!1), [Pe, rt] = L(!1), je = A(G), De = A(ie), p = A(et), Y = A(tt), pt = A(be), kt = A(Qe), Lt = A(Ze), ht = A(re), ne = A(null);
|
|
1977
|
+
je.current = G, De.current = ie, p.current = et, Y.current = tt, pt.current = be, kt.current = Qe, Lt.current = Ze, ht.current = re;
|
|
1978
1978
|
function ye(h) {
|
|
1979
|
-
const d =
|
|
1979
|
+
const d = ht.current;
|
|
1980
1980
|
return d ? d.includes(h) : !0;
|
|
1981
1981
|
}
|
|
1982
1982
|
function ve(h, d) {
|
|
@@ -1984,12 +1984,12 @@ function Tr(e) {
|
|
|
1984
1984
|
`[LiveLayer] Agent command "${h}" blocked — capability "${d}" not in allowlist. See https://livelayer.studio/docs/react/capabilities`
|
|
1985
1985
|
);
|
|
1986
1986
|
}
|
|
1987
|
-
const
|
|
1987
|
+
const Ve = k(
|
|
1988
1988
|
(h) => {
|
|
1989
|
-
var
|
|
1989
|
+
var Z, $e, ot, Dt, $t;
|
|
1990
1990
|
const d = h;
|
|
1991
1991
|
if (!(!d.type || typeof d.type != "string")) {
|
|
1992
|
-
if (
|
|
1992
|
+
if (Ne == null || Ne({ eventName: d.type, data: h }), d.type === "navigate") {
|
|
1993
1993
|
if (!ye("navigate")) {
|
|
1994
1994
|
ve("navigate", "navigate");
|
|
1995
1995
|
return;
|
|
@@ -2001,9 +2001,9 @@ function Tr(e) {
|
|
|
2001
2001
|
);
|
|
2002
2002
|
return;
|
|
2003
2003
|
}
|
|
2004
|
-
if (
|
|
2004
|
+
if (je.current) {
|
|
2005
2005
|
try {
|
|
2006
|
-
|
|
2006
|
+
je.current(S);
|
|
2007
2007
|
} catch (P) {
|
|
2008
2008
|
console.warn(
|
|
2009
2009
|
`[LiveLayer] onNavigate threw for "${S}". Falling back. Error:`,
|
|
@@ -2040,9 +2040,9 @@ function Tr(e) {
|
|
|
2040
2040
|
const S = typeof d.selector == "string" ? d.selector : null;
|
|
2041
2041
|
if (!S) return;
|
|
2042
2042
|
const P = d.behavior === "instant" ? "instant" : "smooth";
|
|
2043
|
-
if (
|
|
2043
|
+
if (De.current) {
|
|
2044
2044
|
try {
|
|
2045
|
-
|
|
2045
|
+
De.current(
|
|
2046
2046
|
S,
|
|
2047
2047
|
P
|
|
2048
2048
|
);
|
|
@@ -2079,7 +2079,7 @@ function Tr(e) {
|
|
|
2079
2079
|
ve("request_page_context", "read_page");
|
|
2080
2080
|
return;
|
|
2081
2081
|
}
|
|
2082
|
-
const S = typeof d.requestId == "string" ? d.requestId : void 0, P = (
|
|
2082
|
+
const S = typeof d.requestId == "string" ? d.requestId : void 0, P = (Z = ne.current) == null ? void 0 : Z.call(ne), D = (K) => {
|
|
2083
2083
|
const T = P, U = T == null ? void 0 : T.localParticipant;
|
|
2084
2084
|
if (U != null && U.publishData)
|
|
2085
2085
|
try {
|
|
@@ -2088,7 +2088,7 @@ function Tr(e) {
|
|
|
2088
2088
|
} catch (H) {
|
|
2089
2089
|
console.warn("[LiveLayer] publishData failed.", H);
|
|
2090
2090
|
}
|
|
2091
|
-
}, $ =
|
|
2091
|
+
}, $ = kt.current, J = pt.current;
|
|
2092
2092
|
try {
|
|
2093
2093
|
if (J) {
|
|
2094
2094
|
const K = J($);
|
|
@@ -2099,7 +2099,7 @@ function Tr(e) {
|
|
|
2099
2099
|
T
|
|
2100
2100
|
), D({
|
|
2101
2101
|
type: "page_context",
|
|
2102
|
-
context:
|
|
2102
|
+
context: Gt($)
|
|
2103
2103
|
});
|
|
2104
2104
|
});
|
|
2105
2105
|
return;
|
|
@@ -2109,7 +2109,7 @@ function Tr(e) {
|
|
|
2109
2109
|
}
|
|
2110
2110
|
D({
|
|
2111
2111
|
type: "page_context",
|
|
2112
|
-
context:
|
|
2112
|
+
context: Gt($)
|
|
2113
2113
|
});
|
|
2114
2114
|
} catch (K) {
|
|
2115
2115
|
console.warn(
|
|
@@ -2147,12 +2147,12 @@ function Tr(e) {
|
|
|
2147
2147
|
return;
|
|
2148
2148
|
}
|
|
2149
2149
|
if (typeof window > "u") return;
|
|
2150
|
-
const D = { behavior: P }, $ =
|
|
2150
|
+
const D = { behavior: P }, $ = Nr(), J = (T) => {
|
|
2151
2151
|
$ instanceof Window ? $.scrollBy({ top: T, ...D }) : $.scrollBy({ top: T, ...D });
|
|
2152
2152
|
}, K = (T) => {
|
|
2153
2153
|
$ instanceof Window ? $.scrollTo({ top: T, ...D }) : $.scrollTo({ top: T, ...D });
|
|
2154
2154
|
};
|
|
2155
|
-
S === "up" ? J(-
|
|
2155
|
+
S === "up" ? J(-Qt($)) : S === "down" ? J(Qt($)) : K(S === "top" ? 0 : Ar($));
|
|
2156
2156
|
return;
|
|
2157
2157
|
}
|
|
2158
2158
|
if (d.type === "click") {
|
|
@@ -2195,7 +2195,7 @@ function Tr(e) {
|
|
|
2195
2195
|
);
|
|
2196
2196
|
return;
|
|
2197
2197
|
}
|
|
2198
|
-
(
|
|
2198
|
+
($e = P.click) == null || $e.call(P);
|
|
2199
2199
|
return;
|
|
2200
2200
|
}
|
|
2201
2201
|
if (d.type === "fill_form" || d.type === "focus_field") {
|
|
@@ -2204,15 +2204,15 @@ function Tr(e) {
|
|
|
2204
2204
|
return;
|
|
2205
2205
|
}
|
|
2206
2206
|
if (typeof document > "u") return;
|
|
2207
|
-
const S = typeof d.requestId == "string" ? d.requestId : void 0, P = (
|
|
2207
|
+
const S = typeof d.requestId == "string" ? d.requestId : void 0, P = (ot = ne.current) == null ? void 0 : ot.call(ne), D = (H) => {
|
|
2208
2208
|
if (d.type !== "fill_form") return;
|
|
2209
2209
|
const Q = P, se = Q == null ? void 0 : Q.localParticipant;
|
|
2210
2210
|
if (se != null && se.publishData)
|
|
2211
2211
|
try {
|
|
2212
|
-
const
|
|
2213
|
-
se.publishData(
|
|
2214
|
-
} catch (
|
|
2215
|
-
console.warn("[LiveLayer] publishData failed.",
|
|
2212
|
+
const ke = S ? { ...H, requestId: S } : H, hn = new TextEncoder().encode(JSON.stringify(ke));
|
|
2213
|
+
se.publishData(hn, { reliable: !0 });
|
|
2214
|
+
} catch (ke) {
|
|
2215
|
+
console.warn("[LiveLayer] publishData failed.", ke);
|
|
2216
2216
|
}
|
|
2217
2217
|
}, $ = typeof d.formId == "string" ? d.formId : null;
|
|
2218
2218
|
if (!$) {
|
|
@@ -2257,7 +2257,7 @@ function Tr(e) {
|
|
|
2257
2257
|
);
|
|
2258
2258
|
return;
|
|
2259
2259
|
}
|
|
2260
|
-
if (!
|
|
2260
|
+
if (!dt(Q)) {
|
|
2261
2261
|
console.warn(
|
|
2262
2262
|
`[LiveLayer] focus_field: field "${H}" is privacy-protected and not focusable.`
|
|
2263
2263
|
);
|
|
@@ -2286,18 +2286,18 @@ function Tr(e) {
|
|
|
2286
2286
|
), U.push(H);
|
|
2287
2287
|
continue;
|
|
2288
2288
|
}
|
|
2289
|
-
if (!
|
|
2289
|
+
if (!dt(se)) {
|
|
2290
2290
|
console.warn(
|
|
2291
2291
|
`[LiveLayer] fill_form: field "${H}" is privacy-protected (password / cc-* / private). Skipping.`
|
|
2292
2292
|
), U.push(H);
|
|
2293
2293
|
continue;
|
|
2294
2294
|
}
|
|
2295
2295
|
try {
|
|
2296
|
-
|
|
2297
|
-
} catch (
|
|
2296
|
+
Lr(se, Q), T.push(H);
|
|
2297
|
+
} catch (ke) {
|
|
2298
2298
|
console.warn(
|
|
2299
2299
|
`[LiveLayer] fill_form: failed to set "${H}".`,
|
|
2300
|
-
|
|
2300
|
+
ke
|
|
2301
2301
|
), U.push(H);
|
|
2302
2302
|
}
|
|
2303
2303
|
}
|
|
@@ -2337,12 +2337,12 @@ function Tr(e) {
|
|
|
2337
2337
|
);
|
|
2338
2338
|
return;
|
|
2339
2339
|
}
|
|
2340
|
-
const D = typeof d.requestId == "string" ? d.requestId : void 0, $ = (
|
|
2340
|
+
const D = typeof d.requestId == "string" ? d.requestId : void 0, $ = (Dt = ne.current) == null ? void 0 : Dt.call(ne), J = (U) => {
|
|
2341
2341
|
const H = $, Q = H == null ? void 0 : H.localParticipant;
|
|
2342
2342
|
if (Q != null && Q.publishData)
|
|
2343
2343
|
try {
|
|
2344
|
-
const se = D ? { ...U, requestId: D } : U,
|
|
2345
|
-
Q.publishData(
|
|
2344
|
+
const se = D ? { ...U, requestId: D } : U, ke = new TextEncoder().encode(JSON.stringify(se));
|
|
2345
|
+
Q.publishData(ke, { reliable: !0 });
|
|
2346
2346
|
} catch {
|
|
2347
2347
|
}
|
|
2348
2348
|
};
|
|
@@ -2375,7 +2375,7 @@ function Tr(e) {
|
|
|
2375
2375
|
ve("request_routes", "read_page");
|
|
2376
2376
|
return;
|
|
2377
2377
|
}
|
|
2378
|
-
const S = typeof d.requestId == "string" ? d.requestId : void 0, D = (
|
|
2378
|
+
const S = typeof d.requestId == "string" ? d.requestId : void 0, D = ($t = ne.current) == null ? void 0 : $t.call(ne), $ = D == null ? void 0 : D.localParticipant;
|
|
2379
2379
|
if (!($ != null && $.publishData)) return;
|
|
2380
2380
|
const J = (T) => {
|
|
2381
2381
|
try {
|
|
@@ -2384,7 +2384,7 @@ function Tr(e) {
|
|
|
2384
2384
|
} catch (U) {
|
|
2385
2385
|
console.warn("[LiveLayer] request_routes: publishData failed.", U);
|
|
2386
2386
|
}
|
|
2387
|
-
}, K =
|
|
2387
|
+
}, K = Lt.current;
|
|
2388
2388
|
if (K) {
|
|
2389
2389
|
try {
|
|
2390
2390
|
const T = K(), U = (H) => {
|
|
@@ -2392,75 +2392,75 @@ function Tr(e) {
|
|
|
2392
2392
|
J([]);
|
|
2393
2393
|
return;
|
|
2394
2394
|
}
|
|
2395
|
-
J(H.map(
|
|
2395
|
+
J(H.map(vr).slice(0, 200));
|
|
2396
2396
|
};
|
|
2397
2397
|
T instanceof Promise ? T.then(U).catch((H) => {
|
|
2398
2398
|
console.warn(
|
|
2399
2399
|
"[LiveLayer] getRoutes rejected; falling back to DOM walker.",
|
|
2400
2400
|
H
|
|
2401
|
-
), J(
|
|
2401
|
+
), J(vt());
|
|
2402
2402
|
}) : U(T);
|
|
2403
2403
|
} catch (T) {
|
|
2404
2404
|
console.warn(
|
|
2405
2405
|
"[LiveLayer] getRoutes threw; falling back to DOM walker.",
|
|
2406
2406
|
T
|
|
2407
|
-
), J(
|
|
2407
|
+
), J(vt());
|
|
2408
2408
|
}
|
|
2409
2409
|
return;
|
|
2410
2410
|
}
|
|
2411
2411
|
try {
|
|
2412
|
-
J(
|
|
2412
|
+
J(vt());
|
|
2413
2413
|
} catch (T) {
|
|
2414
2414
|
console.warn("[LiveLayer] request_routes: extractRoutes threw.", T);
|
|
2415
2415
|
}
|
|
2416
2416
|
return;
|
|
2417
2417
|
}
|
|
2418
|
-
|
|
2418
|
+
Rr.has(d.type) || Ae == null || Ae(d);
|
|
2419
2419
|
}
|
|
2420
2420
|
},
|
|
2421
|
-
[
|
|
2422
|
-
), j =
|
|
2423
|
-
agentId: V ? "__controlled__" :
|
|
2421
|
+
[Ae, Ne]
|
|
2422
|
+
), j = _n({
|
|
2423
|
+
agentId: V ? "__controlled__" : Ie,
|
|
2424
2424
|
baseUrl: i,
|
|
2425
2425
|
apiKey: r,
|
|
2426
2426
|
sessionEndpoint: o,
|
|
2427
2427
|
sessionBody: l,
|
|
2428
|
-
onDataMessage: V ? void 0 :
|
|
2428
|
+
onDataMessage: V ? void 0 : Ve
|
|
2429
2429
|
});
|
|
2430
|
-
|
|
2430
|
+
N(() => {
|
|
2431
2431
|
if (V != null && V.subscribeToDataMessages)
|
|
2432
|
-
return V.subscribeToDataMessages(
|
|
2433
|
-
}, [V,
|
|
2432
|
+
return V.subscribeToDataMessages(Ve);
|
|
2433
|
+
}, [V, Ve]), ne.current = () => {
|
|
2434
2434
|
var h;
|
|
2435
2435
|
return (h = j.getRoom) == null ? void 0 : h.call(j);
|
|
2436
|
-
},
|
|
2437
|
-
var
|
|
2436
|
+
}, N(() => {
|
|
2437
|
+
var Z;
|
|
2438
2438
|
if (!ue) return;
|
|
2439
|
-
const h = (
|
|
2439
|
+
const h = (Z = j.getRoom) == null ? void 0 : Z.call(j), d = h == null ? void 0 : h.localParticipant;
|
|
2440
2440
|
if (d != null && d.publishData)
|
|
2441
2441
|
try {
|
|
2442
|
-
const
|
|
2442
|
+
const $e = new TextEncoder().encode(
|
|
2443
2443
|
JSON.stringify({ type: "pathname", pathname: ue })
|
|
2444
2444
|
);
|
|
2445
|
-
d.publishData(
|
|
2445
|
+
d.publishData($e, { reliable: !0 });
|
|
2446
2446
|
} catch {
|
|
2447
2447
|
}
|
|
2448
|
-
}, [ue, j, j.connectionState]),
|
|
2449
|
-
var
|
|
2448
|
+
}, [ue, j, j.connectionState]), N(() => {
|
|
2449
|
+
var Z;
|
|
2450
2450
|
if (typeof window > "u") return;
|
|
2451
|
-
const h = ((
|
|
2451
|
+
const h = ((Z = window.location) == null ? void 0 : Z.hostname) || "";
|
|
2452
2452
|
if (h === "localhost" || h === "127.0.0.1" || h === "0.0.0.0" || h.endsWith(".local") || h.endsWith(".test"))
|
|
2453
|
-
return window.__livelayerSimulateCommand = (
|
|
2453
|
+
return window.__livelayerSimulateCommand = ($e) => {
|
|
2454
2454
|
try {
|
|
2455
|
-
|
|
2456
|
-
} catch (
|
|
2457
|
-
console.warn("[LiveLayer] simulate-command threw:",
|
|
2455
|
+
Ve($e);
|
|
2456
|
+
} catch (ot) {
|
|
2457
|
+
console.warn("[LiveLayer] simulate-command threw:", ot);
|
|
2458
2458
|
}
|
|
2459
2459
|
}, () => {
|
|
2460
2460
|
delete window.__livelayerSimulateCommand;
|
|
2461
2461
|
};
|
|
2462
|
-
}, [
|
|
2463
|
-
const g =
|
|
2462
|
+
}, [Ve]);
|
|
2463
|
+
const g = st(() => V ? {
|
|
2464
2464
|
connectionState: V.connectionState,
|
|
2465
2465
|
agentState: V.agentState,
|
|
2466
2466
|
transcript: V.transcript,
|
|
@@ -2491,180 +2491,174 @@ function Tr(e) {
|
|
|
2491
2491
|
disconnect: j.disconnect,
|
|
2492
2492
|
getRoom: j.getRoom,
|
|
2493
2493
|
isControlled: !1
|
|
2494
|
-
}, [V, j]),
|
|
2495
|
-
|
|
2496
|
-
const h = g.videoElement, d =
|
|
2494
|
+
}, [V, j]), St = A(null);
|
|
2495
|
+
N(() => {
|
|
2496
|
+
const h = g.videoElement, d = St.current;
|
|
2497
2497
|
if (!(!h || !d))
|
|
2498
2498
|
return d.appendChild(h), () => {
|
|
2499
2499
|
h.parentNode === d && d.removeChild(h);
|
|
2500
2500
|
};
|
|
2501
|
-
}, [g.videoElement]),
|
|
2501
|
+
}, [g.videoElement]), N(() => {
|
|
2502
2502
|
const h = g.audioElement;
|
|
2503
2503
|
if (!h) return;
|
|
2504
|
-
|
|
2504
|
+
Be.attach(h);
|
|
2505
2505
|
const d = h.play();
|
|
2506
|
-
return d && typeof d.catch == "function" && d.catch((
|
|
2507
|
-
(
|
|
2506
|
+
return d && typeof d.catch == "function" && d.catch((Z) => {
|
|
2507
|
+
(Z == null ? void 0 : Z.name) === "NotAllowedError" && pe(!0);
|
|
2508
2508
|
}), () => {
|
|
2509
|
-
|
|
2509
|
+
Be.detach();
|
|
2510
2510
|
};
|
|
2511
|
-
}, [g.audioElement]),
|
|
2511
|
+
}, [g.audioElement]), N(() => {
|
|
2512
2512
|
if (g.isControlled || g.connectionState !== "connected") return;
|
|
2513
2513
|
const h = g.getRoom();
|
|
2514
2514
|
if (h)
|
|
2515
|
-
return
|
|
2515
|
+
return te.setupMic(h, { startMuted: !0 }).catch(() => {
|
|
2516
2516
|
}), le.attachRoom(h), ae.attachRoom(h), fe.refresh(), () => {
|
|
2517
|
-
|
|
2517
|
+
te.teardownMic(), le.teardown(), ae.teardown();
|
|
2518
2518
|
};
|
|
2519
2519
|
}, [g.isControlled, g.connectionState]);
|
|
2520
|
-
const [
|
|
2521
|
-
|
|
2520
|
+
const [Ye, mt] = L(!1), gt = A("idle");
|
|
2521
|
+
N(() => {
|
|
2522
2522
|
if (g.connectionState === "idle" || g.connectionState === "disconnected") {
|
|
2523
|
-
|
|
2523
|
+
mt(!1), gt.current = "idle";
|
|
2524
2524
|
return;
|
|
2525
2525
|
}
|
|
2526
|
-
!
|
|
2527
|
-
}, [g.agentState, g.connectionState,
|
|
2528
|
-
if (g.connectionState !== "connected" ||
|
|
2526
|
+
!Ye && gt.current === "speaking" && g.agentState !== "speaking" && (mt(!0), te.setMuted(!1)), gt.current = g.agentState;
|
|
2527
|
+
}, [g.agentState, g.connectionState, Ye]), N(() => {
|
|
2528
|
+
if (g.connectionState !== "connected" || Ye) return;
|
|
2529
2529
|
const h = setTimeout(() => {
|
|
2530
|
-
|
|
2530
|
+
mt(!0), te.setMuted(!1);
|
|
2531
2531
|
}, 4e3);
|
|
2532
2532
|
return () => clearTimeout(h);
|
|
2533
|
-
}, [g.connectionState,
|
|
2534
|
-
const Et = E(!1), it = E(!1);
|
|
2535
|
-
A(() => {
|
|
2536
|
-
if (!ke) return;
|
|
2537
|
-
const h = g.agentState;
|
|
2538
|
-
!it.current && (h === "speaking" || h === "thinking") ? (Et.current = Z.isMuted, it.current = !0, Z.setMuted(!0)) : it.current && h === "listening" && (it.current = !1, Z.setMuted(Et.current));
|
|
2539
|
-
}, [g.agentState, ke]), A(() => {
|
|
2533
|
+
}, [g.connectionState, Ye]), N(() => {
|
|
2540
2534
|
const h = g.audioElement;
|
|
2541
|
-
h && (h.muted =
|
|
2542
|
-
}, [g.audioElement,
|
|
2543
|
-
const
|
|
2535
|
+
h && (h.muted = Pe);
|
|
2536
|
+
}, [g.audioElement, Pe]);
|
|
2537
|
+
const nn = k((h) => {
|
|
2544
2538
|
const d = g.getRoom();
|
|
2545
2539
|
if (d)
|
|
2546
2540
|
try {
|
|
2547
|
-
const
|
|
2541
|
+
const Z = new TextEncoder().encode(
|
|
2548
2542
|
JSON.stringify({ type: "user_message", text: h })
|
|
2549
2543
|
);
|
|
2550
|
-
d.localParticipant.publishData(
|
|
2544
|
+
d.localParticipant.publishData(Z, { reliable: !0 });
|
|
2551
2545
|
} catch {
|
|
2552
2546
|
}
|
|
2553
|
-
}, [g]),
|
|
2547
|
+
}, [g]), rn = k(() => {
|
|
2554
2548
|
rt((h) => !h);
|
|
2555
2549
|
}, []);
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
}, [g.connectionState, ce, we,
|
|
2559
|
-
|
|
2560
|
-
}, [g.transcript,
|
|
2561
|
-
|
|
2562
|
-
}, [g.agentState,
|
|
2563
|
-
const
|
|
2564
|
-
|
|
2565
|
-
g.isControlled || !c ||
|
|
2566
|
-
}, [c, g.connectionState, g,
|
|
2567
|
-
const
|
|
2550
|
+
N(() => {
|
|
2551
|
+
Ee == null || Ee(g.connectionState), g.connectionState === "connected" ? ce == null || ce() : g.connectionState === "disconnected" && (we == null || we());
|
|
2552
|
+
}, [g.connectionState, ce, we, Ee]), N(() => {
|
|
2553
|
+
Se == null || Se(g.transcript);
|
|
2554
|
+
}, [g.transcript, Se]), N(() => {
|
|
2555
|
+
Ce == null || Ce(g.agentState);
|
|
2556
|
+
}, [g.agentState, Ce]);
|
|
2557
|
+
const Ct = A(!1);
|
|
2558
|
+
N(() => {
|
|
2559
|
+
g.isControlled || !c || Ct.current || Re && g.connectionState === "idle" && (Ct.current = !0, g.connect());
|
|
2560
|
+
}, [c, g.connectionState, g, Re]);
|
|
2561
|
+
const on = k(
|
|
2568
2562
|
(h) => {
|
|
2569
|
-
const d =
|
|
2570
|
-
d && (
|
|
2563
|
+
const d = E == null ? void 0 : E.find((Z) => Z.id === h);
|
|
2564
|
+
d && (Ue(!1), h !== X && (We(!0), g.disconnect(), qe || Me(h), v == null || v(d)));
|
|
2571
2565
|
},
|
|
2572
2566
|
[
|
|
2573
|
-
|
|
2567
|
+
E,
|
|
2574
2568
|
X,
|
|
2575
2569
|
g,
|
|
2576
|
-
|
|
2570
|
+
qe,
|
|
2577
2571
|
v
|
|
2578
2572
|
]
|
|
2579
2573
|
);
|
|
2580
|
-
|
|
2581
|
-
he && g.connectionState === "connected" &&
|
|
2582
|
-
}, [g.connectionState, he]),
|
|
2583
|
-
if (!
|
|
2574
|
+
N(() => {
|
|
2575
|
+
he && g.connectionState === "connected" && We(!1);
|
|
2576
|
+
}, [g.connectionState, he]), N(() => {
|
|
2577
|
+
if (!Fe) return;
|
|
2584
2578
|
const h = (d) => {
|
|
2585
|
-
d.key === "Escape" &&
|
|
2579
|
+
d.key === "Escape" && Ue(!1);
|
|
2586
2580
|
};
|
|
2587
2581
|
return window.addEventListener("keydown", h), () => window.removeEventListener("keydown", h);
|
|
2588
|
-
}, [
|
|
2589
|
-
const
|
|
2590
|
-
re === void 0 && ((
|
|
2591
|
-
const
|
|
2582
|
+
}, [Fe]);
|
|
2583
|
+
const ln = !!I || !!(ee != null && ee.avatarImageUrl) || g.isControlled, Je = Nn(Ie, i, ln);
|
|
2584
|
+
re === void 0 && ((Nt = Je.info) != null && Nt.capabilities) && (ht.current = Je.info.capabilities);
|
|
2585
|
+
const it = (ee == null ? void 0 : ee.name) ?? q ?? ((At = g.agentConfig) == null ? void 0 : At.name) ?? ((Rt = Je.info) == null ? void 0 : Rt.name) ?? "Live Layer", yt = (ee == null ? void 0 : ee.avatarImageUrl) ?? I ?? ((Mt = g.agentConfig) == null ? void 0 : Mt.avatarImageUrl) ?? ((It = Je.info) == null ? void 0 : It.avatarImageUrl) ?? null, an = w ?? ((Tt = g.agentConfig) == null ? void 0 : Tt.idleLoopUrl) ?? ((Pt = Je.info) == null ? void 0 : Pt.idleLoopUrl) ?? null, sn = O ?? null, cn = k(() => de("expanded"), [de]), dn = k(
|
|
2592
2586
|
() => de("minimized"),
|
|
2593
2587
|
[de]
|
|
2594
|
-
),
|
|
2588
|
+
), Et = k(() => {
|
|
2595
2589
|
g.disconnect(), de("hidden");
|
|
2596
|
-
}, [g, de]),
|
|
2590
|
+
}, [g, de]), un = k(() => {
|
|
2597
2591
|
const h = g.audioElement;
|
|
2598
2592
|
h && h.play().then(() => pe(!1)).catch(() => {
|
|
2599
2593
|
});
|
|
2600
|
-
}, [g.audioElement]),
|
|
2594
|
+
}, [g.audioElement]), fn = k(() => {
|
|
2601
2595
|
pe(!1), g.connect();
|
|
2602
2596
|
}, [g]), Ke = {
|
|
2603
|
-
...
|
|
2597
|
+
...ft,
|
|
2604
2598
|
zIndex: nt
|
|
2605
2599
|
};
|
|
2606
2600
|
m.primaryColor && (Ke["--ll-color-primary"] = m.primaryColor), m.accentColor && (Ke["--ll-color-accent"] = m.accentColor), m.backgroundColor && (Ke["--ll-color-bg"] = m.backgroundColor), m.textColor && (Ke["--ll-color-fg"] = m.textColor);
|
|
2607
|
-
const
|
|
2601
|
+
const pn = [
|
|
2608
2602
|
"ll-widget",
|
|
2609
2603
|
`ll-widget--${oe}`,
|
|
2610
2604
|
`ll-widget--${xe ? "mobile" : "desktop"}`,
|
|
2611
|
-
|
|
2605
|
+
ut
|
|
2612
2606
|
].filter(Boolean).join(" ");
|
|
2613
|
-
return
|
|
2607
|
+
return Re ? /* @__PURE__ */ _(
|
|
2614
2608
|
"div",
|
|
2615
2609
|
{
|
|
2616
|
-
className:
|
|
2610
|
+
className: pn,
|
|
2617
2611
|
style: Ke,
|
|
2618
2612
|
"data-display-mode": oe,
|
|
2619
2613
|
"data-position": b,
|
|
2620
2614
|
children: [
|
|
2621
2615
|
oe === "hidden" && /* @__PURE__ */ n(
|
|
2622
|
-
|
|
2616
|
+
Gn,
|
|
2623
2617
|
{
|
|
2624
2618
|
position: b,
|
|
2625
2619
|
isMobile: xe,
|
|
2626
2620
|
isSpeaking: g.agentState === "speaking",
|
|
2627
2621
|
onExpand: () => de("expanded"),
|
|
2628
|
-
label: `Open ${
|
|
2629
|
-
avatarImageUrl:
|
|
2630
|
-
agentName:
|
|
2622
|
+
label: `Open ${it} widget`,
|
|
2623
|
+
avatarImageUrl: yt,
|
|
2624
|
+
agentName: it
|
|
2631
2625
|
}
|
|
2632
2626
|
),
|
|
2633
2627
|
oe === "minimized" && /* @__PURE__ */ n(
|
|
2634
|
-
|
|
2628
|
+
Zn,
|
|
2635
2629
|
{
|
|
2636
2630
|
position: b,
|
|
2637
2631
|
isMobile: xe,
|
|
2638
|
-
agentName:
|
|
2639
|
-
avatarImageUrl:
|
|
2632
|
+
agentName: it,
|
|
2633
|
+
avatarImageUrl: yt,
|
|
2640
2634
|
agentState: g.agentState,
|
|
2641
|
-
isMuted:
|
|
2642
|
-
audioLevel:
|
|
2643
|
-
onExpand:
|
|
2644
|
-
onToggleMute:
|
|
2645
|
-
onClose:
|
|
2635
|
+
isMuted: te.isMuted,
|
|
2636
|
+
audioLevel: Be,
|
|
2637
|
+
onExpand: cn,
|
|
2638
|
+
onToggleMute: te.toggleMute,
|
|
2639
|
+
onClose: Et
|
|
2646
2640
|
}
|
|
2647
2641
|
),
|
|
2648
2642
|
oe === "expanded" && /* @__PURE__ */ n(
|
|
2649
|
-
|
|
2643
|
+
tr,
|
|
2650
2644
|
{
|
|
2651
2645
|
position: b,
|
|
2652
2646
|
isMobile: xe,
|
|
2653
|
-
agentName:
|
|
2654
|
-
avatarImageUrl:
|
|
2655
|
-
idleLoopUrl:
|
|
2656
|
-
greeting:
|
|
2647
|
+
agentName: it,
|
|
2648
|
+
avatarImageUrl: yt,
|
|
2649
|
+
idleLoopUrl: an,
|
|
2650
|
+
greeting: sn,
|
|
2657
2651
|
branding: m,
|
|
2658
|
-
teamMembers:
|
|
2652
|
+
teamMembers: E,
|
|
2659
2653
|
currentTeamMemberId: X,
|
|
2660
2654
|
isSwitchingTeamMember: he,
|
|
2661
|
-
teamSwitcherOpen:
|
|
2662
|
-
onToggleTeamSwitcher: () =>
|
|
2663
|
-
onSelectTeamMember:
|
|
2655
|
+
teamSwitcherOpen: Fe,
|
|
2656
|
+
onToggleTeamSwitcher: () => Ue((h) => !h),
|
|
2657
|
+
onSelectTeamMember: on,
|
|
2664
2658
|
connectionState: g.connectionState,
|
|
2665
2659
|
agentState: g.agentState,
|
|
2666
2660
|
transcript: g.transcript,
|
|
2667
|
-
isMuted:
|
|
2661
|
+
isMuted: te.isMuted,
|
|
2668
2662
|
micDevices: fe.mics,
|
|
2669
2663
|
isCameraEnabled: le.isEnabled,
|
|
2670
2664
|
cameraPreviewEl: le.previewEl,
|
|
@@ -2672,42 +2666,42 @@ function Tr(e) {
|
|
|
2672
2666
|
activeCameraId: le.activeDeviceId,
|
|
2673
2667
|
isScreenShareEnabled: ae.isEnabled,
|
|
2674
2668
|
screenPreviewEl: ae.previewEl,
|
|
2675
|
-
isSpeakerMuted:
|
|
2669
|
+
isSpeakerMuted: Pe,
|
|
2676
2670
|
allowCamera: R,
|
|
2677
2671
|
allowScreenShare: W,
|
|
2678
2672
|
allowTyping: z,
|
|
2679
2673
|
languageMenuOpen: me,
|
|
2680
2674
|
onToggleLanguageMenu: () => ge((h) => !h),
|
|
2681
|
-
needsUserGesture:
|
|
2675
|
+
needsUserGesture: Te,
|
|
2682
2676
|
canResume: g.canResume,
|
|
2683
|
-
micError:
|
|
2677
|
+
micError: te.micError,
|
|
2684
2678
|
error: g.error,
|
|
2685
|
-
avatarVideoContainerRef:
|
|
2679
|
+
avatarVideoContainerRef: St,
|
|
2686
2680
|
agentVideoEl: g.videoElement,
|
|
2687
|
-
micGateOpen: g.isControlled ? !0 :
|
|
2681
|
+
micGateOpen: g.isControlled ? !0 : Ye,
|
|
2688
2682
|
onConnect: () => void g.connect(),
|
|
2689
2683
|
onDisconnect: () => g.disconnect(),
|
|
2690
|
-
onRetry:
|
|
2691
|
-
onResumeAudio:
|
|
2692
|
-
onToggleMute:
|
|
2684
|
+
onRetry: fn,
|
|
2685
|
+
onResumeAudio: un,
|
|
2686
|
+
onToggleMute: te.toggleMute,
|
|
2693
2687
|
onToggleCamera: () => void le.toggle(),
|
|
2694
2688
|
onSwitchCameraDevice: (h) => void le.switchDevice(h),
|
|
2695
2689
|
onToggleScreenShare: () => void ae.toggle(),
|
|
2696
|
-
onToggleSpeaker:
|
|
2697
|
-
onSendMessage:
|
|
2698
|
-
onMinimize:
|
|
2699
|
-
onClose:
|
|
2700
|
-
onClearMicError:
|
|
2690
|
+
onToggleSpeaker: rn,
|
|
2691
|
+
onSendMessage: nn,
|
|
2692
|
+
onMinimize: dn,
|
|
2693
|
+
onClose: Et,
|
|
2694
|
+
onClearMicError: te.clearError
|
|
2701
2695
|
}
|
|
2702
2696
|
)
|
|
2703
2697
|
]
|
|
2704
2698
|
}
|
|
2705
2699
|
) : null;
|
|
2706
2700
|
}
|
|
2707
|
-
function
|
|
2708
|
-
return /* @__PURE__ */ n(
|
|
2701
|
+
function Or(e) {
|
|
2702
|
+
return /* @__PURE__ */ n(wn, { children: /* @__PURE__ */ n(Mr, { ...e }) });
|
|
2709
2703
|
}
|
|
2710
|
-
const
|
|
2704
|
+
const qr = ({
|
|
2711
2705
|
agentId: e,
|
|
2712
2706
|
baseUrl: t,
|
|
2713
2707
|
apiKey: r,
|
|
@@ -2716,26 +2710,26 @@ const Wr = ({
|
|
|
2716
2710
|
className: l,
|
|
2717
2711
|
style: c
|
|
2718
2712
|
}) => {
|
|
2719
|
-
const u =
|
|
2713
|
+
const u = A(null), f = A(null), y = A(o);
|
|
2720
2714
|
y.current = o;
|
|
2721
2715
|
const b = k((s) => {
|
|
2722
2716
|
var x;
|
|
2723
2717
|
const a = s.detail;
|
|
2724
2718
|
(x = y.current) == null || x.call(y, a);
|
|
2725
2719
|
}, []);
|
|
2726
|
-
return
|
|
2720
|
+
return N(() => {
|
|
2727
2721
|
const s = u.current;
|
|
2728
2722
|
if (!s) return;
|
|
2729
2723
|
const a = document.createElement("livelayer-widget");
|
|
2730
2724
|
return a.setAttribute("agent-id", e), t && a.setAttribute("base-url", t), r && a.setAttribute("api-key", r), i && a.setAttribute("mode", i), a.addEventListener("agent-event", b), s.appendChild(a), f.current = a, () => {
|
|
2731
2725
|
a.removeEventListener("agent-event", b), s.removeChild(a), f.current = null;
|
|
2732
2726
|
};
|
|
2733
|
-
}, [e]),
|
|
2727
|
+
}, [e]), N(() => {
|
|
2734
2728
|
f.current && (i ? f.current.setAttribute("mode", i) : f.current.removeAttribute("mode"));
|
|
2735
2729
|
}, [i]), /* @__PURE__ */ n("div", { ref: u, className: l, style: c });
|
|
2736
|
-
},
|
|
2730
|
+
}, Br = _t(
|
|
2737
2731
|
function({ id: t, intent: r, as: i = "div", className: o, style: l, children: c }, u) {
|
|
2738
|
-
return
|
|
2732
|
+
return gn(
|
|
2739
2733
|
i,
|
|
2740
2734
|
{
|
|
2741
2735
|
ref: u,
|
|
@@ -2747,7 +2741,7 @@ const Wr = ({
|
|
|
2747
2741
|
c
|
|
2748
2742
|
);
|
|
2749
2743
|
}
|
|
2750
|
-
),
|
|
2744
|
+
), Wr = _t(
|
|
2751
2745
|
function({ id: t, intent: r, children: i, ...o }, l) {
|
|
2752
2746
|
return /* @__PURE__ */ n(
|
|
2753
2747
|
"form",
|
|
@@ -2760,7 +2754,7 @@ const Wr = ({
|
|
|
2760
2754
|
}
|
|
2761
2755
|
);
|
|
2762
2756
|
}
|
|
2763
|
-
),
|
|
2757
|
+
), Fr = _t(
|
|
2764
2758
|
function(t, r) {
|
|
2765
2759
|
const { name: i, label: o, labelClassName: l } = t, c = { name: i, "data-ll-field": i };
|
|
2766
2760
|
let u;
|
|
@@ -2802,30 +2796,30 @@ const Wr = ({
|
|
|
2802
2796
|
] });
|
|
2803
2797
|
}
|
|
2804
2798
|
);
|
|
2805
|
-
let
|
|
2806
|
-
function
|
|
2799
|
+
let Zt = 1;
|
|
2800
|
+
function Ur({
|
|
2807
2801
|
onMount: e,
|
|
2808
2802
|
defaultOpen: t = !1,
|
|
2809
2803
|
storageKey: r = "ll-debug-open"
|
|
2810
2804
|
}) {
|
|
2811
|
-
const [i, o] = L(t), [l, c] = L([]), [u, f] = L(""), [y, b] = L(!1), s =
|
|
2812
|
-
x.current = y,
|
|
2805
|
+
const [i, o] = L(t), [l, c] = L([]), [u, f] = L(""), [y, b] = L(!1), s = A(/* @__PURE__ */ new Set()), a = A([]), x = A(y);
|
|
2806
|
+
x.current = y, N(() => {
|
|
2813
2807
|
try {
|
|
2814
2808
|
const v = localStorage.getItem(r);
|
|
2815
2809
|
v === "1" && o(!0), v === "0" && o(!1);
|
|
2816
2810
|
} catch {
|
|
2817
2811
|
}
|
|
2818
|
-
}, [r]),
|
|
2812
|
+
}, [r]), N(() => {
|
|
2819
2813
|
try {
|
|
2820
2814
|
localStorage.setItem(r, i ? "1" : "0");
|
|
2821
2815
|
} catch {
|
|
2822
2816
|
}
|
|
2823
|
-
}, [i, r]),
|
|
2817
|
+
}, [i, r]), N(() => {
|
|
2824
2818
|
const v = (w) => {
|
|
2825
2819
|
(w.metaKey || w.ctrlKey) && w.shiftKey && w.key.toLowerCase() === "l" && (w.preventDefault(), o((O) => !O));
|
|
2826
2820
|
};
|
|
2827
2821
|
return window.addEventListener("keydown", v), () => window.removeEventListener("keydown", v);
|
|
2828
|
-
}, []),
|
|
2822
|
+
}, []), N(() => {
|
|
2829
2823
|
const v = setInterval(() => {
|
|
2830
2824
|
if (a.current.length === 0 || x.current) return;
|
|
2831
2825
|
const w = a.current.splice(0, a.current.length);
|
|
@@ -2835,27 +2829,27 @@ function Vr({
|
|
|
2835
2829
|
}, 100);
|
|
2836
2830
|
return () => clearInterval(v);
|
|
2837
2831
|
}, []);
|
|
2838
|
-
const
|
|
2839
|
-
if (
|
|
2840
|
-
!e ||
|
|
2832
|
+
const E = A(!1);
|
|
2833
|
+
if (N(() => {
|
|
2834
|
+
!e || E.current || (E.current = !0, e((v) => {
|
|
2841
2835
|
a.current.push({
|
|
2842
|
-
id:
|
|
2836
|
+
id: Zt++,
|
|
2843
2837
|
ts: Date.now(),
|
|
2844
2838
|
kind: "event",
|
|
2845
2839
|
type: v.eventName,
|
|
2846
2840
|
data: v.data
|
|
2847
2841
|
});
|
|
2848
2842
|
}));
|
|
2849
|
-
}, [e]),
|
|
2843
|
+
}, [e]), N(() => {
|
|
2850
2844
|
const v = console.warn, w = console.log, O = (I, q) => function(...m) {
|
|
2851
2845
|
try {
|
|
2852
2846
|
const R = typeof m[0] == "string" ? m[0] : "";
|
|
2853
2847
|
R.startsWith("[LiveLayer]") && a.current.push({
|
|
2854
|
-
id:
|
|
2848
|
+
id: Zt++,
|
|
2855
2849
|
ts: Date.now(),
|
|
2856
2850
|
kind: I,
|
|
2857
2851
|
type: R.slice(0, 120),
|
|
2858
|
-
data: { args: m.slice(1).map((W) =>
|
|
2852
|
+
data: { args: m.slice(1).map((W) => Tr(W)) }
|
|
2859
2853
|
});
|
|
2860
2854
|
} catch {
|
|
2861
2855
|
}
|
|
@@ -2942,7 +2936,7 @@ function Vr({
|
|
|
2942
2936
|
{
|
|
2943
2937
|
type: "button",
|
|
2944
2938
|
onClick: () => b((v) => !v),
|
|
2945
|
-
style:
|
|
2939
|
+
style: bt(y ? "#f59e0b" : "transparent"),
|
|
2946
2940
|
title: "Pause / resume capture",
|
|
2947
2941
|
children: y ? "▶ resume" : "⏸ pause"
|
|
2948
2942
|
}
|
|
@@ -2954,7 +2948,7 @@ function Vr({
|
|
|
2954
2948
|
onClick: () => {
|
|
2955
2949
|
c([]), a.current = [];
|
|
2956
2950
|
},
|
|
2957
|
-
style:
|
|
2951
|
+
style: bt("transparent"),
|
|
2958
2952
|
title: "Clear buffer",
|
|
2959
2953
|
children: "clear"
|
|
2960
2954
|
}
|
|
@@ -2964,7 +2958,7 @@ function Vr({
|
|
|
2964
2958
|
{
|
|
2965
2959
|
type: "button",
|
|
2966
2960
|
onClick: () => o(!1),
|
|
2967
|
-
style:
|
|
2961
|
+
style: bt("transparent"),
|
|
2968
2962
|
"aria-label": "Close",
|
|
2969
2963
|
title: "Close (Cmd/Ctrl + Shift + L)",
|
|
2970
2964
|
children: "✕"
|
|
@@ -3031,7 +3025,7 @@ function Vr({
|
|
|
3031
3025
|
]
|
|
3032
3026
|
}
|
|
3033
3027
|
) : C.map((v) => /* @__PURE__ */ n(
|
|
3034
|
-
|
|
3028
|
+
Ir,
|
|
3035
3029
|
{
|
|
3036
3030
|
entry: v,
|
|
3037
3031
|
expanded: s.current.has(v.id),
|
|
@@ -3047,7 +3041,7 @@ function Vr({
|
|
|
3047
3041
|
}
|
|
3048
3042
|
);
|
|
3049
3043
|
}
|
|
3050
|
-
function
|
|
3044
|
+
function Ir({
|
|
3051
3045
|
entry: e,
|
|
3052
3046
|
expanded: t,
|
|
3053
3047
|
onToggle: r
|
|
@@ -3117,7 +3111,7 @@ function Pr({
|
|
|
3117
3111
|
}
|
|
3118
3112
|
);
|
|
3119
3113
|
}
|
|
3120
|
-
function
|
|
3114
|
+
function bt(e) {
|
|
3121
3115
|
return {
|
|
3122
3116
|
background: e,
|
|
3123
3117
|
color: "#fff",
|
|
@@ -3128,14 +3122,14 @@ function wt(e) {
|
|
|
3128
3122
|
cursor: "pointer"
|
|
3129
3123
|
};
|
|
3130
3124
|
}
|
|
3131
|
-
function
|
|
3125
|
+
function Tr(e) {
|
|
3132
3126
|
try {
|
|
3133
3127
|
return e instanceof Error ? { message: e.message, stack: e.stack } : (JSON.stringify(e), e);
|
|
3134
3128
|
} catch {
|
|
3135
3129
|
return String(e);
|
|
3136
3130
|
}
|
|
3137
3131
|
}
|
|
3138
|
-
function
|
|
3132
|
+
function jr() {
|
|
3139
3133
|
const [e, t] = L([]), r = k((o) => {
|
|
3140
3134
|
t((l) => {
|
|
3141
3135
|
const c = l.findIndex((u) => u.id === o.id);
|
|
@@ -3154,33 +3148,33 @@ function Yr() {
|
|
|
3154
3148
|
};
|
|
3155
3149
|
}
|
|
3156
3150
|
export {
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3151
|
+
Or as AvatarWidget,
|
|
3152
|
+
wn as ErrorBoundary,
|
|
3153
|
+
Ur as LiveLayerDebugPanel,
|
|
3154
|
+
Fr as LiveLayerField,
|
|
3155
|
+
Wr as LiveLayerForm,
|
|
3156
|
+
Br as LiveLayerRegion,
|
|
3157
|
+
qr as LiveLayerWidget,
|
|
3158
|
+
gr as clearPageContextCache,
|
|
3159
|
+
xr as clearRoutesCache,
|
|
3160
|
+
mr as extractPageContext,
|
|
3161
|
+
wr as extractRoutes,
|
|
3162
|
+
Gt as getCachedPageContext,
|
|
3163
|
+
vt as getCachedRoutes,
|
|
3164
|
+
Fn as matchesPattern,
|
|
3165
|
+
vr as normalizeRouteInput,
|
|
3166
|
+
Un as shouldRenderAtPath,
|
|
3167
|
+
Nn as useAgentInfo,
|
|
3168
|
+
xn as useAudioLevel,
|
|
3169
|
+
Sn as useCameraState,
|
|
3170
|
+
Mn as useDisplayMode,
|
|
3171
|
+
Pn as useDisplayModePersistence,
|
|
3172
|
+
$n as useIsMobile,
|
|
3173
|
+
_n as useLiveKitSession,
|
|
3174
|
+
En as useMediaDevices,
|
|
3175
|
+
kn as useMicrophoneState,
|
|
3176
|
+
Hn as usePathname,
|
|
3177
|
+
jn as useRouteMatch,
|
|
3178
|
+
Cn as useScreenShareState,
|
|
3179
|
+
jr as useTranscript
|
|
3186
3180
|
};
|