@box/box-ai-content-answers 1.10.4 → 1.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/clear-conversation-button.js +25 -22
- package/dist/chunks/stopResponseButton.js +8 -8
- package/dist/esm/lib/components/answer/copy-button.js +27 -24
- package/dist/esm/lib/components/answer/no-citations.js +22 -19
- package/dist/esm/lib/components/answer/thumb-buttons.js +85 -79
- package/dist/esm/lib/components/modal/clear-conversation-button.js +4 -3
- package/dist/esm/lib/components/modal/modal.js +114 -111
- package/dist/esm/lib/components/sidebar/content.js +100 -97
- package/dist/i18n/en-x-pseudo.js +89 -89
- package/dist/i18n/en-x-pseudo.properties +89 -89
- package/dist/styles/stopResponseButton.css +1 -1
- package/package.json +6 -6
|
@@ -1,168 +1,171 @@
|
|
|
1
|
-
import { useBreakpoint as
|
|
2
|
-
import { ArrowsCollapse as
|
|
3
|
-
import { BoxAiLogo as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
1
|
+
import { useBlueprintModernization as Y, useBreakpoint as Z, Breakpoint as ee, Modal as m, TooltipProvider as oe, Tooltip as te } from "@box/blueprint-web";
|
|
2
|
+
import { ArrowsCollapse as se } from "@box/blueprint-web-assets/icons/Fill";
|
|
3
|
+
import { BoxAiLogo as ae } from "@box/blueprint-web-assets/icons/Logo";
|
|
4
|
+
import { ArrowsMinimize as re } from "@box/blueprint-web-assets/icons/Medium";
|
|
5
|
+
import { Size8 as S } from "@box/blueprint-web-assets/tokens/tokens";
|
|
6
|
+
import { BoxAiAgentSelectorWithApi as le, AgentsProvider as ne } from "@box/box-ai-agent-selector";
|
|
7
|
+
import { useState as ie, useMemo as ce, useCallback as x, useEffect as p } from "react";
|
|
8
|
+
import { useIntl as de } from "react-intl";
|
|
9
|
+
import { BoxAiContentAnswers as me } from "../../box-ai-content-answers.js";
|
|
10
|
+
import { A as fe, R as ge } from "../../../../chunks/types.js";
|
|
11
|
+
import { LOGGER_BASE_CONFIG as M, LOGGER_ACTION_CLICK as ue } from "../common/constants.js";
|
|
12
|
+
import { s, C as Ce } from "../../../../chunks/clear-conversation-button.js";
|
|
13
|
+
import pe from "./hooks/useStopPropagationOnEsc.js";
|
|
14
|
+
import { Title as Me } from "./title.js";
|
|
15
|
+
import B from "./messages.js";
|
|
15
16
|
import { jsxs as h, jsx as e } from "react/jsx-runtime";
|
|
16
|
-
const
|
|
17
|
+
const he = (o) => o ? "Modal.Close-collapseContentAnswersModal" : "Modal.Close-closeContentAnswersModal", Te = (o) => o ? B.collapseModalAriaLabel : B.closeModalAriaLabel, be = (o, r) => o ? r ? re : se : void 0, Ae = (o, r) => {
|
|
17
18
|
const l = o === "collapsible";
|
|
18
19
|
return {
|
|
19
|
-
closeModalLabel:
|
|
20
|
-
closeModalTargetId:
|
|
21
|
-
closeModalIcon:
|
|
20
|
+
closeModalLabel: Te(l),
|
|
21
|
+
closeModalTargetId: he(l),
|
|
22
|
+
closeModalIcon: be(l, r)
|
|
22
23
|
};
|
|
23
|
-
},
|
|
24
|
+
}, He = ({
|
|
24
25
|
children: o,
|
|
25
|
-
getAIStudioAgents:
|
|
26
|
-
hasCustomSuggestedQuestions:
|
|
27
|
-
hostAppName:
|
|
26
|
+
getAIStudioAgents: r,
|
|
27
|
+
hasCustomSuggestedQuestions: l,
|
|
28
|
+
hostAppName: f,
|
|
28
29
|
isAIStudioAgentSelectorEnabled: g = !1,
|
|
29
|
-
isDebugModeEnabled:
|
|
30
|
-
isStopResponseEnabled:
|
|
31
|
-
itemSize:
|
|
32
|
-
extension:
|
|
33
|
-
onClearAction:
|
|
34
|
-
onSelectAgent:
|
|
35
|
-
onSelectedAgentCallback:
|
|
36
|
-
promptValue:
|
|
37
|
-
recordAction:
|
|
30
|
+
isDebugModeEnabled: _,
|
|
31
|
+
isStopResponseEnabled: k = !1,
|
|
32
|
+
itemSize: T,
|
|
33
|
+
extension: b,
|
|
34
|
+
onClearAction: u,
|
|
35
|
+
onSelectAgent: P,
|
|
36
|
+
onSelectedAgentCallback: q,
|
|
37
|
+
promptValue: z,
|
|
38
|
+
recordAction: n,
|
|
38
39
|
setPromptValue: G,
|
|
39
40
|
shouldRenderProviders: H = !0,
|
|
40
|
-
shouldShowLandingPage:
|
|
41
|
-
stopPropagationOnEsc:
|
|
42
|
-
variant:
|
|
43
|
-
items:
|
|
44
|
-
parentItem:
|
|
45
|
-
...
|
|
41
|
+
shouldShowLandingPage: F = !1,
|
|
42
|
+
stopPropagationOnEsc: j,
|
|
43
|
+
variant: A = "closable",
|
|
44
|
+
items: c,
|
|
45
|
+
parentItem: d,
|
|
46
|
+
...D
|
|
46
47
|
}) => {
|
|
47
|
-
var
|
|
48
|
+
var v, I;
|
|
48
49
|
const {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
enableModernizedComponents: L
|
|
51
|
+
} = Y(), {
|
|
52
|
+
open: R,
|
|
53
|
+
defaultOpen: Q,
|
|
54
|
+
onOpenChange: U,
|
|
55
|
+
modal: W,
|
|
53
56
|
...a
|
|
54
|
-
} =
|
|
55
|
-
|
|
56
|
-
const
|
|
57
|
-
closeModalLabel:
|
|
58
|
-
closeModalTargetId:
|
|
59
|
-
closeModalIcon:
|
|
60
|
-
} =
|
|
61
|
-
|
|
62
|
-
}, [
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
...
|
|
57
|
+
} = D, O = de(), y = Z() <= ee.Medium;
|
|
58
|
+
pe(j, R);
|
|
59
|
+
const C = (I = (v = a == null ? void 0 : a.questions) == null ? void 0 : v[a.questions.length - 1]) == null ? void 0 : I.error, [K, w] = ie(!1), {
|
|
60
|
+
closeModalLabel: N,
|
|
61
|
+
closeModalTargetId: $,
|
|
62
|
+
closeModalIcon: J
|
|
63
|
+
} = ce(() => Ae(A, L), [A, L]), i = x((t) => {
|
|
64
|
+
n && (t.data ?? (t.data = {}), t.data.hostAppName = f, n(t));
|
|
65
|
+
}, [f, n]);
|
|
66
|
+
p(() => {
|
|
67
|
+
c || i({
|
|
68
|
+
...M,
|
|
66
69
|
target: "loaded",
|
|
67
70
|
data: {
|
|
68
|
-
fileSize:
|
|
69
|
-
fileType:
|
|
71
|
+
fileSize: T,
|
|
72
|
+
fileType: b
|
|
70
73
|
}
|
|
71
74
|
});
|
|
72
|
-
}, [
|
|
73
|
-
|
|
74
|
-
...
|
|
75
|
+
}, [i, b, T, c, n]), p(() => {
|
|
76
|
+
c && i({
|
|
77
|
+
...M,
|
|
75
78
|
target: "loaded",
|
|
76
79
|
data: {
|
|
77
|
-
parentItemType:
|
|
78
|
-
items:
|
|
80
|
+
parentItemType: d == null ? void 0 : d.type,
|
|
81
|
+
items: c.map((t) => ({
|
|
79
82
|
status: t.status,
|
|
80
83
|
fileType: t.fileType
|
|
81
84
|
}))
|
|
82
85
|
}
|
|
83
86
|
});
|
|
84
|
-
}, [
|
|
85
|
-
|
|
86
|
-
}, [
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
...
|
|
90
|
-
action:
|
|
87
|
+
}, [i, d, n]), p(() => {
|
|
88
|
+
C && C === fe.AGENT_NOT_FOUND && w(!0);
|
|
89
|
+
}, [C]);
|
|
90
|
+
const V = () => {
|
|
91
|
+
u && (u(), i({
|
|
92
|
+
...M,
|
|
93
|
+
action: ue,
|
|
91
94
|
target: "clearChat"
|
|
92
95
|
}));
|
|
93
|
-
},
|
|
94
|
-
defaultOpen:
|
|
95
|
-
modal:
|
|
96
|
-
onOpenChange:
|
|
97
|
-
open:
|
|
98
|
-
children: [/* @__PURE__ */ e(
|
|
96
|
+
}, X = x(async () => (w(!1), r()), [r]), E = /* @__PURE__ */ h(m, {
|
|
97
|
+
defaultOpen: Q,
|
|
98
|
+
modal: W,
|
|
99
|
+
onOpenChange: U,
|
|
100
|
+
open: R,
|
|
101
|
+
children: [/* @__PURE__ */ e(m.Trigger, {
|
|
99
102
|
children: o
|
|
100
|
-
}), /* @__PURE__ */ h(
|
|
103
|
+
}), /* @__PURE__ */ h(m.Content, {
|
|
101
104
|
className: s.contentAnswersModal,
|
|
102
105
|
"data-testid": "content-answers-modal",
|
|
103
106
|
size: "xlarge",
|
|
104
|
-
children: [/* @__PURE__ */ e(
|
|
107
|
+
children: [/* @__PURE__ */ e(m.Header, {
|
|
105
108
|
className: s.modalHeaderContainer,
|
|
106
109
|
children: /* @__PURE__ */ h("div", {
|
|
107
110
|
className: s.modalHeader,
|
|
108
|
-
children: [!
|
|
111
|
+
children: [!y && /* @__PURE__ */ e(ae, {
|
|
109
112
|
className: s.BoxAIIconColor,
|
|
110
113
|
"data-testid": "content-answers-icon-color",
|
|
111
|
-
height:
|
|
112
|
-
width:
|
|
113
|
-
}), /* @__PURE__ */ e(
|
|
114
|
+
height: S,
|
|
115
|
+
width: S
|
|
116
|
+
}), /* @__PURE__ */ e(Me, {
|
|
114
117
|
isAIStudioAgentSelectorEnabled: g
|
|
115
|
-
}), g && /* @__PURE__ */ e(
|
|
118
|
+
}), g && /* @__PURE__ */ e(le, {
|
|
116
119
|
contentClassName: s.agentSelectorContent,
|
|
117
120
|
disabled: a.hasRequestInProgress,
|
|
118
|
-
fetcher:
|
|
119
|
-
hostAppName:
|
|
120
|
-
onSelectAgent:
|
|
121
|
-
onSelectedAgentCallback:
|
|
122
|
-
recordAction:
|
|
123
|
-
requestState:
|
|
121
|
+
fetcher: X,
|
|
122
|
+
hostAppName: f,
|
|
123
|
+
onSelectAgent: P,
|
|
124
|
+
onSelectedAgentCallback: q,
|
|
125
|
+
recordAction: n,
|
|
126
|
+
requestState: K ? ge.ERROR : void 0,
|
|
124
127
|
shouldHideAgentSelectorOnLoad: !0,
|
|
125
128
|
triggerChipClassName: s.agentSelectorTrigger,
|
|
126
129
|
useAgentLocalStorage: !0
|
|
127
130
|
})]
|
|
128
131
|
})
|
|
129
|
-
}), /* @__PURE__ */ e(
|
|
132
|
+
}), /* @__PURE__ */ e(me, {
|
|
130
133
|
className: `box-content-answers-chat-container ${s.boxAiContentAnswers}`,
|
|
131
|
-
hasCustomSuggestedQuestions:
|
|
132
|
-
hostAppName:
|
|
134
|
+
hasCustomSuggestedQuestions: l,
|
|
135
|
+
hostAppName: f,
|
|
133
136
|
isAIStudioAgentSelectorEnabled: g,
|
|
134
|
-
isDebugModeEnabled:
|
|
135
|
-
isStopResponseEnabled:
|
|
136
|
-
items:
|
|
137
|
-
parentItem:
|
|
138
|
-
promptValue:
|
|
139
|
-
recordAction:
|
|
137
|
+
isDebugModeEnabled: _,
|
|
138
|
+
isStopResponseEnabled: k,
|
|
139
|
+
items: c,
|
|
140
|
+
parentItem: d,
|
|
141
|
+
promptValue: z,
|
|
142
|
+
recordAction: i,
|
|
140
143
|
setPromptValue: G,
|
|
141
|
-
shouldShowLandingPage:
|
|
144
|
+
shouldShowLandingPage: F,
|
|
142
145
|
...a
|
|
143
|
-
}),
|
|
146
|
+
}), u && /* @__PURE__ */ e(Ce, {
|
|
144
147
|
hasRequestInProgress: a.hasRequestInProgress,
|
|
145
|
-
onClick:
|
|
146
|
-
}), /* @__PURE__ */ e(
|
|
147
|
-
children: /* @__PURE__ */ e(
|
|
148
|
-
content:
|
|
148
|
+
onClick: V
|
|
149
|
+
}), /* @__PURE__ */ e(oe, {
|
|
150
|
+
children: /* @__PURE__ */ e(te, {
|
|
151
|
+
content: O.formatMessage(N),
|
|
149
152
|
"data-testid": "content-answers-close-modal-tooltip",
|
|
150
|
-
children: /* @__PURE__ */ e(
|
|
151
|
-
"aria-label":
|
|
153
|
+
children: /* @__PURE__ */ e(m.Close, {
|
|
154
|
+
"aria-label": O.formatMessage(N),
|
|
152
155
|
className: s["modal-close-button"],
|
|
153
|
-
"data-target-id":
|
|
154
|
-
icon:
|
|
156
|
+
"data-target-id": $,
|
|
157
|
+
icon: J,
|
|
155
158
|
size: "small"
|
|
156
159
|
})
|
|
157
160
|
})
|
|
158
161
|
})]
|
|
159
162
|
})]
|
|
160
163
|
});
|
|
161
|
-
return H ? /* @__PURE__ */ e(
|
|
162
|
-
children:
|
|
163
|
-
}) :
|
|
164
|
+
return H ? /* @__PURE__ */ e(ne, {
|
|
165
|
+
children: E
|
|
166
|
+
}) : E;
|
|
164
167
|
};
|
|
165
168
|
export {
|
|
166
|
-
|
|
167
|
-
|
|
169
|
+
He as IntelligenceModal,
|
|
170
|
+
He as default
|
|
168
171
|
};
|
|
@@ -1,64 +1,65 @@
|
|
|
1
|
-
import { Text as
|
|
2
|
-
import { ArrowsExpand as
|
|
3
|
-
import {
|
|
1
|
+
import { useBlueprintModernization as se, Text as ae, Tooltip as $, IconButton as y } from "@box/blueprint-web";
|
|
2
|
+
import { ArrowsExpand as ie, XMark as re } from "@box/blueprint-web-assets/icons/Fill";
|
|
3
|
+
import { ArrowsMaximize as ce } from "@box/blueprint-web-assets/icons/Medium";
|
|
4
|
+
import { useAgents as de, BoxAiAgentSelectorWithApi as le } from "@box/box-ai-agent-selector";
|
|
4
5
|
import D from "clsx";
|
|
5
|
-
import
|
|
6
|
+
import H from "lodash/isEqual";
|
|
6
7
|
import * as b from "react";
|
|
7
|
-
import { useIntl as
|
|
8
|
-
import { BoxAiContentAnswers as
|
|
9
|
-
import { withApiWrapper as
|
|
10
|
-
import { ORIGIN_BOXAI_SIDEBAR as
|
|
11
|
-
import { mark as
|
|
12
|
-
import { C as
|
|
13
|
-
import { IntelligenceModal as
|
|
14
|
-
import { IntelligenceSidebarContext as
|
|
8
|
+
import { useIntl as be } from "react-intl";
|
|
9
|
+
import { BoxAiContentAnswers as pe } from "../../box-ai-content-answers.js";
|
|
10
|
+
import { withApiWrapper as Se } from "../api-wrapper/api-wrapper.js";
|
|
11
|
+
import { ORIGIN_BOXAI_SIDEBAR as Ae, EVENT_JS_READY as me } from "../common/constants.js";
|
|
12
|
+
import { mark as he } from "../common/performance.js";
|
|
13
|
+
import { C as ue } from "../../../../chunks/clear-conversation-button.js";
|
|
14
|
+
import { IntelligenceModal as Ie } from "../modal/modal.js";
|
|
15
|
+
import { IntelligenceSidebarContext as _e } from "./context.js";
|
|
15
16
|
import p from "./messages.js";
|
|
16
|
-
import
|
|
17
|
-
import { jsxs as h, Fragment as
|
|
18
|
-
import '../../../../styles/content.css';const
|
|
19
|
-
bcsSidebarBase:
|
|
20
|
-
bcsContent:
|
|
21
|
-
bcsBoxAISidebar:
|
|
22
|
-
bcsContentHeader:
|
|
23
|
-
bcsTitle:
|
|
24
|
-
bcsScrollContent:
|
|
25
|
-
withModalOpen:
|
|
26
|
-
bcsBoxAISidebarAgentSelector:
|
|
27
|
-
bcsBoxAISidebarAgentSelectorContainer:
|
|
28
|
-
bcsBoxAISidebarChatActions:
|
|
29
|
-
bcsBoxAISidebarContent:
|
|
30
|
-
bcsBoxAISidebarExpand:
|
|
31
|
-
bcsBoxAISidebarClear:
|
|
32
|
-
bcsBoxAISidebarTitlePart:
|
|
33
|
-
bcsBoxAISidebarClose:
|
|
34
|
-
sidebarChip:
|
|
35
|
-
bcsContentSubheader:
|
|
36
|
-
bcsScrollContentWrapper:
|
|
37
|
-
withSubheader:
|
|
38
|
-
expanded:
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
const
|
|
17
|
+
import Ce from "./title.js";
|
|
18
|
+
import { jsxs as h, Fragment as Q, jsx as e } from "react/jsx-runtime";
|
|
19
|
+
import '../../../../styles/content.css';const xe = "_bcsSidebarBase_1kkpe_2", ge = "_bcsContent_1kkpe_2", Be = "_bcsBoxAISidebar_1kkpe_2", fe = "_bcsContentHeader_1kkpe_6", ke = "_bcsTitle_1kkpe_15", we = "_bcsScrollContent_1kkpe_22", Te = "_withModalOpen_1kkpe_32", Ee = "_bcsBoxAISidebarAgentSelector_1kkpe_35", Ne = "_bcsBoxAISidebarAgentSelectorContainer_1kkpe_39", Me = "_bcsBoxAISidebarChatActions_1kkpe_43", ve = "_bcsBoxAISidebarContent_1kkpe_47", Pe = "_bcsBoxAISidebarExpand_1kkpe_50", Le = "_bcsBoxAISidebarClear_1kkpe_53", Oe = "_bcsBoxAISidebarTitlePart_1kkpe_56", Re = "_bcsBoxAISidebarClose_1kkpe_77", qe = "_sidebarChip_1kkpe_88", Ue = "_bcsContentSubheader_1kkpe_101", Ve = "_bcsScrollContentWrapper_1kkpe_110", We = "_withSubheader_1kkpe_115", ze = "_expanded_1kkpe_118", t = {
|
|
20
|
+
bcsSidebarBase: xe,
|
|
21
|
+
bcsContent: ge,
|
|
22
|
+
bcsBoxAISidebar: Be,
|
|
23
|
+
bcsContentHeader: fe,
|
|
24
|
+
bcsTitle: ke,
|
|
25
|
+
bcsScrollContent: we,
|
|
26
|
+
withModalOpen: Te,
|
|
27
|
+
bcsBoxAISidebarAgentSelector: Ee,
|
|
28
|
+
bcsBoxAISidebarAgentSelectorContainer: Ne,
|
|
29
|
+
bcsBoxAISidebarChatActions: Me,
|
|
30
|
+
bcsBoxAISidebarContent: ve,
|
|
31
|
+
bcsBoxAISidebarExpand: Pe,
|
|
32
|
+
bcsBoxAISidebarClear: Le,
|
|
33
|
+
bcsBoxAISidebarTitlePart: Oe,
|
|
34
|
+
bcsBoxAISidebarClose: Re,
|
|
35
|
+
sidebarChip: qe,
|
|
36
|
+
bcsContentSubheader: Ue,
|
|
37
|
+
bcsScrollContentWrapper: Ve,
|
|
38
|
+
withSubheader: We,
|
|
39
|
+
expanded: ze
|
|
40
|
+
}, Fe = `${Ae}_${me}`;
|
|
41
|
+
he(Fe);
|
|
42
|
+
const $e = ({
|
|
42
43
|
actions: f,
|
|
43
44
|
children: i,
|
|
44
45
|
className: o,
|
|
45
46
|
elementId: S = "",
|
|
46
|
-
sidebarView:
|
|
47
|
+
sidebarView: u = "",
|
|
47
48
|
title: r,
|
|
48
49
|
subheader: c,
|
|
49
50
|
...d
|
|
50
51
|
}) => {
|
|
51
|
-
const A = `${S}${S === "" ? "" : "_"}${
|
|
52
|
+
const A = `${S}${S === "" ? "" : "_"}${u}`, I = `${A}-content`;
|
|
52
53
|
return /* @__PURE__ */ h("div", {
|
|
53
54
|
"aria-labelledby": A,
|
|
54
55
|
className: D(t.bcsContent, o),
|
|
55
56
|
"data-testid": "bcs-content",
|
|
56
|
-
id:
|
|
57
|
+
id: I,
|
|
57
58
|
role: "tabpanel",
|
|
58
59
|
...d,
|
|
59
60
|
children: [/* @__PURE__ */ h("div", {
|
|
60
61
|
className: t.bcsContentHeader,
|
|
61
|
-
children: [r && /* @__PURE__ */ e(
|
|
62
|
+
children: [r && /* @__PURE__ */ e(ae, {
|
|
62
63
|
as: "h3",
|
|
63
64
|
className: t.bcsTitle,
|
|
64
65
|
children: r
|
|
@@ -75,59 +76,61 @@ const We = ({
|
|
|
75
76
|
})]
|
|
76
77
|
});
|
|
77
78
|
};
|
|
78
|
-
function
|
|
79
|
+
function ye(f) {
|
|
79
80
|
const {
|
|
80
81
|
createSession: i,
|
|
81
82
|
encodedSession: o,
|
|
82
83
|
onClearAction: S,
|
|
83
|
-
getAIStudioAgents:
|
|
84
|
+
getAIStudioAgents: u,
|
|
84
85
|
hasRequestInProgress: r,
|
|
85
86
|
hostAppName: c,
|
|
86
87
|
isAIStudioAgentSelectorEnabled: d,
|
|
87
88
|
isLoading: A,
|
|
88
|
-
onSelectAgent:
|
|
89
|
+
onSelectAgent: I,
|
|
89
90
|
questions: _,
|
|
90
91
|
shouldShowLandingPage: N = !0,
|
|
91
92
|
sendQuestion: C,
|
|
92
93
|
stopQuestion: k,
|
|
93
94
|
embedTheAnswerButtonConfig: j,
|
|
94
|
-
onClose:
|
|
95
|
-
...
|
|
95
|
+
onClose: M,
|
|
96
|
+
...v
|
|
96
97
|
} = f, {
|
|
97
98
|
formatMessage: l
|
|
98
|
-
} =
|
|
99
|
+
} = be(), {
|
|
100
|
+
enableModernizedComponents: J
|
|
101
|
+
} = se(), P = b.useRef(!1), [w, L] = b.useState(!1), {
|
|
99
102
|
cache: s,
|
|
100
103
|
contentName: O,
|
|
101
|
-
elementId:
|
|
102
|
-
fileExtension:
|
|
104
|
+
elementId: X,
|
|
105
|
+
fileExtension: Y,
|
|
103
106
|
isFeedbackEnabled: R,
|
|
104
107
|
isFeedbackFormEnabled: q,
|
|
105
108
|
isStopResponseEnabled: U,
|
|
106
109
|
items: T,
|
|
107
|
-
itemSize:
|
|
110
|
+
itemSize: G,
|
|
108
111
|
onFeedbackFormSubmit: V,
|
|
109
112
|
onUserInteraction: W,
|
|
110
|
-
onSelectedAgentCallback:
|
|
113
|
+
onSelectedAgentCallback: K,
|
|
111
114
|
recordAction: m,
|
|
112
115
|
setCacheValue: x,
|
|
113
116
|
shouldPreinitSession: g
|
|
114
|
-
} = b.useContext(
|
|
115
|
-
agents:
|
|
116
|
-
requestState:
|
|
117
|
+
} = b.useContext(_e), {
|
|
118
|
+
agents: Z,
|
|
119
|
+
requestState: ee,
|
|
117
120
|
selectedAgent: E
|
|
118
|
-
} =
|
|
121
|
+
} = de(), {
|
|
119
122
|
questions: a
|
|
120
|
-
} = s, [
|
|
121
|
-
s.shouldShowLandingPage !== N && x("shouldShowLandingPage", N), s.encodedSession !== o && x("encodedSession", o),
|
|
122
|
-
agents:
|
|
123
|
-
requestState:
|
|
123
|
+
} = s, [z, F] = b.useState("");
|
|
124
|
+
s.shouldShowLandingPage !== N && x("shouldShowLandingPage", N), s.encodedSession !== o && x("encodedSession", o), H(s.questions, _) || x("questions", _), H(s.agents.selectedAgent, E) || x("agents", {
|
|
125
|
+
agents: Z,
|
|
126
|
+
requestState: ee,
|
|
124
127
|
selectedAgent: E
|
|
125
128
|
});
|
|
126
129
|
const B = (n = !1) => {
|
|
127
130
|
!g && !o && !A && i && i(!0, !1), n && W && W();
|
|
128
|
-
}, ee = () => {
|
|
129
|
-
L(!1);
|
|
130
131
|
}, te = () => {
|
|
132
|
+
L(!1);
|
|
133
|
+
}, oe = () => {
|
|
131
134
|
B(), L(!0);
|
|
132
135
|
};
|
|
133
136
|
b.useEffect(() => (g && !o && i && i(!0, !0), o && a.length > 0 && a[a.length - 1].isCompleted === !1 && C({
|
|
@@ -147,21 +150,21 @@ function Fe(f) {
|
|
|
147
150
|
k();
|
|
148
151
|
}), []), b.useEffect(() => {
|
|
149
152
|
const n = a[a.length - 1];
|
|
150
|
-
!g && !
|
|
153
|
+
!g && !P.current && o && (n != null && n.isLoading) && (C(n, E, !1), P.current = !0);
|
|
151
154
|
}, [o]);
|
|
152
|
-
const
|
|
155
|
+
const ne = () => /* @__PURE__ */ h("div", {
|
|
153
156
|
className: t.bcsBoxAISidebarTitlePart,
|
|
154
|
-
children: [/* @__PURE__ */ e(
|
|
157
|
+
children: [/* @__PURE__ */ e(Ce, {
|
|
155
158
|
isAIStudioAgentSelectorEnabled: d
|
|
156
159
|
}), d && /* @__PURE__ */ e("div", {
|
|
157
160
|
className: t.bcsBoxAISidebarAgentSelector,
|
|
158
|
-
children: /* @__PURE__ */ e(
|
|
161
|
+
children: /* @__PURE__ */ e(le, {
|
|
159
162
|
disabled: r,
|
|
160
|
-
fetcher:
|
|
163
|
+
fetcher: u,
|
|
161
164
|
hostAppName: c,
|
|
162
165
|
onAgentsListOpen: B,
|
|
163
|
-
onSelectAgent:
|
|
164
|
-
onSelectedAgentCallback:
|
|
166
|
+
onSelectAgent: I,
|
|
167
|
+
onSelectedAgentCallback: K,
|
|
165
168
|
recordAction: m,
|
|
166
169
|
shouldHideAgentSelectorOnLoad: !0,
|
|
167
170
|
useAgentLocalStorage: !0,
|
|
@@ -169,35 +172,35 @@ function Fe(f) {
|
|
|
169
172
|
})
|
|
170
173
|
})]
|
|
171
174
|
});
|
|
172
|
-
return /* @__PURE__ */ h(
|
|
173
|
-
children: [/* @__PURE__ */ e(
|
|
174
|
-
actions: /* @__PURE__ */ h(
|
|
175
|
-
children: [
|
|
175
|
+
return /* @__PURE__ */ h(Q, {
|
|
176
|
+
children: [/* @__PURE__ */ e($e, {
|
|
177
|
+
actions: /* @__PURE__ */ h(Q, {
|
|
178
|
+
children: [ne(), /* @__PURE__ */ e(ue, {
|
|
176
179
|
className: t.bcsBoxAISidebarClear,
|
|
177
180
|
hasRequestInProgress: r,
|
|
178
181
|
onClick: S
|
|
179
|
-
}), /* @__PURE__ */ e(
|
|
182
|
+
}), /* @__PURE__ */ e($, {
|
|
180
183
|
content: l(p.sidebarBoxAISwitchToModalView),
|
|
181
184
|
"data-testid": "content-answers-open-modal-tooltip",
|
|
182
185
|
variant: "standard",
|
|
183
|
-
children: /* @__PURE__ */ e(
|
|
186
|
+
children: /* @__PURE__ */ e(y, {
|
|
184
187
|
"aria-label": l(p.sidebarBoxAISwitchToModalView),
|
|
185
188
|
className: t.bcsBoxAISidebarExpand,
|
|
186
189
|
"data-target-id": "IconButton-expandBoxAISidebar",
|
|
187
|
-
icon:
|
|
188
|
-
onClick:
|
|
190
|
+
icon: J ? ce : ie,
|
|
191
|
+
onClick: oe,
|
|
189
192
|
size: "small"
|
|
190
193
|
})
|
|
191
|
-
}),
|
|
194
|
+
}), M && /* @__PURE__ */ e($, {
|
|
192
195
|
content: l(p.sidebarBoxAIClose),
|
|
193
196
|
"data-testid": "content-answers-close-tooltip",
|
|
194
197
|
variant: "standard",
|
|
195
|
-
children: /* @__PURE__ */ e(
|
|
198
|
+
children: /* @__PURE__ */ e(y, {
|
|
196
199
|
"aria-label": l(p.sidebarBoxAIClose),
|
|
197
200
|
className: t.bcsBoxAISidebarClose,
|
|
198
201
|
"data-target-id": "IconButton-closeBoxAISidebar",
|
|
199
|
-
icon:
|
|
200
|
-
onClick:
|
|
202
|
+
icon: re,
|
|
203
|
+
onClick: M,
|
|
201
204
|
size: "small"
|
|
202
205
|
})
|
|
203
206
|
})]
|
|
@@ -205,11 +208,11 @@ function Fe(f) {
|
|
|
205
208
|
className: D(t.bcsBoxAISidebar, {
|
|
206
209
|
[t.withModalOpen]: w
|
|
207
210
|
}),
|
|
208
|
-
elementId:
|
|
211
|
+
elementId: X,
|
|
209
212
|
sidebarView: "box-ai",
|
|
210
213
|
children: /* @__PURE__ */ e("div", {
|
|
211
214
|
className: t.bcsBoxAISidebarContent,
|
|
212
|
-
children: /* @__PURE__ */ e(
|
|
215
|
+
children: /* @__PURE__ */ e(pe, {
|
|
213
216
|
className: t.bcsBoxAISidebarContentAnswers,
|
|
214
217
|
contentName: O,
|
|
215
218
|
contentType: l(p.sidebarBoxAIContent),
|
|
@@ -222,23 +225,23 @@ function Fe(f) {
|
|
|
222
225
|
items: T,
|
|
223
226
|
onFeedbackFormSubmit: V,
|
|
224
227
|
onUserIntentToUseAI: B,
|
|
225
|
-
promptValue:
|
|
228
|
+
promptValue: z,
|
|
226
229
|
questions: _,
|
|
227
230
|
recordAction: m,
|
|
228
|
-
setPromptValue:
|
|
231
|
+
setPromptValue: F,
|
|
229
232
|
shouldShowLandingPage: s.shouldShowLandingPage,
|
|
230
233
|
showLoadingIndicator: A && g,
|
|
231
234
|
stopQuestion: k,
|
|
232
235
|
submitQuestion: C,
|
|
233
236
|
variant: "sidebar",
|
|
234
|
-
...
|
|
237
|
+
...v
|
|
235
238
|
})
|
|
236
239
|
})
|
|
237
|
-
}), /* @__PURE__ */ e(
|
|
240
|
+
}), /* @__PURE__ */ e(Ie, {
|
|
238
241
|
contentName: O,
|
|
239
242
|
contentType: l(p.sidebarBoxAIContent),
|
|
240
|
-
extension:
|
|
241
|
-
getAIStudioAgents:
|
|
243
|
+
extension: Y,
|
|
244
|
+
getAIStudioAgents: u,
|
|
242
245
|
hasRequestInProgress: r,
|
|
243
246
|
hostAppName: c,
|
|
244
247
|
isAIStudioAgentSelectorEnabled: d,
|
|
@@ -246,29 +249,29 @@ function Fe(f) {
|
|
|
246
249
|
isFeedbackFormEnabled: q,
|
|
247
250
|
isStopResponseEnabled: U,
|
|
248
251
|
items: T,
|
|
249
|
-
itemSize:
|
|
252
|
+
itemSize: G,
|
|
250
253
|
onClearAction: S,
|
|
251
254
|
onFeedbackFormSubmit: V,
|
|
252
|
-
onOpenChange:
|
|
253
|
-
onSelectAgent:
|
|
255
|
+
onOpenChange: te,
|
|
256
|
+
onSelectAgent: I,
|
|
254
257
|
onUserIntentToUseAI: B,
|
|
255
258
|
open: w,
|
|
256
|
-
promptValue:
|
|
259
|
+
promptValue: z,
|
|
257
260
|
questions: _,
|
|
258
261
|
recordAction: w ? m : void 0,
|
|
259
|
-
setPromptValue:
|
|
262
|
+
setPromptValue: F,
|
|
260
263
|
shouldShowLandingPage: s.shouldShowLandingPage,
|
|
261
264
|
showLoadingIndicator: !1,
|
|
262
265
|
stopPropagationOnEsc: !0,
|
|
263
266
|
stopQuestion: k,
|
|
264
267
|
submitQuestion: C,
|
|
265
268
|
variant: "collapsible",
|
|
266
|
-
...
|
|
269
|
+
...v,
|
|
267
270
|
shouldRenderProviders: !1
|
|
268
271
|
})]
|
|
269
272
|
});
|
|
270
273
|
}
|
|
271
|
-
const
|
|
274
|
+
const ct = Se(ye);
|
|
272
275
|
export {
|
|
273
|
-
|
|
276
|
+
ct as default
|
|
274
277
|
};
|