@livelayer/react 0.5.11 → 0.5.12

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
@@ -13,8 +13,8 @@ class mn extends dn {
13
13
  return { hasError: !0, error: t };
14
14
  }
15
15
  componentDidCatch(t, r) {
16
- var o, i;
17
- (i = (o = this.props).onError) == null || i.call(o, t, r);
16
+ var i, o;
17
+ (o = (i = this.props).onError) == null || o.call(i, t, r);
18
18
  }
19
19
  render() {
20
20
  var t;
@@ -34,16 +34,16 @@ class mn extends dn {
34
34
  }
35
35
  }
36
36
  function gn(e) {
37
- const [t, r] = L("idle"), [o, i] = L("idle"), [l, s] = L([]), [d, f] = L(null), [y, g] = L(null), [a, c] = L(null), [I, C] = L(!1), [S, v] = L(null), b = E(null), z = E(e.onDataMessage);
37
+ const [t, r] = L("idle"), [i, o] = L("idle"), [l, c] = L([]), [d, f] = L(null), [y, g] = L(null), [a, s] = L(null), [I, C] = L(!1), [S, v] = L(null), b = E(null), z = E(e.onDataMessage);
38
38
  z.current = e.onDataMessage, R(() => {
39
39
  const N = {
40
40
  onConnectionStateChange: (D) => {
41
41
  r(D), D === "connected" && v(null);
42
42
  },
43
- onAgentStateChange: i,
44
- onTranscript: (D) => s([...D]),
43
+ onAgentStateChange: o,
44
+ onTranscript: (D) => c([...D]),
45
45
  onAgentConfig: f,
46
- onAudioTrack: (D) => c(D),
46
+ onAudioTrack: (D) => s(D),
47
47
  onVideoTrack: (D) => g(D),
48
48
  onVideoTrackRemoved: () => g(null),
49
49
  onError: (D) => v(D),
@@ -62,7 +62,7 @@ function gn(e) {
62
62
  },
63
63
  N
64
64
  );
65
- return b.current = q, r("idle"), i("idle"), s([]), f(null), g(null), c(null), C(!1), v(null), () => {
65
+ return b.current = q, r("idle"), o("idle"), c([]), f(null), g(null), s(null), C(!1), v(null), () => {
66
66
  var D;
67
67
  (D = q.destroy) == null || D.call(q), b.current = null;
68
68
  };
@@ -90,7 +90,7 @@ function gn(e) {
90
90
  }, []);
91
91
  return {
92
92
  connectionState: t,
93
- agentState: o,
93
+ agentState: i,
94
94
  transcript: l,
95
95
  agentConfig: d,
96
96
  videoElement: y,
@@ -104,31 +104,31 @@ function gn(e) {
104
104
  };
105
105
  }
106
106
  function yn() {
107
- const e = E(null), t = E(null), r = E(null), o = E(null), i = E(/* @__PURE__ */ new Set()), l = E(null), s = k(() => {
107
+ const e = E(null), t = E(null), r = E(null), i = E(null), o = E(/* @__PURE__ */ new Set()), l = E(null), c = k(() => {
108
108
  const a = t.current;
109
109
  if (!a) {
110
- o.current = null;
110
+ i.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 c = l.current;
117
- a.getByteFrequencyData(c);
116
+ const s = l.current;
117
+ a.getByteFrequencyData(s);
118
118
  let I = 0;
119
- for (let S = 0; S < c.length; S++) I += c[S];
120
- const C = I / c.length / 255;
121
- for (const S of i.current)
119
+ for (let S = 0; S < s.length; S++) I += s[S];
120
+ const C = I / s.length / 255;
121
+ for (const S of o.current)
122
122
  try {
123
123
  S(C);
124
124
  } catch (v) {
125
125
  console.error("[useAudioLevel] subscriber threw:", v);
126
126
  }
127
- o.current = requestAnimationFrame(s);
127
+ i.current = requestAnimationFrame(c);
128
128
  }, []), d = k(() => {
129
129
  if (e.current || typeof window > "u" || typeof AudioContext > "u") return;
130
- const a = new AudioContext(), c = a.createAnalyser();
131
- c.fftSize = 64, c.connect(a.destination), e.current = a, t.current = c;
130
+ const a = new AudioContext(), s = a.createAnalyser();
131
+ s.fftSize = 64, s.connect(a.destination), e.current = a, t.current = s;
132
132
  }, []), f = k(
133
133
  (a) => {
134
134
  if (d(), !(!e.current || !t.current)) {
@@ -140,26 +140,26 @@ function yn() {
140
140
  r.current = null;
141
141
  }
142
142
  try {
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);
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);
147
147
  return;
148
148
  }
149
- o.current === null && (o.current = requestAnimationFrame(s));
149
+ i.current === null && (i.current = requestAnimationFrame(c));
150
150
  }
151
151
  },
152
- [d, s]
152
+ [d, c]
153
153
  ), y = k(() => {
154
- if (o.current !== null && (cancelAnimationFrame(o.current), o.current = null), r.current) {
154
+ if (i.current !== null && (cancelAnimationFrame(i.current), i.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 = k((a) => (i.current.add(a), () => {
162
- i.current.delete(a);
161
+ }, []), g = k((a) => (o.current.add(a), () => {
162
+ o.current.delete(a);
163
163
  }), []);
164
164
  return R(() => () => {
165
165
  if (y(), t.current) {
@@ -176,34 +176,34 @@ function yn() {
176
176
  }
177
177
  e.current = null;
178
178
  }
179
- i.current.clear(), l.current = null;
179
+ o.current.clear(), l.current = null;
180
180
  }, [y]), { attach: f, detach: y, subscribe: g };
181
181
  }
182
182
  function vn() {
183
- const [e, t] = L(!1), [r, o] = L(null), i = E(null), l = E(null), s = k(async (g) => {
184
- if (i.current && l.current) {
183
+ const [e, t] = L(!1), [r, i] = L(null), o = E(null), l = E(null), c = k(async (g) => {
184
+ if (o.current && l.current) {
185
185
  try {
186
- await l.current.localParticipant.unpublishTrack(i.current);
186
+ await l.current.localParticipant.unpublishTrack(o.current);
187
187
  } catch {
188
188
  }
189
- i.current.stop(), i.current = null;
189
+ o.current.stop(), o.current = null;
190
190
  }
191
- l.current = g, o(null);
191
+ l.current = g, i(null);
192
192
  try {
193
193
  const a = await pn({
194
194
  echoCancellation: !0,
195
195
  noiseSuppression: !0
196
196
  });
197
- await g.localParticipant.publishTrack(a), i.current = a, t(a.isMuted);
197
+ await g.localParticipant.publishTrack(a), o.current = a, t(a.isMuted);
198
198
  } catch (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;
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;
201
201
  }
202
202
  }, []), d = k(() => {
203
- const g = i.current;
203
+ const g = o.current;
204
204
  g && (g.isMuted ? (g.unmute(), t(!1)) : (g.mute(), t(!0)));
205
205
  }, []), f = k(() => {
206
- const g = i.current, a = l.current;
206
+ const g = o.current, a = l.current;
207
207
  if (g && a) {
208
208
  try {
209
209
  a.localParticipant.unpublishTrack(g);
@@ -211,20 +211,20 @@ function vn() {
211
211
  }
212
212
  g.stop();
213
213
  }
214
- i.current = null, l.current = null, t(!1);
215
- }, []), y = k(() => o(null), []);
214
+ o.current = null, l.current = null, t(!1);
215
+ }, []), y = k(() => i(null), []);
216
216
  return {
217
217
  isMuted: e,
218
218
  micError: r,
219
219
  toggleMute: d,
220
- setupMic: s,
220
+ setupMic: c,
221
221
  teardownMic: f,
222
222
  clearError: y
223
223
  };
224
224
  }
225
225
  const bn = { resolution: { width: 640, height: 480, frameRate: 24 } };
226
226
  function wn() {
227
- const [e, t] = L(!1), [r, o] = L(null), [i, l] = L(null), [s, d] = L(""), f = E(null), y = E(null), g = k((b) => {
227
+ const [e, t] = L(!1), [r, i] = L(null), [o, l] = L(null), [c, d] = L(""), f = E(null), y = E(null), g = k((b) => {
228
228
  f.current = b;
229
229
  }, []), a = k(() => {
230
230
  const b = f.current, z = y.current;
@@ -240,10 +240,10 @@ function wn() {
240
240
  z.stop();
241
241
  }
242
242
  y.current = null, l(null), t(!1);
243
- }, []), c = k(async (b) => {
243
+ }, []), s = k(async (b) => {
244
244
  const z = f.current;
245
245
  if (z) {
246
- o(null);
246
+ i(null);
247
247
  try {
248
248
  const M = { ...bn };
249
249
  b && (M.deviceId = b);
@@ -260,23 +260,23 @@ function wn() {
260
260
  }
261
261
  } catch (M) {
262
262
  const H = M instanceof Error && M.name === "NotAllowedError" ? "Enable your camera in the browser to share video." : "Camera unavailable. Check permissions and try again.";
263
- o(H);
263
+ i(H);
264
264
  }
265
265
  }
266
266
  }, []), I = k(async () => {
267
- e ? a() : await c(s || void 0);
268
- }, [e, s, a, c]), C = k(async (b) => {
269
- a(), await c(b);
270
- }, [a, c]), S = k(() => {
271
- a(), f.current = null, o(null), d("");
272
- }, [a]), v = k(() => o(null), []);
267
+ e ? a() : await s(c || void 0);
268
+ }, [e, c, a, s]), C = k(async (b) => {
269
+ a(), await s(b);
270
+ }, [a, s]), S = k(() => {
271
+ a(), f.current = null, i(null), d("");
272
+ }, [a]), v = k(() => i(null), []);
273
273
  return R(() => () => {
274
274
  y.current && y.current.stop();
275
275
  }, []), {
276
276
  isEnabled: e,
277
277
  error: r,
278
- previewEl: i,
279
- activeDeviceId: s,
278
+ previewEl: o,
279
+ activeDeviceId: c,
280
280
  toggle: I,
281
281
  switchDevice: C,
282
282
  attachRoom: g,
@@ -285,30 +285,30 @@ function wn() {
285
285
  };
286
286
  }
287
287
  function _n() {
288
- const [e, t] = L(!1), [r, o] = L(null), [i, l] = L(null), s = E(null), d = k((c) => {
289
- s.current = c;
288
+ const [e, t] = L(!1), [r, i] = L(null), [o, l] = L(null), c = E(null), d = k((s) => {
289
+ c.current = s;
290
290
  }, []), f = k(() => l(null), []), y = k(async () => {
291
- const c = s.current;
292
- if (c) {
291
+ const s = c.current;
292
+ if (s) {
293
293
  if (e) {
294
294
  try {
295
- await c.localParticipant.setScreenShareEnabled(!1);
295
+ await s.localParticipant.setScreenShareEnabled(!1);
296
296
  } catch {
297
297
  }
298
298
  f(), t(!1);
299
299
  return;
300
300
  }
301
- o(null);
301
+ i(null);
302
302
  try {
303
- await c.localParticipant.setScreenShareEnabled(!0);
303
+ await s.localParticipant.setScreenShareEnabled(!0);
304
304
  let I = 0;
305
305
  const C = () => {
306
- const S = c.localParticipant.getTrackPublication(Gt.Source.ScreenShare);
306
+ const S = s.localParticipant.getTrackPublication(Gt.Source.ScreenShare);
307
307
  if (S != null && S.track) {
308
308
  const v = S.track.attach();
309
309
  l(v), t(!0);
310
310
  try {
311
- c.localParticipant.publishData(
311
+ s.localParticipant.publishData(
312
312
  new TextEncoder().encode(JSON.stringify({ type: "user_screen_share_on" })),
313
313
  { reliable: !0 }
314
314
  );
@@ -321,57 +321,57 @@ function _n() {
321
321
  C();
322
322
  } catch (I) {
323
323
  const C = I instanceof Error ? I.name : "";
324
- C !== "NotAllowedError" && C !== "AbortError" && o("Screen share unavailable. Try again."), t(!1);
324
+ C !== "NotAllowedError" && C !== "AbortError" && i("Screen share unavailable. Try again."), t(!1);
325
325
  }
326
326
  }
327
327
  }, [e, f]), g = k(() => {
328
- const c = s.current;
329
- if (c && e)
328
+ const s = c.current;
329
+ if (s && e)
330
330
  try {
331
- c.localParticipant.setScreenShareEnabled(!1);
331
+ s.localParticipant.setScreenShareEnabled(!1);
332
332
  } catch {
333
333
  }
334
- f(), t(!1), o(null), s.current = null;
335
- }, [e, f]), a = k(() => o(null), []);
336
- return { isEnabled: e, error: r, previewEl: i, toggle: y, attachRoom: d, teardown: g, clearError: a };
334
+ f(), t(!1), i(null), c.current = null;
335
+ }, [e, f]), a = k(() => i(null), []);
336
+ return { isEnabled: e, error: r, previewEl: o, toggle: y, attachRoom: d, teardown: g, clearError: a };
337
337
  }
338
338
  function xn() {
339
- const [e, t] = L([]), [r, o] = L([]), i = k(async () => {
339
+ const [e, t] = L([]), [r, i] = L([]), o = k(async () => {
340
340
  if (!(typeof navigator > "u" || !navigator.mediaDevices))
341
341
  try {
342
342
  const l = await navigator.mediaDevices.enumerateDevices();
343
- t(l.filter((s) => s.kind === "audioinput")), o(l.filter((s) => s.kind === "videoinput"));
343
+ t(l.filter((c) => c.kind === "audioinput")), i(l.filter((c) => c.kind === "videoinput"));
344
344
  } catch {
345
345
  }
346
346
  }, []);
347
347
  return R(() => {
348
- if (i(), typeof navigator > "u" || !navigator.mediaDevices) return;
349
- const l = () => void i();
348
+ if (o(), typeof navigator > "u" || !navigator.mediaDevices) return;
349
+ const l = () => void o();
350
350
  return navigator.mediaDevices.addEventListener("devicechange", l), () => navigator.mediaDevices.removeEventListener("devicechange", l);
351
- }, [i]), { mics: e, cameras: r, refresh: i };
351
+ }, [o]), { mics: e, cameras: r, refresh: o };
352
352
  }
353
353
  function kn(e, t, r = !1) {
354
- const [o, i] = L(null), [l, s] = L(null), [d, f] = L(!r && !!e);
354
+ const [i, o] = L(null), [l, c] = L(null), [d, f] = L(!r && !!e);
355
355
  return R(() => {
356
356
  if (r || !e) {
357
357
  f(!1);
358
358
  return;
359
359
  }
360
360
  const y = new AbortController(), g = t || "https://app.livelayer.studio";
361
- return f(!0), s(null), fetch(`${g}/api/widget/agent/${encodeURIComponent(e)}`, {
361
+ return f(!0), c(null), fetch(`${g}/api/widget/agent/${encodeURIComponent(e)}`, {
362
362
  signal: y.signal
363
363
  }).then(async (a) => {
364
364
  if (!a.ok) {
365
- const c = await a.json().catch(() => ({}));
366
- throw new Error(c.error || `HTTP ${a.status}`);
365
+ const s = await a.json().catch(() => ({}));
366
+ throw new Error(s.error || `HTTP ${a.status}`);
367
367
  }
368
368
  return a.json();
369
369
  }).then((a) => {
370
- y.signal.aborted || (i(a), f(!1));
370
+ y.signal.aborted || (o(a), f(!1));
371
371
  }).catch((a) => {
372
- y.signal.aborted || (s(a instanceof Error ? a.message : "Agent lookup failed"), f(!1));
372
+ y.signal.aborted || (c(a instanceof Error ? a.message : "Agent lookup failed"), f(!1));
373
373
  }), () => y.abort();
374
- }, [e, t, r]), { info: o, error: l, loading: d };
374
+ }, [e, t, r]), { info: i, error: l, loading: d };
375
375
  }
376
376
  function Ln(e) {
377
377
  if (typeof window > "u") return null;
@@ -393,13 +393,13 @@ function Cn({
393
393
  defaultValue: t = "expanded",
394
394
  onChange: r
395
395
  } = {}) {
396
- const o = e !== void 0, [i, l] = L(t), s = o ? e : i, d = k(
396
+ const i = e !== void 0, [o, l] = L(t), c = i ? e : o, d = k(
397
397
  (f) => {
398
- f !== s && (o || l(f), r == null || r(f));
398
+ f !== c && (i || l(f), r == null || r(f));
399
399
  },
400
- [s, o, r]
400
+ [c, i, r]
401
401
  );
402
- return [s, d];
402
+ return [c, d];
403
403
  }
404
404
  const En = ["hidden", "minimized", "expanded"];
405
405
  function Nn(e) {
@@ -409,18 +409,18 @@ function An({
409
409
  value: e,
410
410
  defaultValue: t = "expanded",
411
411
  onChange: r,
412
- persistKey: o = "ll-widget",
413
- disablePersistence: i = !1
412
+ persistKey: i = "ll-widget",
413
+ disablePersistence: o = !1
414
414
  } = {}) {
415
- const l = `${o}:display-mode`, s = E(!1), [d, f] = Cn({
415
+ const l = `${i}:display-mode`, c = E(!1), [d, f] = Cn({
416
416
  value: e,
417
417
  defaultValue: t,
418
418
  onChange: (y) => {
419
- e === void 0 && !i && Sn(l, y), r == null || r(y);
419
+ e === void 0 && !o && Sn(l, y), r == null || r(y);
420
420
  }
421
421
  });
422
422
  return R(() => {
423
- if (s.current || (s.current = !0, i || e !== void 0)) return;
423
+ if (c.current || (c.current = !0, o || e !== void 0)) return;
424
424
  const y = Nn(Ln(l));
425
425
  y && y !== d && f(y);
426
426
  }, []), [d, f];
@@ -435,22 +435,22 @@ function In(e = Rn) {
435
435
  }
436
436
  if (typeof window > "u" || typeof window.matchMedia > "u")
437
437
  return;
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);
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);
441
441
  });
442
442
  }, [e]), t;
443
443
  }
444
- const It = "__llHistoryPatched", it = "ll:pathname";
444
+ const It = "__llHistoryPatched", lt = "ll:pathname";
445
445
  function Mn() {
446
446
  if (typeof window > "u" || window.history[It]) return;
447
447
  const e = window.history.pushState, t = window.history.replaceState;
448
448
  window.history.pushState = function(...r) {
449
- const o = e.apply(this, r);
450
- return window.dispatchEvent(new Event(it)), o;
449
+ const i = e.apply(this, r);
450
+ return window.dispatchEvent(new Event(lt)), i;
451
451
  }, window.history.replaceState = function(...r) {
452
- const o = t.apply(this, r);
453
- return window.dispatchEvent(new Event(it)), o;
452
+ const i = t.apply(this, r);
453
+ return window.dispatchEvent(new Event(lt)), i;
454
454
  }, window.history[It] = !0;
455
455
  }
456
456
  function Mt() {
@@ -463,9 +463,9 @@ function Tn(e) {
463
463
  return R(() => {
464
464
  if (e !== void 0) return;
465
465
  Mn();
466
- const o = () => r(Mt());
467
- return o(), window.addEventListener("popstate", o), window.addEventListener(it, o), () => {
468
- window.removeEventListener("popstate", o), window.removeEventListener(it, o);
466
+ const i = () => r(Mt());
467
+ return i(), window.addEventListener("popstate", i), window.addEventListener(lt, i), () => {
468
+ window.removeEventListener("popstate", i), window.removeEventListener(lt, i);
469
469
  };
470
470
  }, [e]), e ?? t;
471
471
  }
@@ -476,7 +476,7 @@ function Dn(e) {
476
476
  function $n(e) {
477
477
  const t = Tt.get(e);
478
478
  if (t) return t;
479
- const r = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e, o = "", i = "", l = r.replace(/\*\*/g, o).replace(/\*/g, i), d = Dn(l).replace(new RegExp(`\\/${o}`, "g"), "(?:\\/.*)?").replace(new RegExp(o, "g"), ".*").replace(new RegExp(i, "g"), "[^/]+"), f = new RegExp(`^${d}\\/?$`);
479
+ const r = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e, i = "", o = "", l = r.replace(/\*\*/g, i).replace(/\*/g, o), d = Dn(l).replace(new RegExp(`\\/${i}`, "g"), "(?:\\/.*)?").replace(new RegExp(i, "g"), ".*").replace(new RegExp(o, "g"), "[^/]+"), f = new RegExp(`^${d}\\/?$`);
480
480
  return Tt.set(e, f), f;
481
481
  }
482
482
  function zn(e, t) {
@@ -620,24 +620,24 @@ const Vn = ({
620
620
  position: e,
621
621
  isMobile: t,
622
622
  isSpeaking: r,
623
- onExpand: o,
624
- label: i = "Open widget",
623
+ onExpand: i,
624
+ label: o = "Open widget",
625
625
  avatarImageUrl: l,
626
- agentName: s
626
+ agentName: c
627
627
  }) => {
628
- const d = Fn(e), f = d === "right" ? "left" : "right", y = t ? 80 : 72, g = !!l, [a, c] = L(null), [I, C] = L(!1), S = E(null), v = E(!1), b = k(
628
+ const d = Fn(e), f = d === "right" ? "left" : "right", y = t ? 80 : 72, g = !!l, [a, s] = L(null), [I, C] = L(!1), S = E(null), v = E(!1), b = k(
629
629
  (A) => {
630
630
  if (typeof window > "u") return A;
631
- const O = y / 2, W = Ht + O, Y = window.innerHeight - Ht - O;
632
- return Y < W ? Math.max(W, A) : Math.max(W, Math.min(Y, A));
631
+ const O = y / 2, W = Ht + O, G = window.innerHeight - Ht - O;
632
+ return G < W ? Math.max(W, A) : Math.max(W, Math.min(G, A));
633
633
  },
634
634
  [y]
635
635
  );
636
636
  R(() => {
637
637
  const A = jn();
638
- c(b(A ?? window.innerHeight / 2));
638
+ s(b(A ?? window.innerHeight / 2));
639
639
  const O = () => {
640
- c((W) => W === null ? null : b(W));
640
+ s((W) => W === null ? null : b(W));
641
641
  };
642
642
  return window.addEventListener("resize", O), () => window.removeEventListener("resize", O);
643
643
  }, [b]);
@@ -661,7 +661,7 @@ const Vn = ({
661
661
  const O = S.current;
662
662
  if (!O) return;
663
663
  const W = A.clientY - O.startClientY;
664
- !O.moved && Math.abs(W) > Un && (O.moved = !0, C(!0)), O.moved && c(b(O.startCenterY + W));
664
+ !O.moved && Math.abs(W) > Un && (O.moved = !0, C(!0)), O.moved && s(b(O.startCenterY + W));
665
665
  },
666
666
  [b]
667
667
  ), H = k(
@@ -672,7 +672,7 @@ const Vn = ({
672
672
  A.currentTarget.releasePointerCapture(A.pointerId);
673
673
  } catch {
674
674
  }
675
- S.current = null, O.moved && (C(!1), v.current = !0, c((W) => (W !== null && Ot(W), W)));
675
+ S.current = null, O.moved && (C(!1), v.current = !0, s((W) => (W !== null && Ot(W), W)));
676
676
  }
677
677
  },
678
678
  []
@@ -681,16 +681,16 @@ const Vn = ({
681
681
  v.current = !1;
682
682
  return;
683
683
  }
684
- o();
685
- }, [o]), N = k(
684
+ i();
685
+ }, [i]), N = k(
686
686
  (A) => {
687
687
  if (A.key === "ArrowUp" || A.key === "ArrowDown") {
688
688
  A.preventDefault();
689
689
  const O = A.key === "ArrowUp" ? -8 : 8;
690
- c((W) => {
690
+ s((W) => {
691
691
  if (W === null) return W;
692
- const Y = b(W + O);
693
- return Ot(Y), Y;
692
+ const G = b(W + O);
693
+ return Ot(G), G;
694
694
  });
695
695
  }
696
696
  },
@@ -714,7 +714,7 @@ const Vn = ({
714
714
  onPointerCancel: H,
715
715
  onClick: h,
716
716
  onKeyDown: N,
717
- "aria-label": i,
717
+ "aria-label": o,
718
718
  "data-position": e,
719
719
  style: D,
720
720
  children: g ? (
@@ -734,7 +734,7 @@ const Vn = ({
734
734
  "img",
735
735
  {
736
736
  src: l,
737
- alt: s ? `${s} avatar` : "Agent avatar",
737
+ alt: c ? `${c} avatar` : "Agent avatar",
738
738
  className: "ll-hidden__avatar",
739
739
  draggable: !1
740
740
  }
@@ -753,31 +753,31 @@ const Vn = ({
753
753
  audioLevel: e,
754
754
  bars: t = 20,
755
755
  maxHeight: r = 20,
756
- minHeight: o = 4,
757
- className: i,
756
+ minHeight: i = 4,
757
+ className: o,
758
758
  barClassName: l
759
759
  }) => {
760
- const s = E(null), d = E([]), f = ot(() => {
760
+ const c = E(null), d = E([]), f = ot(() => {
761
761
  const g = (Math.sqrt(5) - 1) / 2;
762
- return Array.from({ length: t }, (a, c) => 0.5 + c * g % 1 * 0.5);
762
+ return Array.from({ length: t }, (a, s) => 0.5 + s * g % 1 * 0.5);
763
763
  }, [t]);
764
764
  R(() => e.subscribe((a) => {
765
- for (let c = 0; c < t; c++) {
766
- const I = d.current[c];
765
+ for (let s = 0; s < t; s++) {
766
+ const I = d.current[s];
767
767
  if (!I) continue;
768
- const C = Math.max(o, a * r * f[c]);
768
+ const C = Math.max(i, a * r * f[s]);
769
769
  I.style.height = `${C}px`;
770
770
  }
771
- }), [e, t, r, o, f]);
772
- const y = ["ll-waveform", i].filter(Boolean).join(" ");
773
- return /* @__PURE__ */ n("div", { ref: s, className: y, "aria-hidden": "true", children: Array.from({ length: t }, (g, a) => /* @__PURE__ */ n(
771
+ }), [e, t, r, i, f]);
772
+ const y = ["ll-waveform", o].filter(Boolean).join(" ");
773
+ return /* @__PURE__ */ n("div", { ref: c, className: y, "aria-hidden": "true", children: Array.from({ length: t }, (g, a) => /* @__PURE__ */ n(
774
774
  "div",
775
775
  {
776
- ref: (c) => {
777
- d.current[a] = c;
776
+ ref: (s) => {
777
+ d.current[a] = s;
778
778
  },
779
779
  className: ["ll-waveform__bar", l].filter(Boolean).join(" "),
780
- style: { height: `${o}px` }
780
+ style: { height: `${i}px` }
781
781
  },
782
782
  a
783
783
  )) });
@@ -785,10 +785,10 @@ const Vn = ({
785
785
  position: e,
786
786
  isMobile: t,
787
787
  agentName: r,
788
- avatarImageUrl: o,
789
- agentState: i,
788
+ avatarImageUrl: i,
789
+ agentState: o,
790
790
  isMuted: l,
791
- audioLevel: s,
791
+ audioLevel: c,
792
792
  onExpand: d,
793
793
  onToggleMute: f,
794
794
  onClose: y
@@ -806,12 +806,12 @@ const Vn = ({
806
806
  onClick: d,
807
807
  "aria-label": `Expand ${r} widget`,
808
808
  children: [
809
- o ? (
809
+ i ? (
810
810
  // eslint-disable-next-line @next/next/no-img-element
811
811
  /* @__PURE__ */ n(
812
812
  "img",
813
813
  {
814
- src: o,
814
+ src: i,
815
815
  alt: r,
816
816
  className: "ll-minimized__avatar"
817
817
  }
@@ -820,7 +820,7 @@ const Vn = ({
820
820
  /* @__PURE__ */ n(
821
821
  Yn,
822
822
  {
823
- audioLevel: s,
823
+ audioLevel: c,
824
824
  bars: 16,
825
825
  maxHeight: 18,
826
826
  className: "ll-minimized__waveform"
@@ -858,12 +858,12 @@ const Vn = ({
858
858
  role: "region",
859
859
  "aria-label": `${r} widget`,
860
860
  children: /* @__PURE__ */ _("div", { className: "ll-minimized__surface", children: [
861
- o ? (
861
+ i ? (
862
862
  // eslint-disable-next-line @next/next/no-img-element
863
863
  /* @__PURE__ */ n(
864
864
  "img",
865
865
  {
866
- src: o,
866
+ src: i,
867
867
  alt: r,
868
868
  className: "ll-minimized__avatar"
869
869
  }
@@ -871,7 +871,7 @@ const Vn = ({
871
871
  ) : /* @__PURE__ */ n("div", { className: "ll-minimized__avatar ll-minimized__avatar--placeholder" }),
872
872
  /* @__PURE__ */ _("div", { className: "ll-minimized__meta", children: [
873
873
  /* @__PURE__ */ n("span", { className: "ll-minimized__name", children: r }),
874
- /* @__PURE__ */ n("span", { className: "ll-minimized__state", children: i === "speaking" ? "Speaking" : i === "thinking" ? "Thinking" : "Listening" })
874
+ /* @__PURE__ */ n("span", { className: "ll-minimized__state", children: o === "speaking" ? "Speaking" : o === "thinking" ? "Thinking" : "Listening" })
875
875
  ] }),
876
876
  /* @__PURE__ */ _("div", { className: "ll-minimized__controls", children: [
877
877
  /* @__PURE__ */ n(
@@ -911,12 +911,12 @@ const Vn = ({
911
911
  src: e,
912
912
  alt: t,
913
913
  preCannedPlaying: r = !1,
914
- className: o,
915
- style: i
914
+ className: i,
915
+ style: o
916
916
  }) => {
917
- const [l, s] = L(!1), d = E(e);
917
+ const [l, c] = L(!1), d = E(e);
918
918
  if (R(() => {
919
- d.current !== e && (d.current = e, s(!1));
919
+ d.current !== e && (d.current = e, c(!1));
920
920
  }, [e]), !e) return null;
921
921
  const f = {
922
922
  position: "absolute",
@@ -928,7 +928,7 @@ const Vn = ({
928
928
  transition: "opacity 500ms ease, transform 500ms ease",
929
929
  transform: r ? "scale(1.02)" : "scale(1)",
930
930
  opacity: l ? 1 : 0,
931
- ...i
931
+ ...o
932
932
  };
933
933
  return (
934
934
  // eslint-disable-next-line @next/next/no-img-element
@@ -937,11 +937,11 @@ const Vn = ({
937
937
  {
938
938
  src: e,
939
939
  alt: t,
940
- className: o,
940
+ className: i,
941
941
  style: f,
942
942
  loading: "eager",
943
943
  fetchPriority: "high",
944
- onLoad: () => s(!0)
944
+ onLoad: () => c(!0)
945
945
  }
946
946
  )
947
947
  );
@@ -949,16 +949,16 @@ const Vn = ({
949
949
  position: e,
950
950
  isMobile: t,
951
951
  agentName: r,
952
- avatarImageUrl: o,
953
- idleLoopUrl: i,
952
+ avatarImageUrl: i,
953
+ idleLoopUrl: o,
954
954
  greeting: l,
955
- branding: s,
955
+ branding: c,
956
956
  teamMembers: d,
957
957
  currentTeamMemberId: f,
958
958
  isSwitchingTeamMember: y,
959
959
  teamSwitcherOpen: g,
960
960
  onToggleTeamSwitcher: a,
961
- onSelectTeamMember: c,
961
+ onSelectTeamMember: s,
962
962
  languageMenuOpen: I,
963
963
  onToggleLanguageMenu: C,
964
964
  connectionState: S,
@@ -974,112 +974,118 @@ const Vn = ({
974
974
  cameraPreviewEl: A,
975
975
  cameraDevices: O,
976
976
  activeCameraId: W,
977
- isScreenShareEnabled: Y,
978
- screenPreviewEl: ne,
977
+ isScreenShareEnabled: G,
978
+ screenPreviewEl: te,
979
979
  isSpeakerMuted: me,
980
- allowCamera: je,
981
- allowScreenShare: Ve,
982
- allowTyping: Ye,
983
- avatarVideoContainerRef: Ge,
984
- agentVideoEl: te,
980
+ allowCamera: Ve,
981
+ allowScreenShare: Ye,
982
+ allowTyping: Ge,
983
+ avatarVideoContainerRef: Je,
984
+ agentVideoEl: Z,
985
985
  onConnect: ge,
986
- onDisconnect: we,
987
- onRetry: _e,
988
- onResumeAudio: xe,
989
- onToggleMute: ke,
990
- onToggleCamera: Le,
991
- onSwitchCameraDevice: Se,
986
+ onDisconnect: _e,
987
+ onRetry: xe,
988
+ onResumeAudio: ke,
989
+ onToggleMute: Le,
990
+ onToggleCamera: Se,
991
+ onSwitchCameraDevice: Ce,
992
992
  onToggleScreenShare: V,
993
- onToggleSpeaker: at,
994
- onSendMessage: Je,
995
- onMinimize: Ke,
996
- onClose: se,
997
- onClearMicError: Pe
993
+ onToggleSpeaker: st,
994
+ onSendMessage: Ke,
995
+ onMinimize: Xe,
996
+ onClose: ce,
997
+ onClearMicError: Oe
998
998
  }) => {
999
- var Qe;
1000
- const Q = b.length > 0 ? b[b.length - 1] : null, ye = ((d == null ? void 0 : d.length) ?? 0) > 1, Ce = S === "connecting" || S === "connected", K = S === "connected", Z = S === "idle" || S === "disconnected" || S === "error", [Ee, oe] = L(!1);
999
+ var Te;
1000
+ const se = ((d == null ? void 0 : d.length) ?? 0) > 1, Ee = S === "connecting" || S === "connected", re = S === "connected", ye = S === "idle" || S === "disconnected" || S === "error", [J, ve] = L(!1);
1001
1001
  R(() => {
1002
- if (!te) {
1003
- oe(!1);
1002
+ if (!Z) {
1003
+ ve(!1);
1004
1004
  return;
1005
1005
  }
1006
- if (!te.paused && te.readyState >= 2) {
1007
- oe(!0);
1006
+ if (!Z.paused && Z.readyState >= 2) {
1007
+ ve(!0);
1008
1008
  return;
1009
1009
  }
1010
- oe(!1);
1011
- const p = () => oe(!0);
1012
- return te.addEventListener("playing", p), te.addEventListener("loadeddata", p), () => {
1013
- te.removeEventListener("playing", p), te.removeEventListener("loadeddata", p);
1010
+ ve(!1);
1011
+ const p = () => ve(!0);
1012
+ return Z.addEventListener("playing", p), Z.addEventListener("loadeddata", p), () => {
1013
+ Z.removeEventListener("playing", p), Z.removeEventListener("loadeddata", p);
1014
1014
  };
1015
- }, [te]);
1016
- const [ce, ve] = L(!1);
1015
+ }, [Z]);
1016
+ const [be, ie] = L(!1);
1017
1017
  R(() => {
1018
- if (!K) {
1019
- ve(!1);
1018
+ if (!re) {
1019
+ ie(!1);
1020
1020
  return;
1021
1021
  }
1022
- if (Ee) return;
1023
- const p = setTimeout(() => ve(!0), 8e3);
1022
+ if (J) return;
1023
+ const p = setTimeout(() => ie(!0), 8e3);
1024
1024
  return () => clearTimeout(p);
1025
- }, [K, Ee]);
1026
- const De = S === "connecting" || K && !!o && !Ee && !ce, re = E(null), ie = E(null);
1025
+ }, [re, J]);
1026
+ const Ne = S === "connecting" || re && !!i && !J && !be, Ae = E(null), ne = E(null);
1027
1027
  R(() => {
1028
- const p = re.current;
1028
+ const p = Ae.current;
1029
1029
  p && (p.innerHTML = "", A && (A.style.width = "100%", A.style.height = "100%", A.style.objectFit = "cover", A.style.transform = "scaleX(-1)", p.appendChild(A)));
1030
1030
  }, [A]), R(() => {
1031
- const p = ie.current;
1032
- p && (p.innerHTML = "", ne && (ne.style.width = "100%", ne.style.height = "100%", ne.style.objectFit = "contain", p.appendChild(ne)));
1033
- }, [ne]);
1034
- const [le, de] = L(!1), [Ne, ue] = L(!1);
1031
+ const p = ne.current;
1032
+ p && (p.innerHTML = "", te && (te.style.width = "100%", te.style.height = "100%", te.style.objectFit = "contain", p.appendChild(te)));
1033
+ }, [te]);
1034
+ const [ee, oe] = L(!1), [de, Re] = L(!1);
1035
1035
  R(() => {
1036
- if (!le && !Ne && !I && !g) return;
1036
+ if (!ee && !de && !I && !g) return;
1037
1037
  const p = () => {
1038
- de(!1), ue(!1), I && C(), g && a();
1038
+ oe(!1), Re(!1), I && C(), g && a();
1039
1039
  };
1040
1040
  return document.addEventListener("click", p), () => document.removeEventListener("click", p);
1041
1041
  }, [
1042
- le,
1043
- Ne,
1042
+ ee,
1043
+ de,
1044
1044
  I,
1045
1045
  g,
1046
1046
  C,
1047
1047
  a
1048
1048
  ]);
1049
- const [fe, $e] = L(""), ze = k(
1049
+ const [ue, Ie] = L(""), Qe = k(
1050
1050
  (p) => {
1051
1051
  p.preventDefault();
1052
- const X = fe.trim();
1053
- X && (Je(X), $e(""));
1052
+ const Y = ue.trim();
1053
+ Y && (Ke(Y), Ie(""));
1054
1054
  },
1055
- [fe, Je]
1056
- ), He = s.productName || "Live Layer", Xe = K && (Q != null && Q.text) ? Q.text : l || "", ct = K && (Q == null ? void 0 : Q.role) === "agent", Oe = [
1055
+ [ue, Ke]
1056
+ ), Be = c.productName || "Live Layer";
1057
+ let le = null, fe = null;
1058
+ for (let p = b.length - 1; p >= 0; p--) {
1059
+ const Y = b[p];
1060
+ if (!le && Y.role === "agent" ? le = Y : !fe && Y.role === "user" && (fe = Y), le && fe) break;
1061
+ }
1062
+ const Ze = re ? (le == null ? void 0 : le.text) || null : l || null, Me = re && (fe == null ? void 0 : fe.text) || null, ct = [
1057
1063
  "ll-expanded",
1058
1064
  t ? "ll-expanded--mobile" : "ll-expanded--desktop"
1059
1065
  ].join(" ");
1060
1066
  return /* @__PURE__ */ _(
1061
1067
  "div",
1062
1068
  {
1063
- className: Oe,
1069
+ className: ct,
1064
1070
  "data-position": e,
1065
- "data-state": K ? "connected" : Ce ? "connecting" : "idle",
1071
+ "data-state": re ? "connected" : Ee ? "connecting" : "idle",
1066
1072
  role: "dialog",
1067
1073
  "aria-label": `${r} widget`,
1068
1074
  children: [
1069
1075
  /* @__PURE__ */ _("div", { className: "ll-expanded__bg", children: [
1070
- o ? /* @__PURE__ */ n(
1076
+ i ? /* @__PURE__ */ n(
1071
1077
  Jn,
1072
1078
  {
1073
- src: o,
1079
+ src: i,
1074
1080
  alt: r,
1075
1081
  className: "ll-expanded__bg-img"
1076
1082
  }
1077
- ) : /* @__PURE__ */ n("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ n("span", { className: "ll-expanded__bg-initial", children: ((Qe = r == null ? void 0 : r.charAt(0)) == null ? void 0 : Qe.toUpperCase()) || "A" }) }),
1078
- i && !K && /* @__PURE__ */ n(
1083
+ ) : /* @__PURE__ */ n("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ n("span", { className: "ll-expanded__bg-initial", children: ((Te = r == null ? void 0 : r.charAt(0)) == null ? void 0 : Te.toUpperCase()) || "A" }) }),
1084
+ o && !re && /* @__PURE__ */ n(
1079
1085
  "video",
1080
1086
  {
1081
1087
  className: "ll-expanded__bg-idle",
1082
- src: i,
1088
+ src: o,
1083
1089
  autoPlay: !0,
1084
1090
  loop: !0,
1085
1091
  muted: !0,
@@ -1087,24 +1093,24 @@ const Vn = ({
1087
1093
  }
1088
1094
  )
1089
1095
  ] }),
1090
- /* @__PURE__ */ n("div", { ref: Ge, className: "ll-expanded__video" }),
1091
- De && /* @__PURE__ */ _("div", { className: "ll-expanded__overlay ll-expanded__overlay--connecting", children: [
1096
+ /* @__PURE__ */ n("div", { ref: Je, className: "ll-expanded__video" }),
1097
+ Ne && /* @__PURE__ */ _("div", { className: "ll-expanded__overlay ll-expanded__overlay--connecting", children: [
1092
1098
  /* @__PURE__ */ n("div", { className: "ll-expanded__spinner" }),
1093
1099
  /* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children: y ? "Switching..." : "Connecting..." })
1094
1100
  ] }),
1095
- M && K && /* @__PURE__ */ _(
1101
+ M && re && /* @__PURE__ */ _(
1096
1102
  "button",
1097
1103
  {
1098
1104
  type: "button",
1099
1105
  className: "ll-expanded__overlay ll-expanded__overlay--gesture",
1100
- onClick: xe,
1106
+ onClick: ke,
1101
1107
  children: [
1102
1108
  /* @__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" }) }),
1103
1109
  /* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children: "Tap to enable audio" })
1104
1110
  ]
1105
1111
  }
1106
1112
  ),
1107
- Ce ? /* @__PURE__ */ _("div", { className: "ll-expanded__topbar", children: [
1113
+ Ee ? /* @__PURE__ */ _("div", { className: "ll-expanded__topbar", children: [
1108
1114
  /* @__PURE__ */ _("div", { className: "ll-expanded__topbar-left", children: [
1109
1115
  /* @__PURE__ */ _("div", { className: "ll-expanded__pill-wrap", children: [
1110
1116
  /* @__PURE__ */ _(
@@ -1113,17 +1119,17 @@ const Vn = ({
1113
1119
  type: "button",
1114
1120
  className: "ll-hpill",
1115
1121
  onClick: (p) => {
1116
- ye && (p.stopPropagation(), a());
1122
+ se && (p.stopPropagation(), a());
1117
1123
  },
1118
- "aria-haspopup": ye ? "listbox" : void 0,
1119
- "aria-expanded": ye ? g : void 0,
1124
+ "aria-haspopup": se ? "listbox" : void 0,
1125
+ "aria-expanded": se ? g : void 0,
1120
1126
  children: [
1121
1127
  /* @__PURE__ */ n("span", { className: "ll-hpill__label", children: r }),
1122
- ye && /* @__PURE__ */ n(nt, {})
1128
+ se && /* @__PURE__ */ n(rt, {})
1123
1129
  ]
1124
1130
  }
1125
1131
  ),
1126
- ye && g && /* @__PURE__ */ n(
1132
+ se && g && /* @__PURE__ */ n(
1127
1133
  "div",
1128
1134
  {
1129
1135
  className: "ll-hmenu",
@@ -1134,7 +1140,7 @@ const Vn = ({
1134
1140
  {
1135
1141
  type: "button",
1136
1142
  className: `ll-hmenu__item ${p.id === f ? "is-active" : ""}`,
1137
- onClick: () => c(p.id),
1143
+ onClick: () => s(p.id),
1138
1144
  role: "option",
1139
1145
  "aria-selected": p.id === f,
1140
1146
  children: [
@@ -1170,7 +1176,7 @@ const Vn = ({
1170
1176
  title: "Language: English",
1171
1177
  children: [
1172
1178
  /* @__PURE__ */ n("span", { className: "ll-hpill__label", children: "EN" }),
1173
- /* @__PURE__ */ n(nt, {})
1179
+ /* @__PURE__ */ n(rt, {})
1174
1180
  ]
1175
1181
  }
1176
1182
  ),
@@ -1207,7 +1213,7 @@ const Vn = ({
1207
1213
  {
1208
1214
  type: "button",
1209
1215
  className: "ll-hbtn",
1210
- onClick: Ke,
1216
+ onClick: Xe,
1211
1217
  "aria-label": "Minimize widget",
1212
1218
  title: "Minimize",
1213
1219
  children: /* @__PURE__ */ n(qt, {})
@@ -1218,7 +1224,7 @@ const Vn = ({
1218
1224
  {
1219
1225
  type: "button",
1220
1226
  className: "ll-hbtn ll-hbtn--danger",
1221
- onClick: se,
1227
+ onClick: ce,
1222
1228
  "aria-label": "End call",
1223
1229
  title: "End call",
1224
1230
  children: /* @__PURE__ */ n(Bt, {})
@@ -1228,14 +1234,14 @@ const Vn = ({
1228
1234
  ] }) : (
1229
1235
  // Idle-state header with Live Layer product name + minimize/close
1230
1236
  /* @__PURE__ */ _("div", { className: "ll-expanded__header ll-expanded__header--idle", children: [
1231
- /* @__PURE__ */ n("span", { className: "ll-expanded__brand", children: He }),
1237
+ /* @__PURE__ */ n("span", { className: "ll-expanded__brand", children: Be }),
1232
1238
  /* @__PURE__ */ _("div", { className: "ll-expanded__header-actions", children: [
1233
1239
  /* @__PURE__ */ n(
1234
1240
  "button",
1235
1241
  {
1236
1242
  type: "button",
1237
1243
  className: "ll-hbtn ll-hbtn--ghost",
1238
- onClick: Ke,
1244
+ onClick: Xe,
1239
1245
  "aria-label": "Minimize widget",
1240
1246
  children: /* @__PURE__ */ n(qt, {})
1241
1247
  }
@@ -1245,7 +1251,7 @@ const Vn = ({
1245
1251
  {
1246
1252
  type: "button",
1247
1253
  className: "ll-hbtn ll-hbtn--danger",
1248
- onClick: se,
1254
+ onClick: ce,
1249
1255
  "aria-label": "Close widget",
1250
1256
  children: /* @__PURE__ */ n(Bt, {})
1251
1257
  }
@@ -1253,8 +1259,8 @@ const Vn = ({
1253
1259
  ] })
1254
1260
  ] })
1255
1261
  ),
1256
- Z && /* @__PURE__ */ (() => {
1257
- const p = z ? "Restart paused session" : S === "disconnected" ? "Reconnect to agent" : "Start video call", X = z ? "Pick up where you left off" : null;
1262
+ ye && /* @__PURE__ */ (() => {
1263
+ const p = z ? "Restart paused session" : S === "disconnected" ? "Reconnect to agent" : "Start video call", Y = z ? "Pick up where you left off" : null;
1258
1264
  return /* @__PURE__ */ _(ht, { children: [
1259
1265
  S === "idle" && !z && !H && /* @__PURE__ */ _(
1260
1266
  "button",
@@ -1271,7 +1277,7 @@ const Vn = ({
1271
1277
  ),
1272
1278
  /* @__PURE__ */ _("div", { className: "ll-expanded__bottom ll-expanded__bottom--idle", children: [
1273
1279
  l && /* @__PURE__ */ n("div", { className: "ll-expanded__transcript", children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: l }) }),
1274
- X && /* @__PURE__ */ n("p", { className: "ll-expanded__cta-sublabel", children: X }),
1280
+ Y && /* @__PURE__ */ n("p", { className: "ll-expanded__cta-sublabel", children: Y }),
1275
1281
  /* @__PURE__ */ n(
1276
1282
  "button",
1277
1283
  {
@@ -1288,53 +1294,61 @@ const Vn = ({
1288
1294
  /* @__PURE__ */ _(
1289
1295
  "div",
1290
1296
  {
1291
- className: `ll-expanded__pip ${Ce && (D || Y) ? "is-visible" : ""}`,
1297
+ className: `ll-expanded__pip ${Ee && (D || G) ? "is-visible" : ""}`,
1292
1298
  children: [
1293
1299
  /* @__PURE__ */ n(
1294
1300
  "div",
1295
1301
  {
1296
- ref: ie,
1297
- className: Y ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
1302
+ ref: ne,
1303
+ className: G ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
1298
1304
  }
1299
1305
  ),
1300
1306
  /* @__PURE__ */ n(
1301
1307
  "div",
1302
1308
  {
1303
- ref: re,
1304
- className: !Y && D ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
1309
+ ref: Ae,
1310
+ className: !G && D ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
1305
1311
  }
1306
1312
  )
1307
1313
  ]
1308
1314
  }
1309
1315
  ),
1310
- Ce ? /* @__PURE__ */ _("div", { className: "ll-expanded__bottom", children: [
1311
- Xe && /* @__PURE__ */ n(
1316
+ Ee ? /* @__PURE__ */ _("div", { className: "ll-expanded__bottom", children: [
1317
+ Ze && /* @__PURE__ */ n(
1312
1318
  "div",
1313
1319
  {
1314
- className: `ll-expanded__transcript${ct ? " ll-expanded__transcript--agent" : ""}`,
1315
- "data-role": K ? (Q == null ? void 0 : Q.role) ?? "agent" : "agent",
1316
- children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: Xe })
1320
+ className: "ll-expanded__transcript ll-expanded__transcript--agent",
1321
+ "data-role": "agent",
1322
+ children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: Ze })
1323
+ }
1324
+ ),
1325
+ Me && /* @__PURE__ */ n(
1326
+ "div",
1327
+ {
1328
+ className: "ll-expanded__transcript ll-expanded__transcript--user",
1329
+ "data-role": "user",
1330
+ children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: Me })
1317
1331
  }
1318
1332
  ),
1319
1333
  /* @__PURE__ */ _("div", { className: "ll-toolbar", onClick: (p) => p.stopPropagation(), children: [
1320
- Ve && /* @__PURE__ */ n(
1334
+ Ye && /* @__PURE__ */ n(
1321
1335
  "button",
1322
1336
  {
1323
1337
  type: "button",
1324
- className: `ll-tool ${Y ? "is-on" : ""}`,
1338
+ className: `ll-tool ${G ? "is-on" : ""}`,
1325
1339
  onClick: V,
1326
- "aria-label": Y ? "Stop sharing screen" : "Share screen",
1327
- title: Y ? "Stop sharing" : "Share screen",
1340
+ "aria-label": G ? "Stop sharing screen" : "Share screen",
1341
+ title: G ? "Stop sharing" : "Share screen",
1328
1342
  children: /* @__PURE__ */ n(Xn, {})
1329
1343
  }
1330
1344
  ),
1331
- je && /* @__PURE__ */ _("div", { className: "ll-tool-split", children: [
1345
+ Ve && /* @__PURE__ */ _("div", { className: "ll-tool-split", children: [
1332
1346
  /* @__PURE__ */ n(
1333
1347
  "button",
1334
1348
  {
1335
1349
  type: "button",
1336
1350
  className: `ll-tool ll-tool--left ${D ? "is-on" : ""}`,
1337
- onClick: Le,
1351
+ onClick: Se,
1338
1352
  "aria-label": D ? "Turn off camera" : "Turn on camera",
1339
1353
  title: D ? "Stop camera" : "Start camera",
1340
1354
  children: /* @__PURE__ */ n(Qn, {})
@@ -1346,22 +1360,22 @@ const Vn = ({
1346
1360
  type: "button",
1347
1361
  className: `ll-tool ll-tool--right ${D ? "is-on" : ""}`,
1348
1362
  onClick: (p) => {
1349
- p.stopPropagation(), ue((X) => !X), de(!1);
1363
+ p.stopPropagation(), Re((Y) => !Y), oe(!1);
1350
1364
  },
1351
1365
  "aria-label": "Camera devices",
1352
1366
  "aria-haspopup": "listbox",
1353
- "aria-expanded": Ne,
1354
- children: /* @__PURE__ */ n(nt, {})
1367
+ "aria-expanded": de,
1368
+ children: /* @__PURE__ */ n(rt, {})
1355
1369
  }
1356
1370
  ),
1357
- Ne && O.length > 0 && /* @__PURE__ */ n(
1371
+ de && O.length > 0 && /* @__PURE__ */ n(
1358
1372
  Wt,
1359
1373
  {
1360
1374
  label: "Camera",
1361
1375
  devices: O,
1362
1376
  activeId: W,
1363
1377
  onPick: (p) => {
1364
- ue(!1), Se(p);
1378
+ Re(!1), Ce(p);
1365
1379
  }
1366
1380
  }
1367
1381
  )
@@ -1372,7 +1386,7 @@ const Vn = ({
1372
1386
  {
1373
1387
  type: "button",
1374
1388
  className: `ll-tool ll-tool--left ${h ? "is-muted" : ""}`,
1375
- onClick: ke,
1389
+ onClick: Le,
1376
1390
  "aria-label": h ? "Unmute microphone" : "Mute microphone",
1377
1391
  title: h ? "Unmute" : "Mute",
1378
1392
  children: /* @__PURE__ */ n(Zn, { muted: h })
@@ -1384,21 +1398,21 @@ const Vn = ({
1384
1398
  type: "button",
1385
1399
  className: `ll-tool ll-tool--right ${h ? "is-muted" : ""}`,
1386
1400
  onClick: (p) => {
1387
- p.stopPropagation(), de((X) => !X), ue(!1);
1401
+ p.stopPropagation(), oe((Y) => !Y), Re(!1);
1388
1402
  },
1389
1403
  "aria-label": "Microphone devices",
1390
1404
  "aria-haspopup": "listbox",
1391
- "aria-expanded": le,
1392
- children: /* @__PURE__ */ n(nt, {})
1405
+ "aria-expanded": ee,
1406
+ children: /* @__PURE__ */ n(rt, {})
1393
1407
  }
1394
1408
  ),
1395
- le && q.length > 0 && /* @__PURE__ */ n(
1409
+ ee && q.length > 0 && /* @__PURE__ */ n(
1396
1410
  Wt,
1397
1411
  {
1398
1412
  label: "Microphone",
1399
1413
  devices: q,
1400
1414
  activeId: "",
1401
- onPick: () => de(!1)
1415
+ onPick: () => oe(!1)
1402
1416
  }
1403
1417
  )
1404
1418
  ] }),
@@ -1407,7 +1421,7 @@ const Vn = ({
1407
1421
  {
1408
1422
  type: "button",
1409
1423
  className: `ll-tool ${me ? "is-muted" : ""}`,
1410
- onClick: at,
1424
+ onClick: st,
1411
1425
  "aria-label": me ? "Unmute speaker" : "Mute speaker",
1412
1426
  title: me ? "Unmute speaker" : "Mute speaker",
1413
1427
  children: /* @__PURE__ */ n(er, { muted: me })
@@ -1418,26 +1432,26 @@ const Vn = ({
1418
1432
  {
1419
1433
  type: "button",
1420
1434
  className: "ll-tool ll-tool--danger",
1421
- onClick: we,
1435
+ onClick: _e,
1422
1436
  "aria-label": "End conversation",
1423
1437
  title: "End conversation",
1424
1438
  children: /* @__PURE__ */ n(nr, {})
1425
1439
  }
1426
1440
  )
1427
1441
  ] }),
1428
- Ye && /* @__PURE__ */ _("form", { className: "ll-message-input", onSubmit: ze, children: [
1442
+ Ge && /* @__PURE__ */ _("form", { className: "ll-message-input", onSubmit: Qe, children: [
1429
1443
  /* @__PURE__ */ n(
1430
1444
  "input",
1431
1445
  {
1432
1446
  type: "text",
1433
1447
  className: "ll-message-input__field",
1434
1448
  placeholder: "Message...",
1435
- value: fe,
1436
- onChange: (p) => $e(p.target.value),
1449
+ value: ue,
1450
+ onChange: (p) => Ie(p.target.value),
1437
1451
  "aria-label": "Message the agent"
1438
1452
  }
1439
1453
  ),
1440
- fe.trim() && /* @__PURE__ */ n(
1454
+ ue.trim() && /* @__PURE__ */ n(
1441
1455
  "button",
1442
1456
  {
1443
1457
  type: "submit",
@@ -1457,14 +1471,14 @@ const Vn = ({
1457
1471
  {
1458
1472
  type: "button",
1459
1473
  className: "ll-expanded__banner-x",
1460
- onClick: Pe,
1474
+ onClick: Oe,
1461
1475
  "aria-label": "Dismiss",
1462
1476
  children: "×"
1463
1477
  }
1464
1478
  )
1465
1479
  ] });
1466
1480
  if (!H || S !== "error") return null;
1467
- let p = "Failed to connect", X = "Try again";
1481
+ let p = "Failed to connect", Y = "Try again";
1468
1482
  return H === "MIC_PERMISSION_DENIED" ? p = "Microphone blocked. Allow access to talk." : H === "MIC_NOT_FOUND" ? p = "No microphone found. Plug one in + retry." : H === "MIC_UNAVAILABLE" ? p = "Mic unavailable. Check other apps using it." : H === "AGENT_TIMEOUT" ? p = "Agent didn't pick up. Try again." : H === "CONNECT_FAILED" ? p = "Connection failed. Check your network." : H.length < 80 && (p = H), /* @__PURE__ */ _("div", { className: "ll-expanded__banner ll-expanded__banner--error", role: "alert", children: [
1469
1483
  /* @__PURE__ */ n("span", { children: p }),
1470
1484
  /* @__PURE__ */ n(
@@ -1472,8 +1486,8 @@ const Vn = ({
1472
1486
  {
1473
1487
  type: "button",
1474
1488
  className: "ll-expanded__banner-retry",
1475
- onClick: _e,
1476
- children: X
1489
+ onClick: xe,
1490
+ children: Y
1477
1491
  }
1478
1492
  )
1479
1493
  ] });
@@ -1482,7 +1496,7 @@ const Vn = ({
1482
1496
  }
1483
1497
  );
1484
1498
  };
1485
- function nt() {
1499
+ function rt() {
1486
1500
  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" }) });
1487
1501
  }
1488
1502
  function Bt() {
@@ -1539,30 +1553,30 @@ function nr() {
1539
1553
  }
1540
1554
  ) });
1541
1555
  }
1542
- const Wt = ({ label: e, devices: t, activeId: r, onPick: o }) => /* @__PURE__ */ _(
1556
+ const Wt = ({ label: e, devices: t, activeId: r, onPick: i }) => /* @__PURE__ */ _(
1543
1557
  "div",
1544
1558
  {
1545
1559
  className: "ll-device-menu",
1546
- onClick: (i) => i.stopPropagation(),
1560
+ onClick: (o) => o.stopPropagation(),
1547
1561
  role: "listbox",
1548
1562
  children: [
1549
1563
  /* @__PURE__ */ n("p", { className: "ll-device-menu__label", children: e }),
1550
- t.map((i, l) => {
1551
- const s = r === i.deviceId;
1564
+ t.map((o, l) => {
1565
+ const c = r === o.deviceId;
1552
1566
  return /* @__PURE__ */ _(
1553
1567
  "button",
1554
1568
  {
1555
1569
  type: "button",
1556
- className: `ll-device-menu__item ${s ? "is-active" : ""}`,
1557
- onClick: () => o(i.deviceId),
1570
+ className: `ll-device-menu__item ${c ? "is-active" : ""}`,
1571
+ onClick: () => i(o.deviceId),
1558
1572
  role: "option",
1559
- "aria-selected": s,
1573
+ "aria-selected": c,
1560
1574
  children: [
1561
- s && /* @__PURE__ */ n("span", { className: "ll-device-menu__dot", children: "●" }),
1562
- /* @__PURE__ */ n("span", { className: "ll-device-menu__name", children: i.label || `${e} ${l + 1}` })
1575
+ c && /* @__PURE__ */ n("span", { className: "ll-device-menu__dot", children: "●" }),
1576
+ /* @__PURE__ */ n("span", { className: "ll-device-menu__name", children: o.label || `${e} ${l + 1}` })
1563
1577
  ]
1564
1578
  },
1565
- i.deviceId || l
1579
+ o.deviceId || l
1566
1580
  );
1567
1581
  })
1568
1582
  ]
@@ -1580,7 +1594,7 @@ function gt(e) {
1580
1594
  }
1581
1595
  return !1;
1582
1596
  }
1583
- function lt(e) {
1597
+ function at(e) {
1584
1598
  if (gt(e)) return !1;
1585
1599
  if (e instanceof HTMLInputElement) {
1586
1600
  if (e.type === "password") return !1;
@@ -1589,7 +1603,7 @@ function lt(e) {
1589
1603
  }
1590
1604
  return !0;
1591
1605
  }
1592
- const rt = 4096, or = 20, ir = 20, lr = 10, ar = 10, cr = 30, Ft = 500, sr = [
1606
+ const it = 4096, ir = 20, or = 20, lr = 10, ar = 10, sr = 30, Ft = 500, cr = [
1593
1607
  '[data-ll-private="true"]',
1594
1608
  ".ll-widget",
1595
1609
  "script",
@@ -1597,22 +1611,22 @@ const rt = 4096, or = 20, ir = 20, lr = 10, ar = 10, cr = 30, Ft = 500, sr = [
1597
1611
  "noscript",
1598
1612
  "iframe"
1599
1613
  ];
1600
- function Fe(e) {
1614
+ function Ue(e) {
1601
1615
  if (e.getAttribute("aria-hidden") === "true" || e.hasAttribute("hidden")) return !0;
1602
1616
  let t = e;
1603
1617
  for (; t; ) {
1604
- for (const r of sr)
1618
+ for (const r of cr)
1605
1619
  if (t.matches(r)) return !0;
1606
1620
  t = t.parentElement;
1607
1621
  }
1608
1622
  return !1;
1609
1623
  }
1610
- function Ue(e) {
1624
+ function je(e) {
1611
1625
  if (typeof window > "u") return !0;
1612
1626
  const t = e.getBoundingClientRect();
1613
1627
  if (t.width <= 0 || t.height <= 0) return !1;
1614
- const r = window.innerHeight || document.documentElement.clientHeight, o = window.innerWidth || document.documentElement.clientWidth;
1615
- return t.bottom > 0 && t.right > 0 && t.top < r && t.left < o;
1628
+ const r = window.innerHeight || document.documentElement.clientHeight, i = window.innerWidth || document.documentElement.clientWidth;
1629
+ return t.bottom > 0 && t.right > 0 && t.top < r && t.left < i;
1616
1630
  }
1617
1631
  function Ut(e) {
1618
1632
  const t = e.getAttribute("id");
@@ -1622,15 +1636,15 @@ function Ut(e) {
1622
1636
  }
1623
1637
  const r = e.getAttribute("aria-label");
1624
1638
  if (r) return r.trim();
1625
- const o = e.getAttribute("placeholder");
1626
- if (o) return o.trim();
1627
- const i = e.closest("label");
1628
- return i != null && i.textContent ? i.textContent.trim() : "";
1639
+ const i = e.getAttribute("placeholder");
1640
+ if (i) return i.trim();
1641
+ const o = e.closest("label");
1642
+ return o != null && o.textContent ? o.textContent.trim() : "";
1629
1643
  }
1630
- function be(e, t) {
1644
+ function we(e, t) {
1631
1645
  return e.length <= t ? e : e.slice(0, t - 1) + "…";
1632
1646
  }
1633
- function Ie(e) {
1647
+ function $e(e) {
1634
1648
  return e.length;
1635
1649
  }
1636
1650
  function dr(e, t = {}) {
@@ -1647,13 +1661,13 @@ function dr(e, t = {}) {
1647
1661
  forms: [],
1648
1662
  extras: e
1649
1663
  };
1650
- const o = typeof window < "u" && window.location.href || "", i = typeof window < "u" && window.location.pathname || "/", l = r.title || "", s = Array.from(
1664
+ const i = typeof window < "u" && window.location.href || "", o = typeof window < "u" && window.location.pathname || "/", l = r.title || "", c = Array.from(
1651
1665
  r.querySelectorAll("[data-ll-region]")
1652
1666
  ), d = [];
1653
- for (const h of s) {
1667
+ for (const h of c) {
1654
1668
  if (d.length >= lr) break;
1655
- if (Fe(h) || !Ue(h)) continue;
1656
- const N = h.getAttribute("data-ll-region") ?? "", q = h.getAttribute("data-ll-intent") ?? void 0, D = be(
1669
+ if (Ue(h) || !je(h)) continue;
1670
+ const N = h.getAttribute("data-ll-region") ?? "", q = h.getAttribute("data-ll-intent") ?? void 0, D = we(
1657
1671
  (h.innerText || h.textContent || "").trim(),
1658
1672
  Ft * 2
1659
1673
  );
@@ -1663,23 +1677,23 @@ function dr(e, t = {}) {
1663
1677
  r.querySelectorAll("h1, h2, h3, h4, h5, h6")
1664
1678
  );
1665
1679
  for (const h of g) {
1666
- if (Fe(h) || !Ue(h)) continue;
1680
+ if (Ue(h) || !je(h)) continue;
1667
1681
  const N = (h.textContent || "").trim();
1668
- N && f.push(`${h.tagName}: ${be(N, 200)}`);
1682
+ N && f.push(`${h.tagName}: ${we(N, 200)}`);
1669
1683
  }
1670
1684
  const a = Array.from(r.querySelectorAll("p, li"));
1671
1685
  for (const h of a) {
1672
- if (Fe(h) || !Ue(h) || y.includes(h.tagName)) continue;
1686
+ if (Ue(h) || !je(h) || y.includes(h.tagName)) continue;
1673
1687
  const N = (h.textContent || "").trim();
1674
- N.length > 10 && f.push(be(N, Ft));
1688
+ N.length > 10 && f.push(we(N, Ft));
1675
1689
  }
1676
- const c = f.join(`
1690
+ const s = f.join(`
1677
1691
  `), I = [], C = Array.from(r.querySelectorAll("a[href]"));
1678
1692
  for (const h of C) {
1679
- if (I.length >= or) break;
1680
- if (Fe(h) || !Ue(h)) continue;
1693
+ if (I.length >= ir) break;
1694
+ if (Ue(h) || !je(h)) continue;
1681
1695
  const N = h.getAttribute("href") || "", q = (h.textContent || "").trim();
1682
- !N || !q || I.push({ href: N, text: be(q, 100) });
1696
+ !N || !q || I.push({ href: N, text: we(q, 100) });
1683
1697
  }
1684
1698
  const S = [], v = Array.from(
1685
1699
  r.querySelectorAll(
@@ -1687,10 +1701,10 @@ function dr(e, t = {}) {
1687
1701
  )
1688
1702
  );
1689
1703
  for (const h of v) {
1690
- if (S.length >= ir) break;
1691
- if (Fe(h) || !lt(h) || !Ue(h)) continue;
1704
+ if (S.length >= or) break;
1705
+ if (Ue(h) || !at(h) || !je(h)) continue;
1692
1706
  const N = Ut(h), q = h instanceof HTMLInputElement ? h.type : h.tagName.toLowerCase();
1693
- N && S.push({ label: be(N, 100), type: q });
1707
+ N && S.push({ label: we(N, 100), type: q });
1694
1708
  }
1695
1709
  const b = Array.from(
1696
1710
  r.querySelectorAll("[data-ll-form]")
@@ -1706,43 +1720,43 @@ function dr(e, t = {}) {
1706
1720
  )
1707
1721
  ), A = [];
1708
1722
  for (const O of D) {
1709
- if (A.length >= cr) break;
1710
- if (!lt(O)) continue;
1723
+ if (A.length >= sr) break;
1724
+ if (!at(O)) continue;
1711
1725
  const W = O.getAttribute("data-ll-field") || "";
1712
1726
  if (!W) continue;
1713
- const Y = Ut(O) || W, ne = O instanceof HTMLInputElement ? O.type : O.tagName.toLowerCase();
1714
- A.push({ name: W, label: be(Y, 100), type: ne });
1727
+ const G = Ut(O) || W, te = O instanceof HTMLInputElement ? O.type : O.tagName.toLowerCase();
1728
+ A.push({ name: W, label: we(G, 100), type: te });
1715
1729
  }
1716
1730
  z.push({ id: N, intent: q, fields: A });
1717
1731
  }
1718
1732
  const M = {
1719
- url: o,
1733
+ url: i,
1720
1734
  title: l,
1721
- pathname: i,
1735
+ pathname: o,
1722
1736
  regions: d,
1723
- visibleText: c,
1737
+ visibleText: s,
1724
1738
  visibleLinks: I,
1725
1739
  visibleFields: S,
1726
1740
  forms: z,
1727
1741
  extras: e
1728
1742
  };
1729
- let H = Ie(JSON.stringify(M.regions)) + Ie(M.visibleText) + Ie(JSON.stringify(M.visibleLinks)) + Ie(JSON.stringify(M.visibleFields));
1730
- for (; H > rt && M.visibleFields.length > 0; )
1731
- M.visibleFields.pop(), H = Ie(JSON.stringify(M.visibleFields));
1732
- for (; H > rt && M.visibleLinks.length > 0; )
1743
+ let H = $e(JSON.stringify(M.regions)) + $e(M.visibleText) + $e(JSON.stringify(M.visibleLinks)) + $e(JSON.stringify(M.visibleFields));
1744
+ for (; H > it && M.visibleFields.length > 0; )
1745
+ M.visibleFields.pop(), H = $e(JSON.stringify(M.visibleFields));
1746
+ for (; H > it && M.visibleLinks.length > 0; )
1733
1747
  M.visibleLinks.pop(), H -= 80;
1734
- return Ie(M.visibleText) > rt && (M.visibleText = be(M.visibleText, rt - 100)), M;
1748
+ return $e(M.visibleText) > it && (M.visibleText = we(M.visibleText, it - 100)), M;
1735
1749
  }
1736
- let Me = null;
1750
+ let ze = null;
1737
1751
  function jt(e, t = {}) {
1738
- const r = Date.now(), i = `${typeof window < "u" && window.location.pathname || "/"}::${typeof window < "u" ? window.scrollY : 0}`;
1739
- if (Me && Me.key === i && r - Me.at < 1e3)
1740
- return Me.ctx;
1752
+ const r = Date.now(), o = `${typeof window < "u" && window.location.pathname || "/"}::${typeof window < "u" ? window.scrollY : 0}`;
1753
+ if (ze && ze.key === o && r - ze.at < 1e3)
1754
+ return ze.ctx;
1741
1755
  const l = dr(e, t);
1742
- return Me = { key: i, at: r, ctx: l }, l;
1756
+ return ze = { key: o, at: r, ctx: l }, l;
1743
1757
  }
1744
1758
  function ur() {
1745
- Me = null;
1759
+ ze = null;
1746
1760
  }
1747
1761
  const fr = 200;
1748
1762
  function pr(e) {
@@ -1761,11 +1775,11 @@ function hr(e) {
1761
1775
  function mr(e) {
1762
1776
  const t = e ?? (typeof document < "u" ? document : null);
1763
1777
  if (!t) return [];
1764
- const r = typeof window < "u" && window.location.origin || "", o = /* @__PURE__ */ new Set(), i = [], l = Array.from(t.querySelectorAll("a[href]"));
1765
- for (const s of l) {
1766
- if (i.length >= fr) break;
1767
- if (gt(s)) continue;
1768
- const d = s.getAttribute("href") || "";
1778
+ const r = typeof window < "u" && window.location.origin || "", i = /* @__PURE__ */ new Set(), o = [], l = Array.from(t.querySelectorAll("a[href]"));
1779
+ for (const c of l) {
1780
+ if (o.length >= fr) break;
1781
+ if (gt(c)) continue;
1782
+ const d = c.getAttribute("href") || "";
1769
1783
  if (!hr(d)) continue;
1770
1784
  let f = d, y = !0;
1771
1785
  try {
@@ -1776,40 +1790,40 @@ function mr(e) {
1776
1790
  } catch {
1777
1791
  continue;
1778
1792
  }
1779
- if (o.has(f)) continue;
1780
- o.add(f);
1781
- const g = (s.textContent || "").trim().slice(0, 120);
1782
- i.push({ href: f, text: g, internal: y });
1793
+ if (i.has(f)) continue;
1794
+ i.add(f);
1795
+ const g = (c.textContent || "").trim().slice(0, 120);
1796
+ o.push({ href: f, text: g, internal: y });
1783
1797
  }
1784
- return i;
1798
+ return o;
1785
1799
  }
1786
- let Te = null;
1800
+ let He = null;
1787
1801
  const gr = 5e3;
1788
1802
  function ft() {
1789
1803
  const e = Date.now(), t = typeof window < "u" && window.location.pathname || "/";
1790
- if (Te && Te.pathname === t && e - Te.at < gr)
1791
- return Te.routes;
1804
+ if (He && He.pathname === t && e - He.at < gr)
1805
+ return He.routes;
1792
1806
  const r = mr();
1793
- return Te = { at: e, pathname: t, routes: r }, r;
1807
+ return He = { at: e, pathname: t, routes: r }, r;
1794
1808
  }
1795
1809
  function yr() {
1796
- Te = null;
1810
+ He = null;
1797
1811
  }
1798
1812
  function vr(e, t) {
1799
- 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;
1800
- i ? i.call(e, t) : e.value = t;
1813
+ 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;
1814
+ o ? o.call(e, t) : e.value = t;
1801
1815
  }
1802
1816
  function br(e, t, r = {}) {
1803
- const o = r.triggerInput ?? !0, i = r.triggerChange ?? !0;
1817
+ const i = r.triggerInput ?? !0, o = r.triggerChange ?? !0;
1804
1818
  if (e instanceof HTMLInputElement && (e.type === "checkbox" || e.type === "radio")) {
1805
1819
  const l = Object.getOwnPropertyDescriptor(
1806
1820
  HTMLInputElement.prototype,
1807
1821
  "checked"
1808
- ), s = l == null ? void 0 : l.set, d = t === "true" || t === "1" || t === "on";
1809
- s ? s.call(e, d) : e.checked = d, o && e.dispatchEvent(new Event("input", { bubbles: !0 })), i && e.dispatchEvent(new Event("change", { bubbles: !0 }));
1822
+ ), c = l == null ? void 0 : l.set, d = t === "true" || t === "1" || t === "on";
1823
+ c ? c.call(e, d) : e.checked = d, i && e.dispatchEvent(new Event("input", { bubbles: !0 })), o && e.dispatchEvent(new Event("change", { bubbles: !0 }));
1810
1824
  return;
1811
1825
  }
1812
- vr(e, t), o && e.dispatchEvent(new Event("input", { bubbles: !0 })), i && e.dispatchEvent(new Event("change", { bubbles: !0 }));
1826
+ vr(e, t), i && e.dispatchEvent(new Event("input", { bubbles: !0 })), o && e.dispatchEvent(new Event("change", { bubbles: !0 }));
1813
1827
  }
1814
1828
  function wr() {
1815
1829
  if (typeof window > "u" || typeof document > "u")
@@ -1830,12 +1844,12 @@ function xr() {
1830
1844
  document.querySelectorAll("body, body *")
1831
1845
  );
1832
1846
  let t = null, r = 0;
1833
- for (const o of e) {
1834
- if (!_r(o)) continue;
1835
- const i = o.getBoundingClientRect();
1836
- 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;
1837
- const l = i.width * i.height;
1838
- l > r && (r = l, t = o);
1847
+ for (const i of e) {
1848
+ if (!_r(i)) continue;
1849
+ const o = i.getBoundingClientRect();
1850
+ 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;
1851
+ const l = o.width * o.height;
1852
+ l > r && (r = l, t = i);
1839
1853
  }
1840
1854
  return t;
1841
1855
  }
@@ -1884,16 +1898,16 @@ function Cr(e) {
1884
1898
  const {
1885
1899
  agentId: t,
1886
1900
  apiKey: r,
1887
- baseUrl: o = "https://app.livelayer.studio",
1888
- sessionEndpoint: i,
1901
+ baseUrl: i = "https://app.livelayer.studio",
1902
+ sessionEndpoint: o,
1889
1903
  sessionBody: l,
1890
- autoConnect: s = !1,
1904
+ autoConnect: c = !1,
1891
1905
  displayMode: d,
1892
1906
  defaultDisplayMode: f = "expanded",
1893
1907
  onDisplayModeChange: y,
1894
1908
  position: g = "bottom-right",
1895
1909
  mobileBreakpoint: a = 640,
1896
- persistKey: c = "ll-widget",
1910
+ persistKey: s = "ll-widget",
1897
1911
  disablePersistence: I = !1,
1898
1912
  teamMembers: C,
1899
1913
  currentTeamMemberId: S,
@@ -1909,43 +1923,43 @@ function Cr(e) {
1909
1923
  showOn: A,
1910
1924
  hideOn: O,
1911
1925
  pathname: W,
1912
- onNavigate: Y,
1913
- onScrollToSelector: ne,
1926
+ onNavigate: G,
1927
+ onScrollToSelector: te,
1914
1928
  getPageContext: me,
1915
- pageContextExtras: je,
1916
- getRoutes: Ve,
1917
- onScrollPage: Ye,
1918
- onClick: Ge,
1919
- capabilities: te,
1929
+ pageContextExtras: Ve,
1930
+ getRoutes: Ye,
1931
+ onScrollPage: Ge,
1932
+ onClick: Je,
1933
+ capabilities: Z,
1920
1934
  onConnect: ge,
1921
- onDisconnect: we,
1922
- onTranscript: _e,
1923
- onAgentState: xe,
1924
- onConnectionStateChange: ke,
1925
- onAgentEvent: Le,
1926
- onAgentCommand: Se,
1935
+ onDisconnect: _e,
1936
+ onTranscript: xe,
1937
+ onAgentState: ke,
1938
+ onConnectionStateChange: Le,
1939
+ onAgentEvent: Se,
1940
+ onAgentCommand: Ce,
1927
1941
  controlledSession: V,
1928
- className: at,
1929
- style: Je,
1930
- zIndex: Ke = 2147483647
1931
- } = e, se = Tn(W), Pe = Bn(se, A, O);
1942
+ className: st,
1943
+ style: Ke,
1944
+ zIndex: Xe = 2147483647
1945
+ } = e, ce = Tn(W), Oe = Bn(ce, A, O);
1932
1946
  R(() => {
1933
1947
  ur(), yr();
1934
- }, [se]);
1935
- const Q = S !== void 0, [ye, Ce] = L(() => {
1948
+ }, [ce]);
1949
+ const se = S !== void 0, [Ee, re] = L(() => {
1936
1950
  var m;
1937
1951
  return S ?? ((m = C == null ? void 0 : C[0]) == null ? void 0 : m.id);
1938
- }), K = Q ? S : ye, Z = ot(
1939
- () => (C == null ? void 0 : C.find((m) => m.id === K)) ?? null,
1940
- [C, K]
1941
- ), Ee = (Z == null ? void 0 : Z.agentId) ?? t, [oe, ce] = An({
1952
+ }), ye = se ? S : Ee, J = ot(
1953
+ () => (C == null ? void 0 : C.find((m) => m.id === ye)) ?? null,
1954
+ [C, ye]
1955
+ ), ve = (J == null ? void 0 : J.agentId) ?? t, [be, ie] = An({
1942
1956
  value: d,
1943
1957
  defaultValue: f,
1944
1958
  onChange: y,
1945
- persistKey: c,
1959
+ persistKey: s,
1946
1960
  disablePersistence: I
1947
- }), ve = In(a), De = yn(), re = vn(), ie = wn(), le = _n(), de = xn(), [Ne, ue] = L(!1), [fe, $e] = L(!1), [ze, He] = L(!1), [Xe, ct] = L(!1), [Oe, Qe] = L(!1), p = E(Y), X = E(ne), Ze = E(Ye), st = E(Ge), yt = E(me), vt = E(je), bt = E(Ve), dt = E(te), ae = E(null);
1948
- p.current = Y, X.current = ne, Ze.current = Ye, st.current = Ge, yt.current = me, vt.current = je, bt.current = Ve, dt.current = te;
1961
+ }), Ne = In(a), Ae = yn(), ne = vn(), ee = wn(), oe = _n(), de = xn(), [Re, ue] = L(!1), [Ie, Qe] = L(!1), [Be, le] = L(!1), [fe, Ze] = L(!1), [Me, ct] = L(!1), Te = E(G), p = E(te), Y = E(Ge), et = E(Je), yt = E(me), vt = E(Ve), bt = E(Ye), dt = E(Z), ae = E(null);
1962
+ Te.current = G, p.current = te, Y.current = Ge, et.current = Je, yt.current = me, vt.current = Ve, bt.current = Ye, dt.current = Z;
1949
1963
  function pe(m) {
1950
1964
  const u = dt.current;
1951
1965
  return u ? u.includes(m) : !0;
@@ -1955,12 +1969,12 @@ function Cr(e) {
1955
1969
  `[LiveLayer] Agent command "${m}" blocked — capability "${u}" not in allowlist. See https://livelayer.studio/docs/react/capabilities`
1956
1970
  );
1957
1971
  }
1958
- const Be = k(
1972
+ const qe = k(
1959
1973
  (m) => {
1960
- var G, Ae, tt, Rt;
1974
+ var K, Pe, nt, Rt;
1961
1975
  const u = m;
1962
1976
  if (!(!u.type || typeof u.type != "string")) {
1963
- if (Le == null || Le({ eventName: u.type, data: m }), u.type === "navigate") {
1977
+ if (Se == null || Se({ eventName: u.type, data: m }), u.type === "navigate") {
1964
1978
  if (!pe("navigate")) {
1965
1979
  he("navigate", "navigate");
1966
1980
  return;
@@ -1972,9 +1986,9 @@ function Cr(e) {
1972
1986
  );
1973
1987
  return;
1974
1988
  }
1975
- if (p.current) {
1989
+ if (Te.current) {
1976
1990
  try {
1977
- p.current(x);
1991
+ Te.current(x);
1978
1992
  } catch (T) {
1979
1993
  console.warn(
1980
1994
  `[LiveLayer] onNavigate threw for "${x}". Falling back. Error:`,
@@ -2011,9 +2025,9 @@ function Cr(e) {
2011
2025
  const x = typeof u.selector == "string" ? u.selector : null;
2012
2026
  if (!x) return;
2013
2027
  const T = u.behavior === "instant" ? "instant" : "smooth";
2014
- if (X.current) {
2028
+ if (p.current) {
2015
2029
  try {
2016
- X.current(
2030
+ p.current(
2017
2031
  x,
2018
2032
  T
2019
2033
  );
@@ -2050,14 +2064,14 @@ function Cr(e) {
2050
2064
  he("request_page_context", "read_page");
2051
2065
  return;
2052
2066
  }
2053
- const x = typeof u.requestId == "string" ? u.requestId : void 0, T = (G = ae.current) == null ? void 0 : G.call(ae), B = (j) => {
2054
- const P = T, J = P == null ? void 0 : P.localParticipant;
2055
- if (J != null && J.publishData)
2067
+ const x = typeof u.requestId == "string" ? u.requestId : void 0, T = (K = ae.current) == null ? void 0 : K.call(ae), B = (j) => {
2068
+ const P = T, X = P == null ? void 0 : P.localParticipant;
2069
+ if (X != null && X.publishData)
2056
2070
  try {
2057
- const ee = x ? { ...j, requestId: x } : j, Re = new TextEncoder().encode(JSON.stringify(ee));
2058
- J.publishData(Re, { reliable: !0 });
2059
- } catch (ee) {
2060
- console.warn("[LiveLayer] publishData failed.", ee);
2071
+ const Q = x ? { ...j, requestId: x } : j, De = new TextEncoder().encode(JSON.stringify(Q));
2072
+ X.publishData(De, { reliable: !0 });
2073
+ } catch (Q) {
2074
+ console.warn("[LiveLayer] publishData failed.", Q);
2061
2075
  }
2062
2076
  }, $ = vt.current, F = yt.current;
2063
2077
  try {
@@ -2106,9 +2120,9 @@ function Cr(e) {
2106
2120
  return;
2107
2121
  }
2108
2122
  const T = u.behavior === "instant" ? "instant" : "smooth";
2109
- if (Ze.current) {
2123
+ if (Y.current) {
2110
2124
  try {
2111
- Ze.current(
2125
+ Y.current(
2112
2126
  x,
2113
2127
  T
2114
2128
  );
@@ -2136,9 +2150,9 @@ function Cr(e) {
2136
2150
  console.warn("[LiveLayer] click: missing selector.");
2137
2151
  return;
2138
2152
  }
2139
- if (st.current) {
2153
+ if (et.current) {
2140
2154
  try {
2141
- st.current(x);
2155
+ et.current(x);
2142
2156
  } catch (B) {
2143
2157
  console.warn("[LiveLayer] onClick threw.", B);
2144
2158
  }
@@ -2166,7 +2180,7 @@ function Cr(e) {
2166
2180
  );
2167
2181
  return;
2168
2182
  }
2169
- (Ae = T.click) == null || Ae.call(T);
2183
+ (Pe = T.click) == null || Pe.call(T);
2170
2184
  return;
2171
2185
  }
2172
2186
  if (u.type === "fill_form" || u.type === "focus_field") {
@@ -2208,7 +2222,7 @@ function Cr(e) {
2208
2222
  );
2209
2223
  return;
2210
2224
  }
2211
- if (!lt(F)) {
2225
+ if (!at(F)) {
2212
2226
  console.warn(
2213
2227
  `[LiveLayer] focus_field: field "${$}" is privacy-protected and not focusable.`
2214
2228
  );
@@ -2231,7 +2245,7 @@ function Cr(e) {
2231
2245
  );
2232
2246
  continue;
2233
2247
  }
2234
- if (!lt(j)) {
2248
+ if (!at(j)) {
2235
2249
  console.warn(
2236
2250
  `[LiveLayer] fill_form: field "${$}" is privacy-protected (password / cc-* / private). Skipping.`
2237
2251
  );
@@ -2274,12 +2288,12 @@ function Cr(e) {
2274
2288
  );
2275
2289
  return;
2276
2290
  }
2277
- const B = typeof u.requestId == "string" ? u.requestId : void 0, $ = (tt = ae.current) == null ? void 0 : tt.call(ae), F = (J) => {
2278
- const ee = $, Re = ee == null ? void 0 : ee.localParticipant;
2279
- if (Re != null && Re.publishData)
2291
+ const B = typeof u.requestId == "string" ? u.requestId : void 0, $ = (nt = ae.current) == null ? void 0 : nt.call(ae), F = (X) => {
2292
+ const Q = $, De = Q == null ? void 0 : Q.localParticipant;
2293
+ if (De != null && De.publishData)
2280
2294
  try {
2281
- const cn = B ? { ...J, requestId: B } : J, sn = new TextEncoder().encode(JSON.stringify(cn));
2282
- Re.publishData(sn, { reliable: !0 });
2295
+ const sn = B ? { ...X, requestId: B } : X, cn = new TextEncoder().encode(JSON.stringify(sn));
2296
+ De.publishData(cn, { reliable: !0 });
2283
2297
  } catch {
2284
2298
  }
2285
2299
  };
@@ -2290,8 +2304,8 @@ function Cr(e) {
2290
2304
  T.addEventListener("submit", P, { once: !0 });
2291
2305
  try {
2292
2306
  typeof T.requestSubmit == "function" ? T.requestSubmit() : T.submit();
2293
- } catch (J) {
2294
- console.warn("[LiveLayer] submit_form: requestSubmit threw.", J), T.removeEventListener("submit", P), F({
2307
+ } catch (X) {
2308
+ console.warn("[LiveLayer] submit_form: requestSubmit threw.", X), T.removeEventListener("submit", P), F({
2295
2309
  type: "form_submit_blocked",
2296
2310
  formId: x,
2297
2311
  reason: "exception"
@@ -2316,27 +2330,27 @@ function Cr(e) {
2316
2330
  if (!($ != null && $.publishData)) return;
2317
2331
  const F = (P) => {
2318
2332
  try {
2319
- const J = x ? { type: "routes", routes: P, requestId: x } : { type: "routes", routes: P }, ee = new TextEncoder().encode(JSON.stringify(J));
2320
- $.publishData(ee, { reliable: !0 });
2321
- } catch (J) {
2322
- console.warn("[LiveLayer] request_routes: publishData failed.", J);
2333
+ const X = x ? { type: "routes", routes: P, requestId: x } : { type: "routes", routes: P }, Q = new TextEncoder().encode(JSON.stringify(X));
2334
+ $.publishData(Q, { reliable: !0 });
2335
+ } catch (X) {
2336
+ console.warn("[LiveLayer] request_routes: publishData failed.", X);
2323
2337
  }
2324
2338
  }, j = bt.current;
2325
2339
  if (j) {
2326
2340
  try {
2327
- const P = j(), J = (ee) => {
2328
- if (!Array.isArray(ee)) {
2341
+ const P = j(), X = (Q) => {
2342
+ if (!Array.isArray(Q)) {
2329
2343
  F([]);
2330
2344
  return;
2331
2345
  }
2332
- F(ee.map(pr).slice(0, 200));
2346
+ F(Q.map(pr).slice(0, 200));
2333
2347
  };
2334
- P instanceof Promise ? P.then(J).catch((ee) => {
2348
+ P instanceof Promise ? P.then(X).catch((Q) => {
2335
2349
  console.warn(
2336
2350
  "[LiveLayer] getRoutes rejected; falling back to DOM walker.",
2337
- ee
2351
+ Q
2338
2352
  ), F(ft());
2339
- }) : J(P);
2353
+ }) : X(P);
2340
2354
  } catch (P) {
2341
2355
  console.warn(
2342
2356
  "[LiveLayer] getRoutes threw; falling back to DOM walker.",
@@ -2352,51 +2366,51 @@ function Cr(e) {
2352
2366
  }
2353
2367
  return;
2354
2368
  }
2355
- Sr.has(u.type) || Se == null || Se(u);
2369
+ Sr.has(u.type) || Ce == null || Ce(u);
2356
2370
  }
2357
2371
  },
2358
- [Se, Le]
2372
+ [Ce, Se]
2359
2373
  ), U = gn({
2360
- agentId: V ? "__controlled__" : Ee,
2361
- baseUrl: o,
2374
+ agentId: V ? "__controlled__" : ve,
2375
+ baseUrl: i,
2362
2376
  apiKey: r,
2363
- sessionEndpoint: i,
2377
+ sessionEndpoint: o,
2364
2378
  sessionBody: l,
2365
- onDataMessage: V ? void 0 : Be
2379
+ onDataMessage: V ? void 0 : qe
2366
2380
  });
2367
2381
  R(() => {
2368
2382
  if (V != null && V.subscribeToDataMessages)
2369
- return V.subscribeToDataMessages(Be);
2370
- }, [V, Be]), ae.current = () => {
2383
+ return V.subscribeToDataMessages(qe);
2384
+ }, [V, qe]), ae.current = () => {
2371
2385
  var m;
2372
2386
  return (m = U.getRoom) == null ? void 0 : m.call(U);
2373
2387
  }, R(() => {
2374
- var G;
2375
- if (!se) return;
2376
- const m = (G = U.getRoom) == null ? void 0 : G.call(U), u = m == null ? void 0 : m.localParticipant;
2388
+ var K;
2389
+ if (!ce) return;
2390
+ const m = (K = U.getRoom) == null ? void 0 : K.call(U), u = m == null ? void 0 : m.localParticipant;
2377
2391
  if (u != null && u.publishData)
2378
2392
  try {
2379
- const Ae = new TextEncoder().encode(
2380
- JSON.stringify({ type: "pathname", pathname: se })
2393
+ const Pe = new TextEncoder().encode(
2394
+ JSON.stringify({ type: "pathname", pathname: ce })
2381
2395
  );
2382
- u.publishData(Ae, { reliable: !0 });
2396
+ u.publishData(Pe, { reliable: !0 });
2383
2397
  } catch {
2384
2398
  }
2385
- }, [se, U, U.connectionState]), R(() => {
2386
- var G;
2399
+ }, [ce, U, U.connectionState]), R(() => {
2400
+ var K;
2387
2401
  if (typeof window > "u") return;
2388
- const m = ((G = window.location) == null ? void 0 : G.hostname) || "";
2402
+ const m = ((K = window.location) == null ? void 0 : K.hostname) || "";
2389
2403
  if (m === "localhost" || m === "127.0.0.1" || m === "0.0.0.0" || m.endsWith(".local") || m.endsWith(".test"))
2390
- return window.__livelayerSimulateCommand = (Ae) => {
2404
+ return window.__livelayerSimulateCommand = (Pe) => {
2391
2405
  try {
2392
- Be(Ae);
2393
- } catch (tt) {
2394
- console.warn("[LiveLayer] simulate-command threw:", tt);
2406
+ qe(Pe);
2407
+ } catch (nt) {
2408
+ console.warn("[LiveLayer] simulate-command threw:", nt);
2395
2409
  }
2396
2410
  }, () => {
2397
2411
  delete window.__livelayerSimulateCommand;
2398
2412
  };
2399
- }, [Be]);
2413
+ }, [qe]);
2400
2414
  const w = ot(() => V ? {
2401
2415
  connectionState: V.connectionState,
2402
2416
  agentState: V.agentState,
@@ -2438,166 +2452,166 @@ function Cr(e) {
2438
2452
  }, [w.videoElement]), R(() => {
2439
2453
  const m = w.audioElement;
2440
2454
  if (!m) return;
2441
- De.attach(m);
2455
+ Ae.attach(m);
2442
2456
  const u = m.play();
2443
- return u && typeof u.catch == "function" && u.catch((G) => {
2444
- (G == null ? void 0 : G.name) === "NotAllowedError" && ue(!0);
2457
+ return u && typeof u.catch == "function" && u.catch((K) => {
2458
+ (K == null ? void 0 : K.name) === "NotAllowedError" && ue(!0);
2445
2459
  }), () => {
2446
- De.detach();
2460
+ Ae.detach();
2447
2461
  };
2448
2462
  }, [w.audioElement]), R(() => {
2449
2463
  if (w.isControlled || w.connectionState !== "connected") return;
2450
2464
  const m = w.getRoom();
2451
2465
  if (m)
2452
- return re.setupMic(m).catch(() => {
2453
- }), ie.attachRoom(m), le.attachRoom(m), de.refresh(), () => {
2454
- re.teardownMic(), ie.teardown(), le.teardown();
2466
+ return ne.setupMic(m).catch(() => {
2467
+ }), ee.attachRoom(m), oe.attachRoom(m), de.refresh(), () => {
2468
+ ne.teardownMic(), ee.teardown(), oe.teardown();
2455
2469
  };
2456
2470
  }, [w.isControlled, w.connectionState]), R(() => {
2457
2471
  const m = w.audioElement;
2458
- m && (m.muted = Oe);
2459
- }, [w.audioElement, Oe]);
2472
+ m && (m.muted = Me);
2473
+ }, [w.audioElement, Me]);
2460
2474
  const Kt = k((m) => {
2461
2475
  const u = w.getRoom();
2462
2476
  if (u)
2463
2477
  try {
2464
- const G = new TextEncoder().encode(
2478
+ const K = new TextEncoder().encode(
2465
2479
  JSON.stringify({ type: "user_message", text: m })
2466
2480
  );
2467
- u.localParticipant.publishData(G, { reliable: !0 });
2481
+ u.localParticipant.publishData(K, { reliable: !0 });
2468
2482
  } catch {
2469
2483
  }
2470
2484
  }, [w]), Xt = k(() => {
2471
- Qe((m) => !m);
2485
+ ct((m) => !m);
2472
2486
  }, []);
2473
2487
  R(() => {
2474
- ke == null || ke(w.connectionState), w.connectionState === "connected" ? ge == null || ge() : w.connectionState === "disconnected" && (we == null || we());
2475
- }, [w.connectionState, ge, we, ke]), R(() => {
2476
- _e == null || _e(w.transcript);
2477
- }, [w.transcript, _e]), R(() => {
2478
- xe == null || xe(w.agentState);
2479
- }, [w.agentState, xe]);
2488
+ Le == null || Le(w.connectionState), w.connectionState === "connected" ? ge == null || ge() : w.connectionState === "disconnected" && (_e == null || _e());
2489
+ }, [w.connectionState, ge, _e, Le]), R(() => {
2490
+ xe == null || xe(w.transcript);
2491
+ }, [w.transcript, xe]), R(() => {
2492
+ ke == null || ke(w.agentState);
2493
+ }, [w.agentState, ke]);
2480
2494
  const _t = E(!1);
2481
2495
  R(() => {
2482
- w.isControlled || !s || _t.current || Pe && w.connectionState === "idle" && (_t.current = !0, w.connect());
2483
- }, [s, w.connectionState, w, Pe]);
2496
+ w.isControlled || !c || _t.current || Oe && w.connectionState === "idle" && (_t.current = !0, w.connect());
2497
+ }, [c, w.connectionState, w, Oe]);
2484
2498
  const Qt = k(
2485
2499
  (m) => {
2486
- const u = C == null ? void 0 : C.find((G) => G.id === m);
2487
- u && (He(!1), m !== K && ($e(!0), w.disconnect(), Q || Ce(m), v == null || v(u)));
2500
+ const u = C == null ? void 0 : C.find((K) => K.id === m);
2501
+ u && (le(!1), m !== ye && (Qe(!0), w.disconnect(), se || re(m), v == null || v(u)));
2488
2502
  },
2489
2503
  [
2490
2504
  C,
2491
- K,
2505
+ ye,
2492
2506
  w,
2493
- Q,
2507
+ se,
2494
2508
  v
2495
2509
  ]
2496
2510
  );
2497
2511
  R(() => {
2498
- fe && w.connectionState === "connected" && $e(!1);
2499
- }, [w.connectionState, fe]), R(() => {
2500
- if (!ze) return;
2512
+ Ie && w.connectionState === "connected" && Qe(!1);
2513
+ }, [w.connectionState, Ie]), R(() => {
2514
+ if (!Be) return;
2501
2515
  const m = (u) => {
2502
- u.key === "Escape" && He(!1);
2516
+ u.key === "Escape" && le(!1);
2503
2517
  };
2504
2518
  return window.addEventListener("keydown", m), () => window.removeEventListener("keydown", m);
2505
- }, [ze]);
2506
- const Zt = !!M || !!(Z != null && Z.avatarImageUrl) || w.isControlled, qe = kn(Ee, o, Zt);
2507
- te === void 0 && ((kt = qe.info) != null && kt.capabilities) && (dt.current = qe.info.capabilities);
2508
- const et = (Z == null ? void 0 : Z.name) ?? H ?? ((Lt = w.agentConfig) == null ? void 0 : Lt.name) ?? ((St = qe.info) == null ? void 0 : St.name) ?? "Live Layer", ut = (Z == null ? void 0 : Z.avatarImageUrl) ?? M ?? ((Ct = w.agentConfig) == null ? void 0 : Ct.avatarImageUrl) ?? ((Et = qe.info) == null ? void 0 : Et.avatarImageUrl) ?? null, en = b ?? ((Nt = w.agentConfig) == null ? void 0 : Nt.idleLoopUrl) ?? ((At = qe.info) == null ? void 0 : At.idleLoopUrl) ?? null, tn = z ?? null, nn = k(() => ce("expanded"), [ce]), rn = k(
2509
- () => ce("minimized"),
2510
- [ce]
2519
+ }, [Be]);
2520
+ const Zt = !!M || !!(J != null && J.avatarImageUrl) || w.isControlled, We = kn(ve, i, Zt);
2521
+ Z === void 0 && ((kt = We.info) != null && kt.capabilities) && (dt.current = We.info.capabilities);
2522
+ const tt = (J == null ? void 0 : J.name) ?? H ?? ((Lt = w.agentConfig) == null ? void 0 : Lt.name) ?? ((St = We.info) == null ? void 0 : St.name) ?? "Live Layer", ut = (J == null ? void 0 : J.avatarImageUrl) ?? M ?? ((Ct = w.agentConfig) == null ? void 0 : Ct.avatarImageUrl) ?? ((Et = We.info) == null ? void 0 : Et.avatarImageUrl) ?? null, en = b ?? ((Nt = w.agentConfig) == null ? void 0 : Nt.idleLoopUrl) ?? ((At = We.info) == null ? void 0 : At.idleLoopUrl) ?? null, tn = z ?? null, nn = k(() => ie("expanded"), [ie]), rn = k(
2523
+ () => ie("minimized"),
2524
+ [ie]
2511
2525
  ), xt = k(() => {
2512
- w.disconnect(), ce("hidden");
2513
- }, [w, ce]), on = k(() => {
2526
+ w.disconnect(), ie("hidden");
2527
+ }, [w, ie]), on = k(() => {
2514
2528
  const m = w.audioElement;
2515
2529
  m && m.play().then(() => ue(!1)).catch(() => {
2516
2530
  });
2517
2531
  }, [w.audioElement]), ln = k(() => {
2518
2532
  ue(!1), w.connect();
2519
- }, [w]), We = {
2520
- ...Je,
2521
- zIndex: Ke
2533
+ }, [w]), Fe = {
2534
+ ...Ke,
2535
+ zIndex: Xe
2522
2536
  };
2523
- h.primaryColor && (We["--ll-color-primary"] = h.primaryColor), h.accentColor && (We["--ll-color-accent"] = h.accentColor), h.backgroundColor && (We["--ll-color-bg"] = h.backgroundColor), h.textColor && (We["--ll-color-fg"] = h.textColor);
2537
+ h.primaryColor && (Fe["--ll-color-primary"] = h.primaryColor), h.accentColor && (Fe["--ll-color-accent"] = h.accentColor), h.backgroundColor && (Fe["--ll-color-bg"] = h.backgroundColor), h.textColor && (Fe["--ll-color-fg"] = h.textColor);
2524
2538
  const an = [
2525
2539
  "ll-widget",
2526
- `ll-widget--${oe}`,
2527
- `ll-widget--${ve ? "mobile" : "desktop"}`,
2528
- at
2540
+ `ll-widget--${be}`,
2541
+ `ll-widget--${Ne ? "mobile" : "desktop"}`,
2542
+ st
2529
2543
  ].filter(Boolean).join(" ");
2530
- return Pe ? /* @__PURE__ */ _(
2544
+ return Oe ? /* @__PURE__ */ _(
2531
2545
  "div",
2532
2546
  {
2533
2547
  className: an,
2534
- style: We,
2535
- "data-display-mode": oe,
2548
+ style: Fe,
2549
+ "data-display-mode": be,
2536
2550
  "data-position": g,
2537
2551
  children: [
2538
- oe === "hidden" && /* @__PURE__ */ n(
2552
+ be === "hidden" && /* @__PURE__ */ n(
2539
2553
  Vn,
2540
2554
  {
2541
2555
  position: g,
2542
- isMobile: ve,
2556
+ isMobile: Ne,
2543
2557
  isSpeaking: w.agentState === "speaking",
2544
- onExpand: () => ce("expanded"),
2545
- label: `Open ${et} widget`,
2558
+ onExpand: () => ie("expanded"),
2559
+ label: `Open ${tt} widget`,
2546
2560
  avatarImageUrl: ut,
2547
- agentName: et
2561
+ agentName: tt
2548
2562
  }
2549
2563
  ),
2550
- oe === "minimized" && /* @__PURE__ */ n(
2564
+ be === "minimized" && /* @__PURE__ */ n(
2551
2565
  Gn,
2552
2566
  {
2553
2567
  position: g,
2554
- isMobile: ve,
2555
- agentName: et,
2568
+ isMobile: Ne,
2569
+ agentName: tt,
2556
2570
  avatarImageUrl: ut,
2557
2571
  agentState: w.agentState,
2558
- isMuted: re.isMuted,
2559
- audioLevel: De,
2572
+ isMuted: ne.isMuted,
2573
+ audioLevel: Ae,
2560
2574
  onExpand: nn,
2561
- onToggleMute: re.toggleMute,
2575
+ onToggleMute: ne.toggleMute,
2562
2576
  onClose: xt
2563
2577
  }
2564
2578
  ),
2565
- oe === "expanded" && /* @__PURE__ */ n(
2579
+ be === "expanded" && /* @__PURE__ */ n(
2566
2580
  Kn,
2567
2581
  {
2568
2582
  position: g,
2569
- isMobile: ve,
2570
- agentName: et,
2583
+ isMobile: Ne,
2584
+ agentName: tt,
2571
2585
  avatarImageUrl: ut,
2572
2586
  idleLoopUrl: en,
2573
2587
  greeting: tn,
2574
2588
  branding: h,
2575
2589
  teamMembers: C,
2576
- currentTeamMemberId: K,
2577
- isSwitchingTeamMember: fe,
2578
- teamSwitcherOpen: ze,
2579
- onToggleTeamSwitcher: () => He((m) => !m),
2590
+ currentTeamMemberId: ye,
2591
+ isSwitchingTeamMember: Ie,
2592
+ teamSwitcherOpen: Be,
2593
+ onToggleTeamSwitcher: () => le((m) => !m),
2580
2594
  onSelectTeamMember: Qt,
2581
2595
  connectionState: w.connectionState,
2582
2596
  agentState: w.agentState,
2583
2597
  transcript: w.transcript,
2584
- isMuted: re.isMuted,
2598
+ isMuted: ne.isMuted,
2585
2599
  micDevices: de.mics,
2586
- isCameraEnabled: ie.isEnabled,
2587
- cameraPreviewEl: ie.previewEl,
2600
+ isCameraEnabled: ee.isEnabled,
2601
+ cameraPreviewEl: ee.previewEl,
2588
2602
  cameraDevices: de.cameras,
2589
- activeCameraId: ie.activeDeviceId,
2590
- isScreenShareEnabled: le.isEnabled,
2591
- screenPreviewEl: le.previewEl,
2592
- isSpeakerMuted: Oe,
2603
+ activeCameraId: ee.activeDeviceId,
2604
+ isScreenShareEnabled: oe.isEnabled,
2605
+ screenPreviewEl: oe.previewEl,
2606
+ isSpeakerMuted: Me,
2593
2607
  allowCamera: N,
2594
2608
  allowScreenShare: q,
2595
2609
  allowTyping: D,
2596
- languageMenuOpen: Xe,
2597
- onToggleLanguageMenu: () => ct((m) => !m),
2598
- needsUserGesture: Ne,
2610
+ languageMenuOpen: fe,
2611
+ onToggleLanguageMenu: () => Ze((m) => !m),
2612
+ needsUserGesture: Re,
2599
2613
  canResume: w.canResume,
2600
- micError: re.micError,
2614
+ micError: ne.micError,
2601
2615
  error: w.error,
2602
2616
  avatarVideoContainerRef: wt,
2603
2617
  agentVideoEl: w.videoElement,
@@ -2605,15 +2619,15 @@ function Cr(e) {
2605
2619
  onDisconnect: () => w.disconnect(),
2606
2620
  onRetry: ln,
2607
2621
  onResumeAudio: on,
2608
- onToggleMute: re.toggleMute,
2609
- onToggleCamera: () => void ie.toggle(),
2610
- onSwitchCameraDevice: (m) => void ie.switchDevice(m),
2611
- onToggleScreenShare: () => void le.toggle(),
2622
+ onToggleMute: ne.toggleMute,
2623
+ onToggleCamera: () => void ee.toggle(),
2624
+ onSwitchCameraDevice: (m) => void ee.switchDevice(m),
2625
+ onToggleScreenShare: () => void oe.toggle(),
2612
2626
  onToggleSpeaker: Xt,
2613
2627
  onSendMessage: Kt,
2614
2628
  onMinimize: rn,
2615
2629
  onClose: xt,
2616
- onClearMicError: re.clearError
2630
+ onClearMicError: ne.clearError
2617
2631
  }
2618
2632
  )
2619
2633
  ]
@@ -2627,93 +2641,93 @@ const Dr = ({
2627
2641
  agentId: e,
2628
2642
  baseUrl: t,
2629
2643
  apiKey: r,
2630
- mode: o,
2631
- onAgentEvent: i,
2644
+ mode: i,
2645
+ onAgentEvent: o,
2632
2646
  className: l,
2633
- style: s
2647
+ style: c
2634
2648
  }) => {
2635
- const d = E(null), f = E(null), y = E(i);
2636
- y.current = i;
2649
+ const d = E(null), f = E(null), y = E(o);
2650
+ y.current = o;
2637
2651
  const g = k((a) => {
2638
2652
  var I;
2639
- const c = a.detail;
2640
- (I = y.current) == null || I.call(y, c);
2653
+ const s = a.detail;
2654
+ (I = y.current) == null || I.call(y, s);
2641
2655
  }, []);
2642
2656
  return R(() => {
2643
2657
  const a = d.current;
2644
2658
  if (!a) return;
2645
- const c = document.createElement("livelayer-widget");
2646
- 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", g), a.appendChild(c), f.current = c, () => {
2647
- c.removeEventListener("agent-event", g), a.removeChild(c), f.current = null;
2659
+ const s = document.createElement("livelayer-widget");
2660
+ 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), f.current = s, () => {
2661
+ s.removeEventListener("agent-event", g), a.removeChild(s), f.current = null;
2648
2662
  };
2649
2663
  }, [e]), R(() => {
2650
- f.current && (o ? f.current.setAttribute("mode", o) : f.current.removeAttribute("mode"));
2651
- }, [o]), /* @__PURE__ */ n("div", { ref: d, className: l, style: s });
2664
+ f.current && (i ? f.current.setAttribute("mode", i) : f.current.removeAttribute("mode"));
2665
+ }, [i]), /* @__PURE__ */ n("div", { ref: d, className: l, style: c });
2652
2666
  }, $r = mt(
2653
- function({ id: t, intent: r, as: o = "div", className: i, style: l, children: s }, d) {
2667
+ function({ id: t, intent: r, as: i = "div", className: o, style: l, children: c }, d) {
2654
2668
  return un(
2655
- o,
2669
+ i,
2656
2670
  {
2657
2671
  ref: d,
2658
2672
  "data-ll-region": t,
2659
2673
  "data-ll-intent": r,
2660
- className: i,
2674
+ className: o,
2661
2675
  style: l
2662
2676
  },
2663
- s
2677
+ c
2664
2678
  );
2665
2679
  }
2666
2680
  ), zr = mt(
2667
- function({ id: t, intent: r, children: o, ...i }, l) {
2681
+ function({ id: t, intent: r, children: i, ...o }, l) {
2668
2682
  return /* @__PURE__ */ n(
2669
2683
  "form",
2670
2684
  {
2671
2685
  ref: l,
2672
2686
  "data-ll-form": t,
2673
2687
  "data-ll-intent": r,
2674
- ...i,
2675
- children: o
2688
+ ...o,
2689
+ children: i
2676
2690
  }
2677
2691
  );
2678
2692
  }
2679
2693
  ), Hr = mt(
2680
2694
  function(t, r) {
2681
- const { name: o, label: i, labelClassName: l } = t, s = { name: o, "data-ll-field": o };
2695
+ const { name: i, label: o, labelClassName: l } = t, c = { name: i, "data-ll-field": i };
2682
2696
  let d;
2683
2697
  if ("as" in t && t.as === "textarea") {
2684
- const { name: f, label: y, labelClassName: g, as: a, ...c } = t;
2698
+ const { name: f, label: y, labelClassName: g, as: a, ...s } = t;
2685
2699
  d = /* @__PURE__ */ n(
2686
2700
  "textarea",
2687
2701
  {
2688
2702
  ref: r,
2689
- ...s,
2690
- ...c
2703
+ ...c,
2704
+ ...s
2691
2705
  }
2692
2706
  );
2693
2707
  } else if ("as" in t && t.as === "select") {
2694
- const { name: f, label: y, labelClassName: g, as: a, children: c, ...I } = t;
2708
+ const { name: f, label: y, labelClassName: g, as: a, children: s, ...I } = t;
2695
2709
  d = /* @__PURE__ */ n(
2696
2710
  "select",
2697
2711
  {
2698
2712
  ref: r,
2699
- ...s,
2713
+ ...c,
2700
2714
  ...I,
2701
- children: c
2715
+ children: s
2702
2716
  }
2703
2717
  );
2704
2718
  } else {
2705
- const { name: f, label: y, labelClassName: g, as: a, ...c } = t;
2719
+ const { name: f, label: y, labelClassName: g, as: a, ...s } = t;
2706
2720
  d = /* @__PURE__ */ n(
2707
2721
  "input",
2708
2722
  {
2709
2723
  ref: r,
2710
- ...s,
2711
- ...c
2724
+ ...c,
2725
+ ...s
2712
2726
  }
2713
2727
  );
2714
2728
  }
2715
- return i === void 0 ? d : /* @__PURE__ */ _("label", { className: l, children: [
2716
- i,
2729
+ return o === void 0 ? d : /* @__PURE__ */ _("label", { className: l, children: [
2730
+ o,
2717
2731
  d
2718
2732
  ] });
2719
2733
  }
@@ -2724,28 +2738,28 @@ function Or({
2724
2738
  defaultOpen: t = !1,
2725
2739
  storageKey: r = "ll-debug-open"
2726
2740
  }) {
2727
- const [o, i] = L(t), [l, s] = L([]), [d, f] = L(""), [y, g] = L(!1), a = E(/* @__PURE__ */ new Set()), c = E([]), I = E(y);
2741
+ const [i, o] = L(t), [l, c] = L([]), [d, f] = L(""), [y, g] = L(!1), a = E(/* @__PURE__ */ new Set()), s = E([]), I = E(y);
2728
2742
  I.current = y, R(() => {
2729
2743
  try {
2730
2744
  const v = localStorage.getItem(r);
2731
- v === "1" && i(!0), v === "0" && i(!1);
2745
+ v === "1" && o(!0), v === "0" && o(!1);
2732
2746
  } catch {
2733
2747
  }
2734
2748
  }, [r]), R(() => {
2735
2749
  try {
2736
- localStorage.setItem(r, o ? "1" : "0");
2750
+ localStorage.setItem(r, i ? "1" : "0");
2737
2751
  } catch {
2738
2752
  }
2739
- }, [o, r]), R(() => {
2753
+ }, [i, r]), R(() => {
2740
2754
  const v = (b) => {
2741
- (b.metaKey || b.ctrlKey) && b.shiftKey && b.key.toLowerCase() === "l" && (b.preventDefault(), i((z) => !z));
2755
+ (b.metaKey || b.ctrlKey) && b.shiftKey && b.key.toLowerCase() === "l" && (b.preventDefault(), o((z) => !z));
2742
2756
  };
2743
2757
  return window.addEventListener("keydown", v), () => window.removeEventListener("keydown", v);
2744
2758
  }, []), R(() => {
2745
2759
  const v = setInterval(() => {
2746
- if (c.current.length === 0 || I.current) return;
2747
- const b = c.current.splice(0, c.current.length);
2748
- s(
2760
+ if (s.current.length === 0 || I.current) return;
2761
+ const b = s.current.splice(0, s.current.length);
2762
+ c(
2749
2763
  (z) => [...b.reverse(), ...z].slice(0, 200)
2750
2764
  );
2751
2765
  }, 100);
@@ -2754,7 +2768,7 @@ function Or({
2754
2768
  const C = E(!1);
2755
2769
  if (R(() => {
2756
2770
  !e || C.current || (C.current = !0, e((v) => {
2757
- c.current.push({
2771
+ s.current.push({
2758
2772
  id: Yt++,
2759
2773
  ts: Date.now(),
2760
2774
  kind: "event",
@@ -2766,7 +2780,7 @@ function Or({
2766
2780
  const v = console.warn, b = console.log, z = (M, H) => function(...h) {
2767
2781
  try {
2768
2782
  const N = typeof h[0] == "string" ? h[0] : "";
2769
- N.startsWith("[LiveLayer]") && c.current.push({
2783
+ N.startsWith("[LiveLayer]") && s.current.push({
2770
2784
  id: Yt++,
2771
2785
  ts: Date.now(),
2772
2786
  kind: M,
@@ -2780,12 +2794,12 @@ function Or({
2780
2794
  return console.warn = z("warn", v), console.log = z("log", b), () => {
2781
2795
  console.warn = v, console.log = b;
2782
2796
  };
2783
- }, []), !o)
2797
+ }, []), !i)
2784
2798
  return /* @__PURE__ */ n(
2785
2799
  "button",
2786
2800
  {
2787
2801
  type: "button",
2788
- onClick: () => i(!0),
2802
+ onClick: () => o(!0),
2789
2803
  title: "Open LiveLayer debug panel (Cmd/Ctrl + Shift + L)",
2790
2804
  "aria-label": "Open LiveLayer debug panel",
2791
2805
  style: {
@@ -2868,7 +2882,7 @@ function Or({
2868
2882
  {
2869
2883
  type: "button",
2870
2884
  onClick: () => {
2871
- s([]), c.current = [];
2885
+ c([]), s.current = [];
2872
2886
  },
2873
2887
  style: pt("transparent"),
2874
2888
  title: "Clear buffer",
@@ -2879,7 +2893,7 @@ function Or({
2879
2893
  "button",
2880
2894
  {
2881
2895
  type: "button",
2882
- onClick: () => i(!1),
2896
+ onClick: () => o(!1),
2883
2897
  style: pt("transparent"),
2884
2898
  "aria-label": "Close",
2885
2899
  title: "Close (Cmd/Ctrl + Shift + L)",
@@ -2952,7 +2966,7 @@ function Or({
2952
2966
  entry: v,
2953
2967
  expanded: a.current.has(v.id),
2954
2968
  onToggle: () => {
2955
- a.current.has(v.id) ? a.current.delete(v.id) : a.current.add(v.id), s((b) => [...b]);
2969
+ a.current.has(v.id) ? a.current.delete(v.id) : a.current.add(v.id), c((b) => [...b]);
2956
2970
  }
2957
2971
  },
2958
2972
  v.id
@@ -2968,7 +2982,7 @@ function Er({
2968
2982
  expanded: t,
2969
2983
  onToggle: r
2970
2984
  }) {
2971
- 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", {
2985
+ 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", {
2972
2986
  hour12: !1
2973
2987
  });
2974
2988
  return /* @__PURE__ */ _(
@@ -2998,14 +3012,14 @@ function Er({
2998
3012
  fontVariantNumeric: "tabular-nums",
2999
3013
  fontSize: 10
3000
3014
  },
3001
- children: i
3015
+ children: o
3002
3016
  }
3003
3017
  ),
3004
3018
  /* @__PURE__ */ n(
3005
3019
  "span",
3006
3020
  {
3007
3021
  style: {
3008
- color: o,
3022
+ color: i,
3009
3023
  fontWeight: 600,
3010
3024
  flexShrink: 0
3011
3025
  },
@@ -3052,20 +3066,20 @@ function Nr(e) {
3052
3066
  }
3053
3067
  }
3054
3068
  function Br() {
3055
- const [e, t] = L([]), r = k((i) => {
3069
+ const [e, t] = L([]), r = k((o) => {
3056
3070
  t((l) => {
3057
- const s = l.findIndex((d) => d.id === i.id);
3058
- if (s >= 0) {
3071
+ const c = l.findIndex((d) => d.id === o.id);
3072
+ if (c >= 0) {
3059
3073
  const d = l.slice();
3060
- return d[s] = i, d;
3074
+ return d[c] = o, d;
3061
3075
  }
3062
- return [...l, i];
3076
+ return [...l, o];
3063
3077
  });
3064
- }, []), o = k(() => t([]), []);
3078
+ }, []), i = k(() => t([]), []);
3065
3079
  return {
3066
3080
  entries: e,
3067
3081
  pushSegment: r,
3068
- clear: o,
3082
+ clear: i,
3069
3083
  latest: e.length > 0 ? e[e.length - 1] : null
3070
3084
  };
3071
3085
  }