@adyen/kyc-components 3.37.1 → 3.38.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/adyen-kyc-components.es.js +273 -274
- package/dist/types/components/PayoutAccount/types.d.ts +0 -1
- package/dist/types/components/PayoutDetails/rules.d.ts +0 -9
- package/dist/types/components/PayoutDetails/types.d.ts +3 -3
- package/dist/types/components/PayoutDetails/utils.d.ts +1 -0
- package/dist/types/components/PayoutVerificationMethod/types.d.ts +1 -1
- package/dist/types/components/internal/DBANameField/types.d.ts +1 -1
- package/dist/types/core/Context/CoreContext.d.ts +1 -0
- package/dist/types/core/hooks/useScenarioConfiguration.d.ts +2 -2
- package/dist/types/core/hooks/useVersionConfiguration.d.ts +10 -1
- package/dist/types/core/models/api/company-search.d.ts +1 -1
- package/dist/types/utils/mapping/componentApiMapping.d.ts +4 -4
- package/package.json +2 -2
- package/dist/types/core/hooks/useHideButton.d.ts +0 -2
|
@@ -355,6 +355,7 @@ const defaultTrans = {
|
|
|
355
355
|
doNotHaveYTunnus: "I do not have a Y-TUNNUS",
|
|
356
356
|
doNotHaveAbn: "I do not have an ABN",
|
|
357
357
|
doNotHaveAcn: "I do not have an ACN",
|
|
358
|
+
doNotHaveNZBN: "I do not have a NZBN",
|
|
358
359
|
documentAddressedToName: "The document has to be addressed to %{name}",
|
|
359
360
|
documentCannotBeDamaged: "The document cannot be damaged",
|
|
360
361
|
documentIssuedByGovernmentAuthority: "The document has to be issued by a government authority. It's usually given when a business is created at the local commercial register",
|
|
@@ -2975,27 +2976,6 @@ function useResetGlobalData(caller) {
|
|
|
2975
2976
|
[dispatch, caller]
|
|
2976
2977
|
);
|
|
2977
2978
|
}
|
|
2978
|
-
const useSetting = (settingName) => {
|
|
2979
|
-
const context = useContext(SettingsContext);
|
|
2980
|
-
if (context === void 0) {
|
|
2981
|
-
throw new Error("useSetting must be used within a SettingsProvider");
|
|
2982
|
-
}
|
|
2983
|
-
const { getSetting } = context;
|
|
2984
|
-
return getSetting(settingName);
|
|
2985
|
-
};
|
|
2986
|
-
const logger$I = createLogger("useAllowedCountries");
|
|
2987
|
-
const useAllowedCountries = () => {
|
|
2988
|
-
const acceptedCountries = useSetting("acceptedCountries");
|
|
2989
|
-
const { getAllowedCountries: getAllowedCountries2 } = useConfigurationApi();
|
|
2990
|
-
const [allowedCountries, setAllowedCountries] = useState(
|
|
2991
|
-
acceptedCountries
|
|
2992
|
-
);
|
|
2993
|
-
useEffect(() => {
|
|
2994
|
-
if (acceptedCountries !== void 0) return;
|
|
2995
|
-
getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$I.error);
|
|
2996
|
-
}, [acceptedCountries]);
|
|
2997
|
-
return allowedCountries;
|
|
2998
|
-
};
|
|
2999
2979
|
class ValidationResult {
|
|
3000
2980
|
constructor(results) {
|
|
3001
2981
|
this.validationResults = results;
|
|
@@ -3013,7 +2993,7 @@ class ValidationResult {
|
|
|
3013
2993
|
return this.validationResults.find((result) => result.hasError);
|
|
3014
2994
|
}
|
|
3015
2995
|
}
|
|
3016
|
-
const logger$
|
|
2996
|
+
const logger$I = createLogger("useAsyncValidator");
|
|
3017
2997
|
const useAsyncValidator = (asyncRules) => {
|
|
3018
2998
|
const [asyncValidationResults, setAsyncValidationResults] = useState({});
|
|
3019
2999
|
const clearAsyncValidationResults = useCallback(() => setAsyncValidationResults({}), []);
|
|
@@ -3033,7 +3013,7 @@ const useAsyncValidator = (asyncRules) => {
|
|
|
3033
3013
|
}
|
|
3034
3014
|
])
|
|
3035
3015
|
});
|
|
3036
|
-
}).catch(logger$
|
|
3016
|
+
}).catch(logger$I.error);
|
|
3037
3017
|
},
|
|
3038
3018
|
[asyncRules, clearAsyncValidationResults]
|
|
3039
3019
|
);
|
|
@@ -5120,7 +5100,7 @@ const companyNameAndCountryFields = [
|
|
|
5120
5100
|
function CompanyNameAndCountry(props) {
|
|
5121
5101
|
const { i18n } = useI18nContext();
|
|
5122
5102
|
const { isSettingEnabled } = useSettingsContext();
|
|
5123
|
-
const allowedCountries =
|
|
5103
|
+
const { allowedCountries } = useCoreContext();
|
|
5124
5104
|
const { isExperimentEnabled } = useExperimentsContext();
|
|
5125
5105
|
const isStrictNameAndAddressValidationEnabled = isExperimentEnabled(
|
|
5126
5106
|
ExperimentNames.StrictNameAndAddressValidationV4
|
|
@@ -7364,7 +7344,7 @@ const deriveInputState = (isValid, isFocused, isDisabled, isOptional, hasNullish
|
|
|
7364
7344
|
};
|
|
7365
7345
|
};
|
|
7366
7346
|
const MISMATCH_ANIMATION_NAME = "mismatchShake";
|
|
7367
|
-
const logger$
|
|
7347
|
+
const logger$H = createLogger("MaskedInputText");
|
|
7368
7348
|
const MaskedInputText = ({
|
|
7369
7349
|
value,
|
|
7370
7350
|
onInput,
|
|
@@ -7409,7 +7389,7 @@ const MaskedInputText = ({
|
|
|
7409
7389
|
};
|
|
7410
7390
|
useEffect(() => {
|
|
7411
7391
|
if (!mask) {
|
|
7412
|
-
logger$
|
|
7392
|
+
logger$H.warn("`mask` is undefined. No masking of input will take place.");
|
|
7413
7393
|
}
|
|
7414
7394
|
}, [mask]);
|
|
7415
7395
|
const getMaskResult = useCallback(
|
|
@@ -7453,7 +7433,7 @@ const MaskedInputText = ({
|
|
|
7453
7433
|
return;
|
|
7454
7434
|
}
|
|
7455
7435
|
if (preserveMismatchingInitialValue) {
|
|
7456
|
-
logger$
|
|
7436
|
+
logger$H.warn(
|
|
7457
7437
|
`Value received "${value}" does not match mask`,
|
|
7458
7438
|
maskResult,
|
|
7459
7439
|
`
|
|
@@ -7463,7 +7443,7 @@ Preserving mismatched initial value until user input.`
|
|
|
7463
7443
|
return;
|
|
7464
7444
|
}
|
|
7465
7445
|
const fallback = displayValueToPure(maskResult.partialDisplayValue);
|
|
7466
|
-
logger$
|
|
7446
|
+
logger$H.warn(
|
|
7467
7447
|
`Value received "${value}" does not match mask`,
|
|
7468
7448
|
maskResult,
|
|
7469
7449
|
`
|
|
@@ -8244,7 +8224,7 @@ function DBANameField({
|
|
|
8244
8224
|
const isNo = selectedValue === "no";
|
|
8245
8225
|
handleChangeFor("hasDba")(isYes);
|
|
8246
8226
|
if (isDoingBusinessAsNameV4Enabled) {
|
|
8247
|
-
handleChangeFor("
|
|
8227
|
+
handleChangeFor("doingBusinessAsAbsent")(isNo);
|
|
8248
8228
|
if (isNo) {
|
|
8249
8229
|
handleChangeFor("dbaName")(legalCompanyName);
|
|
8250
8230
|
}
|
|
@@ -11232,7 +11212,7 @@ function Dropzone(props) {
|
|
|
11232
11212
|
isRequired && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-error-text", children: i18n.get("fieldIsRequired") })
|
|
11233
11213
|
] });
|
|
11234
11214
|
}
|
|
11235
|
-
const logger$
|
|
11215
|
+
const logger$G = createLogger("TextArea");
|
|
11236
11216
|
function TextArea(props) {
|
|
11237
11217
|
const { classNameModifiers, uniqueId, ...passedProps } = props;
|
|
11238
11218
|
const {
|
|
@@ -11247,7 +11227,7 @@ function TextArea(props) {
|
|
|
11247
11227
|
const { i18n } = useI18nContext();
|
|
11248
11228
|
const [value, setValue] = useState("");
|
|
11249
11229
|
if (Object.prototype.hasOwnProperty.call(props, "onChange")) {
|
|
11250
|
-
logger$
|
|
11230
|
+
logger$G.error("Error: Form fields that rely on InputBase may not have an onChange property");
|
|
11251
11231
|
}
|
|
11252
11232
|
const handleInput = (e) => {
|
|
11253
11233
|
var _a;
|
|
@@ -11666,7 +11646,7 @@ const styles$8 = {
|
|
|
11666
11646
|
"financial-information-reported-value-options": "adyen-kyc-financial-information-reported-value-options",
|
|
11667
11647
|
financialInformationReportedValueOptions
|
|
11668
11648
|
};
|
|
11669
|
-
const logger$
|
|
11649
|
+
const logger$F = createLogger("InputCurrency");
|
|
11670
11650
|
const determineDecimalSeparator = (formatter) => formatter.formatToParts(0.1).find((part) => part.type === "decimal").value;
|
|
11671
11651
|
const determineCurrencySymbol = (formatter) => formatter.formatToParts(0).find((part) => part.type === "currency").value;
|
|
11672
11652
|
const getNumberFromFormattedCurrency = (formatted, decimalSeparator) => {
|
|
@@ -11697,7 +11677,7 @@ const InputCurrency = ({
|
|
|
11697
11677
|
const rawValue = e.target.value;
|
|
11698
11678
|
const value = getNumberFromFormattedCurrency(rawValue, decimalSeparator);
|
|
11699
11679
|
if (Number.isNaN(value)) {
|
|
11700
|
-
logger$
|
|
11680
|
+
logger$F.warn(`Unable to get number from formatted currency: "${rawValue}"`);
|
|
11701
11681
|
setText(isUndefinedOrNull(amount) ? currencySymbol : formatter.format(amount));
|
|
11702
11682
|
return;
|
|
11703
11683
|
}
|
|
@@ -12163,7 +12143,7 @@ function FieldContainer(props) {
|
|
|
12163
12143
|
}
|
|
12164
12144
|
return renderField(fieldName);
|
|
12165
12145
|
}
|
|
12166
|
-
const logger$
|
|
12146
|
+
const logger$E = createLogger("SearchAddress");
|
|
12167
12147
|
const SearchAddress = ({
|
|
12168
12148
|
data,
|
|
12169
12149
|
legalEntityId,
|
|
@@ -12196,7 +12176,7 @@ const SearchAddress = ({
|
|
|
12196
12176
|
const response = await handleFindAddress(selectedAddressId);
|
|
12197
12177
|
autocompleteAddressForm(response);
|
|
12198
12178
|
} catch (e) {
|
|
12199
|
-
logger$
|
|
12179
|
+
logger$E.error(e);
|
|
12200
12180
|
}
|
|
12201
12181
|
};
|
|
12202
12182
|
const onDrilldown = async (selectedAddress) => {
|
|
@@ -12207,7 +12187,7 @@ const SearchAddress = ({
|
|
|
12207
12187
|
);
|
|
12208
12188
|
setItems((response == null ? void 0 : response.results) || []);
|
|
12209
12189
|
} catch (e) {
|
|
12210
|
-
logger$
|
|
12190
|
+
logger$E.error(e);
|
|
12211
12191
|
}
|
|
12212
12192
|
};
|
|
12213
12193
|
const onChange = (e) => {
|
|
@@ -12259,7 +12239,7 @@ const SearchAddress = ({
|
|
|
12259
12239
|
setItems([]);
|
|
12260
12240
|
}
|
|
12261
12241
|
} catch (e) {
|
|
12262
|
-
logger$
|
|
12242
|
+
logger$E.error(e);
|
|
12263
12243
|
}
|
|
12264
12244
|
setLoading(false);
|
|
12265
12245
|
}
|
|
@@ -12902,7 +12882,7 @@ Address.defaultProps = {
|
|
|
12902
12882
|
requiredFields: ADDRESS_SCHEMA,
|
|
12903
12883
|
countryCode: null
|
|
12904
12884
|
};
|
|
12905
|
-
const logger$
|
|
12885
|
+
const logger$D = createLogger("AddressFieldContainer");
|
|
12906
12886
|
const formatAddressItem = (item) => {
|
|
12907
12887
|
if (item.description.includes("Addresses")) {
|
|
12908
12888
|
const splittedDescription = item.description.split(" - ");
|
|
@@ -13040,7 +13020,7 @@ function FieldContainerComponent({
|
|
|
13040
13020
|
setItems([]);
|
|
13041
13021
|
}
|
|
13042
13022
|
} catch (e) {
|
|
13043
|
-
logger$
|
|
13023
|
+
logger$D.error(e);
|
|
13044
13024
|
}
|
|
13045
13025
|
setLoading(false);
|
|
13046
13026
|
};
|
|
@@ -13074,7 +13054,7 @@ function FieldContainerComponent({
|
|
|
13074
13054
|
});
|
|
13075
13055
|
}
|
|
13076
13056
|
} catch (e) {
|
|
13077
|
-
logger$
|
|
13057
|
+
logger$D.error(e);
|
|
13078
13058
|
}
|
|
13079
13059
|
};
|
|
13080
13060
|
const onDrilldown = async (address) => {
|
|
@@ -13086,7 +13066,7 @@ function FieldContainerComponent({
|
|
|
13086
13066
|
));
|
|
13087
13067
|
setItems((response == null ? void 0 : response.results) || []);
|
|
13088
13068
|
} catch (e) {
|
|
13089
|
-
logger$
|
|
13069
|
+
logger$D.error(e);
|
|
13090
13070
|
}
|
|
13091
13071
|
};
|
|
13092
13072
|
const handleOnChange = (e) => {
|
|
@@ -14231,6 +14211,7 @@ const COUNTRIES_WITH_POSSIBLE_REGISTRATION_EXEMPTIONS_FOR_SOLE_PROPS = [
|
|
|
14231
14211
|
CountryCodes.Germany,
|
|
14232
14212
|
CountryCodes.Lithuania,
|
|
14233
14213
|
CountryCodes.Luxembourg,
|
|
14214
|
+
CountryCodes.NewZealand,
|
|
14234
14215
|
CountryCodes.Poland,
|
|
14235
14216
|
CountryCodes.Sweden,
|
|
14236
14217
|
CountryCodes.Switzerland
|
|
@@ -14256,7 +14237,6 @@ const COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT = [
|
|
|
14256
14237
|
CountryCodes.IsleOfMan
|
|
14257
14238
|
];
|
|
14258
14239
|
const COUNTRIES_THAT_DO_NOT_USE_TAX_ID_FOR_SOLE_PROP = [
|
|
14259
|
-
CountryCodes.NewZealand,
|
|
14260
14240
|
CountryCodes.Singapore
|
|
14261
14241
|
];
|
|
14262
14242
|
const COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_COMPANIES = [
|
|
@@ -14452,7 +14432,7 @@ const rules$3 = ({
|
|
|
14452
14432
|
}
|
|
14453
14433
|
}
|
|
14454
14434
|
});
|
|
14455
|
-
const logger$
|
|
14435
|
+
const logger$C = createLogger("mapPayoutAccountSchemaToApiBankAccount");
|
|
14456
14436
|
const getAccountIdentificationFromPayoutAccountSchema = (payoutAccount, bankCountry) => {
|
|
14457
14437
|
var _a;
|
|
14458
14438
|
if ("iban" in payoutAccount && payoutAccount.iban)
|
|
@@ -14532,7 +14512,7 @@ const getAccountIdentificationFromPayoutAccountSchema = (payoutAccount, bankCoun
|
|
|
14532
14512
|
routingNumber: payoutAccount.branchCode
|
|
14533
14513
|
};
|
|
14534
14514
|
default:
|
|
14535
|
-
logger$
|
|
14515
|
+
logger$C.log(`${bankCountry.toLowerCase()}Local is not a configured region`);
|
|
14536
14516
|
return {
|
|
14537
14517
|
type: `${bankCountry.toLowerCase()}Local`,
|
|
14538
14518
|
accountNumber: payoutAccount.bankAccountNumber
|
|
@@ -14646,7 +14626,7 @@ const payoutBaseMapping = {
|
|
|
14646
14626
|
"bankAccount.accountIdentification.clearingNumber": "payoutAccountDetails.branchCode",
|
|
14647
14627
|
"bankAccount.accountIdentification.bic": "payoutAccountDetails.swiftCode",
|
|
14648
14628
|
"bankAccount.accountIdentification.sortCode": "payoutAccountDetails.branchCode",
|
|
14649
|
-
"bankAccount.accountIdentification.routingNumber": "payoutAccountDetails.
|
|
14629
|
+
"bankAccount.accountIdentification.routingNumber": "payoutAccountDetails.branchCode"
|
|
14650
14630
|
};
|
|
14651
14631
|
const businessDetailsBaseMapping = {
|
|
14652
14632
|
"basicInformation.country": "organization.registeredAddress.country",
|
|
@@ -14658,7 +14638,7 @@ const businessDetailsBaseMapping = {
|
|
|
14658
14638
|
"additionalInformation.legalCompanyName": "organization.legalName",
|
|
14659
14639
|
"additionalInformation.legalFormDescription": "organization.legalFormDescription",
|
|
14660
14640
|
"additionalInformation.dbaName": "organization.doingBusinessAs",
|
|
14661
|
-
"additionalInformation.
|
|
14641
|
+
"additionalInformation.doingBusinessAsAbsent": "organization.doingBusinessAsAbsent",
|
|
14662
14642
|
"additionalInformation.registrationNumber": "organization.registrationNumber",
|
|
14663
14643
|
"additionalInformation.taxInformation": "organization.taxInformation",
|
|
14664
14644
|
"additionalInformation.vatNumber": "organization.vatNumber",
|
|
@@ -14687,7 +14667,7 @@ const companyBaseMapping = {
|
|
|
14687
14667
|
"companyType.entityType": "organization.type",
|
|
14688
14668
|
"companyRegistrationDetails.tradingName": "organization.doingBusinessAs",
|
|
14689
14669
|
"companyRegistrationDetails.dbaName": "organization.doingBusinessAs",
|
|
14690
|
-
"companyRegistrationDetails.
|
|
14670
|
+
"companyRegistrationDetails.doingBusinessAsAbsent": "organization.doingBusinessAsAbsent",
|
|
14691
14671
|
"companyRegistrationDetails.registrationNumber": "organization.registrationNumber",
|
|
14692
14672
|
"companyRegistrationDetails.taxInformation": "organization.taxInformation",
|
|
14693
14673
|
"companyRegistrationDetails.vatNumber": "organization.vatNumber",
|
|
@@ -14713,7 +14693,7 @@ const trustBaseMapping = {
|
|
|
14713
14693
|
"trustRegistrationDetails.trustType": "trust.type",
|
|
14714
14694
|
"trustRegistrationDetails.legalName": "trust.name",
|
|
14715
14695
|
"trustRegistrationDetails.dbaName": "trust.doingBusinessAs",
|
|
14716
|
-
"trustRegistrationDetails.
|
|
14696
|
+
"trustRegistrationDetails.doingBusinessAsAbsent": "trust.doingBusinessAsAbsent",
|
|
14717
14697
|
"trustRegistrationDetails.country": "trust.countryOfGoverningLaw",
|
|
14718
14698
|
"trustRegistrationDetails.registrationNumber": "trust.registrationNumber",
|
|
14719
14699
|
"trustRegistrationAddress.registrationAddress.city": "trust.registeredAddress.city",
|
|
@@ -14734,7 +14714,7 @@ const solePropBaseMapping = {
|
|
|
14734
14714
|
"solePropNameAndCountry.legalCompanyName": "soleProprietorship.name",
|
|
14735
14715
|
"solePropRegistrationDetails.tradingName": "soleProprietorship.doingBusinessAs",
|
|
14736
14716
|
"solePropRegistrationDetails.dbaName": "soleProprietorship.doingBusinessAs",
|
|
14737
|
-
"solePropRegistrationDetails.
|
|
14717
|
+
"solePropRegistrationDetails.doingBusinessAsAbsent": "soleProprietorship.doingBusinessAsAbsent",
|
|
14738
14718
|
"solePropRegistrationDetails.vatNumber": "soleProprietorship.vatNumber",
|
|
14739
14719
|
"solePropRegistrationDetails.vatAbsenceReason": "soleProprietorship.vatAbsenceReason",
|
|
14740
14720
|
"solePropRegistrationDetails.exemptedFromTax": "soleProprietorship.taxAbsent",
|
|
@@ -15745,7 +15725,7 @@ const initOnfido = async ({
|
|
|
15745
15725
|
language: getOnfidoLocaleConfig(i18n)
|
|
15746
15726
|
});
|
|
15747
15727
|
};
|
|
15748
|
-
const logger$
|
|
15728
|
+
const logger$B = createLogger("IdVerificationComponent");
|
|
15749
15729
|
function IdVerificationComponent({
|
|
15750
15730
|
userDetails,
|
|
15751
15731
|
legalEntityId,
|
|
@@ -15774,7 +15754,7 @@ function IdVerificationComponent({
|
|
|
15774
15754
|
onIdVerificationError,
|
|
15775
15755
|
onIdVerificationComplete
|
|
15776
15756
|
});
|
|
15777
|
-
})().catch(logger$
|
|
15757
|
+
})().catch(logger$B.error);
|
|
15778
15758
|
return () => {
|
|
15779
15759
|
if (onfidoSdk.current) onfidoSdk.current.tearDown();
|
|
15780
15760
|
};
|
|
@@ -15818,7 +15798,7 @@ function IdDocumentAlreadyUpload(props) {
|
|
|
15818
15798
|
] })
|
|
15819
15799
|
] });
|
|
15820
15800
|
}
|
|
15821
|
-
const logger$
|
|
15801
|
+
const logger$A = createLogger("IdDocumentInstantVerificationComponent");
|
|
15822
15802
|
const idVerificationSchema = [
|
|
15823
15803
|
"instantIdVerificationData",
|
|
15824
15804
|
"idDocumentType"
|
|
@@ -15890,7 +15870,7 @@ function IdDocumentInstantVerificationComponent(props) {
|
|
|
15890
15870
|
userDetails: props.userDetails,
|
|
15891
15871
|
legalEntityId: props.legalEntityId,
|
|
15892
15872
|
onIdVerificationComplete: handleIdVerificationComplete,
|
|
15893
|
-
onIdVerificationError: logger$
|
|
15873
|
+
onIdVerificationError: logger$A.error
|
|
15894
15874
|
}
|
|
15895
15875
|
),
|
|
15896
15876
|
/* @__PURE__ */ jsxs("div", { className: "adyen-kyc-document-upload__manual-upload", children: [
|
|
@@ -16310,7 +16290,7 @@ const phoneFormatters = {
|
|
|
16310
16290
|
};
|
|
16311
16291
|
const phoneFields = ["phoneNumber"];
|
|
16312
16292
|
const DEFAULT_PHONE_PREFIX = "+1";
|
|
16313
|
-
const logger$
|
|
16293
|
+
const logger$z = createLogger("PhoneInput");
|
|
16314
16294
|
const usePhonePrefixes = () => {
|
|
16315
16295
|
const [phonePrefixes, setPhonePrefixes] = useState();
|
|
16316
16296
|
useEffect(() => {
|
|
@@ -16318,7 +16298,7 @@ const usePhonePrefixes = () => {
|
|
|
16318
16298
|
const loaded = (await import("./phonePrefixes-zV4hciyK.js")).default;
|
|
16319
16299
|
setPhonePrefixes(loaded);
|
|
16320
16300
|
};
|
|
16321
|
-
loadPhonePrefixes().catch(logger$
|
|
16301
|
+
loadPhonePrefixes().catch(logger$z.error);
|
|
16322
16302
|
}, []);
|
|
16323
16303
|
return phonePrefixes;
|
|
16324
16304
|
};
|
|
@@ -18357,7 +18337,7 @@ function PersonalDetailsComponent(props) {
|
|
|
18357
18337
|
var _a, _b, _c, _d;
|
|
18358
18338
|
const { i18n } = useI18nContext();
|
|
18359
18339
|
const { isSettingEnabled } = useSettingsContext();
|
|
18360
|
-
const allowedCountries =
|
|
18340
|
+
const { allowedCountries } = useCoreContext();
|
|
18361
18341
|
const canChangeEntityType = isSettingEnabled(SettingNames.AllowLegalEntityTypeChange);
|
|
18362
18342
|
const { isExperimentEnabled } = useExperimentsContext();
|
|
18363
18343
|
const isAgeVerificationEnabled = isExperimentEnabled("EnableAgeVerification");
|
|
@@ -19820,7 +19800,7 @@ class AdyenKycSdkError extends Error {
|
|
|
19820
19800
|
}
|
|
19821
19801
|
let sdkToken;
|
|
19822
19802
|
let fetchSdkToken;
|
|
19823
|
-
const logger$
|
|
19803
|
+
const logger$y = createLogger("Session");
|
|
19824
19804
|
const setSdkToken = (token) => {
|
|
19825
19805
|
sdkToken = token;
|
|
19826
19806
|
};
|
|
@@ -19845,7 +19825,7 @@ const refreshSession = async () => {
|
|
|
19845
19825
|
setSdkToken(token);
|
|
19846
19826
|
isSessionRefreshed = true;
|
|
19847
19827
|
} catch (e) {
|
|
19848
|
-
logger$
|
|
19828
|
+
logger$y.error("Failed to fetch sdk token", e);
|
|
19849
19829
|
}
|
|
19850
19830
|
return isSessionRefreshed;
|
|
19851
19831
|
};
|
|
@@ -19855,7 +19835,7 @@ const addAnimationStartListener = (element, listener) => {
|
|
|
19855
19835
|
const removeAnimationStartListener = (element, listener) => {
|
|
19856
19836
|
element.removeEventListener("animationstart", listener, false);
|
|
19857
19837
|
};
|
|
19858
|
-
const logger$
|
|
19838
|
+
const logger$x = createLogger("Fetch");
|
|
19859
19839
|
const getRequestObject = (options, data) => {
|
|
19860
19840
|
const { headers = [], method = "GET", authentication } = options;
|
|
19861
19841
|
let authHeaders;
|
|
@@ -19896,10 +19876,10 @@ const logFetchError = (message, level) => {
|
|
|
19896
19876
|
case "info":
|
|
19897
19877
|
case "warn":
|
|
19898
19878
|
case "error":
|
|
19899
|
-
logger$
|
|
19879
|
+
logger$x[level](message);
|
|
19900
19880
|
break;
|
|
19901
19881
|
default:
|
|
19902
|
-
logger$
|
|
19882
|
+
logger$x.error(message);
|
|
19903
19883
|
}
|
|
19904
19884
|
};
|
|
19905
19885
|
const handleFetchResponse = async (response, responseType) => {
|
|
@@ -19983,7 +19963,7 @@ const RELEVANT_MESSAGE_TYPES = ["account_verification_report_id", "error"];
|
|
|
19983
19963
|
const TERMINAL_DATA_PROPS = ["accounts", "error", "reference"];
|
|
19984
19964
|
const MOUNT_TIMEOUT = 10 * 1e3;
|
|
19985
19965
|
const TINK_VENDOR = "Tink";
|
|
19986
|
-
const logger$
|
|
19966
|
+
const logger$w = createLogger("iframeWidget");
|
|
19987
19967
|
const isObjectData = (data) => typeof data === "object" && !Array.isArray(data) && data !== null;
|
|
19988
19968
|
const isTerminalMessageData = (data) => isObjectData(data) && Object.entries(data).some(([prop]) => TERMINAL_DATA_PROPS.includes(prop));
|
|
19989
19969
|
const parseMessageJson = (message) => {
|
|
@@ -20001,7 +19981,7 @@ const callbackErrorHandler = async (response) => {
|
|
|
20001
19981
|
try {
|
|
20002
19982
|
await response;
|
|
20003
19983
|
} catch (ex) {
|
|
20004
|
-
logger$
|
|
19984
|
+
logger$w.error(ex);
|
|
20005
19985
|
}
|
|
20006
19986
|
return {
|
|
20007
19987
|
error: "UNKNOWN_ERROR",
|
|
@@ -20097,7 +20077,7 @@ class IFrameWidget {
|
|
|
20097
20077
|
message = responseData.errorMessage;
|
|
20098
20078
|
}
|
|
20099
20079
|
} catch (ex) {
|
|
20100
|
-
logger$
|
|
20080
|
+
logger$w.error(ex);
|
|
20101
20081
|
}
|
|
20102
20082
|
throw new AdyenKycSdkError(reason, jsonData.error);
|
|
20103
20083
|
}
|
|
@@ -21770,48 +21750,7 @@ const Skeleton = ({
|
|
|
21770
21750
|
});
|
|
21771
21751
|
return /* @__PURE__ */ jsx("div", { className: classNames, style: { height, width } });
|
|
21772
21752
|
};
|
|
21773
|
-
const isInstantVerificationAvailable = ({
|
|
21774
|
-
verificationVendorsCallback,
|
|
21775
|
-
provider
|
|
21776
|
-
}) => Boolean(verificationVendorsCallback && (provider == null ? void 0 : provider.redirectUrl));
|
|
21777
21753
|
const isProviderPlaidEmbedded = (redirectUrl) => !!(redirectUrl == null ? void 0 : redirectUrl.includes("/plaid/embedded-search/sdk?"));
|
|
21778
|
-
const rules$2 = ({ data, requiredFields }) => ({
|
|
21779
|
-
whenUsingManualVerification: () => {
|
|
21780
|
-
var _a;
|
|
21781
|
-
if (!data.payoutVerificationMethod) return;
|
|
21782
|
-
if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification") {
|
|
21783
|
-
return "REQUIRED";
|
|
21784
|
-
}
|
|
21785
|
-
},
|
|
21786
|
-
whenUsingInstantVerification: () => {
|
|
21787
|
-
var _a;
|
|
21788
|
-
if (!data.payoutVerificationMethod) {
|
|
21789
|
-
return "REQUIRED";
|
|
21790
|
-
}
|
|
21791
|
-
if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "instantVerification") {
|
|
21792
|
-
return "REQUIRED";
|
|
21793
|
-
}
|
|
21794
|
-
},
|
|
21795
|
-
verifiedBankAccountNumber: () => {
|
|
21796
|
-
var _a;
|
|
21797
|
-
if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "instantVerification") {
|
|
21798
|
-
return "REQUIRED";
|
|
21799
|
-
}
|
|
21800
|
-
},
|
|
21801
|
-
bankStatementRequirement: () => {
|
|
21802
|
-
var _a;
|
|
21803
|
-
if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification") {
|
|
21804
|
-
return requiredFields == null ? void 0 : requiredFields.bankStatementRequirement;
|
|
21805
|
-
}
|
|
21806
|
-
},
|
|
21807
|
-
// "bankStatement description" field is always "optional" and it's coupled with bank statement document.
|
|
21808
|
-
bankStatementDescription: () => {
|
|
21809
|
-
var _a;
|
|
21810
|
-
if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification" && !!(requiredFields == null ? void 0 : requiredFields.bankStatementRequirement)) {
|
|
21811
|
-
return "OPTIONAL";
|
|
21812
|
-
}
|
|
21813
|
-
}
|
|
21814
|
-
});
|
|
21815
21754
|
const preferInstantVerificationMethod = "adyen-kyc-prefer-instant-verification-method";
|
|
21816
21755
|
const preferInstantVerificationMethodCard = "adyen-kyc-prefer-instant-verification-method-card";
|
|
21817
21756
|
const preferInstantVerificationMethodImage = "adyen-kyc-prefer-instant-verification-method-image";
|
|
@@ -21965,7 +21904,7 @@ function PayoutVerificationMethod(props) {
|
|
|
21965
21904
|
accountHolder,
|
|
21966
21905
|
provider,
|
|
21967
21906
|
bankVendorsLoadingStatus,
|
|
21968
|
-
|
|
21907
|
+
instantVerificationAvailable,
|
|
21969
21908
|
legalEntityResponse,
|
|
21970
21909
|
forms,
|
|
21971
21910
|
validators: validators2,
|
|
@@ -22013,14 +21952,8 @@ function PayoutVerificationMethod(props) {
|
|
|
22013
21952
|
);
|
|
22014
21953
|
useEffect(() => {
|
|
22015
21954
|
if (!enablePreferInstantVerificationMethodFlow) return;
|
|
22016
|
-
setHideFooter == null ? void 0 : setHideFooter(
|
|
22017
|
-
enablePreferInstantVerificationMethodFlow && isActiveForm && !bankInfoValidated
|
|
22018
|
-
);
|
|
21955
|
+
setHideFooter == null ? void 0 : setHideFooter(isActiveForm && !bankInfoValidated);
|
|
22019
21956
|
}, [enablePreferInstantVerificationMethodFlow, isActiveForm, bankInfoValidated, setHideFooter]);
|
|
22020
|
-
const instantVerificationAvailable = useMemo(
|
|
22021
|
-
() => Boolean(instantVerificationAllowed && (provider == null ? void 0 : provider.redirectUrl)),
|
|
22022
|
-
[instantVerificationAllowed, provider]
|
|
22023
|
-
);
|
|
22024
21957
|
const methodsMetadata = makePayoutVerificationMethodsMetadata(provider == null ? void 0 : provider.name);
|
|
22025
21958
|
const selectVerificationMethod = (method) => {
|
|
22026
21959
|
setHasSelectedMethod(true);
|
|
@@ -22247,8 +22180,7 @@ function PayoutDetailsComponent(props) {
|
|
|
22247
22180
|
associatedLegalArrangement,
|
|
22248
22181
|
provider,
|
|
22249
22182
|
bankVendorsLoadingStatus,
|
|
22250
|
-
|
|
22251
|
-
handleGetBankVerificationVendors,
|
|
22183
|
+
instantVerificationAvailable,
|
|
22252
22184
|
setHideDropinLayout,
|
|
22253
22185
|
setHideOnHomeButton,
|
|
22254
22186
|
setSkipSubmit,
|
|
@@ -22337,9 +22269,7 @@ function PayoutDetailsComponent(props) {
|
|
|
22337
22269
|
bankInfoValidated,
|
|
22338
22270
|
setBankInfoValidated,
|
|
22339
22271
|
handleNextClick,
|
|
22340
|
-
|
|
22341
|
-
instantVerificationEnabled && handleGetBankVerificationVendors
|
|
22342
|
-
),
|
|
22272
|
+
instantVerificationAvailable,
|
|
22343
22273
|
createTrustedTransferInstrument: createTrustedTransferInstrument2,
|
|
22344
22274
|
handleBankVerificationError: handleBankVerificationError2,
|
|
22345
22275
|
setBankVerificationError: setInstantVerificationError,
|
|
@@ -24416,11 +24346,6 @@ const trackNavigation = ({
|
|
|
24416
24346
|
}
|
|
24417
24347
|
});
|
|
24418
24348
|
};
|
|
24419
|
-
const useHideButton = (condition, setHideState) => {
|
|
24420
|
-
useEffect(() => {
|
|
24421
|
-
setHideState == null ? void 0 : setHideState(condition);
|
|
24422
|
-
}, [condition, setHideState]);
|
|
24423
|
-
};
|
|
24424
24349
|
const getOpeningStep = (forms, remediationActions) => {
|
|
24425
24350
|
var _a;
|
|
24426
24351
|
if (remediationActions && Object.keys(remediationActions).length > 0) {
|
|
@@ -24458,10 +24383,6 @@ const useFormComposer = ({
|
|
|
24458
24383
|
const totalSteps = forms.length;
|
|
24459
24384
|
const isFinalStep = currentStep === totalSteps - 1;
|
|
24460
24385
|
const isFirstStep = currentStep === 0;
|
|
24461
|
-
const [hideHomeButton, setHideHomeButton] = useState(false);
|
|
24462
|
-
const [hideBackButton, setHideBackButton] = useState(false);
|
|
24463
|
-
useHideButton(isFirstStep, setHideBackButton);
|
|
24464
|
-
useHideButton(isFinalStep, setHideHomeButton);
|
|
24465
24386
|
useEffect(() => {
|
|
24466
24387
|
setActiveForm(
|
|
24467
24388
|
(activeForm2) => forms.find(({ formId }) => formId === activeForm2.formId) ?? activeForm2
|
|
@@ -24539,8 +24460,8 @@ const useFormComposer = ({
|
|
|
24539
24460
|
return {
|
|
24540
24461
|
handleBackClick: backClickHandler,
|
|
24541
24462
|
handleNextClick,
|
|
24542
|
-
hideHomeButton,
|
|
24543
|
-
hideBackButton,
|
|
24463
|
+
hideHomeButton: isFirstStep,
|
|
24464
|
+
hideBackButton: isFinalStep,
|
|
24544
24465
|
nextButtonLabel,
|
|
24545
24466
|
gotoFormByFormIndex,
|
|
24546
24467
|
activeForm,
|
|
@@ -24608,13 +24529,13 @@ const useUnifyLoadingStatus = (setParentLoadingStatus, ...childLoadingStatuses)
|
|
|
24608
24529
|
setParentLoadingStatus(loadingStatus);
|
|
24609
24530
|
}, [...childLoadingStatuses]);
|
|
24610
24531
|
};
|
|
24611
|
-
const logger$
|
|
24532
|
+
const logger$v = createLogger("useScenarioConfiguration");
|
|
24612
24533
|
const useScenarioConfiguration = ({
|
|
24613
24534
|
getConfigurationData,
|
|
24614
24535
|
getPayoutAccountFormatData,
|
|
24615
24536
|
parseConfiguration: parseConfiguration2,
|
|
24616
24537
|
country,
|
|
24617
|
-
|
|
24538
|
+
instantVerificationAvailable,
|
|
24618
24539
|
setLoadingStatus,
|
|
24619
24540
|
existingBankAccountFormat
|
|
24620
24541
|
}) => {
|
|
@@ -24631,12 +24552,12 @@ const useScenarioConfiguration = ({
|
|
|
24631
24552
|
const response = await getConfigurationData();
|
|
24632
24553
|
setConfigurationResponse(response);
|
|
24633
24554
|
} catch (err) {
|
|
24634
|
-
logger$
|
|
24555
|
+
logger$v.warn("WARNING: Configuration request failed - error:", err);
|
|
24635
24556
|
} finally {
|
|
24636
24557
|
setConfigurationLoadingStatus("success");
|
|
24637
24558
|
}
|
|
24638
24559
|
};
|
|
24639
|
-
makeConfigCallAndSave().catch(logger$
|
|
24560
|
+
makeConfigCallAndSave().catch(logger$v.error);
|
|
24640
24561
|
}, [getConfigurationData, setConfigurationLoadingStatus]);
|
|
24641
24562
|
useEffect(() => {
|
|
24642
24563
|
if (!getPayoutAccountFormatData) return;
|
|
@@ -24655,12 +24576,12 @@ const useScenarioConfiguration = ({
|
|
|
24655
24576
|
const defaultAccountFormat = defaultPayoutAccountFormat[country] ?? allowedBankAccountFormats[0];
|
|
24656
24577
|
setAccountFormat(existingBankAccountFormat ?? defaultAccountFormat);
|
|
24657
24578
|
} catch (err) {
|
|
24658
|
-
logger$
|
|
24579
|
+
logger$v.warn("WARNING: Payout format request failed - error:", err);
|
|
24659
24580
|
} finally {
|
|
24660
24581
|
setpayoutFormatLoadingStatus("success");
|
|
24661
24582
|
}
|
|
24662
24583
|
};
|
|
24663
|
-
makePayoutFormatCallAndSave().catch(logger$
|
|
24584
|
+
makePayoutFormatCallAndSave().catch(logger$v.error);
|
|
24664
24585
|
}, [
|
|
24665
24586
|
country,
|
|
24666
24587
|
setAccountFormat,
|
|
@@ -24670,14 +24591,14 @@ const useScenarioConfiguration = ({
|
|
|
24670
24591
|
]);
|
|
24671
24592
|
const { fieldConfigurations, requiredFields } = useMemo(() => {
|
|
24672
24593
|
if (!configurationResponse) return {};
|
|
24673
|
-
const { matchingScenario
|
|
24594
|
+
const { matchingScenario } = configurationResponse;
|
|
24674
24595
|
const payoutRequiredFields = accountFormatResponse && accountFormat ? accountFormatResponse[accountFormat] : void 0;
|
|
24675
24596
|
const scenarioConfig = parseConfiguration2(
|
|
24676
24597
|
payoutRequiredFields ? {
|
|
24677
24598
|
matchingScenario,
|
|
24678
24599
|
country,
|
|
24679
24600
|
requiredFields: payoutRequiredFields,
|
|
24680
|
-
bankVerificationAvailable:
|
|
24601
|
+
bankVerificationAvailable: instantVerificationAvailable
|
|
24681
24602
|
} : {
|
|
24682
24603
|
matchingScenario,
|
|
24683
24604
|
country,
|
|
@@ -24695,7 +24616,7 @@ const useScenarioConfiguration = ({
|
|
|
24695
24616
|
configurationResponse,
|
|
24696
24617
|
country,
|
|
24697
24618
|
parseConfiguration2,
|
|
24698
|
-
|
|
24619
|
+
instantVerificationAvailable
|
|
24699
24620
|
]);
|
|
24700
24621
|
return {
|
|
24701
24622
|
requiredFields,
|
|
@@ -24898,7 +24819,8 @@ const countryConfig = {
|
|
|
24898
24819
|
...countryConfig$3,
|
|
24899
24820
|
[CountryCodes.NewZealand]: {
|
|
24900
24821
|
...countryConfig$3[CountryCodes.NewZealand],
|
|
24901
|
-
registrationNumber: { label: "NZBN" }
|
|
24822
|
+
registrationNumber: { label: "NZBN" },
|
|
24823
|
+
exemptedFromRegistrationNumber: { label: "doNotHaveNZBN" }
|
|
24902
24824
|
},
|
|
24903
24825
|
[CountryCodes.Croatia]: {
|
|
24904
24826
|
...countryConfig$3[CountryCodes.Croatia],
|
|
@@ -25321,7 +25243,7 @@ const mapAddressData = (verifiedBusiness) => ({
|
|
|
25321
25243
|
address: verifiedBusiness.street ?? "",
|
|
25322
25244
|
otherAddressInformation: verifiedBusiness.street2 ?? "",
|
|
25323
25245
|
city: verifiedBusiness.city ?? "",
|
|
25324
|
-
postalCode: verifiedBusiness.
|
|
25246
|
+
postalCode: verifiedBusiness.zipCode ?? "",
|
|
25325
25247
|
stateOrProvince: verifiedBusiness.state ?? ""
|
|
25326
25248
|
});
|
|
25327
25249
|
const applyVerifiedBusinessData = (verifiedBusiness, handleChangeFor) => {
|
|
@@ -25467,6 +25389,7 @@ function AdditionalInformationComponent({
|
|
|
25467
25389
|
const { basicInformation } = useGlobalData();
|
|
25468
25390
|
const { updateStateSlice } = useGlobalDataSlice(ADDITIONAL_INFORMATION_FORM_ID);
|
|
25469
25391
|
const { i18n } = useI18nContext();
|
|
25392
|
+
const { isExperimentEnabled } = useExperimentsContext();
|
|
25470
25393
|
const showVerified = !!verifiedBusiness;
|
|
25471
25394
|
const showStockData = companyType === CompanyTypesValue.PUBLIC_COMPANY;
|
|
25472
25395
|
const addressSchema = getAddressSchemaForCountry(country).filter(
|
|
@@ -25574,7 +25497,8 @@ function AdditionalInformationComponent({
|
|
|
25574
25497
|
defaultFieldConfig$9[country],
|
|
25575
25498
|
{
|
|
25576
25499
|
companyType,
|
|
25577
|
-
registrationNumberType
|
|
25500
|
+
registrationNumberType,
|
|
25501
|
+
isExperimentEnabled
|
|
25578
25502
|
},
|
|
25579
25503
|
defaultFieldMetadata$9
|
|
25580
25504
|
),
|
|
@@ -25646,7 +25570,7 @@ function AdditionalInformationComponent({
|
|
|
25646
25570
|
registrationAddress: {
|
|
25647
25571
|
address: verifiedBusiness.street,
|
|
25648
25572
|
city: verifiedBusiness.city,
|
|
25649
|
-
postalCode: verifiedBusiness.
|
|
25573
|
+
postalCode: verifiedBusiness.zipCode,
|
|
25650
25574
|
stateOrProvince: verifiedBusiness.state,
|
|
25651
25575
|
country: verifiedBusiness.country
|
|
25652
25576
|
}
|
|
@@ -26194,7 +26118,7 @@ function BusinessInformationCard({
|
|
|
26194
26118
|
}
|
|
26195
26119
|
);
|
|
26196
26120
|
}
|
|
26197
|
-
const logger$
|
|
26121
|
+
const logger$u = createLogger("BusinessSelection");
|
|
26198
26122
|
function BusinessSelectionComponent({
|
|
26199
26123
|
showCompanyStructure,
|
|
26200
26124
|
searching,
|
|
@@ -26246,7 +26170,7 @@ function BusinessSelectionComponent({
|
|
|
26246
26170
|
setCurrentBusinessSelection(businessData);
|
|
26247
26171
|
}
|
|
26248
26172
|
} catch (e) {
|
|
26249
|
-
logger$
|
|
26173
|
+
logger$u.error(e);
|
|
26250
26174
|
}
|
|
26251
26175
|
},
|
|
26252
26176
|
[basicInformation == null ? void 0 : basicInformation.stateOrProvince, fetchBusinessData, fetching, selectedBusinessId]
|
|
@@ -26260,7 +26184,7 @@ function BusinessSelectionComponent({
|
|
|
26260
26184
|
handleNextClick == null ? void 0 : handleNextClick();
|
|
26261
26185
|
}
|
|
26262
26186
|
} catch (e) {
|
|
26263
|
-
logger$
|
|
26187
|
+
logger$u.error(e);
|
|
26264
26188
|
}
|
|
26265
26189
|
},
|
|
26266
26190
|
[currentTin, handleNextClick, handleBusinessVerification]
|
|
@@ -26447,7 +26371,7 @@ function BasicInformationComponent({
|
|
|
26447
26371
|
const { i18n } = useI18nContext();
|
|
26448
26372
|
const { isSettingEnabled } = useSettingsContext();
|
|
26449
26373
|
const { isExperimentEnabled } = useExperimentsContext();
|
|
26450
|
-
const allowedCountries =
|
|
26374
|
+
const { allowedCountries } = useCoreContext();
|
|
26451
26375
|
const isAllowedEditPrefilledCountry = isSettingEnabled(SettingNames.AllowPrefilledCountryEdit);
|
|
26452
26376
|
const formDescription = /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-form-header__description", children: [
|
|
26453
26377
|
description,
|
|
@@ -27370,7 +27294,7 @@ const DECISION_MAKER_TYPES_WITH_JOBTITLE = [
|
|
|
27370
27294
|
DecisionMakerType.SIGNATORY,
|
|
27371
27295
|
DecisionMakerType.CONTROLLING_PERSON
|
|
27372
27296
|
];
|
|
27373
|
-
const rules$
|
|
27297
|
+
const rules$2 = ({
|
|
27374
27298
|
data,
|
|
27375
27299
|
country,
|
|
27376
27300
|
taskType,
|
|
@@ -27845,7 +27769,7 @@ const useExpiryThreshold = (expiry) => {
|
|
|
27845
27769
|
return { expiryStatus: "notYetCloseToExpiry", secondsUntilExpiry: void 0 };
|
|
27846
27770
|
};
|
|
27847
27771
|
const ExpiryContext = createContext(false);
|
|
27848
|
-
const logger$
|
|
27772
|
+
const logger$t = createLogger("ExpiryProvider");
|
|
27849
27773
|
const ExpiryProvider = ({
|
|
27850
27774
|
expiry: initialExpiry,
|
|
27851
27775
|
eventEmitter,
|
|
@@ -27874,7 +27798,7 @@ const ExpiryProvider = ({
|
|
|
27874
27798
|
refreshExpiry().then((newExpiry) => {
|
|
27875
27799
|
setExpiry(newExpiry);
|
|
27876
27800
|
setModalDismissed(false);
|
|
27877
|
-
}).catch(logger$
|
|
27801
|
+
}).catch(logger$t.error);
|
|
27878
27802
|
}
|
|
27879
27803
|
}
|
|
27880
27804
|
),
|
|
@@ -27896,7 +27820,7 @@ const ExpiryProvider = ({
|
|
|
27896
27820
|
return /* @__PURE__ */ jsx(ExpiryContext.Provider, { value: expiryStatus === "expired", children });
|
|
27897
27821
|
};
|
|
27898
27822
|
const useHasExpired = () => useContext(ExpiryContext);
|
|
27899
|
-
const logger$
|
|
27823
|
+
const logger$s = createLogger("FormRouterContextProvider");
|
|
27900
27824
|
function FormRouterContextProvider({
|
|
27901
27825
|
children,
|
|
27902
27826
|
forms,
|
|
@@ -27919,7 +27843,7 @@ function FormRouterContextProvider({
|
|
|
27919
27843
|
if (formIndex > -1) {
|
|
27920
27844
|
setFormIndex(formIndex);
|
|
27921
27845
|
} else {
|
|
27922
|
-
logger$
|
|
27846
|
+
logger$s.error("No form was found to have that field so form navigation failed.");
|
|
27923
27847
|
}
|
|
27924
27848
|
}
|
|
27925
27849
|
}),
|
|
@@ -29617,7 +29541,7 @@ function CompanyDropinComponent({
|
|
|
29617
29541
|
}
|
|
29618
29542
|
const IgnoreLocalStorageContext = createContext(false);
|
|
29619
29543
|
const useIgnoreLocalStorage = () => useContext(IgnoreLocalStorageContext);
|
|
29620
|
-
const logger$
|
|
29544
|
+
const logger$r = createLogger("useLocalStorage");
|
|
29621
29545
|
const useLocalStorage = (key, defaultValue, options) => {
|
|
29622
29546
|
const { serializer, parser, syncData } = useMemo(
|
|
29623
29547
|
() => ({
|
|
@@ -29637,7 +29561,7 @@ const useLocalStorage = (key, defaultValue, options) => {
|
|
|
29637
29561
|
const res = rawValueRef.current ? parser(rawValueRef.current) : defaultValue;
|
|
29638
29562
|
return res;
|
|
29639
29563
|
} catch (err) {
|
|
29640
|
-
logger$
|
|
29564
|
+
logger$r.error(err);
|
|
29641
29565
|
return defaultValue;
|
|
29642
29566
|
}
|
|
29643
29567
|
});
|
|
@@ -29672,7 +29596,7 @@ const useLocalStorage = (key, defaultValue, options) => {
|
|
|
29672
29596
|
try {
|
|
29673
29597
|
updateLocalStorage();
|
|
29674
29598
|
} catch (err) {
|
|
29675
|
-
logger$
|
|
29599
|
+
logger$r.error(err);
|
|
29676
29600
|
}
|
|
29677
29601
|
}, [value, ignoreLocalStorage]);
|
|
29678
29602
|
useEffect(() => {
|
|
@@ -29685,7 +29609,7 @@ const useLocalStorage = (key, defaultValue, options) => {
|
|
|
29685
29609
|
setValue(event.newValue ? parser(event.newValue) : void 0);
|
|
29686
29610
|
}
|
|
29687
29611
|
} catch (err) {
|
|
29688
|
-
logger$
|
|
29612
|
+
logger$r.error(err);
|
|
29689
29613
|
}
|
|
29690
29614
|
};
|
|
29691
29615
|
if (ignoreLocalStorage) return;
|
|
@@ -29869,7 +29793,7 @@ const useSingpassMyInfoLogin = ({
|
|
|
29869
29793
|
trustedEntityAssociations
|
|
29870
29794
|
};
|
|
29871
29795
|
};
|
|
29872
|
-
const logger$
|
|
29796
|
+
const logger$q = createLogger("useAssociatedLegalArrangement");
|
|
29873
29797
|
function useAssociatedLegalArrangement({
|
|
29874
29798
|
rootLegalEntity,
|
|
29875
29799
|
getLegalEntity: getLegalEntity2
|
|
@@ -29885,7 +29809,7 @@ function useAssociatedLegalArrangement({
|
|
|
29885
29809
|
(entity) => entity.type === LegalEntityType.SOLE_PROPRIETORSHIP || entity.type === LegalEntityType.TRUST
|
|
29886
29810
|
);
|
|
29887
29811
|
if (foundEntity == null ? void 0 : foundEntity.legalEntityId) {
|
|
29888
|
-
getAssociatedEntity(foundEntity == null ? void 0 : foundEntity.legalEntityId).then((res) => setAssociatedLegalArrangement(res)).catch(logger$
|
|
29812
|
+
getAssociatedEntity(foundEntity == null ? void 0 : foundEntity.legalEntityId).then((res) => setAssociatedLegalArrangement(res)).catch(logger$q.error);
|
|
29889
29813
|
}
|
|
29890
29814
|
}, [getAssociatedEntity, rootLegalEntity == null ? void 0 : rootLegalEntity.entityAssociations]);
|
|
29891
29815
|
useEffect(() => {
|
|
@@ -29935,7 +29859,7 @@ const useCanSeeEntitySelection = (legalEntityId) => {
|
|
|
29935
29859
|
setCanSeeEntitySelection: setCanSeeEntitySelectionIntoLocalStorage
|
|
29936
29860
|
};
|
|
29937
29861
|
};
|
|
29938
|
-
const logger$
|
|
29862
|
+
const logger$p = createLogger("useExemptSettlor");
|
|
29939
29863
|
const useExemptSettlor = ({
|
|
29940
29864
|
trust,
|
|
29941
29865
|
handleGetLegalEntity
|
|
@@ -29953,7 +29877,7 @@ const useExemptSettlor = ({
|
|
|
29953
29877
|
);
|
|
29954
29878
|
useEffect(() => {
|
|
29955
29879
|
if (!(trust == null ? void 0 : trust.trust)) return;
|
|
29956
|
-
updateExemptSettlor(trust).catch(logger$
|
|
29880
|
+
updateExemptSettlor(trust).catch(logger$p.error);
|
|
29957
29881
|
}, [trust, updateExemptSettlor]);
|
|
29958
29882
|
return exemptSettlor;
|
|
29959
29883
|
};
|
|
@@ -32010,6 +31934,14 @@ const SingpassSelection = (props) => {
|
|
|
32010
31934
|
)
|
|
32011
31935
|
] }) });
|
|
32012
31936
|
};
|
|
31937
|
+
const useSetting = (settingName) => {
|
|
31938
|
+
const context = useContext(SettingsContext);
|
|
31939
|
+
if (context === void 0) {
|
|
31940
|
+
throw new Error("useSetting must be used within a SettingsProvider");
|
|
31941
|
+
}
|
|
31942
|
+
const { getSetting } = context;
|
|
31943
|
+
return getSetting(settingName);
|
|
31944
|
+
};
|
|
32013
31945
|
const businessTypeMapping = {
|
|
32014
31946
|
myName: {
|
|
32015
31947
|
[LegalEntityType.INDIVIDUAL]: "individual"
|
|
@@ -33052,7 +32984,7 @@ function IndividualDropinComponent({
|
|
|
33052
32984
|
country
|
|
33053
32985
|
});
|
|
33054
32986
|
const fieldsFromCustomRules = useMemo(
|
|
33055
|
-
() => rules$
|
|
32987
|
+
() => rules$2({
|
|
33056
32988
|
data,
|
|
33057
32989
|
country,
|
|
33058
32990
|
taskType,
|
|
@@ -33517,7 +33449,7 @@ function IndividualDropinComponent({
|
|
|
33517
33449
|
}
|
|
33518
33450
|
);
|
|
33519
33451
|
}
|
|
33520
|
-
const logger$
|
|
33452
|
+
const logger$o = createLogger("useBankConfigurationHandler");
|
|
33521
33453
|
const useBankConfigurationHandlers = ({
|
|
33522
33454
|
handleGetBankVerificationVendors,
|
|
33523
33455
|
bankAccountCountry,
|
|
@@ -33535,7 +33467,7 @@ const useBankConfigurationHandlers = ({
|
|
|
33535
33467
|
const bankVerificationVendorsResponse = handleGetBankVerificationVendors ? await handleGetBankVerificationVendors(bankAccountCountry) : [];
|
|
33536
33468
|
setProvider(bankVerificationVendorsResponse == null ? void 0 : bankVerificationVendorsResponse[0]);
|
|
33537
33469
|
})().catch(() => {
|
|
33538
|
-
logger$
|
|
33470
|
+
logger$o.error();
|
|
33539
33471
|
setProvider(void 0);
|
|
33540
33472
|
}).finally(() => {
|
|
33541
33473
|
setLoadingStatus("success");
|
|
@@ -33548,17 +33480,14 @@ const useBankConfigurationHandlers = ({
|
|
|
33548
33480
|
handleGetBankVerificationVendors,
|
|
33549
33481
|
bankAccountCountry
|
|
33550
33482
|
]);
|
|
33551
|
-
const getConfigurationData = useCallback(
|
|
33552
|
-
|
|
33483
|
+
const getConfigurationData = useCallback(
|
|
33484
|
+
() => getConfiguration2({
|
|
33553
33485
|
legalEntityType,
|
|
33554
33486
|
capabilities,
|
|
33555
33487
|
country: bankAccountCountry
|
|
33556
|
-
})
|
|
33557
|
-
|
|
33558
|
-
|
|
33559
|
-
provider
|
|
33560
|
-
};
|
|
33561
|
-
}, [getConfiguration2, legalEntityType, bankAccountCountry, capabilities, provider]);
|
|
33488
|
+
}),
|
|
33489
|
+
[getConfiguration2, legalEntityType, bankAccountCountry, capabilities]
|
|
33490
|
+
);
|
|
33562
33491
|
return {
|
|
33563
33492
|
getConfigurationData,
|
|
33564
33493
|
provider
|
|
@@ -33572,6 +33501,43 @@ const getAccountFormatsForCountry = async (country) => {
|
|
|
33572
33501
|
}
|
|
33573
33502
|
return (await importForCountry()).default;
|
|
33574
33503
|
};
|
|
33504
|
+
const rules$1 = ({ data, requiredFields }) => ({
|
|
33505
|
+
whenUsingManualVerification: () => {
|
|
33506
|
+
var _a;
|
|
33507
|
+
if (!data.payoutVerificationMethod) return;
|
|
33508
|
+
if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification") {
|
|
33509
|
+
return "REQUIRED";
|
|
33510
|
+
}
|
|
33511
|
+
},
|
|
33512
|
+
whenUsingInstantVerification: () => {
|
|
33513
|
+
var _a;
|
|
33514
|
+
if (!data.payoutVerificationMethod) {
|
|
33515
|
+
return "REQUIRED";
|
|
33516
|
+
}
|
|
33517
|
+
if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "instantVerification") {
|
|
33518
|
+
return "REQUIRED";
|
|
33519
|
+
}
|
|
33520
|
+
},
|
|
33521
|
+
verifiedBankAccountNumber: () => {
|
|
33522
|
+
var _a;
|
|
33523
|
+
if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "instantVerification") {
|
|
33524
|
+
return "REQUIRED";
|
|
33525
|
+
}
|
|
33526
|
+
},
|
|
33527
|
+
bankStatementRequirement: () => {
|
|
33528
|
+
var _a;
|
|
33529
|
+
if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification") {
|
|
33530
|
+
return requiredFields == null ? void 0 : requiredFields.bankStatementRequirement;
|
|
33531
|
+
}
|
|
33532
|
+
},
|
|
33533
|
+
// "bankStatement description" field is always "optional" and it's coupled with bank statement document.
|
|
33534
|
+
bankStatementDescription: () => {
|
|
33535
|
+
var _a;
|
|
33536
|
+
if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification" && !!(requiredFields == null ? void 0 : requiredFields.bankStatementRequirement)) {
|
|
33537
|
+
return "OPTIONAL";
|
|
33538
|
+
}
|
|
33539
|
+
}
|
|
33540
|
+
});
|
|
33575
33541
|
const labels = () => ({
|
|
33576
33542
|
verifiedAccountHolder: () => "accountHolder",
|
|
33577
33543
|
verifiedBankCountry: () => "bankCountry",
|
|
@@ -33719,17 +33685,6 @@ function PayoutDetailsDropinComponent({
|
|
|
33719
33685
|
});
|
|
33720
33686
|
onChange == null ? void 0 : onChange(currentState);
|
|
33721
33687
|
}, [bankAccountCountry, currentState, onChange]);
|
|
33722
|
-
useEffect(() => {
|
|
33723
|
-
var _a2, _b2;
|
|
33724
|
-
setData({
|
|
33725
|
-
...currentState.data,
|
|
33726
|
-
payoutAccountDetails: {
|
|
33727
|
-
...(_a2 = currentState.data) == null ? void 0 : _a2.payoutAccountDetails,
|
|
33728
|
-
currency: (_b2 = currencyByCountry[bankAccountCountry]) == null ? void 0 : _b2[0]
|
|
33729
|
-
}
|
|
33730
|
-
});
|
|
33731
|
-
onChange == null ? void 0 : onChange(currentState);
|
|
33732
|
-
}, [bankAccountCountry, currentState, onChange]);
|
|
33733
33688
|
const { getConfigurationData, provider } = useBankConfigurationHandlers({
|
|
33734
33689
|
isEmbeddedDropin,
|
|
33735
33690
|
handleGetBankVerificationVendors,
|
|
@@ -33741,6 +33696,10 @@ function PayoutDetailsDropinComponent({
|
|
|
33741
33696
|
useFreshProviderRedirectUrl,
|
|
33742
33697
|
setUseFreshProviderRedirectUrl
|
|
33743
33698
|
});
|
|
33699
|
+
const instantVerificationAvailable = useMemo(
|
|
33700
|
+
() => Boolean(instantVerificationEnabled && (provider == null ? void 0 : provider.redirectUrl)),
|
|
33701
|
+
[instantVerificationEnabled, provider == null ? void 0 : provider.redirectUrl]
|
|
33702
|
+
);
|
|
33744
33703
|
const getPayoutAccountFormatData = useCallback(
|
|
33745
33704
|
async () => getAccountFormatsForCountry(bankAccountCountry),
|
|
33746
33705
|
[bankAccountCountry]
|
|
@@ -33749,13 +33708,13 @@ function PayoutDetailsDropinComponent({
|
|
|
33749
33708
|
parseConfiguration: parseConfiguration$3,
|
|
33750
33709
|
getConfigurationData,
|
|
33751
33710
|
getPayoutAccountFormatData,
|
|
33752
|
-
|
|
33711
|
+
instantVerificationAvailable,
|
|
33753
33712
|
setLoadingStatus: setConfigurationLoadingStatus,
|
|
33754
33713
|
country: bankAccountCountry,
|
|
33755
33714
|
existingBankAccountFormat
|
|
33756
33715
|
});
|
|
33757
33716
|
const fieldsFromCustomRules = useMemo(
|
|
33758
|
-
() => rules$
|
|
33717
|
+
() => rules$1({
|
|
33759
33718
|
data,
|
|
33760
33719
|
country: bankAccountCountry,
|
|
33761
33720
|
taskType,
|
|
@@ -33773,10 +33732,7 @@ function PayoutDetailsDropinComponent({
|
|
|
33773
33732
|
var _a2;
|
|
33774
33733
|
return getAppropriatePayoutDetailsSteps(
|
|
33775
33734
|
Boolean((_a2 = prefilledData == null ? void 0 : prefilledData.payoutAccountDetails) == null ? void 0 : _a2.transferInstrumentId),
|
|
33776
|
-
|
|
33777
|
-
provider,
|
|
33778
|
-
verificationVendorsCallback: handleGetBankVerificationVendors
|
|
33779
|
-
}),
|
|
33735
|
+
instantVerificationAvailable,
|
|
33780
33736
|
isSettingEnabled(SettingNames.AllowIntraRegionCrossBorderPayout),
|
|
33781
33737
|
showWidgetInVerificationMethodStep
|
|
33782
33738
|
);
|
|
@@ -34058,8 +34014,7 @@ function PayoutDetailsDropinComponent({
|
|
|
34058
34014
|
associatedLegalArrangement,
|
|
34059
34015
|
provider,
|
|
34060
34016
|
bankVendorsLoadingStatus,
|
|
34061
|
-
|
|
34062
|
-
instantVerificationEnabled,
|
|
34017
|
+
instantVerificationAvailable,
|
|
34063
34018
|
refreshLegalEntity,
|
|
34064
34019
|
shouldValidate,
|
|
34065
34020
|
createTrustedTransferInstrument: createTrustedTransferInstrumentHandler,
|
|
@@ -35058,7 +35013,7 @@ const serviceAgreementValidationRules = {
|
|
|
35058
35013
|
errorMessage: "fieldIsRequired"
|
|
35059
35014
|
}
|
|
35060
35015
|
};
|
|
35061
|
-
const logger$
|
|
35016
|
+
const logger$n = createLogger("useServiceAgreement");
|
|
35062
35017
|
const FALLBACK_LANGUAGE_CODE$1 = "en";
|
|
35063
35018
|
const useServiceAgreement = ({
|
|
35064
35019
|
handleGetServiceAgreement,
|
|
@@ -35088,7 +35043,7 @@ const useServiceAgreement = ({
|
|
|
35088
35043
|
const contract = JSON.parse(decodeURIComponent(escape(window.atob(document2))));
|
|
35089
35044
|
setServiceAgreement({ id, contract });
|
|
35090
35045
|
};
|
|
35091
|
-
requestAcceptedServiceAgreement().catch(logger$
|
|
35046
|
+
requestAcceptedServiceAgreement().catch(logger$n.error).finally(() => setLoading("success"));
|
|
35092
35047
|
}, [acceptanceId, handleViewAcceptedTermsOfServiceDocument]);
|
|
35093
35048
|
useEffect(() => {
|
|
35094
35049
|
const requestServiceAgreement = async () => {
|
|
@@ -35103,7 +35058,7 @@ const useServiceAgreement = ({
|
|
|
35103
35058
|
}
|
|
35104
35059
|
);
|
|
35105
35060
|
if (!document2) {
|
|
35106
|
-
logger$
|
|
35061
|
+
logger$n.log('"document" field was missing in response');
|
|
35107
35062
|
return;
|
|
35108
35063
|
}
|
|
35109
35064
|
const contract = JSON.parse(decodeURIComponent(escape(window.atob(document2))));
|
|
@@ -35118,13 +35073,14 @@ const useServiceAgreement = ({
|
|
|
35118
35073
|
throw err;
|
|
35119
35074
|
}
|
|
35120
35075
|
};
|
|
35121
|
-
requestServiceAgreement().catch(logger$
|
|
35076
|
+
requestServiceAgreement().catch(logger$n.error);
|
|
35122
35077
|
}, [
|
|
35123
35078
|
handleGetServiceAgreement,
|
|
35124
35079
|
handleServiceAgreementIsNotAvailableInThatLanguage,
|
|
35125
35080
|
agreementLanguage,
|
|
35126
35081
|
legalEntityId,
|
|
35127
|
-
serviceAgreementType
|
|
35082
|
+
serviceAgreementType,
|
|
35083
|
+
acceptanceId
|
|
35128
35084
|
]);
|
|
35129
35085
|
return {
|
|
35130
35086
|
loading,
|
|
@@ -35142,7 +35098,7 @@ const serviceAgreementTypesTranslationMapping = {
|
|
|
35142
35098
|
adyenPccr: "pccr",
|
|
35143
35099
|
adyenChargeCard: "chargeCardUserAgreement"
|
|
35144
35100
|
};
|
|
35145
|
-
const logger$
|
|
35101
|
+
const logger$m = createLogger("ServiceAgreementDropinComponent");
|
|
35146
35102
|
const FALLBACK_LANGUAGE_CODE = "en";
|
|
35147
35103
|
function ServiceAgreementDropinComponent({
|
|
35148
35104
|
legalEntityResponse,
|
|
@@ -35326,7 +35282,7 @@ function ServiceAgreementDropinComponent({
|
|
|
35326
35282
|
await requestAndDownload(i18n.languageCode);
|
|
35327
35283
|
} catch (e) {
|
|
35328
35284
|
if (i18n.languageCode !== FALLBACK_LANGUAGE_CODE) {
|
|
35329
|
-
await requestAndDownload(FALLBACK_LANGUAGE_CODE).catch(logger$
|
|
35285
|
+
await requestAndDownload(FALLBACK_LANGUAGE_CODE).catch(logger$m.error);
|
|
35330
35286
|
return;
|
|
35331
35287
|
}
|
|
35332
35288
|
showToast({
|
|
@@ -36341,7 +36297,7 @@ const hasProgressedBeyondEntitySelection = (legalEntity) => {
|
|
|
36341
36297
|
return hasOwnEntityAssocation || !!hasOrganizationType;
|
|
36342
36298
|
};
|
|
36343
36299
|
const PAGES_WITH_POLLING = [TaskTypes.DECISION_MAKER_OVERVIEW, TaskTypes.TASKS_OVERVIEW];
|
|
36344
|
-
const logger$
|
|
36300
|
+
const logger$l = createLogger("DropinComposerComponent");
|
|
36345
36301
|
const isOrganizationSettlorWithExemptionReasonEnabled = (enabled, country) => country === CountryCodes.Australia && enabled;
|
|
36346
36302
|
function DropinComposerComponent({
|
|
36347
36303
|
capabilities,
|
|
@@ -36448,7 +36404,7 @@ function DropinComposerComponent({
|
|
|
36448
36404
|
setPciStatus(response);
|
|
36449
36405
|
return response;
|
|
36450
36406
|
} catch (e) {
|
|
36451
|
-
logger$
|
|
36407
|
+
logger$l.warn(i18n.get("failedToGetPciStatus"));
|
|
36452
36408
|
}
|
|
36453
36409
|
}
|
|
36454
36410
|
return void 0;
|
|
@@ -36476,7 +36432,7 @@ function DropinComposerComponent({
|
|
|
36476
36432
|
}, [additionalSalesChannels, i18n, rootLegalEntity.id, args.handleGetPciTemplate]);
|
|
36477
36433
|
useEffect(() => {
|
|
36478
36434
|
if (!tasks.includes(TaskTypes.PCI_DSS)) return;
|
|
36479
|
-
getPciTemplate2().catch(logger$
|
|
36435
|
+
getPciTemplate2().catch(logger$l.error);
|
|
36480
36436
|
}, [getPciTemplate2, tasks]);
|
|
36481
36437
|
const addFetchedAcceptedByName = async (acceptanceInfo) => {
|
|
36482
36438
|
try {
|
|
@@ -36486,7 +36442,7 @@ function DropinComposerComponent({
|
|
|
36486
36442
|
acceptedByName: getLegalEntityNameBasedOnType(acceptedByEntity)
|
|
36487
36443
|
};
|
|
36488
36444
|
} catch (e) {
|
|
36489
|
-
logger$
|
|
36445
|
+
logger$l.warn(i18n.get("failedToFetchAcceptedByName"));
|
|
36490
36446
|
return {
|
|
36491
36447
|
...acceptanceInfo,
|
|
36492
36448
|
acceptedByName: null
|
|
@@ -36500,7 +36456,7 @@ function DropinComposerComponent({
|
|
|
36500
36456
|
const serviceAgreementAcceptanceInfosWithNames2 = await Promise.all(response.data.map(addFetchedAcceptedByName));
|
|
36501
36457
|
setServiceAgreementAcceptanceInfosWithNames(serviceAgreementAcceptanceInfosWithNames2);
|
|
36502
36458
|
} catch (e) {
|
|
36503
|
-
logger$
|
|
36459
|
+
logger$l.warn(i18n.get("failedToGetServiceAgreementStatus"));
|
|
36504
36460
|
}
|
|
36505
36461
|
}
|
|
36506
36462
|
};
|
|
@@ -36510,7 +36466,7 @@ function DropinComposerComponent({
|
|
|
36510
36466
|
const response = await args.handleGetServiceAgreementStatus(rootLegalEntity.id);
|
|
36511
36467
|
setServiceAgreementTypes(response.termsOfServiceTypes);
|
|
36512
36468
|
} catch (e) {
|
|
36513
|
-
logger$
|
|
36469
|
+
logger$l.warn(i18n.get("failedToGetServiceAgreementStatus"));
|
|
36514
36470
|
}
|
|
36515
36471
|
}
|
|
36516
36472
|
};
|
|
@@ -36540,7 +36496,7 @@ function DropinComposerComponent({
|
|
|
36540
36496
|
try {
|
|
36541
36497
|
return await args.handleGetLegalEntity(rootLegalEntity.id);
|
|
36542
36498
|
} catch (e) {
|
|
36543
|
-
logger$
|
|
36499
|
+
logger$l.warn("Failed to fetch legal entity details", e);
|
|
36544
36500
|
}
|
|
36545
36501
|
}
|
|
36546
36502
|
return void 0;
|
|
@@ -36596,7 +36552,7 @@ function DropinComposerComponent({
|
|
|
36596
36552
|
await refreshAssociatedLegalArrangement();
|
|
36597
36553
|
showToast({ type: "success", label: i18n.get("successFullyRemovedTrustMember") });
|
|
36598
36554
|
} catch (err) {
|
|
36599
|
-
logger$
|
|
36555
|
+
logger$l.error(`Failed to delete trust member`, err);
|
|
36600
36556
|
showToast({ type: "error", label: i18n.get("failedToRemoveTrustMember") });
|
|
36601
36557
|
}
|
|
36602
36558
|
};
|
|
@@ -36663,14 +36619,14 @@ function DropinComposerComponent({
|
|
|
36663
36619
|
}
|
|
36664
36620
|
break;
|
|
36665
36621
|
default:
|
|
36666
|
-
logger$
|
|
36622
|
+
logger$l.warn(
|
|
36667
36623
|
`Updating trust member type "${trustMember.trustMemberType}" is not implemented.`
|
|
36668
36624
|
);
|
|
36669
36625
|
}
|
|
36670
36626
|
showToast({ label: i18n.get("successfullyUpdatedDetails"), type: "success" });
|
|
36671
36627
|
await refreshLegalArrangementAndRunOnSubmit(associatedLegalArrangement, 1);
|
|
36672
36628
|
} catch (err) {
|
|
36673
|
-
logger$
|
|
36629
|
+
logger$l.error(err);
|
|
36674
36630
|
showToast({ label: i18n.get("failedToUpdateDetails"), type: "error" });
|
|
36675
36631
|
}
|
|
36676
36632
|
};
|
|
@@ -36682,7 +36638,7 @@ function DropinComposerComponent({
|
|
|
36682
36638
|
singpassTabRef.current = window.open(authUrl, "_blank");
|
|
36683
36639
|
singpassTabRef.current.focus();
|
|
36684
36640
|
} catch (e) {
|
|
36685
|
-
logger$
|
|
36641
|
+
logger$l.error(e);
|
|
36686
36642
|
handleSingpassMyInfoLoginFailure(e);
|
|
36687
36643
|
}
|
|
36688
36644
|
}
|
|
@@ -36873,7 +36829,7 @@ function DropinComposerComponent({
|
|
|
36873
36829
|
}
|
|
36874
36830
|
};
|
|
36875
36831
|
setIsLoadingConfiguration(true);
|
|
36876
|
-
fetchConfiguration().catch(logger$
|
|
36832
|
+
fetchConfiguration().catch(logger$l.error).finally(() => {
|
|
36877
36833
|
setIsLoadingConfiguration(false);
|
|
36878
36834
|
onLoad();
|
|
36879
36835
|
});
|
|
@@ -36910,7 +36866,7 @@ function DropinComposerComponent({
|
|
|
36910
36866
|
singpassTabRef.current = window.open(authUrl);
|
|
36911
36867
|
singpassTabRef.current.focus();
|
|
36912
36868
|
} catch (e) {
|
|
36913
|
-
logger$
|
|
36869
|
+
logger$l.error(e);
|
|
36914
36870
|
handleSingpassMyInfoLoginFailure(e);
|
|
36915
36871
|
}
|
|
36916
36872
|
},
|
|
@@ -38092,7 +38048,7 @@ const useComponentApi = (rootLegalEntityId) => {
|
|
|
38092
38048
|
};
|
|
38093
38049
|
}, [base, rootLegalEntityId]);
|
|
38094
38050
|
};
|
|
38095
|
-
const logger$
|
|
38051
|
+
const logger$k = createLogger("AcceptTermsOfService");
|
|
38096
38052
|
function AcceptTermsOfServiceComponent({
|
|
38097
38053
|
legalEntityId,
|
|
38098
38054
|
modalView,
|
|
@@ -38134,13 +38090,13 @@ function AcceptTermsOfServiceComponent({
|
|
|
38134
38090
|
onClose == null ? void 0 : onClose();
|
|
38135
38091
|
};
|
|
38136
38092
|
const fetchLegalEntity = useCallback(async () => {
|
|
38137
|
-
await getLegalEntity2(legalEntityId).then((res) => setLegalEntity(res)).catch(logger$
|
|
38093
|
+
await getLegalEntity2(legalEntityId).then((res) => setLegalEntity(res)).catch(logger$k.error);
|
|
38138
38094
|
}, [getLegalEntity2, legalEntityId]);
|
|
38139
38095
|
const fetchUnsigned = useCallback(async () => {
|
|
38140
|
-
await getServiceAgreementStatus2(legalEntityId).then(({ termsOfServiceTypes }) => setServiceAgreementTypes(termsOfServiceTypes)).catch(logger$
|
|
38096
|
+
await getServiceAgreementStatus2(legalEntityId).then(({ termsOfServiceTypes }) => setServiceAgreementTypes(termsOfServiceTypes)).catch(logger$k.error);
|
|
38141
38097
|
}, [getServiceAgreementStatus2, legalEntityId]);
|
|
38142
38098
|
const fetchSigned = useCallback(async () => {
|
|
38143
|
-
await getServiceAgreementAcceptanceInfos2(legalEntityId).then(({ data }) => setServiceAgreementAcceptanceInfos(data)).catch(logger$
|
|
38099
|
+
await getServiceAgreementAcceptanceInfos2(legalEntityId).then(({ data }) => setServiceAgreementAcceptanceInfos(data)).catch(logger$k.error);
|
|
38144
38100
|
}, [getServiceAgreementAcceptanceInfos2, legalEntityId]);
|
|
38145
38101
|
const handleSign = useCallback(
|
|
38146
38102
|
// @ts-ignore-error:next-line ts does not infer type correctly
|
|
@@ -38174,7 +38130,7 @@ function AcceptTermsOfServiceComponent({
|
|
|
38174
38130
|
(async () => {
|
|
38175
38131
|
setIsLoading(true);
|
|
38176
38132
|
await Promise.all([fetchLegalEntity(), fetchUnsigned(), fetchSigned()]);
|
|
38177
|
-
})().catch(logger$
|
|
38133
|
+
})().catch(logger$k.error).finally(() => {
|
|
38178
38134
|
setIsLoading(false);
|
|
38179
38135
|
});
|
|
38180
38136
|
}, [fetchLegalEntity, fetchSigned, fetchUnsigned]);
|
|
@@ -38201,7 +38157,7 @@ function AcceptTermsOfServiceComponent({
|
|
|
38201
38157
|
}
|
|
38202
38158
|
);
|
|
38203
38159
|
}
|
|
38204
|
-
const logger$
|
|
38160
|
+
const logger$j = createLogger("CreateIndividualComponent");
|
|
38205
38161
|
function CreateIndividualComponent({
|
|
38206
38162
|
parentLegalEntityId,
|
|
38207
38163
|
legalEntityId,
|
|
@@ -38252,11 +38208,11 @@ function CreateIndividualComponent({
|
|
|
38252
38208
|
setParentLegalEntity(parentEntity);
|
|
38253
38209
|
setLegalEntity(entity);
|
|
38254
38210
|
} catch (error) {
|
|
38255
|
-
logger$
|
|
38211
|
+
logger$j.error(error);
|
|
38256
38212
|
}
|
|
38257
38213
|
}, [parentLegalEntityId, legalEntityId, getLegalEntity2]);
|
|
38258
38214
|
useEffect(() => {
|
|
38259
|
-
fetchLegalEntity().catch(logger$
|
|
38215
|
+
fetchLegalEntity().catch(logger$j.error).finally(() => {
|
|
38260
38216
|
setIsLoading(false);
|
|
38261
38217
|
});
|
|
38262
38218
|
}, [fetchLegalEntity]);
|
|
@@ -38276,7 +38232,7 @@ function CreateIndividualComponent({
|
|
|
38276
38232
|
setIsAddressEnabled(res.statuses.address.enabled);
|
|
38277
38233
|
}, [country, getProviderStatus2]);
|
|
38278
38234
|
useEffect(() => {
|
|
38279
|
-
fetchProviderStatus().catch(logger$
|
|
38235
|
+
fetchProviderStatus().catch(logger$j.error);
|
|
38280
38236
|
}, [fetchProviderStatus]);
|
|
38281
38237
|
return isLoading || !legalEntity ? /* @__PURE__ */ jsx(Loader, { size: "medium" }) : /* @__PURE__ */ jsx(
|
|
38282
38238
|
IndividualDropinComponent,
|
|
@@ -38301,7 +38257,7 @@ function CreateIndividualComponent({
|
|
|
38301
38257
|
}
|
|
38302
38258
|
);
|
|
38303
38259
|
}
|
|
38304
|
-
const logger$
|
|
38260
|
+
const logger$i = createLogger("CreateTransferInstrumentComponent");
|
|
38305
38261
|
function CreateTransferInstrumentComponent({
|
|
38306
38262
|
legalEntityId,
|
|
38307
38263
|
transferInstrumentId,
|
|
@@ -38342,7 +38298,7 @@ function CreateTransferInstrumentComponent({
|
|
|
38342
38298
|
const ti = await getTransferInstrument2(transferInstrumentId);
|
|
38343
38299
|
setTransferInstrument(ti);
|
|
38344
38300
|
}
|
|
38345
|
-
})().catch(logger$
|
|
38301
|
+
})().catch(logger$i.error).finally(() => {
|
|
38346
38302
|
setLoadingStatus("success");
|
|
38347
38303
|
});
|
|
38348
38304
|
}, [transferInstrumentId, fetchLegalEntity, getTransferInstrument2]);
|
|
@@ -38892,7 +38848,7 @@ function ManageTransferInstrumentOverviewItem({
|
|
|
38892
38848
|
)
|
|
38893
38849
|
] });
|
|
38894
38850
|
}
|
|
38895
|
-
const logger$
|
|
38851
|
+
const logger$h = createLogger("ManageTransferInstrumentOverview");
|
|
38896
38852
|
function ManageTransferInstrumentOverview({
|
|
38897
38853
|
transferInstrumentReferences,
|
|
38898
38854
|
legalEntityId,
|
|
@@ -38911,7 +38867,7 @@ function ManageTransferInstrumentOverview({
|
|
|
38911
38867
|
const ti = await getTransferInstrument2(transferInstrumentId);
|
|
38912
38868
|
setTransferInstrumentsMap({ [transferInstrumentId]: ti, ...transferInstrumentsMap });
|
|
38913
38869
|
} catch (e) {
|
|
38914
|
-
logger$
|
|
38870
|
+
logger$h.error(e);
|
|
38915
38871
|
}
|
|
38916
38872
|
};
|
|
38917
38873
|
const onRemoveTransferInstrument = async (transferInstrumentId) => {
|
|
@@ -38920,7 +38876,7 @@ function ManageTransferInstrumentOverview({
|
|
|
38920
38876
|
onRemove(transferInstrumentId);
|
|
38921
38877
|
} catch (e) {
|
|
38922
38878
|
showToast({ label: i18n.get("thereWasAnErrorTryAgain"), type: "error" });
|
|
38923
|
-
logger$
|
|
38879
|
+
logger$h.error(e);
|
|
38924
38880
|
}
|
|
38925
38881
|
};
|
|
38926
38882
|
const transferInstrumentListEle = transferInstrumentReferences.map((transferInstrumentRef) => /* @__PURE__ */ jsx(
|
|
@@ -38949,7 +38905,7 @@ function ManageTransferInstrumentOverview({
|
|
|
38949
38905
|
)
|
|
38950
38906
|
] });
|
|
38951
38907
|
}
|
|
38952
|
-
const logger$
|
|
38908
|
+
const logger$g = createLogger("ManageTransferInstrumentComponent");
|
|
38953
38909
|
function ManageTransferInstrumentComponent({
|
|
38954
38910
|
legalEntityId,
|
|
38955
38911
|
onAdd,
|
|
@@ -38977,7 +38933,7 @@ function ManageTransferInstrumentComponent({
|
|
|
38977
38933
|
}, [getTransferInstruments2]);
|
|
38978
38934
|
useEffect(() => {
|
|
38979
38935
|
eventEmitter == null ? void 0 : eventEmitter.on("updateLocale", (locale) => setLocale(locale));
|
|
38980
|
-
init2().catch(logger$
|
|
38936
|
+
init2().catch(logger$g.error).finally(() => {
|
|
38981
38937
|
setLoadingStatus("success");
|
|
38982
38938
|
});
|
|
38983
38939
|
}, [init2, setLocale, eventEmitter]);
|
|
@@ -38987,7 +38943,7 @@ function ManageTransferInstrumentComponent({
|
|
|
38987
38943
|
}
|
|
38988
38944
|
}, [hasOnlyVerifiedTransferInstruments, timeoutId, transferInstruments]);
|
|
38989
38945
|
const onRemove = (transferInstrumentId) => {
|
|
38990
|
-
refreshTransferInstruments().catch(logger$
|
|
38946
|
+
refreshTransferInstruments().catch(logger$g.error);
|
|
38991
38947
|
onRemoveSuccess == null ? void 0 : onRemoveSuccess(transferInstrumentId, legalEntityId);
|
|
38992
38948
|
};
|
|
38993
38949
|
const render2 = () => {
|
|
@@ -39014,7 +38970,7 @@ function ManageTransferInstrumentComponent({
|
|
|
39014
38970
|
};
|
|
39015
38971
|
return /* @__PURE__ */ jsx("div", { className: "adyen-kyc-manage-transfer-instrument", children: render2() });
|
|
39016
38972
|
}
|
|
39017
|
-
const logger$
|
|
38973
|
+
const logger$f = createLogger("OnboardingDropinComponent");
|
|
39018
38974
|
function OnboardingDropinComponent({
|
|
39019
38975
|
legalEntityId,
|
|
39020
38976
|
openBankingPartnerConfigId
|
|
@@ -39075,13 +39031,13 @@ function OnboardingDropinComponent({
|
|
|
39075
39031
|
setLegalEntity(le);
|
|
39076
39032
|
setProviderStatus(providerStatuses);
|
|
39077
39033
|
} catch (error) {
|
|
39078
|
-
logger$
|
|
39034
|
+
logger$f.error(error);
|
|
39079
39035
|
} finally {
|
|
39080
39036
|
setLoadingStatus("success");
|
|
39081
39037
|
}
|
|
39082
39038
|
}, [legalEntityId, getLegalEntity2, getProviderStatus2]);
|
|
39083
39039
|
useEffect(() => {
|
|
39084
|
-
init2().catch(logger$
|
|
39040
|
+
init2().catch(logger$f.error);
|
|
39085
39041
|
}, [init2]);
|
|
39086
39042
|
return loadingStatus === "loading" || !legalEntity ? /* @__PURE__ */ jsx(Loader, { size: "medium" }) : /* @__PURE__ */ jsx(
|
|
39087
39043
|
DropinComposerComponent,
|
|
@@ -39125,7 +39081,7 @@ function OnboardingDropinComponent({
|
|
|
39125
39081
|
}
|
|
39126
39082
|
);
|
|
39127
39083
|
}
|
|
39128
|
-
const logger$
|
|
39084
|
+
const logger$e = createLogger("SignPCIComponent");
|
|
39129
39085
|
function SignPCIComponent({
|
|
39130
39086
|
legalEntityId,
|
|
39131
39087
|
modalView,
|
|
@@ -39155,7 +39111,7 @@ function SignPCIComponent({
|
|
|
39155
39111
|
onClose == null ? void 0 : onClose();
|
|
39156
39112
|
};
|
|
39157
39113
|
const fetchLegalEntity = useCallback(async () => {
|
|
39158
|
-
await getLegalEntity2(legalEntityId).then((res) => setLegalEntity(res)).catch(logger$
|
|
39114
|
+
await getLegalEntity2(legalEntityId).then((res) => setLegalEntity(res)).catch(logger$e.error);
|
|
39159
39115
|
}, [getLegalEntity2, legalEntityId]);
|
|
39160
39116
|
const fetchStatus = useCallback(async () => {
|
|
39161
39117
|
await getPciStatus2(legalEntityId, { additionalSalesChannels }).then(({ signingRequired }) => {
|
|
@@ -39166,7 +39122,7 @@ function SignPCIComponent({
|
|
|
39166
39122
|
await getPciTemplate2(legalEntityId, {
|
|
39167
39123
|
additionalSalesChannels,
|
|
39168
39124
|
language: i18n.locale.substring(0, 2) ?? "en"
|
|
39169
|
-
}).then((res) => setPciTemplate(res)).catch(logger$
|
|
39125
|
+
}).then((res) => setPciTemplate(res)).catch(logger$e.error);
|
|
39170
39126
|
}, [additionalSalesChannels, getPciTemplate2, i18n.locale, legalEntityId]);
|
|
39171
39127
|
useEffect(() => {
|
|
39172
39128
|
(async () => {
|
|
@@ -39433,6 +39389,9 @@ const getCompanySchemaKeys = (country, currentData, schemaKeys) => {
|
|
|
39433
39389
|
"numberOfEmployees"
|
|
39434
39390
|
);
|
|
39435
39391
|
}
|
|
39392
|
+
if (!euCountries.includes(country)) {
|
|
39393
|
+
fieldsToRemove.push("legalForm");
|
|
39394
|
+
}
|
|
39436
39395
|
if (currentData.isCompanyOwnedByAnotherCompany !== "Yes") {
|
|
39437
39396
|
fieldsToRemove.push("isParentOwnedByAnotherCompany");
|
|
39438
39397
|
}
|
|
@@ -39447,7 +39406,8 @@ const getCompanySchemaKeys = (country, currentData, schemaKeys) => {
|
|
|
39447
39406
|
const getParentCompanySchemaKeys = (currentData, schemaKeys) => {
|
|
39448
39407
|
var _a;
|
|
39449
39408
|
const fieldsToRemove = [];
|
|
39450
|
-
|
|
39409
|
+
const companyCountry = (_a = currentData == null ? void 0 : currentData.registrationAddress) == null ? void 0 : _a.country;
|
|
39410
|
+
if (!isEeaCountry(companyCountry)) {
|
|
39451
39411
|
fieldsToRemove.push(
|
|
39452
39412
|
"financialReportingDate",
|
|
39453
39413
|
"netAssets",
|
|
@@ -39456,6 +39416,9 @@ const getParentCompanySchemaKeys = (currentData, schemaKeys) => {
|
|
|
39456
39416
|
"numberOfEmployees"
|
|
39457
39417
|
);
|
|
39458
39418
|
}
|
|
39419
|
+
if (!companyCountry || !euCountries.includes(companyCountry)) {
|
|
39420
|
+
fieldsToRemove.push("legalForm");
|
|
39421
|
+
}
|
|
39459
39422
|
if (currentData.doesYourCompanyHaveLEI !== "Yes") {
|
|
39460
39423
|
fieldsToRemove.push("legalEntityIdentifier");
|
|
39461
39424
|
}
|
|
@@ -39477,6 +39440,11 @@ const validateDateNotInTheFuture = (selectedDate) => {
|
|
|
39477
39440
|
return new Date(selectedDate) <= /* @__PURE__ */ new Date();
|
|
39478
39441
|
};
|
|
39479
39442
|
const highExposureCompanyDetailsValidations = {
|
|
39443
|
+
legalForm: {
|
|
39444
|
+
modes: ["blur"],
|
|
39445
|
+
validate: (legalName) => !isEmpty$1(legalName),
|
|
39446
|
+
errorMessage: "fieldIsRequired"
|
|
39447
|
+
},
|
|
39480
39448
|
numberOfEmployees: [
|
|
39481
39449
|
{
|
|
39482
39450
|
modes: ["blur"],
|
|
@@ -39581,7 +39549,11 @@ const highExposureCompanyDetailsValidations = {
|
|
|
39581
39549
|
]
|
|
39582
39550
|
};
|
|
39583
39551
|
const highExposureParentCompaniesDetailsValidations = {
|
|
39584
|
-
|
|
39552
|
+
legalForm: {
|
|
39553
|
+
modes: ["blur"],
|
|
39554
|
+
validate: (legalName) => !isEmpty$1(legalName),
|
|
39555
|
+
errorMessage: "fieldIsRequired"
|
|
39556
|
+
},
|
|
39585
39557
|
legalName: {
|
|
39586
39558
|
modes: ["blur"],
|
|
39587
39559
|
validate: (legalName) => !isEmpty$1(legalName),
|
|
@@ -39685,7 +39657,7 @@ const highExposureParentCompaniesDetailsValidations = {
|
|
|
39685
39657
|
}
|
|
39686
39658
|
]
|
|
39687
39659
|
};
|
|
39688
|
-
const logger$
|
|
39660
|
+
const logger$d = createLogger("LegalFormField");
|
|
39689
39661
|
function LegalFormField({
|
|
39690
39662
|
name = "legalForm",
|
|
39691
39663
|
data,
|
|
@@ -39723,7 +39695,7 @@ function LegalFormField({
|
|
|
39723
39695
|
}));
|
|
39724
39696
|
setLegalForms(legalFormsResponse);
|
|
39725
39697
|
}
|
|
39726
|
-
}).catch(() => logger$
|
|
39698
|
+
}).catch(() => logger$d.error);
|
|
39727
39699
|
}, [countryCode]);
|
|
39728
39700
|
return /* @__PURE__ */ jsx(
|
|
39729
39701
|
Field,
|
|
@@ -39749,7 +39721,7 @@ function LegalFormField({
|
|
|
39749
39721
|
}
|
|
39750
39722
|
);
|
|
39751
39723
|
}
|
|
39752
|
-
const logger$
|
|
39724
|
+
const logger$c = createLogger("NaceCodeField");
|
|
39753
39725
|
function NaceCodeField({
|
|
39754
39726
|
name = "naceCode",
|
|
39755
39727
|
data,
|
|
@@ -39769,7 +39741,7 @@ function NaceCodeField({
|
|
|
39769
39741
|
if (response) {
|
|
39770
39742
|
setNaceCodes(response);
|
|
39771
39743
|
}
|
|
39772
|
-
}).catch(() => logger$
|
|
39744
|
+
}).catch(() => logger$c.error);
|
|
39773
39745
|
}, []);
|
|
39774
39746
|
const handleChangeForNaceCode = (e) => {
|
|
39775
39747
|
var _a;
|
|
@@ -40036,6 +40008,7 @@ function HighExposureFinancialInformation({
|
|
|
40036
40008
|
name: "netAssets",
|
|
40037
40009
|
label: formUtils.getLabel("netAssets", "totalAssets"),
|
|
40038
40010
|
helper: i18n.get("totalAssetsHelper"),
|
|
40011
|
+
errorMessage: formUtils.getErrorMessage("netAssets", errors, fieldProblems),
|
|
40039
40012
|
children: (childProps) => /* @__PURE__ */ jsx(
|
|
40040
40013
|
InputCurrency,
|
|
40041
40014
|
{
|
|
@@ -40054,6 +40027,7 @@ function HighExposureFinancialInformation({
|
|
|
40054
40027
|
name: "annualTurnover",
|
|
40055
40028
|
label: formUtils.getLabel("annualTurnover", "annualTurnover"),
|
|
40056
40029
|
helper: i18n.get("annualTurnoverHelper"),
|
|
40030
|
+
errorMessage: formUtils.getErrorMessage("annualTurnover", errors, fieldProblems),
|
|
40057
40031
|
children: (childProps) => /* @__PURE__ */ jsx(
|
|
40058
40032
|
InputCurrency,
|
|
40059
40033
|
{
|
|
@@ -40777,7 +40751,7 @@ const FormEndState = ({
|
|
|
40777
40751
|
);
|
|
40778
40752
|
};
|
|
40779
40753
|
const parseConfiguration = ({ matchingScenario }) => parseHighExposureScenarios(matchingScenario == null ? void 0 : matchingScenario[LegalEntityType.ORGANIZATION]);
|
|
40780
|
-
const logger$
|
|
40754
|
+
const logger$b = createLogger("UpdateLegalEntityForHighExposure");
|
|
40781
40755
|
const customLabels = {
|
|
40782
40756
|
company: {
|
|
40783
40757
|
legalForm: "businessStructure",
|
|
@@ -40898,7 +40872,7 @@ function UpdateLegalEntityForHighExposure({
|
|
|
40898
40872
|
useEffect(() => {
|
|
40899
40873
|
(async () => {
|
|
40900
40874
|
await fetchLegalEntities();
|
|
40901
|
-
})().catch(logger$
|
|
40875
|
+
})().catch(logger$b.error);
|
|
40902
40876
|
}, [fetchLegalEntities]);
|
|
40903
40877
|
const [data, setData] = useState(dataFromResponse);
|
|
40904
40878
|
const [problems, setProblems] = useState(problemsProp ?? {});
|
|
@@ -41298,7 +41272,7 @@ function getContentByStatus(status) {
|
|
|
41298
41272
|
return contentMap[status];
|
|
41299
41273
|
}
|
|
41300
41274
|
const FINAL_STATUSES = [OnboardingStatus.VERIFIED, OnboardingStatus.REJECTED];
|
|
41301
|
-
const logger$
|
|
41275
|
+
const logger$a = createLogger("ViewVerificationStatusComponent");
|
|
41302
41276
|
function ViewVerificationStatusComponent({
|
|
41303
41277
|
legalEntityId,
|
|
41304
41278
|
hideExplanation = false,
|
|
@@ -41317,12 +41291,12 @@ function ViewVerificationStatusComponent({
|
|
|
41317
41291
|
if (!onboardingStatus) return;
|
|
41318
41292
|
const statusContent = getContentByStatus(onboardingStatus);
|
|
41319
41293
|
if (statusContent) return statusContent;
|
|
41320
|
-
logger$
|
|
41294
|
+
logger$a.error(`there is no content for status "${onboardingStatus}"`);
|
|
41321
41295
|
}, [onboardingStatus]);
|
|
41322
41296
|
const handleError = useCallback(
|
|
41323
41297
|
(rawError, userMessage) => {
|
|
41324
41298
|
const error = coerceError(rawError);
|
|
41325
|
-
logger$
|
|
41299
|
+
logger$a.error(error);
|
|
41326
41300
|
setAlertContent(userMessage);
|
|
41327
41301
|
onError == null ? void 0 : onError({
|
|
41328
41302
|
error,
|
|
@@ -41356,7 +41330,7 @@ function ViewVerificationStatusComponent({
|
|
|
41356
41330
|
});
|
|
41357
41331
|
useEffect(() => {
|
|
41358
41332
|
setAlertContent(void 0);
|
|
41359
|
-
fetchOnboardingStatus().then(updateOnboardingStatus).catch(logger$
|
|
41333
|
+
fetchOnboardingStatus().then(updateOnboardingStatus).catch(logger$a.error);
|
|
41360
41334
|
}, [fetchOnboardingStatus, updateOnboardingStatus]);
|
|
41361
41335
|
const [loadingLinkStatus, setLinkLoadingStatus] = useState("success");
|
|
41362
41336
|
const redirectToAdyen = async () => {
|
|
@@ -41551,40 +41525,43 @@ const getVersionConfiguration = async (context) => {
|
|
|
41551
41525
|
}
|
|
41552
41526
|
});
|
|
41553
41527
|
};
|
|
41554
|
-
const logger$
|
|
41555
|
-
const useVersionConfiguration =
|
|
41556
|
-
var _a, _b;
|
|
41528
|
+
const logger$9 = createLogger("UseVersionConfiguration");
|
|
41529
|
+
const useVersionConfiguration = (legalEntityId) => {
|
|
41557
41530
|
const { isEmbeddedDropin, loadingContext: base } = useAuthContext();
|
|
41558
41531
|
const { enableVersionExperiment } = useExperimentsContext();
|
|
41559
|
-
const loadingContext = `${base}api/${COMPONENTS_API_VERSION}/`;
|
|
41560
|
-
|
|
41561
|
-
return;
|
|
41562
|
-
|
|
41563
|
-
|
|
41564
|
-
|
|
41565
|
-
|
|
41566
|
-
|
|
41567
|
-
|
|
41568
|
-
|
|
41569
|
-
|
|
41570
|
-
|
|
41532
|
+
const loadingContext = `${base}api/${COMPONENTS_API_VERSION}/legalEntities/`;
|
|
41533
|
+
useEffect(() => {
|
|
41534
|
+
if (!isEmbeddedDropin) return;
|
|
41535
|
+
(async () => {
|
|
41536
|
+
var _a, _b;
|
|
41537
|
+
try {
|
|
41538
|
+
const versionConfiguration = await getVersionConfiguration({
|
|
41539
|
+
loadingContext,
|
|
41540
|
+
legalEntityId
|
|
41541
|
+
});
|
|
41542
|
+
(_b = (_a = versionConfiguration == null ? void 0 : versionConfiguration.features) == null ? void 0 : _a.forEach) == null ? void 0 : _b.call(_a, (feature) => enableVersionExperiment(feature));
|
|
41543
|
+
} catch (e) {
|
|
41544
|
+
logger$9.error("Failed to set version configuration", e);
|
|
41545
|
+
}
|
|
41546
|
+
})();
|
|
41547
|
+
}, [enableVersionExperiment, isEmbeddedDropin, legalEntityId, loadingContext]);
|
|
41571
41548
|
};
|
|
41572
|
-
const logger$
|
|
41549
|
+
const logger$8 = createLogger("loadCountries");
|
|
41573
41550
|
const countriesImports = /* @__PURE__ */ Object.assign({ "./de-DE.json": () => import("./de-DE-Cx8Uim1K.js"), "./el-GR.json": () => import("./el-GR-B7_JR3z5.js"), "./en-US.json": () => import("./en-US-CkdCbOCX.js"), "./es-ES.json": () => import("./es-ES-NBv3HHhn.js"), "./fr-FR.json": () => import("./fr-FR-DdSVMVsp.js"), "./it-IT.json": () => import("./it-IT-Bwdk3zuj.js"), "./ja-JP.json": () => import("./ja-JP-Bsvzm8zu.js"), "./nl-NL.json": () => import("./nl-NL-DofKaNkk.js"), "./pt-PT.json": () => import("./pt-PT-DFEvMD1M.js"), "./ru-RU.json": () => import("./ru-RU-PiM0ZI5h.js"), "./sv-SE.json": () => import("./sv-SE-C0GoLwTg.js"), "./zh-CN.json": () => import("./zh-CN-DJs6Hct-.js"), "./zh-TW.json": () => import("./zh-TW-BWhLbns8.js") });
|
|
41574
41551
|
const loadCountriesDataset = async (locale) => {
|
|
41575
41552
|
const importForLocale = countriesImports[`./${locale}.json`];
|
|
41576
41553
|
if (!importForLocale) {
|
|
41577
|
-
logger$
|
|
41554
|
+
logger$8.warn(`No countries dataset for ${locale}, falling back to en-US`);
|
|
41578
41555
|
return (await import("./en-US-CkdCbOCX.js")).default;
|
|
41579
41556
|
}
|
|
41580
41557
|
return (await importForLocale()).default;
|
|
41581
41558
|
};
|
|
41582
|
-
const logger$
|
|
41559
|
+
const logger$7 = createLogger("loadStates");
|
|
41583
41560
|
const statesImports = /* @__PURE__ */ Object.assign({ "./AU/en-US.json": () => import("./en-US-CQv3D6--.js"), "./BR/en-US.json": () => import("./en-US-eaysbh-g.js"), "./BR/pt-BR.json": () => import("./pt-BR-CNtbeGFJ.js"), "./CA/en-US.json": () => import("./en-US-gM26UC0X.js"), "./NZ/en-US.json": () => import("./en-US-CLmaFLwu.js"), "./US/en-US.json": () => import("./en-US-7uBFgKyC.js") });
|
|
41584
41561
|
const loadStatesDataset = async (country, locale) => {
|
|
41585
41562
|
const importForLocale = statesImports[`./${country}/${locale}.json`];
|
|
41586
41563
|
if (!importForLocale) {
|
|
41587
|
-
logger$
|
|
41564
|
+
logger$7.warn(`No ${country} states dataset for ${locale}, falling back to en-US`);
|
|
41588
41565
|
const fallbackImport = statesImports[`./${country}/en-US.json`];
|
|
41589
41566
|
return (await fallbackImport()).default;
|
|
41590
41567
|
}
|
|
@@ -41720,7 +41697,7 @@ const validatePhoneNumber$1 = async (context, phoneNumber) => {
|
|
|
41720
41697
|
{ number: phoneNumber }
|
|
41721
41698
|
);
|
|
41722
41699
|
};
|
|
41723
|
-
const logger$
|
|
41700
|
+
const logger$6 = createLogger("verify-id-number");
|
|
41724
41701
|
const verifyIdNumber$1 = async (context, request) => {
|
|
41725
41702
|
const { loadingContext, legalEntityId } = context;
|
|
41726
41703
|
try {
|
|
@@ -41743,13 +41720,13 @@ const verifyIdNumber$1 = async (context, request) => {
|
|
|
41743
41720
|
if (responseData.status === 500) {
|
|
41744
41721
|
return { status: 500, message: "Service did not respond, do not block verification" };
|
|
41745
41722
|
}
|
|
41746
|
-
return logger$
|
|
41723
|
+
return logger$6.warn(`Unexpected response status ${responseData.status}`);
|
|
41747
41724
|
}
|
|
41748
41725
|
},
|
|
41749
41726
|
request
|
|
41750
41727
|
);
|
|
41751
41728
|
} catch (e) {
|
|
41752
|
-
logger$
|
|
41729
|
+
logger$6.warn("WARNING: idNumber verification failed - error:", e);
|
|
41753
41730
|
}
|
|
41754
41731
|
};
|
|
41755
41732
|
const getEmbeddedApi = ({
|
|
@@ -41848,7 +41825,7 @@ const validatePhoneNumber = async (context, phoneNumber) => {
|
|
|
41848
41825
|
{ number: phoneNumber }
|
|
41849
41826
|
);
|
|
41850
41827
|
};
|
|
41851
|
-
const logger$
|
|
41828
|
+
const logger$5 = createLogger("verify-id-number");
|
|
41852
41829
|
const verifyIdNumber = async (context, request) => {
|
|
41853
41830
|
const { loadingContext, clientKey } = context;
|
|
41854
41831
|
try {
|
|
@@ -41866,7 +41843,7 @@ const verifyIdNumber = async (context, request) => {
|
|
|
41866
41843
|
if (responseData.status === 500) {
|
|
41867
41844
|
return { status: 500, message: "Service did not respond, do not block verification" };
|
|
41868
41845
|
}
|
|
41869
|
-
return logger$
|
|
41846
|
+
return logger$5.warn(`Unexpected response status ${responseData.status}`);
|
|
41870
41847
|
},
|
|
41871
41848
|
path: "v1/verification/idNumber",
|
|
41872
41849
|
clientKey
|
|
@@ -41874,7 +41851,7 @@ const verifyIdNumber = async (context, request) => {
|
|
|
41874
41851
|
request
|
|
41875
41852
|
);
|
|
41876
41853
|
} catch (e) {
|
|
41877
|
-
logger$
|
|
41854
|
+
logger$5.warn("WARNING: idNumber verification failed - error:", e);
|
|
41878
41855
|
}
|
|
41879
41856
|
};
|
|
41880
41857
|
const getKycExternalApi = ({
|
|
@@ -41903,7 +41880,7 @@ const ConfigurationApiProvider = ({
|
|
|
41903
41880
|
}) => {
|
|
41904
41881
|
const authContext = useAuthContext();
|
|
41905
41882
|
const { isEmbeddedDropin, loadingContext } = authContext;
|
|
41906
|
-
const sdkVersion = "3.
|
|
41883
|
+
const sdkVersion = "3.38.1";
|
|
41907
41884
|
useAnalytics({
|
|
41908
41885
|
onUserEvent,
|
|
41909
41886
|
legalEntityId: rootLegalEntityId,
|
|
@@ -41934,6 +41911,19 @@ const useAccountHolder = (legalEntityId) => {
|
|
|
41934
41911
|
setAccountHolder: setAccountHolderIntoLocalStorage
|
|
41935
41912
|
};
|
|
41936
41913
|
};
|
|
41914
|
+
const logger$4 = createLogger("useAllowedCountries");
|
|
41915
|
+
const useAllowedCountries = () => {
|
|
41916
|
+
const acceptedCountries = useSetting("acceptedCountries");
|
|
41917
|
+
const { getAllowedCountries: getAllowedCountries2 } = useConfigurationApi();
|
|
41918
|
+
const [allowedCountries, setAllowedCountries] = useState(
|
|
41919
|
+
acceptedCountries
|
|
41920
|
+
);
|
|
41921
|
+
useEffect(() => {
|
|
41922
|
+
if (acceptedCountries !== void 0) return;
|
|
41923
|
+
getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$4.error);
|
|
41924
|
+
}, [acceptedCountries]);
|
|
41925
|
+
return allowedCountries;
|
|
41926
|
+
};
|
|
41937
41927
|
const logger$3 = createLogger("CoreProvider");
|
|
41938
41928
|
const CoreProvider = ({
|
|
41939
41929
|
contextCountry: initialContextCountry,
|
|
@@ -41969,9 +41959,18 @@ const CoreProvider = ({
|
|
|
41969
41959
|
idVerificationProviderId,
|
|
41970
41960
|
setIdVerificationProviderId,
|
|
41971
41961
|
setIsModalView,
|
|
41972
|
-
isModalView
|
|
41962
|
+
isModalView,
|
|
41963
|
+
allowedCountries
|
|
41973
41964
|
}),
|
|
41974
|
-
[
|
|
41965
|
+
[
|
|
41966
|
+
contextCountry,
|
|
41967
|
+
accountHolder,
|
|
41968
|
+
setAccountHolder,
|
|
41969
|
+
accountFormat,
|
|
41970
|
+
idVerificationProviderId,
|
|
41971
|
+
isModalView,
|
|
41972
|
+
allowedCountries
|
|
41973
|
+
]
|
|
41975
41974
|
);
|
|
41976
41975
|
return /* @__PURE__ */ jsx(CoreContext.Provider, { value: contextValue, children });
|
|
41977
41976
|
};
|
|
@@ -42574,7 +42573,7 @@ const DebugModal = ({ rootLegalEntityId, onExit, getRootLegalEntity }) => {
|
|
|
42574
42573
|
};
|
|
42575
42574
|
const copyToClipboard = async () => {
|
|
42576
42575
|
const toCopy = {
|
|
42577
|
-
sdkVersion: "3.
|
|
42576
|
+
sdkVersion: "3.38.1",
|
|
42578
42577
|
experiments: Object.fromEntries(allExperimentsWithValues),
|
|
42579
42578
|
settings: Object.fromEntries(allSettingsWithValues)
|
|
42580
42579
|
};
|
|
@@ -42639,7 +42638,7 @@ const DebugModal = ({ rootLegalEntityId, onExit, getRootLegalEntity }) => {
|
|
|
42639
42638
|
/* @__PURE__ */ jsx("div", { className: "adyen-kyc-debug-modal__meta", children: /* @__PURE__ */ jsx("table", { children: /* @__PURE__ */ jsxs("tbody", { children: [
|
|
42640
42639
|
/* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs("td", { children: [
|
|
42641
42640
|
/* @__PURE__ */ jsx("span", { className: "adyen-kyc-debug-modal__table-key", children: "SDK version" }),
|
|
42642
|
-
/* @__PURE__ */ jsx(Tag, { variant: "green", className: "adyen-kyc-tag--large", children: "3.
|
|
42641
|
+
/* @__PURE__ */ jsx(Tag, { variant: "green", className: "adyen-kyc-tag--large", children: "3.38.1" })
|
|
42643
42642
|
] }) }),
|
|
42644
42643
|
/* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs("td", { children: [
|
|
42645
42644
|
/* @__PURE__ */ jsx("span", { className: "adyen-kyc-debug-modal__table-key", children: "rootLegalEntityId" }),
|