@useago/sdk 1.5.0 → 1.5.3
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/CHANGELOG.md +48 -0
- package/dist/AgoClient-BGkFSNZF.cjs +8 -0
- package/dist/AgoClient-CW-BLT1_.js +1542 -0
- package/dist/angular.cjs +1 -1
- package/dist/angular.d.cts +390 -2
- package/dist/angular.d.ts +390 -2
- package/dist/angular.js +1 -1
- package/dist/createConversationSession-BCb0D6bt.cjs +1 -0
- package/dist/{createConversationSession-DCSWShaW.js → createConversationSession-C7cnnWKW.js} +3 -3
- package/dist/createFormCollector-iCDwAwYJ.js +279 -0
- package/dist/createFormCollector-t_fGyuTD.cjs +1 -0
- package/dist/createMockClient-Br0TWgLO.js +97 -0
- package/dist/createMockClient-BwNLPjeT.cjs +1 -0
- package/dist/devtools.d.cts +390 -2
- package/dist/devtools.d.ts +390 -2
- package/dist/helpers.d.cts +5 -0
- package/dist/helpers.d.ts +5 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +605 -4
- package/dist/index.d.ts +605 -4
- package/dist/index.js +95 -90
- package/dist/react.cjs +3 -3
- package/dist/react.d.cts +561 -4
- package/dist/react.d.ts +561 -4
- package/dist/react.js +849 -517
- package/dist/testing.cjs +1 -1
- package/dist/testing.d.cts +390 -2
- package/dist/testing.d.ts +390 -2
- package/dist/testing.js +1 -1
- package/dist/vue.cjs +1 -1
- package/dist/vue.d.cts +411 -2
- package/dist/vue.d.ts +411 -2
- package/dist/vue.js +133 -110
- package/dist/widget.cjs +4 -4
- package/dist/widget.d.cts +387 -2
- package/dist/widget.d.ts +387 -2
- package/dist/widget.js +437 -423
- package/llms-full.txt +74 -2
- package/package.json +1 -1
- package/dist/AgoClient-q39FIjSC.js +0 -912
- package/dist/AgoClient-wcPRaIMs.cjs +0 -8
- package/dist/createConversationSession-BBYfQLLS.cjs +0 -1
- package/dist/createFormCollector-eimwwWEi.cjs +0 -1
- package/dist/createFormCollector-sB6rMccD.js +0 -299
- package/dist/createMockClient-BUc9PSbo.js +0 -79
- package/dist/createMockClient-CjdCqixj.cjs +0 -1
package/dist/react.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { a as q, i as
|
|
2
|
-
import { t as
|
|
3
|
-
import {
|
|
4
|
-
import { t as
|
|
5
|
-
import
|
|
6
|
-
import { Fragment as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
function
|
|
10
|
-
const [
|
|
11
|
-
if (
|
|
12
|
-
const
|
|
13
|
-
return
|
|
1
|
+
import { a as Y, b as q, h as X, i as Z, o as Q, s as ee, t as te } from "./AgoClient-CW-BLT1_.js";
|
|
2
|
+
import { t as ne } from "./autoContinue-D3Mmaaca.js";
|
|
3
|
+
import { n as He, r as j, t as B } from "./createFormCollector-iCDwAwYJ.js";
|
|
4
|
+
import { t as qe } from "./createMockClient-Br0TWgLO.js";
|
|
5
|
+
import re, { createContext as oe, useCallback as R, useContext as G, useEffect as A, useId as ae, useMemo as W, useRef as _, useState as E, useSyncExternalStore as se } from "react";
|
|
6
|
+
import { Fragment as U, jsx as l, jsxs as M } from "react/jsx-runtime";
|
|
7
|
+
import ie from "react-markdown";
|
|
8
|
+
import le from "remark-gfm";
|
|
9
|
+
function ce(e) {
|
|
10
|
+
const [r, t] = E(!1), o = _(null), n = W(() => {
|
|
11
|
+
if (o.current && (o.current.destroy(), o.current = null), !e) return null;
|
|
12
|
+
const s = new te(e);
|
|
13
|
+
return o.current = s, s;
|
|
14
14
|
}, [e?.baseUrl, e?.widgetId]);
|
|
15
|
-
return
|
|
16
|
-
|
|
17
|
-
}), [
|
|
18
|
-
|
|
15
|
+
return A(() => (n && o.current === null && (o.current = n, n.reviveAfterDestroy()), t(!0), () => {
|
|
16
|
+
o.current?.destroy(), o.current = null;
|
|
17
|
+
}), [n]), A(() => {
|
|
18
|
+
o.current && e && o.current.updateConfig({
|
|
19
19
|
agent: e.agent,
|
|
20
20
|
defaultAgentId: e.defaultAgentId,
|
|
21
21
|
permission: e.permission,
|
|
@@ -33,137 +33,137 @@ function ae(e) {
|
|
|
33
33
|
e?.debug,
|
|
34
34
|
e?.warnOnEmptyReply
|
|
35
35
|
]), {
|
|
36
|
-
client:
|
|
37
|
-
isReady:
|
|
36
|
+
client: n,
|
|
37
|
+
isReady: r
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
|
-
var L =
|
|
41
|
-
const { client: c } =
|
|
42
|
-
return
|
|
43
|
-
if (!(!
|
|
44
|
-
for (const f of
|
|
40
|
+
var L = oe(null), Ke = ({ children: e, client: r, tools: t, helpers: o, pageContext: n, ...s }) => {
|
|
41
|
+
const { client: c } = ce(r ? null : s), a = r || c;
|
|
42
|
+
return A(() => {
|
|
43
|
+
if (!(!t || t.length === 0)) {
|
|
44
|
+
for (const f of t) a.register(f);
|
|
45
45
|
return () => {
|
|
46
|
-
for (const f of
|
|
46
|
+
for (const f of t) a.unregisterFunction(f.name);
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
|
-
}, [
|
|
50
|
-
if (!
|
|
49
|
+
}, [a, t]), A(() => {
|
|
50
|
+
if (!o) return;
|
|
51
51
|
const f = [];
|
|
52
|
-
return import("./functions-CApuQZ2b.js").then((
|
|
53
|
-
for (const [
|
|
54
|
-
const
|
|
55
|
-
if (!
|
|
56
|
-
console.warn(`[AGO] Unknown helper: "${
|
|
52
|
+
return import("./functions-CApuQZ2b.js").then((d) => d.n).then((d) => {
|
|
53
|
+
for (const [g, C] of Object.entries(o)) {
|
|
54
|
+
const N = d[g];
|
|
55
|
+
if (!N) {
|
|
56
|
+
console.warn(`[AGO] Unknown helper: "${g}"`);
|
|
57
57
|
continue;
|
|
58
58
|
}
|
|
59
|
-
const
|
|
60
|
-
...
|
|
61
|
-
handler:
|
|
59
|
+
const S = C === !0 ? N : {
|
|
60
|
+
...N,
|
|
61
|
+
handler: C
|
|
62
62
|
};
|
|
63
|
-
|
|
63
|
+
a.register(S), f.push(S.name);
|
|
64
64
|
}
|
|
65
65
|
}), () => {
|
|
66
|
-
for (const
|
|
66
|
+
for (const d of f) a.unregisterFunction(d);
|
|
67
67
|
};
|
|
68
|
-
}, [
|
|
69
|
-
|
|
70
|
-
}, [
|
|
71
|
-
value:
|
|
68
|
+
}, [a, o]), A(() => {
|
|
69
|
+
n === "auto" && a.enableAutoPageContext();
|
|
70
|
+
}, [a, n]), /* @__PURE__ */ l(L.Provider, {
|
|
71
|
+
value: a,
|
|
72
72
|
children: e
|
|
73
73
|
});
|
|
74
74
|
};
|
|
75
|
-
function
|
|
76
|
-
const e =
|
|
75
|
+
function D() {
|
|
76
|
+
const e = G(L);
|
|
77
77
|
if (!e) throw new Error('useAgoClient must be used within an <AgoProvider>. Wrap your component tree with <AgoProvider baseUrl="...">.');
|
|
78
78
|
return e;
|
|
79
79
|
}
|
|
80
80
|
function z() {
|
|
81
|
-
return
|
|
81
|
+
return G(L);
|
|
82
82
|
}
|
|
83
|
-
function
|
|
84
|
-
const
|
|
85
|
-
if (!
|
|
86
|
-
const [
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}, [
|
|
90
|
-
const
|
|
83
|
+
function K({ client: e, conversationId: r } = {}) {
|
|
84
|
+
const t = z(), o = e || t;
|
|
85
|
+
if (!o) throw new Error("useMessages requires an AgoClient. Either pass it as options.client or wrap your app in <AgoProvider>.");
|
|
86
|
+
const [n, s] = E([]), [c, a] = E(r), [f, d] = E(!1), [g, C] = E(null);
|
|
87
|
+
A(() => {
|
|
88
|
+
r && r !== c && (a(r), N(r));
|
|
89
|
+
}, [r]);
|
|
90
|
+
const N = async (S) => {
|
|
91
91
|
try {
|
|
92
|
-
|
|
93
|
-
} catch (
|
|
94
|
-
|
|
92
|
+
s((await o.getMessages(S)).filter((k) => !k.hidden));
|
|
93
|
+
} catch (k) {
|
|
94
|
+
C(k instanceof Error ? k : /* @__PURE__ */ new Error("Failed to load messages"));
|
|
95
95
|
}
|
|
96
96
|
};
|
|
97
|
-
return
|
|
98
|
-
const
|
|
99
|
-
c ||
|
|
100
|
-
const
|
|
101
|
-
return
|
|
102
|
-
...
|
|
97
|
+
return A(() => {
|
|
98
|
+
const S = (u) => u === "IN_PROGRESS" || u === "WAITING_CLIENT", k = (u) => {
|
|
99
|
+
c || a(u.conversationId), d(!0), s((h) => {
|
|
100
|
+
const w = h.findIndex((b) => b.id === u.messageId);
|
|
101
|
+
return w >= 0 ? h.map((b, T) => T === w ? {
|
|
102
|
+
...b,
|
|
103
103
|
status: "IN_PROGRESS"
|
|
104
|
-
} :
|
|
105
|
-
id:
|
|
106
|
-
conversationId:
|
|
104
|
+
} : b) : h.some((b) => b.role === "assistant" && S(b.status)) ? h : [...h, {
|
|
105
|
+
id: u.messageId,
|
|
106
|
+
conversationId: u.conversationId,
|
|
107
107
|
content: "",
|
|
108
108
|
role: "assistant",
|
|
109
109
|
status: "IN_PROGRESS",
|
|
110
110
|
createdAt: /* @__PURE__ */ new Date()
|
|
111
111
|
}];
|
|
112
112
|
});
|
|
113
|
-
},
|
|
114
|
-
|
|
115
|
-
const
|
|
116
|
-
return
|
|
117
|
-
...
|
|
118
|
-
content:
|
|
119
|
-
} :
|
|
113
|
+
}, p = (u) => {
|
|
114
|
+
s((h) => {
|
|
115
|
+
const w = h.findIndex((b) => b.id === u.messageId);
|
|
116
|
+
return w < 0 ? h : h.map((b, T) => T === w ? {
|
|
117
|
+
...b,
|
|
118
|
+
content: b.content + u.content
|
|
119
|
+
} : b);
|
|
120
120
|
});
|
|
121
|
-
},
|
|
122
|
-
|
|
123
|
-
let
|
|
124
|
-
for (let
|
|
125
|
-
|
|
121
|
+
}, x = (u) => {
|
|
122
|
+
s((h) => {
|
|
123
|
+
let w = -1;
|
|
124
|
+
for (let b = h.length - 1; b >= 0; b--) if (h[b].role === "assistant" && S(h[b].status)) {
|
|
125
|
+
w = b;
|
|
126
126
|
break;
|
|
127
127
|
}
|
|
128
|
-
return
|
|
129
|
-
...
|
|
128
|
+
return w < 0 ? h : [
|
|
129
|
+
...h.slice(0, w),
|
|
130
130
|
{
|
|
131
|
-
...
|
|
132
|
-
...
|
|
131
|
+
...h[w],
|
|
132
|
+
...u
|
|
133
133
|
},
|
|
134
|
-
...
|
|
134
|
+
...h.slice(w + 1)
|
|
135
135
|
];
|
|
136
136
|
});
|
|
137
|
-
},
|
|
138
|
-
|
|
139
|
-
const
|
|
140
|
-
return
|
|
141
|
-
...
|
|
142
|
-
|
|
143
|
-
...
|
|
144
|
-
] : [...
|
|
145
|
-
}),
|
|
146
|
-
},
|
|
147
|
-
|
|
137
|
+
}, i = (u) => {
|
|
138
|
+
s((h) => {
|
|
139
|
+
const w = h.findIndex((b) => b.id === u.id);
|
|
140
|
+
return w >= 0 ? [
|
|
141
|
+
...h.slice(0, w),
|
|
142
|
+
u,
|
|
143
|
+
...h.slice(w + 1)
|
|
144
|
+
] : [...h, u];
|
|
145
|
+
}), d(!1);
|
|
146
|
+
}, v = (u) => {
|
|
147
|
+
C(new Error(u.error)), d(!1);
|
|
148
148
|
};
|
|
149
|
-
return
|
|
150
|
-
|
|
149
|
+
return o.on("message:start", k), o.on("message:chunk", p), o.on("message:answer-complete", x), o.on("message:complete", i), o.on("message:error", v), () => {
|
|
150
|
+
o.off("message:start", k), o.off("message:chunk", p), o.off("message:answer-complete", x), o.off("message:complete", i), o.off("message:error", v);
|
|
151
151
|
};
|
|
152
|
-
}, [
|
|
153
|
-
messages:
|
|
152
|
+
}, [o, c]), {
|
|
153
|
+
messages: n,
|
|
154
154
|
isLoading: f,
|
|
155
|
-
error:
|
|
156
|
-
sendMessage:
|
|
157
|
-
|
|
158
|
-
const
|
|
155
|
+
error: g,
|
|
156
|
+
sendMessage: R(async (S, k) => {
|
|
157
|
+
d(!0), C(null);
|
|
158
|
+
const p = {
|
|
159
159
|
id: `temp-${Date.now()}`,
|
|
160
160
|
conversationId: c || "",
|
|
161
|
-
content:
|
|
161
|
+
content: S,
|
|
162
162
|
role: "user",
|
|
163
163
|
status: "DONE",
|
|
164
|
-
attachments:
|
|
164
|
+
attachments: k && k.length > 0 ? Z(k) : void 0,
|
|
165
165
|
createdAt: /* @__PURE__ */ new Date()
|
|
166
|
-
},
|
|
166
|
+
}, x = {
|
|
167
167
|
id: `temp-assistant-${Date.now()}`,
|
|
168
168
|
conversationId: c || "",
|
|
169
169
|
content: "",
|
|
@@ -171,62 +171,62 @@ function G({ client: e, conversationId: t } = {}) {
|
|
|
171
171
|
status: "IN_PROGRESS",
|
|
172
172
|
createdAt: /* @__PURE__ */ new Date()
|
|
173
173
|
};
|
|
174
|
-
|
|
175
|
-
...
|
|
176
|
-
|
|
177
|
-
|
|
174
|
+
s((i) => [
|
|
175
|
+
...i,
|
|
176
|
+
p,
|
|
177
|
+
x
|
|
178
178
|
]);
|
|
179
179
|
try {
|
|
180
|
-
const
|
|
180
|
+
const i = await o.sendMessage(S, {
|
|
181
181
|
conversationId: c,
|
|
182
|
-
files:
|
|
182
|
+
files: k
|
|
183
183
|
});
|
|
184
|
-
return
|
|
185
|
-
const
|
|
186
|
-
...
|
|
187
|
-
id:
|
|
188
|
-
conversationId:
|
|
184
|
+
return i.conversationId && !c && a(i.conversationId), s((v) => {
|
|
185
|
+
const u = v.filter((w) => !w.id.startsWith("temp-")), h = {
|
|
186
|
+
...p,
|
|
187
|
+
id: p.id.replace("temp-", "user-"),
|
|
188
|
+
conversationId: i.conversationId
|
|
189
189
|
};
|
|
190
|
-
return
|
|
191
|
-
...
|
|
192
|
-
|
|
193
|
-
|
|
190
|
+
return u.some((w) => w.id === i.id) ? [...u, h].sort((w, b) => new Date(w.createdAt).getTime() - new Date(b.createdAt).getTime()) : [
|
|
191
|
+
...u,
|
|
192
|
+
h,
|
|
193
|
+
i
|
|
194
194
|
];
|
|
195
|
-
}),
|
|
196
|
-
} catch (
|
|
197
|
-
return
|
|
195
|
+
}), i;
|
|
196
|
+
} catch (i) {
|
|
197
|
+
return C(i instanceof Error ? i : /* @__PURE__ */ new Error("Failed to send message")), d(!1), s((v) => v.filter((u) => !u.id.startsWith("temp-"))), null;
|
|
198
198
|
}
|
|
199
|
-
}, [
|
|
200
|
-
clearMessages:
|
|
201
|
-
|
|
199
|
+
}, [o, c]),
|
|
200
|
+
clearMessages: R(() => {
|
|
201
|
+
s([]), a(void 0), C(null);
|
|
202
202
|
}, []),
|
|
203
203
|
conversationId: c
|
|
204
204
|
};
|
|
205
205
|
}
|
|
206
|
-
var
|
|
207
|
-
const [
|
|
208
|
-
const
|
|
209
|
-
if (!
|
|
210
|
-
const
|
|
211
|
-
|
|
212
|
-
}, []),
|
|
213
|
-
|
|
206
|
+
var de = ({ onSend: e, disabled: r = !1, placeholder: t = "Type a message...", allowFiles: o = !1, className: n = "" }) => {
|
|
207
|
+
const [s, c] = E(""), [a, f] = E([]), d = _(null), g = _(null), C = R(() => {
|
|
208
|
+
const i = g.current;
|
|
209
|
+
if (!i) return;
|
|
210
|
+
const v = 110;
|
|
211
|
+
i.style.height = "auto", i.style.height = `${Math.min(i.scrollHeight + 2, v)}px`, i.style.overflowY = i.scrollHeight + 2 > v ? "auto" : "hidden";
|
|
212
|
+
}, []), N = R((i) => {
|
|
213
|
+
i.preventDefault(), (s.trim() || a.length > 0) && (e(s.trim(), a.length > 0 ? a : void 0), c(""), f([]), requestAnimationFrame(C));
|
|
214
214
|
}, [
|
|
215
|
-
|
|
216
|
-
|
|
215
|
+
s,
|
|
216
|
+
a,
|
|
217
217
|
e,
|
|
218
|
-
|
|
219
|
-
]),
|
|
220
|
-
|
|
221
|
-
}, [
|
|
222
|
-
const
|
|
223
|
-
f((
|
|
224
|
-
}, []),
|
|
225
|
-
f((
|
|
226
|
-
}, []),
|
|
227
|
-
return /* @__PURE__ */
|
|
228
|
-
onSubmit:
|
|
229
|
-
className: `ago-chat-input ${
|
|
218
|
+
C
|
|
219
|
+
]), S = R((i) => {
|
|
220
|
+
i.key === "Enter" && !i.shiftKey && (i.preventDefault(), N(i));
|
|
221
|
+
}, [N]), k = R((i) => {
|
|
222
|
+
const v = Array.from(i.target.files || []);
|
|
223
|
+
f((u) => [...u, ...v]);
|
|
224
|
+
}, []), p = R((i) => {
|
|
225
|
+
f((v) => v.filter((u, h) => h !== i));
|
|
226
|
+
}, []), x = s.trim() || a.length > 0;
|
|
227
|
+
return /* @__PURE__ */ M("form", {
|
|
228
|
+
onSubmit: N,
|
|
229
|
+
className: `ago-chat-input ${n}`,
|
|
230
230
|
style: {
|
|
231
231
|
display: "flex",
|
|
232
232
|
flexDirection: "column",
|
|
@@ -235,14 +235,14 @@ var se = ({ onSend: e, disabled: t = !1, placeholder: r = "Type a message...", a
|
|
|
235
235
|
borderTop: "1px solid #dee3e8",
|
|
236
236
|
backgroundColor: "#fff"
|
|
237
237
|
},
|
|
238
|
-
children: [
|
|
238
|
+
children: [a.length > 0 && /* @__PURE__ */ l("div", {
|
|
239
239
|
className: "ago-chat-input__files",
|
|
240
240
|
style: {
|
|
241
241
|
display: "flex",
|
|
242
242
|
flexWrap: "wrap",
|
|
243
243
|
gap: "6px"
|
|
244
244
|
},
|
|
245
|
-
children:
|
|
245
|
+
children: a.map((i, v) => /* @__PURE__ */ M("div", {
|
|
246
246
|
style: {
|
|
247
247
|
display: "flex",
|
|
248
248
|
alignItems: "center",
|
|
@@ -253,18 +253,18 @@ var se = ({ onSend: e, disabled: t = !1, placeholder: r = "Type a message...", a
|
|
|
253
253
|
fontSize: "12px",
|
|
254
254
|
color: "#30373e"
|
|
255
255
|
},
|
|
256
|
-
children: [/* @__PURE__ */
|
|
256
|
+
children: [/* @__PURE__ */ l("span", {
|
|
257
257
|
style: {
|
|
258
258
|
maxWidth: "120px",
|
|
259
259
|
overflow: "hidden",
|
|
260
260
|
textOverflow: "ellipsis",
|
|
261
261
|
whiteSpace: "nowrap"
|
|
262
262
|
},
|
|
263
|
-
children:
|
|
264
|
-
}), /* @__PURE__ */
|
|
263
|
+
children: i.name
|
|
264
|
+
}), /* @__PURE__ */ l("button", {
|
|
265
265
|
type: "button",
|
|
266
|
-
onClick: () =>
|
|
267
|
-
"aria-label": `Remove ${
|
|
266
|
+
onClick: () => p(v),
|
|
267
|
+
"aria-label": `Remove ${i.name}`,
|
|
268
268
|
style: {
|
|
269
269
|
border: "none",
|
|
270
270
|
background: "none",
|
|
@@ -276,47 +276,47 @@ var se = ({ onSend: e, disabled: t = !1, placeholder: r = "Type a message...", a
|
|
|
276
276
|
},
|
|
277
277
|
children: "×"
|
|
278
278
|
})]
|
|
279
|
-
},
|
|
280
|
-
}), /* @__PURE__ */
|
|
279
|
+
}, v))
|
|
280
|
+
}), /* @__PURE__ */ M("div", {
|
|
281
281
|
style: {
|
|
282
282
|
display: "flex",
|
|
283
283
|
gap: "8px",
|
|
284
284
|
alignItems: "flex-end"
|
|
285
285
|
},
|
|
286
286
|
children: [
|
|
287
|
-
|
|
287
|
+
o && /* @__PURE__ */ M(U, { children: [/* @__PURE__ */ l("button", {
|
|
288
288
|
type: "button",
|
|
289
|
-
onClick: () =>
|
|
290
|
-
disabled:
|
|
289
|
+
onClick: () => d.current?.click(),
|
|
290
|
+
disabled: r,
|
|
291
291
|
"aria-label": "Attach file",
|
|
292
292
|
style: {
|
|
293
293
|
padding: "8px",
|
|
294
294
|
border: "1px solid #dee3e8",
|
|
295
295
|
borderRadius: "8px",
|
|
296
296
|
backgroundColor: "#fff",
|
|
297
|
-
cursor:
|
|
297
|
+
cursor: r ? "not-allowed" : "pointer",
|
|
298
298
|
color: "#6b6d6f",
|
|
299
299
|
fontSize: "16px",
|
|
300
300
|
lineHeight: 1
|
|
301
301
|
},
|
|
302
302
|
children: "+"
|
|
303
|
-
}), /* @__PURE__ */
|
|
304
|
-
ref:
|
|
303
|
+
}), /* @__PURE__ */ l("input", {
|
|
304
|
+
ref: d,
|
|
305
305
|
type: "file",
|
|
306
306
|
multiple: !0,
|
|
307
|
-
onChange:
|
|
307
|
+
onChange: k,
|
|
308
308
|
style: { display: "none" }
|
|
309
309
|
})] }),
|
|
310
|
-
/* @__PURE__ */
|
|
311
|
-
ref:
|
|
312
|
-
value:
|
|
313
|
-
onChange: (
|
|
314
|
-
c(
|
|
310
|
+
/* @__PURE__ */ l("textarea", {
|
|
311
|
+
ref: g,
|
|
312
|
+
value: s,
|
|
313
|
+
onChange: (i) => {
|
|
314
|
+
c(i.target.value), C();
|
|
315
315
|
},
|
|
316
|
-
onKeyDown:
|
|
317
|
-
placeholder:
|
|
318
|
-
"aria-label":
|
|
319
|
-
disabled:
|
|
316
|
+
onKeyDown: S,
|
|
317
|
+
placeholder: t,
|
|
318
|
+
"aria-label": t,
|
|
319
|
+
disabled: r,
|
|
320
320
|
rows: 1,
|
|
321
321
|
style: {
|
|
322
322
|
flex: 1,
|
|
@@ -335,23 +335,23 @@ var se = ({ onSend: e, disabled: t = !1, placeholder: r = "Type a message...", a
|
|
|
335
335
|
backgroundColor: "#f8f8f8",
|
|
336
336
|
transition: "border-color 0.15s"
|
|
337
337
|
},
|
|
338
|
-
onFocus: (
|
|
339
|
-
|
|
338
|
+
onFocus: (i) => {
|
|
339
|
+
i.currentTarget.style.borderColor = "#1b5fc4";
|
|
340
340
|
},
|
|
341
|
-
onBlur: (
|
|
342
|
-
|
|
341
|
+
onBlur: (i) => {
|
|
342
|
+
i.currentTarget.style.borderColor = "#dee3e8";
|
|
343
343
|
}
|
|
344
344
|
}),
|
|
345
|
-
/* @__PURE__ */
|
|
345
|
+
/* @__PURE__ */ l("button", {
|
|
346
346
|
type: "submit",
|
|
347
|
-
disabled:
|
|
347
|
+
disabled: r || !x,
|
|
348
348
|
style: {
|
|
349
349
|
padding: "10px 18px",
|
|
350
350
|
border: "none",
|
|
351
351
|
borderRadius: "20px",
|
|
352
|
-
backgroundColor:
|
|
352
|
+
backgroundColor: r || !x ? "#b5bfc8" : "#03182f",
|
|
353
353
|
color: "#fff",
|
|
354
|
-
cursor:
|
|
354
|
+
cursor: r || !x ? "not-allowed" : "pointer",
|
|
355
355
|
fontWeight: 500,
|
|
356
356
|
fontSize: "16px",
|
|
357
357
|
transition: "background-color 0.15s"
|
|
@@ -361,7 +361,7 @@ var se = ({ onSend: e, disabled: t = !1, placeholder: r = "Type a message...", a
|
|
|
361
361
|
]
|
|
362
362
|
})]
|
|
363
363
|
});
|
|
364
|
-
},
|
|
364
|
+
}, ue = ({ href: e, children: r, ...t }) => /* @__PURE__ */ l("a", {
|
|
365
365
|
href: e,
|
|
366
366
|
target: "_blank",
|
|
367
367
|
rel: "noopener noreferrer",
|
|
@@ -369,54 +369,54 @@ var se = ({ onSend: e, disabled: t = !1, placeholder: r = "Type a message...", a
|
|
|
369
369
|
color: "#1b5fc4",
|
|
370
370
|
textDecoration: "underline"
|
|
371
371
|
},
|
|
372
|
-
...
|
|
373
|
-
children:
|
|
374
|
-
}),
|
|
372
|
+
...t,
|
|
373
|
+
children: r
|
|
374
|
+
}), fe = ({ children: e, ...r }) => /* @__PURE__ */ l("p", {
|
|
375
375
|
style: {
|
|
376
376
|
margin: "0 0 8px 0",
|
|
377
377
|
lineHeight: "1.6"
|
|
378
378
|
},
|
|
379
|
-
...
|
|
379
|
+
...r,
|
|
380
380
|
children: e
|
|
381
|
-
}),
|
|
382
|
-
const
|
|
381
|
+
}), P = (e, r) => {
|
|
382
|
+
const t = ({ children: o, ...n }) => re.createElement(`h${e}`, {
|
|
383
383
|
style: {
|
|
384
384
|
margin: "16px 0 8px 0",
|
|
385
|
-
fontSize:
|
|
385
|
+
fontSize: r,
|
|
386
386
|
fontWeight: 600,
|
|
387
387
|
lineHeight: "1.3"
|
|
388
388
|
},
|
|
389
|
-
...
|
|
390
|
-
},
|
|
391
|
-
return
|
|
392
|
-
},
|
|
389
|
+
...n
|
|
390
|
+
}, o);
|
|
391
|
+
return t.displayName = `MarkdownHeading${e}`, t;
|
|
392
|
+
}, pe = ({ children: e, ...r }) => /* @__PURE__ */ l("ul", {
|
|
393
393
|
style: {
|
|
394
394
|
margin: "0 0 8px 0",
|
|
395
395
|
paddingLeft: "20px",
|
|
396
396
|
listStyleType: "disc",
|
|
397
397
|
listStylePosition: "outside"
|
|
398
398
|
},
|
|
399
|
-
...
|
|
399
|
+
...r,
|
|
400
400
|
children: e
|
|
401
|
-
}),
|
|
401
|
+
}), ge = ({ children: e, ...r }) => /* @__PURE__ */ l("ol", {
|
|
402
402
|
style: {
|
|
403
403
|
margin: "0 0 8px 0",
|
|
404
404
|
paddingLeft: "20px",
|
|
405
405
|
listStyleType: "decimal",
|
|
406
406
|
listStylePosition: "outside"
|
|
407
407
|
},
|
|
408
|
-
...
|
|
408
|
+
...r,
|
|
409
409
|
children: e
|
|
410
|
-
}),
|
|
410
|
+
}), me = ({ children: e, ...r }) => /* @__PURE__ */ l("li", {
|
|
411
411
|
style: {
|
|
412
412
|
display: "list-item",
|
|
413
413
|
margin: "2px 0",
|
|
414
414
|
lineHeight: "1.6"
|
|
415
415
|
},
|
|
416
|
-
...
|
|
416
|
+
...r,
|
|
417
417
|
children: e
|
|
418
|
-
}),
|
|
419
|
-
`) ? /* @__PURE__ */
|
|
418
|
+
}), xe = ({ className: e, children: r, ...t }) => e !== void 0 || String(r).includes(`
|
|
419
|
+
`) ? /* @__PURE__ */ l("code", {
|
|
420
420
|
style: {
|
|
421
421
|
display: "block",
|
|
422
422
|
background: "#f5f5f5",
|
|
@@ -426,9 +426,9 @@ var se = ({ onSend: e, disabled: t = !1, placeholder: r = "Type a message...", a
|
|
|
426
426
|
overflowX: "auto",
|
|
427
427
|
fontFamily: '"IBM Plex Mono", monospace'
|
|
428
428
|
},
|
|
429
|
-
...
|
|
430
|
-
children:
|
|
431
|
-
}) : /* @__PURE__ */
|
|
429
|
+
...t,
|
|
430
|
+
children: r
|
|
431
|
+
}) : /* @__PURE__ */ l("code", {
|
|
432
432
|
style: {
|
|
433
433
|
background: "#f0f2f5",
|
|
434
434
|
padding: "2px 5px",
|
|
@@ -436,13 +436,13 @@ var se = ({ onSend: e, disabled: t = !1, placeholder: r = "Type a message...", a
|
|
|
436
436
|
fontSize: "13px",
|
|
437
437
|
fontFamily: '"IBM Plex Mono", monospace'
|
|
438
438
|
},
|
|
439
|
-
...r,
|
|
440
|
-
children: t
|
|
441
|
-
}), pe = ({ children: e, ...t }) => /* @__PURE__ */ a("pre", {
|
|
442
|
-
style: { margin: "0 0 8px 0" },
|
|
443
439
|
...t,
|
|
440
|
+
children: r
|
|
441
|
+
}), he = ({ children: e, ...r }) => /* @__PURE__ */ l("pre", {
|
|
442
|
+
style: { margin: "0 0 8px 0" },
|
|
443
|
+
...r,
|
|
444
444
|
children: e
|
|
445
|
-
}),
|
|
445
|
+
}), ye = ({ children: e, ...r }) => /* @__PURE__ */ l("blockquote", {
|
|
446
446
|
style: {
|
|
447
447
|
borderLeft: "4px solid #dee3e8",
|
|
448
448
|
paddingLeft: "12px",
|
|
@@ -450,23 +450,23 @@ var se = ({ onSend: e, disabled: t = !1, placeholder: r = "Type a message...", a
|
|
|
450
450
|
fontStyle: "italic",
|
|
451
451
|
color: "#6b6d6f"
|
|
452
452
|
},
|
|
453
|
-
...
|
|
453
|
+
...r,
|
|
454
454
|
children: e
|
|
455
|
-
}),
|
|
455
|
+
}), ve = ({ children: e, ...r }) => /* @__PURE__ */ l("div", {
|
|
456
456
|
style: {
|
|
457
457
|
overflowX: "auto",
|
|
458
458
|
margin: "0 0 8px 0"
|
|
459
459
|
},
|
|
460
|
-
children: /* @__PURE__ */
|
|
460
|
+
children: /* @__PURE__ */ l("table", {
|
|
461
461
|
style: {
|
|
462
462
|
borderCollapse: "collapse",
|
|
463
463
|
width: "100%",
|
|
464
464
|
fontSize: "13px"
|
|
465
465
|
},
|
|
466
|
-
...
|
|
466
|
+
...r,
|
|
467
467
|
children: e
|
|
468
468
|
})
|
|
469
|
-
}),
|
|
469
|
+
}), be = ({ children: e, ...r }) => /* @__PURE__ */ l("th", {
|
|
470
470
|
style: {
|
|
471
471
|
border: "1px solid #dee3e8",
|
|
472
472
|
padding: "6px 10px",
|
|
@@ -474,66 +474,66 @@ var se = ({ onSend: e, disabled: t = !1, placeholder: r = "Type a message...", a
|
|
|
474
474
|
backgroundColor: "#f5f7fa",
|
|
475
475
|
fontWeight: 600
|
|
476
476
|
},
|
|
477
|
-
...
|
|
477
|
+
...r,
|
|
478
478
|
children: e
|
|
479
|
-
}),
|
|
479
|
+
}), we = ({ children: e, ...r }) => /* @__PURE__ */ l("td", {
|
|
480
480
|
style: {
|
|
481
481
|
border: "1px solid #dee3e8",
|
|
482
482
|
padding: "6px 10px"
|
|
483
483
|
},
|
|
484
|
-
...
|
|
484
|
+
...r,
|
|
485
485
|
children: e
|
|
486
|
-
}),
|
|
486
|
+
}), Ce = ({ alt: e, ...r }) => /* @__PURE__ */ l("img", {
|
|
487
487
|
alt: e ?? "",
|
|
488
488
|
style: {
|
|
489
489
|
maxWidth: "100%",
|
|
490
490
|
borderRadius: "8px",
|
|
491
491
|
margin: "4px 0"
|
|
492
492
|
},
|
|
493
|
-
...
|
|
494
|
-
}),
|
|
493
|
+
...r
|
|
494
|
+
}), Se = (e) => /* @__PURE__ */ l("hr", {
|
|
495
495
|
style: {
|
|
496
496
|
border: "none",
|
|
497
497
|
borderTop: "1px solid #dee3e8",
|
|
498
498
|
margin: "12px 0"
|
|
499
499
|
},
|
|
500
500
|
...e
|
|
501
|
-
}),
|
|
502
|
-
a:
|
|
503
|
-
p:
|
|
504
|
-
h1:
|
|
505
|
-
h2:
|
|
506
|
-
h3:
|
|
507
|
-
h4:
|
|
508
|
-
h5:
|
|
509
|
-
h6:
|
|
510
|
-
ul:
|
|
511
|
-
ol:
|
|
512
|
-
li:
|
|
513
|
-
code:
|
|
514
|
-
pre:
|
|
515
|
-
blockquote:
|
|
516
|
-
table:
|
|
517
|
-
th:
|
|
518
|
-
td:
|
|
519
|
-
img:
|
|
520
|
-
hr:
|
|
521
|
-
},
|
|
522
|
-
remarkPlugins:
|
|
523
|
-
components:
|
|
501
|
+
}), ke = {
|
|
502
|
+
a: ue,
|
|
503
|
+
p: fe,
|
|
504
|
+
h1: P(1, "20px"),
|
|
505
|
+
h2: P(2, "18px"),
|
|
506
|
+
h3: P(3, "16px"),
|
|
507
|
+
h4: P(4, "15px"),
|
|
508
|
+
h5: P(5, "14px"),
|
|
509
|
+
h6: P(6, "13px"),
|
|
510
|
+
ul: pe,
|
|
511
|
+
ol: ge,
|
|
512
|
+
li: me,
|
|
513
|
+
code: xe,
|
|
514
|
+
pre: he,
|
|
515
|
+
blockquote: ye,
|
|
516
|
+
table: ve,
|
|
517
|
+
th: be,
|
|
518
|
+
td: we,
|
|
519
|
+
img: Ce,
|
|
520
|
+
hr: Se
|
|
521
|
+
}, Ie = [le], Ae = ({ content: e }) => /* @__PURE__ */ l(ie, {
|
|
522
|
+
remarkPlugins: Ie,
|
|
523
|
+
components: ke,
|
|
524
524
|
children: e
|
|
525
|
-
}),
|
|
526
|
-
const
|
|
527
|
-
if (
|
|
528
|
-
href:
|
|
525
|
+
}), Ne = ({ attachment: e, isUser: r }) => {
|
|
526
|
+
const t = ee(e.url);
|
|
527
|
+
if (Y(e)) return /* @__PURE__ */ l("a", {
|
|
528
|
+
href: t,
|
|
529
529
|
target: "_blank",
|
|
530
530
|
rel: "noopener noreferrer",
|
|
531
531
|
style: {
|
|
532
532
|
display: "inline-block",
|
|
533
533
|
textDecoration: "none"
|
|
534
534
|
},
|
|
535
|
-
children: /* @__PURE__ */
|
|
536
|
-
src:
|
|
535
|
+
children: /* @__PURE__ */ l("img", {
|
|
536
|
+
src: t,
|
|
537
537
|
alt: e.name,
|
|
538
538
|
loading: "lazy",
|
|
539
539
|
style: {
|
|
@@ -546,7 +546,7 @@ var se = ({ onSend: e, disabled: t = !1, placeholder: r = "Type a message...", a
|
|
|
546
546
|
}
|
|
547
547
|
})
|
|
548
548
|
});
|
|
549
|
-
const
|
|
549
|
+
const o = Q(e.fileSize), n = /* @__PURE__ */ M(U, { children: [/* @__PURE__ */ l("span", {
|
|
550
550
|
style: {
|
|
551
551
|
fontSize: "16px",
|
|
552
552
|
lineHeight: 1,
|
|
@@ -554,13 +554,13 @@ var se = ({ onSend: e, disabled: t = !1, placeholder: r = "Type a message...", a
|
|
|
554
554
|
},
|
|
555
555
|
"aria-hidden": !0,
|
|
556
556
|
children: "📄"
|
|
557
|
-
}), /* @__PURE__ */
|
|
557
|
+
}), /* @__PURE__ */ M("span", {
|
|
558
558
|
style: {
|
|
559
559
|
display: "flex",
|
|
560
560
|
flexDirection: "column",
|
|
561
561
|
minWidth: 0
|
|
562
562
|
},
|
|
563
|
-
children: [/* @__PURE__ */
|
|
563
|
+
children: [/* @__PURE__ */ l("span", {
|
|
564
564
|
style: {
|
|
565
565
|
overflow: "hidden",
|
|
566
566
|
textOverflow: "ellipsis",
|
|
@@ -569,38 +569,38 @@ var se = ({ onSend: e, disabled: t = !1, placeholder: r = "Type a message...", a
|
|
|
569
569
|
},
|
|
570
570
|
title: e.name,
|
|
571
571
|
children: e.name
|
|
572
|
-
}),
|
|
572
|
+
}), o && /* @__PURE__ */ l("span", {
|
|
573
573
|
style: {
|
|
574
574
|
fontSize: "11px",
|
|
575
575
|
color: "#6b6d6f"
|
|
576
576
|
},
|
|
577
|
-
children:
|
|
577
|
+
children: o
|
|
578
578
|
})]
|
|
579
|
-
})] }),
|
|
579
|
+
})] }), s = {
|
|
580
580
|
display: "inline-flex",
|
|
581
581
|
alignItems: "center",
|
|
582
582
|
gap: "8px",
|
|
583
583
|
padding: "8px 12px",
|
|
584
584
|
borderRadius: "10px",
|
|
585
585
|
border: "1px solid #dee3e8",
|
|
586
|
-
backgroundColor:
|
|
587
|
-
color:
|
|
586
|
+
backgroundColor: r ? "rgba(255,255,255,0.12)" : "#fff",
|
|
587
|
+
color: r ? "#fff" : "#30373e",
|
|
588
588
|
fontSize: "13px",
|
|
589
589
|
textDecoration: "none",
|
|
590
590
|
maxWidth: "220px"
|
|
591
591
|
};
|
|
592
|
-
return
|
|
593
|
-
href:
|
|
592
|
+
return t ? /* @__PURE__ */ l("a", {
|
|
593
|
+
href: t,
|
|
594
594
|
target: "_blank",
|
|
595
595
|
rel: "noopener noreferrer",
|
|
596
|
-
style:
|
|
597
|
-
children:
|
|
598
|
-
}) : /* @__PURE__ */
|
|
599
|
-
style:
|
|
600
|
-
children:
|
|
596
|
+
style: s,
|
|
597
|
+
children: n
|
|
598
|
+
}) : /* @__PURE__ */ l("div", {
|
|
599
|
+
style: s,
|
|
600
|
+
children: n
|
|
601
601
|
});
|
|
602
|
-
},
|
|
603
|
-
const
|
|
602
|
+
}, Re = ({ source: e, index: r }) => {
|
|
603
|
+
const t = /* @__PURE__ */ M("div", {
|
|
604
604
|
style: {
|
|
605
605
|
display: "flex",
|
|
606
606
|
alignItems: "center",
|
|
@@ -608,7 +608,7 @@ var se = ({ onSend: e, disabled: t = !1, placeholder: r = "Type a message...", a
|
|
|
608
608
|
width: "100%",
|
|
609
609
|
minWidth: 0
|
|
610
610
|
},
|
|
611
|
-
children: [/* @__PURE__ */
|
|
611
|
+
children: [/* @__PURE__ */ l("div", {
|
|
612
612
|
style: {
|
|
613
613
|
flexShrink: 0,
|
|
614
614
|
width: "18px",
|
|
@@ -623,8 +623,8 @@ var se = ({ onSend: e, disabled: t = !1, placeholder: r = "Type a message...", a
|
|
|
623
623
|
justifyContent: "center",
|
|
624
624
|
backgroundColor: "#f0f4ff"
|
|
625
625
|
},
|
|
626
|
-
children:
|
|
627
|
-
}), /* @__PURE__ */
|
|
626
|
+
children: r + 1
|
|
627
|
+
}), /* @__PURE__ */ l("div", {
|
|
628
628
|
style: {
|
|
629
629
|
fontSize: "12px",
|
|
630
630
|
overflow: "hidden",
|
|
@@ -635,7 +635,7 @@ var se = ({ onSend: e, disabled: t = !1, placeholder: r = "Type a message...", a
|
|
|
635
635
|
title: e.title,
|
|
636
636
|
children: e.title
|
|
637
637
|
})]
|
|
638
|
-
}),
|
|
638
|
+
}), o = {
|
|
639
639
|
display: "flex",
|
|
640
640
|
alignItems: "center",
|
|
641
641
|
padding: "8px 10px",
|
|
@@ -648,23 +648,23 @@ var se = ({ onSend: e, disabled: t = !1, placeholder: r = "Type a message...", a
|
|
|
648
648
|
minWidth: 0,
|
|
649
649
|
transition: "border-color 0.15s"
|
|
650
650
|
};
|
|
651
|
-
return e.url ? /* @__PURE__ */
|
|
651
|
+
return e.url ? /* @__PURE__ */ l("a", {
|
|
652
652
|
href: e.url,
|
|
653
653
|
target: "_blank",
|
|
654
654
|
rel: "noopener noreferrer",
|
|
655
|
-
style:
|
|
656
|
-
onMouseEnter: (
|
|
657
|
-
|
|
655
|
+
style: o,
|
|
656
|
+
onMouseEnter: (n) => {
|
|
657
|
+
n.currentTarget.style.borderColor = "#1b5fc4";
|
|
658
658
|
},
|
|
659
|
-
onMouseLeave: (
|
|
660
|
-
|
|
659
|
+
onMouseLeave: (n) => {
|
|
660
|
+
n.currentTarget.style.borderColor = "#dee3e8";
|
|
661
661
|
},
|
|
662
|
-
children:
|
|
663
|
-
}) : /* @__PURE__ */
|
|
664
|
-
style:
|
|
665
|
-
children:
|
|
662
|
+
children: t
|
|
663
|
+
}) : /* @__PURE__ */ l("div", {
|
|
664
|
+
style: o,
|
|
665
|
+
children: t
|
|
666
666
|
});
|
|
667
|
-
},
|
|
667
|
+
}, Ee = () => /* @__PURE__ */ M("div", {
|
|
668
668
|
style: {
|
|
669
669
|
display: "flex",
|
|
670
670
|
gap: "4px",
|
|
@@ -674,31 +674,31 @@ var se = ({ onSend: e, disabled: t = !1, placeholder: r = "Type a message...", a
|
|
|
674
674
|
0,
|
|
675
675
|
1,
|
|
676
676
|
2
|
|
677
|
-
].map((e) => /* @__PURE__ */
|
|
677
|
+
].map((e) => /* @__PURE__ */ l("div", { style: {
|
|
678
678
|
width: "6px",
|
|
679
679
|
height: "6px",
|
|
680
680
|
borderRadius: "50%",
|
|
681
681
|
backgroundColor: "#b5bfc8",
|
|
682
682
|
animation: "ago-pulse 1.2s ease-in-out infinite",
|
|
683
683
|
animationDelay: `${e * 0.2}s`
|
|
684
|
-
} }, e)), /* @__PURE__ */
|
|
684
|
+
} }, e)), /* @__PURE__ */ l("style", { children: `
|
|
685
685
|
@keyframes ago-pulse {
|
|
686
686
|
0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
|
|
687
687
|
40% { opacity: 1; transform: scale(1); }
|
|
688
688
|
}
|
|
689
689
|
` })]
|
|
690
|
-
}), Me = ({ message: e, className:
|
|
691
|
-
const
|
|
692
|
-
return /* @__PURE__ */
|
|
693
|
-
className: `ago-message ago-message--${e.role} ${
|
|
690
|
+
}), Me = ({ message: e, className: r = "", showAgentName: t = !1, isLast: o = !1, onFollowUpClick: n }) => {
|
|
691
|
+
const s = e.role === "user", c = e.status === "IN_PROGRESS" || e.status === "WAITING_CLIENT";
|
|
692
|
+
return /* @__PURE__ */ M("div", {
|
|
693
|
+
className: `ago-message ago-message--${e.role} ${r}`,
|
|
694
694
|
style: {
|
|
695
695
|
display: "flex",
|
|
696
696
|
flexDirection: "column",
|
|
697
|
-
alignItems:
|
|
697
|
+
alignItems: s ? "flex-end" : "flex-start",
|
|
698
698
|
marginBottom: "16px"
|
|
699
699
|
},
|
|
700
700
|
children: [
|
|
701
|
-
!
|
|
701
|
+
!s && t && e.agent && /* @__PURE__ */ l("div", {
|
|
702
702
|
className: "ago-message__agent",
|
|
703
703
|
style: {
|
|
704
704
|
display: "flex",
|
|
@@ -712,7 +712,7 @@ var se = ({ onSend: e, disabled: t = !1, placeholder: r = "Type a message...", a
|
|
|
712
712
|
},
|
|
713
713
|
children: e.agent.displayName || e.agent.name
|
|
714
714
|
}),
|
|
715
|
-
!
|
|
715
|
+
!s && e.sources && e.sources.length > 0 && /* @__PURE__ */ l("div", {
|
|
716
716
|
className: "ago-message__sources",
|
|
717
717
|
style: {
|
|
718
718
|
display: "grid",
|
|
@@ -722,41 +722,41 @@ var se = ({ onSend: e, disabled: t = !1, placeholder: r = "Type a message...", a
|
|
|
722
722
|
width: "100%",
|
|
723
723
|
maxWidth: "85%"
|
|
724
724
|
},
|
|
725
|
-
children: e.sources.map((
|
|
726
|
-
source:
|
|
725
|
+
children: e.sources.map((a, f) => /* @__PURE__ */ l(Re, {
|
|
726
|
+
source: a,
|
|
727
727
|
index: f
|
|
728
|
-
},
|
|
728
|
+
}, a.id))
|
|
729
729
|
}),
|
|
730
|
-
e.attachments && e.attachments.length > 0 && /* @__PURE__ */
|
|
730
|
+
e.attachments && e.attachments.length > 0 && /* @__PURE__ */ l("div", {
|
|
731
731
|
className: "ago-message__attachments",
|
|
732
732
|
style: {
|
|
733
733
|
display: "flex",
|
|
734
734
|
flexWrap: "wrap",
|
|
735
735
|
gap: "6px",
|
|
736
736
|
marginBottom: "6px",
|
|
737
|
-
justifyContent:
|
|
737
|
+
justifyContent: s ? "flex-end" : "flex-start",
|
|
738
738
|
maxWidth: "75%"
|
|
739
739
|
},
|
|
740
|
-
children: e.attachments.map((
|
|
741
|
-
attachment:
|
|
742
|
-
isUser:
|
|
743
|
-
},
|
|
740
|
+
children: e.attachments.map((a) => /* @__PURE__ */ l(Ne, {
|
|
741
|
+
attachment: a,
|
|
742
|
+
isUser: s
|
|
743
|
+
}, a.id))
|
|
744
744
|
}),
|
|
745
|
-
(e.content || c) && /* @__PURE__ */
|
|
745
|
+
(e.content || c) && /* @__PURE__ */ l("div", {
|
|
746
746
|
className: "ago-message__content",
|
|
747
747
|
style: {
|
|
748
|
-
maxWidth:
|
|
749
|
-
padding:
|
|
750
|
-
borderRadius:
|
|
751
|
-
backgroundColor:
|
|
752
|
-
color:
|
|
748
|
+
maxWidth: s ? "75%" : "100%",
|
|
749
|
+
padding: s ? "10px 14px" : "2px 8px",
|
|
750
|
+
borderRadius: s ? "16px" : "0",
|
|
751
|
+
backgroundColor: s ? "#03182f" : "transparent",
|
|
752
|
+
color: s ? "#fff" : "#30373e",
|
|
753
753
|
wordBreak: "break-word",
|
|
754
754
|
fontSize: "16px",
|
|
755
755
|
lineHeight: "1.6"
|
|
756
756
|
},
|
|
757
|
-
children: e.content ? /* @__PURE__ */
|
|
757
|
+
children: e.content ? /* @__PURE__ */ l(Ae, { content: e.content }) : c && /* @__PURE__ */ l(Ee, {})
|
|
758
758
|
}),
|
|
759
|
-
|
|
759
|
+
o && e.followUpReplies && e.followUpReplies.length > 0 && /* @__PURE__ */ l("div", {
|
|
760
760
|
className: "ago-message__followups",
|
|
761
761
|
style: {
|
|
762
762
|
display: "flex",
|
|
@@ -764,11 +764,11 @@ var se = ({ onSend: e, disabled: t = !1, placeholder: r = "Type a message...", a
|
|
|
764
764
|
gap: "8px",
|
|
765
765
|
marginTop: "10px"
|
|
766
766
|
},
|
|
767
|
-
children: e.followUpReplies.map((
|
|
767
|
+
children: e.followUpReplies.map((a, f) => /* @__PURE__ */ l("button", {
|
|
768
768
|
type: "button",
|
|
769
769
|
className: "ago-message__followup-btn",
|
|
770
|
-
disabled: !
|
|
771
|
-
onClick:
|
|
770
|
+
disabled: !n,
|
|
771
|
+
onClick: n ? () => n(a) : void 0,
|
|
772
772
|
style: {
|
|
773
773
|
minHeight: "36px",
|
|
774
774
|
padding: "6px 14px",
|
|
@@ -777,55 +777,55 @@ var se = ({ onSend: e, disabled: t = !1, placeholder: r = "Type a message...", a
|
|
|
777
777
|
border: "1px solid #dee3e8",
|
|
778
778
|
backgroundColor: "#fff",
|
|
779
779
|
color: "#30373e",
|
|
780
|
-
cursor:
|
|
780
|
+
cursor: n ? "pointer" : "default",
|
|
781
781
|
transition: "border-color 0.15s"
|
|
782
782
|
},
|
|
783
|
-
onMouseEnter: (
|
|
784
|
-
|
|
783
|
+
onMouseEnter: (d) => {
|
|
784
|
+
d.currentTarget.style.borderColor = "#1b5fc4";
|
|
785
785
|
},
|
|
786
|
-
onMouseLeave: (
|
|
787
|
-
|
|
786
|
+
onMouseLeave: (d) => {
|
|
787
|
+
d.currentTarget.style.borderColor = "#dee3e8";
|
|
788
788
|
},
|
|
789
|
-
children:
|
|
789
|
+
children: a
|
|
790
790
|
}, f))
|
|
791
791
|
})
|
|
792
792
|
]
|
|
793
793
|
});
|
|
794
|
-
},
|
|
795
|
-
const
|
|
794
|
+
}, Je = ({ client: e, conversationId: r, title: t = "Chat", welcomeMessage: o = "Hello! How can I help you today?", placeholder: n = "Type a message...", allowFiles: s = !1, height: c = 500, logoUrl: a, showAgentName: f = !1, forms: d, onFollowUpClick: g, className: C = "", onMessageSent: N, onMessageReceived: S }) => {
|
|
795
|
+
const k = _(null), p = z(), x = e ?? p, { messages: i, isLoading: v, error: u, sendMessage: h } = K({
|
|
796
796
|
client: e,
|
|
797
|
-
conversationId:
|
|
797
|
+
conversationId: r
|
|
798
798
|
});
|
|
799
|
-
|
|
800
|
-
if (!
|
|
801
|
-
let
|
|
802
|
-
const
|
|
803
|
-
return Promise.all(
|
|
804
|
-
if (!
|
|
805
|
-
for (const
|
|
799
|
+
A(() => {
|
|
800
|
+
if (!x || !d || d.length === 0) return;
|
|
801
|
+
let m = !1;
|
|
802
|
+
const I = [];
|
|
803
|
+
return Promise.all(d.map((F) => F.schema != null ? Promise.resolve(B(F)) : j(x, F))).then((F) => {
|
|
804
|
+
if (!m)
|
|
805
|
+
for (const V of F) I.push(V.install(x));
|
|
806
806
|
}).catch(() => {
|
|
807
807
|
}), () => {
|
|
808
|
-
|
|
808
|
+
m = !0, I.forEach((F) => F());
|
|
809
809
|
};
|
|
810
|
-
}, [
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
])) : ""]),
|
|
816
|
-
|
|
817
|
-
}, [
|
|
818
|
-
const
|
|
819
|
-
|
|
820
|
-
id:
|
|
821
|
-
content:
|
|
810
|
+
}, [x, d ? JSON.stringify(d.map((m) => [
|
|
811
|
+
m.name,
|
|
812
|
+
m.schema ?? null,
|
|
813
|
+
m.submit ?? !1,
|
|
814
|
+
m.description ?? null
|
|
815
|
+
])) : ""]), A(() => {
|
|
816
|
+
k.current?.scrollIntoView({ behavior: "smooth" });
|
|
817
|
+
}, [i]), A(() => {
|
|
818
|
+
const m = i[i.length - 1];
|
|
819
|
+
m && m.role === "assistant" && m.status === "DONE" && S && S({
|
|
820
|
+
id: m.id,
|
|
821
|
+
content: m.content
|
|
822
822
|
});
|
|
823
|
-
}, [
|
|
824
|
-
const
|
|
825
|
-
|
|
826
|
-
},
|
|
827
|
-
return /* @__PURE__ */
|
|
828
|
-
className: `ago-chat-widget ${
|
|
823
|
+
}, [i, S]);
|
|
824
|
+
const w = async (m, I) => {
|
|
825
|
+
N?.(m), await h(m, I);
|
|
826
|
+
}, b = i[i.length - 1], T = v && b?.role === "assistant" && (b.status === "IN_PROGRESS" || b.status === "WAITING_CLIENT"), y = g === !1 ? void 0 : g ?? ((m) => w(m));
|
|
827
|
+
return /* @__PURE__ */ M("div", {
|
|
828
|
+
className: `ago-chat-widget ${C}`,
|
|
829
829
|
style: {
|
|
830
830
|
display: "flex",
|
|
831
831
|
flexDirection: "column",
|
|
@@ -839,7 +839,7 @@ var se = ({ onSend: e, disabled: t = !1, placeholder: r = "Type a message...", a
|
|
|
839
839
|
boxShadow: "rgba(15, 15, 15, 0.08) 0px 2px 16px 0px"
|
|
840
840
|
},
|
|
841
841
|
children: [
|
|
842
|
-
/* @__PURE__ */
|
|
842
|
+
/* @__PURE__ */ M("div", {
|
|
843
843
|
className: "ago-chat-widget__header",
|
|
844
844
|
style: {
|
|
845
845
|
padding: "14px 16px",
|
|
@@ -850,23 +850,23 @@ var se = ({ onSend: e, disabled: t = !1, placeholder: r = "Type a message...", a
|
|
|
850
850
|
alignItems: "center",
|
|
851
851
|
gap: "10px"
|
|
852
852
|
},
|
|
853
|
-
children: [
|
|
854
|
-
src:
|
|
853
|
+
children: [a && /* @__PURE__ */ l("img", {
|
|
854
|
+
src: a,
|
|
855
855
|
alt: "Logo",
|
|
856
856
|
style: {
|
|
857
857
|
height: "24px",
|
|
858
858
|
width: "auto"
|
|
859
859
|
}
|
|
860
|
-
}), /* @__PURE__ */
|
|
860
|
+
}), /* @__PURE__ */ l("h3", {
|
|
861
861
|
style: {
|
|
862
862
|
margin: 0,
|
|
863
863
|
fontSize: "15px",
|
|
864
864
|
fontWeight: 600
|
|
865
865
|
},
|
|
866
|
-
children:
|
|
866
|
+
children: t
|
|
867
867
|
})]
|
|
868
868
|
}),
|
|
869
|
-
/* @__PURE__ */
|
|
869
|
+
/* @__PURE__ */ M("div", {
|
|
870
870
|
className: "ago-chat-widget__messages",
|
|
871
871
|
role: "log",
|
|
872
872
|
"aria-live": "polite",
|
|
@@ -879,7 +879,7 @@ var se = ({ onSend: e, disabled: t = !1, placeholder: r = "Type a message...", a
|
|
|
879
879
|
backgroundColor: "#fbfbfb"
|
|
880
880
|
},
|
|
881
881
|
children: [
|
|
882
|
-
|
|
882
|
+
i.length === 0 ? /* @__PURE__ */ l("div", {
|
|
883
883
|
style: {
|
|
884
884
|
textAlign: "center",
|
|
885
885
|
color: "#6b6d6f",
|
|
@@ -887,14 +887,14 @@ var se = ({ onSend: e, disabled: t = !1, placeholder: r = "Type a message...", a
|
|
|
887
887
|
fontSize: "16px",
|
|
888
888
|
lineHeight: "1.5"
|
|
889
889
|
},
|
|
890
|
-
children:
|
|
891
|
-
}) :
|
|
892
|
-
message:
|
|
890
|
+
children: o
|
|
891
|
+
}) : i.map((m, I) => /* @__PURE__ */ l(Me, {
|
|
892
|
+
message: m,
|
|
893
893
|
showAgentName: f,
|
|
894
|
-
isLast:
|
|
895
|
-
onFollowUpClick:
|
|
896
|
-
},
|
|
897
|
-
|
|
894
|
+
isLast: I === i.length - 1,
|
|
895
|
+
onFollowUpClick: y
|
|
896
|
+
}, m.id)),
|
|
897
|
+
u && /* @__PURE__ */ l("div", {
|
|
898
898
|
role: "alert",
|
|
899
899
|
style: {
|
|
900
900
|
padding: "10px 14px",
|
|
@@ -905,222 +905,551 @@ var se = ({ onSend: e, disabled: t = !1, placeholder: r = "Type a message...", a
|
|
|
905
905
|
fontSize: "13px",
|
|
906
906
|
border: "1px solid #fecaca"
|
|
907
907
|
},
|
|
908
|
-
children:
|
|
908
|
+
children: u.message
|
|
909
909
|
}),
|
|
910
|
-
/* @__PURE__ */
|
|
910
|
+
/* @__PURE__ */ l("div", { ref: k })
|
|
911
911
|
]
|
|
912
912
|
}),
|
|
913
|
-
/* @__PURE__ */
|
|
914
|
-
onSend:
|
|
915
|
-
disabled:
|
|
916
|
-
placeholder:
|
|
917
|
-
allowFiles:
|
|
913
|
+
/* @__PURE__ */ l(de, {
|
|
914
|
+
onSend: w,
|
|
915
|
+
disabled: T,
|
|
916
|
+
placeholder: n,
|
|
917
|
+
allowFiles: s
|
|
918
918
|
})
|
|
919
919
|
]
|
|
920
920
|
});
|
|
921
921
|
};
|
|
922
|
-
function
|
|
923
|
-
const r = z(),
|
|
924
|
-
if (!
|
|
925
|
-
const [o,
|
|
926
|
-
|
|
922
|
+
function _e(e = {}) {
|
|
923
|
+
const r = z(), t = e.client ?? r;
|
|
924
|
+
if (!t) throw new q("useProactiveNudge: no AgoClient. Pass one via options.client or wrap your tree with <AgoProvider>.", "proactive_missing_client");
|
|
925
|
+
const [o, n] = E(null), s = _(o);
|
|
926
|
+
s.current = o;
|
|
927
|
+
const c = _(e.onExpand);
|
|
928
|
+
return c.current = e.onExpand, A(() => {
|
|
929
|
+
const a = (d) => {
|
|
930
|
+
n(d), t.proactive?.shown(d);
|
|
931
|
+
}, f = ({ nudge: d }) => {
|
|
932
|
+
n((g) => g?.id === d.id ? null : g);
|
|
933
|
+
};
|
|
934
|
+
return t.on("nudge:ready", a), t.on("nudge:accepted", f), t.on("nudge:dismissed", f), () => {
|
|
935
|
+
t.off("nudge:ready", a), t.off("nudge:accepted", f), t.off("nudge:dismissed", f);
|
|
936
|
+
};
|
|
937
|
+
}, [t]), {
|
|
938
|
+
nudge: o,
|
|
939
|
+
accept: R(async () => {
|
|
940
|
+
const a = s.current;
|
|
941
|
+
a && (n(null), await t.proactive?.accept(a), (a.source === "agent" || a.goal) && c.current?.(a));
|
|
942
|
+
}, [t]),
|
|
943
|
+
dismiss: R(() => {
|
|
944
|
+
const a = s.current;
|
|
945
|
+
a && (n(null), t.proactive?.dismiss(a));
|
|
946
|
+
}, [t])
|
|
947
|
+
};
|
|
948
|
+
}
|
|
949
|
+
var Ve = ({ client: e, onExpand: r, autoHideMs: t, position: o = "bottom-right", openChatLabel: n = "Open chat", className: s = "" }) => {
|
|
950
|
+
const { nudge: c, accept: a, dismiss: f } = _e({
|
|
951
|
+
client: e,
|
|
952
|
+
onExpand: r
|
|
953
|
+
});
|
|
954
|
+
if (A(() => {
|
|
955
|
+
if (!c || !t) return;
|
|
956
|
+
const g = setTimeout(() => f(), t);
|
|
957
|
+
return () => clearTimeout(g);
|
|
958
|
+
}, [
|
|
959
|
+
c,
|
|
960
|
+
t,
|
|
961
|
+
f
|
|
962
|
+
]), !c) return null;
|
|
963
|
+
const d = c.source === "agent" || !!c.goal;
|
|
964
|
+
return /* @__PURE__ */ M("div", {
|
|
965
|
+
className: `ago-nudge ${s}`,
|
|
966
|
+
role: "status",
|
|
967
|
+
"aria-live": "polite",
|
|
968
|
+
style: {
|
|
969
|
+
position: "fixed",
|
|
970
|
+
bottom: "90px",
|
|
971
|
+
...o === "bottom-left" ? { left: "20px" } : { right: "20px" },
|
|
972
|
+
zIndex: 2147483e3,
|
|
973
|
+
maxWidth: "320px",
|
|
974
|
+
padding: "14px 16px",
|
|
975
|
+
backgroundColor: "#fff",
|
|
976
|
+
color: "#03182f",
|
|
977
|
+
border: "1px solid #dee3e8",
|
|
978
|
+
borderRadius: "16px",
|
|
979
|
+
boxShadow: "rgba(15, 15, 15, 0.12) 0px 4px 20px 0px",
|
|
980
|
+
fontFamily: '"IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
981
|
+
fontSize: "14px",
|
|
982
|
+
lineHeight: 1.5,
|
|
983
|
+
textAlign: "left"
|
|
984
|
+
},
|
|
985
|
+
children: [
|
|
986
|
+
/* @__PURE__ */ l("button", {
|
|
987
|
+
type: "button",
|
|
988
|
+
className: "ago-nudge__close",
|
|
989
|
+
"aria-label": "Dismiss",
|
|
990
|
+
onClick: f,
|
|
991
|
+
style: {
|
|
992
|
+
position: "absolute",
|
|
993
|
+
top: "6px",
|
|
994
|
+
right: "8px",
|
|
995
|
+
border: "none",
|
|
996
|
+
background: "transparent",
|
|
997
|
+
color: "#6b6d6f",
|
|
998
|
+
fontSize: "16px",
|
|
999
|
+
lineHeight: 1,
|
|
1000
|
+
cursor: "pointer",
|
|
1001
|
+
padding: "4px"
|
|
1002
|
+
},
|
|
1003
|
+
children: "×"
|
|
1004
|
+
}),
|
|
1005
|
+
/* @__PURE__ */ l("div", {
|
|
1006
|
+
className: "ago-nudge__message",
|
|
1007
|
+
style: { paddingRight: "16px" },
|
|
1008
|
+
children: c.message
|
|
1009
|
+
}),
|
|
1010
|
+
(c.action || d) && /* @__PURE__ */ M("div", {
|
|
1011
|
+
className: "ago-nudge__actions",
|
|
1012
|
+
style: {
|
|
1013
|
+
display: "flex",
|
|
1014
|
+
gap: "8px",
|
|
1015
|
+
marginTop: "10px",
|
|
1016
|
+
flexWrap: "wrap"
|
|
1017
|
+
},
|
|
1018
|
+
children: [c.action && /* @__PURE__ */ l("button", {
|
|
1019
|
+
type: "button",
|
|
1020
|
+
className: "ago-nudge__action",
|
|
1021
|
+
onClick: () => {
|
|
1022
|
+
a();
|
|
1023
|
+
},
|
|
1024
|
+
style: {
|
|
1025
|
+
border: "none",
|
|
1026
|
+
borderRadius: "10px",
|
|
1027
|
+
padding: "6px 12px",
|
|
1028
|
+
backgroundColor: "#03182f",
|
|
1029
|
+
color: "#e8f0fe",
|
|
1030
|
+
fontSize: "13px",
|
|
1031
|
+
fontWeight: 600,
|
|
1032
|
+
cursor: "pointer"
|
|
1033
|
+
},
|
|
1034
|
+
children: c.action.label
|
|
1035
|
+
}), d && /* @__PURE__ */ l("button", {
|
|
1036
|
+
type: "button",
|
|
1037
|
+
className: "ago-nudge__expand",
|
|
1038
|
+
onClick: () => {
|
|
1039
|
+
a();
|
|
1040
|
+
},
|
|
1041
|
+
style: {
|
|
1042
|
+
border: "1px solid #dee3e8",
|
|
1043
|
+
borderRadius: "10px",
|
|
1044
|
+
padding: "6px 12px",
|
|
1045
|
+
backgroundColor: "#fff",
|
|
1046
|
+
color: "#03182f",
|
|
1047
|
+
fontSize: "13px",
|
|
1048
|
+
fontWeight: 600,
|
|
1049
|
+
cursor: "pointer"
|
|
1050
|
+
},
|
|
1051
|
+
children: n
|
|
1052
|
+
})]
|
|
1053
|
+
})
|
|
1054
|
+
]
|
|
1055
|
+
});
|
|
1056
|
+
};
|
|
1057
|
+
function Fe({ client: e, autoLoad: r = !0 } = {}) {
|
|
1058
|
+
const t = z(), o = e || t;
|
|
1059
|
+
if (!o) throw new Error("useConversation requires an AgoClient. Either pass it as options.client or wrap your app in <AgoProvider>.");
|
|
1060
|
+
const [n, s] = E([]), [c, a] = E(null), [f, d] = E(!1), [g, C] = E(null), N = R(async () => {
|
|
1061
|
+
d(!0), C(null);
|
|
927
1062
|
try {
|
|
928
|
-
|
|
929
|
-
} catch (
|
|
930
|
-
|
|
1063
|
+
s(await o.getConversations());
|
|
1064
|
+
} catch (p) {
|
|
1065
|
+
C(p instanceof Error ? p : /* @__PURE__ */ new Error("Failed to load conversations"));
|
|
931
1066
|
} finally {
|
|
932
|
-
|
|
1067
|
+
d(!1);
|
|
933
1068
|
}
|
|
934
|
-
}, [
|
|
935
|
-
|
|
1069
|
+
}, [o]), S = R(async (p) => {
|
|
1070
|
+
d(!0), C(null);
|
|
936
1071
|
try {
|
|
937
|
-
|
|
938
|
-
} catch (
|
|
939
|
-
|
|
1072
|
+
a(await o.getConversation(p));
|
|
1073
|
+
} catch (x) {
|
|
1074
|
+
C(x instanceof Error ? x : /* @__PURE__ */ new Error("Failed to load conversation"));
|
|
940
1075
|
} finally {
|
|
941
|
-
|
|
1076
|
+
d(!1);
|
|
942
1077
|
}
|
|
943
|
-
}, [
|
|
944
|
-
|
|
1078
|
+
}, [o]), k = R(() => {
|
|
1079
|
+
a(null);
|
|
945
1080
|
}, []);
|
|
946
|
-
return
|
|
947
|
-
|
|
948
|
-
}, [
|
|
949
|
-
conversations:
|
|
1081
|
+
return A(() => {
|
|
1082
|
+
r && N();
|
|
1083
|
+
}, [r, N]), {
|
|
1084
|
+
conversations: n,
|
|
950
1085
|
currentConversation: c,
|
|
951
1086
|
isLoading: f,
|
|
952
|
-
error:
|
|
953
|
-
selectConversation:
|
|
954
|
-
startNewConversation:
|
|
955
|
-
refreshConversations:
|
|
1087
|
+
error: g,
|
|
1088
|
+
selectConversation: S,
|
|
1089
|
+
startNewConversation: k,
|
|
1090
|
+
refreshConversations: N
|
|
956
1091
|
};
|
|
957
1092
|
}
|
|
958
|
-
function
|
|
959
|
-
const
|
|
960
|
-
if (!
|
|
961
|
-
const
|
|
962
|
-
client:
|
|
1093
|
+
function Ye(e = {}) {
|
|
1094
|
+
const r = z(), t = e.client || r;
|
|
1095
|
+
if (!t) throw new Error("useChat requires an AgoClient. Either pass it as options.client or wrap your app in <AgoProvider>.");
|
|
1096
|
+
const o = K({
|
|
1097
|
+
client: t,
|
|
963
1098
|
conversationId: e.conversationId
|
|
964
|
-
}),
|
|
965
|
-
client:
|
|
1099
|
+
}), n = Fe({
|
|
1100
|
+
client: t,
|
|
966
1101
|
autoLoad: e.autoLoad
|
|
967
1102
|
});
|
|
968
1103
|
return {
|
|
969
|
-
messages:
|
|
970
|
-
isLoading:
|
|
971
|
-
error:
|
|
972
|
-
sendMessage:
|
|
973
|
-
clearMessages:
|
|
974
|
-
conversationId:
|
|
975
|
-
conversations:
|
|
976
|
-
currentConversation:
|
|
977
|
-
isConversationsLoading:
|
|
978
|
-
selectConversation:
|
|
979
|
-
startNewConversation:
|
|
980
|
-
refreshConversations:
|
|
1104
|
+
messages: o.messages,
|
|
1105
|
+
isLoading: o.isLoading,
|
|
1106
|
+
error: o.error || n.error,
|
|
1107
|
+
sendMessage: o.sendMessage,
|
|
1108
|
+
clearMessages: o.clearMessages,
|
|
1109
|
+
conversationId: o.conversationId,
|
|
1110
|
+
conversations: n.conversations,
|
|
1111
|
+
currentConversation: n.currentConversation,
|
|
1112
|
+
isConversationsLoading: n.isLoading,
|
|
1113
|
+
selectConversation: n.selectConversation,
|
|
1114
|
+
startNewConversation: n.startNewConversation,
|
|
1115
|
+
refreshConversations: n.refreshConversations
|
|
981
1116
|
};
|
|
982
1117
|
}
|
|
983
|
-
function
|
|
984
|
-
const
|
|
1118
|
+
function Xe(e, r) {
|
|
1119
|
+
const t = D(), { name: o, description: n, parameters: s, handler: c, maxResultBytes: a, requiresApproval: f } = typeof e == "string" ? {
|
|
985
1120
|
name: e,
|
|
986
|
-
...
|
|
987
|
-
} : e,
|
|
988
|
-
|
|
989
|
-
const
|
|
990
|
-
return
|
|
991
|
-
description:
|
|
992
|
-
parameters:
|
|
993
|
-
maxResultBytes:
|
|
1121
|
+
...r
|
|
1122
|
+
} : e, d = _(c);
|
|
1123
|
+
d.current = c, A(() => {
|
|
1124
|
+
const g = (C) => d.current(C);
|
|
1125
|
+
return t.registerFunction(o, g, {
|
|
1126
|
+
description: n,
|
|
1127
|
+
parameters: s,
|
|
1128
|
+
maxResultBytes: a,
|
|
1129
|
+
requiresApproval: f
|
|
994
1130
|
}), () => {
|
|
995
|
-
|
|
1131
|
+
t.unregisterFunction(o);
|
|
996
1132
|
};
|
|
997
1133
|
}, [
|
|
998
|
-
|
|
999
|
-
n,
|
|
1134
|
+
t,
|
|
1000
1135
|
o,
|
|
1001
|
-
|
|
1002
|
-
|
|
1136
|
+
n,
|
|
1137
|
+
s,
|
|
1138
|
+
a,
|
|
1139
|
+
f
|
|
1003
1140
|
]);
|
|
1004
1141
|
}
|
|
1005
|
-
function
|
|
1006
|
-
const
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
}), [
|
|
1142
|
+
function Ze(e, r) {
|
|
1143
|
+
const t = D(), o = _(e);
|
|
1144
|
+
o.current = e, A(() => (t.registerNavigationFunction((n) => o.current(n), r), () => {
|
|
1145
|
+
t.unregisterNavigationFunction();
|
|
1146
|
+
}), [t, r]);
|
|
1010
1147
|
}
|
|
1011
|
-
function
|
|
1012
|
-
const
|
|
1013
|
-
|
|
1014
|
-
const
|
|
1015
|
-
const
|
|
1148
|
+
function Qe(e, r) {
|
|
1149
|
+
const t = D(), o = r?.functionName ?? "setPageState", n = r?.requiresApproval, s = _(e);
|
|
1150
|
+
s.current = e, A(() => {
|
|
1151
|
+
const c = s.current.map((a) => {
|
|
1152
|
+
const f = () => s.current.find((d) => d.name === a.name) ?? a;
|
|
1016
1153
|
return {
|
|
1017
|
-
name:
|
|
1018
|
-
description:
|
|
1019
|
-
schema:
|
|
1020
|
-
get:
|
|
1021
|
-
set: (
|
|
1154
|
+
name: a.name,
|
|
1155
|
+
description: a.description,
|
|
1156
|
+
schema: a.schema,
|
|
1157
|
+
get: a.get ? () => f().get?.() : void 0,
|
|
1158
|
+
set: (d) => f().set(d)
|
|
1022
1159
|
};
|
|
1023
1160
|
});
|
|
1024
|
-
return
|
|
1025
|
-
|
|
1161
|
+
return t.registerPageStateFunction(c, {
|
|
1162
|
+
functionName: o,
|
|
1163
|
+
requiresApproval: n
|
|
1164
|
+
}), () => {
|
|
1165
|
+
t.unregisterPageStateFunction(o);
|
|
1026
1166
|
};
|
|
1027
|
-
}, [
|
|
1167
|
+
}, [
|
|
1168
|
+
t,
|
|
1169
|
+
o,
|
|
1170
|
+
n
|
|
1171
|
+
]);
|
|
1172
|
+
}
|
|
1173
|
+
function et(e) {
|
|
1174
|
+
const r = D(), t = _(e);
|
|
1175
|
+
t.current = e, A(() => ne(r, () => t.current), [r]);
|
|
1176
|
+
}
|
|
1177
|
+
var Te = /* @__PURE__ */ new Set(["awaiting-approval"]);
|
|
1178
|
+
function J(e) {
|
|
1179
|
+
switch (e) {
|
|
1180
|
+
case "progress_indicator":
|
|
1181
|
+
return "progress";
|
|
1182
|
+
case "reasoning":
|
|
1183
|
+
return "reasoning";
|
|
1184
|
+
case "confirmation_input":
|
|
1185
|
+
return "confirmation";
|
|
1186
|
+
case "form":
|
|
1187
|
+
return "form";
|
|
1188
|
+
default:
|
|
1189
|
+
return "status";
|
|
1190
|
+
}
|
|
1191
|
+
}
|
|
1192
|
+
function Pe(e) {
|
|
1193
|
+
return e.type === "client_function" ? e.functionName === "navigateToPage" ? "navigation" : "action" : J(e.type);
|
|
1194
|
+
}
|
|
1195
|
+
function $(e, r) {
|
|
1196
|
+
const t = (e ?? "").toLowerCase();
|
|
1197
|
+
return t.includes("reject") ? "rejected" : t.includes("error") || t.includes("fail") ? "error" : t.includes("done") || t.includes("complet") ? "done" : (t.includes("waiting") || t.includes("pending")) && (r === "confirmation" || r === "form") ? "awaiting-approval" : "running";
|
|
1028
1198
|
}
|
|
1029
|
-
function
|
|
1030
|
-
|
|
1031
|
-
|
|
1199
|
+
function H(e) {
|
|
1200
|
+
return typeof e != "string" || !e ? "page" : e.replace(/[-_]+/g, " ").replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/\b\w/g, (r) => r.toUpperCase()).trim();
|
|
1201
|
+
}
|
|
1202
|
+
function We(e) {
|
|
1203
|
+
switch (e.kind) {
|
|
1204
|
+
case "navigation":
|
|
1205
|
+
return `Navigating to ${H(e.arguments?.page)}`;
|
|
1206
|
+
case "action":
|
|
1207
|
+
return e.functionName === "setPageState" ? "Updating the page" : e.functionName === "openFilteredConversations" ? "Opening conversations" : e.toolDisplayName || e.message || H(e.functionName) || "Working";
|
|
1208
|
+
case "progress":
|
|
1209
|
+
return e.message || "Working";
|
|
1210
|
+
case "reasoning":
|
|
1211
|
+
return e.message || "Thinking";
|
|
1212
|
+
case "confirmation":
|
|
1213
|
+
return e.message || "Waiting for your confirmation";
|
|
1214
|
+
case "form":
|
|
1215
|
+
return e.message || e.toolDisplayName || "Please fill in the form";
|
|
1216
|
+
default:
|
|
1217
|
+
return e.message || e.toolDisplayName || e.toolName || "Working";
|
|
1218
|
+
}
|
|
1219
|
+
}
|
|
1220
|
+
function tt(e = {}) {
|
|
1221
|
+
const { includeReasoning: r = !1, labelFor: t } = e, o = z(), n = e.client || o;
|
|
1222
|
+
if (!n) throw new q("useAgoActivity requires an AgoClient. Either pass it as options.client or wrap your app in <AgoProvider>.", "provider_missing_client");
|
|
1223
|
+
const [s, c] = E([]), a = _(/* @__PURE__ */ new Set()), f = _(void 0), d = _(t);
|
|
1224
|
+
d.current = t;
|
|
1225
|
+
const g = R((p, x) => {
|
|
1226
|
+
c((i) => {
|
|
1227
|
+
const v = i.findIndex((h) => h.id === p), u = {
|
|
1228
|
+
...v >= 0 ? i[v] : {
|
|
1229
|
+
id: p,
|
|
1230
|
+
kind: "status",
|
|
1231
|
+
label: "",
|
|
1232
|
+
status: "running",
|
|
1233
|
+
requiresApproval: !1,
|
|
1234
|
+
createdAt: /* @__PURE__ */ new Date()
|
|
1235
|
+
},
|
|
1236
|
+
...x
|
|
1237
|
+
};
|
|
1238
|
+
return u.label = d.current?.(u) ?? We(u), v >= 0 ? [
|
|
1239
|
+
...i.slice(0, v),
|
|
1240
|
+
u,
|
|
1241
|
+
...i.slice(v + 1)
|
|
1242
|
+
] : [...i, u];
|
|
1243
|
+
});
|
|
1244
|
+
}, []);
|
|
1245
|
+
A(() => {
|
|
1246
|
+
const p = (y) => {
|
|
1247
|
+
f.current = y.messageId;
|
|
1248
|
+
}, x = (y) => {
|
|
1249
|
+
const m = J(y.type);
|
|
1250
|
+
m === "reasoning" && !r || g(y.id, {
|
|
1251
|
+
kind: m,
|
|
1252
|
+
status: $(y.status, m),
|
|
1253
|
+
messageId: f.current,
|
|
1254
|
+
toolName: y.toolName,
|
|
1255
|
+
toolDisplayName: y.toolDisplayName,
|
|
1256
|
+
message: y.message,
|
|
1257
|
+
data: y.data,
|
|
1258
|
+
formSchema: y.formSchema,
|
|
1259
|
+
requiresApproval: m === "confirmation" || m === "form"
|
|
1260
|
+
});
|
|
1261
|
+
}, i = (y) => {
|
|
1262
|
+
y.invocationId && g(y.invocationId, {
|
|
1263
|
+
kind: y.functionName === "navigateToPage" ? "navigation" : "action",
|
|
1264
|
+
status: "running",
|
|
1265
|
+
messageId: f.current,
|
|
1266
|
+
functionName: y.functionName,
|
|
1267
|
+
arguments: y.arguments
|
|
1268
|
+
});
|
|
1269
|
+
}, v = (y) => {
|
|
1270
|
+
y.invocationId && g(y.invocationId, {
|
|
1271
|
+
kind: y.functionName === "navigateToPage" ? "navigation" : "action",
|
|
1272
|
+
status: "awaiting-approval",
|
|
1273
|
+
messageId: f.current,
|
|
1274
|
+
functionName: y.functionName,
|
|
1275
|
+
arguments: y.arguments,
|
|
1276
|
+
requiresApproval: !0
|
|
1277
|
+
});
|
|
1278
|
+
}, u = (y) => {
|
|
1279
|
+
if (!y.invocationId) return;
|
|
1280
|
+
const m = y.result, I = typeof y.result == "object" && m !== null && m.approved === !1 && m.reason === "user_rejected";
|
|
1281
|
+
g(y.invocationId, {
|
|
1282
|
+
status: y.error ? "error" : I ? "rejected" : "done",
|
|
1283
|
+
requiresApproval: !1
|
|
1284
|
+
});
|
|
1285
|
+
}, h = (y) => {
|
|
1286
|
+
for (const m of y.messages ?? [])
|
|
1287
|
+
if (m.role === "assistant")
|
|
1288
|
+
for (const I of m.toolCalls ?? []) {
|
|
1289
|
+
const F = Pe(I);
|
|
1290
|
+
F === "reasoning" && !r || /waiting/i.test(I.status ?? "") || g(I.id, {
|
|
1291
|
+
kind: F,
|
|
1292
|
+
status: $(I.status, F),
|
|
1293
|
+
messageId: m.id,
|
|
1294
|
+
toolName: I.toolName,
|
|
1295
|
+
toolDisplayName: I.toolDisplayName,
|
|
1296
|
+
functionName: I.functionName,
|
|
1297
|
+
arguments: I.arguments,
|
|
1298
|
+
message: I.message,
|
|
1299
|
+
data: I.data,
|
|
1300
|
+
formSchema: I.formSchema,
|
|
1301
|
+
requiresApproval: F === "confirmation" || F === "form"
|
|
1302
|
+
});
|
|
1303
|
+
}
|
|
1304
|
+
}, w = (y) => {
|
|
1305
|
+
c((m) => m.map((I) => I.status === "running" || I.status === "awaiting-approval" ? {
|
|
1306
|
+
...I,
|
|
1307
|
+
status: y
|
|
1308
|
+
} : I));
|
|
1309
|
+
}, b = () => w("done"), T = () => w("error");
|
|
1310
|
+
return n.on("message:start", p), n.on("toolCall:received", x), n.on("function:invoke", i), n.on("function:awaiting-approval", v), n.on("function:result", u), n.on("conversation:loaded", h), n.on("message:complete", b), n.on("message:error", T), () => {
|
|
1311
|
+
n.off("message:start", p), n.off("toolCall:received", x), n.off("function:invoke", i), n.off("function:awaiting-approval", v), n.off("function:result", u), n.off("conversation:loaded", h), n.off("message:complete", b), n.off("message:error", T);
|
|
1312
|
+
};
|
|
1313
|
+
}, [
|
|
1314
|
+
n,
|
|
1315
|
+
r,
|
|
1316
|
+
g
|
|
1317
|
+
]);
|
|
1318
|
+
const C = R(async (p) => {
|
|
1319
|
+
const x = s.find((i) => i.id === p);
|
|
1320
|
+
!x || x.status !== "awaiting-approval" || a.current.has(p) || x.kind !== "form" && (a.current.add(p), g(p, {
|
|
1321
|
+
status: "running",
|
|
1322
|
+
requiresApproval: !1
|
|
1323
|
+
}), x.functionName ? await n.approveFunction(p) : await n.confirmToolCall(p));
|
|
1324
|
+
}, [
|
|
1325
|
+
n,
|
|
1326
|
+
s,
|
|
1327
|
+
g
|
|
1328
|
+
]), N = R(async (p) => {
|
|
1329
|
+
const x = s.find((i) => i.id === p);
|
|
1330
|
+
!x || x.status !== "awaiting-approval" || a.current.has(p) || (a.current.add(p), g(p, {
|
|
1331
|
+
status: "rejected",
|
|
1332
|
+
requiresApproval: !1
|
|
1333
|
+
}), x.functionName ? await n.rejectFunction(p) : await n.rejectToolCall(p));
|
|
1334
|
+
}, [
|
|
1335
|
+
n,
|
|
1336
|
+
s,
|
|
1337
|
+
g
|
|
1338
|
+
]), S = R(async (p, x) => {
|
|
1339
|
+
g(p, {
|
|
1340
|
+
status: "running",
|
|
1341
|
+
requiresApproval: !1
|
|
1342
|
+
}), await n.submitToolCallForm(p, x), g(p, { status: "done" });
|
|
1343
|
+
}, [n, g]), k = R(() => {
|
|
1344
|
+
a.current.clear(), c([]);
|
|
1345
|
+
}, []);
|
|
1346
|
+
return {
|
|
1347
|
+
items: s,
|
|
1348
|
+
latest: s.length > 0 ? s[s.length - 1] : void 0,
|
|
1349
|
+
isAwaitingApproval: s.some((p) => Te.has(p.status)),
|
|
1350
|
+
approve: C,
|
|
1351
|
+
reject: N,
|
|
1352
|
+
submitForm: S,
|
|
1353
|
+
clear: k
|
|
1354
|
+
};
|
|
1032
1355
|
}
|
|
1033
|
-
function
|
|
1034
|
-
const
|
|
1035
|
-
|
|
1356
|
+
function nt(e, r) {
|
|
1357
|
+
const t = D(), o = ae(), n = r ?? o, s = _(e);
|
|
1358
|
+
s.current = e;
|
|
1036
1359
|
const c = typeof e == "function";
|
|
1037
|
-
|
|
1038
|
-
if (typeof
|
|
1039
|
-
const
|
|
1040
|
-
return
|
|
1041
|
-
|
|
1360
|
+
A(() => {
|
|
1361
|
+
if (typeof s.current == "function") {
|
|
1362
|
+
const a = () => s.current();
|
|
1363
|
+
return t.addDynamicContext(n, a), () => {
|
|
1364
|
+
t.removeDynamicContext(n);
|
|
1042
1365
|
};
|
|
1043
1366
|
}
|
|
1044
|
-
return
|
|
1045
|
-
|
|
1367
|
+
return t.setContext(n, s.current), () => {
|
|
1368
|
+
t.removeContext(n);
|
|
1046
1369
|
};
|
|
1047
1370
|
}, [
|
|
1048
|
-
|
|
1049
|
-
|
|
1371
|
+
t,
|
|
1372
|
+
n,
|
|
1050
1373
|
c,
|
|
1051
1374
|
c ? "" : JSON.stringify(e)
|
|
1052
1375
|
]);
|
|
1053
1376
|
}
|
|
1054
|
-
function
|
|
1055
|
-
return
|
|
1377
|
+
function De(e) {
|
|
1378
|
+
return se(e.subscribe, e.get, e.get);
|
|
1056
1379
|
}
|
|
1057
|
-
var
|
|
1380
|
+
var O = {
|
|
1058
1381
|
missing: [],
|
|
1059
1382
|
complete: !1
|
|
1060
1383
|
};
|
|
1061
|
-
function
|
|
1062
|
-
const
|
|
1063
|
-
|
|
1384
|
+
function rt(e) {
|
|
1385
|
+
const r = D(), t = e.schema != null, o = JSON.stringify(e.schema ?? null), n = e.submit, s = n ? typeof n == "string" ? `client:${n}` : n.via === "backend" ? "backend" : "handler" in n ? "client:handler" : `client:${n.url}` : "none", c = JSON.stringify(e.initialValues ?? null), a = W(() => t ? B(e) : null, [
|
|
1386
|
+
t,
|
|
1064
1387
|
e.name,
|
|
1065
|
-
|
|
1066
|
-
|
|
1388
|
+
o,
|
|
1389
|
+
s,
|
|
1067
1390
|
c,
|
|
1068
1391
|
e.autoSubmit
|
|
1069
|
-
]), [f,
|
|
1392
|
+
]), [f, d] = E({
|
|
1070
1393
|
collector: null,
|
|
1071
|
-
loading: !
|
|
1394
|
+
loading: !t,
|
|
1072
1395
|
error: null
|
|
1073
1396
|
});
|
|
1074
|
-
|
|
1075
|
-
if (
|
|
1076
|
-
let
|
|
1077
|
-
return
|
|
1397
|
+
A(() => {
|
|
1398
|
+
if (t) return;
|
|
1399
|
+
let v = !1;
|
|
1400
|
+
return d({
|
|
1078
1401
|
collector: null,
|
|
1079
1402
|
loading: !0,
|
|
1080
1403
|
error: null
|
|
1081
|
-
}),
|
|
1082
|
-
|
|
1083
|
-
collector:
|
|
1404
|
+
}), j(r, e).then((u) => {
|
|
1405
|
+
v || d({
|
|
1406
|
+
collector: u,
|
|
1084
1407
|
loading: !1,
|
|
1085
1408
|
error: null
|
|
1086
1409
|
});
|
|
1087
|
-
}).catch((
|
|
1088
|
-
|
|
1410
|
+
}).catch((u) => {
|
|
1411
|
+
v || d({
|
|
1089
1412
|
collector: null,
|
|
1090
1413
|
loading: !1,
|
|
1091
|
-
error:
|
|
1414
|
+
error: u instanceof Error ? u : new Error(String(u))
|
|
1092
1415
|
});
|
|
1093
1416
|
}), () => {
|
|
1094
|
-
|
|
1417
|
+
v = !0;
|
|
1095
1418
|
};
|
|
1096
1419
|
}, [
|
|
1097
|
-
t,
|
|
1098
1420
|
r,
|
|
1421
|
+
t,
|
|
1099
1422
|
e.name,
|
|
1100
|
-
|
|
1423
|
+
s,
|
|
1101
1424
|
c,
|
|
1102
1425
|
e.autoSubmit
|
|
1103
1426
|
]);
|
|
1104
|
-
const
|
|
1105
|
-
|
|
1106
|
-
if (
|
|
1107
|
-
return
|
|
1108
|
-
}, [
|
|
1109
|
-
const
|
|
1427
|
+
const g = t ? a : f.collector, C = t ? !1 : f.loading, N = t ? null : f.error;
|
|
1428
|
+
A(() => {
|
|
1429
|
+
if (g)
|
|
1430
|
+
return g.install(r);
|
|
1431
|
+
}, [r, g]);
|
|
1432
|
+
const S = W(() => X({
|
|
1110
1433
|
values: e.initialValues ?? {},
|
|
1111
1434
|
submitted: !1
|
|
1112
|
-
}), [c]),
|
|
1113
|
-
...
|
|
1114
|
-
...
|
|
1115
|
-
}), [
|
|
1435
|
+
}), [c]), k = De(g?.store ?? S), p = W(() => g?.getStatus() ?? O, [k, g]), x = W(() => ({
|
|
1436
|
+
...k,
|
|
1437
|
+
...p
|
|
1438
|
+
}), [k, p]), i = W(() => ({
|
|
1116
1439
|
name: e.name,
|
|
1117
|
-
store:
|
|
1440
|
+
store: S,
|
|
1118
1441
|
functions: [],
|
|
1119
1442
|
contextKey: `form:${e.name}`,
|
|
1120
1443
|
contextProvider: () => ({
|
|
1121
1444
|
name: `Form: ${e.name}`,
|
|
1122
1445
|
description: ""
|
|
1123
1446
|
}),
|
|
1447
|
+
definitionContextKey: `form:${e.name}:definition`,
|
|
1448
|
+
definitionContextProvider: () => ({
|
|
1449
|
+
name: `Form definition: ${e.name}`,
|
|
1450
|
+
description: "",
|
|
1451
|
+
stable: !0
|
|
1452
|
+
}),
|
|
1124
1453
|
install: () => () => {
|
|
1125
1454
|
},
|
|
1126
1455
|
hydrate: () => {
|
|
@@ -1129,41 +1458,44 @@ function Je(e) {
|
|
|
1129
1458
|
ok: !1,
|
|
1130
1459
|
error: "Form definition not loaded yet."
|
|
1131
1460
|
}),
|
|
1132
|
-
getValues: () =>
|
|
1461
|
+
getValues: () => S.get().values,
|
|
1133
1462
|
setValues: () => {
|
|
1134
1463
|
},
|
|
1135
1464
|
reset: () => {
|
|
1136
1465
|
},
|
|
1137
|
-
getStatus: () =>
|
|
1138
|
-
}), [e.name,
|
|
1466
|
+
getStatus: () => O
|
|
1467
|
+
}), [e.name, S]);
|
|
1139
1468
|
return {
|
|
1140
|
-
...
|
|
1141
|
-
state:
|
|
1142
|
-
loading:
|
|
1143
|
-
error:
|
|
1469
|
+
...g ?? i,
|
|
1470
|
+
state: x,
|
|
1471
|
+
loading: C,
|
|
1472
|
+
error: N
|
|
1144
1473
|
};
|
|
1145
1474
|
}
|
|
1146
1475
|
export {
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1476
|
+
Ve as AgoNudge,
|
|
1477
|
+
Ke as AgoProvider,
|
|
1478
|
+
de as ChatInput,
|
|
1479
|
+
Je as ChatWidget,
|
|
1480
|
+
Ae as Markdown,
|
|
1151
1481
|
Me as Message,
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1482
|
+
B as createFormCollector,
|
|
1483
|
+
qe as createMockClient,
|
|
1484
|
+
He as deriveFormStatus,
|
|
1485
|
+
j as loadFormCollector,
|
|
1486
|
+
ce as useAgo,
|
|
1487
|
+
tt as useAgoActivity,
|
|
1488
|
+
et as useAgoAutoContinueAfterNavigation,
|
|
1489
|
+
D as useAgoClient,
|
|
1490
|
+
nt as useAgoContext,
|
|
1491
|
+
Xe as useAgoFunction,
|
|
1492
|
+
Ze as useAgoNavigation,
|
|
1493
|
+
Qe as useAgoPageState,
|
|
1494
|
+
De as useAgoStore,
|
|
1495
|
+
Ye as useChat,
|
|
1496
|
+
Fe as useConversation,
|
|
1497
|
+
rt as useFormCollector,
|
|
1498
|
+
K as useMessages,
|
|
1499
|
+
z as useOptionalAgoClient,
|
|
1500
|
+
_e as useProactiveNudge
|
|
1169
1501
|
};
|