@microsoft/omnichannel-chat-widget 1.0.6-main.ffb4e2a → 1.1.1-main.1f4a6a7

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 (88) hide show
  1. package/lib/cjs/common/Constants.js +2 -0
  2. package/lib/cjs/common/storage/default/defaultClientDataStoreProvider.js +20 -15
  3. package/lib/cjs/common/telemetry/TelemetryConstants.js +2 -0
  4. package/lib/cjs/common/telemetry/TelemetryHelper.js +25 -15
  5. package/lib/cjs/common/utils.js +17 -2
  6. package/lib/cjs/components/draggable/DraggableChatWidget.js +168 -0
  7. package/lib/cjs/components/draggable/DraggableEventEmitter.js +74 -0
  8. package/lib/cjs/components/draggable/DraggableEventNames.js +14 -0
  9. package/lib/cjs/components/draggable/DraggableEventReceiver.js +34 -0
  10. package/lib/cjs/components/draggable/IDraggableElementPosition.js +1 -0
  11. package/lib/cjs/components/draggable/IDraggableElementPositionDelta.js +1 -0
  12. package/lib/cjs/components/draggable/IDraggableEvent.js +1 -0
  13. package/lib/cjs/components/footerstateful/FooterStateful.js +2 -2
  14. package/lib/cjs/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +21 -12
  15. package/lib/cjs/components/footerstateful/downloadtranscriptstateful/interfaces/IWebChatTranscriptConfig.js +1 -0
  16. package/lib/cjs/components/headerstateful/HeaderStateful.js +27 -0
  17. package/lib/cjs/components/livechatwidget/common/createDownloadTranscriptProps.js +27 -0
  18. package/lib/cjs/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +13 -2
  19. package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +15 -5
  20. package/lib/cjs/components/livechatwidget/common/startChat.js +1 -1
  21. package/lib/cjs/components/livechatwidget/interfaces/IDraggableChatWidgetProps.js +1 -0
  22. package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +58 -30
  23. package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +6 -0
  24. package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +48 -13
  25. package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.js +2 -1
  26. package/lib/cjs/components/webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles.js +1 -0
  27. package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +5 -0
  28. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios.js +1 -0
  29. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSentMessageAnchorStyles.js +10 -0
  30. package/lib/cjs/plugins/createChatTranscript.js +548 -0
  31. package/lib/esm/common/Constants.js +2 -0
  32. package/lib/esm/common/storage/default/defaultClientDataStoreProvider.js +18 -14
  33. package/lib/esm/common/telemetry/TelemetryConstants.js +2 -0
  34. package/lib/esm/common/telemetry/TelemetryHelper.js +25 -15
  35. package/lib/esm/common/utils.js +15 -1
  36. package/lib/esm/components/draggable/DraggableChatWidget.js +158 -0
  37. package/lib/esm/components/draggable/DraggableEventEmitter.js +64 -0
  38. package/lib/esm/components/draggable/DraggableEventNames.js +7 -0
  39. package/lib/esm/components/draggable/DraggableEventReceiver.js +25 -0
  40. package/lib/esm/components/draggable/IDraggableElementPosition.js +1 -0
  41. package/lib/esm/components/draggable/IDraggableElementPositionDelta.js +1 -0
  42. package/lib/esm/components/draggable/IDraggableEvent.js +1 -0
  43. package/lib/esm/components/footerstateful/FooterStateful.js +2 -2
  44. package/lib/esm/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +22 -13
  45. package/lib/esm/components/footerstateful/downloadtranscriptstateful/interfaces/IWebChatTranscriptConfig.js +1 -0
  46. package/lib/esm/components/headerstateful/HeaderStateful.js +27 -0
  47. package/lib/esm/components/livechatwidget/common/createDownloadTranscriptProps.js +20 -0
  48. package/lib/esm/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +13 -2
  49. package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +15 -5
  50. package/lib/esm/components/livechatwidget/common/startChat.js +1 -1
  51. package/lib/esm/components/livechatwidget/interfaces/IDraggableChatWidgetProps.js +1 -0
  52. package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +58 -30
  53. package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +6 -0
  54. package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +48 -13
  55. package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.js +2 -1
  56. package/lib/esm/components/webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles.js +1 -0
  57. package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +5 -0
  58. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios.js +1 -0
  59. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSentMessageAnchorStyles.js +3 -0
  60. package/lib/esm/plugins/createChatTranscript.js +543 -0
  61. package/lib/types/common/Constants.d.ts +2 -0
  62. package/lib/types/common/storage/default/defaultClientDataStoreProvider.d.ts +1 -0
  63. package/lib/types/common/telemetry/TelemetryConstants.d.ts +1 -0
  64. package/lib/types/common/telemetry/definitions/Contracts.d.ts +1 -0
  65. package/lib/types/common/utils.d.ts +1 -0
  66. package/lib/types/components/draggable/DraggableChatWidget.d.ts +9 -0
  67. package/lib/types/components/draggable/DraggableEventEmitter.d.ts +27 -0
  68. package/lib/types/components/draggable/DraggableEventNames.d.ts +6 -0
  69. package/lib/types/components/draggable/DraggableEventReceiver.d.ts +27 -0
  70. package/lib/types/components/draggable/IDraggableElementPosition.d.ts +5 -0
  71. package/lib/types/components/draggable/IDraggableElementPositionDelta.d.ts +5 -0
  72. package/lib/types/components/draggable/IDraggableEvent.d.ts +12 -0
  73. package/lib/types/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.d.ts +2 -1
  74. package/lib/types/components/footerstateful/downloadtranscriptstateful/interfaces/IDownloadTranscriptProps.d.ts +5 -0
  75. package/lib/types/components/footerstateful/downloadtranscriptstateful/interfaces/IWebChatTranscriptConfig.d.ts +13 -0
  76. package/lib/types/components/headerstateful/interfaces/IHeaderStatefulParams.d.ts +12 -0
  77. package/lib/types/components/livechatwidget/common/createDownloadTranscriptProps.d.ts +24 -0
  78. package/lib/types/components/livechatwidget/interfaces/IDraggableChatWidgetProps.d.ts +10 -0
  79. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +2 -0
  80. package/lib/types/components/webchatcontainerstateful/WebChatContainerStateful.d.ts +2 -2
  81. package/lib/types/components/webchatcontainerstateful/common/mockchatsdk.d.ts +5 -0
  82. package/lib/types/components/webchatcontainerstateful/interfaces/IAdaptiveCardStyles.d.ts +1 -0
  83. package/lib/types/components/webchatcontainerstateful/interfaces/IRenderingMiddlewareProps.d.ts +3 -1
  84. package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios.d.ts +2 -1
  85. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSentMessageAnchorStyles.d.ts +2 -0
  86. package/lib/types/contexts/common/ILiveChatWidgetLocalizedTexts.d.ts +1 -0
  87. package/lib/types/plugins/createChatTranscript.d.ts +2 -0
  88. package/package.json +4 -4
@@ -7,6 +7,7 @@ import { Stack } from "@fluentui/react";
7
7
  import React, { useEffect, useRef, useState } from "react";
8
8
  import { checkIfConversationStillValid, initStartChat, prepareStartChat, setPreChatAndInitiateChat } from "../common/startChat";
9
9
  import { createTimer, getBroadcastChannelName, getConversationDetailsCall, getLocaleDirection, getStateFromCache, getWidgetCacheIdfromProps, getWidgetEndChatEventName, isNullOrEmptyString, isUndefinedOrEmpty, newGuid } from "../../../common/utils";
10
+ import { defaultClientDataStoreProvider, isCookieAllowed } from "../../../common/storage/default/defaultClientDataStoreProvider";
10
11
  import { endChat, prepareEndChat } from "../common/endChat";
11
12
  import { handleChatReconnect, isReconnectEnabled } from "../common/reconnectChatHelper";
12
13
  import { shouldShowCallingContainer, shouldShowChatButton, shouldShowConfirmationPane, shouldShowEmailTranscriptPane, shouldShowHeader, shouldShowLoadingPane, shouldShowOutOfOfficeHoursPane, shouldShowPostChatLoadingPane, shouldShowPostChatSurveyPane, shouldShowPreChatSurveyPane, shouldShowProactiveChatPane, shouldShowReconnectChatPane, shouldShowWebChatContainer } from "../../../controller/componentController";
@@ -16,6 +17,7 @@ import ChatButtonStateful from "../../chatbuttonstateful/ChatButtonStateful";
16
17
  import ConfirmationPaneStateful from "../../confirmationpanestateful/ConfirmationPaneStateful";
17
18
  import { ConversationState } from "../../../contexts/common/ConversationState";
18
19
  import { DataStoreManager } from "../../../common/contextDataStore/DataStoreManager";
20
+ import DraggableChatWidget from "../../draggable/DraggableChatWidget";
19
21
  import { ElementType } from "@microsoft/omnichannel-chat-components";
20
22
  import EmailTranscriptPaneStateful from "../../emailtranscriptpanestateful/EmailTranscriptPaneStateful";
21
23
  import HeaderStateful from "../../headerstateful/HeaderStateful";
@@ -30,9 +32,9 @@ import ReconnectChatPaneStateful from "../../reconnectchatpanestateful/Reconnect
30
32
  import { TelemetryHelper } from "../../../common/telemetry/TelemetryHelper";
31
33
  import { TelemetryTimers } from "../../../common/telemetry/TelemetryManager";
32
34
  import WebChatContainerStateful from "../../webchatcontainerstateful/WebChatContainerStateful";
35
+ import createDownloadTranscriptProps from "../common/createDownloadTranscriptProps";
33
36
  import { createFooter } from "../common/createFooter";
34
37
  import { createInternetConnectionChangeHandler } from "../common/createInternetConnectionChangeHandler";
35
- import { defaultClientDataStoreProvider } from "../../../common/storage/default/defaultClientDataStoreProvider";
36
38
  import { defaultScrollBarProps } from "../common/defaultProps/defaultScrollBarProps";
37
39
  import { defaultWebChatContainerStatefulProps } from "../../webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps";
38
40
  import { disposeTelemetryLoggers } from "../common/disposeTelemetryLoggers";
@@ -49,7 +51,7 @@ import useChatAdapterStore from "../../../hooks/useChatAdapterStore";
49
51
  import useChatContextStore from "../../../hooks/useChatContextStore";
50
52
  import useChatSDKStore from "../../../hooks/useChatSDKStore";
51
53
  export const LiveChatWidgetStateful = props => {
52
- var _props$webChatContain, _props$styleProps, _chatSDK$omnichannelC, _props$controlProps, _props$controlProps2, _state$appStates7, _props$webChatContain5, _state$appStates14, _props$webChatContain6, _props$styleProps2, _props$controlProps11, _props$controlProps12, _props$componentOverr, _props$controlProps13, _props$componentOverr2, _props$controlProps14, _props$componentOverr3, _props$controlProps15, _props$componentOverr4, _props$controlProps16, _props$componentOverr5, _props$controlProps17, _props$componentOverr6, _props$controlProps18, _props$componentOverr7, _props$controlProps19, _props$controlProps20, _props$componentOverr8, _props$controlProps21, _props$componentOverr9, _props$controlProps22, _props$componentOverr10, _props$componentOverr11, _props$componentOverr12;
54
+ var _props$webChatContain, _props$styleProps, _chatSDK$omnichannelC, _props$controlProps, _props$controlProps2, _state$appStates7, _props$webChatContain5, _state$appStates14, _props$webChatContain6, _props$controlProps11, _props$draggableChatW, _props$draggableChatW2, _props$draggableChatW3, _props$draggableChatW4, _props$draggableChatW5, _livechatProps$webCha, _livechatProps$styleP, _livechatProps$contro, _livechatProps$contro2, _livechatProps$compon, _livechatProps$contro3, _livechatProps$compon2, _livechatProps$contro4, _livechatProps$compon3, _livechatProps$contro5, _livechatProps$compon4, _livechatProps$contro6, _livechatProps$compon5, _livechatProps$contro7, _livechatProps$compon6, _livechatProps$contro8, _livechatProps$compon7, _livechatProps$contro9, _livechatProps$contro10, _livechatProps$compon8, _livechatProps$contro11, _livechatProps$compon9, _livechatProps$contro12, _livechatProps$compon10, _livechatProps$compon11, _livechatProps$compon12;
53
55
  const [state, dispatch] = useChatContextStore();
54
56
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
55
57
  const [adapter, setAdapter] = useChatAdapterStore();
@@ -424,6 +426,9 @@ export const LiveChatWidgetStateful = props => {
424
426
  payload: undefined
425
427
  });
426
428
  });
429
+
430
+ // Check for TPC and log in telemetry if blocked
431
+ isCookieAllowed();
427
432
  return () => {
428
433
  disposeTelemetryLoggers();
429
434
  };
@@ -545,12 +550,11 @@ export const LiveChatWidgetStateful = props => {
545
550
  if (state.appStates.conversationState === ConversationState.Active &&
546
551
  props.controlProps?.hideStartChatButton === true) {
547
552
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
548
-
549
- window.onbeforeunload = function () {
553
+ window.onbeforeunload = function () {
550
554
  const prompt = Constants.BrowserUnloadConfirmationMessage;
551
555
  return prompt;
552
556
  };
553
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
557
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
554
558
  window.onunload = function () {
555
559
  initiateEndChatOnBrowserUnload();
556
560
  };
@@ -601,55 +605,79 @@ export const LiveChatWidgetStateful = props => {
601
605
  const confirmationPaneProps = initConfirmationPropsComposer(props);
602
606
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
603
607
  const prepareEndChatRelay = () => prepareEndChat(props, chatSDK, state, dispatch, setAdapter, setWebChatStyles, adapter, uwid.current);
608
+ const downloadTranscriptProps = createDownloadTranscriptProps(props.downloadTranscriptProps, {
609
+ ...(defaultWebChatContainerStatefulProps === null || defaultWebChatContainerStatefulProps === void 0 ? void 0 : defaultWebChatContainerStatefulProps.webChatStyles),
610
+ ...((_props$webChatContain6 = props.webChatContainerProps) === null || _props$webChatContain6 === void 0 ? void 0 : _props$webChatContain6.webChatStyles)
611
+ }, props.webChatContainerProps);
612
+ const livechatProps = {
613
+ ...props,
614
+ downloadTranscriptProps
615
+ };
616
+ const chatWidgetDraggableConfig = {
617
+ elementId: widgetElementId,
618
+ channel: ((_props$controlProps11 = props.controlProps) === null || _props$controlProps11 === void 0 ? void 0 : _props$controlProps11.widgetInstanceId) ?? "lcw",
619
+ disabled: ((_props$draggableChatW = props.draggableChatWidgetProps) === null || _props$draggableChatW === void 0 ? void 0 : _props$draggableChatW.disabled) === true ?? false // Draggable by default, unless explicitly disabled
620
+ };
621
+
622
+ // Disable receiving IDraggableEvent in current window
623
+ if (((_props$draggableChatW2 = props.draggableChatWidgetProps) === null || _props$draggableChatW2 === void 0 ? void 0 : _props$draggableChatW2.disabled) === false && (_props$draggableChatW3 = props.draggableChatWidgetProps) !== null && _props$draggableChatW3 !== void 0 && _props$draggableChatW3.targetIframe) {
624
+ chatWidgetDraggableConfig.disabled = true;
625
+ }
626
+ const headerDraggableConfig = {
627
+ draggableEventChannel: chatWidgetDraggableConfig.channel ?? "lcw",
628
+ draggableEventEmitterTargetWindow: (_props$draggableChatW4 = props.draggableChatWidgetProps) !== null && _props$draggableChatW4 !== void 0 && _props$draggableChatW4.targetIframe ? window.parent : window,
629
+ draggable: ((_props$draggableChatW5 = props.draggableChatWidgetProps) === null || _props$draggableChatW5 === void 0 ? void 0 : _props$draggableChatW5.disabled) !== true // Draggable by default, unless explicitly disabled
630
+ };
631
+
604
632
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("style", null, `
605
633
  ::-webkit-scrollbar {
606
634
  width: ${scrollbarProps.width};
607
635
  }
608
-
636
+
609
637
  ::-webkit-scrollbar-track {
610
638
  background: ${scrollbarProps.trackBackgroundColor};
611
639
  }
612
-
640
+
613
641
  ::-webkit-scrollbar-thumb {
614
642
  background: ${scrollbarProps.thumbBackgroundColor};
615
643
  border-radius: ${scrollbarProps.thumbBorderRadius};
616
644
  }
617
-
645
+
618
646
  ::-webkit-scrollbar-thumb:hover {
619
647
  background: ${scrollbarProps.thumbHoverColor};
620
- }
621
- `), /*#__PURE__*/React.createElement(Composer, _extends({}, webChatProps, {
648
+ }
649
+ `), /*#__PURE__*/React.createElement(DraggableChatWidget, chatWidgetDraggableConfig, /*#__PURE__*/React.createElement(Composer, _extends({}, webChatProps, {
622
650
  styleOptions: webChatStyles,
623
- directLine: ((_props$webChatContain6 = props.webChatContainerProps) === null || _props$webChatContain6 === void 0 ? void 0 : _props$webChatContain6.directLine) ?? adapter ?? defaultWebChatContainerStatefulProps.directLine
651
+ directLine: ((_livechatProps$webCha = livechatProps.webChatContainerProps) === null || _livechatProps$webCha === void 0 ? void 0 : _livechatProps$webCha.directLine) ?? adapter ?? defaultWebChatContainerStatefulProps.directLine
624
652
  }), /*#__PURE__*/React.createElement(Stack, {
625
653
  id: widgetElementId,
626
654
  styles: generalStyles,
627
- className: (_props$styleProps2 = props.styleProps) === null || _props$styleProps2 === void 0 ? void 0 : _props$styleProps2.className
628
- }, !((_props$controlProps11 = props.controlProps) !== null && _props$controlProps11 !== void 0 && _props$controlProps11.hideChatButton) && !((_props$controlProps12 = props.controlProps) !== null && _props$controlProps12 !== void 0 && _props$controlProps12.hideStartChatButton) && shouldShowChatButton(state) && (decodeComponentString((_props$componentOverr = props.componentOverrides) === null || _props$componentOverr === void 0 ? void 0 : _props$componentOverr.chatButton) || /*#__PURE__*/React.createElement(ChatButtonStateful, {
629
- buttonProps: props.chatButtonProps,
630
- outOfOfficeButtonProps: props.outOfOfficeChatButtonProps,
655
+ className: (_livechatProps$styleP = livechatProps.styleProps) === null || _livechatProps$styleP === void 0 ? void 0 : _livechatProps$styleP.className
656
+ }, !((_livechatProps$contro = livechatProps.controlProps) !== null && _livechatProps$contro !== void 0 && _livechatProps$contro.hideChatButton) && !((_livechatProps$contro2 = livechatProps.controlProps) !== null && _livechatProps$contro2 !== void 0 && _livechatProps$contro2.hideStartChatButton) && shouldShowChatButton(state) && (decodeComponentString((_livechatProps$compon = livechatProps.componentOverrides) === null || _livechatProps$compon === void 0 ? void 0 : _livechatProps$compon.chatButton) || /*#__PURE__*/React.createElement(ChatButtonStateful, {
657
+ buttonProps: livechatProps.chatButtonProps,
658
+ outOfOfficeButtonProps: livechatProps.outOfOfficeChatButtonProps,
631
659
  startChat: prepareStartChatRelay
632
- })), !((_props$controlProps13 = props.controlProps) !== null && _props$controlProps13 !== void 0 && _props$controlProps13.hideProactiveChatPane) && shouldShowProactiveChatPane(state) && (decodeComponentString((_props$componentOverr2 = props.componentOverrides) === null || _props$componentOverr2 === void 0 ? void 0 : _props$componentOverr2.proactiveChatPane) || /*#__PURE__*/React.createElement(ProactiveChatPaneStateful, {
633
- proactiveChatProps: props.proactiveChatPaneProps,
660
+ })), !((_livechatProps$contro3 = livechatProps.controlProps) !== null && _livechatProps$contro3 !== void 0 && _livechatProps$contro3.hideProactiveChatPane) && shouldShowProactiveChatPane(state) && (decodeComponentString((_livechatProps$compon2 = livechatProps.componentOverrides) === null || _livechatProps$compon2 === void 0 ? void 0 : _livechatProps$compon2.proactiveChatPane) || /*#__PURE__*/React.createElement(ProactiveChatPaneStateful, {
661
+ proactiveChatProps: livechatProps.proactiveChatPaneProps,
634
662
  startChat: prepareStartChatRelay
635
- })), !((_props$controlProps14 = props.controlProps) !== null && _props$controlProps14 !== void 0 && _props$controlProps14.hideHeader) && shouldShowHeader(state) && (decodeComponentString((_props$componentOverr3 = props.componentOverrides) === null || _props$componentOverr3 === void 0 ? void 0 : _props$componentOverr3.header) || /*#__PURE__*/React.createElement(HeaderStateful, {
636
- headerProps: props.headerProps,
637
- outOfOfficeHeaderProps: props.outOfOfficeHeaderProps,
663
+ })), !((_livechatProps$contro4 = livechatProps.controlProps) !== null && _livechatProps$contro4 !== void 0 && _livechatProps$contro4.hideHeader) && shouldShowHeader(state) && (decodeComponentString((_livechatProps$compon3 = livechatProps.componentOverrides) === null || _livechatProps$compon3 === void 0 ? void 0 : _livechatProps$compon3.header) || /*#__PURE__*/React.createElement(HeaderStateful, _extends({
664
+ headerProps: livechatProps.headerProps,
665
+ outOfOfficeHeaderProps: livechatProps.outOfOfficeHeaderProps,
638
666
  endChat: endChatRelay
639
- })), !((_props$controlProps15 = props.controlProps) !== null && _props$controlProps15 !== void 0 && _props$controlProps15.hideLoadingPane) && shouldShowLoadingPane(state) && (decodeComponentString((_props$componentOverr4 = props.componentOverrides) === null || _props$componentOverr4 === void 0 ? void 0 : _props$componentOverr4.loadingPane) || /*#__PURE__*/React.createElement(LoadingPaneStateful, {
640
- loadingPaneProps: props.loadingPaneProps,
641
- startChatErrorPaneProps: props.startChatErrorPaneProps
642
- })), !((_props$controlProps16 = props.controlProps) !== null && _props$controlProps16 !== void 0 && _props$controlProps16.hideOutOfOfficeHoursPane) && shouldShowOutOfOfficeHoursPane(state) && (decodeComponentString((_props$componentOverr5 = props.componentOverrides) === null || _props$componentOverr5 === void 0 ? void 0 : _props$componentOverr5.outOfOfficeHoursPane) || /*#__PURE__*/React.createElement(OutOfOfficeHoursPaneStateful, props.outOfOfficeHoursPaneProps)), !((_props$controlProps17 = props.controlProps) !== null && _props$controlProps17 !== void 0 && _props$controlProps17.hideReconnectChatPane) && shouldShowReconnectChatPane(state) && (decodeComponentString((_props$componentOverr6 = props.componentOverrides) === null || _props$componentOverr6 === void 0 ? void 0 : _props$componentOverr6.reconnectChatPane) || /*#__PURE__*/React.createElement(ReconnectChatPaneStateful, {
643
- reconnectChatProps: props.reconnectChatPaneProps,
667
+ }, headerDraggableConfig))), !((_livechatProps$contro5 = livechatProps.controlProps) !== null && _livechatProps$contro5 !== void 0 && _livechatProps$contro5.hideLoadingPane) && shouldShowLoadingPane(state) && (decodeComponentString((_livechatProps$compon4 = livechatProps.componentOverrides) === null || _livechatProps$compon4 === void 0 ? void 0 : _livechatProps$compon4.loadingPane) || /*#__PURE__*/React.createElement(LoadingPaneStateful, {
668
+ loadingPaneProps: livechatProps.loadingPaneProps,
669
+ startChatErrorPaneProps: livechatProps.startChatErrorPaneProps
670
+ })), !((_livechatProps$contro6 = livechatProps.controlProps) !== null && _livechatProps$contro6 !== void 0 && _livechatProps$contro6.hideOutOfOfficeHoursPane) && shouldShowOutOfOfficeHoursPane(state) && (decodeComponentString((_livechatProps$compon5 = livechatProps.componentOverrides) === null || _livechatProps$compon5 === void 0 ? void 0 : _livechatProps$compon5.outOfOfficeHoursPane) || /*#__PURE__*/React.createElement(OutOfOfficeHoursPaneStateful, livechatProps.outOfOfficeHoursPaneProps)), !((_livechatProps$contro7 = livechatProps.controlProps) !== null && _livechatProps$contro7 !== void 0 && _livechatProps$contro7.hideReconnectChatPane) && shouldShowReconnectChatPane(state) && (decodeComponentString((_livechatProps$compon6 = livechatProps.componentOverrides) === null || _livechatProps$compon6 === void 0 ? void 0 : _livechatProps$compon6.reconnectChatPane) || /*#__PURE__*/React.createElement(ReconnectChatPaneStateful, {
671
+ reconnectChatProps: livechatProps.reconnectChatPaneProps,
644
672
  initStartChat: initStartChatRelay
645
- })), !((_props$controlProps18 = props.controlProps) !== null && _props$controlProps18 !== void 0 && _props$controlProps18.hidePreChatSurveyPane) && shouldShowPreChatSurveyPane(state) && (decodeComponentString((_props$componentOverr7 = props.componentOverrides) === null || _props$componentOverr7 === void 0 ? void 0 : _props$componentOverr7.preChatSurveyPane) || /*#__PURE__*/React.createElement(PreChatSurveyPaneStateful, {
646
- surveyProps: props.preChatSurveyPaneProps,
673
+ })), !((_livechatProps$contro8 = livechatProps.controlProps) !== null && _livechatProps$contro8 !== void 0 && _livechatProps$contro8.hidePreChatSurveyPane) && shouldShowPreChatSurveyPane(state) && (decodeComponentString((_livechatProps$compon7 = livechatProps.componentOverrides) === null || _livechatProps$compon7 === void 0 ? void 0 : _livechatProps$compon7.preChatSurveyPane) || /*#__PURE__*/React.createElement(PreChatSurveyPaneStateful, {
674
+ surveyProps: livechatProps.preChatSurveyPaneProps,
647
675
  initStartChat: initStartChatRelay
648
- })), !((_props$controlProps19 = props.controlProps) !== null && _props$controlProps19 !== void 0 && _props$controlProps19.hideCallingContainer) && shouldShowCallingContainer(state) && /*#__PURE__*/React.createElement(CallingContainerStateful, _extends({
676
+ })), !((_livechatProps$contro9 = livechatProps.controlProps) !== null && _livechatProps$contro9 !== void 0 && _livechatProps$contro9.hideCallingContainer) && shouldShowCallingContainer(state) && /*#__PURE__*/React.createElement(CallingContainerStateful, _extends({
649
677
  voiceVideoCallingSdk: voiceVideoCallingSDK
650
- }, props.callingContainerProps)), !((_props$controlProps20 = props.controlProps) !== null && _props$controlProps20 !== void 0 && _props$controlProps20.hideWebChatContainer) && shouldShowWebChatContainer(state) && (decodeComponentString((_props$componentOverr8 = props.componentOverrides) === null || _props$componentOverr8 === void 0 ? void 0 : _props$componentOverr8.webChatContainer) || /*#__PURE__*/React.createElement(WebChatContainerStateful, props.webChatContainerProps)), !((_props$controlProps21 = props.controlProps) !== null && _props$controlProps21 !== void 0 && _props$controlProps21.hideConfirmationPane) && shouldShowConfirmationPane(state) && (decodeComponentString((_props$componentOverr9 = props.componentOverrides) === null || _props$componentOverr9 === void 0 ? void 0 : _props$componentOverr9.confirmationPane) || /*#__PURE__*/React.createElement(ConfirmationPaneStateful, _extends({}, confirmationPaneProps, {
678
+ }, livechatProps.callingContainerProps)), !((_livechatProps$contro10 = livechatProps.controlProps) !== null && _livechatProps$contro10 !== void 0 && _livechatProps$contro10.hideWebChatContainer) && shouldShowWebChatContainer(state) && (decodeComponentString((_livechatProps$compon8 = livechatProps.componentOverrides) === null || _livechatProps$compon8 === void 0 ? void 0 : _livechatProps$compon8.webChatContainer) || /*#__PURE__*/React.createElement(WebChatContainerStateful, livechatProps)), !((_livechatProps$contro11 = livechatProps.controlProps) !== null && _livechatProps$contro11 !== void 0 && _livechatProps$contro11.hideConfirmationPane) && shouldShowConfirmationPane(state) && (decodeComponentString((_livechatProps$compon9 = livechatProps.componentOverrides) === null || _livechatProps$compon9 === void 0 ? void 0 : _livechatProps$compon9.confirmationPane) || /*#__PURE__*/React.createElement(ConfirmationPaneStateful, _extends({}, confirmationPaneProps, {
651
679
  setPostChatContext: setPostChatContextRelay,
652
680
  prepareEndChat: prepareEndChatRelay
653
- }))), !((_props$controlProps22 = props.controlProps) !== null && _props$controlProps22 !== void 0 && _props$controlProps22.hidePostChatLoadingPane) && shouldShowPostChatLoadingPane(state) && (decodeComponentString((_props$componentOverr10 = props.componentOverrides) === null || _props$componentOverr10 === void 0 ? void 0 : _props$componentOverr10.postChatLoadingPane) || /*#__PURE__*/React.createElement(PostChatLoadingPaneStateful, props.postChatLoadingPaneProps)), shouldShowPostChatSurveyPane(state) && (decodeComponentString((_props$componentOverr11 = props.componentOverrides) === null || _props$componentOverr11 === void 0 ? void 0 : _props$componentOverr11.postChatSurveyPane) || /*#__PURE__*/React.createElement(PostChatSurveyPaneStateful, _extends({}, props.postChatSurveyPaneProps, props.chatSDK))), createFooter(props, state), shouldShowEmailTranscriptPane(state) && (decodeComponentString((_props$componentOverr12 = props.componentOverrides) === null || _props$componentOverr12 === void 0 ? void 0 : _props$componentOverr12.emailTranscriptPane) || /*#__PURE__*/React.createElement(EmailTranscriptPaneStateful, props.emailTranscriptPane)))));
681
+ }))), !((_livechatProps$contro12 = livechatProps.controlProps) !== null && _livechatProps$contro12 !== void 0 && _livechatProps$contro12.hidePostChatLoadingPane) && shouldShowPostChatLoadingPane(state) && (decodeComponentString((_livechatProps$compon10 = livechatProps.componentOverrides) === null || _livechatProps$compon10 === void 0 ? void 0 : _livechatProps$compon10.postChatLoadingPane) || /*#__PURE__*/React.createElement(PostChatLoadingPaneStateful, livechatProps.postChatLoadingPaneProps)), shouldShowPostChatSurveyPane(state) && (decodeComponentString((_livechatProps$compon11 = livechatProps.componentOverrides) === null || _livechatProps$compon11 === void 0 ? void 0 : _livechatProps$compon11.postChatSurveyPane) || /*#__PURE__*/React.createElement(PostChatSurveyPaneStateful, _extends({}, livechatProps.postChatSurveyPaneProps, livechatProps.chatSDK))), createFooter(livechatProps, state), shouldShowEmailTranscriptPane(state) && (decodeComponentString((_livechatProps$compon12 = livechatProps.componentOverrides) === null || _livechatProps$compon12 === void 0 ? void 0 : _livechatProps$compon12.emailTranscriptPane) || /*#__PURE__*/React.createElement(EmailTranscriptPaneStateful, livechatProps.emailTranscriptPane))))));
654
682
  };
655
683
  export default LiveChatWidgetStateful;
@@ -113,6 +113,12 @@ export const PreChatSurveyPaneStateful = props => {
113
113
  const current = children[index];
114
114
  if (current && current.className == HtmlAttributeNames.adaptiveCardTextBlockClassName) {
115
115
  value = current.innerHTML;
116
+ if (current.childElementCount > 0) {
117
+ const paragraph = current.children[0];
118
+ if (paragraph.tagName.toLowerCase() == HtmlAttributeNames.pTagName) {
119
+ value = paragraph.innerHTML;
120
+ }
121
+ }
116
122
  }
117
123
  if (current && current.tagName.toLowerCase() == HtmlAttributeNames.div && current.childElementCount > 0) {
118
124
  const input = current.children[0].children;
@@ -1,3 +1,5 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+
1
3
  import { Stack } from "@fluentui/react";
2
4
  import { LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
3
5
  import React, { useEffect } from "react";
@@ -6,12 +8,15 @@ import { BroadcastChannel } from "broadcast-channel";
6
8
  import { Components } from "botframework-webchat";
7
9
  import { Constants } from "../../common/Constants";
8
10
  import { LiveChatWidgetActionType } from "../../contexts/common/LiveChatWidgetActionType";
11
+ import { NotificationHandler } from "./webchatcontroller/notification/NotificationHandler";
12
+ import { NotificationScenarios } from "./webchatcontroller/enums/NotificationScenarios";
9
13
  import { TelemetryHelper } from "../../common/telemetry/TelemetryHelper";
10
14
  import { WebChatActionType } from "./webchatcontroller/enums/WebChatActionType";
11
15
  import { WebChatStoreLoader } from "./webchatcontroller/WebChatStoreLoader";
12
16
  import { defaultAdaptiveCardStyles } from "./common/defaultStyles/defaultAdaptiveCardStyles";
13
17
  import { defaultMiddlewareLocalizedTexts } from "./common/defaultProps/defaultMiddlewareLocalizedTexts";
14
18
  import { defaultReceivedMessageAnchorStyles } from "./webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultReceivedMessageAnchorStyles";
19
+ import { defaultSentMessageAnchorStyles } from "./webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSentMessageAnchorStyles";
15
20
  import { defaultSystemMessageBoxStyles } from "./webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles";
16
21
  import { defaultUserMessageBoxStyles } from "./webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles";
17
22
  import { defaultWebChatContainerStatefulProps } from "./common/defaultProps/defaultWebChatContainerStatefulProps";
@@ -43,28 +48,33 @@ const createMagicCodeSuccessResponse = signin => {
43
48
  };
44
49
  };
45
50
  export const WebChatContainerStateful = props => {
46
- var _props$adaptiveCardSt, _props$renderingMiddl, _props$renderingMiddl2, _props$renderingMiddl3, _props$renderingMiddl4, _props$adaptiveCardSt2, _props$adaptiveCardSt3, _props$adaptiveCardSt4, _props$renderingMiddl5, _props$renderingMiddl6, _props$renderingMiddl7, _props$renderingMiddl8;
51
+ var _webChatContainerProp, _webChatContainerProp2, _webChatContainerProp3, _webChatContainerProp4, _webChatContainerProp5, _webChatContainerProp6, _webChatContainerProp7, _webChatContainerProp8, _webChatContainerProp9, _webChatContainerProp10, _webChatContainerProp11, _webChatContainerProp12, _webChatContainerProp13, _webChatContainerProp14, _webChatContainerProp15;
47
52
  const {
48
53
  BasicWebChat
49
54
  } = Components;
50
55
  const [state, dispatch] = useChatContextStore();
51
56
  const magicCodeBroadcastChannel = new BroadcastChannel(Constants.magicCodeBroadcastChannel);
52
57
  const magicCodeResponseBroadcastChannel = new BroadcastChannel(Constants.magicCodeResponseBroadcastChannel);
58
+ const {
59
+ webChatContainerProps,
60
+ contextDataStore
61
+ } = props;
53
62
  const containerStyles = {
54
- root: Object.assign({}, defaultWebChatContainerStatefulProps.containerStyles, props === null || props === void 0 ? void 0 : props.containerStyles, {
63
+ root: Object.assign({}, defaultWebChatContainerStatefulProps.containerStyles, webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : webChatContainerProps.containerStyles, {
55
64
  display: state.appStates.isMinimized ? "none" : ""
56
65
  }) // Use this instead of removing WebChat from the picture so that the activity observer inside the adapter is not invoked
57
66
  };
58
67
 
59
68
  const localizedTexts = {
60
69
  ...defaultMiddlewareLocalizedTexts,
61
- ...(props === null || props === void 0 ? void 0 : props.localizedTexts)
70
+ ...(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : webChatContainerProps.localizedTexts)
62
71
  };
63
72
  useEffect(() => {
73
+ var _props$webChatContain, _props$webChatContain2;
64
74
  setFocusOnSendBox();
65
75
  dispatch({
66
76
  type: LiveChatWidgetActionType.SET_RENDERING_MIDDLEWARE_PROPS,
67
- payload: props === null || props === void 0 ? void 0 : props.renderingMiddlewareProps
77
+ payload: webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : webChatContainerProps.renderingMiddlewareProps
68
78
  });
69
79
  dispatch({
70
80
  type: LiveChatWidgetActionType.SET_MIDDLEWARE_LOCALIZED_TEXTS,
@@ -73,6 +83,17 @@ export const WebChatContainerStateful = props => {
73
83
  TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
74
84
  Event: TelemetryEvent.WebChatLoaded
75
85
  });
86
+ 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) {
87
+ try {
88
+ localStorage;
89
+ sessionStorage;
90
+ } catch (error) {
91
+ if (!window.TPCWarningShown) {
92
+ NotificationHandler.notifyWarning(NotificationScenarios.TPC, (localizedTexts === null || localizedTexts === void 0 ? void 0 : localizedTexts.THIRD_PARTY_COOKIES_BLOCKED_ALERT_MESSAGE) ?? "");
93
+ window.TPCWarningShown = true;
94
+ }
95
+ }
96
+ }
76
97
  }, []);
77
98
  useEffect(() => {
78
99
  const eventListener = event => {
@@ -113,26 +134,33 @@ export const WebChatContainerStateful = props => {
113
134
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("style", null, `
114
135
 
115
136
  .webchat__bubble__content>div#ms_lcw_webchat_adaptive_card {
116
- background: ${(props === null || props === void 0 ? void 0 : (_props$adaptiveCardSt = props.adaptiveCardStyles) === null || _props$adaptiveCardSt === void 0 ? void 0 : _props$adaptiveCardSt.background) ?? defaultAdaptiveCardStyles.background};
137
+ background: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp === void 0 ? void 0 : _webChatContainerProp.background) ?? defaultAdaptiveCardStyles.background};
117
138
  }
118
139
 
119
140
  .webchat__stacked-layout__content div.webchat__stacked-layout__message-row div.webchat__bubble--from-user {
120
- max-width: ${(props === null || props === void 0 ? void 0 : (_props$renderingMiddl = props.renderingMiddlewareProps) === null || _props$renderingMiddl === void 0 ? void 0 : (_props$renderingMiddl2 = _props$renderingMiddl.userMessageBoxStyles) === null || _props$renderingMiddl2 === void 0 ? void 0 : _props$renderingMiddl2.maxWidth) ?? (defaultUserMessageBoxStyles === null || defaultUserMessageBoxStyles === void 0 ? void 0 : defaultUserMessageBoxStyles.maxWidth)}
141
+ max-width: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp2 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp2 === void 0 ? void 0 : (_webChatContainerProp3 = _webChatContainerProp2.userMessageBoxStyles) === null || _webChatContainerProp3 === void 0 ? void 0 : _webChatContainerProp3.maxWidth) ?? (defaultUserMessageBoxStyles === null || defaultUserMessageBoxStyles === void 0 ? void 0 : defaultUserMessageBoxStyles.maxWidth)}
121
142
  }
122
143
 
123
144
  .webchat__stacked-layout--show-avatar div.webchat__stacked-layout__content div.webchat__stacked-layout__message-row div.webchat__stacked-layout__message {
124
- max-width: ${(props === null || props === void 0 ? void 0 : (_props$renderingMiddl3 = props.renderingMiddlewareProps) === null || _props$renderingMiddl3 === void 0 ? void 0 : (_props$renderingMiddl4 = _props$renderingMiddl3.systemMessageBoxStyles) === null || _props$renderingMiddl4 === void 0 ? void 0 : _props$renderingMiddl4.maxWidth) ?? (defaultSystemMessageBoxStyles === null || defaultSystemMessageBoxStyles === void 0 ? void 0 : defaultSystemMessageBoxStyles.maxWidth)}
145
+ max-width: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp4 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp4 === void 0 ? void 0 : (_webChatContainerProp5 = _webChatContainerProp4.systemMessageBoxStyles) === null || _webChatContainerProp5 === void 0 ? void 0 : _webChatContainerProp5.maxWidth) ?? (defaultSystemMessageBoxStyles === null || defaultSystemMessageBoxStyles === void 0 ? void 0 : defaultSystemMessageBoxStyles.maxWidth)}
125
146
  }
126
147
 
127
- div[class="ac-textBlock"]>p{color:${(props === null || props === void 0 ? void 0 : (_props$adaptiveCardSt2 = props.adaptiveCardStyles) === null || _props$adaptiveCardSt2 === void 0 ? void 0 : _props$adaptiveCardSt2.color) ?? defaultAdaptiveCardStyles.color}; white-space:${(props === null || props === void 0 ? void 0 : (_props$adaptiveCardSt3 = props.adaptiveCardStyles) === null || _props$adaptiveCardSt3 === void 0 ? void 0 : _props$adaptiveCardSt3.textWhiteSpace) ?? defaultAdaptiveCardStyles.textWhiteSpace}}
128
-
129
- .webchat__stacked-layout__content .ac-actionSet > .ac-pushButton > div {white-space: ${(props === null || props === void 0 ? void 0 : (_props$adaptiveCardSt4 = props.adaptiveCardStyles) === null || _props$adaptiveCardSt4 === void 0 ? void 0 : _props$adaptiveCardSt4.buttonWhiteSpace) ?? defaultAdaptiveCardStyles.buttonWhiteSpace} !important;}
148
+ div[class="ac-textBlock"] *,
149
+ div[class="ac-input-container"] * {color:${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp6 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp6 === void 0 ? void 0 : _webChatContainerProp6.color) ?? defaultAdaptiveCardStyles.color}; white-space:${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp7 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp7 === void 0 ? void 0 : _webChatContainerProp7.textWhiteSpace) ?? defaultAdaptiveCardStyles.textWhiteSpace}}
150
+ div[class="ac-textBlock"] a:link,
151
+ div[class="ac-textBlock"] a:visited,
152
+ div[class="ac-textBlock"] a:hover,
153
+ div[class="ac-textBlock"] a:active {
154
+ color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp8 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp8 === void 0 ? void 0 : _webChatContainerProp8.anchorColor) ?? defaultAdaptiveCardStyles.anchorColor};
155
+ }
156
+
157
+ .webchat__stacked-layout__content .ac-actionSet > .ac-pushButton > div {white-space: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp9 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp9 === void 0 ? void 0 : _webChatContainerProp9.buttonWhiteSpace) ?? defaultAdaptiveCardStyles.buttonWhiteSpace} !important;}
130
158
 
131
159
  .ms_lcw_webchat_received_message img.webchat__markdown__external-link-icon {
132
160
  background-image : url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIzIDMgMTggMTgiICB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik03LjI1MDEgNC41MDAxN0gxMC43NDk1QzExLjE2MzcgNC41MDAxNyAxMS40OTk1IDQuODM1OTYgMTEuNDk5NSA1LjI1MDE3QzExLjQ5OTUgNS42Mjk4NiAxMS4yMTczIDUuOTQzNjYgMTAuODUxMyA1Ljk5MzMyTDEwLjc0OTUgNi4wMDAxN0g3LjI0OTc0QzYuMDcwNzkgNS45OTk2MSA1LjEwMzQ5IDYuOTA2NTYgNS4wMDc4NiA4LjA2MTEyTDUuMDAwMjggOC4yMjAwM0w1LjAwMzEyIDE2Ljc1MDdDNS4wMDM0MyAxNy45NDE1IDUuOTI4ODUgMTguOTE2MSA3LjA5OTY2IDE4Ljk5NDlMNy4yNTM3MSAxOS4wMDAxTDE1Ljc1MTggMTguOTg4NEMxNi45NDE1IDE4Ljk4NjggMTcuOTE0NSAxOC4wNjIgMTcuOTkzNSAxNi44OTIzTDE3Ljk5ODcgMTYuNzM4NFYxMy4yMzIxQzE3Ljk5ODcgMTIuODE3OSAxOC4zMzQ1IDEyLjQ4MjEgMTguNzQ4NyAxMi40ODIxQzE5LjEyODQgMTIuNDgyMSAxOS40NDIyIDEyLjc2NDMgMTkuNDkxOCAxMy4xMzAzTDE5LjQ5ODcgMTMuMjMyMVYxNi43Mzg0QzE5LjQ5ODcgMTguNzQwNyAxNy45MjkzIDIwLjM3NjkgMTUuOTUyOCAyMC40ODI5TDE1Ljc1MzggMjAuNDg4NEw3LjI1ODI3IDIwLjUwMDFMNy4wNTQ5NSAyMC40OTQ5QzUuMTQyMzkgMjAuMzk1NCAzLjYwODk1IDE4Ljg2MjcgMy41MDgzNyAxNi45NTAyTDMuNTAzMTIgMTYuNzUxMUwzLjUwMDg5IDguMjUyN0wzLjUwNTI5IDguMDUwMkMzLjYwNTM5IDYuMTM3NDkgNS4xMzg2NyA0LjYwNDQ5IDcuMDUwOTYgNC41MDUyN0w3LjI1MDEgNC41MDAxN0gxMC43NDk1SDcuMjUwMVpNMTMuNzQ4MSAzLjAwMTQ2TDIwLjMwMTggMy4wMDE5N0wyMC40MDE0IDMuMDE1NzVMMjAuNTAyMiAzLjA0MzkzTDIwLjU1OSAzLjA2ODAzQzIwLjYxMjIgMy4wOTEyMiAyMC42NjM0IDMuMTIxNjMgMjAuNzExMSAzLjE1ODg1TDIwLjc4MDQgMy4yMjE1NkwyMC44NjQxIDMuMzIwMTRMMjAuOTE4MyAzLjQxMDI1TDIwLjk1NyAzLjUwMDU3TDIwLjk3NjIgMy41NjQ3NkwyMC45ODk4IDMuNjI4NjJMMjAuOTk5MiAzLjcyMjgyTDIwLjk5OTcgMTAuMjU1NEMyMC45OTk3IDEwLjY2OTYgMjAuNjYzOSAxMS4wMDU0IDIwLjI0OTcgMTEuMDA1NEMxOS44NyAxMS4wMDU0IDE5LjU1NjIgMTAuNzIzMiAxOS41MDY1IDEwLjM1NzFMMTkuNDk5NyAxMC4yNTU0TDE5LjQ5ODkgNS41NjE0N0wxMi4yNzk3IDEyLjc4NDdDMTIuMDEzNCAxMy4wNTEgMTEuNTk2OCAxMy4wNzUzIDExLjMwMzEgMTIuODU3NUwxMS4yMTkgMTIuNzg0OUMxMC45NTI3IDEyLjUxODcgMTAuOTI4NCAxMi4xMDIxIDExLjE0NjIgMTEuODA4NEwxMS4yMTg4IDExLjcyNDNMMTguNDM2OSA0LjUwMTQ2SDEzLjc0ODFDMTMuMzY4NCA0LjUwMTQ2IDEzLjA1NDYgNC4yMTkzMSAxMy4wMDUgMy44NTMyNEwxMi45OTgxIDMuNzUxNDZDMTIuOTk4MSAzLjM3MTc3IDEzLjI4MDMgMy4wNTc5NyAxMy42NDY0IDMuMDA4MzFMMTMuNzQ4MSAzLjAwMTQ2WiIgZmlsbD0iI0ZGRkZGRiIgLz48L3N2Zz4) !important;
133
161
  height: '.75em';
134
162
  marginLeft: '.25em';
135
- filter:${(props === null || props === void 0 ? void 0 : (_props$renderingMiddl5 = props.renderingMiddlewareProps) === null || _props$renderingMiddl5 === void 0 ? void 0 : (_props$renderingMiddl6 = _props$renderingMiddl5.receivedMessageAnchorStyles) === null || _props$renderingMiddl6 === void 0 ? void 0 : _props$renderingMiddl6.filter) ?? "none"};
163
+ filter:${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp10 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp10 === void 0 ? void 0 : (_webChatContainerProp11 = _webChatContainerProp10.receivedMessageAnchorStyles) === null || _webChatContainerProp11 === void 0 ? void 0 : _webChatContainerProp11.filter) ?? "none"};
136
164
  }
137
165
  pre {
138
166
  white-space: pre-wrap;
@@ -145,8 +173,15 @@ export const WebChatContainerStateful = props => {
145
173
  .ms_lcw_webchat_received_message a:visited,
146
174
  .ms_lcw_webchat_received_message a:hover,
147
175
  .ms_lcw_webchat_received_message a:active {
148
- color: ${(props === null || props === void 0 ? void 0 : (_props$renderingMiddl7 = props.renderingMiddlewareProps) === null || _props$renderingMiddl7 === void 0 ? void 0 : (_props$renderingMiddl8 = _props$renderingMiddl7.receivedMessageAnchorStyles) === null || _props$renderingMiddl8 === void 0 ? void 0 : _props$renderingMiddl8.color) ?? (defaultReceivedMessageAnchorStyles === null || defaultReceivedMessageAnchorStyles === void 0 ? void 0 : defaultReceivedMessageAnchorStyles.color)};
149
- } `), /*#__PURE__*/React.createElement(Stack, {
176
+ color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp12 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp12 === void 0 ? void 0 : (_webChatContainerProp13 = _webChatContainerProp12.receivedMessageAnchorStyles) === null || _webChatContainerProp13 === void 0 ? void 0 : _webChatContainerProp13.color) ?? (defaultReceivedMessageAnchorStyles === null || defaultReceivedMessageAnchorStyles === void 0 ? void 0 : defaultReceivedMessageAnchorStyles.color)};
177
+ }
178
+ .ms_lcw_webchat_sent_message a:link,
179
+ .ms_lcw_webchat_sent_message a:visited,
180
+ .ms_lcw_webchat_sent_message a:hover,
181
+ .ms_lcw_webchat_sent_message a:active {
182
+ color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp14 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp14 === void 0 ? void 0 : (_webChatContainerProp15 = _webChatContainerProp14.sentMessageAnchorStyles) === null || _webChatContainerProp15 === void 0 ? void 0 : _webChatContainerProp15.color) ?? (defaultSentMessageAnchorStyles === null || defaultSentMessageAnchorStyles === void 0 ? void 0 : defaultSentMessageAnchorStyles.color)};
183
+ }
184
+ `), /*#__PURE__*/React.createElement(Stack, {
150
185
  styles: containerStyles
151
186
  }, /*#__PURE__*/React.createElement(BasicWebChat, null)));
152
187
  };
@@ -24,5 +24,6 @@ export const defaultMiddlewareLocalizedTexts = {
24
24
  MIDDLEWARE_MESSAGE_DELIVERED: "Sent",
25
25
  MIDDLEWARE_MESSAGE_NOT_DELIVERED: "Not Delivered",
26
26
  MIDDLEWARE_MESSAGE_RETRY: "Retry",
27
- MIDDLEWARE_BANNER_CHAT_DISCONNECT: "Your conversation has been disconnected. For additional assistance, please start a new chat."
27
+ MIDDLEWARE_BANNER_CHAT_DISCONNECT: "Your conversation has been disconnected. For additional assistance, please start a new chat.",
28
+ THIRD_PARTY_COOKIES_BLOCKED_ALERT_MESSAGE: "Third party cookies are blocked. Reloading this page will start a new conversation."
28
29
  };
@@ -1,6 +1,7 @@
1
1
  export const defaultAdaptiveCardStyles = {
2
2
  background: "white",
3
3
  color: "black",
4
+ anchorColor: "blue",
4
5
  textWhiteSpace: "normal",
5
6
  buttonWhiteSpace: "normal"
6
7
  };
@@ -8,6 +8,11 @@ export class MockChatSDK {
8
8
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
9
9
  _defineProperty(this, "sleep", ms => new Promise(r => setTimeout(r, ms)));
10
10
  _defineProperty(this, "isMockModeOn", true);
11
+ _defineProperty(this, "omnichannelConfig", {
12
+ widgetId: "00000000-0000-0000-0000-000000000000",
13
+ orgId: "00000000-0000-0000-0000-000000000000",
14
+ orgUrl: "https://contoso.crm.dynamics.com"
15
+ });
11
16
  }
12
17
  async startChat() {
13
18
  await this.sleep(1000);
@@ -7,4 +7,5 @@ export let NotificationScenarios;
7
7
  NotificationScenarios["InternetConnection"] = "internet connection";
8
8
  NotificationScenarios["MaxSizeError"] = "max size";
9
9
  NotificationScenarios["ChatDisconnect"] = "chat disconnect";
10
+ NotificationScenarios["TPC"] = "tpc blocked";
10
11
  })(NotificationScenarios || (NotificationScenarios = {}));