@livelayer/react 0.8.0 → 0.9.0

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