@axos-web-dev/shared-components 2.2.6 → 2.2.7

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 (200) hide show
  1. package/dist/ATMLocator/ATMLocator.d.ts +1 -1
  2. package/dist/ATMLocator/ATMLocator.js +2 -2
  3. package/dist/Accordion/Accordion.d.ts +3 -3
  4. package/dist/Article/Article.d.ts +1 -1
  5. package/dist/Auth/ErrorAlert.d.ts +1 -1
  6. package/dist/Auth/ErrorAlert.js +3 -3
  7. package/dist/Auth/Logout.d.ts +1 -1
  8. package/dist/Auth/SignInPassword.d.ts +1 -1
  9. package/dist/BulletItem/BulletItem.d.ts +1 -1
  10. package/dist/Button/Button.d.ts +1 -1
  11. package/dist/Button/Button.js +2 -2
  12. package/dist/Button/GoBackButton.d.ts +1 -1
  13. package/dist/Calculators/Calculator.d.ts +1 -1
  14. package/dist/Calculators/Calculator.js +3 -3
  15. package/dist/Calculators/MarginTradingCalculator/index.js +2 -2
  16. package/dist/Carousel/index.d.ts +3 -3
  17. package/dist/Carousel/index.js +2 -2
  18. package/dist/Chatbot/AnimatedGradientBorder.css.d.ts +5 -0
  19. package/dist/Chatbot/AnimatedGradientBorder.css.js +13 -3
  20. package/dist/Chatbot/Bubble.css.js +1 -0
  21. package/dist/Chatbot/Bubble.d.ts +1 -1
  22. package/dist/Chatbot/Chat.d.ts +1 -0
  23. package/dist/Chatbot/Chat.js +158 -0
  24. package/dist/Chatbot/ChatWindow.css.d.ts +6 -0
  25. package/dist/Chatbot/ChatWindow.css.js +47 -35
  26. package/dist/Chatbot/ChatWindow.js +134 -68
  27. package/dist/Chatbot/Chatbot.css.js +0 -1
  28. package/dist/Chatbot/Chatbot.css.ts.vanilla.css.js +1 -0
  29. package/dist/Chatbot/Chatbot.d.ts +1 -1
  30. package/dist/Chatbot/Chatbot.js +47 -20
  31. package/dist/Chatbot/ChatbotMessage.js +184 -159
  32. package/dist/Chatbot/EllipsisAnimation.d.ts +1 -1
  33. package/dist/Chatbot/EllipsisAnimation.js +0 -6
  34. package/dist/Chatbot/EllipsisIcon.d.ts +1 -1
  35. package/dist/Chatbot/index.js +7 -1
  36. package/dist/Chatbot/useHeadlessChat.d.ts +27 -0
  37. package/dist/Chatbot/useHeadlessChat.js +240 -0
  38. package/dist/Chevron/index.js +2 -2
  39. package/dist/Comparison/Comparison.d.ts +1 -1
  40. package/dist/Comparison/Comparison.js +2 -2
  41. package/dist/Comparison/ComparisonSet.d.ts +1 -1
  42. package/dist/ExecutiveBio/ExecutiveBio.d.ts +1 -1
  43. package/dist/ExecutiveBio/ExecutiveBio.js +2 -2
  44. package/dist/ExecutiveBio/ExecutiveBioSet.d.ts +1 -1
  45. package/dist/ExecutiveBio/Overlay.d.ts +1 -1
  46. package/dist/FaqAccordion/index.d.ts +5 -5
  47. package/dist/FaqAccordion/index.js +2 -2
  48. package/dist/FdicCallout/index.d.ts +1 -1
  49. package/dist/FooterDisclosure/FooterDisclosure.d.ts +4 -4
  50. package/dist/FooterDisclosure/LVF/LaVictorieFooter.d.ts +1 -1
  51. package/dist/FooterSiteMap/AxosBank/FooterSiteMap.d.ts +1 -1
  52. package/dist/FooterSiteMap/AxosBank/FooterSiteMap.js +2 -2
  53. package/dist/Forms/ApplicationStart.d.ts +1 -1
  54. package/dist/Forms/ApplyNow.d.ts +1 -1
  55. package/dist/Forms/ApplyNow.js +2 -2
  56. package/dist/Forms/BoatMooringLocation.d.ts +1 -1
  57. package/dist/Forms/ClearingForm.d.ts +1 -1
  58. package/dist/Forms/CommercialDeposits.d.ts +1 -1
  59. package/dist/Forms/CommercialDepositsNoLendingOption.d.ts +1 -1
  60. package/dist/Forms/CommercialLending.d.ts +1 -1
  61. package/dist/Forms/CommercialPremiumFinance.d.ts +1 -1
  62. package/dist/Forms/ConstructionLendingDynamic.d.ts +1 -1
  63. package/dist/Forms/ContactCompany.d.ts +1 -1
  64. package/dist/Forms/ContactCompanyTitle.d.ts +1 -1
  65. package/dist/Forms/ContactUs.d.ts +1 -1
  66. package/dist/Forms/ContactUsAAS.d.ts +1 -1
  67. package/dist/Forms/ContactUsBusiness.d.ts +1 -1
  68. package/dist/Forms/ContactUsBusiness.js +2 -2
  69. package/dist/Forms/ContactUsBusinessNameEmail.d.ts +1 -1
  70. package/dist/Forms/ContactUsBusinessNameEmail.js +2 -2
  71. package/dist/Forms/ContactUsLVF.d.ts +1 -1
  72. package/dist/Forms/ContactUsNMLSId.d.ts +1 -1
  73. package/dist/Forms/ContactUsNMLSId.js +2 -2
  74. package/dist/Forms/ContactUsSchwabAAS.d.ts +1 -1
  75. package/dist/Forms/CpraRequest.d.ts +1 -1
  76. package/dist/Forms/CpraRequest.js +2 -2
  77. package/dist/Forms/CraPublicFile.d.ts +1 -1
  78. package/dist/Forms/CraPublicFile.js +2 -2
  79. package/dist/Forms/DealerServices.d.ts +1 -1
  80. package/dist/Forms/EmailOnly.d.ts +1 -1
  81. package/dist/Forms/EmailOnly.js +2 -2
  82. package/dist/Forms/EmailUs.d.ts +1 -1
  83. package/dist/Forms/HoneyPot/index.d.ts +1 -1
  84. package/dist/Forms/MortgageRate/MortgageRateForm.d.ts +1 -1
  85. package/dist/Forms/MortgageRate/MortgageRateForm.js +2 -2
  86. package/dist/Forms/MortgageRate/MortgageRateQuoteFilters.d.ts +1 -1
  87. package/dist/Forms/MortgageRate/MortgageRateWatch.d.ts +1 -1
  88. package/dist/Forms/MortgageRate/MortgageRateWatch.js +2 -2
  89. package/dist/Forms/MortgageWarehouseLending.d.ts +2 -2
  90. package/dist/Forms/MortgageWarehouseLending.js +9 -9
  91. package/dist/Forms/QuickPricer/QuickPricerForm.d.ts +1 -1
  92. package/dist/Forms/QuickPricer/UserInformation.d.ts +1 -1
  93. package/dist/Forms/ScheduleCall.d.ts +1 -1
  94. package/dist/Forms/ScheduleCallPremier.d.ts +1 -1
  95. package/dist/Forms/SuccesForm.d.ts +1 -1
  96. package/dist/Forms/SuccesForm.js +3 -3
  97. package/dist/Forms/VendorQuestionnaire.d.ts +1 -1
  98. package/dist/Forms/WcplSurvey.d.ts +1 -1
  99. package/dist/HeroBanner/HeroBanner.d.ts +1 -1
  100. package/dist/HeroBanner/HeroVideoPoster.d.ts +1 -1
  101. package/dist/HeroBanner/LargeHeroBanner.d.ts +1 -1
  102. package/dist/Hyperlink/index.js +2 -2
  103. package/dist/IconBillboard/IconBillboard.d.ts +1 -1
  104. package/dist/IconBillboard/IconBillboardSet.d.ts +1 -1
  105. package/dist/IconBillboard/sections/CallToActionSection.d.ts +1 -1
  106. package/dist/IconBillboard/sections/HeaderSection.d.ts +2 -2
  107. package/dist/IconBillboard/sections/IconSection.d.ts +1 -1
  108. package/dist/IconBillboard/sections/ItemsSection.d.ts +1 -1
  109. package/dist/IconBillboard/sections/LayoutSection.d.ts +1 -1
  110. package/dist/ImageBillboard/ExitIntentModal/ModalWrapper.d.ts +1 -1
  111. package/dist/ImageBillboard/ImageBillboard.d.ts +1 -1
  112. package/dist/ImageBillboard/ImageBillboardSet.d.ts +1 -1
  113. package/dist/ImageLink/ImageLink.d.ts +1 -1
  114. package/dist/ImageLink/ImageLink.js +2 -2
  115. package/dist/ImageLink/ImageLinkSet.d.ts +1 -1
  116. package/dist/ImageLink/ImageLinkSet.js +2 -2
  117. package/dist/ImageLink/index.js +2 -2
  118. package/dist/ImageWrapper/ImageWrapper.d.ts +1 -1
  119. package/dist/Insight/Featured/CategorySelector.d.ts +2 -2
  120. package/dist/Insight/Featured/CategorySelector.js +2 -2
  121. package/dist/Insight/Featured/Featured.d.ts +2 -2
  122. package/dist/Insight/Featured/Featured.js +2 -2
  123. package/dist/Insight/Featured/Header.d.ts +1 -1
  124. package/dist/Insight/Featured/Header.js +2 -2
  125. package/dist/LandingPageHeader/LandingPageHeader.d.ts +1 -1
  126. package/dist/LoadingIndicator/index.d.ts +1 -1
  127. package/dist/MainHTML/index.d.ts +1 -1
  128. package/dist/Modal/Modal.js +2 -2
  129. package/dist/Modal/contextApi/store.d.ts +1 -4
  130. package/dist/Modal/contextApi/store.js +34 -3
  131. package/dist/NavigationMenu/AxosALTS/index.d.ts +1 -1
  132. package/dist/NavigationMenu/AxosALTS/index.js +2 -2
  133. package/dist/NavigationMenu/AxosAdvisor/SubNavBar.d.ts +1 -1
  134. package/dist/NavigationMenu/AxosAdvisor/index.d.ts +1 -1
  135. package/dist/NavigationMenu/AxosAdvisorServices/SubNavBar.d.ts +1 -1
  136. package/dist/NavigationMenu/AxosAdvisorServices/index.d.ts +1 -1
  137. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileMenu.d.ts +1 -1
  138. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileMenu.js +2 -2
  139. package/dist/NavigationMenu/AxosBank/SubNavBar.d.ts +1 -1
  140. package/dist/NavigationMenu/AxosBank/SubNavBar.js +2 -2
  141. package/dist/NavigationMenu/AxosBank/index.d.ts +1 -1
  142. package/dist/NavigationMenu/AxosBank/index.js +3 -2
  143. package/dist/NavigationMenu/AxosClearing/SubNavBar.d.ts +1 -1
  144. package/dist/NavigationMenu/AxosClearing/index.d.ts +1 -1
  145. package/dist/NavigationMenu/AxosFiduciary/index.d.ts +1 -1
  146. package/dist/NavigationMenu/LaVictoire/SubNavBar.d.ts +1 -1
  147. package/dist/NavigationMenu/LaVictoire/index.d.ts +1 -1
  148. package/dist/NavigationMenu/LaVictoire/index.js +2 -2
  149. package/dist/NavigationMenu/NavItem/index.d.ts +1 -1
  150. package/dist/NavigationMenu/Navbar.d.ts +1 -1
  151. package/dist/NavigationMenu/Navbar.js +2 -2
  152. package/dist/NavigationMenu/SignInNavButton.d.ts +1 -3
  153. package/dist/NavigationMenu/SignInNavButton.js +3 -2
  154. package/dist/Pagination/Pagination.d.ts +1 -1
  155. package/dist/SecondaryFooter/index.d.ts +1 -1
  156. package/dist/SetContainer/SetContainer.d.ts +1 -1
  157. package/dist/SetContainer/SetContainer.js +2 -2
  158. package/dist/SocialMediaBar/iconsRepository.d.ts +14 -14
  159. package/dist/SocialMediaBar/iconsRepository.js +2 -2
  160. package/dist/SocialMediaBar/index.d.ts +1 -1
  161. package/dist/Tab/Tab.d.ts +1 -1
  162. package/dist/Tab/TabContainer.d.ts +1 -1
  163. package/dist/Table/Table.d.ts +5 -5
  164. package/dist/TextBlock/TextBlock.d.ts +1 -1
  165. package/dist/Topic/Topic.d.ts +4 -4
  166. package/dist/VideoTile/VideoInit.d.ts +1 -1
  167. package/dist/VideoTile/VideoTile.js +2 -2
  168. package/dist/VideoWrapper/index.js +2 -2
  169. package/dist/WalnutIframe/index.d.ts +1 -1
  170. package/dist/assets/Chatbot/AnimatedGradientBorder.css +99 -12
  171. package/dist/assets/Chatbot/Bubble.css +26 -7
  172. package/dist/assets/Chatbot/ChatWindow.css +155 -74
  173. package/dist/assets/globals.css +3 -0
  174. package/dist/icons/AxosX/Blue.d.ts +1 -1
  175. package/dist/icons/AxosX/index.d.ts +1 -1
  176. package/dist/icons/CheckCircle.d.ts +1 -1
  177. package/dist/icons/CheckCircleLight.d.ts +1 -1
  178. package/dist/icons/CheckIcon/index.d.ts +1 -1
  179. package/dist/icons/ChevronDown.d.ts +1 -1
  180. package/dist/icons/ChevronUp.d.ts +1 -1
  181. package/dist/icons/Clock/index.d.ts +1 -1
  182. package/dist/icons/EqualHousingLender.d.ts +1 -1
  183. package/dist/icons/Logos/AAS.d.ts +1 -1
  184. package/dist/icons/Logos/AFS.d.ts +1 -1
  185. package/dist/icons/Logos/AXA.d.ts +1 -1
  186. package/dist/icons/Logos/AXB.d.ts +1 -1
  187. package/dist/icons/Logos/AXC.d.ts +1 -1
  188. package/dist/icons/Logos/AXI.d.ts +1 -1
  189. package/dist/icons/Logos/AXOS.d.ts +1 -1
  190. package/dist/icons/Logos/GBLVF.d.ts +1 -1
  191. package/dist/icons/Logos/LVF.d.ts +1 -1
  192. package/dist/icons/Logos/LVFText.d.ts +1 -1
  193. package/dist/icons/Logos/SPB.d.ts +1 -1
  194. package/dist/icons/MemberFdicLogo.d.ts +1 -1
  195. package/dist/icons/QuoteIconGrey.d.ts +1 -1
  196. package/dist/icons/QuoteIconWhite.d.ts +1 -1
  197. package/dist/icons/QuoteIconYellow.d.ts +1 -1
  198. package/dist/main.js +7 -1
  199. package/package.json +147 -147
  200. package/dist/assets/Chatbot/Chatbot.css +0 -3
@@ -1,42 +1,48 @@
1
- import '../assets/Chatbot/ChatWindow.css';import '../assets/Chatbot/Chatbot.css';import '../assets/themes/victorie.css';import '../assets/themes/ufb.css';import '../assets/themes/premier.css';import '../assets/themes/axos.css';/* empty css */
1
+ import '../assets/Chatbot/ChatWindow.css';import '../assets/Typography/Typography.css';import '../assets/themes/victorie.css';import '../assets/themes/ufb.css';import '../assets/themes/premier.css';import '../assets/themes/axos.css';/* empty css */
2
2
  /* empty css */
3
3
  /* empty css */
4
4
  /* empty css */
5
- /* empty css */
5
+ /* empty css */
6
6
  /* empty css */
7
- var windowStyle = "_13n1jqk0";
8
- var windowExpandedStyle = "_13n1jqk1";
9
- var expandToggleStyle = "_13n1jqk2";
10
- var windowOpenStyle = "_13n1jqk3";
11
- var windowBarStyle = "_13n1jqk4";
12
- var left_bar_section = "_13n1jqk5";
13
- var chat_title = "_13n1jqk6";
14
- var buttonss_section = "_13n1jqk7";
15
- var button_bar = "_13n1jqk8";
16
- var button_reset = "_13n1jqk9";
17
- var arrowFill = "_13n1jqka";
18
- var inputStyle = "_13n1jqkb";
19
- var autoResize = "_13n1jqkc";
20
- var sendButtonStyle = "_13n1jqkd";
21
- var messagesContainerStyle = "_13n1jqke";
22
- var notificationStyle = "_13n1jqkf";
23
- var messageStyle = "_13n1jqkg";
24
- var inline_button_wrapper = "_13n1jqkh";
25
- var inline_button = "_13n1jqki";
26
- var endChatButtonStyle = "_13n1jqkj";
27
- var noAnswerButton = "_13n1jqkk";
28
- var chatbotMenu = "_13n1jqkl";
29
- var chatbotMenuItem = "_13n1jqkm";
30
- var chatNetworkStatus = "_13n1jqkn";
31
- var chatEndDialogOverlay = "_13n1jqko";
32
- var chatFinishDialog = "_13n1jqkp";
33
- var thankyou_overlay = "_13n1jqkq";
34
- var thankyou_message = "_13n1jqkr";
35
- var thankyou_image = "_13n1jqks";
36
- var chatEndCircle = "_13n1jqkt";
37
- var user_msg = "_13n1jqku";
38
- var agent_msg = "_13n1jqkv";
39
- var shimmerText = "_13n1jqkx";
7
+ var windowStyle = "_13n1jqk1";
8
+ var windowExpandedStyle = "_13n1jqk2";
9
+ var expandToggleStyle = "_13n1jqk3";
10
+ var windowOpenStyle = "_13n1jqk4";
11
+ var windowBarStyle = "_13n1jqk5";
12
+ var left_bar_section = "_13n1jqk6";
13
+ var chat_title = "_13n1jqk7";
14
+ var buttonss_section = "_13n1jqk8";
15
+ var button_bar = "_13n1jqk9";
16
+ var button_reset = "_13n1jqka";
17
+ var arrowFill = "_13n1jqkb";
18
+ var inputStyle = "_13n1jqkc";
19
+ var autoResize = "_13n1jqkd";
20
+ var chatAiDisclaimer = "_13n1jqke";
21
+ var sendButtonStyle = "_13n1jqkf";
22
+ var messagesContainerStyle = "_13n1jqkg";
23
+ var notificationStyle = "_13n1jqkh";
24
+ var messageStyle = "_13n1jqki";
25
+ var inline_button_wrapper = "_13n1jqkj";
26
+ var inline_button = "_13n1jqkk";
27
+ var endChatButtonStyle = "_13n1jqkl";
28
+ var noAnswerButton = "_13n1jqkm";
29
+ var chatbotMenu = "_13n1jqkn";
30
+ var chatbotMenuItem = "_13n1jqko";
31
+ var chatNetworkStatus = "_13n1jqkp";
32
+ var chatEndDialogOverlay = "_13n1jqkq";
33
+ var chatFinishDialog = "_13n1jqkr";
34
+ var thankyou_overlay = "_13n1jqks";
35
+ var thankyou_message = "_13n1jqkt";
36
+ var thankyou_image = "_13n1jqku";
37
+ var chatEndCircle = "_13n1jqkv";
38
+ var user_msg = "_13n1jqkw";
39
+ var agent_msg = "_13n1jqkx";
40
+ var shimmerText = "_13n1jqkz";
41
+ var tableMsg = "_13n1jqk10";
42
+ var tableHead = "_13n1jqk11";
43
+ var tableCell = "_13n1jqk12";
44
+ var trMortgageTable = "_13n1jqk13";
45
+ var formTextButton = "_13n1jqk14";
40
46
  export {
41
47
  agent_msg,
42
48
  arrowFill,
@@ -44,6 +50,7 @@ export {
44
50
  button_bar,
45
51
  button_reset,
46
52
  buttonss_section,
53
+ chatAiDisclaimer,
47
54
  chatEndCircle,
48
55
  chatEndDialogOverlay,
49
56
  chatFinishDialog,
@@ -53,6 +60,7 @@ export {
53
60
  chatbotMenuItem,
54
61
  endChatButtonStyle,
55
62
  expandToggleStyle,
63
+ formTextButton,
56
64
  inline_button,
57
65
  inline_button_wrapper,
58
66
  inputStyle,
@@ -63,9 +71,13 @@ export {
63
71
  notificationStyle,
64
72
  sendButtonStyle,
65
73
  shimmerText,
74
+ tableCell,
75
+ tableHead,
76
+ tableMsg,
66
77
  thankyou_image,
67
78
  thankyou_message,
68
79
  thankyou_overlay,
80
+ trMortgageTable,
69
81
  user_msg,
70
82
  windowBarStyle,
71
83
  windowExpandedStyle,
@@ -1,16 +1,17 @@
1
1
  "use client";
2
2
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
3
+ import { LoadingIndicator } from "../LoadingIndicator/index.js";
3
4
  import { vars } from "../themes/axos.css.js";
4
5
  import '../assets/themes/victorie.css';import '../assets/themes/ufb.css';import '../assets/themes/premier.css';import '../assets/themes/axos.css';/* empty css */
5
6
  /* empty css */
6
7
  /* empty css */
7
8
  /* empty css */
8
9
  import clsx from "clsx";
9
- import React, { useRef, useEffect } from "react";
10
+ import React, { useRef, useState, useEffect } from "react";
10
11
  import { useNetworkState, useMount } from "react-use";
11
- import { gradientFocus } from "./AnimatedGradientBorder.css.js";
12
+ import { focusAnimation, gradientFocus } from "./AnimatedGradientBorder.css.js";
12
13
  import { ChatbotMessage } from "./ChatbotMessage.js";
13
- import { windowBarStyle, left_bar_section, chat_title, button_bar, chatbotMenuItem, chatbotMenu, chatEndDialogOverlay, chatFinishDialog, chatEndCircle, endChatButtonStyle, noAnswerButton, arrowFill, button_reset, buttonss_section, chatNetworkStatus, shimmerText, messagesContainerStyle, inputStyle, autoResize, sendButtonStyle, windowStyle, windowOpenStyle, windowExpandedStyle } from "./ChatWindow.css.js";
14
+ import { windowBarStyle, left_bar_section, chat_title, button_bar, chatbotMenuItem, chatbotMenu, chatEndDialogOverlay, chatFinishDialog, chatEndCircle, endChatButtonStyle, noAnswerButton, arrowFill, button_reset, buttonss_section, chatNetworkStatus, shimmerText, messagesContainerStyle, formTextButton, inputStyle, autoResize, sendButtonStyle, chatAiDisclaimer, windowStyle, windowOpenStyle, windowExpandedStyle } from "./ChatWindow.css.js";
14
15
  import { EllipsisIcon } from "./EllipsisIcon.js";
15
16
  import { ExpandChatToggle } from "./ExpandChatToggle.js";
16
17
  import { useOpenChat } from "./store/chat.js";
@@ -40,12 +41,13 @@ const ChatWindow = ({
40
41
  }) => {
41
42
  const {
42
43
  showThankyouMessage,
43
- displayThankyouMessage,
44
44
  toggleThankyouMessage,
45
45
  hasEscalated,
46
46
  isBlockedInput,
47
47
  isOpen,
48
48
  hasOpenedOnce,
49
+ chatStatus,
50
+ setChatStatus,
49
51
  isWindowExpanded,
50
52
  toggleWindowExpanded
51
53
  } = useOpenChat();
@@ -56,6 +58,7 @@ const ChatWindow = ({
56
58
  const [input, setInput] = React.useState("");
57
59
  const messagesEndRef = useRef(null);
58
60
  const inputRef = useRef(null);
61
+ const [focused, setFocused] = useState(false);
59
62
  useEffect(() => {
60
63
  messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });
61
64
  }, [messages]);
@@ -86,9 +89,6 @@ const ChatWindow = ({
86
89
  useEffect(() => {
87
90
  autoResizeTextarea();
88
91
  }, [input]);
89
- const displayThankYouScreen = () => {
90
- displayThankyouMessage();
91
- };
92
92
  const onCancelEndChat = () => {
93
93
  setShowEndChatDialog(false);
94
94
  toggleThankyouMessage?.();
@@ -136,6 +136,7 @@ const ChatWindow = ({
136
136
  height: "17",
137
137
  viewBox: "0 0 20 17",
138
138
  fill: "none",
139
+ "aria-hidden": "true",
139
140
  children: [
140
141
  /* @__PURE__ */ jsx(
141
142
  "path",
@@ -182,7 +183,9 @@ const ChatWindow = ({
182
183
  alignContent: "center",
183
184
  background: menuOpen ? "#0000000f" : void 0
184
185
  },
185
- children: /* @__PURE__ */ jsx(EllipsisIcon, {})
186
+ "aria-label": "end chat with evo ai",
187
+ title: "end chat",
188
+ children: /* @__PURE__ */ jsx(EllipsisIcon, { color: vars.chatbot.window.headerText })
186
189
  }
187
190
  ),
188
191
  menuOpen && /* @__PURE__ */ jsx("ul", { className: clsx(chatbotMenu), children: /* @__PURE__ */ jsx("li", { className: chatbotMenuItem, children: /* @__PURE__ */ jsxs(
@@ -214,7 +217,7 @@ const ChatWindow = ({
214
217
  "path",
215
218
  {
216
219
  d: "M11.1236 5.37374L8.60278 7.89457L11.1236 10.4167L10.4166 11.1237L7.89445 8.6029L5.37362 11.1237L4.66658 10.4167L7.18742 7.89457L4.66658 5.37374L5.37362 4.66671L7.89445 7.18754L10.4166 4.66671L11.1236 5.37374Z",
217
- fill: "#1E3860"
220
+ fill: vars.chatbot.window.headerText
218
221
  }
219
222
  ),
220
223
  /* @__PURE__ */ jsx(
@@ -223,7 +226,7 @@ const ChatWindow = ({
223
226
  fillRule: "evenodd",
224
227
  clipRule: "evenodd",
225
228
  d: "M13.3333 0.833374C14.3458 0.833374 15.1666 1.65419 15.1666 2.66671V13.3334C15.1666 14.3459 14.3458 15.1667 13.3333 15.1667H2.66659C1.65406 15.1667 0.833252 14.3459 0.833252 13.3334V2.66671C0.833252 1.65419 1.65406 0.833374 2.66659 0.833374H13.3333ZM2.66659 1.83337C2.20635 1.83337 1.83325 2.20647 1.83325 2.66671V13.3334C1.83325 13.7936 2.20635 14.1667 2.66659 14.1667H13.3333C13.7935 14.1667 14.1666 13.7936 14.1666 13.3334V2.66671C14.1666 2.20647 13.7935 1.83337 13.3333 1.83337H2.66659Z",
226
- fill: "#1E3860"
229
+ fill: vars.chatbot.window.headerText
227
230
  }
228
231
  )
229
232
  ] }),
@@ -310,7 +313,7 @@ const ChatWindow = ({
310
313
  type: "submit",
311
314
  onClick: () => {
312
315
  endChat();
313
- displayThankYouScreen();
316
+ setChatStatus("ending");
314
317
  setShowEndChatDialog(false);
315
318
  },
316
319
  children: "Yes, End Chat"
@@ -333,6 +336,45 @@ const ChatWindow = ({
333
336
  " "
334
337
  ] }) })
335
338
  ] }),
339
+ chatStatus == "ending" && /* @__PURE__ */ jsxs("div", { children: [
340
+ /* @__PURE__ */ jsx(
341
+ "div",
342
+ {
343
+ style: {
344
+ background: "#00000080",
345
+ position: "fixed",
346
+ top: 0,
347
+ left: 0,
348
+ right: 0,
349
+ bottom: 0,
350
+ zIndex: 999
351
+ }
352
+ }
353
+ ),
354
+ /* @__PURE__ */ jsx(
355
+ "div",
356
+ {
357
+ style: {
358
+ position: "fixed",
359
+ top: 0,
360
+ left: 0,
361
+ right: 0,
362
+ bottom: 0,
363
+ zIndex: 1e3,
364
+ display: "flex",
365
+ justifyContent: "center",
366
+ alignItems: "center"
367
+ },
368
+ children: /* @__PURE__ */ jsx(
369
+ LoadingIndicator,
370
+ {
371
+ variant: "primary",
372
+ style: { borderTopColor: vars.chatbot.bubble.glowShadow }
373
+ }
374
+ )
375
+ }
376
+ )
377
+ ] }),
336
378
  /* @__PURE__ */ jsx(
337
379
  ThankYouMessage,
338
380
  {
@@ -436,7 +478,7 @@ const ChatWindow = ({
436
478
  fontSize: 14,
437
479
  display: "flex",
438
480
  flexDirection: "column",
439
- gap: 4
481
+ gap: 16
440
482
  },
441
483
  children: /* @__PURE__ */ jsx("p", { className: shimmerText, children: "Chat connecting..." })
442
484
  }
@@ -476,71 +518,95 @@ const ChatWindow = ({
476
518
  ),
477
519
  /* @__PURE__ */ jsx("div", { ref: messagesEndRef })
478
520
  ] }),
479
- /* @__PURE__ */ jsx("div", { style: { padding: "16px 16px 24px 16px" }, children: /* @__PURE__ */ jsx("form", { onSubmit: handleSend, className: clsx(gradientFocus), children: /* @__PURE__ */ jsxs(
480
- "div",
481
- {
482
- style: {
483
- display: "flex",
484
- padding: "12px 16px",
485
- background: isBlockedInput || inputDisabled || status !== "connected" || messages.length == 0 || escalationDeflected ? "light-dark(rgba(239, 239, 239, 0.3), rgba(59, 59, 59, 0.3))" : "#ffffff",
486
- borderRadius: 12
487
- },
488
- children: [
489
- /* @__PURE__ */ jsx(
490
- "textarea",
491
- {
492
- ref: inputRef,
493
- value: input,
494
- onChange: (e) => setInput(e.target.value),
495
- onKeyDown: (e) => {
496
- if (hasEscalated) {
497
- previewTyping(e.target?.value);
498
- }
499
- if (e.key === "Enter" && !e.shiftKey) {
500
- handleSend(e);
501
- }
502
- },
503
- placeholder: "Ask anything...",
504
- className: clsx(inputStyle, autoResize),
505
- autoFocus: true,
506
- disabled: isBlockedInput || inputDisabled || status !== "connected" || messages.length == 0 || escalationDeflected,
507
- rows: 1
521
+ /* @__PURE__ */ jsxs("div", { style: { padding: "16px 16px 24px 16px" }, children: [
522
+ /* @__PURE__ */ jsxs("form", { onSubmit: handleSend, className: clsx(gradientFocus), children: [
523
+ /* @__PURE__ */ jsx(
524
+ "div",
525
+ {
526
+ className: clsx(
527
+ focused && !inputDisabled && !isBlockedInput ? focusAnimation : ""
528
+ ),
529
+ style: {
530
+ position: "absolute",
531
+ left: "10%",
532
+ width: "80%",
533
+ height: "40px",
534
+ zIndex: "-1"
508
535
  }
509
- ),
510
- /* @__PURE__ */ jsx(
511
- "button",
512
- {
513
- className: clsx(
514
- sendButtonStyle,
515
- input.trim().length > 0 && "active"
536
+ }
537
+ ),
538
+ /* @__PURE__ */ jsxs(
539
+ "div",
540
+ {
541
+ className: formTextButton,
542
+ style: {
543
+ display: "flex",
544
+ padding: "12px 16px",
545
+ background: isBlockedInput || inputDisabled || status !== "connected" || messages.length == 0 || escalationDeflected ? "light-dark(rgba(239, 239, 239, 0.3), rgba(59, 59, 59, 0.3))" : "#ffffff",
546
+ borderRadius: 12
547
+ },
548
+ children: [
549
+ /* @__PURE__ */ jsx(
550
+ "textarea",
551
+ {
552
+ ref: inputRef,
553
+ value: input,
554
+ onChange: (e) => setInput(e.target.value),
555
+ onKeyDown: (e) => {
556
+ if (hasEscalated) {
557
+ previewTyping(e.target?.value);
558
+ }
559
+ if (e.key === "Enter" && !e.shiftKey) {
560
+ handleSend(e);
561
+ }
562
+ },
563
+ onFocus: () => setFocused(() => true),
564
+ onBlur: () => setFocused(() => false),
565
+ placeholder: "Ask anything...",
566
+ "aria-label": "Ask anything...",
567
+ className: clsx(inputStyle, autoResize),
568
+ autoFocus: true,
569
+ disabled: isBlockedInput || inputDisabled || status !== "connected" || messages.length == 0 || escalationDeflected,
570
+ rows: 1
571
+ }
516
572
  ),
517
- type: "submit",
518
- title: "Send message",
519
- disabled: isBlockedInput || inputDisabled || status !== "connected" || !input.trim() || messages.length == 0 || escalationDeflected,
520
- children: /* @__PURE__ */ jsx(
521
- "svg",
573
+ /* @__PURE__ */ jsx(
574
+ "button",
522
575
  {
523
- xmlns: "http://www.w3.org/2000/svg",
524
- width: "16",
525
- height: "16",
526
- viewBox: "0 0 16 16",
527
- fill: "none",
576
+ className: clsx(
577
+ sendButtonStyle,
578
+ input.trim().length > 0 && "active"
579
+ ),
580
+ type: "submit",
581
+ title: "Send message",
582
+ disabled: isBlockedInput || inputDisabled || status !== "connected" || !input.trim() || messages.length == 0 || escalationDeflected,
528
583
  children: /* @__PURE__ */ jsx(
529
- "path",
584
+ "svg",
530
585
  {
531
- fillRule: "evenodd",
532
- clipRule: "evenodd",
533
- d: "M0.0030533 5.42479C0.0273417 5.1795 0.193529 4.9714 0.427369 4.89345L15.0114 0.0320896C15.236 -0.0427712 15.4836 0.0156801 15.651 0.183075C15.8184 0.35047 15.8769 0.598075 15.802 0.822659L10.9407 15.4067C10.8627 15.6406 10.6546 15.8068 10.4093 15.8311C10.164 15.8553 9.92737 15.7332 9.80508 15.5192L6.35411 9.47999L0.314925 6.02903C0.100912 5.90673 -0.0212351 5.67008 0.0030533 5.42479ZM7.59169 9.1263L9.64202 12.7144C9.85645 13.0896 10.4138 13.0344 10.5505 12.6244L13.9046 2.56191C14.0349 2.17103 13.6631 1.79916 13.2722 1.92946L3.20969 5.28362C2.79967 5.4203 2.74448 5.97766 3.11973 6.19209L6.70781 8.24242L9.90579 5.04443C10.1499 4.80036 10.5456 4.80036 10.7897 5.04443C11.0337 5.28851 11.0337 5.68424 10.7897 5.92832L7.59169 9.1263Z",
534
- fill: "#435164"
586
+ xmlns: "http://www.w3.org/2000/svg",
587
+ width: "20",
588
+ height: "20",
589
+ viewBox: "0 0 16 16",
590
+ fill: "none",
591
+ children: /* @__PURE__ */ jsx(
592
+ "path",
593
+ {
594
+ fillRule: "evenodd",
595
+ clipRule: "evenodd",
596
+ d: "M0.0030533 5.42479C0.0273417 5.1795 0.193529 4.9714 0.427369 4.89345L15.0114 0.0320896C15.236 -0.0427712 15.4836 0.0156801 15.651 0.183075C15.8184 0.35047 15.8769 0.598075 15.802 0.822659L10.9407 15.4067C10.8627 15.6406 10.6546 15.8068 10.4093 15.8311C10.164 15.8553 9.92737 15.7332 9.80508 15.5192L6.35411 9.47999L0.314925 6.02903C0.100912 5.90673 -0.0212351 5.67008 0.0030533 5.42479ZM7.59169 9.1263L9.64202 12.7144C9.85645 13.0896 10.4138 13.0344 10.5505 12.6244L13.9046 2.56191C14.0349 2.17103 13.6631 1.79916 13.2722 1.92946L3.20969 5.28362C2.79967 5.4203 2.74448 5.97766 3.11973 6.19209L6.70781 8.24242L9.90579 5.04443C10.1499 4.80036 10.5456 4.80036 10.7897 5.04443C11.0337 5.28851 11.0337 5.68424 10.7897 5.92832L7.59169 9.1263Z",
597
+ fill: "#435164"
598
+ }
599
+ )
535
600
  }
536
601
  )
537
602
  }
538
603
  )
539
- }
540
- )
541
- ]
542
- }
543
- ) }) })
604
+ ]
605
+ }
606
+ )
607
+ ] }),
608
+ /* @__PURE__ */ jsx("p", { className: chatAiDisclaimer, children: "Evo is AI and can make mistakes. Verify important details." })
609
+ ] })
544
610
  ]
545
611
  }
546
612
  );
@@ -1,4 +1,3 @@
1
- import '../assets/Chatbot/Chatbot.css';/* empty css */
2
1
  var chatbotAXB = "_1hpv6vm0";
3
2
  var chatbotUFB = "_1hpv6vm1";
4
3
  export {
@@ -17,5 +17,5 @@ export declare const Chatbot: ({ project, projectEnv, menuOption, config, }: {
17
17
  menuOption?: "Support Virtual Agent" | string;
18
18
  debug?: boolean;
19
19
  config: InitalizeChatbot;
20
- }) => false | import("react").JSX.Element;
20
+ }) => false | import("react/jsx-runtime").JSX.Element;
21
21
  export {};
@@ -2,7 +2,7 @@
2
2
  import { jsxs, jsx } from "react/jsx-runtime";
3
3
  import { usePageVisibility } from "../utils/useVisibility.js";
4
4
  import { useRef, useState, useEffect } from "react";
5
- import { useMount, useUnmount } from "react-use";
5
+ import { useLocation, useMount, useUnmount } from "react-use";
6
6
  import notificationSound from "../assets/notification.mp3.js";
7
7
  import AudioManager from "./AudioManager.js";
8
8
  import { Bubble } from "./Bubble.js";
@@ -28,9 +28,16 @@ const Chatbot = ({
28
28
  hasEscalated,
29
29
  endEscalation,
30
30
  unblockInput,
31
- blockInput
31
+ blockInput,
32
+ hasStarted,
33
+ setChatStarted,
34
+ resetChatStarted,
35
+ setChatStatus,
36
+ displayThankyouMessage,
37
+ hideDisplayThankyouMessage
32
38
  } = useOpenChat();
33
39
  const isVisible = usePageVisibility();
40
+ const location = useLocation();
34
41
  const { addMessage, addMessages, clearMessages, messages } = useMessages();
35
42
  const clientRef = useRef(null);
36
43
  const menuRef = useRef(null);
@@ -39,7 +46,6 @@ const Chatbot = ({
39
46
  const chatLoading = useRef(false);
40
47
  const agent_virtual = useRef(null);
41
48
  const [status, setStatus] = useState("idle");
42
- const [hasStarted, setHasStarted] = useState(false);
43
49
  const [menusLoaded, setMenusLoaded] = useState(false);
44
50
  const [isTyping, setIsTyping] = useState(false);
45
51
  const [scalationStarted, setScalationStarted] = useState(false);
@@ -86,6 +92,10 @@ const Chatbot = ({
86
92
  env: {
87
93
  label: "env",
88
94
  value: projectEnv === "uat" ? "dev" : projectEnv
95
+ },
96
+ url: {
97
+ label: "url",
98
+ value: location.href
89
99
  }
90
100
  }
91
101
  };
@@ -230,9 +240,6 @@ const Chatbot = ({
230
240
  const createClient = async () => {
231
241
  const { Client } = await import("@ujet/websdk-headless");
232
242
  if (clientRef.current) return;
233
- console.log({
234
- config
235
- });
236
243
  const client = new Client({
237
244
  companyId: config.companyId,
238
245
  tenant: config.tenantName,
@@ -259,12 +266,20 @@ const Chatbot = ({
259
266
  };
260
267
  const startChat = async (source) => {
261
268
  const client = clientRef.current;
262
- if (!client) return;
263
- if (hasStarted) return;
269
+ if (!client) {
270
+ console.log(`no client detected`);
271
+ return;
272
+ }
273
+ if (hasStarted) {
274
+ console.log(`has started is ${hasStarted}`);
275
+ return;
276
+ }
277
+ hideDisplayThankyouMessage();
264
278
  if (chatLoading.current) {
265
279
  console.log(`startChat skipped [${source}] — already in progress`);
266
280
  return;
267
281
  }
282
+ setChatStatus("connected");
268
283
  try {
269
284
  console.log(`Starting chat [${source}]`, chatRef.current);
270
285
  chatLoading.current = true;
@@ -309,7 +324,7 @@ const Chatbot = ({
309
324
  console.error("Error creating chat:", err);
310
325
  } finally {
311
326
  chatLoading.current = false;
312
- setHasStarted(true);
327
+ setChatStarted();
313
328
  }
314
329
  };
315
330
  const handleClick = async () => {
@@ -318,7 +333,7 @@ const Chatbot = ({
318
333
  if (hasStarted) return;
319
334
  if (!hasOpenedOnce) {
320
335
  await startChat("bubbleClick");
321
- setHasStarted(true);
336
+ setChatStarted();
322
337
  }
323
338
  };
324
339
  const onSendMessage = async (msg) => {
@@ -343,15 +358,27 @@ const Chatbot = ({
343
358
  }
344
359
  };
345
360
  const onEndChat = async () => {
346
- console.log("Ending chat");
361
+ console.log(`Ending chat [end chat]`);
347
362
  if (chatRef.current) {
348
- await clientRef.current?.finishChat();
349
- await chatRef.current?.destroy();
350
- clearMessages();
351
- chatRef.current = null;
352
- console.log("Chat ended");
353
- setHasStarted(false);
354
- endEscalation?.();
363
+ try {
364
+ clientRef.current?.finishChat().then(() => {
365
+ console.log(`Chat finished`);
366
+ chatRef.current?.destroy().then(() => {
367
+ console.log(`Chat destroyed`);
368
+ clearMessages();
369
+ chatRef.current = null;
370
+ resetChatStarted();
371
+ console.log("Chat ended");
372
+ endEscalation?.();
373
+ }).finally(() => {
374
+ setChatStatus("ending");
375
+ displayThankyouMessage();
376
+ });
377
+ });
378
+ } catch (error) {
379
+ console.log(error, "from onEndChat");
380
+ }
381
+ return;
355
382
  }
356
383
  };
357
384
  const onEndAndStartNewChat = async () => {
@@ -370,7 +397,7 @@ const Chatbot = ({
370
397
  deregisterEventHandlers();
371
398
  chatLoading.current = false;
372
399
  reset();
373
- setHasStarted(false);
400
+ resetChatStarted();
374
401
  setStatus("idle");
375
402
  clearMessages();
376
403
  endEscalation?.();
@@ -386,7 +413,7 @@ const Chatbot = ({
386
413
  };
387
414
  const onCloseAfterThankYou = async () => {
388
415
  reset();
389
- setHasStarted(false);
416
+ resetChatStarted();
390
417
  newChatSession();
391
418
  };
392
419
  const onPreviewTyping = async (msg) => {