@microsoft/omnichannel-chat-widget 1.8.2 → 1.8.3-main.1381896

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.
Files changed (95) hide show
  1. package/lib/cjs/common/Constants.js +2 -0
  2. package/lib/cjs/common/telemetry/TelemetryConstants.js +4 -0
  3. package/lib/cjs/common/telemetry/TelemetryHelper.js +7 -5
  4. package/lib/cjs/components/citationpanestateful/CitationDim.js +29 -0
  5. package/lib/cjs/components/citationpanestateful/CitationPaneStateful.js +199 -0
  6. package/lib/cjs/components/citationpanestateful/common/defaultProps/defaultCitationPaneProps.js +70 -0
  7. package/lib/cjs/components/confirmationpanestateful/interfaces/IConfirmationPaneLocalizedTexts.js +1 -0
  8. package/lib/cjs/components/livechatwidget/LiveChatWidget.js +4 -4
  9. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +4 -5
  10. package/lib/cjs/components/livechatwidget/common/endChat.js +33 -4
  11. package/lib/cjs/components/livechatwidget/common/getMockChatSDKIfApplicable.js +4 -3
  12. package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +12 -9
  13. package/lib/cjs/components/livechatwidget/common/overridePropsOnMockIfApplicable.js +2 -1
  14. package/lib/cjs/components/livechatwidget/common/startChat.js +7 -5
  15. package/lib/cjs/components/livechatwidget/interfaces/IMockProps.js +8 -2
  16. package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +41 -11
  17. package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +114 -13
  18. package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatAdapter.js +43 -14
  19. package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatSDK.js +6 -1
  20. package/lib/cjs/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles.js +1 -1
  21. package/lib/cjs/components/webchatcontainerstateful/common/utils/chatAdapterUtils.js +36 -2
  22. package/lib/cjs/components/webchatcontainerstateful/common/utils/fontUtils.js +28 -0
  23. package/lib/cjs/components/webchatcontainerstateful/interfaces/ICitation.js +1 -0
  24. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAvatarTextStyles.js +1 -1
  25. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageStyles.js +1 -1
  26. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.js +139 -0
  27. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.js +54 -0
  28. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/queueOverflowHandlerMiddleware.js +2 -2
  29. package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +46 -45
  30. package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +2 -0
  31. package/lib/cjs/contexts/createReducer.js +15 -0
  32. package/lib/cjs/firstresponselatency/util.js +12 -2
  33. package/lib/cjs/index.js +9 -1
  34. package/lib/cjs/plugins/newMessageEventHandler.js +2 -2
  35. package/lib/esm/common/Constants.js +2 -0
  36. package/lib/esm/common/telemetry/TelemetryConstants.js +4 -0
  37. package/lib/esm/common/telemetry/TelemetryHelper.js +7 -5
  38. package/lib/esm/components/citationpanestateful/CitationDim.js +20 -0
  39. package/lib/esm/components/citationpanestateful/CitationPaneStateful.js +188 -0
  40. package/lib/esm/components/citationpanestateful/common/defaultProps/defaultCitationPaneProps.js +61 -0
  41. package/lib/esm/components/confirmationpanestateful/interfaces/IConfirmationPaneLocalizedTexts.js +1 -0
  42. package/lib/esm/components/livechatwidget/LiveChatWidget.js +4 -4
  43. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +4 -5
  44. package/lib/esm/components/livechatwidget/common/endChat.js +34 -5
  45. package/lib/esm/components/livechatwidget/common/getMockChatSDKIfApplicable.js +4 -3
  46. package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +13 -10
  47. package/lib/esm/components/livechatwidget/common/overridePropsOnMockIfApplicable.js +2 -1
  48. package/lib/esm/components/livechatwidget/common/startChat.js +7 -5
  49. package/lib/esm/components/livechatwidget/interfaces/IMockProps.js +3 -3
  50. package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +41 -11
  51. package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +114 -14
  52. package/lib/esm/components/webchatcontainerstateful/common/DesignerChatAdapter.js +43 -14
  53. package/lib/esm/components/webchatcontainerstateful/common/DesignerChatSDK.js +6 -1
  54. package/lib/esm/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles.js +1 -1
  55. package/lib/esm/components/webchatcontainerstateful/common/utils/chatAdapterUtils.js +32 -0
  56. package/lib/esm/components/webchatcontainerstateful/common/utils/fontUtils.js +21 -0
  57. package/lib/esm/components/webchatcontainerstateful/interfaces/ICitation.js +1 -0
  58. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAvatarTextStyles.js +1 -1
  59. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageStyles.js +1 -1
  60. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.js +133 -0
  61. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.js +46 -0
  62. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/queueOverflowHandlerMiddleware.js +2 -2
  63. package/lib/esm/contexts/common/LiveChatWidgetActionType.js +46 -45
  64. package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +2 -0
  65. package/lib/esm/contexts/createReducer.js +15 -0
  66. package/lib/esm/firstresponselatency/util.js +9 -0
  67. package/lib/esm/index.js +1 -0
  68. package/lib/esm/plugins/newMessageEventHandler.js +3 -3
  69. package/lib/types/common/Constants.d.ts +2 -0
  70. package/lib/types/common/telemetry/TelemetryConstants.d.ts +4 -0
  71. package/lib/types/components/citationpanestateful/CitationDim.d.ts +5 -0
  72. package/lib/types/components/citationpanestateful/CitationPaneStateful.d.ts +4 -0
  73. package/lib/types/components/citationpanestateful/common/defaultProps/defaultCitationPaneProps.d.ts +11 -0
  74. package/lib/types/components/citationpanestateful/interfaces/ICitationPaneStatefulProps.d.ts +19 -0
  75. package/lib/types/components/confirmationpanestateful/common/defaultProps/defaultConfirmationPaneLocalizedTexts.d.ts +1 -1
  76. package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneStatefulProps.d.ts +1 -1
  77. package/lib/types/components/livechatwidget/common/getMockChatSDKIfApplicable.d.ts +2 -1
  78. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +3 -1
  79. package/lib/types/components/livechatwidget/interfaces/IMockProps.d.ts +5 -3
  80. package/lib/types/components/webchatcontainerstateful/common/DesignerChatAdapter.d.ts +4 -2
  81. package/lib/types/components/webchatcontainerstateful/common/DesignerChatSDK.d.ts +5 -0
  82. package/lib/types/components/webchatcontainerstateful/common/utils/chatAdapterUtils.d.ts +6 -1
  83. package/lib/types/components/webchatcontainerstateful/common/utils/fontUtils.d.ts +10 -0
  84. package/lib/types/components/webchatcontainerstateful/interfaces/ICitation.d.ts +12 -0
  85. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.d.ts +4 -0
  86. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.d.ts +5 -0
  87. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/queueOverflowHandlerMiddleware.d.ts +2 -2
  88. package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +1 -0
  89. package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +46 -45
  90. package/lib/types/firstresponselatency/util.d.ts +1 -0
  91. package/lib/types/index.d.ts +1 -0
  92. package/package.json +4 -3
  93. /package/lib/cjs/components/{confirmationpanestateful/interfaces/IConfirmationPaneLocalizedText.js → citationpanestateful/interfaces/ICitationPaneStatefulProps.js} +0 -0
  94. /package/lib/esm/components/{confirmationpanestateful/interfaces/IConfirmationPaneLocalizedText.js → citationpanestateful/interfaces/ICitationPaneStatefulProps.js} +0 -0
  95. /package/lib/types/components/confirmationpanestateful/interfaces/{IConfirmationPaneLocalizedText.d.ts → IConfirmationPaneLocalizedTexts.d.ts} +0 -0
@@ -7,6 +7,7 @@ exports.default = void 0;
7
7
  const overridePropsOnMockIfApplicable = props => {
8
8
  var _props$mock, _props$mock2;
9
9
  if (props !== null && props !== void 0 && (_props$mock = props.mock) !== null && _props$mock !== void 0 && _props$mock.type && (props === null || props === void 0 ? void 0 : (_props$mock2 = props.mock) === null || _props$mock2 === void 0 ? void 0 : _props$mock2.type.toLowerCase()) === "designer") {
10
+ var _props$mock3, _props$mock3$mockMess;
10
11
  if (!props.webChatContainerProps) {
11
12
  props.webChatContainerProps = {};
12
13
  }
@@ -22,7 +23,7 @@ const overridePropsOnMockIfApplicable = props => {
22
23
  props.webChatContainerProps = {
23
24
  ...props.webChatContainerProps,
24
25
  webChatProps: {
25
- disabled: true,
26
+ disabled: !(props !== null && props !== void 0 && (_props$mock3 = props.mock) !== null && _props$mock3 !== void 0 && (_props$mock3$mockMess = _props$mock3.mockMessages) !== null && _props$mock3$mockMess !== void 0 && _props$mock3$mockMess.length),
26
27
  ...props.webChatContainerProps.webChatProps,
27
28
  overrideLocalizedStrings: {
28
29
  TEXT_INPUT_PLACEHOLDER: "Send a message . . .",
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.setPreChatAndInitiateChat = exports.prepareStartChat = exports.initStartChat = exports.checkIfConversationStillValid = void 0;
7
7
  var _TelemetryConstants = require("../../../common/telemetry/TelemetryConstants");
8
8
  var _Constants = require("../../../common/Constants");
9
+ var _TelemetryManager = require("../../../common/telemetry/TelemetryManager");
9
10
  var _utils = require("../../../common/utils");
10
11
  var _reconnectChatHelper = require("./reconnectChatHelper");
11
12
  var _startChatErrorHandler = require("./startChatErrorHandler");
@@ -14,7 +15,6 @@ var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components
14
15
  var _ConversationState = require("../../../contexts/common/ConversationState");
15
16
  var _LiveChatWidgetActionType = require("../../../contexts/common/LiveChatWidgetActionType");
16
17
  var _TelemetryHelper = require("../../../common/telemetry/TelemetryHelper");
17
- var _TelemetryManager = require("../../../common/telemetry/TelemetryManager");
18
18
  var _endChat = require("./endChat");
19
19
  var _createAdapter = require("./createAdapter");
20
20
  var _newMessageEventHandler = require("../../../plugins/newMessageEventHandler");
@@ -105,7 +105,7 @@ const setPreChatAndInitiateChat = async (facadeChatSDK, dispatch, setAdapter, is
105
105
 
106
106
  // If minimized, maximize the chat, if the state is missing, consider it as minimized
107
107
  if ((state === null || state === void 0 ? void 0 : state.appStates.isMinimized) === undefined || (state === null || state === void 0 ? void 0 : (_state$appStates = state.appStates) === null || _state$appStates === void 0 ? void 0 : _state$appStates.isMinimized) === true) {
108
- var _state$domainStates3, _state$domainStates3$, _state$domainStates4, _state$domainStates4$;
108
+ var _state$domainStates3, _state$domainStates3$, _state$domainStates4, _state$domainStates4$, _TelemetryManager$Int;
109
109
  dispatch({
110
110
  type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_MINIMIZED,
111
111
  payload: false
@@ -116,7 +116,8 @@ const setPreChatAndInitiateChat = async (facadeChatSDK, dispatch, setAdapter, is
116
116
  eventName: _TelemetryConstants.BroadcastEvent.MaximizeChat,
117
117
  payload: {
118
118
  height: state === null || state === void 0 ? void 0 : (_state$domainStates3 = state.domainStates) === null || _state$domainStates3 === void 0 ? void 0 : (_state$domainStates3$ = _state$domainStates3.widgetSize) === null || _state$domainStates3$ === void 0 ? void 0 : _state$domainStates3$.height,
119
- width: state === null || state === void 0 ? void 0 : (_state$domainStates4 = state.domainStates) === null || _state$domainStates4 === void 0 ? void 0 : (_state$domainStates4$ = _state$domainStates4.widgetSize) === null || _state$domainStates4$ === void 0 ? void 0 : _state$domainStates4$.width
119
+ width: state === null || state === void 0 ? void 0 : (_state$domainStates4 = state.domainStates) === null || _state$domainStates4 === void 0 ? void 0 : (_state$domainStates4$ = _state$domainStates4.widgetSize) === null || _state$domainStates4$ === void 0 ? void 0 : _state$domainStates4$.width,
120
+ runtimeId: _TelemetryManager.TelemetryManager === null || _TelemetryManager.TelemetryManager === void 0 ? void 0 : (_TelemetryManager$Int = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int === void 0 ? void 0 : _TelemetryManager$Int.lcwRuntimeId
120
121
  }
121
122
  });
122
123
  }
@@ -137,7 +138,7 @@ const setPreChatAndInitiateChat = async (facadeChatSDK, dispatch, setAdapter, is
137
138
  * This is because a new change to control OOH as closed event when a widget is coming from chat.
138
139
  */
139
140
  if ((state === null || state === void 0 ? void 0 : state.appStates.isMinimized) === undefined || (state === null || state === void 0 ? void 0 : (_state$appStates2 = state.appStates) === null || _state$appStates2 === void 0 ? void 0 : _state$appStates2.isMinimized) === true) {
140
- var _state$domainStates5, _state$domainStates5$, _state$domainStates6, _state$domainStates6$;
141
+ var _state$domainStates5, _state$domainStates5$, _state$domainStates6, _state$domainStates6$, _TelemetryManager$Int2;
141
142
  dispatch({
142
143
  type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_MINIMIZED,
143
144
  payload: false
@@ -147,7 +148,8 @@ const setPreChatAndInitiateChat = async (facadeChatSDK, dispatch, setAdapter, is
147
148
  eventName: _TelemetryConstants.BroadcastEvent.MaximizeChat,
148
149
  payload: {
149
150
  height: state === null || state === void 0 ? void 0 : (_state$domainStates5 = state.domainStates) === null || _state$domainStates5 === void 0 ? void 0 : (_state$domainStates5$ = _state$domainStates5.widgetSize) === null || _state$domainStates5$ === void 0 ? void 0 : _state$domainStates5$.height,
150
- width: state === null || state === void 0 ? void 0 : (_state$domainStates6 = state.domainStates) === null || _state$domainStates6 === void 0 ? void 0 : (_state$domainStates6$ = _state$domainStates6.widgetSize) === null || _state$domainStates6$ === void 0 ? void 0 : _state$domainStates6$.width
151
+ width: state === null || state === void 0 ? void 0 : (_state$domainStates6 = state.domainStates) === null || _state$domainStates6 === void 0 ? void 0 : (_state$domainStates6$ = _state$domainStates6.widgetSize) === null || _state$domainStates6$ === void 0 ? void 0 : _state$domainStates6$.width,
152
+ runtimeId: _TelemetryManager.TelemetryManager === null || _TelemetryManager.TelemetryManager === void 0 ? void 0 : (_TelemetryManager$Int2 = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int2 === void 0 ? void 0 : _TelemetryManager$Int2.lcwRuntimeId
151
153
  }
152
154
  });
153
155
  }
@@ -1,7 +1,13 @@
1
1
  "use strict";
2
2
 
3
- var LiveChatWidgetMockType;
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.LiveChatWidgetMockType = void 0;
7
+ let LiveChatWidgetMockType;
8
+ exports.LiveChatWidgetMockType = LiveChatWidgetMockType;
4
9
  (function (LiveChatWidgetMockType) {
5
10
  LiveChatWidgetMockType["Test"] = "Test";
6
11
  LiveChatWidgetMockType["Demo"] = "Demo";
7
- })(LiveChatWidgetMockType || (LiveChatWidgetMockType = {}));
12
+ LiveChatWidgetMockType["Designer"] = "Designer";
13
+ })(LiveChatWidgetMockType || (exports.LiveChatWidgetMockType = LiveChatWidgetMockType = {}));
@@ -14,6 +14,7 @@ var _TelemetryManager = require("../../../common/telemetry/TelemetryManager");
14
14
  var _endChat = require("../common/endChat");
15
15
  var _startChat = require("../common/startChat");
16
16
  var _utils = require("../../../common/utils");
17
+ var _customEventHandler = require("../common/customEventHandler");
17
18
  var _defaultClientDataStoreProvider = require("../../../common/storage/default/defaultClientDataStoreProvider");
18
19
  var _reconnectChatHelper = require("../common/reconnectChatHelper");
19
20
  var _componentController = require("../../../controller/componentController");
@@ -57,7 +58,6 @@ var _startProactiveChat = require("../common/startProactiveChat");
57
58
  var _useChatAdapterStore = _interopRequireDefault(require("../../../hooks/useChatAdapterStore"));
58
59
  var _useChatContextStore = _interopRequireDefault(require("../../../hooks/useChatContextStore"));
59
60
  var _useFacadeChatSDKStore = _interopRequireDefault(require("../../../hooks/useFacadeChatSDKStore"));
60
- var _customEventHandler = require("../common/customEventHandler");
61
61
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
62
62
  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
63
  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; }
@@ -488,7 +488,8 @@ const LiveChatWidgetStateful = props => {
488
488
  eventName: _TelemetryConstants.BroadcastEvent.MaximizeChat,
489
489
  payload: {
490
490
  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
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,
492
+ lcwRuntimeId: _TelemetryManager.TelemetryManager.InternalTelemetryData.lcwRuntimeId
492
493
  }
493
494
  });
494
495
  return;
@@ -727,11 +728,7 @@ const LiveChatWidgetStateful = props => {
727
728
  (0, _endChat.endChat)(props, facadeChatSDK, state, dispatch, setAdapter, setWebChatStyles, adapter, false, false, true);
728
729
  return;
729
730
  }
730
- const inMemoryState = (0, _createReducer.executeReducer)(state, {
731
- type: _LiveChatWidgetActionType.LiveChatWidgetActionType.GET_IN_MEMORY_STATE,
732
- payload: null
733
- });
734
- let isConversationalSurveyEnabled = state.appStates.isConversationalSurveyEnabled;
731
+ const isConversationalSurveyEnabled = state.appStates.isConversationalSurveyEnabled;
735
732
 
736
733
  // In conversational survey, we need to check post chat survey logics before we set ConversationState to InActive
737
734
  // Hence setting ConversationState to InActive will be done later in the post chat flows
@@ -880,23 +877,46 @@ const LiveChatWidgetStateful = props => {
880
877
 
881
878
  // WebChat's Composer can only be rendered if a directLine object is defined
882
879
  return directLine && /*#__PURE__*/_react2.default.createElement(_react2.default.Fragment, null, /*#__PURE__*/_react2.default.createElement("style", null, `
883
- ::-webkit-scrollbar {
880
+ #oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar {
884
881
  width: ${scrollbarProps.width};
885
882
  }
886
883
 
887
- ::-webkit-scrollbar-track {
884
+ #oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar-track {
888
885
  background: ${scrollbarProps.trackBackgroundColor};
889
886
  }
890
887
 
891
- ::-webkit-scrollbar-thumb {
888
+ #oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar-thumb {
892
889
  background: ${scrollbarProps.thumbBackgroundColor};
893
890
  border-radius: ${scrollbarProps.thumbBorderRadius};
894
891
  }
895
892
 
896
- ::-webkit-scrollbar-thumb:hover {
893
+ #oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar-thumb:hover {
897
894
  background: ${scrollbarProps.thumbHoverColor};
898
895
  }
899
896
 
897
+ /* High Contrast mode support - optimized for all variants */
898
+ @media (prefers-contrast: high), (-ms-high-contrast: active), (forced-colors: active) {
899
+ #oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar-track {
900
+ background: Canvas !important;
901
+ border: 1px solid CanvasText !important;
902
+ }
903
+
904
+ #oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar-thumb {
905
+ background: CanvasText !important;
906
+ border: 1px solid Canvas !important;
907
+ min-height: 20px !important;
908
+ }
909
+
910
+ #oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar-thumb:hover {
911
+ background: Highlight !important;
912
+ border: 1px solid CanvasText !important;
913
+ }
914
+
915
+ #oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar-corner {
916
+ background: Canvas !important;
917
+ }
918
+ }
919
+
900
920
  .webchat__basic-transcript__activity-markdown-body > :last-child {
901
921
  margin-bottom: 0px;
902
922
  }
@@ -904,11 +924,21 @@ const LiveChatWidgetStateful = props => {
904
924
  .webchat__basic-transcript__activity-markdown-body > :first-child {
905
925
  margin-top: 0px;
906
926
  }
927
+
907
928
  .webchat__basic-transcript__activity-markdown-body img.webchat__render-markdown__external-link-icon {
908
929
  background-image : url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIzIDMgMTggMTgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTcuMjUwMSA0LjUwMDE3SDEwLjc0OTVDMTEuMTYzNyA0LjUwMDE3IDExLjQ5OTUgNC44MzU5NiAxMS40OTk1IDUuMjUwMTdDMTEuNDk5NSA1LjYyOTg2IDExLjIxNzMgNS45NDM2NiAxMC44NTEzIDUuOTkzMzJMMTAuNzQ5NSA2LjAwMDE3SDcuMjQ5NzRDNi4wNzA3OSA1Ljk5OTYxIDUuMTAzNDkgNi45MDY1NiA1LjAwNzg2IDguMDYxMTJMNS4wMDAyOCA4LjIyMDAzTDUuMDAzMTIgMTYuNzUwN0M1LjAwMzQzIDE3Ljk0MTUgNS45Mjg4NSAxOC45MTYxIDcuMDk5NjYgMTguOTk0OUw3LjI1MzcxIDE5LjAwMDFMMTUuNzUxOCAxOC45ODg0QzE2Ljk0MTUgMTguOTg2OCAxNy45MTQ1IDE4LjA2MiAxNy45OTM1IDE2Ljg5MjNMMTcuOTk4NyAxNi43Mzg0VjEzLjIzMjFDMTcuOTk4NyAxMi44MTc5IDE4LjMzNDUgMTIuNDgyMSAxOC43NDg3IDEyLjQ4MjFDMTkuMTI4NCAxMi40ODIxIDE5LjQ0MjIgMTIuNzY0MyAxOS40OTE4IDEzLjEzMDNMMTkuNDk4NyAxMy4yMzIxVjE2LjczODRDMTkuNDk4NyAxOC43NDA3IDE3LjkyOTMgMjAuMzc2OSAxNS45NTI4IDIwLjQ4MjlMMTUuNzUzOCAyMC40ODg0TDcuMjU4MjcgMjAuNTAwMUw3LjA1NDk1IDIwLjQ5NDlDNS4xNDIzOSAyMC4zOTU0IDMuNjA4OTUgMTguODYyNyAzLjUwODM3IDE2Ljk1MDJMMy41MDMxMiAxNi43NTExTDMuNTAwODkgOC4yNTI3TDMuNTA1MjkgOC4wNTAyQzMuNjA1MzkgNi4xMzc0OSA1LjEzODY3IDQuNjA0NDkgNy4wNTA5NiA0LjUwNTI3TDcuMjUwMSA0LjUwMDE3SDEwLjc0OTVINy4yNTAxWk0xMy43NDgxIDMuMDAxNDZMMjAuMzAxOCAzLjAwMTk3TDIwLjQwMTQgMy4wMTU3NUwyMC41MDIyIDMuMDQzOTNMMjAuNTU5IDMuMDY4MDNDMjAuNjEyMiAzLjA5MTIyIDIwLjY2MzQgMy4xMjE2MyAyMC43MTExIDMuMTU4ODVMMjAuNzgwNCAzLjIyMTU2TDIwLjg2NDEgMy4zMjAxNEwyMC45MTgzIDMuNDEwMjVMMjAuOTU3IDMuNTAwNTdMMjAuOTc2MiAzLjU2NDc2TDIwLjk4OTggMy42Mjg2MkwyMC45OTkyIDMuNzIyODJMMjAuOTk5NyAxMC4yNTU0QzIwLjk5OTcgMTAuNjY5NiAyMC42NjM5IDExLjAwNTQgMjAuMjQ5NyAxMS4wMDU0QzE5Ljg3IDExLjAwNTQgMTkuNTU2MiAxMC43MjMyIDE5LjUwNjUgMTAuMzU3MUwxOS40OTk3IDEwLjI1NTRMMTkuNDk4OSA1LjU2MTQ3TDEyLjI3OTcgMTIuNzg0N0MxMi4wMTM0IDEzLjA1MSAxMS41OTY4IDEzLjA3NTMgMTEuMzAzMSAxMi44NTc1TDExLjIxOSAxMi43ODQ5QzEwLjk1MjcgMTIuNTE4NyAxMC45Mjg0IDEyLjEwMjEgMTEuMTQ2MiAxMS44MDg0TDExLjIxODggMTEuNzI0M0wxOC40MzY5IDQuNTAxNDZIMTMuNzQ4MUMxMy4zNjg0IDQuNTAxNDYgMTMuMDU0NiA0LjIxOTMxIDEzLjAwNSAzLjg1MzI0TDEyLjk5ODEgMy43NTE0NkMxMi45OTgxIDMuMzcxNzcgMTMuMjgwMyAzLjA1Nzk3IDEzLjY0NjQgMy4wMDgzMUwxMy43NDgxIDMuMDAxNDZaIiBmaWxsPSIjMjEyMTIxIiAvPjwvc3ZnPg==) !important;
909
930
  height: .75em;
910
931
  margin-left: .25em;
911
932
  }
933
+
934
+ .webchat__link-definitions__header-text {
935
+ color: ${bubbleBackground}
936
+ }
937
+
938
+ .webchat__link-definitions__header-chevron {
939
+ color: ${bubbleBackground}
940
+ }
941
+
912
942
  ${(sendBoxTextArea === null || sendBoxTextArea === void 0 ? void 0 : sendBoxTextArea.minHeight) && `
913
943
  .webchat__auto-resize-textarea.webchat__send-box-text-box__text-area {
914
944
  min-height: ${sendBoxTextArea === null || sendBoxTextArea === void 0 ? void 0 : sendBoxTextArea.minHeight} !important;
@@ -10,6 +10,7 @@ var _TelemetryConstants = require("../../common/telemetry/TelemetryConstants");
10
10
  var _react2 = _interopRequireWildcard(require("react"));
11
11
  var _utils = require("../../common/utils");
12
12
  var _BotMagicCodeStore = require("./webchatcontroller/BotMagicCodeStore");
13
+ var _CitationPaneStateful = _interopRequireDefault(require("../citationpanestateful/CitationPaneStateful"));
13
14
  var _botframeworkWebchat = require("botframework-webchat");
14
15
  var _LiveChatWidgetActionType = require("../../contexts/common/LiveChatWidgetActionType");
15
16
  var _NotificationHandler = require("./webchatcontroller/notification/NotificationHandler");
@@ -17,6 +18,7 @@ var _NotificationScenarios = require("./webchatcontroller/enums/NotificationScen
17
18
  var _TelemetryHelper = require("../../common/telemetry/TelemetryHelper");
18
19
  var _WebChatActionType = require("./webchatcontroller/enums/WebChatActionType");
19
20
  var _WebChatStoreLoader = require("./webchatcontroller/WebChatStoreLoader");
21
+ var _fontUtils = require("./common/utils/fontUtils");
20
22
  var _defaultAdaptiveCardStyles = require("./common/defaultStyles/defaultAdaptiveCardStyles");
21
23
  var _defaultMiddlewareLocalizedTexts = require("./common/defaultProps/defaultMiddlewareLocalizedTexts");
22
24
  var _defaultReceivedMessageAnchorStyles = require("./webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultReceivedMessageAnchorStyles");
@@ -25,12 +27,12 @@ var _defaultSystemMessageBoxStyles = require("./webchatcontroller/middlewares/re
25
27
  var _defaultUserMessageBoxStyles = require("./webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles");
26
28
  var _defaultWebChatContainerStatefulProps = require("./common/defaultProps/defaultWebChatContainerStatefulProps");
27
29
  var _ = require("../..");
30
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
28
31
  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); }
29
32
  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; }
30
- /* eslint-disable @typescript-eslint/no-explicit-any */
31
-
32
33
  let uiTimer;
33
34
  const broadcastChannelMessageEvent = "message";
35
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
34
36
  const postActivity = activity => {
35
37
  // eslint-disable-line @typescript-eslint/no-explicit-any
36
38
  return {
@@ -56,13 +58,30 @@ const createMagicCodeSuccessResponse = signin => {
56
58
  };
57
59
  };
58
60
  const WebChatContainerStateful = props => {
59
- var _webChatContainerProp, _webChatContainerProp2, _webChatContainerProp3, _webChatContainerProp4, _webChatContainerProp5, _webChatContainerProp6, _webChatContainerProp7, _webChatContainerProp8, _props$webChatContain5, _props$webChatContain6, _defaultWebChatContai, _props$webChatContain7, _props$webChatContain8, _defaultWebChatContai2, _webChatContainerProp9, _webChatContainerProp10, _webChatContainerProp11, _webChatContainerProp12, _webChatContainerProp13, _webChatContainerProp14, _webChatContainerProp15, _webChatContainerProp16, _webChatContainerProp17, _webChatContainerProp18, _webChatContainerProp19, _webChatContainerProp20, _webChatContainerProp21, _webChatContainerProp22, _webChatContainerProp23, _props$webChatContain9, _props$webChatContain10;
61
+ var _props$webChatContain, _defaultWebChatContai, _webChatContainerProp, _webChatContainerProp2, _webChatContainerProp3, _webChatContainerProp4, _webChatContainerProp5, _webChatContainerProp6, _webChatContainerProp7, _webChatContainerProp8, _props$webChatContain6, _props$webChatContain7, _defaultWebChatContai2, _props$webChatContain8, _props$webChatContain9, _defaultWebChatContai3, _webChatContainerProp9, _webChatContainerProp10, _webChatContainerProp11, _webChatContainerProp12, _webChatContainerProp13, _webChatContainerProp14, _webChatContainerProp15, _webChatContainerProp16, _webChatContainerProp17, _webChatContainerProp18, _webChatContainerProp19, _webChatContainerProp20, _webChatContainerProp21, _webChatContainerProp22, _webChatContainerProp23, _props$webChatContain10, _props$webChatContain11, _webChatContainerProp24, _webChatContainerProp25, _webChatContainerProp26, _webChatContainerProp27, _props$citationPanePr, _props$citationPanePr2, _props$citationPanePr3, _props$citationPanePr4, _props$citationPanePr5;
62
+ // Create a font family that includes emoji support, based on the primary font or default
63
+ const webChatStyles = ((_props$webChatContain = props.webChatContainerProps) === null || _props$webChatContain === void 0 ? void 0 : _props$webChatContain.webChatStyles) ?? _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps.webChatStyles;
64
+ const primaryFont = (webChatStyles === null || webChatStyles === void 0 ? void 0 : webChatStyles.primaryFont) ?? ((_defaultWebChatContai = _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps.webChatStyles) === null || _defaultWebChatContai === void 0 ? void 0 : _defaultWebChatContai.primaryFont);
65
+
66
+ // Use iOS-optimized emoji font that prioritizes system-ui for proper emoji rendering
67
+ const fontFamilyWithEmojis = (0, _fontUtils.createIOSOptimizedEmojiFont)(primaryFont);
60
68
  (0, _react2.useEffect)(() => {
61
69
  uiTimer = (0, _utils.createTimer)();
62
70
  _TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
63
71
  Event: _TelemetryConstants.TelemetryEvent.UXWebchatContainerCompleted
64
72
  });
65
73
  }, []);
74
+
75
+ // Citation pane state
76
+ const [citationPaneOpen, setCitationPaneOpen] = (0, _react2.useState)(false);
77
+ const [citationPaneText, setCitationPaneText] = (0, _react2.useState)("");
78
+
79
+ // Guard to prevent handling multiple rapid clicks which could cause
80
+ // the dim layer and pane to re-render out of sync and create a flicker.
81
+ const citationOpeningRef = (0, _react2.useRef)(false);
82
+
83
+ // ...existing code...
84
+
66
85
  const {
67
86
  BasicWebChat
68
87
  } = _botframeworkWebchat.Components;
@@ -71,6 +90,53 @@ const WebChatContainerStateful = props => {
71
90
  webChatContainerProps,
72
91
  contextDataStore
73
92
  } = props;
93
+
94
+ // Delegated click handler for citation anchors. Placed after state is
95
+ // available so we can prefer reading citations from app state and fall
96
+ // back to the legacy window map for backward-compatibility in tests.
97
+ (0, _react2.useEffect)(() => {
98
+ const clickHandler = ev => {
99
+ try {
100
+ if (citationOpeningRef.current) {
101
+ return;
102
+ }
103
+ const target = ev.target;
104
+ // Only consider anchors whose href starts with the citation scheme
105
+ const anchor = target.closest && target.closest("a[href^=\"cite:\"]");
106
+ if (anchor) {
107
+ ev.preventDefault();
108
+ citationOpeningRef.current = true;
109
+ // Rely only on the href to identify the citation key
110
+ let text = "";
111
+ try {
112
+ var _state$domainStates;
113
+ const cid = anchor.getAttribute("href");
114
+ // Prefer state-based citations injected by middleware
115
+ if (state !== null && state !== void 0 && (_state$domainStates = state.domainStates) !== null && _state$domainStates !== void 0 && _state$domainStates.citations && cid) {
116
+ text = state.domainStates.citations[cid] ?? "";
117
+ }
118
+ // If state lookup failed, fall back to the anchor's title or innerText
119
+ if (!text) {
120
+ text = anchor.getAttribute("title") || anchor.innerText || "";
121
+ }
122
+ } catch (e) {
123
+ // ignore
124
+ }
125
+ setCitationPaneOpen(true);
126
+ setCitationPaneText(text);
127
+
128
+ // Simple debounce - reset guard after a short delay
129
+ setTimeout(() => {
130
+ citationOpeningRef.current = false;
131
+ }, 100);
132
+ }
133
+ } catch (e) {
134
+ citationOpeningRef.current = false;
135
+ }
136
+ };
137
+ document.addEventListener("click", clickHandler);
138
+ return () => document.removeEventListener("click", clickHandler);
139
+ }, [state]);
74
140
  const containerStyles = {
75
141
  root: Object.assign({}, _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps.containerStyles, webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : webChatContainerProps.containerStyles, {
76
142
  display: state.appStates.isMinimized ? "none" : ""
@@ -82,7 +148,7 @@ const WebChatContainerStateful = props => {
82
148
  ...(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : webChatContainerProps.localizedTexts)
83
149
  };
84
150
  (0, _react2.useEffect)(() => {
85
- var _props$webChatContain, _props$webChatContain2;
151
+ var _props$webChatContain2, _props$webChatContain3;
86
152
  if ((0, _utils.getDeviceType)() !== "standard" && (webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : webChatContainerProps.webChatHistoryMobileAccessibilityLabel) !== undefined) {
87
153
  const chatHistoryElement = document.querySelector(`.${_Constants.HtmlClassNames.webChatHistoryContainer}`);
88
154
  if (chatHistoryElement) {
@@ -100,21 +166,23 @@ const WebChatContainerStateful = props => {
100
166
  _TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
101
167
  Event: _TelemetryConstants.TelemetryEvent.WebChatLoaded
102
168
  });
103
- if (((_props$webChatContain = props.webChatContainerProps) === null || _props$webChatContain === void 0 ? void 0 : (_props$webChatContain2 = _props$webChatContain.renderingMiddlewareProps) === null || _props$webChatContain2 === void 0 ? void 0 : _props$webChatContain2.disableThirdPartyCookiesAlert) !== true && !contextDataStore) {
169
+ if (((_props$webChatContain2 = props.webChatContainerProps) === null || _props$webChatContain2 === void 0 ? void 0 : (_props$webChatContain3 = _props$webChatContain2.renderingMiddlewareProps) === null || _props$webChatContain3 === void 0 ? void 0 : _props$webChatContain3.disableThirdPartyCookiesAlert) !== true && !contextDataStore) {
104
170
  try {
105
171
  localStorage;
106
172
  sessionStorage;
107
173
  } catch (error) {
174
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
108
175
  if (!window.TPCWarningShown) {
109
176
  _NotificationHandler.NotificationHandler.notifyWarning(_NotificationScenarios.NotificationScenarios.TPC, (localizedTexts === null || localizedTexts === void 0 ? void 0 : localizedTexts.THIRD_PARTY_COOKIES_BLOCKED_ALERT_MESSAGE) ?? "");
177
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
110
178
  window.TPCWarningShown = true;
111
179
  }
112
180
  }
113
181
  }
114
182
  }, []);
115
183
  (0, _react2.useEffect)(() => {
116
- var _props$webChatContain3, _props$webChatContain4;
117
- if (!((_props$webChatContain3 = props.webChatContainerProps) !== null && _props$webChatContain3 !== void 0 && (_props$webChatContain4 = _props$webChatContain3.botMagicCode) !== null && _props$webChatContain4 !== void 0 && _props$webChatContain4.disabled)) {
184
+ var _props$webChatContain4, _props$webChatContain5;
185
+ if (!((_props$webChatContain4 = props.webChatContainerProps) !== null && _props$webChatContain4 !== void 0 && (_props$webChatContain5 = _props$webChatContain4.botMagicCode) !== null && _props$webChatContain5 !== void 0 && _props$webChatContain5.disabled)) {
118
186
  return;
119
187
  }
120
188
  if (!window.BroadcastChannel) {
@@ -186,7 +254,7 @@ const WebChatContainerStateful = props => {
186
254
  }
187
255
 
188
256
  .webchat__bubble__content>div#ms_lcw_webchat_adaptive_card .ac-textBlock {
189
- color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp2 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp2 === void 0 ? void 0 : _webChatContainerProp2.color) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.color} !important;
257
+ color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp2 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp2 === void 0 ? void 0 : _webChatContainerProp2.color) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.color};
190
258
  }
191
259
 
192
260
  .webchat__stacked-layout__content div.webchat__stacked-layout__message-row div.webchat__bubble--from-user {
@@ -206,8 +274,8 @@ const WebChatContainerStateful = props => {
206
274
  }
207
275
 
208
276
  .ms_lcw_webchat_received_message>div.webchat__stacked-layout>div.webchat__stacked-layout__main>div.webchat__stacked-layout__content>div.webchat__stacked-layout__message-row>[class^=webchat]:not(.webchat__bubble--from-user)>.webchat__bubble__content {
209
- background-color: ${((_props$webChatContain5 = props.webChatContainerProps) === null || _props$webChatContain5 === void 0 ? void 0 : (_props$webChatContain6 = _props$webChatContain5.webChatStyles) === null || _props$webChatContain6 === void 0 ? void 0 : _props$webChatContain6.bubbleBackground) ?? ((_defaultWebChatContai = _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps.webChatStyles) === null || _defaultWebChatContai === void 0 ? void 0 : _defaultWebChatContai.bubbleBackground)};
210
- color:${((_props$webChatContain7 = props.webChatContainerProps) === null || _props$webChatContain7 === void 0 ? void 0 : (_props$webChatContain8 = _props$webChatContain7.webChatStyles) === null || _props$webChatContain8 === void 0 ? void 0 : _props$webChatContain8.bubbleTextColor) ?? ((_defaultWebChatContai2 = _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps.webChatStyles) === null || _defaultWebChatContai2 === void 0 ? void 0 : _defaultWebChatContai2.bubbleTextColor)};
277
+ background-color: ${((_props$webChatContain6 = props.webChatContainerProps) === null || _props$webChatContain6 === void 0 ? void 0 : (_props$webChatContain7 = _props$webChatContain6.webChatStyles) === null || _props$webChatContain7 === void 0 ? void 0 : _props$webChatContain7.bubbleBackground) ?? ((_defaultWebChatContai2 = _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps.webChatStyles) === null || _defaultWebChatContai2 === void 0 ? void 0 : _defaultWebChatContai2.bubbleBackground)};
278
+ color:${((_props$webChatContain8 = props.webChatContainerProps) === null || _props$webChatContain8 === void 0 ? void 0 : (_props$webChatContain9 = _props$webChatContain8.webChatStyles) === null || _props$webChatContain9 === void 0 ? void 0 : _props$webChatContain9.bubbleTextColor) ?? ((_defaultWebChatContai3 = _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps.webChatStyles) === null || _defaultWebChatContai3 === void 0 ? void 0 : _defaultWebChatContai3.bubbleTextColor)};
211
279
  }
212
280
 
213
281
  div[class="ac-textBlock"] a:link,
@@ -285,7 +353,7 @@ const WebChatContainerStateful = props => {
285
353
  }
286
354
 
287
355
  .webchat__stacked-layout_container>div {
288
- background: ${(props === null || props === void 0 ? void 0 : (_props$webChatContain9 = props.webChatContainerProps) === null || _props$webChatContain9 === void 0 ? void 0 : (_props$webChatContain10 = _props$webChatContain9.containerStyles) === null || _props$webChatContain10 === void 0 ? void 0 : _props$webChatContain10.background) ?? ""}
356
+ background: ${(props === null || props === void 0 ? void 0 : (_props$webChatContain10 = props.webChatContainerProps) === null || _props$webChatContain10 === void 0 ? void 0 : (_props$webChatContain11 = _props$webChatContain10.containerStyles) === null || _props$webChatContain11 === void 0 ? void 0 : _props$webChatContain11.background) ?? ""}
289
357
  }
290
358
  .webchat__toast_text {
291
359
  display: flex;
@@ -295,11 +363,44 @@ const WebChatContainerStateful = props => {
295
363
  overflow-y: unset;
296
364
  }
297
365
 
298
-
366
+ /* Custom styles for carousel hero cards */
367
+ ul.webchat__carousel-filmstrip__attachments .ac-image {
368
+ width: 200px !important;
369
+ height: 150px !important;
370
+ object-fit: cover !important;
371
+ border-radius: 8px !important;
372
+ border: 1px solid #e0e0e0 !important;
373
+ }
374
+
375
+ .webchat__carousel-filmstrip-attachment .webchat__bubble {
376
+ height: 100% !important;
377
+ }
378
+
379
+ .webchat__carousel-filmstrip-attachment .webchat__bubble #ms_lcw_webchat_adaptive_card {
380
+ height: 100% !important;
381
+ }
382
+
383
+ .webchat__auto-resize-textarea__textarea.webchat__send-box-text-box__html-text-area {
384
+ font-family: ${fontFamilyWithEmojis} !important;
385
+ }
386
+
387
+ /* Suggested actions carousel previous/next navigation focus */
388
+ .webchat__suggested-actions .webchat__suggested-actions__carousel .react-film__flipper:focus-visible .react-film__flipper__body {
389
+ outline: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp24 = webChatContainerProps.webChatStyles) === null || _webChatContainerProp24 === void 0 ? void 0 : _webChatContainerProp24.suggestedActionKeyboardFocusIndicatorBorderStyle) ?? "dashed"} ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp25 = webChatContainerProps.webChatStyles) === null || _webChatContainerProp25 === void 0 ? void 0 : _webChatContainerProp25.suggestedActionKeyboardFocusIndicatorBorderWidth) ?? "1px"} ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp26 = webChatContainerProps.webChatStyles) === null || _webChatContainerProp26 === void 0 ? void 0 : _webChatContainerProp26.suggestedActionKeyboardFocusIndicatorBorderColor) ?? "#605E5C"} !important;
390
+ outline-offset: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp27 = webChatContainerProps.webChatStyles) === null || _webChatContainerProp27 === void 0 ? void 0 : _webChatContainerProp27.suggestedActionKeyboardFocusIndicatorInset) ?? "2px"} !important;
391
+
299
392
  `), /*#__PURE__*/_react2.default.createElement(_react.Stack, {
300
393
  styles: containerStyles,
301
394
  className: "webchat__stacked-layout_container"
302
- }, /*#__PURE__*/_react2.default.createElement(BasicWebChat, null)));
395
+ }, /*#__PURE__*/_react2.default.createElement(BasicWebChat, null)), citationPaneOpen && /*#__PURE__*/_react2.default.createElement(_CitationPaneStateful.default, {
396
+ id: ((_props$citationPanePr = props.citationPaneProps) === null || _props$citationPanePr === void 0 ? void 0 : _props$citationPanePr.id) || _Constants.HtmlAttributeNames.ocwCitationPaneClassName,
397
+ title: ((_props$citationPanePr2 = props.citationPaneProps) === null || _props$citationPanePr2 === void 0 ? void 0 : _props$citationPanePr2.title) || _Constants.HtmlAttributeNames.ocwCitationPaneTitle,
398
+ contentHtml: citationPaneText,
399
+ onClose: () => setCitationPaneOpen(false),
400
+ componentOverrides: (_props$citationPanePr3 = props.citationPaneProps) === null || _props$citationPanePr3 === void 0 ? void 0 : _props$citationPanePr3.componentOverrides,
401
+ controlProps: (_props$citationPanePr4 = props.citationPaneProps) === null || _props$citationPanePr4 === void 0 ? void 0 : _props$citationPanePr4.controlProps,
402
+ styleProps: (_props$citationPanePr5 = props.citationPaneProps) === null || _props$citationPanePr5 === void 0 ? void 0 : _props$citationPanePr5.styleProps
403
+ }));
303
404
  };
304
405
  exports.WebChatContainerStateful = WebChatContainerStateful;
305
406
  var _default = WebChatContainerStateful;
@@ -4,15 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.DesignerChatAdapter = void 0;
7
- var _Observable = require("rxjs/Observable");
8
- var _mockadapter = _interopRequireDefault(require("./mockadapter"));
9
7
  var _chatAdapterUtils = require("./utils/chatAdapterUtils");
8
+ var _mockadapter = _interopRequireDefault(require("./mockadapter"));
9
+ var _Observable = require("rxjs/Observable");
10
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
11
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
12
12
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
13
13
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
14
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
15
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
16
14
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
17
15
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
18
16
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
@@ -20,25 +18,56 @@ function _possibleConstructorReturn(self, call) { if (call && (typeof call === "
20
18
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
21
19
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
22
20
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
21
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
22
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
23
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
23
24
  let DesignerChatAdapter = /*#__PURE__*/function (_MockAdapter) {
24
25
  _inherits(DesignerChatAdapter, _MockAdapter);
25
26
  var _super = _createSuper(DesignerChatAdapter);
26
- function DesignerChatAdapter() {
27
+ function DesignerChatAdapter(messages) {
27
28
  var _this;
28
29
  _classCallCheck(this, DesignerChatAdapter);
29
30
  _this = _super.call(this);
30
- setTimeout(() => {
31
- (0, _chatAdapterUtils.postBotMessageActivity)(_this.activityObserver, "Thank you for contacting us! How can I help you today?", undefined, 0);
32
- (0, _chatAdapterUtils.postBotMessageActivity)(_this.activityObserver, "Please accept terms and conditions to proceed. Visit the link for terms and conditions <a href=\"\">here</a>.", undefined, 0);
33
- _this.postUserActivity("I need to change my address.", 0);
34
- (0, _chatAdapterUtils.postBotMessageActivity)(_this.activityObserver, "Okay, let me connect you with a live agent.", undefined, 100);
35
- (0, _chatAdapterUtils.postSystemMessageActivity)(_this.activityObserver, "John has joined the chat", 100);
36
- (0, _chatAdapterUtils.postAgentMessageActivity)(_this.activityObserver, "I'd be happy to help you update your account.", undefined, 100);
37
- _this.postUserActivity("I have trouble visiting the signin page <a href=\"\">signin</a>.", 0);
38
- }, 1000);
31
+ _defineProperty(_assertThisInitialized(_this), "messages", void 0);
32
+ _this.messages = messages;
33
+ if (_this.messages) {
34
+ if (_this.messages.length > 0) {
35
+ setTimeout(() => {
36
+ var _this$messages;
37
+ (_this$messages = _this.messages) === null || _this$messages === void 0 ? void 0 : _this$messages.forEach((msg, index) => {
38
+ _this.processMessage(msg, index);
39
+ });
40
+ }, 1000); // Initial 1 second delay to ensure activityObserver is ready
41
+ }
42
+ } else {
43
+ // Default hardcoded flow
44
+ setTimeout(() => {
45
+ (0, _chatAdapterUtils.postBotMessageActivity)(_this.activityObserver, "Thank you for contacting us! How can I help you today?", undefined, 0);
46
+ (0, _chatAdapterUtils.postBotMessageActivity)(_this.activityObserver, "Please accept terms and conditions to proceed. Visit the link for terms and conditions <a href=\"\">here</a>.", undefined, 0);
47
+ _this.postUserActivity("I need to change my address.", 0);
48
+ (0, _chatAdapterUtils.postBotMessageActivity)(_this.activityObserver, "Okay, let me connect you with a live agent.", undefined, 100);
49
+ (0, _chatAdapterUtils.postSystemMessageActivity)(_this.activityObserver, "John has joined the chat", 100);
50
+ (0, _chatAdapterUtils.postAgentMessageActivity)(_this.activityObserver, "I'd be happy to help you update your account.", undefined, 100);
51
+ _this.postUserActivity("I have trouble visiting the signin page <a href=\"\">signin</a>.", 0);
52
+ }, 1000);
53
+ }
39
54
  return _this;
40
55
  }
41
56
  _createClass(DesignerChatAdapter, [{
57
+ key: "processMessage",
58
+ value: function processMessage(msg, index) {
59
+ if (msg.text) {
60
+ if (msg.suggestedActions) {
61
+ (0, _chatAdapterUtils.postAgentSuggestedActionsActivity)(this.activityObserver, msg.text, msg.suggestedActions, index * 100);
62
+ } else {
63
+ (0, _chatAdapterUtils.postBotMessageActivity)(this.activityObserver, msg.text, undefined, index * 100);
64
+ }
65
+ }
66
+ if (msg.attachments && msg.attachments.length > 0) {
67
+ (0, _chatAdapterUtils.postAgentAttachmentActivity)(this.activityObserver, msg.attachments, index * 100, msg.attachmentLayout);
68
+ }
69
+ }
70
+ }, {
42
71
  key: "postUserActivity",
43
72
  value: function postUserActivity(text) {
44
73
  let delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;
@@ -26,13 +26,18 @@ let DesignerChatSDK = /*#__PURE__*/function (_MockChatSDK) {
26
26
  var _this;
27
27
  _classCallCheck(this, DesignerChatSDK);
28
28
  _this = _super.call(this);
29
+ /**
30
+ * Create a chat adapter for the designer. Uses this.mockMessages if set.
31
+ */
32
+ _defineProperty(_assertThisInitialized(_this), "mockMessages", void 0);
29
33
  _defineProperty(_assertThisInitialized(_this), "localeId", _this.getLiveChatConfig().ChatWidgetLanguage.msdyn_localeid);
30
34
  return _this;
31
35
  }
32
36
  _createClass(DesignerChatSDK, [{
33
37
  key: "createChatAdapter",
34
38
  value: function createChatAdapter() {
35
- return new _DesignerChatAdapter.DesignerChatAdapter();
39
+ const adapter = new _DesignerChatAdapter.DesignerChatAdapter(this.mockMessages);
40
+ return adapter;
36
41
  }
37
42
  }, {
38
43
  key: "getLiveChatConfig",
@@ -23,7 +23,7 @@ const defaultWebChatStyles = {
23
23
  bubbleTextColor: "White",
24
24
  hideSendBox: false,
25
25
  hideUploadButton: true,
26
- primaryFont: "Segoe UI, Arial, sans-serif",
26
+ primaryFont: "Segoe UI, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Noto Color Emoji\"",
27
27
  rootHeight: "100%",
28
28
  rootWidth: "100%",
29
29
  sendBoxTextWrap: true,
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.postSystemMessageActivity = exports.postEchoActivity = exports.postBotTypingActivity = exports.postBotMessageActivity = exports.postBotAttachmentActivity = exports.postAgentMessageActivity = exports.customerUser = exports.botUser = exports.agentUser = void 0;
6
+ exports.postSystemMessageActivity = exports.postEchoActivity = exports.postBotTypingActivity = exports.postBotMessageActivity = exports.postBotAttachmentActivity = exports.postAgentSuggestedActionsActivity = exports.postAgentMessageActivity = exports.postAgentAttachmentActivity = exports.customerUser = exports.botUser = exports.agentUser = void 0;
7
7
  var _omnichannelChatSdk = require("@microsoft/omnichannel-chat-sdk");
8
8
  const customerUser = {
9
9
  id: "usedId",
@@ -112,4 +112,38 @@ const postBotAttachmentActivity = function (activityObserver) {
112
112
  });
113
113
  }, delay);
114
114
  };
115
- exports.postBotAttachmentActivity = postBotAttachmentActivity;
115
+ exports.postBotAttachmentActivity = postBotAttachmentActivity;
116
+ const postAgentAttachmentActivity = function (activityObserver) {
117
+ let attachments = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
118
+ let delay = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1000;
119
+ let attachmentLayout = arguments.length > 3 ? arguments[3] : undefined;
120
+ setTimeout(() => {
121
+ activityObserver === null || activityObserver === void 0 ? void 0 : activityObserver.next({
122
+ id: (0, _omnichannelChatSdk.uuidv4)(),
123
+ from: {
124
+ ...agentUser
125
+ },
126
+ attachments,
127
+ attachmentLayout,
128
+ type: "message",
129
+ timestamp: new Date().toISOString()
130
+ });
131
+ }, delay);
132
+ };
133
+ exports.postAgentAttachmentActivity = postAgentAttachmentActivity;
134
+ const postAgentSuggestedActionsActivity = function (activityObserver, text, suggestedActions) {
135
+ let delay = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1000;
136
+ setTimeout(() => {
137
+ activityObserver === null || activityObserver === void 0 ? void 0 : activityObserver.next({
138
+ id: (0, _omnichannelChatSdk.uuidv4)(),
139
+ from: {
140
+ ...agentUser
141
+ },
142
+ text,
143
+ type: "message",
144
+ suggestedActions,
145
+ timestamp: new Date().toISOString()
146
+ });
147
+ }, delay);
148
+ };
149
+ exports.postAgentSuggestedActionsActivity = postAgentSuggestedActionsActivity;