@adyen/kyc-components 3.15.4 → 3.16.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 +394 -621
- package/dist/es/{arrow-left-CCxYxfCP.js → arrow-left-CwJQyOFz.js} +1 -1
- package/dist/es/{arrow-right-DF4Qe-8E.js → arrow-right-Cs_AKUOH.js} +1 -1
- package/dist/es/{bin-CGwewvcn.js → bin-8yaAerXc.js} +1 -1
- package/dist/es/{check-CeSLN4_9.js → check-_cOIMziL.js} +1 -1
- package/dist/es/{checkmark-DEh9MPYR.js → checkmark-CZpv8i5a.js} +1 -1
- package/dist/es/{checkmark-small-D_9HLctx.js → checkmark-small-C4TPve-W.js} +1 -1
- package/dist/es/{chevron-down-BzENwYSf.js → chevron-down-CwS2tE_6.js} +1 -1
- package/dist/es/{chevron-right-DczMHcvL.js → chevron-right-B8cQLres.js} +1 -1
- package/dist/es/{chevron-up-BLtnROd5.js → chevron-up-DccG0tVR.js} +1 -1
- package/dist/es/{company-2-JG34IScE.js → company-2-Cof0usfn.js} +1 -1
- package/dist/es/{company-D5_F_6SW.js → company-BKO80hWm.js} +1 -1
- package/dist/es/{contract-C6wDy9zU.js → contract-DrX5y2Qf.js} +1 -1
- package/dist/es/{controlling-person-C4KoSyi2.js → controlling-person-B_dn0b9H.js} +1 -1
- package/dist/es/{cross-BadGfrgB.js → cross-aFMJCrLf.js} +1 -1
- package/dist/es/{decision-maker-Cef3-OzY.js → decision-maker-28_rW1ah.js} +1 -1
- package/dist/es/{document-Cg4kZHpA.js → document-Bn_3PIDG.js} +1 -1
- package/dist/es/{download-DGC5_Bxe.js → download-DgAZobJV.js} +1 -1
- package/dist/es/{edit--fDhojib.js → edit-Dg19Ah77.js} +1 -1
- package/dist/es/{field-error-WElEN1mN.js → field-error-DkFiF_Cv.js} +1 -1
- package/dist/es/{info-circle-DkHN1ugA.js → info-circle-CXFfd_nO.js} +1 -1
- package/dist/es/{light-bulb-DEUhbRWP.js → light-bulb-CQ29JPA7.js} +1 -1
- package/dist/es/{location-B1Til-7Q.js → location-DmmjAv9A.js} +1 -1
- package/dist/es/{more-horiz-BieZKfy3.js → more-horiz-dyZQKaOn.js} +1 -1
- package/dist/es/{new-document-BEAJnXCG.js → new-document-CeV8zHP8.js} +1 -1
- package/dist/es/{owners-D1pksb86.js → owners-C1dyQqRO.js} +1 -1
- package/dist/es/{payout-BFiI--HY.js → payout-B-c43MDS.js} +1 -1
- package/dist/es/{pci-DMQLRoAn.js → pci-CVqIvwR-.js} +1 -1
- package/dist/es/{plus-DAnbeoyS.js → plus-BUH0nzS_.js} +1 -1
- package/dist/es/{remove-CEmd9YX7.js → remove-Bor5X8Xu.js} +1 -1
- package/dist/es/{review-CeQeKHXH.js → review-DcoDSRJT.js} +1 -1
- package/dist/es/{search-hf3HRVbu.js → search-SGLIdnsr.js} +1 -1
- package/dist/es/{signatory-BVoLPYPu.js → signatory-BMaWV_18.js} +1 -1
- package/dist/es/{store-D2z639xh.js → store-N4c2LHJ_.js} +1 -1
- package/dist/es/{trust-CpcaQaV7.js → trust-BcVDhtGL.js} +1 -1
- package/dist/es/{user-D6swzlYs.js → user-C8STPF6-.js} +1 -1
- package/dist/es/{user-business-CwS5j1qX.js → user-business-Dcvcw8gB.js} +1 -1
- package/dist/es/{users-3-BdjQ9rEA.js → users-3-D3QDBEk-.js} +1 -1
- package/dist/es/{warning-99uFf1WU.js → warning-Dxxpni4H.js} +1 -1
- package/dist/es/{wrong-1wvh7nZe.js → wrong-DNwa4zZR.js} +1 -1
- package/dist/style.css +1 -0
- package/dist/types/components/BankDocument/types.d.ts +1 -2
- package/dist/types/components/BankVerification/BankVerification.d.ts +1 -1
- package/dist/types/components/BankVerification/types.d.ts +5 -5
- package/dist/types/components/CompanyBasics/types.d.ts +3 -3
- package/dist/types/components/CompanyLookup/types.d.ts +4 -4
- package/dist/types/components/Individual/types.d.ts +2 -2
- package/dist/types/components/PayoutDetails/types.d.ts +2 -2
- package/dist/types/components/TaskList/types.d.ts +2 -2
- package/dist/types/components/internal/Address/constants.d.ts +1 -0
- package/dist/types/components/internal/BusinessRegistrationNumberField/types.d.ts +2 -2
- package/dist/types/components/internal/DocumentGuidance/DocumentGuidance.d.ts +1 -1
- package/dist/types/components/internal/DocumentGuidance/{type.d.ts → types.d.ts} +5 -0
- package/dist/types/components/internal/EntityAssociation/types.d.ts +2 -2
- package/dist/types/components/internal/Remove/types.d.ts +3 -3
- package/dist/types/components/internal/TaxInformationField/types.d.ts +2 -2
- package/dist/types/components/internal/VatNumberField/types.d.ts +2 -2
- package/dist/types/core/Context/QueryContext/QueryClient.d.ts +2 -0
- package/dist/types/core/Context/QueryContext/QueryClientProvider.d.ts +4 -0
- package/dist/types/core/hooks/introduction/useHasSeenIntroduction.d.ts +1 -1
- package/dist/types/core/hooks/singpass/useHasSeenSingpassSelection.d.ts +1 -1
- package/dist/types/core/hooks/useCompanySearch/types.d.ts +2 -2
- package/dist/types/core/hooks/useCompanySearchTaskSubmit.d.ts +3 -3
- package/dist/types/core/hooks/useForm/types.d.ts +8 -8
- package/dist/types/core/hooks/useFormComposer.d.ts +2 -2
- package/dist/types/core/hooks/useLocalStorage.d.ts +2 -2
- package/dist/types/utils/useStateFromProp.d.ts +2 -2
- package/package.json +8 -2
|
@@ -7,9 +7,10 @@ import { jsx, jsxs, Fragment } from "preact/jsx-runtime";
|
|
|
7
7
|
import { debounce, noop as noop$1, isEmpty as isEmpty$1, range } from "lodash";
|
|
8
8
|
import isISIN from "validator/es/lib/isISIN.js";
|
|
9
9
|
import OpenBankingSDK from "@adyen/openbankingsdk";
|
|
10
|
-
import { jsxs as jsxs$1, jsx as jsx$1 } from "
|
|
10
|
+
import { jsxs as jsxs$1, jsx as jsx$1 } from "react/jsx-runtime";
|
|
11
11
|
import "@adyen/adyen-document-viewer/dist/adyen-document-viewer.min.css";
|
|
12
12
|
import AdyenDocumentViewer from "@adyen/adyen-document-viewer";
|
|
13
|
+
import { QueryClient as QueryClient$1, QueryClientProvider as QueryClientProvider$1 } from "@tanstack/react-query";
|
|
13
14
|
const ConfigurationApiContext = createContext(void 0);
|
|
14
15
|
const useConfigurationApi = () => {
|
|
15
16
|
const configurationApi = useContext(ConfigurationApiContext);
|
|
@@ -463,7 +464,6 @@ const depositSlip = "Deposit slip";
|
|
|
463
464
|
const screenshotOfOnlineBankingEnviroment = "Screenshot of online banking environment";
|
|
464
465
|
const officialEmailOrALetterFromYourBank = "Official email or a letter from your bank";
|
|
465
466
|
const check = "Check";
|
|
466
|
-
const releveDidentiteBancaire = "Relevé d'Identité Bancaire (RIB)";
|
|
467
467
|
const successFullyRemovedDecisionMaker = "Successfully removed a decision maker";
|
|
468
468
|
const failedToRemoveDecisionMaker = "Failed to remove a decision maker";
|
|
469
469
|
const chamberOfCommerceExtract = "Chamber of Commerce extract";
|
|
@@ -848,21 +848,21 @@ const getYourBusinessVerifiedDetails = "Get your business's verified details ins
|
|
|
848
848
|
const enterTheDetailsYourself = "Enter the details yourself";
|
|
849
849
|
const youAlsoHaveToUploadSomeSupportingDocuments = "You'll also have to upload some supporting documents.";
|
|
850
850
|
const verificationMethod = "Verification method";
|
|
851
|
-
const
|
|
852
|
-
const
|
|
853
|
-
const instantVerificationDescription = "
|
|
851
|
+
const verifyViaMobileBankingAppOrWebsite = "Verify via mobile banking app or website";
|
|
852
|
+
const uploadABankStatement = "Upload a bank statement";
|
|
853
|
+
const instantVerificationDescription = "Log in to your bank account and get instantly verified.";
|
|
854
854
|
const couldNotEstablishBankConnection = "We couldn't establish a connection with your bank";
|
|
855
855
|
const sorryAnErrorOccurred = "We are sorry, an error has occurred";
|
|
856
856
|
const ranIntoTechnicalError = "We ran into a technical error";
|
|
857
857
|
const failedInitializeInstantVerification = "Failed to initialize instant account verification process";
|
|
858
858
|
const couldNotCompleteAccountCheck = "We couldn't complete the account check";
|
|
859
859
|
const tryAgainOrManualAccountDetails = "Please try again later or provide account details manually.";
|
|
860
|
-
const manualVerificationDescription = "
|
|
860
|
+
const manualVerificationDescription = "You also have to provide the bank account details.";
|
|
861
861
|
const poweredBy = "Powered by";
|
|
862
862
|
const youSuccessfullyVerifiedAccount = "You’ve successfully verified your bank account.";
|
|
863
863
|
const verifyBankAccountAgain = "Verify bank account again";
|
|
864
864
|
const accountName = "Account name";
|
|
865
|
-
const
|
|
865
|
+
const mayTakeAFewDays = "May take a few days";
|
|
866
866
|
const instant = "Instant";
|
|
867
867
|
const isOurTrustedPartnerHelpingSpeedUpSetup = "%{provider} is our trusted partner helping speed up your account setup by instantly verifying your bank account.";
|
|
868
868
|
const howDoesVerificationWithOurPartnerWorks = "How does verification with our partner %{provider} work?";
|
|
@@ -1745,7 +1745,6 @@ const defaultTrans = {
|
|
|
1745
1745
|
screenshotOfOnlineBankingEnviroment,
|
|
1746
1746
|
officialEmailOrALetterFromYourBank,
|
|
1747
1747
|
check,
|
|
1748
|
-
releveDidentiteBancaire,
|
|
1749
1748
|
successFullyRemovedDecisionMaker,
|
|
1750
1749
|
failedToRemoveDecisionMaker,
|
|
1751
1750
|
chamberOfCommerceExtract,
|
|
@@ -2138,8 +2137,8 @@ const defaultTrans = {
|
|
|
2138
2137
|
enterTheDetailsYourself,
|
|
2139
2138
|
youAlsoHaveToUploadSomeSupportingDocuments,
|
|
2140
2139
|
verificationMethod,
|
|
2141
|
-
|
|
2142
|
-
|
|
2140
|
+
verifyViaMobileBankingAppOrWebsite,
|
|
2141
|
+
uploadABankStatement,
|
|
2143
2142
|
instantVerificationDescription,
|
|
2144
2143
|
couldNotEstablishBankConnection,
|
|
2145
2144
|
sorryAnErrorOccurred,
|
|
@@ -2152,7 +2151,7 @@ const defaultTrans = {
|
|
|
2152
2151
|
youSuccessfullyVerifiedAccount,
|
|
2153
2152
|
verifyBankAccountAgain,
|
|
2154
2153
|
accountName,
|
|
2155
|
-
|
|
2154
|
+
mayTakeAFewDays,
|
|
2156
2155
|
instant,
|
|
2157
2156
|
isOurTrustedPartnerHelpingSpeedUpSetup,
|
|
2158
2157
|
howDoesVerificationWithOurPartnerWorks,
|
|
@@ -2629,21 +2628,17 @@ const matchLocale = (locale, supportedLocales) => supportedLocales.find((supLoc)
|
|
|
2629
2628
|
function formatLocale(localeParam) {
|
|
2630
2629
|
const locale = localeParam.replace("_", "-");
|
|
2631
2630
|
const format = /([a-z]{2})(-)([A-Z]{2})/;
|
|
2632
|
-
if (format.test(locale))
|
|
2633
|
-
return locale;
|
|
2631
|
+
if (format.test(locale)) return locale;
|
|
2634
2632
|
const [languageCode, countryCode] = locale.split("-");
|
|
2635
|
-
if (!languageCode || !countryCode)
|
|
2636
|
-
return null;
|
|
2633
|
+
if (!languageCode || !countryCode) return null;
|
|
2637
2634
|
const fullLocale = [languageCode.toLowerCase(), countryCode.toUpperCase()].join("-");
|
|
2638
2635
|
return fullLocale.length === 5 ? fullLocale : null;
|
|
2639
2636
|
}
|
|
2640
2637
|
function parseLocale(locale, supportedLocales = []) {
|
|
2641
|
-
if (!locale || locale.length < 1 || locale.length > 5)
|
|
2642
|
-
return FALLBACK_LOCALE;
|
|
2638
|
+
if (!locale || locale.length < 1 || locale.length > 5) return FALLBACK_LOCALE;
|
|
2643
2639
|
const formattedLocale = formatLocale(locale);
|
|
2644
2640
|
const hasMatch = Boolean(formattedLocale && supportedLocales.includes(formattedLocale));
|
|
2645
|
-
if (hasMatch)
|
|
2646
|
-
return formattedLocale;
|
|
2641
|
+
if (hasMatch) return formattedLocale;
|
|
2647
2642
|
return matchLocale(formattedLocale || locale, supportedLocales);
|
|
2648
2643
|
}
|
|
2649
2644
|
const formatCustomTranslations = (supportedLocales, customTranslations = {}) => Object.keys(customTranslations).reduce((acc, cur) => {
|
|
@@ -3003,7 +2998,7 @@ const mergeFieldMetadataIntoProps = (fieldName, metadata, otherProps) => {
|
|
|
3003
2998
|
const MAX_LENGTH = 30;
|
|
3004
2999
|
const getMaxLengthByFieldAndCountry = (formattingRules, field, country2, ignoreIfFormatterExists) => {
|
|
3005
3000
|
var _a, _b, _c, _d;
|
|
3006
|
-
if (
|
|
3001
|
+
if ((_b = (_a = formattingRules[country2]) == null ? void 0 : _a[field]) == null ? void 0 : _b.formatter) {
|
|
3007
3002
|
return null;
|
|
3008
3003
|
}
|
|
3009
3004
|
const maxLength = (_d = (_c = formattingRules[country2]) == null ? void 0 : _c[field]) == null ? void 0 : _d.maxlength;
|
|
@@ -3034,8 +3029,7 @@ const createLogger = (namespace) => {
|
|
|
3034
3029
|
const methods = {};
|
|
3035
3030
|
consoleMethodsPrefixable.forEach((method) => {
|
|
3036
3031
|
methods[method] = (arg1, ...args) => {
|
|
3037
|
-
if (!console[method] || suppressed)
|
|
3038
|
-
return;
|
|
3032
|
+
if (!console[method] || suppressed) return;
|
|
3039
3033
|
if (!namespace) {
|
|
3040
3034
|
console[method](arg1, ...args);
|
|
3041
3035
|
} else if (stringSubstitutionRegex.test(arg1)) {
|
|
@@ -3048,45 +3042,45 @@ const createLogger = (namespace) => {
|
|
|
3048
3042
|
return methods;
|
|
3049
3043
|
};
|
|
3050
3044
|
const icons = {
|
|
3051
|
-
"arrow-left": lazy(() => import("./arrow-left-
|
|
3052
|
-
"arrow-right": lazy(() => import("./arrow-right-
|
|
3053
|
-
bin: lazy(() => import("./bin-
|
|
3054
|
-
check: lazy(() => import("./check-
|
|
3055
|
-
checkmark: lazy(() => import("./checkmark-
|
|
3056
|
-
"checkmark-small": lazy(() => import("./checkmark-small-
|
|
3057
|
-
"chevron-down": lazy(() => import("./chevron-down-
|
|
3058
|
-
"chevron-right": lazy(() => import("./chevron-right-
|
|
3059
|
-
"chevron-up": lazy(() => import("./chevron-up-
|
|
3060
|
-
company: lazy(() => import("./company-
|
|
3061
|
-
"company-2": lazy(() => import("./company-2-
|
|
3062
|
-
contract: lazy(() => import("./contract-
|
|
3063
|
-
"controlling-person": lazy(() => import("./controlling-person-
|
|
3064
|
-
cross: lazy(() => import("./cross-
|
|
3065
|
-
"decision-maker": lazy(() => import("./decision-maker-
|
|
3066
|
-
document: lazy(() => import("./document-
|
|
3067
|
-
download: lazy(() => import("./download-
|
|
3068
|
-
edit: lazy(() => import("./edit
|
|
3069
|
-
"field-error": lazy(() => import("./field-error-
|
|
3070
|
-
"info-circle": lazy(() => import("./info-circle-
|
|
3071
|
-
"light-bulb": lazy(() => import("./light-bulb-
|
|
3072
|
-
location: lazy(() => import("./location-
|
|
3073
|
-
"more-horiz": lazy(() => import("./more-horiz-
|
|
3074
|
-
"new-document": lazy(() => import("./new-document-
|
|
3075
|
-
owners: lazy(() => import("./owners-
|
|
3076
|
-
payout: lazy(() => import("./payout-
|
|
3077
|
-
pci: lazy(() => import("./pci-
|
|
3078
|
-
plus: lazy(() => import("./plus-
|
|
3079
|
-
remove: lazy(() => import("./remove-
|
|
3080
|
-
review: lazy(() => import("./review-
|
|
3081
|
-
search: lazy(() => import("./search-
|
|
3082
|
-
signatory: lazy(() => import("./signatory-
|
|
3083
|
-
store: lazy(() => import("./store-
|
|
3084
|
-
trust: lazy(() => import("./trust-
|
|
3085
|
-
user: lazy(() => import("./user-
|
|
3086
|
-
"user-business": lazy(() => import("./user-business-
|
|
3087
|
-
"users-3": lazy(() => import("./users-3-
|
|
3088
|
-
warning: lazy(() => import("./warning-
|
|
3089
|
-
wrong: lazy(() => import("./wrong-
|
|
3045
|
+
"arrow-left": lazy(() => import("./arrow-left-CwJQyOFz.js")),
|
|
3046
|
+
"arrow-right": lazy(() => import("./arrow-right-Cs_AKUOH.js")),
|
|
3047
|
+
bin: lazy(() => import("./bin-8yaAerXc.js")),
|
|
3048
|
+
check: lazy(() => import("./check-_cOIMziL.js")),
|
|
3049
|
+
checkmark: lazy(() => import("./checkmark-CZpv8i5a.js")),
|
|
3050
|
+
"checkmark-small": lazy(() => import("./checkmark-small-C4TPve-W.js")),
|
|
3051
|
+
"chevron-down": lazy(() => import("./chevron-down-CwS2tE_6.js")),
|
|
3052
|
+
"chevron-right": lazy(() => import("./chevron-right-B8cQLres.js")),
|
|
3053
|
+
"chevron-up": lazy(() => import("./chevron-up-DccG0tVR.js")),
|
|
3054
|
+
company: lazy(() => import("./company-BKO80hWm.js")),
|
|
3055
|
+
"company-2": lazy(() => import("./company-2-Cof0usfn.js")),
|
|
3056
|
+
contract: lazy(() => import("./contract-DrX5y2Qf.js")),
|
|
3057
|
+
"controlling-person": lazy(() => import("./controlling-person-B_dn0b9H.js")),
|
|
3058
|
+
cross: lazy(() => import("./cross-aFMJCrLf.js")),
|
|
3059
|
+
"decision-maker": lazy(() => import("./decision-maker-28_rW1ah.js")),
|
|
3060
|
+
document: lazy(() => import("./document-Bn_3PIDG.js")),
|
|
3061
|
+
download: lazy(() => import("./download-DgAZobJV.js")),
|
|
3062
|
+
edit: lazy(() => import("./edit-Dg19Ah77.js")),
|
|
3063
|
+
"field-error": lazy(() => import("./field-error-DkFiF_Cv.js")),
|
|
3064
|
+
"info-circle": lazy(() => import("./info-circle-CXFfd_nO.js")),
|
|
3065
|
+
"light-bulb": lazy(() => import("./light-bulb-CQ29JPA7.js")),
|
|
3066
|
+
location: lazy(() => import("./location-DmmjAv9A.js")),
|
|
3067
|
+
"more-horiz": lazy(() => import("./more-horiz-dyZQKaOn.js")),
|
|
3068
|
+
"new-document": lazy(() => import("./new-document-CeV8zHP8.js")),
|
|
3069
|
+
owners: lazy(() => import("./owners-C1dyQqRO.js")),
|
|
3070
|
+
payout: lazy(() => import("./payout-B-c43MDS.js")),
|
|
3071
|
+
pci: lazy(() => import("./pci-CVqIvwR-.js")),
|
|
3072
|
+
plus: lazy(() => import("./plus-BUH0nzS_.js")),
|
|
3073
|
+
remove: lazy(() => import("./remove-Bor5X8Xu.js")),
|
|
3074
|
+
review: lazy(() => import("./review-DcoDSRJT.js")),
|
|
3075
|
+
search: lazy(() => import("./search-SGLIdnsr.js")),
|
|
3076
|
+
signatory: lazy(() => import("./signatory-BMaWV_18.js")),
|
|
3077
|
+
store: lazy(() => import("./store-N4c2LHJ_.js")),
|
|
3078
|
+
trust: lazy(() => import("./trust-BcVDhtGL.js")),
|
|
3079
|
+
user: lazy(() => import("./user-C8STPF6-.js")),
|
|
3080
|
+
"user-business": lazy(() => import("./user-business-Dcvcw8gB.js")),
|
|
3081
|
+
"users-3": lazy(() => import("./users-3-D3QDBEk-.js")),
|
|
3082
|
+
warning: lazy(() => import("./warning-Dxxpni4H.js")),
|
|
3083
|
+
wrong: lazy(() => import("./wrong-DNwa4zZR.js"))
|
|
3090
3084
|
};
|
|
3091
3085
|
const logger$x = createLogger("Icon");
|
|
3092
3086
|
const Icon = ({
|
|
@@ -3226,8 +3220,7 @@ const Alert = ({
|
|
|
3226
3220
|
i18n
|
|
3227
3221
|
} = useI18nContext();
|
|
3228
3222
|
const [isClosed, setIsClosed] = useState(false);
|
|
3229
|
-
if (isClosed)
|
|
3230
|
-
return null;
|
|
3223
|
+
if (isClosed) return null;
|
|
3231
3224
|
const closeAlert = () => setIsClosed(true);
|
|
3232
3225
|
const classNames = cx("adl-alert", className, {
|
|
3233
3226
|
"adl-alert--basic": type === AlertTypes.BASIC,
|
|
@@ -3339,8 +3332,7 @@ const Link = ({
|
|
|
3339
3332
|
iconLeft = false,
|
|
3340
3333
|
onClick
|
|
3341
3334
|
}) => {
|
|
3342
|
-
if (!isValidLink(href))
|
|
3343
|
-
return null;
|
|
3335
|
+
if (!isValidLink(href)) return null;
|
|
3344
3336
|
const target = external ? "_blank" : "_self";
|
|
3345
3337
|
const rel = external ? "external noopener noreferrer" : void 0;
|
|
3346
3338
|
const showIcon = icon || external;
|
|
@@ -3618,8 +3610,7 @@ const useAllowedCountries = () => {
|
|
|
3618
3610
|
} = useConfigurationApi();
|
|
3619
3611
|
const [allowedCountries, setAllowedCountries] = useState(acceptedCountries);
|
|
3620
3612
|
useEffect(() => {
|
|
3621
|
-
if (acceptedCountries !== void 0)
|
|
3622
|
-
return;
|
|
3613
|
+
if (acceptedCountries !== void 0) return;
|
|
3623
3614
|
getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$v.error);
|
|
3624
3615
|
}, [acceptedCountries]);
|
|
3625
3616
|
return allowedCountries;
|
|
@@ -3750,8 +3741,7 @@ function reducer({
|
|
|
3750
3741
|
const validationSchema = selectedSchema || state2.schema;
|
|
3751
3742
|
switch (type) {
|
|
3752
3743
|
case "setData": {
|
|
3753
|
-
if (!key)
|
|
3754
|
-
return state2;
|
|
3744
|
+
if (!key) return state2;
|
|
3755
3745
|
return {
|
|
3756
3746
|
...state2,
|
|
3757
3747
|
data: {
|
|
@@ -3761,8 +3751,7 @@ function reducer({
|
|
|
3761
3751
|
};
|
|
3762
3752
|
}
|
|
3763
3753
|
case "setValid": {
|
|
3764
|
-
if (!key)
|
|
3765
|
-
return state2;
|
|
3754
|
+
if (!key) return state2;
|
|
3766
3755
|
return {
|
|
3767
3756
|
...state2,
|
|
3768
3757
|
valid: {
|
|
@@ -3772,8 +3761,7 @@ function reducer({
|
|
|
3772
3761
|
};
|
|
3773
3762
|
}
|
|
3774
3763
|
case "setErrors": {
|
|
3775
|
-
if (!key)
|
|
3776
|
-
return state2;
|
|
3764
|
+
if (!key) return state2;
|
|
3777
3765
|
return {
|
|
3778
3766
|
...state2,
|
|
3779
3767
|
errors: {
|
|
@@ -3799,8 +3787,7 @@ function reducer({
|
|
|
3799
3787
|
}, state2);
|
|
3800
3788
|
}
|
|
3801
3789
|
case "setSchema": {
|
|
3802
|
-
if (!schema)
|
|
3803
|
-
return state2;
|
|
3790
|
+
if (!schema) return state2;
|
|
3804
3791
|
const defaultState = init({
|
|
3805
3792
|
schema,
|
|
3806
3793
|
defaultData,
|
|
@@ -3835,8 +3822,7 @@ function reducer({
|
|
|
3835
3822
|
};
|
|
3836
3823
|
}
|
|
3837
3824
|
case "updateField": {
|
|
3838
|
-
if (!key || !mode)
|
|
3839
|
-
return state2;
|
|
3825
|
+
if (!key || !mode) return state2;
|
|
3840
3826
|
const [formattedValue, validation] = processField({
|
|
3841
3827
|
key,
|
|
3842
3828
|
value,
|
|
@@ -3964,11 +3950,9 @@ const useAsyncValidator = (asyncRules) => {
|
|
|
3964
3950
|
const [asyncValidationResults, setAsyncValidationResults] = useState({});
|
|
3965
3951
|
const clearAsyncValidationResults = useCallback(() => setAsyncValidationResults({}), []);
|
|
3966
3952
|
const triggerAsyncValidation = useCallback((field, formState, mode) => {
|
|
3967
|
-
if (!asyncRules)
|
|
3968
|
-
return clearAsyncValidationResults();
|
|
3953
|
+
if (!asyncRules) return clearAsyncValidationResults();
|
|
3969
3954
|
const rule = asyncRules[field];
|
|
3970
|
-
if (!rule || !rule.modes.includes(mode))
|
|
3971
|
-
return clearAsyncValidationResults();
|
|
3955
|
+
if (!rule || !rule.modes.includes(mode)) return clearAsyncValidationResults();
|
|
3972
3956
|
const value = formState.data[field];
|
|
3973
3957
|
return rule.asyncValidate(formState.data[field], {
|
|
3974
3958
|
state: formState
|
|
@@ -4021,8 +4005,7 @@ const useStaticValidator = (rules2) => {
|
|
|
4021
4005
|
};
|
|
4022
4006
|
};
|
|
4023
4007
|
const mergeStaticAndAsyncErrorsState = (staticValidationErrors, asyncValidationErrors, schema) => {
|
|
4024
|
-
if (!schema.length)
|
|
4025
|
-
return staticValidationErrors;
|
|
4008
|
+
if (!schema.length) return staticValidationErrors;
|
|
4026
4009
|
return schema.reduce((acc, field) => {
|
|
4027
4010
|
var _a;
|
|
4028
4011
|
return {
|
|
@@ -4076,8 +4059,7 @@ function useForm({
|
|
|
4076
4059
|
return (_a = state2.schema) == null ? void 0 : _a.every((key) => state2.valid[key]);
|
|
4077
4060
|
}, [state2.schema, state2.valid]);
|
|
4078
4061
|
const getTargetValue = useCallback((key, e) => {
|
|
4079
|
-
if (!(e == null ? void 0 : e.target))
|
|
4080
|
-
return e;
|
|
4062
|
+
if (!(e == null ? void 0 : e.target)) return e;
|
|
4081
4063
|
if (e.target.type === "checkbox") {
|
|
4082
4064
|
return !state2.data[key];
|
|
4083
4065
|
}
|
|
@@ -4173,8 +4155,7 @@ function useDataset(datasetIdentifier2, skip) {
|
|
|
4173
4155
|
const [dataset, setDataset] = useState([]);
|
|
4174
4156
|
const [loaded, setLoaded] = useState(false);
|
|
4175
4157
|
useEffect(() => {
|
|
4176
|
-
if (skip)
|
|
4177
|
-
return;
|
|
4158
|
+
if (skip) return;
|
|
4178
4159
|
getDataset2(datasetIdentifier2, i18n.locale).then((response) => {
|
|
4179
4160
|
const result = response && response.length ? response : [];
|
|
4180
4161
|
setDataset(result);
|
|
@@ -4337,15 +4318,12 @@ const Field = ({
|
|
|
4337
4318
|
isValid: !!isValid,
|
|
4338
4319
|
onBlurHandler: (e) => {
|
|
4339
4320
|
setIsFocused(false);
|
|
4340
|
-
if (onBlur)
|
|
4341
|
-
|
|
4342
|
-
if (onFieldBlur)
|
|
4343
|
-
onFieldBlur(e);
|
|
4321
|
+
if (onBlur) onBlur(e);
|
|
4322
|
+
if (onFieldBlur) onFieldBlur(e);
|
|
4344
4323
|
},
|
|
4345
4324
|
onFocusHandler: (e) => {
|
|
4346
4325
|
setIsFocused(true);
|
|
4347
|
-
if (onFocus)
|
|
4348
|
-
onFocus(e);
|
|
4326
|
+
if (onFocus) onFocus(e);
|
|
4349
4327
|
},
|
|
4350
4328
|
uniqueId
|
|
4351
4329
|
}), helper && helperPosition === "below" && jsx("span", {
|
|
@@ -4382,13 +4360,11 @@ const Field = ({
|
|
|
4382
4360
|
});
|
|
4383
4361
|
};
|
|
4384
4362
|
const getScrollParent = (node) => {
|
|
4385
|
-
if (!node)
|
|
4386
|
-
return null;
|
|
4363
|
+
if (!node) return null;
|
|
4387
4364
|
const isElement = node instanceof HTMLElement;
|
|
4388
4365
|
const overflowY = isElement && window.getComputedStyle(node).overflowY;
|
|
4389
4366
|
const isScrollable = overflowY !== "visible" && overflowY !== "hidden";
|
|
4390
|
-
if (isElement && isScrollable)
|
|
4391
|
-
return node;
|
|
4367
|
+
if (isElement && isScrollable) return node;
|
|
4392
4368
|
return getScrollParent(node.parentNode) ?? document.body;
|
|
4393
4369
|
};
|
|
4394
4370
|
function uuidv4() {
|
|
@@ -4438,11 +4414,10 @@ function SelectButtonElement({
|
|
|
4438
4414
|
isSearch,
|
|
4439
4415
|
...props
|
|
4440
4416
|
}) {
|
|
4441
|
-
if (filterable || isMulti || isSearch)
|
|
4442
|
-
|
|
4443
|
-
|
|
4444
|
-
|
|
4445
|
-
});
|
|
4417
|
+
if (filterable || isMulti || isSearch) return jsx("div", {
|
|
4418
|
+
...props,
|
|
4419
|
+
ref: toggleButtonRef
|
|
4420
|
+
});
|
|
4446
4421
|
return jsx("button", {
|
|
4447
4422
|
...props,
|
|
4448
4423
|
ref: toggleButtonRef,
|
|
@@ -4634,13 +4609,11 @@ const SelectListItem = ({
|
|
|
4634
4609
|
"data-disabled": !!item.disabled,
|
|
4635
4610
|
"data-value": item.id,
|
|
4636
4611
|
onClick: () => {
|
|
4637
|
-
if (item.disabled)
|
|
4638
|
-
return;
|
|
4612
|
+
if (item.disabled) return;
|
|
4639
4613
|
onSelect(!selected);
|
|
4640
4614
|
},
|
|
4641
4615
|
onKeyDown: (e) => {
|
|
4642
|
-
if (item.disabled)
|
|
4643
|
-
return;
|
|
4616
|
+
if (item.disabled) return;
|
|
4644
4617
|
onKeyDown(e);
|
|
4645
4618
|
},
|
|
4646
4619
|
role: "option",
|
|
@@ -4772,8 +4745,7 @@ const Select = ({
|
|
|
4772
4745
|
const closeList = () => {
|
|
4773
4746
|
setTextFilter(null);
|
|
4774
4747
|
setIsShowList(false);
|
|
4775
|
-
if (toggleButtonRef.current)
|
|
4776
|
-
toggleButtonRef.current.focus();
|
|
4748
|
+
if (toggleButtonRef.current) toggleButtonRef.current.focus();
|
|
4777
4749
|
};
|
|
4778
4750
|
const showList = () => {
|
|
4779
4751
|
let sp = scrollParent;
|
|
@@ -4800,8 +4772,7 @@ const Select = ({
|
|
|
4800
4772
|
setIsShowList(false);
|
|
4801
4773
|
};
|
|
4802
4774
|
const handleSelect = (selectedItem) => {
|
|
4803
|
-
if (readonly)
|
|
4804
|
-
return;
|
|
4775
|
+
if (readonly) return;
|
|
4805
4776
|
if (isMulti) {
|
|
4806
4777
|
const isAlreadySelected = active.find((item) => item.id === selectedItem.id);
|
|
4807
4778
|
const newActiveItems = isAlreadySelected ? [...active.filter((i) => i.id !== selectedItem.id).map((i) => i.id)] : [...active.map((i) => i.id), selectedItem.id];
|
|
@@ -4864,8 +4835,7 @@ const Select = ({
|
|
|
4864
4835
|
break;
|
|
4865
4836
|
case KEYBOARD_KEYS.arrowDown:
|
|
4866
4837
|
e.preventDefault();
|
|
4867
|
-
if (target.nextElementSibling)
|
|
4868
|
-
target.nextElementSibling.focus();
|
|
4838
|
+
if (target.nextElementSibling) target.nextElementSibling.focus();
|
|
4869
4839
|
break;
|
|
4870
4840
|
case KEYBOARD_KEYS.arrowUp:
|
|
4871
4841
|
e.preventDefault();
|
|
@@ -5664,8 +5634,7 @@ const tryShift = (matchedTokens, remainingTokens, fromIndex, shiftDistance) => {
|
|
|
5664
5634
|
}
|
|
5665
5635
|
return ((_a = token.allow) == null ? void 0 : _a.test(token.potentialValue)) ?? true;
|
|
5666
5636
|
});
|
|
5667
|
-
if (!allValid)
|
|
5668
|
-
return "notPossible";
|
|
5637
|
+
if (!allValid) return "notPossible";
|
|
5669
5638
|
let matchedUpTo = 0;
|
|
5670
5639
|
for (let i = 0; i < normalizedTokens.length; i += 1) {
|
|
5671
5640
|
const token = normalizedInputTokens.find((t) => t.originalIndex === i) ?? normalizedTokens[i];
|
|
@@ -5700,8 +5669,7 @@ const getAvailableInputTokens = (tokens) => {
|
|
|
5700
5669
|
...token,
|
|
5701
5670
|
offset: tokens.indexOf(token)
|
|
5702
5671
|
});
|
|
5703
|
-
if (token.type !== "input" || !token.optional)
|
|
5704
|
-
break;
|
|
5672
|
+
if (token.type !== "input" || !token.optional) break;
|
|
5705
5673
|
}
|
|
5706
5674
|
return availableTokens;
|
|
5707
5675
|
};
|
|
@@ -5710,13 +5678,10 @@ const getEagerSuffix = (tokens) => {
|
|
|
5710
5678
|
let suffix = "";
|
|
5711
5679
|
for (const token of tokens) {
|
|
5712
5680
|
if (token.type === "input") {
|
|
5713
|
-
if (token.optional)
|
|
5714
|
-
|
|
5715
|
-
else
|
|
5716
|
-
break;
|
|
5681
|
+
if (token.optional) continue;
|
|
5682
|
+
else break;
|
|
5717
5683
|
}
|
|
5718
|
-
if (!token.displayEagerly)
|
|
5719
|
-
break;
|
|
5684
|
+
if (!token.displayEagerly) break;
|
|
5720
5685
|
suffix += token.char;
|
|
5721
5686
|
}
|
|
5722
5687
|
return suffix;
|
|
@@ -5744,12 +5709,11 @@ const matchAgainstMask = (pureValue, mask, acceptObscuredValue = false) => {
|
|
|
5744
5709
|
while (true) {
|
|
5745
5710
|
const char = charsToProcess[0];
|
|
5746
5711
|
const token = tokensToProcess[0];
|
|
5747
|
-
if (!char && !tokensToProcess.some((t) => t.type === "input" && !t.optional))
|
|
5748
|
-
|
|
5749
|
-
|
|
5750
|
-
|
|
5751
|
-
|
|
5752
|
-
};
|
|
5712
|
+
if (!char && !tokensToProcess.some((t) => t.type === "input" && !t.optional)) return {
|
|
5713
|
+
outcome: "correct",
|
|
5714
|
+
displayValue: displayValue() + getEagerSuffix(tokensToProcess),
|
|
5715
|
+
potentialForMoreOptionalInput: getPotentialForMoreOptionalInput(tokensToProcess)
|
|
5716
|
+
};
|
|
5753
5717
|
if (!char) {
|
|
5754
5718
|
const output = shiftRight(mask.possibleShifts, matchedTokens, tokensToProcess);
|
|
5755
5719
|
matchedTokens = output.matchedTokens;
|
|
@@ -5759,24 +5723,22 @@ const matchAgainstMask = (pureValue, mask, acceptObscuredValue = false) => {
|
|
|
5759
5723
|
displayValue: displayValue() + getEagerSuffix(tokensToProcess)
|
|
5760
5724
|
};
|
|
5761
5725
|
}
|
|
5762
|
-
if (!token)
|
|
5763
|
-
|
|
5764
|
-
|
|
5765
|
-
|
|
5766
|
-
|
|
5767
|
-
|
|
5768
|
-
|
|
5769
|
-
};
|
|
5726
|
+
if (!token) return {
|
|
5727
|
+
outcome: "mismatch",
|
|
5728
|
+
badChar: char,
|
|
5729
|
+
mismatchAtChar: charIndex,
|
|
5730
|
+
mismatchedToken: "inputTooLong",
|
|
5731
|
+
partialDisplayValue: displayValue()
|
|
5732
|
+
};
|
|
5770
5733
|
if (token.type === "nonInput") {
|
|
5771
5734
|
if (token.includeInValue) {
|
|
5772
|
-
if (char !== token.char)
|
|
5773
|
-
|
|
5774
|
-
|
|
5775
|
-
|
|
5776
|
-
|
|
5777
|
-
|
|
5778
|
-
|
|
5779
|
-
};
|
|
5735
|
+
if (char !== token.char) return {
|
|
5736
|
+
outcome: "mismatch",
|
|
5737
|
+
badChar: char,
|
|
5738
|
+
mismatchAtChar: charIndex,
|
|
5739
|
+
mismatchedToken: token,
|
|
5740
|
+
partialDisplayValue: displayValue()
|
|
5741
|
+
};
|
|
5780
5742
|
shiftChars(1);
|
|
5781
5743
|
}
|
|
5782
5744
|
matchedTokens.push(token);
|
|
@@ -5785,14 +5747,13 @@ const matchAgainstMask = (pureValue, mask, acceptObscuredValue = false) => {
|
|
|
5785
5747
|
if (token.type === "input") {
|
|
5786
5748
|
const availableTokens = getAvailableInputTokens(tokensToProcess);
|
|
5787
5749
|
const matchingToken = findMatchingToken(availableTokens, char);
|
|
5788
|
-
if (!matchingToken)
|
|
5789
|
-
|
|
5790
|
-
|
|
5791
|
-
|
|
5792
|
-
|
|
5793
|
-
|
|
5794
|
-
|
|
5795
|
-
};
|
|
5750
|
+
if (!matchingToken) return {
|
|
5751
|
+
outcome: "mismatch",
|
|
5752
|
+
badChar: char,
|
|
5753
|
+
mismatchAtChar: charIndex,
|
|
5754
|
+
mismatchedToken: token,
|
|
5755
|
+
partialDisplayValue: displayValue()
|
|
5756
|
+
};
|
|
5796
5757
|
matchedTokens.push({
|
|
5797
5758
|
...matchingToken,
|
|
5798
5759
|
char
|
|
@@ -5803,30 +5764,26 @@ const matchAgainstMask = (pureValue, mask, acceptObscuredValue = false) => {
|
|
|
5803
5764
|
}
|
|
5804
5765
|
};
|
|
5805
5766
|
const deriveInputState = (isValid, isFocused, hasBlurred, isDisabled, errorMessage, shouldValidate, potentiallyMoreOptionalCharacters, formatGuidance, i18n) => {
|
|
5806
|
-
if (isDisabled)
|
|
5807
|
-
|
|
5808
|
-
|
|
5809
|
-
|
|
5810
|
-
|
|
5811
|
-
|
|
5812
|
-
|
|
5813
|
-
|
|
5814
|
-
|
|
5815
|
-
|
|
5816
|
-
|
|
5817
|
-
|
|
5818
|
-
|
|
5819
|
-
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
|
|
5823
|
-
|
|
5824
|
-
|
|
5825
|
-
|
|
5826
|
-
return {
|
|
5827
|
-
isError: true,
|
|
5828
|
-
text: typeof errorMessage === "string" && errorMessage ? errorMessage : formatGuidance
|
|
5829
|
-
};
|
|
5767
|
+
if (isDisabled) return {
|
|
5768
|
+
isError: false
|
|
5769
|
+
};
|
|
5770
|
+
if (isValid && (!potentiallyMoreOptionalCharacters || !isFocused)) return {
|
|
5771
|
+
isError: false,
|
|
5772
|
+
text: jsxs(Fragment, {
|
|
5773
|
+
children: [jsx(Icon, {
|
|
5774
|
+
name: "checkmark-small",
|
|
5775
|
+
className: "adyen-kyc-helper-text__valid-format-check"
|
|
5776
|
+
}), i18n.get("formatIsCorrect")]
|
|
5777
|
+
})
|
|
5778
|
+
};
|
|
5779
|
+
if (isFocused && formatGuidance) return {
|
|
5780
|
+
isError: false,
|
|
5781
|
+
text: formatGuidance
|
|
5782
|
+
};
|
|
5783
|
+
if (!isValid && (shouldValidate || hasBlurred)) return {
|
|
5784
|
+
isError: true,
|
|
5785
|
+
text: typeof errorMessage === "string" && errorMessage ? errorMessage : formatGuidance
|
|
5786
|
+
};
|
|
5830
5787
|
return {
|
|
5831
5788
|
isError: false
|
|
5832
5789
|
};
|
|
@@ -5862,12 +5819,10 @@ const MaskedInputText = ({
|
|
|
5862
5819
|
i18n
|
|
5863
5820
|
} = useI18nContext();
|
|
5864
5821
|
const onMismatch = (mismatch) => {
|
|
5865
|
-
if (!inputRef.current)
|
|
5866
|
-
return;
|
|
5822
|
+
if (!inputRef.current) return;
|
|
5867
5823
|
setShowingMismatch(true);
|
|
5868
5824
|
inputRef.current.addEventListener("animationend", (event) => {
|
|
5869
|
-
if (event.animationName !== MISMATCH_ANIMATION_NAME)
|
|
5870
|
-
return;
|
|
5825
|
+
if (event.animationName !== MISMATCH_ANIMATION_NAME) return;
|
|
5871
5826
|
setShowingMismatch(false);
|
|
5872
5827
|
});
|
|
5873
5828
|
onMismatchExternal == null ? void 0 : onMismatchExternal(mismatch);
|
|
@@ -5878,16 +5833,14 @@ const MaskedInputText = ({
|
|
|
5878
5833
|
}
|
|
5879
5834
|
}, [mask]);
|
|
5880
5835
|
const getMaskResult = useCallback((pureValue) => {
|
|
5881
|
-
if (!mask)
|
|
5882
|
-
|
|
5883
|
-
|
|
5884
|
-
|
|
5885
|
-
};
|
|
5836
|
+
if (!mask) return {
|
|
5837
|
+
outcome: "partialCorrect",
|
|
5838
|
+
displayValue: pureValue
|
|
5839
|
+
};
|
|
5886
5840
|
return matchAgainstMask(transformOnType ? transformOnType(pureValue) : pureValue, mask, acceptObscuredValue);
|
|
5887
5841
|
}, [mask, transformOnType, acceptObscuredValue]);
|
|
5888
5842
|
const displayValueToPure = useCallback((displayValue2) => {
|
|
5889
|
-
if (!mask)
|
|
5890
|
-
return displayValue2;
|
|
5843
|
+
if (!mask) return displayValue2;
|
|
5891
5844
|
return displayValueToPureValue(displayValue2, mask);
|
|
5892
5845
|
}, [mask]);
|
|
5893
5846
|
const maskResult = useMemo(() => getMaskResult(value), [getMaskResult, value]);
|
|
@@ -5917,8 +5870,7 @@ Falling back to partially valid value "${fallback}"`);
|
|
|
5917
5870
|
const newPureValue = displayValueToPure(inputEl.value);
|
|
5918
5871
|
const newMaskResult = getMaskResult(newPureValue);
|
|
5919
5872
|
const returnCaretLater = (offset = 0) => {
|
|
5920
|
-
if (!inputEl.selectionStart)
|
|
5921
|
-
return;
|
|
5873
|
+
if (!inputEl.selectionStart) return;
|
|
5922
5874
|
setCaretReturnPosition(inputEl.selectionStart + offset);
|
|
5923
5875
|
};
|
|
5924
5876
|
const cancelInput = () => {
|
|
@@ -5963,8 +5915,7 @@ Falling back to partially valid value "${fallback}"`);
|
|
|
5963
5915
|
selectionStart,
|
|
5964
5916
|
selectionEnd
|
|
5965
5917
|
} = inputEl;
|
|
5966
|
-
if (!pasteValue || !selectionStart || selectionStart !== selectionEnd)
|
|
5967
|
-
return;
|
|
5918
|
+
if (!pasteValue || !selectionStart || selectionStart !== selectionEnd) return;
|
|
5968
5919
|
const pureDisplayValue = displayValueToPure(displayValue);
|
|
5969
5920
|
const purePasteValue = displayValueToPure(pasteValue);
|
|
5970
5921
|
const newPureValue = pureDisplayValue.slice(0, selectionStart) + purePasteValue + pureDisplayValue.slice(selectionStart);
|
|
@@ -5983,8 +5934,7 @@ Falling back to partially valid value "${fallback}"`);
|
|
|
5983
5934
|
onKeyDown: (event) => {
|
|
5984
5935
|
const inputEl = event.target;
|
|
5985
5936
|
const isCaretAtEndWithNoSelection = inputEl.selectionStart === inputEl.value.length && inputEl.selectionStart === inputEl.selectionEnd;
|
|
5986
|
-
if (event.key !== KEYBOARD_KEYS.backspace || !isCaretAtEndWithNoSelection)
|
|
5987
|
-
return;
|
|
5937
|
+
if (event.key !== KEYBOARD_KEYS.backspace || !isCaretAtEndWithNoSelection) return;
|
|
5988
5938
|
event.preventDefault();
|
|
5989
5939
|
const withLastCharRemoved = value.slice(0, value.length - 1);
|
|
5990
5940
|
const newMaskResult = getMaskResult(withLastCharRemoved);
|
|
@@ -6121,8 +6071,7 @@ const companyRegistrationNumberOptions = {
|
|
|
6121
6071
|
};
|
|
6122
6072
|
const getCompanyRegistrationNumberOptions = (country2, companyType2) => {
|
|
6123
6073
|
const optionsForCountry = companyRegistrationNumberOptions[country2];
|
|
6124
|
-
if (!companyType2 || !optionsForCountry)
|
|
6125
|
-
return optionsForCountry;
|
|
6074
|
+
if (!companyType2 || !optionsForCountry) return optionsForCountry;
|
|
6126
6075
|
return optionsForCountry.filter((option) => {
|
|
6127
6076
|
var _a;
|
|
6128
6077
|
return ((_a = option.applicableOnlyFor) == null ? void 0 : _a.includes(companyType2)) ?? true;
|
|
@@ -6188,8 +6137,7 @@ const taxIdNumberOptions = {
|
|
|
6188
6137
|
};
|
|
6189
6138
|
const getTaxIdNumberOptions = (country2, companyType2) => {
|
|
6190
6139
|
const optionsForCountry = taxIdNumberOptions[country2];
|
|
6191
|
-
if (!companyType2 || !optionsForCountry)
|
|
6192
|
-
return optionsForCountry;
|
|
6140
|
+
if (!companyType2 || !optionsForCountry) return optionsForCountry;
|
|
6193
6141
|
return optionsForCountry.filter((option) => {
|
|
6194
6142
|
var _a;
|
|
6195
6143
|
return ((_a = option.applicableOnlyFor) == null ? void 0 : _a.includes(companyType2)) ?? true;
|
|
@@ -6217,8 +6165,7 @@ function CompanyRegistrationNumberTypeSelector({
|
|
|
6217
6165
|
}, [exemptedOption, setSelected]);
|
|
6218
6166
|
const options = useMemo(() => {
|
|
6219
6167
|
const availableOptions = getCompanyRegistrationNumberOptions(country2, companyType2) ?? [];
|
|
6220
|
-
if (availableOptions.length === 0 || !exemptedOption)
|
|
6221
|
-
return availableOptions;
|
|
6168
|
+
if (availableOptions.length === 0 || !exemptedOption) return availableOptions;
|
|
6222
6169
|
return [...availableOptions, {
|
|
6223
6170
|
id: "exempted",
|
|
6224
6171
|
name: exemptedOption
|
|
@@ -6229,8 +6176,7 @@ function CompanyRegistrationNumberTypeSelector({
|
|
|
6229
6176
|
setSelected(options[0].id);
|
|
6230
6177
|
}
|
|
6231
6178
|
}, [options, selected, setSelected]);
|
|
6232
|
-
if (options.length <= 1)
|
|
6233
|
-
return null;
|
|
6179
|
+
if (options.length <= 1) return null;
|
|
6234
6180
|
return jsx(Field, {
|
|
6235
6181
|
name: "companyRegistrationNumberType",
|
|
6236
6182
|
label: i18n.get("whichTypeOfRegistrationNumberDoYouHave"),
|
|
@@ -7441,15 +7387,13 @@ const defaultFieldConfig$8 = {
|
|
|
7441
7387
|
const inferCompanyRegistrationNumberType = (registrationNumber2, country2, companyType2) => {
|
|
7442
7388
|
const optionsForCountry = companyRegistrationNumberOptions[country2];
|
|
7443
7389
|
const metadataFn = defaultFieldConfig$8[country2];
|
|
7444
|
-
if (!optionsForCountry || !metadataFn || typeof metadataFn !== "function")
|
|
7445
|
-
return void 0;
|
|
7390
|
+
if (!optionsForCountry || !metadataFn || typeof metadataFn !== "function") return void 0;
|
|
7446
7391
|
for (const option of optionsForCountry) {
|
|
7447
7392
|
const fieldMetadata = metadataFn({
|
|
7448
7393
|
companyType: companyType2,
|
|
7449
7394
|
registrationNumberType: option.id
|
|
7450
7395
|
});
|
|
7451
|
-
if (!fieldMetadata.validators)
|
|
7452
|
-
continue;
|
|
7396
|
+
if (!fieldMetadata.validators) continue;
|
|
7453
7397
|
const validators = Array.isArray(fieldMetadata.validators) ? fieldMetadata.validators : [fieldMetadata.validators];
|
|
7454
7398
|
if (validators.every((validator) => validator.validate(registrationNumber2))) {
|
|
7455
7399
|
return option.id;
|
|
@@ -8748,15 +8692,13 @@ const defaultFieldConfig$6 = {
|
|
|
8748
8692
|
const inferTaxIdNumberType = (taxId2, country2) => {
|
|
8749
8693
|
const optionsForCountry = taxIdNumberOptions[country2];
|
|
8750
8694
|
const metadataFn = defaultFieldConfig$6[country2] ?? defaultFieldConfig$7[country2];
|
|
8751
|
-
if (!optionsForCountry || !metadataFn || typeof metadataFn !== "function")
|
|
8752
|
-
return void 0;
|
|
8695
|
+
if (!optionsForCountry || !metadataFn || typeof metadataFn !== "function") return void 0;
|
|
8753
8696
|
for (const option of optionsForCountry) {
|
|
8754
8697
|
const fieldMetadata = metadataFn({
|
|
8755
8698
|
taxIdNumberType: option.id,
|
|
8756
8699
|
vatNumberType: option.id
|
|
8757
8700
|
});
|
|
8758
|
-
if (!fieldMetadata.validators)
|
|
8759
|
-
continue;
|
|
8701
|
+
if (!fieldMetadata.validators) continue;
|
|
8760
8702
|
const validators = Array.isArray(fieldMetadata.validators) ? fieldMetadata.validators : [fieldMetadata.validators];
|
|
8761
8703
|
if (validators.every((validator) => validator.validate(taxId2))) {
|
|
8762
8704
|
return option.id;
|
|
@@ -8785,8 +8727,7 @@ function TaxIdNumberTypeSelector({
|
|
|
8785
8727
|
}, [exemptedOption, setSelected]);
|
|
8786
8728
|
const options = useMemo(() => {
|
|
8787
8729
|
const availableOptions = getTaxIdNumberOptions(country2, companyType2) ?? [];
|
|
8788
|
-
if (availableOptions.length === 0 || !exemptedOption)
|
|
8789
|
-
return availableOptions;
|
|
8730
|
+
if (availableOptions.length === 0 || !exemptedOption) return availableOptions;
|
|
8790
8731
|
return [...availableOptions, {
|
|
8791
8732
|
id: "exempted",
|
|
8792
8733
|
name: exemptedOption
|
|
@@ -8797,8 +8738,7 @@ function TaxIdNumberTypeSelector({
|
|
|
8797
8738
|
handleSelect(options[0].id);
|
|
8798
8739
|
}
|
|
8799
8740
|
}, [options, selected, handleSelect]);
|
|
8800
|
-
if (options.length <= 1)
|
|
8801
|
-
return null;
|
|
8741
|
+
if (options.length <= 1) return null;
|
|
8802
8742
|
return jsx(Field, {
|
|
8803
8743
|
name: "taxIdNumberType",
|
|
8804
8744
|
label: i18n.get("whichTypeOfTaxIdNumberDoYouHave"),
|
|
@@ -9020,8 +8960,7 @@ function VatNumber(props) {
|
|
|
9020
8960
|
}
|
|
9021
8961
|
});
|
|
9022
8962
|
}, [data, valid, errors, isValid]);
|
|
9023
|
-
if (!formUtils.isRequiredField("vatNumber"))
|
|
9024
|
-
return null;
|
|
8963
|
+
if (!formUtils.isRequiredField("vatNumber")) return null;
|
|
9025
8964
|
const exemptionIsPossible = ((_b = mergedProps.requiredFields) == null ? void 0 : _b.includes("exemptedFromVat")) ?? false;
|
|
9026
8965
|
const showTaxIdExemptedOption = exemptionIsPossible && ((_c = taxIdNumberOptions[country2]) == null ? void 0 : _c.length) > 1;
|
|
9027
8966
|
const handleTaxIdNumberTypeChange = (taxIdType) => {
|
|
@@ -9969,10 +9908,9 @@ const EntityTypeSelectionRadioCardBody = ({
|
|
|
9969
9908
|
const {
|
|
9970
9909
|
i18n
|
|
9971
9910
|
} = useI18nContext();
|
|
9972
|
-
if (!examples)
|
|
9973
|
-
|
|
9974
|
-
|
|
9975
|
-
});
|
|
9911
|
+
if (!examples) return jsx("span", {
|
|
9912
|
+
children: i18n.get(description2)
|
|
9913
|
+
});
|
|
9976
9914
|
return jsxs(Fragment, {
|
|
9977
9915
|
children: [jsx("span", {
|
|
9978
9916
|
className: "adyen-kyc-entity-type-radio-group-card__description",
|
|
@@ -9991,8 +9929,7 @@ const EntityTypeSelectionRadioCardBody = ({
|
|
|
9991
9929
|
const CoreContext = createContext(void 0);
|
|
9992
9930
|
const useCoreContext = () => {
|
|
9993
9931
|
const context = useContext(CoreContext);
|
|
9994
|
-
if (!context)
|
|
9995
|
-
throw Error("You need a <CoreProvider> to use core context");
|
|
9932
|
+
if (!context) throw Error("You need a <CoreProvider> to use core context");
|
|
9996
9933
|
return context;
|
|
9997
9934
|
};
|
|
9998
9935
|
var TrustMemberTypes = /* @__PURE__ */ ((TrustMemberTypes2) => {
|
|
@@ -10205,22 +10142,17 @@ function getNestedPropertyKeys(obj, includeUndefined = false) {
|
|
|
10205
10142
|
return fieldNames;
|
|
10206
10143
|
}
|
|
10207
10144
|
const getTaskStatus = (type, capabilityProblems, rootLegalEntity, entityIds, skipPendingCapabilitiesCheck = false) => {
|
|
10208
|
-
if (!(entityIds == null ? void 0 : entityIds.length) || entityIds.includes(rootLegalEntity.id) && isEmptyEntity(rootLegalEntity))
|
|
10209
|
-
return TaskStatus.EMPTY;
|
|
10145
|
+
if (!(entityIds == null ? void 0 : entityIds.length) || entityIds.includes(rootLegalEntity.id) && isEmptyEntity(rootLegalEntity)) return TaskStatus.EMPTY;
|
|
10210
10146
|
const importantCapabilityStatus = checkForImportantCapabilityStatus(type, capabilityProblems, entityIds);
|
|
10211
|
-
if (importantCapabilityStatus)
|
|
10212
|
-
|
|
10213
|
-
if (!skipPendingCapabilitiesCheck && hasPendingCapabilities(rootLegalEntity))
|
|
10214
|
-
return TaskStatus.PROCESSING;
|
|
10147
|
+
if (importantCapabilityStatus) return importantCapabilityStatus;
|
|
10148
|
+
if (!skipPendingCapabilitiesCheck && hasPendingCapabilities(rootLegalEntity)) return TaskStatus.PROCESSING;
|
|
10215
10149
|
return TaskStatus.FINISHED;
|
|
10216
10150
|
};
|
|
10217
10151
|
const IMPORTANT_STATUSES = [TaskStatus.DETAILS_REQUIRED, TaskStatus.DOWNLOAD, TaskStatus.ERROR, TaskStatus.PROCESSING];
|
|
10218
10152
|
function checkForImportantCapabilityStatus(type, capabilityProblems, entityIds) {
|
|
10219
|
-
if (!(capabilityProblems == null ? void 0 : capabilityProblems[type]) || !entityIds)
|
|
10220
|
-
return;
|
|
10153
|
+
if (!(capabilityProblems == null ? void 0 : capabilityProblems[type]) || !entityIds) return;
|
|
10221
10154
|
const importantStatuses = Object.entries(capabilityProblems[type] ?? {}).filter(([key]) => entityIds == null ? void 0 : entityIds.includes(key)).map(([, value]) => value.status).filter((status) => status !== void 0 && IMPORTANT_STATUSES.includes(status));
|
|
10222
|
-
if (!importantStatuses.length)
|
|
10223
|
-
return;
|
|
10155
|
+
if (!importantStatuses.length) return;
|
|
10224
10156
|
return importantStatuses.reduce((prev, curr) => curr > prev ? curr : prev);
|
|
10225
10157
|
}
|
|
10226
10158
|
const hasPendingCapabilities = (legalEntityResponse) => Object.values(legalEntityResponse.capabilities ?? {}).some((capability) => capability.verificationStatus === "pending");
|
|
@@ -10239,14 +10171,11 @@ const emptyFieldsByEntityType = {
|
|
|
10239
10171
|
function isEmptyEntity(legalEntity) {
|
|
10240
10172
|
var _a;
|
|
10241
10173
|
const type = legalEntity == null ? void 0 : legalEntity.type;
|
|
10242
|
-
if (!type)
|
|
10243
|
-
|
|
10244
|
-
if ((_a = legalEntity.documentDetails) == null ? void 0 : _a.length)
|
|
10245
|
-
return false;
|
|
10174
|
+
if (!type) return true;
|
|
10175
|
+
if ((_a = legalEntity.documentDetails) == null ? void 0 : _a.length) return false;
|
|
10246
10176
|
const minimumFields = emptyFieldsByEntityType[type];
|
|
10247
10177
|
const typeSpecificSection = legalEntity[type];
|
|
10248
|
-
if (!typeSpecificSection)
|
|
10249
|
-
return true;
|
|
10178
|
+
if (!typeSpecificSection) return true;
|
|
10250
10179
|
const fieldsOnEntity = getNestedPropertyKeys(typeSpecificSection);
|
|
10251
10180
|
return !fieldsOnEntity.some((field) => !minimumFields.includes(field));
|
|
10252
10181
|
}
|
|
@@ -10261,8 +10190,7 @@ const getDefaultAccountHolderType = (legalEntityResponse, isTypeChanging = false
|
|
|
10261
10190
|
if (accountHolder2) {
|
|
10262
10191
|
return accountHolder2;
|
|
10263
10192
|
}
|
|
10264
|
-
if (!(legalEntityResponse == null ? void 0 : legalEntityResponse.type))
|
|
10265
|
-
return void 0;
|
|
10193
|
+
if (!(legalEntityResponse == null ? void 0 : legalEntityResponse.type)) return void 0;
|
|
10266
10194
|
if (hasOwnEntityAssociationOfType(LegalEntityType.SOLE_PROPRIETORSHIP, legalEntityResponse.entityAssociations, legalEntityResponse.id)) {
|
|
10267
10195
|
return "mySoleProprietorName";
|
|
10268
10196
|
}
|
|
@@ -10633,82 +10561,48 @@ function DocumentGuidance({
|
|
|
10633
10561
|
useEffect(() => {
|
|
10634
10562
|
setGuidancePrefix(getDocumentGuidancePrefix(type));
|
|
10635
10563
|
}, [type]);
|
|
10564
|
+
const documentGuidanceItems = useMemo(() => [{
|
|
10565
|
+
type: "valid",
|
|
10566
|
+
translationKey: "good"
|
|
10567
|
+
}, {
|
|
10568
|
+
type: "invalid-cut",
|
|
10569
|
+
translationKey: "notCutOff"
|
|
10570
|
+
}, {
|
|
10571
|
+
type: "invalid-blur",
|
|
10572
|
+
translationKey: "notBlurry"
|
|
10573
|
+
}, guidancePrefix === "generic-document" ? {
|
|
10574
|
+
type: "invalid-expired",
|
|
10575
|
+
translationKey: "notExpired"
|
|
10576
|
+
} : {
|
|
10577
|
+
type: "invalid-glare",
|
|
10578
|
+
translationKey: "noGlare"
|
|
10579
|
+
}], [guidancePrefix]);
|
|
10636
10580
|
return jsx("div", {
|
|
10637
10581
|
className: cx("adl-document-guidance", className),
|
|
10638
|
-
children:
|
|
10582
|
+
children: jsx("div", {
|
|
10639
10583
|
className: "adl-document-guidance__container",
|
|
10640
|
-
children:
|
|
10641
|
-
className: "adl-document-guidance__item",
|
|
10642
|
-
children: [jsx("svg", {
|
|
10643
|
-
width: "100%",
|
|
10644
|
-
role: "img",
|
|
10645
|
-
children: jsx("use", {
|
|
10646
|
-
href: `#adl-${guidancePrefix}-valid`
|
|
10647
|
-
})
|
|
10648
|
-
}), jsx("span", {
|
|
10649
|
-
className: "adl-document-guidance__description",
|
|
10650
|
-
children: i18n.get("good")
|
|
10651
|
-
})]
|
|
10652
|
-
}), jsxs("div", {
|
|
10653
|
-
className: "adl-document-guidance__item",
|
|
10654
|
-
children: [jsx("svg", {
|
|
10655
|
-
width: "100%",
|
|
10656
|
-
role: "img",
|
|
10657
|
-
children: jsx("use", {
|
|
10658
|
-
href: `#adl-${guidancePrefix}-invalid-cut`
|
|
10659
|
-
})
|
|
10660
|
-
}), jsx("span", {
|
|
10661
|
-
className: "adl-document-guidance__description",
|
|
10662
|
-
children: i18n.get("notCutOff")
|
|
10663
|
-
})]
|
|
10664
|
-
}), jsxs("div", {
|
|
10584
|
+
children: documentGuidanceItems.map((item) => jsxs("div", {
|
|
10665
10585
|
className: "adl-document-guidance__item",
|
|
10666
10586
|
children: [jsx("svg", {
|
|
10667
10587
|
width: "100%",
|
|
10588
|
+
height: "100%",
|
|
10668
10589
|
role: "img",
|
|
10669
10590
|
children: jsx("use", {
|
|
10670
|
-
href: `#adl-${guidancePrefix}
|
|
10591
|
+
href: `#adl-${guidancePrefix}-${item.type}`
|
|
10671
10592
|
})
|
|
10672
10593
|
}), jsx("span", {
|
|
10673
10594
|
className: "adl-document-guidance__description",
|
|
10674
|
-
children: i18n.get(
|
|
10595
|
+
children: i18n.get(item.translationKey)
|
|
10675
10596
|
})]
|
|
10676
|
-
}
|
|
10677
|
-
className: "adl-document-guidance__item",
|
|
10678
|
-
children: guidancePrefix === "generic-document" ? jsxs(Fragment, {
|
|
10679
|
-
children: [jsx("svg", {
|
|
10680
|
-
width: "100%",
|
|
10681
|
-
role: "img",
|
|
10682
|
-
children: jsx("use", {
|
|
10683
|
-
href: `#adl-${guidancePrefix}-invalid-expired`
|
|
10684
|
-
})
|
|
10685
|
-
}), jsx("span", {
|
|
10686
|
-
className: "adl-document-guidance__description",
|
|
10687
|
-
children: i18n.get("notExpired")
|
|
10688
|
-
})]
|
|
10689
|
-
}) : jsxs(Fragment, {
|
|
10690
|
-
children: [jsx("svg", {
|
|
10691
|
-
width: "100%",
|
|
10692
|
-
role: "img",
|
|
10693
|
-
children: jsx("use", {
|
|
10694
|
-
href: `#adl-${guidancePrefix}-invalid-glare`
|
|
10695
|
-
})
|
|
10696
|
-
}), jsx("span", {
|
|
10697
|
-
className: "adl-document-guidance__description",
|
|
10698
|
-
children: i18n.get("noGlare")
|
|
10699
|
-
})]
|
|
10700
|
-
})
|
|
10701
|
-
})]
|
|
10597
|
+
}, item.type))
|
|
10702
10598
|
})
|
|
10703
10599
|
});
|
|
10704
10600
|
}
|
|
10705
10601
|
function bytesToSize(bytes) {
|
|
10706
10602
|
const sizes = ["Bytes", "KB", "MB", "GB", "TB"];
|
|
10707
|
-
if (bytes === 0)
|
|
10708
|
-
return "n/a";
|
|
10603
|
+
if (bytes === 0) return "n/a";
|
|
10709
10604
|
const i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)).toString());
|
|
10710
|
-
if (i === 0)
|
|
10711
|
-
return `${bytes} ${sizes[i]}`;
|
|
10605
|
+
if (i === 0) return `${bytes} ${sizes[i]}`;
|
|
10712
10606
|
return `${(bytes / 1024 ** i).toFixed()} ${sizes[i]}`;
|
|
10713
10607
|
}
|
|
10714
10608
|
const isExistingFile = (file) => "existing" in file && file.existing;
|
|
@@ -10725,11 +10619,9 @@ function DropzoneFile(props) {
|
|
|
10725
10619
|
} = useI18nContext();
|
|
10726
10620
|
const formatSize = (bytes) => {
|
|
10727
10621
|
const sizes = ["Bytes", "KB", "MB", "GB", "TB"];
|
|
10728
|
-
if (!bytes || bytes === 0)
|
|
10729
|
-
return "n/a";
|
|
10622
|
+
if (!bytes || bytes === 0) return "n/a";
|
|
10730
10623
|
const i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)).toString());
|
|
10731
|
-
if (i === 0)
|
|
10732
|
-
return `${bytes} ${sizes[i]}`;
|
|
10624
|
+
if (i === 0) return `${bytes} ${sizes[i]}`;
|
|
10733
10625
|
return `${(bytes / 1024 ** i).toFixed(1)} ${sizes[i]}`;
|
|
10734
10626
|
};
|
|
10735
10627
|
return jsxs("div", {
|
|
@@ -10785,40 +10677,35 @@ const fileValidationRules = ({
|
|
|
10785
10677
|
isOptional
|
|
10786
10678
|
}) => [{
|
|
10787
10679
|
validate: (files) => {
|
|
10788
|
-
if (isOptional && (!files || files.length === 0))
|
|
10789
|
-
return true;
|
|
10680
|
+
if (isOptional && (!files || files.length === 0)) return true;
|
|
10790
10681
|
return Boolean(files && files.length > 0);
|
|
10791
10682
|
},
|
|
10792
10683
|
errorMessage: "fieldIsRequired",
|
|
10793
10684
|
modes: ["blur", "input"]
|
|
10794
10685
|
}, {
|
|
10795
10686
|
validate: (files) => {
|
|
10796
|
-
if (!files)
|
|
10797
|
-
return true;
|
|
10687
|
+
if (!files) return true;
|
|
10798
10688
|
return files.length <= maxNumberOfFiles;
|
|
10799
10689
|
},
|
|
10800
10690
|
errorMessage: "tooManyFiles",
|
|
10801
10691
|
modes: ["blur", "input"]
|
|
10802
10692
|
}, {
|
|
10803
10693
|
validate: (files) => {
|
|
10804
|
-
if (!files)
|
|
10805
|
-
return true;
|
|
10694
|
+
if (!files) return true;
|
|
10806
10695
|
return !hasDuplicates(files.map((file) => file.name));
|
|
10807
10696
|
},
|
|
10808
10697
|
errorMessage: "duplicatedFiles",
|
|
10809
10698
|
modes: ["blur", "input"]
|
|
10810
10699
|
}, {
|
|
10811
10700
|
validate: (files) => {
|
|
10812
|
-
if (!files)
|
|
10813
|
-
return true;
|
|
10701
|
+
if (!files) return true;
|
|
10814
10702
|
return filterOnlyNewlyUploadedFiles(files).every((file) => allowedFileTypes.some((filetype) => file.name.toLowerCase().endsWith(filetype.toLowerCase())));
|
|
10815
10703
|
},
|
|
10816
10704
|
errorMessage: "unsupportedFiletype",
|
|
10817
10705
|
modes: ["blur", "input"]
|
|
10818
10706
|
}, {
|
|
10819
10707
|
validate: (files) => {
|
|
10820
|
-
if (!files)
|
|
10821
|
-
return true;
|
|
10708
|
+
if (!files) return true;
|
|
10822
10709
|
return filterOnlyNewlyUploadedFiles(files).every((file) => !file.size || file.size < maxSize);
|
|
10823
10710
|
},
|
|
10824
10711
|
errorMessage: "maximumFileSizeExceeded",
|
|
@@ -11140,10 +11027,9 @@ function DocumentUploadComponent({
|
|
|
11140
11027
|
}, [data, valid, errors, fieldProblems]);
|
|
11141
11028
|
useEffect(() => {
|
|
11142
11029
|
var _a2, _b;
|
|
11143
|
-
if (documentField)
|
|
11144
|
-
|
|
11145
|
-
|
|
11146
|
-
});
|
|
11030
|
+
if (documentField) setDocument({
|
|
11031
|
+
[documentField]: (_a2 = props == null ? void 0 : props.data) == null ? void 0 : _a2[documentField]
|
|
11032
|
+
});
|
|
11147
11033
|
setData("description", (_b = props.data) == null ? void 0 : _b.description);
|
|
11148
11034
|
triggerValidation();
|
|
11149
11035
|
}, [props.data]);
|
|
@@ -11240,7 +11126,8 @@ function ListItem({
|
|
|
11240
11126
|
const ADDRESS_SCHEMA = ["address", "otherAddressInformation", "postalCode", "city", "stateOrProvince", "country"];
|
|
11241
11127
|
const [ADDRESS, OTHER_ADDRESS_INFORMATION, POSTAL_CODE, CITY, STATE, COUNTRY] = ADDRESS_SCHEMA;
|
|
11242
11128
|
const COUNTRIES_WITH_STATES_DATASET = [CountryCodes.Australia, CountryCodes.Brazil, CountryCodes.Canada, CountryCodes.NewZealand, CountryCodes.UnitedStates];
|
|
11243
|
-
const COUNTRIES_WITH_HOUSE_NUMBER_FIRST = [CountryCodes.Australia, CountryCodes.Canada, CountryCodes.NewZealand, CountryCodes.PuertoRico, CountryCodes.UnitedStates, CountryCodes.UnitedKingdom];
|
|
11129
|
+
const COUNTRIES_WITH_HOUSE_NUMBER_FIRST = [CountryCodes.Australia, CountryCodes.Canada, CountryCodes.NewZealand, CountryCodes.PuertoRico, CountryCodes.UnitedStates, CountryCodes.UnitedKingdom, CountryCodes.France];
|
|
11130
|
+
const COUNTRIES_WITH_COMMA_SEPARATED = [CountryCodes.Spain];
|
|
11244
11131
|
const ADDRESS_SCHEMAS = {
|
|
11245
11132
|
[CountryCodes.Australia]: [COUNTRY, ADDRESS, OTHER_ADDRESS_INFORMATION, CITY, STATE, POSTAL_CODE],
|
|
11246
11133
|
[CountryCodes.Canada]: [COUNTRY, ADDRESS, OTHER_ADDRESS_INFORMATION, CITY, POSTAL_CODE, STATE],
|
|
@@ -11348,8 +11235,7 @@ function StateField({
|
|
|
11348
11235
|
} = useDataset(datasetIdentifier.state(selectedCountry), !selectedCountry || !COUNTRIES_WITH_STATES_DATASET.includes(selectedCountry));
|
|
11349
11236
|
const labelKey = getKeyForField("stateOrProvince", selectedCountry);
|
|
11350
11237
|
const placeholderKey = getKeyForField("stateOrProvincePlaceholder", selectedCountry);
|
|
11351
|
-
if (!loaded || !states.length)
|
|
11352
|
-
return null;
|
|
11238
|
+
if (!loaded || !states.length) return null;
|
|
11353
11239
|
return jsx(Field, {
|
|
11354
11240
|
name: "stateOrProvince",
|
|
11355
11241
|
label: (labels2 == null ? void 0 : labels2.stateOrProvince) || i18n.get(labelKey),
|
|
@@ -11463,14 +11349,12 @@ function useIsElementVisible(ref, fallback = true) {
|
|
|
11463
11349
|
const [isOnScreen, setIsOnScreen] = useState(isIntersectionObserverSupported ? false : fallback);
|
|
11464
11350
|
const observerRef = useRef();
|
|
11465
11351
|
useEffect(() => {
|
|
11466
|
-
if (!isIntersectionObserverSupported)
|
|
11467
|
-
return;
|
|
11352
|
+
if (!isIntersectionObserverSupported) return;
|
|
11468
11353
|
observerRef.current = new IntersectionObserver(([entry]) => setIsOnScreen(entry.isIntersecting));
|
|
11469
11354
|
}, []);
|
|
11470
11355
|
useEffect(() => {
|
|
11471
11356
|
var _a;
|
|
11472
|
-
if (!ref.current)
|
|
11473
|
-
return;
|
|
11357
|
+
if (!ref.current) return;
|
|
11474
11358
|
(_a = observerRef.current) == null ? void 0 : _a.observe(ref.current);
|
|
11475
11359
|
return () => {
|
|
11476
11360
|
var _a2;
|
|
@@ -11906,8 +11790,7 @@ const countrySpecificFormatters = {
|
|
|
11906
11790
|
postalCode: {
|
|
11907
11791
|
// Formatter - excludes non digits & hyphens and limits to a maxlength that varies depending on whether a hyphen is present or not
|
|
11908
11792
|
formatter: (val) => {
|
|
11909
|
-
if (!val)
|
|
11910
|
-
return void 0;
|
|
11793
|
+
if (!val) return void 0;
|
|
11911
11794
|
const nuVal = val.replace(getFormattingRegEx("^\\d-", "g"), "");
|
|
11912
11795
|
const maxlength = nuVal.includes("-") ? 6 : 5;
|
|
11913
11796
|
return nuVal.substring(0, maxlength);
|
|
@@ -11919,8 +11802,7 @@ const countrySpecificFormatters = {
|
|
|
11919
11802
|
[CountryCodes.Portugal]: {
|
|
11920
11803
|
postalCode: {
|
|
11921
11804
|
formatter: (val) => {
|
|
11922
|
-
if (!val)
|
|
11923
|
-
return void 0;
|
|
11805
|
+
if (!val) return void 0;
|
|
11924
11806
|
const nuVal = val.replace(getFormattingRegEx("^\\d-", "g"), "");
|
|
11925
11807
|
return nuVal.substring(0, 8);
|
|
11926
11808
|
},
|
|
@@ -12138,8 +12020,7 @@ function Address(props) {
|
|
|
12138
12020
|
}
|
|
12139
12021
|
}, [shouldValidate]);
|
|
12140
12022
|
const getComponent = (fieldName) => {
|
|
12141
|
-
if (!formUtils.isRequiredField(fieldName))
|
|
12142
|
-
return null;
|
|
12023
|
+
if (!formUtils.isRequiredField(fieldName)) return null;
|
|
12143
12024
|
const hideField = fieldName === "country" && hideCountry;
|
|
12144
12025
|
return jsx(FieldContainer, {
|
|
12145
12026
|
classNameModifiers: [fieldName],
|
|
@@ -12149,7 +12030,7 @@ function Address(props) {
|
|
|
12149
12030
|
fieldProblems,
|
|
12150
12031
|
fieldName,
|
|
12151
12032
|
handleChangeFor,
|
|
12152
|
-
maxlength: getMaxLengthByFieldAndCountry(countrySpecificFormatters, fieldName, data.country
|
|
12033
|
+
maxlength: getMaxLengthByFieldAndCountry(countrySpecificFormatters, fieldName, data.country),
|
|
12153
12034
|
hideField,
|
|
12154
12035
|
"aria-label": formUtils.getLabel(fieldName, fieldName),
|
|
12155
12036
|
trimOnBlur: true
|
|
@@ -12160,8 +12041,12 @@ function Address(props) {
|
|
|
12160
12041
|
houseNumberOrName,
|
|
12161
12042
|
street: street2
|
|
12162
12043
|
}) => {
|
|
12163
|
-
const
|
|
12164
|
-
const
|
|
12044
|
+
const isHouseNumberFirst = COUNTRIES_WITH_HOUSE_NUMBER_FIRST.includes(data.country);
|
|
12045
|
+
const needsComma = COUNTRIES_WITH_COMMA_SEPARATED.includes(data.country);
|
|
12046
|
+
let formattedAddress = isHouseNumberFirst ? `${houseNumberOrName} ${street2}` : `${street2} ${houseNumberOrName}`;
|
|
12047
|
+
if (needsComma) {
|
|
12048
|
+
formattedAddress = formattedAddress.replace(" ", ", ");
|
|
12049
|
+
}
|
|
12165
12050
|
handleChangeFor("address", "input")(formattedAddress);
|
|
12166
12051
|
};
|
|
12167
12052
|
const setFieldsData = (address2, field) => {
|
|
@@ -12897,8 +12782,7 @@ const uploadDocuments = async (documents2, entityId) => {
|
|
|
12897
12782
|
return documentStore[entityId];
|
|
12898
12783
|
};
|
|
12899
12784
|
const updateEntityDocuments = (uploadedDocuments, entityId) => {
|
|
12900
|
-
if (!documentStore[entityId])
|
|
12901
|
-
documentStore[entityId] = [];
|
|
12785
|
+
if (!documentStore[entityId]) documentStore[entityId] = [];
|
|
12902
12786
|
uploadedDocuments.forEach((uploadedDocument) => {
|
|
12903
12787
|
if (uploadedDocument) {
|
|
12904
12788
|
const existingDocumentIndex = documentStore[entityId].findIndex((document2) => document2.id === uploadedDocument.id);
|
|
@@ -13089,11 +12973,10 @@ const rules$2 = ({
|
|
|
13089
12973
|
});
|
|
13090
12974
|
const getAccountIdentificationFromPayoutAccountSchema = (payoutAccount2, bankCountry2) => {
|
|
13091
12975
|
var _a;
|
|
13092
|
-
if ("iban" in payoutAccount2 && payoutAccount2.iban)
|
|
13093
|
-
|
|
13094
|
-
|
|
13095
|
-
|
|
13096
|
-
};
|
|
12976
|
+
if ("iban" in payoutAccount2 && payoutAccount2.iban) return {
|
|
12977
|
+
type: "iban",
|
|
12978
|
+
iban: payoutAccount2.iban
|
|
12979
|
+
};
|
|
13097
12980
|
const countryPrefix = bankCountry2 === "GB" ? "uk" : bankCountry2.toLowerCase();
|
|
13098
12981
|
const localAccount = {
|
|
13099
12982
|
type: `${countryPrefix}Local`,
|
|
@@ -13779,11 +13662,9 @@ const mapSolePropToLegalEntity = (data) => {
|
|
|
13779
13662
|
const getPage = ({
|
|
13780
13663
|
attachments
|
|
13781
13664
|
}, pageType) => {
|
|
13782
|
-
if (!attachments)
|
|
13783
|
-
throw Error("Document has no attachments");
|
|
13665
|
+
if (!attachments) throw Error("Document has no attachments");
|
|
13784
13666
|
const attachment = pageType ? attachments.find((attach) => attach.pageType === pageType) : attachments[0];
|
|
13785
|
-
if (!attachment)
|
|
13786
|
-
throw Error(`Attachment not found${pageType ? ` with type '${pageType}'` : ""}`);
|
|
13667
|
+
if (!attachment) throw Error(`Attachment not found${pageType ? ` with type '${pageType}'` : ""}`);
|
|
13787
13668
|
return attachment;
|
|
13788
13669
|
};
|
|
13789
13670
|
const getPageName = (document2, pageType) => getPage(document2, pageType).pageName;
|
|
@@ -14189,8 +14070,7 @@ const useIdVerificationToken = ({
|
|
|
14189
14070
|
const hasAllUserDetails = userDetails && Object.values(userDetails).every(Boolean);
|
|
14190
14071
|
useEffect(() => {
|
|
14191
14072
|
(async () => {
|
|
14192
|
-
if (!hasAllUserDetails)
|
|
14193
|
-
return;
|
|
14073
|
+
if (!hasAllUserDetails) return;
|
|
14194
14074
|
try {
|
|
14195
14075
|
setLoadingStatus("loading");
|
|
14196
14076
|
const data = {
|
|
@@ -14351,8 +14231,7 @@ function IdVerificationComponent({
|
|
|
14351
14231
|
const onfidoSdk = useRef();
|
|
14352
14232
|
useEffect(() => {
|
|
14353
14233
|
(async () => {
|
|
14354
|
-
if (!sdkToken2)
|
|
14355
|
-
return;
|
|
14234
|
+
if (!sdkToken2) return;
|
|
14356
14235
|
onfidoSdk.current = await initOnfido({
|
|
14357
14236
|
token: sdkToken2,
|
|
14358
14237
|
i18n,
|
|
@@ -14362,13 +14241,11 @@ function IdVerificationComponent({
|
|
|
14362
14241
|
});
|
|
14363
14242
|
})().catch(logger$p.error);
|
|
14364
14243
|
return () => {
|
|
14365
|
-
if (onfidoSdk.current)
|
|
14366
|
-
onfidoSdk.current.tearDown();
|
|
14244
|
+
if (onfidoSdk.current) onfidoSdk.current.tearDown();
|
|
14367
14245
|
};
|
|
14368
14246
|
}, [sdkToken2]);
|
|
14369
14247
|
useEffect(() => {
|
|
14370
|
-
if (!onfidoSdk.current)
|
|
14371
|
-
return;
|
|
14248
|
+
if (!onfidoSdk.current) return;
|
|
14372
14249
|
onfidoSdk.current.setOptions({
|
|
14373
14250
|
language: getOnfidoLocaleConfig(i18n)
|
|
14374
14251
|
});
|
|
@@ -14534,8 +14411,7 @@ const layoutBreakpointSizes = {
|
|
|
14534
14411
|
const getBreakpointClassNames = (containerSize) => {
|
|
14535
14412
|
const breakPoints = Object.entries(layoutBreakpointSizes);
|
|
14536
14413
|
const classes = breakPoints.reduce((acc, [bp, size]) => {
|
|
14537
|
-
if (size <= containerSize)
|
|
14538
|
-
acc.push(layoutBreakpointClassnames[bp]);
|
|
14414
|
+
if (size <= containerSize) acc.push(layoutBreakpointClassnames[bp]);
|
|
14539
14415
|
return acc;
|
|
14540
14416
|
}, []);
|
|
14541
14417
|
return classes.length > 0 ? classes : ["adyen-layout-xs-only"];
|
|
@@ -14560,8 +14436,7 @@ const AutoResizer = ({
|
|
|
14560
14436
|
const containerRef = useRef(null);
|
|
14561
14437
|
useEffect(() => {
|
|
14562
14438
|
const container = containerRef.current;
|
|
14563
|
-
if (!container)
|
|
14564
|
-
return;
|
|
14439
|
+
if (!container) return;
|
|
14565
14440
|
const resizeObserver = new ResizeObserver((entries) => assignLayoutClasses(entries, container));
|
|
14566
14441
|
resizeObserver.observe(container);
|
|
14567
14442
|
return () => resizeObserver.unobserve(container);
|
|
@@ -14806,8 +14681,7 @@ function useVerification(fieldsToVerify, country2) {
|
|
|
14806
14681
|
const verificationPromises = [];
|
|
14807
14682
|
fieldsToVerify.forEach((field) => {
|
|
14808
14683
|
if (field === "idNumber" && formState.data[field]) {
|
|
14809
|
-
if (formState.data[field] === savedData[field] || country2 === "US" && formState.data[field].length === 4)
|
|
14810
|
-
return;
|
|
14684
|
+
if (formState.data[field] === savedData[field] || country2 === "US" && formState.data[field].length === 4) return;
|
|
14811
14685
|
const request = {
|
|
14812
14686
|
name: {
|
|
14813
14687
|
firstName: formState.data.firstName,
|
|
@@ -14843,10 +14717,8 @@ function InputTelephone(props) {
|
|
|
14843
14717
|
const staticPhoneValidationRules = (phonePrefixes, defaultPrefix) => ({
|
|
14844
14718
|
phoneNumber: {
|
|
14845
14719
|
validate: (phoneNumber2) => {
|
|
14846
|
-
if (!phoneNumber2)
|
|
14847
|
-
|
|
14848
|
-
if (!phonePrefixes.length)
|
|
14849
|
-
return phoneNumber2.startsWith("+");
|
|
14720
|
+
if (!phoneNumber2) return false;
|
|
14721
|
+
if (!phonePrefixes.length) return phoneNumber2.startsWith("+");
|
|
14850
14722
|
return phonePrefixes.map((prefix) => prefix.name).some((name) => phoneNumber2.startsWith(name));
|
|
14851
14723
|
},
|
|
14852
14724
|
errorMessage: {
|
|
@@ -14866,8 +14738,7 @@ const useAsyncPhoneValidationRules = () => {
|
|
|
14866
14738
|
phoneNumber: {
|
|
14867
14739
|
asyncValidate: async (phoneNumber2) => {
|
|
14868
14740
|
var _a;
|
|
14869
|
-
if (!phoneNumber2)
|
|
14870
|
-
return false;
|
|
14741
|
+
if (!phoneNumber2) return false;
|
|
14871
14742
|
return (_a = await validatePhoneNumber2(phoneNumber2)) == null ? void 0 : _a.valid;
|
|
14872
14743
|
},
|
|
14873
14744
|
errorMessage: "invalidPhoneNumber",
|
|
@@ -15596,8 +15467,7 @@ function IdentityNumberComponent(props) {
|
|
|
15596
15467
|
...data
|
|
15597
15468
|
};
|
|
15598
15469
|
adjustedData.idNumber = data.idNumberExempt ? void 0 : data.idNumber;
|
|
15599
|
-
if (data.idNumberExempt && formErrors.idNumber !== null)
|
|
15600
|
-
setFormErrors("idNumber", null);
|
|
15470
|
+
if (data.idNumberExempt && formErrors.idNumber !== null) setFormErrors("idNumber", null);
|
|
15601
15471
|
(_b = (_a = stateRef.current) == null ? void 0 : _a.setState) == null ? void 0 : _b.call(_a, {
|
|
15602
15472
|
type: "addToState",
|
|
15603
15473
|
value: {
|
|
@@ -15717,8 +15587,7 @@ const getRoleName = (role2) => {
|
|
|
15717
15587
|
};
|
|
15718
15588
|
const makeSelectItemForRole = (role2, i18n) => {
|
|
15719
15589
|
const metadata = roleMetadata[role2];
|
|
15720
|
-
if (!metadata)
|
|
15721
|
-
throw Error(`Cannot make select item for role "${role2}"; no metadata found. Valid roles include: ${Object.keys(roleMetadata).join("\n")}`);
|
|
15590
|
+
if (!metadata) throw Error(`Cannot make select item for role "${role2}"; no metadata found. Valid roles include: ${Object.keys(roleMetadata).join("\n")}`);
|
|
15722
15591
|
const {
|
|
15723
15592
|
name,
|
|
15724
15593
|
description: description2,
|
|
@@ -15732,11 +15601,9 @@ const makeSelectItemForRole = (role2, i18n) => {
|
|
|
15732
15601
|
};
|
|
15733
15602
|
};
|
|
15734
15603
|
const handleKeys = (keys, callback, propagationMode = "stopIfMatches") => (event) => {
|
|
15735
|
-
if (propagationMode === "stop")
|
|
15736
|
-
event.stopPropagation();
|
|
15604
|
+
if (propagationMode === "stop") event.stopPropagation();
|
|
15737
15605
|
if (keys.includes(event.key)) {
|
|
15738
|
-
if (propagationMode === "stopIfMatches")
|
|
15739
|
-
event.stopPropagation();
|
|
15606
|
+
if (propagationMode === "stopIfMatches") event.stopPropagation();
|
|
15740
15607
|
callback();
|
|
15741
15608
|
}
|
|
15742
15609
|
};
|
|
@@ -15865,8 +15732,7 @@ function IndividualIdNumberTypeSelector({
|
|
|
15865
15732
|
setSelected(options[0].id);
|
|
15866
15733
|
}
|
|
15867
15734
|
}, [options, selected, setSelected]);
|
|
15868
|
-
if (options.length <= 1)
|
|
15869
|
-
return null;
|
|
15735
|
+
if (options.length <= 1) return null;
|
|
15870
15736
|
return jsx(Field, {
|
|
15871
15737
|
name: "individualIdNumberType",
|
|
15872
15738
|
label: i18n.get("whichTypeOfIdNumberDoYouHave"),
|
|
@@ -17339,14 +17205,12 @@ function FilePicker({
|
|
|
17339
17205
|
const handleDrop = (e) => {
|
|
17340
17206
|
e.preventDefault();
|
|
17341
17207
|
e.stopPropagation();
|
|
17342
|
-
if (e.dataTransfer)
|
|
17343
|
-
addFiles(e.dataTransfer.files);
|
|
17208
|
+
if (e.dataTransfer) addFiles(e.dataTransfer.files);
|
|
17344
17209
|
setDragged(false);
|
|
17345
17210
|
};
|
|
17346
17211
|
const handleFilesChosen = (e) => {
|
|
17347
17212
|
const fileInput2 = e.target;
|
|
17348
|
-
if (fileInput2.files)
|
|
17349
|
-
addFiles(fileInput2.files);
|
|
17213
|
+
if (fileInput2.files) addFiles(fileInput2.files);
|
|
17350
17214
|
};
|
|
17351
17215
|
const addFiles = (newFiles) => {
|
|
17352
17216
|
setFiles([...newFiles, ...files]);
|
|
@@ -17427,7 +17291,6 @@ var BankDocumentTypes = /* @__PURE__ */ ((BankDocumentTypes2) => {
|
|
|
17427
17291
|
BankDocumentTypes2["SCREENSHOT_OF_BANK"] = "screenshotOfOnlineBankingEnviroment";
|
|
17428
17292
|
BankDocumentTypes2["OFFICIAL_EMAIL"] = "officialEmailOrALetterFromYourBank";
|
|
17429
17293
|
BankDocumentTypes2["CHECK"] = "check";
|
|
17430
|
-
BankDocumentTypes2["RELEVE_DIDENTITE"] = "releveDidentiteBancaire";
|
|
17431
17294
|
return BankDocumentTypes2;
|
|
17432
17295
|
})(BankDocumentTypes || {});
|
|
17433
17296
|
const bankDocumentOptions = [{
|
|
@@ -17445,9 +17308,6 @@ const bankDocumentOptions = [{
|
|
|
17445
17308
|
}, {
|
|
17446
17309
|
id: "check",
|
|
17447
17310
|
name: "check"
|
|
17448
|
-
}, {
|
|
17449
|
-
id: "releveDidentiteBancaire",
|
|
17450
|
-
name: "releveDidentiteBancaire"
|
|
17451
17311
|
}];
|
|
17452
17312
|
var BankDocumentRequirement = /* @__PURE__ */ ((BankDocumentRequirement2) => {
|
|
17453
17313
|
BankDocumentRequirement2["ACCOUNT_NAME_INDIVIDUAL"] = "bankAccountNameIndividual";
|
|
@@ -17679,8 +17539,7 @@ function BankDocument(props) {
|
|
|
17679
17539
|
var _a2;
|
|
17680
17540
|
if (hasAlreadyUploadedDocuments) {
|
|
17681
17541
|
setData("bankStatementDocument", alreadyUploadedDocuments);
|
|
17682
|
-
if ((_a2 = props.data) == null ? void 0 : _a2.description)
|
|
17683
|
-
setData("description", props.data.description);
|
|
17542
|
+
if ((_a2 = props.data) == null ? void 0 : _a2.description) setData("description", props.data.description);
|
|
17684
17543
|
triggerValidation();
|
|
17685
17544
|
}
|
|
17686
17545
|
}, [alreadyUploadedDocuments, hasAlreadyUploadedDocuments, (_b = props.data) == null ? void 0 : _b.description, setData, triggerValidation]);
|
|
@@ -17699,19 +17558,13 @@ function BankDocument(props) {
|
|
|
17699
17558
|
}
|
|
17700
17559
|
});
|
|
17701
17560
|
}, [data, valid, errors, fieldProblems]);
|
|
17702
|
-
const getBankDocumentOptions = () => {
|
|
17703
|
-
|
|
17704
|
-
|
|
17705
|
-
|
|
17706
|
-
|
|
17707
|
-
|
|
17708
|
-
|
|
17709
|
-
name
|
|
17710
|
-
}) => ({
|
|
17711
|
-
id: id2,
|
|
17712
|
-
name: i18n.get(name)
|
|
17713
|
-
}));
|
|
17714
|
-
};
|
|
17561
|
+
const getBankDocumentOptions = () => bankDocumentOptions.map(({
|
|
17562
|
+
id: id2,
|
|
17563
|
+
name
|
|
17564
|
+
}) => ({
|
|
17565
|
+
id: id2,
|
|
17566
|
+
name: i18n.get(name)
|
|
17567
|
+
}));
|
|
17715
17568
|
const documentsModifiers = useMemo(() => {
|
|
17716
17569
|
var _a2, _b2;
|
|
17717
17570
|
return {
|
|
@@ -18132,12 +17985,10 @@ const httpDelete = async (options, data) => http({
|
|
|
18132
17985
|
}, data);
|
|
18133
17986
|
const removeElementSiblings = (element) => {
|
|
18134
17987
|
const parent = element.parentNode;
|
|
18135
|
-
if (!parent)
|
|
18136
|
-
return;
|
|
17988
|
+
if (!parent) return;
|
|
18137
17989
|
let child = parent.firstChild;
|
|
18138
17990
|
while (child) {
|
|
18139
|
-
if (child !== element)
|
|
18140
|
-
parent.removeChild(child);
|
|
17991
|
+
if (child !== element) parent.removeChild(child);
|
|
18141
17992
|
child = child.nextSibling;
|
|
18142
17993
|
}
|
|
18143
17994
|
};
|
|
@@ -18151,8 +18002,7 @@ const isTerminalMessageData = (data) => isObjectData(data) && Object.entries(dat
|
|
|
18151
18002
|
const parseMessageJson = (message) => {
|
|
18152
18003
|
try {
|
|
18153
18004
|
const messageData = JSON.parse(message);
|
|
18154
|
-
if (!RELEVANT_MESSAGE_TYPES.includes(messageData.type))
|
|
18155
|
-
return "invalid";
|
|
18005
|
+
if (!RELEVANT_MESSAGE_TYPES.includes(messageData.type)) return "invalid";
|
|
18156
18006
|
return messageData;
|
|
18157
18007
|
} catch {
|
|
18158
18008
|
return "invalid";
|
|
@@ -18179,8 +18029,7 @@ class IFrameWidget {
|
|
|
18179
18029
|
this.listener = async (message) => {
|
|
18180
18030
|
try {
|
|
18181
18031
|
const result = await this.handleMessage(message);
|
|
18182
|
-
if (!result)
|
|
18183
|
-
return;
|
|
18032
|
+
if (!result) return;
|
|
18184
18033
|
resolve(result);
|
|
18185
18034
|
} catch (err) {
|
|
18186
18035
|
reject(err);
|
|
@@ -18199,8 +18048,7 @@ class IFrameWidget {
|
|
|
18199
18048
|
this.sdkToken = sdkToken2;
|
|
18200
18049
|
}
|
|
18201
18050
|
removeMessageEventListener() {
|
|
18202
|
-
if (!this.listener)
|
|
18203
|
-
return;
|
|
18051
|
+
if (!this.listener) return;
|
|
18204
18052
|
window.removeEventListener("message", this.listener);
|
|
18205
18053
|
this.listener = void 0;
|
|
18206
18054
|
}
|
|
@@ -18209,19 +18057,16 @@ class IFrameWidget {
|
|
|
18209
18057
|
origin,
|
|
18210
18058
|
source
|
|
18211
18059
|
}) {
|
|
18212
|
-
if (source !== this.iframeWindow || origin !== this.iframeUrl.origin)
|
|
18213
|
-
return;
|
|
18060
|
+
if (source !== this.iframeWindow || origin !== this.iframeUrl.origin) return;
|
|
18214
18061
|
if (this.vendor !== TINK_VENDOR && isTerminalMessageData(data)) {
|
|
18215
18062
|
if (Object.getOwnPropertyNames(data).includes("error")) {
|
|
18216
18063
|
throw data;
|
|
18217
18064
|
}
|
|
18218
18065
|
return data;
|
|
18219
18066
|
}
|
|
18220
|
-
if (!isString(data))
|
|
18221
|
-
return;
|
|
18067
|
+
if (!isString(data)) return;
|
|
18222
18068
|
const jsonData = parseMessageJson(data);
|
|
18223
|
-
if (jsonData === "invalid")
|
|
18224
|
-
return;
|
|
18069
|
+
if (jsonData === "invalid") return;
|
|
18225
18070
|
const httpOptions = {
|
|
18226
18071
|
errorHandler: callbackErrorHandler,
|
|
18227
18072
|
loadingContext: "",
|
|
@@ -18243,8 +18088,7 @@ class IFrameWidget {
|
|
|
18243
18088
|
...httpOptions,
|
|
18244
18089
|
path: redirectUrl.href
|
|
18245
18090
|
});
|
|
18246
|
-
if (isVerifiedAccountsData(responseData))
|
|
18247
|
-
return responseData;
|
|
18091
|
+
if (isVerifiedAccountsData(responseData)) return responseData;
|
|
18248
18092
|
throw responseData;
|
|
18249
18093
|
} catch (reason) {
|
|
18250
18094
|
throw new AdyenKycSdkError("WIDGET_ACCOUNT_COMMIT_FAILURE", reason);
|
|
@@ -18303,8 +18147,7 @@ class IFrameWidget {
|
|
|
18303
18147
|
reject(new AdyenKycSdkError("WIDGET_TIMEOUT"));
|
|
18304
18148
|
}, MOUNT_TIMEOUT);
|
|
18305
18149
|
const cancelTimeout = () => {
|
|
18306
|
-
if (timeoutId)
|
|
18307
|
-
clearTimeout(timeoutId);
|
|
18150
|
+
if (timeoutId) clearTimeout(timeoutId);
|
|
18308
18151
|
};
|
|
18309
18152
|
this.iframeElement.addEventListener("load", () => {
|
|
18310
18153
|
cancelTimeout();
|
|
@@ -18476,8 +18319,6 @@ const useInstantVerificationErrorNotification = (notificationVisibilityDuration)
|
|
|
18476
18319
|
useEffect(() => {
|
|
18477
18320
|
clearNotificationTimeout();
|
|
18478
18321
|
if (errorNotification) {
|
|
18479
|
-
if (notificationVisibilityDuration <= 0)
|
|
18480
|
-
return;
|
|
18481
18322
|
dismissNotificationTimeoutRef.current = setTimeout(() => {
|
|
18482
18323
|
setErrorNotification(null);
|
|
18483
18324
|
clearNotificationTimeout();
|
|
@@ -18543,8 +18384,7 @@ function InstantBankVerification({
|
|
|
18543
18384
|
content: errorContent
|
|
18544
18385
|
});
|
|
18545
18386
|
}
|
|
18546
|
-
if (onBack)
|
|
18547
|
-
onBack();
|
|
18387
|
+
if (onBack) onBack();
|
|
18548
18388
|
break;
|
|
18549
18389
|
}
|
|
18550
18390
|
case "retry_verification":
|
|
@@ -18552,8 +18392,7 @@ function InstantBankVerification({
|
|
|
18552
18392
|
title: i18n.get("failedInitializeInstantVerification"),
|
|
18553
18393
|
content: errorContent
|
|
18554
18394
|
});
|
|
18555
|
-
if (onBack)
|
|
18556
|
-
onBack();
|
|
18395
|
+
if (onBack) onBack();
|
|
18557
18396
|
break;
|
|
18558
18397
|
default: {
|
|
18559
18398
|
const {
|
|
@@ -19326,8 +19165,7 @@ const customPrefixByCountry = {
|
|
|
19326
19165
|
[CountryCodes.IsleOfMan]: "GB"
|
|
19327
19166
|
};
|
|
19328
19167
|
function ibanValidator(input, bankCountry2) {
|
|
19329
|
-
if (isEmpty(input))
|
|
19330
|
-
return false;
|
|
19168
|
+
if (isEmpty(input)) return false;
|
|
19331
19169
|
const ibanInput = input.replace(/ /g, "").toUpperCase();
|
|
19332
19170
|
if (!/^([a-zA-Z0-9]{4} ){2,8}[a-zA-Z0-9]{1,4}|[a-zA-Z0-9]{12,34}$/.test(ibanInput)) {
|
|
19333
19171
|
return false;
|
|
@@ -19734,7 +19572,7 @@ const regions = {
|
|
|
19734
19572
|
const getAllowedBankCountries = (country2) => Object.values(regions).find((countriesInARegion) => countriesInARegion.includes(country2)) ?? [country2];
|
|
19735
19573
|
const makePayoutVerificationMethodsMetadata = (svgPath, instantVerificationProvider) => ({
|
|
19736
19574
|
instantVerification: {
|
|
19737
|
-
name: "
|
|
19575
|
+
name: "verifyViaMobileBankingAppOrWebsite",
|
|
19738
19576
|
subtitle: "instant",
|
|
19739
19577
|
description: "instantVerificationDescription",
|
|
19740
19578
|
iconComponentDesktop: `${svgPath}/instant-verification-desktop.svg`,
|
|
@@ -19745,8 +19583,8 @@ const makePayoutVerificationMethodsMetadata = (svgPath, instantVerificationProvi
|
|
|
19745
19583
|
} : void 0
|
|
19746
19584
|
},
|
|
19747
19585
|
manualVerification: {
|
|
19748
|
-
name: "
|
|
19749
|
-
subtitle: "
|
|
19586
|
+
name: "uploadABankStatement",
|
|
19587
|
+
subtitle: "mayTakeAFewDays",
|
|
19750
19588
|
description: "manualVerificationDescription",
|
|
19751
19589
|
iconComponentDesktop: `${svgPath}/manual-verification-desktop.svg`,
|
|
19752
19590
|
iconComponentMobile: `${svgPath}/manual-verification-mobile.svg`
|
|
@@ -19897,11 +19735,9 @@ const getMustHaveSameAccountHolderNameText = (legalEntityType, accountHolderName
|
|
|
19897
19735
|
}
|
|
19898
19736
|
};
|
|
19899
19737
|
const getInstantVerificationProvider = (bankVerificationProviders, bankCountry2) => {
|
|
19900
|
-
if (!bankVerificationProviders)
|
|
19901
|
-
return "loading";
|
|
19738
|
+
if (!bankVerificationProviders) return "loading";
|
|
19902
19739
|
const providerForCountry = bankVerificationProviders[bankCountry2];
|
|
19903
|
-
if (!providerForCountry)
|
|
19904
|
-
return void 0;
|
|
19740
|
+
if (!providerForCountry) return void 0;
|
|
19905
19741
|
return providerForCountry.toLowerCase();
|
|
19906
19742
|
};
|
|
19907
19743
|
function PayoutVerificationMethod(props) {
|
|
@@ -20632,11 +20468,15 @@ const PER_COUNTRY_DECISION_MAKER_REQUIREMENTS_OVERRIDES = {
|
|
|
20632
20468
|
roleTypes: [DecisionMakerType.DIRECTOR],
|
|
20633
20469
|
min: 1,
|
|
20634
20470
|
max: Infinity
|
|
20471
|
+
}],
|
|
20472
|
+
GB: [...DEFAULT_DECISION_MAKER_REQUIREMENTS, {
|
|
20473
|
+
roleTypes: [DecisionMakerType.DIRECTOR],
|
|
20474
|
+
min: 1,
|
|
20475
|
+
max: Infinity
|
|
20635
20476
|
}]
|
|
20636
20477
|
};
|
|
20637
20478
|
const getDecisionMakerRequirements = (country2) => {
|
|
20638
|
-
if (!country2)
|
|
20639
|
-
return DEFAULT_DECISION_MAKER_REQUIREMENTS;
|
|
20479
|
+
if (!country2) return DEFAULT_DECISION_MAKER_REQUIREMENTS;
|
|
20640
20480
|
return PER_COUNTRY_DECISION_MAKER_REQUIREMENTS_OVERRIDES[country2] ?? DEFAULT_DECISION_MAKER_REQUIREMENTS;
|
|
20641
20481
|
};
|
|
20642
20482
|
function getAvailableDecisionMakerRoleTypes(country2) {
|
|
@@ -20666,8 +20506,7 @@ const getDecisionMakerDescriptionMap = (country2) => ({
|
|
|
20666
20506
|
...PER_COUNTRY_DESCRIPTION_OVERRIDES[country2]
|
|
20667
20507
|
});
|
|
20668
20508
|
const getOwnDecisionMakers = (rootLegalEntity) => {
|
|
20669
|
-
if (!(rootLegalEntity == null ? void 0 : rootLegalEntity.entityAssociations))
|
|
20670
|
-
return [];
|
|
20509
|
+
if (!(rootLegalEntity == null ? void 0 : rootLegalEntity.entityAssociations)) return [];
|
|
20671
20510
|
return rootLegalEntity.entityAssociations.filter((entityAssociation) => Object.values(DecisionMakerType).includes(entityAssociation.type) && entityAssociation.associatorId === rootLegalEntity.id);
|
|
20672
20511
|
};
|
|
20673
20512
|
const getDecisionMakers = (rootLegalEntity, companyLegalEntityId) => getDirectEntityAssociations(rootLegalEntity, companyLegalEntityId).filter((association2) => Object.values(DecisionMakerType).includes(association2.type));
|
|
@@ -20724,8 +20563,7 @@ const isPartOfTrustFromLegalEntity = (legalEntity) => {
|
|
|
20724
20563
|
};
|
|
20725
20564
|
const getOwnTrustMembersLegalEntityIds = (rootLegalEntity) => {
|
|
20726
20565
|
const trustLegalEntityId = getOwnTrustLegalEntityId(rootLegalEntity);
|
|
20727
|
-
if (!trustLegalEntityId)
|
|
20728
|
-
return [];
|
|
20566
|
+
if (!trustLegalEntityId) return [];
|
|
20729
20567
|
const trustMemberAssociations = getDirectEntityAssociations(rootLegalEntity, trustLegalEntityId);
|
|
20730
20568
|
const trustMemberIds = trustMemberAssociations.map((association2) => association2.legalEntityId).filter((id2) => id2 !== void 0);
|
|
20731
20569
|
return [...trustMemberIds, ...trustMemberIds.flatMap((trustMemberId) => getTrustMemberCompanyDecisionMakerIds(rootLegalEntity, trustMemberId))];
|
|
@@ -20899,8 +20737,7 @@ function TrustRegistrationDetailsComponent(props) {
|
|
|
20899
20737
|
classNameModifiers: ["country"],
|
|
20900
20738
|
handleChangeFor: () => (e) => {
|
|
20901
20739
|
handleChangeFor("country", "input")(e);
|
|
20902
|
-
if (onCountryChange)
|
|
20903
|
-
onCountryChange(e);
|
|
20740
|
+
if (onCountryChange) onCountryChange(e);
|
|
20904
20741
|
}
|
|
20905
20742
|
}), formUtils.isRequiredField("legalName") && jsx(Field, {
|
|
20906
20743
|
name: "legalName",
|
|
@@ -21917,8 +21754,7 @@ const getOpeningStep = (forms2, remediationActions) => {
|
|
|
21917
21754
|
var _a2;
|
|
21918
21755
|
return (form2 == null ? void 0 : form2.formId) === ((_a2 = allRemediationActions[0]) == null ? void 0 : _a2.forms[0]);
|
|
21919
21756
|
});
|
|
21920
|
-
if (form)
|
|
21921
|
-
return form;
|
|
21757
|
+
if (form) return form;
|
|
21922
21758
|
}
|
|
21923
21759
|
return forms2[forms2.length - 1];
|
|
21924
21760
|
}
|
|
@@ -21949,8 +21785,7 @@ const useFormComposer = ({
|
|
|
21949
21785
|
}) => formId === activeForm2.formId) ?? activeForm2);
|
|
21950
21786
|
}, [forms2]);
|
|
21951
21787
|
useEffect(() => {
|
|
21952
|
-
if (hasAlreadyNavigatedForm)
|
|
21953
|
-
return;
|
|
21788
|
+
if (hasAlreadyNavigatedForm) return;
|
|
21954
21789
|
const openingStep = getOpeningStep(forms2, problems == null ? void 0 : problems.remediationActions);
|
|
21955
21790
|
if (activeForm !== openingStep) {
|
|
21956
21791
|
setActiveForm(openingStep);
|
|
@@ -22125,14 +21960,12 @@ const useScenarioConfiguration = ({
|
|
|
22125
21960
|
}, [getConfigurationData, setLoadingStatus]);
|
|
22126
21961
|
useEffect(() => {
|
|
22127
21962
|
setLoadingStatus("loading");
|
|
22128
|
-
if (!getPayoutAccountFormatData)
|
|
22129
|
-
return;
|
|
21963
|
+
if (!getPayoutAccountFormatData) return;
|
|
22130
21964
|
const makePayoutFormatCallAndSave = async () => {
|
|
22131
21965
|
try {
|
|
22132
21966
|
const response = await getPayoutAccountFormatData();
|
|
22133
21967
|
setAccountFormatResponse(response);
|
|
22134
|
-
if (!response)
|
|
22135
|
-
return;
|
|
21968
|
+
if (!response) return;
|
|
22136
21969
|
const allowedBankAccountFormats = Object.keys(response);
|
|
22137
21970
|
if (existingBankAccountFormat && !allowedBankAccountFormats.includes(existingBankAccountFormat)) {
|
|
22138
21971
|
throw new AdyenKycSdkError(`Account format, ${existingBankAccountFormat}, of transferInstrument is not in allowed formats for ${country2}`);
|
|
@@ -22152,8 +21985,7 @@ const useScenarioConfiguration = ({
|
|
|
22152
21985
|
bankVerificationVendors,
|
|
22153
21986
|
requiredFields
|
|
22154
21987
|
} = useMemo(() => {
|
|
22155
|
-
if (!configurationResponse)
|
|
22156
|
-
return {};
|
|
21988
|
+
if (!configurationResponse) return {};
|
|
22157
21989
|
const {
|
|
22158
21990
|
matchingScenario,
|
|
22159
21991
|
bankVerificationProviders
|
|
@@ -22449,8 +22281,7 @@ function parsePayoutScenarios({
|
|
|
22449
22281
|
country: country2,
|
|
22450
22282
|
bankVerificationAvailable
|
|
22451
22283
|
}) {
|
|
22452
|
-
if (!requiredFields)
|
|
22453
|
-
return;
|
|
22284
|
+
if (!requiredFields) return;
|
|
22454
22285
|
const fieldConfigurations = {};
|
|
22455
22286
|
fieldConfigurations.payoutVerificationMethod = {
|
|
22456
22287
|
rule: "REQUIRED"
|
|
@@ -22748,8 +22579,7 @@ const getFieldsWithExistingData = (legalEntity, isExperimentEnabled) => {
|
|
|
22748
22579
|
var _a;
|
|
22749
22580
|
const apiFieldsWithExistingData = getNestedPropertyKeys(legalEntity);
|
|
22750
22581
|
const legalEntityType = legalEntity.type;
|
|
22751
|
-
if (!legalEntityType)
|
|
22752
|
-
return [];
|
|
22582
|
+
if (!legalEntityType) return [];
|
|
22753
22583
|
const nonDocumentFields = apiFieldsWithExistingData.map((field) => convertApiFieldNameToSchemaFieldName(field, legalEntityType, isExperimentEnabled)).filter((field) => field !== void 0).filter((field) => !knownProblematicFields.includes(field));
|
|
22754
22584
|
if ((_a = legalEntity.documentDetails) == null ? void 0 : _a.length) {
|
|
22755
22585
|
const documentFields = legalEntity.documentDetails.map((document2) => legalEntityDocumentToFieldMapping[legalEntityType][document2.type]).filter((field) => field !== void 0);
|
|
@@ -23025,8 +22855,7 @@ function FormNavigation({
|
|
|
23025
22855
|
} = useI18nContext();
|
|
23026
22856
|
const getFormIndex = (form) => forms2.findIndex((f) => f.formId === form.formId);
|
|
23027
22857
|
const goToForm = (form) => () => {
|
|
23028
|
-
if (form.formId === activeForm.formId)
|
|
23029
|
-
return;
|
|
22858
|
+
if (form.formId === activeForm.formId) return;
|
|
23030
22859
|
gotoForm(getFormIndex(form));
|
|
23031
22860
|
trackNavigation2({
|
|
23032
22861
|
fromForm: form,
|
|
@@ -23321,8 +23150,7 @@ function CompanyDropinComponent({
|
|
|
23321
23150
|
legalEntity,
|
|
23322
23151
|
dataSubmitted
|
|
23323
23152
|
}) => {
|
|
23324
|
-
if (!isDocumentsRequired$2(forms22))
|
|
23325
|
-
return;
|
|
23153
|
+
if (!isDocumentsRequired$2(forms22)) return;
|
|
23326
23154
|
const formattedDocument = await mapCompanyDocumentToApiDocument(dataSubmitted, legalEntity.id);
|
|
23327
23155
|
if (formattedDocument) {
|
|
23328
23156
|
await documentUtils.uploadDocuments(formattedDocument, legalEntity.id);
|
|
@@ -23602,8 +23430,7 @@ function useCompanySearch({
|
|
|
23602
23430
|
deepSearch
|
|
23603
23431
|
}) => {
|
|
23604
23432
|
try {
|
|
23605
|
-
if (!deepSearch)
|
|
23606
|
-
return;
|
|
23433
|
+
if (!deepSearch) return;
|
|
23607
23434
|
setStatus("loading");
|
|
23608
23435
|
setCompaniesList([]);
|
|
23609
23436
|
const {
|
|
@@ -23627,8 +23454,7 @@ function useCompanySearch({
|
|
|
23627
23454
|
return setStatus("idle");
|
|
23628
23455
|
}
|
|
23629
23456
|
try {
|
|
23630
|
-
if (!handleCompanyDeepSearch)
|
|
23631
|
-
return;
|
|
23457
|
+
if (!handleCompanyDeepSearch) return;
|
|
23632
23458
|
setStatus("loading");
|
|
23633
23459
|
setSelectedCompanyId(void 0);
|
|
23634
23460
|
const {
|
|
@@ -23649,8 +23475,7 @@ function useCompanySearch({
|
|
|
23649
23475
|
}, [handleCompanyDeepSearch, country2, legalCompanyName2, limit, stateOrProvince2]);
|
|
23650
23476
|
const verify2 = useCallback(async (companyTIN, company2) => {
|
|
23651
23477
|
try {
|
|
23652
|
-
if (!handleVerifyTin || !handleGetCompanyDataset || !handleRefreshCompanyDataset)
|
|
23653
|
-
return;
|
|
23478
|
+
if (!handleVerifyTin || !handleGetCompanyDataset || !handleRefreshCompanyDataset) return;
|
|
23654
23479
|
setStatus("loading");
|
|
23655
23480
|
setSelectedCompanyId(company2.id);
|
|
23656
23481
|
if (!canVerify || !companyTIN) {
|
|
@@ -23816,10 +23641,8 @@ const CompanyLookupResultsHeader = ({
|
|
|
23816
23641
|
if (status === "loading") {
|
|
23817
23642
|
return selectedCompanyId ? i18n.get("companyLookupResultsHeader__verifying") : i18n.get("companyLookupResultsHeader__searching");
|
|
23818
23643
|
}
|
|
23819
|
-
if (numberOfResults === 0 && status === "loaded")
|
|
23820
|
-
|
|
23821
|
-
if (numberOfResults)
|
|
23822
|
-
return i18n.get("companyLookupResultsHeader__results");
|
|
23644
|
+
if (numberOfResults === 0 && status === "loaded") return i18n.get("companyLookupResultsHeader__noResults");
|
|
23645
|
+
if (numberOfResults) return i18n.get("companyLookupResultsHeader__results");
|
|
23823
23646
|
return i18n.get("companyLookupResultsHeader");
|
|
23824
23647
|
}, [hasInternalError, status, numberOfResults, i18n, selectedCompanyId]);
|
|
23825
23648
|
const descriptionText = useMemo(() => {
|
|
@@ -24220,8 +24043,7 @@ function TaxInformationField({
|
|
|
24220
24043
|
type: countryToTaxInfoTypeMap[country2]
|
|
24221
24044
|
}];
|
|
24222
24045
|
const updatedTaxInformation = taxInformation.map((taxInfo) => {
|
|
24223
|
-
if (taxInfo.country !== country2)
|
|
24224
|
-
return taxInfo;
|
|
24046
|
+
if (taxInfo.country !== country2) return taxInfo;
|
|
24225
24047
|
return {
|
|
24226
24048
|
country: country2,
|
|
24227
24049
|
number: value,
|
|
@@ -24248,8 +24070,7 @@ function TaxInformationField({
|
|
|
24248
24070
|
type: countryToTaxInfoTypeMap[country2]
|
|
24249
24071
|
}];
|
|
24250
24072
|
const updatedTaxInformation = taxInformation.map((taxInfo) => {
|
|
24251
|
-
if (taxInfo.country !== country2)
|
|
24252
|
-
return taxInfo;
|
|
24073
|
+
if (taxInfo.country !== country2) return taxInfo;
|
|
24253
24074
|
return {
|
|
24254
24075
|
country: country2,
|
|
24255
24076
|
number: value,
|
|
@@ -24330,8 +24151,7 @@ const defaultFieldConfig = entriesOf(defaultFieldConfig$7).reduce((fieldConfig,
|
|
|
24330
24151
|
errorMessage: (taxInformation) => {
|
|
24331
24152
|
var _a;
|
|
24332
24153
|
const taxIdNumber2 = (_a = taxInformation == null ? void 0 : taxInformation.find((taxId2) => country2 === taxId2.country)) == null ? void 0 : _a.number;
|
|
24333
|
-
if (!taxIdNumber2)
|
|
24334
|
-
return void 0;
|
|
24154
|
+
if (!taxIdNumber2) return void 0;
|
|
24335
24155
|
return typeof validator.errorMessage === "function" ? validator.errorMessage(taxIdNumber2) : validator.errorMessage;
|
|
24336
24156
|
}
|
|
24337
24157
|
}));
|
|
@@ -25265,8 +25085,7 @@ const formatDataForSummary = (data, forms2, labels2, i18n) => {
|
|
|
25265
25085
|
}, defaultFieldMetadata).label;
|
|
25266
25086
|
return entriesOf(data).reduce((summaryData, [form, formData]) => {
|
|
25267
25087
|
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
25268
|
-
if (!form)
|
|
25269
|
-
return summaryData;
|
|
25088
|
+
if (!form) return summaryData;
|
|
25270
25089
|
switch (form) {
|
|
25271
25090
|
case "companyBasics":
|
|
25272
25091
|
return {
|
|
@@ -25300,8 +25119,7 @@ const formatDataForSummary = (data, forms2, labels2, i18n) => {
|
|
|
25300
25119
|
[form]: formatOtherDetails(formData, i18n, (_f = data.companyBasics) == null ? void 0 : _f.country, labels2)
|
|
25301
25120
|
};
|
|
25302
25121
|
case "companyRegistrationDocument":
|
|
25303
|
-
if (!isDocumentsRequired$1(forms2))
|
|
25304
|
-
return summaryData;
|
|
25122
|
+
if (!isDocumentsRequired$1(forms2)) return summaryData;
|
|
25305
25123
|
return {
|
|
25306
25124
|
...summaryData,
|
|
25307
25125
|
[form]: {
|
|
@@ -25311,8 +25129,7 @@ const formatDataForSummary = (data, forms2, labels2, i18n) => {
|
|
|
25311
25129
|
}
|
|
25312
25130
|
};
|
|
25313
25131
|
case "companyTaxDocument":
|
|
25314
|
-
if (!isDocumentsRequired$1(forms2))
|
|
25315
|
-
return summaryData;
|
|
25132
|
+
if (!isDocumentsRequired$1(forms2)) return summaryData;
|
|
25316
25133
|
return {
|
|
25317
25134
|
...summaryData,
|
|
25318
25135
|
[form]: {
|
|
@@ -25555,8 +25372,7 @@ function useCompanySearchTaskSubmit({
|
|
|
25555
25372
|
legalEntity,
|
|
25556
25373
|
currentForms
|
|
25557
25374
|
}) => {
|
|
25558
|
-
if (!isDocumentsRequired$1(currentForms))
|
|
25559
|
-
return;
|
|
25375
|
+
if (!isDocumentsRequired$1(currentForms)) return;
|
|
25560
25376
|
const formattedDocument = await mapCompanySearchDocumentToApiDocument(data, legalEntity.id);
|
|
25561
25377
|
try {
|
|
25562
25378
|
if (formattedDocument) {
|
|
@@ -25858,8 +25674,7 @@ function CompanySearchDropinComponent({
|
|
|
25858
25674
|
var _a2;
|
|
25859
25675
|
eventEmitter.on("updateLocale", (locale) => setLocale(locale));
|
|
25860
25676
|
const documentIds = ((_a2 = legalEntityResponse == null ? void 0 : legalEntityResponse.documentDetails) == null ? void 0 : _a2.map((documentReference) => documentReference.id)) || [];
|
|
25861
|
-
if (!documentIds.length)
|
|
25862
|
-
return;
|
|
25677
|
+
if (!documentIds.length) return;
|
|
25863
25678
|
documentUtils.fetchDocuments(documentIds, legalEntityResponse.id).then(() => {
|
|
25864
25679
|
setInitialData({
|
|
25865
25680
|
...initialData,
|
|
@@ -26018,8 +25833,7 @@ const useLocalStorage = (key, defaultValue, options) => {
|
|
|
26018
25833
|
}), [options]);
|
|
26019
25834
|
const rawValueRef = useRef(null);
|
|
26020
25835
|
const [value, setValue] = useState(() => {
|
|
26021
|
-
if (typeof window === "undefined")
|
|
26022
|
-
return defaultValue;
|
|
25836
|
+
if (typeof window === "undefined") return defaultValue;
|
|
26023
25837
|
try {
|
|
26024
25838
|
rawValueRef.current = window.localStorage.getItem(key);
|
|
26025
25839
|
const res = rawValueRef.current ? parser(rawValueRef.current) : defaultValue;
|
|
@@ -26030,8 +25844,7 @@ const useLocalStorage = (key, defaultValue, options) => {
|
|
|
26030
25844
|
}
|
|
26031
25845
|
});
|
|
26032
25846
|
useEffect(() => {
|
|
26033
|
-
if (typeof window === "undefined")
|
|
26034
|
-
return;
|
|
25847
|
+
if (typeof window === "undefined") return;
|
|
26035
25848
|
const updateLocalStorage = () => {
|
|
26036
25849
|
if (value !== void 0) {
|
|
26037
25850
|
const newValue = serializer(value);
|
|
@@ -26061,11 +25874,9 @@ const useLocalStorage = (key, defaultValue, options) => {
|
|
|
26061
25874
|
}
|
|
26062
25875
|
}, [value]);
|
|
26063
25876
|
useEffect(() => {
|
|
26064
|
-
if (!syncData)
|
|
26065
|
-
return;
|
|
25877
|
+
if (!syncData) return;
|
|
26066
25878
|
const handleStorageChange = (event) => {
|
|
26067
|
-
if (event.key !== key || event.storageArea !== window.localStorage)
|
|
26068
|
-
return;
|
|
25879
|
+
if (event.key !== key || event.storageArea !== window.localStorage) return;
|
|
26069
25880
|
try {
|
|
26070
25881
|
if (event.newValue !== rawValueRef.current) {
|
|
26071
25882
|
rawValueRef.current = event.newValue;
|
|
@@ -26075,8 +25886,7 @@ const useLocalStorage = (key, defaultValue, options) => {
|
|
|
26075
25886
|
logger$f.error(err);
|
|
26076
25887
|
}
|
|
26077
25888
|
};
|
|
26078
|
-
if (typeof window === "undefined")
|
|
26079
|
-
return;
|
|
25889
|
+
if (typeof window === "undefined") return;
|
|
26080
25890
|
window.addEventListener("storage", handleStorageChange);
|
|
26081
25891
|
return () => window.removeEventListener("storage", handleStorageChange);
|
|
26082
25892
|
}, [key, syncData]);
|
|
@@ -26110,11 +25920,9 @@ const useIsEligibleForSingpass = ({
|
|
|
26110
25920
|
const {
|
|
26111
25921
|
isExperimentEnabled
|
|
26112
25922
|
} = useExperimentsContext();
|
|
26113
|
-
if (!isExperimentEnabled("ShowSingPassButtonForCompanies"))
|
|
26114
|
-
return false;
|
|
25923
|
+
if (!isExperimentEnabled("ShowSingPassButtonForCompanies")) return false;
|
|
26115
25924
|
const isSingpassEnabled = Boolean(handleOpenSingpassAuthorizationLink) && getLegalEntityCountry(legalEntity) === CountryCodes.Singapore;
|
|
26116
|
-
if (!isSingpassEnabled)
|
|
26117
|
-
return false;
|
|
25925
|
+
if (!isSingpassEnabled) return false;
|
|
26118
25926
|
if (accountHolder2) {
|
|
26119
25927
|
return accountHolder2 === "theCompanyIWorkFor";
|
|
26120
25928
|
}
|
|
@@ -26157,8 +25965,7 @@ const useExemptSettlor = ({
|
|
|
26157
25965
|
setExemptSettlor(exemptSettlorLE);
|
|
26158
25966
|
}, [handleGetLegalEntity]);
|
|
26159
25967
|
useEffect(() => {
|
|
26160
|
-
if (!(trust2 == null ? void 0 : trust2.trust))
|
|
26161
|
-
return;
|
|
25968
|
+
if (!(trust2 == null ? void 0 : trust2.trust)) return;
|
|
26162
25969
|
updateExemptSettlor(trust2).catch(logger$d.error);
|
|
26163
25970
|
}, [trust2, updateExemptSettlor]);
|
|
26164
25971
|
return exemptSettlor;
|
|
@@ -26219,8 +26026,7 @@ const saveBlobAsFile = (fileData, filename) => {
|
|
|
26219
26026
|
const isNewEntity = Symbol("isNewEntity");
|
|
26220
26027
|
const splitAtFirstOccurrence = (str, separator) => {
|
|
26221
26028
|
const firstOccurrence = str.indexOf(separator);
|
|
26222
|
-
if (firstOccurrence === -1)
|
|
26223
|
-
return [str];
|
|
26029
|
+
if (firstOccurrence === -1) return [str];
|
|
26224
26030
|
return [str.slice(0, firstOccurrence), str.slice(firstOccurrence + 1)];
|
|
26225
26031
|
};
|
|
26226
26032
|
const getTrustMemberOwnerId = (trustMemberId, entityAssociations) => {
|
|
@@ -26247,23 +26053,21 @@ const convertEntityAssociationIntoTrustMember = (association2, associations, exe
|
|
|
26247
26053
|
name: association2.name
|
|
26248
26054
|
};
|
|
26249
26055
|
}
|
|
26250
|
-
if (association2.entityType === LegalEntityType.ORGANIZATION)
|
|
26251
|
-
|
|
26252
|
-
|
|
26253
|
-
|
|
26254
|
-
|
|
26255
|
-
|
|
26256
|
-
|
|
26257
|
-
|
|
26258
|
-
|
|
26259
|
-
|
|
26260
|
-
|
|
26261
|
-
|
|
26262
|
-
|
|
26263
|
-
|
|
26264
|
-
|
|
26265
|
-
name: association2.name
|
|
26266
|
-
};
|
|
26056
|
+
if (association2.entityType === LegalEntityType.ORGANIZATION) return {
|
|
26057
|
+
trustMemberType: "company",
|
|
26058
|
+
roles: [],
|
|
26059
|
+
legalEntityType: LegalEntityType.ORGANIZATION,
|
|
26060
|
+
legalEntityId: association2.legalEntityId,
|
|
26061
|
+
name: association2.name,
|
|
26062
|
+
ownerId: getTrustMemberOwnerId(association2.legalEntityId, associations)
|
|
26063
|
+
};
|
|
26064
|
+
if (association2.entityType === LegalEntityType.INDIVIDUAL) return {
|
|
26065
|
+
trustMemberType: "regular",
|
|
26066
|
+
roles: [],
|
|
26067
|
+
legalEntityType: LegalEntityType.INDIVIDUAL,
|
|
26068
|
+
legalEntityId: association2.legalEntityId,
|
|
26069
|
+
name: association2.name
|
|
26070
|
+
};
|
|
26267
26071
|
throw new Error(`Not a valid trust member: ${JSON.stringify(association2)}`);
|
|
26268
26072
|
};
|
|
26269
26073
|
const mapEntityAssociationsToTrustMembers = (trustEntityId, entityAssociations, exemptSettlorLE) => {
|
|
@@ -26323,14 +26127,13 @@ const mapTrustMemberToEntityAssociations = (trustMember) => {
|
|
|
26323
26127
|
if (trustMember.legalEntityId === isNewEntity) {
|
|
26324
26128
|
throw Error("Cannot map a new trust member, you must create it first");
|
|
26325
26129
|
}
|
|
26326
|
-
if (trustMember.trustMemberType === "exemptSettlor")
|
|
26327
|
-
|
|
26328
|
-
|
|
26329
|
-
|
|
26330
|
-
|
|
26331
|
-
|
|
26332
|
-
|
|
26333
|
-
}];
|
|
26130
|
+
if (trustMember.trustMemberType === "exemptSettlor") return [{
|
|
26131
|
+
legalEntityId: trustMember.legalEntityId,
|
|
26132
|
+
entityType: trustMember.legalEntityType,
|
|
26133
|
+
type: TrustMemberTypes.SETTLOR,
|
|
26134
|
+
settlorExemptionReason: trustMember.settlorExemptionReason,
|
|
26135
|
+
name: trustMember.legalEntityType === LegalEntityType.INDIVIDUAL ? `${(_a = trustMember.exemptSettlorName) == null ? void 0 : _a.firstName} ${(_b = trustMember.exemptSettlorName) == null ? void 0 : _b.lastName}` : trustMember.name ?? ""
|
|
26136
|
+
}];
|
|
26334
26137
|
return trustMember.roles.map((role2) => ({
|
|
26335
26138
|
legalEntityId: trustMember.legalEntityId,
|
|
26336
26139
|
type: role2
|
|
@@ -26711,8 +26514,7 @@ const BusinessTypeSelection = ({
|
|
|
26711
26514
|
}, []);
|
|
26712
26515
|
const handleNextClick = async () => {
|
|
26713
26516
|
var _a2;
|
|
26714
|
-
if (loadingStatus === "loading")
|
|
26715
|
-
return;
|
|
26517
|
+
if (loadingStatus === "loading") return;
|
|
26716
26518
|
triggerValidation();
|
|
26717
26519
|
if (isValid) {
|
|
26718
26520
|
if (((_a2 = data.businessType) == null ? void 0 : _a2.id) === "legalArrangement") {
|
|
@@ -27047,8 +26849,9 @@ const TaskItemStatus = ({
|
|
|
27047
26849
|
return jsx(Status, {
|
|
27048
26850
|
className: "adl-status--finished",
|
|
27049
26851
|
iconStatusClass: "adl-status__icon--finished",
|
|
27050
|
-
icon: "
|
|
26852
|
+
icon: "checkmark-small",
|
|
27051
26853
|
text: statusLabel || i18n.get("signed"),
|
|
26854
|
+
size,
|
|
27052
26855
|
showText
|
|
27053
26856
|
});
|
|
27054
26857
|
case TaskStatus.ERROR:
|
|
@@ -27725,12 +27528,9 @@ const useLegalEntityType = ({
|
|
|
27725
27528
|
switch (legalEntity.type) {
|
|
27726
27529
|
case LegalEntityType.INDIVIDUAL:
|
|
27727
27530
|
case LegalEntityType.ORGANIZATION:
|
|
27728
|
-
if (!hasLegalAssociation)
|
|
27729
|
-
|
|
27730
|
-
if (
|
|
27731
|
-
return LegalEntityType.SOLE_PROPRIETORSHIP;
|
|
27732
|
-
if (isTrust)
|
|
27733
|
-
return LegalEntityType.TRUST;
|
|
27531
|
+
if (!hasLegalAssociation) return legalEntity.type;
|
|
27532
|
+
if (isSoleProprietor) return LegalEntityType.SOLE_PROPRIETORSHIP;
|
|
27533
|
+
if (isTrust) return LegalEntityType.TRUST;
|
|
27734
27534
|
break;
|
|
27735
27535
|
default:
|
|
27736
27536
|
return void 0;
|
|
@@ -27775,12 +27575,9 @@ const useIntroductionScreens = ({
|
|
|
27775
27575
|
const isSoleProprietor = legalEntityType === LegalEntityType.SOLE_PROPRIETORSHIP;
|
|
27776
27576
|
const isTrustScreen = screen === IntroductionScreens.TRUST || screen === IntroductionScreens.TRUST_MEMBER_OVERVIEW;
|
|
27777
27577
|
const isTrust = legalEntityType === LegalEntityType.TRUST;
|
|
27778
|
-
if (isAccountScreen)
|
|
27779
|
-
|
|
27780
|
-
if (
|
|
27781
|
-
return isSoleProprietor;
|
|
27782
|
-
if (isTrustScreen)
|
|
27783
|
-
return isTrust;
|
|
27578
|
+
if (isAccountScreen) return hasAccountTask;
|
|
27579
|
+
if (isSoleProprietorScreen) return isSoleProprietor;
|
|
27580
|
+
if (isTrustScreen) return isTrust;
|
|
27784
27581
|
return tasks.some((task) => screen === task);
|
|
27785
27582
|
}) : [], [legalEntityType, tasks]);
|
|
27786
27583
|
return canSeeIntroduction && (introductionScreens == null ? void 0 : introductionScreens.length) > 0 ? [IntroductionScreens.PROLOGUE, ...introductionScreens, IntroductionScreens.EPILOGUE] : void 0;
|
|
@@ -29230,8 +29027,7 @@ function IndividualDropinComponent({
|
|
|
29230
29027
|
dataSubmitted
|
|
29231
29028
|
}) => {
|
|
29232
29029
|
var _a2;
|
|
29233
|
-
if (!isDocumentsRequired2(forms22))
|
|
29234
|
-
return;
|
|
29030
|
+
if (!isDocumentsRequired2(forms22)) return;
|
|
29235
29031
|
if ((_a2 = dataSubmitted.idDocument) == null ? void 0 : _a2.instantIdVerificationData) {
|
|
29236
29032
|
await handleInstantIdVerificationStartCheck(dataSubmitted.idDocument.instantIdVerificationData, legalEntity.id);
|
|
29237
29033
|
} else {
|
|
@@ -29367,20 +29163,17 @@ function IndividualDropinComponent({
|
|
|
29367
29163
|
const datasetUtils = datasetUtilities(i18n.locale);
|
|
29368
29164
|
const formatIdDocument = (idDocument2) => {
|
|
29369
29165
|
var _a2, _b2;
|
|
29370
|
-
if (!idDocument2)
|
|
29371
|
-
return void 0;
|
|
29166
|
+
if (!idDocument2) return void 0;
|
|
29372
29167
|
const documentType2 = (idDocument2 == null ? void 0 : idDocument2.instantIdVerificationData) ? onfidoDocumentTypeMapping.find((document2) => {
|
|
29373
29168
|
var _a3;
|
|
29374
29169
|
return ((_a3 = idDocument2.instantIdVerificationData) == null ? void 0 : _a3.document_front.type) === document2.id;
|
|
29375
29170
|
}) : idDocumentTypeOptions.find(({
|
|
29376
29171
|
id: id2
|
|
29377
29172
|
}) => idDocument2.idDocumentType === id2);
|
|
29378
|
-
if (!documentType2)
|
|
29379
|
-
return void 0;
|
|
29173
|
+
if (!documentType2) return void 0;
|
|
29380
29174
|
const frontPage2 = (_a2 = idDocument2.idFrontPage) == null ? void 0 : _a2[0];
|
|
29381
29175
|
const backPage2 = (_b2 = idDocument2.idBackPage) == null ? void 0 : _b2[0];
|
|
29382
|
-
if (!frontPage2)
|
|
29383
|
-
return void 0;
|
|
29176
|
+
if (!frontPage2) return void 0;
|
|
29384
29177
|
return {
|
|
29385
29178
|
documentType: i18n.get(documentType2.name),
|
|
29386
29179
|
...backPage2 && documentType2.hasBackPage ? {
|
|
@@ -29564,8 +29357,7 @@ const rules$1 = ({
|
|
|
29564
29357
|
}) => ({
|
|
29565
29358
|
whenUsingManualVerification: () => {
|
|
29566
29359
|
var _a;
|
|
29567
|
-
if (!data.payoutVerificationMethod)
|
|
29568
|
-
return;
|
|
29360
|
+
if (!data.payoutVerificationMethod) return;
|
|
29569
29361
|
if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification") {
|
|
29570
29362
|
return "REQUIRED";
|
|
29571
29363
|
}
|
|
@@ -29829,8 +29621,7 @@ function PayoutDetailsDropinComponent({
|
|
|
29829
29621
|
useEffect(() => {
|
|
29830
29622
|
var _a2;
|
|
29831
29623
|
const payoutAccountData = (_a2 = cloneObject(data)) == null ? void 0 : _a2.payoutAccountDetails;
|
|
29832
|
-
if (payoutAccountData)
|
|
29833
|
-
setAccountDetailsFromInput(payoutAccountData);
|
|
29624
|
+
if (payoutAccountData) setAccountDetailsFromInput(payoutAccountData);
|
|
29834
29625
|
}, [data]);
|
|
29835
29626
|
const onSubmit = async () => {
|
|
29836
29627
|
setLoadingStatus("loading");
|
|
@@ -30119,8 +29910,7 @@ function PciDropinComponent({
|
|
|
30119
29910
|
name: `${(_a = legalEntityResponse == null ? void 0 : legalEntityResponse.individual) == null ? void 0 : _a.name.firstName} ${(_b = legalEntityResponse.individual) == null ? void 0 : _b.name.lastName}`
|
|
30120
29911
|
}];
|
|
30121
29912
|
const handleSignClick = async () => {
|
|
30122
|
-
if (loadingStatus === "loading")
|
|
30123
|
-
return;
|
|
29913
|
+
if (loadingStatus === "loading") return;
|
|
30124
29914
|
userEvents.addEvent("Clicked PCI signing", {
|
|
30125
29915
|
segmentation: {
|
|
30126
29916
|
...baseTrackingPayload
|
|
@@ -30252,8 +30042,7 @@ function PciDropinComponent({
|
|
|
30252
30042
|
});
|
|
30253
30043
|
}
|
|
30254
30044
|
const convertExistingSettlorExemptionReasons = (existingReasons) => {
|
|
30255
|
-
if (!existingReasons || !existingReasons.length)
|
|
30256
|
-
return ["noneOfTheAbove"];
|
|
30045
|
+
if (!existingReasons || !existingReasons.length) return ["noneOfTheAbove"];
|
|
30257
30046
|
return existingReasons;
|
|
30258
30047
|
};
|
|
30259
30048
|
const convertExistingTrustMember = (trustMember) => {
|
|
@@ -30368,8 +30157,7 @@ const getAvailableRolesByTrustMemberTypeAndLegalEntityType = (currentRoles, trus
|
|
|
30368
30157
|
return roles.filter((r) => r !== "secondaryTrustee");
|
|
30369
30158
|
};
|
|
30370
30159
|
const getAvailableRoles = (currentRoles) => {
|
|
30371
|
-
if (!(currentRoles == null ? void 0 : currentRoles.length))
|
|
30372
|
-
return Object.values(TrustMemberTypes);
|
|
30160
|
+
if (!(currentRoles == null ? void 0 : currentRoles.length)) return Object.values(TrustMemberTypes);
|
|
30373
30161
|
return currentRoles.map((role2) => [role2, ...allowedCrossoverRolesMatrix[role2]]).reduce((existingAllowed, allowedForRole) => existingAllowed.filter((role2) => allowedForRole.includes(role2)));
|
|
30374
30162
|
};
|
|
30375
30163
|
const trustMemberLegalEntityTypes = [LegalEntityType.INDIVIDUAL, LegalEntityType.ORGANIZATION];
|
|
@@ -30706,8 +30494,7 @@ const exemptSettlorForms = {
|
|
|
30706
30494
|
summary
|
|
30707
30495
|
};
|
|
30708
30496
|
const decideForms = (trustMember) => {
|
|
30709
|
-
if (trustMember === "incomplete")
|
|
30710
|
-
return regularForms;
|
|
30497
|
+
if (trustMember === "incomplete") return regularForms;
|
|
30711
30498
|
switch (trustMember.trustMemberType) {
|
|
30712
30499
|
case "undefinedBeneficiary":
|
|
30713
30500
|
return undefinedBeneficiaryForms;
|
|
@@ -30757,13 +30544,12 @@ const convertDataToTrustMember = (data, existingTrustMember, isOrganizationSettl
|
|
|
30757
30544
|
legalEntityId: existingId ?? isNewEntity
|
|
30758
30545
|
};
|
|
30759
30546
|
}
|
|
30760
|
-
if (data.role.includes("undefinedBeneficiary"))
|
|
30761
|
-
|
|
30762
|
-
|
|
30763
|
-
|
|
30764
|
-
|
|
30765
|
-
|
|
30766
|
-
};
|
|
30547
|
+
if (data.role.includes("undefinedBeneficiary")) return {
|
|
30548
|
+
trustMemberType: "undefinedBeneficiary",
|
|
30549
|
+
roles: [TrustMemberTypes.UNDEFINED_BENEFICIARY],
|
|
30550
|
+
description: data.descriptionUndefinedBeneficiary ?? "",
|
|
30551
|
+
reference: existingId ?? isNewEntity
|
|
30552
|
+
};
|
|
30767
30553
|
if (data.entityType === LegalEntityType.ORGANIZATION) {
|
|
30768
30554
|
return {
|
|
30769
30555
|
trustMemberType: "company",
|
|
@@ -30774,14 +30560,13 @@ const convertDataToTrustMember = (data, existingTrustMember, isOrganizationSettl
|
|
|
30774
30560
|
country: data.country
|
|
30775
30561
|
};
|
|
30776
30562
|
}
|
|
30777
|
-
if (data.entityType === LegalEntityType.INDIVIDUAL)
|
|
30778
|
-
|
|
30779
|
-
|
|
30780
|
-
|
|
30781
|
-
|
|
30782
|
-
|
|
30783
|
-
|
|
30784
|
-
};
|
|
30563
|
+
if (data.entityType === LegalEntityType.INDIVIDUAL) return {
|
|
30564
|
+
trustMemberType: "regular",
|
|
30565
|
+
roles: data.role,
|
|
30566
|
+
legalEntityType: LegalEntityType.INDIVIDUAL,
|
|
30567
|
+
legalEntityId: existingId ?? isNewEntity,
|
|
30568
|
+
name: ""
|
|
30569
|
+
};
|
|
30785
30570
|
}
|
|
30786
30571
|
return "incomplete";
|
|
30787
30572
|
};
|
|
@@ -30841,8 +30626,7 @@ function RoleAndTypeDropinComponent({
|
|
|
30841
30626
|
setTrustMember(convertDataToTrustMember(data, existingTrustMember, isOrganizationSettlorWithExemptionEnabled));
|
|
30842
30627
|
};
|
|
30843
30628
|
const saveRolesAndNavigate = async () => {
|
|
30844
|
-
if (trustMember === "incomplete")
|
|
30845
|
-
return;
|
|
30629
|
+
if (trustMember === "incomplete") return;
|
|
30846
30630
|
if (hasRolesChanged(trustMember.roles, existingTrustMember == null ? void 0 : existingTrustMember.roles)) {
|
|
30847
30631
|
addOrUpdateTrustMember(trustMember);
|
|
30848
30632
|
}
|
|
@@ -30865,8 +30649,7 @@ function RoleAndTypeDropinComponent({
|
|
|
30865
30649
|
navigateToFullDropinFor(trustMember);
|
|
30866
30650
|
return;
|
|
30867
30651
|
}
|
|
30868
|
-
if (targetForm.formId === summaryStep.formId)
|
|
30869
|
-
return;
|
|
30652
|
+
if (targetForm.formId === summaryStep.formId) return;
|
|
30870
30653
|
}
|
|
30871
30654
|
setActiveForm(targetForm);
|
|
30872
30655
|
};
|
|
@@ -30940,8 +30723,7 @@ const useServiceAgreement = ({
|
|
|
30940
30723
|
}, [language]);
|
|
30941
30724
|
useEffect(() => {
|
|
30942
30725
|
const requestAcceptedServiceAgreement = async () => {
|
|
30943
|
-
if (!handleViewAcceptedTermsOfServiceDocument || !acceptanceId)
|
|
30944
|
-
return;
|
|
30726
|
+
if (!handleViewAcceptedTermsOfServiceDocument || !acceptanceId) return;
|
|
30945
30727
|
setLoading("loading");
|
|
30946
30728
|
const {
|
|
30947
30729
|
id: id2,
|
|
@@ -30957,8 +30739,7 @@ const useServiceAgreement = ({
|
|
|
30957
30739
|
}, [acceptanceId, handleViewAcceptedTermsOfServiceDocument]);
|
|
30958
30740
|
useEffect(() => {
|
|
30959
30741
|
const requestServiceAgreement = async () => {
|
|
30960
|
-
if (acceptanceId)
|
|
30961
|
-
return;
|
|
30742
|
+
if (acceptanceId) return;
|
|
30962
30743
|
setLoading("loading");
|
|
30963
30744
|
try {
|
|
30964
30745
|
const {
|
|
@@ -31094,8 +30875,7 @@ function ServiceAgreementDropinComponent({
|
|
|
31094
30875
|
}
|
|
31095
30876
|
});
|
|
31096
30877
|
triggerValidation();
|
|
31097
|
-
if (loadingStatus === "loading" || !serviceAgreement || !data.signer)
|
|
31098
|
-
return;
|
|
30878
|
+
if (loadingStatus === "loading" || !serviceAgreement || !data.signer) return;
|
|
31099
30879
|
if (isValid) {
|
|
31100
30880
|
try {
|
|
31101
30881
|
setLoadingStatus("loading");
|
|
@@ -31152,8 +30932,7 @@ function ServiceAgreementDropinComponent({
|
|
|
31152
30932
|
});
|
|
31153
30933
|
};
|
|
31154
30934
|
useEffect(() => {
|
|
31155
|
-
if (!serviceAgreementAcceptanceInfos.length)
|
|
31156
|
-
return;
|
|
30935
|
+
if (!serviceAgreementAcceptanceInfos.length) return;
|
|
31157
30936
|
gotoForm(serviceAgreementAcceptanceInfos.length - 1);
|
|
31158
30937
|
}, [serviceAgreementAcceptanceInfos]);
|
|
31159
30938
|
useEffect(() => {
|
|
@@ -31172,8 +30951,7 @@ function ServiceAgreementDropinComponent({
|
|
|
31172
30951
|
};
|
|
31173
30952
|
const onDownloadAcceptedTermsOfServiceDocument = async () => {
|
|
31174
30953
|
try {
|
|
31175
|
-
if (!canDownload)
|
|
31176
|
-
return;
|
|
30954
|
+
if (!canDownload) return;
|
|
31177
30955
|
const response = await handleDownloadAcceptedTermsOfServiceDocument(legalEntityResponse.id, activeForm.acceptanceId);
|
|
31178
30956
|
await downloadFile(response.document, `${i18n.get(activeForm.formName)}.pdf`);
|
|
31179
30957
|
} catch (e) {
|
|
@@ -31941,8 +31719,7 @@ const useNavigation = ({
|
|
|
31941
31719
|
}
|
|
31942
31720
|
}, [onNavigate]);
|
|
31943
31721
|
const navigateBack = useCallback((stepCount = 1) => {
|
|
31944
|
-
if (taskHistory.length <= 1)
|
|
31945
|
-
return;
|
|
31722
|
+
if (taskHistory.length <= 1) return;
|
|
31946
31723
|
const prevTask = taskHistory[taskHistory.length - (stepCount + 1)];
|
|
31947
31724
|
if (prevTask === "default") {
|
|
31948
31725
|
throw Error("Cannot navigate back to 'default' task");
|
|
@@ -31983,12 +31760,9 @@ const getDefaultTask = ({
|
|
|
31983
31760
|
shouldShowSingpassSelection
|
|
31984
31761
|
}) => {
|
|
31985
31762
|
const hasLegalEntityProgressedBeyondEntitySelection = hasProgressedBeyondEntitySelection(legalEntity);
|
|
31986
|
-
if (isNewEntryFlowEnabled && !accountHolder2 && !hasLegalEntityProgressedBeyondEntitySelection)
|
|
31987
|
-
|
|
31988
|
-
if (
|
|
31989
|
-
return TaskTypes.INTRODUCTION;
|
|
31990
|
-
if (shouldShowSingpassSelection)
|
|
31991
|
-
return TaskTypes.SINGPASS_SELECTION;
|
|
31763
|
+
if (isNewEntryFlowEnabled && !accountHolder2 && !hasLegalEntityProgressedBeyondEntitySelection) return TaskTypes.BUSINESS_TYPE_SELECTION;
|
|
31764
|
+
if (showIntroduction) return TaskTypes.INTRODUCTION;
|
|
31765
|
+
if (shouldShowSingpassSelection) return TaskTypes.SINGPASS_SELECTION;
|
|
31992
31766
|
return TaskTypes.TASKS_OVERVIEW;
|
|
31993
31767
|
};
|
|
31994
31768
|
const hasProgressedBeyondEntitySelection = (legalEntity) => {
|
|
@@ -32136,8 +31910,7 @@ function DropinComposerComponent({
|
|
|
32136
31910
|
}
|
|
32137
31911
|
}, [additionalSalesChannels, i18n, rootLegalEntity.id, args.handleGetPciTemplate]);
|
|
32138
31912
|
useEffect(() => {
|
|
32139
|
-
if (!tasks.includes(TaskTypes.PCI_DSS))
|
|
32140
|
-
return;
|
|
31913
|
+
if (!tasks.includes(TaskTypes.PCI_DSS)) return;
|
|
32141
31914
|
getPciTemplate2().catch(logger$b.error);
|
|
32142
31915
|
}, [getPciTemplate2, tasks]);
|
|
32143
31916
|
const addFetchedAcceptedByName = async (acceptanceInfo) => {
|
|
@@ -34235,11 +34008,9 @@ function ViewVerificationStatusComponent({
|
|
|
34235
34008
|
const [onboardingStatus, setOnboardingStatus] = useState();
|
|
34236
34009
|
const [alertContent, setAlertContent] = useState();
|
|
34237
34010
|
const content = useMemo(() => {
|
|
34238
|
-
if (!onboardingStatus)
|
|
34239
|
-
return;
|
|
34011
|
+
if (!onboardingStatus) return;
|
|
34240
34012
|
const statusContent = getContentByStatus(onboardingStatus);
|
|
34241
|
-
if (statusContent)
|
|
34242
|
-
return statusContent;
|
|
34013
|
+
if (statusContent) return statusContent;
|
|
34243
34014
|
logger$5.error(`there is no content for status "${onboardingStatus}"`);
|
|
34244
34015
|
}, [onboardingStatus]);
|
|
34245
34016
|
const handleError = ({
|
|
@@ -34495,8 +34266,7 @@ const buildSpriteDOMFromResponse = (responseData) => {
|
|
|
34495
34266
|
return iconContainer;
|
|
34496
34267
|
};
|
|
34497
34268
|
const loadDocumentGuidance = async (loadingContext) => {
|
|
34498
|
-
if (isDocumentGuidanceLoaded)
|
|
34499
|
-
return;
|
|
34269
|
+
if (isDocumentGuidanceLoaded) return;
|
|
34500
34270
|
isDocumentGuidanceLoaded = true;
|
|
34501
34271
|
const responseData = await http({
|
|
34502
34272
|
loadingContext,
|
|
@@ -34819,7 +34589,7 @@ const ConfigurationApiProvider = ({
|
|
|
34819
34589
|
isEmbeddedDropin,
|
|
34820
34590
|
loadingContext
|
|
34821
34591
|
} = authContext;
|
|
34822
|
-
const sdkVersion = "3.
|
|
34592
|
+
const sdkVersion = "3.16.0";
|
|
34823
34593
|
useAnalytics({
|
|
34824
34594
|
onUserEvent,
|
|
34825
34595
|
legalEntityId: rootLegalEntityId,
|
|
@@ -34922,12 +34692,10 @@ const useTranslations = ({
|
|
|
34922
34692
|
getDataset: getDataset2
|
|
34923
34693
|
} = useConfigurationApi();
|
|
34924
34694
|
useEffect(() => {
|
|
34925
|
-
if (!allowedLocales)
|
|
34926
|
-
return;
|
|
34695
|
+
if (!allowedLocales) return;
|
|
34927
34696
|
const isLocaleAllowed = allowedLocales.includes(locale);
|
|
34928
34697
|
const localeToUse = isLocaleAllowed ? locale : FALLBACK_LOCALE;
|
|
34929
|
-
if (loaded.locale === localeToUse)
|
|
34930
|
-
return;
|
|
34698
|
+
if (loaded.locale === localeToUse) return;
|
|
34931
34699
|
if (!isLocaleAllowed) {
|
|
34932
34700
|
logger.error(`
|
|
34933
34701
|
"${locale}" isn't a supported locale. Please use one of the following:
|
|
@@ -34978,6 +34746,13 @@ const I18nProvider = ({
|
|
|
34978
34746
|
children
|
|
34979
34747
|
});
|
|
34980
34748
|
};
|
|
34749
|
+
const QueryClient = new QueryClient$1();
|
|
34750
|
+
const QueryClientProvider = ({
|
|
34751
|
+
children
|
|
34752
|
+
}) => jsx(QueryClientProvider$1, {
|
|
34753
|
+
client: QueryClient,
|
|
34754
|
+
children
|
|
34755
|
+
});
|
|
34981
34756
|
const settingsDefaults = {
|
|
34982
34757
|
acceptedCountries: void 0,
|
|
34983
34758
|
allowBankAccountFormatSelection: false,
|
|
@@ -35015,8 +34790,7 @@ function SettingsProvider({
|
|
|
35015
34790
|
}
|
|
35016
34791
|
function removeObjectPropsWithEmptyValues(obj) {
|
|
35017
34792
|
keysOf(obj).forEach((key) => {
|
|
35018
|
-
if (obj[key] === null || isEmpty(obj[key]))
|
|
35019
|
-
delete obj[key];
|
|
34793
|
+
if (obj[key] === null || isEmpty(obj[key])) delete obj[key];
|
|
35020
34794
|
});
|
|
35021
34795
|
return obj;
|
|
35022
34796
|
}
|
|
@@ -35296,10 +35070,8 @@ class BaseElement {
|
|
|
35296
35070
|
}
|
|
35297
35071
|
}
|
|
35298
35072
|
const getRootLegalEntityId = (componentProps) => {
|
|
35299
|
-
if ("legalEntityId" in componentProps)
|
|
35300
|
-
|
|
35301
|
-
if ("legalEntityResponse" in componentProps)
|
|
35302
|
-
return componentProps.legalEntityResponse.id;
|
|
35073
|
+
if ("legalEntityId" in componentProps) return componentProps.legalEntityId;
|
|
35074
|
+
if ("legalEntityResponse" in componentProps) return componentProps.legalEntityResponse.id;
|
|
35303
35075
|
throw new Error("You must provide either `legalEntityId` or `legalEntityResponse`");
|
|
35304
35076
|
};
|
|
35305
35077
|
class UIElement extends BaseElement {
|
|
@@ -35332,9 +35104,11 @@ class UIElement extends BaseElement {
|
|
|
35332
35104
|
children: jsx(AutoResizer, {
|
|
35333
35105
|
children: jsx(ToastContextProvider, {
|
|
35334
35106
|
children: jsx(StateProvider, {
|
|
35335
|
-
children: jsx(
|
|
35336
|
-
|
|
35337
|
-
|
|
35107
|
+
children: jsx(QueryClientProvider, {
|
|
35108
|
+
children: jsx(Component, {
|
|
35109
|
+
...this.props.componentProps,
|
|
35110
|
+
eventEmitter: this.eventEmitter
|
|
35111
|
+
})
|
|
35338
35112
|
})
|
|
35339
35113
|
})
|
|
35340
35114
|
})
|
|
@@ -36204,8 +35978,7 @@ class Core {
|
|
|
36204
35978
|
};
|
|
36205
35979
|
validateCoreOptions(newOptions);
|
|
36206
35980
|
newOptions.loadingContext = normalizeEnvironment(newOptions.environment);
|
|
36207
|
-
if (!newOptions.locale)
|
|
36208
|
-
newOptions.locale = FALLBACK_LOCALE;
|
|
35981
|
+
if (!newOptions.locale) newOptions.locale = FALLBACK_LOCALE;
|
|
36209
35982
|
return newOptions;
|
|
36210
35983
|
};
|
|
36211
35984
|
this.initializeSession = () => {
|