@microsoft/omnichannel-chat-widget 1.8.3-main.ec1328d → 1.8.4-main.1bfa518
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/README.md +27 -0
- package/lib/cjs/common/Constants.js +9 -0
- package/lib/cjs/common/facades/FacadeChatSDK.js +6 -0
- package/lib/cjs/common/telemetry/AppInsightsEvents.js +14 -9
- package/lib/cjs/common/telemetry/TelemetryConstants.js +49 -2
- package/lib/cjs/common/telemetry/TelemetryManager.js +10 -7
- package/lib/cjs/common/telemetry/loggers/appInsightsLogger.js +29 -13
- package/lib/cjs/common/utils/SecureEventBus.js +307 -0
- package/lib/cjs/common/utils/dispatchCustomEvent.js +25 -0
- package/lib/cjs/common/utils.js +14 -1
- package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +16 -4
- package/lib/cjs/components/citationpanestateful/CitationDim.js +29 -0
- package/lib/cjs/components/citationpanestateful/CitationPaneStateful.js +218 -0
- package/lib/cjs/components/citationpanestateful/common/defaultProps/defaultCitationPaneProps.js +70 -0
- package/lib/cjs/components/confirmationpanestateful/interfaces/IConfirmationPaneLocalizedTexts.js +1 -0
- package/lib/cjs/components/headerstateful/HeaderStateful.js +8 -2
- package/lib/cjs/components/livechatwidget/LiveChatWidget.js +4 -4
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/AddActivitySubscriber.js +127 -0
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +4 -5
- package/lib/cjs/components/livechatwidget/common/ChatWidgetEvents.js +15 -0
- package/lib/cjs/components/livechatwidget/common/PersistentConversationHandler.js +290 -0
- package/lib/cjs/components/livechatwidget/common/createAdapter.js +2 -0
- package/lib/cjs/components/livechatwidget/common/defaultProps/defaultPersistentChatHistoryProps.js +17 -0
- package/lib/cjs/components/livechatwidget/common/endChat.js +54 -12
- package/lib/cjs/components/livechatwidget/common/getMockChatSDKIfApplicable.js +4 -3
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +16 -7
- package/lib/cjs/components/livechatwidget/common/liveChatConfigUtils.js +36 -4
- package/lib/cjs/components/livechatwidget/common/overridePropsOnMockIfApplicable.js +2 -1
- package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +3 -0
- package/lib/cjs/components/livechatwidget/common/renderSurveyHelpers.js +2 -2
- package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +3 -3
- package/lib/cjs/components/livechatwidget/common/startChat.js +10 -5
- package/lib/cjs/components/livechatwidget/common/startChatErrorHandler.js +24 -4
- package/lib/cjs/components/livechatwidget/interfaces/IMockProps.js +8 -2
- package/lib/cjs/components/livechatwidget/interfaces/IPersistentChatHistoryProps.js +1 -0
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +152 -33
- package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +37 -8
- package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +12 -3
- package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +135 -26
- package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatAdapter.js +43 -14
- package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatSDK.js +6 -1
- package/lib/cjs/components/webchatcontainerstateful/common/activities/botActivity.js +14 -0
- package/lib/cjs/components/webchatcontainerstateful/common/activities/conversationDividerActivity.js +17 -0
- package/lib/cjs/components/webchatcontainerstateful/common/activityConverters/convertPersistentChatHistoryMessageToActivity.js +103 -0
- package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.js +3 -1
- package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultWebChatStatefulProps.js +1 -1
- package/lib/cjs/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles.js +1 -1
- package/lib/cjs/components/webchatcontainerstateful/common/utils/chatAdapterUtils.js +36 -2
- package/lib/cjs/components/webchatcontainerstateful/common/utils/fontUtils.js +28 -0
- package/lib/cjs/components/webchatcontainerstateful/hooks/usePersistentChatHistory.js +57 -0
- package/lib/cjs/components/webchatcontainerstateful/interfaces/ICitation.js +1 -0
- package/lib/cjs/components/webchatcontainerstateful/interfaces/IExtendedChatConffig.js +1 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.js +121 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/Constants.js +10 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/ConversationDividerActivity.js +47 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.js +1058 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LoadInlineBannerActivity.js +34 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +50 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +16 -2
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAvatarTextStyles.js +1 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultInLineBannerStyle.js +20 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageStyles.js +1 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +2 -2
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/HistoryMessageTimestamp.js +59 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +5 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +2 -2
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.js +102 -30
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.js +29 -7
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/queueOverflowHandlerMiddleware.js +2 -2
- package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +47 -45
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +9 -1
- package/lib/cjs/contexts/createReducer.js +30 -0
- package/lib/cjs/firstresponselatency/FirstMessageTrackerFromBot.js +3 -2
- package/lib/cjs/firstresponselatency/FirstResponseLatencyTracker.js +6 -2
- package/lib/cjs/index.js +9 -1
- package/lib/cjs/plugins/newMessageEventHandler.js +4 -1
- package/lib/esm/common/Constants.js +9 -0
- package/lib/esm/common/facades/FacadeChatSDK.js +6 -0
- package/lib/esm/common/telemetry/AppInsightsEvents.js +14 -9
- package/lib/esm/common/telemetry/TelemetryConstants.js +47 -1
- package/lib/esm/common/telemetry/TelemetryManager.js +10 -7
- package/lib/esm/common/telemetry/loggers/appInsightsLogger.js +30 -14
- package/lib/esm/common/utils/SecureEventBus.js +328 -0
- package/lib/esm/common/utils/dispatchCustomEvent.js +18 -0
- package/lib/esm/common/utils.js +11 -0
- package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +17 -5
- package/lib/esm/components/citationpanestateful/CitationDim.js +20 -0
- package/lib/esm/components/citationpanestateful/CitationPaneStateful.js +207 -0
- package/lib/esm/components/citationpanestateful/common/defaultProps/defaultCitationPaneProps.js +61 -0
- package/lib/esm/components/confirmationpanestateful/interfaces/IConfirmationPaneLocalizedTexts.js +1 -0
- package/lib/esm/components/headerstateful/HeaderStateful.js +9 -3
- package/lib/esm/components/livechatwidget/LiveChatWidget.js +4 -4
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/AddActivitySubscriber.js +120 -0
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +4 -5
- package/lib/esm/components/livechatwidget/common/ChatWidgetEvents.js +8 -0
- package/lib/esm/components/livechatwidget/common/PersistentConversationHandler.js +283 -0
- package/lib/esm/components/livechatwidget/common/createAdapter.js +2 -0
- package/lib/esm/components/livechatwidget/common/defaultProps/defaultPersistentChatHistoryProps.js +10 -0
- package/lib/esm/components/livechatwidget/common/endChat.js +55 -13
- package/lib/esm/components/livechatwidget/common/getMockChatSDKIfApplicable.js +4 -3
- package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +16 -7
- package/lib/esm/components/livechatwidget/common/liveChatConfigUtils.js +33 -2
- package/lib/esm/components/livechatwidget/common/overridePropsOnMockIfApplicable.js +2 -1
- package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +3 -0
- package/lib/esm/components/livechatwidget/common/renderSurveyHelpers.js +2 -2
- package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +3 -3
- package/lib/esm/components/livechatwidget/common/startChat.js +12 -7
- package/lib/esm/components/livechatwidget/common/startChatErrorHandler.js +23 -4
- package/lib/esm/components/livechatwidget/interfaces/IMockProps.js +3 -3
- package/lib/esm/components/livechatwidget/interfaces/IPersistentChatHistoryProps.js +1 -0
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +153 -34
- package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +39 -10
- package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +13 -4
- package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +135 -27
- package/lib/esm/components/webchatcontainerstateful/common/DesignerChatAdapter.js +43 -14
- package/lib/esm/components/webchatcontainerstateful/common/DesignerChatSDK.js +6 -1
- package/lib/esm/components/webchatcontainerstateful/common/activities/botActivity.js +7 -0
- package/lib/esm/components/webchatcontainerstateful/common/activities/conversationDividerActivity.js +9 -0
- package/lib/esm/components/webchatcontainerstateful/common/activityConverters/convertPersistentChatHistoryMessageToActivity.js +96 -0
- package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.js +3 -1
- package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultWebChatStatefulProps.js +2 -2
- package/lib/esm/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles.js +1 -1
- package/lib/esm/components/webchatcontainerstateful/common/utils/chatAdapterUtils.js +32 -0
- package/lib/esm/components/webchatcontainerstateful/common/utils/fontUtils.js +21 -0
- package/lib/esm/components/webchatcontainerstateful/hooks/usePersistentChatHistory.js +49 -0
- package/lib/esm/components/webchatcontainerstateful/interfaces/ICitation.js +1 -0
- package/lib/esm/components/webchatcontainerstateful/interfaces/IExtendedChatConffig.js +1 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.js +114 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/Constants.js +3 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/ConversationDividerActivity.js +39 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.js +1080 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LoadInlineBannerActivity.js +25 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +48 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +13 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAvatarTextStyles.js +1 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultInLineBannerStyle.js +13 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageStyles.js +1 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +1 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/HistoryMessageTimestamp.js +52 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +3 -2
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +1 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.js +103 -30
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.js +29 -7
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/queueOverflowHandlerMiddleware.js +2 -2
- package/lib/esm/contexts/common/LiveChatWidgetActionType.js +47 -45
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +9 -1
- package/lib/esm/contexts/createReducer.js +30 -0
- package/lib/esm/firstresponselatency/FirstMessageTrackerFromBot.js +3 -2
- package/lib/esm/firstresponselatency/FirstResponseLatencyTracker.js +6 -2
- package/lib/esm/index.js +1 -0
- package/lib/esm/plugins/newMessageEventHandler.js +4 -1
- package/lib/types/common/Constants.d.ts +8 -0
- package/lib/types/common/facades/FacadeChatSDK.d.ts +3 -1
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +44 -2
- package/lib/types/common/telemetry/interfaces/IInternalTelemetryData.d.ts +1 -0
- package/lib/types/common/utils/SecureEventBus.d.ts +159 -0
- package/lib/types/common/utils/dispatchCustomEvent.d.ts +2 -0
- package/lib/types/common/utils.d.ts +9 -1
- package/lib/types/components/citationpanestateful/CitationDim.d.ts +5 -0
- package/lib/types/components/citationpanestateful/CitationPaneStateful.d.ts +4 -0
- package/lib/types/components/citationpanestateful/common/defaultProps/defaultCitationPaneProps.d.ts +11 -0
- package/lib/types/components/citationpanestateful/interfaces/ICitationPaneStatefulProps.d.ts +19 -0
- package/lib/types/components/confirmationpanestateful/common/defaultProps/defaultConfirmationPaneLocalizedTexts.d.ts +1 -1
- package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneStatefulProps.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/ActivitySubscriber/AddActivitySubscriber.d.ts +45 -0
- package/lib/types/components/livechatwidget/common/ChatWidgetEvents.d.ts +7 -0
- package/lib/types/components/livechatwidget/common/PersistentConversationHandler.d.ts +28 -0
- package/lib/types/components/livechatwidget/common/defaultProps/defaultPersistentChatHistoryProps.d.ts +2 -0
- package/lib/types/components/livechatwidget/common/getMockChatSDKIfApplicable.d.ts +2 -1
- package/lib/types/components/livechatwidget/common/liveChatConfigUtils.d.ts +11 -0
- package/lib/types/components/livechatwidget/common/startChatErrorHandler.d.ts +1 -0
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +5 -1
- package/lib/types/components/livechatwidget/interfaces/IMockProps.d.ts +5 -3
- package/lib/types/components/livechatwidget/interfaces/IPersistentChatHistoryProps.d.ts +11 -0
- package/lib/types/components/webchatcontainerstateful/common/DesignerChatAdapter.d.ts +4 -2
- package/lib/types/components/webchatcontainerstateful/common/DesignerChatSDK.d.ts +5 -0
- package/lib/types/components/webchatcontainerstateful/common/activities/botActivity.d.ts +7 -0
- package/lib/types/components/webchatcontainerstateful/common/activities/conversationDividerActivity.d.ts +10 -0
- package/lib/types/components/webchatcontainerstateful/common/activityConverters/convertPersistentChatHistoryMessageToActivity.d.ts +2 -0
- package/lib/types/components/webchatcontainerstateful/common/utils/chatAdapterUtils.d.ts +6 -1
- package/lib/types/components/webchatcontainerstateful/common/utils/fontUtils.d.ts +10 -0
- package/lib/types/components/webchatcontainerstateful/hooks/usePersistentChatHistory.d.ts +4 -0
- package/lib/types/components/webchatcontainerstateful/interfaces/ICitation.d.ts +12 -0
- package/lib/types/components/webchatcontainerstateful/interfaces/IExtendedChatConffig.d.ts +15 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.d.ts +6 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/Constants.d.ts +3 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/ConversationDividerActivity.d.ts +4 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.d.ts +326 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LoadInlineBannerActivity.d.ts +8 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.d.ts +1 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultInLineBannerStyle.d.ts +2 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/HistoryMessageTimestamp.d.ts +2 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.d.ts +3 -4
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.d.ts +1 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/queueOverflowHandlerMiddleware.d.ts +2 -2
- package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +2 -0
- package/lib/types/contexts/common/ILiveChatWidgetLocalizedTexts.d.ts +6 -0
- package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +47 -45
- package/lib/types/index.d.ts +1 -0
- package/package.json +3 -3
- /package/lib/cjs/components/{confirmationpanestateful/interfaces/IConfirmationPaneLocalizedText.js → citationpanestateful/interfaces/ICitationPaneStatefulProps.js} +0 -0
- /package/lib/esm/components/{confirmationpanestateful/interfaces/IConfirmationPaneLocalizedText.js → citationpanestateful/interfaces/ICitationPaneStatefulProps.js} +0 -0
- /package/lib/types/components/confirmationpanestateful/interfaces/{IConfirmationPaneLocalizedText.d.ts → IConfirmationPaneLocalizedTexts.d.ts} +0 -0
|
@@ -58,18 +58,22 @@ var _startProactiveChat = require("../common/startProactiveChat");
|
|
|
58
58
|
var _useChatAdapterStore = _interopRequireDefault(require("../../../hooks/useChatAdapterStore"));
|
|
59
59
|
var _useChatContextStore = _interopRequireDefault(require("../../../hooks/useChatContextStore"));
|
|
60
60
|
var _useFacadeChatSDKStore = _interopRequireDefault(require("../../../hooks/useFacadeChatSDKStore"));
|
|
61
|
+
var _renderSurveyHelpers = require("../common/renderSurveyHelpers");
|
|
61
62
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
62
63
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
63
64
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
64
65
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
65
66
|
let uiTimer;
|
|
66
67
|
const LiveChatWidgetStateful = props => {
|
|
67
|
-
var _props$webChatContain, _props$webChatContain2, _props$webChatContain3, _props$webChatContain4, _props$webChatContain5, _props$webChatContain6, _props$webChatContain7, _props$webChatContain8, _props$webChatContain9, _props$styleProps, _props$webChatContain10, _props$webChatContain11, _props$controlProps, _props$controlProps3, _state$appStates7, _props$webChatContain15, _state$
|
|
68
|
+
var _props$webChatContain, _props$webChatContain2, _props$webChatContain3, _props$webChatContain4, _props$webChatContain5, _props$webChatContain6, _props$webChatContain7, _props$webChatContain8, _props$webChatContain9, _props$styleProps, _props$webChatContain10, _props$webChatContain11, _props$controlProps, _props$controlProps3, _state$appStates7, _props$webChatContain15, _state$appStates8, _props$webChatContain17, _props$webChatContain18, _props$controlProps12, _props$draggableChatW, _props$draggableChatW2, _props$draggableChatW3, _props$draggableChatW4, _props$draggableChatW5, _livechatProps$webCha, _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;
|
|
68
69
|
(0, _react2.useEffect)(() => {
|
|
69
70
|
uiTimer = (0, _utils.createTimer)();
|
|
70
71
|
_TelemetryHelper.TelemetryHelper.logLoadingEventToAllTelemetry(_TelemetryConstants.LogLevel.INFO, {
|
|
71
72
|
Event: _TelemetryConstants.TelemetryEvent.UXLiveChatWidgetStart,
|
|
72
|
-
Description: "Live chat widget loading started."
|
|
73
|
+
Description: "Live chat widget loading started.",
|
|
74
|
+
CustomProperties: {
|
|
75
|
+
ConversationStage: _TelemetryConstants.ConversationStage.Initialization
|
|
76
|
+
}
|
|
73
77
|
});
|
|
74
78
|
}, []);
|
|
75
79
|
const [state, dispatch] = (0, _useChatContextStore.default)();
|
|
@@ -322,7 +326,7 @@ const LiveChatWidgetStateful = props => {
|
|
|
322
326
|
});
|
|
323
327
|
});
|
|
324
328
|
_omnichannelChatComponents.BroadcastService.getMessageByEventName(_TelemetryConstants.BroadcastEvent.StartProactiveChat).subscribe(msg => {
|
|
325
|
-
_TelemetryHelper.TelemetryHelper.
|
|
329
|
+
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
326
330
|
Event: _TelemetryConstants.TelemetryEvent.StartProactiveChatEventReceived,
|
|
327
331
|
Description: "Start proactive chat event received."
|
|
328
332
|
});
|
|
@@ -448,7 +452,7 @@ const LiveChatWidgetStateful = props => {
|
|
|
448
452
|
payload: msg === null || msg === void 0 ? void 0 : (_msg$payload8 = msg.payload) === null || _msg$payload8 === void 0 ? void 0 : _msg$payload8.customContext
|
|
449
453
|
});
|
|
450
454
|
}
|
|
451
|
-
_TelemetryHelper.TelemetryHelper.
|
|
455
|
+
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
452
456
|
Event: _TelemetryConstants.TelemetryEvent.StartChatEventReceived,
|
|
453
457
|
Description: "Start chat event received."
|
|
454
458
|
});
|
|
@@ -488,24 +492,98 @@ const LiveChatWidgetStateful = props => {
|
|
|
488
492
|
eventName: _TelemetryConstants.BroadcastEvent.MaximizeChat,
|
|
489
493
|
payload: {
|
|
490
494
|
height: inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$domain = inMemoryState.domainStates) === null || _inMemoryState$domain === void 0 ? void 0 : (_inMemoryState$domain2 = _inMemoryState$domain.widgetSize) === null || _inMemoryState$domain2 === void 0 ? void 0 : _inMemoryState$domain2.height,
|
|
491
|
-
width: inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$domain3 = inMemoryState.domainStates) === null || _inMemoryState$domain3 === void 0 ? void 0 : (_inMemoryState$domain4 = _inMemoryState$domain3.widgetSize) === null || _inMemoryState$domain4 === void 0 ? void 0 : _inMemoryState$domain4.width
|
|
495
|
+
width: inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$domain3 = inMemoryState.domainStates) === null || _inMemoryState$domain3 === void 0 ? void 0 : (_inMemoryState$domain4 = _inMemoryState$domain3.widgetSize) === null || _inMemoryState$domain4 === void 0 ? void 0 : _inMemoryState$domain4.width,
|
|
496
|
+
lcwRuntimeId: _TelemetryManager.TelemetryManager.InternalTelemetryData.lcwRuntimeId
|
|
492
497
|
}
|
|
493
498
|
});
|
|
494
499
|
return;
|
|
495
500
|
}
|
|
496
501
|
});
|
|
502
|
+
const handleInitiateEndChatForPersistentChat = async (msg, conversationDetails) => {
|
|
503
|
+
var _msg$payload10, _msg$payload11, _msg$payload12;
|
|
504
|
+
//If the payload does NOT include the skipSessionCloseForPersistentChat flag, default is false. Upon receiving the customer event, always ending session from C2.
|
|
505
|
+
const skipSessionCloseForPersistentChat = typeof (msg === null || msg === void 0 ? void 0 : (_msg$payload10 = msg.payload) === null || _msg$payload10 === void 0 ? void 0 : _msg$payload10[_Constants.Constants.SkipSessionCloseForPersistentChatFlag]) === _Constants.Constants.String && (msg === null || msg === void 0 ? void 0 : (_msg$payload11 = msg.payload) === null || _msg$payload11 === void 0 ? void 0 : _msg$payload11[_Constants.Constants.SkipSessionCloseForPersistentChatFlag]).toLowerCase() === _Constants.Constants.true || (msg === null || msg === void 0 ? void 0 : (_msg$payload12 = msg.payload) === null || _msg$payload12 === void 0 ? void 0 : _msg$payload12[_Constants.Constants.SkipSessionCloseForPersistentChatFlag]) === true;
|
|
506
|
+
_TelemetryHelper.TelemetryHelper.logSDKEventToAllTelemetry(_TelemetryConstants.LogLevel.INFO, {
|
|
507
|
+
Event: _TelemetryConstants.TelemetryEvent.EndChatEventReceived,
|
|
508
|
+
Description: "Processing initiateEndChat for persistent chat",
|
|
509
|
+
CustomProperties: {
|
|
510
|
+
conversationDetails
|
|
511
|
+
}
|
|
512
|
+
});
|
|
513
|
+
const conversationState = conversationDetails === null || conversationDetails === void 0 ? void 0 : conversationDetails.state;
|
|
514
|
+
if (conversationState !== _Constants.LiveWorkItemState.Closed && conversationState !== _Constants.LiveWorkItemState.WrapUp) {
|
|
515
|
+
if (skipSessionCloseForPersistentChat) {
|
|
516
|
+
var _conversationDetails$;
|
|
517
|
+
if (((_conversationDetails$ = conversationDetails.canRenderPostChat) === null || _conversationDetails$ === void 0 ? void 0 : _conversationDetails$.toLowerCase()) === "true") {
|
|
518
|
+
var _state$domainStates3;
|
|
519
|
+
_TelemetryHelper.TelemetryHelper.logSDKEventToAllTelemetry(_TelemetryConstants.LogLevel.INFO, {
|
|
520
|
+
Event: _TelemetryConstants.TelemetryEvent.EndChatEventReceived,
|
|
521
|
+
Description: "Processing initiateEndChat, fetching postChatContext"
|
|
522
|
+
});
|
|
523
|
+
const postchatContext = (await (0, _renderSurveyHelpers.getPostChatContext)(facadeChatSDK, state, dispatch)) ?? (state === null || state === void 0 ? void 0 : (_state$domainStates3 = state.domainStates) === null || _state$domainStates3 === void 0 ? void 0 : _state$domainStates3.postChatContext);
|
|
524
|
+
if (postchatContext) {
|
|
525
|
+
_TelemetryHelper.TelemetryHelper.logSDKEventToAllTelemetry(_TelemetryConstants.LogLevel.INFO, {
|
|
526
|
+
Event: _TelemetryConstants.TelemetryEvent.EndChatEventReceived,
|
|
527
|
+
Description: "Processing initiateEndChat, initiatePostChat",
|
|
528
|
+
CustomProperties: {
|
|
529
|
+
postchatContext
|
|
530
|
+
}
|
|
531
|
+
});
|
|
532
|
+
await (0, _renderSurveyHelpers.initiatePostChat)(props, conversationDetails, state, dispatch, postchatContext);
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
} else {
|
|
536
|
+
const skipEndChatSDK = false;
|
|
537
|
+
const skipCloseChat = false;
|
|
538
|
+
_TelemetryHelper.TelemetryHelper.logSDKEventToAllTelemetry(_TelemetryConstants.LogLevel.INFO, {
|
|
539
|
+
Event: _TelemetryConstants.TelemetryEvent.EndChatEventReceived,
|
|
540
|
+
Description: "Processing initiateEndChat, trigger endChat"
|
|
541
|
+
});
|
|
542
|
+
await (0, _endChat.endChat)(props, facadeChatSDK, state, dispatch, setAdapter, setWebChatStyles, adapter, skipEndChatSDK, skipCloseChat);
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
//if conversation already closed, it is safe to unmount it upon receiving the closeChat event
|
|
546
|
+
else {
|
|
547
|
+
_omnichannelChatComponents.BroadcastService.postMessage({
|
|
548
|
+
eventName: _TelemetryConstants.BroadcastEvent.CloseChat
|
|
549
|
+
});
|
|
550
|
+
}
|
|
551
|
+
};
|
|
497
552
|
|
|
498
553
|
// End chat
|
|
499
|
-
_omnichannelChatComponents.BroadcastService.getMessageByEventName(_TelemetryConstants.BroadcastEvent.InitiateEndChat).subscribe(async
|
|
554
|
+
_omnichannelChatComponents.BroadcastService.getMessageByEventName(_TelemetryConstants.BroadcastEvent.InitiateEndChat).subscribe(async msg => {
|
|
555
|
+
_TelemetryHelper.TelemetryHelper.logSDKEventToAllTelemetry(_TelemetryConstants.LogLevel.INFO, {
|
|
556
|
+
Event: _TelemetryConstants.TelemetryEvent.EndChatEventReceived,
|
|
557
|
+
Description: "Received InitiateEndChat BroadcastEvent.",
|
|
558
|
+
CustomProperties: {
|
|
559
|
+
ConversationStage: _TelemetryConstants.ConversationStage.ConversationEnd,
|
|
560
|
+
payload: msg === null || msg === void 0 ? void 0 : msg.payload
|
|
561
|
+
}
|
|
562
|
+
});
|
|
563
|
+
const conversationDetails = await (0, _utils.getConversationDetailsCall)(facadeChatSDK);
|
|
564
|
+
const {
|
|
565
|
+
chatConfig
|
|
566
|
+
} = props;
|
|
567
|
+
const isPersistent = (0, _reconnectChatHelper.isPersistentEnabled)(chatConfig);
|
|
500
568
|
_TelemetryHelper.TelemetryHelper.logSDKEventToAllTelemetry(_TelemetryConstants.LogLevel.INFO, {
|
|
501
569
|
Event: _TelemetryConstants.TelemetryEvent.EndChatEventReceived,
|
|
502
|
-
Description: "
|
|
570
|
+
Description: "Processing initiateEndChat, fetched conversation details",
|
|
571
|
+
CustomProperties: {
|
|
572
|
+
conversationDetails,
|
|
573
|
+
isPersistent
|
|
574
|
+
}
|
|
503
575
|
});
|
|
504
|
-
|
|
505
|
-
|
|
576
|
+
if (isPersistent && conversationDetails) {
|
|
577
|
+
await handleInitiateEndChatForPersistentChat(msg, conversationDetails);
|
|
578
|
+
return;
|
|
579
|
+
}
|
|
506
580
|
const persistedState = (0, _utils.getStateFromCache)((0, _utils.getWidgetCacheIdfromProps)(props));
|
|
507
581
|
if (persistedState && persistedState.appStates.conversationState === _ConversationState.ConversationState.Active) {
|
|
508
|
-
|
|
582
|
+
_TelemetryHelper.TelemetryHelper.logSDKEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
583
|
+
Event: _TelemetryConstants.TelemetryEvent.PrepareEndChat,
|
|
584
|
+
Description: _Constants.PrepareEndChatDescriptionConstants.InitiateEndChatReceivedActiveChat
|
|
585
|
+
});
|
|
586
|
+
//We need to simulate states for closing chat, in order to messup with close confirmation pane.
|
|
509
587
|
dispatch({
|
|
510
588
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CONFIRMATION_STATE,
|
|
511
589
|
payload: _Constants.ConfirmationState.Ok
|
|
@@ -525,11 +603,8 @@ const LiveChatWidgetStateful = props => {
|
|
|
525
603
|
Event: _TelemetryConstants.TelemetryEvent.PrepareEndChat,
|
|
526
604
|
Description: _Constants.PrepareEndChatDescriptionConstants.InitiateEndChatReceived
|
|
527
605
|
});
|
|
528
|
-
(0, _endChat.endChat)(props, facadeChatSDK, state, dispatch, setAdapter, setWebChatStyles, adapter, skipEndChatSDK, skipCloseChat);
|
|
606
|
+
await (0, _endChat.endChat)(props, facadeChatSDK, state, dispatch, setAdapter, setWebChatStyles, adapter, skipEndChatSDK, skipCloseChat);
|
|
529
607
|
}
|
|
530
|
-
_omnichannelChatComponents.BroadcastService.postMessage({
|
|
531
|
-
eventName: _TelemetryConstants.BroadcastEvent.CloseChat
|
|
532
|
-
});
|
|
533
608
|
});
|
|
534
609
|
|
|
535
610
|
// End chat on browser unload
|
|
@@ -540,8 +615,8 @@ const LiveChatWidgetStateful = props => {
|
|
|
540
615
|
// Listen to end chat event from other tabs
|
|
541
616
|
const endChatEventName = (0, _utils.getWidgetEndChatEventName)((_facadeChatSDK$getCha3 = facadeChatSDK.getChatSDK()) === null || _facadeChatSDK$getCha3 === void 0 ? void 0 : (_facadeChatSDK$getCha4 = _facadeChatSDK$getCha3.omnichannelConfig) === null || _facadeChatSDK$getCha4 === void 0 ? void 0 : _facadeChatSDK$getCha4.orgId, (_facadeChatSDK$getCha5 = facadeChatSDK.getChatSDK()) === null || _facadeChatSDK$getCha5 === void 0 ? void 0 : (_facadeChatSDK$getCha6 = _facadeChatSDK$getCha5.omnichannelConfig) === null || _facadeChatSDK$getCha6 === void 0 ? void 0 : _facadeChatSDK$getCha6.widgetId, ((_props$controlProps11 = props.controlProps) === null || _props$controlProps11 === void 0 ? void 0 : _props$controlProps11.widgetInstanceId) ?? "");
|
|
542
617
|
_omnichannelChatComponents.BroadcastService.getMessageByEventName(endChatEventName).subscribe(msg => {
|
|
543
|
-
var _msg$
|
|
544
|
-
if ((msg === null || msg === void 0 ? void 0 : (_msg$
|
|
618
|
+
var _msg$payload13;
|
|
619
|
+
if ((msg === null || msg === void 0 ? void 0 : (_msg$payload13 = msg.payload) === null || _msg$payload13 === void 0 ? void 0 : _msg$payload13.runtimeId) !== _TelemetryManager.TelemetryManager.InternalTelemetryData.lcwRuntimeId) {
|
|
545
620
|
_TelemetryHelper.TelemetryHelper.logSDKEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
546
621
|
Event: _TelemetryConstants.TelemetryEvent.PrepareEndChat,
|
|
547
622
|
Description: "Received EndChat BroadcastEvent from other tabs. Closing this chat."
|
|
@@ -583,8 +658,8 @@ const LiveChatWidgetStateful = props => {
|
|
|
583
658
|
|
|
584
659
|
// Retrieve convId
|
|
585
660
|
_omnichannelChatComponents.BroadcastService.getMessageByEventName(_TelemetryConstants.BroadcastEvent.UpdateConversationDataForTelemetry).subscribe(msg => {
|
|
586
|
-
var _msg$
|
|
587
|
-
if ((_msg$
|
|
661
|
+
var _msg$payload14, _msg$payload14$liveWo;
|
|
662
|
+
if ((_msg$payload14 = msg.payload) !== null && _msg$payload14 !== void 0 && (_msg$payload14$liveWo = _msg$payload14.liveWorkItem) !== null && _msg$payload14$liveWo !== void 0 && _msg$payload14$liveWo.conversationId) {
|
|
588
663
|
setConversationId(msg.payload.liveWorkItem.conversationId);
|
|
589
664
|
}
|
|
590
665
|
});
|
|
@@ -702,14 +777,22 @@ const LiveChatWidgetStateful = props => {
|
|
|
702
777
|
}
|
|
703
778
|
}, [state.domainStates.confirmationState]);
|
|
704
779
|
(0, _react2.useEffect)(() => {
|
|
705
|
-
var
|
|
780
|
+
var _inMemoryState$appSta7, _inMemoryState$appSta8, _inMemoryState$appSta9, _inMemoryState$appSta10, _inMemoryState$appSta11, _inMemoryState$appSta12, _inMemoryState$appSta13;
|
|
781
|
+
const inMemoryState = (0, _createReducer.executeReducer)(state, {
|
|
782
|
+
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.GET_IN_MEMORY_STATE,
|
|
783
|
+
payload: null
|
|
784
|
+
});
|
|
706
785
|
// Do not process anything during initialization
|
|
707
|
-
if ((
|
|
786
|
+
if ((inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$appSta7 = inMemoryState.appStates) === null || _inMemoryState$appSta7 === void 0 ? void 0 : _inMemoryState$appSta7.conversationEndedBy) === _Constants.ConversationEndEntity.NotSet) {
|
|
787
|
+
_TelemetryHelper.TelemetryHelper.logSDKEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
788
|
+
Event: _TelemetryConstants.TelemetryEvent.PrepareEndChat,
|
|
789
|
+
Description: "conversationEndedBy is not set"
|
|
790
|
+
});
|
|
708
791
|
return;
|
|
709
792
|
}
|
|
710
793
|
|
|
711
794
|
// If start chat failed, and C2 is trying to close chat widget
|
|
712
|
-
if (
|
|
795
|
+
if (inMemoryState !== null && inMemoryState !== void 0 && (_inMemoryState$appSta8 = inMemoryState.appStates) !== null && _inMemoryState$appSta8 !== void 0 && _inMemoryState$appSta8.startChatFailed || (inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$appSta9 = inMemoryState.appStates) === null || _inMemoryState$appSta9 === void 0 ? void 0 : _inMemoryState$appSta9.conversationState) === _ConversationState.ConversationState.Postchat) {
|
|
713
796
|
_TelemetryHelper.TelemetryHelper.logSDKEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
714
797
|
Event: _TelemetryConstants.TelemetryEvent.PrepareEndChat,
|
|
715
798
|
Description: _Constants.PrepareEndChatDescriptionConstants.CustomerCloseChatOnFailureOrPostChat
|
|
@@ -719,7 +802,7 @@ const LiveChatWidgetStateful = props => {
|
|
|
719
802
|
}
|
|
720
803
|
|
|
721
804
|
// Scenario -> Chat was InActive and closing the chat (Refresh scenario on post chat)
|
|
722
|
-
if ((
|
|
805
|
+
if ((inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$appSta10 = inMemoryState.appStates) === null || _inMemoryState$appSta10 === void 0 ? void 0 : _inMemoryState$appSta10.conversationState) === _ConversationState.ConversationState.InActive) {
|
|
723
806
|
_TelemetryHelper.TelemetryHelper.logSDKEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
724
807
|
Event: _TelemetryConstants.TelemetryEvent.PrepareEndChat,
|
|
725
808
|
Description: _Constants.PrepareEndChatDescriptionConstants.CustomerCloseInactiveChat
|
|
@@ -727,11 +810,11 @@ const LiveChatWidgetStateful = props => {
|
|
|
727
810
|
(0, _endChat.endChat)(props, facadeChatSDK, state, dispatch, setAdapter, setWebChatStyles, adapter, false, false, true);
|
|
728
811
|
return;
|
|
729
812
|
}
|
|
730
|
-
const isConversationalSurveyEnabled =
|
|
813
|
+
const isConversationalSurveyEnabled = inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$appSta11 = inMemoryState.appStates) === null || _inMemoryState$appSta11 === void 0 ? void 0 : _inMemoryState$appSta11.isConversationalSurveyEnabled;
|
|
731
814
|
|
|
732
815
|
// In conversational survey, we need to check post chat survey logics before we set ConversationState to InActive
|
|
733
816
|
// Hence setting ConversationState to InActive will be done later in the post chat flows
|
|
734
|
-
if (!isConversationalSurveyEnabled && (
|
|
817
|
+
if (!isConversationalSurveyEnabled && (inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$appSta12 = inMemoryState.appStates) === null || _inMemoryState$appSta12 === void 0 ? void 0 : _inMemoryState$appSta12.conversationEndedBy) === _Constants.ConversationEndEntity.Agent || (inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$appSta13 = inMemoryState.appStates) === null || _inMemoryState$appSta13 === void 0 ? void 0 : _inMemoryState$appSta13.conversationEndedBy) === _Constants.ConversationEndEntity.Bot) {
|
|
735
818
|
dispatch({
|
|
736
819
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
737
820
|
payload: _ConversationState.ConversationState.InActive
|
|
@@ -739,8 +822,8 @@ const LiveChatWidgetStateful = props => {
|
|
|
739
822
|
}
|
|
740
823
|
|
|
741
824
|
// All other cases
|
|
742
|
-
(0, _endChat.prepareEndChat)(props, facadeChatSDK,
|
|
743
|
-
}, [state === null || state === void 0 ? void 0 : (_state$
|
|
825
|
+
(0, _endChat.prepareEndChat)(props, facadeChatSDK, inMemoryState, dispatch, setAdapter, setWebChatStyles, adapter);
|
|
826
|
+
}, [state === null || state === void 0 ? void 0 : (_state$appStates8 = state.appStates) === null || _state$appStates8 === void 0 ? void 0 : _state$appStates8.conversationEndedBy]);
|
|
744
827
|
|
|
745
828
|
// Publish chat widget state
|
|
746
829
|
(0, _react2.useEffect)(() => {
|
|
@@ -772,13 +855,13 @@ const LiveChatWidgetStateful = props => {
|
|
|
772
855
|
|
|
773
856
|
// Handle Chat disconnect cases
|
|
774
857
|
(0, _react2.useEffect)(() => {
|
|
775
|
-
var _inMemoryState$
|
|
858
|
+
var _inMemoryState$appSta14;
|
|
776
859
|
const inMemoryState = (0, _createReducer.executeReducer)(state, {
|
|
777
860
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.GET_IN_MEMORY_STATE,
|
|
778
861
|
payload: null
|
|
779
862
|
});
|
|
780
863
|
(0, _chatDisconnectHelper.handleChatDisconnect)(props, inMemoryState, setWebChatStyles);
|
|
781
|
-
const chatDisconnectState = inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$
|
|
864
|
+
const chatDisconnectState = inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$appSta14 = inMemoryState.appStates) === null || _inMemoryState$appSta14 === void 0 ? void 0 : _inMemoryState$appSta14.chatDisconnectEventReceived;
|
|
782
865
|
if (chatDisconnectState && adapter) {
|
|
783
866
|
try {
|
|
784
867
|
adapter.end();
|
|
@@ -804,7 +887,10 @@ const LiveChatWidgetStateful = props => {
|
|
|
804
887
|
_TelemetryHelper.TelemetryHelper.logLoadingEventToAllTelemetry(_TelemetryConstants.LogLevel.INFO, {
|
|
805
888
|
Event: _TelemetryConstants.TelemetryEvent.UXLiveChatWidgetCompleted,
|
|
806
889
|
Description: "Live chat widget loading completed.",
|
|
807
|
-
ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
|
|
890
|
+
ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed,
|
|
891
|
+
CustomProperties: {
|
|
892
|
+
ConversationStage: _TelemetryConstants.ConversationStage.Initialization
|
|
893
|
+
}
|
|
808
894
|
});
|
|
809
895
|
}, []);
|
|
810
896
|
const initiateEndChatOnBrowserUnload = () => {
|
|
@@ -874,25 +960,58 @@ const LiveChatWidgetStateful = props => {
|
|
|
874
960
|
bubbleTextColor
|
|
875
961
|
}), [webChatStyles, bubbleBackground, bubbleTextColor]);
|
|
876
962
|
|
|
963
|
+
// React to dynamic bot avatar initials updates from context
|
|
964
|
+
(0, _react2.useEffect)(() => {
|
|
965
|
+
if (state.domainStates.botAvatarInitials && state.domainStates.botAvatarInitials !== webChatStyles.botAvatarInitials) {
|
|
966
|
+
setWebChatStyles(styles => ({
|
|
967
|
+
...styles,
|
|
968
|
+
botAvatarInitials: state.domainStates.botAvatarInitials
|
|
969
|
+
}));
|
|
970
|
+
}
|
|
971
|
+
}, [state.domainStates.botAvatarInitials]);
|
|
972
|
+
|
|
877
973
|
// WebChat's Composer can only be rendered if a directLine object is defined
|
|
878
974
|
return directLine && /*#__PURE__*/_react2.default.createElement(_react2.default.Fragment, null, /*#__PURE__*/_react2.default.createElement("style", null, `
|
|
879
|
-
::-webkit-scrollbar {
|
|
975
|
+
#oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar {
|
|
880
976
|
width: ${scrollbarProps.width};
|
|
881
977
|
}
|
|
882
978
|
|
|
883
|
-
::-webkit-scrollbar-track {
|
|
979
|
+
#oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar-track {
|
|
884
980
|
background: ${scrollbarProps.trackBackgroundColor};
|
|
885
981
|
}
|
|
886
982
|
|
|
887
|
-
::-webkit-scrollbar-thumb {
|
|
983
|
+
#oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar-thumb {
|
|
888
984
|
background: ${scrollbarProps.thumbBackgroundColor};
|
|
889
985
|
border-radius: ${scrollbarProps.thumbBorderRadius};
|
|
890
986
|
}
|
|
891
987
|
|
|
892
|
-
::-webkit-scrollbar-thumb:hover {
|
|
988
|
+
#oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar-thumb:hover {
|
|
893
989
|
background: ${scrollbarProps.thumbHoverColor};
|
|
894
990
|
}
|
|
895
991
|
|
|
992
|
+
/* High Contrast mode support - optimized for all variants */
|
|
993
|
+
@media (prefers-contrast: high), (-ms-high-contrast: active), (forced-colors: active) {
|
|
994
|
+
#oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar-track {
|
|
995
|
+
background: Canvas !important;
|
|
996
|
+
border: 1px solid CanvasText !important;
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
#oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar-thumb {
|
|
1000
|
+
background: CanvasText !important;
|
|
1001
|
+
border: 1px solid Canvas !important;
|
|
1002
|
+
min-height: 20px !important;
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
#oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar-thumb:hover {
|
|
1006
|
+
background: Highlight !important;
|
|
1007
|
+
border: 1px solid CanvasText !important;
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
#oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar-corner {
|
|
1011
|
+
background: Canvas !important;
|
|
1012
|
+
}
|
|
1013
|
+
}
|
|
1014
|
+
|
|
896
1015
|
.webchat__basic-transcript__activity-markdown-body > :last-child {
|
|
897
1016
|
margin-bottom: 0px;
|
|
898
1017
|
}
|
|
@@ -18,6 +18,7 @@ var _isValidSurveyUrl = _interopRequireDefault(require("./common/isValidSurveyUr
|
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
19
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
20
20
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
|
+
let uiTimer;
|
|
21
22
|
const generateSurveyInviteLink = function (surveyInviteLink, isEmbed, locale, compact, customerVoiceSurveyCorrelationId) {
|
|
22
23
|
let showMultiLingual = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
|
|
23
24
|
const surveyLinkParams = new URLSearchParams({
|
|
@@ -30,20 +31,32 @@ const generateSurveyInviteLink = function (surveyInviteLink, isEmbed, locale, co
|
|
|
30
31
|
return `${surveyInviteLink}&${surveyLinkParams.toString()}`;
|
|
31
32
|
};
|
|
32
33
|
const PostChatSurveyPaneStateful = props => {
|
|
33
|
-
var _props$styleProps, _state$appStates, _props$controlProps;
|
|
34
|
+
var _props$styleProps, _state$appStates, _state$domainStates$p, _props$controlProps;
|
|
35
|
+
(0, _react.useEffect)(() => {
|
|
36
|
+
uiTimer = (0, _utils.createTimer)();
|
|
37
|
+
_TelemetryHelper.TelemetryHelper.logLoadingEventToAllTelemetry(_TelemetryConstants.LogLevel.INFO, {
|
|
38
|
+
Event: _TelemetryConstants.TelemetryEvent.UXPostChatPaneStarted,
|
|
39
|
+
Description: "Postchat survey pane loading started.",
|
|
40
|
+
CustomProperties: {
|
|
41
|
+
ConversationStage: _TelemetryConstants.ConversationStage.ConversationEnd
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}, []);
|
|
34
45
|
const [state] = (0, _useChatContextStore.default)();
|
|
35
46
|
const generalStyleProps = Object.assign({}, _defaultgeneralPostChatSurveyPaneStyleProps.defaultGeneralPostChatSurveyPaneStyleProps, (_props$styleProps = props.styleProps) === null || _props$styleProps === void 0 ? void 0 : _props$styleProps.generalStyleProps, {
|
|
36
47
|
display: state.appStates.isMinimized ? "none" : "contents"
|
|
37
48
|
});
|
|
38
49
|
let surveyInviteLink = "";
|
|
39
50
|
const surveyMode = (state === null || state === void 0 ? void 0 : (_state$appStates = state.appStates) === null || _state$appStates === void 0 ? void 0 : _state$appStates.selectedSurveyMode) === _PostChatSurveyMode.PostChatSurveyMode.Embed;
|
|
40
|
-
if (state.domainStates.postChatContext.botSurveyInviteLink &&
|
|
51
|
+
if ((_state$domainStates$p = state.domainStates.postChatContext) !== null && _state$domainStates$p !== void 0 && _state$domainStates$p.botSurveyInviteLink &&
|
|
41
52
|
// Bot survey enabled
|
|
42
53
|
state.appStates.postChatParticipantType === _Constants.ParticipantType.Bot) {
|
|
54
|
+
var _state$domainStates$p2, _state$domainStates$p3;
|
|
43
55
|
// Only Bot has engaged
|
|
44
|
-
surveyInviteLink = generateSurveyInviteLink(state.domainStates.postChatContext.botSurveyInviteLink, surveyMode, state.domainStates.postChatContext.botFormsProLocale, props.isCustomerVoiceSurveyCompact ?? true, props.customerVoiceSurveyCorrelationId || "");
|
|
56
|
+
surveyInviteLink = generateSurveyInviteLink((_state$domainStates$p2 = state.domainStates.postChatContext) === null || _state$domainStates$p2 === void 0 ? void 0 : _state$domainStates$p2.botSurveyInviteLink, surveyMode, (_state$domainStates$p3 = state.domainStates.postChatContext) === null || _state$domainStates$p3 === void 0 ? void 0 : _state$domainStates$p3.botFormsProLocale, props.isCustomerVoiceSurveyCompact ?? true, props.customerVoiceSurveyCorrelationId || "");
|
|
45
57
|
} else {
|
|
46
|
-
|
|
58
|
+
var _state$domainStates$p4, _state$domainStates$p5;
|
|
59
|
+
surveyInviteLink = generateSurveyInviteLink((_state$domainStates$p4 = state.domainStates.postChatContext) === null || _state$domainStates$p4 === void 0 ? void 0 : _state$domainStates$p4.surveyInviteLink, surveyMode, (_state$domainStates$p5 = state.domainStates.postChatContext) === null || _state$domainStates$p5 === void 0 ? void 0 : _state$domainStates$p5.formsProLocale, props.isCustomerVoiceSurveyCompact ?? true, props.customerVoiceSurveyCorrelationId || "");
|
|
47
60
|
}
|
|
48
61
|
if (props.copilotSurveyContext) {
|
|
49
62
|
surveyInviteLink = `${surveyInviteLink}&mcs_additionalcontext=${JSON.stringify(props.copilotSurveyContext)}`;
|
|
@@ -81,7 +94,14 @@ const PostChatSurveyPaneStateful = props => {
|
|
|
81
94
|
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
82
95
|
Event: _TelemetryConstants.TelemetryEvent.PostChatSurveyLoaded
|
|
83
96
|
});
|
|
84
|
-
|
|
97
|
+
_TelemetryHelper.TelemetryHelper.logLoadingEventToAllTelemetry(_TelemetryConstants.LogLevel.INFO, {
|
|
98
|
+
Event: _TelemetryConstants.TelemetryEvent.UXPostChatPaneCompleted,
|
|
99
|
+
ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed,
|
|
100
|
+
Description: "Postchat survey pane loading completed.",
|
|
101
|
+
CustomProperties: {
|
|
102
|
+
ConversationStage: _TelemetryConstants.ConversationStage.ConversationEnd
|
|
103
|
+
}
|
|
104
|
+
});
|
|
85
105
|
//Customer Voice Telemetry Events
|
|
86
106
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
87
107
|
window.addEventListener("message", message => {
|
|
@@ -94,16 +114,22 @@ const PostChatSurveyPaneStateful = props => {
|
|
|
94
114
|
Event: _TelemetryConstants.TelemetryEvent.CustomerVoiceResponsePageLoaded
|
|
95
115
|
});
|
|
96
116
|
} else if (data === _CustomerVoiceEvents.CustomerVoiceEvents.FormResponseSubmitted) {
|
|
97
|
-
_TelemetryHelper.TelemetryHelper.
|
|
117
|
+
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
98
118
|
Event: _TelemetryConstants.TelemetryEvent.CustomerVoiceFormResponseSubmitted,
|
|
99
|
-
Description: "Customer Voice form response submitted."
|
|
119
|
+
Description: "Customer Voice form response submitted.",
|
|
120
|
+
CustomProperties: {
|
|
121
|
+
ConversationStage: _TelemetryConstants.ConversationStage.ConversationEnd
|
|
122
|
+
}
|
|
100
123
|
});
|
|
101
124
|
} else if (data === _CustomerVoiceEvents.CustomerVoiceEvents.FormResponseError) {
|
|
102
|
-
_TelemetryHelper.TelemetryHelper.
|
|
125
|
+
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.ERROR, {
|
|
103
126
|
Event: _TelemetryConstants.TelemetryEvent.CustomerVoiceFormResponseError,
|
|
104
127
|
Description: "Customer Voice form response error.",
|
|
105
128
|
ExceptionDetails: {
|
|
106
129
|
message: "Customer Voice form response error."
|
|
130
|
+
},
|
|
131
|
+
CustomProperties: {
|
|
132
|
+
ConversationStage: _TelemetryConstants.ConversationStage.ConversationEnd
|
|
107
133
|
}
|
|
108
134
|
});
|
|
109
135
|
} else if (typeof data === "string" && data.startsWith(_CustomerVoiceEvents.CustomerVoiceEvents.FormsError)) {
|
|
@@ -112,6 +138,9 @@ const PostChatSurveyPaneStateful = props => {
|
|
|
112
138
|
Description: "Customer Voice failed to load with forms error.",
|
|
113
139
|
ExceptionDetails: {
|
|
114
140
|
message: `Customer Voice forms error details: ${data}`
|
|
141
|
+
},
|
|
142
|
+
CustomProperties: {
|
|
143
|
+
ConversationStage: _TelemetryConstants.ConversationStage.ConversationEnd
|
|
115
144
|
}
|
|
116
145
|
});
|
|
117
146
|
}
|
|
@@ -28,7 +28,10 @@ const PreChatSurveyPaneStateful = props => {
|
|
|
28
28
|
uiTimer = (0, _utils.createTimer)();
|
|
29
29
|
_TelemetryHelper.TelemetryHelper.logLoadingEventToAllTelemetry(_TelemetryConstants.LogLevel.INFO, {
|
|
30
30
|
Event: _TelemetryConstants.TelemetryEvent.UXPrechatPaneStart,
|
|
31
|
-
Description: "Prechat survey pane loading started."
|
|
31
|
+
Description: "Prechat survey pane loading started.",
|
|
32
|
+
CustomProperties: {
|
|
33
|
+
ConversationStage: _TelemetryConstants.ConversationStage.Initialization
|
|
34
|
+
}
|
|
32
35
|
});
|
|
33
36
|
}, []);
|
|
34
37
|
|
|
@@ -79,7 +82,10 @@ const PreChatSurveyPaneStateful = props => {
|
|
|
79
82
|
onSubmit: async values => {
|
|
80
83
|
_TelemetryHelper.TelemetryHelper.logActionEventToAllTelemetry(_TelemetryConstants.LogLevel.INFO, {
|
|
81
84
|
Event: _TelemetryConstants.TelemetryEvent.PrechatSubmitted,
|
|
82
|
-
Description: "Prechat survey submitted."
|
|
85
|
+
Description: "Prechat survey submitted.",
|
|
86
|
+
CustomProperties: {
|
|
87
|
+
ConversationStage: _TelemetryConstants.ConversationStage.Initialization
|
|
88
|
+
}
|
|
83
89
|
});
|
|
84
90
|
dispatch({
|
|
85
91
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
@@ -153,7 +159,10 @@ const PreChatSurveyPaneStateful = props => {
|
|
|
153
159
|
_TelemetryHelper.TelemetryHelper.logLoadingEventToAllTelemetry(_TelemetryConstants.LogLevel.INFO, {
|
|
154
160
|
Event: _TelemetryConstants.TelemetryEvent.UXPrechatPaneCompleted,
|
|
155
161
|
ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed,
|
|
156
|
-
Description: "Prechat survey pane loading completed."
|
|
162
|
+
Description: "Prechat survey pane loading completed.",
|
|
163
|
+
CustomProperties: {
|
|
164
|
+
ConversationStage: _TelemetryConstants.ConversationStage.Initialization
|
|
165
|
+
}
|
|
157
166
|
});
|
|
158
167
|
}, []);
|
|
159
168
|
|