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