@adyen/kyc-components 2.16.1 → 2.17.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.
- package/dist/es/adyen-kyc-components.es.js +1068 -450
- package/dist/style.css +303 -261
- package/dist/types/components/BusinessTypeSelection/BusinessTypeSelection.d.ts +16 -0
- package/dist/types/components/BusinessTypeSelection/types.d.ts +34 -0
- package/dist/types/components/Company/types.d.ts +1 -0
- package/dist/types/components/CompanyNameAndCountry/types.d.ts +1 -0
- package/dist/types/components/Dropins/CompanyDropin/types.d.ts +1 -1
- package/dist/types/components/PayoutDetails/component/PayoutDetailsComponent.d.ts +2 -2
- package/dist/types/components/TaskList/component/TaskListItem.d.ts +1 -1
- package/dist/types/components/TaskList/types.d.ts +2 -0
- package/dist/types/components/internal/AccountHolder/types.d.ts +2 -1
- package/dist/types/components/internal/Address/types.d.ts +0 -2
- package/dist/types/components/internal/Address/utils.d.ts +1 -1
- package/dist/types/components/internal/Alert/Alert.d.ts +1 -3
- package/dist/types/components/internal/Alert/index.d.ts +1 -1
- package/dist/types/components/internal/Alert/types.d.ts +1 -0
- package/dist/types/components/internal/FormFields/RadioGroupCard/RadioCardSelect.d.ts +1 -1
- package/dist/types/components/internal/FormFields/RadioGroupCard/types.d.ts +2 -2
- package/dist/types/core/Context/CoreProvider.d.ts +2 -1
- package/dist/types/core/Context/ExperimentContext/types.d.ts +2 -1
- package/dist/types/core/Services/componentApi/get-supported-countries.d.ts +3 -0
- package/dist/types/core/errorMapping.d.ts +2 -0
- package/dist/types/core/hooks/useAccountHolder.d.ts +2 -0
- package/dist/types/core/hooks/useAllowedCountries.d.ts +2 -0
- package/dist/types/core/hooks/useBusinessSetup.d.ts +16 -0
- package/dist/types/core/hooks/useBusinessTypeSelection.d.ts +2 -0
- package/dist/types/core/hooks/useDataMissingRemediations.d.ts +18 -0
- package/dist/types/core/hooks/useEnableNewEntryFlow.d.ts +1 -0
- package/dist/types/language/config.d.ts +43 -0
- package/dist/types/utils/decision-maker-roles.d.ts +1 -1
- package/dist/types/utils/entity-status-util.d.ts +2 -2
- package/dist/types/utils/trust-util.d.ts +1 -1
- package/package.json +3 -2
- package/dist/types/openbankingsdk/OpenBankingSDK.d.ts +0 -14
- package/dist/types/openbankingsdk/types.d.ts +0 -22
|
@@ -5,6 +5,7 @@ import cx from "classnames";
|
|
|
5
5
|
import { jsx, jsxs, Fragment } from "preact/jsx-runtime";
|
|
6
6
|
import { useId, useRef as useRef$1, useMemo as useMemo$1, forwardRef, memo } from "preact/compat";
|
|
7
7
|
import { debounce, range, uniqueId } from "lodash";
|
|
8
|
+
import OpenBankingSDK from "@adyen/openbankingsdk";
|
|
8
9
|
const ConfigurationApiContext = createContext(void 0);
|
|
9
10
|
const useConfigurationApi = () => {
|
|
10
11
|
const configurationApi = useContext(ConfigurationApiContext);
|
|
@@ -187,7 +188,7 @@ const industryExemption = "Industry exemption";
|
|
|
187
188
|
const validationPleaseEnterAValidRegistrationNumber = "Please enter a valid company registration number";
|
|
188
189
|
const validationPleaseEnterAValidRegistrationNumberWithFormat = "Please enter a valid company registration number. Expected format: %{format}";
|
|
189
190
|
const validationPleaseEnterAValidVatNumber = "Please enter a valid Tax id number";
|
|
190
|
-
const validationPleaseEnterAValidVatNumberWithFormat = "Please enter a valid
|
|
191
|
+
const validationPleaseEnterAValidVatNumberWithFormat = "Please enter a valid VAT number. Expected format: %{format}";
|
|
191
192
|
const validationPleaseEnterAValidTaxIdNumberWithFormat = "Please enter a valid Tax id number. Expected format: %{format}";
|
|
192
193
|
const validationPleaseEnterAValidIRDNumber = "Please enter a valid IRD number. Expected format: 8 - 9 digits";
|
|
193
194
|
const aValidAbnShouldBe11Digits = "A valid ABN should be 11 digits.";
|
|
@@ -228,6 +229,7 @@ const byClickingSubmitReview = "By clicking 'Submit review', you confirm that al
|
|
|
228
229
|
const nameAndCountry = "Name and country";
|
|
229
230
|
const companyCountry = "Where is your business located?";
|
|
230
231
|
const accountDetailsDescription = "Provide a few details about you to start accepting live payments.";
|
|
232
|
+
const provideFewDetailsAboutYourself = "Provide a few details about yourself.";
|
|
231
233
|
const provideDetails = "Provide details";
|
|
232
234
|
const payoutAccountsDescription = "To set up your account, let us know where to send your payouts.";
|
|
233
235
|
const payoutAccountsDescriptionReview = "In order to ensure that your payout data is accurate, please verify the following details.";
|
|
@@ -453,7 +455,7 @@ const ICO = "IČO (Identifikační číslo)";
|
|
|
453
455
|
const handelsregisternummer = "Handelsregisternummer";
|
|
454
456
|
const NumeroDeTVA = "Numéro de TVA";
|
|
455
457
|
const organisasjonsnummer = "Organisasjonsnummer";
|
|
456
|
-
const mvanummer = "MVA
|
|
458
|
+
const mvanummer = "MVA-nummer";
|
|
457
459
|
const verificationErrorMessage = "Some information couldn’t be verified. Click to see what needs to be adjusted.";
|
|
458
460
|
const remediationFormErrorMessage = "Some information couldn’t be verified. Information in this form may need to be adjusted.";
|
|
459
461
|
const youHaveUnsavedChanges = "You have unsaved changes";
|
|
@@ -585,9 +587,36 @@ const providePageWithPhotoAndCode = "Provide the page with the photo, including
|
|
|
585
587
|
const constitutionalDocument = "Constitutional document";
|
|
586
588
|
const solePropDetails = "Sole proprietor details";
|
|
587
589
|
const soleProprietorDetails = "Sole proprietor details";
|
|
590
|
+
const soleProprietorshipDetails = "Sole proprietorship details";
|
|
588
591
|
const selectAccountHolder = "Select account holder";
|
|
589
592
|
const nameOfBankAccountHolder = "We need to know about the bank account where you want to receive your payouts. What is the name of the account holder of that bank account?";
|
|
593
|
+
const whatBestDescribesYourBusinessSetup = "What best describes your business setup?";
|
|
594
|
+
const whichLegalArrangementDoesYourBusinessHave = "Which legal arrangement does your business have?";
|
|
595
|
+
const sorryWeCantSetUpAnAccountForYou = "Sorry, we can’t set up an account for you";
|
|
596
|
+
const changeYourBusinessSetup = "Change your business setup?";
|
|
597
|
+
const someInformationWillNotBeSaved = "Some information that you entered previously will not be saved. ";
|
|
598
|
+
const yesChange = "Yes, change";
|
|
599
|
+
const youAreNotSoleProprietorAndUseBankAccount = "You’re not a sole proprietor and you use a personal bank account.";
|
|
600
|
+
const soleProprietorship = "Sole proprietorship";
|
|
601
|
+
const youAreRegisteredSoleProprietorAndUseBankAccount = "You’re a registered sole proprietor and you use a bank account in your name or sole proprietorship’s name.";
|
|
602
|
+
const company = "Company";
|
|
603
|
+
const youUseCompanyBankAccount = "You use a company bank account.";
|
|
604
|
+
const trust = "Trust";
|
|
605
|
+
const trustPartnershipOrAssociation = "Trust, partnership, or association";
|
|
606
|
+
const whatTypeOfTrusteeAreYou = "What type of trustee are you?";
|
|
607
|
+
const youAreIndividualOrCompanyAndUseBankAccountInNameOfTrustPartnershipOrAssociation = "You’re an individual or company, and you use a bank account in the name of a trust, partnership, or association.";
|
|
608
|
+
const individualTrustee = "Individual trustee";
|
|
609
|
+
const companyTrustee = "Company trustee";
|
|
610
|
+
const association = "Association";
|
|
611
|
+
const partnership = "Partnership";
|
|
612
|
+
const youAreTrusteeManagingTheTrustForBeneficiaries = "You’re a trustee managing the trust for beneficiaries.";
|
|
613
|
+
const jointlyOwnedBusinessWhereTwoOrMorePeopleOperateAndShareProfits = "A jointly owned business where two or more people operate and share profits.";
|
|
614
|
+
const groupOfPeopleActingTogetherForNonCommercialPurpose = "A group of people acting together for a non-commercial purpose.";
|
|
615
|
+
const ourFinancialServicesAreNotAvailableYetForPartnershipsAndAssociations = "Our financial services aren’t available yet for partnerships and associations";
|
|
616
|
+
const needHelpYouCanAlwaysReachOutToCustomerSupport = "Need help? You can always reach out to customer support.";
|
|
590
617
|
const myName = "My name";
|
|
618
|
+
const setUpYourAccount = "Set up your account";
|
|
619
|
+
const yourBusinessSetup = "Your business setup: %{businessSetup}";
|
|
591
620
|
const myNameDescription = "It’s a personal bank account held in my own name";
|
|
592
621
|
const mySoleProprietorName = "My sole proprietor name";
|
|
593
622
|
const mySoleProprietorNameDescription = "The account is in my name, but I am registered as a sole proprietor, sole trader, or freelancer";
|
|
@@ -600,6 +629,12 @@ const aPartnershipDescription = "The account belongs to a jointly owned business
|
|
|
600
629
|
const anAssociation = "An association";
|
|
601
630
|
const anAssociationDescription = "The account belongs to a group of people acting together for a specific non-commercial purpose";
|
|
602
631
|
const legalNameOfSoleProprietor = "Legal name of sole proprietor";
|
|
632
|
+
const legalNameOfSoleProprietorship = "Legal name of sole proprietorship";
|
|
633
|
+
const letUsKnowTheBankAccountToSendReceiveFunds = "Let us know the bank account you use to send or receive funds.";
|
|
634
|
+
const bankAccount = "Bank account";
|
|
635
|
+
const bankAccountDetails = "Bank account details";
|
|
636
|
+
const addExtraBankAccount = "Add extra bank account";
|
|
637
|
+
const addAndVerifyYourBankDetails = "Add and verify your bank account details";
|
|
603
638
|
const failedToFetchSoleProp = "Failed to fetch the sole propietor";
|
|
604
639
|
const uniqueIdentificationCode = "Unique identification code (ЕИК/UIC)";
|
|
605
640
|
const identifikacionenNomerDDS = "VAT number (ДДС)";
|
|
@@ -756,6 +791,7 @@ const passportPhotoPage = "Passport photo page";
|
|
|
756
791
|
const residencePermitBack = "Residence permit (back)";
|
|
757
792
|
const residencePermitFront = "Residence permit (front)";
|
|
758
793
|
const manualUpload = "Manual upload";
|
|
794
|
+
const missingMultipleDecisionMakers = "You haven't added all required decision-makers";
|
|
759
795
|
const legalCompanyName = "Legal name of the company";
|
|
760
796
|
const legalCompanyName__helperText = "Enter the name exactly as it is on your company's official registration documents.";
|
|
761
797
|
const legalCompanyName__helperText__AU = "Enter the name exactly as it is on your Australian Securities and Investment Commission's (ASIC).";
|
|
@@ -979,6 +1015,10 @@ const errorMessage_1_7019 = "The bank document wasn't issued in the past 12 mont
|
|
|
979
1015
|
const errorMessage_1_7020 = "The bank name didn't match the one on the bank document.";
|
|
980
1016
|
const errorMessage_1_7021 = "The bank document didn't show an official bank logo.";
|
|
981
1017
|
const errorMessage_1_7022 = "The bank document didn't show an official bank stamp.";
|
|
1018
|
+
const errorMessage_2_8064 = "UBO through ownership was missing.";
|
|
1019
|
+
const errorMessage_2_8067 = "Signatory was missing.";
|
|
1020
|
+
const errorMessage_2_8189 = "UBO through control was missing.";
|
|
1021
|
+
const errorMessage_2_8193 = "Director was missing.";
|
|
982
1022
|
const errorMessage_3_10 = "Review of data is required";
|
|
983
1023
|
const remediationMessage_1_100 = "No remediation possible";
|
|
984
1024
|
const remediationMessage_1_101 = "Contact Support";
|
|
@@ -1017,6 +1057,10 @@ const remediationMessage_1_702 = "Use other means of bank account verification";
|
|
|
1017
1057
|
const remediationMessage_1_703 = "Upload a bank statement";
|
|
1018
1058
|
const remediationMessage_1_704 = "Upload a different bank statement";
|
|
1019
1059
|
const remediationMessage_1_705 = "Upload an official bank statement";
|
|
1060
|
+
const remediationMessage_2_123 = "You haven't added an owner";
|
|
1061
|
+
const remediationMessage_2_124 = "You haven't added a signatory";
|
|
1062
|
+
const remediationMessage_2_151 = "You haven't added a controlling person";
|
|
1063
|
+
const remediationMessage_2_185 = "You haven't added your directors";
|
|
1020
1064
|
const remediationMessage_3_100 = "Check the above information, then click here to confirm.";
|
|
1021
1065
|
const sameNameAsLegalName = "Same as legal name of the company";
|
|
1022
1066
|
const whereCanIFindTheseNumbersOnMyDriversLicense = "Where can I find these numbers on my driver's license?";
|
|
@@ -1287,6 +1331,7 @@ const defaultTrans = {
|
|
|
1287
1331
|
nameAndCountry,
|
|
1288
1332
|
companyCountry,
|
|
1289
1333
|
accountDetailsDescription,
|
|
1334
|
+
provideFewDetailsAboutYourself,
|
|
1290
1335
|
provideDetails,
|
|
1291
1336
|
payoutAccountsDescription,
|
|
1292
1337
|
payoutAccountsDescriptionReview,
|
|
@@ -1649,9 +1694,36 @@ const defaultTrans = {
|
|
|
1649
1694
|
constitutionalDocument,
|
|
1650
1695
|
solePropDetails,
|
|
1651
1696
|
soleProprietorDetails,
|
|
1697
|
+
soleProprietorshipDetails,
|
|
1652
1698
|
selectAccountHolder,
|
|
1653
1699
|
nameOfBankAccountHolder,
|
|
1700
|
+
whatBestDescribesYourBusinessSetup,
|
|
1701
|
+
whichLegalArrangementDoesYourBusinessHave,
|
|
1702
|
+
sorryWeCantSetUpAnAccountForYou,
|
|
1703
|
+
changeYourBusinessSetup,
|
|
1704
|
+
someInformationWillNotBeSaved,
|
|
1705
|
+
yesChange,
|
|
1706
|
+
youAreNotSoleProprietorAndUseBankAccount,
|
|
1707
|
+
soleProprietorship,
|
|
1708
|
+
youAreRegisteredSoleProprietorAndUseBankAccount,
|
|
1709
|
+
company,
|
|
1710
|
+
youUseCompanyBankAccount,
|
|
1711
|
+
trust,
|
|
1712
|
+
trustPartnershipOrAssociation,
|
|
1713
|
+
whatTypeOfTrusteeAreYou,
|
|
1714
|
+
youAreIndividualOrCompanyAndUseBankAccountInNameOfTrustPartnershipOrAssociation,
|
|
1715
|
+
individualTrustee,
|
|
1716
|
+
companyTrustee,
|
|
1717
|
+
association,
|
|
1718
|
+
partnership,
|
|
1719
|
+
youAreTrusteeManagingTheTrustForBeneficiaries,
|
|
1720
|
+
jointlyOwnedBusinessWhereTwoOrMorePeopleOperateAndShareProfits,
|
|
1721
|
+
groupOfPeopleActingTogetherForNonCommercialPurpose,
|
|
1722
|
+
ourFinancialServicesAreNotAvailableYetForPartnershipsAndAssociations,
|
|
1723
|
+
needHelpYouCanAlwaysReachOutToCustomerSupport,
|
|
1654
1724
|
myName,
|
|
1725
|
+
setUpYourAccount,
|
|
1726
|
+
yourBusinessSetup,
|
|
1655
1727
|
myNameDescription,
|
|
1656
1728
|
mySoleProprietorName,
|
|
1657
1729
|
mySoleProprietorNameDescription,
|
|
@@ -1664,6 +1736,12 @@ const defaultTrans = {
|
|
|
1664
1736
|
anAssociation,
|
|
1665
1737
|
anAssociationDescription,
|
|
1666
1738
|
legalNameOfSoleProprietor,
|
|
1739
|
+
legalNameOfSoleProprietorship,
|
|
1740
|
+
letUsKnowTheBankAccountToSendReceiveFunds,
|
|
1741
|
+
bankAccount,
|
|
1742
|
+
bankAccountDetails,
|
|
1743
|
+
addExtraBankAccount,
|
|
1744
|
+
addAndVerifyYourBankDetails,
|
|
1667
1745
|
failedToFetchSoleProp,
|
|
1668
1746
|
uniqueIdentificationCode,
|
|
1669
1747
|
identifikacionenNomerDDS,
|
|
@@ -1832,6 +1910,7 @@ const defaultTrans = {
|
|
|
1832
1910
|
residencePermitBack,
|
|
1833
1911
|
residencePermitFront,
|
|
1834
1912
|
manualUpload,
|
|
1913
|
+
missingMultipleDecisionMakers,
|
|
1835
1914
|
legalCompanyName,
|
|
1836
1915
|
legalCompanyName__helperText,
|
|
1837
1916
|
legalCompanyName__helperText__AU,
|
|
@@ -2055,6 +2134,10 @@ const defaultTrans = {
|
|
|
2055
2134
|
errorMessage_1_7020,
|
|
2056
2135
|
errorMessage_1_7021,
|
|
2057
2136
|
errorMessage_1_7022,
|
|
2137
|
+
errorMessage_2_8064,
|
|
2138
|
+
errorMessage_2_8067,
|
|
2139
|
+
errorMessage_2_8189,
|
|
2140
|
+
errorMessage_2_8193,
|
|
2058
2141
|
errorMessage_3_10,
|
|
2059
2142
|
remediationMessage_1_100,
|
|
2060
2143
|
remediationMessage_1_101,
|
|
@@ -2093,6 +2176,10 @@ const defaultTrans = {
|
|
|
2093
2176
|
remediationMessage_1_703,
|
|
2094
2177
|
remediationMessage_1_704,
|
|
2095
2178
|
remediationMessage_1_705,
|
|
2179
|
+
remediationMessage_2_123,
|
|
2180
|
+
remediationMessage_2_124,
|
|
2181
|
+
remediationMessage_2_151,
|
|
2182
|
+
remediationMessage_2_185,
|
|
2096
2183
|
remediationMessage_3_100,
|
|
2097
2184
|
sameNameAsLegalName,
|
|
2098
2185
|
whereCanIFindTheseNumbersOnMyDriversLicense,
|
|
@@ -2722,11 +2809,11 @@ var AlertTypes = /* @__PURE__ */ ((AlertTypes2) => {
|
|
|
2722
2809
|
return AlertTypes2;
|
|
2723
2810
|
})(AlertTypes || {});
|
|
2724
2811
|
const Alert = ({
|
|
2725
|
-
className,
|
|
2726
2812
|
title,
|
|
2727
2813
|
type = AlertTypes.BASIC,
|
|
2728
|
-
|
|
2729
|
-
hasCloseButton = true
|
|
2814
|
+
className,
|
|
2815
|
+
hasCloseButton = true,
|
|
2816
|
+
children
|
|
2730
2817
|
}) => {
|
|
2731
2818
|
const {
|
|
2732
2819
|
i18n
|
|
@@ -2825,7 +2912,7 @@ const createLogger = (namespace) => {
|
|
|
2825
2912
|
});
|
|
2826
2913
|
return methods;
|
|
2827
2914
|
};
|
|
2828
|
-
const logger$
|
|
2915
|
+
const logger$n = createLogger("Link");
|
|
2829
2916
|
const getIconClass = (icon, external) => {
|
|
2830
2917
|
if (external) {
|
|
2831
2918
|
return "adl-link__icon adyen-kyc-icon-external-link";
|
|
@@ -2837,7 +2924,7 @@ const getIconClass = (icon, external) => {
|
|
|
2837
2924
|
};
|
|
2838
2925
|
const isValidLink = (href) => {
|
|
2839
2926
|
if (href === "#") {
|
|
2840
|
-
logger$
|
|
2927
|
+
logger$n.error('Links must include a valid href. If your href is "#", consider using a Button instead');
|
|
2841
2928
|
return false;
|
|
2842
2929
|
}
|
|
2843
2930
|
return true;
|
|
@@ -3127,6 +3214,17 @@ function useResetGlobalData(caller) {
|
|
|
3127
3214
|
}
|
|
3128
3215
|
}), [dispatch, caller]);
|
|
3129
3216
|
}
|
|
3217
|
+
const logger$m = createLogger("useAllowedCountries");
|
|
3218
|
+
const useAllowedCountries = () => {
|
|
3219
|
+
const {
|
|
3220
|
+
getAllowedCountries: getAllowedCountries2
|
|
3221
|
+
} = useConfigurationApi();
|
|
3222
|
+
const [allowedCountries, setAllowedCountries] = useState();
|
|
3223
|
+
useEffect(() => {
|
|
3224
|
+
getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$m.error);
|
|
3225
|
+
}, []);
|
|
3226
|
+
return allowedCountries;
|
|
3227
|
+
};
|
|
3130
3228
|
const processField = ({
|
|
3131
3229
|
key,
|
|
3132
3230
|
value = null,
|
|
@@ -4916,7 +5014,7 @@ function CountryField({
|
|
|
4916
5014
|
readonly,
|
|
4917
5015
|
handleChangeFor,
|
|
4918
5016
|
helperText,
|
|
4919
|
-
allowedCountries
|
|
5017
|
+
allowedCountries,
|
|
4920
5018
|
classNameModifiers = []
|
|
4921
5019
|
}) {
|
|
4922
5020
|
const {
|
|
@@ -4931,7 +5029,7 @@ function CountryField({
|
|
|
4931
5029
|
useEffect(() => {
|
|
4932
5030
|
loadFlags2().catch(logger$k.error);
|
|
4933
5031
|
}, [loadFlags2]);
|
|
4934
|
-
const countries = countriesFromApi.filter((country2) => allowedCountries
|
|
5032
|
+
const countries = countriesFromApi.filter((country2) => allowedCountries ? allowedCountries.includes(country2.id) : true).map((item) => ({
|
|
4935
5033
|
...item,
|
|
4936
5034
|
sprite: `#adl-flag-${item.id.toLowerCase()}`
|
|
4937
5035
|
}));
|
|
@@ -5160,8 +5258,10 @@ function CompanyNameAndCountry(props) {
|
|
|
5160
5258
|
isSettingEnabled
|
|
5161
5259
|
} = useSettingsContext();
|
|
5162
5260
|
const {
|
|
5163
|
-
id: id2
|
|
5261
|
+
id: id2,
|
|
5262
|
+
isTopLevelEntity
|
|
5164
5263
|
} = props;
|
|
5264
|
+
const allowedCountries = useAllowedCountries();
|
|
5165
5265
|
const {
|
|
5166
5266
|
sliceData,
|
|
5167
5267
|
updateStateSlice
|
|
@@ -5207,7 +5307,7 @@ function CompanyNameAndCountry(props) {
|
|
|
5207
5307
|
labels: formUtils.getFieldLabels(COUNTRY_FIELD),
|
|
5208
5308
|
readonly: !isAllowedEditPrefilledCountry || Boolean(props == null ? void 0 : props.disableCountry),
|
|
5209
5309
|
classNameModifiers: ["country"],
|
|
5210
|
-
allowedCountries:
|
|
5310
|
+
allowedCountries: isTopLevelEntity ? allowedCountries : void 0,
|
|
5211
5311
|
handleChangeFor
|
|
5212
5312
|
}), formUtils.isRequiredField("legalCompanyName") && jsx(LegalCompanyNameField, {
|
|
5213
5313
|
data: formUtils.getFieldData(formData, LEGAL_COMPANY_NAME_FIELD),
|
|
@@ -8613,6 +8713,7 @@ var DecisionMakerType = /* @__PURE__ */ ((DecisionMakerType2) => {
|
|
|
8613
8713
|
return DecisionMakerType2;
|
|
8614
8714
|
})(DecisionMakerType || {});
|
|
8615
8715
|
var TaskTypes = /* @__PURE__ */ ((TaskTypes2) => {
|
|
8716
|
+
TaskTypes2["BUSINESS_TYPE_SELECTION"] = "BUSINESS_TYPE_SELECTION";
|
|
8616
8717
|
TaskTypes2["INTRO"] = "INTRO";
|
|
8617
8718
|
TaskTypes2["TASKS_OVERVIEW"] = "TASKS_OVERVIEW";
|
|
8618
8719
|
TaskTypes2["REVIEW"] = "REVIEW";
|
|
@@ -8784,12 +8885,19 @@ function AccountHolder(props) {
|
|
|
8784
8885
|
dataStoreId,
|
|
8785
8886
|
capabilities
|
|
8786
8887
|
} = props;
|
|
8888
|
+
const {
|
|
8889
|
+
accountHolder: accountHolder2
|
|
8890
|
+
} = useCoreContext();
|
|
8787
8891
|
const {
|
|
8788
8892
|
isSettingEnabled
|
|
8789
8893
|
} = useSettingsContext();
|
|
8790
8894
|
const {
|
|
8791
8895
|
isExperimentEnabled
|
|
8792
8896
|
} = useExperimentsContext();
|
|
8897
|
+
const defaultData = cloneObject(props.data);
|
|
8898
|
+
if (isExperimentEnabled("EnableNewEntryFlow") && defaultData) {
|
|
8899
|
+
defaultData.accountHolder = accountHolder2 || defaultData.accountHolder;
|
|
8900
|
+
}
|
|
8793
8901
|
const {
|
|
8794
8902
|
handleChangeFor,
|
|
8795
8903
|
data,
|
|
@@ -8799,7 +8907,7 @@ function AccountHolder(props) {
|
|
|
8799
8907
|
} = useForm({
|
|
8800
8908
|
...props,
|
|
8801
8909
|
schema: ["accountHolder"],
|
|
8802
|
-
defaultData
|
|
8910
|
+
defaultData,
|
|
8803
8911
|
rules: props.validators || accountHolderValidationRules,
|
|
8804
8912
|
fieldProblems: props == null ? void 0 : props.fieldValidationErrors
|
|
8805
8913
|
});
|
|
@@ -8909,7 +9017,7 @@ const RadioCard = ({
|
|
|
8909
9017
|
})]
|
|
8910
9018
|
}), jsx("div", {
|
|
8911
9019
|
className: "adl-radio-card__body adl-u-margin-bottom-16",
|
|
8912
|
-
children: body ?? i18n.get(optionDescription)
|
|
9020
|
+
children: body ?? (optionDescription && i18n.get(optionDescription))
|
|
8913
9021
|
}), footer && jsx("div", {
|
|
8914
9022
|
className: "adl-u-margin-bottom-16",
|
|
8915
9023
|
children: footer
|
|
@@ -8942,7 +9050,7 @@ function RadioCardSelect({
|
|
|
8942
9050
|
children: options.map((option) => jsx(RadioCard, {
|
|
8943
9051
|
optionId: optionId(option),
|
|
8944
9052
|
optionName: optionName(option),
|
|
8945
|
-
optionDescription: optionDescription(option),
|
|
9053
|
+
optionDescription: optionDescription == null ? void 0 : optionDescription(option),
|
|
8946
9054
|
optionSubtitle: optionSubtitle == null ? void 0 : optionSubtitle(option),
|
|
8947
9055
|
uniqueId: getUniqueId(uniqueIdBase),
|
|
8948
9056
|
isInvalid,
|
|
@@ -9856,7 +9964,6 @@ function FieldContainer(props) {
|
|
|
9856
9964
|
fieldProblems,
|
|
9857
9965
|
fieldName,
|
|
9858
9966
|
trimOnBlur,
|
|
9859
|
-
allowedCountries,
|
|
9860
9967
|
hideField,
|
|
9861
9968
|
maxlength,
|
|
9862
9969
|
handleChangeFor
|
|
@@ -9883,7 +9990,6 @@ function FieldContainer(props) {
|
|
|
9883
9990
|
},
|
|
9884
9991
|
readonly: formUtils.isReadOnly(field),
|
|
9885
9992
|
classNameModifiers,
|
|
9886
|
-
allowedCountries,
|
|
9887
9993
|
className: hideField ? "adl-u-display-none" : "",
|
|
9888
9994
|
handleChangeFor
|
|
9889
9995
|
});
|
|
@@ -10465,7 +10571,6 @@ function Address(props) {
|
|
|
10465
10571
|
shouldValidate,
|
|
10466
10572
|
id: id2,
|
|
10467
10573
|
hideCountry,
|
|
10468
|
-
allowedCountries,
|
|
10469
10574
|
heading
|
|
10470
10575
|
} = props;
|
|
10471
10576
|
const {
|
|
@@ -10584,7 +10689,6 @@ function Address(props) {
|
|
|
10584
10689
|
return null;
|
|
10585
10690
|
const hideField = fieldName === "country" && hideCountry;
|
|
10586
10691
|
return jsx(FieldContainer, {
|
|
10587
|
-
allowedCountries,
|
|
10588
10692
|
classNameModifiers: [fieldName],
|
|
10589
10693
|
data,
|
|
10590
10694
|
valid,
|
|
@@ -10952,7 +11056,8 @@ function CompanyComponent(props) {
|
|
|
10952
11056
|
country: props.country
|
|
10953
11057
|
},
|
|
10954
11058
|
heading: i18n.get("nameAndCountry"),
|
|
10955
|
-
id: CompanyNameAndCountryFormID
|
|
11059
|
+
id: CompanyNameAndCountryFormID,
|
|
11060
|
+
isTopLevelEntity: props.isTopLevelEntity
|
|
10956
11061
|
})
|
|
10957
11062
|
}), jsx("div", {
|
|
10958
11063
|
className: props.activeForm.formId !== CompanyTypeFormID ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper",
|
|
@@ -15574,6 +15679,7 @@ function PersonalDetailsComponent(props) {
|
|
|
15574
15679
|
const {
|
|
15575
15680
|
isSettingEnabled
|
|
15576
15681
|
} = useSettingsContext();
|
|
15682
|
+
const allowedCountries = useAllowedCountries();
|
|
15577
15683
|
const PERSONAL_DETAILS = props.id;
|
|
15578
15684
|
const [externalErrors, setExternalErrors] = useState(null);
|
|
15579
15685
|
const [status, setStatus] = useState("success");
|
|
@@ -15582,6 +15688,7 @@ function PersonalDetailsComponent(props) {
|
|
|
15582
15688
|
});
|
|
15583
15689
|
const [personalDetailsData, setPersonalDetailsData] = useState(null);
|
|
15584
15690
|
const isDecisionMakerTask = props.taskType === TaskTypes.DECISION_MAKER || props.taskType === TaskTypes.TRUST_MEMBER_COMPANY_OWNER;
|
|
15691
|
+
const isTopLevelEntity = props.taskType === TaskTypes.INDIVIDUAL;
|
|
15585
15692
|
const requiredFieldsByTask = (props.requiredFields || personalDetailsFields).filter((field) => field !== "role" || field === "role" && isDecisionMakerTask);
|
|
15586
15693
|
const isAllowedEditPrefilledCountry = isSettingEnabled(SettingNames.AllowPrefilledCountryEdit);
|
|
15587
15694
|
const getDirectChildFields = () => requiredFieldsByTask.filter((field) => ["birthDate", "residencyCountry", "jobTitle", "nationality"].includes(field));
|
|
@@ -15698,7 +15805,7 @@ function PersonalDetailsComponent(props) {
|
|
|
15698
15805
|
validationErrors: props == null ? void 0 : props.fieldValidationErrors,
|
|
15699
15806
|
formUtils,
|
|
15700
15807
|
id: "ariaErrorField"
|
|
15701
|
-
}), data.residencyCountry === "US" &&
|
|
15808
|
+
}), data.residencyCountry === "US" && isTopLevelEntity ? jsx(PatriotActDisclosure, {}) : void 0, jsx(ContextGuidance, {
|
|
15702
15809
|
page: "Personal details",
|
|
15703
15810
|
title: i18n.get("whyDoINeedToFillInThisInformation"),
|
|
15704
15811
|
content: i18n.get("reasonForFillingIndividualPersonalDetails"),
|
|
@@ -15745,7 +15852,7 @@ function PersonalDetailsComponent(props) {
|
|
|
15745
15852
|
country: formUtils.getLabel("residencyCountry")
|
|
15746
15853
|
},
|
|
15747
15854
|
readonly: !isAllowedEditPrefilledCountry && !isDecisionMakerTask,
|
|
15748
|
-
allowedCountries:
|
|
15855
|
+
allowedCountries: isTopLevelEntity ? allowedCountries : void 0,
|
|
15749
15856
|
classNameModifiers: ["country"],
|
|
15750
15857
|
handleChangeFor: () => handleChangeFor("residencyCountry", "input")
|
|
15751
15858
|
}), jsx(IdentityComponent, {
|
|
@@ -16281,61 +16388,6 @@ const refreshSession = async () => {
|
|
|
16281
16388
|
logger$e.error("Failed to fetch sdk token", e);
|
|
16282
16389
|
}
|
|
16283
16390
|
};
|
|
16284
|
-
const OpenBankingSDKStyles = "";
|
|
16285
|
-
const WIDGET_IFRAME_CLASS$1 = "adyen-open-banking-sdk-widget";
|
|
16286
|
-
const WIDGET_CONTAINER_CLASS$1 = `${WIDGET_IFRAME_CLASS$1}-container`;
|
|
16287
|
-
class OpenBankingSDK {
|
|
16288
|
-
constructor({
|
|
16289
|
-
divElement,
|
|
16290
|
-
link,
|
|
16291
|
-
successHandler,
|
|
16292
|
-
errorHandler
|
|
16293
|
-
}) {
|
|
16294
|
-
this.divElement = divElement;
|
|
16295
|
-
this.link = link;
|
|
16296
|
-
this.successHandler = successHandler;
|
|
16297
|
-
this.errorHandler = errorHandler;
|
|
16298
|
-
}
|
|
16299
|
-
static create(parameters) {
|
|
16300
|
-
return new OpenBankingSDK(parameters);
|
|
16301
|
-
}
|
|
16302
|
-
open() {
|
|
16303
|
-
this.iframe = document.createElement("iframe");
|
|
16304
|
-
this.iframe.setAttribute("allowFullscreen", "true");
|
|
16305
|
-
this.iframe.classList.add(WIDGET_IFRAME_CLASS$1);
|
|
16306
|
-
this.divElement.appendChild(this.iframe);
|
|
16307
|
-
this.divElement.classList.add(WIDGET_CONTAINER_CLASS$1);
|
|
16308
|
-
const iframeUrl = new URL(this.link);
|
|
16309
|
-
const iframeWindow = this.iframe.contentWindow;
|
|
16310
|
-
this.listener = ({
|
|
16311
|
-
data,
|
|
16312
|
-
origin,
|
|
16313
|
-
source
|
|
16314
|
-
}) => {
|
|
16315
|
-
if (source !== iframeWindow || origin !== iframeUrl.origin)
|
|
16316
|
-
return;
|
|
16317
|
-
switch (data.type) {
|
|
16318
|
-
case "account_verification_report":
|
|
16319
|
-
this.successHandler(data.code, data.state);
|
|
16320
|
-
break;
|
|
16321
|
-
case "error":
|
|
16322
|
-
this.errorHandler(data.error_code, data.error_message, data.state, data.metadata);
|
|
16323
|
-
break;
|
|
16324
|
-
}
|
|
16325
|
-
};
|
|
16326
|
-
window.addEventListener("message", this.listener);
|
|
16327
|
-
this.iframe.setAttribute("src", iframeUrl.href);
|
|
16328
|
-
}
|
|
16329
|
-
destroy() {
|
|
16330
|
-
if (this.listener) {
|
|
16331
|
-
window.removeEventListener("message", this.listener);
|
|
16332
|
-
}
|
|
16333
|
-
if (this.iframe) {
|
|
16334
|
-
this.divElement.removeChild(this.iframe);
|
|
16335
|
-
this.iframe = void 0;
|
|
16336
|
-
}
|
|
16337
|
-
}
|
|
16338
|
-
}
|
|
16339
16391
|
const addAnimationStartListener = (element, listener) => {
|
|
16340
16392
|
element.addEventListener("animationstart", listener, false);
|
|
16341
16393
|
element.addEventListener("MSAnimationStart", listener, false);
|
|
@@ -17106,7 +17158,8 @@ function BankAccountFormat(props) {
|
|
|
17106
17158
|
var ExperimentNames = /* @__PURE__ */ ((ExperimentNames2) => {
|
|
17107
17159
|
ExperimentNames2["EnableTrustFlow"] = "EnableTrustFlow";
|
|
17108
17160
|
ExperimentNames2["OnlyAllowAlphanumericBankAccountNumbers"] = "OnlyAllowAlphanumericBankAccountNumbers";
|
|
17109
|
-
ExperimentNames2["
|
|
17161
|
+
ExperimentNames2["EnableNewEntryFlow"] = "EnableNewEntryFlow";
|
|
17162
|
+
ExperimentNames2["AllowOrganizationSettlorWithExemptionReason"] = "AllowOrganizationSettlorWithExemptionReason";
|
|
17110
17163
|
return ExperimentNames2;
|
|
17111
17164
|
})(ExperimentNames || {});
|
|
17112
17165
|
const stripNonAlphanumeric = (value) => value.replaceAll(/[^0-9a-zA-Z]/g, "");
|
|
@@ -18510,9 +18563,13 @@ const payoutSteps = {
|
|
|
18510
18563
|
formName: "verificationMethod",
|
|
18511
18564
|
fields: payoutVerificationMethodFields
|
|
18512
18565
|
},
|
|
18513
|
-
payoutAccountDetails: (tasktype) => ({
|
|
18566
|
+
payoutAccountDetails: (tasktype, isNewEntryFlowExperimentEnabled) => ({
|
|
18514
18567
|
formId: "payoutAccountDetails",
|
|
18515
|
-
|
|
18568
|
+
...isNewEntryFlowExperimentEnabled ? {
|
|
18569
|
+
formName: "bankAccount"
|
|
18570
|
+
} : {
|
|
18571
|
+
formName: tasktype === TaskTypes.PAYIN ? "payinAccount" : "payoutAccount"
|
|
18572
|
+
},
|
|
18516
18573
|
fields: payoutAccountFields
|
|
18517
18574
|
}),
|
|
18518
18575
|
payoutAccountDocuments: {
|
|
@@ -18526,9 +18583,9 @@ const payoutSteps = {
|
|
|
18526
18583
|
fields: accountVerificationFields
|
|
18527
18584
|
}
|
|
18528
18585
|
};
|
|
18529
|
-
const getAppropriatePayoutDetailsSteps = (currentTask, isEditing, instantVerificationAvailable, canChangeCountry) => {
|
|
18586
|
+
const getAppropriatePayoutDetailsSteps = (currentTask, isEditing, instantVerificationAvailable, canChangeCountry, isNewEntryFlowExperimentEnabled) => {
|
|
18530
18587
|
const dependentSteps = {
|
|
18531
|
-
payoutAccountDetails: payoutSteps.payoutAccountDetails(currentTask),
|
|
18588
|
+
payoutAccountDetails: payoutSteps.payoutAccountDetails(currentTask, isNewEntryFlowExperimentEnabled),
|
|
18532
18589
|
payoutAccountDocuments: payoutSteps.payoutAccountDocuments,
|
|
18533
18590
|
payoutAccountVerification: payoutSteps.payoutAccountVerification
|
|
18534
18591
|
};
|
|
@@ -18546,6 +18603,9 @@ function PayoutDetailsComponent(props) {
|
|
|
18546
18603
|
const {
|
|
18547
18604
|
i18n
|
|
18548
18605
|
} = useI18nContext();
|
|
18606
|
+
const {
|
|
18607
|
+
isExperimentEnabled
|
|
18608
|
+
} = useExperimentsContext();
|
|
18549
18609
|
const {
|
|
18550
18610
|
activeForm,
|
|
18551
18611
|
taskType,
|
|
@@ -18562,9 +18622,9 @@ function PayoutDetailsComponent(props) {
|
|
|
18562
18622
|
const [instantVerificationError, setInstantVerificationError] = useInstantVerificationErrorNotification(1e4);
|
|
18563
18623
|
const verificationMethodFormProps = getFormProps(props, payoutSteps.payoutVerificationMethod.formId);
|
|
18564
18624
|
const accountVerificationFormProps = getFormProps(props, payoutSteps.payoutAccountVerification.formId);
|
|
18565
|
-
const payoutAccountFormProps = getFormProps(props, payoutSteps.payoutAccountDetails(taskType).formId);
|
|
18625
|
+
const payoutAccountFormProps = getFormProps(props, payoutSteps.payoutAccountDetails(taskType, isExperimentEnabled("EnableNewEntryFlow")).formId);
|
|
18566
18626
|
const payoutBankStatementFormProps = getFormProps(props, payoutSteps.payoutAccountDocuments.formId);
|
|
18567
|
-
const taskHeading = i18n.get(taskHeadings[taskType]);
|
|
18627
|
+
const taskHeading = isExperimentEnabled("EnableNewEntryFlow") ? i18n.get("addAndVerifyYourBankDetails") : i18n.get(taskHeadings[taskType]);
|
|
18568
18628
|
const isBankStatementDocumentOptional = formUtilities(payoutBankStatementFormProps, i18n).isOptionalField("bankStatementDocument");
|
|
18569
18629
|
const globalData = useGlobalData();
|
|
18570
18630
|
const data = isEmpty(globalData) ? props.data : globalData;
|
|
@@ -18619,11 +18679,11 @@ function PayoutDetailsComponent(props) {
|
|
|
18619
18679
|
handleBankVerificationError: handleBankVerificationError2
|
|
18620
18680
|
})
|
|
18621
18681
|
}) : jsx("div", {
|
|
18622
|
-
className: activeForm.formId !== payoutSteps.payoutAccountDetails(taskType).formId ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper",
|
|
18682
|
+
className: activeForm.formId !== payoutSteps.payoutAccountDetails(taskType, isExperimentEnabled("EnableNewEntryFlow")).formId ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper",
|
|
18623
18683
|
children: jsx(PayoutAccount, {
|
|
18624
18684
|
...payoutAccountFormProps,
|
|
18625
18685
|
heading: taskHeading,
|
|
18626
|
-
id: payoutSteps.payoutAccountDetails(taskType).formId,
|
|
18686
|
+
id: payoutSteps.payoutAccountDetails(taskType, isExperimentEnabled("EnableNewEntryFlow")).formId,
|
|
18627
18687
|
country: bankCountry2,
|
|
18628
18688
|
legalEntityResponse
|
|
18629
18689
|
})
|
|
@@ -18735,6 +18795,9 @@ function SolePropComponent(props) {
|
|
|
18735
18795
|
const {
|
|
18736
18796
|
i18n
|
|
18737
18797
|
} = useI18nContext();
|
|
18798
|
+
const {
|
|
18799
|
+
isExperimentEnabled
|
|
18800
|
+
} = useExperimentsContext();
|
|
18738
18801
|
const [tradingName2, setTradingName] = useState();
|
|
18739
18802
|
const solePropNameAndCountryFormProps = getFormProps(props, solePropNameAndCountryFormId);
|
|
18740
18803
|
const solePropsRegistrationDetailsFormProps = getFormProps(props, solePropRegistrationDetailsFormId);
|
|
@@ -18764,11 +18827,12 @@ function SolePropComponent(props) {
|
|
|
18764
18827
|
},
|
|
18765
18828
|
labels: {
|
|
18766
18829
|
country: "countryOfEstablishment",
|
|
18767
|
-
legalCompanyName: "legalNameOfSoleProprietor"
|
|
18830
|
+
legalCompanyName: isExperimentEnabled("EnableNewEntryFlow") ? "legalNameOfSoleProprietorship" : "legalNameOfSoleProprietor"
|
|
18768
18831
|
},
|
|
18769
18832
|
heading: i18n.get("nameAndCountry"),
|
|
18770
18833
|
id: solePropNameAndCountryFormId,
|
|
18771
|
-
disableCountry: true
|
|
18834
|
+
disableCountry: true,
|
|
18835
|
+
isTopLevelEntity: false
|
|
18772
18836
|
})
|
|
18773
18837
|
}), jsx("div", {
|
|
18774
18838
|
className: activeForm.formId !== solePropRegistrationDetailsFormId ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper",
|
|
@@ -19214,6 +19278,16 @@ const remediationActionMappings = {
|
|
|
19214
19278
|
const dataMissingRemediationsToFieldsMap = {
|
|
19215
19279
|
"2_158": ["vatNumber", "exemptedFromVat", "vatAbsenceReason"]
|
|
19216
19280
|
};
|
|
19281
|
+
const DATA_MISSING_DECISION_MAKER_ERROR_CODE_MAPPING = {
|
|
19282
|
+
"2_8064": "2_123",
|
|
19283
|
+
// Owner
|
|
19284
|
+
"2_8067": "2_124",
|
|
19285
|
+
// Signatory
|
|
19286
|
+
"2_8189": "2_151",
|
|
19287
|
+
// Controller
|
|
19288
|
+
"2_8193": "2_185"
|
|
19289
|
+
// Director
|
|
19290
|
+
};
|
|
19217
19291
|
var EntityType = /* @__PURE__ */ ((EntityType2) => {
|
|
19218
19292
|
EntityType2["BANK_ACCOUNT"] = "BankAccount";
|
|
19219
19293
|
EntityType2["LEGAL_ENTITY"] = "LegalEntity";
|
|
@@ -19234,7 +19308,7 @@ const entityProblemInitialState = {
|
|
|
19234
19308
|
// default status - if the entity is not listed in the problems array
|
|
19235
19309
|
validationErrors: {}
|
|
19236
19310
|
};
|
|
19237
|
-
const UNRELATED_DATA_MISSING_ERROR_CODES = ["2_8036"
|
|
19311
|
+
const UNRELATED_DATA_MISSING_ERROR_CODES = ["2_8036"];
|
|
19238
19312
|
const UNRELATED_INVALID_INPUT_ERROR_CODES = ["1_14", "2_901", "2_902"];
|
|
19239
19313
|
function getCapabilityProblems(response) {
|
|
19240
19314
|
const capabilities = (response == null ? void 0 : response.capabilities) || {};
|
|
@@ -21021,7 +21095,7 @@ function CompanyDropinComponent({
|
|
|
21021
21095
|
taskName,
|
|
21022
21096
|
capabilities,
|
|
21023
21097
|
homeButtonLabel,
|
|
21024
|
-
taskType,
|
|
21098
|
+
taskType = TaskTypes.COMPANY,
|
|
21025
21099
|
trackingConfig,
|
|
21026
21100
|
associationDetail,
|
|
21027
21101
|
parentLegalEntity,
|
|
@@ -21349,7 +21423,8 @@ function CompanyDropinComponent({
|
|
|
21349
21423
|
onTypeSwitch,
|
|
21350
21424
|
onCountryChange: setCountry,
|
|
21351
21425
|
ref: formRef,
|
|
21352
|
-
shouldValidate
|
|
21426
|
+
shouldValidate,
|
|
21427
|
+
isTopLevelEntity: taskType === TaskTypes.COMPANY
|
|
21353
21428
|
})
|
|
21354
21429
|
});
|
|
21355
21430
|
}
|
|
@@ -21457,20 +21532,26 @@ const useShouldShowIntro = (legalEntity) => {
|
|
|
21457
21532
|
} = useHasSeenIntro(legalEntity.id);
|
|
21458
21533
|
return canSeeIntro && !hasSeenIntro;
|
|
21459
21534
|
};
|
|
21535
|
+
const useShouldShowBusinessTypeSelection = (accountHolder2) => {
|
|
21536
|
+
const {
|
|
21537
|
+
isExperimentEnabled
|
|
21538
|
+
} = useExperimentsContext();
|
|
21539
|
+
return isExperimentEnabled("EnableNewEntryFlow") && !accountHolder2;
|
|
21540
|
+
};
|
|
21460
21541
|
const logger$7 = createLogger("useExemptSettlor");
|
|
21461
21542
|
const useExemptSettlor = ({
|
|
21462
|
-
trust,
|
|
21543
|
+
trust: trust2,
|
|
21463
21544
|
handleGetLegalEntity
|
|
21464
21545
|
}) => {
|
|
21465
21546
|
const [exemptSettlor, setExemptSettlor] = useState();
|
|
21466
21547
|
const updateExemptSettlor = useCallback(async (trustLE) => {
|
|
21467
|
-
const exemptSettlorAssociation = getOwnEntityAssociations(trustLE).find((
|
|
21548
|
+
const exemptSettlorAssociation = getOwnEntityAssociations(trustLE).find((association2) => association2.type === TrustMemberTypes.SETTLOR && Boolean(association2.settlorExemptionReason));
|
|
21468
21549
|
const exemptSettlorLE = (exemptSettlorAssociation == null ? void 0 : exemptSettlorAssociation.legalEntityId) ? await handleGetLegalEntity(exemptSettlorAssociation.legalEntityId) : void 0;
|
|
21469
21550
|
setExemptSettlor(exemptSettlorLE);
|
|
21470
21551
|
}, [handleGetLegalEntity]);
|
|
21471
21552
|
useEffect(() => {
|
|
21472
|
-
updateExemptSettlor(
|
|
21473
|
-
}, [
|
|
21553
|
+
updateExemptSettlor(trust2).catch(logger$7.error);
|
|
21554
|
+
}, [trust2, updateExemptSettlor]);
|
|
21474
21555
|
return exemptSettlor;
|
|
21475
21556
|
};
|
|
21476
21557
|
function useSalesChannelsSettings() {
|
|
@@ -21565,7 +21646,7 @@ const splitAtFirstOccurrence = (str, separator) => {
|
|
|
21565
21646
|
};
|
|
21566
21647
|
const getTrustMemberOwnerId = (trustMemberId, entityAssociations) => {
|
|
21567
21648
|
var _a;
|
|
21568
|
-
return (_a = entityAssociations.find((
|
|
21649
|
+
return (_a = entityAssociations.find((association2) => association2.associatorId === trustMemberId && association2.type === TrustMemberTypes.TRUSTEE)) == null ? void 0 : _a.legalEntityId;
|
|
21569
21650
|
};
|
|
21570
21651
|
const getFallbackName = (exemptSettlorAssociation) => {
|
|
21571
21652
|
const [firstName2, lastName2] = splitAtFirstOccurrence(exemptSettlorAssociation.name ?? "", " ");
|
|
@@ -21574,37 +21655,37 @@ const getFallbackName = (exemptSettlorAssociation) => {
|
|
|
21574
21655
|
lastName: lastName2
|
|
21575
21656
|
};
|
|
21576
21657
|
};
|
|
21577
|
-
const convertEntityAssociationIntoTrustMember = (
|
|
21658
|
+
const convertEntityAssociationIntoTrustMember = (association2, associations, exemptSettlorLE) => {
|
|
21578
21659
|
var _a;
|
|
21579
|
-
if (
|
|
21660
|
+
if (association2.settlorExemptionReason) {
|
|
21580
21661
|
return {
|
|
21581
21662
|
trustMemberType: "exemptSettlor",
|
|
21582
21663
|
roles: [TrustMemberTypes.SETTLOR],
|
|
21583
|
-
legalEntityType:
|
|
21584
|
-
legalEntityId:
|
|
21585
|
-
settlorExemptionReason:
|
|
21586
|
-
exemptSettlorName:
|
|
21587
|
-
name:
|
|
21664
|
+
legalEntityType: association2.entityType,
|
|
21665
|
+
legalEntityId: association2.legalEntityId,
|
|
21666
|
+
settlorExemptionReason: association2.settlorExemptionReason,
|
|
21667
|
+
exemptSettlorName: association2.entityType === LegalEntityType.INDIVIDUAL ? ((_a = exemptSettlorLE == null ? void 0 : exemptSettlorLE.individual) == null ? void 0 : _a.name) ?? getFallbackName(association2) : void 0,
|
|
21668
|
+
name: association2.name
|
|
21588
21669
|
};
|
|
21589
21670
|
}
|
|
21590
|
-
if (
|
|
21671
|
+
if (association2.entityType === LegalEntityType.ORGANIZATION)
|
|
21591
21672
|
return {
|
|
21592
21673
|
trustMemberType: "company",
|
|
21593
21674
|
roles: [],
|
|
21594
21675
|
legalEntityType: LegalEntityType.ORGANIZATION,
|
|
21595
|
-
legalEntityId:
|
|
21596
|
-
name:
|
|
21597
|
-
ownerId: getTrustMemberOwnerId(
|
|
21676
|
+
legalEntityId: association2.legalEntityId,
|
|
21677
|
+
name: association2.name,
|
|
21678
|
+
ownerId: getTrustMemberOwnerId(association2.legalEntityId, associations)
|
|
21598
21679
|
};
|
|
21599
|
-
if (
|
|
21680
|
+
if (association2.entityType === LegalEntityType.INDIVIDUAL)
|
|
21600
21681
|
return {
|
|
21601
21682
|
trustMemberType: "regular",
|
|
21602
21683
|
roles: [],
|
|
21603
21684
|
legalEntityType: LegalEntityType.INDIVIDUAL,
|
|
21604
|
-
legalEntityId:
|
|
21605
|
-
name:
|
|
21685
|
+
legalEntityId: association2.legalEntityId,
|
|
21686
|
+
name: association2.name
|
|
21606
21687
|
};
|
|
21607
|
-
throw new Error(`Not a valid trust member: ${JSON.stringify(
|
|
21688
|
+
throw new Error(`Not a valid trust member: ${JSON.stringify(association2)}`);
|
|
21608
21689
|
};
|
|
21609
21690
|
const mapEntityAssociationsToTrustMembers = (trustEntityId, entityAssociations, exemptSettlorLE) => {
|
|
21610
21691
|
const mappedTrustMembers = entityAssociations.reduce((acc, entityAssociation) => {
|
|
@@ -21661,23 +21742,23 @@ const mapTrustMemberToEntityAssociations = (trustMember) => {
|
|
|
21661
21742
|
};
|
|
21662
21743
|
const addOrUpdateAssociatedTrustMember = async ({
|
|
21663
21744
|
newOrUpdated,
|
|
21664
|
-
trust,
|
|
21745
|
+
trust: trust2,
|
|
21665
21746
|
handleUpdateLegalEntity
|
|
21666
21747
|
}) => {
|
|
21667
|
-
const otherAssociations = getOwnEntityAssociations(
|
|
21748
|
+
const otherAssociations = getOwnEntityAssociations(trust2).filter((existingAssociation) => existingAssociation.legalEntityId !== newOrUpdated.legalEntityId);
|
|
21668
21749
|
const updatedAssociations = mapTrustMemberToEntityAssociations(newOrUpdated);
|
|
21669
21750
|
const patchLE = {
|
|
21670
21751
|
entityAssociations: [...otherAssociations, ...updatedAssociations]
|
|
21671
21752
|
};
|
|
21672
|
-
await handleUpdateLegalEntity(patchLE,
|
|
21753
|
+
await handleUpdateLegalEntity(patchLE, trust2.id);
|
|
21673
21754
|
};
|
|
21674
21755
|
const addOrUpdateUndefinedBeneficiary = async ({
|
|
21675
21756
|
newOrUpdated,
|
|
21676
|
-
trust,
|
|
21757
|
+
trust: trust2,
|
|
21677
21758
|
handleUpdateLegalEntity
|
|
21678
21759
|
}) => {
|
|
21679
21760
|
var _a, _b;
|
|
21680
|
-
const otherUndefinedBeneficiaries = ((_b = (_a =
|
|
21761
|
+
const otherUndefinedBeneficiaries = ((_b = (_a = trust2.trust) == null ? void 0 : _a.undefinedBeneficiaryInfo) == null ? void 0 : _b.filter((ub) => ub.reference !== newOrUpdated.reference)) ?? [];
|
|
21681
21762
|
const patchLE = {
|
|
21682
21763
|
trust: {
|
|
21683
21764
|
undefinedBeneficiaryInfo: [...otherUndefinedBeneficiaries, newOrUpdated.reference === isNewEntity ? {
|
|
@@ -21688,11 +21769,11 @@ const addOrUpdateUndefinedBeneficiary = async ({
|
|
|
21688
21769
|
}]
|
|
21689
21770
|
}
|
|
21690
21771
|
};
|
|
21691
|
-
await handleUpdateLegalEntity(patchLE,
|
|
21772
|
+
await handleUpdateLegalEntity(patchLE, trust2.id);
|
|
21692
21773
|
};
|
|
21693
21774
|
const createExemptSettlor = async ({
|
|
21694
21775
|
exemptSettlor,
|
|
21695
|
-
trust,
|
|
21776
|
+
trust: trust2,
|
|
21696
21777
|
handleCreateLegalEntity
|
|
21697
21778
|
}) => {
|
|
21698
21779
|
var _a, _b;
|
|
@@ -21704,7 +21785,7 @@ const createExemptSettlor = async ({
|
|
|
21704
21785
|
lastName: ((_b = exemptSettlor.exemptSettlorName) == null ? void 0 : _b.lastName) ?? ""
|
|
21705
21786
|
},
|
|
21706
21787
|
residentialAddress: {
|
|
21707
|
-
country:
|
|
21788
|
+
country: trust2.trust.registeredAddress.country
|
|
21708
21789
|
}
|
|
21709
21790
|
}
|
|
21710
21791
|
};
|
|
@@ -21727,28 +21808,28 @@ const createOrganizationExemptSettlor = async ({
|
|
|
21727
21808
|
};
|
|
21728
21809
|
const deleteAssociatedTrustMember = async ({
|
|
21729
21810
|
associatedTrustMember,
|
|
21730
|
-
trust,
|
|
21811
|
+
trust: trust2,
|
|
21731
21812
|
handleUpdateLegalEntity
|
|
21732
21813
|
}) => {
|
|
21733
|
-
const ownEntityAssociations = getOwnEntityAssociations(
|
|
21814
|
+
const ownEntityAssociations = getOwnEntityAssociations(trust2);
|
|
21734
21815
|
const updatedTrustAssociations = {
|
|
21735
21816
|
entityAssociations: ownEntityAssociations.filter((entityAssociation) => entityAssociation.legalEntityId !== associatedTrustMember.legalEntityId)
|
|
21736
21817
|
};
|
|
21737
|
-
await handleUpdateLegalEntity(updatedTrustAssociations,
|
|
21818
|
+
await handleUpdateLegalEntity(updatedTrustAssociations, trust2.id);
|
|
21738
21819
|
};
|
|
21739
21820
|
const deleteUndefinedBeneficiary = async ({
|
|
21740
21821
|
undefinedBeneficiary: undefinedBeneficiary2,
|
|
21741
|
-
trust,
|
|
21822
|
+
trust: trust2,
|
|
21742
21823
|
handleUpdateLegalEntity
|
|
21743
21824
|
}) => {
|
|
21744
21825
|
var _a;
|
|
21745
|
-
const existingUndefinedBeneficiaries = ((_a =
|
|
21826
|
+
const existingUndefinedBeneficiaries = ((_a = trust2.trust) == null ? void 0 : _a.undefinedBeneficiaryInfo) ?? [];
|
|
21746
21827
|
const updatedTrust = {
|
|
21747
21828
|
trust: {
|
|
21748
21829
|
undefinedBeneficiaryInfo: existingUndefinedBeneficiaries.filter((ub) => ub.reference !== undefinedBeneficiary2.reference)
|
|
21749
21830
|
}
|
|
21750
21831
|
};
|
|
21751
|
-
await handleUpdateLegalEntity(updatedTrust,
|
|
21832
|
+
await handleUpdateLegalEntity(updatedTrust, trust2.id);
|
|
21752
21833
|
};
|
|
21753
21834
|
const exemptSettlorNamesTheSame = (existingSettlor, newSettlor) => JSON.stringify(existingSettlor.exemptSettlorName) === JSON.stringify(newSettlor.exemptSettlorName);
|
|
21754
21835
|
const updateExemptSettlorName = async ({
|
|
@@ -21798,186 +21879,7 @@ function AccountSetupRejected() {
|
|
|
21798
21879
|
content
|
|
21799
21880
|
});
|
|
21800
21881
|
}
|
|
21801
|
-
const
|
|
21802
|
-
const iconStatus = (current, min, max) => {
|
|
21803
|
-
const isEmpty2 = current === 0;
|
|
21804
|
-
const isWithinObligatoryRange = current === max || min > 0 && current >= min;
|
|
21805
|
-
const isWithinConditionalRange = current >= min;
|
|
21806
|
-
if (isEmpty2) {
|
|
21807
|
-
return min > 0 ? "obligatoryEmpty" : "conditionalEmpty";
|
|
21808
|
-
}
|
|
21809
|
-
if (isWithinObligatoryRange) {
|
|
21810
|
-
return "obligatoryFinished";
|
|
21811
|
-
}
|
|
21812
|
-
return isWithinConditionalRange ? "conditionalFinished" : "conditionalEmpty";
|
|
21813
|
-
};
|
|
21814
|
-
const entityStatusRoles = {
|
|
21815
|
-
...decisionMakerRoles,
|
|
21816
|
-
...trustMemberGuidanceRoles
|
|
21817
|
-
};
|
|
21818
|
-
const getEntityStatusTagColor = (entityLabel) => {
|
|
21819
|
-
var _a;
|
|
21820
|
-
return (_a = entityStatusRoles[entityLabel]) == null ? void 0 : _a.className;
|
|
21821
|
-
};
|
|
21822
|
-
const getEntityStatusName = (entityLabel) => {
|
|
21823
|
-
var _a;
|
|
21824
|
-
return (_a = entityStatusRoles[entityLabel]) == null ? void 0 : _a.name;
|
|
21825
|
-
};
|
|
21826
|
-
const getEntityStatusRuleDescription = (country2, currentTask, entityLabel) => currentTask === TaskTypes.TRUST_MEMBER_OVERVIEW ? TRUST_DEFAULT_DESCRIPTIONS_MAP[entityLabel] : getDecisionMakerDescriptionMap(country2)[entityLabel];
|
|
21827
|
-
const _cardGroup_component = "";
|
|
21828
|
-
function CardGroup({
|
|
21829
|
-
className,
|
|
21830
|
-
children
|
|
21831
|
-
}) {
|
|
21832
|
-
return jsx("section", {
|
|
21833
|
-
className: cx("adl-card-group", className),
|
|
21834
|
-
children
|
|
21835
|
-
});
|
|
21836
|
-
}
|
|
21837
|
-
const _entityAssociation_component = "";
|
|
21838
|
-
const Status$1 = "";
|
|
21839
|
-
const Status = ({
|
|
21840
|
-
text,
|
|
21841
|
-
className,
|
|
21842
|
-
iconStatusClass,
|
|
21843
|
-
icon
|
|
21844
|
-
}) => {
|
|
21845
|
-
const containerClasses = cx("adl-status", className);
|
|
21846
|
-
const iconClasses = cx("adl-status__icon", iconStatusClass);
|
|
21847
|
-
return jsxs("div", {
|
|
21848
|
-
className: containerClasses,
|
|
21849
|
-
children: [jsx("span", {
|
|
21850
|
-
className: iconClasses,
|
|
21851
|
-
children: icon === "loading" ? jsx(Loader, {
|
|
21852
|
-
size: "xsmall",
|
|
21853
|
-
dot: true
|
|
21854
|
-
}) : jsx(Icon, {
|
|
21855
|
-
name: icon
|
|
21856
|
-
})
|
|
21857
|
-
}), jsx("span", {
|
|
21858
|
-
className: "adl-status__text",
|
|
21859
|
-
children: text
|
|
21860
|
-
})]
|
|
21861
|
-
});
|
|
21862
|
-
};
|
|
21863
|
-
const TaskItemStatus = ({
|
|
21864
|
-
status,
|
|
21865
|
-
downloadHandler
|
|
21866
|
-
}) => {
|
|
21867
|
-
const {
|
|
21868
|
-
i18n
|
|
21869
|
-
} = useI18nContext();
|
|
21870
|
-
const handleDownloadClick = (e) => {
|
|
21871
|
-
e.stopPropagation();
|
|
21872
|
-
downloadHandler == null ? void 0 : downloadHandler();
|
|
21873
|
-
};
|
|
21874
|
-
switch (status) {
|
|
21875
|
-
case TaskStatus.DOWNLOAD:
|
|
21876
|
-
return jsxs("span", {
|
|
21877
|
-
className: "adl-status--download",
|
|
21878
|
-
role: "button",
|
|
21879
|
-
tabIndex: 0,
|
|
21880
|
-
icon: "download",
|
|
21881
|
-
onClick: handleDownloadClick,
|
|
21882
|
-
children: [i18n.get("download"), " "]
|
|
21883
|
-
});
|
|
21884
|
-
case TaskStatus.FINISHED:
|
|
21885
|
-
return jsx(Status, {
|
|
21886
|
-
className: "adl-status--finished",
|
|
21887
|
-
iconStatusClass: "adl-status__icon--finished",
|
|
21888
|
-
icon: "check",
|
|
21889
|
-
text: i18n.get("verified")
|
|
21890
|
-
});
|
|
21891
|
-
case TaskStatus.SIGNED:
|
|
21892
|
-
return jsx(Status, {
|
|
21893
|
-
className: "adl-status--finished",
|
|
21894
|
-
iconStatusClass: "adl-status__icon--finished",
|
|
21895
|
-
icon: "check",
|
|
21896
|
-
text: i18n.get("signed")
|
|
21897
|
-
});
|
|
21898
|
-
case TaskStatus.ERROR:
|
|
21899
|
-
return jsx(Status, {
|
|
21900
|
-
className: "adl-status--error",
|
|
21901
|
-
iconStatusClass: "adl-status__icon--error",
|
|
21902
|
-
icon: "info-circle",
|
|
21903
|
-
text: i18n.get("unsuccessful")
|
|
21904
|
-
});
|
|
21905
|
-
case TaskStatus.PROCESSING:
|
|
21906
|
-
return jsx(Status, {
|
|
21907
|
-
className: "",
|
|
21908
|
-
iconStatusClass: "",
|
|
21909
|
-
icon: "loading",
|
|
21910
|
-
text: i18n.get("inReview")
|
|
21911
|
-
});
|
|
21912
|
-
case TaskStatus.SIGN:
|
|
21913
|
-
return jsx("span", {
|
|
21914
|
-
className: "adl-task-status-sign",
|
|
21915
|
-
children: i18n.get("sign")
|
|
21916
|
-
});
|
|
21917
|
-
case TaskStatus.SUBMIT:
|
|
21918
|
-
return jsx("span", {
|
|
21919
|
-
className: "adl-task-status-submit",
|
|
21920
|
-
children: i18n.get("submit")
|
|
21921
|
-
});
|
|
21922
|
-
case TaskStatus.REMOVING:
|
|
21923
|
-
return jsx(Status, {
|
|
21924
|
-
className: "",
|
|
21925
|
-
iconStatusClass: "",
|
|
21926
|
-
icon: "loading",
|
|
21927
|
-
text: i18n.get("removing")
|
|
21928
|
-
});
|
|
21929
|
-
case "review":
|
|
21930
|
-
return jsx("span", {
|
|
21931
|
-
className: "adl-task-status-details-required",
|
|
21932
|
-
children: i18n.get("verify")
|
|
21933
|
-
});
|
|
21934
|
-
case TaskStatus.DETAILS_REQUIRED:
|
|
21935
|
-
case TaskStatus.EMPTY:
|
|
21936
|
-
default:
|
|
21937
|
-
return jsx("span", {
|
|
21938
|
-
className: "adl-task-status-details-required",
|
|
21939
|
-
children: i18n.get("add")
|
|
21940
|
-
});
|
|
21941
|
-
}
|
|
21942
|
-
};
|
|
21943
|
-
const VerificationErrorAlert = ({
|
|
21944
|
-
className,
|
|
21945
|
-
problems
|
|
21946
|
-
}) => {
|
|
21947
|
-
const {
|
|
21948
|
-
i18n
|
|
21949
|
-
} = useI18nContext();
|
|
21950
|
-
if ((problems == null ? void 0 : problems.verificationErrors) && Object.keys(problems.verificationErrors).length > 0) {
|
|
21951
|
-
const childErrors = Object.values(problems.verificationErrors).reduce((acc, parentChildErrors) => {
|
|
21952
|
-
acc = {
|
|
21953
|
-
...acc,
|
|
21954
|
-
...parentChildErrors
|
|
21955
|
-
};
|
|
21956
|
-
return acc;
|
|
21957
|
-
}, {});
|
|
21958
|
-
const childErrorCodes = Object.keys(childErrors);
|
|
21959
|
-
if (childErrorCodes.length === 1) {
|
|
21960
|
-
const remediationActions = Object.values(childErrors[childErrorCodes[0]]).flat();
|
|
21961
|
-
if (remediationActions.length === 1) {
|
|
21962
|
-
const childErrorMsg = i18n.get(`errorMessage_${childErrorCodes[0]}`);
|
|
21963
|
-
const remediationActionMsg = i18n.get(`remediationMessage_${remediationActions[0].code}`);
|
|
21964
|
-
return jsx(Alert, {
|
|
21965
|
-
className,
|
|
21966
|
-
hasCloseButton: false,
|
|
21967
|
-
type: AlertTypes.ERROR,
|
|
21968
|
-
title: `${childErrorMsg}. ${remediationActionMsg}`
|
|
21969
|
-
});
|
|
21970
|
-
}
|
|
21971
|
-
}
|
|
21972
|
-
}
|
|
21973
|
-
return jsx(Alert, {
|
|
21974
|
-
className,
|
|
21975
|
-
hasCloseButton: false,
|
|
21976
|
-
type: AlertTypes.ERROR,
|
|
21977
|
-
title: i18n.get("verificationErrorMessage")
|
|
21978
|
-
});
|
|
21979
|
-
};
|
|
21980
|
-
const _card_component = "";
|
|
21882
|
+
const _businessTypeSelection_component = "";
|
|
21981
21883
|
const _heading_component = "";
|
|
21982
21884
|
const headingTypes = {
|
|
21983
21885
|
1: ({
|
|
@@ -22028,18 +21930,659 @@ function Heading({
|
|
|
22028
21930
|
children
|
|
22029
21931
|
});
|
|
22030
21932
|
}
|
|
22031
|
-
|
|
22032
|
-
|
|
22033
|
-
|
|
22034
|
-
|
|
22035
|
-
|
|
22036
|
-
|
|
22037
|
-
|
|
22038
|
-
|
|
22039
|
-
|
|
22040
|
-
onKeyDown
|
|
21933
|
+
const _toast = "";
|
|
21934
|
+
function Toast({
|
|
21935
|
+
label,
|
|
21936
|
+
subLabel,
|
|
21937
|
+
actionLabel,
|
|
21938
|
+
type,
|
|
21939
|
+
duration = 3500,
|
|
21940
|
+
onToastHide,
|
|
21941
|
+
onToastAction
|
|
22041
21942
|
}) {
|
|
22042
|
-
const
|
|
21943
|
+
const toastRef = useRef(null);
|
|
21944
|
+
const loading2 = type === ToastType.LOADING;
|
|
21945
|
+
const successToast = type === ToastType.SUCCESS;
|
|
21946
|
+
const labelId = getUniqueId("toast");
|
|
21947
|
+
const handleShow = useCallback(() => {
|
|
21948
|
+
var _a;
|
|
21949
|
+
return (_a = toastRef.current) == null ? void 0 : _a.classList.add("adl-toast--visible");
|
|
21950
|
+
}, []);
|
|
21951
|
+
const handleHide = useCallback(() => {
|
|
21952
|
+
var _a;
|
|
21953
|
+
(_a = toastRef.current) == null ? void 0 : _a.classList.remove("adl-toast--visible");
|
|
21954
|
+
onToastHide();
|
|
21955
|
+
}, [onToastHide]);
|
|
21956
|
+
useEffect(() => {
|
|
21957
|
+
handleShow();
|
|
21958
|
+
if (duration !== "indefinite") {
|
|
21959
|
+
setTimeout(() => handleHide(), duration);
|
|
21960
|
+
}
|
|
21961
|
+
}, [label, duration, handleHide, handleShow]);
|
|
21962
|
+
return jsxs("div", {
|
|
21963
|
+
ref: toastRef,
|
|
21964
|
+
role: actionLabel ? "alertdialog" : "alert",
|
|
21965
|
+
className: "adl-toast",
|
|
21966
|
+
"aria-labelledby": labelId,
|
|
21967
|
+
children: [loading2 && jsx("div", {
|
|
21968
|
+
className: "adl-toast__loader",
|
|
21969
|
+
children: jsx("div", {
|
|
21970
|
+
className: "adl-loading-indicator adl-loading-indicator--small adl-loading-indicator--dark"
|
|
21971
|
+
})
|
|
21972
|
+
}), !loading2 && jsxs("div", {
|
|
21973
|
+
className: cx("adl-toast__status", {
|
|
21974
|
+
"adl-toast__status--success": successToast,
|
|
21975
|
+
"adl-toast__status--error": !successToast
|
|
21976
|
+
}),
|
|
21977
|
+
children: [successToast && jsx(Icon, {
|
|
21978
|
+
className: "adl-toast__status-icon",
|
|
21979
|
+
name: "checkmark"
|
|
21980
|
+
}), !successToast && jsx(Icon, {
|
|
21981
|
+
className: "adl-toast__status-icon",
|
|
21982
|
+
name: "cross"
|
|
21983
|
+
})]
|
|
21984
|
+
}), jsxs("div", {
|
|
21985
|
+
className: "adl-toast__message",
|
|
21986
|
+
children: [jsx("span", {
|
|
21987
|
+
id: labelId,
|
|
21988
|
+
className: "adl-toast__title",
|
|
21989
|
+
children: label
|
|
21990
|
+
}), actionLabel && jsx("button", {
|
|
21991
|
+
className: "adl-link adl-toast__action",
|
|
21992
|
+
title: "performAction",
|
|
21993
|
+
type: "button",
|
|
21994
|
+
onClick: onToastAction,
|
|
21995
|
+
children: actionLabel
|
|
21996
|
+
}), !loading2 && subLabel && jsx("span", {
|
|
21997
|
+
className: "adl-toast__subtitle",
|
|
21998
|
+
children: subLabel
|
|
21999
|
+
})]
|
|
22000
|
+
}), !loading2 && jsx("button", {
|
|
22001
|
+
className: "adl-toast__close",
|
|
22002
|
+
title: "close",
|
|
22003
|
+
type: "button",
|
|
22004
|
+
onClick: handleHide,
|
|
22005
|
+
children: jsx(Icon, {
|
|
22006
|
+
name: "cross"
|
|
22007
|
+
})
|
|
22008
|
+
})]
|
|
22009
|
+
});
|
|
22010
|
+
}
|
|
22011
|
+
const businessTypes = [{
|
|
22012
|
+
id: "individual",
|
|
22013
|
+
accountHolder: "myName",
|
|
22014
|
+
name: "individual",
|
|
22015
|
+
description: "youAreNotSoleProprietorAndUseBankAccount"
|
|
22016
|
+
}, {
|
|
22017
|
+
id: "soleProprietorship",
|
|
22018
|
+
accountHolder: "mySoleProprietorName",
|
|
22019
|
+
name: "soleProprietorship",
|
|
22020
|
+
description: "youAreRegisteredSoleProprietorAndUseBankAccount"
|
|
22021
|
+
}, {
|
|
22022
|
+
id: "company",
|
|
22023
|
+
accountHolder: "theCompanyIWorkFor",
|
|
22024
|
+
name: "company",
|
|
22025
|
+
description: "youUseCompanyBankAccount"
|
|
22026
|
+
}, {
|
|
22027
|
+
id: "legalArrangement",
|
|
22028
|
+
name: "trustPartnershipOrAssociation",
|
|
22029
|
+
description: "youAreIndividualOrCompanyAndUseBankAccountInNameOfTrustPartnershipOrAssociation"
|
|
22030
|
+
}];
|
|
22031
|
+
const legalArrangementItems = [{
|
|
22032
|
+
id: "aTrust",
|
|
22033
|
+
accountHolder: "aTrust",
|
|
22034
|
+
name: "trust",
|
|
22035
|
+
description: "youAreTrusteeManagingTheTrustForBeneficiaries"
|
|
22036
|
+
}, {
|
|
22037
|
+
id: "aPartnership",
|
|
22038
|
+
accountHolder: "aPartnership",
|
|
22039
|
+
name: "partnership",
|
|
22040
|
+
description: "jointlyOwnedBusinessWhereTwoOrMorePeopleOperateAndShareProfits"
|
|
22041
|
+
}, {
|
|
22042
|
+
id: "anAssociation",
|
|
22043
|
+
accountHolder: "anAssociation",
|
|
22044
|
+
name: "association",
|
|
22045
|
+
description: "groupOfPeopleActingTogetherForNonCommercialPurpose"
|
|
22046
|
+
}];
|
|
22047
|
+
const trusteeTypeItems = [{
|
|
22048
|
+
id: "individual",
|
|
22049
|
+
name: "individual"
|
|
22050
|
+
}, {
|
|
22051
|
+
id: "company",
|
|
22052
|
+
name: "company"
|
|
22053
|
+
}];
|
|
22054
|
+
const getFormSchema = (isLegalArrangement, isTrust) => {
|
|
22055
|
+
const schema = ["businessType"];
|
|
22056
|
+
if (isLegalArrangement) {
|
|
22057
|
+
schema.push("legalArrangement");
|
|
22058
|
+
}
|
|
22059
|
+
if (isTrust) {
|
|
22060
|
+
schema.push("trusteeType");
|
|
22061
|
+
}
|
|
22062
|
+
return schema;
|
|
22063
|
+
};
|
|
22064
|
+
const getBusinessTypes = (includeTrust, includeSoleProp) => businessTypes.filter((businessType) => {
|
|
22065
|
+
if (businessType.id === "legalArrangement") {
|
|
22066
|
+
return includeTrust;
|
|
22067
|
+
}
|
|
22068
|
+
if (businessType.id === "soleProprietorship") {
|
|
22069
|
+
return includeSoleProp;
|
|
22070
|
+
}
|
|
22071
|
+
return true;
|
|
22072
|
+
});
|
|
22073
|
+
const businessTypeSelectionValidationRules = {
|
|
22074
|
+
businessType: {
|
|
22075
|
+
modes: ["blur"],
|
|
22076
|
+
validate: (businessType) => !!businessType,
|
|
22077
|
+
errorMessage: "fieldIsRequired"
|
|
22078
|
+
},
|
|
22079
|
+
legalArrangement: {
|
|
22080
|
+
modes: ["blur"],
|
|
22081
|
+
validate: (legalArrangement) => !!legalArrangement,
|
|
22082
|
+
errorMessage: "fieldIsRequired"
|
|
22083
|
+
},
|
|
22084
|
+
trusteeType: {
|
|
22085
|
+
modes: ["blur"],
|
|
22086
|
+
validate: (trusteeType) => !!trusteeType,
|
|
22087
|
+
errorMessage: "fieldIsRequired"
|
|
22088
|
+
}
|
|
22089
|
+
};
|
|
22090
|
+
const businessTypeSelectionStepTitles = {
|
|
22091
|
+
[
|
|
22092
|
+
0
|
|
22093
|
+
/* BUSINESS_TYPE_SELECTION */
|
|
22094
|
+
]: "whatBestDescribesYourBusinessSetup",
|
|
22095
|
+
[
|
|
22096
|
+
1
|
|
22097
|
+
/* LEGAL_ARRANGEMENT_SELECTION */
|
|
22098
|
+
]: "whichLegalArrangementDoesYourBusinessHave",
|
|
22099
|
+
[
|
|
22100
|
+
2
|
|
22101
|
+
/* WE_CANNOT_SET_UP_ACCOUNT */
|
|
22102
|
+
]: "sorryWeCantSetUpAnAccountForYou",
|
|
22103
|
+
[
|
|
22104
|
+
3
|
|
22105
|
+
/* CONFIRM_BUSINESS_SETUP_CHANGE */
|
|
22106
|
+
]: "changeYourBusinessSetup"
|
|
22107
|
+
};
|
|
22108
|
+
const getTargetLegalEntityType = (businessType, legalArrangement, trusteeType, currentLegalEntityType) => {
|
|
22109
|
+
const isIndividual = currentLegalEntityType === LegalEntityType.INDIVIDUAL;
|
|
22110
|
+
const isOrganization = currentLegalEntityType === LegalEntityType.ORGANIZATION;
|
|
22111
|
+
if (isIndividual && businessType === "legalArrangement" && legalArrangement === "aTrust" && trusteeType === "company" || businessType === "company") {
|
|
22112
|
+
return LegalEntityType.ORGANIZATION;
|
|
22113
|
+
}
|
|
22114
|
+
if (isOrganization && businessType === "legalArrangement" && legalArrangement === "aTrust" && trusteeType === "individual" || businessType === "individual" || businessType === "soleProprietorship") {
|
|
22115
|
+
return LegalEntityType.INDIVIDUAL;
|
|
22116
|
+
}
|
|
22117
|
+
return currentLegalEntityType;
|
|
22118
|
+
};
|
|
22119
|
+
const BusinessTypeSelection = ({
|
|
22120
|
+
legalEntityResponse,
|
|
22121
|
+
accountHolder: accountHolder2,
|
|
22122
|
+
showTrustOption,
|
|
22123
|
+
showSolePropOption,
|
|
22124
|
+
onAccountHolderSelect,
|
|
22125
|
+
handleUpdateLegalEntity
|
|
22126
|
+
}) => {
|
|
22127
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
22128
|
+
const {
|
|
22129
|
+
i18n
|
|
22130
|
+
} = useI18nContext();
|
|
22131
|
+
const {
|
|
22132
|
+
showToast
|
|
22133
|
+
} = useToastContext();
|
|
22134
|
+
const [loadingStatus, setLoadingStatus] = useState();
|
|
22135
|
+
const [currentStep, setCurrentStep] = useState(
|
|
22136
|
+
0
|
|
22137
|
+
/* BUSINESS_TYPE_SELECTION */
|
|
22138
|
+
);
|
|
22139
|
+
const [formSchema, setFormSchema] = useState(["businessType"]);
|
|
22140
|
+
const hasBackButton = [
|
|
22141
|
+
1,
|
|
22142
|
+
2
|
|
22143
|
+
/* WE_CANNOT_SET_UP_ACCOUNT */
|
|
22144
|
+
].includes(currentStep);
|
|
22145
|
+
const businessTypeItems = getBusinessTypes(showTrustOption, showSolePropOption);
|
|
22146
|
+
const getDefaultBusinessType = () => {
|
|
22147
|
+
if (accountHolder2) {
|
|
22148
|
+
if (["aTrust", "aPartnership", "anAssociation"].includes(accountHolder2)) {
|
|
22149
|
+
return businessTypeItems.find((businessTypeItem) => businessTypeItem.id === "legalArrangement");
|
|
22150
|
+
}
|
|
22151
|
+
return businessTypeItems.find((businessTypeItem) => businessTypeItem.accountHolder === accountHolder2);
|
|
22152
|
+
}
|
|
22153
|
+
switch (legalEntityResponse.type) {
|
|
22154
|
+
case LegalEntityType.ORGANIZATION:
|
|
22155
|
+
return businessTypeItems.find((businessTypeItem) => businessTypeItem.id === "company");
|
|
22156
|
+
case LegalEntityType.INDIVIDUAL:
|
|
22157
|
+
return businessTypeItems.find((businessTypeItem) => businessTypeItem.id === "individual");
|
|
22158
|
+
}
|
|
22159
|
+
};
|
|
22160
|
+
const getDefaultLegalArrangementType = () => accountHolder2 && legalArrangementItems.find((item) => item.accountHolder === accountHolder2);
|
|
22161
|
+
const defaultTrusteeType = legalEntityResponse.type === LegalEntityType.INDIVIDUAL ? trusteeTypeItems[0] : trusteeTypeItems[1];
|
|
22162
|
+
const {
|
|
22163
|
+
handleChangeFor,
|
|
22164
|
+
triggerValidation,
|
|
22165
|
+
data,
|
|
22166
|
+
valid,
|
|
22167
|
+
errors,
|
|
22168
|
+
isValid
|
|
22169
|
+
} = useForm({
|
|
22170
|
+
schema: formSchema,
|
|
22171
|
+
defaultData: {
|
|
22172
|
+
businessType: getDefaultBusinessType(),
|
|
22173
|
+
legalArrangement: getDefaultLegalArrangementType(),
|
|
22174
|
+
trusteeType: defaultTrusteeType
|
|
22175
|
+
},
|
|
22176
|
+
rules: businessTypeSelectionValidationRules
|
|
22177
|
+
});
|
|
22178
|
+
const newAccountHolder = ((_a = data.businessType) == null ? void 0 : _a.accountHolder) || ((_b = data.legalArrangement) == null ? void 0 : _b.accountHolder);
|
|
22179
|
+
const targetLegalEntityType = getTargetLegalEntityType((_c = data.businessType) == null ? void 0 : _c.id, (_d = data.legalArrangement) == null ? void 0 : _d.id, (_e = data.trusteeType) == null ? void 0 : _e.id, legalEntityResponse == null ? void 0 : legalEntityResponse.type);
|
|
22180
|
+
useEffect(() => {
|
|
22181
|
+
var _a2, _b2;
|
|
22182
|
+
setFormSchema(getFormSchema(((_a2 = data.businessType) == null ? void 0 : _a2.id) === "legalArrangement" && !!data.legalArrangement || currentStep === 1, ((_b2 = data.legalArrangement) == null ? void 0 : _b2.id) === "aTrust"));
|
|
22183
|
+
}, [data.businessType, data.legalArrangement, currentStep]);
|
|
22184
|
+
const handleNextClick = async () => {
|
|
22185
|
+
var _a2, _b2, _c2;
|
|
22186
|
+
if (loadingStatus === "loading")
|
|
22187
|
+
return;
|
|
22188
|
+
triggerValidation();
|
|
22189
|
+
if (isValid) {
|
|
22190
|
+
if (((_a2 = data.businessType) == null ? void 0 : _a2.id) === "legalArrangement") {
|
|
22191
|
+
if (currentStep !== 1) {
|
|
22192
|
+
setCurrentStep(
|
|
22193
|
+
1
|
|
22194
|
+
/* LEGAL_ARRANGEMENT_SELECTION */
|
|
22195
|
+
);
|
|
22196
|
+
return;
|
|
22197
|
+
}
|
|
22198
|
+
if (((_b2 = data.legalArrangement) == null ? void 0 : _b2.id) === "aPartnership" || ((_c2 = data.legalArrangement) == null ? void 0 : _c2.id) === "anAssociation") {
|
|
22199
|
+
setCurrentStep(
|
|
22200
|
+
2
|
|
22201
|
+
/* WE_CANNOT_SET_UP_ACCOUNT */
|
|
22202
|
+
);
|
|
22203
|
+
return;
|
|
22204
|
+
}
|
|
22205
|
+
}
|
|
22206
|
+
}
|
|
22207
|
+
if (newAccountHolder !== accountHolder2 || targetLegalEntityType !== legalEntityResponse.type) {
|
|
22208
|
+
if (accountHolder2) {
|
|
22209
|
+
setCurrentStep(
|
|
22210
|
+
3
|
|
22211
|
+
/* CONFIRM_BUSINESS_SETUP_CHANGE */
|
|
22212
|
+
);
|
|
22213
|
+
} else {
|
|
22214
|
+
await updateLegalEntityAndSelectAccountHolder();
|
|
22215
|
+
}
|
|
22216
|
+
} else {
|
|
22217
|
+
onAccountHolderSelect(newAccountHolder);
|
|
22218
|
+
}
|
|
22219
|
+
};
|
|
22220
|
+
const updateLegalEntityAndSelectAccountHolder = async () => {
|
|
22221
|
+
try {
|
|
22222
|
+
if (legalEntityResponse.type !== targetLegalEntityType) {
|
|
22223
|
+
setLoadingStatus("loading");
|
|
22224
|
+
await (handleUpdateLegalEntity == null ? void 0 : handleUpdateLegalEntity({
|
|
22225
|
+
type: targetLegalEntityType,
|
|
22226
|
+
entityAssociations: []
|
|
22227
|
+
}, legalEntityResponse == null ? void 0 : legalEntityResponse.id));
|
|
22228
|
+
}
|
|
22229
|
+
} catch (e) {
|
|
22230
|
+
showToast({
|
|
22231
|
+
label: i18n.get("failedToUpdateDetails"),
|
|
22232
|
+
type: ToastType.ERROR
|
|
22233
|
+
});
|
|
22234
|
+
} finally {
|
|
22235
|
+
setLoadingStatus("success");
|
|
22236
|
+
onAccountHolderSelect(newAccountHolder);
|
|
22237
|
+
}
|
|
22238
|
+
};
|
|
22239
|
+
const handleBackClick = () => {
|
|
22240
|
+
if (currentStep === 2) {
|
|
22241
|
+
setCurrentStep(
|
|
22242
|
+
1
|
|
22243
|
+
/* LEGAL_ARRANGEMENT_SELECTION */
|
|
22244
|
+
);
|
|
22245
|
+
}
|
|
22246
|
+
if (currentStep === 1) {
|
|
22247
|
+
setCurrentStep(
|
|
22248
|
+
0
|
|
22249
|
+
/* BUSINESS_TYPE_SELECTION */
|
|
22250
|
+
);
|
|
22251
|
+
}
|
|
22252
|
+
};
|
|
22253
|
+
const isWeCannotSetUpAccountStep = currentStep === 2;
|
|
22254
|
+
return jsx(LoaderWrapper, {
|
|
22255
|
+
status: loadingStatus,
|
|
22256
|
+
formOpacityWhenLoading: 0.3,
|
|
22257
|
+
showSpinner: false,
|
|
22258
|
+
children: jsxs("div", {
|
|
22259
|
+
className: "adyen-kyc-business-type-selection",
|
|
22260
|
+
children: [jsx("header", {
|
|
22261
|
+
children: jsx(Heading, {
|
|
22262
|
+
level: 1,
|
|
22263
|
+
children: i18n.get(businessTypeSelectionStepTitles[currentStep])
|
|
22264
|
+
})
|
|
22265
|
+
}), currentStep === 0 && jsx(Field, {
|
|
22266
|
+
name: "businessType",
|
|
22267
|
+
useLabelElement: false,
|
|
22268
|
+
errorMessage: i18n.get((_f = errors.businessType) == null ? void 0 : _f.errorMessage),
|
|
22269
|
+
showErrorIconBottom: true,
|
|
22270
|
+
isValid: valid.businessType,
|
|
22271
|
+
children: (childProps) => jsx(RadioGroupCard, {
|
|
22272
|
+
...childProps,
|
|
22273
|
+
name: "businessType",
|
|
22274
|
+
items: businessTypeItems,
|
|
22275
|
+
selected: businessTypeItems.find((type) => {
|
|
22276
|
+
var _a2;
|
|
22277
|
+
return type.id === ((_a2 = data.businessType) == null ? void 0 : _a2.id);
|
|
22278
|
+
}),
|
|
22279
|
+
onSelect: (item) => handleChangeFor("businessType")(item)
|
|
22280
|
+
})
|
|
22281
|
+
}), currentStep === 1 && jsxs(Fragment, {
|
|
22282
|
+
children: [jsx(Field, {
|
|
22283
|
+
name: "legalArrangement",
|
|
22284
|
+
useLabelElement: false,
|
|
22285
|
+
errorMessage: i18n.get((_g = errors.legalArrangement) == null ? void 0 : _g.errorMessage),
|
|
22286
|
+
showErrorIconBottom: true,
|
|
22287
|
+
isValid: valid.legalArrangement,
|
|
22288
|
+
children: (childProps) => jsx(RadioGroupCard, {
|
|
22289
|
+
...childProps,
|
|
22290
|
+
name: "legalArrangement",
|
|
22291
|
+
items: legalArrangementItems,
|
|
22292
|
+
selected: legalArrangementItems.find((legalArrangementItem) => {
|
|
22293
|
+
var _a2;
|
|
22294
|
+
return legalArrangementItem.id === ((_a2 = data.legalArrangement) == null ? void 0 : _a2.id);
|
|
22295
|
+
}),
|
|
22296
|
+
onSelect: (item) => handleChangeFor("legalArrangement")(item)
|
|
22297
|
+
})
|
|
22298
|
+
}), ((_h = data.legalArrangement) == null ? void 0 : _h.id) === "aTrust" && jsx(Field, {
|
|
22299
|
+
name: "trusteeType",
|
|
22300
|
+
label: i18n.get("whatTypeOfTrusteeAreYou"),
|
|
22301
|
+
className: "adl-u-margin-top-32",
|
|
22302
|
+
useLabelElement: false,
|
|
22303
|
+
errorMessage: i18n.get((_i = errors.trusteeType) == null ? void 0 : _i.errorMessage),
|
|
22304
|
+
showErrorIconBottom: true,
|
|
22305
|
+
isValid: valid.trusteeType,
|
|
22306
|
+
children: (childProps) => jsx(RadioGroupCard, {
|
|
22307
|
+
className: "adyen-kyc-trustee-type-radio-group-card",
|
|
22308
|
+
itemLabelClassName: () => "adl-u-width-full",
|
|
22309
|
+
...childProps,
|
|
22310
|
+
name: "trusteeType",
|
|
22311
|
+
items: trusteeTypeItems,
|
|
22312
|
+
selected: trusteeTypeItems.find((type) => {
|
|
22313
|
+
var _a2;
|
|
22314
|
+
return type.id === ((_a2 = data.trusteeType) == null ? void 0 : _a2.id);
|
|
22315
|
+
}),
|
|
22316
|
+
onSelect: (item) => handleChangeFor("trusteeType")(item)
|
|
22317
|
+
})
|
|
22318
|
+
})]
|
|
22319
|
+
}), isWeCannotSetUpAccountStep && jsxs(Fragment, {
|
|
22320
|
+
children: [jsx("p", {
|
|
22321
|
+
children: i18n.get("ourFinancialServicesAreNotAvailableYetForPartnershipsAndAssociations")
|
|
22322
|
+
}), jsx("p", {
|
|
22323
|
+
className: "u-margin-top-32",
|
|
22324
|
+
children: i18n.get("needHelpYouCanAlwaysReachOutToCustomerSupport")
|
|
22325
|
+
})]
|
|
22326
|
+
}), currentStep === 3 ? jsxs(Fragment, {
|
|
22327
|
+
children: [jsx("p", {
|
|
22328
|
+
children: i18n.get("someInformationWillNotBeSaved")
|
|
22329
|
+
}), jsxs("div", {
|
|
22330
|
+
className: "adyen-kyc-business-type-selection__confirm",
|
|
22331
|
+
children: [jsx(Button, {
|
|
22332
|
+
label: i18n.get("cancel"),
|
|
22333
|
+
secondary: true,
|
|
22334
|
+
onClick: () => setCurrentStep(
|
|
22335
|
+
0
|
|
22336
|
+
/* BUSINESS_TYPE_SELECTION */
|
|
22337
|
+
),
|
|
22338
|
+
type: "button"
|
|
22339
|
+
}), jsx(Button, {
|
|
22340
|
+
label: i18n.get("yesChange"),
|
|
22341
|
+
onClick: () => updateLegalEntityAndSelectAccountHolder(),
|
|
22342
|
+
type: "button"
|
|
22343
|
+
})]
|
|
22344
|
+
})]
|
|
22345
|
+
}) : jsxs("div", {
|
|
22346
|
+
className: "adyen-kyc-business-type-selection__nav",
|
|
22347
|
+
children: [!isWeCannotSetUpAccountStep && jsx(Button, {
|
|
22348
|
+
label: i18n.get("next"),
|
|
22349
|
+
block: true,
|
|
22350
|
+
disabled: currentStep === 1 && !data.legalArrangement,
|
|
22351
|
+
onClick: handleNextClick,
|
|
22352
|
+
type: "button"
|
|
22353
|
+
}), hasBackButton && jsx(Button, {
|
|
22354
|
+
label: i18n.get("back"),
|
|
22355
|
+
showAsLink: !isWeCannotSetUpAccountStep,
|
|
22356
|
+
block: isWeCannotSetUpAccountStep,
|
|
22357
|
+
onClick: handleBackClick,
|
|
22358
|
+
type: "button",
|
|
22359
|
+
className: "adl-u-margin-top-16"
|
|
22360
|
+
})]
|
|
22361
|
+
})]
|
|
22362
|
+
})
|
|
22363
|
+
});
|
|
22364
|
+
};
|
|
22365
|
+
const DecisionMakers = "";
|
|
22366
|
+
function useDataMissingRemediations({
|
|
22367
|
+
legalEntityId,
|
|
22368
|
+
problems
|
|
22369
|
+
}) {
|
|
22370
|
+
const {
|
|
22371
|
+
i18n
|
|
22372
|
+
} = useI18nContext();
|
|
22373
|
+
const decisionMakersRemediationMessage = useMemo(() => {
|
|
22374
|
+
var _a, _b;
|
|
22375
|
+
const remediationCodes = (_b = (_a = problems[EntityType.LEGAL_ENTITY]) == null ? void 0 : _a[legalEntityId]) == null ? void 0 : _b.missingData.reduce((remediations, error) => {
|
|
22376
|
+
const remediation = DATA_MISSING_DECISION_MAKER_ERROR_CODE_MAPPING[error.code];
|
|
22377
|
+
return remediation ? [...remediations, remediation] : remediations;
|
|
22378
|
+
}, []);
|
|
22379
|
+
switch (remediationCodes == null ? void 0 : remediationCodes.length) {
|
|
22380
|
+
case void 0:
|
|
22381
|
+
case 0:
|
|
22382
|
+
return void 0;
|
|
22383
|
+
case 1:
|
|
22384
|
+
return remediationCodes[0] ? i18n.get(`remediationMessage_${remediationCodes[0]}`) : i18n.get("missingMultipleDecisionMakers");
|
|
22385
|
+
default:
|
|
22386
|
+
return i18n.get("missingMultipleDecisionMakers");
|
|
22387
|
+
}
|
|
22388
|
+
}, [problems, i18n, legalEntityId]);
|
|
22389
|
+
return {
|
|
22390
|
+
remediationMessages: {
|
|
22391
|
+
[TaskTypes.DECISION_MAKER]: decisionMakersRemediationMessage
|
|
22392
|
+
}
|
|
22393
|
+
};
|
|
22394
|
+
}
|
|
22395
|
+
const iconStatus = (current, min, max) => {
|
|
22396
|
+
const isEmpty2 = current === 0;
|
|
22397
|
+
const isWithinObligatoryRange = current === max || min > 0 && current >= min;
|
|
22398
|
+
const isWithinConditionalRange = current >= min;
|
|
22399
|
+
if (isEmpty2) {
|
|
22400
|
+
return min > 0 ? "obligatoryEmpty" : "conditionalEmpty";
|
|
22401
|
+
}
|
|
22402
|
+
if (isWithinObligatoryRange) {
|
|
22403
|
+
return "obligatoryFinished";
|
|
22404
|
+
}
|
|
22405
|
+
return isWithinConditionalRange ? "conditionalFinished" : "conditionalEmpty";
|
|
22406
|
+
};
|
|
22407
|
+
const entityStatusRoles = {
|
|
22408
|
+
...decisionMakerRoles,
|
|
22409
|
+
...trustMemberGuidanceRoles
|
|
22410
|
+
};
|
|
22411
|
+
const getEntityStatusTagColor = (entityLabel) => {
|
|
22412
|
+
var _a;
|
|
22413
|
+
return (_a = entityStatusRoles[entityLabel]) == null ? void 0 : _a.className;
|
|
22414
|
+
};
|
|
22415
|
+
const getEntityStatusName = (entityLabel) => {
|
|
22416
|
+
var _a;
|
|
22417
|
+
return (_a = entityStatusRoles[entityLabel]) == null ? void 0 : _a.name;
|
|
22418
|
+
};
|
|
22419
|
+
const getEntityStatusRuleDescription = (country2, currentTask, entityLabel) => currentTask === TaskTypes.TRUST_MEMBER_OVERVIEW ? TRUST_DEFAULT_DESCRIPTIONS_MAP[entityLabel] : getDecisionMakerDescriptionMap(country2)[entityLabel];
|
|
22420
|
+
const _cardGroup_component = "";
|
|
22421
|
+
function CardGroup({
|
|
22422
|
+
className,
|
|
22423
|
+
children
|
|
22424
|
+
}) {
|
|
22425
|
+
return jsx("section", {
|
|
22426
|
+
className: cx("adl-card-group", className),
|
|
22427
|
+
children
|
|
22428
|
+
});
|
|
22429
|
+
}
|
|
22430
|
+
const _entityAssociation_component = "";
|
|
22431
|
+
const Status$1 = "";
|
|
22432
|
+
const Status = ({
|
|
22433
|
+
text,
|
|
22434
|
+
className,
|
|
22435
|
+
iconStatusClass,
|
|
22436
|
+
icon
|
|
22437
|
+
}) => {
|
|
22438
|
+
const containerClasses = cx("adl-status", className);
|
|
22439
|
+
const iconClasses = cx("adl-status__icon", iconStatusClass);
|
|
22440
|
+
return jsxs("div", {
|
|
22441
|
+
className: containerClasses,
|
|
22442
|
+
children: [jsx("span", {
|
|
22443
|
+
className: iconClasses,
|
|
22444
|
+
children: icon === "loading" ? jsx(Loader, {
|
|
22445
|
+
size: "xsmall",
|
|
22446
|
+
dot: true
|
|
22447
|
+
}) : jsx(Icon, {
|
|
22448
|
+
name: icon
|
|
22449
|
+
})
|
|
22450
|
+
}), jsx("span", {
|
|
22451
|
+
className: "adl-status__text",
|
|
22452
|
+
children: text
|
|
22453
|
+
})]
|
|
22454
|
+
});
|
|
22455
|
+
};
|
|
22456
|
+
const TaskItemStatus = ({
|
|
22457
|
+
status,
|
|
22458
|
+
downloadHandler
|
|
22459
|
+
}) => {
|
|
22460
|
+
const {
|
|
22461
|
+
i18n
|
|
22462
|
+
} = useI18nContext();
|
|
22463
|
+
const handleDownloadClick = (e) => {
|
|
22464
|
+
e.stopPropagation();
|
|
22465
|
+
downloadHandler == null ? void 0 : downloadHandler();
|
|
22466
|
+
};
|
|
22467
|
+
switch (status) {
|
|
22468
|
+
case TaskStatus.DOWNLOAD:
|
|
22469
|
+
return jsxs("span", {
|
|
22470
|
+
className: "adl-status--download",
|
|
22471
|
+
role: "button",
|
|
22472
|
+
tabIndex: 0,
|
|
22473
|
+
icon: "download",
|
|
22474
|
+
onClick: handleDownloadClick,
|
|
22475
|
+
children: [i18n.get("download"), " "]
|
|
22476
|
+
});
|
|
22477
|
+
case TaskStatus.FINISHED:
|
|
22478
|
+
return jsx(Status, {
|
|
22479
|
+
className: "adl-status--finished",
|
|
22480
|
+
iconStatusClass: "adl-status__icon--finished",
|
|
22481
|
+
icon: "check",
|
|
22482
|
+
text: i18n.get("verified")
|
|
22483
|
+
});
|
|
22484
|
+
case TaskStatus.SIGNED:
|
|
22485
|
+
return jsx(Status, {
|
|
22486
|
+
className: "adl-status--finished",
|
|
22487
|
+
iconStatusClass: "adl-status__icon--finished",
|
|
22488
|
+
icon: "check",
|
|
22489
|
+
text: i18n.get("signed")
|
|
22490
|
+
});
|
|
22491
|
+
case TaskStatus.ERROR:
|
|
22492
|
+
return jsx(Status, {
|
|
22493
|
+
className: "adl-status--error",
|
|
22494
|
+
iconStatusClass: "adl-status__icon--error",
|
|
22495
|
+
icon: "info-circle",
|
|
22496
|
+
text: i18n.get("unsuccessful")
|
|
22497
|
+
});
|
|
22498
|
+
case TaskStatus.PROCESSING:
|
|
22499
|
+
return jsx(Status, {
|
|
22500
|
+
className: "",
|
|
22501
|
+
iconStatusClass: "",
|
|
22502
|
+
icon: "loading",
|
|
22503
|
+
text: i18n.get("inReview")
|
|
22504
|
+
});
|
|
22505
|
+
case TaskStatus.SIGN:
|
|
22506
|
+
return jsx("span", {
|
|
22507
|
+
className: "adl-task-status-sign",
|
|
22508
|
+
children: i18n.get("sign")
|
|
22509
|
+
});
|
|
22510
|
+
case TaskStatus.SUBMIT:
|
|
22511
|
+
return jsx("span", {
|
|
22512
|
+
className: "adl-task-status-submit",
|
|
22513
|
+
children: i18n.get("submit")
|
|
22514
|
+
});
|
|
22515
|
+
case TaskStatus.REMOVING:
|
|
22516
|
+
return jsx(Status, {
|
|
22517
|
+
className: "",
|
|
22518
|
+
iconStatusClass: "",
|
|
22519
|
+
icon: "loading",
|
|
22520
|
+
text: i18n.get("removing")
|
|
22521
|
+
});
|
|
22522
|
+
case "review":
|
|
22523
|
+
return jsx("span", {
|
|
22524
|
+
className: "adl-task-status-details-required",
|
|
22525
|
+
children: i18n.get("verify")
|
|
22526
|
+
});
|
|
22527
|
+
case TaskStatus.DETAILS_REQUIRED:
|
|
22528
|
+
case TaskStatus.EMPTY:
|
|
22529
|
+
default:
|
|
22530
|
+
return jsx("span", {
|
|
22531
|
+
className: "adl-task-status-details-required",
|
|
22532
|
+
children: i18n.get("add")
|
|
22533
|
+
});
|
|
22534
|
+
}
|
|
22535
|
+
};
|
|
22536
|
+
const VerificationErrorAlert = ({
|
|
22537
|
+
className,
|
|
22538
|
+
problems
|
|
22539
|
+
}) => {
|
|
22540
|
+
const {
|
|
22541
|
+
i18n
|
|
22542
|
+
} = useI18nContext();
|
|
22543
|
+
if ((problems == null ? void 0 : problems.verificationErrors) && Object.keys(problems.verificationErrors).length > 0) {
|
|
22544
|
+
const childErrors = Object.values(problems.verificationErrors).reduce((acc, parentChildErrors) => {
|
|
22545
|
+
acc = {
|
|
22546
|
+
...acc,
|
|
22547
|
+
...parentChildErrors
|
|
22548
|
+
};
|
|
22549
|
+
return acc;
|
|
22550
|
+
}, {});
|
|
22551
|
+
const childErrorCodes = Object.keys(childErrors);
|
|
22552
|
+
if (childErrorCodes.length === 1) {
|
|
22553
|
+
const remediationActions = Object.values(childErrors[childErrorCodes[0]]).flat();
|
|
22554
|
+
if (remediationActions.length === 1) {
|
|
22555
|
+
const childErrorMsg = i18n.get(`errorMessage_${childErrorCodes[0]}`);
|
|
22556
|
+
const remediationActionMsg = i18n.get(`remediationMessage_${remediationActions[0].code}`);
|
|
22557
|
+
return jsx(Alert, {
|
|
22558
|
+
className,
|
|
22559
|
+
hasCloseButton: false,
|
|
22560
|
+
type: AlertTypes.ERROR,
|
|
22561
|
+
title: `${childErrorMsg}. ${remediationActionMsg}`
|
|
22562
|
+
});
|
|
22563
|
+
}
|
|
22564
|
+
}
|
|
22565
|
+
}
|
|
22566
|
+
return jsx(Alert, {
|
|
22567
|
+
className,
|
|
22568
|
+
hasCloseButton: false,
|
|
22569
|
+
type: AlertTypes.ERROR,
|
|
22570
|
+
title: i18n.get("verificationErrorMessage")
|
|
22571
|
+
});
|
|
22572
|
+
};
|
|
22573
|
+
const _card_component = "";
|
|
22574
|
+
function Card({
|
|
22575
|
+
className,
|
|
22576
|
+
children,
|
|
22577
|
+
stateful,
|
|
22578
|
+
active,
|
|
22579
|
+
disabled,
|
|
22580
|
+
title,
|
|
22581
|
+
subTitle,
|
|
22582
|
+
onClick,
|
|
22583
|
+
onKeyDown
|
|
22584
|
+
}) {
|
|
22585
|
+
const classNames = cx("adl-card", className, {
|
|
22043
22586
|
"adl-card--stateful": stateful,
|
|
22044
22587
|
"adl-card--active": stateful && active,
|
|
22045
22588
|
"adl-card--disabled": disabled
|
|
@@ -22396,6 +22939,12 @@ const DecisionMakersComponent = ({
|
|
|
22396
22939
|
const decisionMakers2 = getOwnDecisionMakers(legalEntityResponse);
|
|
22397
22940
|
const registeredCountry = (_b = (_a = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _a.registeredAddress) == null ? void 0 : _b.country;
|
|
22398
22941
|
const availableDecisionMakers = getAvailableDecisionMakerRoleTypes(registeredCountry);
|
|
22942
|
+
const {
|
|
22943
|
+
remediationMessages
|
|
22944
|
+
} = useDataMissingRemediations({
|
|
22945
|
+
legalEntityId: legalEntityResponse.id,
|
|
22946
|
+
problems: capabilityProblems
|
|
22947
|
+
});
|
|
22399
22948
|
const mappedDecisionMakers = decisionMakers2 == null ? void 0 : decisionMakers2.reduce((mappedDecisionMakers2, decisionMaker2) => {
|
|
22400
22949
|
var _a2;
|
|
22401
22950
|
const mappedDecisionMaker = mappedDecisionMakers2[decisionMaker2.legalEntityId];
|
|
@@ -22514,7 +23063,12 @@ const DecisionMakersComponent = ({
|
|
|
22514
23063
|
isRemoveDisabled,
|
|
22515
23064
|
handleIsRemoveDisabled: setIsRemoveDisabled
|
|
22516
23065
|
}, decisionMaker2.reference))
|
|
22517
|
-
}) : null, jsx(
|
|
23066
|
+
}) : null, remediationMessages.DECISION_MAKER && jsx(Alert, {
|
|
23067
|
+
className: "adl-decision-makers__warning",
|
|
23068
|
+
title: remediationMessages.DECISION_MAKER,
|
|
23069
|
+
hasCloseButton: false,
|
|
23070
|
+
type: AlertTypes.WARNING
|
|
23071
|
+
}), jsx(Button, {
|
|
22518
23072
|
secondary: true,
|
|
22519
23073
|
className: cx("adl-decision-makers__add", {
|
|
22520
23074
|
"adl-decision-makers__add--more": (uniqueDecisionMakers == null ? void 0 : uniqueDecisionMakers.length) > 0
|
|
@@ -22840,6 +23394,45 @@ const TaskIntros = ({
|
|
|
22840
23394
|
}) : null;
|
|
22841
23395
|
};
|
|
22842
23396
|
const TaskList = "";
|
|
23397
|
+
const businessTypeMapping = {
|
|
23398
|
+
myName: {
|
|
23399
|
+
[LegalEntityType.INDIVIDUAL]: "individual"
|
|
23400
|
+
/* INDIVIDUAL */
|
|
23401
|
+
},
|
|
23402
|
+
theCompanyIWorkFor: {
|
|
23403
|
+
[LegalEntityType.ORGANIZATION]: "company"
|
|
23404
|
+
/* COMPANY */
|
|
23405
|
+
},
|
|
23406
|
+
mySoleProprietorName: {
|
|
23407
|
+
[LegalEntityType.INDIVIDUAL]: "soleProprietorship"
|
|
23408
|
+
/* SOLE_PROPRIETORSHIP */
|
|
23409
|
+
},
|
|
23410
|
+
aTrust: {
|
|
23411
|
+
[LegalEntityType.INDIVIDUAL]: "individualTrustee",
|
|
23412
|
+
[LegalEntityType.ORGANIZATION]: "companyTrustee"
|
|
23413
|
+
/* COMPANY_TRUSTEE */
|
|
23414
|
+
}
|
|
23415
|
+
};
|
|
23416
|
+
const useBusinessSetup = (legalEntityResponse) => {
|
|
23417
|
+
var _a;
|
|
23418
|
+
const {
|
|
23419
|
+
accountHolder: accountHolder2
|
|
23420
|
+
} = useCoreContext();
|
|
23421
|
+
const accountHolderType = accountHolder2 || getDefaultAccountHolderType(legalEntityResponse);
|
|
23422
|
+
const businessSetup = (_a = businessTypeMapping[accountHolderType]) == null ? void 0 : _a[legalEntityResponse == null ? void 0 : legalEntityResponse.type];
|
|
23423
|
+
return {
|
|
23424
|
+
businessSetup
|
|
23425
|
+
};
|
|
23426
|
+
};
|
|
23427
|
+
const useEnableNewEntryFlow = () => {
|
|
23428
|
+
const {
|
|
23429
|
+
isSettingEnabled
|
|
23430
|
+
} = useSettingsContext();
|
|
23431
|
+
const {
|
|
23432
|
+
isExperimentEnabled
|
|
23433
|
+
} = useExperimentsContext();
|
|
23434
|
+
return isSettingEnabled(SettingNames.AllowLegalEntityTypeChange) && isExperimentEnabled("EnableNewEntryFlow");
|
|
23435
|
+
};
|
|
22843
23436
|
const hasPayoutAccount = (legalEntityResponse) => {
|
|
22844
23437
|
var _a;
|
|
22845
23438
|
return Boolean((_a = legalEntityResponse.transferInstruments) == null ? void 0 : _a.length);
|
|
@@ -22857,6 +23450,7 @@ const TaskListItem = ({
|
|
|
22857
23450
|
info,
|
|
22858
23451
|
loading: loading2 = false,
|
|
22859
23452
|
showErrorAlerts = "onErrorStatus",
|
|
23453
|
+
showWarningAlert = false,
|
|
22860
23454
|
removeEntity,
|
|
22861
23455
|
isRemoveDisabled = false,
|
|
22862
23456
|
handleIsRemoveDisabled
|
|
@@ -22867,7 +23461,9 @@ const TaskListItem = ({
|
|
|
22867
23461
|
stateful: onNavigateToTask && !loading2 && !disabled,
|
|
22868
23462
|
onClick: loading2 ? void 0 : onNavigateToTask,
|
|
22869
23463
|
onKeyDown: handleKeys(["Enter"], onNavigateToTask ?? noop),
|
|
22870
|
-
className: "adyen-task",
|
|
23464
|
+
className: cx("adyen-task", {
|
|
23465
|
+
"adyen-task--warning": showWarningAlert
|
|
23466
|
+
}),
|
|
22871
23467
|
disabled,
|
|
22872
23468
|
children: jsxs(LoaderWrapper, {
|
|
22873
23469
|
status: loading2 ? "loading" : "success",
|
|
@@ -22938,6 +23534,9 @@ const PayoutAccountTaskListItem = ({
|
|
|
22938
23534
|
const {
|
|
22939
23535
|
i18n
|
|
22940
23536
|
} = useI18nContext();
|
|
23537
|
+
const {
|
|
23538
|
+
isExperimentEnabled
|
|
23539
|
+
} = useExperimentsContext();
|
|
22941
23540
|
const [isDeletingTransferInstrument, setIsDeletingTransferInstrument] = useState(false);
|
|
22942
23541
|
const isInstantVerificationAccount = isInstantVerifiedAccount(account);
|
|
22943
23542
|
const [isRemoveDisabled, setIsRemoveDisabled] = useState(false);
|
|
@@ -22948,7 +23547,7 @@ const PayoutAccountTaskListItem = ({
|
|
|
22948
23547
|
onNavigateToTask: isInstantVerificationAccount ? void 0 : onNavigateToTask,
|
|
22949
23548
|
icon: "payout",
|
|
22950
23549
|
title: maskedAccountNumber,
|
|
22951
|
-
tagline: i18n.get("payoutDetails"),
|
|
23550
|
+
tagline: isExperimentEnabled("EnableNewEntryFlow") ? void 0 : i18n.get("payoutDetails"),
|
|
22952
23551
|
status,
|
|
22953
23552
|
problems: (_a = capabilityProblems == null ? void 0 : capabilityProblems.BankAccount) == null ? void 0 : _a[account.id],
|
|
22954
23553
|
loading: isDeletingTransferInstrument,
|
|
@@ -23001,12 +23600,22 @@ function TaskListComponent({
|
|
|
23001
23600
|
const {
|
|
23002
23601
|
i18n
|
|
23003
23602
|
} = useI18nContext();
|
|
23603
|
+
const isEnableNewEntryFlowEnabled = useEnableNewEntryFlow();
|
|
23004
23604
|
const {
|
|
23005
23605
|
isExperimentEnabled
|
|
23006
23606
|
} = useExperimentsContext();
|
|
23007
23607
|
const {
|
|
23008
23608
|
canSeeIntro
|
|
23009
23609
|
} = useCanSeeIntro(legalEntityResponse);
|
|
23610
|
+
const {
|
|
23611
|
+
remediationMessages
|
|
23612
|
+
} = useDataMissingRemediations({
|
|
23613
|
+
legalEntityId: legalEntityResponse.id,
|
|
23614
|
+
problems: capabilityProblems
|
|
23615
|
+
});
|
|
23616
|
+
const {
|
|
23617
|
+
businessSetup
|
|
23618
|
+
} = useBusinessSetup(legalEntityResponse);
|
|
23010
23619
|
const hasTaskOfGroupAccountDetails = tasks.some((task) => LEGAL_ENTITY_BASE_TASKS.includes(task));
|
|
23011
23620
|
const hasTrust = isExperimentEnabled("EnableTrustFlow") && (accountHolder2 === "aTrust" || isPartOfTrustFromLegalEntity(legalEntityResponse));
|
|
23012
23621
|
const hasContractTasks = tasks.some((task) => CONTRACT_TASKS.includes(task));
|
|
@@ -23046,9 +23655,33 @@ function TaskListComponent({
|
|
|
23046
23655
|
showAsLink: true,
|
|
23047
23656
|
type: "button"
|
|
23048
23657
|
})
|
|
23658
|
+
}), isEnableNewEntryFlowEnabled && jsxs("header", {
|
|
23659
|
+
className: "adyen-task-list__heading",
|
|
23660
|
+
children: [jsx(Heading, {
|
|
23661
|
+
level: 1,
|
|
23662
|
+
children: i18n.get("setUpYourAccount")
|
|
23663
|
+
}), jsxs(Heading, {
|
|
23664
|
+
level: "sub",
|
|
23665
|
+
children: [jsx("span", {
|
|
23666
|
+
className: "adl-u-font-weight-semi-bold",
|
|
23667
|
+
children: i18n.get("yourBusinessSetup", {
|
|
23668
|
+
values: {
|
|
23669
|
+
businessSetup: i18n.get(businessSetup)
|
|
23670
|
+
}
|
|
23671
|
+
})
|
|
23672
|
+
}), jsx(Button, {
|
|
23673
|
+
title: i18n.get("edit"),
|
|
23674
|
+
icon: "edit",
|
|
23675
|
+
ghost: true,
|
|
23676
|
+
circle: true,
|
|
23677
|
+
onClick: () => onNavigateToTask(TaskTypes.BUSINESS_TYPE_SELECTION),
|
|
23678
|
+
className: "adl-u-margin-left-4",
|
|
23679
|
+
type: "button"
|
|
23680
|
+
})]
|
|
23681
|
+
})]
|
|
23049
23682
|
}), jsxs("div", {
|
|
23050
23683
|
children: [hasTaskOfGroupAccountDetails && jsxs(TaskListGroup, {
|
|
23051
|
-
title: isCompany ? i18n.get(companyTaskDescriptionKey) : i18n.get("accountDetailsDescription"),
|
|
23684
|
+
title: isCompany ? i18n.get(companyTaskDescriptionKey) : i18n.get(isEnableNewEntryFlowEnabled ? "provideFewDetailsAboutYourself" : "accountDetailsDescription"),
|
|
23052
23685
|
children: [tasks.includes(TaskTypes.INDIVIDUAL) && jsx(TaskListItem, {
|
|
23053
23686
|
onNavigateToTask: handleOnNavigateToTaskIndividual,
|
|
23054
23687
|
icon: "decision-maker",
|
|
@@ -23058,7 +23691,7 @@ function TaskListComponent({
|
|
|
23058
23691
|
}), hasSoleProprietorship && jsx(TaskListItem, {
|
|
23059
23692
|
onNavigateToTask: handleOnNavigateToSoleProp,
|
|
23060
23693
|
icon: "company",
|
|
23061
|
-
title: i18n.get("soleProprietorDetails"),
|
|
23694
|
+
title: i18n.get(isEnableNewEntryFlowEnabled ? "soleProprietorshipDetails" : "soleProprietorDetails"),
|
|
23062
23695
|
status: getTaskStatus(EntityType.LEGAL_ENTITY, capabilityProblems, legalEntityResponse, getOwnSoleProprietorshipIdArray(legalEntityResponse)),
|
|
23063
23696
|
problems: getOwnSolePropProblems(legalEntityResponse, capabilityProblems)
|
|
23064
23697
|
}), tasks.includes(TaskTypes.COMPANY) && jsx(TaskListItem, {
|
|
@@ -23067,11 +23700,19 @@ function TaskListComponent({
|
|
|
23067
23700
|
title: hasTrust ? i18n.get("companyTrusteeDetails") : i18n.get("companyDetails"),
|
|
23068
23701
|
status: getTaskStatus(EntityType.LEGAL_ENTITY, capabilityProblems, legalEntityResponse, [legalEntityResponse.id]),
|
|
23069
23702
|
problems: (_f = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _f[legalEntityResponse.id]
|
|
23070
|
-
}), tasks.includes(TaskTypes.DECISION_MAKER) &&
|
|
23071
|
-
|
|
23072
|
-
|
|
23073
|
-
|
|
23074
|
-
|
|
23703
|
+
}), tasks.includes(TaskTypes.DECISION_MAKER) && jsxs(Fragment, {
|
|
23704
|
+
children: [jsx(TaskListItem, {
|
|
23705
|
+
onNavigateToTask: handleOnNavigateToTaskDecisionMaker,
|
|
23706
|
+
icon: "decision-maker",
|
|
23707
|
+
title: i18n.get("decisionMakers"),
|
|
23708
|
+
status: hasMinRequiredDecisionMakerCount(legalEntityResponse) ? getTaskStatus(EntityType.LEGAL_ENTITY, capabilityProblems, legalEntityResponse, getOwnDecisionMakersLegalEntityIds(legalEntityResponse)) : TaskStatus.DETAILS_REQUIRED,
|
|
23709
|
+
showWarningAlert: Boolean(remediationMessages.DECISION_MAKER)
|
|
23710
|
+
}), remediationMessages.DECISION_MAKER && jsx(Alert, {
|
|
23711
|
+
className: "adyen-task-list__warning",
|
|
23712
|
+
title: remediationMessages.DECISION_MAKER,
|
|
23713
|
+
hasCloseButton: false,
|
|
23714
|
+
type: AlertTypes.WARNING
|
|
23715
|
+
})]
|
|
23075
23716
|
})]
|
|
23076
23717
|
}), hasTrust && jsxs(TaskListGroup, {
|
|
23077
23718
|
title: i18n.get("trustDetailsDescription"),
|
|
@@ -23088,7 +23729,7 @@ function TaskListComponent({
|
|
|
23088
23729
|
status: hasMinRequiredTrustMemberCount(legalEntityResponse) ? getTaskStatus(EntityType.LEGAL_ENTITY, capabilityProblems, legalEntityResponse, getOwnTrustMembersLegalEntityIds(legalEntityResponse)) : TaskStatus.DETAILS_REQUIRED
|
|
23089
23730
|
})]
|
|
23090
23731
|
}), (tasks.includes(TaskTypes.PAYOUT) || tasks.includes(TaskTypes.PAYIN)) && jsx(TaskListGroup, {
|
|
23091
|
-
title: i18n.get(hasPayinTaskNotPayout ? "payinAccountsDescription" : payoutTaskDescriptionKey),
|
|
23732
|
+
title: isEnableNewEntryFlowEnabled ? i18n.get("letUsKnowTheBankAccountToSendReceiveFunds") : i18n.get(hasPayinTaskNotPayout ? "payinAccountsDescription" : payoutTaskDescriptionKey),
|
|
23092
23733
|
children: transferInstruments.length > 0 ? jsxs(Fragment, {
|
|
23093
23734
|
children: [transferInstruments.map((transferInstrument) => jsx(PayoutAccountTaskListItem, {
|
|
23094
23735
|
account: transferInstrument,
|
|
@@ -23105,13 +23746,13 @@ function TaskListComponent({
|
|
|
23105
23746
|
name: "plus",
|
|
23106
23747
|
className: "adl-u-padding-top-2 adl-u-margin-right-8"
|
|
23107
23748
|
}), jsx("span", {
|
|
23108
|
-
children: i18n.get(hasPayinTaskNotPayout ? "addExtraPayinAccount" : "addExtraPayoutAccount")
|
|
23749
|
+
children: isEnableNewEntryFlowEnabled ? i18n.get("addExtraBankAccount") : i18n.get(hasPayinTaskNotPayout ? "addExtraPayinAccount" : "addExtraPayoutAccount")
|
|
23109
23750
|
})]
|
|
23110
23751
|
})]
|
|
23111
23752
|
}) : jsx(TaskListItem, {
|
|
23112
23753
|
onNavigateToTask: () => handleOnNavigateToTaskPayout(),
|
|
23113
23754
|
icon: "payout",
|
|
23114
|
-
title: i18n.get(hasPayinTaskNotPayout ? "payinDetails" : "payoutDetails"),
|
|
23755
|
+
title: isEnableNewEntryFlowEnabled ? i18n.get("bankAccountDetails") : i18n.get(hasPayinTaskNotPayout ? "payinDetails" : "payoutDetails"),
|
|
23115
23756
|
status: hasPayoutAccount(legalEntityResponse) ? getTaskStatus(EntityType.BANK_ACCOUNT, capabilityProblems, legalEntityResponse, [(_h = (_g = legalEntityResponse == null ? void 0 : legalEntityResponse.transferInstruments) == null ? void 0 : _g[0]) == null ? void 0 : _h.id]) : TaskStatus.DETAILS_REQUIRED,
|
|
23116
23757
|
disabled: !canAddPayoutAccount,
|
|
23117
23758
|
problems: (_k = capabilityProblems == null ? void 0 : capabilityProblems.BankAccount) == null ? void 0 : _k[(_j = (_i = legalEntityResponse == null ? void 0 : legalEntityResponse.transferInstruments) == null ? void 0 : _i[0]) == null ? void 0 : _j.id]
|
|
@@ -23456,84 +24097,6 @@ const omitMaskedFieldsIfUnchanged = (maskedFields, dataSubmitted, savedData) =>
|
|
|
23456
24097
|
});
|
|
23457
24098
|
return filtered;
|
|
23458
24099
|
};
|
|
23459
|
-
const _toast = "";
|
|
23460
|
-
function Toast({
|
|
23461
|
-
label,
|
|
23462
|
-
subLabel,
|
|
23463
|
-
actionLabel,
|
|
23464
|
-
type,
|
|
23465
|
-
duration = 3500,
|
|
23466
|
-
onToastHide,
|
|
23467
|
-
onToastAction
|
|
23468
|
-
}) {
|
|
23469
|
-
const toastRef = useRef(null);
|
|
23470
|
-
const loading2 = type === ToastType.LOADING;
|
|
23471
|
-
const successToast = type === ToastType.SUCCESS;
|
|
23472
|
-
const labelId = getUniqueId("toast");
|
|
23473
|
-
const handleShow = useCallback(() => {
|
|
23474
|
-
var _a;
|
|
23475
|
-
return (_a = toastRef.current) == null ? void 0 : _a.classList.add("adl-toast--visible");
|
|
23476
|
-
}, []);
|
|
23477
|
-
const handleHide = useCallback(() => {
|
|
23478
|
-
var _a;
|
|
23479
|
-
(_a = toastRef.current) == null ? void 0 : _a.classList.remove("adl-toast--visible");
|
|
23480
|
-
onToastHide();
|
|
23481
|
-
}, [onToastHide]);
|
|
23482
|
-
useEffect(() => {
|
|
23483
|
-
handleShow();
|
|
23484
|
-
if (duration !== "indefinite") {
|
|
23485
|
-
setTimeout(() => handleHide(), duration);
|
|
23486
|
-
}
|
|
23487
|
-
}, [label, duration, handleHide, handleShow]);
|
|
23488
|
-
return jsxs("div", {
|
|
23489
|
-
ref: toastRef,
|
|
23490
|
-
role: actionLabel ? "alertdialog" : "alert",
|
|
23491
|
-
className: "adl-toast",
|
|
23492
|
-
"aria-labelledby": labelId,
|
|
23493
|
-
children: [loading2 && jsx("div", {
|
|
23494
|
-
className: "adl-toast__loader",
|
|
23495
|
-
children: jsx("div", {
|
|
23496
|
-
className: "adl-loading-indicator adl-loading-indicator--small adl-loading-indicator--dark"
|
|
23497
|
-
})
|
|
23498
|
-
}), !loading2 && jsxs("div", {
|
|
23499
|
-
className: cx("adl-toast__status", {
|
|
23500
|
-
"adl-toast__status--success": successToast,
|
|
23501
|
-
"adl-toast__status--error": !successToast
|
|
23502
|
-
}),
|
|
23503
|
-
children: [successToast && jsx(Icon, {
|
|
23504
|
-
className: "adl-toast__status-icon",
|
|
23505
|
-
name: "checkmark"
|
|
23506
|
-
}), !successToast && jsx(Icon, {
|
|
23507
|
-
className: "adl-toast__status-icon",
|
|
23508
|
-
name: "cross"
|
|
23509
|
-
})]
|
|
23510
|
-
}), jsxs("div", {
|
|
23511
|
-
className: "adl-toast__message",
|
|
23512
|
-
children: [jsx("span", {
|
|
23513
|
-
id: labelId,
|
|
23514
|
-
className: "adl-toast__title",
|
|
23515
|
-
children: label
|
|
23516
|
-
}), actionLabel && jsx("button", {
|
|
23517
|
-
className: "adl-link adl-toast__action",
|
|
23518
|
-
title: "performAction",
|
|
23519
|
-
type: "button",
|
|
23520
|
-
onClick: onToastAction,
|
|
23521
|
-
children: actionLabel
|
|
23522
|
-
}), !loading2 && subLabel && jsx("span", {
|
|
23523
|
-
className: "adl-toast__subtitle",
|
|
23524
|
-
children: subLabel
|
|
23525
|
-
})]
|
|
23526
|
-
}), !loading2 && jsx("button", {
|
|
23527
|
-
className: "adl-toast__close",
|
|
23528
|
-
title: "close",
|
|
23529
|
-
type: "button",
|
|
23530
|
-
onClick: handleHide,
|
|
23531
|
-
children: jsx(Icon, {
|
|
23532
|
-
name: "cross"
|
|
23533
|
-
})
|
|
23534
|
-
})]
|
|
23535
|
-
});
|
|
23536
|
-
}
|
|
23537
24100
|
const parseConfiguration$1 = ({
|
|
23538
24101
|
country: country2,
|
|
23539
24102
|
matchingScenario
|
|
@@ -23546,7 +24109,7 @@ function IndividualDropinComponent({
|
|
|
23546
24109
|
handleFindAddress,
|
|
23547
24110
|
handleGetIdVerificationToken,
|
|
23548
24111
|
handleGetIdVerificationStartCheck,
|
|
23549
|
-
taskType,
|
|
24112
|
+
taskType = TaskTypes.INDIVIDUAL,
|
|
23550
24113
|
trackingConfig,
|
|
23551
24114
|
parentLegalEntity,
|
|
23552
24115
|
legalEntityResponse,
|
|
@@ -23647,7 +24210,7 @@ function IndividualDropinComponent({
|
|
|
23647
24210
|
if (parentLegalEntity == null ? void 0 : parentLegalEntity.entityAssociations) {
|
|
23648
24211
|
const associations = (_b = parentLegalEntity == null ? void 0 : parentLegalEntity.entityAssociations) == null ? void 0 : _b.filter((ea) => ea.legalEntityId === (legalEntityResponse == null ? void 0 : legalEntityResponse.id));
|
|
23649
24212
|
if (associations && associations.length > 0) {
|
|
23650
|
-
const jobTitle2 = (_c = associations.find((
|
|
24213
|
+
const jobTitle2 = (_c = associations.find((association2) => Boolean(association2.jobTitle))) == null ? void 0 : _c.jobTitle;
|
|
23651
24214
|
dataFromResponse = {
|
|
23652
24215
|
...dataFromResponse,
|
|
23653
24216
|
personalDetails: {
|
|
@@ -24139,6 +24702,9 @@ function PayoutDetailsDropinComponent({
|
|
|
24139
24702
|
i18n,
|
|
24140
24703
|
setLocale
|
|
24141
24704
|
} = useI18nContext();
|
|
24705
|
+
const {
|
|
24706
|
+
isExperimentEnabled
|
|
24707
|
+
} = useExperimentsContext();
|
|
24142
24708
|
const {
|
|
24143
24709
|
showToast,
|
|
24144
24710
|
clearToasts
|
|
@@ -24234,7 +24800,7 @@ function PayoutDetailsDropinComponent({
|
|
|
24234
24800
|
country: (_b2 = prefilledData == null ? void 0 : prefilledData.payoutVerificationMethod) == null ? void 0 : _b2.bankCountry,
|
|
24235
24801
|
bankVerificationVendors,
|
|
24236
24802
|
verificationVendorsCallback: handleGetBankVerificationVendors
|
|
24237
|
-
}), isSettingEnabled(SettingNames.AllowIntraRegionCrossBorderPayout));
|
|
24803
|
+
}), isSettingEnabled(SettingNames.AllowIntraRegionCrossBorderPayout), isExperimentEnabled("EnableNewEntryFlow"));
|
|
24238
24804
|
}, [bankVerificationVendors]);
|
|
24239
24805
|
const derivedProps = useMemo(() => getPropsFromConfigurations(fieldConfigurations, payoutDetailsSteps, (problems == null ? void 0 : problems.remediationActions) ? Object.values(problems == null ? void 0 : problems.remediationActions) : [], (problems == null ? void 0 : problems.missingData) ?? [], [], fieldsFromCustomRules, fieldsFormCustomLabels), [fieldConfigurations, fieldsFromCustomRules, problems == null ? void 0 : problems.remediationActions]);
|
|
24240
24806
|
const {
|
|
@@ -24438,7 +25004,7 @@ function PayoutDetailsDropinComponent({
|
|
|
24438
25004
|
onSkipSubmit: navigateBackToTaskList
|
|
24439
25005
|
});
|
|
24440
25006
|
return jsx(FormWrapper, {
|
|
24441
|
-
taskName: taskName ?? "payoutDetails",
|
|
25007
|
+
taskName: taskName ?? isExperimentEnabled("EnableNewEntryFlow") ? "bankAccountDetails" : "payoutDetails",
|
|
24442
25008
|
activeForm,
|
|
24443
25009
|
summary: {
|
|
24444
25010
|
data: formatDataForSummary(),
|
|
@@ -26521,6 +27087,9 @@ function SolePropDropinComponent({
|
|
|
26521
27087
|
i18n,
|
|
26522
27088
|
setLocale
|
|
26523
27089
|
} = useI18nContext();
|
|
27090
|
+
const {
|
|
27091
|
+
isExperimentEnabled
|
|
27092
|
+
} = useExperimentsContext();
|
|
26524
27093
|
const [problems, setProblems] = useState(problemsProp);
|
|
26525
27094
|
const datasetUtils = datasetUtilities(i18n.locale);
|
|
26526
27095
|
const getOmittedKeys = () => ["operationalAddressIsSame"];
|
|
@@ -26710,6 +27279,7 @@ function SolePropDropinComponent({
|
|
|
26710
27279
|
eventEmitter,
|
|
26711
27280
|
hideDropinLayout,
|
|
26712
27281
|
legalEntityType: LegalEntityType.TRUST,
|
|
27282
|
+
taskName: isExperimentEnabled("EnableNewEntryFlow") ? "soleProprietorshipDetails" : "solePropDetails",
|
|
26713
27283
|
legalEntityResponse,
|
|
26714
27284
|
summary: {
|
|
26715
27285
|
formatData: formatDataForSummary,
|
|
@@ -26849,7 +27419,7 @@ function TrustDropinComponent(props) {
|
|
|
26849
27419
|
}
|
|
26850
27420
|
};
|
|
26851
27421
|
const isDocumentsRequired2 = (forms) => forms.some((form) => [trustForms.trustConstitutionalDocument.formId].includes(form.formId));
|
|
26852
|
-
const attachTrustToParentLegalEntity = async (
|
|
27422
|
+
const attachTrustToParentLegalEntity = async (trust2) => {
|
|
26853
27423
|
if (legalEntityResponse == null ? void 0 : legalEntityResponse.id) {
|
|
26854
27424
|
return;
|
|
26855
27425
|
}
|
|
@@ -26857,7 +27427,7 @@ function TrustDropinComponent(props) {
|
|
|
26857
27427
|
const updatedParentLegalEntity = {
|
|
26858
27428
|
entityAssociations: [{
|
|
26859
27429
|
type: LegalEntityType.TRUST,
|
|
26860
|
-
legalEntityId:
|
|
27430
|
+
legalEntityId: trust2.id
|
|
26861
27431
|
}, ...existingEntityAssociations]
|
|
26862
27432
|
};
|
|
26863
27433
|
await props.handleUpdateLegalEntity(updatedParentLegalEntity, parentLegalEntity.id);
|
|
@@ -26957,7 +27527,8 @@ function DropinComposerComponent({
|
|
|
26957
27527
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
26958
27528
|
const {
|
|
26959
27529
|
contextCountry,
|
|
26960
|
-
accountHolder: accountHolder2
|
|
27530
|
+
accountHolder: accountHolder2,
|
|
27531
|
+
setAccountHolder
|
|
26961
27532
|
} = useCoreContext();
|
|
26962
27533
|
const {
|
|
26963
27534
|
i18n,
|
|
@@ -26974,20 +27545,28 @@ function DropinComposerComponent({
|
|
|
26974
27545
|
} = useToastContext();
|
|
26975
27546
|
const [isLoadingConfiguration, setIsLoadingConfiguration] = useState(false);
|
|
26976
27547
|
const [pollingId, setPollingId] = useState(null);
|
|
27548
|
+
const showBusinessTypeSelection = useShouldShowBusinessTypeSelection(accountHolder2);
|
|
26977
27549
|
const showIntro = useShouldShowIntro(legalEntityResponse);
|
|
26978
27550
|
const {
|
|
26979
27551
|
setHasSeenIntro
|
|
26980
27552
|
} = useHasSeenIntro(legalEntityResponse.id);
|
|
26981
27553
|
const [tasks, setTasks] = useState([]);
|
|
26982
|
-
const
|
|
27554
|
+
const initialTask = useMemo(() => {
|
|
27555
|
+
if (showBusinessTypeSelection)
|
|
27556
|
+
return TaskTypes.BUSINESS_TYPE_SELECTION;
|
|
27557
|
+
if (showIntro)
|
|
27558
|
+
return TaskTypes.INTRO;
|
|
27559
|
+
return TaskTypes.TASKS_OVERVIEW;
|
|
27560
|
+
}, [showBusinessTypeSelection, showIntro]);
|
|
27561
|
+
const [taskHistory, setTaskHistory] = useState([initialTask]);
|
|
26983
27562
|
const [legalEntity, setLegalEntity] = useState(legalEntityResponse);
|
|
26984
27563
|
const [associatedLegalEntity, setAssociatedLegalEntity] = useState(null);
|
|
26985
27564
|
const [associatedLegalEntityParent, setAssociatedLegalEntityParent] = useState(null);
|
|
26986
27565
|
const [legalEntityType, setLegalEntityType] = useState(null);
|
|
26987
27566
|
const [solePropietor, setSolePropietor] = useState(null);
|
|
26988
|
-
const [
|
|
27567
|
+
const [trust2, setTrust] = useState(null);
|
|
26989
27568
|
const exemptSettlor = useExemptSettlor({
|
|
26990
|
-
trust,
|
|
27569
|
+
trust: trust2,
|
|
26991
27570
|
handleGetLegalEntity: args.handleGetLegalEntity
|
|
26992
27571
|
});
|
|
26993
27572
|
const [trustMember, setTrustMember] = useState(null);
|
|
@@ -27002,7 +27581,7 @@ function DropinComposerComponent({
|
|
|
27002
27581
|
const hasTrust = isExperimentEnabled("EnableTrustFlow") && (accountHolder2 === "aTrust" || isPartOfTrustFromLegalEntity(legalEntityResponse));
|
|
27003
27582
|
const reviewRequired = (legalEntity == null ? void 0 : legalEntity.id) && ((_d = (_c = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _c[legalEntity.id]) == null ? void 0 : _d.isReviewRequired);
|
|
27004
27583
|
const additionalSalesChannels = useSalesChannelsSettings();
|
|
27005
|
-
const isOrganizationSettlorWithExemptionEnabled = isOrganizationSettlorWithExemptionReasonEnabled(isExperimentEnabled("
|
|
27584
|
+
const isOrganizationSettlorWithExemptionEnabled = isOrganizationSettlorWithExemptionReasonEnabled(isExperimentEnabled("AllowOrganizationSettlorWithExemptionReason"), trust2 == null ? void 0 : trust2.trust.countryOfGoverningLaw);
|
|
27006
27585
|
const getLegalEntityProblems = (le) => {
|
|
27007
27586
|
var _a2;
|
|
27008
27587
|
if (le == null ? void 0 : le.id) {
|
|
@@ -27113,9 +27692,9 @@ function DropinComposerComponent({
|
|
|
27113
27692
|
return void 0;
|
|
27114
27693
|
};
|
|
27115
27694
|
const refreshTrust = async () => {
|
|
27116
|
-
if (
|
|
27695
|
+
if (trust2.id && (args == null ? void 0 : args.handleGetLegalEntity)) {
|
|
27117
27696
|
try {
|
|
27118
|
-
const response = await (args == null ? void 0 : args.handleGetLegalEntity(
|
|
27697
|
+
const response = await (args == null ? void 0 : args.handleGetLegalEntity(trust2.id));
|
|
27119
27698
|
setTrust(response);
|
|
27120
27699
|
return response;
|
|
27121
27700
|
} catch (e) {
|
|
@@ -27149,14 +27728,14 @@ function DropinComposerComponent({
|
|
|
27149
27728
|
case "company":
|
|
27150
27729
|
await deleteAssociatedTrustMember({
|
|
27151
27730
|
associatedTrustMember: trustMember2,
|
|
27152
|
-
trust,
|
|
27731
|
+
trust: trust2,
|
|
27153
27732
|
handleUpdateLegalEntity: args.handleUpdateLegalEntity
|
|
27154
27733
|
});
|
|
27155
27734
|
break;
|
|
27156
27735
|
case "undefinedBeneficiary":
|
|
27157
27736
|
await deleteUndefinedBeneficiary({
|
|
27158
27737
|
undefinedBeneficiary: trustMember2,
|
|
27159
|
-
trust,
|
|
27738
|
+
trust: trust2,
|
|
27160
27739
|
handleUpdateLegalEntity: args.handleUpdateLegalEntity
|
|
27161
27740
|
});
|
|
27162
27741
|
break;
|
|
@@ -27178,7 +27757,7 @@ function DropinComposerComponent({
|
|
|
27178
27757
|
};
|
|
27179
27758
|
const addOrUpdateTrustMember = async (updated, existing) => {
|
|
27180
27759
|
if ((existing == null ? void 0 : existing.trustMemberType) === "undefinedBeneficiary" && updated.trustMemberType === "undefinedBeneficiary" && existing.description === updated.description) {
|
|
27181
|
-
await refreshTrustAndRunOnSubmit(
|
|
27760
|
+
await refreshTrustAndRunOnSubmit(trust2, 1);
|
|
27182
27761
|
return;
|
|
27183
27762
|
}
|
|
27184
27763
|
try {
|
|
@@ -27186,7 +27765,7 @@ function DropinComposerComponent({
|
|
|
27186
27765
|
case "undefinedBeneficiary":
|
|
27187
27766
|
await addOrUpdateUndefinedBeneficiary({
|
|
27188
27767
|
newOrUpdated: updated,
|
|
27189
|
-
trust,
|
|
27768
|
+
trust: trust2,
|
|
27190
27769
|
handleUpdateLegalEntity: args.handleUpdateLegalEntity
|
|
27191
27770
|
});
|
|
27192
27771
|
break;
|
|
@@ -27197,7 +27776,7 @@ function DropinComposerComponent({
|
|
|
27197
27776
|
handleCreateLegalEntity: args.handleCreateLegalEntity
|
|
27198
27777
|
}) : await createExemptSettlor({
|
|
27199
27778
|
exemptSettlor: updated,
|
|
27200
|
-
trust,
|
|
27779
|
+
trust: trust2,
|
|
27201
27780
|
handleCreateLegalEntity: args.handleCreateLegalEntity
|
|
27202
27781
|
});
|
|
27203
27782
|
updated.legalEntityId = newSettlorLE.id;
|
|
@@ -27216,7 +27795,7 @@ function DropinComposerComponent({
|
|
|
27216
27795
|
}
|
|
27217
27796
|
await addOrUpdateAssociatedTrustMember({
|
|
27218
27797
|
newOrUpdated: updated,
|
|
27219
|
-
trust,
|
|
27798
|
+
trust: trust2,
|
|
27220
27799
|
handleUpdateLegalEntity: args.handleUpdateLegalEntity
|
|
27221
27800
|
});
|
|
27222
27801
|
break;
|
|
@@ -27224,7 +27803,7 @@ function DropinComposerComponent({
|
|
|
27224
27803
|
case "company":
|
|
27225
27804
|
await addOrUpdateAssociatedTrustMember({
|
|
27226
27805
|
newOrUpdated: updated,
|
|
27227
|
-
trust,
|
|
27806
|
+
trust: trust2,
|
|
27228
27807
|
handleUpdateLegalEntity: args.handleUpdateLegalEntity
|
|
27229
27808
|
});
|
|
27230
27809
|
break;
|
|
@@ -27236,7 +27815,7 @@ function DropinComposerComponent({
|
|
|
27236
27815
|
label: i18n.get("successfullyUpdatedDetails"),
|
|
27237
27816
|
type: ToastType.SUCCESS
|
|
27238
27817
|
});
|
|
27239
|
-
await refreshTrustAndRunOnSubmit(
|
|
27818
|
+
await refreshTrustAndRunOnSubmit(trust2, 1);
|
|
27240
27819
|
} catch (err) {
|
|
27241
27820
|
logger$5.error(err);
|
|
27242
27821
|
showToast({
|
|
@@ -27307,7 +27886,7 @@ function DropinComposerComponent({
|
|
|
27307
27886
|
};
|
|
27308
27887
|
const onNavigateToTrust = async (task = TaskTypes.TRUST) => {
|
|
27309
27888
|
var _a2, _b2;
|
|
27310
|
-
const trustId = (_b2 = (_a2 = legalEntity == null ? void 0 : legalEntity.entityAssociations) == null ? void 0 : _a2.find((
|
|
27889
|
+
const trustId = (_b2 = (_a2 = legalEntity == null ? void 0 : legalEntity.entityAssociations) == null ? void 0 : _a2.find((association2) => association2.type === LegalEntityType.TRUST)) == null ? void 0 : _b2.legalEntityId;
|
|
27311
27890
|
if (trustId) {
|
|
27312
27891
|
try {
|
|
27313
27892
|
const currentTrust = await (args == null ? void 0 : args.handleGetLegalEntity(trustId));
|
|
@@ -27501,6 +28080,19 @@ function DropinComposerComponent({
|
|
|
27501
28080
|
}
|
|
27502
28081
|
const currentTask = taskHistory[taskHistory.length - 1];
|
|
27503
28082
|
switch (currentTask) {
|
|
28083
|
+
case TaskTypes.BUSINESS_TYPE_SELECTION:
|
|
28084
|
+
return jsx(BusinessTypeSelection, {
|
|
28085
|
+
...args,
|
|
28086
|
+
legalEntityResponse: legalEntity,
|
|
28087
|
+
accountHolder: accountHolder2,
|
|
28088
|
+
showTrustOption: isExperimentEnabled("EnableTrustFlow") && TRUST_COUNTRIES.includes(rootLegalEntityCountry),
|
|
28089
|
+
showSolePropOption: SOLE_PROP_COUNTRIES.includes(rootLegalEntityCountry),
|
|
28090
|
+
onAccountHolderSelect: async (newAccountHolder) => {
|
|
28091
|
+
setAccountHolder(newAccountHolder);
|
|
28092
|
+
await refreshLegalEntity();
|
|
28093
|
+
onNavigateTo(showIntro ? TaskTypes.INTRO : TaskTypes.TASKS_OVERVIEW);
|
|
28094
|
+
}
|
|
28095
|
+
});
|
|
27504
28096
|
case TaskTypes.INTRO:
|
|
27505
28097
|
return jsx(TaskIntros, {
|
|
27506
28098
|
legalEntityType: legalEntity.type,
|
|
@@ -27623,7 +28215,7 @@ function DropinComposerComponent({
|
|
|
27623
28215
|
topLevelLegalEntity: legalEntityResponse
|
|
27624
28216
|
},
|
|
27625
28217
|
taskType: TaskTypes.TRUST_MEMBER_INDIVIDUAL,
|
|
27626
|
-
parentLegalEntity:
|
|
28218
|
+
parentLegalEntity: trust2,
|
|
27627
28219
|
legalEntityResponse: associatedLegalEntity,
|
|
27628
28220
|
problems: getLegalEntityProblems(associatedLegalEntity),
|
|
27629
28221
|
capabilities: Object.keys((legalEntityResponse == null ? void 0 : legalEntityResponse.capabilities) ?? {}),
|
|
@@ -27671,7 +28263,7 @@ function DropinComposerComponent({
|
|
|
27671
28263
|
topLevelLegalEntity: legalEntityResponse
|
|
27672
28264
|
},
|
|
27673
28265
|
taskType: TaskTypes.TRUST_MEMBER_COMPANY,
|
|
27674
|
-
parentLegalEntity:
|
|
28266
|
+
parentLegalEntity: trust2,
|
|
27675
28267
|
legalEntityResponse: associatedLegalEntity,
|
|
27676
28268
|
capabilities: Object.keys((legalEntityResponse == null ? void 0 : legalEntityResponse.capabilities) ?? {}),
|
|
27677
28269
|
problems: (_e = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _e[legalEntity.id],
|
|
@@ -27716,22 +28308,22 @@ function DropinComposerComponent({
|
|
|
27716
28308
|
topLevelLegalEntity: legalEntityResponse
|
|
27717
28309
|
},
|
|
27718
28310
|
taskType: TaskTypes.TRUST,
|
|
27719
|
-
problems: (_g = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _g[
|
|
28311
|
+
problems: (_g = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _g[trust2 == null ? void 0 : trust2.id],
|
|
27720
28312
|
parentLegalEntity: legalEntity,
|
|
27721
|
-
legalEntityResponse:
|
|
28313
|
+
legalEntityResponse: trust2,
|
|
27722
28314
|
capabilities: Object.keys((legalEntityResponse == null ? void 0 : legalEntityResponse.capabilities) ?? {}),
|
|
27723
28315
|
onChange: componentOnChange,
|
|
27724
28316
|
eventEmitter,
|
|
27725
28317
|
onSubmit: componentOnSubmit,
|
|
27726
28318
|
handleHomeClick: navigateBack,
|
|
27727
28319
|
homeButtonLabel: i18n.get("saveAndGoToOverview"),
|
|
27728
|
-
country: (((_h =
|
|
28320
|
+
country: (((_h = trust2 == null ? void 0 : trust2.trust) == null ? void 0 : _h.countryOfGoverningLaw) || ((_i = trust2 == null ? void 0 : trust2.trust) == null ? void 0 : _i.registeredAddress.country)) ?? rootLegalEntityCountry,
|
|
27729
28321
|
handleAddressSearch: args == null ? void 0 : args.handleAddressSearch,
|
|
27730
28322
|
handleFindAddress: args == null ? void 0 : args.handleFindAddress
|
|
27731
28323
|
});
|
|
27732
28324
|
case TaskTypes.TRUST_MEMBER_OVERVIEW:
|
|
27733
28325
|
return jsx(TrustMembersOverview, {
|
|
27734
|
-
trustMembers: getTrustMembers(
|
|
28326
|
+
trustMembers: getTrustMembers(trust2, legalEntity, exemptSettlor),
|
|
27735
28327
|
getTrustMemberTaskStatus: (member) => getTaskStatus(EntityType.LEGAL_ENTITY, capabilityProblems, legalEntity, member.trustMemberType === "undefinedBeneficiary" ? void 0 : [member.legalEntityId]),
|
|
27736
28328
|
navigateBackToTaskList: navigateBack,
|
|
27737
28329
|
navigateToEditTrustMember: onNavigateToTrustMemberRoleAndType,
|
|
@@ -28217,6 +28809,22 @@ const getAllowedLocales$1 = async (context) => {
|
|
|
28217
28809
|
}
|
|
28218
28810
|
});
|
|
28219
28811
|
};
|
|
28812
|
+
const getSupportedCountries = async (context) => {
|
|
28813
|
+
const {
|
|
28814
|
+
loadingContext,
|
|
28815
|
+
legalEntityId
|
|
28816
|
+
} = context;
|
|
28817
|
+
return httpGet({
|
|
28818
|
+
loadingContext,
|
|
28819
|
+
errorLevel: "warn",
|
|
28820
|
+
errorMessage: `Supported countries not available`,
|
|
28821
|
+
path: `${legalEntityId}/configurations/supportedCountries`,
|
|
28822
|
+
authentication: "jwt",
|
|
28823
|
+
headers: {
|
|
28824
|
+
"Content-Type": "application/json"
|
|
28825
|
+
}
|
|
28826
|
+
});
|
|
28827
|
+
};
|
|
28220
28828
|
const getEmbeddedApi = ({
|
|
28221
28829
|
base,
|
|
28222
28830
|
rootLegalEntityId
|
|
@@ -28247,9 +28855,7 @@ const getEmbeddedApi = ({
|
|
|
28247
28855
|
loadFlags: async () => loadFlags(base),
|
|
28248
28856
|
loadDocumentGuidance: async () => loadDocumentGuidance(base),
|
|
28249
28857
|
getImageUrl: () => `${base}static/images/`,
|
|
28250
|
-
getAllowedCountries: () =>
|
|
28251
|
-
throw new Error("getAllowedCountries: Not implemented in onboarding component api");
|
|
28252
|
-
},
|
|
28858
|
+
getAllowedCountries: async () => getSupportedCountries(baseRequestContext),
|
|
28253
28859
|
getAllowedLocales: async () => getAllowedLocales$1(baseRequestContext),
|
|
28254
28860
|
validatePhoneNumber: () => {
|
|
28255
28861
|
throw new Error("validatePhoneNumber: Not implemented in onboarding component api");
|
|
@@ -28558,36 +29164,46 @@ const ConfigurationApiProvider = ({
|
|
|
28558
29164
|
children
|
|
28559
29165
|
});
|
|
28560
29166
|
};
|
|
29167
|
+
const accountHolderStorageKey = "ACCOUNT_HOLDER";
|
|
29168
|
+
const useAccountHolder = (enableNewEntryFlow) => {
|
|
29169
|
+
let hook;
|
|
29170
|
+
let initialStateParams;
|
|
29171
|
+
if (enableNewEntryFlow) {
|
|
29172
|
+
hook = useLocalStorage;
|
|
29173
|
+
initialStateParams = [accountHolderStorageKey, null];
|
|
29174
|
+
} else {
|
|
29175
|
+
hook = useState;
|
|
29176
|
+
initialStateParams = [null];
|
|
29177
|
+
}
|
|
29178
|
+
const [accountHolder2, setAccountHolder] = hook(...initialStateParams);
|
|
29179
|
+
return [accountHolder2, setAccountHolder];
|
|
29180
|
+
};
|
|
28561
29181
|
const logger$2 = createLogger("CoreProvider");
|
|
28562
29182
|
const CoreProvider = ({
|
|
28563
29183
|
contextCountry: initialContextCountry,
|
|
29184
|
+
enableNewEntryFlowExperiment = false,
|
|
28564
29185
|
children
|
|
28565
29186
|
}) => {
|
|
28566
29187
|
const {
|
|
28567
29188
|
loadingContext
|
|
28568
29189
|
} = useAuthContext();
|
|
28569
|
-
const {
|
|
28570
|
-
getAllowedCountries: getAllowedCountries2
|
|
28571
|
-
} = useConfigurationApi();
|
|
28572
29190
|
const [contextCountry, setContextCountry] = useState(initialContextCountry);
|
|
28573
|
-
const [accountHolder2, setAccountHolder] =
|
|
29191
|
+
const [accountHolder2, setAccountHolder] = useAccountHolder(enableNewEntryFlowExperiment);
|
|
28574
29192
|
const [accountFormat, setAccountFormat] = useState("local");
|
|
28575
29193
|
useEffect(() => {
|
|
28576
29194
|
addStyleTagForADLIconFont(loadingContext);
|
|
28577
29195
|
}, [loadingContext]);
|
|
29196
|
+
const allowedCountries = useAllowedCountries();
|
|
29197
|
+
const isCountryAllowed = (allowedCountries == null ? void 0 : allowedCountries.includes(contextCountry)) ?? true;
|
|
28578
29198
|
useEffect(() => {
|
|
28579
|
-
|
|
28580
|
-
|
|
28581
|
-
if (!allowedCountries.includes(contextCountry)) {
|
|
28582
|
-
logger$2.warn(`
|
|
29199
|
+
if (allowedCountries && !isCountryAllowed) {
|
|
29200
|
+
logger$2.warn(`
|
|
28583
29201
|
|
|
28584
29202
|
"${contextCountry}" isn't a supported country. Please use one of the following:
|
|
28585
29203
|
- ${listify(allowedCountries)}.
|
|
28586
|
-
|
|
28587
|
-
|
|
28588
|
-
|
|
28589
|
-
checkIfCountryIsAllowed().catch(logger$2.warn);
|
|
28590
|
-
}, [contextCountry, getAllowedCountries2]);
|
|
29204
|
+
`);
|
|
29205
|
+
}
|
|
29206
|
+
}, [allowedCountries, contextCountry, isCountryAllowed]);
|
|
28591
29207
|
const contextValue = useMemo(() => ({
|
|
28592
29208
|
setContextCountry,
|
|
28593
29209
|
contextCountry,
|
|
@@ -28828,6 +29444,7 @@ class UIElement extends BaseElement {
|
|
|
28828
29444
|
constructor(props) {
|
|
28829
29445
|
super(props);
|
|
28830
29446
|
this.render = () => {
|
|
29447
|
+
var _a;
|
|
28831
29448
|
const Component = this.props.component;
|
|
28832
29449
|
return jsx(AuthProvider, {
|
|
28833
29450
|
sdkToken: this.props.sdkToken,
|
|
@@ -28838,6 +29455,7 @@ class UIElement extends BaseElement {
|
|
|
28838
29455
|
rootLegalEntityId: getRootLegalEntityId(this.props.componentProps),
|
|
28839
29456
|
children: jsx(CoreProvider, {
|
|
28840
29457
|
contextCountry: this.props.contextCountry,
|
|
29458
|
+
enableNewEntryFlowExperiment: (_a = this.props.experiments) == null ? void 0 : _a.EnableNewEntryFlow,
|
|
28841
29459
|
children: jsx(I18nProvider, {
|
|
28842
29460
|
locale: this.props.locale,
|
|
28843
29461
|
customTranslations: this.props.customTranslations,
|