@carbon/ai-chat 0.4.0-rc.2 → 0.4.0-rc.3
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.
- package/dist/es/aiChatEntry.js +220 -14
- package/dist/es/chat.AppContainer.js +6491 -0
- package/dist/es/chat.AppState.js +40 -0
- package/dist/es/{chat/shared/components/BasePanelComponent.js → chat.BasePanelComponent.js} +3 -3
- package/dist/es/{chat/shared/components/panels/BodyAndFooterPanelComponent.js → chat.BodyAndFooterPanelComponent.js} +92 -9
- package/dist/es/chat.BodyWithFooterComponent.js +140 -0
- package/dist/es/{chat/shared/components/header/BotHeader.js → chat.BotHeader.js} +7 -9
- package/dist/es/{chat/shared/components/responseTypes/carousel/Carousel.js → chat.Carousel.js} +3 -3
- package/dist/es/chat.CatastrophicError.js +381 -0
- package/dist/es/chat.Chat.js +2009 -0
- package/dist/es/chat.Disclaimer.js +553 -0
- package/dist/es/chat.Header.js +1025 -0
- package/dist/es/{chat/shared/components/util/HideComponent.js → chat.HideComponent.js} +9 -2
- package/dist/es/{types/config/HomeScreenConfig.js → chat.HomeScreenConfig.js} +1 -1
- package/dist/es/{chat/shared/components/homeScreen/HomeScreen.js → chat.HomeScreenContainer.js} +159 -14
- package/dist/es/{chat/shared/components/homeScreen/HomeScreenHeader.js → chat.HomeScreenHeader.js} +3 -3
- package/dist/es/{chat/shared/services/haa/HumanAgentServiceImpl.js → chat.HumanAgentServiceImpl.js} +215 -17
- package/dist/es/{chat/shared/components/responseTypes/iframe/IFrameComponent.js → chat.IFrameComponent.js} +4 -8
- package/dist/es/chat.IFramePanel.js +151 -0
- package/dist/es/{chat/shared/components/input/Input.js → chat.Input.js} +214 -18
- package/dist/es/{types/config/ServiceDeskConfig.js → chat.LocalMessageItem.js} +17 -1
- package/dist/es/chat.MessageTypeComponent.js +3580 -0
- package/dist/es/{types/messaging/Messages.js → chat.Messages.js} +1 -1
- package/dist/es/chat.MountChildrenOnDelay.js +97 -0
- package/dist/es/{chat/shared/components/OverlayPanel.js → chat.PageObjectId.js} +70 -4
- package/dist/es/{chat/web-components/components/markdownText/src/markdownText.scss.js → chat.RichText.js} +347 -1
- package/dist/es/chat.TourContainer.js +524 -0
- package/dist/es/{chat/languages/en.json.js → chat.VideoComponent.js} +561 -1
- package/dist/es/chat.ViewSourcePanel.js +187 -0
- package/dist/es/{chat/shared/store/actions.js → chat.actions.js} +2 -2
- package/dist/es/{chat/shared/utils/browserUtils.js → chat.browserUtils.js} +1 -1
- package/dist/es/{types/utilities/carbonTypes.js → chat.carbonTypes.js} +2 -2
- package/dist/es/{chat/web-components/components/codeElement/src/codeElement.scss.js → chat.cds-aichat-code.js} +64 -1
- package/dist/es/{chat/shared/utils/constants.js → chat.constants.js} +4 -7
- package/dist/es/{types/events/eventBusTypes.js → chat.customElement.js} +32 -1
- package/dist/es/chat.dynamic-imports.js +192 -0
- package/dist/es/{chat/shared/utils/htmlUtils.js → chat.htmlUtils.js} +16 -2
- package/dist/es/{chat/shared/utils/messageUtils.js → chat.messageUtils.js} +54 -7
- package/dist/es/{chat/shared/utils/miscUtils.js → chat.miscUtils.js} +24 -5
- package/dist/es/chat.resolvablePromise.js +315 -0
- package/dist/es/{chat/shared/store/selectors.js → chat.selectors.js} +1 -1
- package/dist/es/{chat/shared/utils/lang/stringUtils.js → chat.stringUtils.js} +2 -2
- package/dist/es/{chat/shared/hooks/useCounter.js → chat.useCounter.js} +1 -1
- package/dist/es/{chat/shared/hooks/useOnMount.js → chat.useOnMount.js} +1 -1
- package/dist/es/{chat/shared/utils/domUtils.js → chat.usePrevious.js} +47 -1
- package/dist/es/{chat/shared/utils/lang/UUIDType.js → chat.uuid.js} +15 -3
- package/dist/es/web-components/cds-aichat-container/index.js +73 -4
- package/dist/es/web-components/cds-aichat-custom-element/index.js +1 -3
- package/package.json +2 -2
- package/dist/es/chat/dynamic-imports/dynamic-imports.js +0 -96
- package/dist/es/chat/react/components/AppContainer.js +0 -197
- package/dist/es/chat/react/components/UserDefinedResponsePortalsContainer.js +0 -31
- package/dist/es/chat/react/components/WriteableElementsPortalsContainer.js +0 -28
- package/dist/es/chat/react/components/chainOfThought/ChainOfThought.js +0 -20
- package/dist/es/chat/react/components/chatHeader/ChatHeaderAvatar.js +0 -20
- package/dist/es/chat/react/components/chatHeader/ChatHeaderLink.js +0 -22
- package/dist/es/chat/react/components/chatHeader/ChatHeaderMenu.js +0 -27
- package/dist/es/chat/react/components/chatHeader/ChatHeaderMenuButton.js +0 -60
- package/dist/es/chat/react/components/chatHeader/ChatHeaderMenuItem.js +0 -24
- package/dist/es/chat/react/components/chatHeader/ChatHeaderMenuItemRadioGroup.js +0 -28
- package/dist/es/chat/react/components/chatHeader/ChatHeaderOverflowMenu.js +0 -69
- package/dist/es/chat/react/components/chatHeader/ChatHeaderTitle.js +0 -22
- package/dist/es/chat/react/components/feedback/FeedbackButtonsComponent.js +0 -20
- package/dist/es/chat/react/components/feedback/FeedbackComponent.js +0 -20
- package/dist/es/chat/react/components/inlineLoading/InlineLoadingComponent.js +0 -20
- package/dist/es/chat/react/components/markdownText/MarkdownText.js +0 -20
- package/dist/es/chat/react/components/stopStreamingButton/StopStreamingButton.js +0 -20
- package/dist/es/chat/react/components/table/Table.js +0 -20
- package/dist/es/chat/shared/Chat.js +0 -115
- package/dist/es/chat/shared/ChatInstanceImpl.js +0 -360
- package/dist/es/chat/shared/chatEntryFunctions.js +0 -46
- package/dist/es/chat/shared/components/Avatar.js +0 -286
- package/dist/es/chat/shared/components/BodyWithFooterComponent.js +0 -56
- package/dist/es/chat/shared/components/CatastrophicError.js +0 -77
- package/dist/es/chat/shared/components/Chat.js +0 -244
- package/dist/es/chat/shared/components/ChatBubbleDark.js +0 -124
- package/dist/es/chat/shared/components/ChatBubbleLight.js +0 -216
- package/dist/es/chat/shared/components/Disclaimer.js +0 -86
- package/dist/es/chat/shared/components/ErrorIcon.js +0 -20
- package/dist/es/chat/shared/components/ErrorMessageDark.js +0 -89
- package/dist/es/chat/shared/components/ErrorMessageLight.js +0 -135
- package/dist/es/chat/shared/components/HydrationPanel.js +0 -58
- package/dist/es/chat/shared/components/LatestWelcomeNodes.js +0 -26
- package/dist/es/chat/shared/components/ResponseStopped.js +0 -19
- package/dist/es/chat/shared/components/SkeletonPicker.js +0 -32
- package/dist/es/chat/shared/components/WriteableElement.js +0 -22
- package/dist/es/chat/shared/components/agent/AgentAvatar.js +0 -54
- package/dist/es/chat/shared/components/agent/AgentBanner.js +0 -109
- package/dist/es/chat/shared/components/agent/AgentBannerContainer.js +0 -28
- package/dist/es/chat/shared/components/agent/AvailabilityMessage.js +0 -49
- package/dist/es/chat/shared/components/aria/AriaAnnouncerComponent.js +0 -122
- package/dist/es/chat/shared/components/aria/AriaAnnouncerProvider.js +0 -48
- package/dist/es/chat/shared/components/aria/AriaLiveMessage.js +0 -22
- package/dist/es/chat/shared/components/header/AISlug.js +0 -22
- package/dist/es/chat/shared/components/header/Header.js +0 -460
- package/dist/es/chat/shared/components/header/SimpleHeader.js +0 -27
- package/dist/es/chat/shared/components/homeScreen/HomeScreenContainer.js +0 -68
- package/dist/es/chat/shared/components/launcher/Launcher.js +0 -88
- package/dist/es/chat/shared/components/launcher/LauncherComplex.js +0 -63
- package/dist/es/chat/shared/components/launcher/LauncherContainer.js +0 -73
- package/dist/es/chat/shared/components/launcher/LauncherDesktopContainer.js +0 -221
- package/dist/es/chat/shared/components/launcher/LauncherExtended.js +0 -244
- package/dist/es/chat/shared/components/launcher/LauncherMobileContainer.js +0 -175
- package/dist/es/chat/shared/components/launcher/launcherUtils.js +0 -16
- package/dist/es/chat/shared/components/modals/ConfirmModal.js +0 -67
- package/dist/es/chat/shared/components/modals/EndAgentChatModal.js +0 -46
- package/dist/es/chat/shared/components/modals/RequestScreenShareModal.js +0 -43
- package/dist/es/chat/shared/components/notifications/Notifications.js +0 -58
- package/dist/es/chat/shared/components/panels/CustomPanel.js +0 -136
- package/dist/es/chat/shared/components/responseTypes/agent/ConnectToAgent.js +0 -30
- package/dist/es/chat/shared/components/responseTypes/agent/RealConnectToAgent.js +0 -102
- package/dist/es/chat/shared/components/responseTypes/audio/AudioComponent.js +0 -26
- package/dist/es/chat/shared/components/responseTypes/buttonItem/BaseButtonItemComponent.js +0 -69
- package/dist/es/chat/shared/components/responseTypes/buttonItem/ButtonItemComponent.js +0 -48
- package/dist/es/chat/shared/components/responseTypes/buttonItem/ButtonItemCustomEventComponent.js +0 -42
- package/dist/es/chat/shared/components/responseTypes/buttonItem/ButtonItemPostBackComponent.js +0 -54
- package/dist/es/chat/shared/components/responseTypes/buttonItem/ButtonItemShowPanelComponent.js +0 -36
- package/dist/es/chat/shared/components/responseTypes/buttonItem/ButtonItemURLComponent.js +0 -42
- package/dist/es/chat/shared/components/responseTypes/card/CardItemComponent.js +0 -34
- package/dist/es/chat/shared/components/responseTypes/carousel/CarouselItemComponent.js +0 -39
- package/dist/es/chat/shared/components/responseTypes/conversationalSearch/ConversationalSearch.js +0 -92
- package/dist/es/chat/shared/components/responseTypes/conversationalSearch/ConversationalSearchText.js +0 -158
- package/dist/es/chat/shared/components/responseTypes/custom/UserDefinedResponse.js +0 -33
- package/dist/es/chat/shared/components/responseTypes/datePicker/DatePickerComponent.js +0 -176
- package/dist/es/chat/shared/components/responseTypes/error/InlineError.js +0 -32
- package/dist/es/chat/shared/components/responseTypes/grid/GridItemComponent.js +0 -109
- package/dist/es/chat/shared/components/responseTypes/iframe/IFrameMessage.js +0 -32
- package/dist/es/chat/shared/components/responseTypes/iframe/IFramePanel.js +0 -51
- package/dist/es/chat/shared/components/responseTypes/iframe/IFramePreviewCard.js +0 -64
- package/dist/es/chat/shared/components/responseTypes/iframe/InlineIFrame.js +0 -55
- package/dist/es/chat/shared/components/responseTypes/image/Image.js +0 -120
- package/dist/es/chat/shared/components/responseTypes/options/OptionComponent.js +0 -83
- package/dist/es/chat/shared/components/responseTypes/options/SelectComponent.js +0 -84
- package/dist/es/chat/shared/components/responseTypes/table/TableContainer.js +0 -96
- package/dist/es/chat/shared/components/responseTypes/text/TextArea.js +0 -68
- package/dist/es/chat/shared/components/responseTypes/tour/TourCard.js +0 -73
- package/dist/es/chat/shared/components/responseTypes/util/BodyMessageComponents.js +0 -65
- package/dist/es/chat/shared/components/responseTypes/util/ClickableImage.js +0 -36
- package/dist/es/chat/shared/components/responseTypes/util/Description.js +0 -21
- package/dist/es/chat/shared/components/responseTypes/util/FooterButtonComponents.js +0 -36
- package/dist/es/chat/shared/components/responseTypes/util/MediaPlayer.js +0 -157
- package/dist/es/chat/shared/components/responseTypes/util/Metablock.js +0 -27
- package/dist/es/chat/shared/components/responseTypes/util/RichText.js +0 -31
- package/dist/es/chat/shared/components/responseTypes/util/SearchResultBody.js +0 -53
- package/dist/es/chat/shared/components/responseTypes/util/StreamingRichText.js +0 -38
- package/dist/es/chat/shared/components/responseTypes/util/TextHolderTile.js +0 -35
- package/dist/es/chat/shared/components/responseTypes/util/citations/CitationCard.js +0 -65
- package/dist/es/chat/shared/components/responseTypes/util/citations/CitationCardContent.js +0 -62
- package/dist/es/chat/shared/components/responseTypes/util/citations/CitationClickableCard.js +0 -23
- package/dist/es/chat/shared/components/responseTypes/util/citations/ExpandToPanelCard.js +0 -50
- package/dist/es/chat/shared/components/responseTypes/util/citations/ViewSourcePanel.js +0 -57
- package/dist/es/chat/shared/components/responseTypes/video/VideoComponent.js +0 -23
- package/dist/es/chat/shared/components/tour/TourCloseMinimizeComponent.js +0 -44
- package/dist/es/chat/shared/components/tour/TourContainer.js +0 -212
- package/dist/es/chat/shared/components/tour/TourControlsComponent.js +0 -98
- package/dist/es/chat/shared/components/tour/TourStepContentComponent.js +0 -156
- package/dist/es/chat/shared/components/tour/TourStepSkeletonComponent.js +0 -20
- package/dist/es/chat/shared/components/util/AnnounceOnMountComponent.js +0 -42
- package/dist/es/chat/shared/components/util/IconHolder.js +0 -16
- package/dist/es/chat/shared/components/util/ImageWithFallback.js +0 -31
- package/dist/es/chat/shared/components/util/MaybeDangerouslySetInnerHTML.js +0 -42
- package/dist/es/chat/shared/components/util/MountChildrenOnDelay.js +0 -40
- package/dist/es/chat/shared/components/util/VisuallyHidden.js +0 -18
- package/dist/es/chat/shared/containers/App.js +0 -181
- package/dist/es/chat/shared/containers/MessageComponent.js +0 -465
- package/dist/es/chat/shared/containers/MessageTypeComponent.js +0 -496
- package/dist/es/chat/shared/containers/MessagesComponent.js +0 -469
- package/dist/es/chat/shared/containers/ModalPortal.js +0 -53
- package/dist/es/chat/shared/containers/main/MainWindow.js +0 -708
- package/dist/es/chat/shared/contexts/AriaAnnouncerContext.js +0 -12
- package/dist/es/chat/shared/contexts/HideComponentContext.js +0 -12
- package/dist/es/chat/shared/contexts/LanguagePackContext.js +0 -12
- package/dist/es/chat/shared/contexts/ModalPortalRootContext.js +0 -12
- package/dist/es/chat/shared/contexts/ServiceManagerContext.js +0 -12
- package/dist/es/chat/shared/contexts/WindowSizeContext.js +0 -12
- package/dist/es/chat/shared/environmentVariables.js +0 -13
- package/dist/es/chat/shared/events/ChatActionsImpl.js +0 -783
- package/dist/es/chat/shared/events/EventBus.js +0 -161
- package/dist/es/chat/shared/hocs/withAriaAnnouncer.js +0 -25
- package/dist/es/chat/shared/hocs/withServiceManager.js +0 -25
- package/dist/es/chat/shared/hooks/useAriaAnnouncer.js +0 -16
- package/dist/es/chat/shared/hooks/useCSSCustomProperties.js +0 -21
- package/dist/es/chat/shared/hooks/useCallbackOnChange.js +0 -24
- package/dist/es/chat/shared/hooks/useEffectDidUpdate.js +0 -21
- package/dist/es/chat/shared/hooks/useLanguagePack.js +0 -16
- package/dist/es/chat/shared/hooks/usePrevious.js +0 -18
- package/dist/es/chat/shared/hooks/useServiceManager.js +0 -16
- package/dist/es/chat/shared/hooks/useShouldSanitizeHTML.js +0 -15
- package/dist/es/chat/shared/hooks/useUUID.js +0 -22
- package/dist/es/chat/shared/hooks/useWindowSize.js +0 -16
- package/dist/es/chat/shared/loadServices.js +0 -72
- package/dist/es/chat/shared/schema/historyToMessages.js +0 -231
- package/dist/es/chat/shared/schema/inputItemToLocalItem.js +0 -30
- package/dist/es/chat/shared/schema/outputItemToLocalItem.js +0 -124
- package/dist/es/chat/shared/services/CustomPanelInstance.js +0 -26
- package/dist/es/chat/shared/services/CustomPanelManager.js +0 -23
- package/dist/es/chat/shared/services/HistoryService.js +0 -59
- package/dist/es/chat/shared/services/MessageService.js +0 -351
- package/dist/es/chat/shared/services/NamespaceService.js +0 -26
- package/dist/es/chat/shared/services/ServiceManager.js +0 -19
- package/dist/es/chat/shared/services/UserSessionStorageService.js +0 -89
- package/dist/es/chat/shared/services/haa/agentStatusMessage.js +0 -108
- package/dist/es/chat/shared/services/haa/humanAgentUtils.js +0 -114
- package/dist/es/chat/shared/services/mockStorage.js +0 -30
- package/dist/es/chat/shared/store/agentActions.js +0 -125
- package/dist/es/chat/shared/store/agentReducers.js +0 -215
- package/dist/es/chat/shared/store/doCreateStore.js +0 -142
- package/dist/es/chat/shared/store/reducerUtils.js +0 -320
- package/dist/es/chat/shared/store/reducers.js +0 -871
- package/dist/es/chat/shared/store/subscriptions.js +0 -55
- package/dist/es/chat/shared/store/tourReducerUtils.js +0 -51
- package/dist/es/chat/shared/utils/ListenerList.js +0 -26
- package/dist/es/chat/shared/utils/PageObjectId.js +0 -25
- package/dist/es/chat/shared/utils/animationUtils.js +0 -77
- package/dist/es/chat/shared/utils/colors.js +0 -71
- package/dist/es/chat/shared/utils/customizers.js +0 -16
- package/dist/es/chat/shared/utils/dateUtils.js +0 -38
- package/dist/es/chat/shared/utils/homeScreenUtils.js +0 -27
- package/dist/es/chat/shared/utils/intlUtils.js +0 -21
- package/dist/es/chat/shared/utils/lang/arrayUtils.js +0 -53
- package/dist/es/chat/shared/utils/lang/langUtils.js +0 -13
- package/dist/es/chat/shared/utils/lang/objectUtils.js +0 -19
- package/dist/es/chat/shared/utils/lang/promiseUtils.js +0 -25
- package/dist/es/chat/shared/utils/lang/uuid.js +0 -16
- package/dist/es/chat/shared/utils/languages.js +0 -156
- package/dist/es/chat/shared/utils/memoizerUtils.js +0 -38
- package/dist/es/chat/shared/utils/messageServiceUtils.js +0 -36
- package/dist/es/chat/shared/utils/resolvablePromise.js +0 -32
- package/dist/es/chat/shared/utils/styleUtils.js +0 -231
- package/dist/es/chat/shared/utils/timeUtils.js +0 -14
- package/dist/es/chat/shared/utils/viewStateUtils.js +0 -38
- package/dist/es/chat/web-components/components/chainOfThought/cds-aichat-chain-of-thought.js +0 -26
- package/dist/es/chat/web-components/components/chainOfThought/src/ChainOfThoughtElement.js +0 -130
- package/dist/es/chat/web-components/components/chainOfThought/src/chainOfThoughtElement.scss.js +0 -3
- package/dist/es/chat/web-components/components/chainOfThought/src/chainOfThoughtElement.template.js +0 -186
- package/dist/es/chat/web-components/components/chatHeader/chatHeaderAvatar/cds-aichat-chat-header-avatar.js +0 -26
- package/dist/es/chat/web-components/components/chatHeader/chatHeaderAvatar/src/chatHeaderAvatar.template.js +0 -32
- package/dist/es/chat/web-components/components/chatHeader/chatHeaderAvatar/src/chatHeaderAvatarElement.js +0 -52
- package/dist/es/chat/web-components/components/chatHeader/chatHeaderAvatar/src/chatHeaderAvatarElement.scss.js +0 -3
- package/dist/es/chat/web-components/components/chatHeader/chatHeaderLink/cds-aichat-chat-header-link.js +0 -44
- package/dist/es/chat/web-components/components/chatHeader/chatHeaderLink/src/chatHeaderLinkElement.template.js +0 -28
- package/dist/es/chat/web-components/components/chatHeader/chatHeaderTitle/cds-aichat-chat-header-title.js +0 -42
- package/dist/es/chat/web-components/components/chatHeader/chatHeaderTitle/src/chatHeaderTitle.scss.js +0 -3
- package/dist/es/chat/web-components/components/chatHeader/chatHeaderTitle/src/chatHeaderTitle.template.js +0 -20
- package/dist/es/chat/web-components/components/codeElement/cds-aichat-code.js +0 -66
- package/dist/es/chat/web-components/components/feedbackButtonsElement/cds-aichat-feedback-buttons.js +0 -26
- package/dist/es/chat/web-components/components/feedbackButtonsElement/src/FeedbackButtonsElement.js +0 -93
- package/dist/es/chat/web-components/components/feedbackButtonsElement/src/feedbackButtonsElement.scss.js +0 -3
- package/dist/es/chat/web-components/components/feedbackButtonsElement/src/feedbackButtonsElement.template.js +0 -84
- package/dist/es/chat/web-components/components/feedbackElement/cds-aichat-feedback.js +0 -30
- package/dist/es/chat/web-components/components/feedbackElement/src/FeedbackElement.js +0 -157
- package/dist/es/chat/web-components/components/feedbackElement/src/feedbackElement.scss.js +0 -3
- package/dist/es/chat/web-components/components/feedbackElement/src/feedbackElement.template.js +0 -95
- package/dist/es/chat/web-components/components/inlineLoadingElement/cds-aichat-inline-loading.js +0 -85
- package/dist/es/chat/web-components/components/inlineLoadingElement/src/styles.scss.js +0 -3
- package/dist/es/chat/web-components/components/markdownText/cds-aichat-markdown-text.js +0 -32
- package/dist/es/chat/web-components/components/markdownText/markdown/markdownToHTML.js +0 -28
- package/dist/es/chat/web-components/components/markdownText/markdown/utils/renderTokenTree.js +0 -191
- package/dist/es/chat/web-components/components/markdownText/markdown/workers/workerManager.js +0 -16
- package/dist/es/chat/web-components/components/markdownText/src/MarkdownElement.js +0 -70
- package/dist/es/chat/web-components/components/markdownText/src/markdownElement.template.js +0 -19
- package/dist/es/chat/web-components/components/roundedButton/cds-aichat-rounded-button.js +0 -29
- package/dist/es/chat/web-components/components/stopStreamingButton/cds-aichat-stop-streaming-button.js +0 -26
- package/dist/es/chat/web-components/components/stopStreamingButton/src/StopStreamingButtonElement.js +0 -49
- package/dist/es/chat/web-components/components/stopStreamingButton/src/stopStreamingButton.scss.js +0 -3
- package/dist/es/chat/web-components/components/stopStreamingButton/src/stopStreamingButton.template.js +0 -44
- package/dist/es/chat/web-components/components/table/cds-aichat-table.js +0 -229
- package/dist/es/chat/web-components/components/table/src/table.scss.js +0 -3
- package/dist/es/chat/web-components/components/table/src/table.template.js +0 -81
- package/dist/es/chat/web-components/components/table/src/tablePagination.template.js +0 -43
- package/dist/es/chat/web-components/components/table/src/tableSkeleton.template.js +0 -17
- package/dist/es/chat/web-components/components/tagListElement/cds-aichat-tag-list.js +0 -28
- package/dist/es/chat/web-components/components/tagListElement/src/TagListElement.js +0 -70
- package/dist/es/chat/web-components/components/tagListElement/src/tagListElement.scss.js +0 -3
- package/dist/es/chat/web-components/components/tagListElement/src/tagListElement.template.js +0 -40
- package/dist/es/chat/web-components/decorators/customElement.js +0 -33
- package/dist/es/chat/web-components/internal/cds-aichat-internal.js +0 -78
- package/dist/es/chat/web-components/settings.js +0 -13
- package/dist/es/node_modules/@carbon/colors/es/index.js +0 -11
- package/dist/es/react/ChatContainer.js +0 -162
- package/dist/es/react/ChatCustomElement.js +0 -58
- package/dist/es/types/config/ChatHeaderConfig.js +0 -18
- package/dist/es/types/config/CornersType.js +0 -16
- package/dist/es/types/config/LauncherConfig.js +0 -19
- package/dist/es/types/config/PublicConfig.js +0 -36
- package/dist/es/types/instance/ChatInstance.js +0 -31
- package/dist/es/types/instance/apiTypes.js +0 -33
- package/dist/es/types/messaging/LocalMessageItem.js +0 -18
- package/dist/es/types/state/AppState.js +0 -18
- package/dist/es/types/utilities/Animation.js +0 -31
- package/dist/es/types/utilities/HasAddRemoveClassName.js +0 -27
- /package/dist/es/{chat/shared/styles/export.carbon.scss.js → chat.export.carbon.js} +0 -0
- /package/dist/es/{chat/shared/styles/export.scss.js → chat.export.js} +0 -0
- /package/dist/es/{chat/web-components/components/markdownText/markdown/utils/markdown.js → chat.markdown.js} +0 -0
- /package/dist/es/{chat/web-components/components/markdownText/markdown/utils/tokenTree.js → chat.tokenTree.js} +0 -0
|
@@ -0,0 +1,553 @@
|
|
|
1
|
+
import { Button } from "@carbon/react";
|
|
2
|
+
|
|
3
|
+
import React, { forwardRef, useRef, useImperativeHandle, useState } from "react";
|
|
4
|
+
|
|
5
|
+
import { useSelector } from "react-redux";
|
|
6
|
+
|
|
7
|
+
import { u as useLanguagePack, C as ChatWidthBreakpoint } from "./chat.AppState.js";
|
|
8
|
+
|
|
9
|
+
import { u as useOnMount } from "./chat.useOnMount.js";
|
|
10
|
+
|
|
11
|
+
import { H as HeaderExport } from "./chat.Header.js";
|
|
12
|
+
|
|
13
|
+
import { u as useShouldSanitizeHTML, s as sanitizeHTML } from "./chat.htmlUtils.js";
|
|
14
|
+
|
|
15
|
+
import "./chat.carbonTypes.js";
|
|
16
|
+
|
|
17
|
+
import { O as OverlayPanelName } from "./chat.PageObjectId.js";
|
|
18
|
+
|
|
19
|
+
import { b as CarbonTheme } from "./chat.dynamic-imports.js";
|
|
20
|
+
|
|
21
|
+
import "@carbon/web-components/es-custom/components/slug/index.js";
|
|
22
|
+
|
|
23
|
+
import "@carbon/icons-react/es/Close.js";
|
|
24
|
+
|
|
25
|
+
import "@carbon/icons-react/es/CloseLarge.js";
|
|
26
|
+
|
|
27
|
+
import "@carbon/icons-react/es/DownToBottom.js";
|
|
28
|
+
|
|
29
|
+
import "@carbon/icons-react/es/Menu.js";
|
|
30
|
+
|
|
31
|
+
import "@carbon/icons-react/es/Restart.js";
|
|
32
|
+
|
|
33
|
+
import "@carbon/icons-react/es/SidePanelClose.js";
|
|
34
|
+
|
|
35
|
+
import "@carbon/icons-react/es/SubtractLarge.js";
|
|
36
|
+
|
|
37
|
+
import "@carbon/web-components/es-custom/components/ai-label/defs.js";
|
|
38
|
+
|
|
39
|
+
import "@carbon/web-components/es-custom/components/popover/defs.js";
|
|
40
|
+
|
|
41
|
+
import "classnames";
|
|
42
|
+
|
|
43
|
+
import "@lit/react";
|
|
44
|
+
|
|
45
|
+
import "tslib";
|
|
46
|
+
|
|
47
|
+
import "./chat.customElement.js";
|
|
48
|
+
|
|
49
|
+
import "@carbon/web-components/es-custom/components/skeleton-icon/index.js";
|
|
50
|
+
|
|
51
|
+
import "lit";
|
|
52
|
+
|
|
53
|
+
import "bind-decorator";
|
|
54
|
+
|
|
55
|
+
import "lit/decorators.js";
|
|
56
|
+
|
|
57
|
+
import "@carbon/web-components/es-custom/components/button/index.js";
|
|
58
|
+
|
|
59
|
+
import "@carbon/web-components/es-custom/components/overflow-menu/index.js";
|
|
60
|
+
|
|
61
|
+
import "@carbon/icons-react/es/ChevronDown.js";
|
|
62
|
+
|
|
63
|
+
import "@carbon/icons-react/es/ChevronUp.js";
|
|
64
|
+
|
|
65
|
+
import "@floating-ui/react";
|
|
66
|
+
|
|
67
|
+
import "./chat.uuid.js";
|
|
68
|
+
|
|
69
|
+
import "uuid";
|
|
70
|
+
|
|
71
|
+
import "./chat.HideComponent.js";
|
|
72
|
+
|
|
73
|
+
import "./chat.usePrevious.js";
|
|
74
|
+
|
|
75
|
+
import "compute-scroll-into-view";
|
|
76
|
+
|
|
77
|
+
import "memoize-one";
|
|
78
|
+
|
|
79
|
+
import "tabbable";
|
|
80
|
+
|
|
81
|
+
import "./chat.actions.js";
|
|
82
|
+
|
|
83
|
+
import "./chat.constants.js";
|
|
84
|
+
|
|
85
|
+
import "focus-trap-react";
|
|
86
|
+
|
|
87
|
+
import "react-dom";
|
|
88
|
+
|
|
89
|
+
import "@carbon/web-components/es-custom/components/ai-label/ai-label-action-button.js";
|
|
90
|
+
|
|
91
|
+
import "@carbon/web-components/es-custom/components/ai-label/ai-label.js";
|
|
92
|
+
|
|
93
|
+
import "dompurify";
|
|
94
|
+
|
|
95
|
+
import "./chat.stringUtils.js";
|
|
96
|
+
|
|
97
|
+
import "./chat.miscUtils.js";
|
|
98
|
+
|
|
99
|
+
import "./chat.browserUtils.js";
|
|
100
|
+
|
|
101
|
+
import "detect-browser";
|
|
102
|
+
|
|
103
|
+
/*
|
|
104
|
+
* Copyright IBM Corp. 2025
|
|
105
|
+
*
|
|
106
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
107
|
+
* LICENSE file in the root directory of this source tree.
|
|
108
|
+
*
|
|
109
|
+
* @license
|
|
110
|
+
*/ function ChatBubbleDark() {
|
|
111
|
+
const chatBubbleID = "cbl-";
|
|
112
|
+
return React.createElement("svg", {
|
|
113
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
114
|
+
viewBox: "0 0 80 80"
|
|
115
|
+
}, React.createElement("defs", null, React.createElement("linearGradient", {
|
|
116
|
+
id: `${chatBubbleID}-a`,
|
|
117
|
+
x1: 30.047,
|
|
118
|
+
x2: 35.499,
|
|
119
|
+
y1: 54.31,
|
|
120
|
+
y2: 54.31,
|
|
121
|
+
gradientUnits: "userSpaceOnUse"
|
|
122
|
+
}, React.createElement("stop", {
|
|
123
|
+
offset: 0,
|
|
124
|
+
stopColor: "#393939"
|
|
125
|
+
}), React.createElement("stop", {
|
|
126
|
+
offset: 1,
|
|
127
|
+
stopColor: "#262626"
|
|
128
|
+
})), React.createElement("linearGradient", {
|
|
129
|
+
id: `${chatBubbleID}-b`,
|
|
130
|
+
x1: 28.608,
|
|
131
|
+
x2: 70.691,
|
|
132
|
+
y1: -3.968,
|
|
133
|
+
y2: 68.921,
|
|
134
|
+
gradientUnits: "userSpaceOnUse"
|
|
135
|
+
}, React.createElement("stop", {
|
|
136
|
+
offset: 0,
|
|
137
|
+
stopColor: "#6f6f6f"
|
|
138
|
+
}), React.createElement("stop", {
|
|
139
|
+
offset: .19,
|
|
140
|
+
stopColor: "#6c6c6c"
|
|
141
|
+
}), React.createElement("stop", {
|
|
142
|
+
offset: .316,
|
|
143
|
+
stopColor: "#636363"
|
|
144
|
+
}), React.createElement("stop", {
|
|
145
|
+
offset: .423,
|
|
146
|
+
stopColor: "#555"
|
|
147
|
+
}), React.createElement("stop", {
|
|
148
|
+
offset: .518,
|
|
149
|
+
stopColor: "#3f3f3f"
|
|
150
|
+
}), React.createElement("stop", {
|
|
151
|
+
offset: .545,
|
|
152
|
+
stopColor: "#383838"
|
|
153
|
+
}), React.createElement("stop", {
|
|
154
|
+
offset: 1,
|
|
155
|
+
stopColor: "#262626"
|
|
156
|
+
})), React.createElement("linearGradient", {
|
|
157
|
+
id: `${chatBubbleID}-c`,
|
|
158
|
+
x1: 15.125,
|
|
159
|
+
x2: 60.902,
|
|
160
|
+
y1: 36.198,
|
|
161
|
+
y2: 36.198,
|
|
162
|
+
gradientUnits: "userSpaceOnUse"
|
|
163
|
+
}, React.createElement("stop", {
|
|
164
|
+
offset: 0,
|
|
165
|
+
stopColor: "#525252"
|
|
166
|
+
}), React.createElement("stop", {
|
|
167
|
+
offset: 1,
|
|
168
|
+
stopColor: "#393939"
|
|
169
|
+
})), React.createElement("linearGradient", {
|
|
170
|
+
id: `${chatBubbleID}-d`,
|
|
171
|
+
x1: 15.14,
|
|
172
|
+
x2: 63.056,
|
|
173
|
+
y1: 5.723,
|
|
174
|
+
y2: 33.517,
|
|
175
|
+
gradientUnits: "userSpaceOnUse"
|
|
176
|
+
}, React.createElement("stop", {
|
|
177
|
+
offset: .777,
|
|
178
|
+
stopColor: "#8d8d8d"
|
|
179
|
+
}), React.createElement("stop", {
|
|
180
|
+
offset: .806,
|
|
181
|
+
stopColor: "#8a8a8a",
|
|
182
|
+
stopOpacity: .967
|
|
183
|
+
}), React.createElement("stop", {
|
|
184
|
+
offset: .839,
|
|
185
|
+
stopColor: "gray",
|
|
186
|
+
stopOpacity: .872
|
|
187
|
+
}), React.createElement("stop", {
|
|
188
|
+
offset: .873,
|
|
189
|
+
stopColor: "#6f6f6f",
|
|
190
|
+
stopOpacity: .713
|
|
191
|
+
}), React.createElement("stop", {
|
|
192
|
+
offset: .908,
|
|
193
|
+
stopColor: "#595959",
|
|
194
|
+
stopOpacity: .491
|
|
195
|
+
}), React.createElement("stop", {
|
|
196
|
+
offset: .944,
|
|
197
|
+
stopColor: "#3b3b3b",
|
|
198
|
+
stopOpacity: .209
|
|
199
|
+
}), React.createElement("stop", {
|
|
200
|
+
offset: .967,
|
|
201
|
+
stopColor: "#262626",
|
|
202
|
+
stopOpacity: 0
|
|
203
|
+
}))), React.createElement("path", {
|
|
204
|
+
d: "m15.129 52.11 45.498 26.279 4.248-2.507-45.473-26.255-4.273 2.483z",
|
|
205
|
+
opacity: .25
|
|
206
|
+
}), React.createElement("path", {
|
|
207
|
+
fill: `url(#${chatBubbleID}-a)`,
|
|
208
|
+
d: "m32.663 52.846-2.258 4.227a1.138 1.138 0 0 1-.358.35l2.837-1.649a1.148 1.148 0 0 0 .358-.35L35.5 51.2Z"
|
|
209
|
+
}), React.createElement("path", {
|
|
210
|
+
fill: `url(#${chatBubbleID}-b)`,
|
|
211
|
+
d: "M63.454 26.582 20.631 1.858a1.006 1.006 0 0 0-1.014-.1l-3.973 2.3a1.006 1.006 0 0 1 1.014.1l42.823 24.725a3.148 3.148 0 0 1 1.419 2.462l-.1 36.084a1 1 0 0 1-.419.907l3.973-2.3a1 1 0 0 0 .419-.907l.1-36.084a3.145 3.145 0 0 0-1.419-2.463Z"
|
|
212
|
+
}), React.createElement("path", {
|
|
213
|
+
fill: `url(#${chatBubbleID}-c)`,
|
|
214
|
+
d: "M59.481 28.883a3.151 3.151 0 0 1 1.419 2.462l-.1 36.084c-.009.9-.647 1.26-1.424.812l-26.695-15.4-2.257 4.226a.9.9 0 0 1-1.333.273 3.086 3.086 0 0 1-1.224-1.527l-2.322-7.092-9-5.2a3.143 3.143 0 0 1-1.421-2.461l.1-36.084c0-.9.641-1.272 1.431-.816Z"
|
|
215
|
+
}), React.createElement("path", {
|
|
216
|
+
fill: "#6f6f6f",
|
|
217
|
+
d: "m57.995 37.068-.011 3.902-39.952-23.066.011-3.902 39.952 23.066zM57.995 45.114l-.011 3.903-39.952-23.066.011-3.903 39.952 23.066zM44.62 45.041l-.011 3.902-26.577-15.344.011-3.902L44.62 45.041z"
|
|
218
|
+
}), React.createElement("path", {
|
|
219
|
+
fill: `url(#${chatBubbleID}-d)`,
|
|
220
|
+
d: "M60.756 30.548a2.507 2.507 0 0 1 .146.8l-.011 3.952a3.98 3.98 0 0 1 .413-.125l.011-3.826a3.541 3.541 0 0 0-1.628-2.821L16.864 3.8a1.976 1.976 0 0 0-.445-.192l-.775.45c.006 0 .015 0 .021-.008a.722.722 0 0 1 .188-.071h.015a.822.822 0 0 1 .151-.015h.101a1.087 1.087 0 0 1 .233.051c.014 0 .027.01.041.015a1.654 1.654 0 0 1 .264.121l21.411 12.37 21.412 12.362a3.155 3.155 0 0 1 1.275 1.665Z"
|
|
221
|
+
}));
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/*
|
|
225
|
+
* Copyright IBM Corp. 2025
|
|
226
|
+
*
|
|
227
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
228
|
+
* LICENSE file in the root directory of this source tree.
|
|
229
|
+
*
|
|
230
|
+
* @license
|
|
231
|
+
*/ function ChatBubbleLight() {
|
|
232
|
+
const chatBubbleID = "cbl-";
|
|
233
|
+
return React.createElement("svg", {
|
|
234
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
235
|
+
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
236
|
+
viewBox: "0 0 80 80",
|
|
237
|
+
className: "chat-bubble-light"
|
|
238
|
+
}, React.createElement("defs", null, React.createElement("linearGradient", {
|
|
239
|
+
id: `${chatBubbleID}-a`,
|
|
240
|
+
x1: 61.44,
|
|
241
|
+
x2: 61.44,
|
|
242
|
+
y1: 66.99,
|
|
243
|
+
y2: 60.01,
|
|
244
|
+
gradientUnits: "userSpaceOnUse"
|
|
245
|
+
}, React.createElement("stop", {
|
|
246
|
+
offset: 0,
|
|
247
|
+
stopColor: "#c6c6c6"
|
|
248
|
+
}), React.createElement("stop", {
|
|
249
|
+
offset: .78,
|
|
250
|
+
stopColor: "#e0e0e0"
|
|
251
|
+
})), React.createElement("linearGradient", {
|
|
252
|
+
id: `${chatBubbleID}-b`,
|
|
253
|
+
x1: 28.49,
|
|
254
|
+
x2: 53.04,
|
|
255
|
+
y1: 44.06,
|
|
256
|
+
y2: 86.58,
|
|
257
|
+
gradientUnits: "userSpaceOnUse"
|
|
258
|
+
}, React.createElement("stop", {
|
|
259
|
+
offset: 0,
|
|
260
|
+
stopColor: "#525252",
|
|
261
|
+
stopOpacity: .05
|
|
262
|
+
}), React.createElement("stop", {
|
|
263
|
+
offset: 1,
|
|
264
|
+
stopOpacity: .1
|
|
265
|
+
})), React.createElement("linearGradient", {
|
|
266
|
+
id: `${chatBubbleID}-c`,
|
|
267
|
+
x1: 30.05,
|
|
268
|
+
x2: 35.5,
|
|
269
|
+
y1: 54.31,
|
|
270
|
+
y2: 54.31,
|
|
271
|
+
gradientUnits: "userSpaceOnUse"
|
|
272
|
+
}, React.createElement("stop", {
|
|
273
|
+
offset: 0,
|
|
274
|
+
stopColor: "#a4a4a4"
|
|
275
|
+
}), React.createElement("stop", {
|
|
276
|
+
offset: 1,
|
|
277
|
+
stopColor: "#bebebe"
|
|
278
|
+
})), React.createElement("linearGradient", {
|
|
279
|
+
id: `${chatBubbleID}-d`,
|
|
280
|
+
x1: 28.61,
|
|
281
|
+
x2: 70.69,
|
|
282
|
+
y1: -3.97,
|
|
283
|
+
y2: 68.92,
|
|
284
|
+
gradientUnits: "userSpaceOnUse"
|
|
285
|
+
}, React.createElement("stop", {
|
|
286
|
+
offset: 0,
|
|
287
|
+
stopColor: "#f4f4f4"
|
|
288
|
+
}), React.createElement("stop", {
|
|
289
|
+
offset: .52,
|
|
290
|
+
stopColor: "#e0e0e0"
|
|
291
|
+
}), React.createElement("stop", {
|
|
292
|
+
offset: .56,
|
|
293
|
+
stopColor: "#d8d8d8"
|
|
294
|
+
}), React.createElement("stop", {
|
|
295
|
+
offset: .61,
|
|
296
|
+
stopColor: "#c6c6c6"
|
|
297
|
+
}), React.createElement("stop", {
|
|
298
|
+
offset: .89,
|
|
299
|
+
stopColor: "#a8a8a8"
|
|
300
|
+
}), React.createElement("stop", {
|
|
301
|
+
offset: .96,
|
|
302
|
+
stopColor: "#8d8d8d"
|
|
303
|
+
})), React.createElement("linearGradient", {
|
|
304
|
+
xlinkHref: `#${chatBubbleID}-a`,
|
|
305
|
+
id: `${chatBubbleID}-e`,
|
|
306
|
+
x1: 38.01,
|
|
307
|
+
x2: 38.01,
|
|
308
|
+
y1: 59.43,
|
|
309
|
+
y2: 3.27
|
|
310
|
+
}), React.createElement("linearGradient", {
|
|
311
|
+
id: `${chatBubbleID}-f`,
|
|
312
|
+
x1: 21.52,
|
|
313
|
+
x2: 61.39,
|
|
314
|
+
y1: 36.2,
|
|
315
|
+
y2: 36.2,
|
|
316
|
+
gradientUnits: "userSpaceOnUse"
|
|
317
|
+
}, React.createElement("stop", {
|
|
318
|
+
offset: 0,
|
|
319
|
+
stopColor: "#e0e0e0"
|
|
320
|
+
}), React.createElement("stop", {
|
|
321
|
+
offset: 1,
|
|
322
|
+
stopColor: "#c6c6c6"
|
|
323
|
+
})), React.createElement("linearGradient", {
|
|
324
|
+
id: `${chatBubbleID}-h`,
|
|
325
|
+
x1: 17.68,
|
|
326
|
+
x2: 55.37,
|
|
327
|
+
y1: 15.75,
|
|
328
|
+
y2: 37.5,
|
|
329
|
+
gradientUnits: "userSpaceOnUse"
|
|
330
|
+
}, React.createElement("stop", {
|
|
331
|
+
offset: 0,
|
|
332
|
+
stopColor: "#fff"
|
|
333
|
+
}), React.createElement("stop", {
|
|
334
|
+
offset: .05,
|
|
335
|
+
stopColor: "#fdfdfd"
|
|
336
|
+
}), React.createElement("stop", {
|
|
337
|
+
offset: .3,
|
|
338
|
+
stopColor: "#f6f6f6"
|
|
339
|
+
}), React.createElement("stop", {
|
|
340
|
+
offset: 1,
|
|
341
|
+
stopColor: "#f4f4f4"
|
|
342
|
+
})), React.createElement("linearGradient", {
|
|
343
|
+
xlinkHref: `#${chatBubbleID}-h`,
|
|
344
|
+
id: `${chatBubbleID}-i`,
|
|
345
|
+
x1: 14.24,
|
|
346
|
+
x2: 51.92,
|
|
347
|
+
y1: 21.81,
|
|
348
|
+
y2: 43.56
|
|
349
|
+
}), React.createElement("linearGradient", {
|
|
350
|
+
xlinkHref: `#${chatBubbleID}-h`,
|
|
351
|
+
id: `${chatBubbleID}-j`,
|
|
352
|
+
x1: 10.96,
|
|
353
|
+
x2: 48.66,
|
|
354
|
+
y1: 27.56,
|
|
355
|
+
y2: 49.33
|
|
356
|
+
}), React.createElement("linearGradient", {
|
|
357
|
+
id: `${chatBubbleID}-k`,
|
|
358
|
+
x1: 15.14,
|
|
359
|
+
x2: 63.06,
|
|
360
|
+
y1: 5.72,
|
|
361
|
+
y2: 33.52,
|
|
362
|
+
gradientUnits: "userSpaceOnUse"
|
|
363
|
+
}, React.createElement("stop", {
|
|
364
|
+
offset: .78,
|
|
365
|
+
stopColor: "#fff"
|
|
366
|
+
}), React.createElement("stop", {
|
|
367
|
+
offset: .8,
|
|
368
|
+
stopColor: "#fefefe",
|
|
369
|
+
stopOpacity: .98
|
|
370
|
+
}), React.createElement("stop", {
|
|
371
|
+
offset: .82,
|
|
372
|
+
stopColor: "#fcfcfc",
|
|
373
|
+
stopOpacity: .93
|
|
374
|
+
}), React.createElement("stop", {
|
|
375
|
+
offset: .85,
|
|
376
|
+
stopColor: "#f8f8f8",
|
|
377
|
+
stopOpacity: .84
|
|
378
|
+
}), React.createElement("stop", {
|
|
379
|
+
offset: .87,
|
|
380
|
+
stopColor: "#f2f2f2",
|
|
381
|
+
stopOpacity: .72
|
|
382
|
+
}), React.createElement("stop", {
|
|
383
|
+
offset: .9,
|
|
384
|
+
stopColor: "#eaeaea",
|
|
385
|
+
stopOpacity: .56
|
|
386
|
+
}), React.createElement("stop", {
|
|
387
|
+
offset: .93,
|
|
388
|
+
stopColor: "#e1e1e1",
|
|
389
|
+
stopOpacity: .37
|
|
390
|
+
}), React.createElement("stop", {
|
|
391
|
+
offset: .95,
|
|
392
|
+
stopColor: "#d7d7d7",
|
|
393
|
+
stopOpacity: .14
|
|
394
|
+
}), React.createElement("stop", {
|
|
395
|
+
offset: .97,
|
|
396
|
+
stopColor: "#d0d0d0",
|
|
397
|
+
stopOpacity: 0
|
|
398
|
+
}))), React.createElement("path", {
|
|
399
|
+
d: "M0 0h80v80H0z",
|
|
400
|
+
className: "chat-bubble-light__background"
|
|
401
|
+
}), React.createElement("path", {
|
|
402
|
+
d: "M61.3 68.11a.67.67 0 0 0 .09-.14.67.67 0 0 1-.09.14Zm.22-.46a1.58 1.58 0 0 0 0-.32v-7.24 7.24a1.58 1.58 0 0 1 0 .32Zm-.09.26a1.18 1.18 0 0 0 .07-.2 1.18 1.18 0 0 1-.07.2Z",
|
|
403
|
+
className: "chat-bubble-light__gradient-a"
|
|
404
|
+
}), React.createElement("path", {
|
|
405
|
+
d: "m15.13 52.11 45.5 26.28 4.25-2.51L19.4 49.63l-4.27 2.48z",
|
|
406
|
+
className: "chat-bubble-light__gradient-b"
|
|
407
|
+
}), React.createElement("path", {
|
|
408
|
+
d: "m32.66 52.85-2.25 4.22a1.08 1.08 0 0 1-.36.35l2.83-1.65a1.08 1.08 0 0 0 .36-.35l2.26-4.22Z",
|
|
409
|
+
className: "chat-bubble-light__gradient-c"
|
|
410
|
+
}), React.createElement("path", {
|
|
411
|
+
d: "M63.45 26.58 20.63 1.86a1 1 0 0 0-1-.1l-4 2.3a1 1 0 0 1 1 .1l42.85 24.72a3.17 3.17 0 0 1 1.42 2.47l-.1 36.08a1 1 0 0 1-.42.91l4-2.3a1 1 0 0 0 .42-.91L64.88 29a3.14 3.14 0 0 0-1.43-2.42Z",
|
|
412
|
+
className: "chat-bubble-light__gradient-d"
|
|
413
|
+
}), React.createElement("path", {
|
|
414
|
+
d: "M59.48 28.88a3.17 3.17 0 0 1 1.42 2.47l-.1 36.08c0 .9-.65 1.26-1.42.81l-26.7-15.4-2.26 4.22a.9.9 0 0 1-1.33.28 3.07 3.07 0 0 1-1.22-1.53l-2.33-7.09-9-5.2a3.15 3.15 0 0 1-1.43-2.46L15.23 5c0-.9.64-1.27 1.43-.81Z",
|
|
415
|
+
className: "chat-bubble-light__gradient-e"
|
|
416
|
+
}), React.createElement("path", {
|
|
417
|
+
d: "M59.48 28.88a3.17 3.17 0 0 1 1.42 2.47l-.1 36.08c0 .9-.65 1.26-1.42.81l-26.7-15.4-2.26 4.22a.9.9 0 0 1-1.33.28 3.07 3.07 0 0 1-1.22-1.53l-2.33-7.09-9-5.2a3.15 3.15 0 0 1-1.43-2.46L15.23 5c0-.9.64-1.27 1.43-.81Z",
|
|
418
|
+
className: "chat-bubble-light__gradient-f"
|
|
419
|
+
}), React.createElement("path", {
|
|
420
|
+
d: "M59.48 28.88a3.17 3.17 0 0 1 1.42 2.47l-.1 36.08c0 .9-.65 1.26-1.42.81l-26.7-15.4-2.26 4.22a.9.9 0 0 1-1.33.28 3.07 3.07 0 0 1-1.22-1.53l-2.33-7.09-9-5.2a3.15 3.15 0 0 1-1.43-2.46L15.23 5c0-.9.64-1.27 1.43-.81Z",
|
|
421
|
+
className: "chat-bubble-light__gradient-e-duplicate"
|
|
422
|
+
}), React.createElement("path", {
|
|
423
|
+
d: "m57.99 37.07-.01 3.9L18.03 17.9l.01-3.9 39.95 23.07z",
|
|
424
|
+
className: "chat-bubble-light__gradient-h"
|
|
425
|
+
}), React.createElement("path", {
|
|
426
|
+
d: "m57.99 45.11-.01 3.91-39.95-23.07.01-3.9 39.95 23.06z",
|
|
427
|
+
className: "chat-bubble-light__gradient-i"
|
|
428
|
+
}), React.createElement("path", {
|
|
429
|
+
d: "m44.62 45.04-.01 3.9L18.03 33.6l.01-3.9 26.58 15.34z",
|
|
430
|
+
className: "chat-bubble-light__gradient-j"
|
|
431
|
+
}), React.createElement("path", {
|
|
432
|
+
d: "M60.76 30.55a2.54 2.54 0 0 1 .14.8v3.95l.41-.13v-3.82a3.54 3.54 0 0 0-1.63-2.82L16.86 3.8a2.09 2.09 0 0 0-.44-.19l-.78.45a1 1 0 0 1 .21-.06h.48l.27.12 21.47 12.4 21.41 12.36a3.19 3.19 0 0 1 1.28 1.67Z",
|
|
433
|
+
className: "chat-bubble-light__gradient-k"
|
|
434
|
+
}));
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
/*
|
|
438
|
+
* Copyright IBM Corp. 2025
|
|
439
|
+
*
|
|
440
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
441
|
+
* LICENSE file in the root directory of this source tree.
|
|
442
|
+
*
|
|
443
|
+
* @license
|
|
444
|
+
*/ function SimpleHeader(props, ref) {
|
|
445
|
+
const {useAITheme: useAITheme, onClose: onClose, testIdPrefix: testIdPrefix} = props;
|
|
446
|
+
const headerRef = useRef();
|
|
447
|
+
useImperativeHandle(ref, () => headerRef.current);
|
|
448
|
+
return React.createElement(HeaderExport, {
|
|
449
|
+
ref: headerRef,
|
|
450
|
+
onClickClose: onClose,
|
|
451
|
+
showCenter: true,
|
|
452
|
+
useAITheme: useAITheme,
|
|
453
|
+
testIdPrefix: testIdPrefix
|
|
454
|
+
});
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
const SimpleHeaderExport = React.memo(forwardRef(SimpleHeader));
|
|
458
|
+
|
|
459
|
+
/*
|
|
460
|
+
* Copyright IBM Corp. 2025
|
|
461
|
+
*
|
|
462
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
463
|
+
* LICENSE file in the root directory of this source tree.
|
|
464
|
+
*
|
|
465
|
+
* @license
|
|
466
|
+
*/ function MaybeDangerouslySetInnerHTML({html: html, overrideSanitize: overrideSanitize, className: className, id: id, asSpan: asSpan}) {
|
|
467
|
+
let doSanitize = useShouldSanitizeHTML();
|
|
468
|
+
if (overrideSanitize !== undefined) {
|
|
469
|
+
doSanitize = overrideSanitize;
|
|
470
|
+
}
|
|
471
|
+
if (doSanitize) {
|
|
472
|
+
html = sanitizeHTML(html);
|
|
473
|
+
}
|
|
474
|
+
if (asSpan) {
|
|
475
|
+
return React.createElement("span", {
|
|
476
|
+
id: id,
|
|
477
|
+
className: className,
|
|
478
|
+
dangerouslySetInnerHTML: {
|
|
479
|
+
__html: html
|
|
480
|
+
}
|
|
481
|
+
});
|
|
482
|
+
}
|
|
483
|
+
return React.createElement("div", {
|
|
484
|
+
id: id,
|
|
485
|
+
className: className,
|
|
486
|
+
dangerouslySetInnerHTML: {
|
|
487
|
+
__html: html
|
|
488
|
+
}
|
|
489
|
+
});
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
const MaybeDangerouslySetInnerHTMLExport = React.memo(MaybeDangerouslySetInnerHTML);
|
|
493
|
+
|
|
494
|
+
/*
|
|
495
|
+
* Copyright IBM Corp. 2025
|
|
496
|
+
*
|
|
497
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
498
|
+
* LICENSE file in the root directory of this source tree.
|
|
499
|
+
*
|
|
500
|
+
* @license
|
|
501
|
+
*/ function Disclaimer({onAcceptDisclaimer: onAcceptDisclaimer, onClose: onClose, disclaimerHTML: disclaimerHTML, disclaimerAcceptButtonRef: disclaimerAcceptButtonRef}) {
|
|
502
|
+
const languagePack = useLanguagePack();
|
|
503
|
+
const chatWidthBreakpoint = useSelector(state => state.chatWidthBreakpoint);
|
|
504
|
+
const {carbonTheme: carbonTheme, useAITheme: useAITheme} = useSelector(state => state.theme);
|
|
505
|
+
const isDarkTheme = carbonTheme === CarbonTheme.G90 || carbonTheme === CarbonTheme.G100;
|
|
506
|
+
const [hasReadDisclaimer, setHasReadDisclaimer] = useState(false);
|
|
507
|
+
const disclaimerContent = useRef();
|
|
508
|
+
const onScroll = () => {
|
|
509
|
+
const {scrollTop: scrollTop, scrollHeight: scrollHeight, clientHeight: clientHeight} = disclaimerContent.current;
|
|
510
|
+
const scrollBottom = clientHeight - scrollHeight + scrollTop;
|
|
511
|
+
if (scrollBottom >= 0) {
|
|
512
|
+
setHasReadDisclaimer(true);
|
|
513
|
+
}
|
|
514
|
+
};
|
|
515
|
+
useOnMount(() => {
|
|
516
|
+
onScroll();
|
|
517
|
+
});
|
|
518
|
+
function renderChatBubble() {
|
|
519
|
+
return isDarkTheme ? React.createElement(ChatBubbleDark, null) : React.createElement(ChatBubbleLight, null);
|
|
520
|
+
}
|
|
521
|
+
return React.createElement("div", {
|
|
522
|
+
className: "WACDisclaimerContainer"
|
|
523
|
+
}, React.createElement("div", {
|
|
524
|
+
className: "WAC__disclaimer"
|
|
525
|
+
}, React.createElement(SimpleHeaderExport, {
|
|
526
|
+
useAITheme: useAITheme,
|
|
527
|
+
onClose: onClose,
|
|
528
|
+
testIdPrefix: OverlayPanelName.DISCLAIMER
|
|
529
|
+
}), React.createElement("div", {
|
|
530
|
+
className: "WACPanelContent WAC__disclaimer-content",
|
|
531
|
+
onScroll: onScroll,
|
|
532
|
+
ref: disclaimerContent
|
|
533
|
+
}, React.createElement("div", {
|
|
534
|
+
className: "WAC__disclaimer-icon"
|
|
535
|
+
}, renderChatBubble()), React.createElement("h1", {
|
|
536
|
+
className: "WAC__disclaimer-title"
|
|
537
|
+
}, languagePack.disclaimer_title), React.createElement(MaybeDangerouslySetInnerHTMLExport, {
|
|
538
|
+
className: "WAC__disclaimer-description",
|
|
539
|
+
html: disclaimerHTML
|
|
540
|
+
})), React.createElement("div", {
|
|
541
|
+
className: "WAC__disclaimer-buttons"
|
|
542
|
+
}, React.createElement("div", {
|
|
543
|
+
className: "WAC__disclaimer-buttonsPadding"
|
|
544
|
+
}, React.createElement(Button, {
|
|
545
|
+
className: "WAC__disclaimer-acceptButton",
|
|
546
|
+
ref: disclaimerAcceptButtonRef,
|
|
547
|
+
onClick: onAcceptDisclaimer,
|
|
548
|
+
size: chatWidthBreakpoint === ChatWidthBreakpoint.WIDE ? "2xl" : "lg",
|
|
549
|
+
disabled: !hasReadDisclaimer
|
|
550
|
+
}, languagePack.disclaimer_accept)))));
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
export { Disclaimer, Disclaimer as default };
|