@box/box-ai-content-answers 0.157.0 → 0.158.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.
Files changed (65) hide show
  1. package/dist/esm/lib/components/answer/answer.js +122 -113
  2. package/dist/esm/lib/components/answer/messages.js +4 -0
  3. package/dist/esm/lib/components/chat/chat.js +70 -68
  4. package/dist/esm/lib/components/content/content.js +25 -25
  5. package/dist/esm/lib/components/thinkingBubble/thinkingBubble.js +75 -72
  6. package/dist/esm/lib/components/welcome-message/messages.js +2 -2
  7. package/dist/i18n/bn-IN.js +3 -2
  8. package/dist/i18n/bn-IN.properties +13 -3
  9. package/dist/i18n/da-DK.js +3 -2
  10. package/dist/i18n/da-DK.properties +13 -3
  11. package/dist/i18n/de-DE.js +3 -2
  12. package/dist/i18n/de-DE.properties +13 -3
  13. package/dist/i18n/en-AU.js +2 -1
  14. package/dist/i18n/en-AU.properties +12 -2
  15. package/dist/i18n/en-CA.js +2 -1
  16. package/dist/i18n/en-CA.properties +12 -2
  17. package/dist/i18n/en-GB.js +2 -1
  18. package/dist/i18n/en-GB.properties +12 -2
  19. package/dist/i18n/en-US.js +3 -2
  20. package/dist/i18n/en-US.properties +4 -2
  21. package/dist/i18n/en-x-pseudo.js +86 -85
  22. package/dist/i18n/en-x-pseudo.properties +91 -81
  23. package/dist/i18n/es-419.js +3 -2
  24. package/dist/i18n/es-419.properties +13 -3
  25. package/dist/i18n/es-ES.js +3 -2
  26. package/dist/i18n/es-ES.properties +13 -3
  27. package/dist/i18n/fi-FI.js +3 -2
  28. package/dist/i18n/fi-FI.properties +13 -3
  29. package/dist/i18n/fr-CA.js +3 -2
  30. package/dist/i18n/fr-CA.properties +13 -3
  31. package/dist/i18n/fr-FR.js +3 -2
  32. package/dist/i18n/fr-FR.properties +13 -3
  33. package/dist/i18n/hi-IN.js +3 -2
  34. package/dist/i18n/hi-IN.properties +13 -3
  35. package/dist/i18n/it-IT.js +3 -2
  36. package/dist/i18n/it-IT.properties +13 -3
  37. package/dist/i18n/ja-JP.js +3 -2
  38. package/dist/i18n/ja-JP.properties +13 -3
  39. package/dist/i18n/json/src/lib/components/answer/messages.json +1 -1
  40. package/dist/i18n/json/src/lib/components/welcome-message/messages.json +1 -1
  41. package/dist/i18n/ko-KR.js +3 -2
  42. package/dist/i18n/ko-KR.properties +13 -3
  43. package/dist/i18n/nb-NO.js +3 -2
  44. package/dist/i18n/nb-NO.properties +13 -3
  45. package/dist/i18n/nl-NL.js +3 -2
  46. package/dist/i18n/nl-NL.properties +13 -3
  47. package/dist/i18n/pl-PL.js +3 -2
  48. package/dist/i18n/pl-PL.properties +13 -3
  49. package/dist/i18n/pt-BR.js +3 -2
  50. package/dist/i18n/pt-BR.properties +13 -3
  51. package/dist/i18n/ru-RU.js +3 -2
  52. package/dist/i18n/ru-RU.properties +13 -3
  53. package/dist/i18n/sv-SE.js +3 -2
  54. package/dist/i18n/sv-SE.properties +13 -3
  55. package/dist/i18n/tr-TR.js +3 -2
  56. package/dist/i18n/tr-TR.properties +13 -3
  57. package/dist/i18n/zh-CN.js +3 -2
  58. package/dist/i18n/zh-CN.properties +13 -3
  59. package/dist/i18n/zh-TW.js +3 -2
  60. package/dist/i18n/zh-TW.properties +13 -3
  61. package/dist/styles/answer.css +1 -1
  62. package/dist/types/lib/components/answer/messages.d.ts +5 -0
  63. package/dist/types/lib/components/chat/chat.d.ts +1 -1
  64. package/dist/types/lib/components/thinkingBubble/thinkingBubble.d.ts +1 -0
  65. package/package.json +4 -4
@@ -1,174 +1,183 @@
1
- import { Text as K } from "@box/blueprint-web";
1
+ import { Text as N } from "@box/blueprint-web";
2
2
  import { AlertTriangle as Q } from "@box/blueprint-web-assets/icons/Line";
3
- import { Gray65 as X, Size4 as N } from "@box/blueprint-web-assets/tokens/tokens";
4
- import g from "clsx";
5
- import { memo as Y, useState as Z, useEffect as I, useMemo as $ } from "react";
6
- import { useIntl as oo } from "react-intl";
3
+ import { Gray65 as X, Size4 as I } from "@box/blueprint-web-assets/tokens/tokens";
4
+ import w from "clsx";
5
+ import { memo as Y, useState as Z, useEffect as T, useMemo as $ } from "react";
6
+ import { useIntl as tt } from "react-intl";
7
7
  import { A as r } from "../../../../chunks/types.js";
8
- import { injectInlineCitation as to } from "../../utils/inlineCitationsUtils.js";
8
+ import { injectInlineCitation as ot } from "../../utils/inlineCitationsUtils.js";
9
9
  import { MediaContainer as S } from "../common/media-container.js";
10
- import { BoxAILoadingIndicator as no } from "../thinkingBubble/boxAILoadingIndicator.js";
11
- import { AnswerContent as eo } from "./answer-content.js";
12
- import { CopyButton as ro } from "./copy-button.js";
13
- import { InlineError as so } from "./inline-error.js";
14
- import _ from "./messages.js";
15
- import { References as ao } from "./references.js";
16
- import { ThumbButtons as io } from "./thumb-buttons.js";
17
- import { jsxs as c, jsx as e } from "react/jsx-runtime";
18
- import '../../../../styles/answer.css';const lo = "_answer_dkxyx_1", co = "_loadingContainer_dkxyx_5", uo = "_alertIcon_dkxyx_11", _o = "_error_dkxyx_14", fo = "_footer_dkxyx_18", mo = "_copyButtonContainer_dkxyx_24", ho = "_feedbackButtonsContainer_dkxyx_25", xo = "_shouldHaveMarginTop_dkxyx_29", Eo = "_shouldUseAnimation_dkxyx_32", po = "_shouldAnimateHeight_dkxyx_36", No = "_footerButtons_dkxyx_40", go = "_iconAvatar_dkxyx_46", Io = "_buttonsVisible_dkxyx_62", o = {
19
- answer: lo,
20
- loadingContainer: co,
21
- alertIcon: uo,
22
- error: _o,
23
- footer: fo,
24
- copyButtonContainer: mo,
25
- feedbackButtonsContainer: ho,
26
- shouldHaveMarginTop: xo,
27
- shouldUseAnimation: Eo,
28
- shouldAnimateHeight: po,
29
- footerButtons: No,
30
- iconAvatar: go,
31
- buttonsVisible: Io
32
- }, So = /* @__PURE__ */ new Set([r.RATE_LIMITING, r.NO_CONTENT, r.PRECONDITION_FAILED, r.GENERAL, r.AGENT_NOT_FOUND]), Go = /* @__PURE__ */ Y(({
33
- answer: t,
34
- citations: y,
35
- error: n,
36
- contentType: R,
37
- hostAppName: d,
38
- feedbackValue: T,
39
- isCitationsEnabled: k = !1,
10
+ import { BoxAILoadingIndicator as nt } from "../thinkingBubble/boxAILoadingIndicator.js";
11
+ import { AnswerContent as et } from "./answer-content.js";
12
+ import { CopyButton as rt } from "./copy-button.js";
13
+ import { InlineError as st } from "./inline-error.js";
14
+ import u from "./messages.js";
15
+ import { References as at } from "./references.js";
16
+ import { ThumbButtons as it } from "./thumb-buttons.js";
17
+ import { jsxs as c, jsx as n } from "react/jsx-runtime";
18
+ import '../../../../styles/answer.css';const lt = "_answer_rp7w7_1", ct = "_loadingContainer_rp7w7_5", dt = "_loadingText_rp7w7_12", ut = "_fadeIn_rp7w7_1", _t = "_alertIcon_rp7w7_21", ft = "_error_rp7w7_24", mt = "_footer_rp7w7_28", pt = "_copyButtonContainer_rp7w7_34", ht = "_feedbackButtonsContainer_rp7w7_35", Et = "_shouldHaveMarginTop_rp7w7_39", gt = "_shouldUseAnimation_rp7w7_42", Nt = "_shouldAnimateHeight_rp7w7_46", It = "_footerButtons_rp7w7_50", wt = "_iconAvatar_rp7w7_56", Tt = "_buttonsVisible_rp7w7_72", t = {
19
+ answer: lt,
20
+ loadingContainer: ct,
21
+ loadingText: dt,
22
+ fadeIn: ut,
23
+ alertIcon: _t,
24
+ error: ft,
25
+ footer: mt,
26
+ copyButtonContainer: pt,
27
+ feedbackButtonsContainer: ht,
28
+ shouldHaveMarginTop: Et,
29
+ shouldUseAnimation: gt,
30
+ shouldAnimateHeight: Nt,
31
+ footerButtons: It,
32
+ iconAvatar: wt,
33
+ buttonsVisible: Tt
34
+ }, St = /* @__PURE__ */ new Set([r.RATE_LIMITING, r.NO_CONTENT, r.PRECONDITION_FAILED, r.GENERAL, r.AGENT_NOT_FOUND]), Vt = /* @__PURE__ */ Y(({
35
+ answer: o,
36
+ citations: R,
37
+ error: e,
38
+ contentType: A,
39
+ hostAppName: _,
40
+ feedbackValue: O,
41
+ isCitationsEnabled: B = !1,
40
42
  isCompleted: s = !1,
41
- isFeedbackEnabled: A = !1,
42
- isFeedbackFormEnabled: O,
43
+ isFeedbackEnabled: b = !1,
44
+ isFeedbackFormEnabled: C,
43
45
  isFeedbackTooltipOpen: f,
44
46
  isInlineCitationsEnabled: m = !1,
45
- isLoading: B = !1,
46
- isMarkdownEnabled: b = !1,
47
+ isLoading: P = !1,
48
+ isMarkdownEnabled: x = !1,
47
49
  items: a = [],
48
- onAnswerCopy: C,
49
- onCitationClick: P,
50
- onFeedbackFormSubmit: w,
51
- onFeedbackTooltipOpenChange: M,
52
- prompt: v,
53
- promptType: D,
50
+ onAnswerCopy: v,
51
+ onCitationClick: M,
52
+ onFeedbackFormSubmit: y,
53
+ onFeedbackTooltipOpenChange: D,
54
+ prompt: L,
55
+ promptType: F,
54
56
  recordAction: i,
55
- shouldFeedbackFormIncludeFeedbackText: F,
56
- shouldFeedbackIncludePromptData: H,
57
- useAnimation: L = !0,
57
+ shouldFeedbackFormIncludeFeedbackText: H,
58
+ shouldFeedbackIncludePromptData: U,
59
+ useAnimation: k = !0,
58
60
  variant: l = "modal",
59
- isReactMarkdownEnabled: U,
60
- setAnswerFeedback: G,
61
- questionId: V
61
+ isReactMarkdownEnabled: G,
62
+ setAnswerFeedback: V,
63
+ questionId: j
62
64
  }) => {
63
- const h = So.has(n), x = B && !t && !n, [j, z] = Z(s), {
64
- formatMessage: u
65
- } = oo();
66
- I(() => {
67
- t && i && s && a.some((J) => t.includes(J.name)) && i({
65
+ const p = St.has(e), h = P && !o && !e, [z, q] = Z(s), {
66
+ formatMessage: d
67
+ } = tt();
68
+ T(() => {
69
+ o && i && s && a.some((K) => o.includes(K.name)) && i({
68
70
  action: "programmatic",
69
71
  component: l,
70
72
  feature: "answers",
71
73
  target: "links_detected",
72
74
  data: {
73
- hostAppName: d,
75
+ hostAppName: _,
74
76
  linkCount: a.length,
75
77
  fileNameCount: a.length
76
78
  }
77
79
  });
78
- }, [t, l, d, s, i, a]), I(() => {
79
- setTimeout(() => z(s), 0);
80
+ }, [o, l, _, s, i, a]), T(() => {
81
+ setTimeout(() => q(s), 0);
80
82
  }, [s]);
81
- const E = () => /* @__PURE__ */ e(Q, {
82
- className: o.alertIcon,
83
+ const E = () => /* @__PURE__ */ n(Q, {
84
+ className: t.alertIcon,
83
85
  color: X,
84
86
  "data-testid": "content-answers-error-alert-icon",
85
- height: N,
87
+ height: I,
86
88
  role: "presentation",
87
- width: N
88
- }), W = () => /* @__PURE__ */ c(K, {
89
+ width: I
90
+ }), W = () => /* @__PURE__ */ c(N, {
89
91
  as: "p",
90
- className: o.error,
92
+ className: t.error,
91
93
  color: "textOnLightSecondary",
92
94
  "data-testid": "content-answers-error",
93
95
  variant: "caption",
94
- children: [n === r.RESPONSE_INTERRUPTED && u(_.responseInterruptedError), n === r.RESPONSE_FAILED && u(_.responseFailedError), n === r.RESPONSE_STOPPED && u(_.responseStoppedError), n !== r.RESPONSE_STOPPED && E()]
95
- }), q = () => n !== r.RESPONSE_STOPPED ? /* @__PURE__ */ c("div", {
96
- className: g(o.footerButtons, "footer-buttons-container", {
97
- [o.buttonsVisible]: f
96
+ children: [e === r.RESPONSE_INTERRUPTED && d(u.responseInterruptedError), e === r.RESPONSE_FAILED && d(u.responseFailedError), e === r.RESPONSE_STOPPED && d(u.responseStoppedError), e !== r.RESPONSE_STOPPED && E()]
97
+ }), J = () => e !== r.RESPONSE_STOPPED ? /* @__PURE__ */ c("div", {
98
+ className: w(t.footerButtons, "footer-buttons-container", {
99
+ [t.buttonsVisible]: f
98
100
  }),
99
- children: [A ? /* @__PURE__ */ e("div", {
100
- className: o.feedbackButtonsContainer,
101
- children: /* @__PURE__ */ e(io, {
102
- feedbackValue: T,
103
- hostAppName: d,
104
- isFeedbackFormEnabled: O,
101
+ children: [b ? /* @__PURE__ */ n("div", {
102
+ className: t.feedbackButtonsContainer,
103
+ children: /* @__PURE__ */ n(it, {
104
+ feedbackValue: O,
105
+ hostAppName: _,
106
+ isFeedbackFormEnabled: C,
105
107
  isFeedbackTooltipOpen: f,
106
108
  items: a,
107
- onFeedbackFormSubmit: w,
108
- onFeedbackTooltipOpenChange: M,
109
- prompt: v,
110
- promptType: D,
111
- questionId: V,
109
+ onFeedbackFormSubmit: y,
110
+ onFeedbackTooltipOpenChange: D,
111
+ prompt: L,
112
+ promptType: F,
113
+ questionId: j,
112
114
  recordAction: i,
113
- response: p,
114
- setAnswerFeedback: G,
115
- shouldFeedbackFormIncludeFeedbackText: F,
116
- shouldFeedbackIncludePromptData: H,
115
+ response: g,
116
+ setAnswerFeedback: V,
117
+ shouldFeedbackFormIncludeFeedbackText: H,
118
+ shouldFeedbackIncludePromptData: U,
117
119
  variant: l
118
120
  })
119
- }) : null, /* @__PURE__ */ e("div", {
120
- className: o.copyButtonContainer,
121
- children: /* @__PURE__ */ e(ro, {
122
- answer: t,
123
- onAnswerCopy: C,
121
+ }) : null, /* @__PURE__ */ n("div", {
122
+ className: t.copyButtonContainer,
123
+ children: /* @__PURE__ */ n(rt, {
124
+ answer: o,
125
+ onAnswerCopy: v,
124
126
  recordAction: i
125
127
  })
126
128
  })]
127
- }) : t ? null : E(), p = $(() => t && to(t, {
129
+ }) : o ? null : E(), g = $(() => o && ot(o, {
128
130
  items: a,
129
131
  isCompleted: s,
130
132
  isInlineCitationsEnabled: m
131
- }), [t, a, s, m]);
133
+ }), [o, a, s, m]);
132
134
  return /* @__PURE__ */ c("div", {
133
135
  "aria-live": "polite",
134
- className: o.answer,
136
+ className: t.answer,
135
137
  "data-testid": "content-answers-answer",
136
- children: [x && /* @__PURE__ */ e(no, {
137
- className: o.loadingContainer
138
- }), !h && !x && /* @__PURE__ */ e(S, {
138
+ children: [h && /* @__PURE__ */ c("div", {
139
+ className: t.loadingContainer,
140
+ children: [/* @__PURE__ */ n(nt, {}), /* @__PURE__ */ n(N, {
141
+ as: "span",
142
+ className: t.loadingText,
143
+ color: "textOnLightDefault",
144
+ variant: "titleMedium",
145
+ children: d(u.analyzingRequest)
146
+ })]
147
+ }), !p && !h && /* @__PURE__ */ n(S, {
139
148
  className: "answer",
140
149
  variant: l,
141
150
  children: /* @__PURE__ */ c(S.Content, {
142
151
  isUsedInsideSidebar: l === "sidebar",
143
152
  variant: "answer",
144
- children: [/* @__PURE__ */ e(eo, {
145
- answer: p,
146
- isMarkdownEnabled: b,
147
- isReactMarkdownEnabled: U,
153
+ children: [/* @__PURE__ */ n(et, {
154
+ answer: g,
155
+ isMarkdownEnabled: x,
156
+ isReactMarkdownEnabled: G,
148
157
  variant: l
149
158
  }), s && /* @__PURE__ */ c("div", {
150
- className: g(o.footer, {
151
- [o.shouldHaveMarginTop]: t,
152
- [o.shouldAnimateHeight]: j,
153
- [o.shouldUseAnimation]: L
159
+ className: w(t.footer, {
160
+ [t.shouldHaveMarginTop]: o,
161
+ [t.shouldAnimateHeight]: z,
162
+ [t.shouldUseAnimation]: k
154
163
  }),
155
164
  "data-testid": "content-answers-answer-footer",
156
- children: [n && W(), k && !n && /* @__PURE__ */ e(ao, {
157
- citations: y,
158
- onCitationClick: P,
165
+ children: [e && W(), B && !e && /* @__PURE__ */ n(at, {
166
+ citations: R,
167
+ onCitationClick: M,
159
168
  recordAction: i
160
- }), q()]
169
+ }), J()]
161
170
  })]
162
171
  })
163
- }), h && /* @__PURE__ */ e(so, {
164
- contentType: R,
165
- error: n,
172
+ }), p && /* @__PURE__ */ n(st, {
173
+ contentType: A,
174
+ error: e,
166
175
  recordAction: i,
167
176
  variant: l
168
177
  })]
169
178
  });
170
179
  });
171
180
  export {
172
- Go as Answer,
173
- Go as default
181
+ Vt as Answer,
182
+ Vt as default
174
183
  };
@@ -100,6 +100,10 @@ const t = e({
100
100
  id: "boxAI.contentAnswers.loadingAnswer",
101
101
  defaultMessage: "Loading Answer..."
102
102
  },
103
+ analyzingRequest: {
104
+ id: "boxAI.contentAnswers.analyzingRequest",
105
+ defaultMessage: "Analyzing your request"
106
+ },
103
107
  noReferences: {
104
108
  id: "boxAI.contentAnswers.noReferences",
105
109
  defaultMessage: "Response based on general document analysis"
@@ -1,25 +1,25 @@
1
- import { Text as Y } from "@box/blueprint-web";
2
- import { BoxAiLogo as Z } from "@box/blueprint-web-assets/icons/Logo";
1
+ import { Text as Z } from "@box/blueprint-web";
2
+ import { BoxAiLogo as $ } from "@box/blueprint-web-assets/icons/Logo";
3
3
  import { Size10 as f } from "@box/blueprint-web-assets/tokens/tokens";
4
- import $ from "clsx";
5
- import * as w from "react";
6
- import { useIntl as L } from "react-intl";
7
- import { Answer as P } from "../answer/answer.js";
8
- import { MediaContainer as S } from "../common/media-container.js";
9
- import { Question as ee } from "../question/question.js";
10
- import { SuggestedQuestions as te } from "../suggested-questions/suggested-questions.js";
11
- import { ThinkingBubble as oe } from "../thinkingBubble/thinkingBubble.js";
12
- import ae from "../welcome-message/messages.js";
13
- import { WelcomeMessage as ie } from "../welcome-message/welcome-message.js";
4
+ import w from "clsx";
5
+ import * as L from "react";
6
+ import { useIntl as P } from "react-intl";
7
+ import { Answer as S } from "../answer/answer.js";
8
+ import { MediaContainer as ee } from "../common/media-container.js";
9
+ import { Question as te } from "../question/question.js";
10
+ import { SuggestedQuestions as oe } from "../suggested-questions/suggested-questions.js";
11
+ import { ThinkingBubble as ae } from "../thinkingBubble/thinkingBubble.js";
12
+ import ie from "../welcome-message/messages.js";
13
+ import { WelcomeMessage as re } from "../welcome-message/welcome-message.js";
14
14
  import { jsx as e, jsxs as _ } from "react/jsx-runtime";
15
- import '../../../../styles/chat.css';const re = "_chat_77vqr_1", se = "_clearChatText_77vqr_1", ne = "_landingPage_77vqr_7", ce = "_askQuestionText_77vqr_15", le = "_iconAvatar_77vqr_23", me = "_sidebar_77vqr_39", a = {
16
- chat: re,
17
- clearChatText: se,
18
- landingPage: ne,
19
- askQuestionText: ce,
20
- iconAvatar: le,
21
- sidebar: me
22
- }, qe = ({
15
+ import '../../../../styles/chat.css';const se = "_chat_77vqr_1", ne = "_clearChatText_77vqr_1", ce = "_landingPage_77vqr_7", le = "_askQuestionText_77vqr_15", me = "_iconAvatar_77vqr_23", pe = "_sidebar_77vqr_39", a = {
16
+ chat: se,
17
+ clearChatText: ne,
18
+ landingPage: ce,
19
+ askQuestionText: le,
20
+ iconAvatar: me,
21
+ sidebar: pe
22
+ }, Fe = ({
23
23
  askSuggestedQuestion: h,
24
24
  contentType: n,
25
25
  hasCustomSuggestedQuestions: T,
@@ -33,116 +33,118 @@ import '../../../../styles/chat.css';const re = "_chat_77vqr_1", se = "_clearCha
33
33
  onCitationClick: q,
34
34
  onAnswerCopy: F,
35
35
  onFeedbackFormSubmit: A,
36
- onSuggestedQuestionInteraction: I,
37
- questions: N,
36
+ onDropdownOpenChange: I,
37
+ onSuggestedQuestionInteraction: N,
38
+ questions: O,
38
39
  recordAction: c,
39
- setAnswerFeedback: O,
40
+ setAnswerFeedback: Q,
40
41
  setAskSuggestedQuestion: l,
41
42
  suggestedQuestions: m,
42
- suggestedQuestionsRequestState: Q,
43
- shouldFeedbackFormIncludeFeedbackText: j,
44
- shouldFeedbackIncludePromptData: y,
43
+ suggestedQuestionsRequestState: j,
44
+ shouldFeedbackFormIncludeFeedbackText: y,
45
+ shouldFeedbackIncludePromptData: B,
45
46
  shouldShowLandingPage: o,
46
- useAnimation: B,
47
+ useAnimation: M,
47
48
  variant: t = "modal",
48
- hostAppName: M = "",
49
- isReactMarkdownEnabled: z,
50
- welcomeMessageClearText: R,
49
+ hostAppName: z = "",
50
+ isReactMarkdownEnabled: R,
51
+ welcomeMessageClearText: W,
51
52
  ...p
52
53
  }) => {
53
54
  const {
54
- formatMessage: W
55
- } = L(), [D, E] = w.useState(null), G = (i, r) => {
56
- E(i ? r : null);
55
+ formatMessage: D
56
+ } = P(), [E, G] = L.useState(null), H = (i, r) => {
57
+ G(i ? r : null);
57
58
  };
58
59
  return /* @__PURE__ */ e("div", {
59
60
  className: a.chat,
60
61
  "data-testid": "content-answers-chat",
61
62
  children: /* @__PURE__ */ _("div", {
62
- className: $({
63
+ className: w({
63
64
  [a.landingPage]: o,
64
65
  [a.sidebar]: t === "sidebar"
65
66
  }),
66
- children: [o && /* @__PURE__ */ e(S.Figure, {
67
+ children: [o && /* @__PURE__ */ e(ee.Figure, {
67
68
  variant: t,
68
69
  children: /* @__PURE__ */ e("div", {
69
70
  className: a.iconAvatar,
70
- children: /* @__PURE__ */ e(Z, {
71
+ children: /* @__PURE__ */ e($, {
71
72
  height: f,
72
73
  role: "presentation",
73
74
  width: f
74
75
  })
75
76
  })
76
- }), /* @__PURE__ */ e(ie, {
77
+ }), /* @__PURE__ */ e(re, {
77
78
  contentType: "",
78
79
  shouldShowLandingPage: o,
79
80
  ...p,
80
81
  variant: t
81
- }), o && m !== void 0 && l !== void 0 && /* @__PURE__ */ e(te, {
82
+ }), o && m !== void 0 && l !== void 0 && /* @__PURE__ */ e(oe, {
82
83
  askSuggestedQuestion: h,
83
84
  hasCustomSuggestedQuestions: T,
84
85
  isLoading: x,
85
- onSuggestedQuestionInteraction: I,
86
+ onSuggestedQuestionInteraction: N,
86
87
  recordAction: c,
87
88
  setAskSuggestedQuestion: l,
88
89
  suggestedQuestions: m,
89
- suggestedQuestionsRequestState: Q,
90
+ suggestedQuestionsRequestState: j,
90
91
  variant: t
91
- }), /* @__PURE__ */ e(Y, {
92
+ }), /* @__PURE__ */ e(Z, {
92
93
  as: "p",
93
94
  className: a.clearChatText,
94
- children: R || W(ae.welcomeClearChatText, {
95
+ children: W || D(ie.welcomeClearChatText, {
95
96
  type: n
96
97
  })
97
98
  }), !o && /* @__PURE__ */ e("ul", {
98
- children: N.map(({
99
+ children: O.map(({
99
100
  answer: i,
100
101
  thinkingAnswer: r,
101
- citations: H,
102
+ citations: J,
102
103
  id: s,
103
- isCompleted: J,
104
- isLoading: K,
105
- error: U,
104
+ isCompleted: K,
105
+ isLoading: U,
106
+ error: V,
106
107
  prompt: d,
107
- promptType: V,
108
- feedbackValue: X
108
+ promptType: X,
109
+ feedbackValue: Y
109
110
  }) => /* @__PURE__ */ _("li", {
110
- children: [/* @__PURE__ */ e(ee, {
111
+ children: [/* @__PURE__ */ e(te, {
111
112
  prompt: d,
112
113
  variant: t
113
- }), r && /* @__PURE__ */ e(oe, {
114
+ }), r && /* @__PURE__ */ e(ae, {
114
115
  content: r,
115
116
  isThinkingComplete: !!i,
117
+ onDropdownOpenChange: I,
116
118
  variant: t
117
- }), /* @__PURE__ */ e(P, {
119
+ }), /* @__PURE__ */ e(S, {
118
120
  answer: i,
119
- citations: H,
121
+ citations: J,
120
122
  contentType: n,
121
- error: U,
122
- feedbackValue: X,
123
- hostAppName: M,
123
+ error: V,
124
+ feedbackValue: Y,
125
+ hostAppName: z,
124
126
  isCitationsEnabled: b,
125
- isCompleted: J,
127
+ isCompleted: K,
126
128
  isFeedbackEnabled: C,
127
129
  isFeedbackFormEnabled: v,
128
- isFeedbackTooltipOpen: D === s,
130
+ isFeedbackTooltipOpen: E === s,
129
131
  isInlineCitationsEnabled: g,
130
- isLoading: K || u,
132
+ isLoading: U || u,
131
133
  isMarkdownEnabled: k,
132
- isReactMarkdownEnabled: z,
134
+ isReactMarkdownEnabled: R,
133
135
  items: p.items,
134
136
  onAnswerCopy: F,
135
137
  onCitationClick: q,
136
138
  onFeedbackFormSubmit: A,
137
- onFeedbackTooltipOpenChange: G,
139
+ onFeedbackTooltipOpenChange: H,
138
140
  prompt: d,
139
- promptType: V,
141
+ promptType: X,
140
142
  questionId: s,
141
143
  recordAction: c,
142
- setAnswerFeedback: O,
143
- shouldFeedbackFormIncludeFeedbackText: j,
144
- shouldFeedbackIncludePromptData: y,
145
- useAnimation: B,
144
+ setAnswerFeedback: Q,
145
+ shouldFeedbackFormIncludeFeedbackText: y,
146
+ shouldFeedbackIncludePromptData: B,
147
+ useAnimation: M,
146
148
  variant: t
147
149
  })]
148
150
  }, s))
@@ -151,6 +153,6 @@ import '../../../../styles/chat.css';const re = "_chat_77vqr_1", se = "_clearCha
151
153
  });
152
154
  };
153
155
  export {
154
- qe as Chat,
155
- qe as default
156
+ Fe as Chat,
157
+ Fe as default
156
158
  };
@@ -4,10 +4,10 @@ import * as t from "react";
4
4
  import { useIntl as S } from "react-intl";
5
5
  import k from "../../messages.js";
6
6
  import { C as y } from "../../../../chunks/types.js";
7
- import { jsx as n, jsxs as H, Fragment as V } from "react/jsx-runtime";
7
+ import { jsx as r, jsxs as H, Fragment as V } from "react/jsx-runtime";
8
8
  import { ModalError as A } from "../modal-error/modal-error.js";
9
9
  import { Chat as B } from "../chat/chat.js";
10
- import '../../../../styles/content2.css';const D = "_loadingIndicatorWrapper_1juw3_1", G = "_content_1juw3_5", J = "_sidebar_1juw3_14", K = "_isLoading_1juw3_17", Q = "_messagesEnd_1juw3_21", U = "_innerContent_1juw3_25", r = {
10
+ import '../../../../styles/content2.css';const D = "_loadingIndicatorWrapper_1juw3_1", G = "_content_1juw3_5", J = "_sidebar_1juw3_14", K = "_isLoading_1juw3_17", Q = "_messagesEnd_1juw3_21", U = "_innerContent_1juw3_25", o = {
11
11
  loadingIndicatorWrapper: D,
12
12
  content: G,
13
13
  sidebar: J,
@@ -31,11 +31,11 @@ import '../../../../styles/content2.css';const D = "_loadingIndicatorWrapper_1ju
31
31
  hostAppName: I = "",
32
32
  ...L
33
33
  }) => {
34
- const d = t.useRef(null), l = t.useRef(null), f = t.useRef(null), o = t.useRef(!0), [g, N] = t.useState(!1), {
34
+ const f = t.useRef(null), l = t.useRef(null), d = t.useRef(null), n = t.useRef(!0), [g, N] = t.useState(!1), {
35
35
  formatMessage: O
36
36
  } = S(), E = u === y.LARGE_FILE, s = t.useCallback((a) => {
37
37
  var e;
38
- (e = f.current) != null && e.scrollIntoView && l.current && (!i || o.current) && f.current.scrollIntoView({
38
+ (e = d.current) != null && e.scrollIntoView && l.current && (!i || n.current) && d.current.scrollIntoView({
39
39
  behavior: a,
40
40
  block: "nearest"
41
41
  });
@@ -47,39 +47,39 @@ import '../../../../styles/content2.css';const D = "_loadingIndicatorWrapper_1ju
47
47
  scrollHeight: T
48
48
  } = l.current, W = T - (a + e);
49
49
  if (c && W > 100) {
50
- o.current = !1;
50
+ n.current = !1;
51
51
  return;
52
52
  }
53
- o.current = !0;
53
+ n.current = !0;
54
54
  }
55
55
  };
56
56
  t.useEffect(() => {
57
- g ? o.current = !1 : c && (o.current = !0, s("instant"));
57
+ g ? n.current = !1 : c && (n.current = !0, s("instant"));
58
58
  }, [g, s, c]), t.useEffect(() => {
59
- o.current = !0, s("instant");
59
+ n.current = !0, s("instant");
60
60
  }, [s]), t.useLayoutEffect(() => {
61
- if (!d.current)
61
+ if (!f.current)
62
62
  return;
63
63
  const a = new ResizeObserver(() => {
64
- s(i ? "instant" : "smooth");
65
- }), e = d.current;
64
+ n.current && s(i ? "instant" : "smooth");
65
+ }), e = f.current;
66
66
  return e && a.observe(e), () => {
67
67
  e && a.unobserve(e);
68
68
  };
69
69
  }, [s, i]);
70
- const z = () => h && !E ? /* @__PURE__ */ n(A, {
70
+ const z = () => h && !E ? /* @__PURE__ */ r(A, {
71
71
  error: u,
72
72
  recordAction: m
73
- }) : p ? /* @__PURE__ */ n("div", {
74
- className: r.loadingIndicatorWrapper,
75
- children: /* @__PURE__ */ n(F, {
73
+ }) : p ? /* @__PURE__ */ r("div", {
74
+ className: o.loadingIndicatorWrapper,
75
+ children: /* @__PURE__ */ r(F, {
76
76
  "aria-label": O(k.loading),
77
- className: r.loadingIndicator,
77
+ className: o.loadingIndicator,
78
78
  "data-testid": "content-answers-modal-loading-indicator",
79
79
  size: "large"
80
80
  })
81
81
  }) : /* @__PURE__ */ H(V, {
82
- children: [/* @__PURE__ */ n(B, {
82
+ children: [/* @__PURE__ */ r(B, {
83
83
  askSuggestedQuestion: b,
84
84
  hasCustomSuggestedQuestions: C,
85
85
  hasRequestInProgress: c,
@@ -93,19 +93,19 @@ import '../../../../styles/content2.css';const D = "_loadingIndicatorWrapper_1ju
93
93
  useAnimation: j,
94
94
  variant: _,
95
95
  ...L
96
- }), /* @__PURE__ */ n("div", {
97
- ref: f,
98
- className: r.messagesEnd
96
+ }), /* @__PURE__ */ r("div", {
97
+ ref: d,
98
+ className: o.messagesEnd
99
99
  })]
100
100
  });
101
- return /* @__PURE__ */ n("div", {
101
+ return /* @__PURE__ */ r("div", {
102
102
  ref: l,
103
- className: M(r.content, _ === "sidebar" && r.sidebar, p && r.isLoading),
103
+ className: M(o.content, _ === "sidebar" && o.sidebar, p && o.isLoading),
104
104
  "data-testid": "content-answers-content",
105
105
  onScroll: x,
106
- children: /* @__PURE__ */ n("div", {
107
- ref: d,
108
- className: r.innerContent,
106
+ children: /* @__PURE__ */ r("div", {
107
+ ref: f,
108
+ className: o.innerContent,
109
109
  children: z()
110
110
  })
111
111
  });