@automattic/agenttic-ui 0.1.69 → 0.1.71
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.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import './global.css';import './index.css';/* empty css */
|
|
2
|
-
import { jsx as a, jsxs as w, Fragment as
|
|
2
|
+
import { jsx as a, jsxs as w, Fragment as Je } from "react/jsx-runtime";
|
|
3
3
|
import * as Yt from "react";
|
|
4
|
-
import ae, { useState as Z, useEffect as O, useCallback as b, useRef as A, createContext as On, useContext as Ln, useId as Nn, useMemo as
|
|
5
|
-
import { c as
|
|
6
|
-
import { Q as
|
|
7
|
-
import { motion as se, AnimatePresence as
|
|
8
|
-
import { setLocaleData as Ht, __ as E, sprintf as
|
|
4
|
+
import ae, { useState as Z, useEffect as O, useCallback as b, useRef as A, createContext as On, useContext as Ln, useId as Nn, useMemo as ot, memo as Kt, forwardRef as Jt, useImperativeHandle as xn, Component as Dn } from "react";
|
|
5
|
+
import { c as ge } from "./QuestionCard-KolZKB58.js";
|
|
6
|
+
import { Q as Fc } from "./QuestionCard-KolZKB58.js";
|
|
7
|
+
import { motion as se, AnimatePresence as ct, useMotionValue as pt, useDragControls as qt, animate as ye } from "framer-motion";
|
|
8
|
+
import { setLocaleData as Ht, __ as E, sprintf as je } from "@wordpress/i18n";
|
|
9
9
|
import { Slot as En } from "@radix-ui/react-slot";
|
|
10
|
-
import * as
|
|
10
|
+
import * as Ue from "@radix-ui/react-popover";
|
|
11
11
|
import At from "react-markdown";
|
|
12
12
|
import { useDebounce as Rn } from "use-debounce";
|
|
13
13
|
import Pn from "remark-gfm";
|
|
@@ -1670,14 +1670,14 @@ function Ci(t, e) {
|
|
|
1670
1670
|
if (c) {
|
|
1671
1671
|
const r = "", s = Object.fromEntries(
|
|
1672
1672
|
Object.entries(c).map(([l, g]) => {
|
|
1673
|
-
var
|
|
1673
|
+
var p;
|
|
1674
1674
|
if (l === "")
|
|
1675
1675
|
return [
|
|
1676
1676
|
"",
|
|
1677
1677
|
{
|
|
1678
1678
|
...c[""],
|
|
1679
1679
|
domain: i,
|
|
1680
|
-
lang: ((
|
|
1680
|
+
lang: ((p = c[""]) == null ? void 0 : p.lang) || t
|
|
1681
1681
|
}
|
|
1682
1682
|
];
|
|
1683
1683
|
const d = l.indexOf(r);
|
|
@@ -1752,9 +1752,9 @@ function Ya({
|
|
|
1752
1752
|
if (!u)
|
|
1753
1753
|
return;
|
|
1754
1754
|
u.style.height = "auto";
|
|
1755
|
-
const
|
|
1755
|
+
const p = u.scrollHeight, M = 40, x = 200;
|
|
1756
1756
|
u.style.height = `${Math.min(
|
|
1757
|
-
Math.max(
|
|
1757
|
+
Math.max(p, M),
|
|
1758
1758
|
x
|
|
1759
1759
|
)}px`;
|
|
1760
1760
|
}, []), d = b(
|
|
@@ -1827,16 +1827,16 @@ const It = {
|
|
|
1827
1827
|
type: "spring",
|
|
1828
1828
|
stiffness: 300,
|
|
1829
1829
|
damping: 30
|
|
1830
|
-
},
|
|
1830
|
+
}, Be = {
|
|
1831
1831
|
type: "spring",
|
|
1832
1832
|
damping: 40,
|
|
1833
1833
|
stiffness: 500,
|
|
1834
1834
|
mass: 0.8
|
|
1835
1835
|
}, ft = {
|
|
1836
|
-
...
|
|
1836
|
+
...Be,
|
|
1837
1837
|
stiffness: 1e3,
|
|
1838
1838
|
damping: 90
|
|
1839
|
-
},
|
|
1839
|
+
}, He = {
|
|
1840
1840
|
type: "spring",
|
|
1841
1841
|
damping: 40,
|
|
1842
1842
|
stiffness: 500,
|
|
@@ -1868,17 +1868,17 @@ const It = {
|
|
|
1868
1868
|
}, Si = {
|
|
1869
1869
|
"0%": { backgroundPosition: "-200% 0" },
|
|
1870
1870
|
"100%": { backgroundPosition: "200% 0" }
|
|
1871
|
-
},
|
|
1871
|
+
}, vc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1872
1872
|
__proto__: null,
|
|
1873
1873
|
fadeVariants: Xa,
|
|
1874
|
-
fastSpring:
|
|
1874
|
+
fastSpring: Be,
|
|
1875
1875
|
fastSpringWithDelay: ft,
|
|
1876
1876
|
getDragConstraints: Ii,
|
|
1877
|
-
morphSpring:
|
|
1877
|
+
morphSpring: He,
|
|
1878
1878
|
springConfig: It,
|
|
1879
1879
|
thinkingGradientKeyframes: Si
|
|
1880
1880
|
}, Symbol.toStringTag, { value: "Module" })), Qa = On(null);
|
|
1881
|
-
function
|
|
1881
|
+
function Le() {
|
|
1882
1882
|
const t = Ln(Qa);
|
|
1883
1883
|
if (!t)
|
|
1884
1884
|
throw new Error(
|
|
@@ -1889,7 +1889,7 @@ function Oe() {
|
|
|
1889
1889
|
function Vt({ children: t, value: e }) {
|
|
1890
1890
|
return /* @__PURE__ */ a(Qa.Provider, { value: e, children: t });
|
|
1891
1891
|
}
|
|
1892
|
-
const ki = "button-module_button", Mi = "button-module_pressed", Ai = "button-module_primary", Oi = "button-module_ghost", Li = "button-module_outline", Ni = "button-module_transparent", xi = "button-module_link", Di = "button-module_icon", Ei = "button-module_sm", Ri = "button-module_lg", Pi = "button-module_withTextAndIcon",
|
|
1892
|
+
const ki = "button-module_button", Mi = "button-module_pressed", Ai = "button-module_primary", Oi = "button-module_ghost", Li = "button-module_outline", Ni = "button-module_transparent", xi = "button-module_link", Di = "button-module_icon", Ei = "button-module_sm", Ri = "button-module_lg", Pi = "button-module_withTextAndIcon", et = {
|
|
1893
1893
|
button: ki,
|
|
1894
1894
|
pressed: Mi,
|
|
1895
1895
|
primary: Ai,
|
|
@@ -1912,18 +1912,18 @@ const ki = "button-module_button", Mi = "button-module_pressed", Ai = "button-mo
|
|
|
1912
1912
|
pressed: s,
|
|
1913
1913
|
...l
|
|
1914
1914
|
}, g) {
|
|
1915
|
-
const d = r ? En : "button", u = !!o,
|
|
1915
|
+
const d = r ? En : "button", u = !!o, p = n || (u && !c ? "icon" : void 0);
|
|
1916
1916
|
return /* @__PURE__ */ w(
|
|
1917
1917
|
d,
|
|
1918
1918
|
{
|
|
1919
1919
|
ref: g,
|
|
1920
1920
|
"data-slot": "button",
|
|
1921
|
-
className:
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
u && c ?
|
|
1926
|
-
s ?
|
|
1921
|
+
className: ge(
|
|
1922
|
+
et.button,
|
|
1923
|
+
et[i],
|
|
1924
|
+
p && et[p],
|
|
1925
|
+
u && c ? et.withTextAndIcon : void 0,
|
|
1926
|
+
s ? et.pressed : void 0,
|
|
1927
1927
|
e
|
|
1928
1928
|
),
|
|
1929
1929
|
"aria-pressed": s,
|
|
@@ -1983,7 +1983,7 @@ function en({
|
|
|
1983
1983
|
opacity: 1,
|
|
1984
1984
|
scale: 1,
|
|
1985
1985
|
transition: {
|
|
1986
|
-
...
|
|
1986
|
+
...He,
|
|
1987
1987
|
delay: 0.2
|
|
1988
1988
|
}
|
|
1989
1989
|
},
|
|
@@ -2067,7 +2067,7 @@ function Hi({ className: t, size: e = 24 }) {
|
|
|
2067
2067
|
}
|
|
2068
2068
|
);
|
|
2069
2069
|
}
|
|
2070
|
-
const Vi = "ChatInput-module_container", Wi = "ChatInput-module_textareaContainer", zi = "ChatInput-module_actions", Gi = "ChatInput-module_containerStacked", Zi = "ChatInput-module_button",
|
|
2070
|
+
const Vi = "ChatInput-module_container", Wi = "ChatInput-module_textareaContainer", zi = "ChatInput-module_actions", Gi = "ChatInput-module_containerStacked", Zi = "ChatInput-module_button", Fe = {
|
|
2071
2071
|
container: Vi,
|
|
2072
2072
|
textareaContainer: Wi,
|
|
2073
2073
|
actions: zi,
|
|
@@ -2112,11 +2112,11 @@ function Ji({
|
|
|
2112
2112
|
);
|
|
2113
2113
|
}, e);
|
|
2114
2114
|
return () => clearInterval(c);
|
|
2115
|
-
}, [t.length, e]), /* @__PURE__ */ a(
|
|
2115
|
+
}, [t.length, e]), /* @__PURE__ */ a(ct, { mode: "wait", children: /* @__PURE__ */ a(
|
|
2116
2116
|
se.span,
|
|
2117
2117
|
{
|
|
2118
2118
|
"data-slot": "animated-placeholder",
|
|
2119
|
-
className:
|
|
2119
|
+
className: ge(Ki.container, i),
|
|
2120
2120
|
initial: { opacity: 0, y: 8 },
|
|
2121
2121
|
animate: { opacity: 1, y: 0 },
|
|
2122
2122
|
exit: { opacity: 0, y: -8 },
|
|
@@ -2143,20 +2143,20 @@ function Nt({
|
|
|
2143
2143
|
onClick: g,
|
|
2144
2144
|
fromCompact: d = !1,
|
|
2145
2145
|
onExpand: u,
|
|
2146
|
-
showExpandButton:
|
|
2146
|
+
showExpandButton: p = !0,
|
|
2147
2147
|
focusOnMount: M = !1,
|
|
2148
2148
|
customActions: x = [],
|
|
2149
2149
|
actionOrder: N = "before-submit",
|
|
2150
2150
|
onStop: j,
|
|
2151
|
-
disabled:
|
|
2151
|
+
disabled: h,
|
|
2152
2152
|
onMouseEnter: _,
|
|
2153
2153
|
onMouseLeave: k,
|
|
2154
2154
|
expandOnClick: D = !1,
|
|
2155
2155
|
layout: C = "inline"
|
|
2156
2156
|
}) {
|
|
2157
|
-
const H = Nn(), { variant: Y, floatingChatState: z, isInputOverLimit: S } =
|
|
2157
|
+
const H = Nn(), { variant: Y, floatingChatState: z, isInputOverLimit: S } = Le(), m = (
|
|
2158
2158
|
// If the consumer actively sets `disabled` to `false` (vs undefined), that takes precedence.
|
|
2159
|
-
|
|
2159
|
+
h !== void 0 ? !h : (t.trim() || r) && !S
|
|
2160
2160
|
), V = b(
|
|
2161
2161
|
(T) => {
|
|
2162
2162
|
const Te = T.key.toLowerCase();
|
|
@@ -2181,7 +2181,7 @@ function Nt({
|
|
|
2181
2181
|
const ie = () => x.map((T) => /* @__PURE__ */ a(
|
|
2182
2182
|
we,
|
|
2183
2183
|
{
|
|
2184
|
-
className: T.className ||
|
|
2184
|
+
className: T.className || Fe.button,
|
|
2185
2185
|
onClick: T.onClick,
|
|
2186
2186
|
disabled: T.disabled,
|
|
2187
2187
|
variant: T.variant || "ghost",
|
|
@@ -2189,10 +2189,10 @@ function Nt({
|
|
|
2189
2189
|
"aria-label": T["aria-label"]
|
|
2190
2190
|
},
|
|
2191
2191
|
T.id
|
|
2192
|
-
)), oe = () => Y === "embedded" || z === "expanded" || D ? null :
|
|
2192
|
+
)), oe = () => Y === "embedded" || z === "expanded" || D ? null : p && u ? /* @__PURE__ */ a(
|
|
2193
2193
|
we,
|
|
2194
2194
|
{
|
|
2195
|
-
className:
|
|
2195
|
+
className: Fe.button,
|
|
2196
2196
|
onClick: u,
|
|
2197
2197
|
variant: "ghost",
|
|
2198
2198
|
icon: /* @__PURE__ */ a(an, {}),
|
|
@@ -2207,7 +2207,7 @@ function Nt({
|
|
|
2207
2207
|
return /* @__PURE__ */ a(
|
|
2208
2208
|
we,
|
|
2209
2209
|
{
|
|
2210
|
-
className:
|
|
2210
|
+
className: Fe.button,
|
|
2211
2211
|
onClick: T,
|
|
2212
2212
|
disabled: !m,
|
|
2213
2213
|
variant: "primary",
|
|
@@ -2220,14 +2220,14 @@ function Nt({
|
|
|
2220
2220
|
"div",
|
|
2221
2221
|
{
|
|
2222
2222
|
"data-slot": "chat-input",
|
|
2223
|
-
className: `${
|
|
2223
|
+
className: `${Fe.container}${C === "stacked" ? ` ${Fe.containerStacked}` : ""}`,
|
|
2224
2224
|
onMouseEnter: _,
|
|
2225
2225
|
onMouseLeave: k,
|
|
2226
2226
|
children: [
|
|
2227
2227
|
/* @__PURE__ */ w(
|
|
2228
2228
|
se.div,
|
|
2229
2229
|
{
|
|
2230
|
-
className:
|
|
2230
|
+
className: Fe.textareaContainer,
|
|
2231
2231
|
initial: {
|
|
2232
2232
|
opacity: 0
|
|
2233
2233
|
},
|
|
@@ -2265,7 +2265,7 @@ function Nt({
|
|
|
2265
2265
|
/* @__PURE__ */ w(
|
|
2266
2266
|
se.div,
|
|
2267
2267
|
{
|
|
2268
|
-
className:
|
|
2268
|
+
className: Fe.actions,
|
|
2269
2269
|
initial: {
|
|
2270
2270
|
opacity: d ? 1 : 0,
|
|
2271
2271
|
scale: d ? 1 : 0.5
|
|
@@ -2273,7 +2273,7 @@ function Nt({
|
|
|
2273
2273
|
animate: {
|
|
2274
2274
|
opacity: 1,
|
|
2275
2275
|
scale: 1,
|
|
2276
|
-
transition: t.trim() ? { duration: 0 } :
|
|
2276
|
+
transition: t.trim() ? { duration: 0 } : Be
|
|
2277
2277
|
},
|
|
2278
2278
|
children: [
|
|
2279
2279
|
oe(),
|
|
@@ -2309,97 +2309,100 @@ function qi({ className: t, size: e = 24 }) {
|
|
|
2309
2309
|
}
|
|
2310
2310
|
);
|
|
2311
2311
|
}
|
|
2312
|
-
const Xi = "SuggestionDropdown-module_container", Qi = "SuggestionDropdown-module_chevron", er = "SuggestionDropdown-module_chevronOpen", tr = "SuggestionDropdown-module_dropdown", ar = "SuggestionDropdown-module_option",
|
|
2312
|
+
const Xi = "SuggestionDropdown-module_container", Qi = "SuggestionDropdown-module_chevron", er = "SuggestionDropdown-module_chevronOpen", tr = "SuggestionDropdown-module_dropdown", ar = "SuggestionDropdown-module_option", tt = {
|
|
2313
2313
|
container: Xi,
|
|
2314
2314
|
chevron: Qi,
|
|
2315
2315
|
chevronOpen: er,
|
|
2316
2316
|
dropdown: tr,
|
|
2317
2317
|
option: ar
|
|
2318
|
-
}, nr = "Suggestions-module_container", ir = "Suggestions-module_vertical", rr = "Suggestions-module_button", or = "Suggestions-module_floating",
|
|
2318
|
+
}, nr = "Suggestions-module_container", ir = "Suggestions-module_vertical", rr = "Suggestions-module_button", or = "Suggestions-module_label", cr = "Suggestions-module_description", sr = "Suggestions-module_floating", Oe = {
|
|
2319
2319
|
container: nr,
|
|
2320
2320
|
vertical: ir,
|
|
2321
2321
|
button: rr,
|
|
2322
|
-
|
|
2323
|
-
|
|
2322
|
+
"suggestion-content--with-description": "Suggestions-module_suggestion-content--with-description",
|
|
2323
|
+
label: or,
|
|
2324
|
+
description: cr,
|
|
2325
|
+
floating: sr
|
|
2326
|
+
}, lr = (t, e) => !t || !e ? `${t}${e}` : /\s$/.test(t) || /^\s/.test(e) ? `${t}${e}` : `${t} ${e}`, dr = ({
|
|
2324
2327
|
suggestion: t,
|
|
2325
2328
|
onSelect: e,
|
|
2326
2329
|
availableSuggestions: i,
|
|
2327
2330
|
onOpenChange: n
|
|
2328
2331
|
}) => {
|
|
2329
2332
|
var j;
|
|
2330
|
-
const [o, c] = ae.useState(!1), r = ae.useRef(null), [s, l] = ae.useState(null), [g, d] = ae.useState(null), [u,
|
|
2331
|
-
(
|
|
2332
|
-
if (r.current =
|
|
2333
|
+
const [o, c] = ae.useState(!1), r = ae.useRef(null), [s, l] = ae.useState(null), [g, d] = ae.useState(null), [u, p] = ae.useState(void 0), M = ae.useCallback(
|
|
2334
|
+
(h) => {
|
|
2335
|
+
if (r.current = h, !h) {
|
|
2333
2336
|
l(null), d(null);
|
|
2334
2337
|
return;
|
|
2335
2338
|
}
|
|
2336
2339
|
l(
|
|
2337
|
-
|
|
2340
|
+
h.closest(".agenttic") ?? h
|
|
2338
2341
|
), d(
|
|
2339
|
-
|
|
2342
|
+
h.closest(
|
|
2340
2343
|
'[data-slot="conversation-view"]'
|
|
2341
2344
|
) ?? null
|
|
2342
2345
|
);
|
|
2343
2346
|
},
|
|
2344
2347
|
[]
|
|
2345
|
-
), x = ae.useCallback((
|
|
2348
|
+
), x = ae.useCallback((h) => {
|
|
2346
2349
|
var _;
|
|
2347
|
-
if (
|
|
2350
|
+
if (h) {
|
|
2348
2351
|
const k = (_ = r.current) == null ? void 0 : _.closest(
|
|
2349
2352
|
'[data-slot="suggestions"]'
|
|
2350
2353
|
);
|
|
2351
|
-
k &&
|
|
2354
|
+
k && p(k.clientWidth * 0.9);
|
|
2352
2355
|
}
|
|
2353
|
-
c(
|
|
2354
|
-
}, [n]), N = (
|
|
2356
|
+
c(h), n == null || n(h);
|
|
2357
|
+
}, [n]), N = (h) => {
|
|
2355
2358
|
const { options: _, ...k } = t, D = {
|
|
2356
2359
|
...k,
|
|
2357
|
-
prompt:
|
|
2360
|
+
prompt: lr(
|
|
2358
2361
|
t.prompt ?? t.label,
|
|
2359
|
-
|
|
2362
|
+
h.value
|
|
2360
2363
|
),
|
|
2361
|
-
label: `${t.label} ${
|
|
2364
|
+
label: `${t.label} ${h.label}`
|
|
2362
2365
|
};
|
|
2363
2366
|
e == null || e(D, i), x(!1);
|
|
2364
2367
|
};
|
|
2365
|
-
return /* @__PURE__ */ a("div", { ref: M, className:
|
|
2366
|
-
/* @__PURE__ */ a(
|
|
2368
|
+
return /* @__PURE__ */ a("div", { ref: M, className: tt.container, children: /* @__PURE__ */ w(Ue.Root, { open: o, onOpenChange: x, children: [
|
|
2369
|
+
/* @__PURE__ */ a(Ue.Trigger, { asChild: !0, children: /* @__PURE__ */ w(
|
|
2367
2370
|
we,
|
|
2368
2371
|
{
|
|
2369
2372
|
variant: "outline",
|
|
2370
|
-
className:
|
|
2373
|
+
className: Oe.button,
|
|
2371
2374
|
children: [
|
|
2372
2375
|
t.label,
|
|
2373
2376
|
/* @__PURE__ */ a(
|
|
2374
2377
|
qi,
|
|
2375
2378
|
{
|
|
2376
2379
|
size: 14,
|
|
2377
|
-
className: `${
|
|
2380
|
+
className: `${tt.chevron} ${o ? tt.chevronOpen : ""}`
|
|
2378
2381
|
}
|
|
2379
2382
|
)
|
|
2380
2383
|
]
|
|
2381
2384
|
}
|
|
2382
2385
|
) }),
|
|
2383
|
-
s && /* @__PURE__ */ a(
|
|
2384
|
-
|
|
2386
|
+
s && /* @__PURE__ */ a(Ue.Portal, { container: s, children: /* @__PURE__ */ a(
|
|
2387
|
+
Ue.Content,
|
|
2385
2388
|
{
|
|
2386
|
-
className:
|
|
2389
|
+
className: tt.dropdown,
|
|
2387
2390
|
side: "top",
|
|
2388
2391
|
align: "start",
|
|
2389
2392
|
sideOffset: 4,
|
|
2390
2393
|
collisionBoundary: g,
|
|
2391
2394
|
"aria-label": t.label,
|
|
2392
2395
|
style: u ? { width: u } : void 0,
|
|
2393
|
-
children: (j = t.options) == null ? void 0 : j.map((
|
|
2396
|
+
children: (j = t.options) == null ? void 0 : j.map((h) => /* @__PURE__ */ a(
|
|
2394
2397
|
"button",
|
|
2395
2398
|
{
|
|
2396
2399
|
type: "button",
|
|
2397
2400
|
"data-slot": "suggestion-option",
|
|
2398
|
-
className:
|
|
2399
|
-
onClick: () => N(
|
|
2400
|
-
children:
|
|
2401
|
+
className: tt.option,
|
|
2402
|
+
onClick: () => N(h),
|
|
2403
|
+
children: h.label
|
|
2401
2404
|
},
|
|
2402
|
-
|
|
2405
|
+
h.id
|
|
2403
2406
|
))
|
|
2404
2407
|
}
|
|
2405
2408
|
) })
|
|
@@ -2415,20 +2418,20 @@ const Xi = "SuggestionDropdown-module_container", Qi = "SuggestionDropdown-modul
|
|
|
2415
2418
|
onDropdownOpenChange: s,
|
|
2416
2419
|
translateY: l = "-100%"
|
|
2417
2420
|
}) => {
|
|
2418
|
-
const { variant: g } =
|
|
2421
|
+
const { variant: g } = Le(), d = ot(
|
|
2419
2422
|
() => g === "floating" ? e == null ? void 0 : e.slice(0, 3) : e,
|
|
2420
2423
|
[e, g]
|
|
2421
|
-
), u = async (
|
|
2424
|
+
), u = async (p, M) => {
|
|
2422
2425
|
let x = !0;
|
|
2423
|
-
|
|
2426
|
+
p.action && (x = await p.action()), x && i && p.prompt && i(p, M);
|
|
2424
2427
|
};
|
|
2425
|
-
return !d || d.length === 0 ? null : /* @__PURE__ */ a(
|
|
2428
|
+
return !d || d.length === 0 ? null : /* @__PURE__ */ a(ct, { children: o && /* @__PURE__ */ a(
|
|
2426
2429
|
se.div,
|
|
2427
2430
|
{
|
|
2428
2431
|
"data-slot": "suggestions",
|
|
2429
|
-
className:
|
|
2430
|
-
|
|
2431
|
-
n === "vertical" ?
|
|
2432
|
+
className: ge(
|
|
2433
|
+
Oe.container,
|
|
2434
|
+
n === "vertical" ? Oe.vertical : n === "floating" ? Oe.floating : "",
|
|
2432
2435
|
t
|
|
2433
2436
|
),
|
|
2434
2437
|
initial: { opacity: 0, y: "-80%" },
|
|
@@ -2438,46 +2441,73 @@ const Xi = "SuggestionDropdown-module_container", Qi = "SuggestionDropdown-modul
|
|
|
2438
2441
|
onMouseEnter: c,
|
|
2439
2442
|
onMouseLeave: r,
|
|
2440
2443
|
children: d.map(
|
|
2441
|
-
(
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2444
|
+
(p, M) => {
|
|
2445
|
+
const x = !!p.description && n !== "horizontal";
|
|
2446
|
+
return /* @__PURE__ */ a(
|
|
2447
|
+
se.div,
|
|
2448
|
+
{
|
|
2449
|
+
initial: { opacity: 0, y: 10 },
|
|
2450
|
+
animate: { opacity: 1, y: 0 },
|
|
2451
|
+
exit: { opacity: 0, y: 10 },
|
|
2452
|
+
transition: {
|
|
2453
|
+
...ft,
|
|
2454
|
+
delay: M * 0.05
|
|
2455
|
+
},
|
|
2456
|
+
children: p.options && p.options.length > 0 ? /* @__PURE__ */ a(
|
|
2457
|
+
dr,
|
|
2458
|
+
{
|
|
2459
|
+
suggestion: p,
|
|
2460
|
+
onSelect: u,
|
|
2461
|
+
availableSuggestions: d,
|
|
2462
|
+
onOpenChange: s
|
|
2463
|
+
}
|
|
2464
|
+
) : /* @__PURE__ */ a(
|
|
2465
|
+
we,
|
|
2466
|
+
{
|
|
2467
|
+
onClick: (N) => {
|
|
2468
|
+
N.stopPropagation(), u(
|
|
2469
|
+
p,
|
|
2470
|
+
d
|
|
2471
|
+
);
|
|
2472
|
+
},
|
|
2473
|
+
variant: "outline",
|
|
2474
|
+
className: Oe.button,
|
|
2475
|
+
children: /* @__PURE__ */ w(
|
|
2476
|
+
"div",
|
|
2477
|
+
{
|
|
2478
|
+
className: ge(
|
|
2479
|
+
Oe["suggestion-content"],
|
|
2480
|
+
x ? Oe["suggestion-content--with-description"] : ""
|
|
2481
|
+
),
|
|
2482
|
+
children: [
|
|
2483
|
+
/* @__PURE__ */ a(
|
|
2484
|
+
"span",
|
|
2485
|
+
{
|
|
2486
|
+
className: Oe.label,
|
|
2487
|
+
children: p.label
|
|
2488
|
+
}
|
|
2489
|
+
),
|
|
2490
|
+
x && /* @__PURE__ */ a(
|
|
2491
|
+
"span",
|
|
2492
|
+
{
|
|
2493
|
+
className: Oe.description,
|
|
2494
|
+
children: p.description
|
|
2495
|
+
}
|
|
2496
|
+
)
|
|
2497
|
+
]
|
|
2498
|
+
}
|
|
2499
|
+
)
|
|
2500
|
+
}
|
|
2501
|
+
)
|
|
2450
2502
|
},
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
suggestion: h,
|
|
2455
|
-
onSelect: u,
|
|
2456
|
-
availableSuggestions: d,
|
|
2457
|
-
onOpenChange: s
|
|
2458
|
-
}
|
|
2459
|
-
) : /* @__PURE__ */ a(
|
|
2460
|
-
we,
|
|
2461
|
-
{
|
|
2462
|
-
onClick: (x) => {
|
|
2463
|
-
x.stopPropagation(), u(
|
|
2464
|
-
h,
|
|
2465
|
-
d
|
|
2466
|
-
);
|
|
2467
|
-
},
|
|
2468
|
-
variant: "outline",
|
|
2469
|
-
className: nt.button,
|
|
2470
|
-
children: h.label
|
|
2471
|
-
}
|
|
2472
|
-
)
|
|
2473
|
-
},
|
|
2474
|
-
h.id
|
|
2475
|
-
)
|
|
2503
|
+
p.id
|
|
2504
|
+
);
|
|
2505
|
+
}
|
|
2476
2506
|
)
|
|
2477
2507
|
}
|
|
2478
2508
|
) });
|
|
2479
2509
|
};
|
|
2480
|
-
function
|
|
2510
|
+
function ur() {
|
|
2481
2511
|
const t = A(/* @__PURE__ */ new Map()), e = b((c) => {
|
|
2482
2512
|
const r = t.current.get(c);
|
|
2483
2513
|
r && (clearTimeout(r), t.current.delete(c));
|
|
@@ -2500,7 +2530,7 @@ function lr() {
|
|
|
2500
2530
|
hasTimeout: o
|
|
2501
2531
|
};
|
|
2502
2532
|
}
|
|
2503
|
-
const
|
|
2533
|
+
const gr = 4e3;
|
|
2504
2534
|
function nn({
|
|
2505
2535
|
value: t,
|
|
2506
2536
|
onChange: e,
|
|
@@ -2514,21 +2544,21 @@ function nn({
|
|
|
2514
2544
|
onExpand: g,
|
|
2515
2545
|
showExpandButton: d = !0,
|
|
2516
2546
|
focusOnMount: u = !1,
|
|
2517
|
-
customActions:
|
|
2547
|
+
customActions: p,
|
|
2518
2548
|
actionOrder: M,
|
|
2519
2549
|
onStop: x,
|
|
2520
2550
|
suggestions: N,
|
|
2521
2551
|
clearSuggestions: j,
|
|
2522
|
-
handleSuggestionSubmit:
|
|
2552
|
+
handleSuggestionSubmit: h,
|
|
2523
2553
|
expandOnClick: _ = !1
|
|
2524
2554
|
}) {
|
|
2525
|
-
const [k, D] = Z(!1), [C, H] = Z(!1), { setNamedTimeout: Y, clearAllTimeouts: z } =
|
|
2555
|
+
const [k, D] = Z(!1), [C, H] = Z(!1), { setNamedTimeout: Y, clearAllTimeouts: z } = ur(), S = b(() => {
|
|
2526
2556
|
Y(
|
|
2527
2557
|
"hide-suggestions",
|
|
2528
2558
|
() => {
|
|
2529
2559
|
D(!1);
|
|
2530
2560
|
},
|
|
2531
|
-
|
|
2561
|
+
gr
|
|
2532
2562
|
);
|
|
2533
2563
|
}, [Y]), m = b(() => {
|
|
2534
2564
|
C || S();
|
|
@@ -2562,7 +2592,7 @@ function nn({
|
|
|
2562
2592
|
C,
|
|
2563
2593
|
z,
|
|
2564
2594
|
S
|
|
2565
|
-
]), /* @__PURE__ */ w(
|
|
2595
|
+
]), /* @__PURE__ */ w(Je, { children: [
|
|
2566
2596
|
/* @__PURE__ */ a(
|
|
2567
2597
|
Nt,
|
|
2568
2598
|
{
|
|
@@ -2579,7 +2609,7 @@ function nn({
|
|
|
2579
2609
|
onExpand: g,
|
|
2580
2610
|
showExpandButton: d,
|
|
2581
2611
|
focusOnMount: u,
|
|
2582
|
-
customActions:
|
|
2612
|
+
customActions: p,
|
|
2583
2613
|
actionOrder: M,
|
|
2584
2614
|
onStop: x,
|
|
2585
2615
|
expandOnClick: _,
|
|
@@ -2591,7 +2621,7 @@ function nn({
|
|
|
2591
2621
|
vt,
|
|
2592
2622
|
{
|
|
2593
2623
|
suggestions: N,
|
|
2594
|
-
onSubmit:
|
|
2624
|
+
onSubmit: h,
|
|
2595
2625
|
layout: "floating",
|
|
2596
2626
|
visible: k,
|
|
2597
2627
|
onMouseEnter: V,
|
|
@@ -2601,10 +2631,10 @@ function nn({
|
|
|
2601
2631
|
)
|
|
2602
2632
|
] });
|
|
2603
2633
|
}
|
|
2604
|
-
const
|
|
2605
|
-
button:
|
|
2606
|
-
chevron:
|
|
2607
|
-
title:
|
|
2634
|
+
const mr = "MinimizedView-module_button", pr = "MinimizedView-module_chevron", hr = "MinimizedView-module_title", _t = {
|
|
2635
|
+
button: mr,
|
|
2636
|
+
chevron: pr,
|
|
2637
|
+
title: hr
|
|
2608
2638
|
};
|
|
2609
2639
|
function rn({
|
|
2610
2640
|
icon: t = /* @__PURE__ */ a(Lt, { size: 26 }),
|
|
@@ -2629,7 +2659,7 @@ function rn({
|
|
|
2629
2659
|
opacity: 1,
|
|
2630
2660
|
scale: 1,
|
|
2631
2661
|
transition: {
|
|
2632
|
-
...
|
|
2662
|
+
...He,
|
|
2633
2663
|
delay: 0.2
|
|
2634
2664
|
}
|
|
2635
2665
|
},
|
|
@@ -2658,14 +2688,14 @@ function rn({
|
|
|
2658
2688
|
}
|
|
2659
2689
|
);
|
|
2660
2690
|
}
|
|
2661
|
-
const
|
|
2662
|
-
container:
|
|
2663
|
-
embedded:
|
|
2664
|
-
floating:
|
|
2665
|
-
content:
|
|
2666
|
-
expanded:
|
|
2691
|
+
const fr = "Chat-module_container", vr = "Chat-module_embedded", yr = "Chat-module_floating", br = "Chat-module_content", wr = "Chat-module_expanded", be = {
|
|
2692
|
+
container: fr,
|
|
2693
|
+
embedded: vr,
|
|
2694
|
+
floating: yr,
|
|
2695
|
+
content: br,
|
|
2696
|
+
expanded: wr
|
|
2667
2697
|
};
|
|
2668
|
-
function
|
|
2698
|
+
function Cr() {
|
|
2669
2699
|
return /* @__PURE__ */ a(
|
|
2670
2700
|
"div",
|
|
2671
2701
|
{
|
|
@@ -2699,12 +2729,12 @@ function on({
|
|
|
2699
2729
|
notice: g,
|
|
2700
2730
|
onOpen: d,
|
|
2701
2731
|
onExpand: u,
|
|
2702
|
-
onClose:
|
|
2732
|
+
onClose: p,
|
|
2703
2733
|
onStop: M,
|
|
2704
2734
|
emptyView: x,
|
|
2705
2735
|
floatingChatState: N,
|
|
2706
2736
|
suggestions: j,
|
|
2707
|
-
clearSuggestions:
|
|
2737
|
+
clearSuggestions: h,
|
|
2708
2738
|
onSuggestionClick: _,
|
|
2709
2739
|
messageRenderer: k,
|
|
2710
2740
|
messagesPosition: D,
|
|
@@ -2726,9 +2756,9 @@ function on({
|
|
|
2726
2756
|
onTypingStatusChange: P,
|
|
2727
2757
|
freeDrag: T = !1,
|
|
2728
2758
|
initialFreeDragPosition: Te,
|
|
2729
|
-
onFreeDragEnd:
|
|
2759
|
+
onFreeDragEnd: me
|
|
2730
2760
|
}) {
|
|
2731
|
-
const
|
|
2761
|
+
const Ne = Y !== void 0, [Ee, xe] = Z(""), le = Ne ? Y : Ee, Re = Ne ? z : xe, v = Za(N), ce = A(!1), X = A(!1), ke = A(!1), [Ve, Ie] = Z(!1), [f, R] = Z(!1), [K, U] = Z(!1), te = Ti(), [fe, pe] = Z(!1);
|
|
2732
2762
|
O(() => {
|
|
2733
2763
|
_i(m, {
|
|
2734
2764
|
domain: "a8c-agenttic"
|
|
@@ -2737,7 +2767,7 @@ function on({
|
|
|
2737
2767
|
);
|
|
2738
2768
|
}, [m]), O(() => {
|
|
2739
2769
|
const I = le.length > 0, F = K && te && I;
|
|
2740
|
-
F !== fe && (
|
|
2770
|
+
F !== fe && (pe(F), P == null || P(F));
|
|
2741
2771
|
}, [
|
|
2742
2772
|
K,
|
|
2743
2773
|
te,
|
|
@@ -2745,9 +2775,9 @@ function on({
|
|
|
2745
2775
|
fe,
|
|
2746
2776
|
P
|
|
2747
2777
|
]);
|
|
2748
|
-
const
|
|
2778
|
+
const De = b(() => {
|
|
2749
2779
|
U(!0);
|
|
2750
|
-
}, []),
|
|
2780
|
+
}, []), We = b(() => {
|
|
2751
2781
|
U(!1);
|
|
2752
2782
|
}, []), Ce = le.length > V;
|
|
2753
2783
|
O(() => {
|
|
@@ -2755,80 +2785,80 @@ function on({
|
|
|
2755
2785
|
}, [Ce, G]), O(() => {
|
|
2756
2786
|
ce.current = !1, X.current = !1, ke.current = !1;
|
|
2757
2787
|
}, [v.state]);
|
|
2758
|
-
const ve = A(/* @__PURE__ */ new Set()),
|
|
2788
|
+
const ve = A(/* @__PURE__ */ new Set()), qe = b(() => {
|
|
2759
2789
|
ve.current.forEach((I) => {
|
|
2760
2790
|
clearTimeout(I);
|
|
2761
2791
|
}), ve.current.clear();
|
|
2762
2792
|
}, []), B = Ya({
|
|
2763
2793
|
value: le,
|
|
2764
|
-
setValue:
|
|
2794
|
+
setValue: Re,
|
|
2765
2795
|
onSubmit: async (I) => {
|
|
2766
2796
|
v.state !== "expanded" && (u == null || u()), v.setState("expanded"), await o(I);
|
|
2767
2797
|
},
|
|
2768
2798
|
isProcessing: i,
|
|
2769
2799
|
isInputOverLimit: Ce,
|
|
2770
2800
|
floatingChatState: v.state
|
|
2771
|
-
}), [
|
|
2801
|
+
}), [st, L] = Z(56), [$, J] = Z(
|
|
2772
2802
|
Ja(ie)
|
|
2773
|
-
), de = A(null), Me = A(null), Se = A(null), { x:
|
|
2803
|
+
), de = A(null), Me = A(null), Se = A(null), { x: Pe, y: ze } = qa({
|
|
2774
2804
|
freeDrag: T,
|
|
2775
2805
|
initialFreeDragPosition: Te,
|
|
2776
2806
|
side: $
|
|
2777
|
-
}), he = pt(
|
|
2807
|
+
}), he = pt(Pe), ue = pt(ze), yt = qt(), bt = b(
|
|
2778
2808
|
async (I, F) => {
|
|
2779
2809
|
const W = I.prompt ?? I.label;
|
|
2780
2810
|
if (I.autoSubmit) {
|
|
2781
|
-
|
|
2811
|
+
h == null || h();
|
|
2782
2812
|
const Q = W.trim();
|
|
2783
2813
|
Q && await o(Q);
|
|
2784
2814
|
} else {
|
|
2785
2815
|
const Q = W.endsWith(" ") ? W : `${W} `;
|
|
2786
|
-
B.setValue(Q),
|
|
2816
|
+
B.setValue(Q), h == null || h(), B.textareaRef.current && (B.textareaRef.current.focus(), B.textareaRef.current.setSelectionRange(
|
|
2787
2817
|
Q.length,
|
|
2788
2818
|
Q.length
|
|
2789
2819
|
));
|
|
2790
2820
|
}
|
|
2791
2821
|
_ == null || _(I, F);
|
|
2792
2822
|
},
|
|
2793
|
-
[
|
|
2823
|
+
[h, o, _, B]
|
|
2794
2824
|
), wt = b(() => {
|
|
2795
2825
|
ce.current = !0, v.open(), d == null || d(), u == null || u();
|
|
2796
|
-
}, [v, d, u]),
|
|
2826
|
+
}, [v, d, u]), Xe = b(() => {
|
|
2797
2827
|
var F, W, Q;
|
|
2798
2828
|
const I = (W = (F = Se.current) == null ? void 0 : F.ownerDocument) == null ? void 0 : W.activeElement;
|
|
2799
2829
|
return !(I && ((Q = Se.current) != null && Q.contains(I)) || le.trim());
|
|
2800
2830
|
}, [le, Se]), Ct = b(
|
|
2801
|
-
(I) => I === "collapsed" || I === "minimized" ? y.COLLAPSED_SIZE : I === "compact" ?
|
|
2802
|
-
[
|
|
2831
|
+
(I) => I === "collapsed" || I === "minimized" ? y.COLLAPSED_SIZE : I === "compact" ? st : y.EXPANDED_HEIGHT,
|
|
2832
|
+
[st]
|
|
2803
2833
|
), bn = b(() => {
|
|
2804
2834
|
if (q && v.state === "collapsed" && (v.setState("compact"), v.initialState === "collapsed")) {
|
|
2805
2835
|
const I = setTimeout(() => {
|
|
2806
|
-
v.state === "compact" &&
|
|
2836
|
+
v.state === "compact" && Xe() && v.setState("collapsed"), ve.current.delete(I);
|
|
2807
2837
|
}, y.AUTO_COLLAPSE_DELAY);
|
|
2808
2838
|
ve.current.add(I);
|
|
2809
2839
|
}
|
|
2810
|
-
}, [v,
|
|
2811
|
-
if (v.initialState === "collapsed" && v.state === "compact" &&
|
|
2840
|
+
}, [v, Xe, q]), Dt = b(() => {
|
|
2841
|
+
if (v.initialState === "collapsed" && v.state === "compact" && Xe()) {
|
|
2812
2842
|
const I = setTimeout(() => {
|
|
2813
|
-
v.state === "compact" &&
|
|
2843
|
+
v.state === "compact" && Xe() && v.setState("collapsed"), ve.current.delete(I);
|
|
2814
2844
|
}, y.AUTO_COLLAPSE_DELAY);
|
|
2815
2845
|
ve.current.add(I);
|
|
2816
2846
|
}
|
|
2817
|
-
}, [v,
|
|
2847
|
+
}, [v, Xe]), Et = b(async () => {
|
|
2818
2848
|
const I = B.value.trim();
|
|
2819
2849
|
B.clear(), v.state !== "expanded" && (u == null || u()), v.setState("expanded"), await o(I);
|
|
2820
2850
|
}, [B, o, v, u]), Rt = b(() => {
|
|
2821
2851
|
ke.current = !0, u == null || u(), v.setState("expanded");
|
|
2822
2852
|
}, [u, v]), wn = b(() => {
|
|
2823
|
-
X.current = !0, B.clear(), v.close(),
|
|
2824
|
-
}, [B, v,
|
|
2853
|
+
X.current = !0, B.clear(), v.close(), p && p();
|
|
2854
|
+
}, [B, v, p]), Ge = b(
|
|
2825
2855
|
(I) => {
|
|
2826
2856
|
if (!Se.current || !Me.current)
|
|
2827
2857
|
return null;
|
|
2828
|
-
const F = Se.current.getBoundingClientRect(), W = Me.current.getBoundingClientRect(), Q = window.getComputedStyle(Se.current),
|
|
2858
|
+
const F = Se.current.getBoundingClientRect(), W = Me.current.getBoundingClientRect(), Q = window.getComputedStyle(Se.current), dt = new DOMMatrixReadOnly(Q.transform), Ut = F.x - dt.e, $e = F.y - dt.f, Qe = I ?? $, Bt = Ct(v.state), Mn = Qe === "left" ? W.left : W.right - y.COMPACT_WIDTH, An = v.state === "minimized" ? window.innerHeight - Bt : W.bottom - Bt;
|
|
2829
2859
|
return {
|
|
2830
2860
|
x: Mn - Ut,
|
|
2831
|
-
y: An -
|
|
2861
|
+
y: An - $e
|
|
2832
2862
|
};
|
|
2833
2863
|
},
|
|
2834
2864
|
[$, v.state, Ct]
|
|
@@ -2847,16 +2877,16 @@ function on({
|
|
|
2847
2877
|
}, []), Tn = b(
|
|
2848
2878
|
(I, F) => {
|
|
2849
2879
|
if (R(!1), T) {
|
|
2850
|
-
|
|
2880
|
+
me == null || me({ x: he.get(), y: ue.get() });
|
|
2851
2881
|
return;
|
|
2852
2882
|
}
|
|
2853
|
-
const W = F.point.x, Q = y.COMPACT_WIDTH,
|
|
2854
|
-
$ !==
|
|
2855
|
-
const
|
|
2856
|
-
|
|
2883
|
+
const W = F.point.x, Q = y.COMPACT_WIDTH, dt = (window.innerWidth - Q) / 2, $e = W < dt ? "left" : "right";
|
|
2884
|
+
$ !== $e && (J($e), ht($e), oe == null || oe($e));
|
|
2885
|
+
const Qe = Ge($e);
|
|
2886
|
+
Qe && (ye(he, Qe.x, {
|
|
2857
2887
|
...re.SPRING_CONFIG,
|
|
2858
2888
|
velocity: F.velocity.x * re.VELOCITY_MULTIPLIER
|
|
2859
|
-
}), ye(ue,
|
|
2889
|
+
}), ye(ue, Qe.y, {
|
|
2860
2890
|
...re.SPRING_CONFIG,
|
|
2861
2891
|
velocity: F.velocity.y * re.VELOCITY_MULTIPLIER
|
|
2862
2892
|
}));
|
|
@@ -2864,11 +2894,11 @@ function on({
|
|
|
2864
2894
|
[
|
|
2865
2895
|
he,
|
|
2866
2896
|
ue,
|
|
2867
|
-
|
|
2897
|
+
Ge,
|
|
2868
2898
|
oe,
|
|
2869
2899
|
$,
|
|
2870
2900
|
T,
|
|
2871
|
-
|
|
2901
|
+
me
|
|
2872
2902
|
]
|
|
2873
2903
|
), Pt = A(T);
|
|
2874
2904
|
O(() => {
|
|
@@ -2877,39 +2907,39 @@ function on({
|
|
|
2877
2907
|
return;
|
|
2878
2908
|
const W = y.VIEWPORT_OFFSET + he.get() + y.COMPACT_WIDTH / 2 < window.innerWidth / 2 ? "left" : "right";
|
|
2879
2909
|
$ !== W && (J(W), ht(W), oe == null || oe(W));
|
|
2880
|
-
const Q =
|
|
2910
|
+
const Q = Ge(W);
|
|
2881
2911
|
Q && (ye(he, Q.x, re.SPRING_CONFIG), ye(ue, Q.y, re.SPRING_CONFIG));
|
|
2882
2912
|
}, [
|
|
2883
2913
|
T,
|
|
2884
2914
|
he,
|
|
2885
2915
|
ue,
|
|
2886
|
-
|
|
2916
|
+
Ge,
|
|
2887
2917
|
oe,
|
|
2888
2918
|
$
|
|
2889
2919
|
]);
|
|
2890
|
-
const
|
|
2920
|
+
const lt = A(null), $t = A(v.state === "minimized");
|
|
2891
2921
|
O(() => {
|
|
2892
2922
|
const I = $t.current, F = v.state === "minimized";
|
|
2893
2923
|
if ($t.current = F, !T || F === I)
|
|
2894
2924
|
return;
|
|
2895
2925
|
if (F) {
|
|
2896
|
-
|
|
2926
|
+
lt.current = ue.get();
|
|
2897
2927
|
const Q = ye(ue, 0, re.SPRING_CONFIG);
|
|
2898
2928
|
return () => Q.stop();
|
|
2899
2929
|
}
|
|
2900
|
-
if (
|
|
2930
|
+
if (lt.current === null)
|
|
2901
2931
|
return;
|
|
2902
2932
|
const W = ye(
|
|
2903
2933
|
ue,
|
|
2904
|
-
|
|
2934
|
+
lt.current,
|
|
2905
2935
|
re.SPRING_CONFIG
|
|
2906
2936
|
);
|
|
2907
|
-
return
|
|
2937
|
+
return lt.current = null, () => W.stop();
|
|
2908
2938
|
}, [v.state, T, ue]);
|
|
2909
2939
|
const Ft = A(v.state), In = Ft.current === "compact" && v.state === "expanded";
|
|
2910
2940
|
O(() => {
|
|
2911
|
-
|
|
2912
|
-
}, [v.state,
|
|
2941
|
+
qe(), Ft.current = v.state;
|
|
2942
|
+
}, [v.state, qe]), O(() => {
|
|
2913
2943
|
const I = () => {
|
|
2914
2944
|
if (T) {
|
|
2915
2945
|
const W = Ot(
|
|
@@ -2920,11 +2950,11 @@ function on({
|
|
|
2920
2950
|
he.set(W.x), ue.set(W.y);
|
|
2921
2951
|
return;
|
|
2922
2952
|
}
|
|
2923
|
-
const F =
|
|
2953
|
+
const F = Ge();
|
|
2924
2954
|
F && (he.set(F.x), v.state !== "minimized" && ue.set(F.y));
|
|
2925
2955
|
};
|
|
2926
2956
|
return window.addEventListener("resize", I), () => window.removeEventListener("resize", I);
|
|
2927
|
-
}, [v.state, he, ue,
|
|
2957
|
+
}, [v.state, he, ue, Ge, T]), O(() => {
|
|
2928
2958
|
const I = ve.current;
|
|
2929
2959
|
return () => {
|
|
2930
2960
|
I.forEach((F) => {
|
|
@@ -2940,7 +2970,7 @@ function on({
|
|
|
2940
2970
|
const Sn = x && ["floating", "embedded"].includes(c) && e.length === 0 && ae.isValidElement(x) ? ae.cloneElement(x, {
|
|
2941
2971
|
onSuggestionClick: bt
|
|
2942
2972
|
}) : void 0, kn = Ce ? {
|
|
2943
|
-
message:
|
|
2973
|
+
message: je(
|
|
2944
2974
|
/* translators: %d: maximum number of characters allowed */
|
|
2945
2975
|
E(
|
|
2946
2976
|
"Message is too long. Please keep it under %d characters.",
|
|
@@ -2980,7 +3010,7 @@ function on({
|
|
|
2980
3010
|
onClose: wn,
|
|
2981
3011
|
// Suggestions
|
|
2982
3012
|
suggestions: j,
|
|
2983
|
-
clearSuggestions:
|
|
3013
|
+
clearSuggestions: h,
|
|
2984
3014
|
handleSuggestionSubmit: bt,
|
|
2985
3015
|
// Notice
|
|
2986
3016
|
notice: kn,
|
|
@@ -2993,14 +3023,14 @@ function on({
|
|
|
2993
3023
|
// Input validation
|
|
2994
3024
|
isInputOverLimit: Ce,
|
|
2995
3025
|
// Focus handlers for typing status
|
|
2996
|
-
onInputFocus:
|
|
2997
|
-
onInputBlur:
|
|
3026
|
+
onInputFocus: De,
|
|
3027
|
+
onInputBlur: We
|
|
2998
3028
|
};
|
|
2999
3029
|
return c === "embedded" ? /* @__PURE__ */ a(Vt, { value: jt, children: /* @__PURE__ */ a(
|
|
3000
3030
|
"div",
|
|
3001
3031
|
{
|
|
3002
3032
|
"data-slot": "chat-embedded",
|
|
3003
|
-
className:
|
|
3033
|
+
className: ge(
|
|
3004
3034
|
H,
|
|
3005
3035
|
be.container,
|
|
3006
3036
|
be.embedded
|
|
@@ -3022,15 +3052,15 @@ function on({
|
|
|
3022
3052
|
}
|
|
3023
3053
|
}
|
|
3024
3054
|
),
|
|
3025
|
-
f && /* @__PURE__ */ a(
|
|
3055
|
+
f && /* @__PURE__ */ a(Cr, {}),
|
|
3026
3056
|
/* @__PURE__ */ a(
|
|
3027
3057
|
se.div,
|
|
3028
3058
|
{
|
|
3029
3059
|
ref: Se,
|
|
3030
3060
|
"data-slot": "chat-floating",
|
|
3031
|
-
className:
|
|
3061
|
+
className: ge(H, be.container, be.floating, {
|
|
3032
3062
|
[be.expanded]: v.state === "expanded",
|
|
3033
|
-
animating:
|
|
3063
|
+
animating: Ve
|
|
3034
3064
|
}),
|
|
3035
3065
|
onMouseLeave: v.state === "compact" ? Dt : void 0,
|
|
3036
3066
|
drag: S.includes(v.state),
|
|
@@ -3047,7 +3077,7 @@ function on({
|
|
|
3047
3077
|
animate: {
|
|
3048
3078
|
bottom: v.state === "minimized" ? 0 : y.VIEWPORT_OFFSET
|
|
3049
3079
|
},
|
|
3050
|
-
transition:
|
|
3080
|
+
transition: He,
|
|
3051
3081
|
style: {
|
|
3052
3082
|
x: he,
|
|
3053
3083
|
y: ue,
|
|
@@ -3066,7 +3096,7 @@ function on({
|
|
|
3066
3096
|
x: v.state === "collapsed" && $ === "right" ? y.COMPACT_WIDTH - y.COLLAPSED_SIZE : 0,
|
|
3067
3097
|
borderBottomLeftRadius: v.state === "minimized" ? 0 : y.BORDER_RADIUS,
|
|
3068
3098
|
borderBottomRightRadius: v.state === "minimized" ? 0 : y.BORDER_RADIUS,
|
|
3069
|
-
transition: B.value.trim() ? { duration: 0 } :
|
|
3099
|
+
transition: B.value.trim() ? { duration: 0 } : He
|
|
3070
3100
|
},
|
|
3071
3101
|
onAnimationStart: () => Ie(!0),
|
|
3072
3102
|
onAnimationComplete: () => Ie(!1),
|
|
@@ -3074,7 +3104,7 @@ function on({
|
|
|
3074
3104
|
borderTopLeftRadius: y.BORDER_RADIUS,
|
|
3075
3105
|
borderTopRightRadius: y.BORDER_RADIUS
|
|
3076
3106
|
},
|
|
3077
|
-
children: /* @__PURE__ */ w(
|
|
3107
|
+
children: /* @__PURE__ */ w(ct, { mode: "wait", children: [
|
|
3078
3108
|
v.state === "collapsed" && /* @__PURE__ */ a(
|
|
3079
3109
|
en,
|
|
3080
3110
|
{
|
|
@@ -3106,13 +3136,13 @@ function on({
|
|
|
3106
3136
|
placeholder: l,
|
|
3107
3137
|
isProcessing: i,
|
|
3108
3138
|
onBlur: Dt,
|
|
3109
|
-
onFocus:
|
|
3139
|
+
onFocus: De,
|
|
3110
3140
|
onExpand: Rt,
|
|
3111
3141
|
showExpandButton: !B.value.trim(),
|
|
3112
3142
|
focusOnMount: ce.current,
|
|
3113
3143
|
onStop: M,
|
|
3114
3144
|
suggestions: j,
|
|
3115
|
-
clearSuggestions:
|
|
3145
|
+
clearSuggestions: h,
|
|
3116
3146
|
handleSuggestionSubmit: bt,
|
|
3117
3147
|
expandOnClick: ne
|
|
3118
3148
|
},
|
|
@@ -3146,8 +3176,8 @@ function cn({ className: t, size: e = 24 }) {
|
|
|
3146
3176
|
}
|
|
3147
3177
|
);
|
|
3148
3178
|
}
|
|
3149
|
-
const
|
|
3150
|
-
container:
|
|
3179
|
+
const _r = "ChatHeader-module_container", Tr = {
|
|
3180
|
+
container: _r
|
|
3151
3181
|
};
|
|
3152
3182
|
function sn({ onClose: t, className: e }) {
|
|
3153
3183
|
return /* @__PURE__ */ a(
|
|
@@ -3155,10 +3185,10 @@ function sn({ onClose: t, className: e }) {
|
|
|
3155
3185
|
{
|
|
3156
3186
|
"data-slot": "chat-header",
|
|
3157
3187
|
"data-draggable": "true",
|
|
3158
|
-
className:
|
|
3188
|
+
className: Tr.container,
|
|
3159
3189
|
initial: { opacity: 0 },
|
|
3160
3190
|
animate: { opacity: 1 },
|
|
3161
|
-
transition: { ...
|
|
3191
|
+
transition: { ...Be, delay: 0.1 },
|
|
3162
3192
|
children: t && /* @__PURE__ */ a(
|
|
3163
3193
|
we,
|
|
3164
3194
|
{
|
|
@@ -3172,11 +3202,11 @@ function sn({ onClose: t, className: e }) {
|
|
|
3172
3202
|
);
|
|
3173
3203
|
}
|
|
3174
3204
|
function St({ className: t } = {}) {
|
|
3175
|
-
const { onClose: e } =
|
|
3205
|
+
const { onClose: e } = Le();
|
|
3176
3206
|
return /* @__PURE__ */ a(sn, { onClose: e, className: t });
|
|
3177
3207
|
}
|
|
3178
|
-
const
|
|
3179
|
-
function
|
|
3208
|
+
const Ir = 0.12, Sr = 1;
|
|
3209
|
+
function kr({
|
|
3180
3210
|
scrollAreaRef: t,
|
|
3181
3211
|
visibleMessages: e
|
|
3182
3212
|
}) {
|
|
@@ -3194,17 +3224,17 @@ function Ir({
|
|
|
3194
3224
|
o.current = !1, s();
|
|
3195
3225
|
return;
|
|
3196
3226
|
}
|
|
3197
|
-
const u =
|
|
3227
|
+
const u = Mr(d);
|
|
3198
3228
|
if (u === null || d.scrollTop >= u) {
|
|
3199
3229
|
s();
|
|
3200
3230
|
return;
|
|
3201
3231
|
}
|
|
3202
|
-
const
|
|
3203
|
-
if (
|
|
3232
|
+
const p = u - d.scrollTop;
|
|
3233
|
+
if (p <= Sr) {
|
|
3204
3234
|
d.scrollTop = u, s();
|
|
3205
3235
|
return;
|
|
3206
3236
|
}
|
|
3207
|
-
d.scrollTop += Math.ceil(
|
|
3237
|
+
d.scrollTop += Math.ceil(p * Ir), r.current = d.scrollTop, c.current = requestAnimationFrame(g);
|
|
3208
3238
|
};
|
|
3209
3239
|
c.current = requestAnimationFrame(g);
|
|
3210
3240
|
}, [t, s]);
|
|
@@ -3248,11 +3278,11 @@ function Ir({
|
|
|
3248
3278
|
s
|
|
3249
3279
|
]);
|
|
3250
3280
|
}
|
|
3251
|
-
function
|
|
3281
|
+
function Mr(t) {
|
|
3252
3282
|
const e = t.querySelectorAll('[data-role="user"]'), i = e[e.length - 1];
|
|
3253
3283
|
return (i == null ? void 0 : i.offsetTop) ?? null;
|
|
3254
3284
|
}
|
|
3255
|
-
function
|
|
3285
|
+
function Ar({ className: t, size: e = 28 }) {
|
|
3256
3286
|
return /* @__PURE__ */ w(
|
|
3257
3287
|
"svg",
|
|
3258
3288
|
{
|
|
@@ -3288,8 +3318,8 @@ function kr({ className: t, size: e = 28 }) {
|
|
|
3288
3318
|
}
|
|
3289
3319
|
);
|
|
3290
3320
|
}
|
|
3291
|
-
const
|
|
3292
|
-
container:
|
|
3321
|
+
const Or = "MessageActions-module_container", Wt = {
|
|
3322
|
+
container: Or
|
|
3293
3323
|
};
|
|
3294
3324
|
function zt({
|
|
3295
3325
|
message: t,
|
|
@@ -3338,15 +3368,15 @@ function zt({
|
|
|
3338
3368
|
}
|
|
3339
3369
|
);
|
|
3340
3370
|
}
|
|
3341
|
-
const
|
|
3342
|
-
message:
|
|
3343
|
-
user:
|
|
3344
|
-
bubble:
|
|
3345
|
-
error:
|
|
3346
|
-
icon:
|
|
3347
|
-
content:
|
|
3348
|
-
disabled:
|
|
3349
|
-
},
|
|
3371
|
+
const Lr = "Message-module_message", Nr = "Message-module_user", xr = "Message-module_bubble", Dr = "Message-module_error", Er = "Message-module_icon", Rr = "Message-module_content", Pr = "Message-module_disabled", Ze = {
|
|
3372
|
+
message: Lr,
|
|
3373
|
+
user: Nr,
|
|
3374
|
+
bubble: xr,
|
|
3375
|
+
error: Dr,
|
|
3376
|
+
icon: Er,
|
|
3377
|
+
content: Rr,
|
|
3378
|
+
disabled: Pr
|
|
3379
|
+
}, $r = ae.forwardRef(
|
|
3350
3380
|
function({
|
|
3351
3381
|
message: e,
|
|
3352
3382
|
messageRenderer: i = At,
|
|
@@ -3354,7 +3384,7 @@ const Ar = "Message-module_message", Or = "Message-module_user", Lr = "Message-m
|
|
|
3354
3384
|
}, o) {
|
|
3355
3385
|
const c = Array.isArray(e.content) ? e.content : [], r = n && e.role !== "user" && e.showIcon && c.some(
|
|
3356
3386
|
(l) => l.type === "text" && !!l.text
|
|
3357
|
-
), s = () => /* @__PURE__ */ a(
|
|
3387
|
+
), s = () => /* @__PURE__ */ a(Je, { children: c.map((l, g) => {
|
|
3358
3388
|
if (l.type === "text" && l.text)
|
|
3359
3389
|
return /* @__PURE__ */ a(i, { children: l.text }, g);
|
|
3360
3390
|
if (l.type === "component" && l.component) {
|
|
@@ -3378,23 +3408,23 @@ const Ar = "Message-module_message", Or = "Message-module_user", Lr = "Message-m
|
|
|
3378
3408
|
animate: "visible",
|
|
3379
3409
|
"data-slot": "message",
|
|
3380
3410
|
"data-role": e.role,
|
|
3381
|
-
className:
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
e.disabled ?
|
|
3411
|
+
className: ge(
|
|
3412
|
+
Ze.message,
|
|
3413
|
+
Ze[e.role],
|
|
3414
|
+
e.disabled ? Ze.disabled : void 0
|
|
3385
3415
|
),
|
|
3386
3416
|
children: [
|
|
3387
|
-
r && /* @__PURE__ */ a("div", { className:
|
|
3417
|
+
r && /* @__PURE__ */ a("div", { className: Ze.icon, "aria-hidden": "true", children: /* @__PURE__ */ a(Ar, { size: 28 }) }),
|
|
3388
3418
|
/* @__PURE__ */ w(
|
|
3389
3419
|
"div",
|
|
3390
3420
|
{
|
|
3391
|
-
className:
|
|
3421
|
+
className: Ze.content,
|
|
3392
3422
|
title: e.disabled ? E(
|
|
3393
3423
|
"This action is no longer available or cannot be performed",
|
|
3394
3424
|
"a8c-agenttic"
|
|
3395
3425
|
) : void 0,
|
|
3396
3426
|
children: [
|
|
3397
|
-
/* @__PURE__ */ a("div", { className:
|
|
3427
|
+
/* @__PURE__ */ a("div", { className: Ze.bubble, children: s() }),
|
|
3398
3428
|
e.role !== "user" && /* @__PURE__ */ a(zt, { message: e })
|
|
3399
3429
|
]
|
|
3400
3430
|
}
|
|
@@ -3404,19 +3434,19 @@ const Ar = "Message-module_message", Or = "Message-module_user", Lr = "Message-m
|
|
|
3404
3434
|
}
|
|
3405
3435
|
);
|
|
3406
3436
|
}
|
|
3407
|
-
),
|
|
3408
|
-
container: Pr,
|
|
3409
|
-
bottomMessages: $r
|
|
3410
|
-
}, Fr = "Thinking-module_container", jr = "Thinking-module_icon", Ur = "Thinking-module_content", Tt = {
|
|
3437
|
+
), Fr = "Messages-module_container", jr = "Messages-module_bottomMessages", at = {
|
|
3411
3438
|
container: Fr,
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3439
|
+
bottomMessages: jr
|
|
3440
|
+
}, Ur = "Thinking-module_container", Br = "Thinking-module_icon", Hr = "Thinking-module_content", Tt = {
|
|
3441
|
+
container: Ur,
|
|
3442
|
+
icon: Br,
|
|
3443
|
+
content: Hr
|
|
3444
|
+
}, Vr = Kt(
|
|
3415
3445
|
ae.forwardRef(
|
|
3416
3446
|
function({
|
|
3417
3447
|
content: e = E("Thinking…", "a8c-agenttic")
|
|
3418
3448
|
}, i) {
|
|
3419
|
-
const n =
|
|
3449
|
+
const n = ot(() => /* @__PURE__ */ a(Lt, {}), []);
|
|
3420
3450
|
return /* @__PURE__ */ w(
|
|
3421
3451
|
"div",
|
|
3422
3452
|
{
|
|
@@ -3431,7 +3461,7 @@ const Ar = "Message-module_message", Or = "Message-module_user", Lr = "Message-m
|
|
|
3431
3461
|
);
|
|
3432
3462
|
}
|
|
3433
3463
|
)
|
|
3434
|
-
),
|
|
3464
|
+
), Wr = (t) => t.map((e) => ({
|
|
3435
3465
|
...e,
|
|
3436
3466
|
content: e.content.filter(
|
|
3437
3467
|
(i) => i.type !== "context" && i.type !== "data"
|
|
@@ -3447,23 +3477,27 @@ function ln({
|
|
|
3447
3477
|
messagesPosition: r = "top",
|
|
3448
3478
|
showAgentIcon: s
|
|
3449
3479
|
}) {
|
|
3450
|
-
const l = A(null), g =
|
|
3451
|
-
|
|
3452
|
-
const d =
|
|
3480
|
+
const l = A(null), g = Wr(t);
|
|
3481
|
+
kr({ scrollAreaRef: l, visibleMessages: g });
|
|
3482
|
+
const d = ot(() => {
|
|
3453
3483
|
const M = g.filter(
|
|
3454
3484
|
(N) => N.role === "agent"
|
|
3455
3485
|
);
|
|
3456
3486
|
return M.length ? M[M.length - 1].content.filter((N) => N.type === "text").map((N) => N.text).join(" ") : "";
|
|
3457
|
-
}, [g]), [u] = Rn(d, 1e3),
|
|
3487
|
+
}, [g]), [u] = Rn(d, 1e3), p = d !== u;
|
|
3458
3488
|
return g.length === 0 && !e ? n ? /* @__PURE__ */ a(
|
|
3459
3489
|
"div",
|
|
3460
3490
|
{
|
|
3461
3491
|
"data-slot": "messages",
|
|
3462
|
-
className:
|
|
3492
|
+
className: ge(
|
|
3493
|
+
at.container,
|
|
3494
|
+
at.emptyState,
|
|
3495
|
+
r === "bottom" ? at.bottomMessages : ""
|
|
3496
|
+
),
|
|
3463
3497
|
ref: l,
|
|
3464
3498
|
children: n
|
|
3465
3499
|
}
|
|
3466
|
-
) : null : /* @__PURE__ */ w(
|
|
3500
|
+
) : null : /* @__PURE__ */ w(Je, { children: [
|
|
3467
3501
|
/* @__PURE__ */ a(
|
|
3468
3502
|
"div",
|
|
3469
3503
|
{
|
|
@@ -3483,14 +3517,14 @@ function ln({
|
|
|
3483
3517
|
"div",
|
|
3484
3518
|
{
|
|
3485
3519
|
"data-slot": "messages",
|
|
3486
|
-
className:
|
|
3487
|
-
|
|
3488
|
-
r === "bottom" ?
|
|
3520
|
+
className: ge(
|
|
3521
|
+
at.container,
|
|
3522
|
+
r === "bottom" ? at.bottomMessages : ""
|
|
3489
3523
|
),
|
|
3490
3524
|
ref: l,
|
|
3491
|
-
children: /* @__PURE__ */ w(
|
|
3525
|
+
children: /* @__PURE__ */ w(ct, { mode: "popLayout", children: [
|
|
3492
3526
|
g.map((M) => /* @__PURE__ */ a(
|
|
3493
|
-
|
|
3527
|
+
$r,
|
|
3494
3528
|
{
|
|
3495
3529
|
message: M,
|
|
3496
3530
|
messageRenderer: o,
|
|
@@ -3498,7 +3532,7 @@ function ln({
|
|
|
3498
3532
|
},
|
|
3499
3533
|
M.reactKey || M.id
|
|
3500
3534
|
)),
|
|
3501
|
-
e && !
|
|
3535
|
+
e && !p && /* @__PURE__ */ a(Vr, { content: c }),
|
|
3502
3536
|
i && /* @__PURE__ */ a(
|
|
3503
3537
|
"div",
|
|
3504
3538
|
{
|
|
@@ -3526,7 +3560,7 @@ function dn({ className: t } = {}) {
|
|
|
3526
3560
|
messagesPosition: r,
|
|
3527
3561
|
showAgentIcon: s,
|
|
3528
3562
|
thinkingMessage: l
|
|
3529
|
-
} =
|
|
3563
|
+
} = Le();
|
|
3530
3564
|
return /* @__PURE__ */ a(
|
|
3531
3565
|
ln,
|
|
3532
3566
|
{
|
|
@@ -3542,7 +3576,7 @@ function dn({ className: t } = {}) {
|
|
|
3542
3576
|
}
|
|
3543
3577
|
);
|
|
3544
3578
|
}
|
|
3545
|
-
function
|
|
3579
|
+
function zr({ className: t, size: e = 24 }) {
|
|
3546
3580
|
return /* @__PURE__ */ a(
|
|
3547
3581
|
"svg",
|
|
3548
3582
|
{
|
|
@@ -3577,20 +3611,20 @@ function un({
|
|
|
3577
3611
|
handleSubmit: g,
|
|
3578
3612
|
handleKeyDown: d,
|
|
3579
3613
|
textareaRef: u,
|
|
3580
|
-
placeholder:
|
|
3614
|
+
placeholder: p,
|
|
3581
3615
|
isProcessing: M,
|
|
3582
3616
|
onStop: x,
|
|
3583
3617
|
fromCompact: N,
|
|
3584
3618
|
onExpand: j,
|
|
3585
|
-
showExpandButton:
|
|
3619
|
+
showExpandButton: h,
|
|
3586
3620
|
focusOnMount: _,
|
|
3587
3621
|
onInputFocus: k,
|
|
3588
3622
|
onInputBlur: D
|
|
3589
|
-
} =
|
|
3623
|
+
} = Le(), C = (z) => {
|
|
3590
3624
|
o == null || o(z), !z.defaultPrevented && d(z);
|
|
3591
|
-
}, H =
|
|
3625
|
+
}, H = ot(() => r ? [{
|
|
3592
3626
|
id: "image-upload",
|
|
3593
|
-
icon: /* @__PURE__ */ a(
|
|
3627
|
+
icon: /* @__PURE__ */ a(zr, {}),
|
|
3594
3628
|
onClick: () => {
|
|
3595
3629
|
var S;
|
|
3596
3630
|
return (S = r.current) == null ? void 0 : S.openFileDialog();
|
|
@@ -3608,12 +3642,12 @@ function un({
|
|
|
3608
3642
|
onFocus: k,
|
|
3609
3643
|
onBlur: D,
|
|
3610
3644
|
textareaRef: u,
|
|
3611
|
-
placeholder:
|
|
3645
|
+
placeholder: p,
|
|
3612
3646
|
isProcessing: M,
|
|
3613
3647
|
onStop: x,
|
|
3614
3648
|
fromCompact: N,
|
|
3615
3649
|
onExpand: j,
|
|
3616
|
-
showExpandButton:
|
|
3650
|
+
showExpandButton: h,
|
|
3617
3651
|
focusOnMount: _,
|
|
3618
3652
|
disabled: e,
|
|
3619
3653
|
customActions: H,
|
|
@@ -3635,13 +3669,13 @@ function gn({
|
|
|
3635
3669
|
messages: r,
|
|
3636
3670
|
variant: s,
|
|
3637
3671
|
emptyView: l
|
|
3638
|
-
} =
|
|
3672
|
+
} = Le(), g = b(
|
|
3639
3673
|
(d, u) => {
|
|
3640
3674
|
try {
|
|
3641
|
-
const
|
|
3642
|
-
i == null || i(
|
|
3643
|
-
} catch (
|
|
3644
|
-
console.warn("Suggestions onSelect callback failed:",
|
|
3675
|
+
const p = d.prompt ?? d.label;
|
|
3676
|
+
i == null || i(p);
|
|
3677
|
+
} catch (p) {
|
|
3678
|
+
console.warn("Suggestions onSelect callback failed:", p);
|
|
3645
3679
|
}
|
|
3646
3680
|
o(d, u);
|
|
3647
3681
|
},
|
|
@@ -3656,7 +3690,7 @@ function gn({
|
|
|
3656
3690
|
}
|
|
3657
3691
|
);
|
|
3658
3692
|
}
|
|
3659
|
-
function
|
|
3693
|
+
function Gr({ className: t, size: e = 18 }) {
|
|
3660
3694
|
return /* @__PURE__ */ w(
|
|
3661
3695
|
"svg",
|
|
3662
3696
|
{
|
|
@@ -3690,7 +3724,7 @@ function Wr({ className: t, size: e = 18 }) {
|
|
|
3690
3724
|
}
|
|
3691
3725
|
);
|
|
3692
3726
|
}
|
|
3693
|
-
function
|
|
3727
|
+
function Zr({ className: t, size: e = 18 }) {
|
|
3694
3728
|
return /* @__PURE__ */ w(
|
|
3695
3729
|
"svg",
|
|
3696
3730
|
{
|
|
@@ -3730,16 +3764,16 @@ function zr({ className: t, size: e = 18 }) {
|
|
|
3730
3764
|
}
|
|
3731
3765
|
);
|
|
3732
3766
|
}
|
|
3733
|
-
const
|
|
3734
|
-
container:
|
|
3735
|
-
isSuccess:
|
|
3736
|
-
icon:
|
|
3737
|
-
isWarning:
|
|
3738
|
-
isError:
|
|
3739
|
-
content:
|
|
3740
|
-
actions:
|
|
3741
|
-
action:
|
|
3742
|
-
dismissible:
|
|
3767
|
+
const Yr = "Notice-module_container", Kr = "Notice-module_isSuccess", Jr = "Notice-module_icon", qr = "Notice-module_isWarning", Xr = "Notice-module_isError", Qr = "Notice-module_content", eo = "Notice-module_actions", to = "Notice-module_action", ao = "Notice-module_dismissible", Ae = {
|
|
3768
|
+
container: Yr,
|
|
3769
|
+
isSuccess: Kr,
|
|
3770
|
+
icon: Jr,
|
|
3771
|
+
isWarning: qr,
|
|
3772
|
+
isError: Xr,
|
|
3773
|
+
content: Qr,
|
|
3774
|
+
actions: eo,
|
|
3775
|
+
action: to,
|
|
3776
|
+
dismissible: ao
|
|
3743
3777
|
};
|
|
3744
3778
|
function mn({
|
|
3745
3779
|
icon: t,
|
|
@@ -3757,9 +3791,9 @@ function mn({
|
|
|
3757
3791
|
return null;
|
|
3758
3792
|
switch (r) {
|
|
3759
3793
|
case "warning":
|
|
3760
|
-
return /* @__PURE__ */ a(
|
|
3794
|
+
return /* @__PURE__ */ a(Gr, {});
|
|
3761
3795
|
case "error":
|
|
3762
|
-
return /* @__PURE__ */ a(
|
|
3796
|
+
return /* @__PURE__ */ a(Zr, {});
|
|
3763
3797
|
default:
|
|
3764
3798
|
return null;
|
|
3765
3799
|
}
|
|
@@ -3768,7 +3802,7 @@ function mn({
|
|
|
3768
3802
|
"div",
|
|
3769
3803
|
{
|
|
3770
3804
|
"data-slot": "notice",
|
|
3771
|
-
className:
|
|
3805
|
+
className: ge(
|
|
3772
3806
|
Ae.container,
|
|
3773
3807
|
{
|
|
3774
3808
|
[Ae.isSuccess]: r === "success",
|
|
@@ -3826,7 +3860,7 @@ function mn({
|
|
|
3826
3860
|
);
|
|
3827
3861
|
}
|
|
3828
3862
|
function pn({ className: t } = {}) {
|
|
3829
|
-
const { notice: e } =
|
|
3863
|
+
const { notice: e } = Le();
|
|
3830
3864
|
return e ? /* @__PURE__ */ a(
|
|
3831
3865
|
mn,
|
|
3832
3866
|
{
|
|
@@ -3840,8 +3874,8 @@ function pn({ className: t } = {}) {
|
|
|
3840
3874
|
}
|
|
3841
3875
|
) : null;
|
|
3842
3876
|
}
|
|
3843
|
-
const
|
|
3844
|
-
container:
|
|
3877
|
+
const no = "ChatFooter-module_container", kt = {
|
|
3878
|
+
container: no
|
|
3845
3879
|
};
|
|
3846
3880
|
function hn({
|
|
3847
3881
|
children: t,
|
|
@@ -3851,20 +3885,20 @@ function hn({
|
|
|
3851
3885
|
se.div,
|
|
3852
3886
|
{
|
|
3853
3887
|
"data-slot": "chat-footer",
|
|
3854
|
-
className:
|
|
3888
|
+
className: ge(kt.container, e),
|
|
3855
3889
|
initial: { opacity: 0, scale: 1 },
|
|
3856
3890
|
animate: { opacity: 1, scale: 1 },
|
|
3857
|
-
transition: { ...
|
|
3891
|
+
transition: { ...Be },
|
|
3858
3892
|
children: t
|
|
3859
3893
|
}
|
|
3860
3894
|
) : /* @__PURE__ */ w(
|
|
3861
3895
|
se.div,
|
|
3862
3896
|
{
|
|
3863
3897
|
"data-slot": "chat-footer",
|
|
3864
|
-
className:
|
|
3898
|
+
className: ge(kt.container, e),
|
|
3865
3899
|
initial: { opacity: 0, scale: 1 },
|
|
3866
3900
|
animate: { opacity: 1, scale: 1 },
|
|
3867
|
-
transition: { ...
|
|
3901
|
+
transition: { ...Be },
|
|
3868
3902
|
children: [
|
|
3869
3903
|
/* @__PURE__ */ a(gn, {}),
|
|
3870
3904
|
/* @__PURE__ */ a(pn, {}),
|
|
@@ -3873,15 +3907,15 @@ function hn({
|
|
|
3873
3907
|
}
|
|
3874
3908
|
);
|
|
3875
3909
|
}
|
|
3876
|
-
const
|
|
3877
|
-
container:
|
|
3878
|
-
withHeader:
|
|
3910
|
+
const io = "ConversationView-module_container", ro = "ConversationView-module_withHeader", Ke = {
|
|
3911
|
+
container: io,
|
|
3912
|
+
withHeader: ro
|
|
3879
3913
|
}, xt = Jt(function({
|
|
3880
3914
|
showHeader: e = !0,
|
|
3881
3915
|
children: i,
|
|
3882
3916
|
className: n
|
|
3883
3917
|
} = {}, o) {
|
|
3884
|
-
const { onClose: c } =
|
|
3918
|
+
const { onClose: c } = Le();
|
|
3885
3919
|
if (O(() => {
|
|
3886
3920
|
const r = (s) => {
|
|
3887
3921
|
s.key === "Escape" && c && c();
|
|
@@ -3896,7 +3930,7 @@ const ao = "ConversationView-module_container", no = "ConversationView-module_wi
|
|
|
3896
3930
|
{
|
|
3897
3931
|
ref: o,
|
|
3898
3932
|
"data-slot": "conversation-view",
|
|
3899
|
-
className: `${
|
|
3933
|
+
className: `${Ke.container}${r ? ` ${Ke.withHeader}` : ""}${n ? ` ${n}` : ""}`,
|
|
3900
3934
|
children: i
|
|
3901
3935
|
}
|
|
3902
3936
|
);
|
|
@@ -3906,7 +3940,7 @@ const ao = "ConversationView-module_container", no = "ConversationView-module_wi
|
|
|
3906
3940
|
{
|
|
3907
3941
|
ref: o,
|
|
3908
3942
|
"data-slot": "conversation-view",
|
|
3909
|
-
className: `${
|
|
3943
|
+
className: `${Ke.container}${e ? ` ${Ke.withHeader}` : ""}${n ? ` ${n}` : ""}`,
|
|
3910
3944
|
children: [
|
|
3911
3945
|
e && /* @__PURE__ */ a(St, {}),
|
|
3912
3946
|
/* @__PURE__ */ a(dn, {}),
|
|
@@ -3916,14 +3950,14 @@ const ao = "ConversationView-module_container", no = "ConversationView-module_wi
|
|
|
3916
3950
|
);
|
|
3917
3951
|
});
|
|
3918
3952
|
xt.displayName = "AgentUIConversationView";
|
|
3919
|
-
const
|
|
3920
|
-
container:
|
|
3921
|
-
button:
|
|
3922
|
-
icon:
|
|
3923
|
-
iconOpen:
|
|
3924
|
-
dropdown:
|
|
3953
|
+
const oo = "AgentUIInputToolbar-module_container", co = "AgentUIInputToolbar-module_button", so = "AgentUIInputToolbar-module_icon", lo = "AgentUIInputToolbar-module_iconOpen", uo = "AgentUIInputToolbar-module_dropdown", nt = {
|
|
3954
|
+
container: oo,
|
|
3955
|
+
button: co,
|
|
3956
|
+
icon: so,
|
|
3957
|
+
iconOpen: lo,
|
|
3958
|
+
dropdown: uo
|
|
3925
3959
|
};
|
|
3926
|
-
function
|
|
3960
|
+
function go({
|
|
3927
3961
|
children: t,
|
|
3928
3962
|
className: e,
|
|
3929
3963
|
icon: i,
|
|
@@ -3931,12 +3965,12 @@ function lo({
|
|
|
3931
3965
|
disabled: o
|
|
3932
3966
|
} = {}) {
|
|
3933
3967
|
const [c, r] = ae.useState(!1), s = n ?? "Input Toolbar";
|
|
3934
|
-
return /* @__PURE__ */ a("div", { className: e, children: /* @__PURE__ */ a("div", { className:
|
|
3935
|
-
/* @__PURE__ */ a(
|
|
3968
|
+
return /* @__PURE__ */ a("div", { className: e, children: /* @__PURE__ */ a("div", { className: nt.container, children: /* @__PURE__ */ w(Ue.Root, { open: c, onOpenChange: r, children: [
|
|
3969
|
+
/* @__PURE__ */ a(Ue.Trigger, { asChild: !0, children: /* @__PURE__ */ w(
|
|
3936
3970
|
"button",
|
|
3937
3971
|
{
|
|
3938
3972
|
type: "button",
|
|
3939
|
-
className:
|
|
3973
|
+
className: nt.button,
|
|
3940
3974
|
"aria-label": s,
|
|
3941
3975
|
disabled: o,
|
|
3942
3976
|
children: [
|
|
@@ -3950,7 +3984,7 @@ function lo({
|
|
|
3950
3984
|
viewBox: "0 0 24 24",
|
|
3951
3985
|
fill: "none",
|
|
3952
3986
|
"aria-hidden": "true",
|
|
3953
|
-
className: `${
|
|
3987
|
+
className: `${nt.icon} ${c ? nt.iconOpen : ""}`,
|
|
3954
3988
|
children: /* @__PURE__ */ a(
|
|
3955
3989
|
"path",
|
|
3956
3990
|
{
|
|
@@ -3966,9 +4000,9 @@ function lo({
|
|
|
3966
4000
|
}
|
|
3967
4001
|
) }),
|
|
3968
4002
|
/* @__PURE__ */ a(
|
|
3969
|
-
|
|
4003
|
+
Ue.Content,
|
|
3970
4004
|
{
|
|
3971
|
-
className:
|
|
4005
|
+
className: nt.dropdown,
|
|
3972
4006
|
side: "bottom",
|
|
3973
4007
|
align: "start",
|
|
3974
4008
|
sideOffset: 8,
|
|
@@ -3979,7 +4013,7 @@ function lo({
|
|
|
3979
4013
|
)
|
|
3980
4014
|
] }) }) });
|
|
3981
4015
|
}
|
|
3982
|
-
const
|
|
4016
|
+
const mo = {
|
|
3983
4017
|
// Core container with state management
|
|
3984
4018
|
Container: on,
|
|
3985
4019
|
// Individual composable components
|
|
@@ -3988,16 +4022,16 @@ const uo = {
|
|
|
3988
4022
|
Input: un,
|
|
3989
4023
|
Suggestions: gn,
|
|
3990
4024
|
Notice: pn,
|
|
3991
|
-
InputToolbar:
|
|
4025
|
+
InputToolbar: go,
|
|
3992
4026
|
// Convenience wrappers
|
|
3993
4027
|
Footer: hn,
|
|
3994
4028
|
ConversationView: xt
|
|
3995
|
-
},
|
|
4029
|
+
}, yc = Object.assign(
|
|
3996
4030
|
(t) => /* @__PURE__ */ a(
|
|
3997
4031
|
on,
|
|
3998
4032
|
{
|
|
3999
4033
|
...t,
|
|
4000
|
-
className:
|
|
4034
|
+
className: ge("agenttic", t.className),
|
|
4001
4035
|
children: /* @__PURE__ */ a(
|
|
4002
4036
|
xt,
|
|
4003
4037
|
{
|
|
@@ -4006,9 +4040,9 @@ const uo = {
|
|
|
4006
4040
|
)
|
|
4007
4041
|
}
|
|
4008
4042
|
),
|
|
4009
|
-
|
|
4043
|
+
mo
|
|
4010
4044
|
);
|
|
4011
|
-
function
|
|
4045
|
+
function po({
|
|
4012
4046
|
inputValue: t,
|
|
4013
4047
|
onInputChange: e,
|
|
4014
4048
|
onSubmit: i,
|
|
@@ -4021,13 +4055,13 @@ function go({
|
|
|
4021
4055
|
onExpand: g,
|
|
4022
4056
|
disabled: d,
|
|
4023
4057
|
notice: u,
|
|
4024
|
-
suggestions:
|
|
4058
|
+
suggestions: p,
|
|
4025
4059
|
clearSuggestions: M,
|
|
4026
4060
|
focusOnMount: x,
|
|
4027
4061
|
customActions: N,
|
|
4028
4062
|
actionOrder: j
|
|
4029
4063
|
}) {
|
|
4030
|
-
const
|
|
4064
|
+
const h = b(
|
|
4031
4065
|
(_, k) => {
|
|
4032
4066
|
const D = _.prompt ?? _.label;
|
|
4033
4067
|
e(D), M == null || M();
|
|
@@ -4041,13 +4075,13 @@ function go({
|
|
|
4041
4075
|
className: kt.container,
|
|
4042
4076
|
initial: { opacity: 0, scale: 1 },
|
|
4043
4077
|
animate: { opacity: 1, scale: 1 },
|
|
4044
|
-
transition: { ...
|
|
4078
|
+
transition: { ...Be },
|
|
4045
4079
|
children: [
|
|
4046
4080
|
!t && /* @__PURE__ */ a(
|
|
4047
4081
|
vt,
|
|
4048
4082
|
{
|
|
4049
|
-
suggestions:
|
|
4050
|
-
onSubmit:
|
|
4083
|
+
suggestions: p,
|
|
4084
|
+
onSubmit: h
|
|
4051
4085
|
}
|
|
4052
4086
|
),
|
|
4053
4087
|
u && /* @__PURE__ */ a(
|
|
@@ -4098,28 +4132,28 @@ function Gt({
|
|
|
4098
4132
|
onStop: g,
|
|
4099
4133
|
fromCompact: d = !1,
|
|
4100
4134
|
showHeader: u = !1,
|
|
4101
|
-
onClose:
|
|
4135
|
+
onClose: p,
|
|
4102
4136
|
onExpand: M,
|
|
4103
4137
|
notice: x,
|
|
4104
4138
|
emptyView: N,
|
|
4105
4139
|
suggestions: j,
|
|
4106
|
-
clearSuggestions:
|
|
4140
|
+
clearSuggestions: h,
|
|
4107
4141
|
messageRenderer: _,
|
|
4108
4142
|
showAgentIcon: k,
|
|
4109
4143
|
focusOnMount: D = !1
|
|
4110
4144
|
}) {
|
|
4111
4145
|
return O(() => {
|
|
4112
4146
|
const C = (H) => {
|
|
4113
|
-
H.key === "Escape" &&
|
|
4147
|
+
H.key === "Escape" && p && p();
|
|
4114
4148
|
};
|
|
4115
4149
|
return document.addEventListener("keydown", C), () => document.removeEventListener("keydown", C);
|
|
4116
|
-
}, [
|
|
4150
|
+
}, [p]), /* @__PURE__ */ w(
|
|
4117
4151
|
"div",
|
|
4118
4152
|
{
|
|
4119
4153
|
"data-slot": "conversation-view",
|
|
4120
|
-
className: `${
|
|
4154
|
+
className: `${Ke.container}${u ? ` ${Ke.withHeader}` : ""}`,
|
|
4121
4155
|
children: [
|
|
4122
|
-
u && /* @__PURE__ */ a(sn, { onClose:
|
|
4156
|
+
u && /* @__PURE__ */ a(sn, { onClose: p }),
|
|
4123
4157
|
/* @__PURE__ */ a(
|
|
4124
4158
|
ln,
|
|
4125
4159
|
{
|
|
@@ -4132,7 +4166,7 @@ function Gt({
|
|
|
4132
4166
|
}
|
|
4133
4167
|
),
|
|
4134
4168
|
/* @__PURE__ */ a(
|
|
4135
|
-
|
|
4169
|
+
po,
|
|
4136
4170
|
{
|
|
4137
4171
|
inputValue: i,
|
|
4138
4172
|
onInputChange: n,
|
|
@@ -4146,7 +4180,7 @@ function Gt({
|
|
|
4146
4180
|
onExpand: M,
|
|
4147
4181
|
notice: x,
|
|
4148
4182
|
suggestions: j,
|
|
4149
|
-
clearSuggestions:
|
|
4183
|
+
clearSuggestions: h,
|
|
4150
4184
|
focusOnMount: D
|
|
4151
4185
|
}
|
|
4152
4186
|
)
|
|
@@ -4154,7 +4188,7 @@ function Gt({
|
|
|
4154
4188
|
}
|
|
4155
4189
|
);
|
|
4156
4190
|
}
|
|
4157
|
-
function
|
|
4191
|
+
function bc({
|
|
4158
4192
|
messages: t,
|
|
4159
4193
|
isProcessing: e,
|
|
4160
4194
|
error: i,
|
|
@@ -4167,12 +4201,12 @@ function vc({
|
|
|
4167
4201
|
onOpen: g,
|
|
4168
4202
|
onExpand: d,
|
|
4169
4203
|
onClose: u,
|
|
4170
|
-
onStop:
|
|
4204
|
+
onStop: p,
|
|
4171
4205
|
emptyView: M,
|
|
4172
4206
|
floatingChatState: x,
|
|
4173
4207
|
suggestions: N,
|
|
4174
4208
|
clearSuggestions: j,
|
|
4175
|
-
messageRenderer:
|
|
4209
|
+
messageRenderer: h,
|
|
4176
4210
|
showAgentIcon: _,
|
|
4177
4211
|
className: k,
|
|
4178
4212
|
expandOnHover: D = !0,
|
|
@@ -4196,13 +4230,13 @@ function vc({
|
|
|
4196
4230
|
},
|
|
4197
4231
|
isProcessing: e,
|
|
4198
4232
|
floatingChatState: m.state
|
|
4199
|
-
}), [T, Te] = Z(56), [
|
|
4233
|
+
}), [T, Te] = Z(56), [me, Ne] = Z(
|
|
4200
4234
|
Ja
|
|
4201
|
-
),
|
|
4235
|
+
), Ee = A(null), xe = A(null), le = A(null), { x: Re, y: v } = qa({
|
|
4202
4236
|
freeDrag: C,
|
|
4203
4237
|
initialFreeDragPosition: H,
|
|
4204
|
-
side:
|
|
4205
|
-
}), ce = pt(
|
|
4238
|
+
side: me
|
|
4239
|
+
}), ce = pt(Re), X = pt(v), ke = qt(), Ve = b(() => {
|
|
4206
4240
|
V.current = !0, m.open(), g == null || g(), d == null || d();
|
|
4207
4241
|
}, [m, g, d]), Ie = b(() => {
|
|
4208
4242
|
var $, J, de;
|
|
@@ -4231,56 +4265,56 @@ function vc({
|
|
|
4231
4265
|
ne.current = !0, d == null || d(), m.setState("expanded");
|
|
4232
4266
|
}, [d, m]), fe = b(() => {
|
|
4233
4267
|
G.current = !0, P.clear(), m.close(), u && u();
|
|
4234
|
-
}, [P, m, u]),
|
|
4268
|
+
}, [P, m, u]), pe = b(
|
|
4235
4269
|
(L) => {
|
|
4236
|
-
if (!le.current || !
|
|
4270
|
+
if (!le.current || !xe.current)
|
|
4237
4271
|
return null;
|
|
4238
|
-
const $ = le.current.getBoundingClientRect(), J =
|
|
4272
|
+
const $ = le.current.getBoundingClientRect(), J = xe.current.getBoundingClientRect(), de = window.getComputedStyle(le.current), Me = new DOMMatrixReadOnly(de.transform), Se = $.x - Me.e, Pe = $.y - Me.f, he = (L ?? me) === "left" ? J.left : J.right - y.COMPACT_WIDTH, ue = m.state === "minimized" ? window.innerHeight - y.COLLAPSED_SIZE : J.bottom - y.EXPANDED_HEIGHT;
|
|
4239
4273
|
return {
|
|
4240
4274
|
x: he - Se,
|
|
4241
|
-
y: ue -
|
|
4275
|
+
y: ue - Pe
|
|
4242
4276
|
};
|
|
4243
4277
|
},
|
|
4244
|
-
[
|
|
4245
|
-
),
|
|
4278
|
+
[me, m.state]
|
|
4279
|
+
), De = b(
|
|
4246
4280
|
(L) => {
|
|
4247
4281
|
L.target.closest(
|
|
4248
4282
|
re.NON_DRAGGABLE_SELECTORS
|
|
4249
4283
|
) || ke.start(L.nativeEvent);
|
|
4250
4284
|
},
|
|
4251
4285
|
[ke]
|
|
4252
|
-
),
|
|
4286
|
+
), We = b(
|
|
4253
4287
|
(L, $) => {
|
|
4254
4288
|
if (C) {
|
|
4255
4289
|
Y == null || Y({ x: ce.get(), y: X.get() });
|
|
4256
4290
|
return;
|
|
4257
4291
|
}
|
|
4258
|
-
const J = $.point.x, de = y.COMPACT_WIDTH, Me = (window.innerWidth - de) / 2,
|
|
4259
|
-
|
|
4260
|
-
const
|
|
4261
|
-
|
|
4292
|
+
const J = $.point.x, de = y.COMPACT_WIDTH, Me = (window.innerWidth - de) / 2, Pe = J < Me ? "left" : "right";
|
|
4293
|
+
Ne(Pe), ht(Pe);
|
|
4294
|
+
const ze = pe(Pe);
|
|
4295
|
+
ze && (ye(ce, ze.x, {
|
|
4262
4296
|
...re.SPRING_CONFIG,
|
|
4263
4297
|
velocity: $.velocity.x * re.VELOCITY_MULTIPLIER
|
|
4264
|
-
}), ye(X,
|
|
4298
|
+
}), ye(X, ze.y, {
|
|
4265
4299
|
...re.SPRING_CONFIG,
|
|
4266
4300
|
velocity: $.velocity.y * re.VELOCITY_MULTIPLIER
|
|
4267
4301
|
}));
|
|
4268
4302
|
},
|
|
4269
|
-
[ce, X,
|
|
4303
|
+
[ce, X, pe, C, Y]
|
|
4270
4304
|
), Ce = A(C);
|
|
4271
4305
|
O(() => {
|
|
4272
4306
|
const L = Ce.current;
|
|
4273
4307
|
if (Ce.current = C, C || !L)
|
|
4274
4308
|
return;
|
|
4275
4309
|
const J = y.VIEWPORT_OFFSET + ce.get() + y.COMPACT_WIDTH / 2 < window.innerWidth / 2 ? "left" : "right";
|
|
4276
|
-
|
|
4277
|
-
const de =
|
|
4310
|
+
me !== J && (Ne(J), ht(J));
|
|
4311
|
+
const de = pe(J);
|
|
4278
4312
|
de && (ye(ce, de.x, re.SPRING_CONFIG), ye(X, de.y, re.SPRING_CONFIG));
|
|
4279
|
-
}, [C, ce, X,
|
|
4280
|
-
const ve = A(null),
|
|
4313
|
+
}, [C, ce, X, pe, me]);
|
|
4314
|
+
const ve = A(null), qe = A(m.state === "minimized");
|
|
4281
4315
|
O(() => {
|
|
4282
|
-
const L =
|
|
4283
|
-
if (
|
|
4316
|
+
const L = qe.current, $ = m.state === "minimized";
|
|
4317
|
+
if (qe.current = $, !C || $ === L)
|
|
4284
4318
|
return;
|
|
4285
4319
|
if ($) {
|
|
4286
4320
|
ve.current = X.get();
|
|
@@ -4296,7 +4330,7 @@ function vc({
|
|
|
4296
4330
|
);
|
|
4297
4331
|
return ve.current = null, () => J.stop();
|
|
4298
4332
|
}, [m.state, C, X]);
|
|
4299
|
-
const B = A(m.state),
|
|
4333
|
+
const B = A(m.state), st = B.current === "compact" && m.state === "expanded";
|
|
4300
4334
|
return O(() => {
|
|
4301
4335
|
oe(), B.current = m.state;
|
|
4302
4336
|
}, [m.state, oe]), O(() => {
|
|
@@ -4312,11 +4346,11 @@ function vc({
|
|
|
4312
4346
|
ce.set(J.x), X.set(J.y);
|
|
4313
4347
|
return;
|
|
4314
4348
|
}
|
|
4315
|
-
const $ =
|
|
4349
|
+
const $ = pe();
|
|
4316
4350
|
$ && (ce.set($.x), X.set($.y));
|
|
4317
4351
|
};
|
|
4318
4352
|
return window.addEventListener("resize", L), () => window.removeEventListener("resize", L);
|
|
4319
|
-
}, [m.state, ce, X,
|
|
4353
|
+
}, [m.state, ce, X, pe, C]), O(() => {
|
|
4320
4354
|
const L = ie.current;
|
|
4321
4355
|
return () => {
|
|
4322
4356
|
L.forEach(($) => {
|
|
@@ -4324,15 +4358,15 @@ function vc({
|
|
|
4324
4358
|
}), L.clear();
|
|
4325
4359
|
};
|
|
4326
4360
|
}, []), O(() => {
|
|
4327
|
-
if (m.state === "compact" &&
|
|
4328
|
-
const L =
|
|
4361
|
+
if (m.state === "compact" && Ee.current) {
|
|
4362
|
+
const L = Ee.current.scrollHeight + y.PADDING;
|
|
4329
4363
|
Te(L);
|
|
4330
4364
|
}
|
|
4331
4365
|
}, [m.state, P.value]), o === "embedded" ? /* @__PURE__ */ a(
|
|
4332
4366
|
"div",
|
|
4333
4367
|
{
|
|
4334
4368
|
"data-slot": "chat-embedded",
|
|
4335
|
-
className:
|
|
4369
|
+
className: ge(k, be.container, be.embedded),
|
|
4336
4370
|
children: /* @__PURE__ */ a(
|
|
4337
4371
|
Gt,
|
|
4338
4372
|
{
|
|
@@ -4344,25 +4378,25 @@ function vc({
|
|
|
4344
4378
|
textareaRef: P.textareaRef,
|
|
4345
4379
|
placeholder: s,
|
|
4346
4380
|
isProcessing: e,
|
|
4347
|
-
onStop:
|
|
4381
|
+
onStop: p,
|
|
4348
4382
|
showHeader: !1,
|
|
4349
4383
|
notice: l,
|
|
4350
4384
|
suggestions: N,
|
|
4351
4385
|
clearSuggestions: j,
|
|
4352
4386
|
error: i,
|
|
4353
4387
|
emptyView: M,
|
|
4354
|
-
messageRenderer:
|
|
4388
|
+
messageRenderer: h,
|
|
4355
4389
|
showAgentIcon: _,
|
|
4356
4390
|
onExpand: te,
|
|
4357
4391
|
focusOnMount: ne.current
|
|
4358
4392
|
}
|
|
4359
4393
|
)
|
|
4360
4394
|
}
|
|
4361
|
-
) : /* @__PURE__ */ w(
|
|
4395
|
+
) : /* @__PURE__ */ w(Je, { children: [
|
|
4362
4396
|
/* @__PURE__ */ a(
|
|
4363
4397
|
"div",
|
|
4364
4398
|
{
|
|
4365
|
-
ref:
|
|
4399
|
+
ref: xe,
|
|
4366
4400
|
style: {
|
|
4367
4401
|
position: "fixed",
|
|
4368
4402
|
top: y.VIEWPORT_OFFSET,
|
|
@@ -4378,7 +4412,7 @@ function vc({
|
|
|
4378
4412
|
{
|
|
4379
4413
|
ref: le,
|
|
4380
4414
|
"data-slot": "chat-floating",
|
|
4381
|
-
className:
|
|
4415
|
+
className: ge(k, be.container, be.floating, {
|
|
4382
4416
|
[be.expanded]: m.state === "expanded",
|
|
4383
4417
|
animating: q
|
|
4384
4418
|
}),
|
|
@@ -4386,17 +4420,17 @@ function vc({
|
|
|
4386
4420
|
drag: m.state === "expanded",
|
|
4387
4421
|
dragControls: ke,
|
|
4388
4422
|
dragListener: !1,
|
|
4389
|
-
dragConstraints:
|
|
4423
|
+
dragConstraints: xe,
|
|
4390
4424
|
dragMomentum: !1,
|
|
4391
4425
|
dragElastic: C ? 0 : 0.1,
|
|
4392
4426
|
dragTransition: { power: 0.1, timeConstant: 100 },
|
|
4393
|
-
onDragEnd:
|
|
4394
|
-
onPointerDown:
|
|
4427
|
+
onDragEnd: We,
|
|
4428
|
+
onPointerDown: De,
|
|
4395
4429
|
initial: !1,
|
|
4396
4430
|
animate: {
|
|
4397
4431
|
bottom: m.state === "minimized" ? 0 : y.VIEWPORT_OFFSET
|
|
4398
4432
|
},
|
|
4399
|
-
transition:
|
|
4433
|
+
transition: He,
|
|
4400
4434
|
style: {
|
|
4401
4435
|
x: ce,
|
|
4402
4436
|
y: X,
|
|
@@ -4411,10 +4445,10 @@ function vc({
|
|
|
4411
4445
|
animate: {
|
|
4412
4446
|
width: m.state === "collapsed" ? y.COLLAPSED_SIZE : y.COMPACT_WIDTH,
|
|
4413
4447
|
height: f(m.state),
|
|
4414
|
-
x: m.state === "collapsed" &&
|
|
4448
|
+
x: m.state === "collapsed" && me === "right" ? y.COMPACT_WIDTH - y.COLLAPSED_SIZE : 0,
|
|
4415
4449
|
borderBottomLeftRadius: m.state === "minimized" ? 0 : y.BORDER_RADIUS,
|
|
4416
4450
|
borderBottomRightRadius: m.state === "minimized" ? 0 : y.BORDER_RADIUS,
|
|
4417
|
-
transition: P.value.trim() ? { duration: 0 } :
|
|
4451
|
+
transition: P.value.trim() ? { duration: 0 } : He
|
|
4418
4452
|
},
|
|
4419
4453
|
onAnimationStart: () => _e(!0),
|
|
4420
4454
|
onAnimationComplete: () => _e(!1),
|
|
@@ -4422,12 +4456,12 @@ function vc({
|
|
|
4422
4456
|
borderTopLeftRadius: y.BORDER_RADIUS,
|
|
4423
4457
|
borderTopRightRadius: y.BORDER_RADIUS
|
|
4424
4458
|
},
|
|
4425
|
-
children: /* @__PURE__ */ w(
|
|
4459
|
+
children: /* @__PURE__ */ w(ct, { mode: "wait", children: [
|
|
4426
4460
|
m.state === "collapsed" && /* @__PURE__ */ a(
|
|
4427
4461
|
en,
|
|
4428
4462
|
{
|
|
4429
4463
|
icon: c,
|
|
4430
|
-
onClick:
|
|
4464
|
+
onClick: Ve,
|
|
4431
4465
|
onHover: R,
|
|
4432
4466
|
focusOnMount: G.current
|
|
4433
4467
|
},
|
|
@@ -4438,12 +4472,12 @@ function vc({
|
|
|
4438
4472
|
{
|
|
4439
4473
|
icon: c,
|
|
4440
4474
|
title: r,
|
|
4441
|
-
onClick:
|
|
4475
|
+
onClick: Ve,
|
|
4442
4476
|
focusOnMount: G.current
|
|
4443
4477
|
},
|
|
4444
4478
|
"minimized"
|
|
4445
4479
|
),
|
|
4446
|
-
m.state === "compact" && /* @__PURE__ */ a("div", { ref:
|
|
4480
|
+
m.state === "compact" && /* @__PURE__ */ a("div", { ref: Ee, children: /* @__PURE__ */ a(
|
|
4447
4481
|
nn,
|
|
4448
4482
|
{
|
|
4449
4483
|
value: P.value,
|
|
@@ -4457,7 +4491,7 @@ function vc({
|
|
|
4457
4491
|
onExpand: te,
|
|
4458
4492
|
showExpandButton: !P.value.trim(),
|
|
4459
4493
|
focusOnMount: V.current,
|
|
4460
|
-
onStop:
|
|
4494
|
+
onStop: p,
|
|
4461
4495
|
suggestions: N,
|
|
4462
4496
|
clearSuggestions: j
|
|
4463
4497
|
},
|
|
@@ -4474,16 +4508,16 @@ function vc({
|
|
|
4474
4508
|
textareaRef: P.textareaRef,
|
|
4475
4509
|
placeholder: s,
|
|
4476
4510
|
isProcessing: e,
|
|
4477
|
-
onStop:
|
|
4511
|
+
onStop: p,
|
|
4478
4512
|
showHeader: !0,
|
|
4479
4513
|
onClose: fe,
|
|
4480
|
-
fromCompact:
|
|
4514
|
+
fromCompact: st,
|
|
4481
4515
|
notice: l,
|
|
4482
4516
|
suggestions: N,
|
|
4483
4517
|
clearSuggestions: j,
|
|
4484
4518
|
error: i,
|
|
4485
4519
|
emptyView: M,
|
|
4486
|
-
messageRenderer:
|
|
4520
|
+
messageRenderer: h,
|
|
4487
4521
|
showAgentIcon: _,
|
|
4488
4522
|
onExpand: te,
|
|
4489
4523
|
focusOnMount: ne.current
|
|
@@ -4497,27 +4531,27 @@ function vc({
|
|
|
4497
4531
|
)
|
|
4498
4532
|
] });
|
|
4499
4533
|
}
|
|
4500
|
-
const
|
|
4501
|
-
container:
|
|
4502
|
-
active:
|
|
4503
|
-
uploader:
|
|
4504
|
-
uploading:
|
|
4505
|
-
content:
|
|
4506
|
-
hiddenInput:
|
|
4507
|
-
clickArea:
|
|
4508
|
-
draggingMessage:
|
|
4509
|
-
draggingOver:
|
|
4510
|
-
preview:
|
|
4511
|
-
previewItem:
|
|
4512
|
-
removeButton:
|
|
4513
|
-
previewImage:
|
|
4514
|
-
previewMeta:
|
|
4515
|
-
previewFilename:
|
|
4516
|
-
previewType:
|
|
4517
|
-
uploadingIndicator:
|
|
4518
|
-
spinner:
|
|
4519
|
-
invalidMessage:
|
|
4520
|
-
},
|
|
4534
|
+
const ho = "ImageUploader-module_container", fo = "ImageUploader-module_active", vo = "ImageUploader-module_uploader", yo = "ImageUploader-module_uploading", bo = "ImageUploader-module_content", wo = "ImageUploader-module_hiddenInput", Co = "ImageUploader-module_clickArea", _o = "ImageUploader-module_draggingMessage", To = "ImageUploader-module_draggingOver", Io = "ImageUploader-module_preview", So = "ImageUploader-module_previewItem", ko = "ImageUploader-module_removeButton", Mo = "ImageUploader-module_previewImage", Ao = "ImageUploader-module_previewMeta", Oo = "ImageUploader-module_previewFilename", Lo = "ImageUploader-module_previewType", No = "ImageUploader-module_uploadingIndicator", xo = "ImageUploader-module_spinner", Do = "ImageUploader-module_invalidMessage", ee = {
|
|
4535
|
+
container: ho,
|
|
4536
|
+
active: fo,
|
|
4537
|
+
uploader: vo,
|
|
4538
|
+
uploading: yo,
|
|
4539
|
+
content: bo,
|
|
4540
|
+
hiddenInput: wo,
|
|
4541
|
+
clickArea: Co,
|
|
4542
|
+
draggingMessage: _o,
|
|
4543
|
+
draggingOver: To,
|
|
4544
|
+
preview: Io,
|
|
4545
|
+
previewItem: So,
|
|
4546
|
+
removeButton: ko,
|
|
4547
|
+
previewImage: Mo,
|
|
4548
|
+
previewMeta: Ao,
|
|
4549
|
+
previewFilename: Oo,
|
|
4550
|
+
previewType: Lo,
|
|
4551
|
+
uploadingIndicator: No,
|
|
4552
|
+
spinner: xo,
|
|
4553
|
+
invalidMessage: Do
|
|
4554
|
+
}, Eo = Kt(
|
|
4521
4555
|
({
|
|
4522
4556
|
image: t,
|
|
4523
4557
|
allowDragToInsert: e,
|
|
@@ -4588,7 +4622,7 @@ const mo = "ImageUploader-module_container", po = "ImageUploader-module_active",
|
|
|
4588
4622
|
t.id
|
|
4589
4623
|
);
|
|
4590
4624
|
}
|
|
4591
|
-
),
|
|
4625
|
+
), wc = Jt(function({
|
|
4592
4626
|
images: e = [],
|
|
4593
4627
|
uploadingImages: i = [],
|
|
4594
4628
|
onFilesSelected: n,
|
|
@@ -4600,16 +4634,16 @@ const mo = "ImageUploader-module_container", po = "ImageUploader-module_active",
|
|
|
4600
4634
|
onImageDragEnd: g,
|
|
4601
4635
|
acceptedFileTypes: d = ["image/jpeg", "image/png"],
|
|
4602
4636
|
maxFileSize: u,
|
|
4603
|
-
maxFiles:
|
|
4637
|
+
maxFiles: p,
|
|
4604
4638
|
uploadingIndicator: M,
|
|
4605
4639
|
className: x = "",
|
|
4606
4640
|
showFileMetadata: N = !0,
|
|
4607
4641
|
allowDragToInsert: j = !0,
|
|
4608
|
-
onError:
|
|
4642
|
+
onError: h,
|
|
4609
4643
|
visible: _ = !0,
|
|
4610
4644
|
dropZoneRef: k
|
|
4611
4645
|
}, D) {
|
|
4612
|
-
const { textareaRef: C } =
|
|
4646
|
+
const { textareaRef: C } = Le(), [H, Y] = Z(!1), [z, S] = Z(!1), [m, V] = Z(!1), G = A(null), ne = A(null), q = A(0);
|
|
4613
4647
|
xn(D, () => ({
|
|
4614
4648
|
openFileDialog: () => {
|
|
4615
4649
|
var f;
|
|
@@ -4620,8 +4654,8 @@ const mo = "ImageUploader-module_container", po = "ImageUploader-module_active",
|
|
|
4620
4654
|
if (!f)
|
|
4621
4655
|
return;
|
|
4622
4656
|
const R = (te) => {
|
|
4623
|
-
var fe,
|
|
4624
|
-
(
|
|
4657
|
+
var fe, pe;
|
|
4658
|
+
(pe = (fe = te.dataTransfer) == null ? void 0 : fe.types) != null && pe.includes("Files") && (q.current += 1, S(!0));
|
|
4625
4659
|
}, K = (te) => {
|
|
4626
4660
|
q.current -= 1, (q.current === 0 || te.relatedTarget === null) && (q.current = 0, S(!1));
|
|
4627
4661
|
}, U = () => {
|
|
@@ -4658,8 +4692,8 @@ const mo = "ImageUploader-module_container", po = "ImageUploader-module_active",
|
|
|
4658
4692
|
if (K.length < R.length) {
|
|
4659
4693
|
V(!0);
|
|
4660
4694
|
const U = d.map((te) => te.split("/")[1].toUpperCase()).join(" or ");
|
|
4661
|
-
|
|
4662
|
-
|
|
4695
|
+
h == null || h(
|
|
4696
|
+
je(
|
|
4663
4697
|
/* translators: %s: allowed file types (e.g., "JPEG or PNG") */
|
|
4664
4698
|
E(
|
|
4665
4699
|
"Only %s image files are allowed.",
|
|
@@ -4671,21 +4705,21 @@ const mo = "ImageUploader-module_container", po = "ImageUploader-module_active",
|
|
|
4671
4705
|
V(!1);
|
|
4672
4706
|
}, 3e3);
|
|
4673
4707
|
}
|
|
4674
|
-
if (
|
|
4675
|
-
|
|
4676
|
-
|
|
4708
|
+
if (p && K.length > p) {
|
|
4709
|
+
h == null || h(
|
|
4710
|
+
je(
|
|
4677
4711
|
/* translators: %d: maximum number of files allowed */
|
|
4678
4712
|
E("Maximum %d files allowed.", "a8c-agenttic"),
|
|
4679
|
-
|
|
4713
|
+
p
|
|
4680
4714
|
)
|
|
4681
4715
|
);
|
|
4682
|
-
const U = K.slice(0,
|
|
4716
|
+
const U = K.slice(0, p);
|
|
4683
4717
|
U.length > 0 && n(U);
|
|
4684
4718
|
return;
|
|
4685
4719
|
}
|
|
4686
4720
|
K.length > 0 && n(K);
|
|
4687
4721
|
},
|
|
4688
|
-
[n, d,
|
|
4722
|
+
[n, d, p, h]
|
|
4689
4723
|
), oe = A(ie);
|
|
4690
4724
|
O(() => {
|
|
4691
4725
|
oe.current = ie;
|
|
@@ -4707,18 +4741,18 @@ const mo = "ImageUploader-module_container", po = "ImageUploader-module_active",
|
|
|
4707
4741
|
};
|
|
4708
4742
|
}, [k, c]), O(() => {
|
|
4709
4743
|
const f = (R) => {
|
|
4710
|
-
var
|
|
4744
|
+
var pe;
|
|
4711
4745
|
const K = C.current && document.activeElement === C.current, U = C.current && R.target && (R.target === C.current || C.current.contains(R.target));
|
|
4712
4746
|
if (!K && !U)
|
|
4713
4747
|
return;
|
|
4714
|
-
const te = (
|
|
4748
|
+
const te = (pe = R.clipboardData) == null ? void 0 : pe.items;
|
|
4715
4749
|
if (!te)
|
|
4716
4750
|
return;
|
|
4717
4751
|
const fe = [];
|
|
4718
|
-
for (let
|
|
4719
|
-
const
|
|
4720
|
-
if (
|
|
4721
|
-
const Ce =
|
|
4752
|
+
for (let De = 0; De < te.length; De++) {
|
|
4753
|
+
const We = te[De];
|
|
4754
|
+
if (We.type.startsWith("image/")) {
|
|
4755
|
+
const Ce = We.getAsFile();
|
|
4722
4756
|
Ce && fe.push(Ce);
|
|
4723
4757
|
}
|
|
4724
4758
|
}
|
|
@@ -4737,21 +4771,21 @@ const mo = "ImageUploader-module_container", po = "ImageUploader-module_active",
|
|
|
4737
4771
|
const R = Array.from(f.dataTransfer.files);
|
|
4738
4772
|
ie(f.dataTransfer.files), c == null || c(R);
|
|
4739
4773
|
}
|
|
4740
|
-
},
|
|
4774
|
+
}, me = (f) => {
|
|
4741
4775
|
if (f.target.files) {
|
|
4742
4776
|
const R = Array.from(f.target.files);
|
|
4743
4777
|
ie(f.target.files), o == null || o(R);
|
|
4744
4778
|
}
|
|
4745
4779
|
f.target.value = "";
|
|
4746
|
-
},
|
|
4780
|
+
}, Ne = () => {
|
|
4747
4781
|
var f;
|
|
4748
4782
|
(f = G.current) == null || f.click();
|
|
4749
|
-
},
|
|
4783
|
+
}, Ee = b(
|
|
4750
4784
|
(f, R) => {
|
|
4751
4785
|
l == null || l(f, R);
|
|
4752
4786
|
},
|
|
4753
4787
|
[l]
|
|
4754
|
-
),
|
|
4788
|
+
), xe = b(
|
|
4755
4789
|
(f, R) => {
|
|
4756
4790
|
g == null || g(f, R);
|
|
4757
4791
|
},
|
|
@@ -4764,11 +4798,11 @@ const mo = "ImageUploader-module_container", po = "ImageUploader-module_active",
|
|
|
4764
4798
|
);
|
|
4765
4799
|
if (!_)
|
|
4766
4800
|
return null;
|
|
4767
|
-
const
|
|
4801
|
+
const Re = e.length > 0, v = i.length > 0, ce = z, X = !z && (Re || v), ke = Re || v || z || m, Ve = u ? je(
|
|
4768
4802
|
/* translators: %s: maximum file size (e.g., "5 MB") */
|
|
4769
4803
|
E("Upload image files up to %s each.", "a8c-agenttic"),
|
|
4770
4804
|
_e(u)
|
|
4771
|
-
) : "", Ie =
|
|
4805
|
+
) : "", Ie = je(
|
|
4772
4806
|
/* translators: %s: allowed file types (e.g., "JPEG or PNG") */
|
|
4773
4807
|
E("Only %s image files are allowed.", "a8c-agenttic"),
|
|
4774
4808
|
d.map((f) => f.split("/")[1].toUpperCase()).join(" or ")
|
|
@@ -4783,15 +4817,15 @@ const mo = "ImageUploader-module_container", po = "ImageUploader-module_active",
|
|
|
4783
4817
|
{
|
|
4784
4818
|
className: `${ee.uploader} ${v ? ee.uploading : ""} ${H ? ee.draggingOver : ""}`,
|
|
4785
4819
|
children: /* @__PURE__ */ w("div", { className: ee.content, children: [
|
|
4786
|
-
!m && /* @__PURE__ */ w(
|
|
4820
|
+
!m && /* @__PURE__ */ w(Je, { children: [
|
|
4787
4821
|
/* @__PURE__ */ a(
|
|
4788
4822
|
"input",
|
|
4789
4823
|
{
|
|
4790
4824
|
ref: G,
|
|
4791
4825
|
type: "file",
|
|
4792
4826
|
accept: d.join(","),
|
|
4793
|
-
multiple: !
|
|
4794
|
-
onChange:
|
|
4827
|
+
multiple: !p || p > 1,
|
|
4828
|
+
onChange: me,
|
|
4795
4829
|
className: ee.hiddenInput
|
|
4796
4830
|
}
|
|
4797
4831
|
),
|
|
@@ -4799,14 +4833,14 @@ const mo = "ImageUploader-module_container", po = "ImageUploader-module_active",
|
|
|
4799
4833
|
"div",
|
|
4800
4834
|
{
|
|
4801
4835
|
className: ee.clickArea,
|
|
4802
|
-
onClick:
|
|
4836
|
+
onClick: Ne,
|
|
4803
4837
|
onDragOver: P,
|
|
4804
4838
|
onDragLeave: T,
|
|
4805
4839
|
onDrop: Te,
|
|
4806
4840
|
role: "button",
|
|
4807
4841
|
tabIndex: 0,
|
|
4808
4842
|
onKeyDown: (f) => {
|
|
4809
|
-
(f.key === "Enter" || f.key === " ") &&
|
|
4843
|
+
(f.key === "Enter" || f.key === " ") && Ne();
|
|
4810
4844
|
},
|
|
4811
4845
|
"aria-label": E(
|
|
4812
4846
|
"Click to upload images or drag and drop",
|
|
@@ -4819,17 +4853,17 @@ const mo = "ImageUploader-module_container", po = "ImageUploader-module_active",
|
|
|
4819
4853
|
"a8c-agenttic"
|
|
4820
4854
|
) }),
|
|
4821
4855
|
/* @__PURE__ */ a("br", {}),
|
|
4822
|
-
u &&
|
|
4856
|
+
u && Ve
|
|
4823
4857
|
] }) }),
|
|
4824
4858
|
X && /* @__PURE__ */ w("div", { className: ee.preview, children: [
|
|
4825
|
-
|
|
4826
|
-
|
|
4859
|
+
Re && e.map((f) => /* @__PURE__ */ a(
|
|
4860
|
+
Eo,
|
|
4827
4861
|
{
|
|
4828
4862
|
image: f,
|
|
4829
4863
|
allowDragToInsert: j,
|
|
4830
4864
|
showFileMetadata: N,
|
|
4831
|
-
onDragStart:
|
|
4832
|
-
onDragEnd:
|
|
4865
|
+
onDragStart: Ee,
|
|
4866
|
+
onDragEnd: xe,
|
|
4833
4867
|
onRemove: le
|
|
4834
4868
|
},
|
|
4835
4869
|
f.id
|
|
@@ -4864,27 +4898,27 @@ const mo = "ImageUploader-module_container", po = "ImageUploader-module_active",
|
|
|
4864
4898
|
)
|
|
4865
4899
|
}
|
|
4866
4900
|
);
|
|
4867
|
-
}),
|
|
4868
|
-
container:
|
|
4869
|
-
line:
|
|
4870
|
-
message:
|
|
4901
|
+
}), Ro = "MessageDivider-module_container", Po = "MessageDivider-module_line", $o = "MessageDivider-module_message", ut = {
|
|
4902
|
+
container: Ro,
|
|
4903
|
+
line: Po,
|
|
4904
|
+
message: $o
|
|
4871
4905
|
};
|
|
4872
|
-
function
|
|
4906
|
+
function Cc({ message: t = "" }) {
|
|
4873
4907
|
return /* @__PURE__ */ w("div", { className: ut.container, children: [
|
|
4874
4908
|
/* @__PURE__ */ a("div", { className: ut.line }),
|
|
4875
|
-
t && /* @__PURE__ */ w(
|
|
4909
|
+
t && /* @__PURE__ */ w(Je, { children: [
|
|
4876
4910
|
/* @__PURE__ */ a("span", { className: ut.message, children: t }),
|
|
4877
4911
|
/* @__PURE__ */ a("div", { className: ut.line })
|
|
4878
4912
|
] })
|
|
4879
4913
|
] });
|
|
4880
4914
|
}
|
|
4881
|
-
const
|
|
4882
|
-
container:
|
|
4883
|
-
icon:
|
|
4884
|
-
heading:
|
|
4885
|
-
help:
|
|
4886
|
-
suggestionsWrapper:
|
|
4887
|
-
},
|
|
4915
|
+
const Fo = "EmptyView-module_container", jo = "EmptyView-module_icon", Uo = "EmptyView-module_heading", Bo = "EmptyView-module_help", Ho = "EmptyView-module_suggestionsWrapper", it = {
|
|
4916
|
+
container: Fo,
|
|
4917
|
+
icon: jo,
|
|
4918
|
+
heading: Uo,
|
|
4919
|
+
help: Bo,
|
|
4920
|
+
suggestionsWrapper: Ho
|
|
4921
|
+
}, _c = ({
|
|
4888
4922
|
suggestions: t,
|
|
4889
4923
|
onSuggestionClick: e,
|
|
4890
4924
|
icon: i = "✨",
|
|
@@ -4893,10 +4927,10 @@ const Po = "EmptyView-module_container", $o = "EmptyView-module_icon", Fo = "Emp
|
|
|
4893
4927
|
"a8c-agenttic"
|
|
4894
4928
|
),
|
|
4895
4929
|
help: o
|
|
4896
|
-
}) => /* @__PURE__ */ w("div", { className:
|
|
4897
|
-
/* @__PURE__ */ a("div", { className:
|
|
4898
|
-
/* @__PURE__ */ a("h2", { className:
|
|
4899
|
-
t && t.length > 0 && /* @__PURE__ */ a("div", { className:
|
|
4930
|
+
}) => /* @__PURE__ */ w("div", { className: it.container, children: [
|
|
4931
|
+
/* @__PURE__ */ a("div", { className: it.icon, children: i }),
|
|
4932
|
+
/* @__PURE__ */ a("h2", { className: it.heading, children: n }),
|
|
4933
|
+
t && t.length > 0 && /* @__PURE__ */ a("div", { className: it.suggestionsWrapper, children: /* @__PURE__ */ a(
|
|
4900
4934
|
vt,
|
|
4901
4935
|
{
|
|
4902
4936
|
suggestions: t,
|
|
@@ -4905,16 +4939,16 @@ const Po = "EmptyView-module_container", $o = "EmptyView-module_icon", Fo = "Emp
|
|
|
4905
4939
|
layout: "vertical"
|
|
4906
4940
|
}
|
|
4907
4941
|
) }),
|
|
4908
|
-
o && /* @__PURE__ */ a("p", { className:
|
|
4909
|
-
] }),
|
|
4910
|
-
container:
|
|
4911
|
-
imageButton:
|
|
4912
|
-
selected:
|
|
4913
|
-
disabled:
|
|
4914
|
-
image:
|
|
4915
|
-
header:
|
|
4942
|
+
o && /* @__PURE__ */ a("p", { className: it.help, children: o })
|
|
4943
|
+
] }), Vo = "ImageRenderer-module_container", Wo = "ImageRenderer-module_imageButton", zo = "ImageRenderer-module_selected", Go = "ImageRenderer-module_disabled", Zo = "ImageRenderer-module_image", Yo = "ImageRenderer-module_header", Ye = {
|
|
4944
|
+
container: Vo,
|
|
4945
|
+
imageButton: Wo,
|
|
4946
|
+
selected: zo,
|
|
4947
|
+
disabled: Go,
|
|
4948
|
+
image: Zo,
|
|
4949
|
+
header: Yo
|
|
4916
4950
|
};
|
|
4917
|
-
function
|
|
4951
|
+
function Ko({ className: t, size: e = 24 }) {
|
|
4918
4952
|
return /* @__PURE__ */ a(
|
|
4919
4953
|
"svg",
|
|
4920
4954
|
{
|
|
@@ -4935,7 +4969,7 @@ function Zo({ className: t, size: e = 24 }) {
|
|
|
4935
4969
|
}
|
|
4936
4970
|
);
|
|
4937
4971
|
}
|
|
4938
|
-
const
|
|
4972
|
+
const Tc = ({
|
|
4939
4973
|
images: t,
|
|
4940
4974
|
onSelect: e,
|
|
4941
4975
|
header: i,
|
|
@@ -4952,17 +4986,17 @@ const Cc = ({
|
|
|
4952
4986
|
};
|
|
4953
4987
|
return window.addEventListener("click", l, !0), () => window.removeEventListener("click", l, !0);
|
|
4954
4988
|
}, [e, n, o]), /* @__PURE__ */ w(se.div, { children: [
|
|
4955
|
-
i || /* @__PURE__ */ w("div", { className:
|
|
4956
|
-
/* @__PURE__ */ a(
|
|
4989
|
+
i || /* @__PURE__ */ w("div", { className: Ye.header, children: [
|
|
4990
|
+
/* @__PURE__ */ a(Ko, {}),
|
|
4957
4991
|
" Done"
|
|
4958
4992
|
] }),
|
|
4959
|
-
/* @__PURE__ */ a("div", { className:
|
|
4993
|
+
/* @__PURE__ */ a("div", { className: Ye.container, ref: r, children: t.map((l) => /* @__PURE__ */ a(
|
|
4960
4994
|
"button",
|
|
4961
4995
|
{
|
|
4962
|
-
className:
|
|
4963
|
-
|
|
4964
|
-
!n && o === l.url ?
|
|
4965
|
-
n ?
|
|
4996
|
+
className: ge(
|
|
4997
|
+
Ye.imageButton,
|
|
4998
|
+
!n && o === l.url ? Ye.selected : "",
|
|
4999
|
+
n ? Ye.disabled : ""
|
|
4966
5000
|
),
|
|
4967
5001
|
onClick: () => s(l),
|
|
4968
5002
|
disabled: n,
|
|
@@ -4972,7 +5006,7 @@ const Cc = ({
|
|
|
4972
5006
|
{
|
|
4973
5007
|
src: l.url,
|
|
4974
5008
|
alt: l.alt,
|
|
4975
|
-
className:
|
|
5009
|
+
className: Ye.image
|
|
4976
5010
|
}
|
|
4977
5011
|
)
|
|
4978
5012
|
},
|
|
@@ -4980,7 +5014,7 @@ const Cc = ({
|
|
|
4980
5014
|
)) })
|
|
4981
5015
|
] });
|
|
4982
5016
|
};
|
|
4983
|
-
function
|
|
5017
|
+
function Ic({ className: t, size: e = 24 }) {
|
|
4984
5018
|
return /* @__PURE__ */ a(
|
|
4985
5019
|
"svg",
|
|
4986
5020
|
{
|
|
@@ -5000,7 +5034,7 @@ function _c({ className: t, size: e = 24 }) {
|
|
|
5000
5034
|
}
|
|
5001
5035
|
);
|
|
5002
5036
|
}
|
|
5003
|
-
function
|
|
5037
|
+
function Sc({ className: t, size: e = 24 }) {
|
|
5004
5038
|
return /* @__PURE__ */ a(
|
|
5005
5039
|
"svg",
|
|
5006
5040
|
{
|
|
@@ -5021,7 +5055,7 @@ function Tc({ className: t, size: e = 24 }) {
|
|
|
5021
5055
|
}
|
|
5022
5056
|
);
|
|
5023
5057
|
}
|
|
5024
|
-
function
|
|
5058
|
+
function kc({ className: t, size: e = 24 }) {
|
|
5025
5059
|
return /* @__PURE__ */ a(
|
|
5026
5060
|
"svg",
|
|
5027
5061
|
{
|
|
@@ -5042,7 +5076,7 @@ function Ic({ className: t, size: e = 24 }) {
|
|
|
5042
5076
|
}
|
|
5043
5077
|
);
|
|
5044
5078
|
}
|
|
5045
|
-
function
|
|
5079
|
+
function Mc({ className: t, size: e = 24 }) {
|
|
5046
5080
|
return /* @__PURE__ */ a(
|
|
5047
5081
|
"svg",
|
|
5048
5082
|
{
|
|
@@ -5065,7 +5099,7 @@ function Sc({ className: t, size: e = 24 }) {
|
|
|
5065
5099
|
}
|
|
5066
5100
|
);
|
|
5067
5101
|
}
|
|
5068
|
-
function
|
|
5102
|
+
function Ac({ className: t, size: e = 24 }) {
|
|
5069
5103
|
return /* @__PURE__ */ a(
|
|
5070
5104
|
"svg",
|
|
5071
5105
|
{
|
|
@@ -5087,7 +5121,7 @@ function kc({ className: t, size: e = 24 }) {
|
|
|
5087
5121
|
}
|
|
5088
5122
|
);
|
|
5089
5123
|
}
|
|
5090
|
-
function
|
|
5124
|
+
function Oc({ className: t, size: e = 24 }) {
|
|
5091
5125
|
return /* @__PURE__ */ w(
|
|
5092
5126
|
"svg",
|
|
5093
5127
|
{
|
|
@@ -5118,7 +5152,7 @@ function Mc({ className: t, size: e = 24 }) {
|
|
|
5118
5152
|
}
|
|
5119
5153
|
);
|
|
5120
5154
|
}
|
|
5121
|
-
function
|
|
5155
|
+
function Lc({ className: t, size: e = 24 }) {
|
|
5122
5156
|
return /* @__PURE__ */ w(
|
|
5123
5157
|
"svg",
|
|
5124
5158
|
{
|
|
@@ -5148,7 +5182,7 @@ function Ac({ className: t, size: e = 24 }) {
|
|
|
5148
5182
|
}
|
|
5149
5183
|
);
|
|
5150
5184
|
}
|
|
5151
|
-
function
|
|
5185
|
+
function Nc({ className: t, size: e = 24 }) {
|
|
5152
5186
|
return /* @__PURE__ */ a(
|
|
5153
5187
|
"svg",
|
|
5154
5188
|
{
|
|
@@ -5169,7 +5203,7 @@ function Oc({ className: t, size: e = 24 }) {
|
|
|
5169
5203
|
}
|
|
5170
5204
|
);
|
|
5171
5205
|
}
|
|
5172
|
-
function
|
|
5206
|
+
function xc({ className: t, size: e = 24 }) {
|
|
5173
5207
|
return /* @__PURE__ */ w(
|
|
5174
5208
|
"svg",
|
|
5175
5209
|
{
|
|
@@ -5201,7 +5235,7 @@ function Lc({ className: t, size: e = 24 }) {
|
|
|
5201
5235
|
}
|
|
5202
5236
|
);
|
|
5203
5237
|
}
|
|
5204
|
-
function
|
|
5238
|
+
function Dc({ className: t, size: e = 24 }) {
|
|
5205
5239
|
return /* @__PURE__ */ a(
|
|
5206
5240
|
"svg",
|
|
5207
5241
|
{
|
|
@@ -5222,13 +5256,13 @@ function Nc({ className: t, size: e = 24 }) {
|
|
|
5222
5256
|
}
|
|
5223
5257
|
);
|
|
5224
5258
|
}
|
|
5225
|
-
const
|
|
5259
|
+
const Jo = (t, e = "") => {
|
|
5226
5260
|
try {
|
|
5227
5261
|
return getComputedStyle(document.documentElement).getPropertyValue(t).trim() || e;
|
|
5228
5262
|
} catch (i) {
|
|
5229
5263
|
return console.warn(`Failed to get CSS variable ${t}:`, i), e;
|
|
5230
5264
|
}
|
|
5231
|
-
},
|
|
5265
|
+
}, rt = ({ message: t, details: e }) => /* @__PURE__ */ w("div", { className: "chart-error", children: [
|
|
5232
5266
|
/* @__PURE__ */ a("strong", { children: "Chart Error:" }),
|
|
5233
5267
|
" ",
|
|
5234
5268
|
t,
|
|
@@ -5240,8 +5274,8 @@ const Yo = (t, e = "") => {
|
|
|
5240
5274
|
children: t,
|
|
5241
5275
|
error: e
|
|
5242
5276
|
}) => {
|
|
5243
|
-
const i =
|
|
5244
|
-
const o = [
|
|
5277
|
+
const i = ot(() => {
|
|
5278
|
+
const o = [Jo("--color-primary", "#4F46E5"), "#f0b849", "#00a32a", "#8c5e94"];
|
|
5245
5279
|
return {
|
|
5246
5280
|
...$n,
|
|
5247
5281
|
colors: o,
|
|
@@ -5259,7 +5293,7 @@ const Yo = (t, e = "") => {
|
|
|
5259
5293
|
legendGlyphSize: 12
|
|
5260
5294
|
};
|
|
5261
5295
|
}, []);
|
|
5262
|
-
return e ? /* @__PURE__ */ a(
|
|
5296
|
+
return e ? /* @__PURE__ */ a(rt, { message: e.message, details: e.details }) : /* @__PURE__ */ a("div", { className: "chart-block", children: /* @__PURE__ */ a("div", { className: "chart-container", children: /* @__PURE__ */ a(Fn, { theme: i, children: t }) }) });
|
|
5263
5297
|
}, Mt = (t = 80, e = 6, i = 25, n) => Math.max(t, (n ?? 5) * e + i), Zt = (t) => {
|
|
5264
5298
|
if (t instanceof Date)
|
|
5265
5299
|
return t;
|
|
@@ -5316,7 +5350,7 @@ const Yo = (t, e = "") => {
|
|
|
5316
5350
|
},
|
|
5317
5351
|
...t,
|
|
5318
5352
|
bottom: Mt(120)
|
|
5319
|
-
}),
|
|
5353
|
+
}), qo = (t) => {
|
|
5320
5354
|
const {
|
|
5321
5355
|
data: e,
|
|
5322
5356
|
currency: i,
|
|
@@ -5329,12 +5363,12 @@ const Yo = (t, e = "") => {
|
|
|
5329
5363
|
maxLabelLength: g = 15,
|
|
5330
5364
|
error: d,
|
|
5331
5365
|
...u
|
|
5332
|
-
} = t,
|
|
5366
|
+
} = t, p = (_, k) => !l || _.length <= k ? _ : _.substring(0, k - 3) + "...", M = () => {
|
|
5333
5367
|
if (s === "item-comparison" && e && e.length > 0) {
|
|
5334
5368
|
let _ = "";
|
|
5335
5369
|
return e.forEach((k) => {
|
|
5336
5370
|
k != null && k.data && k.data.forEach((D) => {
|
|
5337
|
-
const C = D.label || "", H =
|
|
5371
|
+
const C = D.label || "", H = p(C, g);
|
|
5338
5372
|
H.length > _.length && (_ = H);
|
|
5339
5373
|
});
|
|
5340
5374
|
}), Mt(80, 6, 25, _.length);
|
|
@@ -5351,7 +5385,7 @@ const Yo = (t, e = "") => {
|
|
|
5351
5385
|
axis: {
|
|
5352
5386
|
x: {
|
|
5353
5387
|
orientation: "bottom",
|
|
5354
|
-
tickFormat: (_) =>
|
|
5388
|
+
tickFormat: (_) => p(_, g),
|
|
5355
5389
|
tickLabelProps: {
|
|
5356
5390
|
fontSize: 11,
|
|
5357
5391
|
textAnchor: "end",
|
|
@@ -5369,7 +5403,7 @@ const Yo = (t, e = "") => {
|
|
|
5369
5403
|
dy: -15
|
|
5370
5404
|
}
|
|
5371
5405
|
}
|
|
5372
|
-
},
|
|
5406
|
+
}, h = {
|
|
5373
5407
|
data: e,
|
|
5374
5408
|
withTooltips: o,
|
|
5375
5409
|
renderTooltip: c,
|
|
@@ -5385,9 +5419,9 @@ const Yo = (t, e = "") => {
|
|
|
5385
5419
|
...i && { currency: i },
|
|
5386
5420
|
...u
|
|
5387
5421
|
};
|
|
5388
|
-
return /* @__PURE__ */ a(fn, { error: d, children: /* @__PURE__ */ a(jn, { ...
|
|
5422
|
+
return /* @__PURE__ */ a(fn, { error: d, children: /* @__PURE__ */ a(jn, { ...h }) });
|
|
5389
5423
|
};
|
|
5390
|
-
class
|
|
5424
|
+
class Xo extends Dn {
|
|
5391
5425
|
constructor(e) {
|
|
5392
5426
|
super(e), this.state = {
|
|
5393
5427
|
hasError: !1,
|
|
@@ -5424,7 +5458,7 @@ class Jo extends Dn {
|
|
|
5424
5458
|
if (this.state.hasError) {
|
|
5425
5459
|
const i = ((e = this.state.error) == null ? void 0 : e.message) || "An error occurred while rendering the chart";
|
|
5426
5460
|
return /* @__PURE__ */ a(
|
|
5427
|
-
|
|
5461
|
+
rt,
|
|
5428
5462
|
{
|
|
5429
5463
|
message: i,
|
|
5430
5464
|
details: [
|
|
@@ -5438,7 +5472,7 @@ class Jo extends Dn {
|
|
|
5438
5472
|
return this.props.children;
|
|
5439
5473
|
}
|
|
5440
5474
|
}
|
|
5441
|
-
const
|
|
5475
|
+
const Qo = (t) => {
|
|
5442
5476
|
const {
|
|
5443
5477
|
data: e,
|
|
5444
5478
|
currency: i,
|
|
@@ -5477,7 +5511,7 @@ const qo = (t) => {
|
|
|
5477
5511
|
...g
|
|
5478
5512
|
};
|
|
5479
5513
|
return /* @__PURE__ */ a(fn, { error: l, children: /* @__PURE__ */ a(Un, { ...u }) });
|
|
5480
|
-
},
|
|
5514
|
+
}, ec = ({
|
|
5481
5515
|
data: t,
|
|
5482
5516
|
className: e = "",
|
|
5483
5517
|
config: i
|
|
@@ -5485,9 +5519,9 @@ const qo = (t) => {
|
|
|
5485
5519
|
const [n, o] = Z(null), [c, r] = Z(
|
|
5486
5520
|
null
|
|
5487
5521
|
), [s, l] = Z(300), g = A(null), d = b(
|
|
5488
|
-
(
|
|
5522
|
+
(h) => {
|
|
5489
5523
|
var z;
|
|
5490
|
-
const { tooltipData: _ } =
|
|
5524
|
+
const { tooltipData: _ } = h, k = (z = _ == null ? void 0 : _.nearestDatum) == null ? void 0 : z.datum;
|
|
5491
5525
|
if (!k)
|
|
5492
5526
|
return null;
|
|
5493
5527
|
const D = (S) => {
|
|
@@ -5503,7 +5537,7 @@ const qo = (t) => {
|
|
|
5503
5537
|
const V = Math.floor(
|
|
5504
5538
|
((/* @__PURE__ */ new Date()).getTime() - S.getTime()) / (1e3 * 60 * 60 * 24)
|
|
5505
5539
|
);
|
|
5506
|
-
return V === 0 ? E("Today", "a8c-agenttic") : V === 1 ? E("Yesterday", "a8c-agenttic") : V < 7 ?
|
|
5540
|
+
return V === 0 ? E("Today", "a8c-agenttic") : V === 1 ? E("Yesterday", "a8c-agenttic") : V < 7 ? je(
|
|
5507
5541
|
/* translators: %d: number of days */
|
|
5508
5542
|
E("%d days ago", "a8c-agenttic"),
|
|
5509
5543
|
V
|
|
@@ -5575,8 +5609,8 @@ const qo = (t) => {
|
|
|
5575
5609
|
return;
|
|
5576
5610
|
}
|
|
5577
5611
|
try {
|
|
5578
|
-
const
|
|
5579
|
-
if (!
|
|
5612
|
+
const h = JSON.parse(t.trim());
|
|
5613
|
+
if (!h.chartType) {
|
|
5580
5614
|
o({
|
|
5581
5615
|
message: E(
|
|
5582
5616
|
"Chart data must include chartType",
|
|
@@ -5586,7 +5620,7 @@ const qo = (t) => {
|
|
|
5586
5620
|
});
|
|
5587
5621
|
return;
|
|
5588
5622
|
}
|
|
5589
|
-
if (!
|
|
5623
|
+
if (!h.data || !Array.isArray(h.data)) {
|
|
5590
5624
|
o({
|
|
5591
5625
|
message: E(
|
|
5592
5626
|
"Chart data must include a data array",
|
|
@@ -5596,7 +5630,7 @@ const qo = (t) => {
|
|
|
5596
5630
|
});
|
|
5597
5631
|
return;
|
|
5598
5632
|
}
|
|
5599
|
-
if (
|
|
5633
|
+
if (h.data.length === 0) {
|
|
5600
5634
|
o({
|
|
5601
5635
|
message: E(
|
|
5602
5636
|
"No data points found for chart",
|
|
@@ -5606,7 +5640,7 @@ const qo = (t) => {
|
|
|
5606
5640
|
});
|
|
5607
5641
|
return;
|
|
5608
5642
|
}
|
|
5609
|
-
const _ =
|
|
5643
|
+
const _ = h.data.map((D) => ({
|
|
5610
5644
|
...D,
|
|
5611
5645
|
data: D.data.map((C) => {
|
|
5612
5646
|
if (C.date) {
|
|
@@ -5630,11 +5664,11 @@ const qo = (t) => {
|
|
|
5630
5664
|
};
|
|
5631
5665
|
})
|
|
5632
5666
|
})), k = {
|
|
5633
|
-
chartType:
|
|
5634
|
-
title:
|
|
5667
|
+
chartType: h.chartType,
|
|
5668
|
+
title: h.title,
|
|
5635
5669
|
data: _,
|
|
5636
|
-
currency:
|
|
5637
|
-
mode:
|
|
5670
|
+
currency: h.currency,
|
|
5671
|
+
mode: h.mode || "time-comparison"
|
|
5638
5672
|
};
|
|
5639
5673
|
r(k);
|
|
5640
5674
|
} catch {
|
|
@@ -5647,9 +5681,9 @@ const qo = (t) => {
|
|
|
5647
5681
|
});
|
|
5648
5682
|
}
|
|
5649
5683
|
}, [t]);
|
|
5650
|
-
const u = b((
|
|
5651
|
-
if (g.current && g.current.disconnect(),
|
|
5652
|
-
const { width: _ } =
|
|
5684
|
+
const u = b((h) => {
|
|
5685
|
+
if (g.current && g.current.disconnect(), h) {
|
|
5686
|
+
const { width: _ } = h.getBoundingClientRect(), k = Math.max(280, _ - 4);
|
|
5653
5687
|
l(k), g.current = new ResizeObserver((D) => {
|
|
5654
5688
|
for (const C of D) {
|
|
5655
5689
|
const H = C.contentRect.width, Y = Math.max(
|
|
@@ -5658,16 +5692,16 @@ const qo = (t) => {
|
|
|
5658
5692
|
);
|
|
5659
5693
|
l(Y);
|
|
5660
5694
|
}
|
|
5661
|
-
}), g.current.observe(
|
|
5695
|
+
}), g.current.observe(h);
|
|
5662
5696
|
}
|
|
5663
5697
|
}, []);
|
|
5664
5698
|
if (O(() => () => {
|
|
5665
5699
|
g.current && (g.current.disconnect(), g.current = null);
|
|
5666
5700
|
}, []), n)
|
|
5667
|
-
return /* @__PURE__ */ a(
|
|
5701
|
+
return /* @__PURE__ */ a(rt, { message: n.message, details: n.details });
|
|
5668
5702
|
if (!c)
|
|
5669
5703
|
return /* @__PURE__ */ a(
|
|
5670
|
-
|
|
5704
|
+
rt,
|
|
5671
5705
|
{
|
|
5672
5706
|
message: E("No chart data available", "a8c-agenttic")
|
|
5673
5707
|
}
|
|
@@ -5685,10 +5719,10 @@ const qo = (t) => {
|
|
|
5685
5719
|
}, j = () => {
|
|
5686
5720
|
switch (c.chartType) {
|
|
5687
5721
|
case "line":
|
|
5688
|
-
return /* @__PURE__ */ a(
|
|
5722
|
+
return /* @__PURE__ */ a(Qo, { ...N });
|
|
5689
5723
|
case "bar":
|
|
5690
5724
|
return /* @__PURE__ */ a(
|
|
5691
|
-
|
|
5725
|
+
qo,
|
|
5692
5726
|
{
|
|
5693
5727
|
...N,
|
|
5694
5728
|
mode: c.mode
|
|
@@ -5696,9 +5730,9 @@ const qo = (t) => {
|
|
|
5696
5730
|
);
|
|
5697
5731
|
default:
|
|
5698
5732
|
return /* @__PURE__ */ a(
|
|
5699
|
-
|
|
5733
|
+
rt,
|
|
5700
5734
|
{
|
|
5701
|
-
message:
|
|
5735
|
+
message: je(
|
|
5702
5736
|
/* translators: %s: chart type name */
|
|
5703
5737
|
E("Unsupported chart type: %s", "a8c-agenttic"),
|
|
5704
5738
|
c.chartType
|
|
@@ -5707,7 +5741,7 @@ const qo = (t) => {
|
|
|
5707
5741
|
);
|
|
5708
5742
|
}
|
|
5709
5743
|
};
|
|
5710
|
-
return /* @__PURE__ */ a(
|
|
5744
|
+
return /* @__PURE__ */ a(Xo, { chartData: t, children: /* @__PURE__ */ w(
|
|
5711
5745
|
"div",
|
|
5712
5746
|
{
|
|
5713
5747
|
ref: u,
|
|
@@ -5719,7 +5753,7 @@ const qo = (t) => {
|
|
|
5719
5753
|
}
|
|
5720
5754
|
) });
|
|
5721
5755
|
};
|
|
5722
|
-
function
|
|
5756
|
+
function tc(t) {
|
|
5723
5757
|
return function(i) {
|
|
5724
5758
|
const { children: n, className: o, ...c } = i;
|
|
5725
5759
|
if (!(o == null ? void 0 : o.includes("language-chart")))
|
|
@@ -5729,26 +5763,26 @@ function Qo(t) {
|
|
|
5729
5763
|
n
|
|
5730
5764
|
);
|
|
5731
5765
|
const s = typeof n == "string" ? n : "";
|
|
5732
|
-
return ae.createElement(
|
|
5766
|
+
return ae.createElement(ec, {
|
|
5733
5767
|
data: s,
|
|
5734
5768
|
className: "markdown-chart",
|
|
5735
5769
|
config: t
|
|
5736
5770
|
});
|
|
5737
5771
|
};
|
|
5738
5772
|
}
|
|
5739
|
-
function
|
|
5773
|
+
function ac(t) {
|
|
5740
5774
|
var n, o;
|
|
5741
5775
|
const e = {}, i = [];
|
|
5742
|
-
return (n = t == null ? void 0 : t.charts) != null && n.enabled && (e.code =
|
|
5776
|
+
return (n = t == null ? void 0 : t.charts) != null && n.enabled && (e.code = tc(t.charts.config)), (o = t == null ? void 0 : t.gfm) != null && o.enabled && i.push(Pn), { components: e, remarkPlugins: i };
|
|
5743
5777
|
}
|
|
5744
|
-
function
|
|
5778
|
+
function nc(t, e = {}) {
|
|
5745
5779
|
return {
|
|
5746
5780
|
...t,
|
|
5747
5781
|
...e
|
|
5748
5782
|
};
|
|
5749
5783
|
}
|
|
5750
5784
|
let gt = null, mt = null;
|
|
5751
|
-
async function
|
|
5785
|
+
async function ic() {
|
|
5752
5786
|
return gt || mt || (mt = Promise.all([
|
|
5753
5787
|
import("./parseIncompleteMarkdown-Di9Hun9H.js"),
|
|
5754
5788
|
import("./parseBlocks-CiOUXvxi.js")
|
|
@@ -5757,21 +5791,21 @@ async function ac() {
|
|
|
5757
5791
|
parseMarkdownIntoBlocks: e.parseMarkdownIntoBlocks
|
|
5758
5792
|
}, gt)), mt);
|
|
5759
5793
|
}
|
|
5760
|
-
function
|
|
5794
|
+
function Ec(t = {}) {
|
|
5761
5795
|
const {
|
|
5762
5796
|
components: e = {},
|
|
5763
5797
|
extensions: i = {},
|
|
5764
5798
|
remarkPlugins: n = [],
|
|
5765
5799
|
enableStreaming: o = !1
|
|
5766
|
-
} = t, c =
|
|
5800
|
+
} = t, c = ac(i), r = nc(
|
|
5767
5801
|
c.components,
|
|
5768
5802
|
e
|
|
5769
5803
|
), s = [...c.remarkPlugins, ...n];
|
|
5770
5804
|
return function({ children: g }) {
|
|
5771
5805
|
const [d, u] = ae.useState(g);
|
|
5772
5806
|
return ae.useEffect(() => {
|
|
5773
|
-
o ?
|
|
5774
|
-
const x = (await
|
|
5807
|
+
o ? ic().then(async (p) => {
|
|
5808
|
+
const x = (await p.parseMarkdownIntoBlocks(g)).map((N) => p.parseIncompleteMarkdown(
|
|
5775
5809
|
N.trim()
|
|
5776
5810
|
)).join(`
|
|
5777
5811
|
|
|
@@ -5790,7 +5824,7 @@ function xc(t = {}) {
|
|
|
5790
5824
|
);
|
|
5791
5825
|
};
|
|
5792
5826
|
}
|
|
5793
|
-
const
|
|
5827
|
+
const Rc = (t) => {
|
|
5794
5828
|
const e = t.condition || (() => !0), i = {}, n = [], o = () => {
|
|
5795
5829
|
n.forEach((r) => r());
|
|
5796
5830
|
}, c = async (r, s) => {
|
|
@@ -5843,64 +5877,64 @@ const Dc = (t) => {
|
|
|
5843
5877
|
};
|
|
5844
5878
|
};
|
|
5845
5879
|
export {
|
|
5846
|
-
|
|
5880
|
+
yc as AgentUI,
|
|
5847
5881
|
on as AgentUIContainer,
|
|
5848
5882
|
xt as AgentUIConversationView,
|
|
5849
5883
|
hn as AgentUIFooter,
|
|
5850
5884
|
St as AgentUIHeader,
|
|
5851
5885
|
un as AgentUIInput,
|
|
5852
|
-
|
|
5886
|
+
go as AgentUIInputToolbar,
|
|
5853
5887
|
dn as AgentUIMessages,
|
|
5854
5888
|
pn as AgentUINotice,
|
|
5855
5889
|
Vt as AgentUIProvider,
|
|
5856
5890
|
gn as AgentUISuggestions,
|
|
5857
|
-
|
|
5891
|
+
xc as AltIcon,
|
|
5858
5892
|
Ji as AnimatedPlaceholder,
|
|
5859
5893
|
Bi as ArrowUpIcon,
|
|
5860
|
-
|
|
5861
|
-
|
|
5894
|
+
Ar as AssistantAvatarIcon,
|
|
5895
|
+
qo as BarChart,
|
|
5862
5896
|
Lt as BigSkyIcon,
|
|
5863
|
-
|
|
5864
|
-
|
|
5865
|
-
|
|
5866
|
-
|
|
5897
|
+
Dc as BlurIcon,
|
|
5898
|
+
ec as ChartBlock,
|
|
5899
|
+
bc as Chat,
|
|
5900
|
+
po as ChatFooter,
|
|
5867
5901
|
sn as ChatHeader,
|
|
5868
5902
|
Nt as ChatInput,
|
|
5869
5903
|
an as ChevronUpIcon,
|
|
5870
5904
|
en as CollapsedView,
|
|
5871
5905
|
nn as CompactView,
|
|
5872
5906
|
Gt as ConversationView,
|
|
5873
|
-
|
|
5874
|
-
|
|
5875
|
-
|
|
5876
|
-
|
|
5877
|
-
|
|
5878
|
-
|
|
5907
|
+
kc as CopyIcon,
|
|
5908
|
+
_c as EmptyView,
|
|
5909
|
+
Tc as ImageRenderer,
|
|
5910
|
+
wc as ImageUploader,
|
|
5911
|
+
Qo as LineChart,
|
|
5912
|
+
$r as Message,
|
|
5879
5913
|
zt as MessageActions,
|
|
5880
|
-
|
|
5914
|
+
Cc as MessageDivider,
|
|
5881
5915
|
ln as Messages,
|
|
5882
5916
|
rn as MinimizedView,
|
|
5883
5917
|
mn as Notice,
|
|
5884
|
-
|
|
5885
|
-
|
|
5886
|
-
|
|
5887
|
-
|
|
5918
|
+
zr as PlusIcon,
|
|
5919
|
+
Fc as QuestionCard,
|
|
5920
|
+
Nc as RegenerateAltIcon,
|
|
5921
|
+
Lc as RegenerateIcon,
|
|
5888
5922
|
Hi as StopIcon,
|
|
5889
|
-
|
|
5923
|
+
Mc as StylesIcon,
|
|
5890
5924
|
vt as Suggestions,
|
|
5891
|
-
|
|
5892
|
-
|
|
5893
|
-
|
|
5925
|
+
Vr as ThinkingMessage,
|
|
5926
|
+
Sc as ThumbsDownIcon,
|
|
5927
|
+
Ic as ThumbsUpIcon,
|
|
5894
5928
|
cn as XIcon,
|
|
5895
|
-
|
|
5896
|
-
|
|
5897
|
-
|
|
5898
|
-
|
|
5899
|
-
|
|
5900
|
-
|
|
5901
|
-
|
|
5929
|
+
Ac as ZoomIcon,
|
|
5930
|
+
Oc as ZoomIconFilled,
|
|
5931
|
+
vc as animations,
|
|
5932
|
+
ge as cn,
|
|
5933
|
+
Rc as createFeedbackActions,
|
|
5934
|
+
Ec as createMessageRenderer,
|
|
5935
|
+
yc as default,
|
|
5902
5936
|
_i as loadAgentticTranslations,
|
|
5903
|
-
|
|
5937
|
+
Le as useAgentUIContext,
|
|
5904
5938
|
Za as useChat,
|
|
5905
5939
|
Ya as useInput
|
|
5906
5940
|
};
|