@inkeep/agents-ui 0.14.14 → 0.14.15
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.
|
@@ -1,60 +1,60 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as n, jsxs as
|
|
3
|
-
import
|
|
2
|
+
import { jsx as n, jsxs as V, Fragment as Z } from "react/jsx-runtime";
|
|
3
|
+
import Y, { memo as E, forwardRef as $, useRef as O, useState as N, useMemo as Ce, useEffect as J, useLayoutEffect as fe } from "react";
|
|
4
4
|
import * as Me from "react-dom/client";
|
|
5
|
-
import
|
|
6
|
-
import * as
|
|
7
|
-
import * as
|
|
8
|
-
import * as
|
|
9
|
-
import * as
|
|
10
|
-
import * as
|
|
5
|
+
import ee from "react-textarea-autosize";
|
|
6
|
+
import * as te from "@radix-ui/react-avatar";
|
|
7
|
+
import * as Q from "@radix-ui/react-checkbox";
|
|
8
|
+
import * as T from "@radix-ui/react-popover";
|
|
9
|
+
import * as w from "@radix-ui/react-tooltip";
|
|
10
|
+
import * as W from "@radix-ui/react-scroll-area";
|
|
11
11
|
import { ItemText as Ie, Trigger as Ee, Icon as Se, Content as ke, Viewport as Be, Item as ye, ItemIndicator as Te, Root as we, Value as He } from "../atoms/select.js";
|
|
12
|
-
import { Overlay as
|
|
12
|
+
import { Overlay as ie, Content as ae, Close as ne, Title as re, Root as oe } from "../atoms/dialog.js";
|
|
13
13
|
import Le from "../atoms/avatars/ai.js";
|
|
14
14
|
import xe from "../atoms/avatars/user.js";
|
|
15
15
|
import { CustomIcon as I } from "../atoms/icons/custom-icon.js";
|
|
16
|
-
import { BuiltInIconRenderer as
|
|
16
|
+
import { BuiltInIconRenderer as H } from "../atoms/icons/built-in-icon-renderer.js";
|
|
17
17
|
import { LinkWithQueryParams as De } from "../atoms/link.js";
|
|
18
|
-
import { Markdown as
|
|
19
|
-
import { AttachmentItemProvider as
|
|
20
|
-
import { useAttachmentsBar as
|
|
21
|
-
import { SourceItemProvider as We, useSourceItem as
|
|
18
|
+
import { Markdown as U } from "../atoms/markdown/index.js";
|
|
19
|
+
import { AttachmentItemProvider as pe, useAttachmentItem as K } from "../providers/attachment-item-provider.js";
|
|
20
|
+
import { useAttachmentsBar as k, AttachmentsBarProvider as Oe } from "../providers/attachments-bar-provider.js";
|
|
21
|
+
import { SourceItemProvider as We, useSourceItem as L } from "../providers/source-item-provider.js";
|
|
22
22
|
import { useInkeepConfig as p } from "../providers/config-provider.js";
|
|
23
|
-
import { useMessageFeedback as
|
|
24
|
-
import { MessageAttachmentsProvider as Re, useMessageAttachments as
|
|
25
|
-
import { useMessage as
|
|
26
|
-
import { CheckboxIcon as
|
|
27
|
-
import { useCopyToClipboard as
|
|
28
|
-
import { FeedbackItemProvider as Ve, useFeedbackItem as
|
|
29
|
-
import { maybeRender as
|
|
23
|
+
import { useMessageFeedback as se } from "../providers/feedback-provider.js";
|
|
24
|
+
import { MessageAttachmentsProvider as Re, useMessageAttachments as q } from "../providers/message-attachments-provider.js";
|
|
25
|
+
import { useMessage as f, MessageProvider as Ne } from "../providers/message-provider.js";
|
|
26
|
+
import { CheckboxIcon as ve } from "../atoms/icons/checkbox-icon.js";
|
|
27
|
+
import { useCopyToClipboard as X } from "../hooks/use-copy-to-clipboard.js";
|
|
28
|
+
import { FeedbackItemProvider as Ve, useFeedbackItem as ce } from "../providers/feedback-item-provider.js";
|
|
29
|
+
import { maybeRender as y, dataAttr as g, getInitials as $e, getMessageContent as ge } from "../utils/misc.js";
|
|
30
30
|
import { ikp as a } from "./factory.js";
|
|
31
31
|
import { useChat as b } from "./embedded-chat/chat-provider.js";
|
|
32
32
|
import { ChatProvider as ds } from "./embedded-chat/chat-provider.js";
|
|
33
33
|
import Qe from "./tagline-logo-icon.js";
|
|
34
34
|
import { useSettleAction as Ue } from "../hooks/use-settle-action.js";
|
|
35
35
|
import { useContainerSize as Ke } from "../hooks/use-container-size.js";
|
|
36
|
-
import { useChatAction as
|
|
36
|
+
import { useChatAction as de } from "./embedded-chat/use-chat-action.js";
|
|
37
37
|
import { useHelpMenuState as qe, HelpMenuProvider as je, useHelpMenu as ze } from "../providers/help-menu-provider.js";
|
|
38
|
-
import { useChatForm as
|
|
39
|
-
import { useFormField as
|
|
38
|
+
import { useChatForm as A } from "../providers/chat-form-provider.js";
|
|
39
|
+
import { useFormField as x, FormFieldProvider as Ge } from "../providers/form-field-provider.js";
|
|
40
40
|
import { Controller as Ye } from "react-hook-form";
|
|
41
41
|
import { highlightEmphasis as Je } from "../utils/highlight-emphasis.js";
|
|
42
42
|
import { useModal as Xe } from "./modal/modal-provider.js";
|
|
43
43
|
import { useColorModeValue as Ze } from "../../color-mode/index.js";
|
|
44
|
-
import { useComposedRefs as
|
|
44
|
+
import { useComposedRefs as me } from "../utils/compose-refs.js";
|
|
45
45
|
import { composeEventHandlers as h } from "../utils/compose-event-handlers.js";
|
|
46
46
|
import { useScrollToBottom as et } from "../hooks/use-scroll-to-bottom.js";
|
|
47
47
|
import { useDebounce as tt } from "../hooks/use-debounce.js";
|
|
48
|
-
import { HoverPopoverProvider as it, useHoverPopover as
|
|
48
|
+
import { HoverPopoverProvider as it, useHoverPopover as be } from "../providers/hover-popover-provider.js";
|
|
49
49
|
import { useWidgetAutoFocus as at } from "./modal/widget-auto-focus.js";
|
|
50
|
-
import { useBaseEvents as
|
|
50
|
+
import { useBaseEvents as le } from "../providers/base-events-provider.js";
|
|
51
51
|
import { useShadow as nt } from "../atoms/shadow/context.js";
|
|
52
52
|
import { getIcon as rt } from "../utils/get-source-icon.js";
|
|
53
|
-
import { CITATION_ARTIFACT_TYPE as
|
|
53
|
+
import { CITATION_ARTIFACT_TYPE as _e } from "../../types/message.js";
|
|
54
54
|
const ot = "__intro__", st = a("div", {
|
|
55
55
|
_id: "aiChatWrapper"
|
|
56
|
-
}), nn =
|
|
57
|
-
const { ...i } = t, { isHidden: r, isMobile: o } = b(), [s, c] = Ke(), d =
|
|
56
|
+
}), nn = $((t, e) => {
|
|
57
|
+
const { ...i } = t, { isHidden: r, isMobile: o } = b(), [s, c] = Ke(), d = me(e, s), m = c?.width ? c.width > 580 : !0, l = Xe();
|
|
58
58
|
return /* @__PURE__ */ n(
|
|
59
59
|
st,
|
|
60
60
|
{
|
|
@@ -69,7 +69,7 @@ const ot = "__intro__", st = a("div", {
|
|
|
69
69
|
}), ct = a("div", {
|
|
70
70
|
_id: "aiChatRoot"
|
|
71
71
|
}), rn = (t) => {
|
|
72
|
-
const { isHidden: e } = b(), { form: i } =
|
|
72
|
+
const { isHidden: e } = b(), { form: i } = A();
|
|
73
73
|
return i ? null : /* @__PURE__ */ n(ct, { "data-hidden": g(e), ...t });
|
|
74
74
|
}, on = a("div", {
|
|
75
75
|
_id: "aiChatHeader"
|
|
@@ -86,12 +86,12 @@ const ot = "__intro__", st = a("div", {
|
|
|
86
86
|
}
|
|
87
87
|
), mn = a("div", {
|
|
88
88
|
_id: "aiChatContent"
|
|
89
|
-
}), ln = a(
|
|
89
|
+
}), ln = a(W.Root, {
|
|
90
90
|
_id: "aiChatContentScrollArea"
|
|
91
|
-
}), mt = a(
|
|
91
|
+
}), mt = a(W.Viewport, {
|
|
92
92
|
_id: "aiChatContentScrollArea__Viewport"
|
|
93
|
-
}), hn =
|
|
94
|
-
const { containerRef: r } = et(), o =
|
|
93
|
+
}), hn = $(({ children: t, ...e }, i) => {
|
|
94
|
+
const { containerRef: r } = et(), o = me(i, r);
|
|
95
95
|
return /* @__PURE__ */ n(
|
|
96
96
|
mt,
|
|
97
97
|
{
|
|
@@ -104,28 +104,28 @@ const ot = "__intro__", st = a("div", {
|
|
|
104
104
|
}
|
|
105
105
|
);
|
|
106
106
|
}), un = a(
|
|
107
|
-
|
|
107
|
+
W.ScrollAreaScrollbar,
|
|
108
108
|
{
|
|
109
109
|
_id: "aiChatContentScrollArea__Scrollbar"
|
|
110
110
|
}
|
|
111
111
|
), Cn = a(
|
|
112
|
-
|
|
112
|
+
W.ScrollAreaThumb,
|
|
113
113
|
{
|
|
114
114
|
_id: "aiChatContentScrollArea__Thumb"
|
|
115
115
|
}
|
|
116
|
-
), pn = a(
|
|
116
|
+
), pn = a(W.Corner, {
|
|
117
117
|
_id: "aiChatContentScrollArea__Corner"
|
|
118
118
|
}), lt = a("div", {
|
|
119
119
|
_id: "aiChatMessages"
|
|
120
120
|
}), vn = (t) => {
|
|
121
121
|
const e = b(), { children: i, ...r } = t;
|
|
122
|
-
return /* @__PURE__ */ n(lt, { children:
|
|
122
|
+
return /* @__PURE__ */ n(lt, { children: y(i, e), ...r });
|
|
123
123
|
}, ht = a("div", {
|
|
124
124
|
_id: "aiChatDisclaimer"
|
|
125
125
|
}), gn = E(
|
|
126
126
|
(t) => {
|
|
127
|
-
const { aiChatSettings: e } = p(), [i, r] =
|
|
128
|
-
return e.disclaimerSettings?.isEnabled ? /* @__PURE__ */ n(it, { open: i, setOpen: r, children: /* @__PURE__ */ n(
|
|
127
|
+
const { aiChatSettings: e } = p(), [i, r] = N(!1), o = tt(i, 100);
|
|
128
|
+
return e.disclaimerSettings?.isEnabled ? /* @__PURE__ */ n(it, { open: i, setOpen: r, children: /* @__PURE__ */ n(T.Root, { open: o, onOpenChange: r, children: /* @__PURE__ */ n(ht, { ...t }) }) }) : null;
|
|
129
129
|
}
|
|
130
130
|
), ut = a("span", {
|
|
131
131
|
_id: "aiChatDisclaimerLabel"
|
|
@@ -134,12 +134,12 @@ const ot = "__intro__", st = a("div", {
|
|
|
134
134
|
const { aiChatSettings: e } = p(), i = e.disclaimerSettings;
|
|
135
135
|
return /* @__PURE__ */ n(ut, { children: i?.label, ...t });
|
|
136
136
|
}
|
|
137
|
-
), Ct = a(
|
|
137
|
+
), Ct = a(T.Trigger, {
|
|
138
138
|
_id: "aiChatDisclaimerTrigger",
|
|
139
139
|
children: /* @__PURE__ */ n(I, { iconKey: "info" })
|
|
140
140
|
}), _n = E(
|
|
141
141
|
(t) => {
|
|
142
|
-
const { setOpen: e } =
|
|
142
|
+
const { setOpen: e } = be();
|
|
143
143
|
return /* @__PURE__ */ n(
|
|
144
144
|
Ct,
|
|
145
145
|
{
|
|
@@ -149,10 +149,10 @@ const ot = "__intro__", st = a("div", {
|
|
|
149
149
|
}
|
|
150
150
|
);
|
|
151
151
|
}
|
|
152
|
-
), pt = a(
|
|
152
|
+
), pt = a(T.Content, {
|
|
153
153
|
_id: "aiChatDisclaimerContent"
|
|
154
154
|
}), An = (t) => {
|
|
155
|
-
const { setOpen: e } =
|
|
155
|
+
const { setOpen: e } = be();
|
|
156
156
|
return /* @__PURE__ */ n(
|
|
157
157
|
pt,
|
|
158
158
|
{
|
|
@@ -165,14 +165,14 @@ const ot = "__intro__", st = a("div", {
|
|
|
165
165
|
...t
|
|
166
166
|
}
|
|
167
167
|
);
|
|
168
|
-
}, vt = a(
|
|
168
|
+
}, vt = a(U, {
|
|
169
169
|
_id: "aiChatDisclaimerText"
|
|
170
170
|
}), Pn = E(
|
|
171
171
|
(t) => {
|
|
172
172
|
const { aiChatSettings: e } = p(), i = e.aiAssistantName, o = e.disclaimerSettings?.tooltip || `Information provided by ${i || "this AI assistant"} is not guaranteed to be accurate or comprehensive.`;
|
|
173
173
|
return /* @__PURE__ */ n(vt, { shouldOpenLinksInNewTab: !0, children: o, ...t });
|
|
174
174
|
}
|
|
175
|
-
), Fn = a(
|
|
175
|
+
), Fn = a(T.Arrow, {
|
|
176
176
|
_id: "aiChatDisclaimerArrow"
|
|
177
177
|
}), gt = a("div", {
|
|
178
178
|
_id: "aiChatExampleQuestions"
|
|
@@ -191,11 +191,11 @@ const ot = "__intro__", st = a("div", {
|
|
|
191
191
|
}), In = E(
|
|
192
192
|
(t) => {
|
|
193
193
|
const { aiChatSettings: e } = p(), i = e.exampleQuestions, { children: r, ...o } = t;
|
|
194
|
-
return /* @__PURE__ */ n(_t, { children:
|
|
194
|
+
return /* @__PURE__ */ n(_t, { children: y(r, i), ...o });
|
|
195
195
|
}
|
|
196
196
|
), At = a("div", {
|
|
197
197
|
_id: "aiChatExampleQuestion"
|
|
198
|
-
}), En =
|
|
198
|
+
}), En = $((t, e) => {
|
|
199
199
|
const { aiChatSettings: i } = p(), r = i.isFirstExampleQuestionHighlighted;
|
|
200
200
|
return /* @__PURE__ */ n(At, { ref: e, "data-highlight": g(r), ...t });
|
|
201
201
|
}), Pt = a("button", {
|
|
@@ -225,7 +225,7 @@ const ot = "__intro__", st = a("div", {
|
|
|
225
225
|
}), yn = E(
|
|
226
226
|
(t) => {
|
|
227
227
|
const { aiChatSettings: e } = p(), i = e.workflows, { children: r, ...o } = t;
|
|
228
|
-
return /* @__PURE__ */ n(Mt, { children:
|
|
228
|
+
return /* @__PURE__ */ n(Mt, { children: y(r, i), ...o });
|
|
229
229
|
}
|
|
230
230
|
), It = a("button", {
|
|
231
231
|
_id: "aiChatWorkflow"
|
|
@@ -262,7 +262,7 @@ const ot = "__intro__", st = a("div", {
|
|
|
262
262
|
), kt = a("div", {
|
|
263
263
|
_id: "aiChatMessageHeader"
|
|
264
264
|
}), Hn = (t) => {
|
|
265
|
-
const { message: e } =
|
|
265
|
+
const { message: e } = f();
|
|
266
266
|
return /* @__PURE__ */ n(kt, { "data-role": e.role, ...t });
|
|
267
267
|
}, Bt = a("div", {
|
|
268
268
|
_id: "aiChatMessageLoading",
|
|
@@ -270,12 +270,12 @@ const ot = "__intro__", st = a("div", {
|
|
|
270
270
|
}), Ln = (t) => /* @__PURE__ */ n(Bt, { ...t }), yt = a("div", {
|
|
271
271
|
_id: "aiChatMessageAvatar"
|
|
272
272
|
}), xn = (t) => {
|
|
273
|
-
const { message: e } =
|
|
273
|
+
const { message: e } = f();
|
|
274
274
|
return /* @__PURE__ */ n(yt, { "data-role": e.role, ...t });
|
|
275
|
-
}, Tt = a(
|
|
275
|
+
}, Tt = a(te.Root, {
|
|
276
276
|
_id: "aiChatMessageAvatarContent"
|
|
277
277
|
}), Dn = (t) => {
|
|
278
|
-
const { message: e } =
|
|
278
|
+
const { message: e } = f(), { baseSettings: i } = p();
|
|
279
279
|
return /* @__PURE__ */ n(
|
|
280
280
|
Tt,
|
|
281
281
|
{
|
|
@@ -284,11 +284,11 @@ const ot = "__intro__", st = a("div", {
|
|
|
284
284
|
...t
|
|
285
285
|
}
|
|
286
286
|
);
|
|
287
|
-
}, wt = a(
|
|
287
|
+
}, wt = a(te.Fallback, {
|
|
288
288
|
_id: "aiChatMessageAvatarFallback"
|
|
289
289
|
}), On = E(
|
|
290
290
|
(t) => {
|
|
291
|
-
const { baseSettings: e } = p(), { message: i } =
|
|
291
|
+
const { baseSettings: e } = p(), { message: i } = f();
|
|
292
292
|
return e.userProperties.name ? /* @__PURE__ */ n(
|
|
293
293
|
wt,
|
|
294
294
|
{
|
|
@@ -298,15 +298,15 @@ const ot = "__intro__", st = a("div", {
|
|
|
298
298
|
}
|
|
299
299
|
) : null;
|
|
300
300
|
}
|
|
301
|
-
), ue = a(
|
|
301
|
+
), ue = a(te.Image, {
|
|
302
302
|
_id: "aiChatMessageAvatarImage"
|
|
303
303
|
}), Wn = E(
|
|
304
304
|
(t) => {
|
|
305
305
|
const { onLoadingStatusChange: e, ...i } = t, {
|
|
306
306
|
aiChatSettings: r,
|
|
307
307
|
baseSettings: { userProperties: o }
|
|
308
|
-
} = p(), { message: s } =
|
|
309
|
-
|
|
308
|
+
} = p(), { message: s } = f(), { aiAssistantAvatar: c } = r ?? {}, d = typeof c == "string" ? c : c?.light, m = (typeof c == "string" ? c : c?.dark) ?? d, l = Ze(d, m), [C, v] = N(l);
|
|
309
|
+
J(() => {
|
|
310
310
|
v(l);
|
|
311
311
|
}, [l]);
|
|
312
312
|
const u = (_) => {
|
|
@@ -353,7 +353,7 @@ const ot = "__intro__", st = a("div", {
|
|
|
353
353
|
), Ht = a("span", {
|
|
354
354
|
_id: "aiChatMessageName"
|
|
355
355
|
}), Rn = (t) => {
|
|
356
|
-
const { message: e } =
|
|
356
|
+
const { message: e } = f();
|
|
357
357
|
return /* @__PURE__ */ n(
|
|
358
358
|
Ht,
|
|
359
359
|
{
|
|
@@ -365,7 +365,7 @@ const ot = "__intro__", st = a("div", {
|
|
|
365
365
|
}, Lt = a("div", {
|
|
366
366
|
_id: "aiChatMessageContentWrapper"
|
|
367
367
|
}), Nn = (t) => {
|
|
368
|
-
const { message: e } =
|
|
368
|
+
const { message: e } = f(), { messageButtons: i } = b(), r = i[e.id] || [];
|
|
369
369
|
return /* @__PURE__ */ n(
|
|
370
370
|
Lt,
|
|
371
371
|
{
|
|
@@ -377,23 +377,23 @@ const ot = "__intro__", st = a("div", {
|
|
|
377
377
|
}, xt = a("div", {
|
|
378
378
|
_id: "aiChatMessageContent"
|
|
379
379
|
}), Vn = (t) => {
|
|
380
|
-
const { message: e } =
|
|
380
|
+
const { message: e } = f();
|
|
381
381
|
return /* @__PURE__ */ n(xt, { "data-role": e.role, ...t });
|
|
382
382
|
}, Dt = a("div", {
|
|
383
383
|
_id: "aiChatMessageAttachments"
|
|
384
384
|
}), $n = (t) => {
|
|
385
|
-
const { message: e } =
|
|
385
|
+
const { message: e } = f(), i = [];
|
|
386
386
|
return e.role !== "user" || !i?.length ? null : /* @__PURE__ */ n(Re, { children: /* @__PURE__ */ n(Dt, { ...t }) });
|
|
387
387
|
}, Ot = a("div", {
|
|
388
388
|
_id: "aiChatMessageAttachments__List"
|
|
389
389
|
}), Qn = (t) => {
|
|
390
390
|
const { children: e, ...i } = t, r = [];
|
|
391
|
-
return r ? /* @__PURE__ */ n(Ot, { children:
|
|
391
|
+
return r ? /* @__PURE__ */ n(Ot, { children: y(e, r), ...i }) : null;
|
|
392
392
|
}, Wt = a("div", {
|
|
393
393
|
_id: "aiChatMessageAttachments__Item"
|
|
394
394
|
}), Un = (t) => {
|
|
395
|
-
const { attachment: e, onClick: i, ...r } = t, { selectItem: o, onOpen: s } =
|
|
396
|
-
return /* @__PURE__ */ n(
|
|
395
|
+
const { attachment: e, onClick: i, ...r } = t, { selectItem: o, onOpen: s } = q();
|
|
396
|
+
return /* @__PURE__ */ n(pe, { attachment: e, children: /* @__PURE__ */ n(
|
|
397
397
|
Wt,
|
|
398
398
|
{
|
|
399
399
|
onClick: h(i, () => {
|
|
@@ -402,20 +402,20 @@ const ot = "__intro__", st = a("div", {
|
|
|
402
402
|
...r
|
|
403
403
|
}
|
|
404
404
|
) });
|
|
405
|
-
}, Rt = a(
|
|
405
|
+
}, Rt = a(H, {
|
|
406
406
|
_id: "aiChatMessageAttachments__ItemIcon"
|
|
407
407
|
}), Kn = (t) => {
|
|
408
|
-
const { attachment: e } =
|
|
408
|
+
const { attachment: e } = K(), i = e.contentType?.attachmentIcon;
|
|
409
409
|
return i ? /* @__PURE__ */ n(Rt, { iconSettings: i, ...t }) : null;
|
|
410
410
|
}, Nt = a("span", {
|
|
411
411
|
_id: "aiChatMessageAttachments__ItemTitle"
|
|
412
412
|
}), qn = (t) => {
|
|
413
|
-
const { attachment: e } =
|
|
413
|
+
const { attachment: e } = K();
|
|
414
414
|
return /* @__PURE__ */ n(Nt, { children: e.title, ...t });
|
|
415
|
-
}, Vt = a(
|
|
415
|
+
}, Vt = a(oe, {
|
|
416
416
|
_id: "aiChatMessageAttachmentsPreview"
|
|
417
417
|
}), jn = (t) => {
|
|
418
|
-
const { onOpenChange: e, ...i } = t, { selectItem: r, isOpen: o, onClose: s, selectedItem: c } =
|
|
418
|
+
const { onOpenChange: e, ...i } = t, { selectItem: r, isOpen: o, onClose: s, selectedItem: c } = q();
|
|
419
419
|
return /* @__PURE__ */ n(
|
|
420
420
|
Vt,
|
|
421
421
|
{
|
|
@@ -426,15 +426,15 @@ const ot = "__intro__", st = a("div", {
|
|
|
426
426
|
...i
|
|
427
427
|
}
|
|
428
428
|
);
|
|
429
|
-
}, zn = a(
|
|
429
|
+
}, zn = a(ie, {
|
|
430
430
|
_id: "aiChatMessageAttachmentsPreview__Overlay"
|
|
431
|
-
}), Gn = a(
|
|
431
|
+
}), Gn = a(ae, {
|
|
432
432
|
_id: "aiChatMessageAttachmentsPreview__Content",
|
|
433
433
|
"aria-describedby": void 0
|
|
434
|
-
}), $t = a(
|
|
434
|
+
}), $t = a(re, {
|
|
435
435
|
_id: "aiChatMessageAttachmentsPreview__Header"
|
|
436
436
|
}), Yn = (t) => {
|
|
437
|
-
const { selectedItem: e } =
|
|
437
|
+
const { selectedItem: e } = q();
|
|
438
438
|
return /* @__PURE__ */ n(
|
|
439
439
|
$t,
|
|
440
440
|
{
|
|
@@ -442,18 +442,18 @@ const ot = "__intro__", st = a("div", {
|
|
|
442
442
|
...t
|
|
443
443
|
}
|
|
444
444
|
);
|
|
445
|
-
}, Jn = a(
|
|
445
|
+
}, Jn = a(ne, {
|
|
446
446
|
_id: "aiChatMessageAttachmentsPreview__Close",
|
|
447
447
|
children: /* @__PURE__ */ n(I, { iconKey: "close" })
|
|
448
448
|
}), Qt = a("p", {
|
|
449
449
|
_id: "aiChatMessageAttachmentsPreview__Body"
|
|
450
450
|
}), Xn = (t) => {
|
|
451
|
-
const { selectedItem: e } =
|
|
451
|
+
const { selectedItem: e } = q();
|
|
452
452
|
return /* @__PURE__ */ n(Qt, { children: e?.content, ...t });
|
|
453
453
|
}, Zn = (t) => {
|
|
454
454
|
const { text: e, componentStyles: i, ...r } = t, { aiChatSettings: o } = p(), { shouldOpenLinksInNewTab: s } = o;
|
|
455
455
|
return /* @__PURE__ */ n(
|
|
456
|
-
|
|
456
|
+
U,
|
|
457
457
|
{
|
|
458
458
|
children: e,
|
|
459
459
|
componentStyles: i,
|
|
@@ -466,56 +466,60 @@ const ot = "__intro__", st = a("div", {
|
|
|
466
466
|
props: e,
|
|
467
467
|
componentDef: i
|
|
468
468
|
}) => {
|
|
469
|
-
const o = nt()?.shadowHost, s = O(void 0), c = O(null), d = O(null), m = O(!1), [l, C] =
|
|
470
|
-
|
|
469
|
+
const o = nt()?.shadowHost, s = O(void 0), c = O(null), d = O(null), m = O(!1), [l, C] = N(!1), [v, u] = N(!1), _ = O(i);
|
|
470
|
+
Ce(() => {
|
|
471
|
+
i !== _.current && (typeof i == "function" && typeof _.current == "function" ? i.toString() !== _.current.toString() && (_.current = i) : _.current = i);
|
|
472
|
+
}, [i]);
|
|
473
|
+
const B = _.current;
|
|
474
|
+
return J(() => {
|
|
471
475
|
s.current || (s.current = `dyn:${t}:${crypto.randomUUID()}`, C(!0));
|
|
472
|
-
}, [t]),
|
|
473
|
-
if (!
|
|
476
|
+
}, [t]), fe(() => {
|
|
477
|
+
if (!B || !o || !l || !s.current)
|
|
474
478
|
return;
|
|
475
|
-
const
|
|
476
|
-
return F.setAttribute("data-ikp-component", ""), F.setAttribute("data-component", t), F.setAttribute("slot",
|
|
479
|
+
const P = s.current, F = document.createElement("div");
|
|
480
|
+
return F.setAttribute("data-ikp-component", ""), F.setAttribute("data-component", t), F.setAttribute("slot", P), c.current = F, m.current = !1, o.appendChild(F), u(!0), () => {
|
|
477
481
|
m.current = !0, u(!1), queueMicrotask(() => {
|
|
478
482
|
try {
|
|
479
483
|
d.current && (d.current.unmount(), d.current = null);
|
|
480
|
-
} catch (
|
|
481
|
-
console.debug("Ignoring unmount error:",
|
|
484
|
+
} catch (M) {
|
|
485
|
+
console.debug("Ignoring unmount error:", M);
|
|
482
486
|
}
|
|
483
487
|
F.parentNode === o && F.remove(), c.current = null;
|
|
484
488
|
});
|
|
485
489
|
};
|
|
486
|
-
}, [
|
|
487
|
-
const
|
|
488
|
-
if (!
|
|
489
|
-
const F = (
|
|
490
|
-
if (typeof
|
|
490
|
+
}, [B, o, l, t]), J(() => {
|
|
491
|
+
const P = c.current;
|
|
492
|
+
if (!P || m.current) return;
|
|
493
|
+
const F = (S) => {
|
|
494
|
+
if (typeof S != "function" || S.length > 1) return !1;
|
|
491
495
|
try {
|
|
492
|
-
if (typeof
|
|
493
|
-
const
|
|
494
|
-
return
|
|
496
|
+
if (typeof S == "function" && S.constructor === Function) {
|
|
497
|
+
const D = S({});
|
|
498
|
+
return Y.isValidElement(D);
|
|
495
499
|
}
|
|
496
500
|
return !1;
|
|
497
501
|
} catch {
|
|
498
502
|
return !0;
|
|
499
503
|
}
|
|
500
504
|
};
|
|
501
|
-
let
|
|
502
|
-
if (F(
|
|
505
|
+
let M;
|
|
506
|
+
if (F(B))
|
|
503
507
|
try {
|
|
504
|
-
const
|
|
505
|
-
|
|
506
|
-
} catch (
|
|
507
|
-
console.error("Error creating React element from component:",
|
|
508
|
+
const S = B;
|
|
509
|
+
M = Y.createElement(S, e || {});
|
|
510
|
+
} catch (S) {
|
|
511
|
+
console.error("Error creating React element from component:", S);
|
|
508
512
|
return;
|
|
509
513
|
}
|
|
510
|
-
else if (typeof
|
|
511
|
-
|
|
514
|
+
else if (typeof B == "function")
|
|
515
|
+
M = B(e || {}, P, null);
|
|
512
516
|
else {
|
|
513
517
|
console.error("Invalid component definition");
|
|
514
518
|
return;
|
|
515
519
|
}
|
|
516
|
-
if (
|
|
520
|
+
if (Y.isValidElement(M) || typeof M == "string") {
|
|
517
521
|
if (m.current) return;
|
|
518
|
-
d.current || (d.current = Me.createRoot(
|
|
522
|
+
d.current || (d.current = Me.createRoot(P)), !m.current && d.current && d.current.render(M);
|
|
519
523
|
return;
|
|
520
524
|
}
|
|
521
525
|
d.current && !m.current && d.current.render(null);
|
|
@@ -525,19 +529,19 @@ const ot = "__intro__", st = a("div", {
|
|
|
525
529
|
}), Ut = a("div", {
|
|
526
530
|
_id: "aiChatMessageToolbar"
|
|
527
531
|
}), ir = (t) => {
|
|
528
|
-
const { isLoading: e, messages: i } = b(), { message: r } =
|
|
532
|
+
const { isLoading: e, messages: i } = b(), { message: r } = f();
|
|
529
533
|
return i.at(-1)?.id === r?.id && e || r.role === "user" ? null : /* @__PURE__ */ n(Ut, { ...t });
|
|
530
534
|
}, Kt = a("div", {
|
|
531
535
|
_id: "aiChatMessageAnnotationActions"
|
|
532
536
|
}), ar = (t) => {
|
|
533
|
-
const { children: e, ...i } = t, { message: r } =
|
|
534
|
-
return /* @__PURE__ */ n(Kt, { children:
|
|
537
|
+
const { children: e, ...i } = t, { message: r } = f(), { messageButtons: o } = b(), s = o[r.id] || [];
|
|
538
|
+
return /* @__PURE__ */ n(Kt, { children: y(e, s), ...i });
|
|
535
539
|
}, qt = a("a", {
|
|
536
540
|
_id: "aiChatMessageAnnotationAction"
|
|
537
541
|
}), jt = a("button", {
|
|
538
542
|
_id: "aiChatMessageAnnotationAction"
|
|
539
543
|
}), nr = (t) => {
|
|
540
|
-
const { onClick: e, action: i, ...r } = t, { handleAction: o } =
|
|
544
|
+
const { onClick: e, action: i, ...r } = t, { handleAction: o } = de(i), { logEvent: s } = le(), { conversationId: c } = b(), d = () => {
|
|
541
545
|
o(), s({
|
|
542
546
|
eventName: "user_escalation_indicated",
|
|
543
547
|
properties: {
|
|
@@ -545,8 +549,8 @@ const ot = "__intro__", st = a("div", {
|
|
|
545
549
|
conversationId: c
|
|
546
550
|
}
|
|
547
551
|
});
|
|
548
|
-
}, m = i.label || "Contact Support", l = /* @__PURE__ */
|
|
549
|
-
i.icon && /* @__PURE__ */ n(
|
|
552
|
+
}, m = i.label || "Contact Support", l = /* @__PURE__ */ V(Z, { children: [
|
|
553
|
+
i.icon && /* @__PURE__ */ n(H, { iconSettings: i.icon }),
|
|
550
554
|
m
|
|
551
555
|
] });
|
|
552
556
|
return i.action.type === "open_link" ? /* @__PURE__ */ n(
|
|
@@ -574,11 +578,11 @@ const ot = "__intro__", st = a("div", {
|
|
|
574
578
|
}), rr = (t) => {
|
|
575
579
|
const { action: e, onClick: i, className: r, ...o } = t, { conversationId: s } = b(), {
|
|
576
580
|
baseSettings: { onFeedback: c }
|
|
577
|
-
} = p(), { message: d } =
|
|
578
|
-
if (
|
|
579
|
-
const
|
|
581
|
+
} = p(), { message: d } = f(), { isStreaming: m, messages: l } = b(), [C, v] = X(), { feedback: u, submitPositiveFeedback: _, setCurrentFeedback: B, currentFeedback: P } = se(), { logEvent: F } = le(), [M, S] = Ue(), D = l.at(-1)?.id === d?.id, j = d.role === "assistant";
|
|
582
|
+
if (D && m || !j) return null;
|
|
583
|
+
const R = {
|
|
580
584
|
copy() {
|
|
581
|
-
v(
|
|
585
|
+
v(ge(d)), F({
|
|
582
586
|
eventName: "assistant_message_copied",
|
|
583
587
|
properties: {
|
|
584
588
|
conversationId: s
|
|
@@ -587,28 +591,28 @@ const ot = "__intro__", st = a("div", {
|
|
|
587
591
|
},
|
|
588
592
|
upvote() {
|
|
589
593
|
_(d.id).then(() => {
|
|
590
|
-
|
|
594
|
+
S();
|
|
591
595
|
});
|
|
592
596
|
},
|
|
593
597
|
downvote() {
|
|
594
|
-
|
|
598
|
+
B(d.id);
|
|
595
599
|
}
|
|
596
|
-
},
|
|
600
|
+
}, z = {
|
|
597
601
|
copy: "Copy Message",
|
|
598
602
|
upvote: "Upvote Message",
|
|
599
603
|
downvote: "Downvote Message"
|
|
600
|
-
},
|
|
604
|
+
}, G = {
|
|
601
605
|
copy: /* @__PURE__ */ n(I, { iconKey: C ? "messageCopied" : "messageCopy" }),
|
|
602
|
-
upvote: /* @__PURE__ */ n(I, { iconKey:
|
|
606
|
+
upvote: /* @__PURE__ */ n(I, { iconKey: M ? "messageCopied" : "thumbsUp" }),
|
|
603
607
|
downvote: /* @__PURE__ */ n(I, { iconKey: "thumbsDown" })
|
|
604
|
-
},
|
|
608
|
+
}, Fe = {
|
|
605
609
|
copy: { "data-copied": g(C) },
|
|
606
610
|
upvote: {
|
|
607
611
|
"data-upvoted": g(u[d.id]?.type === "positive")
|
|
608
612
|
},
|
|
609
613
|
downvote: {
|
|
610
614
|
"data-downvoted": g(u[d.id]?.type === "negative"),
|
|
611
|
-
"data-state":
|
|
615
|
+
"data-state": P === null ? "closed" : "open"
|
|
612
616
|
}
|
|
613
617
|
};
|
|
614
618
|
return {
|
|
@@ -619,34 +623,34 @@ const ot = "__intro__", st = a("div", {
|
|
|
619
623
|
zt,
|
|
620
624
|
{
|
|
621
625
|
"data-action": e,
|
|
622
|
-
...
|
|
623
|
-
children:
|
|
624
|
-
"aria-label":
|
|
626
|
+
...Fe[e],
|
|
627
|
+
children: G[e],
|
|
628
|
+
"aria-label": z[e],
|
|
625
629
|
className: `${r} ${e}`,
|
|
626
|
-
onClick: h(i,
|
|
630
|
+
onClick: h(i, R[e]),
|
|
627
631
|
...o
|
|
628
632
|
}
|
|
629
633
|
);
|
|
630
634
|
}, Gt = a("div", {
|
|
631
635
|
_id: "aiChatMessageSources"
|
|
632
636
|
}), or = (t) => {
|
|
633
|
-
const { message: e } =
|
|
637
|
+
const { message: e } = f();
|
|
634
638
|
return e.role !== "assistant" || !e.parts.filter(
|
|
635
|
-
(r) => r.type === "data-artifact" && r.data?.type?.toLowerCase() ===
|
|
639
|
+
(r) => r.type === "data-artifact" && r.data?.type?.toLowerCase() === _e
|
|
636
640
|
)?.length ? null : /* @__PURE__ */ n(Gt, { ...t });
|
|
637
641
|
}, Yt = a("div", {
|
|
638
642
|
_id: "aiChatMessageSources__Header"
|
|
639
643
|
}), sr = (t) => /* @__PURE__ */ n(Yt, { children: "Sources", ...t }), Jt = a("div", {
|
|
640
644
|
_id: "aiChatMessageSources__List"
|
|
641
645
|
}), cr = (t) => {
|
|
642
|
-
const { message: e } =
|
|
646
|
+
const { message: e } = f(), { children: i, ...r } = t, {
|
|
643
647
|
baseSettings: { transformSource: o, organizationDisplayName: s },
|
|
644
648
|
aiChatSettings: { shouldOpenLinksInNewTab: c },
|
|
645
649
|
searchSettings: { tabs: d }
|
|
646
650
|
} = p();
|
|
647
651
|
if (e.role !== "assistant") return null;
|
|
648
652
|
const m = e.parts.filter(
|
|
649
|
-
(v) => v.type === "data-artifact" && v.data?.type?.toLowerCase() ===
|
|
653
|
+
(v) => v.type === "data-artifact" && v.data?.type?.toLowerCase() === _e
|
|
650
654
|
);
|
|
651
655
|
if (!m?.length) return null;
|
|
652
656
|
const l = /* @__PURE__ */ new Map(), C = m.filter((v) => {
|
|
@@ -662,21 +666,21 @@ const ot = "__intro__", st = a("div", {
|
|
|
662
666
|
type: u?.artifactSummary?.record_type,
|
|
663
667
|
contentType: u?.artifactType,
|
|
664
668
|
tag: u?.artifactType
|
|
665
|
-
},
|
|
666
|
-
...
|
|
669
|
+
}, P = (o ?? ((M) => ({
|
|
670
|
+
...M,
|
|
667
671
|
shouldOpenInNewTab: c,
|
|
668
|
-
icon: rt(
|
|
672
|
+
icon: rt(M)
|
|
669
673
|
})))(_, "chatSourceItem", {
|
|
670
674
|
organizationDisplayName: s,
|
|
671
675
|
tabs: d
|
|
672
|
-
}),
|
|
673
|
-
return { ...
|
|
676
|
+
}), F = P.shouldOpenInNewTab !== void 0 ? P.shouldOpenInNewTab : c;
|
|
677
|
+
return { ...P, isExternal: F };
|
|
674
678
|
});
|
|
675
|
-
return /* @__PURE__ */ n(Jt, { children:
|
|
679
|
+
return /* @__PURE__ */ n(Jt, { children: y(i, C), ...r });
|
|
676
680
|
}, Xt = a(De, {
|
|
677
681
|
_id: "aiChatMessageSourceItem"
|
|
678
682
|
}), dr = (t) => {
|
|
679
|
-
const { source: e, onClick: i, ...r } = t, { logEvent: o } =
|
|
683
|
+
const { source: e, onClick: i, ...r } = t, { logEvent: o } = le(), { conversationId: s } = b(), c = () => {
|
|
680
684
|
o({
|
|
681
685
|
eventName: "assistant_source_item_clicked",
|
|
682
686
|
properties: {
|
|
@@ -699,42 +703,42 @@ const ot = "__intro__", st = a("div", {
|
|
|
699
703
|
}, Zt = a("div", {
|
|
700
704
|
_id: "aiChatMessageSourceItem__Breadcrumbs"
|
|
701
705
|
}), mr = (t) => {
|
|
702
|
-
const { source: e } =
|
|
706
|
+
const { source: e } = L();
|
|
703
707
|
return e.breadcrumbs?.length ? /* @__PURE__ */ n(Zt, { "data-type": e.type, ...t }) : null;
|
|
704
708
|
}, lr = a(I, {
|
|
705
709
|
_id: "aiChatMessageSourceItem__BreadcrumbIcon",
|
|
706
710
|
iconKey: "breadcrumbSeparator"
|
|
707
|
-
}), ei = a(
|
|
711
|
+
}), ei = a(H, {
|
|
708
712
|
_id: "aiChatMessageSourceItem__Icon"
|
|
709
713
|
}), hr = (t) => {
|
|
710
|
-
const { source: e } =
|
|
714
|
+
const { source: e } = L();
|
|
711
715
|
return /* @__PURE__ */ n(ei, { iconSettings: e.icon, "data-type": e.type, ...t });
|
|
712
716
|
}, ti = a("span", {
|
|
713
717
|
_id: "aiChatMessageSourceItem__Title"
|
|
714
718
|
}), ur = (t) => {
|
|
715
|
-
const { source: e } =
|
|
719
|
+
const { source: e } = L();
|
|
716
720
|
return /* @__PURE__ */ n(ti, { "data-type": e.type, children: e.title, ...t });
|
|
717
721
|
}, ii = a("span", {
|
|
718
722
|
_id: "aiChatMessageSourceItem__Tag"
|
|
719
723
|
}), Cr = (t) => {
|
|
720
|
-
const { source: e } =
|
|
724
|
+
const { source: e } = L();
|
|
721
725
|
return /* @__PURE__ */ n(ii, { "data-type": e.type, ...t });
|
|
722
726
|
}, ai = a("span", {
|
|
723
727
|
_id: "aiChatMessageSourceItem__Description"
|
|
724
728
|
}), pr = (t) => {
|
|
725
|
-
const { source: e } =
|
|
729
|
+
const { source: e } = L(), { children: i, ...r } = t, o = Ce(() => e.description ? Je(e.description) : [], [e.description]);
|
|
726
730
|
return o.length ? /* @__PURE__ */ n(
|
|
727
731
|
ai,
|
|
728
732
|
{
|
|
729
733
|
"data-type": e.type,
|
|
730
|
-
children:
|
|
734
|
+
children: y(i, o),
|
|
731
735
|
...r
|
|
732
736
|
}
|
|
733
737
|
) : null;
|
|
734
738
|
}, ni = a("span", {
|
|
735
739
|
_id: "aiChatMessageSourceItem__DescriptionPart"
|
|
736
740
|
}), vr = (t) => {
|
|
737
|
-
const { part: e, ...i } = t, { source: r } =
|
|
741
|
+
const { part: e, ...i } = t, { source: r } = L();
|
|
738
742
|
return typeof e == "string" ? e : /* @__PURE__ */ n(
|
|
739
743
|
ni,
|
|
740
744
|
{
|
|
@@ -747,7 +751,7 @@ const ot = "__intro__", st = a("div", {
|
|
|
747
751
|
}, ri = a(I, {
|
|
748
752
|
_id: "aiChatMessageSourceItem__Indicator"
|
|
749
753
|
}), gr = (t) => {
|
|
750
|
-
const { source: e } =
|
|
754
|
+
const { source: e } = L();
|
|
751
755
|
return /* @__PURE__ */ n(
|
|
752
756
|
ri,
|
|
753
757
|
{
|
|
@@ -763,8 +767,8 @@ const ot = "__intro__", st = a("div", {
|
|
|
763
767
|
_id: "aiChatInput__Group"
|
|
764
768
|
}), oi = a("textarea", {
|
|
765
769
|
_id: "aiChatInput"
|
|
766
|
-
}), Pr =
|
|
767
|
-
const { handleInputChange: o, handleInputKeyDown: s, input: c, error: d, shouldAutoFocusInput: m, inputRef: l } = b(), { aiChatSettings: C } = p(), v =
|
|
770
|
+
}), Pr = $(({ onChange: t, onKeyDown: e, ...i }, r) => {
|
|
771
|
+
const { handleInputChange: o, handleInputKeyDown: s, input: c, error: d, shouldAutoFocusInput: m, inputRef: l } = b(), { aiChatSettings: C } = p(), v = me(
|
|
768
772
|
r,
|
|
769
773
|
l
|
|
770
774
|
);
|
|
@@ -780,7 +784,7 @@ const ot = "__intro__", st = a("div", {
|
|
|
780
784
|
onKeyDown: h(e, s),
|
|
781
785
|
disabled: !!d || C.isViewOnly,
|
|
782
786
|
...i,
|
|
783
|
-
children: /* @__PURE__ */ n(
|
|
787
|
+
children: /* @__PURE__ */ n(ee, {})
|
|
784
788
|
}
|
|
785
789
|
);
|
|
786
790
|
}), si = a("button", {
|
|
@@ -808,21 +812,21 @@ const ot = "__intro__", st = a("div", {
|
|
|
808
812
|
_id: "aiChatAttachmentsBar__List"
|
|
809
813
|
}), Ir = (t) => {
|
|
810
814
|
const { children: e, ...i } = t;
|
|
811
|
-
return /* @__PURE__ */ n(di, { children:
|
|
815
|
+
return /* @__PURE__ */ n(di, { children: y(e, []), ...i });
|
|
812
816
|
}, mi = a("div", {
|
|
813
817
|
_id: "aiChatAttachmentsBar__Attachment"
|
|
814
818
|
}), Er = (t) => {
|
|
815
819
|
const { attachment: e, ...i } = t;
|
|
816
|
-
return /* @__PURE__ */ n(
|
|
817
|
-
}, li = a(
|
|
820
|
+
return /* @__PURE__ */ n(pe, { attachment: e, children: /* @__PURE__ */ n(mi, { ...i }) });
|
|
821
|
+
}, li = a(H, {
|
|
818
822
|
_id: "aiChatAttachmentsBar__AttachmentIcon"
|
|
819
823
|
}), Sr = (t) => {
|
|
820
|
-
const { attachment: e } =
|
|
824
|
+
const { attachment: e } = K(), i = e.contentType?.attachmentIcon;
|
|
821
825
|
return i ? /* @__PURE__ */ n(li, { iconSettings: i, ...t }) : null;
|
|
822
826
|
}, hi = a("span", {
|
|
823
827
|
_id: "aiChatAttachmentsBar__AttachmentTitle"
|
|
824
828
|
}), kr = (t) => {
|
|
825
|
-
const { attachment: e } =
|
|
829
|
+
const { attachment: e } = K();
|
|
826
830
|
return /* @__PURE__ */ n(hi, { children: e.title, ...t });
|
|
827
831
|
}, ui = a("button", {
|
|
828
832
|
_id: "aiChatAttachmentsBar__AttachmentDelete"
|
|
@@ -840,20 +844,20 @@ const ot = "__intro__", st = a("div", {
|
|
|
840
844
|
);
|
|
841
845
|
}, yr = a("div", {
|
|
842
846
|
_id: "aiChatAttachmentsBar__Actions"
|
|
843
|
-
}), Tr = a(
|
|
847
|
+
}), Tr = a(w.Tooltip, {
|
|
844
848
|
_id: "aiChatAttachmentsBar__InfoTip",
|
|
845
849
|
delayDuration: 0
|
|
846
|
-
}), wr = a(
|
|
850
|
+
}), wr = a(w.Trigger, {
|
|
847
851
|
_id: "aiChatAttachmentsBar__InfoTipIcon",
|
|
848
852
|
children: /* @__PURE__ */ n(I, { iconKey: "info" })
|
|
849
|
-
}), Ci = a(
|
|
853
|
+
}), Ci = a(w.Arrow, {
|
|
850
854
|
_id: "aiChatAttachmentsBar__InfoTipArrow"
|
|
851
|
-
}), Hr = a(
|
|
855
|
+
}), Hr = a(w.Content, {
|
|
852
856
|
_id: "aiChatAttachmentsBar__InfoTipText",
|
|
853
857
|
side: "bottom",
|
|
854
858
|
sideOffset: 3,
|
|
855
859
|
align: "center",
|
|
856
|
-
children: /* @__PURE__ */
|
|
860
|
+
children: /* @__PURE__ */ V(Z, { children: [
|
|
857
861
|
/* @__PURE__ */ n(Ci, {}),
|
|
858
862
|
"Attachments will be kept in context for the entire conversation."
|
|
859
863
|
] })
|
|
@@ -864,7 +868,7 @@ const ot = "__intro__", st = a("div", {
|
|
|
864
868
|
return r?.supportedInputs ? /* @__PURE__ */ n(
|
|
865
869
|
pi,
|
|
866
870
|
{
|
|
867
|
-
children:
|
|
871
|
+
children: y(e, r.supportedInputs),
|
|
868
872
|
...i
|
|
869
873
|
}
|
|
870
874
|
) : null;
|
|
@@ -872,7 +876,7 @@ const ot = "__intro__", st = a("div", {
|
|
|
872
876
|
_id: "aiChatAttachmentsBar__Input"
|
|
873
877
|
}), xr = (t) => {
|
|
874
878
|
const { input: e, onClick: i, ...r } = t, o = { supportedInputs: [] }, s = [], c = () => {
|
|
875
|
-
}, { selectInput: d, onOpen: m } =
|
|
879
|
+
}, { selectInput: d, onOpen: m } = k(), l = () => {
|
|
876
880
|
if (e.type === "FUNCTIONAL_MULTI_ATTACHMENT")
|
|
877
881
|
return o ? e.onInvoke(o, e, c, [...s]) : void 0;
|
|
878
882
|
d(e), m();
|
|
@@ -885,10 +889,10 @@ const ot = "__intro__", st = a("div", {
|
|
|
885
889
|
...r
|
|
886
890
|
}
|
|
887
891
|
);
|
|
888
|
-
}, gi = a(
|
|
892
|
+
}, gi = a(oe, {
|
|
889
893
|
_id: "aiChatAttachmentsBar__Modal"
|
|
890
894
|
}), Dr = (t) => {
|
|
891
|
-
const { onOpenChange: e, ...i } = t, { selectInput: r, isOpen: o, onClose: s, selectedInput: c } =
|
|
895
|
+
const { onOpenChange: e, ...i } = t, { selectInput: r, isOpen: o, onClose: s, selectedInput: c } = k();
|
|
892
896
|
return /* @__PURE__ */ n(
|
|
893
897
|
gi,
|
|
894
898
|
{
|
|
@@ -899,29 +903,29 @@ const ot = "__intro__", st = a("div", {
|
|
|
899
903
|
...i
|
|
900
904
|
}
|
|
901
905
|
);
|
|
902
|
-
}, Or = a(
|
|
906
|
+
}, Or = a(ie, {
|
|
903
907
|
_id: "aiChatAttachmentsBar__ModalOverlay"
|
|
904
|
-
}), Wr = a(
|
|
908
|
+
}), Wr = a(ae, {
|
|
905
909
|
_id: "aiChatAttachmentsBar__ModalContent",
|
|
906
910
|
"aria-describedby": void 0
|
|
907
911
|
}), Rr = a("div", {
|
|
908
912
|
_id: "aiChatAttachmentsBar__ModalHeader"
|
|
909
|
-
}), bi = a(
|
|
913
|
+
}), bi = a(re, {
|
|
910
914
|
_id: "aiChatAttachmentsBar__ModalHeading"
|
|
911
915
|
}), Nr = (t) => {
|
|
912
|
-
const { selectedInput: e } =
|
|
916
|
+
const { selectedInput: e } = k(), i = `Add ${e?.displayName}`;
|
|
913
917
|
return /* @__PURE__ */ n(bi, { children: i, ...t });
|
|
914
918
|
}, _i = a("span", {
|
|
915
919
|
_id: "aiChatAttachmentsBar__ModalDescription"
|
|
916
920
|
}), Vr = (t) => {
|
|
917
|
-
const { selectedInput: e } =
|
|
921
|
+
const { selectedInput: e } = k(), i = e?.workflowModalProps?.modalHelpText;
|
|
918
922
|
return i ? /* @__PURE__ */ n(_i, { children: i, ...t }) : null;
|
|
919
923
|
}, Ai = a("div", {
|
|
920
924
|
_id: "aiChatAttachmentsBar__ModalHelp"
|
|
921
925
|
}), $r = (t) => {
|
|
922
|
-
const { children: e, ...i } = t, { selectedInput: r } =
|
|
926
|
+
const { children: e, ...i } = t, { selectedInput: r } = k(), o = r?.workflowModalProps?.modalHelpElement;
|
|
923
927
|
return o ? /* @__PURE__ */ n(Ai, { asChild: !e, children: e || o, ...i }) : null;
|
|
924
|
-
}, Qr = a(
|
|
928
|
+
}, Qr = a(ne, {
|
|
925
929
|
_id: "aiChatAttachmentsBar__ModalClose",
|
|
926
930
|
children: /* @__PURE__ */ n(I, { iconKey: "close" })
|
|
927
931
|
}), Ur = a("div", {
|
|
@@ -929,7 +933,7 @@ const ot = "__intro__", st = a("div", {
|
|
|
929
933
|
}), Pi = a("form", {
|
|
930
934
|
_id: "aiChatAttachmentsBar__Form"
|
|
931
935
|
}), Kr = (t) => {
|
|
932
|
-
const { onSubmit: e, ...i } = t, { form: r } =
|
|
936
|
+
const { onSubmit: e, ...i } = t, { form: r } = k();
|
|
933
937
|
return /* @__PURE__ */ n(
|
|
934
938
|
Pi,
|
|
935
939
|
{
|
|
@@ -943,7 +947,7 @@ const ot = "__intro__", st = a("div", {
|
|
|
943
947
|
}), Fi = a("label", {
|
|
944
948
|
_id: "aiChatAttachmentsBar__FormTitleLabel"
|
|
945
949
|
}), jr = (t) => {
|
|
946
|
-
const { form: e, selectedInput: i } =
|
|
950
|
+
const { form: e, selectedInput: i } = k();
|
|
947
951
|
return /* @__PURE__ */ n(
|
|
948
952
|
Fi,
|
|
949
953
|
{
|
|
@@ -955,7 +959,7 @@ const ot = "__intro__", st = a("div", {
|
|
|
955
959
|
}, fi = a("input", {
|
|
956
960
|
_id: "aiChatAttachmentsBar__FormTitleInput"
|
|
957
961
|
}), zr = (t) => {
|
|
958
|
-
const { onChange: e, ...i } = t, { form: r, selectedInput: o } =
|
|
962
|
+
const { onChange: e, ...i } = t, { form: r, selectedInput: o } = k();
|
|
959
963
|
return /* @__PURE__ */ n(
|
|
960
964
|
fi,
|
|
961
965
|
{
|
|
@@ -971,7 +975,7 @@ const ot = "__intro__", st = a("div", {
|
|
|
971
975
|
}, Mi = a("span", {
|
|
972
976
|
_id: "aiChatAttachmentsBar__FormTitleError"
|
|
973
977
|
}), Gr = (t) => {
|
|
974
|
-
const { form: e } =
|
|
978
|
+
const { form: e } = k();
|
|
975
979
|
return e.errors.title ? /* @__PURE__ */ n(
|
|
976
980
|
Mi,
|
|
977
981
|
{
|
|
@@ -986,7 +990,7 @@ const ot = "__intro__", st = a("div", {
|
|
|
986
990
|
}), Ii = a("label", {
|
|
987
991
|
_id: "aiChatAttachmentsBar__FormContentLabel"
|
|
988
992
|
}), Jr = (t) => {
|
|
989
|
-
const { form: e, selectedInput: i } =
|
|
993
|
+
const { form: e, selectedInput: i } = k();
|
|
990
994
|
return /* @__PURE__ */ n(
|
|
991
995
|
Ii,
|
|
992
996
|
{
|
|
@@ -998,7 +1002,7 @@ const ot = "__intro__", st = a("div", {
|
|
|
998
1002
|
}, Ei = a("textarea", {
|
|
999
1003
|
_id: "aiChatAttachmentsBar__FormTitleInput"
|
|
1000
1004
|
}), Xr = (t) => {
|
|
1001
|
-
const { onChange: e, ...i } = t, { form: r, selectedInput: o } =
|
|
1005
|
+
const { onChange: e, ...i } = t, { form: r, selectedInput: o } = k();
|
|
1002
1006
|
return /* @__PURE__ */ n(
|
|
1003
1007
|
Ei,
|
|
1004
1008
|
{
|
|
@@ -1011,13 +1015,13 @@ const ot = "__intro__", st = a("div", {
|
|
|
1011
1015
|
"aria-invalid": !!r.errors.content,
|
|
1012
1016
|
onChange: h(e, r.onChange),
|
|
1013
1017
|
...i,
|
|
1014
|
-
children: /* @__PURE__ */ n(
|
|
1018
|
+
children: /* @__PURE__ */ n(ee, { maxRows: 10 })
|
|
1015
1019
|
}
|
|
1016
1020
|
);
|
|
1017
1021
|
}, Si = a("span", {
|
|
1018
1022
|
_id: "aiChatAttachmentsBar__FormContentError"
|
|
1019
1023
|
}), Zr = (t) => {
|
|
1020
|
-
const { form: e } =
|
|
1024
|
+
const { form: e } = k();
|
|
1021
1025
|
return e.errors.content ? /* @__PURE__ */ n(
|
|
1022
1026
|
Si,
|
|
1023
1027
|
{
|
|
@@ -1047,13 +1051,13 @@ const ot = "__intro__", st = a("div", {
|
|
|
1047
1051
|
href: "https://www.inkeep.com/",
|
|
1048
1052
|
target: "_blank",
|
|
1049
1053
|
rel: "noopener noreferrer"
|
|
1050
|
-
}), ki = a(
|
|
1054
|
+
}), ki = a(w.Trigger, {
|
|
1051
1055
|
_id: "aiChat__ChatAction"
|
|
1052
|
-
}),
|
|
1053
|
-
const { action: e, onClick: i, className: r, ...o } = t, s = {}, { clear: c, stop: d, isLoading: m, isStreaming: l, messages: C } = b(), { conversationId: v } = b(), { aiChatSettings: u } = p(), [_,
|
|
1054
|
-
|
|
1056
|
+
}), Ae = (t) => {
|
|
1057
|
+
const { action: e, onClick: i, className: r, ...o } = t, s = {}, { clear: c, stop: d, isLoading: m, isStreaming: l, messages: C } = b(), { conversationId: v } = b(), { aiChatSettings: u } = p(), [_, B] = X(), [
|
|
1058
|
+
P
|
|
1055
1059
|
/* copyShareUri */
|
|
1056
|
-
] =
|
|
1060
|
+
] = X();
|
|
1057
1061
|
if ({
|
|
1058
1062
|
help: !1,
|
|
1059
1063
|
copy: C.length === 0 || !u.isCopyChatButtonVisible || m || l,
|
|
@@ -1061,39 +1065,39 @@ const ot = "__intro__", st = a("div", {
|
|
|
1061
1065
|
clear: C.length === 0 || u.isViewOnly || m || l,
|
|
1062
1066
|
stop: !m && !l
|
|
1063
1067
|
}[e]) return null;
|
|
1064
|
-
const
|
|
1068
|
+
const D = {
|
|
1065
1069
|
// Help actions are handled by HelpAction component
|
|
1066
1070
|
help: () => {
|
|
1067
1071
|
},
|
|
1068
1072
|
copy: () => {
|
|
1069
|
-
const he = C.map((
|
|
1070
|
-
const
|
|
1071
|
-
return `${
|
|
1073
|
+
const he = C.map((R) => {
|
|
1074
|
+
const z = `**${R.role === "assistant" ? "AI Assistant" : "User"}**`, G = ge(R);
|
|
1075
|
+
return `${z}
|
|
1072
1076
|
|
|
1073
|
-
${
|
|
1077
|
+
${G}`;
|
|
1074
1078
|
}).join(`
|
|
1075
1079
|
|
|
1076
1080
|
---
|
|
1077
1081
|
|
|
1078
1082
|
`);
|
|
1079
|
-
|
|
1083
|
+
B(he);
|
|
1080
1084
|
},
|
|
1081
1085
|
share: async () => {
|
|
1082
1086
|
},
|
|
1083
1087
|
clear: c,
|
|
1084
1088
|
stop: d
|
|
1085
|
-
},
|
|
1089
|
+
}, j = {
|
|
1086
1090
|
copy: _,
|
|
1087
|
-
share:
|
|
1091
|
+
share: P
|
|
1088
1092
|
};
|
|
1089
|
-
return /* @__PURE__ */ n(
|
|
1093
|
+
return /* @__PURE__ */ n(w.Tooltip, { delayDuration: 0, open: j[e], children: /* @__PURE__ */ n(
|
|
1090
1094
|
ki,
|
|
1091
1095
|
{
|
|
1092
1096
|
"data-type": e,
|
|
1093
|
-
"data-copied": g(_ ||
|
|
1097
|
+
"data-copied": g(_ || P),
|
|
1094
1098
|
className: `${r} ${e}`,
|
|
1095
1099
|
children: /* @__PURE__ */ n(yi, { action: e }),
|
|
1096
|
-
onClick: h(i,
|
|
1100
|
+
onClick: h(i, D[e]),
|
|
1097
1101
|
...o
|
|
1098
1102
|
}
|
|
1099
1103
|
) });
|
|
@@ -1108,18 +1112,18 @@ ${z}`;
|
|
|
1108
1112
|
stop: o.stop ?? "Stop"
|
|
1109
1113
|
};
|
|
1110
1114
|
return /* @__PURE__ */ n(Bi, { children: s[e], ...i });
|
|
1111
|
-
}, Ti = a(
|
|
1115
|
+
}, Ti = a(w.TooltipContent, {
|
|
1112
1116
|
_id: "aiChat__ChatActionFeeback"
|
|
1113
1117
|
}), so = (t) => {
|
|
1114
1118
|
const { action: e, children: i, ...r } = t, o = {
|
|
1115
1119
|
copy: "Copied!",
|
|
1116
1120
|
share: "Link copied!"
|
|
1117
1121
|
};
|
|
1118
|
-
return /* @__PURE__ */
|
|
1119
|
-
/* @__PURE__ */ n(
|
|
1122
|
+
return /* @__PURE__ */ V(Ti, { sideOffset: 5, ...r, children: [
|
|
1123
|
+
/* @__PURE__ */ n(w.Arrow, {}),
|
|
1120
1124
|
i || o[e]
|
|
1121
1125
|
] });
|
|
1122
|
-
}, wi = a(
|
|
1126
|
+
}, wi = a(T.Root, {
|
|
1123
1127
|
_id: "aiChatHelpActions"
|
|
1124
1128
|
}), co = (t) => {
|
|
1125
1129
|
const { children: e, ...i } = t, { aiChatSettings: r } = p(), { getHelpOptions: o } = r;
|
|
@@ -1137,11 +1141,11 @@ ${z}`;
|
|
|
1137
1141
|
{
|
|
1138
1142
|
open: l.open,
|
|
1139
1143
|
onOpenChange: l.setOpen,
|
|
1140
|
-
children:
|
|
1144
|
+
children: y(e, { pinned: d, unpinned: m }),
|
|
1141
1145
|
...i
|
|
1142
1146
|
}
|
|
1143
1147
|
) });
|
|
1144
|
-
}, Hi = a(
|
|
1148
|
+
}, Hi = a(Ae, {
|
|
1145
1149
|
_id: "aiChatHelpAction",
|
|
1146
1150
|
action: "help"
|
|
1147
1151
|
}), Li = a("a", {
|
|
@@ -1149,7 +1153,7 @@ ${z}`;
|
|
|
1149
1153
|
target: "_blank",
|
|
1150
1154
|
rel: "noreferrer"
|
|
1151
1155
|
}), mo = (t) => {
|
|
1152
|
-
const { action: e, onClick: i, ...r } = t, { handleAction: o, logHelpAction: s } =
|
|
1156
|
+
const { action: e, onClick: i, ...r } = t, { handleAction: o, logHelpAction: s } = de(e), c = e.action.type, d = {
|
|
1153
1157
|
"aria-label": e.name,
|
|
1154
1158
|
"data-name": e.name,
|
|
1155
1159
|
children: e.name,
|
|
@@ -1160,14 +1164,14 @@ ${z}`;
|
|
|
1160
1164
|
...r
|
|
1161
1165
|
};
|
|
1162
1166
|
return c === "open_link" ? /* @__PURE__ */ n(Li, { href: e.action.url, ...d }) : /* @__PURE__ */ n(Hi, { ...d });
|
|
1163
|
-
}, xi = a(
|
|
1167
|
+
}, xi = a(T.Trigger, {
|
|
1164
1168
|
_id: "aiChatHelpActions__Trigger"
|
|
1165
1169
|
}), lo = E(
|
|
1166
1170
|
(t) => {
|
|
1167
1171
|
const { aiChatSettings: e } = p();
|
|
1168
|
-
return /* @__PURE__ */ n(
|
|
1172
|
+
return /* @__PURE__ */ n(Ae, { action: "help", ...t, asChild: !0, children: /* @__PURE__ */ n(xi, { children: e.toolbarButtonLabels?.getHelp ?? "Get Help" }) });
|
|
1169
1173
|
}
|
|
1170
|
-
), Di = a(
|
|
1174
|
+
), Di = a(T.Content, {
|
|
1171
1175
|
_id: "aiChatHelpActions__Menu"
|
|
1172
1176
|
}), ho = (t) => /* @__PURE__ */ n(
|
|
1173
1177
|
Di,
|
|
@@ -1178,10 +1182,10 @@ ${z}`;
|
|
|
1178
1182
|
alignOffset: -10,
|
|
1179
1183
|
...t
|
|
1180
1184
|
}
|
|
1181
|
-
), uo = a(
|
|
1185
|
+
), uo = a(T.Arrow, {
|
|
1182
1186
|
_id: "aiChatHelpActions__MenuArrow"
|
|
1183
1187
|
}), Co = (t) => {
|
|
1184
|
-
const { action: e, onClick: i, ...r } = t, { handleAction: o, logHelpAction: s } =
|
|
1188
|
+
const { action: e, onClick: i, ...r } = t, { handleAction: o, logHelpAction: s } = de(e), { setOpen: c } = ze(), d = () => {
|
|
1185
1189
|
o({
|
|
1186
1190
|
onOpenForm: () => c(!1)
|
|
1187
1191
|
}), s();
|
|
@@ -1199,15 +1203,15 @@ ${z}`;
|
|
|
1199
1203
|
onClick: h(i, d)
|
|
1200
1204
|
});
|
|
1201
1205
|
return /* @__PURE__ */ n(l, { ...r });
|
|
1202
|
-
}, Oi = a(
|
|
1206
|
+
}, Oi = a(H, {
|
|
1203
1207
|
_id: "aiChatHelpActions_MenuItemIcon"
|
|
1204
1208
|
}), po = (t) => {
|
|
1205
1209
|
const { action: e, ...i } = t;
|
|
1206
1210
|
return e.icon ? /* @__PURE__ */ n(Oi, { iconSettings: e.icon, ...i }) : null;
|
|
1207
|
-
}, Wi = a(
|
|
1211
|
+
}, Wi = a(oe, {
|
|
1208
1212
|
_id: "aiChatFeedbackModal"
|
|
1209
1213
|
}), vo = (t) => {
|
|
1210
|
-
const { onOpenChange: e, ...i } = t, { currentFeedback: r, setCurrentFeedback: o } =
|
|
1214
|
+
const { onOpenChange: e, ...i } = t, { currentFeedback: r, setCurrentFeedback: o } = se();
|
|
1211
1215
|
return /* @__PURE__ */ n(
|
|
1212
1216
|
Wi,
|
|
1213
1217
|
{
|
|
@@ -1216,15 +1220,15 @@ ${z}`;
|
|
|
1216
1220
|
...i
|
|
1217
1221
|
}
|
|
1218
1222
|
);
|
|
1219
|
-
}, go = a(
|
|
1223
|
+
}, go = a(ie, {
|
|
1220
1224
|
_id: "aiChatFeedbackModal__Overlay"
|
|
1221
|
-
}), bo = a(
|
|
1225
|
+
}), bo = a(ae, {
|
|
1222
1226
|
_id: "aiChatFeedbackModal__Content",
|
|
1223
1227
|
"aria-describedby": void 0
|
|
1224
|
-
}), _o = a(
|
|
1228
|
+
}), _o = a(re, {
|
|
1225
1229
|
_id: "aiChatFeedbackModal__Header",
|
|
1226
1230
|
children: "Help improve my answers!"
|
|
1227
|
-
}), Ao = a(
|
|
1231
|
+
}), Ao = a(ne, {
|
|
1228
1232
|
_id: "aiChatFeedbackModal__Close",
|
|
1229
1233
|
children: /* @__PURE__ */ n(I, { iconKey: "close" })
|
|
1230
1234
|
}), Po = a("div", {
|
|
@@ -1232,7 +1236,7 @@ ${z}`;
|
|
|
1232
1236
|
}), Ri = a("form", {
|
|
1233
1237
|
_id: "aiChatFeedbackForm"
|
|
1234
1238
|
}), Fo = (t) => {
|
|
1235
|
-
const { onSubmit: e, ...i } = t, { submitNegativeFeedback: r, currentFeedback: o, setCurrentFeedback: s } =
|
|
1239
|
+
const { onSubmit: e, ...i } = t, { submitNegativeFeedback: r, currentFeedback: o, setCurrentFeedback: s } = se();
|
|
1236
1240
|
return /* @__PURE__ */ n(Ri, { onSubmit: h(e, (d) => {
|
|
1237
1241
|
d.preventDefault();
|
|
1238
1242
|
const m = d.target, l = new FormData(m), C = Object.fromEntries(l.entries());
|
|
@@ -1243,10 +1247,10 @@ ${z}`;
|
|
|
1243
1247
|
}), fo = (t) => {
|
|
1244
1248
|
const { name: e, ...i } = t;
|
|
1245
1249
|
return /* @__PURE__ */ n(Ve, { name: e, children: /* @__PURE__ */ n(Ni, { ...i }) });
|
|
1246
|
-
}, Vi = a(
|
|
1250
|
+
}, Vi = a(Q.Root, {
|
|
1247
1251
|
_id: "aiChatFeedbackItem__Checkbox"
|
|
1248
1252
|
}), Mo = (t) => {
|
|
1249
|
-
const { name: e, focusItem: i } =
|
|
1253
|
+
const { name: e, focusItem: i } = ce(), { onCheckedChange: r, ...o } = t, s = (c) => {
|
|
1250
1254
|
c && i?.current?.focus();
|
|
1251
1255
|
};
|
|
1252
1256
|
return /* @__PURE__ */ n(
|
|
@@ -1258,13 +1262,13 @@ ${z}`;
|
|
|
1258
1262
|
...o
|
|
1259
1263
|
}
|
|
1260
1264
|
);
|
|
1261
|
-
}, Io = a(
|
|
1265
|
+
}, Io = a(Q.Indicator, {
|
|
1262
1266
|
_id: "aiChatFeedbackItem__CheckboxIndicator",
|
|
1263
|
-
children: /* @__PURE__ */ n(
|
|
1267
|
+
children: /* @__PURE__ */ n(ve, {})
|
|
1264
1268
|
}), $i = a("label", {
|
|
1265
1269
|
_id: "aiChatFeedbackItem__Label"
|
|
1266
1270
|
}), Eo = (t) => {
|
|
1267
|
-
const { name: e } =
|
|
1271
|
+
const { name: e } = ce(), i = {
|
|
1268
1272
|
unrelated_response: "Didn't answer my question",
|
|
1269
1273
|
inaccurate_statement: "Inaccurate statement",
|
|
1270
1274
|
inaccurate_code_snippet: "Inaccurate code snippet",
|
|
@@ -1275,7 +1279,7 @@ ${z}`;
|
|
|
1275
1279
|
_id: "aiChatFeedbackItem__Description",
|
|
1276
1280
|
placeholder: "Please describe"
|
|
1277
1281
|
}), So = (t) => {
|
|
1278
|
-
const { name: e, focusItem: i } =
|
|
1282
|
+
const { name: e, focusItem: i } = ce();
|
|
1279
1283
|
return /* @__PURE__ */ n(
|
|
1280
1284
|
Qi,
|
|
1281
1285
|
{
|
|
@@ -1291,12 +1295,12 @@ ${z}`;
|
|
|
1291
1295
|
}), Ui = a("div", {
|
|
1292
1296
|
_id: "aiChatForm__Wrapper"
|
|
1293
1297
|
}), Bo = (t) => {
|
|
1294
|
-
const { form: e } =
|
|
1298
|
+
const { form: e } = A();
|
|
1295
1299
|
return e ? /* @__PURE__ */ n(Ui, { ...t }) : null;
|
|
1296
1300
|
}, Ki = a("form", {
|
|
1297
1301
|
_id: "aiChatForm"
|
|
1298
1302
|
}), yo = (t) => {
|
|
1299
|
-
const { onSubmit: e, ...i } = t, { conversationId: r, messages: o } = b(), { handleSubmit: s, isSuccess: c } =
|
|
1303
|
+
const { onSubmit: e, ...i } = t, { conversationId: r, messages: o } = b(), { handleSubmit: s, isSuccess: c } = A();
|
|
1300
1304
|
return c ? null : /* @__PURE__ */ n(
|
|
1301
1305
|
Ki,
|
|
1302
1306
|
{
|
|
@@ -1311,29 +1315,29 @@ ${z}`;
|
|
|
1311
1315
|
_id: "aiChatForm__Close",
|
|
1312
1316
|
children: /* @__PURE__ */ n(I, { iconKey: "close" })
|
|
1313
1317
|
}), To = (t) => {
|
|
1314
|
-
const { onClick: e, ...i } = t, { closeForm: r } =
|
|
1318
|
+
const { onClick: e, ...i } = t, { closeForm: r } = A();
|
|
1315
1319
|
return /* @__PURE__ */ n(qi, { onClick: h(e, r), ...i });
|
|
1316
1320
|
}, wo = a("div", {
|
|
1317
1321
|
_id: "aiChatForm__Header"
|
|
1318
1322
|
}), ji = a("h2", {
|
|
1319
1323
|
_id: "aiChatForm__Heading"
|
|
1320
1324
|
}), Ho = (t) => {
|
|
1321
|
-
const { form: e } =
|
|
1325
|
+
const { form: e } = A();
|
|
1322
1326
|
return e?.heading ? /* @__PURE__ */ n(ji, { children: e.heading, ...t }) : null;
|
|
1323
|
-
}, zi = a(
|
|
1327
|
+
}, zi = a(U, {
|
|
1324
1328
|
_id: "aiChatForm__Description"
|
|
1325
1329
|
}), Lo = (t) => {
|
|
1326
|
-
const { form: e } =
|
|
1330
|
+
const { form: e } = A();
|
|
1327
1331
|
return e?.description ? /* @__PURE__ */ n(zi, { children: e.description, ...t }) : null;
|
|
1328
1332
|
}, Gi = a("div", {
|
|
1329
1333
|
_id: "aiChatForm__Content"
|
|
1330
1334
|
}), xo = (t) => {
|
|
1331
|
-
const { children: e, ...i } = t, { getFields: r } =
|
|
1332
|
-
return /* @__PURE__ */ n(Gi, { children:
|
|
1335
|
+
const { children: e, ...i } = t, { getFields: r } = A(), { conversationId: o } = b(), s = r(o) || [];
|
|
1336
|
+
return /* @__PURE__ */ n(Gi, { children: y(e, s), ...i });
|
|
1333
1337
|
}, Yi = a("div", {
|
|
1334
1338
|
_id: "aiChatForm__Field"
|
|
1335
1339
|
}), Do = (t) => {
|
|
1336
|
-
const { field: e, autoFocus: i, ...r } = t, { control: o, errors: s } =
|
|
1340
|
+
const { field: e, autoFocus: i, ...r } = t, { control: o, errors: s } = A();
|
|
1337
1341
|
return /* @__PURE__ */ n(
|
|
1338
1342
|
Ye,
|
|
1339
1343
|
{
|
|
@@ -1365,7 +1369,7 @@ ${z}`;
|
|
|
1365
1369
|
}, Ji = a("label", {
|
|
1366
1370
|
_id: "aiChatForm__FieldLabel"
|
|
1367
1371
|
}), Oo = (t) => {
|
|
1368
|
-
const { field: e } =
|
|
1372
|
+
const { field: e } = x();
|
|
1369
1373
|
return /* @__PURE__ */ n(
|
|
1370
1374
|
Ji,
|
|
1371
1375
|
{
|
|
@@ -1378,13 +1382,13 @@ ${z}`;
|
|
|
1378
1382
|
}, Xi = a("input", {
|
|
1379
1383
|
_id: "aiChatForm__FieldText",
|
|
1380
1384
|
type: "text"
|
|
1381
|
-
}),
|
|
1385
|
+
}), Pe = (t) => {
|
|
1382
1386
|
const {
|
|
1383
1387
|
field: e,
|
|
1384
1388
|
error: i,
|
|
1385
1389
|
fieldProps: { onChange: r, onBlur: o, ...s },
|
|
1386
1390
|
autoFocus: c
|
|
1387
|
-
} =
|
|
1391
|
+
} = x(), { onChange: d, onBlur: m, ...l } = t;
|
|
1388
1392
|
return /* @__PURE__ */ n(
|
|
1389
1393
|
Xi,
|
|
1390
1394
|
{
|
|
@@ -1398,7 +1402,7 @@ ${z}`;
|
|
|
1398
1402
|
...l
|
|
1399
1403
|
}
|
|
1400
1404
|
);
|
|
1401
|
-
}, Wo = a(
|
|
1405
|
+
}, Wo = a(Pe, {
|
|
1402
1406
|
_id: "aiChatForm__FieldEmail",
|
|
1403
1407
|
type: "email"
|
|
1404
1408
|
}), Zi = a("input", {
|
|
@@ -1411,7 +1415,7 @@ ${z}`;
|
|
|
1411
1415
|
error: i,
|
|
1412
1416
|
fieldProps: { value: r, onChange: o, onBlur: s, ...c },
|
|
1413
1417
|
autoFocus: d
|
|
1414
|
-
} =
|
|
1418
|
+
} = x(), { onChange: m, onBlur: l, ...C } = t, v = (u) => {
|
|
1415
1419
|
const _ = u.target.files;
|
|
1416
1420
|
o(_);
|
|
1417
1421
|
};
|
|
@@ -1428,15 +1432,15 @@ ${z}`;
|
|
|
1428
1432
|
onBlur: h(l, s)
|
|
1429
1433
|
}
|
|
1430
1434
|
);
|
|
1431
|
-
}, No = a(
|
|
1435
|
+
}, No = a(Pe, {
|
|
1432
1436
|
_id: "aiChatForm__FieldTextArea",
|
|
1433
1437
|
type: "textarea",
|
|
1434
1438
|
asChild: !0,
|
|
1435
|
-
children: /* @__PURE__ */ n(
|
|
1436
|
-
}), ea = a(
|
|
1439
|
+
children: /* @__PURE__ */ n(ee, { maxRows: 8 })
|
|
1440
|
+
}), ea = a(Q.Root, {
|
|
1437
1441
|
_id: "aiChatForm__FieldCheckbox"
|
|
1438
1442
|
}), Vo = (t) => {
|
|
1439
|
-
const { field: e, error: i, fieldProps: r, autoFocus: o } =
|
|
1443
|
+
const { field: e, error: i, fieldProps: r, autoFocus: o } = x(), { onCheckedChange: s, ...c } = t;
|
|
1440
1444
|
return /* @__PURE__ */ n(
|
|
1441
1445
|
ea,
|
|
1442
1446
|
{
|
|
@@ -1449,13 +1453,13 @@ ${z}`;
|
|
|
1449
1453
|
...c
|
|
1450
1454
|
}
|
|
1451
1455
|
);
|
|
1452
|
-
}, $o = a(
|
|
1456
|
+
}, $o = a(Q.Indicator, {
|
|
1453
1457
|
_id: "aiChatForm__FieldCheckboxIndicator",
|
|
1454
|
-
children: /* @__PURE__ */ n(
|
|
1458
|
+
children: /* @__PURE__ */ n(ve, {})
|
|
1455
1459
|
}), ta = a(we, {
|
|
1456
1460
|
_id: "aiChatForm__FieldSelect"
|
|
1457
1461
|
}), Qo = (t) => {
|
|
1458
|
-
const { field: e, error: i, fieldProps: r } =
|
|
1462
|
+
const { field: e, error: i, fieldProps: r } = x(), { onValueChange: o, ...s } = t;
|
|
1459
1463
|
return /* @__PURE__ */ n(
|
|
1460
1464
|
ta,
|
|
1461
1465
|
{
|
|
@@ -1471,7 +1475,7 @@ ${z}`;
|
|
|
1471
1475
|
}), ia = a(He, {
|
|
1472
1476
|
_id: "aiChatForm__FieldSelect__Value"
|
|
1473
1477
|
}), Ko = (t) => {
|
|
1474
|
-
const { field: e } =
|
|
1478
|
+
const { field: e } = x();
|
|
1475
1479
|
return /* @__PURE__ */ n(
|
|
1476
1480
|
ia,
|
|
1477
1481
|
{
|
|
@@ -1482,7 +1486,7 @@ ${z}`;
|
|
|
1482
1486
|
}, qo = a(Se, {
|
|
1483
1487
|
_id: "aiChatForm__FieldSelect__Icon",
|
|
1484
1488
|
asChild: !0,
|
|
1485
|
-
children: /* @__PURE__ */ n(
|
|
1489
|
+
children: /* @__PURE__ */ n(H, { iconSettings: { builtIn: "LuChevronDown" } })
|
|
1486
1490
|
}), jo = a(ke, {
|
|
1487
1491
|
_id: "aiChatForm__FieldSelect__Content",
|
|
1488
1492
|
position: "popper"
|
|
@@ -1497,17 +1501,17 @@ ${z}`;
|
|
|
1497
1501
|
{
|
|
1498
1502
|
_id: "aiChatForm__FieldSelect__ItemIndicator",
|
|
1499
1503
|
asChild: !0,
|
|
1500
|
-
children: /* @__PURE__ */ n(
|
|
1504
|
+
children: /* @__PURE__ */ n(H, { iconSettings: { builtIn: "LuCheck" } })
|
|
1501
1505
|
}
|
|
1502
1506
|
), aa = a("span", {
|
|
1503
1507
|
_id: "aiChatForm__FieldError"
|
|
1504
1508
|
}), Xo = (t) => {
|
|
1505
|
-
const { error: e } =
|
|
1509
|
+
const { error: e } = x();
|
|
1506
1510
|
return e ? /* @__PURE__ */ n(aa, { children: e.message?.toString(), ...t }) : null;
|
|
1507
1511
|
}, na = a("span", {
|
|
1508
1512
|
_id: "aiChatForm__Error"
|
|
1509
1513
|
}), Zo = (t) => {
|
|
1510
|
-
const { formError: e } =
|
|
1514
|
+
const { formError: e } = A();
|
|
1511
1515
|
return e ? /* @__PURE__ */ n(na, { children: e.message, ...t }) : null;
|
|
1512
1516
|
}, es = a("div", {
|
|
1513
1517
|
_id: "aiChatForm__Footer"
|
|
@@ -1516,41 +1520,41 @@ ${z}`;
|
|
|
1516
1520
|
children: "Cancel",
|
|
1517
1521
|
type: "button"
|
|
1518
1522
|
}), ts = (t) => {
|
|
1519
|
-
const { onClick: e, ...i } = t, { closeForm: r } =
|
|
1523
|
+
const { onClick: e, ...i } = t, { closeForm: r } = A();
|
|
1520
1524
|
return /* @__PURE__ */ n(ra, { onClick: h(e, r), ...i });
|
|
1521
1525
|
}, oa = a("button", {
|
|
1522
1526
|
_id: "aiChatForm__Submit",
|
|
1523
1527
|
children: "Submit",
|
|
1524
1528
|
type: "submit"
|
|
1525
1529
|
}), is = (t) => {
|
|
1526
|
-
const { onClick: e, ...i } = t, { isSubmitting: r, form: o } =
|
|
1530
|
+
const { onClick: e, ...i } = t, { isSubmitting: r, form: o } = A(), s = o?.buttons.submit.label || "Submit";
|
|
1527
1531
|
return /* @__PURE__ */ n(oa, { disabled: r, ...i, children: s });
|
|
1528
1532
|
}, sa = a("div", {
|
|
1529
1533
|
_id: "aiChatForm__Success"
|
|
1530
1534
|
}), as = (t) => {
|
|
1531
|
-
const { isSuccess: e } =
|
|
1535
|
+
const { isSuccess: e } = A();
|
|
1532
1536
|
return e ? /* @__PURE__ */ n(sa, { ...t }) : null;
|
|
1533
1537
|
}, ca = a("h2", {
|
|
1534
1538
|
_id: "aiChatForm__SuccessHeading"
|
|
1535
1539
|
}), ns = (t) => {
|
|
1536
|
-
const { form: e } =
|
|
1540
|
+
const { form: e } = A();
|
|
1537
1541
|
return /* @__PURE__ */ n(ca, { children: e?.successView?.heading, ...t });
|
|
1538
|
-
}, da = a(
|
|
1542
|
+
}, da = a(U, {
|
|
1539
1543
|
_id: "aiChatForm__SuccessMessage"
|
|
1540
1544
|
}), rs = (t) => {
|
|
1541
|
-
const { form: e } =
|
|
1545
|
+
const { form: e } = A();
|
|
1542
1546
|
return /* @__PURE__ */ n(da, { children: e?.successView?.message, ...t });
|
|
1543
1547
|
}, ma = a("button", {
|
|
1544
1548
|
_id: "aiChatForm__SuccessButton"
|
|
1545
1549
|
}), os = (t) => {
|
|
1546
|
-
const { onClick: e, ...i } = t, { form: r, closeForm: o } =
|
|
1550
|
+
const { onClick: e, ...i } = t, { form: r, closeForm: o } = A(), s = r?.successView?.doneButton;
|
|
1547
1551
|
if (!s) return null;
|
|
1548
|
-
const c = s.icon && /* @__PURE__ */ n(
|
|
1552
|
+
const c = s.icon && /* @__PURE__ */ n(H, { iconSettings: s.icon }), d = s.label;
|
|
1549
1553
|
return /* @__PURE__ */ n(
|
|
1550
1554
|
ma,
|
|
1551
1555
|
{
|
|
1552
1556
|
onClick: h(e, o),
|
|
1553
|
-
children: /* @__PURE__ */
|
|
1557
|
+
children: /* @__PURE__ */ V(Z, { children: [
|
|
1554
1558
|
c,
|
|
1555
1559
|
d
|
|
1556
1560
|
] }),
|
|
@@ -1593,7 +1597,7 @@ export {
|
|
|
1593
1597
|
Nr as AttachmentsBarModalHeading,
|
|
1594
1598
|
$r as AttachmentsBarModalHelp,
|
|
1595
1599
|
Or as AttachmentsBarModalOverlay,
|
|
1596
|
-
|
|
1600
|
+
Ae as ChatAction,
|
|
1597
1601
|
so as ChatActionFeedback,
|
|
1598
1602
|
yi as ChatActionLabel,
|
|
1599
1603
|
mo as ChatHelpAction,
|
|
@@ -1644,7 +1648,7 @@ export {
|
|
|
1644
1648
|
Nr as EmbeddedChatPrimitiveAttachmentsBarModalHeading,
|
|
1645
1649
|
$r as EmbeddedChatPrimitiveAttachmentsBarModalHelp,
|
|
1646
1650
|
Or as EmbeddedChatPrimitiveAttachmentsBarModalOverlay,
|
|
1647
|
-
|
|
1651
|
+
Ae as EmbeddedChatPrimitiveChatAction,
|
|
1648
1652
|
so as EmbeddedChatPrimitiveChatActionFeedback,
|
|
1649
1653
|
yi as EmbeddedChatPrimitiveChatActionLabel,
|
|
1650
1654
|
mo as EmbeddedChatPrimitiveChatHelpAction,
|
|
@@ -1702,7 +1706,7 @@ export {
|
|
|
1702
1706
|
Uo as EmbeddedChatPrimitiveFormFieldSelectTrigger,
|
|
1703
1707
|
Ko as EmbeddedChatPrimitiveFormFieldSelectValue,
|
|
1704
1708
|
zo as EmbeddedChatPrimitiveFormFieldSelectViewport,
|
|
1705
|
-
|
|
1709
|
+
Pe as EmbeddedChatPrimitiveFormFieldText,
|
|
1706
1710
|
No as EmbeddedChatPrimitiveFormFieldTextArea,
|
|
1707
1711
|
es as EmbeddedChatPrimitiveFormFooter,
|
|
1708
1712
|
wo as EmbeddedChatPrimitiveFormHeader,
|
|
@@ -1817,7 +1821,7 @@ export {
|
|
|
1817
1821
|
Uo as FormFieldSelectTrigger,
|
|
1818
1822
|
Ko as FormFieldSelectValue,
|
|
1819
1823
|
zo as FormFieldSelectViewport,
|
|
1820
|
-
|
|
1824
|
+
Pe as FormFieldText,
|
|
1821
1825
|
No as FormFieldTextArea,
|
|
1822
1826
|
es as FormFooter,
|
|
1823
1827
|
wo as FormHeader,
|