@sikka/hawa 0.49.7-next → 0.49.8-next

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.
@@ -4473,8 +4473,15 @@ var RegisterForm = ({
4473
4473
  continueWithEmail: texts == null ? void 0 : texts.continueWithEmail,
4474
4474
  continueWithPhone: texts == null ? void 0 : texts.continueWithPhone
4475
4475
  };
4476
- const methods = (0, import_react_hook_form2.useForm)();
4477
4476
  let fieldSchemas = {};
4477
+ let remainingFieldsSchema = z2.object({
4478
+ refCode: z2.string().optional(),
4479
+ reference: z2.string().optional(),
4480
+ terms_accepted: showTermsOption ? z2.boolean({ required_error: (texts == null ? void 0 : texts.termsRequired) || "Terms required" }).refine((value) => value, {
4481
+ message: (texts == null ? void 0 : texts.termsRequired) || "Terms required"
4482
+ }) : z2.boolean().optional(),
4483
+ newsletter_accepted: z2.boolean().optional()
4484
+ });
4478
4485
  const hasPhoneType = registerTypes == null ? void 0 : registerTypes.some((type) => type.value === "phone");
4479
4486
  if (hasPhoneType && selectedRegisterType.value === "phone") {
4480
4487
  registerFields = ["phone"];
@@ -4529,13 +4536,7 @@ var RegisterForm = ({
4529
4536
  return isPhoneValid;
4530
4537
  },
4531
4538
  { message: ((_d = texts == null ? void 0 : texts.phone) == null ? void 0 : _d.invalid) || "Phone Number Invalid" }
4532
- ),
4533
- refCode: z2.string().optional(),
4534
- reference: z2.string().optional(),
4535
- terms_accepted: z2.boolean({ required_error: (texts == null ? void 0 : texts.termsRequired) || "Terms required" }).refine((value) => value, {
4536
- message: (texts == null ? void 0 : texts.termsRequired) || "Terms required"
4537
- }),
4538
- newsletter_accepted: z2.boolean().optional()
4539
+ )
4539
4540
  });
4540
4541
  } else {
4541
4542
  formSchema = z2.object({
@@ -4553,21 +4554,24 @@ var RegisterForm = ({
4553
4554
  message: ((_i = texts == null ? void 0 : texts.password) == null ? void 0 : _i.tooShort) || "Password is too short"
4554
4555
  }).refine((value) => value !== "", {
4555
4556
  message: ((_j = texts == null ? void 0 : texts.password) == null ? void 0 : _j.required) || "Confirm password is required"
4556
- }),
4557
- refCode: z2.string().optional(),
4558
- reference: z2.string().optional(),
4559
- terms_accepted: z2.boolean({ required_error: (texts == null ? void 0 : texts.termsRequired) || "Terms required" }).refine((value) => value, {
4560
- message: (texts == null ? void 0 : texts.termsRequired) || "Terms required"
4561
- }),
4562
- newsletter_accepted: z2.boolean().optional()
4557
+ })
4563
4558
  }).refine((data) => data.password === data.confirm_password, {
4564
4559
  message: ((_k = texts == null ? void 0 : texts.confirm) == null ? void 0 : _k.dontMatch) || "Passwords don't match",
4565
4560
  path: ["confirm_password"]
4566
4561
  });
4567
4562
  }
4568
- const { handleSubmit, control, formState } = (0, import_react_hook_form2.useForm)({
4569
- resolver: (0, import_zod2.zodResolver)(formSchema)
4563
+ let finalSchema = z2.intersection(formSchema, remainingFieldsSchema);
4564
+ const methods = (0, import_react_hook_form2.useForm)({
4565
+ resolver: (0, import_zod2.zodResolver)(finalSchema)
4570
4566
  });
4567
+ const onSubmit = (data) => {
4568
+ console.log("Form submitted with data:", data);
4569
+ if (props.onRegister) {
4570
+ props.onRegister(data);
4571
+ } else {
4572
+ console.log("onRegister prop is missing");
4573
+ }
4574
+ };
4571
4575
  return /* @__PURE__ */ import_react37.default.createElement("div", { className: cn("hawa-flex hawa-flex-col", (_l = props.classNames) == null ? void 0 : _l.root) }, /* @__PURE__ */ import_react37.default.createElement(
4572
4576
  Card,
4573
4577
  {
@@ -4607,13 +4611,7 @@ var RegisterForm = ({
4607
4611
  {
4608
4612
  id: "register_form",
4609
4613
  noValidate: true,
4610
- onSubmit: handleSubmit((e) => {
4611
- if (props.onRegister) {
4612
- return props.onRegister(e);
4613
- } else {
4614
- console.log("Form is submitted but onRegister prop is missing");
4615
- }
4616
- }),
4614
+ onSubmit: methods.handleSubmit(onSubmit),
4617
4615
  className: "hawa-flex hawa-flex-col hawa-gap-4"
4618
4616
  },
4619
4617
  /* @__PURE__ */ import_react37.default.createElement(
@@ -4650,7 +4648,7 @@ var RegisterForm = ({
4650
4648
  import_react_hook_form2.Controller,
4651
4649
  {
4652
4650
  key: i,
4653
- control,
4651
+ control: methods.control,
4654
4652
  name: "fullName",
4655
4653
  render: ({ field }) => {
4656
4654
  var _a2, _b2, _c2;
@@ -4660,7 +4658,7 @@ var RegisterForm = ({
4660
4658
  width: "full",
4661
4659
  label: ((_a2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _a2.label) || "Full Name",
4662
4660
  placeholder: (_b2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _b2.placeholder,
4663
- helperText: (_c2 = formState.errors.fullName) == null ? void 0 : _c2.message,
4661
+ helperText: (_c2 = methods.formState.errors.fullName) == null ? void 0 : _c2.message,
4664
4662
  ...field
4665
4663
  }
4666
4664
  );
@@ -4673,7 +4671,7 @@ var RegisterForm = ({
4673
4671
  import_react_hook_form2.Controller,
4674
4672
  {
4675
4673
  key: i,
4676
- control,
4674
+ control: methods.control,
4677
4675
  name: "email",
4678
4676
  render: ({ field }) => {
4679
4677
  var _a2, _b2, _c2;
@@ -4687,7 +4685,7 @@ var RegisterForm = ({
4687
4685
  width: "full",
4688
4686
  autoComplete: "email",
4689
4687
  label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
4690
- helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
4688
+ helperText: (_b2 = methods.formState.errors.email) == null ? void 0 : _b2.message,
4691
4689
  placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "Enter your email",
4692
4690
  ...field,
4693
4691
  onChange: (e) => {
@@ -4704,7 +4702,7 @@ var RegisterForm = ({
4704
4702
  import_react_hook_form2.Controller,
4705
4703
  {
4706
4704
  key: i,
4707
- control,
4705
+ control: methods.control,
4708
4706
  name: "username",
4709
4707
  render: ({ field }) => {
4710
4708
  var _a2, _b2, _c2, _d2, _e2;
@@ -4717,7 +4715,7 @@ var RegisterForm = ({
4717
4715
  labelProps: ((_b2 = props.usernameOptions) == null ? void 0 : _b2.label) ? {
4718
4716
  ...(_c2 = props.usernameOptions) == null ? void 0 : _c2.label
4719
4717
  } : void 0,
4720
- helperText: (_d2 = formState.errors.username) == null ? void 0 : _d2.message,
4718
+ helperText: (_d2 = methods.formState.errors.username) == null ? void 0 : _d2.message,
4721
4719
  placeholder: (_e2 = texts == null ? void 0 : texts.username) == null ? void 0 : _e2.placeholder,
4722
4720
  ...field
4723
4721
  }
@@ -4730,7 +4728,7 @@ var RegisterForm = ({
4730
4728
  /* @__PURE__ */ import_react37.default.createElement(
4731
4729
  import_react_hook_form2.Controller,
4732
4730
  {
4733
- control,
4731
+ control: methods.control,
4734
4732
  name: "password",
4735
4733
  render: ({ field }) => {
4736
4734
  var _a2, _b2, _c2;
@@ -4742,7 +4740,7 @@ var RegisterForm = ({
4742
4740
  autoComplete: "new-password",
4743
4741
  label: ((_a2 = texts == null ? void 0 : texts.password) == null ? void 0 : _a2.label) || "Password",
4744
4742
  placeholder: (_b2 = texts == null ? void 0 : texts.password) == null ? void 0 : _b2.placeholder,
4745
- helperText: (_c2 = formState.errors.password) == null ? void 0 : _c2.message,
4743
+ helperText: (_c2 = methods.formState.errors.password) == null ? void 0 : _c2.message,
4746
4744
  endIcon: /* @__PURE__ */ import_react37.default.createElement(
4747
4745
  "div",
4748
4746
  {
@@ -4761,7 +4759,7 @@ var RegisterForm = ({
4761
4759
  /* @__PURE__ */ import_react37.default.createElement(
4762
4760
  import_react_hook_form2.Controller,
4763
4761
  {
4764
- control,
4762
+ control: methods.control,
4765
4763
  name: "confirm_password",
4766
4764
  render: ({ field }) => {
4767
4765
  var _a2, _b2, _c2;
@@ -4773,7 +4771,7 @@ var RegisterForm = ({
4773
4771
  autoComplete: "new-password",
4774
4772
  label: ((_a2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _a2.label) || "Confirm Password",
4775
4773
  placeholder: ((_b2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _b2.placeholder) || "Confirm your Password",
4776
- helperText: (_c2 = formState.errors.confirm_password) == null ? void 0 : _c2.message,
4774
+ helperText: (_c2 = methods.formState.errors.confirm_password) == null ? void 0 : _c2.message,
4777
4775
  endIcon: /* @__PURE__ */ import_react37.default.createElement(
4778
4776
  "div",
4779
4777
  {
@@ -4793,7 +4791,7 @@ var RegisterForm = ({
4793
4791
  props.showRefCode && /* @__PURE__ */ import_react37.default.createElement(
4794
4792
  import_react_hook_form2.Controller,
4795
4793
  {
4796
- control,
4794
+ control: methods.control,
4797
4795
  name: "refCode",
4798
4796
  render: ({ field }) => {
4799
4797
  var _a2;
@@ -4803,7 +4801,7 @@ var RegisterForm = ({
4803
4801
  width: "full",
4804
4802
  label: texts == null ? void 0 : texts.refCode,
4805
4803
  placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
4806
- helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
4804
+ helperText: (_a2 = methods.formState.errors.refCode) == null ? void 0 : _a2.message,
4807
4805
  ...field
4808
4806
  }
4809
4807
  );
@@ -4813,7 +4811,7 @@ var RegisterForm = ({
4813
4811
  props.showUserSource && /* @__PURE__ */ import_react37.default.createElement(
4814
4812
  import_react_hook_form2.Controller,
4815
4813
  {
4816
- control,
4814
+ control: methods.control,
4817
4815
  name: "reference",
4818
4816
  render: ({ field }) => {
4819
4817
  var _a2, _b2;
@@ -4847,7 +4845,7 @@ var RegisterForm = ({
4847
4845
  /* @__PURE__ */ import_react37.default.createElement(
4848
4846
  import_react_hook_form2.Controller,
4849
4847
  {
4850
- control,
4848
+ control: methods.control,
4851
4849
  name: "phone",
4852
4850
  render: ({ field }) => {
4853
4851
  var _a2, _b2;
@@ -4855,7 +4853,7 @@ var RegisterForm = ({
4855
4853
  PhoneInput,
4856
4854
  {
4857
4855
  label: ((_a2 = texts == null ? void 0 : texts.phone) == null ? void 0 : _a2.label) || "Phone Number",
4858
- helperText: (_b2 = formState.errors.phone) == null ? void 0 : _b2.message,
4856
+ helperText: (_b2 = methods.formState.errors.phone) == null ? void 0 : _b2.message,
4859
4857
  preferredCountry: { label: "+966" },
4860
4858
  ...props.phoneInputProps,
4861
4859
  handleChange: (e) => {
@@ -4875,7 +4873,7 @@ var RegisterForm = ({
4875
4873
  props.showRefCode && /* @__PURE__ */ import_react37.default.createElement(
4876
4874
  import_react_hook_form2.Controller,
4877
4875
  {
4878
- control,
4876
+ control: methods.control,
4879
4877
  name: "refCode",
4880
4878
  render: ({ field }) => {
4881
4879
  var _a2;
@@ -4885,7 +4883,7 @@ var RegisterForm = ({
4885
4883
  width: "full",
4886
4884
  label: texts == null ? void 0 : texts.refCode,
4887
4885
  placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
4888
- helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
4886
+ helperText: (_a2 = methods.formState.errors.refCode) == null ? void 0 : _a2.message,
4889
4887
  ...field
4890
4888
  }
4891
4889
  );
@@ -4895,7 +4893,7 @@ var RegisterForm = ({
4895
4893
  props.showUserSource && /* @__PURE__ */ import_react37.default.createElement(
4896
4894
  import_react_hook_form2.Controller,
4897
4895
  {
4898
- control,
4896
+ control: methods.control,
4899
4897
  name: "reference",
4900
4898
  render: ({ field }) => {
4901
4899
  var _a2, _b2;
@@ -4919,7 +4917,7 @@ var RegisterForm = ({
4919
4917
  showTermsOption || showNewsletterOption ? /* @__PURE__ */ import_react37.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-3 hawa-mb-2" }, showTermsOption && /* @__PURE__ */ import_react37.default.createElement(
4920
4918
  import_react_hook_form2.Controller,
4921
4919
  {
4922
- control,
4920
+ control: methods.control,
4923
4921
  name: "terms_accepted",
4924
4922
  render: ({ field }) => {
4925
4923
  var _a2, _b2;
@@ -4927,7 +4925,7 @@ var RegisterForm = ({
4927
4925
  Checkbox,
4928
4926
  {
4929
4927
  id: "terms_accepted",
4930
- helperText: (_b2 = (_a2 = formState.errors.terms_accepted) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
4928
+ helperText: (_b2 = (_a2 = methods.formState.errors.terms_accepted) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
4931
4929
  onCheckedChange: (e) => field.onChange(e),
4932
4930
  label: /* @__PURE__ */ import_react37.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-gap-0.5 hawa-whitespace-nowrap hawa-flex-wrap" }, (texts == null ? void 0 : texts.iAcceptText) || "I accept the", " ", /* @__PURE__ */ import_react37.default.createElement(StopPropagationWrapper, null, /* @__PURE__ */ import_react37.default.createElement(
4933
4931
  "span",
@@ -4949,7 +4947,7 @@ var RegisterForm = ({
4949
4947
  ), showNewsletterOption && /* @__PURE__ */ import_react37.default.createElement(
4950
4948
  import_react_hook_form2.Controller,
4951
4949
  {
4952
- control,
4950
+ control: methods.control,
4953
4951
  name: "newsletter_accepted",
4954
4952
  render: ({ field }) => /* @__PURE__ */ import_react37.default.createElement(
4955
4953
  Checkbox,
@@ -515,8 +515,15 @@ var RegisterForm = ({
515
515
  continueWithEmail: texts == null ? void 0 : texts.continueWithEmail,
516
516
  continueWithPhone: texts == null ? void 0 : texts.continueWithPhone
517
517
  };
518
- const methods = useForm2();
519
518
  let fieldSchemas = {};
519
+ let remainingFieldsSchema = z2.object({
520
+ refCode: z2.string().optional(),
521
+ reference: z2.string().optional(),
522
+ terms_accepted: showTermsOption ? z2.boolean({ required_error: (texts == null ? void 0 : texts.termsRequired) || "Terms required" }).refine((value) => value, {
523
+ message: (texts == null ? void 0 : texts.termsRequired) || "Terms required"
524
+ }) : z2.boolean().optional(),
525
+ newsletter_accepted: z2.boolean().optional()
526
+ });
520
527
  const hasPhoneType = registerTypes == null ? void 0 : registerTypes.some((type) => type.value === "phone");
521
528
  if (hasPhoneType && selectedRegisterType.value === "phone") {
522
529
  registerFields = ["phone"];
@@ -571,13 +578,7 @@ var RegisterForm = ({
571
578
  return isPhoneValid;
572
579
  },
573
580
  { message: ((_d = texts == null ? void 0 : texts.phone) == null ? void 0 : _d.invalid) || "Phone Number Invalid" }
574
- ),
575
- refCode: z2.string().optional(),
576
- reference: z2.string().optional(),
577
- terms_accepted: z2.boolean({ required_error: (texts == null ? void 0 : texts.termsRequired) || "Terms required" }).refine((value) => value, {
578
- message: (texts == null ? void 0 : texts.termsRequired) || "Terms required"
579
- }),
580
- newsletter_accepted: z2.boolean().optional()
581
+ )
581
582
  });
582
583
  } else {
583
584
  formSchema = z2.object({
@@ -595,21 +596,24 @@ var RegisterForm = ({
595
596
  message: ((_i = texts == null ? void 0 : texts.password) == null ? void 0 : _i.tooShort) || "Password is too short"
596
597
  }).refine((value) => value !== "", {
597
598
  message: ((_j = texts == null ? void 0 : texts.password) == null ? void 0 : _j.required) || "Confirm password is required"
598
- }),
599
- refCode: z2.string().optional(),
600
- reference: z2.string().optional(),
601
- terms_accepted: z2.boolean({ required_error: (texts == null ? void 0 : texts.termsRequired) || "Terms required" }).refine((value) => value, {
602
- message: (texts == null ? void 0 : texts.termsRequired) || "Terms required"
603
- }),
604
- newsletter_accepted: z2.boolean().optional()
599
+ })
605
600
  }).refine((data) => data.password === data.confirm_password, {
606
601
  message: ((_k = texts == null ? void 0 : texts.confirm) == null ? void 0 : _k.dontMatch) || "Passwords don't match",
607
602
  path: ["confirm_password"]
608
603
  });
609
604
  }
610
- const { handleSubmit, control, formState } = useForm2({
611
- resolver: zodResolver2(formSchema)
605
+ let finalSchema = z2.intersection(formSchema, remainingFieldsSchema);
606
+ const methods = useForm2({
607
+ resolver: zodResolver2(finalSchema)
612
608
  });
609
+ const onSubmit = (data) => {
610
+ console.log("Form submitted with data:", data);
611
+ if (props.onRegister) {
612
+ props.onRegister(data);
613
+ } else {
614
+ console.log("onRegister prop is missing");
615
+ }
616
+ };
613
617
  return /* @__PURE__ */ React3.createElement("div", { className: cn("hawa-flex hawa-flex-col", (_l = props.classNames) == null ? void 0 : _l.root) }, /* @__PURE__ */ React3.createElement(
614
618
  Card,
615
619
  {
@@ -649,13 +653,7 @@ var RegisterForm = ({
649
653
  {
650
654
  id: "register_form",
651
655
  noValidate: true,
652
- onSubmit: handleSubmit((e) => {
653
- if (props.onRegister) {
654
- return props.onRegister(e);
655
- } else {
656
- console.log("Form is submitted but onRegister prop is missing");
657
- }
658
- }),
656
+ onSubmit: methods.handleSubmit(onSubmit),
659
657
  className: "hawa-flex hawa-flex-col hawa-gap-4"
660
658
  },
661
659
  /* @__PURE__ */ React3.createElement(
@@ -692,7 +690,7 @@ var RegisterForm = ({
692
690
  Controller2,
693
691
  {
694
692
  key: i,
695
- control,
693
+ control: methods.control,
696
694
  name: "fullName",
697
695
  render: ({ field }) => {
698
696
  var _a2, _b2, _c2;
@@ -702,7 +700,7 @@ var RegisterForm = ({
702
700
  width: "full",
703
701
  label: ((_a2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _a2.label) || "Full Name",
704
702
  placeholder: (_b2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _b2.placeholder,
705
- helperText: (_c2 = formState.errors.fullName) == null ? void 0 : _c2.message,
703
+ helperText: (_c2 = methods.formState.errors.fullName) == null ? void 0 : _c2.message,
706
704
  ...field
707
705
  }
708
706
  );
@@ -715,7 +713,7 @@ var RegisterForm = ({
715
713
  Controller2,
716
714
  {
717
715
  key: i,
718
- control,
716
+ control: methods.control,
719
717
  name: "email",
720
718
  render: ({ field }) => {
721
719
  var _a2, _b2, _c2;
@@ -729,7 +727,7 @@ var RegisterForm = ({
729
727
  width: "full",
730
728
  autoComplete: "email",
731
729
  label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
732
- helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
730
+ helperText: (_b2 = methods.formState.errors.email) == null ? void 0 : _b2.message,
733
731
  placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "Enter your email",
734
732
  ...field,
735
733
  onChange: (e) => {
@@ -746,7 +744,7 @@ var RegisterForm = ({
746
744
  Controller2,
747
745
  {
748
746
  key: i,
749
- control,
747
+ control: methods.control,
750
748
  name: "username",
751
749
  render: ({ field }) => {
752
750
  var _a2, _b2, _c2, _d2, _e2;
@@ -759,7 +757,7 @@ var RegisterForm = ({
759
757
  labelProps: ((_b2 = props.usernameOptions) == null ? void 0 : _b2.label) ? {
760
758
  ...(_c2 = props.usernameOptions) == null ? void 0 : _c2.label
761
759
  } : void 0,
762
- helperText: (_d2 = formState.errors.username) == null ? void 0 : _d2.message,
760
+ helperText: (_d2 = methods.formState.errors.username) == null ? void 0 : _d2.message,
763
761
  placeholder: (_e2 = texts == null ? void 0 : texts.username) == null ? void 0 : _e2.placeholder,
764
762
  ...field
765
763
  }
@@ -772,7 +770,7 @@ var RegisterForm = ({
772
770
  /* @__PURE__ */ React3.createElement(
773
771
  Controller2,
774
772
  {
775
- control,
773
+ control: methods.control,
776
774
  name: "password",
777
775
  render: ({ field }) => {
778
776
  var _a2, _b2, _c2;
@@ -784,7 +782,7 @@ var RegisterForm = ({
784
782
  autoComplete: "new-password",
785
783
  label: ((_a2 = texts == null ? void 0 : texts.password) == null ? void 0 : _a2.label) || "Password",
786
784
  placeholder: (_b2 = texts == null ? void 0 : texts.password) == null ? void 0 : _b2.placeholder,
787
- helperText: (_c2 = formState.errors.password) == null ? void 0 : _c2.message,
785
+ helperText: (_c2 = methods.formState.errors.password) == null ? void 0 : _c2.message,
788
786
  endIcon: /* @__PURE__ */ React3.createElement(
789
787
  "div",
790
788
  {
@@ -803,7 +801,7 @@ var RegisterForm = ({
803
801
  /* @__PURE__ */ React3.createElement(
804
802
  Controller2,
805
803
  {
806
- control,
804
+ control: methods.control,
807
805
  name: "confirm_password",
808
806
  render: ({ field }) => {
809
807
  var _a2, _b2, _c2;
@@ -815,7 +813,7 @@ var RegisterForm = ({
815
813
  autoComplete: "new-password",
816
814
  label: ((_a2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _a2.label) || "Confirm Password",
817
815
  placeholder: ((_b2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _b2.placeholder) || "Confirm your Password",
818
- helperText: (_c2 = formState.errors.confirm_password) == null ? void 0 : _c2.message,
816
+ helperText: (_c2 = methods.formState.errors.confirm_password) == null ? void 0 : _c2.message,
819
817
  endIcon: /* @__PURE__ */ React3.createElement(
820
818
  "div",
821
819
  {
@@ -835,7 +833,7 @@ var RegisterForm = ({
835
833
  props.showRefCode && /* @__PURE__ */ React3.createElement(
836
834
  Controller2,
837
835
  {
838
- control,
836
+ control: methods.control,
839
837
  name: "refCode",
840
838
  render: ({ field }) => {
841
839
  var _a2;
@@ -845,7 +843,7 @@ var RegisterForm = ({
845
843
  width: "full",
846
844
  label: texts == null ? void 0 : texts.refCode,
847
845
  placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
848
- helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
846
+ helperText: (_a2 = methods.formState.errors.refCode) == null ? void 0 : _a2.message,
849
847
  ...field
850
848
  }
851
849
  );
@@ -855,7 +853,7 @@ var RegisterForm = ({
855
853
  props.showUserSource && /* @__PURE__ */ React3.createElement(
856
854
  Controller2,
857
855
  {
858
- control,
856
+ control: methods.control,
859
857
  name: "reference",
860
858
  render: ({ field }) => {
861
859
  var _a2, _b2;
@@ -889,7 +887,7 @@ var RegisterForm = ({
889
887
  /* @__PURE__ */ React3.createElement(
890
888
  Controller2,
891
889
  {
892
- control,
890
+ control: methods.control,
893
891
  name: "phone",
894
892
  render: ({ field }) => {
895
893
  var _a2, _b2;
@@ -897,7 +895,7 @@ var RegisterForm = ({
897
895
  PhoneInput,
898
896
  {
899
897
  label: ((_a2 = texts == null ? void 0 : texts.phone) == null ? void 0 : _a2.label) || "Phone Number",
900
- helperText: (_b2 = formState.errors.phone) == null ? void 0 : _b2.message,
898
+ helperText: (_b2 = methods.formState.errors.phone) == null ? void 0 : _b2.message,
901
899
  preferredCountry: { label: "+966" },
902
900
  ...props.phoneInputProps,
903
901
  handleChange: (e) => {
@@ -917,7 +915,7 @@ var RegisterForm = ({
917
915
  props.showRefCode && /* @__PURE__ */ React3.createElement(
918
916
  Controller2,
919
917
  {
920
- control,
918
+ control: methods.control,
921
919
  name: "refCode",
922
920
  render: ({ field }) => {
923
921
  var _a2;
@@ -927,7 +925,7 @@ var RegisterForm = ({
927
925
  width: "full",
928
926
  label: texts == null ? void 0 : texts.refCode,
929
927
  placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
930
- helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
928
+ helperText: (_a2 = methods.formState.errors.refCode) == null ? void 0 : _a2.message,
931
929
  ...field
932
930
  }
933
931
  );
@@ -937,7 +935,7 @@ var RegisterForm = ({
937
935
  props.showUserSource && /* @__PURE__ */ React3.createElement(
938
936
  Controller2,
939
937
  {
940
- control,
938
+ control: methods.control,
941
939
  name: "reference",
942
940
  render: ({ field }) => {
943
941
  var _a2, _b2;
@@ -961,7 +959,7 @@ var RegisterForm = ({
961
959
  showTermsOption || showNewsletterOption ? /* @__PURE__ */ React3.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-3 hawa-mb-2" }, showTermsOption && /* @__PURE__ */ React3.createElement(
962
960
  Controller2,
963
961
  {
964
- control,
962
+ control: methods.control,
965
963
  name: "terms_accepted",
966
964
  render: ({ field }) => {
967
965
  var _a2, _b2;
@@ -969,7 +967,7 @@ var RegisterForm = ({
969
967
  Checkbox,
970
968
  {
971
969
  id: "terms_accepted",
972
- helperText: (_b2 = (_a2 = formState.errors.terms_accepted) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
970
+ helperText: (_b2 = (_a2 = methods.formState.errors.terms_accepted) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
973
971
  onCheckedChange: (e) => field.onChange(e),
974
972
  label: /* @__PURE__ */ React3.createElement("div", { className: "hawa-flex hawa-flex-row hawa-gap-0.5 hawa-whitespace-nowrap hawa-flex-wrap" }, (texts == null ? void 0 : texts.iAcceptText) || "I accept the", " ", /* @__PURE__ */ React3.createElement(StopPropagationWrapper, null, /* @__PURE__ */ React3.createElement(
975
973
  "span",
@@ -991,7 +989,7 @@ var RegisterForm = ({
991
989
  ), showNewsletterOption && /* @__PURE__ */ React3.createElement(
992
990
  Controller2,
993
991
  {
994
- control,
992
+ control: methods.control,
995
993
  name: "newsletter_accepted",
996
994
  render: ({ field }) => /* @__PURE__ */ React3.createElement(
997
995
  Checkbox,