@box/box-ai-content-answers 0.86.2 → 0.87.2

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 (127) hide show
  1. package/chunks/clear-conversation-button.js +12 -13
  2. package/chunks/markdown.js +12168 -0
  3. package/esm/lib/box-ai-content-answers.js +11 -12
  4. package/esm/lib/components/agents/agent-editor.js +7 -8
  5. package/esm/lib/components/agents/agent-selector.js +3 -4
  6. package/esm/lib/components/answer/answer-content.js +5 -6
  7. package/esm/lib/components/answer/answer.js +604 -107
  8. package/esm/lib/components/answer/citation.js +4 -5
  9. package/esm/lib/components/answer/inline-error.js +4 -5
  10. package/esm/lib/components/answer/loading-element.js +4 -5
  11. package/esm/lib/components/answer/references.js +19 -20
  12. package/esm/lib/components/answer/thumb-buttons.js +11 -12
  13. package/esm/lib/components/chat/chat.js +13 -14
  14. package/esm/lib/components/common/markdown.js +3 -12212
  15. package/esm/lib/components/common/media-container.js +10 -11
  16. package/esm/lib/components/content/content.js +4 -5
  17. package/esm/lib/components/footer/footer-actions.js +3 -4
  18. package/esm/lib/components/footer/footer.js +3 -4
  19. package/esm/lib/components/modal-error/modal-error.js +3 -4
  20. package/esm/lib/components/question/question.js +12 -13
  21. package/esm/lib/components/suggested-questions/suggested-questions.js +10 -11
  22. package/esm/lib/components/suggested-questions/suggestions.js +8 -9
  23. package/esm/lib/components/welcome-message/contextual-items-message.js +4 -5
  24. package/esm/lib/components/welcome-message/items-dropdown.js +15 -16
  25. package/esm/lib/components/welcome-message/unsupported-items-notice.js +9 -10
  26. package/esm/lib/components/welcome-message/welcome-message.js +11 -12
  27. package/i18n/bn-IN.js +3 -3
  28. package/i18n/bn-IN.properties +7 -3
  29. package/i18n/da-DK.js +3 -3
  30. package/i18n/da-DK.properties +7 -3
  31. package/i18n/de-DE.js +3 -3
  32. package/i18n/de-DE.properties +7 -3
  33. package/i18n/en-AU.js +3 -3
  34. package/i18n/en-AU.properties +7 -3
  35. package/i18n/en-CA.js +1 -1
  36. package/i18n/en-CA.properties +5 -1
  37. package/i18n/en-GB.js +3 -3
  38. package/i18n/en-GB.properties +7 -3
  39. package/i18n/en-x-pseudo.js +59 -59
  40. package/i18n/en-x-pseudo.properties +61 -57
  41. package/i18n/es-419.js +3 -3
  42. package/i18n/es-419.properties +7 -3
  43. package/i18n/es-ES.js +3 -3
  44. package/i18n/es-ES.properties +7 -3
  45. package/i18n/fi-FI.js +3 -3
  46. package/i18n/fi-FI.properties +7 -3
  47. package/i18n/fr-CA.js +3 -3
  48. package/i18n/fr-CA.properties +7 -3
  49. package/i18n/fr-FR.js +3 -3
  50. package/i18n/fr-FR.properties +7 -3
  51. package/i18n/hi-IN.js +3 -3
  52. package/i18n/hi-IN.properties +7 -3
  53. package/i18n/it-IT.js +3 -3
  54. package/i18n/it-IT.properties +7 -3
  55. package/i18n/ja-JP.js +4 -4
  56. package/i18n/ja-JP.properties +8 -4
  57. package/i18n/ko-KR.js +3 -3
  58. package/i18n/ko-KR.properties +7 -3
  59. package/i18n/nb-NO.js +3 -3
  60. package/i18n/nb-NO.properties +7 -3
  61. package/i18n/nl-NL.js +3 -3
  62. package/i18n/nl-NL.properties +7 -3
  63. package/i18n/pl-PL.js +3 -3
  64. package/i18n/pl-PL.properties +7 -3
  65. package/i18n/pt-BR.js +3 -3
  66. package/i18n/pt-BR.properties +7 -3
  67. package/i18n/ru-RU.js +3 -3
  68. package/i18n/ru-RU.properties +7 -3
  69. package/i18n/sv-SE.js +3 -3
  70. package/i18n/sv-SE.properties +7 -3
  71. package/i18n/tr-TR.js +3 -3
  72. package/i18n/tr-TR.properties +7 -3
  73. package/i18n/zh-CN.js +3 -3
  74. package/i18n/zh-CN.properties +7 -3
  75. package/i18n/zh-TW.js +3 -3
  76. package/i18n/zh-TW.properties +7 -3
  77. package/package.json +7 -7
  78. package/types/lib/box-ai-content-answers.d.ts +1 -1
  79. package/types/lib/components/agents/agent-editor.d.ts +1 -1
  80. package/types/lib/components/agents/agent-selector.d.ts +1 -1
  81. package/types/lib/components/agents/stories/shared.d.ts +3 -3
  82. package/types/lib/components/answer/answer-content.d.ts +2 -2
  83. package/types/lib/components/answer/answer.d.ts +1 -1
  84. package/types/lib/components/answer/citation.d.ts +1 -1
  85. package/types/lib/components/answer/copy-button.d.ts +1 -1
  86. package/types/lib/components/answer/inline-error.d.ts +1 -1
  87. package/types/lib/components/answer/loading-element.d.ts +1 -1
  88. package/types/lib/components/answer/no-citations.d.ts +1 -1
  89. package/types/lib/components/answer/references.d.ts +1 -1
  90. package/types/lib/components/answer/stories/shared.d.ts +1 -1
  91. package/types/lib/components/answer/thumb-buttons.d.ts +1 -1
  92. package/types/lib/components/api-wrapper/api-wrapper.d.ts +1 -1
  93. package/types/lib/components/api-wrapper/constants.d.ts +1 -1
  94. package/types/lib/components/api-wrapper/content-answers-component.d.ts +1 -1
  95. package/types/lib/components/api-wrapper/hooks/useContentAnswers.d.ts +4 -4
  96. package/types/lib/components/api-wrapper/records.d.ts +1 -1
  97. package/types/lib/components/api-wrapper/stories/shared.d.ts +1 -1
  98. package/types/lib/components/api-wrapper/test-utils/ReadableStreamSimulator.d.ts +1 -1
  99. package/types/lib/components/api-wrapper/types.d.ts +3 -3
  100. package/types/lib/components/api-wrapper/utils/format.d.ts +1 -1
  101. package/types/lib/components/api-wrapper/utils/request.d.ts +3 -3
  102. package/types/lib/components/api-wrapper/utils/stream.d.ts +1 -1
  103. package/types/lib/components/chat/chat.d.ts +1 -1
  104. package/types/lib/components/common/constants.d.ts +1 -1
  105. package/types/lib/components/common/media-container.d.ts +2 -2
  106. package/types/lib/components/common/mock-data.d.ts +4 -4
  107. package/types/lib/components/content/content.d.ts +1 -1
  108. package/types/lib/components/footer/footer-actions.d.ts +1 -1
  109. package/types/lib/components/footer/footer.d.ts +1 -1
  110. package/types/lib/components/footer/stories/shared.d.ts +7 -7
  111. package/types/lib/components/modal/modal.d.ts +5 -5
  112. package/types/lib/components/modal/stories/shared.d.ts +2 -2
  113. package/types/lib/components/modal-error/stories/shared.d.ts +1 -1
  114. package/types/lib/components/question/question.d.ts +1 -1
  115. package/types/lib/components/question/stories/shared.d.ts +1 -1
  116. package/types/lib/components/suggested-questions/mocks.d.ts +1 -1
  117. package/types/lib/components/suggested-questions/stories/shared.d.ts +1 -1
  118. package/types/lib/components/suggested-questions/suggested-questions.d.ts +1 -1
  119. package/types/lib/components/suggested-questions/suggestions.d.ts +1 -1
  120. package/types/lib/components/welcome-message/contextual-items-message.d.ts +1 -1
  121. package/types/lib/components/welcome-message/items-dropdown.d.ts +1 -1
  122. package/types/lib/components/welcome-message/stories/shared.d.ts +4 -4
  123. package/types/lib/components/welcome-message/unsupported-items-notice.d.ts +1 -1
  124. package/types/lib/components/welcome-message/welcome-message.d.ts +1 -1
  125. package/types/lib/contexts/AgentsContext.d.ts +1 -1
  126. package/types/lib/stories/shared.d.ts +3 -3
  127. package/types/lib/types.d.ts +2 -2
@@ -1,130 +1,627 @@
1
- import "../../../../styles/answer.css";
2
- import { useBreakpoint as M, Breakpoint as D, Text as F } from "@box/blueprint-web";
3
- import { AlertTriangle as H } from "@box/blueprint-web-assets/icons/Line";
4
- import { BoxAiLogo as x } from "@box/blueprint-web-assets/icons/Logo";
5
- import { Size5 as U, Size6 as b, Gray65 as k, Size4 as E } from "@box/blueprint-web-assets/tokens/tokens";
6
- import y from "clsx";
7
- import * as c from "react";
8
- import { useIntl as z } from "react-intl";
9
- import { A as t } from "../../../../chunks/types.js";
10
- import { MediaContainer as d } from "../common/media-container.js";
11
- import { AnswerContent as C } from "./answer-content.js";
12
- import { CopyButton as G } from "./copy-button.js";
13
- import { InlineError as W } from "./inline-error.js";
14
- import { LoadingElement as J } from "./loading-element.js";
15
- import { ThumbButtons as K } from "./thumb-buttons.js";
16
- import h from "./messages.js";
17
- import { References as Q } from "./references.js";
18
- import { jsxs as s, jsx as e } from "react/jsx-runtime";
19
- const V = "_answer_nhqjo_1", X = "_alertIcon_nhqjo_4", Y = "_error_nhqjo_7", Z = "_footer_nhqjo_11", $ = "_shouldHaveMarginTop_nhqjo_17", oo = "_shouldUseAnimation_nhqjo_20", eo = "_shouldAnimateHeight_nhqjo_24", to = "_footerButtons_nhqjo_28", no = "_iconAvatar_nhqjo_33", n = {
20
- answer: V,
21
- alertIcon: X,
22
- error: Y,
23
- footer: Z,
24
- shouldHaveMarginTop: $,
25
- shouldUseAnimation: oo,
26
- shouldAnimateHeight: eo,
27
- footerButtons: to,
28
- iconAvatar: no
29
- }, ro = /* @__PURE__ */ new Set([t.RATE_LIMITING, t.NO_CONTENT, t.PRECONDITION_FAILED, t.GENERAL, t.AGENT_NOT_FOUND]), Oo = /* @__PURE__ */ c.memo(({
30
- answer: i,
31
- citations: S,
32
- error: o,
33
- contentType: N,
34
- hostAppName: A,
35
- isCitationsEnabled: I = !1,
36
- isCompleted: a = !1,
37
- isFeedbackEnabled: T = !1,
38
- isLoading: g = !1,
39
- isMarkdownEnabled: R = !1,
40
- items: O = [],
41
- onCitationClick: P,
42
- onAnswerCopy: w,
43
- recordAction: l,
44
- useAnimation: v = !0,
45
- variant: r = "modal"
1
+ import { c as k } from "../../../../chunks/markdown.js";
2
+ import { useBreakpoint as it, Breakpoint as vt, Text as st } from "@box/blueprint-web";
3
+ import { AlertTriangle as ct } from "@box/blueprint-web-assets/icons/Line";
4
+ import { BoxAiLogo as ut } from "@box/blueprint-web-assets/icons/Logo";
5
+ import { Size5 as lt, Size6 as ft, Gray65 as $t, Size4 as kr } from "@box/blueprint-web-assets/tokens/tokens";
6
+ import dt from "clsx";
7
+ import * as Q from "react";
8
+ import { useIntl as pt } from "react-intl";
9
+ import { A as f } from "../../../../chunks/types.js";
10
+ import { MediaContainer as rr } from "../common/media-container.js";
11
+ import { AnswerContent as ht } from "./answer-content.js";
12
+ import { CopyButton as yt } from "./copy-button.js";
13
+ import { InlineError as St } from "./inline-error.js";
14
+ import { LoadingElement as mt } from "./loading-element.js";
15
+ import { ThumbButtons as gt } from "./thumb-buttons.js";
16
+ import er from "./messages.js";
17
+ import { References as bt } from "./references.js";
18
+ import { jsxs as j, jsx as u } from "react/jsx-runtime";
19
+ import '../../../../styles/answer.css';var M = function(r) {
20
+ return r && r.Math === Math && r;
21
+ }, $ = (
22
+ // eslint-disable-next-line es/no-global-this -- safe
23
+ M(typeof globalThis == "object" && globalThis) || M(typeof window == "object" && window) || // eslint-disable-next-line no-restricted-globals -- safe
24
+ M(typeof self == "object" && self) || M(typeof k == "object" && k) || M(typeof k == "object" && k) || // eslint-disable-next-line no-new-func -- fallback
25
+ /* @__PURE__ */ function() {
26
+ return this;
27
+ }() || Function("return this")()
28
+ ), Ir = {}, S = function(r) {
29
+ try {
30
+ return !!r();
31
+ } catch {
32
+ return !0;
33
+ }
34
+ }, Ot = S, b = !Ot(function() {
35
+ return Object.defineProperty({}, 1, { get: function() {
36
+ return 7;
37
+ } })[1] !== 7;
38
+ }), Et = S, he = !Et(function() {
39
+ var r = (function() {
40
+ }).bind();
41
+ return typeof r != "function" || r.hasOwnProperty("prototype");
42
+ }), It = he, z = Function.prototype.call, D = It ? z.bind(z) : function() {
43
+ return z.apply(z, arguments);
44
+ }, ye = {}, Se = {}.propertyIsEnumerable, me = Object.getOwnPropertyDescriptor, wt = me && !Se.call({ 1: 2 }, 1);
45
+ ye.f = wt ? function(e) {
46
+ var t = me(this, e);
47
+ return !!t && t.enumerable;
48
+ } : Se;
49
+ var ge = function(r, e) {
50
+ return {
51
+ enumerable: !(r & 1),
52
+ configurable: !(r & 2),
53
+ writable: !(r & 4),
54
+ value: e
55
+ };
56
+ }, be = he, Oe = Function.prototype, Sr = Oe.call, Pt = be && Oe.bind.bind(Sr, Sr), s = be ? Pt : function(r) {
57
+ return function() {
58
+ return Sr.apply(r, arguments);
59
+ };
60
+ }, Ee = s, Tt = Ee({}.toString), jt = Ee("".slice), Rt = function(r) {
61
+ return jt(Tt(r), 8, -1);
62
+ }, _t = s, Dt = S, Nt = Rt, tr = Object, Mt = _t("".split), Ct = Dt(function() {
63
+ return !tr("z").propertyIsEnumerable(0);
64
+ }) ? function(r) {
65
+ return Nt(r) === "String" ? Mt(r, "") : tr(r);
66
+ } : tr, Ie = function(r) {
67
+ return r == null;
68
+ }, At = Ie, Ft = TypeError, we = function(r) {
69
+ if (At(r)) throw new Ft("Can't call method on " + r);
70
+ return r;
71
+ }, Lt = Ct, Bt = we, wr = function(r) {
72
+ return Lt(Bt(r));
73
+ }, ar = typeof document == "object" && document.all, d = typeof ar > "u" && ar !== void 0 ? function(r) {
74
+ return typeof r == "function" || r === ar;
75
+ } : function(r) {
76
+ return typeof r == "function";
77
+ }, xt = d, A = function(r) {
78
+ return typeof r == "object" ? r !== null : xt(r);
79
+ }, nr = $, kt = d, zt = function(r) {
80
+ return kt(r) ? r : void 0;
81
+ }, Pr = function(r, e) {
82
+ return arguments.length < 2 ? zt(nr[r]) : nr[r] && nr[r][e];
83
+ }, Ut = s, Gt = Ut({}.isPrototypeOf), Kt = typeof navigator < "u" && String(navigator.userAgent) || "", Pe = $, or = Kt, zr = Pe.process, Ur = Pe.Deno, Gr = zr && zr.versions || Ur && Ur.version, Kr = Gr && Gr.v8, c, q;
84
+ Kr && (c = Kr.split("."), q = c[0] > 0 && c[0] < 4 ? 1 : +(c[0] + c[1]));
85
+ !q && or && (c = or.match(/Edge\/(\d+)/), (!c || c[1] >= 74) && (c = or.match(/Chrome\/(\d+)/), c && (q = +c[1])));
86
+ var Ht = q, Hr = Ht, Vt = S, qt = $, Wt = qt.String, Te = !!Object.getOwnPropertySymbols && !Vt(function() {
87
+ var r = Symbol("symbol detection");
88
+ return !Wt(r) || !(Object(r) instanceof Symbol) || // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
89
+ !Symbol.sham && Hr && Hr < 41;
90
+ }), Yt = Te, je = Yt && !Symbol.sham && typeof Symbol.iterator == "symbol", Xt = Pr, Zt = d, Jt = Gt, Qt = je, ra = Object, Re = Qt ? function(r) {
91
+ return typeof r == "symbol";
92
+ } : function(r) {
93
+ var e = Xt("Symbol");
94
+ return Zt(e) && Jt(e.prototype, ra(r));
95
+ }, ea = String, ta = function(r) {
96
+ try {
97
+ return ea(r);
98
+ } catch {
99
+ return "Object";
100
+ }
101
+ }, aa = d, na = ta, oa = TypeError, Tr = function(r) {
102
+ if (aa(r)) return r;
103
+ throw new oa(na(r) + " is not a function");
104
+ }, ia = Tr, va = Ie, _e = function(r, e) {
105
+ var t = r[e];
106
+ return va(t) ? void 0 : ia(t);
107
+ }, ir = D, vr = d, sr = A, sa = TypeError, ca = function(r, e) {
108
+ var t, a;
109
+ if (e === "string" && vr(t = r.toString) && !sr(a = ir(t, r)) || vr(t = r.valueOf) && !sr(a = ir(t, r)) || e !== "string" && vr(t = r.toString) && !sr(a = ir(t, r))) return a;
110
+ throw new sa("Can't convert object to primitive value");
111
+ }, De = { exports: {} }, Vr = $, ua = Object.defineProperty, jr = function(r, e) {
112
+ try {
113
+ ua(Vr, r, { value: e, configurable: !0, writable: !0 });
114
+ } catch {
115
+ Vr[r] = e;
116
+ }
117
+ return e;
118
+ }, la = $, fa = jr, qr = "__core-js_shared__", Wr = De.exports = la[qr] || fa(qr, {});
119
+ (Wr.versions || (Wr.versions = [])).push({
120
+ version: "3.36.1",
121
+ mode: "global",
122
+ copyright: "© 2014-2024 Denis Pushkarev (zloirock.ru)",
123
+ license: "https://github.com/zloirock/core-js/blob/v3.36.1/LICENSE",
124
+ source: "https://github.com/zloirock/core-js"
125
+ });
126
+ var Rr = De.exports, Yr = Rr, Ne = function(r, e) {
127
+ return Yr[r] || (Yr[r] = e || {});
128
+ }, $a = we, da = Object, pa = function(r) {
129
+ return da($a(r));
130
+ }, ha = s, ya = pa, Sa = ha({}.hasOwnProperty), O = Object.hasOwn || function(e, t) {
131
+ return Sa(ya(e), t);
132
+ }, ma = s, ga = 0, ba = Math.random(), Oa = ma(1 .toString), Me = function(r) {
133
+ return "Symbol(" + (r === void 0 ? "" : r) + ")_" + Oa(++ga + ba, 36);
134
+ }, Ea = $, Ia = Ne, Xr = O, wa = Me, Pa = Te, Ta = je, _ = Ea.Symbol, cr = Ia("wks"), ja = Ta ? _.for || _ : _ && _.withoutSetter || wa, Ra = function(r) {
135
+ return Xr(cr, r) || (cr[r] = Pa && Xr(_, r) ? _[r] : ja("Symbol." + r)), cr[r];
136
+ }, _a = D, Zr = A, Jr = Re, Da = _e, Na = ca, Ma = Ra, Ca = TypeError, Aa = Ma("toPrimitive"), Fa = function(r, e) {
137
+ if (!Zr(r) || Jr(r)) return r;
138
+ var t = Da(r, Aa), a;
139
+ if (t) {
140
+ if (e === void 0 && (e = "default"), a = _a(t, r, e), !Zr(a) || Jr(a)) return a;
141
+ throw new Ca("Can't convert object to primitive value");
142
+ }
143
+ return e === void 0 && (e = "number"), Na(r, e);
144
+ }, La = Fa, Ba = Re, Ce = function(r) {
145
+ var e = La(r, "string");
146
+ return Ba(e) ? e : e + "";
147
+ }, xa = $, Qr = A, mr = xa.document, ka = Qr(mr) && Qr(mr.createElement), za = function(r) {
148
+ return ka ? mr.createElement(r) : {};
149
+ }, Ua = b, Ga = S, Ka = za, Ae = !Ua && !Ga(function() {
150
+ return Object.defineProperty(Ka("div"), "a", {
151
+ get: function() {
152
+ return 7;
153
+ }
154
+ }).a !== 7;
155
+ }), Ha = b, Va = D, qa = ye, Wa = ge, Ya = wr, Xa = Ce, Za = O, Ja = Ae, re = Object.getOwnPropertyDescriptor;
156
+ Ir.f = Ha ? re : function(e, t) {
157
+ if (e = Ya(e), t = Xa(t), Ja) try {
158
+ return re(e, t);
159
+ } catch {
160
+ }
161
+ if (Za(e, t)) return Wa(!Va(qa.f, e, t), e[t]);
162
+ };
163
+ var X = {}, Qa = b, rn = S, en = Qa && rn(function() {
164
+ return Object.defineProperty(function() {
165
+ }, "prototype", {
166
+ value: 42,
167
+ writable: !1
168
+ }).prototype !== 42;
169
+ }), tn = A, an = String, nn = TypeError, Z = function(r) {
170
+ if (tn(r)) return r;
171
+ throw new nn(an(r) + " is not an object");
172
+ }, on = b, vn = Ae, sn = en, U = Z, ee = Ce, cn = TypeError, ur = Object.defineProperty, un = Object.getOwnPropertyDescriptor, lr = "enumerable", fr = "configurable", $r = "writable";
173
+ X.f = on ? sn ? function(e, t, a) {
174
+ if (U(e), t = ee(t), U(a), typeof e == "function" && t === "prototype" && "value" in a && $r in a && !a[$r]) {
175
+ var n = un(e, t);
176
+ n && n[$r] && (e[t] = a.value, a = {
177
+ configurable: fr in a ? a[fr] : n[fr],
178
+ enumerable: lr in a ? a[lr] : n[lr],
179
+ writable: !1
180
+ });
181
+ }
182
+ return ur(e, t, a);
183
+ } : ur : function(e, t, a) {
184
+ if (U(e), t = ee(t), U(a), vn) try {
185
+ return ur(e, t, a);
186
+ } catch {
187
+ }
188
+ if ("get" in a || "set" in a) throw new cn("Accessors not supported");
189
+ return "value" in a && (e[t] = a.value), e;
190
+ };
191
+ var ln = b, fn = X, $n = ge, Fe = ln ? function(r, e, t) {
192
+ return fn.f(r, e, $n(1, t));
193
+ } : function(r, e, t) {
194
+ return r[e] = t, r;
195
+ }, Le = { exports: {} }, gr = b, dn = O, Be = Function.prototype, pn = gr && Object.getOwnPropertyDescriptor, _r = dn(Be, "name"), hn = _r && (function() {
196
+ }).name === "something", yn = _r && (!gr || gr && pn(Be, "name").configurable), Sn = {
197
+ EXISTS: _r,
198
+ PROPER: hn,
199
+ CONFIGURABLE: yn
200
+ }, mn = s, gn = d, br = Rr, bn = mn(Function.toString);
201
+ gn(br.inspectSource) || (br.inspectSource = function(r) {
202
+ return bn(r);
203
+ });
204
+ var On = br.inspectSource, En = $, In = d, te = En.WeakMap, wn = In(te) && /native code/.test(String(te)), Pn = Ne, Tn = Me, ae = Pn("keys"), jn = function(r) {
205
+ return ae[r] || (ae[r] = Tn(r));
206
+ }, xe = {}, Rn = wn, ke = $, _n = A, Dn = Fe, dr = O, pr = Rr, Nn = jn, Mn = xe, ne = "Object already initialized", Or = ke.TypeError, Cn = ke.WeakMap, W, C, Y, An = function(r) {
207
+ return Y(r) ? C(r) : W(r, {});
208
+ }, Fn = function(r) {
209
+ return function(e) {
210
+ var t;
211
+ if (!_n(e) || (t = C(e)).type !== r)
212
+ throw new Or("Incompatible receiver, " + r + " required");
213
+ return t;
214
+ };
215
+ };
216
+ if (Rn || pr.state) {
217
+ var l = pr.state || (pr.state = new Cn());
218
+ l.get = l.get, l.has = l.has, l.set = l.set, W = function(r, e) {
219
+ if (l.has(r)) throw new Or(ne);
220
+ return e.facade = r, l.set(r, e), e;
221
+ }, C = function(r) {
222
+ return l.get(r) || {};
223
+ }, Y = function(r) {
224
+ return l.has(r);
225
+ };
226
+ } else {
227
+ var R = Nn("state");
228
+ Mn[R] = !0, W = function(r, e) {
229
+ if (dr(r, R)) throw new Or(ne);
230
+ return e.facade = r, Dn(r, R, e), e;
231
+ }, C = function(r) {
232
+ return dr(r, R) ? r[R] : {};
233
+ }, Y = function(r) {
234
+ return dr(r, R);
235
+ };
236
+ }
237
+ var Ln = {
238
+ set: W,
239
+ get: C,
240
+ has: Y,
241
+ enforce: An,
242
+ getterFor: Fn
243
+ }, Dr = s, Bn = S, xn = d, G = O, Er = b, kn = Sn.CONFIGURABLE, zn = On, ze = Ln, Un = ze.enforce, Gn = ze.get, oe = String, V = Object.defineProperty, Kn = Dr("".slice), Hn = Dr("".replace), Vn = Dr([].join), qn = Er && !Bn(function() {
244
+ return V(function() {
245
+ }, "length", { value: 8 }).length !== 8;
246
+ }), Wn = String(String).split("String"), Yn = Le.exports = function(r, e, t) {
247
+ Kn(oe(e), 0, 7) === "Symbol(" && (e = "[" + Hn(oe(e), /^Symbol\(([^)]*)\).*$/, "$1") + "]"), t && t.getter && (e = "get " + e), t && t.setter && (e = "set " + e), (!G(r, "name") || kn && r.name !== e) && (Er ? V(r, "name", { value: e, configurable: !0 }) : r.name = e), qn && t && G(t, "arity") && r.length !== t.arity && V(r, "length", { value: t.arity });
248
+ try {
249
+ t && G(t, "constructor") && t.constructor ? Er && V(r, "prototype", { writable: !1 }) : r.prototype && (r.prototype = void 0);
250
+ } catch {
251
+ }
252
+ var a = Un(r);
253
+ return G(a, "source") || (a.source = Vn(Wn, typeof e == "string" ? e : "")), r;
254
+ };
255
+ Function.prototype.toString = Yn(function() {
256
+ return xn(this) && Gn(this).source || zn(this);
257
+ }, "toString");
258
+ var Xn = Le.exports, Zn = d, Jn = X, Qn = Xn, ro = jr, eo = function(r, e, t, a) {
259
+ a || (a = {});
260
+ var n = a.enumerable, o = a.name !== void 0 ? a.name : e;
261
+ if (Zn(t) && Qn(t, o, a), a.global)
262
+ n ? r[e] = t : ro(e, t);
263
+ else {
264
+ try {
265
+ a.unsafe ? r[e] && (n = !0) : delete r[e];
266
+ } catch {
267
+ }
268
+ n ? r[e] = t : Jn.f(r, e, {
269
+ value: t,
270
+ enumerable: !1,
271
+ configurable: !a.nonConfigurable,
272
+ writable: !a.nonWritable
273
+ });
274
+ }
275
+ return r;
276
+ }, Ue = {}, to = Math.ceil, ao = Math.floor, no = Math.trunc || function(e) {
277
+ var t = +e;
278
+ return (t > 0 ? ao : to)(t);
279
+ }, oo = no, Nr = function(r) {
280
+ var e = +r;
281
+ return e !== e || e === 0 ? 0 : oo(e);
282
+ }, io = Nr, vo = Math.max, so = Math.min, co = function(r, e) {
283
+ var t = io(r);
284
+ return t < 0 ? vo(t + e, 0) : so(t, e);
285
+ }, uo = Nr, lo = Math.min, fo = function(r) {
286
+ var e = uo(r);
287
+ return e > 0 ? lo(e, 9007199254740991) : 0;
288
+ }, $o = fo, po = function(r) {
289
+ return $o(r.length);
290
+ }, ho = wr, yo = co, So = po, ie = function(r) {
291
+ return function(e, t, a) {
292
+ var n = ho(e), o = So(n);
293
+ if (o === 0) return !r && -1;
294
+ var i = yo(a, o), v;
295
+ if (r && t !== t) {
296
+ for (; o > i; )
297
+ if (v = n[i++], v !== v) return !0;
298
+ } else for (; o > i; i++)
299
+ if ((r || i in n) && n[i] === t) return r || i || 0;
300
+ return !r && -1;
301
+ };
302
+ }, mo = {
303
+ // `Array.prototype.includes` method
304
+ // https://tc39.es/ecma262/#sec-array.prototype.includes
305
+ includes: ie(!0),
306
+ // `Array.prototype.indexOf` method
307
+ // https://tc39.es/ecma262/#sec-array.prototype.indexof
308
+ indexOf: ie(!1)
309
+ }, go = s, hr = O, bo = wr, Oo = mo.indexOf, Eo = xe, ve = go([].push), Io = function(r, e) {
310
+ var t = bo(r), a = 0, n = [], o;
311
+ for (o in t) !hr(Eo, o) && hr(t, o) && ve(n, o);
312
+ for (; e.length > a; ) hr(t, o = e[a++]) && (~Oo(n, o) || ve(n, o));
313
+ return n;
314
+ }, wo = [
315
+ "constructor",
316
+ "hasOwnProperty",
317
+ "isPrototypeOf",
318
+ "propertyIsEnumerable",
319
+ "toLocaleString",
320
+ "toString",
321
+ "valueOf"
322
+ ], Po = Io, To = wo, jo = To.concat("length", "prototype");
323
+ Ue.f = Object.getOwnPropertyNames || function(e) {
324
+ return Po(e, jo);
325
+ };
326
+ var Ge = {};
327
+ Ge.f = Object.getOwnPropertySymbols;
328
+ var Ro = Pr, _o = s, Do = Ue, No = Ge, Mo = Z, Co = _o([].concat), Ao = Ro("Reflect", "ownKeys") || function(e) {
329
+ var t = Do.f(Mo(e)), a = No.f;
330
+ return a ? Co(t, a(e)) : t;
331
+ }, se = O, Fo = Ao, Lo = Ir, Bo = X, xo = function(r, e, t) {
332
+ for (var a = Fo(e), n = Bo.f, o = Lo.f, i = 0; i < a.length; i++) {
333
+ var v = a[i];
334
+ !se(r, v) && !(t && se(t, v)) && n(r, v, o(e, v));
335
+ }
336
+ }, ko = S, zo = d, Uo = /#|\.prototype\./, F = function(r, e) {
337
+ var t = Ko[Go(r)];
338
+ return t === Vo ? !0 : t === Ho ? !1 : zo(e) ? ko(e) : !!e;
339
+ }, Go = F.normalize = function(r) {
340
+ return String(r).replace(Uo, ".").toLowerCase();
341
+ }, Ko = F.data = {}, Ho = F.NATIVE = "N", Vo = F.POLYFILL = "P", qo = F, K = $, Wo = Ir.f, Yo = Fe, Xo = eo, Zo = jr, Jo = xo, Qo = qo, E = function(r, e) {
342
+ var t = r.target, a = r.global, n = r.stat, o, i, v, h, m, N;
343
+ if (a ? i = K : n ? i = K[t] || Zo(t, {}) : i = K[t] && K[t].prototype, i) for (v in e) {
344
+ if (m = e[v], r.dontCallGetSet ? (N = Wo(i, v), h = N && N.value) : h = i[v], o = Qo(a ? v : t + (n ? "." : "#") + v, r.forced), !o && h !== void 0) {
345
+ if (typeof m == typeof h) continue;
346
+ Jo(m, h);
347
+ }
348
+ (r.sham || h && h.sham) && Yo(m, "sham", !0), Xo(i, v, m, r);
349
+ }
350
+ }, yr = s, H = Set.prototype, p = {
351
+ // eslint-disable-next-line es/no-set -- safe
352
+ Set,
353
+ add: yr(H.add),
354
+ has: yr(H.has),
355
+ remove: yr(H.delete),
356
+ proto: H
357
+ }, ri = p.has, I = function(r) {
358
+ return ri(r), r;
359
+ }, ei = D, w = function(r, e, t) {
360
+ for (var a = t ? r : r.iterator, n = r.next, o, i; !(o = ei(n, a)).done; )
361
+ if (i = e(o.value), i !== void 0) return i;
362
+ }, Ke = s, ti = w, He = p, ai = He.Set, Ve = He.proto, ni = Ke(Ve.forEach), qe = Ke(Ve.keys), oi = qe(new ai()).next, L = function(r, e, t) {
363
+ return t ? ti({ iterator: qe(r), next: oi }, e) : ni(r, e);
364
+ }, We = p, ii = L, vi = We.Set, si = We.add, Mr = function(r) {
365
+ var e = new vi();
366
+ return ii(r, function(t) {
367
+ si(e, t);
368
+ }), e;
369
+ }, ci = s, ui = Tr, li = function(r, e, t) {
370
+ try {
371
+ return ci(ui(Object.getOwnPropertyDescriptor(r, e)[t]));
372
+ } catch {
373
+ }
374
+ }, fi = li, $i = p, B = fi($i.proto, "size", "get") || function(r) {
375
+ return r.size;
376
+ }, di = function(r) {
377
+ return {
378
+ iterator: r,
379
+ next: r.next,
380
+ done: !1
381
+ };
382
+ }, ce = Tr, Ye = Z, ue = D, pi = Nr, hi = di, le = "Invalid size", yi = RangeError, Si = TypeError, mi = Math.max, Xe = function(r, e) {
383
+ this.set = r, this.size = mi(e, 0), this.has = ce(r.has), this.keys = ce(r.keys);
384
+ };
385
+ Xe.prototype = {
386
+ getIterator: function() {
387
+ return hi(Ye(ue(this.keys, this.set)));
388
+ },
389
+ includes: function(r) {
390
+ return ue(this.has, this.set, r);
391
+ }
392
+ };
393
+ var P = function(r) {
394
+ Ye(r);
395
+ var e = +r.size;
396
+ if (e !== e) throw new Si(le);
397
+ var t = pi(e);
398
+ if (t < 0) throw new yi(le);
399
+ return new Xe(r, t);
400
+ }, gi = I, Ze = p, bi = Mr, Oi = B, Ei = P, Ii = L, wi = w, Pi = Ze.has, fe = Ze.remove, Ti = function(e) {
401
+ var t = gi(this), a = Ei(e), n = bi(t);
402
+ return Oi(t) <= a.size ? Ii(t, function(o) {
403
+ a.includes(o) && fe(n, o);
404
+ }) : wi(a.getIterator(), function(o) {
405
+ Pi(t, o) && fe(n, o);
406
+ }), n;
407
+ }, ji = Pr, $e = function(r) {
408
+ return {
409
+ size: r,
410
+ has: function() {
411
+ return !1;
412
+ },
413
+ keys: function() {
414
+ return {
415
+ next: function() {
416
+ return { done: !0 };
417
+ }
418
+ };
419
+ }
420
+ };
421
+ }, T = function(r) {
422
+ var e = ji("Set");
423
+ try {
424
+ new e()[r]($e(0));
425
+ try {
426
+ return new e()[r]($e(-1)), !1;
427
+ } catch {
428
+ return !0;
429
+ }
430
+ } catch {
431
+ return !1;
432
+ }
433
+ }, Ri = E, _i = Ti, Di = T;
434
+ Ri({ target: "Set", proto: !0, real: !0, forced: !Di("difference") }, {
435
+ difference: _i
436
+ });
437
+ var Ni = I, Cr = p, Mi = B, Ci = P, Ai = L, Fi = w, Li = Cr.Set, de = Cr.add, Bi = Cr.has, xi = function(e) {
438
+ var t = Ni(this), a = Ci(e), n = new Li();
439
+ return Mi(t) > a.size ? Fi(a.getIterator(), function(o) {
440
+ Bi(t, o) && de(n, o);
441
+ }) : Ai(t, function(o) {
442
+ a.includes(o) && de(n, o);
443
+ }), n;
444
+ }, ki = E, zi = S, Ui = xi, Gi = T, Ki = !Gi("intersection") || zi(function() {
445
+ return String(Array.from((/* @__PURE__ */ new Set([1, 2, 3])).intersection(/* @__PURE__ */ new Set([3, 2])))) !== "3,2";
446
+ });
447
+ ki({ target: "Set", proto: !0, real: !0, forced: Ki }, {
448
+ intersection: Ui
449
+ });
450
+ var Hi = D, pe = Z, Vi = _e, Je = function(r, e, t) {
451
+ var a, n;
452
+ pe(r);
453
+ try {
454
+ if (a = Vi(r, "return"), !a) {
455
+ if (e === "throw") throw t;
456
+ return t;
457
+ }
458
+ a = Hi(a, r);
459
+ } catch (o) {
460
+ n = !0, a = o;
461
+ }
462
+ if (e === "throw") throw t;
463
+ if (n) throw a;
464
+ return pe(a), t;
465
+ }, qi = I, Wi = p.has, Yi = B, Xi = P, Zi = L, Ji = w, Qi = Je, rv = function(e) {
466
+ var t = qi(this), a = Xi(e);
467
+ if (Yi(t) <= a.size) return Zi(t, function(o) {
468
+ if (a.includes(o)) return !1;
469
+ }, !0) !== !1;
470
+ var n = a.getIterator();
471
+ return Ji(n, function(o) {
472
+ if (Wi(t, o)) return Qi(n, "normal", !1);
473
+ }) !== !1;
474
+ }, ev = E, tv = rv, av = T;
475
+ ev({ target: "Set", proto: !0, real: !0, forced: !av("isDisjointFrom") }, {
476
+ isDisjointFrom: tv
477
+ });
478
+ var nv = I, ov = B, iv = L, vv = P, sv = function(e) {
479
+ var t = nv(this), a = vv(e);
480
+ return ov(t) > a.size ? !1 : iv(t, function(n) {
481
+ if (!a.includes(n)) return !1;
482
+ }, !0) !== !1;
483
+ }, cv = E, uv = sv, lv = T;
484
+ cv({ target: "Set", proto: !0, real: !0, forced: !lv("isSubsetOf") }, {
485
+ isSubsetOf: uv
486
+ });
487
+ var fv = I, $v = p.has, dv = B, pv = P, hv = w, yv = Je, Sv = function(e) {
488
+ var t = fv(this), a = pv(e);
489
+ if (dv(t) < a.size) return !1;
490
+ var n = a.getIterator();
491
+ return hv(n, function(o) {
492
+ if (!$v(t, o)) return yv(n, "normal", !1);
493
+ }) !== !1;
494
+ }, mv = E, gv = Sv, bv = T;
495
+ mv({ target: "Set", proto: !0, real: !0, forced: !bv("isSupersetOf") }, {
496
+ isSupersetOf: gv
497
+ });
498
+ var Ov = I, Ar = p, Ev = Mr, Iv = P, wv = w, Pv = Ar.add, Tv = Ar.has, jv = Ar.remove, Rv = function(e) {
499
+ var t = Ov(this), a = Iv(e).getIterator(), n = Ev(t);
500
+ return wv(a, function(o) {
501
+ Tv(t, o) ? jv(n, o) : Pv(n, o);
502
+ }), n;
503
+ }, _v = E, Dv = Rv, Nv = T;
504
+ _v({ target: "Set", proto: !0, real: !0, forced: !Nv("symmetricDifference") }, {
505
+ symmetricDifference: Dv
506
+ });
507
+ var Mv = I, Cv = p.add, Av = Mr, Fv = P, Lv = w, Bv = function(e) {
508
+ var t = Mv(this), a = Fv(e).getIterator(), n = Av(t);
509
+ return Lv(a, function(o) {
510
+ Cv(n, o);
511
+ }), n;
512
+ }, xv = E, kv = Bv, zv = T;
513
+ xv({ target: "Set", proto: !0, real: !0, forced: !zv("union") }, {
514
+ union: kv
515
+ });
516
+ const Uv = "_answer_nhqjo_1", Gv = "_alertIcon_nhqjo_4", Kv = "_error_nhqjo_7", Hv = "_footer_nhqjo_11", Vv = "_shouldHaveMarginTop_nhqjo_17", qv = "_shouldUseAnimation_nhqjo_20", Wv = "_shouldAnimateHeight_nhqjo_24", Yv = "_footerButtons_nhqjo_28", Xv = "_iconAvatar_nhqjo_33", y = {
517
+ answer: Uv,
518
+ alertIcon: Gv,
519
+ error: Kv,
520
+ footer: Hv,
521
+ shouldHaveMarginTop: Vv,
522
+ shouldUseAnimation: qv,
523
+ shouldAnimateHeight: Wv,
524
+ footerButtons: Yv,
525
+ iconAvatar: Xv
526
+ }, Zv = /* @__PURE__ */ new Set([f.RATE_LIMITING, f.NO_CONTENT, f.PRECONDITION_FAILED, f.GENERAL, f.AGENT_NOT_FOUND]), ys = /* @__PURE__ */ Q.memo(({
527
+ answer: r,
528
+ citations: e,
529
+ error: t,
530
+ contentType: a,
531
+ hostAppName: n,
532
+ isCitationsEnabled: o = !1,
533
+ isCompleted: i = !1,
534
+ isFeedbackEnabled: v = !1,
535
+ isLoading: h = !1,
536
+ isMarkdownEnabled: m = !1,
537
+ items: N = [],
538
+ onCitationClick: Qe,
539
+ onAnswerCopy: rt,
540
+ recordAction: x,
541
+ useAnimation: et = !0,
542
+ variant: g = "modal"
46
543
  }) => {
47
- const _ = ro.has(o), f = g && !i && !o, [j, q] = c.useState(a), {
48
- formatMessage: m
49
- } = z(), u = M() === D.Small ? U : b;
50
- c.useEffect(() => {
51
- setTimeout(() => q(a), 0);
52
- }, [a]);
53
- const p = () => /* @__PURE__ */ e(H, {
54
- className: n.alertIcon,
55
- color: k,
544
+ const Fr = Zv.has(t), Lr = h && !r && !t, [tt, at] = Q.useState(i), {
545
+ formatMessage: J
546
+ } = pt(), Br = it() === vt.Small ? lt : ft;
547
+ Q.useEffect(() => {
548
+ setTimeout(() => at(i), 0);
549
+ }, [i]);
550
+ const xr = () => /* @__PURE__ */ u(ct, {
551
+ className: y.alertIcon,
552
+ color: $t,
56
553
  "data-testid": "content-answers-error-alert-icon",
57
- height: E,
554
+ height: kr,
58
555
  role: "presentation",
59
- width: E
60
- }), B = () => /* @__PURE__ */ s(F, {
556
+ width: kr
557
+ }), nt = () => /* @__PURE__ */ j(st, {
61
558
  as: "p",
62
- className: n.error,
559
+ className: y.error,
63
560
  color: "textOnLightSecondary",
64
561
  "data-testid": "content-answers-error",
65
562
  variant: "caption",
66
- children: [o === t.RESPONSE_INTERRUPTED && m(h.responseInterruptedError), o === t.RESPONSE_FAILED && m(h.responseFailedError), o === t.RESPONSE_STOPPED && m(h.responseStoppedError), o !== t.RESPONSE_STOPPED && p()]
67
- }), L = () => o !== t.RESPONSE_STOPPED ? /* @__PURE__ */ s("div", {
68
- className: n.footerButtons,
69
- children: [T ? /* @__PURE__ */ e(K, {
70
- hostAppName: A,
71
- items: O,
72
- recordAction: l,
73
- variant: r
74
- }) : null, /* @__PURE__ */ e(G, {
75
- answer: i,
76
- onAnswerCopy: w,
77
- recordAction: l
563
+ children: [t === f.RESPONSE_INTERRUPTED && J(er.responseInterruptedError), t === f.RESPONSE_FAILED && J(er.responseFailedError), t === f.RESPONSE_STOPPED && J(er.responseStoppedError), t !== f.RESPONSE_STOPPED && xr()]
564
+ }), ot = () => t !== f.RESPONSE_STOPPED ? /* @__PURE__ */ j("div", {
565
+ className: y.footerButtons,
566
+ children: [v ? /* @__PURE__ */ u(gt, {
567
+ hostAppName: n,
568
+ items: N,
569
+ recordAction: x,
570
+ variant: g
571
+ }) : null, /* @__PURE__ */ u(yt, {
572
+ answer: r,
573
+ onAnswerCopy: rt,
574
+ recordAction: x
78
575
  })]
79
- }) : i ? null : p();
80
- return /* @__PURE__ */ s("div", {
576
+ }) : r ? null : xr();
577
+ return /* @__PURE__ */ j("div", {
81
578
  "aria-live": "polite",
82
- className: n.answer,
579
+ className: y.answer,
83
580
  "data-testid": "content-answers-answer",
84
- children: [!_ && !f && /* @__PURE__ */ s(d, {
85
- variant: r,
86
- children: [/* @__PURE__ */ e(d.Figure, {
87
- variant: r,
88
- children: /* @__PURE__ */ e("div", {
89
- className: n.iconAvatar,
90
- children: /* @__PURE__ */ e(x, {
91
- height: u,
581
+ children: [!Fr && !Lr && /* @__PURE__ */ j(rr, {
582
+ variant: g,
583
+ children: [/* @__PURE__ */ u(rr.Figure, {
584
+ variant: g,
585
+ children: /* @__PURE__ */ u("div", {
586
+ className: y.iconAvatar,
587
+ children: /* @__PURE__ */ u(ut, {
588
+ height: Br,
92
589
  role: "presentation",
93
- width: u
590
+ width: Br
94
591
  })
95
592
  })
96
- }), /* @__PURE__ */ s(d.Content, {
97
- isUsedInsideSidebar: r === "sidebar",
593
+ }), /* @__PURE__ */ j(rr.Content, {
594
+ isUsedInsideSidebar: g === "sidebar",
98
595
  variant: "answer",
99
- children: [/* @__PURE__ */ e(C, {
100
- answer: i,
101
- isMarkdownEnabled: R,
102
- variant: r
103
- }), a && /* @__PURE__ */ s("div", {
104
- className: y(n.footer, {
105
- [n.shouldHaveMarginTop]: i,
106
- [n.shouldAnimateHeight]: j,
107
- [n.shouldUseAnimation]: v
596
+ children: [/* @__PURE__ */ u(ht, {
597
+ answer: r,
598
+ isMarkdownEnabled: m,
599
+ variant: g
600
+ }), i && /* @__PURE__ */ j("div", {
601
+ className: dt(y.footer, {
602
+ [y.shouldHaveMarginTop]: r,
603
+ [y.shouldAnimateHeight]: tt,
604
+ [y.shouldUseAnimation]: et
108
605
  }),
109
606
  "data-testid": "content-answers-answer-footer",
110
- children: [o && B(), I && !o && /* @__PURE__ */ e(Q, {
111
- citations: S,
112
- onCitationClick: P,
113
- recordAction: l
114
- }), L()]
607
+ children: [t && nt(), o && !t && /* @__PURE__ */ u(bt, {
608
+ citations: e,
609
+ onCitationClick: Qe,
610
+ recordAction: x
611
+ }), ot()]
115
612
  })]
116
613
  })]
117
- }), _ && /* @__PURE__ */ e(W, {
118
- contentType: N,
119
- error: o,
120
- recordAction: l,
121
- variant: r
122
- }), f && /* @__PURE__ */ e(J, {
123
- variant: r
614
+ }), Fr && /* @__PURE__ */ u(St, {
615
+ contentType: a,
616
+ error: t,
617
+ recordAction: x,
618
+ variant: g
619
+ }), Lr && /* @__PURE__ */ u(mt, {
620
+ variant: g
124
621
  })]
125
622
  });
126
623
  });
127
624
  export {
128
- Oo as Answer,
129
- Oo as default
625
+ ys as Answer,
626
+ ys as default
130
627
  };