@adyen/kyc-components 3.48.0 → 3.48.2

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.
@@ -1,7 +1,7 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
- import { b as createContext, d as createSignal, o as onMount, e as createEffect, c as createMemo, a as createComponent, P as Portal, S as Show, t as template, i as insert, f as createRenderEffect, h as className, j as clearDelegatedEvents, k as delegateEvents, u as useContext, l as onCleanup, s as sortFns, m as mutationSortFns, n as on, p as setAttribute, q as getSidedProp, r as use, v as createUniqueId, w as batch, x as getQueryStatusLabel, y as getMutationStatusColor, z as getQueryStatusColor, A as getQueryStatusColorByLabel, B as displayValue, F as For, C as convertRemToPixels, D as untrack, $ as $TRACK, E as useTransition, G as spread, H as mergeProps, I as createRoot, J as serialize, K as Index, L as updateNestedDataByPath, M as addEventListener, N as stringify, O as Match, Q as Switch, R as deleteNestedDataByPath, T as splitProps, U as Dynamic, V as createComputed } from "./index-B2HoAVMQ.js";
4
+ import { b as createContext, d as createSignal, o as onMount, e as createEffect, c as createMemo, a as createComponent, P as Portal, S as Show, t as template, i as insert, f as createRenderEffect, h as className, j as clearDelegatedEvents, k as delegateEvents, u as useContext, l as onCleanup, s as sortFns, m as mutationSortFns, n as on, p as setAttribute, q as getSidedProp, r as use, v as createUniqueId, w as batch, x as getQueryStatusLabel, y as getMutationStatusColor, z as getQueryStatusColor, A as getQueryStatusColorByLabel, B as displayValue, F as For, C as convertRemToPixels, D as untrack, $ as $TRACK, E as useTransition, G as spread, H as mergeProps, I as createRoot, J as serialize, K as Index, L as updateNestedDataByPath, M as addEventListener, N as stringify, O as Match, Q as Switch, R as deleteNestedDataByPath, T as splitProps, U as Dynamic, V as createComputed } from "./index-D9q8Kptr.js";
5
5
  var isNonNullable = (i2) => i2 != null;
6
6
  var filterNonNullable = (arr) => arr.filter(isNonNullable);
7
7
  function chain(callbacks) {
@@ -1,5 +1,5 @@
1
- import { c as createLocalStorage, T as THEME_PREFERENCE, P as PiPProvider, a as ThemeContext, D as Devtools, Q as QueryDevtoolsContext } from "./B4MFY5CR-DG8bMOxS.js";
2
- import { g as getPreferredColorScheme, c as createMemo, a as createComponent } from "./index-B2HoAVMQ.js";
1
+ import { c as createLocalStorage, T as THEME_PREFERENCE, P as PiPProvider, a as ThemeContext, D as Devtools, Q as QueryDevtoolsContext } from "./B4MFY5CR-CXDP9hDt.js";
2
+ import { g as getPreferredColorScheme, c as createMemo, a as createComponent } from "./index-D9q8Kptr.js";
3
3
  var DevtoolsComponent = (props) => {
4
4
  const [localStore, setLocalStore] = createLocalStorage({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,5 +1,5 @@
1
- import { c as createLocalStorage, T as THEME_PREFERENCE, P as PiPProvider, a as ThemeContext, b as ParentPanel, C as ContentView, Q as QueryDevtoolsContext } from "./B4MFY5CR-DG8bMOxS.js";
2
- import { g as getPreferredColorScheme, c as createMemo, a as createComponent } from "./index-B2HoAVMQ.js";
1
+ import { c as createLocalStorage, T as THEME_PREFERENCE, P as PiPProvider, a as ThemeContext, b as ParentPanel, C as ContentView, Q as QueryDevtoolsContext } from "./B4MFY5CR-CXDP9hDt.js";
2
+ import { g as getPreferredColorScheme, c as createMemo, a as createComponent } from "./index-D9q8Kptr.js";
3
3
  var DevtoolsPanelComponent = (props) => {
4
4
  const [localStore, setLocalStore] = createLocalStorage({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,4 +1,4 @@
1
- import { W } from "./index-B2HoAVMQ.js";
1
+ import { W } from "./index-D9q8Kptr.js";
2
2
  export {
3
3
  W as default
4
4
  };
@@ -949,8 +949,8 @@ const defaultLocaleTranslations = {
949
949
  lastNameOfSettlor: "Last name of settlor",
950
950
  learnMore: "Learn more",
951
951
  leave: "Leave",
952
- legalCompanyName: "Legal name of the company",
953
- legalCompanyName__helperText: "Enter the name exactly as it is on your company's official registration documents.",
952
+ legalCompanyName: "Business legal name",
953
+ legalCompanyName__helperText: "The legal name is used to identify a business with the government; enter it exactly as it appears on your government or legal forms.",
954
954
  legalCompanyName__helperText__AU: "Enter the name exactly as it is on your Australian Securities and Investment Commission's (ASIC).",
955
955
  legalCompanyName__helperText__HK: "Enter the name exactly as it is on your Hong Kong Companies Registry's Certificate of Incorporation.",
956
956
  legalCompanyName__helperText__NL: "Enter the name exactly as it is on your Chamber of Commerce registration.",
@@ -9069,12 +9069,6 @@ function DBANameField({
9069
9069
  requiredFields
9070
9070
  }) {
9071
9071
  const { i18n } = useI18nContext();
9072
- const handleDbaChange = (selectedValue) => {
9073
- if (selectedValue === "no") {
9074
- handleChangeFor("doingBusinessAs")("");
9075
- }
9076
- handleChangeFor("doingBusinessAsAbsent")(selectedValue);
9077
- };
9078
9072
  return /* @__PURE__ */ jsxs(Fragment, { children: [
9079
9073
  (requiredFields == null ? void 0 : requiredFields.includes("doingBusinessAsAbsent")) && /* @__PURE__ */ jsx(
9080
9074
  Field,
@@ -9094,7 +9088,7 @@ function DBANameField({
9094
9088
  { id: "no", name: "no" }
9095
9089
  ],
9096
9090
  value: data.doingBusinessAsAbsent,
9097
- onChange: handleDbaChange,
9091
+ onChange: handleChangeFor("doingBusinessAsAbsent"),
9098
9092
  horizontal: true
9099
9093
  }
9100
9094
  )
@@ -11104,7 +11098,7 @@ function CompanyRegistrationDetails(props) {
11104
11098
  if (currentData.sameNameAsLegalName) {
11105
11099
  fieldsToRemove.push("tradingName");
11106
11100
  }
11107
- if (currentData.doingBusinessAsAbsent === "no") {
11101
+ if (currentData.doingBusinessAsAbsent !== "yes") {
11108
11102
  fieldsToRemove.push("doingBusinessAs");
11109
11103
  }
11110
11104
  if (currentData.exemptedFromVat) {
@@ -11397,7 +11391,6 @@ const businessDetailsBase = {
11397
11391
  stockISIN: { rule: "ifPubliclyTradedCompany" },
11398
11392
  stockTickerSymbol: { rule: "ifPubliclyTradedCompany" },
11399
11393
  dateOfIncorporation: { rule: "countryRequiresDateOfIncorporationForCompanies" },
11400
- businessName: { rule: "countryUsingCompanySearch" },
11401
11394
  stateOrProvince: { rule: "countryUsingCompanySearch" },
11402
11395
  registrationNumber: { rule: "countryRequiresRegistrationNumberForCompanies" },
11403
11396
  exemptedFromRegistrationNumber: { rule: "companyRegistrationNumberExemptionAllowed" },
@@ -15789,13 +15782,12 @@ const payoutBaseMapping = {
15789
15782
  };
15790
15783
  const businessDetailsBaseMapping = {
15791
15784
  "basicInformation.country": "organization.registeredAddress.country",
15792
- "basicInformation.businessName": "organization.legalName",
15785
+ "basicInformation.legalCompanyName": "organization.legalName",
15793
15786
  "basicInformation.stateOrProvince": "organization.registeredAddress.stateOrProvince",
15794
15787
  "basicInformation.registrationNumber": "organization.registrationNumber",
15795
15788
  "basicInformation.taxInformation": "organization.taxInformation",
15796
15789
  "basicInformation.countryOfGoverningLaw": "organization.countryOfGoverningLaw",
15797
15790
  "companyStructure.entityType": "organization.type",
15798
- "additionalInformation.legalCompanyName": "organization.legalName",
15799
15791
  "additionalInformation.legalFormDescription": "organization.legalFormDescription",
15800
15792
  "additionalInformation.doingBusinessAs": "organization.doingBusinessAs",
15801
15793
  "additionalInformation.doingBusinessAsAbsent": "organization.doingBusinessAsAbsent",
@@ -28770,7 +28762,7 @@ function TrustRegistrationDetails(props) {
28770
28762
  const getFormSchema2 = useCallback(
28771
28763
  (currentData) => {
28772
28764
  const fieldsToRemove = [];
28773
- if (currentData.doingBusinessAsAbsent === "no") {
28765
+ if (currentData.doingBusinessAsAbsent !== "yes") {
28774
28766
  fieldsToRemove.push("doingBusinessAs");
28775
28767
  }
28776
28768
  return requiredFields.filter((field) => !fieldsToRemove.includes(field));
@@ -30474,9 +30466,6 @@ const applyVerifiedBusinessData = (verifiedBusiness, handleChangeFor) => {
30474
30466
  if (!verifiedBusiness) return;
30475
30467
  entriesOf(verifiedBusiness).forEach(([key, value]) => {
30476
30468
  switch (key) {
30477
- case "name":
30478
- if (value) handleChangeFor("legalCompanyName", "input")(value);
30479
- break;
30480
30469
  case "isPrincipalAddress":
30481
30470
  if (value)
30482
30471
  handleChangeFor(
@@ -30566,7 +30555,6 @@ function VerifiedBusinessCard({
30566
30555
  }
30567
30556
  const ADDITIONAL_INFORMATION_FORM_ID = "additionalInformation";
30568
30557
  const ADDITIONAL_INFORMATION_FIELDS = [
30569
- ...LEGAL_COMPANY_NAME_FIELD,
30570
30558
  ...DBA_NAME_FIELD,
30571
30559
  ...BUSINESS_REGISTRATION_NUMBER_FIELD,
30572
30560
  ...TAX_INFORMATION_FIELD,
@@ -30680,12 +30668,12 @@ function AdditionalInformation({
30680
30668
  } else {
30681
30669
  fieldsToRemove.push("exemptedFromRegistrationNumber");
30682
30670
  }
30683
- if (currentData.doingBusinessAsAbsent === "no") {
30671
+ if (currentData.doingBusinessAsAbsent !== "yes") {
30684
30672
  fieldsToRemove.push("doingBusinessAs");
30685
30673
  }
30686
30674
  return ((_a3 = initialFormUtilsProps.requiredFields) == null ? void 0 : _a3.filter(
30687
30675
  (field) => !fieldsToRemove.includes(field)
30688
- )) ?? [...LEGAL_COMPANY_NAME_FIELD, ...DBA_NAME_FIELD];
30676
+ )) ?? [...DBA_NAME_FIELD];
30689
30677
  },
30690
30678
  [initialFormUtilsProps.requiredFields]
30691
30679
  );
@@ -30694,16 +30682,6 @@ function AdditionalInformation({
30694
30682
  var _a3;
30695
30683
  return (_a3 = initialFormUtilsProps.allFields) == null ? void 0 : _a3.reduce((acc, field) => {
30696
30684
  switch (field) {
30697
- case "legalCompanyName":
30698
- return mergeFieldMetadataIntoProps(
30699
- field,
30700
- resolveFieldMetadata(
30701
- isExperimentEnabled("StrictNameAndAddressValidationV4") ? defaultFieldConfigV4[country] : defaultFieldConfig$a[country],
30702
- { isBusiness: true },
30703
- isExperimentEnabled("StrictNameAndAddressValidationV4") ? defaultFieldMetadataV4 : defaultFieldMetadata$b
30704
- ),
30705
- acc
30706
- );
30707
30685
  case "doingBusinessAsAbsent":
30708
30686
  return mergeFieldMetadataIntoProps(
30709
30687
  "doingBusinessAsAbsent",
@@ -30795,7 +30773,6 @@ function AdditionalInformation({
30795
30773
  if (!verifiedBusiness) return data;
30796
30774
  return {
30797
30775
  ...data,
30798
- legalCompanyName: verifiedBusiness.name,
30799
30776
  registrationAddress: {
30800
30777
  address: verifiedBusiness.street,
30801
30778
  city: verifiedBusiness.city,
@@ -30850,22 +30827,19 @@ function AdditionalInformation({
30850
30827
  };
30851
30828
  }, [verifiedBusiness, basicInformation == null ? void 0 : basicInformation.stateOrProvince, country]);
30852
30829
  useEffect(
30853
- () => applyVerifiedBusinessData(verifiedBusiness, handleChangeFor),
30830
+ () => {
30831
+ applyVerifiedBusinessData(verifiedBusiness, handleChangeFor);
30832
+ if (basicInformation && (verifiedBusiness == null ? void 0 : verifiedBusiness.name)) {
30833
+ basicInformation.legalCompanyName = verifiedBusiness.name;
30834
+ }
30835
+ },
30854
30836
  // eslint-disable-next-line react-hooks/exhaustive-deps
30855
30837
  [verifiedBusiness]
30856
30838
  );
30857
30839
  useEffect(() => {
30858
30840
  if (!verifiedBusiness && !showCompanyStructure) resetToDefaultData();
30859
30841
  }, [verifiedBusiness]);
30860
- const showField = (fieldKeys) => fieldKeys.some((field) => {
30861
- switch (field) {
30862
- case "legalCompanyName": {
30863
- return (formUtils.isRequiredField(field) || formUtils.isOptionalField(field)) && !(verifiedBusiness == null ? void 0 : verifiedBusiness.name);
30864
- }
30865
- default:
30866
- return formUtils.isRequiredField(field) || formUtils.isOptionalField(field);
30867
- }
30868
- });
30842
+ const showField = (fieldKeys) => fieldKeys.some((field) => formUtils.isRequiredField(field) || formUtils.isOptionalField(field));
30869
30843
  const handleRegistrationAddressChange = (state) => {
30870
30844
  handleChangeFor("registrationAddress")(state.data);
30871
30845
  setValid("registrationAddress", Boolean(state.isValid));
@@ -30930,24 +30904,6 @@ function AdditionalInformation({
30930
30904
  /* @__PURE__ */ jsxs("section", { children: [
30931
30905
  showVerified && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-additional-information__section-heading", children: /* @__PURE__ */ jsx(Typography, { el: "h3", variant: "title", children: i18n.get("otherBusinessInformation") }) }),
30932
30906
  /* @__PURE__ */ jsxs("fieldset", { children: [
30933
- showField(LEGAL_COMPANY_NAME_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
30934
- LegalCompanyNameField,
30935
- {
30936
- data: formUtils.getFieldData(formData, LEGAL_COMPANY_NAME_FIELD),
30937
- valid: formUtils.getFieldValid(formValid, LEGAL_COMPANY_NAME_FIELD),
30938
- errors: formUtils.getFieldErrors(
30939
- formErrors,
30940
- formFieldProblems,
30941
- LEGAL_COMPANY_NAME_FIELD
30942
- ),
30943
- labels: formUtils.getFieldLabels(LEGAL_COMPANY_NAME_FIELD),
30944
- helperText: formUtils.getFieldHelperText(LEGAL_COMPANY_NAME_FIELD, {
30945
- legalCompanyName: "legalCompanyName__helperText"
30946
- }),
30947
- readonly: formUtils.isReadOnly("legalCompanyName"),
30948
- handleChangeFor
30949
- }
30950
- ) }),
30951
30907
  /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
30952
30908
  DBANameField,
30953
30909
  {
@@ -30960,8 +30916,7 @@ function AdditionalInformation({
30960
30916
  readonly: formUtils.isReadOnly("doingBusinessAs"),
30961
30917
  requiredFields: requiredFieldsForDBANameField,
30962
30918
  handleChangeFor,
30963
- setErrors,
30964
- legalCompanyName: formData.legalCompanyName
30919
+ setErrors
30965
30920
  }
30966
30921
  ) }),
30967
30922
  showField(BUSINESS_REGISTRATION_NUMBER_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
@@ -31498,45 +31453,6 @@ function BusinessSelection({
31498
31453
  }
31499
31454
  return null;
31500
31455
  }
31501
- const BUSINESS_NAME_FIELD = ["businessName"];
31502
- function BusinessNameField({
31503
- data,
31504
- valid,
31505
- errors,
31506
- labels: labels2,
31507
- readonly,
31508
- handleChangeFor
31509
- }) {
31510
- return /* @__PURE__ */ jsx(
31511
- Field,
31512
- {
31513
- name: "businessName",
31514
- label: labels2.businessName,
31515
- errorMessage: errors.businessName,
31516
- isValid: valid.businessName,
31517
- classNameModifiers: ["businessName"],
31518
- children: (childProps) => /* @__PURE__ */ jsx(
31519
- InputText,
31520
- {
31521
- ...childProps,
31522
- "aria-required": true,
31523
- "aria-label": labels2.businessName,
31524
- "aria-invalid": !valid.businessName,
31525
- name: "businessName",
31526
- value: data.businessName,
31527
- readonly,
31528
- classNameModifiers: ["businessName"],
31529
- onInput: handleChangeFor("businessName", "input"),
31530
- onBlur: handleChangeFor("businessName", "blur")
31531
- }
31532
- )
31533
- }
31534
- );
31535
- }
31536
- const businessNameFieldMetadata = {
31537
- label: "businessName",
31538
- validators: validateNotEmptyOnBlur
31539
- };
31540
31456
  const CountryFieldValidation = () => ({
31541
31457
  country: {
31542
31458
  modes: ["blur"],
@@ -31585,7 +31501,7 @@ const CountryOfGoverningLawFieldValidation = () => ({
31585
31501
  const BASIC_INFORMATION_FORM_ID = "basicInformation";
31586
31502
  const BASIC_INFORMATION_FIELDS = [
31587
31503
  ...COUNTRY_FIELD,
31588
- ...BUSINESS_NAME_FIELD,
31504
+ ...LEGAL_COMPANY_NAME_FIELD,
31589
31505
  ...TAX_INFORMATION_FIELD,
31590
31506
  ...STATE_FIELD,
31591
31507
  ...BUSINESS_REGISTRATION_NUMBER_FIELD,
@@ -31651,7 +31567,10 @@ function BasicInformation({
31651
31567
  if (currentData.country !== CountryCodes.UnitedKingdom) {
31652
31568
  fieldsToRemove.push("countryOfGoverningLaw");
31653
31569
  }
31654
- return (requiredFields == null ? void 0 : requiredFields.filter((field) => !fieldsToRemove.includes(field))) ?? ["country"];
31570
+ return (requiredFields == null ? void 0 : requiredFields.filter((field) => !fieldsToRemove.includes(field))) ?? [
31571
+ ...COUNTRY_FIELD,
31572
+ ...LEGAL_COMPANY_NAME_FIELD
31573
+ ];
31655
31574
  },
31656
31575
  [isCountryOfGoverningLawEnabled, requiredFields]
31657
31576
  );
@@ -31704,8 +31623,16 @@ function BasicInformation({
31704
31623
  ...acc,
31705
31624
  validators: { ...acc.validators, ...CountryFieldValidation() }
31706
31625
  };
31707
- case "businessName":
31708
- return mergeFieldMetadataIntoProps("businessName", businessNameFieldMetadata, acc);
31626
+ case "legalCompanyName":
31627
+ return mergeFieldMetadataIntoProps(
31628
+ field,
31629
+ resolveFieldMetadata(
31630
+ isExperimentEnabled("StrictNameAndAddressValidationV4") ? defaultFieldConfigV4[country] : defaultFieldConfig$a[country],
31631
+ { isBusiness: true },
31632
+ isExperimentEnabled("StrictNameAndAddressValidationV4") ? defaultFieldMetadataV4 : defaultFieldMetadata$b
31633
+ ),
31634
+ acc
31635
+ );
31709
31636
  case "countryOfGoverningLaw":
31710
31637
  return {
31711
31638
  ...acc,
@@ -31883,22 +31810,25 @@ function BasicInformation({
31883
31810
  handleChangeFor
31884
31811
  }
31885
31812
  ),
31813
+ showField(LEGAL_COMPANY_NAME_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
31814
+ LegalCompanyNameField,
31815
+ {
31816
+ data: formUtils.getFieldData(formData, LEGAL_COMPANY_NAME_FIELD),
31817
+ valid: formUtils.getFieldValid(formValid, LEGAL_COMPANY_NAME_FIELD),
31818
+ errors: formUtils.getFieldErrors(
31819
+ formErrors,
31820
+ formFieldProblems,
31821
+ LEGAL_COMPANY_NAME_FIELD
31822
+ ),
31823
+ labels: formUtils.getFieldLabels(LEGAL_COMPANY_NAME_FIELD),
31824
+ helperText: formUtils.getFieldHelperText(LEGAL_COMPANY_NAME_FIELD, {
31825
+ legalCompanyName: "legalCompanyName__helperText"
31826
+ }),
31827
+ readonly: formUtils.isReadOnly("legalCompanyName"),
31828
+ handleChangeFor
31829
+ }
31830
+ ) }),
31886
31831
  COUNTRIES_USING_COMPANY_SEARCH.includes(formData.country ?? country) && /* @__PURE__ */ jsxs("fieldset", { children: [
31887
- showField(BUSINESS_NAME_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
31888
- BusinessNameField,
31889
- {
31890
- data: formUtils.getFieldData(formData, BUSINESS_NAME_FIELD),
31891
- valid: formUtils.getFieldValid(formValid, BUSINESS_NAME_FIELD),
31892
- errors: formUtils.getFieldErrors(
31893
- formErrors,
31894
- formFieldProblems,
31895
- BUSINESS_NAME_FIELD
31896
- ),
31897
- labels: formUtils.getFieldLabels(BUSINESS_NAME_FIELD),
31898
- readonly: formUtils.isReadOnly("businessName"),
31899
- handleChangeFor
31900
- }
31901
- ) }),
31902
31832
  showField(TAX_INFORMATION_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
31903
31833
  TaxInformationField,
31904
31834
  {
@@ -32119,12 +32049,7 @@ function CompanyStructure({
32119
32049
  )
32120
32050
  ] });
32121
32051
  }
32122
- const FIELDS_NEEDED_FOR_COMPANY_SEARCH = [
32123
- ...BUSINESS_NAME_FIELD,
32124
- ...STATE_FIELD,
32125
- ...TAX_INFORMATION_FIELD,
32126
- ...BUSINESS_REGISTRATION_NUMBER_FIELD
32127
- ];
32052
+ const FIELDS_NEEDED_FOR_COMPANY_SEARCH = [...STATE_FIELD, ...TAX_INFORMATION_FIELD, ...BUSINESS_REGISTRATION_NUMBER_FIELD];
32128
32053
  const getBasicInformationFields = (country) => {
32129
32054
  let fields = [...BASIC_INFORMATION_FIELDS];
32130
32055
  if (!COUNTRIES_USING_COMPANY_SEARCH.includes(country)) {
@@ -33438,14 +33363,14 @@ const mapBusinessDetailsDocumentToApiDocument = async (data, entityId) => {
33438
33363
  return documents.filter(Boolean);
33439
33364
  };
33440
33365
  const mapBusinessDetailsSchemaToLegalEntity = (data, isExperimentEnabled) => {
33441
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m, _n, _o, _p, _q;
33366
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m, _n, _o, _p, _q, _r;
33442
33367
  const requestObj = {
33443
33368
  ...formatObject(data, businessDetailsApiKeyMapping)
33444
33369
  };
33445
33370
  (_a2 = requestObj.organization) == null ? true : delete _a2.legalFormDescription;
33446
33371
  const taxData = ((_b2 = data.basicInformation) == null ? void 0 : _b2.taxInformation) || ((_c2 = data.additionalInformation) == null ? void 0 : _c2.taxInformation);
33447
33372
  const registrationNumber = ((_d2 = data.basicInformation) == null ? void 0 : _d2.registrationNumber) || ((_e2 = data.additionalInformation) == null ? void 0 : _e2.registrationNumber);
33448
- const doingBusinessAs = (_f2 = data.additionalInformation) == null ? void 0 : _f2.doingBusinessAs;
33373
+ const doingBusinessAs = ((_f2 = data.additionalInformation) == null ? void 0 : _f2.doingBusinessAs) ?? "";
33449
33374
  if (requestObj.organization) {
33450
33375
  if (taxData) {
33451
33376
  requestObj.organization.taxInformation = COUNTRIES_USING_COMPANY_SEARCH.includes(
@@ -33460,9 +33385,6 @@ const mapBusinessDetailsSchemaToLegalEntity = (data, isExperimentEnabled) => {
33460
33385
  if ((_m = data.additionalInformation) == null ? void 0 : _m.vatAbsenceReason) {
33461
33386
  requestObj.organization.vatNumber = "";
33462
33387
  }
33463
- if (doingBusinessAs) {
33464
- requestObj.organization.doingBusinessAs = doingBusinessAs;
33465
- }
33466
33388
  if (isExperimentEnabled("EnableDoingBusinessAsNameV4")) {
33467
33389
  if (((_n = data.additionalInformation) == null ? void 0 : _n.doingBusinessAsAbsent) === "no") {
33468
33390
  requestObj.organization.doingBusinessAsAbsent = true;
@@ -33471,9 +33393,10 @@ const mapBusinessDetailsSchemaToLegalEntity = (data, isExperimentEnabled) => {
33471
33393
  requestObj.organization.doingBusinessAsAbsent = false;
33472
33394
  }
33473
33395
  } else {
33396
+ requestObj.organization.doingBusinessAs = doingBusinessAs || ((_p = data.basicInformation) == null ? void 0 : _p.legalCompanyName);
33474
33397
  delete requestObj.organization.doingBusinessAsAbsent;
33475
33398
  }
33476
- if (((_p = data.additionalInformation) == null ? void 0 : _p.operationalAddressIsSame) === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_SAME && requestObj.organization.principalPlaceOfBusiness) {
33399
+ if (((_q = data.additionalInformation) == null ? void 0 : _q.operationalAddressIsSame) === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_SAME && requestObj.organization.principalPlaceOfBusiness) {
33477
33400
  requestObj.organization.principalPlaceOfBusiness = requestObj.organization.registeredAddress;
33478
33401
  }
33479
33402
  if (!isEmpty(data.companyFinancialInformation)) {
@@ -33483,7 +33406,7 @@ const mapBusinessDetailsSchemaToLegalEntity = (data, isExperimentEnabled) => {
33483
33406
  }
33484
33407
  }
33485
33408
  requestObj.type = LegalEntityType.ORGANIZATION;
33486
- if (((_q = requestObj.organization) == null ? void 0 : _q.registeredAddress.country) === "US") {
33409
+ if (((_r = requestObj.organization) == null ? void 0 : _r.registeredAddress.country) === "US") {
33487
33410
  delete requestObj.organization.registrationNumber;
33488
33411
  }
33489
33412
  return requestObj;
@@ -33522,7 +33445,7 @@ const formatFinancialInformationSummary = (data, i18n) => {
33522
33445
  }
33523
33446
  return summary2;
33524
33447
  };
33525
- const MANDATORY_API_FIELDS = ["additionalInformation.legalCompanyName", "basicInformation.country"];
33448
+ const MANDATORY_API_FIELDS = ["basicInformation.legalCompanyName", "basicInformation.country"];
33526
33449
  const parseConfiguration$6 = ({ country, matchingScenario }) => parseBusinessDetailsScenarios(matchingScenario == null ? void 0 : matchingScenario[LegalEntityType.ORGANIZATION], country);
33527
33450
  const canSubmit$3 = (data) => MANDATORY_API_FIELDS.every((detail) => {
33528
33451
  const value = getProp(data, detail);
@@ -33531,7 +33454,7 @@ const canSubmit$3 = (data) => MANDATORY_API_FIELDS.every((detail) => {
33531
33454
  const isDocumentsRequired$2 = (forms) => forms.some((form) => documentFormsIds.includes(form.formId));
33532
33455
  const removeConditionalForms = (forms, isSkippingCompanyStructure) => isSkippingCompanyStructure ? forms.filter((f) => f.formId !== "companyStructure" && f.formId !== "companyType") : forms;
33533
33456
  const formatBasicInformation = (data, labels2, datasetUtils, companyType, isCountryOfGoverningLawEnabled) => {
33534
- var _a2, _b2, _c2;
33457
+ var _a2, _b2, _c2, _d2;
33535
33458
  const country = data == null ? void 0 : data.country;
33536
33459
  const registrationNumberLabel = resolveFieldMetadata(
33537
33460
  defaultFieldConfig$9[country],
@@ -33552,18 +33475,19 @@ const formatBasicInformation = (data, labels2, datasetUtils, companyType, isCoun
33552
33475
  ).label;
33553
33476
  const countryOfGoverningLaw = getCountryOfGoverningLaw(isCountryOfGoverningLawEnabled, data);
33554
33477
  return {
33478
+ [((_b2 = labels2 == null ? void 0 : labels2.basicInformation) == null ? void 0 : _b2.legalCompanyName) ?? "legalCompanyName"]: data.legalCompanyName,
33555
33479
  country: datasetUtils.getCountryName(data.country),
33556
33480
  [getKeyForField("stateOrProvince", data.country)]: datasetUtils.getStateName(
33557
33481
  data.stateOrProvince,
33558
33482
  data.country
33559
33483
  ),
33560
- [taxIdLabel]: (_c2 = (_b2 = data.taxInformation) == null ? void 0 : _b2.find((taxId) => data.country === taxId.country)) == null ? void 0 : _c2.number,
33484
+ [taxIdLabel]: (_d2 = (_c2 = data.taxInformation) == null ? void 0 : _c2.find((taxId) => data.country === taxId.country)) == null ? void 0 : _d2.number,
33561
33485
  [registrationNumberLabel]: data.registrationNumber,
33562
33486
  countryOfGoverningLaw: datasetUtils.getCountryName(countryOfGoverningLaw)
33563
33487
  };
33564
33488
  };
33565
33489
  const formatAdditionalInformation = (data, labels2, country, companyType, i18n) => {
33566
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2;
33490
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2;
33567
33491
  const registrationNumberLabel = resolveFieldMetadata(
33568
33492
  defaultFieldConfig$9[country],
33569
33493
  {
@@ -33582,17 +33506,16 @@ const formatAdditionalInformation = (data, labels2, country, companyType, i18n)
33582
33506
  defaultFieldMetadata$7
33583
33507
  ).label;
33584
33508
  return {
33585
- [((_b2 = labels2 == null ? void 0 : labels2.additionalInformation) == null ? void 0 : _b2.legalCompanyName) ?? "legalCompanyName"]: data.legalCompanyName,
33586
- [((_c2 = labels2 == null ? void 0 : labels2.additionalInformation) == null ? void 0 : _c2.doingBusinessAs) ?? "doingBusinessAs"]: data.doingBusinessAs,
33509
+ [((_b2 = labels2 == null ? void 0 : labels2.additionalInformation) == null ? void 0 : _b2.doingBusinessAs) ?? "doingBusinessAs"]: data.doingBusinessAs,
33587
33510
  [registrationNumberLabel]: data.registrationNumber,
33588
- [taxIdLabel]: (_e2 = (_d2 = data.taxInformation) == null ? void 0 : _d2.find((taxId) => country === taxId.country)) == null ? void 0 : _e2.number,
33589
- [((_f2 = labels2 == null ? void 0 : labels2.additionalInformation) == null ? void 0 : _f2.vatNumber) ?? "vatNumber"]: data.vatNumber,
33590
- [((_g2 = labels2 == null ? void 0 : labels2.additionalInformation) == null ? void 0 : _g2.vatAbsenceReason) ?? "vatAbsenceReason"]: data.vatAbsenceReason ? i18n.get(data.vatAbsenceReason) : void 0,
33591
- [((_h2 = labels2 == null ? void 0 : labels2.additionalInformation) == null ? void 0 : _h2.dateOfIncorporation) ?? "dateOfIncorporation"]: data.dateOfIncorporation,
33592
- [((_i2 = labels2 == null ? void 0 : labels2.additionalInformation) == null ? void 0 : _i2.stockExchangeMIC) ?? "stockExchangeMIC"]: data.stockExchangeMIC,
33593
- [((_j2 = labels2 == null ? void 0 : labels2.additionalInformation) == null ? void 0 : _j2.stockISIN) ?? "stockISIN"]: data.stockISIN,
33594
- [((_k2 = labels2 == null ? void 0 : labels2.additionalInformation) == null ? void 0 : _k2.stockTickerSymbol) ?? "stockTickerSymbol"]: data.stockTickerSymbol,
33595
- [((_l2 = labels2 == null ? void 0 : labels2.additionalInformation) == null ? void 0 : _l2.eInvoicingCode) ?? "eInvoicingCode"]: data.eInvoicingCode
33511
+ [taxIdLabel]: (_d2 = (_c2 = data.taxInformation) == null ? void 0 : _c2.find((taxId) => country === taxId.country)) == null ? void 0 : _d2.number,
33512
+ [((_e2 = labels2 == null ? void 0 : labels2.additionalInformation) == null ? void 0 : _e2.vatNumber) ?? "vatNumber"]: data.vatNumber,
33513
+ [((_f2 = labels2 == null ? void 0 : labels2.additionalInformation) == null ? void 0 : _f2.vatAbsenceReason) ?? "vatAbsenceReason"]: data.vatAbsenceReason ? i18n.get(data.vatAbsenceReason) : void 0,
33514
+ [((_g2 = labels2 == null ? void 0 : labels2.additionalInformation) == null ? void 0 : _g2.dateOfIncorporation) ?? "dateOfIncorporation"]: data.dateOfIncorporation,
33515
+ [((_h2 = labels2 == null ? void 0 : labels2.additionalInformation) == null ? void 0 : _h2.stockExchangeMIC) ?? "stockExchangeMIC"]: data.stockExchangeMIC,
33516
+ [((_i2 = labels2 == null ? void 0 : labels2.additionalInformation) == null ? void 0 : _i2.stockISIN) ?? "stockISIN"]: data.stockISIN,
33517
+ [((_j2 = labels2 == null ? void 0 : labels2.additionalInformation) == null ? void 0 : _j2.stockTickerSymbol) ?? "stockTickerSymbol"]: data.stockTickerSymbol,
33518
+ [((_k2 = labels2 == null ? void 0 : labels2.additionalInformation) == null ? void 0 : _k2.eInvoicingCode) ?? "eInvoicingCode"]: data.eInvoicingCode
33596
33519
  };
33597
33520
  };
33598
33521
  const formatDataForSummary$1 = (data, forms, labels2, i18n, isExperimentEnabled) => {
@@ -33741,7 +33664,7 @@ async function submit({
33741
33664
  actionType: "submit",
33742
33665
  companyStructure: ((_a2 = data.companyStructure) == null ? void 0 : _a2.entityType) ?? null,
33743
33666
  countryOfRegistration: ((_b2 = data.basicInformation) == null ? void 0 : _b2.country) ?? null,
33744
- legalEntityName: ((_c2 = data.additionalInformation) == null ? void 0 : _c2.legalCompanyName) ?? null,
33667
+ legalEntityName: ((_c2 = data.basicInformation) == null ? void 0 : _c2.legalCompanyName) ?? null,
33745
33668
  usedAdditionalAddress: ((_d2 = data.additionalInformation) == null ? void 0 : _d2.operationalAddressIsSame) === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME
33746
33669
  };
33747
33670
  const savedLegalEntityData = legalEntityResponse ? mapLegalEntityToBusinessDetailsSchema(legalEntityResponse, isExperimentEnabled) : null;
@@ -34099,14 +34022,14 @@ function BusinessDetailsDropin({
34099
34022
  const findBusiness = useCallback(
34100
34023
  async (currentData) => {
34101
34024
  var _a3, _b3;
34102
- if (!(currentData == null ? void 0 : currentData.businessName) || !(currentData == null ? void 0 : currentData.country) || !(currentData == null ? void 0 : currentData.stateOrProvince)) {
34025
+ if (!(currentData == null ? void 0 : currentData.legalCompanyName) || !(currentData == null ? void 0 : currentData.country) || !(currentData == null ? void 0 : currentData.stateOrProvince)) {
34103
34026
  return;
34104
34027
  }
34105
34028
  const tin = (_b3 = (_a3 = currentData == null ? void 0 : currentData.taxInformation) == null ? void 0 : _a3.find(
34106
34029
  (taxId) => currentCountry === taxId.country
34107
34030
  )) == null ? void 0 : _b3.number;
34108
34031
  const results = await searchForBusiness({
34109
- name: currentData.businessName,
34032
+ name: currentData.legalCompanyName,
34110
34033
  country: currentData.country,
34111
34034
  state: currentData.stateOrProvince,
34112
34035
  registrationNumber: currentData.registrationNumber
@@ -34256,12 +34179,12 @@ function BusinessDetailsDropin({
34256
34179
  }
34257
34180
  }, [searchResults, searching]);
34258
34181
  useEffect(() => {
34259
- var _a3;
34260
- if (((_a3 = currentState.data.basicInformation) == null ? void 0 : _a3.businessName) !== currentSearchName) {
34182
+ var _a3, _b3;
34183
+ if (((_a3 = currentState.data.basicInformation) == null ? void 0 : _a3.legalCompanyName) !== currentSearchName && ((_b3 = currentState.data.basicInformation) == null ? void 0 : _b3.legalCompanyName) !== (verifiedBusiness == null ? void 0 : verifiedBusiness.name)) {
34261
34184
  setShowCompanyStructure(false);
34262
34185
  resetBusinessData();
34263
34186
  }
34264
- }, [currentSearchName, (_f2 = currentState.data.basicInformation) == null ? void 0 : _f2.businessName]);
34187
+ }, [currentSearchName, (_f2 = currentState.data.basicInformation) == null ? void 0 : _f2.legalCompanyName, verifiedBusiness]);
34265
34188
  useEffect(() => {
34266
34189
  var _a3;
34267
34190
  if ((trustedFields == null ? void 0 : trustedFields.length) && ((_a3 = legalEntityResponse.organization) == null ? void 0 : _a3.registeredAddress.country) !== currentCountry) {
@@ -49738,7 +49661,7 @@ const ConfigurationApiProvider = ({
49738
49661
  }) => {
49739
49662
  const authContext = useAuthContext();
49740
49663
  const { isEmbeddedDropin, loadingContext } = authContext;
49741
- const sdkVersion = "3.48.0";
49664
+ const sdkVersion = "3.48.2";
49742
49665
  const rootLegalEntityId = useGlobalStore((store) => store.rootLegalEntity.id);
49743
49666
  useAnalytics({
49744
49667
  onUserEvent,
@@ -50623,7 +50546,7 @@ const DebugModal = ({ onExit }) => {
50623
50546
  const [tab, setTab] = useState("metadata");
50624
50547
  const rootLegalEntity = useGlobalStore((store) => store.rootLegalEntity);
50625
50548
  const metadata = {
50626
- sdkVersion: "3.48.0",
50549
+ sdkVersion: "3.48.2",
50627
50550
  locale: i18n.locale,
50628
50551
  rootLegalEntityId: rootLegalEntity.id
50629
50552
  };
@@ -53614,7 +53537,7 @@ var TanstackQueryDevtools = (_k = class {
53614
53537
  if (__privateGet(this, _Component)) {
53615
53538
  Devtools = __privateGet(this, _Component);
53616
53539
  } else {
53617
- Devtools = lazy(() => import("./HO4MOOFI-DqV4dJj3.js"));
53540
+ Devtools = lazy(() => import("./HO4MOOFI-qsfQDXhN.js"));
53618
53541
  __privateSet(this, _Component, Devtools);
53619
53542
  }
53620
53543
  setupStyleSheet(__privateGet(this, _styleNonce), __privateGet(this, _shadowDOMTarget));
@@ -53736,7 +53659,7 @@ var TanstackQueryDevtoolsPanel = (_l = class {
53736
53659
  if (__privateGet(this, _Component2)) {
53737
53660
  Devtools = __privateGet(this, _Component2);
53738
53661
  } else {
53739
- Devtools = lazy(() => import("./HUY7CZI3-Czph4m1h.js"));
53662
+ Devtools = lazy(() => import("./HUY7CZI3-BKVtu-p6.js"));
53740
53663
  __privateSet(this, _Component2, Devtools);
53741
53664
  }
53742
53665
  setupStyleSheet(__privateGet(this, _styleNonce2), __privateGet(this, _shadowDOMTarget2));
@@ -7,14 +7,13 @@ import type { BusinessRegistrationNumberFieldSchema } from '../BusinessRegistrat
7
7
  import type { DateOfIncorporationFieldSchema } from '../DateOfIncorporationField/types';
8
8
  import type { DBANameFieldSchema } from '../DBANameField/types';
9
9
  import type { EInvoicingCodeFieldSchema } from '../EInvoicingCodeField/types';
10
- import type { LegalCompanyNameFieldSchema } from '../LegalCompanyNameField/types';
11
10
  import type { StockExchangeMICFieldSchema } from '../StockExchangeMICField/types';
12
11
  import type { StockISINFieldSchema } from '../StockISINField/types';
13
12
  import type { StockTickerSymbolFieldSchema } from '../StockTickerSymbol/types';
14
13
  import type { TaxInformationFieldSchema } from '../TaxInformationField/types';
15
14
  import type { VatNumberFieldSchema } from '../VatNumberField/types';
16
15
  import type { RegistrationAddressSchema } from '../RegistrationAddress/types';
17
- export interface AdditionalInformationSchema extends LegalCompanyNameFieldSchema, DBANameFieldSchema, VatNumberFieldSchema, TaxInformationFieldSchema, BusinessRegistrationNumberFieldSchema, DateOfIncorporationFieldSchema, StockISINFieldSchema, StockExchangeMICFieldSchema, StockTickerSymbolFieldSchema, RegistrationAddressSchema, EInvoicingCodeFieldSchema {
16
+ export interface AdditionalInformationSchema extends DBANameFieldSchema, VatNumberFieldSchema, TaxInformationFieldSchema, BusinessRegistrationNumberFieldSchema, DateOfIncorporationFieldSchema, StockISINFieldSchema, StockExchangeMICFieldSchema, StockTickerSymbolFieldSchema, RegistrationAddressSchema, EInvoicingCodeFieldSchema {
18
17
  legalFormDescription?: string;
19
18
  }
20
19
  export interface AdditionalInformationProps extends BaseInnerFormProps<AdditionalInformationSchema> {
@@ -5,13 +5,13 @@ import type { CompanyDatasetResponse, CompanySearchResult } from '../../core/mod
5
5
  import type { CompanyTypesValue } from '../../core/models/api/company-types-value';
6
6
  import type { CountryCode } from '../../core/models/country-code';
7
7
  import type { BaseTrackingPayload } from '../../core/analytics';
8
- import type { BusinessNameFieldSchema } from '../BusinessNameField/types';
9
8
  import type { BusinessRegistrationNumberFieldSchema } from '../BusinessRegistrationNumberField/types';
10
9
  import type { CountryFieldSchema } from '../CountryField/types';
11
10
  import type { StateFieldSchema } from '../StateField/types';
12
11
  import type { TaxInformationFieldSchema } from '../TaxInformationField/types';
13
12
  import type { CountryOfGoverningLawFieldSchema } from '../CountryOfGoverningLawField/types';
14
- export type BasicInformationSchema = CountryFieldSchema & BusinessNameFieldSchema & StateFieldSchema & BusinessRegistrationNumberFieldSchema & TaxInformationFieldSchema & CountryOfGoverningLawFieldSchema;
13
+ import type { LegalCompanyNameFieldSchema } from '../LegalCompanyNameField/types';
14
+ export type BasicInformationSchema = CountryFieldSchema & LegalCompanyNameFieldSchema & StateFieldSchema & BusinessRegistrationNumberFieldSchema & TaxInformationFieldSchema & CountryOfGoverningLawFieldSchema;
15
15
  export interface BasicInformationProps extends BaseInnerFormProps<BasicInformationSchema> {
16
16
  country: CountryCode;
17
17
  companyType: CompanyTypesValue | undefined;
@@ -8,7 +8,7 @@ export declare const getForms: (country: CountryCode) => {
8
8
  readonly formName: "basicInformationFormName";
9
9
  readonly formHeading: "basicInformationFormHeading";
10
10
  readonly formDescription: "basicInformationFormDescription";
11
- readonly fields: ("businessName" | "country" | "countryOfGoverningLaw" | "stateOrProvince" | keyof import("../BusinessRegistrationNumberField/types").BusinessRegistrationNumberFieldSchema | keyof import("../TaxInformationField/types").TaxInformationFieldSchema)[];
11
+ readonly fields: ("country" | "countryOfGoverningLaw" | "legalCompanyName" | "stateOrProvince" | keyof import("../BusinessRegistrationNumberField/types").BusinessRegistrationNumberFieldSchema | keyof import("../TaxInformationField/types").TaxInformationFieldSchema)[];
12
12
  };
13
13
  readonly companyStructure: {
14
14
  readonly formId: "companyStructure";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adyen/kyc-components",
3
- "version": "3.48.0",
3
+ "version": "3.48.2",
4
4
  "keywords": [
5
5
  "adyen",
6
6
  "adyen-kyc",
@@ -1,3 +0,0 @@
1
- import type { BusinessNameFieldProps, BusinessNameFieldSchema } from './types';
2
- export declare const BUSINESS_NAME_FIELD: Array<keyof BusinessNameFieldSchema>;
3
- export declare function BusinessNameField({ data, valid, errors, labels, readonly, handleChangeFor, }: BusinessNameFieldProps): import("preact").JSX.Element;
@@ -1,3 +0,0 @@
1
- import type { FieldMetadata } from '../../core/models/country-config';
2
- import type { BusinessNameFieldSchema } from './types';
3
- export declare const businessNameFieldMetadata: FieldMetadata<BusinessNameFieldSchema, 'businessName'>;
@@ -1,5 +0,0 @@
1
- import type { BaseFormFieldProps } from '../../core/hooks/useForm/types';
2
- export interface BusinessNameFieldSchema {
3
- businessName?: string;
4
- }
5
- export type BusinessNameFieldProps = BaseFormFieldProps<BusinessNameFieldSchema>;