@axos-web-dev/shared-components 1.0.100-dev.2 → 1.0.100-dev.21

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 (233) hide show
  1. package/dist/ATMLocator/ATMLocator.js +1 -1
  2. package/dist/Article/Article.css.d.ts +8 -36
  3. package/dist/ArticlesSet/ArticlesSet.css.d.ts +10 -70
  4. package/dist/ArticlesSet/ArticlesSet.js +1 -1
  5. package/dist/Auth/ErrorAlert.js +1 -1
  6. package/dist/Avatar/Avatar.module.js +7 -7
  7. package/dist/AwardsBanner/AwardsBanner.css.js +4 -1
  8. package/dist/AwardsItem/AwardsItem.css.js +1 -2
  9. package/dist/Blockquote/Blockquote.module.js +3 -3
  10. package/dist/Button/Button.css.d.ts +3 -3
  11. package/dist/Button/Button.js +1 -1
  12. package/dist/Calculators/ApyCalculator/ApyCalculator.css.d.ts +2 -30
  13. package/dist/Calculators/AxosOneCalculator/BalanceAPYCalculator.css.d.ts +1 -0
  14. package/dist/Calculators/AxosOneCalculator/BalanceAPYCalculator.css.js +3 -1
  15. package/dist/Calculators/AxosOneCalculator/index.d.ts +3 -0
  16. package/dist/Calculators/AxosOneCalculator/index.js +48 -20
  17. package/dist/Calculators/BalanceAPYCalculator/BalanceAPYCalculator.css.d.ts +2 -30
  18. package/dist/Calculators/BuyDownCalculator/index.d.ts +5 -1
  19. package/dist/Calculators/BuyDownCalculator/index.js +267 -141
  20. package/dist/Calculators/Calculator.d.ts +3 -0
  21. package/dist/Calculators/Calculator.js +8 -4
  22. package/dist/Calculators/calculator.css.d.ts +2 -8
  23. package/dist/CallToActionBar/index.js +1 -1
  24. package/dist/Carousel/Carousel.css.d.ts +8 -19
  25. package/dist/Carousel/index.js +1 -1
  26. package/dist/Chatbot/Bubble.css.d.ts +1 -0
  27. package/dist/Chatbot/Bubble.css.js +3 -1
  28. package/dist/Chatbot/Bubble.js +69 -17
  29. package/dist/Chatbot/ChatWindow.css.d.ts +7 -0
  30. package/dist/Chatbot/ChatWindow.css.js +21 -6
  31. package/dist/Chatbot/ChatWindow.d.ts +6 -0
  32. package/dist/Chatbot/ChatWindow.js +232 -38
  33. package/dist/Chatbot/Chatbot.css.d.ts +2 -1
  34. package/dist/Chatbot/Chatbot.css.js +4 -3
  35. package/dist/Chatbot/Chatbot.d.ts +5 -1
  36. package/dist/Chatbot/Chatbot.js +10 -7
  37. package/dist/Chatbot/EllipsisIcon.d.ts +4 -0
  38. package/dist/Chatbot/EllipsisIcon.js +19 -0
  39. package/dist/Chatbot/index.js +13 -4
  40. package/dist/Chatbot/store/messages.d.ts +1 -0
  41. package/dist/Chatbot/store/messages.js +2 -1
  42. package/dist/Chatbot/useHeadlessChat.d.ts +6 -1
  43. package/dist/Chatbot/useHeadlessChat.js +92 -20
  44. package/dist/Chevron/Chevron.css.d.ts +2 -2
  45. package/dist/Chevron/index.js +1 -1
  46. package/dist/CollectInformationAlert/index.js +1 -1
  47. package/dist/Comparison/Comparison.js +3 -3
  48. package/dist/Comparison/ComparisonSet.js +33 -24
  49. package/dist/ExecutiveBio/ExecutiveBio.js +1 -1
  50. package/dist/FaqAccordion/index.js +1 -1
  51. package/dist/FooterSiteMap/AxosBank/FooterSiteMap.js +13 -6
  52. package/dist/Forms/ApplyNow.js +1 -1
  53. package/dist/Forms/CommercialDepositsNoLendingOption.d.ts +16 -0
  54. package/dist/Forms/CommercialDepositsNoLendingOption.js +330 -0
  55. package/dist/Forms/ContactUsBusiness.d.ts +1 -1
  56. package/dist/Forms/ContactUsBusiness.js +5 -5
  57. package/dist/Forms/ContactUsBusinessNameEmail.js +1 -1
  58. package/dist/Forms/ContactUsLVF.d.ts +5 -1
  59. package/dist/Forms/ContactUsLVF.js +8 -6
  60. package/dist/Forms/ContactUsNMLSId.js +1 -1
  61. package/dist/Forms/CraPublicFile.js +1 -1
  62. package/dist/Forms/EmailOnly.js +1 -1
  63. package/dist/Forms/FormEnums.js +6 -15
  64. package/dist/Forms/Forms.css.d.ts +2 -30
  65. package/dist/Forms/MortgageRate/MortgageRateForm.js +6 -3
  66. package/dist/Forms/MortgageRate/MortgageRateWatch.js +1 -1
  67. package/dist/Forms/MortgageWarehouseLending.js +1 -1
  68. package/dist/Forms/QuickPricer/QuickPricerForm.js +1 -1
  69. package/dist/Forms/SalesforceFieldsForm.d.ts +5 -0
  70. package/dist/Forms/SalesforceFieldsForm.js +11 -1
  71. package/dist/Forms/SuccesForm.js +2 -2
  72. package/dist/Forms/index.d.ts +1 -0
  73. package/dist/Forms/index.js +2 -0
  74. package/dist/HeroBanner/HeroBanner.css.d.ts +5 -17
  75. package/dist/HeroBanner/HeroBanner.js +1 -12
  76. package/dist/HeroBanner/SelectionBanner.css.d.ts +1 -19
  77. package/dist/HeroBanner/SelectionBanner.css.js +6 -6
  78. package/dist/Hyperlink/Hyperlink.css.d.ts +4 -4
  79. package/dist/Hyperlink/Hyperlink.css.js +4 -1
  80. package/dist/Hyperlink/index.js +1 -1
  81. package/dist/IconBillboard/IconBillboard.css.d.ts +6 -40
  82. package/dist/ImageBillboard/ImageBillboard.css.d.ts +5 -61
  83. package/dist/ImageLink/ImageLink.js +1 -1
  84. package/dist/ImageLink/ImageLinkSet.js +1 -1
  85. package/dist/ImageLink/index.js +1 -1
  86. package/dist/Input/Dropdown.js +1 -0
  87. package/dist/Insight/Featured/CategorySelector.js +1 -1
  88. package/dist/Insight/Featured/Featured.js +1 -1
  89. package/dist/Insight/Featured/Header.js +1 -1
  90. package/dist/LandingPageHeader/LandingPageHeader.css.d.ts +2 -0
  91. package/dist/LandingPageHeader/LandingPageHeader.css.js +6 -2
  92. package/dist/LandingPageHeader/LandingPageHeader.js +18 -9
  93. package/dist/LandingPageHeader/index.js +3 -1
  94. package/dist/LoadingIndicator/LoadingIndicator.css.d.ts +4 -4
  95. package/dist/Modal/Modal.css.d.ts +1 -0
  96. package/dist/Modal/Modal.css.js +5 -3
  97. package/dist/Modal/Modal.js +4 -4
  98. package/dist/NavigationMenu/AxosALTS/NavData.js +1 -1
  99. package/dist/NavigationMenu/AxosALTS/index.js +1 -1
  100. package/dist/NavigationMenu/AxosAdvisor/NavBar.css.d.ts +2 -0
  101. package/dist/NavigationMenu/AxosAdvisor/NavBar.css.js +7 -2
  102. package/dist/NavigationMenu/AxosAdvisor/NavBar.module.js +52 -52
  103. package/dist/NavigationMenu/AxosAdvisor/index.js +39 -21
  104. package/dist/NavigationMenu/AxosAdvisorServices/NavBar.css.d.ts +2 -0
  105. package/dist/NavigationMenu/AxosAdvisorServices/NavBar.css.js +7 -2
  106. package/dist/NavigationMenu/AxosAdvisorServices/NavBar.module.js +53 -53
  107. package/dist/NavigationMenu/AxosAdvisorServices/SubNavbar.css.d.ts +1 -1
  108. package/dist/NavigationMenu/AxosAdvisorServices/SubNavbar.css.js +2 -2
  109. package/dist/NavigationMenu/AxosAdvisorServices/index.js +14 -8
  110. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileMenu.js +2 -2
  111. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileMenu.module.js +16 -16
  112. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileNavData.d.ts +1 -3
  113. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileNavData.js +7 -9
  114. package/dist/NavigationMenu/AxosBank/NavBar.css.js +2 -1
  115. package/dist/NavigationMenu/AxosBank/NavBar.module.js +41 -41
  116. package/dist/NavigationMenu/AxosBank/NavData.js +1 -1
  117. package/dist/NavigationMenu/AxosBank/SubNavBar.js +270 -275
  118. package/dist/NavigationMenu/AxosBank/SubNavbar.css.d.ts +2 -0
  119. package/dist/NavigationMenu/AxosBank/SubNavbar.css.js +4 -0
  120. package/dist/NavigationMenu/AxosBank/index.js +1 -1
  121. package/dist/NavigationMenu/AxosClearing/NavBar.module.js +37 -37
  122. package/dist/NavigationMenu/AxosFiduciary/NavBar.module.js +41 -41
  123. package/dist/NavigationMenu/LaVictoire/NavData.js +1 -1
  124. package/dist/NavigationMenu/LaVictoire/index.js +1 -1
  125. package/dist/NavigationMenu/NavDataJson.js +1 -1
  126. package/dist/NavigationMenu/Navbar.js +1 -1
  127. package/dist/NavigationMenu/SignInNavButton.js +1 -1
  128. package/dist/PageNavItem/PageNavItem.css.d.ts +4 -22
  129. package/dist/Pagination/Pagination.js +6 -6
  130. package/dist/SetContainer/SetContainer.js +1 -1
  131. package/dist/SocialMediaBar/iconsRepository.js +1 -1
  132. package/dist/StepItem/StepItem.css.d.ts +8 -36
  133. package/dist/StepItemSet/StepItemSet.css.d.ts +5 -32
  134. package/dist/StepItemSet/StepItemSet.css.js +9 -5
  135. package/dist/StepItemSet/StepItemSet.d.ts +6 -0
  136. package/dist/StepItemSet/StepItemSet.js +22 -3
  137. package/dist/StepItemSet/index.js +2 -1
  138. package/dist/Table/Table.css.d.ts +4 -3
  139. package/dist/Table/Table.css.js +5 -5
  140. package/dist/Table/Table.js +1 -1
  141. package/dist/VideoTile/VideoTile.js +1 -1
  142. package/dist/VideoWrapper/index.js +1 -1
  143. package/dist/WalnutIframe/wrapper.module.js +3 -3
  144. package/dist/assets/Accordion/Accordion.css +2 -2
  145. package/dist/assets/Article/Article.css +47 -59
  146. package/dist/assets/ArticlesSet/ArticlesSet.css +26 -56
  147. package/dist/assets/Auth/SignIn.css +12 -12
  148. package/dist/assets/Avatar/Avatar.css.css +10 -10
  149. package/dist/assets/AwardsBanner/AwardsBanner.css +1 -1
  150. package/dist/assets/AwardsItem/AwardsItem.css +3 -4
  151. package/dist/assets/Blockquote/Blockquote.css.css +17 -17
  152. package/dist/assets/Button/Button.css +28 -28
  153. package/dist/assets/Calculators/AnnualFeeCalculator/AnnualFeeCalculator.css +8 -8
  154. package/dist/assets/Calculators/ApyCalculator/ApyCalculator.css +12 -21
  155. package/dist/assets/Calculators/AxosOneCalculator/BalanceAPYCalculator.css +31 -11
  156. package/dist/assets/Calculators/BalanceAPYCalculator/BalanceAPYCalculator.css +20 -32
  157. package/dist/assets/Calculators/BuyDownCalculator/BuyDownCalculator.css +14 -14
  158. package/dist/assets/Calculators/MonthlyPaymentCalculator/MonthlyPaymentCalculator.css +9 -9
  159. package/dist/assets/Calculators/MonthlyPaymentLVFCalculator/MonthlyPaymentCalculator.css +9 -9
  160. package/dist/assets/Calculators/SummitApyCalculator/BalanceAPYCalculator.css +18 -10
  161. package/dist/assets/Calculators/calculator.css +9 -15
  162. package/dist/assets/CallToActionBar/CallToActionBar.css +1 -4
  163. package/dist/assets/Carousel/Carousel.css +27 -41
  164. package/dist/assets/Chatbot/Bubble.css +11 -0
  165. package/dist/assets/Chatbot/ChatWindow.css +118 -12
  166. package/dist/assets/Chevron/Chevron.css +11 -10
  167. package/dist/assets/CollectInformationAlert/CollectInformationAlert.css +4 -3
  168. package/dist/assets/Comparison/Comparison.css +8 -5
  169. package/dist/assets/ContentBanner/ContentBanner.css +8 -8
  170. package/dist/assets/DownloadTile/DownloadTile.css +6 -6
  171. package/dist/assets/ExecutiveBio/ExecutiveBio.css +27 -27
  172. package/dist/assets/FaqAccordion/FaqAccordion.css +5 -5
  173. package/dist/assets/FooterDisclosure/FooterDisclosure.css +1 -1
  174. package/dist/assets/FooterSiteMap/AxosBank/FooterSiteMap.css +3 -8
  175. package/dist/assets/Forms/Forms.css +45 -63
  176. package/dist/assets/Forms/QuickPricer/UserInformation.css +1 -1
  177. package/dist/assets/HeroBanner/HeroBanner.css +81 -76
  178. package/dist/assets/HeroBanner/LargeBanner.css +15 -15
  179. package/dist/assets/HeroBanner/SelectionBanner.css +15 -29
  180. package/dist/assets/Hyperlink/Hyperlink.css +4 -4
  181. package/dist/assets/IconBillboard/IconBillboard.css +32 -48
  182. package/dist/assets/ImageBillboard/ImageBillboard.css +31 -64
  183. package/dist/assets/Input/Input.css +6 -6
  184. package/dist/assets/Inputs/Input.css +4 -4
  185. package/dist/assets/Insight/Featured/CategorySelector.css +1 -1
  186. package/dist/assets/Interstitial/Interstitial-variants.css +3 -3
  187. package/dist/assets/LandingPageHeader/LandingPageHeader.css +37 -4
  188. package/dist/assets/LoadingIndicator/LoadingIndicator.css +5 -5
  189. package/dist/assets/Modal/Modal.css +17 -28
  190. package/dist/assets/NavigationMenu/AxosALTS/NavBar.css +1 -1
  191. package/dist/assets/NavigationMenu/AxosAdvisor/NavBar.css +25 -2
  192. package/dist/assets/NavigationMenu/AxosAdvisor/NavBar.css.css +138 -126
  193. package/dist/assets/NavigationMenu/AxosAdvisor/SubNavbar.css +5 -4
  194. package/dist/assets/NavigationMenu/AxosAdvisorServices/NavBar.css +25 -2
  195. package/dist/assets/NavigationMenu/AxosAdvisorServices/NavBar.css.css +142 -130
  196. package/dist/assets/NavigationMenu/AxosAdvisorServices/SubNavbar.css +22 -4
  197. package/dist/assets/NavigationMenu/AxosBank/MobileMenu/MobileMenu.css.css +32 -31
  198. package/dist/assets/NavigationMenu/AxosBank/NavBar.css +21 -9
  199. package/dist/assets/NavigationMenu/AxosBank/NavBar.css.css +118 -146
  200. package/dist/assets/NavigationMenu/AxosBank/SubNavbar.css +35 -1
  201. package/dist/assets/NavigationMenu/AxosClearing/NavBar.css.css +133 -107
  202. package/dist/assets/NavigationMenu/AxosFiduciary/NavBar.css.css +84 -83
  203. package/dist/assets/PageNavItem/PageNavItem.css +16 -33
  204. package/dist/assets/Pagination/Pagination.css +1 -1
  205. package/dist/assets/SetContainer/SetContainer.css +4 -4
  206. package/dist/assets/StepItem/StepItem.css +26 -42
  207. package/dist/assets/StepItemSet/StepItemSet.css +40 -36
  208. package/dist/assets/Tab/Tab.css +12 -12
  209. package/dist/assets/Table/Table.css +87 -93
  210. package/dist/assets/TextBlock/TextBlock.css +1 -1
  211. package/dist/assets/TopicalNavItem/TopicalNavItem.css +2 -2
  212. package/dist/assets/TopicalNavSet/TopicalNavSet.css +1 -1
  213. package/dist/assets/VideoTile/VideoTile.css +1 -1
  214. package/dist/assets/WalnutIframe/wrapper.css.css +7 -8
  215. package/dist/assets/globals.css +8 -7
  216. package/dist/assets/icons/ArrowIcon/ArrowIcon.css +3 -3
  217. package/dist/assets/icons/DownloadIcon/DownloadIcon.css +1 -1
  218. package/dist/assets/icons/FollowIcon/FollowIcon.css +1 -1
  219. package/dist/assets/themes/axos.css +30 -30
  220. package/dist/assets/themes/premier.css +31 -31
  221. package/dist/assets/themes/victorie.css +23 -23
  222. package/dist/icons/CheckCircle.js +1 -1
  223. package/dist/icons/CheckCircleLight.js +1 -1
  224. package/dist/icons/CheckIcon/index.js +1 -1
  225. package/dist/icons/Logos/SPB.d.ts +4 -0
  226. package/dist/icons/Logos/SPB.js +132 -0
  227. package/dist/icons/QuoteIconGrey.js +2 -2
  228. package/dist/icons/index.d.ts +1 -0
  229. package/dist/icons/index.js +2 -0
  230. package/dist/main.js +36 -20
  231. package/dist/themes/axos.css.d.ts +12 -12
  232. package/dist/themes/axos.css.js +1 -1
  233. package/package.json +136 -136
@@ -1,11 +1,13 @@
1
1
  "use client";
2
- import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
3
3
  import clsx from "clsx";
4
- import React, { useRef, useEffect, Fragment } from "react";
4
+ import React, { useRef, useEffect, Fragment as Fragment$1 } from "react";
5
5
  import ReactMarkdown from "react-markdown";
6
+ import { useNetworkState, useMount } from "react-use";
6
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, sendButtonStyle, windowStyle, windowOpenStyle } from "./ChatWindow.css.js";
9
+ import { EllipsisIcon } from "./EllipsisIcon.js";
7
10
  import { useOpenChat } from "./store/chat.js";
8
- import { windowBarStyle, chat_title, button_reset, notificationStyle, messageStyle, inline_button_wrapper, messagesContainerStyle, inputStyle, sendButtonStyle, windowStyle, windowOpenStyle } from "./ChatWindow.css.js";
9
11
  const ChatWindow = ({
10
12
  messages,
11
13
  status = "connected",
@@ -14,11 +16,17 @@ const ChatWindow = ({
14
16
  onClose,
15
17
  endChat = () => {
16
18
  console.log("End chat");
17
- }
19
+ },
20
+ showReconnect = false,
21
+ virtualAgent
18
22
  }) => {
23
+ const [mounted, setMounted] = React.useState(false);
24
+ const [menuOpen, setMenuOpen] = React.useState(false);
25
+ const [showEndChatDialog, setShowEndChatDialog] = React.useState(false);
26
+ const state = useNetworkState();
19
27
  const [input, setInput] = React.useState("");
20
28
  const messagesEndRef = useRef(null);
21
- const isOpen = useOpenChat((state) => state.isOpen);
29
+ const isOpen = useOpenChat((state2) => state2.isOpen);
22
30
  useEffect(() => {
23
31
  messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });
24
32
  }, [messages]);
@@ -29,6 +37,13 @@ const ChatWindow = ({
29
37
  setInput("");
30
38
  }
31
39
  };
40
+ useMount(() => {
41
+ setMounted(true);
42
+ });
43
+ const project = process.env.CCAI_PROJECT_ID;
44
+ const isAxos = project === "axos";
45
+ const endUserBg = isAxos ? "#14263d" : "#323339";
46
+ const chatbotBg = isAxos ? "#E9F8FF" : "#EAE8E8";
32
47
  return /* @__PURE__ */ jsxs("div", { className: clsx(windowStyle, isOpen && windowOpenStyle), children: [
33
48
  /* @__PURE__ */ jsxs("div", { className: windowBarStyle, children: [
34
49
  /* @__PURE__ */ jsxs("div", { className: "flex middle", style: { paddingBlock: "6px" }, children: [
@@ -43,6 +58,105 @@ const ChatWindow = ({
43
58
  ),
44
59
  /* @__PURE__ */ jsx("h2", { className: chat_title, children: "Evo Virtual Assistant" })
45
60
  ] }),
61
+ /* @__PURE__ */ jsx(
62
+ "button",
63
+ {
64
+ onClick: () => {
65
+ setMenuOpen(!menuOpen);
66
+ },
67
+ style: {
68
+ border: "none",
69
+ background: "transparent",
70
+ marginLeft: "auto",
71
+ cursor: "pointer",
72
+ padding: 0,
73
+ display: "flex",
74
+ alignContent: "center"
75
+ },
76
+ children: /* @__PURE__ */ jsx(EllipsisIcon, { color: "#fff" })
77
+ }
78
+ ),
79
+ menuOpen && /* @__PURE__ */ jsx("ul", { className: clsx(chatbotMenu), children: /* @__PURE__ */ jsx("li", { className: chatbotMenuItem, children: /* @__PURE__ */ jsx(
80
+ "button",
81
+ {
82
+ type: "button",
83
+ onClick: () => {
84
+ setShowEndChatDialog(true);
85
+ setMenuOpen(false);
86
+ },
87
+ style: { width: "100%" },
88
+ children: "Finish chat"
89
+ }
90
+ ) }) }),
91
+ showEndChatDialog && /* @__PURE__ */ jsxs(Fragment, { children: [
92
+ /* @__PURE__ */ jsx(
93
+ "div",
94
+ {
95
+ style: {
96
+ background: "#00000080",
97
+ position: "fixed",
98
+ top: 0,
99
+ left: 0,
100
+ right: 0,
101
+ bottom: 0,
102
+ zIndex: 999,
103
+ opacity: 0.75
104
+ }
105
+ }
106
+ ),
107
+ /* @__PURE__ */ jsx(
108
+ "dialog",
109
+ {
110
+ open: showEndChatDialog,
111
+ style: {
112
+ padding: "1rem",
113
+ borderRadius: 8,
114
+ background: "#fff",
115
+ color: "#000",
116
+ border: `1px solid ${endUserBg}`,
117
+ outline: "none",
118
+ maxWidth: "90%",
119
+ top: "25%",
120
+ marginInline: "auto",
121
+ zIndex: 1e3
122
+ },
123
+ children: /* @__PURE__ */ jsxs("form", { method: "dialog", className: chatFinishDialog, children: [
124
+ /* @__PURE__ */ jsx("p", { children: "Are you sure you want to end this chat?" }),
125
+ /* @__PURE__ */ jsxs(
126
+ "div",
127
+ {
128
+ style: { display: "flex", gap: "1rem", marginTop: "1rem" },
129
+ children: [
130
+ /* @__PURE__ */ jsx(
131
+ "button",
132
+ {
133
+ className: endChatButtonStyle,
134
+ type: "submit",
135
+ onClick: () => {
136
+ endChat();
137
+ setShowEndChatDialog(false);
138
+ },
139
+ children: "Yes"
140
+ }
141
+ ),
142
+ /* @__PURE__ */ jsx(
143
+ "button",
144
+ {
145
+ className: endChatButtonStyle,
146
+ type: "button",
147
+ onClick: () => {
148
+ setShowEndChatDialog(false);
149
+ },
150
+ children: "No"
151
+ }
152
+ )
153
+ ]
154
+ }
155
+ )
156
+ ] })
157
+ }
158
+ )
159
+ ] }),
46
160
  onClose && /* @__PURE__ */ jsx(
47
161
  "button",
48
162
  {
@@ -51,19 +165,51 @@ const ChatWindow = ({
51
165
  "aria-label": "Close chat",
52
166
  title: "Close",
53
167
  children: /* @__PURE__ */ jsx(
54
- "img",
168
+ "svg",
55
169
  {
56
- src: "https://www.axos.com/images/fXFpk3tIJEym7OWKNuKBU/axb-down-chevron.svg",
57
- height: 24,
58
- width: 24,
59
- alt: ""
170
+ xmlns: "http://www.w3.org/2000/svg",
171
+ width: "24",
172
+ height: "24",
173
+ viewBox: "0 0 24 24",
174
+ fill: "none",
175
+ children: /* @__PURE__ */ jsx(
176
+ "path",
177
+ {
178
+ className: arrowFill,
179
+ d: "M2.46875 7.76574L11.9991 17.2961L21.5294 7.76574L20.4687 6.70508L11.9991 15.1749L3.52941 6.70508L2.46875 7.76574Z",
180
+ fill: "#98DDFF"
181
+ }
182
+ )
60
183
  }
61
184
  )
62
185
  }
63
186
  )
64
187
  ] }),
188
+ mounted && !state.online ? /* @__PURE__ */ jsx("div", { className: clsx(chatNetworkStatus), children: /* @__PURE__ */ jsxs(
189
+ "div",
190
+ {
191
+ style: {
192
+ color: "#d32f2f",
193
+ textAlign: "center",
194
+ padding: "8px 0",
195
+ fontWeight: 500
196
+ },
197
+ children: [
198
+ /* @__PURE__ */ jsx(
199
+ "span",
200
+ {
201
+ role: "img",
202
+ "aria-label": "disconnected",
203
+ style: { marginRight: 6 },
204
+ children: "⚠️"
205
+ }
206
+ ),
207
+ "You are currently disconnected. Please check your connection."
208
+ ]
209
+ }
210
+ ) }) : null,
65
211
  /* @__PURE__ */ jsxs("div", { className: clsx(messagesContainerStyle), children: [
66
- messages?.map((msg) => /* @__PURE__ */ jsxs(Fragment, { children: [
212
+ messages?.map((msg) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
67
213
  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),
68
214
  msg.type == "noti" && msg.$userType == "system" && msg.event == "memberLeft" && /* @__PURE__ */ jsxs("div", { className: notificationStyle, children: [
69
215
  /* @__PURE__ */ jsx("strong", { children: "Virtual Agent" }),
@@ -81,12 +227,12 @@ const ChatWindow = ({
81
227
  style: {
82
228
  textAlign: msg.$userType == "end_user" ? "right" : "left",
83
229
  alignSelf: msg.$userType == "end_user" ? "flex-end" : "flex-start",
84
- background: msg.$userType == "end_user" ? "#14263d" : "#E9F8FF",
230
+ background: msg.$userType == "end_user" ? endUserBg : chatbotBg,
85
231
  color: msg.$userType == "end_user" ? "#fff" : "#1F1F1F",
86
232
  boxShadow: msg.$userType == "end_user" ? "0 1px 4px #b3e0ff55" : void 0
87
233
  },
88
234
  children: [
89
- /* @__PURE__ */ jsx(
235
+ /* @__PURE__ */ jsxs(
90
236
  "div",
91
237
  {
92
238
  style: {
@@ -95,16 +241,48 @@ const ChatWindow = ({
95
241
  flexDirection: "column",
96
242
  gap: 4
97
243
  },
98
- children: /* @__PURE__ */ jsx(
99
- ReactMarkdown,
100
- {
101
- remarkPlugins: [[remarkGfm, { singleTilde: false }]],
102
- components: {
103
- p: ({ ...props }) => /* @__PURE__ */ jsx("p", { style: { margin: 0 }, ...props })
104
- },
105
- children: msg.content
106
- }
107
- )
244
+ children: [
245
+ msg.$userType == "virtual_agent" && /* @__PURE__ */ jsxs(
246
+ "div",
247
+ {
248
+ style: {
249
+ display: "flex",
250
+ // justifyContent: "center",
251
+ alignItems: "center",
252
+ gap: "8px"
253
+ },
254
+ children: [
255
+ /* @__PURE__ */ jsx(
256
+ "img",
257
+ {
258
+ width: 24,
259
+ height: 24,
260
+ src: virtualAgent?.avatar_url,
261
+ alt: "agent avatar"
262
+ }
263
+ ),
264
+ /* @__PURE__ */ jsx("strong", { children: virtualAgent?.name })
265
+ ]
266
+ }
267
+ ),
268
+ /* @__PURE__ */ jsx(
269
+ ReactMarkdown,
270
+ {
271
+ remarkPlugins: [[remarkGfm, { singleTilde: false }]],
272
+ components: {
273
+ p: ({ ...props }) => /* @__PURE__ */ jsx(
274
+ "p",
275
+ {
276
+ style: { margin: 0, fontSize: "inherit" },
277
+ title: new Date(msg.$timestamp).toLocaleString(),
278
+ ...props
279
+ }
280
+ )
281
+ },
282
+ children: msg.content
283
+ }
284
+ )
285
+ ]
108
286
  }
109
287
  ),
110
288
  /* @__PURE__ */ jsx("div", { style: { fontSize: 10, color: "#888", marginTop: 2 } })
@@ -117,11 +295,8 @@ const ChatWindow = ({
117
295
  return /* @__PURE__ */ jsx(
118
296
  "button",
119
297
  {
298
+ className: inline_button,
120
299
  style: {
121
- fontSize: 12,
122
- textAlign: "left",
123
- background: "#fff",
124
- color: "#1e3860",
125
300
  borderRadius: "0px",
126
301
  borderTopLeftRadius: [0].includes(index) ? 8 : 0,
127
302
  borderTopRightRadius: [0].includes(index) ? 8 : 0,
@@ -136,18 +311,36 @@ const ChatWindow = ({
136
311
  index
137
312
  );
138
313
  }) }),
139
- msg.event == "chatEnded" && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
140
- "button",
141
- {
142
- style: {
143
- fontSize: 12,
144
- textAlign: "center"
145
- },
146
- onClick: endChat,
147
- children: "End Chat"
148
- }
149
- ) })
314
+ msg.event == "chatEnded" && /* @__PURE__ */ jsxs(Fragment, { children: [
315
+ /* @__PURE__ */ jsxs(
316
+ "div",
317
+ {
318
+ title: (/* @__PURE__ */ new Date()).toLocaleString(),
319
+ style: {
320
+ fontSize: 12,
321
+ color: "#888",
322
+ marginBottom: 4,
323
+ textAlign: "center"
324
+ },
325
+ children: [
326
+ "Thank you for chatting!",
327
+ /* @__PURE__ */ jsx("br", {}),
328
+ " This conversation has ended."
329
+ ]
330
+ }
331
+ ),
332
+ /* @__PURE__ */ jsx("div", { style: { textAlign: "center", marginBottom: 12 }, children: /* @__PURE__ */ jsx("button", { className: endChatButtonStyle, onClick: endChat, children: "End Chat" }) })
333
+ ] })
150
334
  ] }, msg.$index)),
335
+ showReconnect && /* @__PURE__ */ jsx(
336
+ "button",
337
+ {
338
+ style: { margin: "12px auto", display: "block" },
339
+ onClick: () => {
340
+ },
341
+ children: "Reconnect Chat"
342
+ }
343
+ ),
151
344
  /* @__PURE__ */ jsx("div", { ref: messagesEndRef })
152
345
  ] }),
153
346
  /* @__PURE__ */ jsxs(
@@ -168,6 +361,7 @@ const ChatWindow = ({
168
361
  onChange: (e) => setInput(e.target.value),
169
362
  placeholder: "Ask something...",
170
363
  className: inputStyle,
364
+ autoFocus: true,
171
365
  disabled: inputDisabled || status !== "connected"
172
366
  }
173
367
  ),
@@ -1 +1,2 @@
1
- export declare const chatbotWrapper: string;
1
+ export declare const chatbotAXB: string;
2
+ export declare const chatbotUFB: string;
@@ -1,5 +1,6 @@
1
- import "./Chatbot.css.ts.vanilla.css.js";
2
- var chatbotWrapper = "_1hpv6vm0";
1
+ var chatbotAXB = "_1hpv6vm0";
2
+ var chatbotUFB = "_1hpv6vm1";
3
3
  export {
4
- chatbotWrapper
4
+ chatbotAXB,
5
+ chatbotUFB
5
6
  };
@@ -1 +1,5 @@
1
- export declare const Chatbot: () => import("react/jsx-runtime").JSX.Element;
1
+ export type ChatbotProps = {
2
+ project?: "axos" | "ufb";
3
+ debug?: boolean;
4
+ };
5
+ export declare const Chatbot: (props: ChatbotProps) => import("react/jsx-runtime").JSX.Element;
@@ -2,24 +2,24 @@
2
2
  import { jsxs, jsx } from "react/jsx-runtime";
3
3
  import { authenticate } from "./authenticate.js";
4
4
  import { Bubble } from "./Bubble.js";
5
+ import { chatbotUFB, chatbotAXB } from "./Chatbot.css.js";
5
6
  import { ChatWindow } from "./ChatWindow.js";
6
7
  import { useOpenChat } from "./store/chat.js";
7
8
  import { useMessages } from "./store/messages.js";
8
9
  import { useHeadlessChat } from "./useHeadlessChat.js";
9
- const Chatbot = () => {
10
+ const Chatbot = (props) => {
10
11
  const messages = useMessages((state) => state.messages);
11
12
  const close = useOpenChat((state) => state.close);
12
- const { status, sendMessage } = useHeadlessChat({
13
+ const { status, sendMessage, showReconnect, endChat, virtualAgent } = useHeadlessChat({
13
14
  companyId: process.env.CCAI_COMPANY_ID || "",
14
15
  tenant: process.env.CCAI_TENANT_NAME || "",
15
16
  host: process.env.CCAI_HOST || "",
16
17
  // or your region
17
- projectId: process.env.CCAI_PROJECT_ID || "axos",
18
- // replace with your project id
18
+ projectId: process.env.CCAI_PROJECT_ID || props.project || "axos",
19
19
  getToken: authenticate,
20
- debug: process.env.NODE_ENV === "development"
20
+ debug: props.debug || process.env.NODE_ENV === "development"
21
21
  });
22
- return /* @__PURE__ */ jsxs("div", { children: [
22
+ return /* @__PURE__ */ jsxs("div", { className: props.project === "ufb" ? chatbotUFB : chatbotAXB, children: [
23
23
  /* @__PURE__ */ jsx(Bubble, {}),
24
24
  /* @__PURE__ */ jsx(
25
25
  ChatWindow,
@@ -29,7 +29,10 @@ const Chatbot = () => {
29
29
  messages,
30
30
  onSend: function(msg) {
31
31
  sendMessage(msg);
32
- }
32
+ },
33
+ endChat,
34
+ virtualAgent,
35
+ showReconnect
33
36
  }
34
37
  )
35
38
  ] });
@@ -0,0 +1,4 @@
1
+ export declare const EllipsisIcon: ({ size, color }: {
2
+ size?: number | undefined;
3
+ color?: string | undefined;
4
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ const EllipsisIcon = ({ size = 24, color = "currentColor" }) => /* @__PURE__ */ jsxs(
3
+ "svg",
4
+ {
5
+ width: size,
6
+ height: size,
7
+ viewBox: "0 0 24 24",
8
+ fill: "none",
9
+ "aria-hidden": "true",
10
+ children: [
11
+ /* @__PURE__ */ jsx("circle", { cx: "5", cy: "12", r: "2", fill: color }),
12
+ /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "2", fill: color }),
13
+ /* @__PURE__ */ jsx("circle", { cx: "19", cy: "12", r: "2", fill: color })
14
+ ]
15
+ }
16
+ );
17
+ export {
18
+ EllipsisIcon
19
+ };
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import { Bubble } from "./Bubble.js";
3
- import { bubbleWrapper } from "./Bubble.css.js";
3
+ import { bubbleWrapper, svgFill } from "./Bubble.css.js";
4
4
  import { Chatbot } from "./Chatbot.js";
5
- import { chatbotWrapper } from "./Chatbot.css.js";
5
+ import { chatbotAXB, chatbotUFB } from "./Chatbot.css.js";
6
6
  import { ChatWindow } from "./ChatWindow.js";
7
- import { button_reset, chat_title, inline_button_wrapper, inputStyle, messageStyle, messagesContainerStyle, notificationStyle, sendButtonStyle, windowBarStyle, windowOpenStyle, windowStyle } from "./ChatWindow.css.js";
7
+ import { arrowFill, button_reset, chatFinishDialog, chatNetworkStatus, chat_title, chatbotMenu, chatbotMenuItem, endChatButtonStyle, inline_button, inline_button_wrapper, inputStyle, messageStyle, messagesContainerStyle, notificationStyle, sendButtonStyle, windowBarStyle, windowOpenStyle, windowStyle } from "./ChatWindow.css.js";
8
8
  import { useOpenChat } from "./store/chat.js";
9
9
  import { useMessages } from "./store/messages.js";
10
10
  import { useHeadlessChat } from "./useHeadlessChat.js";
@@ -12,16 +12,25 @@ export {
12
12
  Bubble,
13
13
  ChatWindow,
14
14
  Chatbot,
15
+ arrowFill,
15
16
  bubbleWrapper,
16
17
  button_reset,
18
+ chatFinishDialog,
19
+ chatNetworkStatus,
17
20
  chat_title,
18
- chatbotWrapper,
21
+ chatbotAXB,
22
+ chatbotMenu,
23
+ chatbotMenuItem,
24
+ chatbotUFB,
25
+ endChatButtonStyle,
26
+ inline_button,
19
27
  inline_button_wrapper,
20
28
  inputStyle,
21
29
  messageStyle,
22
30
  messagesContainerStyle,
23
31
  notificationStyle,
24
32
  sendButtonStyle,
33
+ svgFill,
25
34
  useHeadlessChat,
26
35
  useMessages,
27
36
  useOpenChat,
@@ -5,6 +5,7 @@ interface MessageStore {
5
5
  addMessage: (message: MessageResponse) => void;
6
6
  removeMessage: (id: string) => void;
7
7
  addMessages: (newMessages: MessageResponse[]) => void;
8
+ clearMessages: () => void;
8
9
  }
9
10
  export interface Message {
10
11
  id: string;
@@ -5,7 +5,8 @@ const useMessages = create((set) => ({
5
5
  removeMessage: (id) => set((state) => ({
6
6
  messages: state.messages.filter((msg) => msg.id !== id)
7
7
  })),
8
- addMessages: (newMessages) => set((state) => ({ messages: [...state.messages, ...newMessages] }))
8
+ addMessages: (newMessages) => set((state) => ({ messages: [...state.messages, ...newMessages] })),
9
+ clearMessages: () => set({ messages: [] })
9
10
  }));
10
11
  export {
11
12
  useMessages
@@ -8,6 +8,7 @@ interface UseHeadlessChatOptions {
8
8
  channelId?: string;
9
9
  projectId?: "axos" | "" | "ufb" | string;
10
10
  debug?: boolean;
11
+ menuOption?: string;
11
12
  }
12
13
  export interface ChatMessage {
13
14
  id: string;
@@ -15,8 +16,12 @@ export interface ChatMessage {
15
16
  sender?: string;
16
17
  timestamp?: string;
17
18
  }
18
- export declare function useHeadlessChat({ companyId, tenant, host, getToken, projectId, debug, }: UseHeadlessChatOptions): {
19
+ export declare function useHeadlessChat({ companyId, tenant, host, getToken, projectId, debug, menuOption, }: UseHeadlessChatOptions): {
19
20
  status: "error" | "idle" | "connected" | "connecting" | "finished";
20
21
  sendMessage: (body: string) => Promise<void>;
22
+ showReconnect: boolean;
23
+ setShowReconnect: import('react').Dispatch<import('react').SetStateAction<boolean>>;
24
+ endChat: () => Promise<void>;
25
+ virtualAgent: any;
21
26
  };
22
27
  export {};