@inkeep/agents-ui 0.15.25 → 0.15.27

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 (99) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.js +166 -174
  3. package/dist/primitives/atoms/dialog.cjs +1 -1
  4. package/dist/primitives/atoms/dialog.js +110 -106
  5. package/dist/primitives/atoms/file-upload.cjs +1 -0
  6. package/dist/primitives/atoms/file-upload.d.ts +35 -0
  7. package/dist/primitives/atoms/file-upload.js +45 -0
  8. package/dist/primitives/atoms/icons/built-in-icons.cjs +1 -1
  9. package/dist/primitives/atoms/icons/built-in-icons.d.ts +8 -1
  10. package/dist/primitives/atoms/icons/built-in-icons.js +86 -79
  11. package/dist/primitives/atoms/icons/collections/pi.cjs +1 -1
  12. package/dist/primitives/atoms/icons/collections/pi.d.ts +6 -0
  13. package/dist/primitives/atoms/icons/collections/pi.js +103 -13
  14. package/dist/primitives/atoms/icons/inkeep-default-icons.cjs +1 -1
  15. package/dist/primitives/atoms/icons/inkeep-default-icons.js +9 -1
  16. package/dist/primitives/components/embedded-chat/file-upload-input.cjs +1 -0
  17. package/dist/primitives/components/embedded-chat/file-upload-input.d.ts +68 -0
  18. package/dist/primitives/components/embedded-chat/file-upload-input.js +328 -0
  19. package/dist/primitives/components/embedded-chat/image-preview-modal.cjs +1 -0
  20. package/dist/primitives/components/embedded-chat/image-preview-modal.d.ts +15 -0
  21. package/dist/primitives/components/embedded-chat/image-preview-modal.js +71 -0
  22. package/dist/primitives/components/embedded-chat/use-inkeep-chat.cjs +3 -3
  23. package/dist/primitives/components/embedded-chat/use-inkeep-chat.d.ts +7 -5
  24. package/dist/primitives/components/embedded-chat/use-inkeep-chat.js +287 -247
  25. package/dist/primitives/components/embedded-chat.cjs +4 -4
  26. package/dist/primitives/components/embedded-chat.d.ts +7 -116
  27. package/dist/primitives/components/embedded-chat.js +1082 -1484
  28. package/dist/primitives/components/embedded-search.d.ts +1 -1
  29. package/dist/primitives/hooks/index.cjs +1 -1
  30. package/dist/primitives/hooks/index.js +15 -14
  31. package/dist/primitives/hooks/use-input-notification.cjs +1 -0
  32. package/dist/primitives/hooks/use-input-notification.d.ts +9 -0
  33. package/dist/primitives/hooks/use-input-notification.js +18 -0
  34. package/dist/primitives/hooks/use-scrolling-fades.cjs +1 -1
  35. package/dist/primitives/hooks/use-scrolling-fades.d.ts +1 -0
  36. package/dist/primitives/hooks/use-scrolling-fades.js +21 -5
  37. package/dist/primitives/index.cjs +1 -1
  38. package/dist/primitives/index.js +146 -154
  39. package/dist/primitives/providers/base-events-provider.cjs +1 -1
  40. package/dist/primitives/providers/base-events-provider.js +1 -1
  41. package/dist/primitives/providers/feedback-provider.cjs +1 -1
  42. package/dist/primitives/providers/feedback-provider.js +37 -38
  43. package/dist/primitives/providers/image-preview-provider.cjs +1 -0
  44. package/dist/primitives/providers/image-preview-provider.d.ts +15 -0
  45. package/dist/primitives/providers/image-preview-provider.js +23 -0
  46. package/dist/primitives/providers/index.cjs +1 -1
  47. package/dist/primitives/providers/index.d.ts +0 -3
  48. package/dist/primitives/providers/index.js +54 -63
  49. package/dist/primitives/utils/component-ids.cjs +1 -1
  50. package/dist/primitives/utils/component-ids.d.ts +54 -98
  51. package/dist/primitives/utils/component-ids.js +44 -66
  52. package/dist/primitives/utils/default-settings.cjs +1 -1
  53. package/dist/primitives/utils/default-settings.d.ts +0 -2
  54. package/dist/primitives/utils/default-settings.js +6 -8
  55. package/dist/react/embedded-chat.cjs +1 -1
  56. package/dist/react/embedded-chat.js +283 -287
  57. package/dist/react/index.cjs +1 -1
  58. package/dist/react/index.js +166 -174
  59. package/dist/styled/components/chat-history.cjs +1 -1
  60. package/dist/styled/components/chat-history.d.ts +1 -1
  61. package/dist/styled/components/chat-history.js +31 -29
  62. package/dist/styled/components/embedded-chat/file-upload-input.cjs +1 -0
  63. package/dist/styled/components/embedded-chat/file-upload-input.d.ts +20 -0
  64. package/dist/styled/components/embedded-chat/file-upload-input.js +300 -0
  65. package/dist/styled/components/embedded-chat/image-preview-modal.cjs +1 -0
  66. package/dist/styled/components/embedded-chat/image-preview-modal.d.ts +11 -0
  67. package/dist/styled/components/embedded-chat/image-preview-modal.js +77 -0
  68. package/dist/styled/components/embedded-chat.cjs +1 -1
  69. package/dist/styled/components/embedded-chat.d.ts +4 -50
  70. package/dist/styled/components/embedded-chat.js +567 -1010
  71. package/dist/styled/components/message.cjs +1 -1
  72. package/dist/styled/components/message.js +89 -88
  73. package/dist/styled/components/ui/recipes/citation.d.ts +1 -1
  74. package/dist/styled/components/ui/recipes/index.cjs +1 -1
  75. package/dist/styled/components/ui/recipes/index.d.ts +0 -1
  76. package/dist/styled/components/ui/recipes/index.js +31 -33
  77. package/dist/styled/index.cjs +1 -1
  78. package/dist/styled/index.js +154 -162
  79. package/dist/styled/inkeep.css.cjs +241 -61
  80. package/dist/styled/inkeep.css.js +241 -61
  81. package/dist/types/config/ai.d.ts +1 -10
  82. package/dist/types/icons/built-in.d.ts +1 -1
  83. package/dist/types/icons/custom.d.ts +8 -0
  84. package/dist/types/index.d.ts +0 -1
  85. package/package.json +7 -6
  86. package/dist/primitives/providers/attachment-item-provider.cjs +0 -1
  87. package/dist/primitives/providers/attachment-item-provider.d.ts +0 -9
  88. package/dist/primitives/providers/attachment-item-provider.js +0 -13
  89. package/dist/primitives/providers/attachments-bar-provider.cjs +0 -1
  90. package/dist/primitives/providers/attachments-bar-provider.d.ts +0 -30
  91. package/dist/primitives/providers/attachments-bar-provider.js +0 -57
  92. package/dist/primitives/providers/message-attachments-provider.cjs +0 -1
  93. package/dist/primitives/providers/message-attachments-provider.d.ts +0 -13
  94. package/dist/primitives/providers/message-attachments-provider.js +0 -27
  95. package/dist/primitives/utils/get-message-metadata.d.ts +0 -8
  96. package/dist/styled/components/ui/recipes/attachment.cjs +0 -1
  97. package/dist/styled/components/ui/recipes/attachment.d.ts +0 -4
  98. package/dist/styled/components/ui/recipes/attachment.js +0 -28
  99. package/dist/types/config/settings/workflow.d.ts +0 -86
@@ -8,7 +8,7 @@ const a = {
8
8
  view_toggle: "view_toggle",
9
9
  view_toggle_button: "view_toggle_button",
10
10
  view_toggle_icon: "view_toggle_icon"
11
- }, t = {
11
+ }, e = {
12
12
  codeblockContainer: "codeblockContainer",
13
13
  codeblockHeader: "codeblockHeader",
14
14
  codeblockHeaderLanguage: "codeblockHeaderLanguage",
@@ -32,7 +32,7 @@ const a = {
32
32
  markdownSup: "markdownSup",
33
33
  markdownImg: "markdownImg",
34
34
  markdownHr: "markdownHr"
35
- }, e = {
35
+ }, t = {
36
36
  aiChatWrapper: "aiChatWrapper",
37
37
  aiChatRoot: "aiChatRoot",
38
38
  aiChatHeader: "aiChatHeader",
@@ -58,11 +58,6 @@ const a = {
58
58
  aiChatExampleQuestionsList: "aiChatExampleQuestionsList",
59
59
  aiChatExampleQuestion: "aiChatExampleQuestion",
60
60
  aiChatExampleQuestionButton: "aiChatExampleQuestionButton",
61
- aiChatWorkflows: "aiChatWorkflows",
62
- aiChatWorkflowsLabel: "aiChatWorkflowsLabel",
63
- aiChatWorkflowsList: "aiChatWorkflowsList",
64
- aiChatWorkflow: "aiChatWorkflow",
65
- aiChatWorkflow__Icon: "aiChatWorkflow__Icon",
66
61
  aiChatMessages: "aiChatMessages",
67
62
  aiChatMessageWrapper: "aiChatMessageWrapper",
68
63
  aiChatMessageHeader: "aiChatMessageHeader",
@@ -74,17 +69,8 @@ const a = {
74
69
  aiChatMessageName: "aiChatMessageName",
75
70
  aiChatMessageContentWrapper: "aiChatMessageContentWrapper",
76
71
  aiChatMessageContent: "aiChatMessageContent",
77
- aiChatMessageAttachments: "aiChatMessageAttachments",
78
- aiChatMessageAttachments__List: "aiChatMessageAttachments__List",
79
- aiChatMessageAttachments__Item: "aiChatMessageAttachments__Item",
80
- aiChatMessageAttachments__ItemIcon: "aiChatMessageAttachments__ItemIcon",
81
- aiChatMessageAttachments__ItemTitle: "aiChatMessageAttachments__ItemTitle",
82
- aiChatMessageAttachmentsPreview: "aiChatMessageAttachmentsPreview",
83
- aiChatMessageAttachmentsPreview__Overlay: "aiChatMessageAttachmentsPreview__Overlay",
84
- aiChatMessageAttachmentsPreview__Content: "aiChatMessageAttachmentsPreview__Content",
85
- aiChatMessageAttachmentsPreview__Header: "aiChatMessageAttachmentsPreview__Header",
86
- aiChatMessageAttachmentsPreview__Close: "aiChatMessageAttachmentsPreview__Close",
87
- aiChatMessageAttachmentsPreview__Body: "aiChatMessageAttachmentsPreview__Body",
72
+ aiChatMessage__Files: "aiChatMessage__Files",
73
+ aiChatMessage__File: "aiChatMessage__File",
88
74
  aiChatMessagePart: "aiChatMessagePart",
89
75
  aiChatMessageToolbar: "aiChatMessageToolbar",
90
76
  aiChatMessageCustomActions: "aiChatMessageCustomActions",
@@ -109,39 +95,24 @@ const a = {
109
95
  aiChatInput: "aiChatInput",
110
96
  aiChatInput__SendButton: "aiChatInput__SendButton",
111
97
  aiChatInput__SendButtonIcon: "aiChatInput__SendButtonIcon",
112
- aiChatAttachmentsBar: "aiChatAttachmentsBar",
113
- aiChatAttachmentsBar__List: "aiChatAttachmentsBar__List",
114
- aiChatAttachmentsBar__Attachment: "aiChatAttachmentsBar__Attachment",
115
- aiChatAttachmentsBar__AttachmentIcon: "aiChatAttachmentsBar__AttachmentIcon",
116
- aiChatAttachmentsBar__AttachmentTitle: "aiChatAttachmentsBar__AttachmentTitle",
117
- aiChatAttachmentsBar__AttachmentDelete: "aiChatAttachmentsBar__AttachmentDelete",
118
- aiChatAttachmentsBar__Actions: "aiChatAttachmentsBar__Actions",
119
- aiChatAttachmentsBar__InfoTip: "aiChatAttachmentsBar__InfoTip",
120
- aiChatAttachmentsBar__InfoTipIcon: "aiChatAttachmentsBar__InfoTipIcon",
121
- aiChatAttachmentsBar__InfoTipArrow: "aiChatAttachmentsBar__InfoTipArrow",
122
- aiChatAttachmentsBar__InfoTipText: "aiChatAttachmentsBar__InfoTipText",
123
- aiChatAttachmentsBar__Inputs: "aiChatAttachmentsBar__Inputs",
124
- aiChatAttachmentsBar__Input: "aiChatAttachmentsBar__Input",
125
- aiChatAttachmentsBar__InputIcon: "aiChatAttachmentsBar__InputIcon",
126
- aiChatAttachmentsBar__Modal: "aiChatAttachmentsBar__Modal",
127
- aiChatAttachmentsBar__ModalOverlay: "aiChatAttachmentsBar__ModalOverlay",
128
- aiChatAttachmentsBar__ModalContent: "aiChatAttachmentsBar__ModalContent",
129
- aiChatAttachmentsBar__ModalHeader: "aiChatAttachmentsBar__ModalHeader",
130
- aiChatAttachmentsBar__ModalClose: "aiChatAttachmentsBar__ModalClose",
131
- aiChatAttachmentsBar__ModalBody: "aiChatAttachmentsBar__ModalBody",
132
- aiChatAttachmentsBar__ModalHeading: "aiChatAttachmentsBar__ModalHeading",
133
- aiChatAttachmentsBar__ModalDescription: "aiChatAttachmentsBar__ModalDescription",
134
- aiChatAttachmentsBar__ModalHelp: "aiChatAttachmentsBar__ModalHelp",
135
- aiChatAttachmentsBar__Form: "aiChatAttachmentsBar__Form",
136
- aiChatAttachmentsBar__FormTitle: "aiChatAttachmentsBar__FormTitle",
137
- aiChatAttachmentsBar__FormTitleLabel: "aiChatAttachmentsBar__FormTitleLabel",
138
- aiChatAttachmentsBar__FormTitleInput: "aiChatAttachmentsBar__FormTitleInput",
139
- aiChatAttachmentsBar__FormTitleError: "aiChatAttachmentsBar__FormTitleError",
140
- aiChatAttachmentsBar__FormContent: "aiChatAttachmentsBar__FormContent",
141
- aiChatAttachmentsBar__FormContentLabel: "aiChatAttachmentsBar__FormContentLabel",
142
- aiChatAttachmentsBar__FormContentInput: "aiChatAttachmentsBar__FormContentInput",
143
- aiChatAttachmentsBar__FormContentError: "aiChatAttachmentsBar__FormContentError",
144
- aiChatAttachmentsBar__FormSubmitButton: "aiChatAttachmentsBar__FormSubmitButton",
98
+ aiChatInput__FileUploadButton: "aiChatInput__FileUploadButton",
99
+ aiChatInput__FileUploadButtonIcon: "aiChatInput__FileUploadButtonIcon",
100
+ aiChatInput__FileInput: "aiChatInput__FileInput",
101
+ aiChatInput__FileList: "aiChatInput__FileList",
102
+ aiChatInput__FileItem: "aiChatInput__FileItem",
103
+ aiChatInput__FilePreviewTrigger: "aiChatInput__FilePreviewTrigger",
104
+ aiChatInput__FileContent: "aiChatInput__FileContent",
105
+ aiChatInput__FileThumbnail: "aiChatInput__FileThumbnail",
106
+ aiChatInput__FileName: "aiChatInput__FileName",
107
+ aiChatInput__FileRemove: "aiChatInput__FileRemove",
108
+ aiChatInput__FileRemoveIcon: "aiChatInput__FileRemoveIcon",
109
+ aiChatInput__DropZone: "aiChatInput__DropZone",
110
+ aiChatInput__Notification: "aiChatInput__Notification",
111
+ aiChatInput__NotificationContent: "aiChatInput__NotificationContent",
112
+ aiChatInput__NotificationHeader: "aiChatInput__NotificationHeader",
113
+ aiChatInput__NotificationTitle: "aiChatInput__NotificationTitle",
114
+ aiChatInput__NotificationMessage: "aiChatInput__NotificationMessage",
115
+ aiChatInput__NotificationClose: "aiChatInput__NotificationClose",
145
116
  aiChatActionBar: "aiChatActionBar",
146
117
  aiChat__ChatActions: "aiChat__ChatActions",
147
118
  aiChat__ChatAction: "aiChat__ChatAction",
@@ -164,6 +135,13 @@ const a = {
164
135
  aiChatFeedbackModal__Header: "aiChatFeedbackModal__Header",
165
136
  aiChatFeedbackModal__Close: "aiChatFeedbackModal__Close",
166
137
  aiChatFeedbackModal__Body: "aiChatFeedbackModal__Body",
138
+ aiChatImagePreviewModal: "aiChatImagePreviewModal",
139
+ aiChatImagePreviewModal__Overlay: "aiChatImagePreviewModal__Overlay",
140
+ aiChatImagePreviewModal__Content: "aiChatImagePreviewModal__Content",
141
+ aiChatImagePreviewModal__Image: "aiChatImagePreviewModal__Image",
142
+ aiChatImagePreviewModal__Footer: "aiChatImagePreviewModal__Footer",
143
+ aiChatImagePreviewModal__FileName: "aiChatImagePreviewModal__FileName",
144
+ aiChatImagePreviewModal__Close: "aiChatImagePreviewModal__Close",
167
145
  aiChatFeedbackForm: "aiChatFeedbackForm",
168
146
  aiChatFeedbackItem: "aiChatFeedbackItem",
169
147
  aiChatFeedbackItem__Checkbox: "aiChatFeedbackItem__Checkbox",
@@ -278,14 +256,14 @@ const a = {
278
256
  modal__Overlay: "modal__Overlay",
279
257
  modal__Content: "modal__Content",
280
258
  modal__Close: "modal__Close"
281
- }, r = {
259
+ }, o = {
282
260
  chatButton__Text: "chatButton__Text",
283
261
  chatButton__Button: "chatButton__Button",
284
262
  chatButton__Container: "chatButton__Container",
285
263
  chatButton__AvatarImage: "chatButton__AvatarImage",
286
264
  chatButton__AvatarContent: "chatButton__AvatarContent",
287
265
  chatButton__CloseIcon: "chatButton__CloseIcon"
288
- }, o = {
266
+ }, r = {
289
267
  searchBar__Container: "searchBar__Container",
290
268
  searchBar__Button: "searchBar__Button",
291
269
  searchBar__ContentWrapper: "searchBar__ContentWrapper",
@@ -300,11 +278,11 @@ const a = {
300
278
  sidebarChat__Resizer: "sidebarChat__Resizer",
301
279
  sidebarChat__CloseButton: "sidebarChat__CloseButton",
302
280
  sidebarChat__Header: "sidebarChat__Header"
303
- }, s = {
281
+ }, n = {
304
282
  chatBubble__Root: "chatBubble__Root",
305
283
  chatBubble__CloseButton: "chatBubble__CloseButton",
306
284
  chatBubble__Header: "chatBubble__Header"
307
- }, n = {
285
+ }, s = {
308
286
  dataSummary__Group: "dataSummary__Group",
309
287
  dataSummary__Toggle: "dataSummary__Toggle",
310
288
  dataSummary__ToggleText: "dataSummary__ToggleText",
@@ -330,32 +308,32 @@ const a = {
330
308
  aiChatHistory__LoadingState: "aiChatHistory__LoadingState",
331
309
  aiChatHistory__Footer: "aiChatHistory__Footer",
332
310
  aiChatHistory__NewConversationButton: "aiChatHistory__NewConversationButton"
333
- }, c = {
311
+ }, l = {
334
312
  //
335
313
  //
336
- ...t,
337
314
  ...e,
315
+ ...t,
338
316
  ..._,
339
317
  ...i,
340
- ...r,
341
318
  ...o,
319
+ ...r,
342
320
  ...a,
343
321
  ...h,
344
- ...s,
345
322
  ...n,
323
+ ...s,
346
324
  ...C
347
325
  };
348
326
  export {
349
- s as ChatBubbleComponentIds,
350
- n as DataSummaryComponentIds,
351
- o as SearchBarComponentIds,
327
+ n as ChatBubbleComponentIds,
328
+ s as DataSummaryComponentIds,
329
+ r as SearchBarComponentIds,
352
330
  h as SidebarChatComponentIds,
353
- e as aiChatComponentIds,
331
+ t as aiChatComponentIds,
354
332
  C as aiChatHistoryComponentIds,
355
333
  _ as aiSearchComponentIds,
356
- r as chatButtonComponentIds,
357
- c as componentIDs,
358
- t as markDownComponentIds,
334
+ o as chatButtonComponentIds,
335
+ l as componentIDs,
336
+ e as markDownComponentIds,
359
337
  a as miscellanousComponentIds,
360
338
  i as modalComponentIds
361
339
  };
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../theme/index.cjs"),t=require("../../theme/colors.cjs"),s={baseUrl:"https://api.agents.inkeep.com",placeholder:"How do I get started?",aiAssistantName:void 0,shouldOpenLinksInNewTab:!0,disclaimerSettings:{isEnabled:!1,label:"Usage policy"},isShareButtonVisible:!1,isViewOnly:!1,isChatHistoryButtonVisible:!0,exampleQuestionsLabel:"Example questions",exampleQuestions:[],isFirstExampleQuestionHighlighted:!0,isCopyChatButtonVisible:!1,getHelpOptions:[],workflowsHeader:"Workflows",workflows:[],toolbarButtonLabels:{clear:"Clear",share:"Share",getHelp:"Get help",stop:"Stop",copyChat:"Copy"},context:{}},a={shouldBypassCaptcha:!1,tags:[],userProperties:{},primaryBrandColor:t.DEFAULT_PRIMARY_BRAND_COLOR,theme:{varsClassName:"inkeep-widget-vars",...e.theme}},l={shouldOpenLinksInNewTab:!1,defaultQuery:"",debounceTimeMs:0,tabs:["All","Publications","PDFs","GitHub","Forums","Discord","Slack","StackOverflow"],placeholder:"Search for anything...",view:"single-pane"};exports.defaultInkeepAIChatSettings=s;exports.defaultInkeepBaseSettings=a;exports.defaultInkeepSearchSettings=l;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../theme/index.cjs"),t=require("../../theme/colors.cjs"),s={baseUrl:"https://api.agents.inkeep.com",placeholder:"How do I get started?",aiAssistantName:void 0,shouldOpenLinksInNewTab:!0,disclaimerSettings:{isEnabled:!1,label:"Usage policy"},isShareButtonVisible:!1,isViewOnly:!1,isChatHistoryButtonVisible:!0,exampleQuestionsLabel:"Example questions",exampleQuestions:[],isFirstExampleQuestionHighlighted:!0,isCopyChatButtonVisible:!1,getHelpOptions:[],toolbarButtonLabels:{clear:"Clear",share:"Share",getHelp:"Get help",stop:"Stop",copyChat:"Copy"},context:{}},a={shouldBypassCaptcha:!1,tags:[],userProperties:{},primaryBrandColor:t.DEFAULT_PRIMARY_BRAND_COLOR,theme:{varsClassName:"inkeep-widget-vars",...e.theme}},i={shouldOpenLinksInNewTab:!1,defaultQuery:"",debounceTimeMs:0,tabs:["All","Publications","PDFs","GitHub","Forums","Discord","Slack","StackOverflow"],placeholder:"Search for anything...",view:"single-pane"};exports.defaultInkeepAIChatSettings=s;exports.defaultInkeepBaseSettings=a;exports.defaultInkeepSearchSettings=i;
@@ -16,8 +16,6 @@ export declare const defaultInkeepAIChatSettings: {
16
16
  isFirstExampleQuestionHighlighted: true;
17
17
  isCopyChatButtonVisible: false;
18
18
  getHelpOptions: never[];
19
- workflowsHeader: string;
20
- workflows: never[];
21
19
  toolbarButtonLabels: {
22
20
  clear: string;
23
21
  share: string;
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { theme as e } from "../../theme/index.js";
3
- import { DEFAULT_PRIMARY_BRAND_COLOR as s } from "../../theme/colors.js";
4
- const l = {
3
+ import { DEFAULT_PRIMARY_BRAND_COLOR as t } from "../../theme/colors.js";
4
+ const i = {
5
5
  baseUrl: "https://api.agents.inkeep.com",
6
6
  placeholder: "How do I get started?",
7
7
  aiAssistantName: void 0,
@@ -18,8 +18,6 @@ const l = {
18
18
  isFirstExampleQuestionHighlighted: !0,
19
19
  isCopyChatButtonVisible: !1,
20
20
  getHelpOptions: [],
21
- workflowsHeader: "Workflows",
22
- workflows: [],
23
21
  toolbarButtonLabels: {
24
22
  clear: "Clear",
25
23
  share: "Share",
@@ -28,11 +26,11 @@ const l = {
28
26
  copyChat: "Copy"
29
27
  },
30
28
  context: {}
31
- }, i = {
29
+ }, l = {
32
30
  shouldBypassCaptcha: !1,
33
31
  tags: [],
34
32
  userProperties: {},
35
- primaryBrandColor: s,
33
+ primaryBrandColor: t,
36
34
  theme: {
37
35
  varsClassName: "inkeep-widget-vars",
38
36
  ...e
@@ -46,7 +44,7 @@ const l = {
46
44
  view: "single-pane"
47
45
  };
48
46
  export {
49
- l as defaultInkeepAIChatSettings,
50
- i as defaultInkeepBaseSettings,
47
+ i as defaultInkeepAIChatSettings,
48
+ l as defaultInkeepBaseSettings,
51
49
  o as defaultInkeepSearchSettings
52
50
  };
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),j=require("react"),t=require("../styled/components/embedded-chat.cjs"),i=require("../styled/components/chat-history.cjs"),F=require("../styled/components/modal.cjs"),T=require("../styled/components/shadow.cjs"),C=require("../styled/components/message.cjs"),B=require("../primitives/providers/chat-history-provider.cjs"),g=require("../primitives/providers/config-provider.cjs"),y=require("../primitives/providers/root-provider.cjs"),S=require("../primitives/providers/widget-provider.cjs"),I=require("../primitives/components/embedded-chat/chat-provider.cjs"),H=require("../primitives/components/modal/modal-provider.cjs"),u=require("../primitives/utils/misc.cjs"),p=require("../primitives/atoms/portal-with-theme.cjs"),E=require("../primitives/atoms/error-boundary.cjs"),v=require("./modal.cjs"),w=require("./widget-toggle.cjs");function f(r){const{baseSettings:s,aiChatSettings:n}=r;return e.jsx(E.ErrorBoundary,{children:e.jsx(T.Shadow,{wrapperStyles:{height:"inherit",width:"inherit"},children:e.jsx(y.RootProvider,{config:{baseSettings:s,aiChatSettings:n},componentType:g.WebWidgetInteractionType.EmbeddedChat,children:e.jsx(M,{...r})})})})}function A(r){const{children:s,onToggleView:n,isHidden:o,shouldAutoFocusInput:a=!n}=r;return e.jsx(t.Provider,{isHidden:o,shouldAutoFocusInput:a,children:s})}function M(r){return e.jsx(A,{...r,children:e.jsx(k,{...r})})}function k(r){const{onToggleView:s,variant:n,header:o=L}=r,a=H.useModal(),d=S.useWidget(),l=a&&!d?v.ModalContent:j.Fragment;return e.jsx(l,{children:e.jsxs(t.Wrapper,{variant:n??(s?"no-shadow":"container-with-shadow"),"data-composite":u.dataAttr(!!r.onToggleView||a?.isOpen),children:[e.jsx(R,{}),e.jsxs(t.Root,{children:[o&&e.jsx(o,{...r}),e.jsx(P,{}),e.jsx(N,{})]}),e.jsx($,{}),e.jsx(G,{})]})})}const L=r=>{const{onToggleView:s,askAILabel:n,searchLabel:o}=r,{aiChatSettings:a}=g.useInkeepConfig(),d=a.isChatHistoryButtonVisible,l=!!s||d;return e.jsx(t.Header,{"data-show-toolbar":u.dataAttr(l),children:l?e.jsxs(t.HeaderToolbar,{"data-show-widget-toggle":u.dataAttr(!!s),children:[e.jsx(t.HeaderToolbarWrapper,{children:d&&e.jsx(t.ChatHistoryTrigger,{})}),s&&e.jsx(w.WidgetToggle,{onToggleView:s,askAILabel:n,searchLabel:o,view:"chat"}),e.jsx(F.Close,{})]}):e.jsx(F.Close,{})})};function P(){const{isSessionLoading:r}=I.useChat();return e.jsx(t.Content,{children:e.jsxs(t.ContentScrollArea,{children:[e.jsx(t.ContentScrollAreaViewport,{children:r?e.jsx(t.MessagesSessionLoading,{}):e.jsx(D,{})}),e.jsx(t.ContentScrollAreaScrollbar,{children:e.jsx(t.ContentScrollAreaThumb,{})}),e.jsx(t.ContentScrollAreaCorner,{})]})})}function D(){const{aiChatSettings:{components:r}}=g.useInkeepConfig();return e.jsx(t.Messages,{children:({messages:s,isLoading:n,isStreaming:o})=>{const a=s.at(-1),d=(c,x)=>{const m=r?.[c];if(!m)return console.warn(`Component "${c}" not found in components config`),null;try{if(typeof m=="function"&&m.length<=1)return j.createElement(m,x);const h=m(x,document.createElement("div"),null);return j.isValidElement(h)||typeof h=="string"?h:null}catch(h){return console.error(`🔍 [renderComponent] Error rendering component "${c}":`,h),null}},l=c=>e.jsx(t.Markdown,{text:c});return e.jsxs(e.Fragment,{children:[e.jsx(W,{}),s.map(c=>{const x=a?.id===c.id;return e.jsxs(t.MessageWrapper,{message:c,children:[e.jsx(b,{}),e.jsxs(t.MessageContentWrapper,{children:[e.jsx(t.MessageContent,{children:r?.IkpMessage?e.jsx(t.DynamicComponent,{name:"IkpMessage",props:{message:c,renderComponent:d,renderMarkdown:l},componentDef:r.IkpMessage}):e.jsxs(e.Fragment,{children:[e.jsx(C.EmbeddedChatMessagePart,{isLast:x}),(!o||!x)&&e.jsx(V,{})]})}),e.jsx(q,{}),e.jsx(_,{})]})]},c.id)}),n&&a?.parts.length&&e.jsxs(t.MessageWrapper,{message:{id:"___loader___",role:"assistant",parts:[{type:"text",text:"Thinking..."}]},children:[e.jsx(b,{}),e.jsx(t.MessageLoading,{})]})]})}})}function W(){return e.jsxs(t.IntroMessageWrapper,{children:[e.jsxs(t.MessageHeader,{children:[e.jsx(t.MessageAvatar,{children:e.jsx(t.MessageAvatarContent,{children:e.jsx(t.MessageAvatarImage,{})})}),e.jsx(t.MessageName,{})]}),e.jsxs(t.MessageContentWrapper,{children:[e.jsx(t.MessageContent,{children:e.jsx(C.EmbeddedChatMessagePart,{isLast:!1})}),e.jsxs(t.Disclaimer,{children:[e.jsx(t.DisclaimerLabel,{}),e.jsx(t.DisclaimerTrigger,{}),e.jsxs(t.DisclaimerContent,{children:[e.jsx(t.DisclaimerText,{}),e.jsx(t.DisclaimerArrow,{})]})]}),e.jsxs(t.ExampleQuestions,{children:[e.jsx(t.ExampleQuestionsLabel,{}),e.jsx(t.ExampleQuestionsList,{children:r=>r.map(s=>e.jsx(t.ExampleQuestion,{children:e.jsx(t.ExampleQuestionButton,{question:s})},typeof s=="object"?s.label:s))})]})]})]})}function b(){return e.jsxs(t.MessageHeader,{children:[e.jsx(t.MessageAvatar,{children:e.jsx(t.MessageAvatarContent,{children:e.jsx(t.MessageAvatarImage,{})})}),e.jsx(t.MessageName,{})]})}function q(){return e.jsxs(t.MessageAttachments,{children:[e.jsx(t.MessageAttachmentsList,{children:r=>r.map(s=>e.jsxs(t.MessageAttachmentsItem,{attachment:s,children:[e.jsx(t.MessageAttachmentsItemIcon,{}),e.jsx(t.MessageAttachmentsItemTitle,{})]},s.id))}),e.jsx(t.MessageAttachmentsPreview,{children:e.jsx(p.PortalWithTheme,{children:e.jsx(t.MessageAttachmentsPreviewOverlay,{children:e.jsxs(t.MessageAttachmentsPreviewContent,{children:[e.jsx(t.MessageAttachmentsPreviewHeader,{}),e.jsx(t.MessageAttachmentsPreviewClose,{}),e.jsx(t.MessageAttachmentsPreviewBody,{})]})})})})]})}function _(){return e.jsxs(t.MessageToolbar,{children:[e.jsx(t.MessageCustomActions,{children:r=>r.map((s,n)=>e.jsx(t.MessageCustomAction,{action:s},`action-${n}`))}),e.jsx(t.MessageAction,{action:"copy"}),e.jsx(t.MessageAction,{action:"upvote"}),e.jsx(t.MessageAction,{action:"downvote"})]})}function V(){return e.jsxs(t.MessageSources,{children:[e.jsx(t.MessageSourcesHeader,{}),e.jsx(t.MessageSourcesList,{children:r=>r.map((s,n)=>e.jsxs(t.MessageSourceItem,{href:s.url,source:s,children:[e.jsx(t.MessageSourceItemBreadcrumbs,{children:s.breadcrumbs?.map(o=>e.jsxs(j.Fragment,{children:[o,e.jsx(t.MessageSourceItemBreadcrumbIcon,{})]},o))}),e.jsx(t.MessageSourceItemIcon,{}),e.jsx(t.MessageSourceItemTitle,{}),e.jsx(t.MessageSourceItemTag,{}),e.jsx(t.MessageSourceItemDescription,{children:o=>o.map((a,d)=>e.jsx(t.MessageSourceItemDescriptionPart,{part:a},`part-${d}`))}),e.jsx(t.MessageSourceItemIndicator,{})]},n))})]})}function N(){return e.jsxs(t.Footer,{children:[e.jsx(O,{}),e.jsx(Q,{})]})}function O(){return e.jsxs(t.InputFieldset,{children:[e.jsxs(t.InputGroup,{children:[e.jsx(t.Input,{}),e.jsx(t.SendButton,{children:e.jsx(t.SendButtonIcon,{})})]}),e.jsxs(t.AttachmentsBar,{children:[e.jsx(t.AttachmentsBarList,{children:r=>r.map(s=>e.jsxs(t.AttachmentsBarAttachment,{attachment:s,children:[e.jsx(t.AttachmentsBarAttachmentIcon,{}),e.jsx(t.AttachmentsBarAttachmentTitle,{}),e.jsx(t.AttachmentsBarAttachmentDelete,{})]},s.id))}),e.jsxs(t.AttachmentsBarActions,{children:[e.jsxs(t.AttachmentsBarInfoTip,{children:[e.jsx(t.AttachmentsBarInfoTipIcon,{}),e.jsx(t.AttachmentsBarInfoTipText,{})]}),e.jsx(t.AttachmentsBarInputs,{children:r=>r.map(s=>e.jsx(t.AttachmentsBarInput,{input:s,children:s.displayName},s.id))})]}),e.jsx(p.PortalWithTheme,{children:e.jsx(t.AttachmentsBarModal,{children:e.jsx(t.AttachmentsBarModalOverlay,{children:e.jsxs(t.AttachmentsBarModalContent,{children:[e.jsxs(t.AttachmentsBarModalHeader,{children:[e.jsx(t.AttachmentsBarModalHeading,{}),e.jsx(t.AttachmentsBarModalDescription,{}),e.jsx(t.AttachmentsBarModalHelp,{})]}),e.jsx(t.AttachmentsBarModalClose,{}),e.jsx(t.AttachmentsBarModalBody,{children:e.jsxs(t.AttachmentsBarForm,{children:[e.jsxs(t.AttachmentsBarFormTitle,{children:[e.jsx(t.AttachmentsBarFormTitleLabel,{}),e.jsx(t.AttachmentsBarFormTitleInput,{}),e.jsx(t.AttachmentsBarFormTitleError,{})]}),e.jsxs(t.AttachmentsBarFormContent,{children:[e.jsx(t.AttachmentsBarFormContentLabel,{}),e.jsx(t.AttachmentsBarFormContentInput,{}),e.jsx(t.AttachmentsBarFormContentError,{})]}),e.jsx(t.AttachmentsBarFormSubmitButton,{})]})})]})})})})]})]})}function Q(){return e.jsxs(t.ActionBar,{children:[e.jsxs(t.TaglineContainer,{children:[e.jsx(t.TaglineText,{}),e.jsx(t.TaglineLogo,{}),e.jsx(t.TaglineBrandName,{})]}),e.jsxs(t.Actions,{children:[e.jsx(t.HelpActions,{children:({pinned:r,unpinned:s})=>e.jsxs(e.Fragment,{children:[r.map(n=>e.jsx(t.HelpAction,{action:n},n.name)),s.length>0&&e.jsx(t.HelpActionsTrigger,{}),e.jsxs(t.HelpActionsMenu,{children:[e.jsx(t.HelpActionsMenuArrow,{}),s.map(n=>e.jsxs(t.HelpActionsMenuItem,{action:n,children:[e.jsx(t.HelpActionsMenuItemIcon,{action:n}),n.name]},n.name))]})]})}),e.jsxs(t.ChatAction,{action:"copy",children:[e.jsx(t.ChatActionLabel,{action:"copy"}),e.jsx(t.ChatActionFeedback,{action:"copy"})]}),e.jsx(t.ChatAction,{action:"clear"}),e.jsx(t.ChatAction,{action:"stop"})]})]})}function R(){const{sessions:r}=B.useChatHistory(),{conversationId:s}=I.useChat();return e.jsxs(i.EmbeddedChatHistoryRoot,{children:[e.jsxs(i.EmbeddedChatHistoryHeader,{children:[e.jsxs(i.EmbeddedChatHistoryBackButton,{children:[e.jsx(i.EmbeddedChatHistoryBackButtonIcon,{iconKey:"backToChat"}),"Back to chat"]}),e.jsx(i.EmbeddedChatHistoryTitle,{}),e.jsx(F.Close,{})]}),e.jsxs(i.EmbeddedChatHistoryList,{children:[r.map(n=>e.jsxs(i.EmbeddedChatHistoryItem,{sessionId:n.id,"data-active":u.dataAttr(n.id===s),children:[e.jsx(i.EmbeddedChatHistoryItemTitle,{children:n.title}),e.jsx(i.EmbeddedChatHistoryItemDate,{children:i.formatSessionDate(n.updatedAt)})]},n.id)),e.jsx(i.EmbeddedChatHistoryEmptyState,{}),e.jsx(i.EmbeddedChatHistoryLoadingState,{})]}),e.jsx(i.EmbeddedChatHistoryFooter,{children:e.jsx(i.EmbeddedChatHistoryNewConversationButton,{})})]})}function $(){return e.jsx(p.PortalWithTheme,{children:e.jsx(t.FeedbackModal,{children:e.jsx(t.FeedbackModalOverlay,{children:e.jsxs(t.FeedbackModalContent,{children:[e.jsx(t.FeedbackModalHeader,{}),e.jsx(t.FeedbackModalClose,{}),e.jsx(t.FeedbackModalBody,{children:e.jsxs(t.FeedbackForm,{children:[e.jsxs(t.FeedbackItem,{name:"unrelated_response",children:[e.jsx(t.FeedbackItemCheckbox,{children:e.jsx(t.FeedbackItemCheckboxIndicator,{})}),e.jsx(t.FeedbackItemLabel,{}),e.jsx(t.FeedbackItemDescription,{})]}),e.jsxs(t.FeedbackItem,{name:"inaccurate_statement",children:[e.jsx(t.FeedbackItemCheckbox,{children:e.jsx(t.FeedbackItemCheckboxIndicator,{})}),e.jsx(t.FeedbackItemLabel,{}),e.jsx(t.FeedbackItemDescription,{})]}),e.jsxs(t.FeedbackItem,{name:"inaccurate_code_snippet",children:[e.jsx(t.FeedbackItemCheckbox,{children:e.jsx(t.FeedbackItemCheckboxIndicator,{})}),e.jsx(t.FeedbackItemLabel,{}),e.jsx(t.FeedbackItemDescription,{})]}),e.jsxs(t.FeedbackItem,{name:"irrelevant_citations",children:[e.jsx(t.FeedbackItemCheckbox,{children:e.jsx(t.FeedbackItemCheckboxIndicator,{})}),e.jsx(t.FeedbackItemLabel,{})]}),e.jsx(t.FeedbackSubmitButton,{})]})})]})})})})}function G(){return e.jsxs(t.FormWrapper,{children:[e.jsx(t.FormClose,{}),e.jsxs(t.Form,{children:[e.jsxs(t.FormHeader,{children:[e.jsx(t.FormHeading,{}),e.jsx(t.FormDescription,{})]}),e.jsx(t.FormContent,{children:r=>e.jsxs(e.Fragment,{children:[r.map((s,n)=>e.jsxs(t.FormField,{field:s,autoFocus:n===0,children:[e.jsx(t.FormFieldLabel,{}),s.inputType==="text"&&e.jsx(t.FormFieldText,{}),s.inputType==="email"&&e.jsx(t.FormFieldEmail,{}),s.inputType==="file"&&e.jsx(t.FormFieldFile,{}),s.inputType==="textarea"&&e.jsx(t.FormFieldTextArea,{}),s.inputType==="checkbox"&&e.jsx(t.FormFieldCheckbox,{children:e.jsx(t.FormFieldCheckboxIndicator,{})}),s.inputType==="select"&&e.jsxs(t.FormFieldSelect,{children:[e.jsxs(t.FormFieldSelectTrigger,{children:[e.jsx(t.FormFieldSelectValue,{}),e.jsx(t.FormFieldSelectIcon,{})]}),e.jsx(t.FormFieldSelectContent,{children:e.jsx(t.FormFieldSelectViewport,{children:s.items.map(o=>e.jsxs(t.FormFieldSelectItem,{value:o.value,children:[e.jsx(t.FormFieldSelectItemText,{children:o.label}),e.jsx(t.FormFieldSelectItemIndicator,{})]},o.value))})})]}),s.inputType==="combobox"&&e.jsxs(t.FormFieldCombobox,{children:[e.jsxs(t.FormFieldComboboxControl,{children:["multiple"in s&&s.multiple&&e.jsx(t.FormFieldComboboxSelectedTags,{}),e.jsx(t.FormFieldComboboxInput,{}),e.jsx(t.FormFieldComboboxTrigger,{})]}),e.jsx(t.FormFieldComboboxPositioner,{children:e.jsx(t.FormFieldComboboxContent,{children:e.jsx(t.FormFieldComboboxList,{children:e.jsx(t.FormFieldComboboxListItems,{children:o=>o.length===0?e.jsx(t.FormFieldComboboxListEmpty,{}):o.map(a=>e.jsxs(t.FormFieldComboboxItem,{item:a,children:[e.jsx(t.FormFieldComboboxItemText,{children:a.label}),e.jsx(t.FormFieldComboboxItemIndicator,{})]},a.value))})})})})]}),e.jsx(t.FormFieldDescription,{}),e.jsx(t.FormFieldError,{})]},s.name)),e.jsx(t.FormError,{})]})}),e.jsxs(t.FormFooter,{children:[e.jsx(t.FormCancel,{}),e.jsx(t.FormSubmit,{})]})]}),e.jsxs(t.FormSuccess,{children:[e.jsx(t.FormSuccessHeading,{}),e.jsx(t.FormSuccessMessage,{}),e.jsx(t.FormSuccessButton,{})]})]})}exports.InkeepEmbeddedChat=f;exports.InkeepEmbeddedChatImpl=M;exports.InkeepEmbeddedChatImplContent=k;exports.InkeepEmbeddedChatProvider=A;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),b=require("react"),s=require("../styled/components/embedded-chat.cjs"),a=require("../styled/components/chat-history.cjs"),p=require("../styled/components/modal.cjs"),v=require("../styled/components/shadow.cjs"),I=require("../styled/components/message.cjs"),H=require("../primitives/providers/chat-history-provider.cjs"),g=require("../primitives/providers/config-provider.cjs"),A=require("../primitives/providers/root-provider.cjs"),w=require("../primitives/providers/widget-provider.cjs"),M=require("../primitives/components/embedded-chat/chat-provider.cjs"),f=require("../primitives/components/modal/modal-provider.cjs"),F=require("../primitives/utils/misc.cjs"),E=require("../primitives/atoms/portal-with-theme.cjs"),P=require("../primitives/atoms/error-boundary.cjs"),L=require("./modal.cjs"),B=require("../primitives/providers/image-preview-provider.cjs"),D=require("./widget-toggle.cjs"),k=require("../primitives/components/embedded-chat/file-upload-input.cjs"),i=require("../styled/components/embedded-chat/file-upload-input.cjs"),m=require("../styled/components/embedded-chat/image-preview-modal.cjs");function q(r){const{baseSettings:t,aiChatSettings:n}=r;return e.jsx(P.ErrorBoundary,{children:e.jsx(v.Shadow,{wrapperStyles:{height:"inherit",width:"inherit"},children:e.jsx(A.RootProvider,{config:{baseSettings:t,aiChatSettings:n},componentType:g.WebWidgetInteractionType.EmbeddedChat,children:e.jsx(T,{...r})})})})}function y(r){const{children:t,onToggleView:n,isHidden:o,shouldAutoFocusInput:d=!n}=r;return e.jsx(s.Provider,{isHidden:o,shouldAutoFocusInput:d,children:t})}function T(r){return e.jsx(y,{...r,children:e.jsx(S,{...r})})}function S(r){const{onToggleView:t,variant:n,header:o=W}=r,d=f.useModal(),l=w.useWidget(),x=d&&!l?L.ModalContent:b.Fragment;return e.jsx(B.ImagePreviewProvider,{children:e.jsx(x,{children:e.jsxs(s.Wrapper,{variant:n??(t?"no-shadow":"container-with-shadow"),"data-composite":F.dataAttr(!!r.onToggleView||d?.isOpen),children:[e.jsx(Z,{}),e.jsxs(s.Root,{children:[o&&e.jsx(o,{...r}),e.jsx(N,{}),e.jsx(U,{})]}),e.jsx(z,{}),e.jsx($,{}),e.jsx(J,{})]})})})}const W=r=>{const{onToggleView:t,askAILabel:n,searchLabel:o}=r,{aiChatSettings:d}=g.useInkeepConfig(),l=d.isChatHistoryButtonVisible,x=!!t||l;return e.jsx(s.Header,{"data-show-toolbar":F.dataAttr(x),children:x?e.jsxs(s.HeaderToolbar,{"data-show-widget-toggle":F.dataAttr(!!t),children:[e.jsx(s.HeaderToolbarWrapper,{children:l&&e.jsx(s.ChatHistoryTrigger,{})}),t&&e.jsx(D.WidgetToggle,{onToggleView:t,askAILabel:n,searchLabel:o,view:"chat"}),e.jsx(p.Close,{})]}):e.jsx(p.Close,{})})};function N(){const{isSessionLoading:r}=M.useChat();return e.jsx(s.Content,{children:e.jsxs(s.ContentScrollArea,{children:[e.jsx(s.ContentScrollAreaViewport,{children:r?e.jsx(s.MessagesSessionLoading,{}):e.jsx(_,{})}),e.jsx(s.ContentScrollAreaScrollbar,{children:e.jsx(s.ContentScrollAreaThumb,{})}),e.jsx(s.ContentScrollAreaCorner,{})]})})}function _(){const{aiChatSettings:{components:r}}=g.useInkeepConfig();return e.jsx(s.Messages,{children:({messages:t,isLoading:n,isStreaming:o})=>{const d=t.at(-1),l=(c,j)=>{const h=r?.[c];if(!h)return console.warn(`Component "${c}" not found in components config`),null;try{if(typeof h=="function"&&h.length<=1)return b.createElement(h,j);const u=h(j,document.createElement("div"),null);return b.isValidElement(u)||typeof u=="string"?u:null}catch(u){return console.error(`🔍 [renderComponent] Error rendering component "${c}":`,u),null}},x=c=>e.jsx(s.Markdown,{text:c});return e.jsxs(e.Fragment,{children:[e.jsx(V,{}),t.map(c=>{const j=d?.id===c.id;return e.jsxs(s.MessageWrapper,{message:c,children:[e.jsx(C,{}),e.jsxs(s.MessageContentWrapper,{children:[e.jsx(s.MessageContent,{children:r?.IkpMessage?e.jsx(s.DynamicComponent,{name:"IkpMessage",props:{message:c,renderComponent:l,renderMarkdown:x},componentDef:r.IkpMessage}):e.jsxs(e.Fragment,{children:[e.jsx(I.EmbeddedChatMessagePart,{isLast:j}),(!o||!j)&&e.jsx(O,{})]})}),e.jsx(R,{}),e.jsx(Q,{})]})]},c.id)}),n&&d?.parts.length&&e.jsxs(s.MessageWrapper,{message:{id:"___loader___",role:"assistant",parts:[{type:"text",text:"Thinking..."}]},children:[e.jsx(C,{}),e.jsx(s.MessageLoading,{})]})]})}})}function V(){return e.jsxs(s.IntroMessageWrapper,{children:[e.jsxs(s.MessageHeader,{children:[e.jsx(s.MessageAvatar,{children:e.jsx(s.MessageAvatarContent,{children:e.jsx(s.MessageAvatarImage,{})})}),e.jsx(s.MessageName,{})]}),e.jsxs(s.MessageContentWrapper,{children:[e.jsx(s.MessageContent,{children:e.jsx(I.EmbeddedChatMessagePart,{isLast:!1})}),e.jsxs(s.Disclaimer,{children:[e.jsx(s.DisclaimerLabel,{}),e.jsx(s.DisclaimerTrigger,{}),e.jsxs(s.DisclaimerContent,{children:[e.jsx(s.DisclaimerText,{}),e.jsx(s.DisclaimerArrow,{})]})]}),e.jsxs(s.ExampleQuestions,{children:[e.jsx(s.ExampleQuestionsLabel,{}),e.jsx(s.ExampleQuestionsList,{children:r=>r.map(t=>e.jsx(s.ExampleQuestion,{children:e.jsx(s.ExampleQuestionButton,{question:t})},typeof t=="object"?t.label:t))})]})]})]})}function C(){return e.jsxs(s.MessageHeader,{children:[e.jsx(s.MessageAvatar,{children:e.jsx(s.MessageAvatarContent,{children:e.jsx(s.MessageAvatarImage,{})})}),e.jsx(s.MessageName,{})]})}function $(){return e.jsx(E.PortalWithTheme,{children:e.jsx(m.EmbeddedChatImagePreviewModal,{children:e.jsx(m.EmbeddedChatImagePreviewModalOverlay,{children:e.jsxs(m.EmbeddedChatImagePreviewModalContent,{children:[e.jsx(m.EmbeddedChatImagePreviewModalClose,{}),e.jsx(m.EmbeddedChatImagePreviewModalImage,{}),e.jsx(m.EmbeddedChatImagePreviewModalFooter,{children:e.jsx(m.EmbeddedChatImagePreviewModalFileName,{})})]})})})})}function R(){return e.jsx(i.EmbeddedChatMessageFiles,{children:r=>r.map((t,n)=>{const o=t.url,d=t.mediaType??"",l=d.split("/").pop(),x=t.filename??(l?`untitled.${l}`:"untitled"),c=k.isImageMimeType(d);return e.jsxs(i.EmbeddedChatMessageFile,{url:o,name:x,mediaType:d,children:[c?e.jsx(i.EmbeddedChatFileThumbnail,{}):e.jsx(i.EmbeddedChatFileTypeIcon,{}),e.jsx(i.EmbeddedChatFileName,{})]},o||n)})})}function Q(){return e.jsxs(s.MessageToolbar,{children:[e.jsx(s.MessageCustomActions,{children:r=>r.map((t,n)=>e.jsx(s.MessageCustomAction,{action:t},`action-${n}`))}),e.jsx(s.MessageAction,{action:"copy"}),e.jsx(s.MessageAction,{action:"upvote"}),e.jsx(s.MessageAction,{action:"downvote"})]})}function O(){return e.jsxs(s.MessageSources,{children:[e.jsx(s.MessageSourcesHeader,{}),e.jsx(s.MessageSourcesList,{children:r=>r.map((t,n)=>e.jsxs(s.MessageSourceItem,{href:t.url,source:t,children:[e.jsx(s.MessageSourceItemBreadcrumbs,{children:t.breadcrumbs?.map(o=>e.jsxs(b.Fragment,{children:[o,e.jsx(s.MessageSourceItemBreadcrumbIcon,{})]},o))}),e.jsx(s.MessageSourceItemIcon,{}),e.jsx(s.MessageSourceItemTitle,{}),e.jsx(s.MessageSourceItemTag,{}),e.jsx(s.MessageSourceItemDescription,{children:o=>o.map((d,l)=>e.jsx(s.MessageSourceItemDescriptionPart,{part:d},`part-${l}`))}),e.jsx(s.MessageSourceItemIndicator,{})]},n))})]})}function U(){return e.jsxs(s.Footer,{children:[e.jsx(i.EmbeddedChatInputNotification,{children:e.jsxs(i.EmbeddedChatInputNotificationContent,{children:[e.jsxs(i.EmbeddedChatInputNotificationHeader,{children:[e.jsx(i.EmbeddedChatInputNotificationTitle,{}),e.jsx(i.EmbeddedChatInputNotificationClose,{})]}),e.jsx(i.EmbeddedChatInputNotificationMessage,{})]})}),e.jsx(G,{}),e.jsx(K,{})]})}function G(){return e.jsxs(s.InputFieldset,{children:[e.jsx(i.EmbeddedChatFileInput,{}),e.jsx(i.EmbeddedChatDropZone,{children:"Drop files here to add to chat"}),e.jsx(i.EmbeddedChatFileList,{children:r=>r.map((t,n)=>{const o=k.isImageMimeType(t.type);return e.jsxs(i.EmbeddedChatFileItem,{file:t,children:[o?e.jsxs(i.EmbeddedChatFilePreviewTrigger,{children:[e.jsx(i.EmbeddedChatFileThumbnail,{}),e.jsx(i.EmbeddedChatFileName,{})]}):e.jsxs(i.EmbeddedChatFileContent,{children:[e.jsx(i.EmbeddedChatFileTypeIcon,{}),e.jsx(i.EmbeddedChatFileName,{})]}),e.jsx(i.EmbeddedChatFileRemove,{})]},`${t.name}-${t.lastModified}-${n}`)})}),e.jsxs(s.InputGroup,{children:[e.jsx(i.EmbeddedChatFileUploadButton,{}),e.jsx(s.Input,{}),e.jsx(s.SendButton,{children:e.jsx(s.SendButtonIcon,{})})]})]})}function K(){return e.jsxs(s.ActionBar,{children:[e.jsxs(s.TaglineContainer,{children:[e.jsx(s.TaglineText,{}),e.jsx(s.TaglineLogo,{}),e.jsx(s.TaglineBrandName,{})]}),e.jsxs(s.Actions,{children:[e.jsx(s.HelpActions,{children:({pinned:r,unpinned:t})=>e.jsxs(e.Fragment,{children:[r.map(n=>e.jsx(s.HelpAction,{action:n},n.name)),t.length>0&&e.jsx(s.HelpActionsTrigger,{}),e.jsxs(s.HelpActionsMenu,{children:[e.jsx(s.HelpActionsMenuArrow,{}),t.map(n=>e.jsxs(s.HelpActionsMenuItem,{action:n,children:[e.jsx(s.HelpActionsMenuItemIcon,{action:n}),n.name]},n.name))]})]})}),e.jsxs(s.ChatAction,{action:"copy",children:[e.jsx(s.ChatActionLabel,{action:"copy"}),e.jsx(s.ChatActionFeedback,{action:"copy"})]}),e.jsx(s.ChatAction,{action:"clear"}),e.jsx(s.ChatAction,{action:"stop"})]})]})}function Z(){const{sessions:r}=H.useChatHistory(),{conversationId:t}=M.useChat();return e.jsxs(a.EmbeddedChatHistoryRoot,{children:[e.jsxs(a.EmbeddedChatHistoryHeader,{children:[e.jsxs(a.EmbeddedChatHistoryBackButton,{children:[e.jsx(a.EmbeddedChatHistoryBackButtonIcon,{iconKey:"backToChat"}),"Back to chat"]}),e.jsx(a.EmbeddedChatHistoryTitle,{}),e.jsx(p.Close,{})]}),e.jsxs(a.EmbeddedChatHistoryList,{children:[r.map(n=>e.jsxs(a.EmbeddedChatHistoryItem,{sessionId:n.id,"data-active":F.dataAttr(n.id===t),children:[e.jsx(a.EmbeddedChatHistoryItemTitle,{children:n.title}),e.jsx(a.EmbeddedChatHistoryItemDate,{children:a.formatSessionDate(n.updatedAt)})]},n.id)),e.jsx(a.EmbeddedChatHistoryEmptyState,{}),e.jsx(a.EmbeddedChatHistoryLoadingState,{})]}),e.jsx(a.EmbeddedChatHistoryFooter,{children:e.jsx(a.EmbeddedChatHistoryNewConversationButton,{})})]})}function z(){return e.jsx(E.PortalWithTheme,{children:e.jsx(s.FeedbackModal,{children:e.jsx(s.FeedbackModalOverlay,{children:e.jsxs(s.FeedbackModalContent,{children:[e.jsx(s.FeedbackModalHeader,{}),e.jsx(s.FeedbackModalClose,{}),e.jsx(s.FeedbackModalBody,{children:e.jsxs(s.FeedbackForm,{children:[e.jsxs(s.FeedbackItem,{name:"unrelated_response",children:[e.jsx(s.FeedbackItemCheckbox,{children:e.jsx(s.FeedbackItemCheckboxIndicator,{})}),e.jsx(s.FeedbackItemLabel,{}),e.jsx(s.FeedbackItemDescription,{})]}),e.jsxs(s.FeedbackItem,{name:"inaccurate_statement",children:[e.jsx(s.FeedbackItemCheckbox,{children:e.jsx(s.FeedbackItemCheckboxIndicator,{})}),e.jsx(s.FeedbackItemLabel,{}),e.jsx(s.FeedbackItemDescription,{})]}),e.jsxs(s.FeedbackItem,{name:"inaccurate_code_snippet",children:[e.jsx(s.FeedbackItemCheckbox,{children:e.jsx(s.FeedbackItemCheckboxIndicator,{})}),e.jsx(s.FeedbackItemLabel,{}),e.jsx(s.FeedbackItemDescription,{})]}),e.jsxs(s.FeedbackItem,{name:"irrelevant_citations",children:[e.jsx(s.FeedbackItemCheckbox,{children:e.jsx(s.FeedbackItemCheckboxIndicator,{})}),e.jsx(s.FeedbackItemLabel,{})]}),e.jsx(s.FeedbackSubmitButton,{})]})})]})})})})}function J(){return e.jsxs(s.FormWrapper,{children:[e.jsx(s.FormClose,{}),e.jsxs(s.Form,{children:[e.jsxs(s.FormHeader,{children:[e.jsx(s.FormHeading,{}),e.jsx(s.FormDescription,{})]}),e.jsx(s.FormContent,{children:r=>e.jsxs(e.Fragment,{children:[r.map((t,n)=>e.jsxs(s.FormField,{field:t,autoFocus:n===0,children:[e.jsx(s.FormFieldLabel,{}),t.inputType==="text"&&e.jsx(s.FormFieldText,{}),t.inputType==="email"&&e.jsx(s.FormFieldEmail,{}),t.inputType==="file"&&e.jsx(s.FormFieldFile,{}),t.inputType==="textarea"&&e.jsx(s.FormFieldTextArea,{}),t.inputType==="checkbox"&&e.jsx(s.FormFieldCheckbox,{children:e.jsx(s.FormFieldCheckboxIndicator,{})}),t.inputType==="select"&&e.jsxs(s.FormFieldSelect,{children:[e.jsxs(s.FormFieldSelectTrigger,{children:[e.jsx(s.FormFieldSelectValue,{}),e.jsx(s.FormFieldSelectIcon,{})]}),e.jsx(s.FormFieldSelectContent,{children:e.jsx(s.FormFieldSelectViewport,{children:t.items.map(o=>e.jsxs(s.FormFieldSelectItem,{value:o.value,children:[e.jsx(s.FormFieldSelectItemText,{children:o.label}),e.jsx(s.FormFieldSelectItemIndicator,{})]},o.value))})})]}),t.inputType==="combobox"&&e.jsxs(s.FormFieldCombobox,{children:[e.jsxs(s.FormFieldComboboxControl,{children:["multiple"in t&&t.multiple&&e.jsx(s.FormFieldComboboxSelectedTags,{}),e.jsx(s.FormFieldComboboxInput,{}),e.jsx(s.FormFieldComboboxTrigger,{})]}),e.jsx(s.FormFieldComboboxPositioner,{children:e.jsx(s.FormFieldComboboxContent,{children:e.jsx(s.FormFieldComboboxList,{children:e.jsx(s.FormFieldComboboxListItems,{children:o=>o.length===0?e.jsx(s.FormFieldComboboxListEmpty,{}):o.map(d=>e.jsxs(s.FormFieldComboboxItem,{item:d,children:[e.jsx(s.FormFieldComboboxItemText,{children:d.label}),e.jsx(s.FormFieldComboboxItemIndicator,{})]},d.value))})})})})]}),e.jsx(s.FormFieldDescription,{}),e.jsx(s.FormFieldError,{})]},t.name)),e.jsx(s.FormError,{})]})}),e.jsxs(s.FormFooter,{children:[e.jsx(s.FormCancel,{}),e.jsx(s.FormSubmit,{})]})]}),e.jsxs(s.FormSuccess,{children:[e.jsx(s.FormSuccessHeading,{}),e.jsx(s.FormSuccessMessage,{}),e.jsx(s.FormSuccessButton,{})]})]})}exports.InkeepEmbeddedChat=q;exports.InkeepEmbeddedChatImpl=T;exports.InkeepEmbeddedChatImplContent=S;exports.InkeepEmbeddedChatProvider=y;