@envive-ai/react-widgets-v3 0.3.10 → 0.3.12
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/CXIntegration/hooks/useUnifiedCXButton.cjs +2 -1
- package/dist/CXIntegration/hooks/useUnifiedCXButton.js +2 -1
- package/dist/CXIntegration/implementations/useGladlyUnifiedCXButton.cjs +6 -0
- package/dist/CXIntegration/implementations/useGladlyUnifiedCXButton.js +6 -0
- package/dist/CXIntegration/implementations/useGorgiasUnifiedCXButton.cjs +7 -6
- package/dist/CXIntegration/implementations/useGorgiasUnifiedCXButton.js +7 -6
- package/dist/CXIntegration/implementations/useGrooveUnifiedCXButton.cjs +10 -11
- package/dist/CXIntegration/implementations/useGrooveUnifiedCXButton.js +10 -11
- package/dist/CXIntegration/implementations/useKustomerUnifiedCXButton.cjs +10 -7
- package/dist/CXIntegration/implementations/useKustomerUnifiedCXButton.js +10 -7
- package/dist/CXIntegration/implementations/useReDoUnifiedCXButton.cjs +2 -2
- package/dist/CXIntegration/implementations/useReDoUnifiedCXButton.js +2 -2
- package/dist/CXIntegration/implementations/useRichpanelUnifiedCXButton.cjs +9 -7
- package/dist/CXIntegration/implementations/useRichpanelUnifiedCXButton.js +9 -7
- package/dist/CXIntegration/implementations/useShopifyChatUnifiedCXButton.cjs +13 -16
- package/dist/CXIntegration/implementations/useShopifyChatUnifiedCXButton.js +13 -16
- package/dist/CXIntegration/implementations/useTidioUnifiedCXButton.cjs +6 -0
- package/dist/CXIntegration/implementations/useTidioUnifiedCXButton.js +6 -0
- package/dist/CXIntegration/implementations/useZendeskUnifiedCXButton.cjs +7 -5
- package/dist/CXIntegration/implementations/useZendeskUnifiedCXButton.js +7 -5
- package/dist/CXIntegration/implementations/useZowieUnifiedCXButton.cjs +6 -0
- package/dist/CXIntegration/implementations/useZowieUnifiedCXButton.js +6 -0
- package/dist/_virtual/rolldown_runtime.cjs +2 -0
- package/dist/debug/GenericSelect.cjs +167 -0
- package/dist/debug/GenericSelect.js +165 -0
- package/dist/debug/MessageContent.cjs +151 -0
- package/dist/debug/MessageContent.js +149 -0
- package/dist/debug/chatEmbed.cjs +95 -0
- package/dist/debug/chatEmbed.js +92 -0
- package/dist/debug/debugBar.cjs +17 -0
- package/dist/debug/debugBar.js +16 -0
- package/dist/debug/reportIssue.cjs +528 -0
- package/dist/debug/reportIssue.js +524 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/apis/CustomerServiceApi.cjs +265 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/apis/DefaultApi.cjs +591 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/apis/InferenceApi.cjs +265 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/apis/ProductsApi.cjs +105 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/apis/SearchApi.cjs +229 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/apis/index.cjs +43 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/index.cjs +39 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/AddNoteToLatestConversationRequest.cjs +68 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/AddNoteToLatestConversationResponse.cjs +60 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/AddToCartAttributes.cjs +53 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/AnalyticsIdentifyRequest.cjs +86 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/AnalyticsTrackEventRequest.cjs +62 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/AttachmentRequest.cjs +63 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/AutoForm.cjs +55 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/Context.cjs +89 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ConversationStatus.cjs +63 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/CreateConversationRequest.cjs +68 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/CreateConversationResponse.cjs +64 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/CustServiceAttachment.cjs +68 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/CustServiceConversation.cjs +69 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/CustServiceConversationMessages.cjs +67 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/CustServiceCustomer.cjs +60 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/CustServiceMessage.cjs +85 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/CustomerServiceProvider.cjs +63 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/FormResponseAttributes.cjs +61 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/FormResponseAttributesFormCategory.cjs +55 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/FormSubmittedAttributes.cjs +65 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/FormType.cjs +61 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/FulfillmentDisplayStatus.cjs +84 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/GenerationParams.cjs +74 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/GetConversationMessagesRequest.cjs +61 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/IsBusinessHoursRequest.cjs +54 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/IsBusinessHoursResponse.cjs +59 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/LabelValue.cjs +60 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ManualForm.cjs +55 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/MerchRule.cjs +70 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/MerchRuleAction.cjs +62 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/MerchRuleActionAttribute.cjs +58 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/MerchRuleActionType.cjs +64 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/MerchRuleCondition.cjs +60 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/MerchRuleOp.cjs +61 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/MerchRuleStatus.cjs +62 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/NextMessageRequest.cjs +78 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/OrderItemInfo.cjs +78 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/OrderResponseAttributes.cjs +71 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/Organization.cjs +83 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/OrganizationConfig.cjs +82 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/OrganizationConfigResults.cjs +70 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/OrganizationSettings.cjs +62 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/PDPAttributes.cjs +61 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/PLPAttributeCategory.cjs +61 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/PLPAttributes.cjs +64 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/PLPAttributesAttributes.cjs +55 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/PLPIdAttributes.cjs +53 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/PLPUrlAttributes.cjs +53 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/PageVisitAttributes.cjs +62 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/PageVisitCategory.cjs +65 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ProductRetrievalRequest.cjs +62 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ProductRetrievalResponse.cjs +55 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ProductSearchFilterResponseAttributes.cjs +53 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ProductSearchRequest.cjs +71 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ProductSearchResponse.cjs +64 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ProductSearchResponseAttributes.cjs +60 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ProductSearchResponseV2.cjs +64 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/QueryTypedAttributes.cjs +53 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ReportContent.cjs +59 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ReportSessionRequest.cjs +99 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/Response.cjs +68 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ResponseCategory.cjs +69 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ResponseProductAttributes.cjs +91 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/SearchAttributes.cjs +65 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/SearchResponseProduct.cjs +93 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/SearchSuggestionsResponse.cjs +58 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/SendMessageRequest.cjs +71 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/SendMessageResponse.cjs +55 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/StatsigExperiment.cjs +64 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/StatsigFeatureGate.cjs +62 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/Suggestion.cjs +70 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/SuggestionCategory.cjs +62 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/SuggestionClickedAttributes.cjs +53 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/SupportedEventProductCategory.cjs +62 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/SupportedEventRequest.cjs +67 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/SupportedEventResponse.cjs +78 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/TurnInfo.cjs +70 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/TurnInfoPrevUserEvent.cjs +60 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/UrlResolvingGenericConfig.cjs +52 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/UrlResolvingPDPConfig.cjs +65 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/UrlResolvingPLPConfig.cjs +61 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/UrlResolvingRequest.cjs +69 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/UrlResolvingResponse.cjs +73 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/UrlResolvingResponseSpecificDetails.cjs +59 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/UrlResolvingType.cjs +67 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/UserEvent.cjs +69 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/UserEventAttributes.cjs +75 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/UserEventCategory.cjs +70 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/V1GetSessionMessages200Response.cjs +67 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/V1SearchExplainGet200Response.cjs +63 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/WidgetString.cjs +60 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/WidgetTextRequest.cjs +75 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/WidgetTextResponse.cjs +66 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/WidgetType.cjs +69 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/index.cjs +221 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/runtime.cjs +324 -0
- package/dist/node_modules/react-icons/fa/index.cjs +65 -0
- package/dist/node_modules/react-icons/fa/index.js +61 -0
- package/dist/node_modules/react-icons/lib/iconBase.cjs +121 -0
- package/dist/node_modules/react-icons/lib/iconBase.js +119 -0
- package/dist/node_modules/react-icons/lib/iconContext.cjs +17 -0
- package/dist/node_modules/react-icons/lib/iconContext.js +14 -0
- package/dist/packages/icons/dist/IconCloseVariant.cjs +22 -0
- package/dist/packages/icons/dist/IconCloseVariant.js +22 -0
- package/dist/packages/icons/dist/_virtual/rolldown_runtime.cjs +27 -0
- package/dist/packages/icons/dist/_virtual/rolldown_runtime.js +25 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react-jsx-runtime.development.cjs +696 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react-jsx-runtime.development.js +696 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react-jsx-runtime.production.min.cjs +43 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react-jsx-runtime.production.min.js +43 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react.development.cjs +1528 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react.development.js +1528 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react.production.min.cjs +329 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react.production.min.js +329 -0
- package/dist/packages/icons/dist/node_modules/react/index.cjs +13 -0
- package/dist/packages/icons/dist/node_modules/react/index.js +13 -0
- package/dist/packages/icons/dist/node_modules/react/jsx-runtime.cjs +13 -0
- package/dist/packages/icons/dist/node_modules/react/jsx-runtime.js +13 -0
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.cjs +3 -3
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.cts +3 -3
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.ts +3 -3
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.js +3 -3
- package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.cts +3 -3
- package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.ts +3 -3
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.cjs +3 -3
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.cts +3 -3
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.ts +3 -3
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.js +3 -3
- package/dist/widgets/FloatingChatWidget/FloatingChatOverlay.cjs +2 -2
- package/dist/widgets/FloatingChatWidget/FloatingChatOverlay.js +1 -1
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.cjs +66 -36
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.cts +2 -2
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.ts +2 -2
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.js +67 -37
- package/dist/widgets/FloatingChatWidget/hooks/useAutoPopup.cjs +50 -0
- package/dist/widgets/FloatingChatWidget/hooks/useAutoPopup.js +49 -0
- package/dist/widgets/FloatingChatWidget/hooks/useFloatingButtonVisibility.cjs +4 -1
- package/dist/widgets/FloatingChatWidget/hooks/useFloatingButtonVisibility.js +5 -2
- package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.cjs +31 -0
- package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.cts +15 -0
- package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.ts +15 -0
- package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.js +30 -0
- package/dist/widgets/FullPageSalesAgentWidget/index.cjs +3 -0
- package/dist/widgets/FullPageSalesAgentWidget/index.d.cts +2 -0
- package/dist/widgets/FullPageSalesAgentWidget/index.d.ts +2 -0
- package/dist/widgets/FullPageSalesAgentWidget/index.js +3 -0
- package/dist/widgets/ProductCardWidget/ProductCardWidget.cjs +3 -2
- package/dist/widgets/ProductCardWidget/ProductCardWidget.d.cts +2 -2
- package/dist/widgets/ProductCardWidget/ProductCardWidget.d.ts +2 -2
- package/dist/widgets/ProductCardWidget/ProductCardWidget.js +3 -2
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.cjs +4 -3
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.cts +3 -3
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.ts +3 -3
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.js +4 -3
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.cjs +29 -5
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.cts +2 -2
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.ts +2 -2
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.js +30 -6
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.cts +2 -2
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.ts +2 -2
- package/dist/widgets/SocialProofWidget/SocialProofWidget.cjs +8 -6
- package/dist/widgets/SocialProofWidget/SocialProofWidget.d.cts +3 -3
- package/dist/widgets/SocialProofWidget/SocialProofWidget.js +8 -6
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.cjs +4 -3
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.cts +2 -2
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.ts +2 -2
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.js +4 -3
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.cts +2 -2
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.ts +2 -2
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.cjs +3 -2
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.cts +3 -3
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.ts +3 -3
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.js +3 -2
- package/dist/widgets/utils/functions.cjs +1 -1
- package/dist/widgets/utils/functions.js +1 -1
- package/dist/widgets-v2/SearchResults/index.d.ts +3 -3
- package/dist/widgets-v2/SearchZeroState/index.d.ts +4 -4
- package/dist/widgets-v2/SuggestionBar/index.d.ts +3 -3
- package/dist/widgets-v2/SuggestionButtonContainer/index.d.ts +2 -2
- package/package.json +5 -1
- package/src/CXIntegration/hooks/useUnifiedCXButton.ts +4 -1
- package/src/CXIntegration/implementations/useGladlyUnifiedCXButton.ts +5 -0
- package/src/CXIntegration/implementations/useGorgiasUnifiedCXButton.ts +11 -8
- package/src/CXIntegration/implementations/useGrooveUnifiedCXButton.ts +12 -15
- package/src/CXIntegration/implementations/useKustomerUnifiedCXButton.ts +11 -11
- package/src/CXIntegration/implementations/useReDoUnifiedCXButton.ts +2 -4
- package/src/CXIntegration/implementations/useRichpanelUnifiedCXButton.ts +9 -10
- package/src/CXIntegration/implementations/useShopifyChatUnifiedCXButton.ts +18 -28
- package/src/CXIntegration/implementations/useTidioUnifiedCXButton.ts +5 -0
- package/src/CXIntegration/implementations/useZendeskUnifiedCXButton.ts +11 -6
- package/src/CXIntegration/implementations/useZowieUnifiedCXButton.ts +5 -0
- package/src/CXIntegration/types.ts +1 -0
- package/src/debug/GenericSelect.tsx +236 -0
- package/src/debug/MessageContent.tsx +248 -0
- package/src/debug/chatEmbed.tsx +119 -0
- package/src/debug/debugBar.tsx +12 -0
- package/src/debug/reportIssue.tsx +649 -0
- package/src/hocs/withBaseWidget/__tests__/withBaseWidget.test.tsx +6 -0
- package/src/stories/FullPageSalesAgentWidget.stories.tsx +68 -0
- package/src/stories/SalesAgentTest/SalesAgentTest.tsx +10 -2
- package/src/widgets/FloatingChatWidget/FloatingChatWidget.tsx +110 -65
- package/src/widgets/FloatingChatWidget/hooks/useAutoPopup.ts +65 -0
- package/src/widgets/FloatingChatWidget/hooks/useFloatingButtonVisibility.ts +11 -5
- package/src/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.tsx +46 -0
- package/src/widgets/FullPageSalesAgentWidget/index.ts +1 -0
- package/src/widgets/ProductCardWidget/ProductCardWidget.tsx +5 -1
- package/src/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.tsx +6 -1
- package/src/widgets/PromptCarouselWidget/PromptCarouselWidget.tsx +32 -3
- package/src/widgets/SocialProofWidget/SocialProofWidget.tsx +10 -2
- package/src/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.tsx +6 -2
- package/src/widgets/TypingAnimationWidget/TypingAnimationWidget.tsx +5 -1
- /package/dist/{widgets → packages/widgets}/dist/SearchResults/SearchResults.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/SearchResults/SearchResultsWidget.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/SearchResults/index.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/SearchResults/types.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/SearchZeroState/SearchZeroState.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/SearchZeroState/SearchZeroStateWidget.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/SearchZeroState/index.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/SearchZeroState/types.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/SuggestionBar/SuggestionBar.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/SuggestionBar/index.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/SuggestionBar/types.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/SuggestionButtonContainer/SuggestionButtonContainer.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/SuggestionButtonContainer/types.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/config/BaseWidgetConfig.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/config/WidgetType.d.ts +0 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../_virtual/rolldown_runtime.js";
|
|
2
|
+
import { require_react_jsx_runtime_production_min } from "./cjs/react-jsx-runtime.production.min.js";
|
|
3
|
+
import { require_react_jsx_runtime_development } from "./cjs/react-jsx-runtime.development.js";
|
|
4
|
+
|
|
5
|
+
//#region ../icons/dist/node_modules/react/jsx-runtime.js
|
|
6
|
+
var require_jsx_runtime = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
7
|
+
if (process.env.NODE_ENV === "production") module.exports = require_react_jsx_runtime_production_min();
|
|
8
|
+
else module.exports = require_react_jsx_runtime_development();
|
|
9
|
+
}));
|
|
10
|
+
var jsx_runtime_default = require_jsx_runtime();
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
export { require_jsx_runtime };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
const require_withBaseWidget = require('../../hocs/withBaseWidget/withBaseWidget.cjs');
|
|
3
|
-
const require_ChatPreviewLoadingWidget = require('../ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.cjs');
|
|
4
3
|
const require_functions = require('../utils/functions.cjs');
|
|
4
|
+
const require_ChatPreviewLoadingWidget = require('../ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.cjs');
|
|
5
5
|
let react = require("react");
|
|
6
6
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
7
|
let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
|
|
8
8
|
let jotai = require("jotai");
|
|
9
|
-
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
10
9
|
let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/react-hooks/contexts/salesAgentContext");
|
|
11
10
|
let __envive_ai_react_hooks_hooks_ChatToggle = require("@envive-ai/react-hooks/hooks/ChatToggle");
|
|
12
|
-
let __envive_ai_react_toolkit_v3_Tokens = require("@envive-ai/react-toolkit-v3/Tokens");
|
|
13
11
|
let __envive_ai_react_hooks_atoms_chat = require("@envive-ai/react-hooks/atoms/chat");
|
|
12
|
+
let __envive_ai_react_toolkit_v3_Tokens = require("@envive-ai/react-toolkit-v3/Tokens");
|
|
13
|
+
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
14
14
|
let __envive_ai_react_toolkit_v3_ChatPreviewComparison = require("@envive-ai/react-toolkit-v3/ChatPreviewComparison");
|
|
15
15
|
let __envive_ai_react_hooks_atoms_app = require("@envive-ai/react-hooks/atoms/app");
|
|
16
16
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime17 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.ts
|
|
5
5
|
declare const ChatPreviewComparisonWidgetWithBaseWidget: {
|
|
6
|
-
(props: BaseWidgetProps):
|
|
6
|
+
(props: BaseWidgetProps): react_jsx_runtime17.JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
9
|
interface ChatPreviewComparisonWidgetProps {
|
|
@@ -12,7 +12,7 @@ interface ChatPreviewComparisonWidgetProps {
|
|
|
12
12
|
declare const ChatPreviewComparisonWidget: {
|
|
13
13
|
({
|
|
14
14
|
widgetConfigId
|
|
15
|
-
}: ChatPreviewComparisonWidgetProps):
|
|
15
|
+
}: ChatPreviewComparisonWidgetProps): react_jsx_runtime17.JSX.Element;
|
|
16
16
|
displayName: string;
|
|
17
17
|
};
|
|
18
18
|
//#endregion
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime16 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.ts
|
|
5
5
|
declare const ChatPreviewComparisonWidgetWithBaseWidget: {
|
|
6
|
-
(props: BaseWidgetProps):
|
|
6
|
+
(props: BaseWidgetProps): react_jsx_runtime16.JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
9
|
interface ChatPreviewComparisonWidgetProps {
|
|
@@ -12,7 +12,7 @@ interface ChatPreviewComparisonWidgetProps {
|
|
|
12
12
|
declare const ChatPreviewComparisonWidget: {
|
|
13
13
|
({
|
|
14
14
|
widgetConfigId
|
|
15
|
-
}: ChatPreviewComparisonWidgetProps):
|
|
15
|
+
}: ChatPreviewComparisonWidgetProps): react_jsx_runtime16.JSX.Element;
|
|
16
16
|
displayName: string;
|
|
17
17
|
};
|
|
18
18
|
//#endregion
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { withBaseWidget } from "../../hocs/withBaseWidget/withBaseWidget.js";
|
|
2
|
-
import { ChatPreviewLoadingWidgetWithBaseWidget } from "../ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.js";
|
|
3
2
|
import { getMessageText, getRecentProductImageUrls } from "../utils/functions.js";
|
|
3
|
+
import { ChatPreviewLoadingWidgetWithBaseWidget } from "../ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.js";
|
|
4
4
|
import { useCallback, useMemo } from "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
7
7
|
import { useAtomValue } from "jotai";
|
|
8
|
-
import { ChatElementDisplayLocationV3, VariantTypeEnum } from "@envive-ai/react-hooks/application/models";
|
|
9
8
|
import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
|
|
10
9
|
import { useChatToggle } from "@envive-ai/react-hooks/hooks/ChatToggle";
|
|
11
|
-
import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
|
|
12
10
|
import { chatAtom, lastAssistantMessageAtom } from "@envive-ai/react-hooks/atoms/chat";
|
|
11
|
+
import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
|
|
12
|
+
import { ChatElementDisplayLocationV3, VariantTypeEnum } from "@envive-ai/react-hooks/application/models";
|
|
13
13
|
import { ChatPreviewComparison } from "@envive-ai/react-toolkit-v3/ChatPreviewComparison";
|
|
14
14
|
import { variantInfoAtom } from "@envive-ai/react-hooks/atoms/app";
|
|
15
15
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime4 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.ts
|
|
5
5
|
declare const ChatPreviewLoadingWidgetWithBaseWidget: {
|
|
6
|
-
(props: BaseWidgetProps):
|
|
6
|
+
(props: BaseWidgetProps): react_jsx_runtime4.JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
9
|
interface ChatPreviewLoadingWidgetProps {
|
|
@@ -11,6 +11,6 @@ interface ChatPreviewLoadingWidgetProps {
|
|
|
11
11
|
}
|
|
12
12
|
declare const ChatPreviewLoadingWidget: ({
|
|
13
13
|
widgetConfigId
|
|
14
|
-
}: ChatPreviewLoadingWidgetProps) =>
|
|
14
|
+
}: ChatPreviewLoadingWidgetProps) => react_jsx_runtime4.JSX.Element;
|
|
15
15
|
//#endregion
|
|
16
16
|
export { ChatPreviewLoadingWidget, ChatPreviewLoadingWidgetProps, ChatPreviewLoadingWidgetWithBaseWidget };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime13 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.ts
|
|
5
5
|
declare const ChatPreviewLoadingWidgetWithBaseWidget: {
|
|
6
|
-
(props: BaseWidgetProps):
|
|
6
|
+
(props: BaseWidgetProps): react_jsx_runtime13.JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
9
|
interface ChatPreviewLoadingWidgetProps {
|
|
@@ -11,6 +11,6 @@ interface ChatPreviewLoadingWidgetProps {
|
|
|
11
11
|
}
|
|
12
12
|
declare const ChatPreviewLoadingWidget: ({
|
|
13
13
|
widgetConfigId
|
|
14
|
-
}: ChatPreviewLoadingWidgetProps) =>
|
|
14
|
+
}: ChatPreviewLoadingWidgetProps) => react_jsx_runtime13.JSX.Element;
|
|
15
15
|
//#endregion
|
|
16
16
|
export { ChatPreviewLoadingWidget, ChatPreviewLoadingWidgetProps, ChatPreviewLoadingWidgetWithBaseWidget };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
const require_withBaseWidget = require('../../hocs/withBaseWidget/withBaseWidget.cjs');
|
|
3
|
-
const require_ChatPreviewLoadingWidget = require('../ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.cjs');
|
|
4
3
|
const require_functions = require('../utils/functions.cjs');
|
|
4
|
+
const require_ChatPreviewLoadingWidget = require('../ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.cjs');
|
|
5
5
|
let react = require("react");
|
|
6
6
|
let __envive_ai_react_hooks_contexts_amplitudeContext = require("@envive-ai/react-hooks/contexts/amplitudeContext");
|
|
7
7
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
8
|
let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
|
|
9
9
|
let jotai = require("jotai");
|
|
10
|
-
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
11
10
|
let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/react-hooks/contexts/salesAgentContext");
|
|
12
11
|
let __envive_ai_react_hooks_hooks_ChatToggle = require("@envive-ai/react-hooks/hooks/ChatToggle");
|
|
13
|
-
let __envive_ai_react_toolkit_v3_Tokens = require("@envive-ai/react-toolkit-v3/Tokens");
|
|
14
12
|
let __envive_ai_react_hooks_atoms_chat = require("@envive-ai/react-hooks/atoms/chat");
|
|
13
|
+
let __envive_ai_react_toolkit_v3_Tokens = require("@envive-ai/react-toolkit-v3/Tokens");
|
|
14
|
+
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
15
15
|
let __envive_ai_react_toolkit_v3_ChatPreview = require("@envive-ai/react-toolkit-v3/ChatPreview");
|
|
16
16
|
|
|
17
17
|
//#region src/widgets/ChatPreviewWidget/ChatPreviewWidget.tsx
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime15 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/widgets/ChatPreviewWidget/ChatPreviewWidget.d.ts
|
|
5
5
|
declare const ChatPreviewWidgetWithBaseWidget: {
|
|
6
|
-
(props: BaseWidgetProps):
|
|
6
|
+
(props: BaseWidgetProps): react_jsx_runtime15.JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
9
|
interface ChatPreviewWidgetProps {
|
|
@@ -12,7 +12,7 @@ interface ChatPreviewWidgetProps {
|
|
|
12
12
|
declare const ChatPreviewWidget: {
|
|
13
13
|
({
|
|
14
14
|
widgetConfigId
|
|
15
|
-
}: ChatPreviewWidgetProps):
|
|
15
|
+
}: ChatPreviewWidgetProps): react_jsx_runtime15.JSX.Element;
|
|
16
16
|
displayName: string;
|
|
17
17
|
};
|
|
18
18
|
//#endregion
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime18 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/widgets/ChatPreviewWidget/ChatPreviewWidget.d.ts
|
|
5
5
|
declare const ChatPreviewWidgetWithBaseWidget: {
|
|
6
|
-
(props: BaseWidgetProps):
|
|
6
|
+
(props: BaseWidgetProps): react_jsx_runtime18.JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
9
|
interface ChatPreviewWidgetProps {
|
|
@@ -12,7 +12,7 @@ interface ChatPreviewWidgetProps {
|
|
|
12
12
|
declare const ChatPreviewWidget: {
|
|
13
13
|
({
|
|
14
14
|
widgetConfigId
|
|
15
|
-
}: ChatPreviewWidgetProps):
|
|
15
|
+
}: ChatPreviewWidgetProps): react_jsx_runtime18.JSX.Element;
|
|
16
16
|
displayName: string;
|
|
17
17
|
};
|
|
18
18
|
//#endregion
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { withBaseWidget } from "../../hocs/withBaseWidget/withBaseWidget.js";
|
|
2
|
-
import { ChatPreviewLoadingWidgetWithBaseWidget } from "../ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.js";
|
|
3
2
|
import { getMessageText } from "../utils/functions.js";
|
|
3
|
+
import { ChatPreviewLoadingWidgetWithBaseWidget } from "../ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.js";
|
|
4
4
|
import { useCallback, useEffect, useMemo } from "react";
|
|
5
5
|
import { SpiffyMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
8
8
|
import { useAtomValue } from "jotai";
|
|
9
|
-
import { ChatElementDisplayLocationV3 } from "@envive-ai/react-hooks/application/models";
|
|
10
9
|
import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
|
|
11
10
|
import { useChatToggle } from "@envive-ai/react-hooks/hooks/ChatToggle";
|
|
12
|
-
import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
|
|
13
11
|
import { chatAtom, lastAssistantMessageAtom } from "@envive-ai/react-hooks/atoms/chat";
|
|
12
|
+
import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
|
|
13
|
+
import { ChatElementDisplayLocationV3 } from "@envive-ai/react-hooks/application/models";
|
|
14
14
|
import { ChatPreview } from "@envive-ai/react-toolkit-v3/ChatPreview";
|
|
15
15
|
|
|
16
16
|
//#region src/widgets/ChatPreviewWidget/ChatPreviewWidget.tsx
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
3
|
-
let react_dom = require("react-dom");
|
|
4
|
-
let framer_motion = require("framer-motion");
|
|
5
3
|
let classnames = require("classnames");
|
|
6
4
|
classnames = require_rolldown_runtime.__toESM(classnames);
|
|
5
|
+
let react_dom = require("react-dom");
|
|
6
|
+
let framer_motion = require("framer-motion");
|
|
7
7
|
|
|
8
8
|
//#region src/widgets/FloatingChatWidget/FloatingChatOverlay.tsx
|
|
9
9
|
const FloatingChatOverlay = ({ children, isOpened, onClose, className, dataTestId, previewMode = false }) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import classNames from "classnames";
|
|
2
3
|
import { createPortal } from "react-dom";
|
|
3
4
|
import { AnimatePresence, motion } from "framer-motion";
|
|
4
|
-
import classNames from "classnames";
|
|
5
5
|
|
|
6
6
|
//#region src/widgets/FloatingChatWidget/FloatingChatOverlay.tsx
|
|
7
7
|
const FloatingChatOverlay = ({ children, isOpened, onClose, className, dataTestId, previewMode = false }) => {
|
|
@@ -1,47 +1,69 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
const require_withBaseWidget = require('../../hocs/withBaseWidget/withBaseWidget.cjs');
|
|
3
3
|
require('../../hocs/withBaseWidget/index.cjs');
|
|
4
|
+
const require_debugBar = require('../../debug/debugBar.cjs');
|
|
4
5
|
const require_FloatingChatOverlay = require('./FloatingChatOverlay.cjs');
|
|
5
6
|
const require_useGetWidgetStatus = require('../hooks/useGetWidgetStatus.cjs');
|
|
6
7
|
const require_types = require('../../CXIntegration/types.cjs');
|
|
7
8
|
const require_constants = require('./constants.cjs');
|
|
8
9
|
const require_useUnifiedCXButton = require('../../CXIntegration/hooks/useUnifiedCXButton.cjs');
|
|
9
10
|
const require_useFloatingButtonVisibility = require('./hooks/useFloatingButtonVisibility.cjs');
|
|
11
|
+
const require_useAutoPopup = require('./hooks/useAutoPopup.cjs');
|
|
10
12
|
let react = require("react");
|
|
11
13
|
let __envive_ai_react_hooks_contexts_amplitudeContext = require("@envive-ai/react-hooks/contexts/amplitudeContext");
|
|
12
14
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
13
15
|
let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
|
|
14
|
-
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
15
16
|
let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/react-hooks/contexts/salesAgentContext");
|
|
16
17
|
let __envive_ai_react_hooks_hooks_ChatToggle = require("@envive-ai/react-hooks/hooks/ChatToggle");
|
|
17
18
|
let __envive_ai_react_toolkit_v3_Tokens = require("@envive-ai/react-toolkit-v3/Tokens");
|
|
19
|
+
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
18
20
|
let __envive_ai_react_toolkit_v3_FloatingButton = require("@envive-ai/react-toolkit-v3/FloatingButton");
|
|
19
21
|
|
|
20
22
|
//#region src/widgets/FloatingChatWidget/FloatingChatWidget.tsx
|
|
21
23
|
const FloatingChat = (0, react.lazy)(async () => ({ default: (await import("@envive-ai/react-toolkit-v3/FloatingChat")).FloatingChat }));
|
|
24
|
+
/**
|
|
25
|
+
* Wrapper component that isolates the useUnifiedCXButton hook call.
|
|
26
|
+
* Provider implementations use different React hooks internally, so the
|
|
27
|
+
* provider value must be stable across renders. Use a `key` prop based on
|
|
28
|
+
* provider to force a clean remount when the provider changes.
|
|
29
|
+
*/
|
|
30
|
+
const CXButtonProvider = ({ provider, enabled, suppressMerchantButton, onSwitchToAgent, onCXClose, children }) => {
|
|
31
|
+
const { isSwitchEnabled, toggle } = require_useUnifiedCXButton.useUnifiedCXButton({
|
|
32
|
+
provider,
|
|
33
|
+
enabled,
|
|
34
|
+
suppressMerchantButton,
|
|
35
|
+
onSwitchToAgent,
|
|
36
|
+
onCXClose
|
|
37
|
+
}) ?? {};
|
|
38
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: children({
|
|
39
|
+
isSwitchEnabled,
|
|
40
|
+
toggle
|
|
41
|
+
}) });
|
|
42
|
+
};
|
|
22
43
|
const FloatingChatWidgetHandler = (props) => {
|
|
23
44
|
const { previewButtonOnly, previewChatAlwaysOpen } = props;
|
|
24
45
|
const salesAgentData = (0, __envive_ai_react_hooks_contexts_salesAgentContext.useSalesAgent)();
|
|
25
46
|
const { userHasInteractedValue } = require_useGetWidgetStatus.default();
|
|
26
47
|
const { uiConfig, isUiConfigLoading, hardcopyContent } = props;
|
|
27
|
-
const {
|
|
28
|
-
|
|
29
|
-
enabled: false,
|
|
30
|
-
suppressMerchantButton: false
|
|
31
|
-
}) ?? {};
|
|
32
|
-
const { floatingButton } = uiConfig ?? {};
|
|
48
|
+
const { customerServiceIntegration, floatingButton, floatingChat } = uiConfig ?? {};
|
|
49
|
+
const cxProvider = customerServiceIntegration?.provider ?? require_types.CustomerServiceType.unsupported;
|
|
33
50
|
const { isOpen, openChat, closeChat } = (0, __envive_ai_react_hooks_hooks_ChatToggle.useChatToggle)();
|
|
51
|
+
const [isCXOpen, setIsCXOpen] = (0, react.useState)(false);
|
|
52
|
+
(0, react.useEffect)(() => {
|
|
53
|
+
if (isOpen) setIsCXOpen(false);
|
|
54
|
+
}, [isOpen]);
|
|
34
55
|
const { shouldShowFloatingButton } = require_useFloatingButtonVisibility.useFloatingButtonVisibility({
|
|
35
56
|
floatingButtonShowConfig: floatingButton?.showOption,
|
|
36
57
|
isChatOpen: isOpen,
|
|
37
58
|
userHasInteracted: userHasInteractedValue
|
|
38
59
|
});
|
|
39
60
|
const effectiveIsOpen = previewChatAlwaysOpen ? true : isOpen;
|
|
40
|
-
const buttonShouldRender = previewButtonOnly ? true : !effectiveIsOpen && shouldShowFloatingButton;
|
|
61
|
+
const buttonShouldRender = previewButtonOnly ? true : !effectiveIsOpen && shouldShowFloatingButton && !isCXOpen;
|
|
41
62
|
const theme = (0, react.useMemo)(() => {
|
|
42
63
|
if (isUiConfigLoading || !uiConfig) return __envive_ai_react_toolkit_v3_Tokens.Theme.STANDARD;
|
|
43
64
|
return uiConfig?.lookAndFeel?.theme ?? __envive_ai_react_toolkit_v3_Tokens.Theme.GLOBAL_CUSTOM;
|
|
44
65
|
}, [isUiConfigLoading, uiConfig]);
|
|
66
|
+
require_useAutoPopup.useAutoPopup({ autoPopupConfig: floatingChat?.autoPopupConfig });
|
|
45
67
|
const { trackEvent } = (0, __envive_ai_react_hooks_contexts_amplitudeContext.useAmplitude)();
|
|
46
68
|
const hasTrackedEvent = (0, react.useRef)(false);
|
|
47
69
|
(0, react.useEffect)(() => {
|
|
@@ -56,34 +78,42 @@ const FloatingChatWidgetHandler = (props) => {
|
|
|
56
78
|
hasTrackedEvent.current = true;
|
|
57
79
|
}
|
|
58
80
|
}, [trackEvent, buttonShouldRender]);
|
|
59
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
81
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CXButtonProvider, {
|
|
82
|
+
provider: cxProvider,
|
|
83
|
+
enabled: customerServiceIntegration?.enabled ?? false,
|
|
84
|
+
suppressMerchantButton: customerServiceIntegration?.suppressMerchantButton ?? false,
|
|
85
|
+
onSwitchToAgent: () => setIsCXOpen(true),
|
|
86
|
+
onCXClose: () => setIsCXOpen(false),
|
|
87
|
+
children: ({ isSwitchEnabled, toggle }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [(previewChatAlwaysOpen || effectiveIsOpen) && !previewButtonOnly && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_FloatingChatOverlay.FloatingChatOverlay, {
|
|
88
|
+
isOpened: effectiveIsOpen,
|
|
89
|
+
onClose: previewChatAlwaysOpen ? () => {} : () => closeChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.FLOATING_CHAT_OVERLAY),
|
|
90
|
+
previewMode: !!previewChatAlwaysOpen,
|
|
91
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Suspense, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FloatingChat, {
|
|
92
|
+
theme,
|
|
93
|
+
salesAgentData,
|
|
94
|
+
hardcopyContent,
|
|
95
|
+
floatingChatConfig: uiConfig?.floatingChat ?? {},
|
|
96
|
+
lookAndFeelConfig: uiConfig?.lookAndFeel ?? {},
|
|
97
|
+
isCXButtonSwitchEnabled: !!isSwitchEnabled?.(),
|
|
98
|
+
isFloatingChatOpen: effectiveIsOpen,
|
|
99
|
+
onToggleCXButton: toggle,
|
|
100
|
+
debugBar: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_debugBar.DebugBar, {}),
|
|
101
|
+
onClose: previewChatAlwaysOpen ? () => {} : () => closeChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.FLOATING_CHAT_CLOSE_BUTTON)
|
|
102
|
+
}) })
|
|
103
|
+
}), buttonShouldRender && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_v3_FloatingButton.FloatingButton, {
|
|
104
|
+
id: require_constants.FLOATING_BUTTON_ID,
|
|
105
|
+
variant: floatingButton?.style,
|
|
106
|
+
mode: floatingButton?.mode,
|
|
107
|
+
backgroundColor: floatingButton?.backgroundColor,
|
|
108
|
+
onClick: previewButtonOnly ? () => {} : () => openChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.FLOATING_BUTTON),
|
|
109
|
+
customIcon: floatingButton?.iconSVGSrc,
|
|
110
|
+
show: floatingButton?.showOption,
|
|
111
|
+
location: floatingButton?.position,
|
|
112
|
+
hasInteractionHappened: userHasInteractedValue,
|
|
113
|
+
ariaLabel: "Open chat",
|
|
114
|
+
previewMode: !!previewButtonOnly
|
|
115
|
+
})] })
|
|
116
|
+
}, cxProvider);
|
|
87
117
|
};
|
|
88
118
|
const FloatingChatWidgetWithBaseWidget = require_withBaseWidget.withBaseWidget(FloatingChatWidgetHandler);
|
|
89
119
|
const FloatingChatWidget = ({ previewButtonOnly, previewChatAlwaysOpen } = {}) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime19 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/widgets/FloatingChatWidget/FloatingChatWidget.d.ts
|
|
4
4
|
interface FloatingChatWidgetProps {
|
|
@@ -9,7 +9,7 @@ declare const FloatingChatWidget: {
|
|
|
9
9
|
({
|
|
10
10
|
previewButtonOnly,
|
|
11
11
|
previewChatAlwaysOpen
|
|
12
|
-
}?: FloatingChatWidgetProps):
|
|
12
|
+
}?: FloatingChatWidgetProps): react_jsx_runtime19.JSX.Element;
|
|
13
13
|
displayName: string;
|
|
14
14
|
};
|
|
15
15
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime3 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/widgets/FloatingChatWidget/FloatingChatWidget.d.ts
|
|
4
4
|
interface FloatingChatWidgetProps {
|
|
@@ -9,7 +9,7 @@ declare const FloatingChatWidget: {
|
|
|
9
9
|
({
|
|
10
10
|
previewButtonOnly,
|
|
11
11
|
previewChatAlwaysOpen
|
|
12
|
-
}?: FloatingChatWidgetProps):
|
|
12
|
+
}?: FloatingChatWidgetProps): react_jsx_runtime3.JSX.Element;
|
|
13
13
|
displayName: string;
|
|
14
14
|
};
|
|
15
15
|
//#endregion
|
|
@@ -1,46 +1,68 @@
|
|
|
1
1
|
import { withBaseWidget } from "../../hocs/withBaseWidget/withBaseWidget.js";
|
|
2
2
|
import "../../hocs/withBaseWidget/index.js";
|
|
3
|
+
import { DebugBar } from "../../debug/debugBar.js";
|
|
3
4
|
import { FloatingChatOverlay } from "./FloatingChatOverlay.js";
|
|
4
5
|
import useGetWidgetStatus_default from "../hooks/useGetWidgetStatus.js";
|
|
5
6
|
import { CustomerServiceType } from "../../CXIntegration/types.js";
|
|
6
7
|
import { FLOATING_BUTTON_ID } from "./constants.js";
|
|
7
8
|
import { useUnifiedCXButton } from "../../CXIntegration/hooks/useUnifiedCXButton.js";
|
|
8
9
|
import { useFloatingButtonVisibility } from "./hooks/useFloatingButtonVisibility.js";
|
|
9
|
-
import {
|
|
10
|
+
import { useAutoPopup } from "./hooks/useAutoPopup.js";
|
|
11
|
+
import { Suspense, lazy, useEffect, useMemo, useRef, useState } from "react";
|
|
10
12
|
import { SpiffyMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
|
|
11
13
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
14
|
import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
13
|
-
import { ChatElementDisplayLocationV3 } from "@envive-ai/react-hooks/application/models";
|
|
14
15
|
import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
|
|
15
16
|
import { useChatToggle } from "@envive-ai/react-hooks/hooks/ChatToggle";
|
|
16
17
|
import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
|
|
18
|
+
import { ChatElementDisplayLocationV3 } from "@envive-ai/react-hooks/application/models";
|
|
17
19
|
import { FloatingButton } from "@envive-ai/react-toolkit-v3/FloatingButton";
|
|
18
20
|
|
|
19
21
|
//#region src/widgets/FloatingChatWidget/FloatingChatWidget.tsx
|
|
20
22
|
const FloatingChat = lazy(async () => ({ default: (await import("@envive-ai/react-toolkit-v3/FloatingChat")).FloatingChat }));
|
|
23
|
+
/**
|
|
24
|
+
* Wrapper component that isolates the useUnifiedCXButton hook call.
|
|
25
|
+
* Provider implementations use different React hooks internally, so the
|
|
26
|
+
* provider value must be stable across renders. Use a `key` prop based on
|
|
27
|
+
* provider to force a clean remount when the provider changes.
|
|
28
|
+
*/
|
|
29
|
+
const CXButtonProvider = ({ provider, enabled, suppressMerchantButton, onSwitchToAgent, onCXClose, children }) => {
|
|
30
|
+
const { isSwitchEnabled, toggle } = useUnifiedCXButton({
|
|
31
|
+
provider,
|
|
32
|
+
enabled,
|
|
33
|
+
suppressMerchantButton,
|
|
34
|
+
onSwitchToAgent,
|
|
35
|
+
onCXClose
|
|
36
|
+
}) ?? {};
|
|
37
|
+
return /* @__PURE__ */ jsx(Fragment, { children: children({
|
|
38
|
+
isSwitchEnabled,
|
|
39
|
+
toggle
|
|
40
|
+
}) });
|
|
41
|
+
};
|
|
21
42
|
const FloatingChatWidgetHandler = (props) => {
|
|
22
43
|
const { previewButtonOnly, previewChatAlwaysOpen } = props;
|
|
23
44
|
const salesAgentData = useSalesAgent();
|
|
24
45
|
const { userHasInteractedValue } = useGetWidgetStatus_default();
|
|
25
46
|
const { uiConfig, isUiConfigLoading, hardcopyContent } = props;
|
|
26
|
-
const {
|
|
27
|
-
|
|
28
|
-
enabled: false,
|
|
29
|
-
suppressMerchantButton: false
|
|
30
|
-
}) ?? {};
|
|
31
|
-
const { floatingButton } = uiConfig ?? {};
|
|
47
|
+
const { customerServiceIntegration, floatingButton, floatingChat } = uiConfig ?? {};
|
|
48
|
+
const cxProvider = customerServiceIntegration?.provider ?? CustomerServiceType.unsupported;
|
|
32
49
|
const { isOpen, openChat, closeChat } = useChatToggle();
|
|
50
|
+
const [isCXOpen, setIsCXOpen] = useState(false);
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
if (isOpen) setIsCXOpen(false);
|
|
53
|
+
}, [isOpen]);
|
|
33
54
|
const { shouldShowFloatingButton } = useFloatingButtonVisibility({
|
|
34
55
|
floatingButtonShowConfig: floatingButton?.showOption,
|
|
35
56
|
isChatOpen: isOpen,
|
|
36
57
|
userHasInteracted: userHasInteractedValue
|
|
37
58
|
});
|
|
38
59
|
const effectiveIsOpen = previewChatAlwaysOpen ? true : isOpen;
|
|
39
|
-
const buttonShouldRender = previewButtonOnly ? true : !effectiveIsOpen && shouldShowFloatingButton;
|
|
60
|
+
const buttonShouldRender = previewButtonOnly ? true : !effectiveIsOpen && shouldShowFloatingButton && !isCXOpen;
|
|
40
61
|
const theme = useMemo(() => {
|
|
41
62
|
if (isUiConfigLoading || !uiConfig) return Theme.STANDARD;
|
|
42
63
|
return uiConfig?.lookAndFeel?.theme ?? Theme.GLOBAL_CUSTOM;
|
|
43
64
|
}, [isUiConfigLoading, uiConfig]);
|
|
65
|
+
useAutoPopup({ autoPopupConfig: floatingChat?.autoPopupConfig });
|
|
44
66
|
const { trackEvent } = useAmplitude();
|
|
45
67
|
const hasTrackedEvent = useRef(false);
|
|
46
68
|
useEffect(() => {
|
|
@@ -55,34 +77,42 @@ const FloatingChatWidgetHandler = (props) => {
|
|
|
55
77
|
hasTrackedEvent.current = true;
|
|
56
78
|
}
|
|
57
79
|
}, [trackEvent, buttonShouldRender]);
|
|
58
|
-
return /* @__PURE__ */
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
80
|
+
return /* @__PURE__ */ jsx(CXButtonProvider, {
|
|
81
|
+
provider: cxProvider,
|
|
82
|
+
enabled: customerServiceIntegration?.enabled ?? false,
|
|
83
|
+
suppressMerchantButton: customerServiceIntegration?.suppressMerchantButton ?? false,
|
|
84
|
+
onSwitchToAgent: () => setIsCXOpen(true),
|
|
85
|
+
onCXClose: () => setIsCXOpen(false),
|
|
86
|
+
children: ({ isSwitchEnabled, toggle }) => /* @__PURE__ */ jsxs(Fragment, { children: [(previewChatAlwaysOpen || effectiveIsOpen) && !previewButtonOnly && /* @__PURE__ */ jsx(FloatingChatOverlay, {
|
|
87
|
+
isOpened: effectiveIsOpen,
|
|
88
|
+
onClose: previewChatAlwaysOpen ? () => {} : () => closeChat(ChatElementDisplayLocationV3.FLOATING_CHAT_OVERLAY),
|
|
89
|
+
previewMode: !!previewChatAlwaysOpen,
|
|
90
|
+
children: /* @__PURE__ */ jsx(Suspense, { children: /* @__PURE__ */ jsx(FloatingChat, {
|
|
91
|
+
theme,
|
|
92
|
+
salesAgentData,
|
|
93
|
+
hardcopyContent,
|
|
94
|
+
floatingChatConfig: uiConfig?.floatingChat ?? {},
|
|
95
|
+
lookAndFeelConfig: uiConfig?.lookAndFeel ?? {},
|
|
96
|
+
isCXButtonSwitchEnabled: !!isSwitchEnabled?.(),
|
|
97
|
+
isFloatingChatOpen: effectiveIsOpen,
|
|
98
|
+
onToggleCXButton: toggle,
|
|
99
|
+
debugBar: /* @__PURE__ */ jsx(DebugBar, {}),
|
|
100
|
+
onClose: previewChatAlwaysOpen ? () => {} : () => closeChat(ChatElementDisplayLocationV3.FLOATING_CHAT_CLOSE_BUTTON)
|
|
101
|
+
}) })
|
|
102
|
+
}), buttonShouldRender && /* @__PURE__ */ jsx(FloatingButton, {
|
|
103
|
+
id: FLOATING_BUTTON_ID,
|
|
104
|
+
variant: floatingButton?.style,
|
|
105
|
+
mode: floatingButton?.mode,
|
|
106
|
+
backgroundColor: floatingButton?.backgroundColor,
|
|
107
|
+
onClick: previewButtonOnly ? () => {} : () => openChat(ChatElementDisplayLocationV3.FLOATING_BUTTON),
|
|
108
|
+
customIcon: floatingButton?.iconSVGSrc,
|
|
109
|
+
show: floatingButton?.showOption,
|
|
110
|
+
location: floatingButton?.position,
|
|
111
|
+
hasInteractionHappened: userHasInteractedValue,
|
|
112
|
+
ariaLabel: "Open chat",
|
|
113
|
+
previewMode: !!previewButtonOnly
|
|
114
|
+
})] })
|
|
115
|
+
}, cxProvider);
|
|
86
116
|
};
|
|
87
117
|
const FloatingChatWidgetWithBaseWidget = withBaseWidget(FloatingChatWidgetHandler);
|
|
88
118
|
const FloatingChatWidget = ({ previewButtonOnly, previewChatAlwaysOpen } = {}) => {
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let react = require("react");
|
|
3
|
+
let __envive_ai_react_hooks_hooks_ChatToggle = require("@envive-ai/react-hooks/hooks/ChatToggle");
|
|
4
|
+
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
5
|
+
let __envive_ai_react_hooks_contexts_featureFlagServiceContext = require("@envive-ai/react-hooks/contexts/featureFlagServiceContext");
|
|
6
|
+
|
|
7
|
+
//#region src/widgets/FloatingChatWidget/hooks/useAutoPopup.ts
|
|
8
|
+
const useAutoPopup = ({ autoPopupConfig }) => {
|
|
9
|
+
const { isOpen, openChat } = (0, __envive_ai_react_hooks_hooks_ChatToggle.useChatToggle)();
|
|
10
|
+
const { featureFlagService } = (0, __envive_ai_react_hooks_contexts_featureFlagServiceContext.useFeatureFlagService)();
|
|
11
|
+
const hasBeenOpenedRef = (0, react.useRef)(false);
|
|
12
|
+
const autoPopupTimerRef = (0, react.useRef)(null);
|
|
13
|
+
const isReferrerBasedPromptEnabled = (0, react.useMemo)(() => featureFlagService.isFeatureGateEnabled(__envive_ai_react_hooks_application_models.FeatureGates.IsReferrerBasedPromptEnabled), [featureFlagService]);
|
|
14
|
+
(0, react.useEffect)(() => {
|
|
15
|
+
if (!hasBeenOpenedRef.current && isOpen) hasBeenOpenedRef.current = true;
|
|
16
|
+
}, [isOpen]);
|
|
17
|
+
const openChatSafely = (0, react.useCallback)((triggerLocation) => {
|
|
18
|
+
if (!hasBeenOpenedRef.current) {
|
|
19
|
+
hasBeenOpenedRef.current = true;
|
|
20
|
+
openChat(triggerLocation);
|
|
21
|
+
}
|
|
22
|
+
}, [openChat]);
|
|
23
|
+
(0, react.useEffect)(() => {
|
|
24
|
+
const cleanup = () => {
|
|
25
|
+
if (autoPopupTimerRef.current) clearTimeout(autoPopupTimerRef.current);
|
|
26
|
+
};
|
|
27
|
+
if (!autoPopupConfig || hasBeenOpenedRef.current) return cleanup;
|
|
28
|
+
for (const trigger of autoPopupConfig.triggers) {
|
|
29
|
+
if (trigger.trigger.type === "referrer") {
|
|
30
|
+
if (!isReferrerBasedPromptEnabled) break;
|
|
31
|
+
const utmSource = new URLSearchParams(window.location.search).get("utm_source");
|
|
32
|
+
if (trigger.trigger.referrers.includes(utmSource)) autoPopupTimerRef.current = setTimeout(() => {
|
|
33
|
+
openChatSafely(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.REFERRER_BASED_PROMPT);
|
|
34
|
+
}, trigger.delay);
|
|
35
|
+
}
|
|
36
|
+
if (trigger.trigger.type === "automatic") autoPopupTimerRef.current = setTimeout(() => {
|
|
37
|
+
openChatSafely(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.AUTOMATIC_PROMPT);
|
|
38
|
+
}, trigger.delay);
|
|
39
|
+
}
|
|
40
|
+
return cleanup;
|
|
41
|
+
}, [
|
|
42
|
+
autoPopupConfig,
|
|
43
|
+
isOpen,
|
|
44
|
+
isReferrerBasedPromptEnabled,
|
|
45
|
+
openChatSafely
|
|
46
|
+
]);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
//#endregion
|
|
50
|
+
exports.useAutoPopup = useAutoPopup;
|