@axos-web-dev/shared-components 1.0.100-dev.11 → 1.0.100-dev.13
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/Avatar/Avatar.module.js +7 -7
- package/dist/Blockquote/Blockquote.module.js +3 -3
- package/dist/Calculators/BuyDownCalculator/index.d.ts +4 -1
- package/dist/Calculators/BuyDownCalculator/index.js +107 -67
- package/dist/Calculators/Calculator.js +1 -1
- package/dist/Chatbot/ChatWindow.css.js +0 -1
- package/dist/Chatbot/Chatbot.css.js +1 -0
- package/dist/Chatbot/useHeadlessChat.d.ts +2 -1
- package/dist/Chatbot/useHeadlessChat.js +22 -6
- package/dist/Forms/SuccesForm.js +1 -1
- package/dist/NavigationMenu/AxosAdvisor/NavBar.module.js +52 -52
- package/dist/NavigationMenu/AxosAdvisorServices/NavBar.module.js +53 -53
- package/dist/NavigationMenu/AxosBank/MobileMenu/MobileMenu.module.js +16 -16
- package/dist/NavigationMenu/AxosBank/NavBar.module.js +39 -39
- package/dist/NavigationMenu/AxosClearing/NavBar.module.js +37 -37
- package/dist/NavigationMenu/AxosFiduciary/NavBar.module.js +41 -41
- package/dist/WalnutIframe/wrapper.module.js +3 -3
- package/dist/assets/Avatar/Avatar.css.css +59 -59
- package/dist/assets/Blockquote/Blockquote.css.css +68 -68
- package/dist/assets/NavigationMenu/AxosAdvisor/NavBar.css.css +597 -597
- package/dist/assets/NavigationMenu/AxosAdvisorServices/NavBar.css.css +618 -618
- package/dist/assets/NavigationMenu/AxosBank/MobileMenu/MobileMenu.css.css +191 -191
- package/dist/assets/NavigationMenu/AxosBank/NavBar.css.css +473 -473
- package/dist/assets/NavigationMenu/AxosClearing/NavBar.css.css +458 -458
- package/dist/assets/NavigationMenu/AxosFiduciary/NavBar.css.css +426 -426
- package/dist/assets/WalnutIframe/wrapper.css.css +49 -49
- package/package.json +136 -136
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import '../assets/Avatar/Avatar.css.css';const avatar_sec = "
|
|
2
|
-
const container = "
|
|
3
|
-
const image = "
|
|
4
|
-
const text = "
|
|
5
|
-
const name = "
|
|
6
|
-
const title = "
|
|
7
|
-
const description = "
|
|
1
|
+
import '../assets/Avatar/Avatar.css.css';const avatar_sec = "_avatar_sec_1bnm9_1";
|
|
2
|
+
const container = "_container_1bnm9_5";
|
|
3
|
+
const image = "_image_1bnm9_14";
|
|
4
|
+
const text = "_text_1bnm9_23";
|
|
5
|
+
const name = "_name_1bnm9_29";
|
|
6
|
+
const title = "_title_1bnm9_37";
|
|
7
|
+
const description = "_description_1bnm9_44";
|
|
8
8
|
const css = {
|
|
9
9
|
avatar_sec,
|
|
10
10
|
container,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import '../assets/Blockquote/Blockquote.css.css';const quote_spacer = "
|
|
2
|
-
const author = "
|
|
3
|
-
const quote = "
|
|
1
|
+
import '../assets/Blockquote/Blockquote.css.css';const quote_spacer = "_quote_spacer_1mzku_1";
|
|
2
|
+
const author = "_author_1mzku_7";
|
|
3
|
+
const quote = "_quote_1mzku_1";
|
|
4
4
|
const css = {
|
|
5
5
|
quote_spacer,
|
|
6
6
|
author,
|
|
@@ -19,8 +19,11 @@ export type BuyDownCalculatorInputs = {
|
|
|
19
19
|
fullTimeCharter: boolean;
|
|
20
20
|
mooringOutsideContinentalUS: boolean;
|
|
21
21
|
operatingAccount: boolean;
|
|
22
|
-
ltvAbove60: boolean;
|
|
23
22
|
floorplanDealerIncentive: boolean;
|
|
24
23
|
dealerCommercialDeposit: boolean;
|
|
24
|
+
vesselOver15Years: boolean;
|
|
25
|
+
highPerformanceBoats: boolean;
|
|
26
|
+
retailCheckingAccount: boolean;
|
|
27
|
+
electricMotorHybrid: boolean;
|
|
25
28
|
};
|
|
26
29
|
export declare const BuyDownCalculator: FC<BuyDownCalculatorProps>;
|
|
@@ -16,14 +16,14 @@ import "../../Input/InputAmount.js";
|
|
|
16
16
|
import "../../Input/InputPhone.js";
|
|
17
17
|
import "../../Input/InputTextArea.js";
|
|
18
18
|
import "../../Input/DownPaymentInput.js";
|
|
19
|
-
import
|
|
19
|
+
import "../../Input/RadioButton.js";
|
|
20
20
|
import { PercentageInput } from "../../Input/PercentageInput.js";
|
|
21
21
|
import "../../utils/allowedAxosDomains.js";
|
|
22
22
|
import { getVariant } from "../../utils/getVariant.js";
|
|
23
23
|
import clsx from "clsx";
|
|
24
24
|
import { useForm, FormProvider } from "react-hook-form";
|
|
25
25
|
import { z } from "zod";
|
|
26
|
-
import { calc_container, calculator_section, section_header, theme_header, mt_8, buydown_calculator_form, row_form,
|
|
26
|
+
import { calc_container, calculator_section, section_header, theme_header, mt_8, buydown_calculator_form, row_form, calculate_row, form_wrapper, form_disclosure } from "./BuyDownCalculator.css.js";
|
|
27
27
|
const BuyDownCalculator = ({
|
|
28
28
|
header,
|
|
29
29
|
body,
|
|
@@ -45,12 +45,12 @@ const BuyDownCalculator = ({
|
|
|
45
45
|
const [dealerContributionAmount, setDealerContributionAmount] = useState("");
|
|
46
46
|
const [enableFullTimeCharter, setEnableFullTimeCharter] = useState(false);
|
|
47
47
|
const [disableMooringOutside, setDisableMooringOutside] = useState(false);
|
|
48
|
-
const [disableLTVAbove60, setDisableLTVAbove60] = useState(true);
|
|
49
48
|
const [isDealerContributionDisabled, setIsDealerContributionDisabled] = useState(false);
|
|
50
49
|
const [
|
|
51
50
|
isManufacturerContributionDisabled,
|
|
52
51
|
setIsManufacturerContributionDisabled
|
|
53
52
|
] = useState(false);
|
|
53
|
+
const [ltvDiscountApplied, setLtvDiscountApplied] = useState(false);
|
|
54
54
|
const schema = z.object({
|
|
55
55
|
purchasePrice: z.string().min(1, { message: "Loan amount is required." }).transform((val) => {
|
|
56
56
|
return formatToNumber(val);
|
|
@@ -111,7 +111,6 @@ const BuyDownCalculator = ({
|
|
|
111
111
|
if (purchasePrice && downpayment) {
|
|
112
112
|
const financedAmount2 = purchasePrice - downpayment;
|
|
113
113
|
const range = getRange(financedAmount2);
|
|
114
|
-
const disableLTV = checkLTVStatus(downpayment, purchasePrice);
|
|
115
114
|
if (financedAmount2 < 0) {
|
|
116
115
|
ctx.addIssue({
|
|
117
116
|
code: z.ZodIssueCode.custom,
|
|
@@ -123,11 +122,6 @@ const BuyDownCalculator = ({
|
|
|
123
122
|
const loanRange2 = getRange(financedAmount2, program);
|
|
124
123
|
setLoanRange(loanRange2);
|
|
125
124
|
}
|
|
126
|
-
if (!disableLTV) {
|
|
127
|
-
setDisableLTVAbove60(false);
|
|
128
|
-
} else {
|
|
129
|
-
setDisableLTVAbove60(true);
|
|
130
|
-
}
|
|
131
125
|
}
|
|
132
126
|
if (updateFicoRequirements(range, program) === false) {
|
|
133
127
|
ctx.addIssue({
|
|
@@ -166,7 +160,6 @@ const BuyDownCalculator = ({
|
|
|
166
160
|
}
|
|
167
161
|
}, [watchedFields]);
|
|
168
162
|
const calculator_variant = getVariant(variant);
|
|
169
|
-
const enableDependentInputs = enableFullTimeCharter;
|
|
170
163
|
const formatToNumber = (value) => {
|
|
171
164
|
const cleanValue = value.replace(/[%$, ]/gi, "");
|
|
172
165
|
return parseFloat(cleanValue);
|
|
@@ -189,7 +182,7 @@ const BuyDownCalculator = ({
|
|
|
189
182
|
const percentage = downpayment / purchasePrice * 100;
|
|
190
183
|
const loanToValue2 = 100 - percentage;
|
|
191
184
|
if (loanToValue2 <= 60) return false;
|
|
192
|
-
|
|
185
|
+
return true;
|
|
193
186
|
};
|
|
194
187
|
const getRange = (financedAmount2, program, forRates) => {
|
|
195
188
|
let range = "";
|
|
@@ -358,23 +351,34 @@ const BuyDownCalculator = ({
|
|
|
358
351
|
}
|
|
359
352
|
return rate;
|
|
360
353
|
};
|
|
361
|
-
const calculateAdjustments = () => {
|
|
354
|
+
const calculateAdjustments = (purchasePrice, downpayment) => {
|
|
362
355
|
let total = 0;
|
|
363
356
|
const checkboxes = document.querySelectorAll(
|
|
364
|
-
'input[type="checkbox"]:checked
|
|
357
|
+
'input[type="checkbox"]:checked'
|
|
365
358
|
);
|
|
366
359
|
checkboxes.forEach((checkbox) => {
|
|
367
360
|
total += parseFloat(checkbox.value);
|
|
368
361
|
});
|
|
362
|
+
if (purchasePrice && downpayment && purchasePrice > 0 && downpayment >= 0) {
|
|
363
|
+
const ltvStatus = checkLTVStatus(downpayment, purchasePrice);
|
|
364
|
+
if (!ltvStatus) {
|
|
365
|
+
total += -0.35;
|
|
366
|
+
setLtvDiscountApplied(true);
|
|
367
|
+
} else {
|
|
368
|
+
setLtvDiscountApplied(false);
|
|
369
|
+
}
|
|
370
|
+
} else {
|
|
371
|
+
setLtvDiscountApplied(false);
|
|
372
|
+
}
|
|
369
373
|
return total;
|
|
370
374
|
};
|
|
371
|
-
const calculateRates = (program, fico, financedAmount2, buydownRate) => {
|
|
375
|
+
const calculateRates = (program, fico, financedAmount2, buydownRate, purchasePrice, downpayment) => {
|
|
372
376
|
const minRate = 6.94;
|
|
373
377
|
const loanRange2 = getRange(financedAmount2, program, true);
|
|
374
378
|
const startingRate = parseFloat(
|
|
375
379
|
getInterestRate(program, fico, loanRange2).replace(/[%,]/g, "")
|
|
376
380
|
);
|
|
377
|
-
const rateAdjustments = calculateAdjustments();
|
|
381
|
+
const rateAdjustments = calculateAdjustments(purchasePrice, downpayment);
|
|
378
382
|
const adjustedRate = startingRate + rateAdjustments;
|
|
379
383
|
const finalNoteRateValue = Math.max(minRate, adjustedRate);
|
|
380
384
|
const finalNoteRate2 = formatToPercentage(finalNoteRateValue);
|
|
@@ -469,13 +473,19 @@ const BuyDownCalculator = ({
|
|
|
469
473
|
setManuContributionPercentage(percentage);
|
|
470
474
|
return manufacturerContribution;
|
|
471
475
|
};
|
|
472
|
-
const calculateDealerContributionAmount = (dealerContribution, totalBuydownCost2) => {
|
|
473
|
-
|
|
476
|
+
const calculateDealerContributionAmount = (dealerContribution, manufacturerContributionAmount, totalBuydownCost2) => {
|
|
477
|
+
let dealerContributionValue;
|
|
478
|
+
if (dealerContribution > 0) {
|
|
479
|
+
dealerContributionValue = totalBuydownCost2 * (dealerContribution / 100);
|
|
480
|
+
} else {
|
|
481
|
+
dealerContributionValue = totalBuydownCost2 - manufacturerContributionAmount;
|
|
482
|
+
}
|
|
474
483
|
const formattedAmount = formatToCurrency(dealerContributionValue);
|
|
475
484
|
setDealerContributionAmount(formattedAmount);
|
|
476
485
|
};
|
|
477
486
|
const onSubmit = (data) => {
|
|
478
487
|
if (isValid) {
|
|
488
|
+
setLtvDiscountApplied(false);
|
|
479
489
|
const {
|
|
480
490
|
buydownRate,
|
|
481
491
|
buydownTerm,
|
|
@@ -495,7 +505,9 @@ const BuyDownCalculator = ({
|
|
|
495
505
|
program,
|
|
496
506
|
fico,
|
|
497
507
|
financedAmountValue,
|
|
498
|
-
buydownRate
|
|
508
|
+
buydownRate,
|
|
509
|
+
purchasePrice,
|
|
510
|
+
downpayment
|
|
499
511
|
);
|
|
500
512
|
const buydownPayment2 = calculateBuydownPayment(
|
|
501
513
|
buydownRate,
|
|
@@ -517,7 +529,11 @@ const BuyDownCalculator = ({
|
|
|
517
529
|
manufacturerContributionAmount,
|
|
518
530
|
totalBuydownCost2
|
|
519
531
|
);
|
|
520
|
-
calculateDealerContributionAmount(
|
|
532
|
+
calculateDealerContributionAmount(
|
|
533
|
+
dealerContribution,
|
|
534
|
+
manufacturerContributionAmount,
|
|
535
|
+
totalBuydownCost2
|
|
536
|
+
);
|
|
521
537
|
}
|
|
522
538
|
};
|
|
523
539
|
return /* @__PURE__ */ jsxs("section", { className: `${calc_container({ variant: calculator_variant })}`, children: [
|
|
@@ -689,7 +705,7 @@ const BuyDownCalculator = ({
|
|
|
689
705
|
required: true,
|
|
690
706
|
deps: ["program"]
|
|
691
707
|
}),
|
|
692
|
-
label: "Buydown Term
|
|
708
|
+
label: "Buydown Term",
|
|
693
709
|
sizes: "medium",
|
|
694
710
|
required: true,
|
|
695
711
|
error: !!errors.buydownTerm,
|
|
@@ -700,56 +716,57 @@ const BuyDownCalculator = ({
|
|
|
700
716
|
children: BuydownTerm.map((item) => /* @__PURE__ */ jsx("option", { value: item.value, children: item.text }, item.value))
|
|
701
717
|
}
|
|
702
718
|
) }) }),
|
|
703
|
-
/* @__PURE__ */ jsx("div", { className: `${row_form}`, children: /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("label", { children: "Loan Level Rate Adjustments" }) }) }),
|
|
719
|
+
/* @__PURE__ */ jsx("div", { className: `${row_form}`, children: /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("label", { children: "Loan Level Rate Adjustments. Rate Adjustments are subject to change, are limited, and restricted by floor rate." }) }) }),
|
|
704
720
|
/* @__PURE__ */ jsxs("div", { className: `${row_form}`, children: [
|
|
705
|
-
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("div", { className: row_form, children: /* @__PURE__ */ jsxs(
|
|
706
|
-
RadioButtonSet,
|
|
707
|
-
{
|
|
708
|
-
id: "dependentInputs",
|
|
709
|
-
label: "Limit One",
|
|
710
|
-
sizes: "medium",
|
|
711
|
-
variant,
|
|
712
|
-
direction: "column",
|
|
713
|
-
disabled: !enableDependentInputs,
|
|
714
|
-
className: limit_one,
|
|
715
|
-
children: [
|
|
716
|
-
/* @__PURE__ */ jsx(
|
|
717
|
-
RadioButton,
|
|
718
|
-
{
|
|
719
|
-
id: "mooringOutsideContinentalUS",
|
|
720
|
-
...register("mooringOutsideContinentalUS"),
|
|
721
|
-
value: 0.5,
|
|
722
|
-
radioText: "Mooring Outside Continental U.S. (Includes Puerto Rico,\n Hawaii, and Alaska) (Does not apply to Full Time Charter)\n +0.500",
|
|
723
|
-
groupName: "dependentInputs",
|
|
724
|
-
disabled: disableMooringOutside
|
|
725
|
-
}
|
|
726
|
-
),
|
|
727
|
-
/* @__PURE__ */ jsx(
|
|
728
|
-
RadioButton,
|
|
729
|
-
{
|
|
730
|
-
id: "operatingAccount",
|
|
731
|
-
...register("operatingAccount"),
|
|
732
|
-
value: -0.25,
|
|
733
|
-
radioText: "Open and fund an LLC Operating Account with Axos - 0.25",
|
|
734
|
-
groupName: "dependentInputs"
|
|
735
|
-
}
|
|
736
|
-
)
|
|
737
|
-
]
|
|
738
|
-
}
|
|
739
|
-
) }) }),
|
|
740
721
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
741
|
-
/* @__PURE__ */ jsx("div", {
|
|
722
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
723
|
+
Checkbox,
|
|
724
|
+
{
|
|
725
|
+
id: "mooringOutsideContinentalUS",
|
|
726
|
+
...register("mooringOutsideContinentalUS"),
|
|
727
|
+
sizes: "medium",
|
|
728
|
+
variant: calculator_variant,
|
|
729
|
+
value: 0.5,
|
|
730
|
+
disabled: !enableFullTimeCharter || disableMooringOutside,
|
|
731
|
+
children: "Mooring Outside Continental U.S. (Includes Puerto Rico, Hawaii, and Alaska) (Does not apply to Full Time Charter) +0.500"
|
|
732
|
+
}
|
|
733
|
+
) }),
|
|
734
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
735
|
+
Checkbox,
|
|
736
|
+
{
|
|
737
|
+
id: "operatingAccount",
|
|
738
|
+
...register("operatingAccount"),
|
|
739
|
+
sizes: "medium",
|
|
740
|
+
variant: calculator_variant,
|
|
741
|
+
value: -0.25,
|
|
742
|
+
disabled: !enableFullTimeCharter,
|
|
743
|
+
children: "Open and fund an LLC Operating Account with Axos - 0.25"
|
|
744
|
+
}
|
|
745
|
+
) }),
|
|
746
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
742
747
|
Checkbox,
|
|
743
748
|
{
|
|
744
|
-
id: "
|
|
745
|
-
...register("
|
|
749
|
+
id: "vesselOver15Years",
|
|
750
|
+
...register("vesselOver15Years"),
|
|
746
751
|
sizes: "medium",
|
|
747
|
-
variant,
|
|
748
|
-
value:
|
|
749
|
-
|
|
750
|
-
children: "LTV ≤ 60% (If not required by program) -0.350"
|
|
752
|
+
variant: calculator_variant,
|
|
753
|
+
value: 1.25,
|
|
754
|
+
children: "Vessel > 15 Years +1.250"
|
|
751
755
|
}
|
|
752
756
|
) }),
|
|
757
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
758
|
+
Checkbox,
|
|
759
|
+
{
|
|
760
|
+
id: "highPerformanceBoats",
|
|
761
|
+
...register("highPerformanceBoats"),
|
|
762
|
+
sizes: "medium",
|
|
763
|
+
variant: calculator_variant,
|
|
764
|
+
value: 0.5,
|
|
765
|
+
children: "High Performance Boats (>4 Engines) +0.500"
|
|
766
|
+
}
|
|
767
|
+
) })
|
|
768
|
+
] }),
|
|
769
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
753
770
|
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
754
771
|
Checkbox,
|
|
755
772
|
{
|
|
@@ -758,7 +775,29 @@ const BuyDownCalculator = ({
|
|
|
758
775
|
sizes: "medium",
|
|
759
776
|
variant: calculator_variant,
|
|
760
777
|
value: -0.125,
|
|
761
|
-
children: "
|
|
778
|
+
children: "Floor Plan Dealer Incentive -0.125"
|
|
779
|
+
}
|
|
780
|
+
) }),
|
|
781
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
782
|
+
Checkbox,
|
|
783
|
+
{
|
|
784
|
+
id: "retailCheckingAccount",
|
|
785
|
+
...register("retailCheckingAccount"),
|
|
786
|
+
sizes: "medium",
|
|
787
|
+
variant: calculator_variant,
|
|
788
|
+
value: -0.125,
|
|
789
|
+
children: "Retail Checking Account w/ACH and Minimum of 3 Months P&I Balance -0.125"
|
|
790
|
+
}
|
|
791
|
+
) }),
|
|
792
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
793
|
+
Checkbox,
|
|
794
|
+
{
|
|
795
|
+
id: "electricMotorHybrid",
|
|
796
|
+
...register("electricMotorHybrid"),
|
|
797
|
+
sizes: "medium",
|
|
798
|
+
variant: calculator_variant,
|
|
799
|
+
value: -0.25,
|
|
800
|
+
children: "100% Electric Motor / Hybrid -0.250"
|
|
762
801
|
}
|
|
763
802
|
) }),
|
|
764
803
|
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
@@ -853,7 +892,8 @@ const BuyDownCalculator = ({
|
|
|
853
892
|
label: "Final Note Rate",
|
|
854
893
|
disabled: true,
|
|
855
894
|
variant: calculator_variant,
|
|
856
|
-
value: finalNoteRate
|
|
895
|
+
value: finalNoteRate,
|
|
896
|
+
helperText: ltvDiscountApplied && "LTV discount applied"
|
|
857
897
|
}
|
|
858
898
|
) })
|
|
859
899
|
] }),
|
|
@@ -874,7 +914,7 @@ const BuyDownCalculator = ({
|
|
|
874
914
|
{
|
|
875
915
|
id: "buydownPayment",
|
|
876
916
|
sizes: "medium",
|
|
877
|
-
label: "
|
|
917
|
+
label: "Monthly payment WITH buydown",
|
|
878
918
|
disabled: true,
|
|
879
919
|
variant: calculator_variant,
|
|
880
920
|
value: buydownPayment
|
|
@@ -887,7 +927,7 @@ const BuyDownCalculator = ({
|
|
|
887
927
|
{
|
|
888
928
|
id: "nonBuydownPayment",
|
|
889
929
|
sizes: "medium",
|
|
890
|
-
label: "
|
|
930
|
+
label: "Monthly Payment WITHOUT buydown",
|
|
891
931
|
disabled: true,
|
|
892
932
|
variant: calculator_variant,
|
|
893
933
|
value: nonBuydownPayment
|
|
@@ -51,8 +51,8 @@ import "../Carousel/index.js";
|
|
|
51
51
|
/* empty css */
|
|
52
52
|
import "../Chatbot/store/chat.js";
|
|
53
53
|
import "../Chatbot/authenticate.js";
|
|
54
|
-
import "react-use";
|
|
55
54
|
import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
|
|
55
|
+
import "react-use";
|
|
56
56
|
/* empty css */
|
|
57
57
|
import "../Chatbot/store/messages.js";
|
|
58
58
|
/* empty css */
|
|
@@ -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,7 +16,7 @@ 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>;
|
|
21
22
|
showReconnect: boolean;
|
|
@@ -12,7 +12,8 @@ function useHeadlessChat({
|
|
|
12
12
|
host,
|
|
13
13
|
getToken,
|
|
14
14
|
projectId = "axos",
|
|
15
|
-
debug = false
|
|
15
|
+
debug = false,
|
|
16
|
+
menuOption = "Support Virtual Agent"
|
|
16
17
|
}) {
|
|
17
18
|
const addMessage = useMessages((state) => state.addMessage);
|
|
18
19
|
const addMessages = useMessages((state) => state.addMessages);
|
|
@@ -33,9 +34,11 @@ function useHeadlessChat({
|
|
|
33
34
|
if (chatRef.current) {
|
|
34
35
|
await clientRef.current?.finishChat();
|
|
35
36
|
clearMessages();
|
|
36
|
-
clientRef.current?.createChat(
|
|
37
|
+
clientRef.current?.createChat(
|
|
38
|
+
menuRef.current.menus.find((menu) => menu.name === menuOption)?.id
|
|
39
|
+
);
|
|
37
40
|
}
|
|
38
|
-
}, [clearMessages]);
|
|
41
|
+
}, [clearMessages, menuOption]);
|
|
39
42
|
useEffect(() => {
|
|
40
43
|
let messageHandler;
|
|
41
44
|
let chatReadyHandler;
|
|
@@ -66,7 +69,11 @@ function useHeadlessChat({
|
|
|
66
69
|
}
|
|
67
70
|
menuRef.current = await clientRef.current?.getMenus();
|
|
68
71
|
if (debug) console.log("channelId:", menuRef.current);
|
|
69
|
-
if (debug)
|
|
72
|
+
if (debug)
|
|
73
|
+
console.log(
|
|
74
|
+
"channelId:",
|
|
75
|
+
menuRef.current?.menus.find((menu) => menu.name === menuOption)?.id
|
|
76
|
+
);
|
|
70
77
|
try {
|
|
71
78
|
chatRef.current = await clientRef.current?.loadOngoingChat();
|
|
72
79
|
if (chatRef.current != null) {
|
|
@@ -80,11 +87,19 @@ function useHeadlessChat({
|
|
|
80
87
|
facingBrandId: {
|
|
81
88
|
label: "facingBrandId",
|
|
82
89
|
value: brandMap.get(projectId) || 1
|
|
90
|
+
},
|
|
91
|
+
channel: {
|
|
92
|
+
label: "channel",
|
|
93
|
+
value: "in_web"
|
|
94
|
+
},
|
|
95
|
+
user_auth: {
|
|
96
|
+
label: "user_auth",
|
|
97
|
+
value: false
|
|
83
98
|
}
|
|
84
99
|
}
|
|
85
100
|
};
|
|
86
101
|
chatRef.current = await clientRef.current?.createChat(
|
|
87
|
-
menuRef.current.menus
|
|
102
|
+
menuRef.current.menus.find((menu) => menu.name === menuOption)?.id,
|
|
88
103
|
{
|
|
89
104
|
custom_data
|
|
90
105
|
}
|
|
@@ -179,7 +194,8 @@ function useHeadlessChat({
|
|
|
179
194
|
addMessage,
|
|
180
195
|
addMessages,
|
|
181
196
|
debug,
|
|
182
|
-
projectId
|
|
197
|
+
projectId,
|
|
198
|
+
menuOption
|
|
183
199
|
]);
|
|
184
200
|
return {
|
|
185
201
|
status,
|
package/dist/Forms/SuccesForm.js
CHANGED
|
@@ -60,8 +60,8 @@ import "../Carousel/index.js";
|
|
|
60
60
|
/* empty css */
|
|
61
61
|
import "../Chatbot/store/chat.js";
|
|
62
62
|
import "../Chatbot/authenticate.js";
|
|
63
|
-
import "react-use";
|
|
64
63
|
import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
|
|
64
|
+
import "react-use";
|
|
65
65
|
/* empty css */
|
|
66
66
|
import "../Chatbot/store/messages.js";
|
|
67
67
|
/* empty css */
|
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
import '../../assets/NavigationMenu/AxosAdvisor/NavBar.css.css';const header = "
|
|
2
|
-
const wrapper = "
|
|
3
|
-
const header_main_row = "
|
|
4
|
-
const mobile_header = "
|
|
5
|
-
const logo_wrap = "
|
|
6
|
-
const primary_links = "
|
|
7
|
-
const main_nav_link = "
|
|
8
|
-
const sub_nav_link = "
|
|
9
|
-
const signin_wrap = "
|
|
10
|
-
const signin_btn = "
|
|
11
|
-
const header_sub_row = "
|
|
12
|
-
const signin_dropdown = "
|
|
13
|
-
const shadow = "
|
|
14
|
-
const signin_header = "
|
|
15
|
-
const signin_subheader = "
|
|
16
|
-
const opacity = "
|
|
17
|
-
const fadeInDown = "
|
|
18
|
-
const footer = "
|
|
19
|
-
const open = "
|
|
20
|
-
const dd_wrapper = "
|
|
21
|
-
const dd_media = "
|
|
22
|
-
const dd_media_img = "
|
|
23
|
-
const dd_site_navs = "
|
|
24
|
-
const dd_media_header = "
|
|
25
|
-
const mt_8 = "
|
|
26
|
-
const mt_16 = "
|
|
27
|
-
const ml_8 = "
|
|
28
|
-
const dd_media_cta = "
|
|
29
|
-
const reversed_row = "
|
|
30
|
-
const headline = "
|
|
31
|
-
const nav_anchor = "
|
|
32
|
-
const headline_cta = "
|
|
33
|
-
const site_lists = "
|
|
34
|
-
const hamburger = "
|
|
35
|
-
const mobile_only = "
|
|
36
|
-
const mobile_logo = "
|
|
37
|
-
const highlight = "
|
|
38
|
-
const mobile_nav = "
|
|
39
|
-
const mobile_opened = "
|
|
40
|
-
const mobile_nav_item = "
|
|
41
|
-
const has_dropdown = "
|
|
42
|
-
const icon_wrap = "
|
|
43
|
-
const mobile_footer = "
|
|
44
|
-
const mobile_footer_content = "
|
|
45
|
-
const mobile_footer_media = "
|
|
46
|
-
const footer_cta = "
|
|
47
|
-
const inner_wrapper = "
|
|
48
|
-
const btn = "
|
|
49
|
-
const sub_menu = "
|
|
50
|
-
const main = "
|
|
51
|
-
const dd_footer = "
|
|
52
|
-
const desktop_only = "
|
|
1
|
+
import '../../assets/NavigationMenu/AxosAdvisor/NavBar.css.css';const header = "_header_6da2u_1";
|
|
2
|
+
const wrapper = "_wrapper_6da2u_5";
|
|
3
|
+
const header_main_row = "_header_main_row_6da2u_10";
|
|
4
|
+
const mobile_header = "_mobile_header_6da2u_11";
|
|
5
|
+
const logo_wrap = "_logo_wrap_6da2u_17";
|
|
6
|
+
const primary_links = "_primary_links_6da2u_21";
|
|
7
|
+
const main_nav_link = "_main_nav_link_6da2u_25";
|
|
8
|
+
const sub_nav_link = "_sub_nav_link_6da2u_47";
|
|
9
|
+
const signin_wrap = "_signin_wrap_6da2u_49";
|
|
10
|
+
const signin_btn = "_signin_btn_6da2u_50";
|
|
11
|
+
const header_sub_row = "_header_sub_row_6da2u_88";
|
|
12
|
+
const signin_dropdown = "_signin_dropdown_6da2u_107";
|
|
13
|
+
const shadow = "_shadow_6da2u_117";
|
|
14
|
+
const signin_header = "_signin_header_6da2u_125";
|
|
15
|
+
const signin_subheader = "_signin_subheader_6da2u_132";
|
|
16
|
+
const opacity = "_opacity_6da2u_154";
|
|
17
|
+
const fadeInDown = "_fadeInDown_6da2u_1";
|
|
18
|
+
const footer = "_footer_6da2u_160";
|
|
19
|
+
const open = "_open_6da2u_176";
|
|
20
|
+
const dd_wrapper = "_dd_wrapper_6da2u_188";
|
|
21
|
+
const dd_media = "_dd_media_6da2u_193";
|
|
22
|
+
const dd_media_img = "_dd_media_img_6da2u_198";
|
|
23
|
+
const dd_site_navs = "_dd_site_navs_6da2u_202";
|
|
24
|
+
const dd_media_header = "_dd_media_header_6da2u_209";
|
|
25
|
+
const mt_8 = "_mt_8_6da2u_218";
|
|
26
|
+
const mt_16 = "_mt_16_6da2u_222";
|
|
27
|
+
const ml_8 = "_ml_8_6da2u_226";
|
|
28
|
+
const dd_media_cta = "_dd_media_cta_6da2u_230";
|
|
29
|
+
const reversed_row = "_reversed_row_6da2u_244";
|
|
30
|
+
const headline = "_headline_6da2u_260";
|
|
31
|
+
const nav_anchor = "_nav_anchor_6da2u_266";
|
|
32
|
+
const headline_cta = "_headline_cta_6da2u_274";
|
|
33
|
+
const site_lists = "_site_lists_6da2u_289";
|
|
34
|
+
const hamburger = "_hamburger_6da2u_324";
|
|
35
|
+
const mobile_only = "_mobile_only_6da2u_338";
|
|
36
|
+
const mobile_logo = "_mobile_logo_6da2u_344";
|
|
37
|
+
const highlight = "_highlight_6da2u_349";
|
|
38
|
+
const mobile_nav = "_mobile_nav_6da2u_385";
|
|
39
|
+
const mobile_opened = "_mobile_opened_6da2u_396";
|
|
40
|
+
const mobile_nav_item = "_mobile_nav_item_6da2u_404";
|
|
41
|
+
const has_dropdown = "_has_dropdown_6da2u_419";
|
|
42
|
+
const icon_wrap = "_icon_wrap_6da2u_440";
|
|
43
|
+
const mobile_footer = "_mobile_footer_6da2u_445";
|
|
44
|
+
const mobile_footer_content = "_mobile_footer_content_6da2u_450";
|
|
45
|
+
const mobile_footer_media = "_mobile_footer_media_6da2u_464";
|
|
46
|
+
const footer_cta = "_footer_cta_6da2u_470";
|
|
47
|
+
const inner_wrapper = "_inner_wrapper_6da2u_498";
|
|
48
|
+
const btn = "_btn_6da2u_503";
|
|
49
|
+
const sub_menu = "_sub_menu_6da2u_508";
|
|
50
|
+
const main = "_main_6da2u_25";
|
|
51
|
+
const dd_footer = "_dd_footer_6da2u_533";
|
|
52
|
+
const desktop_only = "_desktop_only_6da2u_552";
|
|
53
53
|
const styles = {
|
|
54
54
|
header,
|
|
55
55
|
wrapper,
|