@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.
- package/dist/ATMLocator/ATMLocator.d.ts +1 -1
- package/dist/ATMLocator/ATMLocator.js +2 -2
- package/dist/Accordion/Accordion.d.ts +3 -3
- package/dist/Article/Article.d.ts +1 -1
- package/dist/Auth/ErrorAlert.d.ts +1 -1
- package/dist/Auth/ErrorAlert.js +3 -3
- package/dist/Auth/Logout.d.ts +1 -1
- package/dist/Auth/SignInPassword.d.ts +1 -1
- package/dist/BulletItem/BulletItem.d.ts +1 -1
- package/dist/Button/Button.d.ts +1 -1
- package/dist/Button/Button.js +2 -2
- package/dist/Button/GoBackButton.d.ts +1 -1
- package/dist/Calculators/Calculator.d.ts +1 -1
- package/dist/Calculators/Calculator.js +3 -3
- package/dist/Calculators/MarginTradingCalculator/index.js +2 -2
- package/dist/Carousel/index.d.ts +3 -3
- package/dist/Carousel/index.js +2 -2
- package/dist/Chatbot/AnimatedGradientBorder.css.d.ts +5 -0
- package/dist/Chatbot/AnimatedGradientBorder.css.js +13 -3
- package/dist/Chatbot/Bubble.css.js +1 -0
- package/dist/Chatbot/Bubble.d.ts +1 -1
- package/dist/Chatbot/Chat.d.ts +1 -0
- package/dist/Chatbot/Chat.js +158 -0
- package/dist/Chatbot/ChatWindow.css.d.ts +6 -0
- package/dist/Chatbot/ChatWindow.css.js +47 -35
- package/dist/Chatbot/ChatWindow.js +134 -68
- package/dist/Chatbot/Chatbot.css.js +0 -1
- package/dist/Chatbot/Chatbot.css.ts.vanilla.css.js +1 -0
- package/dist/Chatbot/Chatbot.d.ts +1 -1
- package/dist/Chatbot/Chatbot.js +47 -20
- package/dist/Chatbot/ChatbotMessage.js +184 -159
- package/dist/Chatbot/EllipsisAnimation.d.ts +1 -1
- package/dist/Chatbot/EllipsisAnimation.js +0 -6
- package/dist/Chatbot/EllipsisIcon.d.ts +1 -1
- package/dist/Chatbot/index.js +7 -1
- package/dist/Chatbot/useHeadlessChat.d.ts +27 -0
- package/dist/Chatbot/useHeadlessChat.js +240 -0
- package/dist/Chevron/index.js +2 -2
- package/dist/Comparison/Comparison.d.ts +1 -1
- package/dist/Comparison/Comparison.js +2 -2
- package/dist/Comparison/ComparisonSet.d.ts +1 -1
- package/dist/ExecutiveBio/ExecutiveBio.d.ts +1 -1
- package/dist/ExecutiveBio/ExecutiveBio.js +2 -2
- package/dist/ExecutiveBio/ExecutiveBioSet.d.ts +1 -1
- package/dist/ExecutiveBio/Overlay.d.ts +1 -1
- package/dist/FaqAccordion/index.d.ts +5 -5
- package/dist/FaqAccordion/index.js +2 -2
- package/dist/FdicCallout/index.d.ts +1 -1
- package/dist/FooterDisclosure/FooterDisclosure.d.ts +4 -4
- package/dist/FooterDisclosure/LVF/LaVictorieFooter.d.ts +1 -1
- package/dist/FooterSiteMap/AxosBank/FooterSiteMap.d.ts +1 -1
- package/dist/FooterSiteMap/AxosBank/FooterSiteMap.js +2 -2
- package/dist/Forms/ApplicationStart.d.ts +1 -1
- package/dist/Forms/ApplyNow.d.ts +1 -1
- package/dist/Forms/ApplyNow.js +2 -2
- package/dist/Forms/BoatMooringLocation.d.ts +1 -1
- package/dist/Forms/ClearingForm.d.ts +1 -1
- package/dist/Forms/CommercialDeposits.d.ts +1 -1
- package/dist/Forms/CommercialDepositsNoLendingOption.d.ts +1 -1
- package/dist/Forms/CommercialLending.d.ts +1 -1
- package/dist/Forms/CommercialPremiumFinance.d.ts +1 -1
- package/dist/Forms/ConstructionLendingDynamic.d.ts +1 -1
- package/dist/Forms/ContactCompany.d.ts +1 -1
- package/dist/Forms/ContactCompanyTitle.d.ts +1 -1
- package/dist/Forms/ContactUs.d.ts +1 -1
- package/dist/Forms/ContactUsAAS.d.ts +1 -1
- package/dist/Forms/ContactUsBusiness.d.ts +1 -1
- package/dist/Forms/ContactUsBusiness.js +2 -2
- package/dist/Forms/ContactUsBusinessNameEmail.d.ts +1 -1
- package/dist/Forms/ContactUsBusinessNameEmail.js +2 -2
- package/dist/Forms/ContactUsLVF.d.ts +1 -1
- package/dist/Forms/ContactUsNMLSId.d.ts +1 -1
- package/dist/Forms/ContactUsNMLSId.js +2 -2
- package/dist/Forms/ContactUsSchwabAAS.d.ts +1 -1
- package/dist/Forms/CpraRequest.d.ts +1 -1
- package/dist/Forms/CpraRequest.js +2 -2
- package/dist/Forms/CraPublicFile.d.ts +1 -1
- package/dist/Forms/CraPublicFile.js +2 -2
- package/dist/Forms/DealerServices.d.ts +1 -1
- package/dist/Forms/EmailOnly.d.ts +1 -1
- package/dist/Forms/EmailOnly.js +2 -2
- package/dist/Forms/EmailUs.d.ts +1 -1
- package/dist/Forms/HoneyPot/index.d.ts +1 -1
- package/dist/Forms/MortgageRate/MortgageRateForm.d.ts +1 -1
- package/dist/Forms/MortgageRate/MortgageRateForm.js +2 -2
- package/dist/Forms/MortgageRate/MortgageRateQuoteFilters.d.ts +1 -1
- package/dist/Forms/MortgageRate/MortgageRateWatch.d.ts +1 -1
- package/dist/Forms/MortgageRate/MortgageRateWatch.js +2 -2
- package/dist/Forms/MortgageWarehouseLending.d.ts +2 -2
- package/dist/Forms/MortgageWarehouseLending.js +9 -9
- package/dist/Forms/QuickPricer/QuickPricerForm.d.ts +1 -1
- package/dist/Forms/QuickPricer/UserInformation.d.ts +1 -1
- package/dist/Forms/ScheduleCall.d.ts +1 -1
- package/dist/Forms/ScheduleCallPremier.d.ts +1 -1
- package/dist/Forms/SuccesForm.d.ts +1 -1
- package/dist/Forms/SuccesForm.js +3 -3
- package/dist/Forms/VendorQuestionnaire.d.ts +1 -1
- package/dist/Forms/WcplSurvey.d.ts +1 -1
- package/dist/HeroBanner/HeroBanner.d.ts +1 -1
- package/dist/HeroBanner/HeroVideoPoster.d.ts +1 -1
- package/dist/HeroBanner/LargeHeroBanner.d.ts +1 -1
- package/dist/Hyperlink/index.js +2 -2
- package/dist/IconBillboard/IconBillboard.d.ts +1 -1
- package/dist/IconBillboard/IconBillboardSet.d.ts +1 -1
- package/dist/IconBillboard/sections/CallToActionSection.d.ts +1 -1
- package/dist/IconBillboard/sections/HeaderSection.d.ts +2 -2
- package/dist/IconBillboard/sections/IconSection.d.ts +1 -1
- package/dist/IconBillboard/sections/ItemsSection.d.ts +1 -1
- package/dist/IconBillboard/sections/LayoutSection.d.ts +1 -1
- package/dist/ImageBillboard/ExitIntentModal/ModalWrapper.d.ts +1 -1
- package/dist/ImageBillboard/ImageBillboard.d.ts +1 -1
- package/dist/ImageBillboard/ImageBillboardSet.d.ts +1 -1
- package/dist/ImageLink/ImageLink.d.ts +1 -1
- package/dist/ImageLink/ImageLink.js +2 -2
- package/dist/ImageLink/ImageLinkSet.d.ts +1 -1
- package/dist/ImageLink/ImageLinkSet.js +2 -2
- package/dist/ImageLink/index.js +2 -2
- package/dist/ImageWrapper/ImageWrapper.d.ts +1 -1
- package/dist/Insight/Featured/CategorySelector.d.ts +2 -2
- package/dist/Insight/Featured/CategorySelector.js +2 -2
- package/dist/Insight/Featured/Featured.d.ts +2 -2
- package/dist/Insight/Featured/Featured.js +2 -2
- package/dist/Insight/Featured/Header.d.ts +1 -1
- package/dist/Insight/Featured/Header.js +2 -2
- package/dist/LandingPageHeader/LandingPageHeader.d.ts +1 -1
- package/dist/LoadingIndicator/index.d.ts +1 -1
- package/dist/MainHTML/index.d.ts +1 -1
- package/dist/Modal/Modal.js +2 -2
- package/dist/Modal/contextApi/store.d.ts +1 -4
- package/dist/Modal/contextApi/store.js +34 -3
- package/dist/NavigationMenu/AxosALTS/index.d.ts +1 -1
- package/dist/NavigationMenu/AxosALTS/index.js +2 -2
- package/dist/NavigationMenu/AxosAdvisor/SubNavBar.d.ts +1 -1
- package/dist/NavigationMenu/AxosAdvisor/index.d.ts +1 -1
- package/dist/NavigationMenu/AxosAdvisorServices/SubNavBar.d.ts +1 -1
- package/dist/NavigationMenu/AxosAdvisorServices/index.d.ts +1 -1
- package/dist/NavigationMenu/AxosBank/MobileMenu/MobileMenu.d.ts +1 -1
- package/dist/NavigationMenu/AxosBank/MobileMenu/MobileMenu.js +2 -2
- package/dist/NavigationMenu/AxosBank/SubNavBar.d.ts +1 -1
- package/dist/NavigationMenu/AxosBank/SubNavBar.js +2 -2
- package/dist/NavigationMenu/AxosBank/index.d.ts +1 -1
- package/dist/NavigationMenu/AxosBank/index.js +3 -2
- package/dist/NavigationMenu/AxosClearing/SubNavBar.d.ts +1 -1
- package/dist/NavigationMenu/AxosClearing/index.d.ts +1 -1
- package/dist/NavigationMenu/AxosFiduciary/index.d.ts +1 -1
- package/dist/NavigationMenu/LaVictoire/SubNavBar.d.ts +1 -1
- package/dist/NavigationMenu/LaVictoire/index.d.ts +1 -1
- package/dist/NavigationMenu/LaVictoire/index.js +2 -2
- package/dist/NavigationMenu/NavItem/index.d.ts +1 -1
- package/dist/NavigationMenu/Navbar.d.ts +1 -1
- package/dist/NavigationMenu/Navbar.js +2 -2
- package/dist/NavigationMenu/SignInNavButton.d.ts +1 -3
- package/dist/NavigationMenu/SignInNavButton.js +3 -2
- package/dist/Pagination/Pagination.d.ts +1 -1
- package/dist/SecondaryFooter/index.d.ts +1 -1
- package/dist/SetContainer/SetContainer.d.ts +1 -1
- package/dist/SetContainer/SetContainer.js +2 -2
- package/dist/SocialMediaBar/iconsRepository.d.ts +14 -14
- package/dist/SocialMediaBar/iconsRepository.js +2 -2
- package/dist/SocialMediaBar/index.d.ts +1 -1
- package/dist/Tab/Tab.d.ts +1 -1
- package/dist/Tab/TabContainer.d.ts +1 -1
- package/dist/Table/Table.d.ts +5 -5
- package/dist/TextBlock/TextBlock.d.ts +1 -1
- package/dist/Topic/Topic.d.ts +4 -4
- package/dist/VideoTile/VideoInit.d.ts +1 -1
- package/dist/VideoTile/VideoTile.js +2 -2
- package/dist/VideoWrapper/index.js +2 -2
- package/dist/WalnutIframe/index.d.ts +1 -1
- package/dist/assets/Chatbot/AnimatedGradientBorder.css +99 -12
- package/dist/assets/Chatbot/Bubble.css +26 -7
- package/dist/assets/Chatbot/ChatWindow.css +155 -74
- package/dist/assets/globals.css +3 -0
- package/dist/icons/AxosX/Blue.d.ts +1 -1
- package/dist/icons/AxosX/index.d.ts +1 -1
- package/dist/icons/CheckCircle.d.ts +1 -1
- package/dist/icons/CheckCircleLight.d.ts +1 -1
- package/dist/icons/CheckIcon/index.d.ts +1 -1
- package/dist/icons/ChevronDown.d.ts +1 -1
- package/dist/icons/ChevronUp.d.ts +1 -1
- package/dist/icons/Clock/index.d.ts +1 -1
- package/dist/icons/EqualHousingLender.d.ts +1 -1
- package/dist/icons/Logos/AAS.d.ts +1 -1
- package/dist/icons/Logos/AFS.d.ts +1 -1
- package/dist/icons/Logos/AXA.d.ts +1 -1
- package/dist/icons/Logos/AXB.d.ts +1 -1
- package/dist/icons/Logos/AXC.d.ts +1 -1
- package/dist/icons/Logos/AXI.d.ts +1 -1
- package/dist/icons/Logos/AXOS.d.ts +1 -1
- package/dist/icons/Logos/GBLVF.d.ts +1 -1
- package/dist/icons/Logos/LVF.d.ts +1 -1
- package/dist/icons/Logos/LVFText.d.ts +1 -1
- package/dist/icons/Logos/SPB.d.ts +1 -1
- package/dist/icons/MemberFdicLogo.d.ts +1 -1
- package/dist/icons/QuoteIconGrey.d.ts +1 -1
- package/dist/icons/QuoteIconWhite.d.ts +1 -1
- package/dist/icons/QuoteIconYellow.d.ts +1 -1
- package/dist/main.js +7 -1
- package/package.json +147 -147
- package/dist/assets/Chatbot/Chatbot.css +0 -3
|
@@ -9,7 +9,7 @@ import '../assets/themes/victorie.css';import '../assets/themes/ufb.css';import
|
|
|
9
9
|
/* empty css */
|
|
10
10
|
/* empty css */
|
|
11
11
|
import clsx from "clsx";
|
|
12
|
-
import { shimmerText, notificationStyle, messageStyle, user_msg, agent_msg, inline_button_wrapper, inline_button, endChatButtonStyle } from "./ChatWindow.css.js";
|
|
12
|
+
import { shimmerText, notificationStyle, trMortgageTable, tableCell, tableHead, tableMsg, messageStyle, user_msg, agent_msg, inline_button_wrapper, inline_button, endChatButtonStyle } from "./ChatWindow.css.js";
|
|
13
13
|
import { useOpenChat } from "./store/chat.js";
|
|
14
14
|
function timeAgo(date) {
|
|
15
15
|
const seconds = Math.floor(((/* @__PURE__ */ new Date()).getTime() - date.getTime()) / 1e3);
|
|
@@ -68,172 +68,197 @@ const ChatbotMessage = ({
|
|
|
68
68
|
}
|
|
69
69
|
);
|
|
70
70
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
"You are now connected with a",
|
|
79
|
-
" ",
|
|
80
|
-
msg.to_agent ? /* @__PURE__ */ jsx("strong", { children: msg?.to_agent?.name }) : "an agent"
|
|
81
|
-
] }, msg.$index),
|
|
82
|
-
msg.type == "noti" && msg.$userType == "virtual_agent" && msg.event == "escalationDeflected" && /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
83
|
-
"div",
|
|
84
|
-
{
|
|
85
|
-
className: notificationStyle,
|
|
86
|
-
style: { fontSize: 12 },
|
|
87
|
-
children: [
|
|
88
|
-
"Our chat team is available weekdays, 8am-5pm, except federal bank holidays. For immediate assistance you can reach out to us at",
|
|
89
|
-
" ",
|
|
90
|
-
/* @__PURE__ */ jsx("a", { href: "tel:1-888-502-2967", children: "1-888-502-2967" }),
|
|
91
|
-
"."
|
|
92
|
-
]
|
|
71
|
+
const checkInformationMortgage = typeof msg.content == "string" ? msg.content.replace(/•/g, "-").replace(/\\n/g, "\n") : "";
|
|
72
|
+
return /* @__PURE__ */ jsxs(
|
|
73
|
+
"div",
|
|
74
|
+
{
|
|
75
|
+
style: {
|
|
76
|
+
display: "flex",
|
|
77
|
+
flexDirection: "column"
|
|
93
78
|
},
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
79
|
+
children: [
|
|
80
|
+
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),
|
|
81
|
+
msg.type == "noti" && msg.$userType == "system" && msg.event == "memberLeft" && /* @__PURE__ */ jsxs("div", { className: notificationStyle, children: [
|
|
82
|
+
/* @__PURE__ */ jsx("strong", { children: "Virtual Agent" }),
|
|
83
|
+
" just left the conversation."
|
|
84
|
+
] }, msg.$index),
|
|
85
|
+
msg.type == "noti" && msg.$userType == "system" && msg.event == "escalationAccepted" && /* @__PURE__ */ jsxs("div", { className: notificationStyle, children: [
|
|
86
|
+
"You are now connected with a",
|
|
87
|
+
" ",
|
|
88
|
+
msg.to_agent ? /* @__PURE__ */ jsx("strong", { children: msg?.to_agent?.name }) : "an agent"
|
|
89
|
+
] }, msg.$index),
|
|
90
|
+
msg.type == "noti" && msg.$userType == "virtual_agent" && msg.event == "escalationDeflected" && /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
91
|
+
"div",
|
|
92
|
+
{
|
|
93
|
+
className: notificationStyle,
|
|
94
|
+
style: { fontSize: 12 },
|
|
95
|
+
children: [
|
|
96
|
+
"Our chat team is available weekdays, 8am-5pm, except federal bank holidays. For immediate assistance you can reach out to us at",
|
|
97
|
+
" ",
|
|
98
|
+
/* @__PURE__ */ jsx("a", { href: "tel:1-888-502-2967", children: "1-888-502-2967" }),
|
|
99
|
+
"."
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
msg.$index
|
|
103
|
+
) }),
|
|
104
|
+
["text", "markdown_template", "markdown"].includes(msg.type) && /* @__PURE__ */ jsx(
|
|
105
|
+
"div",
|
|
106
|
+
{
|
|
107
|
+
className: clsx(
|
|
108
|
+
messageStyle,
|
|
109
|
+
msg.$userType == "end_user" ? user_msg : agent_msg
|
|
110
|
+
),
|
|
111
|
+
children: /* @__PURE__ */ jsxs(
|
|
112
|
+
"div",
|
|
113
|
+
{
|
|
114
|
+
style: {
|
|
115
|
+
fontSize: 14,
|
|
116
|
+
display: "flex",
|
|
117
|
+
flexDirection: "column",
|
|
118
|
+
gap: 4
|
|
119
|
+
},
|
|
120
|
+
children: [
|
|
121
|
+
msg.$userType == "virtual_agent" && /* @__PURE__ */ jsxs(
|
|
122
|
+
"div",
|
|
123
|
+
{
|
|
124
|
+
style: {
|
|
125
|
+
display: "flex",
|
|
126
|
+
alignItems: "center",
|
|
127
|
+
gap: "8px"
|
|
128
|
+
},
|
|
129
|
+
children: [
|
|
130
|
+
showAvatar && /* @__PURE__ */ jsx(
|
|
131
|
+
"img",
|
|
132
|
+
{
|
|
133
|
+
width: 24,
|
|
134
|
+
height: 24,
|
|
135
|
+
src: virtualAgent?.avatar_url,
|
|
136
|
+
alt: "agent avatar"
|
|
137
|
+
}
|
|
138
|
+
),
|
|
139
|
+
showName && /* @__PURE__ */ jsx("strong", { children: virtualAgent?.name })
|
|
140
|
+
]
|
|
141
|
+
}
|
|
142
|
+
),
|
|
143
|
+
msg.$userType != "end_user" ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
144
|
+
ReactMarkdown,
|
|
145
|
+
{
|
|
146
|
+
remarkPlugins: [[remarkGfm, { singleTilde: false }]],
|
|
147
|
+
components: {
|
|
148
|
+
p: ({ ...props }) => /* @__PURE__ */ jsx(
|
|
149
|
+
"p",
|
|
150
|
+
{
|
|
151
|
+
style: { margin: 0, fontSize: "inherit" },
|
|
152
|
+
title: new Date(msg.$timestamp).toLocaleTimeString([], {
|
|
153
|
+
hour: "2-digit",
|
|
154
|
+
minute: "2-digit"
|
|
155
|
+
}),
|
|
156
|
+
...props
|
|
157
|
+
}
|
|
158
|
+
),
|
|
159
|
+
a: ({ ...props }) => /* @__PURE__ */ jsx("a", { style: { wordBreak: "break-word" }, ...props }),
|
|
160
|
+
table: ({ node, ...props }) => /* @__PURE__ */ jsx("div", { style: { overflowX: "auto", marginTop: 4 }, children: /* @__PURE__ */ jsx(
|
|
161
|
+
"table",
|
|
162
|
+
{
|
|
163
|
+
...props,
|
|
164
|
+
className: clsx(tableMsg),
|
|
165
|
+
style: { tableLayout: "fixed" }
|
|
166
|
+
}
|
|
167
|
+
) }),
|
|
168
|
+
th: ({ node, ...props }) => /* @__PURE__ */ jsx("th", { ...props, className: clsx(tableHead) }),
|
|
169
|
+
td: ({ node, ...props }) => /* @__PURE__ */ jsx("td", { ...props, className: clsx(tableCell) }),
|
|
170
|
+
tr: ({ node, ...props }) => {
|
|
171
|
+
return /* @__PURE__ */ jsx("tr", { className: clsx(trMortgageTable), ...props });
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
children: msg?.content?.includes("Does this information look correct?") ? checkInformationMortgage : msg.content
|
|
175
|
+
}
|
|
176
|
+
) }) : /* @__PURE__ */ jsx(
|
|
177
|
+
"div",
|
|
178
|
+
{
|
|
179
|
+
title: new Date(msg.$timestamp).toLocaleTimeString([], {
|
|
180
|
+
hour: "2-digit",
|
|
181
|
+
minute: "2-digit"
|
|
182
|
+
}),
|
|
183
|
+
children: msg.content
|
|
184
|
+
}
|
|
185
|
+
)
|
|
186
|
+
]
|
|
187
|
+
}
|
|
188
|
+
)
|
|
189
|
+
},
|
|
190
|
+
msg.$index
|
|
102
191
|
),
|
|
103
|
-
|
|
192
|
+
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) => {
|
|
193
|
+
return /* @__PURE__ */ jsx(
|
|
194
|
+
"button",
|
|
195
|
+
{
|
|
196
|
+
className: inline_button,
|
|
197
|
+
onClick: () => {
|
|
198
|
+
onSend?.(button?.title);
|
|
199
|
+
},
|
|
200
|
+
children: button.title
|
|
201
|
+
},
|
|
202
|
+
index
|
|
203
|
+
);
|
|
204
|
+
}) }),
|
|
205
|
+
" ",
|
|
206
|
+
msg.event == "chatEnded" && msg.status == "failed" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
207
|
+
/* @__PURE__ */ jsxs(
|
|
208
|
+
"div",
|
|
209
|
+
{
|
|
210
|
+
title: (/* @__PURE__ */ new Date()).toLocaleString(),
|
|
211
|
+
style: {
|
|
212
|
+
fontSize: 12,
|
|
213
|
+
color: "#888",
|
|
214
|
+
marginBottom: 4,
|
|
215
|
+
textAlign: "center"
|
|
216
|
+
},
|
|
217
|
+
children: [
|
|
218
|
+
"No team members are online at the moment.",
|
|
219
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
220
|
+
" Please try again later."
|
|
221
|
+
]
|
|
222
|
+
}
|
|
223
|
+
),
|
|
224
|
+
/* @__PURE__ */ jsx("div", { style: { textAlign: "center", marginBottom: 12 }, children: /* @__PURE__ */ jsx("button", { className: endChatButtonStyle, onClick: onEndChat, children: "End Chat" }) })
|
|
225
|
+
] }),
|
|
226
|
+
msg.event == "chatEnded" && msg.status != "failed" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
227
|
+
/* @__PURE__ */ jsxs(
|
|
228
|
+
"div",
|
|
229
|
+
{
|
|
230
|
+
title: (/* @__PURE__ */ new Date()).toLocaleString(),
|
|
231
|
+
style: {
|
|
232
|
+
fontSize: 12,
|
|
233
|
+
color: "#888",
|
|
234
|
+
marginBottom: 4,
|
|
235
|
+
textAlign: "center"
|
|
236
|
+
},
|
|
237
|
+
children: [
|
|
238
|
+
"Thank you for chatting!",
|
|
239
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
240
|
+
" This conversation has ended."
|
|
241
|
+
]
|
|
242
|
+
}
|
|
243
|
+
),
|
|
244
|
+
/* @__PURE__ */ jsx("div", { style: { textAlign: "center", marginBottom: 12 }, children: /* @__PURE__ */ jsx("button", { className: endChatButtonStyle, onClick: onEndChat, children: "End Chat" }) })
|
|
245
|
+
] }),
|
|
246
|
+
msg.type == "text" && /* @__PURE__ */ jsx(
|
|
104
247
|
"div",
|
|
105
248
|
{
|
|
106
249
|
style: {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
250
|
+
textAlign: msg.$userType === "end_user" ? "right" : "left",
|
|
251
|
+
fontSize: 12,
|
|
252
|
+
color: vars.chatbot.window.timestampColor,
|
|
253
|
+
textTransform: "capitalize",
|
|
254
|
+
fontFamily: "inherit"
|
|
111
255
|
},
|
|
112
|
-
children:
|
|
113
|
-
msg.$userType == "virtual_agent" && /* @__PURE__ */ jsxs(
|
|
114
|
-
"div",
|
|
115
|
-
{
|
|
116
|
-
style: {
|
|
117
|
-
display: "flex",
|
|
118
|
-
alignItems: "center",
|
|
119
|
-
gap: "8px"
|
|
120
|
-
},
|
|
121
|
-
children: [
|
|
122
|
-
showAvatar && /* @__PURE__ */ jsx(
|
|
123
|
-
"img",
|
|
124
|
-
{
|
|
125
|
-
width: 24,
|
|
126
|
-
height: 24,
|
|
127
|
-
src: virtualAgent?.avatar_url,
|
|
128
|
-
alt: "agent avatar"
|
|
129
|
-
}
|
|
130
|
-
),
|
|
131
|
-
showName && /* @__PURE__ */ jsx("strong", { children: virtualAgent?.name })
|
|
132
|
-
]
|
|
133
|
-
}
|
|
134
|
-
),
|
|
135
|
-
msg.$userType != "end_user" ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
136
|
-
ReactMarkdown,
|
|
137
|
-
{
|
|
138
|
-
remarkPlugins: [[remarkGfm, { singleTilde: false }]],
|
|
139
|
-
components: {
|
|
140
|
-
p: ({ ...props }) => /* @__PURE__ */ jsx(
|
|
141
|
-
"p",
|
|
142
|
-
{
|
|
143
|
-
style: { margin: 0, fontSize: "inherit" },
|
|
144
|
-
title: new Date(msg.$timestamp).toLocaleTimeString([], {
|
|
145
|
-
hour: "2-digit",
|
|
146
|
-
minute: "2-digit"
|
|
147
|
-
}),
|
|
148
|
-
...props
|
|
149
|
-
}
|
|
150
|
-
),
|
|
151
|
-
a: ({ ...props }) => /* @__PURE__ */ jsx("a", { style: { wordBreak: "break-word" }, ...props })
|
|
152
|
-
},
|
|
153
|
-
children: msg.content
|
|
154
|
-
}
|
|
155
|
-
) }) : /* @__PURE__ */ jsx(
|
|
156
|
-
"div",
|
|
157
|
-
{
|
|
158
|
-
title: new Date(msg.$timestamp).toLocaleTimeString([], {
|
|
159
|
-
hour: "2-digit",
|
|
160
|
-
minute: "2-digit"
|
|
161
|
-
}),
|
|
162
|
-
children: msg.content
|
|
163
|
-
}
|
|
164
|
-
)
|
|
165
|
-
]
|
|
256
|
+
children: timeText
|
|
166
257
|
}
|
|
167
258
|
)
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
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) => {
|
|
172
|
-
return /* @__PURE__ */ jsx(
|
|
173
|
-
"button",
|
|
174
|
-
{
|
|
175
|
-
className: inline_button,
|
|
176
|
-
onClick: () => {
|
|
177
|
-
onSend?.(button?.title);
|
|
178
|
-
},
|
|
179
|
-
children: button.title
|
|
180
|
-
},
|
|
181
|
-
index
|
|
182
|
-
);
|
|
183
|
-
}) }),
|
|
184
|
-
" ",
|
|
185
|
-
msg.event == "chatEnded" && msg.status == "failed" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
186
|
-
/* @__PURE__ */ jsxs(
|
|
187
|
-
"div",
|
|
188
|
-
{
|
|
189
|
-
title: (/* @__PURE__ */ new Date()).toLocaleString(),
|
|
190
|
-
style: {
|
|
191
|
-
fontSize: 12,
|
|
192
|
-
color: "#888",
|
|
193
|
-
marginBottom: 4,
|
|
194
|
-
textAlign: "center"
|
|
195
|
-
},
|
|
196
|
-
children: [
|
|
197
|
-
"No team members are online at the moment.",
|
|
198
|
-
/* @__PURE__ */ jsx("br", {}),
|
|
199
|
-
" Please try again later."
|
|
200
|
-
]
|
|
201
|
-
}
|
|
202
|
-
),
|
|
203
|
-
/* @__PURE__ */ jsx("div", { style: { textAlign: "center", marginBottom: 12 }, children: /* @__PURE__ */ jsx("button", { className: endChatButtonStyle, onClick: onEndChat, children: "End Chat" }) })
|
|
204
|
-
] }),
|
|
205
|
-
msg.event == "chatEnded" && msg.status != "failed" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
206
|
-
/* @__PURE__ */ jsxs(
|
|
207
|
-
"div",
|
|
208
|
-
{
|
|
209
|
-
title: (/* @__PURE__ */ new Date()).toLocaleString(),
|
|
210
|
-
style: {
|
|
211
|
-
fontSize: 12,
|
|
212
|
-
color: "#888",
|
|
213
|
-
marginBottom: 4,
|
|
214
|
-
textAlign: "center"
|
|
215
|
-
},
|
|
216
|
-
children: [
|
|
217
|
-
"Thank you for chatting!",
|
|
218
|
-
/* @__PURE__ */ jsx("br", {}),
|
|
219
|
-
" This conversation has ended."
|
|
220
|
-
]
|
|
221
|
-
}
|
|
222
|
-
),
|
|
223
|
-
/* @__PURE__ */ jsx("div", { style: { textAlign: "center", marginBottom: 12 }, children: /* @__PURE__ */ jsx("button", { className: endChatButtonStyle, onClick: onEndChat, children: "End Chat" }) })
|
|
224
|
-
] }),
|
|
225
|
-
msg.type == "text" && /* @__PURE__ */ jsx(
|
|
226
|
-
"div",
|
|
227
|
-
{
|
|
228
|
-
style: {
|
|
229
|
-
textAlign: msg.$userType === "end_user" ? "right" : "left",
|
|
230
|
-
fontSize: 12,
|
|
231
|
-
color: vars.chatbot.window.timestampColor
|
|
232
|
-
},
|
|
233
|
-
children: timeText
|
|
234
|
-
}
|
|
235
|
-
)
|
|
236
|
-
] });
|
|
259
|
+
]
|
|
260
|
+
}
|
|
261
|
+
);
|
|
237
262
|
};
|
|
238
263
|
export {
|
|
239
264
|
ChatbotMessage
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const EllipsisLoader: () => import("react").JSX.Element;
|
|
1
|
+
declare const EllipsisLoader: () => import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
export default EllipsisLoader;
|
|
@@ -30,9 +30,6 @@ const loadingTransition = {
|
|
|
30
30
|
ease: "easeInOut"
|
|
31
31
|
};
|
|
32
32
|
const EllipsisLoader = () => {
|
|
33
|
-
const project = process.env.CCAI_PROJECT_ID;
|
|
34
|
-
const isAxos = project === "axos";
|
|
35
|
-
const endUserBg = isAxos ? "#14263d" : "#323339";
|
|
36
33
|
return /* @__PURE__ */ jsxs(
|
|
37
34
|
motion.svg,
|
|
38
35
|
{
|
|
@@ -49,7 +46,6 @@ const EllipsisLoader = () => {
|
|
|
49
46
|
cx: "20",
|
|
50
47
|
cy: "15",
|
|
51
48
|
r: "8",
|
|
52
|
-
fill: endUserBg,
|
|
53
49
|
variants: loadingCircleVariants,
|
|
54
50
|
transition: loadingTransition
|
|
55
51
|
}
|
|
@@ -60,7 +56,6 @@ const EllipsisLoader = () => {
|
|
|
60
56
|
cx: "50",
|
|
61
57
|
cy: "15",
|
|
62
58
|
r: "8",
|
|
63
|
-
fill: endUserBg,
|
|
64
59
|
variants: loadingCircleVariants,
|
|
65
60
|
transition: loadingTransition
|
|
66
61
|
}
|
|
@@ -71,7 +66,6 @@ const EllipsisLoader = () => {
|
|
|
71
66
|
cx: "80",
|
|
72
67
|
cy: "15",
|
|
73
68
|
r: "8",
|
|
74
|
-
fill: endUserBg,
|
|
75
69
|
variants: loadingCircleVariants,
|
|
76
70
|
transition: loadingTransition
|
|
77
71
|
}
|
package/dist/Chatbot/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { borderHoverGradient, bubbleButton, bubbleText, bubbleWrapper, inner, sv
|
|
|
4
4
|
import { Chatbot, audioManager } from "./Chatbot.js";
|
|
5
5
|
import { chatbotAXB, chatbotUFB } from "./Chatbot.css.js";
|
|
6
6
|
import { ChatWindow } from "./ChatWindow.js";
|
|
7
|
-
import { agent_msg, arrowFill, autoResize, button_bar, button_reset, buttonss_section, chatEndCircle, chatEndDialogOverlay, chatFinishDialog, chatNetworkStatus, chat_title, chatbotMenu, chatbotMenuItem, endChatButtonStyle, expandToggleStyle, inline_button, inline_button_wrapper, inputStyle, left_bar_section, messageStyle, messagesContainerStyle, noAnswerButton, notificationStyle, sendButtonStyle, shimmerText, thankyou_image, thankyou_message, thankyou_overlay, user_msg, windowBarStyle, windowExpandedStyle, windowOpenStyle, windowStyle } from "./ChatWindow.css.js";
|
|
7
|
+
import { agent_msg, arrowFill, autoResize, button_bar, button_reset, buttonss_section, chatAiDisclaimer, chatEndCircle, chatEndDialogOverlay, chatFinishDialog, chatNetworkStatus, chat_title, chatbotMenu, chatbotMenuItem, endChatButtonStyle, expandToggleStyle, formTextButton, inline_button, inline_button_wrapper, inputStyle, left_bar_section, messageStyle, messagesContainerStyle, noAnswerButton, notificationStyle, sendButtonStyle, shimmerText, tableCell, tableHead, tableMsg, thankyou_image, thankyou_message, thankyou_overlay, trMortgageTable, user_msg, windowBarStyle, windowExpandedStyle, windowOpenStyle, windowStyle } from "./ChatWindow.css.js";
|
|
8
8
|
import { useOpenChat } from "./store/chat.js";
|
|
9
9
|
import { useMessages } from "./store/messages.js";
|
|
10
10
|
export {
|
|
@@ -22,6 +22,7 @@ export {
|
|
|
22
22
|
button_bar,
|
|
23
23
|
button_reset,
|
|
24
24
|
buttonss_section,
|
|
25
|
+
chatAiDisclaimer,
|
|
25
26
|
chatEndCircle,
|
|
26
27
|
chatEndDialogOverlay,
|
|
27
28
|
chatFinishDialog,
|
|
@@ -33,6 +34,7 @@ export {
|
|
|
33
34
|
chatbotUFB,
|
|
34
35
|
endChatButtonStyle,
|
|
35
36
|
expandToggleStyle,
|
|
37
|
+
formTextButton,
|
|
36
38
|
inline_button,
|
|
37
39
|
inline_button_wrapper,
|
|
38
40
|
inner,
|
|
@@ -45,9 +47,13 @@ export {
|
|
|
45
47
|
sendButtonStyle,
|
|
46
48
|
shimmerText,
|
|
47
49
|
svgFill,
|
|
50
|
+
tableCell,
|
|
51
|
+
tableHead,
|
|
52
|
+
tableMsg,
|
|
48
53
|
thankyou_image,
|
|
49
54
|
thankyou_message,
|
|
50
55
|
thankyou_overlay,
|
|
56
|
+
trMortgageTable,
|
|
51
57
|
useMessages,
|
|
52
58
|
useOpenChat,
|
|
53
59
|
user_msg,
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { TokenResponse } from '@ujet/websdk-headless';
|
|
2
|
+
|
|
3
|
+
interface UseHeadlessChatOptions {
|
|
4
|
+
companyId: string;
|
|
5
|
+
tenant: string;
|
|
6
|
+
host: string;
|
|
7
|
+
getToken: () => Promise<TokenResponse>;
|
|
8
|
+
channelId?: string;
|
|
9
|
+
projectId?: "axos" | "" | "ufb" | string;
|
|
10
|
+
debug?: boolean;
|
|
11
|
+
menuOption?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ChatMessage {
|
|
14
|
+
id: string;
|
|
15
|
+
body: string;
|
|
16
|
+
sender?: string;
|
|
17
|
+
timestamp?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare function useHeadlessChat({ companyId, tenant, host, getToken, projectId, debug, menuOption, }: UseHeadlessChatOptions): {
|
|
20
|
+
status: "error" | "idle" | "connected" | "connecting" | "finished";
|
|
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;
|
|
26
|
+
};
|
|
27
|
+
export {};
|