@incodetech/welcome 1.85.0-20251215165729.0 → 1.85.0-20251216181218.0

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.
@@ -12,6 +12,7 @@ interface FieldInputProps {
12
12
  errors: {
13
13
  [key: string]: FieldError;
14
14
  };
15
+ optional?: boolean;
15
16
  }
16
17
  export declare const FieldInput: React.FC<FieldInputProps>;
17
18
  export {};
@@ -7,6 +7,7 @@ interface UboInputsProps {
7
7
  errors: {
8
8
  [key: string]: FieldError;
9
9
  };
10
+ optional?: boolean;
10
11
  }
11
12
  export declare const UboInputs: React.FC<UboInputsProps>;
12
13
  export {};
@@ -8350,7 +8350,7 @@ class MlWasmJSApi {
8350
8350
  );
8351
8351
  }
8352
8352
  }
8353
- const MlWasmJSApi$1 = MlWasmJSApi.getInstance(), version$4 = "1.85.0-20251215165729.0";
8353
+ const MlWasmJSApi$1 = MlWasmJSApi.getInstance(), version$4 = "1.85.0-20251216181218.0";
8354
8354
  function e$2(Be, Le) {
8355
8355
  return function(Ye, tt) {
8356
8356
  return Object.prototype.hasOwnProperty.call(Ye, tt);
@@ -354611,20 +354611,21 @@ const CountryWrapper = dt.div`
354611
354611
  register: nt,
354612
354612
  setValue: ft,
354613
354613
  trigger: ht,
354614
- errors: gt
354614
+ errors: gt,
354615
+ optional: At = !1
354615
354616
  }) => {
354616
- var xt, Et, yt;
354617
- const { t: At } = useTranslation$1();
354618
- return Be === "state" && console.info("State errors:", gt[Be]), Be === "state" ? tt ? /* @__PURE__ */ jsxRuntimeExports.jsx(CountryWrapper, { error: !!((xt = gt == null ? void 0 : gt.state) != null && xt.message), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
354617
+ var yt, Ct, kt;
354618
+ const { t: xt } = useTranslation$1(), Et = At || OPTIONAL_FIELDS[Be];
354619
+ return Be === "state" ? tt ? /* @__PURE__ */ jsxRuntimeExports.jsx(CountryWrapper, { error: !!((yt = gt == null ? void 0 : gt.state) != null && yt.message), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
354619
354620
  StateSelector,
354620
354621
  {
354621
354622
  id: "state",
354622
- label: (Et = gt == null ? void 0 : gt.state) != null && Et.message ? (yt = gt == null ? void 0 : gt.state) == null ? void 0 : yt.message : At("verification.labels.chooseState"),
354623
- placeholder: At("common.state.placeholder"),
354624
- searchPlaceholder: At("common.state.searchPlaceholder"),
354623
+ label: (Ct = gt == null ? void 0 : gt.state) != null && Ct.message ? (kt = gt == null ? void 0 : gt.state) == null ? void 0 : kt.message : xt("verification.labels.chooseState"),
354624
+ placeholder: xt("common.state.placeholder"),
354625
+ searchPlaceholder: xt("common.state.searchPlaceholder"),
354625
354626
  name: "state",
354626
- onChange: (Ct) => {
354627
- ft("state", Ct), ht("state");
354627
+ onChange: (vt) => {
354628
+ ft("state", vt), ht("state");
354628
354629
  },
354629
354630
  value: Ye
354630
354631
  },
@@ -354634,13 +354635,13 @@ const CountryWrapper = dt.div`
354634
354635
  {
354635
354636
  id: Be,
354636
354637
  register: nt,
354637
- onBlur: (Ct) => {
354638
- ft(Be, Ct.target.value.trim());
354638
+ onBlur: (vt) => {
354639
+ ft(Be, vt.target.value.trim());
354639
354640
  },
354640
354641
  registerOpts: {
354641
- required: OPTIONAL_FIELDS[Be] ? "" : At("ekyb.error.requiredField")
354642
+ required: Et ? "" : xt("ekyb.error.requiredField")
354642
354643
  },
354643
- label: At(`ekyb.${Be}`),
354644
+ label: xt(`ekyb.${Be}`),
354644
354645
  error: formatFieldError(gt[Be])
354645
354646
  },
354646
354647
  Be
@@ -354649,18 +354650,18 @@ const CountryWrapper = dt.div`
354649
354650
  {
354650
354651
  id: Be,
354651
354652
  register: nt,
354652
- onBlur: (Ct) => {
354653
- ft(Be, Ct.target.value.trim());
354653
+ onBlur: (vt) => {
354654
+ ft(Be, vt.target.value.trim());
354654
354655
  },
354655
354656
  registerOpts: {
354656
- required: OPTIONAL_FIELDS[Be] ? "" : At("ekyb.error.requiredField"),
354657
+ required: Et ? "" : xt("ekyb.error.requiredField"),
354657
354658
  pattern: Be === "taxId" && !COUNTRIES_WITH_CNPJ_VALIDATION.includes(Le) && !COUNTRIES_WITH_SPECIAL_TAX_ID_RULES.includes(Le) ? {
354658
354659
  value: /^[a-zA-Z0-9]+$/,
354659
- message: At("ekyb.error.taxId")
354660
+ message: xt("ekyb.error.taxId")
354660
354661
  } : void 0,
354661
- validate: Be === "taxId" && COUNTRIES_WITH_CNPJ_VALIDATION.includes(Le) ? (Ct) => validateCnpjNumber(Ct) || "ekyb.error.invalidTaxId" : void 0
354662
+ validate: Be === "taxId" && COUNTRIES_WITH_CNPJ_VALIDATION.includes(Le) ? (vt) => validateCnpjNumber(vt) || "ekyb.error.invalidTaxId" : void 0
354662
354663
  },
354663
- label: At(`ekyb.${Be}`),
354664
+ label: xt(`ekyb.${Be}`),
354664
354665
  error: formatFieldError(gt[Be])
354665
354666
  },
354666
354667
  Be
@@ -354668,35 +354669,36 @@ const CountryWrapper = dt.div`
354668
354669
  }, UboInputs = ({
354669
354670
  uboCount: Be,
354670
354671
  register: Le,
354671
- errors: Ye
354672
+ errors: Ye,
354673
+ optional: tt = !1
354672
354674
  }) => {
354673
- const { t: tt } = useTranslation$1();
354674
- return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: Array.from({ length: Be }).map((nt, ft) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
354675
+ const { t: nt } = useTranslation$1();
354676
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: Array.from({ length: Be }).map((ft, ht) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
354675
354677
  /* @__PURE__ */ jsxRuntimeExports.jsx(
354676
354678
  Input$4,
354677
354679
  {
354678
- id: `uboName-${ft + 1}`,
354680
+ id: `uboName-${ht + 1}`,
354679
354681
  register: Le,
354680
- label: ft === 0 ? tt("ekyb.uboName") : tt("ekyb.uboNameWithNumber", { number: ft + 1 }),
354681
- error: formatFieldError(Ye[`uboName-${ft + 1}`]),
354682
+ label: ht === 0 ? nt("ekyb.uboName") : nt("ekyb.uboNameWithNumber", { number: ht + 1 }),
354683
+ error: formatFieldError(Ye[`uboName-${ht + 1}`]),
354682
354684
  registerOpts: {
354683
- required: ft === 0 ? tt("ekyb.error.requiredField") : ""
354685
+ required: ht === 0 && !tt ? nt("ekyb.error.requiredField") : ""
354684
354686
  }
354685
354687
  }
354686
354688
  ),
354687
354689
  /* @__PURE__ */ jsxRuntimeExports.jsx(
354688
354690
  Input$4,
354689
354691
  {
354690
- id: `uboSurname-${ft + 1}`,
354692
+ id: `uboSurname-${ht + 1}`,
354691
354693
  register: Le,
354692
- label: ft === 0 ? tt("ekyb.uboSurname") : tt("ekyb.uboSurnameWithNumber", { number: ft + 1 }),
354693
- error: formatFieldError(Ye[`uboSurname-${ft + 1}`]),
354694
+ label: ht === 0 ? nt("ekyb.uboSurname") : nt("ekyb.uboSurnameWithNumber", { number: ht + 1 }),
354695
+ error: formatFieldError(Ye[`uboSurname-${ht + 1}`]),
354694
354696
  registerOpts: {
354695
- required: ft === 0 ? tt("ekyb.error.requiredField") : ""
354697
+ required: ht === 0 && !tt ? nt("ekyb.error.requiredField") : ""
354696
354698
  }
354697
354699
  }
354698
354700
  )
354699
- ] }, `ubo-${ft + 1}`)) });
354701
+ ] }, `ubo-${ht + 1}`)) });
354700
354702
  }, useUboManagement = () => {
354701
354703
  const [Be, Le] = useState(1);
354702
354704
  return {
@@ -354818,7 +354820,7 @@ const sharedStyle$1 = lt`
354818
354820
  flow: Ye,
354819
354821
  token: tt
354820
354822
  }) => {
354821
- var Lt;
354823
+ var $t;
354822
354824
  const [nt, ft] = useState(
354823
354825
  VERIFICATION_STATES.IDLE
354824
354826
  ), { uboCount: ht, handleAddUbo: gt, extractUboNames: At } = useUboManagement(), {
@@ -354854,27 +354856,25 @@ const sharedStyle$1 = lt`
354854
354856
  screen: "EKYB",
354855
354857
  token: tt
354856
354858
  });
354857
- const Dt = Le ? Le.filter((Wt) => Wt === "ubos-user_input" ? (wt = !0, !1) : !0) : (Lt = Ye == null ? void 0 : Ye.modules) == null ? void 0 : Lt.filter(
354858
- (Wt) => Wt.includes("user_input") && !Wt.includes("socure") && Wt !== "ubos-user_input"
354859
- );
354860
- console.log("modules", Dt);
354861
- const Pt = sortModulesByOrder(Dt || [], FIELD_ORDER), Nt = async (Wt) => {
354862
- console.log("data here pls jaja", Wt), ft(VERIFICATION_STATES.VERIFYING);
354863
- const $t = At(Wt), Kt = {
354864
- ...Wt,
354859
+ const Dt = Le ? Le.filter((Kt) => Kt === "ubos-user_input" ? (wt = !0, !1) : !0) : ($t = Ye == null ? void 0 : Ye.modules) == null ? void 0 : $t.filter(
354860
+ (Kt) => Kt.includes("user_input") && !Kt.includes("socure") && Kt !== "ubos-user_input"
354861
+ ), Pt = sortModulesByOrder(Dt || [], FIELD_ORDER), Nt = async (Kt) => {
354862
+ ft(VERIFICATION_STATES.VERIFYING);
354863
+ const Vt = At(Kt), Ut = {
354864
+ ...Kt,
354865
354865
  plugins: ["ekyb"],
354866
- uboNames: $t
354866
+ uboNames: Vt
354867
354867
  };
354868
354868
  try {
354869
354869
  await sendEkyb({
354870
354870
  token: tt,
354871
- body: Kt
354871
+ body: Ut
354872
354872
  }), ft(VERIFICATION_STATES.SUCCESS);
354873
354873
  } catch {
354874
354874
  ft(VERIFICATION_STATES.FAILED);
354875
354875
  }
354876
354876
  Be();
354877
- };
354877
+ }, Lt = Tt === "GB", Wt = Tt === "GB";
354878
354878
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(VerificationContainer, { children: [
354879
354879
  /* @__PURE__ */ jsxRuntimeExports.jsx(InformationVerificationTitle, { children: It("ekyb.title") }),
354880
354880
  /* @__PURE__ */ jsxRuntimeExports.jsxs(
@@ -354891,24 +354891,33 @@ const sharedStyle$1 = lt`
354891
354891
  errors: yt
354892
354892
  }
354893
354893
  ),
354894
- Pt.map((Wt) => {
354895
- const $t = getFieldName(Wt);
354894
+ Pt.map((Kt) => {
354895
+ const Vt = getFieldName(Kt);
354896
354896
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
354897
354897
  FieldInput,
354898
354898
  {
354899
- name: $t,
354899
+ name: Vt,
354900
354900
  country: Tt,
354901
354901
  state: Rt,
354902
354902
  isUnitedStates: Bt,
354903
354903
  register: xt,
354904
354904
  setValue: Ct,
354905
354905
  trigger: vt,
354906
- errors: yt
354906
+ errors: yt,
354907
+ optional: Wt
354907
354908
  },
354908
- $t
354909
+ Vt
354909
354910
  );
354910
354911
  }),
354911
- wt && /* @__PURE__ */ jsxRuntimeExports.jsx(UboInputs, { uboCount: ht, register: xt, errors: yt }),
354912
+ wt && /* @__PURE__ */ jsxRuntimeExports.jsx(
354913
+ UboInputs,
354914
+ {
354915
+ uboCount: ht,
354916
+ register: xt,
354917
+ errors: yt,
354918
+ optional: Lt
354919
+ }
354920
+ ),
354912
354921
  /* @__PURE__ */ jsxRuntimeExports.jsxs(ButtonsContainer$1, { children: [
354913
354922
  wt && ht < UBO_INPUT_LIMIT ? /* @__PURE__ */ jsxRuntimeExports.jsx(UBOButton, { type: "button", onClick: gt, children: It("ekyb.addAnotherUbo") }) : null,
354914
354923
  /* @__PURE__ */ jsxRuntimeExports.jsx(