@axos-web-dev/shared-components 1.0.77-patch.19 → 1.0.77-patch.20

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 (93) hide show
  1. package/dist/ATMLocator/ATMLocator.js +1 -0
  2. package/dist/Auth/ErrorAlert.js +1 -0
  3. package/dist/Button/Button.js +1 -0
  4. package/dist/Calculators/Calculator.js +1 -0
  5. package/dist/Carousel/index.js +1 -0
  6. package/dist/Chevron/index.js +1 -0
  7. package/dist/Comparison/Comparison.js +1 -0
  8. package/dist/ExecutiveBio/ExecutiveBio.js +1 -0
  9. package/dist/FaqAccordion/index.js +1 -0
  10. package/dist/FooterSiteMap/AxosBank/FooterSiteMap.js +1 -0
  11. package/dist/Forms/ApplicationStart.d.ts +1 -1
  12. package/dist/Forms/ApplicationStart.js +111 -89
  13. package/dist/Forms/ApplyNow.js +1 -0
  14. package/dist/Forms/ClearingForm.d.ts +1 -1
  15. package/dist/Forms/ClearingForm.js +184 -162
  16. package/dist/Forms/CommercialDeposits.d.ts +1 -1
  17. package/dist/Forms/CommercialDeposits.js +201 -179
  18. package/dist/Forms/CommercialLending.d.ts +1 -1
  19. package/dist/Forms/CommercialLending.js +278 -256
  20. package/dist/Forms/CommercialPremiumFinance.d.ts +1 -1
  21. package/dist/Forms/CommercialPremiumFinance.js +128 -106
  22. package/dist/Forms/ContactCompany.d.ts +1 -1
  23. package/dist/Forms/ContactCompany.js +113 -91
  24. package/dist/Forms/ContactCompanyTitle.d.ts +1 -1
  25. package/dist/Forms/ContactCompanyTitle.js +127 -105
  26. package/dist/Forms/ContactUs.d.ts +1 -1
  27. package/dist/Forms/ContactUs.js +99 -77
  28. package/dist/Forms/ContactUsAAS.d.ts +1 -1
  29. package/dist/Forms/ContactUsAAS.js +180 -158
  30. package/dist/Forms/ContactUsBusiness.d.ts +1 -1
  31. package/dist/Forms/ContactUsBusiness.js +134 -112
  32. package/dist/Forms/ContactUsBusinessNameEmail.d.ts +1 -1
  33. package/dist/Forms/ContactUsBusinessNameEmail.js +103 -81
  34. package/dist/Forms/ContactUsLVF.d.ts +1 -1
  35. package/dist/Forms/ContactUsLVF.js +118 -98
  36. package/dist/Forms/ContactUsNMLSId.d.ts +1 -1
  37. package/dist/Forms/ContactUsNMLSId.js +117 -95
  38. package/dist/Forms/CpraRequest.d.ts +1 -1
  39. package/dist/Forms/CpraRequest.js +641 -619
  40. package/dist/Forms/CraPublicFile.d.ts +1 -1
  41. package/dist/Forms/CraPublicFile.js +109 -87
  42. package/dist/Forms/DealerServices.d.ts +1 -1
  43. package/dist/Forms/DealerServices.js +225 -203
  44. package/dist/Forms/EmailOnly.d.ts +1 -1
  45. package/dist/Forms/EmailOnly.js +56 -36
  46. package/dist/Forms/EmailUs.d.ts +1 -1
  47. package/dist/Forms/EmailUs.js +75 -53
  48. package/dist/Forms/FormProps.d.ts +3 -0
  49. package/dist/Forms/HoneyPot/HoneyPot.css.d.ts +1 -0
  50. package/dist/Forms/HoneyPot/HoneyPot.css.js +5 -0
  51. package/dist/Forms/HoneyPot/index.d.ts +23 -0
  52. package/dist/Forms/HoneyPot/index.js +69 -0
  53. package/dist/Forms/MortgageRate/MortgageRateForm.d.ts +1 -1
  54. package/dist/Forms/MortgageRate/MortgageRateForm.js +367 -345
  55. package/dist/Forms/MortgageRate/MortgageRateWatch.js +1 -0
  56. package/dist/Forms/MortgageWarehouseLending.d.ts +1 -3
  57. package/dist/Forms/MortgageWarehouseLending.js +13 -3
  58. package/dist/Forms/QuickPricer/QuickPricerForm.d.ts +1 -1
  59. package/dist/Forms/QuickPricer/QuickPricerForm.js +624 -609
  60. package/dist/Forms/ScheduleCall.d.ts +1 -1
  61. package/dist/Forms/ScheduleCall.js +156 -134
  62. package/dist/Forms/ScheduleCallPremier.d.ts +1 -1
  63. package/dist/Forms/ScheduleCallPremier.js +178 -156
  64. package/dist/Forms/SuccesForm.js +1 -0
  65. package/dist/Forms/VendorQuestionnaire.d.ts +1 -1
  66. package/dist/Forms/VendorQuestionnaire.js +817 -795
  67. package/dist/Forms/WcplSurvey.d.ts +1 -1
  68. package/dist/Forms/WcplSurvey.js +112 -90
  69. package/dist/Forms/index.d.ts +1 -0
  70. package/dist/Forms/index.js +4 -0
  71. package/dist/Hyperlink/index.js +1 -0
  72. package/dist/ImageLink/ImageLink.js +1 -0
  73. package/dist/ImageLink/ImageLinkSet.js +1 -0
  74. package/dist/ImageLink/index.js +1 -0
  75. package/dist/Insight/Featured/CategorySelector.js +1 -0
  76. package/dist/Insight/Featured/Featured.js +1 -0
  77. package/dist/Insight/Featured/Header.js +1 -0
  78. package/dist/Modal/Modal.js +1 -0
  79. package/dist/NavigationMenu/AxosALTS/NavData.js +1 -0
  80. package/dist/NavigationMenu/AxosALTS/index.js +1 -0
  81. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileNavData.js +1 -0
  82. package/dist/NavigationMenu/AxosBank/NavData.js +1 -0
  83. package/dist/NavigationMenu/AxosBank/SubNavBar.js +1 -0
  84. package/dist/NavigationMenu/AxosBank/index.js +1 -0
  85. package/dist/NavigationMenu/LaVictoire/NavData.js +1 -0
  86. package/dist/NavigationMenu/LaVictoire/index.js +1 -0
  87. package/dist/SetContainer/SetContainer.js +1 -0
  88. package/dist/SocialMediaBar/iconsRepository.js +1 -0
  89. package/dist/VideoTile/VideoTile.js +1 -0
  90. package/dist/VideoWrapper/index.js +1 -0
  91. package/dist/assets/Forms/HoneyPot/HoneyPot.css +8 -0
  92. package/dist/main.js +4 -0
  93. package/package.json +1 -1
@@ -46,6 +46,7 @@ import { useForm, FormProvider } from "react-hook-form";
46
46
  import * as z from "zod";
47
47
  import "../../Calculators/BuyDownCalculator/BuyDownCalculator.css.js";
48
48
  import { iconForm, headerForm, form, descriptionField, headerContainer, fullRowSelect, formWrapper, centerSelect, mt2rem, fullRowForm, disclosureForm, actions, formBtns, na_cursor, formContainer } from "../Forms.css.js";
49
+ import { honeyPotSchema, isValidHoneyPot, HoneyPot } from "../HoneyPot/index.js";
49
50
  import { SalesforceSchema } from "../SalesforceFieldsForm.js";
50
51
  import "../../Input/RadioButton.css.js";
51
52
  import "../../Input/Checkbox.css.js";
@@ -140,7 +141,8 @@ const MortgageRate = ({
140
141
  rateWatchOnSubmit,
141
142
  setRateWatchSubmitted,
142
143
  hideModalValue,
143
- showingTables
144
+ showingTables,
145
+ onValidate
144
146
  }) => {
145
147
  const [loanPurpose, setLoanPurpose] = useState(1);
146
148
  const [rateType, setRateType] = useState("Purchase");
@@ -219,8 +221,16 @@ const MortgageRate = ({
219
221
  cashOut: z.number({ message: "Cash Out is required." }).optional(),
220
222
  loanPurpose: z.number({ message: "Loan Purpose is required." })
221
223
  });
224
+ const gen_schema = schema.merge(SalesforceSchema).merge(honeyPotSchema).superRefine((data, ctx) => {
225
+ if (!isValidHoneyPot(data)) {
226
+ ctx.addIssue({
227
+ code: z.ZodIssueCode.custom,
228
+ message: "fields are not valid."
229
+ });
230
+ }
231
+ });
222
232
  const methods = useForm({
223
- resolver: zodResolver(schema.merge(SalesforceSchema), {
233
+ resolver: zodResolver(gen_schema, {
224
234
  async: true
225
235
  }),
226
236
  mode: "all",
@@ -410,361 +420,373 @@ const MortgageRate = ({
410
420
  children: "Tell us about your property and loan to personalize your rate."
411
421
  }
412
422
  ) }),
413
- /* @__PURE__ */ jsxs("form", { className: form, onSubmit: handleSubmit(submitForm), children: [
414
- /* @__PURE__ */ jsxs("div", { className: clsx(formWrapper({ variant })), children: [
415
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(
416
- Dropdown,
417
- {
418
- id: "propertyType",
419
- ...register("propertyType", {
420
- required: true,
421
- setValueAs: (value) => Number(value)
422
- }),
423
- label: "Property Type",
424
- sizes: "medium",
425
- required: true,
426
- error: !!errors.propertyType,
427
- helperText: errors.propertyType?.message,
428
- variant,
429
- defaultValue: "Select option",
430
- children: [
431
- /* @__PURE__ */ jsx("option", { disabled: true, value: "Select option", children: "Select Option" }),
432
- /* @__PURE__ */ jsx("option", { value: "1", children: "Single Family Home" }),
433
- /* @__PURE__ */ jsx("option", { value: "3", children: "Condo" }),
434
- /* @__PURE__ */ jsx("option", { value: "5", children: "Hi-Rise Condo" }),
435
- /* @__PURE__ */ jsx("option", { value: "2", children: "Co-op" }),
436
- /* @__PURE__ */ jsx("option", { value: "4", children: "2-4 Unit" }),
437
- /* @__PURE__ */ jsx("option", { value: "6", children: "Manufactured" })
438
- ]
439
- }
440
- ) }),
441
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(
442
- Dropdown,
443
- {
444
- id: "occupancy",
445
- ...register("occupancy", {
446
- required: true,
447
- setValueAs: (value) => Number(value)
448
- }),
449
- label: "Property Usage",
450
- sizes: "medium",
451
- required: true,
452
- error: !!errors.occupancy,
453
- helperText: errors.occupancy?.message,
454
- variant,
455
- defaultValue: "Select option",
456
- children: [
457
- /* @__PURE__ */ jsx("option", { disabled: true, value: "Select option", children: "Select Option" }),
458
- /* @__PURE__ */ jsx("option", { value: "1", children: "Primary Residence" }),
459
- /* @__PURE__ */ jsx("option", { value: "2", children: "Vacation Home" }),
460
- /* @__PURE__ */ jsx("option", { value: "3", children: "Investment" })
461
- ]
462
- }
463
- ) }),
464
- loanPurpose === 1 && /* @__PURE__ */ jsxs(Fragment, { children: [
465
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
466
- Input,
467
- {
468
- id: "salesPrice",
469
- type: "text",
470
- ...register("salesPrice", {
423
+ /* @__PURE__ */ jsxs(
424
+ "form",
425
+ {
426
+ className: form,
427
+ onSubmit: async (e) => {
428
+ onValidate && onValidate(e);
429
+ await handleSubmit(submitForm)(e);
430
+ e.preventDefault();
431
+ },
432
+ children: [
433
+ /* @__PURE__ */ jsxs("div", { className: clsx(formWrapper({ variant })), children: [
434
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(
435
+ Dropdown,
436
+ {
437
+ id: "propertyType",
438
+ ...register("propertyType", {
439
+ required: true,
440
+ setValueAs: (value) => Number(value)
441
+ }),
442
+ label: "Property Type",
443
+ sizes: "medium",
471
444
  required: true,
472
- setValueAs: (value) => parseCurrency(value)
473
- }),
474
- label: "Purchase Price",
475
- sizes: "medium",
476
- required: true,
477
- error: !!errors.salesPrice,
478
- helperText: errors.salesPrice?.message,
479
- variant,
480
- onBlur: (e) => {
481
- setIsTypingDownPayment(false);
482
- const rawValue = e.target.value;
483
- const parsedValue = parseCurrency(rawValue);
484
- if (parsedValue === 0) {
485
- methods.setError("salesPrice", {
486
- type: "manual",
487
- message: "Purchase Price is required."
488
- });
489
- } else {
490
- methods.setValue("salesPrice", parsedValue);
445
+ error: !!errors.propertyType,
446
+ helperText: errors.propertyType?.message,
447
+ variant,
448
+ defaultValue: "Select option",
449
+ children: [
450
+ /* @__PURE__ */ jsx("option", { disabled: true, value: "Select option", children: "Select Option" }),
451
+ /* @__PURE__ */ jsx("option", { value: "1", children: "Single Family Home" }),
452
+ /* @__PURE__ */ jsx("option", { value: "3", children: "Condo" }),
453
+ /* @__PURE__ */ jsx("option", { value: "5", children: "Hi-Rise Condo" }),
454
+ /* @__PURE__ */ jsx("option", { value: "2", children: "Co-op" }),
455
+ /* @__PURE__ */ jsx("option", { value: "4", children: "2-4 Unit" }),
456
+ /* @__PURE__ */ jsx("option", { value: "6", children: "Manufactured" })
457
+ ]
458
+ }
459
+ ) }),
460
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(
461
+ Dropdown,
462
+ {
463
+ id: "occupancy",
464
+ ...register("occupancy", {
465
+ required: true,
466
+ setValueAs: (value) => Number(value)
467
+ }),
468
+ label: "Property Usage",
469
+ sizes: "medium",
470
+ required: true,
471
+ error: !!errors.occupancy,
472
+ helperText: errors.occupancy?.message,
473
+ variant,
474
+ defaultValue: "Select option",
475
+ children: [
476
+ /* @__PURE__ */ jsx("option", { disabled: true, value: "Select option", children: "Select Option" }),
477
+ /* @__PURE__ */ jsx("option", { value: "1", children: "Primary Residence" }),
478
+ /* @__PURE__ */ jsx("option", { value: "2", children: "Vacation Home" }),
479
+ /* @__PURE__ */ jsx("option", { value: "3", children: "Investment" })
480
+ ]
481
+ }
482
+ ) }),
483
+ loanPurpose === 1 && /* @__PURE__ */ jsxs(Fragment, { children: [
484
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
485
+ Input,
486
+ {
487
+ id: "salesPrice",
488
+ type: "text",
489
+ ...register("salesPrice", {
490
+ required: true,
491
+ setValueAs: (value) => parseCurrency(value)
492
+ }),
493
+ label: "Purchase Price",
494
+ sizes: "medium",
495
+ required: true,
496
+ error: !!errors.salesPrice,
497
+ helperText: errors.salesPrice?.message,
498
+ variant,
499
+ onBlur: (e) => {
500
+ setIsTypingDownPayment(false);
501
+ const rawValue = e.target.value;
502
+ const parsedValue = parseCurrency(rawValue);
503
+ if (parsedValue === 0) {
504
+ methods.setError("salesPrice", {
505
+ type: "manual",
506
+ message: "Purchase Price is required."
507
+ });
508
+ } else {
509
+ methods.setValue("salesPrice", parsedValue);
510
+ e.target.value = formatCurrency(parsedValue);
511
+ }
512
+ methods.trigger("downPayment");
513
+ },
514
+ onFocus: (e) => {
515
+ const currentValue = e.target.value;
516
+ e.target.value = currentValue.replace(/[$,]/g, "");
517
+ }
518
+ }
519
+ ) }),
520
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
521
+ DownPaymentInput,
522
+ {
523
+ id: "downPayment",
524
+ type: "text",
525
+ ...register("downPayment", {
526
+ required: true,
527
+ setValueAs: (value) => parseCurrency(value)
528
+ }),
529
+ salesPrice: watch("salesPrice"),
530
+ downPaymentPercentage,
531
+ setDownPaymentPercentage,
532
+ label: "Down Payment",
533
+ sizes: "medium",
534
+ error: !!errors.downPayment,
535
+ helperText: errors.downPayment?.message,
536
+ onChange: (e) => {
537
+ const value = parseCurrency(e.target.value);
538
+ methods.setValue("downPayment", value);
539
+ },
540
+ variant,
541
+ isTypingDownPayment,
542
+ setIsTypingDownPayment,
543
+ methods
544
+ }
545
+ ) })
546
+ ] }),
547
+ loanPurpose === 2 && /* @__PURE__ */ jsxs(Fragment, { children: [
548
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
549
+ Input,
550
+ {
551
+ id: "appraisedValue",
552
+ type: "text",
553
+ ...register("appraisedValue", {
554
+ required: true,
555
+ setValueAs: (value) => parseCurrency(value)
556
+ }),
557
+ label: "Home Value",
558
+ sizes: "medium",
559
+ required: true,
560
+ error: !!errors.appraisedValue,
561
+ helperText: errors.appraisedValue?.message,
562
+ variant,
563
+ onBlur: (e) => {
564
+ const rawValue = e.target.value;
565
+ const parsedValue = parseCurrency(rawValue);
566
+ methods.setValue("appraisedValue", parsedValue);
567
+ e.target.value = formatCurrency(parsedValue);
568
+ },
569
+ onFocus: (e) => {
570
+ const currentValue = e.target.value;
571
+ e.target.value = currentValue.replace(/[$,]/g, "");
572
+ }
573
+ }
574
+ ) }),
575
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
576
+ Input,
577
+ {
578
+ id: "mortgageBalance",
579
+ type: "text",
580
+ ...register("mortgageBalance", {
581
+ required: true,
582
+ setValueAs: (value) => parseCurrency(value)
583
+ }),
584
+ label: "Mortgage Balance",
585
+ sizes: "medium",
586
+ required: true,
587
+ error: !!errors.mortgageBalance,
588
+ helperText: errors.mortgageBalance?.message,
589
+ variant,
590
+ onBlur: (e) => {
591
+ const rawValue = e.target.value;
592
+ const parsedValue = parseCurrency(rawValue);
593
+ methods.setValue("mortgageBalance", parsedValue);
594
+ e.target.value = formatCurrency(parsedValue);
595
+ },
596
+ onFocus: (e) => {
597
+ const currentValue = e.target.value;
598
+ e.target.value = currentValue.replace(/[$,]/g, "");
599
+ }
600
+ }
601
+ ) })
602
+ ] }),
603
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(
604
+ Dropdown,
605
+ {
606
+ id: "creditScore",
607
+ ...register("creditScore", {
608
+ required: true,
609
+ setValueAs: (value) => value === "" ? void 0 : Number(value)
610
+ }),
611
+ label: "Credit Score",
612
+ sizes: "medium",
613
+ required: true,
614
+ error: !!errors.creditScore,
615
+ helperText: errors.creditScore?.message,
616
+ variant,
617
+ defaultValue: "Select option",
618
+ children: [
619
+ /* @__PURE__ */ jsx("option", { disabled: true, value: "Select option", children: "Select Option" }),
620
+ /* @__PURE__ */ jsx("option", { value: "740", children: "740+" }),
621
+ /* @__PURE__ */ jsx("option", { value: "720", children: "739-720" }),
622
+ /* @__PURE__ */ jsx("option", { value: "700", children: "719-700" }),
623
+ /* @__PURE__ */ jsx("option", { value: "680", children: "699-680" }),
624
+ /* @__PURE__ */ jsx("option", { value: "660", children: "679-660" }),
625
+ /* @__PURE__ */ jsx("option", { value: "640", children: "659-640" }),
626
+ /* @__PURE__ */ jsx("option", { value: "620", children: "639-620" }),
627
+ /* @__PURE__ */ jsx("option", { value: "600", children: "Below 620" })
628
+ ]
629
+ }
630
+ ) }),
631
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
632
+ Input,
633
+ {
634
+ id: "zipCode",
635
+ type: "number",
636
+ ...register("zipCode", {
637
+ required: true,
638
+ setValueAs: (value) => Number(value)
639
+ }),
640
+ label: "Zip Code",
641
+ sizes: "medium",
642
+ required: true,
643
+ error: !!errors.zipCode,
644
+ helperText: errors.zipCode?.message,
645
+ variant
646
+ }
647
+ ) }),
648
+ loanPurpose === 2 ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("div", { className: fullRowForm, children: /* @__PURE__ */ jsx(
649
+ Input,
650
+ {
651
+ id: "cashOut",
652
+ type: "text",
653
+ ...register("cashOut", {
654
+ required: true,
655
+ setValueAs: (value) => parseCurrency(value)
656
+ }),
657
+ label: "Cash Out (Optional)",
658
+ sizes: "medium",
659
+ error: !!errors.cashOut,
660
+ helperText: errors.cashOut?.message,
661
+ variant,
662
+ onBlur: (e) => {
663
+ const rawValue = e.target.value;
664
+ const parsedValue = parseCurrency(rawValue);
665
+ methods.setValue("cashOut", parsedValue);
491
666
  e.target.value = formatCurrency(parsedValue);
667
+ },
668
+ onFocus: (e) => {
669
+ const currentValue = e.target.value;
670
+ e.target.value = currentValue.replace(/[$,]/g, "");
492
671
  }
493
- methods.trigger("downPayment");
494
- },
495
- onFocus: (e) => {
496
- const currentValue = e.target.value;
497
- e.target.value = currentValue.replace(/[$,]/g, "");
498
672
  }
499
- }
500
- ) }),
501
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
502
- DownPaymentInput,
503
- {
504
- id: "downPayment",
505
- type: "text",
506
- ...register("downPayment", {
673
+ ) }) }) : null,
674
+ /* @__PURE__ */ jsx("div", { className: clsx(fullRowForm, "text_center"), children: /* @__PURE__ */ jsx(
675
+ "div",
676
+ {
677
+ className: clsx(
678
+ descriptionField({ variant }),
679
+ "text_center"
680
+ ),
681
+ children: "Almost there! Please provide your contact information to view rates and sign up for Rate Watch."
682
+ }
683
+ ) }),
684
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
685
+ Input,
686
+ {
687
+ id: "firstName",
688
+ ...register("firstName", {
689
+ required: "First Name is required"
690
+ }),
691
+ label: "First Name",
692
+ sizes: "medium",
507
693
  required: true,
508
- setValueAs: (value) => parseCurrency(value)
509
- }),
510
- salesPrice: watch("salesPrice"),
511
- downPaymentPercentage,
512
- setDownPaymentPercentage,
513
- label: "Down Payment",
514
- sizes: "medium",
515
- error: !!errors.downPayment,
516
- helperText: errors.downPayment?.message,
517
- onChange: (e) => {
518
- const value = parseCurrency(e.target.value);
519
- methods.setValue("downPayment", value);
520
- },
521
- variant,
522
- isTypingDownPayment,
523
- setIsTypingDownPayment,
524
- methods
525
- }
526
- ) })
527
- ] }),
528
- loanPurpose === 2 && /* @__PURE__ */ jsxs(Fragment, { children: [
529
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
530
- Input,
531
- {
532
- id: "appraisedValue",
533
- type: "text",
534
- ...register("appraisedValue", {
694
+ error: !!errors.firstName,
695
+ helperText: errors.firstName?.message,
696
+ variant
697
+ }
698
+ ) }),
699
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
700
+ Input,
701
+ {
702
+ id: "lastName",
703
+ ...register("lastName", { required: true }),
704
+ label: "Last Name",
705
+ sizes: "medium",
535
706
  required: true,
536
- setValueAs: (value) => parseCurrency(value)
537
- }),
538
- label: "Home Value",
539
- sizes: "medium",
540
- required: true,
541
- error: !!errors.appraisedValue,
542
- helperText: errors.appraisedValue?.message,
543
- variant,
544
- onBlur: (e) => {
545
- const rawValue = e.target.value;
546
- const parsedValue = parseCurrency(rawValue);
547
- methods.setValue("appraisedValue", parsedValue);
548
- e.target.value = formatCurrency(parsedValue);
549
- },
550
- onFocus: (e) => {
551
- const currentValue = e.target.value;
552
- e.target.value = currentValue.replace(/[$,]/g, "");
707
+ error: !!errors.lastName,
708
+ helperText: errors.lastName?.message,
709
+ variant
553
710
  }
554
- }
555
- ) }),
556
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
557
- Input,
558
- {
559
- id: "mortgageBalance",
560
- type: "text",
561
- ...register("mortgageBalance", {
711
+ ) }),
712
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
713
+ Input,
714
+ {
715
+ id: "email",
716
+ ...register("email", {
717
+ required: true,
718
+ validate: {
719
+ isValid: associatedEmail
720
+ }
721
+ }),
722
+ label: "Email",
723
+ sizes: "medium",
562
724
  required: true,
563
- setValueAs: (value) => parseCurrency(value)
564
- }),
565
- label: "Mortgage Balance",
566
- sizes: "medium",
567
- required: true,
568
- error: !!errors.mortgageBalance,
569
- helperText: errors.mortgageBalance?.message,
570
- variant,
571
- onBlur: (e) => {
572
- const rawValue = e.target.value;
573
- const parsedValue = parseCurrency(rawValue);
574
- methods.setValue("mortgageBalance", parsedValue);
575
- e.target.value = formatCurrency(parsedValue);
576
- },
577
- onFocus: (e) => {
578
- const currentValue = e.target.value;
579
- e.target.value = currentValue.replace(/[$,]/g, "");
725
+ error: !!errors.email,
726
+ helperText: errors.email?.message,
727
+ variant
580
728
  }
581
- }
582
- ) })
583
- ] }),
584
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(
585
- Dropdown,
586
- {
587
- id: "creditScore",
588
- ...register("creditScore", {
589
- required: true,
590
- setValueAs: (value) => value === "" ? void 0 : Number(value)
591
- }),
592
- label: "Credit Score",
593
- sizes: "medium",
594
- required: true,
595
- error: !!errors.creditScore,
596
- helperText: errors.creditScore?.message,
597
- variant,
598
- defaultValue: "Select option",
599
- children: [
600
- /* @__PURE__ */ jsx("option", { disabled: true, value: "Select option", children: "Select Option" }),
601
- /* @__PURE__ */ jsx("option", { value: "740", children: "740+" }),
602
- /* @__PURE__ */ jsx("option", { value: "720", children: "739-720" }),
603
- /* @__PURE__ */ jsx("option", { value: "700", children: "719-700" }),
604
- /* @__PURE__ */ jsx("option", { value: "680", children: "699-680" }),
605
- /* @__PURE__ */ jsx("option", { value: "660", children: "679-660" }),
606
- /* @__PURE__ */ jsx("option", { value: "640", children: "659-640" }),
607
- /* @__PURE__ */ jsx("option", { value: "620", children: "639-620" }),
608
- /* @__PURE__ */ jsx("option", { value: "600", children: "Below 620" })
609
- ]
610
- }
611
- ) }),
612
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
613
- Input,
614
- {
615
- id: "zipCode",
616
- type: "number",
617
- ...register("zipCode", {
618
- required: true,
619
- setValueAs: (value) => Number(value)
620
- }),
621
- label: "Zip Code",
622
- sizes: "medium",
623
- required: true,
624
- error: !!errors.zipCode,
625
- helperText: errors.zipCode?.message,
626
- variant
627
- }
628
- ) }),
629
- loanPurpose === 2 ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("div", { className: fullRowForm, children: /* @__PURE__ */ jsx(
630
- Input,
631
- {
632
- id: "cashOut",
633
- type: "text",
634
- ...register("cashOut", {
635
- required: true,
636
- setValueAs: (value) => parseCurrency(value)
637
- }),
638
- label: "Cash Out (Optional)",
639
- sizes: "medium",
640
- error: !!errors.cashOut,
641
- helperText: errors.cashOut?.message,
642
- variant,
643
- onBlur: (e) => {
644
- const rawValue = e.target.value;
645
- const parsedValue = parseCurrency(rawValue);
646
- methods.setValue("cashOut", parsedValue);
647
- e.target.value = formatCurrency(parsedValue);
648
- },
649
- onFocus: (e) => {
650
- const currentValue = e.target.value;
651
- e.target.value = currentValue.replace(/[$,]/g, "");
652
- }
653
- }
654
- ) }) }) : null,
655
- /* @__PURE__ */ jsx("div", { className: clsx(fullRowForm, "text_center"), children: /* @__PURE__ */ jsx(
656
- "div",
657
- {
658
- className: clsx(
659
- descriptionField({ variant }),
660
- "text_center"
661
- ),
662
- children: "Almost there! Please provide your contact information to view rates and sign up for Rate Watch."
663
- }
664
- ) }),
665
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
666
- Input,
667
- {
668
- id: "firstName",
669
- ...register("firstName", {
670
- required: "First Name is required"
671
- }),
672
- label: "First Name",
673
- sizes: "medium",
674
- required: true,
675
- error: !!errors.firstName,
676
- helperText: errors.firstName?.message,
677
- variant
678
- }
679
- ) }),
680
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
681
- Input,
682
- {
683
- id: "lastName",
684
- ...register("lastName", { required: true }),
685
- label: "Last Name",
686
- sizes: "medium",
687
- required: true,
688
- error: !!errors.lastName,
689
- helperText: errors.lastName?.message,
690
- variant
691
- }
692
- ) }),
693
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
694
- Input,
695
- {
696
- id: "email",
697
- ...register("email", {
698
- required: true,
699
- validate: {
700
- isValid: associatedEmail
729
+ ) }),
730
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
731
+ InputPhone,
732
+ {
733
+ id: "phone",
734
+ ...register("phone", { required: true, maxLength: 12 }),
735
+ label: "Phone Number",
736
+ sizes: "medium",
737
+ required: true,
738
+ error: !!errors.phone,
739
+ helperText: errors.phone?.message,
740
+ variant
701
741
  }
702
- }),
703
- label: "Email",
704
- sizes: "medium",
705
- required: true,
706
- error: !!errors.email,
707
- helperText: errors.email?.message,
708
- variant
709
- }
710
- ) }),
711
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
712
- InputPhone,
713
- {
714
- id: "phone",
715
- ...register("phone", { required: true, maxLength: 12 }),
716
- label: "Phone Number",
717
- sizes: "medium",
718
- required: true,
719
- error: !!errors.phone,
720
- helperText: errors.phone?.message,
721
- variant
722
- }
723
- ) })
724
- ] }),
725
- children,
726
- /* @__PURE__ */ jsx("div", { className: disclosureForm({ variant }), children: disclosure }),
727
- /* @__PURE__ */ jsx("div", { className: actions, children: isSubmitting ? /* @__PURE__ */ jsx(
728
- LoadingIndicator,
729
- {
730
- style: { marginInline: "auto" },
731
- variant
732
- }
733
- ) : /* @__PURE__ */ jsxs("div", { className: formBtns, children: [
734
- /* @__PURE__ */ jsx(
735
- "button",
736
- {
737
- type: "submit",
738
- disabled: !isValid,
739
- className: button({
740
- color: "secondary",
741
- size: "large",
742
- rounded: "medium",
743
- disabled: !isValid
744
- }),
745
- children: "Get My Rate"
746
- }
747
- ),
748
- /* @__PURE__ */ jsxs("span", { className: `sc__btn ${chevron_wrapper}`, children: [
749
- /* @__PURE__ */ jsx(
750
- "a",
742
+ ) })
743
+ ] }),
744
+ children,
745
+ /* @__PURE__ */ jsx("div", { className: disclosureForm({ variant }), children: disclosure }),
746
+ /* @__PURE__ */ jsx("div", { className: actions, children: isSubmitting ? /* @__PURE__ */ jsx(
747
+ LoadingIndicator,
751
748
  {
752
- id,
753
- className: `${chevron({ variant })} ${!isValid ? na_cursor : ""}`,
754
- onClick: isValid ? handleSubmit(async (data) => {
755
- await onSubmit(data);
756
- toggleModal();
757
- setHideModal(false);
758
- }) : (e) => {
759
- e.preventDefault();
760
- },
761
- children: "Sign Up For Ratewatch"
749
+ style: { marginInline: "auto" },
750
+ variant
762
751
  }
763
- ),
764
- /* @__PURE__ */ jsx(SvgArrowIcon, { className: "arrow", variant: "tertiary" })
765
- ] })
766
- ] }) })
767
- ] })
752
+ ) : /* @__PURE__ */ jsxs("div", { className: formBtns, children: [
753
+ /* @__PURE__ */ jsx(
754
+ "button",
755
+ {
756
+ type: "submit",
757
+ disabled: !isValid,
758
+ className: button({
759
+ color: "secondary",
760
+ size: "large",
761
+ rounded: "medium",
762
+ disabled: !isValid
763
+ }),
764
+ children: "Get My Rate"
765
+ }
766
+ ),
767
+ /* @__PURE__ */ jsxs("span", { className: `sc__btn ${chevron_wrapper}`, children: [
768
+ /* @__PURE__ */ jsx(
769
+ "a",
770
+ {
771
+ id,
772
+ className: `${chevron({ variant })} ${!isValid ? na_cursor : ""}`,
773
+ onClick: isValid ? handleSubmit(async (data) => {
774
+ await onSubmit(data);
775
+ toggleModal();
776
+ setHideModal(false);
777
+ }) : (e) => {
778
+ e.preventDefault();
779
+ },
780
+ children: "Sign Up For Ratewatch"
781
+ }
782
+ ),
783
+ /* @__PURE__ */ jsx(SvgArrowIcon, { className: "arrow", variant: "tertiary" })
784
+ ] })
785
+ ] }) }),
786
+ /* @__PURE__ */ jsx(HoneyPot, { register, variant })
787
+ ]
788
+ }
789
+ )
768
790
  ] }) })
769
791
  },
770
792
  id