@inkeep/agents-ui 0.15.27 → 0.15.29

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 (33) hide show
  1. package/dist/primitives/components/embedded-chat/use-inkeep-chat.cjs +3 -3
  2. package/dist/primitives/components/embedded-chat/use-inkeep-chat.d.ts +1 -1
  3. package/dist/primitives/components/embedded-chat/use-inkeep-chat.js +185 -175
  4. package/dist/primitives/components/embedded-chat.cjs +3 -3
  5. package/dist/primitives/components/embedded-chat.d.ts +2 -3
  6. package/dist/primitives/components/embedded-chat.js +667 -672
  7. package/dist/primitives/components/embedded-search.cjs +1 -1
  8. package/dist/primitives/components/embedded-search.d.ts +3 -4
  9. package/dist/primitives/components/embedded-search.js +290 -294
  10. package/dist/primitives/components/tagline-logo-icon.cjs +1 -1
  11. package/dist/primitives/components/tagline-logo-icon.js +11 -21
  12. package/dist/primitives/hooks/use-initial-conversation.cjs +1 -0
  13. package/dist/primitives/hooks/use-initial-conversation.d.ts +16 -0
  14. package/dist/primitives/hooks/use-initial-conversation.js +31 -0
  15. package/dist/primitives/providers/base-events-provider.cjs +1 -1
  16. package/dist/primitives/providers/base-events-provider.js +1 -1
  17. package/dist/primitives/utils/component-ids.cjs +1 -1
  18. package/dist/primitives/utils/component-ids.d.ts +0 -4
  19. package/dist/primitives/utils/component-ids.js +1 -3
  20. package/dist/react/embedded-chat.cjs +1 -1
  21. package/dist/react/embedded-chat.js +133 -134
  22. package/dist/react/embedded-search.cjs +1 -1
  23. package/dist/react/embedded-search.js +63 -64
  24. package/dist/styled/components/embedded-chat.cjs +1 -1
  25. package/dist/styled/components/embedded-chat.d.ts +1 -2
  26. package/dist/styled/components/embedded-chat.js +372 -386
  27. package/dist/styled/components/embedded-search.cjs +1 -1
  28. package/dist/styled/components/embedded-search.d.ts +1 -2
  29. package/dist/styled/components/embedded-search.js +119 -133
  30. package/dist/styled/inkeep.css.cjs +3 -3
  31. package/dist/styled/inkeep.css.js +3 -3
  32. package/dist/types/config/ai.d.ts +7 -0
  33. package/package.json +1 -1
@@ -1,83 +1,83 @@
1
1
  "use client";
2
2
  import { jsx as e, jsxs as d, Fragment as u } from "react/jsx-runtime";
3
3
  import x, { Fragment as k } from "react";
4
- import { Provider as R, Wrapper as O, Root as j, Header as G, HeaderToolbar as U, HeaderToolbarWrapper as K, ChatHistoryTrigger as Z, Content as z, ContentScrollArea as J, ContentScrollAreaViewport as X, MessagesSessionLoading as Y, ContentScrollAreaScrollbar as q, ContentScrollAreaThumb as ee, ContentScrollAreaCorner as de, Footer as te, FeedbackModal as ae, FeedbackModalOverlay as oe, FeedbackModalContent as re, FeedbackModalHeader as ne, FeedbackModalClose as ie, FeedbackModalBody as me, FeedbackForm as se, FeedbackItem as b, FeedbackItemCheckbox as C, FeedbackItemCheckboxIndicator as F, FeedbackItemLabel as E, FeedbackItemDescription as g, FeedbackSubmitButton as ce, FormWrapper as le, FormClose as he, Form as be, FormHeader as Ce, FormHeading as Fe, FormDescription as Ee, FormContent as ue, FormField as pe, FormFieldLabel as ge, FormFieldText as Ie, FormFieldEmail as Me, FormFieldFile as Se, FormFieldTextArea as Te, FormFieldCheckbox as xe, FormFieldCheckboxIndicator as Ae, FormFieldSelect as He, FormFieldSelectTrigger as ke, FormFieldSelectValue as ye, FormFieldSelectIcon as fe, FormFieldSelectContent as we, FormFieldSelectViewport as ve, FormFieldSelectItem as Le, FormFieldSelectItemText as Be, FormFieldSelectItemIndicator as De, FormFieldCombobox as Pe, FormFieldComboboxControl as We, FormFieldComboboxSelectedTags as Ne, FormFieldComboboxInput as _e, FormFieldComboboxTrigger as Ve, FormFieldComboboxPositioner as Qe, FormFieldComboboxContent as $e, FormFieldComboboxList as Re, FormFieldComboboxListItems as Oe, FormFieldComboboxListEmpty as je, FormFieldComboboxItem as Ge, FormFieldComboboxItemText as Ue, FormFieldComboboxItemIndicator as Ke, FormFieldDescription as Ze, FormFieldError as ze, FormError as Je, FormFooter as Xe, FormCancel as Ye, FormSubmit as qe, FormSuccess as ed, FormSuccessHeading as dd, FormSuccessMessage as td, FormSuccessButton as ad, Messages as od, MessageWrapper as A, MessageContentWrapper as y, MessageContent as f, DynamicComponent as rd, MessageLoading as nd, InputFieldset as id, InputGroup as md, Input as sd, SendButton as cd, SendButtonIcon as ld, ActionBar as hd, TaglineContainer as bd, TaglineText as Cd, TaglineLogo as Fd, TaglineBrandName as Ed, Actions as ud, HelpActions as pd, HelpAction as gd, HelpActionsTrigger as Id, HelpActionsMenu as Md, HelpActionsMenuArrow as Sd, HelpActionsMenuItem as Td, HelpActionsMenuItemIcon as xd, ChatAction as I, ChatActionLabel as Ad, ChatActionFeedback as Hd, IntroMessageWrapper as kd, MessageHeader as w, MessageAvatar as v, MessageAvatarContent as L, MessageAvatarImage as B, MessageName as D, Disclaimer as yd, DisclaimerLabel as fd, DisclaimerTrigger as wd, DisclaimerContent as vd, DisclaimerText as Ld, DisclaimerArrow as Bd, ExampleQuestions as Dd, ExampleQuestionsLabel as Pd, ExampleQuestionsList as Wd, ExampleQuestion as Nd, ExampleQuestionButton as _d, Markdown as Vd, MessageSources as Qd, MessageSourcesHeader as $d, MessageSourcesList as Rd, MessageSourceItem as Od, MessageSourceItemBreadcrumbs as jd, MessageSourceItemBreadcrumbIcon as Gd, MessageSourceItemIcon as Ud, MessageSourceItemTitle as Kd, MessageSourceItemTag as Zd, MessageSourceItemDescription as zd, MessageSourceItemDescriptionPart as Jd, MessageSourceItemIndicator as Xd, MessageToolbar as Yd, MessageCustomActions as qd, MessageCustomAction as et, MessageAction as M } from "../styled/components/embedded-chat.js";
5
- import { EmbeddedChatHistoryRoot as dt, EmbeddedChatHistoryHeader as tt, EmbeddedChatHistoryBackButton as at, EmbeddedChatHistoryBackButtonIcon as ot, EmbeddedChatHistoryTitle as rt, EmbeddedChatHistoryList as nt, EmbeddedChatHistoryItem as it, EmbeddedChatHistoryItemTitle as mt, EmbeddedChatHistoryItemDate as st, formatSessionDate as ct, EmbeddedChatHistoryEmptyState as lt, EmbeddedChatHistoryLoadingState as ht, EmbeddedChatHistoryFooter as bt, EmbeddedChatHistoryNewConversationButton as Ct } from "../styled/components/chat-history.js";
4
+ import { Provider as R, Wrapper as O, Root as j, Header as G, HeaderToolbar as U, HeaderToolbarWrapper as K, ChatHistoryTrigger as Z, Content as z, ContentScrollArea as J, ContentScrollAreaViewport as X, MessagesSessionLoading as Y, ContentScrollAreaScrollbar as q, ContentScrollAreaThumb as ee, ContentScrollAreaCorner as de, Footer as te, FeedbackModal as ae, FeedbackModalOverlay as oe, FeedbackModalContent as re, FeedbackModalHeader as ne, FeedbackModalClose as ie, FeedbackModalBody as me, FeedbackForm as se, FeedbackItem as b, FeedbackItemCheckbox as C, FeedbackItemCheckboxIndicator as F, FeedbackItemLabel as E, FeedbackItemDescription as g, FeedbackSubmitButton as ce, FormWrapper as le, FormClose as he, Form as be, FormHeader as Ce, FormHeading as Fe, FormDescription as Ee, FormContent as ue, FormField as pe, FormFieldLabel as ge, FormFieldText as Ie, FormFieldEmail as Me, FormFieldFile as Se, FormFieldTextArea as Te, FormFieldCheckbox as xe, FormFieldCheckboxIndicator as Ae, FormFieldSelect as He, FormFieldSelectTrigger as ke, FormFieldSelectValue as ye, FormFieldSelectIcon as fe, FormFieldSelectContent as we, FormFieldSelectViewport as ve, FormFieldSelectItem as Le, FormFieldSelectItemText as De, FormFieldSelectItemIndicator as Be, FormFieldCombobox as Pe, FormFieldComboboxControl as We, FormFieldComboboxSelectedTags as _e, FormFieldComboboxInput as Ve, FormFieldComboboxTrigger as Ne, FormFieldComboboxPositioner as Qe, FormFieldComboboxContent as $e, FormFieldComboboxList as Re, FormFieldComboboxListItems as Oe, FormFieldComboboxListEmpty as je, FormFieldComboboxItem as Ge, FormFieldComboboxItemText as Ue, FormFieldComboboxItemIndicator as Ke, FormFieldDescription as Ze, FormFieldError as ze, FormError as Je, FormFooter as Xe, FormCancel as Ye, FormSubmit as qe, FormSuccess as ed, FormSuccessHeading as dd, FormSuccessMessage as td, FormSuccessButton as ad, Messages as od, MessageWrapper as A, MessageContentWrapper as y, MessageContent as f, DynamicComponent as rd, MessageLoading as nd, InputFieldset as id, InputGroup as md, Input as sd, SendButton as cd, SendButtonIcon as ld, ActionBar as hd, TaglineContainer as bd, TaglineText as Cd, TaglineLogo as Fd, Actions as Ed, HelpActions as ud, HelpAction as pd, HelpActionsTrigger as gd, HelpActionsMenu as Id, HelpActionsMenuArrow as Md, HelpActionsMenuItem as Sd, HelpActionsMenuItemIcon as Td, ChatAction as I, ChatActionLabel as xd, ChatActionFeedback as Ad, IntroMessageWrapper as Hd, MessageHeader as w, MessageAvatar as v, MessageAvatarContent as L, MessageAvatarImage as D, MessageName as B, Disclaimer as kd, DisclaimerLabel as yd, DisclaimerTrigger as fd, DisclaimerContent as wd, DisclaimerText as vd, DisclaimerArrow as Ld, ExampleQuestions as Dd, ExampleQuestionsLabel as Bd, ExampleQuestionsList as Pd, ExampleQuestion as Wd, ExampleQuestionButton as _d, Markdown as Vd, MessageSources as Nd, MessageSourcesHeader as Qd, MessageSourcesList as $d, MessageSourceItem as Rd, MessageSourceItemBreadcrumbs as Od, MessageSourceItemBreadcrumbIcon as jd, MessageSourceItemIcon as Gd, MessageSourceItemTitle as Ud, MessageSourceItemTag as Kd, MessageSourceItemDescription as Zd, MessageSourceItemDescriptionPart as zd, MessageSourceItemIndicator as Jd, MessageToolbar as Xd, MessageCustomActions as Yd, MessageCustomAction as qd, MessageAction as M } from "../styled/components/embedded-chat.js";
5
+ import { EmbeddedChatHistoryRoot as et, EmbeddedChatHistoryHeader as dt, EmbeddedChatHistoryBackButton as tt, EmbeddedChatHistoryBackButtonIcon as at, EmbeddedChatHistoryTitle as ot, EmbeddedChatHistoryList as rt, EmbeddedChatHistoryItem as nt, EmbeddedChatHistoryItemTitle as it, EmbeddedChatHistoryItemDate as mt, formatSessionDate as st, EmbeddedChatHistoryEmptyState as ct, EmbeddedChatHistoryLoadingState as lt, EmbeddedChatHistoryFooter as ht, EmbeddedChatHistoryNewConversationButton as bt } from "../styled/components/chat-history.js";
6
6
  import { Close as S } from "../styled/components/modal.js";
7
- import { Shadow as Ft } from "../styled/components/shadow.js";
7
+ import { Shadow as Ct } from "../styled/components/shadow.js";
8
8
  import { EmbeddedChatMessagePart as P } from "../styled/components/message.js";
9
- import { useChatHistory as Et } from "../primitives/providers/chat-history-provider.js";
10
- import { WebWidgetInteractionType as ut, useInkeepConfig as W } from "../primitives/providers/config-provider.js";
11
- import { RootProvider as pt } from "../primitives/providers/root-provider.js";
12
- import { useWidget as gt } from "../primitives/providers/widget-provider.js";
13
- import { useChat as N } from "../primitives/components/embedded-chat/chat-provider.js";
14
- import { useModal as It } from "../primitives/components/modal/modal-provider.js";
9
+ import { useChatHistory as Ft } from "../primitives/providers/chat-history-provider.js";
10
+ import { WebWidgetInteractionType as Et, useInkeepConfig as W } from "../primitives/providers/config-provider.js";
11
+ import { RootProvider as ut } from "../primitives/providers/root-provider.js";
12
+ import { useWidget as pt } from "../primitives/providers/widget-provider.js";
13
+ import { useChat as _ } from "../primitives/components/embedded-chat/chat-provider.js";
14
+ import { useModal as gt } from "../primitives/components/modal/modal-provider.js";
15
15
  import { dataAttr as p } from "../primitives/utils/misc.js";
16
- import { PortalWithTheme as _ } from "../primitives/atoms/portal-with-theme.js";
17
- import { ErrorBoundary as Mt } from "../primitives/atoms/error-boundary.js";
18
- import { ModalContent as St } from "./modal.js";
19
- import { ImagePreviewProvider as Tt } from "../primitives/providers/image-preview-provider.js";
20
- import { WidgetToggle as xt } from "./widget-toggle.js";
21
- import { isImageMimeType as V } from "../primitives/components/embedded-chat/file-upload-input.js";
22
- import { EmbeddedChatInputNotification as At, EmbeddedChatInputNotificationContent as Ht, EmbeddedChatInputNotificationHeader as kt, EmbeddedChatInputNotificationTitle as yt, EmbeddedChatInputNotificationClose as ft, EmbeddedChatInputNotificationMessage as wt, EmbeddedChatFileInput as vt, EmbeddedChatDropZone as Lt, EmbeddedChatFileList as Bt, EmbeddedChatFileItem as Dt, EmbeddedChatFilePreviewTrigger as Pt, EmbeddedChatFileThumbnail as Q, EmbeddedChatFileName as T, EmbeddedChatFileContent as Wt, EmbeddedChatFileTypeIcon as $, EmbeddedChatFileRemove as Nt, EmbeddedChatFileUploadButton as _t, EmbeddedChatMessageFiles as Vt, EmbeddedChatMessageFile as Qt } from "../styled/components/embedded-chat/file-upload-input.js";
23
- import { EmbeddedChatImagePreviewModal as $t, EmbeddedChatImagePreviewModalOverlay as Rt, EmbeddedChatImagePreviewModalContent as Ot, EmbeddedChatImagePreviewModalClose as jt, EmbeddedChatImagePreviewModalImage as Gt, EmbeddedChatImagePreviewModalFooter as Ut, EmbeddedChatImagePreviewModalFileName as Kt } from "../styled/components/embedded-chat/image-preview-modal.js";
24
- function Ba(a) {
16
+ import { PortalWithTheme as V } from "../primitives/atoms/portal-with-theme.js";
17
+ import { ErrorBoundary as It } from "../primitives/atoms/error-boundary.js";
18
+ import { ModalContent as Mt } from "./modal.js";
19
+ import { ImagePreviewProvider as St } from "../primitives/providers/image-preview-provider.js";
20
+ import { WidgetToggle as Tt } from "./widget-toggle.js";
21
+ import { isImageMimeType as N } from "../primitives/components/embedded-chat/file-upload-input.js";
22
+ import { EmbeddedChatInputNotification as xt, EmbeddedChatInputNotificationContent as At, EmbeddedChatInputNotificationHeader as Ht, EmbeddedChatInputNotificationTitle as kt, EmbeddedChatInputNotificationClose as yt, EmbeddedChatInputNotificationMessage as ft, EmbeddedChatFileInput as wt, EmbeddedChatDropZone as vt, EmbeddedChatFileList as Lt, EmbeddedChatFileItem as Dt, EmbeddedChatFilePreviewTrigger as Bt, EmbeddedChatFileThumbnail as Q, EmbeddedChatFileName as T, EmbeddedChatFileContent as Pt, EmbeddedChatFileTypeIcon as $, EmbeddedChatFileRemove as Wt, EmbeddedChatFileUploadButton as _t, EmbeddedChatMessageFiles as Vt, EmbeddedChatMessageFile as Nt } from "../styled/components/embedded-chat/file-upload-input.js";
23
+ import { EmbeddedChatImagePreviewModal as Qt, EmbeddedChatImagePreviewModalOverlay as $t, EmbeddedChatImagePreviewModalContent as Rt, EmbeddedChatImagePreviewModalClose as Ot, EmbeddedChatImagePreviewModalImage as jt, EmbeddedChatImagePreviewModalFooter as Gt, EmbeddedChatImagePreviewModalFileName as Ut } from "../styled/components/embedded-chat/image-preview-modal.js";
24
+ function La(a) {
25
25
  const { baseSettings: t, aiChatSettings: o } = a;
26
- return /* @__PURE__ */ e(Mt, { children: /* @__PURE__ */ e(
27
- Ft,
26
+ return /* @__PURE__ */ e(It, { children: /* @__PURE__ */ e(
27
+ Ct,
28
28
  {
29
29
  wrapperStyles: {
30
30
  height: "inherit",
31
31
  width: "inherit"
32
32
  },
33
33
  children: /* @__PURE__ */ e(
34
- pt,
34
+ ut,
35
35
  {
36
36
  config: {
37
37
  baseSettings: t,
38
38
  aiChatSettings: o
39
39
  },
40
- componentType: ut.EmbeddedChat,
41
- children: /* @__PURE__ */ e(zt, { ...a })
40
+ componentType: Et.EmbeddedChat,
41
+ children: /* @__PURE__ */ e(Zt, { ...a })
42
42
  }
43
43
  )
44
44
  }
45
45
  ) });
46
46
  }
47
- function Zt(a) {
47
+ function Kt(a) {
48
48
  const { children: t, onToggleView: o, isHidden: r, shouldAutoFocusInput: n = !o } = a;
49
49
  return /* @__PURE__ */ e(R, { isHidden: r, shouldAutoFocusInput: n, children: t });
50
50
  }
51
- function zt(a) {
52
- return /* @__PURE__ */ e(Zt, { ...a, children: /* @__PURE__ */ e(Jt, { ...a }) });
51
+ function Zt(a) {
52
+ return /* @__PURE__ */ e(Kt, { ...a, children: /* @__PURE__ */ e(zt, { ...a }) });
53
53
  }
54
- function Jt(a) {
55
- const { onToggleView: t, variant: o, header: r = Xt } = a, n = It(), m = gt();
56
- return /* @__PURE__ */ e(Tt, { children: /* @__PURE__ */ e(n && !m ? St : k, { children: /* @__PURE__ */ d(
54
+ function zt(a) {
55
+ const { onToggleView: t, variant: o, header: r = Jt } = a, n = gt(), m = pt();
56
+ return /* @__PURE__ */ e(St, { children: /* @__PURE__ */ e(n && !m ? Mt : k, { children: /* @__PURE__ */ d(
57
57
  O,
58
58
  {
59
59
  variant: o ?? (t ? "no-shadow" : "container-with-shadow"),
60
60
  "data-composite": p(!!a.onToggleView || n?.isOpen),
61
61
  children: [
62
- /* @__PURE__ */ e(ma, {}),
62
+ /* @__PURE__ */ e(ia, {}),
63
63
  /* @__PURE__ */ d(j, { children: [
64
64
  r && /* @__PURE__ */ e(r, { ...a }),
65
- /* @__PURE__ */ e(Yt, {}),
66
- /* @__PURE__ */ e(ra, {})
65
+ /* @__PURE__ */ e(Xt, {}),
66
+ /* @__PURE__ */ e(oa, {})
67
67
  ] }),
68
- /* @__PURE__ */ e(sa, {}),
69
- /* @__PURE__ */ e(da, {}),
70
- /* @__PURE__ */ e(ca, {})
68
+ /* @__PURE__ */ e(ma, {}),
69
+ /* @__PURE__ */ e(ea, {}),
70
+ /* @__PURE__ */ e(sa, {})
71
71
  ]
72
72
  }
73
73
  ) }) });
74
74
  }
75
- const Xt = (a) => {
75
+ const Jt = (a) => {
76
76
  const { onToggleView: t, askAILabel: o, searchLabel: r } = a, { aiChatSettings: n } = W(), m = n.isChatHistoryButtonVisible, s = !!t || m;
77
77
  return /* @__PURE__ */ e(G, { "data-show-toolbar": p(s), children: s ? /* @__PURE__ */ d(U, { "data-show-widget-toggle": p(!!t), children: [
78
78
  /* @__PURE__ */ e(K, { children: m && /* @__PURE__ */ e(Z, {}) }),
79
79
  t && /* @__PURE__ */ e(
80
- xt,
80
+ Tt,
81
81
  {
82
82
  onToggleView: t,
83
83
  askAILabel: o,
@@ -88,15 +88,15 @@ const Xt = (a) => {
88
88
  /* @__PURE__ */ e(S, {})
89
89
  ] }) : /* @__PURE__ */ e(S, {}) });
90
90
  };
91
- function Yt() {
92
- const { isSessionLoading: a } = N();
91
+ function Xt() {
92
+ const { isSessionLoading: a } = _();
93
93
  return /* @__PURE__ */ e(z, { children: /* @__PURE__ */ d(J, { children: [
94
- /* @__PURE__ */ e(X, { children: a ? /* @__PURE__ */ e(Y, {}) : /* @__PURE__ */ e(qt, {}) }),
94
+ /* @__PURE__ */ e(X, { children: a ? /* @__PURE__ */ e(Y, {}) : /* @__PURE__ */ e(Yt, {}) }),
95
95
  /* @__PURE__ */ e(q, { children: /* @__PURE__ */ e(ee, {}) }),
96
96
  /* @__PURE__ */ e(de, {})
97
97
  ] }) });
98
98
  }
99
- function qt() {
99
+ function Yt() {
100
100
  const {
101
101
  aiChatSettings: { components: a }
102
102
  } = W();
@@ -115,7 +115,7 @@ function qt() {
115
115
  }
116
116
  }, s = (i) => /* @__PURE__ */ e(Vd, { text: i });
117
117
  return /* @__PURE__ */ d(u, { children: [
118
- /* @__PURE__ */ e(ea, {}),
118
+ /* @__PURE__ */ e(qt, {}),
119
119
  t.map((i) => {
120
120
  const c = n?.id === i.id;
121
121
  return /* @__PURE__ */ d(A, { message: i, children: [
@@ -130,10 +130,10 @@ function qt() {
130
130
  }
131
131
  ) : /* @__PURE__ */ d(u, { children: [
132
132
  /* @__PURE__ */ e(P, { isLast: c }),
133
- (!r || !c) && /* @__PURE__ */ e(oa, {})
133
+ (!r || !c) && /* @__PURE__ */ e(aa, {})
134
134
  ] }) }),
135
- /* @__PURE__ */ e(ta, {}),
136
- /* @__PURE__ */ e(aa, {})
135
+ /* @__PURE__ */ e(da, {}),
136
+ /* @__PURE__ */ e(ta, {})
137
137
  ] })
138
138
  ] }, i.id);
139
139
  }),
@@ -154,26 +154,26 @@ function qt() {
154
154
  ] });
155
155
  } });
156
156
  }
157
- function ea() {
158
- return /* @__PURE__ */ d(kd, { children: [
157
+ function qt() {
158
+ return /* @__PURE__ */ d(Hd, { children: [
159
159
  /* @__PURE__ */ d(w, { children: [
160
- /* @__PURE__ */ e(v, { children: /* @__PURE__ */ e(L, { children: /* @__PURE__ */ e(B, {}) }) }),
161
- /* @__PURE__ */ e(D, {})
160
+ /* @__PURE__ */ e(v, { children: /* @__PURE__ */ e(L, { children: /* @__PURE__ */ e(D, {}) }) }),
161
+ /* @__PURE__ */ e(B, {})
162
162
  ] }),
163
163
  /* @__PURE__ */ d(y, { children: [
164
164
  /* @__PURE__ */ e(f, { children: /* @__PURE__ */ e(P, { isLast: !1 }) }),
165
- /* @__PURE__ */ d(yd, { children: [
165
+ /* @__PURE__ */ d(kd, { children: [
166
+ /* @__PURE__ */ e(yd, {}),
166
167
  /* @__PURE__ */ e(fd, {}),
167
- /* @__PURE__ */ e(wd, {}),
168
- /* @__PURE__ */ d(vd, { children: [
169
- /* @__PURE__ */ e(Ld, {}),
170
- /* @__PURE__ */ e(Bd, {})
168
+ /* @__PURE__ */ d(wd, { children: [
169
+ /* @__PURE__ */ e(vd, {}),
170
+ /* @__PURE__ */ e(Ld, {})
171
171
  ] })
172
172
  ] }),
173
173
  /* @__PURE__ */ d(Dd, { children: [
174
- /* @__PURE__ */ e(Pd, {}),
175
- /* @__PURE__ */ e(Wd, { children: (a) => a.map((t) => /* @__PURE__ */ e(
176
- Nd,
174
+ /* @__PURE__ */ e(Bd, {}),
175
+ /* @__PURE__ */ e(Pd, { children: (a) => a.map((t) => /* @__PURE__ */ e(
176
+ Wd,
177
177
  {
178
178
  children: /* @__PURE__ */ e(_d, { question: t })
179
179
  },
@@ -185,84 +185,84 @@ function ea() {
185
185
  }
186
186
  function H() {
187
187
  return /* @__PURE__ */ d(w, { children: [
188
- /* @__PURE__ */ e(v, { children: /* @__PURE__ */ e(L, { children: /* @__PURE__ */ e(B, {}) }) }),
189
- /* @__PURE__ */ e(D, {})
188
+ /* @__PURE__ */ e(v, { children: /* @__PURE__ */ e(L, { children: /* @__PURE__ */ e(D, {}) }) }),
189
+ /* @__PURE__ */ e(B, {})
190
190
  ] });
191
191
  }
192
- function da() {
193
- return /* @__PURE__ */ e(_, { children: /* @__PURE__ */ e($t, { children: /* @__PURE__ */ e(Rt, { children: /* @__PURE__ */ d(Ot, { children: [
192
+ function ea() {
193
+ return /* @__PURE__ */ e(V, { children: /* @__PURE__ */ e(Qt, { children: /* @__PURE__ */ e($t, { children: /* @__PURE__ */ d(Rt, { children: [
194
+ /* @__PURE__ */ e(Ot, {}),
194
195
  /* @__PURE__ */ e(jt, {}),
195
- /* @__PURE__ */ e(Gt, {}),
196
- /* @__PURE__ */ e(Ut, { children: /* @__PURE__ */ e(Kt, {}) })
196
+ /* @__PURE__ */ e(Gt, { children: /* @__PURE__ */ e(Ut, {}) })
197
197
  ] }) }) }) });
198
198
  }
199
- function ta() {
199
+ function da() {
200
200
  return /* @__PURE__ */ e(Vt, { children: (a) => a.map((t, o) => {
201
- const r = t.url, n = t.mediaType ?? "", m = n.split("/").pop(), s = t.filename ?? (m ? `untitled.${m}` : "untitled"), i = V(n);
202
- return /* @__PURE__ */ d(Qt, { url: r, name: s, mediaType: n, children: [
201
+ const r = t.url, n = t.mediaType ?? "", m = n.split("/").pop(), s = t.filename ?? (m ? `untitled.${m}` : "untitled"), i = N(n);
202
+ return /* @__PURE__ */ d(Nt, { url: r, name: s, mediaType: n, children: [
203
203
  i ? /* @__PURE__ */ e(Q, {}) : /* @__PURE__ */ e($, {}),
204
204
  /* @__PURE__ */ e(T, {})
205
205
  ] }, r || o);
206
206
  }) });
207
207
  }
208
- function aa() {
209
- return /* @__PURE__ */ d(Yd, { children: [
210
- /* @__PURE__ */ e(qd, { children: (a) => a.map((t, o) => /* @__PURE__ */ e(et, { action: t }, `action-${o}`)) }),
208
+ function ta() {
209
+ return /* @__PURE__ */ d(Xd, { children: [
210
+ /* @__PURE__ */ e(Yd, { children: (a) => a.map((t, o) => /* @__PURE__ */ e(qd, { action: t }, `action-${o}`)) }),
211
211
  /* @__PURE__ */ e(M, { action: "copy" }),
212
212
  /* @__PURE__ */ e(M, { action: "upvote" }),
213
213
  /* @__PURE__ */ e(M, { action: "downvote" })
214
214
  ] });
215
215
  }
216
- function oa() {
217
- return /* @__PURE__ */ d(Qd, { children: [
218
- /* @__PURE__ */ e($d, {}),
219
- /* @__PURE__ */ e(Rd, { children: (a) => a.map((t, o) => /* @__PURE__ */ d(Od, { href: t.url, source: t, children: [
220
- /* @__PURE__ */ e(jd, { children: t.breadcrumbs?.map((r) => /* @__PURE__ */ d(k, { children: [
216
+ function aa() {
217
+ return /* @__PURE__ */ d(Nd, { children: [
218
+ /* @__PURE__ */ e(Qd, {}),
219
+ /* @__PURE__ */ e($d, { children: (a) => a.map((t, o) => /* @__PURE__ */ d(Rd, { href: t.url, source: t, children: [
220
+ /* @__PURE__ */ e(Od, { children: t.breadcrumbs?.map((r) => /* @__PURE__ */ d(k, { children: [
221
221
  r,
222
- /* @__PURE__ */ e(Gd, {})
222
+ /* @__PURE__ */ e(jd, {})
223
223
  ] }, r)) }),
224
+ /* @__PURE__ */ e(Gd, {}),
224
225
  /* @__PURE__ */ e(Ud, {}),
225
226
  /* @__PURE__ */ e(Kd, {}),
226
- /* @__PURE__ */ e(Zd, {}),
227
- /* @__PURE__ */ e(zd, { children: (r) => r.map((n, m) => /* @__PURE__ */ e(
228
- Jd,
227
+ /* @__PURE__ */ e(Zd, { children: (r) => r.map((n, m) => /* @__PURE__ */ e(
228
+ zd,
229
229
  {
230
230
  part: n
231
231
  },
232
232
  `part-${m}`
233
233
  )) }),
234
- /* @__PURE__ */ e(Xd, {})
234
+ /* @__PURE__ */ e(Jd, {})
235
235
  ] }, o)) })
236
236
  ] });
237
237
  }
238
- function ra() {
238
+ function oa() {
239
239
  return /* @__PURE__ */ d(te, { children: [
240
- /* @__PURE__ */ e(At, { children: /* @__PURE__ */ d(Ht, { children: [
241
- /* @__PURE__ */ d(kt, { children: [
242
- /* @__PURE__ */ e(yt, {}),
243
- /* @__PURE__ */ e(ft, {})
240
+ /* @__PURE__ */ e(xt, { children: /* @__PURE__ */ d(At, { children: [
241
+ /* @__PURE__ */ d(Ht, { children: [
242
+ /* @__PURE__ */ e(kt, {}),
243
+ /* @__PURE__ */ e(yt, {})
244
244
  ] }),
245
- /* @__PURE__ */ e(wt, {})
245
+ /* @__PURE__ */ e(ft, {})
246
246
  ] }) }),
247
- /* @__PURE__ */ e(na, {}),
248
- /* @__PURE__ */ e(ia, {})
247
+ /* @__PURE__ */ e(ra, {}),
248
+ /* @__PURE__ */ e(na, {})
249
249
  ] });
250
250
  }
251
- function na() {
251
+ function ra() {
252
252
  return /* @__PURE__ */ d(id, { children: [
253
- /* @__PURE__ */ e(vt, {}),
254
- /* @__PURE__ */ e(Lt, { children: "Drop files here to add to chat" }),
255
- /* @__PURE__ */ e(Bt, { children: (a) => a.map((t, o) => {
256
- const r = V(t.type);
253
+ /* @__PURE__ */ e(wt, {}),
254
+ /* @__PURE__ */ e(vt, { children: "Drop files here to add to chat" }),
255
+ /* @__PURE__ */ e(Lt, { children: (a) => a.map((t, o) => {
256
+ const r = N(t.type);
257
257
  return /* @__PURE__ */ d(Dt, { file: t, children: [
258
- r ? /* @__PURE__ */ d(Pt, { children: [
258
+ r ? /* @__PURE__ */ d(Bt, { children: [
259
259
  /* @__PURE__ */ e(Q, {}),
260
260
  /* @__PURE__ */ e(T, {})
261
- ] }) : /* @__PURE__ */ d(Wt, { children: [
261
+ ] }) : /* @__PURE__ */ d(Pt, { children: [
262
262
  /* @__PURE__ */ e($, {}),
263
263
  /* @__PURE__ */ e(T, {})
264
264
  ] }),
265
- /* @__PURE__ */ e(Nt, {})
265
+ /* @__PURE__ */ e(Wt, {})
266
266
  ] }, `${t.name}-${t.lastModified}-${o}`);
267
267
  }) }),
268
268
  /* @__PURE__ */ d(md, { children: [
@@ -272,66 +272,65 @@ function na() {
272
272
  ] })
273
273
  ] });
274
274
  }
275
- function ia() {
275
+ function na() {
276
276
  return /* @__PURE__ */ d(hd, { children: [
277
277
  /* @__PURE__ */ d(bd, { children: [
278
278
  /* @__PURE__ */ e(Cd, {}),
279
- /* @__PURE__ */ e(Fd, {}),
280
- /* @__PURE__ */ e(Ed, {})
279
+ /* @__PURE__ */ e(Fd, {})
281
280
  ] }),
282
- /* @__PURE__ */ d(ud, { children: [
283
- /* @__PURE__ */ e(pd, { children: ({ pinned: a, unpinned: t }) => /* @__PURE__ */ d(u, { children: [
284
- a.map((o) => /* @__PURE__ */ e(gd, { action: o }, o.name)),
285
- t.length > 0 && /* @__PURE__ */ e(Id, {}),
286
- /* @__PURE__ */ d(Md, { children: [
287
- /* @__PURE__ */ e(Sd, {}),
288
- t.map((o) => /* @__PURE__ */ d(Td, { action: o, children: [
289
- /* @__PURE__ */ e(xd, { action: o }),
281
+ /* @__PURE__ */ d(Ed, { children: [
282
+ /* @__PURE__ */ e(ud, { children: ({ pinned: a, unpinned: t }) => /* @__PURE__ */ d(u, { children: [
283
+ a.map((o) => /* @__PURE__ */ e(pd, { action: o }, o.name)),
284
+ t.length > 0 && /* @__PURE__ */ e(gd, {}),
285
+ /* @__PURE__ */ d(Id, { children: [
286
+ /* @__PURE__ */ e(Md, {}),
287
+ t.map((o) => /* @__PURE__ */ d(Sd, { action: o, children: [
288
+ /* @__PURE__ */ e(Td, { action: o }),
290
289
  o.name
291
290
  ] }, o.name))
292
291
  ] })
293
292
  ] }) }),
294
293
  /* @__PURE__ */ d(I, { action: "copy", children: [
295
- /* @__PURE__ */ e(Ad, { action: "copy" }),
296
- /* @__PURE__ */ e(Hd, { action: "copy" })
294
+ /* @__PURE__ */ e(xd, { action: "copy" }),
295
+ /* @__PURE__ */ e(Ad, { action: "copy" })
297
296
  ] }),
298
297
  /* @__PURE__ */ e(I, { action: "clear" }),
299
298
  /* @__PURE__ */ e(I, { action: "stop" })
300
299
  ] })
301
300
  ] });
302
301
  }
303
- function ma() {
304
- const { sessions: a } = Et(), { conversationId: t } = N();
305
- return /* @__PURE__ */ d(dt, { children: [
306
- /* @__PURE__ */ d(tt, { children: [
307
- /* @__PURE__ */ d(at, { children: [
308
- /* @__PURE__ */ e(ot, { iconKey: "backToChat" }),
302
+ function ia() {
303
+ const { sessions: a } = Ft(), { conversationId: t } = _();
304
+ return /* @__PURE__ */ d(et, { children: [
305
+ /* @__PURE__ */ d(dt, { children: [
306
+ /* @__PURE__ */ d(tt, { children: [
307
+ /* @__PURE__ */ e(at, { iconKey: "backToChat" }),
309
308
  "Back to chat"
310
309
  ] }),
311
- /* @__PURE__ */ e(rt, {}),
310
+ /* @__PURE__ */ e(ot, {}),
312
311
  /* @__PURE__ */ e(S, {})
313
312
  ] }),
314
- /* @__PURE__ */ d(nt, { children: [
313
+ /* @__PURE__ */ d(rt, { children: [
315
314
  a.map((o) => /* @__PURE__ */ d(
316
- it,
315
+ nt,
317
316
  {
318
317
  sessionId: o.id,
319
318
  "data-active": p(o.id === t),
320
319
  children: [
321
- /* @__PURE__ */ e(mt, { children: o.title }),
322
- /* @__PURE__ */ e(st, { children: ct(o.updatedAt) })
320
+ /* @__PURE__ */ e(it, { children: o.title }),
321
+ /* @__PURE__ */ e(mt, { children: st(o.updatedAt) })
323
322
  ]
324
323
  },
325
324
  o.id
326
325
  )),
327
- /* @__PURE__ */ e(lt, {}),
328
- /* @__PURE__ */ e(ht, {})
326
+ /* @__PURE__ */ e(ct, {}),
327
+ /* @__PURE__ */ e(lt, {})
329
328
  ] }),
330
- /* @__PURE__ */ e(bt, { children: /* @__PURE__ */ e(Ct, {}) })
329
+ /* @__PURE__ */ e(ht, { children: /* @__PURE__ */ e(bt, {}) })
331
330
  ] });
332
331
  }
333
- function sa() {
334
- return /* @__PURE__ */ e(_, { children: /* @__PURE__ */ e(ae, { children: /* @__PURE__ */ e(oe, { children: /* @__PURE__ */ d(re, { children: [
332
+ function ma() {
333
+ return /* @__PURE__ */ e(V, { children: /* @__PURE__ */ e(ae, { children: /* @__PURE__ */ e(oe, { children: /* @__PURE__ */ d(re, { children: [
335
334
  /* @__PURE__ */ e(ne, {}),
336
335
  /* @__PURE__ */ e(ie, {}),
337
336
  /* @__PURE__ */ e(me, { children: /* @__PURE__ */ d(se, { children: [
@@ -358,7 +357,7 @@ function sa() {
358
357
  ] }) })
359
358
  ] }) }) }) });
360
359
  }
361
- function ca() {
360
+ function sa() {
362
361
  return /* @__PURE__ */ d(le, { children: [
363
362
  /* @__PURE__ */ e(he, {}),
364
363
  /* @__PURE__ */ d(be, { children: [
@@ -380,15 +379,15 @@ function ca() {
380
379
  /* @__PURE__ */ e(fe, {})
381
380
  ] }),
382
381
  /* @__PURE__ */ e(we, { children: /* @__PURE__ */ e(ve, { children: t.items.map((r) => /* @__PURE__ */ d(Le, { value: r.value, children: [
383
- /* @__PURE__ */ e(Be, { children: r.label }),
384
- /* @__PURE__ */ e(De, {})
382
+ /* @__PURE__ */ e(De, { children: r.label }),
383
+ /* @__PURE__ */ e(Be, {})
385
384
  ] }, r.value)) }) })
386
385
  ] }),
387
386
  t.inputType === "combobox" && /* @__PURE__ */ d(Pe, { children: [
388
387
  /* @__PURE__ */ d(We, { children: [
389
- "multiple" in t && t.multiple && /* @__PURE__ */ e(Ne, {}),
390
- /* @__PURE__ */ e(_e, {}),
391
- /* @__PURE__ */ e(Ve, {})
388
+ "multiple" in t && t.multiple && /* @__PURE__ */ e(_e, {}),
389
+ /* @__PURE__ */ e(Ve, {}),
390
+ /* @__PURE__ */ e(Ne, {})
392
391
  ] }),
393
392
  /* @__PURE__ */ e(Qe, { children: /* @__PURE__ */ e($e, { children: /* @__PURE__ */ e(Re, { children: /* @__PURE__ */ e(Oe, { children: (r) => r.length === 0 ? /* @__PURE__ */ e(je, {}) : r.map((n) => /* @__PURE__ */ d(
394
393
  Ge,
@@ -420,8 +419,8 @@ function ca() {
420
419
  ] });
421
420
  }
422
421
  export {
423
- Ba as InkeepEmbeddedChat,
424
- zt as InkeepEmbeddedChatImpl,
425
- Jt as InkeepEmbeddedChatImplContent,
426
- Zt as InkeepEmbeddedChatProvider
422
+ La as InkeepEmbeddedChat,
423
+ Zt as InkeepEmbeddedChatImpl,
424
+ zt as InkeepEmbeddedChatImplContent,
425
+ Kt as InkeepEmbeddedChatProvider
427
426
  };
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("../styled/components/embedded-search.cjs"),R=require("../styled/components/modal.cjs"),A=require("../styled/components/shadow.cjs"),u=require("../primitives/providers/config-provider.cjs"),T=require("../primitives/providers/root-provider.cjs"),w=require("../primitives/providers/widget-provider.cjs"),S=require("../primitives/components/embedded-search/search-provider.cjs"),p=require("../primitives/components/modal/modal-provider.cjs"),d=require("../primitives/utils/misc.cjs"),x=require("../primitives/atoms/cmdk/index.cjs"),v=require("../primitives/atoms/error-boundary.cjs"),a=require("react"),j=require("./widget-toggle.cjs"),k=require("./modal.cjs");function b(r){const{baseSettings:t,searchSettings:n}=r;return e.jsx(v.ErrorBoundary,{children:e.jsx(A.Shadow,{children:e.jsx(T.RootProvider,{config:{baseSettings:t,searchSettings:n},componentType:u.WebWidgetInteractionType.EmbeddedSearch,children:e.jsx(h,{...r})})})})}function I(r){const{children:t,onToggleView:n,isHidden:i,shouldAutoFocusInput:l=!n}=r;return e.jsx(s.Provider,{isHidden:i,shouldAutoFocusInput:l,children:t})}function h(r){return e.jsx(I,{...r,children:e.jsx(m,{...r})})}function m(r){const{searchSettings:{view:t}}=u.useInkeepConfig(),{onToggleView:n,shouldShowAskAICard:i=!!n&&t!=="dual-pane"}=r,l=p.useModal(),o=w.useWidget(),c=l&&!o?k.ModalContent:a.Fragment;return e.jsx(c,{children:e.jsx(s.Wrapper,{"data-show-ask-ai-card":d.dataAttr(i),"data-composite":d.dataAttr(!!n||l?.isOpen),children:e.jsxs(s.Root,{children:[e.jsx(P,{...r}),e.jsxs(s.Content,{children:[e.jsx(C,{askAICardLabel:r.askAICardLabel,askAILabel:r.askAILabel,onToggleView:r.onToggleView,shouldShowAskAICard:i}),e.jsx(L,{})]}),e.jsx(y,{})]})})})}function P(r){const{onToggleView:t,askAILabel:n,searchLabel:i}=r,l=x.useCommandState(c=>c.search),{loading:o}=S.useSearch();return e.jsxs(s.InputGroup,{children:[!o&&e.jsx(s.InputIcon,{}),e.jsx(s.Loading,{}),e.jsx(s.Input,{}),t&&e.jsx(j.WidgetToggle,{onToggleView:t,query:l,askAILabel:n,searchLabel:i,view:"search"}),e.jsx(R.Close,{})]})}function C(r){const{askAILabel:t,onToggleView:n,shouldShowAskAICard:i,askAICardLabel:l}=r,o=x.useCommandState(g=>g.search),{handleToggle:c}=j.useToggleView({onToggleView:n,query:o});return i?e.jsxs(s.AskAITrigger,{onSelect:()=>c("chat",!0),children:[e.jsx(s.AskAITriggerIcon,{}),e.jsxs(s.AskAITriggerLabel,{children:[l||t||"Ask AI",o&&e.jsx(s.AskAITriggerQuery,{children:`${o}`})]}),e.jsx(s.AskAITriggerIndicatorText,{children:"Start conversation"}),e.jsx(s.AskAITriggerIndicator,{})]}):null}function L(){return e.jsxs(s.Results,{children:[e.jsx(s.ResultsLoading,{}),e.jsx(s.ResultsTabList,{children:r=>r.map(t=>e.jsx(s.ResultsTab,{tab:t},t))}),e.jsx(s.ResultsEmpty,{}),e.jsxs(s.ResultsContent,{children:[e.jsx(q,{}),e.jsx(f,{})]})]})}function q(){return e.jsxs(s.ResultsScrollArea,{children:[e.jsx(s.ResultsScrollAreaViewport,{children:e.jsx(s.ResultsList,{children:r=>r.map(t=>e.jsxs(s.ResultsItem,{item:t,children:[e.jsx(s.ResultsItemBreadcrumbs,{children:n=>n.map((i,l)=>e.jsxs(a.Fragment,{children:[i,e.jsx(s.ResultsItemBreadcrumbIcon,{})]},`${i}-${l}`))}),e.jsx(s.ResultsItemIcon,{}),e.jsx(s.ResultsItemTitle,{}),e.jsx(s.ResultsItemTag,{}),e.jsx(s.ResultsItemDescription,{children:n=>n.map((i,l)=>e.jsx(s.ResultsItemDescriptionPart,{part:i},`part-${l}`))}),e.jsx(s.ResultsItemIndicator,{})]},t.id))})}),e.jsx(s.ResultsScrollAreaScrollbar,{children:e.jsx(s.ResultsScrollAreaThumb,{})}),e.jsx(s.ResultsScrollAreaCorner,{})]})}function f(){return e.jsxs(s.ResultsScrollArea,{children:[e.jsx(s.ResultsScrollAreaViewport,{children:e.jsxs(s.ResultsItemPreview,{children:[e.jsxs(s.ResultsItemPreviewHeader,{children:[e.jsxs(s.ResultsItemPreviewHeading,{children:[e.jsx(s.ResultsItemPreviewTitle,{}),e.jsx(s.ResultsItemPreviewTitleLinkIcon,{})]}),e.jsx(s.ResultsItemPreviewBreadcrumbs,{children:r=>r.map((t,n)=>e.jsxs(a.Fragment,{children:[t,e.jsx(s.ResultsItemPreviewBreadcrumbIcon,{})]},`${t}-${n}`))})]}),e.jsx(s.ResultsItemPreviewBody,{}),e.jsxs(s.ResultsItemPreviewOutline,{children:[e.jsx(s.ResultsItemPreviewOutlineTitle,{}),e.jsx(s.ResultsItemPreviewOutlineList,{children:r=>r.map((t,n)=>e.jsxs(s.ResultsItemPreviewOutlineItem,{href:t.url??void 0,"data-is-match":d.dataAttr(t.isMatch),children:[e.jsx(s.ResultsItemPreviewOutlineItemIcon,{}),e.jsx(s.ResultsItemPreviewOutlineItemText,{children:t.content}),t.url&&e.jsx(s.ResultsItemPreviewOutlineItemLinkIcon,{})]},`${t.anchor}-${n}`))})]})]})}),e.jsx(s.ResultsScrollAreaScrollbar,{children:e.jsx(s.ResultsScrollAreaThumb,{})}),e.jsx(s.ResultsScrollAreaCorner,{})]})}function y(){return e.jsx(s.Footer,{children:e.jsxs(s.TaglineContainer,{children:[e.jsx(s.TaglineText,{}),e.jsx(s.TaglineLogo,{}),e.jsx(s.TaglineBrandName,{})]})})}exports.InkeepEmbeddedSearch=b;exports.InkeepEmbeddedSearchImpl=h;exports.InkeepEmbeddedSearchImplContent=m;exports.InkeepEmbeddedSearchProvider=I;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("../styled/components/embedded-search.cjs"),R=require("../styled/components/modal.cjs"),A=require("../styled/components/shadow.cjs"),a=require("../primitives/providers/config-provider.cjs"),w=require("../primitives/providers/root-provider.cjs"),S=require("../primitives/providers/widget-provider.cjs"),T=require("../primitives/components/embedded-search/search-provider.cjs"),p=require("../primitives/components/modal/modal-provider.cjs"),d=require("../primitives/utils/misc.cjs"),x=require("../primitives/atoms/cmdk/index.cjs"),v=require("../primitives/atoms/error-boundary.cjs"),u=require("react"),j=require("./widget-toggle.cjs"),k=require("./modal.cjs");function b(r){const{baseSettings:t,searchSettings:n}=r;return e.jsx(v.ErrorBoundary,{children:e.jsx(A.Shadow,{children:e.jsx(w.RootProvider,{config:{baseSettings:t,searchSettings:n},componentType:a.WebWidgetInteractionType.EmbeddedSearch,children:e.jsx(h,{...r})})})})}function I(r){const{children:t,onToggleView:n,isHidden:i,shouldAutoFocusInput:l=!n}=r;return e.jsx(s.Provider,{isHidden:i,shouldAutoFocusInput:l,children:t})}function h(r){return e.jsx(I,{...r,children:e.jsx(m,{...r})})}function m(r){const{searchSettings:{view:t}}=a.useInkeepConfig(),{onToggleView:n,shouldShowAskAICard:i=!!n&&t!=="dual-pane"}=r,l=p.useModal(),o=S.useWidget(),c=l&&!o?k.ModalContent:u.Fragment;return e.jsx(c,{children:e.jsx(s.Wrapper,{"data-show-ask-ai-card":d.dataAttr(i),"data-composite":d.dataAttr(!!n||l?.isOpen),children:e.jsxs(s.Root,{children:[e.jsx(P,{...r}),e.jsxs(s.Content,{children:[e.jsx(C,{askAICardLabel:r.askAICardLabel,askAILabel:r.askAILabel,onToggleView:r.onToggleView,shouldShowAskAICard:i}),e.jsx(L,{})]}),e.jsx(y,{})]})})})}function P(r){const{onToggleView:t,askAILabel:n,searchLabel:i}=r,l=x.useCommandState(c=>c.search),{loading:o}=T.useSearch();return e.jsxs(s.InputGroup,{children:[!o&&e.jsx(s.InputIcon,{}),e.jsx(s.Loading,{}),e.jsx(s.Input,{}),t&&e.jsx(j.WidgetToggle,{onToggleView:t,query:l,askAILabel:n,searchLabel:i,view:"search"}),e.jsx(R.Close,{})]})}function C(r){const{askAILabel:t,onToggleView:n,shouldShowAskAICard:i,askAICardLabel:l}=r,o=x.useCommandState(g=>g.search),{handleToggle:c}=j.useToggleView({onToggleView:n,query:o});return i?e.jsxs(s.AskAITrigger,{onSelect:()=>c("chat",!0),children:[e.jsx(s.AskAITriggerIcon,{}),e.jsxs(s.AskAITriggerLabel,{children:[l||t||"Ask AI",o&&e.jsx(s.AskAITriggerQuery,{children:`${o}`})]}),e.jsx(s.AskAITriggerIndicatorText,{children:"Start conversation"}),e.jsx(s.AskAITriggerIndicator,{})]}):null}function L(){return e.jsxs(s.Results,{children:[e.jsx(s.ResultsLoading,{}),e.jsx(s.ResultsTabList,{children:r=>r.map(t=>e.jsx(s.ResultsTab,{tab:t},t))}),e.jsx(s.ResultsEmpty,{}),e.jsxs(s.ResultsContent,{children:[e.jsx(q,{}),e.jsx(f,{})]})]})}function q(){return e.jsxs(s.ResultsScrollArea,{children:[e.jsx(s.ResultsScrollAreaViewport,{children:e.jsx(s.ResultsList,{children:r=>r.map(t=>e.jsxs(s.ResultsItem,{item:t,children:[e.jsx(s.ResultsItemBreadcrumbs,{children:n=>n.map((i,l)=>e.jsxs(u.Fragment,{children:[i,e.jsx(s.ResultsItemBreadcrumbIcon,{})]},`${i}-${l}`))}),e.jsx(s.ResultsItemIcon,{}),e.jsx(s.ResultsItemTitle,{}),e.jsx(s.ResultsItemTag,{}),e.jsx(s.ResultsItemDescription,{children:n=>n.map((i,l)=>e.jsx(s.ResultsItemDescriptionPart,{part:i},`part-${l}`))}),e.jsx(s.ResultsItemIndicator,{})]},t.id))})}),e.jsx(s.ResultsScrollAreaScrollbar,{children:e.jsx(s.ResultsScrollAreaThumb,{})}),e.jsx(s.ResultsScrollAreaCorner,{})]})}function f(){return e.jsxs(s.ResultsScrollArea,{children:[e.jsx(s.ResultsScrollAreaViewport,{children:e.jsxs(s.ResultsItemPreview,{children:[e.jsxs(s.ResultsItemPreviewHeader,{children:[e.jsxs(s.ResultsItemPreviewHeading,{children:[e.jsx(s.ResultsItemPreviewTitle,{}),e.jsx(s.ResultsItemPreviewTitleLinkIcon,{})]}),e.jsx(s.ResultsItemPreviewBreadcrumbs,{children:r=>r.map((t,n)=>e.jsxs(u.Fragment,{children:[t,e.jsx(s.ResultsItemPreviewBreadcrumbIcon,{})]},`${t}-${n}`))})]}),e.jsx(s.ResultsItemPreviewBody,{}),e.jsxs(s.ResultsItemPreviewOutline,{children:[e.jsx(s.ResultsItemPreviewOutlineTitle,{}),e.jsx(s.ResultsItemPreviewOutlineList,{children:r=>r.map((t,n)=>e.jsxs(s.ResultsItemPreviewOutlineItem,{href:t.url??void 0,"data-is-match":d.dataAttr(t.isMatch),children:[e.jsx(s.ResultsItemPreviewOutlineItemIcon,{}),e.jsx(s.ResultsItemPreviewOutlineItemText,{children:t.content}),t.url&&e.jsx(s.ResultsItemPreviewOutlineItemLinkIcon,{})]},`${t.anchor}-${n}`))})]})]})}),e.jsx(s.ResultsScrollAreaScrollbar,{children:e.jsx(s.ResultsScrollAreaThumb,{})}),e.jsx(s.ResultsScrollAreaCorner,{})]})}function y(){return e.jsx(s.Footer,{children:e.jsxs(s.TaglineContainer,{children:[e.jsx(s.TaglineText,{}),e.jsx(s.TaglineLogo,{})]})})}exports.InkeepEmbeddedSearch=b;exports.InkeepEmbeddedSearchImpl=h;exports.InkeepEmbeddedSearchImplContent=m;exports.InkeepEmbeddedSearchProvider=I;