@adyen/kyc-components 3.27.1 → 3.28.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 (35) hide show
  1. package/dist/es/adyen-kyc-components.es.js +713 -479
  2. package/dist/es/circle-F380_Tya.js +8 -0
  3. package/dist/style.css +55 -33
  4. package/dist/types/components/AdditionalInformation/component/AdditionalInformationComponent.d.ts +2 -2
  5. package/dist/types/components/AdditionalInformation/types.d.ts +5 -1
  6. package/dist/types/components/BusinessDetails/forms.d.ts +0 -6
  7. package/dist/types/components/BusinessDetails/types.d.ts +0 -2
  8. package/dist/types/components/DecisionMakers/component/DecisionMakersComponent.d.ts +1 -1
  9. package/dist/types/components/DecisionMakers/types.d.ts +2 -2
  10. package/dist/types/components/Dropins/BusinessDetailsDropin/utils.d.ts +1 -2
  11. package/dist/types/components/Dropins/CompanyDropin/types.d.ts +0 -2
  12. package/dist/types/components/Dropins/HighExposureDropin/types.d.ts +1 -5
  13. package/dist/types/components/Dropins/HighExposureDropin/utils.d.ts +2 -0
  14. package/dist/types/components/Dropins/HighExposureDropin/validate.d.ts +3 -1
  15. package/dist/types/components/Dropins/IndividualDropin/components/IndividualDropinComponent.d.ts +1 -1
  16. package/dist/types/components/Dropins/ServiceAgreementDropinComponent/components/ServiceAgreementDropinComponent.d.ts +1 -1
  17. package/dist/types/components/Dropins/ServiceAgreementDropinComponent/types.d.ts +3 -0
  18. package/dist/types/components/EmbeddedDropins/CreateContractingComponent/CreateContractingComponent.d.ts +2 -1
  19. package/dist/types/components/Individual/types.d.ts +3 -0
  20. package/dist/types/components/PersonalDetails/types.d.ts +2 -1
  21. package/dist/types/components/StepProgressIndicator/StepProgressIndicator.d.ts +2 -1
  22. package/dist/types/components/internal/Address/types.d.ts +4 -0
  23. package/dist/types/components/internal/Address/utils.d.ts +5 -5
  24. package/dist/types/components/internal/DecisionMakerRole/types.d.ts +2 -0
  25. package/dist/types/components/internal/EntityGuidanceStatus/types.d.ts +1 -1
  26. package/dist/types/components/internal/Modal/Modal.d.ts +1 -1
  27. package/dist/types/components/internal/Svg/svgs.d.ts +2 -1
  28. package/dist/types/core/hooks/singpass/useSingpassMyInfoLogin.d.ts +3 -0
  29. package/dist/types/utils/entity-status-util.d.ts +12 -1
  30. package/dist/types/utils/mapping/componentApiMapping.d.ts +12 -16
  31. package/package.json +1 -1
  32. package/dist/es/cross-circle-fill-BafKD3Av.js +0 -8
  33. package/dist/types/components/Company/trusted-fields.d.ts +0 -7
  34. package/dist/types/components/internal/EntityGuidanceStatus/component/EntityGuidanceLegend.d.ts +0 -3
  35. package/dist/types/components/internal/EntityGuidanceStatus/index.d.ts +0 -3
@@ -132,6 +132,7 @@ const defaultTrans = {
132
132
  annualTurnoverHelper: "The annual sales revenue minus all discounts and sales taxes. Also known as net sales.",
133
133
  annualTurnoverValue: "Annual turnover value",
134
134
  apartmentSuite: "Apartment / Suite",
135
+ apartmentSuiteOther: "Apt, suite, other",
135
136
  apartmentSuiteOptional: "Apartment / Suite (optional)",
136
137
  areYouACompany: "Are you a company?",
137
138
  areYouAnIndividual: "Are you an individual?",
@@ -320,6 +321,7 @@ const defaultTrans = {
320
321
  currencyCode: "Currency code",
321
322
  currencyPlaceholder: "Select a currency code",
322
323
  cyRegistrationNumber: "Αριθμός Εγγραφής",
324
+ dateCannotBeInTheFuture: "Date cannot be in the future",
323
325
  dateDeedWasSigned: "Date deed was signed",
324
326
  dateOfIncorporation: "Date of incorporation",
325
327
  dateOnDocumentNoOlderThanXMonths: "Date on the document is no older than %{numberOfMonths} months",
@@ -962,6 +964,7 @@ const defaultTrans = {
962
964
  no: "No",
963
965
  noGlare: "No glare",
964
966
  noGoBack: "No, go back",
967
+ noIdontKnow: "No / I don't know",
965
968
  noOptionsFound: "No options found",
966
969
  nonProfitOrCharitableOrgDescription: "Your organization has official non-profit or tax-exempt status.",
967
970
  nonProfitOrCharitableOrgTitle: "Non-profit or charitable organization",
@@ -1005,7 +1008,7 @@ const defaultTrans = {
1005
1008
  orSoleProprietorshipName: "or sole proprietorship's name",
1006
1009
  organisasjonsnummer: "Organisasjonsnummer",
1007
1010
  organisationsnummer: "Organisationsnummer",
1008
- otherAddressInformation: "Other address information (optional)",
1011
+ otherAddressInformation: "Other address information",
1009
1012
  otherBusinessInformation: "Other business information",
1010
1013
  otherInformation: "Other information",
1011
1014
  otherLegalMeasures: "Yes, the company is facing other legal measures",
@@ -1056,12 +1059,16 @@ const defaultTrans = {
1056
1059
  phoneNumber: "Phone number",
1057
1060
  pleaseEnsureTheFollowing: "Please ensure the following section is fulfilled to complete the review of your data.",
1058
1061
  pleaseEnterAPhoneNumberPrefixedWithCountryCode: "Please enter a phone number prefixed with a country code e.g. %{defaultPrefix}.",
1062
+ pleaseEnterAValidNumber: "Please enter a valid number.",
1063
+ pleaseEnterAValidWholeNumber: "Please enter a valid whole number.",
1059
1064
  pleaseNote: "Please note:",
1060
1065
  pleaseProvideThePurposeOfCharitableTrust: "Please provide the purpose of your charitable trust",
1061
1066
  pooledSuperannuationTrust: "Pooled superannuation trust",
1062
1067
  postalCode: "Postal code",
1063
1068
  poweredBy: "Powered by",
1064
1069
  previous: "Previous",
1070
+ principalPlaceOfBusiness: "Principal place of business",
1071
+ principalPlaceOfBusinessDescription: "The physical location where a business's key officers oversee and manage its operations: this is usually the main office or headquarters.",
1065
1072
  privateCompanyDescription: "Your company is owned privately and not traded on a public stock exchange. ",
1066
1073
  privateCompanyTitle: "Private company",
1067
1074
  processing: "Processing",
@@ -1108,6 +1115,8 @@ const defaultTrans = {
1108
1115
  registeredAddressHeaderDescription__PR: "Your address as it appears on your Department of State Registration.",
1109
1116
  registeredAddressHeaderDescription__US: "Your address as it appears on your Secretary of State Registration.",
1110
1117
  registeredAddressTrustHeaderDescription: "The address registered to your trust",
1118
+ registeredBusinessAddress: "Registered business address",
1119
+ registeredBusinessAddressDescription: "Your business's official address used for government and other legal purposes.",
1111
1120
  registrationAddress: "Registration address",
1112
1121
  registrationDetails: "Registration details",
1113
1122
  registrationDocument: "Registration document",
@@ -1191,6 +1200,7 @@ const defaultTrans = {
1191
1200
  routingNumber: "Routing number",
1192
1201
  routingNumberVisible: "Includes your routing number",
1193
1202
  salarySlip: "Salary slip",
1203
+ sameAsRegisteredAddress: "Same as registered business address",
1194
1204
  sameNameAsLegalName: "Same as legal name of the company",
1195
1205
  "save&Leave": "Save & leave",
1196
1206
  saveAndGoToOverview: "Save and go to overview",
@@ -1230,6 +1240,7 @@ const defaultTrans = {
1230
1240
  siRegistrationNumber: "Matična številka",
1231
1241
  siTaxId: "Identifikacijska številka za DDV (ID za DDV)",
1232
1242
  sign: "Sign",
1243
+ signAndContinue: "Sign and continue",
1233
1244
  signServiceAgreement: "Sign services agreement",
1234
1245
  signatory: "Signatory",
1235
1246
  signatoryDescription: "Authorized to sign contracts on behalf of the company",
@@ -1448,6 +1459,7 @@ const defaultTrans = {
1448
1459
  xCharactersLeft: "%{charactersLeft} characters left",
1449
1460
  xMinutes: "%{minutes} minutes",
1450
1461
  xMinutesAndYSeconds: "%{minutes} and %{seconds}",
1462
+ XOfYSteps: "%{currentStep} of %{totalSteps} ",
1451
1463
  xSeconds: "%{seconds} seconds",
1452
1464
  yes: "Yes",
1453
1465
  yesChange: "Yes, change",
@@ -2404,11 +2416,13 @@ const svgs = {
2404
2416
  bin: lazy(() => import("./bin-D7a-dmmy.js")),
2405
2417
  check: lazy(() => import("./checkmark-DS0ypPvH.js")),
2406
2418
  checkmark: lazy(() => import("./checkmark-circle-fill-hZq1T5e9.js")),
2419
+ "checkmark-circle-fill": lazy(() => import("./checkmark-circle-fill-hZq1T5e9.js")),
2407
2420
  "checkmark-small": lazy(() => import("./checkmark-small-4ciES6ZR.js")),
2408
2421
  "chevron-down": lazy(() => import("./chevron-down-CSdvSDZq.js")),
2409
2422
  "chevron-right": lazy(() => import("./chevron-right-B5NJn8is.js")),
2410
2423
  "chevron-left": lazy(() => import("./chevron-left-Ctf1pv5s.js")),
2411
2424
  "chevron-up": lazy(() => import("./chevron-up-CXPd5NYI.js")),
2425
+ circle: lazy(() => import("./circle-F380_Tya.js")),
2412
2426
  company: lazy(() => import("./headquarter-BVHLaPzn.js")),
2413
2427
  "company-2": lazy(() => import("./hotel-DLFFe_Ls.js")),
2414
2428
  contract: lazy(() => import("./contract-DFZ6WwMd.js")),
@@ -2439,7 +2453,6 @@ const svgs = {
2439
2453
  upload: lazy(() => import("./upload-XwV0PfcC.js")),
2440
2454
  "users-3": lazy(() => import("./4-people-BTQ6Okmp.js")),
2441
2455
  warning: lazy(() => import("./warning-filled-Od0v7tGX.js")),
2442
- wrong: lazy(() => import("./cross-circle-fill-BafKD3Av.js")),
2443
2456
  // images
2444
2457
  "document-blurred": lazy(() => import("./document-blurred-gtj03M4x.js")),
2445
2458
  "document-cutoff": lazy(() => import("./document-cut-off-D2vCeeIS.js")),
@@ -2469,7 +2482,7 @@ const svgs = {
2469
2482
  "plaid-logo": lazy(() => import("./plaid-logo-4nYeR9iX.js")),
2470
2483
  "trustly-logo": lazy(() => import("./trustly-logo-YJslAOYF.js"))
2471
2484
  };
2472
- const unscalableIconNames = ["arrow-left", "arrow-right", "bank", "bin", "check", "checkmark", "checkmark-small", "chevron-down", "chevron-right", "chevron-left", "chevron-up", "company", "company-2", "contract", "cross", "decision-maker", "document", "download", "edit", "info-circle", "field-error", "image", "light-bulb", "location", "more-horiz", "new-document", "payout", "pci", "plus", "plus-small", "remove", "save", "search", "store", "trust", "user", "user-business", "upload", "users-3", "warning", "wrong"];
2485
+ const unscalableIconNames = ["bin", "check", "checkmark", "checkmark-small", "chevron-right", "chevron-left", "company", "contract", "cross", "decision-maker", "document", "download", "edit", "info-circle", "image", "location", "payout", "pci", "plus", "remove", "save", "search", "trust", "user", "upload", "warning"];
2473
2486
  const logger$H = createLogger("Icon");
2474
2487
  const Svg = ({
2475
2488
  className,
@@ -2485,7 +2498,7 @@ const Svg = ({
2485
2498
  return null;
2486
2499
  }
2487
2500
  return jsx("span", {
2488
- className: cx(`adyen-kyc-${type} adyen-kyc-${type}-${name}`, className),
2501
+ className: cx(`adyen-kyc-${type}`, className),
2489
2502
  "data-testid": testId,
2490
2503
  children: jsx(Suspense, {
2491
2504
  fallback: null,
@@ -2768,15 +2781,6 @@ function useFormRouterContext() {
2768
2781
  return context;
2769
2782
  }
2770
2783
  const logger$G = createLogger("Link");
2771
- const getIconClass = (icon, external) => {
2772
- if (external) {
2773
- return "adyen-kyc-link__icon adyen-kyc-icon-external-link";
2774
- }
2775
- if (icon) {
2776
- return `adyen-kyc-link__icon`;
2777
- }
2778
- return null;
2779
- };
2780
2784
  const isValidLink = (href) => {
2781
2785
  if (href === "#") {
2782
2786
  logger$G.error('Links must include a valid href. If your href is "#", consider using a Button instead');
@@ -2797,7 +2801,6 @@ const Link = ({
2797
2801
  const target = external ? "_blank" : "_self";
2798
2802
  const rel = external ? "external noopener noreferrer" : void 0;
2799
2803
  const showIcon = icon || external;
2800
- const iconClass = showIcon && getIconClass(icon, external);
2801
2804
  const classNames = showAsButton ? cx("adyen-kyc-button", className, {
2802
2805
  "adyen-kyc-button--icon": showIcon
2803
2806
  }) : cx("adyen-kyc-link", className, {
@@ -2812,9 +2815,9 @@ const Link = ({
2812
2815
  children: [jsx("span", {
2813
2816
  className: "adyen-kyc-link__text adyen-kyc-link--inherit",
2814
2817
  children
2815
- }), showIcon && icon && iconClass && jsx(Icon, {
2818
+ }), showIcon && icon && jsx(Icon, {
2816
2819
  name: icon,
2817
- className: iconClass
2820
+ className: "adyen-kyc-link__icon"
2818
2821
  })]
2819
2822
  });
2820
2823
  };
@@ -2919,7 +2922,7 @@ function getFormProps(props, innerFormId) {
2919
2922
  return null;
2920
2923
  }
2921
2924
  const activeFormId = (_a = props.activeForm) == null ? void 0 : _a.formId;
2922
- const trustedFields2 = ((_b = props.trustedFields) == null ? void 0 : _b[innerFormId]) ?? [];
2925
+ const trustedFields = ((_b = props.trustedFields) == null ? void 0 : _b[innerFormId]) ?? [];
2923
2926
  const readOnlyFields = ((_c = props.readOnlyFields) == null ? void 0 : _c[innerFormId]) ?? [];
2924
2927
  return {
2925
2928
  placeholders: ((_d = props.placeholders) == null ? void 0 : _d[innerFormId]) ?? {},
@@ -2928,12 +2931,12 @@ function getFormProps(props, innerFormId) {
2928
2931
  masks: ((_g = props.masks) == null ? void 0 : _g[innerFormId]) ?? {},
2929
2932
  data: ((_h = props.data) == null ? void 0 : _h[innerFormId]) ?? {},
2930
2933
  allFields: ((_i = props.allFields) == null ? void 0 : _i[innerFormId]) ?? [],
2931
- readOnlyFields: [...readOnlyFields, ...trustedFields2],
2934
+ readOnlyFields: [...readOnlyFields, ...trustedFields],
2932
2935
  requiredFields: ((_j = props.requiredFields) == null ? void 0 : _j[innerFormId]) ?? [],
2933
2936
  optionalFields: ((_k = props.optionalFields) == null ? void 0 : _k[innerFormId]) ?? [],
2934
2937
  obscuredFields: ((_l = props.obscuredFields) == null ? void 0 : _l[innerFormId]) ?? [],
2935
2938
  verifyFields: ((_m = props.verifyFields) == null ? void 0 : _m[innerFormId]) ?? [],
2936
- trustedFields: trustedFields2,
2939
+ trustedFields,
2937
2940
  trustedFieldsProvider: props.trustedFields,
2938
2941
  formVerificationErrors: ((_o = (_n = props.problems) == null ? void 0 : _n.verificationErrors) == null ? void 0 : _o[innerFormId]) ?? {},
2939
2942
  fieldValidationErrors: ((_q = (_p = props.problems) == null ? void 0 : _p.validationErrors) == null ? void 0 : _q[innerFormId]) ?? {},
@@ -2969,7 +2972,7 @@ function getNestedOuterFormPropsFromOuterFormProps(props, innerFormId) {
2969
2972
  optionalFields,
2970
2973
  obscuredFields,
2971
2974
  verifyFields,
2972
- trustedFields: trustedFields2,
2975
+ trustedFields,
2973
2976
  problems,
2974
2977
  validators: validators2,
2975
2978
  shouldValidate
@@ -2986,7 +2989,7 @@ function getNestedOuterFormPropsFromOuterFormProps(props, innerFormId) {
2986
2989
  optionalFields,
2987
2990
  obscuredFields,
2988
2991
  verifyFields,
2989
- trustedFields: trustedFields2,
2992
+ trustedFields,
2990
2993
  // the rest we just pass along for now, as they will be eventually be processed by getFormProps
2991
2994
  problems,
2992
2995
  validators: validators2,
@@ -3196,7 +3199,7 @@ function init({
3196
3199
  fieldProblems,
3197
3200
  obscuredFields,
3198
3201
  optionalFields,
3199
- trustedFields: trustedFields2,
3202
+ trustedFields,
3200
3203
  formatters,
3201
3204
  staticValidate,
3202
3205
  asyncValidate
@@ -3213,7 +3216,7 @@ function init({
3213
3216
  data: defaultData,
3214
3217
  obscuredFields,
3215
3218
  optionalFields,
3216
- trustedFields: trustedFields2
3219
+ trustedFields
3217
3220
  }
3218
3221
  },
3219
3222
  staticValidate,
@@ -3269,7 +3272,7 @@ function init({
3269
3272
  fieldProblems: {},
3270
3273
  obscuredFields,
3271
3274
  optionalFields,
3272
- trustedFields: trustedFields2
3275
+ trustedFields
3273
3276
  });
3274
3277
  return formData;
3275
3278
  }
@@ -3278,7 +3281,7 @@ function reducer({
3278
3281
  asyncValidate,
3279
3282
  obscuredFields,
3280
3283
  optionalFields,
3281
- trustedFields: trustedFields2,
3284
+ trustedFields,
3282
3285
  formatters
3283
3286
  }) {
3284
3287
  return (state, {
@@ -3350,7 +3353,7 @@ function reducer({
3350
3353
  fieldProblems,
3351
3354
  obscuredFields,
3352
3355
  optionalFields,
3353
- trustedFields: trustedFields2,
3356
+ trustedFields,
3354
3357
  staticValidate,
3355
3358
  asyncValidate
3356
3359
  });
@@ -3384,7 +3387,7 @@ function reducer({
3384
3387
  fieldProblems: updatedFieldProblems,
3385
3388
  obscuredFields,
3386
3389
  optionalFields,
3387
- trustedFields: trustedFields2,
3390
+ trustedFields,
3388
3391
  local
3389
3392
  };
3390
3393
  }
@@ -3578,7 +3581,7 @@ function useForm({
3578
3581
  fieldProblems,
3579
3582
  obscuredFields,
3580
3583
  optionalFields,
3581
- trustedFields: trustedFields2,
3584
+ trustedFields,
3582
3585
  formatters,
3583
3586
  shouldValidate = false
3584
3587
  }) {
@@ -3596,20 +3599,20 @@ function useForm({
3596
3599
  asyncValidate: triggerAsyncValidation,
3597
3600
  obscuredFields,
3598
3601
  optionalFields,
3599
- trustedFields: trustedFields2,
3602
+ trustedFields,
3600
3603
  formatters
3601
- }), [triggerStaticValidation, triggerAsyncValidation, obscuredFields, optionalFields, trustedFields2, formatters]);
3604
+ }), [triggerStaticValidation, triggerAsyncValidation, obscuredFields, optionalFields, trustedFields, formatters]);
3602
3605
  const initialData = useMemo(() => ({
3603
3606
  schema: getSchema,
3604
3607
  defaultData,
3605
3608
  fieldProblems,
3606
3609
  obscuredFields,
3607
3610
  optionalFields,
3608
- trustedFields: trustedFields2,
3611
+ trustedFields,
3609
3612
  formatters,
3610
3613
  staticValidate: triggerStaticValidation,
3611
3614
  asyncValidate: triggerAsyncValidation
3612
- }), [getSchema, defaultData, fieldProblems, obscuredFields, optionalFields, trustedFields2, formatters, triggerStaticValidation, triggerAsyncValidation]);
3615
+ }), [getSchema, defaultData, fieldProblems, obscuredFields, optionalFields, trustedFields, formatters, triggerStaticValidation, triggerAsyncValidation]);
3613
3616
  const [state, dispatch] = useReducer(getReducer(), initialData, init);
3614
3617
  const isValid = useMemo(() => {
3615
3618
  var _a;
@@ -11908,10 +11911,10 @@ const LABELS = {
11908
11911
  },
11909
11912
  otherAddressInformation: {
11910
11913
  default: OTHER_ADDRESS_INFORMATION,
11911
- [CountryCodes.Canada]: "apartmentSuiteOptional",
11912
- [CountryCodes.PuertoRico]: "apartmentSuiteOptional",
11914
+ [CountryCodes.Canada]: "apartmentSuiteOther",
11915
+ [CountryCodes.PuertoRico]: "apartmentSuiteOther",
11913
11916
  // should exactly match CountryCodes.UnitedStates
11914
- [CountryCodes.UnitedStates]: "apartmentSuiteOptional"
11917
+ [CountryCodes.UnitedStates]: "apartmentSuiteOther"
11915
11918
  },
11916
11919
  postalCode: {
11917
11920
  default: POSTAL_CODE,
@@ -11940,13 +11943,17 @@ const LABELS = {
11940
11943
  };
11941
11944
  const getKeyForField = (fieldName, country) => country ? LABELS[fieldName][country] || LABELS[fieldName].default : LABELS[fieldName].default;
11942
11945
  const getAddressSchemaForCountry = (country) => ADDRESS_SCHEMAS[country] || ADDRESS_SCHEMAS.default;
11946
+ const getAddressSchemaLabelsByCountry = (country) => {
11947
+ const schema = getAddressSchemaForCountry(country);
11948
+ return schema.reduce((labels2, field) => ({
11949
+ ...labels2,
11950
+ [field]: getKeyForField(field, country)
11951
+ }), {});
11952
+ };
11943
11953
  const mapAddressLabels = (data, datasetUtils) => {
11944
- const {
11945
- country
11946
- } = data;
11947
- if (country) {
11954
+ if (data == null ? void 0 : data.country) {
11948
11955
  return Object.entries(data).reduce((mappedAddress, [field, value]) => {
11949
- const mappedKey = getKeyForField(field, country);
11956
+ const mappedKey = getKeyForField(field, data.country);
11950
11957
  switch (field) {
11951
11958
  case "country":
11952
11959
  return {
@@ -11956,7 +11963,7 @@ const mapAddressLabels = (data, datasetUtils) => {
11956
11963
  case "stateOrProvince":
11957
11964
  return {
11958
11965
  ...mappedAddress,
11959
- [mappedKey]: datasetUtils.getStateName(value, country)
11966
+ [mappedKey]: datasetUtils.getStateName(value, data.country)
11960
11967
  };
11961
11968
  default:
11962
11969
  return {
@@ -12022,7 +12029,8 @@ function FieldContainer(props) {
12022
12029
  hideField,
12023
12030
  maxlength,
12024
12031
  handleChangeFor,
12025
- readOnly
12032
+ readOnly,
12033
+ optional
12026
12034
  } = props;
12027
12035
  const formUtils = formUtilities(props, i18n);
12028
12036
  const errorMessage = formUtils.getErrorMessage(fieldName, errors, fieldProblems);
@@ -12042,7 +12050,7 @@ function FieldContainer(props) {
12042
12050
  country: errorMessage
12043
12051
  },
12044
12052
  labels: {
12045
- country: formUtils.getLabel(field)
12053
+ country: formUtils.getLabel(field, labelKey)
12046
12054
  },
12047
12055
  readonly: readOnly,
12048
12056
  classNameModifiers,
@@ -12061,7 +12069,7 @@ function FieldContainer(props) {
12061
12069
  stateOrProvince: errorMessage
12062
12070
  },
12063
12071
  labels: {
12064
- stateOrProvince: formUtils.getLabel(field)
12072
+ stateOrProvince: formUtils.getLabel(field, labelKey)
12065
12073
  },
12066
12074
  readonly: readOnly,
12067
12075
  classNameModifiers,
@@ -12075,6 +12083,7 @@ function FieldContainer(props) {
12075
12083
  classNameModifiers,
12076
12084
  errorMessage,
12077
12085
  isValid: valid[field],
12086
+ optional,
12078
12087
  children: (childProps) => jsx(InputText, {
12079
12088
  ...childProps,
12080
12089
  classNameModifiers,
@@ -12656,7 +12665,11 @@ const addressValidationRulesV4 = (country, i18n) => {
12656
12665
  errorMessage: "fieldIsRequired"
12657
12666
  }, {
12658
12667
  modes: ["blur"],
12659
- validate: (val) => !matchesRegex(EMOJI_REGEX, val) && !hasRepeatedCharacters(val) && !isInvalidName(val),
12668
+ validate: (input) => !matchesRegex(NO_ALPHABET_REGEX, input),
12669
+ errorMessage: "nameMustContainLetters"
12670
+ }, {
12671
+ modes: ["blur"],
12672
+ validate: (val) => !matchesRegex(EMOJI_REGEX, val) && !hasRepeatedCharacters(val) && !isInvalidName(val) && matchesRegex(INDIVIDUAL_VALID_CHAR_REGEX, val),
12660
12673
  errorMessage: "checkForTypos"
12661
12674
  }, {
12662
12675
  modes: ["blur"],
@@ -12688,7 +12701,11 @@ const addressValidationRulesV4 = (country, i18n) => {
12688
12701
  errorMessage: "fieldIsRequired"
12689
12702
  }, {
12690
12703
  modes: ["blur"],
12691
- validate: (val) => !hasRepeatedCharacters(val) && !isInvalidName(val),
12704
+ validate: (input) => !matchesRegex(NO_ALPHABET_REGEX, input),
12705
+ errorMessage: "nameMustContainLetters"
12706
+ }, {
12707
+ modes: ["blur"],
12708
+ validate: (val) => !matchesRegex(EMOJI_REGEX, val) && !hasRepeatedCharacters(val) && !isInvalidName(val) && matchesRegex(INDIVIDUAL_VALID_CHAR_REGEX, val),
12692
12709
  errorMessage: "checkForTypos"
12693
12710
  }, {
12694
12711
  modes: ["blur"],
@@ -12705,6 +12722,10 @@ const addressValidationRulesV4 = (country, i18n) => {
12705
12722
  modes: ["blur"],
12706
12723
  validate: (val) => !!val,
12707
12724
  errorMessage: "fieldIsRequired"
12725
+ }, {
12726
+ modes: ["blur"],
12727
+ validate: (input) => !matchesRegex(NO_ALPHABET_REGEX, input),
12728
+ errorMessage: "nameMustContainLetters"
12708
12729
  }, {
12709
12730
  modes: ["blur"],
12710
12731
  validate: (val) => !hasRepeatedCharacters(val) && !isInvalidName(val),
@@ -12716,7 +12737,11 @@ const addressValidationRulesV4 = (country, i18n) => {
12716
12737
  errorMessage: "fieldIsRequired"
12717
12738
  }, {
12718
12739
  modes: ["blur"],
12719
- validate: (val) => !hasRepeatedCharacters(val) && !isInvalidName(val),
12740
+ validate: (input) => !matchesRegex(NO_ALPHABET_REGEX, input),
12741
+ errorMessage: "nameMustContainLetters"
12742
+ }, {
12743
+ modes: ["blur"],
12744
+ validate: (val) => !matchesRegex(EMOJI_REGEX, val) && !hasRepeatedCharacters(val) && !isInvalidName(val) && matchesRegex(INDIVIDUAL_VALID_CHAR_REGEX, val),
12720
12745
  errorMessage: "checkForTypos"
12721
12746
  }]
12722
12747
  };
@@ -12725,6 +12750,7 @@ function Address(props) {
12725
12750
  const {
12726
12751
  data: dataProp,
12727
12752
  requiredFields: requiredFieldsProp,
12753
+ optionalFields: optionalFieldsProp = ["otherAddressInformation"],
12728
12754
  fieldValidationErrors: fieldValidationErrorsProp,
12729
12755
  formVerificationErrors: formVerificationErrorsProp,
12730
12756
  legalEntityId,
@@ -12775,11 +12801,13 @@ function Address(props) {
12775
12801
  formatters: addressFormatters,
12776
12802
  rules: isStrictNameAndAddressValidationEnabled ? rulesV4 : rules2,
12777
12803
  fieldProblems: fieldValidationErrorsProp,
12804
+ optionalFields: optionalFieldsProp,
12778
12805
  obscuredFields: []
12779
12806
  });
12780
12807
  const formUtils = formUtilities({
12781
12808
  ...props,
12782
- requiredFields
12809
+ requiredFields,
12810
+ optionalFields: optionalFieldsProp
12783
12811
  }, i18n);
12784
12812
  useEffect(() => {
12785
12813
  if (dataProp.country !== data.country && dataProp.country) {
@@ -12876,7 +12904,7 @@ function Address(props) {
12876
12904
  }
12877
12905
  }, [canAutofillVerifiedBusinessAddress, verifiedBusiness]);
12878
12906
  const getComponent = (fieldName) => {
12879
- if (!formUtils.isRequiredField(fieldName)) return null;
12907
+ if (!formUtils.isRequiredField(fieldName) && !formUtils.isOptionalField(fieldName)) return null;
12880
12908
  const hideField = fieldName === "country" && hideCountry;
12881
12909
  return jsx(FieldContainer, {
12882
12910
  classNameModifiers: [fieldName],
@@ -12890,6 +12918,7 @@ function Address(props) {
12890
12918
  hideField,
12891
12919
  "aria-label": formUtils.getLabel(fieldName, fieldName),
12892
12920
  readOnly: formUtils.isReadOnly(fieldName),
12921
+ optional: formUtils.isOptionalField(fieldName),
12893
12922
  trimOnBlur: true
12894
12923
  }, fieldName);
12895
12924
  };
@@ -14013,32 +14042,30 @@ const businessDetailsBaseMapping = {
14013
14042
  "basicInformation.stateOrProvince": "organization.registeredAddress.stateOrProvince",
14014
14043
  "basicInformation.registrationNumber": "organization.registrationNumber",
14015
14044
  "basicInformation.taxInformation": "organization.taxInformation",
14016
- "basicInformation.isUen": "organization.isUen",
14017
14045
  "companyStructure.entityType": "organization.type",
14018
14046
  "additionalInformation.legalCompanyName": "organization.legalName",
14019
14047
  "additionalInformation.legalFormDescription": "organization.legalFormDescription",
14020
14048
  "additionalInformation.dbaName": "organization.doingBusinessAs",
14021
14049
  "additionalInformation.registrationNumber": "organization.registrationNumber",
14022
14050
  "additionalInformation.taxInformation": "organization.taxInformation",
14023
- "additionalInformation.isUen": "organization.isUen",
14024
14051
  "additionalInformation.vatNumber": "organization.vatNumber",
14025
14052
  "additionalInformation.vatAbsenceReason": "organization.vatAbsenceReason",
14026
14053
  "additionalInformation.dateOfIncorporation": "organization.dateOfIncorporation",
14027
14054
  "additionalInformation.stockExchangeMIC": "organization.stockData.marketIdentifier",
14028
14055
  "additionalInformation.stockISIN": "organization.stockData.stockNumber",
14029
14056
  "additionalInformation.stockTickerSymbol": "organization.stockData.tickerSymbol",
14030
- "companyRegistrationAddress.registrationAddress.city": "organization.registeredAddress.city",
14031
- "companyRegistrationAddress.registrationAddress.country": "organization.registeredAddress.country",
14032
- "companyRegistrationAddress.registrationAddress.postalCode": "organization.registeredAddress.postalCode",
14033
- "companyRegistrationAddress.registrationAddress.stateOrProvince": "organization.registeredAddress.stateOrProvince",
14034
- "companyRegistrationAddress.registrationAddress.address": "organization.registeredAddress.street",
14035
- "companyRegistrationAddress.registrationAddress.otherAddressInformation": "organization.registeredAddress.street2",
14036
- "companyRegistrationAddress.operationalAddress.city": "organization.principalPlaceOfBusiness.city",
14037
- "companyRegistrationAddress.operationalAddress.country": "organization.principalPlaceOfBusiness.country",
14038
- "companyRegistrationAddress.operationalAddress.postalCode": "organization.principalPlaceOfBusiness.postalCode",
14039
- "companyRegistrationAddress.operationalAddress.stateOrProvince": "organization.principalPlaceOfBusiness.stateOrProvince",
14040
- "companyRegistrationAddress.operationalAddress.address": "organization.principalPlaceOfBusiness.street",
14041
- "companyRegistrationAddress.operationalAddress.otherAddressInformation": "organization.principalPlaceOfBusiness.street2"
14057
+ "additionalInformation.registrationAddress.city": "organization.registeredAddress.city",
14058
+ "additionalInformation.registrationAddress.country": "organization.registeredAddress.country",
14059
+ "additionalInformation.registrationAddress.postalCode": "organization.registeredAddress.postalCode",
14060
+ "additionalInformation.registrationAddress.stateOrProvince": "organization.registeredAddress.stateOrProvince",
14061
+ "additionalInformation.registrationAddress.address": "organization.registeredAddress.street",
14062
+ "additionalInformation.registrationAddress.otherAddressInformation": "organization.registeredAddress.street2",
14063
+ "additionalInformation.operationalAddress.city": "organization.principalPlaceOfBusiness.city",
14064
+ "additionalInformation.operationalAddress.country": "organization.principalPlaceOfBusiness.country",
14065
+ "additionalInformation.operationalAddress.postalCode": "organization.principalPlaceOfBusiness.postalCode",
14066
+ "additionalInformation.operationalAddress.stateOrProvince": "organization.principalPlaceOfBusiness.stateOrProvince",
14067
+ "additionalInformation.operationalAddress.address": "organization.principalPlaceOfBusiness.street",
14068
+ "additionalInformation.operationalAddress.otherAddressInformation": "organization.principalPlaceOfBusiness.street2"
14042
14069
  };
14043
14070
  const companyBaseMapping = {
14044
14071
  "companyNameAndCountry.country": "organization.registeredAddress.country",
@@ -14051,7 +14078,6 @@ const companyBaseMapping = {
14051
14078
  "companyRegistrationDetails.vatNumber": "organization.vatNumber",
14052
14079
  "companyRegistrationDetails.vatAbsenceReason": "organization.vatAbsenceReason",
14053
14080
  "companyRegistrationDetails.dateOfIncorporation": "organization.dateOfIncorporation",
14054
- "companyRegistrationDetails.isUen": "organization.isUen",
14055
14081
  "companyRegistrationDetails.stockExchangeMIC": "organization.stockData.marketIdentifier",
14056
14082
  "companyRegistrationDetails.stockISIN": "organization.stockData.stockNumber",
14057
14083
  "companyRegistrationDetails.stockTickerSymbol": "organization.stockData.tickerSymbol",
@@ -14092,7 +14118,6 @@ const companySearchBaseMapping = {
14092
14118
  "companyOtherDetails.vatNumber": "organization.vatNumber",
14093
14119
  "companyOtherDetails.vatAbsenceReason": "organization.vatAbsenceReason",
14094
14120
  "companyOtherDetails.dateOfIncorporation": "organization.dateOfIncorporation",
14095
- "companyOtherDetails.isUen": "organization.isUen",
14096
14121
  "companyOtherDetails.stockExchangeMIC": "organization.stockData.marketIdentifier",
14097
14122
  "companyOtherDetails.stockISIN": "organization.stockData.stockNumber",
14098
14123
  "companyOtherDetails.stockTickerSymbol": "organization.stockData.tickerSymbol"
@@ -14461,23 +14486,23 @@ const mapLegalEntityToCompany = (legalEntity, isChangingType, accountHolder) =>
14461
14486
  return companyCompData;
14462
14487
  };
14463
14488
  const mapCompanyToLegalEntity = (data) => {
14464
- var _a, _b, _c, _d, _e, _f;
14489
+ var _a, _b, _c, _d, _e, _f, _g;
14465
14490
  const requestObj = {
14466
14491
  ...formatObject(data, companyApiKeyMapping)
14467
14492
  };
14468
14493
  if (requestObj.organization.vatAbsenceReason) {
14469
14494
  requestObj.organization.vatNumber = "";
14470
14495
  }
14471
- const taxId = (_a = data.companyRegistrationDetails.taxInformation) == null ? void 0 : _a.find((tax) => {
14496
+ const taxId = (_b = (_a = data.companyRegistrationDetails.taxInformation) == null ? void 0 : _a.find((tax) => {
14472
14497
  var _a2;
14473
14498
  return tax.country === ((_a2 = data.companyNameAndCountry) == null ? void 0 : _a2.country);
14474
- }).number;
14475
- if (taxId || ((_b = data.companyRegistrationDetails) == null ? void 0 : _b.isUen)) {
14499
+ })) == null ? void 0 : _b.number;
14500
+ if (taxId || ((_c = data.companyRegistrationDetails) == null ? void 0 : _c.isUen)) {
14476
14501
  requestObj.organization = updateTaxInformation({
14477
- taxId: ((_c = data.companyRegistrationDetails) == null ? void 0 : _c.isUen) ? data.companyRegistrationDetails.registrationNumber : taxId,
14478
- country: (_d = data.companyNameAndCountry) == null ? void 0 : _d.country,
14479
- exemptedFromTax: (_e = data.companyRegistrationDetails) == null ? void 0 : _e.exemptedFromTax,
14480
- isUen: (_f = data.companyRegistrationDetails) == null ? void 0 : _f.isUen,
14502
+ taxId: ((_d = data.companyRegistrationDetails) == null ? void 0 : _d.isUen) ? data.companyRegistrationDetails.registrationNumber : taxId,
14503
+ country: (_e = data.companyNameAndCountry) == null ? void 0 : _e.country,
14504
+ exemptedFromTax: (_f = data.companyRegistrationDetails) == null ? void 0 : _f.exemptedFromTax,
14505
+ isUen: (_g = data.companyRegistrationDetails) == null ? void 0 : _g.isUen,
14481
14506
  entity: requestObj.organization
14482
14507
  });
14483
14508
  }
@@ -16658,7 +16683,8 @@ const DecisionMakerRoleComponent = (props) => {
16658
16683
  validators: validators2,
16659
16684
  fieldValidationErrors,
16660
16685
  requiredFields,
16661
- allowedRoles
16686
+ allowedRoles,
16687
+ trustedRoles
16662
16688
  } = props;
16663
16689
  const {
16664
16690
  i18n
@@ -16716,7 +16742,7 @@ const DecisionMakerRoleComponent = (props) => {
16716
16742
  onSelect: changeRoles,
16717
16743
  mapToSelectItem: (role) => ({
16718
16744
  ...makeSelectItemForRole(role, i18n),
16719
- disabled: !(allowedRoles == null ? void 0 : allowedRoles.includes(role))
16745
+ disabled: allowedRoles ? !(allowedRoles == null ? void 0 : allowedRoles.includes(role)) : trustedRoles.includes(role)
16720
16746
  })
16721
16747
  })
16722
16748
  })]
@@ -17612,10 +17638,13 @@ function PersonalDetailsComponent(props) {
17612
17638
  isExperimentEnabled
17613
17639
  } = useExperimentsContext();
17614
17640
  const isAgeVerificationEnabled = isExperimentEnabled("EnableAgeVerification");
17615
- const PERSONAL_DETAILS = props.id;
17616
17641
  const {
17617
- residencyCountry
17618
- } = props.data;
17642
+ id: PERSONAL_DETAILS,
17643
+ trustedRoles,
17644
+ data: {
17645
+ residencyCountry
17646
+ }
17647
+ } = props;
17619
17648
  const [externalErrors, setExternalErrors] = useState(null);
17620
17649
  const [status, setStatus] = useState("success");
17621
17650
  const stateRef = useRef({
@@ -17794,7 +17823,8 @@ function PersonalDetailsComponent(props) {
17794
17823
  ...decisionMakerRoleProps,
17795
17824
  taskType: props.taskType,
17796
17825
  dataStoreId: PERSONAL_DETAILS,
17797
- allowedRoles: props == null ? void 0 : props.allowedRoles
17826
+ allowedRoles: props == null ? void 0 : props.allowedRoles,
17827
+ trustedRoles
17798
17828
  }), hasRequiredFields(nameProps) && jsx(Name, {
17799
17829
  ...nameProps,
17800
17830
  dataStoreId: PERSONAL_DETAILS
@@ -18245,7 +18275,8 @@ function IndividualComponent(props) {
18245
18275
  allowedRoles: props == null ? void 0 : props.allowedRoles,
18246
18276
  capabilities: props.capabilities,
18247
18277
  parentLegalEntity: props.parentLegalEntity,
18248
- trustedFieldsProvider: props.trustedFieldsProvider
18278
+ trustedFieldsProvider: props.trustedFieldsProvider,
18279
+ trustedRoles: props.trustedRoles
18249
18280
  })
18250
18281
  }), jsx("div", {
18251
18282
  className: activeForm.formId !== addressFormID ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper",
@@ -19743,12 +19774,9 @@ function BankVerification(props) {
19743
19774
  heading
19744
19775
  }), jsxs("div", {
19745
19776
  className: "adyen-kyc-bank-verification-success",
19746
- children: [jsx("span", {
19747
- children: jsx("i", {
19748
- className: "adyen-kyc-icon adyen-kyc-icon-checkmark-small adyen-kyc-bank-verification-success__checkmark-icon",
19749
- role: "img",
19750
- "aria-hidden": "true"
19751
- })
19777
+ children: [jsx(Icon, {
19778
+ name: "check",
19779
+ className: "adyen-kyc-u-margin-x-24"
19752
19780
  }), jsxs("span", {
19753
19781
  children: [" ", i18n.get("youSuccessfullyVerifiedAccount")]
19754
19782
  })]
@@ -22715,7 +22743,7 @@ var EntityType = /* @__PURE__ */ ((EntityType2) => {
22715
22743
  EntityType2["LEGAL_ENTITY"] = "LegalEntity";
22716
22744
  return EntityType2;
22717
22745
  })(EntityType || {});
22718
- const UNRELATED_DATA_MISSING_ERROR_CODES = ["2_8036", "2_8064", "2_8067", "2_8183", "2_8189"];
22746
+ const UNRELATED_DATA_MISSING_ERROR_CODES = ["2_8036", "2_8064", "2_8067", "2_8183", "2_8189", "2_8190", "2_8191", "2_8193"];
22719
22747
  const UNRELATED_INVALID_INPUT_ERROR_CODES = ["1_14", "2_901", "2_902"];
22720
22748
  const getComponentMappingFromLEFieldPath = (context, entityType, isExperimentEnabled) => {
22721
22749
  if (!(context == null ? void 0 : context.key)) {
@@ -23916,7 +23944,7 @@ function getPropsFromConfigurations(scenarioConfiguration, forms2, remediationAc
23916
23944
  const masks = {};
23917
23945
  const validators2 = {};
23918
23946
  const obscuredFields = {};
23919
- const trustedFields2 = {};
23947
+ const trustedFields = {};
23920
23948
  if (!scenarioConfiguration) {
23921
23949
  return;
23922
23950
  }
@@ -23952,7 +23980,7 @@ function getPropsFromConfigurations(scenarioConfiguration, forms2, remediationAc
23952
23980
  }
23953
23981
  const isFieldTrusted = isTrustedField(trustedMappings, formId, field);
23954
23982
  if (isFieldTrusted) {
23955
- trustedFields2[formId] = trustedFields2[formId] ? [...trustedFields2[formId], field] : [field];
23983
+ trustedFields[formId] = trustedFields[formId] ? [...trustedFields[formId], field] : [field];
23956
23984
  }
23957
23985
  if (fieldConfigurations) {
23958
23986
  const customLabel = (_a3 = customLabels2 == null ? void 0 : customLabels2[field]) == null ? void 0 : _a3.call(customLabels2);
@@ -24023,7 +24051,7 @@ function getPropsFromConfigurations(scenarioConfiguration, forms2, remediationAc
24023
24051
  placeholders,
24024
24052
  validators: validators2,
24025
24053
  obscuredFields,
24026
- trustedFields: trustedFields2,
24054
+ trustedFields,
24027
24055
  helperText,
24028
24056
  masks
24029
24057
  };
@@ -24044,7 +24072,7 @@ const isFieldRequiredToRemediateDataMissingError = (formId, field, dataMissingEr
24044
24072
  const missingAndLinkedFields = addLinkedFields(missingFields);
24045
24073
  return missingAndLinkedFields.includes(makeTLDSFieldName(formId, field));
24046
24074
  };
24047
- const isTrustedField = (trustedFields2, formId, field) => trustedFields2 == null ? void 0 : trustedFields2.some((trustedField) => {
24075
+ const isTrustedField = (trustedFields, formId, field) => trustedFields == null ? void 0 : trustedFields.some((trustedField) => {
24048
24076
  const split = trustedField.split(".");
24049
24077
  return split[0] === formId && split[split.length - 1] === field;
24050
24078
  });
@@ -24281,11 +24309,8 @@ function VerifiedBusinessCard({
24281
24309
  })]
24282
24310
  })
24283
24311
  }].filter((item) => !!item.value), [address, addressLink, i18n, verifiedBusiness == null ? void 0 : verifiedBusiness.legalForm]);
24284
- return jsxs("section", {
24285
- children: [jsx(Typography, {
24286
- el: "h3",
24287
- children: i18n.get("verifiedInformation")
24288
- }), jsxs("div", {
24312
+ return jsx("section", {
24313
+ children: jsxs("div", {
24289
24314
  className: "adyen-kyc-verified-business-card",
24290
24315
  children: [jsx(StructuredList, {
24291
24316
  items: baseItems
@@ -24301,11 +24326,11 @@ function VerifiedBusinessCard({
24301
24326
  onClick: () => setExpanded(!expanded)
24302
24327
  })
24303
24328
  })]
24304
- })]
24329
+ })
24305
24330
  });
24306
24331
  }
24307
24332
  const ADDITIONAL_INFORMATION_FORM_ID = "additionalInformation";
24308
- const ADDITIONAL_INFORMATION_FIELDS = [...LEGAL_COMPANY_NAME_FIELD, ...DBA_NAME_FIELD, ...BUSINESS_REGISTRATION_NUMBER_FIELD, ...TAX_INFORMATION_FIELD, ...VAT_NUMBER_FIELD, ...DATE_OF_INCORPORATION_FIELD, ...STOCK_EXCHANGE_MIC_FIELD, ...STOCK_ISIN_FIELD, ...STOCK_TICKER_SYMBOL_FIELD, "legalFormDescription"];
24333
+ const ADDITIONAL_INFORMATION_FIELDS = [...LEGAL_COMPANY_NAME_FIELD, ...DBA_NAME_FIELD, ...BUSINESS_REGISTRATION_NUMBER_FIELD, ...TAX_INFORMATION_FIELD, ...VAT_NUMBER_FIELD, ...DATE_OF_INCORPORATION_FIELD, ...STOCK_EXCHANGE_MIC_FIELD, ...STOCK_ISIN_FIELD, ...STOCK_TICKER_SYMBOL_FIELD, "legalFormDescription", ...registrationAddressFields];
24309
24334
  function AdditionalInformationComponent({
24310
24335
  data,
24311
24336
  labels: labels2,
@@ -24322,11 +24347,13 @@ function AdditionalInformationComponent({
24322
24347
  obscuredFields,
24323
24348
  optionalFields,
24324
24349
  readOnlyFields,
24325
- trustedFields: trustedFields2,
24350
+ trustedFields,
24326
24351
  country,
24327
24352
  companyType = CompanyTypesValue.PRIVATE_COMPANY,
24328
24353
  verifiedBusiness,
24329
- showCompanyStructure
24354
+ showCompanyStructure,
24355
+ handleAddressSearch,
24356
+ handleFindAddress
24330
24357
  }) {
24331
24358
  var _a, _b, _c, _d;
24332
24359
  const {
@@ -24337,6 +24364,12 @@ function AdditionalInformationComponent({
24337
24364
  } = useI18nContext();
24338
24365
  const showVerified = !!verifiedBusiness;
24339
24366
  const showStockData = companyType === CompanyTypesValue.PUBLIC_COMPANY;
24367
+ const ADDRESS_SCHEMA2 = getAddressSchemaForCountry(country).filter((field) => {
24368
+ if (!COUNTRIES_WITH_STATES_DATASET.includes(country)) {
24369
+ return field !== "otherAddressInformation" && field !== "stateOrProvince";
24370
+ }
24371
+ return field !== "otherAddressInformation";
24372
+ });
24340
24373
  const initialFormUtilsProps = useMemo(() => ({
24341
24374
  data,
24342
24375
  labels: labels2,
@@ -24348,9 +24381,9 @@ function AdditionalInformationComponent({
24348
24381
  readOnlyFields,
24349
24382
  optionalFields,
24350
24383
  obscuredFields,
24351
- trustedFields: trustedFields2,
24384
+ trustedFields,
24352
24385
  shouldValidate
24353
- }), [data, labels2, placeholders, helperText, readOnly, allFields, requiredFields, readOnlyFields, optionalFields, obscuredFields, trustedFields2, shouldValidate]);
24386
+ }), [data, labels2, placeholders, helperText, readOnly, allFields, requiredFields, readOnlyFields, optionalFields, obscuredFields, trustedFields, shouldValidate]);
24354
24387
  const registrationNumberOptions = useMemo(() => getCompanyRegistrationNumberOptions(country, companyType), [country, companyType]);
24355
24388
  const defaultRegistrationNumberType = (data == null ? void 0 : data.registrationNumber) ? inferCompanyRegistrationNumberType(data == null ? void 0 : data.registrationNumber, country, companyType) : registrationNumberOptions == null ? void 0 : registrationNumberOptions[0].id;
24356
24389
  const [registrationNumberType, setRegistrationNumberType] = useState(defaultRegistrationNumberType);
@@ -24425,6 +24458,20 @@ function AdditionalInformationComponent({
24425
24458
  }
24426
24459
  }, initialFormUtilsProps);
24427
24460
  }, [companyType, country, initialFormUtilsProps, registrationNumberType, taxIdNumberType, vatNumberType]);
24461
+ const mergedDefaultData = useMemo(() => {
24462
+ if (!verifiedBusiness) return data;
24463
+ return {
24464
+ ...data,
24465
+ legalCompanyName: verifiedBusiness.name,
24466
+ registrationAddress: {
24467
+ address: verifiedBusiness.street,
24468
+ city: verifiedBusiness.city,
24469
+ postalCode: verifiedBusiness.zipcode,
24470
+ stateOrProvince: verifiedBusiness.state,
24471
+ country: verifiedBusiness.country
24472
+ }
24473
+ };
24474
+ }, [data, verifiedBusiness]);
24428
24475
  const {
24429
24476
  schema: formSchema,
24430
24477
  data: formData,
@@ -24433,10 +24480,11 @@ function AdditionalInformationComponent({
24433
24480
  fieldProblems: formFieldProblems,
24434
24481
  handleChangeFor,
24435
24482
  resetToDefaultData,
24436
- setErrors
24483
+ setErrors,
24484
+ setValid
24437
24485
  } = useForm({
24438
24486
  schema: getFormSchema2,
24439
- defaultData: data,
24487
+ defaultData: mergedDefaultData,
24440
24488
  rules: mergedFieldProps == null ? void 0 : mergedFieldProps.validators,
24441
24489
  optionalFields: mergedFieldProps == null ? void 0 : mergedFieldProps.optionalFields,
24442
24490
  obscuredFields: mergedFieldProps == null ? void 0 : mergedFieldProps.obscuredFields,
@@ -24458,9 +24506,7 @@ function AdditionalInformationComponent({
24458
24506
  if (verifiedBusiness && verifiedBusiness.name !== formData.legalCompanyName) return handleChangeFor("legalCompanyName")(verifiedBusiness.name);
24459
24507
  }, [formData.legalCompanyName, verifiedBusiness, showCompanyStructure]);
24460
24508
  useEffect(() => {
24461
- if (!verifiedBusiness && !showCompanyStructure) {
24462
- return resetToDefaultData();
24463
- }
24509
+ if (!verifiedBusiness && !showCompanyStructure) resetToDefaultData();
24464
24510
  }, [verifiedBusiness]);
24465
24511
  const showField = (fieldKeys) => fieldKeys.some((field) => {
24466
24512
  switch (field) {
@@ -24471,6 +24517,15 @@ function AdditionalInformationComponent({
24471
24517
  return formUtils.isRequiredField(field) || formUtils.isOptionalField(field);
24472
24518
  }
24473
24519
  });
24520
+ const handleRegistrationAddressChange = (state) => {
24521
+ handleChangeFor("registrationAddress")(state.data);
24522
+ setValid("registrationAddress", Boolean(state.isValid));
24523
+ };
24524
+ const handleOperationalAddressChange = (state) => {
24525
+ handleChangeFor("operationalAddress")(state.data);
24526
+ setValid("operationalAddress", Boolean(state.isValid));
24527
+ };
24528
+ const handleOperationalAddressIsSameChange = (isChecked) => isChecked ? handleChangeFor("operationalAddressIsSame")(operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_SAME) : handleChangeFor("operationalAddressIsSame")(operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME);
24474
24529
  return jsxs("form", {
24475
24530
  id: ADDITIONAL_INFORMATION_FORM_ID,
24476
24531
  className: "adyen-kyc-additional-information",
@@ -24482,12 +24537,25 @@ function AdditionalInformationComponent({
24482
24537
  verificationErrors: formVerificationErrors,
24483
24538
  validationErrors: fieldValidationErrors,
24484
24539
  formUtils
24485
- }), showVerified && jsx(VerifiedBusinessCard, {
24486
- verifiedBusiness
24540
+ }), showVerified && jsxs("div", {
24541
+ children: [jsx("div", {
24542
+ className: "adyen-kyc-additional-information__section-heading",
24543
+ children: jsx(Typography, {
24544
+ el: "h3",
24545
+ variant: "title",
24546
+ children: i18n.get("verifiedInformation")
24547
+ })
24548
+ }), jsx(VerifiedBusinessCard, {
24549
+ verifiedBusiness
24550
+ })]
24487
24551
  }), jsxs("fieldset", {
24488
- children: [showVerified && jsx(Typography, {
24489
- el: "h3",
24490
- children: i18n.get("otherBusinessInformation")
24552
+ children: [showVerified && jsx("div", {
24553
+ className: "adyen-kyc-additional-information__section-heading",
24554
+ children: jsx(Typography, {
24555
+ el: "h3",
24556
+ variant: "title",
24557
+ children: i18n.get("otherBusinessInformation")
24558
+ })
24491
24559
  }), showField(LEGAL_COMPANY_NAME_FIELD) && jsx("div", {
24492
24560
  className: "adyen-kyc-field-wrapper",
24493
24561
  children: jsx(LegalCompanyNameField, {
@@ -24578,7 +24646,8 @@ function AdditionalInformationComponent({
24578
24646
  country,
24579
24647
  canExempt: formUtils.isRequiredField("exemptedFromVat"),
24580
24648
  vatNumberType,
24581
- setVatNumberType
24649
+ setVatNumberType,
24650
+ shouldValidate
24582
24651
  })
24583
24652
  }), showField(DATE_OF_INCORPORATION_FIELD) && jsx("div", {
24584
24653
  className: "adyen-kyc-field-wrapper",
@@ -24595,9 +24664,13 @@ function AdditionalInformationComponent({
24595
24664
  })
24596
24665
  })]
24597
24666
  }), showStockData && jsxs("fieldset", {
24598
- children: [jsx(Typography, {
24599
- el: "h3",
24600
- children: i18n.get("stockExchangeInformation")
24667
+ children: [jsx("div", {
24668
+ className: "adyen-kyc-additional-information__section-heading",
24669
+ children: jsx(Typography, {
24670
+ el: "h3",
24671
+ variant: "title",
24672
+ children: i18n.get("stockExchangeInformation")
24673
+ })
24601
24674
  }), showField(STOCK_EXCHANGE_MIC_FIELD) && jsx("div", {
24602
24675
  className: "adyen-kyc-field-wrapper",
24603
24676
  children: jsx(StockExchangeMICField, {
@@ -24641,6 +24714,79 @@ function AdditionalInformationComponent({
24641
24714
  handleChangeFor
24642
24715
  })
24643
24716
  })]
24717
+ }), jsxs("fieldset", {
24718
+ children: [jsxs("div", {
24719
+ className: "adyen-kyc-additional-information__section-heading",
24720
+ children: [jsx(Typography, {
24721
+ el: "h3",
24722
+ variant: "title",
24723
+ children: i18n.get("registeredBusinessAddress")
24724
+ }), jsx(Typography, {
24725
+ el: "h4",
24726
+ variant: "caption",
24727
+ children: i18n.get("registeredBusinessAddressDescription")
24728
+ })]
24729
+ }), jsx(Address, {
24730
+ id: ADDITIONAL_INFORMATION_FORM_ID,
24731
+ addressType: "registrationAddress",
24732
+ data: {
24733
+ ...mergedDefaultData == null ? void 0 : mergedDefaultData.registrationAddress,
24734
+ country
24735
+ },
24736
+ labels: getAddressSchemaLabelsByCountry(country),
24737
+ countryCode: country,
24738
+ requiredFields: ADDRESS_SCHEMA2,
24739
+ shouldValidate,
24740
+ hideCountry: true,
24741
+ optionalFields: ["otherAddressInformation"],
24742
+ onChange: handleRegistrationAddressChange,
24743
+ handleAddressSearch,
24744
+ handleFindAddress,
24745
+ verifiedBusiness
24746
+ })]
24747
+ }), jsxs("fieldset", {
24748
+ children: [jsxs("div", {
24749
+ className: "adyen-kyc-additional-information__section-heading",
24750
+ children: [jsx(Typography, {
24751
+ el: "h3",
24752
+ variant: "title",
24753
+ children: i18n.get("principalPlaceOfBusiness")
24754
+ }), jsx(Typography, {
24755
+ el: "h4",
24756
+ variant: "caption",
24757
+ children: i18n.get("principalPlaceOfBusinessDescription")
24758
+ })]
24759
+ }), jsx(Field, {
24760
+ name: "operationalAddressIsSame",
24761
+ classNameModifiers: ["operationalAddressIsSame"],
24762
+ errorMessage: formErrors.operationalAddressIsSame,
24763
+ isValid: formValid.operationalAddressIsSame,
24764
+ children: (childProps) => jsx(Checkbox, {
24765
+ ...childProps,
24766
+ "aria-required": formUtils.isRequiredField("operationalAddressIsSame"),
24767
+ "aria-label": formUtils.getLabel("sameAsRegisteredAddress"),
24768
+ "aria-invalid": !formValid.operationalAddressIsSame,
24769
+ name: "operationalAddressIsSame",
24770
+ label: formUtils.getLabel("sameAsRegisteredAddress"),
24771
+ checked: formData.operationalAddressIsSame ? formData.operationalAddressIsSame === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_SAME : true,
24772
+ onChange: handleOperationalAddressIsSameChange
24773
+ })
24774
+ }), formData.operationalAddressIsSame === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME && jsx(Address, {
24775
+ id: ADDITIONAL_INFORMATION_FORM_ID,
24776
+ addressType: "operationalAddress",
24777
+ data: {
24778
+ ...mergedDefaultData == null ? void 0 : mergedDefaultData.operationalAddress,
24779
+ country
24780
+ },
24781
+ labels: getAddressSchemaLabelsByCountry(country),
24782
+ countryCode: country,
24783
+ requiredFields: ADDRESS_SCHEMA2,
24784
+ shouldValidate,
24785
+ optionalFields: ["otherAddressInformation"],
24786
+ onChange: handleOperationalAddressChange,
24787
+ handleAddressSearch,
24788
+ handleFindAddress
24789
+ })]
24644
24790
  })]
24645
24791
  });
24646
24792
  }
@@ -25051,7 +25197,7 @@ function BasicInformationComponent({
25051
25197
  obscuredFields,
25052
25198
  optionalFields,
25053
25199
  readOnlyFields,
25054
- trustedFields: trustedFields2,
25200
+ trustedFields,
25055
25201
  country,
25056
25202
  companyType = CompanyTypesValue.PRIVATE_COMPANY,
25057
25203
  isTopLevelEntity,
@@ -25105,9 +25251,9 @@ function BasicInformationComponent({
25105
25251
  readOnlyFields,
25106
25252
  optionalFields,
25107
25253
  obscuredFields,
25108
- trustedFields: trustedFields2,
25254
+ trustedFields,
25109
25255
  shouldValidate
25110
- }), [allFields, helperText, labels2, obscuredFields, optionalFields, placeholders, readOnly, readOnlyFields, requiredFields, trustedFields2, shouldValidate]);
25256
+ }), [allFields, helperText, labels2, obscuredFields, optionalFields, placeholders, readOnly, readOnlyFields, requiredFields, trustedFields, shouldValidate]);
25111
25257
  const registrationNumberOptions = useMemo(() => getCompanyRegistrationNumberOptions(country, companyType), [country, companyType]);
25112
25258
  const defaultRegistrationNumberType = (data == null ? void 0 : data.registrationNumber) ? inferCompanyRegistrationNumberType(data == null ? void 0 : data.registrationNumber, country, companyType) : (_a = registrationNumberOptions == null ? void 0 : registrationNumberOptions[0]) == null ? void 0 : _a.id;
25113
25259
  const [registrationNumberType, setRegistrationNumberType] = useState(defaultRegistrationNumberType);
@@ -25174,6 +25320,9 @@ function BasicInformationComponent({
25174
25320
  fieldProblems: formFieldProblems
25175
25321
  });
25176
25322
  }, [formSchema, formData, formErrors, formFieldProblems, formValid, updateStateSlice]);
25323
+ useEffect(() => {
25324
+ if (!isActiveForm && !(searchResults == null ? void 0 : searchResults.length)) setShowBusinessSelection(false);
25325
+ }, [isActiveForm, searchResults == null ? void 0 : searchResults.length, setShowBusinessSelection]);
25177
25326
  useEffect(() => {
25178
25327
  if (showBusinessSelection && showCompanyStructure && isActiveForm) {
25179
25328
  handleNextClick();
@@ -25639,12 +25788,6 @@ const getForms = (country) => ({
25639
25788
  formHeading: "additionalInformationFormHeading",
25640
25789
  fields: COUNTRIES_USING_COMPANY_SEARCH.includes(country) ? ADDITIONAL_INFORMATION_FIELDS.filter((field) => !FIELDS_NEEDED_FOR_COMPANY_SEARCH.includes(field)) : ADDITIONAL_INFORMATION_FIELDS
25641
25790
  },
25642
- companyRegistrationAddress: {
25643
- formId: "companyRegistrationAddress",
25644
- formName: "companyRegistrationAddressFormName",
25645
- formDescription: "companyRegistrationAddressFormDescription",
25646
- fields: ["registrationAddress", "operationalAddress", "operationalAddressIsSame"]
25647
- },
25648
25791
  companyRegistrationDocument: {
25649
25792
  formId: "companyRegistrationDocument",
25650
25793
  formName: "companyRegistrationDocumentFormName",
@@ -25686,7 +25829,7 @@ const mapBasicInformation = (data) => {
25686
25829
  }, {});
25687
25830
  };
25688
25831
  const mapAdditionalInformation = (data, legalEntity) => {
25689
- var _a, _b, _c, _d;
25832
+ var _a, _b, _c, _d, _e;
25690
25833
  if (!data) return;
25691
25834
  const dbaName = ((_a = legalEntity.organization) == null ? void 0 : _a.doingBusinessAs) ? ((_b = legalEntity.organization) == null ? void 0 : _b.doingBusinessAs) !== ((_c = legalEntity.organization) == null ? void 0 : _c.legalName) ? {
25692
25835
  hasDba: true
@@ -25694,6 +25837,7 @@ const mapAdditionalInformation = (data, legalEntity) => {
25694
25837
  hasDba: false
25695
25838
  } : {};
25696
25839
  const currentCountry = (_d = legalEntity.organization) == null ? void 0 : _d.registeredAddress.country;
25840
+ const operationalAddressIsSame = ((_e = legalEntity.organization) == null ? void 0 : _e.principalPlaceOfBusiness) ? operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME : operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_SAME;
25697
25841
  return entriesOf(data).reduce((acc, [field]) => {
25698
25842
  if (!COUNTRIES_USING_COMPANY_SEARCH.includes(currentCountry)) {
25699
25843
  return {
@@ -25709,7 +25853,8 @@ const mapAdditionalInformation = (data, legalEntity) => {
25709
25853
  }
25710
25854
  return acc;
25711
25855
  }, {
25712
- ...dbaName
25856
+ ...dbaName,
25857
+ operationalAddressIsSame
25713
25858
  });
25714
25859
  };
25715
25860
  const mapLegalEntityToBusinessDetailsSchema = (legalEntity, isChangingType, accountHolder) => {
@@ -25723,7 +25868,6 @@ const mapLegalEntityToBusinessDetailsSchema = (legalEntity, isChangingType, acco
25723
25868
  companyTaxDocument
25724
25869
  };
25725
25870
  return entriesOf(businessDetailsSchema).reduce((componentData, [key]) => {
25726
- var _a;
25727
25871
  switch (key) {
25728
25872
  case "basicInformation": {
25729
25873
  return {
@@ -25746,15 +25890,6 @@ const mapLegalEntityToBusinessDetailsSchema = (legalEntity, isChangingType, acco
25746
25890
  [key]: mapAdditionalInformation(businessDetailsSchema[key], legalEntity)
25747
25891
  };
25748
25892
  }
25749
- case "companyRegistrationAddress": {
25750
- return {
25751
- ...componentData,
25752
- [key]: {
25753
- ...businessDetailsSchema[key],
25754
- operationalAddressIsSame: ((_a = legalEntity.organization) == null ? void 0 : _a.principalPlaceOfBusiness) ? operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME : operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_SAME
25755
- }
25756
- };
25757
- }
25758
25893
  case "companyRegistrationDocument": {
25759
25894
  return {
25760
25895
  ...componentData,
@@ -25783,7 +25918,6 @@ function BusinessDetailsComponent(props) {
25783
25918
  country,
25784
25919
  isTopLevelEntity,
25785
25920
  activeForm,
25786
- problems,
25787
25921
  baseTrackingPayload,
25788
25922
  showCompanyStructure,
25789
25923
  showBusinessSelection,
@@ -25868,22 +26002,9 @@ function BusinessDetailsComponent(props) {
25868
26002
  country,
25869
26003
  companyType: companyStructure == null ? void 0 : companyStructure.entityType,
25870
26004
  verifiedBusiness,
25871
- showCompanyStructure
25872
- })
25873
- }), jsx("div", {
25874
- className: formWrapperClasses(forms2.companyRegistrationAddress.formId),
25875
- children: jsx(RegistrationAddressComponent, {
25876
- ...getNestedOuterFormPropsFromOuterFormProps(props, forms2.companyRegistrationAddress.formId),
25877
- id: forms2.companyRegistrationAddress.formId,
25878
- heading: i18n.get(forms2.companyRegistrationAddress.formName),
25879
- description: i18n.get(forms2.companyRegistrationAddress.formDescription, {
25880
- localizeFor: country
25881
- }),
25882
- country,
25883
- problems,
26005
+ showCompanyStructure,
25884
26006
  handleAddressSearch,
25885
- handleFindAddress,
25886
- verifiedBusiness
26007
+ handleFindAddress
25887
26008
  })
25888
26009
  }), jsx("div", {
25889
26010
  className: formWrapperClasses(forms2.companyRegistrationDocument.formId),
@@ -26137,32 +26258,37 @@ const Modal = ({
26137
26258
  onClose,
26138
26259
  children: jsxs("div", {
26139
26260
  className: "adyen-kyc-modal__wrapper",
26140
- children: [header && jsx("header", {
26141
- className: "adyen-kyc-modal__header",
26142
- children: header
26143
- }), jsx("section", {
26144
- className: "adyen-kyc-modal__content",
26145
- children
26261
+ children: [jsxs("div", {
26262
+ className: "adyen-kyc-modal__main",
26263
+ children: [jsxs("section", {
26264
+ className: "adyen-kyc-modal-top-bar",
26265
+ children: [onBack ? jsx(Button, {
26266
+ tertiary: true,
26267
+ "aria-label": "back",
26268
+ icon: "arrow-left",
26269
+ className: "adyen-kyc-modal-button-blur",
26270
+ onClick: onBack,
26271
+ shaded: true
26272
+ }) : jsx("div", {}), onClose ? jsx(Button, {
26273
+ tertiary: true,
26274
+ "aria-label": "close",
26275
+ icon: "cross",
26276
+ className: "adyen-kyc-modal-button-blur",
26277
+ onClick: onClose,
26278
+ shaded: true
26279
+ }) : jsx("div", {})]
26280
+ }), header && jsx("header", {
26281
+ className: "adyen-kyc-modal__header",
26282
+ children: header
26283
+ }), jsx("section", {
26284
+ className: "adyen-kyc-modal__content",
26285
+ children
26286
+ })]
26146
26287
  }), jsx("div", {
26147
26288
  children: footer && jsx("footer", {
26148
26289
  className: "adyen-kyc-modal__footer",
26149
26290
  children: footer
26150
26291
  })
26151
- }), jsxs("section", {
26152
- className: "adyen-kyc-modal-top-bar",
26153
- children: [onBack ? jsx(Button, {
26154
- tertiary: true,
26155
- "aria-label": "back",
26156
- icon: "arrow-left",
26157
- onClick: onBack,
26158
- shaded: true
26159
- }) : jsx("div", {}), jsx(Button, {
26160
- tertiary: true,
26161
- "aria-label": "close",
26162
- icon: "cross",
26163
- onClick: onClose,
26164
- shaded: true
26165
- })]
26166
26292
  })]
26167
26293
  })
26168
26294
  });
@@ -26399,30 +26525,48 @@ const StepProgressIndicator = ({
26399
26525
  activeStepIndex,
26400
26526
  stepsCount,
26401
26527
  fillBefore,
26402
- thick
26403
- }) => stepsCount > 0 ? jsx("div", {
26404
- "aria-label": `Step ${activeStepIndex} of ${stepsCount}`,
26405
- className: "adyen-kyc-progress",
26406
- role: "group",
26407
- children: jsx("ol", {
26408
- className: cx("adyen-kyc-progress__bar", {
26409
- "adyen-kyc-progress__bar--thick": thick
26410
- }),
26411
- children: range(stepsCount).map((stepNumber) => {
26412
- const isHighlighted = shouldHighlight(activeStepIndex, stepNumber, fillBefore);
26413
- return jsx("li", {
26414
- "aria-current": isHighlighted ? "step" : void 0,
26415
- className: cx("adyen-kyc-progress__step", {
26416
- "adyen-kyc-progress__step--active": isHighlighted
26417
- }),
26418
- children: jsx("span", {
26419
- className: "adyen-kyc-progress__step-label",
26420
- children: `Step ${stepNumber}: ${stepNumber < activeStepIndex ? "completed" : "not completed"}`
26421
- })
26422
- }, stepNumber);
26528
+ thick,
26529
+ circles
26530
+ }) => {
26531
+ const {
26532
+ i18n
26533
+ } = useI18nContext();
26534
+ if (stepsCount === 0 || stepsCount > 10) {
26535
+ return jsx(Typography, {
26536
+ variant: "caption",
26537
+ children: i18n.get("XOfYSteps", {
26538
+ values: {
26539
+ currentStep: activeStepIndex,
26540
+ totalSteps: stepsCount
26541
+ }
26542
+ })
26543
+ });
26544
+ }
26545
+ return jsx("div", {
26546
+ "aria-label": `Step ${activeStepIndex} of ${stepsCount}`,
26547
+ className: "adyen-kyc-progress",
26548
+ role: "group",
26549
+ children: jsx("ol", {
26550
+ className: cx("adyen-kyc-progress__bar", {
26551
+ "adyen-kyc-progress__bar--thick": thick,
26552
+ "adyen-kyc-progress__bar--circles": circles
26553
+ }),
26554
+ children: range(stepsCount).map((stepNumber) => {
26555
+ const isHighlighted = shouldHighlight(activeStepIndex, stepNumber, fillBefore);
26556
+ return jsx("li", {
26557
+ "aria-current": isHighlighted ? "step" : void 0,
26558
+ className: cx("adyen-kyc-progress__step", {
26559
+ "adyen-kyc-progress__step--active": isHighlighted
26560
+ }),
26561
+ children: jsx("span", {
26562
+ className: "adyen-kyc-progress__step-label",
26563
+ children: `Step ${stepNumber}: ${stepNumber < activeStepIndex ? "completed" : "not completed"}`
26564
+ })
26565
+ }, stepNumber);
26566
+ })
26423
26567
  })
26424
- })
26425
- }) : null;
26568
+ });
26569
+ };
26426
26570
  const DropinLayout = ({
26427
26571
  content,
26428
26572
  footer,
@@ -26464,7 +26608,6 @@ const DropinLayout = ({
26464
26608
  children: jsx("div", {
26465
26609
  className: "adyen-kyc-dropin__content",
26466
26610
  children: jsx("div", {
26467
- className: "adyen-kyc-dropin__content-main",
26468
26611
  children: content
26469
26612
  })
26470
26613
  })
@@ -26848,21 +26991,7 @@ const canSubmit$3 = (data) => MANDATORY_API_FIELDS.every((detail) => {
26848
26991
  return !isEmpty(value);
26849
26992
  });
26850
26993
  const isDocumentsRequired$3 = (forms2) => forms2.some((form) => documentFormsIds.includes(form.formId));
26851
- const removeConditionalForms = (forms2, problems, isSkippingCompanyStructure, isSkippingCompanyRegistrationDocument) => {
26852
- var _a;
26853
- const filteredForCompanyStructure = isSkippingCompanyStructure ? forms2.filter((f) => f.formId !== "companyStructure" && f.formId !== "companyType") : forms2;
26854
- switch (problems == null ? void 0 : problems.status) {
26855
- case 6:
26856
- return isSkippingCompanyRegistrationDocument && !Object.keys((problems == null ? void 0 : problems.remediationActions) ?? {}).includes("1_501") ? filteredForCompanyStructure.filter((f) => f.formId !== "companyRegistrationDocument") : filteredForCompanyStructure;
26857
- case 3:
26858
- return isSkippingCompanyRegistrationDocument && !((_a = problems == null ? void 0 : problems.missingData) == null ? void 0 : _a.some((missingData) => {
26859
- var _a2;
26860
- return (_a2 = missingData.remediatingActions) == null ? void 0 : _a2.some((remediation) => remediation.code === "1_501");
26861
- })) ? filteredForCompanyStructure.filter((f) => f.formId !== "companyRegistrationDocument") : filteredForCompanyStructure;
26862
- default:
26863
- return isSkippingCompanyRegistrationDocument ? filteredForCompanyStructure.filter((f) => f.formId !== "companyRegistrationDocument") : filteredForCompanyStructure;
26864
- }
26865
- };
26994
+ const removeConditionalForms = (forms2, isSkippingCompanyStructure) => isSkippingCompanyStructure ? forms2.filter((f) => f.formId !== "companyStructure" && f.formId !== "companyType") : forms2;
26866
26995
  const formatBasicInformation = (data, labels2, datasetUtils, companyType) => {
26867
26996
  var _a, _b, _c;
26868
26997
  const country = data == null ? void 0 : data.country;
@@ -26929,15 +27058,11 @@ const formatDataForSummary$1 = (data, forms2, labels2, i18n) => {
26929
27058
  }
26930
27059
  };
26931
27060
  case "additionalInformation":
26932
- return {
26933
- ...summaryData,
26934
- [form]: formatAdditionalInformation(data[form], labels2, (_e = data.basicInformation) == null ? void 0 : _e.country, (_f = data.companyStructure) == null ? void 0 : _f.entityType)
26935
- };
26936
- case "companyRegistrationAddress":
26937
27061
  return {
26938
27062
  ...summaryData,
26939
27063
  [form]: {
26940
27064
  hasInnerForms: true,
27065
+ additionalInformationFormName: formatAdditionalInformation(data[form], labels2, (_e = data.basicInformation) == null ? void 0 : _e.country, (_f = data.companyStructure) == null ? void 0 : _f.entityType),
26941
27066
  registrationAddress: mapAddressLabels(data[form].registrationAddress, datasetUtils),
26942
27067
  operationalAddress: data[form].operationalAddress ? mapAddressLabels(data[form].operationalAddress, datasetUtils) : void 0
26943
27068
  }
@@ -27026,7 +27151,7 @@ async function submit({
27026
27151
  companyStructure: ((_a = data.companyStructure) == null ? void 0 : _a.entityType) ?? null,
27027
27152
  countryOfRegistration: ((_b = data.basicInformation) == null ? void 0 : _b.country) ?? null,
27028
27153
  legalEntityName: ((_c = data.additionalInformation) == null ? void 0 : _c.legalCompanyName) ?? null,
27029
- usedAdditionalAddress: ((_d = data.companyRegistrationAddress) == null ? void 0 : _d.operationalAddressIsSame) === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME
27154
+ usedAdditionalAddress: ((_d = data.additionalInformation) == null ? void 0 : _d.operationalAddressIsSame) === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME
27030
27155
  };
27031
27156
  const savedLegalEntityData = mapLegalEntityToBusinessDetailsSchema(legalEntityResponse, isTargetLegalEntityType);
27032
27157
  const filteredData = removeOldDataBySchema(data, savedLegalEntityData);
@@ -27126,7 +27251,7 @@ function BusinessDetailsDropinComponent({
27126
27251
  handleClearCompanyData,
27127
27252
  onTypeSwitch
27128
27253
  }) {
27129
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
27254
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
27130
27255
  const {
27131
27256
  state: {
27132
27257
  currentState
@@ -27166,7 +27291,7 @@ function BusinessDetailsDropinComponent({
27166
27291
  return ((_a2 = currentState.data.basicInformation) == null ? void 0 : _a2.country) ?? country;
27167
27292
  }, [(_a = currentState.data.basicInformation) == null ? void 0 : _a.country, country]);
27168
27293
  const [initialData, setInitialData] = useState(mapLegalEntityToBusinessDetailsSchema(legalEntityResponse, Boolean(isTargetLegalEntityType), isNewEntryFlowEnabled ? accountHolder : void 0));
27169
- const [trustedFields2, setTrustedFields] = useState(legalEntityResponse.trustedFields);
27294
+ const [trustedFields, setTrustedFields] = useState(legalEntityResponse.trustedFields);
27170
27295
  const documentUtils = documentApiUtils(handleCreateDocument, handleGetDocument, handleUpdateDocument);
27171
27296
  useEffect(() => {
27172
27297
  var _a2;
@@ -27211,14 +27336,13 @@ function BusinessDetailsDropinComponent({
27211
27336
  isExperimentEnabled
27212
27337
  }), [currentCountry, currentState.data, isExperimentEnabled, taskType]);
27213
27338
  const initialForms = useMemo(() => getForms(currentCountry), [currentCountry]);
27214
- const derivedProps = useMemo(() => getPropsFromConfigurations(fieldConfigurations, initialForms, (currentProblems == null ? void 0 : currentProblems.remediationActions) ? Object.values(currentProblems == null ? void 0 : currentProblems.remediationActions) : [], (currentProblems == null ? void 0 : currentProblems.missingData) ?? [], legalEntityResponse ? getFieldsWithExistingData(legalEntityResponse, isExperimentEnabled) : [], customRules, {}, {}, trustedFields2), [fieldConfigurations, initialForms, currentProblems == null ? void 0 : currentProblems.remediationActions, currentProblems == null ? void 0 : currentProblems.missingData, legalEntityResponse, isExperimentEnabled, customRules, trustedFields2]);
27339
+ const derivedProps = useMemo(() => getPropsFromConfigurations(fieldConfigurations, initialForms, (currentProblems == null ? void 0 : currentProblems.remediationActions) ? Object.values(currentProblems == null ? void 0 : currentProblems.remediationActions) : [], (currentProblems == null ? void 0 : currentProblems.missingData) ?? [], legalEntityResponse ? getFieldsWithExistingData(legalEntityResponse, isExperimentEnabled) : [], customRules, {}, {}, trustedFields), [fieldConfigurations, initialForms, currentProblems == null ? void 0 : currentProblems.remediationActions, currentProblems == null ? void 0 : currentProblems.missingData, legalEntityResponse, isExperimentEnabled, customRules, trustedFields]);
27215
27340
  const isSkippingCompanyStructure = useEnableNewEntryFlow() && organizationTypesToSkipCompanyStructureForm.includes((_d = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _d.type) && accountHolder !== "aTrust";
27216
- const isSkippingCompanyRegistrationDocument = currentCountry === "CA" && ((_e = currentState.data.additionalInformation) == null ? void 0 : _e.registrationNumber) && ((_f = currentState.valid.additionalInformation) == null ? void 0 : _f.registrationNumber) && !((_g = currentState.data.companyRegistrationDocument) == null ? void 0 : _g.registrationDocument);
27217
27341
  const forms2 = useMemo(() => {
27218
27342
  const requiredForms = getRequiredForms(initialForms, derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields);
27219
27343
  const validityAddedForms = addValidityToForms(requiredForms, currentState.validityByForm, currentProblems);
27220
- return removeConditionalForms(validityAddedForms, currentProblems, currentCountry !== "US" ? isSkippingCompanyStructure : !showCompanyStructure, isSkippingCompanyRegistrationDocument);
27221
- }, [initialForms, derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields, currentState.validityByForm, currentProblems, currentCountry, isSkippingCompanyStructure, showCompanyStructure, isSkippingCompanyRegistrationDocument]);
27344
+ return removeConditionalForms(validityAddedForms, currentCountry !== "US" ? isSkippingCompanyStructure : !showCompanyStructure);
27345
+ }, [initialForms, derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields, currentState.validityByForm, currentProblems, currentCountry, isSkippingCompanyStructure, showCompanyStructure]);
27222
27346
  const canSubmitForm = useMemo(() => canSubmit$3(currentState.data) && hasDataChanged(initialData, currentState.data), [initialData, currentState.data]);
27223
27347
  const summaryData = useMemo(() => ({
27224
27348
  data: formatDataForSummary$1(currentState.data, forms2, derivedProps == null ? void 0 : derivedProps.labels, i18n),
@@ -27296,7 +27420,7 @@ function BusinessDetailsDropinComponent({
27296
27420
  return tinMatch ? handleNextClick() : void 0;
27297
27421
  }
27298
27422
  }
27299
- }, [currentCountry, (_h = currentState.data.basicInformation) == null ? void 0 : _h.taxInformation, fetchBusinessData, handleNextClick, searchForBusiness, handleVerifyBusinessData]);
27423
+ }, [currentCountry, (_e = currentState.data.basicInformation) == null ? void 0 : _e.taxInformation, fetchBusinessData, handleNextClick, searchForBusiness, handleVerifyBusinessData]);
27300
27424
  useEffect(() => {
27301
27425
  if (searchResults && !searchResults.length || isSearching === "error") {
27302
27426
  setShowCompanyStructure(true);
@@ -27308,7 +27432,7 @@ function BusinessDetailsDropinComponent({
27308
27432
  setShowCompanyStructure(false);
27309
27433
  resetBusinessData();
27310
27434
  }
27311
- }, [currentSearchName, (_i = currentState.data.basicInformation) == null ? void 0 : _i.businessName]);
27435
+ }, [currentSearchName, (_f = currentState.data.basicInformation) == null ? void 0 : _f.businessName]);
27312
27436
  const [showBusinessSelection, setShowBusinessSelection] = useState(false);
27313
27437
  const isBusinessSelection = useMemo(() => showBusinessSelection && activeForm.formId === "basicInformation", [activeForm.formId, showBusinessSelection]);
27314
27438
  const hideBack = useMemo(() => {
@@ -27339,7 +27463,7 @@ function BusinessDetailsDropinComponent({
27339
27463
  return gotoFormByFormIndex(index);
27340
27464
  }
27341
27465
  case "additionalInformation": {
27342
- if (verifiedBusiness) return gotoFormByFormIndex(index);
27466
+ if (verifiedBusiness || activeForm.formId !== "basicInformation") return gotoFormByFormIndex(index);
27343
27467
  if (!isBusinessSelection) {
27344
27468
  if (!!((_a2 = currentState.data.basicInformation) == null ? void 0 : _a2.businessName) && !!((_b2 = currentState.data.basicInformation) == null ? void 0 : _b2.country) && !!((_c2 = currentState.data.basicInformation) == null ? void 0 : _c2.stateOrProvince)) {
27345
27469
  findBusiness({
@@ -27355,7 +27479,7 @@ function BusinessDetailsDropinComponent({
27355
27479
  default:
27356
27480
  return gotoFormByFormIndex(index);
27357
27481
  }
27358
- }, [canSubmitForm, currentCountry, (_j = currentState.data.basicInformation) == null ? void 0 : _j.businessName, (_k = currentState.data.basicInformation) == null ? void 0 : _k.country, (_l = currentState.data.basicInformation) == null ? void 0 : _l.stateOrProvince, findBusiness, forms2, gotoFormByFormIndex, isBusinessSelection, searchResults, verifiedBusiness]);
27482
+ }, [canSubmitForm, currentCountry, (_g = currentState.data.basicInformation) == null ? void 0 : _g.businessName, (_h = currentState.data.basicInformation) == null ? void 0 : _h.country, (_i = currentState.data.basicInformation) == null ? void 0 : _i.stateOrProvince, findBusiness, forms2, gotoFormByFormIndex, isBusinessSelection, searchResults, verifiedBusiness, activeForm.formId]);
27359
27483
  const nextClick = useCallback(() => {
27360
27484
  var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
27361
27485
  if (!COUNTRIES_USING_COMPANY_SEARCH.includes(currentCountry)) return handleNextClick();
@@ -27378,7 +27502,7 @@ function BusinessDetailsDropinComponent({
27378
27502
  default:
27379
27503
  return handleNextClick();
27380
27504
  }
27381
- }, [currentCountry, handleNextClick, activeForm.formId, verifiedBusiness, (_m = currentState.validityByForm) == null ? void 0 : _m.basicInformation, (_n = currentState.data.basicInformation) == null ? void 0 : _n.businessName, (_o = currentState.data.basicInformation) == null ? void 0 : _o.country, (_p = currentState.data.basicInformation) == null ? void 0 : _p.stateOrProvince, isBusinessSelection, findBusiness]);
27505
+ }, [currentCountry, handleNextClick, activeForm.formId, verifiedBusiness, (_j = currentState.validityByForm) == null ? void 0 : _j.basicInformation, (_k = currentState.data.basicInformation) == null ? void 0 : _k.businessName, (_l = currentState.data.basicInformation) == null ? void 0 : _l.country, (_m = currentState.data.basicInformation) == null ? void 0 : _m.stateOrProvince, isBusinessSelection, findBusiness]);
27382
27506
  const backClick = useCallback(() => {
27383
27507
  if (!COUNTRIES_USING_COMPANY_SEARCH.includes(country)) return handleNextClick();
27384
27508
  switch (activeForm.formId) {
@@ -27411,7 +27535,7 @@ function BusinessDetailsDropinComponent({
27411
27535
  }, [clearTrustedBusinessData]);
27412
27536
  useEffect(() => {
27413
27537
  var _a2;
27414
- if ((trustedFields2 == null ? void 0 : trustedFields2.length) && ((_a2 = legalEntityResponse.organization) == null ? void 0 : _a2.registeredAddress.country) !== currentCountry) {
27538
+ if ((trustedFields == null ? void 0 : trustedFields.length) && ((_a2 = legalEntityResponse.organization) == null ? void 0 : _a2.registeredAddress.country) !== currentCountry) {
27415
27539
  setTrustedFields(void 0);
27416
27540
  }
27417
27541
  }, [currentCountry]);
@@ -27520,9 +27644,9 @@ function CompanyDropinComponent({
27520
27644
  handleHomeClick,
27521
27645
  onTypeSwitch,
27522
27646
  onChange,
27523
- trustedFields: trustedFields2
27647
+ trustedFields
27524
27648
  }) {
27525
- var _a, _b, _c, _d, _e;
27649
+ var _a, _b;
27526
27650
  const {
27527
27651
  accountHolder,
27528
27652
  setAccountHolder
@@ -27601,12 +27725,11 @@ function CompanyDropinComponent({
27601
27725
  onChange == null ? void 0 : onChange(currentState);
27602
27726
  }, [currentState]);
27603
27727
  const isSkippingCompanyStructure = useEnableNewEntryFlow() && organizationTypesToSkipCompanyStructureForm.includes((_b = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _b.type) && accountHolder !== "aTrust";
27604
- const isSkippingCompanyRegistrationDocument = country === "CA" && ((_c = currentState.data.companyRegistrationDetails) == null ? void 0 : _c.registrationNumber) && ((_d = currentState.valid.companyRegistrationDetails) == null ? void 0 : _d.registrationNumber) && !((_e = currentState.data.companyRegistrationDocument) == null ? void 0 : _e.registrationDocument);
27605
27728
  const forms2 = useMemo(() => {
27606
27729
  const requiredForms = getRequiredForms(companyForms, derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields);
27607
27730
  const validityAddedForms = addValidityToForms(requiredForms, formValidity, problems);
27608
- return removeConditionalForms(validityAddedForms, problems, isSkippingCompanyStructure, isSkippingCompanyRegistrationDocument);
27609
- }, [derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields, formValidity, problems, isSkippingCompanyStructure, isSkippingCompanyRegistrationDocument]);
27731
+ return removeConditionalForms(validityAddedForms, isSkippingCompanyStructure);
27732
+ }, [derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields, formValidity, problems, isSkippingCompanyStructure]);
27610
27733
  const submitDocuments2 = async ({
27611
27734
  forms: forms22,
27612
27735
  legalEntity,
@@ -27757,7 +27880,7 @@ function CompanyDropinComponent({
27757
27880
  }, []);
27758
27881
  const datasetUtils = datasetUtilities(i18n.locale);
27759
27882
  const formatDataForSummary2 = (data2, forms22) => {
27760
- var _a2, _b2, _c2, _d2, _e2, _f, _g;
27883
+ var _a2, _b2, _c, _d, _e, _f, _g;
27761
27884
  let summaryData = cloneObject(data2);
27762
27885
  if (summaryData.companyNameAndCountry) {
27763
27886
  if (isCountryOfGoverningLawEnabled) {
@@ -27772,14 +27895,14 @@ function CompanyDropinComponent({
27772
27895
  const companyType = (_b2 = companyTypes.find((type) => type.id === summaryData.companyType.entityType)) == null ? void 0 : _b2.name;
27773
27896
  summaryData.companyType.entityType = i18n.get(companyType);
27774
27897
  }
27775
- if ((_c2 = summaryData.companyType) == null ? void 0 : _c2.accountHolder) {
27898
+ if ((_c = summaryData.companyType) == null ? void 0 : _c.accountHolder) {
27776
27899
  summaryData.companyType.accountHolder = i18n.get(summaryData.companyType.accountHolder);
27777
27900
  }
27778
- if ((_d2 = summaryData.companyRegistrationAddress) == null ? void 0 : _d2.registrationAddress) {
27901
+ if ((_d = summaryData.companyRegistrationAddress) == null ? void 0 : _d.registrationAddress) {
27779
27902
  summaryData.companyRegistrationAddress.hasInnerForms = true;
27780
27903
  summaryData.companyRegistrationAddress.registrationAddress = mapAddressLabels(summaryData.companyRegistrationAddress.registrationAddress, datasetUtils);
27781
27904
  }
27782
- if ((_e2 = summaryData.companyRegistrationAddress) == null ? void 0 : _e2.operationalAddress) {
27905
+ if ((_e = summaryData.companyRegistrationAddress) == null ? void 0 : _e.operationalAddress) {
27783
27906
  summaryData.companyRegistrationAddress.operationalAddress = mapAddressLabels(summaryData.companyRegistrationAddress.operationalAddress, datasetUtils);
27784
27907
  }
27785
27908
  if ((_f = summaryData.companyRegistrationDetails) == null ? void 0 : _f.vatAbsenceReason) {
@@ -27861,7 +27984,7 @@ function CompanyDropinComponent({
27861
27984
  ref: formRef,
27862
27985
  shouldValidate,
27863
27986
  isTopLevelEntity: taskType === TaskTypes.COMPANY,
27864
- readOnlyFields: trustedFields2
27987
+ readOnlyFields: trustedFields
27865
27988
  })
27866
27989
  });
27867
27990
  }
@@ -29154,9 +29277,9 @@ function CompanySearchDropinComponent({
29154
29277
  handleRefreshCompanyDataset,
29155
29278
  handleVerifyTin,
29156
29279
  onTypeSwitch,
29157
- trustedFields: trustedFields2
29280
+ trustedFields
29158
29281
  }) {
29159
- var _a, _b, _c, _d, _e, _f, _g;
29282
+ var _a, _b, _c, _d;
29160
29283
  const {
29161
29284
  state: {
29162
29285
  currentState
@@ -29241,12 +29364,11 @@ function CompanySearchDropinComponent({
29241
29364
  }
29242
29365
  }, [fieldConfigurations, problems == null ? void 0 : problems.remediationActions, problems == null ? void 0 : problems.missingData, legalEntityResponse, isExperimentEnabled, customRules, country]);
29243
29366
  const isSkippingCompanyStructure = useEnableNewEntryFlow() && organizationTypesToSkipCompanyStructureForm.includes((_d = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _d.type) && accountHolder !== "aTrust";
29244
- const isSkippingCompanyRegistrationDocument = country === "CA" && ((_e = currentState.data.companyOtherDetails) == null ? void 0 : _e.registrationNumber) && ((_f = currentState.valid.companyOtherDetails) == null ? void 0 : _f.registrationNumber) && !((_g = currentState.data.companyRegistrationDocument) == null ? void 0 : _g.registrationDocument);
29245
29367
  const forms$1 = useMemo(() => {
29246
29368
  const requiredForms = getRequiredForms(forms, derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields);
29247
29369
  const validityAddedForms = addValidityToForms(requiredForms, currentState.validityByForm, problems);
29248
- return removeConditionalForms(validityAddedForms, problems, isSkippingCompanyStructure, isSkippingCompanyRegistrationDocument);
29249
- }, [derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields, currentState.validityByForm, problems, isSkippingCompanyStructure, isSkippingCompanyRegistrationDocument]);
29370
+ return removeConditionalForms(validityAddedForms, isSkippingCompanyStructure);
29371
+ }, [derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields, currentState.validityByForm, problems, isSkippingCompanyStructure]);
29250
29372
  const summaryData = useMemo(() => ({
29251
29373
  data: formatDataForSummary(currentState.data, forms$1, derivedProps == null ? void 0 : derivedProps.labels, i18n),
29252
29374
  omittedKeys: ["operationalAddressIsSame"]
@@ -29338,7 +29460,7 @@ function CompanySearchDropinComponent({
29338
29460
  handleGetCompanyDataset,
29339
29461
  handleRefreshCompanyDataset,
29340
29462
  handleVerifyTin,
29341
- readOnlyFields: trustedFields2
29463
+ readOnlyFields: trustedFields
29342
29464
  })
29343
29465
  });
29344
29466
  }
@@ -29438,10 +29560,9 @@ const useHasSeenSingpassSelection = ({
29438
29560
  setHasSeenSingpassSelection
29439
29561
  };
29440
29562
  };
29441
- const getTrustedFieldsByProvider = (provider, trustedFields2) => trustedFields2.find((tf) => tf.provider === provider);
29442
- const parseTrustedFieldsIntoReadOnlyFields = (trustedFields2, mapping) => {
29563
+ const parseTrustedFieldsIntoReadOnlyFields = (trustedFields, mapping) => {
29443
29564
  const formFieldsMapped = [];
29444
- trustedFields2.fields.forEach((field) => {
29565
+ trustedFields.forEach((field) => {
29445
29566
  for (const [key, value] of Object.entries(mapping)) {
29446
29567
  if (value === field) {
29447
29568
  formFieldsMapped.push(key);
@@ -29463,17 +29584,6 @@ const parseTrustedFieldsIntoReadOnlyFields = (trustedFields2, mapping) => {
29463
29584
  });
29464
29585
  return readOnlyFields;
29465
29586
  };
29466
- const trustedFields = ({
29467
- fields,
29468
- trustedFieldsProvider,
29469
- apiMapping
29470
- }) => {
29471
- if (!fields || !trustedFieldsProvider || !apiMapping) {
29472
- return {};
29473
- }
29474
- const trustedFieldsOfProvider = getTrustedFieldsByProvider(trustedFieldsProvider, fields);
29475
- return trustedFieldsOfProvider ? parseTrustedFieldsIntoReadOnlyFields(trustedFieldsOfProvider, apiMapping) : {};
29476
- };
29477
29587
  const defaultSingpassState = {
29478
29588
  isLoading: false,
29479
29589
  isSuccess: false
@@ -29517,6 +29627,27 @@ const getApiMapping = (enableCompanySearchFlow, legalEntity) => {
29517
29627
  return companyComponentsKeyMapping;
29518
29628
  }
29519
29629
  };
29630
+ const getTrustedEntityAssociations = (legalEntityTrustedFields) => {
29631
+ const rawTrustedEntityAssociations = legalEntityTrustedFields.filter((f) => f.startsWith("entityAssociations")) ?? [];
29632
+ const leIdMap = {};
29633
+ rawTrustedEntityAssociations.forEach((rtea) => {
29634
+ const [_, role, leId] = rtea.split(".");
29635
+ const trustedRole = role;
29636
+ if (!leIdMap[leId]) {
29637
+ leIdMap[leId] = {
29638
+ roles: [trustedRole]
29639
+ };
29640
+ } else {
29641
+ leIdMap[leId] = {
29642
+ roles: [...leIdMap[leId].roles, trustedRole]
29643
+ };
29644
+ }
29645
+ });
29646
+ return Object.keys(leIdMap).map((reference) => ({
29647
+ reference,
29648
+ types: leIdMap[reference].roles
29649
+ }));
29650
+ };
29520
29651
  const useSingpassMyInfoLogin = ({
29521
29652
  legalEntity,
29522
29653
  accountHolder,
@@ -29530,6 +29661,7 @@ const useSingpassMyInfoLogin = ({
29530
29661
  const isSingpassForIndividualsEnabled = isExperimentEnabled("ShowSingPassButtonForIndividuals");
29531
29662
  const enableCompanySearchFlow = isExperimentEnabled("EnableCompanySearchFlow");
29532
29663
  const apiMapping = getApiMapping(enableCompanySearchFlow, legalEntity);
29664
+ const legalEntityTrustedFields = legalEntity == null ? void 0 : legalEntity.trustedFields;
29533
29665
  const isEligibleForSingpass = useMemo(() => {
29534
29666
  if (!legalEntity) {
29535
29667
  return false;
@@ -29550,17 +29682,13 @@ const useSingpassMyInfoLogin = ({
29550
29682
  const isVanillaIndividual = legalEntityType === LegalEntityType.INDIVIDUAL && !hasSoleProprietor;
29551
29683
  return isVanillaOrganization && isSingpassForCompaniesEnabled || isVanillaIndividual && isSingpassForIndividualsEnabled;
29552
29684
  }, [legalEntity, accountHolder, handleOpenSingpassAuthorizationLink]);
29553
- const trustedFields$1 = useMemo(() => {
29554
- const legalEntityTrustedFields = legalEntity == null ? void 0 : legalEntity.trustedFields;
29555
- if (!isEligibleForSingpass || !legalEntityTrustedFields) {
29556
- return {};
29557
- }
29558
- return trustedFields({
29559
- fields: legalEntityTrustedFields,
29560
- trustedFieldsProvider: TrustedFieldsProvider.SINGPASS,
29561
- apiMapping
29562
- });
29563
- }, [legalEntity, isEligibleForSingpass, apiMapping]);
29685
+ const singpassTrustedFields = useMemo(() => {
29686
+ var _a;
29687
+ const allTrustedFields = isEligibleForSingpass && legalEntityTrustedFields ? legalEntityTrustedFields : [];
29688
+ return ((_a = allTrustedFields.find((tf) => tf.provider === TrustedFieldsProvider.SINGPASS)) == null ? void 0 : _a.fields) || [];
29689
+ }, [isEligibleForSingpass, legalEntity]);
29690
+ const trustedFields = useMemo(() => apiMapping ? parseTrustedFieldsIntoReadOnlyFields(singpassTrustedFields, apiMapping) : {}, [singpassTrustedFields, apiMapping]);
29691
+ const trustedEntityAssociations = useMemo(() => getTrustedEntityAssociations(singpassTrustedFields), [singpassTrustedFields]);
29564
29692
  const handleInitiateSingpassMyInfoLogin = async () => {
29565
29693
  if (handleOpenSingpassAuthorizationLink) {
29566
29694
  dispatch({
@@ -29605,7 +29733,8 @@ const useSingpassMyInfoLogin = ({
29605
29733
  handleSingpassMyInfoLoginSuccess,
29606
29734
  handleSingpassMyInfoLoginFailure,
29607
29735
  handleSingpassMyInfoLoginReset,
29608
- trustedFields: trustedFields$1
29736
+ trustedFields,
29737
+ trustedEntityAssociations
29609
29738
  };
29610
29739
  };
29611
29740
  const logger$m = createLogger("useAssociatedLegalArrangement");
@@ -30445,17 +30574,9 @@ function useDataMissingRemediations({
30445
30574
  }
30446
30575
  };
30447
30576
  }
30448
- const iconStatus = (current, min, max) => {
30449
- const isEmpty2 = current === 0;
30450
- const isWithinObligatoryRange = current === max || min > 0 && current >= min;
30451
- const isWithinConditionalRange = current >= min;
30452
- if (isEmpty2) {
30453
- return min > 0 ? "obligatoryEmpty" : "conditionalEmpty";
30454
- }
30455
- if (isWithinObligatoryRange) {
30456
- return "obligatoryFinished";
30457
- }
30458
- return isWithinConditionalRange ? "conditionalFinished" : "conditionalEmpty";
30577
+ const iconStatus = (current, min) => {
30578
+ const isSatisfied = current > 0 && current >= min;
30579
+ return isSatisfied ? "satisfied" : "empty";
30459
30580
  };
30460
30581
  const getEntityStatusRuleDescription = (country, currentTask, entityLabel) => currentTask === TaskTypes.TRUST_MEMBER_OVERVIEW ? TRUST_DEFAULT_DESCRIPTIONS_MAP[entityLabel] : getDecisionMakerDescriptionMap(country)[entityLabel];
30461
30582
  const Status = ({
@@ -30831,67 +30952,26 @@ const EntityStatusIcon = ({
30831
30952
  status
30832
30953
  }) => {
30833
30954
  switch (status) {
30834
- case "obligatoryEmpty":
30835
- return jsx(Icon, {
30836
- name: "checkmark-small",
30837
- className: "adyen-kyc-entity-status__icon adyen-kyc-entity-status__icon--obligatory",
30838
- testId: "obligatoryEmpty-icon"
30839
- });
30840
- case "conditionalEmpty":
30841
- return jsx(Icon, {
30842
- name: "checkmark-small",
30843
- className: "adyen-kyc-entity-status__icon adyen-kyc-entity-status__icon--conditional",
30844
- testId: "conditionalEmpty-icon"
30845
- });
30846
- case "obligatoryFinished":
30955
+ case "empty":
30847
30956
  return jsx(Icon, {
30848
- name: "checkmark-small",
30849
- className: "adyen-kyc-entity-status__icon adyen-kyc-entity-status__icon--obligatory-success",
30850
- testId: "obligatoryFinished-icon"
30957
+ name: "circle",
30958
+ className: "adyen-kyc-entity-status__icon adyen-kyc-entity-status__icon--empty",
30959
+ testId: "empty-icon"
30851
30960
  });
30852
- case "conditionalFinished":
30961
+ case "satisfied":
30853
30962
  return jsx(Icon, {
30854
- name: "checkmark-small",
30855
- className: "adyen-kyc-entity-status__icon adyen-kyc-entity-status__icon--conditional-success",
30856
- testId: "conditionalFinished-icon"
30963
+ name: "checkmark-circle-fill",
30964
+ className: "adyen-kyc-entity-status__icon adyen-kyc-entity-status__icon--satisfied",
30965
+ testId: "satisfied-icon"
30857
30966
  });
30858
30967
  default:
30859
30968
  return jsx(Icon, {
30860
- name: "checkmark-small",
30861
- className: "adyen-kyc-entity-status__icon adyen-kyc-entity-status__icon--conditional",
30862
- testId: "conditionalEmpty-icon"
30969
+ name: "circle",
30970
+ className: "adyen-kyc-entity-status__icon adyen-kyc-entity-status__icon--empty",
30971
+ testId: "empty-icon"
30863
30972
  });
30864
30973
  }
30865
30974
  };
30866
- const EntityGuidanceLegend = () => {
30867
- const {
30868
- i18n
30869
- } = useI18nContext();
30870
- return jsxs("div", {
30871
- className: "adyen-kyc-entity-status__legend",
30872
- children: [jsxs("span", {
30873
- className: "adyen-kyc-entity-status__legend--rule",
30874
- children: [jsx(EntityStatusIcon, {
30875
- status: "obligatoryEmpty"
30876
- }), jsx("span", {
30877
- className: "adyen-kyc-entity-status--text",
30878
- dangerouslySetInnerHTML: {
30879
- __html: i18n.get("obligatory")
30880
- }
30881
- })]
30882
- }), jsxs("span", {
30883
- className: "adyen-kyc-entity-status__legend--rule",
30884
- children: [jsx(EntityStatusIcon, {
30885
- status: "conditionalEmpty"
30886
- }), jsx("span", {
30887
- className: "adyen-kyc-entity-status--text",
30888
- dangerouslySetInnerHTML: {
30889
- __html: i18n.get("requiredIfApplicable")
30890
- }
30891
- })]
30892
- })]
30893
- });
30894
- };
30895
30975
  const EntityGuidanceStatus = ({
30896
30976
  country,
30897
30977
  currentTask,
@@ -30927,8 +31007,7 @@ const DecisionMakersComponent = ({
30927
31007
  handleUpdateLegalEntity,
30928
31008
  navigateBackToTaskList,
30929
31009
  onDecisionMakerDelete,
30930
- disableAddDecisionMakers,
30931
- disableDeleteDecisionMakers
31010
+ trustedEntityAssociations
30932
31011
  }) => {
30933
31012
  var _a, _b;
30934
31013
  const {
@@ -31024,17 +31103,16 @@ const DecisionMakersComponent = ({
31024
31103
  children: [hasExpired && jsx(ExpiredBanner, {}), jsx(FormHeader, {
31025
31104
  heading: i18n.get("decisionMaker"),
31026
31105
  description: i18n.get("decisionMakerDescription")
31027
- }), jsx(EntityGuidanceLegend, {}), jsx("div", {
31106
+ }), jsx("div", {
31028
31107
  className: "adyen-kyc-decision-makers__container",
31029
31108
  children: availableDecisionMakers.map(({
31030
31109
  roleType,
31031
- min,
31032
- max
31110
+ min
31033
31111
  }) => jsx(EntityGuidanceStatus, {
31034
31112
  country: registeredCountry,
31035
31113
  currentTask: TaskTypes.DECISION_MAKER_OVERVIEW,
31036
31114
  entityLabel: roleType,
31037
- status: iconStatus(uniqueDecisionMakersPerType(roleType), min, max)
31115
+ status: iconStatus(uniqueDecisionMakersPerType(roleType), min)
31038
31116
  }, roleType))
31039
31117
  }), jsx(ContextGuidance, {
31040
31118
  page: "Decision makers",
@@ -31068,7 +31146,7 @@ const DecisionMakersComponent = ({
31068
31146
  removeEntity: () => {
31069
31147
  deleteDecisionMaker(decisionMaker);
31070
31148
  },
31071
- isRemoveDisabled: isRemoveDisabled || disableDeleteDecisionMakers,
31149
+ isRemoveDisabled: isRemoveDisabled || trustedEntityAssociations.some((ea) => ea.reference === decisionMaker.reference),
31072
31150
  handleIsRemoveDisabled: setIsRemoveDisabled
31073
31151
  }, decisionMaker.reference))
31074
31152
  }) : null, jsx(Button, {
@@ -31079,7 +31157,7 @@ const DecisionMakersComponent = ({
31079
31157
  icon: "plus",
31080
31158
  onClick: addDecisionMakerOnClick,
31081
31159
  label: i18n.get("addDecisionMaker"),
31082
- disabled: haveMaxDecisionMakers || disableAddDecisionMakers
31160
+ disabled: haveMaxDecisionMakers
31083
31161
  }), jsx(ActionBar, {
31084
31162
  onHome: () => {
31085
31163
  userEvents.addEvent("Saved decision makers list", {
@@ -32457,18 +32535,17 @@ const TrustMembersOverview = ({
32457
32535
  children: [hasExpired && jsx(ExpiredBanner, {}), jsx(FormHeader, {
32458
32536
  heading: i18n.get("trustMembers"),
32459
32537
  description: i18n.get("trustMembersDescription")
32460
- }), jsx(EntityGuidanceLegend, {}), jsx("div", {
32538
+ }), jsx("div", {
32461
32539
  className: "adyen-kyc-trust-members__container",
32462
32540
  children: trustMemberRequirements.map(({
32463
32541
  roleTypes,
32464
32542
  min,
32465
- max,
32466
32543
  label
32467
32544
  }) => jsx(EntityGuidanceStatus, {
32468
32545
  country: CountryCodes.Australia,
32469
32546
  currentTask: TaskTypes.TRUST_MEMBER_OVERVIEW,
32470
32547
  entityLabel: label,
32471
- status: iconStatus(trustMembersWithOneOfGivenRoles(roleTypes).length, min, max)
32548
+ status: iconStatus(trustMembersWithOneOfGivenRoles(roleTypes).length, min)
32472
32549
  }, label))
32473
32550
  }), jsx(ContextGuidance, {
32474
32551
  page: "Trust members",
@@ -32658,8 +32735,9 @@ function IndividualDropinComponent({
32658
32735
  hideNavigation = false,
32659
32736
  asModal = false,
32660
32737
  handleBackClick: externalBackClick,
32661
- trustedFields: trustedFields2,
32662
- trustedFieldsProvider
32738
+ trustedFields,
32739
+ trustedFieldsProvider,
32740
+ trustedRoles
32663
32741
  }) {
32664
32742
  var _a, _b, _c, _d;
32665
32743
  const {
@@ -32686,7 +32764,7 @@ function IndividualDropinComponent({
32686
32764
  let dataFromResponse = mapLegalEntityToIndividual(legalEntityResponse, isTargetLegalEntityType);
32687
32765
  const documentUtils = documentApiUtils(handleCreateDocument, handleGetDocument, handleUpdateDocument);
32688
32766
  let roleTypes = [];
32689
- const [newDecisionMaker, setNewDecisionMaker] = useState();
32767
+ const [newDecisionMaker] = useState();
32690
32768
  const [problems, setProblems] = useState(propProblems);
32691
32769
  const formRef = useRef(null);
32692
32770
  const [loadingStatus, setLoadingStatus] = useState("success");
@@ -32695,7 +32773,7 @@ function IndividualDropinComponent({
32695
32773
  const [country, setCountry] = useState(((_a = dataFromResponse == null ? void 0 : dataFromResponse.personalDetails) == null ? void 0 : _a.residencyCountry) ?? parentCountry);
32696
32774
  const [hideFooter, setHideFooter] = useState(false);
32697
32775
  const {
32698
- trustedFields: singpassTrustedFields
32776
+ trustedFields: associatedLegalEntityTrustedFields
32699
32777
  } = useSingpassMyInfoLogin({
32700
32778
  legalEntity: legalEntityResponse,
32701
32779
  accountHolder,
@@ -32820,7 +32898,6 @@ function IndividualDropinComponent({
32820
32898
  throw new Error("Provide handler to create legalEntity");
32821
32899
  }
32822
32900
  updatedLegalEntity = await handleCreateLegalEntity(legalEntity);
32823
- setNewDecisionMaker(legalEntity);
32824
32901
  userEvents.addEvent("Added decision maker", {
32825
32902
  segmentation: {
32826
32903
  ...baseTrackingPayload,
@@ -33155,8 +33232,9 @@ function IndividualDropinComponent({
33155
33232
  shouldValidate,
33156
33233
  accountHolder,
33157
33234
  parentLegalEntity,
33158
- trustedFields: !parentLegalEntity ? trustedFields2 : singpassTrustedFields,
33159
- trustedFieldsProvider
33235
+ trustedFields: !parentLegalEntity ? trustedFields : associatedLegalEntityTrustedFields,
33236
+ trustedFieldsProvider,
33237
+ trustedRoles
33160
33238
  })
33161
33239
  });
33162
33240
  }
@@ -34682,7 +34760,10 @@ function ServiceAgreementDropinComponent({
34682
34760
  taskType,
34683
34761
  serviceAgreementTypes,
34684
34762
  serviceAgreementAcceptanceInfos,
34685
- trackingConfig
34763
+ trackingConfig,
34764
+ asEmbedded = false,
34765
+ asModal = false,
34766
+ handleCloseClick
34686
34767
  }) {
34687
34768
  var _a, _b;
34688
34769
  const {
@@ -34966,7 +35047,7 @@ function ServiceAgreementDropinComponent({
34966
35047
  text: i18n.get("signed")
34967
35048
  })]
34968
35049
  })
34969
- }), jsx(ActionBar, {
35050
+ }), !asEmbedded && jsx(ActionBar, {
34970
35051
  onHome: goHome,
34971
35052
  homeButtonLabel: i18n.get("goToOverview"),
34972
35053
  onNext: canSign ? handleSignClick : () => gotoForm(activeFormIndex + 1),
@@ -34977,10 +35058,31 @@ function ServiceAgreementDropinComponent({
34977
35058
  backButtonLabel: i18n.get("previous")
34978
35059
  })]
34979
35060
  });
35061
+ const currentStep = signedForms.length;
35062
+ const totalSteps = forms2.length;
35063
+ const footer = jsx(EmbeddedActionBar, {
35064
+ left: jsx(StepProgressIndicator, {
35065
+ activeStepIndex: currentStep ?? 0,
35066
+ stepsCount: totalSteps ?? 3,
35067
+ circles: true,
35068
+ thick: true
35069
+ }),
35070
+ right: (
35071
+ // The button is either forcing the user to Sign or going Next, never both
35072
+ jsx(Button, {
35073
+ secondary: !canSign,
35074
+ label: i18n.get(canSign ? "signAndContinue" : "next"),
35075
+ onClick: canSign ? handleSignClick : () => gotoForm(activeFormIndex + 1)
35076
+ })
35077
+ )
35078
+ });
34980
35079
  return jsx(DropinLayout, {
35080
+ showAsModal: asModal,
35081
+ onClose: handleCloseClick,
34981
35082
  content: jsxs(Fragment, {
34982
- children: [sidebar, content]
34983
- })
35083
+ children: [!asEmbedded && sidebar, content]
35084
+ }),
35085
+ footer: asEmbedded ? footer : void 0
34984
35086
  });
34985
35087
  }
34986
35088
  const parseConfiguration$2 = ({
@@ -35739,7 +35841,7 @@ function DropinComposerComponent({
35739
35841
  onNavigate = noop,
35740
35842
  ...args
35741
35843
  }) {
35742
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
35844
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
35743
35845
  const {
35744
35846
  contextCountry,
35745
35847
  accountHolder,
@@ -35783,13 +35885,14 @@ function DropinComposerComponent({
35783
35885
  handleSingpassMyInfoLoginSuccess,
35784
35886
  handleSingpassMyInfoLoginFailure,
35785
35887
  handleSingpassMyInfoLoginReset,
35786
- trustedFields: singpassTrustedFields
35888
+ trustedFields: singpassTrustedFields,
35889
+ trustedEntityAssociations
35787
35890
  } = useSingpassMyInfoLogin({
35788
35891
  legalEntity: rootLegalEntity,
35789
35892
  accountHolder,
35790
35893
  handleOpenSingpassAuthorizationLink
35791
35894
  });
35792
- const hasUsedSingpass = Boolean(Object.keys(singpassTrustedFields).length);
35895
+ const singpassTabRef = useRef(null);
35793
35896
  const rootLegalEntityCountry = getLegalEntityCountry(rootLegalEntity);
35794
35897
  const [associatedLegalEntity, setAssociatedLegalEntity] = useState(null);
35795
35898
  const {
@@ -36101,7 +36204,8 @@ function DropinComposerComponent({
36101
36204
  try {
36102
36205
  const authUrl = await handleInitiateSingpassMyInfoLogin();
36103
36206
  setHasSeenSingpassSelection(true);
36104
- window.open(authUrl, "_blank").focus();
36207
+ singpassTabRef.current = window.open(authUrl, "_blank");
36208
+ singpassTabRef.current.focus();
36105
36209
  } catch (e) {
36106
36210
  logger$h.error(e);
36107
36211
  handleSingpassMyInfoLoginFailure(e);
@@ -36339,7 +36443,8 @@ function DropinComposerComponent({
36339
36443
  onClick: async () => {
36340
36444
  try {
36341
36445
  const authUrl = await handleInitiateSingpassMyInfoLogin();
36342
- window.open(authUrl, "_blank").focus();
36446
+ singpassTabRef.current = window.open(authUrl);
36447
+ singpassTabRef.current.focus();
36343
36448
  } catch (e) {
36344
36449
  logger$h.error(e);
36345
36450
  handleSingpassMyInfoLoginFailure(e);
@@ -36353,6 +36458,7 @@ function DropinComposerComponent({
36353
36458
  if (isSuccessful) {
36354
36459
  handleSingpassMyInfoLoginSuccess();
36355
36460
  await refreshLegalEntity();
36461
+ singpassTabRef.current.close();
36356
36462
  } else {
36357
36463
  handleSingpassMyInfoLoginFailure(legalEntityResponse.type === LegalEntityType.INDIVIDUAL ? "weCouldntConnectToMyinfo" : "weCouldntConnectToMyinfoBusiness");
36358
36464
  }
@@ -36429,8 +36535,7 @@ function DropinComposerComponent({
36429
36535
  navigateBackToTaskList: navigateBack,
36430
36536
  onDecisionMakerDelete: refreshLegalEntity,
36431
36537
  capabilityProblems,
36432
- disableAddDecisionMakers: hasUsedSingpass,
36433
- disableDeleteDecisionMakers: hasUsedSingpass
36538
+ trustedEntityAssociations
36434
36539
  });
36435
36540
  case TaskTypes.INDIVIDUAL:
36436
36541
  return jsx(IndividualDropinComponent, {
@@ -36499,7 +36604,8 @@ function DropinComposerComponent({
36499
36604
  handleGetIdVerificationStartCheck: args == null ? void 0 : args.handleGetIdVerificationStartCheck,
36500
36605
  handleOpenSingpassAuthorizationLink: args == null ? void 0 : args.handleOpenSingpassAuthorizationLink,
36501
36606
  trustedFields: singpassTrustedFields,
36502
- trustedFieldsProvider: isEligibleForSingpass && TrustedFieldsProvider.SINGPASS
36607
+ trustedFieldsProvider: isEligibleForSingpass && TrustedFieldsProvider.SINGPASS,
36608
+ trustedRoles: ((_d = trustedEntityAssociations.find((ea) => ea.reference === (associatedLegalEntity == null ? void 0 : associatedLegalEntity.id))) == null ? void 0 : _d.types) || []
36503
36609
  });
36504
36610
  case TaskTypes.TRUST_MEMBER_COMPANY_OWNER:
36505
36611
  return jsx(IndividualDropinComponent, {
@@ -36580,8 +36686,7 @@ function DropinComposerComponent({
36580
36686
  handleFindAddress: args == null ? void 0 : args.handleFindAddress,
36581
36687
  onTypeSwitch: navigateToTypeSwitcher,
36582
36688
  isTargetLegalEntityType: legalEntityType === LegalEntityType.ORGANIZATION,
36583
- trustedFields: singpassTrustedFields,
36584
- trustedFieldsProvider: isEligibleForSingpass && TrustedFieldsProvider.SINGPASS
36689
+ trustedFields: singpassTrustedFields
36585
36690
  });
36586
36691
  case TaskTypes.COMPANY_SEARCH:
36587
36692
  return jsx(CompanySearchDropinComponent, {
@@ -36671,7 +36776,7 @@ function DropinComposerComponent({
36671
36776
  parentLegalEntity: associatedLegalArrangement,
36672
36777
  legalEntityResponse: associatedLegalEntity,
36673
36778
  capabilities: getCapabilities(legalEntityResponse),
36674
- problems: (_d = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _d[rootLegalEntity.id],
36779
+ problems: (_e = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _e[rootLegalEntity.id],
36675
36780
  onChange: componentOnChange,
36676
36781
  onSubmit: (data) => refreshLegalArrangementAndRunOnSubmit(data, 2),
36677
36782
  handleBackClick: navigateBack,
@@ -36689,7 +36794,7 @@ function DropinComposerComponent({
36689
36794
  },
36690
36795
  taskType: currentTask,
36691
36796
  taskName: currentTask === TaskTypes.PAYIN ? "payinDetails" : "payoutDetails",
36692
- problems: (_e = capabilityProblems == null ? void 0 : capabilityProblems.BankAccount) == null ? void 0 : _e[transferInstrument == null ? void 0 : transferInstrument.id],
36797
+ problems: (_f = capabilityProblems == null ? void 0 : capabilityProblems.BankAccount) == null ? void 0 : _f[transferInstrument == null ? void 0 : transferInstrument.id],
36693
36798
  transferInstrument,
36694
36799
  setTransferInstrument,
36695
36800
  legalEntityResponse: rootLegalEntity,
@@ -36718,7 +36823,7 @@ function DropinComposerComponent({
36718
36823
  topLevelLegalEntity: legalEntityResponse
36719
36824
  },
36720
36825
  taskType: TaskTypes.TRUST,
36721
- problems: (_f = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _f[associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.id],
36826
+ problems: (_g = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _g[associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.id],
36722
36827
  parentLegalEntity: rootLegalEntity,
36723
36828
  legalEntityResponse: associatedLegalArrangement,
36724
36829
  capabilities: getCapabilities(legalEntityResponse),
@@ -36726,7 +36831,7 @@ function DropinComposerComponent({
36726
36831
  onSubmit: (data) => refreshLegalArrangementAndRunOnSubmit(data, 1),
36727
36832
  handleHomeClick: navigateBack,
36728
36833
  homeButtonLabel: i18n.get("saveAndGoToOverview"),
36729
- country: (((_g = associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.trust) == null ? void 0 : _g.countryOfGoverningLaw) || ((_h = associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.trust) == null ? void 0 : _h.registeredAddress.country)) ?? rootLegalEntityCountry,
36834
+ country: (((_h = associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.trust) == null ? void 0 : _h.countryOfGoverningLaw) || ((_i = associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.trust) == null ? void 0 : _i.registeredAddress.country)) ?? rootLegalEntityCountry,
36730
36835
  handleAddressSearch: args == null ? void 0 : args.handleAddressSearch,
36731
36836
  handleFindAddress: args == null ? void 0 : args.handleFindAddress
36732
36837
  });
@@ -36772,12 +36877,12 @@ function DropinComposerComponent({
36772
36877
  parentLegalEntity: rootLegalEntity,
36773
36878
  legalEntityResponse: associatedLegalArrangement,
36774
36879
  capabilities: getCapabilities(legalEntityResponse),
36775
- problems: (_i = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _i[associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.id],
36880
+ problems: (_j = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _j[associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.id],
36776
36881
  onChange: componentOnChange,
36777
36882
  onSubmit: (data) => refreshLegalArrangementAndRunOnSubmit(data, 1),
36778
36883
  handleHomeClick: navigateBack,
36779
36884
  homeButtonLabel: i18n.get("saveAndGoToOverview"),
36780
- country: (((_j = associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.soleProprietorship) == null ? void 0 : _j.countryOfGoverningLaw) || ((_l = (_k = associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.soleProprietorship) == null ? void 0 : _k.registeredAddress) == null ? void 0 : _l.country)) ?? rootLegalEntityCountry,
36885
+ country: (((_k = associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.soleProprietorship) == null ? void 0 : _k.countryOfGoverningLaw) || ((_m = (_l = associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.soleProprietorship) == null ? void 0 : _l.registeredAddress) == null ? void 0 : _m.country)) ?? rootLegalEntityCountry,
36781
36886
  handleAddressSearch: args == null ? void 0 : args.handleAddressSearch,
36782
36887
  handleFindAddress: args == null ? void 0 : args.handleFindAddress
36783
36888
  });
@@ -37520,7 +37625,8 @@ const useComponentApi = (rootLegalEntityId) => {
37520
37625
  const logger$g = createLogger("CreateContractingComponent");
37521
37626
  function CreateContractingComponent({
37522
37627
  legalEntityId,
37523
- modalView
37628
+ modalView,
37629
+ onClose
37524
37630
  }) {
37525
37631
  const {
37526
37632
  isModalView,
@@ -37531,45 +37637,61 @@ function CreateContractingComponent({
37531
37637
  }
37532
37638
  const {
37533
37639
  getLegalEntity: getLegalEntity2,
37534
- createLegalEntity: createLegalEntity2,
37535
- updateLegalEntity: updateLegalEntity2,
37536
- getDocument: getDocument2,
37537
- createDocument: createDocument2,
37538
- updateDocument: updateDocument2
37640
+ getServiceAgreement: getServiceAgreement2,
37641
+ getServiceAgreementStatus: getServiceAgreementStatus2,
37642
+ getServiceAgreementAcceptanceInfos: getServiceAgreementAcceptanceInfos2,
37643
+ getAcceptedServiceAgreement: getAcceptedServiceAgreement2,
37644
+ downloadAcceptedServiceAgreement,
37645
+ downloadUnacceptedServiceAgreement
37539
37646
  } = useComponentApi(legalEntityId);
37647
+ const [isLoading, setIsLoading] = useState(true);
37540
37648
  const [legalEntity, setLegalEntity] = useState();
37649
+ const [serviceAgreementTypes, setServiceAgreementTypes] = useState([]);
37650
+ const [serviceAgreementAcceptanceInfos, setServiceAgreementAcceptanceInfos] = useState([]);
37541
37651
  if (modalView) {
37542
37652
  setIsModalView(true);
37543
37653
  }
37544
- useEffect(() => {
37545
- getLegalEntity2(legalEntityId).then((res) => setLegalEntity(res)).catch(logger$g.error);
37654
+ const fetchLegalEntity = useCallback(async () => {
37655
+ await getLegalEntity2(legalEntityId).then((res) => setLegalEntity(res)).catch(logger$g.error);
37546
37656
  }, [getLegalEntity2, legalEntityId]);
37547
- const serviceAgreementTypes = [];
37548
- const serviceAgreementAcceptanceInfos = [];
37549
- const handleGetServiceAgreement = () => {
37550
- };
37551
- const handleViewAcceptedTermsOfServiceDocument = () => {
37552
- };
37553
- const handleDownloadAcceptedTermsOfServiceDocument = () => {
37554
- };
37555
- const handleDownloadUnacceptedTermsOfServiceDocument = () => {
37556
- };
37657
+ const fetchUnsigned = useCallback(async () => {
37658
+ await getServiceAgreementStatus2(legalEntityId).then(({
37659
+ termsOfServiceTypes
37660
+ }) => setServiceAgreementTypes(termsOfServiceTypes)).catch(logger$g.error);
37661
+ }, [getServiceAgreementStatus2, legalEntityId]);
37662
+ const fetchSigned = useCallback(async () => {
37663
+ await getServiceAgreementAcceptanceInfos2(legalEntityId).then(({
37664
+ data
37665
+ }) => setServiceAgreementAcceptanceInfos(data)).catch(logger$g.error);
37666
+ }, [getServiceAgreementAcceptanceInfos2, legalEntityId]);
37667
+ useEffect(() => {
37668
+ (async () => {
37669
+ setIsLoading(true);
37670
+ await Promise.all([fetchLegalEntity(), fetchUnsigned(), fetchSigned()]);
37671
+ })().catch(logger$g.error).finally(() => {
37672
+ setIsLoading(false);
37673
+ });
37674
+ }, [fetchLegalEntity, fetchSigned, fetchUnsigned]);
37557
37675
  const handleHomeClick = () => {
37558
37676
  };
37559
37677
  const handleSign = () => {
37560
37678
  };
37561
- return jsx(ServiceAgreementDropinComponent, {
37679
+ return isLoading || !legalEntity ? jsx(Loader, {
37680
+ size: "medium"
37681
+ }) : jsx(ServiceAgreementDropinComponent, {
37562
37682
  taskType: TaskTypes.SERVICE_AGREEMENT,
37563
37683
  legalEntityResponse: legalEntity,
37564
- serviceAgreementTypes,
37684
+ serviceAgreementTypes: serviceAgreementTypes ?? [],
37565
37685
  serviceAgreementAcceptanceInfos,
37566
- handleGetServiceAgreement,
37567
- handleViewAcceptedTermsOfServiceDocument,
37568
- handleDownloadAcceptedTermsOfServiceDocument,
37569
- handleDownloadUnacceptedTermsOfServiceDocument,
37686
+ handleGetServiceAgreement: getServiceAgreement2,
37687
+ handleViewAcceptedTermsOfServiceDocument: getAcceptedServiceAgreement2,
37688
+ handleDownloadAcceptedTermsOfServiceDocument: downloadAcceptedServiceAgreement,
37689
+ handleDownloadUnacceptedTermsOfServiceDocument: downloadUnacceptedServiceAgreement,
37570
37690
  handleHomeClick,
37571
37691
  handleSign,
37572
- asModal: isModalView
37692
+ asEmbedded: true,
37693
+ asModal: isModalView,
37694
+ handleCloseClick: onClose
37573
37695
  });
37574
37696
  }
37575
37697
  const logger$f = createLogger("CreateIndividualComponent");
@@ -38369,12 +38491,15 @@ const highExposureRadioItems = [{
38369
38491
  id: "No",
38370
38492
  name: "no"
38371
38493
  }];
38372
- const highExposureParentRadioItems = [...highExposureRadioItems, {
38373
- id: "I don't know",
38374
- name: "iDontKnow"
38494
+ const highExposureParentRadioItems = [{
38495
+ id: "Yes",
38496
+ name: "yes"
38497
+ }, {
38498
+ id: "No",
38499
+ name: "noIdontKnow"
38375
38500
  }];
38376
38501
  const companySchemaKeys = ["legalForm", "naceCode", "numberOfEmployees", "doesYourCompanyHaveLEI", "legalEntityIdentifier", "country", "isCompanyOwnedByAnotherCompany", "isParentOwnedByAnotherCompany", "financialReportingDate", "totalAssetsCurrency", "totalAssetsValue", "annualTurnoverCurrency", "annualTurnoverValue", "legalInformationInsolvency", "legalProceedingsDate"];
38377
- const parentCompaniesSchemaKeys = ["legalName", "legalForm", "naceCode", "numberOfEmployees", "doesYourCompanyHaveLEI", "legalEntityIdentifier", "doesNotKnowNumberOfEmployees", "isThisAddressTheMainHeadquarters", "address", "otherAddressInformation", "doesNotKnowLegalEntityIdentifier", "postalCode", "city", "stateOrProvince", "country", "financialReportingDate", "totalAssetsCurrency", "totalAssetsValue", "annualTurnoverCurrency", "annualTurnoverValue", "legalInformationInsolvency", "legalProceedingsDate"];
38502
+ const parentCompaniesSchemaKeys = ["legalName", "legalForm", "naceCode", "numberOfEmployees", "doesYourCompanyHaveLEI", "legalEntityIdentifier", "doesNotKnowNumberOfEmployees", "isThisAddressTheMainHeadquarters", "address", "otherAddressInformation", "postalCode", "city", "stateOrProvince", "country", "financialReportingDate", "totalAssetsCurrency", "totalAssetsValue", "annualTurnoverCurrency", "annualTurnoverValue", "legalInformationInsolvency", "legalProceedingsDate"];
38378
38503
  var HighExposureIndex = /* @__PURE__ */ ((HighExposureIndex2) => {
38379
38504
  HighExposureIndex2["COMPANY"] = "company";
38380
38505
  HighExposureIndex2["PARENT_COMPANY"] = "parentCompany";
@@ -38387,53 +38512,76 @@ const setDefaultCurrencies = (dataObject, country) => {
38387
38512
  dataObject.totalAssetsCurrency = countryCurrencies[0];
38388
38513
  dataObject.annualTurnoverCurrency = countryCurrencies[0];
38389
38514
  };
38390
- const validateLegalEntityIdentifier = (legalEntityIdentifier, doesYourCompanyHaveLEI, isDisabled) => {
38391
- if (isDisabled) return true;
38515
+ const validateEmptyLegalEntityIdentifier = (legalEntityIdentifier, doesYourCompanyHaveLEI) => {
38516
+ const isRequired = doesYourCompanyHaveLEI === "Yes";
38517
+ return !isRequired || !isEmpty(legalEntityIdentifier);
38518
+ };
38519
+ const validateLegalEntityIdentifier = (legalEntityIdentifier, doesYourCompanyHaveLEI) => {
38392
38520
  const isRequired = doesYourCompanyHaveLEI === "Yes";
38393
38521
  const isValidLength = legalEntityIdentifier ? legalEntityIdentifier.length === 20 : false;
38394
38522
  const hasLettersAndNumbers = legalEntityIdentifier ? /[a-zA-Z]/.test(legalEntityIdentifier) && /[0-9]/.test(legalEntityIdentifier) : false;
38395
- return !isRequired || !isEmpty(legalEntityIdentifier) && isValidLength && hasLettersAndNumbers;
38523
+ return !isRequired || isValidLength && hasLettersAndNumbers;
38396
38524
  };
38397
38525
  const validateLegalProceedingsDate = (legalProceedingsDate, legalInformationInsolvency) => {
38398
38526
  const isRequired = legalInformationInsolvency && !["noLegalActionsTaken", "iDontKnow"].includes(legalInformationInsolvency);
38399
38527
  return isRequired ? !isEmpty(legalProceedingsDate) : true;
38400
38528
  };
38529
+ const validateDateNotInTheFuture = (legalProceedingsDate) => {
38530
+ if (!legalProceedingsDate) return false;
38531
+ return new Date(legalProceedingsDate) <= /* @__PURE__ */ new Date();
38532
+ };
38401
38533
  const highExposureCompanyDetailsValidations = {
38402
- numberOfEmployees: {
38534
+ numberOfEmployees: [{
38403
38535
  modes: ["blur"],
38404
38536
  validate: (numberOfEmployees) => !isEmpty(numberOfEmployees),
38405
38537
  errorMessage: "fieldIsRequired"
38406
- },
38538
+ }, {
38539
+ modes: ["blur"],
38540
+ validate: (numberOfEmployees) => Number.isInteger(Number(numberOfEmployees)),
38541
+ errorMessage: "pleaseEnterAValidWholeNumber"
38542
+ }],
38407
38543
  legalInformationInsolvency: {
38408
38544
  modes: ["blur"],
38409
38545
  validate: (legalInformationInsolvency) => !isEmpty(legalInformationInsolvency),
38410
38546
  errorMessage: "fieldIsRequired"
38411
38547
  },
38412
- totalAssetsValue: {
38548
+ totalAssetsValue: [{
38413
38549
  modes: ["blur"],
38414
38550
  validate: (value) => !isEmpty(value),
38415
38551
  errorMessage: "fieldIsRequired"
38416
- },
38552
+ }, {
38553
+ modes: ["blur"],
38554
+ validate: (value) => !Number.isNaN(Number(value)),
38555
+ errorMessage: "pleaseEnterAValidNumber"
38556
+ }],
38417
38557
  totalAssetsCurrency: {
38418
38558
  modes: ["input"],
38419
38559
  validate: (value) => !isEmpty(value),
38420
38560
  errorMessage: "fieldIsRequired"
38421
38561
  },
38422
- annualTurnoverValue: {
38562
+ annualTurnoverValue: [{
38423
38563
  modes: ["blur"],
38424
38564
  validate: (value) => !isEmpty(value),
38425
38565
  errorMessage: "fieldIsRequired"
38426
- },
38566
+ }, {
38567
+ modes: ["blur"],
38568
+ validate: (value) => !Number.isNaN(Number(value)),
38569
+ errorMessage: "pleaseEnterAValidNumber"
38570
+ }],
38427
38571
  annualTurnoverCurrency: {
38428
38572
  modes: ["blur"],
38429
38573
  validate: (value) => !isEmpty(value),
38430
38574
  errorMessage: "fieldIsRequired"
38431
38575
  },
38432
- financialReportingDate: {
38576
+ financialReportingDate: [{
38433
38577
  modes: ["blur"],
38434
38578
  validate: (value) => !isEmpty(value),
38435
38579
  errorMessage: "fieldIsRequired"
38436
- },
38580
+ }, {
38581
+ modes: ["blur"],
38582
+ validate: (value) => validateDateNotInTheFuture(value),
38583
+ errorMessage: "dateCannotBeInTheFuture"
38584
+ }],
38437
38585
  naceCode: {
38438
38586
  modes: ["blur"],
38439
38587
  validate: (naceCode) => !isEmpty(naceCode),
@@ -38444,14 +38592,21 @@ const highExposureCompanyDetailsValidations = {
38444
38592
  validate: (doesYourCompanyHaveLEI) => !isEmpty(doesYourCompanyHaveLEI),
38445
38593
  errorMessage: "fieldIsRequired"
38446
38594
  },
38447
- legalEntityIdentifier: {
38595
+ legalEntityIdentifier: [{
38448
38596
  modes: ["blur"],
38449
38597
  validate: (legalEntityIdentifier, context) => {
38450
38598
  var _a, _b;
38451
- return validateLegalEntityIdentifier(legalEntityIdentifier, (_b = (_a = context == null ? void 0 : context.state) == null ? void 0 : _a.data) == null ? void 0 : _b.doesYourCompanyHaveLEI);
38599
+ return validateEmptyLegalEntityIdentifier(legalEntityIdentifier, (_b = (_a = context == null ? void 0 : context.state) == null ? void 0 : _a.data) == null ? void 0 : _b.doesYourCompanyHaveLEI);
38452
38600
  },
38453
38601
  errorMessage: "fieldIsRequired"
38454
- },
38602
+ }, {
38603
+ modes: ["blur"],
38604
+ validate: (legalEntityIdentifier, context) => {
38605
+ var _a, _b;
38606
+ return validateLegalEntityIdentifier(legalEntityIdentifier, (_b = (_a = context == null ? void 0 : context.state) == null ? void 0 : _a.data) == null ? void 0 : _b.doesYourCompanyHaveLEI);
38607
+ },
38608
+ errorMessage: "invalidFormat"
38609
+ }],
38455
38610
  isCompanyOwnedByAnotherCompany: {
38456
38611
  modes: ["blur"],
38457
38612
  validate: (isCompanyOwnedByAnotherCompany) => !isEmpty(isCompanyOwnedByAnotherCompany),
@@ -38465,14 +38620,18 @@ const highExposureCompanyDetailsValidations = {
38465
38620
  },
38466
38621
  errorMessage: "fieldIsRequired"
38467
38622
  },
38468
- legalProceedingsDate: {
38623
+ legalProceedingsDate: [{
38469
38624
  modes: ["blur"],
38470
38625
  validate: (legalProceedingsDate, context) => {
38471
38626
  var _a, _b;
38472
38627
  return validateLegalProceedingsDate(legalProceedingsDate, (_b = (_a = context == null ? void 0 : context.state) == null ? void 0 : _a.data) == null ? void 0 : _b.legalInformationInsolvency);
38473
38628
  },
38474
38629
  errorMessage: "fieldIsRequired"
38475
- }
38630
+ }, {
38631
+ modes: ["blur"],
38632
+ validate: (value) => validateDateNotInTheFuture(value),
38633
+ errorMessage: "dateCannotBeInTheFuture"
38634
+ }]
38476
38635
  };
38477
38636
  const highExposureParentCompaniesDetailsValidations = {
38478
38637
  country: {
@@ -38485,11 +38644,15 @@ const highExposureParentCompaniesDetailsValidations = {
38485
38644
  validate: (legalName) => !isEmpty(legalName),
38486
38645
  errorMessage: "fieldIsRequired"
38487
38646
  },
38488
- numberOfEmployees: {
38647
+ numberOfEmployees: [{
38489
38648
  modes: ["blur"],
38490
38649
  validate: (numberOfEmployees) => !isEmpty(numberOfEmployees),
38491
38650
  errorMessage: "fieldIsRequired"
38492
- },
38651
+ }, {
38652
+ modes: ["blur"],
38653
+ validate: (numberOfEmployees) => Number.isInteger(Number(numberOfEmployees)),
38654
+ errorMessage: "pleaseEnterAValidWholeNumber"
38655
+ }],
38493
38656
  naceCode: {
38494
38657
  modes: ["blur"],
38495
38658
  validate: (naceCode) => !isEmpty(naceCode),
@@ -38500,14 +38663,21 @@ const highExposureParentCompaniesDetailsValidations = {
38500
38663
  validate: (doesYourCompanyHaveLEI) => !isEmpty(doesYourCompanyHaveLEI),
38501
38664
  errorMessage: "fieldIsRequired"
38502
38665
  },
38503
- legalEntityIdentifier: {
38666
+ legalEntityIdentifier: [{
38504
38667
  modes: ["blur"],
38505
38668
  validate: (legalEntityIdentifier, context) => {
38506
- var _a, _b, _c, _d;
38507
- return validateLegalEntityIdentifier(legalEntityIdentifier, (_b = (_a = context == null ? void 0 : context.state) == null ? void 0 : _a.data) == null ? void 0 : _b.doesYourCompanyHaveLEI, Boolean((_d = (_c = context == null ? void 0 : context.state) == null ? void 0 : _c.data) == null ? void 0 : _d.doesNotKnowLegalEntityIdentifier));
38669
+ var _a, _b;
38670
+ return validateEmptyLegalEntityIdentifier(legalEntityIdentifier, (_b = (_a = context == null ? void 0 : context.state) == null ? void 0 : _a.data) == null ? void 0 : _b.doesYourCompanyHaveLEI);
38508
38671
  },
38509
38672
  errorMessage: "fieldIsRequired"
38510
- },
38673
+ }, {
38674
+ modes: ["blur"],
38675
+ validate: (legalEntityIdentifier, context) => {
38676
+ var _a, _b;
38677
+ return validateLegalEntityIdentifier(legalEntityIdentifier, (_b = (_a = context == null ? void 0 : context.state) == null ? void 0 : _a.data) == null ? void 0 : _b.doesYourCompanyHaveLEI);
38678
+ },
38679
+ errorMessage: "invalidFormat"
38680
+ }],
38511
38681
  isThisAddressTheMainHeadquarters: {
38512
38682
  modes: ["blur"],
38513
38683
  validate: (isThisAddressTheMainHeadquarters) => !isEmpty(isThisAddressTheMainHeadquarters),
@@ -38518,39 +38688,55 @@ const highExposureParentCompaniesDetailsValidations = {
38518
38688
  validate: (value) => !isEmpty(value),
38519
38689
  errorMessage: "fieldIsRequired"
38520
38690
  },
38521
- totalAssetsValue: {
38691
+ totalAssetsValue: [{
38522
38692
  modes: ["blur"],
38523
38693
  validate: (value) => !isEmpty(value),
38524
38694
  errorMessage: "fieldIsRequired"
38525
- },
38695
+ }, {
38696
+ modes: ["blur"],
38697
+ validate: (value) => !Number.isNaN(Number(value)),
38698
+ errorMessage: "pleaseEnterAValidNumber"
38699
+ }],
38526
38700
  totalAssetsCurrency: {
38527
38701
  modes: ["input"],
38528
38702
  validate: (value) => !isEmpty(value),
38529
38703
  errorMessage: "fieldIsRequired"
38530
38704
  },
38531
- annualTurnoverValue: {
38705
+ annualTurnoverValue: [{
38532
38706
  modes: ["blur"],
38533
38707
  validate: (value) => !isEmpty(value),
38534
38708
  errorMessage: "fieldIsRequired"
38535
- },
38709
+ }, {
38710
+ modes: ["blur"],
38711
+ validate: (value) => !Number.isNaN(Number(value)),
38712
+ errorMessage: "pleaseEnterAValidNumber"
38713
+ }],
38536
38714
  annualTurnoverCurrency: {
38537
38715
  modes: ["blur"],
38538
38716
  validate: (value) => !isEmpty(value),
38539
38717
  errorMessage: "fieldIsRequired"
38540
38718
  },
38541
- financialReportingDate: {
38719
+ financialReportingDate: [{
38542
38720
  modes: ["blur"],
38543
38721
  validate: (value) => !isEmpty(value),
38544
38722
  errorMessage: "fieldIsRequired"
38545
- },
38546
- legalProceedingsDate: {
38723
+ }, {
38724
+ modes: ["blur"],
38725
+ validate: (value) => validateDateNotInTheFuture(value),
38726
+ errorMessage: "dateCannotBeInTheFuture"
38727
+ }],
38728
+ legalProceedingsDate: [{
38547
38729
  modes: ["blur"],
38548
38730
  validate: (legalProceedingsDate, context) => {
38549
38731
  var _a, _b;
38550
38732
  return validateLegalProceedingsDate(legalProceedingsDate, (_b = (_a = context == null ? void 0 : context.state) == null ? void 0 : _a.data) == null ? void 0 : _b.legalInformationInsolvency);
38551
38733
  },
38552
38734
  errorMessage: "fieldIsRequired"
38553
- }
38735
+ }, {
38736
+ modes: ["blur"],
38737
+ validate: (legalProceedingsDate) => validateDateNotInTheFuture(legalProceedingsDate),
38738
+ errorMessage: "dateCannotBeInTheFuture"
38739
+ }]
38554
38740
  };
38555
38741
  const logger$a = createLogger("LegalFormField");
38556
38742
  function LegalFormField({
@@ -38736,44 +38922,31 @@ function HighExposureBusinessInformation({
38736
38922
  "aria-label": i18n.get(isMainCompany ? "doesYourCompanyHaveLEI" : "doesThisCompanyHaveLEI"),
38737
38923
  "aria-invalid": !valid.doesYourCompanyHaveLEI
38738
38924
  })
38739
- }), data.doesYourCompanyHaveLEI === "Yes" && jsxs(Fragment, {
38740
- children: [jsx(Field, {
38925
+ }), data.doesYourCompanyHaveLEI === "Yes" && jsx(Field, {
38926
+ name: "legalEntityIdentifier",
38927
+ label: formUtils.getLabel("legalEntityIdentifier", "legalEntityIdentifier"),
38928
+ errorMessage: formUtils.getErrorMessage("legalEntityIdentifier", errors, fieldProblems),
38929
+ isValid: valid.legalEntityIdentifier,
38930
+ helper: i18n.get("enterNCharactersWithAMixForExample", {
38931
+ values: {
38932
+ numChars: 20,
38933
+ example: "529900T8BM49AURSDO55"
38934
+ }
38935
+ }),
38936
+ helperPosition: "above",
38937
+ children: (childProps) => jsx(InputText, {
38938
+ ...childProps,
38741
38939
  name: "legalEntityIdentifier",
38742
- label: formUtils.getLabel("legalEntityIdentifier", "legalEntityIdentifier"),
38743
- errorMessage: formUtils.getErrorMessage("legalEntityIdentifier", errors, fieldProblems),
38744
- isValid: valid.legalEntityIdentifier,
38745
- helper: i18n.get("enterNCharactersWithAMixForExample", {
38746
- values: {
38747
- numChars: 20,
38748
- example: "529900T8BM49AURSDO55"
38749
- }
38750
- }),
38751
- helperPosition: "below",
38752
- children: (childProps) => jsx(InputText, {
38753
- ...childProps,
38754
- name: "legalEntityIdentifier",
38755
- value: data.legalEntityIdentifier,
38756
- readonly: Boolean(data.doesNotKnowLegalEntityIdentifier),
38757
- classNameModifiers: ["legalName"],
38758
- onInput: handleChangeFor("legalEntityIdentifier", "input"),
38759
- onBlur: handleChangeFor("legalEntityIdentifier", "blur"),
38760
- "aria-required": true,
38761
- "aria-label": formUtils.getLabel("legalEntityIdentifier"),
38762
- "aria-invalid": !valid.legalEntityIdentifier,
38763
- isValid: valid.legalEntityIdentifier
38764
- })
38765
- }), !isMainCompany && jsx(Checkbox, {
38766
- name: "doesNotKnowLegalEntityIdentifier",
38767
- label: i18n.get("iDontKnow"),
38768
- value: data.doesNotKnowLegalEntityIdentifier ? data.doesNotKnowLegalEntityIdentifier.toString() : void 0,
38940
+ value: data.legalEntityIdentifier,
38769
38941
  readonly: false,
38770
- classNameModifiers: ["exempted-from-tax"],
38771
- checked: Boolean(data.doesNotKnowLegalEntityIdentifier),
38772
- onChange: handleChangeFor("doesNotKnowLegalEntityIdentifier"),
38773
- "aria-required": false,
38774
- "aria-label": i18n.get("iDontKnow"),
38775
- "aria-invalid": false
38776
- })]
38942
+ classNameModifiers: ["legalName"],
38943
+ onInput: handleChangeFor("legalEntityIdentifier", "input"),
38944
+ onBlur: handleChangeFor("legalEntityIdentifier", "blur"),
38945
+ "aria-required": true,
38946
+ "aria-label": formUtils.getLabel("legalEntityIdentifier"),
38947
+ "aria-invalid": !valid.legalEntityIdentifier,
38948
+ isValid: valid.legalEntityIdentifier
38949
+ })
38777
38950
  })]
38778
38951
  });
38779
38952
  }
@@ -38834,6 +39007,7 @@ function AmountSelector({
38834
39007
  })
38835
39008
  });
38836
39009
  }
39010
+ const TODAY_DATE$1 = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
38837
39011
  function HighExposureFinancialInformation({
38838
39012
  formUtils,
38839
39013
  data,
@@ -38895,11 +39069,13 @@ function HighExposureFinancialInformation({
38895
39069
  onBlur: handleChangeFor("financialReportingDate", "blur"),
38896
39070
  "aria-required": true,
38897
39071
  "aria-label": formUtils.getLabel("financialReportingDate"),
38898
- "aria-invalid": !valid.financialReportingDate
39072
+ "aria-invalid": !valid.financialReportingDate,
39073
+ max: TODAY_DATE$1
38899
39074
  })
38900
39075
  })]
38901
39076
  });
38902
39077
  }
39078
+ const TODAY_DATE = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
38903
39079
  function HighExposureLegalInformation({
38904
39080
  formUtils,
38905
39081
  data,
@@ -38964,7 +39140,8 @@ function HighExposureLegalInformation({
38964
39140
  onBlur: handleChangeFor("legalProceedingsDate", "blur"),
38965
39141
  "aria-required": true,
38966
39142
  "aria-label": formUtils.getLabel("legalProceedingsDate"),
38967
- "aria-invalid": !valid.legalProceedingsDate
39143
+ "aria-invalid": !valid.legalProceedingsDate,
39144
+ max: TODAY_DATE
38968
39145
  })
38969
39146
  })]
38970
39147
  });
@@ -39139,7 +39316,7 @@ function HighExposureBasicCompanyInformation({
39139
39316
  errorMessage: formUtils.getErrorMessage("legalName", errors, fieldProblems),
39140
39317
  isValid: valid.legalName,
39141
39318
  helper: i18n.get("legalNameIsUsedToIdentifyABusinessWithTheGovernment"),
39142
- helperPosition: "below",
39319
+ helperPosition: "above",
39143
39320
  children: (childProps) => jsx(InputText, {
39144
39321
  ...childProps,
39145
39322
  name: "legalName",
@@ -39530,6 +39707,7 @@ const getLegalEntityId = (exposureIndex, rootLegalEntity) => {
39530
39707
  const exposureEntityAssociation = (_a = rootLegalEntity.entityAssociations) == null ? void 0 : _a.find((entity) => entity.type === exposureEntityType);
39531
39708
  return exposureEntityAssociation == null ? void 0 : exposureEntityAssociation.legalEntityId;
39532
39709
  };
39710
+ const USER_LOCALE = navigator.language;
39533
39711
  const entityHasParentCompany = (data) => {
39534
39712
  var _a, _b;
39535
39713
  return ((_a = data.company) == null ? void 0 : _a.isCompanyOwnedByAnotherCompany) && ((_b = data.company) == null ? void 0 : _b.isCompanyOwnedByAnotherCompany) === "Yes";
@@ -39570,7 +39748,7 @@ const prepareExposureSubmitData = (exposureIndex, data, rootLegalEntity) => {
39570
39748
  ...exposureDetails.organization.registeredAddress
39571
39749
  };
39572
39750
  }
39573
- if (exposureData.doesYourCompanyHaveLEI !== "Yes" || exposureData.doesNotKnowLegalEntityIdentifier) {
39751
+ if (exposureData.doesYourCompanyHaveLEI !== "Yes") {
39574
39752
  delete exposureDetails.organization.globalLegalEntityIdentifier;
39575
39753
  }
39576
39754
  const exposureLegalEntityId = getLegalEntityId(exposureIndex, rootLegalEntity);
@@ -39622,6 +39800,7 @@ const handleHighExposureFormSubmission = async (highExposureType, details, creat
39622
39800
  throw highExposureError;
39623
39801
  }
39624
39802
  };
39803
+ const getIntlDate = (date) => date ? new Intl.DateTimeFormat(USER_LOCALE).format(new Date(date)) : void 0;
39625
39804
  const parseConfiguration = ({
39626
39805
  matchingScenario
39627
39806
  }) => parseHighExposureScenarios(matchingScenario == null ? void 0 : matchingScenario[LegalEntityType.ORGANIZATION]);
@@ -39629,17 +39808,23 @@ const logger$8 = createLogger("UpdateLegalEntityForHighExposure");
39629
39808
  const customLabels = {
39630
39809
  company: {
39631
39810
  legalForm: "businessStructure",
39632
- naceCode: "industryAndNaceCode"
39811
+ naceCode: "industryAndNaceCode",
39812
+ totalAssetsValue: "totalAssets",
39813
+ annualTurnoverValue: "annualTurnover"
39633
39814
  },
39634
39815
  parentCompany: {
39635
39816
  legalForm: "businessStructure",
39636
39817
  naceCode: "industryAndNaceCode",
39637
- doesYourCompanyHaveLEI: "doesThisCompanyHaveLEI"
39818
+ doesYourCompanyHaveLEI: "doesThisCompanyHaveLEI",
39819
+ totalAssetsValue: "totalAssets",
39820
+ annualTurnoverValue: "annualTurnover"
39638
39821
  },
39639
39822
  ultimateParentCompany: {
39640
39823
  legalForm: "businessStructure",
39641
39824
  naceCode: "industryAndNaceCode",
39642
- doesYourCompanyHaveLEI: "doesThisCompanyHaveLEI"
39825
+ doesYourCompanyHaveLEI: "doesThisCompanyHaveLEI",
39826
+ totalAssetsValue: "totalAssets",
39827
+ annualTurnoverValue: "annualTurnover"
39643
39828
  }
39644
39829
  };
39645
39830
  function UpdateLegalEntityForHighExposure({
@@ -39898,8 +40083,57 @@ function UpdateLegalEntityForHighExposure({
39898
40083
  });
39899
40084
  }
39900
40085
  };
40086
+ const getTranslatedLegalInsolvency = (insolvencyData) => {
40087
+ if (!insolvencyData) return void 0;
40088
+ return insolvencyData === "noLegalActionsTaken" ? i18n.get("no") : i18n.get(insolvencyData);
40089
+ };
40090
+ const getFormattedAmount = (value, currency) => {
40091
+ if (!value) return void 0;
40092
+ const formattedValue = Number(value).toLocaleString(USER_LOCALE);
40093
+ return `${currency} ${formattedValue}`;
40094
+ };
39901
40095
  const formatDataForSummary2 = (data2) => {
40096
+ var _a2, _b2, _c2;
39902
40097
  const summaryData = cloneObject(data2) || {};
40098
+ if (summaryData.company) {
40099
+ summaryData.company.legalInformationInsolvency = getTranslatedLegalInsolvency((_a2 = summaryData.company) == null ? void 0 : _a2.legalInformationInsolvency);
40100
+ summaryData.company.annualTurnoverValue = getFormattedAmount(summaryData.company.annualTurnoverValue, summaryData.company.annualTurnoverCurrency);
40101
+ delete summaryData.company.annualTurnoverCurrency;
40102
+ summaryData.company.totalAssetsValue = getFormattedAmount(summaryData.company.totalAssetsValue, summaryData.company.totalAssetsCurrency);
40103
+ delete summaryData.company.totalAssetsCurrency;
40104
+ const {
40105
+ legalProceedingsDate,
40106
+ financialReportingDate
40107
+ } = summaryData.company;
40108
+ summaryData.company.legalProceedingsDate = getIntlDate(legalProceedingsDate);
40109
+ summaryData.company.financialReportingDate = getIntlDate(financialReportingDate);
40110
+ }
40111
+ if (summaryData.parentCompany) {
40112
+ summaryData.parentCompany.legalInformationInsolvency = getTranslatedLegalInsolvency((_b2 = summaryData.parentCompany) == null ? void 0 : _b2.legalInformationInsolvency);
40113
+ summaryData.parentCompany.annualTurnoverValue = getFormattedAmount(summaryData.parentCompany.annualTurnoverValue, summaryData.parentCompany.annualTurnoverCurrency);
40114
+ delete summaryData.parentCompany.annualTurnoverCurrency;
40115
+ summaryData.parentCompany.totalAssetsValue = getFormattedAmount(summaryData.parentCompany.totalAssetsValue, summaryData.parentCompany.totalAssetsCurrency);
40116
+ delete summaryData.parentCompany.totalAssetsCurrency;
40117
+ const {
40118
+ legalProceedingsDate,
40119
+ financialReportingDate
40120
+ } = summaryData.parentCompany;
40121
+ summaryData.parentCompany.legalProceedingsDate = getIntlDate(legalProceedingsDate);
40122
+ summaryData.parentCompany.financialReportingDate = getIntlDate(financialReportingDate);
40123
+ }
40124
+ if (summaryData.ultimateParentCompany) {
40125
+ summaryData.ultimateParentCompany.legalInformationInsolvency = getTranslatedLegalInsolvency((_c2 = summaryData.ultimateParentCompany) == null ? void 0 : _c2.legalInformationInsolvency);
40126
+ summaryData.ultimateParentCompany.annualTurnoverValue = getFormattedAmount(summaryData.ultimateParentCompany.annualTurnoverValue, summaryData.ultimateParentCompany.annualTurnoverCurrency);
40127
+ delete summaryData.ultimateParentCompany.annualTurnoverCurrency;
40128
+ summaryData.ultimateParentCompany.totalAssetsValue = getFormattedAmount(summaryData.ultimateParentCompany.totalAssetsValue, summaryData.ultimateParentCompany.totalAssetsCurrency);
40129
+ delete summaryData.ultimateParentCompany.totalAssetsCurrency;
40130
+ const {
40131
+ legalProceedingsDate,
40132
+ financialReportingDate
40133
+ } = summaryData.ultimateParentCompany;
40134
+ summaryData.ultimateParentCompany.legalProceedingsDate = getIntlDate(legalProceedingsDate);
40135
+ summaryData.ultimateParentCompany.financialReportingDate = getIntlDate(financialReportingDate);
40136
+ }
39903
40137
  return summaryData;
39904
40138
  };
39905
40139
  const canSubmit2 = (data2) => mandatoryApiFields.HIGH_EXPOSURE.every((detail) => {
@@ -40609,7 +40843,7 @@ const ConfigurationApiProvider = ({
40609
40843
  isEmbeddedDropin,
40610
40844
  loadingContext
40611
40845
  } = authContext;
40612
- const sdkVersion = "3.27.1";
40846
+ const sdkVersion = "3.28.0";
40613
40847
  useAnalytics({
40614
40848
  onUserEvent,
40615
40849
  legalEntityId: rootLegalEntityId,
@@ -41291,7 +41525,7 @@ const DebugModal = ({
41291
41525
  };
41292
41526
  const copyToClipboard = async () => {
41293
41527
  const toCopy = {
41294
- sdkVersion: "3.27.1",
41528
+ sdkVersion: "3.28.0",
41295
41529
  experiments: Object.fromEntries(allExperimentsWithValues),
41296
41530
  settings: Object.fromEntries(allSettingsWithValues)
41297
41531
  };
@@ -41330,7 +41564,7 @@ const DebugModal = ({
41330
41564
  children: [jsxs("div", {
41331
41565
  className: "adyen-kyc-debug-modal__meta",
41332
41566
  children: [jsxs("span", {
41333
- children: ["SDK version: ", "3.27.1"]
41567
+ children: ["SDK version: ", "3.28.0"]
41334
41568
  }), jsxs("span", {
41335
41569
  children: ["rootLegalEntityId: ", rootLegalEntityId]
41336
41570
  })]