@adyen/kyc-components 2.11.0 → 2.12.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 (60) hide show
  1. package/README.md +9 -9
  2. package/dist/es/adyen-kyc-components.es.js +448 -457
  3. package/dist/style.css +1068 -1068
  4. package/dist/types/components/Dropins/types.d.ts +4 -4
  5. package/dist/types/components/IdDocumentUpload/types.d.ts +1 -0
  6. package/dist/types/components/IdVerification/component/IdVerificationComponent.d.ts +1 -1
  7. package/dist/types/components/IdVerification/types.d.ts +1 -0
  8. package/dist/types/components/Individual/rules.d.ts +1 -0
  9. package/dist/types/components/PayoutVerificationMethod/allowedBankCountriesPerCountry.d.ts +1 -1
  10. package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityAu/component/DriversLicense.d.ts +1 -1
  11. package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityAu/component/IdentityAuComponent.d.ts +2 -2
  12. package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityAu/validate.d.ts +2 -2
  13. package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityHK/component/IdentityHKComponent.d.ts +2 -2
  14. package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityHK/validate.d.ts +2 -2
  15. package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityNZ/component/DriversLicense.d.ts +1 -1
  16. package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityNZ/component/IdentityNZComponent.d.ts +2 -2
  17. package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityNZ/validate.d.ts +2 -2
  18. package/dist/types/components/PersonalDetails/component/IdentityComponent/TypeOfIdentity/index.d.ts +10 -0
  19. package/dist/types/components/PersonalDetails/component/IdentityComponent/{IdentityHK/additionalIdentityInfoSchema.d.ts → TypeOfIdentity/types.d.ts} +1 -0
  20. package/dist/types/components/PersonalDetails/component/IdentityComponent/index.d.ts +2 -2
  21. package/dist/types/components/PersonalDetails/component/IdentityComponent/types.d.ts +16 -0
  22. package/dist/types/components/PersonalDetails/types.d.ts +2 -2
  23. package/dist/types/components/TaskList/component/TaskItemStatus.d.ts +2 -1
  24. package/dist/types/components/TaskList/types.d.ts +1 -1
  25. package/dist/types/components/TrustRegistrationDetails/types.d.ts +1 -0
  26. package/dist/types/components/internal/Address/utils.d.ts +1 -1
  27. package/dist/types/core/Context/CoreContext.d.ts +0 -1
  28. package/dist/types/core/Context/CoreProvider.d.ts +1 -2
  29. package/dist/types/core/Services/componentApi/create-document.d.ts +2 -2
  30. package/dist/types/core/Services/componentApi/get-document.d.ts +2 -2
  31. package/dist/types/core/Services/componentApi/update-document.d.ts +2 -2
  32. package/dist/types/core/Services/utils.d.ts +8 -1
  33. package/dist/types/core/hooks/taskIntros.d.ts +10 -0
  34. package/dist/types/core/hooks/useIdVerificationToken.d.ts +2 -1
  35. package/dist/types/core/models/api/document.d.ts +7 -1
  36. package/dist/types/core/models/api/instant-id-verification.d.ts +1 -0
  37. package/dist/types/core/models/api/legal-arrangement.d.ts +2 -1
  38. package/dist/types/core/models/currency.d.ts +1 -0
  39. package/dist/types/core/models/errors/validation-error.d.ts +1 -0
  40. package/dist/types/core/models/identity.d.ts +4 -1
  41. package/dist/types/language/config.d.ts +1 -0
  42. package/dist/types/utils/api/documentUtils.d.ts +14 -14
  43. package/dist/types/utils/decision-maker-roles.d.ts +1 -1
  44. package/dist/types/utils/entity-status-util.d.ts +2 -2
  45. package/dist/types/utils/mapping/componentApiMapping.d.ts +2 -1
  46. package/dist/types/utils/mapping/utils.d.ts +1 -0
  47. package/dist/types/utils/omitMaskedFieldsIfUnchanged.d.ts +2 -0
  48. package/dist/types/utils/trust-util.d.ts +1 -1
  49. package/package.json +16 -15
  50. package/dist/mockServiceWorker.js +0 -302
  51. package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityAu/additionalIdentityInfoSchema.d.ts +0 -8
  52. package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityAu/component/TypeOfIdentity.d.ts +0 -12
  53. package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityAu/types.d.ts +0 -10
  54. package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityHK/component/TypeOfIdentity.d.ts +0 -12
  55. package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityHK/types.d.ts +0 -10
  56. package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityNZ/additionalIdentityInfoSchema.d.ts +0 -7
  57. package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityNZ/component/TypeOfIdentity.d.ts +0 -12
  58. package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityNZ/types.d.ts +0 -10
  59. package/dist/types/components/internal/Alert/components/ReviewAlert.d.ts +0 -2
  60. package/dist/types/core/hooks/useShouldShowGuidanceIntros.d.ts +0 -7
@@ -119,6 +119,7 @@ const backPage = "Back page";
119
119
  const fileName = "File name";
120
120
  const nationality$1 = "Nationality";
121
121
  const dateOfIncorporation = "Date of incorporation";
122
+ const passportExpiryDate = "Passport expiry date";
122
123
  const proofOfNationality = "Proof of nationality";
123
124
  const uploadDocumentForSsn = "Upload an ID document instead of SSN";
124
125
  const uploadDocumentForNric = "Upload an ID document instead of NRIC";
@@ -511,7 +512,7 @@ const uploadTheFollowingDocuments = "upload the following documents:";
511
512
  const uploadDocumentAndDocument = "%{uploadDocumentOne} and %{documentTwo}";
512
513
  const thenResubmit = "then resubmit.";
513
514
  const isTrustOperationAddressSame = "Is there a different address for your trust's operations?";
514
- const trustDetails = "Trust Details";
515
+ const trustDetails = "Trust details";
515
516
  const trustDetailsDescription = "To prepare your account, we need information about your trust.";
516
517
  const trustDocumentDescription = "We won’t be able to verify your trust without all required information. Make sure the following information is visible on your document:";
517
518
  const nameOfTrust = "Name of trust";
@@ -1174,6 +1175,7 @@ const defaultTrans = {
1174
1175
  fileName,
1175
1176
  nationality: nationality$1,
1176
1177
  dateOfIncorporation,
1178
+ passportExpiryDate,
1177
1179
  proofOfNationality,
1178
1180
  uploadDocumentForSsn,
1179
1181
  uploadDocumentForNric,
@@ -2511,7 +2513,8 @@ const exactLength = (input, length) => {
2511
2513
  };
2512
2514
  const lengthIsBetween = (input, minLength, maxLength) => (input == null ? void 0 : input.length) >= minLength && (input == null ? void 0 : input.length) <= maxLength;
2513
2515
  const trimValWithOneSpace = (val) => val.trimStart().replace(/\s+/g, " ");
2514
- const _alert = "";
2516
+ const _button_component = "";
2517
+ const _link_component = "";
2515
2518
  const _icon = "";
2516
2519
  const Icon = ({
2517
2520
  className = "",
@@ -2523,111 +2526,6 @@ const Icon = ({
2523
2526
  "aria-hidden": true,
2524
2527
  "data-testid": testId
2525
2528
  });
2526
- var AlertTypes = /* @__PURE__ */ ((AlertTypes2) => {
2527
- AlertTypes2[AlertTypes2["BASIC"] = 0] = "BASIC";
2528
- AlertTypes2[AlertTypes2["INFO"] = 1] = "INFO";
2529
- AlertTypes2[AlertTypes2["ERROR"] = 2] = "ERROR";
2530
- AlertTypes2[AlertTypes2["WARNING"] = 3] = "WARNING";
2531
- AlertTypes2[AlertTypes2["SUCCESS"] = 4] = "SUCCESS";
2532
- return AlertTypes2;
2533
- })(AlertTypes || {});
2534
- const Alert = ({
2535
- className,
2536
- title,
2537
- type = AlertTypes.BASIC,
2538
- children,
2539
- hasCloseButton = true
2540
- }) => {
2541
- const {
2542
- i18n
2543
- } = useI18nContext();
2544
- const [isClosed, setIsClosed] = useState(false);
2545
- if (isClosed)
2546
- return null;
2547
- const closeAlert = () => setIsClosed(true);
2548
- const classNames = cx("adl-alert", className, {
2549
- "adl-alert--basic": type === AlertTypes.BASIC,
2550
- "adl-alert--information": type === AlertTypes.INFO,
2551
- "adl-alert--error": type === AlertTypes.ERROR,
2552
- "adl-alert--warning": type === AlertTypes.WARNING,
2553
- "adl-alert--success": type === AlertTypes.SUCCESS
2554
- });
2555
- return jsxs("div", {
2556
- className: classNames,
2557
- role: "alert",
2558
- children: [jsxs("div", {
2559
- className: "adl-alert__header",
2560
- children: [jsx("span", {
2561
- className: "adl-alert__icon",
2562
- children: jsx(AlertIcon, {
2563
- type
2564
- })
2565
- }), title && jsx("span", {
2566
- className: cx("adl-alert__title", {
2567
- "adl-alert__title--no-content": !children
2568
- }),
2569
- children: title
2570
- }), hasCloseButton && jsx("button", {
2571
- "aria-label": i18n.get("close"),
2572
- className: "adl-alert__dismiss",
2573
- onClick: closeAlert,
2574
- type: "button",
2575
- children: jsx(Icon, {
2576
- name: "cross",
2577
- className: "adl-alert__dismiss__icon"
2578
- })
2579
- })]
2580
- }), children]
2581
- });
2582
- };
2583
- const AlertIcon = ({
2584
- className,
2585
- type
2586
- }) => {
2587
- switch (type) {
2588
- case AlertTypes.SUCCESS:
2589
- return jsx(Icon, {
2590
- name: "check"
2591
- });
2592
- case AlertTypes.ERROR:
2593
- return jsx(Icon, {
2594
- name: "warning",
2595
- className
2596
- });
2597
- case AlertTypes.WARNING:
2598
- return jsx(Icon, {
2599
- name: "field-error"
2600
- });
2601
- case AlertTypes.INFO:
2602
- case AlertTypes.BASIC:
2603
- default:
2604
- return jsx(Icon, {
2605
- name: "info-circle",
2606
- className: "adl-alert__icon__info"
2607
- });
2608
- }
2609
- };
2610
- const ReviewAlert = () => {
2611
- const {
2612
- isReview
2613
- } = useCoreContext();
2614
- const {
2615
- i18n
2616
- } = useI18nContext();
2617
- if (!isReview) {
2618
- return null;
2619
- }
2620
- return jsx("div", {
2621
- className: "adl-review-alert",
2622
- children: jsx(Alert, {
2623
- hasCloseButton: false,
2624
- type: AlertTypes.WARNING,
2625
- title: i18n.get("verifyCompanyInfoIsUpToDate")
2626
- })
2627
- });
2628
- };
2629
- const _button_component = "";
2630
- const _link_component = "";
2631
2529
  const Spinner$1 = "";
2632
2530
  const Spinner = ({
2633
2531
  inline = false,
@@ -2726,6 +2624,91 @@ const Button = ({
2726
2624
  });
2727
2625
  };
2728
2626
  const ErrorPanel$1 = "";
2627
+ const _alert = "";
2628
+ var AlertTypes = /* @__PURE__ */ ((AlertTypes2) => {
2629
+ AlertTypes2[AlertTypes2["BASIC"] = 0] = "BASIC";
2630
+ AlertTypes2[AlertTypes2["INFO"] = 1] = "INFO";
2631
+ AlertTypes2[AlertTypes2["ERROR"] = 2] = "ERROR";
2632
+ AlertTypes2[AlertTypes2["WARNING"] = 3] = "WARNING";
2633
+ AlertTypes2[AlertTypes2["SUCCESS"] = 4] = "SUCCESS";
2634
+ return AlertTypes2;
2635
+ })(AlertTypes || {});
2636
+ const Alert = ({
2637
+ className,
2638
+ title,
2639
+ type = AlertTypes.BASIC,
2640
+ children,
2641
+ hasCloseButton = true
2642
+ }) => {
2643
+ const {
2644
+ i18n
2645
+ } = useI18nContext();
2646
+ const [isClosed, setIsClosed] = useState(false);
2647
+ if (isClosed)
2648
+ return null;
2649
+ const closeAlert = () => setIsClosed(true);
2650
+ const classNames = cx("adl-alert", className, {
2651
+ "adl-alert--basic": type === AlertTypes.BASIC,
2652
+ "adl-alert--information": type === AlertTypes.INFO,
2653
+ "adl-alert--error": type === AlertTypes.ERROR,
2654
+ "adl-alert--warning": type === AlertTypes.WARNING,
2655
+ "adl-alert--success": type === AlertTypes.SUCCESS
2656
+ });
2657
+ return jsxs("div", {
2658
+ className: classNames,
2659
+ role: "alert",
2660
+ children: [jsxs("div", {
2661
+ className: "adl-alert__header",
2662
+ children: [jsx("span", {
2663
+ className: "adl-alert__icon",
2664
+ children: jsx(AlertIcon, {
2665
+ type
2666
+ })
2667
+ }), title && jsx("span", {
2668
+ className: cx("adl-alert__title", {
2669
+ "adl-alert__title--no-content": !children
2670
+ }),
2671
+ children: title
2672
+ }), hasCloseButton && jsx("button", {
2673
+ "aria-label": i18n.get("close"),
2674
+ className: "adl-alert__dismiss",
2675
+ onClick: closeAlert,
2676
+ type: "button",
2677
+ children: jsx(Icon, {
2678
+ name: "cross",
2679
+ className: "adl-alert__dismiss__icon"
2680
+ })
2681
+ })]
2682
+ }), children]
2683
+ });
2684
+ };
2685
+ const AlertIcon = ({
2686
+ className,
2687
+ type
2688
+ }) => {
2689
+ switch (type) {
2690
+ case AlertTypes.SUCCESS:
2691
+ return jsx(Icon, {
2692
+ name: "check"
2693
+ });
2694
+ case AlertTypes.ERROR:
2695
+ return jsx(Icon, {
2696
+ name: "warning",
2697
+ className
2698
+ });
2699
+ case AlertTypes.WARNING:
2700
+ return jsx(Icon, {
2701
+ name: "field-error"
2702
+ });
2703
+ case AlertTypes.INFO:
2704
+ case AlertTypes.BASIC:
2705
+ default:
2706
+ return jsx(Icon, {
2707
+ name: "info-circle",
2708
+ className: "adl-alert__icon__info"
2709
+ });
2710
+ }
2711
+ };
2729
2712
  const FormRouterContext = createContext(null);
2730
2713
  function useFormRouterContext() {
2731
2714
  const context = useContext(FormRouterContext);
@@ -8591,6 +8574,7 @@ var TaskStatus = /* @__PURE__ */ ((TaskStatus2) => {
8591
8574
  TaskStatus2[TaskStatus2["REMOVING"] = 9] = "REMOVING";
8592
8575
  return TaskStatus2;
8593
8576
  })(TaskStatus || {});
8577
+ const REQUIRED = "REQUIRED";
8594
8578
  const SOLE_PROP_COUNTRIES = [CountryCodes.Austria, CountryCodes.Australia, CountryCodes.Belgium, CountryCodes.Bulgaria, CountryCodes.Canada, CountryCodes.Croatia, CountryCodes.Cyprus, CountryCodes.CzechRepublic, CountryCodes.Denmark, CountryCodes.Estonia, CountryCodes.Finland, CountryCodes.France, CountryCodes.Germany, CountryCodes.Gibraltar, CountryCodes.Greece, CountryCodes.Guernsey, CountryCodes.HongKong, CountryCodes.Hungary, CountryCodes.Ireland, CountryCodes.IsleOfMan, CountryCodes.Italy, CountryCodes.Jersey, CountryCodes.Latvia, CountryCodes.Liechtenstein, CountryCodes.Lithuania, CountryCodes.Luxembourg, CountryCodes.Malta, CountryCodes.Monaco, CountryCodes.Netherlands, CountryCodes.NewZealand, CountryCodes.Norway, CountryCodes.Poland, CountryCodes.Portugal, CountryCodes.PuertoRico, CountryCodes.Romania, CountryCodes.Singapore, CountryCodes.Slovakia, CountryCodes.Slovenia, CountryCodes.Spain, CountryCodes.Sweden, CountryCodes.Switzerland, CountryCodes.UnitedKingdom, CountryCodes.UnitedStates];
8595
8579
  const ID_NUMBER_EXEMPT_COUNTRIES = [CountryCodes.Canada, CountryCodes.UnitedStates];
8596
8580
  const ID_NUMBER_VERIFICATION_COUNTRIES = [CountryCodes.UnitedStates];
@@ -8600,6 +8584,7 @@ const NATIONALITY_REQUIRED_FOR_COUNTRIES = [CountryCodes.Singapore];
8600
8584
  const CONTACTS_REQUIRED_FOR_COUNTRIES = [CountryCodes.NewZealand];
8601
8585
  const JOB_TITLE_REQUIRED_FOR_COUNTRIES = [CountryCodes.NewZealand];
8602
8586
  const ISSUER_REQUIRED_FOR_COUNTRIES = [CountryCodes.Australia];
8587
+ const EXPIRY_DATE_REQUIRED_FOR_COUNTRIES = [CountryCodes.NewZealand];
8603
8588
  const rules$3 = ({
8604
8589
  data,
8605
8590
  country: country2,
@@ -8608,88 +8593,89 @@ const rules$3 = ({
8608
8593
  isDirectorIdNumberRequiredForCountry: () => {
8609
8594
  var _a, _b, _c, _d, _e;
8610
8595
  if (!((_a = data.personalDetails) == null ? void 0 : _a.role)) {
8611
- return "REQUIRED";
8596
+ return REQUIRED;
8612
8597
  }
8613
8598
  if ((_c = (_b = data.personalDetails) == null ? void 0 : _b.role) == null ? void 0 : _c.some((role2) => role2 !== DecisionMakerType.DIRECTOR)) {
8614
- return "REQUIRED";
8599
+ return REQUIRED;
8615
8600
  }
8616
8601
  if (ID_NUMBER_REQUIRED_FOR_DIRECTOR_COUNTRIES.includes(country2) && ((_e = (_d = data.personalDetails) == null ? void 0 : _d.role) == null ? void 0 : _e.some((role2) => role2 === DecisionMakerType.DIRECTOR))) {
8617
- return "REQUIRED";
8602
+ return REQUIRED;
8618
8603
  }
8619
8604
  },
8620
8605
  idNumberExemptIfApplicableCountry: () => {
8621
8606
  if (ID_NUMBER_EXEMPT_COUNTRIES.includes(country2)) {
8622
- return "REQUIRED";
8607
+ return REQUIRED;
8623
8608
  }
8624
8609
  },
8625
8610
  idDocumentIfIdNumberExempted: () => {
8626
8611
  var _a;
8627
8612
  if ((_a = data.personalDetails) == null ? void 0 : _a.idNumberExempt) {
8628
- return "REQUIRED";
8613
+ return REQUIRED;
8629
8614
  }
8630
8615
  },
8631
8616
  isProofOfResidenceRequired: () => {
8632
8617
  var _a;
8633
8618
  if ((_a = data.proofOfResidence) == null ? void 0 : _a.proofOfResidence) {
8634
- return "REQUIRED";
8619
+ return REQUIRED;
8635
8620
  }
8636
8621
  },
8637
8622
  isProofOfNationalIdRequired: () => {
8638
8623
  var _a;
8639
8624
  if ((_a = data.proofOfNationalId) == null ? void 0 : _a.proofOfNationalId) {
8640
- return "REQUIRED";
8625
+ return REQUIRED;
8641
8626
  }
8642
8627
  },
8643
8628
  contactsIfRequiredForRole: () => {
8644
8629
  var _a, _b, _c, _d;
8645
8630
  if (!((_a = data.personalDetails) == null ? void 0 : _a.role)) {
8646
- return "REQUIRED";
8631
+ return REQUIRED;
8647
8632
  }
8648
8633
  if ((_c = (_b = data.personalDetails) == null ? void 0 : _b.role) == null ? void 0 : _c.includes(DecisionMakerType.SIGNATORY)) {
8649
- return "REQUIRED";
8634
+ return REQUIRED;
8650
8635
  }
8651
8636
  if (CONTACTS_REQUIRED_FOR_COUNTRIES.includes((_d = data.personalDetails) == null ? void 0 : _d.residencyCountry)) {
8652
- return "REQUIRED";
8637
+ return REQUIRED;
8653
8638
  }
8654
8639
  },
8655
8640
  jobTitleIfRequiredForRole: () => {
8656
8641
  var _a, _b;
8657
8642
  if ((_b = (_a = data.personalDetails) == null ? void 0 : _a.role) == null ? void 0 : _b.some((role2) => role2 === DecisionMakerType.SIGNATORY || role2 === DecisionMakerType.CONTROLLING_PERSON)) {
8658
- return "REQUIRED";
8643
+ return REQUIRED;
8659
8644
  }
8660
8645
  if (JOB_TITLE_REQUIRED_FOR_COUNTRIES.includes(country2)) {
8661
- return "REQUIRED";
8646
+ return REQUIRED;
8662
8647
  }
8663
8648
  },
8664
8649
  nationalityIfRequiredForRole: () => {
8665
8650
  var _a;
8666
8651
  if (NATIONALITY_REQUIRED_FOR_COUNTRIES.includes(country2) && ((_a = data.personalDetails) == null ? void 0 : _a.nationality)) {
8667
- return "REQUIRED";
8652
+ return REQUIRED;
8668
8653
  }
8669
8654
  },
8670
8655
  accountHolderIfCustomer: () => {
8671
8656
  if (taskType === TaskTypes.INDIVIDUAL) {
8672
- return "REQUIRED";
8657
+ return REQUIRED;
8673
8658
  }
8674
8659
  },
8675
8660
  requiredIfCountryUsesMultipleTypesOfIdentity: () => {
8676
8661
  if (COUNTRIES_WHICH_USE_MULTIPLE_IDENTITY_TYPES.includes(country2)) {
8677
- return "REQUIRED";
8662
+ return REQUIRED;
8678
8663
  }
8679
8664
  },
8680
8665
  requiredIfIdentityTypeIsDriversLicense: () => {
8681
8666
  var _a;
8682
8667
  if (((_a = data.personalDetails) == null ? void 0 : _a.typeOfIdentity) === "driversLicense") {
8683
- return "REQUIRED";
8668
+ return REQUIRED;
8684
8669
  }
8685
8670
  },
8686
8671
  issuerStateRequired: () => {
8687
8672
  var _a;
8688
8673
  if (((_a = data.personalDetails) == null ? void 0 : _a.typeOfIdentity) === "driversLicense" && ISSUER_REQUIRED_FOR_COUNTRIES.includes(country2)) {
8689
- return "REQUIRED";
8674
+ return REQUIRED;
8690
8675
  }
8691
8676
  },
8692
- isVerificationAllowedForCountry: () => ID_NUMBER_VERIFICATION_COUNTRIES.includes(country2)
8677
+ isVerificationAllowedForCountry: () => ID_NUMBER_VERIFICATION_COUNTRIES.includes(country2),
8678
+ expiryDateRequired: () => EXPIRY_DATE_REQUIRED_FOR_COUNTRIES.includes(country2) ? REQUIRED : void 0
8693
8679
  });
8694
8680
  const accountHolderValidationRules = {
8695
8681
  accountHolder: {
@@ -11044,10 +11030,10 @@ const fetchDocument = async (documentId, entityId) => getDocumentService(documen
11044
11030
  const uploadDocuments = async (documents2, entityId) => {
11045
11031
  const uploadPromises = [];
11046
11032
  documents2.forEach((document2) => {
11047
- if (isDocumentCreatedForEntity(document2, entityId)) {
11033
+ const existingDocument = getDocument$1(entityId, document2.type);
11034
+ if (existingDocument) {
11048
11035
  if (hasDocumentChanged(document2, entityId)) {
11049
- const documentId = getDocument$1(entityId, document2.type).id;
11050
- uploadPromises.push(updateDocumentService(document2, documentId, entityId));
11036
+ uploadPromises.push(updateDocumentService(document2, existingDocument.id, entityId));
11051
11037
  }
11052
11038
  } else {
11053
11039
  uploadPromises.push(createDocumentService(document2, entityId));
@@ -11073,24 +11059,26 @@ const updateEntityDocuments = (uploadedDocuments, entityId) => {
11073
11059
  };
11074
11060
  const getDocument$1 = (entityId, documentType2) => {
11075
11061
  var _a;
11076
- return (_a = documentStore[entityId]) == null ? void 0 : _a.find((document2) => document2.type === documentType2 && isDocumentActive(document2));
11062
+ if (!entityId) {
11063
+ return;
11064
+ }
11065
+ return (_a = documentStore[entityId]) == null ? void 0 : _a.find((document2) => document2.type === documentType2);
11077
11066
  };
11078
11067
  const getIdDocument = (entityId) => {
11079
11068
  var _a;
11080
- return (_a = documentStore[entityId]) == null ? void 0 : _a.find((document2) => idTypes.includes(document2.type) && isDocumentActive(document2));
11069
+ return (_a = documentStore[entityId]) == null ? void 0 : _a.find((document2) => idTypes.includes(document2.type));
11081
11070
  };
11082
11071
  const createDocumentRequest = async ({
11083
11072
  entityId,
11084
11073
  entityType: entityType2,
11085
11074
  documentType: documentType2,
11086
11075
  page1,
11087
- page2 = null,
11088
- description: description2 = null,
11089
- existingDocument = null
11076
+ page2,
11077
+ description: description2,
11078
+ existingDocument
11090
11079
  }) => {
11091
11080
  const promises = [fileToBase64(page1), fileToBase64(page2)].filter(Boolean);
11092
11081
  const [encodedFront, encodedBack] = await Promise.all(promises);
11093
- const hasPageType = page1 && page2;
11094
11082
  if (!encodedFront) {
11095
11083
  if (existingDocument && existingDocument.description !== description2) {
11096
11084
  return {
@@ -11111,23 +11099,16 @@ const createDocumentRequest = async ({
11111
11099
  },
11112
11100
  type: documentType2,
11113
11101
  description: description2 || `Document type: ${documentType2}`,
11114
- attachments: [createAttachment(encodedFront, page1 == null ? void 0 : page1.name, hasPageType ? "front" : null), createAttachment(encodedBack, page2 == null ? void 0 : page2.name, hasPageType ? "back" : null)].filter(Boolean)
11102
+ attachments: [...page1 && page2 && encodedFront && encodedBack ? [createAttachment(encodedFront, page1.name, "front"), createAttachment(encodedBack, page2.name, "back")] : [createAttachment(encodedFront, page1.name)]]
11115
11103
  };
11116
11104
  };
11117
- const createAttachment = (content, pageName, pageType = "") => content && {
11105
+ const createAttachment = (content, pageName, pageType = "") => ({
11118
11106
  content,
11119
11107
  pageName,
11120
11108
  ...pageType && {
11121
11109
  pageType
11122
11110
  }
11123
- };
11124
- const isDocumentCreatedForEntity = (newDocument, entityId) => {
11125
- const existingDocuments = documentStore[entityId];
11126
- if (existingDocuments == null ? void 0 : existingDocuments.length) {
11127
- return existingDocuments.some((document2) => document2.type === newDocument.type);
11128
- }
11129
- return false;
11130
- };
11111
+ });
11131
11112
  const hasDocumentChanged = (newDocument, entityId) => {
11132
11113
  const existingDocument = getDocument$1(entityId, newDocument.type);
11133
11114
  if (existingDocument) {
@@ -11138,20 +11119,16 @@ const hasDocumentChanged = (newDocument, entityId) => {
11138
11119
  }
11139
11120
  return true;
11140
11121
  };
11141
- const isDocumentActive = (document2) => (
11142
- // TODO: check whether the document is active once the boolean in added in backend
11143
- // return document.isActive;
11144
- !!document2
11145
- );
11146
11122
  const fileToBase64 = (file) => new Promise((resolve, reject) => {
11147
11123
  if (!file || !(file instanceof Blob)) {
11148
- resolve(null);
11124
+ resolve();
11149
11125
  return;
11150
11126
  }
11151
11127
  const reader = new FileReader();
11152
11128
  reader.readAsDataURL(file);
11153
11129
  reader.onload = () => {
11154
- const base64String = reader.result.toString().split(";base64,")[1];
11130
+ var _a;
11131
+ const base64String = (_a = reader.result) == null ? void 0 : _a.toString().split(";base64,")[1];
11155
11132
  resolve(base64String);
11156
11133
  };
11157
11134
  reader.onerror = (error) => reject(error);
@@ -11648,14 +11625,13 @@ const getCountrySpecificTrustTypeOptions = (country2) => {
11648
11625
  if (!countrySpecificTrustTypes) {
11649
11626
  return [];
11650
11627
  }
11651
- const countrySpecificTrustTypeOptions = countrySpecificTrustTypes.map((countrySpecificTrustType) => {
11628
+ return countrySpecificTrustTypes.map((countrySpecificTrustType) => {
11652
11629
  const countrySpecificTrustTypeOption = trustTypeOptions.find((trustTypeOption) => trustTypeOption.id === countrySpecificTrustType);
11653
11630
  if (!countrySpecificTrustTypeOption) {
11654
11631
  throw new Error("getCountrySpecificTrustTypeOptions(): unknown trust type");
11655
11632
  }
11656
11633
  return countrySpecificTrustTypeOption;
11657
11634
  });
11658
- return countrySpecificTrustTypeOptions;
11659
11635
  };
11660
11636
  const entityAssociationRoles = {
11661
11637
  ...trustMemberRoles,
@@ -11891,6 +11867,7 @@ const individualBaseMapping = {
11891
11867
  "personalDetails.typeOfIdentity": "individual.identificationData.type",
11892
11868
  "personalDetails.issuerState": "individual.identificationData.issuerState",
11893
11869
  "personalDetails.licenseCardNumber": "individual.identificationData.cardNumber",
11870
+ "personalDetails.expiryDate": "individual.identificationData.expiryDate",
11894
11871
  "personalDetails.nationality": "individual.nationality",
11895
11872
  "personalDetails.jobTitle": "individual.jobTitle",
11896
11873
  "address.city": "individual.residentialAddress.city",
@@ -12076,6 +12053,21 @@ function assignToProp(path, obj, val) {
12076
12053
  }
12077
12054
  });
12078
12055
  }
12056
+ function deleteProp(path, obj) {
12057
+ const splitPath = path.split(".");
12058
+ const pathDepth = splitPath.length;
12059
+ let currentObj = obj;
12060
+ splitPath.forEach((key, index) => {
12061
+ if (index === pathDepth - 1) {
12062
+ delete currentObj[key];
12063
+ } else {
12064
+ if (!currentObj[key]) {
12065
+ throw Error(`The given path does not exist on the object: ${key} (${path})`);
12066
+ }
12067
+ currentObj = currentObj[key];
12068
+ }
12069
+ });
12070
+ }
12079
12071
  const formatObject = (obj, mapping) => {
12080
12072
  if (obj) {
12081
12073
  const formattedObj = {};
@@ -12228,6 +12220,7 @@ const mapLegalEntityToTrust = (legalEntity) => {
12228
12220
  let trustCompData;
12229
12221
  if (legalEntity == null ? void 0 : legalEntity.trust) {
12230
12222
  trustCompData = formatObject(legalEntity, trustComponentsKeyMapping);
12223
+ trustCompData.trustRegistrationDetails.country = legalEntity.trust.countryOfGoverningLaw;
12231
12224
  if ((_a = legalEntity.trust) == null ? void 0 : _a.principalPlaceOfBusiness) {
12232
12225
  trustCompData.trustRegistrationAddress.operationalAddressIsSame = operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME;
12233
12226
  } else {
@@ -12711,6 +12704,7 @@ const IdDocumentManualUpload = memo(IdDocumentManualUploadComponent, (prevProps,
12711
12704
  const IdVerificationComponent$1 = "";
12712
12705
  const useIdVerificationToken = ({
12713
12706
  userDetails,
12707
+ legalEntityId,
12714
12708
  handleGetIdVerificationToken,
12715
12709
  onIdVerificationError
12716
12710
  }) => {
@@ -12738,7 +12732,11 @@ const useIdVerificationToken = ({
12738
12732
  consents: [{
12739
12733
  name: "privacy_notices_read",
12740
12734
  granted: true
12741
- }]
12735
+ }],
12736
+ ...legalEntityId ? {
12737
+ legalEntityId
12738
+ } : {}
12739
+ // Do not include legalEntityId if we don't know yet. Eg.: decision-makers flow the associated legalEntityId.
12742
12740
  };
12743
12741
  const {
12744
12742
  sdkToken: sdkToken2
@@ -13286,6 +13284,7 @@ const initOnfido = async ({
13286
13284
  const logger$g = createLogger("IdVerificationComponent");
13287
13285
  function IdVerificationComponent({
13288
13286
  userDetails,
13287
+ legalEntityId,
13289
13288
  handleGetIdVerificationToken,
13290
13289
  onIdVerificationClose,
13291
13290
  onIdVerificationError,
@@ -13299,6 +13298,7 @@ function IdVerificationComponent({
13299
13298
  loadingStatus
13300
13299
  } = useIdVerificationToken({
13301
13300
  userDetails,
13301
+ legalEntityId,
13302
13302
  handleGetIdVerificationToken,
13303
13303
  onIdVerificationError
13304
13304
  });
@@ -13446,6 +13446,7 @@ function IdDocumentInstantVerificationComponent(props) {
13446
13446
  children: [props.userDetails && jsx(IdVerificationComponent, {
13447
13447
  handleGetIdVerificationToken: props.handleGetIdVerificationToken,
13448
13448
  userDetails: props.userDetails,
13449
+ legalEntityId: props.legalEntityId,
13449
13450
  onIdVerificationComplete: handleIdVerificationComplete,
13450
13451
  onIdVerificationError: logger$f.error
13451
13452
  }), jsxs("div", {
@@ -13469,7 +13470,8 @@ function IdDocumentUploadComponent(props) {
13469
13470
  return props.idVerificationMethodSelected === "instantVerification" && !!props.handleGetIdVerificationToken ? jsx(IdDocumentInstantVerification, {
13470
13471
  ...props,
13471
13472
  handleGetIdVerificationToken: props.handleGetIdVerificationToken,
13472
- userDetails: props.userDetails
13473
+ userDetails: props.userDetails,
13474
+ legalEntityId: props.legalEntityId
13473
13475
  }) : jsx(IdDocumentManualUpload, {
13474
13476
  ...props
13475
13477
  });
@@ -14681,8 +14683,37 @@ const personalDetailsValidationRules = {
14681
14683
  errorMessage: "fieldIsRequired"
14682
14684
  }
14683
14685
  };
14684
- const additionalIdentityInfoFields$2 = ["typeOfIdentity", "licenseCardNumber", "issuerState"];
14685
- const identityTypes$2 = ["nationalIdNumber", "passport", "driversLicense", "proofOfIdentityCard"];
14686
+ const mapIdentityTypeToItem = (type, label) => ({
14687
+ id: type,
14688
+ name: label
14689
+ });
14690
+ const TypeOfIdentity = ({
14691
+ availableIdentityTypes,
14692
+ selectedIdentityType,
14693
+ setSelectedIdentityType,
14694
+ label,
14695
+ errorMessage,
14696
+ isValid
14697
+ }) => {
14698
+ const {
14699
+ i18n
14700
+ } = useI18nContext();
14701
+ return jsx(Field, {
14702
+ name: "typeOfIdentity",
14703
+ label,
14704
+ errorMessage,
14705
+ isValid,
14706
+ helper: i18n.get("typeOfIdentitySubtitle"),
14707
+ children: (childProps) => jsx(Select, {
14708
+ ...childProps,
14709
+ isInvalid: false,
14710
+ items: availableIdentityTypes.map((type) => mapIdentityTypeToItem(type, i18n.get(type))),
14711
+ placeholder: i18n.get("id"),
14712
+ selected: selectedIdentityType,
14713
+ onChange: (event) => setSelectedIdentityType(event.target.value)
14714
+ })
14715
+ });
14716
+ };
14686
14717
  const auIdentityValidationRules = {
14687
14718
  typeOfIdentity: [isTruthyValidator],
14688
14719
  idNumber: [{
@@ -14826,54 +14857,21 @@ const ProofOfIdentityCard$1 = ({
14826
14857
  getLabel
14827
14858
  },
14828
14859
  errorMessage,
14829
- isValid
14830
- }) => jsx(Field, {
14831
- name: "cardNumber",
14832
- label: getLabel("idNumber", "proofOfIdentityCardNumber"),
14833
- errorMessage,
14834
- isValid,
14835
- children: (childProps) => jsx(InputText, {
14836
- ...childProps,
14837
- name: "cardNumber",
14838
- value: cardNumber,
14839
- onInput,
14840
- onBlur,
14841
- placeholder: ""
14842
- })
14843
- });
14844
- const mapIdentityTypeToItem$2 = (type, label) => ({
14845
- id: type,
14846
- name: label
14847
- });
14848
- const TypeOfIdentity$2 = ({
14849
- availableIdentityTypes,
14850
- selectedIdentityType,
14851
- setSelectedIdentityType,
14852
- formUtils: {
14853
- getLabel
14854
- },
14855
- errorMessage,
14856
- isValid
14857
- }) => {
14858
- const {
14859
- i18n
14860
- } = useI18nContext();
14861
- return jsx(Field, {
14862
- name: "typeOfIdentity",
14863
- label: getLabel("typeOfIdentity"),
14864
- errorMessage,
14865
- isValid,
14866
- helper: i18n.get("typeOfIdentitySubtitle"),
14867
- children: (childProps) => jsx(Select, {
14868
- ...childProps,
14869
- isInvalid: false,
14870
- items: availableIdentityTypes.map((type) => mapIdentityTypeToItem$2(type, i18n.get(type))),
14871
- placeholder: i18n.get("id"),
14872
- selected: selectedIdentityType,
14873
- onChange: (event) => setSelectedIdentityType(event.target.value)
14874
- })
14875
- });
14876
- };
14860
+ isValid
14861
+ }) => jsx(Field, {
14862
+ name: "cardNumber",
14863
+ label: getLabel("idNumber", "proofOfIdentityCardNumber"),
14864
+ errorMessage,
14865
+ isValid,
14866
+ children: (childProps) => jsx(InputText, {
14867
+ ...childProps,
14868
+ name: "cardNumber",
14869
+ value: cardNumber,
14870
+ onInput,
14871
+ onBlur,
14872
+ placeholder: ""
14873
+ })
14874
+ });
14877
14875
  function IdentityAuComponent(props) {
14878
14876
  var _a;
14879
14877
  if (((_a = props.data) == null ? void 0 : _a.typeOfIdentity) === "nationalIdNumber") {
@@ -14915,12 +14913,14 @@ function IdentityAuComponent(props) {
14915
14913
  i18n
14916
14914
  } = useI18nContext();
14917
14915
  const formUtils = formUtilities(props, i18n);
14916
+ const availableIdentityTypes = ["passport", "driversLicense", "proofOfIdentityCard"];
14917
+ const selectedIdentityType = data.typeOfIdentity;
14918
14918
  return jsxs(Fragment, {
14919
- children: [jsx(TypeOfIdentity$2, {
14920
- availableIdentityTypes: identityTypes$2.filter((type) => type !== "nationalIdNumber"),
14921
- selectedIdentityType: data.typeOfIdentity,
14919
+ children: [jsx(TypeOfIdentity, {
14920
+ availableIdentityTypes,
14921
+ selectedIdentityType,
14922
14922
  setSelectedIdentityType: handleChangeFor("typeOfIdentity"),
14923
- formUtils,
14923
+ label: formUtils.getLabel("typeOfIdentity"),
14924
14924
  isValid: valid.typeOfIdentity,
14925
14925
  errorMessage: formUtils.getErrorMessage("typeOfIdentity", errors, fieldProblems)
14926
14926
  }), data.typeOfIdentity === "passport" ? jsx(PassportNumber$2, {
@@ -14958,9 +14958,6 @@ function IdentityAuComponent(props) {
14958
14958
  }) : void 0]
14959
14959
  });
14960
14960
  }
14961
- const auIdentityFields = [...additionalIdentityInfoFields$2, "idNumber"];
14962
- const additionalIdentityInfoFields$1 = ["typeOfIdentity"];
14963
- const identityTypes$1 = ["nationalIdNumber", "passport", "driversLicense", "proofOfIdentityCard"];
14964
14961
  const isValidatePassportNumber = (value) => PassportNumberPatterns.HK.test(value);
14965
14962
  const identityValidationRules = {
14966
14963
  typeOfIdentity: [isTruthyValidator],
@@ -15060,39 +15057,6 @@ const ProofOfIdentityCard = ({
15060
15057
  placeholder: ""
15061
15058
  })
15062
15059
  });
15063
- const mapIdentityTypeToItem$1 = (type, label) => ({
15064
- id: type,
15065
- name: label
15066
- });
15067
- const TypeOfIdentity$1 = ({
15068
- availableIdentityTypes,
15069
- selectedIdentityType,
15070
- setSelectedIdentityType,
15071
- formUtils: {
15072
- getLabel
15073
- },
15074
- errorMessage,
15075
- isValid
15076
- }) => {
15077
- const {
15078
- i18n
15079
- } = useI18nContext();
15080
- return jsx(Field, {
15081
- name: "typeOfIdentity",
15082
- label: getLabel("typeOfIdentity"),
15083
- errorMessage,
15084
- isValid,
15085
- helper: i18n.get("typeOfIdentitySubtitle"),
15086
- children: (childProps) => jsx(Select, {
15087
- ...childProps,
15088
- isInvalid: false,
15089
- items: availableIdentityTypes.map((type) => mapIdentityTypeToItem$1(type, i18n.get(type))),
15090
- placeholder: i18n.get("id"),
15091
- selected: selectedIdentityType,
15092
- onChange: (event) => setSelectedIdentityType(event.target.value)
15093
- })
15094
- });
15095
- };
15096
15060
  function IdentityHKComponent(props) {
15097
15061
  var _a;
15098
15062
  if (((_a = props.data) == null ? void 0 : _a.typeOfIdentity) === "nationalIdNumber") {
@@ -15137,12 +15101,14 @@ function IdentityHKComponent(props) {
15137
15101
  i18n
15138
15102
  } = useI18nContext();
15139
15103
  const formUtils = formUtilities(props, i18n);
15104
+ const availableIdentityTypes = ["passport", "driversLicense", "proofOfIdentityCard"];
15105
+ const selectedIdentityType = data.typeOfIdentity;
15140
15106
  return jsxs(Fragment, {
15141
- children: [jsx(TypeOfIdentity$1, {
15142
- availableIdentityTypes: identityTypes$1.filter((type) => type !== "nationalIdNumber"),
15143
- selectedIdentityType: data.typeOfIdentity,
15107
+ children: [jsx(TypeOfIdentity, {
15108
+ availableIdentityTypes,
15109
+ selectedIdentityType,
15144
15110
  setSelectedIdentityType: handleChangeFor("typeOfIdentity"),
15145
- formUtils,
15111
+ label: formUtils.getLabel("typeOfIdentity"),
15146
15112
  isValid: valid.typeOfIdentity,
15147
15113
  errorMessage: formUtils.getErrorMessage("typeOfIdentity", errors, fieldProblems)
15148
15114
  }), data.typeOfIdentity === "passport" ? jsx(PassportNumber$1, {
@@ -15173,9 +15139,6 @@ function IdentityHKComponent(props) {
15173
15139
  }) : void 0]
15174
15140
  });
15175
15141
  }
15176
- const hkIdentityFields = [...additionalIdentityInfoFields$1, "idNumber"];
15177
- const additionalIdentityInfoFields = ["typeOfIdentity", "licenseCardNumber"];
15178
- const identityTypes = ["nationalIdNumber", "passport", "driversLicense", "proofOfIdentityCard"];
15179
15142
  const nzIdentityValidationRules = {
15180
15143
  typeOfIdentity: [isTruthyValidator],
15181
15144
  idNumber: [{
@@ -15292,39 +15255,6 @@ const PassportNumber = ({
15292
15255
  placeholder: ""
15293
15256
  })
15294
15257
  });
15295
- const mapIdentityTypeToItem = (type, label) => ({
15296
- id: type,
15297
- name: label
15298
- });
15299
- const TypeOfIdentity = ({
15300
- availableIdentityTypes,
15301
- selectedIdentityType,
15302
- setSelectedIdentityType,
15303
- formUtils: {
15304
- getLabel
15305
- },
15306
- errorMessage,
15307
- isValid
15308
- }) => {
15309
- const {
15310
- i18n
15311
- } = useI18nContext();
15312
- return jsx(Field, {
15313
- name: "typeOfIdentity",
15314
- label: getLabel("typeOfIdentity"),
15315
- errorMessage,
15316
- isValid,
15317
- helper: i18n.get("typeOfIdentitySubtitle"),
15318
- children: (childProps) => jsx(Select, {
15319
- ...childProps,
15320
- isInvalid: false,
15321
- items: availableIdentityTypes.map((type) => mapIdentityTypeToItem(type, i18n.get(type))),
15322
- placeholder: i18n.get("id"),
15323
- selected: selectedIdentityType,
15324
- onChange: (event) => setSelectedIdentityType(event.target.value)
15325
- })
15326
- });
15327
- };
15328
15258
  function IdentityNZComponent(props) {
15329
15259
  var _a;
15330
15260
  if (((_a = props.data) == null ? void 0 : _a.typeOfIdentity) === "nationalIdNumber") {
@@ -15367,21 +15297,47 @@ function IdentityNZComponent(props) {
15367
15297
  } = useI18nContext();
15368
15298
  const formUtils = formUtilities(props, i18n);
15369
15299
  const availableIdentityTypes = ["passport", "driversLicense"];
15300
+ const selectedIdentityType = data.typeOfIdentity;
15301
+ const today = /* @__PURE__ */ new Date();
15302
+ const maxExpiryDateSelection = new Date((/* @__PURE__ */ new Date()).setFullYear(today.getFullYear() + 10));
15370
15303
  return jsxs(Fragment, {
15371
15304
  children: [jsx(TypeOfIdentity, {
15372
- availableIdentityTypes: identityTypes.filter((type) => availableIdentityTypes.includes(type)),
15373
- selectedIdentityType: data.typeOfIdentity,
15305
+ availableIdentityTypes,
15306
+ selectedIdentityType,
15374
15307
  setSelectedIdentityType: handleChangeFor("typeOfIdentity"),
15375
- formUtils,
15308
+ label: formUtils.getLabel("typeOfIdentity"),
15376
15309
  isValid: valid.typeOfIdentity,
15377
15310
  errorMessage: formUtils.getErrorMessage("typeOfIdentity", errors, fieldProblems)
15378
- }), data.typeOfIdentity === "passport" ? jsx(PassportNumber, {
15379
- passportNumber: data.idNumber ?? "",
15380
- onInput: handleChangeFor("idNumber", "input"),
15381
- onBlur: handleChangeFor("idNumber", "blur"),
15382
- formUtils,
15383
- isValid: valid.idNumber,
15384
- errorMessage: formUtils.getErrorMessage("idNumber", errors, fieldProblems)
15311
+ }), data.typeOfIdentity === "passport" ? jsxs("div", {
15312
+ className: "adyen-kyc-field-wrapper",
15313
+ children: [jsx(PassportNumber, {
15314
+ passportNumber: data.idNumber ?? "",
15315
+ onInput: handleChangeFor("idNumber", "input"),
15316
+ onBlur: handleChangeFor("idNumber", "blur"),
15317
+ formUtils,
15318
+ isValid: valid.idNumber,
15319
+ errorMessage: formUtils.getErrorMessage("idNumber", errors, fieldProblems)
15320
+ }), jsx(Field, {
15321
+ name: "expiryDate",
15322
+ label: formUtils.getLabel("passportExpiryDate"),
15323
+ classNameModifiers: ["expiryDate"],
15324
+ errorMessage: formUtils.getErrorMessage("expiryDate", errors, fieldProblems),
15325
+ isValid: valid.expiryDate,
15326
+ children: (childProps) => jsx(InputDate, {
15327
+ ...childProps,
15328
+ name: "expiryDate",
15329
+ value: data.expiryDate,
15330
+ placeholder: i18n.get("datePlaceholder"),
15331
+ readonly: formUtils.isReadOnly("expiryDate"),
15332
+ onInput: handleChangeFor("expiryDate", "input"),
15333
+ onBlur: handleChangeFor("expiryDate", "blur"),
15334
+ "aria-required": true,
15335
+ "aria-label": formUtils.getLabel("passportExpiryDate"),
15336
+ "aria-invalid": !valid.expiryDate,
15337
+ min: formatDateObj(today),
15338
+ max: formatDateObj(maxExpiryDateSelection)
15339
+ })
15340
+ })]
15385
15341
  }) : data.typeOfIdentity === "driversLicense" ? jsx(DriversLicense, {
15386
15342
  driversLicense: data,
15387
15343
  onLicenseNumberInput: handleChangeFor("idNumber", "input"),
@@ -15400,7 +15356,6 @@ function IdentityNZComponent(props) {
15400
15356
  }) : void 0]
15401
15357
  });
15402
15358
  }
15403
- const nzIdentityFields = [...additionalIdentityInfoFields, "idNumber"];
15404
15359
  const ERROR_CODES = {
15405
15360
  SSN_REMEDIATION: "1_316",
15406
15361
  SSN_4_DIGITS_VALIDATION: "1_3062",
@@ -15444,6 +15399,8 @@ const IdentityUSComponent = forwardRef((props, ref) => {
15444
15399
  ref
15445
15400
  });
15446
15401
  });
15402
+ const additionalIdentityInfoFields = ["typeOfIdentity", "licenseCardNumber", "issuerState", "expiryDate"];
15403
+ const identityFields = [...additionalIdentityInfoFields, "idNumber"];
15447
15404
  function IdentityComponent(props) {
15448
15405
  var _a;
15449
15406
  const {
@@ -15455,44 +15412,39 @@ function IdentityComponent(props) {
15455
15412
  if (!((_a = identityProps == null ? void 0 : identityProps.requiredFields) == null ? void 0 : _a.length)) {
15456
15413
  return null;
15457
15414
  }
15458
- if (country2 === "AU") {
15459
- const auIdentityProps = getFieldProps(personalDetails2, auIdentityFields);
15460
- return jsx(IdentityAuComponent, {
15461
- ...auIdentityProps,
15462
- dataStoreId: personalDetails2.id
15463
- });
15464
- }
15465
- if (country2 === "HK") {
15466
- const hkIdentityProps = getFieldProps(personalDetails2, hkIdentityFields);
15467
- return jsx(IdentityHKComponent, {
15468
- ...hkIdentityProps,
15469
- dataStoreId: personalDetails2.id
15470
- });
15471
- }
15415
+ const {
15416
+ id: dataStoreId
15417
+ } = personalDetails2;
15472
15418
  if (country2 === "US") {
15473
15419
  return jsx(IdentityUSComponent, {
15474
15420
  ...identityProps,
15475
15421
  errors,
15476
- dataStoreId: personalDetails2.id,
15422
+ dataStoreId,
15477
15423
  country: country2,
15478
15424
  formVerificationErrors: personalDetails2.formVerificationErrors
15479
15425
  });
15480
15426
  }
15481
- if (country2 === "NZ") {
15482
- const nzIdentityProps = getFieldProps(personalDetails2, nzIdentityFields);
15483
- return jsx(IdentityNZComponent, {
15484
- ...nzIdentityProps,
15485
- dataStoreId: personalDetails2.id
15427
+ const countrySpecificComponentsMap = {
15428
+ [CountryCodes.Australia]: IdentityAuComponent,
15429
+ [CountryCodes.HongKong]: IdentityHKComponent,
15430
+ [CountryCodes.NewZealand]: IdentityNZComponent
15431
+ };
15432
+ const Component = countrySpecificComponentsMap[country2];
15433
+ if (!Component) {
15434
+ return jsx(IdentityNumberComponent, {
15435
+ ...identityProps,
15436
+ errors,
15437
+ country: country2,
15438
+ dataStoreId
15486
15439
  });
15487
15440
  }
15488
- return jsx(IdentityNumberComponent, {
15489
- ...identityProps,
15490
- errors,
15491
- country: country2,
15492
- dataStoreId: personalDetails2.id
15441
+ const countrySpecificIdentityProps = getFieldProps(personalDetails2, identityFields);
15442
+ return jsx(Component, {
15443
+ ...countrySpecificIdentityProps,
15444
+ dataStoreId
15493
15445
  });
15494
15446
  }
15495
- const personalDetailsFields = [...nameFields, "birthDate", ...idNumberFields, ...additionalIdentityInfoFields$2, "residencyCountry", "nationality", "jobTitle", ...decisionMakerRoleFields, ...contactDetailFields, ...accountHolderFields];
15447
+ const personalDetailsFields = [...nameFields, "birthDate", ...idNumberFields, ...additionalIdentityInfoFields, "residencyCountry", "nationality", "jobTitle", ...decisionMakerRoleFields, ...contactDetailFields, ...accountHolderFields];
15496
15448
  function PersonalDetailsComponent(props) {
15497
15449
  const {
15498
15450
  i18n
@@ -16062,6 +16014,7 @@ var Currency = /* @__PURE__ */ ((Currency2) => {
16062
16014
  Currency2["HRK"] = "HRK";
16063
16015
  Currency2["PLN"] = "PLN";
16064
16016
  Currency2["NOK"] = "NOK";
16017
+ Currency2["NZD"] = "NZD";
16065
16018
  Currency2["RON"] = "RON";
16066
16019
  Currency2["SGD"] = "SGD";
16067
16020
  Currency2["SEK"] = "SEK";
@@ -16099,6 +16052,7 @@ const currencyByCountry = {
16099
16052
  [CountryCodes.Malta]: [Currency.EUR],
16100
16053
  [CountryCodes.Monaco]: [Currency.EUR],
16101
16054
  [CountryCodes.Netherlands]: [Currency.EUR],
16055
+ [CountryCodes.NewZealand]: [Currency.NZD],
16102
16056
  [CountryCodes.Norway]: [Currency.NOK, Currency.EUR],
16103
16057
  [CountryCodes.Poland]: [Currency.PLN, Currency.EUR],
16104
16058
  [CountryCodes.Portugal]: [Currency.EUR],
@@ -16270,16 +16224,17 @@ const getRequestUrl = (loadingContext, path, clientKey) => {
16270
16224
  }
16271
16225
  return url;
16272
16226
  };
16273
- const handleFetchError = (message, level) => {
16227
+ const logFetchError = (message, level) => {
16274
16228
  switch (level) {
16275
16229
  case "silent":
16276
16230
  break;
16277
16231
  case "info":
16278
16232
  case "warn":
16279
16233
  case "error":
16280
- return logger$e[level](message);
16234
+ logger$e[level](message);
16235
+ break;
16281
16236
  default:
16282
- throw new Error(message);
16237
+ logger$e.error(message);
16283
16238
  }
16284
16239
  };
16285
16240
  const handleFetchResponse = async (response, responseType) => {
@@ -16294,6 +16249,14 @@ const handleFetchResponse = async (response, responseType) => {
16294
16249
  return response.text();
16295
16250
  }
16296
16251
  };
16252
+ const isValidationErrorResponse = (response) => (response == null ? void 0 : response.status) === 422;
16253
+ class ValidationError extends Error {
16254
+ constructor(message, validationDetails) {
16255
+ super(message);
16256
+ this.invalidFields = validationDetails == null ? void 0 : validationDetails.invalidFields;
16257
+ this.errorCode = validationDetails == null ? void 0 : validationDetails.errorCode;
16258
+ }
16259
+ }
16297
16260
  const http = async (options, data, responseType = "json") => {
16298
16261
  const {
16299
16262
  errorLevel = "warn",
@@ -16303,18 +16266,31 @@ const http = async (options, data, responseType = "json") => {
16303
16266
  } = options;
16304
16267
  const request = getRequestObject(options, data);
16305
16268
  const url = getRequestUrl(loadingContext, path, clientKey);
16306
- return fetch(url, request).then((response) => {
16307
- if (response.ok)
16308
- return handleFetchResponse(response, responseType);
16309
- const errorMessage = options.errorMessage || `Service at ${url} is not available`;
16310
- if (options.errorHandler) {
16311
- return options.errorHandler(handleFetchResponse(response, responseType));
16312
- }
16313
- return handleFetchError(errorMessage, errorLevel);
16314
- }).catch((e) => {
16315
- const errorMessage = options.errorMessage || `Call to ${url} failed. Error= ${e}`;
16316
- return handleFetchError(errorMessage, errorLevel);
16317
- });
16269
+ let response;
16270
+ try {
16271
+ response = await fetch(url, request);
16272
+ } catch (error) {
16273
+ const errorMessage2 = options.errorMessage || `Service at ${url} is not available. Error= ${error}`;
16274
+ logFetchError(errorMessage2, errorLevel);
16275
+ throw new Error(errorMessage2);
16276
+ }
16277
+ const errorMessage = options.errorMessage || `Call to ${url} failed.`;
16278
+ if (!response) {
16279
+ logFetchError(errorMessage, errorLevel);
16280
+ throw new Error(errorMessage);
16281
+ }
16282
+ if (response.ok) {
16283
+ return handleFetchResponse(response, responseType);
16284
+ }
16285
+ if (options.errorHandler) {
16286
+ return options.errorHandler(handleFetchResponse(response, responseType));
16287
+ }
16288
+ if (isValidationErrorResponse(response)) {
16289
+ const responseData = await response.json();
16290
+ throw new ValidationError(responseData.errorCode, responseData);
16291
+ }
16292
+ logFetchError(errorMessage, errorLevel);
16293
+ throw new Error(errorMessage);
16318
16294
  };
16319
16295
  const httpGet = async (options, data) => http({
16320
16296
  ...options,
@@ -18051,12 +18027,11 @@ const PayoutBankStatement = memo(PayoutBankStatementComponent, (prevProps, nextP
18051
18027
  const VerificationMethod = "";
18052
18028
  const hasLoaded = (loadedValue) => loadedValue !== "loading";
18053
18029
  const eeaCountries = [CountryCodes.Austria, CountryCodes.Belgium, CountryCodes.Bulgaria, CountryCodes.Croatia, CountryCodes.Cyprus, CountryCodes.CzechRepublic, CountryCodes.Denmark, CountryCodes.Estonia, CountryCodes.Finland, CountryCodes.France, CountryCodes.Germany, CountryCodes.Greece, CountryCodes.HongKong, CountryCodes.Hungary, CountryCodes.Ireland, CountryCodes.Italy, CountryCodes.Latvia, CountryCodes.Lithuania, CountryCodes.Luxembourg, CountryCodes.Netherlands, CountryCodes.Norway, CountryCodes.Poland, CountryCodes.Portugal, CountryCodes.Romania, CountryCodes.Slovakia, CountryCodes.Slovenia, CountryCodes.Spain, CountryCodes.Sweden];
18054
- const europeanRegion = [...eeaCountries, CountryCodes.Switzerland, CountryCodes.UnitedKingdom];
18055
- const allowedBankCountriesPerCountry = europeanRegion.reduce((allowed, country2) => {
18056
- allowed[country2] = [...europeanRegion];
18057
- return allowed;
18058
- }, {});
18059
- const getAllowedBankCountries = (country2) => allowedBankCountriesPerCountry[country2] ?? [country2];
18030
+ const regions = {
18031
+ europe: [...eeaCountries, CountryCodes.Switzerland, CountryCodes.UnitedKingdom],
18032
+ apac: [CountryCodes.NewZealand, CountryCodes.Australia]
18033
+ };
18034
+ const getAllowedBankCountries = (country2) => Object.values(regions).find((countriesInARegion) => countriesInARegion.includes(country2)) ?? [country2];
18060
18035
  const makePayoutVerificationMethodsMetadata = (svgPath, instantVerificationProvider) => ({
18061
18036
  instantVerification: {
18062
18037
  name: "verifyViaMobileBankAppOrBankWebsite",
@@ -18666,7 +18641,12 @@ const trustRegistrationDetailsValidations = {
18666
18641
  const trustRegistrationDetailsFields = ["legalName", "country", "trustType", "taxId", "registrationNumber"];
18667
18642
  const ALLOWED_TRUST_COUNTRIES = [CountryCodes.Australia, CountryCodes.NewZealand];
18668
18643
  function TrustRegistrationDetailsComponent(props) {
18669
- var _a, _b;
18644
+ var _a;
18645
+ console.log("TrustRegistrationDetailsComponent props", props);
18646
+ const {
18647
+ country: country2,
18648
+ onCountryChange
18649
+ } = props;
18670
18650
  const {
18671
18651
  i18n
18672
18652
  } = useI18nContext();
@@ -18687,14 +18667,17 @@ function TrustRegistrationDetailsComponent(props) {
18687
18667
  } = useForm({
18688
18668
  ...props,
18689
18669
  schema: directChildFields,
18690
- defaultData: props.data,
18670
+ defaultData: {
18671
+ ...props.data,
18672
+ country: country2
18673
+ },
18691
18674
  rules: props.validators || trustRegistrationDetailsValidations,
18692
18675
  fieldProblems: props == null ? void 0 : props.fieldValidationErrors
18693
18676
  });
18694
18677
  const formUtils = formUtilities(props, i18n);
18695
18678
  useEffect(() => {
18696
- var _a2, _b2;
18697
- (_b2 = (_a2 = stateRef.current) == null ? void 0 : _a2.setState) == null ? void 0 : _b2.call(_a2, {
18679
+ var _a2, _b;
18680
+ (_b = (_a2 = stateRef.current) == null ? void 0 : _a2.setState) == null ? void 0 : _b.call(_a2, {
18698
18681
  type: "addToState",
18699
18682
  value: {
18700
18683
  data,
@@ -18708,13 +18691,7 @@ function TrustRegistrationDetailsComponent(props) {
18708
18691
  });
18709
18692
  }, [data, valid, errors]);
18710
18693
  const taxIdProps = getFieldProps(props, taxIdFields);
18711
- useEffect(() => {
18712
- if (!data.country) {
18713
- setData("country", props.country);
18714
- triggerValidation(["country"]);
18715
- }
18716
- }, [(_a = props.data) == null ? void 0 : _a.country]);
18717
- const trustTypeOptions2 = getCountrySpecificTrustTypeOptions(props.country) ?? [];
18694
+ const trustTypeOptions2 = getCountrySpecificTrustTypeOptions(country2) ?? [];
18718
18695
  const registrationNumberProps = getFieldProps(props, businessRegistrationNumberFields);
18719
18696
  return jsxs(Fragment, {
18720
18697
  children: [jsx(StateContextSetter, {
@@ -18732,14 +18709,18 @@ function TrustRegistrationDetailsComponent(props) {
18732
18709
  }), jsx(ContextHelper, {
18733
18710
  content: i18n.get("makeSureToHaveYourTrustDeed")
18734
18711
  }), formUtils.isRequiredField(COUNTRY_FIELD) && jsx(CountryField, {
18735
- data: data.country,
18712
+ data: country2,
18736
18713
  valid: valid == null ? void 0 : valid.country,
18737
18714
  error: formUtils.getErrorMessage(COUNTRY_FIELD, errors, fieldProblems),
18738
18715
  label: formUtils.getLabel(COUNTRY_FIELD, "countryOfEstablishment"),
18739
18716
  readonly: formUtils.isReadOnly(COUNTRY_FIELD),
18740
18717
  allowedCountries: ALLOWED_TRUST_COUNTRIES,
18741
18718
  classNameModifiers: [COUNTRY_FIELD],
18742
- handleChangeFor
18719
+ handleChangeFor: () => (e) => {
18720
+ handleChangeFor("country", "input")(e);
18721
+ if (onCountryChange)
18722
+ onCountryChange(e);
18723
+ }
18743
18724
  }), formUtils.isRequiredField("legalName") && jsx(Field, {
18744
18725
  name: "legalName",
18745
18726
  label: formUtils.getLabel("legalName", "nameOfTrustAgreement"),
@@ -18781,12 +18762,12 @@ function TrustRegistrationDetailsComponent(props) {
18781
18762
  }), formUtils.isRequiredField("taxId") && jsx(TaxId, {
18782
18763
  ...taxIdProps,
18783
18764
  dataStoreId: TRUST_REGISTRATION_DETAILS,
18784
- country: props.country
18765
+ country: country2
18785
18766
  }), formUtils.isRequiredField("registrationNumber") && jsx(BusinessRegistrationNumber, {
18786
18767
  ...registrationNumberProps,
18787
18768
  dataStoreId: TRUST_REGISTRATION_DETAILS,
18788
- country: props.country,
18789
- trustType: (_b = props.data) == null ? void 0 : _b.trustType
18769
+ country: country2,
18770
+ trustType: (_a = props.data) == null ? void 0 : _a.trustType
18790
18771
  })]
18791
18772
  })]
18792
18773
  });
@@ -18831,7 +18812,8 @@ function TrustComponent(props) {
18831
18812
  ...trustRegistrationDetailsFormProps,
18832
18813
  heading: i18n.get("registrationDetails"),
18833
18814
  id: trustRegistrationDetailsFormId,
18834
- country: props.country
18815
+ country: props.country,
18816
+ onCountryChange: props.onCountryChange
18835
18817
  })
18836
18818
  }), jsx("div", {
18837
18819
  className: activeForm.formId !== trustRegistrationAddressFormId ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper",
@@ -19463,7 +19445,7 @@ function Summary({
19463
19445
  children: [jsx("h2", {
19464
19446
  className: "adyen-kyc-summary__heading",
19465
19447
  children: i18n.get("summary")
19466
- }), jsx(ReviewAlert, {}), jsx(ErrorPanel, {
19448
+ }), jsx(ErrorPanel, {
19467
19449
  validationErrors: allValidationErrors,
19468
19450
  verificationErrors: allVerificationErrors,
19469
19451
  formUtils,
@@ -19982,6 +19964,9 @@ const additionalIdentityInfo = {
19982
19964
  },
19983
19965
  licenseCardNumber: {
19984
19966
  rule: "requiredIfIdentityTypeIsDriversLicense"
19967
+ },
19968
+ expiryDate: {
19969
+ rule: "expiryDateRequired"
19985
19970
  }
19986
19971
  };
19987
19972
  const idDocument = {
@@ -21132,44 +21117,7 @@ function CompanyDropinComponent({
21132
21117
  })
21133
21118
  });
21134
21119
  }
21135
- const logger$9 = createLogger("useExemptSettlor");
21136
- const useExemptSettlor = ({
21137
- trust,
21138
- handleGetLegalEntity
21139
- }) => {
21140
- const [exemptSettlor, setExemptSettlor] = useState();
21141
- const updateExemptSettlor = useCallback(async (trustLE) => {
21142
- const exemptSettlorAssociation = getOwnEntityAssociations(trustLE).find((association) => association.type === TrustMemberTypes.SETTLOR && Boolean(association.settlorExemptionReason));
21143
- const exemptSettlorLE = (exemptSettlorAssociation == null ? void 0 : exemptSettlorAssociation.legalEntityId) ? await handleGetLegalEntity(exemptSettlorAssociation.legalEntityId) : void 0;
21144
- setExemptSettlor(exemptSettlorLE);
21145
- }, [handleGetLegalEntity]);
21146
- useEffect(() => {
21147
- updateExemptSettlor(trust).catch(logger$9.error);
21148
- }, [trust, updateExemptSettlor]);
21149
- return exemptSettlor;
21150
- };
21151
- function useSalesChannelsSettings() {
21152
- const {
21153
- isSettingEnabled
21154
- } = useSettingsContext();
21155
- return useMemo(() => {
21156
- const settings = [];
21157
- if (isSettingEnabled(SettingNames.RequirePciSignEcommerce)) {
21158
- settings.push("eCommerce");
21159
- }
21160
- if (isSettingEnabled(SettingNames.RequirePciSignPos)) {
21161
- settings.push("pos");
21162
- }
21163
- if (isSettingEnabled(SettingNames.RequirePciSignEcomMoto)) {
21164
- settings.push("ecomMoto");
21165
- }
21166
- if (isSettingEnabled(SettingNames.RequirePciSignPosMoto)) {
21167
- settings.push("posMoto");
21168
- }
21169
- return settings;
21170
- }, [isSettingEnabled]);
21171
- }
21172
- const logger$8 = createLogger("useLocalStorage");
21120
+ const logger$9 = createLogger("useLocalStorage");
21173
21121
  function useLocalStorage(key, defaultValue, options) {
21174
21122
  const {
21175
21123
  serializer,
@@ -21190,7 +21138,7 @@ function useLocalStorage(key, defaultValue, options) {
21190
21138
  const res = rawValueRef.current ? parser(rawValueRef.current) : defaultValue;
21191
21139
  return res;
21192
21140
  } catch (err) {
21193
- logger$8.error(err);
21141
+ logger$9.error(err);
21194
21142
  return defaultValue;
21195
21143
  }
21196
21144
  });
@@ -21222,7 +21170,7 @@ function useLocalStorage(key, defaultValue, options) {
21222
21170
  try {
21223
21171
  updateLocalStorage();
21224
21172
  } catch (err) {
21225
- logger$8.error(err);
21173
+ logger$9.error(err);
21226
21174
  }
21227
21175
  }, [value]);
21228
21176
  useEffect(() => {
@@ -21237,7 +21185,7 @@ function useLocalStorage(key, defaultValue, options) {
21237
21185
  setValue(event.newValue ? parser(event.newValue) : void 0);
21238
21186
  }
21239
21187
  } catch (err) {
21240
- logger$8.error(err);
21188
+ logger$9.error(err);
21241
21189
  }
21242
21190
  };
21243
21191
  if (typeof window === "undefined")
@@ -21247,6 +21195,15 @@ function useLocalStorage(key, defaultValue, options) {
21247
21195
  }, [key, syncData]);
21248
21196
  return [value, setValue];
21249
21197
  }
21198
+ const isIntroForLE = (legalEntity) => Boolean(legalEntity.type) && (legalEntity.type === LegalEntityType.INDIVIDUAL || legalEntity.type === LegalEntityType.ORGANIZATION) && !(hasOwnEntityAssociationOfType(LegalEntityType.SOLE_PROPRIETORSHIP, legalEntity.entityAssociations, legalEntity.id) || hasOwnEntityAssociationOfType(LegalEntityType.TRUST, legalEntity.entityAssociations, legalEntity.id));
21199
+ const useCanSeeIntro = (legalEntity) => {
21200
+ const {
21201
+ isSettingEnabled
21202
+ } = useSettingsContext();
21203
+ return {
21204
+ canSeeIntro: isSettingEnabled("viewOnboardingGuidance") && isIntroForLE(legalEntity)
21205
+ };
21206
+ };
21250
21207
  const getHasSeenIntroStorageKey = (legalEntityId) => `COMPLETED_INTRO-${legalEntityId}`;
21251
21208
  const useHasSeenIntro = (legalEntityId) => {
21252
21209
  const [hasSeenIntro, setHasSeenIntro] = useLocalStorage(getHasSeenIntroStorageKey(legalEntityId), false);
@@ -21255,16 +21212,52 @@ const useHasSeenIntro = (legalEntityId) => {
21255
21212
  setHasSeenIntro
21256
21213
  };
21257
21214
  };
21258
- const guidanceAvailableForGivenLE = (legalEntity) => Boolean(legalEntity.type) && (legalEntity.type === LegalEntityType.INDIVIDUAL || legalEntity.type === LegalEntityType.ORGANIZATION) && !(hasOwnEntityAssociationOfType(LegalEntityType.SOLE_PROPRIETORSHIP, legalEntity.entityAssociations, legalEntity.id) || hasOwnEntityAssociationOfType(LegalEntityType.TRUST, legalEntity.entityAssociations, legalEntity.id));
21259
- const useShouldShowGuidanceIntros = (legalEntity) => {
21215
+ const useShouldShowIntro = (legalEntity) => {
21260
21216
  const {
21261
- isSettingEnabled
21262
- } = useSettingsContext();
21217
+ canSeeIntro
21218
+ } = useCanSeeIntro(legalEntity);
21263
21219
  const {
21264
21220
  hasSeenIntro
21265
21221
  } = useHasSeenIntro(legalEntity.id);
21266
- return isSettingEnabled("viewOnboardingGuidance") && guidanceAvailableForGivenLE(legalEntity) && !hasSeenIntro;
21222
+ return canSeeIntro && !hasSeenIntro;
21223
+ };
21224
+ const logger$8 = createLogger("useExemptSettlor");
21225
+ const useExemptSettlor = ({
21226
+ trust,
21227
+ handleGetLegalEntity
21228
+ }) => {
21229
+ const [exemptSettlor, setExemptSettlor] = useState();
21230
+ const updateExemptSettlor = useCallback(async (trustLE) => {
21231
+ const exemptSettlorAssociation = getOwnEntityAssociations(trustLE).find((association) => association.type === TrustMemberTypes.SETTLOR && Boolean(association.settlorExemptionReason));
21232
+ const exemptSettlorLE = (exemptSettlorAssociation == null ? void 0 : exemptSettlorAssociation.legalEntityId) ? await handleGetLegalEntity(exemptSettlorAssociation.legalEntityId) : void 0;
21233
+ setExemptSettlor(exemptSettlorLE);
21234
+ }, [handleGetLegalEntity]);
21235
+ useEffect(() => {
21236
+ updateExemptSettlor(trust).catch(logger$8.error);
21237
+ }, [trust, updateExemptSettlor]);
21238
+ return exemptSettlor;
21267
21239
  };
21240
+ function useSalesChannelsSettings() {
21241
+ const {
21242
+ isSettingEnabled
21243
+ } = useSettingsContext();
21244
+ return useMemo(() => {
21245
+ const settings = [];
21246
+ if (isSettingEnabled(SettingNames.RequirePciSignEcommerce)) {
21247
+ settings.push("eCommerce");
21248
+ }
21249
+ if (isSettingEnabled(SettingNames.RequirePciSignPos)) {
21250
+ settings.push("pos");
21251
+ }
21252
+ if (isSettingEnabled(SettingNames.RequirePciSignEcomMoto)) {
21253
+ settings.push("ecomMoto");
21254
+ }
21255
+ if (isSettingEnabled(SettingNames.RequirePciSignPosMoto)) {
21256
+ settings.push("posMoto");
21257
+ }
21258
+ return settings;
21259
+ }, [isSettingEnabled]);
21260
+ }
21268
21261
  const downloadFile = async (base64, filename) => {
21269
21262
  saveBlobAsFile(base64ToBlob(base64), filename);
21270
21263
  };
@@ -21601,15 +21594,12 @@ const TaskItemStatus = ({
21601
21594
  status,
21602
21595
  downloadHandler
21603
21596
  }) => {
21604
- const {
21605
- isReview
21606
- } = useCoreContext();
21607
21597
  const {
21608
21598
  i18n
21609
21599
  } = useI18nContext();
21610
21600
  const handleDownloadClick = (e) => {
21611
21601
  e.stopPropagation();
21612
- downloadHandler();
21602
+ downloadHandler == null ? void 0 : downloadHandler();
21613
21603
  };
21614
21604
  switch (status) {
21615
21605
  case TaskStatus.DOWNLOAD:
@@ -21666,12 +21656,17 @@ const TaskItemStatus = ({
21666
21656
  icon: "loading",
21667
21657
  text: i18n.get("removing")
21668
21658
  });
21659
+ case "review":
21660
+ return jsx("span", {
21661
+ className: "adl-task-status-details-required",
21662
+ children: i18n.get("verify")
21663
+ });
21669
21664
  case TaskStatus.DETAILS_REQUIRED:
21670
21665
  case TaskStatus.EMPTY:
21671
21666
  default:
21672
21667
  return jsx("span", {
21673
21668
  className: "adl-task-status-details-required",
21674
- children: isReview ? i18n.get("verify") : i18n.get("add")
21669
+ children: i18n.get("add")
21675
21670
  });
21676
21671
  }
21677
21672
  };
@@ -22210,7 +22205,7 @@ const DecisionMakersComponent = ({
22210
22205
  entityLabel: roleType,
22211
22206
  status: iconStatus(uniqueDecisionMakersPerType(roleType), min, max)
22212
22207
  }, roleType))
22213
- }), jsx(ReviewAlert, {}), jsx(ContextGuidance, {
22208
+ }), jsx(ContextGuidance, {
22214
22209
  page: "Decision makers",
22215
22210
  title: i18n.get("whatIsTheDifferenceBetweenTheseRoles"),
22216
22211
  content: jsx("ul", {
@@ -22731,9 +22726,8 @@ function TaskListComponent({
22731
22726
  isExperimentEnabled
22732
22727
  } = useExperimentsContext();
22733
22728
  const {
22734
- isSettingEnabled
22735
- } = useSettingsContext();
22736
- const isGuidanceEnabled = isSettingEnabled("viewOnboardingGuidance");
22729
+ canSeeIntro
22730
+ } = useCanSeeIntro(legalEntityResponse);
22737
22731
  const hasTaskOfGroupAccountDetails = tasks.some((task) => LEGAL_ENTITY_BASE_TASKS.includes(task));
22738
22732
  const hasTrust = isExperimentEnabled("EnableTrustFlow") && (accountHolder2 === "aTrust" || isPartOfTrustFromLegalEntity(legalEntityResponse));
22739
22733
  const hasContractTasks = tasks.some((task) => CONTRACT_TASKS.includes(task));
@@ -22765,7 +22759,7 @@ function TaskListComponent({
22765
22759
  const companyTaskDescriptionKey = isReview ? "businessAccountDetailsDescriptionReview" : "businessAccountDetailsDescription";
22766
22760
  const payoutTaskDescriptionKey = isReview ? "payoutAccountsDescriptionReview" : "payoutAccountsDescription";
22767
22761
  return jsxs("div", {
22768
- children: [isGuidanceEnabled && guidanceAvailableForGivenLE(legalEntityResponse) && jsx("div", {
22762
+ children: [canSeeIntro && jsx("div", {
22769
22763
  className: "adyen-task-list__nav",
22770
22764
  children: jsx(Button, {
22771
22765
  label: i18n.get("goToIntro"),
@@ -22776,7 +22770,7 @@ function TaskListComponent({
22776
22770
  }), jsxs("div", {
22777
22771
  children: [hasTaskOfGroupAccountDetails && jsxs(TaskListGroup, {
22778
22772
  title: isCompany ? i18n.get(companyTaskDescriptionKey) : i18n.get("accountDetailsDescription"),
22779
- children: [jsx(ReviewAlert, {}), tasks.includes(TaskTypes.INDIVIDUAL) && jsx(TaskListItem, {
22773
+ children: [tasks.includes(TaskTypes.INDIVIDUAL) && jsx(TaskListItem, {
22780
22774
  onNavigateToTask: handleOnNavigateToTaskIndividual,
22781
22775
  icon: "decision-maker",
22782
22776
  title: hasTrust ? i18n.get("trusteePersonalDetails") : i18n.get("personalDetails"),
@@ -23098,7 +23092,7 @@ const TrustMembersOverview = ({
23098
23092
  entityLabel: label,
23099
23093
  status: iconStatus(trustMembersWithOneOfGivenRoles(roleTypes).length, min, max)
23100
23094
  }, label))
23101
- }), jsx(ReviewAlert, {}), jsx(ContextGuidance, {
23095
+ }), jsx(ContextGuidance, {
23102
23096
  page: "Trust members",
23103
23097
  title: i18n.get("whatIsTheDifferenceBetweenTheseRoles"),
23104
23098
  content: jsx("ul", {
@@ -23171,6 +23165,18 @@ const TrustMembersOverview = ({
23171
23165
  })
23172
23166
  });
23173
23167
  };
23168
+ const doesValueSeemToBeMasked = (value) => typeof value === "string" && value.includes("**");
23169
+ const omitMaskedFieldsIfUnchanged = (maskedFields, dataSubmitted, savedData) => {
23170
+ const filtered = cloneObject(dataSubmitted);
23171
+ maskedFields.forEach((maskedField) => {
23172
+ const prevValue = getProp(savedData, maskedField);
23173
+ const newValue = getProp(dataSubmitted, maskedField);
23174
+ if (prevValue === newValue && doesValueSeemToBeMasked(newValue)) {
23175
+ deleteProp(maskedField, filtered);
23176
+ }
23177
+ });
23178
+ return filtered;
23179
+ };
23174
23180
  const _toast = "";
23175
23181
  function Toast({
23176
23182
  label,
@@ -23466,13 +23472,6 @@ function IndividualDropinComponent({
23466
23472
  }) => type);
23467
23473
  return !doArraysMatch(existingRoles, newRoles);
23468
23474
  };
23469
- const omitMaskedFieldsIfUnchanged = (maskedFields, dataSubmitted, savedData) => {
23470
- maskedFields.forEach((maskedField) => {
23471
- if (getProp(dataSubmitted, maskedField) === getProp(savedData, maskedField)) {
23472
- assignToProp(maskedField, dataSubmitted, void 0);
23473
- }
23474
- });
23475
- };
23476
23475
  const attachAssociationToParentLegalEntity = async ({
23477
23476
  legalEntity,
23478
23477
  dataSubmitted
@@ -23497,10 +23496,9 @@ function IndividualDropinComponent({
23497
23496
  const onSubmit = async () => {
23498
23497
  var _a2, _b2;
23499
23498
  setLoadingStatus("loading");
23500
- const dataSubmitted = data;
23499
+ const dataSubmitted = omitMaskedFieldsIfUnchanged(individualMaskedFields, data, dataFromResponse);
23501
23500
  try {
23502
- omitMaskedFieldsIfUnchanged(individualMaskedFields, dataSubmitted, dataFromResponse);
23503
- let legalEntity = mapIndividualToLegalEntity(dataSubmitted);
23501
+ const legalEntity = mapIndividualToLegalEntity(dataSubmitted);
23504
23502
  const idDocumentType = (_a2 = idDocumentTypeOptions.find(({
23505
23503
  id: id2
23506
23504
  }) => {
@@ -23515,18 +23513,18 @@ function IndividualDropinComponent({
23515
23513
  }
23516
23514
  });
23517
23515
  legalEntity.entityAssociations = filterOutUnwantedAssociationsIfRootLE(taskType, legalEntityResponse, dataSubmitted.personalDetails.accountHolder);
23518
- legalEntity = await submitLegalEntity({
23516
+ const createdLegalEntity = await submitLegalEntity({
23519
23517
  dataSubmitted,
23520
23518
  legalEntity,
23521
23519
  idDocumentType
23522
23520
  });
23523
23521
  await submitDocuments({
23524
23522
  forms,
23525
- legalEntity,
23523
+ legalEntity: createdLegalEntity,
23526
23524
  dataSubmitted
23527
23525
  });
23528
23526
  await attachAssociationToParentLegalEntity({
23529
- legalEntity,
23527
+ legalEntity: createdLegalEntity,
23530
23528
  dataSubmitted
23531
23529
  });
23532
23530
  if (taskType === TaskTypes.INDIVIDUAL) {
@@ -23868,6 +23866,7 @@ function PayoutDetailsDropinComponent({
23868
23866
  const [bankAccountCountry2, setBankAccountCountry] = useState(defaultPayoutCountry);
23869
23867
  const existingPayoutDetails = transferInstrument ? mapTransferInstrumentToPayoutAccount(transferInstrument) : void 0;
23870
23868
  const [documents2, setDocuments] = useState();
23869
+ const [newTransferInstrumentId, setNewTransferInstrumentId] = useState();
23871
23870
  const fallbackCurrency = (_a = currencyByCountry[defaultPayoutCountry]) == null ? void 0 : _a[0];
23872
23871
  const accountHolderName = accountHolder2 || getLegalEntityNameBasedOnType(legalEntityResponse);
23873
23872
  const instantVerificationEnabled = Boolean(!transferInstrument && handleGetBankVerificationVendors);
@@ -24022,17 +24021,10 @@ function PayoutDetailsDropinComponent({
24022
24021
  }
24023
24022
  }
24024
24023
  };
24025
- const omitMaskedFieldsIfUnchanged = (maskedFields, dataSubmitted, savedData) => {
24026
- maskedFields.forEach((maskedField) => {
24027
- if (dataSubmitted[maskedField] === (savedData == null ? void 0 : savedData[maskedField])) {
24028
- delete dataSubmitted[maskedField];
24029
- }
24030
- });
24031
- };
24032
24024
  const onSubmit = async () => {
24033
24025
  var _a2;
24034
24026
  setLoadingStatus("loading");
24035
- const dataSubmitted = data;
24027
+ const dataSubmitted = cloneObject(data);
24036
24028
  dataSubmitted.payoutAccountDetails.currency = dataSubmitted.payoutAccountDetails.currency ?? fallbackCurrency;
24037
24029
  if (defaultPayoutCountry === CountryCodes.Sweden && "iban" in dataSubmitted.payoutAccountDetails) {
24038
24030
  dataSubmitted.payoutAccountDetails.currency = Currency.EUR;
@@ -24046,15 +24038,16 @@ function PayoutDetailsDropinComponent({
24046
24038
  }
24047
24039
  };
24048
24040
  userEvents.addEvent("Provided payout details", event);
24049
- omitMaskedFieldsIfUnchanged(maskedPayoutFields, dataSubmitted.payoutAccountDetails, existingPayoutDetails == null ? void 0 : existingPayoutDetails.payoutAccountDetails);
24041
+ dataSubmitted.payoutAccountDetails = omitMaskedFieldsIfUnchanged(maskedPayoutFields, dataSubmitted.payoutAccountDetails, existingPayoutDetails == null ? void 0 : existingPayoutDetails.payoutAccountDetails);
24050
24042
  let transferInstrument2 = mapPayoutAccountToTransferInstrument({
24051
24043
  data: dataSubmitted,
24052
24044
  legalEntity: legalEntityResponse
24053
24045
  });
24054
- const transferInstrumentId = (_a2 = existingPayoutDetails == null ? void 0 : existingPayoutDetails.payoutAccountDetails) == null ? void 0 : _a2.transferInstrumentId;
24046
+ const transferInstrumentId = ((_a2 = existingPayoutDetails == null ? void 0 : existingPayoutDetails.payoutAccountDetails) == null ? void 0 : _a2.transferInstrumentId) ?? newTransferInstrumentId;
24055
24047
  try {
24056
24048
  if (!transferInstrumentId) {
24057
24049
  transferInstrument2 = await handleCreateTransferInstrument(transferInstrument2);
24050
+ setNewTransferInstrumentId(transferInstrument2.id);
24058
24051
  } else {
24059
24052
  transferInstrument2 = await handleUpdateTransferInstrument(drop("id").from(transferInstrument2), transferInstrumentId);
24060
24053
  }
@@ -25757,8 +25750,7 @@ function withFormComposer(WrappedComponent, {
25757
25750
  } = useI18nContext();
25758
25751
  const {
25759
25752
  contextCountry: initialContextCountry,
25760
- setContextCountry: setInitialContextCountry,
25761
- isReview
25753
+ setContextCountry: setInitialContextCountry
25762
25754
  } = useCoreContext();
25763
25755
  const {
25764
25756
  loadingContext
@@ -25981,7 +25973,7 @@ function withFormComposer(WrappedComponent, {
25981
25973
  }
25982
25974
  });
25983
25975
  };
25984
- const nextButtonText = isReview ? isFormSummaryStep(activeForm) ? i18n.get("confirm") : i18n.get("next") : isFinalStep ? i18n.get(submitButtonLabel ?? "submit") : i18n.get("next");
25976
+ const nextButtonText = isFinalStep ? i18n.get(submitButtonLabel ?? "submit") : i18n.get("next");
25985
25977
  useEffect(() => {
25986
25978
  props.eventEmitter.on("next", handleNextClick);
25987
25979
  props.eventEmitter.on("back", handleBackClick);
@@ -26572,7 +26564,7 @@ function DropinComposerComponent({
26572
26564
  onNavigate = noop,
26573
26565
  ...args
26574
26566
  }) {
26575
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
26567
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
26576
26568
  const {
26577
26569
  contextCountry,
26578
26570
  accountHolder: accountHolder2
@@ -26592,7 +26584,7 @@ function DropinComposerComponent({
26592
26584
  } = useToastContext();
26593
26585
  const [isLoadingConfiguration, setIsLoadingConfiguration] = useState(false);
26594
26586
  const [pollingId, setPollingId] = useState(null);
26595
- const showIntro = useShouldShowGuidanceIntros(legalEntityResponse);
26587
+ const showIntro = useShouldShowIntro(legalEntityResponse);
26596
26588
  const {
26597
26589
  setHasSeenIntro
26598
26590
  } = useHasSeenIntro(legalEntityResponse.id);
@@ -27333,7 +27325,7 @@ function DropinComposerComponent({
27333
27325
  onSubmit: componentOnSubmit,
27334
27326
  handleHomeClick: navigateBack,
27335
27327
  homeButtonLabel: i18n.get("saveAndGoToOverview"),
27336
- country: ((_h = trust == null ? void 0 : trust.trust) == null ? void 0 : _h.registeredAddress.country) ?? rootLegalEntityCountry,
27328
+ country: (((_h = trust == null ? void 0 : trust.trust) == null ? void 0 : _h.countryOfGoverningLaw) || ((_i = trust == null ? void 0 : trust.trust) == null ? void 0 : _i.registeredAddress.country)) ?? rootLegalEntityCountry,
27337
27329
  handleAddressSearch: args == null ? void 0 : args.handleAddressSearch,
27338
27330
  handleFindAddress: args == null ? void 0 : args.handleFindAddress
27339
27331
  });
@@ -27378,13 +27370,13 @@ function DropinComposerComponent({
27378
27370
  parentLegalEntity: legalEntity,
27379
27371
  legalEntityResponse: solePropietor,
27380
27372
  capabilities: Object.keys((legalEntityResponse == null ? void 0 : legalEntityResponse.capabilities) ?? {}),
27381
- problems: (_i = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _i[solePropietor == null ? void 0 : solePropietor.id],
27373
+ problems: (_j = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _j[solePropietor == null ? void 0 : solePropietor.id],
27382
27374
  onChange: componentOnChange,
27383
27375
  eventEmitter,
27384
27376
  onSubmit: componentOnSubmit,
27385
27377
  handleHomeClick: navigateBack,
27386
27378
  homeButtonLabel: i18n.get("saveAndGoToOverview"),
27387
- country: (_k = (_j = legalEntity == null ? void 0 : legalEntity.individual) == null ? void 0 : _j.residentialAddress) == null ? void 0 : _k.country,
27379
+ country: (_l = (_k = legalEntity == null ? void 0 : legalEntity.individual) == null ? void 0 : _k.residentialAddress) == null ? void 0 : _l.country,
27388
27380
  handleAddressSearch: args == null ? void 0 : args.handleAddressSearch,
27389
27381
  handleFindAddress: args == null ? void 0 : args.handleFindAddress
27390
27382
  });
@@ -27581,7 +27573,8 @@ const getTransferInstrument = async (context, transferInstrumentId) => {
27581
27573
  path: `${legalEntityId}/transferInstruments/${transferInstrumentId}`,
27582
27574
  headers: {
27583
27575
  Authorization: `Bearer ${sdkToken}`,
27584
- Origin: window.location.origin
27576
+ Origin: window.location.origin,
27577
+ "Content-Type": "application/json"
27585
27578
  }
27586
27579
  });
27587
27580
  };
@@ -27769,7 +27762,8 @@ function TransferInstrumentComponent({
27769
27762
  onChange,
27770
27763
  onSubmit,
27771
27764
  createTrustedTransferInstrument: createTrustedTransferInstrument2,
27772
- handleBankVerificationError: handleBankVerificationError2
27765
+ handleBankVerificationError: handleBankVerificationError2,
27766
+ taskType: TaskTypes.PAYOUT
27773
27767
  }) : null;
27774
27768
  }
27775
27769
  const componentsMap = {
@@ -28231,8 +28225,7 @@ const ConfigurationApiProvider = ({
28231
28225
  const logger$2 = createLogger("CoreProvider");
28232
28226
  const CoreProvider = ({
28233
28227
  contextCountry: initialContextCountry,
28234
- children,
28235
- isReview
28228
+ children
28236
28229
  }) => {
28237
28230
  const {
28238
28231
  loadingContext
@@ -28260,14 +28253,13 @@ const CoreProvider = ({
28260
28253
  checkIfCountryIsAllowed().catch(logger$2.warn);
28261
28254
  }, [contextCountry, getAllowedCountries2]);
28262
28255
  const contextValue = useMemo(() => ({
28263
- isReview,
28264
28256
  setContextCountry,
28265
28257
  contextCountry,
28266
28258
  setAccountHolder,
28267
28259
  accountHolder: accountHolder2,
28268
28260
  setAccountFormat,
28269
28261
  accountFormat
28270
- }), [isReview, contextCountry, accountHolder2, accountFormat]);
28262
+ }), [contextCountry, accountHolder2, accountFormat]);
28271
28263
  return jsx(CoreContext.Provider, {
28272
28264
  value: contextValue,
28273
28265
  children
@@ -28510,7 +28502,6 @@ class UIElement extends BaseElement {
28510
28502
  rootLegalEntityId: getRootLegalEntityId(this.props.componentProps),
28511
28503
  children: jsx(CoreProvider, {
28512
28504
  contextCountry: this.props.contextCountry,
28513
- isReview: this.props.isReview,
28514
28505
  children: jsx(I18nProvider, {
28515
28506
  locale: this.props.locale,
28516
28507
  customTranslations: this.props.customTranslations,