@axos-web-dev/shared-components 1.0.99 → 1.0.100-chat.1

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 (162) hide show
  1. package/dist/ATMLocator/ATMLocator.js +8 -1
  2. package/dist/ArticlesSet/ArticlesSet.js +2 -2
  3. package/dist/Auth/ErrorAlert.js +10 -3
  4. package/dist/Blockquote/Blockquote.module.js +3 -3
  5. package/dist/Button/Button.js +10 -3
  6. package/dist/Calculators/Calculator.js +23 -4
  7. package/dist/Calculators/MarineLoanMonthlyPaymentCalculator/index.d.ts +9 -0
  8. package/dist/Calculators/MarineLoanMonthlyPaymentCalculator/index.js +219 -0
  9. package/dist/Calculators/MaxLoanCalculator/index.js +22 -5
  10. package/dist/Calculators/MonthlyPaymentCalculator/MonthlyPaymentCalculator.css.d.ts +1 -0
  11. package/dist/Calculators/MonthlyPaymentCalculator/MonthlyPaymentCalculator.css.js +2 -0
  12. package/dist/Calculators/MonthlyPaymentCalculator/index.js +15 -5
  13. package/dist/Calculators/index.d.ts +2 -1
  14. package/dist/Calculators/index.js +3 -1
  15. package/dist/Carousel/index.js +10 -3
  16. package/dist/Chatbot/Bubble.css.d.ts +2 -0
  17. package/dist/Chatbot/Bubble.css.js +8 -0
  18. package/dist/Chatbot/Bubble.d.ts +3 -0
  19. package/dist/Chatbot/Bubble.js +100 -0
  20. package/dist/Chatbot/Chat.d.ts +1 -0
  21. package/dist/Chatbot/Chat.js +165 -0
  22. package/dist/Chatbot/ChatWindow.css.d.ts +16 -0
  23. package/dist/Chatbot/ChatWindow.css.js +35 -0
  24. package/dist/Chatbot/ChatWindow.d.ts +29 -0
  25. package/dist/Chatbot/ChatWindow.js +329 -0
  26. package/dist/Chatbot/Chatbot.css.d.ts +2 -0
  27. package/dist/Chatbot/Chatbot.css.js +6 -0
  28. package/dist/Chatbot/Chatbot.css.ts.vanilla.css.js +1 -0
  29. package/dist/Chatbot/Chatbot.d.ts +5 -0
  30. package/dist/Chatbot/Chatbot.js +42 -0
  31. package/dist/Chatbot/EllipsisIcon.d.ts +4 -0
  32. package/dist/Chatbot/EllipsisIcon.js +19 -0
  33. package/dist/Chatbot/authenticate.d.ts +3 -0
  34. package/dist/Chatbot/authenticate.js +16 -0
  35. package/dist/Chatbot/index.d.ts +9 -0
  36. package/dist/Chatbot/index.js +38 -0
  37. package/dist/Chatbot/store/chat.d.ts +9 -0
  38. package/dist/Chatbot/store/chat.js +11 -0
  39. package/dist/Chatbot/store/messages.d.ts +15 -0
  40. package/dist/Chatbot/store/messages.js +13 -0
  41. package/dist/Chatbot/useHeadlessChat.d.ts +26 -0
  42. package/dist/Chatbot/useHeadlessChat.js +193 -0
  43. package/dist/Chevron/index.js +10 -3
  44. package/dist/Comparison/Comparison.js +10 -3
  45. package/dist/ExecutiveBio/ExecutiveBio.js +10 -3
  46. package/dist/FaqAccordion/index.js +10 -3
  47. package/dist/FooterSiteMap/AxosBank/FooterSiteMap.js +10 -3
  48. package/dist/Forms/ApplicationStart.d.ts +1 -1
  49. package/dist/Forms/ApplicationStart.js +111 -89
  50. package/dist/Forms/ApplyNow.d.ts +2 -2
  51. package/dist/Forms/ApplyNow.js +178 -146
  52. package/dist/Forms/ClearingForm.d.ts +1 -1
  53. package/dist/Forms/ClearingForm.js +184 -162
  54. package/dist/Forms/CommercialDeposits.d.ts +1 -1
  55. package/dist/Forms/CommercialDeposits.js +201 -179
  56. package/dist/Forms/CommercialLending.d.ts +1 -1
  57. package/dist/Forms/CommercialLending.js +278 -256
  58. package/dist/Forms/CommercialPremiumFinance.d.ts +1 -1
  59. package/dist/Forms/CommercialPremiumFinance.js +128 -106
  60. package/dist/Forms/ContactCompany.d.ts +1 -1
  61. package/dist/Forms/ContactCompany.js +113 -91
  62. package/dist/Forms/ContactCompanyTitle.d.ts +1 -1
  63. package/dist/Forms/ContactCompanyTitle.js +127 -105
  64. package/dist/Forms/ContactUs.d.ts +1 -1
  65. package/dist/Forms/ContactUs.js +99 -77
  66. package/dist/Forms/ContactUsAAS.d.ts +1 -1
  67. package/dist/Forms/ContactUsAAS.js +180 -158
  68. package/dist/Forms/ContactUsBusiness.d.ts +1 -1
  69. package/dist/Forms/ContactUsBusiness.js +143 -115
  70. package/dist/Forms/ContactUsBusinessNameEmail.d.ts +1 -1
  71. package/dist/Forms/ContactUsBusinessNameEmail.js +112 -84
  72. package/dist/Forms/ContactUsLVF.d.ts +3 -1
  73. package/dist/Forms/ContactUsLVF.js +127 -101
  74. package/dist/Forms/ContactUsNMLSId.d.ts +1 -1
  75. package/dist/Forms/ContactUsNMLSId.js +126 -98
  76. package/dist/Forms/CpraRequest.d.ts +1 -1
  77. package/dist/Forms/CpraRequest.js +641 -619
  78. package/dist/Forms/CraPublicFile.d.ts +1 -1
  79. package/dist/Forms/CraPublicFile.js +118 -90
  80. package/dist/Forms/DealerServices.d.ts +1 -1
  81. package/dist/Forms/DealerServices.js +225 -204
  82. package/dist/Forms/EmailOnly.d.ts +1 -1
  83. package/dist/Forms/EmailOnly.js +65 -39
  84. package/dist/Forms/EmailUs.d.ts +1 -1
  85. package/dist/Forms/EmailUs.js +75 -53
  86. package/dist/Forms/FormProps.d.ts +3 -0
  87. package/dist/Forms/Forms.css.d.ts +18 -0
  88. package/dist/Forms/Forms.css.js +44 -38
  89. package/dist/Forms/HoneyPot/HoneyPot.css.d.ts +1 -0
  90. package/dist/Forms/HoneyPot/HoneyPot.css.js +5 -0
  91. package/dist/Forms/HoneyPot/index.d.ts +23 -0
  92. package/dist/Forms/HoneyPot/index.js +69 -0
  93. package/dist/Forms/MortgageRate/MortgageRateForm.d.ts +1 -1
  94. package/dist/Forms/MortgageRate/MortgageRateForm.js +376 -348
  95. package/dist/Forms/MortgageRate/MortgageRateWatch.js +10 -3
  96. package/dist/Forms/MortgageWarehouseLending.d.ts +11 -0
  97. package/dist/Forms/MortgageWarehouseLending.js +343 -0
  98. package/dist/Forms/QuickPricer/QuickPricerForm.d.ts +1 -1
  99. package/dist/Forms/QuickPricer/QuickPricerForm.js +624 -609
  100. package/dist/Forms/ScheduleCall.d.ts +1 -1
  101. package/dist/Forms/ScheduleCall.js +156 -134
  102. package/dist/Forms/ScheduleCallPremier.d.ts +1 -1
  103. package/dist/Forms/ScheduleCallPremier.js +178 -156
  104. package/dist/Forms/SuccesForm.js +14 -7
  105. package/dist/Forms/VendorQuestionnaire.d.ts +1 -1
  106. package/dist/Forms/VendorQuestionnaire.js +817 -795
  107. package/dist/Forms/WcplSurvey.d.ts +1 -1
  108. package/dist/Forms/WcplSurvey.js +112 -90
  109. package/dist/Forms/applynow-utils.d.ts +1 -0
  110. package/dist/Forms/applynow-utils.js +48 -0
  111. package/dist/Forms/index.d.ts +3 -0
  112. package/dist/Forms/index.js +12 -2
  113. package/dist/HeroBanner/HeroBanner.js +42 -1
  114. package/dist/Hyperlink/index.js +10 -3
  115. package/dist/IconBillboard/sections/CallToActionSection.js +2 -1
  116. package/dist/ImageBillboard/ExitIntentModal/useExitIntentModal.js +6 -1
  117. package/dist/ImageLink/ImageLink.js +10 -3
  118. package/dist/ImageLink/ImageLinkSet.js +10 -3
  119. package/dist/ImageLink/index.js +10 -3
  120. package/dist/Input/Input.js +3 -1
  121. package/dist/Insight/Featured/CategorySelector.js +10 -3
  122. package/dist/Insight/Featured/Featured.js +10 -3
  123. package/dist/Insight/Featured/Header.js +10 -3
  124. package/dist/Modal/Modal.js +10 -3
  125. package/dist/NavigationMenu/AxosALTS/NavData.js +10 -3
  126. package/dist/NavigationMenu/AxosALTS/index.js +10 -3
  127. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileMenu.module.js +16 -16
  128. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileNavData.d.ts +1 -0
  129. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileNavData.js +25 -7
  130. package/dist/NavigationMenu/AxosBank/NavBar.module.js +39 -39
  131. package/dist/NavigationMenu/AxosBank/NavData.js +10 -3
  132. package/dist/NavigationMenu/AxosBank/SubNavBar.js +32 -8
  133. package/dist/NavigationMenu/AxosBank/index.js +10 -3
  134. package/dist/NavigationMenu/LaVictoire/NavData.js +10 -3
  135. package/dist/NavigationMenu/LaVictoire/index.js +10 -3
  136. package/dist/NavigationMenu/NavDataJson.d.ts +2 -0
  137. package/dist/NavigationMenu/NavDataJson.js +315 -0
  138. package/dist/NavigationMenu/Navbar.d.ts +5 -0
  139. package/dist/NavigationMenu/Navbar.js +201 -0
  140. package/dist/NavigationMenu/SignInNavButton.d.ts +1 -0
  141. package/dist/NavigationMenu/SignInNavButton.js +369 -0
  142. package/dist/SetContainer/SetContainer.js +10 -3
  143. package/dist/SocialMediaBar/iconsRepository.js +10 -3
  144. package/dist/Table/Table.d.ts +1 -1
  145. package/dist/VideoTile/VideoTile.js +10 -3
  146. package/dist/VideoWrapper/index.js +10 -3
  147. package/dist/assets/Blockquote/Blockquote.css.css +68 -68
  148. package/dist/assets/Calculators/MonthlyPaymentCalculator/MonthlyPaymentCalculator.css +3 -0
  149. package/dist/assets/Chatbot/Bubble.css +51 -0
  150. package/dist/assets/Chatbot/ChatWindow.css +196 -0
  151. package/dist/assets/Forms/Forms.css +135 -105
  152. package/dist/assets/Forms/HoneyPot/HoneyPot.css +8 -0
  153. package/dist/assets/NavigationMenu/AxosBank/MobileMenu/MobileMenu.css.css +191 -191
  154. package/dist/assets/NavigationMenu/AxosBank/NavBar.css.css +473 -473
  155. package/dist/assets/utils/optimizeImage/optimizeImage.css.css +47 -47
  156. package/dist/icons/Logos/AXB.d.ts +8 -0
  157. package/dist/icons/Logos/AXB.js +74 -0
  158. package/dist/main.d.ts +1 -0
  159. package/dist/main.js +50 -3
  160. package/dist/utils/allowedAxosDomains.js +2 -1
  161. package/dist/utils/optimizeImage/optimizeImage.module.js +3 -3
  162. package/package.json +136 -133
@@ -6,7 +6,7 @@ import { getVariant } from "../utils/getVariant.js";
6
6
  import { section_text } from "../IconBillboard/IconBillboard.css.js";
7
7
  import "../icons/ArrowIcon/ArrowIcon.css.js";
8
8
  import "../icons/CheckIcon/CheckIcon.css.js";
9
- import '../assets/VideoWrapper/VideoWrapper.css';import '../assets/TopicalNavSet/TopicalNavSet.css';import '../assets/TopicalNavItem/TopicalNavItem.css';import '../assets/Topic/Topic.css';import '../assets/TextBlock/TextBlock.css';import '../assets/SocialMediaBar/SocialMediaBar.css';import '../assets/SecondaryFooter/SecondaryFooter.css';import '../assets/Pagination/Pagination.css';import '../assets/PageNavSet/PageNavigationSet.css';import '../assets/NavigationMenu/LaVictoire/NavBar.css';import '../assets/NavigationMenu/AxosALTS/NavBar.css';import '../assets/NavigationMenu/AxosClearing/NavBar.css';import '../assets/NavigationMenu/AxosBank/SubNavbar.css';import '../assets/NavigationMenu/AxosBank/NavBar.css';import '../assets/NavigationMenu/AxosAdvisorServices/SubNavbar.css';import '../assets/NavigationMenu/AxosAdvisorServices/NavBar.css';import '../assets/NavigationMenu/AxosAdvisor/SubNavbar.css';import '../assets/NavigationMenu/AxosAdvisor/NavBar.css';import '../assets/Insight/Insight.css';import '../assets/Insight/Featured/Header.css';import '../assets/Insight/Featured/CategorySelector.css';import '../assets/Insight/Featured/Featured.css';import '../assets/ImageLink/ImageLink.css';import '../assets/VideoTile/VideoTile.css';import '../assets/HelpArticle/HelpArticle.css';import '../assets/FooterSiteMap/AxosBank/FooterSiteMap.css';import '../assets/FooterDisclosure/LVF/LaVictorieFooter.css';import '../assets/DownloadTile/DownloadTile.css';import '../assets/CollectInformationAlert/CollectInformationAlert.css';import '../assets/CallToActionBar/CallToActionBar.css';import '../assets/AwardsItem/AwardsItem.css';import '../assets/AwardsBanner/AwardsBanner.css';import '../assets/Auth/SignIn.css';import '../assets/Auth/ErrorAlert.css';import '../assets/Calculators/MarginTradingCalculator/MarginTradingCalculator.css';import '../assets/Forms/QuickPricer/UserInformation.css';import '../assets/Modal/Modal.css';import '../assets/Forms/QuickPricer/QuickPricerResults.css';import '../assets/BulletItem/BulletItem.css';import '../assets/Typography/Typography.css';import '../assets/icons/FollowIcon/FollowIcon.css';import '../assets/icons/DownloadIcon/DownloadIcon.css';import '../assets/themes/victorie.css';import '../assets/themes/premier.css';import '../assets/themes/axos.css';/* empty css */
9
+ import '../assets/VideoWrapper/VideoWrapper.css';import '../assets/TopicalNavSet/TopicalNavSet.css';import '../assets/TopicalNavItem/TopicalNavItem.css';import '../assets/Topic/Topic.css';import '../assets/TextBlock/TextBlock.css';import '../assets/SocialMediaBar/SocialMediaBar.css';import '../assets/SecondaryFooter/SecondaryFooter.css';import '../assets/Pagination/Pagination.css';import '../assets/PageNavSet/PageNavigationSet.css';import '../assets/NavigationMenu/LaVictoire/NavBar.css';import '../assets/NavigationMenu/AxosALTS/NavBar.css';import '../assets/NavigationMenu/AxosClearing/NavBar.css';import '../assets/NavigationMenu/AxosBank/SubNavbar.css';import '../assets/NavigationMenu/AxosBank/NavBar.css';import '../assets/NavigationMenu/AxosAdvisorServices/SubNavbar.css';import '../assets/NavigationMenu/AxosAdvisorServices/NavBar.css';import '../assets/NavigationMenu/AxosAdvisor/SubNavbar.css';import '../assets/NavigationMenu/AxosAdvisor/NavBar.css';import '../assets/Insight/Insight.css';import '../assets/Insight/Featured/Header.css';import '../assets/Insight/Featured/CategorySelector.css';import '../assets/Insight/Featured/Featured.css';import '../assets/ImageLink/ImageLink.css';import '../assets/VideoTile/VideoTile.css';import '../assets/HelpArticle/HelpArticle.css';import '../assets/FooterSiteMap/AxosBank/FooterSiteMap.css';import '../assets/FooterDisclosure/LVF/LaVictorieFooter.css';import '../assets/DownloadTile/DownloadTile.css';import '../assets/CollectInformationAlert/CollectInformationAlert.css';import '../assets/Chatbot/ChatWindow.css';import '../assets/Chatbot/Bubble.css';import '../assets/CallToActionBar/CallToActionBar.css';import '../assets/AwardsItem/AwardsItem.css';import '../assets/AwardsBanner/AwardsBanner.css';import '../assets/Auth/SignIn.css';import '../assets/Auth/ErrorAlert.css';import '../assets/Calculators/MarginTradingCalculator/MarginTradingCalculator.css';import '../assets/Forms/QuickPricer/UserInformation.css';import '../assets/Modal/Modal.css';import '../assets/Forms/QuickPricer/QuickPricerResults.css';import '../assets/BulletItem/BulletItem.css';import '../assets/Typography/Typography.css';import '../assets/icons/FollowIcon/FollowIcon.css';import '../assets/icons/DownloadIcon/DownloadIcon.css';import '../assets/themes/victorie.css';import '../assets/themes/premier.css';import '../assets/themes/axos.css';/* empty css */
10
10
  /* empty css */
11
11
  /* empty css */
12
12
  /* empty css */
@@ -41,8 +41,11 @@ import "../Input/InputPhone.js";
41
41
  import "../Input/InputTextArea.js";
42
42
  import "../Input/DownPaymentInput.js";
43
43
  import "../Input/RadioButton.js";
44
+ import "../Input/PercentageInput.js";
44
45
  import "react-hook-form";
46
+ import "../Calculators/BuyDownCalculator/BuyDownCalculator.css.js";
45
47
  import "../Forms/Forms.css.js";
48
+ import "../Forms/HoneyPot/index.js";
46
49
  import "../Forms/SalesforceFieldsForm.js";
47
50
  import "../Input/RadioButton.css.js";
48
51
  import "../Input/Checkbox.css.js";
@@ -61,8 +64,6 @@ import "iframe-resizer";
61
64
  import "../Calculators/MonthlyPaymentCalculator/MonthlyPaymentCalculator.css.js";
62
65
  import "../Calculators/MonthlyPaymentLVFCalculator/MonthlyPaymentCalculator.css.js";
63
66
  import "../Calculators/SummitApyCalculator/BalanceAPYCalculator.css.js";
64
- import "../Input/PercentageInput.js";
65
- import "../Calculators/BuyDownCalculator/BuyDownCalculator.css.js";
66
67
  /* empty css */
67
68
  import "react-dom";
68
69
  /* empty css */
@@ -70,6 +71,12 @@ import "../Auth/SignInPassword.js";
70
71
  /* empty css */
71
72
  /* empty css */
72
73
  /* empty css */
74
+ import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
75
+ /* empty css */
76
+ import "../Chatbot/store/chat.js";
77
+ import "../Chatbot/authenticate.js";
78
+ /* empty css */
79
+ import "../Chatbot/store/messages.js";
73
80
  /* empty css */
74
81
  import "../Comparison/Comparison.css.js";
75
82
  import "next/image.js";
@@ -0,0 +1,2 @@
1
+ export declare const bubbleWrapper: string;
2
+ export declare const svgFill: string;
@@ -0,0 +1,8 @@
1
+ import "./Chatbot.css.ts.vanilla.css.js";
2
+ import '../assets/Chatbot/Bubble.css';/* empty css */
3
+ var bubbleWrapper = "_7u9pv30";
4
+ var svgFill = "_7u9pv31";
5
+ export {
6
+ bubbleWrapper,
7
+ svgFill
8
+ };
@@ -0,0 +1,3 @@
1
+ import { PropsWithChildren } from 'react';
2
+
3
+ export declare const Bubble: ({ children }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,100 @@
1
+ "use client";
2
+ import { jsxs, jsx } from "react/jsx-runtime";
3
+ import { AnimatePresence, motion } from "framer-motion";
4
+ import { bubbleWrapper, svgFill } from "./Bubble.css.js";
5
+ import { useOpenChat } from "./store/chat.js";
6
+ const Bubble = ({ children }) => {
7
+ const isOpen = useOpenChat((state) => state.isOpen);
8
+ const toggle = useOpenChat((state) => state.toggle);
9
+ return /* @__PURE__ */ jsxs("div", { className: bubbleWrapper, onClick: toggle, children: [
10
+ /* @__PURE__ */ jsx("div", { className: "bubble-circle flex", children: /* @__PURE__ */ jsx(AnimatePresence, { children: !isOpen ? /* @__PURE__ */ jsxs(
11
+ motion.svg,
12
+ {
13
+ xmlns: "http://www.w3.org/2000/svg",
14
+ width: "39",
15
+ height: "39",
16
+ viewBox: "0 0 39 39",
17
+ fill: "none",
18
+ initial: { scale: 0.1, opacity: 0 },
19
+ animate: {
20
+ scale: 1,
21
+ opacity: 1,
22
+ transition: {
23
+ default: { type: "spring" },
24
+ opacity: { ease: [0, 0.71, 0.2, 1.01] }
25
+ }
26
+ },
27
+ children: [
28
+ /* @__PURE__ */ jsx(
29
+ "path",
30
+ {
31
+ className: svgFill,
32
+ d: "M3 7.5C3 5.01472 5.01472 3 7.5 3H22.5V0H7.5C3.35786 0 0 3.35786 0 7.5V16.5H3V7.5Z",
33
+ fill: "#98DDFF"
34
+ }
35
+ ),
36
+ /* @__PURE__ */ jsx(
37
+ "path",
38
+ {
39
+ className: svgFill,
40
+ fillRule: "evenodd",
41
+ clipRule: "evenodd",
42
+ d: "M13.5 30H12C8.68629 30 6 27.3137 6 24V12C6 8.68629 8.68629 6 12 6H33C36.3137 6 39 8.68629 39 12V24C39 27.3137 36.3137 30 33 30H26.25L18.6213 37.6287C16.7314 39.5186 13.5 38.1801 13.5 35.5074V30ZM16.5 35.5074V27H12C10.3431 27 9 25.6569 9 24V12C9 10.3431 10.3431 9 12 9H33C34.6569 9 36 10.3431 36 12V24C36 25.6569 34.6569 27 33 27H25.0074L16.5 35.5074Z",
43
+ fill: "#98DDFF"
44
+ }
45
+ )
46
+ ]
47
+ }
48
+ ) : /* @__PURE__ */ jsx("span", { className: "close-icon", children: /* @__PURE__ */ jsxs(
49
+ motion.svg,
50
+ {
51
+ xmlns: "http://www.w3.org/2000/svg",
52
+ width: "24",
53
+ height: "24",
54
+ viewBox: "0 0 24 24",
55
+ fill: "none",
56
+ initial: { opacity: 0, rotate: 0, scale: 0.1 },
57
+ animate: {
58
+ opacity: 1,
59
+ rotate: -360,
60
+ scale: 1,
61
+ transition: {
62
+ default: { type: "spring" },
63
+ opacity: { ease: "linear" },
64
+ scale: { ease: "linear" }
65
+ }
66
+ },
67
+ children: [
68
+ /* @__PURE__ */ jsx(
69
+ "path",
70
+ {
71
+ className: svgFill,
72
+ d: "M23.7096 0.892655L23.1073 0.290383C22.7202 -0.0967942 22.0749 -0.0967942 21.6447 0.290383L13.6 8.33506L15.6649 10.4L23.7096 2.35533C24.0968 1.92513 24.0968 1.27983 23.7096 0.892655Z",
73
+ fill: "#98DDFF"
74
+ }
75
+ ),
76
+ /* @__PURE__ */ jsx(
77
+ "path",
78
+ {
79
+ className: svgFill,
80
+ d: "M2.44278 0.293744C2.04123 -0.0979148 1.37197 -0.0979148 0.925804 0.293744L0.301162 0.902989C-0.100387 1.29465 -0.100387 1.94742 0.301162 2.38259L10.1168 12L0.301162 21.6174C-0.100387 22.0091 -0.100387 22.6618 0.301162 23.097L0.925804 23.7063C1.32735 24.0979 1.99661 24.0979 2.44278 23.7063L14.4 12.0435L2.44278 0.293744Z",
81
+ fill: "#98DDFF"
82
+ }
83
+ ),
84
+ /* @__PURE__ */ jsx(
85
+ "path",
86
+ {
87
+ className: svgFill,
88
+ d: "M23.7096 23.1073L23.1073 23.7096C22.7202 24.0968 22.0749 24.0968 21.6447 23.7096L13.6 15.6649L15.6649 13.6L23.7096 21.6446C24.0968 22.0748 24.0968 22.7201 23.7096 23.1073Z",
89
+ fill: "#98DDFF"
90
+ }
91
+ )
92
+ ]
93
+ }
94
+ ) }) }) }),
95
+ children
96
+ ] });
97
+ };
98
+ export {
99
+ Bubble
100
+ };
@@ -0,0 +1 @@
1
+ export default function Chat(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,165 @@
1
+ "use client";
2
+ import { jsxs, jsx } from "react/jsx-runtime";
3
+ import { useRef, useEffect } from "react";
4
+ import { authenticate } from "./authenticate.js";
5
+ import { useMessages } from "./store/messages.js";
6
+ const companyId = process.env.CCAI_COMPANY_ID || "";
7
+ const tenant = process.env.CCAI_TENANT_NAME || "";
8
+ const host = process.env.CCAI_HOST || "";
9
+ const COBROWSE_CONSENT_TEMPLATE = `
10
+ <script class="cobrowse-template" type="text/template">
11
+ <div class="cobrowse">
12
+ <div class="cobrowse-title">$title</div>
13
+ <div class="cobrowse-content">$content</div>
14
+ <div class="cobrowse-footer">
15
+ <button class="cobrowse-deny js-cobrowse-deny">$deny</button>
16
+ <button class="cobrowse-allow js-cobrowse-allow">$allow</button>
17
+ </div>
18
+ </div>
19
+ <\/script>
20
+ `;
21
+ function Chat() {
22
+ const clientRef = useRef(null);
23
+ const hasLoadedBefore = useRef(true);
24
+ const addMessages = useMessages((state) => state.addMessages);
25
+ const addMessage = useMessages((state) => state.addMessage);
26
+ const chatRef = useRef(null);
27
+ const isMounted = useRef(true);
28
+ useEffect(() => {
29
+ let messageHandler;
30
+ let identityHandler;
31
+ let chatUpdatedHandler;
32
+ let memberJoinedHandler;
33
+ let chatConnectedHandler;
34
+ async function initChat() {
35
+ const { Client, consoleLoggerHandler, Logger } = await import("@ujet/websdk-headless");
36
+ console.log("this", isMounted);
37
+ Logger.addHandler(consoleLoggerHandler);
38
+ clientRef.current = new Client({
39
+ companyId,
40
+ tenant,
41
+ cobrowse: {
42
+ enabled: true,
43
+ template: COBROWSE_CONSENT_TEMPLATE,
44
+ messages: {
45
+ confirmSessionTitle: "...",
46
+ confirmSessionContent: "...",
47
+ endSessionText: "...",
48
+ confirmRemoteControlTitle: "...",
49
+ confirmRemoteControlContent: "...",
50
+ confirmFullDeviceTitle: "...",
51
+ confirmFullDeviceContent: "...",
52
+ allowText: "...",
53
+ denyText: "..."
54
+ }
55
+ },
56
+ host,
57
+ authenticate
58
+ });
59
+ const menus = await clientRef.current?.getMenus();
60
+ try {
61
+ chatRef.current = await clientRef.current?.loadOngoingChat();
62
+ console.log("chat:", chatRef.current);
63
+ if (!chatRef.current) {
64
+ chatRef.current = await clientRef.current?.createChat(
65
+ menus?.menus[5].id
66
+ );
67
+ }
68
+ } catch (error) {
69
+ console.error("Error creating chat:", error);
70
+ chatRef.current = await clientRef.current?.createChat(
71
+ menus?.menus[5].id
72
+ );
73
+ }
74
+ console.log("this");
75
+ identityHandler = (identity) => {
76
+ if (!isMounted.current) return;
77
+ console.log("identity:", identity);
78
+ };
79
+ messageHandler = (msg) => {
80
+ console.log("new message:", msg);
81
+ console.log("addMessage:", msg);
82
+ addMessage(msg);
83
+ };
84
+ chatUpdatedHandler = (chat) => {
85
+ console.log("chat updated:", chat);
86
+ };
87
+ chatConnectedHandler = async () => {
88
+ console.log("connected");
89
+ const messagesFetched = await clientRef.current?.fetchMessages();
90
+ console.log("[messages]:", messagesFetched);
91
+ addMessages(messagesFetched || []);
92
+ };
93
+ memberJoinedHandler = (identity) => {
94
+ console.log("member joined:", identity);
95
+ };
96
+ console.log(isMounted.current);
97
+ clientRef.current?.on("authenticated", () => {
98
+ console.log("authenticated");
99
+ });
100
+ clientRef.current?.on("chat.ongoing", (chat) => {
101
+ if (!isMounted.current) return;
102
+ console.log("chat:", chat);
103
+ });
104
+ clientRef.current?.on("chat.connected", chatConnectedHandler);
105
+ clientRef.current?.on("chat.updated", chatUpdatedHandler);
106
+ clientRef.current?.on("chat.identity", identityHandler);
107
+ clientRef.current?.on("chat.message", messageHandler);
108
+ clientRef.current?.on("cobrowse.request", ({ from }) => {
109
+ console.log("request by", from);
110
+ });
111
+ clientRef.current?.on("chat.memberJoined", memberJoinedHandler);
112
+ }
113
+ if (hasLoadedBefore.current) {
114
+ console.log("Initial setup");
115
+ initChat();
116
+ hasLoadedBefore.current = false;
117
+ }
118
+ return () => {
119
+ isMounted.current = false;
120
+ console.log("Component unmounted. Cancelling pending async operations.");
121
+ if (clientRef.current) {
122
+ if (messageHandler)
123
+ clientRef.current.off("chat.message", messageHandler);
124
+ if (identityHandler)
125
+ clientRef.current.off("chat.identity", identityHandler);
126
+ clientRef.current.off("chat.connected", chatConnectedHandler);
127
+ clientRef.current.off("chat.updated", chatUpdatedHandler);
128
+ clientRef.current.off("chat.memberJoined", memberJoinedHandler);
129
+ if (typeof clientRef.current.destroyChat === "function") {
130
+ console.log("Destroying chat:", chatRef.current);
131
+ clientRef.current.destroyChat();
132
+ }
133
+ }
134
+ };
135
+ }, [addMessage, addMessages]);
136
+ return /* @__PURE__ */ jsxs("div", { children: [
137
+ /* @__PURE__ */ jsx("h2", { children: "Chat" }),
138
+ /* @__PURE__ */ jsxs(
139
+ "form",
140
+ {
141
+ style: { marginTop: "1rem", display: "flex", gap: "0.5rem" },
142
+ onSubmit: async (e) => {
143
+ e.preventDefault();
144
+ const form = e.target;
145
+ const input = form.elements[0];
146
+ const message = input.value;
147
+ console.log("Sending message:", message);
148
+ try {
149
+ await clientRef.current?.sendTextMessage(message);
150
+ input.value = "";
151
+ } catch (error) {
152
+ console.error("Error sending message:", error);
153
+ }
154
+ },
155
+ children: [
156
+ /* @__PURE__ */ jsx("input", { type: "text", name: "message", placeholder: "Type a message..." }),
157
+ /* @__PURE__ */ jsx("button", { type: "submit", children: "Send" })
158
+ ]
159
+ }
160
+ )
161
+ ] });
162
+ }
163
+ export {
164
+ Chat as default
165
+ };
@@ -0,0 +1,16 @@
1
+ export declare const windowStyle: string;
2
+ export declare const windowOpenStyle: string;
3
+ export declare const windowBarStyle: string;
4
+ export declare const chat_title: string;
5
+ export declare const button_reset: string;
6
+ export declare const arrowFill: string;
7
+ export declare const inputStyle: string;
8
+ export declare const sendButtonStyle: string;
9
+ export declare const messagesContainerStyle: string;
10
+ export declare const notificationStyle: string;
11
+ export declare const messageStyle: string;
12
+ export declare const inline_button_wrapper: string;
13
+ export declare const inline_button: string;
14
+ export declare const endChatButtonStyle: string;
15
+ export declare const chatbotMenu: string;
16
+ export declare const chatbotMenuItem: string;
@@ -0,0 +1,35 @@
1
+ import '../assets/Chatbot/ChatWindow.css';/* empty css */
2
+ var windowStyle = "_13n1jqk0";
3
+ var windowOpenStyle = "_13n1jqk1";
4
+ var windowBarStyle = "_13n1jqk2";
5
+ var chat_title = "_13n1jqk3";
6
+ var button_reset = "_13n1jqk4";
7
+ var arrowFill = "_13n1jqk5";
8
+ var inputStyle = "_13n1jqk6";
9
+ var sendButtonStyle = "_13n1jqk7";
10
+ var messagesContainerStyle = "_13n1jqk8";
11
+ var notificationStyle = "_13n1jqk9";
12
+ var messageStyle = "_13n1jqka";
13
+ var inline_button_wrapper = "_13n1jqkb";
14
+ var inline_button = "_13n1jqkc";
15
+ var endChatButtonStyle = "_13n1jqkd";
16
+ var chatbotMenu = "_13n1jqke";
17
+ var chatbotMenuItem = "_13n1jqkf";
18
+ export {
19
+ arrowFill,
20
+ button_reset,
21
+ chat_title,
22
+ chatbotMenu,
23
+ chatbotMenuItem,
24
+ endChatButtonStyle,
25
+ inline_button,
26
+ inline_button_wrapper,
27
+ inputStyle,
28
+ messageStyle,
29
+ messagesContainerStyle,
30
+ notificationStyle,
31
+ sendButtonStyle,
32
+ windowBarStyle,
33
+ windowOpenStyle,
34
+ windowStyle
35
+ };
@@ -0,0 +1,29 @@
1
+ import { MessageResponse as BaseMessageResponse, HumanAgent } from '@ujet/websdk-headless';
2
+ import { default as React } from 'react';
3
+
4
+ interface MessageResponse extends BaseMessageResponse {
5
+ to_agent?: HumanAgent;
6
+ }
7
+ export interface ChatBubble {
8
+ id: string | number;
9
+ body: string;
10
+ sender?: string;
11
+ timestamp?: string;
12
+ isOwn?: boolean;
13
+ }
14
+ interface ChatWindowProps {
15
+ messages: MessageResponse[];
16
+ status?: string;
17
+ onSend: (msg: string) => void;
18
+ inputDisabled?: boolean;
19
+ onClose?: () => void;
20
+ endChat?: () => void;
21
+ showReconnect?: boolean;
22
+ virtualAgent?: {
23
+ avatar_url: string;
24
+ name: string;
25
+ id: string;
26
+ };
27
+ }
28
+ export declare const ChatWindow: React.FC<ChatWindowProps>;
29
+ export {};