@adyen/kyc-components 2.53.1 → 2.54.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/adyen-kyc-components.es.js +582 -484
- package/dist/es/circle-F380_Tya.js +8 -0
- package/dist/style.css +55 -33
- package/dist/types/components/AdditionalInformation/component/AdditionalInformationComponent.d.ts +2 -2
- package/dist/types/components/AdditionalInformation/types.d.ts +5 -1
- package/dist/types/components/BasicInformation/component/BasicInformationComponent.d.ts +1 -1
- package/dist/types/components/BasicInformation/types.d.ts +4 -4
- package/dist/types/components/BusinessDetails/forms.d.ts +0 -6
- package/dist/types/components/BusinessDetails/types.d.ts +4 -6
- package/dist/types/components/BusinessSelection/BusinessInformationCard.d.ts +4 -3
- package/dist/types/components/BusinessSelection/component/BusinessSelectionComponent.d.ts +1 -1
- package/dist/types/components/BusinessSelection/types.d.ts +4 -4
- package/dist/types/components/DecisionMakers/component/DecisionMakersComponent.d.ts +1 -1
- package/dist/types/components/DecisionMakers/types.d.ts +2 -2
- package/dist/types/components/Dropins/BusinessDetailsDropin/components/BusinessDetailsDropinComponent.d.ts +1 -1
- package/dist/types/components/Dropins/BusinessDetailsDropin/types.d.ts +2 -2
- package/dist/types/components/Dropins/BusinessDetailsDropin/utils.d.ts +2 -3
- package/dist/types/components/Dropins/CompanyDropin/types.d.ts +0 -2
- package/dist/types/components/Dropins/CompanySearchDropin/components/CompanySearchDropinComponent.d.ts +1 -1
- package/dist/types/components/Dropins/CompanySearchDropin/types.d.ts +0 -2
- package/dist/types/components/Dropins/IndividualDropin/components/IndividualDropinComponent.d.ts +1 -1
- package/dist/types/components/Individual/types.d.ts +3 -0
- package/dist/types/components/PersonalDetails/types.d.ts +2 -1
- package/dist/types/components/StepProgressIndicator/StepProgressIndicator.d.ts +2 -1
- package/dist/types/components/internal/Address/types.d.ts +4 -0
- package/dist/types/components/internal/Address/utils.d.ts +5 -5
- package/dist/types/components/internal/DecisionMakerRole/types.d.ts +2 -0
- package/dist/types/components/internal/EntityGuidanceStatus/types.d.ts +1 -1
- package/dist/types/components/internal/Modal/Modal.d.ts +1 -1
- package/dist/types/components/internal/Svg/svgs.d.ts +2 -1
- package/dist/types/core/hooks/singpass/useSingpassMyInfoLogin.d.ts +3 -0
- package/dist/types/core/hooks/useBusinessData/types.d.ts +4 -4
- package/dist/types/core/hooks/useCompanySearchTaskSubmit.d.ts +3 -1
- package/dist/types/utils/entity-status-util.d.ts +12 -1
- package/dist/types/utils/mapping/componentApiMapping.d.ts +15 -19
- package/package.json +1 -1
- package/dist/es/cross-circle-fill-BafKD3Av.js +0 -8
- package/dist/types/components/Company/trusted-fields.d.ts +0 -7
- package/dist/types/components/internal/EntityGuidanceStatus/component/EntityGuidanceLegend.d.ts +0 -3
- package/dist/types/components/internal/EntityGuidanceStatus/index.d.ts +0 -3
|
@@ -125,6 +125,7 @@ const defaultTrans = {
|
|
|
125
125
|
annualTurnover: "Annual turnover",
|
|
126
126
|
annualTurnoverHelper: "The annual sales revenue minus all discounts and sales taxes. Also known as net sales.",
|
|
127
127
|
apartmentSuite: "Apartment / Suite",
|
|
128
|
+
apartmentSuiteOther: "Apt, suite, other",
|
|
128
129
|
apartmentSuiteOptional: "Apartment / Suite (optional)",
|
|
129
130
|
areYouACompany: "Are you a company?",
|
|
130
131
|
areYouAnIndividual: "Are you an individual?",
|
|
@@ -203,6 +204,7 @@ const defaultTrans = {
|
|
|
203
204
|
businessSelection__footerButton: "Add details manually",
|
|
204
205
|
businessSelection__heading: "Select your business",
|
|
205
206
|
businessSelection__invalidTin: "This company's TIN doesn't match yours",
|
|
207
|
+
businessSelection__tinVerificationFailure: "Sorry, something went wrong. Try again or continue by pressing Add details manually",
|
|
206
208
|
businessStructure: "Business structure",
|
|
207
209
|
businessTrust: "Business trust",
|
|
208
210
|
businessTrusteeDetails: "Business trustee details",
|
|
@@ -985,7 +987,7 @@ const defaultTrans = {
|
|
|
985
987
|
orSoleProprietorshipName: "or sole proprietorship's name",
|
|
986
988
|
organisasjonsnummer: "Organisasjonsnummer",
|
|
987
989
|
organisationsnummer: "Organisationsnummer",
|
|
988
|
-
otherAddressInformation: "Other address information
|
|
990
|
+
otherAddressInformation: "Other address information",
|
|
989
991
|
otherBusinessInformation: "Other business information",
|
|
990
992
|
otherInformation: "Other information",
|
|
991
993
|
otherTrust: "Other trust",
|
|
@@ -1041,6 +1043,8 @@ const defaultTrans = {
|
|
|
1041
1043
|
postalCode: "Postal code",
|
|
1042
1044
|
poweredBy: "Powered by",
|
|
1043
1045
|
previous: "Previous",
|
|
1046
|
+
principalPlaceOfBusiness: "Principal place of business",
|
|
1047
|
+
principalPlaceOfBusinessDescription: "The physical location where a business's key officers oversee and manage its operations: this is usually the main office or headquarters.",
|
|
1044
1048
|
privateCompanyDescription: "Your company is owned privately and not traded on a public stock exchange. ",
|
|
1045
1049
|
privateCompanyTitle: "Private company",
|
|
1046
1050
|
processing: "Processing",
|
|
@@ -1087,6 +1091,8 @@ const defaultTrans = {
|
|
|
1087
1091
|
registeredAddressHeaderDescription__PR: "Your address as it appears on your Department of State Registration.",
|
|
1088
1092
|
registeredAddressHeaderDescription__US: "Your address as it appears on your Secretary of State Registration.",
|
|
1089
1093
|
registeredAddressTrustHeaderDescription: "The address registered to your trust",
|
|
1094
|
+
registeredBusinessAddress: "Registered business address",
|
|
1095
|
+
registeredBusinessAddressDescription: "Your business's official address used for government and other legal purposes.",
|
|
1090
1096
|
registrationAddress: "Registration address",
|
|
1091
1097
|
registrationDetails: "Registration details",
|
|
1092
1098
|
registrationDocument: "Registration document",
|
|
@@ -1168,6 +1174,7 @@ const defaultTrans = {
|
|
|
1168
1174
|
roleAndEntityType: "Role and entity type",
|
|
1169
1175
|
routingNumberVisible: "Includes your routing number",
|
|
1170
1176
|
salarySlip: "Salary slip",
|
|
1177
|
+
sameAsRegisteredAddress: "Same as registered business address",
|
|
1171
1178
|
sameNameAsLegalName: "Same as legal name of the company",
|
|
1172
1179
|
"save&Leave": "Save & leave",
|
|
1173
1180
|
saveAndGoToOverview: "Save and go to overview",
|
|
@@ -1422,6 +1429,7 @@ const defaultTrans = {
|
|
|
1422
1429
|
xCharactersLeft: "%{charactersLeft} characters left",
|
|
1423
1430
|
xMinutes: "%{minutes} minutes",
|
|
1424
1431
|
xMinutesAndYSeconds: "%{minutes} and %{seconds}",
|
|
1432
|
+
XOfYSteps: "%{currentStep} of %{totalSteps} ",
|
|
1425
1433
|
xSeconds: "%{seconds} seconds",
|
|
1426
1434
|
yes: "Yes",
|
|
1427
1435
|
yesBankruptcyInsolvency: "Yes, the company is filling for bankruptcy or insolvency",
|
|
@@ -1647,6 +1655,12 @@ function useToastContext() {
|
|
|
1647
1655
|
}
|
|
1648
1656
|
return context;
|
|
1649
1657
|
}
|
|
1658
|
+
const CoreContext = createContext(void 0);
|
|
1659
|
+
const useCoreContext = () => {
|
|
1660
|
+
const context = useContext(CoreContext);
|
|
1661
|
+
if (!context) throw Error("You need a <CoreProvider> to use core context");
|
|
1662
|
+
return context;
|
|
1663
|
+
};
|
|
1650
1664
|
let suppressed = false;
|
|
1651
1665
|
const consoleMethodsPrefixable = Object.freeze(["debug", "info", "log", "warn", "error", "trace"]);
|
|
1652
1666
|
const stringSubstitutionRegex = /%([soOc]|(\.\d)?[dif])/;
|
|
@@ -2001,10 +2015,10 @@ function useBusinessData({
|
|
|
2001
2015
|
handleVerifyTin,
|
|
2002
2016
|
handleClearCompanyData
|
|
2003
2017
|
}) {
|
|
2004
|
-
const [
|
|
2005
|
-
const [
|
|
2006
|
-
const [
|
|
2007
|
-
const [
|
|
2018
|
+
const [searching, setSearching] = useState("idle");
|
|
2019
|
+
const [fetching, setFetching] = useState("idle");
|
|
2020
|
+
const [verifying, setVerifying] = useState("idle");
|
|
2021
|
+
const [resettingTrustedData, setResettingTrustedData] = useState("idle");
|
|
2008
2022
|
const [searchResults, setSearchResults] = useState();
|
|
2009
2023
|
const [cachedSearch, setCachedSearch] = useState();
|
|
2010
2024
|
const [cachedBusiness, setCachedBusiness] = useState();
|
|
@@ -2017,7 +2031,7 @@ function useBusinessData({
|
|
|
2017
2031
|
}
|
|
2018
2032
|
if (searchResults && objectsDeepEqual(cachedSearch, data)) return;
|
|
2019
2033
|
try {
|
|
2020
|
-
|
|
2034
|
+
setSearching("loading");
|
|
2021
2035
|
const {
|
|
2022
2036
|
results
|
|
2023
2037
|
} = KNOWN_BROKEN_PRIMARY_SOURCE_CONNECTIONS.includes(data.state) ? await handleCompanyIndexSearch({
|
|
@@ -2030,11 +2044,11 @@ function useBusinessData({
|
|
|
2030
2044
|
setSearchResults(results);
|
|
2031
2045
|
return results;
|
|
2032
2046
|
} catch (e) {
|
|
2033
|
-
|
|
2047
|
+
setSearching("error");
|
|
2034
2048
|
logger$E.error(e);
|
|
2035
2049
|
} finally {
|
|
2036
2050
|
setCachedSearch(data);
|
|
2037
|
-
|
|
2051
|
+
setSearching((prevState) => prevState !== "error" ? "loaded" : prevState);
|
|
2038
2052
|
}
|
|
2039
2053
|
}, [handleCompanyDeepSearch, handleCompanyIndexSearch, searchResults, cachedSearch]);
|
|
2040
2054
|
const fetchBusinessData = useCallback(async (company) => {
|
|
@@ -2052,7 +2066,8 @@ function useBusinessData({
|
|
|
2052
2066
|
const date = (/* @__PURE__ */ new Date()).toDateString();
|
|
2053
2067
|
const isDataCompliant = company.lastUpdate ? Date.parse(date) - Date.parse(company.lastUpdate) < LOW_RISK_COMPANY_DATA_COMPLIANCE_WINDOW : false;
|
|
2054
2068
|
try {
|
|
2055
|
-
|
|
2069
|
+
setFetching("loading");
|
|
2070
|
+
setVerifying("idle");
|
|
2056
2071
|
setInvalidTin(false);
|
|
2057
2072
|
const businessData = isDataCompliant ? await handleGetCompanyDataset({
|
|
2058
2073
|
companyId: company.id,
|
|
@@ -2064,11 +2079,11 @@ function useBusinessData({
|
|
|
2064
2079
|
setCachedBusiness(businessData);
|
|
2065
2080
|
return businessData;
|
|
2066
2081
|
} catch (e) {
|
|
2067
|
-
|
|
2082
|
+
setFetching("error");
|
|
2068
2083
|
setCachedBusiness(void 0);
|
|
2069
2084
|
logger$E.error(e);
|
|
2070
2085
|
} finally {
|
|
2071
|
-
|
|
2086
|
+
setFetching((prevState) => prevState !== "error" ? "loaded" : prevState);
|
|
2072
2087
|
}
|
|
2073
2088
|
}, [cachedBusiness, handleGetCompanyDataset, handleRefreshCompanyDataset]);
|
|
2074
2089
|
const verifyBusinessData = useCallback(async (data, tin) => {
|
|
@@ -2077,7 +2092,7 @@ function useBusinessData({
|
|
|
2077
2092
|
return;
|
|
2078
2093
|
}
|
|
2079
2094
|
try {
|
|
2080
|
-
|
|
2095
|
+
setVerifying("loading");
|
|
2081
2096
|
setVerifiedBusiness(void 0);
|
|
2082
2097
|
setInvalidTin(false);
|
|
2083
2098
|
const {
|
|
@@ -2093,21 +2108,21 @@ function useBusinessData({
|
|
|
2093
2108
|
}
|
|
2094
2109
|
return matched;
|
|
2095
2110
|
} catch (e) {
|
|
2096
|
-
|
|
2111
|
+
setVerifying("error");
|
|
2097
2112
|
logger$E.error(e);
|
|
2098
2113
|
} finally {
|
|
2099
|
-
|
|
2114
|
+
setVerifying((prevState) => prevState !== "error" ? "loaded" : prevState);
|
|
2100
2115
|
}
|
|
2101
2116
|
}, [handleVerifyTin]);
|
|
2102
2117
|
const clearTrustedBusinessData = useCallback(async () => {
|
|
2103
2118
|
try {
|
|
2104
|
-
|
|
2119
|
+
setResettingTrustedData("loading");
|
|
2105
2120
|
await (handleClearCompanyData == null ? void 0 : handleClearCompanyData());
|
|
2106
2121
|
} catch (e) {
|
|
2107
|
-
|
|
2122
|
+
setResettingTrustedData("error");
|
|
2108
2123
|
logger$E.error(e);
|
|
2109
2124
|
} finally {
|
|
2110
|
-
|
|
2125
|
+
setResettingTrustedData((prevState) => prevState !== "error" ? "loaded" : prevState);
|
|
2111
2126
|
}
|
|
2112
2127
|
}, [handleClearCompanyData]);
|
|
2113
2128
|
const resetBusinessData = () => {
|
|
@@ -2126,10 +2141,10 @@ function useBusinessData({
|
|
|
2126
2141
|
resetBusinessData,
|
|
2127
2142
|
resetTinVerification,
|
|
2128
2143
|
// Data
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2144
|
+
searching,
|
|
2145
|
+
fetching,
|
|
2146
|
+
verifying,
|
|
2147
|
+
resettingTrustedData,
|
|
2133
2148
|
currentSearchName: cachedSearch == null ? void 0 : cachedSearch.text,
|
|
2134
2149
|
searchResults,
|
|
2135
2150
|
verifiedBusiness,
|
|
@@ -2369,11 +2384,13 @@ const svgs = {
|
|
|
2369
2384
|
bin: lazy(() => import("./bin-D7a-dmmy.js")),
|
|
2370
2385
|
check: lazy(() => import("./checkmark-DS0ypPvH.js")),
|
|
2371
2386
|
checkmark: lazy(() => import("./checkmark-circle-fill-hZq1T5e9.js")),
|
|
2387
|
+
"checkmark-circle-fill": lazy(() => import("./checkmark-circle-fill-hZq1T5e9.js")),
|
|
2372
2388
|
"checkmark-small": lazy(() => import("./checkmark-small-4ciES6ZR.js")),
|
|
2373
2389
|
"chevron-down": lazy(() => import("./chevron-down-CSdvSDZq.js")),
|
|
2374
2390
|
"chevron-right": lazy(() => import("./chevron-right-B5NJn8is.js")),
|
|
2375
2391
|
"chevron-left": lazy(() => import("./chevron-left-Ctf1pv5s.js")),
|
|
2376
2392
|
"chevron-up": lazy(() => import("./chevron-up-CXPd5NYI.js")),
|
|
2393
|
+
circle: lazy(() => import("./circle-F380_Tya.js")),
|
|
2377
2394
|
company: lazy(() => import("./headquarter-BVHLaPzn.js")),
|
|
2378
2395
|
"company-2": lazy(() => import("./hotel-DLFFe_Ls.js")),
|
|
2379
2396
|
contract: lazy(() => import("./contract-DFZ6WwMd.js")),
|
|
@@ -2404,7 +2421,6 @@ const svgs = {
|
|
|
2404
2421
|
upload: lazy(() => import("./upload-XwV0PfcC.js")),
|
|
2405
2422
|
"users-3": lazy(() => import("./4-people-BTQ6Okmp.js")),
|
|
2406
2423
|
warning: lazy(() => import("./warning-filled-Od0v7tGX.js")),
|
|
2407
|
-
wrong: lazy(() => import("./cross-circle-fill-BafKD3Av.js")),
|
|
2408
2424
|
// images
|
|
2409
2425
|
"document-blurred": lazy(() => import("./document-blurred-gtj03M4x.js")),
|
|
2410
2426
|
"document-cutoff": lazy(() => import("./document-cut-off-D2vCeeIS.js")),
|
|
@@ -2434,7 +2450,7 @@ const svgs = {
|
|
|
2434
2450
|
"plaid-logo": lazy(() => import("./plaid-logo-4nYeR9iX.js")),
|
|
2435
2451
|
"trustly-logo": lazy(() => import("./trustly-logo-YJslAOYF.js"))
|
|
2436
2452
|
};
|
|
2437
|
-
const unscalableIconNames = ["
|
|
2453
|
+
const unscalableIconNames = ["bin", "check", "checkmark", "checkmark-small", "chevron-right", "chevron-left", "company", "contract", "cross", "decision-maker", "document", "download", "edit", "info-circle", "image", "location", "payout", "pci", "plus", "remove", "save", "search", "trust", "user", "upload", "warning"];
|
|
2438
2454
|
const logger$D = createLogger("Icon");
|
|
2439
2455
|
const Svg = ({
|
|
2440
2456
|
className,
|
|
@@ -2450,7 +2466,7 @@ const Svg = ({
|
|
|
2450
2466
|
return null;
|
|
2451
2467
|
}
|
|
2452
2468
|
return jsx("span", {
|
|
2453
|
-
className: cx(`adyen-kyc-${type}
|
|
2469
|
+
className: cx(`adyen-kyc-${type}`, className),
|
|
2454
2470
|
"data-testid": testId,
|
|
2455
2471
|
children: jsx(Suspense, {
|
|
2456
2472
|
fallback: null,
|
|
@@ -2733,15 +2749,6 @@ function useFormRouterContext() {
|
|
|
2733
2749
|
return context;
|
|
2734
2750
|
}
|
|
2735
2751
|
const logger$C = createLogger("Link");
|
|
2736
|
-
const getIconClass = (icon, external) => {
|
|
2737
|
-
if (external) {
|
|
2738
|
-
return "adyen-kyc-link__icon adyen-kyc-icon-external-link";
|
|
2739
|
-
}
|
|
2740
|
-
if (icon) {
|
|
2741
|
-
return `adyen-kyc-link__icon`;
|
|
2742
|
-
}
|
|
2743
|
-
return null;
|
|
2744
|
-
};
|
|
2745
2752
|
const isValidLink = (href) => {
|
|
2746
2753
|
if (href === "#") {
|
|
2747
2754
|
logger$C.error('Links must include a valid href. If your href is "#", consider using a Button instead');
|
|
@@ -2762,7 +2769,6 @@ const Link = ({
|
|
|
2762
2769
|
const target = external ? "_blank" : "_self";
|
|
2763
2770
|
const rel = external ? "external noopener noreferrer" : void 0;
|
|
2764
2771
|
const showIcon = icon || external;
|
|
2765
|
-
const iconClass = showIcon && getIconClass(icon, external);
|
|
2766
2772
|
const classNames = showAsButton ? cx("adyen-kyc-button", className, {
|
|
2767
2773
|
"adyen-kyc-button--icon": showIcon
|
|
2768
2774
|
}) : cx("adyen-kyc-link", className, {
|
|
@@ -2777,9 +2783,9 @@ const Link = ({
|
|
|
2777
2783
|
children: [jsx("span", {
|
|
2778
2784
|
className: "adyen-kyc-link__text adyen-kyc-link--inherit",
|
|
2779
2785
|
children
|
|
2780
|
-
}), showIcon && icon &&
|
|
2786
|
+
}), showIcon && icon && jsx(Icon, {
|
|
2781
2787
|
name: icon,
|
|
2782
|
-
className:
|
|
2788
|
+
className: "adyen-kyc-link__icon"
|
|
2783
2789
|
})]
|
|
2784
2790
|
});
|
|
2785
2791
|
};
|
|
@@ -2884,7 +2890,7 @@ function getFormProps(props, innerFormId) {
|
|
|
2884
2890
|
return null;
|
|
2885
2891
|
}
|
|
2886
2892
|
const activeFormId = (_a = props.activeForm) == null ? void 0 : _a.formId;
|
|
2887
|
-
const
|
|
2893
|
+
const trustedFields = ((_b = props.trustedFields) == null ? void 0 : _b[innerFormId]) ?? [];
|
|
2888
2894
|
const readOnlyFields = ((_c = props.readOnlyFields) == null ? void 0 : _c[innerFormId]) ?? [];
|
|
2889
2895
|
return {
|
|
2890
2896
|
placeholders: ((_d = props.placeholders) == null ? void 0 : _d[innerFormId]) ?? {},
|
|
@@ -2893,12 +2899,12 @@ function getFormProps(props, innerFormId) {
|
|
|
2893
2899
|
masks: ((_g = props.masks) == null ? void 0 : _g[innerFormId]) ?? {},
|
|
2894
2900
|
data: ((_h = props.data) == null ? void 0 : _h[innerFormId]) ?? {},
|
|
2895
2901
|
allFields: ((_i = props.allFields) == null ? void 0 : _i[innerFormId]) ?? [],
|
|
2896
|
-
readOnlyFields: [...readOnlyFields, ...
|
|
2902
|
+
readOnlyFields: [...readOnlyFields, ...trustedFields],
|
|
2897
2903
|
requiredFields: ((_j = props.requiredFields) == null ? void 0 : _j[innerFormId]) ?? [],
|
|
2898
2904
|
optionalFields: ((_k = props.optionalFields) == null ? void 0 : _k[innerFormId]) ?? [],
|
|
2899
2905
|
obscuredFields: ((_l = props.obscuredFields) == null ? void 0 : _l[innerFormId]) ?? [],
|
|
2900
2906
|
verifyFields: ((_m = props.verifyFields) == null ? void 0 : _m[innerFormId]) ?? [],
|
|
2901
|
-
trustedFields
|
|
2907
|
+
trustedFields,
|
|
2902
2908
|
trustedFieldsProvider: props.trustedFields,
|
|
2903
2909
|
formVerificationErrors: ((_o = (_n = props.problems) == null ? void 0 : _n.verificationErrors) == null ? void 0 : _o[innerFormId]) ?? {},
|
|
2904
2910
|
fieldValidationErrors: ((_q = (_p = props.problems) == null ? void 0 : _p.validationErrors) == null ? void 0 : _q[innerFormId]) ?? {},
|
|
@@ -2934,7 +2940,7 @@ function getNestedOuterFormPropsFromOuterFormProps(props, innerFormId) {
|
|
|
2934
2940
|
optionalFields,
|
|
2935
2941
|
obscuredFields,
|
|
2936
2942
|
verifyFields,
|
|
2937
|
-
trustedFields
|
|
2943
|
+
trustedFields,
|
|
2938
2944
|
problems,
|
|
2939
2945
|
validators: validators2,
|
|
2940
2946
|
shouldValidate
|
|
@@ -2951,7 +2957,7 @@ function getNestedOuterFormPropsFromOuterFormProps(props, innerFormId) {
|
|
|
2951
2957
|
optionalFields,
|
|
2952
2958
|
obscuredFields,
|
|
2953
2959
|
verifyFields,
|
|
2954
|
-
trustedFields
|
|
2960
|
+
trustedFields,
|
|
2955
2961
|
// the rest we just pass along for now, as they will be eventually be processed by getFormProps
|
|
2956
2962
|
problems,
|
|
2957
2963
|
validators: validators2,
|
|
@@ -3161,7 +3167,7 @@ function init({
|
|
|
3161
3167
|
fieldProblems,
|
|
3162
3168
|
obscuredFields,
|
|
3163
3169
|
optionalFields,
|
|
3164
|
-
trustedFields
|
|
3170
|
+
trustedFields,
|
|
3165
3171
|
formatters,
|
|
3166
3172
|
staticValidate,
|
|
3167
3173
|
asyncValidate
|
|
@@ -3178,7 +3184,7 @@ function init({
|
|
|
3178
3184
|
data: defaultData,
|
|
3179
3185
|
obscuredFields,
|
|
3180
3186
|
optionalFields,
|
|
3181
|
-
trustedFields
|
|
3187
|
+
trustedFields
|
|
3182
3188
|
}
|
|
3183
3189
|
},
|
|
3184
3190
|
staticValidate,
|
|
@@ -3234,7 +3240,7 @@ function init({
|
|
|
3234
3240
|
fieldProblems: {},
|
|
3235
3241
|
obscuredFields,
|
|
3236
3242
|
optionalFields,
|
|
3237
|
-
trustedFields
|
|
3243
|
+
trustedFields
|
|
3238
3244
|
});
|
|
3239
3245
|
return formData;
|
|
3240
3246
|
}
|
|
@@ -3243,7 +3249,7 @@ function reducer({
|
|
|
3243
3249
|
asyncValidate,
|
|
3244
3250
|
obscuredFields,
|
|
3245
3251
|
optionalFields,
|
|
3246
|
-
trustedFields
|
|
3252
|
+
trustedFields,
|
|
3247
3253
|
formatters
|
|
3248
3254
|
}) {
|
|
3249
3255
|
return (state, {
|
|
@@ -3315,7 +3321,7 @@ function reducer({
|
|
|
3315
3321
|
fieldProblems,
|
|
3316
3322
|
obscuredFields,
|
|
3317
3323
|
optionalFields,
|
|
3318
|
-
trustedFields
|
|
3324
|
+
trustedFields,
|
|
3319
3325
|
staticValidate,
|
|
3320
3326
|
asyncValidate
|
|
3321
3327
|
});
|
|
@@ -3349,7 +3355,7 @@ function reducer({
|
|
|
3349
3355
|
fieldProblems: updatedFieldProblems,
|
|
3350
3356
|
obscuredFields,
|
|
3351
3357
|
optionalFields,
|
|
3352
|
-
trustedFields
|
|
3358
|
+
trustedFields,
|
|
3353
3359
|
local
|
|
3354
3360
|
};
|
|
3355
3361
|
}
|
|
@@ -3543,7 +3549,7 @@ function useForm({
|
|
|
3543
3549
|
fieldProblems,
|
|
3544
3550
|
obscuredFields,
|
|
3545
3551
|
optionalFields,
|
|
3546
|
-
trustedFields
|
|
3552
|
+
trustedFields,
|
|
3547
3553
|
formatters,
|
|
3548
3554
|
shouldValidate = false
|
|
3549
3555
|
}) {
|
|
@@ -3561,20 +3567,20 @@ function useForm({
|
|
|
3561
3567
|
asyncValidate: triggerAsyncValidation,
|
|
3562
3568
|
obscuredFields,
|
|
3563
3569
|
optionalFields,
|
|
3564
|
-
trustedFields
|
|
3570
|
+
trustedFields,
|
|
3565
3571
|
formatters
|
|
3566
|
-
}), [triggerStaticValidation, triggerAsyncValidation, obscuredFields, optionalFields,
|
|
3572
|
+
}), [triggerStaticValidation, triggerAsyncValidation, obscuredFields, optionalFields, trustedFields, formatters]);
|
|
3567
3573
|
const initialData = useMemo(() => ({
|
|
3568
3574
|
schema: getSchema,
|
|
3569
3575
|
defaultData,
|
|
3570
3576
|
fieldProblems,
|
|
3571
3577
|
obscuredFields,
|
|
3572
3578
|
optionalFields,
|
|
3573
|
-
trustedFields
|
|
3579
|
+
trustedFields,
|
|
3574
3580
|
formatters,
|
|
3575
3581
|
staticValidate: triggerStaticValidation,
|
|
3576
3582
|
asyncValidate: triggerAsyncValidation
|
|
3577
|
-
}), [getSchema, defaultData, fieldProblems, obscuredFields, optionalFields,
|
|
3583
|
+
}), [getSchema, defaultData, fieldProblems, obscuredFields, optionalFields, trustedFields, formatters, triggerStaticValidation, triggerAsyncValidation]);
|
|
3578
3584
|
const [state, dispatch] = useReducer(getReducer(), initialData, init);
|
|
3579
3585
|
const isValid = useMemo(() => {
|
|
3580
3586
|
var _a;
|
|
@@ -11874,10 +11880,10 @@ const LABELS = {
|
|
|
11874
11880
|
},
|
|
11875
11881
|
otherAddressInformation: {
|
|
11876
11882
|
default: OTHER_ADDRESS_INFORMATION,
|
|
11877
|
-
[CountryCodes.Canada]: "
|
|
11878
|
-
[CountryCodes.PuertoRico]: "
|
|
11883
|
+
[CountryCodes.Canada]: "apartmentSuiteOther",
|
|
11884
|
+
[CountryCodes.PuertoRico]: "apartmentSuiteOther",
|
|
11879
11885
|
// should exactly match CountryCodes.UnitedStates
|
|
11880
|
-
[CountryCodes.UnitedStates]: "
|
|
11886
|
+
[CountryCodes.UnitedStates]: "apartmentSuiteOther"
|
|
11881
11887
|
},
|
|
11882
11888
|
postalCode: {
|
|
11883
11889
|
default: POSTAL_CODE,
|
|
@@ -11906,13 +11912,17 @@ const LABELS = {
|
|
|
11906
11912
|
};
|
|
11907
11913
|
const getKeyForField = (fieldName, country) => country ? LABELS[fieldName][country] || LABELS[fieldName].default : LABELS[fieldName].default;
|
|
11908
11914
|
const getAddressSchemaForCountry = (country) => ADDRESS_SCHEMAS[country] || ADDRESS_SCHEMAS.default;
|
|
11915
|
+
const getAddressSchemaLabelsByCountry = (country) => {
|
|
11916
|
+
const schema = getAddressSchemaForCountry(country);
|
|
11917
|
+
return schema.reduce((labels2, field) => ({
|
|
11918
|
+
...labels2,
|
|
11919
|
+
[field]: getKeyForField(field, country)
|
|
11920
|
+
}), {});
|
|
11921
|
+
};
|
|
11909
11922
|
const mapAddressLabels = (data, datasetUtils) => {
|
|
11910
|
-
|
|
11911
|
-
country
|
|
11912
|
-
} = data;
|
|
11913
|
-
if (country) {
|
|
11923
|
+
if (data == null ? void 0 : data.country) {
|
|
11914
11924
|
return Object.entries(data).reduce((mappedAddress, [field, value]) => {
|
|
11915
|
-
const mappedKey = getKeyForField(field, country);
|
|
11925
|
+
const mappedKey = getKeyForField(field, data.country);
|
|
11916
11926
|
switch (field) {
|
|
11917
11927
|
case "country":
|
|
11918
11928
|
return {
|
|
@@ -11922,7 +11932,7 @@ const mapAddressLabels = (data, datasetUtils) => {
|
|
|
11922
11932
|
case "stateOrProvince":
|
|
11923
11933
|
return {
|
|
11924
11934
|
...mappedAddress,
|
|
11925
|
-
[mappedKey]: datasetUtils.getStateName(value, country)
|
|
11935
|
+
[mappedKey]: datasetUtils.getStateName(value, data.country)
|
|
11926
11936
|
};
|
|
11927
11937
|
default:
|
|
11928
11938
|
return {
|
|
@@ -11988,7 +11998,8 @@ function FieldContainer(props) {
|
|
|
11988
11998
|
hideField,
|
|
11989
11999
|
maxlength,
|
|
11990
12000
|
handleChangeFor,
|
|
11991
|
-
readOnly
|
|
12001
|
+
readOnly,
|
|
12002
|
+
optional
|
|
11992
12003
|
} = props;
|
|
11993
12004
|
const formUtils = formUtilities(props, i18n);
|
|
11994
12005
|
const errorMessage = formUtils.getErrorMessage(fieldName, errors, fieldProblems);
|
|
@@ -12008,7 +12019,7 @@ function FieldContainer(props) {
|
|
|
12008
12019
|
country: errorMessage
|
|
12009
12020
|
},
|
|
12010
12021
|
labels: {
|
|
12011
|
-
country: formUtils.getLabel(field)
|
|
12022
|
+
country: formUtils.getLabel(field, labelKey)
|
|
12012
12023
|
},
|
|
12013
12024
|
readonly: readOnly,
|
|
12014
12025
|
classNameModifiers,
|
|
@@ -12027,7 +12038,7 @@ function FieldContainer(props) {
|
|
|
12027
12038
|
stateOrProvince: errorMessage
|
|
12028
12039
|
},
|
|
12029
12040
|
labels: {
|
|
12030
|
-
stateOrProvince: formUtils.getLabel(field)
|
|
12041
|
+
stateOrProvince: formUtils.getLabel(field, labelKey)
|
|
12031
12042
|
},
|
|
12032
12043
|
readonly: readOnly,
|
|
12033
12044
|
classNameModifiers,
|
|
@@ -12041,6 +12052,7 @@ function FieldContainer(props) {
|
|
|
12041
12052
|
classNameModifiers,
|
|
12042
12053
|
errorMessage,
|
|
12043
12054
|
isValid: valid[field],
|
|
12055
|
+
optional,
|
|
12044
12056
|
children: (childProps) => jsx(InputText, {
|
|
12045
12057
|
...childProps,
|
|
12046
12058
|
classNameModifiers,
|
|
@@ -12622,7 +12634,11 @@ const addressValidationRulesV4 = (country, i18n) => {
|
|
|
12622
12634
|
errorMessage: "fieldIsRequired"
|
|
12623
12635
|
}, {
|
|
12624
12636
|
modes: ["blur"],
|
|
12625
|
-
validate: (
|
|
12637
|
+
validate: (input) => !matchesRegex(NO_ALPHABET_REGEX, input),
|
|
12638
|
+
errorMessage: "nameMustContainLetters"
|
|
12639
|
+
}, {
|
|
12640
|
+
modes: ["blur"],
|
|
12641
|
+
validate: (val) => !matchesRegex(EMOJI_REGEX, val) && !hasRepeatedCharacters(val) && !isInvalidName(val) && matchesRegex(INDIVIDUAL_VALID_CHAR_REGEX, val),
|
|
12626
12642
|
errorMessage: "checkForTypos"
|
|
12627
12643
|
}, {
|
|
12628
12644
|
modes: ["blur"],
|
|
@@ -12654,7 +12670,11 @@ const addressValidationRulesV4 = (country, i18n) => {
|
|
|
12654
12670
|
errorMessage: "fieldIsRequired"
|
|
12655
12671
|
}, {
|
|
12656
12672
|
modes: ["blur"],
|
|
12657
|
-
validate: (
|
|
12673
|
+
validate: (input) => !matchesRegex(NO_ALPHABET_REGEX, input),
|
|
12674
|
+
errorMessage: "nameMustContainLetters"
|
|
12675
|
+
}, {
|
|
12676
|
+
modes: ["blur"],
|
|
12677
|
+
validate: (val) => !matchesRegex(EMOJI_REGEX, val) && !hasRepeatedCharacters(val) && !isInvalidName(val) && matchesRegex(INDIVIDUAL_VALID_CHAR_REGEX, val),
|
|
12658
12678
|
errorMessage: "checkForTypos"
|
|
12659
12679
|
}, {
|
|
12660
12680
|
modes: ["blur"],
|
|
@@ -12671,6 +12691,10 @@ const addressValidationRulesV4 = (country, i18n) => {
|
|
|
12671
12691
|
modes: ["blur"],
|
|
12672
12692
|
validate: (val) => !!val,
|
|
12673
12693
|
errorMessage: "fieldIsRequired"
|
|
12694
|
+
}, {
|
|
12695
|
+
modes: ["blur"],
|
|
12696
|
+
validate: (input) => !matchesRegex(NO_ALPHABET_REGEX, input),
|
|
12697
|
+
errorMessage: "nameMustContainLetters"
|
|
12674
12698
|
}, {
|
|
12675
12699
|
modes: ["blur"],
|
|
12676
12700
|
validate: (val) => !hasRepeatedCharacters(val) && !isInvalidName(val),
|
|
@@ -12682,7 +12706,11 @@ const addressValidationRulesV4 = (country, i18n) => {
|
|
|
12682
12706
|
errorMessage: "fieldIsRequired"
|
|
12683
12707
|
}, {
|
|
12684
12708
|
modes: ["blur"],
|
|
12685
|
-
validate: (
|
|
12709
|
+
validate: (input) => !matchesRegex(NO_ALPHABET_REGEX, input),
|
|
12710
|
+
errorMessage: "nameMustContainLetters"
|
|
12711
|
+
}, {
|
|
12712
|
+
modes: ["blur"],
|
|
12713
|
+
validate: (val) => !matchesRegex(EMOJI_REGEX, val) && !hasRepeatedCharacters(val) && !isInvalidName(val) && matchesRegex(INDIVIDUAL_VALID_CHAR_REGEX, val),
|
|
12686
12714
|
errorMessage: "checkForTypos"
|
|
12687
12715
|
}]
|
|
12688
12716
|
};
|
|
@@ -12691,6 +12719,7 @@ function Address(props) {
|
|
|
12691
12719
|
const {
|
|
12692
12720
|
data: dataProp,
|
|
12693
12721
|
requiredFields: requiredFieldsProp,
|
|
12722
|
+
optionalFields: optionalFieldsProp = ["otherAddressInformation"],
|
|
12694
12723
|
fieldValidationErrors: fieldValidationErrorsProp,
|
|
12695
12724
|
formVerificationErrors: formVerificationErrorsProp,
|
|
12696
12725
|
legalEntityId,
|
|
@@ -12741,11 +12770,13 @@ function Address(props) {
|
|
|
12741
12770
|
formatters: addressFormatters,
|
|
12742
12771
|
rules: isStrictNameAndAddressValidationEnabled ? rulesV4 : rules2,
|
|
12743
12772
|
fieldProblems: fieldValidationErrorsProp,
|
|
12773
|
+
optionalFields: optionalFieldsProp,
|
|
12744
12774
|
obscuredFields: []
|
|
12745
12775
|
});
|
|
12746
12776
|
const formUtils = formUtilities({
|
|
12747
12777
|
...props,
|
|
12748
|
-
requiredFields
|
|
12778
|
+
requiredFields,
|
|
12779
|
+
optionalFields: optionalFieldsProp
|
|
12749
12780
|
}, i18n);
|
|
12750
12781
|
useEffect(() => {
|
|
12751
12782
|
if (dataProp.country !== data.country && dataProp.country) {
|
|
@@ -12842,7 +12873,7 @@ function Address(props) {
|
|
|
12842
12873
|
}
|
|
12843
12874
|
}, [canAutofillVerifiedBusinessAddress, verifiedBusiness]);
|
|
12844
12875
|
const getComponent = (fieldName) => {
|
|
12845
|
-
if (!formUtils.isRequiredField(fieldName)) return null;
|
|
12876
|
+
if (!formUtils.isRequiredField(fieldName) && !formUtils.isOptionalField(fieldName)) return null;
|
|
12846
12877
|
const hideField = fieldName === "country" && hideCountry;
|
|
12847
12878
|
return jsx(FieldContainer, {
|
|
12848
12879
|
classNameModifiers: [fieldName],
|
|
@@ -12856,6 +12887,7 @@ function Address(props) {
|
|
|
12856
12887
|
hideField,
|
|
12857
12888
|
"aria-label": formUtils.getLabel(fieldName, fieldName),
|
|
12858
12889
|
readOnly: formUtils.isReadOnly(fieldName),
|
|
12890
|
+
optional: formUtils.isOptionalField(fieldName),
|
|
12859
12891
|
trimOnBlur: true
|
|
12860
12892
|
}, fieldName);
|
|
12861
12893
|
};
|
|
@@ -13903,32 +13935,30 @@ const businessDetailsBaseMapping = {
|
|
|
13903
13935
|
"basicInformation.stateOrProvince": "organization.registeredAddress.stateOrProvince",
|
|
13904
13936
|
"basicInformation.registrationNumber": "organization.registrationNumber",
|
|
13905
13937
|
"basicInformation.taxInformation": "organization.taxInformation",
|
|
13906
|
-
"basicInformation.isUen": "organization.isUen",
|
|
13907
13938
|
"companyStructure.entityType": "organization.type",
|
|
13908
13939
|
"additionalInformation.legalCompanyName": "organization.legalName",
|
|
13909
13940
|
"additionalInformation.legalFormDescription": "organization.legalFormDescription",
|
|
13910
13941
|
"additionalInformation.dbaName": "organization.doingBusinessAs",
|
|
13911
13942
|
"additionalInformation.registrationNumber": "organization.registrationNumber",
|
|
13912
13943
|
"additionalInformation.taxInformation": "organization.taxInformation",
|
|
13913
|
-
"additionalInformation.isUen": "organization.isUen",
|
|
13914
13944
|
"additionalInformation.vatNumber": "organization.vatNumber",
|
|
13915
13945
|
"additionalInformation.vatAbsenceReason": "organization.vatAbsenceReason",
|
|
13916
13946
|
"additionalInformation.dateOfIncorporation": "organization.dateOfIncorporation",
|
|
13917
13947
|
"additionalInformation.stockExchangeMIC": "organization.stockData.marketIdentifier",
|
|
13918
13948
|
"additionalInformation.stockISIN": "organization.stockData.stockNumber",
|
|
13919
13949
|
"additionalInformation.stockTickerSymbol": "organization.stockData.tickerSymbol",
|
|
13920
|
-
"
|
|
13921
|
-
"
|
|
13922
|
-
"
|
|
13923
|
-
"
|
|
13924
|
-
"
|
|
13925
|
-
"
|
|
13926
|
-
"
|
|
13927
|
-
"
|
|
13928
|
-
"
|
|
13929
|
-
"
|
|
13930
|
-
"
|
|
13931
|
-
"
|
|
13950
|
+
"additionalInformation.registrationAddress.city": "organization.registeredAddress.city",
|
|
13951
|
+
"additionalInformation.registrationAddress.country": "organization.registeredAddress.country",
|
|
13952
|
+
"additionalInformation.registrationAddress.postalCode": "organization.registeredAddress.postalCode",
|
|
13953
|
+
"additionalInformation.registrationAddress.stateOrProvince": "organization.registeredAddress.stateOrProvince",
|
|
13954
|
+
"additionalInformation.registrationAddress.address": "organization.registeredAddress.street",
|
|
13955
|
+
"additionalInformation.registrationAddress.otherAddressInformation": "organization.registeredAddress.street2",
|
|
13956
|
+
"additionalInformation.operationalAddress.city": "organization.principalPlaceOfBusiness.city",
|
|
13957
|
+
"additionalInformation.operationalAddress.country": "organization.principalPlaceOfBusiness.country",
|
|
13958
|
+
"additionalInformation.operationalAddress.postalCode": "organization.principalPlaceOfBusiness.postalCode",
|
|
13959
|
+
"additionalInformation.operationalAddress.stateOrProvince": "organization.principalPlaceOfBusiness.stateOrProvince",
|
|
13960
|
+
"additionalInformation.operationalAddress.address": "organization.principalPlaceOfBusiness.street",
|
|
13961
|
+
"additionalInformation.operationalAddress.otherAddressInformation": "organization.principalPlaceOfBusiness.street2"
|
|
13932
13962
|
};
|
|
13933
13963
|
const companyBaseMapping = {
|
|
13934
13964
|
"companyNameAndCountry.country": "organization.registeredAddress.country",
|
|
@@ -13941,7 +13971,6 @@ const companyBaseMapping = {
|
|
|
13941
13971
|
"companyRegistrationDetails.vatNumber": "organization.vatNumber",
|
|
13942
13972
|
"companyRegistrationDetails.vatAbsenceReason": "organization.vatAbsenceReason",
|
|
13943
13973
|
"companyRegistrationDetails.dateOfIncorporation": "organization.dateOfIncorporation",
|
|
13944
|
-
"companyRegistrationDetails.isUen": "organization.isUen",
|
|
13945
13974
|
"companyRegistrationDetails.stockExchangeMIC": "organization.stockData.marketIdentifier",
|
|
13946
13975
|
"companyRegistrationDetails.stockISIN": "organization.stockData.stockNumber",
|
|
13947
13976
|
"companyRegistrationDetails.stockTickerSymbol": "organization.stockData.tickerSymbol",
|
|
@@ -13982,7 +14011,6 @@ const companySearchBaseMapping = {
|
|
|
13982
14011
|
"companyOtherDetails.vatNumber": "organization.vatNumber",
|
|
13983
14012
|
"companyOtherDetails.vatAbsenceReason": "organization.vatAbsenceReason",
|
|
13984
14013
|
"companyOtherDetails.dateOfIncorporation": "organization.dateOfIncorporation",
|
|
13985
|
-
"companyOtherDetails.isUen": "organization.isUen",
|
|
13986
14014
|
"companyOtherDetails.stockExchangeMIC": "organization.stockData.marketIdentifier",
|
|
13987
14015
|
"companyOtherDetails.stockISIN": "organization.stockData.stockNumber",
|
|
13988
14016
|
"companyOtherDetails.stockTickerSymbol": "organization.stockData.tickerSymbol"
|
|
@@ -14338,23 +14366,23 @@ const mapLegalEntityToCompany = (legalEntity, isChangingType, accountHolder) =>
|
|
|
14338
14366
|
return companyCompData;
|
|
14339
14367
|
};
|
|
14340
14368
|
const mapCompanyToLegalEntity = (data) => {
|
|
14341
|
-
var _a, _b, _c, _d, _e, _f;
|
|
14369
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
14342
14370
|
const requestObj = {
|
|
14343
14371
|
...formatObject(data, companyApiKeyMapping)
|
|
14344
14372
|
};
|
|
14345
14373
|
if (requestObj.organization.vatAbsenceReason) {
|
|
14346
14374
|
requestObj.organization.vatNumber = "";
|
|
14347
14375
|
}
|
|
14348
|
-
const taxId = (_a = data.companyRegistrationDetails.taxInformation) == null ? void 0 : _a.find((tax) => {
|
|
14376
|
+
const taxId = (_b = (_a = data.companyRegistrationDetails.taxInformation) == null ? void 0 : _a.find((tax) => {
|
|
14349
14377
|
var _a2;
|
|
14350
14378
|
return tax.country === ((_a2 = data.companyNameAndCountry) == null ? void 0 : _a2.country);
|
|
14351
|
-
}).number;
|
|
14352
|
-
if (taxId || ((
|
|
14379
|
+
})) == null ? void 0 : _b.number;
|
|
14380
|
+
if (taxId || ((_c = data.companyRegistrationDetails) == null ? void 0 : _c.isUen)) {
|
|
14353
14381
|
requestObj.organization = updateTaxInformation({
|
|
14354
|
-
taxId: ((
|
|
14355
|
-
country: (
|
|
14356
|
-
exemptedFromTax: (
|
|
14357
|
-
isUen: (
|
|
14382
|
+
taxId: ((_d = data.companyRegistrationDetails) == null ? void 0 : _d.isUen) ? data.companyRegistrationDetails.registrationNumber : taxId,
|
|
14383
|
+
country: (_e = data.companyNameAndCountry) == null ? void 0 : _e.country,
|
|
14384
|
+
exemptedFromTax: (_f = data.companyRegistrationDetails) == null ? void 0 : _f.exemptedFromTax,
|
|
14385
|
+
isUen: (_g = data.companyRegistrationDetails) == null ? void 0 : _g.isUen,
|
|
14358
14386
|
entity: requestObj.organization
|
|
14359
14387
|
});
|
|
14360
14388
|
}
|
|
@@ -16510,7 +16538,8 @@ const DecisionMakerRoleComponent = (props) => {
|
|
|
16510
16538
|
validators: validators2,
|
|
16511
16539
|
fieldValidationErrors,
|
|
16512
16540
|
requiredFields,
|
|
16513
|
-
allowedRoles
|
|
16541
|
+
allowedRoles,
|
|
16542
|
+
trustedRoles
|
|
16514
16543
|
} = props;
|
|
16515
16544
|
const {
|
|
16516
16545
|
i18n
|
|
@@ -16568,7 +16597,7 @@ const DecisionMakerRoleComponent = (props) => {
|
|
|
16568
16597
|
onSelect: changeRoles,
|
|
16569
16598
|
mapToSelectItem: (role) => ({
|
|
16570
16599
|
...makeSelectItemForRole(role, i18n),
|
|
16571
|
-
disabled: !(allowedRoles == null ? void 0 : allowedRoles.includes(role))
|
|
16600
|
+
disabled: allowedRoles ? !(allowedRoles == null ? void 0 : allowedRoles.includes(role)) : trustedRoles.includes(role)
|
|
16572
16601
|
})
|
|
16573
16602
|
})
|
|
16574
16603
|
})]
|
|
@@ -17464,10 +17493,13 @@ function PersonalDetailsComponent(props) {
|
|
|
17464
17493
|
isExperimentEnabled
|
|
17465
17494
|
} = useExperimentsContext();
|
|
17466
17495
|
const isAgeVerificationEnabled = isExperimentEnabled("EnableAgeVerification");
|
|
17467
|
-
const PERSONAL_DETAILS = props.id;
|
|
17468
17496
|
const {
|
|
17469
|
-
|
|
17470
|
-
|
|
17497
|
+
id: PERSONAL_DETAILS,
|
|
17498
|
+
trustedRoles,
|
|
17499
|
+
data: {
|
|
17500
|
+
residencyCountry
|
|
17501
|
+
}
|
|
17502
|
+
} = props;
|
|
17471
17503
|
const [externalErrors, setExternalErrors] = useState(null);
|
|
17472
17504
|
const [status, setStatus] = useState("success");
|
|
17473
17505
|
const stateRef = useRef({
|
|
@@ -17646,7 +17678,8 @@ function PersonalDetailsComponent(props) {
|
|
|
17646
17678
|
...decisionMakerRoleProps,
|
|
17647
17679
|
taskType: props.taskType,
|
|
17648
17680
|
dataStoreId: PERSONAL_DETAILS,
|
|
17649
|
-
allowedRoles: props == null ? void 0 : props.allowedRoles
|
|
17681
|
+
allowedRoles: props == null ? void 0 : props.allowedRoles,
|
|
17682
|
+
trustedRoles
|
|
17650
17683
|
}), hasRequiredFields(nameProps) && jsx(Name, {
|
|
17651
17684
|
...nameProps,
|
|
17652
17685
|
dataStoreId: PERSONAL_DETAILS
|
|
@@ -18097,7 +18130,8 @@ function IndividualComponent(props) {
|
|
|
18097
18130
|
allowedRoles: props == null ? void 0 : props.allowedRoles,
|
|
18098
18131
|
capabilities: props.capabilities,
|
|
18099
18132
|
parentLegalEntity: props.parentLegalEntity,
|
|
18100
|
-
trustedFieldsProvider: props.trustedFieldsProvider
|
|
18133
|
+
trustedFieldsProvider: props.trustedFieldsProvider,
|
|
18134
|
+
trustedRoles: props.trustedRoles
|
|
18101
18135
|
})
|
|
18102
18136
|
}), jsx("div", {
|
|
18103
18137
|
className: activeForm.formId !== addressFormID ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper",
|
|
@@ -19558,12 +19592,9 @@ function BankVerification(props) {
|
|
|
19558
19592
|
heading
|
|
19559
19593
|
}), jsxs("div", {
|
|
19560
19594
|
className: "adyen-kyc-bank-verification-success",
|
|
19561
|
-
children: [jsx(
|
|
19562
|
-
|
|
19563
|
-
|
|
19564
|
-
role: "img",
|
|
19565
|
-
"aria-hidden": "true"
|
|
19566
|
-
})
|
|
19595
|
+
children: [jsx(Icon, {
|
|
19596
|
+
name: "check",
|
|
19597
|
+
className: "adyen-kyc-u-margin-x-24"
|
|
19567
19598
|
}), jsxs("span", {
|
|
19568
19599
|
children: [" ", i18n.get("youSuccessfullyVerifiedAccount")]
|
|
19569
19600
|
})]
|
|
@@ -19585,12 +19616,6 @@ function BankVerification(props) {
|
|
|
19585
19616
|
});
|
|
19586
19617
|
}
|
|
19587
19618
|
const BankVerification$1 = memo(BankVerification);
|
|
19588
|
-
const CoreContext = createContext(void 0);
|
|
19589
|
-
const useCoreContext = () => {
|
|
19590
|
-
const context = useContext(CoreContext);
|
|
19591
|
-
if (!context) throw Error("You need a <CoreProvider> to use core context");
|
|
19592
|
-
return context;
|
|
19593
|
-
};
|
|
19594
19619
|
const countriesWithMultipleCurrencies = /* @__PURE__ */ new Set([CountryCodes.Bulgaria, CountryCodes.Canada, CountryCodes.Croatia, CountryCodes.CzechRepublic, CountryCodes.Hungary, CountryCodes.Romania, CountryCodes.Switzerland]);
|
|
19595
19620
|
const countriesWithLocalFormat = /* @__PURE__ */ new Set([CountryCodes.Denmark, CountryCodes.Norway, CountryCodes.Poland, CountryCodes.Sweden, CountryCodes.UnitedKingdom]);
|
|
19596
19621
|
const payoutCurrencySupport = {
|
|
@@ -22525,7 +22550,7 @@ const entityProblemInitialState = {
|
|
|
22525
22550
|
// default status - if the entity is not listed in the problems array
|
|
22526
22551
|
validationErrors: {}
|
|
22527
22552
|
};
|
|
22528
|
-
const UNRELATED_DATA_MISSING_ERROR_CODES = ["2_8036", "2_8064", "2_8067", "2_8183", "2_8189"];
|
|
22553
|
+
const UNRELATED_DATA_MISSING_ERROR_CODES = ["2_8036", "2_8064", "2_8067", "2_8183", "2_8189", "2_8190", "2_8191", "2_8193"];
|
|
22529
22554
|
const UNRELATED_INVALID_INPUT_ERROR_CODES = ["1_14", "2_901", "2_902"];
|
|
22530
22555
|
function getCapabilityProblems(response, country, isExperimentEnabled) {
|
|
22531
22556
|
const capabilities = (response == null ? void 0 : response.capabilities) || {};
|
|
@@ -23667,7 +23692,7 @@ function getPropsFromConfigurations(scenarioConfiguration, forms2, remediationAc
|
|
|
23667
23692
|
const masks = {};
|
|
23668
23693
|
const validators2 = {};
|
|
23669
23694
|
const obscuredFields = {};
|
|
23670
|
-
const
|
|
23695
|
+
const trustedFields = {};
|
|
23671
23696
|
if (!scenarioConfiguration) {
|
|
23672
23697
|
return;
|
|
23673
23698
|
}
|
|
@@ -23703,7 +23728,7 @@ function getPropsFromConfigurations(scenarioConfiguration, forms2, remediationAc
|
|
|
23703
23728
|
}
|
|
23704
23729
|
const isFieldTrusted = isTrustedField(trustedMappings, formId, field);
|
|
23705
23730
|
if (isFieldTrusted) {
|
|
23706
|
-
|
|
23731
|
+
trustedFields[formId] = trustedFields[formId] ? [...trustedFields[formId], field] : [field];
|
|
23707
23732
|
}
|
|
23708
23733
|
if (fieldConfigurations) {
|
|
23709
23734
|
const customLabel = (_a3 = customLabels2 == null ? void 0 : customLabels2[field]) == null ? void 0 : _a3.call(customLabels2);
|
|
@@ -23774,7 +23799,7 @@ function getPropsFromConfigurations(scenarioConfiguration, forms2, remediationAc
|
|
|
23774
23799
|
placeholders,
|
|
23775
23800
|
validators: validators2,
|
|
23776
23801
|
obscuredFields,
|
|
23777
|
-
trustedFields
|
|
23802
|
+
trustedFields,
|
|
23778
23803
|
helperText,
|
|
23779
23804
|
masks
|
|
23780
23805
|
};
|
|
@@ -23795,7 +23820,7 @@ const isFieldRequiredToRemediateDataMissingError = (formId, field, dataMissingEr
|
|
|
23795
23820
|
const missingAndLinkedFields = addLinkedFields(missingFields);
|
|
23796
23821
|
return missingAndLinkedFields.includes(makeTLDSFieldName(formId, field));
|
|
23797
23822
|
};
|
|
23798
|
-
const isTrustedField = (
|
|
23823
|
+
const isTrustedField = (trustedFields, formId, field) => trustedFields == null ? void 0 : trustedFields.some((trustedField) => {
|
|
23799
23824
|
const split = trustedField.split(".");
|
|
23800
23825
|
return split[0] === formId && split[split.length - 1] === field;
|
|
23801
23826
|
});
|
|
@@ -24032,11 +24057,8 @@ function VerifiedBusinessCard({
|
|
|
24032
24057
|
})]
|
|
24033
24058
|
})
|
|
24034
24059
|
}].filter((item) => !!item.value), [address, addressLink, i18n, verifiedBusiness == null ? void 0 : verifiedBusiness.legalForm]);
|
|
24035
|
-
return
|
|
24036
|
-
children:
|
|
24037
|
-
el: "h3",
|
|
24038
|
-
children: i18n.get("verifiedInformation")
|
|
24039
|
-
}), jsxs("div", {
|
|
24060
|
+
return jsx("section", {
|
|
24061
|
+
children: jsxs("div", {
|
|
24040
24062
|
className: "adyen-kyc-verified-business-card",
|
|
24041
24063
|
children: [jsx(StructuredList, {
|
|
24042
24064
|
items: baseItems
|
|
@@ -24052,11 +24074,11 @@ function VerifiedBusinessCard({
|
|
|
24052
24074
|
onClick: () => setExpanded(!expanded)
|
|
24053
24075
|
})
|
|
24054
24076
|
})]
|
|
24055
|
-
})
|
|
24077
|
+
})
|
|
24056
24078
|
});
|
|
24057
24079
|
}
|
|
24058
24080
|
const ADDITIONAL_INFORMATION_FORM_ID = "additionalInformation";
|
|
24059
|
-
const ADDITIONAL_INFORMATION_FIELDS = [...LEGAL_COMPANY_NAME_FIELD, ...DBA_NAME_FIELD, ...BUSINESS_REGISTRATION_NUMBER_FIELD, ...TAX_INFORMATION_FIELD, ...VAT_NUMBER_FIELD, ...DATE_OF_INCORPORATION_FIELD, ...STOCK_EXCHANGE_MIC_FIELD, ...STOCK_ISIN_FIELD, ...STOCK_TICKER_SYMBOL_FIELD, "legalFormDescription"];
|
|
24081
|
+
const ADDITIONAL_INFORMATION_FIELDS = [...LEGAL_COMPANY_NAME_FIELD, ...DBA_NAME_FIELD, ...BUSINESS_REGISTRATION_NUMBER_FIELD, ...TAX_INFORMATION_FIELD, ...VAT_NUMBER_FIELD, ...DATE_OF_INCORPORATION_FIELD, ...STOCK_EXCHANGE_MIC_FIELD, ...STOCK_ISIN_FIELD, ...STOCK_TICKER_SYMBOL_FIELD, "legalFormDescription", ...registrationAddressFields];
|
|
24060
24082
|
function AdditionalInformationComponent({
|
|
24061
24083
|
data,
|
|
24062
24084
|
labels: labels2,
|
|
@@ -24073,11 +24095,13 @@ function AdditionalInformationComponent({
|
|
|
24073
24095
|
obscuredFields,
|
|
24074
24096
|
optionalFields,
|
|
24075
24097
|
readOnlyFields,
|
|
24076
|
-
trustedFields
|
|
24098
|
+
trustedFields,
|
|
24077
24099
|
country,
|
|
24078
24100
|
companyType = CompanyTypesValue.PRIVATE_COMPANY,
|
|
24079
24101
|
verifiedBusiness,
|
|
24080
|
-
showCompanyStructure
|
|
24102
|
+
showCompanyStructure,
|
|
24103
|
+
handleAddressSearch,
|
|
24104
|
+
handleFindAddress
|
|
24081
24105
|
}) {
|
|
24082
24106
|
var _a, _b, _c, _d;
|
|
24083
24107
|
const {
|
|
@@ -24088,6 +24112,12 @@ function AdditionalInformationComponent({
|
|
|
24088
24112
|
} = useI18nContext();
|
|
24089
24113
|
const showVerified = !!verifiedBusiness;
|
|
24090
24114
|
const showStockData = companyType === CompanyTypesValue.PUBLIC_COMPANY;
|
|
24115
|
+
const ADDRESS_SCHEMA2 = getAddressSchemaForCountry(country).filter((field) => {
|
|
24116
|
+
if (!COUNTRIES_WITH_STATES_DATASET.includes(country)) {
|
|
24117
|
+
return field !== "otherAddressInformation" && field !== "stateOrProvince";
|
|
24118
|
+
}
|
|
24119
|
+
return field !== "otherAddressInformation";
|
|
24120
|
+
});
|
|
24091
24121
|
const initialFormUtilsProps = useMemo(() => ({
|
|
24092
24122
|
data,
|
|
24093
24123
|
labels: labels2,
|
|
@@ -24099,9 +24129,9 @@ function AdditionalInformationComponent({
|
|
|
24099
24129
|
readOnlyFields,
|
|
24100
24130
|
optionalFields,
|
|
24101
24131
|
obscuredFields,
|
|
24102
|
-
trustedFields
|
|
24132
|
+
trustedFields,
|
|
24103
24133
|
shouldValidate
|
|
24104
|
-
}), [data, labels2, placeholders, helperText, readOnly, allFields, requiredFields, readOnlyFields, optionalFields, obscuredFields,
|
|
24134
|
+
}), [data, labels2, placeholders, helperText, readOnly, allFields, requiredFields, readOnlyFields, optionalFields, obscuredFields, trustedFields, shouldValidate]);
|
|
24105
24135
|
const registrationNumberOptions = useMemo(() => getCompanyRegistrationNumberOptions(country, companyType), [country, companyType]);
|
|
24106
24136
|
const defaultRegistrationNumberType = (data == null ? void 0 : data.registrationNumber) ? inferCompanyRegistrationNumberType(data == null ? void 0 : data.registrationNumber, country, companyType) : registrationNumberOptions == null ? void 0 : registrationNumberOptions[0].id;
|
|
24107
24137
|
const [registrationNumberType, setRegistrationNumberType] = useState(defaultRegistrationNumberType);
|
|
@@ -24176,6 +24206,20 @@ function AdditionalInformationComponent({
|
|
|
24176
24206
|
}
|
|
24177
24207
|
}, initialFormUtilsProps);
|
|
24178
24208
|
}, [companyType, country, initialFormUtilsProps, registrationNumberType, taxIdNumberType, vatNumberType]);
|
|
24209
|
+
const mergedDefaultData = useMemo(() => {
|
|
24210
|
+
if (!verifiedBusiness) return data;
|
|
24211
|
+
return {
|
|
24212
|
+
...data,
|
|
24213
|
+
legalCompanyName: verifiedBusiness.name,
|
|
24214
|
+
registrationAddress: {
|
|
24215
|
+
address: verifiedBusiness.street,
|
|
24216
|
+
city: verifiedBusiness.city,
|
|
24217
|
+
postalCode: verifiedBusiness.zipcode,
|
|
24218
|
+
stateOrProvince: verifiedBusiness.state,
|
|
24219
|
+
country: verifiedBusiness.country
|
|
24220
|
+
}
|
|
24221
|
+
};
|
|
24222
|
+
}, [data, verifiedBusiness]);
|
|
24179
24223
|
const {
|
|
24180
24224
|
schema: formSchema,
|
|
24181
24225
|
data: formData,
|
|
@@ -24184,10 +24228,11 @@ function AdditionalInformationComponent({
|
|
|
24184
24228
|
fieldProblems: formFieldProblems,
|
|
24185
24229
|
handleChangeFor,
|
|
24186
24230
|
resetToDefaultData,
|
|
24187
|
-
setErrors
|
|
24231
|
+
setErrors,
|
|
24232
|
+
setValid
|
|
24188
24233
|
} = useForm({
|
|
24189
24234
|
schema: getFormSchema2,
|
|
24190
|
-
defaultData:
|
|
24235
|
+
defaultData: mergedDefaultData,
|
|
24191
24236
|
rules: mergedFieldProps == null ? void 0 : mergedFieldProps.validators,
|
|
24192
24237
|
optionalFields: mergedFieldProps == null ? void 0 : mergedFieldProps.optionalFields,
|
|
24193
24238
|
obscuredFields: mergedFieldProps == null ? void 0 : mergedFieldProps.obscuredFields,
|
|
@@ -24209,9 +24254,7 @@ function AdditionalInformationComponent({
|
|
|
24209
24254
|
if (verifiedBusiness && verifiedBusiness.name !== formData.legalCompanyName) return handleChangeFor("legalCompanyName")(verifiedBusiness.name);
|
|
24210
24255
|
}, [formData.legalCompanyName, verifiedBusiness, showCompanyStructure]);
|
|
24211
24256
|
useEffect(() => {
|
|
24212
|
-
if (!verifiedBusiness && !showCompanyStructure)
|
|
24213
|
-
return resetToDefaultData();
|
|
24214
|
-
}
|
|
24257
|
+
if (!verifiedBusiness && !showCompanyStructure) resetToDefaultData();
|
|
24215
24258
|
}, [verifiedBusiness]);
|
|
24216
24259
|
const showField = (fieldKeys) => fieldKeys.some((field) => {
|
|
24217
24260
|
switch (field) {
|
|
@@ -24222,6 +24265,15 @@ function AdditionalInformationComponent({
|
|
|
24222
24265
|
return formUtils.isRequiredField(field) || formUtils.isOptionalField(field);
|
|
24223
24266
|
}
|
|
24224
24267
|
});
|
|
24268
|
+
const handleRegistrationAddressChange = (state) => {
|
|
24269
|
+
handleChangeFor("registrationAddress")(state.data);
|
|
24270
|
+
setValid("registrationAddress", Boolean(state.isValid));
|
|
24271
|
+
};
|
|
24272
|
+
const handleOperationalAddressChange = (state) => {
|
|
24273
|
+
handleChangeFor("operationalAddress")(state.data);
|
|
24274
|
+
setValid("operationalAddress", Boolean(state.isValid));
|
|
24275
|
+
};
|
|
24276
|
+
const handleOperationalAddressIsSameChange = (isChecked) => isChecked ? handleChangeFor("operationalAddressIsSame")(operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_SAME) : handleChangeFor("operationalAddressIsSame")(operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME);
|
|
24225
24277
|
return jsxs("form", {
|
|
24226
24278
|
id: ADDITIONAL_INFORMATION_FORM_ID,
|
|
24227
24279
|
className: "adyen-kyc-additional-information",
|
|
@@ -24233,12 +24285,25 @@ function AdditionalInformationComponent({
|
|
|
24233
24285
|
verificationErrors: formVerificationErrors,
|
|
24234
24286
|
validationErrors: fieldValidationErrors,
|
|
24235
24287
|
formUtils
|
|
24236
|
-
}), showVerified &&
|
|
24237
|
-
|
|
24288
|
+
}), showVerified && jsxs("div", {
|
|
24289
|
+
children: [jsx("div", {
|
|
24290
|
+
className: "adyen-kyc-additional-information__section-heading",
|
|
24291
|
+
children: jsx(Typography, {
|
|
24292
|
+
el: "h3",
|
|
24293
|
+
variant: "title",
|
|
24294
|
+
children: i18n.get("verifiedInformation")
|
|
24295
|
+
})
|
|
24296
|
+
}), jsx(VerifiedBusinessCard, {
|
|
24297
|
+
verifiedBusiness
|
|
24298
|
+
})]
|
|
24238
24299
|
}), jsxs("fieldset", {
|
|
24239
|
-
children: [showVerified && jsx(
|
|
24240
|
-
|
|
24241
|
-
children:
|
|
24300
|
+
children: [showVerified && jsx("div", {
|
|
24301
|
+
className: "adyen-kyc-additional-information__section-heading",
|
|
24302
|
+
children: jsx(Typography, {
|
|
24303
|
+
el: "h3",
|
|
24304
|
+
variant: "title",
|
|
24305
|
+
children: i18n.get("otherBusinessInformation")
|
|
24306
|
+
})
|
|
24242
24307
|
}), showField(LEGAL_COMPANY_NAME_FIELD) && jsx("div", {
|
|
24243
24308
|
className: "adyen-kyc-field-wrapper",
|
|
24244
24309
|
children: jsx(LegalCompanyNameField, {
|
|
@@ -24329,7 +24394,8 @@ function AdditionalInformationComponent({
|
|
|
24329
24394
|
country,
|
|
24330
24395
|
canExempt: formUtils.isRequiredField("exemptedFromVat"),
|
|
24331
24396
|
vatNumberType,
|
|
24332
|
-
setVatNumberType
|
|
24397
|
+
setVatNumberType,
|
|
24398
|
+
shouldValidate
|
|
24333
24399
|
})
|
|
24334
24400
|
}), showField(DATE_OF_INCORPORATION_FIELD) && jsx("div", {
|
|
24335
24401
|
className: "adyen-kyc-field-wrapper",
|
|
@@ -24346,9 +24412,13 @@ function AdditionalInformationComponent({
|
|
|
24346
24412
|
})
|
|
24347
24413
|
})]
|
|
24348
24414
|
}), showStockData && jsxs("fieldset", {
|
|
24349
|
-
children: [jsx(
|
|
24350
|
-
|
|
24351
|
-
children:
|
|
24415
|
+
children: [jsx("div", {
|
|
24416
|
+
className: "adyen-kyc-additional-information__section-heading",
|
|
24417
|
+
children: jsx(Typography, {
|
|
24418
|
+
el: "h3",
|
|
24419
|
+
variant: "title",
|
|
24420
|
+
children: i18n.get("stockExchangeInformation")
|
|
24421
|
+
})
|
|
24352
24422
|
}), showField(STOCK_EXCHANGE_MIC_FIELD) && jsx("div", {
|
|
24353
24423
|
className: "adyen-kyc-field-wrapper",
|
|
24354
24424
|
children: jsx(StockExchangeMICField, {
|
|
@@ -24392,6 +24462,79 @@ function AdditionalInformationComponent({
|
|
|
24392
24462
|
handleChangeFor
|
|
24393
24463
|
})
|
|
24394
24464
|
})]
|
|
24465
|
+
}), jsxs("fieldset", {
|
|
24466
|
+
children: [jsxs("div", {
|
|
24467
|
+
className: "adyen-kyc-additional-information__section-heading",
|
|
24468
|
+
children: [jsx(Typography, {
|
|
24469
|
+
el: "h3",
|
|
24470
|
+
variant: "title",
|
|
24471
|
+
children: i18n.get("registeredBusinessAddress")
|
|
24472
|
+
}), jsx(Typography, {
|
|
24473
|
+
el: "h4",
|
|
24474
|
+
variant: "caption",
|
|
24475
|
+
children: i18n.get("registeredBusinessAddressDescription")
|
|
24476
|
+
})]
|
|
24477
|
+
}), jsx(Address, {
|
|
24478
|
+
id: ADDITIONAL_INFORMATION_FORM_ID,
|
|
24479
|
+
addressType: "registrationAddress",
|
|
24480
|
+
data: {
|
|
24481
|
+
...mergedDefaultData == null ? void 0 : mergedDefaultData.registrationAddress,
|
|
24482
|
+
country
|
|
24483
|
+
},
|
|
24484
|
+
labels: getAddressSchemaLabelsByCountry(country),
|
|
24485
|
+
countryCode: country,
|
|
24486
|
+
requiredFields: ADDRESS_SCHEMA2,
|
|
24487
|
+
shouldValidate,
|
|
24488
|
+
hideCountry: true,
|
|
24489
|
+
optionalFields: ["otherAddressInformation"],
|
|
24490
|
+
onChange: handleRegistrationAddressChange,
|
|
24491
|
+
handleAddressSearch,
|
|
24492
|
+
handleFindAddress,
|
|
24493
|
+
verifiedBusiness
|
|
24494
|
+
})]
|
|
24495
|
+
}), jsxs("fieldset", {
|
|
24496
|
+
children: [jsxs("div", {
|
|
24497
|
+
className: "adyen-kyc-additional-information__section-heading",
|
|
24498
|
+
children: [jsx(Typography, {
|
|
24499
|
+
el: "h3",
|
|
24500
|
+
variant: "title",
|
|
24501
|
+
children: i18n.get("principalPlaceOfBusiness")
|
|
24502
|
+
}), jsx(Typography, {
|
|
24503
|
+
el: "h4",
|
|
24504
|
+
variant: "caption",
|
|
24505
|
+
children: i18n.get("principalPlaceOfBusinessDescription")
|
|
24506
|
+
})]
|
|
24507
|
+
}), jsx(Field, {
|
|
24508
|
+
name: "operationalAddressIsSame",
|
|
24509
|
+
classNameModifiers: ["operationalAddressIsSame"],
|
|
24510
|
+
errorMessage: formErrors.operationalAddressIsSame,
|
|
24511
|
+
isValid: formValid.operationalAddressIsSame,
|
|
24512
|
+
children: (childProps) => jsx(Checkbox, {
|
|
24513
|
+
...childProps,
|
|
24514
|
+
"aria-required": formUtils.isRequiredField("operationalAddressIsSame"),
|
|
24515
|
+
"aria-label": formUtils.getLabel("sameAsRegisteredAddress"),
|
|
24516
|
+
"aria-invalid": !formValid.operationalAddressIsSame,
|
|
24517
|
+
name: "operationalAddressIsSame",
|
|
24518
|
+
label: formUtils.getLabel("sameAsRegisteredAddress"),
|
|
24519
|
+
checked: formData.operationalAddressIsSame ? formData.operationalAddressIsSame === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_SAME : true,
|
|
24520
|
+
onChange: handleOperationalAddressIsSameChange
|
|
24521
|
+
})
|
|
24522
|
+
}), formData.operationalAddressIsSame === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME && jsx(Address, {
|
|
24523
|
+
id: ADDITIONAL_INFORMATION_FORM_ID,
|
|
24524
|
+
addressType: "operationalAddress",
|
|
24525
|
+
data: {
|
|
24526
|
+
...mergedDefaultData == null ? void 0 : mergedDefaultData.operationalAddress,
|
|
24527
|
+
country
|
|
24528
|
+
},
|
|
24529
|
+
labels: getAddressSchemaLabelsByCountry(country),
|
|
24530
|
+
countryCode: country,
|
|
24531
|
+
requiredFields: ADDRESS_SCHEMA2,
|
|
24532
|
+
shouldValidate,
|
|
24533
|
+
optionalFields: ["otherAddressInformation"],
|
|
24534
|
+
onChange: handleOperationalAddressChange,
|
|
24535
|
+
handleAddressSearch,
|
|
24536
|
+
handleFindAddress
|
|
24537
|
+
})]
|
|
24395
24538
|
})]
|
|
24396
24539
|
});
|
|
24397
24540
|
}
|
|
@@ -24538,8 +24681,8 @@ function BusinessInformationCard({
|
|
|
24538
24681
|
result,
|
|
24539
24682
|
selectedBusinessId,
|
|
24540
24683
|
currentBusinessSelection,
|
|
24541
|
-
|
|
24542
|
-
|
|
24684
|
+
fetchStatus,
|
|
24685
|
+
verifyStatus,
|
|
24543
24686
|
invalidTin,
|
|
24544
24687
|
resetTinVerification,
|
|
24545
24688
|
setIsBusinessSelection,
|
|
@@ -24549,9 +24692,9 @@ function BusinessInformationCard({
|
|
|
24549
24692
|
const {
|
|
24550
24693
|
i18n
|
|
24551
24694
|
} = useI18nContext();
|
|
24552
|
-
const showSelectButton =
|
|
24695
|
+
const showSelectButton = fetchStatus !== "loading" && fetchStatus !== "error" && currentBusinessSelection;
|
|
24553
24696
|
const selectBusiness = (searchResult) => {
|
|
24554
|
-
if (
|
|
24697
|
+
if (fetchStatus === "error" && selectedBusinessId === searchResult.id) return;
|
|
24555
24698
|
return handleSelectBusiness(searchResult);
|
|
24556
24699
|
};
|
|
24557
24700
|
const handleGoBack = () => {
|
|
@@ -24564,7 +24707,7 @@ function BusinessInformationCard({
|
|
|
24564
24707
|
title: result.name,
|
|
24565
24708
|
subTitle: result.registrationNumber,
|
|
24566
24709
|
stateful: true,
|
|
24567
|
-
fetching:
|
|
24710
|
+
fetching: fetchStatus === "loading" && selectedBusinessId === result.id,
|
|
24568
24711
|
active: selectedBusinessId === result.id,
|
|
24569
24712
|
headerButton: selectedBusinessId === result.id && showSelectButton ? jsx(Button, {
|
|
24570
24713
|
label: i18n.get("thisIsMyBusiness"),
|
|
@@ -24586,7 +24729,11 @@ function BusinessInformationCard({
|
|
|
24586
24729
|
showAsLink: true
|
|
24587
24730
|
}),
|
|
24588
24731
|
testId: "invalidTin"
|
|
24589
|
-
}),
|
|
24732
|
+
}), verifyStatus === "error" && jsx(Alert, {
|
|
24733
|
+
variant: "error",
|
|
24734
|
+
title: i18n.get("businessSelection__tinVerificationFailure"),
|
|
24735
|
+
testId: "tinVerificationFailure"
|
|
24736
|
+
}), fetchStatus === "error" && jsx(Alert, {
|
|
24590
24737
|
variant: "info",
|
|
24591
24738
|
type: "callToAction",
|
|
24592
24739
|
title: i18n.get("businessSelection__failedToLoad"),
|
|
@@ -24597,8 +24744,8 @@ function BusinessInformationCard({
|
|
|
24597
24744
|
showAsLink: true
|
|
24598
24745
|
}),
|
|
24599
24746
|
testId: "failedToLoad"
|
|
24600
|
-
}),
|
|
24601
|
-
fetching,
|
|
24747
|
+
}), fetchStatus !== "error" && jsx(BusinessInformation, {
|
|
24748
|
+
fetching: fetchStatus === "loading",
|
|
24602
24749
|
selectedBusiness: currentBusinessSelection
|
|
24603
24750
|
})]
|
|
24604
24751
|
})
|
|
@@ -24607,10 +24754,10 @@ function BusinessInformationCard({
|
|
|
24607
24754
|
const logger$n = createLogger("BusinessSelection");
|
|
24608
24755
|
function BusinessSelectionComponent({
|
|
24609
24756
|
showCompanyStructure,
|
|
24610
|
-
|
|
24611
|
-
|
|
24612
|
-
|
|
24613
|
-
|
|
24757
|
+
searching,
|
|
24758
|
+
fetching,
|
|
24759
|
+
verifying,
|
|
24760
|
+
resettingTrustedData,
|
|
24614
24761
|
searchResults,
|
|
24615
24762
|
invalidTin,
|
|
24616
24763
|
fetchBusinessData,
|
|
@@ -24638,19 +24785,19 @@ function BusinessSelectionComponent({
|
|
|
24638
24785
|
}, [setShowCompanyStructure, verifyBusinessData]);
|
|
24639
24786
|
const handleSelectBusiness = useCallback(async (result) => {
|
|
24640
24787
|
try {
|
|
24641
|
-
if (
|
|
24788
|
+
if (fetching === "loading") return;
|
|
24642
24789
|
if (!selectedBusinessId || selectedBusinessId !== result.id) {
|
|
24643
24790
|
setSelectedBusinessId(result.id);
|
|
24644
24791
|
const businessData = await fetchBusinessData(result);
|
|
24645
24792
|
setCurrentBusinessSelection(businessData);
|
|
24646
|
-
} else if (
|
|
24793
|
+
} else if (fetching === "error") {
|
|
24647
24794
|
const businessData = await fetchBusinessData(result);
|
|
24648
24795
|
setCurrentBusinessSelection(businessData);
|
|
24649
24796
|
}
|
|
24650
24797
|
} catch (e) {
|
|
24651
24798
|
logger$n.error(e);
|
|
24652
24799
|
}
|
|
24653
|
-
}, [fetchBusinessData,
|
|
24800
|
+
}, [fetchBusinessData, fetching, selectedBusinessId]);
|
|
24654
24801
|
const handleConfirmSelection = useCallback(async (data) => {
|
|
24655
24802
|
if (!currentTin) return;
|
|
24656
24803
|
try {
|
|
@@ -24662,7 +24809,7 @@ function BusinessSelectionComponent({
|
|
|
24662
24809
|
logger$n.error(e);
|
|
24663
24810
|
}
|
|
24664
24811
|
}, [currentTin, handleNextClick, handleBusinessVerification]);
|
|
24665
|
-
const showLoader =
|
|
24812
|
+
const showLoader = searching === "loading" || verifying === "loading" || resettingTrustedData === "loading" || fetching === "loading" && (searchResults == null ? void 0 : searchResults.length) === 1;
|
|
24666
24813
|
const businessSelectionClasses = cx("adyen-kyc-business-selection", {
|
|
24667
24814
|
"adyen-kyc-business-selection--loading": showLoader
|
|
24668
24815
|
});
|
|
@@ -24687,8 +24834,8 @@ function BusinessSelectionComponent({
|
|
|
24687
24834
|
result,
|
|
24688
24835
|
selectedBusinessId,
|
|
24689
24836
|
currentBusinessSelection,
|
|
24690
|
-
|
|
24691
|
-
|
|
24837
|
+
fetchStatus: fetching,
|
|
24838
|
+
verifyStatus: verifying,
|
|
24692
24839
|
invalidTin,
|
|
24693
24840
|
resetTinVerification,
|
|
24694
24841
|
handleSelectBusiness,
|
|
@@ -24802,7 +24949,7 @@ function BasicInformationComponent({
|
|
|
24802
24949
|
obscuredFields,
|
|
24803
24950
|
optionalFields,
|
|
24804
24951
|
readOnlyFields,
|
|
24805
|
-
trustedFields
|
|
24952
|
+
trustedFields,
|
|
24806
24953
|
country,
|
|
24807
24954
|
companyType = CompanyTypesValue.PRIVATE_COMPANY,
|
|
24808
24955
|
isTopLevelEntity,
|
|
@@ -24810,10 +24957,10 @@ function BasicInformationComponent({
|
|
|
24810
24957
|
showBusinessSelection,
|
|
24811
24958
|
showCompanyStructure,
|
|
24812
24959
|
isActiveForm,
|
|
24813
|
-
|
|
24814
|
-
|
|
24815
|
-
|
|
24816
|
-
|
|
24960
|
+
searching,
|
|
24961
|
+
fetching,
|
|
24962
|
+
verifying,
|
|
24963
|
+
resettingTrustedData,
|
|
24817
24964
|
searchResults,
|
|
24818
24965
|
invalidTin,
|
|
24819
24966
|
verifiedBusiness,
|
|
@@ -24856,9 +25003,9 @@ function BasicInformationComponent({
|
|
|
24856
25003
|
readOnlyFields,
|
|
24857
25004
|
optionalFields,
|
|
24858
25005
|
obscuredFields,
|
|
24859
|
-
trustedFields
|
|
25006
|
+
trustedFields,
|
|
24860
25007
|
shouldValidate
|
|
24861
|
-
}), [allFields, helperText, labels2, obscuredFields, optionalFields, placeholders, readOnly, readOnlyFields, requiredFields,
|
|
25008
|
+
}), [allFields, helperText, labels2, obscuredFields, optionalFields, placeholders, readOnly, readOnlyFields, requiredFields, trustedFields, shouldValidate]);
|
|
24862
25009
|
const registrationNumberOptions = useMemo(() => getCompanyRegistrationNumberOptions(country, companyType), [country, companyType]);
|
|
24863
25010
|
const defaultRegistrationNumberType = (data == null ? void 0 : data.registrationNumber) ? inferCompanyRegistrationNumberType(data == null ? void 0 : data.registrationNumber, country, companyType) : (_a = registrationNumberOptions == null ? void 0 : registrationNumberOptions[0]) == null ? void 0 : _a.id;
|
|
24864
25011
|
const [registrationNumberType, setRegistrationNumberType] = useState(defaultRegistrationNumberType);
|
|
@@ -24925,6 +25072,9 @@ function BasicInformationComponent({
|
|
|
24925
25072
|
fieldProblems: formFieldProblems
|
|
24926
25073
|
});
|
|
24927
25074
|
}, [formSchema, formData, formErrors, formFieldProblems, formValid, updateStateSlice]);
|
|
25075
|
+
useEffect(() => {
|
|
25076
|
+
if (!isActiveForm && !(searchResults == null ? void 0 : searchResults.length)) setShowBusinessSelection(false);
|
|
25077
|
+
}, [isActiveForm, searchResults == null ? void 0 : searchResults.length, setShowBusinessSelection]);
|
|
24928
25078
|
useEffect(() => {
|
|
24929
25079
|
if (showBusinessSelection && showCompanyStructure && isActiveForm) {
|
|
24930
25080
|
handleNextClick();
|
|
@@ -24935,10 +25085,10 @@ function BasicInformationComponent({
|
|
|
24935
25085
|
if (showBusinessSelection) {
|
|
24936
25086
|
return jsx(BusinessSelectionComponent, {
|
|
24937
25087
|
showCompanyStructure,
|
|
24938
|
-
|
|
24939
|
-
|
|
24940
|
-
|
|
24941
|
-
|
|
25088
|
+
searching,
|
|
25089
|
+
fetching,
|
|
25090
|
+
verifying,
|
|
25091
|
+
resettingTrustedData,
|
|
24942
25092
|
searchResults,
|
|
24943
25093
|
invalidTin,
|
|
24944
25094
|
fetchBusinessData,
|
|
@@ -25390,12 +25540,6 @@ const getForms = (country) => ({
|
|
|
25390
25540
|
formHeading: "additionalInformationFormHeading",
|
|
25391
25541
|
fields: COUNTRIES_USING_COMPANY_SEARCH.includes(country) ? ADDITIONAL_INFORMATION_FIELDS.filter((field) => !FIELDS_NEEDED_FOR_COMPANY_SEARCH.includes(field)) : ADDITIONAL_INFORMATION_FIELDS
|
|
25392
25542
|
},
|
|
25393
|
-
companyRegistrationAddress: {
|
|
25394
|
-
formId: "companyRegistrationAddress",
|
|
25395
|
-
formName: "companyRegistrationAddressFormName",
|
|
25396
|
-
formDescription: "companyRegistrationAddressFormDescription",
|
|
25397
|
-
fields: ["registrationAddress", "operationalAddress", "operationalAddressIsSame"]
|
|
25398
|
-
},
|
|
25399
25543
|
companyRegistrationDocument: {
|
|
25400
25544
|
formId: "companyRegistrationDocument",
|
|
25401
25545
|
formName: "companyRegistrationDocumentFormName",
|
|
@@ -25437,7 +25581,7 @@ const mapBasicInformation = (data) => {
|
|
|
25437
25581
|
}, {});
|
|
25438
25582
|
};
|
|
25439
25583
|
const mapAdditionalInformation = (data, legalEntity) => {
|
|
25440
|
-
var _a, _b, _c, _d;
|
|
25584
|
+
var _a, _b, _c, _d, _e;
|
|
25441
25585
|
if (!data) return;
|
|
25442
25586
|
const dbaName = ((_a = legalEntity.organization) == null ? void 0 : _a.doingBusinessAs) ? ((_b = legalEntity.organization) == null ? void 0 : _b.doingBusinessAs) !== ((_c = legalEntity.organization) == null ? void 0 : _c.legalName) ? {
|
|
25443
25587
|
hasDba: true
|
|
@@ -25445,6 +25589,7 @@ const mapAdditionalInformation = (data, legalEntity) => {
|
|
|
25445
25589
|
hasDba: false
|
|
25446
25590
|
} : {};
|
|
25447
25591
|
const currentCountry = (_d = legalEntity.organization) == null ? void 0 : _d.registeredAddress.country;
|
|
25592
|
+
const operationalAddressIsSame = ((_e = legalEntity.organization) == null ? void 0 : _e.principalPlaceOfBusiness) ? operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME : operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_SAME;
|
|
25448
25593
|
return entriesOf(data).reduce((acc, [field]) => {
|
|
25449
25594
|
if (!COUNTRIES_USING_COMPANY_SEARCH.includes(currentCountry)) {
|
|
25450
25595
|
return {
|
|
@@ -25460,7 +25605,8 @@ const mapAdditionalInformation = (data, legalEntity) => {
|
|
|
25460
25605
|
}
|
|
25461
25606
|
return acc;
|
|
25462
25607
|
}, {
|
|
25463
|
-
...dbaName
|
|
25608
|
+
...dbaName,
|
|
25609
|
+
operationalAddressIsSame
|
|
25464
25610
|
});
|
|
25465
25611
|
};
|
|
25466
25612
|
const mapLegalEntityToBusinessDetailsSchema = (legalEntity, isChangingType, accountHolder) => {
|
|
@@ -25474,7 +25620,6 @@ const mapLegalEntityToBusinessDetailsSchema = (legalEntity, isChangingType, acco
|
|
|
25474
25620
|
companyTaxDocument
|
|
25475
25621
|
};
|
|
25476
25622
|
return entriesOf(businessDetailsSchema).reduce((componentData, [key]) => {
|
|
25477
|
-
var _a;
|
|
25478
25623
|
switch (key) {
|
|
25479
25624
|
case "basicInformation": {
|
|
25480
25625
|
return {
|
|
@@ -25497,15 +25642,6 @@ const mapLegalEntityToBusinessDetailsSchema = (legalEntity, isChangingType, acco
|
|
|
25497
25642
|
[key]: mapAdditionalInformation(businessDetailsSchema[key], legalEntity)
|
|
25498
25643
|
};
|
|
25499
25644
|
}
|
|
25500
|
-
case "companyRegistrationAddress": {
|
|
25501
|
-
return {
|
|
25502
|
-
...componentData,
|
|
25503
|
-
[key]: {
|
|
25504
|
-
...businessDetailsSchema[key],
|
|
25505
|
-
operationalAddressIsSame: ((_a = legalEntity.organization) == null ? void 0 : _a.principalPlaceOfBusiness) ? operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME : operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_SAME
|
|
25506
|
-
}
|
|
25507
|
-
};
|
|
25508
|
-
}
|
|
25509
25645
|
case "companyRegistrationDocument": {
|
|
25510
25646
|
return {
|
|
25511
25647
|
...componentData,
|
|
@@ -25534,16 +25670,15 @@ function BusinessDetailsComponent(props) {
|
|
|
25534
25670
|
country,
|
|
25535
25671
|
isTopLevelEntity,
|
|
25536
25672
|
activeForm,
|
|
25537
|
-
problems,
|
|
25538
25673
|
baseTrackingPayload,
|
|
25539
25674
|
showCompanyStructure,
|
|
25540
25675
|
showBusinessSelection,
|
|
25541
25676
|
setShowBusinessSelection,
|
|
25542
25677
|
setShowCompanyStructure,
|
|
25543
|
-
|
|
25544
|
-
|
|
25545
|
-
|
|
25546
|
-
|
|
25678
|
+
searching,
|
|
25679
|
+
fetching,
|
|
25680
|
+
verifying,
|
|
25681
|
+
resettingTrustedData,
|
|
25547
25682
|
searchResults,
|
|
25548
25683
|
invalidTin,
|
|
25549
25684
|
verifiedBusiness,
|
|
@@ -25584,10 +25719,10 @@ function BusinessDetailsComponent(props) {
|
|
|
25584
25719
|
showBusinessSelection,
|
|
25585
25720
|
showCompanyStructure,
|
|
25586
25721
|
isActiveForm: (activeForm == null ? void 0 : activeForm.formId) === forms2.basicInformation.formId,
|
|
25587
|
-
|
|
25588
|
-
|
|
25589
|
-
|
|
25590
|
-
|
|
25722
|
+
searching,
|
|
25723
|
+
fetching,
|
|
25724
|
+
verifying,
|
|
25725
|
+
resettingTrustedData,
|
|
25591
25726
|
fetchBusinessData,
|
|
25592
25727
|
verifyBusinessData,
|
|
25593
25728
|
proceedToManualDataEntry,
|
|
@@ -25619,22 +25754,9 @@ function BusinessDetailsComponent(props) {
|
|
|
25619
25754
|
country,
|
|
25620
25755
|
companyType: companyStructure == null ? void 0 : companyStructure.entityType,
|
|
25621
25756
|
verifiedBusiness,
|
|
25622
|
-
showCompanyStructure
|
|
25623
|
-
})
|
|
25624
|
-
}), jsx("div", {
|
|
25625
|
-
className: formWrapperClasses(forms2.companyRegistrationAddress.formId),
|
|
25626
|
-
children: jsx(RegistrationAddressComponent, {
|
|
25627
|
-
...getNestedOuterFormPropsFromOuterFormProps(props, forms2.companyRegistrationAddress.formId),
|
|
25628
|
-
id: forms2.companyRegistrationAddress.formId,
|
|
25629
|
-
heading: i18n.get(forms2.companyRegistrationAddress.formName),
|
|
25630
|
-
description: i18n.get(forms2.companyRegistrationAddress.formDescription, {
|
|
25631
|
-
localizeFor: country
|
|
25632
|
-
}),
|
|
25633
|
-
country,
|
|
25634
|
-
problems,
|
|
25757
|
+
showCompanyStructure,
|
|
25635
25758
|
handleAddressSearch,
|
|
25636
|
-
handleFindAddress
|
|
25637
|
-
verifiedBusiness
|
|
25759
|
+
handleFindAddress
|
|
25638
25760
|
})
|
|
25639
25761
|
}), jsx("div", {
|
|
25640
25762
|
className: formWrapperClasses(forms2.companyRegistrationDocument.formId),
|
|
@@ -25888,32 +26010,37 @@ const Modal = ({
|
|
|
25888
26010
|
onClose,
|
|
25889
26011
|
children: jsxs("div", {
|
|
25890
26012
|
className: "adyen-kyc-modal__wrapper",
|
|
25891
|
-
children: [
|
|
25892
|
-
className: "adyen-kyc-
|
|
25893
|
-
children:
|
|
25894
|
-
|
|
25895
|
-
|
|
25896
|
-
|
|
26013
|
+
children: [jsxs("div", {
|
|
26014
|
+
className: "adyen-kyc-modal__main",
|
|
26015
|
+
children: [jsxs("section", {
|
|
26016
|
+
className: "adyen-kyc-modal-top-bar",
|
|
26017
|
+
children: [onBack ? jsx(Button, {
|
|
26018
|
+
tertiary: true,
|
|
26019
|
+
"aria-label": "back",
|
|
26020
|
+
icon: "arrow-left",
|
|
26021
|
+
className: "adyen-kyc-modal-button-blur",
|
|
26022
|
+
onClick: onBack,
|
|
26023
|
+
shaded: true
|
|
26024
|
+
}) : jsx("div", {}), onClose ? jsx(Button, {
|
|
26025
|
+
tertiary: true,
|
|
26026
|
+
"aria-label": "close",
|
|
26027
|
+
icon: "cross",
|
|
26028
|
+
className: "adyen-kyc-modal-button-blur",
|
|
26029
|
+
onClick: onClose,
|
|
26030
|
+
shaded: true
|
|
26031
|
+
}) : jsx("div", {})]
|
|
26032
|
+
}), header && jsx("header", {
|
|
26033
|
+
className: "adyen-kyc-modal__header",
|
|
26034
|
+
children: header
|
|
26035
|
+
}), jsx("section", {
|
|
26036
|
+
className: "adyen-kyc-modal__content",
|
|
26037
|
+
children
|
|
26038
|
+
})]
|
|
25897
26039
|
}), jsx("div", {
|
|
25898
26040
|
children: footer && jsx("footer", {
|
|
25899
26041
|
className: "adyen-kyc-modal__footer",
|
|
25900
26042
|
children: footer
|
|
25901
26043
|
})
|
|
25902
|
-
}), jsxs("section", {
|
|
25903
|
-
className: "adyen-kyc-modal-top-bar",
|
|
25904
|
-
children: [onBack ? jsx(Button, {
|
|
25905
|
-
tertiary: true,
|
|
25906
|
-
"aria-label": "back",
|
|
25907
|
-
icon: "arrow-left",
|
|
25908
|
-
onClick: onBack,
|
|
25909
|
-
shaded: true
|
|
25910
|
-
}) : jsx("div", {}), jsx(Button, {
|
|
25911
|
-
tertiary: true,
|
|
25912
|
-
"aria-label": "close",
|
|
25913
|
-
icon: "cross",
|
|
25914
|
-
onClick: onClose,
|
|
25915
|
-
shaded: true
|
|
25916
|
-
})]
|
|
25917
26044
|
})]
|
|
25918
26045
|
})
|
|
25919
26046
|
});
|
|
@@ -26150,30 +26277,48 @@ const StepProgressIndicator = ({
|
|
|
26150
26277
|
activeStepIndex,
|
|
26151
26278
|
stepsCount,
|
|
26152
26279
|
fillBefore,
|
|
26153
|
-
thick
|
|
26154
|
-
|
|
26155
|
-
|
|
26156
|
-
|
|
26157
|
-
|
|
26158
|
-
|
|
26159
|
-
|
|
26160
|
-
|
|
26161
|
-
|
|
26162
|
-
|
|
26163
|
-
|
|
26164
|
-
|
|
26165
|
-
|
|
26166
|
-
|
|
26167
|
-
|
|
26168
|
-
|
|
26169
|
-
|
|
26170
|
-
|
|
26171
|
-
|
|
26172
|
-
|
|
26173
|
-
|
|
26280
|
+
thick,
|
|
26281
|
+
circles
|
|
26282
|
+
}) => {
|
|
26283
|
+
const {
|
|
26284
|
+
i18n
|
|
26285
|
+
} = useI18nContext();
|
|
26286
|
+
if (stepsCount === 0 || stepsCount > 10) {
|
|
26287
|
+
return jsx(Typography, {
|
|
26288
|
+
variant: "caption",
|
|
26289
|
+
children: i18n.get("XOfYSteps", {
|
|
26290
|
+
values: {
|
|
26291
|
+
currentStep: activeStepIndex,
|
|
26292
|
+
totalSteps: stepsCount
|
|
26293
|
+
}
|
|
26294
|
+
})
|
|
26295
|
+
});
|
|
26296
|
+
}
|
|
26297
|
+
return jsx("div", {
|
|
26298
|
+
"aria-label": `Step ${activeStepIndex} of ${stepsCount}`,
|
|
26299
|
+
className: "adyen-kyc-progress",
|
|
26300
|
+
role: "group",
|
|
26301
|
+
children: jsx("ol", {
|
|
26302
|
+
className: cx("adyen-kyc-progress__bar", {
|
|
26303
|
+
"adyen-kyc-progress__bar--thick": thick,
|
|
26304
|
+
"adyen-kyc-progress__bar--circles": circles
|
|
26305
|
+
}),
|
|
26306
|
+
children: range(stepsCount).map((stepNumber) => {
|
|
26307
|
+
const isHighlighted = shouldHighlight(activeStepIndex, stepNumber, fillBefore);
|
|
26308
|
+
return jsx("li", {
|
|
26309
|
+
"aria-current": isHighlighted ? "step" : void 0,
|
|
26310
|
+
className: cx("adyen-kyc-progress__step", {
|
|
26311
|
+
"adyen-kyc-progress__step--active": isHighlighted
|
|
26312
|
+
}),
|
|
26313
|
+
children: jsx("span", {
|
|
26314
|
+
className: "adyen-kyc-progress__step-label",
|
|
26315
|
+
children: `Step ${stepNumber}: ${stepNumber < activeStepIndex ? "completed" : "not completed"}`
|
|
26316
|
+
})
|
|
26317
|
+
}, stepNumber);
|
|
26318
|
+
})
|
|
26174
26319
|
})
|
|
26175
|
-
})
|
|
26176
|
-
}
|
|
26320
|
+
});
|
|
26321
|
+
};
|
|
26177
26322
|
const DropinLayout = ({
|
|
26178
26323
|
content,
|
|
26179
26324
|
footer,
|
|
@@ -26215,7 +26360,6 @@ const DropinLayout = ({
|
|
|
26215
26360
|
children: jsx("div", {
|
|
26216
26361
|
className: "adyen-kyc-dropin__content",
|
|
26217
26362
|
children: jsx("div", {
|
|
26218
|
-
className: "adyen-kyc-dropin__content-main",
|
|
26219
26363
|
children: content
|
|
26220
26364
|
})
|
|
26221
26365
|
})
|
|
@@ -26601,21 +26745,7 @@ const canSubmit$3 = (data) => MANDATORY_API_FIELDS.every((detail) => {
|
|
|
26601
26745
|
return !isEmpty(value);
|
|
26602
26746
|
});
|
|
26603
26747
|
const isDocumentsRequired$3 = (forms2) => forms2.some((form) => documentFormsIds.includes(form.formId));
|
|
26604
|
-
const removeConditionalForms = (forms2,
|
|
26605
|
-
var _a;
|
|
26606
|
-
const filteredForCompanyStructure = isSkippingCompanyStructure ? forms2.filter((f) => f.formId !== "companyStructure" && f.formId !== "companyType") : forms2;
|
|
26607
|
-
switch (problems == null ? void 0 : problems.status) {
|
|
26608
|
-
case 6:
|
|
26609
|
-
return isSkippingCompanyRegistrationDocument && !Object.keys((problems == null ? void 0 : problems.remediationActions) ?? {}).includes("1_501") ? filteredForCompanyStructure.filter((f) => f.formId !== "companyRegistrationDocument") : filteredForCompanyStructure;
|
|
26610
|
-
case 3:
|
|
26611
|
-
return isSkippingCompanyRegistrationDocument && !((_a = problems == null ? void 0 : problems.missingData) == null ? void 0 : _a.some((missingData) => {
|
|
26612
|
-
var _a2;
|
|
26613
|
-
return (_a2 = missingData.remediatingActions) == null ? void 0 : _a2.some((remediation) => remediation.code === "1_501");
|
|
26614
|
-
})) ? filteredForCompanyStructure.filter((f) => f.formId !== "companyRegistrationDocument") : filteredForCompanyStructure;
|
|
26615
|
-
default:
|
|
26616
|
-
return isSkippingCompanyRegistrationDocument ? filteredForCompanyStructure.filter((f) => f.formId !== "companyRegistrationDocument") : filteredForCompanyStructure;
|
|
26617
|
-
}
|
|
26618
|
-
};
|
|
26748
|
+
const removeConditionalForms = (forms2, isSkippingCompanyStructure) => isSkippingCompanyStructure ? forms2.filter((f) => f.formId !== "companyStructure" && f.formId !== "companyType") : forms2;
|
|
26619
26749
|
const formatBasicInformation = (data, labels2, datasetUtils, companyType) => {
|
|
26620
26750
|
var _a, _b, _c;
|
|
26621
26751
|
const country = data == null ? void 0 : data.country;
|
|
@@ -26682,15 +26812,11 @@ const formatDataForSummary$1 = (data, forms2, labels2, i18n) => {
|
|
|
26682
26812
|
}
|
|
26683
26813
|
};
|
|
26684
26814
|
case "additionalInformation":
|
|
26685
|
-
return {
|
|
26686
|
-
...summaryData,
|
|
26687
|
-
[form]: formatAdditionalInformation(data[form], labels2, (_e = data.basicInformation) == null ? void 0 : _e.country, (_f = data.companyStructure) == null ? void 0 : _f.entityType)
|
|
26688
|
-
};
|
|
26689
|
-
case "companyRegistrationAddress":
|
|
26690
26815
|
return {
|
|
26691
26816
|
...summaryData,
|
|
26692
26817
|
[form]: {
|
|
26693
26818
|
hasInnerForms: true,
|
|
26819
|
+
additionalInformationFormName: formatAdditionalInformation(data[form], labels2, (_e = data.basicInformation) == null ? void 0 : _e.country, (_f = data.companyStructure) == null ? void 0 : _f.entityType),
|
|
26694
26820
|
registrationAddress: mapAddressLabels(data[form].registrationAddress, datasetUtils),
|
|
26695
26821
|
operationalAddress: data[form].operationalAddress ? mapAddressLabels(data[form].operationalAddress, datasetUtils) : void 0
|
|
26696
26822
|
}
|
|
@@ -26770,22 +26896,23 @@ async function submit({
|
|
|
26770
26896
|
showToast,
|
|
26771
26897
|
clearToasts,
|
|
26772
26898
|
handleUpdateLegalEntity,
|
|
26773
|
-
onExternalSubmit
|
|
26899
|
+
onExternalSubmit,
|
|
26900
|
+
accountHolder
|
|
26774
26901
|
}) {
|
|
26775
|
-
var _a, _b, _c, _d;
|
|
26902
|
+
var _a, _b, _c, _d, _e;
|
|
26776
26903
|
const logger2 = createLogger("submitBusinessDetails");
|
|
26777
26904
|
setLoadingStatus("loading");
|
|
26778
26905
|
const trackingPayload = {
|
|
26779
26906
|
companyStructure: ((_a = data.companyStructure) == null ? void 0 : _a.entityType) ?? null,
|
|
26780
26907
|
countryOfRegistration: ((_b = data.basicInformation) == null ? void 0 : _b.country) ?? null,
|
|
26781
26908
|
legalEntityName: ((_c = data.additionalInformation) == null ? void 0 : _c.legalCompanyName) ?? null,
|
|
26782
|
-
usedAdditionalAddress: ((_d = data.
|
|
26909
|
+
usedAdditionalAddress: ((_d = data.additionalInformation) == null ? void 0 : _d.operationalAddressIsSame) === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME
|
|
26783
26910
|
};
|
|
26784
26911
|
const savedLegalEntityData = mapLegalEntityToBusinessDetailsSchema(legalEntityResponse, isTargetLegalEntityType);
|
|
26785
26912
|
const filteredData = removeOldDataBySchema(data, savedLegalEntityData);
|
|
26786
26913
|
const legalEntity = {
|
|
26787
26914
|
...mapBusinessDetailsSchemaToLegalEntity(filteredData),
|
|
26788
|
-
entityAssociations: filterOutUnwantedAssociationsIfRootLE(TaskTypes.BUSINESS_DETAILS, legalEntityResponse,
|
|
26915
|
+
entityAssociations: filterOutUnwantedAssociationsIfRootLE(TaskTypes.BUSINESS_DETAILS, legalEntityResponse, ((_e = data.companyStructure) == null ? void 0 : _e.accountHolder) || accountHolder)
|
|
26789
26916
|
};
|
|
26790
26917
|
try {
|
|
26791
26918
|
userEvents.addEvent(BusinessDetailsEvents.TASK_SUBMIT, {
|
|
@@ -26857,7 +26984,6 @@ function BusinessDetailsDropinComponent({
|
|
|
26857
26984
|
parentLegalEntity,
|
|
26858
26985
|
trackingConfig,
|
|
26859
26986
|
capabilities,
|
|
26860
|
-
accountHolder,
|
|
26861
26987
|
taskName,
|
|
26862
26988
|
hideDropinLayout,
|
|
26863
26989
|
homeButtonLabel,
|
|
@@ -26879,7 +27005,7 @@ function BusinessDetailsDropinComponent({
|
|
|
26879
27005
|
handleClearCompanyData,
|
|
26880
27006
|
onTypeSwitch
|
|
26881
27007
|
}) {
|
|
26882
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m
|
|
27008
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
26883
27009
|
const {
|
|
26884
27010
|
state: {
|
|
26885
27011
|
currentState
|
|
@@ -26900,6 +27026,10 @@ function BusinessDetailsDropinComponent({
|
|
|
26900
27026
|
});
|
|
26901
27027
|
}, []);
|
|
26902
27028
|
const formRef = useRef(null);
|
|
27029
|
+
const {
|
|
27030
|
+
accountHolder,
|
|
27031
|
+
setAccountHolder
|
|
27032
|
+
} = useCoreContext();
|
|
26903
27033
|
const {
|
|
26904
27034
|
showToast,
|
|
26905
27035
|
clearToasts
|
|
@@ -26918,8 +27048,8 @@ function BusinessDetailsDropinComponent({
|
|
|
26918
27048
|
var _a2;
|
|
26919
27049
|
return ((_a2 = currentState.data.basicInformation) == null ? void 0 : _a2.country) ?? country;
|
|
26920
27050
|
}, [(_a = currentState.data.basicInformation) == null ? void 0 : _a.country, country]);
|
|
26921
|
-
const [initialData, setInitialData] = useState(mapLegalEntityToBusinessDetailsSchema(legalEntityResponse, Boolean(isTargetLegalEntityType), isNewEntryFlowEnabled ? accountHolder : void 0));
|
|
26922
|
-
const [
|
|
27051
|
+
const [initialData, setInitialData] = useState(mapLegalEntityToBusinessDetailsSchema(legalEntityResponse, Boolean(isTargetLegalEntityType), isNewEntryFlowEnabled && accountHolder ? accountHolder : void 0));
|
|
27052
|
+
const [trustedFields, setTrustedFields] = useState(legalEntityResponse.trustedFields);
|
|
26923
27053
|
const documentUtils = documentApiUtils(handleCreateDocument, handleGetDocument, handleUpdateDocument);
|
|
26924
27054
|
useEffect(() => {
|
|
26925
27055
|
var _a2;
|
|
@@ -26964,35 +27094,38 @@ function BusinessDetailsDropinComponent({
|
|
|
26964
27094
|
isExperimentEnabled
|
|
26965
27095
|
}), [currentCountry, currentState.data, isExperimentEnabled, taskType]);
|
|
26966
27096
|
const initialForms = useMemo(() => getForms(currentCountry), [currentCountry]);
|
|
26967
|
-
const derivedProps = useMemo(() => getPropsFromConfigurations(fieldConfigurations, initialForms, (currentProblems == null ? void 0 : currentProblems.remediationActions) ? Object.values(currentProblems == null ? void 0 : currentProblems.remediationActions) : [], (currentProblems == null ? void 0 : currentProblems.missingData) ?? [], legalEntityResponse ? getFieldsWithExistingData(legalEntityResponse, isExperimentEnabled) : [], customRules, {}, {},
|
|
27097
|
+
const derivedProps = useMemo(() => getPropsFromConfigurations(fieldConfigurations, initialForms, (currentProblems == null ? void 0 : currentProblems.remediationActions) ? Object.values(currentProblems == null ? void 0 : currentProblems.remediationActions) : [], (currentProblems == null ? void 0 : currentProblems.missingData) ?? [], legalEntityResponse ? getFieldsWithExistingData(legalEntityResponse, isExperimentEnabled) : [], customRules, {}, {}, trustedFields), [fieldConfigurations, initialForms, currentProblems == null ? void 0 : currentProblems.remediationActions, currentProblems == null ? void 0 : currentProblems.missingData, legalEntityResponse, isExperimentEnabled, customRules, trustedFields]);
|
|
26968
27098
|
const isSkippingCompanyStructure = useEnableNewEntryFlow() && organizationTypesToSkipCompanyStructureForm.includes((_d = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _d.type) && accountHolder !== "aTrust";
|
|
26969
|
-
const isSkippingCompanyRegistrationDocument = currentCountry === "CA" && ((_e = currentState.data.additionalInformation) == null ? void 0 : _e.registrationNumber) && ((_f = currentState.valid.additionalInformation) == null ? void 0 : _f.registrationNumber) && !((_g = currentState.data.companyRegistrationDocument) == null ? void 0 : _g.registrationDocument);
|
|
26970
27099
|
const forms2 = useMemo(() => {
|
|
26971
27100
|
const requiredForms = getRequiredForms(initialForms, derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields);
|
|
26972
27101
|
const validityAddedForms = addValidityToForms(requiredForms, currentState.validityByForm, currentProblems);
|
|
26973
|
-
return removeConditionalForms(validityAddedForms,
|
|
26974
|
-
}, [initialForms, derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields, currentState.validityByForm, currentProblems, currentCountry, isSkippingCompanyStructure, showCompanyStructure
|
|
27102
|
+
return removeConditionalForms(validityAddedForms, currentCountry !== "US" ? isSkippingCompanyStructure : !showCompanyStructure);
|
|
27103
|
+
}, [initialForms, derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields, currentState.validityByForm, currentProblems, currentCountry, isSkippingCompanyStructure, showCompanyStructure]);
|
|
26975
27104
|
const canSubmitForm = useMemo(() => canSubmit$3(currentState.data) && hasDataChanged(initialData, currentState.data), [initialData, currentState.data]);
|
|
26976
27105
|
const summaryData = useMemo(() => ({
|
|
26977
27106
|
data: formatDataForSummary$1(currentState.data, forms2, derivedProps == null ? void 0 : derivedProps.labels, i18n),
|
|
26978
27107
|
omittedKeys: ["operationalAddressIsSame"]
|
|
26979
27108
|
}), [currentState.data, derivedProps == null ? void 0 : derivedProps.labels, forms2, i18n]);
|
|
26980
|
-
const submitTask = useCallback(() =>
|
|
26981
|
-
|
|
26982
|
-
|
|
26983
|
-
|
|
26984
|
-
|
|
26985
|
-
|
|
26986
|
-
|
|
26987
|
-
|
|
26988
|
-
|
|
26989
|
-
|
|
26990
|
-
|
|
26991
|
-
|
|
26992
|
-
|
|
26993
|
-
|
|
26994
|
-
|
|
26995
|
-
|
|
27109
|
+
const submitTask = useCallback(() => {
|
|
27110
|
+
var _a2;
|
|
27111
|
+
setAccountHolder(((_a2 = currentState.data.companyStructure) == null ? void 0 : _a2.accountHolder) || accountHolder);
|
|
27112
|
+
return submit({
|
|
27113
|
+
data: currentState.data,
|
|
27114
|
+
legalEntityResponse,
|
|
27115
|
+
isTargetLegalEntityType: Boolean(isTargetLegalEntityType),
|
|
27116
|
+
baseTrackingPayload,
|
|
27117
|
+
problems: currentProblems,
|
|
27118
|
+
forms: forms2,
|
|
27119
|
+
documentUtils,
|
|
27120
|
+
i18n,
|
|
27121
|
+
setLoadingStatus,
|
|
27122
|
+
setProblems: setCurrentProblems,
|
|
27123
|
+
showToast,
|
|
27124
|
+
clearToasts,
|
|
27125
|
+
handleUpdateLegalEntity,
|
|
27126
|
+
onExternalSubmit
|
|
27127
|
+
});
|
|
27128
|
+
}, [baseTrackingPayload, clearToasts, currentState.data, documentUtils, forms2, handleUpdateLegalEntity, i18n, isTargetLegalEntityType, legalEntityResponse, onExternalSubmit, currentProblems, showToast]);
|
|
26996
27129
|
const {
|
|
26997
27130
|
handleNextClick,
|
|
26998
27131
|
handleBackClick,
|
|
@@ -27017,10 +27150,10 @@ function BusinessDetailsDropinComponent({
|
|
|
27017
27150
|
clearTrustedBusinessData,
|
|
27018
27151
|
resetBusinessData,
|
|
27019
27152
|
resetTinVerification,
|
|
27020
|
-
|
|
27021
|
-
|
|
27022
|
-
|
|
27023
|
-
|
|
27153
|
+
searching,
|
|
27154
|
+
fetching,
|
|
27155
|
+
verifying,
|
|
27156
|
+
resettingTrustedData,
|
|
27024
27157
|
currentSearchName,
|
|
27025
27158
|
searchResults,
|
|
27026
27159
|
invalidTin,
|
|
@@ -27049,34 +27182,34 @@ function BusinessDetailsDropinComponent({
|
|
|
27049
27182
|
return tinMatch ? handleNextClick() : void 0;
|
|
27050
27183
|
}
|
|
27051
27184
|
}
|
|
27052
|
-
}, [currentCountry, (
|
|
27185
|
+
}, [currentCountry, (_e = currentState.data.basicInformation) == null ? void 0 : _e.taxInformation, fetchBusinessData, handleNextClick, searchForBusiness, handleVerifyBusinessData]);
|
|
27053
27186
|
useEffect(() => {
|
|
27054
|
-
if (searchResults && !searchResults.length ||
|
|
27187
|
+
if (searchResults && !searchResults.length || searching === "error") {
|
|
27055
27188
|
setShowCompanyStructure(true);
|
|
27056
27189
|
}
|
|
27057
|
-
}, [searchResults,
|
|
27190
|
+
}, [searchResults, searching]);
|
|
27058
27191
|
useEffect(() => {
|
|
27059
27192
|
var _a2;
|
|
27060
27193
|
if (((_a2 = currentState.data.basicInformation) == null ? void 0 : _a2.businessName) !== currentSearchName) {
|
|
27061
27194
|
setShowCompanyStructure(false);
|
|
27062
27195
|
resetBusinessData();
|
|
27063
27196
|
}
|
|
27064
|
-
}, [currentSearchName, (
|
|
27197
|
+
}, [currentSearchName, (_f = currentState.data.basicInformation) == null ? void 0 : _f.businessName]);
|
|
27065
27198
|
const [showBusinessSelection, setShowBusinessSelection] = useState(false);
|
|
27066
27199
|
const isBusinessSelection = useMemo(() => showBusinessSelection && activeForm.formId === "basicInformation", [activeForm.formId, showBusinessSelection]);
|
|
27067
27200
|
const hideBack = useMemo(() => {
|
|
27068
27201
|
if (!COUNTRIES_USING_COMPANY_SEARCH.includes(currentCountry)) return hideBackButton;
|
|
27069
27202
|
if (isBusinessSelection) {
|
|
27070
|
-
return
|
|
27203
|
+
return searching === "loading" || fetching === "loading" || verifying === "loading" || resettingTrustedData === "loading" ? hideBackButton : false;
|
|
27071
27204
|
}
|
|
27072
27205
|
return hideBackButton;
|
|
27073
|
-
}, [currentCountry, hideBackButton, isBusinessSelection,
|
|
27206
|
+
}, [currentCountry, hideBackButton, isBusinessSelection, searching, fetching, verifying, resettingTrustedData]);
|
|
27074
27207
|
const hideHome = useMemo(() => {
|
|
27075
27208
|
if (!COUNTRIES_USING_COMPANY_SEARCH.includes(currentCountry)) return hideHomeButton;
|
|
27076
27209
|
if (isBusinessSelection) {
|
|
27077
|
-
return
|
|
27210
|
+
return searching === "loading" || fetching === "loading" || verifying === "loading" || resettingTrustedData === "loading" ? true : hideHomeButton;
|
|
27078
27211
|
}
|
|
27079
|
-
}, [currentCountry, hideHomeButton, isBusinessSelection,
|
|
27212
|
+
}, [currentCountry, hideHomeButton, isBusinessSelection, searching, fetching, verifying, resettingTrustedData]);
|
|
27080
27213
|
const goToForm = useCallback((index) => {
|
|
27081
27214
|
var _a2, _b2, _c2, _d2, _e2, _f2;
|
|
27082
27215
|
const form = forms2[index].formId;
|
|
@@ -27092,7 +27225,7 @@ function BusinessDetailsDropinComponent({
|
|
|
27092
27225
|
return gotoFormByFormIndex(index);
|
|
27093
27226
|
}
|
|
27094
27227
|
case "additionalInformation": {
|
|
27095
|
-
if (verifiedBusiness) return gotoFormByFormIndex(index);
|
|
27228
|
+
if (verifiedBusiness || activeForm.formId !== "basicInformation") return gotoFormByFormIndex(index);
|
|
27096
27229
|
if (!isBusinessSelection) {
|
|
27097
27230
|
if (!!((_a2 = currentState.data.basicInformation) == null ? void 0 : _a2.businessName) && !!((_b2 = currentState.data.basicInformation) == null ? void 0 : _b2.country) && !!((_c2 = currentState.data.basicInformation) == null ? void 0 : _c2.stateOrProvince)) {
|
|
27098
27231
|
findBusiness({
|
|
@@ -27108,7 +27241,7 @@ function BusinessDetailsDropinComponent({
|
|
|
27108
27241
|
default:
|
|
27109
27242
|
return gotoFormByFormIndex(index);
|
|
27110
27243
|
}
|
|
27111
|
-
}, [canSubmitForm, currentCountry, (
|
|
27244
|
+
}, [canSubmitForm, currentCountry, (_g = currentState.data.basicInformation) == null ? void 0 : _g.businessName, (_h = currentState.data.basicInformation) == null ? void 0 : _h.country, (_i = currentState.data.basicInformation) == null ? void 0 : _i.stateOrProvince, findBusiness, forms2, gotoFormByFormIndex, isBusinessSelection, searchResults, verifiedBusiness, activeForm.formId]);
|
|
27112
27245
|
const nextClick = useCallback(() => {
|
|
27113
27246
|
var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
|
|
27114
27247
|
if (!COUNTRIES_USING_COMPANY_SEARCH.includes(currentCountry)) return handleNextClick();
|
|
@@ -27131,7 +27264,7 @@ function BusinessDetailsDropinComponent({
|
|
|
27131
27264
|
default:
|
|
27132
27265
|
return handleNextClick();
|
|
27133
27266
|
}
|
|
27134
|
-
}, [currentCountry, handleNextClick, activeForm.formId, verifiedBusiness, (
|
|
27267
|
+
}, [currentCountry, handleNextClick, activeForm.formId, verifiedBusiness, (_j = currentState.validityByForm) == null ? void 0 : _j.basicInformation, (_k = currentState.data.basicInformation) == null ? void 0 : _k.businessName, (_l = currentState.data.basicInformation) == null ? void 0 : _l.country, (_m = currentState.data.basicInformation) == null ? void 0 : _m.stateOrProvince, isBusinessSelection, findBusiness]);
|
|
27135
27268
|
const backClick = useCallback(() => {
|
|
27136
27269
|
if (!COUNTRIES_USING_COMPANY_SEARCH.includes(country)) return handleNextClick();
|
|
27137
27270
|
switch (activeForm.formId) {
|
|
@@ -27139,12 +27272,12 @@ function BusinessDetailsDropinComponent({
|
|
|
27139
27272
|
return showBusinessSelection ? setShowBusinessSelection(false) : void 0;
|
|
27140
27273
|
}
|
|
27141
27274
|
case "companyStructure": {
|
|
27142
|
-
if (
|
|
27275
|
+
if (searching === "error") {
|
|
27143
27276
|
setShowBusinessSelection(false);
|
|
27144
27277
|
setShowCompanyStructure(false);
|
|
27145
27278
|
return handleBackClick == null ? void 0 : handleBackClick();
|
|
27146
27279
|
}
|
|
27147
|
-
if (
|
|
27280
|
+
if (searching !== "loading" && searchResults && !searchResults.length) {
|
|
27148
27281
|
setShowBusinessSelection(false);
|
|
27149
27282
|
} else if (!verifiedBusiness) setShowCompanyStructure(false);
|
|
27150
27283
|
return handleBackClick == null ? void 0 : handleBackClick();
|
|
@@ -27158,13 +27291,13 @@ function BusinessDetailsDropinComponent({
|
|
|
27158
27291
|
default:
|
|
27159
27292
|
return handleBackClick == null ? void 0 : handleBackClick();
|
|
27160
27293
|
}
|
|
27161
|
-
}, [activeForm.formId, country, handleBackClick, handleNextClick,
|
|
27294
|
+
}, [activeForm.formId, country, handleBackClick, handleNextClick, searching, searchResults, showBusinessSelection, verifiedBusiness]);
|
|
27162
27295
|
const proceedToManualDataEntry = useCallback(async () => {
|
|
27163
27296
|
await clearTrustedBusinessData().then(() => setShowCompanyStructure(true));
|
|
27164
27297
|
}, [clearTrustedBusinessData]);
|
|
27165
27298
|
useEffect(() => {
|
|
27166
27299
|
var _a2;
|
|
27167
|
-
if ((
|
|
27300
|
+
if ((trustedFields == null ? void 0 : trustedFields.length) && ((_a2 = legalEntityResponse.organization) == null ? void 0 : _a2.registeredAddress.country) !== currentCountry) {
|
|
27168
27301
|
setTrustedFields(void 0);
|
|
27169
27302
|
}
|
|
27170
27303
|
}, [currentCountry]);
|
|
@@ -27209,10 +27342,10 @@ function BusinessDetailsDropinComponent({
|
|
|
27209
27342
|
invalidTin,
|
|
27210
27343
|
resetTinVerification,
|
|
27211
27344
|
verifiedBusiness,
|
|
27212
|
-
|
|
27213
|
-
|
|
27214
|
-
|
|
27215
|
-
|
|
27345
|
+
searching,
|
|
27346
|
+
fetching,
|
|
27347
|
+
verifying,
|
|
27348
|
+
resettingTrustedData,
|
|
27216
27349
|
searchForBusiness,
|
|
27217
27350
|
fetchBusinessData,
|
|
27218
27351
|
verifyBusinessData,
|
|
@@ -27273,9 +27406,9 @@ function CompanyDropinComponent({
|
|
|
27273
27406
|
handleHomeClick,
|
|
27274
27407
|
onTypeSwitch,
|
|
27275
27408
|
onChange,
|
|
27276
|
-
trustedFields
|
|
27409
|
+
trustedFields
|
|
27277
27410
|
}) {
|
|
27278
|
-
var _a, _b
|
|
27411
|
+
var _a, _b;
|
|
27279
27412
|
const {
|
|
27280
27413
|
accountHolder,
|
|
27281
27414
|
setAccountHolder
|
|
@@ -27354,12 +27487,11 @@ function CompanyDropinComponent({
|
|
|
27354
27487
|
onChange == null ? void 0 : onChange(currentState);
|
|
27355
27488
|
}, [currentState]);
|
|
27356
27489
|
const isSkippingCompanyStructure = useEnableNewEntryFlow() && organizationTypesToSkipCompanyStructureForm.includes((_b = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _b.type) && accountHolder !== "aTrust";
|
|
27357
|
-
const isSkippingCompanyRegistrationDocument = country === "CA" && ((_c = currentState.data.companyRegistrationDetails) == null ? void 0 : _c.registrationNumber) && ((_d = currentState.valid.companyRegistrationDetails) == null ? void 0 : _d.registrationNumber) && !((_e = currentState.data.companyRegistrationDocument) == null ? void 0 : _e.registrationDocument);
|
|
27358
27490
|
const forms2 = useMemo(() => {
|
|
27359
27491
|
const requiredForms = getRequiredForms(companyForms, derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields);
|
|
27360
27492
|
const validityAddedForms = addValidityToForms(requiredForms, formValidity, problems);
|
|
27361
|
-
return removeConditionalForms(validityAddedForms,
|
|
27362
|
-
}, [derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields, formValidity, problems, isSkippingCompanyStructure
|
|
27493
|
+
return removeConditionalForms(validityAddedForms, isSkippingCompanyStructure);
|
|
27494
|
+
}, [derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields, formValidity, problems, isSkippingCompanyStructure]);
|
|
27363
27495
|
const submitDocuments2 = async ({
|
|
27364
27496
|
forms: forms22,
|
|
27365
27497
|
legalEntity,
|
|
@@ -27510,7 +27642,7 @@ function CompanyDropinComponent({
|
|
|
27510
27642
|
}, []);
|
|
27511
27643
|
const datasetUtils = datasetUtilities(i18n.locale);
|
|
27512
27644
|
const formatDataForSummary2 = (data2, forms22) => {
|
|
27513
|
-
var _a2, _b2,
|
|
27645
|
+
var _a2, _b2, _c, _d, _e, _f, _g;
|
|
27514
27646
|
let summaryData = cloneObject(data2);
|
|
27515
27647
|
if (summaryData.companyNameAndCountry) {
|
|
27516
27648
|
if (isCountryOfGoverningLawEnabled) {
|
|
@@ -27525,14 +27657,14 @@ function CompanyDropinComponent({
|
|
|
27525
27657
|
const companyType = (_b2 = companyTypes.find((type) => type.id === summaryData.companyType.entityType)) == null ? void 0 : _b2.name;
|
|
27526
27658
|
summaryData.companyType.entityType = i18n.get(companyType);
|
|
27527
27659
|
}
|
|
27528
|
-
if ((
|
|
27660
|
+
if ((_c = summaryData.companyType) == null ? void 0 : _c.accountHolder) {
|
|
27529
27661
|
summaryData.companyType.accountHolder = i18n.get(summaryData.companyType.accountHolder);
|
|
27530
27662
|
}
|
|
27531
|
-
if ((
|
|
27663
|
+
if ((_d = summaryData.companyRegistrationAddress) == null ? void 0 : _d.registrationAddress) {
|
|
27532
27664
|
summaryData.companyRegistrationAddress.hasInnerForms = true;
|
|
27533
27665
|
summaryData.companyRegistrationAddress.registrationAddress = mapAddressLabels(summaryData.companyRegistrationAddress.registrationAddress, datasetUtils);
|
|
27534
27666
|
}
|
|
27535
|
-
if ((
|
|
27667
|
+
if ((_e = summaryData.companyRegistrationAddress) == null ? void 0 : _e.operationalAddress) {
|
|
27536
27668
|
summaryData.companyRegistrationAddress.operationalAddress = mapAddressLabels(summaryData.companyRegistrationAddress.operationalAddress, datasetUtils);
|
|
27537
27669
|
}
|
|
27538
27670
|
if ((_f = summaryData.companyRegistrationDetails) == null ? void 0 : _f.vatAbsenceReason) {
|
|
@@ -27614,7 +27746,7 @@ function CompanyDropinComponent({
|
|
|
27614
27746
|
ref: formRef,
|
|
27615
27747
|
shouldValidate,
|
|
27616
27748
|
isTopLevelEntity: taskType === TaskTypes.COMPANY,
|
|
27617
|
-
readOnlyFields:
|
|
27749
|
+
readOnlyFields: trustedFields
|
|
27618
27750
|
})
|
|
27619
27751
|
});
|
|
27620
27752
|
}
|
|
@@ -28627,7 +28759,8 @@ function useCompanySearchTaskSubmit({
|
|
|
28627
28759
|
setProblems,
|
|
28628
28760
|
setLoadingStatus,
|
|
28629
28761
|
onExternalSubmit,
|
|
28630
|
-
handleUpdateLegalEntity
|
|
28762
|
+
handleUpdateLegalEntity,
|
|
28763
|
+
accountHolder
|
|
28631
28764
|
}) {
|
|
28632
28765
|
const {
|
|
28633
28766
|
showToast,
|
|
@@ -28672,7 +28805,7 @@ function useCompanySearchTaskSubmit({
|
|
|
28672
28805
|
const submit2 = useCallback(async ({
|
|
28673
28806
|
data
|
|
28674
28807
|
}) => {
|
|
28675
|
-
var _a, _b, _c, _d;
|
|
28808
|
+
var _a, _b, _c, _d, _e;
|
|
28676
28809
|
setLoadingStatus("loading");
|
|
28677
28810
|
const trackingPayload = {
|
|
28678
28811
|
companyStructure: ((_a = data.companyStructure) == null ? void 0 : _a.entityType) ?? null,
|
|
@@ -28684,7 +28817,7 @@ function useCompanySearchTaskSubmit({
|
|
|
28684
28817
|
const filteredData = removeOldDataBySchema(data, savedLegalEntityData);
|
|
28685
28818
|
const legalEntity = {
|
|
28686
28819
|
...mapCompanySearchSchemaToLegalEntity(filteredData),
|
|
28687
|
-
entityAssociations: filterOutUnwantedAssociationsIfRootLE(task, legalEntityResponse,
|
|
28820
|
+
entityAssociations: filterOutUnwantedAssociationsIfRootLE(task, legalEntityResponse, (((_e = data.companyStructure) == null ? void 0 : _e.accountHolder) || accountHolder) ?? void 0)
|
|
28688
28821
|
};
|
|
28689
28822
|
try {
|
|
28690
28823
|
userEvents.addEvent(CompanySearchEvents.TASK_SUBMIT, {
|
|
@@ -28891,7 +29024,6 @@ function CompanySearchDropinComponent({
|
|
|
28891
29024
|
taskName,
|
|
28892
29025
|
hideDropinLayout,
|
|
28893
29026
|
homeButtonLabel,
|
|
28894
|
-
accountHolder,
|
|
28895
29027
|
onChange,
|
|
28896
29028
|
onSubmit: onExternalSubmit,
|
|
28897
29029
|
handleHomeClick,
|
|
@@ -28907,9 +29039,9 @@ function CompanySearchDropinComponent({
|
|
|
28907
29039
|
handleRefreshCompanyDataset,
|
|
28908
29040
|
handleVerifyTin,
|
|
28909
29041
|
onTypeSwitch,
|
|
28910
|
-
trustedFields
|
|
29042
|
+
trustedFields
|
|
28911
29043
|
}) {
|
|
28912
|
-
var _a, _b, _c, _d
|
|
29044
|
+
var _a, _b, _c, _d;
|
|
28913
29045
|
const {
|
|
28914
29046
|
state: {
|
|
28915
29047
|
currentState
|
|
@@ -28918,6 +29050,10 @@ function CompanySearchDropinComponent({
|
|
|
28918
29050
|
useEffect(() => {
|
|
28919
29051
|
onChange == null ? void 0 : onChange(currentState);
|
|
28920
29052
|
}, [currentState, onChange]);
|
|
29053
|
+
const {
|
|
29054
|
+
accountHolder,
|
|
29055
|
+
setAccountHolder
|
|
29056
|
+
} = useCoreContext();
|
|
28921
29057
|
const formRef = useRef(null);
|
|
28922
29058
|
const {
|
|
28923
29059
|
showToast
|
|
@@ -28933,7 +29069,7 @@ function CompanySearchDropinComponent({
|
|
|
28933
29069
|
} = useExperimentsContext();
|
|
28934
29070
|
const isNewEntryFlowEnabled = useEnableNewEntryFlow();
|
|
28935
29071
|
const [loadingStatus, setLoadingStatus] = useState("success");
|
|
28936
|
-
const [initialData, setInitialData] = useState(mapLegalEntityToCompanySearchSchema(legalEntityResponse, Boolean(isTargetLegalEntityType), isNewEntryFlowEnabled ? accountHolder : void 0));
|
|
29072
|
+
const [initialData, setInitialData] = useState(mapLegalEntityToCompanySearchSchema(legalEntityResponse, Boolean(isTargetLegalEntityType), isNewEntryFlowEnabled && accountHolder ? accountHolder : void 0));
|
|
28937
29073
|
const country = useMemo(() => {
|
|
28938
29074
|
var _a2;
|
|
28939
29075
|
return ((_a2 = currentState.data.companyBasics) == null ? void 0 : _a2.country) ?? parentCountry;
|
|
@@ -28994,12 +29130,11 @@ function CompanySearchDropinComponent({
|
|
|
28994
29130
|
}
|
|
28995
29131
|
}, [fieldConfigurations, problems == null ? void 0 : problems.remediationActions, problems == null ? void 0 : problems.missingData, legalEntityResponse, isExperimentEnabled, customRules, country]);
|
|
28996
29132
|
const isSkippingCompanyStructure = useEnableNewEntryFlow() && organizationTypesToSkipCompanyStructureForm.includes((_d = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _d.type) && accountHolder !== "aTrust";
|
|
28997
|
-
const isSkippingCompanyRegistrationDocument = country === "CA" && ((_e = currentState.data.companyOtherDetails) == null ? void 0 : _e.registrationNumber) && ((_f = currentState.valid.companyOtherDetails) == null ? void 0 : _f.registrationNumber) && !((_g = currentState.data.companyRegistrationDocument) == null ? void 0 : _g.registrationDocument);
|
|
28998
29133
|
const forms$1 = useMemo(() => {
|
|
28999
29134
|
const requiredForms = getRequiredForms(forms, derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields);
|
|
29000
29135
|
const validityAddedForms = addValidityToForms(requiredForms, currentState.validityByForm, problems);
|
|
29001
|
-
return removeConditionalForms(validityAddedForms,
|
|
29002
|
-
}, [derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields, currentState.validityByForm, problems, isSkippingCompanyStructure
|
|
29136
|
+
return removeConditionalForms(validityAddedForms, isSkippingCompanyStructure);
|
|
29137
|
+
}, [derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields, currentState.validityByForm, problems, isSkippingCompanyStructure]);
|
|
29003
29138
|
const summaryData = useMemo(() => ({
|
|
29004
29139
|
data: formatDataForSummary(currentState.data, forms$1, derivedProps == null ? void 0 : derivedProps.labels, i18n),
|
|
29005
29140
|
omittedKeys: ["operationalAddressIsSame"]
|
|
@@ -29024,7 +29159,8 @@ function CompanySearchDropinComponent({
|
|
|
29024
29159
|
setProblems,
|
|
29025
29160
|
setLoadingStatus,
|
|
29026
29161
|
onExternalSubmit,
|
|
29027
|
-
handleUpdateLegalEntity
|
|
29162
|
+
handleUpdateLegalEntity,
|
|
29163
|
+
accountHolder
|
|
29028
29164
|
});
|
|
29029
29165
|
const {
|
|
29030
29166
|
handleNextClick,
|
|
@@ -29062,9 +29198,13 @@ function CompanySearchDropinComponent({
|
|
|
29062
29198
|
activeForm,
|
|
29063
29199
|
validateForm: () => setShouldValidate(true),
|
|
29064
29200
|
baseTrackingPayload,
|
|
29065
|
-
onSubmit: () =>
|
|
29066
|
-
|
|
29067
|
-
|
|
29201
|
+
onSubmit: () => {
|
|
29202
|
+
var _a2;
|
|
29203
|
+
setAccountHolder(((_a2 = currentState.data.companyStructure) == null ? void 0 : _a2.accountHolder) || accountHolder);
|
|
29204
|
+
return submit2({
|
|
29205
|
+
data: currentState.data
|
|
29206
|
+
});
|
|
29207
|
+
},
|
|
29068
29208
|
problems,
|
|
29069
29209
|
canSubmit: canSubmitForm,
|
|
29070
29210
|
summary: summaryData,
|
|
@@ -29091,7 +29231,7 @@ function CompanySearchDropinComponent({
|
|
|
29091
29231
|
handleGetCompanyDataset,
|
|
29092
29232
|
handleRefreshCompanyDataset,
|
|
29093
29233
|
handleVerifyTin,
|
|
29094
|
-
readOnlyFields:
|
|
29234
|
+
readOnlyFields: trustedFields
|
|
29095
29235
|
})
|
|
29096
29236
|
});
|
|
29097
29237
|
}
|
|
@@ -29191,10 +29331,9 @@ const useHasSeenSingpassSelection = ({
|
|
|
29191
29331
|
setHasSeenSingpassSelection
|
|
29192
29332
|
};
|
|
29193
29333
|
};
|
|
29194
|
-
const
|
|
29195
|
-
const parseTrustedFieldsIntoReadOnlyFields = (trustedFields2, mapping) => {
|
|
29334
|
+
const parseTrustedFieldsIntoReadOnlyFields = (trustedFields, mapping) => {
|
|
29196
29335
|
const formFieldsMapped = [];
|
|
29197
|
-
|
|
29336
|
+
trustedFields.forEach((field) => {
|
|
29198
29337
|
for (const [key, value] of Object.entries(mapping)) {
|
|
29199
29338
|
if (value === field) {
|
|
29200
29339
|
formFieldsMapped.push(key);
|
|
@@ -29216,17 +29355,6 @@ const parseTrustedFieldsIntoReadOnlyFields = (trustedFields2, mapping) => {
|
|
|
29216
29355
|
});
|
|
29217
29356
|
return readOnlyFields;
|
|
29218
29357
|
};
|
|
29219
|
-
const trustedFields = ({
|
|
29220
|
-
fields,
|
|
29221
|
-
trustedFieldsProvider,
|
|
29222
|
-
apiMapping
|
|
29223
|
-
}) => {
|
|
29224
|
-
if (!fields || !trustedFieldsProvider || !apiMapping) {
|
|
29225
|
-
return {};
|
|
29226
|
-
}
|
|
29227
|
-
const trustedFieldsOfProvider = getTrustedFieldsByProvider(trustedFieldsProvider, fields);
|
|
29228
|
-
return trustedFieldsOfProvider ? parseTrustedFieldsIntoReadOnlyFields(trustedFieldsOfProvider, apiMapping) : {};
|
|
29229
|
-
};
|
|
29230
29358
|
const defaultSingpassState = {
|
|
29231
29359
|
isLoading: false,
|
|
29232
29360
|
isSuccess: false
|
|
@@ -29270,6 +29398,27 @@ const getApiMapping = (enableCompanySearchFlow, legalEntity) => {
|
|
|
29270
29398
|
return companyComponentsKeyMapping;
|
|
29271
29399
|
}
|
|
29272
29400
|
};
|
|
29401
|
+
const getTrustedEntityAssociations = (legalEntityTrustedFields) => {
|
|
29402
|
+
const rawTrustedEntityAssociations = legalEntityTrustedFields.filter((f) => f.startsWith("entityAssociations")) ?? [];
|
|
29403
|
+
const leIdMap = {};
|
|
29404
|
+
rawTrustedEntityAssociations.forEach((rtea) => {
|
|
29405
|
+
const [_, role, leId] = rtea.split(".");
|
|
29406
|
+
const trustedRole = role;
|
|
29407
|
+
if (!leIdMap[leId]) {
|
|
29408
|
+
leIdMap[leId] = {
|
|
29409
|
+
roles: [trustedRole]
|
|
29410
|
+
};
|
|
29411
|
+
} else {
|
|
29412
|
+
leIdMap[leId] = {
|
|
29413
|
+
roles: [...leIdMap[leId].roles, trustedRole]
|
|
29414
|
+
};
|
|
29415
|
+
}
|
|
29416
|
+
});
|
|
29417
|
+
return Object.keys(leIdMap).map((reference) => ({
|
|
29418
|
+
reference,
|
|
29419
|
+
types: leIdMap[reference].roles
|
|
29420
|
+
}));
|
|
29421
|
+
};
|
|
29273
29422
|
const useSingpassMyInfoLogin = ({
|
|
29274
29423
|
legalEntity,
|
|
29275
29424
|
accountHolder,
|
|
@@ -29283,6 +29432,7 @@ const useSingpassMyInfoLogin = ({
|
|
|
29283
29432
|
const isSingpassForIndividualsEnabled = isExperimentEnabled("ShowSingPassButtonForIndividuals");
|
|
29284
29433
|
const enableCompanySearchFlow = isExperimentEnabled("EnableCompanySearchFlow");
|
|
29285
29434
|
const apiMapping = getApiMapping(enableCompanySearchFlow, legalEntity);
|
|
29435
|
+
const legalEntityTrustedFields = legalEntity == null ? void 0 : legalEntity.trustedFields;
|
|
29286
29436
|
const isEligibleForSingpass = useMemo(() => {
|
|
29287
29437
|
if (!legalEntity) {
|
|
29288
29438
|
return false;
|
|
@@ -29303,17 +29453,13 @@ const useSingpassMyInfoLogin = ({
|
|
|
29303
29453
|
const isVanillaIndividual = legalEntityType === LegalEntityType.INDIVIDUAL && !hasSoleProprietor;
|
|
29304
29454
|
return isVanillaOrganization && isSingpassForCompaniesEnabled || isVanillaIndividual && isSingpassForIndividualsEnabled;
|
|
29305
29455
|
}, [legalEntity, accountHolder, handleOpenSingpassAuthorizationLink]);
|
|
29306
|
-
const
|
|
29307
|
-
|
|
29308
|
-
|
|
29309
|
-
|
|
29310
|
-
|
|
29311
|
-
|
|
29312
|
-
|
|
29313
|
-
trustedFieldsProvider: TrustedFieldsProvider.SINGPASS,
|
|
29314
|
-
apiMapping
|
|
29315
|
-
});
|
|
29316
|
-
}, [legalEntity, isEligibleForSingpass, apiMapping]);
|
|
29456
|
+
const singpassTrustedFields = useMemo(() => {
|
|
29457
|
+
var _a;
|
|
29458
|
+
const allTrustedFields = isEligibleForSingpass && legalEntityTrustedFields ? legalEntityTrustedFields : [];
|
|
29459
|
+
return ((_a = allTrustedFields.find((tf) => tf.provider === TrustedFieldsProvider.SINGPASS)) == null ? void 0 : _a.fields) || [];
|
|
29460
|
+
}, [isEligibleForSingpass, legalEntity]);
|
|
29461
|
+
const trustedFields = useMemo(() => apiMapping ? parseTrustedFieldsIntoReadOnlyFields(singpassTrustedFields, apiMapping) : {}, [singpassTrustedFields, apiMapping]);
|
|
29462
|
+
const trustedEntityAssociations = useMemo(() => getTrustedEntityAssociations(singpassTrustedFields), [singpassTrustedFields]);
|
|
29317
29463
|
const handleInitiateSingpassMyInfoLogin = async () => {
|
|
29318
29464
|
if (handleOpenSingpassAuthorizationLink) {
|
|
29319
29465
|
dispatch({
|
|
@@ -29358,7 +29504,8 @@ const useSingpassMyInfoLogin = ({
|
|
|
29358
29504
|
handleSingpassMyInfoLoginSuccess,
|
|
29359
29505
|
handleSingpassMyInfoLoginFailure,
|
|
29360
29506
|
handleSingpassMyInfoLoginReset,
|
|
29361
|
-
trustedFields
|
|
29507
|
+
trustedFields,
|
|
29508
|
+
trustedEntityAssociations
|
|
29362
29509
|
};
|
|
29363
29510
|
};
|
|
29364
29511
|
const logger$i = createLogger("useAssociatedLegalArrangement");
|
|
@@ -30198,17 +30345,9 @@ function useDataMissingRemediations({
|
|
|
30198
30345
|
}
|
|
30199
30346
|
};
|
|
30200
30347
|
}
|
|
30201
|
-
const iconStatus = (current, min
|
|
30202
|
-
const
|
|
30203
|
-
|
|
30204
|
-
const isWithinConditionalRange = current >= min;
|
|
30205
|
-
if (isEmpty2) {
|
|
30206
|
-
return min > 0 ? "obligatoryEmpty" : "conditionalEmpty";
|
|
30207
|
-
}
|
|
30208
|
-
if (isWithinObligatoryRange) {
|
|
30209
|
-
return "obligatoryFinished";
|
|
30210
|
-
}
|
|
30211
|
-
return isWithinConditionalRange ? "conditionalFinished" : "conditionalEmpty";
|
|
30348
|
+
const iconStatus = (current, min) => {
|
|
30349
|
+
const isSatisfied = current > 0 && current >= min;
|
|
30350
|
+
return isSatisfied ? "satisfied" : "empty";
|
|
30212
30351
|
};
|
|
30213
30352
|
const getEntityStatusRuleDescription = (country, currentTask, entityLabel) => currentTask === TaskTypes.TRUST_MEMBER_OVERVIEW ? TRUST_DEFAULT_DESCRIPTIONS_MAP[entityLabel] : getDecisionMakerDescriptionMap(country)[entityLabel];
|
|
30214
30353
|
const Status = ({
|
|
@@ -30563,67 +30702,26 @@ const EntityStatusIcon = ({
|
|
|
30563
30702
|
status
|
|
30564
30703
|
}) => {
|
|
30565
30704
|
switch (status) {
|
|
30566
|
-
case "
|
|
30567
|
-
return jsx(Icon, {
|
|
30568
|
-
name: "checkmark-small",
|
|
30569
|
-
className: "adyen-kyc-entity-status__icon adyen-kyc-entity-status__icon--obligatory",
|
|
30570
|
-
testId: "obligatoryEmpty-icon"
|
|
30571
|
-
});
|
|
30572
|
-
case "conditionalEmpty":
|
|
30705
|
+
case "empty":
|
|
30573
30706
|
return jsx(Icon, {
|
|
30574
|
-
name: "
|
|
30575
|
-
className: "adyen-kyc-entity-status__icon adyen-kyc-entity-status__icon--
|
|
30576
|
-
testId: "
|
|
30707
|
+
name: "circle",
|
|
30708
|
+
className: "adyen-kyc-entity-status__icon adyen-kyc-entity-status__icon--empty",
|
|
30709
|
+
testId: "empty-icon"
|
|
30577
30710
|
});
|
|
30578
|
-
case "
|
|
30711
|
+
case "satisfied":
|
|
30579
30712
|
return jsx(Icon, {
|
|
30580
|
-
name: "checkmark-
|
|
30581
|
-
className: "adyen-kyc-entity-status__icon adyen-kyc-entity-status__icon--
|
|
30582
|
-
testId: "
|
|
30583
|
-
});
|
|
30584
|
-
case "conditionalFinished":
|
|
30585
|
-
return jsx(Icon, {
|
|
30586
|
-
name: "checkmark-small",
|
|
30587
|
-
className: "adyen-kyc-entity-status__icon adyen-kyc-entity-status__icon--conditional-success",
|
|
30588
|
-
testId: "conditionalFinished-icon"
|
|
30713
|
+
name: "checkmark-circle-fill",
|
|
30714
|
+
className: "adyen-kyc-entity-status__icon adyen-kyc-entity-status__icon--satisfied",
|
|
30715
|
+
testId: "satisfied-icon"
|
|
30589
30716
|
});
|
|
30590
30717
|
default:
|
|
30591
30718
|
return jsx(Icon, {
|
|
30592
|
-
name: "
|
|
30593
|
-
className: "adyen-kyc-entity-status__icon adyen-kyc-entity-status__icon--
|
|
30594
|
-
testId: "
|
|
30719
|
+
name: "circle",
|
|
30720
|
+
className: "adyen-kyc-entity-status__icon adyen-kyc-entity-status__icon--empty",
|
|
30721
|
+
testId: "empty-icon"
|
|
30595
30722
|
});
|
|
30596
30723
|
}
|
|
30597
30724
|
};
|
|
30598
|
-
const EntityGuidanceLegend = () => {
|
|
30599
|
-
const {
|
|
30600
|
-
i18n
|
|
30601
|
-
} = useI18nContext();
|
|
30602
|
-
return jsxs("div", {
|
|
30603
|
-
className: "adyen-kyc-entity-status__legend",
|
|
30604
|
-
children: [jsxs("span", {
|
|
30605
|
-
className: "adyen-kyc-entity-status__legend--rule",
|
|
30606
|
-
children: [jsx(EntityStatusIcon, {
|
|
30607
|
-
status: "obligatoryEmpty"
|
|
30608
|
-
}), jsx("span", {
|
|
30609
|
-
className: "adyen-kyc-entity-status--text",
|
|
30610
|
-
dangerouslySetInnerHTML: {
|
|
30611
|
-
__html: i18n.get("obligatory")
|
|
30612
|
-
}
|
|
30613
|
-
})]
|
|
30614
|
-
}), jsxs("span", {
|
|
30615
|
-
className: "adyen-kyc-entity-status__legend--rule",
|
|
30616
|
-
children: [jsx(EntityStatusIcon, {
|
|
30617
|
-
status: "conditionalEmpty"
|
|
30618
|
-
}), jsx("span", {
|
|
30619
|
-
className: "adyen-kyc-entity-status--text",
|
|
30620
|
-
dangerouslySetInnerHTML: {
|
|
30621
|
-
__html: i18n.get("requiredIfApplicable")
|
|
30622
|
-
}
|
|
30623
|
-
})]
|
|
30624
|
-
})]
|
|
30625
|
-
});
|
|
30626
|
-
};
|
|
30627
30725
|
const EntityGuidanceStatus = ({
|
|
30628
30726
|
country,
|
|
30629
30727
|
currentTask,
|
|
@@ -30659,8 +30757,7 @@ const DecisionMakersComponent = ({
|
|
|
30659
30757
|
handleUpdateLegalEntity,
|
|
30660
30758
|
navigateBackToTaskList,
|
|
30661
30759
|
onDecisionMakerDelete,
|
|
30662
|
-
|
|
30663
|
-
disableDeleteDecisionMakers
|
|
30760
|
+
trustedEntityAssociations
|
|
30664
30761
|
}) => {
|
|
30665
30762
|
var _a, _b;
|
|
30666
30763
|
const {
|
|
@@ -30756,17 +30853,16 @@ const DecisionMakersComponent = ({
|
|
|
30756
30853
|
children: [hasExpired && jsx(ExpiredBanner, {}), jsx(FormHeader, {
|
|
30757
30854
|
heading: i18n.get("decisionMaker"),
|
|
30758
30855
|
description: i18n.get("decisionMakerDescription")
|
|
30759
|
-
}), jsx(
|
|
30856
|
+
}), jsx("div", {
|
|
30760
30857
|
className: "adyen-kyc-decision-makers__container",
|
|
30761
30858
|
children: availableDecisionMakers.map(({
|
|
30762
30859
|
roleType,
|
|
30763
|
-
min
|
|
30764
|
-
max
|
|
30860
|
+
min
|
|
30765
30861
|
}) => jsx(EntityGuidanceStatus, {
|
|
30766
30862
|
country: registeredCountry,
|
|
30767
30863
|
currentTask: TaskTypes.DECISION_MAKER_OVERVIEW,
|
|
30768
30864
|
entityLabel: roleType,
|
|
30769
|
-
status: iconStatus(uniqueDecisionMakersPerType(roleType), min
|
|
30865
|
+
status: iconStatus(uniqueDecisionMakersPerType(roleType), min)
|
|
30770
30866
|
}, roleType))
|
|
30771
30867
|
}), jsx(ContextGuidance, {
|
|
30772
30868
|
page: "Decision makers",
|
|
@@ -30800,7 +30896,7 @@ const DecisionMakersComponent = ({
|
|
|
30800
30896
|
removeEntity: () => {
|
|
30801
30897
|
deleteDecisionMaker(decisionMaker);
|
|
30802
30898
|
},
|
|
30803
|
-
isRemoveDisabled: isRemoveDisabled ||
|
|
30899
|
+
isRemoveDisabled: isRemoveDisabled || trustedEntityAssociations.some((ea) => ea.reference === decisionMaker.reference),
|
|
30804
30900
|
handleIsRemoveDisabled: setIsRemoveDisabled
|
|
30805
30901
|
}, decisionMaker.reference))
|
|
30806
30902
|
}) : null, jsx(Button, {
|
|
@@ -30811,7 +30907,7 @@ const DecisionMakersComponent = ({
|
|
|
30811
30907
|
icon: "plus",
|
|
30812
30908
|
onClick: addDecisionMakerOnClick,
|
|
30813
30909
|
label: i18n.get("addDecisionMaker"),
|
|
30814
|
-
disabled: haveMaxDecisionMakers
|
|
30910
|
+
disabled: haveMaxDecisionMakers
|
|
30815
30911
|
}), jsx(ActionBar, {
|
|
30816
30912
|
onHome: () => {
|
|
30817
30913
|
userEvents.addEvent("Saved decision makers list", {
|
|
@@ -32189,18 +32285,17 @@ const TrustMembersOverview = ({
|
|
|
32189
32285
|
children: [hasExpired && jsx(ExpiredBanner, {}), jsx(FormHeader, {
|
|
32190
32286
|
heading: i18n.get("trustMembers"),
|
|
32191
32287
|
description: i18n.get("trustMembersDescription")
|
|
32192
|
-
}), jsx(
|
|
32288
|
+
}), jsx("div", {
|
|
32193
32289
|
className: "adyen-kyc-trust-members__container",
|
|
32194
32290
|
children: trustMemberRequirements.map(({
|
|
32195
32291
|
roleTypes,
|
|
32196
32292
|
min,
|
|
32197
|
-
max,
|
|
32198
32293
|
label
|
|
32199
32294
|
}) => jsx(EntityGuidanceStatus, {
|
|
32200
32295
|
country: CountryCodes.Australia,
|
|
32201
32296
|
currentTask: TaskTypes.TRUST_MEMBER_OVERVIEW,
|
|
32202
32297
|
entityLabel: label,
|
|
32203
|
-
status: iconStatus(trustMembersWithOneOfGivenRoles(roleTypes).length, min
|
|
32298
|
+
status: iconStatus(trustMembersWithOneOfGivenRoles(roleTypes).length, min)
|
|
32204
32299
|
}, label))
|
|
32205
32300
|
}), jsx(ContextGuidance, {
|
|
32206
32301
|
page: "Trust members",
|
|
@@ -32390,8 +32485,9 @@ function IndividualDropinComponent({
|
|
|
32390
32485
|
hideNavigation = false,
|
|
32391
32486
|
asModal = false,
|
|
32392
32487
|
handleBackClick: externalBackClick,
|
|
32393
|
-
trustedFields
|
|
32394
|
-
trustedFieldsProvider
|
|
32488
|
+
trustedFields,
|
|
32489
|
+
trustedFieldsProvider,
|
|
32490
|
+
trustedRoles
|
|
32395
32491
|
}) {
|
|
32396
32492
|
var _a, _b, _c, _d;
|
|
32397
32493
|
const {
|
|
@@ -32417,7 +32513,7 @@ function IndividualDropinComponent({
|
|
|
32417
32513
|
let dataFromResponse = mapLegalEntityToIndividual(legalEntityResponse, isTargetLegalEntityType);
|
|
32418
32514
|
const documentUtils = documentApiUtils(handleCreateDocument, handleGetDocument, handleUpdateDocument);
|
|
32419
32515
|
let roleTypes = [];
|
|
32420
|
-
const [newDecisionMaker
|
|
32516
|
+
const [newDecisionMaker] = useState();
|
|
32421
32517
|
const [problems, setProblems] = useState(propProblems);
|
|
32422
32518
|
const formRef = useRef(null);
|
|
32423
32519
|
const [loadingStatus, setLoadingStatus] = useState("success");
|
|
@@ -32426,7 +32522,7 @@ function IndividualDropinComponent({
|
|
|
32426
32522
|
const [country, setCountry] = useState(((_a = dataFromResponse == null ? void 0 : dataFromResponse.personalDetails) == null ? void 0 : _a.residencyCountry) ?? parentCountry);
|
|
32427
32523
|
const [hideFooter, setHideFooter] = useState(false);
|
|
32428
32524
|
const {
|
|
32429
|
-
trustedFields:
|
|
32525
|
+
trustedFields: associatedLegalEntityTrustedFields
|
|
32430
32526
|
} = useSingpassMyInfoLogin({
|
|
32431
32527
|
legalEntity: legalEntityResponse,
|
|
32432
32528
|
accountHolder,
|
|
@@ -32552,7 +32648,6 @@ function IndividualDropinComponent({
|
|
|
32552
32648
|
throw new Error("Provide handler to create legalEntity");
|
|
32553
32649
|
}
|
|
32554
32650
|
updatedLegalEntity = await handleCreateLegalEntity(legalEntity);
|
|
32555
|
-
setNewDecisionMaker(legalEntity);
|
|
32556
32651
|
userEvents.addEvent("Added decision maker", {
|
|
32557
32652
|
segmentation: {
|
|
32558
32653
|
...baseTrackingPayload,
|
|
@@ -32672,7 +32767,8 @@ function IndividualDropinComponent({
|
|
|
32672
32767
|
}
|
|
32673
32768
|
});
|
|
32674
32769
|
const accountHolderToEvaluated = ((_c2 = dataSubmitted.personalDetails) == null ? void 0 : _c2.accountHolder) || accountHolder;
|
|
32675
|
-
|
|
32770
|
+
const filteredEntityAssociation = filterOutUnwantedAssociationsIfRootLE(taskType, legalEntityResponse, accountHolderToEvaluated || void 0);
|
|
32771
|
+
legalEntity.entityAssociations = filteredEntityAssociation;
|
|
32676
32772
|
const createdLegalEntity = await submitLegalEntity({
|
|
32677
32773
|
dataSubmitted,
|
|
32678
32774
|
legalEntity,
|
|
@@ -32883,8 +32979,9 @@ function IndividualDropinComponent({
|
|
|
32883
32979
|
shouldValidate,
|
|
32884
32980
|
accountHolder,
|
|
32885
32981
|
parentLegalEntity,
|
|
32886
|
-
trustedFields: !parentLegalEntity ?
|
|
32887
|
-
trustedFieldsProvider
|
|
32982
|
+
trustedFields: !parentLegalEntity ? trustedFields : associatedLegalEntityTrustedFields,
|
|
32983
|
+
trustedFieldsProvider,
|
|
32984
|
+
trustedRoles
|
|
32888
32985
|
})
|
|
32889
32986
|
});
|
|
32890
32987
|
}
|
|
@@ -35474,7 +35571,7 @@ function DropinComposerComponent({
|
|
|
35474
35571
|
onNavigate = noop,
|
|
35475
35572
|
...args
|
|
35476
35573
|
}) {
|
|
35477
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
35574
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
35478
35575
|
const {
|
|
35479
35576
|
contextCountry,
|
|
35480
35577
|
accountHolder,
|
|
@@ -35518,13 +35615,14 @@ function DropinComposerComponent({
|
|
|
35518
35615
|
handleSingpassMyInfoLoginSuccess,
|
|
35519
35616
|
handleSingpassMyInfoLoginFailure,
|
|
35520
35617
|
handleSingpassMyInfoLoginReset,
|
|
35521
|
-
trustedFields: singpassTrustedFields
|
|
35618
|
+
trustedFields: singpassTrustedFields,
|
|
35619
|
+
trustedEntityAssociations
|
|
35522
35620
|
} = useSingpassMyInfoLogin({
|
|
35523
35621
|
legalEntity: rootLegalEntity,
|
|
35524
35622
|
accountHolder,
|
|
35525
35623
|
handleOpenSingpassAuthorizationLink
|
|
35526
35624
|
});
|
|
35527
|
-
const
|
|
35625
|
+
const singpassTabRef = useRef(null);
|
|
35528
35626
|
const rootLegalEntityCountry = getLegalEntityCountry(rootLegalEntity);
|
|
35529
35627
|
const [associatedLegalEntity, setAssociatedLegalEntity] = useState(null);
|
|
35530
35628
|
const {
|
|
@@ -35836,7 +35934,8 @@ function DropinComposerComponent({
|
|
|
35836
35934
|
try {
|
|
35837
35935
|
const authUrl = await handleInitiateSingpassMyInfoLogin();
|
|
35838
35936
|
setHasSeenSingpassSelection(true);
|
|
35839
|
-
window.open(authUrl, "_blank")
|
|
35937
|
+
singpassTabRef.current = window.open(authUrl, "_blank");
|
|
35938
|
+
singpassTabRef.current.focus();
|
|
35840
35939
|
} catch (e) {
|
|
35841
35940
|
logger$d.error(e);
|
|
35842
35941
|
handleSingpassMyInfoLoginFailure(e);
|
|
@@ -36074,7 +36173,8 @@ function DropinComposerComponent({
|
|
|
36074
36173
|
onClick: async () => {
|
|
36075
36174
|
try {
|
|
36076
36175
|
const authUrl = await handleInitiateSingpassMyInfoLogin();
|
|
36077
|
-
window.open(authUrl
|
|
36176
|
+
singpassTabRef.current = window.open(authUrl);
|
|
36177
|
+
singpassTabRef.current.focus();
|
|
36078
36178
|
} catch (e) {
|
|
36079
36179
|
logger$d.error(e);
|
|
36080
36180
|
handleSingpassMyInfoLoginFailure(e);
|
|
@@ -36088,6 +36188,7 @@ function DropinComposerComponent({
|
|
|
36088
36188
|
if (isSuccessful) {
|
|
36089
36189
|
handleSingpassMyInfoLoginSuccess();
|
|
36090
36190
|
await refreshLegalEntity();
|
|
36191
|
+
singpassTabRef.current.close();
|
|
36091
36192
|
} else {
|
|
36092
36193
|
handleSingpassMyInfoLoginFailure(legalEntityResponse.type === LegalEntityType.INDIVIDUAL ? "weCouldntConnectToMyinfo" : "weCouldntConnectToMyinfoBusiness");
|
|
36093
36194
|
}
|
|
@@ -36164,8 +36265,7 @@ function DropinComposerComponent({
|
|
|
36164
36265
|
navigateBackToTaskList: navigateBack,
|
|
36165
36266
|
onDecisionMakerDelete: refreshLegalEntity,
|
|
36166
36267
|
capabilityProblems,
|
|
36167
|
-
|
|
36168
|
-
disableDeleteDecisionMakers: hasUsedSingpass
|
|
36268
|
+
trustedEntityAssociations
|
|
36169
36269
|
});
|
|
36170
36270
|
case TaskTypes.INDIVIDUAL:
|
|
36171
36271
|
return jsx(IndividualDropinComponent, {
|
|
@@ -36234,7 +36334,8 @@ function DropinComposerComponent({
|
|
|
36234
36334
|
handleGetIdVerificationStartCheck: args == null ? void 0 : args.handleGetIdVerificationStartCheck,
|
|
36235
36335
|
handleOpenSingpassAuthorizationLink: args == null ? void 0 : args.handleOpenSingpassAuthorizationLink,
|
|
36236
36336
|
trustedFields: singpassTrustedFields,
|
|
36237
|
-
trustedFieldsProvider: isEligibleForSingpass && TrustedFieldsProvider.SINGPASS
|
|
36337
|
+
trustedFieldsProvider: isEligibleForSingpass && TrustedFieldsProvider.SINGPASS,
|
|
36338
|
+
trustedRoles: ((_d = trustedEntityAssociations.find((ea) => ea.reference === (associatedLegalEntity == null ? void 0 : associatedLegalEntity.id))) == null ? void 0 : _d.types) || []
|
|
36238
36339
|
});
|
|
36239
36340
|
case TaskTypes.TRUST_MEMBER_COMPANY_OWNER:
|
|
36240
36341
|
return jsx(IndividualDropinComponent, {
|
|
@@ -36315,8 +36416,7 @@ function DropinComposerComponent({
|
|
|
36315
36416
|
handleFindAddress: args == null ? void 0 : args.handleFindAddress,
|
|
36316
36417
|
onTypeSwitch: navigateToTypeSwitcher,
|
|
36317
36418
|
isTargetLegalEntityType: legalEntityType === LegalEntityType.ORGANIZATION,
|
|
36318
|
-
trustedFields: singpassTrustedFields
|
|
36319
|
-
trustedFieldsProvider: isEligibleForSingpass && TrustedFieldsProvider.SINGPASS
|
|
36419
|
+
trustedFields: singpassTrustedFields
|
|
36320
36420
|
});
|
|
36321
36421
|
case TaskTypes.COMPANY_SEARCH:
|
|
36322
36422
|
return jsx(CompanySearchDropinComponent, {
|
|
@@ -36352,7 +36452,6 @@ function DropinComposerComponent({
|
|
|
36352
36452
|
handleVerifyTin: args.handleVerifyTin,
|
|
36353
36453
|
onTypeSwitch: navigateToTypeSwitcher,
|
|
36354
36454
|
isTargetLegalEntityType: legalEntityType === LegalEntityType.ORGANIZATION,
|
|
36355
|
-
accountHolder,
|
|
36356
36455
|
trustedFields: singpassTrustedFields,
|
|
36357
36456
|
trustedFieldsProvider: isEligibleForSingpass && TrustedFieldsProvider.SINGPASS
|
|
36358
36457
|
});
|
|
@@ -36392,8 +36491,7 @@ function DropinComposerComponent({
|
|
|
36392
36491
|
handleVerifyTin: args.handleVerifyTin,
|
|
36393
36492
|
handleClearCompanyData: args.handleClearCompanyData,
|
|
36394
36493
|
onTypeSwitch: navigateToTypeSwitcher,
|
|
36395
|
-
isTargetLegalEntityType: legalEntityType === LegalEntityType.ORGANIZATION
|
|
36396
|
-
accountHolder
|
|
36494
|
+
isTargetLegalEntityType: legalEntityType === LegalEntityType.ORGANIZATION
|
|
36397
36495
|
})
|
|
36398
36496
|
});
|
|
36399
36497
|
case TaskTypes.TRUST_MEMBER_COMPANY:
|
|
@@ -36406,7 +36504,7 @@ function DropinComposerComponent({
|
|
|
36406
36504
|
parentLegalEntity: associatedLegalArrangement,
|
|
36407
36505
|
legalEntityResponse: associatedLegalEntity,
|
|
36408
36506
|
capabilities: getCapabilities(legalEntityResponse),
|
|
36409
|
-
problems: (
|
|
36507
|
+
problems: (_e = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _e[rootLegalEntity.id],
|
|
36410
36508
|
onChange: componentOnChange,
|
|
36411
36509
|
onSubmit: (data) => refreshLegalArrangementAndRunOnSubmit(data, 2),
|
|
36412
36510
|
handleBackClick: navigateBack,
|
|
@@ -36424,7 +36522,7 @@ function DropinComposerComponent({
|
|
|
36424
36522
|
},
|
|
36425
36523
|
taskType: currentTask,
|
|
36426
36524
|
taskName: currentTask === TaskTypes.PAYIN ? "payinDetails" : "payoutDetails",
|
|
36427
|
-
problems: (
|
|
36525
|
+
problems: (_f = capabilityProblems == null ? void 0 : capabilityProblems.BankAccount) == null ? void 0 : _f[transferInstrument == null ? void 0 : transferInstrument.id],
|
|
36428
36526
|
transferInstrument,
|
|
36429
36527
|
setTransferInstrument,
|
|
36430
36528
|
legalEntityResponse: rootLegalEntity,
|
|
@@ -36452,7 +36550,7 @@ function DropinComposerComponent({
|
|
|
36452
36550
|
topLevelLegalEntity: legalEntityResponse
|
|
36453
36551
|
},
|
|
36454
36552
|
taskType: TaskTypes.TRUST,
|
|
36455
|
-
problems: (
|
|
36553
|
+
problems: (_g = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _g[associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.id],
|
|
36456
36554
|
parentLegalEntity: rootLegalEntity,
|
|
36457
36555
|
legalEntityResponse: associatedLegalArrangement,
|
|
36458
36556
|
capabilities: getCapabilities(legalEntityResponse),
|
|
@@ -36460,7 +36558,7 @@ function DropinComposerComponent({
|
|
|
36460
36558
|
onSubmit: (data) => refreshLegalArrangementAndRunOnSubmit(data, 1),
|
|
36461
36559
|
handleHomeClick: navigateBack,
|
|
36462
36560
|
homeButtonLabel: i18n.get("saveAndGoToOverview"),
|
|
36463
|
-
country: (((
|
|
36561
|
+
country: (((_h = associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.trust) == null ? void 0 : _h.countryOfGoverningLaw) || ((_i = associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.trust) == null ? void 0 : _i.registeredAddress.country)) ?? rootLegalEntityCountry,
|
|
36464
36562
|
handleAddressSearch: args == null ? void 0 : args.handleAddressSearch,
|
|
36465
36563
|
handleFindAddress: args == null ? void 0 : args.handleFindAddress
|
|
36466
36564
|
});
|
|
@@ -36506,12 +36604,12 @@ function DropinComposerComponent({
|
|
|
36506
36604
|
parentLegalEntity: rootLegalEntity,
|
|
36507
36605
|
legalEntityResponse: associatedLegalArrangement,
|
|
36508
36606
|
capabilities: getCapabilities(legalEntityResponse),
|
|
36509
|
-
problems: (
|
|
36607
|
+
problems: (_j = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _j[associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.id],
|
|
36510
36608
|
onChange: componentOnChange,
|
|
36511
36609
|
onSubmit: (data) => refreshLegalArrangementAndRunOnSubmit(data, 1),
|
|
36512
36610
|
handleHomeClick: navigateBack,
|
|
36513
36611
|
homeButtonLabel: i18n.get("saveAndGoToOverview"),
|
|
36514
|
-
country: (((
|
|
36612
|
+
country: (((_k = associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.soleProprietorship) == null ? void 0 : _k.countryOfGoverningLaw) || ((_m = (_l = associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.soleProprietorship) == null ? void 0 : _l.registeredAddress) == null ? void 0 : _m.country)) ?? rootLegalEntityCountry,
|
|
36515
36613
|
handleAddressSearch: args == null ? void 0 : args.handleAddressSearch,
|
|
36516
36614
|
handleFindAddress: args == null ? void 0 : args.handleFindAddress
|
|
36517
36615
|
});
|
|
@@ -39360,7 +39458,7 @@ const ConfigurationApiProvider = ({
|
|
|
39360
39458
|
isEmbeddedDropin,
|
|
39361
39459
|
loadingContext
|
|
39362
39460
|
} = authContext;
|
|
39363
|
-
const sdkVersion = "2.
|
|
39461
|
+
const sdkVersion = "2.54.1";
|
|
39364
39462
|
useAnalytics({
|
|
39365
39463
|
onUserEvent,
|
|
39366
39464
|
legalEntityId: rootLegalEntityId,
|
|
@@ -40038,7 +40136,7 @@ const DebugModal = ({
|
|
|
40038
40136
|
};
|
|
40039
40137
|
const copyToClipboard = async () => {
|
|
40040
40138
|
const toCopy = {
|
|
40041
|
-
sdkVersion: "2.
|
|
40139
|
+
sdkVersion: "2.54.1",
|
|
40042
40140
|
experiments: Object.fromEntries(allExperimentsWithValues),
|
|
40043
40141
|
settings: Object.fromEntries(allSettingsWithValues)
|
|
40044
40142
|
};
|
|
@@ -40077,7 +40175,7 @@ const DebugModal = ({
|
|
|
40077
40175
|
children: [jsxs("div", {
|
|
40078
40176
|
className: "adyen-kyc-debug-modal__meta",
|
|
40079
40177
|
children: [jsxs("span", {
|
|
40080
|
-
children: ["SDK version: ", "2.
|
|
40178
|
+
children: ["SDK version: ", "2.54.1"]
|
|
40081
40179
|
}), jsxs("span", {
|
|
40082
40180
|
children: ["rootLegalEntityId: ", rootLegalEntityId]
|
|
40083
40181
|
})]
|