@automattic/agenttic-ui 0.1.79 → 0.1.81

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.
Files changed (26) hide show
  1. package/dist/hooks/useFloatingPanel.d.ts.map +1 -1
  2. package/dist/hooks/useFloatingPanel.test.d.ts +2 -0
  3. package/dist/hooks/useFloatingPanel.test.d.ts.map +1 -0
  4. package/dist/index.css +1 -1
  5. package/dist/index.js +318 -313
  6. package/package.json +1 -1
  7. package/dist/components/chat/page-pattern-modal/dist/esm/components/page-pattern-modal.d.ts +0 -3
  8. package/dist/components/chat/page-pattern-modal/dist/esm/components/page-pattern-modal.d.ts.map +0 -1
  9. package/dist/components/chat/page-pattern-modal/dist/esm/components/pattern-selector-control.d.ts +0 -9
  10. package/dist/components/chat/page-pattern-modal/dist/esm/components/pattern-selector-control.d.ts.map +0 -1
  11. package/dist/components/chat/page-pattern-modal/dist/esm/components/pattern-selector-item.d.ts +0 -3
  12. package/dist/components/chat/page-pattern-modal/dist/esm/components/pattern-selector-item.d.ts.map +0 -1
  13. package/dist/components/chat/page-pattern-modal/dist/esm/index.d.ts +0 -3
  14. package/dist/components/chat/page-pattern-modal/dist/esm/index.d.ts.map +0 -1
  15. package/dist/components/chat/page-pattern-modal/dist/esm/pattern-definition.d.ts +0 -2
  16. package/dist/components/chat/page-pattern-modal/dist/esm/pattern-definition.d.ts.map +0 -1
  17. package/dist/components/chat/page-pattern-modal/dist/esm/utils/contains-missing-block.d.ts +0 -9
  18. package/dist/components/chat/page-pattern-modal/dist/esm/utils/contains-missing-block.d.ts.map +0 -1
  19. package/dist/components/chat/page-pattern-modal/dist/esm/utils/group-utils.d.ts +0 -8
  20. package/dist/components/chat/page-pattern-modal/dist/esm/utils/group-utils.d.ts.map +0 -1
  21. package/dist/components/chat/page-pattern-modal/dist/esm/utils/map-blocks-recursively.d.ts +0 -9
  22. package/dist/components/chat/page-pattern-modal/dist/esm/utils/map-blocks-recursively.d.ts.map +0 -1
  23. package/dist/components/chat/page-pattern-modal/dist/esm/utils/replace-placeholders.d.ts +0 -3
  24. package/dist/components/chat/page-pattern-modal/dist/esm/utils/replace-placeholders.d.ts.map +0 -1
  25. package/dist/components/chat/page-pattern-modal/dist/esm/utils/tracking.d.ts +0 -5
  26. package/dist/components/chat/page-pattern-modal/dist/esm/utils/tracking.d.ts.map +0 -1
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import './global.css';import './index.css';/* empty css */
2
2
  import { jsx as a, Fragment as Ie, jsxs as k } from "react/jsx-runtime";
3
3
  import * as Kt from "react";
4
- import ne, { useState as J, useEffect as P, useCallback as T, useRef as D, useLayoutEffect as Jt, createContext as jn, useContext as Un, useId as Bn, useMemo as tt, memo as qt, forwardRef as Xt, useImperativeHandle as Vn, Component as zn } from "react";
5
- import { c as te, S as Zn, D as Qt, C as ea } from "./DiffCard-DQc8e9un.js";
4
+ import ne, { useState as J, useEffect as P, useCallback as T, useRef as D, useLayoutEffect as Jt, createContext as jn, useContext as Un, useId as Bn, useMemo as tt, memo as qt, forwardRef as Xt, useImperativeHandle as Vn, Component as Zn } from "react";
5
+ import { c as te, S as zn, D as Qt, C as ea } from "./DiffCard-DQc8e9un.js";
6
6
  import { a as fc, Q as vc } from "./DiffCard-DQc8e9un.js";
7
7
  import { useMotionValue as dt, animate as le, useDragControls as Gn, motion as ie, AnimatePresence as at } from "framer-motion";
8
8
  import { setLocaleData as Ft, __ as F, sprintf as Ee } from "@wordpress/i18n";
@@ -1460,7 +1460,7 @@ const we = {
1460
1460
  domain: ja,
1461
1461
  generator: Wa,
1462
1462
  locale_data: Ua
1463
- }, Symbol.toStringTag, { value: "Module" })), Ba = "GlotPress/2.4.0-alpha", Va = "messages", za = {
1463
+ }, Symbol.toStringTag, { value: "Module" })), Ba = "GlotPress/2.4.0-alpha", Va = "messages", Za = {
1464
1464
  messages: {
1465
1465
  "": {
1466
1466
  domain: "messages",
@@ -1553,14 +1553,14 @@ const we = {
1553
1553
  "translation-revision-date": "2025-10-08 20:39:49+0000",
1554
1554
  generator: Ba,
1555
1555
  domain: Va,
1556
- locale_data: za
1556
+ locale_data: Za
1557
1557
  }, Sr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1558
1558
  __proto__: null,
1559
1559
  default: Nr,
1560
1560
  domain: Va,
1561
1561
  generator: Ba,
1562
- locale_data: za
1563
- }, Symbol.toStringTag, { value: "Module" })), Za = "GlotPress/2.4.0-alpha", Ga = "messages", Ya = {
1562
+ locale_data: Za
1563
+ }, Symbol.toStringTag, { value: "Module" })), za = "GlotPress/2.4.0-alpha", Ga = "messages", Ya = {
1564
1564
  messages: {
1565
1565
  "": {
1566
1566
  domain: "messages",
@@ -1651,14 +1651,14 @@ const we = {
1651
1651
  }
1652
1652
  }, Dr = {
1653
1653
  "translation-revision-date": "2025-10-08 20:39:50+0000",
1654
- generator: Za,
1654
+ generator: za,
1655
1655
  domain: Ga,
1656
1656
  locale_data: Ya
1657
1657
  }, Rr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1658
1658
  __proto__: null,
1659
1659
  default: Dr,
1660
1660
  domain: Ga,
1661
- generator: Za,
1661
+ generator: za,
1662
1662
  locale_data: Ya
1663
1663
  }, Symbol.toStringTag, { value: "Module" })), Pr = /* @__PURE__ */ Object.assign({
1664
1664
  "../../../../languages/wpcom-agenttic-ar.jed.json": nr,
@@ -1778,9 +1778,9 @@ function qa({
1778
1778
  if (!l)
1779
1779
  return;
1780
1780
  l.style.height = "auto";
1781
- const w = l.scrollHeight, C = 40, R = 200;
1781
+ const w = l.scrollHeight, y = 40, R = 200;
1782
1782
  l.style.height = `${Math.min(
1783
- Math.max(w, C),
1783
+ Math.max(w, y),
1784
1784
  R
1785
1785
  )}px`;
1786
1786
  }, []), p = T(
@@ -1938,7 +1938,7 @@ function jr({
1938
1938
  onResize: p,
1939
1939
  onResizeEnd: l
1940
1940
  }) {
1941
- const w = (n == null ? void 0 : n.width) ?? I.COMPACT_WIDTH, C = (n == null ? void 0 : n.height) ?? I.EXPANDED_HEIGHT, [R] = J(() => {
1941
+ const w = (n == null ? void 0 : n.width) ?? I.COMPACT_WIDTH, y = (n == null ? void 0 : n.height) ?? I.EXPANDED_HEIGHT, [R] = J(() => {
1942
1942
  const A = jt(
1943
1943
  {
1944
1944
  width: (t == null ? void 0 : t.width) ?? I.COMPACT_WIDTH,
@@ -1946,7 +1946,7 @@ function jr({
1946
1946
  },
1947
1947
  {
1948
1948
  minWidth: w,
1949
- minHeight: C,
1949
+ minHeight: y,
1950
1950
  maxWidth: o == null ? void 0 : o.width,
1951
1951
  maxHeight: o == null ? void 0 : o.height
1952
1952
  }
@@ -1960,14 +1960,14 @@ function jr({
1960
1960
  !!e
1961
1961
  )
1962
1962
  };
1963
- }), f = dt(R.footprint.width), M = dt(R.footprint.height), v = D(R.expanded), h = D(null), [b, O] = J(!1), N = T(
1963
+ }), f = dt(R.footprint.width), M = dt(R.footprint.height), v = D(R.expanded), h = D(null), [C, L] = J(!1), N = T(
1964
1964
  (A) => jt(A, {
1965
1965
  minWidth: w,
1966
- minHeight: C,
1966
+ minHeight: y,
1967
1967
  maxWidth: o == null ? void 0 : o.width,
1968
1968
  maxHeight: o == null ? void 0 : o.height
1969
1969
  }),
1970
- [o == null ? void 0 : o.width, o == null ? void 0 : o.height, w, C]
1970
+ [o == null ? void 0 : o.width, o == null ? void 0 : o.height, w, y]
1971
1971
  ), x = T(
1972
1972
  (A) => A === "collapsed" || A === "minimized" ? I.COLLAPSED_SIZE : A === "compact" ? i : e ? v.current.height : I.EXPANDED_HEIGHT,
1973
1973
  [i, e]
@@ -1982,9 +1982,9 @@ function jr({
1982
1982
  const A = N(v.current);
1983
1983
  f.set(A.width), M.set(A.height), v.current = A;
1984
1984
  }
1985
- }, [e, s, N, f, M]), S = D(p), L = D(l), y = D(N);
1985
+ }, [e, s, N, f, M]), S = D(p), O = D(l), b = D(N);
1986
1986
  Jt(() => {
1987
- S.current = p, L.current = l, y.current = N;
1987
+ S.current = p, O.current = l, b.current = N;
1988
1988
  });
1989
1989
  const E = T(
1990
1990
  (A) => {
@@ -2006,7 +2006,7 @@ function jr({
2006
2006
  ae,
2007
2007
  re.height + _.startPosY
2008
2008
  ));
2009
- const de = y.current({
2009
+ const de = b.current({
2010
2010
  width: q,
2011
2011
  height: ae
2012
2012
  });
@@ -2040,7 +2040,7 @@ function jr({
2040
2040
  ), _ == null || _.removeEventListener("pointerup", H), _ == null || _.removeEventListener(
2041
2041
  "lostpointercapture",
2042
2042
  H
2043
- ), O(!1), (B = L.current) == null || B.call(L, {
2043
+ ), L(!1), (B = O.current) == null || B.call(O, {
2044
2044
  width: f.get(),
2045
2045
  height: M.get()
2046
2046
  });
@@ -2057,7 +2057,7 @@ function jr({
2057
2057
  startHeight: M.get(),
2058
2058
  startPosX: c.get(),
2059
2059
  startPosY: u.get()
2060
- }, O(!0), _.addEventListener("pointermove", E), _.addEventListener("pointerup", H), _.addEventListener(
2060
+ }, L(!0), _.addEventListener("pointermove", E), _.addEventListener("pointerup", H), _.addEventListener(
2061
2061
  "lostpointercapture",
2062
2062
  H
2063
2063
  ));
@@ -2100,7 +2100,7 @@ function jr({
2100
2100
  }, [e, r == null ? void 0 : r.width, r == null ? void 0 : r.height]), {
2101
2101
  width: f,
2102
2102
  height: M,
2103
- isResizing: b,
2103
+ isResizing: C,
2104
2104
  expandedSizeRef: v,
2105
2105
  getPanelSize: X,
2106
2106
  clampSize: N,
@@ -2122,23 +2122,23 @@ function Ur({
2122
2122
  }) {
2123
2123
  const [m, p] = J(!1), [l, w] = J(
2124
2124
  () => Qa(t)
2125
- ), C = D(null), R = D(null), f = Gn(), M = T(
2126
- (L) => Ht(L ?? l, c().width),
2125
+ ), y = D(null), R = D(null), f = Gn(), M = T(
2126
+ (O) => Ht(O ?? l, c().width),
2127
2127
  [l, c]
2128
2128
  ), v = T(
2129
- (L) => {
2130
- const y = L.target;
2131
- if (y.closest('[data-slot="resize-handle"]') || y.ownerDocument !== document)
2129
+ (O) => {
2130
+ const b = O.target;
2131
+ if (b.closest('[data-slot="resize-handle"]') || b.ownerDocument !== document)
2132
2132
  return;
2133
- y.closest(
2133
+ b.closest(
2134
2134
  we.NON_DRAGGABLE_SELECTORS
2135
- ) || (L.preventDefault(), f.start(L.nativeEvent));
2135
+ ) || (O.preventDefault(), f.start(O.nativeEvent));
2136
2136
  },
2137
2137
  [f]
2138
2138
  ), h = T(() => {
2139
2139
  p(!0);
2140
- }, []), b = T(
2141
- (L, y) => {
2140
+ }, []), C = T(
2141
+ (O, b) => {
2142
2142
  p(!1);
2143
2143
  const E = s.get(), H = c().width, Q = (window.innerWidth - H) / 2, A = E < Q ? "left" : "right";
2144
2144
  if (l !== A && (w(A), Wt(A), n == null || n(A)), e) {
@@ -2153,10 +2153,10 @@ function Ur({
2153
2153
  const _ = M(A);
2154
2154
  le(s, _.x, {
2155
2155
  ...we.SPRING_CONFIG,
2156
- velocity: y.velocity.x * we.VELOCITY_MULTIPLIER
2156
+ velocity: b.velocity.x * we.VELOCITY_MULTIPLIER
2157
2157
  }), le(i, _.y, {
2158
2158
  ...we.SPRING_CONFIG,
2159
- velocity: y.velocity.y * we.VELOCITY_MULTIPLIER
2159
+ velocity: b.velocity.y * we.VELOCITY_MULTIPLIER
2160
2160
  });
2161
2161
  },
2162
2162
  [
@@ -2169,10 +2169,10 @@ function Ur({
2169
2169
  o,
2170
2170
  c
2171
2171
  ]
2172
- ), O = D(e);
2172
+ ), L = D(e);
2173
2173
  P(() => {
2174
- const L = O.current;
2175
- if (O.current = e, e || !L)
2174
+ const O = L.current;
2175
+ if (L.current = e, e || !O)
2176
2176
  return;
2177
2177
  const E = I.VIEWPORT_OFFSET + s.get() + c().width / 2 < window.innerWidth / 2 ? "left" : "right";
2178
2178
  l !== E && (w(E), Wt(E), n == null || n(E));
@@ -2189,10 +2189,10 @@ function Ur({
2189
2189
  ]);
2190
2190
  const N = D(null), x = D(r === "minimized");
2191
2191
  P(() => {
2192
- const L = x.current, y = r === "minimized";
2193
- if (x.current = y, !e || y === L)
2192
+ const O = x.current, b = r === "minimized";
2193
+ if (x.current = b, !e || b === O)
2194
2194
  return;
2195
- if (y) {
2195
+ if (b) {
2196
2196
  N.current = i.get();
2197
2197
  const H = le(i, 0, we.SPRING_CONFIG);
2198
2198
  return () => H.stop();
@@ -2207,47 +2207,47 @@ function Ur({
2207
2207
  return N.current = null, () => E.stop();
2208
2208
  }, [r, e, i]);
2209
2209
  const X = T(
2210
- (L) => {
2211
- const y = i.get(), E = 2 * I.VIEWPORT_OFFSET + L - window.innerHeight, H = Math.max(E, Math.min(y, 0));
2212
- return { y: H, skipY: H === y };
2210
+ (O) => {
2211
+ const b = i.get(), E = 2 * I.VIEWPORT_OFFSET + O - window.innerHeight, H = Math.max(E, Math.min(b, 0));
2212
+ return { y: H, skipY: H === b };
2213
2213
  },
2214
2214
  [i]
2215
2215
  ), U = T(
2216
- (L) => {
2217
- const y = c();
2216
+ (O) => {
2217
+ const b = c();
2218
2218
  if (e) {
2219
- const Q = window.innerWidth - y.width - 2 * I.VIEWPORT_OFFSET, Y = l === "right" ? L : 0, A = Math.max(
2219
+ const Q = window.innerWidth - b.width - 2 * I.VIEWPORT_OFFSET, Y = l === "right" ? O : 0, A = Math.max(
2220
2220
  0,
2221
2221
  Math.min(s.get() - Y, Q)
2222
- ), _ = X(y.height);
2222
+ ), _ = X(b.height);
2223
2223
  return { x: A, y: _.y, skipY: _.skipY };
2224
2224
  }
2225
2225
  const E = Ht(
2226
2226
  l,
2227
- y.width
2227
+ b.width
2228
2228
  ).x;
2229
2229
  if (r === "minimized")
2230
2230
  return { x: E, y: 0, skipY: !0 };
2231
- const H = X(y.height);
2231
+ const H = X(b.height);
2232
2232
  return { x: E, y: H.y, skipY: H.skipY };
2233
2233
  },
2234
2234
  [e, s, l, r, X, c]
2235
2235
  ), S = T(
2236
- (L = 0) => {
2236
+ (O = 0) => {
2237
2237
  if (m)
2238
2238
  return;
2239
- const y = U(L);
2240
- le(s, y.x, ge), y.skipY || le(i, y.y, ge);
2239
+ const b = U(O);
2240
+ le(s, b.x, ge), b.skipY || le(i, b.y, ge);
2241
2241
  },
2242
2242
  [m, U, s, i]
2243
2243
  );
2244
2244
  return P(() => {
2245
- const L = () => {
2245
+ const O = () => {
2246
2246
  u();
2247
- const y = U(0);
2248
- s.set(y.x), y.skipY || i.set(y.y);
2247
+ const b = U(0);
2248
+ s.set(b.x), b.skipY || i.set(b.y);
2249
2249
  };
2250
- return window.addEventListener("resize", L), () => window.removeEventListener("resize", L);
2250
+ return window.addEventListener("resize", O), () => window.removeEventListener("resize", O);
2251
2251
  }, [s, i, u, U]), {
2252
2252
  x: s,
2253
2253
  y: i,
@@ -2255,10 +2255,10 @@ function Ur({
2255
2255
  isDragging: m,
2256
2256
  dragControls: f,
2257
2257
  chatRef: R,
2258
- constraintsRef: C,
2258
+ constraintsRef: y,
2259
2259
  handlePointerDown: v,
2260
2260
  handleDragStart: h,
2261
- handleDragEnd: b,
2261
+ handleDragEnd: C,
2262
2262
  calculateSnapPosition: M,
2263
2263
  repositionForResize: S
2264
2264
  };
@@ -2277,16 +2277,16 @@ function nn({
2277
2277
  onChatPositionChange: p,
2278
2278
  onFreeDragEnd: l,
2279
2279
  onResize: w,
2280
- onResizeEnd: C
2280
+ onResizeEnd: y
2281
2281
  }) {
2282
2282
  const [R] = J(() => {
2283
- const O = !!e && s === "expanded";
2283
+ const L = !!e && s === "expanded";
2284
2284
  return Fr({
2285
2285
  freeDrag: c,
2286
2286
  initialFreeDragPosition: u,
2287
2287
  side: Qa(m),
2288
- width: O ? t == null ? void 0 : t.width : void 0,
2289
- height: O ? t == null ? void 0 : t.height : void 0
2288
+ width: L ? t == null ? void 0 : t.width : void 0,
2289
+ height: L ? t == null ? void 0 : t.height : void 0
2290
2290
  });
2291
2291
  }), f = dt(R.x), M = dt(R.y), v = D(
2292
2292
  () => {
@@ -2301,10 +2301,15 @@ function nn({
2301
2301
  compactHeight: i,
2302
2302
  x: f,
2303
2303
  y: M,
2304
- repositionForResize: (O) => v.current(O),
2304
+ repositionForResize: (L) => v.current(L),
2305
2305
  onResize: w,
2306
- onResizeEnd: C
2307
- }), b = Ur({
2306
+ // Free-drag persists an absolute x/y; a left/bottom-edge resize shifts x/y
2307
+ // to pin the opposite edge, so report the moved position or a close→reopen
2308
+ // restores the pre-resize spot. Already in-bounds (x floored at 0, y clamped).
2309
+ onResizeEnd: (L) => {
2310
+ y == null || y(L), c && (l == null || l({ x: f.get(), y: M.get() }));
2311
+ }
2312
+ }), C = Ur({
2308
2313
  freeDrag: c,
2309
2314
  initialChatPosition: m,
2310
2315
  chatState: s,
@@ -2316,19 +2321,19 @@ function nn({
2316
2321
  clampResizedSize: h.clampToViewport
2317
2322
  });
2318
2323
  return Jt(() => {
2319
- v.current = b.repositionForResize;
2320
- }, [b.repositionForResize]), {
2324
+ v.current = C.repositionForResize;
2325
+ }, [C.repositionForResize]), {
2321
2326
  // Position / drag
2322
2327
  x: f,
2323
2328
  y: M,
2324
- currentSide: b.currentSide,
2325
- isDragging: b.isDragging,
2326
- dragControls: b.dragControls,
2327
- chatRef: b.chatRef,
2328
- constraintsRef: b.constraintsRef,
2329
- handlePointerDown: b.handlePointerDown,
2330
- handleDragStart: b.handleDragStart,
2331
- handleDragEnd: b.handleDragEnd,
2329
+ currentSide: C.currentSide,
2330
+ isDragging: C.isDragging,
2331
+ dragControls: C.dragControls,
2332
+ chatRef: C.chatRef,
2333
+ constraintsRef: C.constraintsRef,
2334
+ handlePointerDown: C.handlePointerDown,
2335
+ handleDragStart: C.handleDragStart,
2336
+ handleDragEnd: C.handleDragEnd,
2332
2337
  // Resize
2333
2338
  width: h.width,
2334
2339
  height: h.height,
@@ -2379,10 +2384,10 @@ function on() {
2379
2384
  }
2380
2385
  );
2381
2386
  }
2382
- const Vr = "ResizeHandles-module_resizeTop", zr = "ResizeHandles-module_resizeRight", Zr = "ResizeHandles-module_resizeBottom", Gr = "ResizeHandles-module_resizeLeft", Yr = "ResizeHandles-module_resizeTopLeft", Kr = "ResizeHandles-module_resizeTopRight", Jr = "ResizeHandles-module_resizeBottomRight", qr = "ResizeHandles-module_resizeBottomLeft", Xr = {
2387
+ const Vr = "ResizeHandles-module_resizeTop", Zr = "ResizeHandles-module_resizeRight", zr = "ResizeHandles-module_resizeBottom", Gr = "ResizeHandles-module_resizeLeft", Yr = "ResizeHandles-module_resizeTopLeft", Kr = "ResizeHandles-module_resizeTopRight", Jr = "ResizeHandles-module_resizeBottomRight", qr = "ResizeHandles-module_resizeBottomLeft", Xr = {
2383
2388
  resizeTop: Vr,
2384
- resizeRight: zr,
2385
- resizeBottom: Zr,
2389
+ resizeRight: Zr,
2390
+ resizeBottom: zr,
2386
2391
  resizeLeft: Gr,
2387
2392
  resizeTopLeft: Yr,
2388
2393
  resizeTopRight: Kr,
@@ -2662,20 +2667,20 @@ function Ot({
2662
2667
  fromCompact: p = !1,
2663
2668
  onExpand: l,
2664
2669
  showExpandButton: w = !0,
2665
- focusOnMount: C = !1,
2670
+ focusOnMount: y = !1,
2666
2671
  customActions: R = [],
2667
2672
  actionOrder: f = "before-submit",
2668
2673
  onStop: M,
2669
2674
  disabled: v,
2670
2675
  readOnly: h,
2671
- onMouseEnter: b,
2672
- onMouseLeave: O,
2676
+ onMouseEnter: C,
2677
+ onMouseLeave: L,
2673
2678
  expandOnClick: N = !1,
2674
2679
  layout: x = "inline"
2675
2680
  }) {
2676
- const X = Bn(), { variant: U, floatingChatState: S, isInputOverLimit: L } = Le(), y = (
2681
+ const X = Bn(), { variant: U, floatingChatState: S, isInputOverLimit: O } = Le(), b = (
2677
2682
  // If the consumer actively sets `disabled` to `false` (vs undefined), that takes precedence.
2678
- v !== void 0 ? !v : (e.trim() || i) && !L
2683
+ v !== void 0 ? !v : (e.trim() || i) && !O
2679
2684
  ), E = T(
2680
2685
  (g) => {
2681
2686
  const q = g.key.toLowerCase();
@@ -2683,7 +2688,7 @@ function Ot({
2683
2688
  g.preventDefault();
2684
2689
  return;
2685
2690
  }
2686
- if (q === "enter" && !g.shiftKey && !y) {
2691
+ if (q === "enter" && !g.shiftKey && !b) {
2687
2692
  g.preventDefault();
2688
2693
  return;
2689
2694
  }
@@ -2693,11 +2698,11 @@ function Ot({
2693
2698
  }
2694
2699
  ((g.metaKey || g.ctrlKey) && q === "z" || g.ctrlKey && q === "y") && g.stopPropagation(), n(g);
2695
2700
  },
2696
- [y, n, h]
2701
+ [b, n, h]
2697
2702
  ), H = (g) => g.endsWith("…") ? g : `${g}…`, Q = Array.isArray(s);
2698
2703
  let Y;
2699
2704
  Q ? Y = s.map(H) : s ? Y = H(s) : Y = "";
2700
- const A = D(C);
2705
+ const A = D(y);
2701
2706
  P(() => {
2702
2707
  A.current && o.current && o.current.focus(), A.current = !1;
2703
2708
  }, [A, o]);
@@ -2740,7 +2745,7 @@ function Ot({
2740
2745
  {
2741
2746
  className: Me.button,
2742
2747
  onClick: g,
2743
- disabled: !y,
2748
+ disabled: !b,
2744
2749
  variant: "primary",
2745
2750
  icon: i ? /* @__PURE__ */ a(hi, {}) : /* @__PURE__ */ a(mi, {}),
2746
2751
  "aria-label": i ? F("Stop processing", "a8c-agenttic") : F("Send message", "a8c-agenttic")
@@ -2752,8 +2757,8 @@ function Ot({
2752
2757
  {
2753
2758
  "data-slot": "chat-input",
2754
2759
  className: `${Me.container}${x === "stacked" ? ` ${Me.containerStacked}` : ""}`,
2755
- onMouseEnter: b,
2756
- onMouseLeave: O,
2760
+ onMouseEnter: C,
2761
+ onMouseLeave: L,
2757
2762
  children: [
2758
2763
  /* @__PURE__ */ k(
2759
2764
  ie.div,
@@ -2864,7 +2869,7 @@ const Ai = "SuggestionDropdown-module_container", Li = "SuggestionDropdown-modul
2864
2869
  showDescription: o
2865
2870
  }) => {
2866
2871
  var v;
2867
- const [s, i] = ne.useState(!1), c = ne.useRef(null), [u, m] = ne.useState(null), [p, l] = ne.useState(null), [w, C] = ne.useState(void 0), R = ne.useCallback(
2872
+ const [s, i] = ne.useState(!1), c = ne.useRef(null), [u, m] = ne.useState(null), [p, l] = ne.useState(null), [w, y] = ne.useState(void 0), R = ne.useCallback(
2868
2873
  (h) => {
2869
2874
  if (c.current = h, !h) {
2870
2875
  m(null), l(null);
@@ -2881,19 +2886,19 @@ const Ai = "SuggestionDropdown-module_container", Li = "SuggestionDropdown-modul
2881
2886
  []
2882
2887
  ), f = ne.useCallback(
2883
2888
  (h) => {
2884
- var b;
2889
+ var C;
2885
2890
  if (h) {
2886
- const O = (b = c.current) == null ? void 0 : b.closest(
2891
+ const L = (C = c.current) == null ? void 0 : C.closest(
2887
2892
  '[data-slot="suggestions"]'
2888
2893
  );
2889
- O && C(O.clientWidth * 0.9);
2894
+ L && y(L.clientWidth * 0.9);
2890
2895
  }
2891
2896
  i(h), n == null || n(h);
2892
2897
  },
2893
2898
  [n]
2894
2899
  ), M = (h) => {
2895
- const { options: b, ...O } = e, N = {
2896
- ...O,
2900
+ const { options: C, ...L } = e, N = {
2901
+ ...L,
2897
2902
  prompt: Hi(
2898
2903
  e.prompt ?? e.label,
2899
2904
  h.value
@@ -2980,9 +2985,9 @@ const Ai = "SuggestionDropdown-module_container", Li = "SuggestionDropdown-modul
2980
2985
  P(() => {
2981
2986
  o && (l != null && l.length) && (p == null || p(l));
2982
2987
  }, [o, l, p]);
2983
- const w = async (C, R) => {
2988
+ const w = async (y, R) => {
2984
2989
  let f = !0;
2985
- C.action && (f = await C.action()), f && r && C.prompt && r(C, R);
2990
+ y.action && (f = await y.action()), f && r && y.prompt && r(y, R);
2986
2991
  };
2987
2992
  return !l || l.length === 0 ? null : /* @__PURE__ */ a(at, { children: o && /* @__PURE__ */ a(
2988
2993
  ie.div,
@@ -3000,8 +3005,8 @@ const Ai = "SuggestionDropdown-module_container", Li = "SuggestionDropdown-modul
3000
3005
  onMouseEnter: s,
3001
3006
  onMouseLeave: i,
3002
3007
  children: l.map(
3003
- (C, R) => {
3004
- const f = !!C.description && n !== "horizontal";
3008
+ (y, R) => {
3009
+ const f = !!y.description && n !== "horizontal";
3005
3010
  return /* @__PURE__ */ a(
3006
3011
  ie.div,
3007
3012
  {
@@ -3012,10 +3017,10 @@ const Ai = "SuggestionDropdown-module_container", Li = "SuggestionDropdown-modul
3012
3017
  ...ut,
3013
3018
  delay: R * 0.05
3014
3019
  },
3015
- children: C.options && C.options.length > 0 ? /* @__PURE__ */ a(
3020
+ children: y.options && y.options.length > 0 ? /* @__PURE__ */ a(
3016
3021
  Wi,
3017
3022
  {
3018
- suggestion: C,
3023
+ suggestion: y,
3019
3024
  onSelect: w,
3020
3025
  availableSuggestions: l,
3021
3026
  onOpenChange: c,
@@ -3026,7 +3031,7 @@ const Ai = "SuggestionDropdown-module_container", Li = "SuggestionDropdown-modul
3026
3031
  {
3027
3032
  onClick: (M) => {
3028
3033
  M.stopPropagation(), w(
3029
- C,
3034
+ y,
3030
3035
  l
3031
3036
  );
3032
3037
  },
@@ -3044,14 +3049,14 @@ const Ai = "SuggestionDropdown-module_container", Li = "SuggestionDropdown-modul
3044
3049
  "span",
3045
3050
  {
3046
3051
  className: ue.label,
3047
- children: C.label
3052
+ children: y.label
3048
3053
  }
3049
3054
  ),
3050
3055
  f && /* @__PURE__ */ a(
3051
3056
  "span",
3052
3057
  {
3053
3058
  className: ue.description,
3054
- children: C.description
3059
+ children: y.description
3055
3060
  }
3056
3061
  )
3057
3062
  ]
@@ -3060,7 +3065,7 @@ const Ai = "SuggestionDropdown-module_container", Li = "SuggestionDropdown-modul
3060
3065
  }
3061
3066
  )
3062
3067
  },
3063
- C.id
3068
+ y.id
3064
3069
  );
3065
3070
  }
3066
3071
  )
@@ -3105,47 +3110,47 @@ function un({
3105
3110
  showExpandButton: p = !0,
3106
3111
  focusOnMount: l = !1,
3107
3112
  customActions: w,
3108
- actionOrder: C,
3113
+ actionOrder: y,
3109
3114
  onStop: R,
3110
3115
  suggestions: f,
3111
3116
  clearSuggestions: M,
3112
3117
  handleSuggestionSubmit: v,
3113
3118
  expandOnClick: h = !1
3114
3119
  }) {
3115
- const [b, O] = J(!1), [N, x] = J(!1), { setNamedTimeout: X, clearAllTimeouts: U } = ji(), S = T(() => {
3120
+ const [C, L] = J(!1), [N, x] = J(!1), { setNamedTimeout: X, clearAllTimeouts: U } = ji(), S = T(() => {
3116
3121
  X(
3117
3122
  "hide-suggestions",
3118
3123
  () => {
3119
- O(!1);
3124
+ L(!1);
3120
3125
  },
3121
3126
  Ui
3122
3127
  );
3123
- }, [X]), L = T(() => {
3128
+ }, [X]), O = T(() => {
3124
3129
  N || S();
3125
- }, [N, S]), y = T(() => {
3126
- U(), O(!0);
3130
+ }, [N, S]), b = T(() => {
3131
+ U(), L(!0);
3127
3132
  }, [U]), E = T(
3128
3133
  (Q) => {
3129
- x(Q), Q ? y() : S();
3134
+ x(Q), Q ? b() : S();
3130
3135
  },
3131
- [S, y]
3136
+ [S, b]
3132
3137
  ), H = T(() => {
3133
3138
  h && m && !e && m();
3134
3139
  }, [h, m, e]);
3135
3140
  return P(() => {
3136
3141
  if (U(), e) {
3137
- O(!1);
3142
+ L(!1);
3138
3143
  return;
3139
3144
  }
3140
3145
  if (!f || f.length === 0) {
3141
- O(!1);
3146
+ L(!1);
3142
3147
  return;
3143
3148
  }
3144
3149
  if (N) {
3145
- O(!0);
3150
+ L(!0);
3146
3151
  return;
3147
3152
  }
3148
- O(!0), S();
3153
+ L(!0), S();
3149
3154
  }, [
3150
3155
  e,
3151
3156
  f,
@@ -3170,11 +3175,11 @@ function un({
3170
3175
  showExpandButton: p,
3171
3176
  focusOnMount: l,
3172
3177
  customActions: w,
3173
- actionOrder: C,
3178
+ actionOrder: y,
3174
3179
  onStop: R,
3175
3180
  expandOnClick: h,
3176
- onMouseEnter: y,
3177
- onMouseLeave: () => L()
3181
+ onMouseEnter: b,
3182
+ onMouseLeave: () => O()
3178
3183
  }
3179
3184
  ),
3180
3185
  !e && /* @__PURE__ */ a(
@@ -3183,18 +3188,18 @@ function un({
3183
3188
  suggestions: f,
3184
3189
  onSubmit: v,
3185
3190
  layout: "floating",
3186
- visible: b,
3187
- onMouseEnter: y,
3188
- onMouseLeave: () => L(),
3191
+ visible: C,
3192
+ onMouseEnter: b,
3193
+ onMouseLeave: () => O(),
3189
3194
  onDropdownOpenChange: E
3190
3195
  }
3191
3196
  )
3192
3197
  ] });
3193
3198
  }
3194
- const Bi = "MinimizedView-module_button", Vi = "MinimizedView-module_chevron", zi = "MinimizedView-module_title", Ct = {
3199
+ const Bi = "MinimizedView-module_button", Vi = "MinimizedView-module_chevron", Zi = "MinimizedView-module_title", Ct = {
3195
3200
  button: Bi,
3196
3201
  chevron: Vi,
3197
- title: zi
3202
+ title: Zi
3198
3203
  };
3199
3204
  function gn({
3200
3205
  icon: e = /* @__PURE__ */ a(Lt, { size: 26 }),
@@ -3248,8 +3253,8 @@ function gn({
3248
3253
  }
3249
3254
  );
3250
3255
  }
3251
- const Zi = "Chat-module_container", Gi = "Chat-module_embedded", Yi = "Chat-module_floating", Ki = "Chat-module_content", Ji = "Chat-module_expanded", me = {
3252
- container: Zi,
3256
+ const zi = "Chat-module_container", Gi = "Chat-module_embedded", Yi = "Chat-module_floating", Ki = "Chat-module_content", Ji = "Chat-module_expanded", me = {
3257
+ container: zi,
3253
3258
  embedded: Gi,
3254
3259
  floating: Yi,
3255
3260
  content: Ki,
@@ -3269,22 +3274,22 @@ function pn({
3269
3274
  onOpen: p,
3270
3275
  onExpand: l,
3271
3276
  onClose: w,
3272
- onStop: C,
3277
+ onStop: y,
3273
3278
  emptyView: R,
3274
3279
  floatingChatState: f,
3275
3280
  suggestions: M,
3276
3281
  clearSuggestions: v,
3277
3282
  onSuggestionClick: h,
3278
- onSuggestionsRendered: b,
3279
- messageRenderer: O,
3283
+ onSuggestionsRendered: C,
3284
+ messageRenderer: L,
3280
3285
  messagesPosition: N,
3281
3286
  showAgentIcon: x,
3282
3287
  className: X,
3283
3288
  inputValue: U,
3284
3289
  onInputChange: S,
3285
- draggableStates: L = ["expanded"],
3290
+ draggableStates: O = ["expanded"],
3286
3291
  // Default to only expanded for backward compatibility
3287
- locale: y = "en",
3292
+ locale: b = "en",
3288
3293
  maxInputLength: E = 600,
3289
3294
  // Default to 600 characters
3290
3295
  onInputLimitExceeded: H,
@@ -3305,14 +3310,14 @@ function pn({
3305
3310
  onResize: V,
3306
3311
  onResizeEnd: be
3307
3312
  }) {
3308
- const Fe = U !== void 0, [Ve, ze] = J(""), Ce = Fe ? U : Ve, Ze = Fe ? S : ze, d = Ja(f), $ = D(!1), W = D(!1), Z = D(!1), [oe, pe] = J(!1), [_e, Oe] = J(!1), Se = Br(), [De, pt] = J(!1);
3313
+ const Fe = U !== void 0, [Ve, Ze] = J(""), Ce = Fe ? U : Ve, ze = Fe ? S : Ze, d = Ja(f), $ = D(!1), W = D(!1), z = D(!1), [oe, pe] = J(!1), [_e, Oe] = J(!1), Se = Br(), [De, pt] = J(!1);
3309
3314
  P(() => {
3310
- $r(y, {
3315
+ $r(b, {
3311
3316
  domain: "a8c-agenttic"
3312
3317
  }) || console.warn(
3313
- `Translations could not be loaded for locale: ${y}, defaulting to English`
3318
+ `Translations could not be loaded for locale: ${b}, defaulting to English`
3314
3319
  );
3315
- }, [y]), P(() => {
3320
+ }, [b]), P(() => {
3316
3321
  const j = Ce.length > 0, ce = _e && Se && j;
3317
3322
  ce !== De && (pt(ce), B == null || B(ce));
3318
3323
  }, [
@@ -3330,15 +3335,15 @@ function pn({
3330
3335
  P(() => {
3331
3336
  fe && (H == null || H());
3332
3337
  }, [fe, H]), P(() => {
3333
- $.current = !1, W.current = !1, Z.current = !1;
3338
+ $.current = !1, W.current = !1, z.current = !1;
3334
3339
  }, [d.state]);
3335
3340
  const ke = D(/* @__PURE__ */ new Set()), Ge = T(() => {
3336
3341
  ke.current.forEach((j) => {
3337
3342
  clearTimeout(j);
3338
3343
  }), ke.current.clear();
3339
- }, []), z = qa({
3344
+ }, []), Z = qa({
3340
3345
  value: Ce,
3341
- setValue: Ze,
3346
+ setValue: ze,
3342
3347
  onSubmit: async (j) => {
3343
3348
  d.state !== "expanded" && (l == null || l()), d.setState("expanded"), await o(j);
3344
3349
  },
@@ -3376,8 +3381,8 @@ function pn({
3376
3381
  onFreeDragEnd: ae,
3377
3382
  onResize: V,
3378
3383
  onResizeEnd: be
3379
- }), ot = D(b);
3380
- ot.current = b;
3384
+ }), ot = D(C);
3385
+ ot.current = C;
3381
3386
  const vt = D(""), Dt = !!(M != null && M.length);
3382
3387
  P(() => {
3383
3388
  Dt || (vt.current = "");
@@ -3395,14 +3400,14 @@ function pn({
3395
3400
  ve && await o(ve);
3396
3401
  } else {
3397
3402
  const ve = Te.endsWith(" ") ? Te : `${Te} `;
3398
- z.setValue(ve), v == null || v(), z.textareaRef.current && (z.textareaRef.current.focus(), z.textareaRef.current.setSelectionRange(
3403
+ Z.setValue(ve), v == null || v(), Z.textareaRef.current && (Z.textareaRef.current.focus(), Z.textareaRef.current.setSelectionRange(
3399
3404
  ve.length,
3400
3405
  ve.length
3401
3406
  ));
3402
3407
  }
3403
3408
  h == null || h(j, ce);
3404
3409
  },
3405
- [v, o, h, z]
3410
+ [v, o, h, Z]
3406
3411
  ), yt = T(() => {
3407
3412
  $.current = !0, d.open(), p == null || p(), l == null || l();
3408
3413
  }, [d, p, l]), Ke = T(() => {
@@ -3424,13 +3429,13 @@ function pn({
3424
3429
  ke.current.add(j);
3425
3430
  }
3426
3431
  }, [d, Ke]), Pt = T(async () => {
3427
- const j = z.value.trim();
3428
- z.clear(), d.state !== "expanded" && (l == null || l()), d.setState("expanded"), await o(j);
3429
- }, [z, o, d, l]), Et = T(() => {
3430
- Z.current = !0, l == null || l(), d.setState("expanded");
3432
+ const j = Z.value.trim();
3433
+ Z.clear(), d.state !== "expanded" && (l == null || l()), d.setState("expanded"), await o(j);
3434
+ }, [Z, o, d, l]), Et = T(() => {
3435
+ z.current = !0, l == null || l(), d.setState("expanded");
3431
3436
  }, [l, d]), xn = T(() => {
3432
- W.current = !0, z.clear(), d.close(), w && w();
3433
- }, [z, d, w]), xt = D(d.state), $n = xt.current === "compact" && d.state === "expanded";
3437
+ W.current = !0, Z.clear(), d.close(), w && w();
3438
+ }, [Z, d, w]), xt = D(d.state), $n = xt.current === "compact" && d.state === "expanded";
3434
3439
  P(() => {
3435
3440
  Ge(), xt.current = d.state;
3436
3441
  }, [d.state, Ge]), P(() => {
@@ -3445,7 +3450,7 @@ function pn({
3445
3450
  const j = He.current.scrollHeight + I.PADDING;
3446
3451
  mt(j);
3447
3452
  }
3448
- }, [d.state, z.value]);
3453
+ }, [d.state, Z.value]);
3449
3454
  const Fn = R && ["floating", "embedded"].includes(s) && t.length === 0 && ne.isValidElement(R) ? ne.cloneElement(R, {
3450
3455
  onSuggestionClick: wt
3451
3456
  }) : void 0, Hn = fe ? {
@@ -3465,20 +3470,20 @@ function pn({
3465
3470
  isProcessing: r,
3466
3471
  error: n,
3467
3472
  // Input state
3468
- inputValue: z.value,
3469
- setInputValue: z.setValue,
3470
- clearInput: z.clear,
3471
- textareaRef: z.textareaRef,
3472
- handleKeyDown: z.handleKeyDown,
3473
+ inputValue: Z.value,
3474
+ setInputValue: Z.setValue,
3475
+ clearInput: Z.clear,
3476
+ textareaRef: Z.textareaRef,
3477
+ handleKeyDown: Z.handleKeyDown,
3473
3478
  // Actions
3474
3479
  onSubmit: o,
3475
3480
  handleSubmit: Pt,
3476
- onStop: C,
3481
+ onStop: y,
3477
3482
  // UI state
3478
3483
  variant: s,
3479
3484
  placeholder: u,
3480
3485
  emptyView: Fn,
3481
- messageRenderer: O,
3486
+ messageRenderer: L,
3482
3487
  messagesPosition: N,
3483
3488
  showAgentIcon: x,
3484
3489
  // Floating chat specific
@@ -3497,9 +3502,9 @@ function pn({
3497
3502
  // Thinking message
3498
3503
  thinkingMessage: A,
3499
3504
  // Internal state for components
3500
- focusOnMount: Z.current,
3505
+ focusOnMount: z.current,
3501
3506
  fromCompact: $n,
3502
- showExpandButton: !z.value.trim(),
3507
+ showExpandButton: !Z.value.trim(),
3503
3508
  // Input validation
3504
3509
  isInputOverLimit: fe,
3505
3510
  // Focus handlers for typing status
@@ -3546,7 +3551,7 @@ function pn({
3546
3551
  animating: oe
3547
3552
  }),
3548
3553
  onMouseLeave: d.state === "compact" ? Rt : void 0,
3549
- drag: L.includes(d.state),
3554
+ drag: O.includes(d.state),
3550
3555
  dragControls: it,
3551
3556
  dragListener: !1,
3552
3557
  dragConstraints: Re ? St : !1,
@@ -3565,7 +3570,7 @@ function pn({
3565
3570
  x: ht,
3566
3571
  y: ft,
3567
3572
  left: I.VIEWPORT_OFFSET,
3568
- cursor: L.includes(d.state) ? "grab" : "default"
3573
+ cursor: O.includes(d.state) ? "grab" : "default"
3569
3574
  },
3570
3575
  children: [
3571
3576
  /* @__PURE__ */ a(
@@ -3584,7 +3589,7 @@ function pn({
3584
3589
  x: d.state === "collapsed" && ee === "right" ? I.COMPACT_WIDTH - I.COLLAPSED_SIZE : 0,
3585
3590
  borderBottomLeftRadius: d.state === "minimized" ? 0 : I.BORDER_RADIUS,
3586
3591
  borderBottomRightRadius: d.state === "minimized" ? 0 : I.BORDER_RADIUS,
3587
- transition: z.value.trim() ? { duration: 0 } : ge
3592
+ transition: Z.value.trim() ? { duration: 0 } : ge
3588
3593
  },
3589
3594
  onAnimationStart: () => pe(!0),
3590
3595
  onAnimationComplete: () => pe(!1),
@@ -3617,19 +3622,19 @@ function pn({
3617
3622
  d.state === "compact" && /* @__PURE__ */ a("div", { ref: He, children: /* @__PURE__ */ a(
3618
3623
  un,
3619
3624
  {
3620
- value: z.value,
3621
- onChange: z.setValue,
3625
+ value: Z.value,
3626
+ onChange: Z.setValue,
3622
3627
  onSubmit: Pt,
3623
- onKeyDown: z.handleKeyDown,
3624
- textareaRef: z.textareaRef,
3628
+ onKeyDown: Z.handleKeyDown,
3629
+ textareaRef: Z.textareaRef,
3625
3630
  placeholder: u,
3626
3631
  isProcessing: r,
3627
3632
  onBlur: Rt,
3628
3633
  onFocus: nt,
3629
3634
  onExpand: Et,
3630
- showExpandButton: !z.value.trim(),
3635
+ showExpandButton: !Z.value.trim(),
3631
3636
  focusOnMount: $.current,
3632
- onStop: C,
3637
+ onStop: y,
3633
3638
  suggestions: M,
3634
3639
  clearSuggestions: v,
3635
3640
  handleSuggestionSubmit: wt,
@@ -3818,7 +3823,7 @@ function no({ className: e, size: t = 28 }) {
3818
3823
  const ro = "MessageActions-module_container", Vt = {
3819
3824
  container: ro
3820
3825
  };
3821
- function zt({
3826
+ function Zt({
3822
3827
  message: e,
3823
3828
  actions: t
3824
3829
  }) {
@@ -3922,11 +3927,11 @@ const io = "Message-module_message", oo = "Message-module_user", so = "Message-m
3922
3927
  ) : void 0,
3923
3928
  children: [
3924
3929
  /* @__PURE__ */ a("div", { className: je.bubble, children: c() }),
3925
- t.role !== "user" && /* @__PURE__ */ a(zt, { message: t })
3930
+ t.role !== "user" && /* @__PURE__ */ a(Zt, { message: t })
3926
3931
  ]
3927
3932
  }
3928
3933
  ),
3929
- t.role === "user" && /* @__PURE__ */ a(zt, { message: t })
3934
+ t.role === "user" && /* @__PURE__ */ a(Zt, { message: t })
3930
3935
  ]
3931
3936
  }
3932
3937
  );
@@ -3977,10 +3982,10 @@ function fn({
3977
3982
  const u = D(null), m = bo(e);
3978
3983
  to({ scrollAreaRef: u, visibleMessages: m });
3979
3984
  const p = tt(() => {
3980
- const C = m.filter(
3985
+ const y = m.filter(
3981
3986
  (f) => f.role === "agent"
3982
3987
  );
3983
- return C.length ? C[C.length - 1].content.filter((f) => f.type === "text").map((f) => f.text).join(" ") : "";
3988
+ return y.length ? y[y.length - 1].content.filter((f) => f.type === "text").map((f) => f.text).join(" ") : "";
3984
3989
  }, [m]), [l] = Kn(p, 1e3), w = p !== l;
3985
3990
  return m.length === 0 && !t ? n ? /* @__PURE__ */ a(
3986
3991
  "div",
@@ -4020,26 +4025,26 @@ function fn({
4020
4025
  ),
4021
4026
  ref: u,
4022
4027
  children: /* @__PURE__ */ k(at, { mode: "popLayout", children: [
4023
- m.flatMap((C) => {
4028
+ m.flatMap((y) => {
4024
4029
  var f;
4025
4030
  const R = [
4026
4031
  /* @__PURE__ */ a(
4027
4032
  po,
4028
4033
  {
4029
- message: C,
4034
+ message: y,
4030
4035
  messageRenderer: o,
4031
4036
  showAgentIcon: c
4032
4037
  },
4033
- C.reactKey || C.id
4038
+ y.reactKey || y.id
4034
4039
  )
4035
4040
  ];
4036
- return C.role === "agent" && ((f = C.sources) != null && f.length) && R.push(
4041
+ return y.role === "agent" && ((f = y.sources) != null && f.length) && R.push(
4037
4042
  /* @__PURE__ */ a(
4038
- Zn,
4043
+ zn,
4039
4044
  {
4040
- sources: C.sources
4045
+ sources: y.sources
4041
4046
  },
4042
- `${C.reactKey || C.id}-sources`
4047
+ `${y.reactKey || y.id}-sources`
4043
4048
  )
4044
4049
  ), R;
4045
4050
  }),
@@ -4123,24 +4128,24 @@ function wn({
4123
4128
  setInputValue: p,
4124
4129
  handleSubmit: l,
4125
4130
  handleKeyDown: w,
4126
- textareaRef: C,
4131
+ textareaRef: y,
4127
4132
  placeholder: R,
4128
4133
  isProcessing: f,
4129
4134
  onStop: M,
4130
4135
  fromCompact: v,
4131
4136
  onExpand: h,
4132
- showExpandButton: b,
4133
- focusOnMount: O,
4137
+ showExpandButton: C,
4138
+ focusOnMount: L,
4134
4139
  onInputFocus: N,
4135
4140
  onInputBlur: x
4136
- } = Le(), X = (L) => {
4137
- s == null || s(L), !L.defaultPrevented && w(L);
4141
+ } = Le(), X = (O) => {
4142
+ s == null || s(O), !O.defaultPrevented && w(O);
4138
4143
  }, U = tt(() => c ? [{
4139
4144
  id: "image-upload",
4140
4145
  icon: /* @__PURE__ */ a(Co, {}),
4141
4146
  onClick: () => {
4142
- var y;
4143
- return (y = c.current) == null ? void 0 : y.openFileDialog();
4147
+ var b;
4148
+ return (b = c.current) == null ? void 0 : b.openFileDialog();
4144
4149
  },
4145
4150
  variant: "ghost",
4146
4151
  disabled: u,
@@ -4155,14 +4160,14 @@ function wn({
4155
4160
  onKeyDown: X,
4156
4161
  onFocus: N,
4157
4162
  onBlur: x,
4158
- textareaRef: C,
4163
+ textareaRef: y,
4159
4164
  placeholder: R,
4160
4165
  isProcessing: f,
4161
4166
  onStop: M,
4162
4167
  fromCompact: v,
4163
4168
  onExpand: h,
4164
- showExpandButton: b,
4165
- focusOnMount: O,
4169
+ showExpandButton: C,
4170
+ focusOnMount: L,
4166
4171
  disabled: t,
4167
4172
  readOnly: r,
4168
4173
  customActions: U,
@@ -4579,18 +4584,18 @@ function Bo({
4579
4584
  disabled: p,
4580
4585
  notice: l,
4581
4586
  suggestions: w,
4582
- clearSuggestions: C,
4587
+ clearSuggestions: y,
4583
4588
  focusOnMount: R,
4584
4589
  customActions: f,
4585
4590
  actionOrder: M,
4586
4591
  complianceDisclosure: v = /* @__PURE__ */ a(Qt, {})
4587
4592
  }) {
4588
4593
  const h = T(
4589
- (b) => {
4590
- const O = b.prompt ?? b.label;
4591
- t(O), C == null || C();
4594
+ (C) => {
4595
+ const L = C.prompt ?? C.label;
4596
+ t(L), y == null || y();
4592
4597
  },
4593
- [t, C]
4598
+ [t, y]
4594
4599
  );
4595
4600
  return /* @__PURE__ */ k(Ie, { children: [
4596
4601
  /* @__PURE__ */ k(
@@ -4646,7 +4651,7 @@ function Bo({
4646
4651
  /* @__PURE__ */ a(ea, { children: v })
4647
4652
  ] });
4648
4653
  }
4649
- function Zt({
4654
+ function zt({
4650
4655
  messages: e,
4651
4656
  error: t,
4652
4657
  inputValue: r,
@@ -4660,14 +4665,14 @@ function Zt({
4660
4665
  fromCompact: p = !1,
4661
4666
  showHeader: l = !1,
4662
4667
  onClose: w,
4663
- onExpand: C,
4668
+ onExpand: y,
4664
4669
  notice: R,
4665
4670
  emptyView: f,
4666
4671
  suggestions: M,
4667
4672
  clearSuggestions: v,
4668
4673
  messageRenderer: h,
4669
- showAgentIcon: b,
4670
- focusOnMount: O = !1
4674
+ showAgentIcon: C,
4675
+ focusOnMount: L = !1
4671
4676
  }) {
4672
4677
  return P(() => {
4673
4678
  const N = (x) => {
@@ -4689,7 +4694,7 @@ function Zt({
4689
4694
  error: t,
4690
4695
  emptyView: f,
4691
4696
  messageRenderer: h,
4692
- showAgentIcon: b
4697
+ showAgentIcon: C
4693
4698
  }
4694
4699
  ),
4695
4700
  /* @__PURE__ */ a(
@@ -4704,11 +4709,11 @@ function Zt({
4704
4709
  isProcessing: u,
4705
4710
  onStop: m,
4706
4711
  fromCompact: p,
4707
- onExpand: C,
4712
+ onExpand: y,
4708
4713
  notice: R,
4709
4714
  suggestions: M,
4710
4715
  clearSuggestions: v,
4711
- focusOnMount: O
4716
+ focusOnMount: L
4712
4717
  }
4713
4718
  )
4714
4719
  ]
@@ -4729,22 +4734,22 @@ function qs({
4729
4734
  onExpand: p,
4730
4735
  onClose: l,
4731
4736
  onStop: w,
4732
- emptyView: C,
4737
+ emptyView: y,
4733
4738
  floatingChatState: R,
4734
4739
  suggestions: f,
4735
4740
  clearSuggestions: M,
4736
4741
  messageRenderer: v,
4737
4742
  showAgentIcon: h,
4738
- className: b,
4739
- expandOnHover: O = !0,
4743
+ className: C,
4744
+ expandOnHover: L = !0,
4740
4745
  draggableStates: N = ["expanded"],
4741
4746
  // Default to only expanded for backward compatibility
4742
4747
  freeDrag: x = !1,
4743
4748
  initialFreeDragPosition: X,
4744
4749
  onFreeDragEnd: U,
4745
4750
  initialChatPosition: S,
4746
- onChatPositionChange: L,
4747
- resizable: y = !1,
4751
+ onChatPositionChange: O,
4752
+ resizable: b = !1,
4748
4753
  defaultSize: E,
4749
4754
  size: H,
4750
4755
  minSize: Q,
@@ -4769,13 +4774,13 @@ function qs({
4769
4774
  isProcessing: t,
4770
4775
  floatingChatState: g.state
4771
4776
  }), be = D(null), [Fe, Ve] = J(56), {
4772
- x: ze,
4777
+ x: Ze,
4773
4778
  y: Ce,
4774
- currentSide: Ze,
4779
+ currentSide: ze,
4775
4780
  isDragging: d,
4776
4781
  dragControls: $,
4777
4782
  chatRef: W,
4778
- constraintsRef: Z,
4783
+ constraintsRef: z,
4779
4784
  handlePointerDown: oe,
4780
4785
  handleDragStart: pe,
4781
4786
  handleDragEnd: _e,
@@ -4785,7 +4790,7 @@ function qs({
4785
4790
  getHeightForState: pt,
4786
4791
  handleResizePointerDown: nt
4787
4792
  } = nn({
4788
- resizable: y,
4793
+ resizable: b,
4789
4794
  defaultSize: E,
4790
4795
  size: H,
4791
4796
  minSize: Q,
@@ -4795,7 +4800,7 @@ function qs({
4795
4800
  freeDrag: x,
4796
4801
  initialFreeDragPosition: X,
4797
4802
  initialChatPosition: S,
4798
- onChatPositionChange: L,
4803
+ onChatPositionChange: O,
4799
4804
  onFreeDragEnd: U,
4800
4805
  onResize: A,
4801
4806
  onResizeEnd: _
@@ -4806,20 +4811,20 @@ function qs({
4806
4811
  const ee = (it = (Re = W.current) == null ? void 0 : Re.ownerDocument) == null ? void 0 : it.activeElement;
4807
4812
  return !(ee && ((Pe = W.current) != null && Pe.contains(ee)) || K.trim());
4808
4813
  }, [K, W]), ke = T(() => {
4809
- if (O && g.state === "collapsed" && (g.setState("compact"), g.initialState === "collapsed")) {
4814
+ if (L && g.state === "collapsed" && (g.setState("compact"), g.initialState === "collapsed")) {
4810
4815
  const ee = setTimeout(() => {
4811
4816
  g.state === "compact" && fe() && g.setState("collapsed"), se.current.delete(ee);
4812
4817
  }, I.AUTO_COLLAPSE_DELAY);
4813
4818
  se.current.add(ee);
4814
4819
  }
4815
- }, [g, fe, O]), Ge = T(() => {
4820
+ }, [g, fe, L]), Ge = T(() => {
4816
4821
  if (g.initialState === "collapsed" && g.state === "compact" && fe()) {
4817
4822
  const ee = setTimeout(() => {
4818
4823
  g.state === "compact" && fe() && g.setState("collapsed"), se.current.delete(ee);
4819
4824
  }, I.AUTO_COLLAPSE_DELAY);
4820
4825
  se.current.add(ee);
4821
4826
  }
4822
- }, [g, fe]), z = T(async () => {
4827
+ }, [g, fe]), Z = T(async () => {
4823
4828
  if (V.value.trim()) {
4824
4829
  const ee = V.value.trim();
4825
4830
  V.clear(), g.state !== "expanded" && (p == null || p()), g.setState("expanded"), await n(ee);
@@ -4848,14 +4853,14 @@ function qs({
4848
4853
  "div",
4849
4854
  {
4850
4855
  "data-slot": "chat-embedded",
4851
- className: te(b, me.container, me.embedded),
4856
+ className: te(C, me.container, me.embedded),
4852
4857
  children: /* @__PURE__ */ a(
4853
- Zt,
4858
+ zt,
4854
4859
  {
4855
4860
  messages: e,
4856
4861
  inputValue: V.value,
4857
4862
  onInputChange: V.setValue,
4858
- onSubmit: z,
4863
+ onSubmit: Z,
4859
4864
  onKeyDown: V.handleKeyDown,
4860
4865
  textareaRef: V.textareaRef,
4861
4866
  placeholder: c,
@@ -4866,7 +4871,7 @@ function qs({
4866
4871
  suggestions: f,
4867
4872
  clearSuggestions: M,
4868
4873
  error: r,
4869
- emptyView: C,
4874
+ emptyView: y,
4870
4875
  messageRenderer: v,
4871
4876
  showAgentIcon: h,
4872
4877
  onExpand: Ye,
@@ -4875,12 +4880,12 @@ function qs({
4875
4880
  )
4876
4881
  }
4877
4882
  );
4878
- const ft = y && g.state === "expanded";
4883
+ const ft = b && g.state === "expanded";
4879
4884
  return /* @__PURE__ */ k(Ie, { children: [
4880
4885
  /* @__PURE__ */ a(
4881
4886
  "div",
4882
4887
  {
4883
- ref: Z,
4888
+ ref: z,
4884
4889
  style: {
4885
4890
  position: "fixed",
4886
4891
  top: I.VIEWPORT_OFFSET,
@@ -4897,7 +4902,7 @@ function qs({
4897
4902
  {
4898
4903
  ref: W,
4899
4904
  "data-slot": "chat-floating",
4900
- className: te(b, me.container, me.floating, {
4905
+ className: te(C, me.container, me.floating, {
4901
4906
  [me.expanded]: g.state === "expanded",
4902
4907
  animating: de
4903
4908
  }),
@@ -4905,7 +4910,7 @@ function qs({
4905
4910
  drag: N.includes(g.state),
4906
4911
  dragControls: $,
4907
4912
  dragListener: !1,
4908
- dragConstraints: d ? Z : !1,
4913
+ dragConstraints: d ? z : !1,
4909
4914
  dragMomentum: !1,
4910
4915
  dragElastic: x ? 0 : 0.1,
4911
4916
  dragTransition: { power: 0.1, timeConstant: 100 },
@@ -4918,7 +4923,7 @@ function qs({
4918
4923
  },
4919
4924
  transition: ge,
4920
4925
  style: {
4921
- x: ze,
4926
+ x: Ze,
4922
4927
  y: Ce,
4923
4928
  left: I.VIEWPORT_OFFSET,
4924
4929
  cursor: N.includes(g.state) ? "grab" : "default"
@@ -4927,17 +4932,17 @@ function qs({
4927
4932
  /* @__PURE__ */ a(
4928
4933
  ie.div,
4929
4934
  {
4930
- layout: !(y && De),
4935
+ layout: !(b && De),
4931
4936
  className: me.content,
4932
4937
  initial: !1,
4933
4938
  animate: {
4934
4939
  // When resizable, size is owned by the width/height motion
4935
4940
  // values (driven imperatively); keep it out of animate here.
4936
- ...y ? {} : {
4941
+ ...b ? {} : {
4937
4942
  width: g.state === "collapsed" ? I.COLLAPSED_SIZE : I.COMPACT_WIDTH,
4938
4943
  height: pt(g.state)
4939
4944
  },
4940
- x: g.state === "collapsed" && Ze === "right" ? I.COMPACT_WIDTH - I.COLLAPSED_SIZE : 0,
4945
+ x: g.state === "collapsed" && ze === "right" ? I.COMPACT_WIDTH - I.COLLAPSED_SIZE : 0,
4941
4946
  borderBottomLeftRadius: g.state === "minimized" ? 0 : I.BORDER_RADIUS,
4942
4947
  borderBottomRightRadius: g.state === "minimized" ? 0 : I.BORDER_RADIUS,
4943
4948
  transition: V.value.trim() ? { duration: 0 } : ge
@@ -4947,7 +4952,7 @@ function qs({
4947
4952
  style: {
4948
4953
  borderTopLeftRadius: I.BORDER_RADIUS,
4949
4954
  borderTopRightRadius: I.BORDER_RADIUS,
4950
- ...y ? { width: Oe, height: Se } : {}
4955
+ ...b ? { width: Oe, height: Se } : {}
4951
4956
  },
4952
4957
  children: /* @__PURE__ */ k(at, { mode: "wait", children: [
4953
4958
  g.state === "collapsed" && /* @__PURE__ */ a(
@@ -4975,7 +4980,7 @@ function qs({
4975
4980
  {
4976
4981
  value: V.value,
4977
4982
  onChange: V.setValue,
4978
- onSubmit: z,
4983
+ onSubmit: Z,
4979
4984
  onKeyDown: V.handleKeyDown,
4980
4985
  textareaRef: V.textareaRef,
4981
4986
  placeholder: c,
@@ -4991,12 +4996,12 @@ function qs({
4991
4996
  "compact"
4992
4997
  ) }),
4993
4998
  g.state === "expanded" && /* @__PURE__ */ a(
4994
- Zt,
4999
+ zt,
4995
5000
  {
4996
5001
  messages: e,
4997
5002
  inputValue: V.value,
4998
5003
  onInputChange: V.setValue,
4999
- onSubmit: z,
5004
+ onSubmit: Z,
5000
5005
  onKeyDown: V.handleKeyDown,
5001
5006
  textareaRef: V.textareaRef,
5002
5007
  placeholder: c,
@@ -5009,7 +5014,7 @@ function qs({
5009
5014
  suggestions: f,
5010
5015
  clearSuggestions: M,
5011
5016
  error: r,
5012
- emptyView: C,
5017
+ emptyView: y,
5013
5018
  messageRenderer: v,
5014
5019
  showAgentIcon: h,
5015
5020
  onExpand: Ye,
@@ -5023,7 +5028,7 @@ function qs({
5023
5028
  ft && /* @__PURE__ */ a(
5024
5029
  sn,
5025
5030
  {
5026
- resizable: y,
5031
+ resizable: b,
5027
5032
  onPointerDown: nt
5028
5033
  }
5029
5034
  )
@@ -5032,10 +5037,10 @@ function qs({
5032
5037
  )
5033
5038
  ] });
5034
5039
  }
5035
- const Vo = "ImageUploader-module_container", zo = "ImageUploader-module_active", Zo = "ImageUploader-module_uploader", Go = "ImageUploader-module_uploading", Yo = "ImageUploader-module_content", Ko = "ImageUploader-module_hiddenInput", Jo = "ImageUploader-module_clickArea", qo = "ImageUploader-module_clickAreaDisabled", Xo = "ImageUploader-module_draggingMessage", Qo = "ImageUploader-module_draggingOver", es = "ImageUploader-module_preview", ts = "ImageUploader-module_previewItem", as = "ImageUploader-module_removeButton", ns = "ImageUploader-module_previewImage", rs = "ImageUploader-module_previewMeta", is = "ImageUploader-module_previewFilename", os = "ImageUploader-module_previewType", ss = "ImageUploader-module_uploadingItem", cs = "ImageUploader-module_uploadingIndicator", ls = "ImageUploader-module_thumbnail", ds = "ImageUploader-module_uploadingOverlay", us = "ImageUploader-module_spinner", gs = "ImageUploader-module_invalidMessage", G = {
5040
+ const Vo = "ImageUploader-module_container", Zo = "ImageUploader-module_active", zo = "ImageUploader-module_uploader", Go = "ImageUploader-module_uploading", Yo = "ImageUploader-module_content", Ko = "ImageUploader-module_hiddenInput", Jo = "ImageUploader-module_clickArea", qo = "ImageUploader-module_clickAreaDisabled", Xo = "ImageUploader-module_draggingMessage", Qo = "ImageUploader-module_draggingOver", es = "ImageUploader-module_preview", ts = "ImageUploader-module_previewItem", as = "ImageUploader-module_removeButton", ns = "ImageUploader-module_previewImage", rs = "ImageUploader-module_previewMeta", is = "ImageUploader-module_previewFilename", os = "ImageUploader-module_previewType", ss = "ImageUploader-module_uploadingItem", cs = "ImageUploader-module_uploadingIndicator", ls = "ImageUploader-module_thumbnail", ds = "ImageUploader-module_uploadingOverlay", us = "ImageUploader-module_spinner", gs = "ImageUploader-module_invalidMessage", G = {
5036
5041
  container: Vo,
5037
- active: zo,
5038
- uploader: Zo,
5042
+ active: Zo,
5043
+ uploader: zo,
5039
5044
  uploading: Go,
5040
5045
  content: Yo,
5041
5046
  hiddenInput: Ko,
@@ -5150,34 +5155,34 @@ const Vo = "ImageUploader-module_container", zo = "ImageUploader-module_active",
5150
5155
  acceptedFileTypes: p = ["image/jpeg", "image/png"],
5151
5156
  maxFileSize: l,
5152
5157
  maxFiles: w,
5153
- uploadingIndicator: C,
5158
+ uploadingIndicator: y,
5154
5159
  className: R = "",
5155
5160
  showFileMetadata: f = !0,
5156
5161
  allowDragToInsert: M = !0,
5157
5162
  onError: v,
5158
5163
  visible: h = !0,
5159
- disabled: b = !1,
5160
- dropZoneRef: O
5164
+ disabled: C = !1,
5165
+ dropZoneRef: L
5161
5166
  }, N) {
5162
- const { textareaRef: x } = Le(), [X, U] = J(!1), [S, L] = J(!1), [y, E] = J(!1), H = D(null), Q = D(null), Y = D(0), A = D(b);
5167
+ const { textareaRef: x } = Le(), [X, U] = J(!1), [S, O] = J(!1), [b, E] = J(!1), H = D(null), Q = D(null), Y = D(0), A = D(C);
5163
5168
  P(() => {
5164
- A.current = b, b && (Y.current = 0, L(!1), U(!1));
5165
- }, [b]);
5169
+ A.current = C, C && (Y.current = 0, O(!1), U(!1));
5170
+ }, [C]);
5166
5171
  const _ = () => {
5167
5172
  var d;
5168
- b || (d = H.current) == null || d.click();
5173
+ C || (d = H.current) == null || d.click();
5169
5174
  };
5170
5175
  Vn(N, () => ({ openFileDialog: _ })), P(() => {
5171
- const d = O ? O.current : window;
5176
+ const d = L ? L.current : window;
5172
5177
  if (!d)
5173
5178
  return;
5174
5179
  const $ = (oe) => {
5175
5180
  var pe, _e;
5176
- A.current || (_e = (pe = oe.dataTransfer) == null ? void 0 : pe.types) != null && _e.includes("Files") && (Y.current += 1, L(!0));
5181
+ A.current || (_e = (pe = oe.dataTransfer) == null ? void 0 : pe.types) != null && _e.includes("Files") && (Y.current += 1, O(!0));
5177
5182
  }, W = (oe) => {
5178
- A.current || (Y.current -= 1, (Y.current === 0 || oe.relatedTarget === null) && (Y.current = 0, L(!1)));
5179
- }, Z = () => {
5180
- Y.current = 0, L(!1);
5183
+ A.current || (Y.current -= 1, (Y.current === 0 || oe.relatedTarget === null) && (Y.current = 0, O(!1)));
5184
+ }, z = () => {
5185
+ Y.current = 0, O(!1);
5181
5186
  };
5182
5187
  return d.addEventListener(
5183
5188
  "dragenter",
@@ -5185,16 +5190,16 @@ const Vo = "ImageUploader-module_container", zo = "ImageUploader-module_active",
5185
5190
  ), d.addEventListener(
5186
5191
  "dragleave",
5187
5192
  W
5188
- ), d.addEventListener("drop", Z), () => {
5193
+ ), d.addEventListener("drop", z), () => {
5189
5194
  d.removeEventListener(
5190
5195
  "dragenter",
5191
5196
  $
5192
5197
  ), d.removeEventListener(
5193
5198
  "dragleave",
5194
5199
  W
5195
- ), d.removeEventListener("drop", Z);
5200
+ ), d.removeEventListener("drop", z);
5196
5201
  };
5197
- }, [O]), P(() => () => {
5202
+ }, [L]), P(() => () => {
5198
5203
  Q.current && clearTimeout(Q.current);
5199
5204
  }, []);
5200
5205
  const K = T((d) => {
@@ -5205,11 +5210,11 @@ const Vo = "ImageUploader-module_container", zo = "ImageUploader-module_active",
5205
5210
  if (!d || d.length === 0)
5206
5211
  return;
5207
5212
  const $ = Array.from(d), W = $.filter(
5208
- (Z) => p.includes(Z.type)
5213
+ (z) => p.includes(z.type)
5209
5214
  );
5210
5215
  if (W.length < $.length) {
5211
5216
  E(!0);
5212
- const Z = p.map((oe) => oe.split("/")[1].toUpperCase()).join(" or ");
5217
+ const z = p.map((oe) => oe.split("/")[1].toUpperCase()).join(" or ");
5213
5218
  v == null || v(
5214
5219
  Ee(
5215
5220
  /* translators: %s: allowed file types (e.g., "JPEG or PNG") */
@@ -5217,7 +5222,7 @@ const Vo = "ImageUploader-module_container", zo = "ImageUploader-module_active",
5217
5222
  "Only %s image files are allowed.",
5218
5223
  "a8c-agenttic"
5219
5224
  ),
5220
- Z
5225
+ z
5221
5226
  )
5222
5227
  ), Q.current && clearTimeout(Q.current), Q.current = setTimeout(() => {
5223
5228
  E(!1);
@@ -5231,8 +5236,8 @@ const Vo = "ImageUploader-module_container", zo = "ImageUploader-module_active",
5231
5236
  w
5232
5237
  )
5233
5238
  );
5234
- const Z = W.slice(0, w);
5235
- Z.length > 0 && n(Z);
5239
+ const z = W.slice(0, w);
5240
+ z.length > 0 && n(z);
5236
5241
  return;
5237
5242
  }
5238
5243
  W.length > 0 && n(W);
@@ -5242,14 +5247,14 @@ const Vo = "ImageUploader-module_container", zo = "ImageUploader-module_active",
5242
5247
  P(() => {
5243
5248
  g.current = B;
5244
5249
  }, [B]), P(() => {
5245
- const d = O == null ? void 0 : O.current;
5250
+ const d = L == null ? void 0 : L.current;
5246
5251
  if (!d)
5247
5252
  return;
5248
- const $ = (Z) => {
5249
- Z.preventDefault();
5250
- }, W = (Z) => {
5253
+ const $ = (z) => {
5254
+ z.preventDefault();
5255
+ }, W = (z) => {
5251
5256
  var oe;
5252
- Z.preventDefault(), Y.current = 0, L(!1), U(!1), (oe = Z.dataTransfer) != null && oe.files && !A.current && (g.current(Z.dataTransfer.files), s == null || s(Array.from(Z.dataTransfer.files)));
5257
+ z.preventDefault(), Y.current = 0, O(!1), U(!1), (oe = z.dataTransfer) != null && oe.files && !A.current && (g.current(z.dataTransfer.files), s == null || s(Array.from(z.dataTransfer.files)));
5253
5258
  };
5254
5259
  return d.addEventListener("dragover", $), d.addEventListener("drop", W), () => {
5255
5260
  d.removeEventListener(
@@ -5257,13 +5262,13 @@ const Vo = "ImageUploader-module_container", zo = "ImageUploader-module_active",
5257
5262
  $
5258
5263
  ), d.removeEventListener("drop", W);
5259
5264
  };
5260
- }, [O, s]), P(() => {
5265
+ }, [L, s]), P(() => {
5261
5266
  const d = ($) => {
5262
5267
  var _e;
5263
5268
  if (A.current)
5264
5269
  return;
5265
- const W = x.current && document.activeElement === x.current, Z = x.current && $.target && ($.target === x.current || x.current.contains($.target));
5266
- if (!W && !Z)
5270
+ const W = x.current && document.activeElement === x.current, z = x.current && $.target && ($.target === x.current || x.current.contains($.target));
5271
+ if (!W && !z)
5267
5272
  return;
5268
5273
  const oe = (_e = $.clipboardData) == null ? void 0 : _e.items;
5269
5274
  if (!oe)
@@ -5283,16 +5288,16 @@ const Vo = "ImageUploader-module_container", zo = "ImageUploader-module_active",
5283
5288
  };
5284
5289
  }, [i, x]);
5285
5290
  const q = (d) => {
5286
- d.preventDefault(), d.stopPropagation(), b || U(!0);
5291
+ d.preventDefault(), d.stopPropagation(), C || U(!0);
5287
5292
  }, ae = (d) => {
5288
5293
  d.preventDefault(), d.stopPropagation(), U(!1);
5289
5294
  }, re = (d) => {
5290
- if (d.preventDefault(), d.stopPropagation(), U(!1), Y.current = 0, L(!1), d.dataTransfer.files && !b) {
5295
+ if (d.preventDefault(), d.stopPropagation(), U(!1), Y.current = 0, O(!1), d.dataTransfer.files && !C) {
5291
5296
  const $ = Array.from(d.dataTransfer.files);
5292
5297
  B(d.dataTransfer.files), s == null || s($);
5293
5298
  }
5294
5299
  }, de = (d) => {
5295
- if (d.target.files && !b) {
5300
+ if (d.target.files && !C) {
5296
5301
  const $ = Array.from(d.target.files);
5297
5302
  B(d.target.files), o == null || o($);
5298
5303
  }
@@ -5315,11 +5320,11 @@ const Vo = "ImageUploader-module_container", zo = "ImageUploader-module_active",
5315
5320
  );
5316
5321
  if (!h)
5317
5322
  return null;
5318
- const V = t.length > 0, be = r.length > 0, Fe = S, Ve = !S && (V || be), ze = V || be || S || y, Ce = l ? Ee(
5323
+ const V = t.length > 0, be = r.length > 0, Fe = S, Ve = !S && (V || be), Ze = V || be || S || b, Ce = l ? Ee(
5319
5324
  /* translators: %s: maximum file size (e.g., "5 MB") */
5320
5325
  F("Upload image files up to %s each.", "a8c-agenttic"),
5321
5326
  K(l)
5322
- ) : "", Ze = Ee(
5327
+ ) : "", ze = Ee(
5323
5328
  /* translators: %s: allowed file types (e.g., "JPEG or PNG") */
5324
5329
  F("Only %s image files are allowed.", "a8c-agenttic"),
5325
5330
  p.map((d) => d.split("/")[1].toUpperCase()).join(" or ")
@@ -5327,14 +5332,14 @@ const Vo = "ImageUploader-module_container", zo = "ImageUploader-module_active",
5327
5332
  return /* @__PURE__ */ a(
5328
5333
  "div",
5329
5334
  {
5330
- className: `${G.container} ${ze ? G.active : ""} ${R}`,
5335
+ className: `${G.container} ${Ze ? G.active : ""} ${R}`,
5331
5336
  "data-slot": "image-uploader",
5332
5337
  children: /* @__PURE__ */ a(
5333
5338
  "div",
5334
5339
  {
5335
5340
  className: `${G.uploader} ${be ? G.uploading : ""} ${X ? G.draggingOver : ""}`,
5336
5341
  children: /* @__PURE__ */ k("div", { className: G.content, children: [
5337
- !y && /* @__PURE__ */ k(Ie, { children: [
5342
+ !b && /* @__PURE__ */ k(Ie, { children: [
5338
5343
  /* @__PURE__ */ a(
5339
5344
  "input",
5340
5345
  {
@@ -5350,15 +5355,15 @@ const Vo = "ImageUploader-module_container", zo = "ImageUploader-module_active",
5350
5355
  "div",
5351
5356
  {
5352
5357
  className: te(G.clickArea, {
5353
- [G.clickAreaDisabled]: b
5358
+ [G.clickAreaDisabled]: C
5354
5359
  }),
5355
5360
  onClick: _,
5356
5361
  onDragOver: q,
5357
5362
  onDragLeave: ae,
5358
5363
  onDrop: re,
5359
5364
  role: "button",
5360
- tabIndex: b ? -1 : 0,
5361
- "aria-disabled": b,
5365
+ tabIndex: C ? -1 : 0,
5366
+ "aria-disabled": C,
5362
5367
  onKeyDown: (d) => {
5363
5368
  (d.key === "Enter" || d.key === " ") && _();
5364
5369
  },
@@ -5382,7 +5387,7 @@ const Vo = "ImageUploader-module_container", zo = "ImageUploader-module_active",
5382
5387
  image: d,
5383
5388
  allowDragToInsert: M,
5384
5389
  showFileMetadata: f,
5385
- disabled: b,
5390
+ disabled: C,
5386
5391
  onDragStart: ye,
5387
5392
  onDragEnd: se,
5388
5393
  onRemove: Ne
@@ -5401,9 +5406,9 @@ const Vo = "ImageUploader-module_container", zo = "ImageUploader-module_active",
5401
5406
  },
5402
5407
  allowDragToInsert: M,
5403
5408
  showFileMetadata: f,
5404
- disabled: b,
5409
+ disabled: C,
5405
5410
  uploading: !0,
5406
- uploadingIndicator: C,
5411
+ uploadingIndicator: y,
5407
5412
  onDragStart: ye,
5408
5413
  onDragEnd: se,
5409
5414
  onRemove: Ne
@@ -5420,7 +5425,7 @@ const Vo = "ImageUploader-module_container", zo = "ImageUploader-module_active",
5420
5425
  "Uploading image",
5421
5426
  "a8c-agenttic"
5422
5427
  ),
5423
- children: C || /* @__PURE__ */ a(
5428
+ children: y || /* @__PURE__ */ a(
5424
5429
  "div",
5425
5430
  {
5426
5431
  className: G.uploadingIndicator,
@@ -5441,7 +5446,7 @@ const Vo = "ImageUploader-module_container", zo = "ImageUploader-module_active",
5441
5446
  }
5442
5447
  )
5443
5448
  ] }),
5444
- y && /* @__PURE__ */ a("div", { className: G.invalidMessage, children: /* @__PURE__ */ a("p", { children: Ze }) })
5449
+ b && /* @__PURE__ */ a("div", { className: G.invalidMessage, children: /* @__PURE__ */ a("p", { children: ze }) })
5445
5450
  ] })
5446
5451
  }
5447
5452
  )
@@ -5912,12 +5917,12 @@ const Ls = (e, t = "") => {
5912
5917
  maxLabelLength: m = 15,
5913
5918
  error: p,
5914
5919
  ...l
5915
- } = e, w = (h, b) => !u || h.length <= b ? h : h.substring(0, b - 3) + "...", C = () => {
5920
+ } = e, w = (h, C) => !u || h.length <= C ? h : h.substring(0, C - 3) + "...", y = () => {
5916
5921
  if (c === "item-comparison" && t && t.length > 0) {
5917
5922
  let h = "";
5918
- return t.forEach((b) => {
5919
- b != null && b.data && b.data.forEach((O) => {
5920
- const N = O.label || "", x = w(N, m);
5923
+ return t.forEach((C) => {
5924
+ C != null && C.data && C.data.forEach((L) => {
5925
+ const N = L.label || "", x = w(N, m);
5921
5926
  x.length > h.length && (h = x);
5922
5927
  });
5923
5928
  }), Mt(80, 6, 25, h.length);
@@ -5925,7 +5930,7 @@ const Ls = (e, t = "") => {
5925
5930
  return Mt();
5926
5931
  }, R = {
5927
5932
  ...kn(i),
5928
- bottom: C()
5933
+ bottom: y()
5929
5934
  }, M = c === "item-comparison" ? {
5930
5935
  xScale: {
5931
5936
  type: "band",
@@ -5970,7 +5975,7 @@ const Ls = (e, t = "") => {
5970
5975
  };
5971
5976
  return /* @__PURE__ */ a(Tn, { error: p, children: /* @__PURE__ */ a(Qn, { ...v }) });
5972
5977
  };
5973
- class Ns extends zn {
5978
+ class Ns extends Zn {
5974
5979
  constructor(t) {
5975
5980
  super(t), this.state = {
5976
5981
  hasError: !1,
@@ -6070,40 +6075,40 @@ const Ss = (e) => {
6070
6075
  ), [c, u] = J(300), m = D(null), p = T(
6071
6076
  (v) => {
6072
6077
  var U;
6073
- const { tooltipData: h } = v, b = (U = h == null ? void 0 : h.nearestDatum) == null ? void 0 : U.datum;
6074
- if (!b)
6078
+ const { tooltipData: h } = v, C = (U = h == null ? void 0 : h.nearestDatum) == null ? void 0 : U.datum;
6079
+ if (!C)
6075
6080
  return null;
6076
- const O = (S) => {
6081
+ const L = (S) => {
6077
6082
  if (s != null && s.currency) {
6078
- const { symbol: L, symbolPosition: y } = s.currency;
6083
+ const { symbol: O, symbolPosition: b } = s.currency;
6079
6084
  let E;
6080
6085
  return S >= 1e6 ? E = `${(S / 1e6).toFixed(
6081
6086
  1
6082
- )}M` : S >= 1e3 ? E = `${(S / 1e3).toFixed(1)}K` : E = S.toLocaleString(), y === "right" ? `${E}${L}` : `${L}${E}`;
6087
+ )}M` : S >= 1e3 ? E = `${(S / 1e3).toFixed(1)}K` : E = S.toLocaleString(), b === "right" ? `${E}${O}` : `${O}${E}`;
6083
6088
  }
6084
6089
  return S >= 1e6 ? `${(S / 1e6).toFixed(1)}M` : S >= 1e3 ? `${(S / 1e3).toFixed(1)}K` : S.toLocaleString();
6085
6090
  }, N = (S) => {
6086
- const y = Math.floor(
6091
+ const b = Math.floor(
6087
6092
  ((/* @__PURE__ */ new Date()).getTime() - S.getTime()) / (1e3 * 60 * 60 * 24)
6088
6093
  );
6089
- return y === 0 ? F("Today", "a8c-agenttic") : y === 1 ? F("Yesterday", "a8c-agenttic") : y < 7 ? Ee(
6094
+ return b === 0 ? F("Today", "a8c-agenttic") : b === 1 ? F("Yesterday", "a8c-agenttic") : b < 7 ? Ee(
6090
6095
  /* translators: %d: number of days */
6091
6096
  F("%d days ago", "a8c-agenttic"),
6092
- y
6097
+ b
6093
6098
  ) : S.toLocaleDateString("en-US", {
6094
6099
  year: "numeric",
6095
6100
  month: "short",
6096
6101
  day: "numeric"
6097
6102
  });
6098
- }, x = b.label, X = Object.entries(
6103
+ }, x = C.label, X = Object.entries(
6099
6104
  (h == null ? void 0 : h.datumByKey) || {}
6100
- ).map(([S, L]) => {
6101
- const y = L.datum;
6105
+ ).map(([S, O]) => {
6106
+ const b = O.datum;
6102
6107
  return {
6103
6108
  key: S,
6104
- value: y.value
6109
+ value: b.value
6105
6110
  };
6106
- }).sort((S, L) => L.value - S.value);
6111
+ }).sort((S, O) => O.value - S.value);
6107
6112
  return /* @__PURE__ */ k("div", { children: [
6108
6113
  x && /* @__PURE__ */ a(
6109
6114
  "div",
@@ -6119,7 +6124,7 @@ const Ss = (e) => {
6119
6124
  children: x
6120
6125
  }
6121
6126
  ),
6122
- b.date && /* @__PURE__ */ a(
6127
+ C.date && /* @__PURE__ */ a(
6123
6128
  "div",
6124
6129
  {
6125
6130
  style: {
@@ -6127,7 +6132,7 @@ const Ss = (e) => {
6127
6132
  opacity: 0.8,
6128
6133
  marginBottom: "4px"
6129
6134
  },
6130
- children: N(b.date)
6135
+ children: N(C.date)
6131
6136
  }
6132
6137
  ),
6133
6138
  X.map((S) => /* @__PURE__ */ k(
@@ -6140,7 +6145,7 @@ const Ss = (e) => {
6140
6145
  ":"
6141
6146
  ] }),
6142
6147
  " ",
6143
- O(S.value)
6148
+ L(S.value)
6144
6149
  ]
6145
6150
  },
6146
6151
  S.key
@@ -6189,13 +6194,13 @@ const Ss = (e) => {
6189
6194
  });
6190
6195
  return;
6191
6196
  }
6192
- const h = v.data.map((O) => ({
6193
- ...O,
6194
- data: O.data.map((N) => {
6197
+ const h = v.data.map((L) => ({
6198
+ ...L,
6199
+ data: L.data.map((N) => {
6195
6200
  if (N.date) {
6196
6201
  const x = new Date(N.date);
6197
6202
  return isNaN(x.getTime()) ? (console.warn(
6198
- `Invalid date string: "${N.date}" in series "${O.label}"`
6203
+ `Invalid date string: "${N.date}" in series "${L.label}"`
6199
6204
  ), {
6200
6205
  label: N.label,
6201
6206
  value: N.value,
@@ -6212,14 +6217,14 @@ const Ss = (e) => {
6212
6217
  date: void 0
6213
6218
  };
6214
6219
  })
6215
- })), b = {
6220
+ })), C = {
6216
6221
  chartType: v.chartType,
6217
6222
  title: v.title,
6218
6223
  data: h,
6219
6224
  currency: v.currency,
6220
6225
  mode: v.mode || "time-comparison"
6221
6226
  };
6222
- i(b);
6227
+ i(C);
6223
6228
  } catch {
6224
6229
  o({
6225
6230
  message: F(
@@ -6232,9 +6237,9 @@ const Ss = (e) => {
6232
6237
  }, [e]);
6233
6238
  const l = T((v) => {
6234
6239
  if (m.current && m.current.disconnect(), v) {
6235
- const { width: h } = v.getBoundingClientRect(), b = Math.max(280, h - 4);
6236
- u(b), m.current = new ResizeObserver((O) => {
6237
- for (const N of O) {
6240
+ const { width: h } = v.getBoundingClientRect(), C = Math.max(280, h - 4);
6241
+ u(C), m.current = new ResizeObserver((L) => {
6242
+ for (const N of L) {
6238
6243
  const x = N.contentRect.width, X = Math.max(
6239
6244
  280,
6240
6245
  x - 4
@@ -6255,10 +6260,10 @@ const Ss = (e) => {
6255
6260
  message: F("No chart data available", "a8c-agenttic")
6256
6261
  }
6257
6262
  );
6258
- const C = s.data.length > 1, R = c, f = {
6263
+ const y = s.data.length > 1, R = c, f = {
6259
6264
  data: s.data,
6260
6265
  currency: s.currency,
6261
- showLegend: C,
6266
+ showLegend: y,
6262
6267
  withTooltips: !0,
6263
6268
  renderTooltip: p,
6264
6269
  error: null,
@@ -6452,7 +6457,7 @@ export {
6452
6457
  dn as ChevronUpIcon,
6453
6458
  cn as CollapsedView,
6454
6459
  un as CompactView,
6455
- Zt as ConversationView,
6460
+ zt as ConversationView,
6456
6461
  rc as CopyIcon,
6457
6462
  fc as DiffCard,
6458
6463
  ec as EmptyView,
@@ -6460,7 +6465,7 @@ export {
6460
6465
  Xs as ImageUploader,
6461
6466
  Ss as LineChart,
6462
6467
  po as Message,
6463
- zt as MessageActions,
6468
+ Zt as MessageActions,
6464
6469
  Qs as MessageDivider,
6465
6470
  fn as Messages,
6466
6471
  gn as MinimizedView,
@@ -6469,7 +6474,7 @@ export {
6469
6474
  vc as QuestionCard,
6470
6475
  lc as RegenerateAltIcon,
6471
6476
  cc as RegenerateIcon,
6472
- Zn as SourcesCard,
6477
+ zn as SourcesCard,
6473
6478
  hi as StopIcon,
6474
6479
  ic as StylesIcon,
6475
6480
  gt as Suggestions,