@livelayer/react 0.15.0 → 0.15.2

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