@adyen/kyc-components 3.18.1 → 3.19.1

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 (48) hide show
  1. package/dist/es/adyen-kyc-components.es.js +1367 -484
  2. package/dist/style.css +1134 -2304
  3. package/dist/types/components/BusinessDetails/forms.d.ts +2 -1
  4. package/dist/types/components/CompanyOtherDetails/types.d.ts +2 -1
  5. package/dist/types/components/CompanyRegistrationDetails/types.d.ts +1 -0
  6. package/dist/types/components/Dropins/CompanyDropin/components/CompanyDropinComponent.d.ts +1 -1
  7. package/dist/types/components/Dropins/CompanyDropin/types.d.ts +0 -2
  8. package/dist/types/components/Dropins/HighExposureDropin/components/AdditionalFieldsForHighExposureCompany.d.ts +4 -0
  9. package/dist/types/components/Dropins/HighExposureDropin/components/AdditionalFieldsForHighExposureParentCompany.d.ts +4 -0
  10. package/dist/types/components/Dropins/HighExposureDropin/components/AdditionalFieldsForHighExposureUltimateParentCompany.d.ts +4 -0
  11. package/dist/types/components/Dropins/HighExposureDropin/components/HighExposureDropinComponent.d.ts +6 -0
  12. package/dist/types/components/Dropins/HighExposureDropin/types.d.ts +34 -0
  13. package/dist/types/components/Dropins/HighExposureDropin/validate.d.ts +3 -0
  14. package/dist/types/components/EmbeddedDropins/OnboardingDropinComponent/OnboardingDropinComponent.d.ts +2 -1
  15. package/dist/types/components/EmbeddedDropins/UpdateLegalEntityForHighExposure/UpdateLegalEntityForHighExposure.d.ts +2 -0
  16. package/dist/types/components/Individual/types.d.ts +3 -1
  17. package/dist/types/components/SingpassBanner/index.d.ts +2 -0
  18. package/dist/types/components/SingpassSelection/index.d.ts +1 -0
  19. package/dist/types/components/SingpassSelection/types.d.ts +4 -0
  20. package/dist/types/components/index.d.ts +2 -0
  21. package/dist/types/components/internal/DocumentGuidance/DocumentGuidance.d.ts +1 -1
  22. package/dist/types/components/internal/FormFields/Field/Field.d.ts +5 -3
  23. package/dist/types/components/internal/IdFieldTypeSelector/countryIdNumberTypes.d.ts +8 -0
  24. package/dist/types/components/internal/IdFieldTypeSelector/inferTaxIdNumberType.d.ts +4 -1
  25. package/dist/types/components/internal/StockISINField/types.d.ts +1 -1
  26. package/dist/types/components/internal/StockTickerSymbol/StockTickerSymbolField.d.ts +3 -0
  27. package/dist/types/components/internal/StockTickerSymbol/fieldConfig.d.ts +3 -0
  28. package/dist/types/components/internal/StockTickerSymbol/index.d.ts +1 -0
  29. package/dist/types/components/internal/StockTickerSymbol/types.d.ts +5 -0
  30. package/dist/types/components/internal/TaxId/fieldConfig.d.ts +3 -0
  31. package/dist/types/core/Context/ExperimentContext/types.d.ts +1 -0
  32. package/dist/types/core/Context/StateContext/types.d.ts +2 -1
  33. package/dist/types/core/Services/componentApi/{get-service-agreement-acceptance-info.d.ts → get-service-agreement-acceptance-infos.d.ts} +1 -1
  34. package/dist/types/core/Services/componentApi/push-events.d.ts +1 -2
  35. package/dist/types/core/hooks/useAnalytics.d.ts +9 -3
  36. package/dist/types/core/hooks/useCanSeeEntitySelection.d.ts +6 -0
  37. package/dist/types/core/process-field-configurations.d.ts +2 -0
  38. package/dist/types/core/user-events.d.ts +4 -8
  39. package/dist/types/core/utils.d.ts +1 -1
  40. package/dist/types/utils/api/processValidationErrors.d.ts +4 -1
  41. package/dist/types/utils/get-props.d.ts +17 -0
  42. package/dist/types/utils/getNestedPropertyKeys.d.ts +1 -1
  43. package/dist/types/utils/mapping/componentApiMapping.d.ts +11 -0
  44. package/dist/types/utils/mapping/mapping.d.ts +3 -0
  45. package/dist/types/utils/verification/helpers/verify-id-number-helper.d.ts +8 -3
  46. package/dist/types/utils/verification/verificationUtils.d.ts +14 -4
  47. package/package.json +7 -4
  48. package/dist/types/core/models/id-verification-status.d.ts +0 -7
@@ -4,9 +4,12 @@ import { sanitize } from "isomorphic-dompurify";
4
4
  import cx from "classnames";
5
5
  import { lazy, Suspense, useId, forwardRef, memo, useMemo as useMemo$1, useEffect as useEffect$1, useState as useState$1 } from "preact/compat";
6
6
  import { jsx, jsxs, Fragment } from "preact/jsx-runtime";
7
- import { debounce, noop as noop$1, isEmpty as isEmpty$1, range } from "lodash";
7
+ import debounce from "lodash-es/debounce";
8
8
  import isISIN from "validator/es/lib/isISIN.js";
9
9
  import OpenBankingSDK from "@adyen/openbankingsdk";
10
+ import isEmpty$1 from "lodash-es/isEmpty";
11
+ import noop$1 from "lodash-es/noop";
12
+ import range from "lodash-es/range";
10
13
  import { jsxs as jsxs$1, jsx as jsx$1 } from "preact/compat/jsx-runtime";
11
14
  import "@adyen/adyen-document-viewer/dist/adyen-document-viewer.min.css";
12
15
  import AdyenDocumentViewer from "@adyen/adyen-document-viewer";
@@ -43,7 +46,8 @@ const payoutAccount = "Payout account";
43
46
  const payinAccount = "Payin account";
44
47
  const firstName = "First name";
45
48
  const lastName = "Last name";
46
- const country = "Country/region of establishment";
49
+ const country = "Country/region";
50
+ const countryRegionOfEstablishment = "Country/region of establishment";
47
51
  const street = "Street";
48
52
  const otherAddressInformation = "Other address information (optional)";
49
53
  const postalCode = "Postal code";
@@ -481,6 +485,7 @@ const companyLegalName = "Company legal name";
481
485
  const companyName = "Company name";
482
486
  const companyType = "Company type";
483
487
  const taxReferenceNumber = "Tax reference number";
488
+ const taxpayerReferenceNumber = "Taxpayer reference number";
484
489
  const SST = "SST";
485
490
  const companyProfile = "Company profile";
486
491
  const companyNumber = "Company number";
@@ -580,7 +585,6 @@ const otherTrust = "Other trust";
580
585
  const pooledSuperannuationTrust = "Pooled superannuation trust";
581
586
  const publicTradingTrust = "Public trading trust";
582
587
  const unlistedPublicUnitTrust = "Unlisted public unit trust";
583
- const countryRegionOfEstablishment = "Country/region of establishment";
584
588
  const nameOfTrustAgreement = "Name of trust agreement";
585
589
  const typeOfTrustAgreement = "Type of trust agreement";
586
590
  const objectOfCharitableTrust = "Object of charitable trust";
@@ -852,7 +856,9 @@ const addresses = "Addresses";
852
856
  const loading = "Loading";
853
857
  const businessIncorporationNumber = "Business incorporation number";
854
858
  const doNotHaveBusinessIncorporationNumber = "I do not have a Business incorporation number";
859
+ const retrieveMyInfo = "Retrieve Myinfo";
855
860
  const retrieveMyInfoBusiness = "Retrieve Myinfo business";
861
+ const getYourVerifiedDetailsInstantly = "Get your verified details instantly and skip uploading documents.";
856
862
  const getYourBusinessVerifiedDetails = "Get your business's verified details instantly and skip uploading documents.";
857
863
  const enterTheDetailsYourself = "Enter the details yourself";
858
864
  const youAlsoHaveToUploadSomeSupportingDocuments = "You'll also have to upload some supporting documents.";
@@ -933,6 +939,7 @@ const taxInformationNumber = "Tax Identification Number";
933
939
  const taxInformationNumber__HK = "Business Registration number (BRN)";
934
940
  const stockExchangeMIC = "Market Identifier Code (MIC)";
935
941
  const stockISIN = "International Securities Identification Number (ISIN)";
942
+ const stockTickerSymbol = "Stock ticker symbol";
936
943
  const companyLookupResultsHeader = "Let's find your company";
937
944
  const companyLookupResultsHeader__searching = "Searching for companies...";
938
945
  const companyLookupResultsHeader__verifying = "Verifying company selection...";
@@ -1320,8 +1327,9 @@ const onboardingRedirectOpenError = "Pop-up blocker prevented redirecting, pleas
1320
1327
  const forExample_ = "For example: %{examples}";
1321
1328
  const failToLaunchSingpass = "failed to launch Singpass";
1322
1329
  const retrieveMyinfoBusinessWith = "Retrieve Myinfo business with";
1330
+ const retrieveMyinfoWith = "Retrieve Myinfo with";
1323
1331
  const getSetUpInstantly = "Get set up instantly";
1324
- const MyInfoBusinessYouCanGetVerifiedDetails = "With Myinfo business, you can get your business's verified details instantly and skip uploading documents.";
1332
+ const myInfoBusinessYouCanGetVerifiedDetails = "With Myinfo business, you can get your business's verified details instantly and skip uploading documents.";
1325
1333
  const addBankDetails = "Add bank details";
1326
1334
  const addMissingBankDetails = "We are missing your bank details in order to perform payouts, please add your bank account.";
1327
1335
  const bankDetails = "Bank details";
@@ -1335,6 +1343,7 @@ const missingDetailsToPerformPayouts = "We are missing some details in order to
1335
1343
  const completeAddingAccount = "Complete adding account";
1336
1344
  const removeThisBankAccount = "Remove this bank account";
1337
1345
  const editDetails = "Edit details";
1346
+ const myInfoYouCanGetVerifiedDetails = "With Myinfo, you can get your verified details instantly and skip uploading documents.";
1338
1347
  const sessionTimeout = "Session timeout";
1339
1348
  const thisSessionWillExpireIn = "This session will expire in %{timeUntilExpiry}. Continue working to avoid losing any unsaved data.";
1340
1349
  const xMinutes = "%{minutes} minutes";
@@ -1345,6 +1354,14 @@ const thisPageIsNowInactive = "This page is now inactive";
1345
1354
  const startANewSessionFromTheSamePlaceYouOriginallyAccessed = "Start a new session from the same place you originally accessed this page.";
1346
1355
  const differentCountryOfGoverningLaw = "This company has a different country/region of governing law";
1347
1356
  const countryOfGoverningLaw = "Country/region of governing law";
1357
+ const nationalInsuranceNumber = "National Insurance Number (NINO)";
1358
+ const detailsForCapital = "Details for capital";
1359
+ const parentCompany = "Parent company";
1360
+ const ultimateParentCompany = "Ultimate parent company";
1361
+ const numberOfEmployees = "Number of employees";
1362
+ const parentCompanyDetails = "Parent company details";
1363
+ const ultimateParentCompanyDetails = "Ultimate parent company details";
1364
+ const euFinancialRegulationsRequireUs = "EU financial regulations require us to collect this information. This won’t affect your business credit score.";
1348
1365
  const defaultTrans = {
1349
1366
  smartling,
1350
1367
  close,
@@ -1354,6 +1371,7 @@ const defaultTrans = {
1354
1371
  firstName,
1355
1372
  lastName,
1356
1373
  country,
1374
+ countryRegionOfEstablishment,
1357
1375
  street,
1358
1376
  otherAddressInformation,
1359
1377
  postalCode,
@@ -1791,6 +1809,7 @@ const defaultTrans = {
1791
1809
  companyName,
1792
1810
  companyType,
1793
1811
  taxReferenceNumber,
1812
+ taxpayerReferenceNumber,
1794
1813
  SST,
1795
1814
  companyProfile,
1796
1815
  companyNumber,
@@ -1895,7 +1914,6 @@ const defaultTrans = {
1895
1914
  pooledSuperannuationTrust,
1896
1915
  publicTradingTrust,
1897
1916
  unlistedPublicUnitTrust,
1898
- countryRegionOfEstablishment,
1899
1917
  nameOfTrustAgreement,
1900
1918
  typeOfTrustAgreement,
1901
1919
  objectOfCharitableTrust,
@@ -2170,7 +2188,9 @@ const defaultTrans = {
2170
2188
  loading,
2171
2189
  businessIncorporationNumber,
2172
2190
  doNotHaveBusinessIncorporationNumber,
2191
+ retrieveMyInfo,
2173
2192
  retrieveMyInfoBusiness,
2193
+ getYourVerifiedDetailsInstantly,
2174
2194
  getYourBusinessVerifiedDetails,
2175
2195
  enterTheDetailsYourself,
2176
2196
  youAlsoHaveToUploadSomeSupportingDocuments,
@@ -2251,6 +2271,7 @@ const defaultTrans = {
2251
2271
  taxInformationNumber__HK,
2252
2272
  stockExchangeMIC,
2253
2273
  stockISIN,
2274
+ stockTickerSymbol,
2254
2275
  companyLookupResultsHeader,
2255
2276
  companyLookupResultsHeader__searching,
2256
2277
  companyLookupResultsHeader__verifying,
@@ -2638,8 +2659,9 @@ const defaultTrans = {
2638
2659
  forExample_,
2639
2660
  failToLaunchSingpass,
2640
2661
  retrieveMyinfoBusinessWith,
2662
+ retrieveMyinfoWith,
2641
2663
  getSetUpInstantly,
2642
- MyInfoBusinessYouCanGetVerifiedDetails,
2664
+ myInfoBusinessYouCanGetVerifiedDetails,
2643
2665
  addBankDetails,
2644
2666
  addMissingBankDetails,
2645
2667
  bankDetails,
@@ -2653,6 +2675,7 @@ const defaultTrans = {
2653
2675
  completeAddingAccount,
2654
2676
  removeThisBankAccount,
2655
2677
  editDetails,
2678
+ myInfoYouCanGetVerifiedDetails,
2656
2679
  sessionTimeout,
2657
2680
  thisSessionWillExpireIn,
2658
2681
  xMinutes,
@@ -2664,7 +2687,15 @@ const defaultTrans = {
2664
2687
  thisPageIsNowInactive,
2665
2688
  startANewSessionFromTheSamePlaceYouOriginallyAccessed,
2666
2689
  differentCountryOfGoverningLaw,
2667
- countryOfGoverningLaw
2690
+ countryOfGoverningLaw,
2691
+ nationalInsuranceNumber,
2692
+ detailsForCapital,
2693
+ parentCompany,
2694
+ ultimateParentCompany,
2695
+ numberOfEmployees,
2696
+ parentCompanyDetails,
2697
+ ultimateParentCompanyDetails,
2698
+ euFinancialRegulationsRequireUs
2668
2699
  };
2669
2700
  const FALLBACK_LOCALE = "en-US";
2670
2701
  const defaultTranslation = Object.entries(defaultTrans).reduce((acc, [translationKey, translationValue]) => translationKey !== "smartling" ? {
@@ -3106,7 +3137,7 @@ const icons = {
3106
3137
  warning: lazy(() => import("./warning-99uFf1WU.js")),
3107
3138
  wrong: lazy(() => import("./wrong-1wvh7nZe.js"))
3108
3139
  };
3109
- const logger$y = createLogger("Icon");
3140
+ const logger$z = createLogger("Icon");
3110
3141
  const Icon = ({
3111
3142
  className,
3112
3143
  name,
@@ -3114,7 +3145,7 @@ const Icon = ({
3114
3145
  }) => {
3115
3146
  const LazyLoadedIcon = icons[name];
3116
3147
  if (!LazyLoadedIcon) {
3117
- logger$y.error(`No such icon: "${name}"`);
3148
+ logger$z.error(`No such icon: "${name}"`);
3118
3149
  return null;
3119
3150
  }
3120
3151
  return jsx("span", {
@@ -3330,7 +3361,7 @@ function useFormRouterContext() {
3330
3361
  }
3331
3362
  return context;
3332
3363
  }
3333
- const logger$x = createLogger("Link");
3364
+ const logger$y = createLogger("Link");
3334
3365
  const getIconClass = (icon, external) => {
3335
3366
  if (external) {
3336
3367
  return "adyen-kyc-link__icon adyen-kyc-icon-external-link";
@@ -3342,7 +3373,7 @@ const getIconClass = (icon, external) => {
3342
3373
  };
3343
3374
  const isValidLink = (href) => {
3344
3375
  if (href === "#") {
3345
- logger$x.error('Links must include a valid href. If your href is "#", consider using a Button instead');
3376
+ logger$y.error('Links must include a valid href. If your href is "#", consider using a Button instead');
3346
3377
  return false;
3347
3378
  }
3348
3379
  return true;
@@ -3517,6 +3548,49 @@ function getFormProps(props, innerFormId) {
3517
3548
  shouldValidate: (activeFormId ? activeFormId === innerFormId : true) && props.shouldValidate
3518
3549
  };
3519
3550
  }
3551
+ function removeFormLayer(obj, formId) {
3552
+ if (!obj) {
3553
+ return obj;
3554
+ }
3555
+ const formIdWithDelimiter = `${formId}.`;
3556
+ return Object.entries(obj).reduce((acc, [key, value]) => {
3557
+ const newKey = key.startsWith(formIdWithDelimiter) ? key.substring(formIdWithDelimiter.length, key.length) : key;
3558
+ return {
3559
+ ...acc,
3560
+ [newKey]: value
3561
+ };
3562
+ }, {});
3563
+ }
3564
+ function getNestedOuterFormPropsFromOuterFormProps(props, innerFormId) {
3565
+ const newProps = getFormProps(props, innerFormId);
3566
+ if (newProps === null) {
3567
+ return null;
3568
+ }
3569
+ const {
3570
+ placeholders,
3571
+ labels: labels2,
3572
+ data,
3573
+ helperText,
3574
+ masks
3575
+ } = newProps;
3576
+ return {
3577
+ placeholders,
3578
+ labels: labels2,
3579
+ data,
3580
+ helperText,
3581
+ masks,
3582
+ // maintain the structure of the special fields
3583
+ readOnlyFields: removeFormLayer(props.readOnlyFields, innerFormId),
3584
+ requiredFields: removeFormLayer(props.requiredFields, innerFormId),
3585
+ optionalFields: removeFormLayer(props.optionalFields, innerFormId),
3586
+ obscuredFields: removeFormLayer(props.obscuredFields, innerFormId),
3587
+ verifyFields: removeFormLayer(props.verifyFields, innerFormId),
3588
+ // the rest we just pass along for now, as they will be eventually be processed by getFormProps
3589
+ problems: props.problems,
3590
+ validators: props.validators,
3591
+ shouldValidate: props.shouldValidate
3592
+ };
3593
+ }
3520
3594
  function getFieldProps(props, innerFormFields) {
3521
3595
  if (innerFormFields) {
3522
3596
  const nestedFormProps = {
@@ -3657,7 +3731,7 @@ const useSetting = (settingName) => {
3657
3731
  } = context;
3658
3732
  return getSetting(settingName);
3659
3733
  };
3660
- const logger$w = createLogger("useAllowedCountries");
3734
+ const logger$x = createLogger("useAllowedCountries");
3661
3735
  const useAllowedCountries = () => {
3662
3736
  const acceptedCountries = useSetting("acceptedCountries");
3663
3737
  const {
@@ -3666,7 +3740,7 @@ const useAllowedCountries = () => {
3666
3740
  const [allowedCountries, setAllowedCountries] = useState(acceptedCountries);
3667
3741
  useEffect(() => {
3668
3742
  if (acceptedCountries !== void 0) return;
3669
- getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$w.error);
3743
+ getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$x.error);
3670
3744
  }, [acceptedCountries]);
3671
3745
  return allowedCountries;
3672
3746
  };
@@ -4019,7 +4093,7 @@ function reducer({
4019
4093
  }
4020
4094
  };
4021
4095
  }
4022
- const logger$v = createLogger("useAsyncValidator");
4096
+ const logger$w = createLogger("useAsyncValidator");
4023
4097
  const useAsyncValidator = (asyncRules) => {
4024
4098
  const [asyncValidationResults, setAsyncValidationResults] = useState({});
4025
4099
  const clearAsyncValidationResults = useCallback(() => setAsyncValidationResults({}), []);
@@ -4040,7 +4114,7 @@ const useAsyncValidator = (asyncRules) => {
4040
4114
  hasError: !isValid
4041
4115
  }])
4042
4116
  });
4043
- }).catch(logger$v.error);
4117
+ }).catch(logger$w.error);
4044
4118
  }, [asyncRules, clearAsyncValidationResults]);
4045
4119
  return {
4046
4120
  asyncValidationResults,
@@ -4317,10 +4391,13 @@ const ARIA_ERROR_SUFFIX = "-ariaError";
4317
4391
  const MaybeLabelElement = ({
4318
4392
  children,
4319
4393
  ...props
4320
- }) => props.useLabelElement === true ? jsx("label", {
4321
- ...props,
4322
- children
4323
- }) : jsx("div", {
4394
+ }) => props.useLabelElement === true ? (
4395
+ // eslint-disable-next-line jsx-a11y/label-has-associated-control
4396
+ jsx("label", {
4397
+ ...props,
4398
+ children
4399
+ })
4400
+ ) : jsx("div", {
4324
4401
  ...props,
4325
4402
  role: "form",
4326
4403
  children
@@ -5965,7 +6042,7 @@ const deriveInputState = (isValid, isFocused, isDisabled, isOptional, hasNullish
5965
6042
  };
5966
6043
  };
5967
6044
  const MISMATCH_ANIMATION_NAME = "mismatchShake";
5968
- const logger$u = createLogger("MaskedInputText");
6045
+ const logger$v = createLogger("MaskedInputText");
5969
6046
  const MaskedInputText = ({
5970
6047
  value,
5971
6048
  onInput,
@@ -6006,7 +6083,7 @@ const MaskedInputText = ({
6006
6083
  };
6007
6084
  useEffect(() => {
6008
6085
  if (!mask) {
6009
- logger$u.warn("`mask` is undefined. No masking of input will take place.");
6086
+ logger$v.warn("`mask` is undefined. No masking of input will take place.");
6010
6087
  }
6011
6088
  }, [mask]);
6012
6089
  const getMaskResult = useCallback((pureValue) => {
@@ -6031,7 +6108,7 @@ const MaskedInputText = ({
6031
6108
  return;
6032
6109
  }
6033
6110
  const fallback = displayValueToPure(maskResult.partialDisplayValue);
6034
- logger$u.warn(`Value received "${value}" does not match mask`, maskResult, `
6111
+ logger$v.warn(`Value received "${value}" does not match mask`, maskResult, `
6035
6112
  Falling back to partially valid value "${fallback}"`);
6036
6113
  onInput(fallback);
6037
6114
  }
@@ -6311,6 +6388,14 @@ const taxIdNumberOptions = {
6311
6388
  }, {
6312
6389
  id: "uen",
6313
6390
  name: "uen"
6391
+ }],
6392
+ [CountryCodes.Jersey]: [{
6393
+ id: "taxIdentificationNumber",
6394
+ name: "taxIdentificationNumber"
6395
+ }, {
6396
+ id: "socialSecurityNumber",
6397
+ name: "socialSecurityNumber",
6398
+ applicableOnlyFor: [CompanyTypesValue.SOLE_PROPRIETORSHIP]
6314
6399
  }]
6315
6400
  };
6316
6401
  const getTaxIdNumberOptions = (country2, companyType2) => {
@@ -7791,20 +7876,21 @@ const Accordion = ({
7791
7876
  };
7792
7877
  return jsxs("details", {
7793
7878
  onToggle: handleToggle,
7794
- className,
7879
+ className: cx(className, "adyen-kyc-accordion__details"),
7795
7880
  children: [jsxs("summary", {
7881
+ className: "adyen-kyc-accordion__summary",
7796
7882
  role: "button",
7797
7883
  children: [expandOnLeft && jsx("img", {
7798
- className: "arrow",
7884
+ className: "adyen-kyc-accordion__arrow",
7799
7885
  src: ChevronDownIcon,
7800
7886
  alt: ""
7801
7887
  }), icon, title, !expandOnLeft && jsx("img", {
7802
- className: "arrow arrow-right",
7888
+ className: "adyen-kyc-accordion__arrow adyen-kyc-accordion__arrow--right",
7803
7889
  src: ChevronDownIcon,
7804
7890
  alt: ""
7805
7891
  })]
7806
7892
  }), jsx("section", {
7807
- className: "content",
7893
+ className: "adyen-kyc-accordion__content",
7808
7894
  children
7809
7895
  })]
7810
7896
  });
@@ -7969,6 +8055,54 @@ const stockISINFieldMetadata = {
7969
8055
  }
7970
8056
  }
7971
8057
  };
8058
+ const STOCK_TICKER_SYMBOL_FIELD = ["stockTickerSymbol"];
8059
+ function StockTickerSymbolField({
8060
+ data,
8061
+ valid,
8062
+ errors,
8063
+ labels: labels2,
8064
+ placeholders,
8065
+ readonly,
8066
+ mask,
8067
+ guidanceText,
8068
+ handleChangeFor
8069
+ }) {
8070
+ return jsx(MaskedInputText, {
8071
+ name: "stockTickerSymbol",
8072
+ label: labels2.stockTickerSymbol ?? "",
8073
+ formatGuidance: guidanceText == null ? void 0 : guidanceText.stockTickerSymbol,
8074
+ placeholder: placeholders == null ? void 0 : placeholders.stockTickerSymbol,
8075
+ ...mask,
8076
+ classNameModifiers: {
8077
+ field: ["stockTickerSymbol"],
8078
+ input: ["stockTickerSymbol"]
8079
+ },
8080
+ errorMessage: errors.stockTickerSymbol,
8081
+ isValid: valid.stockTickerSymbol ?? false,
8082
+ value: data.stockTickerSymbol ?? "",
8083
+ readonly,
8084
+ onInput: handleChangeFor("stockTickerSymbol", "input"),
8085
+ onBlur: handleChangeFor("stockTickerSymbol", "blur"),
8086
+ "aria-required": true,
8087
+ "aria-label": labels2.stockTickerSymbol,
8088
+ "aria-invalid": !valid.stockTickerSymbol
8089
+ });
8090
+ }
8091
+ const stockTickerSymbolFieldMetadata = {
8092
+ label: "stockTickerSymbol",
8093
+ validators: [validatePatternOnBlur(/^[A-Z\d]{1,5}$/)],
8094
+ mask: {
8095
+ mask: makeMask(...alphanumericInputs(1), ...alphanumericInputs(4)),
8096
+ transformOnType: uppercase
8097
+ },
8098
+ guidanceText: {
8099
+ key: "enterAMaximumOfNCharactersForExample",
8100
+ values: {
8101
+ maxChars: "5",
8102
+ example: "ADYEN"
8103
+ }
8104
+ }
8105
+ };
7972
8106
  const defaultFieldMetadata$7 = {
7973
8107
  label: "taxId"
7974
8108
  };
@@ -8072,6 +8206,136 @@ const defaultFieldConfig$7 = {
8072
8206
  }
8073
8207
  }
8074
8208
  },
8209
+ [CountryCodes.Guernsey]: ({
8210
+ companyType: companyType2
8211
+ }) => {
8212
+ switch (companyType2) {
8213
+ case CompanyTypesValue.SOLE_PROPRIETORSHIP:
8214
+ return {
8215
+ label: "nationalInsuranceNumber",
8216
+ validators: validatePatternOnBlur(/^GY\d{6}[A-D]$/),
8217
+ mask: {
8218
+ mask: makeMask(...nonInputs("GY", {
8219
+ includeInValue: true
8220
+ }), spacer, ...numericInputs(2), spacer, ...numericInputs(2), spacer, ...numericInputs(2), spacer, {
8221
+ type: "input",
8222
+ allow: /[A-D]/
8223
+ }),
8224
+ transformOnType: uppercase
8225
+ },
8226
+ guidanceText: {
8227
+ key: "enterTheRemainingNCharactersForExample",
8228
+ values: {
8229
+ numChars: "7",
8230
+ example: "GY 12 34 56 A"
8231
+ }
8232
+ }
8233
+ };
8234
+ default:
8235
+ return {
8236
+ label: "registrationNumber",
8237
+ mask: businessRegistrationNumberMasks[CountryCodes.Guernsey].default,
8238
+ validators: validatePatternOnBlur(businessRegistrationNumberPatterns[CountryCodes.Guernsey].default),
8239
+ guidanceText: {
8240
+ key: "enterAMaximumOfNDigitsForExample",
8241
+ values: {
8242
+ maxDigits: "9",
8243
+ example: "123456"
8244
+ }
8245
+ }
8246
+ };
8247
+ }
8248
+ },
8249
+ [CountryCodes.Jersey]: ({
8250
+ taxIdNumberType,
8251
+ companyType: companyType2
8252
+ }) => {
8253
+ switch (taxIdNumberType) {
8254
+ case "socialSecurityNumber":
8255
+ return {
8256
+ label: "socialSecurityNumber",
8257
+ validators: validatePatternOnBlur(/^[A-Z]{2}\d{6}[A-Z]$/),
8258
+ mask: {
8259
+ mask: makeMask(...alphaInputs(2), ...numericInputs(6), ...alphaInputs(1)),
8260
+ transformOnType: uppercase
8261
+ },
8262
+ guidanceText: {
8263
+ key: "enterNCharactersForExample",
8264
+ values: {
8265
+ numChars: "9",
8266
+ example: "JY000000A"
8267
+ }
8268
+ }
8269
+ };
8270
+ case "taxIdentificationNumber":
8271
+ default:
8272
+ switch (companyType2) {
8273
+ case CompanyTypesValue.SOLE_PROPRIETORSHIP:
8274
+ return {
8275
+ label: "taxIdentificationNumber",
8276
+ validators: validatePatternOnBlur(/^\d{10}$/),
8277
+ mask: {
8278
+ mask: makeMask(...numericInputs(3), ...nonInputs(" - "), ...numericInputs(3), ...nonInputs(" - "), ...numericInputs(4))
8279
+ },
8280
+ guidanceText: {
8281
+ key: "enterNDigitsForExample",
8282
+ values: {
8283
+ numDigits: "10",
8284
+ example: "100-100-1000"
8285
+ }
8286
+ }
8287
+ };
8288
+ default:
8289
+ return {
8290
+ label: "taxIdentificationNumber",
8291
+ validators: validatePatternOnBlur(/^[A-Z]{2}\d{5}$/),
8292
+ mask: {
8293
+ mask: makeMask(...alphaInputs(2), ...numericInputs(5)),
8294
+ transformOnType: uppercase
8295
+ },
8296
+ guidanceText: {
8297
+ key: "enterNCharactersForExample",
8298
+ values: {
8299
+ numChars: "7",
8300
+ example: "CC17261"
8301
+ }
8302
+ }
8303
+ };
8304
+ }
8305
+ }
8306
+ },
8307
+ [CountryCodes.IsleOfMan]: {
8308
+ label: "taxReferenceNumber",
8309
+ validators: validatePatternOnBlur(/^[HCX]\d{8}$/),
8310
+ mask: {
8311
+ mask: makeMask({
8312
+ type: "input",
8313
+ allow: /[HCX]/
8314
+ }, ...numericInputs(6), ...nonInputs(" - "), ...numericInputs(2)),
8315
+ transformOnType: uppercase
8316
+ },
8317
+ guidanceText: {
8318
+ key: "enterNCharactersForExample",
8319
+ values: {
8320
+ numChars: "9",
8321
+ example: "C155673-79"
8322
+ }
8323
+ }
8324
+ },
8325
+ [CountryCodes.Gibraltar]: {
8326
+ label: "taxpayerReferenceNumber",
8327
+ validators: validatePatternOnBlur(/^\d{1,7}$/),
8328
+ mask: {
8329
+ mask: makeMask(...numericInputs(1), ...numericInputs(6, true))
8330
+ },
8331
+ guidanceText: {
8332
+ key: "enterAMaximumOfNDigitsForExample",
8333
+ values: {
8334
+ maxDigits: "7",
8335
+ example: "123456"
8336
+ }
8337
+ }
8338
+ },
8075
8339
  /**
8076
8340
  * NOT YET SUPPORTED
8077
8341
  * These are brought over from the old pattern files. We have no idea if they are accurate or not.
@@ -8721,14 +8985,15 @@ const defaultFieldConfig$6 = {
8721
8985
  validators: validatePatternOnBlur(/^[JGVE]-\d{8}-?\d$/)
8722
8986
  }
8723
8987
  };
8724
- const inferTaxIdNumberType = (taxId2, country2) => {
8988
+ const inferTaxIdNumberType = (taxId2, country2, companyType2) => {
8725
8989
  const optionsForCountry = taxIdNumberOptions[country2];
8726
8990
  const metadataFn = defaultFieldConfig$6[country2] ?? defaultFieldConfig$7[country2];
8727
8991
  if (!optionsForCountry || !metadataFn || typeof metadataFn !== "function") return void 0;
8728
8992
  for (const option of optionsForCountry) {
8729
8993
  const fieldMetadata = metadataFn({
8730
8994
  taxIdNumberType: option.id,
8731
- vatNumberType: option.id
8995
+ vatNumberType: option.id,
8996
+ companyType: companyType2
8732
8997
  });
8733
8998
  if (!fieldMetadata.validators) continue;
8734
8999
  const validators = Array.isArray(fieldMetadata.validators) ? fieldMetadata.validators : [fieldMetadata.validators];
@@ -8795,10 +9060,11 @@ function TaxId(props) {
8795
9060
  fieldConfig = defaultFieldConfig$7
8796
9061
  } = props;
8797
9062
  const existingTaxId = propData == null ? void 0 : propData.taxId;
8798
- const defaultTaxIdNumberType = existingTaxId ? inferTaxIdNumberType(existingTaxId, country2) : (_a = getTaxIdNumberOptions(country2, companyType2)) == null ? void 0 : _a[0].id;
9063
+ const defaultTaxIdNumberType = existingTaxId ? inferTaxIdNumberType(existingTaxId, country2, companyType2) : (_a = getTaxIdNumberOptions(country2, companyType2)) == null ? void 0 : _a[0].id;
8799
9064
  const [taxIdNumberType, setTaxIdNumberType] = useState(defaultTaxIdNumberType);
8800
9065
  const metadata = resolveFieldMetadata(fieldConfig[country2], {
8801
- taxIdNumberType
9066
+ taxIdNumberType,
9067
+ companyType: companyType2
8802
9068
  }, defaultFieldMetadata$7);
8803
9069
  const mergedProps = mergeFieldMetadataIntoProps("taxId", metadata, props);
8804
9070
  const {
@@ -8939,6 +9205,7 @@ var ExperimentNames = /* @__PURE__ */ ((ExperimentNames2) => {
8939
9205
  ExperimentNames2["AllowMoreRolesForMainRootTrustee"] = "AllowMoreRolesForMainRootTrustee";
8940
9206
  ExperimentNames2["ShowUnsupportedEntityType"] = "ShowUnsupportedEntityType";
8941
9207
  ExperimentNames2["ShowSingPassButtonForCompanies"] = "ShowSingPassButtonForCompanies";
9208
+ ExperimentNames2["ShowSingPassButtonForIndividuals"] = "ShowSingPassButtonForIndividuals";
8942
9209
  ExperimentNames2["ShowExtraTaxExemptionReasons"] = "ShowExtraTaxExemptionReasons";
8943
9210
  ExperimentNames2["EnableCountryOfGoverningLawForUKCompanies"] = "EnableCountryOfGoverningLawForUKCompanies";
8944
9211
  ExperimentNames2["HidePayoutAccountTask"] = "HidePayoutAccountTask";
@@ -8978,7 +9245,7 @@ function VatNumber(props) {
8978
9245
  name: VatAbsenceReason.CountryWithoutVatOrGstSystem
8979
9246
  }]);
8980
9247
  const existingTaxId = propData == null ? void 0 : propData.vatNumber;
8981
- const defaultTaxIdNumberType = existingTaxId ? inferTaxIdNumberType(existingTaxId, country2) : (_a = taxIdNumberOptions[country2]) == null ? void 0 : _a[0].id;
9248
+ const defaultTaxIdNumberType = existingTaxId ? inferTaxIdNumberType(existingTaxId, country2, void 0) : (_a = taxIdNumberOptions[country2]) == null ? void 0 : _a[0].id;
8982
9249
  const [taxIdNumberType, setTaxIdNumberType] = useState(defaultTaxIdNumberType);
8983
9250
  const metadata = resolveFieldMetadata(fieldConfig[country2], {
8984
9251
  vatNumberType: taxIdNumberType
@@ -9135,7 +9402,7 @@ const FLOWS_THAT_HIDE_REGISTRATION_NUMBER = [{
9135
9402
  companyType: [CompanyTypesValue.SOLE_PROPRIETORSHIP],
9136
9403
  country: CountryCodes.PuertoRico
9137
9404
  }];
9138
- const companyRegistrationDetailsFields = ["tradingName", "sameNameAsLegalName", ...businessRegistrationNumberFields, "stockExchangeMIC", "stockISIN", ...vatNumberFields, ...taxIdFields, "dateOfIncorporation"];
9405
+ const companyRegistrationDetailsFields = ["tradingName", "sameNameAsLegalName", ...businessRegistrationNumberFields, "stockExchangeMIC", "stockISIN", "stockTickerSymbol", ...vatNumberFields, ...taxIdFields, "dateOfIncorporation"];
9139
9406
  function CompanyRegistrationDetailsComponent(props) {
9140
9407
  var _a, _b;
9141
9408
  const {
@@ -9144,13 +9411,14 @@ function CompanyRegistrationDetailsComponent(props) {
9144
9411
  let mergedProps = props;
9145
9412
  mergedProps = mergeFieldMetadataIntoProps("stockExchangeMIC", stockExchangeMICFieldMetadata, mergedProps);
9146
9413
  mergedProps = mergeFieldMetadataIntoProps("stockISIN", stockISINFieldMetadata, mergedProps);
9414
+ mergedProps = mergeFieldMetadataIntoProps("stockTickerSymbol", stockTickerSymbolFieldMetadata, mergedProps);
9147
9415
  const hideOptionalRegistrationNumberField = FLOWS_THAT_HIDE_REGISTRATION_NUMBER.some((f) => f.country === mergedProps.country && f.companyType.includes(mergedProps.companyType));
9148
9416
  const stateRef = useRef({
9149
9417
  setState: null
9150
9418
  });
9151
9419
  const COMPANY_REGISTRATION_DETAILS = mergedProps.id;
9152
9420
  const requiredFields = mergedProps.requiredFields || companyRegistrationDetailsFields;
9153
- const directChildFields = requiredFields.filter((field) => ["tradingName", "sameNameAsLegalName", "stockExchangeMIC", "stockISIN", "dateOfIncorporation"].includes(field));
9421
+ const directChildFields = requiredFields.filter((field) => ["tradingName", "sameNameAsLegalName", "stockExchangeMIC", "stockISIN", "stockTickerSymbol", "dateOfIncorporation"].includes(field));
9154
9422
  const {
9155
9423
  getData
9156
9424
  } = useStateContext();
@@ -9320,6 +9588,16 @@ function CompanyRegistrationDetailsComponent(props) {
9320
9588
  guidanceText: formUtils.getFieldGuidanceText(STOCK_ISIN_FIELD),
9321
9589
  readonly: formUtils.isReadOnly("stockISIN"),
9322
9590
  handleChangeFor
9591
+ }), formUtils.isRequiredField("stockTickerSymbol") && jsx(StockTickerSymbolField, {
9592
+ data: formUtils.getFieldData(data, STOCK_TICKER_SYMBOL_FIELD),
9593
+ valid: formUtils.getFieldValid(valid, STOCK_TICKER_SYMBOL_FIELD),
9594
+ errors: formUtils.getFieldErrors(errors, fieldProblems, STOCK_TICKER_SYMBOL_FIELD),
9595
+ labels: formUtils.getFieldLabels(STOCK_TICKER_SYMBOL_FIELD),
9596
+ placeholders: formUtils.getFieldPlaceholders(STOCK_TICKER_SYMBOL_FIELD),
9597
+ mask: formUtils.getMask("stockTickerSymbol"),
9598
+ guidanceText: formUtils.getFieldGuidanceText(STOCK_TICKER_SYMBOL_FIELD),
9599
+ readonly: formUtils.isReadOnly("stockTickerSymbol"),
9600
+ handleChangeFor
9323
9601
  }), formUtils.isRequiredField("registrationNumber", !hideOptionalRegistrationNumberField) && jsx(BusinessRegistrationNumber, {
9324
9602
  ...registrationNumberProps,
9325
9603
  companyType: mergedProps.companyType,
@@ -9389,10 +9667,13 @@ const companyBase = {
9389
9667
  rule: "REQUIRED"
9390
9668
  },
9391
9669
  stockExchangeMIC: {
9392
- rule: "stockExchangeMICIfTypePublic"
9670
+ rule: "ifPubliclyTradedCompany"
9393
9671
  },
9394
9672
  stockISIN: {
9395
- rule: "stockISINIfTypePublic"
9673
+ rule: "ifPubliclyTradedCompany"
9674
+ },
9675
+ stockTickerSymbol: {
9676
+ rule: "ifPubliclyTradedCompany"
9396
9677
  },
9397
9678
  tradingName: {
9398
9679
  rule: "REQUIRED"
@@ -9442,10 +9723,13 @@ const companySearchBase = {
9442
9723
  rule: "countryRequiresStateOrProvince"
9443
9724
  },
9444
9725
  stockExchangeMIC: {
9445
- rule: "stockExchangeMICIfTypePublic"
9726
+ rule: "ifPubliclyTradedCompany"
9446
9727
  },
9447
9728
  stockISIN: {
9448
- rule: "stockISINIfTypePublic"
9729
+ rule: "ifPubliclyTradedCompany"
9730
+ },
9731
+ stockTickerSymbol: {
9732
+ rule: "ifPubliclyTradedCompany"
9449
9733
  },
9450
9734
  dateOfIncorporation: {
9451
9735
  rule: "countryRequiresDateOfIncorporationForCompanies"
@@ -9489,10 +9773,13 @@ const businessDetailsBase = {
9489
9773
  rule: "countryRequiresStateOrProvince"
9490
9774
  },
9491
9775
  stockExchangeMIC: {
9492
- rule: "stockExchangeMICIfTypePublic"
9776
+ rule: "ifPubliclyTradedCompany"
9493
9777
  },
9494
9778
  stockISIN: {
9495
- rule: "stockISINIfTypePublic"
9779
+ rule: "ifPubliclyTradedCompany"
9780
+ },
9781
+ stockTickerSymbol: {
9782
+ rule: "ifPubliclyTradedCompany"
9496
9783
  },
9497
9784
  dateOfIncorporation: {
9498
9785
  rule: "countryRequiresDateOfIncorporationForCompanies"
@@ -10086,12 +10373,6 @@ const EntityTypeSelectionRadioCardBody = ({
10086
10373
  })]
10087
10374
  });
10088
10375
  };
10089
- const CoreContext = createContext(void 0);
10090
- const useCoreContext = () => {
10091
- const context = useContext(CoreContext);
10092
- if (!context) throw Error("You need a <CoreProvider> to use core context");
10093
- return context;
10094
- };
10095
10376
  var TrustMemberTypes = /* @__PURE__ */ ((TrustMemberTypes2) => {
10096
10377
  TrustMemberTypes2["DEFINED_BENEFICIARY"] = "definedBeneficiary";
10097
10378
  TrustMemberTypes2["UNDEFINED_BENEFICIARY"] = "undefinedBeneficiary";
@@ -10287,7 +10568,7 @@ var VerificationStatus = /* @__PURE__ */ ((VerificationStatus2) => {
10287
10568
  VerificationStatus2["REJECTED"] = "rejected";
10288
10569
  return VerificationStatus2;
10289
10570
  })(VerificationStatus || {});
10290
- function getNestedPropertyKeys(obj, includeUndefined = false) {
10571
+ function getNestedPropertyKeys(obj, includeUndefined = false, includeFalsy = true) {
10291
10572
  const fieldNames = [];
10292
10573
  Object.entries(obj).forEach(([key, value]) => {
10293
10574
  if (typeof value === "object" && value !== null) {
@@ -10295,7 +10576,7 @@ function getNestedPropertyKeys(obj, includeUndefined = false) {
10295
10576
  fieldNames.push(...nested);
10296
10577
  return;
10297
10578
  }
10298
- if (value !== void 0 || includeUndefined) {
10579
+ if ((value !== void 0 || includeUndefined) && (value || !includeFalsy)) {
10299
10580
  fieldNames.push(key);
10300
10581
  }
10301
10582
  });
@@ -10336,8 +10617,10 @@ function isEmptyEntity(legalEntity) {
10336
10617
  const minimumFields = emptyFieldsByEntityType[type];
10337
10618
  const typeSpecificSection = legalEntity[type];
10338
10619
  if (!typeSpecificSection) return true;
10339
- const fieldsOnEntity = getNestedPropertyKeys(typeSpecificSection);
10340
- return !fieldsOnEntity.some((field) => !minimumFields.includes(field));
10620
+ const fieldsOnEntity = getNestedPropertyKeys(typeSpecificSection, false, false);
10621
+ const sortedMinimumFields = minimumFields.toSorted();
10622
+ const sortedFieldsOnEntity = fieldsOnEntity.toSorted();
10623
+ return sortedFieldsOnEntity.every((value, index) => value === sortedMinimumFields[index]);
10341
10624
  }
10342
10625
  const capabilitiesToPreventTypeChange = ["receivePayments", "issueCard", "useCard", "withdrawFromAtm", "withdrawFromAtmInRestrictedCountries", "receiveFromTransferInstrument", "useCardInRestrictedCountries", "useCardInRestrictedIndustries", "issueBankAccount", "sendToThirdParty", "receiveFromThirdParty", "getGrantOffers", "receiveGrants"];
10343
10626
  const entityTypeToCorrespondingAccountHolderOption = {
@@ -10489,7 +10772,7 @@ const accountHolderValidationRules = {
10489
10772
  }
10490
10773
  };
10491
10774
  const accountHolderFields = ["accountHolder"];
10492
- const logger$t = createLogger("AccountHolder");
10775
+ const logger$u = createLogger("AccountHolder");
10493
10776
  function getAvailableAccountHolderOptions(legalEntityType, isChangeOfLegalEntityTypeAllowed, isTrustFlowEnabled, isSoleProprietorshipAllowed, isChangeToMyNameAllowed) {
10494
10777
  switch (legalEntityType) {
10495
10778
  case LegalEntityType.ORGANIZATION: {
@@ -10499,7 +10782,7 @@ function getAvailableAccountHolderOptions(legalEntityType, isChangeOfLegalEntity
10499
10782
  return [...isChangeToMyNameAllowed ? ["myName"] : [], ...isChangeOfLegalEntityTypeAllowed ? ["theCompanyIWorkFor"] : [], ...isTrustFlowEnabled ? ["aTrust"] : [], ...isSoleProprietorshipAllowed ? ["mySoleProprietorName"] : []];
10500
10783
  }
10501
10784
  default:
10502
- logger$t.error(`No available account holder options for legal entity type '${legalEntityType}'`);
10785
+ logger$u.error(`No available account holder options for legal entity type '${legalEntityType}'`);
10503
10786
  return [];
10504
10787
  }
10505
10788
  }
@@ -10515,9 +10798,6 @@ function AccountHolder(props) {
10515
10798
  dataStoreId,
10516
10799
  capabilities
10517
10800
  } = props;
10518
- const {
10519
- setAccountHolder
10520
- } = useCoreContext();
10521
10801
  const {
10522
10802
  isSettingEnabled
10523
10803
  } = useSettingsContext();
@@ -10566,9 +10846,6 @@ function AccountHolder(props) {
10566
10846
  dataStoreId
10567
10847
  }
10568
10848
  });
10569
- if (data == null ? void 0 : data.accountHolder) {
10570
- setAccountHolder(data.accountHolder);
10571
- }
10572
10849
  }, [data, errors, valid, dataStoreId]);
10573
10850
  const formUtils = formUtilities(props, i18n);
10574
10851
  const questionLabel = i18n.get("nameOfBankAccountHolder");
@@ -10741,7 +11018,7 @@ function DocumentGuidance({
10741
11018
  className: cx("adyen-kyc-document-guidance", className),
10742
11019
  children: jsx("div", {
10743
11020
  className: "adyen-kyc-document-guidance__container",
10744
- children: documentGuidanceItems.map((item) => jsxs("div", {
11021
+ children: documentGuidanceItems.map((item) => jsxs("figure", {
10745
11022
  className: "adyen-kyc-document-guidance__item",
10746
11023
  children: [jsx("svg", {
10747
11024
  width: "100%",
@@ -10750,7 +11027,7 @@ function DocumentGuidance({
10750
11027
  children: jsx("use", {
10751
11028
  href: `#adyen-kyc-${guidancePrefix}-${item.type}`
10752
11029
  })
10753
- }), jsx("span", {
11030
+ }), jsx("figcaption", {
10754
11031
  className: "adyen-kyc-document-guidance__description",
10755
11032
  children: i18n.get(item.translationKey)
10756
11033
  })]
@@ -11059,7 +11336,7 @@ function Dropzone(props) {
11059
11336
  })]
11060
11337
  });
11061
11338
  }
11062
- const logger$s = createLogger("TextArea");
11339
+ const logger$t = createLogger("TextArea");
11063
11340
  function TextArea(props) {
11064
11341
  const {
11065
11342
  classNameModifiers,
@@ -11080,7 +11357,7 @@ function TextArea(props) {
11080
11357
  } = useI18nContext();
11081
11358
  const [value, setValue] = useState("");
11082
11359
  if (Object.prototype.hasOwnProperty.call(props, "onChange")) {
11083
- logger$s.error("Error: Form fields that rely on InputBase may not have an onChange property");
11360
+ logger$t.error("Error: Form fields that rely on InputBase may not have an onChange property");
11084
11361
  }
11085
11362
  const handleInput = (e) => {
11086
11363
  var _a;
@@ -11523,7 +11800,7 @@ function useIsElementVisible(ref, fallback = true) {
11523
11800
  }, [ref]);
11524
11801
  return isOnScreen;
11525
11802
  }
11526
- const logger$r = createLogger("SearchAddress");
11803
+ const logger$s = createLogger("SearchAddress");
11527
11804
  const SearchAddress = ({
11528
11805
  data,
11529
11806
  legalEntityId,
@@ -11566,7 +11843,7 @@ const SearchAddress = ({
11566
11843
  const response = await handleFindAddress(selectedAddressId);
11567
11844
  autocompleteAddressForm(response);
11568
11845
  } catch (e) {
11569
- logger$r.error(e);
11846
+ logger$s.error(e);
11570
11847
  }
11571
11848
  };
11572
11849
  const onDrilldown = async (selectedAddress) => {
@@ -11578,7 +11855,7 @@ const SearchAddress = ({
11578
11855
  }, legalEntityId);
11579
11856
  setItems((response == null ? void 0 : response.results) || []);
11580
11857
  } catch (e) {
11581
- logger$r.error(e);
11858
+ logger$s.error(e);
11582
11859
  }
11583
11860
  };
11584
11861
  const onChange = (e) => {
@@ -11633,7 +11910,7 @@ const SearchAddress = ({
11633
11910
  setItems([]);
11634
11911
  }
11635
11912
  } catch (e) {
11636
- logger$r.error(e);
11913
+ logger$s.error(e);
11637
11914
  }
11638
11915
  setLoading(false);
11639
11916
  }
@@ -12193,6 +12470,7 @@ function Address(props) {
12193
12470
  maxlength: getMaxLengthByFieldAndCountry(countrySpecificFormatters, fieldName, data.country),
12194
12471
  hideField,
12195
12472
  "aria-label": formUtils.getLabel(fieldName, fieldName),
12473
+ readOnly: formUtils.isReadOnly(fieldName),
12196
12474
  trimOnBlur: true
12197
12475
  }, fieldName);
12198
12476
  };
@@ -12320,16 +12598,22 @@ function RegistrationAddressComponent(props) {
12320
12598
  } = useI18nContext();
12321
12599
  const {
12322
12600
  id: id2,
12323
- data,
12324
- country: country2,
12325
- validators,
12326
12601
  heading,
12327
12602
  description: description2,
12328
12603
  handleAddressSearch,
12329
12604
  handleFindAddress,
12330
- optionalFields,
12605
+ country: country2,
12606
+ data,
12607
+ validators,
12331
12608
  kompanyAddress
12332
12609
  } = props;
12610
+ const {
12611
+ requiredFields: registrationAddressRequiredFields,
12612
+ optionalFields: registrationAddressOptionalFields,
12613
+ readOnlyFields: registrationAddressReadOnlyFields,
12614
+ obscuredFields: registrationAddressObscuredFields,
12615
+ verifyFields: registrationAddressVerifyFields
12616
+ } = getFormProps(props, props.id);
12333
12617
  const {
12334
12618
  data: formData,
12335
12619
  valid: formValid,
@@ -12342,9 +12626,17 @@ function RegistrationAddressComponent(props) {
12342
12626
  defaultData: data,
12343
12627
  rules: validators || registrationAddressValidationRules,
12344
12628
  obscuredFields: [],
12345
- optionalFields
12629
+ optionalFields: registrationAddressOptionalFields
12346
12630
  });
12347
- const formUtils = formUtilities(props, i18n);
12631
+ const mergedProps = {
12632
+ ...props,
12633
+ requiredFields: registrationAddressRequiredFields,
12634
+ optionalFields: registrationAddressOptionalFields,
12635
+ readOnlyFields: registrationAddressReadOnlyFields,
12636
+ obscuredFields: registrationAddressObscuredFields,
12637
+ verifyFields: registrationAddressVerifyFields
12638
+ };
12639
+ const formUtils = formUtilities(mergedProps, i18n);
12348
12640
  const stateRef = useRef({
12349
12641
  setState: null
12350
12642
  });
@@ -12374,8 +12666,8 @@ function RegistrationAddressComponent(props) {
12374
12666
  heading,
12375
12667
  description: description2
12376
12668
  }), jsx(ErrorPanel, {
12377
- verificationErrors: id2 ? (_b = (_a = props == null ? void 0 : props.problems) == null ? void 0 : _a.verificationErrors) == null ? void 0 : _b[id2] : void 0,
12378
- validationErrors: id2 ? (_d = (_c = props == null ? void 0 : props.problems) == null ? void 0 : _c.validationErrors) == null ? void 0 : _d[id2] : void 0,
12669
+ verificationErrors: id2 ? (_b = (_a = props.problems) == null ? void 0 : _a.verificationErrors) == null ? void 0 : _b[id2] : void 0,
12670
+ validationErrors: id2 ? (_d = (_c = props.problems) == null ? void 0 : _c.validationErrors) == null ? void 0 : _d[id2] : void 0,
12379
12671
  formUtils,
12380
12672
  id: "ariaErrorField"
12381
12673
  }), jsx(ContextGuidance, {
@@ -12750,7 +13042,7 @@ function CompanyComponent(props) {
12750
13042
  const companyNameAndCountryFormProps = getFormProps(props, CompanyNameAndCountryFormID);
12751
13043
  const companyTypeFormProps = getFormProps(props, CompanyTypeFormID);
12752
13044
  const companyRegistrationDetailsFormProps = getFormProps(props, CompanyRegistrationDetailsFormID);
12753
- const companyRegistrationAddressFormProps = getFormProps(props, CompanyRegistrationAddressFormID);
13045
+ const companyRegistrationAddressFormProps = getNestedOuterFormPropsFromOuterFormProps(props, CompanyRegistrationAddressFormID);
12754
13046
  const companyRegistrationDocumentFormProps = getFormProps(props, CompanyRegistrationDocumentFormID);
12755
13047
  const companyTaxDocumentFormProps = getFormProps(props, CompanyTaxDocumentFormID);
12756
13048
  const handleStateChange = ({
@@ -13028,7 +13320,7 @@ const COUNTRIES_THAT_DONT_REQUIRE_SOLE_PROP_REGISTRATION = [CountryCodes.Austral
13028
13320
  const COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION = [CountryCodes.PuertoRico, CountryCodes.UnitedStates];
13029
13321
  const COUNTRIES_WITH_POSSIBLE_REGISTRATION_EXEMPTIONS_FOR_SOLE_PROPS = [CountryCodes.Austria, CountryCodes.Canada, CountryCodes.Finland, CountryCodes.Germany, CountryCodes.Lithuania, CountryCodes.Luxembourg, CountryCodes.Poland, CountryCodes.Sweden, CountryCodes.Switzerland];
13030
13322
  const COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER = [CountryCodes.PuertoRico, CountryCodes.UnitedStates];
13031
- const COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT = [CountryCodes.Australia, CountryCodes.Canada, CountryCodes.Gibraltar, CountryCodes.HongKong, CountryCodes.NewZealand, CountryCodes.PuertoRico, CountryCodes.Singapore, CountryCodes.UnitedStates];
13323
+ const COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT = [CountryCodes.Australia, CountryCodes.Canada, CountryCodes.Gibraltar, CountryCodes.HongKong, CountryCodes.NewZealand, CountryCodes.PuertoRico, CountryCodes.Singapore, CountryCodes.UnitedStates, CountryCodes.Guernsey, CountryCodes.Jersey, CountryCodes.IsleOfMan];
13032
13324
  const COUNTRIES_THAT_DO_NOT_USE_TAX_ID_FOR_SOLE_PROP = [CountryCodes.NewZealand, CountryCodes.Singapore];
13033
13325
  const COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_COMPANIES = [
13034
13326
  // strictly a subset of countries which use tax ID
@@ -13054,16 +13346,7 @@ const rules$2 = ({
13054
13346
  return "REQUIRED";
13055
13347
  }
13056
13348
  },
13057
- stockExchangeMICIfTypePublic: () => {
13058
- var _a, _b;
13059
- if ("companyType" in data && ((_a = data.companyType) == null ? void 0 : _a.entityType) === CompanyTypesValue.PUBLIC_COMPANY) {
13060
- return "REQUIRED";
13061
- }
13062
- if ("companyStructure" in data && ((_b = data.companyStructure) == null ? void 0 : _b.entityType) === CompanyTypesValue.PUBLIC_COMPANY) {
13063
- return "REQUIRED";
13064
- }
13065
- },
13066
- stockISINIfTypePublic: () => {
13349
+ ifPubliclyTradedCompany: () => {
13067
13350
  var _a, _b;
13068
13351
  if ("companyType" in data && ((_a = data.companyType) == null ? void 0 : _a.entityType) === CompanyTypesValue.PUBLIC_COMPANY) {
13069
13352
  return "REQUIRED";
@@ -13324,7 +13607,8 @@ const mandatoryApiFields = {
13324
13607
  DECISION_MAKER_OWNER: ["personalDetails.firstName", "personalDetails.lastName", "personalDetails.residencyCountry", "personalDetails.role"],
13325
13608
  ORGANIZATION: ["companyNameAndCountry.legalCompanyName", "companyNameAndCountry.country"],
13326
13609
  SOLE_PROPRIETORSHIP: ["solePropNameAndCountry.legalCompanyName", "solePropNameAndCountry.country"],
13327
- TRUST: ["trustRegistrationDetails.legalName", "trustRegistrationDetails.country"]
13610
+ TRUST: ["trustRegistrationDetails.legalName", "trustRegistrationDetails.country"],
13611
+ HIGH_EXPOSURE: ["company.numberOfEmployees", "parentCompany.numberOfEmployees", "ultimateParentCompany.numberOfEmployees"]
13328
13612
  };
13329
13613
  const individualObscuredFields = ["personalDetails.idNumber", "personalDetails.idNumberExempt"];
13330
13614
  const individualBaseMapping = {
@@ -13389,6 +13673,7 @@ const businessDetailsBaseMapping = {
13389
13673
  "additionalInformation.isUen": "organization.isUen",
13390
13674
  "additionalInformation.stockExchangeMIC": "organization.stockData.marketIdentifier",
13391
13675
  "additionalInformation.stockISIN": "organization.stockData.stockNumber",
13676
+ "additionalInformation.stockTickerSymbol": "organization.stockData.tickerSymbol",
13392
13677
  "companyRegistrationAddress.registrationAddress.city": "organization.registeredAddress.city",
13393
13678
  "companyRegistrationAddress.registrationAddress.country": "organization.registeredAddress.country",
13394
13679
  "companyRegistrationAddress.registrationAddress.postalCode": "organization.registeredAddress.postalCode",
@@ -13415,6 +13700,7 @@ const companyBaseMapping = {
13415
13700
  "companyRegistrationDetails.isUen": "organization.isUen",
13416
13701
  "companyRegistrationDetails.stockExchangeMIC": "organization.stockData.marketIdentifier",
13417
13702
  "companyRegistrationDetails.stockISIN": "organization.stockData.stockNumber",
13703
+ "companyRegistrationDetails.stockTickerSymbol": "organization.stockData.tickerSymbol",
13418
13704
  "companyRegistrationAddress.registrationAddress.city": "organization.registeredAddress.city",
13419
13705
  "companyRegistrationAddress.registrationAddress.country": "organization.registeredAddress.country",
13420
13706
  "companyRegistrationAddress.registrationAddress.postalCode": "organization.registeredAddress.postalCode",
@@ -13454,7 +13740,8 @@ const companySearchBaseMapping = {
13454
13740
  "companyOtherDetails.dateOfIncorporation": "organization.dateOfIncorporation",
13455
13741
  "companyOtherDetails.isUen": "organization.isUen",
13456
13742
  "companyOtherDetails.stockExchangeMIC": "organization.stockData.marketIdentifier",
13457
- "companyOtherDetails.stockISIN": "organization.stockData.stockNumber"
13743
+ "companyOtherDetails.stockISIN": "organization.stockData.stockNumber",
13744
+ "companyOtherDetails.stockTickerSymbol": "organization.stockData.tickerSymbol"
13458
13745
  };
13459
13746
  const trustBaseMapping = {
13460
13747
  "trustRegistrationDetails.trustType": "trust.type",
@@ -13496,6 +13783,11 @@ const solePropBaseMapping = {
13496
13783
  "solePropRegistrationAddress.operationalAddress.address": "soleProprietorship.principalPlaceOfBusiness.street",
13497
13784
  "solePropRegistrationAddress.operationalAddress.otherAddressInformation": "soleProprietorship.principalPlaceOfBusiness.street2"
13498
13785
  };
13786
+ const highExposureBaseMapping = {
13787
+ "company.numberOfEmployees": "company.numberOfEmployees",
13788
+ "parentCompany.numberOfEmployees": "parentCompany.numberOfEmployees",
13789
+ "ultimateParentCompany.numberOfEmployees": "ultimateParentCompany.numberOfEmployees"
13790
+ };
13499
13791
  const businessDetailsComponentsKeyMapping = {
13500
13792
  "additionalInformation.exemptedFromVat": "organization.vatAbsenceReason",
13501
13793
  ...businessDetailsBaseMapping
@@ -13529,6 +13821,12 @@ const trustComponentsKeyMapping = {
13529
13821
  const trustApiKeyMapping = {
13530
13822
  ...reverseObject(trustBaseMapping)
13531
13823
  };
13824
+ const highExposureComponentsKeyMapping = {
13825
+ ...highExposureBaseMapping
13826
+ };
13827
+ const highExposureApiKeyMapping = {
13828
+ ...reverseObject(highExposureBaseMapping)
13829
+ };
13532
13830
  const solePropComponentsKeyMapping = {
13533
13831
  "solePropRegistrationDetails.exemptedFromVat": "soleProprietorship.vatAbsenceReason",
13534
13832
  ...solePropBaseMapping
@@ -13868,6 +14166,10 @@ const mapTrustToLegalEntity = (data) => {
13868
14166
  requestObj.type = LegalEntityType.TRUST;
13869
14167
  return requestObj;
13870
14168
  };
14169
+ const mapLegalEntityToHighExposure = (legalEntity) => formatObject(legalEntity, highExposureComponentsKeyMapping);
14170
+ const mapHighExposureToLegalEntity = (data) => ({
14171
+ ...formatObject(data, highExposureApiKeyMapping)
14172
+ });
13871
14173
  const mapLegalEntityToSoleProp = (legalEntity) => {
13872
14174
  var _a, _b, _c, _d, _e, _f, _g, _h;
13873
14175
  let solePropCompData;
@@ -14485,7 +14787,7 @@ const initOnfido = async ({
14485
14787
  language: getOnfidoLocaleConfig(i18n)
14486
14788
  });
14487
14789
  };
14488
- const logger$q = createLogger("IdVerificationComponent");
14790
+ const logger$r = createLogger("IdVerificationComponent");
14489
14791
  function IdVerificationComponent({
14490
14792
  userDetails,
14491
14793
  legalEntityId,
@@ -14517,7 +14819,7 @@ function IdVerificationComponent({
14517
14819
  onIdVerificationError,
14518
14820
  onIdVerificationComplete
14519
14821
  });
14520
- })().catch(logger$q.error);
14822
+ })().catch(logger$r.error);
14521
14823
  return () => {
14522
14824
  if (onfidoSdk.current) onfidoSdk.current.tearDown();
14523
14825
  };
@@ -14567,7 +14869,7 @@ function IdDocumentAlreadyUpload(props) {
14567
14869
  })]
14568
14870
  });
14569
14871
  }
14570
- const logger$p = createLogger("IdDocumentInstantVerificationComponent");
14872
+ const logger$q = createLogger("IdDocumentInstantVerificationComponent");
14571
14873
  const idVerificationSchema = ["instantIdVerificationData", "idDocumentType"];
14572
14874
  const documentTypeValidationRules = {
14573
14875
  instantIdVerificationData: {
@@ -14649,7 +14951,7 @@ function IdDocumentInstantVerificationComponent(props) {
14649
14951
  userDetails: props.userDetails,
14650
14952
  legalEntityId: props.legalEntityId,
14651
14953
  onIdVerificationComplete: handleIdVerificationComplete,
14652
- onIdVerificationError: logger$p.error
14954
+ onIdVerificationError: logger$q.error
14653
14955
  }), jsxs("div", {
14654
14956
  className: "adyen-kyc-document-upload__manual-upload",
14655
14957
  children: [i18n.get("canNotCompleteInstantVerification"), " ", jsx("button", {
@@ -14925,54 +15227,83 @@ function IdVerificationMethodComponent(props) {
14925
15227
  })]
14926
15228
  });
14927
15229
  }
14928
- const FIELD = "idNumber";
14929
- const verifyIdNumberHelper = (idRtnData) => {
14930
- if ((idRtnData == null ? void 0 : idRtnData.status) === 422 || (idRtnData == null ? void 0 : idRtnData.verified) === "false") {
14931
- return {
14932
- status: "error",
14933
- data: idRtnData,
14934
- fieldName: FIELD,
14935
- translationKey: "unableToVerifyTheIdNumber"
14936
- };
14937
- }
14938
- if ((idRtnData == null ? void 0 : idRtnData.status) === 500) {
14939
- return {
14940
- status: "verified",
14941
- data: idRtnData,
14942
- fieldName: FIELD
14943
- };
14944
- }
14945
- if ((idRtnData == null ? void 0 : idRtnData.verified) === "true") {
14946
- return {
14947
- status: "verified",
14948
- data: idRtnData,
14949
- fieldName: FIELD
14950
- };
15230
+ const COUNTRY_ID_NUMBER_MASKS = {
15231
+ [CountryCodes.PuertoRico]: {
15232
+ length: 4
15233
+ },
15234
+ [CountryCodes.UnitedStates]: {
15235
+ length: 4
14951
15236
  }
14952
15237
  };
15238
+ const FIELD = "idNumber";
15239
+ const handleVerifyIdNumber = async (formData, country2, verifyFn) => {
15240
+ var _a, _b;
15241
+ const verified2 = {
15242
+ field: "idNumber",
15243
+ isVerified: true
15244
+ };
15245
+ if (formData.idNumberExempt) return verified2;
15246
+ const isCountryWithMaskedIdNumber = Object.keys(COUNTRY_ID_NUMBER_MASKS).includes(country2);
15247
+ const isValueMasked = ((_a = formData.idNumber) == null ? void 0 : _a.length) === ((_b = COUNTRY_ID_NUMBER_MASKS[country2]) == null ? void 0 : _b.length);
15248
+ if (isCountryWithMaskedIdNumber && isValueMasked) return verified2;
15249
+ const response = await verifyFn({
15250
+ name: {
15251
+ firstName: formData.firstName || "",
15252
+ lastName: formData.lastName || ""
15253
+ },
15254
+ countryCode: country2,
15255
+ idNumber: formData.idNumber || ""
15256
+ });
15257
+ const isNotVerified = (response == null ? void 0 : response.status) === 422 || (response == null ? void 0 : response.verified) === "false";
15258
+ if (isNotVerified) return {
15259
+ field: FIELD,
15260
+ isVerified: false,
15261
+ messageKey: "unableToVerifyTheIdNumber"
15262
+ };
15263
+ return {
15264
+ field: FIELD,
15265
+ isVerified: true
15266
+ };
15267
+ };
15268
+ const FIELDS_WITH_EXTERNAL_VERIFICATION = ["idNumber"];
14953
15269
  function useVerification(fieldsToVerify, country2) {
14954
15270
  const {
14955
15271
  verifyIdNumber: verifyIdNumber2
14956
15272
  } = useConfigurationApi();
14957
15273
  const hasFieldsToVerify = !!(fieldsToVerify == null ? void 0 : fieldsToVerify.length);
14958
15274
  const verifyFields = useCallback(async (formState, savedData) => {
14959
- const verificationPromises = [];
14960
- fieldsToVerify.forEach((field) => {
14961
- if (field === "idNumber" && formState.data[field]) {
14962
- if (formState.data[field] === savedData[field] || country2 === "US" && formState.data[field].length === 4) return;
14963
- const request = {
14964
- name: {
14965
- firstName: formState.data.firstName,
14966
- lastName: formState.data.lastName
14967
- },
14968
- countryCode: country2,
14969
- idNumber: formState.data.idNumber
14970
- };
14971
- const verifyIdPromise = verifyIdNumber2(request).then((response) => verifyIdNumberHelper(response));
14972
- verificationPromises.push(verifyIdPromise);
15275
+ const isVerifications = fieldsToVerify.some((field) => FIELDS_WITH_EXTERNAL_VERIFICATION.includes(field));
15276
+ if (!isVerifications) return [];
15277
+ const verifications = fieldsToVerify.filter((f) => {
15278
+ const field = f;
15279
+ const isValue = formState.data[field];
15280
+ if (!isValue) return false;
15281
+ const isDirty = isValue && formState.data[field] !== savedData[field];
15282
+ if (!isDirty) return false;
15283
+ if (typeof field !== "string") return false;
15284
+ const hasVerification = FIELDS_WITH_EXTERNAL_VERIFICATION.includes(field);
15285
+ if (hasVerification) return true;
15286
+ return false;
15287
+ }).map(async (field) => {
15288
+ switch (field) {
15289
+ case "idNumber":
15290
+ return handleVerifyIdNumber(
15291
+ // made this hook more agnostic in general
15292
+ // and removed the ts-strict-ignore
15293
+ //
15294
+ // need to coerce the schema here to make the check happy
15295
+ formState.data,
15296
+ country2,
15297
+ verifyIdNumber2
15298
+ );
15299
+ default:
15300
+ return {
15301
+ field,
15302
+ isVerified: true
15303
+ };
14973
15304
  }
14974
15305
  });
14975
- return Promise.all(verificationPromises);
15306
+ return Promise.all(verifications);
14976
15307
  }, [fieldsToVerify, country2]);
14977
15308
  return {
14978
15309
  hasFieldsToVerify,
@@ -16894,7 +17225,7 @@ function PersonalDetailsComponent(props) {
16894
17225
  verifyFields({
16895
17226
  data: personalDetailsData
16896
17227
  }, props.data).then((verifiedArr) => {
16897
- const isVerified = verifiedArr.every((item) => item.status === "verified");
17228
+ const isVerified = verifiedArr.every((item) => (item == null ? void 0 : item.isVerified) === true);
16898
17229
  const t1 = performance.now();
16899
17230
  const elapsedTime = Math.floor(t1 - t0);
16900
17231
  if (elapsedTime < minTime) {
@@ -16911,10 +17242,10 @@ function PersonalDetailsComponent(props) {
16911
17242
  ...externalErrors
16912
17243
  };
16913
17244
  verifiedArr.forEach((error) => {
16914
- if (error.status === "error") {
16915
- errorObj[error.fieldName] = {
17245
+ if (error.isVerified === false) {
17246
+ errorObj[error.field] = {
16916
17247
  isValid: false,
16917
- errorMessage: error.translationKey
17248
+ errorMessage: error.messageKey
16918
17249
  };
16919
17250
  }
16920
17251
  });
@@ -18093,7 +18424,7 @@ class AdyenKycSdkError extends Error {
18093
18424
  }
18094
18425
  let sdkToken;
18095
18426
  let fetchSdkToken;
18096
- const logger$o = createLogger("Session");
18427
+ const logger$p = createLogger("Session");
18097
18428
  const setSdkToken = (token) => {
18098
18429
  sdkToken = token;
18099
18430
  };
@@ -18116,7 +18447,7 @@ const refreshSession = async () => {
18116
18447
  setSdkToken(token);
18117
18448
  isSessionRefreshed = true;
18118
18449
  } catch (e) {
18119
- logger$o.error("Failed to fetch sdk token", e);
18450
+ logger$p.error("Failed to fetch sdk token", e);
18120
18451
  }
18121
18452
  return isSessionRefreshed;
18122
18453
  };
@@ -18126,7 +18457,7 @@ const addAnimationStartListener = (element, listener) => {
18126
18457
  const removeAnimationStartListener = (element, listener) => {
18127
18458
  element.removeEventListener("animationstart", listener, false);
18128
18459
  };
18129
- const logger$n = createLogger("Fetch");
18460
+ const logger$o = createLogger("Fetch");
18130
18461
  const getRequestObject = (options, data) => {
18131
18462
  const {
18132
18463
  headers = [],
@@ -18173,10 +18504,10 @@ const logFetchError = (message, level) => {
18173
18504
  case "info":
18174
18505
  case "warn":
18175
18506
  case "error":
18176
- logger$n[level](message);
18507
+ logger$o[level](message);
18177
18508
  break;
18178
18509
  default:
18179
- logger$n.error(message);
18510
+ logger$o.error(message);
18180
18511
  }
18181
18512
  };
18182
18513
  const handleFetchResponse = async (response, responseType) => {
@@ -18274,7 +18605,7 @@ const RELEVANT_MESSAGE_TYPES = ["account_verification_report_id", "error"];
18274
18605
  const TERMINAL_DATA_PROPS = ["accounts", "error", "reference"];
18275
18606
  const MOUNT_TIMEOUT = 10 * 1e3;
18276
18607
  const TINK_VENDOR = "Tink";
18277
- const logger$m = createLogger("iframeWidget");
18608
+ const logger$n = createLogger("iframeWidget");
18278
18609
  const isObjectData = (data) => typeof data === "object" && !Array.isArray(data) && data !== null;
18279
18610
  const isTerminalMessageData = (data) => isObjectData(data) && Object.entries(data).some(([prop]) => TERMINAL_DATA_PROPS.includes(prop));
18280
18611
  const parseMessageJson = (message) => {
@@ -18292,7 +18623,7 @@ const callbackErrorHandler = async (response) => {
18292
18623
  try {
18293
18624
  await response;
18294
18625
  } catch (ex) {
18295
- logger$m.error(ex);
18626
+ logger$n.error(ex);
18296
18627
  }
18297
18628
  return {
18298
18629
  error: "UNKNOWN_ERROR",
@@ -18395,7 +18726,7 @@ class IFrameWidget {
18395
18726
  message = responseData.errorMessage;
18396
18727
  }
18397
18728
  } catch (ex) {
18398
- logger$m.error(ex);
18729
+ logger$n.error(ex);
18399
18730
  }
18400
18731
  throw new AdyenKycSdkError(reason, jsonData.error);
18401
18732
  }
@@ -18582,7 +18913,7 @@ function BankVerificationWidget({
18582
18913
  ref: widgetContainerRef
18583
18914
  });
18584
18915
  }
18585
- const logger$l = createLogger("BankVerification");
18916
+ const logger$m = createLogger("BankVerification");
18586
18917
  const accountVerificationFields = ["verifiedAccountHolder", "verifiedBankCountry", "verifiedBankName", "verifiedCurrencyCode", "verifiedBankAccountNumber"];
18587
18918
  const InstantVerificationErrorContext = createContext(null);
18588
18919
  const useInstantVerificationErrorNotification = (notificationVisibilityDuration) => {
@@ -18614,7 +18945,7 @@ const usePreferredVendorForCountry = (country2, getBankVerificationVendors) => {
18614
18945
  const vendor = vendors[0];
18615
18946
  setPreferredVendor(vendor.name ? vendor : void 0);
18616
18947
  };
18617
- getPreferredVendor().catch(logger$l.error);
18948
+ getPreferredVendor().catch(logger$m.error);
18618
18949
  }, [country2, getBankVerificationVendors]);
18619
18950
  return preferredVendor;
18620
18951
  };
@@ -18813,6 +19144,12 @@ function BankVerification(props) {
18813
19144
  });
18814
19145
  }
18815
19146
  const BankVerification$1 = memo(BankVerification);
19147
+ const CoreContext = createContext(void 0);
19148
+ const useCoreContext = () => {
19149
+ const context = useContext(CoreContext);
19150
+ if (!context) throw Error("You need a <CoreProvider> to use core context");
19151
+ return context;
19152
+ };
18816
19153
  const countriesWithMultipleCurrencies = /* @__PURE__ */ new Set([CountryCodes.Bulgaria, CountryCodes.Canada, CountryCodes.Croatia, CountryCodes.CzechRepublic, CountryCodes.Hungary, CountryCodes.Romania, CountryCodes.Switzerland]);
18817
19154
  const countriesWithLocalFormat = /* @__PURE__ */ new Set([CountryCodes.Denmark, CountryCodes.Norway, CountryCodes.Poland, CountryCodes.Sweden, CountryCodes.UnitedKingdom]);
18818
19155
  const payoutCurrencySupport = {
@@ -20514,7 +20851,7 @@ function SolePropComponent(props) {
20514
20851
  const [tradingName2, setTradingName] = useState();
20515
20852
  const solePropNameAndCountryFormProps = getFormProps(props, solePropNameAndCountryFormId);
20516
20853
  const solePropsRegistrationDetailsFormProps = getFormProps(props, solePropRegistrationDetailsFormId);
20517
- const solePropRegistrationAddressFormProps = getFormProps(props, solePropRegistrationAddressFormId);
20854
+ const solePropRegistrationAddressFormProps = getNestedOuterFormPropsFromOuterFormProps(props, solePropRegistrationAddressFormId);
20518
20855
  const solePropDocumentsFormProps = getFormProps(props, solePropDocumentFormId);
20519
20856
  const handleStateChange = ({
20520
20857
  currentState
@@ -21111,10 +21448,11 @@ function TrustComponent(props) {
21111
21448
  i18n
21112
21449
  } = useI18nContext();
21113
21450
  const trustRegistrationDetailsFormProps = getFormProps(props, trustRegistrationDetailsFormId);
21114
- const trustRegistrationAddressFormProps = getFormProps(props, trustRegistrationAddressFormId);
21451
+ const trustRegistrationAddressFormProps = getNestedOuterFormPropsFromOuterFormProps(props, trustRegistrationAddressFormId);
21115
21452
  const trustDocumentFormProps = getFormProps(props, trustConstitutionalDocumentFormId);
21116
21453
  const handleStateChange = () => {
21117
21454
  };
21455
+ console.log("trustRegistrationDetailsFormProps", trustRegistrationDetailsFormProps);
21118
21456
  const renderActiveForm = (activeForm) => jsxs("div", {
21119
21457
  className: "adyen-kyc-trust",
21120
21458
  children: [jsx(StateContextWatcher, {
@@ -21841,6 +22179,55 @@ function ErrorPanel({
21841
22179
  })]
21842
22180
  });
21843
22181
  }
22182
+ const headingTypes = {
22183
+ 1: ({
22184
+ children,
22185
+ className
22186
+ }) => jsx("h1", {
22187
+ className,
22188
+ children
22189
+ }),
22190
+ 2: ({
22191
+ children,
22192
+ className
22193
+ }) => jsx("h2", {
22194
+ className,
22195
+ children
22196
+ }),
22197
+ 3: ({
22198
+ children,
22199
+ className
22200
+ }) => jsx("h3", {
22201
+ className,
22202
+ children
22203
+ }),
22204
+ 4: ({
22205
+ children,
22206
+ className
22207
+ }) => jsx("h4", {
22208
+ className,
22209
+ children
22210
+ }),
22211
+ sub: ({
22212
+ children,
22213
+ className
22214
+ }) => jsx("div", {
22215
+ className,
22216
+ children
22217
+ })
22218
+ };
22219
+ function Heading({
22220
+ className,
22221
+ level,
22222
+ children
22223
+ }) {
22224
+ const HeadingElement = headingTypes[level] || headingTypes[1];
22225
+ const classNames = cx("adyen-kyc-heading", `adyen-kyc-heading--${level}`, className);
22226
+ return jsx(HeadingElement, {
22227
+ className: classNames,
22228
+ children
22229
+ });
22230
+ }
21844
22231
  const summaryStep = {
21845
22232
  formId: "summary",
21846
22233
  formName: "summary"
@@ -21869,61 +22256,58 @@ function Summary({
21869
22256
  gotoForm(formIndex);
21870
22257
  }
21871
22258
  };
21872
- const allValidationErrors = (problems == null ? void 0 : problems.validationErrors) && ((_a = Object.values(problems == null ? void 0 : problems.validationErrors)) == null ? void 0 : _a.reduce((acc, validError) => ({
22259
+ const allValidationErrors = (problems == null ? void 0 : problems.validationErrors) && ((_a = Object.values(problems.validationErrors)) == null ? void 0 : _a.reduce((acc, validError) => ({
21873
22260
  ...acc,
21874
22261
  ...validError
21875
22262
  }), {}));
21876
- const allVerificationErrors = (problems == null ? void 0 : problems.verificationErrors) && ((_b = Object.values(problems == null ? void 0 : problems.verificationErrors)) == null ? void 0 : _b.reduce((acc, verifError) => ({
22263
+ const allVerificationErrors = (problems == null ? void 0 : problems.verificationErrors) && ((_b = Object.values(problems.verificationErrors)) == null ? void 0 : _b.reduce((acc, verifError) => ({
21877
22264
  ...acc,
21878
22265
  ...verifError
21879
22266
  }), {}));
21880
22267
  const formUtils = formUtilities({
21881
22268
  labels: labels2
21882
22269
  }, i18n);
21883
- const summaryItemHeader = (formName, formId) => jsxs("ul", {
21884
- className: "adyen-kyc-summary__heading-section",
21885
- children: [jsx("li", {
21886
- children: jsx("span", {
21887
- className: "adyen-kyc-summary__form-heading",
21888
- children: formName
21889
- })
21890
- }), jsx("li", {
21891
- children: jsx(Button, {
21892
- className: "adyen-kyc-summary__edit-form-button",
21893
- ghost: true,
21894
- circle: true,
21895
- tertiary: true,
21896
- icon: "edit",
21897
- onClick: () => {
21898
- trackNavigation2({
21899
- fromForm: {
21900
- formName: "summary",
21901
- formId: "summary"
21902
- },
21903
- toForm: {
21904
- formId,
21905
- formName
21906
- },
21907
- component: "Pencil icon"
21908
- });
21909
- editForm(formId);
21910
- },
21911
- title: i18n.get("edit"),
21912
- label: i18n.get("edit"),
21913
- labelHoverBox: true
21914
- })
22270
+ const summarySectionHeader = (formName, formId) => jsxs("header", {
22271
+ className: "adyen-kyc-summary-section__header",
22272
+ children: [jsx(Heading, {
22273
+ level: 4,
22274
+ className: "adyen-kyc-summary-section__heading",
22275
+ children: formName
22276
+ }), jsx(Button, {
22277
+ className: "adyen-kyc-summary-section__edit-button",
22278
+ ghost: true,
22279
+ circle: true,
22280
+ tertiary: true,
22281
+ icon: "edit",
22282
+ onClick: () => {
22283
+ trackNavigation2({
22284
+ fromForm: {
22285
+ formName: "summary",
22286
+ formId: "summary"
22287
+ },
22288
+ toForm: {
22289
+ formId,
22290
+ formName
22291
+ },
22292
+ component: "Pencil icon"
22293
+ });
22294
+ editForm(formId);
22295
+ },
22296
+ title: i18n.get("edit"),
22297
+ label: i18n.get("edit"),
22298
+ labelHoverBox: true
21915
22299
  })]
21916
22300
  });
21917
- const renderSummaryItem = (fieldData, labelData, formName, formId) => jsxs("li", {
21918
- className: "adyen-kyc-summary__item",
21919
- children: [showSectionHeader && summaryItemHeader(formName, formId), jsx("ul", {
21920
- className: cx("adyen-kyc-summary__content-section", {
21921
- "adyen-kyc-summary__content-section--with-header": showSectionHeader
22301
+ const renderSummarySection = (fieldData, labelData, formName, formId) => jsxs("section", {
22302
+ className: "adyen-kyc-summary-section",
22303
+ children: [showSectionHeader && summarySectionHeader(formName, formId), jsx("dl", {
22304
+ className: cx("adyen-kyc-summary-section__content", {
22305
+ "adyen-kyc-summary-section__content--no-header": !showSectionHeader
21922
22306
  }),
21923
- children: renderFormData(fieldData, labelData)
22307
+ children: renderSummaryItems(fieldData, labelData)
21924
22308
  })]
21925
22309
  });
21926
- const renderSummary = (data2) => {
22310
+ const renderSummaryContent = (data2) => {
21927
22311
  const summaryList = [];
21928
22312
  forms2.forEach(({
21929
22313
  formId,
@@ -21931,53 +22315,44 @@ function Summary({
21931
22315
  }) => {
21932
22316
  const currentFormData = data2[formId];
21933
22317
  const isFormEmpty = !currentFormData || Object.values(currentFormData).every((value) => isEmpty(value));
21934
- if (isFormEmpty || formId === summaryStep.formId || omittedForms.includes(formId)) {
21935
- return;
21936
- }
21937
- const summaryItems = currentFormData.hasInnerForms ? renderInnerForms(labels2 == null ? void 0 : labels2[formId], formId, currentFormData) : currentFormData ? renderSummaryItem(currentFormData, labels2 == null ? void 0 : labels2[formId], i18n.get(formName), formId) : null;
22318
+ if (isFormEmpty || formId === summaryStep.formId || omittedForms.includes(formId)) return;
22319
+ const summaryItems = currentFormData.hasInnerForms ? renderInnerForms(labels2 == null ? void 0 : labels2[formId], formId, currentFormData) : renderSummarySection(currentFormData, labels2 == null ? void 0 : labels2[formId], i18n.get(formName), formId);
21938
22320
  summaryList.push(summaryItems);
21939
22321
  });
21940
22322
  return summaryList;
21941
22323
  };
21942
22324
  const renderInnerForms = (labelData, parentFormId, innerForms = {}) => {
22325
+ if (!innerForms) return [];
21943
22326
  const dataList = [];
21944
- if (innerForms) {
21945
- Object.entries(innerForms).forEach(([innerFormName, innerFormFieldData]) => {
21946
- const formName = i18n.get(labelData == null ? void 0 : labelData[innerFormName]) || i18n.get(innerFormName);
21947
- if (typeof innerFormFieldData === "object" && innerFormFieldData !== null) {
21948
- dataList.push(renderSummaryItem(innerFormFieldData, labelData, formName, parentFormId));
21949
- }
21950
- });
21951
- }
22327
+ Object.entries(innerForms).forEach(([innerFormName, innerFormFieldData]) => {
22328
+ const formName = i18n.get(labelData == null ? void 0 : labelData[innerFormName]) || i18n.get(innerFormName);
22329
+ if (typeof innerFormFieldData === "object" && innerFormFieldData !== null) {
22330
+ dataList.push(renderSummarySection(innerFormFieldData, labelData, formName, parentFormId));
22331
+ }
22332
+ });
21952
22333
  return dataList;
21953
22334
  };
21954
- const renderFormData = (formData = {}, labelData = {}) => {
22335
+ const renderSummaryItems = (formData = {}, labelData = {}) => {
22336
+ if (!formData) return [];
21955
22337
  const dataList = [];
21956
- if (formData) {
21957
- Object.entries(formData).forEach(([field, fieldData]) => {
21958
- const fieldName = i18n.get(labelData[field]) || i18n.get(field);
21959
- if (typeof fieldData === "object" && fieldData !== null && !(omittedKeys == null ? void 0 : omittedKeys.includes(field))) {
21960
- dataList.push(jsx("li", {
21961
- className: "adyen-kyc-summary__item-nested",
21962
- children: jsx("ul", {
21963
- className: "adyen-kyc-summary__content-section-nested",
21964
- children: renderFormData(fieldData, labelData)
21965
- })
21966
- }));
21967
- } else if (typeof fieldData === "string" && !(omittedKeys == null ? void 0 : omittedKeys.includes(field))) {
21968
- dataList.push(jsxs("li", {
21969
- className: "adyen-kyc-summary__data-item",
21970
- children: [jsx("span", {
21971
- className: "adyen-kyc-summary__field",
21972
- children: fieldName
21973
- }), jsx("span", {
21974
- className: "adyen-kyc-summary__data",
21975
- children: fieldData
21976
- })]
21977
- }));
21978
- }
21979
- });
21980
- }
22338
+ Object.entries(formData).forEach(([field, fieldData]) => {
22339
+ if ((omittedKeys == null ? void 0 : omittedKeys.includes(field)) || !fieldData) return;
22340
+ const fieldName = i18n.get(labelData[field]) || i18n.get(field);
22341
+ if (typeof fieldData === "object") {
22342
+ dataList.push(renderSummaryItems(fieldData, labelData));
22343
+ } else if (typeof fieldData === "string") {
22344
+ dataList.push(jsxs("div", {
22345
+ className: "adyen-kyc-summary-section__field",
22346
+ children: [jsx("dt", {
22347
+ className: "adyen-kyc-summary-section__label",
22348
+ children: fieldName
22349
+ }), jsx("dd", {
22350
+ className: "adyen-kyc-summary-section__data",
22351
+ children: fieldData
22352
+ })]
22353
+ }));
22354
+ }
22355
+ });
21981
22356
  return dataList;
21982
22357
  };
21983
22358
  return jsxs("div", {
@@ -21991,9 +22366,9 @@ function Summary({
21991
22366
  verificationErrors: allVerificationErrors,
21992
22367
  formUtils,
21993
22368
  id: "ariaErrorField"
21994
- }), jsx("ul", {
21995
- className: "adyen-kyc-summary",
21996
- children: renderSummary(data)
22369
+ }), jsx("div", {
22370
+ className: "adyen-kyc-summary__content",
22371
+ children: renderSummaryContent(data)
21997
22372
  }), showLegalCaption && jsx("span", {
21998
22373
  className: "adyen-kyc-summary__legal-caption",
21999
22374
  children: i18n.get("summaryLegalCaption")
@@ -22217,7 +22592,7 @@ const defaultPayoutAccountFormat = {
22217
22592
  [CountryCodes.Sweden]: "local",
22218
22593
  [CountryCodes.UnitedKingdom]: "local"
22219
22594
  };
22220
- const logger$k = createLogger("useScenarioConfiguration");
22595
+ const logger$l = createLogger("useScenarioConfiguration");
22221
22596
  const useScenarioConfiguration = ({
22222
22597
  getConfigurationData,
22223
22598
  getPayoutAccountFormatData,
@@ -22240,12 +22615,12 @@ const useScenarioConfiguration = ({
22240
22615
  const response = await getConfigurationData();
22241
22616
  setConfigurationResponse(response);
22242
22617
  } catch (err) {
22243
- logger$k.warn("WARNING: Configuration request failed - error:", err);
22618
+ logger$l.warn("WARNING: Configuration request failed - error:", err);
22244
22619
  } finally {
22245
22620
  setLoadingStatus("success");
22246
22621
  }
22247
22622
  };
22248
- makeConfigCallAndSave().catch(logger$k.error);
22623
+ makeConfigCallAndSave().catch(logger$l.error);
22249
22624
  }, [getConfigurationData, setLoadingStatus]);
22250
22625
  useEffect(() => {
22251
22626
  setLoadingStatus("loading");
@@ -22262,12 +22637,12 @@ const useScenarioConfiguration = ({
22262
22637
  const defaultAccountFormat = defaultPayoutAccountFormat[country2] ?? allowedBankAccountFormats[0];
22263
22638
  setAccountFormat(existingBankAccountFormat ?? defaultAccountFormat);
22264
22639
  } catch (err) {
22265
- logger$k.warn("WARNING: Payout format request failed - error:", err);
22640
+ logger$l.warn("WARNING: Payout format request failed - error:", err);
22266
22641
  } finally {
22267
22642
  setLoadingStatus("success");
22268
22643
  }
22269
22644
  };
22270
- makePayoutFormatCallAndSave().catch(logger$k.error);
22645
+ makePayoutFormatCallAndSave().catch(logger$l.error);
22271
22646
  }, [country2, setAccountFormat, getPayoutAccountFormatData, setLoadingStatus, existingBankAccountFormat]);
22272
22647
  const {
22273
22648
  fieldConfigurations,
@@ -22436,10 +22811,13 @@ const solePropBase = {
22436
22811
  rule: "REQUIRED"
22437
22812
  },
22438
22813
  stockExchangeMIC: {
22439
- rule: "stockExchangeMICIfTypePublic"
22814
+ rule: "ifPubliclyTradedCompany"
22440
22815
  },
22441
22816
  stockISIN: {
22442
- rule: "stockISINIfTypePublic"
22817
+ rule: "ifPubliclyTradedCompany"
22818
+ },
22819
+ stockTickerSymbol: {
22820
+ rule: "ifPubliclyTradedCompany"
22443
22821
  },
22444
22822
  tradingName: {
22445
22823
  rule: "REQUIRED"
@@ -22563,6 +22941,10 @@ function parseTrustScenarios(scenario, country2) {
22563
22941
  return fieldConfigurations;
22564
22942
  }
22565
22943
  }
22944
+ const parseHighExposureScenarios = (scenario) => scenario == null ? void 0 : scenario.reduce((scenarios, scenarioName) => ({
22945
+ ...scenarios,
22946
+ ...fieldsPerScenario$1[scenarioName]
22947
+ }), {});
22566
22948
  function parseSolePropScenarios(scenario, country2) {
22567
22949
  if (scenario) {
22568
22950
  let fieldConfigurations = scenario.reduce((scenarios, scenarioName) => ({
@@ -23365,7 +23747,7 @@ function VatNumberField({
23365
23747
  }
23366
23748
  const BUSINESS_NAME_FIELD = ["businessName"];
23367
23749
  const basicInformationFields = [...COUNTRY_FIELD, ...BUSINESS_NAME_FIELD, ...STATE_FIELD, ...TAX_INFORMATION_FIELD, ...BUSINESS_REGISTRATION_NUMBER_FIELD];
23368
- const additionalInformationFields = [...LEGAL_COMPANY_NAME_FIELD, ...TRADING_NAME_FIELD, ...STOCK_EXCHANGE_MIC_FIELD, ...STOCK_ISIN_FIELD, ...DATE_OF_INCORPORATION_FIELD, ...BUSINESS_REGISTRATION_NUMBER_FIELD, ...TAX_INFORMATION_FIELD, ...VAT_NUMBER_FIELD];
23750
+ const additionalInformationFields = [...LEGAL_COMPANY_NAME_FIELD, ...TRADING_NAME_FIELD, ...STOCK_EXCHANGE_MIC_FIELD, ...STOCK_ISIN_FIELD, ...STOCK_TICKER_SYMBOL_FIELD, ...DATE_OF_INCORPORATION_FIELD, ...BUSINESS_REGISTRATION_NUMBER_FIELD, ...TAX_INFORMATION_FIELD, ...VAT_NUMBER_FIELD];
23369
23751
  const FIELDS_NEEDED_FOR_COMPANY_SEARCH = [...BUSINESS_NAME_FIELD, ...TAX_INFORMATION_FIELD, ...BUSINESS_REGISTRATION_NUMBER_FIELD];
23370
23752
  const getForms = (country2) => ({
23371
23753
  basicInformation: {
@@ -23843,7 +24225,7 @@ const useExpiryThreshold = (expiry) => {
23843
24225
  };
23844
24226
  };
23845
24227
  const ExpiryContext = createContext(false);
23846
- const logger$j = createLogger("ExpiryProvider");
24228
+ const logger$k = createLogger("ExpiryProvider");
23847
24229
  const ExpiryProvider = ({
23848
24230
  expiry: initialExpiry,
23849
24231
  eventEmitter,
@@ -23876,7 +24258,7 @@ const ExpiryProvider = ({
23876
24258
  refreshExpiry().then((newExpiry) => {
23877
24259
  setExpiry(newExpiry);
23878
24260
  setModalDismissed(false);
23879
- }).catch(logger$j.error);
24261
+ }).catch(logger$k.error);
23880
24262
  }
23881
24263
  }), children]
23882
24264
  });
@@ -23896,7 +24278,7 @@ const ExpiryProvider = ({
23896
24278
  });
23897
24279
  };
23898
24280
  const useHasExpired = () => useContext(ExpiryContext);
23899
- const logger$i = createLogger("FormRouterContextProvider");
24281
+ const logger$j = createLogger("FormRouterContextProvider");
23900
24282
  function FormRouterContextProvider({
23901
24283
  children,
23902
24284
  forms: forms2,
@@ -23916,7 +24298,7 @@ function FormRouterContextProvider({
23916
24298
  if (formIndex > -1) {
23917
24299
  setFormIndex(formIndex);
23918
24300
  } else {
23919
- logger$i.error("No form was found to have that field so form navigation failed.");
24301
+ logger$j.error("No form was found to have that field so form navigation failed.");
23920
24302
  }
23921
24303
  }
23922
24304
  }), [forms2, handleGetIdVerificationToken, setFormIndex]);
@@ -24081,7 +24463,7 @@ const FormWrapper = ({
24081
24463
  isExperimentEnabled
24082
24464
  } = useExperimentsContext();
24083
24465
  const showExtraTaxExemptionReasons = isExperimentEnabled(ExperimentNames.ShowExtraTaxExemptionReasons);
24084
- const showTaxExemptedLegalCaption = showExtraTaxExemptionReasons && ((_a = summaryData.companyRegistrationDetails) == null ? void 0 : _a.vatAbsenceReason);
24466
+ const showTaxExemptedLegalCaption = showExtraTaxExemptionReasons && ((_a = summaryData.companyRegistrationDetails) == null ? void 0 : _a.vatAbsenceReason) && ["companyDetails"].includes(taskName);
24085
24467
  const summaryContent = jsx("div", {
24086
24468
  className: "adyen-kyc-form-wrapper",
24087
24469
  children: jsx(Summary, {
@@ -24178,11 +24560,16 @@ const validateErrorCode = (error, errorCode) => error && "errorCode" in error &&
24178
24560
  const isValidationError = (error) => validateErrorCode(error, API_VALIDATION_ERROR_CODE);
24179
24561
  const isIdDocumentUploadError = (error) => validateErrorCode(error, ID_DOCUMENT_UPLOAD_ERROR_CODE);
24180
24562
  const isBankStatementUploadError = (error) => validateErrorCode(error, BANK_STATEMENT_UPLOAD_ERROR_CODE);
24181
- const processValidationErrors = (validationError, dropinTask) => {
24563
+ const processValidationErrors = (validationError, dropinTask, keyMappings) => {
24182
24564
  if ((validationError == null ? void 0 : validationError.invalidFields) && (validationError == null ? void 0 : validationError.invalidFields.length) > 0) {
24183
24565
  return validationError == null ? void 0 : validationError.invalidFields.reduce((acc, invalidField) => {
24184
24566
  if (invalidField == null ? void 0 : invalidField.name) {
24185
- const mappedFieldPath = mapField(invalidField == null ? void 0 : invalidField.name, dropinTask);
24567
+ let mappedFieldPath = mapField(invalidField == null ? void 0 : invalidField.name, dropinTask);
24568
+ if (keyMappings) {
24569
+ mappedFieldPath = {
24570
+ ...keyMappings
24571
+ };
24572
+ }
24186
24573
  if (mappedFieldPath) {
24187
24574
  assignToProp(mappedFieldPath, acc, true);
24188
24575
  }
@@ -24244,7 +24631,7 @@ const mapBusinessDetailsSchemaToLegalEntity = (data) => {
24244
24631
  return requestObj;
24245
24632
  };
24246
24633
  const MANDATORY_API_FIELDS = ["basicInformation.legalCompanyName", "basicInformation.country"];
24247
- const parseConfiguration$6 = ({
24634
+ const parseConfiguration$7 = ({
24248
24635
  country: country2,
24249
24636
  matchingScenario
24250
24637
  }) => parseBusinessDetailsScenarios(matchingScenario == null ? void 0 : matchingScenario[LegalEntityType.ORGANIZATION], country2);
@@ -24260,15 +24647,7 @@ const formatDataForSummary$1 = (data, forms2, labels2, i18n) => {
24260
24647
  if (!form) return summaryData;
24261
24648
  switch (form) {
24262
24649
  case "basicInformation":
24263
- return {
24264
- ...summaryData,
24265
- [form]: formData
24266
- };
24267
24650
  case "companyStructure":
24268
- return {
24269
- ...summaryData,
24270
- [form]: formData
24271
- };
24272
24651
  case "additionalInformation":
24273
24652
  return {
24274
24653
  ...summaryData,
@@ -24504,7 +24883,7 @@ function BusinessDetailsDropinComponent({
24504
24883
  const {
24505
24884
  fieldConfigurations
24506
24885
  } = useScenarioConfiguration({
24507
- parseConfiguration: parseConfiguration$6,
24886
+ parseConfiguration: parseConfiguration$7,
24508
24887
  getConfigurationData,
24509
24888
  setLoadingStatus,
24510
24889
  country: currentCountry
@@ -24791,7 +25170,7 @@ const getTargetLegalEntityType = (businessType, legalArrangement, trusteeType, c
24791
25170
  return currentLegalEntityType;
24792
25171
  };
24793
25172
  const isLegalArrangementOrganizationSubtype = (legalArrangementOption) => legalArrangementOption === "partnershipIncorporated" || legalArrangementOption === "associationIncorporated";
24794
- const parseConfiguration$5 = ({
25173
+ const parseConfiguration$6 = ({
24795
25174
  country: country2,
24796
25175
  matchingScenario
24797
25176
  }) => parseCompanyScenarios(matchingScenario == null ? void 0 : matchingScenario[LegalEntityType.ORGANIZATION], country2);
@@ -24840,10 +25219,13 @@ function CompanyDropinComponent({
24840
25219
  handleUpdateLegalEntity,
24841
25220
  handleHomeClick,
24842
25221
  onTypeSwitch,
24843
- onChange,
24844
- accountHolder: accountHolder2
25222
+ onChange
24845
25223
  }) {
24846
25224
  var _a, _b;
25225
+ const {
25226
+ accountHolder: accountHolder2,
25227
+ setAccountHolder
25228
+ } = useCoreContext();
24847
25229
  const {
24848
25230
  showToast,
24849
25231
  clearToasts
@@ -24888,7 +25270,7 @@ function CompanyDropinComponent({
24888
25270
  fieldConfigurations,
24889
25271
  requiredFields
24890
25272
  } = useScenarioConfiguration({
24891
- parseConfiguration: parseConfiguration$5,
25273
+ parseConfiguration: parseConfiguration$6,
24892
25274
  getConfigurationData,
24893
25275
  setLoadingStatus,
24894
25276
  country: country2
@@ -24975,7 +25357,8 @@ function CompanyDropinComponent({
24975
25357
  legalEntityName: dataSubmitted.companyNameAndCountry.legalCompanyName,
24976
25358
  usedAdditionalAddress: dataSubmitted.companyRegistrationAddress.operationalAddressIsSame === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME
24977
25359
  };
24978
- legalEntity.entityAssociations = filterOutUnwantedAssociationsIfRootLE(taskType, legalEntityResponse, dataSubmitted.companyType.accountHolder);
25360
+ const newAccountHolder = dataSubmitted.companyType.accountHolder ?? accountHolder2;
25361
+ legalEntity.entityAssociations = filterOutUnwantedAssociationsIfRootLE(taskType, legalEntityResponse, newAccountHolder);
24979
25362
  if (!isCountryOfGoverningLawEnabled && ((_a2 = legalEntity.organization) == null ? void 0 : _a2.countryOfGoverningLaw)) {
24980
25363
  delete legalEntity.organization.countryOfGoverningLaw;
24981
25364
  }
@@ -24991,6 +25374,7 @@ function CompanyDropinComponent({
24991
25374
  } else {
24992
25375
  legalEntity = await handleUpdateLegalEntity(drop("type").from(legalEntity), legalEntityResponse.id);
24993
25376
  }
25377
+ setAccountHolder(newAccountHolder);
24994
25378
  userEvents.addEvent("Saved company details", {
24995
25379
  segmentation: {
24996
25380
  ...baseTrackingPayload,
@@ -25069,33 +25453,32 @@ function CompanyDropinComponent({
25069
25453
  }, []);
25070
25454
  const datasetUtils = datasetUtilities(i18n.locale);
25071
25455
  const formatDataForSummary2 = (data2, forms22) => {
25072
- var _a2, _b2, _c, _d, _e, _f, _g, _h;
25456
+ var _a2, _b2, _c, _d, _e, _f;
25073
25457
  let summaryData = cloneObject(data2);
25074
- if ((_a2 = summaryData == null ? void 0 : summaryData.companyNameAndCountry) == null ? void 0 : _a2.country) {
25075
- summaryData.companyNameAndCountry.countryRegionOfEstablishment = datasetUtils.getCountryName(summaryData.companyNameAndCountry.country);
25458
+ if (summaryData.companyNameAndCountry) {
25459
+ if (isCountryOfGoverningLawEnabled) {
25460
+ summaryData.companyNameAndCountry = getUpdatedCountryOfGoverningLaw(summaryData.companyNameAndCountry);
25461
+ } else {
25462
+ summaryData.companyNameAndCountry.country = datasetUtils.getCountryName(summaryData.companyNameAndCountry.country);
25463
+ }
25464
+ summaryData.companyNameAndCountry.countryRegionOfEstablishment = summaryData.companyNameAndCountry.country;
25076
25465
  delete summaryData.companyNameAndCountry.country;
25077
25466
  }
25078
- if (isCountryOfGoverningLawEnabled) {
25079
- summaryData.companyNameAndCountry = getUpdatedCountryOfGoverningLaw(summaryData.companyNameAndCountry);
25080
- }
25081
- if ((_b2 = summaryData == null ? void 0 : summaryData.companyType) == null ? void 0 : _b2.entityType) {
25082
- const companyType2 = (_c = companyTypes.find((companyType22) => {
25083
- var _a3;
25084
- return companyType22.id === ((_a3 = summaryData.companyType) == null ? void 0 : _a3.entityType);
25085
- })) == null ? void 0 : _c.name;
25467
+ if ((_a2 = summaryData.companyType) == null ? void 0 : _a2.entityType) {
25468
+ const companyType2 = (_b2 = companyTypes.find((type) => type.id === summaryData.companyType.entityType)) == null ? void 0 : _b2.name;
25086
25469
  summaryData.companyType.entityType = i18n.get(companyType2);
25087
25470
  }
25088
- if ((_d = summaryData == null ? void 0 : summaryData.companyType) == null ? void 0 : _d.accountHolder) {
25089
- summaryData.companyType.accountHolder = i18n.get((_e = summaryData == null ? void 0 : summaryData.companyType) == null ? void 0 : _e.accountHolder);
25471
+ if ((_c = summaryData.companyType) == null ? void 0 : _c.accountHolder) {
25472
+ summaryData.companyType.accountHolder = i18n.get(summaryData.companyType.accountHolder);
25090
25473
  }
25091
- if ((_f = summaryData == null ? void 0 : summaryData.companyRegistrationAddress) == null ? void 0 : _f.registrationAddress) {
25474
+ if ((_d = summaryData.companyRegistrationAddress) == null ? void 0 : _d.registrationAddress) {
25092
25475
  summaryData.companyRegistrationAddress.hasInnerForms = true;
25093
- summaryData.companyRegistrationAddress.registrationAddress = mapAddressLabels(summaryData == null ? void 0 : summaryData.companyRegistrationAddress.registrationAddress, datasetUtils);
25476
+ summaryData.companyRegistrationAddress.registrationAddress = mapAddressLabels(summaryData.companyRegistrationAddress.registrationAddress, datasetUtils);
25094
25477
  }
25095
- if ((_g = summaryData == null ? void 0 : summaryData.companyRegistrationAddress) == null ? void 0 : _g.operationalAddress) {
25096
- summaryData.companyRegistrationAddress.operationalAddress = mapAddressLabels(summaryData == null ? void 0 : summaryData.companyRegistrationAddress.operationalAddress, datasetUtils);
25478
+ if ((_e = summaryData.companyRegistrationAddress) == null ? void 0 : _e.operationalAddress) {
25479
+ summaryData.companyRegistrationAddress.operationalAddress = mapAddressLabels(summaryData.companyRegistrationAddress.operationalAddress, datasetUtils);
25097
25480
  }
25098
- if ((_h = summaryData.companyRegistrationDetails) == null ? void 0 : _h.vatAbsenceReason) {
25481
+ if ((_f = summaryData.companyRegistrationDetails) == null ? void 0 : _f.vatAbsenceReason) {
25099
25482
  const vatAbsenceReason2 = vatAbsenceReasons.find((absenceReason) => absenceReason === summaryData.companyRegistrationDetails.vatAbsenceReason);
25100
25483
  if (vatAbsenceReason2) {
25101
25484
  summaryData.companyRegistrationDetails.vatAbsenceReason = i18n.get(vatAbsenceReason2);
@@ -25177,7 +25560,7 @@ var CompanySearchEvents = /* @__PURE__ */ ((CompanySearchEvents2) => {
25177
25560
  CompanySearchEvents2["SELECTION_ERROR"] = "CompanySearch_CompanySelectionError";
25178
25561
  return CompanySearchEvents2;
25179
25562
  })(CompanySearchEvents || {});
25180
- const logger$h = createLogger("useCompanySearch");
25563
+ const logger$i = createLogger("useCompanySearch");
25181
25564
  const LOW_RISK_COMPANY_DATA_COMPLIANCE_WINDOW = 1577664e5;
25182
25565
  function useCompanySearch({
25183
25566
  defaultData,
@@ -25301,7 +25684,7 @@ function useCompanySearch({
25301
25684
  state: companyData.state ?? stateOrProvince2
25302
25685
  });
25303
25686
  } catch (e) {
25304
- logger$h.error(e);
25687
+ logger$i.error(e);
25305
25688
  setError(e);
25306
25689
  setStatus("error");
25307
25690
  } finally {
@@ -25334,7 +25717,7 @@ function useCompanySearch({
25334
25717
  indexSearch: handleCompanyIndexSearch,
25335
25718
  deepSearch: handleCompanyDeepSearch,
25336
25719
  resultsLimit: limit
25337
- })) == null ? void 0 : _a.catch((e) => logger$h.error(e));
25720
+ })) == null ? void 0 : _a.catch((e) => logger$i.error(e));
25338
25721
  }
25339
25722
  }, [legalCompanyName2, country2, stateOrProvince2, taxIdentificationNumber2, verifiedCompany, searchCompanies, handleCompanyIndexSearch, handleCompanyDeepSearch, limit, canVerify, baseTrackingPayload]);
25340
25723
  useEffect(() => {
@@ -25793,10 +26176,12 @@ const defaultFieldMetadata = defaultFieldMetadata$7;
25793
26176
  const defaultFieldConfig = entriesOf(defaultFieldConfig$7).reduce((fieldConfig, [country2, countryEntry]) => ({
25794
26177
  ...fieldConfig,
25795
26178
  [country2]: ({
25796
- taxIdNumberType
26179
+ taxIdNumberType,
26180
+ companyType: companyType2
25797
26181
  }) => {
25798
26182
  const fieldMetadata = resolveFieldMetadata(countryEntry, {
25799
- taxIdNumberType
26183
+ taxIdNumberType,
26184
+ companyType: companyType2
25800
26185
  }, defaultFieldMetadata$7);
25801
26186
  const taxIdValidators = fieldMetadata.validators ? Array.isArray(fieldMetadata.validators) ? fieldMetadata.validators : [fieldMetadata.validators] : [];
25802
26187
  const mappedValidators = taxIdValidators.map((validator) => ({
@@ -25863,7 +26248,7 @@ function CompanyBasics({
25863
26248
  const [loading2, setLoading] = useState$1(false);
25864
26249
  const allowedCountries = useAllowedCountries();
25865
26250
  const existingTaxId = (_b = (_a = data == null ? void 0 : data.taxInformation) == null ? void 0 : _a.find((taxId2) => taxId2.country === country2)) == null ? void 0 : _b.number;
25866
- const defaultTaxIdNumberType = existingTaxId ? inferTaxIdNumberType(existingTaxId, country2) : (_c = getTaxIdNumberOptions(country2, companyType2)) == null ? void 0 : _c[0].id;
26251
+ const defaultTaxIdNumberType = existingTaxId ? inferTaxIdNumberType(existingTaxId, country2, companyType2) : (_c = getTaxIdNumberOptions(country2, companyType2)) == null ? void 0 : _c[0].id;
25867
26252
  const [taxIdNumberType, setTaxIdNumberType] = useState$1(defaultTaxIdNumberType);
25868
26253
  const initialFormUtilsProps = useMemo$1(() => ({
25869
26254
  allFields,
@@ -25907,7 +26292,8 @@ function CompanyBasics({
25907
26292
  };
25908
26293
  case "taxInformation":
25909
26294
  return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig[country2], {
25910
- taxIdNumberType
26295
+ taxIdNumberType,
26296
+ companyType: companyType2
25911
26297
  }, defaultFieldMetadata), acc);
25912
26298
  default:
25913
26299
  return acc;
@@ -26054,7 +26440,7 @@ const TradingNameFieldValidation = () => ({
26054
26440
  }]
26055
26441
  });
26056
26442
  const COMPANY_OTHER_DETAILS_FORM_ID = "companyOtherDetails";
26057
- const companyOtherDetailsFields = [...TRADING_NAME_FIELD, ...STOCK_EXCHANGE_MIC_FIELD, ...STOCK_ISIN_FIELD, ...DATE_OF_INCORPORATION_FIELD, ...BUSINESS_REGISTRATION_NUMBER_FIELD, ...TAX_INFORMATION_FIELD, ...VAT_NUMBER_FIELD];
26443
+ const companyOtherDetailsFields = [...TRADING_NAME_FIELD, ...STOCK_EXCHANGE_MIC_FIELD, ...STOCK_ISIN_FIELD, ...STOCK_TICKER_SYMBOL_FIELD, ...DATE_OF_INCORPORATION_FIELD, ...BUSINESS_REGISTRATION_NUMBER_FIELD, ...TAX_INFORMATION_FIELD, ...VAT_NUMBER_FIELD];
26058
26444
  function CompanyOtherDetails({
26059
26445
  data,
26060
26446
  labels: labels2,
@@ -26085,12 +26471,12 @@ function CompanyOtherDetails({
26085
26471
  const registrationNumberOptions = useMemo$1(() => getCompanyRegistrationNumberOptions(country2, companyType2), [country2, companyType2]);
26086
26472
  const defaultRegistrationNumberType = (data == null ? void 0 : data.registrationNumber) ? inferCompanyRegistrationNumberType(data == null ? void 0 : data.registrationNumber, country2, companyType2) : registrationNumberOptions == null ? void 0 : registrationNumberOptions[0].id;
26087
26473
  const [registrationNumberType, setRegistrationNumberType] = useState$1(defaultRegistrationNumberType);
26088
- const defaultVatNumberType = (data == null ? void 0 : data.vatNumber) ? inferTaxIdNumberType(data == null ? void 0 : data.vatNumber, country2) : (_a = taxIdNumberOptions[country2]) == null ? void 0 : _a[0].id;
26474
+ const defaultVatNumberType = (data == null ? void 0 : data.vatNumber) ? inferTaxIdNumberType(data == null ? void 0 : data.vatNumber, country2, companyType2) : (_a = taxIdNumberOptions[country2]) == null ? void 0 : _a[0].id;
26089
26475
  const [vatNumberType, setVatNumberType] = useState$1(defaultVatNumberType);
26090
26476
  const existingTaxId = (_c = (_b = data == null ? void 0 : data.taxInformation) == null ? void 0 : _b.find((taxId2) => taxId2.country === country2)) == null ? void 0 : _c.number;
26091
- const defaultTaxIdNumberType = existingTaxId ? inferTaxIdNumberType(existingTaxId, country2) : (_d = getTaxIdNumberOptions(country2, companyType2)) == null ? void 0 : _d[0].id;
26477
+ const defaultTaxIdNumberType = existingTaxId ? inferTaxIdNumberType(existingTaxId, country2, companyType2) : (_d = getTaxIdNumberOptions(country2, companyType2)) == null ? void 0 : _d[0].id;
26092
26478
  const [taxIdNumberType, setTaxIdNumberType] = useState$1(defaultTaxIdNumberType);
26093
- const directChildFields = companyOtherDetailsFields.filter((field) => ["tradingName", "sameNameAsLegalName", "stockExchangeMIC", "stockISIN", "dateOfIncorporation"].includes(field));
26479
+ const directChildFields = companyOtherDetailsFields.filter((field) => ["tradingName", "sameNameAsLegalName", "stockExchangeMIC", "stockISIN", "stockTickerSymbol", "dateOfIncorporation"].includes(field));
26094
26480
  const initialFormUtilsProps = useMemo$1(() => ({
26095
26481
  allFields,
26096
26482
  labels: labels2,
@@ -26127,6 +26513,8 @@ function CompanyOtherDetails({
26127
26513
  return mergeFieldMetadataIntoProps("stockExchangeMIC", stockExchangeMICFieldMetadata, acc);
26128
26514
  case "stockISIN":
26129
26515
  return mergeFieldMetadataIntoProps("stockISIN", stockISINFieldMetadata, acc);
26516
+ case "stockTickerSymbol":
26517
+ return mergeFieldMetadataIntoProps("stockTickerSymbol", stockTickerSymbolFieldMetadata, acc);
26130
26518
  case "registrationNumber":
26131
26519
  return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig$8[country2], {
26132
26520
  companyType: companyType2,
@@ -26134,7 +26522,8 @@ function CompanyOtherDetails({
26134
26522
  }, defaultFieldMetadata$8), acc);
26135
26523
  case "taxInformation":
26136
26524
  return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig[country2], {
26137
- taxIdNumberType
26525
+ taxIdNumberType,
26526
+ companyType: companyType2
26138
26527
  }, defaultFieldMetadata), acc);
26139
26528
  case "vatNumber":
26140
26529
  return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig$6[country2], {
@@ -26300,6 +26689,19 @@ function CompanyOtherDetails({
26300
26689
  readonly: formUtils.isReadOnly("stockISIN"),
26301
26690
  handleChangeFor
26302
26691
  })
26692
+ }), formUtils.isRequiredField("stockTickerSymbol") && jsx("div", {
26693
+ className: "adyen-kyc-field-wrapper",
26694
+ children: jsx(StockTickerSymbolField, {
26695
+ data: formUtils.getFieldData(formData, STOCK_TICKER_SYMBOL_FIELD),
26696
+ valid: formUtils.getFieldValid(formValid, STOCK_TICKER_SYMBOL_FIELD),
26697
+ errors: formUtils.getFieldErrors(formErrors, formFieldProblems, STOCK_TICKER_SYMBOL_FIELD),
26698
+ labels: formUtils.getFieldLabels(STOCK_TICKER_SYMBOL_FIELD),
26699
+ placeholders: formUtils.getFieldPlaceholders(STOCK_TICKER_SYMBOL_FIELD),
26700
+ mask: formUtils.getMask("stockTickerSymbol"),
26701
+ guidanceText: formUtils.getFieldGuidanceText(STOCK_TICKER_SYMBOL_FIELD),
26702
+ readonly: formUtils.isReadOnly("stockTickerSymbol"),
26703
+ handleChangeFor
26704
+ })
26303
26705
  })]
26304
26706
  })]
26305
26707
  });
@@ -26343,7 +26745,7 @@ const forms = {
26343
26745
  fields: ["taxDocument"]
26344
26746
  }
26345
26747
  };
26346
- const parseConfiguration$4 = ({
26748
+ const parseConfiguration$5 = ({
26347
26749
  country: country2,
26348
26750
  matchingScenario
26349
26751
  }) => parseCompanySearchScenarios(matchingScenario == null ? void 0 : matchingScenario[LegalEntityType.ORGANIZATION], country2);
@@ -26373,7 +26775,8 @@ const formatDataForSummary = (data, forms2, labels2, i18n) => {
26373
26775
  const datasetUtils = datasetUtilities(i18n.locale);
26374
26776
  const country2 = (_a = data.companyBasics) == null ? void 0 : _a.country;
26375
26777
  const taxIdLabel = resolveFieldMetadata(defaultFieldConfig[country2], {
26376
- taxIdNumberType: countryToTaxInfoTypeMap[country2]
26778
+ taxIdNumberType: countryToTaxInfoTypeMap[country2],
26779
+ companyType: void 0
26377
26780
  }, defaultFieldMetadata).label;
26378
26781
  return entriesOf(data).reduce((summaryData, [form, formData]) => {
26379
26782
  var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j;
@@ -26561,7 +26964,7 @@ const mapLegalEntityToCompanySearchSchema = (legalEntity, isChangingType, accoun
26561
26964
  }
26562
26965
  }, {});
26563
26966
  };
26564
- const logger$g = createLogger("useFormTaskSubmit");
26967
+ const logger$h = createLogger("useFormTaskSubmit");
26565
26968
  function useCompanySearchTaskSubmit({
26566
26969
  task,
26567
26970
  forms: forms2,
@@ -26604,7 +27007,7 @@ function useCompanySearchTaskSubmit({
26604
27007
  });
26605
27008
  }
26606
27009
  } catch (e) {
26607
- logger$g.error(e);
27010
+ logger$h.error(e);
26608
27011
  userEvents.addEvent(CompanySearchEvents.DOCUMENTS_ERROR, {
26609
27012
  segmentation: {
26610
27013
  ...baseTrackingPayload,
@@ -26656,7 +27059,7 @@ function useCompanySearchTaskSubmit({
26656
27059
  ...trackingPayload
26657
27060
  }
26658
27061
  });
26659
- logger$g.log(submittedLegalEntity);
27062
+ logger$h.log(submittedLegalEntity);
26660
27063
  clearToasts();
26661
27064
  onExternalSubmit == null ? void 0 : onExternalSubmit(data);
26662
27065
  } catch (e) {
@@ -26680,7 +27083,7 @@ function useCompanySearchTaskSubmit({
26680
27083
  type: ToastType.ERROR
26681
27084
  });
26682
27085
  }
26683
- logger$g.error(e);
27086
+ logger$h.error(e);
26684
27087
  userEvents.addEvent(CompanySearchEvents.TASK_ERROR, {
26685
27088
  segmentation: {
26686
27089
  ...baseTrackingPayload,
@@ -26746,7 +27149,7 @@ function CompanySearchComponent(props) {
26746
27149
  }), jsx("div", {
26747
27150
  className: formWrapperClasses(forms.companyRegistrationAddress.formId),
26748
27151
  children: jsx(RegistrationAddressComponent, {
26749
- ...getFormProps(props, forms.companyRegistrationAddress.formId),
27152
+ ...getNestedOuterFormPropsFromOuterFormProps(props, forms.companyRegistrationAddress.formId),
26750
27153
  id: forms.companyRegistrationAddress.formId,
26751
27154
  heading: i18n.get(forms.companyRegistrationAddress.formName),
26752
27155
  description: i18n.get(forms.companyRegistrationAddress.formDescription, {
@@ -26907,7 +27310,7 @@ function CompanySearchDropinComponent({
26907
27310
  const {
26908
27311
  fieldConfigurations
26909
27312
  } = useScenarioConfiguration({
26910
- parseConfiguration: parseConfiguration$4,
27313
+ parseConfiguration: parseConfiguration$5,
26911
27314
  getConfigurationData,
26912
27315
  setLoadingStatus,
26913
27316
  country: country2
@@ -27033,7 +27436,7 @@ function CompanySearchDropinComponent({
27033
27436
  })
27034
27437
  });
27035
27438
  }
27036
- const logger$f = createLogger("useLocalStorage");
27439
+ const logger$g = createLogger("useLocalStorage");
27037
27440
  const useLocalStorage = (key, defaultValue, options) => {
27038
27441
  const {
27039
27442
  serializer,
@@ -27053,7 +27456,7 @@ const useLocalStorage = (key, defaultValue, options) => {
27053
27456
  const res = rawValueRef.current ? parser(rawValueRef.current) : defaultValue;
27054
27457
  return res;
27055
27458
  } catch (err) {
27056
- logger$f.error(err);
27459
+ logger$g.error(err);
27057
27460
  return defaultValue;
27058
27461
  }
27059
27462
  });
@@ -27084,7 +27487,7 @@ const useLocalStorage = (key, defaultValue, options) => {
27084
27487
  try {
27085
27488
  updateLocalStorage();
27086
27489
  } catch (err) {
27087
- logger$f.error(err);
27490
+ logger$g.error(err);
27088
27491
  }
27089
27492
  }, [value]);
27090
27493
  useEffect(() => {
@@ -27097,7 +27500,7 @@ const useLocalStorage = (key, defaultValue, options) => {
27097
27500
  setValue(event.newValue ? parser(event.newValue) : void 0);
27098
27501
  }
27099
27502
  } catch (err) {
27100
- logger$f.error(err);
27503
+ logger$g.error(err);
27101
27504
  }
27102
27505
  };
27103
27506
  if (typeof window === "undefined") return;
@@ -27134,15 +27537,25 @@ const useIsEligibleForSingpass = ({
27134
27537
  const {
27135
27538
  isExperimentEnabled
27136
27539
  } = useExperimentsContext();
27137
- if (!isExperimentEnabled("ShowSingPassButtonForCompanies")) return false;
27138
- const isSingpassEnabled = Boolean(handleOpenSingpassAuthorizationLink) && getLegalEntityCountry(legalEntity) === CountryCodes.Singapore;
27540
+ if (getLegalEntityCountry(legalEntity) !== CountryCodes.Singapore) {
27541
+ return false;
27542
+ }
27543
+ const isSingpassForCompaniesEnabled = isExperimentEnabled("ShowSingPassButtonForCompanies");
27544
+ const isSingpassForIndividualsEnabled = isExperimentEnabled("ShowSingPassButtonForIndividuals");
27545
+ if (!isSingpassForCompaniesEnabled && !isSingpassForIndividualsEnabled) return false;
27546
+ const isSingpassEnabled = Boolean(handleOpenSingpassAuthorizationLink);
27139
27547
  if (!isSingpassEnabled) return false;
27140
27548
  if (accountHolder2) {
27141
- return accountHolder2 === "theCompanyIWorkFor";
27549
+ return accountHolder2 === "theCompanyIWorkFor" && isSingpassForCompaniesEnabled || accountHolder2 === "myName" && isSingpassForIndividualsEnabled;
27142
27550
  }
27143
- return legalEntity.type === LegalEntityType.ORGANIZATION;
27551
+ const legalEntityType = legalEntity.type;
27552
+ const isPartOfTrust = isPartOfTrustFromLegalEntity(legalEntity);
27553
+ const isVanillaOrganization = legalEntityType === LegalEntityType.ORGANIZATION && !isPartOfTrust;
27554
+ const hasSoleProprietor = hasSolePropInLegalEntity(legalEntity);
27555
+ const isVanillaIndividual = legalEntityType === LegalEntityType.INDIVIDUAL && !hasSoleProprietor;
27556
+ return isVanillaOrganization && isSingpassForCompaniesEnabled || isVanillaIndividual && isSingpassForIndividualsEnabled;
27144
27557
  };
27145
- const logger$e = createLogger("useAssociatedLegalArrangement");
27558
+ const logger$f = createLogger("useAssociatedLegalArrangement");
27146
27559
  function useAssociatedLegalArrangement({
27147
27560
  rootLegalEntity,
27148
27561
  getLegalEntity: getLegalEntity2
@@ -27153,7 +27566,7 @@ function useAssociatedLegalArrangement({
27153
27566
  var _a;
27154
27567
  const foundEntity = (_a = rootLegalEntity == null ? void 0 : rootLegalEntity.entityAssociations) == null ? void 0 : _a.find((entity) => entity.type === LegalEntityType.SOLE_PROPRIETORSHIP || entity.type === LegalEntityType.TRUST);
27155
27568
  if (foundEntity == null ? void 0 : foundEntity.legalEntityId) {
27156
- getAssociatedEntity(foundEntity == null ? void 0 : foundEntity.legalEntityId).then((res) => setAssociatedLegalArrangement(res)).catch(logger$e.error);
27569
+ getAssociatedEntity(foundEntity == null ? void 0 : foundEntity.legalEntityId).then((res) => setAssociatedLegalArrangement(res)).catch(logger$f.error);
27157
27570
  }
27158
27571
  }, [getAssociatedEntity, rootLegalEntity == null ? void 0 : rootLegalEntity.entityAssociations]);
27159
27572
  useEffect(() => {
@@ -27167,7 +27580,15 @@ function useAssociatedLegalArrangement({
27167
27580
  refreshAssociatedLegalArrangement
27168
27581
  };
27169
27582
  }
27170
- const logger$d = createLogger("useExemptSettlor");
27583
+ const getCanSeeEntitySelectionStorageKey = (legalEntityId) => `ENTITY_SELECTION_SEEN-${legalEntityId}`;
27584
+ const useCanSeeEntitySelection = (legalEntityId) => {
27585
+ const [canSeeEntitySelectionFromLocalStorage, setCanSeeEntitySelectionIntoLocalStorage] = useLocalStorage(getCanSeeEntitySelectionStorageKey(legalEntityId), true);
27586
+ return {
27587
+ canSeeEntitySelection: canSeeEntitySelectionFromLocalStorage,
27588
+ setCanSeeEntitySelection: setCanSeeEntitySelectionIntoLocalStorage
27589
+ };
27590
+ };
27591
+ const logger$e = createLogger("useExemptSettlor");
27171
27592
  const useExemptSettlor = ({
27172
27593
  trust: trust2,
27173
27594
  handleGetLegalEntity
@@ -27180,7 +27601,7 @@ const useExemptSettlor = ({
27180
27601
  }, [handleGetLegalEntity]);
27181
27602
  useEffect(() => {
27182
27603
  if (!(trust2 == null ? void 0 : trust2.trust)) return;
27183
- updateExemptSettlor(trust2).catch(logger$d.error);
27604
+ updateExemptSettlor(trust2).catch(logger$e.error);
27184
27605
  }, [trust2, updateExemptSettlor]);
27185
27606
  return exemptSettlor;
27186
27607
  };
@@ -27540,55 +27961,6 @@ const useBusinessTypeExamples = (country2) => {
27540
27961
  }, [country2]);
27541
27962
  return examples;
27542
27963
  };
27543
- const headingTypes = {
27544
- 1: ({
27545
- children,
27546
- className
27547
- }) => jsx("h1", {
27548
- className,
27549
- children
27550
- }),
27551
- 2: ({
27552
- children,
27553
- className
27554
- }) => jsx("h2", {
27555
- className,
27556
- children
27557
- }),
27558
- 3: ({
27559
- children,
27560
- className
27561
- }) => jsx("h3", {
27562
- className,
27563
- children
27564
- }),
27565
- 4: ({
27566
- children,
27567
- className
27568
- }) => jsx("h4", {
27569
- className,
27570
- children
27571
- }),
27572
- sub: ({
27573
- children,
27574
- className
27575
- }) => jsx("div", {
27576
- className,
27577
- children
27578
- })
27579
- };
27580
- function Heading({
27581
- className,
27582
- level,
27583
- children
27584
- }) {
27585
- const HeadingElement = headingTypes[level] || headingTypes[1];
27586
- const classNames = cx("adyen-kyc-heading", `adyen-kyc-heading--${level}`, className);
27587
- return jsx(HeadingElement, {
27588
- className: classNames,
27589
- children
27590
- });
27591
- }
27592
27964
  const trusteeTypeItems = [{
27593
27965
  id: "individual",
27594
27966
  name: "individual"
@@ -28200,7 +28572,8 @@ function Card({
28200
28572
  level: "sub",
28201
28573
  children: subTitle
28202
28574
  })]
28203
- }), jsx("main", {
28575
+ }), jsx("div", {
28576
+ role: "region",
28204
28577
  className: "adyen-kyc-card__body",
28205
28578
  children
28206
28579
  }), warning && jsx(Alert, {
@@ -29172,33 +29545,57 @@ const SvgSingpassLogo = (props) => /* @__PURE__ */ jsxs$1("svg", { xmlns: "http:
29172
29545
  ] });
29173
29546
  const setupAccountMethods = ["singpass", "manual"];
29174
29547
  const setupAccountMethodFields = ["setupAccountMethod"];
29175
- const getSetupAccountMethodMetadata = () => ({
29176
- singpass: {
29177
- name: "retrieveMyInfoBusiness",
29178
- description: "getYourBusinessVerifiedDetails",
29179
- icon: jsx("span", {
29180
- className: "adyen-kyc-setup-singpass-container",
29181
- children: jsx(SvgSetupSingpass, {})
29182
- }),
29183
- provider: {
29184
- name: "singpass",
29548
+ const getSingpassSelectionDisabled = (legalEntityType) => {
29549
+ switch (legalEntityType) {
29550
+ case LegalEntityType.INDIVIDUAL:
29551
+ case LegalEntityType.ORGANIZATION:
29552
+ return false;
29553
+ default:
29554
+ return true;
29555
+ }
29556
+ };
29557
+ const legalEntityTypeToSelectionTranslationKeyMap = {
29558
+ [LegalEntityType.INDIVIDUAL]: "retrieveMyInfo",
29559
+ [LegalEntityType.ORGANIZATION]: "retrieveMyInfoBusiness"
29560
+ };
29561
+ const legalEntityTypeToSelectionDescriptionTranslationKeyMap = {
29562
+ [LegalEntityType.INDIVIDUAL]: "getYourVerifiedDetailsInstantly",
29563
+ [LegalEntityType.ORGANIZATION]: "getYourBusinessVerifiedDetails"
29564
+ };
29565
+ const getSetupAccountMethodMetadata = (legalEntityType) => {
29566
+ const translationSingpassNameKey = legalEntityTypeToSelectionTranslationKeyMap[legalEntityType] ?? "retrieveMyInfoBusiness";
29567
+ const translationSingpassDescriptionKey = legalEntityTypeToSelectionDescriptionTranslationKeyMap[legalEntityType] ?? "getYourBusinessVerifiedDetails";
29568
+ const isSingpassSelectionDisabled = getSingpassSelectionDisabled(legalEntityType);
29569
+ return {
29570
+ singpass: {
29571
+ name: translationSingpassNameKey,
29572
+ description: translationSingpassDescriptionKey,
29573
+ icon: jsx("span", {
29574
+ className: "adyen-kyc-setup-singpass-container",
29575
+ children: jsx(SvgSetupSingpass, {})
29576
+ }),
29577
+ provider: {
29578
+ name: "singpass",
29579
+ icon: jsx("span", {
29580
+ className: "adyen-kyc-singpass-logo-container",
29581
+ children: jsx(SvgSingpassLogo, {})
29582
+ })
29583
+ },
29584
+ isOptionDisabled: isSingpassSelectionDisabled
29585
+ },
29586
+ manual: {
29587
+ name: "enterTheDetailsYourself",
29588
+ description: "youAlsoHaveToUploadSomeSupportingDocuments",
29185
29589
  icon: jsx("span", {
29186
- className: "adyen-kyc-singpass-logo-container",
29187
- children: jsx(SvgSingpassLogo, {})
29590
+ className: "adyen-kyc-setup-manual-container",
29591
+ children: jsx(SvgSetupManual, {})
29188
29592
  })
29189
29593
  }
29190
- },
29191
- manual: {
29192
- name: "enterTheDetailsYourself",
29193
- description: "youAlsoHaveToUploadSomeSupportingDocuments",
29194
- icon: jsx("span", {
29195
- className: "adyen-kyc-setup-manual-container",
29196
- children: jsx(SvgSetupManual, {})
29197
- })
29198
- }
29199
- });
29594
+ };
29595
+ };
29200
29596
  const SingpassSelection = (props) => {
29201
29597
  const {
29598
+ legalEntityType,
29202
29599
  handleNextClick
29203
29600
  } = props;
29204
29601
  const {
@@ -29217,7 +29614,7 @@ const SingpassSelection = (props) => {
29217
29614
  schema: setupAccountMethodFields,
29218
29615
  defaultData: {}
29219
29616
  });
29220
- const methodsMetadata = getSetupAccountMethodMetadata();
29617
+ const methodsMetadata = getSetupAccountMethodMetadata(legalEntityType);
29221
29618
  return jsx("div", {
29222
29619
  children: jsxs("div", {
29223
29620
  className: "adyen-kyc-singpass-selection",
@@ -29309,10 +29706,21 @@ const hasPayoutAccount = (legalEntityResponse) => {
29309
29706
  var _a;
29310
29707
  return Boolean((_a = legalEntityResponse.transferInstruments) == null ? void 0 : _a.length);
29311
29708
  };
29709
+ const legalEntityTypeToSubtitleTranslationKey = {
29710
+ [LegalEntityType.INDIVIDUAL]: "myInfoYouCanGetVerifiedDetails",
29711
+ [LegalEntityType.ORGANIZATION]: "myInfoBusinessYouCanGetVerifiedDetails"
29712
+ };
29713
+ const legalEntityTypeToButtonTextTranslationKeyMap = {
29714
+ [LegalEntityType.INDIVIDUAL]: "retrieveMyinfoWith",
29715
+ [LegalEntityType.ORGANIZATION]: "retrieveMyinfoBusinessWith"
29716
+ };
29312
29717
  const SingpassBanner = (props) => {
29313
29718
  const {
29719
+ legalEntityType,
29314
29720
  onClick
29315
29721
  } = props;
29722
+ const subtitleTranslationKey = legalEntityTypeToSubtitleTranslationKey[legalEntityType];
29723
+ const buttonTextTranslationKey = legalEntityTypeToButtonTextTranslationKeyMap[legalEntityType];
29316
29724
  const {
29317
29725
  i18n
29318
29726
  } = useI18nContext();
@@ -29321,14 +29729,14 @@ const SingpassBanner = (props) => {
29321
29729
  hasCloseButton: false,
29322
29730
  icon: false,
29323
29731
  title: i18n.get("getSetUpInstantly"),
29324
- children: [jsx("div", {
29732
+ children: [subtitleTranslationKey && jsx("div", {
29325
29733
  className: cx("adyen-task-list-singpass-banner__subtitle"),
29326
- children: i18n.get("MyInfoBusinessYouCanGetVerifiedDetails")
29734
+ children: i18n.get(subtitleTranslationKey)
29327
29735
  }), jsxs("button", {
29328
29736
  type: "button",
29329
29737
  className: cx("adyen-kyc-button adyen-task-list-singpass-banner__button"),
29330
29738
  onClick,
29331
- children: [i18n.get("retrieveMyinfoBusinessWith"), jsx(SvgSingpassLogo, {})]
29739
+ children: [buttonTextTranslationKey && i18n.get(buttonTextTranslationKey), jsx(SvgSingpassLogo, {})]
29332
29740
  })]
29333
29741
  });
29334
29742
  };
@@ -29469,7 +29877,7 @@ const TaskListGroup = ({
29469
29877
  level: 4,
29470
29878
  children: title
29471
29879
  })
29472
- }), jsx("main", {
29880
+ }), jsx("div", {
29473
29881
  className: "adyen-kyc-card__body",
29474
29882
  children: jsx(CardGroup, {
29475
29883
  className: "adyen-task-list-group__items",
@@ -29611,7 +30019,8 @@ function TaskListComponent({
29611
30019
  })]
29612
30020
  })]
29613
30021
  }), onRetrieveMyinfoBusinessWithSingpass && jsx(SingpassBanner, {
29614
- onClick: onRetrieveMyinfoBusinessWithSingpass
30022
+ onClick: onRetrieveMyinfoBusinessWithSingpass,
30023
+ legalEntityType: legalEntityResponse.type
29615
30024
  }), hasExpired && jsx(ExpiredBanner, {}), jsxs("div", {
29616
30025
  children: [hasTaskOfGroupAccountDetails && jsxs(TaskListGroup, {
29617
30026
  title: isCompany ? i18n.get(companyTaskDescriptionKey) : i18n.get(isEnableNewEntryFlowEnabled ? "provideFewDetailsAboutYourself" : "accountDetailsDescription"),
@@ -30070,7 +30479,7 @@ const omitObscuredFieldsIfUnchanged = (obscuredFields, dataSubmitted, savedData)
30070
30479
  });
30071
30480
  return filtered;
30072
30481
  };
30073
- const parseConfiguration$3 = ({
30482
+ const parseConfiguration$4 = ({
30074
30483
  matchingScenario
30075
30484
  }) => parseIndividualScenarios(matchingScenario == null ? void 0 : matchingScenario[LegalEntityType.INDIVIDUAL]);
30076
30485
  function IndividualDropinComponent({
@@ -30102,6 +30511,10 @@ function IndividualDropinComponent({
30102
30511
  handleBackClick: externalBackClick
30103
30512
  }) {
30104
30513
  var _a, _b, _c, _d;
30514
+ const {
30515
+ accountHolder: accountHolder2,
30516
+ setAccountHolder
30517
+ } = useCoreContext();
30105
30518
  const {
30106
30519
  i18n
30107
30520
  } = useI18nContext();
@@ -30151,7 +30564,7 @@ function IndividualDropinComponent({
30151
30564
  const {
30152
30565
  fieldConfigurations
30153
30566
  } = useScenarioConfiguration({
30154
- parseConfiguration: parseConfiguration$3,
30567
+ parseConfiguration: parseConfiguration$4,
30155
30568
  getConfigurationData,
30156
30569
  setLoadingStatus,
30157
30570
  country: country2
@@ -30337,12 +30750,14 @@ function IndividualDropinComponent({
30337
30750
  idDocumentType: idDocumentType || null
30338
30751
  }
30339
30752
  });
30340
- legalEntity.entityAssociations = filterOutUnwantedAssociationsIfRootLE(taskType, legalEntityResponse, (_c2 = dataSubmitted.personalDetails) == null ? void 0 : _c2.accountHolder);
30753
+ const accountHolderToEvaluated = ((_c2 = dataSubmitted.personalDetails) == null ? void 0 : _c2.accountHolder) ?? accountHolder2;
30754
+ legalEntity.entityAssociations = filterOutUnwantedAssociationsIfRootLE(taskType, legalEntityResponse, accountHolderToEvaluated ?? void 0);
30341
30755
  const createdLegalEntity = await submitLegalEntity({
30342
30756
  dataSubmitted,
30343
30757
  legalEntity,
30344
30758
  idDocumentType
30345
30759
  });
30760
+ setAccountHolder(accountHolderToEvaluated);
30346
30761
  await submitDocuments2({
30347
30762
  forms: forms2,
30348
30763
  legalEntity: createdLegalEntity,
@@ -30466,7 +30881,7 @@ function IndividualDropinComponent({
30466
30881
  ...formatFileSummaryData2(data)
30467
30882
  };
30468
30883
  }
30469
- if ((_c2 = summaryData == null ? void 0 : summaryData.personalDetails) == null ? void 0 : _c2.accountHolder) {
30884
+ if ((_c2 = summaryData.personalDetails) == null ? void 0 : _c2.accountHolder) {
30470
30885
  summaryData.personalDetails.accountHolder = i18n.get(summaryData.personalDetails.accountHolder);
30471
30886
  }
30472
30887
  return summaryData;
@@ -30534,7 +30949,8 @@ function IndividualDropinComponent({
30534
30949
  handleFindAddress,
30535
30950
  onTypeSwitch,
30536
30951
  onCountryChange: setCountry,
30537
- shouldValidate
30952
+ shouldValidate,
30953
+ accountHolder: accountHolder2
30538
30954
  })
30539
30955
  });
30540
30956
  }
@@ -30637,7 +31053,7 @@ const labels = () => ({
30637
31053
  verifiedCurrencyCode: () => "currencyCode",
30638
31054
  verifiedBankAccountNumber: () => "bankAccountNumber"
30639
31055
  });
30640
- const parseConfiguration$2 = ({
31056
+ const parseConfiguration$3 = ({
30641
31057
  requiredFields,
30642
31058
  country: country2,
30643
31059
  bankVerificationAvailable
@@ -30777,7 +31193,7 @@ function PayoutDetailsDropinComponent({
30777
31193
  requiredFields,
30778
31194
  bankVerificationVendors
30779
31195
  } = useScenarioConfiguration({
30780
- parseConfiguration: parseConfiguration$2,
31196
+ parseConfiguration: parseConfiguration$3,
30781
31197
  getConfigurationData,
30782
31198
  getPayoutAccountFormatData,
30783
31199
  instantVerificationEnabled,
@@ -31938,7 +32354,7 @@ const serviceAgreementValidationRules = {
31938
32354
  errorMessage: "fieldIsRequired"
31939
32355
  }
31940
32356
  };
31941
- const logger$c = createLogger("useServiceAgreement");
32357
+ const logger$d = createLogger("useServiceAgreement");
31942
32358
  const FALLBACK_LANGUAGE_CODE = "en";
31943
32359
  const useServiceAgreement = ({
31944
32360
  handleGetServiceAgreement,
@@ -31971,7 +32387,7 @@ const useServiceAgreement = ({
31971
32387
  contract
31972
32388
  });
31973
32389
  };
31974
- requestAcceptedServiceAgreement().catch(logger$c.error).finally(() => setLoading("success"));
32390
+ requestAcceptedServiceAgreement().catch(logger$d.error).finally(() => setLoading("success"));
31975
32391
  }, [acceptanceId, handleViewAcceptedTermsOfServiceDocument]);
31976
32392
  useEffect(() => {
31977
32393
  const requestServiceAgreement = async () => {
@@ -31986,7 +32402,7 @@ const useServiceAgreement = ({
31986
32402
  language: agreementLanguage
31987
32403
  });
31988
32404
  if (!document2) {
31989
- logger$c.log('"document" field was missing in response');
32405
+ logger$d.log('"document" field was missing in response');
31990
32406
  return;
31991
32407
  }
31992
32408
  const contract = JSON.parse(decodeURIComponent(escape(window.atob(document2))));
@@ -32004,7 +32420,7 @@ const useServiceAgreement = ({
32004
32420
  throw err;
32005
32421
  }
32006
32422
  };
32007
- requestServiceAgreement().catch(logger$c.error);
32423
+ requestServiceAgreement().catch(logger$d.error);
32008
32424
  }, [handleGetServiceAgreement, handleServiceAgreementIsNotAvailableInThatLanguage, agreementLanguage, legalEntityId, serviceAgreementType]);
32009
32425
  return {
32010
32426
  loading: loading2,
@@ -32308,7 +32724,7 @@ function ServiceAgreementDropinComponent({
32308
32724
  })
32309
32725
  });
32310
32726
  }
32311
- const parseConfiguration$1 = ({
32727
+ const parseConfiguration$2 = ({
32312
32728
  matchingScenario,
32313
32729
  country: country2
32314
32730
  }) => parseSolePropScenarios(matchingScenario[LegalEntityType.SOLE_PROPRIETORSHIP], country2);
@@ -32410,7 +32826,7 @@ function SolePropDropinComponent({
32410
32826
  fieldConfigurations,
32411
32827
  requiredFields
32412
32828
  } = useScenarioConfiguration({
32413
- parseConfiguration: parseConfiguration$1,
32829
+ parseConfiguration: parseConfiguration$2,
32414
32830
  getConfigurationData,
32415
32831
  setLoadingStatus,
32416
32832
  country: country2
@@ -32547,18 +32963,18 @@ function SolePropDropinComponent({
32547
32963
  if (isCountryOfGoverningLawEnabled) {
32548
32964
  summaryData.solePropNameAndCountry = getUpdatedCountryOfGoverningLaw(summaryData.solePropNameAndCountry);
32549
32965
  }
32550
- const solePropCountry = ((_a2 = summaryData == null ? void 0 : summaryData.solePropNameAndCountry) == null ? void 0 : _a2.country) ? datasetUtils.getCountryName(summaryData.solePropNameAndCountry.country) : void 0;
32966
+ const solePropCountry = ((_a2 = summaryData.solePropNameAndCountry) == null ? void 0 : _a2.country) && datasetUtils.getCountryName(summaryData.solePropNameAndCountry.country);
32551
32967
  summaryData.solePropNameAndCountry = {
32552
32968
  legalNameOfSoleProprietor: (_b2 = data2.solePropNameAndCountry) == null ? void 0 : _b2.legalCompanyName,
32553
32969
  countryRegionOfEstablishment: solePropCountry,
32554
- countryOfGoverningLaw: ((_c = summaryData == null ? void 0 : summaryData.solePropNameAndCountry) == null ? void 0 : _c.countryOfGoverningLaw) ? datasetUtils.getCountryName(summaryData.solePropNameAndCountry.countryOfGoverningLaw) : void 0
32970
+ countryOfGoverningLaw: ((_c = summaryData.solePropNameAndCountry) == null ? void 0 : _c.countryOfGoverningLaw) && datasetUtils.getCountryName(summaryData.solePropNameAndCountry.countryOfGoverningLaw)
32555
32971
  };
32556
- if ((_d = summaryData == null ? void 0 : summaryData.solePropRegistrationAddress) == null ? void 0 : _d.registrationAddress) {
32972
+ if ((_d = summaryData.solePropRegistrationAddress) == null ? void 0 : _d.registrationAddress) {
32557
32973
  summaryData.solePropRegistrationAddress.hasInnerForms = true;
32558
- summaryData.solePropRegistrationAddress.registrationAddress = mapAddressLabels(summaryData == null ? void 0 : summaryData.solePropRegistrationAddress.registrationAddress, datasetUtils);
32974
+ summaryData.solePropRegistrationAddress.registrationAddress = mapAddressLabels(summaryData.solePropRegistrationAddress.registrationAddress, datasetUtils);
32559
32975
  }
32560
- if ((_e = summaryData == null ? void 0 : summaryData.solePropRegistrationAddress) == null ? void 0 : _e.operationalAddress) {
32561
- summaryData.solePropRegistrationAddress.operationalAddress = mapAddressLabels(summaryData == null ? void 0 : summaryData.solePropRegistrationAddress.operationalAddress, datasetUtils);
32976
+ if ((_e = summaryData.solePropRegistrationAddress) == null ? void 0 : _e.operationalAddress) {
32977
+ summaryData.solePropRegistrationAddress.operationalAddress = mapAddressLabels(summaryData.solePropRegistrationAddress.operationalAddress, datasetUtils);
32562
32978
  }
32563
32979
  if (isDocumentsRequired(forms22)) {
32564
32980
  delete summaryData[solePropDocumentFormId];
@@ -32641,7 +33057,7 @@ const rules = ({
32641
33057
  }
32642
33058
  }
32643
33059
  });
32644
- const parseConfiguration = ({
33060
+ const parseConfiguration$1 = ({
32645
33061
  matchingScenario,
32646
33062
  country: country2
32647
33063
  }) => parseTrustScenarios(matchingScenario == null ? void 0 : matchingScenario[LegalEntityType.TRUST], country2);
@@ -32695,7 +33111,7 @@ function TrustDropinComponent({
32695
33111
  fieldConfigurations,
32696
33112
  requiredFields
32697
33113
  } = useScenarioConfiguration({
32698
- parseConfiguration,
33114
+ parseConfiguration: parseConfiguration$1,
32699
33115
  getConfigurationData,
32700
33116
  setLoadingStatus,
32701
33117
  country: country2
@@ -32826,34 +33242,31 @@ function TrustDropinComponent({
32826
33242
  await handleUpdateLegalEntity(updatedParentLegalEntity, parentLegalEntity.id);
32827
33243
  };
32828
33244
  const formatDataForSummary2 = (data2, forms22) => {
32829
- var _a2, _b, _c, _d, _e, _f, _g, _h;
33245
+ var _a2, _b, _c;
32830
33246
  let summaryData = cloneObject(data2) || {};
32831
- if (summaryData == null ? void 0 : summaryData.trustRegistrationDetails) {
32832
- const trustCountry = ((_a2 = summaryData == null ? void 0 : summaryData.trustRegistrationDetails) == null ? void 0 : _a2.country) ? datasetUtils.getCountryName(summaryData.trustRegistrationDetails.country) : void 0;
32833
- const trustType2 = ((_b = summaryData == null ? void 0 : summaryData.trustRegistrationDetails) == null ? void 0 : _b.trustType) ? i18n.get((_c = trustTypeOptions.find((trustType22) => {
32834
- var _a3;
32835
- return trustType22.id === ((_a3 = summaryData.trustRegistrationDetails) == null ? void 0 : _a3.trustType);
32836
- })) == null ? void 0 : _c.name) : void 0;
33247
+ if (summaryData.trustRegistrationDetails) {
33248
+ const trustCountry = summaryData.trustRegistrationDetails.country && datasetUtils.getCountryName(summaryData.trustRegistrationDetails.country);
33249
+ const trustType2 = summaryData.trustRegistrationDetails.trustType && i18n.get((_a2 = trustTypeOptions.find((option) => option.id === summaryData.trustRegistrationDetails.trustType)) == null ? void 0 : _a2.name);
32837
33250
  summaryData.trustRegistrationDetails = {
32838
- nameOfTrustAgreement: (_d = summaryData == null ? void 0 : summaryData.trustRegistrationDetails) == null ? void 0 : _d.legalName,
33251
+ nameOfTrustAgreement: summaryData.trustRegistrationDetails.legalName,
32839
33252
  countryRegionOfEstablishment: trustCountry,
32840
33253
  typeOfTrustAgreement: trustType2,
32841
- objectOfTrust: (_e = summaryData == null ? void 0 : summaryData.trustRegistrationDetails) == null ? void 0 : _e.objectOfTrust,
32842
- taxId: (_f = summaryData == null ? void 0 : summaryData.trustRegistrationDetails) == null ? void 0 : _f.taxId
33254
+ objectOfTrust: summaryData.trustRegistrationDetails.objectOfTrust,
33255
+ taxId: summaryData.trustRegistrationDetails.taxId
32843
33256
  };
32844
33257
  }
32845
- if ((_g = summaryData == null ? void 0 : summaryData.trustRegistrationAddress) == null ? void 0 : _g.registrationAddress) {
33258
+ if ((_b = summaryData.trustRegistrationAddress) == null ? void 0 : _b.registrationAddress) {
32846
33259
  summaryData.trustRegistrationAddress.hasInnerForms = true;
32847
- summaryData.trustRegistrationAddress.registrationAddress = mapAddressLabels(summaryData == null ? void 0 : summaryData.trustRegistrationAddress.registrationAddress, datasetUtils);
33260
+ summaryData.trustRegistrationAddress.registrationAddress = mapAddressLabels(summaryData.trustRegistrationAddress.registrationAddress, datasetUtils);
32848
33261
  }
32849
- if ((_h = summaryData == null ? void 0 : summaryData.trustRegistrationAddress) == null ? void 0 : _h.operationalAddress) {
32850
- summaryData.trustRegistrationAddress.operationalAddress = mapAddressLabels(summaryData == null ? void 0 : summaryData.trustRegistrationAddress.operationalAddress, datasetUtils);
33262
+ if ((_c = summaryData.trustRegistrationAddress) == null ? void 0 : _c.operationalAddress) {
33263
+ summaryData.trustRegistrationAddress.operationalAddress = mapAddressLabels(summaryData.trustRegistrationAddress.operationalAddress, datasetUtils);
32851
33264
  }
32852
33265
  if (isDocumentsRequired2(forms22)) {
32853
33266
  delete summaryData[trustConstitutionalDocumentFormId];
32854
33267
  summaryData = {
32855
33268
  ...summaryData,
32856
- ...formatFileSummaryData2(summaryData == null ? void 0 : summaryData.trustConstitutionalDocument)
33269
+ ...formatFileSummaryData2(summaryData.trustConstitutionalDocument)
32857
33270
  };
32858
33271
  }
32859
33272
  return summaryData;
@@ -32959,6 +33372,9 @@ const useNavigation = ({
32959
33372
  const {
32960
33373
  accountHolder: accountHolder2
32961
33374
  } = useCoreContext();
33375
+ const {
33376
+ canSeeEntitySelection
33377
+ } = useCanSeeEntitySelection(legalEntity.id);
32962
33378
  const eligibleForSingpass = useIsEligibleForSingpass({
32963
33379
  legalEntity,
32964
33380
  accountHolder: accountHolder2,
@@ -32995,7 +33411,7 @@ const useNavigation = ({
32995
33411
  if (pushedTask === "default") {
32996
33412
  const defaultTask = getDefaultTask({
32997
33413
  legalEntity,
32998
- accountHolder: accountHolder2,
33414
+ canSeeEntitySelection,
32999
33415
  showIntroduction,
33000
33416
  isNewEntryFlowEnabled,
33001
33417
  shouldShowSingpassSelection
@@ -33012,13 +33428,13 @@ const useNavigation = ({
33012
33428
  };
33013
33429
  const getDefaultTask = ({
33014
33430
  legalEntity,
33015
- accountHolder: accountHolder2,
33431
+ canSeeEntitySelection,
33016
33432
  isNewEntryFlowEnabled,
33017
33433
  showIntroduction,
33018
33434
  shouldShowSingpassSelection
33019
33435
  }) => {
33020
33436
  const hasLegalEntityProgressedBeyondEntitySelection = hasProgressedBeyondEntitySelection(legalEntity);
33021
- if (isNewEntryFlowEnabled && !accountHolder2 && !hasLegalEntityProgressedBeyondEntitySelection) return TaskTypes.BUSINESS_TYPE_SELECTION;
33437
+ if (isNewEntryFlowEnabled && canSeeEntitySelection && !hasLegalEntityProgressedBeyondEntitySelection) return TaskTypes.BUSINESS_TYPE_SELECTION;
33022
33438
  if (showIntroduction) return TaskTypes.INTRODUCTION;
33023
33439
  if (shouldShowSingpassSelection) return TaskTypes.SINGPASS_SELECTION;
33024
33440
  return TaskTypes.TASKS_OVERVIEW;
@@ -33031,7 +33447,7 @@ const hasProgressedBeyondEntitySelection = (legalEntity) => {
33031
33447
  };
33032
33448
  const PAGES_WITH_POLLING = [TaskTypes.DECISION_MAKER_OVERVIEW, TaskTypes.TASKS_OVERVIEW];
33033
33449
  const POLLING_INTERVAL = 3e3;
33034
- const logger$b = createLogger("DropinComposerComponent");
33450
+ const logger$c = createLogger("DropinComposerComponent");
33035
33451
  const isOrganizationSettlorWithExemptionReasonEnabled = (enabled, country2) => country2 === CountryCodes.Australia && enabled;
33036
33452
  function DropinComposerComponent({
33037
33453
  capabilities,
@@ -33048,6 +33464,9 @@ function DropinComposerComponent({
33048
33464
  accountHolder: accountHolder2,
33049
33465
  setAccountHolder
33050
33466
  } = useCoreContext();
33467
+ const {
33468
+ setCanSeeEntitySelection
33469
+ } = useCanSeeEntitySelection(legalEntityResponse.id);
33051
33470
  const {
33052
33471
  i18n
33053
33472
  } = useI18nContext();
@@ -33074,13 +33493,13 @@ function DropinComposerComponent({
33074
33493
  } = useHasSeenIntroduction({
33075
33494
  legalEntityId: legalEntityResponse.id
33076
33495
  });
33496
+ const [tasks, setTasks] = useState([]);
33497
+ const [rootLegalEntity, setRootLegalEntity] = useState(legalEntityResponse);
33077
33498
  const eligibleForSingpass = useIsEligibleForSingpass({
33078
- legalEntity: legalEntityResponse,
33499
+ legalEntity: rootLegalEntity,
33079
33500
  accountHolder: accountHolder2,
33080
33501
  handleOpenSingpassAuthorizationLink
33081
33502
  });
33082
- const [tasks, setTasks] = useState([]);
33083
- const [rootLegalEntity, setRootLegalEntity] = useState(legalEntityResponse);
33084
33503
  const rootLegalEntityCountry = getLegalEntityCountry(rootLegalEntity);
33085
33504
  const [associatedLegalEntity, setAssociatedLegalEntity] = useState(null);
33086
33505
  const {
@@ -33139,7 +33558,7 @@ function DropinComposerComponent({
33139
33558
  setPciStatus(response);
33140
33559
  return response;
33141
33560
  } catch (e) {
33142
- logger$b.warn(i18n.get("failedToGetPciStatus"));
33561
+ logger$c.warn(i18n.get("failedToGetPciStatus"));
33143
33562
  }
33144
33563
  }
33145
33564
  return void 0;
@@ -33167,7 +33586,7 @@ function DropinComposerComponent({
33167
33586
  }, [additionalSalesChannels, i18n, rootLegalEntity.id, args.handleGetPciTemplate]);
33168
33587
  useEffect(() => {
33169
33588
  if (!tasks.includes(TaskTypes.PCI_DSS)) return;
33170
- getPciTemplate2().catch(logger$b.error);
33589
+ getPciTemplate2().catch(logger$c.error);
33171
33590
  }, [getPciTemplate2, tasks]);
33172
33591
  const addFetchedAcceptedByName = async (acceptanceInfo) => {
33173
33592
  try {
@@ -33177,21 +33596,21 @@ function DropinComposerComponent({
33177
33596
  acceptedByName: getLegalEntityNameBasedOnType(acceptedByEntity)
33178
33597
  };
33179
33598
  } catch (e) {
33180
- logger$b.warn(i18n.get("failedToFetchAcceptedByName"));
33599
+ logger$c.warn(i18n.get("failedToFetchAcceptedByName"));
33181
33600
  return {
33182
33601
  ...acceptanceInfo,
33183
33602
  acceptedByName: null
33184
33603
  };
33185
33604
  }
33186
33605
  };
33187
- const getServiceAgreementAcceptanceInfos = async () => {
33606
+ const getServiceAgreementAcceptanceInfos2 = async () => {
33188
33607
  if (rootLegalEntity.id && (args == null ? void 0 : args.handleGetServiceAgreementAcceptanceInfos)) {
33189
33608
  try {
33190
33609
  const response = await args.handleGetServiceAgreementAcceptanceInfos(rootLegalEntity.id);
33191
33610
  const serviceAgreementAcceptanceInfosWithNames2 = await Promise.all(response.data.map(addFetchedAcceptedByName));
33192
33611
  setServiceAgreementAcceptanceInfosWithNames(serviceAgreementAcceptanceInfosWithNames2);
33193
33612
  } catch (e) {
33194
- logger$b.warn(i18n.get("failedToGetServiceAgreementStatus"));
33613
+ logger$c.warn(i18n.get("failedToGetServiceAgreementStatus"));
33195
33614
  }
33196
33615
  }
33197
33616
  };
@@ -33201,7 +33620,7 @@ function DropinComposerComponent({
33201
33620
  const response = await args.handleGetServiceAgreementStatus(rootLegalEntity.id);
33202
33621
  setServiceAgreementTypes(response.termsOfServiceTypes);
33203
33622
  } catch (e) {
33204
- logger$b.warn(i18n.get("failedToGetServiceAgreementStatus"));
33623
+ logger$c.warn(i18n.get("failedToGetServiceAgreementStatus"));
33205
33624
  }
33206
33625
  }
33207
33626
  };
@@ -33240,7 +33659,7 @@ function DropinComposerComponent({
33240
33659
  setCapabilityProblems(getCapabilityProblems(response, rootLegalEntityCountry, isExperimentEnabled));
33241
33660
  return response;
33242
33661
  } catch (e) {
33243
- logger$b.warn(i18n.get("failedToFetchLegalEntityDetails"));
33662
+ logger$c.warn(i18n.get("failedToFetchLegalEntityDetails"));
33244
33663
  }
33245
33664
  }
33246
33665
  return void 0;
@@ -33290,7 +33709,7 @@ function DropinComposerComponent({
33290
33709
  label: i18n.get("successFullyRemovedTrustMember")
33291
33710
  });
33292
33711
  } catch (err) {
33293
- logger$b.error(`Failed to delete trust member`, err);
33712
+ logger$c.error(`Failed to delete trust member`, err);
33294
33713
  showToast({
33295
33714
  type: ToastType.ERROR,
33296
33715
  label: i18n.get("failedToRemoveTrustMember")
@@ -33360,7 +33779,7 @@ function DropinComposerComponent({
33360
33779
  }
33361
33780
  break;
33362
33781
  default:
33363
- logger$b.warn(`Updating trust member type "${trustMember.trustMemberType}" is not implemented.`);
33782
+ logger$c.warn(`Updating trust member type "${trustMember.trustMemberType}" is not implemented.`);
33364
33783
  }
33365
33784
  showToast({
33366
33785
  label: i18n.get("successfullyUpdatedDetails"),
@@ -33368,7 +33787,7 @@ function DropinComposerComponent({
33368
33787
  });
33369
33788
  await refreshLegalArrangementAndRunOnSubmit(associatedLegalArrangement, 1);
33370
33789
  } catch (err) {
33371
- logger$b.error(err);
33790
+ logger$c.error(err);
33372
33791
  showToast({
33373
33792
  label: i18n.get("failedToUpdateDetails"),
33374
33793
  type: ToastType.ERROR
@@ -33389,7 +33808,7 @@ function DropinComposerComponent({
33389
33808
  navigateTo(TaskTypes.TASKS_OVERVIEW);
33390
33809
  }
33391
33810
  } catch (e) {
33392
- logger$b.error(e);
33811
+ logger$c.error(e);
33393
33812
  showToast({
33394
33813
  label: i18n.get("failToLaunchSingpass"),
33395
33814
  type: ToastType.ERROR
@@ -33592,11 +34011,11 @@ function DropinComposerComponent({
33592
34011
  await getPciStatus2();
33593
34012
  }
33594
34013
  await getServiceAgreementStatus2();
33595
- await getServiceAgreementAcceptanceInfos();
34014
+ await getServiceAgreementAcceptanceInfos2();
33596
34015
  }
33597
34016
  };
33598
34017
  setIsLoadingConfiguration(true);
33599
- fetchConfiguration().catch(logger$b.error).finally(() => {
34018
+ fetchConfiguration().catch(logger$c.error).finally(() => {
33600
34019
  setIsLoadingConfiguration(false);
33601
34020
  onLoad();
33602
34021
  });
@@ -33614,12 +34033,16 @@ function DropinComposerComponent({
33614
34033
  return;
33615
34034
  }
33616
34035
  const timeoutId = setTimeout(() => {
33617
- refreshLegalEntity().catch(logger$b.error);
34036
+ refreshLegalEntity().catch(logger$c.error);
33618
34037
  }, POLLING_INTERVAL);
33619
34038
  return () => {
33620
34039
  clearInterval(timeoutId);
33621
34040
  };
33622
34041
  }, [refreshLegalEntity, rootLegalEntity]);
34042
+ useEffect(() => {
34043
+ const newAccountHolder = getDefaultAccountHolderType(rootLegalEntity, false, accountHolder2);
34044
+ if (newAccountHolder !== accountHolder2) setAccountHolder(newAccountHolder);
34045
+ }, [accountHolder2, rootLegalEntity]);
33623
34046
  if (isLoadingConfiguration) {
33624
34047
  return jsx(Shimmer, {});
33625
34048
  }
@@ -33633,6 +34056,7 @@ function DropinComposerComponent({
33633
34056
  accountHolder: accountHolder2,
33634
34057
  onComplete: async (newAccountHolder) => {
33635
34058
  setAccountHolder(newAccountHolder);
34059
+ setCanSeeEntitySelection(false);
33636
34060
  await refreshLegalEntity();
33637
34061
  navigateTo("default");
33638
34062
  },
@@ -33644,7 +34068,9 @@ function DropinComposerComponent({
33644
34068
  });
33645
34069
  case TaskTypes.SINGPASS_SELECTION:
33646
34070
  return jsx(SingpassSelection, {
33647
- handleNextClick: handleSingpassSelectionNextClick
34071
+ handleNextClick: handleSingpassSelectionNextClick,
34072
+ accountHolder: accountHolder2,
34073
+ legalEntityType: rootLegalEntity.type
33648
34074
  });
33649
34075
  case TaskTypes.INTRODUCTION:
33650
34076
  return jsx(Introduction, {
@@ -33826,8 +34252,7 @@ function DropinComposerComponent({
33826
34252
  handleAddressSearch: args == null ? void 0 : args.handleAddressSearch,
33827
34253
  handleFindAddress: args == null ? void 0 : args.handleFindAddress,
33828
34254
  onTypeSwitch: navigateToTypeSwitcher,
33829
- isTargetLegalEntityType: legalEntityType === LegalEntityType.ORGANIZATION,
33830
- accountHolder: accountHolder2
34255
+ isTargetLegalEntityType: legalEntityType === LegalEntityType.ORGANIZATION
33831
34256
  });
33832
34257
  case TaskTypes.COMPANY_SEARCH:
33833
34258
  return jsx(CompanySearchDropinComponent, {
@@ -33920,8 +34345,7 @@ function DropinComposerComponent({
33920
34345
  homeButtonLabel: i18n.get("saveAndGoToOverview"),
33921
34346
  associationDetail: trustMember,
33922
34347
  handleAddressSearch: args == null ? void 0 : args.handleAddressSearch,
33923
- handleFindAddress: args == null ? void 0 : args.handleFindAddress,
33924
- accountHolder: accountHolder2
34348
+ handleFindAddress: args == null ? void 0 : args.handleFindAddress
33925
34349
  });
33926
34350
  case TaskTypes.PAYOUT:
33927
34351
  case TaskTypes.PAYIN:
@@ -34040,7 +34464,7 @@ function DropinComposerComponent({
34040
34464
  handleSign: async (...params) => {
34041
34465
  await args.handleSignServiceAgreement(...params);
34042
34466
  await getServiceAgreementStatus2();
34043
- await getServiceAgreementAcceptanceInfos();
34467
+ await getServiceAgreementAcceptanceInfos2();
34044
34468
  }
34045
34469
  });
34046
34470
  case TaskTypes.LEGAL_ENTITY_TYPE_SWITCHER:
@@ -34083,7 +34507,7 @@ const createLegalEntity = async (context, legalEntity) => {
34083
34507
  return httpPost({
34084
34508
  loadingContext,
34085
34509
  errorLevel: "warn",
34086
- errorMessage: `LegalEntity creation available`,
34510
+ errorMessage: "LegalEntity create failed",
34087
34511
  path: `${legalEntityId}`,
34088
34512
  authentication: "jwt",
34089
34513
  headers: {
@@ -34412,7 +34836,7 @@ const getIdverificationToken = async (context, request) => {
34412
34836
  loadingContext,
34413
34837
  errorLevel: "warn",
34414
34838
  errorMessage: `Failed to find address`,
34415
- path: `${legalEntityId}/providers/IdVerification/initiate`,
34839
+ path: `${legalEntityId}/providers/idVerification/initiate`,
34416
34840
  authentication: "jwt",
34417
34841
  headers: {
34418
34842
  "Content-Type": "application/json"
@@ -34499,7 +34923,7 @@ const getServiceAgreement = async (context, data) => {
34499
34923
  }
34500
34924
  }, data);
34501
34925
  };
34502
- const getServiceAgreementAcceptanceInfo = async (context) => {
34926
+ const getServiceAgreementAcceptanceInfos = async (context) => {
34503
34927
  const {
34504
34928
  loadingContext,
34505
34929
  legalEntityId
@@ -34508,7 +34932,7 @@ const getServiceAgreementAcceptanceInfo = async (context) => {
34508
34932
  loadingContext,
34509
34933
  errorLevel: "warn",
34510
34934
  errorMessage: `Failed to get service agreement acceptance info`,
34511
- path: `${legalEntityId}/termsOfService/termsOfServiceAcceptanceInfo`,
34935
+ path: `${legalEntityId}/termsOfService/termsOfServiceAcceptanceInfos`,
34512
34936
  authentication: "jwt",
34513
34937
  headers: {
34514
34938
  "Content-Type": "application/json"
@@ -34562,7 +34986,7 @@ const idVerificationStartcheck = async (context, request) => {
34562
34986
  loadingContext,
34563
34987
  errorLevel: "warn",
34564
34988
  errorMessage: `Failed to find address`,
34565
- path: `${legalEntityId}/providers/IdVerification/process`,
34989
+ path: `${legalEntityId}/providers/idVerification/process`,
34566
34990
  authentication: "jwt",
34567
34991
  headers: {
34568
34992
  "Content-Type": "application/json"
@@ -34626,10 +35050,7 @@ const useComponentApi = (rootLegalEntityId) => {
34626
35050
  ...baseRequestContext,
34627
35051
  legalEntityId
34628
35052
  }, legalEntity),
34629
- createLegalEntity: async (legalEntity) => createLegalEntity({
34630
- ...baseRequestContext,
34631
- legalEntityId: rootLegalEntityId
34632
- }, legalEntity),
35053
+ createLegalEntity: async (legalEntity) => createLegalEntity(baseRequestContext, legalEntity),
34633
35054
  getTransferInstrument: async (transferInstrumentId) => getTransferInstrument(baseRequestContext, transferInstrumentId),
34634
35055
  getBankVerificationVendor: async (country2, openBankingPartnerConfigId) => getBankVerificationVendor(baseRequestContext, country2, openBankingPartnerConfigId),
34635
35056
  getDocument: async (documentId) => getDocument(baseRequestContext, documentId),
@@ -34667,7 +35088,7 @@ const useComponentApi = (rootLegalEntityId) => {
34667
35088
  ...baseRequestContext,
34668
35089
  legalEntityId
34669
35090
  }, pciReference),
34670
- getServiceAgreementAcceptanceInfos: async (legalEntityId) => getServiceAgreementAcceptanceInfo({
35091
+ getServiceAgreementAcceptanceInfos: async (legalEntityId) => getServiceAgreementAcceptanceInfos({
34671
35092
  ...baseRequestContext,
34672
35093
  legalEntityId
34673
35094
  }),
@@ -34686,7 +35107,7 @@ const useComponentApi = (rootLegalEntityId) => {
34686
35107
  };
34687
35108
  }, [base, rootLegalEntityId]);
34688
35109
  };
34689
- const logger$a = createLogger("CreateIndividualComponent");
35110
+ const logger$b = createLogger("CreateIndividualComponent");
34690
35111
  function CreateIndividualComponent({
34691
35112
  parentLegalEntityId,
34692
35113
  legalEntityId,
@@ -34722,13 +35143,13 @@ function CreateIndividualComponent({
34722
35143
  setParentLegalEntity(parentEntity);
34723
35144
  setLegalEntity(entity);
34724
35145
  } catch (error) {
34725
- logger$a.error(error);
35146
+ logger$b.error(error);
34726
35147
  } finally {
34727
35148
  setLoadingStatus("success");
34728
35149
  }
34729
35150
  }, [parentLegalEntityId, legalEntityId, getLegalEntity2]);
34730
35151
  useEffect(() => {
34731
- fetchLegalEntity().catch(logger$a.error);
35152
+ fetchLegalEntity().catch(logger$b.error);
34732
35153
  }, [fetchLegalEntity]);
34733
35154
  const country2 = ((_a = legalEntity == null ? void 0 : legalEntity.individual) == null ? void 0 : _a.residentialAddress.country) ?? contextCountry;
34734
35155
  return loadingStatus === "loading" ? jsx(Loader, {
@@ -34752,7 +35173,7 @@ function CreateIndividualComponent({
34752
35173
  taskType
34753
35174
  });
34754
35175
  }
34755
- const logger$9 = createLogger("CreateTransferInstrumentComponent");
35176
+ const logger$a = createLogger("CreateTransferInstrumentComponent");
34756
35177
  function CreateTransferInstrumentComponent({
34757
35178
  legalEntityId,
34758
35179
  transferInstrumentId,
@@ -34794,7 +35215,7 @@ function CreateTransferInstrumentComponent({
34794
35215
  const ti = await getTransferInstrument2(transferInstrumentId);
34795
35216
  setTransferInstrument(ti);
34796
35217
  }
34797
- })().catch(logger$9.error).finally(() => {
35218
+ })().catch(logger$a.error).finally(() => {
34798
35219
  setLoadingStatus("success");
34799
35220
  });
34800
35221
  }, [transferInstrumentId, fetchLegalEntity, getTransferInstrument2]);
@@ -34993,7 +35414,7 @@ function ManageTransferInstrumentOverviewItem({
34993
35414
  })
34994
35415
  }, transferInstrumentReference.transferInstrument.id);
34995
35416
  }
34996
- const logger$8 = createLogger("ManageTransferInstrumentOverview");
35417
+ const logger$9 = createLogger("ManageTransferInstrumentOverview");
34997
35418
  function ManageTransferInstrumentOverview({
34998
35419
  transferInstrumentReferences,
34999
35420
  onAdd,
@@ -35018,7 +35439,7 @@ function ManageTransferInstrumentOverview({
35018
35439
  ...transferInstrumentsMap
35019
35440
  });
35020
35441
  } catch (e) {
35021
- logger$8.error(e);
35442
+ logger$9.error(e);
35022
35443
  }
35023
35444
  };
35024
35445
  const onRemoveTransferinstrument = async (transferInstrumentId) => {
@@ -35026,7 +35447,7 @@ function ManageTransferInstrumentOverview({
35026
35447
  await deleteTransferInstrument2(transferInstrumentId);
35027
35448
  onRemove(transferInstrumentId);
35028
35449
  } catch (e) {
35029
- logger$8.error(e);
35450
+ logger$9.error(e);
35030
35451
  }
35031
35452
  };
35032
35453
  const transferInstrumentListEle = transferInstrumentReferences.map((transferInstrumentRef) => jsx(ManageTransferInstrumentOverviewItem, {
@@ -35051,7 +35472,7 @@ function ManageTransferInstrumentOverview({
35051
35472
  })]
35052
35473
  });
35053
35474
  }
35054
- const logger$7 = createLogger("ManageTransferInstrumentComponent");
35475
+ const logger$8 = createLogger("ManageTransferInstrumentComponent");
35055
35476
  function ManageTransferInstrumentComponent({
35056
35477
  legalEntityId,
35057
35478
  onAdd,
@@ -35087,7 +35508,7 @@ function ManageTransferInstrumentComponent({
35087
35508
  }, [getTransferInstruments2, getLegalEntity2, i18n, legalEntityId]);
35088
35509
  useEffect(() => {
35089
35510
  eventEmitter == null ? void 0 : eventEmitter.on("updateLocale", (locale) => setLocale(locale));
35090
- init2().catch(logger$7.error).finally(() => {
35511
+ init2().catch(logger$8.error).finally(() => {
35091
35512
  setLoadingStatus("success");
35092
35513
  });
35093
35514
  }, [init2, setLocale, eventEmitter]);
@@ -35097,7 +35518,7 @@ function ManageTransferInstrumentComponent({
35097
35518
  }
35098
35519
  }, [hasOnlyVerifiedTransferInstruments, timeoutId, transferInstruments]);
35099
35520
  const onRemove = (transferInstrumentId) => {
35100
- refreshTransferInstruments().catch(logger$7.error);
35521
+ refreshTransferInstruments().catch(logger$8.error);
35101
35522
  onRemoveSuccess == null ? void 0 : onRemoveSuccess(transferInstrumentId, legalEntityId);
35102
35523
  };
35103
35524
  const render2 = () => {
@@ -35125,9 +35546,10 @@ function ManageTransferInstrumentComponent({
35125
35546
  children: render2()
35126
35547
  });
35127
35548
  }
35128
- const logger$6 = createLogger("CreateIndividualComponent");
35549
+ const logger$7 = createLogger("CreateIndividualComponent");
35129
35550
  function OnboardingDropinComponent({
35130
- legalEntityId
35551
+ legalEntityId,
35552
+ openBankingPartnerConfigId
35131
35553
  }) {
35132
35554
  if (!legalEntityId) {
35133
35555
  throw new Error("Must provide at-least legalEntityId");
@@ -35153,10 +35575,11 @@ function OnboardingDropinComponent({
35153
35575
  signPci: signPci2,
35154
35576
  getPciQuestionnaires: getPciQuestionnaires2,
35155
35577
  downloadPci: downloadPci2,
35156
- getServiceAgreementAcceptanceInfos,
35578
+ getServiceAgreementAcceptanceInfos: getServiceAgreementAcceptanceInfos2,
35157
35579
  getServiceAgreementStatus: getServiceAgreementStatus2,
35158
35580
  getServiceAgreement: getServiceAgreement2,
35159
- acceptServiceAgreement: acceptServiceAgreement2
35581
+ acceptServiceAgreement: acceptServiceAgreement2,
35582
+ getBankVerificationVendor: getBankVerificationVendor2
35160
35583
  } = useComponentApi(legalEntityId);
35161
35584
  const [legalEntity, setLegalEntity] = useState();
35162
35585
  const [loadingStatus, setLoadingStatus] = useState("loading");
@@ -35165,13 +35588,13 @@ function OnboardingDropinComponent({
35165
35588
  const le = await getLegalEntity2(legalEntityId);
35166
35589
  setLegalEntity(le);
35167
35590
  } catch (error) {
35168
- logger$6.error(error);
35591
+ logger$7.error(error);
35169
35592
  } finally {
35170
35593
  setLoadingStatus("success");
35171
35594
  }
35172
35595
  }, [legalEntityId, getLegalEntity2]);
35173
35596
  useEffect(() => {
35174
- fetchLegalEntity().catch(logger$6.error);
35597
+ fetchLegalEntity().catch(logger$7.error);
35175
35598
  }, [fetchLegalEntity]);
35176
35599
  return loadingStatus === "loading" || !legalEntity ? jsx(Loader, {
35177
35600
  size: "medium"
@@ -35192,7 +35615,7 @@ function OnboardingDropinComponent({
35192
35615
  handleSignPci: signPci2,
35193
35616
  handleGetPciQuestionnaires: getPciQuestionnaires2,
35194
35617
  handleDownloadPci: downloadPci2,
35195
- handleGetServiceAgreementAcceptanceInfos: getServiceAgreementAcceptanceInfos,
35618
+ handleGetServiceAgreementAcceptanceInfos: getServiceAgreementAcceptanceInfos2,
35196
35619
  handleGetServiceAgreementStatus: getServiceAgreementStatus2,
35197
35620
  handleGetServiceAgreement: getServiceAgreement2,
35198
35621
  handleSignServiceAgreement: acceptServiceAgreement2,
@@ -35200,7 +35623,448 @@ function OnboardingDropinComponent({
35200
35623
  handleGetTransferInstrument: getTransferInstrument2,
35201
35624
  handleDeleteTransferInstrument: deleteTransferInstrument2,
35202
35625
  handleUpdateTransferInstrument: updateTransferInstrument2,
35203
- handleCreateTrustedTransferInstrument: createTrustedTransferInstrument2
35626
+ handleCreateTrustedTransferInstrument: createTrustedTransferInstrument2,
35627
+ handleGetBankVerificationVendors: (country2) => getBankVerificationVendor2(country2, openBankingPartnerConfigId)
35628
+ });
35629
+ }
35630
+ const highExposureCompanyDetailsValidations = {
35631
+ country: {
35632
+ modes: ["blur"],
35633
+ validate: (country2) => !isEmpty(country2),
35634
+ errorMessage: "fieldIsRequired"
35635
+ },
35636
+ numberOfEmployees: {
35637
+ modes: ["blur"],
35638
+ validate: (numberOfEmployees2) => !isEmpty(numberOfEmployees2),
35639
+ errorMessage: "fieldIsRequired"
35640
+ }
35641
+ };
35642
+ const highExposureCompanyDetailsFields = ["numberOfEmployees"];
35643
+ function AdditionalFieldsForHighExposureCompany({
35644
+ requiredFields,
35645
+ ...props
35646
+ }) {
35647
+ const {
35648
+ i18n
35649
+ } = useI18nContext();
35650
+ const {
35651
+ handleChangeFor,
35652
+ data,
35653
+ valid,
35654
+ errors,
35655
+ fieldProblems
35656
+ } = useForm({
35657
+ ...props,
35658
+ schema: ["numberOfEmployees"],
35659
+ defaultData: {
35660
+ ...props.data
35661
+ },
35662
+ rules: props.validators || highExposureCompanyDetailsValidations,
35663
+ fieldProblems: props == null ? void 0 : props.fieldValidationErrors
35664
+ });
35665
+ const formUtils = formUtilities(props, i18n);
35666
+ const {
35667
+ updateStateSlice
35668
+ } = useGlobalDataSlice("company");
35669
+ useEffect(() => {
35670
+ updateStateSlice({
35671
+ data,
35672
+ valid,
35673
+ errors,
35674
+ fieldProblems
35675
+ });
35676
+ }, [data, valid, errors, fieldProblems]);
35677
+ return jsxs("form", {
35678
+ className: "adyen-kyc__registration-details",
35679
+ children: [jsx(FormHeader, {
35680
+ heading: props.heading
35681
+ }), jsx(ErrorPanel, {
35682
+ verificationErrors: props.formVerificationErrors,
35683
+ validationErrors: props == null ? void 0 : props.fieldValidationErrors,
35684
+ formUtils,
35685
+ id: "ariaErrorField"
35686
+ }), formUtils.isRequiredField("numberOfEmployees") && jsx(Field, {
35687
+ name: "numberOfEmployees",
35688
+ label: formUtils.getLabel("numberOfEmployees", "numberOfEmployees"),
35689
+ classNameModifiers: ["legalName"],
35690
+ errorMessage: formUtils.getErrorMessage("numberOfEmployees", errors, fieldProblems),
35691
+ isValid: valid.numberOfEmployees,
35692
+ children: (childProps) => jsx(InputText, {
35693
+ ...childProps,
35694
+ name: "numberOfEmployees",
35695
+ value: data.numberOfEmployees,
35696
+ readonly: formUtils.isReadOnly("numberOfEmployees"),
35697
+ classNameModifiers: ["legalName"],
35698
+ onInput: handleChangeFor("numberOfEmployees", "input"),
35699
+ onBlur: handleChangeFor("numberOfEmployees", "blur"),
35700
+ "aria-required": true,
35701
+ "aria-label": formUtils.getLabel("numberOfEmployees"),
35702
+ "aria-invalid": !valid.numberOfEmployees
35703
+ })
35704
+ })]
35705
+ });
35706
+ }
35707
+ const highExposureParentCompanyDetailsFields = ["numberOfEmployees"];
35708
+ function AdditionalFieldsForHighExposureParentCompany({
35709
+ requiredFields,
35710
+ ...props
35711
+ }) {
35712
+ const {
35713
+ i18n
35714
+ } = useI18nContext();
35715
+ const {
35716
+ handleChangeFor,
35717
+ data,
35718
+ valid,
35719
+ errors,
35720
+ fieldProblems
35721
+ } = useForm({
35722
+ ...props,
35723
+ schema: ["numberOfEmployees"],
35724
+ defaultData: {
35725
+ ...props.data
35726
+ },
35727
+ rules: props.validators || highExposureCompanyDetailsValidations,
35728
+ fieldProblems: props == null ? void 0 : props.fieldValidationErrors
35729
+ });
35730
+ const formUtils = formUtilities(props, i18n);
35731
+ const {
35732
+ updateStateSlice
35733
+ } = useGlobalDataSlice("parentCompany");
35734
+ useEffect(() => {
35735
+ updateStateSlice({
35736
+ data,
35737
+ valid,
35738
+ errors,
35739
+ fieldProblems
35740
+ });
35741
+ }, [data, valid, errors, fieldProblems]);
35742
+ return jsxs("form", {
35743
+ className: "adyen-kyc__registration-details",
35744
+ children: [jsx(FormHeader, {
35745
+ heading: props.heading
35746
+ }), jsx(ErrorPanel, {
35747
+ verificationErrors: props.formVerificationErrors,
35748
+ validationErrors: props == null ? void 0 : props.fieldValidationErrors,
35749
+ formUtils,
35750
+ id: "ariaErrorField"
35751
+ }), formUtils.isRequiredField("numberOfEmployees") && jsx(Field, {
35752
+ name: "numberOfEmployees",
35753
+ label: formUtils.getLabel("numberOfEmployees", "numberOfEmployees"),
35754
+ classNameModifiers: ["legalName"],
35755
+ errorMessage: formUtils.getErrorMessage("numberOfEmployees", errors, fieldProblems),
35756
+ isValid: valid.numberOfEmployees,
35757
+ children: (childProps) => jsx(InputText, {
35758
+ ...childProps,
35759
+ name: "numberOfEmployees",
35760
+ value: data.numberOfEmployees,
35761
+ readonly: formUtils.isReadOnly("numberOfEmployees"),
35762
+ classNameModifiers: ["legalName"],
35763
+ onInput: handleChangeFor("numberOfEmployees", "input"),
35764
+ onBlur: handleChangeFor("numberOfEmployees", "blur"),
35765
+ "aria-required": true,
35766
+ "aria-label": formUtils.getLabel("numberOfEmployees"),
35767
+ "aria-invalid": !valid.numberOfEmployees
35768
+ })
35769
+ })]
35770
+ });
35771
+ }
35772
+ function AdditionalFieldsForHighExposureUltimateParentCompany({
35773
+ requiredFields,
35774
+ ...props
35775
+ }) {
35776
+ const {
35777
+ i18n
35778
+ } = useI18nContext();
35779
+ const {
35780
+ handleChangeFor,
35781
+ data,
35782
+ valid,
35783
+ errors,
35784
+ fieldProblems
35785
+ } = useForm({
35786
+ ...props,
35787
+ schema: ["numberOfEmployees"],
35788
+ defaultData: {
35789
+ ...props.data
35790
+ },
35791
+ rules: props.validators || highExposureCompanyDetailsValidations,
35792
+ fieldProblems: props == null ? void 0 : props.fieldValidationErrors
35793
+ });
35794
+ const formUtils = formUtilities(props, i18n);
35795
+ const {
35796
+ updateStateSlice
35797
+ } = useGlobalDataSlice("ultimateParentCompany");
35798
+ useEffect(() => {
35799
+ updateStateSlice({
35800
+ data,
35801
+ valid,
35802
+ errors,
35803
+ fieldProblems
35804
+ });
35805
+ }, [data, valid, errors, fieldProblems]);
35806
+ return jsxs("form", {
35807
+ className: "adyen-kyc__registration-details",
35808
+ children: [jsx(FormHeader, {
35809
+ heading: props.heading
35810
+ }), jsx(ErrorPanel, {
35811
+ verificationErrors: props.formVerificationErrors,
35812
+ validationErrors: props == null ? void 0 : props.fieldValidationErrors,
35813
+ formUtils,
35814
+ id: "ariaErrorField"
35815
+ }), formUtils.isRequiredField("numberOfEmployees") && jsx(Field, {
35816
+ name: "numberOfEmployees",
35817
+ label: formUtils.getLabel("numberOfEmployees", "numberOfEmployees"),
35818
+ classNameModifiers: ["legalName"],
35819
+ errorMessage: formUtils.getErrorMessage("numberOfEmployees", errors, fieldProblems),
35820
+ isValid: valid.numberOfEmployees,
35821
+ children: (childProps) => jsx(InputText, {
35822
+ ...childProps,
35823
+ name: "numberOfEmployees",
35824
+ value: data.numberOfEmployees,
35825
+ readonly: formUtils.isReadOnly("numberOfEmployees"),
35826
+ classNameModifiers: ["legalName"],
35827
+ onInput: handleChangeFor("numberOfEmployees", "input"),
35828
+ onBlur: handleChangeFor("numberOfEmployees", "blur"),
35829
+ "aria-required": true,
35830
+ "aria-label": formUtils.getLabel("numberOfEmployees"),
35831
+ "aria-invalid": !valid.numberOfEmployees
35832
+ })
35833
+ })]
35834
+ });
35835
+ }
35836
+ const highExposureForms = {
35837
+ company: {
35838
+ formId: "company",
35839
+ formName: "company",
35840
+ fields: [...highExposureCompanyDetailsFields]
35841
+ },
35842
+ parentCompany: {
35843
+ formId: "parentCompany",
35844
+ formName: "parentCompany",
35845
+ fields: [...highExposureParentCompanyDetailsFields]
35846
+ },
35847
+ ultimateParentCompany: {
35848
+ formId: "ultimateParentCompany",
35849
+ formName: "ultimateParentCompany",
35850
+ fields: [...highExposureCompanyDetailsFields]
35851
+ }
35852
+ };
35853
+ const parentCompanyFormId = highExposureForms.parentCompany.formId;
35854
+ const companyFormId = highExposureForms.company.formId;
35855
+ const ultimateParentCompanyFormId = highExposureForms.ultimateParentCompany.formId;
35856
+ function HighExposureDropinComponent(props) {
35857
+ const {
35858
+ i18n
35859
+ } = useI18nContext();
35860
+ const highExposureCompanyDetailsFormProps = getFormProps(props, companyFormId);
35861
+ const highExposureParentCompanyDetailsFormProps = getFormProps(props, companyFormId);
35862
+ const highExposureUltimateParentCompanyDetailsFormProps = getFormProps(props, companyFormId);
35863
+ const renderActiveForm = (activeForm) => jsxs("div", {
35864
+ className: "adyen-kyc",
35865
+ children: [jsx(ContextGuidance, {
35866
+ page: "High exposure company details page",
35867
+ titleId: "whyDoINeedToFillInThisInformation",
35868
+ contentId: "euFinancialRegulationsRequireUs",
35869
+ title: i18n.get("whyDoINeedToFillInThisInformation"),
35870
+ content: i18n.get("euFinancialRegulationsRequireUs")
35871
+ }), jsxs("div", {
35872
+ className: "adyen-kyc-form-wrapper",
35873
+ children: [activeForm.formId === companyFormId && jsx(AdditionalFieldsForHighExposureCompany, {
35874
+ ...highExposureCompanyDetailsFormProps,
35875
+ heading: i18n.get("detailsForCapital"),
35876
+ id: companyFormId,
35877
+ country: props.country
35878
+ }), activeForm.formId === parentCompanyFormId && jsx(AdditionalFieldsForHighExposureParentCompany, {
35879
+ ...highExposureParentCompanyDetailsFormProps,
35880
+ heading: i18n.get("parentCompanyDetails"),
35881
+ id: companyFormId,
35882
+ country: props.country
35883
+ }), activeForm.formId === ultimateParentCompanyFormId && jsx(AdditionalFieldsForHighExposureUltimateParentCompany, {
35884
+ ...highExposureUltimateParentCompanyDetailsFormProps,
35885
+ heading: i18n.get("ultimateParentCompanyDetails"),
35886
+ id: companyFormId,
35887
+ country: props.country
35888
+ })]
35889
+ })]
35890
+ });
35891
+ return jsx("div", {
35892
+ className: "adyen-kyc",
35893
+ children: renderActiveForm(props.activeForm || highExposureForms.company)
35894
+ });
35895
+ }
35896
+ const parseConfiguration = ({
35897
+ matchingScenario
35898
+ }) => parseHighExposureScenarios(matchingScenario == null ? void 0 : matchingScenario[LegalEntityType.ORGANIZATION]);
35899
+ const logger$6 = createLogger("UpdateLegalEntityForHighExposure");
35900
+ function UpdateLegalEntityForHighExposure({
35901
+ parentLegalEntity,
35902
+ capabilities,
35903
+ country: country2,
35904
+ trackingConfig,
35905
+ problems: problemsProp,
35906
+ onSubmit: externalOnSubmit,
35907
+ onChange,
35908
+ hideDropinLayout,
35909
+ handleHomeClick,
35910
+ homeButtonLabel,
35911
+ legalEntityId
35912
+ }) {
35913
+ var _a;
35914
+ const {
35915
+ getLegalEntity: getLegalEntity2
35916
+ } = useComponentApi(legalEntityId);
35917
+ const {
35918
+ i18n
35919
+ } = useI18nContext();
35920
+ const [legalEntity, setLegalEntity] = useState();
35921
+ const fetchLegalEntity = useCallback(async () => {
35922
+ const legalEntityResponse = await getLegalEntity2(legalEntityId);
35923
+ setLegalEntity(legalEntityResponse);
35924
+ if (legalEntityResponse) {
35925
+ setData(mapLegalEntityToHighExposure(legalEntityResponse));
35926
+ }
35927
+ return legalEntityResponse;
35928
+ }, [getLegalEntity2, legalEntityId]);
35929
+ useEffect(() => {
35930
+ (async () => {
35931
+ await fetchLegalEntity();
35932
+ })().catch(logger$6.error);
35933
+ }, [fetchLegalEntity]);
35934
+ const dataFromResponse = legalEntity ? mapLegalEntityToHighExposure(legalEntity) : {};
35935
+ const [data, setData] = useState(dataFromResponse);
35936
+ const [problems, setProblems] = useState(problemsProp ?? {});
35937
+ const {
35938
+ getConfiguration: getConfiguration2
35939
+ } = useConfigurationApi();
35940
+ const {
35941
+ showToast
35942
+ } = useToastContext();
35943
+ const [loadingStatus, setLoadingStatus] = useState("success");
35944
+ const formRef = useRef(null);
35945
+ const getConfigurationData = useCallback(() => getConfiguration2({
35946
+ legalEntityType: LegalEntityType.ORGANIZATION,
35947
+ capabilities,
35948
+ country: country2
35949
+ }), [country2, capabilities]);
35950
+ const {
35951
+ fieldConfigurations
35952
+ } = useScenarioConfiguration({
35953
+ parseConfiguration,
35954
+ getConfigurationData,
35955
+ setLoadingStatus,
35956
+ country: country2
35957
+ });
35958
+ const derivedProps = useMemo(() => getPropsFromConfigurations(fieldConfigurations, highExposureForms, (problems == null ? void 0 : problems.remediationActions) ? Object.values(problems == null ? void 0 : problems.remediationActions) : [], (problems == null ? void 0 : problems.missingData) ?? [], legalEntity ? getFieldsWithExistingData(legalEntity) : []), [fieldConfigurations, problems == null ? void 0 : problems.remediationActions]);
35959
+ const {
35960
+ state: {
35961
+ currentState
35962
+ }
35963
+ } = useStateContext();
35964
+ const formValidity = currentState.validityByForm;
35965
+ useEffect(() => {
35966
+ setData({
35967
+ ...currentState.data
35968
+ });
35969
+ onChange == null ? void 0 : onChange(currentState);
35970
+ }, [currentState]);
35971
+ const forms2 = useMemo(() => {
35972
+ const requiredForms = getRequiredForms(highExposureForms, derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields);
35973
+ return addValidityToForms(requiredForms, formValidity, problems);
35974
+ }, [derivedProps, formValidity, problems]);
35975
+ const onSubmit = async () => {
35976
+ setLoadingStatus("loading");
35977
+ const exposureDetails = mapHighExposureToLegalEntity(data);
35978
+ try {
35979
+ console.log({
35980
+ exposureDetails
35981
+ });
35982
+ setLoadingStatus("success");
35983
+ showToast({
35984
+ label: i18n.get("successfullyUpdatedDetails"),
35985
+ type: ToastType.SUCCESS
35986
+ });
35987
+ externalOnSubmit == null ? void 0 : externalOnSubmit(data);
35988
+ } catch (e) {
35989
+ showToast({
35990
+ label: i18n.get("failedToUpdateDetails"),
35991
+ type: ToastType.ERROR
35992
+ });
35993
+ if (isValidationError(e)) {
35994
+ const validationErrors = processValidationErrors(e, void 0, highExposureApiKeyMapping);
35995
+ setProblems({
35996
+ ...problems,
35997
+ validationErrors
35998
+ });
35999
+ } else if (isMaintenanceModeError(e)) {
36000
+ showToast({
36001
+ label: i18n.get("failedToUpdateDetails"),
36002
+ subLabel: i18n.get("maintenanceModeMessage"),
36003
+ type: ToastType.ERROR,
36004
+ duration: "indefinite"
36005
+ });
36006
+ }
36007
+ setLoadingStatus("success");
36008
+ }
36009
+ };
36010
+ const formatDataForSummary2 = (data2) => {
36011
+ const summaryData = cloneObject(data2) || {};
36012
+ return summaryData;
36013
+ };
36014
+ const canSubmit2 = (data2) => mandatoryApiFields.HIGH_EXPOSURE.every((detail) => {
36015
+ const value = getProp(data2, detail);
36016
+ return !isEmpty(value);
36017
+ });
36018
+ const baseTrackingPayload = getBaseTrackingPayload({
36019
+ trackingConfig,
36020
+ parentLegalEntity,
36021
+ legalEntity
36022
+ });
36023
+ const {
36024
+ handleNextClick,
36025
+ handleBackClick,
36026
+ activeForm,
36027
+ shouldValidate,
36028
+ setShouldValidate,
36029
+ gotoFormByFormIndex,
36030
+ nextButtonLabel
36031
+ } = useFormComposer({
36032
+ problems,
36033
+ baseTrackingPayload,
36034
+ forms: forms2,
36035
+ formRef,
36036
+ onSubmit
36037
+ });
36038
+ return jsx(FormWrapper, {
36039
+ taskName: "detailsForCapital",
36040
+ handleNextClick,
36041
+ handleBackClick,
36042
+ gotoFormByFormIndex,
36043
+ nextButtonLabel,
36044
+ loadingStatus,
36045
+ forms: forms2,
36046
+ activeForm,
36047
+ baseTrackingPayload,
36048
+ onSubmit,
36049
+ hideDropinLayout,
36050
+ handleHomeClick,
36051
+ homeButtonLabel,
36052
+ validateForm: () => setShouldValidate(true),
36053
+ canSubmit: canSubmit2(data) && hasDataChanged(dataFromResponse, data),
36054
+ problems,
36055
+ summary: {
36056
+ data: formatDataForSummary2(data)
36057
+ },
36058
+ children: jsx(HighExposureDropinComponent, {
36059
+ ...derivedProps,
36060
+ activeForm,
36061
+ capabilities,
36062
+ data: dataFromResponse,
36063
+ country: ((_a = data == null ? void 0 : data.company) == null ? void 0 : _a.country) ?? country2,
36064
+ problems,
36065
+ shouldValidate,
36066
+ ref: formRef
36067
+ })
35204
36068
  });
35205
36069
  }
35206
36070
  var OnboardingUrlTarget = /* @__PURE__ */ ((OnboardingUrlTarget2) => {
@@ -35408,7 +36272,8 @@ const componentsMap = {
35408
36272
  createIndividualComponent: CreateIndividualComponent,
35409
36273
  manageTransferInstrumentComponent: ManageTransferInstrumentComponent,
35410
36274
  onboardingDropinComponent: OnboardingDropinComponent,
35411
- viewVerificationStatusComponent: ViewVerificationStatusComponent
36275
+ viewVerificationStatusComponent: ViewVerificationStatusComponent,
36276
+ updateLegalEntityForHighExposureComponent: UpdateLegalEntityForHighExposure
35412
36277
  };
35413
36278
  const AuthProvider = ({
35414
36279
  children,
@@ -35460,14 +36325,13 @@ const pushEvents = async (loadingContext, sessionId, event) => httpPost({
35460
36325
  }, event);
35461
36326
  const convertToEmbeddedEvent = (eventQueueItem) => {
35462
36327
  const [eventType, event] = eventQueueItem;
35463
- const hasEventData = typeof event === "object";
35464
- const eventName = hasEventData ? event.key : event;
36328
+ const isObject = typeof event === "object";
36329
+ const eventName = isObject ? event.key : event;
36330
+ const eventData = isObject ? event.segmentation : {};
35465
36331
  return {
35466
36332
  eventType,
35467
36333
  eventName,
35468
- ...hasEventData && {
35469
- eventData: event.segmentation
35470
- }
36334
+ eventData: eventData ?? {}
35471
36335
  };
35472
36336
  };
35473
36337
  const useAnalytics = async ({
@@ -35476,6 +36340,9 @@ const useAnalytics = async ({
35476
36340
  sdkVersion,
35477
36341
  componentName
35478
36342
  }) => {
36343
+ const {
36344
+ i18n
36345
+ } = useI18nContext();
35479
36346
  const {
35480
36347
  isEmbeddedDropin,
35481
36348
  loadingContext: base
@@ -35494,6 +36361,9 @@ const useAnalytics = async ({
35494
36361
  }
35495
36362
  userEvents.subscribe((data) => {
35496
36363
  const eventItem = convertToEmbeddedEvent(data);
36364
+ if (eventItem.eventData) {
36365
+ eventItem.eventData.locale = i18n.locale;
36366
+ }
35497
36367
  pushEvents(loadingContext, sessionResponse.id, eventItem);
35498
36368
  });
35499
36369
  } catch (e) {
@@ -35840,7 +36710,7 @@ const ConfigurationApiProvider = ({
35840
36710
  isEmbeddedDropin,
35841
36711
  loadingContext
35842
36712
  } = authContext;
35843
- const sdkVersion = "3.18.1";
36713
+ const sdkVersion = "3.19.1";
35844
36714
  useAnalytics({
35845
36715
  onUserEvent,
35846
36716
  legalEntityId: rootLegalEntityId,
@@ -37162,6 +38032,18 @@ const viewVerificationStatusComponentSchema = {
37162
38032
  }
37163
38033
  };
37164
38034
  const onboardingDropinComponentSchema = {
38035
+ legalEntityId: {
38036
+ type: "string",
38037
+ required: true
38038
+ },
38039
+ openBankingPartnerConfigId: {
38040
+ type: "string"
38041
+ }
38042
+ };
38043
+ const updateLegalEntityForHighExposureComponentSchema = {
38044
+ country: {
38045
+ type: "string"
38046
+ },
37165
38047
  legalEntityId: {
37166
38048
  type: "string",
37167
38049
  required: true
@@ -37181,6 +38063,7 @@ const componentsSchemaMap = {
37181
38063
  createIndividualComponent: createIndividualComponentSchema,
37182
38064
  createTransferInstrumentComponent: createTransferInstrumentComponentSchema,
37183
38065
  viewVerificationStatusComponent: viewVerificationStatusComponentSchema,
38066
+ updateLegalEntityForHighExposureComponent: updateLegalEntityForHighExposureComponentSchema,
37184
38067
  onboardingDropinComponent: onboardingDropinComponentSchema
37185
38068
  };
37186
38069
  const validateComponentName = (componentName) => {