@adyen/kyc-components 2.46.0 → 2.47.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.
Files changed (37) hide show
  1. package/dist/es/adyen-kyc-components.es.js +1074 -642
  2. package/dist/style.css +836 -1264
  3. package/dist/types/components/Company/trustedFields.d.ts +7 -0
  4. package/dist/types/components/Dropins/CompanyDropin/components/CompanyDropinComponent.d.ts +1 -1
  5. package/dist/types/components/Dropins/CompanyDropin/types.d.ts +2 -0
  6. package/dist/types/components/Dropins/HighExposureDropin/components/AdditionalFieldsForHighExposureParentCompany.d.ts +1 -1
  7. package/dist/types/components/Dropins/HighExposureDropin/components/AdditionalFieldsForHighExposureUltimateParentCompany.d.ts +1 -1
  8. package/dist/types/components/Dropins/HighExposureDropin/components/HighExposureBusinessInformation.d.ts +2 -1
  9. package/dist/types/components/Dropins/HighExposureDropin/components/HighExposureOwnershipStructure.d.ts +4 -0
  10. package/dist/types/components/Dropins/HighExposureDropin/types.d.ts +80 -7
  11. package/dist/types/components/Dropins/HighExposureDropin/validate.d.ts +4 -1
  12. package/dist/types/components/Dropins/RoleAndTypeDropin/components/RoleAndTypeDropinComponent.d.ts +1 -1
  13. package/dist/types/components/Dropins/RoleAndTypeDropin/types.d.ts +2 -0
  14. package/dist/types/components/EmbeddedDropins/UpdateLegalEntityForHighExposure/UpdateLegalEntityForHighExposure.d.ts +1 -1
  15. package/dist/types/components/Individual/types.d.ts +1 -1
  16. package/dist/types/components/TrustRoleAndEntityType/types.d.ts +1 -0
  17. package/dist/types/components/internal/LegalCompanyNameField/fieldConfig.d.ts +9 -0
  18. package/dist/types/components/internal/LegalFormField/LegalFormField.d.ts +1 -1
  19. package/dist/types/components/internal/LegalFormField/types.d.ts +4 -1
  20. package/dist/types/components/internal/NaceCodeField/NaceCodeField.d.ts +1 -1
  21. package/dist/types/components/internal/NaceCodeField/types.d.ts +5 -1
  22. package/dist/types/components/internal/Spinner/Spinner.d.ts +3 -4
  23. package/dist/types/components/internal/Tag/Tag.d.ts +6 -5
  24. package/dist/types/components/internal/Toast/types.d.ts +1 -1
  25. package/dist/types/components/internal/Typography/Typography.d.ts +3 -0
  26. package/dist/types/components/internal/Typography/types.d.ts +12 -0
  27. package/dist/types/core/hooks/useForm/types.d.ts +1 -0
  28. package/dist/types/core/models/api/legal-entity.d.ts +6 -0
  29. package/dist/types/core/models/api/trusted-fields-provider.d.ts +4 -0
  30. package/dist/types/utils/get-props.d.ts +0 -9
  31. package/dist/types/utils/roleMetadata.d.ts +3 -2
  32. package/package.json +1 -1
  33. package/dist/types/components/internal/Heading/Heading.d.ts +0 -10
  34. package/dist/types/components/internal/LegalCompanyNameField/validate.d.ts +0 -3
  35. package/dist/types/components/internal/Spinner/index.d.ts +0 -1
  36. package/dist/types/components/internal/StateField/validate.d.ts +0 -3
  37. package/dist/types/components/internal/Tag/index.d.ts +0 -1
@@ -257,6 +257,7 @@ const validationPleaseEnterAValidStockISIN = "Please enter a valid ISIN. For exa
257
257
  const shareholderDocument = "Shareholder document";
258
258
  const role = "Role";
259
259
  const selectAllTheRolesThatThisDecisionMakerHolds = "Select all the roles that this decision-maker holds.";
260
+ const selectedSomeRolesBasedOnMyinfo = "We selected some roles based on Myinfo business data about your company's appointment holders and shareholders.";
260
261
  const selectTheApplicableRoles = "Select the applicable role(s)";
261
262
  const back = "Back";
262
263
  const next = "Next";
@@ -451,7 +452,6 @@ const issuedInTheLastXMonths = "Issued in the last %{number} months";
451
452
  const bankAccountVerification = "Bank account verification";
452
453
  const bankStatementDocument = "Bank statement";
453
454
  const requirements = "Requirements:";
454
- const ifDocumentMoreThan12months = "If your document is older than 12 months, then it should contain a statement with the company’s assets and liabilities. You will need to have it signed and dated by someone with decision-making or signing power within the company. Make sure the date, title, and legal entity name are included.";
455
455
  const whyDoINeedToFillInThisInformation = "Why do I need to fill in this information?";
456
456
  const reasonForFillingCompanyRegistrationDetails = "We have to make sure the businesses using our services will not be misusing the funds or causing harm. To do that, we’ll check all of this information against official records. This is a part of the financial regulations that we have to follow as a payments provider.";
457
457
  const reasonForFillingCompanyAddressDetails = "We have to make sure the businesses using our services will not be misusing the funds or causing harm. To do that, we’ll check all of this information against official records. This is a part of the financial regulations that we have to follow as a payments provider.";
@@ -465,7 +465,6 @@ const controllingPersonGuideDescription = "A <strong>controlling person</strong>
465
465
  const signatoryGuideDescription = "A <strong>signatory</strong> has been given authority to sign official documents on behalf of the company. Usually a signatory is also an owner or a controlling person.";
466
466
  const directorGuideDescription = "A <strong>director</strong> is someone appointed to manage a company's business and affairs. Who your directors are can be found on the companies register.";
467
467
  const someoneAppointedToManageACompanysBusinessAndAffairs = "Someone appointed to manage a company's business and affairs.";
468
- const whatIfDocumentIsMoreThan12MonthsOld = "What if my document is more than 12 months old?";
469
468
  const depositSlip = "Deposit slip";
470
469
  const screenshotOfOnlineBankingEnviroment = "Screenshot of online banking environment";
471
470
  const officialEmailOrALetterFromYourBank = "Official email or a letter from your bank";
@@ -925,7 +924,8 @@ const legalCompanyName__US = "Legal name";
925
924
  const legalCompanyName__helperText = "Enter the name exactly as it is on your company's official registration documents.";
926
925
  const legalCompanyName__helperText__AU = "Enter the name exactly as it is on your Australian Securities and Investment Commission's (ASIC).";
927
926
  const legalCompanyName__helperText__NL = "Enter the name exactly as it is on your Chamber of Commerce registration.";
928
- const legalCompanyName__helperText__US = "The legal name is used to identify a business with the government. This information came from a trusted data source and can not be edited.";
927
+ const legalCompanyName__helperText__US = "Enter the name exactly as it appears on your Secretary of State Registration.";
928
+ const legalCompanyName__helperText__US__business = "The legal name is used to identify a business with the government. This information came from a trusted data source and can not be edited.";
929
929
  const legalCompanyName__helperText__PR = "Enter the name exactly as it appears on your Department of State Registration.";
930
930
  const legalCompanyName__helperText__SG = "Enter the name exactly as it is on your Accounting and Corporate Regulatory Authority (ACRA) BizFile.";
931
931
  const legalCompanyName__helperText__HK = "Enter the name exactly as it is on your Hong Kong Companies Registry's Certificate of Incorporation.";
@@ -1353,7 +1353,6 @@ const startANewSessionFromTheSamePlaceYouOriginallyAccessed = "Start a new sessi
1353
1353
  const differentCountryOfGoverningLaw = "This company has a different country/region of governing law";
1354
1354
  const countryOfGoverningLaw = "Country/region of governing law";
1355
1355
  const nationalInsuranceNumber = "National Insurance Number (NINO)";
1356
- const detailsForCapital = "Details for capital";
1357
1356
  const parentCompany = "Parent company";
1358
1357
  const ultimateParentCompany = "Ultimate parent company";
1359
1358
  const numberOfEmployees = "Number of employees";
@@ -1364,6 +1363,28 @@ const businessStructure = "Business structure";
1364
1363
  const selectOne = "Select one";
1365
1364
  const industryAndNaceCode = "Industry and NACE code";
1366
1365
  const youMustXYearsOldToContinue = "You must be at least %{minimumAge} years old to continue";
1366
+ const doesTheCompanyEarnMoreThanHalf = "Does the company earn more than 50% of its income from selling goods or non-financial services?";
1367
+ const doesYourCompanyHaveLEI = "Does your company have a Legal Entity Identifier (LEI)?";
1368
+ const anLEIIsAUniqueCode = "An LEI is a unique code that identifies legal entities, including companies, who engage in financial transactions.";
1369
+ const lookUpYourLEI = "Look up your LEI.";
1370
+ const legalEntityIdentifier = "Legal Entity Identifier (LEI)";
1371
+ const yourBusinessDetails = "Your business details";
1372
+ const progress = "Progress";
1373
+ const ownershipStructure = "Ownership structure";
1374
+ const isCompanyOwnedByAnotherCompany = "Is %{company} owned by another company?";
1375
+ const isParentOwnedByAnotherCompany = "Is your parent company owned by another company?";
1376
+ const thisMeansYouHaveAParentCompany = "If yes, this means you have a parent company, such as a global headquarters or a holding company.";
1377
+ const thisMeansYouHaveAnUltimateParentCompany = "If yes, this means you have an ultimate parent company. An ultimate parent company is the company that’s highest in the corporate structure. Learn more.";
1378
+ const additionalInformationIsRequiredForLoan = "Additional information is required to complete your capital loan application.";
1379
+ const beforeYourCapitalLoanApplicationCanBeSubmitted = "Before your capital loan application can be submitted, we need to collect a bit more information about you. All information collected here is required.";
1380
+ const legalName = "Legal name";
1381
+ const businessInformation = "Business information";
1382
+ const parentCompanyInformation = "Parent company information";
1383
+ const inTheLastStepOwnedByAParentCompany = "In the last step, you indicated that your business is owned by a parent company. We need to know some information about this company before submitting your application.";
1384
+ const ultimateParentCompanyInformation = "Ultimate parent company information";
1385
+ const inThePreviousStepOwnedByAnUltimateParentCompany = "In a previous step, you indicated that your business’ parent company was owned by an ultimate parent company. We need to know some information about this company before submitting your application.";
1386
+ const doesThisCompanyHaveLEI = "Does this company have a Legal Entity Identifier (LEI)?";
1387
+ const iDontKnow = "I don't know";
1367
1388
  const defaultTrans = {
1368
1389
  smartling,
1369
1390
  close,
@@ -1583,6 +1604,7 @@ const defaultTrans = {
1583
1604
  shareholderDocument,
1584
1605
  role,
1585
1606
  selectAllTheRolesThatThisDecisionMakerHolds,
1607
+ selectedSomeRolesBasedOnMyinfo,
1586
1608
  selectTheApplicableRoles,
1587
1609
  back,
1588
1610
  next,
@@ -1777,7 +1799,6 @@ const defaultTrans = {
1777
1799
  bankAccountVerification,
1778
1800
  bankStatementDocument,
1779
1801
  requirements,
1780
- ifDocumentMoreThan12months,
1781
1802
  whyDoINeedToFillInThisInformation,
1782
1803
  reasonForFillingCompanyRegistrationDetails,
1783
1804
  reasonForFillingCompanyAddressDetails,
@@ -1791,7 +1812,6 @@ const defaultTrans = {
1791
1812
  signatoryGuideDescription,
1792
1813
  directorGuideDescription,
1793
1814
  someoneAppointedToManageACompanysBusinessAndAffairs,
1794
- whatIfDocumentIsMoreThan12MonthsOld,
1795
1815
  depositSlip,
1796
1816
  screenshotOfOnlineBankingEnviroment,
1797
1817
  officialEmailOrALetterFromYourBank,
@@ -2260,6 +2280,7 @@ const defaultTrans = {
2260
2280
  legalCompanyName__helperText__AU,
2261
2281
  legalCompanyName__helperText__NL,
2262
2282
  legalCompanyName__helperText__US,
2283
+ legalCompanyName__helperText__US__business,
2263
2284
  legalCompanyName__helperText__PR,
2264
2285
  legalCompanyName__helperText__SG,
2265
2286
  legalCompanyName__helperText__HK,
@@ -2689,7 +2710,6 @@ const defaultTrans = {
2689
2710
  differentCountryOfGoverningLaw,
2690
2711
  countryOfGoverningLaw,
2691
2712
  nationalInsuranceNumber,
2692
- detailsForCapital,
2693
2713
  parentCompany,
2694
2714
  ultimateParentCompany,
2695
2715
  numberOfEmployees,
@@ -2699,7 +2719,29 @@ const defaultTrans = {
2699
2719
  businessStructure,
2700
2720
  selectOne,
2701
2721
  industryAndNaceCode,
2702
- youMustXYearsOldToContinue
2722
+ youMustXYearsOldToContinue,
2723
+ doesTheCompanyEarnMoreThanHalf,
2724
+ doesYourCompanyHaveLEI,
2725
+ anLEIIsAUniqueCode,
2726
+ lookUpYourLEI,
2727
+ legalEntityIdentifier,
2728
+ yourBusinessDetails,
2729
+ progress,
2730
+ ownershipStructure,
2731
+ isCompanyOwnedByAnotherCompany,
2732
+ isParentOwnedByAnotherCompany,
2733
+ thisMeansYouHaveAParentCompany,
2734
+ thisMeansYouHaveAnUltimateParentCompany,
2735
+ additionalInformationIsRequiredForLoan,
2736
+ beforeYourCapitalLoanApplicationCanBeSubmitted,
2737
+ legalName,
2738
+ businessInformation,
2739
+ parentCompanyInformation,
2740
+ inTheLastStepOwnedByAParentCompany,
2741
+ ultimateParentCompanyInformation,
2742
+ inThePreviousStepOwnedByAnUltimateParentCompany,
2743
+ doesThisCompanyHaveLEI,
2744
+ iDontKnow
2703
2745
  };
2704
2746
  const FALLBACK_LOCALE = "en-US";
2705
2747
  const defaultTranslation = Object.entries(defaultTrans).reduce((acc, [translationKey, translationValue]) => translationKey !== "smartling" ? {
@@ -3564,19 +3606,6 @@ function getFormProps(props, innerFormId) {
3564
3606
  shouldValidate: (activeFormId ? activeFormId === innerFormId : true) && props.shouldValidate
3565
3607
  };
3566
3608
  }
3567
- function removeFormLayer(obj, formId) {
3568
- if (!obj) {
3569
- return obj;
3570
- }
3571
- const formIdWithDelimiter = `${formId}.`;
3572
- return Object.entries(obj).reduce((acc, [key, value]) => {
3573
- const newKey = key.startsWith(formIdWithDelimiter) ? key.substring(formIdWithDelimiter.length, key.length) : key;
3574
- return {
3575
- ...acc,
3576
- [newKey]: value
3577
- };
3578
- }, {});
3579
- }
3580
3609
  function getNestedOuterFormPropsFromOuterFormProps(props, innerFormId) {
3581
3610
  const newProps = getFormProps(props, innerFormId);
3582
3611
  if (newProps === null) {
@@ -3589,6 +3618,16 @@ function getNestedOuterFormPropsFromOuterFormProps(props, innerFormId) {
3589
3618
  helperText,
3590
3619
  masks
3591
3620
  } = newProps;
3621
+ const {
3622
+ readOnlyFields,
3623
+ requiredFields,
3624
+ optionalFields,
3625
+ obscuredFields,
3626
+ verifyFields,
3627
+ problems,
3628
+ validators: validators2,
3629
+ shouldValidate
3630
+ } = props;
3592
3631
  return {
3593
3632
  placeholders,
3594
3633
  labels: labels2,
@@ -3596,15 +3635,15 @@ function getNestedOuterFormPropsFromOuterFormProps(props, innerFormId) {
3596
3635
  helperText,
3597
3636
  masks,
3598
3637
  // maintain the structure of the special fields
3599
- readOnlyFields: removeFormLayer(props.readOnlyFields, innerFormId),
3600
- requiredFields: removeFormLayer(props.requiredFields, innerFormId),
3601
- optionalFields: removeFormLayer(props.optionalFields, innerFormId),
3602
- obscuredFields: removeFormLayer(props.obscuredFields, innerFormId),
3603
- verifyFields: removeFormLayer(props.verifyFields, innerFormId),
3638
+ readOnlyFields,
3639
+ requiredFields,
3640
+ optionalFields,
3641
+ obscuredFields,
3642
+ verifyFields,
3604
3643
  // the rest we just pass along for now, as they will be eventually be processed by getFormProps
3605
- problems: props.problems,
3606
- validators: props.validators,
3607
- shouldValidate: props.shouldValidate
3644
+ problems,
3645
+ validators: validators2,
3646
+ shouldValidate
3608
3647
  };
3609
3648
  }
3610
3649
  function getFieldProps(props, innerFormFields) {
@@ -4283,6 +4322,15 @@ function useForm({
4283
4322
  fieldProblems: state2.fieldProblems
4284
4323
  };
4285
4324
  }
4325
+ const resolveFieldMetadata = (countryEntry, params, defaultMetadata) => {
4326
+ if (typeof countryEntry === "object") {
4327
+ return countryEntry;
4328
+ }
4329
+ if (typeof countryEntry === "function") {
4330
+ return countryEntry(params);
4331
+ }
4332
+ return defaultMetadata;
4333
+ };
4286
4334
  function useDataset(datasetIdentifier2, skip) {
4287
4335
  const {
4288
4336
  i18n
@@ -4535,12 +4583,10 @@ const Loader = ({
4535
4583
  });
4536
4584
  const Tag = ({
4537
4585
  className,
4538
- isBasic = false,
4586
+ variant = "blue",
4539
4587
  children
4540
4588
  }) => {
4541
- const classNames = cx("adyen-kyc-tag", className, {
4542
- "adyen-kyc-tag--basic": isBasic
4543
- });
4589
+ const classNames = cx("adyen-kyc-tag", className, `adyen-kyc-tag--${variant}`);
4544
4590
  return jsx("span", {
4545
4591
  className: classNames,
4546
4592
  children
@@ -4695,13 +4741,29 @@ const SelectButtonContentMulti = ({
4695
4741
  className: "adyen-kyc-dropdown-selected-items",
4696
4742
  children: active.map((item) => jsx(Tag, {
4697
4743
  className: item.className,
4698
- isBasic: true,
4744
+ variant: "grey",
4699
4745
  children: (item == null ? void 0 : item.selectedOptionName) || (item == null ? void 0 : item.name) || placeholder
4700
4746
  }, item.id))
4701
4747
  }) : jsx("span", {
4702
4748
  className: "adyen-kyc-dropdown-button__text adyen-kyc-dropdown-button__text--placeholder",
4703
4749
  children: placeholder
4704
4750
  });
4751
+ const Typography = ({
4752
+ el = "p",
4753
+ variant = "body",
4754
+ color = "primary",
4755
+ className,
4756
+ children,
4757
+ ...props
4758
+ }) => {
4759
+ const TypographyElement = el;
4760
+ const classNames = cx(className, "adyen-kyc-typography", `adyen-kyc-typography--${color}`, `adyen-kyc-typography--${variant}`);
4761
+ return jsx(TypographyElement, {
4762
+ ...props,
4763
+ className: classNames,
4764
+ children
4765
+ });
4766
+ };
4705
4767
  function Checkbox({
4706
4768
  classNameModifiers = [],
4707
4769
  label,
@@ -4778,10 +4840,14 @@ const SelectListItem = ({
4778
4840
  className: "adyen-kyc-dropdown-element__icon",
4779
4841
  children: item.icon
4780
4842
  }), item.description ? jsxs(Fragment, {
4781
- children: [jsx("span", {
4782
- className: "adyen-kyc-dropdown-element__label adyen-kyc-u-font-weight-semi-bold",
4843
+ children: [jsx(Typography, {
4844
+ el: "span",
4845
+ variant: "body-strongest",
4846
+ className: "adyen-kyc-dropdown-element__label",
4783
4847
  children: item.name
4784
- }), jsx("span", {
4848
+ }), jsx(Typography, {
4849
+ el: "span",
4850
+ color: "secondary",
4785
4851
  className: "adyen-kyc-dropdown-element-description__text",
4786
4852
  children: item.description
4787
4853
  })]
@@ -5338,189 +5404,6 @@ function LegalCompanyNameField({
5338
5404
  })
5339
5405
  });
5340
5406
  }
5341
- const Disclaimer = ({
5342
- title,
5343
- children
5344
- }) => jsxs("div", {
5345
- className: "adyen-kyc-disclaimer-container",
5346
- children: [jsx("div", {
5347
- className: "adyen-kyc-disclaimer__title",
5348
- children: title
5349
- }), jsx("div", {
5350
- className: "adyen-kyc-disclaimer__content",
5351
- children
5352
- })]
5353
- });
5354
- const PatriotActDisclosure = () => {
5355
- const {
5356
- i18n
5357
- } = useI18nContext();
5358
- return jsxs(Disclaimer, {
5359
- title: i18n.get("patriotActDisclosureTitle"),
5360
- children: [jsx("p", {
5361
- children: i18n.get("patriotActDisclosureTextParagraph1")
5362
- }), jsx("p", {
5363
- children: i18n.get("patriotActDisclosureTextParagraph2")
5364
- })]
5365
- });
5366
- };
5367
- const companyCountryValidationRules = {
5368
- country: {
5369
- modes: ["blur"],
5370
- validate: (companyCountry) => !isEmpty(companyCountry),
5371
- errorMessage: "fieldIsRequired"
5372
- },
5373
- legalCompanyName: {
5374
- modes: ["blur"],
5375
- validate: (legalCompanyName2) => !isEmpty(legalCompanyName2),
5376
- errorMessage: "fieldIsRequired"
5377
- },
5378
- countryOfGoverningLaw: {
5379
- modes: ["blur"],
5380
- validate: (countryOfGoverningLaw2) => !isEmpty(countryOfGoverningLaw2),
5381
- errorMessage: "fieldIsRequired"
5382
- }
5383
- };
5384
- const countryWithGoverningLawFields = [...LEGAL_COMPANY_NAME_FIELD, ...COUNTRY_FIELD, ...COUNTRY_OF_GOVERNING_LAW_FIELD];
5385
- const companyNameAndCountryFields = [...LEGAL_COMPANY_NAME_FIELD, ...COUNTRY_FIELD];
5386
- function CompanyNameAndCountry(props) {
5387
- const {
5388
- i18n
5389
- } = useI18nContext();
5390
- const {
5391
- isSettingEnabled
5392
- } = useSettingsContext();
5393
- const {
5394
- id: id2,
5395
- isTopLevelEntity
5396
- } = props;
5397
- const allowedCountries = useAllowedCountries();
5398
- const {
5399
- isExperimentEnabled
5400
- } = useExperimentsContext();
5401
- const {
5402
- sliceData,
5403
- updateStateSlice
5404
- } = useGlobalDataSlice(id2);
5405
- const schemaWithGoverningLaw = (sliceData == null ? void 0 : sliceData.country) === "GB" && (sliceData == null ? void 0 : sliceData.differentCountryOfGoverningLaw) ? countryWithGoverningLawFields : companyNameAndCountryFields;
5406
- const {
5407
- data: formData,
5408
- valid: formValid,
5409
- errors: formErrors,
5410
- fieldProblems: formFieldProblems,
5411
- handleChangeFor
5412
- } = useForm({
5413
- ...props,
5414
- schema: schemaWithGoverningLaw,
5415
- defaultData: props == null ? void 0 : props.data,
5416
- rules: (props == null ? void 0 : props.validators) || companyCountryValidationRules,
5417
- fieldProblems: props == null ? void 0 : props.fieldValidationErrors
5418
- });
5419
- const formUtils = formUtilities(props, i18n);
5420
- const isAllowedEditPrefilledCountry = isSettingEnabled(SettingNames.AllowPrefilledCountryEdit);
5421
- const isCountryOfGoverningLawEnabled = isExperimentEnabled("EnableCountryOfGoverningLawForUKCompanies");
5422
- const isCountryOfGoverningLawAllowed = formData.country === "GB";
5423
- const showCountryOfGoverningLaw = isCountryOfGoverningLawEnabled && isCountryOfGoverningLawAllowed;
5424
- useEffect(() => {
5425
- updateStateSlice == null ? void 0 : updateStateSlice({
5426
- data: {
5427
- ...sliceData,
5428
- ...formData
5429
- },
5430
- errors: formErrors,
5431
- valid: formValid,
5432
- fieldProblems: formFieldProblems
5433
- });
5434
- }, [formData, formErrors, formFieldProblems, formValid, updateStateSlice]);
5435
- const handleChangeForCountries = (key) => (e) => {
5436
- handleChangeFor(key)(e);
5437
- if (!formData.differentCountryOfGoverningLaw && e.target.value === "GB") {
5438
- const countryOfGoverningLawEvent = {
5439
- target: {
5440
- name: "countryOfGoverningLaw",
5441
- value: e.target.value
5442
- }
5443
- };
5444
- handleChangeFor("countryOfGoverningLaw")(countryOfGoverningLawEvent);
5445
- }
5446
- };
5447
- return jsxs("form", {
5448
- children: [jsx(FormHeader, {
5449
- heading: props == null ? void 0 : props.heading
5450
- }), jsx(ErrorPanel, {
5451
- verificationErrors: props == null ? void 0 : props.formVerificationErrors,
5452
- validationErrors: props == null ? void 0 : props.fieldValidationErrors,
5453
- formUtils,
5454
- id: "ariaErrorField"
5455
- }), formData.country === "US" ? jsx(PatriotActDisclosure, {}) : void 0, formUtils.isRequiredField("legalCompanyName") && jsx(LegalCompanyNameField, {
5456
- data: formUtils.getFieldData(formData, LEGAL_COMPANY_NAME_FIELD),
5457
- valid: formUtils.getFieldValid(formValid, LEGAL_COMPANY_NAME_FIELD),
5458
- errors: formUtils.getFieldErrors(formErrors, formFieldProblems, LEGAL_COMPANY_NAME_FIELD),
5459
- labels: formUtils.getFieldLabels(LEGAL_COMPANY_NAME_FIELD),
5460
- helperText: formUtils.getFieldHelperText(LEGAL_COMPANY_NAME_FIELD, {
5461
- legalCompanyName: "legalCompanyName__helperText"
5462
- }),
5463
- readonly: formUtils.isReadOnly("legalCompanyName"),
5464
- handleChangeFor
5465
- }), formUtils.isRequiredField("country") && jsx(CountryField, {
5466
- data: formUtils.getFieldData(formData, COUNTRY_FIELD),
5467
- valid: formUtils.getFieldValid(formValid, COUNTRY_FIELD),
5468
- errors: formUtils.getFieldErrors(formErrors, formFieldProblems, COUNTRY_FIELD),
5469
- labels: formUtils.getFieldLabels(COUNTRY_FIELD, {
5470
- country: "countryRegionOfEstablishment"
5471
- }),
5472
- readonly: !isAllowedEditPrefilledCountry || Boolean(props == null ? void 0 : props.disableCountry),
5473
- classNameModifiers: ["country"],
5474
- allowedCountries: isTopLevelEntity ? allowedCountries : void 0,
5475
- handleChangeFor: handleChangeForCountries
5476
- }), showCountryOfGoverningLaw && jsx(CountryOfGoverningLawField, {
5477
- data: formUtils.getFieldData(formData, COUNTRY_OF_GOVERNING_LAW_FIELD),
5478
- valid: formUtils.getFieldValid(formValid, COUNTRY_OF_GOVERNING_LAW_FIELD),
5479
- errors: formUtils.getFieldErrors(formErrors, formFieldProblems, COUNTRY_OF_GOVERNING_LAW_FIELD),
5480
- labels: formUtils.getFieldLabels(COUNTRY_OF_GOVERNING_LAW_FIELD),
5481
- readonly: false,
5482
- classNameModifiers: ["country"],
5483
- allowedCountries: isTopLevelEntity ? allowedCountries : void 0,
5484
- handleChangeFor
5485
- })]
5486
- });
5487
- }
5488
- const CompanyNameAndCountryComponent = memo(CompanyNameAndCountry, (prevProps, nextProps) => {
5489
- var _a, _b;
5490
- return objectsDeepEqual(prevProps.requiredFields, nextProps.requiredFields) && objectsDeepEqual(prevProps.optionalFields, nextProps.optionalFields) && objectsDeepEqual(prevProps.data, nextProps.data) && objectsDeepEqual(prevProps.formVerificationErrors, nextProps.formVerificationErrors) && objectsDeepEqual(prevProps.fieldValidationErrors, nextProps.fieldValidationErrors) && ((_a = prevProps.data) == null ? void 0 : _a.country) === ((_b = nextProps.data) == null ? void 0 : _b.country) && prevProps.shouldValidate === nextProps.shouldValidate;
5491
- });
5492
- function StateContextSetter({
5493
- stateRef
5494
- }) {
5495
- if (stateRef.current.setState) {
5496
- return null;
5497
- }
5498
- return jsx(StateContext.Consumer, {
5499
- children: (stateContextValue) => {
5500
- if (!stateContextValue) {
5501
- throw new Error("<StateContextSetter> needs to be mounted inside a <StateProvider>");
5502
- }
5503
- const {
5504
- dispatch,
5505
- setActiveForms
5506
- } = stateContextValue;
5507
- stateRef.current.setState = dispatch;
5508
- stateRef.current.setActiveForms = setActiveForms;
5509
- return null;
5510
- }
5511
- });
5512
- }
5513
- var CompanyTypesValue = /* @__PURE__ */ ((CompanyTypesValue2) => {
5514
- CompanyTypesValue2["PRIVATE_COMPANY"] = "privateCompany";
5515
- CompanyTypesValue2["PUBLIC_COMPANY"] = "listedPublicCompany";
5516
- CompanyTypesValue2["UNLISTED_PUBLIC_COMPANY"] = "unlistedPublicCompany";
5517
- CompanyTypesValue2["INCORPORATED_PARTNERSHIP"] = "partnershipIncorporated";
5518
- CompanyTypesValue2["INCORPORATED_ASSOCIATION"] = "associationIncorporated";
5519
- CompanyTypesValue2["GOVERNMENTAL_ORGANIZATION"] = "governmentalOrganization";
5520
- CompanyTypesValue2["NON_PROFIT_OR_CHARITABLE"] = "nonProfit";
5521
- CompanyTypesValue2["SOLE_PROPRIETORSHIP"] = "soleProprietorship";
5522
- return CompanyTypesValue2;
5523
- })(CompanyTypesValue || {});
5524
5407
  var CountryCodes = /* @__PURE__ */ ((CountryCodes2) => {
5525
5408
  CountryCodes2["Afghanistan"] = "AF";
5526
5409
  CountryCodes2["AlandIslands"] = "AX";
@@ -5770,15 +5653,232 @@ var CountryCodes = /* @__PURE__ */ ((CountryCodes2) => {
5770
5653
  CountryCodes2["Zimbabwe"] = "ZW";
5771
5654
  return CountryCodes2;
5772
5655
  })(CountryCodes || {});
5773
- const resolveFieldMetadata = (countryEntry, params, defaultMetadata) => {
5774
- if (typeof countryEntry === "object") {
5775
- return countryEntry;
5776
- }
5777
- if (typeof countryEntry === "function") {
5778
- return countryEntry(params);
5656
+ const validateNotEmptyOnBlur = {
5657
+ modes: ["blur"],
5658
+ validate: (val) => !isEmpty(val),
5659
+ errorMessage: "fieldIsRequired"
5660
+ };
5661
+ const validatePatternOnBlur = (pattern) => ({
5662
+ modes: ["blur"],
5663
+ validate: (val) => !!val && pattern.test(val)
5664
+ });
5665
+ const defaultFieldMetadata$a = {
5666
+ label: "legalCompanyName",
5667
+ helperText: "legalCompanyName__helperText",
5668
+ validators: validateNotEmptyOnBlur
5669
+ };
5670
+ const defaultFieldConfig$a = {
5671
+ [CountryCodes.Australia]: {
5672
+ label: "legalCompanyName",
5673
+ helperText: "legalCompanyName__helperText__AU",
5674
+ validators: validateNotEmptyOnBlur
5675
+ },
5676
+ [CountryCodes.HongKong]: {
5677
+ label: "legalCompanyName",
5678
+ helperText: "legalCompanyName__helperText__HK",
5679
+ validators: validateNotEmptyOnBlur
5680
+ },
5681
+ [CountryCodes.Netherlands]: {
5682
+ label: "legalCompanyName",
5683
+ helperText: "legalCompanyName__helperText__NL",
5684
+ validators: validateNotEmptyOnBlur
5685
+ },
5686
+ [CountryCodes.Singapore]: {
5687
+ label: "legalCompanyName",
5688
+ helperText: "legalCompanyName__helperText__SG",
5689
+ validators: validateNotEmptyOnBlur
5690
+ },
5691
+ [CountryCodes.UnitedStates]: ({
5692
+ isBusiness
5693
+ }) => ({
5694
+ label: "legalCompanyName__US",
5695
+ helperText: isBusiness ? "legalCompanyName__helperText__US__business" : "legalCompanyName__helperText__US",
5696
+ validators: validateNotEmptyOnBlur
5697
+ })
5698
+ };
5699
+ const Disclaimer = ({
5700
+ title,
5701
+ children
5702
+ }) => jsxs("div", {
5703
+ className: "adyen-kyc-disclaimer-container",
5704
+ children: [jsx("div", {
5705
+ className: "adyen-kyc-disclaimer__title",
5706
+ children: title
5707
+ }), jsx("div", {
5708
+ className: "adyen-kyc-disclaimer__content",
5709
+ children
5710
+ })]
5711
+ });
5712
+ const PatriotActDisclosure = () => {
5713
+ const {
5714
+ i18n
5715
+ } = useI18nContext();
5716
+ return jsxs(Disclaimer, {
5717
+ title: i18n.get("patriotActDisclosureTitle"),
5718
+ children: [jsx("p", {
5719
+ children: i18n.get("patriotActDisclosureTextParagraph1")
5720
+ }), jsx("p", {
5721
+ children: i18n.get("patriotActDisclosureTextParagraph2")
5722
+ })]
5723
+ });
5724
+ };
5725
+ const companyCountryValidationRules = {
5726
+ country: {
5727
+ modes: ["blur"],
5728
+ validate: (companyCountry) => !isEmpty(companyCountry),
5729
+ errorMessage: "fieldIsRequired"
5730
+ },
5731
+ legalCompanyName: {
5732
+ modes: ["blur"],
5733
+ validate: (legalCompanyName2) => !isEmpty(legalCompanyName2),
5734
+ errorMessage: "fieldIsRequired"
5735
+ },
5736
+ countryOfGoverningLaw: {
5737
+ modes: ["blur"],
5738
+ validate: (countryOfGoverningLaw2) => !isEmpty(countryOfGoverningLaw2),
5739
+ errorMessage: "fieldIsRequired"
5779
5740
  }
5780
- return defaultMetadata;
5781
5741
  };
5742
+ const countryWithGoverningLawFields = [...LEGAL_COMPANY_NAME_FIELD, ...COUNTRY_FIELD, ...COUNTRY_OF_GOVERNING_LAW_FIELD];
5743
+ const companyNameAndCountryFields = [...LEGAL_COMPANY_NAME_FIELD, ...COUNTRY_FIELD];
5744
+ function CompanyNameAndCountry(props) {
5745
+ const {
5746
+ i18n
5747
+ } = useI18nContext();
5748
+ const {
5749
+ isSettingEnabled
5750
+ } = useSettingsContext();
5751
+ const allowedCountries = useAllowedCountries();
5752
+ const {
5753
+ isExperimentEnabled
5754
+ } = useExperimentsContext();
5755
+ const {
5756
+ sliceData,
5757
+ updateStateSlice
5758
+ } = useGlobalDataSlice(props.id);
5759
+ let mergedProps = props;
5760
+ mergedProps = mergeFieldMetadataIntoProps("legalCompanyName", resolveFieldMetadata(defaultFieldConfig$a[sliceData == null ? void 0 : sliceData.country], {
5761
+ isBusiness: false
5762
+ }, defaultFieldMetadata$a), mergedProps);
5763
+ const schemaWithGoverningLaw = (sliceData == null ? void 0 : sliceData.country) === "GB" && (sliceData == null ? void 0 : sliceData.differentCountryOfGoverningLaw) ? countryWithGoverningLawFields : companyNameAndCountryFields;
5764
+ const {
5765
+ data: formData,
5766
+ valid: formValid,
5767
+ errors: formErrors,
5768
+ fieldProblems: formFieldProblems,
5769
+ handleChangeFor
5770
+ } = useForm({
5771
+ ...mergedProps,
5772
+ schema: schemaWithGoverningLaw,
5773
+ defaultData: mergedProps == null ? void 0 : mergedProps.data,
5774
+ rules: (mergedProps == null ? void 0 : mergedProps.validators) || companyCountryValidationRules,
5775
+ fieldProblems: mergedProps == null ? void 0 : mergedProps.fieldValidationErrors
5776
+ });
5777
+ const formUtils = formUtilities(mergedProps, i18n);
5778
+ const isAllowedEditPrefilledCountry = isSettingEnabled(SettingNames.AllowPrefilledCountryEdit);
5779
+ const isCountryOfGoverningLawEnabled = isExperimentEnabled("EnableCountryOfGoverningLawForUKCompanies");
5780
+ const isCountryOfGoverningLawAllowed = formData.country === "GB";
5781
+ const showCountryOfGoverningLaw = isCountryOfGoverningLawEnabled && isCountryOfGoverningLawAllowed;
5782
+ useEffect(() => {
5783
+ updateStateSlice == null ? void 0 : updateStateSlice({
5784
+ data: {
5785
+ ...sliceData,
5786
+ ...formData
5787
+ },
5788
+ errors: formErrors,
5789
+ valid: formValid,
5790
+ fieldProblems: formFieldProblems
5791
+ });
5792
+ }, [formData, formErrors, formFieldProblems, formValid, updateStateSlice]);
5793
+ const handleChangeForCountries = (key) => (e) => {
5794
+ handleChangeFor(key)(e);
5795
+ if (!formData.differentCountryOfGoverningLaw && e.target.value === "GB") {
5796
+ const countryOfGoverningLawEvent = {
5797
+ target: {
5798
+ name: "countryOfGoverningLaw",
5799
+ value: e.target.value
5800
+ }
5801
+ };
5802
+ handleChangeFor("countryOfGoverningLaw")(countryOfGoverningLawEvent);
5803
+ }
5804
+ };
5805
+ return jsxs("form", {
5806
+ children: [jsx(FormHeader, {
5807
+ heading: props == null ? void 0 : props.heading
5808
+ }), jsx(ErrorPanel, {
5809
+ verificationErrors: props == null ? void 0 : props.formVerificationErrors,
5810
+ validationErrors: props == null ? void 0 : props.fieldValidationErrors,
5811
+ formUtils,
5812
+ id: "ariaErrorField"
5813
+ }), formData.country === "US" ? jsx(PatriotActDisclosure, {}) : void 0, formUtils.isRequiredField("legalCompanyName") && jsx(LegalCompanyNameField, {
5814
+ data: formUtils.getFieldData(formData, LEGAL_COMPANY_NAME_FIELD),
5815
+ valid: formUtils.getFieldValid(formValid, LEGAL_COMPANY_NAME_FIELD),
5816
+ errors: formUtils.getFieldErrors(formErrors, formFieldProblems, LEGAL_COMPANY_NAME_FIELD),
5817
+ labels: formUtils.getFieldLabels(LEGAL_COMPANY_NAME_FIELD),
5818
+ helperText: formUtils.getFieldHelperText(LEGAL_COMPANY_NAME_FIELD, {
5819
+ legalCompanyName: "legalCompanyName__helperText"
5820
+ }),
5821
+ readonly: formUtils.isReadOnly("legalCompanyName"),
5822
+ handleChangeFor
5823
+ }), formUtils.isRequiredField("country") && jsx(CountryField, {
5824
+ data: formUtils.getFieldData(formData, COUNTRY_FIELD),
5825
+ valid: formUtils.getFieldValid(formValid, COUNTRY_FIELD),
5826
+ errors: formUtils.getFieldErrors(formErrors, formFieldProblems, COUNTRY_FIELD),
5827
+ labels: formUtils.getFieldLabels(COUNTRY_FIELD, {
5828
+ country: "countryRegionOfEstablishment"
5829
+ }),
5830
+ readonly: formUtils.isReadOnly("country") || !isAllowedEditPrefilledCountry || Boolean(props == null ? void 0 : props.disableCountry),
5831
+ classNameModifiers: ["country"],
5832
+ allowedCountries: mergedProps.isTopLevelEntity ? allowedCountries : void 0,
5833
+ handleChangeFor: handleChangeForCountries
5834
+ }), showCountryOfGoverningLaw && jsx(CountryOfGoverningLawField, {
5835
+ data: formUtils.getFieldData(formData, COUNTRY_OF_GOVERNING_LAW_FIELD),
5836
+ valid: formUtils.getFieldValid(formValid, COUNTRY_OF_GOVERNING_LAW_FIELD),
5837
+ errors: formUtils.getFieldErrors(formErrors, formFieldProblems, COUNTRY_OF_GOVERNING_LAW_FIELD),
5838
+ labels: formUtils.getFieldLabels(COUNTRY_OF_GOVERNING_LAW_FIELD),
5839
+ readonly: false,
5840
+ classNameModifiers: ["country"],
5841
+ allowedCountries: mergedProps.isTopLevelEntity ? allowedCountries : void 0,
5842
+ handleChangeFor
5843
+ })]
5844
+ });
5845
+ }
5846
+ const CompanyNameAndCountryComponent = memo(CompanyNameAndCountry, (prevProps, nextProps) => {
5847
+ var _a, _b;
5848
+ return objectsDeepEqual(prevProps.requiredFields, nextProps.requiredFields) && objectsDeepEqual(prevProps.optionalFields, nextProps.optionalFields) && objectsDeepEqual(prevProps.data, nextProps.data) && objectsDeepEqual(prevProps.formVerificationErrors, nextProps.formVerificationErrors) && objectsDeepEqual(prevProps.fieldValidationErrors, nextProps.fieldValidationErrors) && ((_a = prevProps.data) == null ? void 0 : _a.country) === ((_b = nextProps.data) == null ? void 0 : _b.country) && prevProps.shouldValidate === nextProps.shouldValidate;
5849
+ });
5850
+ function StateContextSetter({
5851
+ stateRef
5852
+ }) {
5853
+ if (stateRef.current.setState) {
5854
+ return null;
5855
+ }
5856
+ return jsx(StateContext.Consumer, {
5857
+ children: (stateContextValue) => {
5858
+ if (!stateContextValue) {
5859
+ throw new Error("<StateContextSetter> needs to be mounted inside a <StateProvider>");
5860
+ }
5861
+ const {
5862
+ dispatch,
5863
+ setActiveForms
5864
+ } = stateContextValue;
5865
+ stateRef.current.setState = dispatch;
5866
+ stateRef.current.setActiveForms = setActiveForms;
5867
+ return null;
5868
+ }
5869
+ });
5870
+ }
5871
+ var CompanyTypesValue = /* @__PURE__ */ ((CompanyTypesValue2) => {
5872
+ CompanyTypesValue2["PRIVATE_COMPANY"] = "privateCompany";
5873
+ CompanyTypesValue2["PUBLIC_COMPANY"] = "listedPublicCompany";
5874
+ CompanyTypesValue2["UNLISTED_PUBLIC_COMPANY"] = "unlistedPublicCompany";
5875
+ CompanyTypesValue2["INCORPORATED_PARTNERSHIP"] = "partnershipIncorporated";
5876
+ CompanyTypesValue2["INCORPORATED_ASSOCIATION"] = "associationIncorporated";
5877
+ CompanyTypesValue2["GOVERNMENTAL_ORGANIZATION"] = "governmentalOrganization";
5878
+ CompanyTypesValue2["NON_PROFIT_OR_CHARITABLE"] = "nonProfit";
5879
+ CompanyTypesValue2["SOLE_PROPRIETORSHIP"] = "soleProprietorship";
5880
+ return CompanyTypesValue2;
5881
+ })(CompanyTypesValue || {});
5782
5882
  const cachedStripPatterns = /* @__PURE__ */ new Map();
5783
5883
  const makeStripPattern = (mask) => {
5784
5884
  const inputPatterns = mask.tokens.filter((token) => token.type === "input" && !!token.allow).map((token) => token.allow);
@@ -7668,15 +7768,6 @@ const PassportNumberPatterns = {
7668
7768
  const ProofOfIdentityCardPatterns = {
7669
7769
  [CountryCodes.HongKong]: /^[A-Z]{1,2}[0-9]{6}[0-9A]$/
7670
7770
  };
7671
- const validateNotEmptyOnBlur = {
7672
- modes: ["blur"],
7673
- validate: (val) => !isEmpty(val),
7674
- errorMessage: "fieldIsRequired"
7675
- };
7676
- const validatePatternOnBlur = (pattern) => ({
7677
- modes: ["blur"],
7678
- validate: (val) => !!val && pattern.test(val)
7679
- });
7680
7771
  const defaultFieldMetadata$9 = {
7681
7772
  label: "registrationNumber"
7682
7773
  };
@@ -8388,7 +8479,8 @@ function BusinessRegistrationNumber(props) {
8388
8479
  registrationNumberType
8389
8480
  }, defaultFieldMetadata$9);
8390
8481
  const mergedProps = mergeFieldMetadataIntoProps("registrationNumber", metadata, {
8391
- requiredFields: schema
8482
+ requiredFields: schema,
8483
+ readOnlyFields: props.readOnlyFields
8392
8484
  });
8393
8485
  const {
8394
8486
  handleChangeFor,
@@ -10707,9 +10799,6 @@ const businessDetailsFieldsPerScenario = {
10707
10799
  };
10708
10800
  const countryConfig$3 = {
10709
10801
  [CountryCodes.Australia]: {
10710
- legalCompanyName: {
10711
- helperText: "legalCompanyName__helperText__AU"
10712
- },
10713
10802
  legalEntityType: {
10714
10803
  label: "companyType"
10715
10804
  }
@@ -10762,9 +10851,6 @@ const countryConfig$3 = {
10762
10851
  [CountryCodes.Gibraltar]: {},
10763
10852
  [CountryCodes.Guernsey]: {},
10764
10853
  [CountryCodes.HongKong]: {
10765
- legalCompanyName: {
10766
- helperText: "legalCompanyName__helperText__HK"
10767
- },
10768
10854
  legalEntityType: {
10769
10855
  label: "typeOfCompany"
10770
10856
  },
@@ -10818,9 +10904,6 @@ const countryConfig$3 = {
10818
10904
  },
10819
10905
  [CountryCodes.Monaco]: {},
10820
10906
  [CountryCodes.Netherlands]: {
10821
- legalCompanyName: {
10822
- helperText: "legalCompanyName__helperText__NL"
10823
- },
10824
10907
  vatAbsenceReason: {
10825
10908
  label: "vatAbsenceReason"
10826
10909
  }
@@ -10856,9 +10939,6 @@ const countryConfig$3 = {
10856
10939
  country: {
10857
10940
  label: "country__US__business"
10858
10941
  },
10859
- legalCompanyName: {
10860
- helperText: "legalCompanyName__helperText__US"
10861
- },
10862
10942
  tradingName: {
10863
10943
  label: "doingBusinessAs"
10864
10944
  },
@@ -10878,9 +10958,6 @@ const countryConfig$3 = {
10878
10958
  registrationNumber: {
10879
10959
  label: "uen"
10880
10960
  },
10881
- legalCompanyName: {
10882
- helperText: "legalCompanyName__helperText__SG"
10883
- },
10884
10961
  legalEntityType: {
10885
10962
  label: "companyType"
10886
10963
  },
@@ -10909,10 +10986,6 @@ const countryConfig$3 = {
10909
10986
  stateOrProvince: {
10910
10987
  label: "stateOrProvince__US__business"
10911
10988
  },
10912
- legalCompanyName: {
10913
- label: "legalCompanyName__US",
10914
- helperText: "legalCompanyName__helperText__US"
10915
- },
10916
10989
  tradingName: {
10917
10990
  label: "doingBusinessAs"
10918
10991
  },
@@ -11373,7 +11446,7 @@ function isEmptyEntity(legalEntity) {
11373
11446
  const sortedFieldsOnEntity = fieldsOnEntity.toSorted();
11374
11447
  return sortedFieldsOnEntity.every((value, index) => value === sortedMinimumFields[index]);
11375
11448
  }
11376
- const capabilitiesToPreventTypeChange = ["receivePayments", "issueCard", "useCard", "withdrawFromAtm", "withdrawFromAtmInRestrictedCountries", "receiveFromTransferInstrument", "useCardInRestrictedCountries", "useCardInRestrictedIndustries", "issueBankAccount", "sendToThirdParty", "receiveFromThirdParty", "getGrantOffers", "receiveGrants"];
11449
+ const capabilitiesToPreventTypeChange = ["receivePayments", "issueCard", "useCard", "withdrawFromAtm", "withdrawFromAtmInRestrictedCountries", "useCardInRestrictedCountries", "useCardInRestrictedIndustries", "issueBankAccount", "sendToThirdParty", "receiveFromThirdParty", "getGrantOffers", "receiveGrants"];
11377
11450
  const entityTypeToCorrespondingAccountHolderOption = {
11378
11451
  [LegalEntityType.INDIVIDUAL]: "myName",
11379
11452
  [LegalEntityType.ORGANIZATION]: "theCompanyIWorkFor",
@@ -12456,7 +12529,8 @@ function FieldContainer(props) {
12456
12529
  trimOnBlur,
12457
12530
  hideField,
12458
12531
  maxlength,
12459
- handleChangeFor
12532
+ handleChangeFor,
12533
+ readOnly
12460
12534
  } = props;
12461
12535
  const formUtils = formUtilities(props, i18n);
12462
12536
  const errorMessage = formUtils.getErrorMessage(fieldName, errors, fieldProblems);
@@ -12478,7 +12552,7 @@ function FieldContainer(props) {
12478
12552
  labels: {
12479
12553
  country: formUtils.getLabel(field)
12480
12554
  },
12481
- readonly: formUtils.isReadOnly(field),
12555
+ readonly: readOnly,
12482
12556
  classNameModifiers,
12483
12557
  className: hideField ? "adyen-kyc-u-display-none" : "",
12484
12558
  handleChangeFor
@@ -12497,7 +12571,7 @@ function FieldContainer(props) {
12497
12571
  labels: {
12498
12572
  stateOrProvince: formUtils.getLabel(field)
12499
12573
  },
12500
- readonly: formUtils.isReadOnly(field),
12574
+ readonly: readOnly,
12501
12575
  classNameModifiers,
12502
12576
  selectedCountry: data.country,
12503
12577
  handleChangeFor
@@ -12520,7 +12594,8 @@ function FieldContainer(props) {
12520
12594
  "aria-required": true,
12521
12595
  "aria-label": props == null ? void 0 : props["aria-label"],
12522
12596
  "aria-invalid": !valid[field],
12523
- trimOnBlur
12597
+ trimOnBlur,
12598
+ readonly: readOnly
12524
12599
  })
12525
12600
  });
12526
12601
  }
@@ -13369,7 +13444,7 @@ function RegistrationAddressComponent(props) {
13369
13444
  readOnlyFields: registrationAddressReadOnlyFields,
13370
13445
  obscuredFields: registrationAddressObscuredFields,
13371
13446
  verifyFields: registrationAddressVerifyFields
13372
- } = getFormProps(props, props.id);
13447
+ } = getFormProps(props, registrationAddressFormID);
13373
13448
  const {
13374
13449
  data: formData,
13375
13450
  valid: formValid,
@@ -13567,29 +13642,15 @@ const GuidanceContent$1 = ({
13567
13642
  })
13568
13643
  })]
13569
13644
  })]
13570
- }) : jsxs(Fragment, {
13571
- children: [jsxs("div", {
13572
- className: "adyen-kyc-u-margin-bottom-24",
13573
- children: [jsxs("strong", {
13574
- children: [" ", i18n.get("requirements")]
13575
- }), jsxs(List, {
13576
- className: "adyen-kyc-upload-field__requirements",
13577
- children: [jsx(ListItem, {
13578
- children: i18n.get("documentIssuedByGovernmentAuthority")
13579
- }), jsx(ListItem, {
13580
- children: i18n.get("dateOnDocumentNoOlderThanXMonths", {
13581
- values: {
13582
- numberOfMonths: 12
13583
- }
13584
- })
13585
- })]
13586
- })]
13587
- }), jsx(ContextGuidance, {
13588
- page: "Company registration document",
13589
- titleId: "whatIfDocumentIsMoreThan12MonthsOld",
13590
- contentId: "ifDocumentMoreThan12months",
13591
- title: i18n.get("whatIfDocumentIsMoreThan12MonthsOld"),
13592
- content: i18n.get("ifDocumentMoreThan12months")
13645
+ }) : jsxs("div", {
13646
+ className: "adyen-kyc-u-margin-bottom-24",
13647
+ children: [jsxs("strong", {
13648
+ children: [" ", i18n.get("documentRequirements")]
13649
+ }), jsx(List, {
13650
+ className: "adyen-kyc-upload-field__requirements",
13651
+ children: jsx(ListItem, {
13652
+ children: i18n.get("documentIssuedByGovernmentAuthority")
13653
+ })
13593
13654
  })]
13594
13655
  })
13595
13656
  });
@@ -13704,9 +13765,9 @@ const GuidanceContent = ({
13704
13765
  })]
13705
13766
  }) : jsxs("div", {
13706
13767
  className: "adyen-kyc-u-margin-bottom-24",
13707
- children: [jsxs("div", {
13768
+ children: [jsx("div", {
13708
13769
  className: "adyen-kyc-upload-field__subtitle",
13709
- children: [" ", i18n.get("requirements")]
13770
+ children: i18n.get("documentRequirements")
13710
13771
  }), jsxs(List, {
13711
13772
  className: "adyen-kyc-upload-field__requirements",
13712
13773
  children: [jsx(ListItem, {
@@ -14291,7 +14352,7 @@ const mandatoryApiFields = {
14291
14352
  ORGANIZATION: ["companyNameAndCountry.legalCompanyName", "companyNameAndCountry.country"],
14292
14353
  SOLE_PROPRIETORSHIP: ["solePropNameAndCountry.legalCompanyName", "solePropNameAndCountry.country"],
14293
14354
  TRUST: ["trustRegistrationDetails.legalName", "trustRegistrationDetails.country"],
14294
- HIGH_EXPOSURE: ["company.numberOfEmployees", "parentCompany.numberOfEmployees", "ultimateParentCompany.numberOfEmployees"]
14355
+ HIGH_EXPOSURE: ["company.numberOfEmployees", "parentCompany.parentNumberOfEmployees", "ultimateParentCompany.ultimateParentNumberOfEmployees"]
14295
14356
  };
14296
14357
  const individualObscuredFields = ["personalDetails.idNumber", "personalDetails.idNumberExempt"];
14297
14358
  const individualBaseMapping = {
@@ -16808,60 +16869,60 @@ const roleMetadata = {
16808
16869
  [DecisionMakerType.CONTROLLING_PERSON]: {
16809
16870
  name: "controllingPerson",
16810
16871
  description: "controllingPersonDescription",
16811
- className: "adyen-kyc-tag--teal"
16872
+ variant: "teal"
16812
16873
  },
16813
16874
  [DecisionMakerType.OWNER]: {
16814
16875
  name: "owner",
16815
16876
  description: "ownerDescription",
16816
- className: "adyen-kyc-tag--purple"
16877
+ variant: "red"
16817
16878
  },
16818
16879
  [DecisionMakerType.SIGNATORY]: {
16819
16880
  name: "signatory",
16820
16881
  description: "signatoryDescription",
16821
- className: "adyen-kyc-tag--light-blue"
16882
+ variant: "green"
16822
16883
  },
16823
16884
  [DecisionMakerType.DIRECTOR]: {
16824
16885
  name: "director",
16825
16886
  description: "directorDescription",
16826
- className: "adyen-kyc-tag--orange"
16887
+ variant: "orange"
16827
16888
  },
16828
16889
  [TrustMemberTypes.DEFINED_BENEFICIARY]: {
16829
16890
  name: "definedBeneficiary",
16830
16891
  description: "definedBeneficiaryDescription",
16831
- className: "adyen-kyc-tag--orange"
16892
+ variant: "orange"
16832
16893
  },
16833
16894
  [TrustMemberTypes.UNDEFINED_BENEFICIARY]: {
16834
16895
  name: "undefinedBeneficiary",
16835
16896
  description: "undefinedBeneficiaryDescription",
16836
- className: "adyen-kyc-tag--orange"
16897
+ variant: "orange"
16837
16898
  },
16838
16899
  [TrustMemberTypes.PROTECTOR]: {
16839
16900
  name: "protector",
16840
16901
  description: "personAppointmentUnderTrustInstrument",
16841
- className: "adyen-kyc-tag--orange"
16902
+ variant: "orange"
16842
16903
  },
16843
16904
  [TrustMemberTypes.TRUSTEE]: {
16844
16905
  name: "trustee",
16845
16906
  description: "legalOwnerOfProperty",
16846
- className: "adyen-kyc-tag--light-blue"
16907
+ variant: "green"
16847
16908
  },
16848
16909
  [TrustMemberTypes.SETTLOR]: {
16849
16910
  name: "settlor",
16850
16911
  description: "entityEstablishingTrust",
16851
- className: "adyen-kyc-tag--orange"
16912
+ variant: "orange"
16852
16913
  },
16853
16914
  [TrustMemberGuidanceLabel.BENEFICIARY]: {
16854
16915
  name: TrustMemberGuidanceLabel.BENEFICIARY,
16855
- className: "adyen-kyc-tag--orange"
16916
+ variant: "orange"
16856
16917
  },
16857
16918
  [TrustMemberGuidanceLabel.TRUSTEE]: {
16858
16919
  name: TrustMemberGuidanceLabel.TRUSTEE,
16859
- className: "adyen-kyc-tag--light-blue"
16920
+ variant: "green"
16860
16921
  }
16861
16922
  };
16862
- const getRoleTagColor = (role2) => {
16923
+ const getRoleTagVariant = (role2) => {
16863
16924
  var _a;
16864
- return ((_a = roleMetadata[role2]) == null ? void 0 : _a.className) ?? "adyen-kyc-tag--blue";
16925
+ return ((_a = roleMetadata[role2]) == null ? void 0 : _a.variant) ?? "blue";
16865
16926
  };
16866
16927
  const getRoleName = (role2) => {
16867
16928
  var _a;
@@ -16873,13 +16934,13 @@ const makeSelectItemForRole = (role2, i18n) => {
16873
16934
  const {
16874
16935
  name,
16875
16936
  description: description2,
16876
- className
16937
+ variant
16877
16938
  } = metadata;
16878
16939
  return {
16879
16940
  id: role2,
16880
16941
  name: i18n.get(name),
16881
16942
  description: description2 ? i18n.get(description2) : void 0,
16882
- className
16943
+ className: `adyen-kyc-tag--${variant}`
16883
16944
  };
16884
16945
  };
16885
16946
  const handleKeys = (keys, callback, propagationMode = "stopIfMatches") => (event) => {
@@ -21881,7 +21942,7 @@ const trustRegistrationDetailsValidations = {
21881
21942
  },
21882
21943
  legalName: {
21883
21944
  modes: ["blur"],
21884
- validate: (legalName) => !!legalName,
21945
+ validate: (legalName2) => !!legalName2,
21885
21946
  errorMessage: "fieldIsRequired"
21886
21947
  },
21887
21948
  objectOfTrust: {
@@ -22748,55 +22809,6 @@ function ErrorPanel({
22748
22809
  })]
22749
22810
  });
22750
22811
  }
22751
- const headingTypes = {
22752
- 1: ({
22753
- children,
22754
- className
22755
- }) => jsx("h1", {
22756
- className,
22757
- children
22758
- }),
22759
- 2: ({
22760
- children,
22761
- className
22762
- }) => jsx("h2", {
22763
- className,
22764
- children
22765
- }),
22766
- 3: ({
22767
- children,
22768
- className
22769
- }) => jsx("h3", {
22770
- className,
22771
- children
22772
- }),
22773
- 4: ({
22774
- children,
22775
- className
22776
- }) => jsx("h4", {
22777
- className,
22778
- children
22779
- }),
22780
- sub: ({
22781
- children,
22782
- className
22783
- }) => jsx("div", {
22784
- className,
22785
- children
22786
- })
22787
- };
22788
- function Heading({
22789
- className,
22790
- level,
22791
- children
22792
- }) {
22793
- const HeadingElement = headingTypes[level] || headingTypes[1];
22794
- const classNames = cx("adyen-kyc-heading", `adyen-kyc-heading--${level}`, className);
22795
- return jsx(HeadingElement, {
22796
- className: classNames,
22797
- children
22798
- });
22799
- }
22800
22812
  const summaryStep = {
22801
22813
  formId: "summary",
22802
22814
  formName: "summary"
@@ -22836,8 +22848,9 @@ function Summary({
22836
22848
  }, i18n);
22837
22849
  const summarySectionHeader = (formName, formId) => jsxs("header", {
22838
22850
  className: "adyen-kyc-summary-section__header",
22839
- children: [jsx(Heading, {
22840
- level: 4,
22851
+ children: [jsx(Typography, {
22852
+ el: "h4",
22853
+ variant: "title",
22841
22854
  className: "adyen-kyc-summary-section__heading",
22842
22855
  children: formName
22843
22856
  }), jsx(Button, {
@@ -22919,9 +22932,9 @@ function Summary({
22919
22932
  return jsxs("div", {
22920
22933
  role: "region",
22921
22934
  className: "adyen-kyc-summary",
22922
- children: [jsx("h2", {
22923
- className: "adyen-kyc-summary__heading",
22924
- children: i18n.get("summary")
22935
+ children: [jsx(FormHeader, {
22936
+ heading: i18n.get("summary"),
22937
+ classNames: "adyen-kyc-summary__heading"
22925
22938
  }), jsx(ErrorPanel, {
22926
22939
  validationErrors: allValidationErrors,
22927
22940
  verificationErrors: allVerificationErrors,
@@ -24018,13 +24031,6 @@ const dbaNameFieldMetadata = {
24018
24031
  label: "dbaName",
24019
24032
  validators: validateNotEmptyOnBlur
24020
24033
  };
24021
- const LegalCompanyNameFieldValidation = () => ({
24022
- legalCompanyName: {
24023
- modes: ["blur"],
24024
- validate: (legalCompanyName2) => !isEmpty(legalCompanyName2),
24025
- errorMessage: "fieldIsRequired"
24026
- }
24027
- });
24028
24034
  const TAX_INFORMATION_FIELD = ["taxInformation", "exemptedFromTax", "isUen"];
24029
24035
  function TaxInformationField({
24030
24036
  data,
@@ -24381,13 +24387,9 @@ function AdditionalInformationComponent({
24381
24387
  return (_a2 = initialFormUtilsProps.allFields) == null ? void 0 : _a2.reduce((acc, field) => {
24382
24388
  switch (field) {
24383
24389
  case "legalCompanyName":
24384
- return {
24385
- ...acc,
24386
- validators: {
24387
- ...acc.validators,
24388
- ...LegalCompanyNameFieldValidation()
24389
- }
24390
- };
24390
+ return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig$a[country2], {
24391
+ isBusiness: true
24392
+ }, defaultFieldMetadata$a), acc);
24391
24393
  case "dbaName":
24392
24394
  return mergeFieldMetadataIntoProps("dbaName", dbaNameFieldMetadata, acc);
24393
24395
  case "registrationNumber":
@@ -26564,6 +26566,42 @@ function BusinessDetailsDropinComponent({
26564
26566
  })
26565
26567
  });
26566
26568
  }
26569
+ const getTrustedFieldsByProvider = (provider, trustedFields2) => trustedFields2.find((tf) => tf.provider === provider);
26570
+ const parseTrustedFieldsIntoReadOnlyFields = (trustedFields2, mapping) => {
26571
+ const formFieldsMapped = [];
26572
+ trustedFields2.fields.forEach((field) => {
26573
+ for (const [key, value] of Object.entries(mapping)) {
26574
+ if (value === field) {
26575
+ formFieldsMapped.push(key);
26576
+ }
26577
+ }
26578
+ });
26579
+ const readOnlyFields = {};
26580
+ formFieldsMapped.forEach((field) => {
26581
+ const tokenizedField = field.split(".");
26582
+ const formField = tokenizedField.pop();
26583
+ const formId = tokenizedField.pop();
26584
+ if (formField && formId) {
26585
+ if (formId in readOnlyFields) {
26586
+ readOnlyFields[formId].push(formField);
26587
+ } else {
26588
+ readOnlyFields[formId] = [formField];
26589
+ }
26590
+ }
26591
+ });
26592
+ return readOnlyFields;
26593
+ };
26594
+ const trustedFields = ({
26595
+ fields,
26596
+ trustedFieldsProvider,
26597
+ apiMapping
26598
+ }) => {
26599
+ if (!fields || !trustedFieldsProvider || !apiMapping) {
26600
+ return {};
26601
+ }
26602
+ const trustedFieldsOfProvider = getTrustedFieldsByProvider(trustedFieldsProvider, fields);
26603
+ return trustedFieldsOfProvider ? parseTrustedFieldsIntoReadOnlyFields(trustedFieldsOfProvider, apiMapping) : {};
26604
+ };
26567
26605
  const parseConfiguration$6 = ({
26568
26606
  country: country2,
26569
26607
  matchingScenario
@@ -26613,7 +26651,8 @@ function CompanyDropinComponent({
26613
26651
  handleUpdateLegalEntity,
26614
26652
  handleHomeClick,
26615
26653
  onTypeSwitch,
26616
- onChange
26654
+ onChange,
26655
+ trustedFieldsProvider
26617
26656
  }) {
26618
26657
  var _a, _b;
26619
26658
  const {
@@ -26677,7 +26716,15 @@ function CompanyDropinComponent({
26677
26716
  isSettingEnabled,
26678
26717
  isExperimentEnabled
26679
26718
  }), [country2, data, taskType, requiredFields, isSettingEnabled]);
26680
- const derivedProps = useMemo(() => getPropsFromConfigurations(fieldConfigurations, companyForms, (problems == null ? void 0 : problems.remediationActions) ? Object.values(problems == null ? void 0 : problems.remediationActions) : [], (problems == null ? void 0 : problems.missingData) ?? [], legalEntityResponse ? getFieldsWithExistingData(legalEntityResponse) : [], fieldsFromCustomRules), [fieldConfigurations, fieldsFromCustomRules, problems == null ? void 0 : problems.remediationActions]);
26719
+ const legalEntityTrustedFields = legalEntityResponse == null ? void 0 : legalEntityResponse.trustedFields;
26720
+ const trustedFieldsOfProvider = useMemo(() => trustedFields({
26721
+ fields: legalEntityTrustedFields,
26722
+ trustedFieldsProvider,
26723
+ apiMapping: companyComponentsKeyMapping
26724
+ }), [legalEntityTrustedFields, trustedFieldsProvider]);
26725
+ const derivedProps = useMemo(() => ({
26726
+ ...getPropsFromConfigurations(fieldConfigurations, companyForms, (problems == null ? void 0 : problems.remediationActions) ? Object.values(problems == null ? void 0 : problems.remediationActions) : [], (problems == null ? void 0 : problems.missingData) ?? [], legalEntityResponse ? getFieldsWithExistingData(legalEntityResponse) : [], fieldsFromCustomRules)
26727
+ }), [fieldConfigurations, fieldsFromCustomRules, problems == null ? void 0 : problems.remediationActions]);
26681
26728
  const isCountryOfGoverningLawEnabled = isExperimentEnabled("EnableCountryOfGoverningLawForUKCompanies");
26682
26729
  const {
26683
26730
  state: {
@@ -26940,7 +26987,8 @@ function CompanyDropinComponent({
26940
26987
  onCountryChange: setCountry,
26941
26988
  ref: formRef,
26942
26989
  shouldValidate,
26943
- isTopLevelEntity: taskType === TaskTypes.COMPANY
26990
+ isTopLevelEntity: taskType === TaskTypes.COMPANY,
26991
+ readOnlyFields: trustedFieldsOfProvider
26944
26992
  })
26945
26993
  });
26946
26994
  }
@@ -27549,13 +27597,6 @@ function CompanyLookup({
27549
27597
  });
27550
27598
  }
27551
27599
  const CompanyLookupComponent = memo(CompanyLookup, (prevProps, nextProps) => objectsDeepEqual(prevProps.defaultData, nextProps.defaultData) && prevProps.canVerify === nextProps.canVerify && prevProps.legalCompanyName === nextProps.legalCompanyName && prevProps.country === nextProps.country && prevProps.stateOrProvince === nextProps.stateOrProvince && prevProps.taxInformationNumber === nextProps.taxInformationNumber && prevProps.setLoading === nextProps.setLoading && prevProps.setKompanyAddress === nextProps.setKompanyAddress && prevProps.handleCompanyIndexSearch === nextProps.handleCompanyIndexSearch && prevProps.handleCompanyDeepSearch === nextProps.handleCompanyDeepSearch && prevProps.handleGetCompanyDataset === nextProps.handleGetCompanyDataset && prevProps.handleRefreshCompanyDataset === nextProps.handleRefreshCompanyDataset && prevProps.handleVerifyTin === nextProps.handleVerifyTin);
27552
- const StateFieldValidation = () => ({
27553
- stateOrProvince: {
27554
- modes: ["blur"],
27555
- validate: (stateOrProvince2) => !isEmpty(stateOrProvince2),
27556
- errorMessage: "fieldIsRequired"
27557
- }
27558
- });
27559
27600
  const COMPANY_BASICS_FORM_ID = "companyBasics";
27560
27601
  const companyBasicsFields = [...LEGAL_COMPANY_NAME_FIELD, ...COUNTRY_FIELD, ...STATE_FIELD, ...TAX_INFORMATION_FIELD];
27561
27602
  function CompanyBasics({
@@ -27619,13 +27660,9 @@ function CompanyBasics({
27619
27660
  return (_a2 = initialFormUtilsProps.allFields) == null ? void 0 : _a2.reduce((acc, field) => {
27620
27661
  switch (field) {
27621
27662
  case "legalCompanyName":
27622
- return {
27623
- ...acc,
27624
- validators: {
27625
- ...acc.validators,
27626
- ...LegalCompanyNameFieldValidation()
27627
- }
27628
- };
27663
+ return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig$a[country2], {
27664
+ isBusiness: false
27665
+ }, defaultFieldMetadata$a), acc);
27629
27666
  case "country":
27630
27667
  return {
27631
27668
  ...acc,
@@ -27635,13 +27672,9 @@ function CompanyBasics({
27635
27672
  }
27636
27673
  };
27637
27674
  case "stateOrProvince":
27638
- return {
27639
- ...acc,
27640
- validators: {
27641
- ...acc.validators,
27642
- ...StateFieldValidation()
27643
- }
27644
- };
27675
+ return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig[country2], {
27676
+ isBusiness: false
27677
+ }, defaultFieldMetadata), acc);
27645
27678
  case "taxInformation":
27646
27679
  return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig$1[country2], {
27647
27680
  taxIdNumberType,
@@ -27651,7 +27684,7 @@ function CompanyBasics({
27651
27684
  return acc;
27652
27685
  }
27653
27686
  }, initialFormUtilsProps);
27654
- }, [country2, initialFormUtilsProps, taxIdNumberType]);
27687
+ }, [companyType2, country2, initialFormUtilsProps, taxIdNumberType]);
27655
27688
  const schema = (requiredFields == null ? void 0 : requiredFields.length) ? requiredFields : ["legalCompanyName", "country"];
27656
27689
  const {
27657
27690
  schema: formSchema,
@@ -29028,6 +29061,11 @@ function useSalesChannelsSettings() {
29028
29061
  return settings;
29029
29062
  }, [isSettingEnabled]);
29030
29063
  }
29064
+ var TrustedFieldsProvider = /* @__PURE__ */ ((TrustedFieldsProvider2) => {
29065
+ TrustedFieldsProvider2["SINGPASS"] = "singpass";
29066
+ TrustedFieldsProvider2["KOMPANY"] = "kompany";
29067
+ return TrustedFieldsProvider2;
29068
+ })(TrustedFieldsProvider || {});
29031
29069
  const downloadFile = async (base64, filename) => {
29032
29070
  saveBlobAsFile(base64ToBlob(base64), filename);
29033
29071
  };
@@ -29602,11 +29640,13 @@ const BusinessTypeSelection = ({
29602
29640
  className: "adyen-kyc-business-type-selection",
29603
29641
  children: [jsxs("header", {
29604
29642
  className: "adyen-kyc-u-margin-bottom-32",
29605
- children: [jsx(Heading, {
29606
- level: 2,
29643
+ children: [jsx(Typography, {
29644
+ el: "h2",
29645
+ variant: "title-m",
29607
29646
  children: i18n.get(businessTypeSelectionStepTitles[currentStep])
29608
- }), currentStep === 3 && jsx(Heading, {
29609
- level: "sub",
29647
+ }), currentStep === 3 && jsx(Typography, {
29648
+ el: "p",
29649
+ variant: "title",
29610
29650
  children: i18n.get("someInformationWillNotBeSaved")
29611
29651
  })]
29612
29652
  }), currentStep === 0 && jsx(Field, {
@@ -29946,11 +29986,13 @@ function Card({
29946
29986
  onKeyDown,
29947
29987
  children: [title && jsxs("header", {
29948
29988
  className: "adyen-kyc-card__header",
29949
- children: [jsx(Heading, {
29950
- level: 4,
29989
+ children: [jsx(Typography, {
29990
+ el: "h4",
29991
+ variant: "title",
29951
29992
  children: title
29952
- }), subTitle && jsx(Heading, {
29953
- level: "sub",
29993
+ }), subTitle && jsx(Typography, {
29994
+ el: "p",
29995
+ variant: "body",
29954
29996
  children: subTitle
29955
29997
  })]
29956
29998
  }), jsx("div", {
@@ -30163,8 +30205,8 @@ const EntityAssociation = ({
30163
30205
  })]
30164
30206
  }), jsx("div", {
30165
30207
  children: types.map((type) => jsx(Tag, {
30166
- className: `adyen-kyc-entity-association__tag ${getRoleTagColor(type)}`,
30167
- isBasic: true,
30208
+ className: "adyen-kyc-entity-association__tag",
30209
+ variant: getRoleTagVariant(type),
30168
30210
  children: i18n.get(getRoleName(type))
30169
30211
  }, type))
30170
30212
  }), status === TaskStatus.ERROR && jsx(VerificationErrorAlert, {
@@ -30252,8 +30294,8 @@ const EntityGuidanceStatus = ({
30252
30294
  children: [jsx(EntityStatusIcon, {
30253
30295
  status
30254
30296
  }), jsx(Tag, {
30255
- className: `adyen-kyc-entity-status__tag ${getRoleTagColor(entityLabel)}`,
30256
- isBasic: true,
30297
+ className: "adyen-kyc-entity-status__tag",
30298
+ variant: getRoleTagVariant(entityLabel),
30257
30299
  children: i18n.get(getRoleName(entityLabel))
30258
30300
  }, entityLabel), jsx("span", {
30259
30301
  className: "adyen-kyc-entity-status--text",
@@ -31000,8 +31042,9 @@ const SingpassSelection = (props) => {
31000
31042
  className: "adyen-kyc-singpass-selection",
31001
31043
  children: [jsx("header", {
31002
31044
  className: "adyen-kyc-u-margin-bottom-32",
31003
- children: jsx(Heading, {
31004
- level: 2,
31045
+ children: jsx(Typography, {
31046
+ el: "h2",
31047
+ variant: "title-m",
31005
31048
  children: i18n.get("howWouldYouLikeToSetUpYourAccount")
31006
31049
  })
31007
31050
  }), jsx("form", {
@@ -31253,8 +31296,9 @@ const TaskListGroup = ({
31253
31296
  className: "adyen-task-list-group",
31254
31297
  children: [title && jsx("header", {
31255
31298
  className: "adyen-task-list-group__header",
31256
- children: jsx(Heading, {
31257
- level: 4,
31299
+ children: jsx(Typography, {
31300
+ el: "h4",
31301
+ variant: "title",
31258
31302
  children: title
31259
31303
  })
31260
31304
  }), jsx("div", {
@@ -31376,13 +31420,17 @@ function TaskListComponent({
31376
31420
  })
31377
31421
  }), isEnableNewEntryFlowEnabled && jsxs("header", {
31378
31422
  className: "adyen-task-list__heading",
31379
- children: [jsx(Heading, {
31380
- level: 1,
31423
+ children: [jsx(Typography, {
31424
+ el: "h1",
31425
+ variant: "title-l",
31381
31426
  children: i18n.get("setUpYourAccount")
31382
- }), jsxs(Heading, {
31383
- level: "sub",
31384
- children: [jsx("span", {
31385
- className: "adyen-kyc-u-font-weight-semi-bold",
31427
+ }), jsxs(Typography, {
31428
+ el: "p",
31429
+ variant: "title",
31430
+ className: "adyen-task-list__description",
31431
+ children: [jsx(Typography, {
31432
+ el: "span",
31433
+ variant: "body-strongest",
31386
31434
  children: i18n.get("yourBusinessSetup", {
31387
31435
  values: {
31388
31436
  businessSetup: i18n.get(businessSetup)
@@ -31393,7 +31441,6 @@ function TaskListComponent({
31393
31441
  icon: "edit",
31394
31442
  tertiary: true,
31395
31443
  onClick: onEditBusinessSetupClick,
31396
- className: "adyen-kyc-u-margin-left-4",
31397
31444
  type: "button"
31398
31445
  })]
31399
31446
  })]
@@ -31878,7 +31925,7 @@ const getAgeToday = (birthdate2) => {
31878
31925
  if (todayMonth > bdMonth) {
31879
31926
  return yearDifference;
31880
31927
  }
31881
- if (todayMonth === bdMonth && todayDay >= bdDate.getDate()) {
31928
+ if (todayMonth === bdMonth && todayDay >= bdDate.getUTCDate()) {
31882
31929
  return yearDifference;
31883
31930
  }
31884
31931
  return yearDifference - 1;
@@ -33346,28 +33393,28 @@ const convertExistingTrustMemberToDefaultData = (trustMember, allowMoreRolesForM
33346
33393
  return convertExistingTrustMember(trustMember);
33347
33394
  };
33348
33395
  const TrustRoleAndEntityType = (props) => {
33349
- const {
33350
- existingTrustMember,
33351
- id: id2,
33352
- getLegalEntityHandler,
33353
- isOrganizationSettlorWithExemptionEnabled
33354
- } = props;
33396
+ var _a;
33355
33397
  const {
33356
33398
  i18n
33357
33399
  } = useI18nContext();
33400
+ const country2 = props.country;
33401
+ let mergedProps = props;
33402
+ mergedProps = mergeFieldMetadataIntoProps("legalCompanyName", resolveFieldMetadata(defaultFieldConfig$a[country2], {
33403
+ isBusiness: false
33404
+ }, defaultFieldMetadata$a), mergedProps);
33358
33405
  const {
33359
33406
  isExperimentEnabled
33360
33407
  } = useExperimentsContext();
33361
33408
  const allowMoreRolesForMainRootTrusteeEnabled = isExperimentEnabled("AllowMoreRolesForMainRootTrustee");
33362
- const defaultData = convertExistingTrustMemberToDefaultData(existingTrustMember, allowMoreRolesForMainRootTrusteeEnabled);
33363
- const formUtils = formUtilities(props, i18n);
33409
+ const defaultData = convertExistingTrustMemberToDefaultData(props.existingTrustMember, allowMoreRolesForMainRootTrusteeEnabled);
33410
+ const formUtils = formUtilities(mergedProps, i18n);
33364
33411
  const decideFields = (data2) => {
33365
- var _a, _b;
33366
- if ((_a = data2.role) == null ? void 0 : _a.includes("undefinedBeneficiary")) {
33412
+ var _a2, _b;
33413
+ if ((_a2 = data2.role) == null ? void 0 : _a2.includes("undefinedBeneficiary")) {
33367
33414
  return ["role", "descriptionUndefinedBeneficiary"];
33368
33415
  }
33369
33416
  if ((_b = data2.role) == null ? void 0 : _b.length) {
33370
- if (isOrganizationSettlorWithExemptionEnabled && isOrganizationAndSettlor(data2)) {
33417
+ if (props.isOrganizationSettlorWithExemptionEnabled && isOrganizationAndSettlor(data2)) {
33371
33418
  return ["role", "entityType", "settlorExemptionReason", "country", "legalCompanyName"];
33372
33419
  }
33373
33420
  if (couldBeExemptSettlor(data2)) {
@@ -33395,31 +33442,31 @@ const TrustRoleAndEntityType = (props) => {
33395
33442
  defaultData,
33396
33443
  fieldProblems: props == null ? void 0 : props.fieldValidationErrors
33397
33444
  });
33398
- const availableRoles = allowMoreRolesForMainRootTrusteeEnabled && (existingTrustMember == null ? void 0 : existingTrustMember.trustMemberType) === "rootTrustee" ? getAvailableRolesByTrustMemberTypeAndLegalEntityType(data.role, existingTrustMember) : getAvailableRoles(data.role);
33445
+ const availableRoles = allowMoreRolesForMainRootTrusteeEnabled && ((_a = props.existingTrustMember) == null ? void 0 : _a.trustMemberType) === "rootTrustee" ? getAvailableRolesByTrustMemberTypeAndLegalEntityType(data.role, props.existingTrustMember) : getAvailableRoles(data.role);
33399
33446
  useEffect(() => {
33400
33447
  (async () => {
33401
- var _a;
33402
- if (isOrganizationSettlorWithExemptionEnabled && existingTrustMember && existingTrustMember.trustMemberType === "exemptSettlor" && existingTrustMember.legalEntityId !== "isNewEntry" && existingTrustMember.roles !== void 0 && existingTrustMember.roles.length === 1 && existingTrustMember.roles[0] === "settlor" && getLegalEntityHandler) {
33403
- const response = await getLegalEntityHandler(existingTrustMember.legalEntityId);
33404
- const country2 = (_a = response == null ? void 0 : response.organization) == null ? void 0 : _a.registeredAddress.country;
33448
+ var _a2;
33449
+ if (props.isOrganizationSettlorWithExemptionEnabled && props.existingTrustMember && props.existingTrustMember.trustMemberType === "exemptSettlor" && props.existingTrustMember.legalEntityId !== "isNewEntry" && props.existingTrustMember.roles !== void 0 && props.existingTrustMember.roles.length === 1 && props.existingTrustMember.roles[0] === "settlor" && props.getLegalEntityHandler) {
33450
+ const response = await props.getLegalEntityHandler(props.existingTrustMember.legalEntityId);
33451
+ const country22 = (_a2 = response == null ? void 0 : response.organization) == null ? void 0 : _a2.registeredAddress.country;
33405
33452
  if (response && response.organization) {
33406
- handleChangeFor("country")(country2);
33453
+ handleChangeFor("country")(country22);
33407
33454
  }
33408
33455
  }
33409
33456
  })();
33410
33457
  }, []);
33411
33458
  useEffect(() => {
33412
- var _a;
33413
- (_a = props.onChange) == null ? void 0 : _a.call(props, {
33459
+ var _a2;
33460
+ (_a2 = props.onChange) == null ? void 0 : _a2.call(props, {
33414
33461
  schema,
33415
33462
  data,
33416
33463
  errors,
33417
33464
  valid,
33418
33465
  isValid,
33419
- dataStoreId: id2,
33466
+ dataStoreId: props.id,
33420
33467
  fieldProblems
33421
33468
  });
33422
- }, [schema, data, isValid, i18n, errors, valid, id2, fieldProblems]);
33469
+ }, [schema, data, isValid, i18n, errors, valid, props.id, fieldProblems]);
33423
33470
  const onInputDescription = (e) => {
33424
33471
  const {
33425
33472
  value
@@ -33435,9 +33482,9 @@ const TrustRoleAndEntityType = (props) => {
33435
33482
  }
33436
33483
  };
33437
33484
  const changeSettlorExemptionReasons = (exemptionReasons) => {
33438
- var _a;
33485
+ var _a2;
33439
33486
  if (exemptionReasons.includes("noneOfTheAbove")) {
33440
- handleChangeFor("settlorExemptionReason")(((_a = data.settlorExemptionReason) == null ? void 0 : _a.includes("noneOfTheAbove")) ? exemptionReasons.filter((reason) => reason !== "noneOfTheAbove") : ["noneOfTheAbove"]);
33487
+ handleChangeFor("settlorExemptionReason")(((_a2 = data.settlorExemptionReason) == null ? void 0 : _a2.includes("noneOfTheAbove")) ? exemptionReasons.filter((reason) => reason !== "noneOfTheAbove") : ["noneOfTheAbove"]);
33441
33488
  return;
33442
33489
  }
33443
33490
  handleChangeFor("settlorExemptionReason")(exemptionReasons);
@@ -33456,8 +33503,8 @@ const TrustRoleAndEntityType = (props) => {
33456
33503
  setErrors("lastName", errors2.lastName);
33457
33504
  };
33458
33505
  const onEntityTypeChange = (value) => {
33459
- var _a;
33460
- if (isOrganizationSettlorWithExemptionEnabled && value === LegalEntityType.ORGANIZATION && ((_a = data.role) == null ? void 0 : _a.length) === 1 && data.role[0] === "settlor") {
33506
+ var _a2;
33507
+ if (props.isOrganizationSettlorWithExemptionEnabled && value === LegalEntityType.ORGANIZATION && ((_a2 = data.role) == null ? void 0 : _a2.length) === 1 && data.role[0] === "settlor") {
33461
33508
  changeSettlorExemptionReasons(["professionalServiceProvider"]);
33462
33509
  }
33463
33510
  handleChangeFor("entityType")(value);
@@ -33495,7 +33542,7 @@ const TrustRoleAndEntityType = (props) => {
33495
33542
  errorMessage: formUtils.getErrorMessage("entityType", errors, fieldProblems),
33496
33543
  label: formUtils.getLabel("entityType", "whatTypeOfYourMembersEntity"),
33497
33544
  classNameModifiers: ["entityType"],
33498
- disabled: Boolean(existingTrustMember),
33545
+ disabled: Boolean(props.existingTrustMember),
33499
33546
  children: (childProps) => jsx(RadioCardSelect, {
33500
33547
  ...childProps,
33501
33548
  options: trustMemberLegalEntityTypes,
@@ -33555,8 +33602,8 @@ const TrustRoleAndEntityType = (props) => {
33555
33602
  enterLastNameExactlyAsAppearInID: "enterSettlorsLastNameExactlyAsItAppearsInID"
33556
33603
  },
33557
33604
  onChange: onNameChange,
33558
- dataStoreId: id2
33559
- }) : void 0, isOrganizationSettlorWithExemptionEnabled && (schema == null ? void 0 : schema.includes("country")) && (schema == null ? void 0 : schema.includes("legalCompanyName")) ? jsxs(Fragment, {
33605
+ dataStoreId: props.id
33606
+ }) : void 0, props.isOrganizationSettlorWithExemptionEnabled && (schema == null ? void 0 : schema.includes("country")) && (schema == null ? void 0 : schema.includes("legalCompanyName")) ? jsxs(Fragment, {
33560
33607
  children: [jsx(CountryField, {
33561
33608
  data: formUtils.getFieldData(data, COUNTRY_FIELD),
33562
33609
  valid: formUtils.getFieldValid(valid, COUNTRY_FIELD),
@@ -33695,7 +33742,8 @@ function RoleAndTypeDropinComponent({
33695
33742
  navigateBack,
33696
33743
  addOrUpdateTrustMember,
33697
33744
  getLegalEntityHandler,
33698
- isOrganizationSettlorWithExemptionEnabled
33745
+ isOrganizationSettlorWithExemptionEnabled,
33746
+ country: country2
33699
33747
  }) {
33700
33748
  var _a, _b;
33701
33749
  const {
@@ -33788,7 +33836,8 @@ function RoleAndTypeDropinComponent({
33788
33836
  onChange: onTrustMemberChange,
33789
33837
  shouldValidate,
33790
33838
  getLegalEntityHandler,
33791
- isOrganizationSettlorWithExemptionEnabled
33839
+ isOrganizationSettlorWithExemptionEnabled,
33840
+ country: country2
33792
33841
  })
33793
33842
  }), isSummaryStep && jsx("div", {
33794
33843
  className: "adyen-kyc-form-wrapper",
@@ -35723,7 +35772,8 @@ function DropinComposerComponent({
35723
35772
  handleAddressSearch: args == null ? void 0 : args.handleAddressSearch,
35724
35773
  handleFindAddress: args == null ? void 0 : args.handleFindAddress,
35725
35774
  onTypeSwitch: navigateToTypeSwitcher,
35726
- isTargetLegalEntityType: legalEntityType === LegalEntityType.ORGANIZATION
35775
+ isTargetLegalEntityType: legalEntityType === LegalEntityType.ORGANIZATION,
35776
+ trustedFieldsProvider: eligibleForSingpass && TrustedFieldsProvider.SINGPASS
35727
35777
  });
35728
35778
  case TaskTypes.COMPANY_SEARCH:
35729
35779
  return jsx(CompanySearchDropinComponent, {
@@ -36488,6 +36538,30 @@ function CreateTransferInstrumentComponent({
36488
36538
  taskType: TaskTypes.PAYOUT
36489
36539
  }) : null;
36490
36540
  }
36541
+ var HighExposurePagesEnums = /* @__PURE__ */ ((HighExposurePagesEnums2) => {
36542
+ HighExposurePagesEnums2["COMPANY_PAGE"] = "COMPANY_PAGE";
36543
+ HighExposurePagesEnums2["PARENT_COMPANY_PAGE"] = "PARENT_COMPANY_PAGE";
36544
+ HighExposurePagesEnums2["ULTIMATE_PARENT_COMPANY_PAGE"] = "ULTIMATE_PARENT_COMPANY_PAGE";
36545
+ return HighExposurePagesEnums2;
36546
+ })(HighExposurePagesEnums || {});
36547
+ const highExposureRadioItems = [{
36548
+ id: "Yes",
36549
+ name: "yes"
36550
+ }, {
36551
+ id: "No",
36552
+ name: "no"
36553
+ }];
36554
+ const highExposureParentRadioItems = [...highExposureRadioItems, {
36555
+ id: "I don't know",
36556
+ name: "iDontKnow"
36557
+ }];
36558
+ const validateLegalEntityIdentifier = (legalEntityIdentifier2, doesYourCompanyHaveLEI2, isDisabled) => {
36559
+ if (isDisabled) return true;
36560
+ const isRequired = doesYourCompanyHaveLEI2 === "Yes";
36561
+ const isValidLength = legalEntityIdentifier2 ? legalEntityIdentifier2.length === 20 : false;
36562
+ const hasLettersAndNumbers = legalEntityIdentifier2 ? /[a-zA-Z]/.test(legalEntityIdentifier2) && /[0-9]/.test(legalEntityIdentifier2) : false;
36563
+ return !isRequired || !isEmpty(legalEntityIdentifier2) && isValidLength && hasLettersAndNumbers;
36564
+ };
36491
36565
  const highExposureCompanyDetailsValidations = {
36492
36566
  country: {
36493
36567
  modes: ["blur"],
@@ -36508,16 +36582,126 @@ const highExposureCompanyDetailsValidations = {
36508
36582
  modes: ["blur"],
36509
36583
  validate: (naceCode) => !isEmpty(naceCode),
36510
36584
  errorMessage: "fieldIsRequired"
36585
+ },
36586
+ doesTheCompanyEarnMoreThanHalf: {
36587
+ modes: ["blur"],
36588
+ validate: (doesTheCompanyEarnMoreThanHalf2) => !isEmpty(doesTheCompanyEarnMoreThanHalf2),
36589
+ errorMessage: "fieldIsRequired"
36590
+ },
36591
+ doesYourCompanyHaveLEI: {
36592
+ modes: ["blur"],
36593
+ validate: (doesYourCompanyHaveLEI2) => !isEmpty(doesYourCompanyHaveLEI2),
36594
+ errorMessage: "fieldIsRequired"
36595
+ },
36596
+ legalEntityIdentifier: {
36597
+ modes: ["blur"],
36598
+ validate: (legalEntityIdentifier2, context) => {
36599
+ var _a, _b;
36600
+ return validateLegalEntityIdentifier(legalEntityIdentifier2, (_b = (_a = context == null ? void 0 : context.state) == null ? void 0 : _a.data) == null ? void 0 : _b.doesTheCompanyEarnMoreThanHalf);
36601
+ },
36602
+ errorMessage: "fieldIsRequired"
36603
+ },
36604
+ isCompanyOwnedByAnotherCompany: {
36605
+ modes: ["blur"],
36606
+ validate: (isCompanyOwnedByAnotherCompany2) => !isEmpty(isCompanyOwnedByAnotherCompany2),
36607
+ errorMessage: "fieldIsRequired"
36608
+ },
36609
+ isParentOwnedByAnotherCompany: {
36610
+ modes: ["blur"],
36611
+ validate: (isParentOwnedByAnotherCompany2, context) => {
36612
+ var _a, _b;
36613
+ return ((_b = (_a = context == null ? void 0 : context.state) == null ? void 0 : _a.data) == null ? void 0 : _b.isCompanyOwnedByAnotherCompany) ? !isEmpty(isParentOwnedByAnotherCompany2) : true;
36614
+ },
36615
+ errorMessage: "fieldIsRequired"
36616
+ }
36617
+ };
36618
+ const highExposureParentCompanyDetailsValidations = {
36619
+ parentLegalName: {
36620
+ modes: ["blur"],
36621
+ validate: (parentLegalName) => !isEmpty(parentLegalName),
36622
+ errorMessage: "fieldIsRequired"
36623
+ },
36624
+ parentNumberOfEmployees: {
36625
+ modes: ["blur"],
36626
+ validate: (parentNumberOfEmployees) => !isEmpty(parentNumberOfEmployees),
36627
+ errorMessage: "fieldIsRequired"
36628
+ },
36629
+ parentLegalForm: {
36630
+ modes: ["blur"],
36631
+ validate: (parentLegalForm) => !isEmpty(parentLegalForm),
36632
+ errorMessage: "fieldIsRequired"
36633
+ },
36634
+ parentNaceCode: {
36635
+ modes: ["blur"],
36636
+ validate: (parentNaceCode) => !isEmpty(parentNaceCode),
36637
+ errorMessage: "fieldIsRequired"
36638
+ },
36639
+ doesTheParentCompanyEarnMoreThanHalf: {
36640
+ modes: ["blur"],
36641
+ validate: (doesTheParentCompanyEarnMoreThanHalf) => !isEmpty(doesTheParentCompanyEarnMoreThanHalf),
36642
+ errorMessage: "fieldIsRequired"
36643
+ },
36644
+ doesYourParentCompanyHaveLEI: {
36645
+ modes: ["blur"],
36646
+ validate: (doesYourParentCompanyHaveLEI) => !isEmpty(doesYourParentCompanyHaveLEI),
36647
+ errorMessage: "fieldIsRequired"
36648
+ },
36649
+ parentLegalEntityIdentifier: {
36650
+ modes: ["blur"],
36651
+ validate: (parentLegalEntityIdentifier, context) => {
36652
+ var _a, _b, _c, _d;
36653
+ return validateLegalEntityIdentifier(parentLegalEntityIdentifier, (_b = (_a = context == null ? void 0 : context.state) == null ? void 0 : _a.data) == null ? void 0 : _b.doesYourParentCompanyHaveLEI, Boolean((_d = (_c = context == null ? void 0 : context.state) == null ? void 0 : _c.data) == null ? void 0 : _d.doesNotKnowParentNumberOfEmployees));
36654
+ },
36655
+ errorMessage: "fieldIsRequired"
36656
+ }
36657
+ };
36658
+ const highExposureUltimateParentCompanyDetailsValidations = {
36659
+ ultimateParentLegalName: {
36660
+ modes: ["blur"],
36661
+ validate: (ultimateParentLegalName) => !isEmpty(ultimateParentLegalName),
36662
+ errorMessage: "fieldIsRequired"
36663
+ },
36664
+ ultimateParentNumberOfEmployees: {
36665
+ modes: ["blur"],
36666
+ validate: (ultimateParentNumberOfEmployees) => !isEmpty(ultimateParentNumberOfEmployees),
36667
+ errorMessage: "fieldIsRequired"
36668
+ },
36669
+ ultimateParentLegalForm: {
36670
+ modes: ["blur"],
36671
+ validate: (ultimateParentLegalForm) => !isEmpty(ultimateParentLegalForm),
36672
+ errorMessage: "fieldIsRequired"
36673
+ },
36674
+ ultimateParentNaceCode: {
36675
+ modes: ["blur"],
36676
+ validate: (ultimateParentNaceCode) => !isEmpty(ultimateParentNaceCode),
36677
+ errorMessage: "fieldIsRequired"
36678
+ },
36679
+ doesTheUltimateParentCompanyEarnMoreThanHalf: {
36680
+ modes: ["blur"],
36681
+ validate: (doesTheUltimateParentCompanyEarnMoreThanHalf) => !isEmpty(doesTheUltimateParentCompanyEarnMoreThanHalf),
36682
+ errorMessage: "fieldIsRequired"
36683
+ },
36684
+ doesYourUltimateParentCompanyHaveLEI: {
36685
+ modes: ["blur"],
36686
+ validate: (doesYourUltimateParentCompanyHaveLEI) => !isEmpty(doesYourUltimateParentCompanyHaveLEI),
36687
+ errorMessage: "fieldIsRequired"
36688
+ },
36689
+ ultimateParentLegalEntityIdentifier: {
36690
+ modes: ["blur"],
36691
+ validate: (ultimateParentLegalEntityIdentifier, context) => {
36692
+ var _a, _b, _c, _d;
36693
+ return validateLegalEntityIdentifier(ultimateParentLegalEntityIdentifier, (_b = (_a = context == null ? void 0 : context.state) == null ? void 0 : _a.data) == null ? void 0 : _b.doesYourUltimateParentCompanyHaveLEI, Boolean((_d = (_c = context == null ? void 0 : context.state) == null ? void 0 : _c.data) == null ? void 0 : _d.doesNotKnowUltimateParentNumberOfEmployees));
36694
+ },
36695
+ errorMessage: "fieldIsRequired"
36511
36696
  }
36512
36697
  };
36513
- const LEGAL_FORM_FIELD = ["legalForm"];
36514
36698
  const logger$8 = createLogger("LegalFormField");
36515
36699
  function LegalFormField({
36516
36700
  name = "legalForm",
36517
36701
  data,
36518
36702
  valid,
36519
- errors,
36520
- labels: labels2,
36703
+ errorMessage,
36704
+ label,
36521
36705
  readonly,
36522
36706
  handleChangeFor,
36523
36707
  helperText,
@@ -36544,8 +36728,8 @@ function LegalFormField({
36544
36728
  }, [countryCode]);
36545
36729
  return jsx(Field, {
36546
36730
  name,
36547
- label: (labels2 == null ? void 0 : labels2.legalForm) || i18n.get("businessStructure"),
36548
- errorMessage: errors.legalForm,
36731
+ label: label || i18n.get("businessStructure"),
36732
+ errorMessage,
36549
36733
  classNameModifiers,
36550
36734
  isValid: valid.legalForm,
36551
36735
  helper: helperText == null ? void 0 : helperText.legalForm,
@@ -36560,14 +36744,13 @@ function LegalFormField({
36560
36744
  })
36561
36745
  });
36562
36746
  }
36563
- const NACE_CODE_FIELD = ["naceCode"];
36564
36747
  const logger$7 = createLogger("NaceCodeField");
36565
36748
  function NaceCodeField({
36566
36749
  name = "naceCode",
36567
36750
  data,
36568
36751
  valid,
36569
- errors,
36570
- labels: labels2,
36752
+ errorMessage,
36753
+ label,
36571
36754
  readonly,
36572
36755
  handleChangeFor,
36573
36756
  helperText,
@@ -36589,8 +36772,8 @@ function NaceCodeField({
36589
36772
  }, []);
36590
36773
  return jsx(Field, {
36591
36774
  name,
36592
- label: (labels2 == null ? void 0 : labels2.naceCode) || i18n.get("industryAndNaceCode"),
36593
- errorMessage: errors.naceCode,
36775
+ label: label || i18n.get("industryAndNaceCode"),
36776
+ errorMessage,
36594
36777
  classNameModifiers,
36595
36778
  isValid: valid.naceCode,
36596
36779
  helper: helperText == null ? void 0 : helperText.naceCode,
@@ -36612,58 +36795,238 @@ function HighExposureBusinessInformation({
36612
36795
  errors,
36613
36796
  fieldProblems,
36614
36797
  handleChangeFor,
36615
- country: country2
36798
+ country: country2,
36799
+ fieldMapping,
36800
+ targetPage,
36801
+ sectionHeading
36616
36802
  }) {
36803
+ const {
36804
+ i18n
36805
+ } = useI18nContext();
36806
+ const getFieldName = (fieldKey) => fieldMapping[fieldKey] ?? fieldKey;
36807
+ const getFieldData = (fieldKey) => {
36808
+ const fieldData = data[getFieldName(fieldKey)];
36809
+ return fieldData ? fieldData.toString() : void 0;
36810
+ };
36811
+ const isMainCompany = targetPage === HighExposurePagesEnums.COMPANY_PAGE;
36617
36812
  return jsxs(Fragment, {
36618
- children: [jsx(LegalFormField, {
36813
+ children: [jsx(Typography, {
36814
+ el: "h3",
36815
+ variant: "title",
36816
+ children: i18n.get(sectionHeading || "yourBusinessDetails")
36817
+ }), !isMainCompany && jsx(Field, {
36818
+ name: getFieldName("legalName"),
36819
+ label: formUtils.getLabel(getFieldName("legalName"), "legalName"),
36820
+ classNameModifiers: ["legalName"],
36821
+ errorMessage: formUtils.getErrorMessage(getFieldName("legalName"), errors, fieldProblems),
36822
+ isValid: valid[getFieldName("legalName")],
36823
+ children: (childProps) => jsx(InputText, {
36824
+ ...childProps,
36825
+ name: getFieldName("legalName"),
36826
+ value: getFieldData("legalName"),
36827
+ readonly: false,
36828
+ classNameModifiers: ["legalName"],
36829
+ onInput: handleChangeFor(getFieldName("legalName"), "input"),
36830
+ onBlur: handleChangeFor(getFieldName("legalName"), "blur"),
36831
+ "aria-required": true,
36832
+ "aria-label": formUtils.getLabel(getFieldName("legalName")),
36833
+ "aria-invalid": !valid[getFieldName("legalName")]
36834
+ })
36835
+ }), jsx(LegalFormField, {
36836
+ name: getFieldName("legalForm"),
36619
36837
  countryCode: country2,
36620
36838
  data: {
36621
- legalForm: data.legalForm
36839
+ legalForm: getFieldData("legalForm")
36622
36840
  },
36623
36841
  valid: {
36624
- legalForm: valid.legalForm
36842
+ legalForm: valid[getFieldName("legalForm")]
36625
36843
  },
36626
- errors: formUtils.getFieldErrors(errors, fieldProblems, LEGAL_FORM_FIELD),
36627
- handleChangeFor: () => handleChangeFor("legalForm", "blur"),
36844
+ errorMessage: formUtils.getErrorMessage(getFieldName("legalForm"), errors, fieldProblems),
36845
+ handleChangeFor: () => handleChangeFor(getFieldName("legalForm"), "blur"),
36628
36846
  readonly: false,
36629
- labels: formUtils.getFieldLabels(LEGAL_FORM_FIELD, {
36630
- legalForm: "businessStructure"
36631
- })
36847
+ label: formUtils.getLabel(getFieldName("legalForm"), "businessStructure")
36632
36848
  }), jsx(NaceCodeField, {
36849
+ name: getFieldName("naceCode"),
36633
36850
  data: {
36634
- naceCode: data.naceCode
36851
+ naceCode: getFieldData("naceCode")
36635
36852
  },
36636
36853
  valid: {
36637
- naceCode: valid.naceCode
36854
+ naceCode: valid[getFieldName("naceCode")]
36638
36855
  },
36639
- errors: formUtils.getFieldErrors(errors, fieldProblems, NACE_CODE_FIELD),
36640
- handleChangeFor: () => handleChangeFor("naceCode", "blur"),
36856
+ errorMessage: formUtils.getErrorMessage(getFieldName("naceCode"), errors, fieldProblems),
36857
+ handleChangeFor: () => handleChangeFor(getFieldName("naceCode"), "blur"),
36641
36858
  readonly: false,
36642
- labels: formUtils.getFieldLabels(NACE_CODE_FIELD, {
36643
- naceCode: "industryAndNaceCode"
36644
- })
36859
+ label: formUtils.getLabel(getFieldName("naceCode"), "industryAndNaceCode")
36645
36860
  }), jsx(Field, {
36646
- name: "numberOfEmployees",
36647
- label: formUtils.getLabel("numberOfEmployees", "numberOfEmployees"),
36861
+ name: getFieldName("numberOfEmployees"),
36862
+ label: formUtils.getLabel(getFieldName("numberOfEmployees"), "numberOfEmployees"),
36648
36863
  classNameModifiers: ["legalName"],
36649
- errorMessage: formUtils.getErrorMessage("numberOfEmployees", errors, fieldProblems),
36650
- isValid: valid.numberOfEmployees,
36864
+ errorMessage: formUtils.getErrorMessage(getFieldName("numberOfEmployees"), errors, fieldProblems),
36865
+ isValid: valid[getFieldName("numberOfEmployees")],
36651
36866
  children: (childProps) => jsx(InputText, {
36652
36867
  ...childProps,
36653
- name: "numberOfEmployees",
36654
- value: data.numberOfEmployees,
36655
- readonly: formUtils.isReadOnly("numberOfEmployees"),
36868
+ name: getFieldName("numberOfEmployees"),
36869
+ value: getFieldData("numberOfEmployees"),
36870
+ readonly: false,
36656
36871
  classNameModifiers: ["legalName"],
36657
- onInput: handleChangeFor("numberOfEmployees", "input"),
36658
- onBlur: handleChangeFor("numberOfEmployees", "blur"),
36872
+ onInput: handleChangeFor(getFieldName("numberOfEmployees"), "input"),
36873
+ onBlur: handleChangeFor(getFieldName("numberOfEmployees"), "blur"),
36874
+ "aria-required": true,
36875
+ "aria-label": formUtils.getLabel(getFieldName("numberOfEmployees")),
36876
+ "aria-invalid": !valid[getFieldName("numberOfEmployees")]
36877
+ })
36878
+ }), jsx(Field, {
36879
+ name: getFieldName("doesTheCompanyEarnMoreThanHalf"),
36880
+ classNameModifiers: ["highExposureBusinessInformation"],
36881
+ label: i18n.get("doesTheCompanyEarnMoreThanHalf"),
36882
+ errorMessage: formUtils.getErrorMessage(getFieldName("doesTheCompanyEarnMoreThanHalf"), errors, fieldProblems),
36883
+ children: (childProps) => jsx(RadioGroup, {
36884
+ ...childProps,
36885
+ name: getFieldName("doesTheCompanyEarnMoreThanHalf"),
36886
+ items: isMainCompany ? highExposureRadioItems : highExposureParentRadioItems,
36887
+ value: getFieldData("doesTheCompanyEarnMoreThanHalf"),
36888
+ disabled: false,
36889
+ onChange: handleChangeFor(getFieldName("doesTheCompanyEarnMoreThanHalf")),
36890
+ "aria-required": true,
36891
+ "aria-label": i18n.get("doesTheCompanyEarnMoreThanHalf"),
36892
+ "aria-invalid": !valid[getFieldName("doesTheCompanyEarnMoreThanHalf")]
36893
+ })
36894
+ }), jsx(Field, {
36895
+ name: getFieldName("doesYourCompanyHaveLEI"),
36896
+ classNameModifiers: ["highExposureBusinessInformation"],
36897
+ label: i18n.get(isMainCompany ? "doesYourCompanyHaveLEI" : "doesThisCompanyHaveLEI"),
36898
+ helper: jsxs("div", {
36899
+ children: [jsx("span", {
36900
+ children: i18n.get("anLEIIsAUniqueCode")
36901
+ }), " ", jsx(Link, {
36902
+ href: "https://search.gleif.org/#/search/",
36903
+ external: true,
36904
+ className: ["adyen-kyc__high-exposure-link"],
36905
+ children: i18n.get("lookUpYourLEI")
36906
+ })]
36907
+ }),
36908
+ errorMessage: formUtils.getErrorMessage(getFieldName("doesYourCompanyHaveLEI"), errors, fieldProblems),
36909
+ children: (childProps) => jsx(RadioGroup, {
36910
+ ...childProps,
36911
+ name: getFieldName("doesYourCompanyHaveLEI"),
36912
+ items: isMainCompany ? highExposureRadioItems : highExposureParentRadioItems,
36913
+ value: getFieldData("doesYourCompanyHaveLEI"),
36914
+ disabled: false,
36915
+ onChange: handleChangeFor(getFieldName("doesYourCompanyHaveLEI")),
36659
36916
  "aria-required": true,
36660
- "aria-label": formUtils.getLabel("numberOfEmployees"),
36661
- "aria-invalid": !valid.numberOfEmployees
36917
+ "aria-label": i18n.get(isMainCompany ? "doesYourCompanyHaveLEI" : "doesThisCompanyHaveLEI"),
36918
+ "aria-invalid": !valid[getFieldName("doesYourCompanyHaveLEI")]
36662
36919
  })
36920
+ }), getFieldData("doesYourCompanyHaveLEI") === "Yes" && jsxs(Fragment, {
36921
+ children: [jsx(Field, {
36922
+ name: getFieldName("legalEntityIdentifier"),
36923
+ label: formUtils.getLabel(getFieldName("legalEntityIdentifier"), "legalEntityIdentifier"),
36924
+ errorMessage: formUtils.getErrorMessage(getFieldName("legalEntityIdentifier"), errors, fieldProblems),
36925
+ isValid: valid.legalEntityIdentifier,
36926
+ helper: i18n.get("enterNCharactersWithAMixForExample", {
36927
+ values: {
36928
+ numChars: 20,
36929
+ example: "529900T8BM49AURSDO55"
36930
+ }
36931
+ }),
36932
+ helperPosition: "below",
36933
+ children: (childProps) => jsx(InputText, {
36934
+ ...childProps,
36935
+ name: getFieldName("legalEntityIdentifier"),
36936
+ value: getFieldData("legalEntityIdentifier"),
36937
+ readonly: Boolean(getFieldData("doesNotKnowNumberOfEmployees")),
36938
+ classNameModifiers: ["legalName"],
36939
+ onInput: handleChangeFor(getFieldName("legalEntityIdentifier"), "input"),
36940
+ onBlur: handleChangeFor(getFieldName("legalEntityIdentifier"), "blur"),
36941
+ "aria-required": true,
36942
+ "aria-label": formUtils.getLabel(getFieldName("legalEntityIdentifier")),
36943
+ "aria-invalid": !valid[getFieldName("legalEntityIdentifier")],
36944
+ isValid: valid[getFieldName("legalEntityIdentifier")]
36945
+ })
36946
+ }), !isMainCompany && jsx(Checkbox, {
36947
+ name: getFieldName("doesNotKnowNumberOfEmployees"),
36948
+ label: i18n.get("iDontKnow"),
36949
+ value: getFieldData("doesNotKnowNumberOfEmployees"),
36950
+ readonly: false,
36951
+ classNameModifiers: ["exempted-from-tax"],
36952
+ checked: Boolean(getFieldData("doesNotKnowNumberOfEmployees")),
36953
+ onChange: handleChangeFor(getFieldName("doesNotKnowNumberOfEmployees")),
36954
+ "aria-required": false,
36955
+ "aria-label": i18n.get("iDontKnow"),
36956
+ "aria-invalid": false
36957
+ })]
36663
36958
  })]
36664
36959
  });
36665
36960
  }
36666
- const highExposureCompanyDetailsFields = ["numberOfEmployees", "legalForm", "naceCode"];
36961
+ function HighExposureOwnershipStructure({
36962
+ formUtils,
36963
+ data,
36964
+ valid,
36965
+ errors,
36966
+ fieldProblems,
36967
+ handleChangeFor,
36968
+ legalEntity
36969
+ }) {
36970
+ const {
36971
+ i18n
36972
+ } = useI18nContext();
36973
+ return jsxs(Fragment, {
36974
+ children: [jsx(Typography, {
36975
+ el: "h3",
36976
+ variant: "title",
36977
+ children: i18n.get("ownershipStructure")
36978
+ }), jsx(Field, {
36979
+ name: "isCompanyOwnedByAnotherCompany",
36980
+ classNameModifiers: ["highExposureBusinessInformation"],
36981
+ label: i18n.get("isCompanyOwnedByAnotherCompany", {
36982
+ values: {
36983
+ company: (legalEntity == null ? void 0 : legalEntity.organization) ? legalEntity.organization.legalName : ""
36984
+ }
36985
+ }),
36986
+ errorMessage: formUtils.getErrorMessage("isCompanyOwnedByAnotherCompany", errors, fieldProblems),
36987
+ helper: i18n.get("thisMeansYouHaveAParentCompany"),
36988
+ children: (childProps) => jsx(RadioGroup, {
36989
+ ...childProps,
36990
+ name: "isCompanyOwnedByAnotherCompany",
36991
+ items: highExposureRadioItems,
36992
+ value: data.isCompanyOwnedByAnotherCompany,
36993
+ disabled: false,
36994
+ onChange: handleChangeFor("isCompanyOwnedByAnotherCompany"),
36995
+ "aria-required": true,
36996
+ "aria-label": formUtils.getLabel("isCompanyOwnedByAnotherCompany"),
36997
+ "aria-invalid": !valid.isCompanyOwnedByAnotherCompany
36998
+ })
36999
+ }), (data == null ? void 0 : data.isCompanyOwnedByAnotherCompany) === "Yes" && jsx(Field, {
37000
+ name: "isParentOwnedByAnotherCompany",
37001
+ classNameModifiers: ["highExposureBusinessInformation"],
37002
+ label: formUtils.getLabel("isParentOwnedByAnotherCompany"),
37003
+ helper: i18n.get("thisMeansYouHaveAnUltimateParentCompany"),
37004
+ errorMessage: formUtils.getErrorMessage("isParentOwnedByAnotherCompany", errors, fieldProblems),
37005
+ children: (childProps) => jsx(RadioGroup, {
37006
+ ...childProps,
37007
+ name: "isParentOwnedByAnotherCompany",
37008
+ items: highExposureRadioItems,
37009
+ value: data.isParentOwnedByAnotherCompany,
37010
+ disabled: false,
37011
+ onChange: handleChangeFor("isParentOwnedByAnotherCompany"),
37012
+ "aria-required": true,
37013
+ "aria-label": formUtils.getLabel("isParentOwnedByAnotherCompany"),
37014
+ "aria-invalid": !valid.doesYourCompanyHaveLEI
37015
+ })
37016
+ })]
37017
+ });
37018
+ }
37019
+ const companyFieldMapping = {
37020
+ legalForm: "legalForm",
37021
+ naceCode: "naceCode",
37022
+ numberOfEmployees: "numberOfEmployees",
37023
+ doesTheCompanyEarnMoreThanHalf: "doesTheCompanyEarnMoreThanHalf",
37024
+ doesYourCompanyHaveLEI: "doesYourCompanyHaveLEI",
37025
+ legalEntityIdentifier: "legalEntityIdentifier",
37026
+ isCompanyOwnedByAnotherCompany: "isCompanyOwnedByAnotherCompany",
37027
+ isParentOwnedByAnotherCompany: "isParentOwnedByAnotherCompany"
37028
+ };
37029
+ const highExposureCompanyDetailsFields = Object.values(companyFieldMapping);
36667
37030
  function AdditionalFieldsForHighExposureCompany(props) {
36668
37031
  const {
36669
37032
  i18n
@@ -36684,6 +37047,7 @@ function AdditionalFieldsForHighExposureCompany(props) {
36684
37047
  fieldProblems: props == null ? void 0 : props.fieldValidationErrors
36685
37048
  });
36686
37049
  const formUtils = formUtilities(props, i18n);
37050
+ const highExposureHandleChangeFor = handleChangeFor;
36687
37051
  const {
36688
37052
  updateStateSlice
36689
37053
  } = useGlobalDataSlice("company");
@@ -36696,9 +37060,19 @@ function AdditionalFieldsForHighExposureCompany(props) {
36696
37060
  });
36697
37061
  }, [data, valid, errors, fieldProblems]);
36698
37062
  return jsxs("form", {
36699
- className: "adyen-kyc__registration-details",
36700
- children: [jsx(FormHeader, {
36701
- heading: props.heading
37063
+ className: "adyen-kyc__high-exposure-company",
37064
+ children: [jsx(Typography, {
37065
+ el: "h1",
37066
+ variant: "title-l",
37067
+ children: i18n.get("additionalInformationIsRequiredForLoan")
37068
+ }), jsx(Typography, {
37069
+ el: "p",
37070
+ variant: "body",
37071
+ children: i18n.get("beforeYourCapitalLoanApplicationCanBeSubmitted")
37072
+ }), jsx(Typography, {
37073
+ el: "p",
37074
+ variant: "body",
37075
+ children: i18n.get("euFinancialRegulationsRequireUs")
36702
37076
  }), jsx(ErrorPanel, {
36703
37077
  verificationErrors: props.formVerificationErrors,
36704
37078
  validationErrors: props == null ? void 0 : props.fieldValidationErrors,
@@ -36706,21 +37080,39 @@ function AdditionalFieldsForHighExposureCompany(props) {
36706
37080
  id: "ariaErrorField"
36707
37081
  }), jsx(HighExposureBusinessInformation, {
36708
37082
  ...props,
36709
- handleChangeFor,
37083
+ handleChangeFor: highExposureHandleChangeFor,
36710
37084
  errors,
36711
37085
  data,
36712
37086
  valid,
36713
37087
  country: props.country,
36714
37088
  formUtils,
37089
+ fieldProblems,
37090
+ targetPage: HighExposurePagesEnums.COMPANY_PAGE,
37091
+ fieldMapping: companyFieldMapping
37092
+ }), jsx(HighExposureOwnershipStructure, {
37093
+ ...props,
37094
+ handleChangeFor,
37095
+ errors,
37096
+ data,
37097
+ valid,
37098
+ legalEntity: props.legalEntity,
37099
+ formUtils,
36715
37100
  fieldProblems
36716
37101
  })]
36717
37102
  });
36718
37103
  }
36719
- const highExposureParentCompanyDetailsFields = ["numberOfEmployees"];
36720
- function AdditionalFieldsForHighExposureParentCompany({
36721
- requiredFields,
36722
- ...props
36723
- }) {
37104
+ const parentCompanyFieldMapping$1 = {
37105
+ legalName: "parentLegalName",
37106
+ legalForm: "parentLegalForm",
37107
+ naceCode: "parentNaceCode",
37108
+ numberOfEmployees: "parentNumberOfEmployees",
37109
+ doesTheCompanyEarnMoreThanHalf: "doesTheParentCompanyEarnMoreThanHalf",
37110
+ doesYourCompanyHaveLEI: "doesYourParentCompanyHaveLEI",
37111
+ legalEntityIdentifier: "parentLegalEntityIdentifier",
37112
+ doesNotKnowNumberOfEmployees: "doesNotKnowParentNumberOfEmployees"
37113
+ };
37114
+ const highExposureParentCompanyDetailsFields = Object.values(parentCompanyFieldMapping$1);
37115
+ function AdditionalFieldsForHighExposureParentCompany(props) {
36724
37116
  const {
36725
37117
  i18n
36726
37118
  } = useI18nContext();
@@ -36732,14 +37124,15 @@ function AdditionalFieldsForHighExposureParentCompany({
36732
37124
  fieldProblems
36733
37125
  } = useForm({
36734
37126
  ...props,
36735
- schema: ["numberOfEmployees"],
37127
+ schema: highExposureParentCompanyDetailsFields,
36736
37128
  defaultData: {
36737
37129
  ...props.data
36738
37130
  },
36739
- rules: props.validators || highExposureCompanyDetailsValidations,
37131
+ rules: props.validators || highExposureParentCompanyDetailsValidations,
36740
37132
  fieldProblems: props == null ? void 0 : props.fieldValidationErrors
36741
37133
  });
36742
37134
  const formUtils = formUtilities(props, i18n);
37135
+ const highExposureHandleChangeFor = handleChangeFor;
36743
37136
  const {
36744
37137
  updateStateSlice
36745
37138
  } = useGlobalDataSlice("parentCompany");
@@ -36752,39 +37145,47 @@ function AdditionalFieldsForHighExposureParentCompany({
36752
37145
  });
36753
37146
  }, [data, valid, errors, fieldProblems]);
36754
37147
  return jsxs("form", {
36755
- className: "adyen-kyc__registration-details",
36756
- children: [jsx(FormHeader, {
36757
- heading: props.heading
37148
+ className: "adyen-kyc__high-exposure-company",
37149
+ children: [jsx(Typography, {
37150
+ el: "h1",
37151
+ variant: "title-l",
37152
+ children: i18n.get("parentCompanyInformation")
37153
+ }), jsx(Typography, {
37154
+ el: "p",
37155
+ variant: "body",
37156
+ children: i18n.get("inTheLastStepOwnedByAParentCompany")
36758
37157
  }), jsx(ErrorPanel, {
36759
37158
  verificationErrors: props.formVerificationErrors,
36760
37159
  validationErrors: props == null ? void 0 : props.fieldValidationErrors,
36761
37160
  formUtils,
36762
37161
  id: "ariaErrorField"
36763
- }), formUtils.isRequiredField("numberOfEmployees") && jsx(Field, {
36764
- name: "numberOfEmployees",
36765
- label: formUtils.getLabel("numberOfEmployees", "numberOfEmployees"),
36766
- classNameModifiers: ["legalName"],
36767
- errorMessage: formUtils.getErrorMessage("numberOfEmployees", errors, fieldProblems),
36768
- isValid: valid.numberOfEmployees,
36769
- children: (childProps) => jsx(InputText, {
36770
- ...childProps,
36771
- name: "numberOfEmployees",
36772
- value: data.numberOfEmployees,
36773
- readonly: formUtils.isReadOnly("numberOfEmployees"),
36774
- classNameModifiers: ["legalName"],
36775
- onInput: handleChangeFor("numberOfEmployees", "input"),
36776
- onBlur: handleChangeFor("numberOfEmployees", "blur"),
36777
- "aria-required": true,
36778
- "aria-label": formUtils.getLabel("numberOfEmployees"),
36779
- "aria-invalid": !valid.numberOfEmployees
36780
- })
37162
+ }), jsx(HighExposureBusinessInformation, {
37163
+ ...props,
37164
+ handleChangeFor: highExposureHandleChangeFor,
37165
+ sectionHeading: "businessInformation",
37166
+ errors,
37167
+ data,
37168
+ valid,
37169
+ country: props.country,
37170
+ formUtils,
37171
+ fieldProblems,
37172
+ targetPage: HighExposurePagesEnums.PARENT_COMPANY_PAGE,
37173
+ fieldMapping: parentCompanyFieldMapping$1
36781
37174
  })]
36782
37175
  });
36783
37176
  }
36784
- function AdditionalFieldsForHighExposureUltimateParentCompany({
36785
- requiredFields,
36786
- ...props
36787
- }) {
37177
+ const parentCompanyFieldMapping = {
37178
+ legalName: "ultimateParentLegalName",
37179
+ legalForm: "ultimateParentLegalForm",
37180
+ naceCode: "ultimateParentNaceCode",
37181
+ numberOfEmployees: "ultimateParentNumberOfEmployees",
37182
+ doesTheCompanyEarnMoreThanHalf: "doesTheUltimateParentCompanyEarnMoreThanHalf",
37183
+ doesYourCompanyHaveLEI: "doesYourUltimateParentCompanyHaveLEI",
37184
+ legalEntityIdentifier: "ultimateParentLegalEntityIdentifier",
37185
+ doesNotKnowNumberOfEmployees: "doesNotKnowUltimateParentNumberOfEmployees"
37186
+ };
37187
+ const highExposureUltimateParentCompanyDetailsFields = Object.values(parentCompanyFieldMapping);
37188
+ function AdditionalFieldsForHighExposureUltimateParentCompany(props) {
36788
37189
  const {
36789
37190
  i18n
36790
37191
  } = useI18nContext();
@@ -36796,14 +37197,15 @@ function AdditionalFieldsForHighExposureUltimateParentCompany({
36796
37197
  fieldProblems
36797
37198
  } = useForm({
36798
37199
  ...props,
36799
- schema: ["numberOfEmployees"],
37200
+ schema: highExposureUltimateParentCompanyDetailsFields,
36800
37201
  defaultData: {
36801
37202
  ...props.data
36802
37203
  },
36803
- rules: props.validators || highExposureCompanyDetailsValidations,
37204
+ rules: props.validators || highExposureUltimateParentCompanyDetailsValidations,
36804
37205
  fieldProblems: props == null ? void 0 : props.fieldValidationErrors
36805
37206
  });
36806
37207
  const formUtils = formUtilities(props, i18n);
37208
+ const highExposureHandleChangeFor = handleChangeFor;
36807
37209
  const {
36808
37210
  updateStateSlice
36809
37211
  } = useGlobalDataSlice("ultimateParentCompany");
@@ -36816,32 +37218,32 @@ function AdditionalFieldsForHighExposureUltimateParentCompany({
36816
37218
  });
36817
37219
  }, [data, valid, errors, fieldProblems]);
36818
37220
  return jsxs("form", {
36819
- className: "adyen-kyc__registration-details",
36820
- children: [jsx(FormHeader, {
36821
- heading: props.heading
37221
+ className: "adyen-kyc__high-exposure-company",
37222
+ children: [jsx(Typography, {
37223
+ el: "h1",
37224
+ variant: "title-l",
37225
+ children: i18n.get("ultimateParentCompanyInformation")
37226
+ }), jsx(Typography, {
37227
+ el: "p",
37228
+ variant: "body",
37229
+ children: i18n.get("inThePreviousStepOwnedByAnUltimateParentCompany")
36822
37230
  }), jsx(ErrorPanel, {
36823
37231
  verificationErrors: props.formVerificationErrors,
36824
37232
  validationErrors: props == null ? void 0 : props.fieldValidationErrors,
36825
37233
  formUtils,
36826
37234
  id: "ariaErrorField"
36827
- }), formUtils.isRequiredField("numberOfEmployees") && jsx(Field, {
36828
- name: "numberOfEmployees",
36829
- label: formUtils.getLabel("numberOfEmployees", "numberOfEmployees"),
36830
- classNameModifiers: ["legalName"],
36831
- errorMessage: formUtils.getErrorMessage("numberOfEmployees", errors, fieldProblems),
36832
- isValid: valid.numberOfEmployees,
36833
- children: (childProps) => jsx(InputText, {
36834
- ...childProps,
36835
- name: "numberOfEmployees",
36836
- value: data.numberOfEmployees,
36837
- readonly: formUtils.isReadOnly("numberOfEmployees"),
36838
- classNameModifiers: ["legalName"],
36839
- onInput: handleChangeFor("numberOfEmployees", "input"),
36840
- onBlur: handleChangeFor("numberOfEmployees", "blur"),
36841
- "aria-required": true,
36842
- "aria-label": formUtils.getLabel("numberOfEmployees"),
36843
- "aria-invalid": !valid.numberOfEmployees
36844
- })
37235
+ }), jsx(HighExposureBusinessInformation, {
37236
+ ...props,
37237
+ handleChangeFor: highExposureHandleChangeFor,
37238
+ sectionHeading: "businessInformation",
37239
+ errors,
37240
+ data,
37241
+ valid,
37242
+ country: props.country,
37243
+ formUtils,
37244
+ fieldProblems,
37245
+ targetPage: HighExposurePagesEnums.ULTIMATE_PARENT_COMPANY_PAGE,
37246
+ fieldMapping: parentCompanyFieldMapping
36845
37247
  })]
36846
37248
  });
36847
37249
  }
@@ -36872,20 +37274,15 @@ function HighExposureDropinComponent(props) {
36872
37274
  const highExposureCompanyDetailsFormProps = getFormProps(props, companyFormId);
36873
37275
  const highExposureParentCompanyDetailsFormProps = getFormProps(props, parentCompanyFormId);
36874
37276
  const highExposureUltimateParentCompanyDetailsFormProps = getFormProps(props, ultimateParentCompanyFormId);
36875
- const renderActiveForm = (activeForm) => jsxs("div", {
37277
+ const renderActiveForm = (activeForm) => jsx("div", {
36876
37278
  className: "adyen-kyc",
36877
- children: [jsx(ContextGuidance, {
36878
- page: "High exposure company details page",
36879
- titleId: "whyDoINeedToFillInThisInformation",
36880
- contentId: "euFinancialRegulationsRequireUs",
36881
- title: i18n.get("whyDoINeedToFillInThisInformation"),
36882
- content: i18n.get("euFinancialRegulationsRequireUs")
36883
- }), jsxs("div", {
37279
+ children: jsxs("div", {
36884
37280
  className: "adyen-kyc-form-wrapper",
36885
37281
  children: [activeForm.formId === companyFormId && jsx(AdditionalFieldsForHighExposureCompany, {
36886
37282
  ...highExposureCompanyDetailsFormProps,
36887
37283
  legalEntityId: props.legalEntityId,
36888
- heading: i18n.get("detailsForCapital"),
37284
+ legalEntity: props.legalEntity,
37285
+ heading: i18n.get("yourBusinessDetails"),
36889
37286
  id: companyFormId,
36890
37287
  country: props.country
36891
37288
  }), activeForm.formId === parentCompanyFormId && jsx(AdditionalFieldsForHighExposureParentCompany, {
@@ -36901,7 +37298,7 @@ function HighExposureDropinComponent(props) {
36901
37298
  id: companyFormId,
36902
37299
  country: props.country
36903
37300
  })]
36904
- })]
37301
+ })
36905
37302
  });
36906
37303
  return jsx("div", {
36907
37304
  className: "adyen-kyc",
@@ -36916,6 +37313,24 @@ const customLabels = {
36916
37313
  company: {
36917
37314
  legalForm: "businessStructure",
36918
37315
  naceCode: "industryAndNaceCode"
37316
+ },
37317
+ parentCompany: {
37318
+ parentLegalName: "legalName",
37319
+ parentLegalForm: "businessStructure",
37320
+ parentNaceCode: "industryAndNaceCode",
37321
+ parentNumberOfEmployees: "numberOfEmployees",
37322
+ doesTheParentCompanyEarnMoreThanHalf: "doesTheCompanyEarnMoreThanHalf",
37323
+ doesYourParentCompanyHaveLEI: "doesThisCompanyHaveLEI",
37324
+ parentLegalEntityIdentifier: "legalEntityIdentifier"
37325
+ },
37326
+ ultimateParentCompany: {
37327
+ ultimateParentLegalName: "legalName",
37328
+ ultimateParentLegalForm: "businessStructure",
37329
+ ultimateParentNaceCode: "industryAndNaceCode",
37330
+ ultimateParentNumberOfEmployees: "numberOfEmployees",
37331
+ doesTheUltimateParentCompanyEarnMoreThanHalf: "doesTheCompanyEarnMoreThanHalf",
37332
+ doesYourUltimateParentCompanyHaveLEI: "doesThisCompanyHaveLEI",
37333
+ ultimateParentLegalEntityIdentifier: "legalEntityIdentifier"
36919
37334
  }
36920
37335
  };
36921
37336
  function UpdateLegalEntityForHighExposure({
@@ -36929,16 +37344,17 @@ function UpdateLegalEntityForHighExposure({
36929
37344
  hideDropinLayout,
36930
37345
  handleHomeClick,
36931
37346
  homeButtonLabel,
36932
- legalEntityId
37347
+ legalEntityId,
37348
+ legalEntity: legalEntityProps
36933
37349
  }) {
36934
- var _a;
37350
+ var _a, _b, _c;
36935
37351
  const {
36936
37352
  getLegalEntity: getLegalEntity2
36937
37353
  } = useComponentApi(legalEntityId);
36938
37354
  const {
36939
37355
  i18n
36940
37356
  } = useI18nContext();
36941
- const [legalEntity, setLegalEntity] = useState();
37357
+ const [legalEntity, setLegalEntity] = useState(legalEntityProps);
36942
37358
  const fetchLegalEntity = useCallback(async () => {
36943
37359
  const legalEntityResponse = await getLegalEntity2(legalEntityId);
36944
37360
  setLegalEntity(legalEntityResponse);
@@ -36963,6 +37379,7 @@ function UpdateLegalEntityForHighExposure({
36963
37379
  } = useToastContext();
36964
37380
  const [loadingStatus, setLoadingStatus] = useState("success");
36965
37381
  const formRef = useRef(null);
37382
+ const [highExposureRequiredForms, setHighExposureRequiredForms] = useState(highExposureForms);
36966
37383
  const getConfigurationData = useCallback(() => getConfiguration2({
36967
37384
  legalEntityType: LegalEntityType.ORGANIZATION,
36968
37385
  capabilities,
@@ -36989,10 +37406,33 @@ function UpdateLegalEntityForHighExposure({
36989
37406
  });
36990
37407
  onChange == null ? void 0 : onChange(currentState);
36991
37408
  }, [currentState]);
37409
+ useEffect(() => {
37410
+ var _a2, _b2;
37411
+ const showParentCompany = ((_a2 = data == null ? void 0 : data.company) == null ? void 0 : _a2.isCompanyOwnedByAnotherCompany) === "Yes";
37412
+ const showUltimateParentCompany = ((_b2 = data == null ? void 0 : data.company) == null ? void 0 : _b2.isParentOwnedByAnotherCompany) === "Yes";
37413
+ let updateForms = {
37414
+ company: {
37415
+ ...highExposureForms.company
37416
+ }
37417
+ };
37418
+ if (showParentCompany) {
37419
+ updateForms = {
37420
+ ...updateForms,
37421
+ parentCompany: highExposureForms.parentCompany
37422
+ };
37423
+ }
37424
+ if (showParentCompany && showUltimateParentCompany) {
37425
+ updateForms = {
37426
+ ...updateForms,
37427
+ ultimateParentCompany: highExposureForms.ultimateParentCompany
37428
+ };
37429
+ }
37430
+ setHighExposureRequiredForms(updateForms);
37431
+ }, [(_a = data == null ? void 0 : data.company) == null ? void 0 : _a.isCompanyOwnedByAnotherCompany, (_b = data == null ? void 0 : data.company) == null ? void 0 : _b.isParentOwnedByAnotherCompany]);
36992
37432
  const forms2 = useMemo(() => {
36993
- const requiredForms = getRequiredForms(highExposureForms, derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields);
37433
+ const requiredForms = getRequiredForms(highExposureRequiredForms, derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields);
36994
37434
  return addValidityToForms(requiredForms, formValidity, problems);
36995
- }, [derivedProps, formValidity, problems]);
37435
+ }, [derivedProps == null ? void 0 : derivedProps.optionalFields, derivedProps == null ? void 0 : derivedProps.requiredFields, formValidity, highExposureRequiredForms, problems]);
36996
37436
  const onSubmit = async () => {
36997
37437
  setLoadingStatus("loading");
36998
37438
  const exposureDetails = mapHighExposureToLegalEntity(data);
@@ -37057,7 +37497,7 @@ function UpdateLegalEntityForHighExposure({
37057
37497
  onSubmit
37058
37498
  });
37059
37499
  return jsx(FormWrapper, {
37060
- taskName: "detailsForCapital",
37500
+ taskName: "progress",
37061
37501
  handleNextClick,
37062
37502
  handleBackClick,
37063
37503
  gotoFormByFormIndex,
@@ -37083,10 +37523,11 @@ function UpdateLegalEntityForHighExposure({
37083
37523
  activeForm,
37084
37524
  capabilities,
37085
37525
  data,
37086
- country: ((_a = data == null ? void 0 : data.company) == null ? void 0 : _a.country) ?? country2,
37526
+ country: ((_c = data == null ? void 0 : data.company) == null ? void 0 : _c.country) ?? country2,
37087
37527
  problems,
37088
37528
  shouldValidate,
37089
- ref: formRef
37529
+ ref: formRef,
37530
+ legalEntity
37090
37531
  })
37091
37532
  });
37092
37533
  }
@@ -37674,39 +38115,40 @@ const verifyIdNumber = async (context, request) => {
37674
38115
  const getKycExternalApi = ({
37675
38116
  loadingContext,
37676
38117
  clientKey
37677
- }) => {
37678
- const datasetBaseUrl = `/onboardingcomponents/api/${COMPONENTS_API_VERSION}/datasets/`;
37679
- return {
37680
- getConfiguration: async (request) => getConfiguration({
37681
- loadingContext,
37682
- clientKey
37683
- }, request),
37684
- getAllowedCountries: async () => getAllowedCountries({
37685
- loadingContext,
37686
- clientKey
37687
- }),
37688
- getAllowedLocales: async () => getAllowedLocales({
37689
- loadingContext,
37690
- clientKey
37691
- }),
37692
- getDataset: async (name, locale) => getDataset({
37693
- loadingContext,
37694
- clientKey
37695
- }, name, locale),
37696
- loadDocumentGuidance: async () => loadDocumentGuidance(loadingContext),
37697
- verifyIdNumber: async (request) => verifyIdNumber({
37698
- loadingContext,
37699
- clientKey
37700
- }, request),
37701
- validatePhoneNumber: async (phoneNumber2) => validatePhoneNumber({
37702
- loadingContext,
37703
- clientKey
37704
- }, phoneNumber2),
37705
- getImageUrl: () => `${loadingContext}static/images/`,
37706
- getLegalForms: async (countryCode) => getLegalForms(datasetBaseUrl, countryCode),
37707
- getNaceCodes: async () => getNaceCodes(datasetBaseUrl)
37708
- };
37709
- };
38118
+ }) => ({
38119
+ getConfiguration: async (request) => getConfiguration({
38120
+ loadingContext,
38121
+ clientKey
38122
+ }, request),
38123
+ getAllowedCountries: async () => getAllowedCountries({
38124
+ loadingContext,
38125
+ clientKey
38126
+ }),
38127
+ getAllowedLocales: async () => getAllowedLocales({
38128
+ loadingContext,
38129
+ clientKey
38130
+ }),
38131
+ getDataset: async (name, locale) => getDataset({
38132
+ loadingContext,
38133
+ clientKey
38134
+ }, name, locale),
38135
+ loadDocumentGuidance: async () => loadDocumentGuidance(loadingContext),
38136
+ verifyIdNumber: async (request) => verifyIdNumber({
38137
+ loadingContext,
38138
+ clientKey
38139
+ }, request),
38140
+ validatePhoneNumber: async (phoneNumber2) => validatePhoneNumber({
38141
+ loadingContext,
38142
+ clientKey
38143
+ }, phoneNumber2),
38144
+ getImageUrl: () => `${loadingContext}static/images/`,
38145
+ getLegalForms: async () => {
38146
+ throw new Error("getLegalForms not implemented in kycexternalapi");
38147
+ },
38148
+ getNaceCodes: async () => {
38149
+ throw new Error("getNaceCodes not implemented in kycexternalapi");
38150
+ }
38151
+ });
37710
38152
  const ConfigurationApiProvider = ({
37711
38153
  children,
37712
38154
  onUserEvent,
@@ -37718,7 +38160,7 @@ const ConfigurationApiProvider = ({
37718
38160
  isEmbeddedDropin,
37719
38161
  loadingContext
37720
38162
  } = authContext;
37721
- const sdkVersion = "2.46.0";
38163
+ const sdkVersion = "2.47.0";
37722
38164
  useAnalytics({
37723
38165
  onUserEvent,
37724
38166
  legalEntityId: rootLegalEntityId,
@@ -38102,8 +38544,7 @@ const Toast = ({
38102
38544
  onToastAction
38103
38545
  }) => {
38104
38546
  const toastRef = useRef(null);
38105
- const loading2 = type === "loading";
38106
- const successToast = type === "loading";
38547
+ const isLoading = type === "loading";
38107
38548
  const labelId = getUniqueId("toast");
38108
38549
  const handleShow = useCallback(() => {
38109
38550
  var _a;
@@ -38120,52 +38561,49 @@ const Toast = ({
38120
38561
  setTimeout(() => handleHide(), duration);
38121
38562
  }
38122
38563
  }, [label, duration, handleHide, handleShow]);
38564
+ const statusClassMap = Object.freeze({
38565
+ info: "",
38566
+ loading: "adyen-kyc-toast__loading",
38567
+ success: "adyen-kyc-toast__success",
38568
+ error: "adyen-kyc-toast__error"
38569
+ });
38123
38570
  return jsxs("div", {
38124
38571
  ref: toastRef,
38125
38572
  role: actionLabel ? "alertdialog" : "alert",
38126
- className: "adyen-kyc-toast",
38573
+ className: `adyen-kyc-toast ${statusClassMap[type]}`,
38127
38574
  "aria-labelledby": labelId,
38128
- children: [loading2 && jsx("div", {
38575
+ children: [isLoading && jsx("div", {
38129
38576
  className: "adyen-kyc-toast__loader",
38130
- children: jsx("div", {
38131
- className: "adyen-kyc-loading-indicator adyen-kyc-loading-indicator--small adyen-kyc-loading-indicator--dark"
38577
+ children: jsx(Spinner, {
38578
+ size: "small"
38132
38579
  })
38133
- }), !loading2 && jsxs("div", {
38134
- className: cx("adyen-kyc-toast__status", {
38135
- "adyen-kyc-toast__status--success": successToast,
38136
- "adyen-kyc-toast__status--error": !successToast
38137
- }),
38138
- children: [successToast && jsx(Icon, {
38139
- className: "adyen-kyc-toast__status-icon",
38140
- name: "checkmark"
38141
- }), !successToast && jsx(Icon, {
38142
- className: "adyen-kyc-toast__status-icon",
38143
- name: "cross"
38144
- })]
38145
38580
  }), jsxs("div", {
38146
38581
  className: "adyen-kyc-toast__message",
38147
38582
  children: [jsx("span", {
38148
38583
  id: labelId,
38149
38584
  className: "adyen-kyc-toast__title",
38150
38585
  children: label
38151
- }), actionLabel && jsx("button", {
38152
- className: "adyen-kyc-link adyen-kyc-toast__action",
38153
- title: "performAction",
38154
- type: "button",
38155
- onClick: onToastAction,
38156
- children: actionLabel
38157
- }), !loading2 && subLabel && jsx("span", {
38586
+ }), !isLoading && subLabel && jsx("span", {
38158
38587
  className: "adyen-kyc-toast__subtitle",
38159
38588
  children: subLabel
38160
38589
  })]
38161
- }), !loading2 && jsx("button", {
38162
- className: "adyen-kyc-toast__close",
38163
- title: "close",
38164
- type: "button",
38165
- onClick: handleHide,
38166
- children: jsx(Icon, {
38167
- name: "cross"
38168
- })
38590
+ }), jsxs("div", {
38591
+ className: "adyen-kyc-toast__actions",
38592
+ children: [!isLoading && jsx("button", {
38593
+ className: "adyen-kyc-toast__close",
38594
+ title: "close",
38595
+ type: "button",
38596
+ onClick: handleHide,
38597
+ children: jsx(Icon, {
38598
+ name: "cross"
38599
+ })
38600
+ }), actionLabel && jsx(Button, {
38601
+ onClick: onToastAction ?? noop,
38602
+ className: "adyen-kyc-link adyen-kyc-toast__action adyen-kyc-u-margin-right-8",
38603
+ title: "performAction",
38604
+ label: actionLabel,
38605
+ tertiary: true
38606
+ })]
38169
38607
  })]
38170
38608
  });
38171
38609
  };
@@ -39159,18 +39597,12 @@ const validateCoreOptions = (coreOptions) => {
39159
39597
  if (!(coreOptions.sdkToken && coreOptions.getSdkToken) && !coreOptions.clientKey) {
39160
39598
  throw new Error(`
39161
39599
 
39162
- Please specify either sdkToken and getSdkToken handler or a clientKey for the SDK to initialize!
39163
-
39164
-
39165
- - For more information please check: https://docs.adyen.com/platforms/onboard-users/components/?tab=npm_recommended__1#step-7-initiate-the-onboarding-component`);
39600
+ Missing or invalid parameters. Specify either the sdkToken and getSdkToken handler or a clientKey in your request to initialize the component.`);
39166
39601
  }
39167
39602
  if (missing.length > 0) {
39168
39603
  throw new Error(`
39169
39604
 
39170
- Please specify a ${listify(missing)} for the SDK to initialize!
39171
-
39172
- - For more information please check: https://docs.adyen.com/platforms/onboard-users/components/?tab=npm_recommended__1#step-7-initiate-the-onboarding-component
39173
- `);
39605
+ Missing or invalid parameters. Specify ${listify(missing)} in your request to initialize the component.`);
39174
39606
  }
39175
39607
  };
39176
39608
  const validateComponentOptions = (componentName, options) => {