@microsoft/omnichannel-chat-widget 1.7.8-main.ab4d3b4 → 1.7.8-main.cf04c1c

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 (388) hide show
  1. package/lib/cjs/common/Constants.js +67 -20
  2. package/lib/cjs/common/KeyCodes.js +6 -1
  3. package/lib/cjs/common/contextDataStore/DataStoreManager.js +6 -1
  4. package/lib/cjs/common/facades/FacadeChatSDK.js +392 -295
  5. package/lib/cjs/common/storage/default/defaultCacheManager.js +6 -3
  6. package/lib/cjs/common/telemetry/AppInsightsEvents.js +31 -0
  7. package/lib/cjs/common/telemetry/ScenarioMarker.js +66 -0
  8. package/lib/cjs/common/telemetry/TelemetryConstants.js +153 -131
  9. package/lib/cjs/common/telemetry/TelemetryHelper.js +281 -250
  10. package/lib/cjs/common/telemetry/TelemetryManager.js +32 -12
  11. package/lib/cjs/common/telemetry/defaultConfigs/defaultAppInsightsConfig.js +11 -0
  12. package/lib/cjs/common/telemetry/interfaces/IAppInsightsConfig.js +1 -0
  13. package/lib/cjs/common/telemetry/loggers/appInsightsLogger.js +149 -0
  14. package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +13 -9
  15. package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +3 -2
  16. package/lib/cjs/components/footerstateful/FooterStateful.js +11 -6
  17. package/lib/cjs/components/headerstateful/HeaderStateful.js +18 -6
  18. package/lib/cjs/components/livechatwidget/common/ActivityStreamHandler.js +32 -19
  19. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +70 -58
  20. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +17 -8
  21. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/HiddenAdaptiveCardActivitySubscriber.js +65 -52
  22. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +31 -18
  23. package/lib/cjs/components/livechatwidget/common/ChatAdapterShim.js +14 -6
  24. package/lib/cjs/components/livechatwidget/common/Deferred.js +14 -6
  25. package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +0 -5
  26. package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +3 -1
  27. package/lib/cjs/components/livechatwidget/common/renderSurveyHelpers.js +6 -3
  28. package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +7 -2
  29. package/lib/cjs/components/livechatwidget/common/startChat.js +43 -40
  30. package/lib/cjs/components/livechatwidget/common/startChatErrorHandler.js +5 -4
  31. package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +25 -20
  32. package/lib/cjs/components/ooohpanestateful/OOOHPaneStateful.js +6 -4
  33. package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +9 -4
  34. package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +9 -6
  35. package/lib/cjs/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +8 -6
  36. package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +7 -1
  37. package/lib/cjs/components/webchatcontainerstateful/common/DemoChatAdapter.js +88 -65
  38. package/lib/cjs/components/webchatcontainerstateful/common/DemoChatSDK.js +26 -7
  39. package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatAdapter.js +49 -26
  40. package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatSDK.js +57 -35
  41. package/lib/cjs/components/webchatcontainerstateful/common/mockadapter.js +62 -52
  42. package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +95 -61
  43. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +6 -1
  44. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +6 -1
  45. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/markdownrenderers/HyperlinkTextOverrideRenderer.js +53 -39
  46. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +88 -60
  47. package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +5 -6
  48. package/lib/cjs/controller/componentController.js +3 -2
  49. package/lib/cjs/firstresponselatency/FirstResponseLatencyTracker.js +138 -116
  50. package/lib/cjs/plugins/createChatTranscript.js +88 -58
  51. package/lib/cjs/plugins/newMessageEventHandler.js +4 -4
  52. package/lib/esm/common/Constants.js +65 -19
  53. package/lib/esm/common/KeyCodes.js +6 -1
  54. package/lib/esm/common/contextDataStore/DataStoreManager.js +6 -1
  55. package/lib/esm/common/facades/FacadeChatSDK.js +392 -295
  56. package/lib/esm/common/storage/default/defaultCacheManager.js +6 -1
  57. package/lib/esm/common/telemetry/AppInsightsEvents.js +24 -0
  58. package/lib/esm/common/telemetry/ScenarioMarker.js +59 -0
  59. package/lib/esm/common/telemetry/TelemetryConstants.js +153 -131
  60. package/lib/esm/common/telemetry/TelemetryHelper.js +281 -250
  61. package/lib/esm/common/telemetry/TelemetryManager.js +32 -12
  62. package/lib/esm/common/telemetry/defaultConfigs/defaultAppInsightsConfig.js +4 -0
  63. package/lib/esm/common/telemetry/interfaces/IAppInsightsConfig.js +1 -0
  64. package/lib/esm/common/telemetry/loggers/appInsightsLogger.js +139 -0
  65. package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +13 -9
  66. package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +3 -2
  67. package/lib/esm/components/footerstateful/FooterStateful.js +11 -6
  68. package/lib/esm/components/headerstateful/HeaderStateful.js +18 -6
  69. package/lib/esm/components/livechatwidget/common/ActivityStreamHandler.js +32 -19
  70. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +70 -58
  71. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +17 -8
  72. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/HiddenAdaptiveCardActivitySubscriber.js +65 -52
  73. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +31 -18
  74. package/lib/esm/components/livechatwidget/common/ChatAdapterShim.js +14 -6
  75. package/lib/esm/components/livechatwidget/common/Deferred.js +14 -6
  76. package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +1 -6
  77. package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +3 -1
  78. package/lib/esm/components/livechatwidget/common/renderSurveyHelpers.js +6 -3
  79. package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +7 -2
  80. package/lib/esm/components/livechatwidget/common/startChat.js +44 -41
  81. package/lib/esm/components/livechatwidget/common/startChatErrorHandler.js +5 -4
  82. package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +25 -20
  83. package/lib/esm/components/ooohpanestateful/OOOHPaneStateful.js +6 -4
  84. package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +9 -4
  85. package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +9 -6
  86. package/lib/esm/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +8 -6
  87. package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +7 -1
  88. package/lib/esm/components/webchatcontainerstateful/common/DemoChatAdapter.js +88 -65
  89. package/lib/esm/components/webchatcontainerstateful/common/DemoChatSDK.js +26 -7
  90. package/lib/esm/components/webchatcontainerstateful/common/DesignerChatAdapter.js +49 -26
  91. package/lib/esm/components/webchatcontainerstateful/common/DesignerChatSDK.js +57 -35
  92. package/lib/esm/components/webchatcontainerstateful/common/mockadapter.js +63 -52
  93. package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +95 -61
  94. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +6 -1
  95. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +6 -1
  96. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/markdownrenderers/HyperlinkTextOverrideRenderer.js +53 -39
  97. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +88 -60
  98. package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +5 -6
  99. package/lib/esm/controller/componentController.js +3 -2
  100. package/lib/esm/firstresponselatency/FirstResponseLatencyTracker.js +138 -116
  101. package/lib/esm/plugins/createChatTranscript.js +88 -58
  102. package/lib/esm/plugins/newMessageEventHandler.js +4 -4
  103. package/lib/types/assets/Audios.d.ts +1 -1
  104. package/lib/types/assets/Icons.d.ts +16 -16
  105. package/lib/types/common/Constants.d.ts +283 -277
  106. package/lib/types/common/KeyCodes.d.ts +5 -5
  107. package/lib/types/common/contextDataStore/DataStoreManager.d.ts +4 -4
  108. package/lib/types/common/facades/FacadeChatSDK.d.ts +75 -74
  109. package/lib/types/common/facades/types/IFacadeChatSDKInput.d.ts +13 -13
  110. package/lib/types/common/interfaces/IContextDataStore.d.ts +14 -14
  111. package/lib/types/common/interfaces/ITimer.d.ts +3 -3
  112. package/lib/types/common/storage/default/defaultCacheManager.d.ts +5 -5
  113. package/lib/types/common/storage/default/defaultClientDataStoreProvider.d.ts +4 -4
  114. package/lib/types/common/storage/default/defaultInMemoryDataStore.d.ts +6 -6
  115. package/lib/types/common/telemetry/AppInsightsEvents.d.ts +1 -0
  116. package/lib/types/common/telemetry/ScenarioMarker.d.ts +19 -0
  117. package/lib/types/common/telemetry/TelemetryConstants.d.ts +272 -264
  118. package/lib/types/common/telemetry/TelemetryHelper.d.ts +48 -43
  119. package/lib/types/common/telemetry/TelemetryManager.d.ts +12 -12
  120. package/lib/types/common/telemetry/defaultConfigs/defaultAppInsightsConfig.d.ts +2 -0
  121. package/lib/types/common/telemetry/defaultConfigs/defaultAriaConfig.d.ts +2 -2
  122. package/lib/types/common/telemetry/defaultConfigs/defaultTelemetryConfiguration.d.ts +2 -2
  123. package/lib/types/common/telemetry/defaultConfigs/defaultTelemetryInternalData.d.ts +2 -2
  124. package/lib/types/common/telemetry/definitions/Contracts.d.ts +77 -77
  125. package/lib/types/common/telemetry/definitions/Payload.d.ts +105 -105
  126. package/lib/types/common/telemetry/interfaces/IAppInsightsConfig.d.ts +4 -0
  127. package/lib/types/common/telemetry/interfaces/IAriaConfigurations.d.ts +18 -18
  128. package/lib/types/common/telemetry/interfaces/IChatSDKLogger.d.ts +6 -5
  129. package/lib/types/common/telemetry/interfaces/IInternalTelemetryData.d.ts +23 -21
  130. package/lib/types/common/telemetry/interfaces/ITelemetryConfig.d.ts +48 -48
  131. package/lib/types/common/telemetry/interfaces/ITelemetryEvents.d.ts +7 -7
  132. package/lib/types/common/telemetry/loggers/appInsightsLogger.d.ts +10 -0
  133. package/lib/types/common/telemetry/loggers/ariaTelemetryLogger.d.ts +2 -2
  134. package/lib/types/common/telemetry/loggers/consoleLogger.d.ts +2 -2
  135. package/lib/types/common/utils.d.ts +49 -49
  136. package/lib/types/components/callingcontainerstateful/CallingContainerStateful.d.ts +4 -3
  137. package/lib/types/components/callingcontainerstateful/ICallingContainerStatefulProps.d.ts +4 -4
  138. package/lib/types/components/chatbuttonstateful/ChatButtonStateful.d.ts +4 -3
  139. package/lib/types/components/chatbuttonstateful/common/styleProps/defaultOutOfOfficeChatButtonStyleProps.d.ts +2 -2
  140. package/lib/types/components/chatbuttonstateful/interfaces/IChatButtonStatefulParams.d.ts +17 -17
  141. package/lib/types/components/confirmationpanestateful/ConfirmationPaneStateful.d.ts +4 -3
  142. package/lib/types/components/confirmationpanestateful/common/defaultProps/defaultConfirmationPaneLocalizedTexts.d.ts +2 -2
  143. package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneInputs.d.ts +4 -4
  144. package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneLocalizedText.d.ts +10 -10
  145. package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneStatefulParams.d.ts +13 -13
  146. package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneStatefulProps.d.ts +8 -8
  147. package/lib/types/components/dimlayer/DimLayer.d.ts +6 -5
  148. package/lib/types/components/draggable/DraggableChatWidget.d.ts +9 -9
  149. package/lib/types/components/draggable/DraggableEventEmitter.d.ts +27 -27
  150. package/lib/types/components/draggable/DraggableEventNames.d.ts +6 -6
  151. package/lib/types/components/draggable/DraggableEventReceiver.d.ts +27 -27
  152. package/lib/types/components/draggable/IDraggableElementPosition.d.ts +5 -5
  153. package/lib/types/components/draggable/IDraggableElementPositionDelta.d.ts +5 -5
  154. package/lib/types/components/draggable/IDraggableEvent.d.ts +12 -12
  155. package/lib/types/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.d.ts +4 -3
  156. package/lib/types/components/emailtranscriptpanestateful/interfaces/IChatTranscriptBody.d.ts +5 -5
  157. package/lib/types/components/emailtranscriptpanestateful/interfaces/IEmailTranscriptPaneProps.d.ts +11 -11
  158. package/lib/types/components/footerstateful/FooterStateful.d.ts +3 -2
  159. package/lib/types/components/footerstateful/audionotificationstateful/AudioNotificationStateful.d.ts +4 -3
  160. package/lib/types/components/footerstateful/audionotificationstateful/interfaces/IAudioNotificationProps.d.ts +3 -3
  161. package/lib/types/components/footerstateful/audionotificationstateful/interfaces/IAudioNotificationStatefulParams.d.ts +4 -4
  162. package/lib/types/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.d.ts +4 -4
  163. package/lib/types/components/footerstateful/downloadtranscriptstateful/common/defaultLibraryScripts.d.ts +23 -23
  164. package/lib/types/components/footerstateful/downloadtranscriptstateful/interfaces/IDownloadTranscriptProps.d.ts +19 -19
  165. package/lib/types/components/footerstateful/downloadtranscriptstateful/interfaces/IWebChatTranscriptConfig.d.ts +14 -14
  166. package/lib/types/components/footerstateful/downloadtranscriptstateful/interfaces/TranscriptHtmlScripts.d.ts +33 -33
  167. package/lib/types/components/headerstateful/HeaderStateful.d.ts +4 -3
  168. package/lib/types/components/headerstateful/common/styleProps/defaultOutOfOfficeHeaderStyleProps.d.ts +2 -2
  169. package/lib/types/components/headerstateful/interfaces/IHeaderStatefulParams.d.ts +33 -33
  170. package/lib/types/components/livechatwidget/LiveChatWidget.d.ts +4 -3
  171. package/lib/types/components/livechatwidget/common/ActivityStreamHandler.d.ts +14 -14
  172. package/lib/types/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.d.ts +12 -12
  173. package/lib/types/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.d.ts +5 -5
  174. package/lib/types/components/livechatwidget/common/ActivitySubscriber/HiddenAdaptiveCardActivitySubscriber.d.ts +7 -7
  175. package/lib/types/components/livechatwidget/common/ActivitySubscriber/IActivitySubscriber.d.ts +6 -6
  176. package/lib/types/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.d.ts +7 -7
  177. package/lib/types/components/livechatwidget/common/ChatAdapterShim.d.ts +7 -7
  178. package/lib/types/components/livechatwidget/common/Deferred.d.ts +9 -9
  179. package/lib/types/components/livechatwidget/common/authHelper.d.ts +18 -18
  180. package/lib/types/components/livechatwidget/common/chatDisconnectHelper.d.ts +4 -4
  181. package/lib/types/components/livechatwidget/common/createAdapter.d.ts +3 -3
  182. package/lib/types/components/livechatwidget/common/createDownloadTranscriptProps.d.ts +25 -25
  183. package/lib/types/components/livechatwidget/common/createFooter.d.ts +4 -3
  184. package/lib/types/components/livechatwidget/common/createInternetConnectionChangeHandler.d.ts +2 -2
  185. package/lib/types/components/livechatwidget/common/createMarkdown.d.ts +2 -2
  186. package/lib/types/components/livechatwidget/common/defaultProps/defaultScrollBarProps.d.ts +2 -2
  187. package/lib/types/components/livechatwidget/common/defaultStyles/defaultLiveChatWidgetGeneralStyles.d.ts +2 -2
  188. package/lib/types/components/livechatwidget/common/disposeTelemetryLoggers.d.ts +1 -1
  189. package/lib/types/components/livechatwidget/common/endChat.d.ts +13 -13
  190. package/lib/types/components/livechatwidget/common/getGeneralStylesForButton.d.ts +3 -3
  191. package/lib/types/components/livechatwidget/common/getMockChatSDKIfApplicable.d.ts +1 -1
  192. package/lib/types/components/livechatwidget/common/helpers/markdownHelper.d.ts +2 -2
  193. package/lib/types/components/livechatwidget/common/initCallingSdk.d.ts +2 -2
  194. package/lib/types/components/livechatwidget/common/initConfirmationPropsComposer.d.ts +3 -3
  195. package/lib/types/components/livechatwidget/common/initWebChatComposer.d.ts +7 -7
  196. package/lib/types/components/livechatwidget/common/liveChatConfigUtils.d.ts +3 -3
  197. package/lib/types/components/livechatwidget/common/overridePropsOnMockIfApplicable.d.ts +3 -3
  198. package/lib/types/components/livechatwidget/common/persistentChatHelper.d.ts +1 -1
  199. package/lib/types/components/livechatwidget/common/reconnectChatHelper.d.ts +12 -12
  200. package/lib/types/components/livechatwidget/common/registerTelemetryLoggers.d.ts +4 -4
  201. package/lib/types/components/livechatwidget/common/renderSurveyHelpers.d.ts +10 -10
  202. package/lib/types/components/livechatwidget/common/setPostChatContextAndLoadSurvey.d.ts +4 -4
  203. package/lib/types/components/livechatwidget/common/shareObservable.d.ts +1 -1
  204. package/lib/types/components/livechatwidget/common/startChat.d.ts +11 -11
  205. package/lib/types/components/livechatwidget/common/startChatErrorHandler.d.ts +6 -6
  206. package/lib/types/components/livechatwidget/common/startProactiveChat.d.ts +4 -4
  207. package/lib/types/components/livechatwidget/common/updateSessionDataForTelemetry.d.ts +4 -4
  208. package/lib/types/components/livechatwidget/interfaces/IBotAuthActivitySubscriberOptionalParams.d.ts +4 -4
  209. package/lib/types/components/livechatwidget/interfaces/IDraggableChatWidgetProps.d.ts +10 -10
  210. package/lib/types/components/livechatwidget/interfaces/IFeatureConfigProps.d.ts +3 -3
  211. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetComponentOverrides.d.ts +17 -17
  212. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetControlProps.d.ts +21 -21
  213. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +70 -68
  214. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetStyleProps.d.ts +5 -5
  215. package/lib/types/components/livechatwidget/interfaces/IMockProps.d.ts +8 -8
  216. package/lib/types/components/livechatwidget/interfaces/IScrollBarProps.d.ts +22 -22
  217. package/lib/types/components/livechatwidget/interfaces/ISendBox.d.ts +12 -12
  218. package/lib/types/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.d.ts +3 -3
  219. package/lib/types/components/loadingpanestateful/LoadingPaneStateful.d.ts +3 -2
  220. package/lib/types/components/loadingpanestateful/common/defaultStyleProps/defaultgeneralLoadingPaneStyleProps.d.ts +2 -2
  221. package/lib/types/components/loadingpanestateful/common/errorUIStyleProps/errorUILoadingPaneStyleProps.d.ts +2 -2
  222. package/lib/types/components/notificationpanestateful/NotificationPaneStateful.d.ts +4 -3
  223. package/lib/types/components/notificationpanestateful/defaultProps/defaultChatDisconnectControlProps.d.ts +2 -2
  224. package/lib/types/components/notificationpanestateful/defaultProps/defaultChatDisconnectStyleProps.d.ts +2 -2
  225. package/lib/types/components/notificationpanestateful/interfaces/INotificationPaneStatefulProps.d.ts +13 -13
  226. package/lib/types/components/ooohpanestateful/OOOHPaneStateful.d.ts +4 -3
  227. package/lib/types/components/ooohpanestateful/common/defaultStyleProps/defaultgeneralOOOHPaneStyleProps.d.ts +2 -2
  228. package/lib/types/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.d.ts +4 -3
  229. package/lib/types/components/postchatloadingpanestateful/common/defaultgeneralPostChatLoadingPaneStyleProps.d.ts +2 -2
  230. package/lib/types/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.d.ts +4 -3
  231. package/lib/types/components/postchatsurveypanestateful/common/defaultStyleProps/defaultgeneralPostChatSurveyPaneStyleProps.d.ts +2 -2
  232. package/lib/types/components/postchatsurveypanestateful/common/isValidSurveyUrl.d.ts +2 -2
  233. package/lib/types/components/postchatsurveypanestateful/enums/CustomerVoiceEvents.d.ts +5 -5
  234. package/lib/types/components/postchatsurveypanestateful/enums/PostChatSurveyMode.d.ts +4 -4
  235. package/lib/types/components/postchatsurveypanestateful/interfaces/IPostChatSurveyPaneStatefulProps.d.ts +5 -5
  236. package/lib/types/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.d.ts +4 -3
  237. package/lib/types/components/prechatsurveypanestateful/common/defaultProps/defaultPreChatSurveyLocalizedTexts.d.ts +2 -2
  238. package/lib/types/components/prechatsurveypanestateful/common/defaultStyles/defaultGeneralPreChatSurveyPaneStyleProps.d.ts +2 -2
  239. package/lib/types/components/prechatsurveypanestateful/interfaces/IPreChatSurveyPaneStatefulParams.d.ts +5 -5
  240. package/lib/types/components/proactivechatpanestateful/ProactiveChatPaneStateful.d.ts +3 -2
  241. package/lib/types/components/proactivechatpanestateful/interfaces/IProactiveChatNotificationConfig.d.ts +3 -3
  242. package/lib/types/components/proactivechatpanestateful/interfaces/IProactiveChatPaneStatefulProps.d.ts +4 -4
  243. package/lib/types/components/reconnectchatpanestateful/ReconnectChatPaneStateful.d.ts +4 -3
  244. package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatContext.d.ts +4 -4
  245. package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatOptionalParams.d.ts +3 -3
  246. package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatPaneStatefulParams.d.ts +5 -5
  247. package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatPaneStatefulProps.d.ts +5 -5
  248. package/lib/types/components/startchaterrorpanestateful/StartChatErrorPaneStateful.d.ts +4 -3
  249. package/lib/types/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneGeneralStyleProps.d.ts +2 -2
  250. package/lib/types/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneIconImageProps.d.ts +2 -2
  251. package/lib/types/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneIconStyleProps.d.ts +2 -2
  252. package/lib/types/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneSubtitleStyleProps.d.ts +2 -2
  253. package/lib/types/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneTitleStyleProps.d.ts +2 -2
  254. package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneClassNames.d.ts +5 -5
  255. package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneComponentOverrides.d.ts +6 -6
  256. package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneControlProps.d.ts +14 -14
  257. package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneProps.d.ts +8 -8
  258. package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneStyleProps.d.ts +10 -10
  259. package/lib/types/components/webchatcontainerstateful/WebChatContainerStateful.d.ts +4 -3
  260. package/lib/types/components/webchatcontainerstateful/common/DemoChatAdapter.d.ts +10 -10
  261. package/lib/types/components/webchatcontainerstateful/common/DemoChatSDK.d.ts +6 -6
  262. package/lib/types/components/webchatcontainerstateful/common/DesignerChatAdapter.d.ts +8 -8
  263. package/lib/types/components/webchatcontainerstateful/common/DesignerChatSDK.d.ts +31 -31
  264. package/lib/types/components/webchatcontainerstateful/common/MockBotCardCommandType.d.ts +6 -6
  265. package/lib/types/components/webchatcontainerstateful/common/MockBotCommand.d.ts +11 -11
  266. package/lib/types/components/webchatcontainerstateful/common/defaultProps/defaultAttachmentProps.d.ts +2 -2
  267. package/lib/types/components/webchatcontainerstateful/common/defaultProps/defaultMarkdownLocalizedTexts.d.ts +2 -2
  268. package/lib/types/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.d.ts +2 -2
  269. package/lib/types/components/webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps.d.ts +2 -2
  270. package/lib/types/components/webchatcontainerstateful/common/defaultProps/defaultWebChatStatefulProps.d.ts +2 -2
  271. package/lib/types/components/webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles.d.ts +2 -2
  272. package/lib/types/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStatefulContainerStyles.d.ts +2 -2
  273. package/lib/types/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles.d.ts +2 -2
  274. package/lib/types/components/webchatcontainerstateful/common/mockadapter.d.ts +14 -14
  275. package/lib/types/components/webchatcontainerstateful/common/mockchatsdk.d.ts +45 -45
  276. package/lib/types/components/webchatcontainerstateful/common/utils/BrowserInfo.d.ts +5 -5
  277. package/lib/types/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.d.ts +7 -7
  278. package/lib/types/components/webchatcontainerstateful/common/utils/attachmentActivityUtils.d.ts +9 -9
  279. package/lib/types/components/webchatcontainerstateful/common/utils/chatAdapterUtils.d.ts +9 -9
  280. package/lib/types/components/webchatcontainerstateful/common/utils/isMaskingFromCustomer.d.ts +2 -2
  281. package/lib/types/components/webchatcontainerstateful/interfaces/IAdaptiveCardStyles.d.ts +8 -8
  282. package/lib/types/components/webchatcontainerstateful/interfaces/IAttachmentProps.d.ts +5 -5
  283. package/lib/types/components/webchatcontainerstateful/interfaces/IBotAuthConfig.d.ts +4 -4
  284. package/lib/types/components/webchatcontainerstateful/interfaces/IBotMagicCodeConfig.d.ts +4 -4
  285. package/lib/types/components/webchatcontainerstateful/interfaces/IDataMaskingInfo.d.ts +6 -6
  286. package/lib/types/components/webchatcontainerstateful/interfaces/IDataMaskingRule.d.ts +3 -3
  287. package/lib/types/components/webchatcontainerstateful/interfaces/IDataMaskingSetting.d.ts +4 -4
  288. package/lib/types/components/webchatcontainerstateful/interfaces/IRenderingMiddlewareProps.d.ts +37 -37
  289. package/lib/types/components/webchatcontainerstateful/interfaces/IWebChatAction.d.ts +4 -4
  290. package/lib/types/components/webchatcontainerstateful/interfaces/IWebChatContainerStatefulProps.d.ts +28 -28
  291. package/lib/types/components/webchatcontainerstateful/interfaces/IWebChatProps.d.ts +39 -39
  292. package/lib/types/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.d.ts +3 -3
  293. package/lib/types/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.d.ts +3 -3
  294. package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/BrowserVendor.d.ts +9 -9
  295. package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineActivityType.d.ts +4 -4
  296. package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineSenderRole.d.ts +5 -5
  297. package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/MessageType.d.ts +11 -11
  298. package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/NotificationLevel.d.ts +6 -6
  299. package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios.d.ts +11 -11
  300. package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/SendStatus.d.ts +5 -5
  301. package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/WebChatActionType.d.ts +24 -24
  302. package/lib/types/components/webchatcontainerstateful/webchatcontroller/markdownrenderers/HyperlinkTextOverrideRenderer.d.ts +9 -9
  303. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsEgressMiddleware.d.ts +2 -2
  304. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsIngressMiddleware.d.ts +2 -2
  305. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.d.ts +10 -10
  306. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.d.ts +1 -1
  307. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.d.ts +6 -6
  308. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/Attachment.d.ts +3 -2
  309. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/AttachmentContent.d.ts +3 -2
  310. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/AttachmentIcon.d.ts +3 -2
  311. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/DownloadBlockedAttachment.d.ts +3 -2
  312. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/FileScanStatus.d.ts +6 -6
  313. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/MaliciousAttachment.d.ts +3 -2
  314. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/ScanInProgressAttachment.d.ts +3 -2
  315. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/Spinner.d.ts +3 -2
  316. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware.d.ts +8 -8
  317. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.d.ts +2 -2
  318. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentContentStyles.d.ts +1 -2
  319. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentDividerStyles.d.ts +1 -2
  320. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentDownloadIconStyles.d.ts +1 -2
  321. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentFileNameStyles.d.ts +1 -2
  322. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentSizeStyles.d.ts +1 -2
  323. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAtttachmentAdaptiveCardStyles.d.ts +1 -2
  324. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAtttachmentIconStyles.d.ts +1 -2
  325. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAtttachmentStyles.d.ts +1 -2
  326. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAvatarStyles.d.ts +1 -2
  327. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAvatarTextStyles.d.ts +1 -2
  328. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultReceivedMessageAnchorStyles.d.ts +1 -2
  329. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSentMessageAnchorStyles.d.ts +1 -2
  330. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles.d.ts +3 -3
  331. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageStyles.d.ts +11 -11
  332. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampContentStyles.d.ts +2 -2
  333. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampFailedStyles.d.ts +1 -2
  334. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampRetryStyles.d.ts +1 -2
  335. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTypingIndicatorBubbleStyles.d.ts +1 -2
  336. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTypingIndicatorContainerStyles.d.ts +1 -2
  337. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTypingIndicatorMessageStyles.d.ts +1 -2
  338. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles.d.ts +3 -3
  339. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageStyles.d.ts +3 -3
  340. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/groupActivitiesMiddleware.d.ts +10 -10
  341. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/index.d.ts +10 -10
  342. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageSequenceIdOverrideMiddleware.d.ts +4 -4
  343. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.d.ts +4 -4
  344. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.d.ts +2 -1
  345. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.d.ts +2 -1
  346. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.d.ts +2 -1
  347. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/toastMiddleware.d.ts +2 -2
  348. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.d.ts +7 -6
  349. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentProcessingMiddleware.d.ts +10 -10
  350. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.d.ts +11 -11
  351. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware.d.ts +10 -10
  352. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.d.ts +11 -11
  353. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/dataMaskingMiddleware.d.ts +11 -11
  354. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/gifUploadMiddleware.d.ts +10 -10
  355. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlPlayerMiddleware.d.ts +10 -10
  356. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlTextMiddleware.d.ts +10 -10
  357. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/maxMessageSizeValidator.d.ts +11 -11
  358. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/preProcessingMiddleware.d.ts +10 -10
  359. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/sanitizationMiddleware.d.ts +10 -10
  360. package/lib/types/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.d.ts +12 -12
  361. package/lib/types/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.d.ts +1 -1
  362. package/lib/types/contexts/ChatAdapterStore.d.ts +1 -2
  363. package/lib/types/contexts/ChatContextStore.d.ts +1 -1
  364. package/lib/types/contexts/ChatSDKStore.d.ts +1 -1
  365. package/lib/types/contexts/FacadeChatSDKStore.d.ts +1 -1
  366. package/lib/types/contexts/common/ConversationState.d.ts +13 -13
  367. package/lib/types/contexts/common/ILiveChatWidgetAction.d.ts +5 -5
  368. package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +63 -63
  369. package/lib/types/contexts/common/ILiveChatWidgetLocalizedTexts.d.ts +40 -40
  370. package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +48 -48
  371. package/lib/types/contexts/common/LiveChatWidgetContextInitialState.d.ts +3 -3
  372. package/lib/types/contexts/common/StartChatFailureType.d.ts +5 -5
  373. package/lib/types/contexts/createReducer.d.ts +4 -4
  374. package/lib/types/controller/componentController.d.ts +16 -16
  375. package/lib/types/firstresponselatency/Constants.d.ts +30 -30
  376. package/lib/types/firstresponselatency/FirstMessageTrackerFromBot.d.ts +1 -1
  377. package/lib/types/firstresponselatency/FirstResponseLatencyTracker.d.ts +22 -22
  378. package/lib/types/firstresponselatency/util.d.ts +7 -7
  379. package/lib/types/hooks/useChatAdapterStore.d.ts +2 -2
  380. package/lib/types/hooks/useChatContextStore.d.ts +5 -5
  381. package/lib/types/hooks/useChatSDKStore.d.ts +2 -2
  382. package/lib/types/hooks/useDebounce.d.ts +3 -3
  383. package/lib/types/hooks/useFacadeChatSDKStore.d.ts +3 -3
  384. package/lib/types/hooks/useWindowDimensions.d.ts +4 -4
  385. package/lib/types/index.d.ts +11 -11
  386. package/lib/types/plugins/createChatTranscript.d.ts +3 -3
  387. package/lib/types/plugins/newMessageEventHandler.d.ts +2 -2
  388. package/package.json +31 -16
@@ -1,3 +1,8 @@
1
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
3
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
4
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
5
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
1
6
  import { HtmlClassNames, HtmlIdNames } from "../../../../common/Constants";
2
7
  import { NotificationLevel } from "../enums/NotificationLevel";
3
8
  import { WebChatActionType } from "../enums/WebChatActionType";
@@ -5,73 +10,96 @@ import { WebChatStoreLoader } from "../WebChatStoreLoader";
5
10
  import { setFocusOnSendBox } from "../../../../common/utils";
6
11
  import { BroadcastService } from "@microsoft/omnichannel-chat-components";
7
12
  import { BroadcastEvent } from "../../../../common/telemetry/TelemetryConstants";
8
- export class NotificationHandler {
9
- static notify(id, level, message) {
10
- if (WebChatStoreLoader.store) {
11
- WebChatStoreLoader.store.dispatch({
12
- type: WebChatActionType.WEB_CHAT_SET_NOTIFICATION,
13
- payload: {
14
- id,
15
- level,
16
- message
17
- }
18
- });
19
- NotificationHandler.setFocusOnNotificationCloseButton();
20
- }
13
+ export let NotificationHandler = /*#__PURE__*/function () {
14
+ function NotificationHandler() {
15
+ _classCallCheck(this, NotificationHandler);
21
16
  }
22
- static dismissNotification(id) {
23
- if (WebChatStoreLoader.store) {
24
- WebChatStoreLoader.store.dispatch({
25
- type: WebChatActionType.WEB_CHAT_DISMISS_NOTIFICATION,
17
+ _createClass(NotificationHandler, null, [{
18
+ key: "notify",
19
+ value: function notify(id, level, message) {
20
+ if (WebChatStoreLoader.store) {
21
+ WebChatStoreLoader.store.dispatch({
22
+ type: WebChatActionType.WEB_CHAT_SET_NOTIFICATION,
23
+ payload: {
24
+ id,
25
+ level,
26
+ message
27
+ }
28
+ });
29
+ NotificationHandler.setFocusOnNotificationCloseButton();
30
+ }
31
+ }
32
+ }, {
33
+ key: "dismissNotification",
34
+ value: function dismissNotification(id) {
35
+ if (WebChatStoreLoader.store) {
36
+ WebChatStoreLoader.store.dispatch({
37
+ type: WebChatActionType.WEB_CHAT_DISMISS_NOTIFICATION,
38
+ payload: {
39
+ id
40
+ }
41
+ });
42
+ }
43
+ }
44
+ }, {
45
+ key: "notifyError",
46
+ value: function notifyError(id, message) {
47
+ BroadcastService.postMessage({
48
+ eventName: BroadcastEvent.OnWidgetError,
26
49
  payload: {
27
- id
50
+ errorMessage: message
28
51
  }
29
52
  });
53
+ this.notify(id, NotificationLevel.Error, message);
30
54
  }
31
- }
32
- static notifyError(id, message) {
33
- BroadcastService.postMessage({
34
- eventName: BroadcastEvent.OnWidgetError,
35
- payload: {
36
- errorMessage: message
55
+ }, {
56
+ key: "notifyWarning",
57
+ value: function notifyWarning(id, message) {
58
+ this.notify(id, NotificationLevel.Warning, message);
59
+ }
60
+ }, {
61
+ key: "notifyInfo",
62
+ value: function notifyInfo(id, message) {
63
+ this.notify(id, NotificationLevel.Info, message);
64
+ }
65
+ }, {
66
+ key: "notifySuccess",
67
+ value: function notifySuccess(id, message) {
68
+ this.notify(id, NotificationLevel.Success, message);
69
+ }
70
+ }, {
71
+ key: "notifyWithLevel",
72
+ value: function notifyWithLevel(id, message, level) {
73
+ if (!level) {
74
+ this.notifyInfo(id, message);
75
+ } else {
76
+ this.notify(id, level, message);
37
77
  }
38
- });
39
- this.notify(id, NotificationLevel.Error, message);
40
- }
41
- static notifyWarning(id, message) {
42
- this.notify(id, NotificationLevel.Warning, message);
43
- }
44
- static notifyInfo(id, message) {
45
- this.notify(id, NotificationLevel.Info, message);
46
- }
47
- static notifySuccess(id, message) {
48
- this.notify(id, NotificationLevel.Success, message);
49
- }
50
- static notifyWithLevel(id, message, level) {
51
- if (!level) {
52
- this.notifyInfo(id, message);
53
- } else {
54
- this.notify(id, level, message);
55
78
  }
56
- }
57
79
 
58
- /* Bypass WebChat behavior and focus on banner close button */
59
- static setFocusOnNotificationCloseButton() {
60
- const expandButton = document.querySelector(`#${HtmlIdNames.MSLiveChatWidget} .${HtmlClassNames.webChatBannerExpandButton}`);
61
- if (expandButton) {
62
- expandButton.focus();
63
- return;
80
+ /* Bypass WebChat behavior and focus on banner close button */
81
+ }, {
82
+ key: "setFocusOnNotificationCloseButton",
83
+ value: function setFocusOnNotificationCloseButton() {
84
+ const expandButton = document.querySelector(`#${HtmlIdNames.MSLiveChatWidget} .${HtmlClassNames.webChatBannerExpandButton}`);
85
+ if (expandButton) {
86
+ expandButton.focus();
87
+ return;
88
+ }
89
+ const closeButton = document.querySelector(`#${HtmlIdNames.MSLiveChatWidget} .${HtmlClassNames.webChatBannerCloseButton}`);
90
+ if (closeButton) {
91
+ closeButton.focus();
92
+ NotificationHandler.registerOnCloseEvent(closeButton);
93
+ return;
94
+ }
64
95
  }
65
- const closeButton = document.querySelector(`#${HtmlIdNames.MSLiveChatWidget} .${HtmlClassNames.webChatBannerCloseButton}`);
66
- if (closeButton) {
67
- closeButton.focus();
68
- NotificationHandler.registerOnCloseEvent(closeButton);
69
- return;
96
+ }, {
97
+ key: "registerOnCloseEvent",
98
+ value: function registerOnCloseEvent(button) {
99
+ button.onclick = () => {
100
+ setFocusOnSendBox();
101
+ };
70
102
  }
71
- }
72
- static registerOnCloseEvent(button) {
73
- button.onclick = () => {
74
- setFocusOnSendBox();
75
- };
76
- }
77
- }
103
+ }]);
104
+ return NotificationHandler;
105
+ }();
@@ -16,6 +16,7 @@ export const getLiveChatWidgetContextInitialState = props => {
16
16
  const initialState = defaultClientDataStoreProvider(cacheTtlInMins, storageType).getData(widgetCacheId);
17
17
  if (!isNullOrUndefined(initialState)) {
18
18
  const initialStateFromCache = JSON.parse(initialState);
19
+ const outsideOperatingHours = isOutsideOperatingHours();
19
20
 
20
21
  /*
21
22
  * this step is needed to avoid the pre-chat pane to be injected in the DOM when the widget is reloaded, because wont be visible
@@ -23,17 +24,15 @@ export const getLiveChatWidgetContextInitialState = props => {
23
24
  * as part of the flow, the pre-chat will be detected and then it will be displayed properly
24
25
  * this case is only and only for pre-chat pane.
25
26
  * **/
26
- if (initialStateFromCache.appStates.conversationState === ConversationState.Prechat) {
27
+ if (initialStateFromCache.appStates.conversationState === ConversationState.Prechat || initialStateFromCache.appStates.conversationState === ConversationState.OutOfOffice || outsideOperatingHours) {
27
28
  initialStateFromCache.appStates.conversationState = ConversationState.Closed;
29
+ // if we are resetting the conversation state, there is no point to obtain minimized state from cache
30
+ initialStateFromCache.appStates.isMinimized = undefined;
28
31
  }
29
-
30
32
  // we are always setting the chatConfig from the props to avoid any issues with the cache
31
33
  initialStateFromCache.domainStates.liveChatConfig = props.chatConfig;
32
-
33
34
  // Cache the result of isOutsideOperatingHours() to ensure consistency
34
- const outsideOperatingHours = isOutsideOperatingHours();
35
35
  initialStateFromCache.appStates.outsideOperatingHours = outsideOperatingHours;
36
- initialStateFromCache.appStates.conversationState = outsideOperatingHours ? ConversationState.OutOfOffice : initialStateFromCache.appStates.conversationState;
37
36
  return initialStateFromCache;
38
37
  }
39
38
  const LiveChatWidgetContextInitialState = {
@@ -58,7 +57,7 @@ export const getLiveChatWidgetContextInitialState = props => {
58
57
  startChatFailureType: StartChatFailureType.Generic
59
58
  },
60
59
  appStates: {
61
- conversationState: isOutsideOperatingHours() ? ConversationState.OutOfOffice : ConversationState.Closed,
60
+ conversationState: ConversationState.Closed,
62
61
  isMinimized: undefined,
63
62
  previousElementIdOnFocusBeforeModalOpen: null,
64
63
  startChatFailed: false,
@@ -17,7 +17,7 @@ export const shouldShowEmailTranscriptPane = state => {
17
17
  return state.uiStates.showEmailTranscriptPane;
18
18
  };
19
19
  export const shouldShowWebChatContainer = state => {
20
- return state.appStates.conversationState === ConversationState.Active || state.appStates.conversationState === ConversationState.InActive;
20
+ return !state.appStates.isMinimized && state.appStates.conversationState === ConversationState.Active || state.appStates.conversationState === ConversationState.InActive;
21
21
  };
22
22
  export const shouldShowLoadingPane = state => {
23
23
  return !state.appStates.isMinimized && state.appStates.conversationState === ConversationState.Loading;
@@ -32,7 +32,8 @@ export const shouldShowPostChatLoadingPane = state => {
32
32
  return !state.appStates.isMinimized && state.appStates.conversationState === ConversationState.PostchatLoading;
33
33
  };
34
34
  export const shouldShowOutOfOfficeHoursPane = state => {
35
- return !state.appStates.isMinimized && state.appStates.conversationState === ConversationState.OutOfOffice;
35
+ // Show OOOH pane only when the conversation state is Closed and outside operating hours is true
36
+ return !state.appStates.isMinimized && state.appStates.outsideOperatingHours === true && state.appStates.conversationState === ConversationState.OutOfOffice;
36
37
  };
37
38
  export const shouldShowPreChatSurveyPane = state => {
38
39
  return state.appStates.conversationState === ConversationState.Prechat;
@@ -1,11 +1,15 @@
1
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
3
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
1
4
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
5
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
3
6
  function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
4
7
  import { BroadcastEvent, LogLevel, TelemetryEvent } from "../common/telemetry/TelemetryConstants";
5
8
  import { BroadcastService } from "@microsoft/omnichannel-chat-components";
6
9
  import { TelemetryHelper } from "../common/telemetry/TelemetryHelper";
7
- export class FirstResponseLatencyTracker {
8
- constructor() {
10
+ export let FirstResponseLatencyTracker = /*#__PURE__*/function () {
11
+ function FirstResponseLatencyTracker() {
12
+ _classCallCheck(this, FirstResponseLatencyTracker);
9
13
  _defineProperty(this, "isABotConversation", false);
10
14
  _defineProperty(this, "isStarted", false);
11
15
  _defineProperty(this, "isEnded", false);
@@ -41,132 +45,150 @@ export class FirstResponseLatencyTracker {
41
45
  // we do have a mechanism in place to prevent log agent messages.
42
46
  this.isABotConversation = true;
43
47
  }
44
- createTrackingMessage(payload, type) {
45
- return {
46
- Id: payload.Id,
47
- role: payload.role,
48
- timestamp: payload === null || payload === void 0 ? void 0 : payload.timestamp,
49
- tags: payload.tags,
50
- messageType: payload.messageType,
51
- text: payload.text,
52
- type: type,
53
- checkTime: new Date().getTime()
54
- };
55
- }
56
-
57
- // Tracking Functions
58
- startTracking(payload) {
59
- if (!this.isReady) return;
60
- // this prevents to initiate tracking for multiple incoming messages
61
- if (this.isStarted) {
62
- return;
63
- }
64
- // this is to ensure we track only messages where bot is engaged
65
- if (!this.isABotConversation) {
66
- return;
67
- }
68
- // control of states to prevent clashing of messages
69
- this.isStarted = true;
70
- this.isEnded = false;
71
- // The idea of using types is to enrich telemetry data
72
- this.startTrackingMessage = this.createTrackingMessage(payload, "userMessage");
73
- }
74
- handleAgentMessage(payload) {
75
- var _payload$tags;
76
- // this tag so far is only present in agent messages
77
- if (payload !== null && payload !== void 0 && (_payload$tags = payload.tags) !== null && _payload$tags !== void 0 && _payload$tags.includes("public")) {
78
- this.deregister();
79
- }
80
- }
81
- stopTracking(payload) {
82
- var _this$stopTrackingMes, _this$startTrackingMe;
83
- // this prevents execution for multiple incoming messages from the bot.
84
- if (this.isEnded && !this.isStarted) {
85
- return;
48
+ _createClass(FirstResponseLatencyTracker, [{
49
+ key: "createTrackingMessage",
50
+ value: function createTrackingMessage(payload, type) {
51
+ return {
52
+ Id: payload.Id,
53
+ role: payload.role,
54
+ timestamp: payload === null || payload === void 0 ? void 0 : payload.timestamp,
55
+ tags: payload.tags,
56
+ messageType: payload.messageType,
57
+ text: payload.text,
58
+ type: type,
59
+ checkTime: new Date().getTime()
60
+ };
86
61
  }
87
62
 
88
- // control of states to prevent clashing of messages
89
- this.isEnded = true;
90
- this.isStarted = false;
91
-
92
- // The idea of using types is to enrich telemetry data
93
- this.stopTrackingMessage = this.createTrackingMessage(payload, "botMessage");
94
- // calculating elapsed time
95
- const elapsedTime = (((_this$stopTrackingMes = this.stopTrackingMessage) === null || _this$stopTrackingMes === void 0 ? void 0 : _this$stopTrackingMes.checkTime) ?? 0) - (((_this$startTrackingMe = this.startTrackingMessage) === null || _this$startTrackingMe === void 0 ? void 0 : _this$startTrackingMe.checkTime) ?? 0);
96
- TelemetryHelper.logActionEvent(LogLevel.INFO, {
97
- Event: TelemetryEvent.MessageLapTrack,
98
- Description: "First response latency tracking",
99
- CustomProperties: {
100
- elapsedTime,
101
- userMessage: this.startTrackingMessage,
102
- botMessage: this.stopTrackingMessage
63
+ // Tracking Functions
64
+ }, {
65
+ key: "startTracking",
66
+ value: function startTracking(payload) {
67
+ if (!this.isReady) return;
68
+ // this prevents to initiate tracking for multiple incoming messages
69
+ if (this.isStarted) {
70
+ return;
103
71
  }
104
- });
105
- }
106
-
107
- // mechanism to ensure we track only allowed conversations
108
- isMessageFromValidSender(payload) {
109
- var _payload$tags2;
110
- // agent scenario
111
- if (payload !== null && payload !== void 0 && (_payload$tags2 = payload.tags) !== null && _payload$tags2 !== void 0 && _payload$tags2.includes("public")) {
112
- this.handleAgentMessage(payload);
113
- return false;
72
+ // this is to ensure we track only messages where bot is engaged
73
+ if (!this.isABotConversation) {
74
+ return;
75
+ }
76
+ // control of states to prevent clashing of messages
77
+ this.isStarted = true;
78
+ this.isEnded = false;
79
+ // The idea of using types is to enrich telemetry data
80
+ this.startTrackingMessage = this.createTrackingMessage(payload, "userMessage");
114
81
  }
115
- return true;
116
- }
117
- startClock(payload) {
118
- try {
119
- if (!payload || !payload.Id) {
120
- throw new Error("Invalid payload");
82
+ }, {
83
+ key: "handleAgentMessage",
84
+ value: function handleAgentMessage(payload) {
85
+ var _payload$tags;
86
+ // this tag so far is only present in agent messages
87
+ if (payload !== null && payload !== void 0 && (_payload$tags = payload.tags) !== null && _payload$tags !== void 0 && _payload$tags.includes("public")) {
88
+ this.deregister();
121
89
  }
122
- this.startTracking(payload);
123
- } catch (e) {
124
- TelemetryHelper.logActionEvent(LogLevel.ERROR, {
125
- Event: TelemetryEvent.MessageStartLapTrackError,
126
- Description: "Error while starting the clock",
127
- ExceptionDetails: e,
90
+ }
91
+ }, {
92
+ key: "stopTracking",
93
+ value: function stopTracking(payload) {
94
+ var _this$stopTrackingMes, _this$startTrackingMe;
95
+ // this prevents execution for multiple incoming messages from the bot.
96
+ if (this.isEnded && !this.isStarted) {
97
+ return;
98
+ }
99
+
100
+ // control of states to prevent clashing of messages
101
+ this.isEnded = true;
102
+ this.isStarted = false;
103
+
104
+ // The idea of using types is to enrich telemetry data
105
+ this.stopTrackingMessage = this.createTrackingMessage(payload, "botMessage");
106
+ // calculating elapsed time
107
+ const elapsedTime = (((_this$stopTrackingMes = this.stopTrackingMessage) === null || _this$stopTrackingMes === void 0 ? void 0 : _this$stopTrackingMes.checkTime) ?? 0) - (((_this$startTrackingMe = this.startTrackingMessage) === null || _this$startTrackingMe === void 0 ? void 0 : _this$startTrackingMe.checkTime) ?? 0);
108
+ TelemetryHelper.logActionEvent(LogLevel.INFO, {
109
+ Event: TelemetryEvent.MessageLapTrack,
110
+ Description: "First response latency tracking",
128
111
  CustomProperties: {
129
- payload: payload
112
+ elapsedTime,
113
+ userMessage: this.startTrackingMessage,
114
+ botMessage: this.stopTrackingMessage
130
115
  }
131
116
  });
132
117
  }
133
- }
134
- stopClock(payload) {
135
- try {
136
- if (!payload || !payload.Id) {
137
- throw new Error("Invalid payload");
118
+
119
+ // mechanism to ensure we track only allowed conversations
120
+ }, {
121
+ key: "isMessageFromValidSender",
122
+ value: function isMessageFromValidSender(payload) {
123
+ var _payload$tags2;
124
+ // agent scenario
125
+ if (payload !== null && payload !== void 0 && (_payload$tags2 = payload.tags) !== null && _payload$tags2 !== void 0 && _payload$tags2.includes("public")) {
126
+ this.handleAgentMessage(payload);
127
+ return false;
138
128
  }
139
- if (!this.isMessageFromValidSender(payload)) return;
140
- if (this.isABotConversation && this.isStarted) {
141
- this.stopTracking(payload);
129
+ return true;
130
+ }
131
+ }, {
132
+ key: "startClock",
133
+ value: function startClock(payload) {
134
+ try {
135
+ if (!payload || !payload.Id) {
136
+ throw new Error("Invalid payload");
137
+ }
138
+ this.startTracking(payload);
139
+ } catch (e) {
140
+ TelemetryHelper.logActionEvent(LogLevel.ERROR, {
141
+ Event: TelemetryEvent.MessageStartLapTrackError,
142
+ Description: "Error while starting the clock",
143
+ ExceptionDetails: e,
144
+ CustomProperties: {
145
+ payload: payload
146
+ }
147
+ });
142
148
  }
143
- } catch (e) {
144
- console.error("FRL : error while trying to stop the tracker", e);
145
- TelemetryHelper.logActionEvent(LogLevel.ERROR, {
146
- Event: TelemetryEvent.MessageStopLapTrackError,
147
- Description: "Error while stopping the clock",
148
- ExceptionDetails: e,
149
- CustomProperties: {
150
- payload: payload
149
+ }
150
+ }, {
151
+ key: "stopClock",
152
+ value: function stopClock(payload) {
153
+ try {
154
+ if (!payload || !payload.Id) {
155
+ throw new Error("Invalid payload");
151
156
  }
152
- });
153
- //reset state
154
- this.startTrackingMessage = undefined;
155
- this.stopTrackingMessage = undefined;
157
+ if (!this.isMessageFromValidSender(payload)) return;
158
+ if (this.isABotConversation && this.isStarted) {
159
+ this.stopTracking(payload);
160
+ }
161
+ } catch (e) {
162
+ console.error("FRL : error while trying to stop the tracker", e);
163
+ TelemetryHelper.logActionEvent(LogLevel.ERROR, {
164
+ Event: TelemetryEvent.MessageStopLapTrackError,
165
+ Description: "Error while stopping the clock",
166
+ ExceptionDetails: e,
167
+ CustomProperties: {
168
+ payload: payload
169
+ }
170
+ });
171
+ //reset state
172
+ this.startTrackingMessage = undefined;
173
+ this.stopTrackingMessage = undefined;
174
+ this.isStarted = false;
175
+ this.isEnded = false;
176
+ }
177
+ }
178
+ }, {
179
+ key: "deregister",
180
+ value: function deregister() {
181
+ // Reset State
182
+ this.isABotConversation = false;
156
183
  this.isStarted = false;
157
184
  this.isEnded = false;
185
+ this.startTrackingMessage = undefined;
186
+ this.stopTrackingMessage = undefined;
187
+ this.offlineNetworkListener.unsubscribe();
188
+ this.fmltrackingListener.unsubscribe();
189
+ this.rehydrateListener.unsubscribe();
190
+ this.historyListener.unsubscribe();
158
191
  }
159
- }
160
- deregister() {
161
- // Reset State
162
- this.isABotConversation = false;
163
- this.isStarted = false;
164
- this.isEnded = false;
165
- this.startTrackingMessage = undefined;
166
- this.stopTrackingMessage = undefined;
167
- this.offlineNetworkListener.unsubscribe();
168
- this.fmltrackingListener.unsubscribe();
169
- this.rehydrateListener.unsubscribe();
170
- this.historyListener.unsubscribe();
171
- }
172
- }
192
+ }]);
193
+ return FirstResponseLatencyTracker;
194
+ }();