@adyen/kyc-components 3.48.1 → 3.48.3

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-C0Dn2sJJ.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-C8DGM6t7.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-Fd17DCoR.js";
2
- import { g as getPreferredColorScheme, c as createMemo, a as createComponent } from "./index-C0Dn2sJJ.js";
1
+ import { c as createLocalStorage, T as THEME_PREFERENCE, P as PiPProvider, a as ThemeContext, D as Devtools, Q as QueryDevtoolsContext } from "./B4MFY5CR-CQfGQVaX.js";
2
+ import { g as getPreferredColorScheme, c as createMemo, a as createComponent } from "./index-C8DGM6t7.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-Fd17DCoR.js";
2
- import { g as getPreferredColorScheme, c as createMemo, a as createComponent } from "./index-C0Dn2sJJ.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-CQfGQVaX.js";
2
+ import { g as getPreferredColorScheme, c as createMemo, a as createComponent } from "./index-C8DGM6t7.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-C0Dn2sJJ.js";
1
+ import { W } from "./index-C8DGM6t7.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.",
@@ -10544,9 +10544,8 @@ function TaxInformationField({
10544
10544
  );
10545
10545
  useEffect(() => {
10546
10546
  const hasSavedTaxId = defaultData == null ? void 0 : defaultData.find((taxId) => taxId.country === country);
10547
- if (currentCountryTaxInformation && !hasSavedTaxId) {
10548
- return;
10549
- }
10547
+ if ((currentCountryTaxInformation == null ? void 0 : currentCountryTaxInformation.country) === country) return;
10548
+ if (currentCountryTaxInformation && !hasSavedTaxId) return;
10550
10549
  handleChangeFor("taxInformation", "input")(defaultData);
10551
10550
  }, [country]);
10552
10551
  const showTaxIdExemptedOptions = canExempt && (((_a2 = getTaxIdNumberOptions(country, companyType)) == null ? void 0 : _a2.length) ?? 0) > 1;
@@ -11391,7 +11390,6 @@ const businessDetailsBase = {
11391
11390
  stockISIN: { rule: "ifPubliclyTradedCompany" },
11392
11391
  stockTickerSymbol: { rule: "ifPubliclyTradedCompany" },
11393
11392
  dateOfIncorporation: { rule: "countryRequiresDateOfIncorporationForCompanies" },
11394
- businessName: { rule: "countryUsingCompanySearch" },
11395
11393
  stateOrProvince: { rule: "countryUsingCompanySearch" },
11396
11394
  registrationNumber: { rule: "countryRequiresRegistrationNumberForCompanies" },
11397
11395
  exemptedFromRegistrationNumber: { rule: "companyRegistrationNumberExemptionAllowed" },
@@ -15783,13 +15781,12 @@ const payoutBaseMapping = {
15783
15781
  };
15784
15782
  const businessDetailsBaseMapping = {
15785
15783
  "basicInformation.country": "organization.registeredAddress.country",
15786
- "basicInformation.businessName": "organization.legalName",
15784
+ "basicInformation.legalCompanyName": "organization.legalName",
15787
15785
  "basicInformation.stateOrProvince": "organization.registeredAddress.stateOrProvince",
15788
15786
  "basicInformation.registrationNumber": "organization.registrationNumber",
15789
15787
  "basicInformation.taxInformation": "organization.taxInformation",
15790
15788
  "basicInformation.countryOfGoverningLaw": "organization.countryOfGoverningLaw",
15791
15789
  "companyStructure.entityType": "organization.type",
15792
- "additionalInformation.legalCompanyName": "organization.legalName",
15793
15790
  "additionalInformation.legalFormDescription": "organization.legalFormDescription",
15794
15791
  "additionalInformation.doingBusinessAs": "organization.doingBusinessAs",
15795
15792
  "additionalInformation.doingBusinessAsAbsent": "organization.doingBusinessAsAbsent",
@@ -30468,9 +30465,6 @@ const applyVerifiedBusinessData = (verifiedBusiness, handleChangeFor) => {
30468
30465
  if (!verifiedBusiness) return;
30469
30466
  entriesOf(verifiedBusiness).forEach(([key, value]) => {
30470
30467
  switch (key) {
30471
- case "name":
30472
- if (value) handleChangeFor("legalCompanyName", "input")(value);
30473
- break;
30474
30468
  case "isPrincipalAddress":
30475
30469
  if (value)
30476
30470
  handleChangeFor(
@@ -30560,7 +30554,6 @@ function VerifiedBusinessCard({
30560
30554
  }
30561
30555
  const ADDITIONAL_INFORMATION_FORM_ID = "additionalInformation";
30562
30556
  const ADDITIONAL_INFORMATION_FIELDS = [
30563
- ...LEGAL_COMPANY_NAME_FIELD,
30564
30557
  ...DBA_NAME_FIELD,
30565
30558
  ...BUSINESS_REGISTRATION_NUMBER_FIELD,
30566
30559
  ...TAX_INFORMATION_FIELD,
@@ -30679,7 +30672,7 @@ function AdditionalInformation({
30679
30672
  }
30680
30673
  return ((_a3 = initialFormUtilsProps.requiredFields) == null ? void 0 : _a3.filter(
30681
30674
  (field) => !fieldsToRemove.includes(field)
30682
- )) ?? [...LEGAL_COMPANY_NAME_FIELD, ...DBA_NAME_FIELD];
30675
+ )) ?? [...DBA_NAME_FIELD];
30683
30676
  },
30684
30677
  [initialFormUtilsProps.requiredFields]
30685
30678
  );
@@ -30688,16 +30681,6 @@ function AdditionalInformation({
30688
30681
  var _a3;
30689
30682
  return (_a3 = initialFormUtilsProps.allFields) == null ? void 0 : _a3.reduce((acc, field) => {
30690
30683
  switch (field) {
30691
- case "legalCompanyName":
30692
- return mergeFieldMetadataIntoProps(
30693
- field,
30694
- resolveFieldMetadata(
30695
- isExperimentEnabled("StrictNameAndAddressValidationV4") ? defaultFieldConfigV4[country] : defaultFieldConfig$a[country],
30696
- { isBusiness: true },
30697
- isExperimentEnabled("StrictNameAndAddressValidationV4") ? defaultFieldMetadataV4 : defaultFieldMetadata$b
30698
- ),
30699
- acc
30700
- );
30701
30684
  case "doingBusinessAsAbsent":
30702
30685
  return mergeFieldMetadataIntoProps(
30703
30686
  "doingBusinessAsAbsent",
@@ -30789,7 +30772,6 @@ function AdditionalInformation({
30789
30772
  if (!verifiedBusiness) return data;
30790
30773
  return {
30791
30774
  ...data,
30792
- legalCompanyName: verifiedBusiness.name,
30793
30775
  registrationAddress: {
30794
30776
  address: verifiedBusiness.street,
30795
30777
  city: verifiedBusiness.city,
@@ -30844,22 +30826,19 @@ function AdditionalInformation({
30844
30826
  };
30845
30827
  }, [verifiedBusiness, basicInformation == null ? void 0 : basicInformation.stateOrProvince, country]);
30846
30828
  useEffect(
30847
- () => applyVerifiedBusinessData(verifiedBusiness, handleChangeFor),
30829
+ () => {
30830
+ applyVerifiedBusinessData(verifiedBusiness, handleChangeFor);
30831
+ if (basicInformation && (verifiedBusiness == null ? void 0 : verifiedBusiness.name)) {
30832
+ basicInformation.legalCompanyName = verifiedBusiness.name;
30833
+ }
30834
+ },
30848
30835
  // eslint-disable-next-line react-hooks/exhaustive-deps
30849
30836
  [verifiedBusiness]
30850
30837
  );
30851
30838
  useEffect(() => {
30852
30839
  if (!verifiedBusiness && !showCompanyStructure) resetToDefaultData();
30853
30840
  }, [verifiedBusiness]);
30854
- const showField = (fieldKeys) => fieldKeys.some((field) => {
30855
- switch (field) {
30856
- case "legalCompanyName": {
30857
- return (formUtils.isRequiredField(field) || formUtils.isOptionalField(field)) && !(verifiedBusiness == null ? void 0 : verifiedBusiness.name);
30858
- }
30859
- default:
30860
- return formUtils.isRequiredField(field) || formUtils.isOptionalField(field);
30861
- }
30862
- });
30841
+ const showField = (fieldKeys) => fieldKeys.some((field) => formUtils.isRequiredField(field) || formUtils.isOptionalField(field));
30863
30842
  const handleRegistrationAddressChange = (state) => {
30864
30843
  handleChangeFor("registrationAddress")(state.data);
30865
30844
  setValid("registrationAddress", Boolean(state.isValid));
@@ -30924,24 +30903,6 @@ function AdditionalInformation({
30924
30903
  /* @__PURE__ */ jsxs("section", { children: [
30925
30904
  showVerified && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-additional-information__section-heading", children: /* @__PURE__ */ jsx(Typography, { el: "h3", variant: "title", children: i18n.get("otherBusinessInformation") }) }),
30926
30905
  /* @__PURE__ */ jsxs("fieldset", { children: [
30927
- showField(LEGAL_COMPANY_NAME_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
30928
- LegalCompanyNameField,
30929
- {
30930
- data: formUtils.getFieldData(formData, LEGAL_COMPANY_NAME_FIELD),
30931
- valid: formUtils.getFieldValid(formValid, LEGAL_COMPANY_NAME_FIELD),
30932
- errors: formUtils.getFieldErrors(
30933
- formErrors,
30934
- formFieldProblems,
30935
- LEGAL_COMPANY_NAME_FIELD
30936
- ),
30937
- labels: formUtils.getFieldLabels(LEGAL_COMPANY_NAME_FIELD),
30938
- helperText: formUtils.getFieldHelperText(LEGAL_COMPANY_NAME_FIELD, {
30939
- legalCompanyName: "legalCompanyName__helperText"
30940
- }),
30941
- readonly: formUtils.isReadOnly("legalCompanyName"),
30942
- handleChangeFor
30943
- }
30944
- ) }),
30945
30906
  /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
30946
30907
  DBANameField,
30947
30908
  {
@@ -30954,8 +30915,7 @@ function AdditionalInformation({
30954
30915
  readonly: formUtils.isReadOnly("doingBusinessAs"),
30955
30916
  requiredFields: requiredFieldsForDBANameField,
30956
30917
  handleChangeFor,
30957
- setErrors,
30958
- legalCompanyName: formData.legalCompanyName
30918
+ setErrors
30959
30919
  }
30960
30920
  ) }),
30961
30921
  showField(BUSINESS_REGISTRATION_NUMBER_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
@@ -31492,45 +31452,6 @@ function BusinessSelection({
31492
31452
  }
31493
31453
  return null;
31494
31454
  }
31495
- const BUSINESS_NAME_FIELD = ["businessName"];
31496
- function BusinessNameField({
31497
- data,
31498
- valid,
31499
- errors,
31500
- labels: labels2,
31501
- readonly,
31502
- handleChangeFor
31503
- }) {
31504
- return /* @__PURE__ */ jsx(
31505
- Field,
31506
- {
31507
- name: "businessName",
31508
- label: labels2.businessName,
31509
- errorMessage: errors.businessName,
31510
- isValid: valid.businessName,
31511
- classNameModifiers: ["businessName"],
31512
- children: (childProps) => /* @__PURE__ */ jsx(
31513
- InputText,
31514
- {
31515
- ...childProps,
31516
- "aria-required": true,
31517
- "aria-label": labels2.businessName,
31518
- "aria-invalid": !valid.businessName,
31519
- name: "businessName",
31520
- value: data.businessName,
31521
- readonly,
31522
- classNameModifiers: ["businessName"],
31523
- onInput: handleChangeFor("businessName", "input"),
31524
- onBlur: handleChangeFor("businessName", "blur")
31525
- }
31526
- )
31527
- }
31528
- );
31529
- }
31530
- const businessNameFieldMetadata = {
31531
- label: "businessName",
31532
- validators: validateNotEmptyOnBlur
31533
- };
31534
31455
  const CountryFieldValidation = () => ({
31535
31456
  country: {
31536
31457
  modes: ["blur"],
@@ -31579,7 +31500,7 @@ const CountryOfGoverningLawFieldValidation = () => ({
31579
31500
  const BASIC_INFORMATION_FORM_ID = "basicInformation";
31580
31501
  const BASIC_INFORMATION_FIELDS = [
31581
31502
  ...COUNTRY_FIELD,
31582
- ...BUSINESS_NAME_FIELD,
31503
+ ...LEGAL_COMPANY_NAME_FIELD,
31583
31504
  ...TAX_INFORMATION_FIELD,
31584
31505
  ...STATE_FIELD,
31585
31506
  ...BUSINESS_REGISTRATION_NUMBER_FIELD,
@@ -31645,7 +31566,10 @@ function BasicInformation({
31645
31566
  if (currentData.country !== CountryCodes.UnitedKingdom) {
31646
31567
  fieldsToRemove.push("countryOfGoverningLaw");
31647
31568
  }
31648
- return (requiredFields == null ? void 0 : requiredFields.filter((field) => !fieldsToRemove.includes(field))) ?? ["country"];
31569
+ return (requiredFields == null ? void 0 : requiredFields.filter((field) => !fieldsToRemove.includes(field))) ?? [
31570
+ ...COUNTRY_FIELD,
31571
+ ...LEGAL_COMPANY_NAME_FIELD
31572
+ ];
31649
31573
  },
31650
31574
  [isCountryOfGoverningLawEnabled, requiredFields]
31651
31575
  );
@@ -31698,8 +31622,16 @@ function BasicInformation({
31698
31622
  ...acc,
31699
31623
  validators: { ...acc.validators, ...CountryFieldValidation() }
31700
31624
  };
31701
- case "businessName":
31702
- return mergeFieldMetadataIntoProps("businessName", businessNameFieldMetadata, acc);
31625
+ case "legalCompanyName":
31626
+ return mergeFieldMetadataIntoProps(
31627
+ field,
31628
+ resolveFieldMetadata(
31629
+ isExperimentEnabled("StrictNameAndAddressValidationV4") ? defaultFieldConfigV4[country] : defaultFieldConfig$a[country],
31630
+ { isBusiness: true },
31631
+ isExperimentEnabled("StrictNameAndAddressValidationV4") ? defaultFieldMetadataV4 : defaultFieldMetadata$b
31632
+ ),
31633
+ acc
31634
+ );
31703
31635
  case "countryOfGoverningLaw":
31704
31636
  return {
31705
31637
  ...acc,
@@ -31877,22 +31809,25 @@ function BasicInformation({
31877
31809
  handleChangeFor
31878
31810
  }
31879
31811
  ),
31812
+ showField(LEGAL_COMPANY_NAME_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
31813
+ LegalCompanyNameField,
31814
+ {
31815
+ data: formUtils.getFieldData(formData, LEGAL_COMPANY_NAME_FIELD),
31816
+ valid: formUtils.getFieldValid(formValid, LEGAL_COMPANY_NAME_FIELD),
31817
+ errors: formUtils.getFieldErrors(
31818
+ formErrors,
31819
+ formFieldProblems,
31820
+ LEGAL_COMPANY_NAME_FIELD
31821
+ ),
31822
+ labels: formUtils.getFieldLabels(LEGAL_COMPANY_NAME_FIELD),
31823
+ helperText: formUtils.getFieldHelperText(LEGAL_COMPANY_NAME_FIELD, {
31824
+ legalCompanyName: "legalCompanyName__helperText"
31825
+ }),
31826
+ readonly: formUtils.isReadOnly("legalCompanyName"),
31827
+ handleChangeFor
31828
+ }
31829
+ ) }),
31880
31830
  COUNTRIES_USING_COMPANY_SEARCH.includes(formData.country ?? country) && /* @__PURE__ */ jsxs("fieldset", { children: [
31881
- showField(BUSINESS_NAME_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
31882
- BusinessNameField,
31883
- {
31884
- data: formUtils.getFieldData(formData, BUSINESS_NAME_FIELD),
31885
- valid: formUtils.getFieldValid(formValid, BUSINESS_NAME_FIELD),
31886
- errors: formUtils.getFieldErrors(
31887
- formErrors,
31888
- formFieldProblems,
31889
- BUSINESS_NAME_FIELD
31890
- ),
31891
- labels: formUtils.getFieldLabels(BUSINESS_NAME_FIELD),
31892
- readonly: formUtils.isReadOnly("businessName"),
31893
- handleChangeFor
31894
- }
31895
- ) }),
31896
31831
  showField(TAX_INFORMATION_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
31897
31832
  TaxInformationField,
31898
31833
  {
@@ -32113,12 +32048,7 @@ function CompanyStructure({
32113
32048
  )
32114
32049
  ] });
32115
32050
  }
32116
- const FIELDS_NEEDED_FOR_COMPANY_SEARCH = [
32117
- ...BUSINESS_NAME_FIELD,
32118
- ...STATE_FIELD,
32119
- ...TAX_INFORMATION_FIELD,
32120
- ...BUSINESS_REGISTRATION_NUMBER_FIELD
32121
- ];
32051
+ const FIELDS_NEEDED_FOR_COMPANY_SEARCH = [...STATE_FIELD, ...TAX_INFORMATION_FIELD, ...BUSINESS_REGISTRATION_NUMBER_FIELD];
32122
32052
  const getBasicInformationFields = (country) => {
32123
32053
  let fields = [...BASIC_INFORMATION_FIELDS];
32124
32054
  if (!COUNTRIES_USING_COMPANY_SEARCH.includes(country)) {
@@ -33432,7 +33362,7 @@ const mapBusinessDetailsDocumentToApiDocument = async (data, entityId) => {
33432
33362
  return documents.filter(Boolean);
33433
33363
  };
33434
33364
  const mapBusinessDetailsSchemaToLegalEntity = (data, isExperimentEnabled) => {
33435
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m, _n, _o, _p, _q;
33365
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m, _n, _o, _p, _q, _r;
33436
33366
  const requestObj = {
33437
33367
  ...formatObject(data, businessDetailsApiKeyMapping)
33438
33368
  };
@@ -33454,9 +33384,6 @@ const mapBusinessDetailsSchemaToLegalEntity = (data, isExperimentEnabled) => {
33454
33384
  if ((_m = data.additionalInformation) == null ? void 0 : _m.vatAbsenceReason) {
33455
33385
  requestObj.organization.vatNumber = "";
33456
33386
  }
33457
- if (doingBusinessAs) {
33458
- requestObj.organization.doingBusinessAs = doingBusinessAs;
33459
- }
33460
33387
  if (isExperimentEnabled("EnableDoingBusinessAsNameV4")) {
33461
33388
  if (((_n = data.additionalInformation) == null ? void 0 : _n.doingBusinessAsAbsent) === "no") {
33462
33389
  requestObj.organization.doingBusinessAsAbsent = true;
@@ -33465,9 +33392,10 @@ const mapBusinessDetailsSchemaToLegalEntity = (data, isExperimentEnabled) => {
33465
33392
  requestObj.organization.doingBusinessAsAbsent = false;
33466
33393
  }
33467
33394
  } else {
33395
+ requestObj.organization.doingBusinessAs = doingBusinessAs || ((_p = data.basicInformation) == null ? void 0 : _p.legalCompanyName);
33468
33396
  delete requestObj.organization.doingBusinessAsAbsent;
33469
33397
  }
33470
- if (((_p = data.additionalInformation) == null ? void 0 : _p.operationalAddressIsSame) === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_SAME && requestObj.organization.principalPlaceOfBusiness) {
33398
+ if (((_q = data.additionalInformation) == null ? void 0 : _q.operationalAddressIsSame) === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_SAME && requestObj.organization.principalPlaceOfBusiness) {
33471
33399
  requestObj.organization.principalPlaceOfBusiness = requestObj.organization.registeredAddress;
33472
33400
  }
33473
33401
  if (!isEmpty(data.companyFinancialInformation)) {
@@ -33477,7 +33405,7 @@ const mapBusinessDetailsSchemaToLegalEntity = (data, isExperimentEnabled) => {
33477
33405
  }
33478
33406
  }
33479
33407
  requestObj.type = LegalEntityType.ORGANIZATION;
33480
- if (((_q = requestObj.organization) == null ? void 0 : _q.registeredAddress.country) === "US") {
33408
+ if (((_r = requestObj.organization) == null ? void 0 : _r.registeredAddress.country) === "US") {
33481
33409
  delete requestObj.organization.registrationNumber;
33482
33410
  }
33483
33411
  return requestObj;
@@ -33516,7 +33444,7 @@ const formatFinancialInformationSummary = (data, i18n) => {
33516
33444
  }
33517
33445
  return summary2;
33518
33446
  };
33519
- const MANDATORY_API_FIELDS = ["additionalInformation.legalCompanyName", "basicInformation.country"];
33447
+ const MANDATORY_API_FIELDS = ["basicInformation.legalCompanyName", "basicInformation.country"];
33520
33448
  const parseConfiguration$6 = ({ country, matchingScenario }) => parseBusinessDetailsScenarios(matchingScenario == null ? void 0 : matchingScenario[LegalEntityType.ORGANIZATION], country);
33521
33449
  const canSubmit$3 = (data) => MANDATORY_API_FIELDS.every((detail) => {
33522
33450
  const value = getProp(data, detail);
@@ -33525,7 +33453,7 @@ const canSubmit$3 = (data) => MANDATORY_API_FIELDS.every((detail) => {
33525
33453
  const isDocumentsRequired$2 = (forms) => forms.some((form) => documentFormsIds.includes(form.formId));
33526
33454
  const removeConditionalForms = (forms, isSkippingCompanyStructure) => isSkippingCompanyStructure ? forms.filter((f) => f.formId !== "companyStructure" && f.formId !== "companyType") : forms;
33527
33455
  const formatBasicInformation = (data, labels2, datasetUtils, companyType, isCountryOfGoverningLawEnabled) => {
33528
- var _a2, _b2, _c2;
33456
+ var _a2, _b2, _c2, _d2;
33529
33457
  const country = data == null ? void 0 : data.country;
33530
33458
  const registrationNumberLabel = resolveFieldMetadata(
33531
33459
  defaultFieldConfig$9[country],
@@ -33546,18 +33474,19 @@ const formatBasicInformation = (data, labels2, datasetUtils, companyType, isCoun
33546
33474
  ).label;
33547
33475
  const countryOfGoverningLaw = getCountryOfGoverningLaw(isCountryOfGoverningLawEnabled, data);
33548
33476
  return {
33477
+ [((_b2 = labels2 == null ? void 0 : labels2.basicInformation) == null ? void 0 : _b2.legalCompanyName) ?? "legalCompanyName"]: data.legalCompanyName,
33549
33478
  country: datasetUtils.getCountryName(data.country),
33550
33479
  [getKeyForField("stateOrProvince", data.country)]: datasetUtils.getStateName(
33551
33480
  data.stateOrProvince,
33552
33481
  data.country
33553
33482
  ),
33554
- [taxIdLabel]: (_c2 = (_b2 = data.taxInformation) == null ? void 0 : _b2.find((taxId) => data.country === taxId.country)) == null ? void 0 : _c2.number,
33483
+ [taxIdLabel]: (_d2 = (_c2 = data.taxInformation) == null ? void 0 : _c2.find((taxId) => data.country === taxId.country)) == null ? void 0 : _d2.number,
33555
33484
  [registrationNumberLabel]: data.registrationNumber,
33556
33485
  countryOfGoverningLaw: datasetUtils.getCountryName(countryOfGoverningLaw)
33557
33486
  };
33558
33487
  };
33559
33488
  const formatAdditionalInformation = (data, labels2, country, companyType, i18n) => {
33560
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2;
33489
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2;
33561
33490
  const registrationNumberLabel = resolveFieldMetadata(
33562
33491
  defaultFieldConfig$9[country],
33563
33492
  {
@@ -33576,17 +33505,16 @@ const formatAdditionalInformation = (data, labels2, country, companyType, i18n)
33576
33505
  defaultFieldMetadata$7
33577
33506
  ).label;
33578
33507
  return {
33579
- [((_b2 = labels2 == null ? void 0 : labels2.additionalInformation) == null ? void 0 : _b2.legalCompanyName) ?? "legalCompanyName"]: data.legalCompanyName,
33580
- [((_c2 = labels2 == null ? void 0 : labels2.additionalInformation) == null ? void 0 : _c2.doingBusinessAs) ?? "doingBusinessAs"]: data.doingBusinessAs,
33508
+ [((_b2 = labels2 == null ? void 0 : labels2.additionalInformation) == null ? void 0 : _b2.doingBusinessAs) ?? "doingBusinessAs"]: data.doingBusinessAs,
33581
33509
  [registrationNumberLabel]: data.registrationNumber,
33582
- [taxIdLabel]: (_e2 = (_d2 = data.taxInformation) == null ? void 0 : _d2.find((taxId) => country === taxId.country)) == null ? void 0 : _e2.number,
33583
- [((_f2 = labels2 == null ? void 0 : labels2.additionalInformation) == null ? void 0 : _f2.vatNumber) ?? "vatNumber"]: data.vatNumber,
33584
- [((_g2 = labels2 == null ? void 0 : labels2.additionalInformation) == null ? void 0 : _g2.vatAbsenceReason) ?? "vatAbsenceReason"]: data.vatAbsenceReason ? i18n.get(data.vatAbsenceReason) : void 0,
33585
- [((_h2 = labels2 == null ? void 0 : labels2.additionalInformation) == null ? void 0 : _h2.dateOfIncorporation) ?? "dateOfIncorporation"]: data.dateOfIncorporation,
33586
- [((_i2 = labels2 == null ? void 0 : labels2.additionalInformation) == null ? void 0 : _i2.stockExchangeMIC) ?? "stockExchangeMIC"]: data.stockExchangeMIC,
33587
- [((_j2 = labels2 == null ? void 0 : labels2.additionalInformation) == null ? void 0 : _j2.stockISIN) ?? "stockISIN"]: data.stockISIN,
33588
- [((_k2 = labels2 == null ? void 0 : labels2.additionalInformation) == null ? void 0 : _k2.stockTickerSymbol) ?? "stockTickerSymbol"]: data.stockTickerSymbol,
33589
- [((_l2 = labels2 == null ? void 0 : labels2.additionalInformation) == null ? void 0 : _l2.eInvoicingCode) ?? "eInvoicingCode"]: data.eInvoicingCode
33510
+ [taxIdLabel]: (_d2 = (_c2 = data.taxInformation) == null ? void 0 : _c2.find((taxId) => country === taxId.country)) == null ? void 0 : _d2.number,
33511
+ [((_e2 = labels2 == null ? void 0 : labels2.additionalInformation) == null ? void 0 : _e2.vatNumber) ?? "vatNumber"]: data.vatNumber,
33512
+ [((_f2 = labels2 == null ? void 0 : labels2.additionalInformation) == null ? void 0 : _f2.vatAbsenceReason) ?? "vatAbsenceReason"]: data.vatAbsenceReason ? i18n.get(data.vatAbsenceReason) : void 0,
33513
+ [((_g2 = labels2 == null ? void 0 : labels2.additionalInformation) == null ? void 0 : _g2.dateOfIncorporation) ?? "dateOfIncorporation"]: data.dateOfIncorporation,
33514
+ [((_h2 = labels2 == null ? void 0 : labels2.additionalInformation) == null ? void 0 : _h2.stockExchangeMIC) ?? "stockExchangeMIC"]: data.stockExchangeMIC,
33515
+ [((_i2 = labels2 == null ? void 0 : labels2.additionalInformation) == null ? void 0 : _i2.stockISIN) ?? "stockISIN"]: data.stockISIN,
33516
+ [((_j2 = labels2 == null ? void 0 : labels2.additionalInformation) == null ? void 0 : _j2.stockTickerSymbol) ?? "stockTickerSymbol"]: data.stockTickerSymbol,
33517
+ [((_k2 = labels2 == null ? void 0 : labels2.additionalInformation) == null ? void 0 : _k2.eInvoicingCode) ?? "eInvoicingCode"]: data.eInvoicingCode
33590
33518
  };
33591
33519
  };
33592
33520
  const formatDataForSummary$1 = (data, forms, labels2, i18n, isExperimentEnabled) => {
@@ -33735,7 +33663,7 @@ async function submit({
33735
33663
  actionType: "submit",
33736
33664
  companyStructure: ((_a2 = data.companyStructure) == null ? void 0 : _a2.entityType) ?? null,
33737
33665
  countryOfRegistration: ((_b2 = data.basicInformation) == null ? void 0 : _b2.country) ?? null,
33738
- legalEntityName: ((_c2 = data.additionalInformation) == null ? void 0 : _c2.legalCompanyName) ?? null,
33666
+ legalEntityName: ((_c2 = data.basicInformation) == null ? void 0 : _c2.legalCompanyName) ?? null,
33739
33667
  usedAdditionalAddress: ((_d2 = data.additionalInformation) == null ? void 0 : _d2.operationalAddressIsSame) === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME
33740
33668
  };
33741
33669
  const savedLegalEntityData = legalEntityResponse ? mapLegalEntityToBusinessDetailsSchema(legalEntityResponse, isExperimentEnabled) : null;
@@ -34093,14 +34021,14 @@ function BusinessDetailsDropin({
34093
34021
  const findBusiness = useCallback(
34094
34022
  async (currentData) => {
34095
34023
  var _a3, _b3;
34096
- if (!(currentData == null ? void 0 : currentData.businessName) || !(currentData == null ? void 0 : currentData.country) || !(currentData == null ? void 0 : currentData.stateOrProvince)) {
34024
+ if (!(currentData == null ? void 0 : currentData.legalCompanyName) || !(currentData == null ? void 0 : currentData.country) || !(currentData == null ? void 0 : currentData.stateOrProvince)) {
34097
34025
  return;
34098
34026
  }
34099
34027
  const tin = (_b3 = (_a3 = currentData == null ? void 0 : currentData.taxInformation) == null ? void 0 : _a3.find(
34100
34028
  (taxId) => currentCountry === taxId.country
34101
34029
  )) == null ? void 0 : _b3.number;
34102
34030
  const results = await searchForBusiness({
34103
- name: currentData.businessName,
34031
+ name: currentData.legalCompanyName,
34104
34032
  country: currentData.country,
34105
34033
  state: currentData.stateOrProvince,
34106
34034
  registrationNumber: currentData.registrationNumber
@@ -34250,12 +34178,12 @@ function BusinessDetailsDropin({
34250
34178
  }
34251
34179
  }, [searchResults, searching]);
34252
34180
  useEffect(() => {
34253
- var _a3;
34254
- if (((_a3 = currentState.data.basicInformation) == null ? void 0 : _a3.businessName) !== currentSearchName) {
34181
+ var _a3, _b3;
34182
+ 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)) {
34255
34183
  setShowCompanyStructure(false);
34256
34184
  resetBusinessData();
34257
34185
  }
34258
- }, [currentSearchName, (_f2 = currentState.data.basicInformation) == null ? void 0 : _f2.businessName]);
34186
+ }, [currentSearchName, (_f2 = currentState.data.basicInformation) == null ? void 0 : _f2.legalCompanyName, verifiedBusiness]);
34259
34187
  useEffect(() => {
34260
34188
  var _a3;
34261
34189
  if ((trustedFields == null ? void 0 : trustedFields.length) && ((_a3 = legalEntityResponse.organization) == null ? void 0 : _a3.registeredAddress.country) !== currentCountry) {
@@ -49732,7 +49660,7 @@ const ConfigurationApiProvider = ({
49732
49660
  }) => {
49733
49661
  const authContext = useAuthContext();
49734
49662
  const { isEmbeddedDropin, loadingContext } = authContext;
49735
- const sdkVersion = "3.48.1";
49663
+ const sdkVersion = "3.48.3";
49736
49664
  const rootLegalEntityId = useGlobalStore((store) => store.rootLegalEntity.id);
49737
49665
  useAnalytics({
49738
49666
  onUserEvent,
@@ -50617,7 +50545,7 @@ const DebugModal = ({ onExit }) => {
50617
50545
  const [tab, setTab] = useState("metadata");
50618
50546
  const rootLegalEntity = useGlobalStore((store) => store.rootLegalEntity);
50619
50547
  const metadata = {
50620
- sdkVersion: "3.48.1",
50548
+ sdkVersion: "3.48.3",
50621
50549
  locale: i18n.locale,
50622
50550
  rootLegalEntityId: rootLegalEntity.id
50623
50551
  };
@@ -53608,7 +53536,7 @@ var TanstackQueryDevtools = (_k = class {
53608
53536
  if (__privateGet(this, _Component)) {
53609
53537
  Devtools = __privateGet(this, _Component);
53610
53538
  } else {
53611
- Devtools = lazy(() => import("./HO4MOOFI-lWUM6L_G.js"));
53539
+ Devtools = lazy(() => import("./HO4MOOFI-NwTVjWrt.js"));
53612
53540
  __privateSet(this, _Component, Devtools);
53613
53541
  }
53614
53542
  setupStyleSheet(__privateGet(this, _styleNonce), __privateGet(this, _shadowDOMTarget));
@@ -53730,7 +53658,7 @@ var TanstackQueryDevtoolsPanel = (_l = class {
53730
53658
  if (__privateGet(this, _Component2)) {
53731
53659
  Devtools = __privateGet(this, _Component2);
53732
53660
  } else {
53733
- Devtools = lazy(() => import("./HUY7CZI3-DbgH_0BN.js"));
53661
+ Devtools = lazy(() => import("./HUY7CZI3-njZg72SG.js"));
53734
53662
  __privateSet(this, _Component2, Devtools);
53735
53663
  }
53736
53664
  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.1",
3
+ "version": "3.48.3",
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>;