@adyen/kyc-components 2.11.0 → 2.13.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 (65) hide show
  1. package/README.md +9 -9
  2. package/dist/es/adyen-kyc-components.es.js +577 -532
  3. package/dist/style.css +774 -772
  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/TaskIntros/TaskIntro.d.ts +2 -2
  24. package/dist/types/components/TaskIntros/types.d.ts +1 -1
  25. package/dist/types/components/TaskList/component/TaskItemStatus.d.ts +2 -1
  26. package/dist/types/components/TaskList/types.d.ts +1 -1
  27. package/dist/types/components/TrustRegistrationDetails/types.d.ts +2 -0
  28. package/dist/types/components/internal/Address/utils.d.ts +1 -1
  29. package/dist/types/core/Context/CoreContext.d.ts +0 -1
  30. package/dist/types/core/Context/CoreProvider.d.ts +1 -2
  31. package/dist/types/core/Services/componentApi/create-document.d.ts +2 -2
  32. package/dist/types/core/Services/componentApi/get-document.d.ts +2 -2
  33. package/dist/types/core/Services/componentApi/update-document.d.ts +2 -2
  34. package/dist/types/core/Services/utils.d.ts +8 -1
  35. package/dist/types/core/hooks/taskIntros.d.ts +10 -0
  36. package/dist/types/core/hooks/useIdVerificationToken.d.ts +2 -1
  37. package/dist/types/core/models/api/document.d.ts +7 -1
  38. package/dist/types/core/models/api/instant-id-verification.d.ts +1 -0
  39. package/dist/types/core/models/api/legal-arrangement.d.ts +3 -1
  40. package/dist/types/core/models/api/trust-types-value.d.ts +1 -1
  41. package/dist/types/core/models/currency.d.ts +1 -0
  42. package/dist/types/core/models/errors/validation-error.d.ts +1 -0
  43. package/dist/types/core/models/identity.d.ts +4 -1
  44. package/dist/types/language/config.d.ts +15 -13
  45. package/dist/types/utils/api/documentUtils.d.ts +14 -14
  46. package/dist/types/utils/decision-maker-roles.d.ts +1 -1
  47. package/dist/types/utils/entity-status-util.d.ts +2 -2
  48. package/dist/types/utils/formatting/stripNonAlphanumeric.d.ts +1 -0
  49. package/dist/types/utils/isValueMasked.d.ts +1 -0
  50. package/dist/types/utils/mapping/componentApiMapping.d.ts +2 -1
  51. package/dist/types/utils/mapping/utils.d.ts +1 -0
  52. package/dist/types/utils/omitMaskedFieldsIfUnchanged.d.ts +2 -0
  53. package/dist/types/utils/trust-util.d.ts +1 -1
  54. package/package.json +16 -15
  55. package/dist/mockServiceWorker.js +0 -302
  56. package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityAu/additionalIdentityInfoSchema.d.ts +0 -8
  57. package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityAu/component/TypeOfIdentity.d.ts +0 -12
  58. package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityAu/types.d.ts +0 -10
  59. package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityHK/component/TypeOfIdentity.d.ts +0 -12
  60. package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityHK/types.d.ts +0 -10
  61. package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityNZ/additionalIdentityInfoSchema.d.ts +0 -7
  62. package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityNZ/component/TypeOfIdentity.d.ts +0 -12
  63. package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityNZ/types.d.ts +0 -10
  64. package/dist/types/components/internal/Alert/components/ReviewAlert.d.ts +0 -2
  65. 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";
@@ -148,7 +149,8 @@ const entityType = "Entity type";
148
149
  const registrationDetails = "Registration details";
149
150
  const registeredAddress = "Registered address";
150
151
  const registrationAddress = "Registration address";
151
- const registeredAddressHeaderDescription = "The address registered to your company with the Chamber of Commerce.";
152
+ const registeredAddressHeaderDescription = "The address as it appears on your company's official registration documents.";
153
+ const registeredAddressHeaderDescription__NL = "The address registered to your company with the Chamber of Commerce.";
152
154
  const registeredAddressHeaderDescription__US = "Your address as it appears on your Secretary of State Registration.";
153
155
  const registeredAddressTrustHeaderDescription = "The address registered to your trust";
154
156
  const operationalAddress = "Operational address";
@@ -223,9 +225,10 @@ const byClickingSubmitReview = "By clicking 'Submit review', you confirm that al
223
225
  const nameAndCountry = "Name and country";
224
226
  const companyCountry = "Where is your business located?";
225
227
  const legalCompanyName = "Legal name of the company";
226
- const legalCompanyNameHelper = "Enter the name exactly as it is on your Chamber of Commerce registration";
228
+ const legalCompanyNameHelper = "Enter the name exactly as it is on your company's official registration documents.";
227
229
  const legalCompanyNameHelper__AU = "Enter the name exactly as it is on your Australian Securities and Investment Commission's (ASIC)";
228
- const legalCompanyNameHelper__US = "Enter the name exactly as it appears on your Secretary of State Registration.";
230
+ const legalCompanyNameHelper__NL = "Enter the name exactly as it is on your Chamber of Commerce registration.";
231
+ const legalCompanyNameHelper__US = "Enter the name exactly as it is on on your Secretary of State registration.";
229
232
  const legalCompanyNameHelper__SG = "Enter the name exactly as it is on your Accounting and Corporate Regulatory Authority (ACRA) BizFile";
230
233
  const legalCompanyNameHelper__HK = "Enter the name exactly as it is on your Hong Kong Companies Registry's Certificate of Incorporation";
231
234
  const accountDetailsDescription = "Provide a few details about you to start accepting live payments.";
@@ -504,6 +507,9 @@ const unlistedPublicUnitTrust = "Unlisted public unit trust";
504
507
  const countryOfEstablishment = "Country of establishment";
505
508
  const nameOfTrustAgreement = "Name of trust agreement";
506
509
  const typeOfTrustAgreement = "Type of trust agreement";
510
+ const objectOfCharitableTrust = "Object of charitable trust";
511
+ const objectOfTrust = "Object of trust";
512
+ const pleaseProvideThePurposeOfCharitableTrust = "Please provide the purpose of your charitable trust";
507
513
  const weFoundTheFollowingIssues = "We found the following issues:";
508
514
  const reviewTheInformationBelowAndCorrectMistakesOr = "Review the information below and correct any mistakes, or";
509
515
  const uploadTheRequestedDocuments = "upload the requested documents";
@@ -511,7 +517,7 @@ const uploadTheFollowingDocuments = "upload the following documents:";
511
517
  const uploadDocumentAndDocument = "%{uploadDocumentOne} and %{documentTwo}";
512
518
  const thenResubmit = "then resubmit.";
513
519
  const isTrustOperationAddressSame = "Is there a different address for your trust's operations?";
514
- const trustDetails = "Trust Details";
520
+ const trustDetails = "Trust details";
515
521
  const trustDetailsDescription = "To prepare your account, we need information about your trust.";
516
522
  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
523
  const nameOfTrust = "Name of trust";
@@ -1038,35 +1044,31 @@ const firstNameOfSettlor = "First name of settlor";
1038
1044
  const lastNameOfSettlor = "Last name of settlor";
1039
1045
  const enterSettlorsFirstNameExactlyAsItAppearsInID = "Enter the settlor's first name(s) exactly as it appears on their identity document";
1040
1046
  const enterSettlorsLastNameExactlyAsItAppearsInID = "Enter the settlor's last name(s) exactly as it appears on their identity document";
1041
- const taskIntroPrologueTitle = "Before you start";
1042
- const taskIntroPrologueDescriptionP1 = "The more prepared you are with the requirements, the quicker you'll be able to set up your account!";
1043
- const taskIntroPrologueDescriptionP2 = "Here are the things we need to know from you.";
1047
+ const taskIntroPrologueTitle = "Before you begin...";
1048
+ const taskIntroPrologueDescriptionP1 = "We'll ask for some details about your business as part of financial regulations.";
1049
+ const taskIntroPrologueDescriptionP2 = "Our advice? Have these details on hand so you can get verified quickly.";
1044
1050
  const taskIntroCompanyTitle = "Company details";
1045
- const taskIntroCompanyDescriptionP1 = "Make sure to have acces to your most recent company registration information, as we'll ask for your company details.";
1046
- const taskIntroCompanyDescriptionP2 = "You can find this on your company registration document.";
1047
- const taskIntroDecisionMakerOverviewTitle = "Proof of identity";
1048
- const taskIntroDecisionMakerOverviewDescriptionP1 = "We'll need to check the identity of the main decision makers of your company.";
1049
- const taskIntroDecisionMakerOverviewDescriptionP2 = "Make sure to have a copy of their IDs in color and their residential address.";
1050
- const taskIntroDecisionMakerOverviewDescriptionP3 = "For the ID you can choose:";
1051
- const taskIntroDecisionMakerOverviewDescriptionLI1 = "Driver's license";
1052
- const taskIntroDecisionMakerOverviewDescriptionLI2 = "Passport";
1053
- const taskIntroDecisionMakerOverviewDescriptionLI3 = "ID document";
1054
- const taskIntroIndividualTitle = "Proof of identity";
1055
- const taskIntroIndividualDescriptionP1 = "We'll need to check your identity and personal details.";
1056
- const taskIntroIndividualDescriptionP2 = "You'll be asked to provide your residential address and, if necessary, a copy of our ID in color.";
1057
- const taskIntroIndividualDescriptionP3 = "For the ID you can choose:";
1051
+ const taskIntroCompanyDescriptionP1 = "For example, your company name and registration number.";
1052
+ const taskIntroCompanyDescriptionP2 = "Where to find this information";
1053
+ const taskIntroCompanyDescriptionLI1 = "Your company registration document";
1054
+ const taskIntroDecisionMakerTitle = "Decision-makers";
1055
+ const taskIntroDecisionMakerDescriptionP1 = "For example, the name and address of important people in your company.";
1056
+ const taskIntroDecisionMakerDescriptionP2 = "Where to find this information";
1057
+ const taskIntroDecisionMakerDescriptionLI1 = "Driver's license";
1058
+ const taskIntroDecisionMakerDescriptionLI2 = "Passport";
1059
+ const taskIntroDecisionMakerDescriptionLI3 = "ID document";
1060
+ const taskIntroIndividualTitle = "Personal details";
1061
+ const taskIntroIndividualDescriptionP1 = "For example, your name and residential address.";
1062
+ const taskIntroIndividualDescriptionP2 = "Where to find this information";
1058
1063
  const taskIntroIndividualDescriptionLI1 = "Driver's license";
1059
1064
  const taskIntroIndividualDescriptionLI2 = "Passport";
1060
1065
  const taskIntroIndividualDescriptionLI3 = "ID document";
1061
- const taskIntroPayoutTitle = "Payout account details";
1062
- const taskIntroPayoutOrganizationDescriptionP1 = "We'll have to verify the details of the bank account where we'll be sending the funds.";
1063
- const taskIntroPayoutOrganizationDescriptionP2 = "This account should be in the name of the company.";
1064
- const taskIntroPayoutIndividualDescriptionP1 = "We'll have to verify the details of the bank account where we'll be sending the funds.";
1065
- const taskIntroPayoutIndividualDescriptionP2 = "This account should be in your name.";
1066
+ const taskIntroPayoutTitle = "Bank account details";
1067
+ const taskIntroPayoutDescriptionP1 = "For example, the account holder name and account number.";
1068
+ const taskIntroPayoutDescriptionP2 = "This is the bank account you use to send or receive funds.";
1066
1069
  const taskIntroEpilogueTitle = "Why do we need this information?";
1067
- const taskIntroEpilogueDescriptionP1 = "We have to make sure the businesses using our services won't misuse the funds or cause harm.";
1068
- const taskIntroEpilogueDescriptionP2 = "We'll check all of this information against official records. This is a part of the financial regulations that we have to follow as a payments provider.";
1069
- const taskIntroEpilogueDescriptionP3 = "We'll use your information exclusively for these purposes.";
1070
+ const taskIntroEpilogueDescriptionP1 = "We check all this information against official records to verify your identity and comply with financial regulations.";
1071
+ const taskIntroEpilogueDescriptionP2 = "Your information will be used only for these purposes.";
1070
1072
  const defaultTrans = {
1071
1073
  close,
1072
1074
  individual,
@@ -1174,6 +1176,7 @@ const defaultTrans = {
1174
1176
  fileName,
1175
1177
  nationality: nationality$1,
1176
1178
  dateOfIncorporation,
1179
+ passportExpiryDate,
1177
1180
  proofOfNationality,
1178
1181
  uploadDocumentForSsn,
1179
1182
  uploadDocumentForNric,
@@ -1204,6 +1207,7 @@ const defaultTrans = {
1204
1207
  registeredAddress,
1205
1208
  registrationAddress,
1206
1209
  registeredAddressHeaderDescription,
1210
+ registeredAddressHeaderDescription__NL,
1207
1211
  registeredAddressHeaderDescription__US,
1208
1212
  registeredAddressTrustHeaderDescription,
1209
1213
  operationalAddress,
@@ -1280,6 +1284,7 @@ const defaultTrans = {
1280
1284
  legalCompanyName,
1281
1285
  legalCompanyNameHelper,
1282
1286
  legalCompanyNameHelper__AU,
1287
+ legalCompanyNameHelper__NL,
1283
1288
  legalCompanyNameHelper__US,
1284
1289
  legalCompanyNameHelper__SG,
1285
1290
  legalCompanyNameHelper__HK,
@@ -1564,6 +1569,9 @@ const defaultTrans = {
1564
1569
  countryOfEstablishment,
1565
1570
  nameOfTrustAgreement,
1566
1571
  typeOfTrustAgreement,
1572
+ objectOfCharitableTrust,
1573
+ objectOfTrust,
1574
+ pleaseProvideThePurposeOfCharitableTrust,
1567
1575
  weFoundTheFollowingIssues,
1568
1576
  reviewTheInformationBelowAndCorrectMistakesOr,
1569
1577
  uploadTheRequestedDocuments,
@@ -2116,29 +2124,25 @@ const defaultTrans = {
2116
2124
  taskIntroCompanyTitle,
2117
2125
  taskIntroCompanyDescriptionP1,
2118
2126
  taskIntroCompanyDescriptionP2,
2119
- taskIntroDecisionMakerOverviewTitle,
2120
- taskIntroDecisionMakerOverviewDescriptionP1,
2121
- taskIntroDecisionMakerOverviewDescriptionP2,
2122
- taskIntroDecisionMakerOverviewDescriptionP3,
2123
- taskIntroDecisionMakerOverviewDescriptionLI1,
2124
- taskIntroDecisionMakerOverviewDescriptionLI2,
2125
- taskIntroDecisionMakerOverviewDescriptionLI3,
2127
+ taskIntroCompanyDescriptionLI1,
2128
+ taskIntroDecisionMakerTitle,
2129
+ taskIntroDecisionMakerDescriptionP1,
2130
+ taskIntroDecisionMakerDescriptionP2,
2131
+ taskIntroDecisionMakerDescriptionLI1,
2132
+ taskIntroDecisionMakerDescriptionLI2,
2133
+ taskIntroDecisionMakerDescriptionLI3,
2126
2134
  taskIntroIndividualTitle,
2127
2135
  taskIntroIndividualDescriptionP1,
2128
2136
  taskIntroIndividualDescriptionP2,
2129
- taskIntroIndividualDescriptionP3,
2130
2137
  taskIntroIndividualDescriptionLI1,
2131
2138
  taskIntroIndividualDescriptionLI2,
2132
2139
  taskIntroIndividualDescriptionLI3,
2133
2140
  taskIntroPayoutTitle,
2134
- taskIntroPayoutOrganizationDescriptionP1,
2135
- taskIntroPayoutOrganizationDescriptionP2,
2136
- taskIntroPayoutIndividualDescriptionP1,
2137
- taskIntroPayoutIndividualDescriptionP2,
2141
+ taskIntroPayoutDescriptionP1,
2142
+ taskIntroPayoutDescriptionP2,
2138
2143
  taskIntroEpilogueTitle,
2139
2144
  taskIntroEpilogueDescriptionP1,
2140
- taskIntroEpilogueDescriptionP2,
2141
- taskIntroEpilogueDescriptionP3
2145
+ taskIntroEpilogueDescriptionP2
2142
2146
  };
2143
2147
  const FALLBACK_LOCALE = "en-US";
2144
2148
  const defaultTranslation = defaultTrans;
@@ -2511,7 +2515,8 @@ const exactLength = (input, length) => {
2511
2515
  };
2512
2516
  const lengthIsBetween = (input, minLength, maxLength) => (input == null ? void 0 : input.length) >= minLength && (input == null ? void 0 : input.length) <= maxLength;
2513
2517
  const trimValWithOneSpace = (val) => val.trimStart().replace(/\s+/g, " ");
2514
- const _alert = "";
2518
+ const _button_component = "";
2519
+ const _link_component = "";
2515
2520
  const _icon = "";
2516
2521
  const Icon = ({
2517
2522
  className = "",
@@ -2523,111 +2528,6 @@ const Icon = ({
2523
2528
  "aria-hidden": true,
2524
2529
  "data-testid": testId
2525
2530
  });
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
2531
  const Spinner$1 = "";
2632
2532
  const Spinner = ({
2633
2533
  inline = false,
@@ -2726,6 +2626,91 @@ const Button = ({
2726
2626
  });
2727
2627
  };
2728
2628
  const ErrorPanel$1 = "";
2629
+ const _alert = "";
2630
+ var AlertTypes = /* @__PURE__ */ ((AlertTypes2) => {
2631
+ AlertTypes2[AlertTypes2["BASIC"] = 0] = "BASIC";
2632
+ AlertTypes2[AlertTypes2["INFO"] = 1] = "INFO";
2633
+ AlertTypes2[AlertTypes2["ERROR"] = 2] = "ERROR";
2634
+ AlertTypes2[AlertTypes2["WARNING"] = 3] = "WARNING";
2635
+ AlertTypes2[AlertTypes2["SUCCESS"] = 4] = "SUCCESS";
2636
+ return AlertTypes2;
2637
+ })(AlertTypes || {});
2638
+ const Alert = ({
2639
+ className,
2640
+ title,
2641
+ type = AlertTypes.BASIC,
2642
+ children,
2643
+ hasCloseButton = true
2644
+ }) => {
2645
+ const {
2646
+ i18n
2647
+ } = useI18nContext();
2648
+ const [isClosed, setIsClosed] = useState(false);
2649
+ if (isClosed)
2650
+ return null;
2651
+ const closeAlert = () => setIsClosed(true);
2652
+ const classNames = cx("adl-alert", className, {
2653
+ "adl-alert--basic": type === AlertTypes.BASIC,
2654
+ "adl-alert--information": type === AlertTypes.INFO,
2655
+ "adl-alert--error": type === AlertTypes.ERROR,
2656
+ "adl-alert--warning": type === AlertTypes.WARNING,
2657
+ "adl-alert--success": type === AlertTypes.SUCCESS
2658
+ });
2659
+ return jsxs("div", {
2660
+ className: classNames,
2661
+ role: "alert",
2662
+ children: [jsxs("div", {
2663
+ className: "adl-alert__header",
2664
+ children: [jsx("span", {
2665
+ className: "adl-alert__icon",
2666
+ children: jsx(AlertIcon, {
2667
+ type
2668
+ })
2669
+ }), title && jsx("span", {
2670
+ className: cx("adl-alert__title", {
2671
+ "adl-alert__title--no-content": !children
2672
+ }),
2673
+ children: title
2674
+ }), hasCloseButton && jsx("button", {
2675
+ "aria-label": i18n.get("close"),
2676
+ className: "adl-alert__dismiss",
2677
+ onClick: closeAlert,
2678
+ type: "button",
2679
+ children: jsx(Icon, {
2680
+ name: "cross",
2681
+ className: "adl-alert__dismiss__icon"
2682
+ })
2683
+ })]
2684
+ }), children]
2685
+ });
2686
+ };
2687
+ const AlertIcon = ({
2688
+ className,
2689
+ type
2690
+ }) => {
2691
+ switch (type) {
2692
+ case AlertTypes.SUCCESS:
2693
+ return jsx(Icon, {
2694
+ name: "check"
2695
+ });
2696
+ case AlertTypes.ERROR:
2697
+ return jsx(Icon, {
2698
+ name: "warning",
2699
+ className
2700
+ });
2701
+ case AlertTypes.WARNING:
2702
+ return jsx(Icon, {
2703
+ name: "field-error"
2704
+ });
2705
+ case AlertTypes.INFO:
2706
+ case AlertTypes.BASIC:
2707
+ default:
2708
+ return jsx(Icon, {
2709
+ name: "info-circle",
2710
+ className: "adl-alert__icon__info"
2711
+ });
2712
+ }
2713
+ };
2729
2714
  const FormRouterContext = createContext(null);
2730
2715
  function useFormRouterContext() {
2731
2716
  const context = useContext(FormRouterContext);
@@ -7521,13 +7506,10 @@ const FLOWS_THAT_HIDE_REGISTRATION_NUMBER = [{
7521
7506
  const companyRegistrationDetailsFields = ["tradingName", "sameNameAsLegalName", ...businessRegistrationNumberFields, "stockExchangeMIC", "stockISIN", ...vatNumberFields, ...taxIdFields, "dateOfIncorporation"];
7522
7507
  function CompanyRegistrationDetailsComponent(props) {
7523
7508
  var _a, _b;
7524
- const {
7525
- contextCountry
7526
- } = useCoreContext();
7527
7509
  const {
7528
7510
  i18n
7529
7511
  } = useI18nContext();
7530
- const hideOptionalRegistrationNumberField = FLOWS_THAT_HIDE_REGISTRATION_NUMBER.some((f) => f.country === contextCountry && f.companyType.includes(props.companyType));
7512
+ const hideOptionalRegistrationNumberField = FLOWS_THAT_HIDE_REGISTRATION_NUMBER.some((f) => f.country === props.country && f.companyType.includes(props.companyType));
7531
7513
  const stateRef = useRef({
7532
7514
  setState: null
7533
7515
  });
@@ -8232,6 +8214,9 @@ const countryConfig$4 = {
8232
8214
  registrationNumber: {
8233
8215
  label: "chamberOfCommerceRegistrationNumber"
8234
8216
  },
8217
+ legalCompanyName: {
8218
+ helperText: "legalCompanyNameHelper__NL"
8219
+ },
8235
8220
  exemptedFromVat: {
8236
8221
  label: "vatNumberExempted"
8237
8222
  },
@@ -8460,6 +8445,9 @@ const trustBase = {
8460
8445
  trustType: {
8461
8446
  rule: "REQUIRED"
8462
8447
  },
8448
+ objectOfTrust: {
8449
+ rule: "trustTypeHasDescription"
8450
+ },
8463
8451
  legalName: {
8464
8452
  rule: "REQUIRED"
8465
8453
  },
@@ -8591,6 +8579,7 @@ var TaskStatus = /* @__PURE__ */ ((TaskStatus2) => {
8591
8579
  TaskStatus2[TaskStatus2["REMOVING"] = 9] = "REMOVING";
8592
8580
  return TaskStatus2;
8593
8581
  })(TaskStatus || {});
8582
+ const REQUIRED = "REQUIRED";
8594
8583
  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
8584
  const ID_NUMBER_EXEMPT_COUNTRIES = [CountryCodes.Canada, CountryCodes.UnitedStates];
8596
8585
  const ID_NUMBER_VERIFICATION_COUNTRIES = [CountryCodes.UnitedStates];
@@ -8600,6 +8589,7 @@ const NATIONALITY_REQUIRED_FOR_COUNTRIES = [CountryCodes.Singapore];
8600
8589
  const CONTACTS_REQUIRED_FOR_COUNTRIES = [CountryCodes.NewZealand];
8601
8590
  const JOB_TITLE_REQUIRED_FOR_COUNTRIES = [CountryCodes.NewZealand];
8602
8591
  const ISSUER_REQUIRED_FOR_COUNTRIES = [CountryCodes.Australia];
8592
+ const EXPIRY_DATE_REQUIRED_FOR_COUNTRIES = [CountryCodes.NewZealand];
8603
8593
  const rules$3 = ({
8604
8594
  data,
8605
8595
  country: country2,
@@ -8608,88 +8598,89 @@ const rules$3 = ({
8608
8598
  isDirectorIdNumberRequiredForCountry: () => {
8609
8599
  var _a, _b, _c, _d, _e;
8610
8600
  if (!((_a = data.personalDetails) == null ? void 0 : _a.role)) {
8611
- return "REQUIRED";
8601
+ return REQUIRED;
8612
8602
  }
8613
8603
  if ((_c = (_b = data.personalDetails) == null ? void 0 : _b.role) == null ? void 0 : _c.some((role2) => role2 !== DecisionMakerType.DIRECTOR)) {
8614
- return "REQUIRED";
8604
+ return REQUIRED;
8615
8605
  }
8616
8606
  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";
8607
+ return REQUIRED;
8618
8608
  }
8619
8609
  },
8620
8610
  idNumberExemptIfApplicableCountry: () => {
8621
8611
  if (ID_NUMBER_EXEMPT_COUNTRIES.includes(country2)) {
8622
- return "REQUIRED";
8612
+ return REQUIRED;
8623
8613
  }
8624
8614
  },
8625
8615
  idDocumentIfIdNumberExempted: () => {
8626
8616
  var _a;
8627
8617
  if ((_a = data.personalDetails) == null ? void 0 : _a.idNumberExempt) {
8628
- return "REQUIRED";
8618
+ return REQUIRED;
8629
8619
  }
8630
8620
  },
8631
8621
  isProofOfResidenceRequired: () => {
8632
8622
  var _a;
8633
8623
  if ((_a = data.proofOfResidence) == null ? void 0 : _a.proofOfResidence) {
8634
- return "REQUIRED";
8624
+ return REQUIRED;
8635
8625
  }
8636
8626
  },
8637
8627
  isProofOfNationalIdRequired: () => {
8638
8628
  var _a;
8639
8629
  if ((_a = data.proofOfNationalId) == null ? void 0 : _a.proofOfNationalId) {
8640
- return "REQUIRED";
8630
+ return REQUIRED;
8641
8631
  }
8642
8632
  },
8643
8633
  contactsIfRequiredForRole: () => {
8644
8634
  var _a, _b, _c, _d;
8645
8635
  if (!((_a = data.personalDetails) == null ? void 0 : _a.role)) {
8646
- return "REQUIRED";
8636
+ return REQUIRED;
8647
8637
  }
8648
8638
  if ((_c = (_b = data.personalDetails) == null ? void 0 : _b.role) == null ? void 0 : _c.includes(DecisionMakerType.SIGNATORY)) {
8649
- return "REQUIRED";
8639
+ return REQUIRED;
8650
8640
  }
8651
8641
  if (CONTACTS_REQUIRED_FOR_COUNTRIES.includes((_d = data.personalDetails) == null ? void 0 : _d.residencyCountry)) {
8652
- return "REQUIRED";
8642
+ return REQUIRED;
8653
8643
  }
8654
8644
  },
8655
8645
  jobTitleIfRequiredForRole: () => {
8656
8646
  var _a, _b;
8657
8647
  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";
8648
+ return REQUIRED;
8659
8649
  }
8660
8650
  if (JOB_TITLE_REQUIRED_FOR_COUNTRIES.includes(country2)) {
8661
- return "REQUIRED";
8651
+ return REQUIRED;
8662
8652
  }
8663
8653
  },
8664
8654
  nationalityIfRequiredForRole: () => {
8665
8655
  var _a;
8666
8656
  if (NATIONALITY_REQUIRED_FOR_COUNTRIES.includes(country2) && ((_a = data.personalDetails) == null ? void 0 : _a.nationality)) {
8667
- return "REQUIRED";
8657
+ return REQUIRED;
8668
8658
  }
8669
8659
  },
8670
8660
  accountHolderIfCustomer: () => {
8671
8661
  if (taskType === TaskTypes.INDIVIDUAL) {
8672
- return "REQUIRED";
8662
+ return REQUIRED;
8673
8663
  }
8674
8664
  },
8675
8665
  requiredIfCountryUsesMultipleTypesOfIdentity: () => {
8676
8666
  if (COUNTRIES_WHICH_USE_MULTIPLE_IDENTITY_TYPES.includes(country2)) {
8677
- return "REQUIRED";
8667
+ return REQUIRED;
8678
8668
  }
8679
8669
  },
8680
8670
  requiredIfIdentityTypeIsDriversLicense: () => {
8681
8671
  var _a;
8682
8672
  if (((_a = data.personalDetails) == null ? void 0 : _a.typeOfIdentity) === "driversLicense") {
8683
- return "REQUIRED";
8673
+ return REQUIRED;
8684
8674
  }
8685
8675
  },
8686
8676
  issuerStateRequired: () => {
8687
8677
  var _a;
8688
8678
  if (((_a = data.personalDetails) == null ? void 0 : _a.typeOfIdentity) === "driversLicense" && ISSUER_REQUIRED_FOR_COUNTRIES.includes(country2)) {
8689
- return "REQUIRED";
8679
+ return REQUIRED;
8690
8680
  }
8691
8681
  },
8692
- isVerificationAllowedForCountry: () => ID_NUMBER_VERIFICATION_COUNTRIES.includes(country2)
8682
+ isVerificationAllowedForCountry: () => ID_NUMBER_VERIFICATION_COUNTRIES.includes(country2),
8683
+ expiryDateRequired: () => EXPIRY_DATE_REQUIRED_FOR_COUNTRIES.includes(country2) ? REQUIRED : void 0
8693
8684
  });
8694
8685
  const accountHolderValidationRules = {
8695
8686
  accountHolder: {
@@ -10840,9 +10831,6 @@ const CompanyRegistrationDocumentFormID = companyForms.companyRegistrationDocume
10840
10831
  const CompanyTaxDocumentFormID = companyForms.companyTaxDocument.formId;
10841
10832
  const companyDocumentForms = [CompanyRegistrationDocumentFormID, CompanyTaxDocumentFormID];
10842
10833
  function CompanyComponent(props) {
10843
- const {
10844
- contextCountry
10845
- } = useCoreContext();
10846
10834
  const {
10847
10835
  i18n
10848
10836
  } = useI18nContext();
@@ -10906,7 +10894,7 @@ function CompanyComponent(props) {
10906
10894
  ...companyRegistrationAddressFormProps,
10907
10895
  heading: i18n.get("registeredAddress"),
10908
10896
  description: i18n.get("registeredAddressHeaderDescription", {
10909
- localizeFor: contextCountry
10897
+ localizeFor: props.country
10910
10898
  }),
10911
10899
  id: CompanyRegistrationAddressFormID,
10912
10900
  country: props.country,
@@ -11044,10 +11032,10 @@ const fetchDocument = async (documentId, entityId) => getDocumentService(documen
11044
11032
  const uploadDocuments = async (documents2, entityId) => {
11045
11033
  const uploadPromises = [];
11046
11034
  documents2.forEach((document2) => {
11047
- if (isDocumentCreatedForEntity(document2, entityId)) {
11035
+ const existingDocument = getDocument$1(entityId, document2.type);
11036
+ if (existingDocument) {
11048
11037
  if (hasDocumentChanged(document2, entityId)) {
11049
- const documentId = getDocument$1(entityId, document2.type).id;
11050
- uploadPromises.push(updateDocumentService(document2, documentId, entityId));
11038
+ uploadPromises.push(updateDocumentService(document2, existingDocument.id, entityId));
11051
11039
  }
11052
11040
  } else {
11053
11041
  uploadPromises.push(createDocumentService(document2, entityId));
@@ -11073,24 +11061,26 @@ const updateEntityDocuments = (uploadedDocuments, entityId) => {
11073
11061
  };
11074
11062
  const getDocument$1 = (entityId, documentType2) => {
11075
11063
  var _a;
11076
- return (_a = documentStore[entityId]) == null ? void 0 : _a.find((document2) => document2.type === documentType2 && isDocumentActive(document2));
11064
+ if (!entityId) {
11065
+ return;
11066
+ }
11067
+ return (_a = documentStore[entityId]) == null ? void 0 : _a.find((document2) => document2.type === documentType2);
11077
11068
  };
11078
11069
  const getIdDocument = (entityId) => {
11079
11070
  var _a;
11080
- return (_a = documentStore[entityId]) == null ? void 0 : _a.find((document2) => idTypes.includes(document2.type) && isDocumentActive(document2));
11071
+ return (_a = documentStore[entityId]) == null ? void 0 : _a.find((document2) => idTypes.includes(document2.type));
11081
11072
  };
11082
11073
  const createDocumentRequest = async ({
11083
11074
  entityId,
11084
11075
  entityType: entityType2,
11085
11076
  documentType: documentType2,
11086
11077
  page1,
11087
- page2 = null,
11088
- description: description2 = null,
11089
- existingDocument = null
11078
+ page2,
11079
+ description: description2,
11080
+ existingDocument
11090
11081
  }) => {
11091
11082
  const promises = [fileToBase64(page1), fileToBase64(page2)].filter(Boolean);
11092
11083
  const [encodedFront, encodedBack] = await Promise.all(promises);
11093
- const hasPageType = page1 && page2;
11094
11084
  if (!encodedFront) {
11095
11085
  if (existingDocument && existingDocument.description !== description2) {
11096
11086
  return {
@@ -11111,23 +11101,16 @@ const createDocumentRequest = async ({
11111
11101
  },
11112
11102
  type: documentType2,
11113
11103
  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)
11104
+ attachments: [...page1 && page2 && encodedFront && encodedBack ? [createAttachment(encodedFront, page1.name, "front"), createAttachment(encodedBack, page2.name, "back")] : [createAttachment(encodedFront, page1.name)]]
11115
11105
  };
11116
11106
  };
11117
- const createAttachment = (content, pageName, pageType = "") => content && {
11107
+ const createAttachment = (content, pageName, pageType = "") => ({
11118
11108
  content,
11119
11109
  pageName,
11120
11110
  ...pageType && {
11121
11111
  pageType
11122
11112
  }
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
- };
11113
+ });
11131
11114
  const hasDocumentChanged = (newDocument, entityId) => {
11132
11115
  const existingDocument = getDocument$1(entityId, newDocument.type);
11133
11116
  if (existingDocument) {
@@ -11138,20 +11121,16 @@ const hasDocumentChanged = (newDocument, entityId) => {
11138
11121
  }
11139
11122
  return true;
11140
11123
  };
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
11124
  const fileToBase64 = (file) => new Promise((resolve, reject) => {
11147
11125
  if (!file || !(file instanceof Blob)) {
11148
- resolve(null);
11126
+ resolve();
11149
11127
  return;
11150
11128
  }
11151
11129
  const reader = new FileReader();
11152
11130
  reader.readAsDataURL(file);
11153
11131
  reader.onload = () => {
11154
- const base64String = reader.result.toString().split(";base64,")[1];
11132
+ var _a;
11133
+ const base64String = (_a = reader.result) == null ? void 0 : _a.toString().split(";base64,")[1];
11155
11134
  resolve(base64String);
11156
11135
  };
11157
11136
  reader.onerror = (error) => reject(error);
@@ -11455,7 +11434,7 @@ const hasMinRequiredDecisionMakerCount = (legalEntityResponse) => {
11455
11434
  var TrustTypes = /* @__PURE__ */ ((TrustTypes2) => {
11456
11435
  TrustTypes2["BUSINESS_TRUST"] = "businessTrust";
11457
11436
  TrustTypes2["CASH_MANAGEMENT_TRUST"] = "cashManagementTrust";
11458
- TrustTypes2["CHARTIABLE_TRUST"] = "charitableTrust";
11437
+ TrustTypes2["CHARITABLE_TRUST"] = "charitableTrust";
11459
11438
  TrustTypes2["CORPORATE_UNIT_TRUST"] = "corporateUnitTrust";
11460
11439
  TrustTypes2["DECEASED_ESTATE"] = "deceasedEstate";
11461
11440
  TrustTypes2["DISCRETIONARY_INVESTMENT_TRUST"] = "discretionaryInvestmentTrust";
@@ -11481,7 +11460,7 @@ const trustTypeOptions = [{
11481
11460
  id: TrustTypes.CASH_MANAGEMENT_TRUST,
11482
11461
  name: "cashManagementTrust"
11483
11462
  }, {
11484
- id: TrustTypes.CHARTIABLE_TRUST,
11463
+ id: TrustTypes.CHARITABLE_TRUST,
11485
11464
  name: "charitableTrust"
11486
11465
  }, {
11487
11466
  id: TrustTypes.CORPORATE_UNIT_TRUST,
@@ -11532,7 +11511,7 @@ const trustTypeOptions = [{
11532
11511
  id: TrustTypes.UNLISTED_PUBLIC_UNIT_TRUST,
11533
11512
  name: "unlistedPublicUnitTrust"
11534
11513
  }];
11535
- const nzSpecificTrustTypes = [TrustTypes.DISCRETIONARY_TRUST, TrustTypes.FAMILY_TRUST, TrustTypes.CHARTIABLE_TRUST, TrustTypes.BUSINESS_TRUST, TrustTypes.OTHER_TRUST];
11514
+ const nzSpecificTrustTypes = [TrustTypes.DISCRETIONARY_TRUST, TrustTypes.FAMILY_TRUST, TrustTypes.CHARITABLE_TRUST, TrustTypes.BUSINESS_TRUST, TrustTypes.OTHER_TRUST];
11536
11515
  const auSpecificTrustTypes = [TrustTypes.CASH_MANAGEMENT_TRUST, TrustTypes.CORPORATE_UNIT_TRUST, TrustTypes.DECEASED_ESTATE, TrustTypes.DISCRETIONARY_INVESTMENT_TRUST, TrustTypes.DISCRETIONARY_SERVICES_MANAGEMENT_TRUST, TrustTypes.DISCRETIONARY_TRADING_TRUST, TrustTypes.FIRST_HOME_SAVER_ACCOUNTS_TRUST, TrustTypes.FIXED_TRUST, TrustTypes.FIXED_UNIT_TRUST, TrustTypes.HYBRID_TRUST, TrustTypes.LISTED_PUBLIC_UNIT_TRUST, TrustTypes.OTHER_TRUST, TrustTypes.POOLED_SUPERANNUATION_TRUST, TrustTypes.PUBLIC_TRADING_TRUST, TrustTypes.UNLISTED_PUBLIC_UNIT_TRUST];
11537
11516
  const countryToTrustTypes = {
11538
11517
  [CountryCodes.Australia]: auSpecificTrustTypes,
@@ -11648,14 +11627,13 @@ const getCountrySpecificTrustTypeOptions = (country2) => {
11648
11627
  if (!countrySpecificTrustTypes) {
11649
11628
  return [];
11650
11629
  }
11651
- const countrySpecificTrustTypeOptions = countrySpecificTrustTypes.map((countrySpecificTrustType) => {
11630
+ return countrySpecificTrustTypes.map((countrySpecificTrustType) => {
11652
11631
  const countrySpecificTrustTypeOption = trustTypeOptions.find((trustTypeOption) => trustTypeOption.id === countrySpecificTrustType);
11653
11632
  if (!countrySpecificTrustTypeOption) {
11654
11633
  throw new Error("getCountrySpecificTrustTypeOptions(): unknown trust type");
11655
11634
  }
11656
11635
  return countrySpecificTrustTypeOption;
11657
11636
  });
11658
- return countrySpecificTrustTypeOptions;
11659
11637
  };
11660
11638
  const entityAssociationRoles = {
11661
11639
  ...trustMemberRoles,
@@ -11891,6 +11869,7 @@ const individualBaseMapping = {
11891
11869
  "personalDetails.typeOfIdentity": "individual.identificationData.type",
11892
11870
  "personalDetails.issuerState": "individual.identificationData.issuerState",
11893
11871
  "personalDetails.licenseCardNumber": "individual.identificationData.cardNumber",
11872
+ "personalDetails.expiryDate": "individual.identificationData.expiryDate",
11894
11873
  "personalDetails.nationality": "individual.nationality",
11895
11874
  "personalDetails.jobTitle": "individual.jobTitle",
11896
11875
  "address.city": "individual.residentialAddress.city",
@@ -12076,6 +12055,21 @@ function assignToProp(path, obj, val) {
12076
12055
  }
12077
12056
  });
12078
12057
  }
12058
+ function deleteProp(path, obj) {
12059
+ const splitPath = path.split(".");
12060
+ const pathDepth = splitPath.length;
12061
+ let currentObj = obj;
12062
+ splitPath.forEach((key, index) => {
12063
+ if (index === pathDepth - 1) {
12064
+ delete currentObj[key];
12065
+ } else {
12066
+ if (!currentObj[key]) {
12067
+ throw Error(`The given path does not exist on the object: ${key} (${path})`);
12068
+ }
12069
+ currentObj = currentObj[key];
12070
+ }
12071
+ });
12072
+ }
12079
12073
  const formatObject = (obj, mapping) => {
12080
12074
  if (obj) {
12081
12075
  const formattedObj = {};
@@ -12224,11 +12218,15 @@ const mapCompanyToLegalEntity = (data) => {
12224
12218
  return requestObj;
12225
12219
  };
12226
12220
  const mapLegalEntityToTrust = (legalEntity) => {
12227
- var _a, _b, _c;
12221
+ var _a, _b, _c, _d;
12228
12222
  let trustCompData;
12229
12223
  if (legalEntity == null ? void 0 : legalEntity.trust) {
12230
12224
  trustCompData = formatObject(legalEntity, trustComponentsKeyMapping);
12231
- if ((_a = legalEntity.trust) == null ? void 0 : _a.principalPlaceOfBusiness) {
12225
+ trustCompData.trustRegistrationDetails.country = legalEntity.trust.countryOfGoverningLaw;
12226
+ if ((_a = legalEntity.trust) == null ? void 0 : _a.description) {
12227
+ trustCompData.trustRegistrationDetails.objectOfTrust = legalEntity.trust.description;
12228
+ }
12229
+ if ((_b = legalEntity.trust) == null ? void 0 : _b.principalPlaceOfBusiness) {
12232
12230
  trustCompData.trustRegistrationAddress.operationalAddressIsSame = operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME;
12233
12231
  } else {
12234
12232
  if (!trustCompData.trustRegistrationAddress) {
@@ -12243,10 +12241,10 @@ const mapLegalEntityToTrust = (legalEntity) => {
12243
12241
  const {
12244
12242
  country: country2
12245
12243
  } = legalEntity.trust.registeredAddress;
12246
- trustCompData.trustRegistrationDetails.taxId = (_b = taxInformation.find((info) => info.country === country2)) == null ? void 0 : _b.number;
12244
+ trustCompData.trustRegistrationDetails.taxId = (_c = taxInformation.find((info) => info.country === country2)) == null ? void 0 : _c.number;
12247
12245
  trustCompData.trustRegistrationDetails.exemptedFromTax = false;
12248
12246
  }
12249
- if ((_c = legalEntity == null ? void 0 : legalEntity.documentDetails) == null ? void 0 : _c.length) {
12247
+ if ((_d = legalEntity == null ? void 0 : legalEntity.documentDetails) == null ? void 0 : _d.length) {
12250
12248
  trustCompData = {
12251
12249
  ...trustCompData,
12252
12250
  ...mapApiDocumentToTrustDocument(legalEntity == null ? void 0 : legalEntity.id)
@@ -12256,6 +12254,7 @@ const mapLegalEntityToTrust = (legalEntity) => {
12256
12254
  return trustCompData;
12257
12255
  };
12258
12256
  const mapTrustToLegalEntity = (data) => {
12257
+ var _a;
12259
12258
  const requestObj = {
12260
12259
  ...formatObject(data, trustApiKeyMapping)
12261
12260
  };
@@ -12266,6 +12265,9 @@ const mapTrustToLegalEntity = (data) => {
12266
12265
  entity: requestObj.trust
12267
12266
  });
12268
12267
  }
12268
+ if ((_a = data.trustRegistrationDetails) == null ? void 0 : _a.objectOfTrust) {
12269
+ requestObj.trust.description = data.trustRegistrationDetails.objectOfTrust;
12270
+ }
12269
12271
  requestObj.type = LegalEntityType.TRUST;
12270
12272
  return requestObj;
12271
12273
  };
@@ -12711,6 +12713,7 @@ const IdDocumentManualUpload = memo(IdDocumentManualUploadComponent, (prevProps,
12711
12713
  const IdVerificationComponent$1 = "";
12712
12714
  const useIdVerificationToken = ({
12713
12715
  userDetails,
12716
+ legalEntityId,
12714
12717
  handleGetIdVerificationToken,
12715
12718
  onIdVerificationError
12716
12719
  }) => {
@@ -12738,7 +12741,11 @@ const useIdVerificationToken = ({
12738
12741
  consents: [{
12739
12742
  name: "privacy_notices_read",
12740
12743
  granted: true
12741
- }]
12744
+ }],
12745
+ ...legalEntityId ? {
12746
+ legalEntityId
12747
+ } : {}
12748
+ // Do not include legalEntityId if we don't know yet. Eg.: decision-makers flow the associated legalEntityId.
12742
12749
  };
12743
12750
  const {
12744
12751
  sdkToken: sdkToken2
@@ -13286,6 +13293,7 @@ const initOnfido = async ({
13286
13293
  const logger$g = createLogger("IdVerificationComponent");
13287
13294
  function IdVerificationComponent({
13288
13295
  userDetails,
13296
+ legalEntityId,
13289
13297
  handleGetIdVerificationToken,
13290
13298
  onIdVerificationClose,
13291
13299
  onIdVerificationError,
@@ -13299,6 +13307,7 @@ function IdVerificationComponent({
13299
13307
  loadingStatus
13300
13308
  } = useIdVerificationToken({
13301
13309
  userDetails,
13310
+ legalEntityId,
13302
13311
  handleGetIdVerificationToken,
13303
13312
  onIdVerificationError
13304
13313
  });
@@ -13446,6 +13455,7 @@ function IdDocumentInstantVerificationComponent(props) {
13446
13455
  children: [props.userDetails && jsx(IdVerificationComponent, {
13447
13456
  handleGetIdVerificationToken: props.handleGetIdVerificationToken,
13448
13457
  userDetails: props.userDetails,
13458
+ legalEntityId: props.legalEntityId,
13449
13459
  onIdVerificationComplete: handleIdVerificationComplete,
13450
13460
  onIdVerificationError: logger$f.error
13451
13461
  }), jsxs("div", {
@@ -13469,7 +13479,8 @@ function IdDocumentUploadComponent(props) {
13469
13479
  return props.idVerificationMethodSelected === "instantVerification" && !!props.handleGetIdVerificationToken ? jsx(IdDocumentInstantVerification, {
13470
13480
  ...props,
13471
13481
  handleGetIdVerificationToken: props.handleGetIdVerificationToken,
13472
- userDetails: props.userDetails
13482
+ userDetails: props.userDetails,
13483
+ legalEntityId: props.legalEntityId
13473
13484
  }) : jsx(IdDocumentManualUpload, {
13474
13485
  ...props
13475
13486
  });
@@ -14681,8 +14692,37 @@ const personalDetailsValidationRules = {
14681
14692
  errorMessage: "fieldIsRequired"
14682
14693
  }
14683
14694
  };
14684
- const additionalIdentityInfoFields$2 = ["typeOfIdentity", "licenseCardNumber", "issuerState"];
14685
- const identityTypes$2 = ["nationalIdNumber", "passport", "driversLicense", "proofOfIdentityCard"];
14695
+ const mapIdentityTypeToItem = (type, label) => ({
14696
+ id: type,
14697
+ name: label
14698
+ });
14699
+ const TypeOfIdentity = ({
14700
+ availableIdentityTypes,
14701
+ selectedIdentityType,
14702
+ setSelectedIdentityType,
14703
+ label,
14704
+ errorMessage,
14705
+ isValid
14706
+ }) => {
14707
+ const {
14708
+ i18n
14709
+ } = useI18nContext();
14710
+ return jsx(Field, {
14711
+ name: "typeOfIdentity",
14712
+ label,
14713
+ errorMessage,
14714
+ isValid,
14715
+ helper: i18n.get("typeOfIdentitySubtitle"),
14716
+ children: (childProps) => jsx(Select, {
14717
+ ...childProps,
14718
+ isInvalid: false,
14719
+ items: availableIdentityTypes.map((type) => mapIdentityTypeToItem(type, i18n.get(type))),
14720
+ placeholder: i18n.get("id"),
14721
+ selected: selectedIdentityType,
14722
+ onChange: (event) => setSelectedIdentityType(event.target.value)
14723
+ })
14724
+ });
14725
+ };
14686
14726
  const auIdentityValidationRules = {
14687
14727
  typeOfIdentity: [isTruthyValidator],
14688
14728
  idNumber: [{
@@ -14841,39 +14881,6 @@ const ProofOfIdentityCard$1 = ({
14841
14881
  placeholder: ""
14842
14882
  })
14843
14883
  });
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
- };
14877
14884
  function IdentityAuComponent(props) {
14878
14885
  var _a;
14879
14886
  if (((_a = props.data) == null ? void 0 : _a.typeOfIdentity) === "nationalIdNumber") {
@@ -14915,12 +14922,14 @@ function IdentityAuComponent(props) {
14915
14922
  i18n
14916
14923
  } = useI18nContext();
14917
14924
  const formUtils = formUtilities(props, i18n);
14925
+ const availableIdentityTypes = ["passport", "driversLicense", "proofOfIdentityCard"];
14926
+ const selectedIdentityType = data.typeOfIdentity;
14918
14927
  return jsxs(Fragment, {
14919
- children: [jsx(TypeOfIdentity$2, {
14920
- availableIdentityTypes: identityTypes$2.filter((type) => type !== "nationalIdNumber"),
14921
- selectedIdentityType: data.typeOfIdentity,
14928
+ children: [jsx(TypeOfIdentity, {
14929
+ availableIdentityTypes,
14930
+ selectedIdentityType,
14922
14931
  setSelectedIdentityType: handleChangeFor("typeOfIdentity"),
14923
- formUtils,
14932
+ label: formUtils.getLabel("typeOfIdentity"),
14924
14933
  isValid: valid.typeOfIdentity,
14925
14934
  errorMessage: formUtils.getErrorMessage("typeOfIdentity", errors, fieldProblems)
14926
14935
  }), data.typeOfIdentity === "passport" ? jsx(PassportNumber$2, {
@@ -14958,9 +14967,6 @@ function IdentityAuComponent(props) {
14958
14967
  }) : void 0]
14959
14968
  });
14960
14969
  }
14961
- const auIdentityFields = [...additionalIdentityInfoFields$2, "idNumber"];
14962
- const additionalIdentityInfoFields$1 = ["typeOfIdentity"];
14963
- const identityTypes$1 = ["nationalIdNumber", "passport", "driversLicense", "proofOfIdentityCard"];
14964
14970
  const isValidatePassportNumber = (value) => PassportNumberPatterns.HK.test(value);
14965
14971
  const identityValidationRules = {
14966
14972
  typeOfIdentity: [isTruthyValidator],
@@ -15053,46 +15059,13 @@ const ProofOfIdentityCard = ({
15053
15059
  isValid,
15054
15060
  children: (childProps) => jsx(InputText, {
15055
15061
  ...childProps,
15056
- name: "cardNumber",
15057
- value: cardNumber,
15058
- onInput,
15059
- onBlur,
15060
- placeholder: ""
15061
- })
15062
- });
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
- };
15062
+ name: "cardNumber",
15063
+ value: cardNumber,
15064
+ onInput,
15065
+ onBlur,
15066
+ placeholder: ""
15067
+ })
15068
+ });
15096
15069
  function IdentityHKComponent(props) {
15097
15070
  var _a;
15098
15071
  if (((_a = props.data) == null ? void 0 : _a.typeOfIdentity) === "nationalIdNumber") {
@@ -15137,12 +15110,14 @@ function IdentityHKComponent(props) {
15137
15110
  i18n
15138
15111
  } = useI18nContext();
15139
15112
  const formUtils = formUtilities(props, i18n);
15113
+ const availableIdentityTypes = ["passport", "driversLicense", "proofOfIdentityCard"];
15114
+ const selectedIdentityType = data.typeOfIdentity;
15140
15115
  return jsxs(Fragment, {
15141
- children: [jsx(TypeOfIdentity$1, {
15142
- availableIdentityTypes: identityTypes$1.filter((type) => type !== "nationalIdNumber"),
15143
- selectedIdentityType: data.typeOfIdentity,
15116
+ children: [jsx(TypeOfIdentity, {
15117
+ availableIdentityTypes,
15118
+ selectedIdentityType,
15144
15119
  setSelectedIdentityType: handleChangeFor("typeOfIdentity"),
15145
- formUtils,
15120
+ label: formUtils.getLabel("typeOfIdentity"),
15146
15121
  isValid: valid.typeOfIdentity,
15147
15122
  errorMessage: formUtils.getErrorMessage("typeOfIdentity", errors, fieldProblems)
15148
15123
  }), data.typeOfIdentity === "passport" ? jsx(PassportNumber$1, {
@@ -15173,9 +15148,6 @@ function IdentityHKComponent(props) {
15173
15148
  }) : void 0]
15174
15149
  });
15175
15150
  }
15176
- const hkIdentityFields = [...additionalIdentityInfoFields$1, "idNumber"];
15177
- const additionalIdentityInfoFields = ["typeOfIdentity", "licenseCardNumber"];
15178
- const identityTypes = ["nationalIdNumber", "passport", "driversLicense", "proofOfIdentityCard"];
15179
15151
  const nzIdentityValidationRules = {
15180
15152
  typeOfIdentity: [isTruthyValidator],
15181
15153
  idNumber: [{
@@ -15292,39 +15264,6 @@ const PassportNumber = ({
15292
15264
  placeholder: ""
15293
15265
  })
15294
15266
  });
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
15267
  function IdentityNZComponent(props) {
15329
15268
  var _a;
15330
15269
  if (((_a = props.data) == null ? void 0 : _a.typeOfIdentity) === "nationalIdNumber") {
@@ -15367,21 +15306,47 @@ function IdentityNZComponent(props) {
15367
15306
  } = useI18nContext();
15368
15307
  const formUtils = formUtilities(props, i18n);
15369
15308
  const availableIdentityTypes = ["passport", "driversLicense"];
15309
+ const selectedIdentityType = data.typeOfIdentity;
15310
+ const today = /* @__PURE__ */ new Date();
15311
+ const maxExpiryDateSelection = new Date((/* @__PURE__ */ new Date()).setFullYear(today.getFullYear() + 10));
15370
15312
  return jsxs(Fragment, {
15371
15313
  children: [jsx(TypeOfIdentity, {
15372
- availableIdentityTypes: identityTypes.filter((type) => availableIdentityTypes.includes(type)),
15373
- selectedIdentityType: data.typeOfIdentity,
15314
+ availableIdentityTypes,
15315
+ selectedIdentityType,
15374
15316
  setSelectedIdentityType: handleChangeFor("typeOfIdentity"),
15375
- formUtils,
15317
+ label: formUtils.getLabel("typeOfIdentity"),
15376
15318
  isValid: valid.typeOfIdentity,
15377
15319
  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)
15320
+ }), data.typeOfIdentity === "passport" ? jsxs("div", {
15321
+ className: "adyen-kyc-field-wrapper",
15322
+ children: [jsx(PassportNumber, {
15323
+ passportNumber: data.idNumber ?? "",
15324
+ onInput: handleChangeFor("idNumber", "input"),
15325
+ onBlur: handleChangeFor("idNumber", "blur"),
15326
+ formUtils,
15327
+ isValid: valid.idNumber,
15328
+ errorMessage: formUtils.getErrorMessage("idNumber", errors, fieldProblems)
15329
+ }), jsx(Field, {
15330
+ name: "expiryDate",
15331
+ label: formUtils.getLabel("passportExpiryDate"),
15332
+ classNameModifiers: ["expiryDate"],
15333
+ errorMessage: formUtils.getErrorMessage("expiryDate", errors, fieldProblems),
15334
+ isValid: valid.expiryDate,
15335
+ children: (childProps) => jsx(InputDate, {
15336
+ ...childProps,
15337
+ name: "expiryDate",
15338
+ value: data.expiryDate,
15339
+ placeholder: i18n.get("datePlaceholder"),
15340
+ readonly: formUtils.isReadOnly("expiryDate"),
15341
+ onInput: handleChangeFor("expiryDate", "input"),
15342
+ onBlur: handleChangeFor("expiryDate", "blur"),
15343
+ "aria-required": true,
15344
+ "aria-label": formUtils.getLabel("passportExpiryDate"),
15345
+ "aria-invalid": !valid.expiryDate,
15346
+ min: formatDateObj(today),
15347
+ max: formatDateObj(maxExpiryDateSelection)
15348
+ })
15349
+ })]
15385
15350
  }) : data.typeOfIdentity === "driversLicense" ? jsx(DriversLicense, {
15386
15351
  driversLicense: data,
15387
15352
  onLicenseNumberInput: handleChangeFor("idNumber", "input"),
@@ -15400,7 +15365,6 @@ function IdentityNZComponent(props) {
15400
15365
  }) : void 0]
15401
15366
  });
15402
15367
  }
15403
- const nzIdentityFields = [...additionalIdentityInfoFields, "idNumber"];
15404
15368
  const ERROR_CODES = {
15405
15369
  SSN_REMEDIATION: "1_316",
15406
15370
  SSN_4_DIGITS_VALIDATION: "1_3062",
@@ -15444,6 +15408,8 @@ const IdentityUSComponent = forwardRef((props, ref) => {
15444
15408
  ref
15445
15409
  });
15446
15410
  });
15411
+ const additionalIdentityInfoFields = ["typeOfIdentity", "licenseCardNumber", "issuerState", "expiryDate"];
15412
+ const identityFields = [...additionalIdentityInfoFields, "idNumber"];
15447
15413
  function IdentityComponent(props) {
15448
15414
  var _a;
15449
15415
  const {
@@ -15455,44 +15421,39 @@ function IdentityComponent(props) {
15455
15421
  if (!((_a = identityProps == null ? void 0 : identityProps.requiredFields) == null ? void 0 : _a.length)) {
15456
15422
  return null;
15457
15423
  }
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
- }
15424
+ const {
15425
+ id: dataStoreId
15426
+ } = personalDetails2;
15472
15427
  if (country2 === "US") {
15473
15428
  return jsx(IdentityUSComponent, {
15474
15429
  ...identityProps,
15475
15430
  errors,
15476
- dataStoreId: personalDetails2.id,
15431
+ dataStoreId,
15477
15432
  country: country2,
15478
15433
  formVerificationErrors: personalDetails2.formVerificationErrors
15479
15434
  });
15480
15435
  }
15481
- if (country2 === "NZ") {
15482
- const nzIdentityProps = getFieldProps(personalDetails2, nzIdentityFields);
15483
- return jsx(IdentityNZComponent, {
15484
- ...nzIdentityProps,
15485
- dataStoreId: personalDetails2.id
15436
+ const countrySpecificComponentsMap = {
15437
+ [CountryCodes.Australia]: IdentityAuComponent,
15438
+ [CountryCodes.HongKong]: IdentityHKComponent,
15439
+ [CountryCodes.NewZealand]: IdentityNZComponent
15440
+ };
15441
+ const Component = countrySpecificComponentsMap[country2];
15442
+ if (!Component) {
15443
+ return jsx(IdentityNumberComponent, {
15444
+ ...identityProps,
15445
+ errors,
15446
+ country: country2,
15447
+ dataStoreId
15486
15448
  });
15487
15449
  }
15488
- return jsx(IdentityNumberComponent, {
15489
- ...identityProps,
15490
- errors,
15491
- country: country2,
15492
- dataStoreId: personalDetails2.id
15450
+ const countrySpecificIdentityProps = getFieldProps(personalDetails2, identityFields);
15451
+ return jsx(Component, {
15452
+ ...countrySpecificIdentityProps,
15453
+ dataStoreId
15493
15454
  });
15494
15455
  }
15495
- const personalDetailsFields = [...nameFields, "birthDate", ...idNumberFields, ...additionalIdentityInfoFields$2, "residencyCountry", "nationality", "jobTitle", ...decisionMakerRoleFields, ...contactDetailFields, ...accountHolderFields];
15456
+ const personalDetailsFields = [...nameFields, "birthDate", ...idNumberFields, ...additionalIdentityInfoFields, "residencyCountry", "nationality", "jobTitle", ...decisionMakerRoleFields, ...contactDetailFields, ...accountHolderFields];
15496
15457
  function PersonalDetailsComponent(props) {
15497
15458
  const {
15498
15459
  i18n
@@ -16062,6 +16023,7 @@ var Currency = /* @__PURE__ */ ((Currency2) => {
16062
16023
  Currency2["HRK"] = "HRK";
16063
16024
  Currency2["PLN"] = "PLN";
16064
16025
  Currency2["NOK"] = "NOK";
16026
+ Currency2["NZD"] = "NZD";
16065
16027
  Currency2["RON"] = "RON";
16066
16028
  Currency2["SGD"] = "SGD";
16067
16029
  Currency2["SEK"] = "SEK";
@@ -16099,6 +16061,7 @@ const currencyByCountry = {
16099
16061
  [CountryCodes.Malta]: [Currency.EUR],
16100
16062
  [CountryCodes.Monaco]: [Currency.EUR],
16101
16063
  [CountryCodes.Netherlands]: [Currency.EUR],
16064
+ [CountryCodes.NewZealand]: [Currency.NZD],
16102
16065
  [CountryCodes.Norway]: [Currency.NOK, Currency.EUR],
16103
16066
  [CountryCodes.Poland]: [Currency.PLN, Currency.EUR],
16104
16067
  [CountryCodes.Portugal]: [Currency.EUR],
@@ -16270,16 +16233,17 @@ const getRequestUrl = (loadingContext, path, clientKey) => {
16270
16233
  }
16271
16234
  return url;
16272
16235
  };
16273
- const handleFetchError = (message, level) => {
16236
+ const logFetchError = (message, level) => {
16274
16237
  switch (level) {
16275
16238
  case "silent":
16276
16239
  break;
16277
16240
  case "info":
16278
16241
  case "warn":
16279
16242
  case "error":
16280
- return logger$e[level](message);
16243
+ logger$e[level](message);
16244
+ break;
16281
16245
  default:
16282
- throw new Error(message);
16246
+ logger$e.error(message);
16283
16247
  }
16284
16248
  };
16285
16249
  const handleFetchResponse = async (response, responseType) => {
@@ -16294,6 +16258,14 @@ const handleFetchResponse = async (response, responseType) => {
16294
16258
  return response.text();
16295
16259
  }
16296
16260
  };
16261
+ const isValidationErrorResponse = (response) => (response == null ? void 0 : response.status) === 422;
16262
+ class ValidationError extends Error {
16263
+ constructor(message, validationDetails) {
16264
+ super(message);
16265
+ this.invalidFields = validationDetails == null ? void 0 : validationDetails.invalidFields;
16266
+ this.errorCode = validationDetails == null ? void 0 : validationDetails.errorCode;
16267
+ }
16268
+ }
16297
16269
  const http = async (options, data, responseType = "json") => {
16298
16270
  const {
16299
16271
  errorLevel = "warn",
@@ -16303,18 +16275,31 @@ const http = async (options, data, responseType = "json") => {
16303
16275
  } = options;
16304
16276
  const request = getRequestObject(options, data);
16305
16277
  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
- });
16278
+ let response;
16279
+ try {
16280
+ response = await fetch(url, request);
16281
+ } catch (error) {
16282
+ const errorMessage2 = options.errorMessage || `Service at ${url} is not available. Error= ${error}`;
16283
+ logFetchError(errorMessage2, errorLevel);
16284
+ throw new Error(errorMessage2);
16285
+ }
16286
+ const errorMessage = options.errorMessage || `Call to ${url} failed.`;
16287
+ if (!response) {
16288
+ logFetchError(errorMessage, errorLevel);
16289
+ throw new Error(errorMessage);
16290
+ }
16291
+ if (response.ok) {
16292
+ return handleFetchResponse(response, responseType);
16293
+ }
16294
+ if (options.errorHandler) {
16295
+ return options.errorHandler(handleFetchResponse(response, responseType));
16296
+ }
16297
+ if (isValidationErrorResponse(response)) {
16298
+ const responseData = await response.json();
16299
+ throw new ValidationError(responseData.errorCode, responseData);
16300
+ }
16301
+ logFetchError(errorMessage, errorLevel);
16302
+ throw new Error(errorMessage);
16318
16303
  };
16319
16304
  const httpGet = async (options, data) => http({
16320
16305
  ...options,
@@ -16955,6 +16940,11 @@ function BankAccountFormat(props) {
16955
16940
  })
16956
16941
  });
16957
16942
  }
16943
+ const stripNonAlphanumeric = (value) => value.replaceAll(/[^0-9a-zA-Z]/g, "");
16944
+ const isValueMasked = (value) => {
16945
+ var _a;
16946
+ return typeof value === "string" && !!((_a = value.match(/[*]{2,}/)) == null ? void 0 : _a.length);
16947
+ };
16958
16948
  const bankAccountNumberFields = ["bankAccountNumber"];
16959
16949
  function BankAccountNumber(props) {
16960
16950
  const {
@@ -16980,6 +16970,11 @@ function BankAccountNumber(props) {
16980
16970
  rules: validators,
16981
16971
  defaultData: props.data,
16982
16972
  fieldProblems: props == null ? void 0 : props.fieldValidationErrors,
16973
+ formatters: {
16974
+ bankAccountNumber: {
16975
+ formatter: (v) => v && !isValueMasked(v) ? stripNonAlphanumeric(v) : v
16976
+ }
16977
+ },
16983
16978
  maskedFields: props.maskedFields
16984
16979
  });
16985
16980
  useEffect(() => {
@@ -17000,22 +16995,22 @@ function BankAccountNumber(props) {
17000
16995
  children: [jsx(StateContextSetter, {
17001
16996
  stateRef
17002
16997
  }), jsx(Field, {
17003
- name: "bankAccountNumber",
17004
- label: formUtils.getLabel("bankAccountNumber"),
17005
16998
  classNameModifiers: ["bankAccountNumber"],
17006
16999
  errorMessage: formUtils.getErrorMessage("bankAccountNumber", errors, fieldProblems) || "",
17007
17000
  isValid: valid.bankAccountNumber,
17001
+ label: formUtils.getLabel("bankAccountNumber"),
17002
+ name: "bankAccountNumber",
17008
17003
  children: (childProps) => jsx(InputText, {
17009
17004
  ...childProps,
17010
- name: "bankAccountNumber",
17011
- value: data.bankAccountNumber,
17012
- readonly: formUtils.isReadOnly("bankAccountNumber"),
17013
- classNameModifiers: ["bankAccountNumber"],
17014
- onInput: handleChangeFor("bankAccountNumber", "input"),
17015
- onBlur: handleChangeFor("bankAccountNumber", "blur"),
17016
17005
  "aria-required": true,
17006
+ "aria-invalid": !valid.bankAccountNumber,
17017
17007
  "aria-label": formUtils.getLabel("bankAccountNumber"),
17018
- "aria-invalid": !valid.bankAccountNumber
17008
+ classNameModifiers: ["bankAccountNumber"],
17009
+ name: "bankAccountNumber",
17010
+ onBlur: handleChangeFor("bankAccountNumber", "blur"),
17011
+ onInput: handleChangeFor("bankAccountNumber", "input"),
17012
+ readonly: formUtils.isReadOnly("bankAccountNumber"),
17013
+ value: data.bankAccountNumber
17019
17014
  })
17020
17015
  })]
17021
17016
  });
@@ -18051,12 +18046,11 @@ const PayoutBankStatement = memo(PayoutBankStatementComponent, (prevProps, nextP
18051
18046
  const VerificationMethod = "";
18052
18047
  const hasLoaded = (loadedValue) => loadedValue !== "loading";
18053
18048
  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];
18049
+ const regions = {
18050
+ europe: [...eeaCountries, CountryCodes.Switzerland, CountryCodes.UnitedKingdom],
18051
+ apac: [CountryCodes.NewZealand, CountryCodes.Australia]
18052
+ };
18053
+ const getAllowedBankCountries = (country2) => Object.values(regions).find((countriesInARegion) => countriesInARegion.includes(country2)) ?? [country2];
18060
18054
  const makePayoutVerificationMethodsMetadata = (svgPath, instantVerificationProvider) => ({
18061
18055
  instantVerification: {
18062
18056
  name: "verifyViaMobileBankAppOrBankWebsite",
@@ -18661,12 +18655,21 @@ const trustRegistrationDetailsValidations = {
18661
18655
  modes: ["blur"],
18662
18656
  validate: (legalName) => !!legalName,
18663
18657
  errorMessage: "fieldIsRequired"
18658
+ },
18659
+ objectOfTrust: {
18660
+ modes: ["blur"],
18661
+ validate: (objectOfTrust2) => !!objectOfTrust2,
18662
+ errorMessage: "fieldIsRequired"
18664
18663
  }
18665
18664
  };
18666
- const trustRegistrationDetailsFields = ["legalName", "country", "trustType", "taxId", "registrationNumber"];
18665
+ const trustRegistrationDetailsFields = ["legalName", "country", "trustType", "objectOfTrust", "taxId", "registrationNumber"];
18667
18666
  const ALLOWED_TRUST_COUNTRIES = [CountryCodes.Australia, CountryCodes.NewZealand];
18668
18667
  function TrustRegistrationDetailsComponent(props) {
18669
- var _a, _b;
18668
+ var _a;
18669
+ const {
18670
+ country: country2,
18671
+ onCountryChange
18672
+ } = props;
18670
18673
  const {
18671
18674
  i18n
18672
18675
  } = useI18nContext();
@@ -18675,7 +18678,8 @@ function TrustRegistrationDetailsComponent(props) {
18675
18678
  setState: null
18676
18679
  });
18677
18680
  const requiredFieldsByTask = trustRegistrationDetailsFields;
18678
- const directChildFields = requiredFieldsByTask.filter((field) => ["trustType", "legalName", "country", "taxId", "registrationNumber"].includes(field));
18681
+ const requiredFields = props.requiredFields ?? requiredFieldsByTask;
18682
+ const directChildFields = requiredFields.filter((field) => ["trustType", "objectOfTrust", "legalName", "country", "taxId", "registrationNumber"].includes(field));
18679
18683
  const {
18680
18684
  handleChangeFor,
18681
18685
  data,
@@ -18687,14 +18691,17 @@ function TrustRegistrationDetailsComponent(props) {
18687
18691
  } = useForm({
18688
18692
  ...props,
18689
18693
  schema: directChildFields,
18690
- defaultData: props.data,
18694
+ defaultData: {
18695
+ ...props.data,
18696
+ country: country2
18697
+ },
18691
18698
  rules: props.validators || trustRegistrationDetailsValidations,
18692
18699
  fieldProblems: props == null ? void 0 : props.fieldValidationErrors
18693
18700
  });
18694
18701
  const formUtils = formUtilities(props, i18n);
18695
18702
  useEffect(() => {
18696
- var _a2, _b2;
18697
- (_b2 = (_a2 = stateRef.current) == null ? void 0 : _a2.setState) == null ? void 0 : _b2.call(_a2, {
18703
+ var _a2, _b;
18704
+ (_b = (_a2 = stateRef.current) == null ? void 0 : _a2.setState) == null ? void 0 : _b.call(_a2, {
18698
18705
  type: "addToState",
18699
18706
  value: {
18700
18707
  data,
@@ -18703,18 +18710,18 @@ function TrustRegistrationDetailsComponent(props) {
18703
18710
  fieldProblems,
18704
18711
  caller: TRUST_REGISTRATION_DETAILS,
18705
18712
  dataStoreId: TRUST_REGISTRATION_DETAILS,
18706
- schema: requiredFieldsByTask
18713
+ schema: requiredFields
18707
18714
  }
18708
18715
  });
18709
18716
  }, [data, valid, errors]);
18710
- const taxIdProps = getFieldProps(props, taxIdFields);
18711
- useEffect(() => {
18712
- if (!data.country) {
18713
- setData("country", props.country);
18714
- triggerValidation(["country"]);
18717
+ const changeTrustType = (e) => {
18718
+ handleChangeFor("trustType", "blur")(e);
18719
+ if (e.target.value !== TrustTypes.CHARITABLE_TRUST) {
18720
+ setData("objectOfTrust", void 0);
18715
18721
  }
18716
- }, [(_a = props.data) == null ? void 0 : _a.country]);
18717
- const trustTypeOptions2 = getCountrySpecificTrustTypeOptions(props.country) ?? [];
18722
+ };
18723
+ const taxIdProps = getFieldProps(props, taxIdFields);
18724
+ const trustTypeOptions2 = getCountrySpecificTrustTypeOptions(country2) ?? [];
18718
18725
  const registrationNumberProps = getFieldProps(props, businessRegistrationNumberFields);
18719
18726
  return jsxs(Fragment, {
18720
18727
  children: [jsx(StateContextSetter, {
@@ -18732,14 +18739,18 @@ function TrustRegistrationDetailsComponent(props) {
18732
18739
  }), jsx(ContextHelper, {
18733
18740
  content: i18n.get("makeSureToHaveYourTrustDeed")
18734
18741
  }), formUtils.isRequiredField(COUNTRY_FIELD) && jsx(CountryField, {
18735
- data: data.country,
18742
+ data: country2,
18736
18743
  valid: valid == null ? void 0 : valid.country,
18737
18744
  error: formUtils.getErrorMessage(COUNTRY_FIELD, errors, fieldProblems),
18738
18745
  label: formUtils.getLabel(COUNTRY_FIELD, "countryOfEstablishment"),
18739
18746
  readonly: formUtils.isReadOnly(COUNTRY_FIELD),
18740
18747
  allowedCountries: ALLOWED_TRUST_COUNTRIES,
18741
18748
  classNameModifiers: [COUNTRY_FIELD],
18742
- handleChangeFor
18749
+ handleChangeFor: () => (e) => {
18750
+ handleChangeFor("country", "input")(e);
18751
+ if (onCountryChange)
18752
+ onCountryChange(e);
18753
+ }
18743
18754
  }), formUtils.isRequiredField("legalName") && jsx(Field, {
18744
18755
  name: "legalName",
18745
18756
  label: formUtils.getLabel("legalName", "nameOfTrustAgreement"),
@@ -18767,7 +18778,7 @@ function TrustRegistrationDetailsComponent(props) {
18767
18778
  children: (childProps) => jsx(Select, {
18768
18779
  ...childProps,
18769
18780
  name: "trustType",
18770
- onChange: handleChangeFor("trustType", "blur"),
18781
+ onChange: changeTrustType,
18771
18782
  selected: data.trustType,
18772
18783
  items: trustTypeOptions2.map(({
18773
18784
  id: id2,
@@ -18778,15 +18789,32 @@ function TrustRegistrationDetailsComponent(props) {
18778
18789
  })),
18779
18790
  placeholder: i18n.get("trustType")
18780
18791
  })
18792
+ }), formUtils.isRequiredField("objectOfTrust") && jsx(Field, {
18793
+ name: "objectOfTrust",
18794
+ label: formUtils.getLabel("objectOfCharitableTrust"),
18795
+ helper: formUtils.getLabel("pleaseProvideThePurposeOfCharitableTrust"),
18796
+ errorMessage: formUtils.getErrorMessage("objectOfTrust", errors, fieldProblems),
18797
+ isValid: valid.objectOfTrust,
18798
+ children: (childProps) => jsx(InputText, {
18799
+ ...childProps,
18800
+ name: "objectOfTrust",
18801
+ value: data.objectOfTrust,
18802
+ readonly: formUtils.isReadOnly("objectOfTrust"),
18803
+ onInput: handleChangeFor("objectOfTrust", "input"),
18804
+ onBlur: handleChangeFor("objectOfTrust", "blur"),
18805
+ "aria-required": true,
18806
+ "aria-label": formUtils.getLabel("objectOfCharitableTrust"),
18807
+ "aria-invalid": !valid.objectOfTrust
18808
+ })
18781
18809
  }), formUtils.isRequiredField("taxId") && jsx(TaxId, {
18782
18810
  ...taxIdProps,
18783
18811
  dataStoreId: TRUST_REGISTRATION_DETAILS,
18784
- country: props.country
18812
+ country: country2
18785
18813
  }), formUtils.isRequiredField("registrationNumber") && jsx(BusinessRegistrationNumber, {
18786
18814
  ...registrationNumberProps,
18787
18815
  dataStoreId: TRUST_REGISTRATION_DETAILS,
18788
- country: props.country,
18789
- trustType: (_b = props.data) == null ? void 0 : _b.trustType
18816
+ country: country2,
18817
+ trustType: (_a = props.data) == null ? void 0 : _a.trustType
18790
18818
  })]
18791
18819
  })]
18792
18820
  });
@@ -18831,7 +18859,8 @@ function TrustComponent(props) {
18831
18859
  ...trustRegistrationDetailsFormProps,
18832
18860
  heading: i18n.get("registrationDetails"),
18833
18861
  id: trustRegistrationDetailsFormId,
18834
- country: props.country
18862
+ country: props.country,
18863
+ onCountryChange: props.onCountryChange
18835
18864
  })
18836
18865
  }), jsx("div", {
18837
18866
  className: activeForm.formId !== trustRegistrationAddressFormId ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper",
@@ -19463,7 +19492,7 @@ function Summary({
19463
19492
  children: [jsx("h2", {
19464
19493
  className: "adyen-kyc-summary__heading",
19465
19494
  children: i18n.get("summary")
19466
- }), jsx(ReviewAlert, {}), jsx(ErrorPanel, {
19495
+ }), jsx(ErrorPanel, {
19467
19496
  validationErrors: allValidationErrors,
19468
19497
  verificationErrors: allVerificationErrors,
19469
19498
  formUtils,
@@ -19982,6 +20011,9 @@ const additionalIdentityInfo = {
19982
20011
  },
19983
20012
  licenseCardNumber: {
19984
20013
  rule: "requiredIfIdentityTypeIsDriversLicense"
20014
+ },
20015
+ expiryDate: {
20016
+ rule: "expiryDateRequired"
19985
20017
  }
19986
20018
  };
19987
20019
  const idDocument = {
@@ -20819,7 +20851,7 @@ function CompanyDropinComponent({
20819
20851
  onTypeSwitch,
20820
20852
  onChange
20821
20853
  }) {
20822
- var _a, _b;
20854
+ var _a;
20823
20855
  const {
20824
20856
  showToast,
20825
20857
  clearToasts
@@ -21043,12 +21075,12 @@ function CompanyDropinComponent({
21043
21075
  }, []);
21044
21076
  const datasetUtils = datasetUtilities(i18n.locale);
21045
21077
  const formatDataForSummary = (data2, forms2) => {
21046
- var _a2, _b2, _c, _d, _e, _f, _g, _h;
21078
+ var _a2, _b, _c, _d, _e, _f, _g, _h;
21047
21079
  let summaryData = cloneObject(data2);
21048
21080
  if ((_a2 = summaryData == null ? void 0 : summaryData.companyNameAndCountry) == null ? void 0 : _a2.companyCountry) {
21049
21081
  summaryData.companyNameAndCountry.companyCountry = datasetUtils.getCountryName(summaryData.companyNameAndCountry.companyCountry);
21050
21082
  }
21051
- if ((_b2 = summaryData == null ? void 0 : summaryData.companyType) == null ? void 0 : _b2.entityType) {
21083
+ if ((_b = summaryData == null ? void 0 : summaryData.companyType) == null ? void 0 : _b.entityType) {
21052
21084
  const companyType2 = (_c = companyTypes.find((companyType22) => {
21053
21085
  var _a3;
21054
21086
  return companyType22.id === ((_a3 = summaryData.companyType) == null ? void 0 : _a3.entityType);
@@ -21121,7 +21153,7 @@ function CompanyDropinComponent({
21121
21153
  activeForm,
21122
21154
  capabilities,
21123
21155
  data: dataFromResponse,
21124
- country: (_b = data == null ? void 0 : data.companyNameAndCountry) == null ? void 0 : _b.country,
21156
+ country: country2,
21125
21157
  problems,
21126
21158
  handleAddressSearch,
21127
21159
  handleFindAddress,
@@ -21132,44 +21164,7 @@ function CompanyDropinComponent({
21132
21164
  })
21133
21165
  });
21134
21166
  }
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");
21167
+ const logger$9 = createLogger("useLocalStorage");
21173
21168
  function useLocalStorage(key, defaultValue, options) {
21174
21169
  const {
21175
21170
  serializer,
@@ -21190,7 +21185,7 @@ function useLocalStorage(key, defaultValue, options) {
21190
21185
  const res = rawValueRef.current ? parser(rawValueRef.current) : defaultValue;
21191
21186
  return res;
21192
21187
  } catch (err) {
21193
- logger$8.error(err);
21188
+ logger$9.error(err);
21194
21189
  return defaultValue;
21195
21190
  }
21196
21191
  });
@@ -21222,7 +21217,7 @@ function useLocalStorage(key, defaultValue, options) {
21222
21217
  try {
21223
21218
  updateLocalStorage();
21224
21219
  } catch (err) {
21225
- logger$8.error(err);
21220
+ logger$9.error(err);
21226
21221
  }
21227
21222
  }, [value]);
21228
21223
  useEffect(() => {
@@ -21237,7 +21232,7 @@ function useLocalStorage(key, defaultValue, options) {
21237
21232
  setValue(event.newValue ? parser(event.newValue) : void 0);
21238
21233
  }
21239
21234
  } catch (err) {
21240
- logger$8.error(err);
21235
+ logger$9.error(err);
21241
21236
  }
21242
21237
  };
21243
21238
  if (typeof window === "undefined")
@@ -21247,6 +21242,15 @@ function useLocalStorage(key, defaultValue, options) {
21247
21242
  }, [key, syncData]);
21248
21243
  return [value, setValue];
21249
21244
  }
21245
+ 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));
21246
+ const useCanSeeIntro = (legalEntity) => {
21247
+ const {
21248
+ isSettingEnabled
21249
+ } = useSettingsContext();
21250
+ return {
21251
+ canSeeIntro: isSettingEnabled("viewOnboardingGuidance") && isIntroForLE(legalEntity)
21252
+ };
21253
+ };
21250
21254
  const getHasSeenIntroStorageKey = (legalEntityId) => `COMPLETED_INTRO-${legalEntityId}`;
21251
21255
  const useHasSeenIntro = (legalEntityId) => {
21252
21256
  const [hasSeenIntro, setHasSeenIntro] = useLocalStorage(getHasSeenIntroStorageKey(legalEntityId), false);
@@ -21255,16 +21259,52 @@ const useHasSeenIntro = (legalEntityId) => {
21255
21259
  setHasSeenIntro
21256
21260
  };
21257
21261
  };
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) => {
21262
+ const useShouldShowIntro = (legalEntity) => {
21260
21263
  const {
21261
- isSettingEnabled
21262
- } = useSettingsContext();
21264
+ canSeeIntro
21265
+ } = useCanSeeIntro(legalEntity);
21263
21266
  const {
21264
21267
  hasSeenIntro
21265
21268
  } = useHasSeenIntro(legalEntity.id);
21266
- return isSettingEnabled("viewOnboardingGuidance") && guidanceAvailableForGivenLE(legalEntity) && !hasSeenIntro;
21269
+ return canSeeIntro && !hasSeenIntro;
21270
+ };
21271
+ const logger$8 = createLogger("useExemptSettlor");
21272
+ const useExemptSettlor = ({
21273
+ trust,
21274
+ handleGetLegalEntity
21275
+ }) => {
21276
+ const [exemptSettlor, setExemptSettlor] = useState();
21277
+ const updateExemptSettlor = useCallback(async (trustLE) => {
21278
+ const exemptSettlorAssociation = getOwnEntityAssociations(trustLE).find((association) => association.type === TrustMemberTypes.SETTLOR && Boolean(association.settlorExemptionReason));
21279
+ const exemptSettlorLE = (exemptSettlorAssociation == null ? void 0 : exemptSettlorAssociation.legalEntityId) ? await handleGetLegalEntity(exemptSettlorAssociation.legalEntityId) : void 0;
21280
+ setExemptSettlor(exemptSettlorLE);
21281
+ }, [handleGetLegalEntity]);
21282
+ useEffect(() => {
21283
+ updateExemptSettlor(trust).catch(logger$8.error);
21284
+ }, [trust, updateExemptSettlor]);
21285
+ return exemptSettlor;
21267
21286
  };
21287
+ function useSalesChannelsSettings() {
21288
+ const {
21289
+ isSettingEnabled
21290
+ } = useSettingsContext();
21291
+ return useMemo(() => {
21292
+ const settings = [];
21293
+ if (isSettingEnabled(SettingNames.RequirePciSignEcommerce)) {
21294
+ settings.push("eCommerce");
21295
+ }
21296
+ if (isSettingEnabled(SettingNames.RequirePciSignPos)) {
21297
+ settings.push("pos");
21298
+ }
21299
+ if (isSettingEnabled(SettingNames.RequirePciSignEcomMoto)) {
21300
+ settings.push("ecomMoto");
21301
+ }
21302
+ if (isSettingEnabled(SettingNames.RequirePciSignPosMoto)) {
21303
+ settings.push("posMoto");
21304
+ }
21305
+ return settings;
21306
+ }, [isSettingEnabled]);
21307
+ }
21268
21308
  const downloadFile = async (base64, filename) => {
21269
21309
  saveBlobAsFile(base64ToBlob(base64), filename);
21270
21310
  };
@@ -21601,15 +21641,12 @@ const TaskItemStatus = ({
21601
21641
  status,
21602
21642
  downloadHandler
21603
21643
  }) => {
21604
- const {
21605
- isReview
21606
- } = useCoreContext();
21607
21644
  const {
21608
21645
  i18n
21609
21646
  } = useI18nContext();
21610
21647
  const handleDownloadClick = (e) => {
21611
21648
  e.stopPropagation();
21612
- downloadHandler();
21649
+ downloadHandler == null ? void 0 : downloadHandler();
21613
21650
  };
21614
21651
  switch (status) {
21615
21652
  case TaskStatus.DOWNLOAD:
@@ -21666,12 +21703,17 @@ const TaskItemStatus = ({
21666
21703
  icon: "loading",
21667
21704
  text: i18n.get("removing")
21668
21705
  });
21706
+ case "review":
21707
+ return jsx("span", {
21708
+ className: "adl-task-status-details-required",
21709
+ children: i18n.get("verify")
21710
+ });
21669
21711
  case TaskStatus.DETAILS_REQUIRED:
21670
21712
  case TaskStatus.EMPTY:
21671
21713
  default:
21672
21714
  return jsx("span", {
21673
21715
  className: "adl-task-status-details-required",
21674
- children: isReview ? i18n.get("verify") : i18n.get("add")
21716
+ children: i18n.get("add")
21675
21717
  });
21676
21718
  }
21677
21719
  };
@@ -22210,7 +22252,7 @@ const DecisionMakersComponent = ({
22210
22252
  entityLabel: roleType,
22211
22253
  status: iconStatus(uniqueDecisionMakersPerType(roleType), min, max)
22212
22254
  }, roleType))
22213
- }), jsx(ReviewAlert, {}), jsx(ContextGuidance, {
22255
+ }), jsx(ContextGuidance, {
22214
22256
  page: "Decision makers",
22215
22257
  title: i18n.get("whatIsTheDifferenceBetweenTheseRoles"),
22216
22258
  content: jsx("ul", {
@@ -22465,9 +22507,9 @@ const getIntroDescriptionTranslationKeys = (translations, factors) => {
22465
22507
  return (keysWithL.length ? keysWithL : keys).sort((a, b) => Number(a.charAt(a.length - 1)) - Number(b.charAt(b.length - 1)));
22466
22508
  };
22467
22509
  const TaskIntro = ({
22468
- index,
22469
22510
  intro,
22470
- legalEntityType
22511
+ legalEntityType,
22512
+ number: number2
22471
22513
  }) => {
22472
22514
  const {
22473
22515
  i18n
@@ -22485,7 +22527,7 @@ const TaskIntro = ({
22485
22527
  return jsxs(Fragment, {
22486
22528
  children: [jsx("div", {
22487
22529
  className: "adyen-kyc-task-intros__number",
22488
- children: index + 1
22530
+ children: number2
22489
22531
  }), jsx("div", {
22490
22532
  className: "adyen-kyc-task-intros__title",
22491
22533
  children: i18n.get(`taskIntro${toPascalCase(intro)}Title`)
@@ -22503,7 +22545,7 @@ const TaskIntro = ({
22503
22545
  };
22504
22546
  const taskIntrosInOrder = [
22505
22547
  TaskTypes.COMPANY,
22506
- TaskTypes.DECISION_MAKER_OVERVIEW,
22548
+ TaskTypes.DECISION_MAKER,
22507
22549
  TaskTypes.INDIVIDUAL,
22508
22550
  // TaskTypes.PAYIN,
22509
22551
  TaskTypes.PAYOUT
@@ -22542,9 +22584,10 @@ const TaskIntros = ({
22542
22584
  type: "button"
22543
22585
  })
22544
22586
  }), jsx(TaskIntro, {
22545
- index: activeIndex,
22546
22587
  intro: allIntros[activeIndex],
22547
- legalEntityType
22588
+ legalEntityType,
22589
+ number: activeIndex > 0 && activeIndex < allIntros.length - 1 ? activeIndex : void 0
22590
+ // prologue and epilogue should not be numbered
22548
22591
  }, allIntros[activeIndex]), jsxs("div", {
22549
22592
  className: "adyen-kyc-task-intros__nav",
22550
22593
  children: [jsx(Button, {
@@ -22731,9 +22774,8 @@ function TaskListComponent({
22731
22774
  isExperimentEnabled
22732
22775
  } = useExperimentsContext();
22733
22776
  const {
22734
- isSettingEnabled
22735
- } = useSettingsContext();
22736
- const isGuidanceEnabled = isSettingEnabled("viewOnboardingGuidance");
22777
+ canSeeIntro
22778
+ } = useCanSeeIntro(legalEntityResponse);
22737
22779
  const hasTaskOfGroupAccountDetails = tasks.some((task) => LEGAL_ENTITY_BASE_TASKS.includes(task));
22738
22780
  const hasTrust = isExperimentEnabled("EnableTrustFlow") && (accountHolder2 === "aTrust" || isPartOfTrustFromLegalEntity(legalEntityResponse));
22739
22781
  const hasContractTasks = tasks.some((task) => CONTRACT_TASKS.includes(task));
@@ -22765,7 +22807,7 @@ function TaskListComponent({
22765
22807
  const companyTaskDescriptionKey = isReview ? "businessAccountDetailsDescriptionReview" : "businessAccountDetailsDescription";
22766
22808
  const payoutTaskDescriptionKey = isReview ? "payoutAccountsDescriptionReview" : "payoutAccountsDescription";
22767
22809
  return jsxs("div", {
22768
- children: [isGuidanceEnabled && guidanceAvailableForGivenLE(legalEntityResponse) && jsx("div", {
22810
+ children: [canSeeIntro && jsx("div", {
22769
22811
  className: "adyen-task-list__nav",
22770
22812
  children: jsx(Button, {
22771
22813
  label: i18n.get("goToIntro"),
@@ -22776,7 +22818,7 @@ function TaskListComponent({
22776
22818
  }), jsxs("div", {
22777
22819
  children: [hasTaskOfGroupAccountDetails && jsxs(TaskListGroup, {
22778
22820
  title: isCompany ? i18n.get(companyTaskDescriptionKey) : i18n.get("accountDetailsDescription"),
22779
- children: [jsx(ReviewAlert, {}), tasks.includes(TaskTypes.INDIVIDUAL) && jsx(TaskListItem, {
22821
+ children: [tasks.includes(TaskTypes.INDIVIDUAL) && jsx(TaskListItem, {
22780
22822
  onNavigateToTask: handleOnNavigateToTaskIndividual,
22781
22823
  icon: "decision-maker",
22782
22824
  title: hasTrust ? i18n.get("trusteePersonalDetails") : i18n.get("personalDetails"),
@@ -23098,7 +23140,7 @@ const TrustMembersOverview = ({
23098
23140
  entityLabel: label,
23099
23141
  status: iconStatus(trustMembersWithOneOfGivenRoles(roleTypes).length, min, max)
23100
23142
  }, label))
23101
- }), jsx(ReviewAlert, {}), jsx(ContextGuidance, {
23143
+ }), jsx(ContextGuidance, {
23102
23144
  page: "Trust members",
23103
23145
  title: i18n.get("whatIsTheDifferenceBetweenTheseRoles"),
23104
23146
  content: jsx("ul", {
@@ -23171,6 +23213,17 @@ const TrustMembersOverview = ({
23171
23213
  })
23172
23214
  });
23173
23215
  };
23216
+ const omitMaskedFieldsIfUnchanged = (maskedFields, dataSubmitted, savedData) => {
23217
+ const filtered = cloneObject(dataSubmitted);
23218
+ maskedFields.forEach((maskedField) => {
23219
+ const prevValue = getProp(savedData, maskedField);
23220
+ const newValue = getProp(dataSubmitted, maskedField);
23221
+ if (prevValue === newValue && isValueMasked(newValue)) {
23222
+ deleteProp(maskedField, filtered);
23223
+ }
23224
+ });
23225
+ return filtered;
23226
+ };
23174
23227
  const _toast = "";
23175
23228
  function Toast({
23176
23229
  label,
@@ -23466,13 +23519,6 @@ function IndividualDropinComponent({
23466
23519
  }) => type);
23467
23520
  return !doArraysMatch(existingRoles, newRoles);
23468
23521
  };
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
23522
  const attachAssociationToParentLegalEntity = async ({
23477
23523
  legalEntity,
23478
23524
  dataSubmitted
@@ -23497,10 +23543,9 @@ function IndividualDropinComponent({
23497
23543
  const onSubmit = async () => {
23498
23544
  var _a2, _b2;
23499
23545
  setLoadingStatus("loading");
23500
- const dataSubmitted = data;
23546
+ const dataSubmitted = omitMaskedFieldsIfUnchanged(individualMaskedFields, data, dataFromResponse);
23501
23547
  try {
23502
- omitMaskedFieldsIfUnchanged(individualMaskedFields, dataSubmitted, dataFromResponse);
23503
- let legalEntity = mapIndividualToLegalEntity(dataSubmitted);
23548
+ const legalEntity = mapIndividualToLegalEntity(dataSubmitted);
23504
23549
  const idDocumentType = (_a2 = idDocumentTypeOptions.find(({
23505
23550
  id: id2
23506
23551
  }) => {
@@ -23515,18 +23560,18 @@ function IndividualDropinComponent({
23515
23560
  }
23516
23561
  });
23517
23562
  legalEntity.entityAssociations = filterOutUnwantedAssociationsIfRootLE(taskType, legalEntityResponse, dataSubmitted.personalDetails.accountHolder);
23518
- legalEntity = await submitLegalEntity({
23563
+ const createdLegalEntity = await submitLegalEntity({
23519
23564
  dataSubmitted,
23520
23565
  legalEntity,
23521
23566
  idDocumentType
23522
23567
  });
23523
23568
  await submitDocuments({
23524
23569
  forms,
23525
- legalEntity,
23570
+ legalEntity: createdLegalEntity,
23526
23571
  dataSubmitted
23527
23572
  });
23528
23573
  await attachAssociationToParentLegalEntity({
23529
- legalEntity,
23574
+ legalEntity: createdLegalEntity,
23530
23575
  dataSubmitted
23531
23576
  });
23532
23577
  if (taskType === TaskTypes.INDIVIDUAL) {
@@ -23868,6 +23913,7 @@ function PayoutDetailsDropinComponent({
23868
23913
  const [bankAccountCountry2, setBankAccountCountry] = useState(defaultPayoutCountry);
23869
23914
  const existingPayoutDetails = transferInstrument ? mapTransferInstrumentToPayoutAccount(transferInstrument) : void 0;
23870
23915
  const [documents2, setDocuments] = useState();
23916
+ const [newTransferInstrumentId, setNewTransferInstrumentId] = useState();
23871
23917
  const fallbackCurrency = (_a = currencyByCountry[defaultPayoutCountry]) == null ? void 0 : _a[0];
23872
23918
  const accountHolderName = accountHolder2 || getLegalEntityNameBasedOnType(legalEntityResponse);
23873
23919
  const instantVerificationEnabled = Boolean(!transferInstrument && handleGetBankVerificationVendors);
@@ -24022,17 +24068,10 @@ function PayoutDetailsDropinComponent({
24022
24068
  }
24023
24069
  }
24024
24070
  };
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
24071
  const onSubmit = async () => {
24033
24072
  var _a2;
24034
24073
  setLoadingStatus("loading");
24035
- const dataSubmitted = data;
24074
+ const dataSubmitted = cloneObject(data);
24036
24075
  dataSubmitted.payoutAccountDetails.currency = dataSubmitted.payoutAccountDetails.currency ?? fallbackCurrency;
24037
24076
  if (defaultPayoutCountry === CountryCodes.Sweden && "iban" in dataSubmitted.payoutAccountDetails) {
24038
24077
  dataSubmitted.payoutAccountDetails.currency = Currency.EUR;
@@ -24046,15 +24085,16 @@ function PayoutDetailsDropinComponent({
24046
24085
  }
24047
24086
  };
24048
24087
  userEvents.addEvent("Provided payout details", event);
24049
- omitMaskedFieldsIfUnchanged(maskedPayoutFields, dataSubmitted.payoutAccountDetails, existingPayoutDetails == null ? void 0 : existingPayoutDetails.payoutAccountDetails);
24088
+ dataSubmitted.payoutAccountDetails = omitMaskedFieldsIfUnchanged(maskedPayoutFields, dataSubmitted.payoutAccountDetails, existingPayoutDetails == null ? void 0 : existingPayoutDetails.payoutAccountDetails);
24050
24089
  let transferInstrument2 = mapPayoutAccountToTransferInstrument({
24051
24090
  data: dataSubmitted,
24052
24091
  legalEntity: legalEntityResponse
24053
24092
  });
24054
- const transferInstrumentId = (_a2 = existingPayoutDetails == null ? void 0 : existingPayoutDetails.payoutAccountDetails) == null ? void 0 : _a2.transferInstrumentId;
24093
+ const transferInstrumentId = ((_a2 = existingPayoutDetails == null ? void 0 : existingPayoutDetails.payoutAccountDetails) == null ? void 0 : _a2.transferInstrumentId) ?? newTransferInstrumentId;
24055
24094
  try {
24056
24095
  if (!transferInstrumentId) {
24057
24096
  transferInstrument2 = await handleCreateTransferInstrument(transferInstrument2);
24097
+ setNewTransferInstrumentId(transferInstrument2.id);
24058
24098
  } else {
24059
24099
  transferInstrument2 = await handleUpdateTransferInstrument(drop("id").from(transferInstrument2), transferInstrumentId);
24060
24100
  }
@@ -25757,8 +25797,7 @@ function withFormComposer(WrappedComponent, {
25757
25797
  } = useI18nContext();
25758
25798
  const {
25759
25799
  contextCountry: initialContextCountry,
25760
- setContextCountry: setInitialContextCountry,
25761
- isReview
25800
+ setContextCountry: setInitialContextCountry
25762
25801
  } = useCoreContext();
25763
25802
  const {
25764
25803
  loadingContext
@@ -25981,7 +26020,7 @@ function withFormComposer(WrappedComponent, {
25981
26020
  }
25982
26021
  });
25983
26022
  };
25984
- const nextButtonText = isReview ? isFormSummaryStep(activeForm) ? i18n.get("confirm") : i18n.get("next") : isFinalStep ? i18n.get(submitButtonLabel ?? "submit") : i18n.get("next");
26023
+ const nextButtonText = isFinalStep ? i18n.get(submitButtonLabel ?? "submit") : i18n.get("next");
25985
26024
  useEffect(() => {
25986
26025
  props.eventEmitter.on("next", handleNextClick);
25987
26026
  props.eventEmitter.on("back", handleBackClick);
@@ -26367,6 +26406,12 @@ const rules = ({
26367
26406
  if (COUNTRIES_THAT_USE_REGISTRATION_NUMBER.includes(country2)) {
26368
26407
  return "REQUIRED";
26369
26408
  }
26409
+ },
26410
+ trustTypeHasDescription: () => {
26411
+ var _a;
26412
+ if (((_a = data == null ? void 0 : data.trustRegistrationDetails) == null ? void 0 : _a.trustType) === TrustTypes.CHARITABLE_TRUST) {
26413
+ return "REQUIRED";
26414
+ }
26370
26415
  }
26371
26416
  });
26372
26417
  const TrustWithFormComposer = withFormComposer(TrustComponent, {
@@ -26484,7 +26529,7 @@ function TrustDropinComponent(props) {
26484
26529
  await props.handleUpdateLegalEntity(updatedParentLegalEntity, parentLegalEntity.id);
26485
26530
  };
26486
26531
  const formatDataForSummary = (data2, forms) => {
26487
- var _a, _b, _c, _d, _e, _f, _g;
26532
+ var _a, _b, _c, _d, _e, _f, _g, _h;
26488
26533
  let summaryData = cloneObject(data2);
26489
26534
  let trustCountry;
26490
26535
  let trustType2;
@@ -26502,13 +26547,14 @@ function TrustDropinComponent(props) {
26502
26547
  nameOfTrustAgreement: (_d = data2.trustRegistrationDetails) == null ? void 0 : _d.legalName,
26503
26548
  countryOfEstablishment: trustCountry,
26504
26549
  typeOfTrustAgreement: trustType2,
26505
- taxId: (_e = data2.trustRegistrationDetails) == null ? void 0 : _e.taxId
26550
+ objectOfTrust: (_e = data2.trustRegistrationDetails) == null ? void 0 : _e.objectOfTrust,
26551
+ taxId: (_f = data2.trustRegistrationDetails) == null ? void 0 : _f.taxId
26506
26552
  };
26507
- if ((_f = summaryData == null ? void 0 : summaryData.trustRegistrationAddress) == null ? void 0 : _f.registrationAddress) {
26553
+ if ((_g = summaryData == null ? void 0 : summaryData.trustRegistrationAddress) == null ? void 0 : _g.registrationAddress) {
26508
26554
  summaryData.trustRegistrationAddress.hasInnerForms = true;
26509
26555
  summaryData.trustRegistrationAddress.registrationAddress = mapAddressLabels(summaryData == null ? void 0 : summaryData.trustRegistrationAddress.registrationAddress, datasetUtils);
26510
26556
  }
26511
- if ((_g = summaryData == null ? void 0 : summaryData.trustRegistrationAddress) == null ? void 0 : _g.operationalAddress) {
26557
+ if ((_h = summaryData == null ? void 0 : summaryData.trustRegistrationAddress) == null ? void 0 : _h.operationalAddress) {
26512
26558
  summaryData.trustRegistrationAddress.operationalAddress = mapAddressLabels(summaryData == null ? void 0 : summaryData.trustRegistrationAddress.operationalAddress, datasetUtils);
26513
26559
  }
26514
26560
  if (isDocumentsRequired2(forms)) {
@@ -26572,7 +26618,7 @@ function DropinComposerComponent({
26572
26618
  onNavigate = noop,
26573
26619
  ...args
26574
26620
  }) {
26575
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
26621
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
26576
26622
  const {
26577
26623
  contextCountry,
26578
26624
  accountHolder: accountHolder2
@@ -26592,7 +26638,7 @@ function DropinComposerComponent({
26592
26638
  } = useToastContext();
26593
26639
  const [isLoadingConfiguration, setIsLoadingConfiguration] = useState(false);
26594
26640
  const [pollingId, setPollingId] = useState(null);
26595
- const showIntro = useShouldShowGuidanceIntros(legalEntityResponse);
26641
+ const showIntro = useShouldShowIntro(legalEntityResponse);
26596
26642
  const {
26597
26643
  setHasSeenIntro
26598
26644
  } = useHasSeenIntro(legalEntityResponse.id);
@@ -27333,7 +27379,7 @@ function DropinComposerComponent({
27333
27379
  onSubmit: componentOnSubmit,
27334
27380
  handleHomeClick: navigateBack,
27335
27381
  homeButtonLabel: i18n.get("saveAndGoToOverview"),
27336
- country: ((_h = trust == null ? void 0 : trust.trust) == null ? void 0 : _h.registeredAddress.country) ?? rootLegalEntityCountry,
27382
+ 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
27383
  handleAddressSearch: args == null ? void 0 : args.handleAddressSearch,
27338
27384
  handleFindAddress: args == null ? void 0 : args.handleFindAddress
27339
27385
  });
@@ -27378,13 +27424,13 @@ function DropinComposerComponent({
27378
27424
  parentLegalEntity: legalEntity,
27379
27425
  legalEntityResponse: solePropietor,
27380
27426
  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],
27427
+ problems: (_j = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _j[solePropietor == null ? void 0 : solePropietor.id],
27382
27428
  onChange: componentOnChange,
27383
27429
  eventEmitter,
27384
27430
  onSubmit: componentOnSubmit,
27385
27431
  handleHomeClick: navigateBack,
27386
27432
  homeButtonLabel: i18n.get("saveAndGoToOverview"),
27387
- country: (_k = (_j = legalEntity == null ? void 0 : legalEntity.individual) == null ? void 0 : _j.residentialAddress) == null ? void 0 : _k.country,
27433
+ country: (_l = (_k = legalEntity == null ? void 0 : legalEntity.individual) == null ? void 0 : _k.residentialAddress) == null ? void 0 : _l.country,
27388
27434
  handleAddressSearch: args == null ? void 0 : args.handleAddressSearch,
27389
27435
  handleFindAddress: args == null ? void 0 : args.handleFindAddress
27390
27436
  });
@@ -27581,7 +27627,8 @@ const getTransferInstrument = async (context, transferInstrumentId) => {
27581
27627
  path: `${legalEntityId}/transferInstruments/${transferInstrumentId}`,
27582
27628
  headers: {
27583
27629
  Authorization: `Bearer ${sdkToken}`,
27584
- Origin: window.location.origin
27630
+ Origin: window.location.origin,
27631
+ "Content-Type": "application/json"
27585
27632
  }
27586
27633
  });
27587
27634
  };
@@ -27769,7 +27816,8 @@ function TransferInstrumentComponent({
27769
27816
  onChange,
27770
27817
  onSubmit,
27771
27818
  createTrustedTransferInstrument: createTrustedTransferInstrument2,
27772
- handleBankVerificationError: handleBankVerificationError2
27819
+ handleBankVerificationError: handleBankVerificationError2,
27820
+ taskType: TaskTypes.PAYOUT
27773
27821
  }) : null;
27774
27822
  }
27775
27823
  const componentsMap = {
@@ -28231,8 +28279,7 @@ const ConfigurationApiProvider = ({
28231
28279
  const logger$2 = createLogger("CoreProvider");
28232
28280
  const CoreProvider = ({
28233
28281
  contextCountry: initialContextCountry,
28234
- children,
28235
- isReview
28282
+ children
28236
28283
  }) => {
28237
28284
  const {
28238
28285
  loadingContext
@@ -28260,14 +28307,13 @@ const CoreProvider = ({
28260
28307
  checkIfCountryIsAllowed().catch(logger$2.warn);
28261
28308
  }, [contextCountry, getAllowedCountries2]);
28262
28309
  const contextValue = useMemo(() => ({
28263
- isReview,
28264
28310
  setContextCountry,
28265
28311
  contextCountry,
28266
28312
  setAccountHolder,
28267
28313
  accountHolder: accountHolder2,
28268
28314
  setAccountFormat,
28269
28315
  accountFormat
28270
- }), [isReview, contextCountry, accountHolder2, accountFormat]);
28316
+ }), [contextCountry, accountHolder2, accountFormat]);
28271
28317
  return jsx(CoreContext.Provider, {
28272
28318
  value: contextValue,
28273
28319
  children
@@ -28510,7 +28556,6 @@ class UIElement extends BaseElement {
28510
28556
  rootLegalEntityId: getRootLegalEntityId(this.props.componentProps),
28511
28557
  children: jsx(CoreProvider, {
28512
28558
  contextCountry: this.props.contextCountry,
28513
- isReview: this.props.isReview,
28514
28559
  children: jsx(I18nProvider, {
28515
28560
  locale: this.props.locale,
28516
28561
  customTranslations: this.props.customTranslations,