@microsoft/omnichannel-chat-widget 1.7.8-main.f60b0b7 → 1.7.8
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/lib/cjs/common/Constants.js +67 -20
- package/lib/cjs/common/KeyCodes.js +6 -1
- package/lib/cjs/common/contextDataStore/DataStoreManager.js +6 -1
- package/lib/cjs/common/facades/FacadeChatSDK.js +392 -295
- package/lib/cjs/common/storage/default/defaultCacheManager.js +6 -3
- package/lib/cjs/common/telemetry/AppInsightsEvents.js +31 -0
- package/lib/cjs/common/telemetry/ScenarioMarker.js +66 -0
- package/lib/cjs/common/telemetry/TelemetryConstants.js +160 -129
- package/lib/cjs/common/telemetry/TelemetryHelper.js +281 -250
- package/lib/cjs/common/telemetry/TelemetryManager.js +32 -12
- package/lib/cjs/common/telemetry/defaultConfigs/defaultAppInsightsConfig.js +11 -0
- package/lib/cjs/common/telemetry/interfaces/IAppInsightsConfig.js +1 -0
- package/lib/cjs/common/telemetry/loggers/appInsightsLogger.js +149 -0
- package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +17 -14
- package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +3 -2
- package/lib/cjs/components/footerstateful/FooterStateful.js +11 -6
- package/lib/cjs/components/headerstateful/HeaderStateful.js +21 -11
- package/lib/cjs/components/livechatwidget/common/ActivityStreamHandler.js +32 -19
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +71 -56
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +17 -8
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/HiddenAdaptiveCardActivitySubscriber.js +65 -52
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +31 -18
- package/lib/cjs/components/livechatwidget/common/ChatAdapterShim.js +14 -6
- package/lib/cjs/components/livechatwidget/common/Deferred.js +14 -6
- package/lib/cjs/components/livechatwidget/common/chatDisconnectHelper.js +3 -1
- package/lib/cjs/components/livechatwidget/common/endChat.js +4 -18
- package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +0 -5
- package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +3 -1
- package/lib/cjs/components/livechatwidget/common/renderSurveyHelpers.js +6 -3
- package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +7 -2
- package/lib/cjs/components/livechatwidget/common/startChat.js +45 -40
- package/lib/cjs/components/livechatwidget/common/startChatErrorHandler.js +5 -4
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +28 -23
- package/lib/cjs/components/ooohpanestateful/OOOHPaneStateful.js +12 -8
- package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +31 -10
- package/lib/cjs/components/postchatsurveypanestateful/common/isValidSurveyUrl.js +28 -0
- package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +9 -6
- package/lib/cjs/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +8 -6
- package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +11 -4
- package/lib/cjs/components/webchatcontainerstateful/common/DemoChatAdapter.js +88 -65
- package/lib/cjs/components/webchatcontainerstateful/common/DemoChatSDK.js +26 -7
- package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatAdapter.js +49 -26
- package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatSDK.js +57 -35
- package/lib/cjs/components/webchatcontainerstateful/common/mockadapter.js +62 -52
- package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +95 -61
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +6 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +6 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/markdownrenderers/HyperlinkTextOverrideRenderer.js +53 -39
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +4 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.js +2 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +88 -60
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +17 -6
- package/lib/cjs/controller/componentController.js +3 -2
- package/lib/cjs/firstresponselatency/Constants.js +13 -0
- package/lib/cjs/firstresponselatency/FirstMessageTrackerFromBot.js +118 -0
- package/lib/cjs/firstresponselatency/FirstResponseLatencyTracker.js +201 -0
- package/lib/cjs/firstresponselatency/util.js +98 -0
- package/lib/cjs/plugins/createChatTranscript.js +88 -58
- package/lib/cjs/plugins/newMessageEventHandler.js +105 -88
- package/lib/esm/common/Constants.js +65 -19
- package/lib/esm/common/KeyCodes.js +6 -1
- package/lib/esm/common/contextDataStore/DataStoreManager.js +6 -1
- package/lib/esm/common/facades/FacadeChatSDK.js +392 -295
- package/lib/esm/common/storage/default/defaultCacheManager.js +6 -1
- package/lib/esm/common/telemetry/AppInsightsEvents.js +24 -0
- package/lib/esm/common/telemetry/ScenarioMarker.js +59 -0
- package/lib/esm/common/telemetry/TelemetryConstants.js +160 -129
- package/lib/esm/common/telemetry/TelemetryHelper.js +281 -250
- package/lib/esm/common/telemetry/TelemetryManager.js +32 -12
- package/lib/esm/common/telemetry/defaultConfigs/defaultAppInsightsConfig.js +4 -0
- package/lib/esm/common/telemetry/interfaces/IAppInsightsConfig.js +1 -0
- package/lib/esm/common/telemetry/loggers/appInsightsLogger.js +139 -0
- package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +17 -14
- package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +3 -2
- package/lib/esm/components/footerstateful/FooterStateful.js +11 -6
- package/lib/esm/components/headerstateful/HeaderStateful.js +21 -11
- package/lib/esm/components/livechatwidget/common/ActivityStreamHandler.js +32 -19
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +71 -56
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +17 -8
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/HiddenAdaptiveCardActivitySubscriber.js +65 -52
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +31 -18
- package/lib/esm/components/livechatwidget/common/ChatAdapterShim.js +14 -6
- package/lib/esm/components/livechatwidget/common/Deferred.js +14 -6
- package/lib/esm/components/livechatwidget/common/chatDisconnectHelper.js +3 -1
- package/lib/esm/components/livechatwidget/common/endChat.js +4 -18
- package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +1 -6
- package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +3 -1
- package/lib/esm/components/livechatwidget/common/renderSurveyHelpers.js +6 -3
- package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +7 -2
- package/lib/esm/components/livechatwidget/common/startChat.js +46 -41
- package/lib/esm/components/livechatwidget/common/startChatErrorHandler.js +5 -4
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +28 -23
- package/lib/esm/components/ooohpanestateful/OOOHPaneStateful.js +12 -8
- package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +31 -10
- package/lib/esm/components/postchatsurveypanestateful/common/isValidSurveyUrl.js +21 -0
- package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +9 -6
- package/lib/esm/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +8 -6
- package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +11 -4
- package/lib/esm/components/webchatcontainerstateful/common/DemoChatAdapter.js +88 -65
- package/lib/esm/components/webchatcontainerstateful/common/DemoChatSDK.js +26 -7
- package/lib/esm/components/webchatcontainerstateful/common/DesignerChatAdapter.js +49 -26
- package/lib/esm/components/webchatcontainerstateful/common/DesignerChatSDK.js +57 -35
- package/lib/esm/components/webchatcontainerstateful/common/mockadapter.js +63 -52
- package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +95 -61
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +6 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +6 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/markdownrenderers/HyperlinkTextOverrideRenderer.js +53 -39
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +4 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.js +2 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +88 -60
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +17 -6
- package/lib/esm/controller/componentController.js +3 -2
- package/lib/esm/firstresponselatency/Constants.js +6 -0
- package/lib/esm/firstresponselatency/FirstMessageTrackerFromBot.js +112 -0
- package/lib/esm/firstresponselatency/FirstResponseLatencyTracker.js +194 -0
- package/lib/esm/firstresponselatency/util.js +87 -0
- package/lib/esm/plugins/createChatTranscript.js +88 -58
- package/lib/esm/plugins/newMessageEventHandler.js +103 -86
- package/lib/types/assets/Audios.d.ts +1 -1
- package/lib/types/assets/Icons.d.ts +16 -16
- package/lib/types/common/Constants.d.ts +283 -277
- package/lib/types/common/KeyCodes.d.ts +5 -5
- package/lib/types/common/contextDataStore/DataStoreManager.d.ts +4 -4
- package/lib/types/common/facades/FacadeChatSDK.d.ts +75 -74
- package/lib/types/common/facades/types/IFacadeChatSDKInput.d.ts +13 -13
- package/lib/types/common/interfaces/IContextDataStore.d.ts +14 -14
- package/lib/types/common/interfaces/ITimer.d.ts +3 -3
- package/lib/types/common/storage/default/defaultCacheManager.d.ts +5 -5
- package/lib/types/common/storage/default/defaultClientDataStoreProvider.d.ts +4 -4
- package/lib/types/common/storage/default/defaultInMemoryDataStore.d.ts +6 -6
- package/lib/types/common/telemetry/AppInsightsEvents.d.ts +1 -0
- package/lib/types/common/telemetry/ScenarioMarker.d.ts +19 -0
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +272 -255
- package/lib/types/common/telemetry/TelemetryHelper.d.ts +48 -43
- package/lib/types/common/telemetry/TelemetryManager.d.ts +12 -12
- package/lib/types/common/telemetry/defaultConfigs/defaultAppInsightsConfig.d.ts +2 -0
- package/lib/types/common/telemetry/defaultConfigs/defaultAriaConfig.d.ts +2 -2
- package/lib/types/common/telemetry/defaultConfigs/defaultTelemetryConfiguration.d.ts +2 -2
- package/lib/types/common/telemetry/defaultConfigs/defaultTelemetryInternalData.d.ts +2 -2
- package/lib/types/common/telemetry/definitions/Contracts.d.ts +77 -77
- package/lib/types/common/telemetry/definitions/Payload.d.ts +105 -105
- package/lib/types/common/telemetry/interfaces/IAppInsightsConfig.d.ts +4 -0
- package/lib/types/common/telemetry/interfaces/IAriaConfigurations.d.ts +18 -18
- package/lib/types/common/telemetry/interfaces/IChatSDKLogger.d.ts +6 -5
- package/lib/types/common/telemetry/interfaces/IInternalTelemetryData.d.ts +23 -21
- package/lib/types/common/telemetry/interfaces/ITelemetryConfig.d.ts +48 -48
- package/lib/types/common/telemetry/interfaces/ITelemetryEvents.d.ts +7 -7
- package/lib/types/common/telemetry/loggers/appInsightsLogger.d.ts +10 -0
- package/lib/types/common/telemetry/loggers/ariaTelemetryLogger.d.ts +2 -2
- package/lib/types/common/telemetry/loggers/consoleLogger.d.ts +2 -2
- package/lib/types/common/utils.d.ts +49 -49
- package/lib/types/components/callingcontainerstateful/CallingContainerStateful.d.ts +4 -3
- package/lib/types/components/callingcontainerstateful/ICallingContainerStatefulProps.d.ts +4 -4
- package/lib/types/components/chatbuttonstateful/ChatButtonStateful.d.ts +4 -3
- package/lib/types/components/chatbuttonstateful/common/styleProps/defaultOutOfOfficeChatButtonStyleProps.d.ts +2 -2
- package/lib/types/components/chatbuttonstateful/interfaces/IChatButtonStatefulParams.d.ts +17 -17
- package/lib/types/components/confirmationpanestateful/ConfirmationPaneStateful.d.ts +4 -3
- package/lib/types/components/confirmationpanestateful/common/defaultProps/defaultConfirmationPaneLocalizedTexts.d.ts +2 -2
- package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneInputs.d.ts +4 -4
- package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneLocalizedText.d.ts +10 -10
- package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneStatefulParams.d.ts +13 -13
- package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneStatefulProps.d.ts +8 -8
- package/lib/types/components/dimlayer/DimLayer.d.ts +6 -5
- package/lib/types/components/draggable/DraggableChatWidget.d.ts +9 -9
- package/lib/types/components/draggable/DraggableEventEmitter.d.ts +27 -27
- package/lib/types/components/draggable/DraggableEventNames.d.ts +6 -6
- package/lib/types/components/draggable/DraggableEventReceiver.d.ts +27 -27
- package/lib/types/components/draggable/IDraggableElementPosition.d.ts +5 -5
- package/lib/types/components/draggable/IDraggableElementPositionDelta.d.ts +5 -5
- package/lib/types/components/draggable/IDraggableEvent.d.ts +12 -12
- package/lib/types/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.d.ts +4 -3
- package/lib/types/components/emailtranscriptpanestateful/interfaces/IChatTranscriptBody.d.ts +5 -5
- package/lib/types/components/emailtranscriptpanestateful/interfaces/IEmailTranscriptPaneProps.d.ts +11 -11
- package/lib/types/components/footerstateful/FooterStateful.d.ts +3 -2
- package/lib/types/components/footerstateful/audionotificationstateful/AudioNotificationStateful.d.ts +4 -3
- package/lib/types/components/footerstateful/audionotificationstateful/interfaces/IAudioNotificationProps.d.ts +3 -3
- package/lib/types/components/footerstateful/audionotificationstateful/interfaces/IAudioNotificationStatefulParams.d.ts +4 -4
- package/lib/types/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.d.ts +4 -4
- package/lib/types/components/footerstateful/downloadtranscriptstateful/common/defaultLibraryScripts.d.ts +23 -23
- package/lib/types/components/footerstateful/downloadtranscriptstateful/interfaces/IDownloadTranscriptProps.d.ts +19 -19
- package/lib/types/components/footerstateful/downloadtranscriptstateful/interfaces/IWebChatTranscriptConfig.d.ts +14 -14
- package/lib/types/components/footerstateful/downloadtranscriptstateful/interfaces/TranscriptHtmlScripts.d.ts +33 -33
- package/lib/types/components/headerstateful/HeaderStateful.d.ts +4 -3
- package/lib/types/components/headerstateful/common/styleProps/defaultOutOfOfficeHeaderStyleProps.d.ts +2 -2
- package/lib/types/components/headerstateful/interfaces/IHeaderStatefulParams.d.ts +33 -33
- package/lib/types/components/livechatwidget/LiveChatWidget.d.ts +4 -3
- package/lib/types/components/livechatwidget/common/ActivityStreamHandler.d.ts +14 -14
- package/lib/types/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.d.ts +12 -12
- package/lib/types/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.d.ts +5 -5
- package/lib/types/components/livechatwidget/common/ActivitySubscriber/HiddenAdaptiveCardActivitySubscriber.d.ts +7 -7
- package/lib/types/components/livechatwidget/common/ActivitySubscriber/IActivitySubscriber.d.ts +6 -6
- package/lib/types/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.d.ts +7 -7
- package/lib/types/components/livechatwidget/common/ChatAdapterShim.d.ts +7 -7
- package/lib/types/components/livechatwidget/common/Deferred.d.ts +9 -9
- package/lib/types/components/livechatwidget/common/authHelper.d.ts +18 -18
- package/lib/types/components/livechatwidget/common/chatDisconnectHelper.d.ts +4 -4
- package/lib/types/components/livechatwidget/common/createAdapter.d.ts +3 -3
- package/lib/types/components/livechatwidget/common/createDownloadTranscriptProps.d.ts +25 -25
- package/lib/types/components/livechatwidget/common/createFooter.d.ts +4 -3
- package/lib/types/components/livechatwidget/common/createInternetConnectionChangeHandler.d.ts +2 -2
- package/lib/types/components/livechatwidget/common/createMarkdown.d.ts +2 -2
- package/lib/types/components/livechatwidget/common/defaultProps/defaultScrollBarProps.d.ts +2 -2
- package/lib/types/components/livechatwidget/common/defaultStyles/defaultLiveChatWidgetGeneralStyles.d.ts +2 -2
- package/lib/types/components/livechatwidget/common/disposeTelemetryLoggers.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/endChat.d.ts +13 -13
- package/lib/types/components/livechatwidget/common/getGeneralStylesForButton.d.ts +3 -3
- package/lib/types/components/livechatwidget/common/getMockChatSDKIfApplicable.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/helpers/markdownHelper.d.ts +2 -2
- package/lib/types/components/livechatwidget/common/initCallingSdk.d.ts +2 -2
- package/lib/types/components/livechatwidget/common/initConfirmationPropsComposer.d.ts +3 -3
- package/lib/types/components/livechatwidget/common/initWebChatComposer.d.ts +7 -7
- package/lib/types/components/livechatwidget/common/liveChatConfigUtils.d.ts +3 -3
- package/lib/types/components/livechatwidget/common/overridePropsOnMockIfApplicable.d.ts +3 -3
- package/lib/types/components/livechatwidget/common/persistentChatHelper.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/reconnectChatHelper.d.ts +12 -12
- package/lib/types/components/livechatwidget/common/registerTelemetryLoggers.d.ts +4 -4
- package/lib/types/components/livechatwidget/common/renderSurveyHelpers.d.ts +10 -10
- package/lib/types/components/livechatwidget/common/setPostChatContextAndLoadSurvey.d.ts +4 -4
- package/lib/types/components/livechatwidget/common/shareObservable.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/startChat.d.ts +11 -11
- package/lib/types/components/livechatwidget/common/startChatErrorHandler.d.ts +6 -6
- package/lib/types/components/livechatwidget/common/startProactiveChat.d.ts +4 -4
- package/lib/types/components/livechatwidget/common/updateSessionDataForTelemetry.d.ts +4 -4
- package/lib/types/components/livechatwidget/interfaces/IBotAuthActivitySubscriberOptionalParams.d.ts +4 -4
- package/lib/types/components/livechatwidget/interfaces/IDraggableChatWidgetProps.d.ts +10 -10
- package/lib/types/components/livechatwidget/interfaces/IFeatureConfigProps.d.ts +3 -3
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetComponentOverrides.d.ts +17 -17
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetControlProps.d.ts +21 -21
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +70 -68
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetStyleProps.d.ts +5 -5
- package/lib/types/components/livechatwidget/interfaces/IMockProps.d.ts +8 -8
- package/lib/types/components/livechatwidget/interfaces/IScrollBarProps.d.ts +22 -22
- package/lib/types/components/livechatwidget/interfaces/ISendBox.d.ts +12 -12
- package/lib/types/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.d.ts +3 -3
- package/lib/types/components/loadingpanestateful/LoadingPaneStateful.d.ts +3 -2
- package/lib/types/components/loadingpanestateful/common/defaultStyleProps/defaultgeneralLoadingPaneStyleProps.d.ts +2 -2
- package/lib/types/components/loadingpanestateful/common/errorUIStyleProps/errorUILoadingPaneStyleProps.d.ts +2 -2
- package/lib/types/components/notificationpanestateful/NotificationPaneStateful.d.ts +4 -3
- package/lib/types/components/notificationpanestateful/defaultProps/defaultChatDisconnectControlProps.d.ts +2 -2
- package/lib/types/components/notificationpanestateful/defaultProps/defaultChatDisconnectStyleProps.d.ts +2 -2
- package/lib/types/components/notificationpanestateful/interfaces/INotificationPaneStatefulProps.d.ts +13 -13
- package/lib/types/components/ooohpanestateful/OOOHPaneStateful.d.ts +4 -3
- package/lib/types/components/ooohpanestateful/common/defaultStyleProps/defaultgeneralOOOHPaneStyleProps.d.ts +2 -2
- package/lib/types/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.d.ts +4 -3
- package/lib/types/components/postchatloadingpanestateful/common/defaultgeneralPostChatLoadingPaneStyleProps.d.ts +2 -2
- package/lib/types/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.d.ts +4 -3
- package/lib/types/components/postchatsurveypanestateful/common/defaultStyleProps/defaultgeneralPostChatSurveyPaneStyleProps.d.ts +2 -2
- package/lib/types/components/postchatsurveypanestateful/common/isValidSurveyUrl.d.ts +2 -0
- package/lib/types/components/postchatsurveypanestateful/enums/CustomerVoiceEvents.d.ts +5 -5
- package/lib/types/components/postchatsurveypanestateful/enums/PostChatSurveyMode.d.ts +4 -4
- package/lib/types/components/postchatsurveypanestateful/interfaces/IPostChatSurveyPaneStatefulProps.d.ts +5 -5
- package/lib/types/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.d.ts +4 -3
- package/lib/types/components/prechatsurveypanestateful/common/defaultProps/defaultPreChatSurveyLocalizedTexts.d.ts +2 -2
- package/lib/types/components/prechatsurveypanestateful/common/defaultStyles/defaultGeneralPreChatSurveyPaneStyleProps.d.ts +2 -2
- package/lib/types/components/prechatsurveypanestateful/interfaces/IPreChatSurveyPaneStatefulParams.d.ts +5 -5
- package/lib/types/components/proactivechatpanestateful/ProactiveChatPaneStateful.d.ts +3 -2
- package/lib/types/components/proactivechatpanestateful/interfaces/IProactiveChatNotificationConfig.d.ts +3 -3
- package/lib/types/components/proactivechatpanestateful/interfaces/IProactiveChatPaneStatefulProps.d.ts +4 -4
- package/lib/types/components/reconnectchatpanestateful/ReconnectChatPaneStateful.d.ts +4 -3
- package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatContext.d.ts +4 -4
- package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatOptionalParams.d.ts +3 -3
- package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatPaneStatefulParams.d.ts +5 -5
- package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatPaneStatefulProps.d.ts +5 -5
- package/lib/types/components/startchaterrorpanestateful/StartChatErrorPaneStateful.d.ts +4 -3
- package/lib/types/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneGeneralStyleProps.d.ts +2 -2
- package/lib/types/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneIconImageProps.d.ts +2 -2
- package/lib/types/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneIconStyleProps.d.ts +2 -2
- package/lib/types/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneSubtitleStyleProps.d.ts +2 -2
- package/lib/types/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneTitleStyleProps.d.ts +2 -2
- package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneClassNames.d.ts +5 -5
- package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneComponentOverrides.d.ts +6 -6
- package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneControlProps.d.ts +14 -14
- package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneProps.d.ts +8 -8
- package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneStyleProps.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/WebChatContainerStateful.d.ts +4 -3
- package/lib/types/components/webchatcontainerstateful/common/DemoChatAdapter.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/common/DemoChatSDK.d.ts +6 -6
- package/lib/types/components/webchatcontainerstateful/common/DesignerChatAdapter.d.ts +8 -8
- package/lib/types/components/webchatcontainerstateful/common/DesignerChatSDK.d.ts +31 -31
- package/lib/types/components/webchatcontainerstateful/common/MockBotCardCommandType.d.ts +6 -6
- package/lib/types/components/webchatcontainerstateful/common/MockBotCommand.d.ts +11 -11
- package/lib/types/components/webchatcontainerstateful/common/defaultProps/defaultAttachmentProps.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/common/defaultProps/defaultMarkdownLocalizedTexts.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/common/defaultProps/defaultWebChatStatefulProps.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStatefulContainerStyles.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/common/mockadapter.d.ts +14 -14
- package/lib/types/components/webchatcontainerstateful/common/mockchatsdk.d.ts +45 -45
- package/lib/types/components/webchatcontainerstateful/common/utils/BrowserInfo.d.ts +5 -5
- package/lib/types/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.d.ts +7 -7
- package/lib/types/components/webchatcontainerstateful/common/utils/attachmentActivityUtils.d.ts +9 -9
- package/lib/types/components/webchatcontainerstateful/common/utils/chatAdapterUtils.d.ts +9 -9
- package/lib/types/components/webchatcontainerstateful/common/utils/isMaskingFromCustomer.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/interfaces/IAdaptiveCardStyles.d.ts +8 -8
- package/lib/types/components/webchatcontainerstateful/interfaces/IAttachmentProps.d.ts +5 -5
- package/lib/types/components/webchatcontainerstateful/interfaces/IBotAuthConfig.d.ts +4 -4
- package/lib/types/components/webchatcontainerstateful/interfaces/IBotMagicCodeConfig.d.ts +4 -4
- package/lib/types/components/webchatcontainerstateful/interfaces/IDataMaskingInfo.d.ts +6 -6
- package/lib/types/components/webchatcontainerstateful/interfaces/IDataMaskingRule.d.ts +3 -3
- package/lib/types/components/webchatcontainerstateful/interfaces/IDataMaskingSetting.d.ts +4 -4
- package/lib/types/components/webchatcontainerstateful/interfaces/IRenderingMiddlewareProps.d.ts +37 -37
- package/lib/types/components/webchatcontainerstateful/interfaces/IWebChatAction.d.ts +4 -4
- package/lib/types/components/webchatcontainerstateful/interfaces/IWebChatContainerStatefulProps.d.ts +28 -28
- package/lib/types/components/webchatcontainerstateful/interfaces/IWebChatProps.d.ts +39 -39
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.d.ts +3 -3
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.d.ts +3 -3
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/BrowserVendor.d.ts +9 -9
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineActivityType.d.ts +4 -4
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineSenderRole.d.ts +5 -5
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/MessageType.d.ts +11 -11
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/NotificationLevel.d.ts +6 -6
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios.d.ts +11 -11
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/SendStatus.d.ts +5 -5
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/WebChatActionType.d.ts +24 -24
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/markdownrenderers/HyperlinkTextOverrideRenderer.d.ts +9 -9
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsEgressMiddleware.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsIngressMiddleware.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.d.ts +1 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.d.ts +6 -6
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/Attachment.d.ts +3 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/AttachmentContent.d.ts +3 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/AttachmentIcon.d.ts +3 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/DownloadBlockedAttachment.d.ts +3 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/FileScanStatus.d.ts +6 -6
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/MaliciousAttachment.d.ts +3 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/ScanInProgressAttachment.d.ts +3 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/Spinner.d.ts +3 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware.d.ts +8 -8
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentContentStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentDividerStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentDownloadIconStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentFileNameStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentSizeStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAtttachmentAdaptiveCardStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAtttachmentIconStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAtttachmentStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAvatarStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAvatarTextStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultReceivedMessageAnchorStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSentMessageAnchorStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles.d.ts +3 -3
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageStyles.d.ts +11 -11
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampContentStyles.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampFailedStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampRetryStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTypingIndicatorBubbleStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTypingIndicatorContainerStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTypingIndicatorMessageStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles.d.ts +3 -3
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageStyles.d.ts +3 -3
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/groupActivitiesMiddleware.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/index.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageSequenceIdOverrideMiddleware.d.ts +4 -4
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.d.ts +4 -4
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/toastMiddleware.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.d.ts +7 -6
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentProcessingMiddleware.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.d.ts +11 -11
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.d.ts +11 -11
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/dataMaskingMiddleware.d.ts +11 -11
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/gifUploadMiddleware.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlPlayerMiddleware.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlTextMiddleware.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/maxMessageSizeValidator.d.ts +11 -11
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/preProcessingMiddleware.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/sanitizationMiddleware.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.d.ts +12 -12
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.d.ts +1 -1
- package/lib/types/contexts/ChatAdapterStore.d.ts +1 -2
- package/lib/types/contexts/ChatContextStore.d.ts +1 -1
- package/lib/types/contexts/ChatSDKStore.d.ts +1 -1
- package/lib/types/contexts/FacadeChatSDKStore.d.ts +1 -1
- package/lib/types/contexts/common/ConversationState.d.ts +13 -13
- package/lib/types/contexts/common/ILiveChatWidgetAction.d.ts +5 -5
- package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +63 -63
- package/lib/types/contexts/common/ILiveChatWidgetLocalizedTexts.d.ts +40 -40
- package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +48 -48
- package/lib/types/contexts/common/LiveChatWidgetContextInitialState.d.ts +3 -3
- package/lib/types/contexts/common/StartChatFailureType.d.ts +5 -5
- package/lib/types/contexts/createReducer.d.ts +4 -4
- package/lib/types/controller/componentController.d.ts +16 -16
- package/lib/types/firstresponselatency/Constants.d.ts +30 -0
- package/lib/types/firstresponselatency/FirstMessageTrackerFromBot.d.ts +1 -0
- package/lib/types/firstresponselatency/FirstResponseLatencyTracker.d.ts +22 -0
- package/lib/types/firstresponselatency/util.d.ts +7 -0
- package/lib/types/hooks/useChatAdapterStore.d.ts +2 -2
- package/lib/types/hooks/useChatContextStore.d.ts +5 -5
- package/lib/types/hooks/useChatSDKStore.d.ts +2 -2
- package/lib/types/hooks/useDebounce.d.ts +3 -3
- package/lib/types/hooks/useFacadeChatSDKStore.d.ts +3 -3
- package/lib/types/hooks/useWindowDimensions.d.ts +4 -4
- package/lib/types/index.d.ts +11 -11
- package/lib/types/plugins/createChatTranscript.d.ts +3 -3
- package/lib/types/plugins/newMessageEventHandler.d.ts +2 -2
- package/package.json +42 -17
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { BroadcastEvent, LogLevel, TelemetryEvent } from "../../../common/telemetry/TelemetryConstants";
|
|
2
|
-
import { Constants, LiveWorkItemState,
|
|
2
|
+
import { Constants, LiveWorkItemState, WidgetLoadTelemetryMessage } from "../../../common/Constants";
|
|
3
3
|
import { checkContactIdError, createTimer, getConversationDetailsCall, getStateFromCache, getWidgetCacheIdfromProps, isNullOrEmptyString, isNullOrUndefined, isUndefinedOrEmpty } from "../../../common/utils";
|
|
4
|
-
import { getAuthClientFunction, handleAuthentication } from "./authHelper";
|
|
5
4
|
import { handleChatReconnect, isPersistentEnabled, isReconnectEnabled } from "./reconnectChatHelper";
|
|
6
5
|
import { handleStartChatError, logWidgetLoadComplete } from "./startChatErrorHandler";
|
|
7
6
|
import { ActivityStreamHandler } from "./ActivityStreamHandler";
|
|
@@ -13,6 +12,7 @@ import { TelemetryTimers } from "../../../common/telemetry/TelemetryManager";
|
|
|
13
12
|
import { chatSDKStateCleanUp } from "./endChat";
|
|
14
13
|
import { createAdapter } from "./createAdapter";
|
|
15
14
|
import { createOnNewAdapterActivityHandler } from "../../../plugins/newMessageEventHandler";
|
|
15
|
+
import { createTrackingForFirstMessage } from "../../../firstresponselatency/FirstMessageTrackerFromBot";
|
|
16
16
|
import { isPersistentChatEnabled } from "./liveChatConfigUtils";
|
|
17
17
|
import { setPostChatContextAndLoadSurvey } from "./setPostChatContextAndLoadSurvey";
|
|
18
18
|
import { shouldSetPreChatIfPersistentChat } from "./persistentChatHelper";
|
|
@@ -25,20 +25,6 @@ let widgetInstanceId;
|
|
|
25
25
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
26
26
|
let popoutWidgetInstanceId;
|
|
27
27
|
|
|
28
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
29
|
-
const setAuthenticationIfApplicable = async (props, facadeChatSDK) => {
|
|
30
|
-
const chatConfig = props === null || props === void 0 ? void 0 : props.chatConfig;
|
|
31
|
-
const getAuthToken = props === null || props === void 0 ? void 0 : props.getAuthToken;
|
|
32
|
-
const authClientFunction = getAuthClientFunction(chatConfig);
|
|
33
|
-
if (getAuthToken && authClientFunction) {
|
|
34
|
-
// set auth token to chat sdk before start chat
|
|
35
|
-
const authSuccess = await handleAuthentication(facadeChatSDK.getChatSDK(), chatConfig, getAuthToken);
|
|
36
|
-
if (!authSuccess.result) {
|
|
37
|
-
throw new Error(WidgetLoadCustomErrorString.AuthenticationFailedErrorString);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
|
|
42
28
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
43
29
|
const prepareStartChat = async (props, facadeChatSDK, state, dispatch, setAdapter) => {
|
|
44
30
|
optionalParams = {}; //Resetting to ensure no stale values
|
|
@@ -66,18 +52,13 @@ const prepareStartChat = async (props, facadeChatSDK, state, dispatch, setAdapte
|
|
|
66
52
|
const isProactiveChat = state.appStates.conversationState === ConversationState.ProactiveChat;
|
|
67
53
|
const isPreChatEnabledInProactiveChat = state.appStates.proactiveChatStates.proactiveChatEnablePrechat;
|
|
68
54
|
|
|
69
|
-
// Setting auth settings to OC API to retrieve existing persistent chat session before start chat if any
|
|
70
|
-
if (isPersistentEnabled(props.chatConfig)) {
|
|
71
|
-
await setAuthenticationIfApplicable(props, facadeChatSDK);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
55
|
//Setting PreChat and intiate chat
|
|
75
56
|
await setPreChatAndInitiateChat(facadeChatSDK, dispatch, setAdapter, isProactiveChat, isPreChatEnabledInProactiveChat, state, props);
|
|
76
57
|
};
|
|
77
58
|
|
|
78
59
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
79
60
|
const setPreChatAndInitiateChat = async (facadeChatSDK, dispatch, setAdapter, isProactiveChat, proactiveChatEnablePrechatState, state, props) => {
|
|
80
|
-
var _props$preChatSurveyP, _props$preChatSurveyP2, _props$controlProps, _state$domainStates, _state$domainStates$l, _state$domainStates$l2;
|
|
61
|
+
var _props$preChatSurveyP, _props$preChatSurveyP2, _props$controlProps, _state$domainStates, _state$domainStates$l, _state$domainStates$l2, _state$appStates2;
|
|
81
62
|
// This reset needs to be done before to load prechat, because the conversation state changes from close to prechat
|
|
82
63
|
if ((state === null || state === void 0 ? void 0 : state.appStates.conversationState) === ConversationState.Closed) {
|
|
83
64
|
// Preventive reset to avoid starting chat with previous requestId which could potentially cause problems
|
|
@@ -117,7 +98,7 @@ const setPreChatAndInitiateChat = async (facadeChatSDK, dispatch, setAdapter, is
|
|
|
117
98
|
});
|
|
118
99
|
|
|
119
100
|
// If minimized, maximize the chat, if the state is missing, consider it as minimized
|
|
120
|
-
if ((state === null || state === void 0 ? void 0 : state.appStates.isMinimized)
|
|
101
|
+
if ((state === null || state === void 0 ? void 0 : state.appStates.isMinimized) === undefined || (state === null || state === void 0 ? void 0 : (_state$appStates = state.appStates) === null || _state$appStates === void 0 ? void 0 : _state$appStates.isMinimized) === true) {
|
|
121
102
|
var _state$domainStates3, _state$domainStates3$, _state$domainStates4, _state$domainStates4$;
|
|
122
103
|
dispatch({
|
|
123
104
|
type: LiveChatWidgetActionType.SET_MINIMIZED,
|
|
@@ -142,39 +123,59 @@ const setPreChatAndInitiateChat = async (facadeChatSDK, dispatch, setAdapter, is
|
|
|
142
123
|
type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
143
124
|
payload: ConversationState.Loading
|
|
144
125
|
});
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Send max event, since there is a path coming from hide button + LCW SDK that intialize the components
|
|
129
|
+
* but dont maximize it.
|
|
130
|
+
*
|
|
131
|
+
* This is because a new change to control OOH as closed event when a widget is coming from chat.
|
|
132
|
+
*/
|
|
133
|
+
if ((state === null || state === void 0 ? void 0 : state.appStates.isMinimized) === undefined || (state === null || state === void 0 ? void 0 : (_state$appStates2 = state.appStates) === null || _state$appStates2 === void 0 ? void 0 : _state$appStates2.isMinimized) === true) {
|
|
134
|
+
var _state$domainStates5, _state$domainStates5$, _state$domainStates6, _state$domainStates6$;
|
|
135
|
+
dispatch({
|
|
136
|
+
type: LiveChatWidgetActionType.SET_MINIMIZED,
|
|
137
|
+
payload: false
|
|
138
|
+
});
|
|
139
|
+
// this event will notify the upper layer to maximize the widget, an event missing during multi-tab scenario.
|
|
140
|
+
BroadcastService.postMessage({
|
|
141
|
+
eventName: BroadcastEvent.MaximizeChat,
|
|
142
|
+
payload: {
|
|
143
|
+
height: state === null || state === void 0 ? void 0 : (_state$domainStates5 = state.domainStates) === null || _state$domainStates5 === void 0 ? void 0 : (_state$domainStates5$ = _state$domainStates5.widgetSize) === null || _state$domainStates5$ === void 0 ? void 0 : _state$domainStates5$.height,
|
|
144
|
+
width: state === null || state === void 0 ? void 0 : (_state$domainStates6 = state.domainStates) === null || _state$domainStates6 === void 0 ? void 0 : (_state$domainStates6$ = _state$domainStates6.widgetSize) === null || _state$domainStates6$ === void 0 ? void 0 : _state$domainStates6$.width
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
}
|
|
145
148
|
const optionalParams = {
|
|
146
149
|
isProactiveChat
|
|
147
150
|
};
|
|
151
|
+
createTrackingForFirstMessage();
|
|
148
152
|
await initStartChat(facadeChatSDK, dispatch, setAdapter, state, props, optionalParams);
|
|
149
153
|
};
|
|
150
154
|
|
|
151
155
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
152
156
|
const initStartChat = async (facadeChatSDK, dispatch, setAdapter, state, props, params, persistedState) => {
|
|
153
|
-
var _state$
|
|
157
|
+
var _state$domainStates7, _state$domainStates7$, _state$domainStates7$2;
|
|
154
158
|
let isStartChatSuccessful = false;
|
|
155
|
-
const persistentChatEnabled = await isPersistentChatEnabled(state === null || state === void 0 ? void 0 : (_state$
|
|
159
|
+
const persistentChatEnabled = await isPersistentChatEnabled(state === null || state === void 0 ? void 0 : (_state$domainStates7 = state.domainStates) === null || _state$domainStates7 === void 0 ? void 0 : (_state$domainStates7$ = _state$domainStates7.liveChatConfig) === null || _state$domainStates7$ === void 0 ? void 0 : (_state$domainStates7$2 = _state$domainStates7$.LiveWSAndLiveChatEngJoin) === null || _state$domainStates7$2 === void 0 ? void 0 : _state$domainStates7$2.msdyn_conversationmode);
|
|
156
160
|
if ((state === null || state === void 0 ? void 0 : state.appStates.conversationState) === ConversationState.Closed) {
|
|
157
161
|
// Preventive reset to avoid starting chat with previous requestId which could potentially cause problems
|
|
158
162
|
chatSDKStateCleanUp(facadeChatSDK.getChatSDK());
|
|
159
163
|
}
|
|
160
164
|
try {
|
|
161
|
-
var _state$
|
|
165
|
+
var _state$appStates3;
|
|
162
166
|
// Clear disconnect state on start chat
|
|
163
|
-
(state === null || state === void 0 ? void 0 : (_state$
|
|
167
|
+
(state === null || state === void 0 ? void 0 : (_state$appStates3 = state.appStates) === null || _state$appStates3 === void 0 ? void 0 : _state$appStates3.chatDisconnectEventReceived) && dispatch({
|
|
164
168
|
type: LiveChatWidgetActionType.SET_CHAT_DISCONNECT_EVENT_RECEIVED,
|
|
165
169
|
payload: false
|
|
166
170
|
});
|
|
167
171
|
|
|
168
172
|
//Start widget load timer
|
|
169
173
|
TelemetryTimers.WidgetLoadTimer = createTimer();
|
|
170
|
-
TelemetryHelper.
|
|
174
|
+
TelemetryHelper.logLoadingEventToAllTelemetry(LogLevel.INFO, {
|
|
171
175
|
Event: TelemetryEvent.WidgetLoadStarted,
|
|
172
|
-
Description: "Widget
|
|
176
|
+
Description: "Widget start chat started."
|
|
173
177
|
});
|
|
174
178
|
|
|
175
|
-
// Auth token retrieval needs to happen during start chat to support pop-out chat
|
|
176
|
-
await setAuthenticationIfApplicable(props, facadeChatSDK);
|
|
177
|
-
|
|
178
179
|
//Check if chat retrieved from cache
|
|
179
180
|
if (persistedState || params !== null && params !== void 0 && params.liveChatContext) {
|
|
180
181
|
var _persistedState$domai, _persistedState$domai2, _persistedState$domai3, _persistedState$domai4, _persistedState$domai5;
|
|
@@ -281,9 +282,9 @@ const createAdapterAndSubscribe = async (facadeChatSDK, dispatch, setAdapter, pr
|
|
|
281
282
|
};
|
|
282
283
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
283
284
|
const canConnectToExistingChat = async (props, facadeChatSDK, state, dispatch, setAdapter) => {
|
|
284
|
-
var _state$
|
|
285
|
+
var _state$appStates4, _persistedState$domai6, _persistedState$appSt;
|
|
285
286
|
// By pass this function in case of popout chat
|
|
286
|
-
if ((state === null || state === void 0 ? void 0 : (_state$
|
|
287
|
+
if ((state === null || state === void 0 ? void 0 : (_state$appStates4 = state.appStates) === null || _state$appStates4 === void 0 ? void 0 : _state$appStates4.hideStartChatButton) === true) {
|
|
287
288
|
return false;
|
|
288
289
|
}
|
|
289
290
|
const persistedState = getStateFromCache(getWidgetCacheIdfromProps(props));
|
|
@@ -306,17 +307,17 @@ const canConnectToExistingChat = async (props, facadeChatSDK, state, dispatch, s
|
|
|
306
307
|
|
|
307
308
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
308
309
|
const setCustomContextParams = async (state, props) => {
|
|
309
|
-
var _props$chatConfig, _props$chatConfig$Liv, _state$
|
|
310
|
+
var _props$chatConfig, _props$chatConfig$Liv, _state$domainStates8, _persistedState$domai8;
|
|
310
311
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
311
312
|
const isAuthenticatedChat = props !== null && props !== void 0 && (_props$chatConfig = props.chatConfig) !== null && _props$chatConfig !== void 0 && (_props$chatConfig$Liv = _props$chatConfig.LiveChatConfigAuthSettings) !== null && _props$chatConfig$Liv !== void 0 && _props$chatConfig$Liv.msdyn_javascriptclientfunction ? true : false;
|
|
312
313
|
//Should not set custom context for auth chat
|
|
313
314
|
if (isAuthenticatedChat) {
|
|
314
315
|
return;
|
|
315
316
|
}
|
|
316
|
-
if (state !== null && state !== void 0 && (_state$
|
|
317
|
-
var _state$
|
|
317
|
+
if (state !== null && state !== void 0 && (_state$domainStates8 = state.domainStates) !== null && _state$domainStates8 !== void 0 && _state$domainStates8.customContext) {
|
|
318
|
+
var _state$domainStates9;
|
|
318
319
|
optionalParams = Object.assign({}, optionalParams, {
|
|
319
|
-
customContext: JSON.parse(JSON.stringify(state === null || state === void 0 ? void 0 : (_state$
|
|
320
|
+
customContext: JSON.parse(JSON.stringify(state === null || state === void 0 ? void 0 : (_state$domainStates9 = state.domainStates) === null || _state$domainStates9 === void 0 ? void 0 : _state$domainStates9.customContext))
|
|
320
321
|
});
|
|
321
322
|
return;
|
|
322
323
|
}
|
|
@@ -364,9 +365,9 @@ const canStartPopoutChat = async props => {
|
|
|
364
365
|
|
|
365
366
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
366
367
|
const checkIfConversationStillValid = async (facadeChatSDK, dispatch, state) => {
|
|
367
|
-
var _state$
|
|
368
|
-
const requestIdFromCache = (_state$
|
|
369
|
-
const liveChatContext = state === null || state === void 0 ? void 0 : (_state$
|
|
368
|
+
var _state$domainStates10, _state$domainStates11, _state$domainStates12;
|
|
369
|
+
const requestIdFromCache = (_state$domainStates10 = state.domainStates) === null || _state$domainStates10 === void 0 ? void 0 : (_state$domainStates11 = _state$domainStates10.liveChatContext) === null || _state$domainStates11 === void 0 ? void 0 : _state$domainStates11.requestId;
|
|
370
|
+
const liveChatContext = state === null || state === void 0 ? void 0 : (_state$domainStates12 = state.domainStates) === null || _state$domainStates12 === void 0 ? void 0 : _state$domainStates12.liveChatContext;
|
|
370
371
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
371
372
|
let conversationDetails = undefined;
|
|
372
373
|
// Preserve current requestId
|
|
@@ -383,6 +384,10 @@ const checkIfConversationStillValid = async (facadeChatSDK, dispatch, state) =>
|
|
|
383
384
|
type: LiveChatWidgetActionType.SET_LIVE_CHAT_CONTEXT,
|
|
384
385
|
payload: undefined
|
|
385
386
|
});
|
|
387
|
+
dispatch({
|
|
388
|
+
type: LiveChatWidgetActionType.SET_UNREAD_MESSAGE_COUNT,
|
|
389
|
+
payload: 0
|
|
390
|
+
});
|
|
386
391
|
if (currentRequestId) {
|
|
387
392
|
facadeChatSDK.getChatSDK().requestId = currentRequestId;
|
|
388
393
|
}
|
|
@@ -106,8 +106,9 @@ const logWidgetLoadFailed = ex => {
|
|
|
106
106
|
if (ex !== null && ex !== void 0 && ex.httpResponseStatusCode) {
|
|
107
107
|
exDetails.HttpResponseStatusCode = ex.httpResponseStatusCode;
|
|
108
108
|
}
|
|
109
|
-
TelemetryHelper.
|
|
109
|
+
TelemetryHelper.logLoadingEventToAllTelemetry(LogLevel.ERROR, {
|
|
110
110
|
Event: TelemetryEvent.WidgetLoadFailed,
|
|
111
|
+
Description: "Widget load complete with error",
|
|
111
112
|
ExceptionDetails: exDetails,
|
|
112
113
|
ElapsedTimeInMilliseconds: TelemetryTimers === null || TelemetryTimers === void 0 ? void 0 : (_TelemetryTimers$Widg = TelemetryTimers.WidgetLoadTimer) === null || _TelemetryTimers$Widg === void 0 ? void 0 : _TelemetryTimers$Widg.milliSecondsElapsed
|
|
113
114
|
});
|
|
@@ -118,7 +119,7 @@ export const logWidgetLoadComplete = additionalMessage => {
|
|
|
118
119
|
if (additionalMessage) {
|
|
119
120
|
descriptionString += `. ${additionalMessage}`;
|
|
120
121
|
}
|
|
121
|
-
TelemetryHelper.
|
|
122
|
+
TelemetryHelper.logLoadingEventToAllTelemetry(LogLevel.INFO, {
|
|
122
123
|
Event: TelemetryEvent.WidgetLoadComplete,
|
|
123
124
|
Description: descriptionString,
|
|
124
125
|
ElapsedTimeInMilliseconds: TelemetryTimers === null || TelemetryTimers === void 0 ? void 0 : (_TelemetryTimers$Widg2 = TelemetryTimers.WidgetLoadTimer) === null || _TelemetryTimers$Widg2 === void 0 ? void 0 : _TelemetryTimers$Widg2.milliSecondsElapsed
|
|
@@ -133,8 +134,8 @@ const logWidgetLoadCompleteWithError = ex => {
|
|
|
133
134
|
if (ex !== null && ex !== void 0 && ex.httpResponseStatusCode) {
|
|
134
135
|
exDetails.HttpResponseStatusCode = ex.httpResponseStatusCode;
|
|
135
136
|
}
|
|
136
|
-
TelemetryHelper.
|
|
137
|
-
Event: TelemetryEvent.
|
|
137
|
+
TelemetryHelper.logLoadingEventToAllTelemetry(LogLevel.ERROR, {
|
|
138
|
+
Event: TelemetryEvent.WidgetLoadFailed,
|
|
138
139
|
Description: "Widget load complete with error",
|
|
139
140
|
ExceptionDetails: exDetails,
|
|
140
141
|
ElapsedTimeInMilliseconds: TelemetryTimers === null || TelemetryTimers === void 0 ? void 0 : (_TelemetryTimers$Widg3 = TelemetryTimers.WidgetLoadTimer) === null || _TelemetryTimers$Widg3 === void 0 ? void 0 : _TelemetryTimers$Widg3.milliSecondsElapsed
|
|
@@ -56,11 +56,12 @@ import useChatContextStore from "../../../hooks/useChatContextStore";
|
|
|
56
56
|
import useFacadeSDKStore from "../../../hooks/useFacadeChatSDKStore";
|
|
57
57
|
let uiTimer;
|
|
58
58
|
export const LiveChatWidgetStateful = props => {
|
|
59
|
-
var _props$webChatContain, _props$styleProps, _props$webChatContain2, _props$webChatContain3, _props$controlProps, _props$controlProps3, _state$appStates7, _props$webChatContain7, _state$appStates14, _props$webChatContain9, _props$webChatContain10, _props$controlProps12, _props$draggableChatW, _props$draggableChatW2, _props$draggableChatW3, _props$draggableChatW4, _props$draggableChatW5, _livechatProps$webCha, _props$webChatContain11, _props$webChatContain12, _props$webChatContain13, _props$webChatContain14, _livechatProps$styleP, _livechatProps$contro, _livechatProps$contro2, _livechatProps$compon, _livechatProps$contro3, _livechatProps$compon2, _livechatProps$contro4, _livechatProps$compon3, _livechatProps$contro5, _livechatProps$compon4, _livechatProps$contro6, _livechatProps$compon5, _livechatProps$contro7, _livechatProps$compon6, _livechatProps$contro8, _livechatProps$compon7, _livechatProps$contro9, _livechatProps$compon8, _livechatProps$contro10, _livechatProps$contro11, _livechatProps$compon9, _livechatProps$contro12, _livechatProps$compon10, _livechatProps$contro13, _livechatProps$compon11, _livechatProps$compon12, _livechatProps$compon13;
|
|
59
|
+
var _props$webChatContain, _props$styleProps, _props$webChatContain2, _props$webChatContain3, _props$controlProps, _props$controlProps3, _state$appStates7, _props$webChatContain7, _state$appStates14, _props$webChatContain9, _props$webChatContain10, _props$controlProps12, _props$draggableChatW, _props$draggableChatW2, _props$draggableChatW3, _props$draggableChatW4, _props$draggableChatW5, _livechatProps$webCha, _props$webChatContain11, _props$webChatContain12, _props$webChatContain13, _props$webChatContain14, _props$webChatContain15, _props$webChatContain16, _props$webChatContain17, _props$webChatContain18, _livechatProps$styleP, _livechatProps$contro, _livechatProps$contro2, _livechatProps$compon, _livechatProps$contro3, _livechatProps$compon2, _livechatProps$contro4, _livechatProps$compon3, _livechatProps$contro5, _livechatProps$compon4, _livechatProps$contro6, _livechatProps$compon5, _livechatProps$contro7, _livechatProps$compon6, _livechatProps$contro8, _livechatProps$compon7, _livechatProps$contro9, _livechatProps$compon8, _livechatProps$contro10, _livechatProps$contro11, _livechatProps$compon9, _livechatProps$contro12, _livechatProps$compon10, _livechatProps$contro13, _livechatProps$compon11, _livechatProps$compon12, _livechatProps$compon13;
|
|
60
60
|
useEffect(() => {
|
|
61
61
|
uiTimer = createTimer();
|
|
62
|
-
TelemetryHelper.
|
|
63
|
-
Event: TelemetryEvent.
|
|
62
|
+
TelemetryHelper.logLoadingEventToAllTelemetry(LogLevel.INFO, {
|
|
63
|
+
Event: TelemetryEvent.UXLiveChatWidgetStart,
|
|
64
|
+
Description: "Live chat widget loading started."
|
|
64
65
|
});
|
|
65
66
|
}, []);
|
|
66
67
|
const [state, dispatch] = useChatContextStore();
|
|
@@ -273,9 +274,8 @@ export const LiveChatWidgetStateful = props => {
|
|
|
273
274
|
useEffect(() => {
|
|
274
275
|
var _state$appStates6;
|
|
275
276
|
if ((state === null || state === void 0 ? void 0 : (_state$appStates6 = state.appStates) === null || _state$appStates6 === void 0 ? void 0 : _state$appStates6.hideStartChatButton) === true) {
|
|
276
|
-
var _props$chatConfig3, _props$chatConfig3$Li, _props$chatConfig4, _props$chatConfig4$Li;
|
|
277
277
|
//handle OOH pane
|
|
278
|
-
if (
|
|
278
|
+
if (state.appStates.outsideOperatingHours === true) {
|
|
279
279
|
dispatch({
|
|
280
280
|
type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
281
281
|
payload: ConversationState.OutOfOffice
|
|
@@ -311,7 +311,7 @@ export const LiveChatWidgetStateful = props => {
|
|
|
311
311
|
});
|
|
312
312
|
});
|
|
313
313
|
BroadcastService.getMessageByEventName(BroadcastEvent.StartProactiveChat).subscribe(msg => {
|
|
314
|
-
TelemetryHelper.
|
|
314
|
+
TelemetryHelper.logActionEventToAllTelemetry(LogLevel.INFO, {
|
|
315
315
|
Event: TelemetryEvent.StartProactiveChatEventReceived,
|
|
316
316
|
Description: "Start proactive chat event received."
|
|
317
317
|
});
|
|
@@ -409,10 +409,10 @@ export const LiveChatWidgetStateful = props => {
|
|
|
409
409
|
|
|
410
410
|
// Start chat from SDK Event
|
|
411
411
|
BroadcastService.getMessageByEventName(BroadcastEvent.StartChat).subscribe(msg => {
|
|
412
|
-
var
|
|
412
|
+
var _msg$payload5, _msg$payload6, _msg$payload7, _msg$payload9, _inMemoryState$appSta2, _inMemoryState$appSta3, _inMemoryState$appSta4;
|
|
413
413
|
// If chat is out of operating hours chat widget sets the conversation state to OutOfOffice.
|
|
414
|
-
if (
|
|
415
|
-
|
|
414
|
+
if (state.appStates.outsideOperatingHours === true) {
|
|
415
|
+
dispatch({
|
|
416
416
|
type: LiveChatWidgetActionType.SET_MINIMIZED,
|
|
417
417
|
payload: false
|
|
418
418
|
});
|
|
@@ -428,7 +428,7 @@ export const LiveChatWidgetStateful = props => {
|
|
|
428
428
|
}
|
|
429
429
|
if (msg !== null && msg !== void 0 && (_msg$payload7 = msg.payload) !== null && _msg$payload7 !== void 0 && _msg$payload7.customContext) {
|
|
430
430
|
var _msg$payload8;
|
|
431
|
-
TelemetryHelper.
|
|
431
|
+
TelemetryHelper.logActionEventToAllTelemetry(LogLevel.INFO, {
|
|
432
432
|
Event: TelemetryEvent.CustomContextReceived,
|
|
433
433
|
Description: "CustomContext received through startChat event."
|
|
434
434
|
});
|
|
@@ -437,8 +437,8 @@ export const LiveChatWidgetStateful = props => {
|
|
|
437
437
|
payload: msg === null || msg === void 0 ? void 0 : (_msg$payload8 = msg.payload) === null || _msg$payload8 === void 0 ? void 0 : _msg$payload8.customContext
|
|
438
438
|
});
|
|
439
439
|
}
|
|
440
|
-
TelemetryHelper.
|
|
441
|
-
Event: TelemetryEvent.
|
|
440
|
+
TelemetryHelper.logActionEventToAllTelemetry(LogLevel.INFO, {
|
|
441
|
+
Event: TelemetryEvent.StartChatEventReceived,
|
|
442
442
|
Description: "Start chat event received."
|
|
443
443
|
});
|
|
444
444
|
const inMemoryState = executeReducer(state, {
|
|
@@ -446,13 +446,17 @@ export const LiveChatWidgetStateful = props => {
|
|
|
446
446
|
payload: null
|
|
447
447
|
});
|
|
448
448
|
inMemoryState.domainStates.customContext = msg === null || msg === void 0 ? void 0 : (_msg$payload9 = msg.payload) === null || _msg$payload9 === void 0 ? void 0 : _msg$payload9.customContext;
|
|
449
|
-
|
|
450
449
|
/*
|
|
451
450
|
* If the conversation is in closed state then we start a new chat,
|
|
452
451
|
* else if the conversation is in active state then we maximize the chat
|
|
453
452
|
* If the conversation is in inactive or postchat state then we maximize the chat.
|
|
454
453
|
*
|
|
455
454
|
* To start a new chat, it needs to be called via the close button or close chat via SDK.
|
|
455
|
+
*
|
|
456
|
+
* NOTE : Transition from OOH to business hours will follow this path, since during intialization conversation
|
|
457
|
+
* state is being set to closed.
|
|
458
|
+
*
|
|
459
|
+
* Maximization has been added as part of the initialization chat, since it wont go further than this block.
|
|
456
460
|
**/
|
|
457
461
|
if (((_inMemoryState$appSta2 = inMemoryState.appStates) === null || _inMemoryState$appSta2 === void 0 ? void 0 : _inMemoryState$appSta2.conversationState) === ConversationState.Closed) {
|
|
458
462
|
BroadcastService.postMessage({
|
|
@@ -463,7 +467,7 @@ export const LiveChatWidgetStateful = props => {
|
|
|
463
467
|
}
|
|
464
468
|
|
|
465
469
|
// If minimized, maximize the chat
|
|
466
|
-
if ((inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$appSta3 = inMemoryState.appStates) === null || _inMemoryState$appSta3 === void 0 ? void 0 : _inMemoryState$appSta3.isMinimized) === true) {
|
|
470
|
+
if ((inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$appSta3 = inMemoryState.appStates) === null || _inMemoryState$appSta3 === void 0 ? void 0 : _inMemoryState$appSta3.isMinimized) === true || (inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$appSta4 = inMemoryState.appStates) === null || _inMemoryState$appSta4 === void 0 ? void 0 : _inMemoryState$appSta4.isMinimized) === undefined) {
|
|
467
471
|
var _inMemoryState$domain, _inMemoryState$domain2, _inMemoryState$domain3, _inMemoryState$domain4;
|
|
468
472
|
dispatch({
|
|
469
473
|
type: LiveChatWidgetActionType.SET_MINIMIZED,
|
|
@@ -482,7 +486,7 @@ export const LiveChatWidgetStateful = props => {
|
|
|
482
486
|
|
|
483
487
|
// End chat
|
|
484
488
|
BroadcastService.getMessageByEventName(BroadcastEvent.InitiateEndChat).subscribe(async () => {
|
|
485
|
-
TelemetryHelper.
|
|
489
|
+
TelemetryHelper.logSDKEventToAllTelemetry(LogLevel.INFO, {
|
|
486
490
|
Event: TelemetryEvent.EndChatEventReceived,
|
|
487
491
|
Description: "Received InitiateEndChat BroadcastEvent."
|
|
488
492
|
});
|
|
@@ -591,12 +595,12 @@ export const LiveChatWidgetStateful = props => {
|
|
|
591
595
|
disablePolling: true
|
|
592
596
|
});
|
|
593
597
|
facadeChatSDK === null || facadeChatSDK === void 0 ? void 0 : facadeChatSDK.onAgentEndSession(event => {
|
|
594
|
-
var _inMemoryState$
|
|
598
|
+
var _inMemoryState$appSta5;
|
|
595
599
|
const inMemoryState = executeReducer(state, {
|
|
596
600
|
type: LiveChatWidgetActionType.GET_IN_MEMORY_STATE,
|
|
597
601
|
payload: null
|
|
598
602
|
});
|
|
599
|
-
if ("participantsRemoved" in event && (inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$
|
|
603
|
+
if ("participantsRemoved" in event && (inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$appSta5 = inMemoryState.appStates) === null || _inMemoryState$appSta5 === void 0 ? void 0 : _inMemoryState$appSta5.conversationState) === ConversationState.Active) {
|
|
600
604
|
setWebChatStyles(styles => {
|
|
601
605
|
return {
|
|
602
606
|
...styles,
|
|
@@ -739,13 +743,13 @@ export const LiveChatWidgetStateful = props => {
|
|
|
739
743
|
|
|
740
744
|
// Handle Chat disconnect cases
|
|
741
745
|
useEffect(() => {
|
|
742
|
-
var _inMemoryState$
|
|
746
|
+
var _inMemoryState$appSta6;
|
|
743
747
|
const inMemoryState = executeReducer(state, {
|
|
744
748
|
type: LiveChatWidgetActionType.GET_IN_MEMORY_STATE,
|
|
745
749
|
payload: null
|
|
746
750
|
});
|
|
747
751
|
handleChatDisconnect(props, inMemoryState, setWebChatStyles);
|
|
748
|
-
const chatDisconnectState = inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$
|
|
752
|
+
const chatDisconnectState = inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$appSta6 = inMemoryState.appStates) === null || _inMemoryState$appSta6 === void 0 ? void 0 : _inMemoryState$appSta6.chatDisconnectEventReceived;
|
|
749
753
|
if (chatDisconnectState && adapter) {
|
|
750
754
|
try {
|
|
751
755
|
adapter.end();
|
|
@@ -768,8 +772,9 @@ export const LiveChatWidgetStateful = props => {
|
|
|
768
772
|
});
|
|
769
773
|
}, [(_props$webChatContain9 = props.webChatContainerProps) === null || _props$webChatContain9 === void 0 ? void 0 : _props$webChatContain9.renderingMiddlewareProps]);
|
|
770
774
|
useEffect(() => {
|
|
771
|
-
TelemetryHelper.
|
|
772
|
-
Event: TelemetryEvent.
|
|
775
|
+
TelemetryHelper.logLoadingEventToAllTelemetry(LogLevel.INFO, {
|
|
776
|
+
Event: TelemetryEvent.UXLiveChatWidgetCompleted,
|
|
777
|
+
Description: "Live chat widget loading completed.",
|
|
773
778
|
ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
|
|
774
779
|
});
|
|
775
780
|
}, []);
|
|
@@ -874,8 +879,8 @@ export const LiveChatWidgetStateful = props => {
|
|
|
874
879
|
userID: userID,
|
|
875
880
|
styleOptions: {
|
|
876
881
|
...webChatStyles,
|
|
877
|
-
bubbleBackground: ((_props$webChatContain11 = props.webChatContainerProps) === null || _props$webChatContain11 === void 0 ? void 0 : (_props$webChatContain12 = _props$webChatContain11.
|
|
878
|
-
bubbleTextColor: ((_props$
|
|
882
|
+
bubbleBackground: ((_props$webChatContain11 = props.webChatContainerProps) === null || _props$webChatContain11 === void 0 ? void 0 : (_props$webChatContain12 = _props$webChatContain11.webChatStyles) === null || _props$webChatContain12 === void 0 ? void 0 : _props$webChatContain12.bubbleBackground) ?? ((_props$webChatContain13 = props.webChatContainerProps) === null || _props$webChatContain13 === void 0 ? void 0 : (_props$webChatContain14 = _props$webChatContain13.adaptiveCardStyles) === null || _props$webChatContain14 === void 0 ? void 0 : _props$webChatContain14.background) ?? defaultAdaptiveCardStyles.background,
|
|
883
|
+
bubbleTextColor: ((_props$webChatContain15 = props.webChatContainerProps) === null || _props$webChatContain15 === void 0 ? void 0 : (_props$webChatContain16 = _props$webChatContain15.webChatStyles) === null || _props$webChatContain16 === void 0 ? void 0 : _props$webChatContain16.bubbleTextColor) ?? ((_props$webChatContain17 = props.webChatContainerProps) === null || _props$webChatContain17 === void 0 ? void 0 : (_props$webChatContain18 = _props$webChatContain17.adaptiveCardStyles) === null || _props$webChatContain18 === void 0 ? void 0 : _props$webChatContain18.color) ?? defaultAdaptiveCardStyles.color
|
|
879
884
|
},
|
|
880
885
|
directLine: directLine
|
|
881
886
|
}), /*#__PURE__*/React.createElement(Stack, {
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
|
|
2
2
|
import React, { useEffect } from "react";
|
|
3
3
|
import { createTimer, findAllFocusableElement } from "../../common/utils";
|
|
4
|
+
import DOMPurify from "dompurify";
|
|
4
5
|
import { OutOfOfficeHoursPane } from "@microsoft/omnichannel-chat-components";
|
|
5
6
|
import { TelemetryHelper } from "../../common/telemetry/TelemetryHelper";
|
|
6
7
|
import { defaultGeneralStyleProps } from "./common/defaultStyleProps/defaultgeneralOOOHPaneStyleProps";
|
|
7
8
|
import useChatContextStore from "../../hooks/useChatContextStore";
|
|
8
|
-
import DOMPurify from "dompurify";
|
|
9
9
|
let uiTimer;
|
|
10
10
|
export const OutOfOfficeHoursPaneStateful = props => {
|
|
11
11
|
var _props$styleProps;
|
|
12
12
|
useEffect(() => {
|
|
13
13
|
uiTimer = createTimer();
|
|
14
|
-
TelemetryHelper.
|
|
15
|
-
Event: TelemetryEvent.
|
|
14
|
+
TelemetryHelper.logLoadingEventToAllTelemetry(LogLevel.INFO, {
|
|
15
|
+
Event: TelemetryEvent.UXOutOfOfficeHoursPaneStart,
|
|
16
|
+
Description: "Out of office hours pane loading started."
|
|
16
17
|
});
|
|
17
18
|
}, []);
|
|
18
19
|
const [state] = useChatContextStore();
|
|
@@ -29,15 +30,18 @@ export const OutOfOfficeHoursPaneStateful = props => {
|
|
|
29
30
|
|
|
30
31
|
// Move focus to the first button
|
|
31
32
|
useEffect(() => {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
firstElement[0]
|
|
33
|
+
if (state.domainStates.widgetElementId !== null && state.domainStates.widgetElementId !== undefined && state.domainStates.widgetElementId.trim() !== "") {
|
|
34
|
+
const firstElement = findAllFocusableElement(`#${state.domainStates.widgetElementId}`);
|
|
35
|
+
if (firstElement && firstElement[0]) {
|
|
36
|
+
firstElement[0].focus();
|
|
37
|
+
}
|
|
35
38
|
}
|
|
36
39
|
TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
|
|
37
40
|
Event: TelemetryEvent.OutOfOfficePaneLoaded
|
|
38
41
|
});
|
|
39
|
-
TelemetryHelper.
|
|
40
|
-
Event: TelemetryEvent.
|
|
42
|
+
TelemetryHelper.logLoadingEventToAllTelemetry(LogLevel.INFO, {
|
|
43
|
+
Event: TelemetryEvent.UXOutOfOfficeHoursPaneCompleted,
|
|
44
|
+
Description: "Out of office hours pane loading completed.",
|
|
41
45
|
ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
|
|
42
46
|
});
|
|
43
47
|
}, []);
|
|
@@ -8,14 +8,16 @@ import { TelemetryHelper } from "../../common/telemetry/TelemetryHelper";
|
|
|
8
8
|
import { defaultGeneralPostChatSurveyPaneStyleProps } from "./common/defaultStyleProps/defaultgeneralPostChatSurveyPaneStyleProps";
|
|
9
9
|
import { findAllFocusableElement } from "../../common/utils";
|
|
10
10
|
import useChatContextStore from "../../hooks/useChatContextStore";
|
|
11
|
+
import isValidSurveyUrl from "./common/isValidSurveyUrl";
|
|
11
12
|
const generateSurveyInviteLink = function (surveyInviteLink, isEmbed, locale, compact) {
|
|
12
13
|
let showMultiLingual = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
const surveyLinkParams = new URLSearchParams({
|
|
15
|
+
embed: isEmbed.toString(),
|
|
16
|
+
compact: (compact ?? true).toString(),
|
|
17
|
+
lang: locale ?? "en-us",
|
|
18
|
+
showmultilingual: (showMultiLingual ?? false).toString()
|
|
19
|
+
});
|
|
20
|
+
return `${surveyInviteLink}&${surveyLinkParams.toString()}`;
|
|
19
21
|
};
|
|
20
22
|
export const PostChatSurveyPaneStateful = props => {
|
|
21
23
|
var _props$styleProps, _state$appStates, _props$controlProps;
|
|
@@ -45,6 +47,20 @@ export const PostChatSurveyPaneStateful = props => {
|
|
|
45
47
|
surveyURL: ((_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.surveyURL) ?? surveyInviteLink,
|
|
46
48
|
...props.controlProps
|
|
47
49
|
};
|
|
50
|
+
if (controlProps.surveyURL) {
|
|
51
|
+
if (!isValidSurveyUrl(controlProps.surveyURL)) {
|
|
52
|
+
TelemetryHelper.logLoadingEvent(LogLevel.ERROR, {
|
|
53
|
+
Event: TelemetryEvent.PostChatSurveyUrlValidationFailed,
|
|
54
|
+
Description: `${controlProps.surveyURL} is not a valid Survey URL`
|
|
55
|
+
});
|
|
56
|
+
controlProps.surveyURL = "";
|
|
57
|
+
} else {
|
|
58
|
+
TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
|
|
59
|
+
Event: TelemetryEvent.PostChatSurveyUrlValidationCompleted,
|
|
60
|
+
Description: `${controlProps.surveyURL} is a valid Survey URL`
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
48
64
|
|
|
49
65
|
// Move focus to the first button
|
|
50
66
|
useEffect(() => {
|
|
@@ -68,12 +84,17 @@ export const PostChatSurveyPaneStateful = props => {
|
|
|
68
84
|
Event: TelemetryEvent.CustomerVoiceResponsePageLoaded
|
|
69
85
|
});
|
|
70
86
|
} else if (data === CustomerVoiceEvents.FormResponseSubmitted) {
|
|
71
|
-
TelemetryHelper.
|
|
72
|
-
Event: TelemetryEvent.CustomerVoiceFormResponseSubmitted
|
|
87
|
+
TelemetryHelper.logActionEventToAllTelemetry(LogLevel.INFO, {
|
|
88
|
+
Event: TelemetryEvent.CustomerVoiceFormResponseSubmitted,
|
|
89
|
+
Description: "Customer Voice form response submitted."
|
|
73
90
|
});
|
|
74
91
|
} else if (data === CustomerVoiceEvents.FormResponseError) {
|
|
75
|
-
TelemetryHelper.
|
|
76
|
-
Event: TelemetryEvent.CustomerVoiceFormResponseError
|
|
92
|
+
TelemetryHelper.logActionEventToAllTelemetry(LogLevel.ERROR, {
|
|
93
|
+
Event: TelemetryEvent.CustomerVoiceFormResponseError,
|
|
94
|
+
Description: "Customer Voice form response error.",
|
|
95
|
+
ExceptionDetails: {
|
|
96
|
+
message: "Customer Voice form response error."
|
|
97
|
+
}
|
|
77
98
|
});
|
|
78
99
|
}
|
|
79
100
|
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { isNullOrEmptyString } from "../../../common/utils";
|
|
2
|
+
const validRootDomains = ["microsoft.com", "microsoft.us", "appsplatform.us", "powervirtualagents.cn"];
|
|
3
|
+
const isValidSurveyUrl = url => {
|
|
4
|
+
if (isNullOrEmptyString(url)) {
|
|
5
|
+
return false;
|
|
6
|
+
}
|
|
7
|
+
try {
|
|
8
|
+
const objectUrl = new URL(url);
|
|
9
|
+
if (!objectUrl.origin || objectUrl.origin === "null") {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
const validDomain = validRootDomains.find(domain => objectUrl.origin.endsWith(domain));
|
|
13
|
+
if (validDomain) {
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
} catch (error) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
return false;
|
|
20
|
+
};
|
|
21
|
+
export default isValidSurveyUrl;
|
|
@@ -17,8 +17,9 @@ export const PreChatSurveyPaneStateful = props => {
|
|
|
17
17
|
var _surveyProps$stylePro, _props$surveyProps, _props$surveyProps$co;
|
|
18
18
|
useEffect(() => {
|
|
19
19
|
uiTimer = createTimer();
|
|
20
|
-
TelemetryHelper.
|
|
21
|
-
Event: TelemetryEvent.UXPrechatPaneStart
|
|
20
|
+
TelemetryHelper.logLoadingEventToAllTelemetry(LogLevel.INFO, {
|
|
21
|
+
Event: TelemetryEvent.UXPrechatPaneStart,
|
|
22
|
+
Description: "Prechat survey pane loading started."
|
|
22
23
|
});
|
|
23
24
|
}, []);
|
|
24
25
|
|
|
@@ -67,8 +68,9 @@ export const PreChatSurveyPaneStateful = props => {
|
|
|
67
68
|
payload: getAdaptiveCardPayload(state.domainStates.preChatSurveyResponse, requiredFieldMissingMessage),
|
|
68
69
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
69
70
|
onSubmit: async values => {
|
|
70
|
-
TelemetryHelper.
|
|
71
|
-
Event: TelemetryEvent.PrechatSubmitted
|
|
71
|
+
TelemetryHelper.logActionEventToAllTelemetry(LogLevel.INFO, {
|
|
72
|
+
Event: TelemetryEvent.PrechatSubmitted,
|
|
73
|
+
Description: "Prechat survey submitted."
|
|
72
74
|
});
|
|
73
75
|
dispatch({
|
|
74
76
|
type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
@@ -139,9 +141,10 @@ export const PreChatSurveyPaneStateful = props => {
|
|
|
139
141
|
TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
|
|
140
142
|
Event: TelemetryEvent.PrechatSurveyLoaded
|
|
141
143
|
});
|
|
142
|
-
TelemetryHelper.
|
|
144
|
+
TelemetryHelper.logLoadingEventToAllTelemetry(LogLevel.INFO, {
|
|
143
145
|
Event: TelemetryEvent.UXPrechatPaneCompleted,
|
|
144
|
-
ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
|
|
146
|
+
ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed,
|
|
147
|
+
Description: "Prechat survey pane loading completed."
|
|
145
148
|
});
|
|
146
149
|
}, []);
|
|
147
150
|
|
|
@@ -16,8 +16,9 @@ export const ProactiveChatPaneStateful = props => {
|
|
|
16
16
|
var _proactiveChatProps$c;
|
|
17
17
|
useEffect(() => {
|
|
18
18
|
uiTimer = createTimer();
|
|
19
|
-
TelemetryHelper.
|
|
20
|
-
Event: TelemetryEvent.UXProactiveChatPaneStart
|
|
19
|
+
TelemetryHelper.logLoadingEventToAllTelemetry(LogLevel.INFO, {
|
|
20
|
+
Event: TelemetryEvent.UXProactiveChatPaneStart,
|
|
21
|
+
Description: "Proactive chat pane loading started."
|
|
21
22
|
});
|
|
22
23
|
}, []);
|
|
23
24
|
const [state, dispatch] = useChatContextStore();
|
|
@@ -42,7 +43,7 @@ export const ProactiveChatPaneStateful = props => {
|
|
|
42
43
|
type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
43
44
|
payload: ConversationState.Closed
|
|
44
45
|
});
|
|
45
|
-
TelemetryHelper.
|
|
46
|
+
TelemetryHelper.logActionEventToAllTelemetry(LogLevel.INFO, {
|
|
46
47
|
Event: TelemetryEvent.ProactiveChatRejected,
|
|
47
48
|
ElapsedTimeInMilliseconds: TelemetryTimers.LcwLoadToChatButtonTimer.milliSecondsElapsed,
|
|
48
49
|
Description: "Proactive chat invitation timed out."
|
|
@@ -121,9 +122,10 @@ export const ProactiveChatPaneStateful = props => {
|
|
|
121
122
|
TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
|
|
122
123
|
Event: TelemetryEvent.ProactiveChatPaneLoaded
|
|
123
124
|
});
|
|
124
|
-
TelemetryHelper.
|
|
125
|
-
Event: TelemetryEvent.
|
|
126
|
-
ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
|
|
125
|
+
TelemetryHelper.logLoadingEventToAllTelemetry(LogLevel.INFO, {
|
|
126
|
+
Event: TelemetryEvent.UXProactiveChatPaneCompleted,
|
|
127
|
+
ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed,
|
|
128
|
+
Description: "Proactive chat pane loading completed."
|
|
127
129
|
});
|
|
128
130
|
return () => {
|
|
129
131
|
clearTimeout(timeoutEvent);
|