@adyen/kyc-components 3.45.1 → 3.46.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.
Files changed (50) hide show
  1. package/dist/es/adyen-kyc-components.es.js +1504 -568
  2. package/dist/es/{bg-BG-Q7jr61oX.js → bg-BG-Ihgju3Pi.js} +49 -26
  3. package/dist/es/{cs-CZ-DWt-8d0a.js → cs-CZ-BwFstFmQ.js} +49 -26
  4. package/dist/es/{da-DK-DzKDKodb.js → da-DK-8v1CN9Kj.js} +49 -26
  5. package/dist/es/{de-DE-CTrlEFB7.js → de-DE-DtR-ZoAt.js} +49 -26
  6. package/dist/es/{el-GR-BEyHixTO.js → el-GR-CBnu_V96.js} +49 -26
  7. package/dist/es/{es-ES-C5YKWCME.js → es-ES-kb2BRKrK.js} +49 -26
  8. package/dist/es/{et-EE-UTwEA7KT.js → et-EE-UdwhQ1tL.js} +49 -26
  9. package/dist/es/{fi-FI-Dlg3u-HY.js → fi-FI-DX8-uQWW.js} +49 -26
  10. package/dist/es/{fr-FR-BrL2V-lF.js → fr-FR-Dflt81Kj.js} +49 -26
  11. package/dist/es/{hr-HR-CR1NpsoY.js → hr-HR-DDW3mkAM.js} +49 -26
  12. package/dist/es/{hu-HU-BkmzV8oZ.js → hu-HU-B7KDp-GT.js} +49 -26
  13. package/dist/es/{it-IT-BR75YMjD.js → it-IT-Q6-mT16i.js} +49 -26
  14. package/dist/es/{lt-LT-Cm17tGP4.js → lt-LT-DKLjCNW_.js} +49 -26
  15. package/dist/es/{lv-LV-Bj0D7n67.js → lv-LV-Cj-obzFe.js} +49 -26
  16. package/dist/es/{nl-NL-bhqLkBQz.js → nl-NL-C0DfxtrT.js} +49 -26
  17. package/dist/es/{no-NO-CrzRhfMh.js → no-NO-DRJeRltS.js} +49 -26
  18. package/dist/es/{pl-PL-BcncZK0S.js → pl-PL-DPYok5sp.js} +49 -26
  19. package/dist/es/{pt-PT-Bwx0xHGg.js → pt-PT-C5GFc3jY.js} +49 -26
  20. package/dist/es/{ro-RO-Bj9nLST9.js → ro-RO-BhsqkN_s.js} +49 -26
  21. package/dist/es/{sk-SK-CI2V7naC.js → sk-SK-HaK9kYN-.js} +49 -26
  22. package/dist/es/{sl-SI-Dg4cE1ea.js → sl-SI-VeIDFOxi.js} +49 -26
  23. package/dist/es/{sv-SE-DPB5qLHu.js → sv-SE-DEhZRTDK.js} +49 -26
  24. package/dist/style.css +107 -56
  25. package/dist/types/components/Address/utils.d.ts +1 -1
  26. package/dist/types/components/CustomerSupport/CustomerSupport.d.ts +1 -1
  27. package/dist/types/components/CustomerSupport/types.d.ts +0 -1
  28. package/dist/types/components/Dropins/DropinLayout/types.d.ts +0 -1
  29. package/dist/types/components/Dropins/SourceOfFundsDropin/SOFAdditionalData/AdditionalDataForAssetSale.d.ts +2 -0
  30. package/dist/types/components/Dropins/SourceOfFundsDropin/SOFAdditionalData/AdditionalDataForBusiness.d.ts +2 -0
  31. package/dist/types/components/Dropins/SourceOfFundsDropin/SOFAdditionalData/AdditionalDataForCryptocurrency.d.ts +2 -0
  32. package/dist/types/components/Dropins/SourceOfFundsDropin/SOFAdditionalData/AdditionalDataForGambling.d.ts +2 -0
  33. package/dist/types/components/Dropins/SourceOfFundsDropin/SOFAdditionalData/AdditionalDataForThirdParty.d.ts +2 -0
  34. package/dist/types/components/Dropins/SourceOfFundsDropin/SOFAdditionalData/SOFFinancierModal.d.ts +18 -0
  35. package/dist/types/components/Dropins/SourceOfFundsDropin/SourceOfFundsAdditionalData.d.ts +2 -0
  36. package/dist/types/components/Dropins/SourceOfFundsDropin/SourceOfFundsDropin.d.ts +0 -3
  37. package/dist/types/components/Dropins/SourceOfFundsDropin/types.d.ts +27 -16
  38. package/dist/types/components/Dropins/SourceOfFundsDropin/utils.d.ts +41 -0
  39. package/dist/types/components/Dropins/SourceOfFundsDropin/validate.d.ts +2 -2
  40. package/dist/types/components/ui/atoms/InputGroupAddon/InputGroupAddon.d.ts +7 -0
  41. package/dist/types/core/errorMapping.d.ts +1 -0
  42. package/dist/types/core/models/api/source-of-funds.d.ts +4 -4
  43. package/dist/types/core/models/form.d.ts +0 -1
  44. package/dist/types/stores/globalStore/get-task-status.d.ts +1 -0
  45. package/dist/types/utils/entityStatusUtil.d.ts +1 -1
  46. package/dist/types/utils/formatCurrency.d.ts +1 -0
  47. package/dist/types/utils/mapping/componentApiMapping.d.ts +11 -14
  48. package/package.json +1 -1
  49. package/dist/types/components/Dropins/DropinLayout/EmbeddedActionBar/EmbeddedActionBar.d.ts +0 -7
  50. package/dist/types/components/Dropins/SourceOfFundsDropin/SourceOfFundsTellUsMore.d.ts +0 -3
@@ -10,6 +10,7 @@ import OpenBankingSDK from "@adyen/openbankingsdk";
10
10
  import { jsxs as jsxs$1, jsx as jsx$1 } from "preact/compat/jsx-runtime";
11
11
  import "@adyen/adyen-document-viewer/dist/adyen-document-viewer.min.css";
12
12
  import AdyenDocumentViewer from "@adyen/adyen-document-viewer";
13
+ import isURL from "validator/es/lib/isURL.js";
13
14
  const ConfigurationApiContext = createContext(void 0);
14
15
  const useConfigurationApi = () => {
15
16
  const configurationApi = useContext(ConfigurationApiContext);
@@ -97,6 +98,7 @@ const defaultLocaleTranslations = {
97
98
  addExtraBankAccount: "Add extra bank account",
98
99
  addExtraPayinAccount: "Add extra payin account",
99
100
  addExtraPayoutAccount: "Add extra payout account",
101
+ addInvestor: "Add investor",
100
102
  addManually: "Add manually",
101
103
  addMissingBankDetails: "We are missing your bank details in order to perform payouts, please add your bank account.",
102
104
  addOwnerToTrustMember: "Add owner of %{trustMember}",
@@ -115,12 +117,13 @@ const defaultLocaleTranslations = {
115
117
  adyenKeepsDataAsLongAsLegallyRequired: "Adyen only keeps your data for as long as we're legally required to. It won't be used for any other purposes or by other third parties than those stated.",
116
118
  adyenWillOnlyGetTemporaryAccess: "Adyen will only gain temporary access to your bank details, and your data is never shared with third parties.",
117
119
  allCapabilitiesValid: "All capabilities are valid",
120
+ amountIsRequired: "Amount is required",
121
+ amountWon: "Amount won",
118
122
  anAssociation: "An association",
119
123
  anLEIIsAUniqueCode: "An LEI is a unique code that identifies legal entities, including companies, who engage in financial transactions.",
120
124
  andResubmit: "and submit again.",
121
125
  annualReport: "Annual Report",
122
126
  annualTurnover: "Annual turnover",
123
- annualTurnoverCurrency: "Annual turnover currency",
124
127
  annualTurnoverHelper: "The annual sales revenue minus all discounts and sales taxes. Also known as net sales.",
125
128
  annualTurnoverValue: "Annual turnover value",
126
129
  apartmentSuite: "Apartment / Suite",
@@ -129,6 +132,7 @@ const defaultLocaleTranslations = {
129
132
  areYouACompany: "Are you a company?",
130
133
  areYouAnIndividual: "Are you an individual?",
131
134
  areYouSureYouWantToDeleteThisBankAccount: "Are you sure you want to delete this bank account?",
135
+ areYouSureYouWantToDeleteThisInvestorDetails: "Are you sure you want to delete this investor details?",
132
136
  arithmosEngraphes: "Αριθμός Εγγραφής Φ.Π.Α.",
133
137
  articlesOfIncorporation: "Articles of incorporation",
134
138
  arvonlisaveronumeroMervardesskattenummer: "Arvonlisäveronumero Mervärdesskattenummer",
@@ -197,10 +201,13 @@ const defaultLocaleTranslations = {
197
201
  businessAccountDetailsDescriptionReview: "In order to ensure your data is up-to-date, please verify the following details. If necessary, please adjust any data that is no longer accurate.",
198
202
  businessAccountTerms: "Business Account Terms",
199
203
  businessDetails: "Business details",
204
+ businessDescription: "Business description",
205
+ businessEarningDetails: "Business earning details",
200
206
  businessEntityDescription: "This is usually a sole proprietor, private company, public corporation, partnership, or non profit.",
201
207
  businessEntityTitle: "Business entity",
202
208
  businessIncorporationNumber: "Business incorporation number",
203
209
  businessInformation: "Business information",
210
+ businessInvestorDetails: "Business investor details",
204
211
  businessName: "Business name",
205
212
  businessNumber: "Business number",
206
213
  businessRegistrationDocument__FR: "Business registration document, such as a KBIS extract or situation au répertoire sirene",
@@ -300,8 +307,11 @@ const defaultLocaleTranslations = {
300
307
  countryRegionOfEstablishment: "Country/region of establishment",
301
308
  countryWithoutVatOrGstSystem: "There is no indirect tax in this country/region of establishment",
302
309
  country__US__business: "Where is your business registered?",
310
+ cryptocurrencyExchange: "Cryptocurrency exchange",
311
+ cryptocurrencyProceedDetails: "Cryptocurrency proceed details",
303
312
  currency: "Currency",
304
313
  currencyCode: "Currency code",
314
+ currencyIsRequired: "Currency is required",
305
315
  currencyPlaceholder: "Select a currency code",
306
316
  customerSupport: "Customer support",
307
317
  cyRegistrationNumber: "Αριθμός Εγγραφής",
@@ -309,6 +319,8 @@ const defaultLocaleTranslations = {
309
319
  dataReviewNeeded: "A data review is neeced.",
310
320
  dateCannotBeInTheFuture: "Date cannot be in the future",
311
321
  dateOfIncorporation: "Date of incorporation",
322
+ dateOfSale: "Date of sale",
323
+ dateOfSourceEvent: "Date of source event",
312
324
  dateOfTotalAssetsCalculation: "The date on which total assets and annual turnover were calculated is often the balance sheet date.",
313
325
  dateOnDocumentNoOlderThanXMonths: "Date on the document is no older than %{numberOfMonths} months",
314
326
  datePlaceholder: "dd/mm/yyyy",
@@ -322,6 +334,7 @@ const defaultLocaleTranslations = {
322
334
  definedBeneficiary: "Defined beneficiary",
323
335
  definedBeneficiaryDescription: "A natural person, corporate entity, or member of a class in whose interest the trust is principally constituted or operates.",
324
336
  "delete": "Delete",
337
+ deleteInvestorDetails: "Delete investor details",
325
338
  depositSlip: "Deposit slip",
326
339
  describeWhoIsABeneficiaryInYourTrust: "Describe in open format who is set to be a beneficiary in your trust deed",
327
340
  description: "Description",
@@ -667,6 +680,10 @@ const defaultLocaleTranslations = {
667
680
  errorMessage_2_8196: "proofOfOwnership document to perform verification was missing.",
668
681
  errorMessage_2_8234: "'organization.countryOfGoverningLaw' was missing.",
669
682
  errorMessage_2_8236: "Proof of director was missing.",
683
+ errorMessage_2_8247: "'organization.support.email' was missing",
684
+ errorMessage_2_8248: "'individual.support.email' was missing",
685
+ errorMessage_2_8249: "'organization.support.phone.number' was missing",
686
+ errorMessage_2_8250: "'individual.support.phone.number' was missing",
670
687
  errorMessage_3_10: "Review of data is required",
671
688
  euVatNumber: "EU VAT number",
672
689
  exemptedFromTax: "Exempted from tax",
@@ -717,6 +734,7 @@ const defaultLocaleTranslations = {
717
734
  fullDocumentVisible: "The full document needs to be visible, with all text readable",
718
735
  fullDocumentVisibleWithReadableText: "The full document needs to be visible, with all text readable",
719
736
  fundingSources: "Funding sources",
737
+ gamblingWebsite: "Gambling website",
720
738
  getSetUpInstantly: "Get set up instantly",
721
739
  getYourBusinessVerifiedDetails: "Get your business's verified details instantly and skip uploading documents.",
722
740
  getYourVerifiedDetailsInstantly: "Get your verified details instantly and skip uploading documents.",
@@ -875,6 +893,9 @@ const defaultLocaleTranslations = {
875
893
  invalidInputError: "There was an invalid input error:",
876
894
  invalidNumberOfEmployees: "Please enter a valid number",
877
895
  invalidPhoneNumber: "Please enter a valid phone number",
896
+ investmentAmount: "Investment amount",
897
+ investorInformation: "Investor information",
898
+ investorLocation: "Investor's location",
878
899
  irdDocument: "IRD document",
879
900
  irdNumber: "IRD number",
880
901
  irsCP575: "IRS CP 575 letter",
@@ -1081,8 +1102,10 @@ const defaultLocaleTranslations = {
1081
1102
  phoneNumber__placeholder__US: "(000) 000-0000",
1082
1103
  pleaseEnsureTheFollowing: "Please ensure the following section is fulfilled to complete the review of your data.",
1083
1104
  pleaseEnterAPhoneNumberPrefixedWithCountryCode: "Please enter a phone number prefixed with a country code e.g. %{defaultPrefix}.",
1105
+ pleaseEnterAValidAmount: "Please enter a valid amount.",
1084
1106
  pleaseEnterAValidNumber: "Please enter a valid number.",
1085
1107
  pleaseEnterAValidWholeNumber: "Please enter a valid whole number.",
1108
+ pleaseFillInAllFields: "Please fill in all fields.",
1086
1109
  pleaseNote: "Please note:",
1087
1110
  pleaseProvideThePurposeOfCharitableTrust: "Please provide the purpose of your charitable trust",
1088
1111
  pooledSuperannuationTrust: "Pooled superannuation trust",
@@ -1202,6 +1225,10 @@ const defaultLocaleTranslations = {
1202
1225
  remediationMessage_2_188: "Add proofOfOwnership document document for verification to legal entity",
1203
1226
  remediationMessage_2_222: "Upload a proof of relationship to individual",
1204
1227
  remediationMessage_2_223: "Add 'organization.countryOfGoverningLaw' to legal entity",
1228
+ remediationMessage_2_234: "Add 'organization.support.email' to legal entity",
1229
+ remediationMessage_2_235: "Add 'individual.support.email' to legal entity",
1230
+ remediationMessage_2_236: "Add 'organization.support.phone.number' to legal entity",
1231
+ remediationMessage_2_237: "Add 'individual.support.email' to legal entity",
1205
1232
  remediationMessage_3_100: "Check the above information, then click here to confirm.",
1206
1233
  remove: "Remove",
1207
1234
  removeDecisionMaker: "remove %{decisionMaker}",
@@ -1228,8 +1255,10 @@ const defaultLocaleTranslations = {
1228
1255
  routingNumber: "Routing number",
1229
1256
  routingNumberVisible: "Includes your routing number",
1230
1257
  salarySlip: "Salary slip",
1258
+ saleAmount: "Sale amount",
1231
1259
  sameAsRegisteredAddress: "Same as registered business address",
1232
1260
  sameNameAsLegalName: "Same as legal name of the company",
1261
+ save: "Save",
1233
1262
  saveAndGoToOverview: "Save and go to overview",
1234
1263
  screenshotOfOnlineBankingEnviroment: "Screenshot of online banking environment",
1235
1264
  search: "Search",
@@ -1346,6 +1375,9 @@ const defaultLocaleTranslations = {
1346
1375
  taxReferenceNumber: "Tax reference number",
1347
1376
  taxationDocument: "Taxation document",
1348
1377
  taxpayerReferenceNumber: "Taxpayer reference number",
1378
+ tellUsMoreAboutTheCryptocurrency: "Tell us more about the cryptocurrency earnings that will be used with our financial products.",
1379
+ tellUsMoreAboutThePreviousBusinessEarnings: "Tell us more about the previous business earnings that will be used with our financial products. Upload supporting documents in the next step. ",
1380
+ tellUsMoreAboutTheInvestors: "Tell us more about the investors whose funds will be used with our financial products. Upload supporting documentation in the next step. ",
1349
1381
  tellUsMoreAboutThisSource: "Tell us more about this source",
1350
1382
  textToVerifyAccount: "For you to receive your payouts, we need a verified bank account.",
1351
1383
  the7CharacterIdentifierAssignedToThis: "The 7-character identifier assigned to this company by the Sistema di Interscambio (SDI) for electronic invoicing in Italy. For example, %{example}",
@@ -1434,6 +1466,7 @@ const defaultLocaleTranslations = {
1434
1466
  validationPleaseEnterAValidTaxIdNumber: "Please enter a valid Tax id number.",
1435
1467
  validationPleaseEnterAValidTaxIdNumberWithFormat: "Please enter a valid Tax id number. Expected format: %{format}",
1436
1468
  validationPleaseEnterAValidUen: "Please enter a valid UEN",
1469
+ validationPleaseEnterAValidUrl: "Please enter a valid URL",
1437
1470
  validationPleaseEnterAValidVatNumber: "Please enter a valid Tax id number",
1438
1471
  validationPleaseEnterAValidVatNumberWithFormat: "Please enter a valid VAT number. Expected format: %{format}",
1439
1472
  vatAbsenceReason: "VAT number absence reason",
@@ -2232,7 +2265,7 @@ const NO_ALPHABET_REGEX = /^[^a-zA-Z]*$/;
2232
2265
  const INDIVIDUAL_VALID_CHAR_REGEX = /^[\p{L}\p{M}\d\s\-—./']*$/u;
2233
2266
  const OTHER_ENTITIES_VALID_CHAR_REGEX = /^[\w\s,.;:\-—&!?@()"'/\\+\p{L}\p{M}]+$/u;
2234
2267
  const matchesRegex = (regex, input) => isString(input) && regex.test(input ?? "");
2235
- const hasRepeatedCharacters = (input) => !isEmpty$1(input) && input.length > 1 && new Set(input).size === 1;
2268
+ const hasRepeatedCharacters = (input) => !isEmpty$1(input) && input.length > 1 && new Set(input.toLowerCase()).size === 1;
2236
2269
  const isValidMinLength = (input, minLength = 1) => !isEmpty$1(input) && input.length >= minLength;
2237
2270
  const isInvalidName = (input) => {
2238
2271
  const invalidNames = /* @__PURE__ */ new Set([
@@ -15630,20 +15663,17 @@ const highExposureBaseMapping = {
15630
15663
  };
15631
15664
  const sourceOfFundsBaseMapping = {
15632
15665
  "sourceOfFundsType.type": "sourceOfFunds.type",
15633
- "tellUsMore.description": "sourceOfFunds.description",
15634
- "tellUsMore.annualTurnover": "sourceOfFunds.annualTurnover",
15635
- "tellUsMore.annualTurnoverCurrency": "sourceOfFunds.annualTurnoverCurrency",
15636
- adyenProcessedFunds: "sourceOfFunds.adyenProcessedFunds",
15637
- dateOfFundsReceived: "sourceOfFunds.dateOfFundsReceived",
15638
- purpose: "sourceOfFunds.purpose",
15639
- relationship: "sourceOfFunds.relationship",
15640
- originatorSourceOfFundsType: "sourceOfFunds.originatorSourceOfFundsType",
15641
- originatorLegalEntityId: "sourceOfFunds.originatorLegalEntityId",
15642
- amount: "sourceOfFunds.amount",
15643
- cryptocurrencyExchange: "sourceOfFunds.cryptocurrencyExchange",
15644
- dateOfSourceEvent: "sourceOfFunds.dateOfSourceEvent",
15645
- website: "sourceOfFunds.website",
15646
- financiers: "sourceOfFunds.financiers"
15666
+ "additionalData.description": "sourceOfFunds.description",
15667
+ "additionalData.amount": "sourceOfFunds.amount",
15668
+ "additionalData.dateOfFundsReceived": "sourceOfFunds.dateOfFundsReceived",
15669
+ "additionalData.purpose": "sourceOfFunds.purpose",
15670
+ "additionalData.relationship": "sourceOfFunds.relationship",
15671
+ "additionalData.originatorSourceOfFundsType": "sourceOfFunds.originatorSourceOfFundsType",
15672
+ "additionalData.originatorLegalEntityId": "sourceOfFunds.originatorLegalEntityId",
15673
+ "additionalData.financiers": "sourceOfFunds.financiers",
15674
+ "additionalData.cryptocurrencyExchange": "sourceOfFunds.cryptocurrencyExchange",
15675
+ "additionalData.dateOfSourceEvent": "sourceOfFunds.dateOfSourceEvent",
15676
+ "additionalData.website": "sourceOfFunds.website"
15647
15677
  };
15648
15678
  const businessDetailsComponentsKeyMapping = {
15649
15679
  "additionalInformation.exemptedFromVat": "organization.vatAbsenceReason",
@@ -17448,6 +17478,11 @@ const validatePhoneCountryCodeNotEmptyOnBlur = {
17448
17478
  validate: (phone) => !isEmpty$1(phone == null ? void 0 : phone.phoneCountryCode),
17449
17479
  errorMessage: "missingPhoneCountryCode"
17450
17480
  };
17481
+ const validatePhoneNumberNotEmpty = {
17482
+ modes: ["blur"],
17483
+ validate: (phone) => !isEmpty$1(phone == null ? void 0 : phone.number),
17484
+ errorMessage: "invalidPhoneNumber"
17485
+ };
17451
17486
  const useAsyncPhoneValidationRules = () => {
17452
17487
  const { validatePhoneNumber: validatePhoneNumber2 } = useConfigurationApi();
17453
17488
  return useMemo(
@@ -17464,7 +17499,7 @@ const useAsyncPhoneValidationRules = () => {
17464
17499
  [validatePhoneNumber2]
17465
17500
  );
17466
17501
  };
17467
- const defaultValidators = [validatePhoneCountryCodeNotEmptyOnBlur];
17502
+ const defaultValidators = [validatePhoneCountryCodeNotEmptyOnBlur, validatePhoneNumberNotEmpty];
17468
17503
  const defaultFieldMetadata$6 = {
17469
17504
  label: "phoneNumber",
17470
17505
  validators: defaultValidators
@@ -19748,7 +19783,7 @@ function PersonalDetails(props) {
19748
19783
  const isDecisionMakerTask = taskType === TaskTypes.DECISION_MAKER || taskType === TaskTypes.TRUST_MEMBER_COMPANY_OWNER;
19749
19784
  const isTopLevelEntity = taskType === TaskTypes.INDIVIDUAL;
19750
19785
  const isLegalRepresentativeDetailsTask = taskType === TaskTypes.LEGAL_REPRESENTATIVE_DETAILS;
19751
- const countryRequiringNationality = ((_b = parentLegalEntity == null ? void 0 : parentLegalEntity.organization) == null ? void 0 : _b.registeredAddress.country) || (detailsData == null ? void 0 : detailsData.residencyCountry);
19786
+ const countryRequiringNationality = (detailsData == null ? void 0 : detailsData.residencyCountry) || ((_b = parentLegalEntity == null ? void 0 : parentLegalEntity.organization) == null ? void 0 : _b.registeredAddress.country);
19752
19787
  const requiredFieldsByTask = (requiredFields || personalDetailsFields).filter(
19753
19788
  (field) => !canChangeEntityType && (field !== "role" || field === "role" && isDecisionMakerTask) || canChangeEntityType && (field !== "role" || field === "role" && isDecisionMakerTask) || field === "relationship" && isLegalRepresentativeDetailsTask
19754
19789
  );
@@ -25136,6 +25171,7 @@ const dataMissingRemediationsToFieldsMap = {
25136
25171
  "2_158": ["vatNumber", "exemptedFromVat", "vatAbsenceReason"],
25137
25172
  "2_222": [DocumentType.PROOF_OF_RELATIONSHIP]
25138
25173
  };
25174
+ const CUSTOMER_SUPPORT_DATA_MISSING_ERROR_CODES = ["2_8247", "2_8248", "2_8249", "2_8250"];
25139
25175
  const DATA_MISSING_DECISION_MAKER_ERROR_CODE_MAPPING = {
25140
25176
  "2_8064": "2_123",
25141
25177
  // Owner
@@ -29811,6 +29847,15 @@ const formatCurrency = (amount, currency, locale) => {
29811
29847
  );
29812
29848
  return format(amount);
29813
29849
  };
29850
+ const formatAmountWithCurrency = (amount, currency) => {
29851
+ const commaDecimalCurrencies = ["EUR", "BRL", "ARS", "CHF"];
29852
+ const locale = commaDecimalCurrencies.includes(currency.toUpperCase()) ? "de-DE" : "en-US";
29853
+ const formattedAmount = formatCurrency(amount, currency, locale);
29854
+ if (!formattedAmount) {
29855
+ return void 0;
29856
+ }
29857
+ return `${formattedAmount} ${currency}`;
29858
+ };
29814
29859
  const formatFinancialInformationSummary = (data, i18n) => {
29815
29860
  if (!data) return {};
29816
29861
  const summary2 = {
@@ -32253,7 +32298,12 @@ const mapCustomerSupportSchemaToCustomerSupportType = (customerSupport) => {
32253
32298
  };
32254
32299
  };
32255
32300
  const logger$t = createLogger("CustomerSupport");
32256
- function CustomerSupport(props) {
32301
+ function CustomerSupport({
32302
+ country,
32303
+ onSubmit,
32304
+ legalEntityResponse,
32305
+ handleUpdateLegalEntity
32306
+ }) {
32257
32307
  var _a, _b, _c, _d, _e, _f;
32258
32308
  const { i18n } = useI18nContext();
32259
32309
  const { showToast } = useToastContext();
@@ -32262,7 +32312,6 @@ function CustomerSupport(props) {
32262
32312
  const {
32263
32313
  state: { currentState }
32264
32314
  } = useStateContext();
32265
- const { country, onNavigateBack, onSubmit, legalEntityResponse, handleUpdateLegalEntity } = props;
32266
32315
  const legalEntityType = legalEntityResponse.type;
32267
32316
  const contactDetailsData = {
32268
32317
  phone: (_b = (_a = legalEntityResponse[legalEntityType]) == null ? void 0 : _a.support) == null ? void 0 : _b.phone,
@@ -32308,15 +32357,7 @@ function CustomerSupport(props) {
32308
32357
  shouldValidate
32309
32358
  }
32310
32359
  ),
32311
- /* @__PURE__ */ jsx(
32312
- ActionBar,
32313
- {
32314
- onBack: onNavigateBack,
32315
- onNext: submitForm,
32316
- backButtonLabel: i18n.get("saveAndGoToOverview"),
32317
- nextButtonLabel: i18n.get("submit")
32318
- }
32319
- )
32360
+ /* @__PURE__ */ jsx(ActionBar, { onNext: submitForm, nextButtonLabel: i18n.get("submit") })
32320
32361
  ] });
32321
32362
  }
32322
32363
  function useDataMissingRemediations({
@@ -33098,6 +33139,46 @@ var VerificationStatus = /* @__PURE__ */ ((VerificationStatus2) => {
33098
33139
  VerificationStatus2["REJECTED"] = "rejected";
33099
33140
  return VerificationStatus2;
33100
33141
  })(VerificationStatus || {});
33142
+ const calculateCustomerSupportTask = (capabilityProblems, rootLegalEntity) => {
33143
+ var _a, _b, _c, _d, _e, _f;
33144
+ const supportData = ((_a = rootLegalEntity.individual) == null ? void 0 : _a.support) ?? ((_b = rootLegalEntity.organization) == null ? void 0 : _b.support);
33145
+ const hasMissingDataErrors = (_d = (_c = capabilityProblems.LegalEntity) == null ? void 0 : _c[rootLegalEntity.id].missingData) == null ? void 0 : _d.some((error) => CUSTOMER_SUPPORT_DATA_MISSING_ERROR_CODES.includes(error.code));
33146
+ if (!supportData) {
33147
+ return {
33148
+ status: TaskStatus.DETAILS_REQUIRED,
33149
+ reason: "rootLegalEntityIsEmpty"
33150
+ };
33151
+ }
33152
+ if (hasMissingDataErrors) {
33153
+ return {
33154
+ status: TaskStatus.DETAILS_REQUIRED,
33155
+ reason: "dataMissingError",
33156
+ details: {
33157
+ missingData: (_f = (_e = capabilityProblems.LegalEntity) == null ? void 0 : _e[rootLegalEntity.id].missingData) == null ? void 0 : _f.filter(
33158
+ (error) => CUSTOMER_SUPPORT_DATA_MISSING_ERROR_CODES.includes(error.code)
33159
+ )
33160
+ }
33161
+ };
33162
+ }
33163
+ const pendingCapabilities = getPendingCapabilities(rootLegalEntity);
33164
+ if (pendingCapabilities.length > 0) {
33165
+ return {
33166
+ status: TaskStatus.PROCESSING,
33167
+ reason: "pendingCapabilities",
33168
+ details: { pendingCapabilities }
33169
+ };
33170
+ }
33171
+ if (hasAllCapabilitiesValid(rootLegalEntity)) {
33172
+ return {
33173
+ status: TaskStatus.FINISHED,
33174
+ reason: "allCapabilitiesValid"
33175
+ };
33176
+ }
33177
+ return {
33178
+ status: TaskStatus.FINISHED,
33179
+ reason: "noIssuesFound"
33180
+ };
33181
+ };
33101
33182
  const getRegularTaskStatus = ({
33102
33183
  taskType,
33103
33184
  capabilityProblems,
@@ -33115,7 +33196,8 @@ const getRegularTaskStatus = ({
33115
33196
  const importantProblems = findImportantProblems(
33116
33197
  entityType,
33117
33198
  capabilityProblems,
33118
- relevantEntityIds
33199
+ relevantEntityIds,
33200
+ taskType
33119
33201
  );
33120
33202
  if (importantProblems.length > 0) {
33121
33203
  return importantProblems[0].statusWithReason;
@@ -33142,10 +33224,21 @@ const IMPORTANT_STATUSES = [
33142
33224
  TaskStatus.ERROR,
33143
33225
  TaskStatus.PROCESSING
33144
33226
  ];
33145
- function findImportantProblems(type, capabilityProblems, entityIds) {
33227
+ function findImportantProblems(type, capabilityProblems, entityIds, taskType) {
33146
33228
  if (!(capabilityProblems == null ? void 0 : capabilityProblems[type]) || !entityIds.length) return [];
33147
- const importantStatuses = Object.entries(capabilityProblems[type] ?? {}).filter(([key]) => entityIds.includes(key)).map(([, value]) => value).filter(
33148
- (problems) => problems.statusWithReason !== void 0 && IMPORTANT_STATUSES.includes(problems.statusWithReason.status)
33229
+ const problems = cloneObject(capabilityProblems);
33230
+ if (taskType !== TaskTypes.CUSTOMER_SUPPORT) {
33231
+ entityIds.forEach((id) => {
33232
+ var _a, _b, _c, _d, _e;
33233
+ if ((_b = (_a = problems.LegalEntity) == null ? void 0 : _a[id]) == null ? void 0 : _b.missingData) {
33234
+ problems.LegalEntity[id].missingData = (_e = (_d = (_c = problems.LegalEntity) == null ? void 0 : _c[id]) == null ? void 0 : _d.missingData) == null ? void 0 : _e.filter(
33235
+ (missingDataErrors) => !CUSTOMER_SUPPORT_DATA_MISSING_ERROR_CODES.includes(missingDataErrors.code)
33236
+ );
33237
+ }
33238
+ });
33239
+ }
33240
+ const importantStatuses = Object.entries(problems[type] ?? {}).filter(([key]) => entityIds.includes(key)).map(([, value]) => value).filter(
33241
+ (problems2) => problems2.statusWithReason !== void 0 && IMPORTANT_STATUSES.includes(problems2.statusWithReason.status)
33149
33242
  );
33150
33243
  return importantStatuses.sort(
33151
33244
  (prev, curr) => curr.statusWithReason.status - prev.statusWithReason.status
@@ -33249,8 +33342,7 @@ const calculateTaskStatus = ({
33249
33342
  break;
33250
33343
  }
33251
33344
  case TaskTypes.CUSTOMER_SUPPORT:
33252
- relevantEntityIds = [rootLegalEntity.id];
33253
- break;
33345
+ return calculateCustomerSupportTask(capabilityProblems, rootLegalEntity);
33254
33346
  }
33255
33347
  return getRegularTaskStatus({
33256
33348
  taskType,
@@ -37266,10 +37358,6 @@ function RoleAndTypeDropin({
37266
37358
  ] });
37267
37359
  return /* @__PURE__ */ jsx(DropinLayout, { content });
37268
37360
  }
37269
- const EmbeddedActionBar = ({ left, right }) => /* @__PURE__ */ jsxs("footer", { className: "adyen-kyc-embedded-action-bar", children: [
37270
- /* @__PURE__ */ jsx("section", { children: left }),
37271
- /* @__PURE__ */ jsx("section", { className: "adyen-kyc-embedded-action-bar-right", children: right })
37272
- ] });
37273
37361
  const serviceAgreementValidationRules = {
37274
37362
  signer: { modes: ["blur"], validate: (signer) => !!signer, errorMessage: "fieldIsRequired" },
37275
37363
  acceptServiceAgreement: {
@@ -37729,10 +37817,19 @@ function ServiceAgreementDropin({
37729
37817
  setHasFinished(true);
37730
37818
  }
37731
37819
  };
37732
- const footer = /* @__PURE__ */ jsx(
37733
- EmbeddedActionBar,
37820
+ const endScreen = hasFinished && /* @__PURE__ */ jsx(
37821
+ Splashscreen,
37734
37822
  {
37735
- left: /* @__PURE__ */ jsx(
37823
+ icon: "check",
37824
+ title: i18n.get("serviceAgreementSignedAndDated"),
37825
+ onClick: handleCloseClick
37826
+ }
37827
+ );
37828
+ return /* @__PURE__ */ jsx(MaybeModal, { inline: !asModal, onClose: handleCloseClick, children: /* @__PURE__ */ jsxs(ModalContent, { children: [
37829
+ !asEmbedded && sidebar,
37830
+ endScreen || content,
37831
+ asEmbedded && /* @__PURE__ */ jsxs(ModalFooter, { children: [
37832
+ /* @__PURE__ */ jsx(
37736
37833
  StepProgressIndicator,
37737
37834
  {
37738
37835
  activeStepIndex: currentStep ?? 0,
@@ -37741,46 +37838,25 @@ function ServiceAgreementDropin({
37741
37838
  thick: true
37742
37839
  }
37743
37840
  ),
37744
- right: /* @__PURE__ */ jsxs(Fragment, { children: [
37745
- !asModal && /* @__PURE__ */ jsx(
37746
- Button,
37747
- {
37748
- label: i18n.get("back"),
37749
- onClick: () => gotoForm(activeFormIndex - 1),
37750
- secondary: true
37751
- }
37752
- ),
37753
- /* @__PURE__ */ jsx(
37754
- Button,
37755
- {
37756
- secondary: !canSign,
37757
- label: i18n.get(canSign ? "signAndContinue" : "next"),
37758
- onClick: handleClick
37759
- }
37760
- )
37761
- ] })
37762
- }
37763
- );
37764
- const endScreen = hasFinished && /* @__PURE__ */ jsx(
37765
- Splashscreen,
37766
- {
37767
- icon: "check",
37768
- title: i18n.get("serviceAgreementSignedAndDated"),
37769
- onClick: handleCloseClick
37770
- }
37771
- );
37772
- return /* @__PURE__ */ jsx(
37773
- DropinLayout,
37774
- {
37775
- showAsModal: asModal,
37776
- onClose: handleCloseClick,
37777
- content: /* @__PURE__ */ jsxs(Fragment, { children: [
37778
- !asEmbedded && sidebar,
37779
- endScreen || content
37780
- ] }),
37781
- footer: asEmbedded ? footer : void 0
37782
- }
37783
- );
37841
+ /* @__PURE__ */ jsx("div", { style: { flex: "1" } }),
37842
+ !asModal && /* @__PURE__ */ jsx(
37843
+ Button,
37844
+ {
37845
+ label: i18n.get("back"),
37846
+ onClick: () => gotoForm(activeFormIndex - 1),
37847
+ secondary: true
37848
+ }
37849
+ ),
37850
+ /* @__PURE__ */ jsx(
37851
+ Button,
37852
+ {
37853
+ secondary: !canSign,
37854
+ label: i18n.get(canSign ? "signAndContinue" : "next"),
37855
+ onClick: handleClick
37856
+ }
37857
+ )
37858
+ ] })
37859
+ ] }) });
37784
37860
  }
37785
37861
  const parseConfiguration$2 = ({ matchingScenario, country }) => parseSolePropScenarios(matchingScenario[LegalEntityType.SOLE_PROPRIETORSHIP], country);
37786
37862
  const isDocumentsRequired = (forms) => forms.some(
@@ -38569,30 +38645,294 @@ const hasProgressedBeyondEntitySelection = (legalEntity) => {
38569
38645
  const hasOrganizationType = (_b = legalEntity.organization) == null ? void 0 : _b.type;
38570
38646
  return hasOwnEntityAssocation || !!hasOrganizationType;
38571
38647
  };
38572
- const sourceOfFundsTypeValidations = {
38573
- type: {
38648
+ const validateLegalEntityIdentifier = (legalEntityIdentifier) => {
38649
+ if (!legalEntityIdentifier) {
38650
+ return true;
38651
+ }
38652
+ const isValidLength = legalEntityIdentifier ? legalEntityIdentifier.length === 20 : false;
38653
+ const hasLettersAndNumbers = legalEntityIdentifier ? /[a-zA-Z]/.test(legalEntityIdentifier) && /[0-9]/.test(legalEntityIdentifier) : false;
38654
+ return isValidLength && hasLettersAndNumbers;
38655
+ };
38656
+ const validateDateNotInTheFuture = (selectedDate) => {
38657
+ if (!selectedDate) return true;
38658
+ return new Date(selectedDate) <= /* @__PURE__ */ new Date();
38659
+ };
38660
+ const highExposureCompanyDetailsValidations = {
38661
+ legalForm: {
38574
38662
  modes: ["blur"],
38575
- validate: (type) => !isEmpty$1(type),
38663
+ validate: (legalName) => !isEmpty$1(legalName),
38576
38664
  errorMessage: "fieldIsRequired"
38577
- }
38665
+ },
38666
+ numberOfEmployees: [
38667
+ {
38668
+ modes: ["blur"],
38669
+ validate: (numberOfEmployees) => !isEmpty$1(numberOfEmployees),
38670
+ errorMessage: "fieldIsRequired"
38671
+ },
38672
+ {
38673
+ modes: ["blur"],
38674
+ validate: (numberOfEmployees) => Number.isInteger(Number(numberOfEmployees)),
38675
+ errorMessage: "pleaseEnterAValidWholeNumber"
38676
+ }
38677
+ ],
38678
+ legalInformationInsolvency: {
38679
+ modes: ["blur"],
38680
+ validate: (legalInformationInsolvency) => !isEmpty$1(legalInformationInsolvency),
38681
+ errorMessage: "fieldIsRequired"
38682
+ },
38683
+ netAssets: [
38684
+ {
38685
+ modes: ["blur"],
38686
+ validate: (value) => !isEmpty$1(value),
38687
+ errorMessage: "fieldIsRequired"
38688
+ },
38689
+ {
38690
+ modes: ["blur"],
38691
+ validate: (value) => !Number.isNaN(Number(value)),
38692
+ errorMessage: "pleaseEnterAValidNumber"
38693
+ }
38694
+ ],
38695
+ currency: {
38696
+ modes: ["input"],
38697
+ validate: (value) => !isEmpty$1(value),
38698
+ errorMessage: "fieldIsRequired"
38699
+ },
38700
+ annualTurnover: [
38701
+ {
38702
+ modes: ["blur"],
38703
+ validate: (value) => !isEmpty$1(value),
38704
+ errorMessage: "fieldIsRequired"
38705
+ },
38706
+ {
38707
+ modes: ["blur"],
38708
+ validate: (value) => !Number.isNaN(Number(value)),
38709
+ errorMessage: "pleaseEnterAValidNumber"
38710
+ }
38711
+ ],
38712
+ financialReportingDate: [
38713
+ {
38714
+ modes: ["blur"],
38715
+ validate: (value) => !isEmpty$1(value),
38716
+ errorMessage: "fieldIsRequired"
38717
+ },
38718
+ {
38719
+ modes: ["blur"],
38720
+ validate: (value) => validateDateNotInTheFuture(value),
38721
+ errorMessage: "dateCannotBeInTheFuture"
38722
+ }
38723
+ ],
38724
+ naceCode: {
38725
+ modes: ["blur"],
38726
+ validate: (naceCode) => !isEmpty$1(naceCode),
38727
+ errorMessage: "fieldIsRequired"
38728
+ },
38729
+ doesYourCompanyHaveLEI: {
38730
+ modes: ["blur"],
38731
+ validate: (doesYourCompanyHaveLEI) => !isEmpty$1(doesYourCompanyHaveLEI),
38732
+ errorMessage: "fieldIsRequired"
38733
+ },
38734
+ legalEntityIdentifier: [
38735
+ {
38736
+ modes: ["blur"],
38737
+ validate: (legalEntityIdentifier) => !isEmpty$1(legalEntityIdentifier),
38738
+ errorMessage: "fieldIsRequired"
38739
+ },
38740
+ {
38741
+ modes: ["blur"],
38742
+ validate: (legalEntityIdentifier) => validateLegalEntityIdentifier(legalEntityIdentifier),
38743
+ errorMessage: "invalidFormat"
38744
+ }
38745
+ ],
38746
+ isCompanyOwnedByAnotherCompany: {
38747
+ modes: ["blur"],
38748
+ validate: (isCompanyOwnedByAnotherCompany) => !isEmpty$1(isCompanyOwnedByAnotherCompany),
38749
+ errorMessage: "fieldIsRequired"
38750
+ },
38751
+ isParentOwnedByAnotherCompany: {
38752
+ modes: ["blur"],
38753
+ validate: (isParentOwnedByAnotherCompany) => !isEmpty$1(isParentOwnedByAnotherCompany),
38754
+ errorMessage: "fieldIsRequired"
38755
+ },
38756
+ legalProceedingsDate: [
38757
+ {
38758
+ modes: ["blur"],
38759
+ validate: (legalProceedingsDate) => !isEmpty$1(legalProceedingsDate),
38760
+ errorMessage: "fieldIsRequired"
38761
+ },
38762
+ {
38763
+ modes: ["blur"],
38764
+ validate: (value) => validateDateNotInTheFuture(value),
38765
+ errorMessage: "dateCannotBeInTheFuture"
38766
+ }
38767
+ ]
38578
38768
  };
38579
- const sourceOfFundsTellUsMoreValidations = {
38769
+ const highExposureParentCompaniesDetailsValidations = {
38770
+ legalForm: {
38771
+ modes: ["blur"],
38772
+ validate: (legalName) => !isEmpty$1(legalName),
38773
+ errorMessage: "fieldIsRequired"
38774
+ },
38775
+ legalName: {
38776
+ modes: ["blur"],
38777
+ validate: (legalName) => !isEmpty$1(legalName),
38778
+ errorMessage: "fieldIsRequired"
38779
+ },
38780
+ numberOfEmployees: [
38781
+ {
38782
+ modes: ["blur"],
38783
+ validate: (numberOfEmployees) => !isEmpty$1(numberOfEmployees),
38784
+ errorMessage: "fieldIsRequired"
38785
+ },
38786
+ {
38787
+ modes: ["blur"],
38788
+ validate: (numberOfEmployees) => Number.isInteger(Number(numberOfEmployees)),
38789
+ errorMessage: "pleaseEnterAValidWholeNumber"
38790
+ }
38791
+ ],
38792
+ naceCode: {
38793
+ modes: ["blur"],
38794
+ validate: (naceCode) => !isEmpty$1(naceCode),
38795
+ errorMessage: "fieldIsRequired"
38796
+ },
38797
+ doesYourCompanyHaveLEI: {
38798
+ modes: ["blur"],
38799
+ validate: (doesYourCompanyHaveLEI) => !isEmpty$1(doesYourCompanyHaveLEI),
38800
+ errorMessage: "fieldIsRequired"
38801
+ },
38802
+ legalEntityIdentifier: [
38803
+ {
38804
+ modes: ["blur"],
38805
+ validate: (legalEntityIdentifier) => !isEmpty$1(legalEntityIdentifier),
38806
+ errorMessage: "fieldIsRequired"
38807
+ },
38808
+ {
38809
+ modes: ["blur"],
38810
+ validate: (legalEntityIdentifier) => validateLegalEntityIdentifier(legalEntityIdentifier),
38811
+ errorMessage: "invalidFormat"
38812
+ }
38813
+ ],
38814
+ isThisAddressTheMainHeadquarters: {
38815
+ modes: ["blur"],
38816
+ validate: (isThisAddressTheMainHeadquarters) => !isEmpty$1(isThisAddressTheMainHeadquarters),
38817
+ errorMessage: "fieldIsRequired"
38818
+ },
38819
+ legalInformationInsolvency: {
38820
+ modes: ["blur"],
38821
+ validate: (value) => !isEmpty$1(value),
38822
+ errorMessage: "fieldIsRequired"
38823
+ },
38824
+ netAssets: [
38825
+ {
38826
+ modes: ["blur"],
38827
+ validate: (value) => !isEmpty$1(value),
38828
+ errorMessage: "fieldIsRequired"
38829
+ },
38830
+ {
38831
+ modes: ["blur"],
38832
+ validate: (value) => !Number.isNaN(Number(value)),
38833
+ errorMessage: "pleaseEnterAValidNumber"
38834
+ }
38835
+ ],
38836
+ currency: {
38837
+ modes: ["input"],
38838
+ validate: (value) => !isEmpty$1(value),
38839
+ errorMessage: "fieldIsRequired"
38840
+ },
38580
38841
  annualTurnover: [
38581
38842
  {
38582
38843
  modes: ["blur"],
38583
- validate: (annualTurnover) => !isEmpty$1(annualTurnover),
38844
+ validate: (value) => !isEmpty$1(value),
38584
38845
  errorMessage: "fieldIsRequired"
38585
38846
  },
38586
38847
  {
38587
38848
  modes: ["blur"],
38588
- validate: (annualTurnover) => !Number.isNaN(Number(annualTurnover)),
38849
+ validate: (value) => !Number.isNaN(Number(value)),
38589
38850
  errorMessage: "pleaseEnterAValidNumber"
38590
38851
  }
38591
38852
  ],
38853
+ financialReportingDate: [
38854
+ {
38855
+ modes: ["blur"],
38856
+ validate: (value) => !isEmpty$1(value),
38857
+ errorMessage: "fieldIsRequired"
38858
+ },
38859
+ {
38860
+ modes: ["blur"],
38861
+ validate: (value) => validateDateNotInTheFuture(value),
38862
+ errorMessage: "dateCannotBeInTheFuture"
38863
+ }
38864
+ ],
38865
+ legalProceedingsDate: [
38866
+ {
38867
+ modes: ["blur"],
38868
+ validate: (legalProceedingsDate) => !isEmpty$1(legalProceedingsDate),
38869
+ errorMessage: "fieldIsRequired"
38870
+ },
38871
+ {
38872
+ modes: ["blur"],
38873
+ validate: (legalProceedingsDate) => validateDateNotInTheFuture(legalProceedingsDate),
38874
+ errorMessage: "dateCannotBeInTheFuture"
38875
+ }
38876
+ ]
38877
+ };
38878
+ const sourceOfFundsTypeValidations = {
38879
+ type: {
38880
+ modes: ["blur"],
38881
+ validate: (type) => !isEmpty$1(type),
38882
+ errorMessage: "fieldIsRequired"
38883
+ }
38884
+ };
38885
+ const sourceOfFundsAdditionalDataValidations = {
38592
38886
  description: {
38593
38887
  modes: ["blur"],
38594
38888
  validate: (description2) => !isEmpty$1(description2),
38595
38889
  errorMessage: "fieldIsRequired"
38890
+ },
38891
+ website: [
38892
+ {
38893
+ modes: ["blur"],
38894
+ validate: (website) => !isEmpty$1(website),
38895
+ errorMessage: "fieldIsRequired"
38896
+ },
38897
+ {
38898
+ modes: ["blur"],
38899
+ validate: (website) => website ? isURL(website) : false,
38900
+ errorMessage: "validationPleaseEnterAValidUrl"
38901
+ }
38902
+ ],
38903
+ amount: [
38904
+ {
38905
+ modes: ["blur"],
38906
+ validate: (amount) => !isEmpty$1(amount == null ? void 0 : amount.currency),
38907
+ errorMessage: "currencyIsRequired"
38908
+ },
38909
+ {
38910
+ modes: ["blur"],
38911
+ validate: (amount) => !isEmpty$1(amount == null ? void 0 : amount.value),
38912
+ errorMessage: "amountIsRequired"
38913
+ },
38914
+ {
38915
+ modes: ["blur"],
38916
+ validate: (amount) => !Number.isNaN(Number(amount == null ? void 0 : amount.value)),
38917
+ errorMessage: "pleaseEnterAValidAmount"
38918
+ }
38919
+ ],
38920
+ dateOfSourceEvent: [
38921
+ {
38922
+ modes: ["blur"],
38923
+ validate: (dateOfSourceEvent) => !isEmpty$1(dateOfSourceEvent),
38924
+ errorMessage: "fieldIsRequired"
38925
+ },
38926
+ {
38927
+ modes: ["blur"],
38928
+ validate: (dateOfSourceEvent) => validateDateNotInTheFuture(dateOfSourceEvent),
38929
+ errorMessage: "dateCannotBeInTheFuture"
38930
+ }
38931
+ ],
38932
+ cryptocurrencyExchange: {
38933
+ modes: ["blur"],
38934
+ validate: (cryptocurrencyExchange) => !isEmpty$1(cryptocurrencyExchange),
38935
+ errorMessage: "fieldIsRequired"
38596
38936
  }
38597
38937
  };
38598
38938
  const sourceOfFundsTypeFields = ["type"];
@@ -38668,142 +39008,1081 @@ function SourceOfFundsType(props) {
38668
39008
  )
38669
39009
  ] });
38670
39010
  }
38671
- const sourceOfFundsTellUsMoreFields = [
38672
- "annualTurnover",
39011
+ const additionalDataSchemaKeys = [
38673
39012
  "description",
38674
- "annualTurnoverCurrency"
39013
+ "dateOfFundsReceived",
39014
+ "purpose",
39015
+ "relationship",
39016
+ "originatorSourceOfFundsType",
39017
+ "originatorLegalEntityId",
39018
+ "amount",
39019
+ "financiers",
39020
+ "cryptocurrencyExchange",
39021
+ "dateOfSourceEvent",
39022
+ "website"
38675
39023
  ];
38676
- const allowedCurrencies = [
38677
- {
38678
- name: "EUR",
38679
- id: "EUR"
38680
- },
38681
- {
38682
- name: "USD",
38683
- id: "USD"
39024
+ const allowedCurrencies = Object.entries(Currencies).map(([key]) => ({
39025
+ name: key,
39026
+ id: key
39027
+ }));
39028
+ const SOF_CHARACTERS_LIMIT = 200;
39029
+ const TODAY_DATE$2 = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
39030
+ const getAdditionalDataSchemaKeys = (sourceOfFundsType) => {
39031
+ switch (sourceOfFundsType) {
39032
+ case "business":
39033
+ return ["amount", "description"];
39034
+ case "donations":
39035
+ return [
39036
+ "dateOfFundsReceived",
39037
+ "purpose",
39038
+ "relationship",
39039
+ "originatorSourceOfFundsType",
39040
+ "originatorLegalEntityId"
39041
+ ];
39042
+ case "inheritance":
39043
+ return [
39044
+ "dateOfFundsReceived",
39045
+ "amount",
39046
+ "relationship",
39047
+ "originatorSourceOfFundsType",
39048
+ "originatorLegalEntityId"
39049
+ ];
39050
+ case "thirdPartyFunding":
39051
+ return ["amount", "financiers"];
39052
+ case "cryptocurrencyIncome":
39053
+ return ["cryptocurrencyExchange"];
39054
+ case "assetSale":
39055
+ return ["dateOfSourceEvent", "description", "amount"];
39056
+ case "gamblingWinnings":
39057
+ return ["dateOfSourceEvent", "website", "amount"];
39058
+ default:
39059
+ return [];
39060
+ }
39061
+ };
39062
+ const sourceOfFundsForms = {
39063
+ sourceOfFundsType: {
39064
+ formId: "sourceOfFundsType",
39065
+ formName: "chooseAFundingCategory",
39066
+ fields: ["type"]
38684
39067
  },
38685
- {
38686
- name: "GBP",
38687
- id: "GBP"
39068
+ additionalData: {
39069
+ formId: "additionalData",
39070
+ formName: "tellUsMoreAboutThisSource",
39071
+ fields: [...additionalDataSchemaKeys]
38688
39072
  }
39073
+ };
39074
+ const sourceOfFundsRequiredFields = {
39075
+ sourceOfFundsType: sourceOfFundsForms.sourceOfFundsType.fields,
39076
+ additionalData: sourceOfFundsForms.additionalData.fields
39077
+ };
39078
+ const typesRequiringAdditionalData = [
39079
+ "business",
39080
+ "donations",
39081
+ "inheritance",
39082
+ "thirdPartyFunding",
39083
+ "cryptocurrencyIncome",
39084
+ "assetSale",
39085
+ "gamblingWinnings"
38689
39086
  ];
38690
- function SourceOfFundsTellUsMore(props) {
39087
+ const getSourceOfFundsRequiredForms = (data) => {
39088
+ return Object.fromEntries(
39089
+ Object.entries(sourceOfFundsForms).filter(([form]) => {
39090
+ if (!(data == null ? void 0 : data.type) || !typesRequiringAdditionalData.includes(data == null ? void 0 : data.type))
39091
+ return form !== sourceOfFundsForms.additionalData.formId;
39092
+ return form;
39093
+ })
39094
+ );
39095
+ };
39096
+ const getInputErrors = ({
39097
+ formErrors,
39098
+ data,
39099
+ key,
39100
+ value,
39101
+ i18n
39102
+ }) => {
39103
+ var _a, _b, _c, _d;
39104
+ const isEmpty2 = value === "" || value === null || value === void 0;
39105
+ let errors = { ...formErrors };
39106
+ if (isEmpty2) {
39107
+ errors = { ...formErrors, [key]: i18n.get("fieldIsRequired") };
39108
+ } else {
39109
+ errors = { ...formErrors, [key]: void 0 };
39110
+ }
39111
+ if (["amount", "currency"].includes(key)) {
39112
+ if (((_a = data == null ? void 0 : data.amount) == null ? void 0 : _a.value) && ((_b = data == null ? void 0 : data.amount) == null ? void 0 : _b.currency)) {
39113
+ errors = { ...formErrors, amount: void 0 };
39114
+ }
39115
+ if (!((_c = data == null ? void 0 : data.amount) == null ? void 0 : _c.currency)) {
39116
+ errors = { ...formErrors, amount: i18n.get("currencyIsRequired") };
39117
+ }
39118
+ if (!((_d = data == null ? void 0 : data.amount) == null ? void 0 : _d.value)) {
39119
+ errors = { ...formErrors, amount: i18n.get("amountIsRequired") };
39120
+ } else if (isNaN(data == null ? void 0 : data.amount.value)) {
39121
+ errors = { ...formErrors, amount: i18n.get("pleaseEnterAValidAmount") };
39122
+ }
39123
+ }
39124
+ return errors;
39125
+ };
39126
+ const sourceOfFunds = "adyen-kyc-source-of-funds";
39127
+ const sourceOfFundsGettingStarted = "adyen-kyc-source-of-funds-getting-started";
39128
+ const sourceOfFundsGettingStartedIcon = "adyen-kyc-source-of-funds-getting-started-icon";
39129
+ const sourceOfFundsGettingStartedHeading = "adyen-kyc-source-of-funds-getting-started-heading";
39130
+ const sourceOfFundsGettingStartedBody = "adyen-kyc-source-of-funds-getting-started-body";
39131
+ const sourceOfFundsGettingStartedHelpHeader = "adyen-kyc-source-of-funds-getting-started-help-header";
39132
+ const sourceOfFundsGettingStartedHelpBody = "adyen-kyc-source-of-funds-getting-started-help-body";
39133
+ const sourceOfFundsGettingStartedCards = "adyen-kyc-source-of-funds-getting-started-cards";
39134
+ const sourceOfFundsGettingStartedCardsCard = "adyen-kyc-source-of-funds-getting-started-cards-card";
39135
+ const sourceOfFundsGettingStartedCardsCardHeader = "adyen-kyc-source-of-funds-getting-started-cards-card-header";
39136
+ const sourceOfFundsGettingStartedCardsCardBody = "adyen-kyc-source-of-funds-getting-started-cards-card-body";
39137
+ const sourceOfFundsGettingStartedCardsCardDescription = "adyen-kyc-source-of-funds-getting-started-cards-card-description";
39138
+ const sourceOfFundsGettingStartedActions = "adyen-kyc-source-of-funds-getting-started-actions";
39139
+ const sourceOfFundsGettingStartedHelpButton = "adyen-kyc-source-of-funds-getting-started-help-button";
39140
+ const sourceOfFundsGettingStartedPrimaryButton = "adyen-kyc-source-of-funds-getting-started-primary-button";
39141
+ const sourceOfFundsAdditionalDataForm = "adyen-kyc-source-of-funds-additional-data-form";
39142
+ const sourceOfFundsAdditonalDataMutedPlaceholder = "adyen-kyc-source-of-funds-additonal-data-muted-placeholder";
39143
+ const sourceOfFundsAdditonalDataSofHeadings = "adyen-kyc-source-of-funds-additonal-data-sof-headings";
39144
+ const sourceOfFundsAdditonalDataSofHeadingsDescription = "adyen-kyc-source-of-funds-additonal-data-sof-headings-description";
39145
+ const sourceOfFundsAdditonalDataSofAssetsContainer = "adyen-kyc-source-of-funds-additonal-data-sof-assets-container";
39146
+ const sourceOfFundsThirdPartyFundingFinancierGroup = "adyen-kyc-source-of-funds-third-party-funding-financier-group";
39147
+ const sourceOfFundsThirdPartyFundingNameAvatarGroup = "adyen-kyc-source-of-funds-third-party-funding-name-avatar-group";
39148
+ const sourceOfFundsThirdPartyFundingAvatar = "adyen-kyc-source-of-funds-third-party-funding-avatar";
39149
+ const sourceOfFundsThirdPartyFundingNameAddressGroup = "adyen-kyc-source-of-funds-third-party-funding-name-address-group";
39150
+ const sourceOfFundsSofFinancierFormNameGroup = "adyen-kyc-source-of-funds-sof-financier-form-name-group";
39151
+ const sourceOfFundsSofFinancierFooter = "adyen-kyc-source-of-funds-sof-financier-footer";
39152
+ const styles$4 = {
39153
+ "source-of-funds": "adyen-kyc-source-of-funds",
39154
+ sourceOfFunds,
39155
+ "source-of-funds-getting-started": "adyen-kyc-source-of-funds-getting-started",
39156
+ sourceOfFundsGettingStarted,
39157
+ "source-of-funds-getting-started-icon": "adyen-kyc-source-of-funds-getting-started-icon",
39158
+ sourceOfFundsGettingStartedIcon,
39159
+ "source-of-funds-getting-started-heading": "adyen-kyc-source-of-funds-getting-started-heading",
39160
+ sourceOfFundsGettingStartedHeading,
39161
+ "source-of-funds-getting-started-body": "adyen-kyc-source-of-funds-getting-started-body",
39162
+ sourceOfFundsGettingStartedBody,
39163
+ "source-of-funds-getting-started-help-header": "adyen-kyc-source-of-funds-getting-started-help-header",
39164
+ sourceOfFundsGettingStartedHelpHeader,
39165
+ "source-of-funds-getting-started-help-body": "adyen-kyc-source-of-funds-getting-started-help-body",
39166
+ sourceOfFundsGettingStartedHelpBody,
39167
+ "source-of-funds-getting-started-cards": "adyen-kyc-source-of-funds-getting-started-cards",
39168
+ sourceOfFundsGettingStartedCards,
39169
+ "source-of-funds-getting-started-cards-card": "adyen-kyc-source-of-funds-getting-started-cards-card",
39170
+ sourceOfFundsGettingStartedCardsCard,
39171
+ "source-of-funds-getting-started-cards-card-header": "adyen-kyc-source-of-funds-getting-started-cards-card-header",
39172
+ sourceOfFundsGettingStartedCardsCardHeader,
39173
+ "source-of-funds-getting-started-cards-card-body": "adyen-kyc-source-of-funds-getting-started-cards-card-body",
39174
+ sourceOfFundsGettingStartedCardsCardBody,
39175
+ "source-of-funds-getting-started-cards-card-description": "adyen-kyc-source-of-funds-getting-started-cards-card-description",
39176
+ sourceOfFundsGettingStartedCardsCardDescription,
39177
+ "source-of-funds-getting-started-actions": "adyen-kyc-source-of-funds-getting-started-actions",
39178
+ sourceOfFundsGettingStartedActions,
39179
+ "source-of-funds-getting-started-help-button": "adyen-kyc-source-of-funds-getting-started-help-button",
39180
+ sourceOfFundsGettingStartedHelpButton,
39181
+ "source-of-funds-getting-started-primary-button": "adyen-kyc-source-of-funds-getting-started-primary-button",
39182
+ sourceOfFundsGettingStartedPrimaryButton,
39183
+ "source-of-funds-additional-data-form": "adyen-kyc-source-of-funds-additional-data-form",
39184
+ sourceOfFundsAdditionalDataForm,
39185
+ "source-of-funds-additonal-data-muted-placeholder": "adyen-kyc-source-of-funds-additonal-data-muted-placeholder",
39186
+ sourceOfFundsAdditonalDataMutedPlaceholder,
39187
+ "source-of-funds-additonal-data-sof-headings": "adyen-kyc-source-of-funds-additonal-data-sof-headings",
39188
+ sourceOfFundsAdditonalDataSofHeadings,
39189
+ "source-of-funds-additonal-data-sof-headings-description": "adyen-kyc-source-of-funds-additonal-data-sof-headings-description",
39190
+ sourceOfFundsAdditonalDataSofHeadingsDescription,
39191
+ "source-of-funds-additonal-data-sof-assets-container": "adyen-kyc-source-of-funds-additonal-data-sof-assets-container",
39192
+ sourceOfFundsAdditonalDataSofAssetsContainer,
39193
+ "source-of-funds-third-party-funding-financier-group": "adyen-kyc-source-of-funds-third-party-funding-financier-group",
39194
+ sourceOfFundsThirdPartyFundingFinancierGroup,
39195
+ "source-of-funds-third-party-funding-name-avatar-group": "adyen-kyc-source-of-funds-third-party-funding-name-avatar-group",
39196
+ sourceOfFundsThirdPartyFundingNameAvatarGroup,
39197
+ "source-of-funds-third-party-funding-avatar": "adyen-kyc-source-of-funds-third-party-funding-avatar",
39198
+ sourceOfFundsThirdPartyFundingAvatar,
39199
+ "source-of-funds-third-party-funding-name-address-group": "adyen-kyc-source-of-funds-third-party-funding-name-address-group",
39200
+ sourceOfFundsThirdPartyFundingNameAddressGroup,
39201
+ "source-of-funds-sof-financier-form-name-group": "adyen-kyc-source-of-funds-sof-financier-form-name-group",
39202
+ sourceOfFundsSofFinancierFormNameGroup,
39203
+ "source-of-funds-sof-financier-footer": "adyen-kyc-source-of-funds-sof-financier-footer",
39204
+ sourceOfFundsSofFinancierFooter
39205
+ };
39206
+ const InputGroupAddon = ({ className, children }) => {
39207
+ const classNames = cx("adyen-kyc-input-group-addon", className);
39208
+ return /* @__PURE__ */ jsx("div", { className: classNames, children });
39209
+ };
39210
+ function AdditionalDataForGambling(props) {
38691
39211
  const { i18n } = useI18nContext();
38692
- const {
38693
- data: defaultData,
38694
- validators: validators2,
38695
- formVerificationErrors,
38696
- fieldValidationErrors,
38697
- shouldValidate
38698
- } = props;
38699
- const {
38700
- handleChangeFor,
38701
- data: formData,
38702
- schema: formSchema,
38703
- valid: formValid,
38704
- errors: formErrors,
38705
- fieldProblems: formFieldProblems
38706
- } = useForm({
38707
- ...props,
38708
- schema: sourceOfFundsTellUsMoreFields,
38709
- defaultData,
38710
- rules: validators2 || sourceOfFundsTellUsMoreValidations,
38711
- fieldProblems: fieldValidationErrors,
38712
- shouldValidate
38713
- });
38714
- const formUtils = createFormUtils(props, i18n);
38715
- const { updateStateSlice } = useGlobalDataSlice("tellUsMore");
38716
- useEffect(() => {
38717
- updateStateSlice({
38718
- data: formData,
38719
- valid: formValid,
38720
- errors: formErrors,
38721
- fieldProblems: formFieldProblems,
38722
- schema: formSchema
38723
- });
38724
- }, [formData, formValid, formErrors, formSchema, formFieldProblems]);
38725
- return /* @__PURE__ */ jsxs("form", { className: "adyen-kyc__high-exposure-company", children: [
38726
- /* @__PURE__ */ jsx(Typography, { el: "h1", variant: "title-l", children: i18n.get("tellUsMoreAboutThisSource") }),
39212
+ const [focusedInput, setFocusedInput] = useState();
39213
+ const { formUtils, data, errors, valid, fieldProblems, handleChangeFor, handleAmountChange } = props;
39214
+ const handleOnAmountBlur = () => {
39215
+ setFocusedInput(void 0);
39216
+ handleAmountChange("amount");
39217
+ };
39218
+ const handleWebsiteBlur = () => {
39219
+ setFocusedInput(void 0);
39220
+ handleChangeFor("website", "blur");
39221
+ };
39222
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
38727
39223
  /* @__PURE__ */ jsx(
38728
- ErrorPanel,
39224
+ Field,
38729
39225
  {
38730
- verificationErrors: formVerificationErrors,
38731
- validationErrors: props == null ? void 0 : props.fieldValidationErrors,
38732
- formUtils,
38733
- id: "ariaErrorField"
39226
+ name: "amount",
39227
+ label: formUtils.getLabel("amount", "amountWon"),
39228
+ errorMessage: formUtils.getErrorMessage("amount", errors, fieldProblems),
39229
+ children: (childProps) => {
39230
+ var _a, _b;
39231
+ return /* @__PURE__ */ jsxs(
39232
+ InputGroup,
39233
+ {
39234
+ ...childProps,
39235
+ id: "currencyGroup",
39236
+ isFocused: focusedInput === "amount",
39237
+ isInvalid: Boolean(!valid.amount && errors.amount),
39238
+ children: [
39239
+ /* @__PURE__ */ jsx(
39240
+ Select,
39241
+ {
39242
+ name: "currency",
39243
+ isMulti: false,
39244
+ items: allowedCurrencies,
39245
+ selected: (_a = data.amount) == null ? void 0 : _a.currency,
39246
+ placeholder: i18n.get("select"),
39247
+ onChange: handleAmountChange("currency")
39248
+ }
39249
+ ),
39250
+ /* @__PURE__ */ jsx(
39251
+ InputText,
39252
+ {
39253
+ ...childProps,
39254
+ name: "amount",
39255
+ value: (_b = data.amount) == null ? void 0 : _b.value,
39256
+ readonly: formUtils.isReadOnly("amount"),
39257
+ onInput: handleAmountChange("amount"),
39258
+ onBlur: handleOnAmountBlur,
39259
+ "aria-required": true,
39260
+ "aria-label": formUtils.getLabel("amount", "amountWon"),
39261
+ "aria-invalid": !valid.amount,
39262
+ isValid: valid.amount,
39263
+ onFocusHandler: () => setFocusedInput("amount")
39264
+ }
39265
+ )
39266
+ ]
39267
+ }
39268
+ );
39269
+ }
38734
39270
  }
38735
39271
  ),
38736
39272
  /* @__PURE__ */ jsx(
38737
39273
  Field,
38738
39274
  {
38739
- name: "annualTurnover",
38740
- label: formUtils.getLabel("annualTurnover", "annualTurnover"),
38741
- errorMessage: formUtils.getErrorMessage("annualTurnover", formErrors, formFieldProblems),
39275
+ name: "dateOfSourceEvent",
39276
+ label: formUtils.getLabel("dateOfSourceEvent", "dateOfSourceEvent"),
39277
+ errorMessage: formUtils.getErrorMessage("dateOfSourceEvent", errors, fieldProblems),
39278
+ isValid: valid.dateOfSourceEvent,
39279
+ children: (childProps) => /* @__PURE__ */ jsx(
39280
+ InputDate,
39281
+ {
39282
+ ...childProps,
39283
+ name: "dateOfSourceEvent",
39284
+ value: data.dateOfSourceEvent,
39285
+ onInput: handleChangeFor("dateOfSourceEvent", "input"),
39286
+ onBlur: handleChangeFor("dateOfSourceEvent", "blur"),
39287
+ "aria-required": true,
39288
+ "aria-label": formUtils.getLabel("dateOfSourceEvent", "dateOfSourceEvent"),
39289
+ "aria-invalid": !valid.dateOfSourceEvent,
39290
+ max: TODAY_DATE$2
39291
+ }
39292
+ )
39293
+ }
39294
+ ),
39295
+ /* @__PURE__ */ jsx(
39296
+ Field,
39297
+ {
39298
+ name: "website",
39299
+ label: formUtils.getLabel("website", "gamblingWebsite"),
39300
+ errorMessage: formUtils.getErrorMessage("website", errors, fieldProblems),
38742
39301
  children: (childProps) => /* @__PURE__ */ jsxs(
38743
39302
  InputGroup,
38744
39303
  {
38745
39304
  ...childProps,
38746
- id: "currencyGroup",
38747
- isFocused: false,
38748
- isInvalid: Boolean(!formValid.annualTurnover && formErrors.annualTurnover),
39305
+ id: "websiteGroup",
39306
+ isFocused: focusedInput === "website",
39307
+ isInvalid: Boolean(!valid.website && errors.website),
38749
39308
  children: [
38750
- /* @__PURE__ */ jsx(
38751
- Select,
38752
- {
38753
- name: "currency",
38754
- isMulti: false,
38755
- items: allowedCurrencies,
38756
- selected: formData.annualTurnoverCurrency,
38757
- placeholder: i18n.get("select"),
38758
- onChange: handleChangeFor("annualTurnoverCurrency")
38759
- }
38760
- ),
39309
+ /* @__PURE__ */ jsx(InputGroupAddon, { className: styles$4.sourceOfFundsAdditonalDataMutedPlaceholder, children: "https://" }),
38761
39310
  /* @__PURE__ */ jsx(
38762
39311
  InputText,
38763
39312
  {
38764
39313
  ...childProps,
38765
- name: "annualTurnover",
38766
- value: formData.annualTurnover,
38767
- readonly: false,
38768
- onInput: handleChangeFor("annualTurnover", "input"),
38769
- onBlur: handleChangeFor("annualTurnover", "blur"),
39314
+ name: "website",
39315
+ value: data.website,
39316
+ readonly: formUtils.isReadOnly("website"),
39317
+ onInput: handleChangeFor("website", "input"),
39318
+ onBlur: handleWebsiteBlur,
38770
39319
  "aria-required": true,
38771
- "aria-label": formUtils.getLabel("annualTurnover"),
38772
- "aria-invalid": !formValid.annualTurnover,
38773
- isValid: formValid.annualTurnover
39320
+ "aria-label": formUtils.getLabel("website"),
39321
+ "aria-invalid": !valid.website,
39322
+ isValid: valid.website,
39323
+ onFocusHandler: () => setFocusedInput("website")
38774
39324
  }
38775
39325
  )
38776
39326
  ]
38777
39327
  }
38778
39328
  )
38779
39329
  }
39330
+ )
39331
+ ] });
39332
+ }
39333
+ function AdditionalDataForCryptocurrency(props) {
39334
+ const { formUtils, data, errors, valid, fieldProblems, handleChangeFor } = props;
39335
+ return /* @__PURE__ */ jsx(
39336
+ Field,
39337
+ {
39338
+ name: "cryptocurrencyExchange",
39339
+ label: formUtils.getLabel("cryptocurrencyExchange", "cryptocurrencyExchange"),
39340
+ errorMessage: formUtils.getErrorMessage("cryptocurrencyExchange", errors, fieldProblems),
39341
+ isValid: valid.cryptocurrencyExchange,
39342
+ children: (childProps) => /* @__PURE__ */ jsx(
39343
+ InputText,
39344
+ {
39345
+ ...childProps,
39346
+ name: "cryptocurrencyExchange",
39347
+ value: data.cryptocurrencyExchange,
39348
+ readonly: formUtils.isReadOnly("cryptocurrencyExchange"),
39349
+ onInput: handleChangeFor("cryptocurrencyExchange", "input"),
39350
+ onBlur: handleChangeFor("cryptocurrencyExchange", "blur"),
39351
+ "aria-required": true,
39352
+ "aria-label": formUtils.getLabel("cryptocurrencyExchange"),
39353
+ "aria-invalid": !valid.cryptocurrencyExchange,
39354
+ isValid: valid.cryptocurrencyExchange
39355
+ }
39356
+ )
39357
+ }
39358
+ );
39359
+ }
39360
+ function AdditionalDataForBusiness(props) {
39361
+ const { i18n } = useI18nContext();
39362
+ const [isFocused, setIsFocused] = useState(false);
39363
+ const { formUtils, data, errors, valid, fieldProblems, handleChangeFor, handleAmountChange } = props;
39364
+ const handleOnAmountBlur = () => {
39365
+ setIsFocused(false);
39366
+ handleAmountChange("amount");
39367
+ };
39368
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
39369
+ /* @__PURE__ */ jsx(
39370
+ Field,
39371
+ {
39372
+ name: "amount",
39373
+ label: formUtils.getLabel("amount", "annualTurnoverValue"),
39374
+ errorMessage: formUtils.getErrorMessage("amount", errors, fieldProblems),
39375
+ children: (childProps) => {
39376
+ var _a, _b;
39377
+ return /* @__PURE__ */ jsxs(
39378
+ InputGroup,
39379
+ {
39380
+ ...childProps,
39381
+ id: "currencyGroup",
39382
+ isFocused,
39383
+ isInvalid: Boolean(!valid.amount && errors.amount),
39384
+ children: [
39385
+ /* @__PURE__ */ jsx(
39386
+ Select,
39387
+ {
39388
+ name: "currency",
39389
+ isMulti: false,
39390
+ items: allowedCurrencies,
39391
+ selected: (_a = data.amount) == null ? void 0 : _a.currency,
39392
+ placeholder: i18n.get("select"),
39393
+ onChange: handleAmountChange("currency")
39394
+ }
39395
+ ),
39396
+ /* @__PURE__ */ jsx(
39397
+ InputText,
39398
+ {
39399
+ ...childProps,
39400
+ name: "amount",
39401
+ value: (_b = data.amount) == null ? void 0 : _b.value,
39402
+ readonly: formUtils.isReadOnly("amount"),
39403
+ onInput: handleAmountChange("amount"),
39404
+ onBlur: handleOnAmountBlur,
39405
+ "aria-required": true,
39406
+ "aria-label": formUtils.getLabel("amount", "annualTurnoverValue"),
39407
+ "aria-invalid": !valid.amount,
39408
+ isValid: valid.amount,
39409
+ onFocusHandler: () => setIsFocused(true)
39410
+ }
39411
+ )
39412
+ ]
39413
+ }
39414
+ );
39415
+ }
39416
+ }
38780
39417
  ),
38781
39418
  /* @__PURE__ */ jsx(
38782
39419
  Field,
38783
39420
  {
38784
39421
  name: "description",
38785
- label: formUtils.getLabel("description"),
38786
- errorMessage: formUtils.getErrorMessage("description", formErrors, formFieldProblems),
38787
- isValid: formValid.description,
39422
+ label: formUtils.getLabel("description", "businessDescription"),
39423
+ errorMessage: formUtils.getErrorMessage("description", errors, fieldProblems),
39424
+ isValid: valid.description,
38788
39425
  children: (childProps) => /* @__PURE__ */ jsx(
38789
39426
  TextArea,
38790
39427
  {
38791
39428
  ...childProps,
38792
39429
  name: "description",
38793
- value: formData.description,
38794
39430
  classNameModifiers: ["description"],
39431
+ value: data.description,
39432
+ maxLength: SOF_CHARACTERS_LIMIT,
38795
39433
  onInput: handleChangeFor("description"),
38796
- "aria-label": formUtils.getLabel("description"),
38797
- "aria-invalid": !formValid.description
39434
+ onBlur: handleChangeFor("description"),
39435
+ "aria-label": formUtils.getLabel("description", "businessDescription"),
39436
+ "aria-invalid": !valid.description
38798
39437
  }
38799
39438
  )
38800
39439
  }
38801
39440
  )
38802
39441
  ] });
38803
39442
  }
39443
+ function AdditionalDataForAssetSale(props) {
39444
+ const { i18n } = useI18nContext();
39445
+ const [isFocused, setIsFocused] = useState(false);
39446
+ const { formUtils, data, errors, valid, fieldProblems, handleChangeFor, handleAmountChange } = props;
39447
+ const handleOnAmountBlur = () => {
39448
+ setIsFocused(false);
39449
+ handleAmountChange("amount");
39450
+ };
39451
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
39452
+ /* @__PURE__ */ jsxs("div", { className: styles$4.sourceOfFundsAdditonalDataSofAssetsContainer, children: [
39453
+ /* @__PURE__ */ jsx(
39454
+ Field,
39455
+ {
39456
+ name: "amount",
39457
+ label: formUtils.getLabel("amount", "saleAmount"),
39458
+ errorMessage: formUtils.getErrorMessage("amount", errors, fieldProblems),
39459
+ children: (childProps) => {
39460
+ var _a, _b;
39461
+ return /* @__PURE__ */ jsxs(
39462
+ InputGroup,
39463
+ {
39464
+ ...childProps,
39465
+ id: "currencyGroup",
39466
+ isFocused,
39467
+ isInvalid: Boolean(!valid.amount && errors.amount),
39468
+ children: [
39469
+ /* @__PURE__ */ jsx(
39470
+ Select,
39471
+ {
39472
+ name: "currency",
39473
+ isMulti: false,
39474
+ items: allowedCurrencies,
39475
+ selected: (_a = data.amount) == null ? void 0 : _a.currency,
39476
+ placeholder: i18n.get("select"),
39477
+ onChange: handleAmountChange("currency")
39478
+ }
39479
+ ),
39480
+ /* @__PURE__ */ jsx(
39481
+ InputText,
39482
+ {
39483
+ ...childProps,
39484
+ name: "amount",
39485
+ value: (_b = data.amount) == null ? void 0 : _b.value,
39486
+ readonly: formUtils.isReadOnly("amount"),
39487
+ onInput: handleAmountChange("amount"),
39488
+ onBlur: handleOnAmountBlur,
39489
+ "aria-required": true,
39490
+ "aria-label": formUtils.getLabel("amount", "saleAmount"),
39491
+ "aria-invalid": !valid.amount,
39492
+ isValid: valid.amount,
39493
+ onFocusHandler: () => setIsFocused(true)
39494
+ }
39495
+ )
39496
+ ]
39497
+ }
39498
+ );
39499
+ }
39500
+ }
39501
+ ),
39502
+ /* @__PURE__ */ jsx(
39503
+ Field,
39504
+ {
39505
+ name: "dateOfSourceEvent",
39506
+ label: formUtils.getLabel("dateOfSourceEvent", "dateOfSale"),
39507
+ errorMessage: formUtils.getErrorMessage("dateOfSourceEvent", errors, fieldProblems),
39508
+ isValid: valid.dateOfSourceEvent,
39509
+ children: (childProps) => /* @__PURE__ */ jsx(
39510
+ InputDate,
39511
+ {
39512
+ ...childProps,
39513
+ name: "dateOfSourceEvent",
39514
+ value: data.dateOfSourceEvent,
39515
+ onInput: handleChangeFor("dateOfSourceEvent", "input"),
39516
+ onBlur: handleChangeFor("dateOfSourceEvent", "blur"),
39517
+ "aria-required": true,
39518
+ "aria-label": formUtils.getLabel("dateOfSourceEvent", "dateOfSale"),
39519
+ "aria-invalid": !valid.dateOfSourceEvent,
39520
+ max: TODAY_DATE$2
39521
+ }
39522
+ )
39523
+ }
39524
+ )
39525
+ ] }),
39526
+ /* @__PURE__ */ jsx(
39527
+ Field,
39528
+ {
39529
+ name: "description",
39530
+ label: formUtils.getLabel("description", "businessDescription"),
39531
+ errorMessage: formUtils.getErrorMessage("description", errors, fieldProblems),
39532
+ isValid: valid.description,
39533
+ children: (childProps) => /* @__PURE__ */ jsx(
39534
+ TextArea,
39535
+ {
39536
+ ...childProps,
39537
+ name: "description",
39538
+ classNameModifiers: ["description"],
39539
+ value: data.description,
39540
+ maxLength: SOF_CHARACTERS_LIMIT,
39541
+ onInput: handleChangeFor("description"),
39542
+ onBlur: handleChangeFor("description"),
39543
+ "aria-label": formUtils.getLabel("description", "businessDescription"),
39544
+ "aria-invalid": !valid.description
39545
+ }
39546
+ )
39547
+ }
39548
+ )
39549
+ ] });
39550
+ }
39551
+ const Confirm = ({ onConfirm, title, confirmBtnLabel, onClose }) => {
39552
+ const { i18n } = useI18nContext();
39553
+ const [isInFlight, setIsInFlight] = useState(false);
39554
+ const handleConfirm = async () => {
39555
+ setIsInFlight(true);
39556
+ try {
39557
+ await onConfirm();
39558
+ } finally {
39559
+ setIsInFlight(false);
39560
+ onClose();
39561
+ }
39562
+ };
39563
+ return /* @__PURE__ */ jsxs(Modal, { size: "small", onClose, children: [
39564
+ /* @__PURE__ */ jsx(ModalHeader, { children: /* @__PURE__ */ jsx(
39565
+ Typography,
39566
+ {
39567
+ variant: "title",
39568
+ el: "h3",
39569
+ className: "adyen-kyc-u-margin-top-8 adyen-kyc-u-margin-left-8",
39570
+ children: title
39571
+ }
39572
+ ) }),
39573
+ /* @__PURE__ */ jsxs(ModalFooter, { children: [
39574
+ /* @__PURE__ */ jsx("div", { style: { flex: "1" } }),
39575
+ /* @__PURE__ */ jsx(Button, { label: i18n.get("cancel"), onClick: onClose, secondary: true }),
39576
+ /* @__PURE__ */ jsx(
39577
+ Button,
39578
+ {
39579
+ label: confirmBtnLabel || i18n.get("confirm"),
39580
+ onClick: handleConfirm,
39581
+ critical: true,
39582
+ disabled: isInFlight
39583
+ }
39584
+ )
39585
+ ] })
39586
+ ] });
39587
+ };
39588
+ const SOFFinancierModal = (props) => {
39589
+ const { i18n } = useI18nContext();
39590
+ const { financier, handleModalClose, indexNumber, handleFinancierUpdate } = props;
39591
+ const [formData, setFormData] = useState(financier);
39592
+ const [formErrors, setFormErrors] = useState({});
39593
+ const [confirmOpen, setConfirmOpen] = useState(false);
39594
+ const [isFocused, setIsFocused] = useState(false);
39595
+ const [errorMessage, setErrorMessage] = useState("");
39596
+ const handleInputUpdate = (key, e) => {
39597
+ var _a, _b;
39598
+ const inputEl = e.target;
39599
+ setErrorMessage("");
39600
+ const value = inputEl == null ? void 0 : inputEl.value;
39601
+ let inputData = {
39602
+ [key]: value
39603
+ };
39604
+ if (["amount", "currency"].includes(key)) {
39605
+ const amountValue = {
39606
+ currency: key === "currency" ? value : (_a = formData == null ? void 0 : formData.amount) == null ? void 0 : _a.currency,
39607
+ value: key === "currency" ? (_b = formData == null ? void 0 : formData.amount) == null ? void 0 : _b.value : value
39608
+ };
39609
+ inputData = { amount: amountValue };
39610
+ }
39611
+ const data = {
39612
+ ...formData,
39613
+ ...inputData
39614
+ };
39615
+ setFormData(data);
39616
+ const errors = getInputErrors({ formErrors, data, key, value, i18n });
39617
+ setFormErrors(errors);
39618
+ };
39619
+ const handleOnAmountBlur = () => {
39620
+ var _a;
39621
+ setIsFocused(false);
39622
+ const errors = getInputErrors({
39623
+ formErrors,
39624
+ data: formData,
39625
+ key: "amount",
39626
+ value: (_a = formData == null ? void 0 : formData.amount) == null ? void 0 : _a.value,
39627
+ i18n
39628
+ });
39629
+ setFormErrors(errors);
39630
+ };
39631
+ const allFieldsFilled = (data) => {
39632
+ var _a, _b;
39633
+ return (data == null ? void 0 : data.firstName) && (data == null ? void 0 : data.lastName) && (data == null ? void 0 : data.location) && ((_a = data == null ? void 0 : data.amount) == null ? void 0 : _a.currency) && !Number.isNaN(Number((_b = data == null ? void 0 : data.amount) == null ? void 0 : _b.value));
39634
+ };
39635
+ const handleFinancierSave = () => {
39636
+ if (formData && allFieldsFilled(formData)) {
39637
+ handleFinancierUpdate({ formData, indexNumber });
39638
+ handleModalClose();
39639
+ } else {
39640
+ setErrorMessage(i18n.get("pleaseFillInAllFields"));
39641
+ }
39642
+ };
39643
+ const handleFinancierDelete = async () => {
39644
+ handleFinancierUpdate({ indexNumber });
39645
+ handleModalClose();
39646
+ };
39647
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
39648
+ /* @__PURE__ */ jsxs(Modal, { onClose: handleModalClose, children: [
39649
+ /* @__PURE__ */ jsx(ModalHeader, { children: /* @__PURE__ */ jsx(
39650
+ Typography,
39651
+ {
39652
+ variant: "title-l",
39653
+ el: "h3",
39654
+ className: styles$4.sourceOfFundsGettingStartedHelpHeader,
39655
+ children: i18n.get("investorInformation")
39656
+ }
39657
+ ) }),
39658
+ /* @__PURE__ */ jsx(ModalContent, { children: /* @__PURE__ */ jsxs("div", { className: styles$4.sourceOfFundsSofFinancierForm, children: [
39659
+ errorMessage && /* @__PURE__ */ jsx(Alert, { title: "Error submitting data", variant: "error", children: errorMessage }),
39660
+ /* @__PURE__ */ jsxs("div", { className: styles$4.sourceOfFundsSofFinancierFormNameGroup, children: [
39661
+ /* @__PURE__ */ jsx(
39662
+ Field,
39663
+ {
39664
+ name: "firstName",
39665
+ label: i18n.get("firstName"),
39666
+ errorMessage: formErrors.firstName,
39667
+ isValid: !formErrors.firstName,
39668
+ children: (childProps) => /* @__PURE__ */ jsx(
39669
+ InputText,
39670
+ {
39671
+ ...childProps,
39672
+ name: "firstName",
39673
+ value: formData == null ? void 0 : formData.firstName,
39674
+ onInput: (e) => handleInputUpdate("firstName", e),
39675
+ onBlur: (e) => handleInputUpdate("firstName", e),
39676
+ "aria-required": true,
39677
+ "aria-label": i18n.get("firstName"),
39678
+ "aria-invalid": Boolean(formErrors.firstName),
39679
+ isValid: !formErrors.firstName
39680
+ }
39681
+ )
39682
+ }
39683
+ ),
39684
+ /* @__PURE__ */ jsx(
39685
+ Field,
39686
+ {
39687
+ name: "lastName",
39688
+ label: i18n.get("lastName"),
39689
+ errorMessage: formErrors.lastName,
39690
+ isValid: !formErrors.lastName,
39691
+ children: (childProps) => /* @__PURE__ */ jsx(
39692
+ InputText,
39693
+ {
39694
+ ...childProps,
39695
+ name: "lastName",
39696
+ value: formData == null ? void 0 : formData.lastName,
39697
+ onInput: (e) => handleInputUpdate("lastName", e),
39698
+ onBlur: (e) => handleInputUpdate("lastName", e),
39699
+ "aria-required": true,
39700
+ "aria-label": i18n.get("lastName"),
39701
+ "aria-invalid": Boolean(formErrors.lastName),
39702
+ isValid: !formErrors.lastName
39703
+ }
39704
+ )
39705
+ }
39706
+ )
39707
+ ] }),
39708
+ /* @__PURE__ */ jsx(
39709
+ Field,
39710
+ {
39711
+ name: "location",
39712
+ label: i18n.get("investorLocation"),
39713
+ errorMessage: formErrors.location,
39714
+ isValid: !formErrors.location,
39715
+ children: (childProps) => /* @__PURE__ */ jsx(
39716
+ InputText,
39717
+ {
39718
+ ...childProps,
39719
+ name: "location",
39720
+ value: formData == null ? void 0 : formData.location,
39721
+ onInput: (e) => handleInputUpdate("location", e),
39722
+ onBlur: (e) => handleInputUpdate("location", e),
39723
+ "aria-required": true,
39724
+ "aria-label": i18n.get("investorLocation"),
39725
+ "aria-invalid": Boolean(formErrors.location),
39726
+ isValid: !formErrors.location
39727
+ }
39728
+ )
39729
+ }
39730
+ ),
39731
+ /* @__PURE__ */ jsx(
39732
+ Field,
39733
+ {
39734
+ name: "amount",
39735
+ label: i18n.get("investmentAmount"),
39736
+ errorMessage: formErrors.amount,
39737
+ isValid: !formErrors.amount,
39738
+ children: (childProps) => {
39739
+ var _a, _b;
39740
+ return /* @__PURE__ */ jsxs(InputGroup, { ...childProps, id: "currencyGroup", isFocused, children: [
39741
+ /* @__PURE__ */ jsx(
39742
+ Select,
39743
+ {
39744
+ name: "currency",
39745
+ isMulti: false,
39746
+ items: allowedCurrencies,
39747
+ selected: (_a = formData == null ? void 0 : formData.amount) == null ? void 0 : _a.currency,
39748
+ placeholder: i18n.get("select"),
39749
+ onChange: (e) => handleInputUpdate("currency", e)
39750
+ }
39751
+ ),
39752
+ /* @__PURE__ */ jsx(
39753
+ InputText,
39754
+ {
39755
+ ...childProps,
39756
+ name: "amount",
39757
+ value: (_b = formData == null ? void 0 : formData.amount) == null ? void 0 : _b.value,
39758
+ onInput: (e) => handleInputUpdate("amount", e),
39759
+ onBlur: handleOnAmountBlur,
39760
+ "aria-required": true,
39761
+ "aria-label": i18n.get("investmentAmount"),
39762
+ onFocusHandler: () => setIsFocused(true)
39763
+ }
39764
+ )
39765
+ ] });
39766
+ }
39767
+ }
39768
+ )
39769
+ ] }) }),
39770
+ /* @__PURE__ */ jsx(ModalFooter, { children: /* @__PURE__ */ jsxs("div", { className: styles$4.sourceOfFundsSofFinancierFooter, children: [
39771
+ Number.isFinite(indexNumber) && /* @__PURE__ */ jsx(
39772
+ Button,
39773
+ {
39774
+ ariaLabel: i18n.get("deleteInvestorDetails"),
39775
+ icon: "bin",
39776
+ secondary: true,
39777
+ large: true,
39778
+ onClick: () => setConfirmOpen(true)
39779
+ }
39780
+ ),
39781
+ /* @__PURE__ */ jsx(
39782
+ Button,
39783
+ {
39784
+ large: true,
39785
+ label: i18n.get("save"),
39786
+ className: "adyen-kyc-button",
39787
+ onClick: handleFinancierSave
39788
+ }
39789
+ )
39790
+ ] }) })
39791
+ ] }),
39792
+ confirmOpen && /* @__PURE__ */ jsx(
39793
+ Confirm,
39794
+ {
39795
+ title: i18n.get("areYouSureYouWantToDeleteThisInvestorDetails"),
39796
+ confirmBtnLabel: i18n.get("delete"),
39797
+ onConfirm: handleFinancierDelete,
39798
+ onClose: () => setConfirmOpen(false)
39799
+ }
39800
+ )
39801
+ ] });
39802
+ };
39803
+ function AdditionalDataForThirdParty(props) {
39804
+ var _a;
39805
+ const [showFinancierModal, setShowFinancierModal] = useState(false);
39806
+ const [activeFinancier, setActiveFinancier] = useState();
39807
+ const [activeIndex, setActiveIndex] = useState();
39808
+ const { data, handleChangeFor } = props;
39809
+ const { i18n } = useI18nContext();
39810
+ const handleToggleFinancierModal = () => {
39811
+ setActiveFinancier(void 0);
39812
+ setActiveIndex(void 0);
39813
+ setShowFinancierModal(!showFinancierModal);
39814
+ };
39815
+ const handleShowUpdateFinancierModal = (index) => {
39816
+ if (!data.financiers) {
39817
+ return;
39818
+ }
39819
+ const financier = data.financiers[index];
39820
+ setActiveFinancier(financier);
39821
+ setActiveIndex(index);
39822
+ setShowFinancierModal(true);
39823
+ };
39824
+ const handleFinancierUpdate = ({
39825
+ formData,
39826
+ indexNumber
39827
+ }) => {
39828
+ const existingFinanciers = data.financiers || [];
39829
+ let newFinanciers = [];
39830
+ if (!formData) {
39831
+ if (indexNumber) {
39832
+ newFinanciers = existingFinanciers.filter((_, index) => index !== indexNumber);
39833
+ }
39834
+ } else {
39835
+ newFinanciers = [...existingFinanciers, formData];
39836
+ if (Number.isFinite(indexNumber)) {
39837
+ newFinanciers = existingFinanciers.map(
39838
+ (existingFinancier, i) => i === indexNumber ? formData : existingFinancier
39839
+ );
39840
+ }
39841
+ }
39842
+ const financierEvent = {
39843
+ target: {
39844
+ name: "financiers",
39845
+ value: newFinanciers
39846
+ }
39847
+ };
39848
+ handleChangeFor("financiers")(financierEvent);
39849
+ };
39850
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
39851
+ (_a = data.financiers) == null ? void 0 : _a.map((financier, index) => {
39852
+ var _a2, _b, _c;
39853
+ return /* @__PURE__ */ jsxs(
39854
+ "button",
39855
+ {
39856
+ type: "button",
39857
+ onClick: () => handleShowUpdateFinancierModal(index),
39858
+ className: styles$4.sourceOfFundsThirdPartyFundingFinancierGroup,
39859
+ children: [
39860
+ /* @__PURE__ */ jsxs("div", { className: styles$4.sourceOfFundsThirdPartyFundingNameAvatarGroup, children: [
39861
+ /* @__PURE__ */ jsx(
39862
+ Button,
39863
+ {
39864
+ tertiary: true,
39865
+ icon: "user",
39866
+ onClick: () => handleShowUpdateFinancierModal(index),
39867
+ className: styles$4.sourceOfFundsThirdPartyFundingAvatar
39868
+ }
39869
+ ),
39870
+ /* @__PURE__ */ jsxs("div", { className: styles$4.sourceOfFundsThirdPartyFundingNameAddressGroup, children: [
39871
+ /* @__PURE__ */ jsxs(Typography, { el: "div", variant: "body-strongest", children: [
39872
+ financier.firstName,
39873
+ " ",
39874
+ financier.lastName
39875
+ ] }),
39876
+ /* @__PURE__ */ jsx(Typography, { el: "div", variant: "caption", children: financier.location })
39877
+ ] })
39878
+ ] }),
39879
+ /* @__PURE__ */ jsx("div", { children: ((_a2 = financier.amount) == null ? void 0 : _a2.currency) && ((_b = financier.amount) == null ? void 0 : _b.value) ? formatAmountWithCurrency(financier.amount.value, (_c = financier.amount) == null ? void 0 : _c.currency) : "" })
39880
+ ]
39881
+ },
39882
+ index
39883
+ );
39884
+ }),
39885
+ /* @__PURE__ */ jsx(
39886
+ "button",
39887
+ {
39888
+ type: "button",
39889
+ className: styles$4.sourceOfFundsThirdPartyFundingFinancierGroup,
39890
+ onClick: handleToggleFinancierModal,
39891
+ children: /* @__PURE__ */ jsxs("div", { className: styles$4.sourceOfFundsThirdPartyFundingNameAvatarGroup, children: [
39892
+ /* @__PURE__ */ jsx(
39893
+ Button,
39894
+ {
39895
+ tertiary: true,
39896
+ icon: "plus",
39897
+ onClick: handleToggleFinancierModal,
39898
+ className: styles$4.sourceOfFundsThirdPartyFundingAvatar
39899
+ }
39900
+ ),
39901
+ /* @__PURE__ */ jsx(Typography, { el: "div", variant: "body-strongest", children: i18n.get("addInvestor") })
39902
+ ] })
39903
+ }
39904
+ ),
39905
+ showFinancierModal && /* @__PURE__ */ jsx(
39906
+ SOFFinancierModal,
39907
+ {
39908
+ financier: activeFinancier,
39909
+ indexNumber: activeIndex,
39910
+ handleModalClose: handleToggleFinancierModal,
39911
+ handleFinancierUpdate
39912
+ }
39913
+ )
39914
+ ] });
39915
+ }
39916
+ function SourceOfFundsAdditionalData(props) {
39917
+ const { i18n } = useI18nContext();
39918
+ const {
39919
+ data: defaultData,
39920
+ validators: validators2,
39921
+ formVerificationErrors,
39922
+ fieldValidationErrors,
39923
+ shouldValidate,
39924
+ sourceOfFundsType
39925
+ } = props;
39926
+ const getFormSchema2 = useMemo(
39927
+ () => getAdditionalDataSchemaKeys(sourceOfFundsType),
39928
+ [sourceOfFundsType]
39929
+ );
39930
+ const {
39931
+ handleChangeFor,
39932
+ data: formData,
39933
+ schema: formSchema,
39934
+ valid: formValid,
39935
+ errors: formErrors,
39936
+ fieldProblems: formFieldProblems
39937
+ } = useForm({
39938
+ ...props,
39939
+ schema: getFormSchema2,
39940
+ defaultData,
39941
+ rules: validators2 || sourceOfFundsAdditionalDataValidations,
39942
+ fieldProblems: fieldValidationErrors,
39943
+ shouldValidate
39944
+ });
39945
+ const handleAmountChange = (key) => (e) => {
39946
+ var _a, _b;
39947
+ const isCurrencyKey = key === "currency";
39948
+ const amountValue = {
39949
+ currency: isCurrencyKey ? e.target.value : (_a = formData.amount) == null ? void 0 : _a.currency,
39950
+ value: isCurrencyKey ? (_b = formData.amount) == null ? void 0 : _b.value : e.target.value
39951
+ };
39952
+ const fieldEvent = {
39953
+ target: {
39954
+ name: "amount",
39955
+ value: amountValue
39956
+ }
39957
+ };
39958
+ handleChangeFor("amount")(fieldEvent);
39959
+ };
39960
+ const formUtils = createFormUtils(props, i18n);
39961
+ const { updateStateSlice } = useGlobalDataSlice("additionalData");
39962
+ const getPageHeadings = useMemo(() => {
39963
+ let pageHeadings = {
39964
+ heading: "tellUsMoreAboutThisSource"
39965
+ };
39966
+ if (sourceOfFundsType === "cryptocurrencyIncome") {
39967
+ pageHeadings = {
39968
+ heading: "cryptocurrencyProceedDetails",
39969
+ description: "tellUsMoreAboutTheCryptocurrency"
39970
+ };
39971
+ }
39972
+ if (sourceOfFundsType === "business") {
39973
+ pageHeadings = {
39974
+ heading: "businessEarningDetails",
39975
+ description: "tellUsMoreAboutThePreviousBusinessEarnings"
39976
+ };
39977
+ }
39978
+ if (sourceOfFundsType === "thirdPartyFunding") {
39979
+ pageHeadings = {
39980
+ heading: "businessInvestorDetails",
39981
+ description: "tellUsMoreAboutTheInvestors"
39982
+ };
39983
+ }
39984
+ return pageHeadings;
39985
+ }, [sourceOfFundsType]);
39986
+ useEffect(() => {
39987
+ updateStateSlice({
39988
+ data: formData,
39989
+ valid: formValid,
39990
+ errors: formErrors,
39991
+ fieldProblems: formFieldProblems,
39992
+ schema: formSchema
39993
+ });
39994
+ }, [formData, formValid, formErrors, formSchema, formFieldProblems]);
39995
+ const renderSubForms = () => {
39996
+ switch (sourceOfFundsType) {
39997
+ case "gamblingWinnings":
39998
+ return /* @__PURE__ */ jsx(
39999
+ AdditionalDataForGambling,
40000
+ {
40001
+ formUtils,
40002
+ handleChangeFor,
40003
+ data: formData,
40004
+ errors: formErrors,
40005
+ valid: formValid,
40006
+ fieldProblems: formFieldProblems,
40007
+ handleAmountChange
40008
+ }
40009
+ );
40010
+ case "cryptocurrencyIncome":
40011
+ return /* @__PURE__ */ jsx(
40012
+ AdditionalDataForCryptocurrency,
40013
+ {
40014
+ formUtils,
40015
+ handleChangeFor,
40016
+ data: formData,
40017
+ errors: formErrors,
40018
+ valid: formValid,
40019
+ fieldProblems: formFieldProblems,
40020
+ handleAmountChange
40021
+ }
40022
+ );
40023
+ case "business":
40024
+ return /* @__PURE__ */ jsx(
40025
+ AdditionalDataForBusiness,
40026
+ {
40027
+ formUtils,
40028
+ handleChangeFor,
40029
+ data: formData,
40030
+ errors: formErrors,
40031
+ valid: formValid,
40032
+ fieldProblems: formFieldProblems,
40033
+ handleAmountChange
40034
+ }
40035
+ );
40036
+ case "assetSale":
40037
+ return /* @__PURE__ */ jsx(
40038
+ AdditionalDataForAssetSale,
40039
+ {
40040
+ formUtils,
40041
+ handleChangeFor,
40042
+ data: formData,
40043
+ errors: formErrors,
40044
+ valid: formValid,
40045
+ fieldProblems: formFieldProblems,
40046
+ handleAmountChange
40047
+ }
40048
+ );
40049
+ case "thirdPartyFunding":
40050
+ return /* @__PURE__ */ jsx(
40051
+ AdditionalDataForThirdParty,
40052
+ {
40053
+ formUtils,
40054
+ handleChangeFor,
40055
+ data: formData,
40056
+ errors: formErrors,
40057
+ valid: formValid,
40058
+ fieldProblems: formFieldProblems,
40059
+ handleAmountChange
40060
+ }
40061
+ );
40062
+ default:
40063
+ return null;
40064
+ }
40065
+ };
40066
+ return /* @__PURE__ */ jsxs("form", { className: styles$4.sourceOfFundsAdditionalDataForm, children: [
40067
+ /* @__PURE__ */ jsxs("div", { className: styles$4.sourceOfFundsAdditonalDataSofHeadings, children: [
40068
+ /* @__PURE__ */ jsx(Typography, { el: "h1", variant: "title-l", children: i18n.get(getPageHeadings.heading) }),
40069
+ getPageHeadings.description && /* @__PURE__ */ jsx("div", { className: styles$4.sourceOfFundsAdditonalDataSofHeadingsDescription, children: i18n.get(getPageHeadings.description) })
40070
+ ] }),
40071
+ /* @__PURE__ */ jsx(
40072
+ ErrorPanel,
40073
+ {
40074
+ verificationErrors: formVerificationErrors,
40075
+ validationErrors: props == null ? void 0 : props.fieldValidationErrors,
40076
+ formUtils,
40077
+ id: "ariaErrorField"
40078
+ }
40079
+ ),
40080
+ renderSubForms()
40081
+ ] });
40082
+ }
38804
40083
  function SourceOfFunds(props) {
38805
40084
  const { i18n } = useI18nContext();
38806
- const { activeForm } = props;
40085
+ const { activeForm, sourceOfFundsType } = props;
38807
40086
  const formWrapperClasses = (formId) => (activeForm == null ? void 0 : activeForm.formId) !== formId ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper";
38808
40087
  return /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-form-wrapper", children: [
38809
40088
  /* @__PURE__ */ jsx("div", { className: formWrapperClasses("sourceOfFundsType"), children: /* @__PURE__ */ jsx(
@@ -38812,10 +40091,11 @@ function SourceOfFunds(props) {
38812
40091
  ...getFormProps(props, sourceOfFundsForms.sourceOfFundsType.formId)
38813
40092
  }
38814
40093
  ) }),
38815
- /* @__PURE__ */ jsx("div", { className: formWrapperClasses("tellUsMore"), children: /* @__PURE__ */ jsx(
38816
- SourceOfFundsTellUsMore,
40094
+ /* @__PURE__ */ jsx("div", { className: formWrapperClasses("additionalData"), children: /* @__PURE__ */ jsx(
40095
+ SourceOfFundsAdditionalData,
38817
40096
  {
38818
- ...getFormProps(props, sourceOfFundsForms.tellUsMore.formId)
40097
+ ...getFormProps(props, sourceOfFundsForms.additionalData.formId),
40098
+ sourceOfFundsType
38819
40099
  }
38820
40100
  ) }),
38821
40101
  /* @__PURE__ */ jsx("div", { className: formWrapperClasses("companySourceOfFunds"), children: /* @__PURE__ */ jsx("div", { children: i18n.get("uploadADocument") }) })
@@ -38826,7 +40106,7 @@ const descriptionSectionField = "adyen-kyc-description-section-field";
38826
40106
  const adyenLayoutXsOnly = "adyen-layout-xs-only";
38827
40107
  const descriptionSectionLabel = "adyen-kyc-description-section-label";
38828
40108
  const descriptionSectionData = "adyen-kyc-description-section-data";
38829
- const styles$4 = {
40109
+ const styles$3 = {
38830
40110
  description,
38831
40111
  "description-section-field": "adyen-kyc-description-section-field",
38832
40112
  descriptionSectionField,
@@ -38838,59 +40118,12 @@ const styles$4 = {
38838
40118
  descriptionSectionData
38839
40119
  };
38840
40120
  const Description = ({ className, list }) => {
38841
- const descriptionClassNames = cx(styles$4.description, className);
38842
- return /* @__PURE__ */ jsx("dl", { className: descriptionClassNames, children: list.map(({ term, details }, index) => /* @__PURE__ */ jsxs("div", { className: styles$4.descriptionSectionField, children: [
38843
- /* @__PURE__ */ jsx("dt", { className: styles$4.descriptionSectionLabel, children: term }),
38844
- /* @__PURE__ */ jsx("dd", { className: styles$4.descriptionSectionData, children: details })
40121
+ const descriptionClassNames = cx(styles$3.description, className);
40122
+ return /* @__PURE__ */ jsx("dl", { className: descriptionClassNames, children: list.map(({ term, details }, index) => /* @__PURE__ */ jsxs("div", { className: styles$3.descriptionSectionField, children: [
40123
+ /* @__PURE__ */ jsx("dt", { className: styles$3.descriptionSectionLabel, children: term }),
40124
+ /* @__PURE__ */ jsx("dd", { className: styles$3.descriptionSectionData, children: details })
38845
40125
  ] }, index)) });
38846
40126
  };
38847
- const sourceOfFunds = "adyen-kyc-source-of-funds";
38848
- const sourceOfFundsGettingStarted = "adyen-kyc-source-of-funds-getting-started";
38849
- const sourceOfFundsGettingStartedIcon = "adyen-kyc-source-of-funds-getting-started-icon";
38850
- const sourceOfFundsGettingStartedHeading = "adyen-kyc-source-of-funds-getting-started-heading";
38851
- const sourceOfFundsGettingStartedBody = "adyen-kyc-source-of-funds-getting-started-body";
38852
- const sourceOfFundsGettingStartedHelpHeader = "adyen-kyc-source-of-funds-getting-started-help-header";
38853
- const sourceOfFundsGettingStartedHelpBody = "adyen-kyc-source-of-funds-getting-started-help-body";
38854
- const sourceOfFundsGettingStartedCards = "adyen-kyc-source-of-funds-getting-started-cards";
38855
- const sourceOfFundsGettingStartedCardsCard = "adyen-kyc-source-of-funds-getting-started-cards-card";
38856
- const sourceOfFundsGettingStartedCardsCardHeader = "adyen-kyc-source-of-funds-getting-started-cards-card-header";
38857
- const sourceOfFundsGettingStartedCardsCardBody = "adyen-kyc-source-of-funds-getting-started-cards-card-body";
38858
- const sourceOfFundsGettingStartedCardsCardDescription = "adyen-kyc-source-of-funds-getting-started-cards-card-description";
38859
- const sourceOfFundsGettingStartedActions = "adyen-kyc-source-of-funds-getting-started-actions";
38860
- const sourceOfFundsGettingStartedHelpButton = "adyen-kyc-source-of-funds-getting-started-help-button";
38861
- const sourceOfFundsGettingStartedPrimaryButton = "adyen-kyc-source-of-funds-getting-started-primary-button";
38862
- const styles$3 = {
38863
- "source-of-funds": "adyen-kyc-source-of-funds",
38864
- sourceOfFunds,
38865
- "source-of-funds-getting-started": "adyen-kyc-source-of-funds-getting-started",
38866
- sourceOfFundsGettingStarted,
38867
- "source-of-funds-getting-started-icon": "adyen-kyc-source-of-funds-getting-started-icon",
38868
- sourceOfFundsGettingStartedIcon,
38869
- "source-of-funds-getting-started-heading": "adyen-kyc-source-of-funds-getting-started-heading",
38870
- sourceOfFundsGettingStartedHeading,
38871
- "source-of-funds-getting-started-body": "adyen-kyc-source-of-funds-getting-started-body",
38872
- sourceOfFundsGettingStartedBody,
38873
- "source-of-funds-getting-started-help-header": "adyen-kyc-source-of-funds-getting-started-help-header",
38874
- sourceOfFundsGettingStartedHelpHeader,
38875
- "source-of-funds-getting-started-help-body": "adyen-kyc-source-of-funds-getting-started-help-body",
38876
- sourceOfFundsGettingStartedHelpBody,
38877
- "source-of-funds-getting-started-cards": "adyen-kyc-source-of-funds-getting-started-cards",
38878
- sourceOfFundsGettingStartedCards,
38879
- "source-of-funds-getting-started-cards-card": "adyen-kyc-source-of-funds-getting-started-cards-card",
38880
- sourceOfFundsGettingStartedCardsCard,
38881
- "source-of-funds-getting-started-cards-card-header": "adyen-kyc-source-of-funds-getting-started-cards-card-header",
38882
- sourceOfFundsGettingStartedCardsCardHeader,
38883
- "source-of-funds-getting-started-cards-card-body": "adyen-kyc-source-of-funds-getting-started-cards-card-body",
38884
- sourceOfFundsGettingStartedCardsCardBody,
38885
- "source-of-funds-getting-started-cards-card-description": "adyen-kyc-source-of-funds-getting-started-cards-card-description",
38886
- sourceOfFundsGettingStartedCardsCardDescription,
38887
- "source-of-funds-getting-started-actions": "adyen-kyc-source-of-funds-getting-started-actions",
38888
- sourceOfFundsGettingStartedActions,
38889
- "source-of-funds-getting-started-help-button": "adyen-kyc-source-of-funds-getting-started-help-button",
38890
- sourceOfFundsGettingStartedHelpButton,
38891
- "source-of-funds-getting-started-primary-button": "adyen-kyc-source-of-funds-getting-started-primary-button",
38892
- sourceOfFundsGettingStartedPrimaryButton
38893
- };
38894
40127
  const SourceOfFundsGettingStarted = ({
38895
40128
  handleGettingStartedClick,
38896
40129
  handleCancelClick,
@@ -38922,9 +40155,9 @@ const SourceOfFundsGettingStarted = ({
38922
40155
  return /* @__PURE__ */ jsx(
38923
40156
  Card,
38924
40157
  {
38925
- className: styles$3.sourceOfFundsGettingStartedCardsCard,
38926
- headerClassName: styles$3.sourceOfFundsGettingStartedCardsCardHeader,
38927
- bodyClassName: styles$3.sourceOfFundsGettingStartedCardsCardBody,
40158
+ className: styles$4.sourceOfFundsGettingStartedCardsCard,
40159
+ headerClassName: styles$4.sourceOfFundsGettingStartedCardsCardHeader,
40160
+ bodyClassName: styles$4.sourceOfFundsGettingStartedCardsCardBody,
38928
40161
  title: line == null ? void 0 : line.service,
38929
40162
  stateful: true,
38930
40163
  onClick: () => handleSourceOfFundsClick(SoF),
@@ -38940,7 +40173,7 @@ const SourceOfFundsGettingStarted = ({
38940
40173
  children: editOrStart && /* @__PURE__ */ jsx(
38941
40174
  Description,
38942
40175
  {
38943
- className: styles$3.sourceOfFundsGettingStartedCardsCardDescription,
40176
+ className: styles$4.sourceOfFundsGettingStartedCardsCardDescription,
38944
40177
  list: mappedSourceOfFunds
38945
40178
  }
38946
40179
  )
@@ -38953,7 +40186,7 @@ const SourceOfFundsGettingStarted = ({
38953
40186
  return /* @__PURE__ */ jsxs(
38954
40187
  "div",
38955
40188
  {
38956
- className: styles$3.sourceOfFundsGettingStarted,
40189
+ className: styles$4.sourceOfFundsGettingStarted,
38957
40190
  "data-testid": "source-of-funds-getting-started",
38958
40191
  children: [
38959
40192
  !hasSourceOfFunds && /* @__PURE__ */ jsx(
@@ -38962,13 +40195,13 @@ const SourceOfFundsGettingStarted = ({
38962
40195
  type: "image",
38963
40196
  testId: "source-of-funds-getting-started-icon",
38964
40197
  name: "source-of-funds",
38965
- className: styles$3.sourceOfFundsGettingStartedIcon
40198
+ className: styles$4.sourceOfFundsGettingStartedIcon
38966
40199
  }
38967
40200
  ),
38968
- /* @__PURE__ */ jsx(Typography, { className: styles$3.sourceOfFundsGettingStartedHeading, el: "h2", variant: "title-l", children: i18n.get("gettingStartedHeading") }),
38969
- /* @__PURE__ */ jsx("div", { className: styles$3.sourceOfFundsGettingStartedBody, children: /* @__PURE__ */ jsx(Typography, { children: i18n.get("gettingStartedBody") }) }),
40201
+ /* @__PURE__ */ jsx(Typography, { className: styles$4.sourceOfFundsGettingStartedHeading, el: "h2", variant: "title-l", children: i18n.get("gettingStartedHeading") }),
40202
+ /* @__PURE__ */ jsx("div", { className: styles$4.sourceOfFundsGettingStartedBody, children: /* @__PURE__ */ jsx(Typography, { children: i18n.get("gettingStartedBody") }) }),
38970
40203
  hasSourceOfFunds && /* @__PURE__ */ jsxs(Fragment, { children: [
38971
- /* @__PURE__ */ jsx("div", { className: styles$3.sourceOfFundsGettingStartedCards, children: mapBusinessLines(businessLines) }),
40204
+ /* @__PURE__ */ jsx("div", { className: styles$4.sourceOfFundsGettingStartedCards, children: mapBusinessLines(businessLines) }),
38972
40205
  handleCancelClick && /* @__PURE__ */ jsx(
38973
40206
  Button,
38974
40207
  {
@@ -38976,7 +40209,7 @@ const SourceOfFundsGettingStarted = ({
38976
40209
  block: true,
38977
40210
  large: true,
38978
40211
  testId: "source-of-funds-getting-return-button",
38979
- className: styles$3.sourceOfFundsGettingStartedCancelButton,
40212
+ className: styles$4.sourceOfFundsGettingStartedCancelButton,
38980
40213
  onClick: handleCancelClick,
38981
40214
  label: i18n.get("returnToTaskList")
38982
40215
  }
@@ -38988,18 +40221,18 @@ const SourceOfFundsGettingStarted = ({
38988
40221
  {
38989
40222
  tertiary: true,
38990
40223
  block: true,
38991
- className: styles$3.sourceOfFundsGettingStartedHelpButton,
40224
+ className: styles$4.sourceOfFundsGettingStartedHelpButton,
38992
40225
  onClick: handleHelpClick,
38993
40226
  testId: "source-of-funds-getting-help-button",
38994
40227
  label: i18n.get("gettingStartedHelp")
38995
40228
  }
38996
40229
  ),
38997
- /* @__PURE__ */ jsxs("div", { className: styles$3.sourceOfFundsGettingStartedActions, children: [
40230
+ /* @__PURE__ */ jsxs("div", { className: styles$4.sourceOfFundsGettingStartedActions, children: [
38998
40231
  /* @__PURE__ */ jsx(
38999
40232
  Button,
39000
40233
  {
39001
40234
  large: true,
39002
- className: styles$3.sourceOfFundsGettingStartedPrimaryButton,
40235
+ className: styles$4.sourceOfFundsGettingStartedPrimaryButton,
39003
40236
  label: i18n.get("gettingStarted"),
39004
40237
  block: true,
39005
40238
  testId: "source-of-funds-getting-primary-button",
@@ -39031,36 +40264,14 @@ const SourceOfFundsHelpModal = ({ handleModalClose }) => {
39031
40264
  {
39032
40265
  variant: "title-l",
39033
40266
  el: "h3",
39034
- className: styles$3.sourceOfFundsGettingStartedHelpHeader,
40267
+ className: styles$4.sourceOfFundsGettingStartedHelpHeader,
39035
40268
  children: i18n.get("gettingStartedHelpModalTitle")
39036
40269
  }
39037
40270
  ) }),
39038
- /* @__PURE__ */ jsx(ModalContent, { children: /* @__PURE__ */ jsx(Typography, { className: styles$3.sourceOfFundsGettingStartedHelpBody, children: i18n.get("gettingStartedHelpModalDescription") }) })
40271
+ /* @__PURE__ */ jsx(ModalContent, { children: /* @__PURE__ */ jsx(Typography, { className: styles$4.sourceOfFundsGettingStartedHelpBody, children: i18n.get("gettingStartedHelpModalDescription") }) })
39039
40272
  ] });
39040
40273
  };
39041
40274
  const logger$n = createLogger("SourceOfFundsDropin");
39042
- const sourceOfFundsForms = {
39043
- sourceOfFundsType: {
39044
- formId: "sourceOfFundsType",
39045
- formName: "chooseAFundingCategory",
39046
- fields: ["type"]
39047
- },
39048
- tellUsMore: {
39049
- formId: "tellUsMore",
39050
- formName: "tellUsMoreAboutThisSource",
39051
- fields: ["annualTurnover", "description", "annualTurnoverCurrency"]
39052
- },
39053
- companySourceOfFunds: {
39054
- formId: "companySourceOfFunds",
39055
- formName: "uploadADocument",
39056
- fields: ["sourceOfFundsDocument"]
39057
- }
39058
- };
39059
- const sourceOfFundsRequiredFields = {
39060
- sourceOfFundsType: sourceOfFundsForms.sourceOfFundsType.fields,
39061
- tellUsMore: sourceOfFundsForms.tellUsMore.fields,
39062
- companySourceOfFunds: sourceOfFundsForms.companySourceOfFunds.fields
39063
- };
39064
40275
  function SourceOfFundsDropin({
39065
40276
  legalEntityResponse,
39066
40277
  country,
@@ -39068,7 +40279,7 @@ function SourceOfFundsDropin({
39068
40279
  trackingConfig,
39069
40280
  handleHomeClick
39070
40281
  }) {
39071
- var _a;
40282
+ var _a, _b, _c;
39072
40283
  const [loadingStatus, setLoadingStatus] = useState("success");
39073
40284
  const [activeBusinessLine, setActiveBusinessLine] = useState();
39074
40285
  const [activeSourceOfFund, setActiveSourceOfFund] = useState({});
@@ -39106,7 +40317,7 @@ function SourceOfFundsDropin({
39106
40317
  trackingConfig,
39107
40318
  task: TaskTypes.SOURCE_OF_FUNDS
39108
40319
  });
39109
- const allFormsFilled = (data) => ["sourceOfFundsType", "annualTurnover"].every((detail) => {
40320
+ const allFormsFilled = (data) => ["sourceOfFundsType", "amount"].every((detail) => {
39110
40321
  const value = getProp(data, detail);
39111
40322
  return !isEmpty$1(value);
39112
40323
  });
@@ -39128,17 +40339,13 @@ function SourceOfFundsDropin({
39128
40339
  ),
39129
40340
  [problems == null ? void 0 : problems.remediationActions, legalEntityResponse]
39130
40341
  );
39131
- const sourceOfFundsRequiredForms = useMemo(() => {
39132
- const data = currentState == null ? void 0 : currentState.data;
39133
- return Object.fromEntries(
39134
- Object.entries(sourceOfFundsForms).filter(([form]) => {
39135
- var _a2;
39136
- if (((_a2 = data == null ? void 0 : data.sourceOfFundsType) == null ? void 0 : _a2.type) !== "business")
39137
- return form !== sourceOfFundsForms.tellUsMore.formId;
39138
- return form;
39139
- })
39140
- );
39141
- }, [(_a = currentState == null ? void 0 : currentState.data) == null ? void 0 : _a.sourceOfFundsType]);
40342
+ const sourceOfFundsRequiredForms = useMemo(
40343
+ () => {
40344
+ var _a2;
40345
+ return getSourceOfFundsRequiredForms((_a2 = currentState == null ? void 0 : currentState.data) == null ? void 0 : _a2.sourceOfFundsType);
40346
+ },
40347
+ [(_a = currentState == null ? void 0 : currentState.data) == null ? void 0 : _a.sourceOfFundsType]
40348
+ );
39142
40349
  const forms = useMemo(() => {
39143
40350
  const requiredForms = getRequiredForms(
39144
40351
  sourceOfFundsRequiredForms,
@@ -39178,7 +40385,7 @@ function SourceOfFundsDropin({
39178
40385
  forms,
39179
40386
  onSubmit: handleSubmit
39180
40387
  });
39181
- return /* @__PURE__ */ jsx("div", { className: styles$3.sourceOfFunds, children: loading ? /* @__PURE__ */ jsx(Loader, { size: "medium" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
40388
+ return /* @__PURE__ */ jsx("div", { className: styles$4.sourceOfFunds, children: loading ? /* @__PURE__ */ jsx(Loader, { size: "medium" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
39182
40389
  gettingStarted && /* @__PURE__ */ jsx(
39183
40390
  SourceOfFundsGettingStarted,
39184
40391
  {
@@ -39215,6 +40422,7 @@ function SourceOfFundsDropin({
39215
40422
  activeForm,
39216
40423
  shouldValidate,
39217
40424
  activeBusinessLine,
40425
+ sourceOfFundsType: (_c = (_b = currentState == null ? void 0 : currentState.data) == null ? void 0 : _b.sourceOfFundsType) == null ? void 0 : _c.type,
39218
40426
  ref: formRef,
39219
40427
  data: activeSourceOfFund
39220
40428
  }
@@ -39899,10 +41107,12 @@ function DropinComposer({
39899
41107
  return /* @__PURE__ */ jsx(
39900
41108
  CustomerSupport,
39901
41109
  {
39902
- legalEntityResponse,
41110
+ legalEntityResponse: rootLegalEntity,
39903
41111
  country: rootLegalEntityCountry,
39904
- onNavigateBack: navigateBack,
39905
- onSubmit: navigateBack,
41112
+ onSubmit: async () => {
41113
+ await refreshLegalEntity();
41114
+ navigateTo(TaskTypes.TASKS_OVERVIEW);
41115
+ },
39906
41116
  handleUpdateLegalEntity: args == null ? void 0 : args.handleUpdateLegalEntity
39907
41117
  }
39908
41118
  );
@@ -41553,43 +42763,6 @@ function useInterval(callback, initialDelay = DEFAULT_POLLING_INTERVAL) {
41553
42763
  );
41554
42764
  return timeoutId;
41555
42765
  }
41556
- const Confirm = ({ onConfirm, title, confirmBtnLabel, onClose }) => {
41557
- const { i18n } = useI18nContext();
41558
- const [isInFlight, setIsInFlight] = useState(false);
41559
- const handleConfirm = async () => {
41560
- setIsInFlight(true);
41561
- try {
41562
- await onConfirm();
41563
- } finally {
41564
- setIsInFlight(false);
41565
- onClose();
41566
- }
41567
- };
41568
- return /* @__PURE__ */ jsxs(Modal, { size: "small", onClose, children: [
41569
- /* @__PURE__ */ jsx(ModalHeader, { children: /* @__PURE__ */ jsx(
41570
- Typography,
41571
- {
41572
- variant: "title",
41573
- el: "h3",
41574
- className: "adyen-kyc-u-margin-top-8 adyen-kyc-u-margin-left-8",
41575
- children: title
41576
- }
41577
- ) }),
41578
- /* @__PURE__ */ jsxs(ModalFooter, { children: [
41579
- /* @__PURE__ */ jsx("div", { style: { flex: "1" } }),
41580
- /* @__PURE__ */ jsx(Button, { label: i18n.get("cancel"), onClick: onClose, secondary: true }),
41581
- /* @__PURE__ */ jsx(
41582
- Button,
41583
- {
41584
- label: confirmBtnLabel || i18n.get("confirm"),
41585
- onClick: handleConfirm,
41586
- critical: true,
41587
- disabled: isInFlight
41588
- }
41589
- )
41590
- ] })
41591
- ] });
41592
- };
41593
42766
  function ManageTransferInstrumentOverviewItemModal({
41594
42767
  status,
41595
42768
  transferInstrument,
@@ -42082,21 +43255,14 @@ function SignPCIComponent({
42082
43255
  return /* @__PURE__ */ jsx(Loader, { size: "medium" });
42083
43256
  }
42084
43257
  if (!hasGenericError) {
42085
- return /* @__PURE__ */ jsx(
42086
- DropinLayout,
43258
+ return /* @__PURE__ */ jsx(MaybeModal, { inline: !modalView, onClose: handleOnClose, children: /* @__PURE__ */ jsx(ModalContent, { children: /* @__PURE__ */ jsx(
43259
+ Splashscreen,
42087
43260
  {
42088
- showAsModal: modalView,
42089
- onClose: handleOnClose,
42090
- content: /* @__PURE__ */ jsx(
42091
- Splashscreen,
42092
- {
42093
- icon: "check",
42094
- title: i18n.get("pciDoesNotNeedSigningOrHasBeenSigned"),
42095
- onClick: handleOnClose
42096
- }
42097
- )
43261
+ icon: "check",
43262
+ title: i18n.get("pciDoesNotNeedSigningOrHasBeenSigned"),
43263
+ onClick: handleOnClose
42098
43264
  }
42099
- );
43265
+ ) }) });
42100
43266
  }
42101
43267
  return pciTemplate ? /* @__PURE__ */ jsx(
42102
43268
  PciDropin,
@@ -42338,236 +43504,6 @@ const getParentCompanySchemaKeys = (currentData, schemaKeys) => {
42338
43504
  }
42339
43505
  return schemaKeys.filter((field) => !fieldsToRemove.includes(field));
42340
43506
  };
42341
- const validateLegalEntityIdentifier = (legalEntityIdentifier) => {
42342
- if (!legalEntityIdentifier) {
42343
- return true;
42344
- }
42345
- const isValidLength = legalEntityIdentifier ? legalEntityIdentifier.length === 20 : false;
42346
- const hasLettersAndNumbers = legalEntityIdentifier ? /[a-zA-Z]/.test(legalEntityIdentifier) && /[0-9]/.test(legalEntityIdentifier) : false;
42347
- return isValidLength && hasLettersAndNumbers;
42348
- };
42349
- const validateDateNotInTheFuture = (selectedDate) => {
42350
- if (!selectedDate) return true;
42351
- return new Date(selectedDate) <= /* @__PURE__ */ new Date();
42352
- };
42353
- const highExposureCompanyDetailsValidations = {
42354
- legalForm: {
42355
- modes: ["blur"],
42356
- validate: (legalName) => !isEmpty$1(legalName),
42357
- errorMessage: "fieldIsRequired"
42358
- },
42359
- numberOfEmployees: [
42360
- {
42361
- modes: ["blur"],
42362
- validate: (numberOfEmployees) => !isEmpty$1(numberOfEmployees),
42363
- errorMessage: "fieldIsRequired"
42364
- },
42365
- {
42366
- modes: ["blur"],
42367
- validate: (numberOfEmployees) => Number.isInteger(Number(numberOfEmployees)),
42368
- errorMessage: "pleaseEnterAValidWholeNumber"
42369
- }
42370
- ],
42371
- legalInformationInsolvency: {
42372
- modes: ["blur"],
42373
- validate: (legalInformationInsolvency) => !isEmpty$1(legalInformationInsolvency),
42374
- errorMessage: "fieldIsRequired"
42375
- },
42376
- netAssets: [
42377
- {
42378
- modes: ["blur"],
42379
- validate: (value) => !isEmpty$1(value),
42380
- errorMessage: "fieldIsRequired"
42381
- },
42382
- {
42383
- modes: ["blur"],
42384
- validate: (value) => !Number.isNaN(Number(value)),
42385
- errorMessage: "pleaseEnterAValidNumber"
42386
- }
42387
- ],
42388
- currency: {
42389
- modes: ["input"],
42390
- validate: (value) => !isEmpty$1(value),
42391
- errorMessage: "fieldIsRequired"
42392
- },
42393
- annualTurnover: [
42394
- {
42395
- modes: ["blur"],
42396
- validate: (value) => !isEmpty$1(value),
42397
- errorMessage: "fieldIsRequired"
42398
- },
42399
- {
42400
- modes: ["blur"],
42401
- validate: (value) => !Number.isNaN(Number(value)),
42402
- errorMessage: "pleaseEnterAValidNumber"
42403
- }
42404
- ],
42405
- financialReportingDate: [
42406
- {
42407
- modes: ["blur"],
42408
- validate: (value) => !isEmpty$1(value),
42409
- errorMessage: "fieldIsRequired"
42410
- },
42411
- {
42412
- modes: ["blur"],
42413
- validate: (value) => validateDateNotInTheFuture(value),
42414
- errorMessage: "dateCannotBeInTheFuture"
42415
- }
42416
- ],
42417
- naceCode: {
42418
- modes: ["blur"],
42419
- validate: (naceCode) => !isEmpty$1(naceCode),
42420
- errorMessage: "fieldIsRequired"
42421
- },
42422
- doesYourCompanyHaveLEI: {
42423
- modes: ["blur"],
42424
- validate: (doesYourCompanyHaveLEI) => !isEmpty$1(doesYourCompanyHaveLEI),
42425
- errorMessage: "fieldIsRequired"
42426
- },
42427
- legalEntityIdentifier: [
42428
- {
42429
- modes: ["blur"],
42430
- validate: (legalEntityIdentifier) => !isEmpty$1(legalEntityIdentifier),
42431
- errorMessage: "fieldIsRequired"
42432
- },
42433
- {
42434
- modes: ["blur"],
42435
- validate: (legalEntityIdentifier) => validateLegalEntityIdentifier(legalEntityIdentifier),
42436
- errorMessage: "invalidFormat"
42437
- }
42438
- ],
42439
- isCompanyOwnedByAnotherCompany: {
42440
- modes: ["blur"],
42441
- validate: (isCompanyOwnedByAnotherCompany) => !isEmpty$1(isCompanyOwnedByAnotherCompany),
42442
- errorMessage: "fieldIsRequired"
42443
- },
42444
- isParentOwnedByAnotherCompany: {
42445
- modes: ["blur"],
42446
- validate: (isParentOwnedByAnotherCompany) => !isEmpty$1(isParentOwnedByAnotherCompany),
42447
- errorMessage: "fieldIsRequired"
42448
- },
42449
- legalProceedingsDate: [
42450
- {
42451
- modes: ["blur"],
42452
- validate: (legalProceedingsDate) => !isEmpty$1(legalProceedingsDate),
42453
- errorMessage: "fieldIsRequired"
42454
- },
42455
- {
42456
- modes: ["blur"],
42457
- validate: (value) => validateDateNotInTheFuture(value),
42458
- errorMessage: "dateCannotBeInTheFuture"
42459
- }
42460
- ]
42461
- };
42462
- const highExposureParentCompaniesDetailsValidations = {
42463
- legalForm: {
42464
- modes: ["blur"],
42465
- validate: (legalName) => !isEmpty$1(legalName),
42466
- errorMessage: "fieldIsRequired"
42467
- },
42468
- legalName: {
42469
- modes: ["blur"],
42470
- validate: (legalName) => !isEmpty$1(legalName),
42471
- errorMessage: "fieldIsRequired"
42472
- },
42473
- numberOfEmployees: [
42474
- {
42475
- modes: ["blur"],
42476
- validate: (numberOfEmployees) => !isEmpty$1(numberOfEmployees),
42477
- errorMessage: "fieldIsRequired"
42478
- },
42479
- {
42480
- modes: ["blur"],
42481
- validate: (numberOfEmployees) => Number.isInteger(Number(numberOfEmployees)),
42482
- errorMessage: "pleaseEnterAValidWholeNumber"
42483
- }
42484
- ],
42485
- naceCode: {
42486
- modes: ["blur"],
42487
- validate: (naceCode) => !isEmpty$1(naceCode),
42488
- errorMessage: "fieldIsRequired"
42489
- },
42490
- doesYourCompanyHaveLEI: {
42491
- modes: ["blur"],
42492
- validate: (doesYourCompanyHaveLEI) => !isEmpty$1(doesYourCompanyHaveLEI),
42493
- errorMessage: "fieldIsRequired"
42494
- },
42495
- legalEntityIdentifier: [
42496
- {
42497
- modes: ["blur"],
42498
- validate: (legalEntityIdentifier) => !isEmpty$1(legalEntityIdentifier),
42499
- errorMessage: "fieldIsRequired"
42500
- },
42501
- {
42502
- modes: ["blur"],
42503
- validate: (legalEntityIdentifier) => validateLegalEntityIdentifier(legalEntityIdentifier),
42504
- errorMessage: "invalidFormat"
42505
- }
42506
- ],
42507
- isThisAddressTheMainHeadquarters: {
42508
- modes: ["blur"],
42509
- validate: (isThisAddressTheMainHeadquarters) => !isEmpty$1(isThisAddressTheMainHeadquarters),
42510
- errorMessage: "fieldIsRequired"
42511
- },
42512
- legalInformationInsolvency: {
42513
- modes: ["blur"],
42514
- validate: (value) => !isEmpty$1(value),
42515
- errorMessage: "fieldIsRequired"
42516
- },
42517
- netAssets: [
42518
- {
42519
- modes: ["blur"],
42520
- validate: (value) => !isEmpty$1(value),
42521
- errorMessage: "fieldIsRequired"
42522
- },
42523
- {
42524
- modes: ["blur"],
42525
- validate: (value) => !Number.isNaN(Number(value)),
42526
- errorMessage: "pleaseEnterAValidNumber"
42527
- }
42528
- ],
42529
- currency: {
42530
- modes: ["input"],
42531
- validate: (value) => !isEmpty$1(value),
42532
- errorMessage: "fieldIsRequired"
42533
- },
42534
- annualTurnover: [
42535
- {
42536
- modes: ["blur"],
42537
- validate: (value) => !isEmpty$1(value),
42538
- errorMessage: "fieldIsRequired"
42539
- },
42540
- {
42541
- modes: ["blur"],
42542
- validate: (value) => !Number.isNaN(Number(value)),
42543
- errorMessage: "pleaseEnterAValidNumber"
42544
- }
42545
- ],
42546
- financialReportingDate: [
42547
- {
42548
- modes: ["blur"],
42549
- validate: (value) => !isEmpty$1(value),
42550
- errorMessage: "fieldIsRequired"
42551
- },
42552
- {
42553
- modes: ["blur"],
42554
- validate: (value) => validateDateNotInTheFuture(value),
42555
- errorMessage: "dateCannotBeInTheFuture"
42556
- }
42557
- ],
42558
- legalProceedingsDate: [
42559
- {
42560
- modes: ["blur"],
42561
- validate: (legalProceedingsDate) => !isEmpty$1(legalProceedingsDate),
42562
- errorMessage: "fieldIsRequired"
42563
- },
42564
- {
42565
- modes: ["blur"],
42566
- validate: (legalProceedingsDate) => validateDateNotInTheFuture(legalProceedingsDate),
42567
- errorMessage: "dateCannotBeInTheFuture"
42568
- }
42569
- ]
42570
- };
42571
43507
  const logger$d = createLogger("LegalFormField");
42572
43508
  function LegalFormField({
42573
43509
  name = "legalForm",
@@ -44844,7 +45780,7 @@ const ConfigurationApiProvider = ({
44844
45780
  }) => {
44845
45781
  const authContext = useAuthContext();
44846
45782
  const { isEmbeddedDropin, loadingContext } = authContext;
44847
- const sdkVersion = "3.45.1";
45783
+ const sdkVersion = "3.46.1";
44848
45784
  const rootLegalEntityId = useGlobalStore((store) => store.rootLegalEntity.id);
44849
45785
  useAnalytics({
44850
45786
  onUserEvent,
@@ -44965,7 +45901,7 @@ const useAllowedLocales = () => {
44965
45901
  }, []);
44966
45902
  return allowedLocales;
44967
45903
  };
44968
- const localeImports = /* @__PURE__ */ Object.assign({ "./locales/bg-BG.json": () => import("./bg-BG-Q7jr61oX.js"), "./locales/cs-CZ.json": () => import("./cs-CZ-DWt-8d0a.js"), "./locales/da-DK.json": () => import("./da-DK-DzKDKodb.js"), "./locales/de-DE.json": () => import("./de-DE-CTrlEFB7.js"), "./locales/el-GR.json": () => import("./el-GR-BEyHixTO.js"), "./locales/en-US.instructions.json": () => import("./en-US.instructions-DLPEHGI-.js"), "./locales/en-US.json": () => Promise.resolve().then(() => enUS), "./locales/es-ES.json": () => import("./es-ES-C5YKWCME.js"), "./locales/et-EE.json": () => import("./et-EE-UTwEA7KT.js"), "./locales/fi-FI.json": () => import("./fi-FI-Dlg3u-HY.js"), "./locales/fr-FR.json": () => import("./fr-FR-BrL2V-lF.js"), "./locales/hr-HR.json": () => import("./hr-HR-CR1NpsoY.js"), "./locales/hu-HU.json": () => import("./hu-HU-BkmzV8oZ.js"), "./locales/it-IT.json": () => import("./it-IT-BR75YMjD.js"), "./locales/lt-LT.json": () => import("./lt-LT-Cm17tGP4.js"), "./locales/lv-LV.json": () => import("./lv-LV-Bj0D7n67.js"), "./locales/nl-NL.json": () => import("./nl-NL-bhqLkBQz.js"), "./locales/no-NO.json": () => import("./no-NO-CrzRhfMh.js"), "./locales/pl-PL.json": () => import("./pl-PL-BcncZK0S.js"), "./locales/pt-PT.json": () => import("./pt-PT-Bwx0xHGg.js"), "./locales/ro-RO.json": () => import("./ro-RO-Bj9nLST9.js"), "./locales/sk-SK.json": () => import("./sk-SK-CI2V7naC.js"), "./locales/sl-SI.json": () => import("./sl-SI-Dg4cE1ea.js"), "./locales/sv-SE.json": () => import("./sv-SE-DPB5qLHu.js") });
45904
+ const localeImports = /* @__PURE__ */ Object.assign({ "./locales/bg-BG.json": () => import("./bg-BG-Ihgju3Pi.js"), "./locales/cs-CZ.json": () => import("./cs-CZ-BwFstFmQ.js"), "./locales/da-DK.json": () => import("./da-DK-8v1CN9Kj.js"), "./locales/de-DE.json": () => import("./de-DE-DtR-ZoAt.js"), "./locales/el-GR.json": () => import("./el-GR-CBnu_V96.js"), "./locales/en-US.instructions.json": () => import("./en-US.instructions-DLPEHGI-.js"), "./locales/en-US.json": () => Promise.resolve().then(() => enUS), "./locales/es-ES.json": () => import("./es-ES-kb2BRKrK.js"), "./locales/et-EE.json": () => import("./et-EE-UdwhQ1tL.js"), "./locales/fi-FI.json": () => import("./fi-FI-DX8-uQWW.js"), "./locales/fr-FR.json": () => import("./fr-FR-Dflt81Kj.js"), "./locales/hr-HR.json": () => import("./hr-HR-DDW3mkAM.js"), "./locales/hu-HU.json": () => import("./hu-HU-B7KDp-GT.js"), "./locales/it-IT.json": () => import("./it-IT-Q6-mT16i.js"), "./locales/lt-LT.json": () => import("./lt-LT-DKLjCNW_.js"), "./locales/lv-LV.json": () => import("./lv-LV-Cj-obzFe.js"), "./locales/nl-NL.json": () => import("./nl-NL-C0DfxtrT.js"), "./locales/no-NO.json": () => import("./no-NO-DRJeRltS.js"), "./locales/pl-PL.json": () => import("./pl-PL-DPYok5sp.js"), "./locales/pt-PT.json": () => import("./pt-PT-C5GFc3jY.js"), "./locales/ro-RO.json": () => import("./ro-RO-BhsqkN_s.js"), "./locales/sk-SK.json": () => import("./sk-SK-HaK9kYN-.js"), "./locales/sl-SI.json": () => import("./sl-SI-VeIDFOxi.js"), "./locales/sv-SE.json": () => import("./sv-SE-DEhZRTDK.js") });
44969
45905
  const loadLocale = async (locale) => {
44970
45906
  const importForLocale = localeImports[`./locales/${locale}.json`];
44971
45907
  if (!importForLocale) {
@@ -45691,7 +46627,7 @@ const DebugModal = ({ onExit }) => {
45691
46627
  const [tab, setTab] = useState("metadata");
45692
46628
  const rootLegalEntity = useGlobalStore((store) => store.rootLegalEntity);
45693
46629
  const metadata = {
45694
- sdkVersion: "3.45.1",
46630
+ sdkVersion: "3.46.1",
45695
46631
  locale: i18n.locale,
45696
46632
  rootLegalEntityId: rootLegalEntity.id
45697
46633
  };