@livelayer/react 0.12.6 → 0.14.0

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