@inkeep/cxkit-react 0.5.113 → 0.5.115
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("@inkeep/cxkit-styled"),m=require("react"),l=require("./widget-toggle.cjs"),C=require("./modal.cjs");function x(a){const{baseSettings:t,aiChatSettings:s}=a;return e.jsx(d.ErrorBoundary,{children:e.jsx(d.Shadow,{wrapperStyles:{height:"inherit",width:"inherit"},children:e.jsx(d.RootProvider,{config:{baseSettings:t,aiChatSettings:s},componentType:d.WebWidgetInteractionType.EmbeddedChat,children:e.jsx(o,{...a})})})})}function c(a){const{children:t,onToggleView:s,isHidden:n,shouldAutoFocusInput:r=!s}=a;return e.jsx(d.EmbeddedChat.Provider,{isHidden:n,shouldAutoFocusInput:r,children:t})}function o(a){return e.jsx(c,{...a,children:e.jsx(i,{...a})})}function i(a){const{onToggleView:t,variant:s,header:n=j}=a,r=d.useModal(),h=d.useWidget(),b=r&&!h?C.ModalContent:m.Fragment;return e.jsx(b,{children:e.jsxs(d.EmbeddedChat.Wrapper,{variant:s??(t?"no-shadow":"container-with-shadow"),"data-composite":d.dataAttr(!!a.onToggleView||r?.isOpen),children:[e.jsx(d.EmbeddedChat.ConversationLoading,{}),e.jsxs(d.EmbeddedChat.Root,{children:[e.jsx(n,{...a}),e.jsx(E,{}),e.jsx(M,{})]}),e.jsx(B,{}),e.jsx(S,{})]})})}function j(a){const{onToggleView:t,askAILabel:s,searchLabel:n}=a,r=!!t;return e.jsx(d.EmbeddedChat.Header,{"data-show-toolbar":d.dataAttr(r),children:r?e.jsxs(d.EmbeddedChat.HeaderToolbar,{children:[e.jsxs(d.EmbeddedChat.HeaderToolbarWrapper,{children:[e.jsx(d.EmbeddedChat.ToolbarHeader,{}),e.jsxs(d.EmbeddedChat.Disclaimer,{children:[e.jsx(d.EmbeddedChat.DisclaimerTrigger,{}),e.jsxs(d.EmbeddedChat.DisclaimerContent,{side:"bottom",align:"start",children:[e.jsx(d.EmbeddedChat.DisclaimerText,{}),e.jsx(d.EmbeddedChat.DisclaimerArrow,{})]})]})]}),e.jsx(l.WidgetToggle,{onToggleView:t,askAILabel:s,searchLabel:n,view:"chat"}),e.jsx(d.Modal.Close,{})]}):e.jsx(d.Modal.Close,{})})}function E(){return e.jsx(d.EmbeddedChat.Content,{children:e.jsxs(d.EmbeddedChat.ContentScrollArea,{children:[e.jsx(d.EmbeddedChat.ContentScrollAreaViewport,{children:e.jsx(u,{})}),e.jsx(d.EmbeddedChat.ContentScrollAreaScrollbar,{children:e.jsx(d.EmbeddedChat.ContentScrollAreaThumb,{})}),e.jsx(d.EmbeddedChat.ContentScrollAreaCorner,{})]})})}function u(){return e.jsx(d.EmbeddedChat.Messages,{children:({messages:a})=>e.jsxs(e.Fragment,{children:[e.jsx(F,{}),a.map(t=>e.jsxs(d.EmbeddedChat.MessageWrapper,{message:t,children:[e.jsx(g,{}),e.jsx(d.EmbeddedChat.MessageLoading,{}),e.jsxs(d.EmbeddedChat.MessageContentWrapper,{children:[e.jsx(d.EmbeddedChat.MessageContent,{children:e.jsx(d.EmbeddedChat.Message,{})}),e.jsx(p,{}),e.jsx(A,{}),e.jsx(I,{})]})]},t.id))]})})}function F(){return e.jsxs(d.EmbeddedChat.IntroMessageWrapper,{children:[e.jsxs(d.EmbeddedChat.MessageHeader,{children:[e.jsx(d.EmbeddedChat.MessageAvatar,{children:e.jsxs(d.EmbeddedChat.MessageAvatarContent,{children:[e.jsx(d.EmbeddedChat.MessageAvatarFallback,{}),e.jsx(d.EmbeddedChat.MessageAvatarImage,{})]})}),e.jsx(d.EmbeddedChat.MessageName,{})]}),e.jsxs(d.EmbeddedChat.MessageContentWrapper,{children:[e.jsx(d.EmbeddedChat.MessageContent,{children:e.jsx(d.EmbeddedChat.Message,{})}),e.jsxs(d.EmbeddedChat.Disclaimer,{children:[e.jsx(d.EmbeddedChat.DisclaimerLabel,{}),e.jsx(d.EmbeddedChat.DisclaimerTrigger,{}),e.jsxs(d.EmbeddedChat.DisclaimerContent,{children:[e.jsx(d.EmbeddedChat.DisclaimerText,{}),e.jsx(d.EmbeddedChat.DisclaimerArrow,{})]})]}),e.jsxs(d.EmbeddedChat.ExampleQuestions,{children:[e.jsx(d.EmbeddedChat.ExampleQuestionsLabel,{}),e.jsx(d.EmbeddedChat.ExampleQuestionsList,{children:a=>a.map(t=>e.jsx(d.EmbeddedChat.ExampleQuestion,{children:e.jsx(d.EmbeddedChat.ExampleQuestionButton,{question:t})},t))})]})]})]})}function g(){return e.jsxs(d.EmbeddedChat.MessageHeader,{children:[e.jsx(d.EmbeddedChat.MessageAvatar,{children:e.jsxs(d.EmbeddedChat.MessageAvatarContent,{children:[e.jsx(d.EmbeddedChat.MessageAvatarFallback,{}),e.jsx(d.EmbeddedChat.MessageAvatarImage,{})]})}),e.jsx(d.EmbeddedChat.MessageName,{})]})}function p(){return e.jsxs(d.EmbeddedChat.MessageAttachments,{children:[e.jsx(d.EmbeddedChat.MessageAttachmentsList,{children:a=>a.map(t=>e.jsxs(d.EmbeddedChat.MessageAttachmentsItem,{attachment:t,children:[e.jsx(d.EmbeddedChat.MessageAttachmentsItemIcon,{}),e.jsx(d.EmbeddedChat.MessageAttachmentsItemTitle,{})]},t.id))}),e.jsx(d.EmbeddedChat.MessageAttachmentsPreview,{children:e.jsx(d.PortalWithTheme,{children:e.jsx(d.EmbeddedChat.MessageAttachmentsPreviewOverlay,{children:e.jsxs(d.EmbeddedChat.MessageAttachmentsPreviewContent,{children:[e.jsx(d.EmbeddedChat.MessageAttachmentsPreviewHeader,{}),e.jsx(d.EmbeddedChat.MessageAttachmentsPreviewClose,{}),e.jsx(d.EmbeddedChat.MessageAttachmentsPreviewBody,{})]})})})})]})}function A(){return e.jsxs(d.EmbeddedChat.MessageToolbar,{children:[e.jsx(d.EmbeddedChat.MessageToolActions,{children:a=>a.map((t,s)=>e.jsx(d.EmbeddedChat.MessageToolAction,{action:t},`action-${s}`))}),e.jsx(d.EmbeddedChat.MessageAction,{action:"copy"}),e.jsx(d.EmbeddedChat.MessageAction,{action:"upvote"}),e.jsx(d.EmbeddedChat.MessageAction,{action:"downvote"})]})}function I(){return e.jsxs(d.EmbeddedChat.MessageSources,{children:[e.jsx(d.EmbeddedChat.MessageSourcesHeader,{}),e.jsx(d.EmbeddedChat.MessageSourcesList,{children:a=>a.map((t,s)=>e.jsxs(d.EmbeddedChat.MessageSourceItem,{href:t.url,source:t,children:[e.jsx(d.EmbeddedChat.MessageSourceItemBreadcrumbs,{children:t.breadcrumbs?.map(n=>e.jsxs(m.Fragment,{children:[n,e.jsx(d.EmbeddedChat.MessageSourceItemBreadcrumbIcon,{})]},n))}),e.jsx(d.EmbeddedChat.MessageSourceItemIcon,{}),e.jsx(d.EmbeddedChat.MessageSourceItemTitle,{}),e.jsx(d.EmbeddedChat.MessageSourceItemTag,{}),e.jsx(d.EmbeddedChat.MessageSourceItemDescription,{children:n=>n.map((r,h)=>e.jsx(d.EmbeddedChat.MessageSourceItemDescriptionPart,{part:r},`part-${h}`))}),e.jsx(d.EmbeddedChat.MessageSourceItemIndicator,{})]},s))})]})}function M(){return e.jsxs(d.EmbeddedChat.Footer,{children:[e.jsx(k,{}),e.jsx(T,{})]})}function k(){return e.jsxs(d.EmbeddedChat.InputFieldset,{children:[e.jsxs(d.EmbeddedChat.InputGroup,{children:[e.jsx(d.EmbeddedChat.Input,{}),e.jsx(d.EmbeddedChat.SendButton,{children:e.jsx(d.EmbeddedChat.SendButtonIcon,{})})]}),e.jsxs(d.EmbeddedChat.AttachmentsBar,{children:[e.jsx(d.EmbeddedChat.AttachmentsBarList,{children:a=>a.map(t=>e.jsxs(d.EmbeddedChat.AttachmentsBarAttachment,{attachment:t,children:[e.jsx(d.EmbeddedChat.AttachmentsBarAttachmentIcon,{}),e.jsx(d.EmbeddedChat.AttachmentsBarAttachmentTitle,{}),e.jsx(d.EmbeddedChat.AttachmentsBarAttachmentDelete,{})]},t.id))}),e.jsxs(d.EmbeddedChat.AttachmentsBarActions,{children:[e.jsxs(d.EmbeddedChat.AttachmentsBarInfoTip,{children:[e.jsx(d.EmbeddedChat.AttachmentsBarInfoTipIcon,{}),e.jsx(d.EmbeddedChat.AttachmentsBarInfoTipText,{})]}),e.jsx(d.EmbeddedChat.AttachmentsBarInputs,{children:a=>a.map(t=>e.jsx(d.EmbeddedChat.AttachmentsBarInput,{input:t,children:t.displayName},t.id))})]}),e.jsx(d.PortalWithTheme,{children:e.jsx(d.EmbeddedChat.AttachmentsBarModal,{children:e.jsx(d.EmbeddedChat.AttachmentsBarModalOverlay,{children:e.jsxs(d.EmbeddedChat.AttachmentsBarModalContent,{children:[e.jsxs(d.EmbeddedChat.AttachmentsBarModalHeader,{children:[e.jsx(d.EmbeddedChat.AttachmentsBarModalHeading,{}),e.jsx(d.EmbeddedChat.AttachmentsBarModalDescription,{}),e.jsx(d.EmbeddedChat.AttachmentsBarModalHelp,{})]}),e.jsx(d.EmbeddedChat.AttachmentsBarModalClose,{}),e.jsx(d.EmbeddedChat.AttachmentsBarModalBody,{children:e.jsxs(d.EmbeddedChat.AttachmentsBarForm,{children:[e.jsxs(d.EmbeddedChat.AttachmentsBarFormTitle,{children:[e.jsx(d.EmbeddedChat.AttachmentsBarFormTitleLabel,{}),e.jsx(d.EmbeddedChat.AttachmentsBarFormTitleInput,{}),e.jsx(d.EmbeddedChat.AttachmentsBarFormTitleError,{})]}),e.jsxs(d.EmbeddedChat.AttachmentsBarFormContent,{children:[e.jsx(d.EmbeddedChat.AttachmentsBarFormContentLabel,{}),e.jsx(d.EmbeddedChat.AttachmentsBarFormContentInput,{}),e.jsx(d.EmbeddedChat.AttachmentsBarFormContentError,{})]}),e.jsx(d.EmbeddedChat.AttachmentsBarFormSubmitButton,{})]})})]})})})})]})]})}function T(){return e.jsxs(d.EmbeddedChat.ActionBar,{children:[e.jsxs(d.EmbeddedChat.TaglineContainer,{children:[e.jsx(d.EmbeddedChat.TaglineText,{}),e.jsx(d.EmbeddedChat.TaglineLogo,{}),e.jsx(d.EmbeddedChat.TaglineBrandName,{})]}),e.jsxs(d.EmbeddedChat.Actions,{children:[e.jsx(d.EmbeddedChat.HelpActions,{children:({pinned:a,unpinned:t})=>e.jsxs(e.Fragment,{children:[a.map(s=>e.jsx(d.EmbeddedChat.HelpAction,{action:s},s.name)),t.length>0&&e.jsx(d.EmbeddedChat.HelpActionsTrigger,{}),e.jsxs(d.EmbeddedChat.HelpActionsMenu,{children:[e.jsx(d.EmbeddedChat.HelpActionsMenuArrow,{}),t.map(s=>e.jsxs(d.EmbeddedChat.HelpActionsMenuItem,{action:s,children:[e.jsx(d.EmbeddedChat.HelpActionsMenuItemIcon,{action:s}),s.name]},s.name))]})]})}),e.jsxs(d.EmbeddedChat.ChatAction,{action:"copy",children:[e.jsx(d.EmbeddedChat.ChatActionLabel,{action:"copy"}),e.jsx(d.EmbeddedChat.ChatActionFeedback,{action:"copy"})]}),e.jsxs(d.EmbeddedChat.ChatAction,{action:"share",children:[e.jsx(d.EmbeddedChat.ChatActionLabel,{action:"share"}),e.jsx(d.EmbeddedChat.ChatActionFeedback,{action:"share"})]}),e.jsx(d.EmbeddedChat.ChatAction,{action:"clear"}),e.jsx(d.EmbeddedChat.ChatAction,{action:"stop"})]})]})}function B(){return e.jsx(d.PortalWithTheme,{children:e.jsx(d.EmbeddedChat.FeedbackModal,{children:e.jsx(d.EmbeddedChat.FeedbackModalOverlay,{children:e.jsxs(d.EmbeddedChat.FeedbackModalContent,{children:[e.jsx(d.EmbeddedChat.FeedbackModalHeader,{}),e.jsx(d.EmbeddedChat.FeedbackModalClose,{}),e.jsx(d.EmbeddedChat.FeedbackModalBody,{children:e.jsxs(d.EmbeddedChat.FeedbackForm,{children:[e.jsxs(d.EmbeddedChat.FeedbackItem,{name:"unrelated_response",children:[e.jsx(d.EmbeddedChat.FeedbackItemCheckbox,{children:e.jsx(d.EmbeddedChat.FeedbackItemCheckboxIndicator,{})}),e.jsx(d.EmbeddedChat.FeedbackItemLabel,{}),e.jsx(d.EmbeddedChat.FeedbackItemDescription,{})]}),e.jsxs(d.EmbeddedChat.FeedbackItem,{name:"inaccurate_statement",children:[e.jsx(d.EmbeddedChat.FeedbackItemCheckbox,{children:e.jsx(d.EmbeddedChat.FeedbackItemCheckboxIndicator,{})}),e.jsx(d.EmbeddedChat.FeedbackItemLabel,{}),e.jsx(d.EmbeddedChat.FeedbackItemDescription,{})]}),e.jsxs(d.EmbeddedChat.FeedbackItem,{name:"inaccurate_code_snippet",children:[e.jsx(d.EmbeddedChat.FeedbackItemCheckbox,{children:e.jsx(d.EmbeddedChat.FeedbackItemCheckboxIndicator,{})}),e.jsx(d.EmbeddedChat.FeedbackItemLabel,{}),e.jsx(d.EmbeddedChat.FeedbackItemDescription,{})]}),e.jsxs(d.EmbeddedChat.FeedbackItem,{name:"irrelevant_citations",children:[e.jsx(d.EmbeddedChat.FeedbackItemCheckbox,{children:e.jsx(d.EmbeddedChat.FeedbackItemCheckboxIndicator,{})}),e.jsx(d.EmbeddedChat.FeedbackItemLabel,{})]}),e.jsx(d.EmbeddedChat.FeedbackSubmitButton,{})]})})]})})})})}function S(){return e.jsxs(d.EmbeddedChat.FormWrapper,{children:[e.jsx(d.EmbeddedChat.FormClose,{}),e.jsxs(d.EmbeddedChat.Form,{children:[e.jsxs(d.EmbeddedChat.FormHeader,{children:[e.jsx(d.EmbeddedChat.FormHeading,{}),e.jsx(d.EmbeddedChat.FormDescription,{})]}),e.jsx(d.EmbeddedChat.FormContent,{children:a=>e.jsxs(e.Fragment,{children:[a.map((t,s)=>e.jsxs(d.EmbeddedChat.FormField,{field:t,autoFocus:s===0,children:[e.jsx(d.EmbeddedChat.FormFieldLabel,{}),t.inputType==="text"&&e.jsx(d.EmbeddedChat.FormFieldText,{}),t.inputType==="email"&&e.jsx(d.EmbeddedChat.FormFieldEmail,{}),t.inputType==="file"&&e.jsx(d.EmbeddedChat.FormFieldFile,{}),t.inputType==="textarea"&&e.jsx(d.EmbeddedChat.FormFieldTextArea,{}),t.inputType==="checkbox"&&e.jsx(d.EmbeddedChat.FormFieldCheckbox,{children:e.jsx(d.EmbeddedChat.FormFieldCheckboxIndicator,{})}),t.inputType==="select"&&e.jsxs(d.EmbeddedChat.FormFieldSelect,{children:[e.jsxs(d.EmbeddedChat.FormFieldSelectTrigger,{children:[e.jsx(d.EmbeddedChat.FormFieldSelectValue,{}),e.jsx(d.EmbeddedChat.FormFieldSelectIcon,{})]}),e.jsx(d.EmbeddedChat.FormFieldSelectContent,{children:e.jsx(d.EmbeddedChat.FormFieldSelectViewport,{children:t.items.map(n=>e.jsxs(d.EmbeddedChat.FormFieldSelectItem,{value:n.value,children:[e.jsx(d.EmbeddedChat.FormFieldSelectItemText,{children:n.label}),e.jsx(d.EmbeddedChat.FormFieldSelectItemIndicator,{})]},n.value))})})]}),e.jsx(d.EmbeddedChat.FormFieldError,{})]},t.name)),e.jsx(d.EmbeddedChat.FormError,{})]})}),e.jsxs(d.EmbeddedChat.FormFooter,{children:[e.jsx(d.EmbeddedChat.FormCancel,{}),e.jsx(d.EmbeddedChat.FormSubmit,{})]})]}),e.jsxs(d.EmbeddedChat.FormSuccess,{children:[e.jsx(d.EmbeddedChat.FormSuccessHeading,{}),e.jsx(d.EmbeddedChat.FormSuccessMessage,{}),e.jsx(d.EmbeddedChat.FormSuccessButton,{})]})]})}exports.InkeepEmbeddedChat=x;exports.InkeepEmbeddedChatImpl=o;exports.InkeepEmbeddedChatImplContent=i;exports.InkeepEmbeddedChatProvider=c;
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("@inkeep/cxkit-styled"),h=require("react"),l=require("./widget-toggle.cjs"),C=require("./modal.cjs");function x(a){const{baseSettings:t,aiChatSettings:s}=a;return e.jsx(d.ErrorBoundary,{children:e.jsx(d.Shadow,{wrapperStyles:{height:"inherit",width:"inherit"},children:e.jsx(d.RootProvider,{config:{baseSettings:t,aiChatSettings:s},componentType:d.WebWidgetInteractionType.EmbeddedChat,children:e.jsx(c,{...a})})})})}function o(a){const{children:t,onToggleView:s,isHidden:n,shouldAutoFocusInput:r=!s}=a;return e.jsx(d.EmbeddedChat.Provider,{isHidden:n,shouldAutoFocusInput:r,children:t})}function c(a){return e.jsx(o,{...a,children:e.jsx(i,{...a})})}function i(a){const{onToggleView:t,variant:s,header:n=j}=a,r=d.useModal(),m=d.useWidget(),b=r&&!m?C.ModalContent:h.Fragment;return e.jsx(b,{children:e.jsxs(d.EmbeddedChat.Wrapper,{variant:s??(t?"no-shadow":"container-with-shadow"),"data-composite":d.dataAttr(!!a.onToggleView||r?.isOpen),children:[e.jsx(d.EmbeddedChat.ConversationLoading,{}),e.jsxs(d.EmbeddedChat.Root,{children:[e.jsx(n,{...a}),e.jsx(E,{}),e.jsx(M,{})]}),e.jsx(B,{}),e.jsx(S,{})]})})}function j(a){const{onToggleView:t,askAILabel:s,searchLabel:n}=a,r=!!t;return e.jsx(d.EmbeddedChat.Header,{"data-show-toolbar":d.dataAttr(r),children:r?e.jsxs(d.EmbeddedChat.HeaderToolbar,{children:[e.jsxs(d.EmbeddedChat.HeaderToolbarWrapper,{children:[e.jsx(d.EmbeddedChat.ToolbarHeader,{}),e.jsxs(d.EmbeddedChat.Disclaimer,{children:[e.jsx(d.EmbeddedChat.DisclaimerTrigger,{}),e.jsxs(d.EmbeddedChat.DisclaimerContent,{side:"bottom",align:"start",children:[e.jsx(d.EmbeddedChat.DisclaimerText,{}),e.jsx(d.EmbeddedChat.DisclaimerArrow,{})]})]})]}),e.jsx(l.WidgetToggle,{onToggleView:t,askAILabel:s,searchLabel:n,view:"chat"}),e.jsx(d.Modal.Close,{})]}):e.jsx(d.Modal.Close,{})})}function E(){return e.jsx(d.EmbeddedChat.Content,{children:e.jsxs(d.EmbeddedChat.ContentScrollArea,{children:[e.jsx(d.EmbeddedChat.ContentScrollAreaViewport,{children:e.jsx(F,{})}),e.jsx(d.EmbeddedChat.ContentScrollAreaScrollbar,{children:e.jsx(d.EmbeddedChat.ContentScrollAreaThumb,{})}),e.jsx(d.EmbeddedChat.ContentScrollAreaCorner,{})]})})}function F(){return e.jsx(d.EmbeddedChat.Messages,{children:({messages:a})=>e.jsxs(e.Fragment,{children:[e.jsx(u,{}),a.map(t=>e.jsxs(d.EmbeddedChat.MessageWrapper,{message:t,children:[e.jsx(g,{}),e.jsx(d.EmbeddedChat.MessageLoading,{}),e.jsxs(d.EmbeddedChat.MessageContentWrapper,{children:[e.jsx(d.EmbeddedChat.MessageContent,{children:e.jsx(d.EmbeddedChat.Message,{})}),e.jsx(p,{}),e.jsx(A,{}),e.jsx(I,{})]})]},t.id))]})})}function u(){return e.jsxs(d.EmbeddedChat.IntroMessageWrapper,{children:[e.jsxs(d.EmbeddedChat.MessageHeader,{children:[e.jsx(d.EmbeddedChat.MessageAvatar,{children:e.jsxs(d.EmbeddedChat.MessageAvatarContent,{children:[e.jsx(d.EmbeddedChat.MessageAvatarFallback,{}),e.jsx(d.EmbeddedChat.MessageAvatarImage,{})]})}),e.jsx(d.EmbeddedChat.MessageName,{})]}),e.jsxs(d.EmbeddedChat.MessageContentWrapper,{children:[e.jsx(d.EmbeddedChat.MessageContent,{children:e.jsx(d.EmbeddedChat.Message,{})}),e.jsxs(d.EmbeddedChat.Disclaimer,{children:[e.jsx(d.EmbeddedChat.DisclaimerLabel,{}),e.jsx(d.EmbeddedChat.DisclaimerTrigger,{}),e.jsxs(d.EmbeddedChat.DisclaimerContent,{children:[e.jsx(d.EmbeddedChat.DisclaimerText,{}),e.jsx(d.EmbeddedChat.DisclaimerArrow,{})]})]}),e.jsxs(d.EmbeddedChat.ExampleQuestions,{children:[e.jsx(d.EmbeddedChat.ExampleQuestionsLabel,{}),e.jsx(d.EmbeddedChat.ExampleQuestionsList,{children:a=>a.map(t=>e.jsx(d.EmbeddedChat.ExampleQuestion,{children:e.jsx(d.EmbeddedChat.ExampleQuestionButton,{question:t})},t))})]})]})]})}function g(){return e.jsxs(d.EmbeddedChat.MessageHeader,{children:[e.jsx(d.EmbeddedChat.MessageAvatar,{children:e.jsxs(d.EmbeddedChat.MessageAvatarContent,{children:[e.jsx(d.EmbeddedChat.MessageAvatarFallback,{}),e.jsx(d.EmbeddedChat.MessageAvatarImage,{})]})}),e.jsx(d.EmbeddedChat.MessageName,{})]})}function p(){return e.jsxs(d.EmbeddedChat.MessageAttachments,{children:[e.jsx(d.EmbeddedChat.MessageAttachmentsList,{children:a=>a.map(t=>e.jsxs(d.EmbeddedChat.MessageAttachmentsItem,{attachment:t,children:[e.jsx(d.EmbeddedChat.MessageAttachmentsItemIcon,{}),e.jsx(d.EmbeddedChat.MessageAttachmentsItemTitle,{})]},t.id))}),e.jsx(d.EmbeddedChat.MessageAttachmentsPreview,{children:e.jsx(d.PortalWithTheme,{children:e.jsx(d.EmbeddedChat.MessageAttachmentsPreviewOverlay,{children:e.jsxs(d.EmbeddedChat.MessageAttachmentsPreviewContent,{children:[e.jsx(d.EmbeddedChat.MessageAttachmentsPreviewHeader,{}),e.jsx(d.EmbeddedChat.MessageAttachmentsPreviewClose,{}),e.jsx(d.EmbeddedChat.MessageAttachmentsPreviewBody,{})]})})})})]})}function A(){return e.jsxs(d.EmbeddedChat.MessageToolbar,{children:[e.jsx(d.EmbeddedChat.MessageToolActions,{children:a=>a.map((t,s)=>e.jsx(d.EmbeddedChat.MessageToolAction,{action:t},`action-${s}`))}),e.jsx(d.EmbeddedChat.MessageAction,{action:"copy"}),e.jsx(d.EmbeddedChat.MessageAction,{action:"upvote"}),e.jsx(d.EmbeddedChat.MessageAction,{action:"downvote"})]})}function I(){return e.jsxs(d.EmbeddedChat.MessageSources,{children:[e.jsx(d.EmbeddedChat.MessageSourcesHeader,{}),e.jsx(d.EmbeddedChat.MessageSourcesList,{children:a=>a.map((t,s)=>e.jsxs(d.EmbeddedChat.MessageSourceItem,{href:t.url,source:t,children:[e.jsx(d.EmbeddedChat.MessageSourceItemBreadcrumbs,{children:t.breadcrumbs?.map(n=>e.jsxs(h.Fragment,{children:[n,e.jsx(d.EmbeddedChat.MessageSourceItemBreadcrumbIcon,{})]},n))}),e.jsx(d.EmbeddedChat.MessageSourceItemIcon,{}),e.jsx(d.EmbeddedChat.MessageSourceItemTitle,{}),e.jsx(d.EmbeddedChat.MessageSourceItemTag,{}),e.jsx(d.EmbeddedChat.MessageSourceItemDescription,{children:n=>n.map((r,m)=>e.jsx(d.EmbeddedChat.MessageSourceItemDescriptionPart,{part:r},`part-${m}`))}),e.jsx(d.EmbeddedChat.MessageSourceItemIndicator,{})]},s))})]})}function M(){return e.jsxs(d.EmbeddedChat.Footer,{children:[e.jsx(T,{}),e.jsx(k,{})]})}function T(){return e.jsxs(d.EmbeddedChat.InputFieldset,{children:[e.jsxs(d.EmbeddedChat.InputGroup,{children:[e.jsx(d.EmbeddedChat.Input,{}),e.jsx(d.EmbeddedChat.SendButton,{children:e.jsx(d.EmbeddedChat.SendButtonIcon,{})})]}),e.jsxs(d.EmbeddedChat.AttachmentsBar,{children:[e.jsx(d.EmbeddedChat.AttachmentsBarList,{children:a=>a.map(t=>e.jsxs(d.EmbeddedChat.AttachmentsBarAttachment,{attachment:t,children:[e.jsx(d.EmbeddedChat.AttachmentsBarAttachmentIcon,{}),e.jsx(d.EmbeddedChat.AttachmentsBarAttachmentTitle,{}),e.jsx(d.EmbeddedChat.AttachmentsBarAttachmentDelete,{})]},t.id))}),e.jsxs(d.EmbeddedChat.AttachmentsBarActions,{children:[e.jsxs(d.EmbeddedChat.AttachmentsBarInfoTip,{children:[e.jsx(d.EmbeddedChat.AttachmentsBarInfoTipIcon,{}),e.jsx(d.EmbeddedChat.AttachmentsBarInfoTipText,{})]}),e.jsx(d.EmbeddedChat.AttachmentsBarInputs,{children:a=>a.map(t=>e.jsx(d.EmbeddedChat.AttachmentsBarInput,{input:t,children:t.displayName},t.id))})]}),e.jsx(d.PortalWithTheme,{children:e.jsx(d.EmbeddedChat.AttachmentsBarModal,{children:e.jsx(d.EmbeddedChat.AttachmentsBarModalOverlay,{children:e.jsxs(d.EmbeddedChat.AttachmentsBarModalContent,{children:[e.jsxs(d.EmbeddedChat.AttachmentsBarModalHeader,{children:[e.jsx(d.EmbeddedChat.AttachmentsBarModalHeading,{}),e.jsx(d.EmbeddedChat.AttachmentsBarModalDescription,{}),e.jsx(d.EmbeddedChat.AttachmentsBarModalHelp,{})]}),e.jsx(d.EmbeddedChat.AttachmentsBarModalClose,{}),e.jsx(d.EmbeddedChat.AttachmentsBarModalBody,{children:e.jsxs(d.EmbeddedChat.AttachmentsBarForm,{children:[e.jsxs(d.EmbeddedChat.AttachmentsBarFormTitle,{children:[e.jsx(d.EmbeddedChat.AttachmentsBarFormTitleLabel,{}),e.jsx(d.EmbeddedChat.AttachmentsBarFormTitleInput,{}),e.jsx(d.EmbeddedChat.AttachmentsBarFormTitleError,{})]}),e.jsxs(d.EmbeddedChat.AttachmentsBarFormContent,{children:[e.jsx(d.EmbeddedChat.AttachmentsBarFormContentLabel,{}),e.jsx(d.EmbeddedChat.AttachmentsBarFormContentInput,{}),e.jsx(d.EmbeddedChat.AttachmentsBarFormContentError,{})]}),e.jsx(d.EmbeddedChat.AttachmentsBarFormSubmitButton,{})]})})]})})})})]})]})}function k(){return e.jsxs(d.EmbeddedChat.ActionBar,{children:[e.jsxs(d.EmbeddedChat.TaglineContainer,{children:[e.jsx(d.EmbeddedChat.TaglineText,{}),e.jsx(d.EmbeddedChat.TaglineLogo,{}),e.jsx(d.EmbeddedChat.TaglineBrandName,{})]}),e.jsxs(d.EmbeddedChat.Actions,{children:[e.jsx(d.EmbeddedChat.HelpActions,{children:({pinned:a,unpinned:t})=>e.jsxs(e.Fragment,{children:[a.map(s=>e.jsx(d.EmbeddedChat.HelpAction,{action:s},s.name)),t.length>0&&e.jsx(d.EmbeddedChat.HelpActionsTrigger,{}),e.jsxs(d.EmbeddedChat.HelpActionsMenu,{children:[e.jsx(d.EmbeddedChat.HelpActionsMenuArrow,{}),t.map(s=>e.jsxs(d.EmbeddedChat.HelpActionsMenuItem,{action:s,children:[e.jsx(d.EmbeddedChat.HelpActionsMenuItemIcon,{action:s}),s.name]},s.name))]})]})}),e.jsxs(d.EmbeddedChat.ChatAction,{action:"copy",children:[e.jsx(d.EmbeddedChat.ChatActionLabel,{action:"copy"}),e.jsx(d.EmbeddedChat.ChatActionFeedback,{action:"copy"})]}),e.jsxs(d.EmbeddedChat.ChatAction,{action:"share",children:[e.jsx(d.EmbeddedChat.ChatActionLabel,{action:"share"}),e.jsx(d.EmbeddedChat.ChatActionFeedback,{action:"share"})]}),e.jsx(d.EmbeddedChat.ChatAction,{action:"clear"}),e.jsx(d.EmbeddedChat.ChatAction,{action:"stop"})]})]})}function B(){return e.jsx(d.PortalWithTheme,{children:e.jsx(d.EmbeddedChat.FeedbackModal,{children:e.jsx(d.EmbeddedChat.FeedbackModalOverlay,{children:e.jsxs(d.EmbeddedChat.FeedbackModalContent,{children:[e.jsx(d.EmbeddedChat.FeedbackModalHeader,{}),e.jsx(d.EmbeddedChat.FeedbackModalClose,{}),e.jsx(d.EmbeddedChat.FeedbackModalBody,{children:e.jsxs(d.EmbeddedChat.FeedbackForm,{children:[e.jsxs(d.EmbeddedChat.FeedbackItem,{name:"unrelated_response",children:[e.jsx(d.EmbeddedChat.FeedbackItemCheckbox,{children:e.jsx(d.EmbeddedChat.FeedbackItemCheckboxIndicator,{})}),e.jsx(d.EmbeddedChat.FeedbackItemLabel,{}),e.jsx(d.EmbeddedChat.FeedbackItemDescription,{})]}),e.jsxs(d.EmbeddedChat.FeedbackItem,{name:"inaccurate_statement",children:[e.jsx(d.EmbeddedChat.FeedbackItemCheckbox,{children:e.jsx(d.EmbeddedChat.FeedbackItemCheckboxIndicator,{})}),e.jsx(d.EmbeddedChat.FeedbackItemLabel,{}),e.jsx(d.EmbeddedChat.FeedbackItemDescription,{})]}),e.jsxs(d.EmbeddedChat.FeedbackItem,{name:"inaccurate_code_snippet",children:[e.jsx(d.EmbeddedChat.FeedbackItemCheckbox,{children:e.jsx(d.EmbeddedChat.FeedbackItemCheckboxIndicator,{})}),e.jsx(d.EmbeddedChat.FeedbackItemLabel,{}),e.jsx(d.EmbeddedChat.FeedbackItemDescription,{})]}),e.jsxs(d.EmbeddedChat.FeedbackItem,{name:"irrelevant_citations",children:[e.jsx(d.EmbeddedChat.FeedbackItemCheckbox,{children:e.jsx(d.EmbeddedChat.FeedbackItemCheckboxIndicator,{})}),e.jsx(d.EmbeddedChat.FeedbackItemLabel,{})]}),e.jsx(d.EmbeddedChat.FeedbackSubmitButton,{})]})})]})})})})}function S(){return e.jsxs(d.EmbeddedChat.FormWrapper,{children:[e.jsx(d.EmbeddedChat.FormClose,{}),e.jsxs(d.EmbeddedChat.Form,{children:[e.jsxs(d.EmbeddedChat.FormHeader,{children:[e.jsx(d.EmbeddedChat.FormHeading,{}),e.jsx(d.EmbeddedChat.FormDescription,{})]}),e.jsx(d.EmbeddedChat.FormContent,{children:a=>e.jsxs(e.Fragment,{children:[a.map((t,s)=>e.jsxs(d.EmbeddedChat.FormField,{field:t,autoFocus:s===0,children:[e.jsx(d.EmbeddedChat.FormFieldLabel,{}),t.inputType==="text"&&e.jsx(d.EmbeddedChat.FormFieldText,{}),t.inputType==="email"&&e.jsx(d.EmbeddedChat.FormFieldEmail,{}),t.inputType==="file"&&e.jsx(d.EmbeddedChat.FormFieldFile,{}),t.inputType==="textarea"&&e.jsx(d.EmbeddedChat.FormFieldTextArea,{}),t.inputType==="checkbox"&&e.jsx(d.EmbeddedChat.FormFieldCheckbox,{children:e.jsx(d.EmbeddedChat.FormFieldCheckboxIndicator,{})}),t.inputType==="select"&&e.jsxs(d.EmbeddedChat.FormFieldSelect,{children:[e.jsxs(d.EmbeddedChat.FormFieldSelectTrigger,{children:[e.jsx(d.EmbeddedChat.FormFieldSelectValue,{}),e.jsx(d.EmbeddedChat.FormFieldSelectIcon,{})]}),e.jsx(d.EmbeddedChat.FormFieldSelectContent,{children:e.jsx(d.EmbeddedChat.FormFieldSelectViewport,{children:t.items.map(n=>e.jsxs(d.EmbeddedChat.FormFieldSelectItem,{value:n.value,children:[e.jsx(d.EmbeddedChat.FormFieldSelectItemText,{children:n.label}),e.jsx(d.EmbeddedChat.FormFieldSelectItemIndicator,{})]},n.value))})})]}),t.inputType==="combobox"&&e.jsxs(d.EmbeddedChat.FormFieldCombobox,{children:[e.jsxs(d.EmbeddedChat.FormFieldComboboxControl,{children:[t.multiple&&e.jsx(d.EmbeddedChat.FormFieldComboboxSelectedTags,{}),e.jsx(d.EmbeddedChat.FormFieldComboboxInput,{}),e.jsx(d.EmbeddedChat.FormFieldComboboxTrigger,{})]}),e.jsx(d.EmbeddedChat.FormFieldComboboxPositioner,{children:e.jsx(d.EmbeddedChat.FormFieldComboboxContent,{children:e.jsx(d.EmbeddedChat.FormFieldComboboxItemList,{})})})]}),e.jsx(d.EmbeddedChat.FormFieldError,{})]},t.name)),e.jsx(d.EmbeddedChat.FormError,{})]})}),e.jsxs(d.EmbeddedChat.FormFooter,{children:[e.jsx(d.EmbeddedChat.FormCancel,{}),e.jsx(d.EmbeddedChat.FormSubmit,{})]})]}),e.jsxs(d.EmbeddedChat.FormSuccess,{children:[e.jsx(d.EmbeddedChat.FormSuccessHeading,{}),e.jsx(d.EmbeddedChat.FormSuccessMessage,{}),e.jsx(d.EmbeddedChat.FormSuccessButton,{})]})]})}exports.InkeepEmbeddedChat=x;exports.InkeepEmbeddedChatImpl=c;exports.InkeepEmbeddedChatImplContent=i;exports.InkeepEmbeddedChatProvider=o;
|
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as t, jsxs as
|
|
3
|
-
import { ErrorBoundary as u, Shadow as
|
|
2
|
+
import { jsx as t, jsxs as r, Fragment as d } from "react/jsx-runtime";
|
|
3
|
+
import { ErrorBoundary as u, Shadow as p, RootProvider as g, WebWidgetInteractionType as b, EmbeddedChat as e, useModal as A, useWidget as M, dataAttr as h, Modal as m, PortalWithTheme as s } from "@inkeep/cxkit-styled";
|
|
4
4
|
import { Fragment as F } from "react";
|
|
5
5
|
import { WidgetToggle as I } from "./widget-toggle.js";
|
|
6
6
|
import { ModalContent as C } from "./modal.js";
|
|
7
7
|
function R(a) {
|
|
8
|
-
const { baseSettings:
|
|
8
|
+
const { baseSettings: n, aiChatSettings: o } = a;
|
|
9
9
|
return /* @__PURE__ */ t(u, { children: /* @__PURE__ */ t(
|
|
10
|
-
|
|
10
|
+
p,
|
|
11
11
|
{
|
|
12
12
|
wrapperStyles: {
|
|
13
13
|
height: "inherit",
|
|
14
14
|
width: "inherit"
|
|
15
15
|
},
|
|
16
16
|
children: /* @__PURE__ */ t(
|
|
17
|
-
|
|
17
|
+
g,
|
|
18
18
|
{
|
|
19
19
|
config: {
|
|
20
|
-
baseSettings:
|
|
21
|
-
aiChatSettings:
|
|
20
|
+
baseSettings: n,
|
|
21
|
+
aiChatSettings: o
|
|
22
22
|
},
|
|
23
|
-
componentType:
|
|
24
|
-
children: /* @__PURE__ */ t(
|
|
23
|
+
componentType: b.EmbeddedChat,
|
|
24
|
+
children: /* @__PURE__ */ t(k, { ...a })
|
|
25
25
|
}
|
|
26
26
|
)
|
|
27
27
|
}
|
|
28
28
|
) });
|
|
29
29
|
}
|
|
30
|
-
function k(a) {
|
|
31
|
-
const { children: r, onToggleView: c, isHidden: o, shouldAutoFocusInput: i = !c } = a;
|
|
32
|
-
return /* @__PURE__ */ t(e.Provider, { isHidden: o, shouldAutoFocusInput: i, children: r });
|
|
33
|
-
}
|
|
34
30
|
function T(a) {
|
|
35
|
-
|
|
31
|
+
const { children: n, onToggleView: o, isHidden: c, shouldAutoFocusInput: i = !o } = a;
|
|
32
|
+
return /* @__PURE__ */ t(e.Provider, { isHidden: c, shouldAutoFocusInput: i, children: n });
|
|
33
|
+
}
|
|
34
|
+
function k(a) {
|
|
35
|
+
return /* @__PURE__ */ t(T, { ...a, children: /* @__PURE__ */ t(B, { ...a }) });
|
|
36
36
|
}
|
|
37
37
|
function B(a) {
|
|
38
|
-
const { onToggleView:
|
|
39
|
-
return /* @__PURE__ */ t(i && !l ? C : F, { children: /* @__PURE__ */
|
|
38
|
+
const { onToggleView: n, variant: o, header: c = S } = a, i = A(), l = M();
|
|
39
|
+
return /* @__PURE__ */ t(i && !l ? C : F, { children: /* @__PURE__ */ r(
|
|
40
40
|
e.Wrapper,
|
|
41
41
|
{
|
|
42
|
-
variant:
|
|
43
|
-
"data-composite":
|
|
42
|
+
variant: o ?? (n ? "no-shadow" : "container-with-shadow"),
|
|
43
|
+
"data-composite": h(!!a.onToggleView || i?.isOpen),
|
|
44
44
|
children: [
|
|
45
45
|
/* @__PURE__ */ t(e.ConversationLoading, {}),
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
-
/* @__PURE__ */ t(
|
|
48
|
-
/* @__PURE__ */ t(
|
|
49
|
-
/* @__PURE__ */ t(
|
|
46
|
+
/* @__PURE__ */ r(e.Root, { children: [
|
|
47
|
+
/* @__PURE__ */ t(c, { ...a }),
|
|
48
|
+
/* @__PURE__ */ t(x, {}),
|
|
49
|
+
/* @__PURE__ */ t(f, {})
|
|
50
50
|
] }),
|
|
51
51
|
/* @__PURE__ */ t(P, {}),
|
|
52
52
|
/* @__PURE__ */ t(V, {})
|
|
@@ -55,13 +55,13 @@ function B(a) {
|
|
|
55
55
|
) });
|
|
56
56
|
}
|
|
57
57
|
function S(a) {
|
|
58
|
-
const { onToggleView:
|
|
59
|
-
return /* @__PURE__ */ t(e.Header, { "data-show-toolbar":
|
|
60
|
-
/* @__PURE__ */
|
|
58
|
+
const { onToggleView: n, askAILabel: o, searchLabel: c } = a, i = !!n;
|
|
59
|
+
return /* @__PURE__ */ t(e.Header, { "data-show-toolbar": h(i), children: i ? /* @__PURE__ */ r(e.HeaderToolbar, { children: [
|
|
60
|
+
/* @__PURE__ */ r(e.HeaderToolbarWrapper, { children: [
|
|
61
61
|
/* @__PURE__ */ t(e.ToolbarHeader, {}),
|
|
62
|
-
/* @__PURE__ */
|
|
62
|
+
/* @__PURE__ */ r(e.Disclaimer, { children: [
|
|
63
63
|
/* @__PURE__ */ t(e.DisclaimerTrigger, {}),
|
|
64
|
-
/* @__PURE__ */
|
|
64
|
+
/* @__PURE__ */ r(e.DisclaimerContent, { side: "bottom", align: "start", children: [
|
|
65
65
|
/* @__PURE__ */ t(e.DisclaimerText, {}),
|
|
66
66
|
/* @__PURE__ */ t(e.DisclaimerArrow, {})
|
|
67
67
|
] })
|
|
@@ -70,66 +70,66 @@ function S(a) {
|
|
|
70
70
|
/* @__PURE__ */ t(
|
|
71
71
|
I,
|
|
72
72
|
{
|
|
73
|
-
onToggleView:
|
|
74
|
-
askAILabel:
|
|
75
|
-
searchLabel:
|
|
73
|
+
onToggleView: n,
|
|
74
|
+
askAILabel: o,
|
|
75
|
+
searchLabel: c,
|
|
76
76
|
view: "chat"
|
|
77
77
|
}
|
|
78
78
|
),
|
|
79
|
-
/* @__PURE__ */ t(
|
|
80
|
-
] }) : /* @__PURE__ */ t(
|
|
79
|
+
/* @__PURE__ */ t(m.Close, {})
|
|
80
|
+
] }) : /* @__PURE__ */ t(m.Close, {}) });
|
|
81
81
|
}
|
|
82
|
-
function
|
|
83
|
-
return /* @__PURE__ */ t(e.Content, { children: /* @__PURE__ */
|
|
84
|
-
/* @__PURE__ */ t(e.ContentScrollAreaViewport, { children: /* @__PURE__ */ t(
|
|
82
|
+
function x() {
|
|
83
|
+
return /* @__PURE__ */ t(e.Content, { children: /* @__PURE__ */ r(e.ContentScrollArea, { children: [
|
|
84
|
+
/* @__PURE__ */ t(e.ContentScrollAreaViewport, { children: /* @__PURE__ */ t(v, {}) }),
|
|
85
85
|
/* @__PURE__ */ t(e.ContentScrollAreaScrollbar, { children: /* @__PURE__ */ t(e.ContentScrollAreaThumb, {}) }),
|
|
86
86
|
/* @__PURE__ */ t(e.ContentScrollAreaCorner, {})
|
|
87
87
|
] }) });
|
|
88
88
|
}
|
|
89
|
-
function
|
|
90
|
-
return /* @__PURE__ */ t(e.Messages, { children: ({ messages: a }) => /* @__PURE__ */
|
|
89
|
+
function v() {
|
|
90
|
+
return /* @__PURE__ */ t(e.Messages, { children: ({ messages: a }) => /* @__PURE__ */ r(d, { children: [
|
|
91
91
|
/* @__PURE__ */ t(w, {}),
|
|
92
|
-
a.map((
|
|
92
|
+
a.map((n) => /* @__PURE__ */ r(e.MessageWrapper, { message: n, children: [
|
|
93
93
|
/* @__PURE__ */ t(H, {}),
|
|
94
94
|
/* @__PURE__ */ t(e.MessageLoading, {}),
|
|
95
|
-
/* @__PURE__ */
|
|
95
|
+
/* @__PURE__ */ r(e.MessageContentWrapper, { children: [
|
|
96
96
|
/* @__PURE__ */ t(e.MessageContent, { children: /* @__PURE__ */ t(e.Message, {}) }),
|
|
97
97
|
/* @__PURE__ */ t(y, {}),
|
|
98
|
-
/* @__PURE__ */ t(
|
|
99
|
-
/* @__PURE__ */ t(
|
|
98
|
+
/* @__PURE__ */ t(L, {}),
|
|
99
|
+
/* @__PURE__ */ t(D, {})
|
|
100
100
|
] })
|
|
101
|
-
] },
|
|
101
|
+
] }, n.id))
|
|
102
102
|
] }) });
|
|
103
103
|
}
|
|
104
104
|
function w() {
|
|
105
|
-
return /* @__PURE__ */
|
|
106
|
-
/* @__PURE__ */
|
|
107
|
-
/* @__PURE__ */ t(e.MessageAvatar, { children: /* @__PURE__ */
|
|
105
|
+
return /* @__PURE__ */ r(e.IntroMessageWrapper, { children: [
|
|
106
|
+
/* @__PURE__ */ r(e.MessageHeader, { children: [
|
|
107
|
+
/* @__PURE__ */ t(e.MessageAvatar, { children: /* @__PURE__ */ r(e.MessageAvatarContent, { children: [
|
|
108
108
|
/* @__PURE__ */ t(e.MessageAvatarFallback, {}),
|
|
109
109
|
/* @__PURE__ */ t(e.MessageAvatarImage, {})
|
|
110
110
|
] }) }),
|
|
111
111
|
/* @__PURE__ */ t(e.MessageName, {})
|
|
112
112
|
] }),
|
|
113
|
-
/* @__PURE__ */
|
|
113
|
+
/* @__PURE__ */ r(e.MessageContentWrapper, { children: [
|
|
114
114
|
/* @__PURE__ */ t(e.MessageContent, { children: /* @__PURE__ */ t(e.Message, {}) }),
|
|
115
|
-
/* @__PURE__ */
|
|
115
|
+
/* @__PURE__ */ r(e.Disclaimer, { children: [
|
|
116
116
|
/* @__PURE__ */ t(e.DisclaimerLabel, {}),
|
|
117
117
|
/* @__PURE__ */ t(e.DisclaimerTrigger, {}),
|
|
118
|
-
/* @__PURE__ */
|
|
118
|
+
/* @__PURE__ */ r(e.DisclaimerContent, { children: [
|
|
119
119
|
/* @__PURE__ */ t(e.DisclaimerText, {}),
|
|
120
120
|
/* @__PURE__ */ t(e.DisclaimerArrow, {})
|
|
121
121
|
] })
|
|
122
122
|
] }),
|
|
123
|
-
/* @__PURE__ */
|
|
123
|
+
/* @__PURE__ */ r(e.ExampleQuestions, { children: [
|
|
124
124
|
/* @__PURE__ */ t(e.ExampleQuestionsLabel, {}),
|
|
125
|
-
/* @__PURE__ */ t(e.ExampleQuestionsList, { children: (a) => a.map((
|
|
125
|
+
/* @__PURE__ */ t(e.ExampleQuestionsList, { children: (a) => a.map((n) => /* @__PURE__ */ t(e.ExampleQuestion, { children: /* @__PURE__ */ t(e.ExampleQuestionButton, { question: n }) }, n)) })
|
|
126
126
|
] })
|
|
127
127
|
] })
|
|
128
128
|
] });
|
|
129
129
|
}
|
|
130
130
|
function H() {
|
|
131
|
-
return /* @__PURE__ */
|
|
132
|
-
/* @__PURE__ */ t(e.MessageAvatar, { children: /* @__PURE__ */
|
|
131
|
+
return /* @__PURE__ */ r(e.MessageHeader, { children: [
|
|
132
|
+
/* @__PURE__ */ t(e.MessageAvatar, { children: /* @__PURE__ */ r(e.MessageAvatarContent, { children: [
|
|
133
133
|
/* @__PURE__ */ t(e.MessageAvatarFallback, {}),
|
|
134
134
|
/* @__PURE__ */ t(e.MessageAvatarImage, {})
|
|
135
135
|
] }) }),
|
|
@@ -137,38 +137,38 @@ function H() {
|
|
|
137
137
|
] });
|
|
138
138
|
}
|
|
139
139
|
function y() {
|
|
140
|
-
return /* @__PURE__ */
|
|
141
|
-
/* @__PURE__ */ t(e.MessageAttachmentsList, { children: (a) => a.map((
|
|
140
|
+
return /* @__PURE__ */ r(e.MessageAttachments, { children: [
|
|
141
|
+
/* @__PURE__ */ t(e.MessageAttachmentsList, { children: (a) => a.map((n) => /* @__PURE__ */ r(e.MessageAttachmentsItem, { attachment: n, children: [
|
|
142
142
|
/* @__PURE__ */ t(e.MessageAttachmentsItemIcon, {}),
|
|
143
143
|
/* @__PURE__ */ t(e.MessageAttachmentsItemTitle, {})
|
|
144
|
-
] },
|
|
145
|
-
/* @__PURE__ */ t(e.MessageAttachmentsPreview, { children: /* @__PURE__ */ t(
|
|
144
|
+
] }, n.id)) }),
|
|
145
|
+
/* @__PURE__ */ t(e.MessageAttachmentsPreview, { children: /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(e.MessageAttachmentsPreviewOverlay, { children: /* @__PURE__ */ r(e.MessageAttachmentsPreviewContent, { children: [
|
|
146
146
|
/* @__PURE__ */ t(e.MessageAttachmentsPreviewHeader, {}),
|
|
147
147
|
/* @__PURE__ */ t(e.MessageAttachmentsPreviewClose, {}),
|
|
148
148
|
/* @__PURE__ */ t(e.MessageAttachmentsPreviewBody, {})
|
|
149
149
|
] }) }) }) })
|
|
150
150
|
] });
|
|
151
151
|
}
|
|
152
|
-
function
|
|
153
|
-
return /* @__PURE__ */
|
|
154
|
-
/* @__PURE__ */ t(e.MessageToolActions, { children: (a) => a.map((
|
|
152
|
+
function L() {
|
|
153
|
+
return /* @__PURE__ */ r(e.MessageToolbar, { children: [
|
|
154
|
+
/* @__PURE__ */ t(e.MessageToolActions, { children: (a) => a.map((n, o) => /* @__PURE__ */ t(e.MessageToolAction, { action: n }, `action-${o}`)) }),
|
|
155
155
|
/* @__PURE__ */ t(e.MessageAction, { action: "copy" }),
|
|
156
156
|
/* @__PURE__ */ t(e.MessageAction, { action: "upvote" }),
|
|
157
157
|
/* @__PURE__ */ t(e.MessageAction, { action: "downvote" })
|
|
158
158
|
] });
|
|
159
159
|
}
|
|
160
|
-
function
|
|
161
|
-
return /* @__PURE__ */
|
|
160
|
+
function D() {
|
|
161
|
+
return /* @__PURE__ */ r(e.MessageSources, { children: [
|
|
162
162
|
/* @__PURE__ */ t(e.MessageSourcesHeader, {}),
|
|
163
|
-
/* @__PURE__ */ t(e.MessageSourcesList, { children: (a) => a.map((
|
|
164
|
-
/* @__PURE__ */ t(e.MessageSourceItemBreadcrumbs, { children:
|
|
165
|
-
|
|
163
|
+
/* @__PURE__ */ t(e.MessageSourcesList, { children: (a) => a.map((n, o) => /* @__PURE__ */ r(e.MessageSourceItem, { href: n.url, source: n, children: [
|
|
164
|
+
/* @__PURE__ */ t(e.MessageSourceItemBreadcrumbs, { children: n.breadcrumbs?.map((c) => /* @__PURE__ */ r(F, { children: [
|
|
165
|
+
c,
|
|
166
166
|
/* @__PURE__ */ t(e.MessageSourceItemBreadcrumbIcon, {})
|
|
167
|
-
] },
|
|
167
|
+
] }, c)) }),
|
|
168
168
|
/* @__PURE__ */ t(e.MessageSourceItemIcon, {}),
|
|
169
169
|
/* @__PURE__ */ t(e.MessageSourceItemTitle, {}),
|
|
170
170
|
/* @__PURE__ */ t(e.MessageSourceItemTag, {}),
|
|
171
|
-
/* @__PURE__ */ t(e.MessageSourceItemDescription, { children: (
|
|
171
|
+
/* @__PURE__ */ t(e.MessageSourceItemDescription, { children: (c) => c.map((i, l) => /* @__PURE__ */ t(
|
|
172
172
|
e.MessageSourceItemDescriptionPart,
|
|
173
173
|
{
|
|
174
174
|
part: i
|
|
@@ -176,48 +176,48 @@ function L() {
|
|
|
176
176
|
`part-${l}`
|
|
177
177
|
)) }),
|
|
178
178
|
/* @__PURE__ */ t(e.MessageSourceItemIndicator, {})
|
|
179
|
-
] },
|
|
179
|
+
] }, o)) })
|
|
180
180
|
] });
|
|
181
181
|
}
|
|
182
|
-
function
|
|
183
|
-
return /* @__PURE__ */
|
|
182
|
+
function f() {
|
|
183
|
+
return /* @__PURE__ */ r(e.Footer, { children: [
|
|
184
184
|
/* @__PURE__ */ t(E, {}),
|
|
185
185
|
/* @__PURE__ */ t(W, {})
|
|
186
186
|
] });
|
|
187
187
|
}
|
|
188
188
|
function E() {
|
|
189
|
-
return /* @__PURE__ */
|
|
190
|
-
/* @__PURE__ */
|
|
189
|
+
return /* @__PURE__ */ r(e.InputFieldset, { children: [
|
|
190
|
+
/* @__PURE__ */ r(e.InputGroup, { children: [
|
|
191
191
|
/* @__PURE__ */ t(e.Input, {}),
|
|
192
192
|
/* @__PURE__ */ t(e.SendButton, { children: /* @__PURE__ */ t(e.SendButtonIcon, {}) })
|
|
193
193
|
] }),
|
|
194
|
-
/* @__PURE__ */
|
|
195
|
-
/* @__PURE__ */ t(e.AttachmentsBarList, { children: (a) => a.map((
|
|
194
|
+
/* @__PURE__ */ r(e.AttachmentsBar, { children: [
|
|
195
|
+
/* @__PURE__ */ t(e.AttachmentsBarList, { children: (a) => a.map((n) => /* @__PURE__ */ r(e.AttachmentsBarAttachment, { attachment: n, children: [
|
|
196
196
|
/* @__PURE__ */ t(e.AttachmentsBarAttachmentIcon, {}),
|
|
197
197
|
/* @__PURE__ */ t(e.AttachmentsBarAttachmentTitle, {}),
|
|
198
198
|
/* @__PURE__ */ t(e.AttachmentsBarAttachmentDelete, {})
|
|
199
|
-
] },
|
|
200
|
-
/* @__PURE__ */
|
|
201
|
-
/* @__PURE__ */
|
|
199
|
+
] }, n.id)) }),
|
|
200
|
+
/* @__PURE__ */ r(e.AttachmentsBarActions, { children: [
|
|
201
|
+
/* @__PURE__ */ r(e.AttachmentsBarInfoTip, { children: [
|
|
202
202
|
/* @__PURE__ */ t(e.AttachmentsBarInfoTipIcon, {}),
|
|
203
203
|
/* @__PURE__ */ t(e.AttachmentsBarInfoTipText, {})
|
|
204
204
|
] }),
|
|
205
|
-
/* @__PURE__ */ t(e.AttachmentsBarInputs, { children: (a) => a.map((
|
|
205
|
+
/* @__PURE__ */ t(e.AttachmentsBarInputs, { children: (a) => a.map((n) => /* @__PURE__ */ t(e.AttachmentsBarInput, { input: n, children: n.displayName }, n.id)) })
|
|
206
206
|
] }),
|
|
207
|
-
/* @__PURE__ */ t(
|
|
208
|
-
/* @__PURE__ */
|
|
207
|
+
/* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(e.AttachmentsBarModal, { children: /* @__PURE__ */ t(e.AttachmentsBarModalOverlay, { children: /* @__PURE__ */ r(e.AttachmentsBarModalContent, { children: [
|
|
208
|
+
/* @__PURE__ */ r(e.AttachmentsBarModalHeader, { children: [
|
|
209
209
|
/* @__PURE__ */ t(e.AttachmentsBarModalHeading, {}),
|
|
210
210
|
/* @__PURE__ */ t(e.AttachmentsBarModalDescription, {}),
|
|
211
211
|
/* @__PURE__ */ t(e.AttachmentsBarModalHelp, {})
|
|
212
212
|
] }),
|
|
213
213
|
/* @__PURE__ */ t(e.AttachmentsBarModalClose, {}),
|
|
214
|
-
/* @__PURE__ */ t(e.AttachmentsBarModalBody, { children: /* @__PURE__ */
|
|
215
|
-
/* @__PURE__ */
|
|
214
|
+
/* @__PURE__ */ t(e.AttachmentsBarModalBody, { children: /* @__PURE__ */ r(e.AttachmentsBarForm, { children: [
|
|
215
|
+
/* @__PURE__ */ r(e.AttachmentsBarFormTitle, { children: [
|
|
216
216
|
/* @__PURE__ */ t(e.AttachmentsBarFormTitleLabel, {}),
|
|
217
217
|
/* @__PURE__ */ t(e.AttachmentsBarFormTitleInput, {}),
|
|
218
218
|
/* @__PURE__ */ t(e.AttachmentsBarFormTitleError, {})
|
|
219
219
|
] }),
|
|
220
|
-
/* @__PURE__ */
|
|
220
|
+
/* @__PURE__ */ r(e.AttachmentsBarFormContent, { children: [
|
|
221
221
|
/* @__PURE__ */ t(e.AttachmentsBarFormContentLabel, {}),
|
|
222
222
|
/* @__PURE__ */ t(e.AttachmentsBarFormContentInput, {}),
|
|
223
223
|
/* @__PURE__ */ t(e.AttachmentsBarFormContentError, {})
|
|
@@ -229,29 +229,29 @@ function E() {
|
|
|
229
229
|
] });
|
|
230
230
|
}
|
|
231
231
|
function W() {
|
|
232
|
-
return /* @__PURE__ */
|
|
233
|
-
/* @__PURE__ */
|
|
232
|
+
return /* @__PURE__ */ r(e.ActionBar, { children: [
|
|
233
|
+
/* @__PURE__ */ r(e.TaglineContainer, { children: [
|
|
234
234
|
/* @__PURE__ */ t(e.TaglineText, {}),
|
|
235
235
|
/* @__PURE__ */ t(e.TaglineLogo, {}),
|
|
236
236
|
/* @__PURE__ */ t(e.TaglineBrandName, {})
|
|
237
237
|
] }),
|
|
238
|
-
/* @__PURE__ */
|
|
239
|
-
/* @__PURE__ */ t(e.HelpActions, { children: ({ pinned: a, unpinned:
|
|
240
|
-
a.map((
|
|
241
|
-
|
|
242
|
-
/* @__PURE__ */
|
|
238
|
+
/* @__PURE__ */ r(e.Actions, { children: [
|
|
239
|
+
/* @__PURE__ */ t(e.HelpActions, { children: ({ pinned: a, unpinned: n }) => /* @__PURE__ */ r(d, { children: [
|
|
240
|
+
a.map((o) => /* @__PURE__ */ t(e.HelpAction, { action: o }, o.name)),
|
|
241
|
+
n.length > 0 && /* @__PURE__ */ t(e.HelpActionsTrigger, {}),
|
|
242
|
+
/* @__PURE__ */ r(e.HelpActionsMenu, { children: [
|
|
243
243
|
/* @__PURE__ */ t(e.HelpActionsMenuArrow, {}),
|
|
244
|
-
|
|
245
|
-
/* @__PURE__ */ t(e.HelpActionsMenuItemIcon, { action:
|
|
246
|
-
|
|
247
|
-
] },
|
|
244
|
+
n.map((o) => /* @__PURE__ */ r(e.HelpActionsMenuItem, { action: o, children: [
|
|
245
|
+
/* @__PURE__ */ t(e.HelpActionsMenuItemIcon, { action: o }),
|
|
246
|
+
o.name
|
|
247
|
+
] }, o.name))
|
|
248
248
|
] })
|
|
249
249
|
] }) }),
|
|
250
|
-
/* @__PURE__ */
|
|
250
|
+
/* @__PURE__ */ r(e.ChatAction, { action: "copy", children: [
|
|
251
251
|
/* @__PURE__ */ t(e.ChatActionLabel, { action: "copy" }),
|
|
252
252
|
/* @__PURE__ */ t(e.ChatActionFeedback, { action: "copy" })
|
|
253
253
|
] }),
|
|
254
|
-
/* @__PURE__ */
|
|
254
|
+
/* @__PURE__ */ r(e.ChatAction, { action: "share", children: [
|
|
255
255
|
/* @__PURE__ */ t(e.ChatActionLabel, { action: "share" }),
|
|
256
256
|
/* @__PURE__ */ t(e.ChatActionFeedback, { action: "share" })
|
|
257
257
|
] }),
|
|
@@ -261,26 +261,26 @@ function W() {
|
|
|
261
261
|
] });
|
|
262
262
|
}
|
|
263
263
|
function P() {
|
|
264
|
-
return /* @__PURE__ */ t(
|
|
264
|
+
return /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(e.FeedbackModal, { children: /* @__PURE__ */ t(e.FeedbackModalOverlay, { children: /* @__PURE__ */ r(e.FeedbackModalContent, { children: [
|
|
265
265
|
/* @__PURE__ */ t(e.FeedbackModalHeader, {}),
|
|
266
266
|
/* @__PURE__ */ t(e.FeedbackModalClose, {}),
|
|
267
|
-
/* @__PURE__ */ t(e.FeedbackModalBody, { children: /* @__PURE__ */
|
|
268
|
-
/* @__PURE__ */
|
|
267
|
+
/* @__PURE__ */ t(e.FeedbackModalBody, { children: /* @__PURE__ */ r(e.FeedbackForm, { children: [
|
|
268
|
+
/* @__PURE__ */ r(e.FeedbackItem, { name: "unrelated_response", children: [
|
|
269
269
|
/* @__PURE__ */ t(e.FeedbackItemCheckbox, { children: /* @__PURE__ */ t(e.FeedbackItemCheckboxIndicator, {}) }),
|
|
270
270
|
/* @__PURE__ */ t(e.FeedbackItemLabel, {}),
|
|
271
271
|
/* @__PURE__ */ t(e.FeedbackItemDescription, {})
|
|
272
272
|
] }),
|
|
273
|
-
/* @__PURE__ */
|
|
273
|
+
/* @__PURE__ */ r(e.FeedbackItem, { name: "inaccurate_statement", children: [
|
|
274
274
|
/* @__PURE__ */ t(e.FeedbackItemCheckbox, { children: /* @__PURE__ */ t(e.FeedbackItemCheckboxIndicator, {}) }),
|
|
275
275
|
/* @__PURE__ */ t(e.FeedbackItemLabel, {}),
|
|
276
276
|
/* @__PURE__ */ t(e.FeedbackItemDescription, {})
|
|
277
277
|
] }),
|
|
278
|
-
/* @__PURE__ */
|
|
278
|
+
/* @__PURE__ */ r(e.FeedbackItem, { name: "inaccurate_code_snippet", children: [
|
|
279
279
|
/* @__PURE__ */ t(e.FeedbackItemCheckbox, { children: /* @__PURE__ */ t(e.FeedbackItemCheckboxIndicator, {}) }),
|
|
280
280
|
/* @__PURE__ */ t(e.FeedbackItemLabel, {}),
|
|
281
281
|
/* @__PURE__ */ t(e.FeedbackItemDescription, {})
|
|
282
282
|
] }),
|
|
283
|
-
/* @__PURE__ */
|
|
283
|
+
/* @__PURE__ */ r(e.FeedbackItem, { name: "irrelevant_citations", children: [
|
|
284
284
|
/* @__PURE__ */ t(e.FeedbackItemCheckbox, { children: /* @__PURE__ */ t(e.FeedbackItemCheckboxIndicator, {}) }),
|
|
285
285
|
/* @__PURE__ */ t(e.FeedbackItemLabel, {})
|
|
286
286
|
] }),
|
|
@@ -289,41 +289,49 @@ function P() {
|
|
|
289
289
|
] }) }) }) });
|
|
290
290
|
}
|
|
291
291
|
function V() {
|
|
292
|
-
return /* @__PURE__ */
|
|
292
|
+
return /* @__PURE__ */ r(e.FormWrapper, { children: [
|
|
293
293
|
/* @__PURE__ */ t(e.FormClose, {}),
|
|
294
|
-
/* @__PURE__ */
|
|
295
|
-
/* @__PURE__ */
|
|
294
|
+
/* @__PURE__ */ r(e.Form, { children: [
|
|
295
|
+
/* @__PURE__ */ r(e.FormHeader, { children: [
|
|
296
296
|
/* @__PURE__ */ t(e.FormHeading, {}),
|
|
297
297
|
/* @__PURE__ */ t(e.FormDescription, {})
|
|
298
298
|
] }),
|
|
299
|
-
/* @__PURE__ */ t(e.FormContent, { children: (a) => /* @__PURE__ */
|
|
300
|
-
a.map((
|
|
299
|
+
/* @__PURE__ */ t(e.FormContent, { children: (a) => /* @__PURE__ */ r(d, { children: [
|
|
300
|
+
a.map((n, o) => /* @__PURE__ */ r(e.FormField, { field: n, autoFocus: o === 0, children: [
|
|
301
301
|
/* @__PURE__ */ t(e.FormFieldLabel, {}),
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
/* @__PURE__ */
|
|
302
|
+
n.inputType === "text" && /* @__PURE__ */ t(e.FormFieldText, {}),
|
|
303
|
+
n.inputType === "email" && /* @__PURE__ */ t(e.FormFieldEmail, {}),
|
|
304
|
+
n.inputType === "file" && /* @__PURE__ */ t(e.FormFieldFile, {}),
|
|
305
|
+
n.inputType === "textarea" && /* @__PURE__ */ t(e.FormFieldTextArea, {}),
|
|
306
|
+
n.inputType === "checkbox" && /* @__PURE__ */ t(e.FormFieldCheckbox, { children: /* @__PURE__ */ t(e.FormFieldCheckboxIndicator, {}) }),
|
|
307
|
+
n.inputType === "select" && /* @__PURE__ */ r(e.FormFieldSelect, { children: [
|
|
308
|
+
/* @__PURE__ */ r(e.FormFieldSelectTrigger, { children: [
|
|
309
309
|
/* @__PURE__ */ t(e.FormFieldSelectValue, {}),
|
|
310
310
|
/* @__PURE__ */ t(e.FormFieldSelectIcon, {})
|
|
311
311
|
] }),
|
|
312
|
-
/* @__PURE__ */ t(e.FormFieldSelectContent, { children: /* @__PURE__ */ t(e.FormFieldSelectViewport, { children:
|
|
313
|
-
/* @__PURE__ */ t(e.FormFieldSelectItemText, { children:
|
|
312
|
+
/* @__PURE__ */ t(e.FormFieldSelectContent, { children: /* @__PURE__ */ t(e.FormFieldSelectViewport, { children: n.items.map((c) => /* @__PURE__ */ r(e.FormFieldSelectItem, { value: c.value, children: [
|
|
313
|
+
/* @__PURE__ */ t(e.FormFieldSelectItemText, { children: c.label }),
|
|
314
314
|
/* @__PURE__ */ t(e.FormFieldSelectItemIndicator, {})
|
|
315
|
-
] },
|
|
315
|
+
] }, c.value)) }) })
|
|
316
|
+
] }),
|
|
317
|
+
n.inputType === "combobox" && /* @__PURE__ */ r(e.FormFieldCombobox, { children: [
|
|
318
|
+
/* @__PURE__ */ r(e.FormFieldComboboxControl, { children: [
|
|
319
|
+
n.multiple && /* @__PURE__ */ t(e.FormFieldComboboxSelectedTags, {}),
|
|
320
|
+
/* @__PURE__ */ t(e.FormFieldComboboxInput, {}),
|
|
321
|
+
/* @__PURE__ */ t(e.FormFieldComboboxTrigger, {})
|
|
322
|
+
] }),
|
|
323
|
+
/* @__PURE__ */ t(e.FormFieldComboboxPositioner, { children: /* @__PURE__ */ t(e.FormFieldComboboxContent, { children: /* @__PURE__ */ t(e.FormFieldComboboxItemList, {}) }) })
|
|
316
324
|
] }),
|
|
317
325
|
/* @__PURE__ */ t(e.FormFieldError, {})
|
|
318
|
-
] },
|
|
326
|
+
] }, n.name)),
|
|
319
327
|
/* @__PURE__ */ t(e.FormError, {})
|
|
320
328
|
] }) }),
|
|
321
|
-
/* @__PURE__ */
|
|
329
|
+
/* @__PURE__ */ r(e.FormFooter, { children: [
|
|
322
330
|
/* @__PURE__ */ t(e.FormCancel, {}),
|
|
323
331
|
/* @__PURE__ */ t(e.FormSubmit, {})
|
|
324
332
|
] })
|
|
325
333
|
] }),
|
|
326
|
-
/* @__PURE__ */
|
|
334
|
+
/* @__PURE__ */ r(e.FormSuccess, { children: [
|
|
327
335
|
/* @__PURE__ */ t(e.FormSuccessHeading, {}),
|
|
328
336
|
/* @__PURE__ */ t(e.FormSuccessMessage, {}),
|
|
329
337
|
/* @__PURE__ */ t(e.FormSuccessButton, {})
|
|
@@ -332,7 +340,7 @@ function V() {
|
|
|
332
340
|
}
|
|
333
341
|
export {
|
|
334
342
|
R as InkeepEmbeddedChat,
|
|
335
|
-
|
|
343
|
+
k as InkeepEmbeddedChatImpl,
|
|
336
344
|
B as InkeepEmbeddedChatImplContent,
|
|
337
|
-
|
|
345
|
+
T as InkeepEmbeddedChatProvider
|
|
338
346
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("@inkeep/cxkit-styled");function
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("@inkeep/cxkit-styled");function c(r){const{baseSettings:t}=r;return e.jsx(n.ErrorBoundary,{children:e.jsx(n.Shadow,{wrapperStyles:{height:"inherit",width:"inherit"},children:e.jsx(n.RootProvider,{config:{baseSettings:t},componentType:n.WebWidgetInteractionType.IntelligentForm,children:e.jsx(s,{...r})})})})}function s(r){const{formSettings:t}=r;return e.jsx(n.IntelligentForm.Provider,{formSettings:t,children:e.jsxs(n.IntelligentForm.Root,{children:[e.jsx(n.IntelligentForm.Heading,{}),e.jsx(n.IntelligentForm.Content,{children:e.jsxs(n.IntelligentForm.ContentScrollArea,{children:[e.jsxs(n.IntelligentForm.ContentScrollAreaViewport,{children:[e.jsx(F,{}),e.jsx(x,{}),e.jsx(g,{}),e.jsx(I,{}),e.jsx(d,{})]}),e.jsx(n.IntelligentForm.ContentScrollAreaScrollbar,{children:e.jsx(n.IntelligentForm.ContentScrollAreaThumb,{})}),e.jsx(n.IntelligentForm.ContentScrollAreaCorner,{})]})})]})})}function F(){return e.jsxs(n.IntelligentForm.Success,{children:[e.jsx(n.IntelligentForm.SuccessIcon,{}),e.jsx(n.IntelligentForm.SuccessHeading,{}),e.jsx(n.IntelligentForm.SuccessMessage,{})]})}function x(){const{isSubmitSuccessful:r}=n.useIntelligentForm();return r?null:e.jsxs(n.IntelligentForm.PrimaryForm,{children:[e.jsx(n.IntelligentForm.PrimaryFormDescription,{}),e.jsx(n.IntelligentForm.PrimaryFormFields,{children:t=>t.map(l=>e.jsx(m,{field:l},l.name))}),e.jsx(n.IntelligentForm.PrimaryFormSubmit,{})]})}function i(){return e.jsxs(n.IntelligentForm.BotHeading,{children:[e.jsx(n.IntelligentForm.BotHeadingIcon,{}),e.jsx(n.IntelligentForm.BotHeadingName,{})]})}function g(){return e.jsxs(n.IntelligentForm.Loading,{children:[e.jsx(i,{}),e.jsx(n.LoadingIndicator,{})]})}function I(){const{isSubmitSuccessful:r}=n.useIntelligentForm();return r?null:e.jsxs(n.IntelligentForm.ConfidentResponse,{children:[e.jsx(i,{}),e.jsxs(n.IntelligentForm.Sources,{children:[e.jsx(n.IntelligentForm.SourcesCaption,{}),e.jsx(n.IntelligentForm.SourcesList,{children:t=>t.map(l=>e.jsxs(n.IntelligentForm.Source,{source:l,children:[e.jsx(n.IntelligentForm.SourceIcon,{}),e.jsx(n.IntelligentForm.SourceTitle,{})]},l.url))})]}),e.jsx(n.IntelligentForm.ConfidentAnswer,{}),e.jsxs(n.IntelligentForm.ConfidentResponseButton,{children:[e.jsx(n.IntelligentForm.ConfidentResponseButtonIcon,{}),e.jsx(n.IntelligentForm.ConfidentResponseButtonLabel,{})]})]})}function d(){const{aiResponse:r}=n.useIntelligentForm(),{isSubmitSuccessful:t}=n.useIntelligentForm();return t?null:e.jsxs(n.IntelligentForm.SecondaryForm,{children:[e.jsx(i,{}),!r.answerConfidence&&e.jsxs(n.IntelligentForm.Sources,{children:[e.jsx(n.IntelligentForm.SourcesCaption,{children:"I wasn't able to find a direct answer to your question, but here's some helpful sources:"}),e.jsx(n.IntelligentForm.SourcesList,{children:l=>l.map(o=>e.jsxs(n.IntelligentForm.Source,{source:o,children:[e.jsx(n.IntelligentForm.SourceIcon,{}),e.jsx(n.IntelligentForm.SourceTitle,{})]},o.url))})]}),e.jsx(n.IntelligentForm.SecondaryFormDescription,{}),e.jsx(n.IntelligentForm.SecondaryFormFields,{children:l=>l.map(o=>e.jsx(m,{field:o},o.name))}),e.jsx(n.IntelligentForm.Error,{}),e.jsx(n.IntelligentForm.SecondaryFormSubmit,{})]})}function m(r){const{field:t}=r;return e.jsxs(n.IntelligentForm.Field,{field:t,children:[e.jsx(n.IntelligentForm.FieldLabel,{}),t.inputType==="text"&&e.jsx(n.IntelligentForm.Text,{}),t.inputType==="email"&&e.jsx(n.IntelligentForm.Email,{}),t.inputType==="file"&&e.jsx(n.IntelligentForm.File,{}),t.inputType==="textarea"&&e.jsx(n.IntelligentForm.TextArea,{}),t.inputType==="checkbox"&&e.jsx(n.IntelligentForm.Checkbox,{children:e.jsx(n.IntelligentForm.CheckboxIndicator,{})}),t.inputType==="select"&&e.jsxs(n.IntelligentForm.Select,{children:[e.jsxs(n.IntelligentForm.SelectTrigger,{children:[e.jsx(n.IntelligentForm.SelectValue,{}),e.jsx(n.IntelligentForm.SelectIcon,{})]}),e.jsx(n.IntelligentForm.SelectContent,{children:e.jsx(n.IntelligentForm.SelectViewport,{children:t.items.map(l=>e.jsxs(n.IntelligentForm.SelectItem,{value:l.value,children:[e.jsx(n.IntelligentForm.SelectItemText,{children:l.label}),e.jsx(n.IntelligentForm.SelectItemIndicator,{})]},l.value))})})]}),t.inputType==="combobox"&&e.jsxs(n.IntelligentForm.FormFieldCombobox,{children:[e.jsxs(n.IntelligentForm.FormFieldComboboxControl,{children:[t.multiple&&e.jsx(n.IntelligentForm.FormFieldComboboxSelectedTags,{}),e.jsx(n.IntelligentForm.FormFieldComboboxInput,{}),e.jsx(n.IntelligentForm.FormFieldComboboxTrigger,{})]}),e.jsx(n.IntelligentForm.FormFieldComboboxPositioner,{children:e.jsx(n.IntelligentForm.FormFieldComboboxContent,{children:e.jsx(n.IntelligentForm.FormFieldComboboxItemList,{})})})]}),e.jsx(n.IntelligentForm.FieldError,{})]},t.name)}exports.InkeepIntelligentForm=c;exports.InkeepIntelligentFormImpl=s;
|
|
@@ -1,130 +1,138 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as n, jsxs as
|
|
3
|
-
import { ErrorBoundary as s, Shadow as
|
|
4
|
-
function
|
|
5
|
-
const { baseSettings: r } =
|
|
2
|
+
import { jsx as n, jsxs as o } from "react/jsx-runtime";
|
|
3
|
+
import { ErrorBoundary as s, Shadow as m, RootProvider as a, WebWidgetInteractionType as S, IntelligentForm as e, useIntelligentForm as l, LoadingIndicator as h } from "@inkeep/cxkit-styled";
|
|
4
|
+
function x(t) {
|
|
5
|
+
const { baseSettings: r } = t;
|
|
6
6
|
return /* @__PURE__ */ n(s, { children: /* @__PURE__ */ n(
|
|
7
|
-
|
|
7
|
+
m,
|
|
8
8
|
{
|
|
9
9
|
wrapperStyles: {
|
|
10
10
|
height: "inherit",
|
|
11
11
|
width: "inherit"
|
|
12
12
|
},
|
|
13
13
|
children: /* @__PURE__ */ n(
|
|
14
|
-
|
|
14
|
+
a,
|
|
15
15
|
{
|
|
16
16
|
config: {
|
|
17
17
|
baseSettings: r
|
|
18
18
|
},
|
|
19
|
-
componentType:
|
|
20
|
-
children: /* @__PURE__ */ n(p, { ...
|
|
19
|
+
componentType: S.IntelligentForm,
|
|
20
|
+
children: /* @__PURE__ */ n(p, { ...t })
|
|
21
21
|
}
|
|
22
22
|
)
|
|
23
23
|
}
|
|
24
24
|
) });
|
|
25
25
|
}
|
|
26
|
-
function p(
|
|
27
|
-
const { formSettings: r } =
|
|
28
|
-
return /* @__PURE__ */ n(e.Provider, { formSettings: r, children: /* @__PURE__ */
|
|
26
|
+
function p(t) {
|
|
27
|
+
const { formSettings: r } = t;
|
|
28
|
+
return /* @__PURE__ */ n(e.Provider, { formSettings: r, children: /* @__PURE__ */ o(e.Root, { children: [
|
|
29
29
|
/* @__PURE__ */ n(e.Heading, {}),
|
|
30
|
-
/* @__PURE__ */ n(e.Content, { children: /* @__PURE__ */
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
/* @__PURE__ */ n(f, {}),
|
|
33
|
-
/* @__PURE__ */ n(g, {}),
|
|
30
|
+
/* @__PURE__ */ n(e.Content, { children: /* @__PURE__ */ o(e.ContentScrollArea, { children: [
|
|
31
|
+
/* @__PURE__ */ o(e.ContentScrollAreaViewport, { children: [
|
|
34
32
|
/* @__PURE__ */ n(F, {}),
|
|
35
|
-
/* @__PURE__ */ n(
|
|
36
|
-
/* @__PURE__ */ n(
|
|
33
|
+
/* @__PURE__ */ n(b, {}),
|
|
34
|
+
/* @__PURE__ */ n(C, {}),
|
|
35
|
+
/* @__PURE__ */ n(f, {}),
|
|
36
|
+
/* @__PURE__ */ n(g, {})
|
|
37
37
|
] }),
|
|
38
38
|
/* @__PURE__ */ n(e.ContentScrollAreaScrollbar, { children: /* @__PURE__ */ n(e.ContentScrollAreaThumb, {}) }),
|
|
39
39
|
/* @__PURE__ */ n(e.ContentScrollAreaCorner, {})
|
|
40
40
|
] }) })
|
|
41
41
|
] }) });
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
return /* @__PURE__ */
|
|
43
|
+
function F() {
|
|
44
|
+
return /* @__PURE__ */ o(e.Success, { children: [
|
|
45
45
|
/* @__PURE__ */ n(e.SuccessIcon, {}),
|
|
46
46
|
/* @__PURE__ */ n(e.SuccessHeading, {}),
|
|
47
47
|
/* @__PURE__ */ n(e.SuccessMessage, {})
|
|
48
48
|
] });
|
|
49
49
|
}
|
|
50
|
-
function
|
|
51
|
-
const { isSubmitSuccessful:
|
|
52
|
-
return
|
|
50
|
+
function b() {
|
|
51
|
+
const { isSubmitSuccessful: t } = l();
|
|
52
|
+
return t ? null : /* @__PURE__ */ o(e.PrimaryForm, { children: [
|
|
53
53
|
/* @__PURE__ */ n(e.PrimaryFormDescription, {}),
|
|
54
|
-
/* @__PURE__ */ n(e.PrimaryFormFields, { children: (r) => r.map((i) => /* @__PURE__ */ n(
|
|
54
|
+
/* @__PURE__ */ n(e.PrimaryFormFields, { children: (r) => r.map((i) => /* @__PURE__ */ n(u, { field: i }, i.name)) }),
|
|
55
55
|
/* @__PURE__ */ n(e.PrimaryFormSubmit, {})
|
|
56
56
|
] });
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
return /* @__PURE__ */
|
|
58
|
+
function d() {
|
|
59
|
+
return /* @__PURE__ */ o(e.BotHeading, { children: [
|
|
60
60
|
/* @__PURE__ */ n(e.BotHeadingIcon, {}),
|
|
61
61
|
/* @__PURE__ */ n(e.BotHeadingName, {})
|
|
62
62
|
] });
|
|
63
63
|
}
|
|
64
|
-
function
|
|
65
|
-
return /* @__PURE__ */
|
|
66
|
-
/* @__PURE__ */ n(
|
|
64
|
+
function C() {
|
|
65
|
+
return /* @__PURE__ */ o(e.Loading, { children: [
|
|
66
|
+
/* @__PURE__ */ n(d, {}),
|
|
67
67
|
/* @__PURE__ */ n(h, {})
|
|
68
68
|
] });
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
const { isSubmitSuccessful:
|
|
72
|
-
return
|
|
73
|
-
/* @__PURE__ */ n(
|
|
74
|
-
/* @__PURE__ */
|
|
70
|
+
function f() {
|
|
71
|
+
const { isSubmitSuccessful: t } = l();
|
|
72
|
+
return t ? null : /* @__PURE__ */ o(e.ConfidentResponse, { children: [
|
|
73
|
+
/* @__PURE__ */ n(d, {}),
|
|
74
|
+
/* @__PURE__ */ o(e.Sources, { children: [
|
|
75
75
|
/* @__PURE__ */ n(e.SourcesCaption, {}),
|
|
76
|
-
/* @__PURE__ */ n(e.SourcesList, { children: (r) => r.map((i) => /* @__PURE__ */
|
|
76
|
+
/* @__PURE__ */ n(e.SourcesList, { children: (r) => r.map((i) => /* @__PURE__ */ o(e.Source, { source: i, children: [
|
|
77
77
|
/* @__PURE__ */ n(e.SourceIcon, {}),
|
|
78
78
|
/* @__PURE__ */ n(e.SourceTitle, {})
|
|
79
79
|
] }, i.url)) })
|
|
80
80
|
] }),
|
|
81
81
|
/* @__PURE__ */ n(e.ConfidentAnswer, {}),
|
|
82
|
-
/* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ o(e.ConfidentResponseButton, { children: [
|
|
83
83
|
/* @__PURE__ */ n(e.ConfidentResponseButtonIcon, {}),
|
|
84
84
|
/* @__PURE__ */ n(e.ConfidentResponseButtonLabel, {})
|
|
85
85
|
] })
|
|
86
86
|
] });
|
|
87
87
|
}
|
|
88
|
-
function
|
|
89
|
-
const { aiResponse:
|
|
90
|
-
return r ? null : /* @__PURE__ */
|
|
91
|
-
/* @__PURE__ */ n(
|
|
92
|
-
!
|
|
88
|
+
function g() {
|
|
89
|
+
const { aiResponse: t } = l(), { isSubmitSuccessful: r } = l();
|
|
90
|
+
return r ? null : /* @__PURE__ */ o(e.SecondaryForm, { children: [
|
|
91
|
+
/* @__PURE__ */ n(d, {}),
|
|
92
|
+
!t.answerConfidence && /* @__PURE__ */ o(e.Sources, { children: [
|
|
93
93
|
/* @__PURE__ */ n(e.SourcesCaption, { children: "I wasn't able to find a direct answer to your question, but here's some helpful sources:" }),
|
|
94
|
-
/* @__PURE__ */ n(e.SourcesList, { children: (i) => i.map((c) => /* @__PURE__ */
|
|
94
|
+
/* @__PURE__ */ n(e.SourcesList, { children: (i) => i.map((c) => /* @__PURE__ */ o(e.Source, { source: c, children: [
|
|
95
95
|
/* @__PURE__ */ n(e.SourceIcon, {}),
|
|
96
96
|
/* @__PURE__ */ n(e.SourceTitle, {})
|
|
97
97
|
] }, c.url)) })
|
|
98
98
|
] }),
|
|
99
99
|
/* @__PURE__ */ n(e.SecondaryFormDescription, {}),
|
|
100
|
-
/* @__PURE__ */ n(e.SecondaryFormFields, { children: (i) => i.map((c) => /* @__PURE__ */ n(
|
|
100
|
+
/* @__PURE__ */ n(e.SecondaryFormFields, { children: (i) => i.map((c) => /* @__PURE__ */ n(u, { field: c }, c.name)) }),
|
|
101
101
|
/* @__PURE__ */ n(e.Error, {}),
|
|
102
102
|
/* @__PURE__ */ n(e.SecondaryFormSubmit, {})
|
|
103
103
|
] });
|
|
104
104
|
}
|
|
105
|
-
function
|
|
106
|
-
const { field: r } =
|
|
107
|
-
return /* @__PURE__ */
|
|
105
|
+
function u(t) {
|
|
106
|
+
const { field: r } = t;
|
|
107
|
+
return /* @__PURE__ */ o(e.Field, { field: r, children: [
|
|
108
108
|
/* @__PURE__ */ n(e.FieldLabel, {}),
|
|
109
109
|
r.inputType === "text" && /* @__PURE__ */ n(e.Text, {}),
|
|
110
110
|
r.inputType === "email" && /* @__PURE__ */ n(e.Email, {}),
|
|
111
111
|
r.inputType === "file" && /* @__PURE__ */ n(e.File, {}),
|
|
112
112
|
r.inputType === "textarea" && /* @__PURE__ */ n(e.TextArea, {}),
|
|
113
113
|
r.inputType === "checkbox" && /* @__PURE__ */ n(e.Checkbox, { children: /* @__PURE__ */ n(e.CheckboxIndicator, {}) }),
|
|
114
|
-
r.inputType === "select" && /* @__PURE__ */
|
|
115
|
-
/* @__PURE__ */
|
|
114
|
+
r.inputType === "select" && /* @__PURE__ */ o(e.Select, { children: [
|
|
115
|
+
/* @__PURE__ */ o(e.SelectTrigger, { children: [
|
|
116
116
|
/* @__PURE__ */ n(e.SelectValue, {}),
|
|
117
117
|
/* @__PURE__ */ n(e.SelectIcon, {})
|
|
118
118
|
] }),
|
|
119
|
-
/* @__PURE__ */ n(e.SelectContent, { children: /* @__PURE__ */ n(e.SelectViewport, { children: r.items.map((i) => /* @__PURE__ */
|
|
119
|
+
/* @__PURE__ */ n(e.SelectContent, { children: /* @__PURE__ */ n(e.SelectViewport, { children: r.items.map((i) => /* @__PURE__ */ o(e.SelectItem, { value: i.value, children: [
|
|
120
120
|
/* @__PURE__ */ n(e.SelectItemText, { children: i.label }),
|
|
121
121
|
/* @__PURE__ */ n(e.SelectItemIndicator, {})
|
|
122
122
|
] }, i.value)) }) })
|
|
123
123
|
] }),
|
|
124
|
+
r.inputType === "combobox" && /* @__PURE__ */ o(e.FormFieldCombobox, { children: [
|
|
125
|
+
/* @__PURE__ */ o(e.FormFieldComboboxControl, { children: [
|
|
126
|
+
r.multiple && /* @__PURE__ */ n(e.FormFieldComboboxSelectedTags, {}),
|
|
127
|
+
/* @__PURE__ */ n(e.FormFieldComboboxInput, {}),
|
|
128
|
+
/* @__PURE__ */ n(e.FormFieldComboboxTrigger, {})
|
|
129
|
+
] }),
|
|
130
|
+
/* @__PURE__ */ n(e.FormFieldComboboxPositioner, { children: /* @__PURE__ */ n(e.FormFieldComboboxContent, { children: /* @__PURE__ */ n(e.FormFieldComboboxItemList, {}) }) })
|
|
131
|
+
] }),
|
|
124
132
|
/* @__PURE__ */ n(e.FieldError, {})
|
|
125
133
|
] }, r.name);
|
|
126
134
|
}
|
|
127
135
|
export {
|
|
128
|
-
|
|
136
|
+
x as InkeepIntelligentForm,
|
|
129
137
|
p as InkeepIntelligentFormImpl
|
|
130
138
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/cxkit-react",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.115",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Inkeep, Inc. Customer License (IICL) v1.1",
|
|
6
6
|
"homepage": "",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@radix-ui/react-use-controllable-state": "^1.1.0",
|
|
24
24
|
"lucide-react": "^0.503.0",
|
|
25
|
-
"@inkeep/cxkit-styled": "0.5.
|
|
25
|
+
"@inkeep/cxkit-styled": "0.5.115"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@biomejs/biome": "1.9.4",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"typescript": "5.7.3",
|
|
45
45
|
"vite": "5.4.11",
|
|
46
46
|
"vite-plugin-dts": "4.4.0",
|
|
47
|
-
"@inkeep/cxkit-color-mode": "0.5.
|
|
48
|
-
"@inkeep/cxkit-types": "0.5.
|
|
47
|
+
"@inkeep/cxkit-color-mode": "0.5.115",
|
|
48
|
+
"@inkeep/cxkit-types": "0.5.115"
|
|
49
49
|
},
|
|
50
50
|
"module": "dist/index.js",
|
|
51
51
|
"types": "dist/index.d.ts",
|