@microsoft/omnichannel-chat-widget 1.8.4-main.4478bbf → 1.8.4-main.6672d3a
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 +2 -0
- package/lib/cjs/common/telemetry/AppInsightsEvents.js +11 -5
- package/lib/cjs/common/telemetry/TelemetryConstants.js +3 -0
- package/lib/cjs/common/telemetry/TelemetryManager.js +10 -7
- package/lib/cjs/components/citationpanestateful/CitationPaneStateful.js +20 -1
- package/lib/cjs/components/livechatwidget/common/ChatWidgetEvents.js +1 -1
- package/lib/cjs/components/livechatwidget/common/PersistentConversationHandler.js +26 -20
- package/lib/cjs/components/livechatwidget/common/defaultProps/defaultPersistentChatHistoryProps.js +1 -2
- package/lib/cjs/components/livechatwidget/common/endChat.js +21 -9
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +9 -2
- package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +3 -0
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +112 -26
- package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +2 -2
- package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +9 -12
- package/lib/cjs/components/webchatcontainerstateful/common/activityConverters/convertPersistentChatHistoryMessageToActivity.js +8 -2
- package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.js +2 -1
- package/lib/cjs/components/webchatcontainerstateful/hooks/usePersistentChatHistory.js +1 -3
- package/lib/cjs/components/webchatcontainerstateful/interfaces/IExtendedChatConffig.js +1 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.js +6 -7
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/ConversationDividerActivity.js +30 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.js +21 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +7 -2
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.js +6 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.js +29 -7
- package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +1 -0
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +7 -1
- package/lib/cjs/contexts/createReducer.js +15 -0
- package/lib/esm/common/Constants.js +2 -0
- package/lib/esm/common/telemetry/AppInsightsEvents.js +11 -5
- package/lib/esm/common/telemetry/TelemetryConstants.js +3 -0
- package/lib/esm/common/telemetry/TelemetryManager.js +10 -7
- package/lib/esm/components/citationpanestateful/CitationPaneStateful.js +20 -1
- package/lib/esm/components/livechatwidget/common/ChatWidgetEvents.js +1 -1
- package/lib/esm/components/livechatwidget/common/PersistentConversationHandler.js +26 -20
- package/lib/esm/components/livechatwidget/common/defaultProps/defaultPersistentChatHistoryProps.js +1 -2
- package/lib/esm/components/livechatwidget/common/endChat.js +21 -9
- package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +9 -2
- package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +3 -0
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +112 -26
- package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +2 -2
- package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +9 -15
- package/lib/esm/components/webchatcontainerstateful/common/activityConverters/convertPersistentChatHistoryMessageToActivity.js +8 -2
- package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.js +2 -1
- package/lib/esm/components/webchatcontainerstateful/hooks/usePersistentChatHistory.js +1 -3
- package/lib/esm/components/webchatcontainerstateful/interfaces/IExtendedChatConffig.js +1 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.js +6 -7
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/ConversationDividerActivity.js +30 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.js +21 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +7 -2
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.js +6 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.js +29 -7
- package/lib/esm/contexts/common/LiveChatWidgetActionType.js +1 -0
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +7 -1
- package/lib/esm/contexts/createReducer.js +15 -0
- package/lib/types/common/Constants.d.ts +2 -0
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +3 -0
- package/lib/types/common/telemetry/interfaces/IInternalTelemetryData.d.ts +1 -0
- package/lib/types/components/livechatwidget/common/ChatWidgetEvents.d.ts +1 -1
- package/lib/types/components/livechatwidget/interfaces/IPersistentChatHistoryProps.d.ts +5 -1
- package/lib/types/components/webchatcontainerstateful/interfaces/IExtendedChatConffig.d.ts +15 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.d.ts +1 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.d.ts +1 -1
- package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +1 -0
- package/lib/types/contexts/common/ILiveChatWidgetLocalizedTexts.d.ts +5 -0
- package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +2 -1
- package/package.json +1 -1
|
@@ -4,18 +4,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.localizedStringsBotInitialsMiddleware = exports.getOverriddenLocalizedStrings = void 0;
|
|
7
|
+
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
7
8
|
var _Constants = require("../../../../../common/Constants");
|
|
8
|
-
var _utils = require("../../../../../common/utils");
|
|
9
|
-
var _defaultWebChatStyles = require("../../../common/defaultStyles/defaultWebChatStyles");
|
|
10
9
|
var _WebChatActionType = require("../../enums/WebChatActionType");
|
|
10
|
+
var _defaultWebChatStyles = require("../../../common/defaultStyles/defaultWebChatStyles");
|
|
11
|
+
var _utils = require("../../../../../common/utils");
|
|
11
12
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
12
13
|
|
|
13
14
|
let currentAgentInitials = _defaultWebChatStyles.defaultWebChatStyles.botAvatarInitials;
|
|
14
|
-
|
|
15
|
+
|
|
16
|
+
// Optional external updater (React context dispatch wrapper) set at runtime
|
|
17
|
+
let externalInitialsUpdater;
|
|
18
|
+
const localizedStringsBotInitialsMiddleware = onInitialsChange => _ref => {
|
|
15
19
|
let {
|
|
16
20
|
dispatch
|
|
17
21
|
} = _ref;
|
|
18
22
|
return next => action => {
|
|
23
|
+
if (onInitialsChange && !externalInitialsUpdater) {
|
|
24
|
+
externalInitialsUpdater = onInitialsChange; // capture once
|
|
25
|
+
}
|
|
26
|
+
|
|
19
27
|
if (action.type === _WebChatActionType.WebChatActionType.DIRECT_LINE_INCOMING_ACTIVITY) {
|
|
20
28
|
var _action$payload, _activity$from;
|
|
21
29
|
const activity = (_action$payload = action.payload) === null || _action$payload === void 0 ? void 0 : _action$payload.activity;
|
|
@@ -23,10 +31,25 @@ const localizedStringsBotInitialsMiddleware = () => _ref => {
|
|
|
23
31
|
var _activity$channelData, _activity$channelData2, _activity$tags;
|
|
24
32
|
const agentName = activity.from.name.trim();
|
|
25
33
|
const isSystemMessage = agentName === "__agent__" || agentName.startsWith("__") || ((_activity$channelData = activity.channelData) === null || _activity$channelData === void 0 ? void 0 : (_activity$channelData2 = _activity$channelData.tags) === null || _activity$channelData2 === void 0 ? void 0 : _activity$channelData2.includes(_Constants.Constants.systemMessageTag)) || ((_activity$tags = activity.tags) === null || _activity$tags === void 0 ? void 0 : _activity$tags.includes(_Constants.Constants.systemMessageTag));
|
|
26
|
-
if (!isSystemMessage && agentName
|
|
27
|
-
// Update initials for valid agent/bot names
|
|
34
|
+
if (!isSystemMessage && agentName) {
|
|
28
35
|
const newInitials = (0, _utils.getIconText)(agentName) || currentAgentInitials;
|
|
29
|
-
currentAgentInitials
|
|
36
|
+
if (newInitials !== currentAgentInitials) {
|
|
37
|
+
var _externalInitialsUpda;
|
|
38
|
+
currentAgentInitials = newInitials;
|
|
39
|
+
// Notify external React context if provided
|
|
40
|
+
(_externalInitialsUpda = externalInitialsUpdater) === null || _externalInitialsUpda === void 0 ? void 0 : _externalInitialsUpda(currentAgentInitials || "");
|
|
41
|
+
// Broadcast (optional) for multi-tab sync without forcing consumers
|
|
42
|
+
_omnichannelChatComponents.BroadcastService.postMessage({
|
|
43
|
+
eventName: "BotAvatarInitialsUpdated",
|
|
44
|
+
payload: {
|
|
45
|
+
initials: currentAgentInitials
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
// Also dispatch a no-op action into WebChat store to encourage re-render (cheap)
|
|
49
|
+
dispatch({
|
|
50
|
+
type: "__BOT_INITIALS_UPDATED__"
|
|
51
|
+
});
|
|
52
|
+
}
|
|
30
53
|
}
|
|
31
54
|
}
|
|
32
55
|
}
|
|
@@ -40,7 +63,6 @@ const getOverriddenLocalizedStrings = existingOverrides => {
|
|
|
40
63
|
...strings,
|
|
41
64
|
...existingOverrides
|
|
42
65
|
};
|
|
43
|
-
|
|
44
66
|
// Apply dynamic bot initials to alt text if not already overridden through props
|
|
45
67
|
if (!(existingOverrides !== null && existingOverrides !== void 0 && existingOverrides.ACTIVITY_BOT_SAID_ALT)) {
|
|
46
68
|
result.ACTIVITY_BOT_SAID_ALT = `${currentAgentInitials} said:`;
|
|
@@ -56,4 +56,5 @@ exports.LiveChatWidgetActionType = LiveChatWidgetActionType;
|
|
|
56
56
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATIONAL_SURVEY_ENABLED"] = 46] = "SET_CONVERSATIONAL_SURVEY_ENABLED";
|
|
57
57
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATIONAL_SURVEY_DISPLAY"] = 47] = "SET_CONVERSATIONAL_SURVEY_DISPLAY";
|
|
58
58
|
LiveChatWidgetActionType[LiveChatWidgetActionType["GET_IN_MEMORY_STATE"] = 48] = "GET_IN_MEMORY_STATE";
|
|
59
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_BOT_AVATAR_INITIALS"] = 49] = "SET_BOT_AVATAR_INITIALS";
|
|
59
60
|
})(LiveChatWidgetActionType || (exports.LiveChatWidgetActionType = LiveChatWidgetActionType = {}));
|
|
@@ -10,6 +10,7 @@ var _ConversationState = require("./ConversationState");
|
|
|
10
10
|
var _StartChatFailureType = require("./StartChatFailureType");
|
|
11
11
|
var _defaultClientDataStoreProvider = require("../../common/storage/default/defaultClientDataStoreProvider");
|
|
12
12
|
var _defaultMiddlewareLocalizedTexts = require("../../components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts");
|
|
13
|
+
var _defaultWebChatStyles = require("../../components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles");
|
|
13
14
|
const getLiveChatWidgetContextInitialState = props => {
|
|
14
15
|
var _props$controlProps, _props$webChatContain;
|
|
15
16
|
const isOutsideOperatingHours = () => {
|
|
@@ -39,6 +40,10 @@ const getLiveChatWidgetContextInitialState = props => {
|
|
|
39
40
|
initialStateFromCache.domainStates.liveChatConfig = props.chatConfig;
|
|
40
41
|
// Cache the result of isOutsideOperatingHours() to ensure consistency
|
|
41
42
|
initialStateFromCache.appStates.outsideOperatingHours = outsideOperatingHours;
|
|
43
|
+
// Backward compatibility: if botAvatarInitials not cached (older sessions), seed with default
|
|
44
|
+
if (!initialStateFromCache.domainStates.botAvatarInitials) {
|
|
45
|
+
initialStateFromCache.domainStates.botAvatarInitials = _defaultWebChatStyles.defaultWebChatStyles.botAvatarInitials;
|
|
46
|
+
}
|
|
42
47
|
return initialStateFromCache;
|
|
43
48
|
}
|
|
44
49
|
const LiveChatWidgetContextInitialState = {
|
|
@@ -62,7 +67,8 @@ const getLiveChatWidgetContextInitialState = props => {
|
|
|
62
67
|
transcriptRequestId: "",
|
|
63
68
|
confirmationPaneConfirmedOptionClicked: false,
|
|
64
69
|
confirmationState: _Constants.ConfirmationState.NotSet,
|
|
65
|
-
startChatFailureType: _StartChatFailureType.StartChatFailureType.Generic
|
|
70
|
+
startChatFailureType: _StartChatFailureType.StartChatFailureType.Generic,
|
|
71
|
+
botAvatarInitials: _defaultWebChatStyles.defaultWebChatStyles.botAvatarInitials
|
|
66
72
|
},
|
|
67
73
|
appStates: {
|
|
68
74
|
conversationState: _ConversationState.ConversationState.Closed,
|
|
@@ -562,6 +562,21 @@ const reducer = (state, action) => {
|
|
|
562
562
|
widgetSize: action.payload
|
|
563
563
|
}
|
|
564
564
|
};
|
|
565
|
+
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_BOT_AVATAR_INITIALS:
|
|
566
|
+
inMemory = {
|
|
567
|
+
...inMemory,
|
|
568
|
+
domainStates: {
|
|
569
|
+
...inMemory.domainStates,
|
|
570
|
+
botAvatarInitials: action.payload
|
|
571
|
+
}
|
|
572
|
+
};
|
|
573
|
+
return {
|
|
574
|
+
...state,
|
|
575
|
+
domainStates: {
|
|
576
|
+
...state.domainStates,
|
|
577
|
+
botAvatarInitials: action.payload
|
|
578
|
+
}
|
|
579
|
+
};
|
|
565
580
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_WIDGET_INSTANCE_ID:
|
|
566
581
|
inMemory = {
|
|
567
582
|
...inMemory,
|
|
@@ -136,6 +136,7 @@ _defineProperty(Constants, "customEventName", "customEventName");
|
|
|
136
136
|
_defineProperty(Constants, "customEventValue", "customEventValue");
|
|
137
137
|
_defineProperty(Constants, "Hidden", "Hidden");
|
|
138
138
|
_defineProperty(Constants, "EndConversationDueToOverflow", "endconversationduetooverflow");
|
|
139
|
+
_defineProperty(Constants, "SkipSessionCloseForPersistentChatFlag", "skipSessionCloseForPersistentChat");
|
|
139
140
|
export const Regex = (_class = /*#__PURE__*/_createClass(function Regex() {
|
|
140
141
|
_classCallCheck(this, Regex);
|
|
141
142
|
}), _defineProperty(_class, "EmailRegex", "^(?:[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\")@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?)*|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\])$"), _class);
|
|
@@ -345,6 +346,7 @@ _defineProperty(PrepareEndChatDescriptionConstants, "ConversationEndedBy", "Conv
|
|
|
345
346
|
_defineProperty(PrepareEndChatDescriptionConstants, "PrepareEndChatError", "There's an error while preparing to end chat. Closing chat widget.");
|
|
346
347
|
_defineProperty(PrepareEndChatDescriptionConstants, "WidgetLoadFailedAfterSessionInit", "SessionInit was successful, but widget load failed. Ending chat to avoid ghost chats in OC.");
|
|
347
348
|
_defineProperty(PrepareEndChatDescriptionConstants, "InitiateEndChatReceived", "Received InitiateEndChat BroadcastEvent while conversation state is not Active. Ending chat.");
|
|
349
|
+
_defineProperty(PrepareEndChatDescriptionConstants, "InitiateEndChatReceivedActiveChat", "Received InitiateEndChat BroadcastEvent while conversation state is Active. Updating conversation states.");
|
|
348
350
|
_defineProperty(PrepareEndChatDescriptionConstants, "EndChatReceivedFromOtherTabs", "Received EndChat BroadcastEvent from other tabs. Closing this chat.");
|
|
349
351
|
_defineProperty(PrepareEndChatDescriptionConstants, "CustomerCloseChatOnFailureOrPostChat", "Customer is trying to close chat widget on start chat failure or post chat pane.");
|
|
350
352
|
_defineProperty(PrepareEndChatDescriptionConstants, "CustomerCloseInactiveChat", "Chat was Inactive and customer is trying to close chat widget or refreshing the page.");
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
export const AppInsightsEventMapping = {
|
|
2
2
|
"LCWChatButtonClicked": "LCWChatButtonActionStarted",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
3
|
+
"UXLCWChatButtonLoadingStart": "LiveChatWidgetChatButtonLoadingStarted",
|
|
4
|
+
"UXLCWChatButtonLoadingCompleted": "LiveChatWidgetChatButtonLoadingCompleted",
|
|
5
|
+
"UXPrechatPaneStart": "PrechatSurveyStarted",
|
|
6
|
+
"UXPrechatPaneCompleted": "PrechatSurveyCompleted",
|
|
7
|
+
"PrechatSubmitted": "PrechatSurveySubmitCompleted",
|
|
5
8
|
"EndChatEventReceived": "EndChatEventReceivedCompleted",
|
|
6
9
|
"EmailTranscriptSent": "EmailTranscriptActionCompleted",
|
|
7
10
|
"EmailTranscriptFailed": "EmailTranscriptActionFailed",
|
|
@@ -9,8 +12,6 @@ export const AppInsightsEventMapping = {
|
|
|
9
12
|
"HeaderMinimizeButtonClicked": "MinimizeChatActionStarted",
|
|
10
13
|
"DownloadTranscriptButtonClicked": "DownloadTranscriptActionStarted",
|
|
11
14
|
"EmailTranscriptButtonClicked": "EmailTranscriptButtonActionStarted",
|
|
12
|
-
"CustomerVoiceFormResponseSubmitted": "CustomerVoiceFormResponseSubmitCompleted",
|
|
13
|
-
"StartProactiveChatEventReceived": "StartProactiveChatEventReceivedCompleted",
|
|
14
15
|
"ProactiveChatRejected": "ProactiveChatTimeOutCompleted",
|
|
15
16
|
"MessageSent": "MessageSentCompleted",
|
|
16
17
|
"MessageReceived": "MessageReceivedCompleted",
|
|
@@ -19,5 +20,10 @@ export const AppInsightsEventMapping = {
|
|
|
19
20
|
"CustomContextReceived": "CustomContextReceivedCompleted",
|
|
20
21
|
"NewTokenValidationStarted": "AuthTokenValidationStarted",
|
|
21
22
|
"NewTokenValidationCompleted": "AuthTokenValidationCompleted",
|
|
22
|
-
"NewTokenValidationFailed": "AuthTokenValidationFailed"
|
|
23
|
+
"NewTokenValidationFailed": "AuthTokenValidationFailed",
|
|
24
|
+
"UXPostChatPaneStarted": "PostChatSurveyStarted",
|
|
25
|
+
"UXPostChatPaneCompleted": "PostChatSurveyCompleted",
|
|
26
|
+
"WidgetLoadStarted": "ChatSessionInitializationStarted",
|
|
27
|
+
"WidgetLoadComplete": "ChatSessionInitializationCompleted",
|
|
28
|
+
"WidgetLoadFailed": "ChatSessionInitializationFailed"
|
|
23
29
|
};
|
|
@@ -118,6 +118,7 @@ export let TelemetryEvent;
|
|
|
118
118
|
TelemetryEvent["EndChatFailed"] = "EndChatFailed";
|
|
119
119
|
TelemetryEvent["SettingCustomContext"] = "SettingCustomContext";
|
|
120
120
|
TelemetryEvent["WebChatLoaded"] = "WebChatLoaded";
|
|
121
|
+
TelemetryEvent["PersistentChatHistoryEnabled"] = "PersistentChatHistoryEnabled";
|
|
121
122
|
TelemetryEvent["LCWChatButtonActionCompleted"] = "LCWChatButtonActionCompleted";
|
|
122
123
|
TelemetryEvent["LCWChatButtonClicked"] = "LCWChatButtonClicked";
|
|
123
124
|
TelemetryEvent["LCWChatButtonShow"] = "LCWChatButtonShow";
|
|
@@ -299,6 +300,7 @@ export let TelemetryEvent;
|
|
|
299
300
|
TelemetryEvent["LCWPersistentConversationHandlerInitialized"] = "LCWPersistentConversationHandlerInitialized";
|
|
300
301
|
TelemetryEvent["LCWPersistentHistoryPullBlocked"] = "LCWPersistentHistoryPullBlocked";
|
|
301
302
|
TelemetryEvent["LCWPersistentHistoryPullCompleted"] = "LCWPersistentHistoryPullCompleted";
|
|
303
|
+
TelemetryEvent["LCWPersistentHistoryReturnedNull"] = "LCWPersistentHistoryReturnedNull";
|
|
302
304
|
TelemetryEvent["LCWLazyLoadInitializationStarted"] = "LCWLazyLoadInitializationStarted";
|
|
303
305
|
TelemetryEvent["LCWLazyLoadContainerNotFound"] = "LCWLazyLoadContainerNotFound";
|
|
304
306
|
TelemetryEvent["LCWLazyLoadInitializationCompleted"] = "LCWLazyLoadInitializationCompleted";
|
|
@@ -308,6 +310,7 @@ export let TelemetryEvent;
|
|
|
308
310
|
TelemetryEvent["LCWLazyLoadActivityMounted"] = "LCWLazyLoadActivityMounted";
|
|
309
311
|
TelemetryEvent["LCWLazyLoadReset"] = "LCWLazyLoadReset";
|
|
310
312
|
TelemetryEvent["LCWLazyLoadNoMoreHistory"] = "LCWLazyLoadNoMoreHistory";
|
|
313
|
+
TelemetryEvent["LCWLazyLoadHistoryError"] = "LCWLazyLoadHistoryError";
|
|
311
314
|
TelemetryEvent["LCWLazyLoadDestroyed"] = "LCWLazyLoadDestroyed";
|
|
312
315
|
TelemetryEvent["SecureEventBusUnauthorizedDispatch"] = "SecureEventBusUnauthorizedDispatch";
|
|
313
316
|
TelemetryEvent["SecureEventBusListenerError"] = "SecureEventBusListenerError";
|
|
@@ -41,7 +41,7 @@ export const RegisterLoggers = () => {
|
|
|
41
41
|
loggers.push(consoleLogger());
|
|
42
42
|
}
|
|
43
43
|
if (((_TelemetryManager$Int9 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int9 === void 0 ? void 0 : (_TelemetryManager$Int10 = _TelemetryManager$Int9.telemetryConfig) === null || _TelemetryManager$Int10 === void 0 ? void 0 : _TelemetryManager$Int10.telemetryDisabled) === false) {
|
|
44
|
-
var _TelemetryManager$Int11, _TelemetryManager$Int20, _TelemetryManager$Int21, _TelemetryManager$Int22, _TelemetryManager$Int23;
|
|
44
|
+
var _TelemetryManager$Int11, _TelemetryManager$Int20, _TelemetryManager$Int21, _TelemetryManager$Int22, _TelemetryManager$Int23, _TelemetryManager$Int24, _TelemetryManager$Int25, _TelemetryManager$Int26;
|
|
45
45
|
if ((_TelemetryManager$Int11 = TelemetryManager.InternalTelemetryData) !== null && _TelemetryManager$Int11 !== void 0 && _TelemetryManager$Int11.ariaConfig) {
|
|
46
46
|
var _TelemetryManager$Int12, _TelemetryManager$Int13, _TelemetryManager$Int14, _TelemetryManager$Int15, _TelemetryManager$Int16, _TelemetryManager$Int17, _TelemetryManager$Int18, _TelemetryManager$Int19;
|
|
47
47
|
loggers.push(ariaTelemetryLogger(((_TelemetryManager$Int12 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int12 === void 0 ? void 0 : (_TelemetryManager$Int13 = _TelemetryManager$Int12.ariaConfig) === null || _TelemetryManager$Int13 === void 0 ? void 0 : _TelemetryManager$Int13.ariaTelemetryKey) ?? defaultAriaConfig.ariaTelemetryKey, ((_TelemetryManager$Int14 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int14 === void 0 ? void 0 : (_TelemetryManager$Int15 = _TelemetryManager$Int14.ariaConfig) === null || _TelemetryManager$Int15 === void 0 ? void 0 : _TelemetryManager$Int15.disableCookieUsage) ?? defaultAriaConfig.disableCookieUsage, ((_TelemetryManager$Int16 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int16 === void 0 ? void 0 : (_TelemetryManager$Int17 = _TelemetryManager$Int16.ariaConfig) === null || _TelemetryManager$Int17 === void 0 ? void 0 : _TelemetryManager$Int17.collectorUriForTelemetry) ?? defaultAriaConfig.collectorUriForTelemetry, ((_TelemetryManager$Int18 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int18 === void 0 ? void 0 : (_TelemetryManager$Int19 = _TelemetryManager$Int18.ariaConfig) === null || _TelemetryManager$Int19 === void 0 ? void 0 : _TelemetryManager$Int19.ariaTelemetryApplicationName) ?? defaultAriaConfig.ariaTelemetryApplicationName));
|
|
@@ -52,12 +52,15 @@ export const RegisterLoggers = () => {
|
|
|
52
52
|
loggers.push(logger);
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
55
|
+
const chatConfigAppInsightsKey = (_TelemetryManager$Int22 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int22 === void 0 ? void 0 : _TelemetryManager$Int22.chatConfigAppInsightsKey;
|
|
56
|
+
const appInsightsKeyFromUser = (_TelemetryManager$Int23 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int23 === void 0 ? void 0 : (_TelemetryManager$Int24 = _TelemetryManager$Int23.appInsightsConfig) === null || _TelemetryManager$Int24 === void 0 ? void 0 : _TelemetryManager$Int24.appInsightsKey;
|
|
57
|
+
// when chatConfig has AppInsightsInstrumentationKey
|
|
58
|
+
if (chatConfigAppInsightsKey) {
|
|
59
|
+
loggers.push(appInsightsLogger(chatConfigAppInsightsKey));
|
|
60
|
+
}
|
|
61
|
+
// when key set through appInsightsConfig
|
|
62
|
+
else if (appInsightsKeyFromUser && ((_TelemetryManager$Int25 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int25 === void 0 ? void 0 : (_TelemetryManager$Int26 = _TelemetryManager$Int25.appInsightsConfig) === null || _TelemetryManager$Int26 === void 0 ? void 0 : _TelemetryManager$Int26.appInsightsDisabled) === false) {
|
|
63
|
+
loggers.push(appInsightsLogger(appInsightsKeyFromUser));
|
|
61
64
|
}
|
|
62
65
|
}
|
|
63
66
|
};
|
|
@@ -33,7 +33,7 @@ export const CitationPaneStateful = props => {
|
|
|
33
33
|
const [paneStyle, setPaneStyle] = useState(null);
|
|
34
34
|
const [isReady, setIsReady] = useState(false);
|
|
35
35
|
|
|
36
|
-
//
|
|
36
|
+
// Initial focus pattern (mirrors ConfirmationPaneStateful): focus first focusable element (will re-attempt after visibility becomes true)
|
|
37
37
|
useEffect(() => {
|
|
38
38
|
preventFocusToMoveOutOfElement(controlId);
|
|
39
39
|
const focusableElements = findAllFocusableElement(`#${controlId}`);
|
|
@@ -55,6 +55,25 @@ export const CitationPaneStateful = props => {
|
|
|
55
55
|
});
|
|
56
56
|
}, []);
|
|
57
57
|
|
|
58
|
+
// Retry focus once pane is actually visible (isReady) in case initial attempt occurred while wrapper was visibility:hidden
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
if (!isReady) return;
|
|
61
|
+
const focusableElements = findAllFocusableElement(`#${controlId}`);
|
|
62
|
+
if (focusableElements && focusableElements.length > 0) {
|
|
63
|
+
const first = focusableElements[0];
|
|
64
|
+
// If focused element is not already inside the pane, move focus
|
|
65
|
+
if (!first.contains(document.activeElement) && !(document.activeElement && document.activeElement.id.startsWith(controlId))) {
|
|
66
|
+
requestAnimationFrame(() => {
|
|
67
|
+
if (first.isConnected) {
|
|
68
|
+
first.focus({
|
|
69
|
+
preventScroll: true
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}, [isReady, controlId]);
|
|
76
|
+
|
|
58
77
|
// Compute the widget bounds and set pane style accordingly (95% of widget size
|
|
59
78
|
// and centered inside the widget). If the widget container can't be found,
|
|
60
79
|
// fall back to the default pane styles from defaultCitationPaneProps.
|
|
@@ -3,6 +3,6 @@ var ChatWidgetEvents;
|
|
|
3
3
|
ChatWidgetEvents["ADD_ACTIVITY"] = "CHAT_WIDGET/ADD_ACTIVITY";
|
|
4
4
|
ChatWidgetEvents["FETCH_PERSISTENT_CHAT_HISTORY"] = "CHAT_WIDGET/FETCH_PERSISTENT_CHAT_HISTORY";
|
|
5
5
|
ChatWidgetEvents["NO_MORE_HISTORY_AVAILABLE"] = "CHAT_WIDGET/NO_MORE_HISTORY_AVAILABLE";
|
|
6
|
-
ChatWidgetEvents["
|
|
6
|
+
ChatWidgetEvents["HISTORY_LOAD_ERROR"] = "CHAT_WIDGET/HISTORY_LOAD_ERROR";
|
|
7
7
|
})(ChatWidgetEvents || (ChatWidgetEvents = {}));
|
|
8
8
|
export default ChatWidgetEvents;
|
|
@@ -30,7 +30,7 @@ let PersistentConversationHandler = /*#__PURE__*/function () {
|
|
|
30
30
|
_defineProperty(this, "facadeChatSDK", void 0);
|
|
31
31
|
_defineProperty(this, "lastMessage", null);
|
|
32
32
|
_defineProperty(this, "count", 0);
|
|
33
|
-
_defineProperty(this, "pageSize",
|
|
33
|
+
_defineProperty(this, "pageSize", defaultPersistentChatHistoryProps.pageSize);
|
|
34
34
|
_defineProperty(this, "isCurrentlyPulling", false);
|
|
35
35
|
_defineProperty(this, "pageTokenInTransitSet", new Set());
|
|
36
36
|
_defineProperty(this, "resetEventListener", BroadcastService.getMessageByEventName(BroadcastEvent.PersistentConversationReset).subscribe(() => {
|
|
@@ -42,18 +42,21 @@ let PersistentConversationHandler = /*#__PURE__*/function () {
|
|
|
42
42
|
Event: TelemetryEvent.LCWPersistentConversationHandlerInitialized,
|
|
43
43
|
Description: "PersistentConversationHandler initialized",
|
|
44
44
|
CustomProperties: {
|
|
45
|
-
pageSize:
|
|
45
|
+
pageSize: defaultPersistentChatHistoryProps.pageSize
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
49
|
_createClass(PersistentConversationHandler, [{
|
|
50
50
|
key: "appliedPropsHandler",
|
|
51
51
|
value: function appliedPropsHandler(props) {
|
|
52
|
+
var _this$appliedProps;
|
|
52
53
|
this.appliedProps = {
|
|
53
54
|
...defaultPersistentChatHistoryProps,
|
|
54
55
|
...props
|
|
55
56
|
};
|
|
56
|
-
|
|
57
|
+
|
|
58
|
+
// if the props is not existent or is not a number then default to defaultPersistentChatHistoryProps.pageSize
|
|
59
|
+
this.pageSize = ((_this$appliedProps = this.appliedProps) === null || _this$appliedProps === void 0 ? void 0 : _this$appliedProps.pageSize) !== undefined && !isNaN(this.appliedProps.pageSize) ? this.appliedProps.pageSize : defaultPersistentChatHistoryProps.pageSize;
|
|
57
60
|
}
|
|
58
61
|
}, {
|
|
59
62
|
key: "reset",
|
|
@@ -98,12 +101,23 @@ let PersistentConversationHandler = /*#__PURE__*/function () {
|
|
|
98
101
|
try {
|
|
99
102
|
var _ref;
|
|
100
103
|
const messages = await this.fetchHistoryMessages();
|
|
101
|
-
|
|
104
|
+
|
|
105
|
+
// Handle error case - null indicates an error occurred
|
|
106
|
+
// Don't mark as last pull to allow retry on next attempt
|
|
107
|
+
if (messages == null) {
|
|
108
|
+
TelemetryHelper.logActionEvent(LogLevel.WARN, {
|
|
109
|
+
Event: TelemetryEvent.LCWPersistentHistoryReturnedNull,
|
|
110
|
+
Description: "History pull returned null - Possible error occurred, will retry on next scroll",
|
|
111
|
+
ElapsedTimeInMilliseconds: pullTimer.milliSecondsElapsed
|
|
112
|
+
});
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// Handle legitimate end of history - empty array
|
|
117
|
+
if (messages.length === 0) {
|
|
102
118
|
this.isLastPull = true;
|
|
103
119
|
// Dispatch event to notify UI that no more history is available
|
|
104
120
|
dispatchCustomEvent(ChatWidgetEvents.NO_MORE_HISTORY_AVAILABLE);
|
|
105
|
-
// Also hide the loading banner
|
|
106
|
-
dispatchCustomEvent(ChatWidgetEvents.HIDE_LOADING_BANNER);
|
|
107
121
|
TelemetryHelper.logActionEvent(LogLevel.INFO, {
|
|
108
122
|
Event: TelemetryEvent.LCWPersistentHistoryPullCompleted,
|
|
109
123
|
Description: "History pull completed - no more messages",
|
|
@@ -113,9 +127,6 @@ let PersistentConversationHandler = /*#__PURE__*/function () {
|
|
|
113
127
|
}
|
|
114
128
|
const messagesDescOrder = (_ref = [...messages]) === null || _ref === void 0 ? void 0 : _ref.reverse();
|
|
115
129
|
this.processHistoryMessages(messagesDescOrder);
|
|
116
|
-
|
|
117
|
-
// Dispatch event to hide the loading banner after messages are processed
|
|
118
|
-
dispatchCustomEvent(ChatWidgetEvents.HIDE_LOADING_BANNER);
|
|
119
130
|
TelemetryHelper.logActionEvent(LogLevel.INFO, {
|
|
120
131
|
Event: TelemetryEvent.LCWPersistentHistoryPullCompleted,
|
|
121
132
|
Description: "History pull completed successfully",
|
|
@@ -171,7 +182,6 @@ let PersistentConversationHandler = /*#__PURE__*/function () {
|
|
|
171
182
|
if (!this.shouldPull()) {
|
|
172
183
|
// Dispatch event to ensure banner is hidden when no more pulls are needed
|
|
173
184
|
dispatchCustomEvent(ChatWidgetEvents.NO_MORE_HISTORY_AVAILABLE);
|
|
174
|
-
dispatchCustomEvent(ChatWidgetEvents.HIDE_LOADING_BANNER);
|
|
175
185
|
return [];
|
|
176
186
|
}
|
|
177
187
|
const options = {
|
|
@@ -197,24 +207,20 @@ let PersistentConversationHandler = /*#__PURE__*/function () {
|
|
|
197
207
|
this.isLastPull = true;
|
|
198
208
|
// Dispatch event when we reach the end of available history
|
|
199
209
|
dispatchCustomEvent(ChatWidgetEvents.NO_MORE_HISTORY_AVAILABLE);
|
|
200
|
-
// Also hide the loading banner
|
|
201
|
-
dispatchCustomEvent(ChatWidgetEvents.HIDE_LOADING_BANNER);
|
|
202
210
|
return [];
|
|
203
211
|
}
|
|
204
|
-
dispatchCustomEvent(ChatWidgetEvents.HIDE_LOADING_BANNER);
|
|
205
212
|
return messages;
|
|
206
213
|
} catch (error) {
|
|
207
214
|
TelemetryHelper.logSDKEvent(LogLevel.ERROR, {
|
|
208
215
|
Event: TelemetryEvent.FetchPersistentChatHistoryFailed,
|
|
209
216
|
ExceptionDetails: error
|
|
210
217
|
});
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
//
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
return [];
|
|
218
|
+
|
|
219
|
+
// On error, dispatch HISTORY_LOAD_ERROR to hide loading banner without marking conversation as ended
|
|
220
|
+
// This allows recovery on the next attempt (e.g., transient network errors)
|
|
221
|
+
// Return null to distinguish error from legitimate empty history
|
|
222
|
+
dispatchCustomEvent(ChatWidgetEvents.HISTORY_LOAD_ERROR);
|
|
223
|
+
return null;
|
|
218
224
|
}
|
|
219
225
|
}
|
|
220
226
|
}, {
|
|
@@ -195,6 +195,18 @@ const endChat = async (props, facadeChatSDK, state, dispatch, setAdapter, setWeb
|
|
|
195
195
|
facadeChatSDK.destroy();
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
|
+
|
|
199
|
+
//moving logic below to before processing skipCloseChat logic to avoid race conditions of postMessage for endChatEvent for other tabs vs postMessage for CloseChat
|
|
200
|
+
//TODO: clarify if this postMessageToOtherTab actually works in production.
|
|
201
|
+
if (postMessageToOtherTab) {
|
|
202
|
+
const endChatEventName = await getEndChatEventName(facadeChatSDK, props);
|
|
203
|
+
BroadcastService.postMessage({
|
|
204
|
+
eventName: endChatEventName,
|
|
205
|
+
payload: {
|
|
206
|
+
runtimeId: TelemetryManager.InternalTelemetryData.lcwRuntimeId
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
}
|
|
198
210
|
if (!skipCloseChat) {
|
|
199
211
|
try {
|
|
200
212
|
var _props$webChatContain;
|
|
@@ -234,17 +246,17 @@ const endChat = async (props, facadeChatSDK, state, dispatch, setAdapter, setWeb
|
|
|
234
246
|
});
|
|
235
247
|
closeChatWidget(dispatch, setWebChatStyles, props);
|
|
236
248
|
facadeChatSDK.destroy();
|
|
249
|
+
|
|
250
|
+
//always post the close chat event after chat closed and cleanup completed
|
|
251
|
+
BroadcastService.postMessage({
|
|
252
|
+
eventName: BroadcastEvent.CloseChat
|
|
253
|
+
});
|
|
254
|
+
TelemetryHelper.logActionEvent(LogLevel.INFO, {
|
|
255
|
+
Event: TelemetryEvent.CloseChatCall,
|
|
256
|
+
Description: "Broadcasted close chat event"
|
|
257
|
+
});
|
|
237
258
|
}
|
|
238
259
|
}
|
|
239
|
-
if (postMessageToOtherTab) {
|
|
240
|
-
const endChatEventName = await getEndChatEventName(facadeChatSDK, props);
|
|
241
|
-
BroadcastService.postMessage({
|
|
242
|
-
eventName: endChatEventName,
|
|
243
|
-
payload: {
|
|
244
|
-
runtimeId: TelemetryManager.InternalTelemetryData.lcwRuntimeId
|
|
245
|
-
}
|
|
246
|
-
});
|
|
247
|
-
}
|
|
248
260
|
};
|
|
249
261
|
export const callingStateCleanUp = dispatch => {
|
|
250
262
|
dispatch({
|
|
@@ -120,7 +120,14 @@ export const initWebChatComposer = (props, state, dispatch, facadeChatSDK, endCh
|
|
|
120
120
|
};
|
|
121
121
|
webChatStore = createStore({},
|
|
122
122
|
//initial state
|
|
123
|
-
preProcessingMiddleware, attachmentProcessingMiddleware, createAttachmentUploadValidatorMiddleware((_state$domainStates$l = state.domainStates.liveChatConfig) === null || _state$domainStates$l === void 0 ? void 0 : _state$domainStates$l.allowedFileExtensions, (_state$domainStates$l2 = state.domainStates.liveChatConfig) === null || _state$domainStates$l2 === void 0 ? void 0 : _state$domainStates$l2.maxUploadFileSize, localizedTexts), createCustomEventMiddleware(BroadcastService), createQueueOverflowMiddleware(state, dispatch), channelDataMiddleware(addConversationalSurveyTagsCallback), createConversationEndMiddleware(conversationEndCallback, startConversationalSurveyCallback, endConversationalSurveyCallback), createDataMaskingMiddleware((_state$domainStates$l3 = state.domainStates.liveChatConfig) === null || _state$domainStates$l3 === void 0 ? void 0 : _state$domainStates$l3.DataMaskingInfo), createMessageTimeStampMiddleware, createMessageSequenceIdOverrideMiddleware, createCitationsMiddleware(state, dispatch), gifUploadMiddleware, htmlPlayerMiddleware, htmlTextMiddleware(honorsTargetInHTMLLinks), createMaxMessageSizeValidator(localizedTexts), sanitizationMiddleware, createCallActionMiddleware(),
|
|
123
|
+
preProcessingMiddleware, attachmentProcessingMiddleware, createAttachmentUploadValidatorMiddleware((_state$domainStates$l = state.domainStates.liveChatConfig) === null || _state$domainStates$l === void 0 ? void 0 : _state$domainStates$l.allowedFileExtensions, (_state$domainStates$l2 = state.domainStates.liveChatConfig) === null || _state$domainStates$l2 === void 0 ? void 0 : _state$domainStates$l2.maxUploadFileSize, localizedTexts), createCustomEventMiddleware(BroadcastService), createQueueOverflowMiddleware(state, dispatch), channelDataMiddleware(addConversationalSurveyTagsCallback), createConversationEndMiddleware(conversationEndCallback, startConversationalSurveyCallback, endConversationalSurveyCallback), createDataMaskingMiddleware((_state$domainStates$l3 = state.domainStates.liveChatConfig) === null || _state$domainStates$l3 === void 0 ? void 0 : _state$domainStates$l3.DataMaskingInfo), createMessageTimeStampMiddleware, createMessageSequenceIdOverrideMiddleware, createCitationsMiddleware(state, dispatch), gifUploadMiddleware, htmlPlayerMiddleware, htmlTextMiddleware(honorsTargetInHTMLLinks), createMaxMessageSizeValidator(localizedTexts), sanitizationMiddleware, createCallActionMiddleware(),
|
|
124
|
+
// Pass a callback so middleware can push initials into React context for reactivity
|
|
125
|
+
localizedStringsBotInitialsMiddleware(initials => {
|
|
126
|
+
dispatch({
|
|
127
|
+
type: LiveChatWidgetActionType.SET_BOT_AVATAR_INITIALS,
|
|
128
|
+
payload: initials
|
|
129
|
+
});
|
|
130
|
+
}),
|
|
124
131
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
125
132
|
...(((_props$webChatContain7 = props.webChatContainerProps) === null || _props$webChatContain7 === void 0 ? void 0 : _props$webChatContain7.storeMiddlewares) ?? []));
|
|
126
133
|
WebChatStoreLoader.store = webChatStore;
|
|
@@ -163,7 +170,7 @@ export const initWebChatComposer = (props, state, dispatch, facadeChatSDK, endCh
|
|
|
163
170
|
dir: state.domainStates.globalDir,
|
|
164
171
|
locale: changeLanguageCodeFormatForWebChat(getLocaleStringFromId((_state$domainStates$l4 = state.domainStates.liveChatConfig) === null || _state$domainStates$l4 === void 0 ? void 0 : (_state$domainStates$l5 = _state$domainStates$l4.ChatWidgetLanguage) === null || _state$domainStates$l5 === void 0 ? void 0 : _state$domainStates$l5.msdyn_localeid)),
|
|
165
172
|
store: webChatStore,
|
|
166
|
-
activityMiddleware: (_props$webChatContain11 = props.webChatContainerProps) !== null && _props$webChatContain11 !== void 0 && (_props$webChatContain12 = _props$webChatContain11.renderingMiddlewareProps) !== null && _props$webChatContain12 !== void 0 && _props$webChatContain12.disableActivityMiddleware ? undefined : createActivityMiddleware(renderMarkdown, (_state$domainStates$r = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r === void 0 ? void 0 : _state$domainStates$r.systemMessageStyleProps, (_state$domainStates$r2 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r2 === void 0 ? void 0 : _state$domainStates$r2.userMessageStyleProps),
|
|
173
|
+
activityMiddleware: (_props$webChatContain11 = props.webChatContainerProps) !== null && _props$webChatContain11 !== void 0 && (_props$webChatContain12 = _props$webChatContain11.renderingMiddlewareProps) !== null && _props$webChatContain12 !== void 0 && _props$webChatContain12.disableActivityMiddleware ? undefined : createActivityMiddleware(renderMarkdown, (_state$domainStates$r = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r === void 0 ? void 0 : _state$domainStates$r.systemMessageStyleProps, (_state$domainStates$r2 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r2 === void 0 ? void 0 : _state$domainStates$r2.userMessageStyleProps, localizedTexts),
|
|
167
174
|
attachmentMiddleware: (_props$webChatContain13 = props.webChatContainerProps) !== null && _props$webChatContain13 !== void 0 && (_props$webChatContain14 = _props$webChatContain13.renderingMiddlewareProps) !== null && _props$webChatContain14 !== void 0 && _props$webChatContain14.disableAttachmentMiddleware ? undefined : createAttachmentMiddleware(((_state$domainStates$r3 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r3 === void 0 ? void 0 : (_state$domainStates$r4 = _state$domainStates$r3.attachmentProps) === null || _state$domainStates$r4 === void 0 ? void 0 : _state$domainStates$r4.enableInlinePlaying) ?? defaultAttachmentProps.enableInlinePlaying),
|
|
168
175
|
activityStatusMiddleware: (_props$webChatContain15 = props.webChatContainerProps) !== null && _props$webChatContain15 !== void 0 && (_props$webChatContain16 = _props$webChatContain15.renderingMiddlewareProps) !== null && _props$webChatContain16 !== void 0 && _props$webChatContain16.disableActivityStatusMiddleware ? undefined : createActivityStatusMiddleware(getLocaleStringFromId((_state$domainStates$l6 = state.domainStates.liveChatConfig) === null || _state$domainStates$l6 === void 0 ? void 0 : (_state$domainStates$l7 = _state$domainStates$l6.ChatWidgetLanguage) === null || _state$domainStates$l7 === void 0 ? void 0 : _state$domainStates$l7.msdyn_localeid)),
|
|
169
176
|
toastMiddleware: (_props$webChatContain17 = props.webChatContainerProps) !== null && _props$webChatContain17 !== void 0 && (_props$webChatContain18 = _props$webChatContain17.renderingMiddlewareProps) !== null && _props$webChatContain18 !== void 0 && _props$webChatContain18.disableToastMiddleware ? undefined : createToastMiddleware(props.notificationPaneProps, endChat),
|
|
@@ -24,7 +24,10 @@ export const registerTelemetryLoggers = (props, dispatch) => {
|
|
|
24
24
|
appInsightsConfig: Object.assign({}, defaultAppInsightsConfig, props.appInsightsConfig)
|
|
25
25
|
};
|
|
26
26
|
if (props.chatConfig) {
|
|
27
|
+
var _props$chatConfig$Liv;
|
|
27
28
|
telemetryData = TelemetryHelper.addChatConfigDataToTelemetry(props === null || props === void 0 ? void 0 : props.chatConfig, telemetryData);
|
|
29
|
+
//store AppInsights instrumentation key from chatConfig if present
|
|
30
|
+
telemetryData.chatConfigAppInsightsKey = (_props$chatConfig$Liv = props.chatConfig.LiveWSAndLiveChatEngJoin) === null || _props$chatConfig$Liv === void 0 ? void 0 : _props$chatConfig$Liv.AppInsightsInstrumentationKey;
|
|
28
31
|
}
|
|
29
32
|
if (!((_props$chatSDK = props.chatSDK) !== null && _props$chatSDK !== void 0 && (_props$chatSDK$omnich = _props$chatSDK.omnichannelConfig) !== null && _props$chatSDK$omnich !== void 0 && _props$chatSDK$omnich.orgId) || ((_props$chatSDK2 = props.chatSDK) === null || _props$chatSDK2 === void 0 ? void 0 : (_props$chatSDK2$omnic = _props$chatSDK2.omnichannelConfig) === null || _props$chatSDK2$omnic === void 0 ? void 0 : _props$chatSDK2$omnic.orgId.trim().length) === 0) {
|
|
30
33
|
throw new Error("orgId is undefined in ChatSDK");
|