@adyen/kyc-components 2.55.0 → 2.56.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/adyen-kyc-components.es.js +1045 -502
- package/dist/style.css +127 -694
- package/dist/types/components/AdditionalInformation/VerifiedBusinessCard.d.ts +3 -1
- package/dist/types/components/AdditionalInformation/utils.d.ts +6 -0
- package/dist/types/components/BusinessSelection/types.d.ts +3 -1
- package/dist/types/components/Dropins/ServiceAgreementDropinComponent/components/ServiceAgreementDropinComponent.d.ts +1 -1
- package/dist/types/components/Dropins/ServiceAgreementDropinComponent/types.d.ts +1 -0
- package/dist/types/components/Dropins/types.d.ts +2 -2
- package/dist/types/components/EmbeddedDropins/CreateIndividualComponent/CreateIndividualComponent.d.ts +2 -1
- package/dist/types/components/PayoutAccount/component/CheckGuidance/CheckGuidance.d.ts +1 -0
- package/dist/types/components/RegistrationAddress/component/RegistrationAddressComponent.d.ts +2 -1
- package/dist/types/components/index.d.ts +14 -2
- package/dist/types/components/internal/Address/AddressComponent.d.ts +3 -0
- package/dist/types/components/internal/Address/AddressExperimentWrapper.d.ts +2 -0
- package/dist/types/components/internal/Address/components/FieldContainerComponent.d.ts +9 -0
- package/dist/types/components/internal/Address/types.d.ts +6 -10
- package/dist/types/components/internal/Address/validate.d.ts +2 -2
- package/dist/types/components/internal/FormFields/MultiSelectList/MultiSelectList.d.ts +1 -0
- package/dist/types/components/internal/FormFields/Select/Select.d.ts +2 -1
- package/dist/types/components/internal/FormFields/Select/components/SelectButton.d.ts +2 -1
- package/dist/types/components/internal/FormFields/Select/components/SelectList.d.ts +1 -0
- package/dist/types/components/internal/FormFields/Select/components/SelectListItem.d.ts +1 -0
- package/dist/types/components/internal/FormFields/Select/types.d.ts +4 -1
- package/dist/types/core/Context/ExperimentContext/types.d.ts +4 -1
- package/dist/types/core/Context/SettingsContext/types.d.ts +3 -1
- package/dist/types/core/SDKValidation/types.d.ts +2 -2
- package/dist/types/core/Services/componentApi/get-address.d.ts +2 -2
- package/dist/types/core/hooks/useBusinessData/types.d.ts +3 -1
- package/dist/types/core/hooks/useDebounce.d.ts +1 -0
- package/dist/types/core/models/api/address-search.d.ts +1 -8
- package/dist/types/core/models/api/company-search.d.ts +7 -0
- package/dist/types/core/models/form-rules.d.ts +2 -0
- package/package.json +1 -1
|
@@ -107,6 +107,7 @@ const defaultTrans = {
|
|
|
107
107
|
addPayinAccount: "Add a payin account",
|
|
108
108
|
addPayoutAccount: "Add a payout account",
|
|
109
109
|
addTrustMember: "Add trust member",
|
|
110
|
+
addYourselfAsSigner: "Add yourself as a signer",
|
|
110
111
|
additionalInformation: "Additional information",
|
|
111
112
|
additionalInformationFormHeading: "Additional business details",
|
|
112
113
|
additionalInformationFormName: "Additional details",
|
|
@@ -478,6 +479,8 @@ const defaultTrans = {
|
|
|
478
479
|
errorMessage_1_3051: "The proof of national ID number image was of too low quality.",
|
|
479
480
|
errorMessage_1_3052: "An ID document is needed to verify the individual.",
|
|
480
481
|
errorMessage_1_3062: "The name and 4 digit SSN couldn't be verified.",
|
|
482
|
+
errorMessage_1_3072: "We found the following issues:\n- The name and nationality couldn't be verified.\nReview the information below and correct any mistakes, or upload an id document then resubmit.",
|
|
483
|
+
errorMessage_1_3073: "We found the following issues:\n- The ID document didn't show the nationality.\nReview the information below and correct any mistakes, or upload an id document then resubmit.",
|
|
481
484
|
errorMessage_1_31: "ID document is needed",
|
|
482
485
|
errorMessage_1_32: "ID document couldn't be processed",
|
|
483
486
|
errorMessage_1_33: "ID document didn't meet requirements",
|
|
@@ -851,6 +854,7 @@ const defaultTrans = {
|
|
|
851
854
|
isParentOwnedByAnotherCompany: "Is your parent company owned by another company?",
|
|
852
855
|
isThisAddressTheMainHeadquarters: "Is this address the main headquarters?",
|
|
853
856
|
isTrustOperationAddressSame: "Is there a different address for your trust's operations?",
|
|
857
|
+
isYourNameMissingFromSigners: "Is your name missing from the list of signers?",
|
|
854
858
|
issuedByTheTaxAuthority: "Issued by the tax authority or government of the country where the company is registered",
|
|
855
859
|
issuedInTheLastXMonths: "Issued in the last %{number} months",
|
|
856
860
|
issuerState: "Issuing state",
|
|
@@ -949,6 +953,7 @@ const defaultTrans = {
|
|
|
949
953
|
nonProfitOrCharitableOrgDescription: "Your organization has official non-profit or tax-exempt status.",
|
|
950
954
|
nonProfitOrCharitableOrgTitle: "Non-profit or charitable organization",
|
|
951
955
|
noneOfTheAbove: "None of the above",
|
|
956
|
+
nothingNeedsToBeSigned: "Nothing needs to be signed right now.",
|
|
952
957
|
notBlurry: "Not blurry",
|
|
953
958
|
notCutOff: "Not cut off",
|
|
954
959
|
notExpired: "Not expired",
|
|
@@ -1303,6 +1308,7 @@ const defaultTrans = {
|
|
|
1303
1308
|
theIdCheckWillBeAutomaticallyValidated: "With the right capture, the ID check will be automatically validated",
|
|
1304
1309
|
theSubmitWasSuccessful: "The submit was successful",
|
|
1305
1310
|
thenResubmit: "then resubmit.",
|
|
1311
|
+
thereAreNoSigners: "There are no signers, please add yourself to make sure you can accept the terms and get the funds.",
|
|
1306
1312
|
thereWasAnErrorTryAgain: "There was an error, please try again",
|
|
1307
1313
|
thisIsMyBusiness: "This is my business",
|
|
1308
1314
|
thisMeansYouHaveAParentCompany: "If yes, this means you have a parent company, such as a global headquarters or a holding company.",
|
|
@@ -1828,7 +1834,7 @@ class UserEvents {
|
|
|
1828
1834
|
}
|
|
1829
1835
|
}
|
|
1830
1836
|
const userEvents = new UserEvents();
|
|
1831
|
-
const logger$
|
|
1837
|
+
const logger$G = createLogger("useCompanySearch");
|
|
1832
1838
|
const LOW_RISK_COMPANY_DATA_COMPLIANCE_WINDOW = 1577664e5;
|
|
1833
1839
|
function useCompanySearch({
|
|
1834
1840
|
defaultData,
|
|
@@ -1952,7 +1958,7 @@ function useCompanySearch({
|
|
|
1952
1958
|
state: companyData.state ?? stateOrProvince
|
|
1953
1959
|
});
|
|
1954
1960
|
} catch (e) {
|
|
1955
|
-
logger$
|
|
1961
|
+
logger$G.error(e);
|
|
1956
1962
|
setError(e);
|
|
1957
1963
|
setStatus("error");
|
|
1958
1964
|
} finally {
|
|
@@ -1985,7 +1991,7 @@ function useCompanySearch({
|
|
|
1985
1991
|
indexSearch: handleCompanyIndexSearch,
|
|
1986
1992
|
deepSearch: handleCompanyDeepSearch,
|
|
1987
1993
|
resultsLimit: limit
|
|
1988
|
-
})) == null ? void 0 : _a.catch((e) => logger$
|
|
1994
|
+
})) == null ? void 0 : _a.catch((e) => logger$G.error(e));
|
|
1989
1995
|
}
|
|
1990
1996
|
}, [legalCompanyName, country, stateOrProvince, taxIdentificationNumber, verifiedCompany, searchCompanies, handleCompanyIndexSearch, handleCompanyDeepSearch, limit, canVerify, baseTrackingPayload]);
|
|
1991
1997
|
useEffect(() => {
|
|
@@ -2008,8 +2014,8 @@ function useCompanySearch({
|
|
|
2008
2014
|
reset
|
|
2009
2015
|
};
|
|
2010
2016
|
}
|
|
2011
|
-
const logger$
|
|
2012
|
-
const KNOWN_BROKEN_PRIMARY_SOURCE_CONNECTIONS = [StateCodesUS.Arkansas, StateCodesUS.Connecticut, StateCodesUS.Georgia, StateCodesUS.Hawaii, StateCodesUS.Kentucky, StateCodesUS.Maryland, StateCodesUS.Minnesota, StateCodesUS.Missouri, StateCodesUS.Montana, StateCodesUS.NewHampshire, StateCodesUS.NewMexico, StateCodesUS.SouthCarolina, StateCodesUS.Utah, StateCodesUS.Vermont, StateCodesUS.Wisconsin, StateCodesUS.Wyoming];
|
|
2017
|
+
const logger$F = createLogger("useBusinessData");
|
|
2018
|
+
const KNOWN_BROKEN_PRIMARY_SOURCE_CONNECTIONS = [StateCodesUS.Arkansas, StateCodesUS.Connecticut, StateCodesUS.Georgia, StateCodesUS.Hawaii, StateCodesUS.Indiana, StateCodesUS.Kentucky, StateCodesUS.Maryland, StateCodesUS.Minnesota, StateCodesUS.Missouri, StateCodesUS.Montana, StateCodesUS.NewHampshire, StateCodesUS.NewMexico, StateCodesUS.SouthCarolina, StateCodesUS.Utah, StateCodesUS.Vermont, StateCodesUS.Wisconsin, StateCodesUS.Wyoming];
|
|
2013
2019
|
function useBusinessData({
|
|
2014
2020
|
handleCompanyIndexSearch,
|
|
2015
2021
|
handleCompanyDeepSearch,
|
|
@@ -2044,7 +2050,7 @@ function useBusinessData({
|
|
|
2044
2050
|
};
|
|
2045
2051
|
const searchForBusiness = useCallback(async (data) => {
|
|
2046
2052
|
if (!handleCompanyDeepSearch || !handleCompanyIndexSearch) {
|
|
2047
|
-
logger$
|
|
2053
|
+
logger$F.log("Missing handlers for searchForBusiness");
|
|
2048
2054
|
return;
|
|
2049
2055
|
}
|
|
2050
2056
|
if (searchResults && objectsDeepEqual(cachedSearch, data)) return;
|
|
@@ -2061,15 +2067,15 @@ function useBusinessData({
|
|
|
2061
2067
|
return response == null ? void 0 : response.results;
|
|
2062
2068
|
} catch (e) {
|
|
2063
2069
|
setSearching("error");
|
|
2064
|
-
logger$
|
|
2070
|
+
logger$F.error(e);
|
|
2065
2071
|
} finally {
|
|
2066
2072
|
setCachedSearch(data);
|
|
2067
2073
|
setSearching((prevState) => prevState !== "error" ? "loaded" : prevState);
|
|
2068
2074
|
}
|
|
2069
2075
|
}, [handleCompanyDeepSearch, handleCompanyIndexSearch, searchResults, cachedSearch]);
|
|
2070
|
-
const fetchBusinessData = useCallback(async (company) => {
|
|
2076
|
+
const fetchBusinessData = useCallback(async (company, state) => {
|
|
2071
2077
|
if (!handleGetCompanyDataset || !handleRefreshCompanyDataset) {
|
|
2072
|
-
logger$
|
|
2078
|
+
logger$F.log("Missing handlers for fetchBusinessData");
|
|
2073
2079
|
return;
|
|
2074
2080
|
}
|
|
2075
2081
|
if (cachedBusiness && objectsDeepEqual({
|
|
@@ -2088,23 +2094,25 @@ function useBusinessData({
|
|
|
2088
2094
|
const businessData = isDataCompliant ? await handleGetCompanyDataset({
|
|
2089
2095
|
companyId: company.id,
|
|
2090
2096
|
country: "US"
|
|
2097
|
+
// state: state as StateCodeUS,
|
|
2091
2098
|
}) : await handleRefreshCompanyDataset({
|
|
2092
2099
|
companyId: company.id,
|
|
2093
2100
|
country: "US"
|
|
2101
|
+
// state: state as StateCodeUS,
|
|
2094
2102
|
});
|
|
2095
2103
|
setCachedBusiness(businessData);
|
|
2096
2104
|
return businessData;
|
|
2097
2105
|
} catch (e) {
|
|
2098
2106
|
setFetching("error");
|
|
2099
2107
|
setCachedBusiness(void 0);
|
|
2100
|
-
logger$
|
|
2108
|
+
logger$F.error(e);
|
|
2101
2109
|
} finally {
|
|
2102
2110
|
setFetching((prevState) => prevState !== "error" ? "loaded" : prevState);
|
|
2103
2111
|
}
|
|
2104
2112
|
}, [cachedBusiness, handleGetCompanyDataset, handleRefreshCompanyDataset]);
|
|
2105
2113
|
const verifyBusinessData = useCallback(async (data, tin) => {
|
|
2106
2114
|
if (!handleVerifyTin) {
|
|
2107
|
-
logger$
|
|
2115
|
+
logger$F.log("Missing handlers for verifyBusinessData");
|
|
2108
2116
|
return;
|
|
2109
2117
|
}
|
|
2110
2118
|
try {
|
|
@@ -2125,7 +2133,7 @@ function useBusinessData({
|
|
|
2125
2133
|
return matched;
|
|
2126
2134
|
} catch (e) {
|
|
2127
2135
|
setVerifying("error");
|
|
2128
|
-
logger$
|
|
2136
|
+
logger$F.error(e);
|
|
2129
2137
|
} finally {
|
|
2130
2138
|
setVerifying((prevState) => prevState !== "error" ? "loaded" : prevState);
|
|
2131
2139
|
}
|
|
@@ -2136,7 +2144,7 @@ function useBusinessData({
|
|
|
2136
2144
|
await (handleClearCompanyData == null ? void 0 : handleClearCompanyData());
|
|
2137
2145
|
} catch (e) {
|
|
2138
2146
|
setResettingTrustedData("error");
|
|
2139
|
-
logger$
|
|
2147
|
+
logger$F.error(e);
|
|
2140
2148
|
} finally {
|
|
2141
2149
|
setResettingTrustedData((prevState) => prevState !== "error" ? "loaded" : prevState);
|
|
2142
2150
|
}
|
|
@@ -2184,6 +2192,7 @@ var SettingNames = /* @__PURE__ */ ((SettingNames2) => {
|
|
|
2184
2192
|
SettingNames2["HideOnboardingIntroductionSoleProprietor"] = "hideOnboardingIntroductionSoleProprietor";
|
|
2185
2193
|
SettingNames2["TransferInstrumentLimit"] = "transferInstrumentLimit";
|
|
2186
2194
|
SettingNames2["ViewOnboardingGuidance"] = "viewOnboardingGuidance";
|
|
2195
|
+
SettingNames2["ShowServiceAgreementsFirst"] = "showServiceAgreementsFirst";
|
|
2187
2196
|
return SettingNames2;
|
|
2188
2197
|
})(SettingNames || {});
|
|
2189
2198
|
const SettingsContext = createContext(void 0);
|
|
@@ -2471,7 +2480,7 @@ const svgs = {
|
|
|
2471
2480
|
"trustly-logo": lazy(() => import("./trustly-logo-YJslAOYF.js"))
|
|
2472
2481
|
};
|
|
2473
2482
|
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"];
|
|
2474
|
-
const logger$
|
|
2483
|
+
const logger$E = createLogger("Icon");
|
|
2475
2484
|
const Svg = ({
|
|
2476
2485
|
className,
|
|
2477
2486
|
name,
|
|
@@ -2482,7 +2491,7 @@ const Svg = ({
|
|
|
2482
2491
|
const LazyLoadedSvg = svgs[name];
|
|
2483
2492
|
const viewBox = unscalableIconNames.includes(name) ? "0 0 16 16" : void 0;
|
|
2484
2493
|
if (!LazyLoadedSvg) {
|
|
2485
|
-
logger$
|
|
2494
|
+
logger$E.error(`No such svg: "${name}"`);
|
|
2486
2495
|
return null;
|
|
2487
2496
|
}
|
|
2488
2497
|
return jsx("span", {
|
|
@@ -2770,10 +2779,10 @@ function useFormRouterContext() {
|
|
|
2770
2779
|
}
|
|
2771
2780
|
return context;
|
|
2772
2781
|
}
|
|
2773
|
-
const logger$
|
|
2782
|
+
const logger$D = createLogger("Link");
|
|
2774
2783
|
const isValidLink = (href) => {
|
|
2775
2784
|
if (href === "#") {
|
|
2776
|
-
logger$
|
|
2785
|
+
logger$D.error('Links must include a valid href. If your href is "#", consider using a Button instead');
|
|
2777
2786
|
return false;
|
|
2778
2787
|
}
|
|
2779
2788
|
return true;
|
|
@@ -3049,6 +3058,7 @@ function getFieldProps(props, innerFormFields) {
|
|
|
3049
3058
|
var ExperimentNames = /* @__PURE__ */ ((ExperimentNames2) => {
|
|
3050
3059
|
ExperimentNames2["EnableCompanySearchFlow"] = "EnableCompanySearchFlow";
|
|
3051
3060
|
ExperimentNames2["EnableNewBusinessDetailsFlow"] = "EnableNewBusinessDetailsFlow";
|
|
3061
|
+
ExperimentNames2["EnableNewAddressComponent"] = "EnableNewAddressComponent";
|
|
3052
3062
|
ExperimentNames2["EnableNewEntryFlow"] = "EnableNewEntryFlow";
|
|
3053
3063
|
ExperimentNames2["AllowOrganizationSettlorWithExemptionReason"] = "AllowOrganizationSettlorWithExemptionReason";
|
|
3054
3064
|
ExperimentNames2["AllowMoreRolesForMainRootTrustee"] = "AllowMoreRolesForMainRootTrustee";
|
|
@@ -3062,6 +3072,8 @@ var ExperimentNames = /* @__PURE__ */ ((ExperimentNames2) => {
|
|
|
3062
3072
|
ExperimentNames2["EnableAgeVerification"] = "EnableAgeVerification";
|
|
3063
3073
|
ExperimentNames2["PreserveMismatchedInitialValues"] = "PreserveMismatchedInitialValues";
|
|
3064
3074
|
ExperimentNames2["StrictNameAndAddressValidationV4"] = "StrictNameAndAddressValidationV4";
|
|
3075
|
+
ExperimentNames2["EnableIdentificationNationalityCrossBorderAssociateCheck"] = "EnableIdentificationNationalityCrossBorderAssociateCheck";
|
|
3076
|
+
ExperimentNames2["EnableAUGovernmentalOrganizationSkipRegistrationNumber"] = "EnableAUGovernmentalOrganizationSkipRegistrationNumber";
|
|
3065
3077
|
return ExperimentNames2;
|
|
3066
3078
|
})(ExperimentNames || {});
|
|
3067
3079
|
const ON_CHANGE_DEBOUNCE_DURATION = 200;
|
|
@@ -3122,7 +3134,7 @@ const useSetting = (settingName) => {
|
|
|
3122
3134
|
} = context;
|
|
3123
3135
|
return getSetting(settingName);
|
|
3124
3136
|
};
|
|
3125
|
-
const logger$
|
|
3137
|
+
const logger$C = createLogger("useAllowedCountries");
|
|
3126
3138
|
const useAllowedCountries = () => {
|
|
3127
3139
|
const acceptedCountries = useSetting("acceptedCountries");
|
|
3128
3140
|
const {
|
|
@@ -3131,7 +3143,7 @@ const useAllowedCountries = () => {
|
|
|
3131
3143
|
const [allowedCountries, setAllowedCountries] = useState(acceptedCountries);
|
|
3132
3144
|
useEffect(() => {
|
|
3133
3145
|
if (acceptedCountries !== void 0) return;
|
|
3134
|
-
getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$
|
|
3146
|
+
getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$C.error);
|
|
3135
3147
|
}, [acceptedCountries]);
|
|
3136
3148
|
return allowedCountries;
|
|
3137
3149
|
};
|
|
@@ -3490,7 +3502,7 @@ function reducer({
|
|
|
3490
3502
|
}
|
|
3491
3503
|
};
|
|
3492
3504
|
}
|
|
3493
|
-
const logger$
|
|
3505
|
+
const logger$B = createLogger("useAsyncValidator");
|
|
3494
3506
|
const useAsyncValidator = (asyncRules) => {
|
|
3495
3507
|
const [asyncValidationResults, setAsyncValidationResults] = useState({});
|
|
3496
3508
|
const clearAsyncValidationResults = useCallback(() => setAsyncValidationResults({}), []);
|
|
@@ -3511,7 +3523,7 @@ const useAsyncValidator = (asyncRules) => {
|
|
|
3511
3523
|
hasError: !isValid
|
|
3512
3524
|
}])
|
|
3513
3525
|
});
|
|
3514
|
-
}).catch(logger$
|
|
3526
|
+
}).catch(logger$B.error);
|
|
3515
3527
|
}, [asyncRules, clearAsyncValidationResults]);
|
|
3516
3528
|
return {
|
|
3517
3529
|
asyncValidationResults,
|
|
@@ -3932,6 +3944,14 @@ const Field = ({
|
|
|
3932
3944
|
})
|
|
3933
3945
|
});
|
|
3934
3946
|
};
|
|
3947
|
+
const useDebounce = (value, delay) => {
|
|
3948
|
+
const [debouncedValue, setDebouncedValue] = useState(value);
|
|
3949
|
+
useEffect(() => {
|
|
3950
|
+
const handler = setTimeout(() => setDebouncedValue(value), delay);
|
|
3951
|
+
return () => clearTimeout(handler);
|
|
3952
|
+
}, [value, delay]);
|
|
3953
|
+
return debouncedValue;
|
|
3954
|
+
};
|
|
3935
3955
|
const getScrollParent = (node) => {
|
|
3936
3956
|
if (!node) return null;
|
|
3937
3957
|
const isElement = node instanceof HTMLElement;
|
|
@@ -3957,32 +3977,6 @@ const Tag = ({
|
|
|
3957
3977
|
children
|
|
3958
3978
|
});
|
|
3959
3979
|
};
|
|
3960
|
-
const adyenKycDropdown = "adyen-kyc-dropdown";
|
|
3961
|
-
const adyenKycDropdownButton = "adyen-kyc-dropdown-button";
|
|
3962
|
-
const adyenKycDropdownButtonActive = "adyen-kyc-dropdown-button--active";
|
|
3963
|
-
const adyenKycFilterInput = "adyen-kyc-filter-input";
|
|
3964
|
-
const adyenKycDropdownList = "adyen-kyc-dropdown-list";
|
|
3965
|
-
const adyenKycDropdownListTransformer = "adyen-kyc-dropdown-list__transformer";
|
|
3966
|
-
const adyenKycDropdownListActive = "adyen-kyc-dropdown-list--active";
|
|
3967
|
-
const adyenKycDropdownElement = "adyen-kyc-dropdown-element";
|
|
3968
|
-
const styles$6 = {
|
|
3969
|
-
"adyen-kyc-dropdown": "adyen-kyc-dropdown",
|
|
3970
|
-
adyenKycDropdown,
|
|
3971
|
-
"adyen-kyc-dropdown-button": "adyen-kyc-dropdown-button",
|
|
3972
|
-
adyenKycDropdownButton,
|
|
3973
|
-
"adyen-kyc-dropdown-button--active": "adyen-kyc-dropdown-button--active",
|
|
3974
|
-
adyenKycDropdownButtonActive,
|
|
3975
|
-
"adyen-kyc-filter-input": "adyen-kyc-filter-input",
|
|
3976
|
-
adyenKycFilterInput,
|
|
3977
|
-
"adyen-kyc-dropdown-list": "adyen-kyc-dropdown-list",
|
|
3978
|
-
adyenKycDropdownList,
|
|
3979
|
-
"adyen-kyc-dropdown-list__transformer": "adyen-kyc-dropdown-list__transformer",
|
|
3980
|
-
adyenKycDropdownListTransformer,
|
|
3981
|
-
"adyen-kyc-dropdown-list--active": "adyen-kyc-dropdown-list--active",
|
|
3982
|
-
adyenKycDropdownListActive,
|
|
3983
|
-
"adyen-kyc-dropdown-element": "adyen-kyc-dropdown-element",
|
|
3984
|
-
adyenKycDropdownElement
|
|
3985
|
-
};
|
|
3986
3980
|
function SelectButtonElement({
|
|
3987
3981
|
filterable,
|
|
3988
3982
|
isMulti,
|
|
@@ -4018,6 +4012,7 @@ function SelectButton({
|
|
|
4018
4012
|
isMulti,
|
|
4019
4013
|
id,
|
|
4020
4014
|
isSearch,
|
|
4015
|
+
hideSearchIcon = false,
|
|
4021
4016
|
loading,
|
|
4022
4017
|
textFilter
|
|
4023
4018
|
}) {
|
|
@@ -4030,10 +4025,8 @@ function SelectButton({
|
|
|
4030
4025
|
"aria-haspopup": "listbox",
|
|
4031
4026
|
className: cx({
|
|
4032
4027
|
"adyen-kyc-dropdown-button": true,
|
|
4033
|
-
[styles$6["adyen-kyc-dropdown-button"]]: true,
|
|
4034
4028
|
"adyen-kyc-dropdown-button--readonly": readonly,
|
|
4035
4029
|
"adyen-kyc-dropdown-button--active": showList,
|
|
4036
|
-
[styles$6["adyen-kyc-dropdown-button--active"]]: showList,
|
|
4037
4030
|
"adyen-kyc-dropdown-button--invalid": isInvalid,
|
|
4038
4031
|
"adyen-kyc-dropdown-field--valid": isValid,
|
|
4039
4032
|
"adyen-kyc-dropdown-button-search": isSearch
|
|
@@ -4062,6 +4055,7 @@ function SelectButton({
|
|
|
4062
4055
|
filterable,
|
|
4063
4056
|
onInput,
|
|
4064
4057
|
isSearch,
|
|
4058
|
+
hideSearchIcon,
|
|
4065
4059
|
loading,
|
|
4066
4060
|
textFilter
|
|
4067
4061
|
})
|
|
@@ -4076,6 +4070,7 @@ const SelectButtonContentSingle = ({
|
|
|
4076
4070
|
filterable,
|
|
4077
4071
|
onInput,
|
|
4078
4072
|
isSearch,
|
|
4073
|
+
hideSearchIcon = false,
|
|
4079
4074
|
loading,
|
|
4080
4075
|
textFilter
|
|
4081
4076
|
}) => {
|
|
@@ -4084,17 +4079,17 @@ const SelectButtonContentSingle = ({
|
|
|
4084
4079
|
children: [(activeSingle == null ? void 0 : activeSingle.icon) && jsx("span", {
|
|
4085
4080
|
className: "adyen-kyc-dropdown-button__icon",
|
|
4086
4081
|
children: activeSingle.icon
|
|
4087
|
-
}), isSearch && jsx(Icon, {
|
|
4082
|
+
}), isSearch && !hideSearchIcon && jsx(Icon, {
|
|
4088
4083
|
name: "search",
|
|
4089
4084
|
className: "adyen-kyc-dropdown-button-search__icon"
|
|
4090
4085
|
}), jsx("span", {
|
|
4091
4086
|
className: cx("adyen-kyc-dropdown-button__text", {
|
|
4092
|
-
"adyen-kyc-dropdown-button__text--placeholder": !activeSingle
|
|
4087
|
+
"adyen-kyc-dropdown-button__text--placeholder": !activeSingle && placeholder
|
|
4093
4088
|
}),
|
|
4094
4089
|
children: (activeSingle == null ? void 0 : activeSingle.selectedOptionName) || (activeSingle == null ? void 0 : activeSingle.name) || textFilter || placeholder
|
|
4095
4090
|
})]
|
|
4096
4091
|
}) : jsxs(Fragment, {
|
|
4097
|
-
children: [isSearch && jsx(Icon, {
|
|
4092
|
+
children: [isSearch && !hideSearchIcon && jsx(Icon, {
|
|
4098
4093
|
name: "search",
|
|
4099
4094
|
className: "adyen-kyc-dropdown-button-search__icon"
|
|
4100
4095
|
}), jsx("input", {
|
|
@@ -4103,7 +4098,7 @@ const SelectButtonContentSingle = ({
|
|
|
4103
4098
|
"aria-expanded": showList,
|
|
4104
4099
|
"aria-owns": selectListId,
|
|
4105
4100
|
autoComplete: "off",
|
|
4106
|
-
className: cx("adyen-kyc-filter-input"
|
|
4101
|
+
className: cx("adyen-kyc-filter-input"),
|
|
4107
4102
|
onInput,
|
|
4108
4103
|
placeholder,
|
|
4109
4104
|
ref: filterInputRef,
|
|
@@ -4191,7 +4186,7 @@ const SelectListItem = ({
|
|
|
4191
4186
|
}) => jsx("li", {
|
|
4192
4187
|
"aria-disabled": !!item.disabled,
|
|
4193
4188
|
"aria-selected": selected,
|
|
4194
|
-
className: cx(["adyen-kyc-dropdown-element",
|
|
4189
|
+
className: cx(["adyen-kyc-dropdown-element", {
|
|
4195
4190
|
"adyen-kyc-dropdown-element--active": selected,
|
|
4196
4191
|
"adyen-kyc-dropdown-element--disabled": !!item.disabled,
|
|
4197
4192
|
"adyen-kyc-dropdown-multi-element": isMulti,
|
|
@@ -4322,9 +4317,7 @@ function SelectList({
|
|
|
4322
4317
|
test: true,
|
|
4323
4318
|
"adyen-kyc-dropdown-list--above": showAbove,
|
|
4324
4319
|
"adyen-kyc-dropdown-list": true,
|
|
4325
|
-
|
|
4326
|
-
"adyen-kyc-dropdown-list--active": showList,
|
|
4327
|
-
[styles$6["adyen-kyc-dropdown-list--active"]]: showList
|
|
4320
|
+
"adyen-kyc-dropdown-list--active": showList
|
|
4328
4321
|
}),
|
|
4329
4322
|
id: props.selectListId,
|
|
4330
4323
|
role: "listbox",
|
|
@@ -4356,7 +4349,7 @@ const Select = ({
|
|
|
4356
4349
|
name,
|
|
4357
4350
|
isInvalid = false,
|
|
4358
4351
|
isValid,
|
|
4359
|
-
placeholder,
|
|
4352
|
+
placeholder = "",
|
|
4360
4353
|
isMulti,
|
|
4361
4354
|
uniqueId,
|
|
4362
4355
|
showSelectedItemsAsTags = false,
|
|
@@ -4366,21 +4359,21 @@ const Select = ({
|
|
|
4366
4359
|
loading = false,
|
|
4367
4360
|
getSearchItem,
|
|
4368
4361
|
searchText,
|
|
4362
|
+
onSearchTextChange,
|
|
4369
4363
|
showSearchList
|
|
4370
4364
|
}) => {
|
|
4371
4365
|
const filterInputRef = useRef(null);
|
|
4372
4366
|
const selectContainerRef = useRef(null);
|
|
4373
4367
|
const toggleButtonRef = useRef(null);
|
|
4374
4368
|
const selectListRef = useRef(null);
|
|
4375
|
-
const [textFilter, setTextFilter] = useState(
|
|
4369
|
+
const [textFilter, setTextFilter] = useState(searchText);
|
|
4376
4370
|
const [isShowList, setIsShowList] = useState(false);
|
|
4377
4371
|
const selectListId = useMemo(() => `select-${uuidv4()}`, []);
|
|
4378
4372
|
const active = items.filter((i) => !isMulti ? i.id === selected : selected == null ? void 0 : selected.includes(i.id)) || [];
|
|
4379
4373
|
const [isShowListAbove, setIsShowListAbove] = useState(false);
|
|
4380
4374
|
const [scrollParent, setScrollParent] = useState(null);
|
|
4381
|
-
const debouncedOnSearch = useCallback(debounce(onSearch, 500), [onSearch]);
|
|
4382
4375
|
const closeList = () => {
|
|
4383
|
-
setTextFilter(null);
|
|
4376
|
+
if (!onSearchTextChange) setTextFilter(null);
|
|
4384
4377
|
setIsShowList(false);
|
|
4385
4378
|
if (toggleButtonRef.current) toggleButtonRef.current.focus();
|
|
4386
4379
|
};
|
|
@@ -4491,11 +4484,19 @@ const Select = ({
|
|
|
4491
4484
|
const {
|
|
4492
4485
|
value
|
|
4493
4486
|
} = e.target;
|
|
4494
|
-
if (
|
|
4495
|
-
|
|
4487
|
+
if (onSearchTextChange) {
|
|
4488
|
+
onSearchTextChange == null ? void 0 : onSearchTextChange(value);
|
|
4489
|
+
setTextFilter(value);
|
|
4490
|
+
} else {
|
|
4491
|
+
setTextFilter(value.toLowerCase());
|
|
4496
4492
|
}
|
|
4497
|
-
setTextFilter(value.toLowerCase());
|
|
4498
4493
|
};
|
|
4494
|
+
const debouncedTextFilter = useDebounce(textFilter, 500);
|
|
4495
|
+
useEffect(() => {
|
|
4496
|
+
if (isSearch && (debouncedTextFilter == null ? void 0 : debouncedTextFilter.length) > 2) {
|
|
4497
|
+
onSearch(debouncedTextFilter);
|
|
4498
|
+
}
|
|
4499
|
+
}, [debouncedTextFilter]);
|
|
4499
4500
|
const toggleList = (e) => {
|
|
4500
4501
|
e.preventDefault();
|
|
4501
4502
|
if (isShowList) {
|
|
@@ -4505,9 +4506,9 @@ const Select = ({
|
|
|
4505
4506
|
}
|
|
4506
4507
|
};
|
|
4507
4508
|
useEffect(() => {
|
|
4508
|
-
if (
|
|
4509
|
-
setTextFilter("");
|
|
4510
|
-
}
|
|
4509
|
+
if (!onSearchTextChange) {
|
|
4510
|
+
if (resetSearch) setTextFilter("");
|
|
4511
|
+
} else if (resetSearch && !searchText) setTextFilter("");
|
|
4511
4512
|
}, [resetSearch]);
|
|
4512
4513
|
useEffect(() => {
|
|
4513
4514
|
setTextFilter(searchText);
|
|
@@ -4527,7 +4528,7 @@ const Select = ({
|
|
|
4527
4528
|
};
|
|
4528
4529
|
}, []);
|
|
4529
4530
|
return jsxs("div", {
|
|
4530
|
-
className: cx(["adyen-kyc-dropdown",
|
|
4531
|
+
className: cx(["adyen-kyc-dropdown", className, ...classNameModifiers.map((m) => `adyen-kyc-dropdown--${m}`)]),
|
|
4531
4532
|
ref: selectContainerRef,
|
|
4532
4533
|
onClick: (e) => {
|
|
4533
4534
|
e.stopPropagation();
|
|
@@ -4555,6 +4556,7 @@ const Select = ({
|
|
|
4555
4556
|
isMulti,
|
|
4556
4557
|
showSelectedItemsAsTags,
|
|
4557
4558
|
isSearch,
|
|
4559
|
+
hideSearchIcon: !!onSearchTextChange,
|
|
4558
4560
|
loading,
|
|
4559
4561
|
textFilter
|
|
4560
4562
|
}), jsx(SelectList, {
|
|
@@ -7448,7 +7450,7 @@ const deriveInputState = (isValid, isFocused, isDisabled, isOptional, hasNullish
|
|
|
7448
7450
|
};
|
|
7449
7451
|
};
|
|
7450
7452
|
const MISMATCH_ANIMATION_NAME = "mismatchShake";
|
|
7451
|
-
const logger$
|
|
7453
|
+
const logger$A = createLogger("MaskedInputText");
|
|
7452
7454
|
const MaskedInputText = ({
|
|
7453
7455
|
value,
|
|
7454
7456
|
onInput,
|
|
@@ -7495,7 +7497,7 @@ const MaskedInputText = ({
|
|
|
7495
7497
|
};
|
|
7496
7498
|
useEffect(() => {
|
|
7497
7499
|
if (!mask) {
|
|
7498
|
-
logger$
|
|
7500
|
+
logger$A.warn("`mask` is undefined. No masking of input will take place.");
|
|
7499
7501
|
}
|
|
7500
7502
|
}, [mask]);
|
|
7501
7503
|
const getMaskResult = useCallback((pureValue) => {
|
|
@@ -7520,13 +7522,13 @@ const MaskedInputText = ({
|
|
|
7520
7522
|
return;
|
|
7521
7523
|
}
|
|
7522
7524
|
if (preserveMismatchingInitialValue) {
|
|
7523
|
-
logger$
|
|
7525
|
+
logger$A.warn(`Value received "${value}" does not match mask`, maskResult, `
|
|
7524
7526
|
Preserving mismatched initial value until user input.`);
|
|
7525
7527
|
setPreservingMismatchedValue(true);
|
|
7526
7528
|
return;
|
|
7527
7529
|
}
|
|
7528
7530
|
const fallback = displayValueToPure(maskResult.partialDisplayValue);
|
|
7529
|
-
logger$
|
|
7531
|
+
logger$A.warn(`Value received "${value}" does not match mask`, maskResult, `
|
|
7530
7532
|
Falling back to partially valid value "${fallback}"`);
|
|
7531
7533
|
onInput(fallback);
|
|
7532
7534
|
}
|
|
@@ -10967,7 +10969,7 @@ const ID_NUMBER_EXEMPT_COUNTRIES = [CountryCodes.Canada, CountryCodes.PuertoRico
|
|
|
10967
10969
|
const ID_NUMBER_VERIFICATION_COUNTRIES = [CountryCodes.PuertoRico, CountryCodes.UnitedStates];
|
|
10968
10970
|
const COUNTRIES_WHICH_USE_MULTIPLE_IDENTITY_TYPES = [CountryCodes.HongKong, CountryCodes.Australia, CountryCodes.NewZealand];
|
|
10969
10971
|
const ID_NUMBER_REQUIRED_FOR_DIRECTOR_COUNTRIES = [CountryCodes.Singapore];
|
|
10970
|
-
const NATIONALITY_REQUIRED_FOR_COUNTRIES = [CountryCodes.Singapore];
|
|
10972
|
+
const NATIONALITY_REQUIRED_FOR_COUNTRIES = [CountryCodes.Singapore, CountryCodes.HongKong];
|
|
10971
10973
|
const CONTACTS_REQUIRED_FOR_COUNTRIES = [CountryCodes.NewZealand];
|
|
10972
10974
|
const JOB_TITLE_REQUIRED_FOR_COUNTRIES = [CountryCodes.NewZealand];
|
|
10973
10975
|
const ISSUER_REQUIRED_FOR_COUNTRIES = [CountryCodes.Australia];
|
|
@@ -10978,7 +10980,8 @@ const rules$3 = ({
|
|
|
10978
10980
|
country,
|
|
10979
10981
|
taskType,
|
|
10980
10982
|
isEmbeddedDropin,
|
|
10981
|
-
isExperimentEnabled = () => false
|
|
10983
|
+
isExperimentEnabled = () => false,
|
|
10984
|
+
rootLegalEntity
|
|
10982
10985
|
}) => ({
|
|
10983
10986
|
isDirectorIdNumberRequiredForCountry: () => {
|
|
10984
10987
|
var _a, _b, _c, _d, _e;
|
|
@@ -11043,8 +11046,13 @@ const rules$3 = ({
|
|
|
11043
11046
|
}
|
|
11044
11047
|
},
|
|
11045
11048
|
nationalityIfRequiredForRole: () => {
|
|
11046
|
-
var _a;
|
|
11047
|
-
|
|
11049
|
+
var _a, _b;
|
|
11050
|
+
const enableIdentificationNationalityCrossBorderAssociateCheck = isExperimentEnabled("EnableIdentificationNationalityCrossBorderAssociateCheck");
|
|
11051
|
+
const rootLegalEntityCountry = (_a = rootLegalEntity == null ? void 0 : rootLegalEntity.organization) == null ? void 0 : _a.registeredAddress.country;
|
|
11052
|
+
if (enableIdentificationNationalityCrossBorderAssociateCheck && rootLegalEntityCountry && NATIONALITY_REQUIRED_FOR_COUNTRIES.includes(rootLegalEntityCountry)) {
|
|
11053
|
+
return REQUIRED;
|
|
11054
|
+
}
|
|
11055
|
+
if (NATIONALITY_REQUIRED_FOR_COUNTRIES.includes(country) || ((_b = data == null ? void 0 : data.personalDetails) == null ? void 0 : _b.nationality)) {
|
|
11048
11056
|
return REQUIRED;
|
|
11049
11057
|
}
|
|
11050
11058
|
},
|
|
@@ -11084,7 +11092,7 @@ const accountHolderValidationRules = {
|
|
|
11084
11092
|
}
|
|
11085
11093
|
};
|
|
11086
11094
|
const accountHolderFields = ["accountHolder"];
|
|
11087
|
-
const logger$
|
|
11095
|
+
const logger$z = createLogger("AccountHolder");
|
|
11088
11096
|
function getAvailableAccountHolderOptions(legalEntityType, isChangeOfLegalEntityTypeAllowed, isTrustFlowEnabled, isSoleProprietorshipAllowed, isChangeToMyNameAllowed) {
|
|
11089
11097
|
switch (legalEntityType) {
|
|
11090
11098
|
case LegalEntityType.ORGANIZATION: {
|
|
@@ -11094,7 +11102,7 @@ function getAvailableAccountHolderOptions(legalEntityType, isChangeOfLegalEntity
|
|
|
11094
11102
|
return [...isChangeToMyNameAllowed ? ["myName"] : [], ...isChangeOfLegalEntityTypeAllowed ? ["theCompanyIWorkFor"] : [], ...isTrustFlowEnabled ? ["aTrust"] : [], ...isSoleProprietorshipAllowed ? ["mySoleProprietorName"] : []];
|
|
11095
11103
|
}
|
|
11096
11104
|
default:
|
|
11097
|
-
logger$
|
|
11105
|
+
logger$z.error(`No available account holder options for legal entity type '${legalEntityType}'`);
|
|
11098
11106
|
return [];
|
|
11099
11107
|
}
|
|
11100
11108
|
}
|
|
@@ -11662,7 +11670,7 @@ function Dropzone(props) {
|
|
|
11662
11670
|
})]
|
|
11663
11671
|
});
|
|
11664
11672
|
}
|
|
11665
|
-
const logger$
|
|
11673
|
+
const logger$y = createLogger("TextArea");
|
|
11666
11674
|
function TextArea(props) {
|
|
11667
11675
|
const {
|
|
11668
11676
|
classNameModifiers,
|
|
@@ -11683,7 +11691,7 @@ function TextArea(props) {
|
|
|
11683
11691
|
} = useI18nContext();
|
|
11684
11692
|
const [value, setValue] = useState("");
|
|
11685
11693
|
if (Object.prototype.hasOwnProperty.call(props, "onChange")) {
|
|
11686
|
-
logger$
|
|
11694
|
+
logger$y.error("Error: Form fields that rely on InputBase may not have an onChange property");
|
|
11687
11695
|
}
|
|
11688
11696
|
const handleInput = (e) => {
|
|
11689
11697
|
var _a;
|
|
@@ -12134,7 +12142,7 @@ function useIsElementVisible(ref, fallback = true) {
|
|
|
12134
12142
|
}, [ref]);
|
|
12135
12143
|
return isOnScreen;
|
|
12136
12144
|
}
|
|
12137
|
-
const logger$
|
|
12145
|
+
const logger$x = createLogger("SearchAddress");
|
|
12138
12146
|
const SearchAddress = ({
|
|
12139
12147
|
data,
|
|
12140
12148
|
legalEntityId,
|
|
@@ -12178,7 +12186,7 @@ const SearchAddress = ({
|
|
|
12178
12186
|
const response = await handleFindAddress(selectedAddressId);
|
|
12179
12187
|
autocompleteAddressForm(response);
|
|
12180
12188
|
} catch (e) {
|
|
12181
|
-
logger$
|
|
12189
|
+
logger$x.error(e);
|
|
12182
12190
|
}
|
|
12183
12191
|
};
|
|
12184
12192
|
const onDrilldown = async (selectedAddress) => {
|
|
@@ -12190,7 +12198,7 @@ const SearchAddress = ({
|
|
|
12190
12198
|
}, legalEntityId);
|
|
12191
12199
|
setItems((response == null ? void 0 : response.results) || []);
|
|
12192
12200
|
} catch (e) {
|
|
12193
|
-
logger$
|
|
12201
|
+
logger$x.error(e);
|
|
12194
12202
|
}
|
|
12195
12203
|
};
|
|
12196
12204
|
const onChange = (e) => {
|
|
@@ -12210,7 +12218,7 @@ const SearchAddress = ({
|
|
|
12210
12218
|
}
|
|
12211
12219
|
setLoading(false);
|
|
12212
12220
|
};
|
|
12213
|
-
const
|
|
12221
|
+
const formatAddressItem2 = (item) => {
|
|
12214
12222
|
if (item.description.includes("Addresses")) {
|
|
12215
12223
|
const splittedDescription = item.description.split(" - ");
|
|
12216
12224
|
if (splittedDescription.length === 1) {
|
|
@@ -12239,18 +12247,18 @@ const SearchAddress = ({
|
|
|
12239
12247
|
country: data.country
|
|
12240
12248
|
}, legalEntityId);
|
|
12241
12249
|
if (response == null ? void 0 : response.results) {
|
|
12242
|
-
const modifiedItems = response.results.map(
|
|
12250
|
+
const modifiedItems = response.results.map(formatAddressItem2);
|
|
12243
12251
|
setItems(modifiedItems);
|
|
12244
12252
|
} else {
|
|
12245
12253
|
setItems([]);
|
|
12246
12254
|
}
|
|
12247
12255
|
} catch (e) {
|
|
12248
|
-
logger$
|
|
12256
|
+
logger$x.error(e);
|
|
12249
12257
|
}
|
|
12250
12258
|
setLoading(false);
|
|
12251
12259
|
}
|
|
12252
12260
|
};
|
|
12253
|
-
const
|
|
12261
|
+
const getFormattedText2 = (highlightItems, text) => {
|
|
12254
12262
|
const formattedText = [];
|
|
12255
12263
|
let lastHighlightIndex = 0;
|
|
12256
12264
|
if (highlightItems[0] === "") {
|
|
@@ -12276,7 +12284,7 @@ const SearchAddress = ({
|
|
|
12276
12284
|
}
|
|
12277
12285
|
return formattedText;
|
|
12278
12286
|
};
|
|
12279
|
-
const
|
|
12287
|
+
const getHighlightedText2 = ({
|
|
12280
12288
|
text,
|
|
12281
12289
|
highlight,
|
|
12282
12290
|
description
|
|
@@ -12290,11 +12298,11 @@ const SearchAddress = ({
|
|
|
12290
12298
|
}
|
|
12291
12299
|
} else {
|
|
12292
12300
|
const highlightItems = highlight.split(";");
|
|
12293
|
-
formattedText =
|
|
12301
|
+
formattedText = getFormattedText2(highlightItems[0].split(","), text);
|
|
12294
12302
|
if (highlightItems.length > 1) {
|
|
12295
12303
|
formattedText.push(`, `);
|
|
12296
12304
|
formattedText.push(jsx(Fragment, {
|
|
12297
|
-
children:
|
|
12305
|
+
children: getFormattedText2(highlightItems[1].split(","), description)
|
|
12298
12306
|
}));
|
|
12299
12307
|
} else if (description) {
|
|
12300
12308
|
formattedText.push(`, ${description}`);
|
|
@@ -12302,10 +12310,10 @@ const SearchAddress = ({
|
|
|
12302
12310
|
}
|
|
12303
12311
|
return formattedText;
|
|
12304
12312
|
};
|
|
12305
|
-
const
|
|
12313
|
+
const generateSearchListItem2 = (item) => jsxs(Fragment, {
|
|
12306
12314
|
children: [jsx("span", {
|
|
12307
12315
|
className: "adyen-kyc-dropdown-search-element__description",
|
|
12308
|
-
children:
|
|
12316
|
+
children: getHighlightedText2(item)
|
|
12309
12317
|
}), item.addressAmount && jsxs("div", {
|
|
12310
12318
|
className: "adyen-kyc-dropdown-search-element__addresses",
|
|
12311
12319
|
children: [item.addressAmount, " ", jsxs("span", {
|
|
@@ -12336,7 +12344,7 @@ const SearchAddress = ({
|
|
|
12336
12344
|
resetSearch,
|
|
12337
12345
|
onSearch: getSearchItems,
|
|
12338
12346
|
loading,
|
|
12339
|
-
getSearchItem:
|
|
12347
|
+
getSearchItem: generateSearchListItem2,
|
|
12340
12348
|
isInvalid: false,
|
|
12341
12349
|
searchText,
|
|
12342
12350
|
showSearchList
|
|
@@ -12623,7 +12631,7 @@ const countrySpecificFormatters = {
|
|
|
12623
12631
|
};
|
|
12624
12632
|
const addressValidationRules = (country) => {
|
|
12625
12633
|
var _a, _b;
|
|
12626
|
-
const postalCodeFormat = (_b = (_a = countrySpecificFormatters[country]) == null ? void 0 : _a.postalCode) == null ? void 0 : _b.format;
|
|
12634
|
+
const postalCodeFormat = country ? (_b = (_a = countrySpecificFormatters[country]) == null ? void 0 : _a.postalCode) == null ? void 0 : _b.format : void 0;
|
|
12627
12635
|
return {
|
|
12628
12636
|
address: {
|
|
12629
12637
|
modes: ["blur"],
|
|
@@ -12633,7 +12641,7 @@ const addressValidationRules = (country) => {
|
|
|
12633
12641
|
postalCode: {
|
|
12634
12642
|
modes: ["blur"],
|
|
12635
12643
|
validate: (val) => {
|
|
12636
|
-
const pattern = postalCodePatterns[country];
|
|
12644
|
+
const pattern = country ? postalCodePatterns[country] : void 0;
|
|
12637
12645
|
return pattern ? !!val && pattern.test(val) : !!val;
|
|
12638
12646
|
},
|
|
12639
12647
|
errorMessage: postalCodeFormat ? {
|
|
@@ -12662,7 +12670,7 @@ const addressValidationRules = (country) => {
|
|
|
12662
12670
|
};
|
|
12663
12671
|
const addressValidationRulesV4 = (country, i18n) => {
|
|
12664
12672
|
var _a, _b;
|
|
12665
|
-
const postalCodeFormat = (_b = (_a = countrySpecificFormatters[country]) == null ? void 0 : _a.postalCode) == null ? void 0 : _b.format;
|
|
12673
|
+
const postalCodeFormat = country ? (_b = (_a = countrySpecificFormatters[country]) == null ? void 0 : _a.postalCode) == null ? void 0 : _b.format : void 0;
|
|
12666
12674
|
const MIN_LENGTH_3 = 3;
|
|
12667
12675
|
return {
|
|
12668
12676
|
address: [{
|
|
@@ -12691,7 +12699,7 @@ const addressValidationRulesV4 = (country, i18n) => {
|
|
|
12691
12699
|
postalCode: {
|
|
12692
12700
|
modes: ["blur"],
|
|
12693
12701
|
validate: (val) => {
|
|
12694
|
-
const pattern = postalCodePatterns[country];
|
|
12702
|
+
const pattern = country ? postalCodePatterns[country] : void 0;
|
|
12695
12703
|
return pattern ? !!val && pattern.test(val) : !!val;
|
|
12696
12704
|
},
|
|
12697
12705
|
errorMessage: postalCodeFormat ? {
|
|
@@ -12786,8 +12794,8 @@ function Address(props) {
|
|
|
12786
12794
|
});
|
|
12787
12795
|
const datasetUtils = datasetUtilities(i18n.locale);
|
|
12788
12796
|
const requiredFields = (requiredFieldsProp == null ? void 0 : requiredFieldsProp.includes("stateOrProvince")) || (dataProp == null ? void 0 : dataProp.country) && COUNTRIES_WITH_STATES_DATASET.includes(dataProp == null ? void 0 : dataProp.country) ? getAddressSchemaForCountry(dataProp == null ? void 0 : dataProp.country) : getAddressSchemaForCountry(dataProp == null ? void 0 : dataProp.country).filter((ad) => ad !== "stateOrProvince");
|
|
12789
|
-
const rules2 = useMemo(() =>
|
|
12790
|
-
const rulesV4 = useMemo(() =>
|
|
12797
|
+
const rules2 = useMemo(() => addressValidationRules(dataProp == null ? void 0 : dataProp.country), [dataProp == null ? void 0 : dataProp.country]);
|
|
12798
|
+
const rulesV4 = useMemo(() => addressValidationRulesV4(dataProp == null ? void 0 : dataProp.country, i18n), [dataProp == null ? void 0 : dataProp.country, i18n]);
|
|
12791
12799
|
const {
|
|
12792
12800
|
data,
|
|
12793
12801
|
errors,
|
|
@@ -13016,6 +13024,460 @@ Address.defaultProps = {
|
|
|
13016
13024
|
requiredFields: ADDRESS_SCHEMA,
|
|
13017
13025
|
countryCode: null
|
|
13018
13026
|
};
|
|
13027
|
+
const logger$w = createLogger("AddressFieldContainer");
|
|
13028
|
+
const formatAddressItem = (item) => {
|
|
13029
|
+
if (item.description.includes("Addresses")) {
|
|
13030
|
+
const splittedDescription = item.description.split(" - ");
|
|
13031
|
+
if (splittedDescription.length === 1) {
|
|
13032
|
+
return {
|
|
13033
|
+
...item,
|
|
13034
|
+
description: "",
|
|
13035
|
+
addressAmount: splittedDescription[0].replace("Addresses", "")
|
|
13036
|
+
};
|
|
13037
|
+
}
|
|
13038
|
+
return {
|
|
13039
|
+
...item,
|
|
13040
|
+
description: splittedDescription[0],
|
|
13041
|
+
addressAmount: splittedDescription[1].replace("Addresses", "")
|
|
13042
|
+
};
|
|
13043
|
+
}
|
|
13044
|
+
return item;
|
|
13045
|
+
};
|
|
13046
|
+
const getFormattedText = (highlightItems, text) => {
|
|
13047
|
+
const formattedText = [];
|
|
13048
|
+
let lastHighlightIndex = 0;
|
|
13049
|
+
if (highlightItems[0] === "") {
|
|
13050
|
+
return [text];
|
|
13051
|
+
}
|
|
13052
|
+
highlightItems.forEach((highlightValue) => {
|
|
13053
|
+
const highlightRange = highlightValue.split("-");
|
|
13054
|
+
const highlightInit = parseInt(highlightRange[0]);
|
|
13055
|
+
const highlightEnd = parseInt(highlightRange[1]);
|
|
13056
|
+
if (lastHighlightIndex < highlightInit) {
|
|
13057
|
+
const remain = text.substring(lastHighlightIndex, highlightInit);
|
|
13058
|
+
formattedText.push(`${remain}`);
|
|
13059
|
+
}
|
|
13060
|
+
const boldText = text.substring(highlightInit, highlightEnd);
|
|
13061
|
+
formattedText.push(jsx("span", {
|
|
13062
|
+
className: "adyen-kyc-dropdown-search-element__description--highlight",
|
|
13063
|
+
children: boldText
|
|
13064
|
+
}));
|
|
13065
|
+
lastHighlightIndex = highlightEnd;
|
|
13066
|
+
});
|
|
13067
|
+
if (lastHighlightIndex < text.length) {
|
|
13068
|
+
formattedText.push(`${text.substring(lastHighlightIndex)}`);
|
|
13069
|
+
}
|
|
13070
|
+
return formattedText;
|
|
13071
|
+
};
|
|
13072
|
+
const getHighlightedText = ({
|
|
13073
|
+
text = "",
|
|
13074
|
+
highlight = "",
|
|
13075
|
+
description = ""
|
|
13076
|
+
}) => {
|
|
13077
|
+
let formattedText = [];
|
|
13078
|
+
if (highlight === "") {
|
|
13079
|
+
if (description) {
|
|
13080
|
+
formattedText.push(`${text}, ${description}`);
|
|
13081
|
+
} else {
|
|
13082
|
+
formattedText.push(text);
|
|
13083
|
+
}
|
|
13084
|
+
} else {
|
|
13085
|
+
const highlightItems = highlight.split(";");
|
|
13086
|
+
formattedText = getFormattedText(highlightItems[0].split(","), text);
|
|
13087
|
+
if (highlightItems.length > 1) {
|
|
13088
|
+
formattedText.push(`, `);
|
|
13089
|
+
formattedText.push(jsx(Fragment, {
|
|
13090
|
+
children: getFormattedText(highlightItems[1].split(","), description)
|
|
13091
|
+
}));
|
|
13092
|
+
} else if (description) {
|
|
13093
|
+
formattedText.push(`, ${description}`);
|
|
13094
|
+
}
|
|
13095
|
+
}
|
|
13096
|
+
return formattedText;
|
|
13097
|
+
};
|
|
13098
|
+
const generateSearchListItem = (item, i18n) => jsxs(Fragment, {
|
|
13099
|
+
children: [jsx("span", {
|
|
13100
|
+
className: "adyen-kyc-dropdown-search-element__description",
|
|
13101
|
+
children: getHighlightedText(item)
|
|
13102
|
+
}), item.addressAmount && jsxs("div", {
|
|
13103
|
+
className: "adyen-kyc-dropdown-search-element__addresses",
|
|
13104
|
+
children: [item.addressAmount, " ", jsxs("span", {
|
|
13105
|
+
className: "adyen-kyc-dropdown-search-element__addresses--text",
|
|
13106
|
+
children: [" ", i18n.get("addresses")]
|
|
13107
|
+
}), jsx(Icon, {
|
|
13108
|
+
name: "arrow-right",
|
|
13109
|
+
className: "adyen-kyc-dropdown-search-element__addresses--icon"
|
|
13110
|
+
})]
|
|
13111
|
+
})]
|
|
13112
|
+
});
|
|
13113
|
+
function FieldContainerComponent({
|
|
13114
|
+
legalEntityId = "",
|
|
13115
|
+
classNameModifiers = [],
|
|
13116
|
+
schema,
|
|
13117
|
+
data,
|
|
13118
|
+
valid,
|
|
13119
|
+
errors,
|
|
13120
|
+
fieldProblems,
|
|
13121
|
+
fieldName,
|
|
13122
|
+
trimOnBlur,
|
|
13123
|
+
hideField,
|
|
13124
|
+
maxlength,
|
|
13125
|
+
readOnly,
|
|
13126
|
+
optional,
|
|
13127
|
+
handleChangeFor,
|
|
13128
|
+
handleAddressSearch,
|
|
13129
|
+
handleFindAddress
|
|
13130
|
+
}) {
|
|
13131
|
+
const {
|
|
13132
|
+
i18n
|
|
13133
|
+
} = useI18nContext();
|
|
13134
|
+
useEffect(() => {
|
|
13135
|
+
setItems([]);
|
|
13136
|
+
setSearchText("");
|
|
13137
|
+
setResetSearch(true);
|
|
13138
|
+
}, [data.country]);
|
|
13139
|
+
const formUtils = formUtilities({
|
|
13140
|
+
data
|
|
13141
|
+
}, i18n);
|
|
13142
|
+
const errorMessage = formUtils.getErrorMessage(fieldName, errors ?? {}, fieldProblems);
|
|
13143
|
+
const value = data[fieldName];
|
|
13144
|
+
const labelKey = getKeyForField(fieldName, data.country);
|
|
13145
|
+
const [items, setItems] = useState([]);
|
|
13146
|
+
const [loading, setLoading] = useState(false);
|
|
13147
|
+
const [resetSearch, setResetSearch] = useState(false);
|
|
13148
|
+
const [showSearchList, setShowSearchList] = useState(false);
|
|
13149
|
+
const [selectedAddressId, setSelectedAddressId] = useState();
|
|
13150
|
+
const [searchText, setSearchText] = useState(data.address);
|
|
13151
|
+
useEffect(() => {
|
|
13152
|
+
setSearchText(data.address);
|
|
13153
|
+
}, [data.address]);
|
|
13154
|
+
const setAddressField = ({
|
|
13155
|
+
houseNumberOrName,
|
|
13156
|
+
street
|
|
13157
|
+
}) => {
|
|
13158
|
+
const hasHouseNumber = !!houseNumberOrName;
|
|
13159
|
+
if (hasHouseNumber) {
|
|
13160
|
+
const isHouseNumberFirst = data.country ? COUNTRIES_WITH_HOUSE_NUMBER_FIRST.includes(data.country) : false;
|
|
13161
|
+
const needsComma = data.country ? COUNTRIES_WITH_COMMA_SEPARATED.includes(data.country) : false;
|
|
13162
|
+
const formattedAddress = isHouseNumberFirst ? `${houseNumberOrName}${needsComma ? ", " : " "}${street}` : `${street}${needsComma ? ", " : " "}${houseNumberOrName}`;
|
|
13163
|
+
return handleChangeFor("address", "input")(formattedAddress);
|
|
13164
|
+
}
|
|
13165
|
+
return handleChangeFor("address", "input")(street);
|
|
13166
|
+
};
|
|
13167
|
+
const getSearchItems = async (text) => {
|
|
13168
|
+
if (!text || !data.country) return setItems([]);
|
|
13169
|
+
try {
|
|
13170
|
+
setLoading(true);
|
|
13171
|
+
const response = await (handleAddressSearch == null ? void 0 : handleAddressSearch({
|
|
13172
|
+
text,
|
|
13173
|
+
country: data.country
|
|
13174
|
+
}, legalEntityId));
|
|
13175
|
+
if (response == null ? void 0 : response.results) {
|
|
13176
|
+
setItems(response.results.map(formatAddressItem));
|
|
13177
|
+
} else {
|
|
13178
|
+
setItems([]);
|
|
13179
|
+
}
|
|
13180
|
+
} catch (e) {
|
|
13181
|
+
logger$w.error(e);
|
|
13182
|
+
}
|
|
13183
|
+
setLoading(false);
|
|
13184
|
+
};
|
|
13185
|
+
const onFindAddress = async (addressId) => {
|
|
13186
|
+
try {
|
|
13187
|
+
const response = await (handleFindAddress == null ? void 0 : handleFindAddress(addressId));
|
|
13188
|
+
if (response) {
|
|
13189
|
+
schema == null ? void 0 : schema.forEach((field) => {
|
|
13190
|
+
switch (field) {
|
|
13191
|
+
case "country":
|
|
13192
|
+
handleChangeFor("country", "input")(response.country ?? " ");
|
|
13193
|
+
break;
|
|
13194
|
+
case "address":
|
|
13195
|
+
setAddressField(response);
|
|
13196
|
+
break;
|
|
13197
|
+
case "otherAddressInformation":
|
|
13198
|
+
handleChangeFor("otherAddressInformation", "blur")(response.street2 ?? " ");
|
|
13199
|
+
break;
|
|
13200
|
+
case "city":
|
|
13201
|
+
handleChangeFor("city", "input")(response.city ?? " ");
|
|
13202
|
+
break;
|
|
13203
|
+
case "postalCode":
|
|
13204
|
+
handleChangeFor("postalCode", "input")(response.postalCode ?? " ");
|
|
13205
|
+
break;
|
|
13206
|
+
case "stateOrProvince":
|
|
13207
|
+
handleChangeFor("stateOrProvince", "input")(response.stateOrProvince ?? " ");
|
|
13208
|
+
break;
|
|
13209
|
+
default:
|
|
13210
|
+
break;
|
|
13211
|
+
}
|
|
13212
|
+
});
|
|
13213
|
+
}
|
|
13214
|
+
} catch (e) {
|
|
13215
|
+
logger$w.error(e);
|
|
13216
|
+
}
|
|
13217
|
+
};
|
|
13218
|
+
const onDrilldown = async (address) => {
|
|
13219
|
+
if (!data.country) return;
|
|
13220
|
+
try {
|
|
13221
|
+
const response = await (handleAddressSearch == null ? void 0 : handleAddressSearch({
|
|
13222
|
+
text: address.text,
|
|
13223
|
+
country: data.country,
|
|
13224
|
+
container: address.id
|
|
13225
|
+
}, legalEntityId));
|
|
13226
|
+
setItems((response == null ? void 0 : response.results) || []);
|
|
13227
|
+
} catch (e) {
|
|
13228
|
+
logger$w.error(e);
|
|
13229
|
+
}
|
|
13230
|
+
};
|
|
13231
|
+
const handleOnChange = (e) => {
|
|
13232
|
+
const addressId = e.target.value;
|
|
13233
|
+
setSelectedAddressId(addressId);
|
|
13234
|
+
setLoading(true);
|
|
13235
|
+
const selectedAddress = items.filter((i) => i.id === addressId)[0];
|
|
13236
|
+
if (selectedAddress.type === "Address") {
|
|
13237
|
+
onFindAddress(selectedAddress.id);
|
|
13238
|
+
setShowSearchList(false);
|
|
13239
|
+
} else {
|
|
13240
|
+
onDrilldown(selectedAddress);
|
|
13241
|
+
setShowSearchList(true);
|
|
13242
|
+
}
|
|
13243
|
+
setLoading(false);
|
|
13244
|
+
};
|
|
13245
|
+
const renderField = (field) => {
|
|
13246
|
+
switch (field) {
|
|
13247
|
+
case "address":
|
|
13248
|
+
return handleAddressSearch && handleFindAddress ? jsx(Field, {
|
|
13249
|
+
name: field,
|
|
13250
|
+
label: i18n.get(labelKey),
|
|
13251
|
+
classNameModifiers,
|
|
13252
|
+
errorMessage,
|
|
13253
|
+
isValid: valid == null ? void 0 : valid[field],
|
|
13254
|
+
optional,
|
|
13255
|
+
children: (childProps) => jsx(Select, {
|
|
13256
|
+
...childProps,
|
|
13257
|
+
isSearch: true,
|
|
13258
|
+
name: field,
|
|
13259
|
+
items: items.map((item) => ({
|
|
13260
|
+
...item,
|
|
13261
|
+
name: ""
|
|
13262
|
+
})),
|
|
13263
|
+
selected: selectedAddressId,
|
|
13264
|
+
loading,
|
|
13265
|
+
onChange: handleOnChange,
|
|
13266
|
+
onSearch: getSearchItems,
|
|
13267
|
+
onSearchTextChange: (text) => handleChangeFor("address", "input")(text),
|
|
13268
|
+
getSearchItem: (item) => generateSearchListItem(item, i18n),
|
|
13269
|
+
showSearchList,
|
|
13270
|
+
resetSearch,
|
|
13271
|
+
searchText
|
|
13272
|
+
})
|
|
13273
|
+
}) : jsx(Field, {
|
|
13274
|
+
name: field,
|
|
13275
|
+
label: i18n.get(labelKey),
|
|
13276
|
+
classNameModifiers,
|
|
13277
|
+
errorMessage,
|
|
13278
|
+
isValid: valid == null ? void 0 : valid[field],
|
|
13279
|
+
optional,
|
|
13280
|
+
children: (childProps) => jsx(InputText, {
|
|
13281
|
+
...childProps,
|
|
13282
|
+
classNameModifiers,
|
|
13283
|
+
name: field,
|
|
13284
|
+
value,
|
|
13285
|
+
onInput: handleChangeFor(fieldName, "input"),
|
|
13286
|
+
onBlur: handleChangeFor(fieldName, "blur"),
|
|
13287
|
+
maxLength: maxlength,
|
|
13288
|
+
"aria-required": true,
|
|
13289
|
+
"aria-label": i18n.get(labelKey),
|
|
13290
|
+
"aria-invalid": !(valid == null ? void 0 : valid[field]),
|
|
13291
|
+
trimOnBlur,
|
|
13292
|
+
readonly: readOnly
|
|
13293
|
+
})
|
|
13294
|
+
});
|
|
13295
|
+
case "country":
|
|
13296
|
+
return jsx(CountryField, {
|
|
13297
|
+
data: {
|
|
13298
|
+
country: value
|
|
13299
|
+
},
|
|
13300
|
+
valid: {
|
|
13301
|
+
country: valid == null ? void 0 : valid.country
|
|
13302
|
+
},
|
|
13303
|
+
errors: {
|
|
13304
|
+
country: errorMessage
|
|
13305
|
+
},
|
|
13306
|
+
labels: {
|
|
13307
|
+
country: formUtils.getLabel(field, labelKey)
|
|
13308
|
+
},
|
|
13309
|
+
readonly: Boolean(readOnly),
|
|
13310
|
+
classNameModifiers,
|
|
13311
|
+
className: hideField ? "adyen-kyc-search-fieldcontainer-hide" : "",
|
|
13312
|
+
handleChangeFor
|
|
13313
|
+
});
|
|
13314
|
+
case "stateOrProvince":
|
|
13315
|
+
return jsx(StateField, {
|
|
13316
|
+
data: {
|
|
13317
|
+
stateOrProvince: value
|
|
13318
|
+
},
|
|
13319
|
+
valid: {
|
|
13320
|
+
stateOrProvince: valid == null ? void 0 : valid.stateOrProvince
|
|
13321
|
+
},
|
|
13322
|
+
errors: {
|
|
13323
|
+
stateOrProvince: errorMessage
|
|
13324
|
+
},
|
|
13325
|
+
labels: {
|
|
13326
|
+
stateOrProvince: formUtils.getLabel(field, labelKey)
|
|
13327
|
+
},
|
|
13328
|
+
readonly: Boolean(readOnly),
|
|
13329
|
+
classNameModifiers,
|
|
13330
|
+
selectedCountry: data.country,
|
|
13331
|
+
handleChangeFor
|
|
13332
|
+
});
|
|
13333
|
+
default:
|
|
13334
|
+
return jsx(Field, {
|
|
13335
|
+
name: field,
|
|
13336
|
+
label: i18n.get(labelKey),
|
|
13337
|
+
classNameModifiers,
|
|
13338
|
+
errorMessage,
|
|
13339
|
+
isValid: valid == null ? void 0 : valid[field],
|
|
13340
|
+
optional,
|
|
13341
|
+
children: (childProps) => jsx(InputText, {
|
|
13342
|
+
...childProps,
|
|
13343
|
+
classNameModifiers,
|
|
13344
|
+
name: field,
|
|
13345
|
+
value: field === "postalCode" ? value == null ? void 0 : value.toUpperCase() : value,
|
|
13346
|
+
onInput: handleChangeFor(fieldName, "input"),
|
|
13347
|
+
onBlur: handleChangeFor(fieldName, "blur"),
|
|
13348
|
+
maxLength: maxlength,
|
|
13349
|
+
"aria-required": true,
|
|
13350
|
+
"aria-label": i18n.get(labelKey),
|
|
13351
|
+
"aria-invalid": !(valid == null ? void 0 : valid[field]),
|
|
13352
|
+
trimOnBlur,
|
|
13353
|
+
readonly: readOnly
|
|
13354
|
+
})
|
|
13355
|
+
});
|
|
13356
|
+
}
|
|
13357
|
+
};
|
|
13358
|
+
return hideField ? null : renderField(fieldName);
|
|
13359
|
+
}
|
|
13360
|
+
function AddressComponent({
|
|
13361
|
+
data,
|
|
13362
|
+
labels: labels2,
|
|
13363
|
+
placeholders,
|
|
13364
|
+
helperText,
|
|
13365
|
+
readOnly,
|
|
13366
|
+
hideCountry,
|
|
13367
|
+
fieldValidationErrors,
|
|
13368
|
+
allFields,
|
|
13369
|
+
requiredFields,
|
|
13370
|
+
optionalFields = ["otherAddressInformation"],
|
|
13371
|
+
readOnlyFields,
|
|
13372
|
+
trustedFields,
|
|
13373
|
+
shouldValidate,
|
|
13374
|
+
handleAddressSearch,
|
|
13375
|
+
handleFindAddress,
|
|
13376
|
+
onChange,
|
|
13377
|
+
legalEntityId,
|
|
13378
|
+
verifiedAddress
|
|
13379
|
+
}) {
|
|
13380
|
+
const {
|
|
13381
|
+
i18n
|
|
13382
|
+
} = useI18nContext();
|
|
13383
|
+
const {
|
|
13384
|
+
isExperimentEnabled
|
|
13385
|
+
} = useExperimentsContext();
|
|
13386
|
+
const isStrictNameAndAddressValidationEnabled = isExperimentEnabled(ExperimentNames.StrictNameAndAddressValidationV4);
|
|
13387
|
+
const schema = useMemo(() => {
|
|
13388
|
+
if (requiredFields == null ? void 0 : requiredFields.length) {
|
|
13389
|
+
return (requiredFields == null ? void 0 : requiredFields.includes("stateOrProvince")) || (data == null ? void 0 : data.country) && COUNTRIES_WITH_STATES_DATASET.includes(data == null ? void 0 : data.country) ? requiredFields : requiredFields == null ? void 0 : requiredFields.filter((field) => field !== "stateOrProvince");
|
|
13390
|
+
}
|
|
13391
|
+
return (data == null ? void 0 : data.country) && COUNTRIES_WITH_STATES_DATASET.includes(data == null ? void 0 : data.country) ? getAddressSchemaForCountry(data == null ? void 0 : data.country) : getAddressSchemaForCountry(data == null ? void 0 : data.country).filter((ad) => ad !== "stateOrProvince");
|
|
13392
|
+
}, [data == null ? void 0 : data.country, requiredFields]);
|
|
13393
|
+
const rules2 = useMemo(() => addressValidationRules(data == null ? void 0 : data.country), [data == null ? void 0 : data.country]);
|
|
13394
|
+
const rulesV4 = useMemo(() => addressValidationRulesV4(data == null ? void 0 : data.country, i18n), [data == null ? void 0 : data.country, i18n]);
|
|
13395
|
+
const {
|
|
13396
|
+
schema: formSchema,
|
|
13397
|
+
data: formData,
|
|
13398
|
+
errors: formErrors,
|
|
13399
|
+
valid: formValid,
|
|
13400
|
+
fieldProblems: formFieldProblems,
|
|
13401
|
+
handleChangeFor,
|
|
13402
|
+
isValid
|
|
13403
|
+
} = useForm({
|
|
13404
|
+
schema,
|
|
13405
|
+
defaultData: data,
|
|
13406
|
+
formatters: addressFormatters,
|
|
13407
|
+
rules: isStrictNameAndAddressValidationEnabled ? rulesV4 : rules2,
|
|
13408
|
+
fieldProblems: fieldValidationErrors,
|
|
13409
|
+
optionalFields,
|
|
13410
|
+
obscuredFields: [],
|
|
13411
|
+
trustedFields: [],
|
|
13412
|
+
shouldValidate
|
|
13413
|
+
});
|
|
13414
|
+
useEffect(
|
|
13415
|
+
() => verifiedAddress ? entriesOf(verifiedAddress).forEach(([key, value]) => {
|
|
13416
|
+
if (formData[key] !== value) handleChangeFor(key, "input")(value);
|
|
13417
|
+
}) : formSchema.forEach((field) => handleChangeFor(field, "input")((data == null ? void 0 : data[field]) ?? " ")),
|
|
13418
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13419
|
+
[verifiedAddress]
|
|
13420
|
+
);
|
|
13421
|
+
const formUtils = formUtilities({
|
|
13422
|
+
data,
|
|
13423
|
+
labels: labels2,
|
|
13424
|
+
placeholders,
|
|
13425
|
+
helperText,
|
|
13426
|
+
readOnly,
|
|
13427
|
+
allFields,
|
|
13428
|
+
requiredFields: schema,
|
|
13429
|
+
optionalFields,
|
|
13430
|
+
readOnlyFields,
|
|
13431
|
+
trustedFields
|
|
13432
|
+
}, i18n);
|
|
13433
|
+
useEffect(() => {
|
|
13434
|
+
onChange == null ? void 0 : onChange({
|
|
13435
|
+
schema: formSchema,
|
|
13436
|
+
data: formData,
|
|
13437
|
+
valid: formValid,
|
|
13438
|
+
errors: formErrors,
|
|
13439
|
+
fieldProblems: formFieldProblems,
|
|
13440
|
+
isValid
|
|
13441
|
+
});
|
|
13442
|
+
}, [formData, formErrors, formFieldProblems, formSchema, formValid, isValid]);
|
|
13443
|
+
const createFieldComponent = (fieldName) => {
|
|
13444
|
+
if (!formUtils.isRequiredField(fieldName) && !formUtils.isOptionalField(fieldName)) return null;
|
|
13445
|
+
const hideField = fieldName === "country" && hideCountry;
|
|
13446
|
+
return jsx(FieldContainerComponent, {
|
|
13447
|
+
classNameModifiers: [fieldName],
|
|
13448
|
+
schema: formSchema,
|
|
13449
|
+
data: formData,
|
|
13450
|
+
valid: formValid,
|
|
13451
|
+
errors: formErrors,
|
|
13452
|
+
fieldProblems: formFieldProblems,
|
|
13453
|
+
fieldName,
|
|
13454
|
+
maxlength: getMaxLengthByFieldAndCountry(countrySpecificFormatters, fieldName, formData.country),
|
|
13455
|
+
hideField,
|
|
13456
|
+
"aria-label": formUtils.getLabel(fieldName, fieldName),
|
|
13457
|
+
readOnly: formUtils.isReadOnly(fieldName),
|
|
13458
|
+
optional: formUtils.isOptionalField(fieldName),
|
|
13459
|
+
trimOnBlur: true,
|
|
13460
|
+
legalEntityId,
|
|
13461
|
+
handleChangeFor,
|
|
13462
|
+
handleAddressSearch,
|
|
13463
|
+
handleFindAddress
|
|
13464
|
+
}, fieldName);
|
|
13465
|
+
};
|
|
13466
|
+
return jsx("fieldset", {
|
|
13467
|
+
className: "adyen-kyc__address",
|
|
13468
|
+
children: formSchema.map((field) => createFieldComponent(field))
|
|
13469
|
+
});
|
|
13470
|
+
}
|
|
13471
|
+
function AddressExperimentWrapper(props) {
|
|
13472
|
+
const {
|
|
13473
|
+
isExperimentEnabled
|
|
13474
|
+
} = useExperimentsContext();
|
|
13475
|
+
return isExperimentEnabled("EnableNewAddressComponent") ? jsx(AddressComponent, {
|
|
13476
|
+
...props
|
|
13477
|
+
}) : jsx(Address, {
|
|
13478
|
+
...props
|
|
13479
|
+
});
|
|
13480
|
+
}
|
|
13019
13481
|
var operationalAddressIsSameIds = /* @__PURE__ */ ((operationalAddressIsSameIds2) => {
|
|
13020
13482
|
operationalAddressIsSameIds2["OPERATIONAL_ADDRESS_IS_SAME"] = "OperationAddressAnswerYes";
|
|
13021
13483
|
operationalAddressIsSameIds2["OPERATIONAL_ADDRESS_IS_NOT_SAME"] = "OperationAddressAnswerNo";
|
|
@@ -13080,7 +13542,8 @@ function RegistrationAddressComponent(props) {
|
|
|
13080
13542
|
valid: formValid,
|
|
13081
13543
|
errors: formErrors,
|
|
13082
13544
|
fieldProblems: formFieldProblems,
|
|
13083
|
-
handleChangeFor
|
|
13545
|
+
handleChangeFor,
|
|
13546
|
+
setValid
|
|
13084
13547
|
} = useForm({
|
|
13085
13548
|
...props,
|
|
13086
13549
|
schema: ["operationalAddressIsSame"],
|
|
@@ -13117,10 +13580,25 @@ function RegistrationAddressComponent(props) {
|
|
|
13117
13580
|
schema: ["registrationAddress", "operationalAddressIsSame", ...isOperationAddressNotSame() ? ["operationalAddress"] : []]
|
|
13118
13581
|
}
|
|
13119
13582
|
});
|
|
13120
|
-
}, [formData
|
|
13583
|
+
}, [formData, formValid, formErrors, formFieldProblems]);
|
|
13121
13584
|
const isOperationAddressNotSame = () => formData.operationalAddressIsSame === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME;
|
|
13122
13585
|
const registrationAddressFormProps = getFormProps(props, registrationAddressFormID);
|
|
13123
13586
|
const operationalAddressFormProps = getFormProps(props, operationalAddressFormID);
|
|
13587
|
+
const handleRegistrationAddressChange = (state) => {
|
|
13588
|
+
handleChangeFor("registrationAddress")(state.data);
|
|
13589
|
+
setValid("registrationAddress", Boolean(state.isValid));
|
|
13590
|
+
};
|
|
13591
|
+
const handleOperationalAddressChange = (state) => {
|
|
13592
|
+
handleChangeFor("operationalAddress")(state.data);
|
|
13593
|
+
setValid("operationalAddress", Boolean(state.isValid));
|
|
13594
|
+
};
|
|
13595
|
+
const handleOperationalAddressIsSameChange = (e) => {
|
|
13596
|
+
const {
|
|
13597
|
+
value
|
|
13598
|
+
} = e.target;
|
|
13599
|
+
handleChangeFor("operationalAddressIsSame")(value);
|
|
13600
|
+
if (value === "OperationAddressAnswerYes") setValid("operationalAddress", true);
|
|
13601
|
+
};
|
|
13124
13602
|
return jsxs(Fragment, {
|
|
13125
13603
|
children: [jsx(StateContextSetter, {
|
|
13126
13604
|
owner: id,
|
|
@@ -13139,7 +13617,7 @@ function RegistrationAddressComponent(props) {
|
|
|
13139
13617
|
contentId: "reasonForFillingCompanyAddressDetails",
|
|
13140
13618
|
title: i18n.get("whyDoINeedToFillInThisInformation"),
|
|
13141
13619
|
content: i18n.get("reasonForFillingCompanyAddressDetails")
|
|
13142
|
-
}), jsx(
|
|
13620
|
+
}), jsx(AddressExperimentWrapper, {
|
|
13143
13621
|
...registrationAddressFormProps,
|
|
13144
13622
|
data: {
|
|
13145
13623
|
...registrationAddressFormProps == null ? void 0 : registrationAddressFormProps.data,
|
|
@@ -13148,10 +13626,12 @@ function RegistrationAddressComponent(props) {
|
|
|
13148
13626
|
hideCountry: true,
|
|
13149
13627
|
id,
|
|
13150
13628
|
addressType: "registrationAddress",
|
|
13629
|
+
optionalFields: ["otherAddressInformation"],
|
|
13151
13630
|
handleAddressSearch,
|
|
13152
13631
|
handleFindAddress,
|
|
13153
13632
|
verifiedBusiness,
|
|
13154
|
-
kompanyAddress
|
|
13633
|
+
kompanyAddress,
|
|
13634
|
+
onChange: handleRegistrationAddressChange
|
|
13155
13635
|
}), jsx(FormHeader, {
|
|
13156
13636
|
classNames: "adyen-kyc-u-margin-top-32",
|
|
13157
13637
|
heading: i18n.get("operationalAddressHeader")
|
|
@@ -13167,12 +13647,12 @@ function RegistrationAddressComponent(props) {
|
|
|
13167
13647
|
items: operationalAddressIsSameItems,
|
|
13168
13648
|
value: formData.operationalAddressIsSame,
|
|
13169
13649
|
disabled: formUtils.isReadOnly("operationalAddressIsSame"),
|
|
13170
|
-
onChange:
|
|
13650
|
+
onChange: handleOperationalAddressIsSameChange,
|
|
13171
13651
|
"aria-required": true,
|
|
13172
13652
|
"aria-label": formUtils.getLabel("operationalAddressIsSame"),
|
|
13173
13653
|
"aria-invalid": !formValid.operationalAddressIsSame
|
|
13174
13654
|
})
|
|
13175
|
-
}), isOperationAddressNotSame() && createElement(
|
|
13655
|
+
}), isOperationAddressNotSame() && createElement(AddressExperimentWrapper, {
|
|
13176
13656
|
...operationalAddressFormProps,
|
|
13177
13657
|
key: "operationalAddress",
|
|
13178
13658
|
data: {
|
|
@@ -13181,9 +13661,11 @@ function RegistrationAddressComponent(props) {
|
|
|
13181
13661
|
},
|
|
13182
13662
|
hideCountry: true,
|
|
13183
13663
|
id,
|
|
13664
|
+
optionalFields: ["otherAddressInformation"],
|
|
13184
13665
|
addressType: "operationalAddress",
|
|
13185
13666
|
handleAddressSearch,
|
|
13186
|
-
handleFindAddress
|
|
13667
|
+
handleFindAddress,
|
|
13668
|
+
onChange: handleOperationalAddressChange
|
|
13187
13669
|
})]
|
|
13188
13670
|
});
|
|
13189
13671
|
}
|
|
@@ -13863,9 +14345,18 @@ const rules$2 = ({
|
|
|
13863
14345
|
}
|
|
13864
14346
|
},
|
|
13865
14347
|
countryRequiresRegistrationNumberForCompanies: () => {
|
|
14348
|
+
var _a, _b;
|
|
13866
14349
|
if (COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER.includes(country)) {
|
|
13867
14350
|
return "OPTIONAL";
|
|
13868
14351
|
}
|
|
14352
|
+
if (isExperimentEnabled("EnableAUGovernmentalOrganizationSkipRegistrationNumber") && country === CountryCodes.Australia) {
|
|
14353
|
+
if ("companyType" in data && ((_a = data.companyType) == null ? void 0 : _a.entityType) === CompanyTypesValue.GOVERNMENTAL_ORGANIZATION) {
|
|
14354
|
+
return;
|
|
14355
|
+
}
|
|
14356
|
+
if ("companyStructure" in data && ((_b = data.companyStructure) == null ? void 0 : _b.entityType) === CompanyTypesValue.GOVERNMENTAL_ORGANIZATION) {
|
|
14357
|
+
return;
|
|
14358
|
+
}
|
|
14359
|
+
}
|
|
13869
14360
|
if (!COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION.includes(country)) {
|
|
13870
14361
|
return "REQUIRED";
|
|
13871
14362
|
}
|
|
@@ -14985,49 +15476,13 @@ const useIdVerificationToken = ({
|
|
|
14985
15476
|
loadingStatus
|
|
14986
15477
|
};
|
|
14987
15478
|
};
|
|
14988
|
-
const
|
|
14989
|
-
const
|
|
14990
|
-
const
|
|
14991
|
-
|
|
14992
|
-
|
|
14993
|
-
|
|
14994
|
-
|
|
14995
|
-
const adyenKycLoadingInputFormLoadingOpacity06 = "adyen-kyc-loading-input__form--loading-opacity0-6";
|
|
14996
|
-
const adyenKycLoadingInputFormLoadingOpacity07 = "adyen-kyc-loading-input__form--loading-opacity0-7";
|
|
14997
|
-
const adyenKycLoadingInputFormLoadingOpacity08 = "adyen-kyc-loading-input__form--loading-opacity0-8";
|
|
14998
|
-
const adyenKycLoadingInputFormLoadingOpacity09 = "adyen-kyc-loading-input__form--loading-opacity0-9";
|
|
14999
|
-
const adyenKycLoadingInputFormLoadingOpacity1 = "adyen-kyc-loading-input__form--loading-opacity1";
|
|
15000
|
-
const adyenKycLoadingInputLoader = "adyen-kyc-loading-input__loader";
|
|
15001
|
-
const adyenKycLoadingInputLoaderActive = "adyen-kyc-loading-input__loader--active";
|
|
15002
|
-
const styles$5 = {
|
|
15003
|
-
"adyen-kyc-loading-input__form": "adyen-kyc-loading-input__form",
|
|
15004
|
-
adyenKycLoadingInputForm,
|
|
15005
|
-
"adyen-kyc-loading-input__form--loading-opacity0": "adyen-kyc-loading-input__form--loading-opacity0",
|
|
15006
|
-
adyenKycLoadingInputFormLoadingOpacity0,
|
|
15007
|
-
"adyen-kyc-loading-input__form--loading-opacity0-1": "adyen-kyc-loading-input__form--loading-opacity0-1",
|
|
15008
|
-
adyenKycLoadingInputFormLoadingOpacity01,
|
|
15009
|
-
"adyen-kyc-loading-input__form--loading-opacity0-2": "adyen-kyc-loading-input__form--loading-opacity0-2",
|
|
15010
|
-
adyenKycLoadingInputFormLoadingOpacity02,
|
|
15011
|
-
"adyen-kyc-loading-input__form--loading-opacity0-3": "adyen-kyc-loading-input__form--loading-opacity0-3",
|
|
15012
|
-
adyenKycLoadingInputFormLoadingOpacity03,
|
|
15013
|
-
"adyen-kyc-loading-input__form--loading-opacity0-4": "adyen-kyc-loading-input__form--loading-opacity0-4",
|
|
15014
|
-
adyenKycLoadingInputFormLoadingOpacity04,
|
|
15015
|
-
"adyen-kyc-loading-input__form--loading-opacity0-5": "adyen-kyc-loading-input__form--loading-opacity0-5",
|
|
15016
|
-
adyenKycLoadingInputFormLoadingOpacity05,
|
|
15017
|
-
"adyen-kyc-loading-input__form--loading-opacity0-6": "adyen-kyc-loading-input__form--loading-opacity0-6",
|
|
15018
|
-
adyenKycLoadingInputFormLoadingOpacity06,
|
|
15019
|
-
"adyen-kyc-loading-input__form--loading-opacity0-7": "adyen-kyc-loading-input__form--loading-opacity0-7",
|
|
15020
|
-
adyenKycLoadingInputFormLoadingOpacity07,
|
|
15021
|
-
"adyen-kyc-loading-input__form--loading-opacity0-8": "adyen-kyc-loading-input__form--loading-opacity0-8",
|
|
15022
|
-
adyenKycLoadingInputFormLoadingOpacity08,
|
|
15023
|
-
"adyen-kyc-loading-input__form--loading-opacity0-9": "adyen-kyc-loading-input__form--loading-opacity0-9",
|
|
15024
|
-
adyenKycLoadingInputFormLoadingOpacity09,
|
|
15025
|
-
"adyen-kyc-loading-input__form--loading-opacity1": "adyen-kyc-loading-input__form--loading-opacity1",
|
|
15026
|
-
adyenKycLoadingInputFormLoadingOpacity1,
|
|
15027
|
-
"adyen-kyc-loading-input__loader": "adyen-kyc-loading-input__loader",
|
|
15028
|
-
adyenKycLoadingInputLoader,
|
|
15029
|
-
"adyen-kyc-loading-input__loader--active": "adyen-kyc-loading-input__loader--active",
|
|
15030
|
-
adyenKycLoadingInputLoaderActive
|
|
15479
|
+
const loaderWrapperLoader = "adyen-kyc-loader-wrapper-loader";
|
|
15480
|
+
const loaderWrapperLoaderActive = "adyen-kyc-loader-wrapper-loader-active";
|
|
15481
|
+
const styles$3 = {
|
|
15482
|
+
"loader-wrapper-loader": "adyen-kyc-loader-wrapper-loader",
|
|
15483
|
+
loaderWrapperLoader,
|
|
15484
|
+
"loader-wrapper-loader-active": "adyen-kyc-loader-wrapper-loader-active",
|
|
15485
|
+
loaderWrapperLoaderActive
|
|
15031
15486
|
};
|
|
15032
15487
|
const LoaderWrapper = ({
|
|
15033
15488
|
children,
|
|
@@ -15037,18 +15492,15 @@ const LoaderWrapper = ({
|
|
|
15037
15492
|
showSpinner = true,
|
|
15038
15493
|
className
|
|
15039
15494
|
}) => {
|
|
15040
|
-
const
|
|
15041
|
-
|
|
15042
|
-
|
|
15043
|
-
|
|
15044
|
-
|
|
15045
|
-
|
|
15046
|
-
|
|
15047
|
-
|
|
15048
|
-
|
|
15049
|
-
[styles$5["adyen-kyc-loading-input__loader--active"]]: status === "loading" && showSpinner
|
|
15050
|
-
});
|
|
15051
|
-
const overlayClass = cx("adyen-kyc-loading-input", className);
|
|
15495
|
+
const opacitySyle = status === "loading" ? {
|
|
15496
|
+
opacity: formOpacityWhenLoading
|
|
15497
|
+
} : {
|
|
15498
|
+
opacity: 1
|
|
15499
|
+
};
|
|
15500
|
+
const loaderWrapperClass = cx(styles$3.loaderWrapperLoader, {
|
|
15501
|
+
[styles$3.loaderWrapperLoaderActive]: status === "loading" && showSpinner
|
|
15502
|
+
});
|
|
15503
|
+
const overlayClass = cx(styles$3.loaderWrapper, className);
|
|
15052
15504
|
return jsxs("div", {
|
|
15053
15505
|
className: overlayClass,
|
|
15054
15506
|
style: {
|
|
@@ -15060,7 +15512,8 @@ const LoaderWrapper = ({
|
|
|
15060
15512
|
size: loaderSize
|
|
15061
15513
|
})
|
|
15062
15514
|
}), jsx("div", {
|
|
15063
|
-
className:
|
|
15515
|
+
className: styles$3.loaderWrapperForm,
|
|
15516
|
+
style: opacitySyle,
|
|
15064
15517
|
children
|
|
15065
15518
|
})]
|
|
15066
15519
|
});
|
|
@@ -16556,27 +17009,13 @@ const handleKeys = (keys, callback, propagationMode = "stopIfMatches") => (event
|
|
|
16556
17009
|
callback();
|
|
16557
17010
|
}
|
|
16558
17011
|
};
|
|
16559
|
-
const adyenKycMultiSelectList = "adyen-kyc-multi-select-list";
|
|
16560
|
-
const adyenKycMultiSelectListItem = "adyen-kyc-multi-select-list-item";
|
|
16561
|
-
const adyenKycMultiSelectListItemWithDescription = "adyen-kyc-multi-select-list-item--with-description";
|
|
16562
|
-
const adyenKycCheckboxLabel = "adyen-kyc-checkbox__label";
|
|
16563
|
-
const styles$4 = {
|
|
16564
|
-
"adyen-kyc-multi-select-list": "adyen-kyc-multi-select-list",
|
|
16565
|
-
adyenKycMultiSelectList,
|
|
16566
|
-
"adyen-kyc-multi-select-list-item": "adyen-kyc-multi-select-list-item",
|
|
16567
|
-
adyenKycMultiSelectListItem,
|
|
16568
|
-
"adyen-kyc-multi-select-list-item--with-description": "adyen-kyc-multi-select-list-item--with-description",
|
|
16569
|
-
adyenKycMultiSelectListItemWithDescription,
|
|
16570
|
-
"adyen-kyc-checkbox__label": "adyen-kyc-checkbox__label",
|
|
16571
|
-
adyenKycCheckboxLabel
|
|
16572
|
-
};
|
|
16573
17012
|
const MultiSelectList = ({
|
|
16574
17013
|
options,
|
|
16575
17014
|
selected,
|
|
16576
17015
|
onSelect,
|
|
16577
17016
|
mapToSelectItem
|
|
16578
17017
|
}) => jsx("ul", {
|
|
16579
|
-
className:
|
|
17018
|
+
className: "adyen-kyc-multi-select-list",
|
|
16580
17019
|
children: options.map((option) => {
|
|
16581
17020
|
const item = mapToSelectItem(option);
|
|
16582
17021
|
const isSelected = selected.includes(option);
|
|
@@ -16590,8 +17029,8 @@ const MultiSelectList = ({
|
|
|
16590
17029
|
onKeyDown: handleKeys(["Enter", " "], handleSelect),
|
|
16591
17030
|
onSelect: handleSelect,
|
|
16592
17031
|
isMulti: true,
|
|
16593
|
-
className: cx([
|
|
16594
|
-
|
|
17032
|
+
className: cx(["adyen-kyc-multi-select-list-item", {
|
|
17033
|
+
"adyen-kyc-multi-select-list-item--with-description": !!item.description
|
|
16595
17034
|
}])
|
|
16596
17035
|
}, item.id);
|
|
16597
17036
|
})
|
|
@@ -17552,8 +17991,9 @@ const relationshipOptions = [{
|
|
|
17552
17991
|
id: "guardian",
|
|
17553
17992
|
name: "guardian"
|
|
17554
17993
|
}];
|
|
17994
|
+
const countriesRequiringNationality = [CountryCodes.HongKong, CountryCodes.Singapore];
|
|
17555
17995
|
function PersonalDetailsComponent(props) {
|
|
17556
|
-
var _a;
|
|
17996
|
+
var _a, _b, _c, _d;
|
|
17557
17997
|
const {
|
|
17558
17998
|
i18n
|
|
17559
17999
|
} = useI18nContext();
|
|
@@ -17584,6 +18024,7 @@ function PersonalDetailsComponent(props) {
|
|
|
17584
18024
|
const isDecisionMakerTask = props.taskType === TaskTypes.DECISION_MAKER || props.taskType === TaskTypes.TRUST_MEMBER_COMPANY_OWNER;
|
|
17585
18025
|
const isTopLevelEntity = props.taskType === TaskTypes.INDIVIDUAL;
|
|
17586
18026
|
const isLegalRepresentativeDetailsTask = props.taskType === TaskTypes.LEGAL_REPRESENTATIVE_DETAILS;
|
|
18027
|
+
const countryRequiringNationality = ((_c = (_b = props.parentLegalEntity) == null ? void 0 : _b.organization) == null ? void 0 : _c.registeredAddress.country) || ((_d = props.data) == null ? void 0 : _d.residencyCountry);
|
|
17587
18028
|
const requiredFieldsByTask = (props.requiredFields || personalDetailsFields).filter((field) => !isNewEntryFlowEnabled && (field !== "role" || field === "role" && isDecisionMakerTask) || isNewEntryFlowEnabled && (field !== "role" && field !== "accountHolder" || field === "role" && isDecisionMakerTask) || field === "relationship" && isLegalRepresentativeDetailsTask);
|
|
17588
18029
|
const isAllowedEditPrefilledCountry = isSettingEnabled(SettingNames.AllowPrefilledCountryEdit);
|
|
17589
18030
|
const getDirectChildFields = () => requiredFieldsByTask.filter((field) => ["birthDate", "residencyCountry", "jobTitle", "nationality", "relationship"].includes(field));
|
|
@@ -17675,9 +18116,9 @@ function PersonalDetailsComponent(props) {
|
|
|
17675
18116
|
currentState,
|
|
17676
18117
|
changeInitiatedBy
|
|
17677
18118
|
}) => {
|
|
17678
|
-
var _a2,
|
|
18119
|
+
var _a2, _b2;
|
|
17679
18120
|
if (changeInitiatedBy === PERSONAL_DETAILS) {
|
|
17680
|
-
if (!((
|
|
18121
|
+
if (!((_b2 = (_a2 = currentState.errors) == null ? void 0 : _a2[PERSONAL_DETAILS]) == null ? void 0 : _b2.idNumber) && (externalErrors == null ? void 0 : externalErrors.idNumber)) {
|
|
17681
18122
|
delete externalErrors.idNumber;
|
|
17682
18123
|
}
|
|
17683
18124
|
this.isValid = currentState.validityByForm[PERSONAL_DETAILS];
|
|
@@ -17853,7 +18294,7 @@ function PersonalDetailsComponent(props) {
|
|
|
17853
18294
|
country: data.residencyCountry,
|
|
17854
18295
|
errors: externalErrors,
|
|
17855
18296
|
idNumberType
|
|
17856
|
-
}), (
|
|
18297
|
+
}), countriesRequiringNationality.includes(countryRequiringNationality) && formUtils.isRequiredField("nationality") && jsx(CountryField, {
|
|
17857
18298
|
data: {
|
|
17858
18299
|
country: data.nationality
|
|
17859
18300
|
},
|
|
@@ -18111,7 +18552,7 @@ const proofOfNationalIdFormID = individualForms.proofOfNationalId.formId;
|
|
|
18111
18552
|
const proofOfRelationshipFormID = individualForms.proofOfRelationship.formId;
|
|
18112
18553
|
const individualDocumentForms = [idVerificationMethodFormID, idDocumentFormID, proofOfResidencyFormID, proofOfNationalIdFormID, proofOfRelationshipFormID];
|
|
18113
18554
|
function IndividualComponent(props) {
|
|
18114
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
18555
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
18115
18556
|
const {
|
|
18116
18557
|
i18n
|
|
18117
18558
|
} = useI18nContext();
|
|
@@ -18154,7 +18595,7 @@ function IndividualComponent(props) {
|
|
|
18154
18595
|
currentState,
|
|
18155
18596
|
prevState
|
|
18156
18597
|
}) => {
|
|
18157
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2,
|
|
18598
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j;
|
|
18158
18599
|
const residencyCountryPrev = (_b2 = (_a2 = prevState.data) == null ? void 0 : _a2.personalDetails) == null ? void 0 : _b2.residencyCountry;
|
|
18159
18600
|
const residencyCountry = (_d2 = (_c2 = currentState.data) == null ? void 0 : _c2.personalDetails) == null ? void 0 : _d2.residencyCountry;
|
|
18160
18601
|
if (residencyCountry != null && residencyCountry !== residencyCountryPrev) {
|
|
@@ -18165,13 +18606,18 @@ function IndividualComponent(props) {
|
|
|
18165
18606
|
if (idVerificationMethod != null && idVerificationMethod !== idVerificationMethodPrev) {
|
|
18166
18607
|
setIdVerificationMethodSelected(idVerificationMethod);
|
|
18167
18608
|
}
|
|
18168
|
-
const accountHolder = (_j = (
|
|
18609
|
+
const accountHolder = (_j = (_i2 = currentState.data) == null ? void 0 : _i2.personalDetails) == null ? void 0 : _j.accountHolder;
|
|
18169
18610
|
this.customNavigationHandler = accountHolder === "theCompanyIWorkFor" ? () => {
|
|
18170
18611
|
var _a3;
|
|
18171
18612
|
return (_a3 = props.onTypeSwitch) == null ? void 0 : _a3.call(props, LegalEntityType.ORGANIZATION);
|
|
18172
18613
|
} : null;
|
|
18173
18614
|
setData(currentState.data);
|
|
18174
18615
|
};
|
|
18616
|
+
const handleAddressChange = (addressData) => {
|
|
18617
|
+
updateStateSlice({
|
|
18618
|
+
...addressData
|
|
18619
|
+
});
|
|
18620
|
+
};
|
|
18175
18621
|
useEffect(() => {
|
|
18176
18622
|
var _a2, _b2, _c2;
|
|
18177
18623
|
const isIdDocumentFormActive = props.activeForm.formId === idDocumentFormID;
|
|
@@ -18179,8 +18625,18 @@ function IndividualComponent(props) {
|
|
|
18179
18625
|
const isIdAlreadyUploaded = ((_a2 = data == null ? void 0 : data.idDocument) == null ? void 0 : _a2.instantIdVerificationData) || ((_c2 = (_b2 = props.data) == null ? void 0 : _b2.idDocument) == null ? void 0 : _c2.idDocumentType);
|
|
18180
18626
|
props.setHideFooter(isIdDocumentFormActive && !isIdAlreadyUploaded && isInstantIdVerificationEnabled);
|
|
18181
18627
|
}, [props.activeForm, idVerificationMethodSelected, props.handleGetIdVerificationToken, (_f = data == null ? void 0 : data.idDocument) == null ? void 0 : _f.instantIdVerificationData, (_h = (_g = props.data) == null ? void 0 : _g.idDocument) == null ? void 0 : _h.idDocumentType]);
|
|
18182
|
-
const
|
|
18628
|
+
const addressSchema = getAddressSchemaForCountry((_i = data == null ? void 0 : data.personalDetails) == null ? void 0 : _i.residencyCountry).filter((field) => {
|
|
18183
18629
|
var _a2;
|
|
18630
|
+
if (!COUNTRIES_WITH_STATES_DATASET.includes((_a2 = data == null ? void 0 : data.personalDetails) == null ? void 0 : _a2.residencyCountry)) {
|
|
18631
|
+
return field !== "otherAddressInformation" && field !== "stateOrProvince";
|
|
18632
|
+
}
|
|
18633
|
+
return field !== "otherAddressInformation";
|
|
18634
|
+
});
|
|
18635
|
+
const {
|
|
18636
|
+
updateStateSlice
|
|
18637
|
+
} = useGlobalDataSlice("address");
|
|
18638
|
+
const renderActiveForm = (activeForm) => {
|
|
18639
|
+
var _a2, _b2;
|
|
18184
18640
|
return jsxs(Fragment, {
|
|
18185
18641
|
children: [jsx(StateContextWatcher, {
|
|
18186
18642
|
owner: "IndividualComponent",
|
|
@@ -18217,17 +18673,20 @@ function IndividualComponent(props) {
|
|
|
18217
18673
|
content: i18n.get("reasonForFillingIndividualAddressDetails"),
|
|
18218
18674
|
titleId: "whyDoINeedToFillInThisInformation",
|
|
18219
18675
|
contentId: "reasonForFillingIndividualAddressDetails"
|
|
18220
|
-
}), jsx(
|
|
18676
|
+
}), jsx(AddressExperimentWrapper, {
|
|
18221
18677
|
...addressFormProps,
|
|
18678
|
+
id: addressFormID,
|
|
18222
18679
|
data: {
|
|
18223
|
-
...
|
|
18224
|
-
country:
|
|
18680
|
+
...data.address,
|
|
18681
|
+
country: (_a2 = data == null ? void 0 : data.personalDetails) == null ? void 0 : _a2.residencyCountry
|
|
18225
18682
|
},
|
|
18226
|
-
|
|
18227
|
-
|
|
18683
|
+
requiredFields: addressSchema,
|
|
18684
|
+
optionalFields: ["otherAddressInformation"],
|
|
18228
18685
|
legalEntityId: props.legalEntityId,
|
|
18229
18686
|
handleAddressSearch: props.handleAddressSearch,
|
|
18230
|
-
handleFindAddress: props.handleFindAddress
|
|
18687
|
+
handleFindAddress: props.handleFindAddress,
|
|
18688
|
+
onChange: handleAddressChange,
|
|
18689
|
+
hideCountry: true
|
|
18231
18690
|
})]
|
|
18232
18691
|
})
|
|
18233
18692
|
}), !!props.handleGetIdVerificationToken && jsx("div", {
|
|
@@ -18236,7 +18695,7 @@ function IndividualComponent(props) {
|
|
|
18236
18695
|
...idVerificationMethodFormProps,
|
|
18237
18696
|
name: fullName,
|
|
18238
18697
|
id: idVerificationMethodFormID,
|
|
18239
|
-
countryOfResidence: (
|
|
18698
|
+
countryOfResidence: (_b2 = data == null ? void 0 : data.personalDetails) == null ? void 0 : _b2.residencyCountry
|
|
18240
18699
|
})
|
|
18241
18700
|
}), jsx("div", {
|
|
18242
18701
|
className: activeForm.formId !== idDocumentFormID ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper",
|
|
@@ -20608,46 +21067,26 @@ function SwiftCode(props) {
|
|
|
20608
21067
|
"aria-invalid": !valid.swiftCode
|
|
20609
21068
|
});
|
|
20610
21069
|
}
|
|
20611
|
-
const adyenKycCheckGuidance = "adyen-kyc-check-guidance";
|
|
20612
|
-
const adyenKycCheckGuidanceImage = "adyen-kyc-check-guidance__image";
|
|
20613
|
-
const adyenKycCheckGuidanceImageAnnotated = "adyen-kyc-check-guidance__image--annotated";
|
|
20614
|
-
const adyenKycCheckGuidanceImageInactive = "adyen-kyc-check-guidance__image--inactive";
|
|
20615
|
-
const adyenKycUsCheckAccountNumber = "adyen-kyc-us-check-account-number";
|
|
20616
|
-
const adyenKycUsCheckRoutingNumber = "adyen-kyc-us-check-routing-number";
|
|
20617
|
-
const styles$3 = {
|
|
20618
|
-
"adyen-kyc-check-guidance": "adyen-kyc-check-guidance",
|
|
20619
|
-
adyenKycCheckGuidance,
|
|
20620
|
-
"adyen-kyc-check-guidance__image": "adyen-kyc-check-guidance__image",
|
|
20621
|
-
adyenKycCheckGuidanceImage,
|
|
20622
|
-
"adyen-kyc-check-guidance__image--annotated": "adyen-kyc-check-guidance__image--annotated",
|
|
20623
|
-
adyenKycCheckGuidanceImageAnnotated,
|
|
20624
|
-
"adyen-kyc-check-guidance__image--inactive": "adyen-kyc-check-guidance__image--inactive",
|
|
20625
|
-
adyenKycCheckGuidanceImageInactive,
|
|
20626
|
-
"adyen-kyc-us-check-account-number": "adyen-kyc-us-check-account-number",
|
|
20627
|
-
adyenKycUsCheckAccountNumber,
|
|
20628
|
-
"adyen-kyc-us-check-routing-number": "adyen-kyc-us-check-routing-number",
|
|
20629
|
-
adyenKycUsCheckRoutingNumber
|
|
20630
|
-
};
|
|
20631
21070
|
const CheckGuidance = ({
|
|
20632
21071
|
annotated
|
|
20633
21072
|
}) => jsxs("div", {
|
|
20634
|
-
className:
|
|
21073
|
+
className: "adyen-kyc-check-guidance",
|
|
20635
21074
|
children: [jsx(Svg, {
|
|
20636
21075
|
type: "image",
|
|
20637
21076
|
name: "us-check-account-number",
|
|
20638
|
-
className: cx(
|
|
20639
|
-
|
|
21077
|
+
className: cx("adyen-kyc-check-guidance__image", "adyen-kyc-check-guidance__image--annotated", {
|
|
21078
|
+
"adyen-kyc-check-guidance__image--inactive": annotated !== "account"
|
|
20640
21079
|
})
|
|
20641
21080
|
}), jsx(Svg, {
|
|
20642
21081
|
type: "image",
|
|
20643
21082
|
name: "us-check-routing-number",
|
|
20644
|
-
className: cx(
|
|
20645
|
-
|
|
21083
|
+
className: cx("adyen-kyc-check-guidance__image", "adyen-kyc-check-guidance__image--annotated", {
|
|
21084
|
+
"adyen-kyc-check-guidance__image--inactive": annotated !== "routing"
|
|
20646
21085
|
})
|
|
20647
21086
|
}), jsx(Svg, {
|
|
20648
21087
|
name: "us-check",
|
|
20649
21088
|
type: "image",
|
|
20650
|
-
className:
|
|
21089
|
+
className: "adyen-kyc-check-guidance__image"
|
|
20651
21090
|
})]
|
|
20652
21091
|
});
|
|
20653
21092
|
const payoutAccountFields = ["accountHolder", ...ibanFields, ...branchCodeFields, ...swiftCodeFields, ...currencyFields, ...bankAccountNumberFields, ...bankNameFields, ...bankCodeFields];
|
|
@@ -24138,22 +24577,42 @@ const dbaNameFieldMetadata = {
|
|
|
24138
24577
|
label: "dbaName",
|
|
24139
24578
|
validators: [validateNotEmptyOnBlur]
|
|
24140
24579
|
};
|
|
24141
|
-
const
|
|
24142
|
-
|
|
24580
|
+
const mapAddressData = (verifiedBusiness) => ({
|
|
24581
|
+
address: verifiedBusiness.street ?? "",
|
|
24582
|
+
otherAddressInformation: verifiedBusiness.street2 ?? "",
|
|
24583
|
+
city: verifiedBusiness.city ?? "",
|
|
24584
|
+
postalCode: verifiedBusiness.zipcode ?? "",
|
|
24585
|
+
stateOrProvince: verifiedBusiness.state ?? ""
|
|
24586
|
+
});
|
|
24587
|
+
const applyVerifiedBusinessData = (verifiedBusiness, handleChangeFor) => {
|
|
24588
|
+
if (!verifiedBusiness) return;
|
|
24589
|
+
entriesOf(verifiedBusiness).forEach(([key, value]) => {
|
|
24590
|
+
switch (key) {
|
|
24591
|
+
case "name":
|
|
24592
|
+
if (value) handleChangeFor("legalCompanyName", "input")(value);
|
|
24593
|
+
break;
|
|
24594
|
+
case "isPrincipalAddress":
|
|
24595
|
+
if (value) handleChangeFor("operationalAddressIsSame", "input")(operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME);
|
|
24596
|
+
break;
|
|
24597
|
+
}
|
|
24598
|
+
});
|
|
24599
|
+
};
|
|
24600
|
+
const structuredList = "adyen-kyc-structured-list";
|
|
24601
|
+
const structuredListListItem = "adyen-kyc-structured-list-list-item";
|
|
24143
24602
|
const adyenLayoutMd = "adyen-layout-md";
|
|
24144
|
-
const
|
|
24145
|
-
const
|
|
24603
|
+
const structuredListLabel = "adyen-kyc-structured-list-label";
|
|
24604
|
+
const structuredListValue = "adyen-kyc-structured-list-value";
|
|
24146
24605
|
const styles$2 = {
|
|
24147
|
-
"
|
|
24148
|
-
|
|
24149
|
-
"
|
|
24150
|
-
|
|
24606
|
+
"structured-list": "adyen-kyc-structured-list",
|
|
24607
|
+
structuredList,
|
|
24608
|
+
"structured-list-list-item": "adyen-kyc-structured-list-list-item",
|
|
24609
|
+
structuredListListItem,
|
|
24151
24610
|
"adyen-layout-md": "adyen-layout-md",
|
|
24152
24611
|
adyenLayoutMd,
|
|
24153
|
-
"
|
|
24154
|
-
|
|
24155
|
-
"
|
|
24156
|
-
|
|
24612
|
+
"structured-list-label": "adyen-kyc-structured-list-label",
|
|
24613
|
+
structuredListLabel,
|
|
24614
|
+
"structured-list-value": "adyen-kyc-structured-list-value",
|
|
24615
|
+
structuredListValue
|
|
24157
24616
|
};
|
|
24158
24617
|
const StructuredList = ({
|
|
24159
24618
|
items
|
|
@@ -24162,28 +24621,29 @@ const StructuredList = ({
|
|
|
24162
24621
|
i18n
|
|
24163
24622
|
} = useI18nContext();
|
|
24164
24623
|
return jsx("dl", {
|
|
24165
|
-
className: styles$2
|
|
24624
|
+
className: styles$2.structuredList,
|
|
24166
24625
|
children: items.map((item) => jsxs("div", {
|
|
24167
|
-
className: styles$2
|
|
24626
|
+
className: styles$2.structuredListListItem,
|
|
24168
24627
|
children: [jsx("dt", {
|
|
24169
|
-
className: styles$2
|
|
24628
|
+
className: styles$2.structuredListLabel,
|
|
24170
24629
|
children: i18n.get(item.labelKey)
|
|
24171
24630
|
}), jsx("dd", {
|
|
24172
|
-
className: styles$2
|
|
24631
|
+
className: styles$2.structuredListValue,
|
|
24173
24632
|
children: item.value
|
|
24174
24633
|
})]
|
|
24175
24634
|
}, item.labelKey))
|
|
24176
24635
|
});
|
|
24177
24636
|
};
|
|
24178
24637
|
function VerifiedBusinessCard({
|
|
24179
|
-
verifiedBusiness
|
|
24638
|
+
verifiedBusiness,
|
|
24639
|
+
verifiedAddress
|
|
24180
24640
|
}) {
|
|
24181
24641
|
const {
|
|
24182
24642
|
i18n
|
|
24183
24643
|
} = useI18nContext();
|
|
24184
24644
|
const [expanded, setExpanded] = useState(false);
|
|
24185
|
-
const address = (
|
|
24186
|
-
const addressLink =
|
|
24645
|
+
const address = (verifiedAddress == null ? void 0 : verifiedAddress.address) && (verifiedAddress == null ? void 0 : verifiedAddress.city) && (verifiedAddress == null ? void 0 : verifiedAddress.stateOrProvince) && (verifiedAddress == null ? void 0 : verifiedAddress.postalCode) ? `${verifiedAddress == null ? void 0 : verifiedAddress.address} ${verifiedAddress.city} ${verifiedAddress.stateOrProvince} ${verifiedAddress.postalCode}` : verifiedBusiness == null ? void 0 : verifiedBusiness.address;
|
|
24646
|
+
const addressLink = address ? `https://www.google.com/maps/place/${address.replaceAll(" ", "+")}` : void 0;
|
|
24187
24647
|
const baseItems = useMemo(() => [{
|
|
24188
24648
|
labelKey: "legalCompanyName__US",
|
|
24189
24649
|
value: verifiedBusiness == null ? void 0 : verifiedBusiness.name
|
|
@@ -24196,7 +24656,7 @@ function VerifiedBusinessCard({
|
|
|
24196
24656
|
value: verifiedBusiness == null ? void 0 : verifiedBusiness.legalForm
|
|
24197
24657
|
}, {
|
|
24198
24658
|
labelKey: "address",
|
|
24199
|
-
value: jsxs("
|
|
24659
|
+
value: jsxs("span", {
|
|
24200
24660
|
className: "adyen-kyc-verified-business-card__address",
|
|
24201
24661
|
children: [address, addressLink && jsx(Link, {
|
|
24202
24662
|
external: true,
|
|
@@ -24205,24 +24665,30 @@ function VerifiedBusinessCard({
|
|
|
24205
24665
|
})]
|
|
24206
24666
|
})
|
|
24207
24667
|
}].filter((item) => !!item.value), [address, addressLink, i18n, verifiedBusiness == null ? void 0 : verifiedBusiness.legalForm]);
|
|
24208
|
-
|
|
24209
|
-
|
|
24210
|
-
|
|
24668
|
+
const expandedContentClasses = cx("adyen-kyc-verified-business-card__content", {
|
|
24669
|
+
"adyen-kyc-verified-business-card__content--collapsed": !expanded,
|
|
24670
|
+
"adyen-kyc-verified-business-card__content--expanded": expanded
|
|
24671
|
+
});
|
|
24672
|
+
return jsxs("section", {
|
|
24673
|
+
className: "adyen-kyc-verified-business-card",
|
|
24674
|
+
children: [jsxs("div", {
|
|
24675
|
+
className: "adyen-kyc-verified-business-card__content",
|
|
24211
24676
|
children: [jsx(StructuredList, {
|
|
24212
24677
|
items: baseItems
|
|
24213
|
-
}), jsx(Divider, {})
|
|
24214
|
-
|
|
24215
|
-
|
|
24216
|
-
|
|
24217
|
-
|
|
24218
|
-
|
|
24219
|
-
|
|
24220
|
-
|
|
24221
|
-
|
|
24222
|
-
|
|
24223
|
-
|
|
24224
|
-
|
|
24225
|
-
|
|
24678
|
+
}), jsx(Divider, {})]
|
|
24679
|
+
}), jsxs("div", {
|
|
24680
|
+
className: expandedContentClasses,
|
|
24681
|
+
children: [jsx(StructuredList, {
|
|
24682
|
+
items: expandedItems
|
|
24683
|
+
}), jsx(Divider, {})]
|
|
24684
|
+
}), jsx("div", {
|
|
24685
|
+
className: "adyen-kyc-verified-business-card__expand-button",
|
|
24686
|
+
children: jsx(Button, {
|
|
24687
|
+
label: expanded ? i18n.get("hideDetails") : i18n.get("showDetails"),
|
|
24688
|
+
showAsLink: true,
|
|
24689
|
+
onClick: () => setExpanded(!expanded)
|
|
24690
|
+
})
|
|
24691
|
+
})]
|
|
24226
24692
|
});
|
|
24227
24693
|
}
|
|
24228
24694
|
const ADDITIONAL_INFORMATION_FORM_ID = "additionalInformation";
|
|
@@ -24252,20 +24718,21 @@ function AdditionalInformationComponent({
|
|
|
24252
24718
|
handleFindAddress
|
|
24253
24719
|
}) {
|
|
24254
24720
|
var _a, _b, _c, _d;
|
|
24721
|
+
const {
|
|
24722
|
+
basicInformation
|
|
24723
|
+
} = useGlobalData();
|
|
24255
24724
|
const {
|
|
24256
24725
|
updateStateSlice
|
|
24257
24726
|
} = useGlobalDataSlice(ADDITIONAL_INFORMATION_FORM_ID);
|
|
24258
24727
|
const {
|
|
24259
24728
|
i18n
|
|
24260
24729
|
} = useI18nContext();
|
|
24730
|
+
const {
|
|
24731
|
+
isExperimentEnabled
|
|
24732
|
+
} = useExperimentsContext();
|
|
24261
24733
|
const showVerified = !!verifiedBusiness;
|
|
24262
24734
|
const showStockData = companyType === CompanyTypesValue.PUBLIC_COMPANY;
|
|
24263
|
-
const
|
|
24264
|
-
if (!COUNTRIES_WITH_STATES_DATASET.includes(country)) {
|
|
24265
|
-
return field !== "otherAddressInformation" && field !== "stateOrProvince";
|
|
24266
|
-
}
|
|
24267
|
-
return field !== "otherAddressInformation";
|
|
24268
|
-
});
|
|
24735
|
+
const addressSchema = getAddressSchemaForCountry(country).filter((field) => !COUNTRIES_WITH_STATES_DATASET.includes(country) ? field !== "stateOrProvince" : true);
|
|
24269
24736
|
const initialFormUtilsProps = useMemo(() => ({
|
|
24270
24737
|
data,
|
|
24271
24738
|
labels: labels2,
|
|
@@ -24397,10 +24864,30 @@ function AdditionalInformationComponent({
|
|
|
24397
24864
|
valid: formValid,
|
|
24398
24865
|
fieldProblems: formFieldProblems
|
|
24399
24866
|
});
|
|
24400
|
-
}, [formSchema, formData, formErrors,
|
|
24401
|
-
|
|
24402
|
-
if (verifiedBusiness
|
|
24403
|
-
|
|
24867
|
+
}, [formSchema, formData, formErrors, formValid, formFieldProblems]);
|
|
24868
|
+
const verifiedAddress = useMemo(() => {
|
|
24869
|
+
if (!verifiedBusiness) return void 0;
|
|
24870
|
+
return verifiedBusiness.isPrincipalAddress || verifiedBusiness.state && (basicInformation == null ? void 0 : basicInformation.stateOrProvince) !== verifiedBusiness.state ? {
|
|
24871
|
+
operationalAddress: {
|
|
24872
|
+
...mapAddressData(verifiedBusiness),
|
|
24873
|
+
country
|
|
24874
|
+
}
|
|
24875
|
+
} : {
|
|
24876
|
+
registrationAddress: {
|
|
24877
|
+
...mapAddressData(verifiedBusiness),
|
|
24878
|
+
country
|
|
24879
|
+
}
|
|
24880
|
+
};
|
|
24881
|
+
}, [verifiedBusiness, basicInformation == null ? void 0 : basicInformation.stateOrProvince, country]);
|
|
24882
|
+
const hideRegistrationAddress = useMemo(() => addressSchema.filter((field) => field !== "otherAddressInformation").every((field) => {
|
|
24883
|
+
var _a2;
|
|
24884
|
+
return !!((_a2 = verifiedAddress == null ? void 0 : verifiedAddress.registrationAddress) == null ? void 0 : _a2[field]);
|
|
24885
|
+
}) && Boolean(verifiedBusiness == null ? void 0 : verifiedBusiness.isTrustedAddress) && isExperimentEnabled("EnableNewAddressComponent"), [addressSchema, verifiedBusiness == null ? void 0 : verifiedBusiness.isTrustedAddress, isExperimentEnabled, verifiedAddress == null ? void 0 : verifiedAddress.registrationAddress]);
|
|
24886
|
+
useEffect(
|
|
24887
|
+
() => applyVerifiedBusinessData(verifiedBusiness, handleChangeFor),
|
|
24888
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
24889
|
+
[verifiedBusiness]
|
|
24890
|
+
);
|
|
24404
24891
|
useEffect(() => {
|
|
24405
24892
|
if (!verifiedBusiness && !showCompanyStructure) resetToDefaultData();
|
|
24406
24893
|
}, [verifiedBusiness]);
|
|
@@ -24421,7 +24908,14 @@ function AdditionalInformationComponent({
|
|
|
24421
24908
|
handleChangeFor("operationalAddress")(state.data);
|
|
24422
24909
|
setValid("operationalAddress", Boolean(state.isValid));
|
|
24423
24910
|
};
|
|
24424
|
-
const handleOperationalAddressIsSameChange = (isChecked) =>
|
|
24911
|
+
const handleOperationalAddressIsSameChange = (isChecked) => {
|
|
24912
|
+
if (isChecked) {
|
|
24913
|
+
handleChangeFor("operationalAddressIsSame")(operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_SAME);
|
|
24914
|
+
setValid("operationalAddress", true);
|
|
24915
|
+
} else {
|
|
24916
|
+
handleChangeFor("operationalAddressIsSame")(operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME);
|
|
24917
|
+
}
|
|
24918
|
+
};
|
|
24425
24919
|
return jsxs("form", {
|
|
24426
24920
|
id: ADDITIONAL_INFORMATION_FORM_ID,
|
|
24427
24921
|
className: "adyen-kyc-additional-information",
|
|
@@ -24433,7 +24927,7 @@ function AdditionalInformationComponent({
|
|
|
24433
24927
|
verificationErrors: formVerificationErrors,
|
|
24434
24928
|
validationErrors: fieldValidationErrors,
|
|
24435
24929
|
formUtils
|
|
24436
|
-
}), showVerified && jsxs("
|
|
24930
|
+
}), showVerified && jsxs("section", {
|
|
24437
24931
|
children: [jsx("div", {
|
|
24438
24932
|
className: "adyen-kyc-additional-information__section-heading",
|
|
24439
24933
|
children: jsx(Typography, {
|
|
@@ -24442,9 +24936,10 @@ function AdditionalInformationComponent({
|
|
|
24442
24936
|
children: i18n.get("verifiedInformation")
|
|
24443
24937
|
})
|
|
24444
24938
|
}), jsx(VerifiedBusinessCard, {
|
|
24445
|
-
verifiedBusiness
|
|
24939
|
+
verifiedBusiness,
|
|
24940
|
+
verifiedAddress: (verifiedAddress == null ? void 0 : verifiedAddress.registrationAddress) ?? (verifiedAddress == null ? void 0 : verifiedAddress.operationalAddress)
|
|
24446
24941
|
})]
|
|
24447
|
-
}), jsxs("
|
|
24942
|
+
}), jsxs("section", {
|
|
24448
24943
|
children: [showVerified && jsx("div", {
|
|
24449
24944
|
className: "adyen-kyc-additional-information__section-heading",
|
|
24450
24945
|
children: jsx(Typography, {
|
|
@@ -24452,114 +24947,116 @@ function AdditionalInformationComponent({
|
|
|
24452
24947
|
variant: "title",
|
|
24453
24948
|
children: i18n.get("otherBusinessInformation")
|
|
24454
24949
|
})
|
|
24455
|
-
}),
|
|
24456
|
-
|
|
24457
|
-
|
|
24458
|
-
|
|
24459
|
-
|
|
24460
|
-
|
|
24461
|
-
|
|
24462
|
-
|
|
24463
|
-
|
|
24464
|
-
|
|
24465
|
-
|
|
24466
|
-
|
|
24467
|
-
|
|
24468
|
-
|
|
24469
|
-
|
|
24470
|
-
|
|
24471
|
-
|
|
24472
|
-
|
|
24473
|
-
|
|
24474
|
-
|
|
24475
|
-
|
|
24476
|
-
|
|
24477
|
-
|
|
24478
|
-
|
|
24479
|
-
|
|
24480
|
-
|
|
24481
|
-
|
|
24482
|
-
|
|
24483
|
-
|
|
24484
|
-
|
|
24485
|
-
|
|
24486
|
-
|
|
24487
|
-
|
|
24488
|
-
|
|
24489
|
-
|
|
24490
|
-
|
|
24491
|
-
|
|
24492
|
-
|
|
24493
|
-
|
|
24494
|
-
|
|
24495
|
-
|
|
24496
|
-
|
|
24497
|
-
|
|
24498
|
-
|
|
24499
|
-
|
|
24500
|
-
|
|
24501
|
-
|
|
24502
|
-
|
|
24503
|
-
|
|
24504
|
-
|
|
24505
|
-
|
|
24506
|
-
|
|
24507
|
-
|
|
24508
|
-
|
|
24509
|
-
|
|
24510
|
-
|
|
24511
|
-
|
|
24512
|
-
|
|
24513
|
-
|
|
24514
|
-
|
|
24515
|
-
|
|
24516
|
-
|
|
24517
|
-
|
|
24518
|
-
|
|
24519
|
-
|
|
24520
|
-
|
|
24521
|
-
|
|
24522
|
-
|
|
24523
|
-
|
|
24524
|
-
|
|
24525
|
-
|
|
24526
|
-
|
|
24527
|
-
|
|
24528
|
-
|
|
24529
|
-
|
|
24530
|
-
|
|
24531
|
-
|
|
24532
|
-
|
|
24533
|
-
|
|
24534
|
-
|
|
24535
|
-
|
|
24536
|
-
|
|
24537
|
-
|
|
24538
|
-
|
|
24539
|
-
|
|
24540
|
-
|
|
24541
|
-
|
|
24542
|
-
|
|
24543
|
-
|
|
24544
|
-
|
|
24545
|
-
|
|
24546
|
-
|
|
24547
|
-
|
|
24548
|
-
|
|
24549
|
-
|
|
24550
|
-
|
|
24551
|
-
|
|
24552
|
-
|
|
24553
|
-
|
|
24554
|
-
|
|
24555
|
-
|
|
24556
|
-
|
|
24557
|
-
|
|
24558
|
-
|
|
24559
|
-
|
|
24560
|
-
|
|
24950
|
+
}), jsxs("fieldset", {
|
|
24951
|
+
children: [showField(LEGAL_COMPANY_NAME_FIELD) && jsx("div", {
|
|
24952
|
+
className: "adyen-kyc-field-wrapper",
|
|
24953
|
+
children: jsx(LegalCompanyNameField, {
|
|
24954
|
+
data: formUtils.getFieldData(formData, LEGAL_COMPANY_NAME_FIELD),
|
|
24955
|
+
valid: formUtils.getFieldValid(formValid, LEGAL_COMPANY_NAME_FIELD),
|
|
24956
|
+
errors: formUtils.getFieldErrors(formErrors, formFieldProblems, LEGAL_COMPANY_NAME_FIELD),
|
|
24957
|
+
labels: formUtils.getFieldLabels(LEGAL_COMPANY_NAME_FIELD),
|
|
24958
|
+
helperText: formUtils.getFieldHelperText(LEGAL_COMPANY_NAME_FIELD, {
|
|
24959
|
+
legalCompanyName: "legalCompanyName__helperText"
|
|
24960
|
+
}),
|
|
24961
|
+
readonly: formUtils.isReadOnly("legalCompanyName"),
|
|
24962
|
+
handleChangeFor
|
|
24963
|
+
})
|
|
24964
|
+
}), showField(DBA_NAME_FIELD) && jsx("div", {
|
|
24965
|
+
className: "adyen-kyc-field-wrapper",
|
|
24966
|
+
children: jsx(DBANameField, {
|
|
24967
|
+
data: formUtils.getFieldData(formData, DBA_NAME_FIELD),
|
|
24968
|
+
valid: formUtils.getFieldValid(formValid, DBA_NAME_FIELD),
|
|
24969
|
+
errors: formUtils.getFieldErrors(formErrors, formFieldProblems, DBA_NAME_FIELD),
|
|
24970
|
+
labels: formUtils.getFieldLabels(DBA_NAME_FIELD, {
|
|
24971
|
+
hasDba: "hasDba"
|
|
24972
|
+
}),
|
|
24973
|
+
readonly: formUtils.isReadOnly("dbaName"),
|
|
24974
|
+
handleChangeFor,
|
|
24975
|
+
setErrors
|
|
24976
|
+
})
|
|
24977
|
+
}), showField(BUSINESS_REGISTRATION_NUMBER_FIELD) && jsx("div", {
|
|
24978
|
+
className: "adyen-kyc-field-wrapper",
|
|
24979
|
+
children: jsx(BusinessRegistrationNumberField, {
|
|
24980
|
+
data: formUtils.getFieldData(formData, BUSINESS_REGISTRATION_NUMBER_FIELD),
|
|
24981
|
+
valid: formUtils.getFieldValid(formValid, BUSINESS_REGISTRATION_NUMBER_FIELD),
|
|
24982
|
+
errors: formUtils.getFieldErrors(formErrors, formFieldProblems, BUSINESS_REGISTRATION_NUMBER_FIELD),
|
|
24983
|
+
labels: formUtils.getFieldLabels(BUSINESS_REGISTRATION_NUMBER_FIELD, {
|
|
24984
|
+
exemptedFromRegistrationNumber: "iDontHaveARegistrationNumber"
|
|
24985
|
+
}),
|
|
24986
|
+
mask: formUtils.getMask("registrationNumber"),
|
|
24987
|
+
guidanceText: formUtils.getFieldGuidanceText(BUSINESS_REGISTRATION_NUMBER_FIELD),
|
|
24988
|
+
placeholders: formUtils.getFieldPlaceholders(BUSINESS_REGISTRATION_NUMBER_FIELD),
|
|
24989
|
+
helperText: formUtils.getFieldHelperText(BUSINESS_REGISTRATION_NUMBER_FIELD),
|
|
24990
|
+
readonly: formUtils.isReadOnly("registrationNumber"),
|
|
24991
|
+
optional: formUtils.isOptionalField("registrationNumber"),
|
|
24992
|
+
shouldValidate,
|
|
24993
|
+
handleChangeFor,
|
|
24994
|
+
country,
|
|
24995
|
+
canExempt: formUtils.isRequiredField("exemptedFromRegistrationNumber"),
|
|
24996
|
+
companyType,
|
|
24997
|
+
registrationNumberOptions,
|
|
24998
|
+
registrationNumberType,
|
|
24999
|
+
setRegistrationNumberType
|
|
25000
|
+
})
|
|
25001
|
+
}), showField(TAX_INFORMATION_FIELD) && jsx("div", {
|
|
25002
|
+
className: "adyen-kyc-field-wrapper",
|
|
25003
|
+
children: jsx(TaxInformationField, {
|
|
25004
|
+
data: formUtils.getFieldData(formData, TAX_INFORMATION_FIELD),
|
|
25005
|
+
valid: formUtils.getFieldValid(formValid, TAX_INFORMATION_FIELD),
|
|
25006
|
+
errors: formUtils.getFieldErrors(formErrors, formFieldProblems, TAX_INFORMATION_FIELD),
|
|
25007
|
+
labels: formUtils.getFieldLabels(TAX_INFORMATION_FIELD, {
|
|
25008
|
+
exemptedFromTax: "iDontHaveATaxId"
|
|
25009
|
+
}),
|
|
25010
|
+
mask: formUtils.getMask("taxInformation"),
|
|
25011
|
+
helperText: formUtils.getFieldHelperText(TAX_INFORMATION_FIELD),
|
|
25012
|
+
guidanceText: formUtils.getFieldGuidanceText(TAX_INFORMATION_FIELD),
|
|
25013
|
+
readonly: formUtils.isReadOnly("taxInformation"),
|
|
25014
|
+
shouldValidate,
|
|
25015
|
+
handleChangeFor,
|
|
25016
|
+
canExempt: formUtils.isRequiredField("exemptedFromTax"),
|
|
25017
|
+
isUen: formUtils.isRequiredField("isUen"),
|
|
25018
|
+
country,
|
|
25019
|
+
companyType,
|
|
25020
|
+
taxIdNumberType,
|
|
25021
|
+
setTaxIdNumberType,
|
|
25022
|
+
defaultData: data == null ? void 0 : data.taxInformation
|
|
25023
|
+
})
|
|
25024
|
+
}), showField(VAT_NUMBER_FIELD) && jsx("div", {
|
|
25025
|
+
className: "adyen-kyc-field-wrapper",
|
|
25026
|
+
children: jsx(VatNumberField, {
|
|
25027
|
+
data: formUtils.getFieldData(formData, VAT_NUMBER_FIELD),
|
|
25028
|
+
valid: formUtils.getFieldValid(formValid, VAT_NUMBER_FIELD),
|
|
25029
|
+
errors: formUtils.getFieldErrors(formErrors, formFieldProblems, VAT_NUMBER_FIELD),
|
|
25030
|
+
labels: formUtils.getFieldLabels(VAT_NUMBER_FIELD, {
|
|
25031
|
+
exemptedFromVat: "iDontHaveAVatNumber"
|
|
25032
|
+
}),
|
|
25033
|
+
mask: formUtils.getMask("vatNumber"),
|
|
25034
|
+
guidanceText: formUtils.getFieldGuidanceText(VAT_NUMBER_FIELD),
|
|
25035
|
+
placeholders: formUtils.getFieldPlaceholders(VAT_NUMBER_FIELD),
|
|
25036
|
+
readonly: formUtils.isReadOnly("vatNumber"),
|
|
25037
|
+
handleChangeFor,
|
|
25038
|
+
country,
|
|
25039
|
+
canExempt: formUtils.isRequiredField("exemptedFromVat"),
|
|
25040
|
+
vatNumberType,
|
|
25041
|
+
setVatNumberType,
|
|
25042
|
+
shouldValidate
|
|
25043
|
+
})
|
|
25044
|
+
}), showField(DATE_OF_INCORPORATION_FIELD) && jsx("div", {
|
|
25045
|
+
className: "adyen-kyc-field-wrapper",
|
|
25046
|
+
children: jsx(DateOfIncorporationField, {
|
|
25047
|
+
data: formUtils.getFieldData(formData, DATE_OF_INCORPORATION_FIELD),
|
|
25048
|
+
valid: formUtils.getFieldValid(formValid, DATE_OF_INCORPORATION_FIELD),
|
|
25049
|
+
errors: formUtils.getFieldErrors(formErrors, formFieldProblems, DATE_OF_INCORPORATION_FIELD),
|
|
25050
|
+
labels: formUtils.getFieldLabels(DATE_OF_INCORPORATION_FIELD),
|
|
25051
|
+
placeholders: formUtils.getFieldPlaceholders(DATE_OF_INCORPORATION_FIELD, {
|
|
25052
|
+
dateOfIncorporation: "datePlaceholder"
|
|
25053
|
+
}),
|
|
25054
|
+
readonly: formUtils.isReadOnly("dateOfIncorporation"),
|
|
25055
|
+
handleChangeFor
|
|
25056
|
+
})
|
|
25057
|
+
})]
|
|
24561
25058
|
})]
|
|
24562
|
-
}), showStockData && jsxs("
|
|
25059
|
+
}), showStockData && jsxs("section", {
|
|
24563
25060
|
children: [jsx("div", {
|
|
24564
25061
|
className: "adyen-kyc-additional-information__section-heading",
|
|
24565
25062
|
children: jsx(Typography, {
|
|
@@ -24567,50 +25064,55 @@ function AdditionalInformationComponent({
|
|
|
24567
25064
|
variant: "title",
|
|
24568
25065
|
children: i18n.get("stockExchangeInformation")
|
|
24569
25066
|
})
|
|
24570
|
-
}),
|
|
24571
|
-
|
|
24572
|
-
|
|
24573
|
-
|
|
24574
|
-
|
|
24575
|
-
|
|
24576
|
-
|
|
24577
|
-
|
|
24578
|
-
|
|
24579
|
-
|
|
24580
|
-
|
|
24581
|
-
|
|
24582
|
-
|
|
24583
|
-
|
|
24584
|
-
|
|
24585
|
-
|
|
24586
|
-
|
|
24587
|
-
|
|
24588
|
-
|
|
24589
|
-
|
|
24590
|
-
|
|
24591
|
-
|
|
24592
|
-
|
|
24593
|
-
|
|
24594
|
-
|
|
24595
|
-
|
|
24596
|
-
|
|
24597
|
-
|
|
24598
|
-
|
|
24599
|
-
|
|
24600
|
-
|
|
24601
|
-
|
|
24602
|
-
|
|
24603
|
-
|
|
24604
|
-
|
|
24605
|
-
|
|
24606
|
-
|
|
24607
|
-
|
|
24608
|
-
|
|
24609
|
-
|
|
24610
|
-
|
|
24611
|
-
|
|
25067
|
+
}), jsxs("fieldset", {
|
|
25068
|
+
children: [showField(STOCK_EXCHANGE_MIC_FIELD) && jsx("div", {
|
|
25069
|
+
className: "adyen-kyc-field-wrapper",
|
|
25070
|
+
children: jsx(StockExchangeMICField, {
|
|
25071
|
+
data: formUtils.getFieldData(formData, STOCK_EXCHANGE_MIC_FIELD),
|
|
25072
|
+
valid: formUtils.getFieldValid(formValid, STOCK_EXCHANGE_MIC_FIELD),
|
|
25073
|
+
errors: formUtils.getFieldErrors(formErrors, formFieldProblems, STOCK_EXCHANGE_MIC_FIELD),
|
|
25074
|
+
labels: formUtils.getFieldLabels(STOCK_EXCHANGE_MIC_FIELD),
|
|
25075
|
+
placeholders: formUtils.getFieldPlaceholders(STOCK_EXCHANGE_MIC_FIELD),
|
|
25076
|
+
mask: formUtils.getMask("stockExchangeMIC"),
|
|
25077
|
+
guidanceText: formUtils.getFieldGuidanceText(STOCK_EXCHANGE_MIC_FIELD),
|
|
25078
|
+
readonly: formUtils.isReadOnly("stockExchangeMIC"),
|
|
25079
|
+
shouldValidate,
|
|
25080
|
+
handleChangeFor
|
|
25081
|
+
})
|
|
25082
|
+
}), showField(STOCK_ISIN_FIELD) && jsx("div", {
|
|
25083
|
+
className: "adyen-kyc-field-wrapper",
|
|
25084
|
+
children: jsx(StockISINField, {
|
|
25085
|
+
data: formUtils.getFieldData(formData, STOCK_ISIN_FIELD),
|
|
25086
|
+
valid: formUtils.getFieldValid(formValid, STOCK_ISIN_FIELD),
|
|
25087
|
+
errors: formUtils.getFieldErrors(formErrors, formFieldProblems, STOCK_ISIN_FIELD),
|
|
25088
|
+
labels: formUtils.getFieldLabels(STOCK_ISIN_FIELD),
|
|
25089
|
+
placeholders: formUtils.getFieldPlaceholders(STOCK_ISIN_FIELD),
|
|
25090
|
+
mask: formUtils.getMask("stockISIN"),
|
|
25091
|
+
guidanceText: formUtils.getFieldGuidanceText(STOCK_ISIN_FIELD),
|
|
25092
|
+
readonly: formUtils.isReadOnly("stockISIN"),
|
|
25093
|
+
shouldValidate,
|
|
25094
|
+
handleChangeFor
|
|
25095
|
+
})
|
|
25096
|
+
}), showField(STOCK_TICKER_SYMBOL_FIELD) && jsx("div", {
|
|
25097
|
+
className: "adyen-kyc-field-wrapper",
|
|
25098
|
+
children: jsx(StockTickerSymbolField, {
|
|
25099
|
+
data: formUtils.getFieldData(formData, STOCK_TICKER_SYMBOL_FIELD),
|
|
25100
|
+
valid: formUtils.getFieldValid(formValid, STOCK_TICKER_SYMBOL_FIELD),
|
|
25101
|
+
errors: formUtils.getFieldErrors(formErrors, formFieldProblems, STOCK_TICKER_SYMBOL_FIELD),
|
|
25102
|
+
labels: formUtils.getFieldLabels(STOCK_TICKER_SYMBOL_FIELD),
|
|
25103
|
+
placeholders: formUtils.getFieldPlaceholders(STOCK_TICKER_SYMBOL_FIELD),
|
|
25104
|
+
mask: formUtils.getMask("stockTickerSymbol"),
|
|
25105
|
+
guidanceText: formUtils.getFieldGuidanceText(STOCK_TICKER_SYMBOL_FIELD),
|
|
25106
|
+
readonly: formUtils.isReadOnly("stockTickerSymbol"),
|
|
25107
|
+
shouldValidate,
|
|
25108
|
+
handleChangeFor
|
|
25109
|
+
})
|
|
25110
|
+
})]
|
|
24612
25111
|
})]
|
|
24613
|
-
}), jsxs("
|
|
25112
|
+
}), jsxs("section", {
|
|
25113
|
+
style: {
|
|
25114
|
+
display: hideRegistrationAddress ? "none" : "unset"
|
|
25115
|
+
},
|
|
24614
25116
|
children: [jsxs("div", {
|
|
24615
25117
|
className: "adyen-kyc-additional-information__section-heading",
|
|
24616
25118
|
children: [jsx(Typography, {
|
|
@@ -24622,7 +25124,7 @@ function AdditionalInformationComponent({
|
|
|
24622
25124
|
variant: "body",
|
|
24623
25125
|
children: i18n.get("registeredBusinessAddressDescription")
|
|
24624
25126
|
})]
|
|
24625
|
-
}), jsx(
|
|
25127
|
+
}), jsx(AddressExperimentWrapper, {
|
|
24626
25128
|
id: ADDITIONAL_INFORMATION_FORM_ID,
|
|
24627
25129
|
addressType: "registrationAddress",
|
|
24628
25130
|
data: {
|
|
@@ -24631,16 +25133,18 @@ function AdditionalInformationComponent({
|
|
|
24631
25133
|
},
|
|
24632
25134
|
labels: getAddressSchemaLabelsByCountry(country),
|
|
24633
25135
|
countryCode: country,
|
|
24634
|
-
requiredFields:
|
|
25136
|
+
requiredFields: addressSchema,
|
|
24635
25137
|
shouldValidate,
|
|
24636
25138
|
hideCountry: true,
|
|
24637
25139
|
optionalFields: ["otherAddressInformation"],
|
|
25140
|
+
readOnlyFields: verifiedBusiness ? ["stateOrProvince"] : [],
|
|
24638
25141
|
onChange: handleRegistrationAddressChange,
|
|
24639
25142
|
handleAddressSearch,
|
|
24640
25143
|
handleFindAddress,
|
|
24641
|
-
verifiedBusiness
|
|
25144
|
+
verifiedBusiness,
|
|
25145
|
+
verifiedAddress: verifiedAddress == null ? void 0 : verifiedAddress.registrationAddress
|
|
24642
25146
|
})]
|
|
24643
|
-
}), jsxs("
|
|
25147
|
+
}), jsxs("section", {
|
|
24644
25148
|
children: [jsxs("div", {
|
|
24645
25149
|
className: "adyen-kyc-additional-information__section-heading",
|
|
24646
25150
|
children: [jsx(Typography, {
|
|
@@ -24667,7 +25171,7 @@ function AdditionalInformationComponent({
|
|
|
24667
25171
|
checked: formData.operationalAddressIsSame ? formData.operationalAddressIsSame === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_SAME : true,
|
|
24668
25172
|
onChange: handleOperationalAddressIsSameChange
|
|
24669
25173
|
})
|
|
24670
|
-
}), formData.operationalAddressIsSame === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME && jsx(
|
|
25174
|
+
}), formData.operationalAddressIsSame === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME && jsx(AddressExperimentWrapper, {
|
|
24671
25175
|
id: ADDITIONAL_INFORMATION_FORM_ID,
|
|
24672
25176
|
addressType: "operationalAddress",
|
|
24673
25177
|
data: {
|
|
@@ -24676,12 +25180,15 @@ function AdditionalInformationComponent({
|
|
|
24676
25180
|
},
|
|
24677
25181
|
labels: getAddressSchemaLabelsByCountry(country),
|
|
24678
25182
|
countryCode: country,
|
|
24679
|
-
requiredFields:
|
|
25183
|
+
requiredFields: addressSchema,
|
|
24680
25184
|
shouldValidate,
|
|
25185
|
+
hideCountry: true,
|
|
24681
25186
|
optionalFields: ["otherAddressInformation"],
|
|
24682
25187
|
onChange: handleOperationalAddressChange,
|
|
24683
25188
|
handleAddressSearch,
|
|
24684
|
-
handleFindAddress
|
|
25189
|
+
handleFindAddress,
|
|
25190
|
+
verifiedBusiness,
|
|
25191
|
+
verifiedAddress: verifiedAddress == null ? void 0 : verifiedAddress.operationalAddress
|
|
24685
25192
|
})]
|
|
24686
25193
|
})]
|
|
24687
25194
|
});
|
|
@@ -24936,10 +25443,10 @@ function BusinessSelectionComponent({
|
|
|
24936
25443
|
if (fetching === "loading") return;
|
|
24937
25444
|
if (!selectedBusinessId || selectedBusinessId !== result.id) {
|
|
24938
25445
|
setSelectedBusinessId(result.id);
|
|
24939
|
-
const businessData = await fetchBusinessData(result);
|
|
25446
|
+
const businessData = await fetchBusinessData(result, basicInformation == null ? void 0 : basicInformation.stateOrProvince);
|
|
24940
25447
|
setCurrentBusinessSelection(businessData);
|
|
24941
25448
|
} else if (fetching === "error") {
|
|
24942
|
-
const businessData = await fetchBusinessData(result);
|
|
25449
|
+
const businessData = await fetchBusinessData(result, basicInformation == null ? void 0 : basicInformation.stateOrProvince);
|
|
24943
25450
|
setCurrentBusinessSelection(businessData);
|
|
24944
25451
|
}
|
|
24945
25452
|
} catch (e) {
|
|
@@ -27147,7 +27654,7 @@ function BusinessDetailsDropinComponent({
|
|
|
27147
27654
|
handleClearCompanyData,
|
|
27148
27655
|
onTypeSwitch
|
|
27149
27656
|
}) {
|
|
27150
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
27657
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
27151
27658
|
const {
|
|
27152
27659
|
state: {
|
|
27153
27660
|
currentState
|
|
@@ -27314,17 +27821,17 @@ function BusinessDetailsDropinComponent({
|
|
|
27314
27821
|
return tinMatch;
|
|
27315
27822
|
}, [verifyBusinessData]);
|
|
27316
27823
|
const findBusiness = useCallback(async (data) => {
|
|
27317
|
-
var _a2, _b2, _c2;
|
|
27824
|
+
var _a2, _b2, _c2, _d2;
|
|
27318
27825
|
const tin = (_c2 = (_b2 = (_a2 = currentState.data.basicInformation) == null ? void 0 : _a2.taxInformation) == null ? void 0 : _b2.find((taxId) => currentCountry === taxId.country)) == null ? void 0 : _c2.number;
|
|
27319
27826
|
const results = await searchForBusiness(data);
|
|
27320
27827
|
if (results && results.length === 1) {
|
|
27321
|
-
const businessData = await fetchBusinessData(results[0]);
|
|
27828
|
+
const businessData = await fetchBusinessData(results[0], (_d2 = currentState.data.basicInformation) == null ? void 0 : _d2.stateOrProvince);
|
|
27322
27829
|
if (businessData && tin) {
|
|
27323
27830
|
const tinMatch = await handleVerifyBusinessData(businessData, tin);
|
|
27324
27831
|
return tinMatch ? handleNextClick() : void 0;
|
|
27325
27832
|
}
|
|
27326
27833
|
}
|
|
27327
|
-
}, [currentCountry, (_e = currentState.data.basicInformation) == null ? void 0 : _e.taxInformation, fetchBusinessData, handleNextClick, searchForBusiness, handleVerifyBusinessData]);
|
|
27834
|
+
}, [currentCountry, (_e = currentState.data.basicInformation) == null ? void 0 : _e.taxInformation, (_f = currentState.data.basicInformation) == null ? void 0 : _f.stateOrProvince, fetchBusinessData, handleNextClick, searchForBusiness, handleVerifyBusinessData]);
|
|
27328
27835
|
useEffect(() => {
|
|
27329
27836
|
if (searchResults && !searchResults.length || searching === "error") {
|
|
27330
27837
|
setShowCompanyStructure(true);
|
|
@@ -27336,7 +27843,7 @@ function BusinessDetailsDropinComponent({
|
|
|
27336
27843
|
setShowCompanyStructure(false);
|
|
27337
27844
|
resetBusinessData();
|
|
27338
27845
|
}
|
|
27339
|
-
}, [currentSearchName, (
|
|
27846
|
+
}, [currentSearchName, (_g = currentState.data.basicInformation) == null ? void 0 : _g.businessName]);
|
|
27340
27847
|
const [showBusinessSelection, setShowBusinessSelection] = useState(false);
|
|
27341
27848
|
const isBusinessSelection = useMemo(() => showBusinessSelection && activeForm.formId === "basicInformation", [activeForm.formId, showBusinessSelection]);
|
|
27342
27849
|
const hideBack = useMemo(() => {
|
|
@@ -27383,7 +27890,7 @@ function BusinessDetailsDropinComponent({
|
|
|
27383
27890
|
default:
|
|
27384
27891
|
return gotoFormByFormIndex(index);
|
|
27385
27892
|
}
|
|
27386
|
-
}, [canSubmitForm, currentCountry, (
|
|
27893
|
+
}, [canSubmitForm, currentCountry, (_h = currentState.data.basicInformation) == null ? void 0 : _h.businessName, (_i = currentState.data.basicInformation) == null ? void 0 : _i.country, (_j = currentState.data.basicInformation) == null ? void 0 : _j.stateOrProvince, findBusiness, forms2, gotoFormByFormIndex, isBusinessSelection, searchResults, verifiedBusiness, activeForm.formId]);
|
|
27387
27894
|
const nextClick = useCallback(() => {
|
|
27388
27895
|
var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
|
|
27389
27896
|
if (!COUNTRIES_USING_COMPANY_SEARCH.includes(currentCountry)) return handleNextClick();
|
|
@@ -27406,7 +27913,7 @@ function BusinessDetailsDropinComponent({
|
|
|
27406
27913
|
default:
|
|
27407
27914
|
return handleNextClick();
|
|
27408
27915
|
}
|
|
27409
|
-
}, [currentCountry, handleNextClick, activeForm.formId, verifiedBusiness, (
|
|
27916
|
+
}, [currentCountry, handleNextClick, activeForm.formId, verifiedBusiness, (_k = currentState.validityByForm) == null ? void 0 : _k.basicInformation, (_l = currentState.data.basicInformation) == null ? void 0 : _l.businessName, (_m = currentState.data.basicInformation) == null ? void 0 : _m.country, (_n = currentState.data.basicInformation) == null ? void 0 : _n.stateOrProvince, isBusinessSelection, findBusiness]);
|
|
27410
27917
|
const backClick = useCallback(() => {
|
|
27411
27918
|
if (!COUNTRIES_USING_COMPANY_SEARCH.includes(country)) return handleNextClick();
|
|
27412
27919
|
switch (activeForm.formId) {
|
|
@@ -32702,7 +33209,8 @@ function IndividualDropinComponent({
|
|
|
32702
33209
|
country,
|
|
32703
33210
|
taskType,
|
|
32704
33211
|
isEmbeddedDropin,
|
|
32705
|
-
isExperimentEnabled
|
|
33212
|
+
isExperimentEnabled,
|
|
33213
|
+
rootLegalEntity: parentLegalEntity
|
|
32706
33214
|
}), [country, data, taskType]);
|
|
32707
33215
|
const customValidators = useMemo(() => isExperimentEnabled("EnableAgeVerification") ? validators({
|
|
32708
33216
|
country,
|
|
@@ -34653,6 +35161,7 @@ function ServiceAgreementDropinComponent({
|
|
|
34653
35161
|
handleDownloadAcceptedTermsOfServiceDocument,
|
|
34654
35162
|
handleDownloadUnacceptedTermsOfServiceDocument,
|
|
34655
35163
|
handleHomeClick,
|
|
35164
|
+
handleAddSigner,
|
|
34656
35165
|
handleSign,
|
|
34657
35166
|
taskType,
|
|
34658
35167
|
serviceAgreementTypes,
|
|
@@ -34693,8 +35202,8 @@ function ServiceAgreementDropinComponent({
|
|
|
34693
35202
|
const forms2 = [...signedForms, ...formsToBeSigned];
|
|
34694
35203
|
const [activeFormIndex, setActiveFormIndex] = useState(0);
|
|
34695
35204
|
const [activeForm, setActiveForm] = useState(forms2[activeFormIndex]);
|
|
34696
|
-
const canSign = (serviceAgreementTypes == null ? void 0 : serviceAgreementTypes.includes(activeForm.serviceAgreementType)) && !activeForm.acceptanceId;
|
|
34697
|
-
const showSignerCard = !!activeForm.acceptanceId;
|
|
35205
|
+
const canSign = (serviceAgreementTypes == null ? void 0 : serviceAgreementTypes.includes(activeForm == null ? void 0 : activeForm.serviceAgreementType)) && !(activeForm == null ? void 0 : activeForm.acceptanceId);
|
|
35206
|
+
const showSignerCard = !!(activeForm == null ? void 0 : activeForm.acceptanceId);
|
|
34698
35207
|
const handleServiceAgreementIsNotAvailableInThatLanguage = useCallback(() => {
|
|
34699
35208
|
showToast({
|
|
34700
35209
|
label: i18n.get("failedToGetServiceAgreementInSelectedLanguageFallbackToEn"),
|
|
@@ -34707,10 +35216,10 @@ function ServiceAgreementDropinComponent({
|
|
|
34707
35216
|
} = useServiceAgreement({
|
|
34708
35217
|
handleGetServiceAgreement,
|
|
34709
35218
|
handleServiceAgreementIsNotAvailableInThatLanguage,
|
|
34710
|
-
acceptanceId: activeForm.acceptanceId,
|
|
35219
|
+
acceptanceId: activeForm == null ? void 0 : activeForm.acceptanceId,
|
|
34711
35220
|
handleViewAcceptedTermsOfServiceDocument,
|
|
34712
35221
|
legalEntityId: legalEntityResponse.id,
|
|
34713
|
-
serviceAgreementType: activeForm.serviceAgreementType,
|
|
35222
|
+
serviceAgreementType: activeForm == null ? void 0 : activeForm.serviceAgreementType,
|
|
34714
35223
|
language: i18n.languageCode
|
|
34715
35224
|
});
|
|
34716
35225
|
const {
|
|
@@ -34865,12 +35374,24 @@ function ServiceAgreementDropinComponent({
|
|
|
34865
35374
|
});
|
|
34866
35375
|
}
|
|
34867
35376
|
};
|
|
35377
|
+
const addSignerAlert = jsx(Alert, {
|
|
35378
|
+
variant: signers.length ? "info" : "warning",
|
|
35379
|
+
className: "adyen-kyc-u-margin-top-16",
|
|
35380
|
+
title: i18n.get(signers.length ? "isYourNameMissingFromSigners" : "thereAreNoSigners"),
|
|
35381
|
+
children: jsx(Button, {
|
|
35382
|
+
label: i18n.get("addYourselfAsSigner"),
|
|
35383
|
+
onClick: handleAddSigner,
|
|
35384
|
+
showAsLink: true,
|
|
35385
|
+
underline: true,
|
|
35386
|
+
type: "button"
|
|
35387
|
+
})
|
|
35388
|
+
});
|
|
34868
35389
|
const sidebar = jsx(LoaderWrapper, {
|
|
34869
35390
|
status: loadingStatus,
|
|
34870
35391
|
formOpacityWhenLoading: 0.3,
|
|
34871
35392
|
showSpinner: false,
|
|
34872
35393
|
className: "adyen-kyc-dropin__sidebar-wrapper",
|
|
34873
|
-
children:
|
|
35394
|
+
children: jsx(FormNavigation, {
|
|
34874
35395
|
forms: forms2,
|
|
34875
35396
|
activeForm,
|
|
34876
35397
|
gotoForm,
|
|
@@ -34883,11 +35404,11 @@ function ServiceAgreementDropinComponent({
|
|
|
34883
35404
|
formOpacityWhenLoading: 0.3,
|
|
34884
35405
|
showSpinner: false,
|
|
34885
35406
|
className: "adyen-kyc-form-container",
|
|
34886
|
-
children: [
|
|
35407
|
+
children: [jsxs(LoaderWrapper, {
|
|
34887
35408
|
status: contractLoadingStatus,
|
|
34888
35409
|
formOpacityWhenLoading: 0.3,
|
|
34889
35410
|
showSpinner: false,
|
|
34890
|
-
children: serviceAgreement && jsxs(Fragment, {
|
|
35411
|
+
children: [serviceAgreement && jsxs(Fragment, {
|
|
34891
35412
|
children: [jsx(ContractViewer, {
|
|
34892
35413
|
contract: serviceAgreement.contract,
|
|
34893
35414
|
onExpandSection: handleExpandSection
|
|
@@ -34898,13 +35419,16 @@ function ServiceAgreementDropinComponent({
|
|
|
34898
35419
|
label: i18n.get("downloadAsPdf"),
|
|
34899
35420
|
icon: "download"
|
|
34900
35421
|
})]
|
|
34901
|
-
})
|
|
35422
|
+
}), !forms2.length && jsx(Alert, {
|
|
35423
|
+
variant: "info",
|
|
35424
|
+
title: i18n.get("nothingNeedsToBeSigned")
|
|
35425
|
+
})]
|
|
34902
35426
|
}), canSign && jsxs(Fragment, {
|
|
34903
|
-
children: [jsx(Field, {
|
|
35427
|
+
children: [!!signers.length && jsx(Field, {
|
|
34904
35428
|
name: "signer",
|
|
34905
35429
|
label: i18n.get("signer"),
|
|
34906
35430
|
classNameModifiers: ["col-50"],
|
|
34907
|
-
className: "adyen-kyc-u-margin-
|
|
35431
|
+
className: "adyen-kyc-u-margin-top-32",
|
|
34908
35432
|
errorMessage: i18n.get((_a = errors.signer) == null ? void 0 : _a.errorMessage),
|
|
34909
35433
|
isValid: valid.signer,
|
|
34910
35434
|
children: (childProps) => jsx(Select, {
|
|
@@ -34915,8 +35439,9 @@ function ServiceAgreementDropinComponent({
|
|
|
34915
35439
|
selected: data.signer,
|
|
34916
35440
|
items: signers
|
|
34917
35441
|
})
|
|
34918
|
-
}), jsx(Field, {
|
|
35442
|
+
}), addSignerAlert, jsx(Field, {
|
|
34919
35443
|
name: "acceptServiceAgreement",
|
|
35444
|
+
className: "adyen-kyc-u-margin-top-16",
|
|
34920
35445
|
errorMessage: i18n.get((_b = errors.acceptServiceAgreement) == null ? void 0 : _b.errorMessage),
|
|
34921
35446
|
isValid: valid.acceptServiceAgreement,
|
|
34922
35447
|
children: (childProps) => jsx(Checkbox, {
|
|
@@ -34946,7 +35471,7 @@ function ServiceAgreementDropinComponent({
|
|
|
34946
35471
|
homeButtonLabel: i18n.get("goToOverview"),
|
|
34947
35472
|
onNext: canSign ? handleSignClick : () => gotoForm(activeFormIndex + 1),
|
|
34948
35473
|
nextButtonLabel: i18n.get(canSign ? "sign" : "next"),
|
|
34949
|
-
nextButtonDisabled: !canSign && activeFormIndex === forms2.length - 1,
|
|
35474
|
+
nextButtonDisabled: forms2.length === 0 || !canSign && activeFormIndex === forms2.length - 1,
|
|
34950
35475
|
onBack: () => gotoForm(activeFormIndex - 1),
|
|
34951
35476
|
hideBackButton: activeFormIndex === 0,
|
|
34952
35477
|
backButtonLabel: i18n.get("previous")
|
|
@@ -35604,6 +36129,10 @@ const useNavigation = ({
|
|
|
35604
36129
|
onNavigate,
|
|
35605
36130
|
handleOpenSingpassAuthorizationLink
|
|
35606
36131
|
}) => {
|
|
36132
|
+
const {
|
|
36133
|
+
isSettingEnabled
|
|
36134
|
+
} = useSettingsContext();
|
|
36135
|
+
const showServiceAgreementsFirst = isSettingEnabled(SettingNames.ShowServiceAgreementsFirst);
|
|
35607
36136
|
const isNewEntryFlowEnabled = useEnableNewEntryFlow();
|
|
35608
36137
|
const showIntroduction = useShouldShowIntroduction({
|
|
35609
36138
|
legalEntity
|
|
@@ -35671,11 +36200,12 @@ const useNavigation = ({
|
|
|
35671
36200
|
canSeeEntitySelection,
|
|
35672
36201
|
showIntroduction,
|
|
35673
36202
|
isNewEntryFlowEnabled,
|
|
35674
|
-
shouldShowSingpassSelection
|
|
36203
|
+
shouldShowSingpassSelection,
|
|
36204
|
+
showServiceAgreementsFirst
|
|
35675
36205
|
});
|
|
35676
36206
|
setTaskHistory([...taskHistory.slice(0, taskHistory.length - 1), defaultTask]);
|
|
35677
36207
|
}
|
|
35678
|
-
}, [legalEntity, accountHolder, showIntroduction, isNewEntryFlowEnabled, shouldShowSingpassSelection, taskHistory]);
|
|
36208
|
+
}, [legalEntity, accountHolder, showIntroduction, isNewEntryFlowEnabled, shouldShowSingpassSelection, showServiceAgreementsFirst, taskHistory]);
|
|
35679
36209
|
return {
|
|
35680
36210
|
currentTask: actualTasks.at(-1),
|
|
35681
36211
|
previousTask: actualTasks.at(-2),
|
|
@@ -35688,9 +36218,13 @@ const getDefaultTask = ({
|
|
|
35688
36218
|
canSeeEntitySelection,
|
|
35689
36219
|
isNewEntryFlowEnabled,
|
|
35690
36220
|
showIntroduction,
|
|
35691
|
-
shouldShowSingpassSelection
|
|
36221
|
+
shouldShowSingpassSelection,
|
|
36222
|
+
showServiceAgreementsFirst
|
|
35692
36223
|
}) => {
|
|
35693
36224
|
const hasLegalEntityProgressedBeyondEntitySelection = hasProgressedBeyondEntitySelection(legalEntity);
|
|
36225
|
+
if (showServiceAgreementsFirst) {
|
|
36226
|
+
return TaskTypes.SERVICE_AGREEMENT;
|
|
36227
|
+
}
|
|
35694
36228
|
if (isNewEntryFlowEnabled && canSeeEntitySelection && !hasLegalEntityProgressedBeyondEntitySelection) return TaskTypes.BUSINESS_TYPE_SELECTION;
|
|
35695
36229
|
if (showIntroduction) return TaskTypes.INTRODUCTION;
|
|
35696
36230
|
if (shouldShowSingpassSelection) return TaskTypes.SINGPASS_SELECTION;
|
|
@@ -36769,7 +37303,8 @@ function DropinComposerComponent({
|
|
|
36769
37303
|
handleViewAcceptedTermsOfServiceDocument: args.handleViewAcceptedTermsOfServiceDocument,
|
|
36770
37304
|
handleDownloadAcceptedTermsOfServiceDocument: args.handleDownloadAcceptedTermsOfServiceDocument,
|
|
36771
37305
|
handleDownloadUnacceptedTermsOfServiceDocument: args.handleDownloadUnacceptedTermsOfServiceDocument,
|
|
36772
|
-
handleHomeClick:
|
|
37306
|
+
handleHomeClick: () => navigateTo(TaskTypes.TASKS_OVERVIEW),
|
|
37307
|
+
handleAddSigner: () => navigateTo(TaskTypes.DECISION_MAKER),
|
|
36773
37308
|
handleSign: async (...params) => {
|
|
36774
37309
|
await args.handleSignServiceAgreement(...params);
|
|
36775
37310
|
await getServiceAgreementStatus();
|
|
@@ -37206,7 +37741,8 @@ function CreateIndividualComponent({
|
|
|
37206
37741
|
onSubmitSuccess,
|
|
37207
37742
|
handleBackClick,
|
|
37208
37743
|
modalView,
|
|
37209
|
-
onClose
|
|
37744
|
+
onClose,
|
|
37745
|
+
onUnmount
|
|
37210
37746
|
}) {
|
|
37211
37747
|
var _a;
|
|
37212
37748
|
const {
|
|
@@ -37234,6 +37770,12 @@ function CreateIndividualComponent({
|
|
|
37234
37770
|
if (modalView) {
|
|
37235
37771
|
setIsModalView(true);
|
|
37236
37772
|
}
|
|
37773
|
+
const handleOnClose = () => {
|
|
37774
|
+
if (modalView) {
|
|
37775
|
+
onUnmount == null ? void 0 : onUnmount();
|
|
37776
|
+
}
|
|
37777
|
+
onClose == null ? void 0 : onClose();
|
|
37778
|
+
};
|
|
37237
37779
|
const fetchLegalEntity = useCallback(async () => {
|
|
37238
37780
|
try {
|
|
37239
37781
|
const [parentEntity, entity] = await Promise.all([parentLegalEntityId ? getLegalEntity2(parentLegalEntityId) : Promise.resolve(void 0), legalEntityId ? getLegalEntity2(legalEntityId) : Promise.resolve(void 0)]);
|
|
@@ -37248,9 +37790,10 @@ function CreateIndividualComponent({
|
|
|
37248
37790
|
}, [fetchLegalEntity]);
|
|
37249
37791
|
const country = ((_a = legalEntity == null ? void 0 : legalEntity.individual) == null ? void 0 : _a.residentialAddress.country) ?? contextCountry;
|
|
37250
37792
|
const onSubmit = (d) => {
|
|
37251
|
-
if (
|
|
37252
|
-
|
|
37793
|
+
if (modalView) {
|
|
37794
|
+
onUnmount == null ? void 0 : onUnmount();
|
|
37253
37795
|
}
|
|
37796
|
+
onSubmitSuccess == null ? void 0 : onSubmitSuccess(d);
|
|
37254
37797
|
};
|
|
37255
37798
|
return jsx(IndividualDropinComponent, {
|
|
37256
37799
|
parentLegalEntity,
|
|
@@ -37269,7 +37812,7 @@ function CreateIndividualComponent({
|
|
|
37269
37812
|
hideNavigation: true,
|
|
37270
37813
|
asModal: isModalView,
|
|
37271
37814
|
onSubmit,
|
|
37272
|
-
handleCloseClick:
|
|
37815
|
+
handleCloseClick: handleOnClose,
|
|
37273
37816
|
taskType
|
|
37274
37817
|
});
|
|
37275
37818
|
}
|
|
@@ -37342,18 +37885,15 @@ var OnboardingStatus = /* @__PURE__ */ ((OnboardingStatus2) => {
|
|
|
37342
37885
|
OnboardingStatus2["VERIFIED"] = "VERIFIED";
|
|
37343
37886
|
return OnboardingStatus2;
|
|
37344
37887
|
})(OnboardingStatus || {});
|
|
37345
|
-
const
|
|
37346
|
-
const
|
|
37347
|
-
const
|
|
37348
|
-
const adyenKycSkeletonText = "adyen-kyc-skeleton__text";
|
|
37888
|
+
const skeleton = "adyen-kyc-skeleton";
|
|
37889
|
+
const skeletonCircle = "adyen-kyc-skeleton-circle";
|
|
37890
|
+
const skeletonText = "adyen-kyc-skeleton-text";
|
|
37349
37891
|
const styles$1 = {
|
|
37350
|
-
"adyen-kyc-skeleton": "adyen-kyc-skeleton",
|
|
37351
|
-
adyenKycSkeleton,
|
|
37352
37892
|
skeleton,
|
|
37353
|
-
"
|
|
37354
|
-
|
|
37355
|
-
"
|
|
37356
|
-
|
|
37893
|
+
"skeleton-circle": "adyen-kyc-skeleton-circle",
|
|
37894
|
+
skeletonCircle,
|
|
37895
|
+
"skeleton-text": "adyen-kyc-skeleton-text",
|
|
37896
|
+
skeletonText
|
|
37357
37897
|
};
|
|
37358
37898
|
const Skeleton = ({
|
|
37359
37899
|
circle = false,
|
|
@@ -37361,9 +37901,9 @@ const Skeleton = ({
|
|
|
37361
37901
|
height = "1em",
|
|
37362
37902
|
width
|
|
37363
37903
|
}) => {
|
|
37364
|
-
const classNames = cx(
|
|
37365
|
-
[styles$1
|
|
37366
|
-
[styles$1
|
|
37904
|
+
const classNames = cx(styles$1.skeleton, {
|
|
37905
|
+
[styles$1.skeletonCircle]: circle,
|
|
37906
|
+
[styles$1.skeletonText]: text
|
|
37367
37907
|
});
|
|
37368
37908
|
return jsx("div", {
|
|
37369
37909
|
className: classNames,
|
|
@@ -37373,25 +37913,25 @@ const Skeleton = ({
|
|
|
37373
37913
|
}
|
|
37374
37914
|
});
|
|
37375
37915
|
};
|
|
37376
|
-
const
|
|
37377
|
-
const
|
|
37378
|
-
const
|
|
37379
|
-
const
|
|
37380
|
-
const
|
|
37381
|
-
const
|
|
37916
|
+
const embeddedStatus = "adyen-kyc-embedded-status";
|
|
37917
|
+
const embeddedStatusLoading = "adyen-kyc-embedded-status-loading";
|
|
37918
|
+
const embeddedStatusAvatar = "adyen-kyc-embedded-status-avatar";
|
|
37919
|
+
const embeddedStatusLight = "adyen-kyc-embedded-status-light";
|
|
37920
|
+
const embeddedStatusIcon = "adyen-kyc-embedded-status-icon";
|
|
37921
|
+
const embeddedStatusInfo = "adyen-kyc-embedded-status-info";
|
|
37382
37922
|
const styles = {
|
|
37383
|
-
"
|
|
37384
|
-
|
|
37385
|
-
"
|
|
37386
|
-
|
|
37387
|
-
"
|
|
37388
|
-
|
|
37389
|
-
"
|
|
37390
|
-
|
|
37391
|
-
"
|
|
37392
|
-
|
|
37393
|
-
"
|
|
37394
|
-
|
|
37923
|
+
"embedded-status": "adyen-kyc-embedded-status",
|
|
37924
|
+
embeddedStatus,
|
|
37925
|
+
"embedded-status-loading": "adyen-kyc-embedded-status-loading",
|
|
37926
|
+
embeddedStatusLoading,
|
|
37927
|
+
"embedded-status-avatar": "adyen-kyc-embedded-status-avatar",
|
|
37928
|
+
embeddedStatusAvatar,
|
|
37929
|
+
"embedded-status-light": "adyen-kyc-embedded-status-light",
|
|
37930
|
+
embeddedStatusLight,
|
|
37931
|
+
"embedded-status-icon": "adyen-kyc-embedded-status-icon",
|
|
37932
|
+
embeddedStatusIcon,
|
|
37933
|
+
"embedded-status-info": "adyen-kyc-embedded-status-info",
|
|
37934
|
+
embeddedStatusInfo
|
|
37395
37935
|
};
|
|
37396
37936
|
const statusToTag = (status) => {
|
|
37397
37937
|
switch (status) {
|
|
@@ -37456,23 +37996,23 @@ const EmbeddedStatus = ({
|
|
|
37456
37996
|
};
|
|
37457
37997
|
return jsxs("button", {
|
|
37458
37998
|
type: "button",
|
|
37459
|
-
className: cx(className, styles
|
|
37460
|
-
[styles
|
|
37461
|
-
[styles
|
|
37999
|
+
className: cx(className, styles.embeddedStatus, {
|
|
38000
|
+
[styles.embeddedStatusLoading]: loading,
|
|
38001
|
+
[styles.embeddedStatusLight]: light
|
|
37462
38002
|
}),
|
|
37463
38003
|
onClick,
|
|
37464
38004
|
children: [jsx("section", {
|
|
37465
|
-
className: styles
|
|
38005
|
+
className: styles.embeddedStatusAvatar,
|
|
37466
38006
|
children: loading ? jsx(Skeleton, {
|
|
37467
38007
|
height: "100%",
|
|
37468
38008
|
width: "100%",
|
|
37469
38009
|
circle: true
|
|
37470
38010
|
}) : jsx(Icon, {
|
|
37471
|
-
className: styles
|
|
38011
|
+
className: styles.embeddedStatusIcon,
|
|
37472
38012
|
name: iconName
|
|
37473
38013
|
})
|
|
37474
38014
|
}), jsx("section", {
|
|
37475
|
-
className: styles
|
|
38015
|
+
className: styles.embeddedStatusInfo,
|
|
37476
38016
|
children: loading ? jsxs(Fragment, {
|
|
37477
38017
|
children: [jsx(Skeleton, {
|
|
37478
38018
|
text: true,
|
|
@@ -37494,7 +38034,7 @@ const EmbeddedStatus = ({
|
|
|
37494
38034
|
})]
|
|
37495
38035
|
})
|
|
37496
38036
|
}), actionButton ? jsx("section", {
|
|
37497
|
-
className: styles
|
|
38037
|
+
className: styles.embeddedStatusButton,
|
|
37498
38038
|
children: loading ? jsx(Skeleton, {
|
|
37499
38039
|
width: "5em",
|
|
37500
38040
|
height: "2em"
|
|
@@ -37508,7 +38048,7 @@ const EmbeddedStatus = ({
|
|
|
37508
38048
|
small: true
|
|
37509
38049
|
})
|
|
37510
38050
|
}) : statusTag.translationKey && jsx("section", {
|
|
37511
|
-
className: styles
|
|
38051
|
+
className: styles.embeddedStatusTag,
|
|
37512
38052
|
children: loading ? jsx(Skeleton, {
|
|
37513
38053
|
width: "8ch",
|
|
37514
38054
|
height: "1em"
|
|
@@ -39626,7 +40166,7 @@ const ConfigurationApiProvider = ({
|
|
|
39626
40166
|
isEmbeddedDropin,
|
|
39627
40167
|
loadingContext
|
|
39628
40168
|
} = authContext;
|
|
39629
|
-
const sdkVersion = "2.
|
|
40169
|
+
const sdkVersion = "2.56.0";
|
|
39630
40170
|
useAnalytics({
|
|
39631
40171
|
onUserEvent,
|
|
39632
40172
|
legalEntityId: rootLegalEntityId,
|
|
@@ -39814,7 +40354,8 @@ const settingsDefaults = {
|
|
|
39814
40354
|
hideOnboardingIntroductionTrust: true,
|
|
39815
40355
|
hideOnboardingIntroductionSoleProprietor: true,
|
|
39816
40356
|
viewOnboardingGuidance: false,
|
|
39817
|
-
transferInstrumentLimit: 0
|
|
40357
|
+
transferInstrumentLimit: 0,
|
|
40358
|
+
showServiceAgreementsFirst: false
|
|
39818
40359
|
};
|
|
39819
40360
|
function SettingsProvider({
|
|
39820
40361
|
children,
|
|
@@ -40189,6 +40730,7 @@ class BaseElement {
|
|
|
40189
40730
|
...props
|
|
40190
40731
|
};
|
|
40191
40732
|
this._parentInstance = this.props._parentInstance;
|
|
40733
|
+
this.remove = this.remove.bind(this);
|
|
40192
40734
|
}
|
|
40193
40735
|
/**
|
|
40194
40736
|
* Mounts an element into the dom
|
|
@@ -40248,6 +40790,7 @@ class BaseElement {
|
|
|
40248
40790
|
if (this._node) {
|
|
40249
40791
|
render(null, this._node);
|
|
40250
40792
|
}
|
|
40793
|
+
this._node = void 0;
|
|
40251
40794
|
return this;
|
|
40252
40795
|
}
|
|
40253
40796
|
/**
|
|
@@ -40304,7 +40847,7 @@ const DebugModal = ({
|
|
|
40304
40847
|
};
|
|
40305
40848
|
const copyToClipboard = async () => {
|
|
40306
40849
|
const toCopy = {
|
|
40307
|
-
sdkVersion: "2.
|
|
40850
|
+
sdkVersion: "2.56.0",
|
|
40308
40851
|
experiments: Object.fromEntries(allExperimentsWithValues),
|
|
40309
40852
|
settings: Object.fromEntries(allSettingsWithValues)
|
|
40310
40853
|
};
|
|
@@ -40343,7 +40886,7 @@ const DebugModal = ({
|
|
|
40343
40886
|
children: [jsxs("div", {
|
|
40344
40887
|
className: "adyen-kyc-debug-modal__meta",
|
|
40345
40888
|
children: [jsxs("span", {
|
|
40346
|
-
children: ["SDK version: ", "2.
|
|
40889
|
+
children: ["SDK version: ", "2.56.0"]
|
|
40347
40890
|
}), jsxs("span", {
|
|
40348
40891
|
children: ["rootLegalEntityId: ", rootLegalEntityId]
|
|
40349
40892
|
})]
|
|
@@ -40491,14 +41034,14 @@ class UIElement extends BaseElement {
|
|
|
40491
41034
|
rootLegalEntityId,
|
|
40492
41035
|
handleGetLegalEntity: "handleGetLegalEntity" in this.props.componentProps ? this.props.componentProps.handleGetLegalEntity : void 0,
|
|
40493
41036
|
children: jsx("div", {
|
|
40494
|
-
className: "adyen-kyc-ui-element-container-wrapper",
|
|
40495
41037
|
children: jsx(AutoResizer, {
|
|
40496
41038
|
children: jsx("div", {
|
|
40497
41039
|
className: "adyen-kyc-ui-element-container",
|
|
40498
41040
|
children: jsx(ToastContextProvider, {
|
|
40499
41041
|
children: jsx(StateProvider, {
|
|
40500
41042
|
children: jsx(Component, {
|
|
40501
|
-
...this.props.componentProps
|
|
41043
|
+
...this.props.componentProps,
|
|
41044
|
+
onUnmount: this.remove
|
|
40502
41045
|
})
|
|
40503
41046
|
})
|
|
40504
41047
|
})
|