@adyen/kyc-components 3.18.0 → 3.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/adyen-kyc-components.es.js +977 -344
- package/dist/style.css +164 -1812
- package/dist/types/components/Dropins/HighExposureDropin/components/AdditionalFieldsForHighExposureCompany.d.ts +4 -0
- package/dist/types/components/Dropins/HighExposureDropin/components/AdditionalFieldsForHighExposureParentCompany.d.ts +4 -0
- package/dist/types/components/Dropins/HighExposureDropin/components/AdditionalFieldsForHighExposureUltimateParentCompany.d.ts +4 -0
- package/dist/types/components/Dropins/HighExposureDropin/components/HighExposureDropinComponent.d.ts +6 -0
- package/dist/types/components/Dropins/HighExposureDropin/types.d.ts +34 -0
- package/dist/types/components/Dropins/HighExposureDropin/validate.d.ts +3 -0
- package/dist/types/components/EmbeddedDropins/OnboardingDropinComponent/OnboardingDropinComponent.d.ts +2 -1
- package/dist/types/components/EmbeddedDropins/UpdateLegalEntityForHighExposure/UpdateLegalEntityForHighExposure.d.ts +2 -0
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/components/internal/DocumentGuidance/DocumentGuidance.d.ts +1 -1
- package/dist/types/components/internal/FormFields/Field/Field.d.ts +5 -3
- package/dist/types/components/internal/IdFieldTypeSelector/countryIdNumberTypes.d.ts +8 -0
- package/dist/types/components/internal/IdFieldTypeSelector/inferTaxIdNumberType.d.ts +4 -1
- package/dist/types/components/internal/TaxId/fieldConfig.d.ts +3 -0
- package/dist/types/core/Context/StateContext/types.d.ts +2 -1
- package/dist/types/core/Services/componentApi/{get-service-agreement-acceptance-info.d.ts → get-service-agreement-acceptance-infos.d.ts} +1 -1
- package/dist/types/core/Services/componentApi/push-events.d.ts +1 -2
- package/dist/types/core/hooks/useAnalytics.d.ts +9 -3
- package/dist/types/core/process-field-configurations.d.ts +2 -0
- package/dist/types/core/user-events.d.ts +4 -8
- package/dist/types/core/utils.d.ts +1 -1
- package/dist/types/utils/api/processValidationErrors.d.ts +4 -1
- package/dist/types/utils/getNestedPropertyKeys.d.ts +1 -1
- package/dist/types/utils/mapping/componentApiMapping.d.ts +8 -0
- package/dist/types/utils/mapping/mapping.d.ts +4 -1
- package/package.json +7 -4
|
@@ -4,9 +4,12 @@ import { sanitize } from "isomorphic-dompurify";
|
|
|
4
4
|
import cx from "classnames";
|
|
5
5
|
import { lazy, Suspense, useId, forwardRef, memo, useMemo as useMemo$1, useEffect as useEffect$1, useState as useState$1 } from "preact/compat";
|
|
6
6
|
import { jsx, jsxs, Fragment } from "preact/jsx-runtime";
|
|
7
|
-
import
|
|
7
|
+
import debounce from "lodash-es/debounce";
|
|
8
8
|
import isISIN from "validator/es/lib/isISIN.js";
|
|
9
9
|
import OpenBankingSDK from "@adyen/openbankingsdk";
|
|
10
|
+
import isEmpty$1 from "lodash-es/isEmpty";
|
|
11
|
+
import noop$1 from "lodash-es/noop";
|
|
12
|
+
import range from "lodash-es/range";
|
|
10
13
|
import { jsxs as jsxs$1, jsx as jsx$1 } from "preact/compat/jsx-runtime";
|
|
11
14
|
import "@adyen/adyen-document-viewer/dist/adyen-document-viewer.min.css";
|
|
12
15
|
import AdyenDocumentViewer from "@adyen/adyen-document-viewer";
|
|
@@ -43,7 +46,8 @@ const payoutAccount = "Payout account";
|
|
|
43
46
|
const payinAccount = "Payin account";
|
|
44
47
|
const firstName = "First name";
|
|
45
48
|
const lastName = "Last name";
|
|
46
|
-
const country = "Country/region
|
|
49
|
+
const country = "Country/region";
|
|
50
|
+
const countryRegionOfEstablishment = "Country/region of establishment";
|
|
47
51
|
const street = "Street";
|
|
48
52
|
const otherAddressInformation = "Other address information (optional)";
|
|
49
53
|
const postalCode = "Postal code";
|
|
@@ -481,6 +485,7 @@ const companyLegalName = "Company legal name";
|
|
|
481
485
|
const companyName = "Company name";
|
|
482
486
|
const companyType = "Company type";
|
|
483
487
|
const taxReferenceNumber = "Tax reference number";
|
|
488
|
+
const taxpayerReferenceNumber = "Taxpayer reference number";
|
|
484
489
|
const SST = "SST";
|
|
485
490
|
const companyProfile = "Company profile";
|
|
486
491
|
const companyNumber = "Company number";
|
|
@@ -580,7 +585,6 @@ const otherTrust = "Other trust";
|
|
|
580
585
|
const pooledSuperannuationTrust = "Pooled superannuation trust";
|
|
581
586
|
const publicTradingTrust = "Public trading trust";
|
|
582
587
|
const unlistedPublicUnitTrust = "Unlisted public unit trust";
|
|
583
|
-
const countryRegionOfEstablishment = "Country/region of establishment";
|
|
584
588
|
const nameOfTrustAgreement = "Name of trust agreement";
|
|
585
589
|
const typeOfTrustAgreement = "Type of trust agreement";
|
|
586
590
|
const objectOfCharitableTrust = "Object of charitable trust";
|
|
@@ -1345,6 +1349,14 @@ const thisPageIsNowInactive = "This page is now inactive";
|
|
|
1345
1349
|
const startANewSessionFromTheSamePlaceYouOriginallyAccessed = "Start a new session from the same place you originally accessed this page.";
|
|
1346
1350
|
const differentCountryOfGoverningLaw = "This company has a different country/region of governing law";
|
|
1347
1351
|
const countryOfGoverningLaw = "Country/region of governing law";
|
|
1352
|
+
const nationalInsuranceNumber = "National Insurance Number (NINO)";
|
|
1353
|
+
const detailsForCapital = "Details for capital";
|
|
1354
|
+
const parentCompany = "Parent company";
|
|
1355
|
+
const ultimateParentCompany = "Ultimate parent company";
|
|
1356
|
+
const numberOfEmployees = "Number of employees";
|
|
1357
|
+
const parentCompanyDetails = "Parent company details";
|
|
1358
|
+
const ultimateParentCompanyDetails = "Ultimate parent company details";
|
|
1359
|
+
const euFinancialRegulationsRequireUs = "EU financial regulations require us to collect this information. This won’t affect your business credit score.";
|
|
1348
1360
|
const defaultTrans = {
|
|
1349
1361
|
smartling,
|
|
1350
1362
|
close,
|
|
@@ -1354,6 +1366,7 @@ const defaultTrans = {
|
|
|
1354
1366
|
firstName,
|
|
1355
1367
|
lastName,
|
|
1356
1368
|
country,
|
|
1369
|
+
countryRegionOfEstablishment,
|
|
1357
1370
|
street,
|
|
1358
1371
|
otherAddressInformation,
|
|
1359
1372
|
postalCode,
|
|
@@ -1791,6 +1804,7 @@ const defaultTrans = {
|
|
|
1791
1804
|
companyName,
|
|
1792
1805
|
companyType,
|
|
1793
1806
|
taxReferenceNumber,
|
|
1807
|
+
taxpayerReferenceNumber,
|
|
1794
1808
|
SST,
|
|
1795
1809
|
companyProfile,
|
|
1796
1810
|
companyNumber,
|
|
@@ -1895,7 +1909,6 @@ const defaultTrans = {
|
|
|
1895
1909
|
pooledSuperannuationTrust,
|
|
1896
1910
|
publicTradingTrust,
|
|
1897
1911
|
unlistedPublicUnitTrust,
|
|
1898
|
-
countryRegionOfEstablishment,
|
|
1899
1912
|
nameOfTrustAgreement,
|
|
1900
1913
|
typeOfTrustAgreement,
|
|
1901
1914
|
objectOfCharitableTrust,
|
|
@@ -2664,7 +2677,15 @@ const defaultTrans = {
|
|
|
2664
2677
|
thisPageIsNowInactive,
|
|
2665
2678
|
startANewSessionFromTheSamePlaceYouOriginallyAccessed,
|
|
2666
2679
|
differentCountryOfGoverningLaw,
|
|
2667
|
-
countryOfGoverningLaw
|
|
2680
|
+
countryOfGoverningLaw,
|
|
2681
|
+
nationalInsuranceNumber,
|
|
2682
|
+
detailsForCapital,
|
|
2683
|
+
parentCompany,
|
|
2684
|
+
ultimateParentCompany,
|
|
2685
|
+
numberOfEmployees,
|
|
2686
|
+
parentCompanyDetails,
|
|
2687
|
+
ultimateParentCompanyDetails,
|
|
2688
|
+
euFinancialRegulationsRequireUs
|
|
2668
2689
|
};
|
|
2669
2690
|
const FALLBACK_LOCALE = "en-US";
|
|
2670
2691
|
const defaultTranslation = Object.entries(defaultTrans).reduce((acc, [translationKey, translationValue]) => translationKey !== "smartling" ? {
|
|
@@ -3106,7 +3127,7 @@ const icons = {
|
|
|
3106
3127
|
warning: lazy(() => import("./warning-99uFf1WU.js")),
|
|
3107
3128
|
wrong: lazy(() => import("./wrong-1wvh7nZe.js"))
|
|
3108
3129
|
};
|
|
3109
|
-
const logger$
|
|
3130
|
+
const logger$z = createLogger("Icon");
|
|
3110
3131
|
const Icon = ({
|
|
3111
3132
|
className,
|
|
3112
3133
|
name,
|
|
@@ -3114,7 +3135,7 @@ const Icon = ({
|
|
|
3114
3135
|
}) => {
|
|
3115
3136
|
const LazyLoadedIcon = icons[name];
|
|
3116
3137
|
if (!LazyLoadedIcon) {
|
|
3117
|
-
logger$
|
|
3138
|
+
logger$z.error(`No such icon: "${name}"`);
|
|
3118
3139
|
return null;
|
|
3119
3140
|
}
|
|
3120
3141
|
return jsx("span", {
|
|
@@ -3330,7 +3351,7 @@ function useFormRouterContext() {
|
|
|
3330
3351
|
}
|
|
3331
3352
|
return context;
|
|
3332
3353
|
}
|
|
3333
|
-
const logger$
|
|
3354
|
+
const logger$y = createLogger("Link");
|
|
3334
3355
|
const getIconClass = (icon, external) => {
|
|
3335
3356
|
if (external) {
|
|
3336
3357
|
return "adyen-kyc-link__icon adyen-kyc-icon-external-link";
|
|
@@ -3342,7 +3363,7 @@ const getIconClass = (icon, external) => {
|
|
|
3342
3363
|
};
|
|
3343
3364
|
const isValidLink = (href) => {
|
|
3344
3365
|
if (href === "#") {
|
|
3345
|
-
logger$
|
|
3366
|
+
logger$y.error('Links must include a valid href. If your href is "#", consider using a Button instead');
|
|
3346
3367
|
return false;
|
|
3347
3368
|
}
|
|
3348
3369
|
return true;
|
|
@@ -3657,7 +3678,7 @@ const useSetting = (settingName) => {
|
|
|
3657
3678
|
} = context;
|
|
3658
3679
|
return getSetting(settingName);
|
|
3659
3680
|
};
|
|
3660
|
-
const logger$
|
|
3681
|
+
const logger$x = createLogger("useAllowedCountries");
|
|
3661
3682
|
const useAllowedCountries = () => {
|
|
3662
3683
|
const acceptedCountries = useSetting("acceptedCountries");
|
|
3663
3684
|
const {
|
|
@@ -3666,7 +3687,7 @@ const useAllowedCountries = () => {
|
|
|
3666
3687
|
const [allowedCountries, setAllowedCountries] = useState(acceptedCountries);
|
|
3667
3688
|
useEffect(() => {
|
|
3668
3689
|
if (acceptedCountries !== void 0) return;
|
|
3669
|
-
getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$
|
|
3690
|
+
getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$x.error);
|
|
3670
3691
|
}, [acceptedCountries]);
|
|
3671
3692
|
return allowedCountries;
|
|
3672
3693
|
};
|
|
@@ -4019,7 +4040,7 @@ function reducer({
|
|
|
4019
4040
|
}
|
|
4020
4041
|
};
|
|
4021
4042
|
}
|
|
4022
|
-
const logger$
|
|
4043
|
+
const logger$w = createLogger("useAsyncValidator");
|
|
4023
4044
|
const useAsyncValidator = (asyncRules) => {
|
|
4024
4045
|
const [asyncValidationResults, setAsyncValidationResults] = useState({});
|
|
4025
4046
|
const clearAsyncValidationResults = useCallback(() => setAsyncValidationResults({}), []);
|
|
@@ -4040,7 +4061,7 @@ const useAsyncValidator = (asyncRules) => {
|
|
|
4040
4061
|
hasError: !isValid
|
|
4041
4062
|
}])
|
|
4042
4063
|
});
|
|
4043
|
-
}).catch(logger$
|
|
4064
|
+
}).catch(logger$w.error);
|
|
4044
4065
|
}, [asyncRules, clearAsyncValidationResults]);
|
|
4045
4066
|
return {
|
|
4046
4067
|
asyncValidationResults,
|
|
@@ -4317,10 +4338,13 @@ const ARIA_ERROR_SUFFIX = "-ariaError";
|
|
|
4317
4338
|
const MaybeLabelElement = ({
|
|
4318
4339
|
children,
|
|
4319
4340
|
...props
|
|
4320
|
-
}) => props.useLabelElement === true ?
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4341
|
+
}) => props.useLabelElement === true ? (
|
|
4342
|
+
// eslint-disable-next-line jsx-a11y/label-has-associated-control
|
|
4343
|
+
jsx("label", {
|
|
4344
|
+
...props,
|
|
4345
|
+
children
|
|
4346
|
+
})
|
|
4347
|
+
) : jsx("div", {
|
|
4324
4348
|
...props,
|
|
4325
4349
|
role: "form",
|
|
4326
4350
|
children
|
|
@@ -5965,7 +5989,7 @@ const deriveInputState = (isValid, isFocused, isDisabled, isOptional, hasNullish
|
|
|
5965
5989
|
};
|
|
5966
5990
|
};
|
|
5967
5991
|
const MISMATCH_ANIMATION_NAME = "mismatchShake";
|
|
5968
|
-
const logger$
|
|
5992
|
+
const logger$v = createLogger("MaskedInputText");
|
|
5969
5993
|
const MaskedInputText = ({
|
|
5970
5994
|
value,
|
|
5971
5995
|
onInput,
|
|
@@ -6006,7 +6030,7 @@ const MaskedInputText = ({
|
|
|
6006
6030
|
};
|
|
6007
6031
|
useEffect(() => {
|
|
6008
6032
|
if (!mask) {
|
|
6009
|
-
logger$
|
|
6033
|
+
logger$v.warn("`mask` is undefined. No masking of input will take place.");
|
|
6010
6034
|
}
|
|
6011
6035
|
}, [mask]);
|
|
6012
6036
|
const getMaskResult = useCallback((pureValue) => {
|
|
@@ -6031,7 +6055,7 @@ const MaskedInputText = ({
|
|
|
6031
6055
|
return;
|
|
6032
6056
|
}
|
|
6033
6057
|
const fallback = displayValueToPure(maskResult.partialDisplayValue);
|
|
6034
|
-
logger$
|
|
6058
|
+
logger$v.warn(`Value received "${value}" does not match mask`, maskResult, `
|
|
6035
6059
|
Falling back to partially valid value "${fallback}"`);
|
|
6036
6060
|
onInput(fallback);
|
|
6037
6061
|
}
|
|
@@ -6311,6 +6335,14 @@ const taxIdNumberOptions = {
|
|
|
6311
6335
|
}, {
|
|
6312
6336
|
id: "uen",
|
|
6313
6337
|
name: "uen"
|
|
6338
|
+
}],
|
|
6339
|
+
[CountryCodes.Jersey]: [{
|
|
6340
|
+
id: "taxIdentificationNumber",
|
|
6341
|
+
name: "taxIdentificationNumber"
|
|
6342
|
+
}, {
|
|
6343
|
+
id: "socialSecurityNumber",
|
|
6344
|
+
name: "socialSecurityNumber",
|
|
6345
|
+
applicableOnlyFor: [CompanyTypesValue.SOLE_PROPRIETORSHIP]
|
|
6314
6346
|
}]
|
|
6315
6347
|
};
|
|
6316
6348
|
const getTaxIdNumberOptions = (country2, companyType2) => {
|
|
@@ -8072,6 +8104,136 @@ const defaultFieldConfig$7 = {
|
|
|
8072
8104
|
}
|
|
8073
8105
|
}
|
|
8074
8106
|
},
|
|
8107
|
+
[CountryCodes.Guernsey]: ({
|
|
8108
|
+
companyType: companyType2
|
|
8109
|
+
}) => {
|
|
8110
|
+
switch (companyType2) {
|
|
8111
|
+
case CompanyTypesValue.SOLE_PROPRIETORSHIP:
|
|
8112
|
+
return {
|
|
8113
|
+
label: "nationalInsuranceNumber",
|
|
8114
|
+
validators: validatePatternOnBlur(/^GY\d{6}[A-D]$/),
|
|
8115
|
+
mask: {
|
|
8116
|
+
mask: makeMask(...nonInputs("GY", {
|
|
8117
|
+
includeInValue: true
|
|
8118
|
+
}), spacer, ...numericInputs(2), spacer, ...numericInputs(2), spacer, ...numericInputs(2), spacer, {
|
|
8119
|
+
type: "input",
|
|
8120
|
+
allow: /[A-D]/
|
|
8121
|
+
}),
|
|
8122
|
+
transformOnType: uppercase
|
|
8123
|
+
},
|
|
8124
|
+
guidanceText: {
|
|
8125
|
+
key: "enterTheRemainingNCharactersForExample",
|
|
8126
|
+
values: {
|
|
8127
|
+
numChars: "7",
|
|
8128
|
+
example: "GY 12 34 56 A"
|
|
8129
|
+
}
|
|
8130
|
+
}
|
|
8131
|
+
};
|
|
8132
|
+
default:
|
|
8133
|
+
return {
|
|
8134
|
+
label: "registrationNumber",
|
|
8135
|
+
mask: businessRegistrationNumberMasks[CountryCodes.Guernsey].default,
|
|
8136
|
+
validators: validatePatternOnBlur(businessRegistrationNumberPatterns[CountryCodes.Guernsey].default),
|
|
8137
|
+
guidanceText: {
|
|
8138
|
+
key: "enterAMaximumOfNDigitsForExample",
|
|
8139
|
+
values: {
|
|
8140
|
+
maxDigits: "9",
|
|
8141
|
+
example: "123456"
|
|
8142
|
+
}
|
|
8143
|
+
}
|
|
8144
|
+
};
|
|
8145
|
+
}
|
|
8146
|
+
},
|
|
8147
|
+
[CountryCodes.Jersey]: ({
|
|
8148
|
+
taxIdNumberType,
|
|
8149
|
+
companyType: companyType2
|
|
8150
|
+
}) => {
|
|
8151
|
+
switch (taxIdNumberType) {
|
|
8152
|
+
case "socialSecurityNumber":
|
|
8153
|
+
return {
|
|
8154
|
+
label: "socialSecurityNumber",
|
|
8155
|
+
validators: validatePatternOnBlur(/^[A-Z]{2}\d{6}[A-Z]$/),
|
|
8156
|
+
mask: {
|
|
8157
|
+
mask: makeMask(...alphaInputs(2), ...numericInputs(6), ...alphaInputs(1)),
|
|
8158
|
+
transformOnType: uppercase
|
|
8159
|
+
},
|
|
8160
|
+
guidanceText: {
|
|
8161
|
+
key: "enterNCharactersForExample",
|
|
8162
|
+
values: {
|
|
8163
|
+
numChars: "9",
|
|
8164
|
+
example: "JY000000A"
|
|
8165
|
+
}
|
|
8166
|
+
}
|
|
8167
|
+
};
|
|
8168
|
+
case "taxIdentificationNumber":
|
|
8169
|
+
default:
|
|
8170
|
+
switch (companyType2) {
|
|
8171
|
+
case CompanyTypesValue.SOLE_PROPRIETORSHIP:
|
|
8172
|
+
return {
|
|
8173
|
+
label: "taxIdentificationNumber",
|
|
8174
|
+
validators: validatePatternOnBlur(/^\d{10}$/),
|
|
8175
|
+
mask: {
|
|
8176
|
+
mask: makeMask(...numericInputs(3), ...nonInputs(" - "), ...numericInputs(3), ...nonInputs(" - "), ...numericInputs(4))
|
|
8177
|
+
},
|
|
8178
|
+
guidanceText: {
|
|
8179
|
+
key: "enterNDigitsForExample",
|
|
8180
|
+
values: {
|
|
8181
|
+
numDigits: "10",
|
|
8182
|
+
example: "100-100-1000"
|
|
8183
|
+
}
|
|
8184
|
+
}
|
|
8185
|
+
};
|
|
8186
|
+
default:
|
|
8187
|
+
return {
|
|
8188
|
+
label: "taxIdentificationNumber",
|
|
8189
|
+
validators: validatePatternOnBlur(/^[A-Z]{2}\d{5}$/),
|
|
8190
|
+
mask: {
|
|
8191
|
+
mask: makeMask(...alphaInputs(2), ...numericInputs(5)),
|
|
8192
|
+
transformOnType: uppercase
|
|
8193
|
+
},
|
|
8194
|
+
guidanceText: {
|
|
8195
|
+
key: "enterNCharactersForExample",
|
|
8196
|
+
values: {
|
|
8197
|
+
numChars: "7",
|
|
8198
|
+
example: "CC17261"
|
|
8199
|
+
}
|
|
8200
|
+
}
|
|
8201
|
+
};
|
|
8202
|
+
}
|
|
8203
|
+
}
|
|
8204
|
+
},
|
|
8205
|
+
[CountryCodes.IsleOfMan]: {
|
|
8206
|
+
label: "taxReferenceNumber",
|
|
8207
|
+
validators: validatePatternOnBlur(/^[HCX]\d{8}$/),
|
|
8208
|
+
mask: {
|
|
8209
|
+
mask: makeMask({
|
|
8210
|
+
type: "input",
|
|
8211
|
+
allow: /[HCX]/
|
|
8212
|
+
}, ...numericInputs(6), ...nonInputs(" - "), ...numericInputs(2)),
|
|
8213
|
+
transformOnType: uppercase
|
|
8214
|
+
},
|
|
8215
|
+
guidanceText: {
|
|
8216
|
+
key: "enterNCharactersForExample",
|
|
8217
|
+
values: {
|
|
8218
|
+
numChars: "9",
|
|
8219
|
+
example: "C155673-79"
|
|
8220
|
+
}
|
|
8221
|
+
}
|
|
8222
|
+
},
|
|
8223
|
+
[CountryCodes.Gibraltar]: {
|
|
8224
|
+
label: "taxpayerReferenceNumber",
|
|
8225
|
+
validators: validatePatternOnBlur(/^\d{1,7}$/),
|
|
8226
|
+
mask: {
|
|
8227
|
+
mask: makeMask(...numericInputs(1), ...numericInputs(6, true))
|
|
8228
|
+
},
|
|
8229
|
+
guidanceText: {
|
|
8230
|
+
key: "enterAMaximumOfNDigitsForExample",
|
|
8231
|
+
values: {
|
|
8232
|
+
maxDigits: "7",
|
|
8233
|
+
example: "123456"
|
|
8234
|
+
}
|
|
8235
|
+
}
|
|
8236
|
+
},
|
|
8075
8237
|
/**
|
|
8076
8238
|
* NOT YET SUPPORTED
|
|
8077
8239
|
* These are brought over from the old pattern files. We have no idea if they are accurate or not.
|
|
@@ -8721,14 +8883,15 @@ const defaultFieldConfig$6 = {
|
|
|
8721
8883
|
validators: validatePatternOnBlur(/^[JGVE]-\d{8}-?\d$/)
|
|
8722
8884
|
}
|
|
8723
8885
|
};
|
|
8724
|
-
const inferTaxIdNumberType = (taxId2, country2) => {
|
|
8886
|
+
const inferTaxIdNumberType = (taxId2, country2, companyType2) => {
|
|
8725
8887
|
const optionsForCountry = taxIdNumberOptions[country2];
|
|
8726
8888
|
const metadataFn = defaultFieldConfig$6[country2] ?? defaultFieldConfig$7[country2];
|
|
8727
8889
|
if (!optionsForCountry || !metadataFn || typeof metadataFn !== "function") return void 0;
|
|
8728
8890
|
for (const option of optionsForCountry) {
|
|
8729
8891
|
const fieldMetadata = metadataFn({
|
|
8730
8892
|
taxIdNumberType: option.id,
|
|
8731
|
-
vatNumberType: option.id
|
|
8893
|
+
vatNumberType: option.id,
|
|
8894
|
+
companyType: companyType2
|
|
8732
8895
|
});
|
|
8733
8896
|
if (!fieldMetadata.validators) continue;
|
|
8734
8897
|
const validators = Array.isArray(fieldMetadata.validators) ? fieldMetadata.validators : [fieldMetadata.validators];
|
|
@@ -8795,10 +8958,11 @@ function TaxId(props) {
|
|
|
8795
8958
|
fieldConfig = defaultFieldConfig$7
|
|
8796
8959
|
} = props;
|
|
8797
8960
|
const existingTaxId = propData == null ? void 0 : propData.taxId;
|
|
8798
|
-
const defaultTaxIdNumberType = existingTaxId ? inferTaxIdNumberType(existingTaxId, country2) : (_a = getTaxIdNumberOptions(country2, companyType2)) == null ? void 0 : _a[0].id;
|
|
8961
|
+
const defaultTaxIdNumberType = existingTaxId ? inferTaxIdNumberType(existingTaxId, country2, companyType2) : (_a = getTaxIdNumberOptions(country2, companyType2)) == null ? void 0 : _a[0].id;
|
|
8799
8962
|
const [taxIdNumberType, setTaxIdNumberType] = useState(defaultTaxIdNumberType);
|
|
8800
8963
|
const metadata = resolveFieldMetadata(fieldConfig[country2], {
|
|
8801
|
-
taxIdNumberType
|
|
8964
|
+
taxIdNumberType,
|
|
8965
|
+
companyType: companyType2
|
|
8802
8966
|
}, defaultFieldMetadata$7);
|
|
8803
8967
|
const mergedProps = mergeFieldMetadataIntoProps("taxId", metadata, props);
|
|
8804
8968
|
const {
|
|
@@ -8978,7 +9142,7 @@ function VatNumber(props) {
|
|
|
8978
9142
|
name: VatAbsenceReason.CountryWithoutVatOrGstSystem
|
|
8979
9143
|
}]);
|
|
8980
9144
|
const existingTaxId = propData == null ? void 0 : propData.vatNumber;
|
|
8981
|
-
const defaultTaxIdNumberType = existingTaxId ? inferTaxIdNumberType(existingTaxId, country2) : (_a = taxIdNumberOptions[country2]) == null ? void 0 : _a[0].id;
|
|
9145
|
+
const defaultTaxIdNumberType = existingTaxId ? inferTaxIdNumberType(existingTaxId, country2, void 0) : (_a = taxIdNumberOptions[country2]) == null ? void 0 : _a[0].id;
|
|
8982
9146
|
const [taxIdNumberType, setTaxIdNumberType] = useState(defaultTaxIdNumberType);
|
|
8983
9147
|
const metadata = resolveFieldMetadata(fieldConfig[country2], {
|
|
8984
9148
|
vatNumberType: taxIdNumberType
|
|
@@ -10287,7 +10451,7 @@ var VerificationStatus = /* @__PURE__ */ ((VerificationStatus2) => {
|
|
|
10287
10451
|
VerificationStatus2["REJECTED"] = "rejected";
|
|
10288
10452
|
return VerificationStatus2;
|
|
10289
10453
|
})(VerificationStatus || {});
|
|
10290
|
-
function getNestedPropertyKeys(obj, includeUndefined = false) {
|
|
10454
|
+
function getNestedPropertyKeys(obj, includeUndefined = false, includeFalsy = true) {
|
|
10291
10455
|
const fieldNames = [];
|
|
10292
10456
|
Object.entries(obj).forEach(([key, value]) => {
|
|
10293
10457
|
if (typeof value === "object" && value !== null) {
|
|
@@ -10295,7 +10459,7 @@ function getNestedPropertyKeys(obj, includeUndefined = false) {
|
|
|
10295
10459
|
fieldNames.push(...nested);
|
|
10296
10460
|
return;
|
|
10297
10461
|
}
|
|
10298
|
-
if (value !== void 0 || includeUndefined) {
|
|
10462
|
+
if ((value !== void 0 || includeUndefined) && (value || !includeFalsy)) {
|
|
10299
10463
|
fieldNames.push(key);
|
|
10300
10464
|
}
|
|
10301
10465
|
});
|
|
@@ -10336,8 +10500,10 @@ function isEmptyEntity(legalEntity) {
|
|
|
10336
10500
|
const minimumFields = emptyFieldsByEntityType[type];
|
|
10337
10501
|
const typeSpecificSection = legalEntity[type];
|
|
10338
10502
|
if (!typeSpecificSection) return true;
|
|
10339
|
-
const fieldsOnEntity = getNestedPropertyKeys(typeSpecificSection);
|
|
10340
|
-
|
|
10503
|
+
const fieldsOnEntity = getNestedPropertyKeys(typeSpecificSection, false, false);
|
|
10504
|
+
const sortedMinimumFields = minimumFields.toSorted();
|
|
10505
|
+
const sortedFieldsOnEntity = fieldsOnEntity.toSorted();
|
|
10506
|
+
return sortedFieldsOnEntity.every((value, index) => value === sortedMinimumFields[index]);
|
|
10341
10507
|
}
|
|
10342
10508
|
const capabilitiesToPreventTypeChange = ["receivePayments", "issueCard", "useCard", "withdrawFromAtm", "withdrawFromAtmInRestrictedCountries", "receiveFromTransferInstrument", "useCardInRestrictedCountries", "useCardInRestrictedIndustries", "issueBankAccount", "sendToThirdParty", "receiveFromThirdParty", "getGrantOffers", "receiveGrants"];
|
|
10343
10509
|
const entityTypeToCorrespondingAccountHolderOption = {
|
|
@@ -10489,7 +10655,7 @@ const accountHolderValidationRules = {
|
|
|
10489
10655
|
}
|
|
10490
10656
|
};
|
|
10491
10657
|
const accountHolderFields = ["accountHolder"];
|
|
10492
|
-
const logger$
|
|
10658
|
+
const logger$u = createLogger("AccountHolder");
|
|
10493
10659
|
function getAvailableAccountHolderOptions(legalEntityType, isChangeOfLegalEntityTypeAllowed, isTrustFlowEnabled, isSoleProprietorshipAllowed, isChangeToMyNameAllowed) {
|
|
10494
10660
|
switch (legalEntityType) {
|
|
10495
10661
|
case LegalEntityType.ORGANIZATION: {
|
|
@@ -10499,7 +10665,7 @@ function getAvailableAccountHolderOptions(legalEntityType, isChangeOfLegalEntity
|
|
|
10499
10665
|
return [...isChangeToMyNameAllowed ? ["myName"] : [], ...isChangeOfLegalEntityTypeAllowed ? ["theCompanyIWorkFor"] : [], ...isTrustFlowEnabled ? ["aTrust"] : [], ...isSoleProprietorshipAllowed ? ["mySoleProprietorName"] : []];
|
|
10500
10666
|
}
|
|
10501
10667
|
default:
|
|
10502
|
-
logger$
|
|
10668
|
+
logger$u.error(`No available account holder options for legal entity type '${legalEntityType}'`);
|
|
10503
10669
|
return [];
|
|
10504
10670
|
}
|
|
10505
10671
|
}
|
|
@@ -10741,7 +10907,7 @@ function DocumentGuidance({
|
|
|
10741
10907
|
className: cx("adyen-kyc-document-guidance", className),
|
|
10742
10908
|
children: jsx("div", {
|
|
10743
10909
|
className: "adyen-kyc-document-guidance__container",
|
|
10744
|
-
children: documentGuidanceItems.map((item) => jsxs("
|
|
10910
|
+
children: documentGuidanceItems.map((item) => jsxs("figure", {
|
|
10745
10911
|
className: "adyen-kyc-document-guidance__item",
|
|
10746
10912
|
children: [jsx("svg", {
|
|
10747
10913
|
width: "100%",
|
|
@@ -10750,7 +10916,7 @@ function DocumentGuidance({
|
|
|
10750
10916
|
children: jsx("use", {
|
|
10751
10917
|
href: `#adyen-kyc-${guidancePrefix}-${item.type}`
|
|
10752
10918
|
})
|
|
10753
|
-
}), jsx("
|
|
10919
|
+
}), jsx("figcaption", {
|
|
10754
10920
|
className: "adyen-kyc-document-guidance__description",
|
|
10755
10921
|
children: i18n.get(item.translationKey)
|
|
10756
10922
|
})]
|
|
@@ -11059,7 +11225,7 @@ function Dropzone(props) {
|
|
|
11059
11225
|
})]
|
|
11060
11226
|
});
|
|
11061
11227
|
}
|
|
11062
|
-
const logger$
|
|
11228
|
+
const logger$t = createLogger("TextArea");
|
|
11063
11229
|
function TextArea(props) {
|
|
11064
11230
|
const {
|
|
11065
11231
|
classNameModifiers,
|
|
@@ -11080,7 +11246,7 @@ function TextArea(props) {
|
|
|
11080
11246
|
} = useI18nContext();
|
|
11081
11247
|
const [value, setValue] = useState("");
|
|
11082
11248
|
if (Object.prototype.hasOwnProperty.call(props, "onChange")) {
|
|
11083
|
-
logger$
|
|
11249
|
+
logger$t.error("Error: Form fields that rely on InputBase may not have an onChange property");
|
|
11084
11250
|
}
|
|
11085
11251
|
const handleInput = (e) => {
|
|
11086
11252
|
var _a;
|
|
@@ -11523,7 +11689,7 @@ function useIsElementVisible(ref, fallback = true) {
|
|
|
11523
11689
|
}, [ref]);
|
|
11524
11690
|
return isOnScreen;
|
|
11525
11691
|
}
|
|
11526
|
-
const logger$
|
|
11692
|
+
const logger$s = createLogger("SearchAddress");
|
|
11527
11693
|
const SearchAddress = ({
|
|
11528
11694
|
data,
|
|
11529
11695
|
legalEntityId,
|
|
@@ -11566,7 +11732,7 @@ const SearchAddress = ({
|
|
|
11566
11732
|
const response = await handleFindAddress(selectedAddressId);
|
|
11567
11733
|
autocompleteAddressForm(response);
|
|
11568
11734
|
} catch (e) {
|
|
11569
|
-
logger$
|
|
11735
|
+
logger$s.error(e);
|
|
11570
11736
|
}
|
|
11571
11737
|
};
|
|
11572
11738
|
const onDrilldown = async (selectedAddress) => {
|
|
@@ -11578,7 +11744,7 @@ const SearchAddress = ({
|
|
|
11578
11744
|
}, legalEntityId);
|
|
11579
11745
|
setItems((response == null ? void 0 : response.results) || []);
|
|
11580
11746
|
} catch (e) {
|
|
11581
|
-
logger$
|
|
11747
|
+
logger$s.error(e);
|
|
11582
11748
|
}
|
|
11583
11749
|
};
|
|
11584
11750
|
const onChange = (e) => {
|
|
@@ -11633,7 +11799,7 @@ const SearchAddress = ({
|
|
|
11633
11799
|
setItems([]);
|
|
11634
11800
|
}
|
|
11635
11801
|
} catch (e) {
|
|
11636
|
-
logger$
|
|
11802
|
+
logger$s.error(e);
|
|
11637
11803
|
}
|
|
11638
11804
|
setLoading(false);
|
|
11639
11805
|
}
|
|
@@ -13028,7 +13194,7 @@ const COUNTRIES_THAT_DONT_REQUIRE_SOLE_PROP_REGISTRATION = [CountryCodes.Austral
|
|
|
13028
13194
|
const COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION = [CountryCodes.PuertoRico, CountryCodes.UnitedStates];
|
|
13029
13195
|
const COUNTRIES_WITH_POSSIBLE_REGISTRATION_EXEMPTIONS_FOR_SOLE_PROPS = [CountryCodes.Austria, CountryCodes.Canada, CountryCodes.Finland, CountryCodes.Germany, CountryCodes.Lithuania, CountryCodes.Luxembourg, CountryCodes.Poland, CountryCodes.Sweden, CountryCodes.Switzerland];
|
|
13030
13196
|
const COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER = [CountryCodes.PuertoRico, CountryCodes.UnitedStates];
|
|
13031
|
-
const COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT = [CountryCodes.Australia, CountryCodes.Canada, CountryCodes.Gibraltar, CountryCodes.HongKong, CountryCodes.NewZealand, CountryCodes.PuertoRico, CountryCodes.Singapore, CountryCodes.UnitedStates];
|
|
13197
|
+
const COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT = [CountryCodes.Australia, CountryCodes.Canada, CountryCodes.Gibraltar, CountryCodes.HongKong, CountryCodes.NewZealand, CountryCodes.PuertoRico, CountryCodes.Singapore, CountryCodes.UnitedStates, CountryCodes.Guernsey, CountryCodes.Jersey, CountryCodes.IsleOfMan];
|
|
13032
13198
|
const COUNTRIES_THAT_DO_NOT_USE_TAX_ID_FOR_SOLE_PROP = [CountryCodes.NewZealand, CountryCodes.Singapore];
|
|
13033
13199
|
const COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_COMPANIES = [
|
|
13034
13200
|
// strictly a subset of countries which use tax ID
|
|
@@ -13324,7 +13490,8 @@ const mandatoryApiFields = {
|
|
|
13324
13490
|
DECISION_MAKER_OWNER: ["personalDetails.firstName", "personalDetails.lastName", "personalDetails.residencyCountry", "personalDetails.role"],
|
|
13325
13491
|
ORGANIZATION: ["companyNameAndCountry.legalCompanyName", "companyNameAndCountry.country"],
|
|
13326
13492
|
SOLE_PROPRIETORSHIP: ["solePropNameAndCountry.legalCompanyName", "solePropNameAndCountry.country"],
|
|
13327
|
-
TRUST: ["trustRegistrationDetails.legalName", "trustRegistrationDetails.country"]
|
|
13493
|
+
TRUST: ["trustRegistrationDetails.legalName", "trustRegistrationDetails.country"],
|
|
13494
|
+
HIGH_EXPOSURE: ["company.numberOfEmployees", "parentCompany.numberOfEmployees", "ultimateParentCompany.numberOfEmployees"]
|
|
13328
13495
|
};
|
|
13329
13496
|
const individualObscuredFields = ["personalDetails.idNumber", "personalDetails.idNumberExempt"];
|
|
13330
13497
|
const individualBaseMapping = {
|
|
@@ -13496,6 +13663,11 @@ const solePropBaseMapping = {
|
|
|
13496
13663
|
"solePropRegistrationAddress.operationalAddress.address": "soleProprietorship.principalPlaceOfBusiness.street",
|
|
13497
13664
|
"solePropRegistrationAddress.operationalAddress.otherAddressInformation": "soleProprietorship.principalPlaceOfBusiness.street2"
|
|
13498
13665
|
};
|
|
13666
|
+
const highExposureBaseMapping = {
|
|
13667
|
+
"company.numberOfEmployees": "company.numberOfEmployees",
|
|
13668
|
+
"parentCompany.numberOfEmployees": "parentCompany.numberOfEmployees",
|
|
13669
|
+
"ultimateParentCompany.numberOfEmployees": "ultimateParentCompany.numberOfEmployees"
|
|
13670
|
+
};
|
|
13499
13671
|
const businessDetailsComponentsKeyMapping = {
|
|
13500
13672
|
"additionalInformation.exemptedFromVat": "organization.vatAbsenceReason",
|
|
13501
13673
|
...businessDetailsBaseMapping
|
|
@@ -13529,6 +13701,12 @@ const trustComponentsKeyMapping = {
|
|
|
13529
13701
|
const trustApiKeyMapping = {
|
|
13530
13702
|
...reverseObject(trustBaseMapping)
|
|
13531
13703
|
};
|
|
13704
|
+
const highExposureComponentsKeyMapping = {
|
|
13705
|
+
...highExposureBaseMapping
|
|
13706
|
+
};
|
|
13707
|
+
const highExposureApiKeyMapping = {
|
|
13708
|
+
...reverseObject(highExposureBaseMapping)
|
|
13709
|
+
};
|
|
13532
13710
|
const solePropComponentsKeyMapping = {
|
|
13533
13711
|
"solePropRegistrationDetails.exemptedFromVat": "soleProprietorship.vatAbsenceReason",
|
|
13534
13712
|
...solePropBaseMapping
|
|
@@ -13868,6 +14046,10 @@ const mapTrustToLegalEntity = (data) => {
|
|
|
13868
14046
|
requestObj.type = LegalEntityType.TRUST;
|
|
13869
14047
|
return requestObj;
|
|
13870
14048
|
};
|
|
14049
|
+
const mapLegalEntityToHighExposure = (legalEntity) => formatObject(legalEntity, highExposureComponentsKeyMapping);
|
|
14050
|
+
const mapHighExposureToLegalEntity = (data) => ({
|
|
14051
|
+
...formatObject(data, highExposureApiKeyMapping)
|
|
14052
|
+
});
|
|
13871
14053
|
const mapLegalEntityToSoleProp = (legalEntity) => {
|
|
13872
14054
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
13873
14055
|
let solePropCompData;
|
|
@@ -13911,8 +14093,8 @@ const mapLegalEntityToSoleProp = (legalEntity) => {
|
|
|
13911
14093
|
}
|
|
13912
14094
|
return solePropCompData;
|
|
13913
14095
|
};
|
|
13914
|
-
const mapSolePropToLegalEntity = (data
|
|
13915
|
-
var _a;
|
|
14096
|
+
const mapSolePropToLegalEntity = (data) => {
|
|
14097
|
+
var _a, _b;
|
|
13916
14098
|
const requestObj = {
|
|
13917
14099
|
...formatObject(data, solePropApiKeyMapping)
|
|
13918
14100
|
};
|
|
@@ -13931,7 +14113,7 @@ const mapSolePropToLegalEntity = (data, isCountryOfGoverningLawEnabled = false)
|
|
|
13931
14113
|
if (data.solePropRegistrationDetails.exemptedFromRegistrationNumber) {
|
|
13932
14114
|
requestObj.soleProprietorship.registrationNumber = "";
|
|
13933
14115
|
}
|
|
13934
|
-
if (!
|
|
14116
|
+
if (!((_a = requestObj.soleProprietorship) == null ? void 0 : _a.countryOfGoverningLaw) && ((_b = data.solePropNameAndCountry) == null ? void 0 : _b.country)) {
|
|
13935
14117
|
requestObj.soleProprietorship.countryOfGoverningLaw = data.solePropNameAndCountry.country;
|
|
13936
14118
|
}
|
|
13937
14119
|
requestObj.type = LegalEntityType.SOLE_PROPRIETORSHIP;
|
|
@@ -14485,7 +14667,7 @@ const initOnfido = async ({
|
|
|
14485
14667
|
language: getOnfidoLocaleConfig(i18n)
|
|
14486
14668
|
});
|
|
14487
14669
|
};
|
|
14488
|
-
const logger$
|
|
14670
|
+
const logger$r = createLogger("IdVerificationComponent");
|
|
14489
14671
|
function IdVerificationComponent({
|
|
14490
14672
|
userDetails,
|
|
14491
14673
|
legalEntityId,
|
|
@@ -14517,7 +14699,7 @@ function IdVerificationComponent({
|
|
|
14517
14699
|
onIdVerificationError,
|
|
14518
14700
|
onIdVerificationComplete
|
|
14519
14701
|
});
|
|
14520
|
-
})().catch(logger$
|
|
14702
|
+
})().catch(logger$r.error);
|
|
14521
14703
|
return () => {
|
|
14522
14704
|
if (onfidoSdk.current) onfidoSdk.current.tearDown();
|
|
14523
14705
|
};
|
|
@@ -14567,7 +14749,7 @@ function IdDocumentAlreadyUpload(props) {
|
|
|
14567
14749
|
})]
|
|
14568
14750
|
});
|
|
14569
14751
|
}
|
|
14570
|
-
const logger$
|
|
14752
|
+
const logger$q = createLogger("IdDocumentInstantVerificationComponent");
|
|
14571
14753
|
const idVerificationSchema = ["instantIdVerificationData", "idDocumentType"];
|
|
14572
14754
|
const documentTypeValidationRules = {
|
|
14573
14755
|
instantIdVerificationData: {
|
|
@@ -14649,7 +14831,7 @@ function IdDocumentInstantVerificationComponent(props) {
|
|
|
14649
14831
|
userDetails: props.userDetails,
|
|
14650
14832
|
legalEntityId: props.legalEntityId,
|
|
14651
14833
|
onIdVerificationComplete: handleIdVerificationComplete,
|
|
14652
|
-
onIdVerificationError: logger$
|
|
14834
|
+
onIdVerificationError: logger$q.error
|
|
14653
14835
|
}), jsxs("div", {
|
|
14654
14836
|
className: "adyen-kyc-document-upload__manual-upload",
|
|
14655
14837
|
children: [i18n.get("canNotCompleteInstantVerification"), " ", jsx("button", {
|
|
@@ -18093,7 +18275,7 @@ class AdyenKycSdkError extends Error {
|
|
|
18093
18275
|
}
|
|
18094
18276
|
let sdkToken;
|
|
18095
18277
|
let fetchSdkToken;
|
|
18096
|
-
const logger$
|
|
18278
|
+
const logger$p = createLogger("Session");
|
|
18097
18279
|
const setSdkToken = (token) => {
|
|
18098
18280
|
sdkToken = token;
|
|
18099
18281
|
};
|
|
@@ -18116,7 +18298,7 @@ const refreshSession = async () => {
|
|
|
18116
18298
|
setSdkToken(token);
|
|
18117
18299
|
isSessionRefreshed = true;
|
|
18118
18300
|
} catch (e) {
|
|
18119
|
-
logger$
|
|
18301
|
+
logger$p.error("Failed to fetch sdk token", e);
|
|
18120
18302
|
}
|
|
18121
18303
|
return isSessionRefreshed;
|
|
18122
18304
|
};
|
|
@@ -18126,7 +18308,7 @@ const addAnimationStartListener = (element, listener) => {
|
|
|
18126
18308
|
const removeAnimationStartListener = (element, listener) => {
|
|
18127
18309
|
element.removeEventListener("animationstart", listener, false);
|
|
18128
18310
|
};
|
|
18129
|
-
const logger$
|
|
18311
|
+
const logger$o = createLogger("Fetch");
|
|
18130
18312
|
const getRequestObject = (options, data) => {
|
|
18131
18313
|
const {
|
|
18132
18314
|
headers = [],
|
|
@@ -18173,10 +18355,10 @@ const logFetchError = (message, level) => {
|
|
|
18173
18355
|
case "info":
|
|
18174
18356
|
case "warn":
|
|
18175
18357
|
case "error":
|
|
18176
|
-
logger$
|
|
18358
|
+
logger$o[level](message);
|
|
18177
18359
|
break;
|
|
18178
18360
|
default:
|
|
18179
|
-
logger$
|
|
18361
|
+
logger$o.error(message);
|
|
18180
18362
|
}
|
|
18181
18363
|
};
|
|
18182
18364
|
const handleFetchResponse = async (response, responseType) => {
|
|
@@ -18274,7 +18456,7 @@ const RELEVANT_MESSAGE_TYPES = ["account_verification_report_id", "error"];
|
|
|
18274
18456
|
const TERMINAL_DATA_PROPS = ["accounts", "error", "reference"];
|
|
18275
18457
|
const MOUNT_TIMEOUT = 10 * 1e3;
|
|
18276
18458
|
const TINK_VENDOR = "Tink";
|
|
18277
|
-
const logger$
|
|
18459
|
+
const logger$n = createLogger("iframeWidget");
|
|
18278
18460
|
const isObjectData = (data) => typeof data === "object" && !Array.isArray(data) && data !== null;
|
|
18279
18461
|
const isTerminalMessageData = (data) => isObjectData(data) && Object.entries(data).some(([prop]) => TERMINAL_DATA_PROPS.includes(prop));
|
|
18280
18462
|
const parseMessageJson = (message) => {
|
|
@@ -18292,7 +18474,7 @@ const callbackErrorHandler = async (response) => {
|
|
|
18292
18474
|
try {
|
|
18293
18475
|
await response;
|
|
18294
18476
|
} catch (ex) {
|
|
18295
|
-
logger$
|
|
18477
|
+
logger$n.error(ex);
|
|
18296
18478
|
}
|
|
18297
18479
|
return {
|
|
18298
18480
|
error: "UNKNOWN_ERROR",
|
|
@@ -18395,7 +18577,7 @@ class IFrameWidget {
|
|
|
18395
18577
|
message = responseData.errorMessage;
|
|
18396
18578
|
}
|
|
18397
18579
|
} catch (ex) {
|
|
18398
|
-
logger$
|
|
18580
|
+
logger$n.error(ex);
|
|
18399
18581
|
}
|
|
18400
18582
|
throw new AdyenKycSdkError(reason, jsonData.error);
|
|
18401
18583
|
}
|
|
@@ -18582,7 +18764,7 @@ function BankVerificationWidget({
|
|
|
18582
18764
|
ref: widgetContainerRef
|
|
18583
18765
|
});
|
|
18584
18766
|
}
|
|
18585
|
-
const logger$
|
|
18767
|
+
const logger$m = createLogger("BankVerification");
|
|
18586
18768
|
const accountVerificationFields = ["verifiedAccountHolder", "verifiedBankCountry", "verifiedBankName", "verifiedCurrencyCode", "verifiedBankAccountNumber"];
|
|
18587
18769
|
const InstantVerificationErrorContext = createContext(null);
|
|
18588
18770
|
const useInstantVerificationErrorNotification = (notificationVisibilityDuration) => {
|
|
@@ -18614,7 +18796,7 @@ const usePreferredVendorForCountry = (country2, getBankVerificationVendors) => {
|
|
|
18614
18796
|
const vendor = vendors[0];
|
|
18615
18797
|
setPreferredVendor(vendor.name ? vendor : void 0);
|
|
18616
18798
|
};
|
|
18617
|
-
getPreferredVendor().catch(logger$
|
|
18799
|
+
getPreferredVendor().catch(logger$m.error);
|
|
18618
18800
|
}, [country2, getBankVerificationVendors]);
|
|
18619
18801
|
return preferredVendor;
|
|
18620
18802
|
};
|
|
@@ -21115,6 +21297,7 @@ function TrustComponent(props) {
|
|
|
21115
21297
|
const trustDocumentFormProps = getFormProps(props, trustConstitutionalDocumentFormId);
|
|
21116
21298
|
const handleStateChange = () => {
|
|
21117
21299
|
};
|
|
21300
|
+
console.log("trustRegistrationDetailsFormProps", trustRegistrationDetailsFormProps);
|
|
21118
21301
|
const renderActiveForm = (activeForm) => jsxs("div", {
|
|
21119
21302
|
className: "adyen-kyc-trust",
|
|
21120
21303
|
children: [jsx(StateContextWatcher, {
|
|
@@ -21841,6 +22024,55 @@ function ErrorPanel({
|
|
|
21841
22024
|
})]
|
|
21842
22025
|
});
|
|
21843
22026
|
}
|
|
22027
|
+
const headingTypes = {
|
|
22028
|
+
1: ({
|
|
22029
|
+
children,
|
|
22030
|
+
className
|
|
22031
|
+
}) => jsx("h1", {
|
|
22032
|
+
className,
|
|
22033
|
+
children
|
|
22034
|
+
}),
|
|
22035
|
+
2: ({
|
|
22036
|
+
children,
|
|
22037
|
+
className
|
|
22038
|
+
}) => jsx("h2", {
|
|
22039
|
+
className,
|
|
22040
|
+
children
|
|
22041
|
+
}),
|
|
22042
|
+
3: ({
|
|
22043
|
+
children,
|
|
22044
|
+
className
|
|
22045
|
+
}) => jsx("h3", {
|
|
22046
|
+
className,
|
|
22047
|
+
children
|
|
22048
|
+
}),
|
|
22049
|
+
4: ({
|
|
22050
|
+
children,
|
|
22051
|
+
className
|
|
22052
|
+
}) => jsx("h4", {
|
|
22053
|
+
className,
|
|
22054
|
+
children
|
|
22055
|
+
}),
|
|
22056
|
+
sub: ({
|
|
22057
|
+
children,
|
|
22058
|
+
className
|
|
22059
|
+
}) => jsx("div", {
|
|
22060
|
+
className,
|
|
22061
|
+
children
|
|
22062
|
+
})
|
|
22063
|
+
};
|
|
22064
|
+
function Heading({
|
|
22065
|
+
className,
|
|
22066
|
+
level,
|
|
22067
|
+
children
|
|
22068
|
+
}) {
|
|
22069
|
+
const HeadingElement = headingTypes[level] || headingTypes[1];
|
|
22070
|
+
const classNames = cx("adyen-kyc-heading", `adyen-kyc-heading--${level}`, className);
|
|
22071
|
+
return jsx(HeadingElement, {
|
|
22072
|
+
className: classNames,
|
|
22073
|
+
children
|
|
22074
|
+
});
|
|
22075
|
+
}
|
|
21844
22076
|
const summaryStep = {
|
|
21845
22077
|
formId: "summary",
|
|
21846
22078
|
formName: "summary"
|
|
@@ -21869,61 +22101,58 @@ function Summary({
|
|
|
21869
22101
|
gotoForm(formIndex);
|
|
21870
22102
|
}
|
|
21871
22103
|
};
|
|
21872
|
-
const allValidationErrors = (problems == null ? void 0 : problems.validationErrors) && ((_a = Object.values(problems
|
|
22104
|
+
const allValidationErrors = (problems == null ? void 0 : problems.validationErrors) && ((_a = Object.values(problems.validationErrors)) == null ? void 0 : _a.reduce((acc, validError) => ({
|
|
21873
22105
|
...acc,
|
|
21874
22106
|
...validError
|
|
21875
22107
|
}), {}));
|
|
21876
|
-
const allVerificationErrors = (problems == null ? void 0 : problems.verificationErrors) && ((_b = Object.values(problems
|
|
22108
|
+
const allVerificationErrors = (problems == null ? void 0 : problems.verificationErrors) && ((_b = Object.values(problems.verificationErrors)) == null ? void 0 : _b.reduce((acc, verifError) => ({
|
|
21877
22109
|
...acc,
|
|
21878
22110
|
...verifError
|
|
21879
22111
|
}), {}));
|
|
21880
22112
|
const formUtils = formUtilities({
|
|
21881
22113
|
labels: labels2
|
|
21882
22114
|
}, i18n);
|
|
21883
|
-
const
|
|
21884
|
-
className: "adyen-kyc-
|
|
21885
|
-
children: [jsx(
|
|
21886
|
-
|
|
21887
|
-
|
|
21888
|
-
|
|
21889
|
-
|
|
21890
|
-
|
|
21891
|
-
|
|
21892
|
-
|
|
21893
|
-
|
|
21894
|
-
|
|
21895
|
-
|
|
21896
|
-
|
|
21897
|
-
|
|
21898
|
-
|
|
21899
|
-
|
|
21900
|
-
|
|
21901
|
-
|
|
21902
|
-
|
|
21903
|
-
|
|
21904
|
-
|
|
21905
|
-
|
|
21906
|
-
|
|
21907
|
-
|
|
21908
|
-
|
|
21909
|
-
|
|
21910
|
-
|
|
21911
|
-
|
|
21912
|
-
label: i18n.get("edit"),
|
|
21913
|
-
labelHoverBox: true
|
|
21914
|
-
})
|
|
22115
|
+
const summarySectionHeader = (formName, formId) => jsxs("header", {
|
|
22116
|
+
className: "adyen-kyc-summary-section__header",
|
|
22117
|
+
children: [jsx(Heading, {
|
|
22118
|
+
level: 4,
|
|
22119
|
+
className: "adyen-kyc-summary-section__heading",
|
|
22120
|
+
children: formName
|
|
22121
|
+
}), jsx(Button, {
|
|
22122
|
+
className: "adyen-kyc-summary-section__edit-button",
|
|
22123
|
+
ghost: true,
|
|
22124
|
+
circle: true,
|
|
22125
|
+
tertiary: true,
|
|
22126
|
+
icon: "edit",
|
|
22127
|
+
onClick: () => {
|
|
22128
|
+
trackNavigation2({
|
|
22129
|
+
fromForm: {
|
|
22130
|
+
formName: "summary",
|
|
22131
|
+
formId: "summary"
|
|
22132
|
+
},
|
|
22133
|
+
toForm: {
|
|
22134
|
+
formId,
|
|
22135
|
+
formName
|
|
22136
|
+
},
|
|
22137
|
+
component: "Pencil icon"
|
|
22138
|
+
});
|
|
22139
|
+
editForm(formId);
|
|
22140
|
+
},
|
|
22141
|
+
title: i18n.get("edit"),
|
|
22142
|
+
label: i18n.get("edit"),
|
|
22143
|
+
labelHoverBox: true
|
|
21915
22144
|
})]
|
|
21916
22145
|
});
|
|
21917
|
-
const
|
|
21918
|
-
className: "adyen-kyc-
|
|
21919
|
-
children: [showSectionHeader &&
|
|
21920
|
-
className: cx("adyen-kyc-
|
|
21921
|
-
"adyen-kyc-
|
|
22146
|
+
const renderSummarySection = (fieldData, labelData, formName, formId) => jsxs("section", {
|
|
22147
|
+
className: "adyen-kyc-summary-section",
|
|
22148
|
+
children: [showSectionHeader && summarySectionHeader(formName, formId), jsx("dl", {
|
|
22149
|
+
className: cx("adyen-kyc-summary-section__content", {
|
|
22150
|
+
"adyen-kyc-summary-section__content--no-header": !showSectionHeader
|
|
21922
22151
|
}),
|
|
21923
|
-
children:
|
|
22152
|
+
children: renderSummaryItems(fieldData, labelData)
|
|
21924
22153
|
})]
|
|
21925
22154
|
});
|
|
21926
|
-
const
|
|
22155
|
+
const renderSummaryContent = (data2) => {
|
|
21927
22156
|
const summaryList = [];
|
|
21928
22157
|
forms2.forEach(({
|
|
21929
22158
|
formId,
|
|
@@ -21931,53 +22160,44 @@ function Summary({
|
|
|
21931
22160
|
}) => {
|
|
21932
22161
|
const currentFormData = data2[formId];
|
|
21933
22162
|
const isFormEmpty = !currentFormData || Object.values(currentFormData).every((value) => isEmpty(value));
|
|
21934
|
-
if (isFormEmpty || formId === summaryStep.formId || omittedForms.includes(formId))
|
|
21935
|
-
|
|
21936
|
-
}
|
|
21937
|
-
const summaryItems = currentFormData.hasInnerForms ? renderInnerForms(labels2 == null ? void 0 : labels2[formId], formId, currentFormData) : currentFormData ? renderSummaryItem(currentFormData, labels2 == null ? void 0 : labels2[formId], i18n.get(formName), formId) : null;
|
|
22163
|
+
if (isFormEmpty || formId === summaryStep.formId || omittedForms.includes(formId)) return;
|
|
22164
|
+
const summaryItems = currentFormData.hasInnerForms ? renderInnerForms(labels2 == null ? void 0 : labels2[formId], formId, currentFormData) : renderSummarySection(currentFormData, labels2 == null ? void 0 : labels2[formId], i18n.get(formName), formId);
|
|
21938
22165
|
summaryList.push(summaryItems);
|
|
21939
22166
|
});
|
|
21940
22167
|
return summaryList;
|
|
21941
22168
|
};
|
|
21942
22169
|
const renderInnerForms = (labelData, parentFormId, innerForms = {}) => {
|
|
22170
|
+
if (!innerForms) return [];
|
|
21943
22171
|
const dataList = [];
|
|
21944
|
-
|
|
21945
|
-
|
|
21946
|
-
|
|
21947
|
-
|
|
21948
|
-
|
|
21949
|
-
|
|
21950
|
-
});
|
|
21951
|
-
}
|
|
22172
|
+
Object.entries(innerForms).forEach(([innerFormName, innerFormFieldData]) => {
|
|
22173
|
+
const formName = i18n.get(labelData == null ? void 0 : labelData[innerFormName]) || i18n.get(innerFormName);
|
|
22174
|
+
if (typeof innerFormFieldData === "object" && innerFormFieldData !== null) {
|
|
22175
|
+
dataList.push(renderSummarySection(innerFormFieldData, labelData, formName, parentFormId));
|
|
22176
|
+
}
|
|
22177
|
+
});
|
|
21952
22178
|
return dataList;
|
|
21953
22179
|
};
|
|
21954
|
-
const
|
|
22180
|
+
const renderSummaryItems = (formData = {}, labelData = {}) => {
|
|
22181
|
+
if (!formData) return [];
|
|
21955
22182
|
const dataList = [];
|
|
21956
|
-
|
|
21957
|
-
|
|
21958
|
-
|
|
21959
|
-
|
|
21960
|
-
|
|
21961
|
-
|
|
21962
|
-
|
|
21963
|
-
|
|
21964
|
-
|
|
21965
|
-
|
|
21966
|
-
|
|
21967
|
-
|
|
21968
|
-
|
|
21969
|
-
|
|
21970
|
-
|
|
21971
|
-
|
|
21972
|
-
|
|
21973
|
-
|
|
21974
|
-
className: "adyen-kyc-summary__data",
|
|
21975
|
-
children: fieldData
|
|
21976
|
-
})]
|
|
21977
|
-
}));
|
|
21978
|
-
}
|
|
21979
|
-
});
|
|
21980
|
-
}
|
|
22183
|
+
Object.entries(formData).forEach(([field, fieldData]) => {
|
|
22184
|
+
if ((omittedKeys == null ? void 0 : omittedKeys.includes(field)) || !fieldData) return;
|
|
22185
|
+
const fieldName = i18n.get(labelData[field]) || i18n.get(field);
|
|
22186
|
+
if (typeof fieldData === "object") {
|
|
22187
|
+
dataList.push(renderSummaryItems(fieldData, labelData));
|
|
22188
|
+
} else if (typeof fieldData === "string") {
|
|
22189
|
+
dataList.push(jsxs("div", {
|
|
22190
|
+
className: "adyen-kyc-summary-section__field",
|
|
22191
|
+
children: [jsx("dt", {
|
|
22192
|
+
className: "adyen-kyc-summary-section__label",
|
|
22193
|
+
children: fieldName
|
|
22194
|
+
}), jsx("dd", {
|
|
22195
|
+
className: "adyen-kyc-summary-section__data",
|
|
22196
|
+
children: fieldData
|
|
22197
|
+
})]
|
|
22198
|
+
}));
|
|
22199
|
+
}
|
|
22200
|
+
});
|
|
21981
22201
|
return dataList;
|
|
21982
22202
|
};
|
|
21983
22203
|
return jsxs("div", {
|
|
@@ -21991,9 +22211,9 @@ function Summary({
|
|
|
21991
22211
|
verificationErrors: allVerificationErrors,
|
|
21992
22212
|
formUtils,
|
|
21993
22213
|
id: "ariaErrorField"
|
|
21994
|
-
}), jsx("
|
|
21995
|
-
className: "adyen-kyc-
|
|
21996
|
-
children:
|
|
22214
|
+
}), jsx("div", {
|
|
22215
|
+
className: "adyen-kyc-summary__content",
|
|
22216
|
+
children: renderSummaryContent(data)
|
|
21997
22217
|
}), showLegalCaption && jsx("span", {
|
|
21998
22218
|
className: "adyen-kyc-summary__legal-caption",
|
|
21999
22219
|
children: i18n.get("summaryLegalCaption")
|
|
@@ -22217,7 +22437,7 @@ const defaultPayoutAccountFormat = {
|
|
|
22217
22437
|
[CountryCodes.Sweden]: "local",
|
|
22218
22438
|
[CountryCodes.UnitedKingdom]: "local"
|
|
22219
22439
|
};
|
|
22220
|
-
const logger$
|
|
22440
|
+
const logger$l = createLogger("useScenarioConfiguration");
|
|
22221
22441
|
const useScenarioConfiguration = ({
|
|
22222
22442
|
getConfigurationData,
|
|
22223
22443
|
getPayoutAccountFormatData,
|
|
@@ -22240,12 +22460,12 @@ const useScenarioConfiguration = ({
|
|
|
22240
22460
|
const response = await getConfigurationData();
|
|
22241
22461
|
setConfigurationResponse(response);
|
|
22242
22462
|
} catch (err) {
|
|
22243
|
-
logger$
|
|
22463
|
+
logger$l.warn("WARNING: Configuration request failed - error:", err);
|
|
22244
22464
|
} finally {
|
|
22245
22465
|
setLoadingStatus("success");
|
|
22246
22466
|
}
|
|
22247
22467
|
};
|
|
22248
|
-
makeConfigCallAndSave().catch(logger$
|
|
22468
|
+
makeConfigCallAndSave().catch(logger$l.error);
|
|
22249
22469
|
}, [getConfigurationData, setLoadingStatus]);
|
|
22250
22470
|
useEffect(() => {
|
|
22251
22471
|
setLoadingStatus("loading");
|
|
@@ -22262,12 +22482,12 @@ const useScenarioConfiguration = ({
|
|
|
22262
22482
|
const defaultAccountFormat = defaultPayoutAccountFormat[country2] ?? allowedBankAccountFormats[0];
|
|
22263
22483
|
setAccountFormat(existingBankAccountFormat ?? defaultAccountFormat);
|
|
22264
22484
|
} catch (err) {
|
|
22265
|
-
logger$
|
|
22485
|
+
logger$l.warn("WARNING: Payout format request failed - error:", err);
|
|
22266
22486
|
} finally {
|
|
22267
22487
|
setLoadingStatus("success");
|
|
22268
22488
|
}
|
|
22269
22489
|
};
|
|
22270
|
-
makePayoutFormatCallAndSave().catch(logger$
|
|
22490
|
+
makePayoutFormatCallAndSave().catch(logger$l.error);
|
|
22271
22491
|
}, [country2, setAccountFormat, getPayoutAccountFormatData, setLoadingStatus, existingBankAccountFormat]);
|
|
22272
22492
|
const {
|
|
22273
22493
|
fieldConfigurations,
|
|
@@ -22563,6 +22783,10 @@ function parseTrustScenarios(scenario, country2) {
|
|
|
22563
22783
|
return fieldConfigurations;
|
|
22564
22784
|
}
|
|
22565
22785
|
}
|
|
22786
|
+
const parseHighExposureScenarios = (scenario) => scenario == null ? void 0 : scenario.reduce((scenarios, scenarioName) => ({
|
|
22787
|
+
...scenarios,
|
|
22788
|
+
...fieldsPerScenario$1[scenarioName]
|
|
22789
|
+
}), {});
|
|
22566
22790
|
function parseSolePropScenarios(scenario, country2) {
|
|
22567
22791
|
if (scenario) {
|
|
22568
22792
|
let fieldConfigurations = scenario.reduce((scenarios, scenarioName) => ({
|
|
@@ -23843,7 +24067,7 @@ const useExpiryThreshold = (expiry) => {
|
|
|
23843
24067
|
};
|
|
23844
24068
|
};
|
|
23845
24069
|
const ExpiryContext = createContext(false);
|
|
23846
|
-
const logger$
|
|
24070
|
+
const logger$k = createLogger("ExpiryProvider");
|
|
23847
24071
|
const ExpiryProvider = ({
|
|
23848
24072
|
expiry: initialExpiry,
|
|
23849
24073
|
eventEmitter,
|
|
@@ -23876,7 +24100,7 @@ const ExpiryProvider = ({
|
|
|
23876
24100
|
refreshExpiry().then((newExpiry) => {
|
|
23877
24101
|
setExpiry(newExpiry);
|
|
23878
24102
|
setModalDismissed(false);
|
|
23879
|
-
}).catch(logger$
|
|
24103
|
+
}).catch(logger$k.error);
|
|
23880
24104
|
}
|
|
23881
24105
|
}), children]
|
|
23882
24106
|
});
|
|
@@ -23896,7 +24120,7 @@ const ExpiryProvider = ({
|
|
|
23896
24120
|
});
|
|
23897
24121
|
};
|
|
23898
24122
|
const useHasExpired = () => useContext(ExpiryContext);
|
|
23899
|
-
const logger$
|
|
24123
|
+
const logger$j = createLogger("FormRouterContextProvider");
|
|
23900
24124
|
function FormRouterContextProvider({
|
|
23901
24125
|
children,
|
|
23902
24126
|
forms: forms2,
|
|
@@ -23916,7 +24140,7 @@ function FormRouterContextProvider({
|
|
|
23916
24140
|
if (formIndex > -1) {
|
|
23917
24141
|
setFormIndex(formIndex);
|
|
23918
24142
|
} else {
|
|
23919
|
-
logger$
|
|
24143
|
+
logger$j.error("No form was found to have that field so form navigation failed.");
|
|
23920
24144
|
}
|
|
23921
24145
|
}
|
|
23922
24146
|
}), [forms2, handleGetIdVerificationToken, setFormIndex]);
|
|
@@ -24178,11 +24402,16 @@ const validateErrorCode = (error, errorCode) => error && "errorCode" in error &&
|
|
|
24178
24402
|
const isValidationError = (error) => validateErrorCode(error, API_VALIDATION_ERROR_CODE);
|
|
24179
24403
|
const isIdDocumentUploadError = (error) => validateErrorCode(error, ID_DOCUMENT_UPLOAD_ERROR_CODE);
|
|
24180
24404
|
const isBankStatementUploadError = (error) => validateErrorCode(error, BANK_STATEMENT_UPLOAD_ERROR_CODE);
|
|
24181
|
-
const processValidationErrors = (validationError, dropinTask) => {
|
|
24405
|
+
const processValidationErrors = (validationError, dropinTask, keyMappings) => {
|
|
24182
24406
|
if ((validationError == null ? void 0 : validationError.invalidFields) && (validationError == null ? void 0 : validationError.invalidFields.length) > 0) {
|
|
24183
24407
|
return validationError == null ? void 0 : validationError.invalidFields.reduce((acc, invalidField) => {
|
|
24184
24408
|
if (invalidField == null ? void 0 : invalidField.name) {
|
|
24185
|
-
|
|
24409
|
+
let mappedFieldPath = mapField(invalidField == null ? void 0 : invalidField.name, dropinTask);
|
|
24410
|
+
if (keyMappings) {
|
|
24411
|
+
mappedFieldPath = {
|
|
24412
|
+
...keyMappings
|
|
24413
|
+
};
|
|
24414
|
+
}
|
|
24186
24415
|
if (mappedFieldPath) {
|
|
24187
24416
|
assignToProp(mappedFieldPath, acc, true);
|
|
24188
24417
|
}
|
|
@@ -24244,7 +24473,7 @@ const mapBusinessDetailsSchemaToLegalEntity = (data) => {
|
|
|
24244
24473
|
return requestObj;
|
|
24245
24474
|
};
|
|
24246
24475
|
const MANDATORY_API_FIELDS = ["basicInformation.legalCompanyName", "basicInformation.country"];
|
|
24247
|
-
const parseConfiguration$
|
|
24476
|
+
const parseConfiguration$7 = ({
|
|
24248
24477
|
country: country2,
|
|
24249
24478
|
matchingScenario
|
|
24250
24479
|
}) => parseBusinessDetailsScenarios(matchingScenario == null ? void 0 : matchingScenario[LegalEntityType.ORGANIZATION], country2);
|
|
@@ -24260,15 +24489,7 @@ const formatDataForSummary$1 = (data, forms2, labels2, i18n) => {
|
|
|
24260
24489
|
if (!form) return summaryData;
|
|
24261
24490
|
switch (form) {
|
|
24262
24491
|
case "basicInformation":
|
|
24263
|
-
return {
|
|
24264
|
-
...summaryData,
|
|
24265
|
-
[form]: formData
|
|
24266
|
-
};
|
|
24267
24492
|
case "companyStructure":
|
|
24268
|
-
return {
|
|
24269
|
-
...summaryData,
|
|
24270
|
-
[form]: formData
|
|
24271
|
-
};
|
|
24272
24493
|
case "additionalInformation":
|
|
24273
24494
|
return {
|
|
24274
24495
|
...summaryData,
|
|
@@ -24504,7 +24725,7 @@ function BusinessDetailsDropinComponent({
|
|
|
24504
24725
|
const {
|
|
24505
24726
|
fieldConfigurations
|
|
24506
24727
|
} = useScenarioConfiguration({
|
|
24507
|
-
parseConfiguration: parseConfiguration$
|
|
24728
|
+
parseConfiguration: parseConfiguration$7,
|
|
24508
24729
|
getConfigurationData,
|
|
24509
24730
|
setLoadingStatus,
|
|
24510
24731
|
country: currentCountry
|
|
@@ -24791,7 +25012,7 @@ const getTargetLegalEntityType = (businessType, legalArrangement, trusteeType, c
|
|
|
24791
25012
|
return currentLegalEntityType;
|
|
24792
25013
|
};
|
|
24793
25014
|
const isLegalArrangementOrganizationSubtype = (legalArrangementOption) => legalArrangementOption === "partnershipIncorporated" || legalArrangementOption === "associationIncorporated";
|
|
24794
|
-
const parseConfiguration$
|
|
25015
|
+
const parseConfiguration$6 = ({
|
|
24795
25016
|
country: country2,
|
|
24796
25017
|
matchingScenario
|
|
24797
25018
|
}) => parseCompanyScenarios(matchingScenario == null ? void 0 : matchingScenario[LegalEntityType.ORGANIZATION], country2);
|
|
@@ -24888,7 +25109,7 @@ function CompanyDropinComponent({
|
|
|
24888
25109
|
fieldConfigurations,
|
|
24889
25110
|
requiredFields
|
|
24890
25111
|
} = useScenarioConfiguration({
|
|
24891
|
-
parseConfiguration: parseConfiguration$
|
|
25112
|
+
parseConfiguration: parseConfiguration$6,
|
|
24892
25113
|
getConfigurationData,
|
|
24893
25114
|
setLoadingStatus,
|
|
24894
25115
|
country: country2
|
|
@@ -25069,33 +25290,32 @@ function CompanyDropinComponent({
|
|
|
25069
25290
|
}, []);
|
|
25070
25291
|
const datasetUtils = datasetUtilities(i18n.locale);
|
|
25071
25292
|
const formatDataForSummary2 = (data2, forms22) => {
|
|
25072
|
-
var _a2, _b2, _c, _d, _e, _f
|
|
25293
|
+
var _a2, _b2, _c, _d, _e, _f;
|
|
25073
25294
|
let summaryData = cloneObject(data2);
|
|
25074
|
-
if (
|
|
25075
|
-
|
|
25295
|
+
if (summaryData.companyNameAndCountry) {
|
|
25296
|
+
if (isCountryOfGoverningLawEnabled) {
|
|
25297
|
+
summaryData.companyNameAndCountry = getUpdatedCountryOfGoverningLaw(summaryData.companyNameAndCountry);
|
|
25298
|
+
} else {
|
|
25299
|
+
summaryData.companyNameAndCountry.country = datasetUtils.getCountryName(summaryData.companyNameAndCountry.country);
|
|
25300
|
+
}
|
|
25301
|
+
summaryData.companyNameAndCountry.countryRegionOfEstablishment = summaryData.companyNameAndCountry.country;
|
|
25076
25302
|
delete summaryData.companyNameAndCountry.country;
|
|
25077
25303
|
}
|
|
25078
|
-
if (
|
|
25079
|
-
|
|
25080
|
-
}
|
|
25081
|
-
if ((_b2 = summaryData == null ? void 0 : summaryData.companyType) == null ? void 0 : _b2.entityType) {
|
|
25082
|
-
const companyType2 = (_c = companyTypes.find((companyType22) => {
|
|
25083
|
-
var _a3;
|
|
25084
|
-
return companyType22.id === ((_a3 = summaryData.companyType) == null ? void 0 : _a3.entityType);
|
|
25085
|
-
})) == null ? void 0 : _c.name;
|
|
25304
|
+
if ((_a2 = summaryData.companyType) == null ? void 0 : _a2.entityType) {
|
|
25305
|
+
const companyType2 = (_b2 = companyTypes.find((type) => type.id === summaryData.companyType.entityType)) == null ? void 0 : _b2.name;
|
|
25086
25306
|
summaryData.companyType.entityType = i18n.get(companyType2);
|
|
25087
25307
|
}
|
|
25088
|
-
if ((
|
|
25089
|
-
summaryData.companyType.accountHolder = i18n.get(
|
|
25308
|
+
if ((_c = summaryData.companyType) == null ? void 0 : _c.accountHolder) {
|
|
25309
|
+
summaryData.companyType.accountHolder = i18n.get(summaryData.companyType.accountHolder);
|
|
25090
25310
|
}
|
|
25091
|
-
if ((
|
|
25311
|
+
if ((_d = summaryData.companyRegistrationAddress) == null ? void 0 : _d.registrationAddress) {
|
|
25092
25312
|
summaryData.companyRegistrationAddress.hasInnerForms = true;
|
|
25093
|
-
summaryData.companyRegistrationAddress.registrationAddress = mapAddressLabels(summaryData
|
|
25313
|
+
summaryData.companyRegistrationAddress.registrationAddress = mapAddressLabels(summaryData.companyRegistrationAddress.registrationAddress, datasetUtils);
|
|
25094
25314
|
}
|
|
25095
|
-
if ((
|
|
25096
|
-
summaryData.companyRegistrationAddress.operationalAddress = mapAddressLabels(summaryData
|
|
25315
|
+
if ((_e = summaryData.companyRegistrationAddress) == null ? void 0 : _e.operationalAddress) {
|
|
25316
|
+
summaryData.companyRegistrationAddress.operationalAddress = mapAddressLabels(summaryData.companyRegistrationAddress.operationalAddress, datasetUtils);
|
|
25097
25317
|
}
|
|
25098
|
-
if ((
|
|
25318
|
+
if ((_f = summaryData.companyRegistrationDetails) == null ? void 0 : _f.vatAbsenceReason) {
|
|
25099
25319
|
const vatAbsenceReason2 = vatAbsenceReasons.find((absenceReason) => absenceReason === summaryData.companyRegistrationDetails.vatAbsenceReason);
|
|
25100
25320
|
if (vatAbsenceReason2) {
|
|
25101
25321
|
summaryData.companyRegistrationDetails.vatAbsenceReason = i18n.get(vatAbsenceReason2);
|
|
@@ -25177,7 +25397,7 @@ var CompanySearchEvents = /* @__PURE__ */ ((CompanySearchEvents2) => {
|
|
|
25177
25397
|
CompanySearchEvents2["SELECTION_ERROR"] = "CompanySearch_CompanySelectionError";
|
|
25178
25398
|
return CompanySearchEvents2;
|
|
25179
25399
|
})(CompanySearchEvents || {});
|
|
25180
|
-
const logger$
|
|
25400
|
+
const logger$i = createLogger("useCompanySearch");
|
|
25181
25401
|
const LOW_RISK_COMPANY_DATA_COMPLIANCE_WINDOW = 1577664e5;
|
|
25182
25402
|
function useCompanySearch({
|
|
25183
25403
|
defaultData,
|
|
@@ -25301,7 +25521,7 @@ function useCompanySearch({
|
|
|
25301
25521
|
state: companyData.state ?? stateOrProvince2
|
|
25302
25522
|
});
|
|
25303
25523
|
} catch (e) {
|
|
25304
|
-
logger$
|
|
25524
|
+
logger$i.error(e);
|
|
25305
25525
|
setError(e);
|
|
25306
25526
|
setStatus("error");
|
|
25307
25527
|
} finally {
|
|
@@ -25334,7 +25554,7 @@ function useCompanySearch({
|
|
|
25334
25554
|
indexSearch: handleCompanyIndexSearch,
|
|
25335
25555
|
deepSearch: handleCompanyDeepSearch,
|
|
25336
25556
|
resultsLimit: limit
|
|
25337
|
-
})) == null ? void 0 : _a.catch((e) => logger$
|
|
25557
|
+
})) == null ? void 0 : _a.catch((e) => logger$i.error(e));
|
|
25338
25558
|
}
|
|
25339
25559
|
}, [legalCompanyName2, country2, stateOrProvince2, taxIdentificationNumber2, verifiedCompany, searchCompanies, handleCompanyIndexSearch, handleCompanyDeepSearch, limit, canVerify, baseTrackingPayload]);
|
|
25340
25560
|
useEffect(() => {
|
|
@@ -25793,10 +26013,12 @@ const defaultFieldMetadata = defaultFieldMetadata$7;
|
|
|
25793
26013
|
const defaultFieldConfig = entriesOf(defaultFieldConfig$7).reduce((fieldConfig, [country2, countryEntry]) => ({
|
|
25794
26014
|
...fieldConfig,
|
|
25795
26015
|
[country2]: ({
|
|
25796
|
-
taxIdNumberType
|
|
26016
|
+
taxIdNumberType,
|
|
26017
|
+
companyType: companyType2
|
|
25797
26018
|
}) => {
|
|
25798
26019
|
const fieldMetadata = resolveFieldMetadata(countryEntry, {
|
|
25799
|
-
taxIdNumberType
|
|
26020
|
+
taxIdNumberType,
|
|
26021
|
+
companyType: companyType2
|
|
25800
26022
|
}, defaultFieldMetadata$7);
|
|
25801
26023
|
const taxIdValidators = fieldMetadata.validators ? Array.isArray(fieldMetadata.validators) ? fieldMetadata.validators : [fieldMetadata.validators] : [];
|
|
25802
26024
|
const mappedValidators = taxIdValidators.map((validator) => ({
|
|
@@ -25863,7 +26085,7 @@ function CompanyBasics({
|
|
|
25863
26085
|
const [loading2, setLoading] = useState$1(false);
|
|
25864
26086
|
const allowedCountries = useAllowedCountries();
|
|
25865
26087
|
const existingTaxId = (_b = (_a = data == null ? void 0 : data.taxInformation) == null ? void 0 : _a.find((taxId2) => taxId2.country === country2)) == null ? void 0 : _b.number;
|
|
25866
|
-
const defaultTaxIdNumberType = existingTaxId ? inferTaxIdNumberType(existingTaxId, country2) : (_c = getTaxIdNumberOptions(country2, companyType2)) == null ? void 0 : _c[0].id;
|
|
26088
|
+
const defaultTaxIdNumberType = existingTaxId ? inferTaxIdNumberType(existingTaxId, country2, companyType2) : (_c = getTaxIdNumberOptions(country2, companyType2)) == null ? void 0 : _c[0].id;
|
|
25867
26089
|
const [taxIdNumberType, setTaxIdNumberType] = useState$1(defaultTaxIdNumberType);
|
|
25868
26090
|
const initialFormUtilsProps = useMemo$1(() => ({
|
|
25869
26091
|
allFields,
|
|
@@ -25907,7 +26129,8 @@ function CompanyBasics({
|
|
|
25907
26129
|
};
|
|
25908
26130
|
case "taxInformation":
|
|
25909
26131
|
return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig[country2], {
|
|
25910
|
-
taxIdNumberType
|
|
26132
|
+
taxIdNumberType,
|
|
26133
|
+
companyType: companyType2
|
|
25911
26134
|
}, defaultFieldMetadata), acc);
|
|
25912
26135
|
default:
|
|
25913
26136
|
return acc;
|
|
@@ -26085,10 +26308,10 @@ function CompanyOtherDetails({
|
|
|
26085
26308
|
const registrationNumberOptions = useMemo$1(() => getCompanyRegistrationNumberOptions(country2, companyType2), [country2, companyType2]);
|
|
26086
26309
|
const defaultRegistrationNumberType = (data == null ? void 0 : data.registrationNumber) ? inferCompanyRegistrationNumberType(data == null ? void 0 : data.registrationNumber, country2, companyType2) : registrationNumberOptions == null ? void 0 : registrationNumberOptions[0].id;
|
|
26087
26310
|
const [registrationNumberType, setRegistrationNumberType] = useState$1(defaultRegistrationNumberType);
|
|
26088
|
-
const defaultVatNumberType = (data == null ? void 0 : data.vatNumber) ? inferTaxIdNumberType(data == null ? void 0 : data.vatNumber, country2) : (_a = taxIdNumberOptions[country2]) == null ? void 0 : _a[0].id;
|
|
26311
|
+
const defaultVatNumberType = (data == null ? void 0 : data.vatNumber) ? inferTaxIdNumberType(data == null ? void 0 : data.vatNumber, country2, companyType2) : (_a = taxIdNumberOptions[country2]) == null ? void 0 : _a[0].id;
|
|
26089
26312
|
const [vatNumberType, setVatNumberType] = useState$1(defaultVatNumberType);
|
|
26090
26313
|
const existingTaxId = (_c = (_b = data == null ? void 0 : data.taxInformation) == null ? void 0 : _b.find((taxId2) => taxId2.country === country2)) == null ? void 0 : _c.number;
|
|
26091
|
-
const defaultTaxIdNumberType = existingTaxId ? inferTaxIdNumberType(existingTaxId, country2) : (_d = getTaxIdNumberOptions(country2, companyType2)) == null ? void 0 : _d[0].id;
|
|
26314
|
+
const defaultTaxIdNumberType = existingTaxId ? inferTaxIdNumberType(existingTaxId, country2, companyType2) : (_d = getTaxIdNumberOptions(country2, companyType2)) == null ? void 0 : _d[0].id;
|
|
26092
26315
|
const [taxIdNumberType, setTaxIdNumberType] = useState$1(defaultTaxIdNumberType);
|
|
26093
26316
|
const directChildFields = companyOtherDetailsFields.filter((field) => ["tradingName", "sameNameAsLegalName", "stockExchangeMIC", "stockISIN", "dateOfIncorporation"].includes(field));
|
|
26094
26317
|
const initialFormUtilsProps = useMemo$1(() => ({
|
|
@@ -26134,7 +26357,8 @@ function CompanyOtherDetails({
|
|
|
26134
26357
|
}, defaultFieldMetadata$8), acc);
|
|
26135
26358
|
case "taxInformation":
|
|
26136
26359
|
return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig[country2], {
|
|
26137
|
-
taxIdNumberType
|
|
26360
|
+
taxIdNumberType,
|
|
26361
|
+
companyType: companyType2
|
|
26138
26362
|
}, defaultFieldMetadata), acc);
|
|
26139
26363
|
case "vatNumber":
|
|
26140
26364
|
return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig$6[country2], {
|
|
@@ -26343,7 +26567,7 @@ const forms = {
|
|
|
26343
26567
|
fields: ["taxDocument"]
|
|
26344
26568
|
}
|
|
26345
26569
|
};
|
|
26346
|
-
const parseConfiguration$
|
|
26570
|
+
const parseConfiguration$5 = ({
|
|
26347
26571
|
country: country2,
|
|
26348
26572
|
matchingScenario
|
|
26349
26573
|
}) => parseCompanySearchScenarios(matchingScenario == null ? void 0 : matchingScenario[LegalEntityType.ORGANIZATION], country2);
|
|
@@ -26373,7 +26597,8 @@ const formatDataForSummary = (data, forms2, labels2, i18n) => {
|
|
|
26373
26597
|
const datasetUtils = datasetUtilities(i18n.locale);
|
|
26374
26598
|
const country2 = (_a = data.companyBasics) == null ? void 0 : _a.country;
|
|
26375
26599
|
const taxIdLabel = resolveFieldMetadata(defaultFieldConfig[country2], {
|
|
26376
|
-
taxIdNumberType: countryToTaxInfoTypeMap[country2]
|
|
26600
|
+
taxIdNumberType: countryToTaxInfoTypeMap[country2],
|
|
26601
|
+
companyType: void 0
|
|
26377
26602
|
}, defaultFieldMetadata).label;
|
|
26378
26603
|
return entriesOf(data).reduce((summaryData, [form, formData]) => {
|
|
26379
26604
|
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
@@ -26561,7 +26786,7 @@ const mapLegalEntityToCompanySearchSchema = (legalEntity, isChangingType, accoun
|
|
|
26561
26786
|
}
|
|
26562
26787
|
}, {});
|
|
26563
26788
|
};
|
|
26564
|
-
const logger$
|
|
26789
|
+
const logger$h = createLogger("useFormTaskSubmit");
|
|
26565
26790
|
function useCompanySearchTaskSubmit({
|
|
26566
26791
|
task,
|
|
26567
26792
|
forms: forms2,
|
|
@@ -26604,7 +26829,7 @@ function useCompanySearchTaskSubmit({
|
|
|
26604
26829
|
});
|
|
26605
26830
|
}
|
|
26606
26831
|
} catch (e) {
|
|
26607
|
-
logger$
|
|
26832
|
+
logger$h.error(e);
|
|
26608
26833
|
userEvents.addEvent(CompanySearchEvents.DOCUMENTS_ERROR, {
|
|
26609
26834
|
segmentation: {
|
|
26610
26835
|
...baseTrackingPayload,
|
|
@@ -26656,7 +26881,7 @@ function useCompanySearchTaskSubmit({
|
|
|
26656
26881
|
...trackingPayload
|
|
26657
26882
|
}
|
|
26658
26883
|
});
|
|
26659
|
-
logger$
|
|
26884
|
+
logger$h.log(submittedLegalEntity);
|
|
26660
26885
|
clearToasts();
|
|
26661
26886
|
onExternalSubmit == null ? void 0 : onExternalSubmit(data);
|
|
26662
26887
|
} catch (e) {
|
|
@@ -26680,7 +26905,7 @@ function useCompanySearchTaskSubmit({
|
|
|
26680
26905
|
type: ToastType.ERROR
|
|
26681
26906
|
});
|
|
26682
26907
|
}
|
|
26683
|
-
logger$
|
|
26908
|
+
logger$h.error(e);
|
|
26684
26909
|
userEvents.addEvent(CompanySearchEvents.TASK_ERROR, {
|
|
26685
26910
|
segmentation: {
|
|
26686
26911
|
...baseTrackingPayload,
|
|
@@ -26907,7 +27132,7 @@ function CompanySearchDropinComponent({
|
|
|
26907
27132
|
const {
|
|
26908
27133
|
fieldConfigurations
|
|
26909
27134
|
} = useScenarioConfiguration({
|
|
26910
|
-
parseConfiguration: parseConfiguration$
|
|
27135
|
+
parseConfiguration: parseConfiguration$5,
|
|
26911
27136
|
getConfigurationData,
|
|
26912
27137
|
setLoadingStatus,
|
|
26913
27138
|
country: country2
|
|
@@ -27033,7 +27258,7 @@ function CompanySearchDropinComponent({
|
|
|
27033
27258
|
})
|
|
27034
27259
|
});
|
|
27035
27260
|
}
|
|
27036
|
-
const logger$
|
|
27261
|
+
const logger$g = createLogger("useLocalStorage");
|
|
27037
27262
|
const useLocalStorage = (key, defaultValue, options) => {
|
|
27038
27263
|
const {
|
|
27039
27264
|
serializer,
|
|
@@ -27053,7 +27278,7 @@ const useLocalStorage = (key, defaultValue, options) => {
|
|
|
27053
27278
|
const res = rawValueRef.current ? parser(rawValueRef.current) : defaultValue;
|
|
27054
27279
|
return res;
|
|
27055
27280
|
} catch (err) {
|
|
27056
|
-
logger$
|
|
27281
|
+
logger$g.error(err);
|
|
27057
27282
|
return defaultValue;
|
|
27058
27283
|
}
|
|
27059
27284
|
});
|
|
@@ -27084,7 +27309,7 @@ const useLocalStorage = (key, defaultValue, options) => {
|
|
|
27084
27309
|
try {
|
|
27085
27310
|
updateLocalStorage();
|
|
27086
27311
|
} catch (err) {
|
|
27087
|
-
logger$
|
|
27312
|
+
logger$g.error(err);
|
|
27088
27313
|
}
|
|
27089
27314
|
}, [value]);
|
|
27090
27315
|
useEffect(() => {
|
|
@@ -27097,7 +27322,7 @@ const useLocalStorage = (key, defaultValue, options) => {
|
|
|
27097
27322
|
setValue(event.newValue ? parser(event.newValue) : void 0);
|
|
27098
27323
|
}
|
|
27099
27324
|
} catch (err) {
|
|
27100
|
-
logger$
|
|
27325
|
+
logger$g.error(err);
|
|
27101
27326
|
}
|
|
27102
27327
|
};
|
|
27103
27328
|
if (typeof window === "undefined") return;
|
|
@@ -27142,7 +27367,7 @@ const useIsEligibleForSingpass = ({
|
|
|
27142
27367
|
}
|
|
27143
27368
|
return legalEntity.type === LegalEntityType.ORGANIZATION;
|
|
27144
27369
|
};
|
|
27145
|
-
const logger$
|
|
27370
|
+
const logger$f = createLogger("useAssociatedLegalArrangement");
|
|
27146
27371
|
function useAssociatedLegalArrangement({
|
|
27147
27372
|
rootLegalEntity,
|
|
27148
27373
|
getLegalEntity: getLegalEntity2
|
|
@@ -27153,7 +27378,7 @@ function useAssociatedLegalArrangement({
|
|
|
27153
27378
|
var _a;
|
|
27154
27379
|
const foundEntity = (_a = rootLegalEntity == null ? void 0 : rootLegalEntity.entityAssociations) == null ? void 0 : _a.find((entity) => entity.type === LegalEntityType.SOLE_PROPRIETORSHIP || entity.type === LegalEntityType.TRUST);
|
|
27155
27380
|
if (foundEntity == null ? void 0 : foundEntity.legalEntityId) {
|
|
27156
|
-
getAssociatedEntity(foundEntity == null ? void 0 : foundEntity.legalEntityId).then((res) => setAssociatedLegalArrangement(res)).catch(logger$
|
|
27381
|
+
getAssociatedEntity(foundEntity == null ? void 0 : foundEntity.legalEntityId).then((res) => setAssociatedLegalArrangement(res)).catch(logger$f.error);
|
|
27157
27382
|
}
|
|
27158
27383
|
}, [getAssociatedEntity, rootLegalEntity == null ? void 0 : rootLegalEntity.entityAssociations]);
|
|
27159
27384
|
useEffect(() => {
|
|
@@ -27167,7 +27392,7 @@ function useAssociatedLegalArrangement({
|
|
|
27167
27392
|
refreshAssociatedLegalArrangement
|
|
27168
27393
|
};
|
|
27169
27394
|
}
|
|
27170
|
-
const logger$
|
|
27395
|
+
const logger$e = createLogger("useExemptSettlor");
|
|
27171
27396
|
const useExemptSettlor = ({
|
|
27172
27397
|
trust: trust2,
|
|
27173
27398
|
handleGetLegalEntity
|
|
@@ -27180,7 +27405,7 @@ const useExemptSettlor = ({
|
|
|
27180
27405
|
}, [handleGetLegalEntity]);
|
|
27181
27406
|
useEffect(() => {
|
|
27182
27407
|
if (!(trust2 == null ? void 0 : trust2.trust)) return;
|
|
27183
|
-
updateExemptSettlor(trust2).catch(logger$
|
|
27408
|
+
updateExemptSettlor(trust2).catch(logger$e.error);
|
|
27184
27409
|
}, [trust2, updateExemptSettlor]);
|
|
27185
27410
|
return exemptSettlor;
|
|
27186
27411
|
};
|
|
@@ -27540,55 +27765,6 @@ const useBusinessTypeExamples = (country2) => {
|
|
|
27540
27765
|
}, [country2]);
|
|
27541
27766
|
return examples;
|
|
27542
27767
|
};
|
|
27543
|
-
const headingTypes = {
|
|
27544
|
-
1: ({
|
|
27545
|
-
children,
|
|
27546
|
-
className
|
|
27547
|
-
}) => jsx("h1", {
|
|
27548
|
-
className,
|
|
27549
|
-
children
|
|
27550
|
-
}),
|
|
27551
|
-
2: ({
|
|
27552
|
-
children,
|
|
27553
|
-
className
|
|
27554
|
-
}) => jsx("h2", {
|
|
27555
|
-
className,
|
|
27556
|
-
children
|
|
27557
|
-
}),
|
|
27558
|
-
3: ({
|
|
27559
|
-
children,
|
|
27560
|
-
className
|
|
27561
|
-
}) => jsx("h3", {
|
|
27562
|
-
className,
|
|
27563
|
-
children
|
|
27564
|
-
}),
|
|
27565
|
-
4: ({
|
|
27566
|
-
children,
|
|
27567
|
-
className
|
|
27568
|
-
}) => jsx("h4", {
|
|
27569
|
-
className,
|
|
27570
|
-
children
|
|
27571
|
-
}),
|
|
27572
|
-
sub: ({
|
|
27573
|
-
children,
|
|
27574
|
-
className
|
|
27575
|
-
}) => jsx("div", {
|
|
27576
|
-
className,
|
|
27577
|
-
children
|
|
27578
|
-
})
|
|
27579
|
-
};
|
|
27580
|
-
function Heading({
|
|
27581
|
-
className,
|
|
27582
|
-
level,
|
|
27583
|
-
children
|
|
27584
|
-
}) {
|
|
27585
|
-
const HeadingElement = headingTypes[level] || headingTypes[1];
|
|
27586
|
-
const classNames = cx("adyen-kyc-heading", `adyen-kyc-heading--${level}`, className);
|
|
27587
|
-
return jsx(HeadingElement, {
|
|
27588
|
-
className: classNames,
|
|
27589
|
-
children
|
|
27590
|
-
});
|
|
27591
|
-
}
|
|
27592
27768
|
const trusteeTypeItems = [{
|
|
27593
27769
|
id: "individual",
|
|
27594
27770
|
name: "individual"
|
|
@@ -28200,7 +28376,8 @@ function Card({
|
|
|
28200
28376
|
level: "sub",
|
|
28201
28377
|
children: subTitle
|
|
28202
28378
|
})]
|
|
28203
|
-
}), jsx("
|
|
28379
|
+
}), jsx("div", {
|
|
28380
|
+
role: "region",
|
|
28204
28381
|
className: "adyen-kyc-card__body",
|
|
28205
28382
|
children
|
|
28206
28383
|
}), warning && jsx(Alert, {
|
|
@@ -29469,7 +29646,7 @@ const TaskListGroup = ({
|
|
|
29469
29646
|
level: 4,
|
|
29470
29647
|
children: title
|
|
29471
29648
|
})
|
|
29472
|
-
}), jsx("
|
|
29649
|
+
}), jsx("div", {
|
|
29473
29650
|
className: "adyen-kyc-card__body",
|
|
29474
29651
|
children: jsx(CardGroup, {
|
|
29475
29652
|
className: "adyen-task-list-group__items",
|
|
@@ -30070,7 +30247,7 @@ const omitObscuredFieldsIfUnchanged = (obscuredFields, dataSubmitted, savedData)
|
|
|
30070
30247
|
});
|
|
30071
30248
|
return filtered;
|
|
30072
30249
|
};
|
|
30073
|
-
const parseConfiguration$
|
|
30250
|
+
const parseConfiguration$4 = ({
|
|
30074
30251
|
matchingScenario
|
|
30075
30252
|
}) => parseIndividualScenarios(matchingScenario == null ? void 0 : matchingScenario[LegalEntityType.INDIVIDUAL]);
|
|
30076
30253
|
function IndividualDropinComponent({
|
|
@@ -30151,7 +30328,7 @@ function IndividualDropinComponent({
|
|
|
30151
30328
|
const {
|
|
30152
30329
|
fieldConfigurations
|
|
30153
30330
|
} = useScenarioConfiguration({
|
|
30154
|
-
parseConfiguration: parseConfiguration$
|
|
30331
|
+
parseConfiguration: parseConfiguration$4,
|
|
30155
30332
|
getConfigurationData,
|
|
30156
30333
|
setLoadingStatus,
|
|
30157
30334
|
country: country2
|
|
@@ -30466,7 +30643,7 @@ function IndividualDropinComponent({
|
|
|
30466
30643
|
...formatFileSummaryData2(data)
|
|
30467
30644
|
};
|
|
30468
30645
|
}
|
|
30469
|
-
if ((_c2 = summaryData
|
|
30646
|
+
if ((_c2 = summaryData.personalDetails) == null ? void 0 : _c2.accountHolder) {
|
|
30470
30647
|
summaryData.personalDetails.accountHolder = i18n.get(summaryData.personalDetails.accountHolder);
|
|
30471
30648
|
}
|
|
30472
30649
|
return summaryData;
|
|
@@ -30637,7 +30814,7 @@ const labels = () => ({
|
|
|
30637
30814
|
verifiedCurrencyCode: () => "currencyCode",
|
|
30638
30815
|
verifiedBankAccountNumber: () => "bankAccountNumber"
|
|
30639
30816
|
});
|
|
30640
|
-
const parseConfiguration$
|
|
30817
|
+
const parseConfiguration$3 = ({
|
|
30641
30818
|
requiredFields,
|
|
30642
30819
|
country: country2,
|
|
30643
30820
|
bankVerificationAvailable
|
|
@@ -30777,7 +30954,7 @@ function PayoutDetailsDropinComponent({
|
|
|
30777
30954
|
requiredFields,
|
|
30778
30955
|
bankVerificationVendors
|
|
30779
30956
|
} = useScenarioConfiguration({
|
|
30780
|
-
parseConfiguration: parseConfiguration$
|
|
30957
|
+
parseConfiguration: parseConfiguration$3,
|
|
30781
30958
|
getConfigurationData,
|
|
30782
30959
|
getPayoutAccountFormatData,
|
|
30783
30960
|
instantVerificationEnabled,
|
|
@@ -31938,7 +32115,7 @@ const serviceAgreementValidationRules = {
|
|
|
31938
32115
|
errorMessage: "fieldIsRequired"
|
|
31939
32116
|
}
|
|
31940
32117
|
};
|
|
31941
|
-
const logger$
|
|
32118
|
+
const logger$d = createLogger("useServiceAgreement");
|
|
31942
32119
|
const FALLBACK_LANGUAGE_CODE = "en";
|
|
31943
32120
|
const useServiceAgreement = ({
|
|
31944
32121
|
handleGetServiceAgreement,
|
|
@@ -31971,7 +32148,7 @@ const useServiceAgreement = ({
|
|
|
31971
32148
|
contract
|
|
31972
32149
|
});
|
|
31973
32150
|
};
|
|
31974
|
-
requestAcceptedServiceAgreement().catch(logger$
|
|
32151
|
+
requestAcceptedServiceAgreement().catch(logger$d.error).finally(() => setLoading("success"));
|
|
31975
32152
|
}, [acceptanceId, handleViewAcceptedTermsOfServiceDocument]);
|
|
31976
32153
|
useEffect(() => {
|
|
31977
32154
|
const requestServiceAgreement = async () => {
|
|
@@ -31986,7 +32163,7 @@ const useServiceAgreement = ({
|
|
|
31986
32163
|
language: agreementLanguage
|
|
31987
32164
|
});
|
|
31988
32165
|
if (!document2) {
|
|
31989
|
-
logger$
|
|
32166
|
+
logger$d.log('"document" field was missing in response');
|
|
31990
32167
|
return;
|
|
31991
32168
|
}
|
|
31992
32169
|
const contract = JSON.parse(decodeURIComponent(escape(window.atob(document2))));
|
|
@@ -32004,7 +32181,7 @@ const useServiceAgreement = ({
|
|
|
32004
32181
|
throw err;
|
|
32005
32182
|
}
|
|
32006
32183
|
};
|
|
32007
|
-
requestServiceAgreement().catch(logger$
|
|
32184
|
+
requestServiceAgreement().catch(logger$d.error);
|
|
32008
32185
|
}, [handleGetServiceAgreement, handleServiceAgreementIsNotAvailableInThatLanguage, agreementLanguage, legalEntityId, serviceAgreementType]);
|
|
32009
32186
|
return {
|
|
32010
32187
|
loading: loading2,
|
|
@@ -32308,7 +32485,7 @@ function ServiceAgreementDropinComponent({
|
|
|
32308
32485
|
})
|
|
32309
32486
|
});
|
|
32310
32487
|
}
|
|
32311
|
-
const parseConfiguration$
|
|
32488
|
+
const parseConfiguration$2 = ({
|
|
32312
32489
|
matchingScenario,
|
|
32313
32490
|
country: country2
|
|
32314
32491
|
}) => parseSolePropScenarios(matchingScenario[LegalEntityType.SOLE_PROPRIETORSHIP], country2);
|
|
@@ -32410,7 +32587,7 @@ function SolePropDropinComponent({
|
|
|
32410
32587
|
fieldConfigurations,
|
|
32411
32588
|
requiredFields
|
|
32412
32589
|
} = useScenarioConfiguration({
|
|
32413
|
-
parseConfiguration: parseConfiguration$
|
|
32590
|
+
parseConfiguration: parseConfiguration$2,
|
|
32414
32591
|
getConfigurationData,
|
|
32415
32592
|
setLoadingStatus,
|
|
32416
32593
|
country: country2
|
|
@@ -32503,7 +32680,7 @@ function SolePropDropinComponent({
|
|
|
32503
32680
|
const dataSubmitted = data;
|
|
32504
32681
|
setLoadingStatus("loading");
|
|
32505
32682
|
try {
|
|
32506
|
-
const legalEntity = await handleSubmitLegalEntity(mapSolePropToLegalEntity(dataSubmitted
|
|
32683
|
+
const legalEntity = await handleSubmitLegalEntity(mapSolePropToLegalEntity(dataSubmitted));
|
|
32507
32684
|
await submitDocuments2({
|
|
32508
32685
|
forms: forms2,
|
|
32509
32686
|
legalEntity,
|
|
@@ -32547,18 +32724,18 @@ function SolePropDropinComponent({
|
|
|
32547
32724
|
if (isCountryOfGoverningLawEnabled) {
|
|
32548
32725
|
summaryData.solePropNameAndCountry = getUpdatedCountryOfGoverningLaw(summaryData.solePropNameAndCountry);
|
|
32549
32726
|
}
|
|
32550
|
-
const solePropCountry = ((_a2 = summaryData
|
|
32727
|
+
const solePropCountry = ((_a2 = summaryData.solePropNameAndCountry) == null ? void 0 : _a2.country) && datasetUtils.getCountryName(summaryData.solePropNameAndCountry.country);
|
|
32551
32728
|
summaryData.solePropNameAndCountry = {
|
|
32552
32729
|
legalNameOfSoleProprietor: (_b2 = data2.solePropNameAndCountry) == null ? void 0 : _b2.legalCompanyName,
|
|
32553
32730
|
countryRegionOfEstablishment: solePropCountry,
|
|
32554
|
-
countryOfGoverningLaw: ((_c = summaryData
|
|
32731
|
+
countryOfGoverningLaw: ((_c = summaryData.solePropNameAndCountry) == null ? void 0 : _c.countryOfGoverningLaw) && datasetUtils.getCountryName(summaryData.solePropNameAndCountry.countryOfGoverningLaw)
|
|
32555
32732
|
};
|
|
32556
|
-
if ((_d = summaryData
|
|
32733
|
+
if ((_d = summaryData.solePropRegistrationAddress) == null ? void 0 : _d.registrationAddress) {
|
|
32557
32734
|
summaryData.solePropRegistrationAddress.hasInnerForms = true;
|
|
32558
|
-
summaryData.solePropRegistrationAddress.registrationAddress = mapAddressLabels(summaryData
|
|
32735
|
+
summaryData.solePropRegistrationAddress.registrationAddress = mapAddressLabels(summaryData.solePropRegistrationAddress.registrationAddress, datasetUtils);
|
|
32559
32736
|
}
|
|
32560
|
-
if ((_e = summaryData
|
|
32561
|
-
summaryData.solePropRegistrationAddress.operationalAddress = mapAddressLabels(summaryData
|
|
32737
|
+
if ((_e = summaryData.solePropRegistrationAddress) == null ? void 0 : _e.operationalAddress) {
|
|
32738
|
+
summaryData.solePropRegistrationAddress.operationalAddress = mapAddressLabels(summaryData.solePropRegistrationAddress.operationalAddress, datasetUtils);
|
|
32562
32739
|
}
|
|
32563
32740
|
if (isDocumentsRequired(forms22)) {
|
|
32564
32741
|
delete summaryData[solePropDocumentFormId];
|
|
@@ -32641,7 +32818,7 @@ const rules = ({
|
|
|
32641
32818
|
}
|
|
32642
32819
|
}
|
|
32643
32820
|
});
|
|
32644
|
-
const parseConfiguration = ({
|
|
32821
|
+
const parseConfiguration$1 = ({
|
|
32645
32822
|
matchingScenario,
|
|
32646
32823
|
country: country2
|
|
32647
32824
|
}) => parseTrustScenarios(matchingScenario == null ? void 0 : matchingScenario[LegalEntityType.TRUST], country2);
|
|
@@ -32695,7 +32872,7 @@ function TrustDropinComponent({
|
|
|
32695
32872
|
fieldConfigurations,
|
|
32696
32873
|
requiredFields
|
|
32697
32874
|
} = useScenarioConfiguration({
|
|
32698
|
-
parseConfiguration,
|
|
32875
|
+
parseConfiguration: parseConfiguration$1,
|
|
32699
32876
|
getConfigurationData,
|
|
32700
32877
|
setLoadingStatus,
|
|
32701
32878
|
country: country2
|
|
@@ -32826,34 +33003,31 @@ function TrustDropinComponent({
|
|
|
32826
33003
|
await handleUpdateLegalEntity(updatedParentLegalEntity, parentLegalEntity.id);
|
|
32827
33004
|
};
|
|
32828
33005
|
const formatDataForSummary2 = (data2, forms22) => {
|
|
32829
|
-
var _a2, _b, _c
|
|
33006
|
+
var _a2, _b, _c;
|
|
32830
33007
|
let summaryData = cloneObject(data2) || {};
|
|
32831
|
-
if (summaryData
|
|
32832
|
-
const trustCountry =
|
|
32833
|
-
const trustType2 = ((
|
|
32834
|
-
var _a3;
|
|
32835
|
-
return trustType22.id === ((_a3 = summaryData.trustRegistrationDetails) == null ? void 0 : _a3.trustType);
|
|
32836
|
-
})) == null ? void 0 : _c.name) : void 0;
|
|
33008
|
+
if (summaryData.trustRegistrationDetails) {
|
|
33009
|
+
const trustCountry = summaryData.trustRegistrationDetails.country && datasetUtils.getCountryName(summaryData.trustRegistrationDetails.country);
|
|
33010
|
+
const trustType2 = summaryData.trustRegistrationDetails.trustType && i18n.get((_a2 = trustTypeOptions.find((option) => option.id === summaryData.trustRegistrationDetails.trustType)) == null ? void 0 : _a2.name);
|
|
32837
33011
|
summaryData.trustRegistrationDetails = {
|
|
32838
|
-
nameOfTrustAgreement:
|
|
33012
|
+
nameOfTrustAgreement: summaryData.trustRegistrationDetails.legalName,
|
|
32839
33013
|
countryRegionOfEstablishment: trustCountry,
|
|
32840
33014
|
typeOfTrustAgreement: trustType2,
|
|
32841
|
-
objectOfTrust:
|
|
32842
|
-
taxId:
|
|
33015
|
+
objectOfTrust: summaryData.trustRegistrationDetails.objectOfTrust,
|
|
33016
|
+
taxId: summaryData.trustRegistrationDetails.taxId
|
|
32843
33017
|
};
|
|
32844
33018
|
}
|
|
32845
|
-
if ((
|
|
33019
|
+
if ((_b = summaryData.trustRegistrationAddress) == null ? void 0 : _b.registrationAddress) {
|
|
32846
33020
|
summaryData.trustRegistrationAddress.hasInnerForms = true;
|
|
32847
|
-
summaryData.trustRegistrationAddress.registrationAddress = mapAddressLabels(summaryData
|
|
33021
|
+
summaryData.trustRegistrationAddress.registrationAddress = mapAddressLabels(summaryData.trustRegistrationAddress.registrationAddress, datasetUtils);
|
|
32848
33022
|
}
|
|
32849
|
-
if ((
|
|
32850
|
-
summaryData.trustRegistrationAddress.operationalAddress = mapAddressLabels(summaryData
|
|
33023
|
+
if ((_c = summaryData.trustRegistrationAddress) == null ? void 0 : _c.operationalAddress) {
|
|
33024
|
+
summaryData.trustRegistrationAddress.operationalAddress = mapAddressLabels(summaryData.trustRegistrationAddress.operationalAddress, datasetUtils);
|
|
32851
33025
|
}
|
|
32852
33026
|
if (isDocumentsRequired2(forms22)) {
|
|
32853
33027
|
delete summaryData[trustConstitutionalDocumentFormId];
|
|
32854
33028
|
summaryData = {
|
|
32855
33029
|
...summaryData,
|
|
32856
|
-
...formatFileSummaryData2(summaryData
|
|
33030
|
+
...formatFileSummaryData2(summaryData.trustConstitutionalDocument)
|
|
32857
33031
|
};
|
|
32858
33032
|
}
|
|
32859
33033
|
return summaryData;
|
|
@@ -33031,7 +33205,7 @@ const hasProgressedBeyondEntitySelection = (legalEntity) => {
|
|
|
33031
33205
|
};
|
|
33032
33206
|
const PAGES_WITH_POLLING = [TaskTypes.DECISION_MAKER_OVERVIEW, TaskTypes.TASKS_OVERVIEW];
|
|
33033
33207
|
const POLLING_INTERVAL = 3e3;
|
|
33034
|
-
const logger$
|
|
33208
|
+
const logger$c = createLogger("DropinComposerComponent");
|
|
33035
33209
|
const isOrganizationSettlorWithExemptionReasonEnabled = (enabled, country2) => country2 === CountryCodes.Australia && enabled;
|
|
33036
33210
|
function DropinComposerComponent({
|
|
33037
33211
|
capabilities,
|
|
@@ -33139,7 +33313,7 @@ function DropinComposerComponent({
|
|
|
33139
33313
|
setPciStatus(response);
|
|
33140
33314
|
return response;
|
|
33141
33315
|
} catch (e) {
|
|
33142
|
-
logger$
|
|
33316
|
+
logger$c.warn(i18n.get("failedToGetPciStatus"));
|
|
33143
33317
|
}
|
|
33144
33318
|
}
|
|
33145
33319
|
return void 0;
|
|
@@ -33167,7 +33341,7 @@ function DropinComposerComponent({
|
|
|
33167
33341
|
}, [additionalSalesChannels, i18n, rootLegalEntity.id, args.handleGetPciTemplate]);
|
|
33168
33342
|
useEffect(() => {
|
|
33169
33343
|
if (!tasks.includes(TaskTypes.PCI_DSS)) return;
|
|
33170
|
-
getPciTemplate2().catch(logger$
|
|
33344
|
+
getPciTemplate2().catch(logger$c.error);
|
|
33171
33345
|
}, [getPciTemplate2, tasks]);
|
|
33172
33346
|
const addFetchedAcceptedByName = async (acceptanceInfo) => {
|
|
33173
33347
|
try {
|
|
@@ -33177,21 +33351,21 @@ function DropinComposerComponent({
|
|
|
33177
33351
|
acceptedByName: getLegalEntityNameBasedOnType(acceptedByEntity)
|
|
33178
33352
|
};
|
|
33179
33353
|
} catch (e) {
|
|
33180
|
-
logger$
|
|
33354
|
+
logger$c.warn(i18n.get("failedToFetchAcceptedByName"));
|
|
33181
33355
|
return {
|
|
33182
33356
|
...acceptanceInfo,
|
|
33183
33357
|
acceptedByName: null
|
|
33184
33358
|
};
|
|
33185
33359
|
}
|
|
33186
33360
|
};
|
|
33187
|
-
const
|
|
33361
|
+
const getServiceAgreementAcceptanceInfos2 = async () => {
|
|
33188
33362
|
if (rootLegalEntity.id && (args == null ? void 0 : args.handleGetServiceAgreementAcceptanceInfos)) {
|
|
33189
33363
|
try {
|
|
33190
33364
|
const response = await args.handleGetServiceAgreementAcceptanceInfos(rootLegalEntity.id);
|
|
33191
33365
|
const serviceAgreementAcceptanceInfosWithNames2 = await Promise.all(response.data.map(addFetchedAcceptedByName));
|
|
33192
33366
|
setServiceAgreementAcceptanceInfosWithNames(serviceAgreementAcceptanceInfosWithNames2);
|
|
33193
33367
|
} catch (e) {
|
|
33194
|
-
logger$
|
|
33368
|
+
logger$c.warn(i18n.get("failedToGetServiceAgreementStatus"));
|
|
33195
33369
|
}
|
|
33196
33370
|
}
|
|
33197
33371
|
};
|
|
@@ -33201,7 +33375,7 @@ function DropinComposerComponent({
|
|
|
33201
33375
|
const response = await args.handleGetServiceAgreementStatus(rootLegalEntity.id);
|
|
33202
33376
|
setServiceAgreementTypes(response.termsOfServiceTypes);
|
|
33203
33377
|
} catch (e) {
|
|
33204
|
-
logger$
|
|
33378
|
+
logger$c.warn(i18n.get("failedToGetServiceAgreementStatus"));
|
|
33205
33379
|
}
|
|
33206
33380
|
}
|
|
33207
33381
|
};
|
|
@@ -33240,7 +33414,7 @@ function DropinComposerComponent({
|
|
|
33240
33414
|
setCapabilityProblems(getCapabilityProblems(response, rootLegalEntityCountry, isExperimentEnabled));
|
|
33241
33415
|
return response;
|
|
33242
33416
|
} catch (e) {
|
|
33243
|
-
logger$
|
|
33417
|
+
logger$c.warn(i18n.get("failedToFetchLegalEntityDetails"));
|
|
33244
33418
|
}
|
|
33245
33419
|
}
|
|
33246
33420
|
return void 0;
|
|
@@ -33290,7 +33464,7 @@ function DropinComposerComponent({
|
|
|
33290
33464
|
label: i18n.get("successFullyRemovedTrustMember")
|
|
33291
33465
|
});
|
|
33292
33466
|
} catch (err) {
|
|
33293
|
-
logger$
|
|
33467
|
+
logger$c.error(`Failed to delete trust member`, err);
|
|
33294
33468
|
showToast({
|
|
33295
33469
|
type: ToastType.ERROR,
|
|
33296
33470
|
label: i18n.get("failedToRemoveTrustMember")
|
|
@@ -33360,7 +33534,7 @@ function DropinComposerComponent({
|
|
|
33360
33534
|
}
|
|
33361
33535
|
break;
|
|
33362
33536
|
default:
|
|
33363
|
-
logger$
|
|
33537
|
+
logger$c.warn(`Updating trust member type "${trustMember.trustMemberType}" is not implemented.`);
|
|
33364
33538
|
}
|
|
33365
33539
|
showToast({
|
|
33366
33540
|
label: i18n.get("successfullyUpdatedDetails"),
|
|
@@ -33368,7 +33542,7 @@ function DropinComposerComponent({
|
|
|
33368
33542
|
});
|
|
33369
33543
|
await refreshLegalArrangementAndRunOnSubmit(associatedLegalArrangement, 1);
|
|
33370
33544
|
} catch (err) {
|
|
33371
|
-
logger$
|
|
33545
|
+
logger$c.error(err);
|
|
33372
33546
|
showToast({
|
|
33373
33547
|
label: i18n.get("failedToUpdateDetails"),
|
|
33374
33548
|
type: ToastType.ERROR
|
|
@@ -33389,7 +33563,7 @@ function DropinComposerComponent({
|
|
|
33389
33563
|
navigateTo(TaskTypes.TASKS_OVERVIEW);
|
|
33390
33564
|
}
|
|
33391
33565
|
} catch (e) {
|
|
33392
|
-
logger$
|
|
33566
|
+
logger$c.error(e);
|
|
33393
33567
|
showToast({
|
|
33394
33568
|
label: i18n.get("failToLaunchSingpass"),
|
|
33395
33569
|
type: ToastType.ERROR
|
|
@@ -33592,11 +33766,11 @@ function DropinComposerComponent({
|
|
|
33592
33766
|
await getPciStatus2();
|
|
33593
33767
|
}
|
|
33594
33768
|
await getServiceAgreementStatus2();
|
|
33595
|
-
await
|
|
33769
|
+
await getServiceAgreementAcceptanceInfos2();
|
|
33596
33770
|
}
|
|
33597
33771
|
};
|
|
33598
33772
|
setIsLoadingConfiguration(true);
|
|
33599
|
-
fetchConfiguration().catch(logger$
|
|
33773
|
+
fetchConfiguration().catch(logger$c.error).finally(() => {
|
|
33600
33774
|
setIsLoadingConfiguration(false);
|
|
33601
33775
|
onLoad();
|
|
33602
33776
|
});
|
|
@@ -33614,7 +33788,7 @@ function DropinComposerComponent({
|
|
|
33614
33788
|
return;
|
|
33615
33789
|
}
|
|
33616
33790
|
const timeoutId = setTimeout(() => {
|
|
33617
|
-
refreshLegalEntity().catch(logger$
|
|
33791
|
+
refreshLegalEntity().catch(logger$c.error);
|
|
33618
33792
|
}, POLLING_INTERVAL);
|
|
33619
33793
|
return () => {
|
|
33620
33794
|
clearInterval(timeoutId);
|
|
@@ -34040,7 +34214,7 @@ function DropinComposerComponent({
|
|
|
34040
34214
|
handleSign: async (...params) => {
|
|
34041
34215
|
await args.handleSignServiceAgreement(...params);
|
|
34042
34216
|
await getServiceAgreementStatus2();
|
|
34043
|
-
await
|
|
34217
|
+
await getServiceAgreementAcceptanceInfos2();
|
|
34044
34218
|
}
|
|
34045
34219
|
});
|
|
34046
34220
|
case TaskTypes.LEGAL_ENTITY_TYPE_SWITCHER:
|
|
@@ -34083,7 +34257,7 @@ const createLegalEntity = async (context, legalEntity) => {
|
|
|
34083
34257
|
return httpPost({
|
|
34084
34258
|
loadingContext,
|
|
34085
34259
|
errorLevel: "warn",
|
|
34086
|
-
errorMessage:
|
|
34260
|
+
errorMessage: "LegalEntity create failed",
|
|
34087
34261
|
path: `${legalEntityId}`,
|
|
34088
34262
|
authentication: "jwt",
|
|
34089
34263
|
headers: {
|
|
@@ -34412,7 +34586,7 @@ const getIdverificationToken = async (context, request) => {
|
|
|
34412
34586
|
loadingContext,
|
|
34413
34587
|
errorLevel: "warn",
|
|
34414
34588
|
errorMessage: `Failed to find address`,
|
|
34415
|
-
path: `${legalEntityId}/providers/
|
|
34589
|
+
path: `${legalEntityId}/providers/idVerification/initiate`,
|
|
34416
34590
|
authentication: "jwt",
|
|
34417
34591
|
headers: {
|
|
34418
34592
|
"Content-Type": "application/json"
|
|
@@ -34499,7 +34673,7 @@ const getServiceAgreement = async (context, data) => {
|
|
|
34499
34673
|
}
|
|
34500
34674
|
}, data);
|
|
34501
34675
|
};
|
|
34502
|
-
const
|
|
34676
|
+
const getServiceAgreementAcceptanceInfos = async (context) => {
|
|
34503
34677
|
const {
|
|
34504
34678
|
loadingContext,
|
|
34505
34679
|
legalEntityId
|
|
@@ -34508,7 +34682,7 @@ const getServiceAgreementAcceptanceInfo = async (context) => {
|
|
|
34508
34682
|
loadingContext,
|
|
34509
34683
|
errorLevel: "warn",
|
|
34510
34684
|
errorMessage: `Failed to get service agreement acceptance info`,
|
|
34511
|
-
path: `${legalEntityId}/termsOfService/
|
|
34685
|
+
path: `${legalEntityId}/termsOfService/termsOfServiceAcceptanceInfos`,
|
|
34512
34686
|
authentication: "jwt",
|
|
34513
34687
|
headers: {
|
|
34514
34688
|
"Content-Type": "application/json"
|
|
@@ -34562,7 +34736,7 @@ const idVerificationStartcheck = async (context, request) => {
|
|
|
34562
34736
|
loadingContext,
|
|
34563
34737
|
errorLevel: "warn",
|
|
34564
34738
|
errorMessage: `Failed to find address`,
|
|
34565
|
-
path: `${legalEntityId}/providers/
|
|
34739
|
+
path: `${legalEntityId}/providers/idVerification/process`,
|
|
34566
34740
|
authentication: "jwt",
|
|
34567
34741
|
headers: {
|
|
34568
34742
|
"Content-Type": "application/json"
|
|
@@ -34626,10 +34800,7 @@ const useComponentApi = (rootLegalEntityId) => {
|
|
|
34626
34800
|
...baseRequestContext,
|
|
34627
34801
|
legalEntityId
|
|
34628
34802
|
}, legalEntity),
|
|
34629
|
-
createLegalEntity: async (legalEntity) => createLegalEntity(
|
|
34630
|
-
...baseRequestContext,
|
|
34631
|
-
legalEntityId: rootLegalEntityId
|
|
34632
|
-
}, legalEntity),
|
|
34803
|
+
createLegalEntity: async (legalEntity) => createLegalEntity(baseRequestContext, legalEntity),
|
|
34633
34804
|
getTransferInstrument: async (transferInstrumentId) => getTransferInstrument(baseRequestContext, transferInstrumentId),
|
|
34634
34805
|
getBankVerificationVendor: async (country2, openBankingPartnerConfigId) => getBankVerificationVendor(baseRequestContext, country2, openBankingPartnerConfigId),
|
|
34635
34806
|
getDocument: async (documentId) => getDocument(baseRequestContext, documentId),
|
|
@@ -34667,7 +34838,7 @@ const useComponentApi = (rootLegalEntityId) => {
|
|
|
34667
34838
|
...baseRequestContext,
|
|
34668
34839
|
legalEntityId
|
|
34669
34840
|
}, pciReference),
|
|
34670
|
-
getServiceAgreementAcceptanceInfos: async (legalEntityId) =>
|
|
34841
|
+
getServiceAgreementAcceptanceInfos: async (legalEntityId) => getServiceAgreementAcceptanceInfos({
|
|
34671
34842
|
...baseRequestContext,
|
|
34672
34843
|
legalEntityId
|
|
34673
34844
|
}),
|
|
@@ -34686,7 +34857,7 @@ const useComponentApi = (rootLegalEntityId) => {
|
|
|
34686
34857
|
};
|
|
34687
34858
|
}, [base, rootLegalEntityId]);
|
|
34688
34859
|
};
|
|
34689
|
-
const logger$
|
|
34860
|
+
const logger$b = createLogger("CreateIndividualComponent");
|
|
34690
34861
|
function CreateIndividualComponent({
|
|
34691
34862
|
parentLegalEntityId,
|
|
34692
34863
|
legalEntityId,
|
|
@@ -34722,13 +34893,13 @@ function CreateIndividualComponent({
|
|
|
34722
34893
|
setParentLegalEntity(parentEntity);
|
|
34723
34894
|
setLegalEntity(entity);
|
|
34724
34895
|
} catch (error) {
|
|
34725
|
-
logger$
|
|
34896
|
+
logger$b.error(error);
|
|
34726
34897
|
} finally {
|
|
34727
34898
|
setLoadingStatus("success");
|
|
34728
34899
|
}
|
|
34729
34900
|
}, [parentLegalEntityId, legalEntityId, getLegalEntity2]);
|
|
34730
34901
|
useEffect(() => {
|
|
34731
|
-
fetchLegalEntity().catch(logger$
|
|
34902
|
+
fetchLegalEntity().catch(logger$b.error);
|
|
34732
34903
|
}, [fetchLegalEntity]);
|
|
34733
34904
|
const country2 = ((_a = legalEntity == null ? void 0 : legalEntity.individual) == null ? void 0 : _a.residentialAddress.country) ?? contextCountry;
|
|
34734
34905
|
return loadingStatus === "loading" ? jsx(Loader, {
|
|
@@ -34752,7 +34923,7 @@ function CreateIndividualComponent({
|
|
|
34752
34923
|
taskType
|
|
34753
34924
|
});
|
|
34754
34925
|
}
|
|
34755
|
-
const logger$
|
|
34926
|
+
const logger$a = createLogger("CreateTransferInstrumentComponent");
|
|
34756
34927
|
function CreateTransferInstrumentComponent({
|
|
34757
34928
|
legalEntityId,
|
|
34758
34929
|
transferInstrumentId,
|
|
@@ -34794,7 +34965,7 @@ function CreateTransferInstrumentComponent({
|
|
|
34794
34965
|
const ti = await getTransferInstrument2(transferInstrumentId);
|
|
34795
34966
|
setTransferInstrument(ti);
|
|
34796
34967
|
}
|
|
34797
|
-
})().catch(logger$
|
|
34968
|
+
})().catch(logger$a.error).finally(() => {
|
|
34798
34969
|
setLoadingStatus("success");
|
|
34799
34970
|
});
|
|
34800
34971
|
}, [transferInstrumentId, fetchLegalEntity, getTransferInstrument2]);
|
|
@@ -34993,7 +35164,7 @@ function ManageTransferInstrumentOverviewItem({
|
|
|
34993
35164
|
})
|
|
34994
35165
|
}, transferInstrumentReference.transferInstrument.id);
|
|
34995
35166
|
}
|
|
34996
|
-
const logger$
|
|
35167
|
+
const logger$9 = createLogger("ManageTransferInstrumentOverview");
|
|
34997
35168
|
function ManageTransferInstrumentOverview({
|
|
34998
35169
|
transferInstrumentReferences,
|
|
34999
35170
|
onAdd,
|
|
@@ -35018,7 +35189,7 @@ function ManageTransferInstrumentOverview({
|
|
|
35018
35189
|
...transferInstrumentsMap
|
|
35019
35190
|
});
|
|
35020
35191
|
} catch (e) {
|
|
35021
|
-
logger$
|
|
35192
|
+
logger$9.error(e);
|
|
35022
35193
|
}
|
|
35023
35194
|
};
|
|
35024
35195
|
const onRemoveTransferinstrument = async (transferInstrumentId) => {
|
|
@@ -35026,7 +35197,7 @@ function ManageTransferInstrumentOverview({
|
|
|
35026
35197
|
await deleteTransferInstrument2(transferInstrumentId);
|
|
35027
35198
|
onRemove(transferInstrumentId);
|
|
35028
35199
|
} catch (e) {
|
|
35029
|
-
logger$
|
|
35200
|
+
logger$9.error(e);
|
|
35030
35201
|
}
|
|
35031
35202
|
};
|
|
35032
35203
|
const transferInstrumentListEle = transferInstrumentReferences.map((transferInstrumentRef) => jsx(ManageTransferInstrumentOverviewItem, {
|
|
@@ -35051,7 +35222,7 @@ function ManageTransferInstrumentOverview({
|
|
|
35051
35222
|
})]
|
|
35052
35223
|
});
|
|
35053
35224
|
}
|
|
35054
|
-
const logger$
|
|
35225
|
+
const logger$8 = createLogger("ManageTransferInstrumentComponent");
|
|
35055
35226
|
function ManageTransferInstrumentComponent({
|
|
35056
35227
|
legalEntityId,
|
|
35057
35228
|
onAdd,
|
|
@@ -35087,7 +35258,7 @@ function ManageTransferInstrumentComponent({
|
|
|
35087
35258
|
}, [getTransferInstruments2, getLegalEntity2, i18n, legalEntityId]);
|
|
35088
35259
|
useEffect(() => {
|
|
35089
35260
|
eventEmitter == null ? void 0 : eventEmitter.on("updateLocale", (locale) => setLocale(locale));
|
|
35090
|
-
init2().catch(logger$
|
|
35261
|
+
init2().catch(logger$8.error).finally(() => {
|
|
35091
35262
|
setLoadingStatus("success");
|
|
35092
35263
|
});
|
|
35093
35264
|
}, [init2, setLocale, eventEmitter]);
|
|
@@ -35097,7 +35268,7 @@ function ManageTransferInstrumentComponent({
|
|
|
35097
35268
|
}
|
|
35098
35269
|
}, [hasOnlyVerifiedTransferInstruments, timeoutId, transferInstruments]);
|
|
35099
35270
|
const onRemove = (transferInstrumentId) => {
|
|
35100
|
-
refreshTransferInstruments().catch(logger$
|
|
35271
|
+
refreshTransferInstruments().catch(logger$8.error);
|
|
35101
35272
|
onRemoveSuccess == null ? void 0 : onRemoveSuccess(transferInstrumentId, legalEntityId);
|
|
35102
35273
|
};
|
|
35103
35274
|
const render2 = () => {
|
|
@@ -35125,9 +35296,10 @@ function ManageTransferInstrumentComponent({
|
|
|
35125
35296
|
children: render2()
|
|
35126
35297
|
});
|
|
35127
35298
|
}
|
|
35128
|
-
const logger$
|
|
35299
|
+
const logger$7 = createLogger("CreateIndividualComponent");
|
|
35129
35300
|
function OnboardingDropinComponent({
|
|
35130
|
-
legalEntityId
|
|
35301
|
+
legalEntityId,
|
|
35302
|
+
openBankingPartnerConfigId
|
|
35131
35303
|
}) {
|
|
35132
35304
|
if (!legalEntityId) {
|
|
35133
35305
|
throw new Error("Must provide at-least legalEntityId");
|
|
@@ -35153,10 +35325,11 @@ function OnboardingDropinComponent({
|
|
|
35153
35325
|
signPci: signPci2,
|
|
35154
35326
|
getPciQuestionnaires: getPciQuestionnaires2,
|
|
35155
35327
|
downloadPci: downloadPci2,
|
|
35156
|
-
getServiceAgreementAcceptanceInfos,
|
|
35328
|
+
getServiceAgreementAcceptanceInfos: getServiceAgreementAcceptanceInfos2,
|
|
35157
35329
|
getServiceAgreementStatus: getServiceAgreementStatus2,
|
|
35158
35330
|
getServiceAgreement: getServiceAgreement2,
|
|
35159
|
-
acceptServiceAgreement: acceptServiceAgreement2
|
|
35331
|
+
acceptServiceAgreement: acceptServiceAgreement2,
|
|
35332
|
+
getBankVerificationVendor: getBankVerificationVendor2
|
|
35160
35333
|
} = useComponentApi(legalEntityId);
|
|
35161
35334
|
const [legalEntity, setLegalEntity] = useState();
|
|
35162
35335
|
const [loadingStatus, setLoadingStatus] = useState("loading");
|
|
@@ -35165,13 +35338,13 @@ function OnboardingDropinComponent({
|
|
|
35165
35338
|
const le = await getLegalEntity2(legalEntityId);
|
|
35166
35339
|
setLegalEntity(le);
|
|
35167
35340
|
} catch (error) {
|
|
35168
|
-
logger$
|
|
35341
|
+
logger$7.error(error);
|
|
35169
35342
|
} finally {
|
|
35170
35343
|
setLoadingStatus("success");
|
|
35171
35344
|
}
|
|
35172
35345
|
}, [legalEntityId, getLegalEntity2]);
|
|
35173
35346
|
useEffect(() => {
|
|
35174
|
-
fetchLegalEntity().catch(logger$
|
|
35347
|
+
fetchLegalEntity().catch(logger$7.error);
|
|
35175
35348
|
}, [fetchLegalEntity]);
|
|
35176
35349
|
return loadingStatus === "loading" || !legalEntity ? jsx(Loader, {
|
|
35177
35350
|
size: "medium"
|
|
@@ -35192,7 +35365,7 @@ function OnboardingDropinComponent({
|
|
|
35192
35365
|
handleSignPci: signPci2,
|
|
35193
35366
|
handleGetPciQuestionnaires: getPciQuestionnaires2,
|
|
35194
35367
|
handleDownloadPci: downloadPci2,
|
|
35195
|
-
handleGetServiceAgreementAcceptanceInfos:
|
|
35368
|
+
handleGetServiceAgreementAcceptanceInfos: getServiceAgreementAcceptanceInfos2,
|
|
35196
35369
|
handleGetServiceAgreementStatus: getServiceAgreementStatus2,
|
|
35197
35370
|
handleGetServiceAgreement: getServiceAgreement2,
|
|
35198
35371
|
handleSignServiceAgreement: acceptServiceAgreement2,
|
|
@@ -35200,7 +35373,448 @@ function OnboardingDropinComponent({
|
|
|
35200
35373
|
handleGetTransferInstrument: getTransferInstrument2,
|
|
35201
35374
|
handleDeleteTransferInstrument: deleteTransferInstrument2,
|
|
35202
35375
|
handleUpdateTransferInstrument: updateTransferInstrument2,
|
|
35203
|
-
handleCreateTrustedTransferInstrument: createTrustedTransferInstrument2
|
|
35376
|
+
handleCreateTrustedTransferInstrument: createTrustedTransferInstrument2,
|
|
35377
|
+
handleGetBankVerificationVendors: (country2) => getBankVerificationVendor2(country2, openBankingPartnerConfigId)
|
|
35378
|
+
});
|
|
35379
|
+
}
|
|
35380
|
+
const highExposureCompanyDetailsValidations = {
|
|
35381
|
+
country: {
|
|
35382
|
+
modes: ["blur"],
|
|
35383
|
+
validate: (country2) => !isEmpty(country2),
|
|
35384
|
+
errorMessage: "fieldIsRequired"
|
|
35385
|
+
},
|
|
35386
|
+
numberOfEmployees: {
|
|
35387
|
+
modes: ["blur"],
|
|
35388
|
+
validate: (numberOfEmployees2) => !isEmpty(numberOfEmployees2),
|
|
35389
|
+
errorMessage: "fieldIsRequired"
|
|
35390
|
+
}
|
|
35391
|
+
};
|
|
35392
|
+
const highExposureCompanyDetailsFields = ["numberOfEmployees"];
|
|
35393
|
+
function AdditionalFieldsForHighExposureCompany({
|
|
35394
|
+
requiredFields,
|
|
35395
|
+
...props
|
|
35396
|
+
}) {
|
|
35397
|
+
const {
|
|
35398
|
+
i18n
|
|
35399
|
+
} = useI18nContext();
|
|
35400
|
+
const {
|
|
35401
|
+
handleChangeFor,
|
|
35402
|
+
data,
|
|
35403
|
+
valid,
|
|
35404
|
+
errors,
|
|
35405
|
+
fieldProblems
|
|
35406
|
+
} = useForm({
|
|
35407
|
+
...props,
|
|
35408
|
+
schema: ["numberOfEmployees"],
|
|
35409
|
+
defaultData: {
|
|
35410
|
+
...props.data
|
|
35411
|
+
},
|
|
35412
|
+
rules: props.validators || highExposureCompanyDetailsValidations,
|
|
35413
|
+
fieldProblems: props == null ? void 0 : props.fieldValidationErrors
|
|
35414
|
+
});
|
|
35415
|
+
const formUtils = formUtilities(props, i18n);
|
|
35416
|
+
const {
|
|
35417
|
+
updateStateSlice
|
|
35418
|
+
} = useGlobalDataSlice("company");
|
|
35419
|
+
useEffect(() => {
|
|
35420
|
+
updateStateSlice({
|
|
35421
|
+
data,
|
|
35422
|
+
valid,
|
|
35423
|
+
errors,
|
|
35424
|
+
fieldProblems
|
|
35425
|
+
});
|
|
35426
|
+
}, [data, valid, errors, fieldProblems]);
|
|
35427
|
+
return jsxs("form", {
|
|
35428
|
+
className: "adyen-kyc__registration-details",
|
|
35429
|
+
children: [jsx(FormHeader, {
|
|
35430
|
+
heading: props.heading
|
|
35431
|
+
}), jsx(ErrorPanel, {
|
|
35432
|
+
verificationErrors: props.formVerificationErrors,
|
|
35433
|
+
validationErrors: props == null ? void 0 : props.fieldValidationErrors,
|
|
35434
|
+
formUtils,
|
|
35435
|
+
id: "ariaErrorField"
|
|
35436
|
+
}), formUtils.isRequiredField("numberOfEmployees") && jsx(Field, {
|
|
35437
|
+
name: "numberOfEmployees",
|
|
35438
|
+
label: formUtils.getLabel("numberOfEmployees", "numberOfEmployees"),
|
|
35439
|
+
classNameModifiers: ["legalName"],
|
|
35440
|
+
errorMessage: formUtils.getErrorMessage("numberOfEmployees", errors, fieldProblems),
|
|
35441
|
+
isValid: valid.numberOfEmployees,
|
|
35442
|
+
children: (childProps) => jsx(InputText, {
|
|
35443
|
+
...childProps,
|
|
35444
|
+
name: "numberOfEmployees",
|
|
35445
|
+
value: data.numberOfEmployees,
|
|
35446
|
+
readonly: formUtils.isReadOnly("numberOfEmployees"),
|
|
35447
|
+
classNameModifiers: ["legalName"],
|
|
35448
|
+
onInput: handleChangeFor("numberOfEmployees", "input"),
|
|
35449
|
+
onBlur: handleChangeFor("numberOfEmployees", "blur"),
|
|
35450
|
+
"aria-required": true,
|
|
35451
|
+
"aria-label": formUtils.getLabel("numberOfEmployees"),
|
|
35452
|
+
"aria-invalid": !valid.numberOfEmployees
|
|
35453
|
+
})
|
|
35454
|
+
})]
|
|
35455
|
+
});
|
|
35456
|
+
}
|
|
35457
|
+
const highExposureParentCompanyDetailsFields = ["numberOfEmployees"];
|
|
35458
|
+
function AdditionalFieldsForHighExposureParentCompany({
|
|
35459
|
+
requiredFields,
|
|
35460
|
+
...props
|
|
35461
|
+
}) {
|
|
35462
|
+
const {
|
|
35463
|
+
i18n
|
|
35464
|
+
} = useI18nContext();
|
|
35465
|
+
const {
|
|
35466
|
+
handleChangeFor,
|
|
35467
|
+
data,
|
|
35468
|
+
valid,
|
|
35469
|
+
errors,
|
|
35470
|
+
fieldProblems
|
|
35471
|
+
} = useForm({
|
|
35472
|
+
...props,
|
|
35473
|
+
schema: ["numberOfEmployees"],
|
|
35474
|
+
defaultData: {
|
|
35475
|
+
...props.data
|
|
35476
|
+
},
|
|
35477
|
+
rules: props.validators || highExposureCompanyDetailsValidations,
|
|
35478
|
+
fieldProblems: props == null ? void 0 : props.fieldValidationErrors
|
|
35479
|
+
});
|
|
35480
|
+
const formUtils = formUtilities(props, i18n);
|
|
35481
|
+
const {
|
|
35482
|
+
updateStateSlice
|
|
35483
|
+
} = useGlobalDataSlice("parentCompany");
|
|
35484
|
+
useEffect(() => {
|
|
35485
|
+
updateStateSlice({
|
|
35486
|
+
data,
|
|
35487
|
+
valid,
|
|
35488
|
+
errors,
|
|
35489
|
+
fieldProblems
|
|
35490
|
+
});
|
|
35491
|
+
}, [data, valid, errors, fieldProblems]);
|
|
35492
|
+
return jsxs("form", {
|
|
35493
|
+
className: "adyen-kyc__registration-details",
|
|
35494
|
+
children: [jsx(FormHeader, {
|
|
35495
|
+
heading: props.heading
|
|
35496
|
+
}), jsx(ErrorPanel, {
|
|
35497
|
+
verificationErrors: props.formVerificationErrors,
|
|
35498
|
+
validationErrors: props == null ? void 0 : props.fieldValidationErrors,
|
|
35499
|
+
formUtils,
|
|
35500
|
+
id: "ariaErrorField"
|
|
35501
|
+
}), formUtils.isRequiredField("numberOfEmployees") && jsx(Field, {
|
|
35502
|
+
name: "numberOfEmployees",
|
|
35503
|
+
label: formUtils.getLabel("numberOfEmployees", "numberOfEmployees"),
|
|
35504
|
+
classNameModifiers: ["legalName"],
|
|
35505
|
+
errorMessage: formUtils.getErrorMessage("numberOfEmployees", errors, fieldProblems),
|
|
35506
|
+
isValid: valid.numberOfEmployees,
|
|
35507
|
+
children: (childProps) => jsx(InputText, {
|
|
35508
|
+
...childProps,
|
|
35509
|
+
name: "numberOfEmployees",
|
|
35510
|
+
value: data.numberOfEmployees,
|
|
35511
|
+
readonly: formUtils.isReadOnly("numberOfEmployees"),
|
|
35512
|
+
classNameModifiers: ["legalName"],
|
|
35513
|
+
onInput: handleChangeFor("numberOfEmployees", "input"),
|
|
35514
|
+
onBlur: handleChangeFor("numberOfEmployees", "blur"),
|
|
35515
|
+
"aria-required": true,
|
|
35516
|
+
"aria-label": formUtils.getLabel("numberOfEmployees"),
|
|
35517
|
+
"aria-invalid": !valid.numberOfEmployees
|
|
35518
|
+
})
|
|
35519
|
+
})]
|
|
35520
|
+
});
|
|
35521
|
+
}
|
|
35522
|
+
function AdditionalFieldsForHighExposureUltimateParentCompany({
|
|
35523
|
+
requiredFields,
|
|
35524
|
+
...props
|
|
35525
|
+
}) {
|
|
35526
|
+
const {
|
|
35527
|
+
i18n
|
|
35528
|
+
} = useI18nContext();
|
|
35529
|
+
const {
|
|
35530
|
+
handleChangeFor,
|
|
35531
|
+
data,
|
|
35532
|
+
valid,
|
|
35533
|
+
errors,
|
|
35534
|
+
fieldProblems
|
|
35535
|
+
} = useForm({
|
|
35536
|
+
...props,
|
|
35537
|
+
schema: ["numberOfEmployees"],
|
|
35538
|
+
defaultData: {
|
|
35539
|
+
...props.data
|
|
35540
|
+
},
|
|
35541
|
+
rules: props.validators || highExposureCompanyDetailsValidations,
|
|
35542
|
+
fieldProblems: props == null ? void 0 : props.fieldValidationErrors
|
|
35543
|
+
});
|
|
35544
|
+
const formUtils = formUtilities(props, i18n);
|
|
35545
|
+
const {
|
|
35546
|
+
updateStateSlice
|
|
35547
|
+
} = useGlobalDataSlice("ultimateParentCompany");
|
|
35548
|
+
useEffect(() => {
|
|
35549
|
+
updateStateSlice({
|
|
35550
|
+
data,
|
|
35551
|
+
valid,
|
|
35552
|
+
errors,
|
|
35553
|
+
fieldProblems
|
|
35554
|
+
});
|
|
35555
|
+
}, [data, valid, errors, fieldProblems]);
|
|
35556
|
+
return jsxs("form", {
|
|
35557
|
+
className: "adyen-kyc__registration-details",
|
|
35558
|
+
children: [jsx(FormHeader, {
|
|
35559
|
+
heading: props.heading
|
|
35560
|
+
}), jsx(ErrorPanel, {
|
|
35561
|
+
verificationErrors: props.formVerificationErrors,
|
|
35562
|
+
validationErrors: props == null ? void 0 : props.fieldValidationErrors,
|
|
35563
|
+
formUtils,
|
|
35564
|
+
id: "ariaErrorField"
|
|
35565
|
+
}), formUtils.isRequiredField("numberOfEmployees") && jsx(Field, {
|
|
35566
|
+
name: "numberOfEmployees",
|
|
35567
|
+
label: formUtils.getLabel("numberOfEmployees", "numberOfEmployees"),
|
|
35568
|
+
classNameModifiers: ["legalName"],
|
|
35569
|
+
errorMessage: formUtils.getErrorMessage("numberOfEmployees", errors, fieldProblems),
|
|
35570
|
+
isValid: valid.numberOfEmployees,
|
|
35571
|
+
children: (childProps) => jsx(InputText, {
|
|
35572
|
+
...childProps,
|
|
35573
|
+
name: "numberOfEmployees",
|
|
35574
|
+
value: data.numberOfEmployees,
|
|
35575
|
+
readonly: formUtils.isReadOnly("numberOfEmployees"),
|
|
35576
|
+
classNameModifiers: ["legalName"],
|
|
35577
|
+
onInput: handleChangeFor("numberOfEmployees", "input"),
|
|
35578
|
+
onBlur: handleChangeFor("numberOfEmployees", "blur"),
|
|
35579
|
+
"aria-required": true,
|
|
35580
|
+
"aria-label": formUtils.getLabel("numberOfEmployees"),
|
|
35581
|
+
"aria-invalid": !valid.numberOfEmployees
|
|
35582
|
+
})
|
|
35583
|
+
})]
|
|
35584
|
+
});
|
|
35585
|
+
}
|
|
35586
|
+
const highExposureForms = {
|
|
35587
|
+
company: {
|
|
35588
|
+
formId: "company",
|
|
35589
|
+
formName: "company",
|
|
35590
|
+
fields: [...highExposureCompanyDetailsFields]
|
|
35591
|
+
},
|
|
35592
|
+
parentCompany: {
|
|
35593
|
+
formId: "parentCompany",
|
|
35594
|
+
formName: "parentCompany",
|
|
35595
|
+
fields: [...highExposureParentCompanyDetailsFields]
|
|
35596
|
+
},
|
|
35597
|
+
ultimateParentCompany: {
|
|
35598
|
+
formId: "ultimateParentCompany",
|
|
35599
|
+
formName: "ultimateParentCompany",
|
|
35600
|
+
fields: [...highExposureCompanyDetailsFields]
|
|
35601
|
+
}
|
|
35602
|
+
};
|
|
35603
|
+
const parentCompanyFormId = highExposureForms.parentCompany.formId;
|
|
35604
|
+
const companyFormId = highExposureForms.company.formId;
|
|
35605
|
+
const ultimateParentCompanyFormId = highExposureForms.ultimateParentCompany.formId;
|
|
35606
|
+
function HighExposureDropinComponent(props) {
|
|
35607
|
+
const {
|
|
35608
|
+
i18n
|
|
35609
|
+
} = useI18nContext();
|
|
35610
|
+
const highExposureCompanyDetailsFormProps = getFormProps(props, companyFormId);
|
|
35611
|
+
const highExposureParentCompanyDetailsFormProps = getFormProps(props, companyFormId);
|
|
35612
|
+
const highExposureUltimateParentCompanyDetailsFormProps = getFormProps(props, companyFormId);
|
|
35613
|
+
const renderActiveForm = (activeForm) => jsxs("div", {
|
|
35614
|
+
className: "adyen-kyc",
|
|
35615
|
+
children: [jsx(ContextGuidance, {
|
|
35616
|
+
page: "High exposure company details page",
|
|
35617
|
+
titleId: "whyDoINeedToFillInThisInformation",
|
|
35618
|
+
contentId: "euFinancialRegulationsRequireUs",
|
|
35619
|
+
title: i18n.get("whyDoINeedToFillInThisInformation"),
|
|
35620
|
+
content: i18n.get("euFinancialRegulationsRequireUs")
|
|
35621
|
+
}), jsxs("div", {
|
|
35622
|
+
className: "adyen-kyc-form-wrapper",
|
|
35623
|
+
children: [activeForm.formId === companyFormId && jsx(AdditionalFieldsForHighExposureCompany, {
|
|
35624
|
+
...highExposureCompanyDetailsFormProps,
|
|
35625
|
+
heading: i18n.get("detailsForCapital"),
|
|
35626
|
+
id: companyFormId,
|
|
35627
|
+
country: props.country
|
|
35628
|
+
}), activeForm.formId === parentCompanyFormId && jsx(AdditionalFieldsForHighExposureParentCompany, {
|
|
35629
|
+
...highExposureParentCompanyDetailsFormProps,
|
|
35630
|
+
heading: i18n.get("parentCompanyDetails"),
|
|
35631
|
+
id: companyFormId,
|
|
35632
|
+
country: props.country
|
|
35633
|
+
}), activeForm.formId === ultimateParentCompanyFormId && jsx(AdditionalFieldsForHighExposureUltimateParentCompany, {
|
|
35634
|
+
...highExposureUltimateParentCompanyDetailsFormProps,
|
|
35635
|
+
heading: i18n.get("ultimateParentCompanyDetails"),
|
|
35636
|
+
id: companyFormId,
|
|
35637
|
+
country: props.country
|
|
35638
|
+
})]
|
|
35639
|
+
})]
|
|
35640
|
+
});
|
|
35641
|
+
return jsx("div", {
|
|
35642
|
+
className: "adyen-kyc",
|
|
35643
|
+
children: renderActiveForm(props.activeForm || highExposureForms.company)
|
|
35644
|
+
});
|
|
35645
|
+
}
|
|
35646
|
+
const parseConfiguration = ({
|
|
35647
|
+
matchingScenario
|
|
35648
|
+
}) => parseHighExposureScenarios(matchingScenario == null ? void 0 : matchingScenario[LegalEntityType.ORGANIZATION]);
|
|
35649
|
+
const logger$6 = createLogger("UpdateLegalEntityForHighExposure");
|
|
35650
|
+
function UpdateLegalEntityForHighExposure({
|
|
35651
|
+
parentLegalEntity,
|
|
35652
|
+
capabilities,
|
|
35653
|
+
country: country2,
|
|
35654
|
+
trackingConfig,
|
|
35655
|
+
problems: problemsProp,
|
|
35656
|
+
onSubmit: externalOnSubmit,
|
|
35657
|
+
onChange,
|
|
35658
|
+
hideDropinLayout,
|
|
35659
|
+
handleHomeClick,
|
|
35660
|
+
homeButtonLabel,
|
|
35661
|
+
legalEntityId
|
|
35662
|
+
}) {
|
|
35663
|
+
var _a;
|
|
35664
|
+
const {
|
|
35665
|
+
getLegalEntity: getLegalEntity2
|
|
35666
|
+
} = useComponentApi(legalEntityId);
|
|
35667
|
+
const {
|
|
35668
|
+
i18n
|
|
35669
|
+
} = useI18nContext();
|
|
35670
|
+
const [legalEntity, setLegalEntity] = useState();
|
|
35671
|
+
const fetchLegalEntity = useCallback(async () => {
|
|
35672
|
+
const legalEntityResponse = await getLegalEntity2(legalEntityId);
|
|
35673
|
+
setLegalEntity(legalEntityResponse);
|
|
35674
|
+
if (legalEntityResponse) {
|
|
35675
|
+
setData(mapLegalEntityToHighExposure(legalEntityResponse));
|
|
35676
|
+
}
|
|
35677
|
+
return legalEntityResponse;
|
|
35678
|
+
}, [getLegalEntity2, legalEntityId]);
|
|
35679
|
+
useEffect(() => {
|
|
35680
|
+
(async () => {
|
|
35681
|
+
await fetchLegalEntity();
|
|
35682
|
+
})().catch(logger$6.error);
|
|
35683
|
+
}, [fetchLegalEntity]);
|
|
35684
|
+
const dataFromResponse = legalEntity ? mapLegalEntityToHighExposure(legalEntity) : {};
|
|
35685
|
+
const [data, setData] = useState(dataFromResponse);
|
|
35686
|
+
const [problems, setProblems] = useState(problemsProp ?? {});
|
|
35687
|
+
const {
|
|
35688
|
+
getConfiguration: getConfiguration2
|
|
35689
|
+
} = useConfigurationApi();
|
|
35690
|
+
const {
|
|
35691
|
+
showToast
|
|
35692
|
+
} = useToastContext();
|
|
35693
|
+
const [loadingStatus, setLoadingStatus] = useState("success");
|
|
35694
|
+
const formRef = useRef(null);
|
|
35695
|
+
const getConfigurationData = useCallback(() => getConfiguration2({
|
|
35696
|
+
legalEntityType: LegalEntityType.ORGANIZATION,
|
|
35697
|
+
capabilities,
|
|
35698
|
+
country: country2
|
|
35699
|
+
}), [country2, capabilities]);
|
|
35700
|
+
const {
|
|
35701
|
+
fieldConfigurations
|
|
35702
|
+
} = useScenarioConfiguration({
|
|
35703
|
+
parseConfiguration,
|
|
35704
|
+
getConfigurationData,
|
|
35705
|
+
setLoadingStatus,
|
|
35706
|
+
country: country2
|
|
35707
|
+
});
|
|
35708
|
+
const derivedProps = useMemo(() => getPropsFromConfigurations(fieldConfigurations, highExposureForms, (problems == null ? void 0 : problems.remediationActions) ? Object.values(problems == null ? void 0 : problems.remediationActions) : [], (problems == null ? void 0 : problems.missingData) ?? [], legalEntity ? getFieldsWithExistingData(legalEntity) : []), [fieldConfigurations, problems == null ? void 0 : problems.remediationActions]);
|
|
35709
|
+
const {
|
|
35710
|
+
state: {
|
|
35711
|
+
currentState
|
|
35712
|
+
}
|
|
35713
|
+
} = useStateContext();
|
|
35714
|
+
const formValidity = currentState.validityByForm;
|
|
35715
|
+
useEffect(() => {
|
|
35716
|
+
setData({
|
|
35717
|
+
...currentState.data
|
|
35718
|
+
});
|
|
35719
|
+
onChange == null ? void 0 : onChange(currentState);
|
|
35720
|
+
}, [currentState]);
|
|
35721
|
+
const forms2 = useMemo(() => {
|
|
35722
|
+
const requiredForms = getRequiredForms(highExposureForms, derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields);
|
|
35723
|
+
return addValidityToForms(requiredForms, formValidity, problems);
|
|
35724
|
+
}, [derivedProps, formValidity, problems]);
|
|
35725
|
+
const onSubmit = async () => {
|
|
35726
|
+
setLoadingStatus("loading");
|
|
35727
|
+
const exposureDetails = mapHighExposureToLegalEntity(data);
|
|
35728
|
+
try {
|
|
35729
|
+
console.log({
|
|
35730
|
+
exposureDetails
|
|
35731
|
+
});
|
|
35732
|
+
setLoadingStatus("success");
|
|
35733
|
+
showToast({
|
|
35734
|
+
label: i18n.get("successfullyUpdatedDetails"),
|
|
35735
|
+
type: ToastType.SUCCESS
|
|
35736
|
+
});
|
|
35737
|
+
externalOnSubmit == null ? void 0 : externalOnSubmit(data);
|
|
35738
|
+
} catch (e) {
|
|
35739
|
+
showToast({
|
|
35740
|
+
label: i18n.get("failedToUpdateDetails"),
|
|
35741
|
+
type: ToastType.ERROR
|
|
35742
|
+
});
|
|
35743
|
+
if (isValidationError(e)) {
|
|
35744
|
+
const validationErrors = processValidationErrors(e, void 0, highExposureApiKeyMapping);
|
|
35745
|
+
setProblems({
|
|
35746
|
+
...problems,
|
|
35747
|
+
validationErrors
|
|
35748
|
+
});
|
|
35749
|
+
} else if (isMaintenanceModeError(e)) {
|
|
35750
|
+
showToast({
|
|
35751
|
+
label: i18n.get("failedToUpdateDetails"),
|
|
35752
|
+
subLabel: i18n.get("maintenanceModeMessage"),
|
|
35753
|
+
type: ToastType.ERROR,
|
|
35754
|
+
duration: "indefinite"
|
|
35755
|
+
});
|
|
35756
|
+
}
|
|
35757
|
+
setLoadingStatus("success");
|
|
35758
|
+
}
|
|
35759
|
+
};
|
|
35760
|
+
const formatDataForSummary2 = (data2) => {
|
|
35761
|
+
const summaryData = cloneObject(data2) || {};
|
|
35762
|
+
return summaryData;
|
|
35763
|
+
};
|
|
35764
|
+
const canSubmit2 = (data2) => mandatoryApiFields.HIGH_EXPOSURE.every((detail) => {
|
|
35765
|
+
const value = getProp(data2, detail);
|
|
35766
|
+
return !isEmpty(value);
|
|
35767
|
+
});
|
|
35768
|
+
const baseTrackingPayload = getBaseTrackingPayload({
|
|
35769
|
+
trackingConfig,
|
|
35770
|
+
parentLegalEntity,
|
|
35771
|
+
legalEntity
|
|
35772
|
+
});
|
|
35773
|
+
const {
|
|
35774
|
+
handleNextClick,
|
|
35775
|
+
handleBackClick,
|
|
35776
|
+
activeForm,
|
|
35777
|
+
shouldValidate,
|
|
35778
|
+
setShouldValidate,
|
|
35779
|
+
gotoFormByFormIndex,
|
|
35780
|
+
nextButtonLabel
|
|
35781
|
+
} = useFormComposer({
|
|
35782
|
+
problems,
|
|
35783
|
+
baseTrackingPayload,
|
|
35784
|
+
forms: forms2,
|
|
35785
|
+
formRef,
|
|
35786
|
+
onSubmit
|
|
35787
|
+
});
|
|
35788
|
+
return jsx(FormWrapper, {
|
|
35789
|
+
taskName: "detailsForCapital",
|
|
35790
|
+
handleNextClick,
|
|
35791
|
+
handleBackClick,
|
|
35792
|
+
gotoFormByFormIndex,
|
|
35793
|
+
nextButtonLabel,
|
|
35794
|
+
loadingStatus,
|
|
35795
|
+
forms: forms2,
|
|
35796
|
+
activeForm,
|
|
35797
|
+
baseTrackingPayload,
|
|
35798
|
+
onSubmit,
|
|
35799
|
+
hideDropinLayout,
|
|
35800
|
+
handleHomeClick,
|
|
35801
|
+
homeButtonLabel,
|
|
35802
|
+
validateForm: () => setShouldValidate(true),
|
|
35803
|
+
canSubmit: canSubmit2(data) && hasDataChanged(dataFromResponse, data),
|
|
35804
|
+
problems,
|
|
35805
|
+
summary: {
|
|
35806
|
+
data: formatDataForSummary2(data)
|
|
35807
|
+
},
|
|
35808
|
+
children: jsx(HighExposureDropinComponent, {
|
|
35809
|
+
...derivedProps,
|
|
35810
|
+
activeForm,
|
|
35811
|
+
capabilities,
|
|
35812
|
+
data: dataFromResponse,
|
|
35813
|
+
country: ((_a = data == null ? void 0 : data.company) == null ? void 0 : _a.country) ?? country2,
|
|
35814
|
+
problems,
|
|
35815
|
+
shouldValidate,
|
|
35816
|
+
ref: formRef
|
|
35817
|
+
})
|
|
35204
35818
|
});
|
|
35205
35819
|
}
|
|
35206
35820
|
var OnboardingUrlTarget = /* @__PURE__ */ ((OnboardingUrlTarget2) => {
|
|
@@ -35408,7 +36022,8 @@ const componentsMap = {
|
|
|
35408
36022
|
createIndividualComponent: CreateIndividualComponent,
|
|
35409
36023
|
manageTransferInstrumentComponent: ManageTransferInstrumentComponent,
|
|
35410
36024
|
onboardingDropinComponent: OnboardingDropinComponent,
|
|
35411
|
-
viewVerificationStatusComponent: ViewVerificationStatusComponent
|
|
36025
|
+
viewVerificationStatusComponent: ViewVerificationStatusComponent,
|
|
36026
|
+
updateLegalEntityForHighExposureComponent: UpdateLegalEntityForHighExposure
|
|
35412
36027
|
};
|
|
35413
36028
|
const AuthProvider = ({
|
|
35414
36029
|
children,
|
|
@@ -35460,14 +36075,13 @@ const pushEvents = async (loadingContext, sessionId, event) => httpPost({
|
|
|
35460
36075
|
}, event);
|
|
35461
36076
|
const convertToEmbeddedEvent = (eventQueueItem) => {
|
|
35462
36077
|
const [eventType, event] = eventQueueItem;
|
|
35463
|
-
const
|
|
35464
|
-
const eventName =
|
|
36078
|
+
const isObject = typeof event === "object";
|
|
36079
|
+
const eventName = isObject ? event.key : event;
|
|
36080
|
+
const eventData = isObject ? event.segmentation : {};
|
|
35465
36081
|
return {
|
|
35466
36082
|
eventType,
|
|
35467
36083
|
eventName,
|
|
35468
|
-
|
|
35469
|
-
eventData: event.segmentation
|
|
35470
|
-
}
|
|
36084
|
+
eventData: eventData ?? {}
|
|
35471
36085
|
};
|
|
35472
36086
|
};
|
|
35473
36087
|
const useAnalytics = async ({
|
|
@@ -35476,6 +36090,9 @@ const useAnalytics = async ({
|
|
|
35476
36090
|
sdkVersion,
|
|
35477
36091
|
componentName
|
|
35478
36092
|
}) => {
|
|
36093
|
+
const {
|
|
36094
|
+
i18n
|
|
36095
|
+
} = useI18nContext();
|
|
35479
36096
|
const {
|
|
35480
36097
|
isEmbeddedDropin,
|
|
35481
36098
|
loadingContext: base
|
|
@@ -35494,6 +36111,9 @@ const useAnalytics = async ({
|
|
|
35494
36111
|
}
|
|
35495
36112
|
userEvents.subscribe((data) => {
|
|
35496
36113
|
const eventItem = convertToEmbeddedEvent(data);
|
|
36114
|
+
if (eventItem.eventData) {
|
|
36115
|
+
eventItem.eventData.locale = i18n.locale;
|
|
36116
|
+
}
|
|
35497
36117
|
pushEvents(loadingContext, sessionResponse.id, eventItem);
|
|
35498
36118
|
});
|
|
35499
36119
|
} catch (e) {
|
|
@@ -35840,7 +36460,7 @@ const ConfigurationApiProvider = ({
|
|
|
35840
36460
|
isEmbeddedDropin,
|
|
35841
36461
|
loadingContext
|
|
35842
36462
|
} = authContext;
|
|
35843
|
-
const sdkVersion = "3.
|
|
36463
|
+
const sdkVersion = "3.19.0";
|
|
35844
36464
|
useAnalytics({
|
|
35845
36465
|
onUserEvent,
|
|
35846
36466
|
legalEntityId: rootLegalEntityId,
|
|
@@ -37162,6 +37782,18 @@ const viewVerificationStatusComponentSchema = {
|
|
|
37162
37782
|
}
|
|
37163
37783
|
};
|
|
37164
37784
|
const onboardingDropinComponentSchema = {
|
|
37785
|
+
legalEntityId: {
|
|
37786
|
+
type: "string",
|
|
37787
|
+
required: true
|
|
37788
|
+
},
|
|
37789
|
+
openBankingPartnerConfigId: {
|
|
37790
|
+
type: "string"
|
|
37791
|
+
}
|
|
37792
|
+
};
|
|
37793
|
+
const updateLegalEntityForHighExposureComponentSchema = {
|
|
37794
|
+
country: {
|
|
37795
|
+
type: "string"
|
|
37796
|
+
},
|
|
37165
37797
|
legalEntityId: {
|
|
37166
37798
|
type: "string",
|
|
37167
37799
|
required: true
|
|
@@ -37181,6 +37813,7 @@ const componentsSchemaMap = {
|
|
|
37181
37813
|
createIndividualComponent: createIndividualComponentSchema,
|
|
37182
37814
|
createTransferInstrumentComponent: createTransferInstrumentComponentSchema,
|
|
37183
37815
|
viewVerificationStatusComponent: viewVerificationStatusComponentSchema,
|
|
37816
|
+
updateLegalEntityForHighExposureComponent: updateLegalEntityForHighExposureComponentSchema,
|
|
37184
37817
|
onboardingDropinComponent: onboardingDropinComponentSchema
|
|
37185
37818
|
};
|
|
37186
37819
|
const validateComponentName = (componentName) => {
|