@microsoft/omnichannel-chat-widget 0.1.0-main.cf54410 → 0.1.0-main.d48dae2

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 (184) hide show
  1. package/README.md +259 -0
  2. package/lib/cjs/assets/Audios.js +8 -0
  3. package/lib/cjs/assets/Icons.js +28 -0
  4. package/lib/cjs/common/Constants.js +52 -6
  5. package/lib/cjs/common/telemetry/TelemetryConstants.js +61 -5
  6. package/lib/cjs/common/telemetry/TelemetryHelper.js +13 -0
  7. package/lib/cjs/common/telemetry/TelemetryManager.js +17 -6
  8. package/lib/cjs/common/telemetry/defaultConfigs/defaultAriaConfig.js +1 -1
  9. package/lib/cjs/common/telemetry/defaultConfigs/defaultTelemetryConfiguration.js +4 -1
  10. package/lib/cjs/common/telemetry/loggers/ariaTelemetryLogger.js +33 -13
  11. package/lib/cjs/common/telemetry/loggers/consoleLogger.js +6 -5
  12. package/lib/cjs/common/utils.js +76 -2
  13. package/lib/cjs/components/callingcontainerstateful/CallingContainerStateful.js +14 -0
  14. package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +20 -4
  15. package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +8 -42
  16. package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +2 -2
  17. package/lib/cjs/components/footerstateful/FooterStateful.js +4 -5
  18. package/lib/cjs/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +11 -2
  19. package/lib/cjs/components/headerstateful/HeaderStateful.js +13 -10
  20. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +23 -0
  21. package/lib/cjs/{assets/assets.d.js → components/livechatwidget/common/ActivitySubscriber/IActivitySubscriber.js} +0 -0
  22. package/lib/cjs/components/livechatwidget/common/ChatAdapterShim.js +70 -0
  23. package/lib/cjs/components/livechatwidget/common/createAdapter.js +10 -1
  24. package/lib/cjs/components/livechatwidget/common/createMarkdown.js +32 -32
  25. package/lib/cjs/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +25 -24
  26. package/lib/cjs/components/livechatwidget/common/endChat.js +142 -51
  27. package/lib/cjs/components/livechatwidget/common/initCallingSdk.js +5 -0
  28. package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +47 -9
  29. package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +115 -22
  30. package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +6 -17
  31. package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +6 -9
  32. package/lib/cjs/components/livechatwidget/common/shareObservable.js +45 -0
  33. package/lib/cjs/components/livechatwidget/common/startChat.js +176 -57
  34. package/lib/cjs/components/livechatwidget/common/startProactiveChat.js +3 -3
  35. package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +246 -78
  36. package/lib/cjs/components/loadingpanestateful/LoadingPaneStateful.js +1 -1
  37. package/lib/cjs/components/ooohpanestateful/OOOHPaneStateful.js +8 -0
  38. package/lib/cjs/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.js +8 -0
  39. package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +8 -13
  40. package/lib/cjs/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +27 -5
  41. package/lib/cjs/components/proactivechatpanestateful/interfaces/IProactiveChatNotificationConfig.js +1 -0
  42. package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +80 -0
  43. package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +6 -0
  44. package/lib/cjs/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.js +51 -73
  45. package/lib/cjs/components/webchatcontainerstateful/interfaces/IBotMagicCodeConfig.js +1 -0
  46. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +14 -0
  47. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +25 -48
  48. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +3 -1
  49. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.js +52 -0
  50. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.spec.js +98 -0
  51. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.js +117 -0
  52. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +6 -6
  53. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.js +45 -0
  54. package/lib/cjs/contexts/common/ConversationState.js +4 -2
  55. package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +9 -7
  56. package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +8 -3
  57. package/lib/cjs/contexts/createReducer.js +16 -10
  58. package/lib/cjs/controller/componentController.js +5 -5
  59. package/lib/cjs/plugins/newMessageEventHandler.js +99 -0
  60. package/lib/esm/assets/Audios.js +1 -0
  61. package/lib/esm/assets/Icons.js +11 -0
  62. package/lib/esm/common/Constants.js +48 -5
  63. package/lib/esm/common/telemetry/TelemetryConstants.js +57 -4
  64. package/lib/esm/common/telemetry/TelemetryHelper.js +13 -1
  65. package/lib/esm/common/telemetry/TelemetryManager.js +15 -6
  66. package/lib/esm/common/telemetry/defaultConfigs/defaultAriaConfig.js +1 -1
  67. package/lib/esm/common/telemetry/defaultConfigs/defaultTelemetryConfiguration.js +4 -1
  68. package/lib/esm/common/telemetry/loggers/ariaTelemetryLogger.js +36 -14
  69. package/lib/esm/common/telemetry/loggers/consoleLogger.js +6 -5
  70. package/lib/esm/common/utils.js +55 -1
  71. package/lib/esm/components/callingcontainerstateful/CallingContainerStateful.js +14 -0
  72. package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +22 -7
  73. package/lib/esm/components/confirmationpanestateful/ConfirmationPaneStateful.js +8 -38
  74. package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +2 -2
  75. package/lib/esm/components/footerstateful/FooterStateful.js +4 -5
  76. package/lib/esm/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +9 -3
  77. package/lib/esm/components/headerstateful/HeaderStateful.js +14 -11
  78. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +14 -0
  79. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/IActivitySubscriber.js +1 -0
  80. package/lib/esm/components/livechatwidget/common/ChatAdapterShim.js +59 -0
  81. package/lib/esm/components/livechatwidget/common/createAdapter.js +10 -2
  82. package/lib/esm/components/livechatwidget/common/createMarkdown.js +32 -31
  83. package/lib/esm/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +23 -25
  84. package/lib/esm/components/livechatwidget/common/endChat.js +139 -50
  85. package/lib/esm/components/livechatwidget/common/initCallingSdk.js +3 -0
  86. package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +42 -11
  87. package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +104 -22
  88. package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +5 -14
  89. package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +6 -9
  90. package/lib/esm/components/livechatwidget/common/shareObservable.js +38 -0
  91. package/lib/esm/components/livechatwidget/common/startChat.js +170 -56
  92. package/lib/esm/components/livechatwidget/common/startProactiveChat.js +5 -5
  93. package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +232 -79
  94. package/lib/esm/components/loadingpanestateful/LoadingPaneStateful.js +1 -1
  95. package/lib/esm/components/ooohpanestateful/OOOHPaneStateful.js +6 -0
  96. package/lib/esm/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.js +6 -0
  97. package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +9 -13
  98. package/lib/esm/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +26 -6
  99. package/lib/esm/components/proactivechatpanestateful/interfaces/IProactiveChatNotificationConfig.js +1 -0
  100. package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +72 -0
  101. package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +6 -0
  102. package/lib/esm/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.js +2 -12
  103. package/lib/esm/components/webchatcontainerstateful/interfaces/IBotMagicCodeConfig.js +1 -0
  104. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +5 -0
  105. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +23 -46
  106. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +2 -1
  107. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.js +41 -0
  108. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.spec.js +94 -0
  109. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.js +107 -0
  110. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +6 -6
  111. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.js +32 -0
  112. package/lib/esm/contexts/common/ConversationState.js +4 -2
  113. package/lib/esm/contexts/common/LiveChatWidgetActionType.js +9 -7
  114. package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +8 -3
  115. package/lib/esm/contexts/createReducer.js +16 -9
  116. package/lib/esm/controller/componentController.js +5 -5
  117. package/lib/esm/plugins/newMessageEventHandler.js +82 -0
  118. package/lib/types/assets/Audios.d.ts +1 -0
  119. package/lib/types/assets/Icons.d.ts +11 -0
  120. package/lib/types/common/Constants.d.ts +26 -2
  121. package/lib/types/common/interfaces/IContextDataStore.d.ts +2 -2
  122. package/lib/types/common/telemetry/TelemetryConstants.d.ts +44 -2
  123. package/lib/types/common/telemetry/TelemetryHelper.d.ts +3 -1
  124. package/lib/types/common/telemetry/definitions/Payload.d.ts +12 -9
  125. package/lib/types/common/telemetry/interfaces/ITelemetryConfig.d.ts +3 -3
  126. package/lib/types/common/utils.d.ts +7 -1
  127. package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneStatefulParams.d.ts +5 -2
  128. package/lib/types/components/footerstateful/audionotificationstateful/interfaces/IAudioNotificationStatefulParams.d.ts +0 -1
  129. package/lib/types/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.d.ts +1 -1
  130. package/lib/types/components/headerstateful/interfaces/IHeaderStatefulParams.d.ts +4 -1
  131. package/lib/types/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.d.ts +5 -0
  132. package/lib/types/components/livechatwidget/common/ActivitySubscriber/IActivitySubscriber.d.ts +6 -0
  133. package/lib/types/components/livechatwidget/common/ChatAdapterShim.d.ts +7 -0
  134. package/lib/types/components/livechatwidget/common/endChat.d.ts +4 -1
  135. package/lib/types/components/livechatwidget/common/reconnectChatHelper.d.ts +6 -2
  136. package/lib/types/components/livechatwidget/common/setPostChatContextAndLoadSurvey.d.ts +1 -1
  137. package/lib/types/components/livechatwidget/common/shareObservable.d.ts +1 -0
  138. package/lib/types/components/livechatwidget/common/startChat.d.ts +4 -2
  139. package/lib/types/components/livechatwidget/common/startProactiveChat.d.ts +2 -1
  140. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetComponentOverrides.d.ts +1 -0
  141. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +2 -1
  142. package/lib/types/components/proactivechatpanestateful/interfaces/IProactiveChatNotificationConfig.d.ts +3 -0
  143. package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatPaneStatefulProps.d.ts +1 -1
  144. package/lib/types/components/webchatcontainerstateful/common/mockchatsdk.d.ts +2 -0
  145. package/lib/types/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.d.ts +1 -1
  146. package/lib/types/components/webchatcontainerstateful/interfaces/IBotMagicCodeConfig.d.ts +4 -0
  147. package/lib/types/components/webchatcontainerstateful/interfaces/IWebChatContainerStatefulProps.d.ts +2 -0
  148. package/lib/types/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.d.ts +3 -0
  149. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.d.ts +1 -2
  150. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware.d.ts +1 -1
  151. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.d.ts +2 -0
  152. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.spec.d.ts +1 -0
  153. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.d.ts +5 -0
  154. package/lib/types/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.d.ts +1 -0
  155. package/lib/types/contexts/common/ConversationState.d.ts +4 -2
  156. package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +2 -1
  157. package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +10 -8
  158. package/lib/types/plugins/newMessageEventHandler.d.ts +2 -0
  159. package/package.json +9 -11
  160. package/lib/cjs/assets/audios/newMessageNotification.mp3 +0 -0
  161. package/lib/cjs/assets/icons/archiveIcon.svg +0 -3
  162. package/lib/cjs/assets/icons/audioIcon.svg +0 -6
  163. package/lib/cjs/assets/icons/blankIcon.svg +0 -6
  164. package/lib/cjs/assets/icons/excelIcon.svg +0 -6
  165. package/lib/cjs/assets/icons/imageIcon.svg +0 -6
  166. package/lib/cjs/assets/icons/oneNoteIcon.svg +0 -6
  167. package/lib/cjs/assets/icons/pdfIcon.svg +0 -6
  168. package/lib/cjs/assets/icons/powerpointIcon.svg +0 -6
  169. package/lib/cjs/assets/icons/videoIcon.svg +0 -6
  170. package/lib/cjs/assets/icons/visioIcon.svg +0 -6
  171. package/lib/cjs/assets/icons/wordIcon.svg +0 -6
  172. package/lib/esm/assets/assets.d.js +0 -0
  173. package/lib/esm/assets/audios/newMessageNotification.mp3 +0 -0
  174. package/lib/esm/assets/icons/archiveIcon.svg +0 -3
  175. package/lib/esm/assets/icons/audioIcon.svg +0 -6
  176. package/lib/esm/assets/icons/blankIcon.svg +0 -6
  177. package/lib/esm/assets/icons/excelIcon.svg +0 -6
  178. package/lib/esm/assets/icons/imageIcon.svg +0 -6
  179. package/lib/esm/assets/icons/oneNoteIcon.svg +0 -6
  180. package/lib/esm/assets/icons/pdfIcon.svg +0 -6
  181. package/lib/esm/assets/icons/powerpointIcon.svg +0 -6
  182. package/lib/esm/assets/icons/videoIcon.svg +0 -6
  183. package/lib/esm/assets/icons/visioIcon.svg +0 -6
  184. package/lib/esm/assets/icons/wordIcon.svg +0 -6
@@ -276,5 +276,18 @@ _defineProperty(TelemetryHelper, "logConfigDataEvent", (logLevel, payload) => {
276
276
  }
277
277
  };
278
278
 
279
+ _omnichannelChatComponents.BroadcastService.postMessage(telemetryEvent);
280
+ });
281
+
282
+ _defineProperty(TelemetryHelper, "logWebChatEvent", (logLevel, payload) => {
283
+ const telemetryEvent = {
284
+ eventName: _TelemetryConstants.TelemetryEvent.WebChatEvent,
285
+ logLevel: logLevel,
286
+ payload: { ...payload,
287
+ type: _TelemetryConstants.TelemetryEvent.WebChatEvent,
288
+ scenarioType: _TelemetryConstants.ScenarioType.WEBCHAT
289
+ }
290
+ };
291
+
279
292
  _omnichannelChatComponents.BroadcastService.postMessage(telemetryEvent);
280
293
  });
@@ -13,6 +13,10 @@ var _ariaTelemetryLogger = require("./loggers/ariaTelemetryLogger");
13
13
 
14
14
  var _consoleLogger = require("./loggers/consoleLogger");
15
15
 
16
+ var _defaultAriaConfig = require("./defaultConfigs/defaultAriaConfig");
17
+
18
+ var _TelemetryHelper = require("./TelemetryHelper");
19
+
16
20
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
17
21
 
18
22
  class TelemetryTimers {}
@@ -45,25 +49,25 @@ const RegisterLoggers = () => {
45
49
  const registerLoggers = () => {
46
50
  var _TelemetryManager$Int, _TelemetryManager$Int2, _TelemetryManager$Int3, _TelemetryManager$Int4, _TelemetryManager$Int5, _TelemetryManager$Int6, _TelemetryManager$Int7, _TelemetryManager$Int8;
47
51
 
48
- if (!((_TelemetryManager$Int = TelemetryManager.InternalTelemetryData) !== null && _TelemetryManager$Int !== void 0 && (_TelemetryManager$Int2 = _TelemetryManager$Int.telemetryConfig) !== null && _TelemetryManager$Int2 !== void 0 && _TelemetryManager$Int2.disableConsoleLog) || !((_TelemetryManager$Int3 = TelemetryManager.InternalTelemetryData) !== null && _TelemetryManager$Int3 !== void 0 && (_TelemetryManager$Int4 = _TelemetryManager$Int3.telemetryConfig) !== null && _TelemetryManager$Int4 !== void 0 && _TelemetryManager$Int4.telemetryDisabled)) {
52
+ if (((_TelemetryManager$Int = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int === void 0 ? void 0 : (_TelemetryManager$Int2 = _TelemetryManager$Int.telemetryConfig) === null || _TelemetryManager$Int2 === void 0 ? void 0 : _TelemetryManager$Int2.disableConsoleLog) === false || ((_TelemetryManager$Int3 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int3 === void 0 ? void 0 : (_TelemetryManager$Int4 = _TelemetryManager$Int3.telemetryConfig) === null || _TelemetryManager$Int4 === void 0 ? void 0 : _TelemetryManager$Int4.telemetryDisabled) === false) {
49
53
  _omnichannelChatComponents.BroadcastService.getAnyMessage().subscribe(event => {
50
- if (event.payload && event.eventName !== _TelemetryConstants.TelemetryEvent.ChatWidgetStateChanged) {
54
+ if (event.payload && event.eventName in _TelemetryConstants.TelemetryEvent) {
51
55
  logTelemetry(event);
52
56
  }
53
57
  });
54
58
  }
55
59
 
56
- if (!((_TelemetryManager$Int5 = TelemetryManager.InternalTelemetryData) !== null && _TelemetryManager$Int5 !== void 0 && (_TelemetryManager$Int6 = _TelemetryManager$Int5.telemetryConfig) !== null && _TelemetryManager$Int6 !== void 0 && _TelemetryManager$Int6.disableConsoleLog)) {
60
+ if (((_TelemetryManager$Int5 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int5 === void 0 ? void 0 : (_TelemetryManager$Int6 = _TelemetryManager$Int5.telemetryConfig) === null || _TelemetryManager$Int6 === void 0 ? void 0 : _TelemetryManager$Int6.disableConsoleLog) === false) {
57
61
  loggers.push((0, _consoleLogger.consoleLogger)());
58
62
  }
59
63
 
60
- if (!((_TelemetryManager$Int7 = TelemetryManager.InternalTelemetryData) !== null && _TelemetryManager$Int7 !== void 0 && (_TelemetryManager$Int8 = _TelemetryManager$Int7.telemetryConfig) !== null && _TelemetryManager$Int8 !== void 0 && _TelemetryManager$Int8.telemetryDisabled)) {
64
+ if (((_TelemetryManager$Int7 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int7 === void 0 ? void 0 : (_TelemetryManager$Int8 = _TelemetryManager$Int7.telemetryConfig) === null || _TelemetryManager$Int8 === void 0 ? void 0 : _TelemetryManager$Int8.telemetryDisabled) === false) {
61
65
  var _TelemetryManager$Int9, _TelemetryManager$Int18, _TelemetryManager$Int19;
62
66
 
63
67
  if ((_TelemetryManager$Int9 = TelemetryManager.InternalTelemetryData) !== null && _TelemetryManager$Int9 !== void 0 && _TelemetryManager$Int9.ariaConfig) {
64
68
  var _TelemetryManager$Int10, _TelemetryManager$Int11, _TelemetryManager$Int12, _TelemetryManager$Int13, _TelemetryManager$Int14, _TelemetryManager$Int15, _TelemetryManager$Int16, _TelemetryManager$Int17;
65
69
 
66
- loggers.push((0, _ariaTelemetryLogger.ariaTelemetryLogger)(((_TelemetryManager$Int10 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int10 === void 0 ? void 0 : (_TelemetryManager$Int11 = _TelemetryManager$Int10.ariaConfig) === null || _TelemetryManager$Int11 === void 0 ? void 0 : _TelemetryManager$Int11.ariaTelemetryKey) ?? "", ((_TelemetryManager$Int12 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int12 === void 0 ? void 0 : (_TelemetryManager$Int13 = _TelemetryManager$Int12.ariaConfig) === null || _TelemetryManager$Int13 === void 0 ? void 0 : _TelemetryManager$Int13.disableCookieUsage) ?? false, ((_TelemetryManager$Int14 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int14 === void 0 ? void 0 : (_TelemetryManager$Int15 = _TelemetryManager$Int14.ariaConfig) === null || _TelemetryManager$Int15 === void 0 ? void 0 : _TelemetryManager$Int15.collectorUriForTelemetry) ?? "", ((_TelemetryManager$Int16 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int16 === void 0 ? void 0 : (_TelemetryManager$Int17 = _TelemetryManager$Int16.ariaConfig) === null || _TelemetryManager$Int17 === void 0 ? void 0 : _TelemetryManager$Int17.ariaTelemetryApplicationName) ?? "OmniChannelProd_Web"));
70
+ loggers.push((0, _ariaTelemetryLogger.ariaTelemetryLogger)(((_TelemetryManager$Int10 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int10 === void 0 ? void 0 : (_TelemetryManager$Int11 = _TelemetryManager$Int10.ariaConfig) === null || _TelemetryManager$Int11 === void 0 ? void 0 : _TelemetryManager$Int11.ariaTelemetryKey) ?? _defaultAriaConfig.defaultAriaConfig.ariaTelemetryKey, ((_TelemetryManager$Int12 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int12 === void 0 ? void 0 : (_TelemetryManager$Int13 = _TelemetryManager$Int12.ariaConfig) === null || _TelemetryManager$Int13 === void 0 ? void 0 : _TelemetryManager$Int13.disableCookieUsage) ?? _defaultAriaConfig.defaultAriaConfig.disableCookieUsage, ((_TelemetryManager$Int14 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int14 === void 0 ? void 0 : (_TelemetryManager$Int15 = _TelemetryManager$Int14.ariaConfig) === null || _TelemetryManager$Int15 === void 0 ? void 0 : _TelemetryManager$Int15.collectorUriForTelemetry) ?? _defaultAriaConfig.defaultAriaConfig.collectorUriForTelemetry, ((_TelemetryManager$Int16 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int16 === void 0 ? void 0 : (_TelemetryManager$Int17 = _TelemetryManager$Int16.ariaConfig) === null || _TelemetryManager$Int17 === void 0 ? void 0 : _TelemetryManager$Int17.ariaTelemetryApplicationName) ?? _defaultAriaConfig.defaultAriaConfig.ariaTelemetryApplicationName));
67
71
  }
68
72
 
69
73
  const customLoggers = (_TelemetryManager$Int18 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int18 === void 0 ? void 0 : (_TelemetryManager$Int19 = _TelemetryManager$Int18.telemetryConfig) === null || _TelemetryManager$Int19 === void 0 ? void 0 : _TelemetryManager$Int19.telemetryLoggers;
@@ -86,8 +90,15 @@ const RegisterLoggers = () => {
86
90
 
87
91
  const logTelemetry = telemetryEvent => {
88
92
  loggers.map(logger => {
93
+ var _payload;
94
+
89
95
  const logLevel = telemetryEvent.logLevel ?? _TelemetryConstants.LogLevel.INFO;
90
- logger.log(logLevel, parseInput(telemetryEvent === null || telemetryEvent === void 0 ? void 0 : telemetryEvent.payload));
96
+ const scenarioType = ((_payload = telemetryEvent.payload) === null || _payload === void 0 ? void 0 : _payload.scenarioType) ?? _TelemetryConstants.ScenarioType.UNDEFINED;
97
+ const telemetryInput = parseInput(telemetryEvent === null || telemetryEvent === void 0 ? void 0 : telemetryEvent.payload, scenarioType);
98
+ telemetryInput.telemetryInfo = {
99
+ telemetryInfo: _TelemetryHelper.TelemetryHelper.buildTelemetryEvent(logLevel, telemetryInput)
100
+ };
101
+ logger.log(logLevel, telemetryInput);
91
102
  });
92
103
  };
93
104
 
@@ -7,7 +7,7 @@ exports.defaultAriaConfig = void 0;
7
7
  const defaultAriaConfig = {
8
8
  collectorUriForTelemetry: "",
9
9
  ariaTelemetryKey: "c7655518acf1403f93ff6b9f77942f0a-d01a02fd-6b50-4de3-a566-62eda11f93bc-7083",
10
- ariaTelemetryApplicationName: "",
10
+ ariaTelemetryApplicationName: "D365_Omnichannel_Client_Public_Prod",
11
11
  disableCookieUsage: true
12
12
  };
13
13
  exports.defaultAriaConfig = defaultAriaConfig;
@@ -11,6 +11,9 @@ const defaultTelemetryConfiguration = {
11
11
  telemetryDisabled: false,
12
12
  disableConsoleLog: false,
13
13
  telemetryLoggers: [],
14
- ariaConfigurations: _defaultAriaConfig.defaultAriaConfig
14
+ ariaConfigurations: _defaultAriaConfig.defaultAriaConfig,
15
+ chatWidgetVersion: "0.0.0-0",
16
+ chatComponentVersion: "0.0.0-0",
17
+ OCChatSDKVersion: "0.0.0-0"
15
18
  };
16
19
  exports.defaultTelemetryConfiguration = defaultTelemetryConfiguration;
@@ -15,7 +15,7 @@ var _Enums = require("@microsoft/omnichannel-chat-sdk/lib/external/aria/common/E
15
15
 
16
16
  var _Constants = require("../../Constants");
17
17
 
18
- var _TelemetryHelper = require("../TelemetryHelper");
18
+ var _TelemetryManager = require("../TelemetryManager");
19
19
 
20
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
21
 
@@ -30,6 +30,21 @@ const ariaTelemetryLogger = (ariaTelemetryKey, disabledCookieUsage, collectiorUr
30
30
 
31
31
  if (!(0, _utils.isNullOrEmptyString)(collectiorUriForTelemetry)) {
32
32
  configuration.collectorUri = collectiorUriForTelemetry;
33
+ } else {
34
+ if (_TelemetryManager.TelemetryManager.InternalTelemetryData.environmentVersion == _Constants.EnvironmentVersion.prod) {
35
+ var _TelemetryManager$Int;
36
+
37
+ const orgUrl = (_TelemetryManager$Int = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int === void 0 ? void 0 : _TelemetryManager$Int.orgUrl;
38
+
39
+ if (!(0, _utils.isNullOrUndefined)(orgUrl)) {
40
+ // If the given org is a Production EU org, modify the Aria collector uri
41
+ const region = (0, _utils.getDomain)(orgUrl);
42
+
43
+ if (region === _Constants.AriaTelemetryConstants.EU) {
44
+ configuration.collectorUri = _Constants.AriaTelemetryConstants.EUROPE_ENDPOINT;
45
+ }
46
+ }
47
+ }
33
48
  }
34
49
 
35
50
  try {
@@ -48,20 +63,25 @@ const ariaTelemetryLogger = (ariaTelemetryKey, disabledCookieUsage, collectiorUr
48
63
 
49
64
  const ariaLogger = {
50
65
  log: (logLevel, telemetryInput) => {
51
- let property;
52
- const eventProperties = new _AWTEventProperties.default();
53
-
54
- const event = _TelemetryHelper.TelemetryHelper.buildTelemetryEvent(logLevel, telemetryInput);
55
-
56
- eventProperties.setName(telemetryInput.scenarioType);
66
+ try {
67
+ let property;
68
+ const telemetryInfo = telemetryInput === null || telemetryInput === void 0 ? void 0 : telemetryInput.telemetryInfo;
69
+ const eventProperties = new _AWTEventProperties.default();
70
+ eventProperties.setName(telemetryInput.scenarioType);
71
+
72
+ if (telemetryInfo) {
73
+ for (const key of Object.keys(telemetryInfo)) {
74
+ property = typeof telemetryInfo[key] === "object" ? JSON.stringify(telemetryInfo[key]) : telemetryInfo[key];
75
+ eventProperties.setProperty(key, property);
76
+ }
77
+
78
+ eventProperties.setPropertyWithPii(ariaTelemetryApplicationName, _Constants.Constants.LiveChatWidget, _Enums.AWTPiiKind.GenericData);
79
+ }
57
80
 
58
- for (const key of Object.keys(event)) {
59
- property = typeof event[key] === "object" ? JSON.stringify(event[key]) : event[key];
60
- eventProperties.setProperty(key, property);
81
+ logger() ? logger().logEvent(eventProperties) : console.log("Unable to initialize aria logger");
82
+ } catch (error) {
83
+ console.error("Error in logging telemetry to Aria logger:" + error);
61
84
  }
62
-
63
- eventProperties.setPropertyWithPii(ariaTelemetryApplicationName, _Constants.Constants.LiveChatWidget, _Enums.AWTPiiKind.GenericData);
64
- logger() ? logger().logEvent(eventProperties) : console.log("Unable to initialize aria logger");
65
85
  },
66
86
  dispose: () => {
67
87
  _AWTLogManager.default.flush(function () {
@@ -13,27 +13,28 @@ const consoleLogger = () => {
13
13
  const consoleLogger = {
14
14
  log: (logLevel, telemetryInput) => {
15
15
  const payload = telemetryInput !== null && telemetryInput !== void 0 && telemetryInput.payload && Object.keys(telemetryInput === null || telemetryInput === void 0 ? void 0 : telemetryInput.payload).length > 0 ? telemetryInput === null || telemetryInput === void 0 ? void 0 : telemetryInput.payload : "";
16
+ const telemetryInfo = telemetryInput !== null && telemetryInput !== void 0 && telemetryInput.telemetryInfo && Object.keys(telemetryInput === null || telemetryInput === void 0 ? void 0 : telemetryInput.telemetryInfo).length > 0 ? telemetryInput === null || telemetryInput === void 0 ? void 0 : telemetryInput.telemetryInfo : "";
16
17
 
17
18
  try {
18
19
  switch (logLevel) {
19
20
  case _TelemetryConstants.LogLevel.INFO:
20
- console.info(_Constants.Constants.LiveChatWidget, payload);
21
+ console.info(_Constants.Constants.LiveChatWidget, payload, telemetryInfo);
21
22
  break;
22
23
 
23
24
  case _TelemetryConstants.LogLevel.DEBUG:
24
- console.debug(_Constants.Constants.LiveChatWidget, payload);
25
+ console.debug(_Constants.Constants.LiveChatWidget, payload, telemetryInfo);
25
26
  break;
26
27
 
27
28
  case _TelemetryConstants.LogLevel.WARN:
28
- console.warn(_Constants.Constants.LiveChatWidget, payload);
29
+ console.warn(_Constants.Constants.LiveChatWidget, payload, telemetryInfo);
29
30
  break;
30
31
 
31
32
  case _TelemetryConstants.LogLevel.ERROR:
32
- console.error(_Constants.Constants.LiveChatWidget, payload);
33
+ console.error(_Constants.Constants.LiveChatWidget, payload, telemetryInfo);
33
34
  break;
34
35
 
35
36
  default:
36
- console.debug(_Constants.Constants.LiveChatWidget, payload);
37
+ console.debug(_Constants.Constants.LiveChatWidget, payload, telemetryInfo);
37
38
  break;
38
39
  }
39
40
  } catch (ex) {
@@ -3,12 +3,16 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.setTabIndices = exports.setFocusOnSendBox = exports.setFocusOnElement = exports.preventFocusToMoveOutOfElement = exports.parseAdaptiveCardPayload = exports.newGuid = exports.isNullOrUndefined = exports.isNullOrEmptyString = exports.getTimestampHourMinute = exports.getLocaleDirection = exports.getIconText = exports.findParentFocusableElementsWithoutChildContainer = exports.findAllFocusableElement = exports.extractPreChatSurveyResponseValues = exports.escapeHtml = exports.createTimer = exports.changeLanguageCodeFormatForWebChat = void 0;
6
+ exports.setTabIndices = exports.setFocusOnSendBox = exports.setFocusOnElement = exports.preventFocusToMoveOutOfElement = exports.parseAdaptiveCardPayload = exports.newGuid = exports.isUndefinedOrEmpty = exports.isNullOrUndefined = exports.isNullOrEmptyString = exports.getWidgetEndChatEventName = exports.getWidgetCacheId = exports.getTimestampHourMinute = exports.getStateFromCache = exports.getLocaleDirection = exports.getIconText = exports.getDomain = exports.findParentFocusableElementsWithoutChildContainer = exports.findAllFocusableElement = exports.extractPreChatSurveyResponseValues = exports.escapeHtml = exports.createTimer = exports.changeLanguageCodeFormatForWebChat = exports.addDelayInMs = void 0;
7
7
 
8
8
  var _Constants = require("./Constants");
9
9
 
10
+ var _DataStoreManager = require("./contextDataStore/DataStoreManager");
11
+
10
12
  var _KeyCodes = require("./KeyCodes");
11
13
 
14
+ var _TelemetryConstants = require("./telemetry/TelemetryConstants");
15
+
12
16
  const getElementBySelector = selector => {
13
17
  let element;
14
18
 
@@ -332,6 +336,76 @@ const createTimer = () => {
332
336
  }
333
337
 
334
338
  };
339
+ }; // Returns the domain of the org
340
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
341
+
342
+
343
+ exports.createTimer = createTimer;
344
+
345
+ const getDomain = hostValue => {
346
+ for (let i = 0; i < _Constants.AriaTelemetryConstants.lcwEUDomainNames.length; i++) {
347
+ if (hostValue.endsWith(_Constants.AriaTelemetryConstants.lcwEUDomainNames[i])) {
348
+ return _Constants.AriaTelemetryConstants.EU;
349
+ }
350
+ }
351
+
352
+ return _Constants.AriaTelemetryConstants.Public;
353
+ };
354
+
355
+ exports.getDomain = getDomain;
356
+
357
+ const getWidgetCacheId = (orgId, widgetId) => {
358
+ return `${_Constants.Constants.ChatWidgetStateChangedPrefix}_${orgId}_${widgetId}`;
359
+ };
360
+
361
+ exports.getWidgetCacheId = getWidgetCacheId;
362
+
363
+ const getWidgetEndChatEventName = (orgId, widgetId) => {
364
+ return `${_TelemetryConstants.BroadcastEvent.ChatEnded}_${orgId}_${widgetId}`;
365
+ }; // eslint-disable-next-line @typescript-eslint/no-explicit-any
366
+
367
+
368
+ exports.getWidgetEndChatEventName = getWidgetEndChatEventName;
369
+
370
+ const getStateFromCache = (orgId, widgetId) => {
371
+ // Getting updated state from cache
372
+ try {
373
+ if (_DataStoreManager.DataStoreManager.clientDataStore) {
374
+ var _DataStoreManager$cli;
375
+
376
+ const widgetStateEventName = getWidgetCacheId(orgId, widgetId);
377
+ const widgetStateFromCache = (_DataStoreManager$cli = _DataStoreManager.DataStoreManager.clientDataStore) === null || _DataStoreManager$cli === void 0 ? void 0 : _DataStoreManager$cli.getData(widgetStateEventName, "localStorage");
378
+ const persistedState = widgetStateFromCache ? JSON.parse(widgetStateFromCache) : undefined;
379
+ return persistedState;
380
+ } else {
381
+ return null;
382
+ }
383
+ } catch (error) {
384
+ console.log(error);
385
+ return null;
386
+ }
387
+ }; // eslint-disable-next-line @typescript-eslint/no-explicit-any
388
+
389
+
390
+ exports.getStateFromCache = getStateFromCache;
391
+
392
+ const isUndefinedOrEmpty = object => {
393
+ if (object) {
394
+ if (Object.keys(object).length === 0) {
395
+ return true;
396
+ }
397
+
398
+ return false;
399
+ } else {
400
+ return true;
401
+ }
402
+ }; // eslint-disable-next-line @typescript-eslint/no-explicit-any
403
+
404
+
405
+ exports.isUndefinedOrEmpty = isUndefinedOrEmpty;
406
+
407
+ const addDelayInMs = ms => {
408
+ return new Promise(resolve => setTimeout(resolve, ms));
335
409
  };
336
410
 
337
- exports.createTimer = createTimer;
411
+ exports.addDelayInMs = addDelayInMs;
@@ -206,6 +206,20 @@ const CallingContainerStateful = props => {
206
206
  });
207
207
  }
208
208
  });
209
+ window.addEventListener("beforeunload", () => {
210
+ if (state.uiStates.isIncomingCall) {
211
+ voiceVideoCallingSdk === null || voiceVideoCallingSdk === void 0 ? void 0 : voiceVideoCallingSdk.rejectCall();
212
+ } else {
213
+ voiceVideoCallingSdk === null || voiceVideoCallingSdk === void 0 ? void 0 : voiceVideoCallingSdk.stopCall();
214
+ }
215
+
216
+ voiceVideoCallingSdk === null || voiceVideoCallingSdk === void 0 ? void 0 : voiceVideoCallingSdk.close();
217
+ dispatch({
218
+ type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_E2VV_ENABLED,
219
+ payload: false
220
+ });
221
+ resetCallingStates(true);
222
+ });
209
223
  }, []);
210
224
  const controlProps = {
211
225
  id: "oc-lcw-callingcontainer",
@@ -34,7 +34,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
34
34
  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; }
35
35
 
36
36
  const ChatButtonStateful = props => {
37
- var _state$domainStates$l, _state$domainStates$l2, _buttonProps$controlP;
37
+ var _state$domainStates$l, _state$domainStates$l2, _buttonProps$controlP, _props$buttonProps, _props$buttonProps$co, _props$buttonProps2, _props$buttonProps2$c, _props$buttonProps3, _props$buttonProps3$c;
38
38
 
39
39
  const [state, dispatch] = (0, _useChatContextStore.default)();
40
40
  const {
@@ -44,20 +44,27 @@ const ChatButtonStateful = props => {
44
44
  } = props; //Setting OutOfOperatingHours Flag
45
45
 
46
46
  const [outOfOperatingHours, setOutOfOperatingHours] = (0, _react.useState)(((_state$domainStates$l = state.domainStates.liveChatConfig) === null || _state$domainStates$l === void 0 ? void 0 : (_state$domainStates$l2 = _state$domainStates$l.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l2 === void 0 ? void 0 : _state$domainStates$l2.OutOfOperatingHours) === "True");
47
+ const proactiveChatInNewWindow = (0, _react.useRef)(state.appStates.proactiveChatStates.proactiveChatInNewWindow);
47
48
  const outOfOfficeStyleProps = Object.assign({}, _defaultOutOfOfficeChatButtonStyleProps.defaultOutOfOfficeChatButtonStyleProps, outOfOfficeButtonProps === null || outOfOfficeButtonProps === void 0 ? void 0 : outOfOfficeButtonProps.styleProps);
48
49
  const controlProps = {
49
50
  id: "oc-lcw-chat-button",
50
51
  dir: state.domainStates.globalDir,
51
52
  titleText: "Let's Chat!",
52
53
  subtitleText: "We're online.",
53
- hideNotificationBubble: !(state.appStates.isMinimized === true && state.appStates.unreadMessageCount > 0) || (buttonProps === null || buttonProps === void 0 ? void 0 : (_buttonProps$controlP = buttonProps.controlProps) === null || _buttonProps$controlP === void 0 ? void 0 : _buttonProps$controlP.hideNotificationBubble) === true,
54
- unreadMessageCount: state.appStates.unreadMessageCount ? state.appStates.unreadMessageCount > _Constants.Constants.maximumUnreadMessageCount ? _Constants.Constants.maximumUnreadMessageCount.toString() + "+" : state.appStates.unreadMessageCount.toString() : "0",
54
+ hideNotificationBubble: (buttonProps === null || buttonProps === void 0 ? void 0 : (_buttonProps$controlP = buttonProps.controlProps) === null || _buttonProps$controlP === void 0 ? void 0 : _buttonProps$controlP.hideNotificationBubble) === true || state.appStates.isMinimized === false,
55
+ unreadMessageCount: state.appStates.unreadMessageCount ? state.appStates.unreadMessageCount > _Constants.Constants.maximumUnreadMessageCount ? (_props$buttonProps = props.buttonProps) === null || _props$buttonProps === void 0 ? void 0 : (_props$buttonProps$co = _props$buttonProps.controlProps) === null || _props$buttonProps$co === void 0 ? void 0 : _props$buttonProps$co.largeUnreadMessageString : state.appStates.unreadMessageCount.toString() : "0",
55
56
  onClick: async () => {
56
57
  _TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
57
58
  Event: _TelemetryConstants.TelemetryEvent.LCWChatButtonClicked
58
59
  });
59
60
 
60
- if (state.appStates.isMinimized) {
61
+ if (proactiveChatInNewWindow.current) {
62
+ const proactiveChatIsInPopoutModeEvent = {
63
+ eventName: _TelemetryConstants.BroadcastEvent.ProactiveChatIsInPopoutMode
64
+ };
65
+
66
+ _omnichannelChatComponents.BroadcastService.postMessage(proactiveChatIsInPopoutModeEvent);
67
+ } else if (state.appStates.isMinimized) {
61
68
  dispatch({
62
69
  type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_MINIMIZED,
63
70
  payload: false
@@ -66,6 +73,7 @@ const ChatButtonStateful = props => {
66
73
  await startChat();
67
74
  }
68
75
  },
76
+ unreadMessageString: (_props$buttonProps2 = props.buttonProps) === null || _props$buttonProps2 === void 0 ? void 0 : (_props$buttonProps2$c = _props$buttonProps2.controlProps) === null || _props$buttonProps2$c === void 0 ? void 0 : _props$buttonProps2$c.unreadMessageString,
69
77
  ...(buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.controlProps)
70
78
  };
71
79
  const outOfOfficeControlProps = {
@@ -74,6 +82,10 @@ const ChatButtonStateful = props => {
74
82
  titleText: "We're Offline",
75
83
  subtitleText: "No agents available",
76
84
  onClick: async () => {
85
+ _TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
86
+ Event: _TelemetryConstants.TelemetryEvent.LCWChatButtonClicked
87
+ });
88
+
77
89
  if (state.appStates.isMinimized) {
78
90
  dispatch({
79
91
  type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_MINIMIZED,
@@ -86,6 +98,7 @@ const ChatButtonStateful = props => {
86
98
  });
87
99
  }
88
100
  },
101
+ unreadMessageString: (_props$buttonProps3 = props.buttonProps) === null || _props$buttonProps3 === void 0 ? void 0 : (_props$buttonProps3$c = _props$buttonProps3.controlProps) === null || _props$buttonProps3$c === void 0 ? void 0 : _props$buttonProps3$c.unreadMessageString,
89
102
  ...(outOfOfficeButtonProps === null || outOfOfficeButtonProps === void 0 ? void 0 : outOfOfficeButtonProps.controlProps)
90
103
  };
91
104
  (0, _react.useEffect)(() => {
@@ -107,6 +120,9 @@ const ChatButtonStateful = props => {
107
120
  });
108
121
  }
109
122
  }, []);
123
+ (0, _react.useEffect)(() => {
124
+ proactiveChatInNewWindow.current = state.appStates.proactiveChatStates.proactiveChatInNewWindow;
125
+ }, [state.appStates.proactiveChatStates.proactiveChatInNewWindow]);
110
126
  return /*#__PURE__*/_react.default.createElement(_omnichannelChatComponents.ChatButton, {
111
127
  componentOverrides: buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.componentOverrides,
112
128
  controlProps: outOfOperatingHours ? outOfOfficeControlProps : controlProps,
@@ -7,12 +7,12 @@ exports.default = exports.ConfirmationPaneStateful = void 0;
7
7
 
8
8
  var _TelemetryConstants = require("../../common/telemetry/TelemetryConstants");
9
9
 
10
+ var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
11
+
10
12
  var _react = _interopRequireWildcard(require("react"));
11
13
 
12
14
  var _utils = require("../../common/utils");
13
15
 
14
- var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
15
-
16
16
  var _DimLayer = require("../dimlayer/DimLayer");
17
17
 
18
18
  var _LiveChatWidgetActionType = require("../../contexts/common/LiveChatWidgetActionType");
@@ -21,18 +21,12 @@ var _NotificationHandler = require("../webchatcontainerstateful/webchatcontrolle
21
21
 
22
22
  var _NotificationScenarios = require("../webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios");
23
23
 
24
- var _PostChatSurveyMode = require("../postchatsurveypanestateful/enums/PostChatSurveyMode");
25
-
26
24
  var _TelemetryHelper = require("../../common/telemetry/TelemetryHelper");
27
25
 
28
26
  var _useChatAdapterStore = _interopRequireDefault(require("../../hooks/useChatAdapterStore"));
29
27
 
30
28
  var _useChatContextStore = _interopRequireDefault(require("../../hooks/useChatContextStore"));
31
29
 
32
- var _useChatSDKStore = _interopRequireDefault(require("../../hooks/useChatSDKStore"));
33
-
34
- var _Constants = require("../../common/Constants");
35
-
36
30
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
37
31
 
38
32
  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); }
@@ -41,26 +35,19 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
41
35
 
42
36
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
43
37
  const ConfirmationPaneStateful = props => {
44
- var _state$domainStates$l, _state$domainStates$l2, _state$domainStates$l3, _state$domainStates$l4;
45
-
46
38
  const initialTabIndexMap = new Map();
47
- let elements = []; // eslint-disable-next-line @typescript-eslint/no-explicit-any
48
-
49
- const chatSDK = (0, _useChatSDKStore.default)();
39
+ let elements = [];
50
40
  const [state, dispatch] = (0, _useChatContextStore.default)();
51
41
  const {
52
- endChat
42
+ prepareEndChat
53
43
  } = props; // eslint-disable-next-line @typescript-eslint/no-explicit-any
54
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
55
44
 
56
45
  const [adapter] = (0, _useChatAdapterStore.default)();
57
- const isPostChatEnabled = (_state$domainStates$l = state.domainStates.liveChatConfig) === null || _state$domainStates$l === void 0 ? void 0 : (_state$domainStates$l2 = _state$domainStates$l.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l2 === void 0 ? void 0 : _state$domainStates$l2.msdyn_postconversationsurveyenable;
58
- const postChatSurveyMode = (_state$domainStates$l3 = state.domainStates.liveChatConfig) === null || _state$domainStates$l3 === void 0 ? void 0 : (_state$domainStates$l4 = _state$domainStates$l3.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l4 === void 0 ? void 0 : _state$domainStates$l4.msdyn_postconversationsurveymode;
59
46
  const controlProps = {
60
47
  id: "oc-lcw-confirmation-pane",
61
48
  dir: state.domainStates.globalDir,
62
49
  onConfirm: async () => {
63
- _TelemetryHelper.TelemetryHelper.logConfigDataEvent(_TelemetryConstants.LogLevel.INFO, {
50
+ _TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
64
51
  Event: _TelemetryConstants.TelemetryEvent.ConfirmationConfirmButtonClicked,
65
52
  Description: "Confirmation pane Confirm button clicked"
66
53
  });
@@ -71,29 +58,8 @@ const ConfirmationPaneStateful = props => {
71
58
  });
72
59
 
73
60
  try {
74
- // check agent has joined conversation
75
- const conversationDetails = await chatSDK.getConversationDetails();
76
-
77
- if (isPostChatEnabled === "true" && postChatSurveyMode === _PostChatSurveyMode.PostChatSurveyMode.Embed && conversationDetails.canRenderPostChat === _Constants.Constants.truePascal) {
78
- const loadPostChatEvent = {
79
- eventName: "LoadPostChatSurvey"
80
- };
81
-
82
- _omnichannelChatComponents.BroadcastService.postMessage(loadPostChatEvent);
83
- } else {
84
- (0, _utils.setTabIndices)(elements, initialTabIndexMap, true);
85
-
86
- try {
87
- await endChat(adapter);
88
- } catch (error) {
89
- _TelemetryHelper.TelemetryHelper.logSDKEvent(_TelemetryConstants.LogLevel.ERROR, {
90
- Event: _TelemetryConstants.TelemetryEvent.CloseChatMethodException,
91
- ExceptionDetails: {
92
- exception: `Failed to endChat: ${error}`
93
- }
94
- });
95
- }
96
- }
61
+ (0, _utils.setTabIndices)(elements, initialTabIndexMap, true);
62
+ await prepareEndChat(adapter, state);
97
63
  } catch (ex) {
98
64
  _TelemetryHelper.TelemetryHelper.logSDKEvent(_TelemetryConstants.LogLevel.ERROR, {
99
65
  Event: _TelemetryConstants.TelemetryEvent.GetConversationDetailsCallFailed,
@@ -106,7 +72,7 @@ const ConfirmationPaneStateful = props => {
106
72
  }
107
73
  },
108
74
  onCancel: () => {
109
- _TelemetryHelper.TelemetryHelper.logConfigDataEvent(_TelemetryConstants.LogLevel.INFO, {
75
+ _TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
110
76
  Event: _TelemetryConstants.TelemetryEvent.ConfirmationCancelButtonClicked,
111
77
  Description: "Confirmation pane Cancel button clicked."
112
78
  });
@@ -95,8 +95,8 @@ const EmailTranscriptPaneStateful = props => {
95
95
  },
96
96
  onCancel: () => {
97
97
  _TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
98
- Event: _TelemetryConstants.TelemetryEvent.EmailTranscriptButtonClicked,
99
- Description: "Email Transcript button clicked."
98
+ Event: _TelemetryConstants.TelemetryEvent.EmailTranscriptCancelButtonClicked,
99
+ Description: "Email Transcript cancel button clicked."
100
100
  });
101
101
 
102
102
  closeEmailTranscriptPane();
@@ -17,6 +17,8 @@ var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components
17
17
 
18
18
  var _LiveChatWidgetActionType = require("../../contexts/common/LiveChatWidgetActionType");
19
19
 
20
+ var _Audios = require("../../assets/Audios");
21
+
20
22
  var _NotificationHandler = require("../webchatcontainerstateful/webchatcontroller/notification/NotificationHandler");
21
23
 
22
24
  var _NotificationScenarios = require("../webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios");
@@ -29,8 +31,6 @@ var _useChatContextStore = _interopRequireDefault(require("../../hooks/useChatCo
29
31
 
30
32
  var _useChatSDKStore = _interopRequireDefault(require("../../hooks/useChatSDKStore"));
31
33
 
32
- var _newMessageNotification = _interopRequireDefault(require("../../assets/audios/newMessageNotification.mp3"));
33
-
34
34
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
35
35
 
36
36
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -122,9 +122,8 @@ const FooterStateful = props => {
122
122
  controlProps: controlProps,
123
123
  styleProps: footerProps === null || footerProps === void 0 ? void 0 : footerProps.styleProps
124
124
  }), /*#__PURE__*/_react.default.createElement(_AudioNotificationStateful.default, {
125
- audioSrc: (audioNotificationProps === null || audioNotificationProps === void 0 ? void 0 : audioNotificationProps.audioSrc) ?? _newMessageNotification.default,
126
- hideAudioNotificationButton: (footerProps === null || footerProps === void 0 ? void 0 : (_footerProps$controlP4 = footerProps.controlProps) === null || _footerProps$controlP4 === void 0 ? void 0 : _footerProps$controlP4.hideAudioNotificationButton) ?? false,
127
- isAudioMuted: state.appStates.isAudioMuted ?? false
125
+ audioSrc: (audioNotificationProps === null || audioNotificationProps === void 0 ? void 0 : audioNotificationProps.audioSrc) ?? _Audios.NewMessageNotificationSoundBase64,
126
+ isAudioMuted: state.appStates.isAudioMuted === null ? (footerProps === null || footerProps === void 0 ? void 0 : (_footerProps$controlP4 = footerProps.controlProps) === null || _footerProps$controlP4 === void 0 ? void 0 : _footerProps$controlP4.hideAudioNotificationButton) ?? false : state.appStates.isAudioMuted ?? false
128
127
  }));
129
128
  };
130
129
 
@@ -116,8 +116,17 @@ const beautifyChatTranscripts = (chatTranscripts, renderMarkDown, attachmentMess
116
116
  let fileAttachmentName = _Constants.TranscriptConstants.DefaultFileAttachmentName;
117
117
  let dialogColor = _Constants.TranscriptConstants.CustomerDialogColor;
118
118
  let fontColor = _Constants.TranscriptConstants.CustomerFontColor;
119
+ const isSystemMessage = value.tags && value.tags.toLowerCase().indexOf(_Constants.Constants.systemMessageTag) !== -1;
120
+ const isControlMessage = value.isControlMessage && value.isControlMessage === true;
119
121
 
120
- if (value.tags && value.tags.toLowerCase().indexOf(_Constants.Constants.systemMessageTag) !== -1 || value.isControlMessage && value.isControlMessage === true || value.contentType && value.contentType.toLowerCase() === _Constants.TranscriptConstants.AdaptiveCardType || value.deliveryMode && value.deliveryMode.toLowerCase() === _Constants.TranscriptConstants.InternalMode) {
122
+ const isAdaptiveCard = value.contentType && value.contentType.toLowerCase() === _Constants.TranscriptConstants.AdaptiveCardType;
123
+
124
+ const isInternalMessage = value.deliveryMode && value.deliveryMode.toLowerCase() === _Constants.TranscriptConstants.InternalMode;
125
+
126
+ const isHiddenMessage = value.tags && value.tags.toLowerCase().indexOf(_Constants.Constants.hiddenTag.toLowerCase()) !== -1;
127
+ const shouldIgnoreMessage = isSystemMessage || isControlMessage || isAdaptiveCard || isInternalMessage || isHiddenMessage;
128
+
129
+ if (shouldIgnoreMessage) {
121
130
  return;
122
131
  } else if (value.from) {
123
132
  if (value.from.application) {
@@ -138,7 +147,7 @@ const beautifyChatTranscripts = (chatTranscripts, renderMarkDown, attachmentMess
138
147
 
139
148
  if (value.attachments && value.attachments.length > 0 && value.attachments[0].name) {
140
149
  fileAttachmentName = value.attachments[0].name;
141
- value.content = attachmentMessage ?? "The following attachment was uploaded during the conversation:" + fileAttachmentName;
150
+ value.content = attachmentMessage ? attachmentMessage + " " + fileAttachmentName : "The following attachment was uploaded during the conversation: " + fileAttachmentName;
142
151
  }
143
152
  }
144
153