@axos-web-dev/shared-components 1.0.77-patch.54 → 1.0.77-patch.56

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 (181) hide show
  1. package/dist/ATMLocator/ATMLocator.js +4 -2
  2. package/dist/Accordion/Accordion.css.js +2 -1
  3. package/dist/Accordion/Accordion.js +2 -1
  4. package/dist/AlertBanner/index.js +2 -1
  5. package/dist/Article/Article.css.js +2 -1
  6. package/dist/ArticlesSet/ArticlesSet.css.js +2 -1
  7. package/dist/Auth/ErrorAlert.js +4 -2
  8. package/dist/Auth/SignIn.css.js +2 -1
  9. package/dist/AwardsBanner/AwardsBanner.css.js +2 -1
  10. package/dist/Blockquote/Blockquote.module.js +3 -3
  11. package/dist/BulletItem/BulletItem.js +2 -1
  12. package/dist/Button/Button.css.js +2 -1
  13. package/dist/Button/Button.js +4 -2
  14. package/dist/Calculators/AnnualFeeCalculator/AnnualFeeCalculator.css.js +2 -1
  15. package/dist/Calculators/ApyCalculator/ApyCalculator.css.js +2 -1
  16. package/dist/Calculators/AxosOneCalculator/BalanceAPYCalculator.css.d.ts +2 -0
  17. package/dist/Calculators/AxosOneCalculator/BalanceAPYCalculator.css.js +8 -2
  18. package/dist/Calculators/AxosOneCalculator/index.js +72 -64
  19. package/dist/Calculators/BalanceAPYCalculator/BalanceAPYCalculator.css.js +2 -1
  20. package/dist/Calculators/BalanceAPYCalculator/index.js +2 -1
  21. package/dist/Calculators/BuyDownCalculator/BuyDownCalculator.css.js +2 -1
  22. package/dist/Calculators/Calculator.js +4 -2
  23. package/dist/Calculators/MonthlyPaymentCalculator/MonthlyPaymentCalculator.css.js +2 -1
  24. package/dist/Calculators/MonthlyPaymentLVFCalculator/MonthlyPaymentCalculator.css.js +2 -1
  25. package/dist/Calculators/SummitApyCalculator/BalanceAPYCalculator.css.js +2 -1
  26. package/dist/Calculators/SummitApyCalculator/index.js +2 -1
  27. package/dist/Calculators/calculator.css.js +2 -1
  28. package/dist/CallToActionBar/CallToActionBar.css.js +2 -1
  29. package/dist/Carousel/Carousel.css.js +2 -1
  30. package/dist/Carousel/index.js +4 -2
  31. package/dist/Chatbot/AnimatedGradientBorder.css.d.ts +3 -0
  32. package/dist/Chatbot/AnimatedGradientBorder.css.js +13 -0
  33. package/dist/Chatbot/Bubble.css.d.ts +4 -0
  34. package/dist/Chatbot/Bubble.css.js +15 -4
  35. package/dist/Chatbot/Bubble.js +26 -19
  36. package/dist/Chatbot/Chat.js +0 -7
  37. package/dist/Chatbot/ChatWindow.css.d.ts +17 -0
  38. package/dist/Chatbot/ChatWindow.css.js +46 -17
  39. package/dist/Chatbot/ChatWindow.d.ts +6 -1
  40. package/dist/Chatbot/ChatWindow.js +338 -283
  41. package/dist/Chatbot/Chatbot.css.js +1 -0
  42. package/dist/Chatbot/Chatbot.js +117 -9
  43. package/dist/Chatbot/ChatbotMessage.d.ts +17 -0
  44. package/dist/Chatbot/ChatbotMessage.js +219 -0
  45. package/dist/Chatbot/ThankYouMessage.d.ts +9 -0
  46. package/dist/Chatbot/ThankYouMessage.js +510 -0
  47. package/dist/Chatbot/index.js +18 -2
  48. package/dist/Chatbot/store/chat.d.ts +6 -0
  49. package/dist/Chatbot/store/chat.js +12 -1
  50. package/dist/Chatbot/store/messages.d.ts +2 -1
  51. package/dist/Chatbot/store/messages.js +12 -4
  52. package/dist/Chevron/Chevron.css.js +2 -1
  53. package/dist/Chevron/index.js +4 -2
  54. package/dist/CollectInformationAlert/CollectInformationAlert.css.js +2 -1
  55. package/dist/CollectInformationAlert/index.js +2 -1
  56. package/dist/Comparison/Comparison.css.js +2 -1
  57. package/dist/Comparison/Comparison.js +4 -2
  58. package/dist/ContentBanner/ContentBanner.css.js +2 -1
  59. package/dist/DownloadTile/DownloadTile.css.js +2 -1
  60. package/dist/ExecutiveBio/ExecutiveBio.css.js +2 -1
  61. package/dist/ExecutiveBio/ExecutiveBio.js +4 -2
  62. package/dist/FaqAccordion/FaqAccordion.css.js +2 -1
  63. package/dist/FaqAccordion/index.js +4 -2
  64. package/dist/FooterDisclosure/LVF/LaVictorieFooter.css.js +2 -1
  65. package/dist/FooterDisclosure/LVF/LaVictorieFooter.js +2 -1
  66. package/dist/FooterSiteMap/AxosBank/FooterSiteMap.css.js +2 -1
  67. package/dist/FooterSiteMap/AxosBank/FooterSiteMap.js +4 -2
  68. package/dist/Forms/ApplicationStart.js +2 -1
  69. package/dist/Forms/ApplyNow.js +4 -2
  70. package/dist/Forms/ClearingForm.js +2 -1
  71. package/dist/Forms/CommercialDeposits.js +2 -1
  72. package/dist/Forms/CommercialDepositsNoLendingOption.js +2 -1
  73. package/dist/Forms/CommercialLending.js +2 -1
  74. package/dist/Forms/CommercialPremiumFinance.js +2 -1
  75. package/dist/Forms/ContactCompany.js +2 -1
  76. package/dist/Forms/ContactCompanyTitle.js +2 -1
  77. package/dist/Forms/ContactUs.js +2 -1
  78. package/dist/Forms/ContactUsAAS.js +2 -1
  79. package/dist/Forms/ContactUsBusiness.js +4 -2
  80. package/dist/Forms/ContactUsBusinessNameEmail.js +4 -2
  81. package/dist/Forms/ContactUsLVF.js +2 -1
  82. package/dist/Forms/ContactUsNMLSId.js +4 -2
  83. package/dist/Forms/CpraRequest.js +2 -1
  84. package/dist/Forms/CraPublicFile.js +4 -2
  85. package/dist/Forms/DealerServices.js +2 -1
  86. package/dist/Forms/EmailOnly.js +4 -2
  87. package/dist/Forms/EmailUs.js +2 -1
  88. package/dist/Forms/Forms.css.js +2 -1
  89. package/dist/Forms/MortgageRate/MortgageRateForm.js +4 -2
  90. package/dist/Forms/MortgageRate/MortgageRateWatch.js +4 -2
  91. package/dist/Forms/MortgageWarehouseLending.js +4 -2
  92. package/dist/Forms/QuickPricer/QuickPricerForm.js +2 -1
  93. package/dist/Forms/QuickPricer/UserInformation.css.js +2 -1
  94. package/dist/Forms/ScheduleCall.js +2 -1
  95. package/dist/Forms/ScheduleCallPremier.js +2 -1
  96. package/dist/Forms/SuccesForm.js +4 -2
  97. package/dist/Forms/WcplSurvey.js +2 -1
  98. package/dist/HeroBanner/HeroBanner.css.js +2 -1
  99. package/dist/HeroBanner/HeroBanner.js +2 -1
  100. package/dist/HeroBanner/LargeBanner.css.js +2 -1
  101. package/dist/HeroBanner/SelectionBanner.css.js +2 -1
  102. package/dist/Hyperlink/Hyperlink.css.js +2 -1
  103. package/dist/Hyperlink/index.js +4 -2
  104. package/dist/IconBillboard/IconBillboard.css.js +2 -1
  105. package/dist/IconBillboard/IconBillboard.js +2 -2
  106. package/dist/ImageBillboard/ImageBillboard.css.js +2 -1
  107. package/dist/ImageBillboard/ImageBillboard.js +2 -1
  108. package/dist/ImageBillboard/ImageBillboardSet.js +4 -3
  109. package/dist/ImageLink/ImageLink.js +4 -2
  110. package/dist/ImageLink/ImageLinkSet.js +4 -2
  111. package/dist/ImageLink/index.js +4 -2
  112. package/dist/Input/Input.css.js +2 -1
  113. package/dist/Inputs/Input.css.js +2 -1
  114. package/dist/Insight/Featured/CategorySelector.css.js +2 -1
  115. package/dist/Insight/Featured/CategorySelector.js +4 -2
  116. package/dist/Insight/Featured/Featured.js +4 -2
  117. package/dist/Insight/Featured/Header.js +4 -2
  118. package/dist/Interstitial/Interstitial-variants.css.js +2 -1
  119. package/dist/LandingPageHeader/LandingPageHeader.css.js +2 -1
  120. package/dist/LandingPageHeader/LandingPageHeader.js +2 -1
  121. package/dist/MainHTML/index.d.ts +1 -1
  122. package/dist/MainHTML/index.js +3 -1
  123. package/dist/Modal/Modal.css.js +2 -1
  124. package/dist/Modal/Modal.js +4 -2
  125. package/dist/NavigationMenu/AxosALTS/NavBar.css.js +2 -1
  126. package/dist/NavigationMenu/AxosALTS/NavData.js +4 -2
  127. package/dist/NavigationMenu/AxosALTS/index.js +4 -2
  128. package/dist/NavigationMenu/AxosAdvisor/NavBar.css.js +2 -1
  129. package/dist/NavigationMenu/AxosAdvisor/SubNavbar.css.js +2 -1
  130. package/dist/NavigationMenu/AxosAdvisorServices/NavBar.css.js +2 -1
  131. package/dist/NavigationMenu/AxosAdvisorServices/SubNavbar.css.js +2 -1
  132. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileNavData.js +4 -2
  133. package/dist/NavigationMenu/AxosBank/NavBar.css.js +2 -1
  134. package/dist/NavigationMenu/AxosBank/NavData.js +4 -2
  135. package/dist/NavigationMenu/AxosBank/SubNavBar.js +4 -2
  136. package/dist/NavigationMenu/AxosBank/SubNavbar.css.js +2 -1
  137. package/dist/NavigationMenu/AxosBank/index.js +4 -2
  138. package/dist/NavigationMenu/LaVictoire/NavData.js +4 -2
  139. package/dist/NavigationMenu/LaVictoire/index.js +4 -2
  140. package/dist/NavigationMenu/NavDataJson.js +4 -2
  141. package/dist/NavigationMenu/Navbar.js +4 -2
  142. package/dist/NavigationMenu/SignInNavButton.js +4 -2
  143. package/dist/PageNavItem/PageNavItem.css.js +2 -1
  144. package/dist/Pagination/Pagination.js +2 -1
  145. package/dist/SecondaryFooter/SecondaryFooter.css.js +2 -1
  146. package/dist/SetContainer/SetContainer.css.js +2 -1
  147. package/dist/SetContainer/SetContainer.js +4 -2
  148. package/dist/SocialMediaBar/iconsRepository.js +4 -2
  149. package/dist/StepItem/StepItem.css.js +2 -1
  150. package/dist/StepItemSet/StepItemSet.css.js +2 -1
  151. package/dist/StepItemSet/StepItemSet.js +2 -1
  152. package/dist/Tab/Tab.css.js +2 -1
  153. package/dist/Table/Table.css.js +2 -1
  154. package/dist/Table/Table.js +2 -1
  155. package/dist/TextBlock/TextBlock.css.js +2 -1
  156. package/dist/VideoTile/VideoTile.css.js +2 -1
  157. package/dist/VideoTile/VideoTile.js +4 -2
  158. package/dist/VideoWrapper/index.js +4 -2
  159. package/dist/assets/Blockquote/Blockquote.css.css +68 -68
  160. package/dist/assets/Calculators/AxosOneCalculator/BalanceAPYCalculator.css +40 -2
  161. package/dist/assets/Chatbot/AnimatedGradientBorder.css +38 -0
  162. package/dist/assets/Chatbot/Bubble.css +58 -21
  163. package/dist/assets/Chatbot/ChatWindow.css +211 -85
  164. package/dist/assets/Chatbot/Chatbot.css +3 -0
  165. package/dist/assets/themes/axos.css +12 -0
  166. package/dist/assets/themes/premier.css +12 -0
  167. package/dist/assets/themes/ufb.css +52 -0
  168. package/dist/assets/themes/victorie.css +12 -0
  169. package/dist/icons/ArrowIcon/ArrowIcon.css.js +2 -1
  170. package/dist/icons/CheckIcon/CheckIcon.css.js +2 -1
  171. package/dist/icons/DownloadIcon/DownloadIcon.css.js +2 -1
  172. package/dist/icons/FollowIcon/FollowIcon.css.js +2 -1
  173. package/dist/main.js +20 -2
  174. package/dist/themes/axos.css.d.ts +18 -0
  175. package/dist/themes/axos.css.js +1 -1
  176. package/dist/themes/index.d.ts +1 -0
  177. package/dist/themes/index.js +2 -0
  178. package/dist/themes/ufb.css.d.ts +1 -0
  179. package/dist/themes/ufb.css.js +6 -0
  180. package/package.json +135 -135
  181. package/dist/Chatbot/Chatbot.css.ts.vanilla.css.js +0 -1
@@ -1,14 +1,19 @@
1
1
  "use client";
2
2
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
3
+ import { vars } from "../themes/axos.css.js";
4
+ import '../assets/themes/victorie.css';import '../assets/themes/ufb.css';import '../assets/themes/premier.css';import '../assets/themes/axos.css';/* empty css */
5
+ /* empty css */
6
+ /* empty css */
7
+ /* empty css */
3
8
  import clsx from "clsx";
4
- import React, { useRef, useEffect, Fragment as Fragment$1 } from "react";
5
- import ReactMarkdown from "react-markdown";
9
+ import React, { useRef, useEffect } from "react";
6
10
  import { useNetworkState, useMount } from "react-use";
7
- import remarkGfm from "remark-gfm";
8
- import { windowBarStyle, chat_title, chatbotMenuItem, chatbotMenu, chatFinishDialog, endChatButtonStyle, button_reset, arrowFill, chatNetworkStatus, notificationStyle, messageStyle, inline_button_wrapper, inline_button, messagesContainerStyle, inputStyle, autoResize, sendButtonStyle, windowStyle, windowOpenStyle } from "./ChatWindow.css.js";
9
- import EllipsisLoader from "./EllipsisAnimation.js";
11
+ import { gradientFocus } from "./AnimatedGradientBorder.css.js";
12
+ 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 } from "./ChatWindow.css.js";
10
14
  import { EllipsisIcon } from "./EllipsisIcon.js";
11
15
  import { useOpenChat } from "./store/chat.js";
16
+ import { ThankYouMessage } from "./ThankYouMessage.js";
12
17
  const ChatWindow = ({
13
18
  messages,
14
19
  status = "connected",
@@ -20,8 +25,24 @@ const ChatWindow = ({
20
25
  },
21
26
  showReconnect = false,
22
27
  virtualAgent,
23
- showAvatar = false
28
+ showAvatar = false,
29
+ onNewChat = () => {
30
+ console.log("Start chat");
31
+ },
32
+ showName = false,
33
+ onCloseAfterThankYou = () => {
34
+ console.log("Close after thank you");
35
+ },
36
+ previewTyping = (msg) => {
37
+ console.log("Preview typing: ", msg);
38
+ }
24
39
  }) => {
40
+ const {
41
+ showThankyouMessage,
42
+ displayThankyouMessage,
43
+ toggleThankyouMessage,
44
+ hasEscalated
45
+ } = useOpenChat();
25
46
  const [mounted, setMounted] = React.useState(false);
26
47
  const [menuOpen, setMenuOpen] = React.useState(false);
27
48
  const [showEndChatDialog, setShowEndChatDialog] = React.useState(false);
@@ -44,10 +65,6 @@ const ChatWindow = ({
44
65
  useMount(() => {
45
66
  setMounted(true);
46
67
  });
47
- const project = process.env.CCAI_PROJECT_ID;
48
- const isAxos = project === "axos";
49
- const endUserBg = isAxos ? "#14263d" : "#323339";
50
- const chatbotBg = isAxos ? "#E9F8FF" : "#EAE8E8";
51
68
  const escalationDeflected = messages?.filter(
52
69
  (item) => item.type == "noti" && item.event == "escalationDeflected"
53
70
  ).length > 0;
@@ -63,146 +80,292 @@ const ChatWindow = ({
63
80
  useEffect(() => {
64
81
  autoResizeTextarea();
65
82
  }, [input]);
83
+ const displayThankYouScreen = () => {
84
+ displayThankyouMessage();
85
+ };
86
+ const onCancelEndChat = () => {
87
+ setShowEndChatDialog(false);
88
+ toggleThankyouMessage?.();
89
+ onCloseAfterThankYou();
90
+ setInput("");
91
+ };
92
+ const onStartChat = () => {
93
+ onNewChat();
94
+ setInput("");
95
+ toggleThankyouMessage?.();
96
+ };
66
97
  return /* @__PURE__ */ jsxs("div", { className: clsx(windowStyle, isOpen && windowOpenStyle), children: [
67
98
  /* @__PURE__ */ jsxs("div", { className: windowBarStyle, children: [
68
- /* @__PURE__ */ jsxs("div", { className: "flex middle", style: { paddingBlock: "6px" }, children: [
69
- /* @__PURE__ */ jsx(
70
- "img",
71
- {
72
- src: "https://www.axos.com/images/2xmVfQm5l0HWOKjgxQO1Iw/axb-assistant.svg",
73
- style: { marginRight: 12 },
74
- height: 18,
75
- width: 18
76
- }
77
- ),
78
- /* @__PURE__ */ jsx("h2", { className: chat_title, children: "Evo Virtual Assistant" })
79
- ] }),
80
- /* @__PURE__ */ jsx(
81
- "button",
99
+ /* @__PURE__ */ jsx("div", { className: clsx(left_bar_section) }),
100
+ /* @__PURE__ */ jsxs(
101
+ "div",
82
102
  {
83
- onClick: () => {
84
- setMenuOpen(!menuOpen);
85
- },
86
- style: {
87
- border: "none",
88
- background: "transparent",
89
- marginLeft: "auto",
90
- cursor: "pointer",
91
- padding: 0,
92
- display: "flex",
93
- alignContent: "center"
94
- },
95
- children: /* @__PURE__ */ jsx(EllipsisIcon, { color: "#fff" })
103
+ className: "flex middle center",
104
+ style: { paddingBlock: "6px", gap: 4 },
105
+ children: [
106
+ /* @__PURE__ */ jsxs(
107
+ "svg",
108
+ {
109
+ xmlns: "http://www.w3.org/2000/svg",
110
+ width: "20",
111
+ height: "17",
112
+ viewBox: "0 0 20 17",
113
+ fill: "none",
114
+ children: [
115
+ /* @__PURE__ */ jsx(
116
+ "path",
117
+ {
118
+ d: "M10.5277 2.78937C10.8911 2.78937 11.1852 3.08251 11.1853 3.44452C11.1852 3.80654 10.8911 4.10056 10.5277 4.10056H5.26386C4.5371 4.10064 3.94791 4.68761 3.94789 5.41175V10.6565C3.9479 11.3806 4.5371 11.9676 5.26386 11.9677H6.97488C7.12012 11.9678 7.23818 12.0854 7.23825 12.2301V15.6861L10.8932 12.0445C10.9424 11.9956 11.0092 11.9679 11.0786 11.9677H14.4765C15.2032 11.9676 15.7925 11.3806 15.7925 10.6565V9.27302C15.7925 8.91106 16.0868 8.61721 16.45 8.61697C16.8134 8.61699 17.1084 8.91093 17.1084 9.27302V10.6565C17.1084 12.1048 15.9301 13.2788 14.4765 13.2789H11.5149L8.16901 16.6135C7.33997 17.4393 5.92245 16.8542 5.92229 15.6861V13.2789H5.26386C3.81026 13.2788 2.63193 12.1048 2.63193 10.6565V5.41175C2.63194 3.96341 3.81027 2.78945 5.26386 2.78937H10.5277Z",
119
+ fill: "#1E3860"
120
+ }
121
+ ),
122
+ /* @__PURE__ */ jsx(
123
+ "path",
124
+ {
125
+ d: "M9.21265 0.166102C9.57579 0.166381 9.87012 0.460269 9.87018 0.822142C9.87004 1.18394 9.57574 1.47701 9.21265 1.47729H3.29036C2.20017 1.47729 1.31606 2.35831 1.31596 3.44452V6.72294C1.31577 7.08487 1.02083 7.37808 0.657534 7.37808C0.294361 7.37794 0.000196551 7.08478 0 6.72294V3.44452C9.80773e-05 1.63411 1.47333 0.166102 3.29036 0.166102H9.21265Z",
126
+ fill: "#1E3860"
127
+ }
128
+ ),
129
+ /* @__PURE__ */ jsx(
130
+ "path",
131
+ {
132
+ d: "M15.7145 0.475824C15.9558 -0.158638 16.8779 -0.158578 17.1192 0.475824L17.6459 1.8611C17.7218 2.06058 17.8835 2.2175 18.0885 2.29132L19.511 2.80454C20.163 3.03936 20.163 3.93626 19.511 4.17107L18.0885 4.6843C17.8835 4.75812 17.7218 4.91504 17.6459 5.11452L17.1192 6.49979C16.8779 7.1342 15.9558 7.13426 15.7145 6.49979L15.1878 5.11452C15.1119 4.91508 14.9502 4.75811 14.7453 4.6843L13.3227 4.17107C12.6708 3.93622 12.6708 3.0394 13.3227 2.80454L14.7453 2.29132C14.9502 2.21751 15.1119 2.06054 15.1878 1.8611L15.7145 0.475824Z",
133
+ fill: "#1E3860"
134
+ }
135
+ )
136
+ ]
137
+ }
138
+ ),
139
+ /* @__PURE__ */ jsx("h2", { className: chat_title, children: "Ask Evo AI" })
140
+ ]
96
141
  }
97
142
  ),
98
- menuOpen && /* @__PURE__ */ jsx("ul", { className: clsx(chatbotMenu), children: /* @__PURE__ */ jsx("li", { className: chatbotMenuItem, children: /* @__PURE__ */ jsx(
99
- "button",
100
- {
101
- type: "button",
102
- onClick: () => {
103
- setShowEndChatDialog(true);
104
- setMenuOpen(false);
105
- },
106
- style: { width: "100%" },
107
- children: "Finish chat"
108
- }
109
- ) }) }),
110
- showEndChatDialog && /* @__PURE__ */ jsxs(Fragment, { children: [
143
+ /* @__PURE__ */ jsxs("div", { className: clsx(buttonss_section), children: [
111
144
  /* @__PURE__ */ jsx(
112
- "div",
145
+ "button",
113
146
  {
147
+ disabled: messages.length === 0,
148
+ onClick: () => {
149
+ setMenuOpen(!menuOpen);
150
+ },
151
+ className: clsx(button_bar),
114
152
  style: {
115
- background: "#00000080",
116
- position: "fixed",
117
- top: 0,
118
- left: 0,
119
- right: 0,
120
- bottom: 0,
121
- zIndex: 999,
122
- opacity: 0.75
123
- }
153
+ border: menuOpen ? `1px solid ${vars.chatbot.window.headerText}` : "none",
154
+ cursor: "pointer",
155
+ padding: 0,
156
+ display: "flex",
157
+ alignContent: "center",
158
+ background: menuOpen ? "#0000000f" : void 0
159
+ },
160
+ children: /* @__PURE__ */ jsx(EllipsisIcon, {})
124
161
  }
125
162
  ),
126
- /* @__PURE__ */ jsx(
127
- "dialog",
163
+ menuOpen && /* @__PURE__ */ jsx("ul", { className: clsx(chatbotMenu), children: /* @__PURE__ */ jsx("li", { className: chatbotMenuItem, children: /* @__PURE__ */ jsxs(
164
+ "button",
128
165
  {
129
- open: showEndChatDialog,
166
+ type: "button",
167
+ onClick: () => {
168
+ setShowEndChatDialog(true);
169
+ setMenuOpen(false);
170
+ },
130
171
  style: {
131
- padding: "1rem",
132
- borderRadius: 8,
133
- background: "#fff",
134
- color: "#000",
135
- border: `1px solid ${endUserBg}`,
136
- outline: "none",
137
- maxWidth: "90%",
138
- top: "25%",
139
- marginInline: "auto",
140
- zIndex: 1e3
172
+ width: "100%",
173
+ display: "flex",
174
+ alignItems: "center",
175
+ gap: "12px"
141
176
  },
142
- children: /* @__PURE__ */ jsxs("form", { method: "dialog", className: chatFinishDialog, children: [
143
- /* @__PURE__ */ jsx("p", { children: "Are you sure you want to end this chat?" }),
144
- /* @__PURE__ */ jsxs(
145
- "div",
177
+ children: [
178
+ /* @__PURE__ */ jsx("div", { className: clsx(button_bar), children: /* @__PURE__ */ jsxs(
179
+ "svg",
146
180
  {
147
- style: { display: "flex", gap: "1rem", marginTop: "1rem" },
181
+ xmlns: "http://www.w3.org/2000/svg",
182
+ width: "16",
183
+ height: "16",
184
+ viewBox: "0 0 16 16",
185
+ fill: "none",
148
186
  children: [
149
- /* @__PURE__ */ jsx(
150
- "button",
151
- {
152
- className: endChatButtonStyle,
153
- type: "submit",
154
- onClick: () => {
155
- endChat();
156
- setShowEndChatDialog(false);
157
- },
158
- children: "Yes"
159
- }
160
- ),
161
- /* @__PURE__ */ jsx(
162
- "button",
163
- {
164
- className: endChatButtonStyle,
165
- type: "button",
166
- onClick: () => {
167
- setShowEndChatDialog(false);
168
- },
169
- children: "No"
170
- }
171
- )
187
+ /* @__PURE__ */ jsxs("g", { clipPath: "url(#clip0_92_1389)", children: [
188
+ /* @__PURE__ */ jsx(
189
+ "path",
190
+ {
191
+ 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",
192
+ fill: "#1E3860"
193
+ }
194
+ ),
195
+ /* @__PURE__ */ jsx(
196
+ "path",
197
+ {
198
+ fillRule: "evenodd",
199
+ clipRule: "evenodd",
200
+ 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",
201
+ fill: "#1E3860"
202
+ }
203
+ )
204
+ ] }),
205
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("clipPath", { id: "clip0_92_1389", children: /* @__PURE__ */ jsx("rect", { width: "16", height: "16", fill: "white" }) }) })
172
206
  ]
173
207
  }
174
- )
175
- ] })
208
+ ) }),
209
+ /* @__PURE__ */ jsx("span", { children: "End Chat" })
210
+ ]
176
211
  }
177
- )
178
- ] }),
179
- onClose && /* @__PURE__ */ jsx(
180
- "button",
181
- {
182
- onClick: onClose,
183
- className: button_reset,
184
- "aria-label": "Close chat",
185
- title: "Close",
186
- children: /* @__PURE__ */ jsx(
187
- "svg",
212
+ ) }) }),
213
+ showEndChatDialog && /* @__PURE__ */ jsxs(Fragment, { children: [
214
+ /* @__PURE__ */ jsx(
215
+ "div",
188
216
  {
189
- xmlns: "http://www.w3.org/2000/svg",
190
- width: "24",
191
- height: "24",
192
- viewBox: "0 0 24 24",
193
- fill: "none",
194
- children: /* @__PURE__ */ jsx(
195
- "path",
217
+ style: {
218
+ background: "#00000080",
219
+ position: "fixed",
220
+ top: 0,
221
+ left: 0,
222
+ right: 0,
223
+ bottom: 0,
224
+ zIndex: 999
225
+ }
226
+ }
227
+ ),
228
+ /* @__PURE__ */ jsx("dialog", { open: showEndChatDialog, className: chatEndDialogOverlay, children: /* @__PURE__ */ jsxs("form", { method: "dialog", className: chatFinishDialog, children: [
229
+ /* @__PURE__ */ jsx("div", { className: clsx(button_bar, chatEndCircle), children: /* @__PURE__ */ jsxs(
230
+ "svg",
231
+ {
232
+ xmlns: "http://www.w3.org/2000/svg",
233
+ width: "24",
234
+ height: "24",
235
+ viewBox: "0 0 24 24",
236
+ fill: "none",
237
+ children: [
238
+ /* @__PURE__ */ jsx(
239
+ "path",
240
+ {
241
+ d: "M12.7514 7.14531V15.3953H11.2514V7.14531H12.7514Z",
242
+ fill: "#D2272F"
243
+ }
244
+ ),
245
+ /* @__PURE__ */ jsx(
246
+ "path",
247
+ {
248
+ d: "M12.0014 16.8953C12.6227 16.8953 13.1264 17.399 13.1264 18.0203C13.1264 18.6416 12.6227 19.1453 12.0014 19.1453C11.3801 19.1453 10.8764 18.6416 10.8764 18.0203C10.8764 17.399 11.3801 16.8953 12.0014 16.8953Z",
249
+ fill: "#D2272F"
250
+ }
251
+ ),
252
+ /* @__PURE__ */ jsx(
253
+ "path",
254
+ {
255
+ fillRule: "evenodd",
256
+ clipRule: "evenodd",
257
+ d: "M9.31805 3.51187L2.17215 17.8037C1.1748 19.7984 2.62529 22.1453 4.85543 22.1453H19.1472C21.3774 22.1453 22.8279 19.7984 21.8305 17.8037L14.6846 3.51188C13.579 1.30073 10.4236 1.30073 9.31805 3.51187ZM3.51379 18.4745L10.6597 4.18269C11.2125 3.07712 12.7902 3.07712 13.343 4.1827L20.4889 18.4745C20.9875 19.4718 20.2623 20.6453 19.1472 20.6453H4.85543C3.74036 20.6453 3.01512 19.4718 3.51379 18.4745Z",
258
+ fill: "#D2272F"
259
+ }
260
+ )
261
+ ]
262
+ }
263
+ ) }),
264
+ /* @__PURE__ */ jsxs("p", { children: [
265
+ "Are you sure you want to end",
266
+ /* @__PURE__ */ jsx("br", {}),
267
+ " this chat?"
268
+ ] }),
269
+ /* @__PURE__ */ jsxs(
270
+ "div",
271
+ {
272
+ style: {
273
+ display: "flex",
274
+ gap: "1rem",
275
+ marginTop: "1rem",
276
+ flexDirection: "column",
277
+ marginBottom: 24,
278
+ width: "100%"
279
+ },
280
+ children: [
281
+ /* @__PURE__ */ jsx(
282
+ "button",
283
+ {
284
+ className: endChatButtonStyle,
285
+ type: "submit",
286
+ onClick: () => {
287
+ endChat();
288
+ displayThankYouScreen();
289
+ setShowEndChatDialog(false);
290
+ },
291
+ children: "Yes, End Chat"
292
+ }
293
+ ),
294
+ /* @__PURE__ */ jsx(
295
+ "button",
296
+ {
297
+ className: clsx(endChatButtonStyle, noAnswerButton),
298
+ type: "button",
299
+ onClick: () => {
300
+ setShowEndChatDialog(false);
301
+ },
302
+ children: "No, Go Back"
303
+ }
304
+ )
305
+ ]
306
+ }
307
+ ),
308
+ " "
309
+ ] }) })
310
+ ] }),
311
+ /* @__PURE__ */ jsx(
312
+ ThankYouMessage,
313
+ {
314
+ showEndChatDialog: showThankyouMessage,
315
+ onStart: onStartChat,
316
+ onClose: onCancelEndChat
317
+ }
318
+ ),
319
+ onClose && /* @__PURE__ */ jsxs(
320
+ "button",
321
+ {
322
+ onClick: () => {
323
+ onClose();
324
+ setMenuOpen(false);
325
+ },
326
+ className: clsx(button_reset, button_bar),
327
+ "aria-label": "Close chat window",
328
+ title: "Close",
329
+ children: [
330
+ /* @__PURE__ */ jsx(
331
+ "svg",
196
332
  {
197
- className: arrowFill,
198
- d: "M2.46875 7.76574L11.9991 17.2961L21.5294 7.76574L20.4687 6.70508L11.9991 15.1749L3.52941 6.70508L2.46875 7.76574Z",
199
- fill: "#98DDFF"
333
+ xmlns: "http://www.w3.org/2000/svg",
334
+ width: "24",
335
+ height: "24",
336
+ viewBox: "0 0 24 24",
337
+ fill: "none",
338
+ children: /* @__PURE__ */ jsx(
339
+ "path",
340
+ {
341
+ className: arrowFill,
342
+ d: "M2.46875 7.76574L11.9991 17.2961L21.5294 7.76574L20.4687 6.70508L11.9991 15.1749L3.52941 6.70508L2.46875 7.76574Z",
343
+ color: vars.chatbot.window.headerText
344
+ }
345
+ )
346
+ }
347
+ ),
348
+ /* @__PURE__ */ jsx(
349
+ "svg",
350
+ {
351
+ width: "15",
352
+ height: "15",
353
+ viewBox: "0 0 15 15",
354
+ fill: "none",
355
+ xmlns: "http://www.w3.org/2000/svg",
356
+ children: /* @__PURE__ */ jsx(
357
+ "path",
358
+ {
359
+ d: "M13.2187 0L14.0142 0.795495L7.803 7.0065L14.0142 13.2187L13.2187 14.0142L7.0065 7.803L0.795495 14.0142L0 13.2187L6.21112 7.0065L0 0.795495L0.795495 0L7.0065 6.21112L13.2187 0Z",
360
+ fill: vars.chatbot.window.headerText
361
+ }
362
+ )
200
363
  }
201
364
  )
202
- }
203
- )
204
- }
205
- )
365
+ ]
366
+ }
367
+ )
368
+ ] })
206
369
  ] }),
207
370
  mounted && !state.online ? /* @__PURE__ */ jsx("div", { className: clsx(chatNetworkStatus), children: /* @__PURE__ */ jsxs(
208
371
  "div",
@@ -235,7 +398,6 @@ const ChatWindow = ({
235
398
  style: {
236
399
  textAlign: "left",
237
400
  alignSelf: "flex-start",
238
- background: "#eee",
239
401
  color: "#1e3860",
240
402
  borderRadius: 16,
241
403
  padding: "8px 8px",
@@ -246,151 +408,32 @@ const ChatWindow = ({
246
408
  "div",
247
409
  {
248
410
  style: {
249
- fontSize: 13,
411
+ fontSize: 14,
250
412
  display: "flex",
251
413
  flexDirection: "column",
252
414
  gap: 4
253
415
  },
254
- children: /* @__PURE__ */ jsx(EllipsisLoader, {})
416
+ children: /* @__PURE__ */ jsx("p", { className: shimmerText, children: "AI thinking..." })
255
417
  }
256
418
  )
257
419
  }
258
420
  ),
259
- messages?.map((msg) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
260
- msg.type == "noti" && msg.$userType == "system" && msg.event == "escalationStarted" && /* @__PURE__ */ jsx("div", { className: notificationStyle, children: "We are connecting you with a human agent..." }, msg.$index),
261
- msg.type == "noti" && msg.$userType == "system" && msg.event == "memberLeft" && /* @__PURE__ */ jsxs("div", { className: notificationStyle, children: [
262
- /* @__PURE__ */ jsx("strong", { children: "Virtual Agent" }),
263
- " just left the conversation."
264
- ] }, msg.$index),
265
- msg.type == "noti" && msg.$userType == "system" && msg.event == "escalationAccepted" && /* @__PURE__ */ jsxs("div", { className: notificationStyle, children: [
266
- "You are now connected with a",
267
- " ",
268
- msg.to_agent ? /* @__PURE__ */ jsx("strong", { children: msg?.to_agent?.name }) : "an agent"
269
- ] }, msg.$index),
270
- msg.type == "noti" && msg.$userType == "virtual_agent" && msg.event == "escalationDeflected" && /* @__PURE__ */ jsxs(Fragment, { children: [
271
- /* @__PURE__ */ jsxs(
272
- "div",
273
- {
274
- className: notificationStyle,
275
- style: { fontSize: 12 },
276
- children: [
277
- "Our chat team is available weekdays, 8am-5pm, except federal bank holidays. For immediate assistance you can reach out to us at ",
278
- /* @__PURE__ */ jsx("a", { href: "tel:1-888-502-2967", children: "1-888-502-2967" }),
279
- "."
280
- ]
281
- },
282
- msg.$index
283
- ),
284
- /* @__PURE__ */ jsx("div", { style: { textAlign: "center", marginBottom: 12 }, children: /* @__PURE__ */ jsx("button", { className: endChatButtonStyle, onClick: endChat, children: "End Chat" }) })
285
- ] }),
286
- ["text", "markdown_template", "markdown"].includes(msg.type) && /* @__PURE__ */ jsx(
287
- "div",
288
- {
289
- className: messageStyle,
290
- style: {
291
- textAlign: msg.$userType == "end_user" ? "right" : "left",
292
- alignSelf: msg.$userType == "end_user" ? "flex-end" : "flex-start",
293
- background: msg.$userType == "end_user" ? endUserBg : chatbotBg,
294
- color: msg.$userType == "end_user" ? "#fff" : "#1F1F1F",
295
- boxShadow: msg.$userType == "end_user" ? "0 1px 4px #b3e0ff55" : void 0
296
- },
297
- children: /* @__PURE__ */ jsxs(
298
- "div",
299
- {
300
- style: {
301
- fontSize: 13,
302
- display: "flex",
303
- flexDirection: "column",
304
- gap: 4
305
- },
306
- children: [
307
- msg.$userType == "virtual_agent" && /* @__PURE__ */ jsxs(
308
- "div",
309
- {
310
- style: {
311
- display: "flex",
312
- alignItems: "center",
313
- gap: "8px"
314
- },
315
- children: [
316
- showAvatar && /* @__PURE__ */ jsx(
317
- "img",
318
- {
319
- width: 24,
320
- height: 24,
321
- src: virtualAgent?.avatar_url,
322
- alt: "agent avatar"
323
- }
324
- ),
325
- /* @__PURE__ */ jsx("strong", { children: virtualAgent?.name })
326
- ]
327
- }
328
- ),
329
- msg.$userType != "end_user" ? /* @__PURE__ */ jsx(
330
- ReactMarkdown,
331
- {
332
- remarkPlugins: [[remarkGfm, { singleTilde: false }]],
333
- components: {
334
- p: ({ ...props }) => /* @__PURE__ */ jsx(
335
- "p",
336
- {
337
- style: { margin: 0, fontSize: "inherit" },
338
- title: new Date(msg.$timestamp).toLocaleString(),
339
- ...props
340
- }
341
- )
342
- },
343
- children: msg.content
344
- }
345
- ) : /* @__PURE__ */ jsx("div", { title: new Date(msg.$timestamp).toLocaleString(), children: msg.content })
346
- ]
347
- }
348
- )
349
- },
350
- msg.$index
351
- ),
352
- msg.type == "inline_button" && Array.isArray(msg.buttons) && msg.buttons.length > 0 && /* @__PURE__ */ jsx("div", { className: inline_button_wrapper, children: msg.buttons.length !== 0 && Array.isArray(msg.buttons) && msg.buttons.map((button, index) => {
353
- const lastItem = msg.buttons && msg.buttons?.length - 1;
354
- return /* @__PURE__ */ jsx(
355
- "button",
356
- {
357
- className: inline_button,
358
- style: {
359
- borderRadius: "0px",
360
- borderTopLeftRadius: [0].includes(index) ? 8 : 0,
361
- borderTopRightRadius: [0].includes(index) ? 8 : 0,
362
- borderBottomLeftRadius: [lastItem].includes(index) ? 8 : 0,
363
- borderBottomRightRadius: [lastItem].includes(index) ? 8 : 0
364
- },
365
- onClick: () => {
366
- onSend(button?.title);
367
- },
368
- children: button.title
369
- },
370
- index
371
- );
372
- }) }),
373
- msg.event == "chatEnded" && /* @__PURE__ */ jsxs(Fragment, { children: [
374
- /* @__PURE__ */ jsxs(
375
- "div",
376
- {
377
- title: (/* @__PURE__ */ new Date()).toLocaleString(),
378
- style: {
379
- fontSize: 12,
380
- color: "#888",
381
- marginBottom: 4,
382
- textAlign: "center"
383
- },
384
- children: [
385
- "Thank you for chatting!",
386
- /* @__PURE__ */ jsx("br", {}),
387
- " This conversation has ended."
388
- ]
389
- }
390
- ),
391
- /* @__PURE__ */ jsx("div", { style: { textAlign: "center", marginBottom: 12 }, children: /* @__PURE__ */ jsx("button", { className: endChatButtonStyle, onClick: endChat, children: "End Chat" }) })
392
- ] })
393
- ] }, msg.$index)),
421
+ messages?.map((msg) => /* @__PURE__ */ jsx(
422
+ ChatbotMessage,
423
+ {
424
+ msg,
425
+ onSend,
426
+ showAvatar,
427
+ showName,
428
+ virtualAgent,
429
+ onCancelEndChat,
430
+ onEndChat: () => {
431
+ endChat();
432
+ onCloseAfterThankYou();
433
+ }
434
+ },
435
+ msg?.$index
436
+ )),
394
437
  showReconnect && /* @__PURE__ */ jsx(
395
438
  "button",
396
439
  {
@@ -402,14 +445,14 @@ const ChatWindow = ({
402
445
  ),
403
446
  /* @__PURE__ */ jsx("div", { ref: messagesEndRef })
404
447
  ] }),
405
- /* @__PURE__ */ jsxs(
406
- "form",
448
+ /* @__PURE__ */ jsx("div", { style: { padding: "16px 16px 24px 16px" }, children: /* @__PURE__ */ jsx("form", { onSubmit: handleSend, className: clsx(gradientFocus), children: /* @__PURE__ */ jsxs(
449
+ "div",
407
450
  {
408
- onSubmit: handleSend,
409
451
  style: {
410
- borderTop: "1px solid #eee",
411
- display: "flex"
412
- // gap: 8,
452
+ display: "flex",
453
+ padding: "12px 16px",
454
+ background: "#ffffff",
455
+ borderRadius: 12
413
456
  },
414
457
  children: [
415
458
  /* @__PURE__ */ jsx(
@@ -419,6 +462,9 @@ const ChatWindow = ({
419
462
  value: input,
420
463
  onChange: (e) => setInput(e.target.value),
421
464
  onKeyDown: (e) => {
465
+ if (hasEscalated) {
466
+ previewTyping(e.target?.value);
467
+ }
422
468
  if (e.key === "Enter" && !e.shiftKey) {
423
469
  e.preventDefault();
424
470
  const cleaned = cleanInput(input);
@@ -428,7 +474,7 @@ const ChatWindow = ({
428
474
  }
429
475
  }
430
476
  },
431
- placeholder: "Ask something...",
477
+ placeholder: "Ask anything...",
432
478
  className: clsx(inputStyle, autoResize),
433
479
  autoFocus: true,
434
480
  disabled: inputDisabled || status !== "connected" || messages.length == 0 || escalationDeflected,
@@ -438,28 +484,37 @@ const ChatWindow = ({
438
484
  /* @__PURE__ */ jsx(
439
485
  "button",
440
486
  {
441
- className: clsx(sendButtonStyle, input.trim().length > 0 && "active"),
487
+ className: clsx(
488
+ sendButtonStyle,
489
+ input.trim().length > 0 && "active"
490
+ ),
442
491
  type: "submit",
443
492
  title: "Send message",
444
493
  disabled: inputDisabled || status !== "connected" || !input.trim() || messages.length == 0 || escalationDeflected,
445
- children: /* @__PURE__ */ jsxs(
494
+ children: /* @__PURE__ */ jsx(
446
495
  "svg",
447
496
  {
448
497
  xmlns: "http://www.w3.org/2000/svg",
449
- id: "send-icon",
450
- width: 24,
451
- height: 24,
452
- children: [
453
- /* @__PURE__ */ jsx("path", { d: "M2.01 21L23 12 2.01 3 2 10l15 2-15 2z" }),
454
- /* @__PURE__ */ jsx("path", { d: "M0 0h24v24H0z", fill: "none" })
455
- ]
498
+ width: "16",
499
+ height: "16",
500
+ viewBox: "0 0 16 16",
501
+ fill: "none",
502
+ children: /* @__PURE__ */ jsx(
503
+ "path",
504
+ {
505
+ fillRule: "evenodd",
506
+ clipRule: "evenodd",
507
+ 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",
508
+ fill: "#435164"
509
+ }
510
+ )
456
511
  }
457
512
  )
458
513
  }
459
514
  )
460
515
  ]
461
516
  }
462
- )
517
+ ) }) })
463
518
  ] });
464
519
  };
465
520
  export {