@adyen/kyc-components 2.44.1 → 2.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/es/adyen-kyc-components.es.js +1167 -378
  2. package/dist/style.css +1098 -2248
  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/UpdateLegalEntityForHighExposure/UpdateLegalEntityForHighExposure.d.ts +2 -0
  15. package/dist/types/components/Individual/types.d.ts +3 -1
  16. package/dist/types/components/index.d.ts +2 -0
  17. package/dist/types/components/internal/FormFields/Field/Field.d.ts +5 -3
  18. package/dist/types/components/internal/IdFieldTypeSelector/countryIdNumberTypes.d.ts +8 -0
  19. package/dist/types/components/internal/IdFieldTypeSelector/inferTaxIdNumberType.d.ts +4 -1
  20. package/dist/types/components/internal/StockISINField/types.d.ts +1 -1
  21. package/dist/types/components/internal/StockTickerSymbol/StockTickerSymbolField.d.ts +3 -0
  22. package/dist/types/components/internal/StockTickerSymbol/fieldConfig.d.ts +3 -0
  23. package/dist/types/components/internal/StockTickerSymbol/index.d.ts +1 -0
  24. package/dist/types/components/internal/StockTickerSymbol/types.d.ts +5 -0
  25. package/dist/types/components/internal/TaxId/fieldConfig.d.ts +3 -0
  26. package/dist/types/core/Context/StateContext/types.d.ts +2 -1
  27. package/dist/types/core/Services/componentApi/push-events.d.ts +1 -2
  28. package/dist/types/core/hooks/useAnalytics.d.ts +9 -3
  29. package/dist/types/core/hooks/useCanSeeEntitySelection.d.ts +6 -0
  30. package/dist/types/core/process-field-configurations.d.ts +2 -0
  31. package/dist/types/core/user-events.d.ts +4 -8
  32. package/dist/types/core/utils.d.ts +1 -1
  33. package/dist/types/utils/api/processValidationErrors.d.ts +4 -1
  34. package/dist/types/utils/get-props.d.ts +17 -0
  35. package/dist/types/utils/getNestedPropertyKeys.d.ts +1 -1
  36. package/dist/types/utils/mapping/componentApiMapping.d.ts +16 -3
  37. package/dist/types/utils/mapping/mapping.d.ts +3 -0
  38. package/package.json +4 -2
@@ -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";
@@ -477,6 +481,7 @@ const companyLegalName = "Company legal name";
477
481
  const companyName = "Company name";
478
482
  const companyType = "Company type";
479
483
  const taxReferenceNumber = "Tax reference number";
484
+ const taxpayerReferenceNumber = "Taxpayer reference number";
480
485
  const SST = "SST";
481
486
  const companyProfile = "Company profile";
482
487
  const companyNumber = "Company number";
@@ -576,7 +581,6 @@ const otherTrust = "Other trust";
576
581
  const pooledSuperannuationTrust = "Pooled superannuation trust";
577
582
  const publicTradingTrust = "Public trading trust";
578
583
  const unlistedPublicUnitTrust = "Unlisted public unit trust";
579
- const countryRegionOfEstablishment = "Country/region of establishment";
580
584
  const nameOfTrustAgreement = "Name of trust agreement";
581
585
  const typeOfTrustAgreement = "Type of trust agreement";
582
586
  const objectOfCharitableTrust = "Object of charitable trust";
@@ -927,6 +931,7 @@ const taxInformationNumber = "Tax Identification Number";
927
931
  const taxInformationNumber__HK = "Business Registration number (BRN)";
928
932
  const stockExchangeMIC = "Market Identifier Code (MIC)";
929
933
  const stockISIN = "International Securities Identification Number (ISIN)";
934
+ const stockTickerSymbol = "Stock ticker symbol";
930
935
  const companyLookupResultsHeader = "Let's find your company";
931
936
  const companyLookupResultsHeader__searching = "Searching for companies...";
932
937
  const companyLookupResultsHeader__verifying = "Verifying company selection...";
@@ -1326,6 +1331,14 @@ const thisPageIsNowInactive = "This page is now inactive";
1326
1331
  const startANewSessionFromTheSamePlaceYouOriginallyAccessed = "Start a new session from the same place you originally accessed this page.";
1327
1332
  const differentCountryOfGoverningLaw = "This company has a different country/region of governing law";
1328
1333
  const countryOfGoverningLaw = "Country/region of governing law";
1334
+ const nationalInsuranceNumber = "National Insurance Number (NINO)";
1335
+ const detailsForCapital = "Details for capital";
1336
+ const parentCompany = "Parent company";
1337
+ const ultimateParentCompany = "Ultimate parent company";
1338
+ const numberOfEmployees = "Number of employees";
1339
+ const parentCompanyDetails = "Parent company details";
1340
+ const ultimateParentCompanyDetails = "Ultimate parent company details";
1341
+ const euFinancialRegulationsRequireUs = "EU financial regulations require us to collect this information. This won’t affect your business credit score.";
1329
1342
  const defaultTrans = {
1330
1343
  smartling,
1331
1344
  close,
@@ -1335,6 +1348,7 @@ const defaultTrans = {
1335
1348
  firstName,
1336
1349
  lastName,
1337
1350
  country,
1351
+ countryRegionOfEstablishment,
1338
1352
  street,
1339
1353
  otherAddressInformation,
1340
1354
  postalCode,
@@ -1768,6 +1782,7 @@ const defaultTrans = {
1768
1782
  companyName,
1769
1783
  companyType,
1770
1784
  taxReferenceNumber,
1785
+ taxpayerReferenceNumber,
1771
1786
  SST,
1772
1787
  companyProfile,
1773
1788
  companyNumber,
@@ -1872,7 +1887,6 @@ const defaultTrans = {
1872
1887
  pooledSuperannuationTrust,
1873
1888
  publicTradingTrust,
1874
1889
  unlistedPublicUnitTrust,
1875
- countryRegionOfEstablishment,
1876
1890
  nameOfTrustAgreement,
1877
1891
  typeOfTrustAgreement,
1878
1892
  objectOfCharitableTrust,
@@ -2226,6 +2240,7 @@ const defaultTrans = {
2226
2240
  taxInformationNumber__HK,
2227
2241
  stockExchangeMIC,
2228
2242
  stockISIN,
2243
+ stockTickerSymbol,
2229
2244
  companyLookupResultsHeader,
2230
2245
  companyLookupResultsHeader__searching,
2231
2246
  companyLookupResultsHeader__verifying,
@@ -2626,7 +2641,15 @@ const defaultTrans = {
2626
2641
  thisPageIsNowInactive,
2627
2642
  startANewSessionFromTheSamePlaceYouOriginallyAccessed,
2628
2643
  differentCountryOfGoverningLaw,
2629
- countryOfGoverningLaw
2644
+ countryOfGoverningLaw,
2645
+ nationalInsuranceNumber,
2646
+ detailsForCapital,
2647
+ parentCompany,
2648
+ ultimateParentCompany,
2649
+ numberOfEmployees,
2650
+ parentCompanyDetails,
2651
+ ultimateParentCompanyDetails,
2652
+ euFinancialRegulationsRequireUs
2630
2653
  };
2631
2654
  const FALLBACK_LOCALE = "en-US";
2632
2655
  const defaultTranslation = Object.entries(defaultTrans).reduce((acc, [translationKey, translationValue]) => translationKey !== "smartling" ? {
@@ -3057,7 +3080,7 @@ const icons = {
3057
3080
  warning: lazy(() => import("./warning-99uFf1WU.js")),
3058
3081
  wrong: lazy(() => import("./wrong-1wvh7nZe.js"))
3059
3082
  };
3060
- const logger$v = createLogger("Icon");
3083
+ const logger$w = createLogger("Icon");
3061
3084
  const Icon = ({
3062
3085
  className,
3063
3086
  name,
@@ -3065,7 +3088,7 @@ const Icon = ({
3065
3088
  }) => {
3066
3089
  const LazyLoadedIcon = icons[name];
3067
3090
  if (!LazyLoadedIcon) {
3068
- logger$v.error(`No such icon: "${name}"`);
3091
+ logger$w.error(`No such icon: "${name}"`);
3069
3092
  return null;
3070
3093
  }
3071
3094
  return jsx("span", {
@@ -3281,7 +3304,7 @@ function useFormRouterContext() {
3281
3304
  }
3282
3305
  return context;
3283
3306
  }
3284
- const logger$u = createLogger("Link");
3307
+ const logger$v = createLogger("Link");
3285
3308
  const getIconClass = (icon, external) => {
3286
3309
  if (external) {
3287
3310
  return "adyen-kyc-link__icon adyen-kyc-icon-external-link";
@@ -3293,7 +3316,7 @@ const getIconClass = (icon, external) => {
3293
3316
  };
3294
3317
  const isValidLink = (href) => {
3295
3318
  if (href === "#") {
3296
- logger$u.error('Links must include a valid href. If your href is "#", consider using a Button instead');
3319
+ logger$v.error('Links must include a valid href. If your href is "#", consider using a Button instead');
3297
3320
  return false;
3298
3321
  }
3299
3322
  return true;
@@ -3468,6 +3491,49 @@ function getFormProps(props, innerFormId) {
3468
3491
  shouldValidate: (activeFormId ? activeFormId === innerFormId : true) && props.shouldValidate
3469
3492
  };
3470
3493
  }
3494
+ function removeFormLayer(obj, formId) {
3495
+ if (!obj) {
3496
+ return obj;
3497
+ }
3498
+ const formIdWithDelimiter = `${formId}.`;
3499
+ return Object.entries(obj).reduce((acc, [key, value]) => {
3500
+ const newKey = key.startsWith(formIdWithDelimiter) ? key.substring(formIdWithDelimiter.length, key.length) : key;
3501
+ return {
3502
+ ...acc,
3503
+ [newKey]: value
3504
+ };
3505
+ }, {});
3506
+ }
3507
+ function getNestedOuterFormPropsFromOuterFormProps(props, innerFormId) {
3508
+ const newProps = getFormProps(props, innerFormId);
3509
+ if (newProps === null) {
3510
+ return null;
3511
+ }
3512
+ const {
3513
+ placeholders,
3514
+ labels: labels2,
3515
+ data,
3516
+ helperText,
3517
+ masks
3518
+ } = newProps;
3519
+ return {
3520
+ placeholders,
3521
+ labels: labels2,
3522
+ data,
3523
+ helperText,
3524
+ masks,
3525
+ // maintain the structure of the special fields
3526
+ readOnlyFields: removeFormLayer(props.readOnlyFields, innerFormId),
3527
+ requiredFields: removeFormLayer(props.requiredFields, innerFormId),
3528
+ optionalFields: removeFormLayer(props.optionalFields, innerFormId),
3529
+ obscuredFields: removeFormLayer(props.obscuredFields, innerFormId),
3530
+ verifyFields: removeFormLayer(props.verifyFields, innerFormId),
3531
+ // the rest we just pass along for now, as they will be eventually be processed by getFormProps
3532
+ problems: props.problems,
3533
+ validators: props.validators,
3534
+ shouldValidate: props.shouldValidate
3535
+ };
3536
+ }
3471
3537
  function getFieldProps(props, innerFormFields) {
3472
3538
  if (innerFormFields) {
3473
3539
  const nestedFormProps = {
@@ -3608,7 +3674,7 @@ const useSetting = (settingName) => {
3608
3674
  } = context;
3609
3675
  return getSetting(settingName);
3610
3676
  };
3611
- const logger$t = createLogger("useAllowedCountries");
3677
+ const logger$u = createLogger("useAllowedCountries");
3612
3678
  const useAllowedCountries = () => {
3613
3679
  const acceptedCountries = useSetting("acceptedCountries");
3614
3680
  const {
@@ -3617,7 +3683,7 @@ const useAllowedCountries = () => {
3617
3683
  const [allowedCountries, setAllowedCountries] = useState(acceptedCountries);
3618
3684
  useEffect(() => {
3619
3685
  if (acceptedCountries !== void 0) return;
3620
- getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$t.error);
3686
+ getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$u.error);
3621
3687
  }, [acceptedCountries]);
3622
3688
  return allowedCountries;
3623
3689
  };
@@ -3970,7 +4036,7 @@ function reducer({
3970
4036
  }
3971
4037
  };
3972
4038
  }
3973
- const logger$s = createLogger("useAsyncValidator");
4039
+ const logger$t = createLogger("useAsyncValidator");
3974
4040
  const useAsyncValidator = (asyncRules) => {
3975
4041
  const [asyncValidationResults, setAsyncValidationResults] = useState({});
3976
4042
  const clearAsyncValidationResults = useCallback(() => setAsyncValidationResults({}), []);
@@ -3991,7 +4057,7 @@ const useAsyncValidator = (asyncRules) => {
3991
4057
  hasError: !isValid
3992
4058
  }])
3993
4059
  });
3994
- }).catch(logger$s.error);
4060
+ }).catch(logger$t.error);
3995
4061
  }, [asyncRules, clearAsyncValidationResults]);
3996
4062
  return {
3997
4063
  asyncValidationResults,
@@ -4268,10 +4334,13 @@ const ARIA_ERROR_SUFFIX = "-ariaError";
4268
4334
  const MaybeLabelElement = ({
4269
4335
  children,
4270
4336
  ...props
4271
- }) => props.useLabelElement === true ? jsx("label", {
4272
- ...props,
4273
- children
4274
- }) : jsx("div", {
4337
+ }) => props.useLabelElement === true ? (
4338
+ // eslint-disable-next-line jsx-a11y/label-has-associated-control
4339
+ jsx("label", {
4340
+ ...props,
4341
+ children
4342
+ })
4343
+ ) : jsx("div", {
4275
4344
  ...props,
4276
4345
  role: "form",
4277
4346
  children
@@ -5916,7 +5985,7 @@ const deriveInputState = (isValid, isFocused, isDisabled, isOptional, hasNullish
5916
5985
  };
5917
5986
  };
5918
5987
  const MISMATCH_ANIMATION_NAME = "mismatchShake";
5919
- const logger$r = createLogger("MaskedInputText");
5988
+ const logger$s = createLogger("MaskedInputText");
5920
5989
  const MaskedInputText = ({
5921
5990
  value,
5922
5991
  onInput,
@@ -5957,7 +6026,7 @@ const MaskedInputText = ({
5957
6026
  };
5958
6027
  useEffect(() => {
5959
6028
  if (!mask) {
5960
- logger$r.warn("`mask` is undefined. No masking of input will take place.");
6029
+ logger$s.warn("`mask` is undefined. No masking of input will take place.");
5961
6030
  }
5962
6031
  }, [mask]);
5963
6032
  const getMaskResult = useCallback((pureValue) => {
@@ -5982,7 +6051,7 @@ const MaskedInputText = ({
5982
6051
  return;
5983
6052
  }
5984
6053
  const fallback = displayValueToPure(maskResult.partialDisplayValue);
5985
- logger$r.warn(`Value received "${value}" does not match mask`, maskResult, `
6054
+ logger$s.warn(`Value received "${value}" does not match mask`, maskResult, `
5986
6055
  Falling back to partially valid value "${fallback}"`);
5987
6056
  onInput(fallback);
5988
6057
  }
@@ -6262,6 +6331,14 @@ const taxIdNumberOptions = {
6262
6331
  }, {
6263
6332
  id: "uen",
6264
6333
  name: "uen"
6334
+ }],
6335
+ [CountryCodes.Jersey]: [{
6336
+ id: "taxIdentificationNumber",
6337
+ name: "taxIdentificationNumber"
6338
+ }, {
6339
+ id: "socialSecurityNumber",
6340
+ name: "socialSecurityNumber",
6341
+ applicableOnlyFor: [CompanyTypesValue.SOLE_PROPRIETORSHIP]
6265
6342
  }]
6266
6343
  };
6267
6344
  const getTaxIdNumberOptions = (country2, companyType2) => {
@@ -7745,16 +7822,16 @@ const Accordion = ({
7745
7822
  className,
7746
7823
  children: [jsxs("summary", {
7747
7824
  children: [expandOnLeft && jsx("img", {
7748
- className: "arrow",
7825
+ className: "adyen-kyc-accordion__arrow",
7749
7826
  src: ChevronDownIcon,
7750
7827
  alt: ""
7751
7828
  }), icon, title, !expandOnLeft && jsx("img", {
7752
- className: "arrow arrow-right",
7829
+ className: "adyen-kyc-accordion__arrow adyen-kyc-accordion__arrow--right",
7753
7830
  src: ChevronDownIcon,
7754
7831
  alt: ""
7755
7832
  })]
7756
7833
  }), jsx("section", {
7757
- className: "content",
7834
+ className: "adyen-kyc-accordion__content",
7758
7835
  children
7759
7836
  })]
7760
7837
  });
@@ -7919,6 +7996,54 @@ const stockISINFieldMetadata = {
7919
7996
  }
7920
7997
  }
7921
7998
  };
7999
+ const STOCK_TICKER_SYMBOL_FIELD = ["stockTickerSymbol"];
8000
+ function StockTickerSymbolField({
8001
+ data,
8002
+ valid,
8003
+ errors,
8004
+ labels: labels2,
8005
+ placeholders,
8006
+ readonly,
8007
+ mask,
8008
+ guidanceText,
8009
+ handleChangeFor
8010
+ }) {
8011
+ return jsx(MaskedInputText, {
8012
+ name: "stockTickerSymbol",
8013
+ label: labels2.stockTickerSymbol ?? "",
8014
+ formatGuidance: guidanceText == null ? void 0 : guidanceText.stockTickerSymbol,
8015
+ placeholder: placeholders == null ? void 0 : placeholders.stockTickerSymbol,
8016
+ ...mask,
8017
+ classNameModifiers: {
8018
+ field: ["stockTickerSymbol"],
8019
+ input: ["stockTickerSymbol"]
8020
+ },
8021
+ errorMessage: errors.stockTickerSymbol,
8022
+ isValid: valid.stockTickerSymbol ?? false,
8023
+ value: data.stockTickerSymbol ?? "",
8024
+ readonly,
8025
+ onInput: handleChangeFor("stockTickerSymbol", "input"),
8026
+ onBlur: handleChangeFor("stockTickerSymbol", "blur"),
8027
+ "aria-required": true,
8028
+ "aria-label": labels2.stockTickerSymbol,
8029
+ "aria-invalid": !valid.stockTickerSymbol
8030
+ });
8031
+ }
8032
+ const stockTickerSymbolFieldMetadata = {
8033
+ label: "stockTickerSymbol",
8034
+ validators: [validatePatternOnBlur(/^[A-Z\d]{1,5}$/)],
8035
+ mask: {
8036
+ mask: makeMask(...alphanumericInputs(1), ...alphanumericInputs(4)),
8037
+ transformOnType: uppercase
8038
+ },
8039
+ guidanceText: {
8040
+ key: "enterAMaximumOfNCharactersForExample",
8041
+ values: {
8042
+ maxChars: "5",
8043
+ example: "ADYEN"
8044
+ }
8045
+ }
8046
+ };
7922
8047
  const defaultFieldMetadata$7 = {
7923
8048
  label: "taxId"
7924
8049
  };
@@ -8022,6 +8147,136 @@ const defaultFieldConfig$7 = {
8022
8147
  }
8023
8148
  }
8024
8149
  },
8150
+ [CountryCodes.Guernsey]: ({
8151
+ companyType: companyType2
8152
+ }) => {
8153
+ switch (companyType2) {
8154
+ case CompanyTypesValue.SOLE_PROPRIETORSHIP:
8155
+ return {
8156
+ label: "nationalInsuranceNumber",
8157
+ validators: validatePatternOnBlur(/^GY\d{6}[A-D]$/),
8158
+ mask: {
8159
+ mask: makeMask(...nonInputs("GY", {
8160
+ includeInValue: true
8161
+ }), spacer, ...numericInputs(2), spacer, ...numericInputs(2), spacer, ...numericInputs(2), spacer, {
8162
+ type: "input",
8163
+ allow: /[A-D]/
8164
+ }),
8165
+ transformOnType: uppercase
8166
+ },
8167
+ guidanceText: {
8168
+ key: "enterTheRemainingNCharactersForExample",
8169
+ values: {
8170
+ numChars: "7",
8171
+ example: "GY 12 34 56 A"
8172
+ }
8173
+ }
8174
+ };
8175
+ default:
8176
+ return {
8177
+ label: "registrationNumber",
8178
+ mask: businessRegistrationNumberMasks[CountryCodes.Guernsey].default,
8179
+ validators: validatePatternOnBlur(businessRegistrationNumberPatterns[CountryCodes.Guernsey].default),
8180
+ guidanceText: {
8181
+ key: "enterAMaximumOfNDigitsForExample",
8182
+ values: {
8183
+ maxDigits: "9",
8184
+ example: "123456"
8185
+ }
8186
+ }
8187
+ };
8188
+ }
8189
+ },
8190
+ [CountryCodes.Jersey]: ({
8191
+ taxIdNumberType,
8192
+ companyType: companyType2
8193
+ }) => {
8194
+ switch (taxIdNumberType) {
8195
+ case "socialSecurityNumber":
8196
+ return {
8197
+ label: "socialSecurityNumber",
8198
+ validators: validatePatternOnBlur(/^[A-Z]{2}\d{6}[A-Z]$/),
8199
+ mask: {
8200
+ mask: makeMask(...alphaInputs(2), ...numericInputs(6), ...alphaInputs(1)),
8201
+ transformOnType: uppercase
8202
+ },
8203
+ guidanceText: {
8204
+ key: "enterNCharactersForExample",
8205
+ values: {
8206
+ numChars: "9",
8207
+ example: "JY000000A"
8208
+ }
8209
+ }
8210
+ };
8211
+ case "taxIdentificationNumber":
8212
+ default:
8213
+ switch (companyType2) {
8214
+ case CompanyTypesValue.SOLE_PROPRIETORSHIP:
8215
+ return {
8216
+ label: "taxIdentificationNumber",
8217
+ validators: validatePatternOnBlur(/^\d{10}$/),
8218
+ mask: {
8219
+ mask: makeMask(...numericInputs(3), ...nonInputs(" - "), ...numericInputs(3), ...nonInputs(" - "), ...numericInputs(4))
8220
+ },
8221
+ guidanceText: {
8222
+ key: "enterNDigitsForExample",
8223
+ values: {
8224
+ numDigits: "10",
8225
+ example: "100-100-1000"
8226
+ }
8227
+ }
8228
+ };
8229
+ default:
8230
+ return {
8231
+ label: "taxIdentificationNumber",
8232
+ validators: validatePatternOnBlur(/^[A-Z]{2}\d{5}$/),
8233
+ mask: {
8234
+ mask: makeMask(...alphaInputs(2), ...numericInputs(5)),
8235
+ transformOnType: uppercase
8236
+ },
8237
+ guidanceText: {
8238
+ key: "enterNCharactersForExample",
8239
+ values: {
8240
+ numChars: "7",
8241
+ example: "CC17261"
8242
+ }
8243
+ }
8244
+ };
8245
+ }
8246
+ }
8247
+ },
8248
+ [CountryCodes.IsleOfMan]: {
8249
+ label: "taxReferenceNumber",
8250
+ validators: validatePatternOnBlur(/^[HCX]\d{8}$/),
8251
+ mask: {
8252
+ mask: makeMask({
8253
+ type: "input",
8254
+ allow: /[HCX]/
8255
+ }, ...numericInputs(6), ...nonInputs(" - "), ...numericInputs(2)),
8256
+ transformOnType: uppercase
8257
+ },
8258
+ guidanceText: {
8259
+ key: "enterNCharactersForExample",
8260
+ values: {
8261
+ numChars: "9",
8262
+ example: "C155673-79"
8263
+ }
8264
+ }
8265
+ },
8266
+ [CountryCodes.Gibraltar]: {
8267
+ label: "taxpayerReferenceNumber",
8268
+ validators: validatePatternOnBlur(/^\d{1,7}$/),
8269
+ mask: {
8270
+ mask: makeMask(...numericInputs(1), ...numericInputs(6, true))
8271
+ },
8272
+ guidanceText: {
8273
+ key: "enterAMaximumOfNDigitsForExample",
8274
+ values: {
8275
+ maxDigits: "7",
8276
+ example: "123456"
8277
+ }
8278
+ }
8279
+ },
8025
8280
  /**
8026
8281
  * NOT YET SUPPORTED
8027
8282
  * These are brought over from the old pattern files. We have no idea if they are accurate or not.
@@ -8671,14 +8926,15 @@ const defaultFieldConfig$6 = {
8671
8926
  validators: validatePatternOnBlur(/^[JGVE]-\d{8}-?\d$/)
8672
8927
  }
8673
8928
  };
8674
- const inferTaxIdNumberType = (taxId2, country2) => {
8929
+ const inferTaxIdNumberType = (taxId2, country2, companyType2) => {
8675
8930
  const optionsForCountry = taxIdNumberOptions[country2];
8676
8931
  const metadataFn = defaultFieldConfig$6[country2] ?? defaultFieldConfig$7[country2];
8677
8932
  if (!optionsForCountry || !metadataFn || typeof metadataFn !== "function") return void 0;
8678
8933
  for (const option of optionsForCountry) {
8679
8934
  const fieldMetadata = metadataFn({
8680
8935
  taxIdNumberType: option.id,
8681
- vatNumberType: option.id
8936
+ vatNumberType: option.id,
8937
+ companyType: companyType2
8682
8938
  });
8683
8939
  if (!fieldMetadata.validators) continue;
8684
8940
  const validators = Array.isArray(fieldMetadata.validators) ? fieldMetadata.validators : [fieldMetadata.validators];
@@ -8745,10 +9001,11 @@ function TaxId(props) {
8745
9001
  fieldConfig = defaultFieldConfig$7
8746
9002
  } = props;
8747
9003
  const existingTaxId = propData == null ? void 0 : propData.taxId;
8748
- const defaultTaxIdNumberType = existingTaxId ? inferTaxIdNumberType(existingTaxId, country2) : (_a = getTaxIdNumberOptions(country2, companyType2)) == null ? void 0 : _a[0].id;
9004
+ const defaultTaxIdNumberType = existingTaxId ? inferTaxIdNumberType(existingTaxId, country2, companyType2) : (_a = getTaxIdNumberOptions(country2, companyType2)) == null ? void 0 : _a[0].id;
8749
9005
  const [taxIdNumberType, setTaxIdNumberType] = useState(defaultTaxIdNumberType);
8750
9006
  const metadata = resolveFieldMetadata(fieldConfig[country2], {
8751
- taxIdNumberType
9007
+ taxIdNumberType,
9008
+ companyType: companyType2
8752
9009
  }, defaultFieldMetadata$7);
8753
9010
  const mergedProps = mergeFieldMetadataIntoProps("taxId", metadata, props);
8754
9011
  const {
@@ -8928,7 +9185,7 @@ function VatNumber(props) {
8928
9185
  name: VatAbsenceReason.CountryWithoutVatOrGstSystem
8929
9186
  }]);
8930
9187
  const existingTaxId = propData == null ? void 0 : propData.vatNumber;
8931
- const defaultTaxIdNumberType = existingTaxId ? inferTaxIdNumberType(existingTaxId, country2) : (_a = taxIdNumberOptions[country2]) == null ? void 0 : _a[0].id;
9188
+ const defaultTaxIdNumberType = existingTaxId ? inferTaxIdNumberType(existingTaxId, country2, void 0) : (_a = taxIdNumberOptions[country2]) == null ? void 0 : _a[0].id;
8932
9189
  const [taxIdNumberType, setTaxIdNumberType] = useState(defaultTaxIdNumberType);
8933
9190
  const metadata = resolveFieldMetadata(fieldConfig[country2], {
8934
9191
  vatNumberType: taxIdNumberType
@@ -9085,7 +9342,7 @@ const FLOWS_THAT_HIDE_REGISTRATION_NUMBER = [{
9085
9342
  companyType: [CompanyTypesValue.SOLE_PROPRIETORSHIP],
9086
9343
  country: CountryCodes.PuertoRico
9087
9344
  }];
9088
- const companyRegistrationDetailsFields = ["tradingName", "sameNameAsLegalName", ...businessRegistrationNumberFields, "stockExchangeMIC", "stockISIN", ...vatNumberFields, ...taxIdFields, "dateOfIncorporation"];
9345
+ const companyRegistrationDetailsFields = ["tradingName", "sameNameAsLegalName", ...businessRegistrationNumberFields, "stockExchangeMIC", "stockISIN", "stockTickerSymbol", ...vatNumberFields, ...taxIdFields, "dateOfIncorporation"];
9089
9346
  function CompanyRegistrationDetailsComponent(props) {
9090
9347
  var _a, _b;
9091
9348
  const {
@@ -9094,13 +9351,14 @@ function CompanyRegistrationDetailsComponent(props) {
9094
9351
  let mergedProps = props;
9095
9352
  mergedProps = mergeFieldMetadataIntoProps("stockExchangeMIC", stockExchangeMICFieldMetadata, mergedProps);
9096
9353
  mergedProps = mergeFieldMetadataIntoProps("stockISIN", stockISINFieldMetadata, mergedProps);
9354
+ mergedProps = mergeFieldMetadataIntoProps("stockTickerSymbol", stockTickerSymbolFieldMetadata, mergedProps);
9097
9355
  const hideOptionalRegistrationNumberField = FLOWS_THAT_HIDE_REGISTRATION_NUMBER.some((f) => f.country === mergedProps.country && f.companyType.includes(mergedProps.companyType));
9098
9356
  const stateRef = useRef({
9099
9357
  setState: null
9100
9358
  });
9101
9359
  const COMPANY_REGISTRATION_DETAILS = mergedProps.id;
9102
9360
  const requiredFields = mergedProps.requiredFields || companyRegistrationDetailsFields;
9103
- const directChildFields = requiredFields.filter((field) => ["tradingName", "sameNameAsLegalName", "stockExchangeMIC", "stockISIN", "dateOfIncorporation"].includes(field));
9361
+ const directChildFields = requiredFields.filter((field) => ["tradingName", "sameNameAsLegalName", "stockExchangeMIC", "stockISIN", "stockTickerSymbol", "dateOfIncorporation"].includes(field));
9104
9362
  const {
9105
9363
  getData
9106
9364
  } = useStateContext();
@@ -9270,6 +9528,16 @@ function CompanyRegistrationDetailsComponent(props) {
9270
9528
  guidanceText: formUtils.getFieldGuidanceText(STOCK_ISIN_FIELD),
9271
9529
  readonly: formUtils.isReadOnly("stockISIN"),
9272
9530
  handleChangeFor
9531
+ }), formUtils.isRequiredField("stockTickerSymbol") && jsx(StockTickerSymbolField, {
9532
+ data: formUtils.getFieldData(data, STOCK_TICKER_SYMBOL_FIELD),
9533
+ valid: formUtils.getFieldValid(valid, STOCK_TICKER_SYMBOL_FIELD),
9534
+ errors: formUtils.getFieldErrors(errors, fieldProblems, STOCK_TICKER_SYMBOL_FIELD),
9535
+ labels: formUtils.getFieldLabels(STOCK_TICKER_SYMBOL_FIELD),
9536
+ placeholders: formUtils.getFieldPlaceholders(STOCK_TICKER_SYMBOL_FIELD),
9537
+ mask: formUtils.getMask("stockTickerSymbol"),
9538
+ guidanceText: formUtils.getFieldGuidanceText(STOCK_TICKER_SYMBOL_FIELD),
9539
+ readonly: formUtils.isReadOnly("stockTickerSymbol"),
9540
+ handleChangeFor
9273
9541
  }), formUtils.isRequiredField("registrationNumber", !hideOptionalRegistrationNumberField) && jsx(BusinessRegistrationNumber, {
9274
9542
  ...registrationNumberProps,
9275
9543
  companyType: mergedProps.companyType,
@@ -9339,10 +9607,13 @@ const companyBase = {
9339
9607
  rule: "REQUIRED"
9340
9608
  },
9341
9609
  stockExchangeMIC: {
9342
- rule: "stockExchangeMICIfTypePublic"
9610
+ rule: "ifPubliclyTradedCompany"
9343
9611
  },
9344
9612
  stockISIN: {
9345
- rule: "stockISINIfTypePublic"
9613
+ rule: "ifPubliclyTradedCompany"
9614
+ },
9615
+ stockTickerSymbol: {
9616
+ rule: "ifPubliclyTradedCompany"
9346
9617
  },
9347
9618
  tradingName: {
9348
9619
  rule: "REQUIRED"
@@ -9392,10 +9663,13 @@ const companySearchBase = {
9392
9663
  rule: "countryRequiresStateOrProvince"
9393
9664
  },
9394
9665
  stockExchangeMIC: {
9395
- rule: "stockExchangeMICIfTypePublic"
9666
+ rule: "ifPubliclyTradedCompany"
9396
9667
  },
9397
9668
  stockISIN: {
9398
- rule: "stockISINIfTypePublic"
9669
+ rule: "ifPubliclyTradedCompany"
9670
+ },
9671
+ stockTickerSymbol: {
9672
+ rule: "ifPubliclyTradedCompany"
9399
9673
  },
9400
9674
  dateOfIncorporation: {
9401
9675
  rule: "countryRequiresDateOfIncorporationForCompanies"
@@ -9439,10 +9713,13 @@ const businessDetailsBase = {
9439
9713
  rule: "countryRequiresStateOrProvince"
9440
9714
  },
9441
9715
  stockExchangeMIC: {
9442
- rule: "stockExchangeMICIfTypePublic"
9716
+ rule: "ifPubliclyTradedCompany"
9443
9717
  },
9444
9718
  stockISIN: {
9445
- rule: "stockISINIfTypePublic"
9719
+ rule: "ifPubliclyTradedCompany"
9720
+ },
9721
+ stockTickerSymbol: {
9722
+ rule: "ifPubliclyTradedCompany"
9446
9723
  },
9447
9724
  dateOfIncorporation: {
9448
9725
  rule: "countryRequiresDateOfIncorporationForCompanies"
@@ -10036,12 +10313,6 @@ const EntityTypeSelectionRadioCardBody = ({
10036
10313
  })]
10037
10314
  });
10038
10315
  };
10039
- const CoreContext = createContext(void 0);
10040
- const useCoreContext = () => {
10041
- const context = useContext(CoreContext);
10042
- if (!context) throw Error("You need a <CoreProvider> to use core context");
10043
- return context;
10044
- };
10045
10316
  var TrustMemberTypes = /* @__PURE__ */ ((TrustMemberTypes2) => {
10046
10317
  TrustMemberTypes2["DEFINED_BENEFICIARY"] = "definedBeneficiary";
10047
10318
  TrustMemberTypes2["UNDEFINED_BENEFICIARY"] = "undefinedBeneficiary";
@@ -10237,7 +10508,7 @@ var VerificationStatus = /* @__PURE__ */ ((VerificationStatus2) => {
10237
10508
  VerificationStatus2["REJECTED"] = "rejected";
10238
10509
  return VerificationStatus2;
10239
10510
  })(VerificationStatus || {});
10240
- function getNestedPropertyKeys(obj, includeUndefined = false) {
10511
+ function getNestedPropertyKeys(obj, includeUndefined = false, includeFalsy = true) {
10241
10512
  const fieldNames = [];
10242
10513
  Object.entries(obj).forEach(([key, value]) => {
10243
10514
  if (typeof value === "object" && value !== null) {
@@ -10245,7 +10516,7 @@ function getNestedPropertyKeys(obj, includeUndefined = false) {
10245
10516
  fieldNames.push(...nested);
10246
10517
  return;
10247
10518
  }
10248
- if (value !== void 0 || includeUndefined) {
10519
+ if ((value !== void 0 || includeUndefined) && (value || !includeFalsy)) {
10249
10520
  fieldNames.push(key);
10250
10521
  }
10251
10522
  });
@@ -10286,8 +10557,10 @@ function isEmptyEntity(legalEntity) {
10286
10557
  const minimumFields = emptyFieldsByEntityType[type];
10287
10558
  const typeSpecificSection = legalEntity[type];
10288
10559
  if (!typeSpecificSection) return true;
10289
- const fieldsOnEntity = getNestedPropertyKeys(typeSpecificSection);
10290
- return !fieldsOnEntity.some((field) => !minimumFields.includes(field));
10560
+ const fieldsOnEntity = getNestedPropertyKeys(typeSpecificSection, false, false);
10561
+ const sortedMinimumFields = minimumFields.toSorted();
10562
+ const sortedFieldsOnEntity = fieldsOnEntity.toSorted();
10563
+ return sortedFieldsOnEntity.every((value, index) => value === sortedMinimumFields[index]);
10291
10564
  }
10292
10565
  const capabilitiesToPreventTypeChange = ["receivePayments", "issueCard", "useCard", "withdrawFromAtm", "withdrawFromAtmInRestrictedCountries", "receiveFromTransferInstrument", "useCardInRestrictedCountries", "useCardInRestrictedIndustries", "issueBankAccount", "sendToThirdParty", "receiveFromThirdParty", "getGrantOffers", "receiveGrants"];
10293
10566
  const entityTypeToCorrespondingAccountHolderOption = {
@@ -10439,7 +10712,7 @@ const accountHolderValidationRules = {
10439
10712
  }
10440
10713
  };
10441
10714
  const accountHolderFields = ["accountHolder"];
10442
- const logger$q = createLogger("AccountHolder");
10715
+ const logger$r = createLogger("AccountHolder");
10443
10716
  function getAvailableAccountHolderOptions(legalEntityType, isChangeOfLegalEntityTypeAllowed, isTrustFlowEnabled, isSoleProprietorshipAllowed, isChangeToMyNameAllowed) {
10444
10717
  switch (legalEntityType) {
10445
10718
  case LegalEntityType.ORGANIZATION: {
@@ -10449,7 +10722,7 @@ function getAvailableAccountHolderOptions(legalEntityType, isChangeOfLegalEntity
10449
10722
  return [...isChangeToMyNameAllowed ? ["myName"] : [], ...isChangeOfLegalEntityTypeAllowed ? ["theCompanyIWorkFor"] : [], ...isTrustFlowEnabled ? ["aTrust"] : [], ...isSoleProprietorshipAllowed ? ["mySoleProprietorName"] : []];
10450
10723
  }
10451
10724
  default:
10452
- logger$q.error(`No available account holder options for legal entity type '${legalEntityType}'`);
10725
+ logger$r.error(`No available account holder options for legal entity type '${legalEntityType}'`);
10453
10726
  return [];
10454
10727
  }
10455
10728
  }
@@ -10465,9 +10738,6 @@ function AccountHolder(props) {
10465
10738
  dataStoreId,
10466
10739
  capabilities
10467
10740
  } = props;
10468
- const {
10469
- setAccountHolder
10470
- } = useCoreContext();
10471
10741
  const {
10472
10742
  isSettingEnabled
10473
10743
  } = useSettingsContext();
@@ -10516,9 +10786,6 @@ function AccountHolder(props) {
10516
10786
  dataStoreId
10517
10787
  }
10518
10788
  });
10519
- if (data == null ? void 0 : data.accountHolder) {
10520
- setAccountHolder(data.accountHolder);
10521
- }
10522
10789
  }, [data, errors, valid, dataStoreId]);
10523
10790
  const formUtils = formUtilities(props, i18n);
10524
10791
  const questionLabel = i18n.get("nameOfBankAccountHolder");
@@ -11009,7 +11276,7 @@ function Dropzone(props) {
11009
11276
  })]
11010
11277
  });
11011
11278
  }
11012
- const logger$p = createLogger("TextArea");
11279
+ const logger$q = createLogger("TextArea");
11013
11280
  function TextArea(props) {
11014
11281
  const {
11015
11282
  classNameModifiers,
@@ -11030,7 +11297,7 @@ function TextArea(props) {
11030
11297
  } = useI18nContext();
11031
11298
  const [value, setValue] = useState("");
11032
11299
  if (Object.prototype.hasOwnProperty.call(props, "onChange")) {
11033
- logger$p.error("Error: Form fields that rely on InputBase may not have an onChange property");
11300
+ logger$q.error("Error: Form fields that rely on InputBase may not have an onChange property");
11034
11301
  }
11035
11302
  const handleInput = (e) => {
11036
11303
  var _a;
@@ -11473,7 +11740,7 @@ function useIsElementVisible(ref, fallback = true) {
11473
11740
  }, [ref]);
11474
11741
  return isOnScreen;
11475
11742
  }
11476
- const logger$o = createLogger("SearchAddress");
11743
+ const logger$p = createLogger("SearchAddress");
11477
11744
  const SearchAddress = ({
11478
11745
  data,
11479
11746
  legalEntityId,
@@ -11516,7 +11783,7 @@ const SearchAddress = ({
11516
11783
  const response = await handleFindAddress(selectedAddressId);
11517
11784
  autocompleteAddressForm(response);
11518
11785
  } catch (e) {
11519
- logger$o.error(e);
11786
+ logger$p.error(e);
11520
11787
  }
11521
11788
  };
11522
11789
  const onDrilldown = async (selectedAddress) => {
@@ -11528,7 +11795,7 @@ const SearchAddress = ({
11528
11795
  }, legalEntityId);
11529
11796
  setItems((response == null ? void 0 : response.results) || []);
11530
11797
  } catch (e) {
11531
- logger$o.error(e);
11798
+ logger$p.error(e);
11532
11799
  }
11533
11800
  };
11534
11801
  const onChange = (e) => {
@@ -11583,7 +11850,7 @@ const SearchAddress = ({
11583
11850
  setItems([]);
11584
11851
  }
11585
11852
  } catch (e) {
11586
- logger$o.error(e);
11853
+ logger$p.error(e);
11587
11854
  }
11588
11855
  setLoading(false);
11589
11856
  }
@@ -12143,6 +12410,7 @@ function Address(props) {
12143
12410
  maxlength: getMaxLengthByFieldAndCountry(countrySpecificFormatters, fieldName, data.country),
12144
12411
  hideField,
12145
12412
  "aria-label": formUtils.getLabel(fieldName, fieldName),
12413
+ readOnly: formUtils.isReadOnly(fieldName),
12146
12414
  trimOnBlur: true
12147
12415
  }, fieldName);
12148
12416
  };
@@ -12270,16 +12538,22 @@ function RegistrationAddressComponent(props) {
12270
12538
  } = useI18nContext();
12271
12539
  const {
12272
12540
  id: id2,
12273
- data,
12274
- country: country2,
12275
- validators,
12276
12541
  heading,
12277
12542
  description: description2,
12278
12543
  handleAddressSearch,
12279
12544
  handleFindAddress,
12280
- optionalFields,
12545
+ country: country2,
12546
+ data,
12547
+ validators,
12281
12548
  kompanyAddress
12282
12549
  } = props;
12550
+ const {
12551
+ requiredFields: registrationAddressRequiredFields,
12552
+ optionalFields: registrationAddressOptionalFields,
12553
+ readOnlyFields: registrationAddressReadOnlyFields,
12554
+ obscuredFields: registrationAddressObscuredFields,
12555
+ verifyFields: registrationAddressVerifyFields
12556
+ } = getFormProps(props, props.id);
12283
12557
  const {
12284
12558
  data: formData,
12285
12559
  valid: formValid,
@@ -12292,9 +12566,17 @@ function RegistrationAddressComponent(props) {
12292
12566
  defaultData: data,
12293
12567
  rules: validators || registrationAddressValidationRules,
12294
12568
  obscuredFields: [],
12295
- optionalFields
12569
+ optionalFields: registrationAddressOptionalFields
12296
12570
  });
12297
- const formUtils = formUtilities(props, i18n);
12571
+ const mergedProps = {
12572
+ ...props,
12573
+ requiredFields: registrationAddressRequiredFields,
12574
+ optionalFields: registrationAddressOptionalFields,
12575
+ readOnlyFields: registrationAddressReadOnlyFields,
12576
+ obscuredFields: registrationAddressObscuredFields,
12577
+ verifyFields: registrationAddressVerifyFields
12578
+ };
12579
+ const formUtils = formUtilities(mergedProps, i18n);
12298
12580
  const stateRef = useRef({
12299
12581
  setState: null
12300
12582
  });
@@ -12324,8 +12606,8 @@ function RegistrationAddressComponent(props) {
12324
12606
  heading,
12325
12607
  description: description2
12326
12608
  }), jsx(ErrorPanel, {
12327
- verificationErrors: id2 ? (_b = (_a = props == null ? void 0 : props.problems) == null ? void 0 : _a.verificationErrors) == null ? void 0 : _b[id2] : void 0,
12328
- validationErrors: id2 ? (_d = (_c = props == null ? void 0 : props.problems) == null ? void 0 : _c.validationErrors) == null ? void 0 : _d[id2] : void 0,
12609
+ verificationErrors: id2 ? (_b = (_a = props.problems) == null ? void 0 : _a.verificationErrors) == null ? void 0 : _b[id2] : void 0,
12610
+ validationErrors: id2 ? (_d = (_c = props.problems) == null ? void 0 : _c.validationErrors) == null ? void 0 : _d[id2] : void 0,
12329
12611
  formUtils,
12330
12612
  id: "ariaErrorField"
12331
12613
  }), jsx(ContextGuidance, {
@@ -12700,7 +12982,7 @@ function CompanyComponent(props) {
12700
12982
  const companyNameAndCountryFormProps = getFormProps(props, CompanyNameAndCountryFormID);
12701
12983
  const companyTypeFormProps = getFormProps(props, CompanyTypeFormID);
12702
12984
  const companyRegistrationDetailsFormProps = getFormProps(props, CompanyRegistrationDetailsFormID);
12703
- const companyRegistrationAddressFormProps = getFormProps(props, CompanyRegistrationAddressFormID);
12985
+ const companyRegistrationAddressFormProps = getNestedOuterFormPropsFromOuterFormProps(props, CompanyRegistrationAddressFormID);
12704
12986
  const companyRegistrationDocumentFormProps = getFormProps(props, CompanyRegistrationDocumentFormID);
12705
12987
  const companyTaxDocumentFormProps = getFormProps(props, CompanyTaxDocumentFormID);
12706
12988
  const handleStateChange = ({
@@ -12978,7 +13260,7 @@ const COUNTRIES_THAT_DONT_REQUIRE_SOLE_PROP_REGISTRATION = [CountryCodes.Austral
12978
13260
  const COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION = [CountryCodes.PuertoRico, CountryCodes.UnitedStates];
12979
13261
  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];
12980
13262
  const COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER = [CountryCodes.PuertoRico, CountryCodes.UnitedStates];
12981
- 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];
13263
+ 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];
12982
13264
  const COUNTRIES_THAT_DO_NOT_USE_TAX_ID_FOR_SOLE_PROP = [CountryCodes.NewZealand, CountryCodes.Singapore];
12983
13265
  const COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_COMPANIES = [
12984
13266
  // strictly a subset of countries which use tax ID
@@ -13004,16 +13286,7 @@ const rules$2 = ({
13004
13286
  return "REQUIRED";
13005
13287
  }
13006
13288
  },
13007
- stockExchangeMICIfTypePublic: () => {
13008
- var _a, _b;
13009
- if ("companyType" in data && ((_a = data.companyType) == null ? void 0 : _a.entityType) === CompanyTypesValue.PUBLIC_COMPANY) {
13010
- return "REQUIRED";
13011
- }
13012
- if ("companyStructure" in data && ((_b = data.companyStructure) == null ? void 0 : _b.entityType) === CompanyTypesValue.PUBLIC_COMPANY) {
13013
- return "REQUIRED";
13014
- }
13015
- },
13016
- stockISINIfTypePublic: () => {
13289
+ ifPubliclyTradedCompany: () => {
13017
13290
  var _a, _b;
13018
13291
  if ("companyType" in data && ((_a = data.companyType) == null ? void 0 : _a.entityType) === CompanyTypesValue.PUBLIC_COMPANY) {
13019
13292
  return "REQUIRED";
@@ -13200,7 +13473,8 @@ const mandatoryApiFields = {
13200
13473
  DECISION_MAKER_OWNER: ["personalDetails.firstName", "personalDetails.lastName", "personalDetails.residencyCountry", "personalDetails.role"],
13201
13474
  ORGANIZATION: ["companyNameAndCountry.legalCompanyName", "companyNameAndCountry.country"],
13202
13475
  SOLE_PROPRIETORSHIP: ["solePropNameAndCountry.legalCompanyName", "solePropNameAndCountry.country"],
13203
- TRUST: ["trustRegistrationDetails.legalName", "trustRegistrationDetails.country"]
13476
+ TRUST: ["trustRegistrationDetails.legalName", "trustRegistrationDetails.country"],
13477
+ HIGH_EXPOSURE: ["company.numberOfEmployees", "parentCompany.numberOfEmployees", "ultimateParentCompany.numberOfEmployees"]
13204
13478
  };
13205
13479
  const individualObscuredFields = ["personalDetails.idNumber", "personalDetails.idNumberExempt"];
13206
13480
  const individualBaseMapping = {
@@ -13263,6 +13537,7 @@ const businessDetailsBaseMapping = {
13263
13537
  "additionalInformation.isUen": "organization.isUen",
13264
13538
  "additionalInformation.stockExchangeMIC": "organization.stockData.marketIdentifier",
13265
13539
  "additionalInformation.stockISIN": "organization.stockData.stockNumber",
13540
+ "additionalInformation.stockTickerSymbol": "organization.stockData.tickerSymbol",
13266
13541
  "companyRegistrationAddress.registrationAddress.city": "organization.registeredAddress.city",
13267
13542
  "companyRegistrationAddress.registrationAddress.country": "organization.registeredAddress.country",
13268
13543
  "companyRegistrationAddress.registrationAddress.postalCode": "organization.registeredAddress.postalCode",
@@ -13289,6 +13564,7 @@ const companyBaseMapping = {
13289
13564
  "companyRegistrationDetails.isUen": "organization.isUen",
13290
13565
  "companyRegistrationDetails.stockExchangeMIC": "organization.stockData.marketIdentifier",
13291
13566
  "companyRegistrationDetails.stockISIN": "organization.stockData.stockNumber",
13567
+ "companyRegistrationDetails.stockTickerSymbol": "organization.stockData.tickerSymbol",
13292
13568
  "companyRegistrationAddress.registrationAddress.city": "organization.registeredAddress.city",
13293
13569
  "companyRegistrationAddress.registrationAddress.country": "organization.registeredAddress.country",
13294
13570
  "companyRegistrationAddress.registrationAddress.postalCode": "organization.registeredAddress.postalCode",
@@ -13328,7 +13604,8 @@ const companySearchBaseMapping = {
13328
13604
  "companyOtherDetails.dateOfIncorporation": "organization.dateOfIncorporation",
13329
13605
  "companyOtherDetails.isUen": "organization.isUen",
13330
13606
  "companyOtherDetails.stockExchangeMIC": "organization.stockData.marketIdentifier",
13331
- "companyOtherDetails.stockISIN": "organization.stockData.stockNumber"
13607
+ "companyOtherDetails.stockISIN": "organization.stockData.stockNumber",
13608
+ "companyOtherDetails.stockTickerSymbol": "organization.stockData.tickerSymbol"
13332
13609
  };
13333
13610
  const trustBaseMapping = {
13334
13611
  "trustRegistrationDetails.trustType": "trust.type",
@@ -13370,6 +13647,11 @@ const solePropBaseMapping = {
13370
13647
  "solePropRegistrationAddress.operationalAddress.address": "soleProprietorship.principalPlaceOfBusiness.street",
13371
13648
  "solePropRegistrationAddress.operationalAddress.otherAddressInformation": "soleProprietorship.principalPlaceOfBusiness.street2"
13372
13649
  };
13650
+ const highExposureBaseMapping = {
13651
+ "company.numberOfEmployees": "company.numberOfEmployees",
13652
+ "parentCompany.numberOfEmployees": "parentCompany.numberOfEmployees",
13653
+ "ultimateParentCompany.numberOfEmployees": "ultimateParentCompany.numberOfEmployees"
13654
+ };
13373
13655
  const businessDetailsComponentsKeyMapping = {
13374
13656
  "additionalInformation.exemptedFromVat": "organization.vatAbsenceReason",
13375
13657
  ...businessDetailsBaseMapping
@@ -13403,6 +13685,12 @@ const trustComponentsKeyMapping = {
13403
13685
  const trustApiKeyMapping = {
13404
13686
  ...reverseObject(trustBaseMapping)
13405
13687
  };
13688
+ const highExposureComponentsKeyMapping = {
13689
+ ...highExposureBaseMapping
13690
+ };
13691
+ const highExposureApiKeyMapping = {
13692
+ ...reverseObject(highExposureBaseMapping)
13693
+ };
13406
13694
  const solePropComponentsKeyMapping = {
13407
13695
  "solePropRegistrationDetails.exemptedFromVat": "soleProprietorship.vatAbsenceReason",
13408
13696
  ...solePropBaseMapping
@@ -13743,6 +14031,10 @@ const mapTrustToLegalEntity = (data) => {
13743
14031
  requestObj.type = LegalEntityType.TRUST;
13744
14032
  return requestObj;
13745
14033
  };
14034
+ const mapLegalEntityToHighExposure = (legalEntity) => formatObject(legalEntity, highExposureComponentsKeyMapping);
14035
+ const mapHighExposureToLegalEntity = (data) => ({
14036
+ ...formatObject(data, highExposureApiKeyMapping)
14037
+ });
13746
14038
  const mapLegalEntityToSoleProp = (legalEntity) => {
13747
14039
  var _a, _b, _c, _d, _e, _f, _g, _h;
13748
14040
  let solePropCompData;
@@ -14350,7 +14642,7 @@ const initOnfido = async ({
14350
14642
  language: getOnfidoLocaleConfig(i18n)
14351
14643
  });
14352
14644
  };
14353
- const logger$n = createLogger("IdVerificationComponent");
14645
+ const logger$o = createLogger("IdVerificationComponent");
14354
14646
  function IdVerificationComponent({
14355
14647
  userDetails,
14356
14648
  legalEntityId,
@@ -14382,7 +14674,7 @@ function IdVerificationComponent({
14382
14674
  onIdVerificationError,
14383
14675
  onIdVerificationComplete
14384
14676
  });
14385
- })().catch(logger$n.error);
14677
+ })().catch(logger$o.error);
14386
14678
  return () => {
14387
14679
  if (onfidoSdk.current) onfidoSdk.current.tearDown();
14388
14680
  };
@@ -14432,7 +14724,7 @@ function IdDocumentAlreadyUpload(props) {
14432
14724
  })]
14433
14725
  });
14434
14726
  }
14435
- const logger$m = createLogger("IdDocumentInstantVerificationComponent");
14727
+ const logger$n = createLogger("IdDocumentInstantVerificationComponent");
14436
14728
  const idVerificationSchema = ["instantIdVerificationData", "idDocumentType"];
14437
14729
  const documentTypeValidationRules = {
14438
14730
  instantIdVerificationData: {
@@ -14514,7 +14806,7 @@ function IdDocumentInstantVerificationComponent(props) {
14514
14806
  userDetails: props.userDetails,
14515
14807
  legalEntityId: props.legalEntityId,
14516
14808
  onIdVerificationComplete: handleIdVerificationComplete,
14517
- onIdVerificationError: logger$m.error
14809
+ onIdVerificationError: logger$n.error
14518
14810
  }), jsxs("div", {
14519
14811
  className: "adyen-kyc-document-upload__manual-upload",
14520
14812
  children: [i18n.get("canNotCompleteInstantVerification"), " ", jsx("button", {
@@ -17928,7 +18220,7 @@ class AdyenKycSdkError extends Error {
17928
18220
  }
17929
18221
  let sdkToken;
17930
18222
  let fetchSdkToken;
17931
- const logger$l = createLogger("Session");
18223
+ const logger$m = createLogger("Session");
17932
18224
  const setSdkToken = (token) => {
17933
18225
  sdkToken = token;
17934
18226
  };
@@ -17951,7 +18243,7 @@ const refreshSession = async () => {
17951
18243
  setSdkToken(token);
17952
18244
  isSessionRefreshed = true;
17953
18245
  } catch (e) {
17954
- logger$l.error("Failed to fetch sdk token", e);
18246
+ logger$m.error("Failed to fetch sdk token", e);
17955
18247
  }
17956
18248
  return isSessionRefreshed;
17957
18249
  };
@@ -17961,7 +18253,7 @@ const addAnimationStartListener = (element, listener) => {
17961
18253
  const removeAnimationStartListener = (element, listener) => {
17962
18254
  element.removeEventListener("animationstart", listener, false);
17963
18255
  };
17964
- const logger$k = createLogger("Fetch");
18256
+ const logger$l = createLogger("Fetch");
17965
18257
  const getRequestObject = (options, data) => {
17966
18258
  const {
17967
18259
  headers = [],
@@ -18008,10 +18300,10 @@ const logFetchError = (message, level) => {
18008
18300
  case "info":
18009
18301
  case "warn":
18010
18302
  case "error":
18011
- logger$k[level](message);
18303
+ logger$l[level](message);
18012
18304
  break;
18013
18305
  default:
18014
- logger$k.error(message);
18306
+ logger$l.error(message);
18015
18307
  }
18016
18308
  };
18017
18309
  const handleFetchResponse = async (response, responseType) => {
@@ -18102,7 +18394,7 @@ const RELEVANT_MESSAGE_TYPES = ["account_verification_report_id", "error"];
18102
18394
  const TERMINAL_DATA_PROPS = ["accounts", "error", "reference"];
18103
18395
  const MOUNT_TIMEOUT = 10 * 1e3;
18104
18396
  const TINK_VENDOR = "Tink";
18105
- const logger$j = createLogger("iframeWidget");
18397
+ const logger$k = createLogger("iframeWidget");
18106
18398
  const isObjectData = (data) => typeof data === "object" && !Array.isArray(data) && data !== null;
18107
18399
  const isTerminalMessageData = (data) => isObjectData(data) && Object.entries(data).some(([prop]) => TERMINAL_DATA_PROPS.includes(prop));
18108
18400
  const parseMessageJson = (message) => {
@@ -18120,7 +18412,7 @@ const callbackErrorHandler = async (response) => {
18120
18412
  try {
18121
18413
  await response;
18122
18414
  } catch (ex) {
18123
- logger$j.error(ex);
18415
+ logger$k.error(ex);
18124
18416
  }
18125
18417
  return {
18126
18418
  error: "UNKNOWN_ERROR",
@@ -18223,7 +18515,7 @@ class IFrameWidget {
18223
18515
  message = responseData.errorMessage;
18224
18516
  }
18225
18517
  } catch (ex) {
18226
- logger$j.error(ex);
18518
+ logger$k.error(ex);
18227
18519
  }
18228
18520
  throw new AdyenKycSdkError(reason, jsonData.error);
18229
18521
  }
@@ -18410,7 +18702,7 @@ function BankVerificationWidget({
18410
18702
  ref: widgetContainerRef
18411
18703
  });
18412
18704
  }
18413
- const logger$i = createLogger("BankVerification");
18705
+ const logger$j = createLogger("BankVerification");
18414
18706
  const accountVerificationFields = ["verifiedAccountHolder", "verifiedBankCountry", "verifiedBankName", "verifiedCurrencyCode", "verifiedBankAccountNumber"];
18415
18707
  const InstantVerificationErrorContext = createContext(null);
18416
18708
  const useInstantVerificationErrorNotification = (notificationVisibilityDuration) => {
@@ -18442,7 +18734,7 @@ const usePreferredVendorForCountry = (country2, getBankVerificationVendors) => {
18442
18734
  const vendor = vendors[0];
18443
18735
  setPreferredVendor(vendor.name ? vendor : void 0);
18444
18736
  };
18445
- getPreferredVendor().catch(logger$i.error);
18737
+ getPreferredVendor().catch(logger$j.error);
18446
18738
  }, [country2, getBankVerificationVendors]);
18447
18739
  return preferredVendor;
18448
18740
  };
@@ -18641,6 +18933,12 @@ function BankVerification(props) {
18641
18933
  });
18642
18934
  }
18643
18935
  const BankVerification$1 = memo(BankVerification);
18936
+ const CoreContext = createContext(void 0);
18937
+ const useCoreContext = () => {
18938
+ const context = useContext(CoreContext);
18939
+ if (!context) throw Error("You need a <CoreProvider> to use core context");
18940
+ return context;
18941
+ };
18644
18942
  const countriesWithMultipleCurrencies = /* @__PURE__ */ new Set([CountryCodes.Bulgaria, CountryCodes.Canada, CountryCodes.Croatia, CountryCodes.CzechRepublic, CountryCodes.Hungary, CountryCodes.Romania, CountryCodes.Switzerland]);
18645
18943
  const countriesWithLocalFormat = /* @__PURE__ */ new Set([CountryCodes.Denmark, CountryCodes.Norway, CountryCodes.Poland, CountryCodes.Sweden, CountryCodes.UnitedKingdom]);
18646
18944
  const payoutCurrencySupport = {
@@ -20323,7 +20621,7 @@ function SolePropComponent(props) {
20323
20621
  const [tradingName2, setTradingName] = useState();
20324
20622
  const solePropNameAndCountryFormProps = getFormProps(props, solePropNameAndCountryFormId);
20325
20623
  const solePropsRegistrationDetailsFormProps = getFormProps(props, solePropRegistrationDetailsFormId);
20326
- const solePropRegistrationAddressFormProps = getFormProps(props, solePropRegistrationAddressFormId);
20624
+ const solePropRegistrationAddressFormProps = getNestedOuterFormPropsFromOuterFormProps(props, solePropRegistrationAddressFormId);
20327
20625
  const solePropDocumentsFormProps = getFormProps(props, solePropDocumentFormId);
20328
20626
  const handleStateChange = ({
20329
20627
  currentState
@@ -20920,10 +21218,11 @@ function TrustComponent(props) {
20920
21218
  i18n
20921
21219
  } = useI18nContext();
20922
21220
  const trustRegistrationDetailsFormProps = getFormProps(props, trustRegistrationDetailsFormId);
20923
- const trustRegistrationAddressFormProps = getFormProps(props, trustRegistrationAddressFormId);
21221
+ const trustRegistrationAddressFormProps = getNestedOuterFormPropsFromOuterFormProps(props, trustRegistrationAddressFormId);
20924
21222
  const trustDocumentFormProps = getFormProps(props, trustConstitutionalDocumentFormId);
20925
21223
  const handleStateChange = () => {
20926
21224
  };
21225
+ console.log("trustRegistrationDetailsFormProps", trustRegistrationDetailsFormProps);
20927
21226
  const renderActiveForm = (activeForm) => jsxs("div", {
20928
21227
  className: "adyen-kyc-trust",
20929
21228
  children: [jsx(StateContextWatcher, {
@@ -21596,6 +21895,55 @@ function ErrorPanel({
21596
21895
  })]
21597
21896
  });
21598
21897
  }
21898
+ const headingTypes = {
21899
+ 1: ({
21900
+ children,
21901
+ className
21902
+ }) => jsx("h1", {
21903
+ className,
21904
+ children
21905
+ }),
21906
+ 2: ({
21907
+ children,
21908
+ className
21909
+ }) => jsx("h2", {
21910
+ className,
21911
+ children
21912
+ }),
21913
+ 3: ({
21914
+ children,
21915
+ className
21916
+ }) => jsx("h3", {
21917
+ className,
21918
+ children
21919
+ }),
21920
+ 4: ({
21921
+ children,
21922
+ className
21923
+ }) => jsx("h4", {
21924
+ className,
21925
+ children
21926
+ }),
21927
+ sub: ({
21928
+ children,
21929
+ className
21930
+ }) => jsx("div", {
21931
+ className,
21932
+ children
21933
+ })
21934
+ };
21935
+ function Heading({
21936
+ className,
21937
+ level,
21938
+ children
21939
+ }) {
21940
+ const HeadingElement = headingTypes[level] || headingTypes[1];
21941
+ const classNames = cx("adyen-kyc-heading", `adyen-kyc-heading--${level}`, className);
21942
+ return jsx(HeadingElement, {
21943
+ className: classNames,
21944
+ children
21945
+ });
21946
+ }
21599
21947
  const summaryStep = {
21600
21948
  formId: "summary",
21601
21949
  formName: "summary"
@@ -21622,59 +21970,56 @@ function Summary({
21622
21970
  gotoForm(formIndex);
21623
21971
  }
21624
21972
  };
21625
- const allValidationErrors = (problems == null ? void 0 : problems.validationErrors) && ((_a = Object.values(problems == null ? void 0 : problems.validationErrors)) == null ? void 0 : _a.reduce((acc, validError) => ({
21973
+ const allValidationErrors = (problems == null ? void 0 : problems.validationErrors) && ((_a = Object.values(problems.validationErrors)) == null ? void 0 : _a.reduce((acc, validError) => ({
21626
21974
  ...acc,
21627
21975
  ...validError
21628
21976
  }), {}));
21629
- const allVerificationErrors = (problems == null ? void 0 : problems.verificationErrors) && ((_b = Object.values(problems == null ? void 0 : problems.verificationErrors)) == null ? void 0 : _b.reduce((acc, verifError) => ({
21977
+ const allVerificationErrors = (problems == null ? void 0 : problems.verificationErrors) && ((_b = Object.values(problems.verificationErrors)) == null ? void 0 : _b.reduce((acc, verifError) => ({
21630
21978
  ...acc,
21631
21979
  ...verifError
21632
21980
  }), {}));
21633
21981
  const formUtils = formUtilities({
21634
21982
  labels: labels2
21635
21983
  }, i18n);
21636
- const summaryItemHeader = (formName, formId) => jsxs("ul", {
21637
- className: "adyen-kyc-summary__heading-section",
21638
- children: [jsx("li", {
21639
- children: jsx("span", {
21640
- className: "adyen-kyc-summary__form-heading",
21641
- children: formName
21642
- })
21643
- }), jsx("li", {
21644
- children: jsx(Button, {
21645
- className: "adyen-kyc-summary__edit-form-button",
21646
- ghost: true,
21647
- circle: true,
21648
- tertiary: true,
21649
- icon: "edit",
21650
- onClick: () => {
21651
- trackNavigation2({
21652
- fromForm: {
21653
- formName: "summary",
21654
- formId: "summary"
21655
- },
21656
- toForm: {
21657
- formId,
21658
- formName
21659
- },
21660
- component: "Pencil icon"
21661
- });
21662
- editForm(formId);
21663
- },
21664
- title: i18n.get("edit"),
21665
- label: i18n.get("edit"),
21666
- labelHoverBox: true
21667
- })
21984
+ const summarySectionHeader = (formName, formId) => jsxs("header", {
21985
+ className: "adyen-kyc-summary-section__header",
21986
+ children: [jsx(Heading, {
21987
+ level: 4,
21988
+ className: "adyen-kyc-summary-section__heading",
21989
+ children: formName
21990
+ }), jsx(Button, {
21991
+ className: "adyen-kyc-summary-section__edit-button",
21992
+ ghost: true,
21993
+ circle: true,
21994
+ tertiary: true,
21995
+ icon: "edit",
21996
+ onClick: () => {
21997
+ trackNavigation2({
21998
+ fromForm: {
21999
+ formName: "summary",
22000
+ formId: "summary"
22001
+ },
22002
+ toForm: {
22003
+ formId,
22004
+ formName
22005
+ },
22006
+ component: "Pencil icon"
22007
+ });
22008
+ editForm(formId);
22009
+ },
22010
+ title: i18n.get("edit"),
22011
+ label: i18n.get("edit"),
22012
+ labelHoverBox: true
21668
22013
  })]
21669
22014
  });
21670
- const renderSummaryItem = (fieldData, labelData, formName, formId) => jsxs("li", {
21671
- className: "adyen-kyc-summary__item",
21672
- children: [summaryItemHeader(formName, formId), jsx("ul", {
21673
- className: "adyen-kyc-summary__content-section",
21674
- children: renderFormData(fieldData, labelData)
22015
+ const renderSummarySection = (fieldData, labelData, formName, formId) => jsxs("section", {
22016
+ className: "adyen-kyc-summary-section",
22017
+ children: [summarySectionHeader(formName, formId), jsx("dl", {
22018
+ className: "adyen-kyc-summary-section__content",
22019
+ children: renderSummaryItems(fieldData, labelData)
21675
22020
  })]
21676
22021
  });
21677
- const renderSummary = (data2) => {
22022
+ const renderSummaryContent = (data2) => {
21678
22023
  const summaryList = [];
21679
22024
  forms2.forEach(({
21680
22025
  formId,
@@ -21682,53 +22027,44 @@ function Summary({
21682
22027
  }) => {
21683
22028
  const currentFormData = data2[formId];
21684
22029
  const isFormEmpty = !currentFormData || Object.values(currentFormData).every((value) => isEmpty(value));
21685
- if (isFormEmpty || formId === summaryStep.formId || omittedForms.includes(formId)) {
21686
- return;
21687
- }
21688
- 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;
22030
+ if (isFormEmpty || formId === summaryStep.formId || omittedForms.includes(formId)) return;
22031
+ 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);
21689
22032
  summaryList.push(summaryItems);
21690
22033
  });
21691
22034
  return summaryList;
21692
22035
  };
21693
22036
  const renderInnerForms = (labelData, parentFormId, innerForms = {}) => {
22037
+ if (!innerForms) return [];
21694
22038
  const dataList = [];
21695
- if (innerForms) {
21696
- Object.entries(innerForms).forEach(([innerFormName, innerFormFieldData]) => {
21697
- const formName = i18n.get(labelData == null ? void 0 : labelData[innerFormName]) || i18n.get(innerFormName);
21698
- if (typeof innerFormFieldData === "object" && innerFormFieldData !== null) {
21699
- dataList.push(renderSummaryItem(innerFormFieldData, labelData, formName, parentFormId));
21700
- }
21701
- });
21702
- }
22039
+ Object.entries(innerForms).forEach(([innerFormName, innerFormFieldData]) => {
22040
+ const formName = i18n.get(labelData == null ? void 0 : labelData[innerFormName]) || i18n.get(innerFormName);
22041
+ if (typeof innerFormFieldData === "object" && innerFormFieldData !== null) {
22042
+ dataList.push(renderSummarySection(innerFormFieldData, labelData, formName, parentFormId));
22043
+ }
22044
+ });
21703
22045
  return dataList;
21704
22046
  };
21705
- const renderFormData = (formData = {}, labelData = {}) => {
22047
+ const renderSummaryItems = (formData = {}, labelData = {}) => {
22048
+ if (!formData) return [];
21706
22049
  const dataList = [];
21707
- if (formData) {
21708
- Object.entries(formData).forEach(([field, fieldData]) => {
21709
- const fieldName = i18n.get(labelData[field]) || i18n.get(field);
21710
- if (typeof fieldData === "object" && fieldData !== null && !(omittedKeys == null ? void 0 : omittedKeys.includes(field))) {
21711
- dataList.push(jsx("li", {
21712
- className: "adyen-kyc-summary__item-nested",
21713
- children: jsx("ul", {
21714
- className: "adyen-kyc-summary__content-section-nested",
21715
- children: renderFormData(fieldData, labelData)
21716
- })
21717
- }));
21718
- } else if (typeof fieldData === "string" && !(omittedKeys == null ? void 0 : omittedKeys.includes(field))) {
21719
- dataList.push(jsxs("li", {
21720
- className: "adyen-kyc-summary__data-item",
21721
- children: [jsx("span", {
21722
- className: "adyen-kyc-summary__field",
21723
- children: fieldName
21724
- }), jsx("span", {
21725
- className: "adyen-kyc-summary__data",
21726
- children: fieldData
21727
- })]
21728
- }));
21729
- }
21730
- });
21731
- }
22050
+ Object.entries(formData).forEach(([field, fieldData]) => {
22051
+ if ((omittedKeys == null ? void 0 : omittedKeys.includes(field)) || !fieldData) return;
22052
+ const fieldName = i18n.get(labelData[field]) || i18n.get(field);
22053
+ if (typeof fieldData === "object") {
22054
+ dataList.push(renderSummaryItems(fieldData, labelData));
22055
+ } else if (typeof fieldData === "string") {
22056
+ dataList.push(jsxs("div", {
22057
+ className: "adyen-kyc-summary-section__field",
22058
+ children: [jsx("dt", {
22059
+ className: "adyen-kyc-summary-section__label",
22060
+ children: fieldName
22061
+ }), jsx("dd", {
22062
+ className: "adyen-kyc-summary-section__data",
22063
+ children: fieldData
22064
+ })]
22065
+ }));
22066
+ }
22067
+ });
21732
22068
  return dataList;
21733
22069
  };
21734
22070
  return jsxs("div", {
@@ -21742,9 +22078,9 @@ function Summary({
21742
22078
  verificationErrors: allVerificationErrors,
21743
22079
  formUtils,
21744
22080
  id: "ariaErrorField"
21745
- }), jsx("ul", {
21746
- className: "adyen-kyc-summary",
21747
- children: renderSummary(data)
22081
+ }), jsx("div", {
22082
+ className: "adyen-kyc-summary__content",
22083
+ children: renderSummaryContent(data)
21748
22084
  }), showLegalCaption && jsx("span", {
21749
22085
  className: "adyen-kyc-summary__legal-caption",
21750
22086
  children: i18n.get("summaryLegalCaption")
@@ -21974,7 +22310,7 @@ const defaultPayoutAccountFormat = {
21974
22310
  [CountryCodes.Sweden]: "local",
21975
22311
  [CountryCodes.UnitedKingdom]: "local"
21976
22312
  };
21977
- const logger$h = createLogger("useScenarioConfiguration");
22313
+ const logger$i = createLogger("useScenarioConfiguration");
21978
22314
  const useScenarioConfiguration = ({
21979
22315
  getConfigurationData,
21980
22316
  getPayoutAccountFormatData,
@@ -21997,12 +22333,12 @@ const useScenarioConfiguration = ({
21997
22333
  const response = await getConfigurationData();
21998
22334
  setConfigurationResponse(response);
21999
22335
  } catch (err) {
22000
- logger$h.warn("WARNING: Configuration request failed - error:", err);
22336
+ logger$i.warn("WARNING: Configuration request failed - error:", err);
22001
22337
  } finally {
22002
22338
  setLoadingStatus("success");
22003
22339
  }
22004
22340
  };
22005
- makeConfigCallAndSave().catch(logger$h.error);
22341
+ makeConfigCallAndSave().catch(logger$i.error);
22006
22342
  }, [getConfigurationData, setLoadingStatus]);
22007
22343
  useEffect(() => {
22008
22344
  setLoadingStatus("loading");
@@ -22019,12 +22355,12 @@ const useScenarioConfiguration = ({
22019
22355
  const defaultAccountFormat = defaultPayoutAccountFormat[country2] ?? allowedBankAccountFormats[0];
22020
22356
  setAccountFormat(existingBankAccountFormat ?? defaultAccountFormat);
22021
22357
  } catch (err) {
22022
- logger$h.warn("WARNING: Payout format request failed - error:", err);
22358
+ logger$i.warn("WARNING: Payout format request failed - error:", err);
22023
22359
  } finally {
22024
22360
  setLoadingStatus("success");
22025
22361
  }
22026
22362
  };
22027
- makePayoutFormatCallAndSave().catch(logger$h.error);
22363
+ makePayoutFormatCallAndSave().catch(logger$i.error);
22028
22364
  }, [country2, setAccountFormat, getPayoutAccountFormatData, setLoadingStatus, existingBankAccountFormat]);
22029
22365
  const {
22030
22366
  fieldConfigurations,
@@ -22193,10 +22529,13 @@ const solePropBase = {
22193
22529
  rule: "REQUIRED"
22194
22530
  },
22195
22531
  stockExchangeMIC: {
22196
- rule: "stockExchangeMICIfTypePublic"
22532
+ rule: "ifPubliclyTradedCompany"
22197
22533
  },
22198
22534
  stockISIN: {
22199
- rule: "stockISINIfTypePublic"
22535
+ rule: "ifPubliclyTradedCompany"
22536
+ },
22537
+ stockTickerSymbol: {
22538
+ rule: "ifPubliclyTradedCompany"
22200
22539
  },
22201
22540
  tradingName: {
22202
22541
  rule: "REQUIRED"
@@ -22320,6 +22659,10 @@ function parseTrustScenarios(scenario, country2) {
22320
22659
  return fieldConfigurations;
22321
22660
  }
22322
22661
  }
22662
+ const parseHighExposureScenarios = (scenario) => scenario == null ? void 0 : scenario.reduce((scenarios, scenarioName) => ({
22663
+ ...scenarios,
22664
+ ...fieldsPerScenario$1[scenarioName]
22665
+ }), {});
22323
22666
  function parseSolePropScenarios(scenario, country2) {
22324
22667
  if (scenario) {
22325
22668
  let fieldConfigurations = scenario.reduce((scenarios, scenarioName) => ({
@@ -23122,7 +23465,7 @@ function VatNumberField({
23122
23465
  }
23123
23466
  const BUSINESS_NAME_FIELD = ["businessName"];
23124
23467
  const basicInformationFields = [...COUNTRY_FIELD, ...BUSINESS_NAME_FIELD, ...STATE_FIELD, ...TAX_INFORMATION_FIELD, ...BUSINESS_REGISTRATION_NUMBER_FIELD];
23125
- 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];
23468
+ 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];
23126
23469
  const FIELDS_NEEDED_FOR_COMPANY_SEARCH = [...BUSINESS_NAME_FIELD, ...TAX_INFORMATION_FIELD, ...BUSINESS_REGISTRATION_NUMBER_FIELD];
23127
23470
  const getForms = (country2) => ({
23128
23471
  basicInformation: {
@@ -23600,7 +23943,7 @@ const useExpiryThreshold = (expiry) => {
23600
23943
  };
23601
23944
  };
23602
23945
  const ExpiryContext = createContext(false);
23603
- const logger$g = createLogger("ExpiryProvider");
23946
+ const logger$h = createLogger("ExpiryProvider");
23604
23947
  const ExpiryProvider = ({
23605
23948
  expiry: initialExpiry,
23606
23949
  eventEmitter,
@@ -23633,7 +23976,7 @@ const ExpiryProvider = ({
23633
23976
  refreshExpiry().then((newExpiry) => {
23634
23977
  setExpiry(newExpiry);
23635
23978
  setModalDismissed(false);
23636
- }).catch(logger$g.error);
23979
+ }).catch(logger$h.error);
23637
23980
  }
23638
23981
  }), children]
23639
23982
  });
@@ -23653,7 +23996,7 @@ const ExpiryProvider = ({
23653
23996
  });
23654
23997
  };
23655
23998
  const useHasExpired = () => useContext(ExpiryContext);
23656
- const logger$f = createLogger("FormRouterContextProvider");
23999
+ const logger$g = createLogger("FormRouterContextProvider");
23657
24000
  function FormRouterContextProvider({
23658
24001
  children,
23659
24002
  forms: forms2,
@@ -23673,7 +24016,7 @@ function FormRouterContextProvider({
23673
24016
  if (formIndex > -1) {
23674
24017
  setFormIndex(formIndex);
23675
24018
  } else {
23676
- logger$f.error("No form was found to have that field so form navigation failed.");
24019
+ logger$g.error("No form was found to have that field so form navigation failed.");
23677
24020
  }
23678
24021
  }
23679
24022
  }), [forms2, handleGetIdVerificationToken, setFormIndex]);
@@ -23838,7 +24181,7 @@ const FormWrapper = ({
23838
24181
  isExperimentEnabled
23839
24182
  } = useExperimentsContext();
23840
24183
  const showExtraTaxExemptionReasons = isExperimentEnabled(ExperimentNames.ShowExtraTaxExemptionReasons);
23841
- const showTaxExemptedLegalCaption = showExtraTaxExemptionReasons && ((_a = summaryData.companyRegistrationDetails) == null ? void 0 : _a.vatAbsenceReason);
24184
+ const showTaxExemptedLegalCaption = showExtraTaxExemptionReasons && ((_a = summaryData.companyRegistrationDetails) == null ? void 0 : _a.vatAbsenceReason) && ["companyDetails"].includes(taskName);
23842
24185
  const summaryContent = jsx("div", {
23843
24186
  className: "adyen-kyc-form-wrapper",
23844
24187
  children: jsx(Summary, {
@@ -23935,11 +24278,16 @@ const validateErrorCode = (error, errorCode) => error && "errorCode" in error &&
23935
24278
  const isValidationError = (error) => validateErrorCode(error, API_VALIDATION_ERROR_CODE);
23936
24279
  const isIdDocumentUploadError = (error) => validateErrorCode(error, ID_DOCUMENT_UPLOAD_ERROR_CODE);
23937
24280
  const isBankStatementUploadError = (error) => validateErrorCode(error, BANK_STATEMENT_UPLOAD_ERROR_CODE);
23938
- const processValidationErrors = (validationError, dropinTask) => {
24281
+ const processValidationErrors = (validationError, dropinTask, keyMappings) => {
23939
24282
  if ((validationError == null ? void 0 : validationError.invalidFields) && (validationError == null ? void 0 : validationError.invalidFields.length) > 0) {
23940
24283
  return validationError == null ? void 0 : validationError.invalidFields.reduce((acc, invalidField) => {
23941
24284
  if (invalidField == null ? void 0 : invalidField.name) {
23942
- const mappedFieldPath = mapField(invalidField == null ? void 0 : invalidField.name, dropinTask);
24285
+ let mappedFieldPath = mapField(invalidField == null ? void 0 : invalidField.name, dropinTask);
24286
+ if (keyMappings) {
24287
+ mappedFieldPath = {
24288
+ ...keyMappings
24289
+ };
24290
+ }
23943
24291
  if (mappedFieldPath) {
23944
24292
  assignToProp(mappedFieldPath, acc, true);
23945
24293
  }
@@ -24001,7 +24349,7 @@ const mapBusinessDetailsSchemaToLegalEntity = (data) => {
24001
24349
  return requestObj;
24002
24350
  };
24003
24351
  const MANDATORY_API_FIELDS = ["basicInformation.legalCompanyName", "basicInformation.country"];
24004
- const parseConfiguration$6 = ({
24352
+ const parseConfiguration$7 = ({
24005
24353
  country: country2,
24006
24354
  matchingScenario
24007
24355
  }) => parseBusinessDetailsScenarios(matchingScenario == null ? void 0 : matchingScenario[LegalEntityType.ORGANIZATION], country2);
@@ -24017,15 +24365,7 @@ const formatDataForSummary$1 = (data, forms2, labels2, i18n) => {
24017
24365
  if (!form) return summaryData;
24018
24366
  switch (form) {
24019
24367
  case "basicInformation":
24020
- return {
24021
- ...summaryData,
24022
- [form]: formData
24023
- };
24024
24368
  case "companyStructure":
24025
- return {
24026
- ...summaryData,
24027
- [form]: formData
24028
- };
24029
24369
  case "additionalInformation":
24030
24370
  return {
24031
24371
  ...summaryData,
@@ -24261,7 +24601,7 @@ function BusinessDetailsDropinComponent({
24261
24601
  const {
24262
24602
  fieldConfigurations
24263
24603
  } = useScenarioConfiguration({
24264
- parseConfiguration: parseConfiguration$6,
24604
+ parseConfiguration: parseConfiguration$7,
24265
24605
  getConfigurationData,
24266
24606
  setLoadingStatus,
24267
24607
  country: currentCountry
@@ -24548,7 +24888,7 @@ const getTargetLegalEntityType = (businessType, legalArrangement, trusteeType, c
24548
24888
  return currentLegalEntityType;
24549
24889
  };
24550
24890
  const isLegalArrangementOrganizationSubtype = (legalArrangementOption) => legalArrangementOption === "partnershipIncorporated" || legalArrangementOption === "associationIncorporated";
24551
- const parseConfiguration$5 = ({
24891
+ const parseConfiguration$6 = ({
24552
24892
  country: country2,
24553
24893
  matchingScenario
24554
24894
  }) => parseCompanyScenarios(matchingScenario == null ? void 0 : matchingScenario[LegalEntityType.ORGANIZATION], country2);
@@ -24597,10 +24937,13 @@ function CompanyDropinComponent({
24597
24937
  handleUpdateLegalEntity,
24598
24938
  handleHomeClick,
24599
24939
  onTypeSwitch,
24600
- onChange,
24601
- accountHolder: accountHolder2
24940
+ onChange
24602
24941
  }) {
24603
24942
  var _a, _b;
24943
+ const {
24944
+ accountHolder: accountHolder2,
24945
+ setAccountHolder
24946
+ } = useCoreContext();
24604
24947
  const {
24605
24948
  showToast,
24606
24949
  clearToasts
@@ -24645,7 +24988,7 @@ function CompanyDropinComponent({
24645
24988
  fieldConfigurations,
24646
24989
  requiredFields
24647
24990
  } = useScenarioConfiguration({
24648
- parseConfiguration: parseConfiguration$5,
24991
+ parseConfiguration: parseConfiguration$6,
24649
24992
  getConfigurationData,
24650
24993
  setLoadingStatus,
24651
24994
  country: country2
@@ -24732,7 +25075,8 @@ function CompanyDropinComponent({
24732
25075
  legalEntityName: dataSubmitted.companyNameAndCountry.legalCompanyName,
24733
25076
  usedAdditionalAddress: dataSubmitted.companyRegistrationAddress.operationalAddressIsSame === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME
24734
25077
  };
24735
- legalEntity.entityAssociations = filterOutUnwantedAssociationsIfRootLE(taskType, legalEntityResponse, dataSubmitted.companyType.accountHolder);
25078
+ const newAccountHolder = dataSubmitted.companyType.accountHolder ?? accountHolder2;
25079
+ legalEntity.entityAssociations = filterOutUnwantedAssociationsIfRootLE(taskType, legalEntityResponse, newAccountHolder);
24736
25080
  if (!isCountryOfGoverningLawEnabled && ((_a2 = legalEntity.organization) == null ? void 0 : _a2.countryOfGoverningLaw)) {
24737
25081
  delete legalEntity.organization.countryOfGoverningLaw;
24738
25082
  }
@@ -24748,6 +25092,7 @@ function CompanyDropinComponent({
24748
25092
  } else {
24749
25093
  legalEntity = await handleUpdateLegalEntity(drop("type").from(legalEntity), legalEntityResponse.id);
24750
25094
  }
25095
+ setAccountHolder(newAccountHolder);
24751
25096
  userEvents.addEvent("Saved company details", {
24752
25097
  segmentation: {
24753
25098
  ...baseTrackingPayload,
@@ -24826,33 +25171,32 @@ function CompanyDropinComponent({
24826
25171
  }, []);
24827
25172
  const datasetUtils = datasetUtilities(i18n.locale);
24828
25173
  const formatDataForSummary2 = (data2, forms22) => {
24829
- var _a2, _b2, _c, _d, _e, _f, _g, _h;
25174
+ var _a2, _b2, _c, _d, _e, _f;
24830
25175
  let summaryData = cloneObject(data2);
24831
- if ((_a2 = summaryData == null ? void 0 : summaryData.companyNameAndCountry) == null ? void 0 : _a2.country) {
24832
- summaryData.companyNameAndCountry.countryRegionOfEstablishment = datasetUtils.getCountryName(summaryData.companyNameAndCountry.country);
25176
+ if (summaryData.companyNameAndCountry) {
25177
+ if (isCountryOfGoverningLawEnabled) {
25178
+ summaryData.companyNameAndCountry = getUpdatedCountryOfGoverningLaw(summaryData.companyNameAndCountry);
25179
+ } else {
25180
+ summaryData.companyNameAndCountry.country = datasetUtils.getCountryName(summaryData.companyNameAndCountry.country);
25181
+ }
25182
+ summaryData.companyNameAndCountry.countryRegionOfEstablishment = summaryData.companyNameAndCountry.country;
24833
25183
  delete summaryData.companyNameAndCountry.country;
24834
25184
  }
24835
- if (isCountryOfGoverningLawEnabled) {
24836
- summaryData.companyNameAndCountry = getUpdatedCountryOfGoverningLaw(summaryData.companyNameAndCountry);
24837
- }
24838
- if ((_b2 = summaryData == null ? void 0 : summaryData.companyType) == null ? void 0 : _b2.entityType) {
24839
- const companyType2 = (_c = companyTypes.find((companyType22) => {
24840
- var _a3;
24841
- return companyType22.id === ((_a3 = summaryData.companyType) == null ? void 0 : _a3.entityType);
24842
- })) == null ? void 0 : _c.name;
25185
+ if ((_a2 = summaryData.companyType) == null ? void 0 : _a2.entityType) {
25186
+ const companyType2 = (_b2 = companyTypes.find((type) => type.id === summaryData.companyType.entityType)) == null ? void 0 : _b2.name;
24843
25187
  summaryData.companyType.entityType = i18n.get(companyType2);
24844
25188
  }
24845
- if ((_d = summaryData == null ? void 0 : summaryData.companyType) == null ? void 0 : _d.accountHolder) {
24846
- summaryData.companyType.accountHolder = i18n.get((_e = summaryData == null ? void 0 : summaryData.companyType) == null ? void 0 : _e.accountHolder);
25189
+ if ((_c = summaryData.companyType) == null ? void 0 : _c.accountHolder) {
25190
+ summaryData.companyType.accountHolder = i18n.get(summaryData.companyType.accountHolder);
24847
25191
  }
24848
- if ((_f = summaryData == null ? void 0 : summaryData.companyRegistrationAddress) == null ? void 0 : _f.registrationAddress) {
25192
+ if ((_d = summaryData.companyRegistrationAddress) == null ? void 0 : _d.registrationAddress) {
24849
25193
  summaryData.companyRegistrationAddress.hasInnerForms = true;
24850
- summaryData.companyRegistrationAddress.registrationAddress = mapAddressLabels(summaryData == null ? void 0 : summaryData.companyRegistrationAddress.registrationAddress, datasetUtils);
25194
+ summaryData.companyRegistrationAddress.registrationAddress = mapAddressLabels(summaryData.companyRegistrationAddress.registrationAddress, datasetUtils);
24851
25195
  }
24852
- if ((_g = summaryData == null ? void 0 : summaryData.companyRegistrationAddress) == null ? void 0 : _g.operationalAddress) {
24853
- summaryData.companyRegistrationAddress.operationalAddress = mapAddressLabels(summaryData == null ? void 0 : summaryData.companyRegistrationAddress.operationalAddress, datasetUtils);
25196
+ if ((_e = summaryData.companyRegistrationAddress) == null ? void 0 : _e.operationalAddress) {
25197
+ summaryData.companyRegistrationAddress.operationalAddress = mapAddressLabels(summaryData.companyRegistrationAddress.operationalAddress, datasetUtils);
24854
25198
  }
24855
- if ((_h = summaryData.companyRegistrationDetails) == null ? void 0 : _h.vatAbsenceReason) {
25199
+ if ((_f = summaryData.companyRegistrationDetails) == null ? void 0 : _f.vatAbsenceReason) {
24856
25200
  const vatAbsenceReason2 = vatAbsenceReasons.find((absenceReason) => absenceReason === summaryData.companyRegistrationDetails.vatAbsenceReason);
24857
25201
  if (vatAbsenceReason2) {
24858
25202
  summaryData.companyRegistrationDetails.vatAbsenceReason = i18n.get(vatAbsenceReason2);
@@ -24934,7 +25278,7 @@ var CompanySearchEvents = /* @__PURE__ */ ((CompanySearchEvents2) => {
24934
25278
  CompanySearchEvents2["SELECTION_ERROR"] = "CompanySearch_CompanySelectionError";
24935
25279
  return CompanySearchEvents2;
24936
25280
  })(CompanySearchEvents || {});
24937
- const logger$e = createLogger("useCompanySearch");
25281
+ const logger$f = createLogger("useCompanySearch");
24938
25282
  const LOW_RISK_COMPANY_DATA_COMPLIANCE_WINDOW = 1577664e5;
24939
25283
  function useCompanySearch({
24940
25284
  defaultData,
@@ -25058,7 +25402,7 @@ function useCompanySearch({
25058
25402
  state: companyData.state ?? stateOrProvince2
25059
25403
  });
25060
25404
  } catch (e) {
25061
- logger$e.error(e);
25405
+ logger$f.error(e);
25062
25406
  setError(e);
25063
25407
  setStatus("error");
25064
25408
  } finally {
@@ -25091,7 +25435,7 @@ function useCompanySearch({
25091
25435
  indexSearch: handleCompanyIndexSearch,
25092
25436
  deepSearch: handleCompanyDeepSearch,
25093
25437
  resultsLimit: limit
25094
- })) == null ? void 0 : _a.catch((e) => logger$e.error(e));
25438
+ })) == null ? void 0 : _a.catch((e) => logger$f.error(e));
25095
25439
  }
25096
25440
  }, [legalCompanyName2, country2, stateOrProvince2, taxIdentificationNumber2, verifiedCompany, searchCompanies, handleCompanyIndexSearch, handleCompanyDeepSearch, limit, canVerify, baseTrackingPayload]);
25097
25441
  useEffect(() => {
@@ -25550,10 +25894,12 @@ const defaultFieldMetadata = defaultFieldMetadata$7;
25550
25894
  const defaultFieldConfig = entriesOf(defaultFieldConfig$7).reduce((fieldConfig, [country2, countryEntry]) => ({
25551
25895
  ...fieldConfig,
25552
25896
  [country2]: ({
25553
- taxIdNumberType
25897
+ taxIdNumberType,
25898
+ companyType: companyType2
25554
25899
  }) => {
25555
25900
  const fieldMetadata = resolveFieldMetadata(countryEntry, {
25556
- taxIdNumberType
25901
+ taxIdNumberType,
25902
+ companyType: companyType2
25557
25903
  }, defaultFieldMetadata$7);
25558
25904
  const taxIdValidators = fieldMetadata.validators ? Array.isArray(fieldMetadata.validators) ? fieldMetadata.validators : [fieldMetadata.validators] : [];
25559
25905
  const mappedValidators = taxIdValidators.map((validator) => ({
@@ -25620,7 +25966,7 @@ function CompanyBasics({
25620
25966
  const [loading2, setLoading] = useState$1(false);
25621
25967
  const allowedCountries = useAllowedCountries();
25622
25968
  const existingTaxId = (_b = (_a = data == null ? void 0 : data.taxInformation) == null ? void 0 : _a.find((taxId2) => taxId2.country === country2)) == null ? void 0 : _b.number;
25623
- const defaultTaxIdNumberType = existingTaxId ? inferTaxIdNumberType(existingTaxId, country2) : (_c = getTaxIdNumberOptions(country2, companyType2)) == null ? void 0 : _c[0].id;
25969
+ const defaultTaxIdNumberType = existingTaxId ? inferTaxIdNumberType(existingTaxId, country2, companyType2) : (_c = getTaxIdNumberOptions(country2, companyType2)) == null ? void 0 : _c[0].id;
25624
25970
  const [taxIdNumberType, setTaxIdNumberType] = useState$1(defaultTaxIdNumberType);
25625
25971
  const initialFormUtilsProps = useMemo$1(() => ({
25626
25972
  allFields,
@@ -25664,7 +26010,8 @@ function CompanyBasics({
25664
26010
  };
25665
26011
  case "taxInformation":
25666
26012
  return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig[country2], {
25667
- taxIdNumberType
26013
+ taxIdNumberType,
26014
+ companyType: companyType2
25668
26015
  }, defaultFieldMetadata), acc);
25669
26016
  default:
25670
26017
  return acc;
@@ -25811,7 +26158,7 @@ const TradingNameFieldValidation = () => ({
25811
26158
  }]
25812
26159
  });
25813
26160
  const COMPANY_OTHER_DETAILS_FORM_ID = "companyOtherDetails";
25814
- 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];
26161
+ 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];
25815
26162
  function CompanyOtherDetails({
25816
26163
  data,
25817
26164
  labels: labels2,
@@ -25842,12 +26189,12 @@ function CompanyOtherDetails({
25842
26189
  const registrationNumberOptions = useMemo$1(() => getCompanyRegistrationNumberOptions(country2, companyType2), [country2, companyType2]);
25843
26190
  const defaultRegistrationNumberType = (data == null ? void 0 : data.registrationNumber) ? inferCompanyRegistrationNumberType(data == null ? void 0 : data.registrationNumber, country2, companyType2) : registrationNumberOptions == null ? void 0 : registrationNumberOptions[0].id;
25844
26191
  const [registrationNumberType, setRegistrationNumberType] = useState$1(defaultRegistrationNumberType);
25845
- 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;
26192
+ 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;
25846
26193
  const [vatNumberType, setVatNumberType] = useState$1(defaultVatNumberType);
25847
26194
  const existingTaxId = (_c = (_b = data == null ? void 0 : data.taxInformation) == null ? void 0 : _b.find((taxId2) => taxId2.country === country2)) == null ? void 0 : _c.number;
25848
- const defaultTaxIdNumberType = existingTaxId ? inferTaxIdNumberType(existingTaxId, country2) : (_d = getTaxIdNumberOptions(country2, companyType2)) == null ? void 0 : _d[0].id;
26195
+ const defaultTaxIdNumberType = existingTaxId ? inferTaxIdNumberType(existingTaxId, country2, companyType2) : (_d = getTaxIdNumberOptions(country2, companyType2)) == null ? void 0 : _d[0].id;
25849
26196
  const [taxIdNumberType, setTaxIdNumberType] = useState$1(defaultTaxIdNumberType);
25850
- const directChildFields = companyOtherDetailsFields.filter((field) => ["tradingName", "sameNameAsLegalName", "stockExchangeMIC", "stockISIN", "dateOfIncorporation"].includes(field));
26197
+ const directChildFields = companyOtherDetailsFields.filter((field) => ["tradingName", "sameNameAsLegalName", "stockExchangeMIC", "stockISIN", "stockTickerSymbol", "dateOfIncorporation"].includes(field));
25851
26198
  const initialFormUtilsProps = useMemo$1(() => ({
25852
26199
  allFields,
25853
26200
  labels: labels2,
@@ -25884,6 +26231,8 @@ function CompanyOtherDetails({
25884
26231
  return mergeFieldMetadataIntoProps("stockExchangeMIC", stockExchangeMICFieldMetadata, acc);
25885
26232
  case "stockISIN":
25886
26233
  return mergeFieldMetadataIntoProps("stockISIN", stockISINFieldMetadata, acc);
26234
+ case "stockTickerSymbol":
26235
+ return mergeFieldMetadataIntoProps("stockTickerSymbol", stockTickerSymbolFieldMetadata, acc);
25887
26236
  case "registrationNumber":
25888
26237
  return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig$8[country2], {
25889
26238
  companyType: companyType2,
@@ -25891,7 +26240,8 @@ function CompanyOtherDetails({
25891
26240
  }, defaultFieldMetadata$8), acc);
25892
26241
  case "taxInformation":
25893
26242
  return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig[country2], {
25894
- taxIdNumberType
26243
+ taxIdNumberType,
26244
+ companyType: companyType2
25895
26245
  }, defaultFieldMetadata), acc);
25896
26246
  case "vatNumber":
25897
26247
  return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig$6[country2], {
@@ -26057,6 +26407,19 @@ function CompanyOtherDetails({
26057
26407
  readonly: formUtils.isReadOnly("stockISIN"),
26058
26408
  handleChangeFor
26059
26409
  })
26410
+ }), formUtils.isRequiredField("stockTickerSymbol") && jsx("div", {
26411
+ className: "adyen-kyc-field-wrapper",
26412
+ children: jsx(StockTickerSymbolField, {
26413
+ data: formUtils.getFieldData(formData, STOCK_TICKER_SYMBOL_FIELD),
26414
+ valid: formUtils.getFieldValid(formValid, STOCK_TICKER_SYMBOL_FIELD),
26415
+ errors: formUtils.getFieldErrors(formErrors, formFieldProblems, STOCK_TICKER_SYMBOL_FIELD),
26416
+ labels: formUtils.getFieldLabels(STOCK_TICKER_SYMBOL_FIELD),
26417
+ placeholders: formUtils.getFieldPlaceholders(STOCK_TICKER_SYMBOL_FIELD),
26418
+ mask: formUtils.getMask("stockTickerSymbol"),
26419
+ guidanceText: formUtils.getFieldGuidanceText(STOCK_TICKER_SYMBOL_FIELD),
26420
+ readonly: formUtils.isReadOnly("stockTickerSymbol"),
26421
+ handleChangeFor
26422
+ })
26060
26423
  })]
26061
26424
  })]
26062
26425
  });
@@ -26100,7 +26463,7 @@ const forms = {
26100
26463
  fields: ["taxDocument"]
26101
26464
  }
26102
26465
  };
26103
- const parseConfiguration$4 = ({
26466
+ const parseConfiguration$5 = ({
26104
26467
  country: country2,
26105
26468
  matchingScenario
26106
26469
  }) => parseCompanySearchScenarios(matchingScenario == null ? void 0 : matchingScenario[LegalEntityType.ORGANIZATION], country2);
@@ -26130,7 +26493,8 @@ const formatDataForSummary = (data, forms2, labels2, i18n) => {
26130
26493
  const datasetUtils = datasetUtilities(i18n.locale);
26131
26494
  const country2 = (_a = data.companyBasics) == null ? void 0 : _a.country;
26132
26495
  const taxIdLabel = resolveFieldMetadata(defaultFieldConfig[country2], {
26133
- taxIdNumberType: countryToTaxInfoTypeMap[country2]
26496
+ taxIdNumberType: countryToTaxInfoTypeMap[country2],
26497
+ companyType: void 0
26134
26498
  }, defaultFieldMetadata).label;
26135
26499
  return entriesOf(data).reduce((summaryData, [form, formData]) => {
26136
26500
  var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j;
@@ -26318,7 +26682,7 @@ const mapLegalEntityToCompanySearchSchema = (legalEntity, isChangingType, accoun
26318
26682
  }
26319
26683
  }, {});
26320
26684
  };
26321
- const logger$d = createLogger("useFormTaskSubmit");
26685
+ const logger$e = createLogger("useFormTaskSubmit");
26322
26686
  function useCompanySearchTaskSubmit({
26323
26687
  task,
26324
26688
  forms: forms2,
@@ -26361,7 +26725,7 @@ function useCompanySearchTaskSubmit({
26361
26725
  });
26362
26726
  }
26363
26727
  } catch (e) {
26364
- logger$d.error(e);
26728
+ logger$e.error(e);
26365
26729
  userEvents.addEvent(CompanySearchEvents.DOCUMENTS_ERROR, {
26366
26730
  segmentation: {
26367
26731
  ...baseTrackingPayload,
@@ -26413,7 +26777,7 @@ function useCompanySearchTaskSubmit({
26413
26777
  ...trackingPayload
26414
26778
  }
26415
26779
  });
26416
- logger$d.log(submittedLegalEntity);
26780
+ logger$e.log(submittedLegalEntity);
26417
26781
  clearToasts();
26418
26782
  onExternalSubmit == null ? void 0 : onExternalSubmit(data);
26419
26783
  } catch (e) {
@@ -26437,7 +26801,7 @@ function useCompanySearchTaskSubmit({
26437
26801
  type: ToastType.ERROR
26438
26802
  });
26439
26803
  }
26440
- logger$d.error(e);
26804
+ logger$e.error(e);
26441
26805
  userEvents.addEvent(CompanySearchEvents.TASK_ERROR, {
26442
26806
  segmentation: {
26443
26807
  ...baseTrackingPayload,
@@ -26503,7 +26867,7 @@ function CompanySearchComponent(props) {
26503
26867
  }), jsx("div", {
26504
26868
  className: formWrapperClasses(forms.companyRegistrationAddress.formId),
26505
26869
  children: jsx(RegistrationAddressComponent, {
26506
- ...getFormProps(props, forms.companyRegistrationAddress.formId),
26870
+ ...getNestedOuterFormPropsFromOuterFormProps(props, forms.companyRegistrationAddress.formId),
26507
26871
  id: forms.companyRegistrationAddress.formId,
26508
26872
  heading: i18n.get(forms.companyRegistrationAddress.formName),
26509
26873
  description: i18n.get(forms.companyRegistrationAddress.formDescription, {
@@ -26664,7 +27028,7 @@ function CompanySearchDropinComponent({
26664
27028
  const {
26665
27029
  fieldConfigurations
26666
27030
  } = useScenarioConfiguration({
26667
- parseConfiguration: parseConfiguration$4,
27031
+ parseConfiguration: parseConfiguration$5,
26668
27032
  getConfigurationData,
26669
27033
  setLoadingStatus,
26670
27034
  country: country2
@@ -26790,7 +27154,7 @@ function CompanySearchDropinComponent({
26790
27154
  })
26791
27155
  });
26792
27156
  }
26793
- const logger$c = createLogger("useLocalStorage");
27157
+ const logger$d = createLogger("useLocalStorage");
26794
27158
  const useLocalStorage = (key, defaultValue, options) => {
26795
27159
  const {
26796
27160
  serializer,
@@ -26810,7 +27174,7 @@ const useLocalStorage = (key, defaultValue, options) => {
26810
27174
  const res = rawValueRef.current ? parser(rawValueRef.current) : defaultValue;
26811
27175
  return res;
26812
27176
  } catch (err) {
26813
- logger$c.error(err);
27177
+ logger$d.error(err);
26814
27178
  return defaultValue;
26815
27179
  }
26816
27180
  });
@@ -26841,7 +27205,7 @@ const useLocalStorage = (key, defaultValue, options) => {
26841
27205
  try {
26842
27206
  updateLocalStorage();
26843
27207
  } catch (err) {
26844
- logger$c.error(err);
27208
+ logger$d.error(err);
26845
27209
  }
26846
27210
  }, [value]);
26847
27211
  useEffect(() => {
@@ -26854,7 +27218,7 @@ const useLocalStorage = (key, defaultValue, options) => {
26854
27218
  setValue(event.newValue ? parser(event.newValue) : void 0);
26855
27219
  }
26856
27220
  } catch (err) {
26857
- logger$c.error(err);
27221
+ logger$d.error(err);
26858
27222
  }
26859
27223
  };
26860
27224
  if (typeof window === "undefined") return;
@@ -26899,7 +27263,7 @@ const useIsEligibleForSingpass = ({
26899
27263
  }
26900
27264
  return legalEntity.type === LegalEntityType.ORGANIZATION;
26901
27265
  };
26902
- const logger$b = createLogger("useAssociatedLegalArrangement");
27266
+ const logger$c = createLogger("useAssociatedLegalArrangement");
26903
27267
  function useAssociatedLegalArrangement({
26904
27268
  rootLegalEntity,
26905
27269
  getLegalEntity: getLegalEntity2
@@ -26910,7 +27274,7 @@ function useAssociatedLegalArrangement({
26910
27274
  var _a;
26911
27275
  const foundEntity = (_a = rootLegalEntity == null ? void 0 : rootLegalEntity.entityAssociations) == null ? void 0 : _a.find((entity) => entity.type === LegalEntityType.SOLE_PROPRIETORSHIP || entity.type === LegalEntityType.TRUST);
26912
27276
  if (foundEntity == null ? void 0 : foundEntity.legalEntityId) {
26913
- getAssociatedEntity(foundEntity == null ? void 0 : foundEntity.legalEntityId).then((res) => setAssociatedLegalArrangement(res)).catch(logger$b.error);
27277
+ getAssociatedEntity(foundEntity == null ? void 0 : foundEntity.legalEntityId).then((res) => setAssociatedLegalArrangement(res)).catch(logger$c.error);
26914
27278
  }
26915
27279
  }, [getAssociatedEntity, rootLegalEntity == null ? void 0 : rootLegalEntity.entityAssociations]);
26916
27280
  useEffect(() => {
@@ -26924,7 +27288,15 @@ function useAssociatedLegalArrangement({
26924
27288
  refreshAssociatedLegalArrangement
26925
27289
  };
26926
27290
  }
26927
- const logger$a = createLogger("useExemptSettlor");
27291
+ const getCanSeeEntitySelectionStorageKey = (legalEntityId) => `ENTITY_SELECTION_SEEN-${legalEntityId}`;
27292
+ const useCanSeeEntitySelection = (legalEntityId) => {
27293
+ const [canSeeEntitySelectionFromLocalStorage, setCanSeeEntitySelectionIntoLocalStorage] = useLocalStorage(getCanSeeEntitySelectionStorageKey(legalEntityId), true);
27294
+ return {
27295
+ canSeeEntitySelection: canSeeEntitySelectionFromLocalStorage,
27296
+ setCanSeeEntitySelection: setCanSeeEntitySelectionIntoLocalStorage
27297
+ };
27298
+ };
27299
+ const logger$b = createLogger("useExemptSettlor");
26928
27300
  const useExemptSettlor = ({
26929
27301
  trust: trust2,
26930
27302
  handleGetLegalEntity
@@ -26937,7 +27309,7 @@ const useExemptSettlor = ({
26937
27309
  }, [handleGetLegalEntity]);
26938
27310
  useEffect(() => {
26939
27311
  if (!(trust2 == null ? void 0 : trust2.trust)) return;
26940
- updateExemptSettlor(trust2).catch(logger$a.error);
27312
+ updateExemptSettlor(trust2).catch(logger$b.error);
26941
27313
  }, [trust2, updateExemptSettlor]);
26942
27314
  return exemptSettlor;
26943
27315
  };
@@ -27297,55 +27669,6 @@ const useBusinessTypeExamples = (country2) => {
27297
27669
  }, [country2]);
27298
27670
  return examples;
27299
27671
  };
27300
- const headingTypes = {
27301
- 1: ({
27302
- children,
27303
- className
27304
- }) => jsx("h1", {
27305
- className,
27306
- children
27307
- }),
27308
- 2: ({
27309
- children,
27310
- className
27311
- }) => jsx("h2", {
27312
- className,
27313
- children
27314
- }),
27315
- 3: ({
27316
- children,
27317
- className
27318
- }) => jsx("h3", {
27319
- className,
27320
- children
27321
- }),
27322
- 4: ({
27323
- children,
27324
- className
27325
- }) => jsx("h4", {
27326
- className,
27327
- children
27328
- }),
27329
- sub: ({
27330
- children,
27331
- className
27332
- }) => jsx("div", {
27333
- className,
27334
- children
27335
- })
27336
- };
27337
- function Heading({
27338
- className,
27339
- level,
27340
- children
27341
- }) {
27342
- const HeadingElement = headingTypes[level] || headingTypes[1];
27343
- const classNames = cx("adyen-kyc-heading", `adyen-kyc-heading--${level}`, className);
27344
- return jsx(HeadingElement, {
27345
- className: classNames,
27346
- children
27347
- });
27348
- }
27349
27672
  const trusteeTypeItems = [{
27350
27673
  id: "individual",
27351
27674
  name: "individual"
@@ -29807,7 +30130,7 @@ const omitObscuredFieldsIfUnchanged = (obscuredFields, dataSubmitted, savedData)
29807
30130
  });
29808
30131
  return filtered;
29809
30132
  };
29810
- const parseConfiguration$3 = ({
30133
+ const parseConfiguration$4 = ({
29811
30134
  matchingScenario
29812
30135
  }) => parseIndividualScenarios(matchingScenario == null ? void 0 : matchingScenario[LegalEntityType.INDIVIDUAL]);
29813
30136
  function IndividualDropinComponent({
@@ -29839,6 +30162,10 @@ function IndividualDropinComponent({
29839
30162
  handleBackClick: externalBackClick
29840
30163
  }) {
29841
30164
  var _a, _b, _c, _d;
30165
+ const {
30166
+ accountHolder: accountHolder2,
30167
+ setAccountHolder
30168
+ } = useCoreContext();
29842
30169
  const {
29843
30170
  i18n
29844
30171
  } = useI18nContext();
@@ -29888,7 +30215,7 @@ function IndividualDropinComponent({
29888
30215
  const {
29889
30216
  fieldConfigurations
29890
30217
  } = useScenarioConfiguration({
29891
- parseConfiguration: parseConfiguration$3,
30218
+ parseConfiguration: parseConfiguration$4,
29892
30219
  getConfigurationData,
29893
30220
  setLoadingStatus,
29894
30221
  country: country2
@@ -30074,12 +30401,14 @@ function IndividualDropinComponent({
30074
30401
  idDocumentType: idDocumentType || null
30075
30402
  }
30076
30403
  });
30077
- legalEntity.entityAssociations = filterOutUnwantedAssociationsIfRootLE(taskType, legalEntityResponse, (_c2 = dataSubmitted.personalDetails) == null ? void 0 : _c2.accountHolder);
30404
+ const accountHolderToEvaluated = ((_c2 = dataSubmitted.personalDetails) == null ? void 0 : _c2.accountHolder) ?? accountHolder2;
30405
+ legalEntity.entityAssociations = filterOutUnwantedAssociationsIfRootLE(taskType, legalEntityResponse, accountHolderToEvaluated ?? void 0);
30078
30406
  const createdLegalEntity = await submitLegalEntity({
30079
30407
  dataSubmitted,
30080
30408
  legalEntity,
30081
30409
  idDocumentType
30082
30410
  });
30411
+ setAccountHolder(accountHolderToEvaluated);
30083
30412
  await submitDocuments2({
30084
30413
  forms: forms2,
30085
30414
  legalEntity: createdLegalEntity,
@@ -30203,7 +30532,7 @@ function IndividualDropinComponent({
30203
30532
  ...formatFileSummaryData2(data)
30204
30533
  };
30205
30534
  }
30206
- if ((_c2 = summaryData == null ? void 0 : summaryData.personalDetails) == null ? void 0 : _c2.accountHolder) {
30535
+ if ((_c2 = summaryData.personalDetails) == null ? void 0 : _c2.accountHolder) {
30207
30536
  summaryData.personalDetails.accountHolder = i18n.get(summaryData.personalDetails.accountHolder);
30208
30537
  }
30209
30538
  return summaryData;
@@ -30271,7 +30600,8 @@ function IndividualDropinComponent({
30271
30600
  handleFindAddress,
30272
30601
  onTypeSwitch,
30273
30602
  onCountryChange: setCountry,
30274
- shouldValidate
30603
+ shouldValidate,
30604
+ accountHolder: accountHolder2
30275
30605
  })
30276
30606
  });
30277
30607
  }
@@ -30374,7 +30704,7 @@ const labels = () => ({
30374
30704
  verifiedCurrencyCode: () => "currencyCode",
30375
30705
  verifiedBankAccountNumber: () => "bankAccountNumber"
30376
30706
  });
30377
- const parseConfiguration$2 = ({
30707
+ const parseConfiguration$3 = ({
30378
30708
  requiredFields,
30379
30709
  country: country2,
30380
30710
  bankVerificationAvailable
@@ -30497,7 +30827,7 @@ function PayoutDetailsDropinComponent({
30497
30827
  requiredFields,
30498
30828
  bankVerificationVendors
30499
30829
  } = useScenarioConfiguration({
30500
- parseConfiguration: parseConfiguration$2,
30830
+ parseConfiguration: parseConfiguration$3,
30501
30831
  getConfigurationData,
30502
30832
  getPayoutAccountFormatData,
30503
30833
  instantVerificationEnabled,
@@ -31682,7 +32012,7 @@ const serviceAgreementValidationRules = {
31682
32012
  errorMessage: "fieldIsRequired"
31683
32013
  }
31684
32014
  };
31685
- const logger$9 = createLogger("useServiceAgreement");
32015
+ const logger$a = createLogger("useServiceAgreement");
31686
32016
  const FALLBACK_LANGUAGE_CODE = "en";
31687
32017
  const useServiceAgreement = ({
31688
32018
  handleGetServiceAgreement,
@@ -31715,7 +32045,7 @@ const useServiceAgreement = ({
31715
32045
  contract
31716
32046
  });
31717
32047
  };
31718
- requestAcceptedServiceAgreement().catch(logger$9.error).finally(() => setLoading("success"));
32048
+ requestAcceptedServiceAgreement().catch(logger$a.error).finally(() => setLoading("success"));
31719
32049
  }, [acceptanceId, handleViewAcceptedTermsOfServiceDocument]);
31720
32050
  useEffect(() => {
31721
32051
  const requestServiceAgreement = async () => {
@@ -31730,7 +32060,7 @@ const useServiceAgreement = ({
31730
32060
  language: agreementLanguage
31731
32061
  });
31732
32062
  if (!document2) {
31733
- logger$9.log('"document" field was missing in response');
32063
+ logger$a.log('"document" field was missing in response');
31734
32064
  return;
31735
32065
  }
31736
32066
  const contract = JSON.parse(decodeURIComponent(escape(window.atob(document2))));
@@ -31748,7 +32078,7 @@ const useServiceAgreement = ({
31748
32078
  throw err;
31749
32079
  }
31750
32080
  };
31751
- requestServiceAgreement().catch(logger$9.error);
32081
+ requestServiceAgreement().catch(logger$a.error);
31752
32082
  }, [handleGetServiceAgreement, handleServiceAgreementIsNotAvailableInThatLanguage, agreementLanguage, legalEntityId, serviceAgreementType]);
31753
32083
  return {
31754
32084
  loading: loading2,
@@ -32052,7 +32382,7 @@ function ServiceAgreementDropinComponent({
32052
32382
  })
32053
32383
  });
32054
32384
  }
32055
- const parseConfiguration$1 = ({
32385
+ const parseConfiguration$2 = ({
32056
32386
  matchingScenario,
32057
32387
  country: country2
32058
32388
  }) => parseSolePropScenarios(matchingScenario[LegalEntityType.SOLE_PROPRIETORSHIP], country2);
@@ -32154,7 +32484,7 @@ function SolePropDropinComponent({
32154
32484
  fieldConfigurations,
32155
32485
  requiredFields
32156
32486
  } = useScenarioConfiguration({
32157
- parseConfiguration: parseConfiguration$1,
32487
+ parseConfiguration: parseConfiguration$2,
32158
32488
  getConfigurationData,
32159
32489
  setLoadingStatus,
32160
32490
  country: country2
@@ -32291,18 +32621,18 @@ function SolePropDropinComponent({
32291
32621
  if (isCountryOfGoverningLawEnabled) {
32292
32622
  summaryData.solePropNameAndCountry = getUpdatedCountryOfGoverningLaw(summaryData.solePropNameAndCountry);
32293
32623
  }
32294
- const solePropCountry = ((_a2 = summaryData == null ? void 0 : summaryData.solePropNameAndCountry) == null ? void 0 : _a2.country) ? datasetUtils.getCountryName(summaryData.solePropNameAndCountry.country) : void 0;
32624
+ const solePropCountry = ((_a2 = summaryData.solePropNameAndCountry) == null ? void 0 : _a2.country) && datasetUtils.getCountryName(summaryData.solePropNameAndCountry.country);
32295
32625
  summaryData.solePropNameAndCountry = {
32296
32626
  legalNameOfSoleProprietor: (_b2 = data2.solePropNameAndCountry) == null ? void 0 : _b2.legalCompanyName,
32297
32627
  countryRegionOfEstablishment: solePropCountry,
32298
- countryOfGoverningLaw: ((_c = summaryData == null ? void 0 : summaryData.solePropNameAndCountry) == null ? void 0 : _c.countryOfGoverningLaw) ? datasetUtils.getCountryName(summaryData.solePropNameAndCountry.countryOfGoverningLaw) : void 0
32628
+ countryOfGoverningLaw: ((_c = summaryData.solePropNameAndCountry) == null ? void 0 : _c.countryOfGoverningLaw) && datasetUtils.getCountryName(summaryData.solePropNameAndCountry.countryOfGoverningLaw)
32299
32629
  };
32300
- if ((_d = summaryData == null ? void 0 : summaryData.solePropRegistrationAddress) == null ? void 0 : _d.registrationAddress) {
32630
+ if ((_d = summaryData.solePropRegistrationAddress) == null ? void 0 : _d.registrationAddress) {
32301
32631
  summaryData.solePropRegistrationAddress.hasInnerForms = true;
32302
- summaryData.solePropRegistrationAddress.registrationAddress = mapAddressLabels(summaryData == null ? void 0 : summaryData.solePropRegistrationAddress.registrationAddress, datasetUtils);
32632
+ summaryData.solePropRegistrationAddress.registrationAddress = mapAddressLabels(summaryData.solePropRegistrationAddress.registrationAddress, datasetUtils);
32303
32633
  }
32304
- if ((_e = summaryData == null ? void 0 : summaryData.solePropRegistrationAddress) == null ? void 0 : _e.operationalAddress) {
32305
- summaryData.solePropRegistrationAddress.operationalAddress = mapAddressLabels(summaryData == null ? void 0 : summaryData.solePropRegistrationAddress.operationalAddress, datasetUtils);
32634
+ if ((_e = summaryData.solePropRegistrationAddress) == null ? void 0 : _e.operationalAddress) {
32635
+ summaryData.solePropRegistrationAddress.operationalAddress = mapAddressLabels(summaryData.solePropRegistrationAddress.operationalAddress, datasetUtils);
32306
32636
  }
32307
32637
  if (isDocumentsRequired(forms22)) {
32308
32638
  delete summaryData[solePropDocumentFormId];
@@ -32385,7 +32715,7 @@ const rules = ({
32385
32715
  }
32386
32716
  }
32387
32717
  });
32388
- const parseConfiguration = ({
32718
+ const parseConfiguration$1 = ({
32389
32719
  matchingScenario,
32390
32720
  country: country2
32391
32721
  }) => parseTrustScenarios(matchingScenario == null ? void 0 : matchingScenario[LegalEntityType.TRUST], country2);
@@ -32439,7 +32769,7 @@ function TrustDropinComponent({
32439
32769
  fieldConfigurations,
32440
32770
  requiredFields
32441
32771
  } = useScenarioConfiguration({
32442
- parseConfiguration,
32772
+ parseConfiguration: parseConfiguration$1,
32443
32773
  getConfigurationData,
32444
32774
  setLoadingStatus,
32445
32775
  country: country2
@@ -32570,34 +32900,31 @@ function TrustDropinComponent({
32570
32900
  await handleUpdateLegalEntity(updatedParentLegalEntity, parentLegalEntity.id);
32571
32901
  };
32572
32902
  const formatDataForSummary2 = (data2, forms22) => {
32573
- var _a2, _b, _c, _d, _e, _f, _g, _h;
32903
+ var _a2, _b, _c;
32574
32904
  let summaryData = cloneObject(data2) || {};
32575
- if (summaryData == null ? void 0 : summaryData.trustRegistrationDetails) {
32576
- const trustCountry = ((_a2 = summaryData == null ? void 0 : summaryData.trustRegistrationDetails) == null ? void 0 : _a2.country) ? datasetUtils.getCountryName(summaryData.trustRegistrationDetails.country) : void 0;
32577
- const trustType2 = ((_b = summaryData == null ? void 0 : summaryData.trustRegistrationDetails) == null ? void 0 : _b.trustType) ? i18n.get((_c = trustTypeOptions.find((trustType22) => {
32578
- var _a3;
32579
- return trustType22.id === ((_a3 = summaryData.trustRegistrationDetails) == null ? void 0 : _a3.trustType);
32580
- })) == null ? void 0 : _c.name) : void 0;
32905
+ if (summaryData.trustRegistrationDetails) {
32906
+ const trustCountry = summaryData.trustRegistrationDetails.country && datasetUtils.getCountryName(summaryData.trustRegistrationDetails.country);
32907
+ const trustType2 = summaryData.trustRegistrationDetails.trustType && i18n.get((_a2 = trustTypeOptions.find((option) => option.id === summaryData.trustRegistrationDetails.trustType)) == null ? void 0 : _a2.name);
32581
32908
  summaryData.trustRegistrationDetails = {
32582
- nameOfTrustAgreement: (_d = summaryData == null ? void 0 : summaryData.trustRegistrationDetails) == null ? void 0 : _d.legalName,
32909
+ nameOfTrustAgreement: summaryData.trustRegistrationDetails.legalName,
32583
32910
  countryRegionOfEstablishment: trustCountry,
32584
32911
  typeOfTrustAgreement: trustType2,
32585
- objectOfTrust: (_e = summaryData == null ? void 0 : summaryData.trustRegistrationDetails) == null ? void 0 : _e.objectOfTrust,
32586
- taxId: (_f = summaryData == null ? void 0 : summaryData.trustRegistrationDetails) == null ? void 0 : _f.taxId
32912
+ objectOfTrust: summaryData.trustRegistrationDetails.objectOfTrust,
32913
+ taxId: summaryData.trustRegistrationDetails.taxId
32587
32914
  };
32588
32915
  }
32589
- if ((_g = summaryData == null ? void 0 : summaryData.trustRegistrationAddress) == null ? void 0 : _g.registrationAddress) {
32916
+ if ((_b = summaryData.trustRegistrationAddress) == null ? void 0 : _b.registrationAddress) {
32590
32917
  summaryData.trustRegistrationAddress.hasInnerForms = true;
32591
- summaryData.trustRegistrationAddress.registrationAddress = mapAddressLabels(summaryData == null ? void 0 : summaryData.trustRegistrationAddress.registrationAddress, datasetUtils);
32918
+ summaryData.trustRegistrationAddress.registrationAddress = mapAddressLabels(summaryData.trustRegistrationAddress.registrationAddress, datasetUtils);
32592
32919
  }
32593
- if ((_h = summaryData == null ? void 0 : summaryData.trustRegistrationAddress) == null ? void 0 : _h.operationalAddress) {
32594
- summaryData.trustRegistrationAddress.operationalAddress = mapAddressLabels(summaryData == null ? void 0 : summaryData.trustRegistrationAddress.operationalAddress, datasetUtils);
32920
+ if ((_c = summaryData.trustRegistrationAddress) == null ? void 0 : _c.operationalAddress) {
32921
+ summaryData.trustRegistrationAddress.operationalAddress = mapAddressLabels(summaryData.trustRegistrationAddress.operationalAddress, datasetUtils);
32595
32922
  }
32596
32923
  if (isDocumentsRequired2(forms22)) {
32597
32924
  delete summaryData[trustConstitutionalDocumentFormId];
32598
32925
  summaryData = {
32599
32926
  ...summaryData,
32600
- ...formatFileSummaryData2(summaryData == null ? void 0 : summaryData.trustConstitutionalDocument)
32927
+ ...formatFileSummaryData2(summaryData.trustConstitutionalDocument)
32601
32928
  };
32602
32929
  }
32603
32930
  return summaryData;
@@ -32703,6 +33030,9 @@ const useNavigation = ({
32703
33030
  const {
32704
33031
  accountHolder: accountHolder2
32705
33032
  } = useCoreContext();
33033
+ const {
33034
+ canSeeEntitySelection
33035
+ } = useCanSeeEntitySelection(legalEntity.id);
32706
33036
  const eligibleForSingpass = useIsEligibleForSingpass({
32707
33037
  legalEntity,
32708
33038
  accountHolder: accountHolder2,
@@ -32739,7 +33069,7 @@ const useNavigation = ({
32739
33069
  if (pushedTask === "default") {
32740
33070
  const defaultTask = getDefaultTask({
32741
33071
  legalEntity,
32742
- accountHolder: accountHolder2,
33072
+ canSeeEntitySelection,
32743
33073
  showIntroduction,
32744
33074
  isNewEntryFlowEnabled,
32745
33075
  shouldShowSingpassSelection
@@ -32756,13 +33086,13 @@ const useNavigation = ({
32756
33086
  };
32757
33087
  const getDefaultTask = ({
32758
33088
  legalEntity,
32759
- accountHolder: accountHolder2,
33089
+ canSeeEntitySelection,
32760
33090
  isNewEntryFlowEnabled,
32761
33091
  showIntroduction,
32762
33092
  shouldShowSingpassSelection
32763
33093
  }) => {
32764
33094
  const hasLegalEntityProgressedBeyondEntitySelection = hasProgressedBeyondEntitySelection(legalEntity);
32765
- if (isNewEntryFlowEnabled && !accountHolder2 && !hasLegalEntityProgressedBeyondEntitySelection) return TaskTypes.BUSINESS_TYPE_SELECTION;
33095
+ if (isNewEntryFlowEnabled && canSeeEntitySelection && !hasLegalEntityProgressedBeyondEntitySelection) return TaskTypes.BUSINESS_TYPE_SELECTION;
32766
33096
  if (showIntroduction) return TaskTypes.INTRODUCTION;
32767
33097
  if (shouldShowSingpassSelection) return TaskTypes.SINGPASS_SELECTION;
32768
33098
  return TaskTypes.TASKS_OVERVIEW;
@@ -32775,7 +33105,7 @@ const hasProgressedBeyondEntitySelection = (legalEntity) => {
32775
33105
  };
32776
33106
  const PAGES_WITH_POLLING = [TaskTypes.DECISION_MAKER_OVERVIEW, TaskTypes.TASKS_OVERVIEW];
32777
33107
  const POLLING_INTERVAL = 3e3;
32778
- const logger$8 = createLogger("DropinComposerComponent");
33108
+ const logger$9 = createLogger("DropinComposerComponent");
32779
33109
  const isOrganizationSettlorWithExemptionReasonEnabled = (enabled, country2) => country2 === CountryCodes.Australia && enabled;
32780
33110
  function DropinComposerComponent({
32781
33111
  capabilities,
@@ -32792,6 +33122,9 @@ function DropinComposerComponent({
32792
33122
  accountHolder: accountHolder2,
32793
33123
  setAccountHolder
32794
33124
  } = useCoreContext();
33125
+ const {
33126
+ setCanSeeEntitySelection
33127
+ } = useCanSeeEntitySelection(legalEntityResponse.id);
32795
33128
  const {
32796
33129
  i18n
32797
33130
  } = useI18nContext();
@@ -32883,7 +33216,7 @@ function DropinComposerComponent({
32883
33216
  setPciStatus(response);
32884
33217
  return response;
32885
33218
  } catch (e) {
32886
- logger$8.warn(i18n.get("failedToGetPciStatus"));
33219
+ logger$9.warn(i18n.get("failedToGetPciStatus"));
32887
33220
  }
32888
33221
  }
32889
33222
  return void 0;
@@ -32911,7 +33244,7 @@ function DropinComposerComponent({
32911
33244
  }, [additionalSalesChannels, i18n, rootLegalEntity.id, args.handleGetPciTemplate]);
32912
33245
  useEffect(() => {
32913
33246
  if (!tasks.includes(TaskTypes.PCI_DSS)) return;
32914
- getPciTemplate().catch(logger$8.error);
33247
+ getPciTemplate().catch(logger$9.error);
32915
33248
  }, [getPciTemplate, tasks]);
32916
33249
  const addFetchedAcceptedByName = async (acceptanceInfo) => {
32917
33250
  try {
@@ -32921,7 +33254,7 @@ function DropinComposerComponent({
32921
33254
  acceptedByName: getLegalEntityNameBasedOnType(acceptedByEntity)
32922
33255
  };
32923
33256
  } catch (e) {
32924
- logger$8.warn(i18n.get("failedToFetchAcceptedByName"));
33257
+ logger$9.warn(i18n.get("failedToFetchAcceptedByName"));
32925
33258
  return {
32926
33259
  ...acceptanceInfo,
32927
33260
  acceptedByName: null
@@ -32935,7 +33268,7 @@ function DropinComposerComponent({
32935
33268
  const serviceAgreementAcceptanceInfosWithNames2 = await Promise.all(response.data.map(addFetchedAcceptedByName));
32936
33269
  setServiceAgreementAcceptanceInfosWithNames(serviceAgreementAcceptanceInfosWithNames2);
32937
33270
  } catch (e) {
32938
- logger$8.warn(i18n.get("failedToGetServiceAgreementStatus"));
33271
+ logger$9.warn(i18n.get("failedToGetServiceAgreementStatus"));
32939
33272
  }
32940
33273
  }
32941
33274
  };
@@ -32945,7 +33278,7 @@ function DropinComposerComponent({
32945
33278
  const response = await args.handleGetServiceAgreementStatus(rootLegalEntity.id);
32946
33279
  setServiceAgreementTypes(response.termsOfServiceTypes);
32947
33280
  } catch (e) {
32948
- logger$8.warn(i18n.get("failedToGetServiceAgreementStatus"));
33281
+ logger$9.warn(i18n.get("failedToGetServiceAgreementStatus"));
32949
33282
  }
32950
33283
  }
32951
33284
  };
@@ -32984,7 +33317,7 @@ function DropinComposerComponent({
32984
33317
  setCapabilityProblems(getCapabilityProblems(response, rootLegalEntityCountry, isExperimentEnabled));
32985
33318
  return response;
32986
33319
  } catch (e) {
32987
- logger$8.warn(i18n.get("failedToFetchLegalEntityDetails"));
33320
+ logger$9.warn(i18n.get("failedToFetchLegalEntityDetails"));
32988
33321
  }
32989
33322
  }
32990
33323
  return void 0;
@@ -33034,7 +33367,7 @@ function DropinComposerComponent({
33034
33367
  label: i18n.get("successFullyRemovedTrustMember")
33035
33368
  });
33036
33369
  } catch (err) {
33037
- logger$8.error(`Failed to delete trust member`, err);
33370
+ logger$9.error(`Failed to delete trust member`, err);
33038
33371
  showToast({
33039
33372
  type: ToastType.ERROR,
33040
33373
  label: i18n.get("failedToRemoveTrustMember")
@@ -33104,7 +33437,7 @@ function DropinComposerComponent({
33104
33437
  }
33105
33438
  break;
33106
33439
  default:
33107
- logger$8.warn(`Updating trust member type "${trustMember.trustMemberType}" is not implemented.`);
33440
+ logger$9.warn(`Updating trust member type "${trustMember.trustMemberType}" is not implemented.`);
33108
33441
  }
33109
33442
  showToast({
33110
33443
  label: i18n.get("successfullyUpdatedDetails"),
@@ -33112,7 +33445,7 @@ function DropinComposerComponent({
33112
33445
  });
33113
33446
  await refreshLegalArrangementAndRunOnSubmit(associatedLegalArrangement, 1);
33114
33447
  } catch (err) {
33115
- logger$8.error(err);
33448
+ logger$9.error(err);
33116
33449
  showToast({
33117
33450
  label: i18n.get("failedToUpdateDetails"),
33118
33451
  type: ToastType.ERROR
@@ -33133,7 +33466,7 @@ function DropinComposerComponent({
33133
33466
  navigateTo(TaskTypes.TASKS_OVERVIEW);
33134
33467
  }
33135
33468
  } catch (e) {
33136
- logger$8.error(e);
33469
+ logger$9.error(e);
33137
33470
  showToast({
33138
33471
  label: i18n.get("failToLaunchSingpass"),
33139
33472
  type: ToastType.ERROR
@@ -33340,7 +33673,7 @@ function DropinComposerComponent({
33340
33673
  }
33341
33674
  };
33342
33675
  setIsLoadingConfiguration(true);
33343
- fetchConfiguration().catch(logger$8.error).finally(() => {
33676
+ fetchConfiguration().catch(logger$9.error).finally(() => {
33344
33677
  setIsLoadingConfiguration(false);
33345
33678
  onLoad();
33346
33679
  });
@@ -33358,12 +33691,16 @@ function DropinComposerComponent({
33358
33691
  return;
33359
33692
  }
33360
33693
  const timeoutId = setTimeout(() => {
33361
- refreshLegalEntity().catch(logger$8.error);
33694
+ refreshLegalEntity().catch(logger$9.error);
33362
33695
  }, POLLING_INTERVAL);
33363
33696
  return () => {
33364
33697
  clearInterval(timeoutId);
33365
33698
  };
33366
33699
  }, [refreshLegalEntity, rootLegalEntity]);
33700
+ useEffect(() => {
33701
+ const newAccountHolder = getDefaultAccountHolderType(rootLegalEntity, false, accountHolder2);
33702
+ if (newAccountHolder !== accountHolder2) setAccountHolder(newAccountHolder);
33703
+ }, [accountHolder2, rootLegalEntity]);
33367
33704
  if (isLoadingConfiguration) {
33368
33705
  return jsx(Shimmer, {});
33369
33706
  }
@@ -33377,6 +33714,7 @@ function DropinComposerComponent({
33377
33714
  accountHolder: accountHolder2,
33378
33715
  onComplete: async (newAccountHolder) => {
33379
33716
  setAccountHolder(newAccountHolder);
33717
+ setCanSeeEntitySelection(false);
33380
33718
  await refreshLegalEntity();
33381
33719
  navigateTo("default");
33382
33720
  },
@@ -33570,8 +33908,7 @@ function DropinComposerComponent({
33570
33908
  handleAddressSearch: args == null ? void 0 : args.handleAddressSearch,
33571
33909
  handleFindAddress: args == null ? void 0 : args.handleFindAddress,
33572
33910
  onTypeSwitch: navigateToTypeSwitcher,
33573
- isTargetLegalEntityType: legalEntityType === LegalEntityType.ORGANIZATION,
33574
- accountHolder: accountHolder2
33911
+ isTargetLegalEntityType: legalEntityType === LegalEntityType.ORGANIZATION
33575
33912
  });
33576
33913
  case TaskTypes.COMPANY_SEARCH:
33577
33914
  return jsx(CompanySearchDropinComponent, {
@@ -33664,8 +34001,7 @@ function DropinComposerComponent({
33664
34001
  homeButtonLabel: i18n.get("saveAndGoToOverview"),
33665
34002
  associationDetail: trustMember,
33666
34003
  handleAddressSearch: args == null ? void 0 : args.handleAddressSearch,
33667
- handleFindAddress: args == null ? void 0 : args.handleFindAddress,
33668
- accountHolder: accountHolder2
34004
+ handleFindAddress: args == null ? void 0 : args.handleFindAddress
33669
34005
  });
33670
34006
  case TaskTypes.PAYOUT:
33671
34007
  case TaskTypes.PAYIN:
@@ -33826,7 +34162,7 @@ const createLegalEntity = async (context, legalEntity) => {
33826
34162
  return httpPost({
33827
34163
  loadingContext,
33828
34164
  errorLevel: "warn",
33829
- errorMessage: `LegalEntity creation available`,
34165
+ errorMessage: "LegalEntity create failed",
33830
34166
  path: `${legalEntityId}`,
33831
34167
  authentication: "jwt",
33832
34168
  headers: {
@@ -34189,10 +34525,7 @@ const useComponentApi = (rootLegalEntityId) => {
34189
34525
  ...baseRequestContext,
34190
34526
  legalEntityId
34191
34527
  }, legalEntity),
34192
- createLegalEntity: async (legalEntity) => createLegalEntity({
34193
- ...baseRequestContext,
34194
- legalEntityId: rootLegalEntityId
34195
- }, legalEntity),
34528
+ createLegalEntity: async (legalEntity) => createLegalEntity(baseRequestContext, legalEntity),
34196
34529
  getTransferInstrument: async (transferInstrumentId) => getTransferInstrument(baseRequestContext, transferInstrumentId),
34197
34530
  getBankVerificationVendor: async (country2, openBankingPartnerConfigId) => getBankVerificationVendor(baseRequestContext, country2, openBankingPartnerConfigId),
34198
34531
  getDocument: async (documentId) => getDocument(baseRequestContext, documentId),
@@ -34211,7 +34544,7 @@ const useComponentApi = (rootLegalEntityId) => {
34211
34544
  };
34212
34545
  }, [base, rootLegalEntityId]);
34213
34546
  };
34214
- const logger$7 = createLogger("CreateIndividualComponent");
34547
+ const logger$8 = createLogger("CreateIndividualComponent");
34215
34548
  function CreateIndividualComponent({
34216
34549
  parentLegalEntityId,
34217
34550
  legalEntityId,
@@ -34247,13 +34580,13 @@ function CreateIndividualComponent({
34247
34580
  setParentLegalEntity(parentEntity);
34248
34581
  setLegalEntity(entity);
34249
34582
  } catch (error) {
34250
- logger$7.error(error);
34583
+ logger$8.error(error);
34251
34584
  } finally {
34252
34585
  setLoadingStatus("success");
34253
34586
  }
34254
34587
  }, [parentLegalEntityId, legalEntityId, getLegalEntity2]);
34255
34588
  useEffect(() => {
34256
- fetchLegalEntity().catch(logger$7.error);
34589
+ fetchLegalEntity().catch(logger$8.error);
34257
34590
  }, [fetchLegalEntity]);
34258
34591
  const country2 = ((_a = legalEntity == null ? void 0 : legalEntity.individual) == null ? void 0 : _a.residentialAddress.country) ?? contextCountry;
34259
34592
  return loadingStatus === "loading" ? jsx(Loader, {
@@ -34277,7 +34610,7 @@ function CreateIndividualComponent({
34277
34610
  taskType
34278
34611
  });
34279
34612
  }
34280
- const logger$6 = createLogger("CreateTransferInstrumentComponent");
34613
+ const logger$7 = createLogger("CreateTransferInstrumentComponent");
34281
34614
  function CreateTransferInstrumentComponent({
34282
34615
  legalEntityId,
34283
34616
  transferInstrumentId,
@@ -34317,7 +34650,7 @@ function CreateTransferInstrumentComponent({
34317
34650
  const ti = await getTransferInstrument2(transferInstrumentId);
34318
34651
  setTransferInstrument(ti);
34319
34652
  }
34320
- })().catch(logger$6.error);
34653
+ })().catch(logger$7.error);
34321
34654
  }, [transferInstrumentId, fetchLegalEntity]);
34322
34655
  return legalEntity ? jsx(PayoutDetailsDropinComponent, {
34323
34656
  transferInstrument,
@@ -34338,6 +34671,446 @@ function CreateTransferInstrumentComponent({
34338
34671
  taskType: TaskTypes.PAYOUT
34339
34672
  }) : null;
34340
34673
  }
34674
+ const highExposureCompanyDetailsValidations = {
34675
+ country: {
34676
+ modes: ["blur"],
34677
+ validate: (country2) => !isEmpty(country2),
34678
+ errorMessage: "fieldIsRequired"
34679
+ },
34680
+ numberOfEmployees: {
34681
+ modes: ["blur"],
34682
+ validate: (numberOfEmployees2) => !isEmpty(numberOfEmployees2),
34683
+ errorMessage: "fieldIsRequired"
34684
+ }
34685
+ };
34686
+ const highExposureCompanyDetailsFields = ["numberOfEmployees"];
34687
+ function AdditionalFieldsForHighExposureCompany({
34688
+ requiredFields,
34689
+ ...props
34690
+ }) {
34691
+ const {
34692
+ i18n
34693
+ } = useI18nContext();
34694
+ const {
34695
+ handleChangeFor,
34696
+ data,
34697
+ valid,
34698
+ errors,
34699
+ fieldProblems
34700
+ } = useForm({
34701
+ ...props,
34702
+ schema: ["numberOfEmployees"],
34703
+ defaultData: {
34704
+ ...props.data
34705
+ },
34706
+ rules: props.validators || highExposureCompanyDetailsValidations,
34707
+ fieldProblems: props == null ? void 0 : props.fieldValidationErrors
34708
+ });
34709
+ const formUtils = formUtilities(props, i18n);
34710
+ const {
34711
+ updateStateSlice
34712
+ } = useGlobalDataSlice("company");
34713
+ useEffect(() => {
34714
+ updateStateSlice({
34715
+ data,
34716
+ valid,
34717
+ errors,
34718
+ fieldProblems
34719
+ });
34720
+ }, [data, valid, errors, fieldProblems]);
34721
+ return jsxs("form", {
34722
+ className: "adyen-kyc__registration-details",
34723
+ children: [jsx(FormHeader, {
34724
+ heading: props.heading
34725
+ }), jsx(ErrorPanel, {
34726
+ verificationErrors: props.formVerificationErrors,
34727
+ validationErrors: props == null ? void 0 : props.fieldValidationErrors,
34728
+ formUtils,
34729
+ id: "ariaErrorField"
34730
+ }), formUtils.isRequiredField("numberOfEmployees") && jsx(Field, {
34731
+ name: "numberOfEmployees",
34732
+ label: formUtils.getLabel("numberOfEmployees", "numberOfEmployees"),
34733
+ classNameModifiers: ["legalName"],
34734
+ errorMessage: formUtils.getErrorMessage("numberOfEmployees", errors, fieldProblems),
34735
+ isValid: valid.numberOfEmployees,
34736
+ children: (childProps) => jsx(InputText, {
34737
+ ...childProps,
34738
+ name: "numberOfEmployees",
34739
+ value: data.numberOfEmployees,
34740
+ readonly: formUtils.isReadOnly("numberOfEmployees"),
34741
+ classNameModifiers: ["legalName"],
34742
+ onInput: handleChangeFor("numberOfEmployees", "input"),
34743
+ onBlur: handleChangeFor("numberOfEmployees", "blur"),
34744
+ "aria-required": true,
34745
+ "aria-label": formUtils.getLabel("numberOfEmployees"),
34746
+ "aria-invalid": !valid.numberOfEmployees
34747
+ })
34748
+ })]
34749
+ });
34750
+ }
34751
+ const highExposureParentCompanyDetailsFields = ["numberOfEmployees"];
34752
+ function AdditionalFieldsForHighExposureParentCompany({
34753
+ requiredFields,
34754
+ ...props
34755
+ }) {
34756
+ const {
34757
+ i18n
34758
+ } = useI18nContext();
34759
+ const {
34760
+ handleChangeFor,
34761
+ data,
34762
+ valid,
34763
+ errors,
34764
+ fieldProblems
34765
+ } = useForm({
34766
+ ...props,
34767
+ schema: ["numberOfEmployees"],
34768
+ defaultData: {
34769
+ ...props.data
34770
+ },
34771
+ rules: props.validators || highExposureCompanyDetailsValidations,
34772
+ fieldProblems: props == null ? void 0 : props.fieldValidationErrors
34773
+ });
34774
+ const formUtils = formUtilities(props, i18n);
34775
+ const {
34776
+ updateStateSlice
34777
+ } = useGlobalDataSlice("parentCompany");
34778
+ useEffect(() => {
34779
+ updateStateSlice({
34780
+ data,
34781
+ valid,
34782
+ errors,
34783
+ fieldProblems
34784
+ });
34785
+ }, [data, valid, errors, fieldProblems]);
34786
+ return jsxs("form", {
34787
+ className: "adyen-kyc__registration-details",
34788
+ children: [jsx(FormHeader, {
34789
+ heading: props.heading
34790
+ }), jsx(ErrorPanel, {
34791
+ verificationErrors: props.formVerificationErrors,
34792
+ validationErrors: props == null ? void 0 : props.fieldValidationErrors,
34793
+ formUtils,
34794
+ id: "ariaErrorField"
34795
+ }), formUtils.isRequiredField("numberOfEmployees") && jsx(Field, {
34796
+ name: "numberOfEmployees",
34797
+ label: formUtils.getLabel("numberOfEmployees", "numberOfEmployees"),
34798
+ classNameModifiers: ["legalName"],
34799
+ errorMessage: formUtils.getErrorMessage("numberOfEmployees", errors, fieldProblems),
34800
+ isValid: valid.numberOfEmployees,
34801
+ children: (childProps) => jsx(InputText, {
34802
+ ...childProps,
34803
+ name: "numberOfEmployees",
34804
+ value: data.numberOfEmployees,
34805
+ readonly: formUtils.isReadOnly("numberOfEmployees"),
34806
+ classNameModifiers: ["legalName"],
34807
+ onInput: handleChangeFor("numberOfEmployees", "input"),
34808
+ onBlur: handleChangeFor("numberOfEmployees", "blur"),
34809
+ "aria-required": true,
34810
+ "aria-label": formUtils.getLabel("numberOfEmployees"),
34811
+ "aria-invalid": !valid.numberOfEmployees
34812
+ })
34813
+ })]
34814
+ });
34815
+ }
34816
+ function AdditionalFieldsForHighExposureUltimateParentCompany({
34817
+ requiredFields,
34818
+ ...props
34819
+ }) {
34820
+ const {
34821
+ i18n
34822
+ } = useI18nContext();
34823
+ const {
34824
+ handleChangeFor,
34825
+ data,
34826
+ valid,
34827
+ errors,
34828
+ fieldProblems
34829
+ } = useForm({
34830
+ ...props,
34831
+ schema: ["numberOfEmployees"],
34832
+ defaultData: {
34833
+ ...props.data
34834
+ },
34835
+ rules: props.validators || highExposureCompanyDetailsValidations,
34836
+ fieldProblems: props == null ? void 0 : props.fieldValidationErrors
34837
+ });
34838
+ const formUtils = formUtilities(props, i18n);
34839
+ const {
34840
+ updateStateSlice
34841
+ } = useGlobalDataSlice("ultimateParentCompany");
34842
+ useEffect(() => {
34843
+ updateStateSlice({
34844
+ data,
34845
+ valid,
34846
+ errors,
34847
+ fieldProblems
34848
+ });
34849
+ }, [data, valid, errors, fieldProblems]);
34850
+ return jsxs("form", {
34851
+ className: "adyen-kyc__registration-details",
34852
+ children: [jsx(FormHeader, {
34853
+ heading: props.heading
34854
+ }), jsx(ErrorPanel, {
34855
+ verificationErrors: props.formVerificationErrors,
34856
+ validationErrors: props == null ? void 0 : props.fieldValidationErrors,
34857
+ formUtils,
34858
+ id: "ariaErrorField"
34859
+ }), formUtils.isRequiredField("numberOfEmployees") && jsx(Field, {
34860
+ name: "numberOfEmployees",
34861
+ label: formUtils.getLabel("numberOfEmployees", "numberOfEmployees"),
34862
+ classNameModifiers: ["legalName"],
34863
+ errorMessage: formUtils.getErrorMessage("numberOfEmployees", errors, fieldProblems),
34864
+ isValid: valid.numberOfEmployees,
34865
+ children: (childProps) => jsx(InputText, {
34866
+ ...childProps,
34867
+ name: "numberOfEmployees",
34868
+ value: data.numberOfEmployees,
34869
+ readonly: formUtils.isReadOnly("numberOfEmployees"),
34870
+ classNameModifiers: ["legalName"],
34871
+ onInput: handleChangeFor("numberOfEmployees", "input"),
34872
+ onBlur: handleChangeFor("numberOfEmployees", "blur"),
34873
+ "aria-required": true,
34874
+ "aria-label": formUtils.getLabel("numberOfEmployees"),
34875
+ "aria-invalid": !valid.numberOfEmployees
34876
+ })
34877
+ })]
34878
+ });
34879
+ }
34880
+ const highExposureForms = {
34881
+ company: {
34882
+ formId: "company",
34883
+ formName: "company",
34884
+ fields: [...highExposureCompanyDetailsFields]
34885
+ },
34886
+ parentCompany: {
34887
+ formId: "parentCompany",
34888
+ formName: "parentCompany",
34889
+ fields: [...highExposureParentCompanyDetailsFields]
34890
+ },
34891
+ ultimateParentCompany: {
34892
+ formId: "ultimateParentCompany",
34893
+ formName: "ultimateParentCompany",
34894
+ fields: [...highExposureCompanyDetailsFields]
34895
+ }
34896
+ };
34897
+ const parentCompanyFormId = highExposureForms.parentCompany.formId;
34898
+ const companyFormId = highExposureForms.company.formId;
34899
+ const ultimateParentCompanyFormId = highExposureForms.ultimateParentCompany.formId;
34900
+ function HighExposureDropinComponent(props) {
34901
+ const {
34902
+ i18n
34903
+ } = useI18nContext();
34904
+ const highExposureCompanyDetailsFormProps = getFormProps(props, companyFormId);
34905
+ const highExposureParentCompanyDetailsFormProps = getFormProps(props, companyFormId);
34906
+ const highExposureUltimateParentCompanyDetailsFormProps = getFormProps(props, companyFormId);
34907
+ const renderActiveForm = (activeForm) => jsxs("div", {
34908
+ className: "adyen-kyc",
34909
+ children: [jsx(ContextGuidance, {
34910
+ page: "High exposure company details page",
34911
+ titleId: "whyDoINeedToFillInThisInformation",
34912
+ contentId: "euFinancialRegulationsRequireUs",
34913
+ title: i18n.get("whyDoINeedToFillInThisInformation"),
34914
+ content: i18n.get("euFinancialRegulationsRequireUs")
34915
+ }), jsxs("div", {
34916
+ className: "adyen-kyc-form-wrapper",
34917
+ children: [activeForm.formId === companyFormId && jsx(AdditionalFieldsForHighExposureCompany, {
34918
+ ...highExposureCompanyDetailsFormProps,
34919
+ heading: i18n.get("detailsForCapital"),
34920
+ id: companyFormId,
34921
+ country: props.country
34922
+ }), activeForm.formId === parentCompanyFormId && jsx(AdditionalFieldsForHighExposureParentCompany, {
34923
+ ...highExposureParentCompanyDetailsFormProps,
34924
+ heading: i18n.get("parentCompanyDetails"),
34925
+ id: companyFormId,
34926
+ country: props.country
34927
+ }), activeForm.formId === ultimateParentCompanyFormId && jsx(AdditionalFieldsForHighExposureUltimateParentCompany, {
34928
+ ...highExposureUltimateParentCompanyDetailsFormProps,
34929
+ heading: i18n.get("ultimateParentCompanyDetails"),
34930
+ id: companyFormId,
34931
+ country: props.country
34932
+ })]
34933
+ })]
34934
+ });
34935
+ return jsx("div", {
34936
+ className: "adyen-kyc",
34937
+ children: renderActiveForm(props.activeForm || highExposureForms.company)
34938
+ });
34939
+ }
34940
+ const parseConfiguration = ({
34941
+ matchingScenario
34942
+ }) => parseHighExposureScenarios(matchingScenario == null ? void 0 : matchingScenario[LegalEntityType.ORGANIZATION]);
34943
+ const logger$6 = createLogger("UpdateLegalEntityForHighExposure");
34944
+ function UpdateLegalEntityForHighExposure({
34945
+ parentLegalEntity,
34946
+ capabilities,
34947
+ country: country2,
34948
+ trackingConfig,
34949
+ problems: problemsProp,
34950
+ onSubmit: externalOnSubmit,
34951
+ onChange,
34952
+ hideDropinLayout,
34953
+ handleHomeClick,
34954
+ homeButtonLabel,
34955
+ legalEntityId
34956
+ }) {
34957
+ var _a;
34958
+ const {
34959
+ getLegalEntity: getLegalEntity2
34960
+ } = useComponentApi(legalEntityId);
34961
+ const {
34962
+ i18n
34963
+ } = useI18nContext();
34964
+ const [legalEntity, setLegalEntity] = useState();
34965
+ const fetchLegalEntity = useCallback(async () => {
34966
+ const legalEntityResponse = await getLegalEntity2(legalEntityId);
34967
+ setLegalEntity(legalEntityResponse);
34968
+ if (legalEntityResponse) {
34969
+ setData(mapLegalEntityToHighExposure(legalEntityResponse));
34970
+ }
34971
+ return legalEntityResponse;
34972
+ }, [getLegalEntity2, legalEntityId]);
34973
+ useEffect(() => {
34974
+ (async () => {
34975
+ await fetchLegalEntity();
34976
+ })().catch(logger$6.error);
34977
+ }, [fetchLegalEntity]);
34978
+ const dataFromResponse = legalEntity ? mapLegalEntityToHighExposure(legalEntity) : {};
34979
+ const [data, setData] = useState(dataFromResponse);
34980
+ const [problems, setProblems] = useState(problemsProp ?? {});
34981
+ const {
34982
+ getConfiguration: getConfiguration2
34983
+ } = useConfigurationApi();
34984
+ const {
34985
+ showToast
34986
+ } = useToastContext();
34987
+ const [loadingStatus, setLoadingStatus] = useState("success");
34988
+ const formRef = useRef(null);
34989
+ const getConfigurationData = useCallback(() => getConfiguration2({
34990
+ legalEntityType: LegalEntityType.ORGANIZATION,
34991
+ capabilities,
34992
+ country: country2
34993
+ }), [country2, capabilities]);
34994
+ const {
34995
+ fieldConfigurations
34996
+ } = useScenarioConfiguration({
34997
+ parseConfiguration,
34998
+ getConfigurationData,
34999
+ setLoadingStatus,
35000
+ country: country2
35001
+ });
35002
+ 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]);
35003
+ const {
35004
+ state: {
35005
+ currentState
35006
+ }
35007
+ } = useStateContext();
35008
+ const formValidity = currentState.validityByForm;
35009
+ useEffect(() => {
35010
+ setData({
35011
+ ...currentState.data
35012
+ });
35013
+ onChange == null ? void 0 : onChange(currentState);
35014
+ }, [currentState]);
35015
+ const forms2 = useMemo(() => {
35016
+ const requiredForms = getRequiredForms(highExposureForms, derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields);
35017
+ return addValidityToForms(requiredForms, formValidity, problems);
35018
+ }, [derivedProps, formValidity, problems]);
35019
+ const onSubmit = async () => {
35020
+ setLoadingStatus("loading");
35021
+ const exposureDetails = mapHighExposureToLegalEntity(data);
35022
+ try {
35023
+ console.log({
35024
+ exposureDetails
35025
+ });
35026
+ setLoadingStatus("success");
35027
+ showToast({
35028
+ label: i18n.get("successfullyUpdatedDetails"),
35029
+ type: ToastType.SUCCESS
35030
+ });
35031
+ externalOnSubmit == null ? void 0 : externalOnSubmit(data);
35032
+ } catch (e) {
35033
+ showToast({
35034
+ label: i18n.get("failedToUpdateDetails"),
35035
+ type: ToastType.ERROR
35036
+ });
35037
+ if (isValidationError(e)) {
35038
+ const validationErrors = processValidationErrors(e, void 0, highExposureApiKeyMapping);
35039
+ setProblems({
35040
+ ...problems,
35041
+ validationErrors
35042
+ });
35043
+ } else if (isMaintenanceModeError(e)) {
35044
+ showToast({
35045
+ label: i18n.get("failedToUpdateDetails"),
35046
+ subLabel: i18n.get("maintenanceModeMessage"),
35047
+ type: ToastType.ERROR,
35048
+ duration: "indefinite"
35049
+ });
35050
+ }
35051
+ setLoadingStatus("success");
35052
+ }
35053
+ };
35054
+ const formatDataForSummary2 = (data2) => {
35055
+ const summaryData = cloneObject(data2) || {};
35056
+ return summaryData;
35057
+ };
35058
+ const canSubmit2 = (data2) => mandatoryApiFields.HIGH_EXPOSURE.every((detail) => {
35059
+ const value = getProp(data2, detail);
35060
+ return !isEmpty(value);
35061
+ });
35062
+ const baseTrackingPayload = getBaseTrackingPayload({
35063
+ trackingConfig,
35064
+ parentLegalEntity,
35065
+ legalEntity
35066
+ });
35067
+ const {
35068
+ handleNextClick,
35069
+ handleBackClick,
35070
+ activeForm,
35071
+ shouldValidate,
35072
+ setShouldValidate,
35073
+ gotoFormByFormIndex,
35074
+ nextButtonLabel
35075
+ } = useFormComposer({
35076
+ problems,
35077
+ baseTrackingPayload,
35078
+ forms: forms2,
35079
+ formRef,
35080
+ onSubmit
35081
+ });
35082
+ return jsx(FormWrapper, {
35083
+ taskName: "detailsForCapital",
35084
+ handleNextClick,
35085
+ handleBackClick,
35086
+ gotoFormByFormIndex,
35087
+ nextButtonLabel,
35088
+ loadingStatus,
35089
+ forms: forms2,
35090
+ activeForm,
35091
+ baseTrackingPayload,
35092
+ onSubmit,
35093
+ hideDropinLayout,
35094
+ handleHomeClick,
35095
+ homeButtonLabel,
35096
+ validateForm: () => setShouldValidate(true),
35097
+ canSubmit: canSubmit2(data) && hasDataChanged(dataFromResponse, data),
35098
+ problems,
35099
+ summary: {
35100
+ data: formatDataForSummary2(data)
35101
+ },
35102
+ children: jsx(HighExposureDropinComponent, {
35103
+ ...derivedProps,
35104
+ activeForm,
35105
+ capabilities,
35106
+ data: dataFromResponse,
35107
+ country: ((_a = data == null ? void 0 : data.company) == null ? void 0 : _a.country) ?? country2,
35108
+ problems,
35109
+ shouldValidate,
35110
+ ref: formRef
35111
+ })
35112
+ });
35113
+ }
34341
35114
  var OnboardingUrlTarget = /* @__PURE__ */ ((OnboardingUrlTarget2) => {
34342
35115
  OnboardingUrlTarget2["BLANK"] = "_blank";
34343
35116
  OnboardingUrlTarget2["SELF"] = "_self";
@@ -34541,7 +35314,8 @@ const componentsMap = {
34541
35314
  pci: PciDropinComponent,
34542
35315
  createTransferInstrumentComponent: CreateTransferInstrumentComponent,
34543
35316
  createIndividualComponent: CreateIndividualComponent,
34544
- viewVerificationStatusComponent: ViewVerificationStatusComponent
35317
+ viewVerificationStatusComponent: ViewVerificationStatusComponent,
35318
+ updateLegalEntityForHighExposureComponent: UpdateLegalEntityForHighExposure
34545
35319
  };
34546
35320
  const AuthProvider = ({
34547
35321
  children,
@@ -34593,14 +35367,13 @@ const pushEvents = async (loadingContext, sessionId, event) => httpPost({
34593
35367
  }, event);
34594
35368
  const convertToEmbeddedEvent = (eventQueueItem) => {
34595
35369
  const [eventType, event] = eventQueueItem;
34596
- const hasEventData = typeof event === "object";
34597
- const eventName = hasEventData ? event.key : event;
35370
+ const isObject = typeof event === "object";
35371
+ const eventName = isObject ? event.key : event;
35372
+ const eventData = isObject ? event.segmentation : {};
34598
35373
  return {
34599
35374
  eventType,
34600
35375
  eventName,
34601
- ...hasEventData && {
34602
- eventData: event.segmentation
34603
- }
35376
+ eventData: eventData ?? {}
34604
35377
  };
34605
35378
  };
34606
35379
  const useAnalytics = async ({
@@ -34609,6 +35382,9 @@ const useAnalytics = async ({
34609
35382
  sdkVersion,
34610
35383
  componentName
34611
35384
  }) => {
35385
+ const {
35386
+ i18n
35387
+ } = useI18nContext();
34612
35388
  const {
34613
35389
  isEmbeddedDropin,
34614
35390
  loadingContext: base
@@ -34627,6 +35403,9 @@ const useAnalytics = async ({
34627
35403
  }
34628
35404
  userEvents.subscribe((data) => {
34629
35405
  const eventItem = convertToEmbeddedEvent(data);
35406
+ if (eventItem.eventData) {
35407
+ eventItem.eventData.locale = i18n.locale;
35408
+ }
34630
35409
  pushEvents(loadingContext, sessionResponse.id, eventItem);
34631
35410
  });
34632
35411
  } catch (e) {
@@ -34932,7 +35711,7 @@ const ConfigurationApiProvider = ({
34932
35711
  isEmbeddedDropin,
34933
35712
  loadingContext
34934
35713
  } = authContext;
34935
- const sdkVersion = "2.44.1";
35714
+ const sdkVersion = "2.45.0";
34936
35715
  useAnalytics({
34937
35716
  onUserEvent,
34938
35717
  legalEntityId: rootLegalEntityId,
@@ -36247,6 +37026,15 @@ const viewVerificationStatusComponentSchema = {
36247
37026
  type: "string"
36248
37027
  }
36249
37028
  };
37029
+ const updateLegalEntityForHighExposureComponentSchema = {
37030
+ country: {
37031
+ type: "string"
37032
+ },
37033
+ legalEntityId: {
37034
+ type: "string",
37035
+ required: true
37036
+ }
37037
+ };
36250
37038
  const componentsSchemaMap = {
36251
37039
  payoutAccount: payoutAccountSchema,
36252
37040
  soleProprietorDropin: solePropDropinSchema,
@@ -36259,7 +37047,8 @@ const componentsSchemaMap = {
36259
37047
  taskList: taskListSchema,
36260
37048
  createIndividualComponent: createIndividualComponentSchema,
36261
37049
  createTransferInstrumentComponent: createTransferInstrumentComponentSchema,
36262
- viewVerificationStatusComponent: viewVerificationStatusComponentSchema
37050
+ viewVerificationStatusComponent: viewVerificationStatusComponentSchema,
37051
+ updateLegalEntityForHighExposureComponent: updateLegalEntityForHighExposureComponentSchema
36263
37052
  };
36264
37053
  const validateComponentName = (componentName) => {
36265
37054
  if (!componentName) {