@adyen/kyc-components 4.0.0-beta.3 → 4.0.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AcceptTermsOfServiceComponent-i222mdxX.js → AcceptTermsOfServiceComponent-ilX6szf9.js} +42 -43
- package/dist/{AccountSetupRejected-DHph9lFl.js → AccountSetupRejected-CQjHA557.js} +3 -3
- package/dist/{Avatar-vCjWXfC7.js → Avatar-BfRRf9_a.js} +2 -2
- package/dist/{BusinessDetailsDropin-DQcfiSR8.js → BusinessDetailsDropin-Dr580mIQ.js} +122 -144
- package/dist/{BusinessFinancingComponent-DC3jzBrq.js → BusinessFinancingComponent-CEIG-4wN.js} +3 -3
- package/dist/{BusinessFinancingDropin-D2lMEbNh.js → BusinessFinancingDropin-sC3QpkDx.js} +409 -258
- package/dist/{BusinessFinancingPage-BPD2cSDR.js → BusinessFinancingPage-BIEuNfKE.js} +3 -3
- package/dist/{BusinessTypeSelectionPage-Cdp8joPJ.js → BusinessTypeSelectionPage-6sF2ce3o.js} +35 -64
- package/dist/{ContractViewer-B0bZ14Ts.js → ContractViewer-BOxsPeO1.js} +4 -4
- package/dist/{CreateIndividualComponent-D9wnexv4.js → CreateIndividualComponent-t9eDVjpb.js} +4 -4
- package/dist/{CreateTransferInstrumentComponent-COzPdQjC.js → CreateTransferInstrumentComponent-D65FAcQz.js} +5 -5
- package/dist/{CustomerSupport-NGBoBg3N.js → CustomerSupport-CoLWcgoS.js} +5 -5
- package/dist/{DebugModal-I2U6TjGT.js → DebugModal-DkICAsiu.js} +7 -221
- package/dist/{DecisionMakerDetailsPage-BN-H1sJF.js → DecisionMakerDetailsPage-CvmwdHqV.js} +4 -4
- package/dist/{DecisionMakers-CZ5-IRtU.js → DecisionMakers-DthVv8_t.js} +160 -9
- package/dist/{EmbeddedStatus-Blr0seRl.js → EmbeddedStatus-DdGnEZzS.js} +13 -13
- package/dist/{FormEndState-JB6QFSet.js → FormEndState-CUYkLBgX.js} +3 -3
- package/dist/{FormFlow-DjvdNEiV.js → FormFlow-CNXkXUwa.js} +3 -3
- package/dist/{IndividualOnfidoDropin-DHhyO2ai.js → IndividualOnfidoDropin-DV2fJG5W.js} +254 -223
- package/dist/{Introduction-erRXgreE.js → Introduction-B1WXHc-7.js} +24 -26
- package/dist/{ProviderButton-B58n0cRC.js → LandingLayout-BC3pp_IY.js} +91 -83
- package/dist/{LegalRepresentativeDetailsPage-rS5K4657.js → LegalRepresentativeDetailsPage-9xm-XCto.js} +4 -4
- package/dist/{ManageIndividualComponent-BEzE5lkX.js → ManageIndividualComponent-zCo6mUQx.js} +6 -6
- package/dist/{ManageTermsOfServiceComponent-BWkwy6YC.js → ManageTermsOfServiceComponent-DpQXgPYk.js} +4 -4
- package/dist/{ManageTransferInstrumentComponent-B8kRNftW.js → ManageTransferInstrumentComponent-BKERoin1.js} +6 -6
- package/dist/{OnboardingDropinComponent-DBW5N3Dr.js → OnboardingDropinComponent-DYdts9Sh.js} +330 -169
- package/dist/{Review-O6Al47Cu.js → Review-jBq7cFVv.js} +3 -3
- package/dist/RootBusinessDetailsPage-BfO0Xb7n.js +1848 -0
- package/dist/{RootIndividualDetailsPage-CiXgSJsV.js → RootIndividualDetailsPage-DzmHoceW.js} +4 -4
- package/dist/{SignPCIComponent-cqRNhGdl.js → SignPCIComponent-By4PazmA.js} +20 -24
- package/dist/{SingpassSelection-BWEJ3Yi-.js → SingpassSelection-BeUj9Kdy.js} +8 -8
- package/dist/{SoleProprietorshipPage-CRcJSpn9.js → SoleProprietorshipPage-CZPeKEEl.js} +4 -4
- package/dist/{SourceOfFundsPage-BxLGXTHb.js → SourceOfFundsPage-CI1qdFId.js} +18 -17
- package/dist/{StoreProvider-ClKLaHzy.js → StoreProvider-O9jwxfG8.js} +5192 -4367
- package/dist/{TaskItemStatus-DrTIwCTx.js → TaskItemStatus-s7Z3DOGa.js} +12 -12
- package/dist/{TaskStatusIndicator-CTtKjo0m.js → TaskStatusIndicator-BanufME0.js} +5 -5
- package/dist/{TaxReportingDropin-DFZ2ehfk.js → TaxReportingDropin-BQqDUn9I.js} +8 -8
- package/dist/{TileGroup-BtE472I1.js → TileGroup-tu04B8GK.js} +2 -2
- package/dist/{TrustDetailsPage-CGiiTbfR.js → TrustDetailsPage-BQKZ_ZyU.js} +28 -15
- package/dist/{TrustMemberCompanyPage-oLNhg0hg.js → TrustMemberCompanyPage-C9aFr4Bm.js} +5 -5
- package/dist/{TrustMemberIndividualPage-Bgsis586.js → TrustMemberIndividualPage-Ci7hwMA_.js} +4 -4
- package/dist/{UnincorporatedPartnershipIndividualPage-DPE3grqL.js → UnincorporatedPartnershipIndividualPage-XQsgF3ou.js} +4 -4
- package/dist/{UnincorporatedPartnershipMemberCompanyPage-HUnc9g0g.js → UnincorporatedPartnershipMemberCompanyPage-DFe_N3gH.js} +4 -4
- package/dist/{VerificationErrorAlert-BBdJmGJu.js → VerificationErrorAlert-Ci0cObw1.js} +13 -4
- package/dist/{ViewVerificationStatusComponent-DDtXG_pM.js → ViewVerificationStatusComponent-_qQmZFDY.js} +14 -12
- package/dist/adyen-business-financing.js +2 -2
- package/dist/adyen-individual.js +2 -2
- package/dist/adyen-kyc-components.js +31 -22
- package/dist/adyen-manage-individual.js +2 -2
- package/dist/adyen-manage-terms-of-service.js +3 -3
- package/dist/adyen-manage-transfer-instruments.js +3 -3
- package/dist/adyen-onboarding.js +3 -3
- package/dist/adyen-terms-of-service.js +2 -2
- package/dist/adyen-transfer-instrument.js +2 -2
- package/dist/adyen-verification-status.js +2 -2
- package/dist/bag-DpxmyXfR.js +14 -0
- package/dist/bg-BG-9uVrFuHv.js +23 -0
- package/dist/bg-BG-BiYtb1Tz.js +55 -0
- package/dist/bg-BG-CMomhopf.js +35 -0
- package/dist/bg-BG-Dy6-IwuZ.js +28 -0
- package/dist/bg-BG-NMIts2sa.js +35 -0
- package/dist/{plaintext-9WNCwUtz.js → bg-BG-hFblesn-.js} +4 -6
- package/dist/business-lines-DboUCbXw.js +135 -0
- package/dist/{_plugin-vue_export-helper-CgYpM5kA.js → cs-CZ-B8IPRc47.js} +4 -8
- package/dist/cs-CZ-Csr_35T-.js +35 -0
- package/dist/cs-CZ-DMzortvO.js +35 -0
- package/dist/cs-CZ-Dbow28-o.js +28 -0
- package/dist/cs-CZ-Wzc382q6.js +23 -0
- package/dist/cs-CZ-wdftovLe.js +55 -0
- package/dist/da-DK-4QAKic_C.js +55 -0
- package/dist/da-DK-Adj8R5Qn.js +28 -0
- package/dist/da-DK-BTpZzEgA.js +15 -0
- package/dist/da-DK-CeNMXUfE.js +23 -0
- package/dist/da-DK-Dm8o1giq.js +35 -0
- package/dist/da-DK-q2b_1elr.js +35 -0
- package/dist/de-DE-BG0tKqvi.js +28 -0
- package/dist/de-DE-BzumFI3T.js +55 -0
- package/dist/de-DE-D2ByeIZs.js +35 -0
- package/dist/de-DE-DMFaycio.js +35 -0
- package/dist/de-DE-DjOUNvp6.js +15 -0
- package/dist/de-DE-JI-7mvxy.js +23 -0
- package/dist/el-GR-CGeBAkDN.js +35 -0
- package/dist/el-GR-CXmTklMq.js +55 -0
- package/dist/el-GR-Cu9HwD-f.js +15 -0
- package/dist/el-GR-DGW388LZ.js +35 -0
- package/dist/el-GR-DerT143K.js +28 -0
- package/dist/el-GR-DfNOPkLq.js +23 -0
- package/dist/en-US-BQpgt41j.js +37 -0
- package/dist/en-US-BTYdAWXp.js +15 -0
- package/dist/en-US-CQ3angjM.js +22 -0
- package/dist/en-US-CkZcSKGh.js +35 -0
- package/dist/en-US-DHq7VYFs.js +23 -0
- package/dist/en-US-DLm6gy6T.js +58 -0
- package/dist/en-US-SbE0c1gn.js +36 -0
- package/dist/es-ES-BM4U0hT3.js +28 -0
- package/dist/es-ES-BhQOdKge.js +55 -0
- package/dist/es-ES-Cj7q7fWO.js +15 -0
- package/dist/es-ES-DOVPTeyf.js +23 -0
- package/dist/es-ES-WWftn3JX.js +35 -0
- package/dist/es-ES-pXHx3ODy.js +35 -0
- package/dist/et-EE-BJIsPOnh.js +23 -0
- package/dist/et-EE-CFlzRBEx.js +55 -0
- package/dist/et-EE-D5lRJbMZ.js +35 -0
- package/dist/et-EE-Dor3enPS.js +15 -0
- package/dist/et-EE-OJg_PSHf.js +28 -0
- package/dist/et-EE-QLVnr6Vl.js +35 -0
- package/dist/fi-FI-BJ2l42Pj.js +28 -0
- package/dist/fi-FI-BNcnKrJ9.js +15 -0
- package/dist/fi-FI-D522KHGk.js +23 -0
- package/dist/fi-FI-D9E_KaJi.js +35 -0
- package/dist/fi-FI-DT351N-G.js +35 -0
- package/dist/fi-FI-Djollt2G.js +55 -0
- package/dist/fr-FR-BNXXNUX_.js +35 -0
- package/dist/fr-FR-Bn3D6mmY.js +15 -0
- package/dist/fr-FR-Cv0k-3Xc.js +35 -0
- package/dist/fr-FR-DInQKkTd.js +23 -0
- package/dist/fr-FR-g7lmxEsI.js +28 -0
- package/dist/fr-FR-l36qBV3a.js +55 -0
- package/dist/{getFieldsWithExistingData-BY--eXBQ.js → getFieldsWithExistingData-7pZnHro-.js} +2 -2
- package/dist/{hasDataChanged-CwfuS4et.js → hasDataChanged-v0hD-nEq.js} +2 -2
- package/dist/hr-HR-B8AZ4eHJ.js +35 -0
- package/dist/hr-HR-CDUE36Dg.js +28 -0
- package/dist/hr-HR-CNzbyo9r.js +15 -0
- package/dist/hr-HR-CzSrqEFA.js +35 -0
- package/dist/hr-HR-DTCY4iL8.js +55 -0
- package/dist/hr-HR-DzS44Gpv.js +23 -0
- package/dist/hu-HU-BSOiZA7a.js +15 -0
- package/dist/hu-HU-Bmf13NMf.js +28 -0
- package/dist/hu-HU-BznXPoc2.js +55 -0
- package/dist/hu-HU-DRi6Dz9U.js +35 -0
- package/dist/hu-HU-xCvNM5TU.js +23 -0
- package/dist/hu-HU-zK6nUqWr.js +35 -0
- package/dist/it-IT-BEWyAQUU.js +55 -0
- package/dist/it-IT-BeYbInCQ.js +35 -0
- package/dist/it-IT-C_fNHhjE.js +35 -0
- package/dist/it-IT-CjEYONJg.js +23 -0
- package/dist/it-IT-DYIx7myn.js +28 -0
- package/dist/it-IT-DvM-9LpM.js +15 -0
- package/dist/ja-JP-BUz3qN-V.js +23 -0
- package/dist/ja-JP-C1OQ16fo.js +35 -0
- package/dist/ja-JP-D7oL6xGY.js +55 -0
- package/dist/ja-JP-GXkLvnQ4.js +15 -0
- package/dist/ja-JP-tx1DbZYD.js +28 -0
- package/dist/ja-JP-weDU8GLW.js +35 -0
- package/dist/{localizeDateString-CKCBXzSn.js → localizeDateString-BlZ_CtJI.js} +2 -2
- package/dist/lt-LT-B6CJ4ULI.js +23 -0
- package/dist/lt-LT-BUYY0LaT.js +35 -0
- package/dist/lt-LT-BxScCodJ.js +28 -0
- package/dist/lt-LT-DNjXmQPv.js +15 -0
- package/dist/lt-LT-De7dLXxI.js +55 -0
- package/dist/lt-LT-_MzAcXJo.js +35 -0
- package/dist/lv-LV-B9js9VoA.js +35 -0
- package/dist/lv-LV-CRhXAjn6.js +35 -0
- package/dist/lv-LV-ChOoZuhc.js +15 -0
- package/dist/lv-LV-DTtuyfHS.js +23 -0
- package/dist/lv-LV-De9rdme0.js +55 -0
- package/dist/lv-LV-F9_Fiu3w.js +28 -0
- package/dist/mail-Z_IE_hkw.js +14 -0
- package/dist/{mapFinancialReportsToFinancialInformation-D_6u_bSS.js → mapFinancialReportsToFinancialInformation-DrS0xN6i.js} +2 -2
- package/dist/nl-NL-BHqiO21q.js +15 -0
- package/dist/nl-NL-Cht7cSwD.js +28 -0
- package/dist/nl-NL-DLedC3mO.js +35 -0
- package/dist/nl-NL-Dbx0ZmI7.js +35 -0
- package/dist/nl-NL-Zcq0bXd-.js +23 -0
- package/dist/nl-NL-lZcJhRsP.js +55 -0
- package/dist/no-NO-BEIyAMmZ.js +55 -0
- package/dist/no-NO-BQAqVzF4.js +28 -0
- package/dist/no-NO-BxReX6oF.js +23 -0
- package/dist/no-NO-C0sfkp82.js +35 -0
- package/dist/no-NO-CKT9kLAH.js +15 -0
- package/dist/no-NO-CpVal4cV.js +35 -0
- package/dist/pay-by-link-plane-Pv7Babgn.js +22 -0
- package/dist/pl-PL-1ylK-_FE.js +35 -0
- package/dist/pl-PL-CqxMKpBm.js +28 -0
- package/dist/pl-PL-D6heiKsH.js +15 -0
- package/dist/pl-PL-DAPGaxWi.js +35 -0
- package/dist/pl-PL-DD3wVcKc.js +55 -0
- package/dist/pl-PL-T6uD5--R.js +23 -0
- package/dist/pt-PT-BY9rcwcF.js +35 -0
- package/dist/pt-PT-BkvMsoK4.js +35 -0
- package/dist/pt-PT-BsDCHbWN.js +55 -0
- package/dist/pt-PT-CBbmkr_J.js +28 -0
- package/dist/pt-PT-D2elvnDU.js +15 -0
- package/dist/pt-PT-N0njcfLO.js +23 -0
- package/dist/{resolveEnvironment-DQH1ab0S.js → resolveEnvironment-DvSgDDo8.js} +3 -3
- package/dist/ro-RO-CUg8-CQ8.js +55 -0
- package/dist/ro-RO-DJLWmWZ4.js +35 -0
- package/dist/ro-RO-DL9V1CMj.js +15 -0
- package/dist/ro-RO-Dfx0g3bU.js +35 -0
- package/dist/ro-RO-IY3AMhwm.js +28 -0
- package/dist/ro-RO-Ic1SzBgx.js +23 -0
- package/dist/{rules-CCnLDGvk.js → rules-Meybz2dk.js} +13 -13
- package/dist/sk-SK-B7o3L57C.js +35 -0
- package/dist/sk-SK-BDKRZ2mM.js +28 -0
- package/dist/sk-SK-BSioQTMW.js +15 -0
- package/dist/sk-SK-CiD0FeLN.js +23 -0
- package/dist/sk-SK-Cjrkrb85.js +55 -0
- package/dist/sk-SK-iO863_t2.js +35 -0
- package/dist/sl-SI-BB0suyr1.js +28 -0
- package/dist/sl-SI-BE_ndzZ2.js +55 -0
- package/dist/sl-SI-BylvpF-X.js +15 -0
- package/dist/sl-SI-C8CMAkD0.js +35 -0
- package/dist/sl-SI-Cth2Qa5T.js +35 -0
- package/dist/sl-SI-MZoDApq9.js +23 -0
- package/dist/solution-payments-DTAuLSWF.js +14 -0
- package/dist/style.css +690 -628
- package/dist/styles-CLV89_hH.js +690 -628
- package/dist/sv-SE-BryiIPVv.js +55 -0
- package/dist/sv-SE-Bwh0wKFk.js +35 -0
- package/dist/sv-SE-DCFSf4Oj.js +23 -0
- package/dist/sv-SE-DYruQSzt.js +28 -0
- package/dist/sv-SE-Dwz1yTrB.js +15 -0
- package/dist/sv-SE-OPOHtqtP.js +35 -0
- package/dist/terminal-1-ewywjFJI.js +18 -0
- package/dist/types/api/idNowProvider/idNowProvider.types.d.ts +1 -2
- package/dist/types/api/idNowProvider/useIdNowProvider.d.ts +4 -8
- package/dist/types/components/BankAccount/forms/BankDocument/BankDocumentRequirements.d.ts +2 -3
- package/dist/types/components/BankAccount/forms/BankDocument/types.d.ts +25 -24
- package/dist/types/components/BankAccount/forms/BankVerification/verification/widget/types.d.ts +10 -10
- package/dist/types/components/BankAccount/forms/PayoutDetails/types.d.ts +2 -2
- package/dist/types/components/BankAccount/pages/PayoutDetailsPage.d.ts +1 -1
- package/dist/types/components/Business/forms/AdditionalInformation/AdditionalInformationMultiform.d.ts +9 -0
- package/dist/types/components/Business/forms/BasicInformation/BasicInformationMultiform.d.ts +10 -0
- package/dist/types/components/Business/forms/BasicInformation/types.d.ts +2 -2
- package/dist/types/components/Business/forms/BusinessDetails/forms.d.ts +14 -2
- package/dist/types/components/Business/forms/BusinessDetails/types.d.ts +5 -3
- package/dist/types/components/Business/forms/BusinessSelection/BusinessInformationCard/BusinessInformationCard.d.ts +3 -2
- package/dist/types/components/Business/forms/BusinessSelection/BusinessSelectionMultiform.d.ts +14 -0
- package/dist/types/components/Business/forms/BusinessSelection/types.d.ts +3 -0
- package/dist/types/components/Business/forms/CompanyStructure/CompanyStructureMultiform.d.ts +4 -0
- package/dist/types/components/Business/forms/forms.types.d.ts +14 -0
- package/dist/types/components/Business/forms/rules.d.ts +26 -8
- package/dist/types/components/Business/mapping/businessDetails/mapLegalEntityToBusinessDetailsSchema.d.ts +2 -1
- package/dist/types/components/Business/mapping/businessDetails/mapOrganizationTypeToCompanyType.d.ts +1 -1
- package/dist/types/components/Business/tasks/BusinessDetailsDropin/businessDetailsStore.d.ts +5 -3
- package/dist/types/components/Business/tasks/BusinessDetailsDropin/types.d.ts +4 -3
- package/dist/types/components/Business/tasks/BusinessDetailsMultiformDropin/BusinessDetailsMultiform.d.ts +18 -0
- package/dist/types/components/Business/tasks/BusinessDetailsMultiformDropin/BusinessDetailsMultiformDropin.d.ts +5 -0
- package/dist/types/components/Business/tasks/BusinessDetailsMultiformDropin/types.d.ts +2 -0
- package/dist/types/components/Business/tasks/BusinessDetailsMultiformDropin/utils.d.ts +21 -0
- package/dist/types/components/Business/tasks/BusinessDetailsMultiformDropin/validate.d.ts +22 -0
- package/dist/types/components/Business/utils/companyTypeMetadata.d.ts +1 -1
- package/dist/types/components/Business/utils/companyUtil.d.ts +3 -3
- package/dist/types/components/BusinessLines/pages/RootBusinessLinesPage.d.ts +5 -0
- package/dist/types/components/BusinessLines/tasks/BusinessLinesDropin.d.ts +5 -0
- package/dist/types/components/BusinessLines/tasks/BusinessLinesGettingStarted/BusinessLinesGettingStarted.d.ts +6 -0
- package/dist/types/components/Contract/tasks/ServiceAgreementDropin/types.d.ts +2 -2
- package/dist/types/components/EFP/mapping/businessFinancingKeyMappings.d.ts +31 -29
- package/dist/types/components/EFP/tasks/BusinessFinancingDropin/BusinessFinancingFinancialInformation.d.ts +0 -1
- package/dist/types/components/EFP/tasks/BusinessFinancingDropin/BusinessFinancingRegisteredAddress.d.ts +1 -0
- package/dist/types/components/EFP/tasks/BusinessFinancingDropin/types.d.ts +28 -19
- package/dist/types/components/EFP/tasks/BusinessFinancingDropin/utils.d.ts +3 -2
- package/dist/types/components/EFP/tasks/BusinessFinancingDropin/validate.d.ts +1 -0
- package/dist/types/components/EFP/tasks/SourceOfFundsDropin/types.d.ts +2 -2
- package/dist/types/components/EmbeddedDropins/BusinessFinancingComponent/utils.d.ts +2 -1
- package/dist/types/components/EmbeddedDropins/OnboardingDropinComponent/DropinComposer/types.d.ts +3 -3
- package/dist/types/components/EmbeddedDropins/OnboardingDropinComponent/DropinComposer/useNavigation.d.ts +5 -5
- package/dist/types/components/EmbeddedDropins/ViewVerificationStatus/ViewVerificationStatusComponent.d.ts +1 -1
- package/dist/types/components/EmbeddedDropins/ViewVerificationStatus/content.d.ts +1 -1
- package/dist/types/components/Individual/fields/DecisionMakerRole/NomineeDecisionMakerRole.d.ts +6 -0
- package/dist/types/components/Individual/fields/DecisionMakerRole/types.d.ts +2 -2
- package/dist/types/components/Individual/forms/Individual/PersonalDetails/types.d.ts +2 -2
- package/dist/types/components/Individual/forms/Individual/PersonalDetails/validate.d.ts +2 -2
- package/dist/types/components/Individual/forms/Individual/ProofOfRelationship/types.d.ts +8 -8
- package/dist/types/components/Individual/forms/Individual/ProofOfResidency/types.d.ts +18 -18
- package/dist/types/components/Individual/forms/Individual/rules.d.ts +1 -1
- package/dist/types/components/Individual/forms/Individual/types.d.ts +2 -2
- package/dist/types/components/Individual/forms/IndividualOnfido/AdditionalPersonalDetails/AdditionalPersonalDetails.types.d.ts +3 -2
- package/dist/types/components/Individual/forms/IndividualOnfido/AdditionalPersonalDetails/validate.d.ts +2 -2
- package/dist/types/components/Individual/forms/IndividualOnfido/BasicDetails/BasicDetails.types.d.ts +2 -2
- package/dist/types/components/Individual/forms/IndividualOnfido/GuidanceQuestion/GuidanceQuestion.d.ts +4 -4
- package/dist/types/components/Individual/forms/IndividualOnfido/IndividualOnfido.rules.d.ts +3 -1
- package/dist/types/components/Individual/forms/IndividualOnfido/IndividualOnfido.types.d.ts +2 -2
- package/dist/types/components/Individual/helpers/isOnfidoAutofillFlowEnabled.d.ts +2 -2
- package/dist/types/components/Individual/helpers/roleUtils.d.ts +1 -1
- package/dist/types/components/Individual/helpers/shouldShowMotionCapture.d.ts +3 -3
- package/dist/types/components/Individual/pages/DecisionMakerDetailsPage.d.ts +1 -1
- package/dist/types/components/Individual/tasks/DecisionMakers/DecisionMakerDetails/DecisionMakerDetails.d.ts +2 -0
- package/dist/types/components/Individual/tasks/DecisionMakers/DecisionMakerDetails/DecisionMakerDetails.types.d.ts +7 -0
- package/dist/types/components/Shared/EntityGuidanceStatus/types.d.ts +4 -4
- package/dist/types/components/Shared/FormFlow/FormFlow.types.d.ts +1 -1
- package/dist/types/components/Shared/Introduction/Introduction.d.ts +2 -2
- package/dist/types/components/Shared/Introduction/IntroductionScreen.d.ts +2 -2
- package/dist/types/components/Shared/Introduction/constants.d.ts +3 -3
- package/dist/types/components/Shared/Introduction/copy.d.ts +6 -5
- package/dist/types/components/Shared/Introduction/types.d.ts +11 -11
- package/dist/types/components/Shared/SingpassBanner/SingpassBanner.d.ts +1 -1
- package/dist/types/components/Shared/fields/BusinessRegistrationNumberField/fieldConfig.d.ts +1 -1
- package/dist/types/components/Shared/fields/BusinessRegistrationNumberField/types.d.ts +2 -2
- package/dist/types/components/Shared/fields/IdFieldTypeSelector/TaxIdNumberTypeSelector.d.ts +2 -2
- package/dist/types/components/Shared/fields/IdFieldTypeSelector/VatNumberTypeSelector.d.ts +2 -2
- package/dist/types/components/Shared/fields/IdFieldTypeSelector/countryIdNumberTypes.d.ts +27 -27
- package/dist/types/components/Shared/fields/IdFieldTypeSelector/getDefaultRegistrationNumberType.d.ts +2 -2
- package/dist/types/components/Shared/fields/IdFieldTypeSelector/getDefaultTaxIdNumberType.d.ts +2 -2
- package/dist/types/components/Shared/fields/IdFieldTypeSelector/inferTaxIdNumberType.d.ts +2 -2
- package/dist/types/components/Shared/fields/TaxInformationField/TaxInformationField.d.ts +1 -1
- package/dist/types/components/Shared/fields/TaxInformationField/fieldConfig.d.ts +3 -3
- package/dist/types/components/Shared/fields/TaxInformationField/types.d.ts +2 -6
- package/dist/types/components/Shared/forms/Address/utils.d.ts +1 -1
- package/dist/types/components/Shared/forms/BusinessTypeSelection/utils.d.ts +2 -2
- package/dist/types/components/Shared/forms/ConstitutionalDocument/types.d.ts +11 -10
- package/dist/types/components/Shared/forms/FinancialInformation/types.d.ts +3 -0
- package/dist/types/components/Shared/forms/RegistrationAddress/types.d.ts +7 -5
- package/dist/types/components/Shared/tasks/TaskList/TaskListItem.d.ts +1 -1
- package/dist/types/components/Shared/tasks/TaskList/types.d.ts +3 -4
- package/dist/types/components/Shared/tasks/TaskList/utils.d.ts +1 -2
- package/dist/types/components/Trust/forms/Trust/rules.d.ts +1 -0
- package/dist/types/components/Trust/forms/Trust/types.d.ts +1 -1
- package/dist/types/components/Trust/forms/TrustRegistrationDetails/types.d.ts +2 -2
- package/dist/types/components/Trust/forms/TrustRoleAndEntityType/types.d.ts +1 -2
- package/dist/types/components/Trust/hooks/useTrustMemberNavigation.hook.d.ts +3 -3
- package/dist/types/components/Trust/pages/TrustDetailsPage.d.ts +1 -1
- package/dist/types/components/Trust/tasks/TrustMembers/CompanyTrustMemberTaskItem.d.ts +1 -1
- package/dist/types/components/Trust/tasks/TrustMembers/ExemptSettlorTaskItem.d.ts +1 -1
- package/dist/types/components/Trust/tasks/TrustMembers/RegularTrustMemberTaskItem.d.ts +1 -1
- package/dist/types/components/Trust/tasks/TrustMembers/RootTrusteeTaskItem.d.ts +1 -1
- package/dist/types/components/Trust/tasks/TrustMembers/types.d.ts +6 -6
- package/dist/types/components/Trust/utils/trustMemberGuidance.d.ts +7 -6
- package/dist/types/components/Trust/utils/trustMemberRequirements.d.ts +1 -1
- package/dist/types/components/UnincorporatedPartnership/hooks/useUnincorporatedPartnershipNavigation.d.ts +6 -6
- package/dist/types/components/UnincorporatedPartnership/tasks/UnincorporatedPartnershipMembers/types.d.ts +5 -5
- package/dist/types/components/UnincorporatedPartnership/tasks/UnincorporatedPartnershipRoleAndType/UnincorporatedPartnershipRadioGroup.d.ts +2 -2
- package/dist/types/components/UnincorporatedPartnership/tasks/UnincorporatedPartnershipRoleAndType/types.d.ts +2 -2
- package/dist/types/components/ui/atoms/ListItem/ListItem.d.ts +16 -0
- package/dist/types/components/ui/atoms/Svg/svgs.d.ts +12 -0
- package/dist/types/components/ui/atoms/TaskStatusIndicator/TaskStatusIndicator.d.ts +1 -1
- package/dist/types/components/ui/layout/LandingLayout/LandingLayout.d.ts +3 -2
- package/dist/types/components/ui/molecules/Alert/VerificationErrorAlert.d.ts +1 -1
- package/dist/types/components/ui/molecules/Alert/types.d.ts +1 -0
- package/dist/types/components/ui/molecules/EmbeddedStatus/EmbeddedStatus.d.ts +1 -1
- package/dist/types/components/ui/molecules/EmbeddedStatus/statusToTag.d.ts +2 -2
- package/dist/types/context/ExperimentContext/types.d.ts +46 -38
- package/dist/types/context/SettingsContext/types.d.ts +24 -24
- package/dist/types/core/models/api/company-types-value.d.ts +12 -11
- package/dist/types/core/models/api/decision-maker-type.d.ts +7 -6
- package/dist/types/core/models/api/entity-type.d.ts +5 -4
- package/dist/types/core/models/api/get-scenarios.d.ts +18 -18
- package/dist/types/core/models/api/individual.d.ts +1 -0
- package/dist/types/core/models/api/legal-entity-association.d.ts +2 -2
- package/dist/types/core/models/api/legal-entity-type.d.ts +8 -7
- package/dist/types/core/models/api/trust-member-type.d.ts +8 -8
- package/dist/types/core/models/api/trusted-fields-provider.d.ts +5 -4
- package/dist/types/core/models/api/unincorporated-partnership.d.ts +6 -6
- package/dist/types/core/models/api/verification-error.d.ts +8 -7
- package/dist/types/core/models/api/verification-status.d.ts +7 -6
- package/dist/types/core/models/api/view-verification-status.d.ts +8 -7
- package/dist/types/hooks/introduction/useIntroductionScreens.d.ts +4 -4
- package/dist/types/hooks/singpass/useSingpassMyInfoLogin.d.ts +7 -6
- package/dist/types/hooks/useBusinessSetup.d.ts +11 -10
- package/dist/types/hooks/useDataMissingRemediations.d.ts +2 -2
- package/dist/types/hooks/useFormComposer.d.ts +1 -1
- package/dist/types/hooks/useLegalCompanyNameField/useLegalCompanyNameField.d.ts +6 -3
- package/dist/types/hooks/useLegalEntityType.d.ts +1 -1
- package/dist/types/hooks/useMultiForm/types.d.ts +2 -2
- package/dist/types/hooks/useScenarioConfiguration.d.ts +2 -2
- package/dist/types/language/types.d.ts +2 -0
- package/dist/types/stores/globalStore/calculateTaskStatus.d.ts +2 -2
- package/dist/types/stores/globalStore/determineTaskIdentifiers.d.ts +2 -2
- package/dist/types/stores/globalStore/get-task-status.d.ts +2 -2
- package/dist/types/stores/globalStore/globalStore.d.ts +7 -7
- package/dist/types/stores/globalStore/taskStatus.d.ts +17 -16
- package/dist/types/stores/globalStore/taskTypes.d.ts +37 -35
- package/dist/types/types/datasets/currency.d.ts +25 -25
- package/dist/types/types/datasets/province-code.d.ts +46 -46
- package/dist/types/types/datasets/state-code.d.ts +84 -84
- package/dist/types/types/errors/entity-problems.d.ts +3 -4
- package/dist/types/types/form-rules.d.ts +2 -2
- package/dist/types/utils/api/processValidationErrors.d.ts +2 -2
- package/dist/types/utils/birthDateUtils.d.ts +3 -3
- package/dist/types/utils/decisionMaker.d.ts +4 -3
- package/dist/types/utils/decisionMakerRoles.d.ts +4 -3
- package/dist/types/utils/entityAssociationUtil.d.ts +3 -3
- package/dist/types/utils/entityStatusUtil.d.ts +3 -3
- package/dist/types/utils/formUtils.d.ts +2 -2
- package/dist/types/utils/regex/patternValidators.d.ts +1 -0
- package/dist/types/utils/roleMetadata.d.ts +3 -3
- package/dist/types/utils/translation.d.ts +40 -0
- package/dist/{useMultiForm-KQwxav4F.js → useMultiForm-BQmE_nfY.js} +2 -2
- package/dist/{useOnboardingStatus-BMyj9Pwn.js → useOnboardingStatus-DJdV6bAG.js} +2 -2
- package/dist/{useTermsOfServiceStatus-CBHKWYSb.js → useTermsOfServiceStatus-BX4GiDbz.js} +2 -2
- package/dist/{useUpdateLegalEntity-D8dw9Oc3.js → useUpdateLegalEntity-BfnvHQJj.js} +2 -2
- package/dist/{utils-CL9qlD-O.js → utils-1zLleVnu.js} +17 -17
- package/dist/{validate-CuwYJGc9.js → validate-BweJRQFE.js} +9 -3
- package/dist/{validate-CeF0YKvL.js → validate-Cy6vBhF2.js} +2 -2
- package/dist/view-verification-status-VFcBydkR.js +21 -0
- package/package.json +7 -32
- package/dist/LandingLayout-B45lEjOv.js +0 -84
- package/dist/ManagePCIComponent-BgdGfAuT.js +0 -33
- package/dist/RootBusinessDetailsPage-q_6wAcer.js +0 -42
- package/dist/adyen-manage-pci.js +0 -48
- package/dist/adyen-sign-pci.js +0 -55
- package/dist/adyen-terms-of-service.vue_vue_type_script_lang-BD4hndWg.js +0 -42
- package/dist/adyen-transfer-instrument.vue_vue_type_script_lang-DQBzahGy.js +0 -57
- package/dist/bg-BG-HpLj_LOM.js +0 -16
- package/dist/cs-CZ-CQ_M3lEp.js +0 -16
- package/dist/css-BJGWcW8A.js +0 -24
- package/dist/da-DK-k4JW3iVF.js +0 -16
- package/dist/de-DE-C7mjtS5w.js +0 -16
- package/dist/el-GR-CEQrkYHW.js +0 -16
- package/dist/en-US-DDagIr01.js +0 -16
- package/dist/es-ES-DB1c74Kv.js +0 -16
- package/dist/et-EE-xIegUSuv.js +0 -16
- package/dist/fi-FI-NCxneAqU.js +0 -16
- package/dist/fr-FR-daiUnUwo.js +0 -16
- package/dist/hr-HR-BAUywqDj.js +0 -16
- package/dist/hu-HU-3GQojIHR.js +0 -16
- package/dist/it-IT-pDWPFHEh.js +0 -16
- package/dist/ja-JP-scPXJ93L.js +0 -16
- package/dist/json-Dk6RRAV8.js +0 -31
- package/dist/lt-LT-BcGNy8Ti.js +0 -16
- package/dist/lv-LV-CBD07r1Y.js +0 -16
- package/dist/nl-NL-BxJUDHMK.js +0 -16
- package/dist/no-NO-Drup6Jyy.js +0 -16
- package/dist/pl-PL-BXv8Mmzb.js +0 -16
- package/dist/preact/adyen-individual.js +0 -15
- package/dist/preact/adyen-manage-individual.js +0 -15
- package/dist/preact/adyen-terms-of-service.js +0 -16
- package/dist/preact/adyen-transfer-instrument.js +0 -16
- package/dist/pt-PT-D8nU-UM2.js +0 -16
- package/dist/ro-RO-CG33OwqS.js +0 -16
- package/dist/sk-SK-DV_xkO69.js +0 -16
- package/dist/sl-SI-B5yeoadY.js +0 -16
- package/dist/sv-SE-CfxyR53r.js +0 -16
- package/dist/types/components/Individual/forms/IndividualOnfido/IdVerificationMethod/IdVerificationDisclaimer/IdVerificationDisclaimer.d.ts +0 -1
- package/dist/types/components/Individual/forms/IndividualOnfido/IdVerificationMethod/IdVerificationHeader/IdVerificationHeader.d.ts +0 -1
- package/dist/types/embeds/individual/AdyenIndividualPreact.d.ts +0 -3
- package/dist/types/embeds/manage-individual/AdyenManageIndividualPreact.d.ts +0 -3
- package/dist/types/embeds/manage-pci/AdyenManagePci.d.ts +0 -12
- package/dist/types/embeds/manage-pci/adyen-manage-pci.d.ts +0 -1
- package/dist/types/embeds/manage-pci/adyen-manage-pci.types.d.ts +0 -39
- package/dist/types/embeds/sign-pci/AdyenSignPci.d.ts +0 -14
- package/dist/types/embeds/sign-pci/adyen-sign-pci.d.ts +0 -1
- package/dist/types/embeds/sign-pci/adyen-sign-pci.types.d.ts +0 -45
- package/dist/types/embeds/terms-of-service/AdyenTermsOfServicePreact.d.ts +0 -3
- package/dist/types/embeds/transfer-instrument/AdyenTransferInstrumentPreact.d.ts +0 -3
- package/dist/useSalesChannelsSettings-43TfSoxc.js +0 -51
- package/dist/view-verification-status-DTkA8PtO.js +0 -20
- package/dist/vue/adyen-individual.js +0 -53
- package/dist/vue/adyen-manage-individual.js +0 -56
- package/dist/vue/adyen-terms-of-service.js +0 -28
- package/dist/vue/adyen-transfer-instrument.js +0 -31
- package/dist/yaml-CBkrSAtc.js +0 -22
|
@@ -0,0 +1,1848 @@
|
|
|
1
|
+
;
|
|
2
|
+
{
|
|
3
|
+
try {
|
|
4
|
+
let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
5
|
+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "18245b12-91ae-415d-af15-d3753e0eef1f", e._sentryDebugIdIdentifier = "sentry-dbid-18245b12-91ae-415d-af15-d3753e0eef1f");
|
|
6
|
+
} catch (e) {
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
;
|
|
10
|
+
import { jsxs, jsx } from "preact/jsx-runtime";
|
|
11
|
+
import { c as useTranslation, bK as useFormContext, aa as useExperimentsContext, dT as verifiedBusiness, bL as getAddressSchemaForCountry, bM as COUNTRIES_WITH_STATES_DATASET, dU as useDebouncedState, dV as useAddressCleanse, dW as formatAddressForCleanse, dX as mapAddressData, dY as operationalAddressIsSameIds, au as mergeFieldMetadataIntoProps, dZ as legalFormFieldMetadata, d_ as stockTickerSymbolFieldMetadata, d$ as stockISINFieldMetadata, e0 as stockExchangeMICFieldMetadata, e1 as dateOfIncorporationFieldMetadata, e2 as eInvoicingCodeFieldMetadata, e3 as vatAbsenceReasonMetadata, av as resolveFieldMetadata, e4 as defaultFieldMetadata, e5 as defaultFieldConfig, cb as taxInformationDefaultFieldMetadata, cc as taxInformationDefaultFieldConfig, e6 as registrationNumberDefaultFieldMetadata, e7 as registrationNumberDefaultFieldConfig, e8 as doingBusinessAsFieldMetadata, e9 as doingBusinessAsAbsentFieldMetadata, aC as createFormUtils, ba as datasetUtilities, F as FormHeader, aB as ErrorPanel, N as Typography, ea as VerifiedBusinessCard, eb as LEGAL_FORM_FIELDS, bC as LegalFormField, ec as DBA_NAME_FIELD, ed as DBANameField, ee as BUSINESS_REGISTRATION_NUMBER_FIELD, ef as BusinessRegistrationNumberField, eg as TAX_INFORMATION_FIELD, d6 as TaxInformationField, eh as VAT_NUMBER_FIELD, ei as VatNumberField, ej as EInvoicingCodeField, ek as EINVOICING_CODE_FIELD, el as DATE_OF_INCORPORATION_FIELD, em as DateOfIncorporationField, en as STOCK_EXCHANGE_MIC_FIELD, eo as StockExchangeMICField, ep as STOCK_ISIN_FIELD, eq as StockISINField, er as STOCK_TICKER_SYMBOL_FIELD, es as StockTickerSymbolField, bN as Address, et as getNestedTrustedFields, bO as getAddressSchemaLabelsByCountry, eu as ADDITIONAL_INFORMATION_FORM_ID, aD as Field, bv as Checkbox, Y as CompanyTypesValues, v as useSettingsContext, b as useAllowedCountries, w as SettingNames, ev as localizedLegalCompanyNameFieldConfig, ew as defaultFieldMetadata$1, ex as defaultFieldConfig$1, ey as defaultFieldMetadataV4, aw as defaultFieldMetadata$2, ez as defaultFieldConfigV4, ax as defaultFieldConfig$2, eA as useLegalCompanyNameField, aJ as CountryField, aK as COUNTRY_FIELD, eB as COUNTRY_OF_GOVERNING_LAW_FIELD, eC as CountryOfGoverningLawField, bE as InputText, eD as STATE_FIELD, eE as StateField, bD as Link, aM as LEGAL_COMPANY_NAME_FIELD, X as useAccountHolder, eF as isBankAccountRequestedForOrganization, eG as companyTypeOptions, eH as useCompanyTypeExamples, dQ as EntityTypeRadioGroupCard, eI as companyTypeMetadata, u as useI18nContext, $ as TaskTypes, eJ as FinancialInformation, eK as MemoizedConstitutionalDocument, O as LegalEntityTypes, dw as MemoizedDocumentUpload, eL as BusinessSelectionMultiform, eM as COUNTRIES_USING_COMPANY_SEARCH, aP as summaryStep, bR as addValidityToForms, eN as exemptFromRegistrationNumberDefaultFieldMetadata, eO as CountryOfGoverningLawFieldValidation, eP as CountryFieldValidation, a as useApiContext, a3 as useAnalyticsContext, a9 as useToastContext, br as useQueryClient, eQ as getForms, cp as documentApiUtils, cD as composePerScenarioFormConfigurations, cx as useScenarioConfiguration, eR as financialInfoValidationWithEmployeesRules, eS as CompanyStructureValidation, eT as tinMatched, eU as rules, cy as getPropsFromConfigurations, bP as getAssociatedLeAnalyticsPayload, bT as trackNavigation, bS as useFormComposer, eV as useCompanySearch, eW as useVerifyTin, eX as businessMismatchModalOpen, bi as Confirm, eY as businessDetailsDocumentMapping, eZ as businessDetailsApiKeyMapping, d as useLegalEntity, R as ROOT_LE, af as useCapabilityProblems, L as Loader, P as isPartOfTrustFromLegalEntity, b5 as getProblemsForEntity, Z as EntityTypes, g as getLegalEntityCountry } from "./StoreProvider-O9jwxfG8.js";
|
|
12
|
+
import { P as ProofOfOwnershipDocument, a as ProofOfSignatoryDocument, b as ProofOfDirectorDocument, R as RegistrationDocument, T as TaxDocument, m as mapApiDocumentToBusinessDetailsDocuments, c as mapLegalEntityToBusinessDetailsSchema, f as formatDataForSummary, s as submit, d as businessDetailsFieldsPerScenario, B as BusinessDetailsDropin } from "./BusinessDetailsDropin-Dr580mIQ.js";
|
|
13
|
+
import { useEffect, useMemo, useCallback, useState } from "preact/hooks";
|
|
14
|
+
import { u as useCreateLegalEntity, a as useUpdateLegalEntity } from "./useUpdateLegalEntity-BfnvHQJj.js";
|
|
15
|
+
import { F as FormContextProvider, a as FormFlow } from "./FormFlow-CNXkXUwa.js";
|
|
16
|
+
import { u as useMultiForm } from "./useMultiForm-BQmE_nfY.js";
|
|
17
|
+
import { g as getFieldsWithExistingData } from "./getFieldsWithExistingData-7pZnHro-.js";
|
|
18
|
+
function AdditionalInformationMultiform({
|
|
19
|
+
id,
|
|
20
|
+
country,
|
|
21
|
+
companyType,
|
|
22
|
+
shouldValidate,
|
|
23
|
+
heading = "additionalInformationFormHeading",
|
|
24
|
+
description,
|
|
25
|
+
validationErrors = {},
|
|
26
|
+
verificationErrors = {}
|
|
27
|
+
}) {
|
|
28
|
+
const { t, i18n } = useTranslation(["business", "common"]);
|
|
29
|
+
const { form } = useFormContext();
|
|
30
|
+
const { isExperimentEnabled } = useExperimentsContext();
|
|
31
|
+
const verifiedBusiness$1 = verifiedBusiness.value;
|
|
32
|
+
const showVerified = !!verifiedBusiness$1;
|
|
33
|
+
const showStockData = companyType === CompanyTypesValues.PUBLIC_COMPANY;
|
|
34
|
+
const addressSchema = getAddressSchemaForCountry(country).filter(
|
|
35
|
+
(field) => !COUNTRIES_WITH_STATES_DATASET.includes(country) ? field !== "stateOrProvince" : true
|
|
36
|
+
);
|
|
37
|
+
const currentCountryTaxInformation = form.data?.additionalInformation?.taxInformation?.find(
|
|
38
|
+
(taxId) => taxId.country === country
|
|
39
|
+
);
|
|
40
|
+
const [addressToCheck, setAddressToCheck] = useDebouncedState(500);
|
|
41
|
+
const { data: cleansedRegistrationAddress } = useAddressCleanse(
|
|
42
|
+
{
|
|
43
|
+
text: addressToCheck,
|
|
44
|
+
country
|
|
45
|
+
},
|
|
46
|
+
{ enabled: Boolean(addressToCheck) }
|
|
47
|
+
);
|
|
48
|
+
const mustProvideOperationalAddress = cleansedRegistrationAddress?.poBox ?? false;
|
|
49
|
+
useEffect(
|
|
50
|
+
() => setAddressToCheck(
|
|
51
|
+
formatAddressForCleanse(form.data?.additionalInformation?.registrationAddress ?? {})
|
|
52
|
+
),
|
|
53
|
+
[form.data?.additionalInformation?.registrationAddress, setAddressToCheck]
|
|
54
|
+
);
|
|
55
|
+
const verifiedAddress = useMemo(() => {
|
|
56
|
+
if (!verifiedBusiness$1) return void 0;
|
|
57
|
+
return verifiedBusiness$1.isPrincipalAddress || verifiedBusiness$1.state && form.data?.basicInformation?.stateOrProvince !== verifiedBusiness$1.state ? { operationalAddress: { ...mapAddressData(verifiedBusiness$1), country } } : {
|
|
58
|
+
registrationAddress: {
|
|
59
|
+
...mapAddressData(verifiedBusiness$1),
|
|
60
|
+
country,
|
|
61
|
+
stateOrProvince: form.data?.basicInformation?.stateOrProvince
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
}, [verifiedBusiness$1, form.data?.basicInformation?.stateOrProvince, country]);
|
|
65
|
+
const handleChangeFor = useCallback(
|
|
66
|
+
(fieldName, mode) => form.handleChangeFor(fieldName, "additionalInformation", mode),
|
|
67
|
+
[form]
|
|
68
|
+
);
|
|
69
|
+
const handleRegistrationAddressChange = (state) => {
|
|
70
|
+
handleChangeFor("registrationAddress")(state.data);
|
|
71
|
+
form.setValid("registrationAddress", Boolean(state.isValid), "additionalInformation");
|
|
72
|
+
};
|
|
73
|
+
const handleOperationalAddressChange = (state) => {
|
|
74
|
+
handleChangeFor("operationalAddress")(state.data);
|
|
75
|
+
form.setValid("operationalAddress", Boolean(state.isValid), "additionalInformation");
|
|
76
|
+
};
|
|
77
|
+
const handleOperationalAddressIsSameChange = useCallback(
|
|
78
|
+
(isChecked) => {
|
|
79
|
+
if (isChecked) {
|
|
80
|
+
handleChangeFor("operationalAddressIsSame")(
|
|
81
|
+
operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_SAME
|
|
82
|
+
);
|
|
83
|
+
form.setValid("operationalAddress", true, "additionalInformation");
|
|
84
|
+
} else {
|
|
85
|
+
handleChangeFor("operationalAddressIsSame")(
|
|
86
|
+
operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
[form, handleChangeFor]
|
|
91
|
+
);
|
|
92
|
+
useEffect(() => {
|
|
93
|
+
if (mustProvideOperationalAddress && form.data?.additionalInformation?.operationalAddressIsSame !== operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME) {
|
|
94
|
+
handleOperationalAddressIsSameChange(false);
|
|
95
|
+
}
|
|
96
|
+
}, [
|
|
97
|
+
handleOperationalAddressIsSameChange,
|
|
98
|
+
mustProvideOperationalAddress,
|
|
99
|
+
form.data?.additionalInformation?.operationalAddressIsSame
|
|
100
|
+
]);
|
|
101
|
+
const formUtils = useMemo(() => {
|
|
102
|
+
const initialProps = {
|
|
103
|
+
data: form.data?.additionalInformation ?? {},
|
|
104
|
+
fieldValidationErrors: validationErrors,
|
|
105
|
+
formVerificationErrors: verificationErrors,
|
|
106
|
+
allFields: form.allFields?.additionalInformation ?? [],
|
|
107
|
+
requiredFields: form.requiredFields?.additionalInformation ?? [],
|
|
108
|
+
optionalFields: form.optionalFields?.additionalInformation ?? [],
|
|
109
|
+
trustedFields: form.trustedFields?.additionalInformation ?? [],
|
|
110
|
+
obscuredFields: form.obscuredFields?.additionalInformation ?? [],
|
|
111
|
+
errors: form.errors?.additionalInformation ?? {},
|
|
112
|
+
valid: form.valid?.additionalInformation ?? {},
|
|
113
|
+
handleFieldChange: handleChangeFor
|
|
114
|
+
};
|
|
115
|
+
const formUtilProps = initialProps.allFields?.reduce((acc, field) => {
|
|
116
|
+
switch (field) {
|
|
117
|
+
case "hasDoingBusinessAs":
|
|
118
|
+
return mergeFieldMetadataIntoProps(
|
|
119
|
+
"hasDoingBusinessAs",
|
|
120
|
+
doingBusinessAsAbsentFieldMetadata,
|
|
121
|
+
acc
|
|
122
|
+
);
|
|
123
|
+
case "doingBusinessAs":
|
|
124
|
+
return mergeFieldMetadataIntoProps("doingBusinessAs", doingBusinessAsFieldMetadata, acc);
|
|
125
|
+
case "registrationNumber":
|
|
126
|
+
return mergeFieldMetadataIntoProps(
|
|
127
|
+
field,
|
|
128
|
+
resolveFieldMetadata(
|
|
129
|
+
registrationNumberDefaultFieldConfig[country],
|
|
130
|
+
{
|
|
131
|
+
companyType,
|
|
132
|
+
registrationNumberType: form.data?.additionalInformation?.registrationNumberType,
|
|
133
|
+
isExperimentEnabled
|
|
134
|
+
},
|
|
135
|
+
registrationNumberDefaultFieldMetadata
|
|
136
|
+
),
|
|
137
|
+
acc
|
|
138
|
+
);
|
|
139
|
+
case "taxInformation":
|
|
140
|
+
return mergeFieldMetadataIntoProps(
|
|
141
|
+
field,
|
|
142
|
+
resolveFieldMetadata(
|
|
143
|
+
taxInformationDefaultFieldConfig[country],
|
|
144
|
+
{
|
|
145
|
+
taxIdNumberType: currentCountryTaxInformation?.type,
|
|
146
|
+
companyType
|
|
147
|
+
},
|
|
148
|
+
taxInformationDefaultFieldMetadata
|
|
149
|
+
),
|
|
150
|
+
acc
|
|
151
|
+
);
|
|
152
|
+
case "vatNumber":
|
|
153
|
+
return mergeFieldMetadataIntoProps(
|
|
154
|
+
field,
|
|
155
|
+
resolveFieldMetadata(
|
|
156
|
+
defaultFieldConfig[country],
|
|
157
|
+
{ vatNumberType: form.data?.additionalInformation?.vatNumberType },
|
|
158
|
+
defaultFieldMetadata
|
|
159
|
+
),
|
|
160
|
+
acc
|
|
161
|
+
);
|
|
162
|
+
case "vatAbsenceReason":
|
|
163
|
+
return mergeFieldMetadataIntoProps("vatAbsenceReason", vatAbsenceReasonMetadata, acc);
|
|
164
|
+
case "eInvoicingCode":
|
|
165
|
+
return mergeFieldMetadataIntoProps("eInvoicingCode", eInvoicingCodeFieldMetadata, acc);
|
|
166
|
+
case "dateOfIncorporation":
|
|
167
|
+
return mergeFieldMetadataIntoProps(
|
|
168
|
+
"dateOfIncorporation",
|
|
169
|
+
dateOfIncorporationFieldMetadata,
|
|
170
|
+
acc
|
|
171
|
+
);
|
|
172
|
+
case "stockExchangeMIC":
|
|
173
|
+
return mergeFieldMetadataIntoProps(
|
|
174
|
+
"stockExchangeMIC",
|
|
175
|
+
stockExchangeMICFieldMetadata,
|
|
176
|
+
acc
|
|
177
|
+
);
|
|
178
|
+
case "stockISIN":
|
|
179
|
+
return mergeFieldMetadataIntoProps("stockISIN", stockISINFieldMetadata, acc);
|
|
180
|
+
case "stockTickerSymbol":
|
|
181
|
+
return mergeFieldMetadataIntoProps(
|
|
182
|
+
"stockTickerSymbol",
|
|
183
|
+
stockTickerSymbolFieldMetadata,
|
|
184
|
+
acc
|
|
185
|
+
);
|
|
186
|
+
case "legalForm":
|
|
187
|
+
return mergeFieldMetadataIntoProps("legalForm", legalFormFieldMetadata, acc);
|
|
188
|
+
default:
|
|
189
|
+
return acc;
|
|
190
|
+
}
|
|
191
|
+
}, initialProps);
|
|
192
|
+
return createFormUtils(formUtilProps ?? initialProps, i18n.t);
|
|
193
|
+
}, [
|
|
194
|
+
companyType,
|
|
195
|
+
country,
|
|
196
|
+
currentCountryTaxInformation?.type,
|
|
197
|
+
form.allFields?.additionalInformation,
|
|
198
|
+
form.data?.additionalInformation,
|
|
199
|
+
form.errors?.additionalInformation,
|
|
200
|
+
form.obscuredFields?.additionalInformation,
|
|
201
|
+
form.optionalFields?.additionalInformation,
|
|
202
|
+
form.requiredFields?.additionalInformation,
|
|
203
|
+
form.trustedFields?.additionalInformation,
|
|
204
|
+
form.valid?.additionalInformation,
|
|
205
|
+
handleChangeFor,
|
|
206
|
+
i18n.t,
|
|
207
|
+
isExperimentEnabled,
|
|
208
|
+
validationErrors,
|
|
209
|
+
verificationErrors
|
|
210
|
+
]);
|
|
211
|
+
const showField = (fieldKeys) => fieldKeys.some((field) => formUtils.isRequiredField(field) || formUtils.isOptionalField(field));
|
|
212
|
+
const datasetUtils = datasetUtilities(i18n.language);
|
|
213
|
+
const registrationAddressDescription = useMemo(() => {
|
|
214
|
+
if (country) {
|
|
215
|
+
return ["US", "NL", "CZ"].includes(country) ? t(($) => $["youBusinessOfficalAddressInTheCounty"], {
|
|
216
|
+
country: datasetUtils.getCountryName(country)
|
|
217
|
+
}) : t(($) => $["youBusinessOfficalAddressInCounty"], {
|
|
218
|
+
country: datasetUtils.getCountryName(country)
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
return t(($) => $["youBusinessOfficalAddress"]);
|
|
222
|
+
}, [country, datasetUtils, t]);
|
|
223
|
+
return /* @__PURE__ */ jsxs("form", { id, className: "adyen-kyc-additional-information", children: [
|
|
224
|
+
/* @__PURE__ */ jsx(
|
|
225
|
+
FormHeader,
|
|
226
|
+
{
|
|
227
|
+
heading: t(($) => $[heading], { ns: "common" }),
|
|
228
|
+
description: description ? t(($) => $[description], { ns: "common" }) : void 0
|
|
229
|
+
}
|
|
230
|
+
),
|
|
231
|
+
/* @__PURE__ */ jsx(
|
|
232
|
+
ErrorPanel,
|
|
233
|
+
{
|
|
234
|
+
id: "ariaErrorField",
|
|
235
|
+
verificationErrors,
|
|
236
|
+
validationErrors,
|
|
237
|
+
formUtils
|
|
238
|
+
}
|
|
239
|
+
),
|
|
240
|
+
/* @__PURE__ */ jsxs("div", { className: "adyen-kyc-additional-information__content", children: [
|
|
241
|
+
showVerified && /* @__PURE__ */ jsxs("section", { children: [
|
|
242
|
+
/* @__PURE__ */ jsx("div", { className: "adyen-kyc-additional-information__section-heading", children: /* @__PURE__ */ jsx(Typography, { el: "h3", variant: "title", children: t(($) => $["verifiedInformation"]) }) }),
|
|
243
|
+
/* @__PURE__ */ jsx(
|
|
244
|
+
VerifiedBusinessCard,
|
|
245
|
+
{
|
|
246
|
+
verifiedBusiness: verifiedBusiness$1,
|
|
247
|
+
verifiedAddress: verifiedAddress?.registrationAddress ?? verifiedAddress?.operationalAddress
|
|
248
|
+
}
|
|
249
|
+
)
|
|
250
|
+
] }),
|
|
251
|
+
/* @__PURE__ */ jsxs("section", { children: [
|
|
252
|
+
showVerified && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-additional-information__section-heading", children: /* @__PURE__ */ jsx(Typography, { el: "h3", variant: "title", children: t(($) => $["otherBusinessInformation"]) }) }),
|
|
253
|
+
/* @__PURE__ */ jsxs("fieldset", { children: [
|
|
254
|
+
showField(LEGAL_FORM_FIELDS) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
|
|
255
|
+
LegalFormField,
|
|
256
|
+
{
|
|
257
|
+
name: "legalForm",
|
|
258
|
+
countryCode: country,
|
|
259
|
+
data: {
|
|
260
|
+
legalForm: formUtils.getFieldData(
|
|
261
|
+
form.data?.additionalInformation ?? {},
|
|
262
|
+
LEGAL_FORM_FIELDS
|
|
263
|
+
)?.legalForm
|
|
264
|
+
},
|
|
265
|
+
valid: formUtils.getFieldValid(
|
|
266
|
+
form.valid?.additionalInformation ?? {},
|
|
267
|
+
LEGAL_FORM_FIELDS
|
|
268
|
+
),
|
|
269
|
+
errorMessage: form.errors.additionalInformation?.legalForm?.errorMessage,
|
|
270
|
+
handleChangeFor,
|
|
271
|
+
readonly: false,
|
|
272
|
+
label: formUtils.getLabel("legalForm", "businessStructure")
|
|
273
|
+
}
|
|
274
|
+
) }),
|
|
275
|
+
showField(DBA_NAME_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
|
|
276
|
+
DBANameField,
|
|
277
|
+
{
|
|
278
|
+
data: formUtils.getFieldData(
|
|
279
|
+
form.data?.additionalInformation ?? {},
|
|
280
|
+
DBA_NAME_FIELD
|
|
281
|
+
),
|
|
282
|
+
valid: formUtils.getFieldValid(
|
|
283
|
+
form.valid?.additionalInformation ?? {},
|
|
284
|
+
DBA_NAME_FIELD
|
|
285
|
+
),
|
|
286
|
+
errors: formUtils.getFieldErrors(
|
|
287
|
+
form.errors?.additionalInformation ?? {},
|
|
288
|
+
validationErrors,
|
|
289
|
+
DBA_NAME_FIELD
|
|
290
|
+
),
|
|
291
|
+
labels: formUtils.getFieldLabels(DBA_NAME_FIELD, {
|
|
292
|
+
hasDoingBusinessAs: "hasDba"
|
|
293
|
+
}),
|
|
294
|
+
readonly: formUtils.isReadOnly("doingBusinessAs"),
|
|
295
|
+
handleChangeFor
|
|
296
|
+
}
|
|
297
|
+
) }),
|
|
298
|
+
showField(BUSINESS_REGISTRATION_NUMBER_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
|
|
299
|
+
BusinessRegistrationNumberField,
|
|
300
|
+
{
|
|
301
|
+
data: formUtils.getFieldData(
|
|
302
|
+
form.data?.additionalInformation ?? {},
|
|
303
|
+
BUSINESS_REGISTRATION_NUMBER_FIELD
|
|
304
|
+
),
|
|
305
|
+
valid: formUtils.getFieldValid(
|
|
306
|
+
form.valid?.additionalInformation ?? {},
|
|
307
|
+
BUSINESS_REGISTRATION_NUMBER_FIELD
|
|
308
|
+
),
|
|
309
|
+
errors: formUtils.getFieldErrors(
|
|
310
|
+
form.errors?.additionalInformation ?? {},
|
|
311
|
+
validationErrors,
|
|
312
|
+
BUSINESS_REGISTRATION_NUMBER_FIELD
|
|
313
|
+
),
|
|
314
|
+
labels: formUtils.getFieldLabels(BUSINESS_REGISTRATION_NUMBER_FIELD, {
|
|
315
|
+
exemptedFromRegistrationNumber: "iDontHaveARegistrationNumber"
|
|
316
|
+
}),
|
|
317
|
+
mask: formUtils.getMask("registrationNumber"),
|
|
318
|
+
guidanceText: formUtils.getFieldGuidanceText(BUSINESS_REGISTRATION_NUMBER_FIELD),
|
|
319
|
+
placeholders: formUtils.getFieldPlaceholders(BUSINESS_REGISTRATION_NUMBER_FIELD),
|
|
320
|
+
helperText: formUtils.getFieldHelperText(BUSINESS_REGISTRATION_NUMBER_FIELD),
|
|
321
|
+
readonly: formUtils.isReadOnly("registrationNumber"),
|
|
322
|
+
optional: formUtils.isOptionalField("registrationNumber"),
|
|
323
|
+
shouldValidate,
|
|
324
|
+
handleChangeFor,
|
|
325
|
+
country,
|
|
326
|
+
canExempt: showField(["exemptedFromRegistrationNumber"]),
|
|
327
|
+
companyType
|
|
328
|
+
}
|
|
329
|
+
) }),
|
|
330
|
+
showField(TAX_INFORMATION_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
|
|
331
|
+
TaxInformationField,
|
|
332
|
+
{
|
|
333
|
+
data: formUtils.getFieldData(
|
|
334
|
+
form.data?.additionalInformation ?? {},
|
|
335
|
+
TAX_INFORMATION_FIELD
|
|
336
|
+
),
|
|
337
|
+
valid: formUtils.getFieldValid(
|
|
338
|
+
form.valid?.additionalInformation ?? {},
|
|
339
|
+
TAX_INFORMATION_FIELD
|
|
340
|
+
),
|
|
341
|
+
errors: formUtils.getFieldErrors(
|
|
342
|
+
form.errors?.additionalInformation ?? {},
|
|
343
|
+
validationErrors,
|
|
344
|
+
TAX_INFORMATION_FIELD
|
|
345
|
+
),
|
|
346
|
+
labels: formUtils.getFieldLabels(TAX_INFORMATION_FIELD, {
|
|
347
|
+
exemptedFromTax: "iDontHaveATaxId"
|
|
348
|
+
}),
|
|
349
|
+
mask: formUtils.getMask("taxInformation"),
|
|
350
|
+
guidanceText: formUtils.getFieldGuidanceText(TAX_INFORMATION_FIELD),
|
|
351
|
+
readonly: formUtils.isReadOnly("taxInformation"),
|
|
352
|
+
shouldValidate,
|
|
353
|
+
handleChangeFor,
|
|
354
|
+
canExempt: showField(["exemptedFromTax"]),
|
|
355
|
+
country,
|
|
356
|
+
entityType: companyType,
|
|
357
|
+
defaultData: form.defaultData?.additionalInformation?.taxInformation,
|
|
358
|
+
registrationNumber: form.data?.additionalInformation?.registrationNumber
|
|
359
|
+
}
|
|
360
|
+
) }),
|
|
361
|
+
showField(VAT_NUMBER_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
|
|
362
|
+
VatNumberField,
|
|
363
|
+
{
|
|
364
|
+
data: formUtils.getFieldData(
|
|
365
|
+
form.data?.additionalInformation ?? {},
|
|
366
|
+
VAT_NUMBER_FIELD
|
|
367
|
+
),
|
|
368
|
+
valid: formUtils.getFieldValid(
|
|
369
|
+
form.valid?.additionalInformation ?? {},
|
|
370
|
+
VAT_NUMBER_FIELD
|
|
371
|
+
),
|
|
372
|
+
errors: formUtils.getFieldErrors(
|
|
373
|
+
form.errors?.additionalInformation ?? {},
|
|
374
|
+
validationErrors,
|
|
375
|
+
VAT_NUMBER_FIELD
|
|
376
|
+
),
|
|
377
|
+
labels: formUtils.getFieldLabels(VAT_NUMBER_FIELD, {
|
|
378
|
+
exemptedFromVat: "iDontHaveAVatNumber"
|
|
379
|
+
}),
|
|
380
|
+
mask: formUtils.getMask("vatNumber"),
|
|
381
|
+
guidanceText: formUtils.getFieldGuidanceText(VAT_NUMBER_FIELD),
|
|
382
|
+
placeholders: formUtils.getFieldPlaceholders(VAT_NUMBER_FIELD),
|
|
383
|
+
readonly: formUtils.isReadOnly("vatNumber"),
|
|
384
|
+
handleChangeFor,
|
|
385
|
+
country,
|
|
386
|
+
canExempt: showField(["exemptedFromVat"]),
|
|
387
|
+
shouldValidate
|
|
388
|
+
}
|
|
389
|
+
) }),
|
|
390
|
+
formUtils.isRequiredField("eInvoicingCode", false) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
|
|
391
|
+
EInvoicingCodeField,
|
|
392
|
+
{
|
|
393
|
+
data: formUtils.getFieldData(
|
|
394
|
+
form.data?.additionalInformation ?? {},
|
|
395
|
+
EINVOICING_CODE_FIELD
|
|
396
|
+
),
|
|
397
|
+
valid: formUtils.getFieldValid(
|
|
398
|
+
form.valid?.additionalInformation ?? {},
|
|
399
|
+
EINVOICING_CODE_FIELD
|
|
400
|
+
),
|
|
401
|
+
errors: formUtils.getFieldErrors(
|
|
402
|
+
form.errors?.additionalInformation ?? {},
|
|
403
|
+
validationErrors,
|
|
404
|
+
EINVOICING_CODE_FIELD
|
|
405
|
+
),
|
|
406
|
+
labels: formUtils.getFieldLabels(EINVOICING_CODE_FIELD),
|
|
407
|
+
placeholders: formUtils.getFieldPlaceholders(EINVOICING_CODE_FIELD),
|
|
408
|
+
mask: formUtils.getMask("eInvoicingCode"),
|
|
409
|
+
guidanceText: formUtils.getFieldGuidanceText(EINVOICING_CODE_FIELD),
|
|
410
|
+
readonly: formUtils.isReadOnly("eInvoicingCode"),
|
|
411
|
+
handleChangeFor
|
|
412
|
+
}
|
|
413
|
+
) }),
|
|
414
|
+
showField(DATE_OF_INCORPORATION_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
|
|
415
|
+
DateOfIncorporationField,
|
|
416
|
+
{
|
|
417
|
+
data: formUtils.getFieldData(
|
|
418
|
+
form.data?.additionalInformation ?? {},
|
|
419
|
+
DATE_OF_INCORPORATION_FIELD
|
|
420
|
+
),
|
|
421
|
+
valid: formUtils.getFieldValid(
|
|
422
|
+
form.valid?.additionalInformation ?? {},
|
|
423
|
+
DATE_OF_INCORPORATION_FIELD
|
|
424
|
+
),
|
|
425
|
+
errors: formUtils.getFieldErrors(
|
|
426
|
+
form.errors?.additionalInformation ?? {},
|
|
427
|
+
validationErrors,
|
|
428
|
+
DATE_OF_INCORPORATION_FIELD
|
|
429
|
+
),
|
|
430
|
+
labels: formUtils.getFieldLabels(DATE_OF_INCORPORATION_FIELD),
|
|
431
|
+
placeholders: formUtils.getFieldPlaceholders(DATE_OF_INCORPORATION_FIELD, {
|
|
432
|
+
dateOfIncorporation: "datePlaceholder"
|
|
433
|
+
}),
|
|
434
|
+
readonly: formUtils.isReadOnly("dateOfIncorporation"),
|
|
435
|
+
handleChangeFor
|
|
436
|
+
}
|
|
437
|
+
) })
|
|
438
|
+
] })
|
|
439
|
+
] }),
|
|
440
|
+
showStockData && /* @__PURE__ */ jsxs("section", { children: [
|
|
441
|
+
/* @__PURE__ */ jsx("div", { className: "adyen-kyc-additional-information__section-heading", children: /* @__PURE__ */ jsx(Typography, { el: "h3", variant: "title", children: t(($) => $["stockExchangeInformation"]) }) }),
|
|
442
|
+
/* @__PURE__ */ jsxs("fieldset", { children: [
|
|
443
|
+
showField(STOCK_EXCHANGE_MIC_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
|
|
444
|
+
StockExchangeMICField,
|
|
445
|
+
{
|
|
446
|
+
data: formUtils.getFieldData(
|
|
447
|
+
form.data?.additionalInformation ?? {},
|
|
448
|
+
STOCK_EXCHANGE_MIC_FIELD
|
|
449
|
+
),
|
|
450
|
+
valid: formUtils.getFieldValid(
|
|
451
|
+
form.valid?.additionalInformation ?? {},
|
|
452
|
+
STOCK_EXCHANGE_MIC_FIELD
|
|
453
|
+
),
|
|
454
|
+
errors: formUtils.getFieldErrors(
|
|
455
|
+
form.errors?.additionalInformation ?? {},
|
|
456
|
+
validationErrors,
|
|
457
|
+
STOCK_EXCHANGE_MIC_FIELD
|
|
458
|
+
),
|
|
459
|
+
labels: formUtils.getFieldLabels(STOCK_EXCHANGE_MIC_FIELD),
|
|
460
|
+
placeholders: formUtils.getFieldPlaceholders(STOCK_EXCHANGE_MIC_FIELD),
|
|
461
|
+
mask: formUtils.getMask("stockExchangeMIC"),
|
|
462
|
+
guidanceText: formUtils.getFieldGuidanceText(STOCK_EXCHANGE_MIC_FIELD),
|
|
463
|
+
readonly: formUtils.isReadOnly("stockExchangeMIC"),
|
|
464
|
+
shouldValidate,
|
|
465
|
+
handleChangeFor
|
|
466
|
+
}
|
|
467
|
+
) }),
|
|
468
|
+
showField(STOCK_ISIN_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
|
|
469
|
+
StockISINField,
|
|
470
|
+
{
|
|
471
|
+
data: formUtils.getFieldData(
|
|
472
|
+
form.data?.additionalInformation ?? {},
|
|
473
|
+
STOCK_ISIN_FIELD
|
|
474
|
+
),
|
|
475
|
+
valid: formUtils.getFieldValid(
|
|
476
|
+
form.valid?.additionalInformation ?? {},
|
|
477
|
+
STOCK_ISIN_FIELD
|
|
478
|
+
),
|
|
479
|
+
errors: formUtils.getFieldErrors(
|
|
480
|
+
form.errors?.additionalInformation ?? {},
|
|
481
|
+
validationErrors,
|
|
482
|
+
STOCK_ISIN_FIELD
|
|
483
|
+
),
|
|
484
|
+
labels: formUtils.getFieldLabels(STOCK_ISIN_FIELD),
|
|
485
|
+
placeholders: formUtils.getFieldPlaceholders(STOCK_ISIN_FIELD),
|
|
486
|
+
mask: formUtils.getMask("stockISIN"),
|
|
487
|
+
guidanceText: formUtils.getFieldGuidanceText(STOCK_ISIN_FIELD),
|
|
488
|
+
readonly: formUtils.isReadOnly("stockISIN"),
|
|
489
|
+
shouldValidate,
|
|
490
|
+
handleChangeFor
|
|
491
|
+
}
|
|
492
|
+
) }),
|
|
493
|
+
showField(STOCK_TICKER_SYMBOL_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
|
|
494
|
+
StockTickerSymbolField,
|
|
495
|
+
{
|
|
496
|
+
data: formUtils.getFieldData(
|
|
497
|
+
form.data?.additionalInformation ?? {},
|
|
498
|
+
STOCK_TICKER_SYMBOL_FIELD
|
|
499
|
+
),
|
|
500
|
+
valid: formUtils.getFieldValid(
|
|
501
|
+
form.valid?.additionalInformation ?? {},
|
|
502
|
+
STOCK_TICKER_SYMBOL_FIELD
|
|
503
|
+
),
|
|
504
|
+
errors: formUtils.getFieldErrors(
|
|
505
|
+
form.errors?.additionalInformation ?? {},
|
|
506
|
+
validationErrors,
|
|
507
|
+
STOCK_TICKER_SYMBOL_FIELD
|
|
508
|
+
),
|
|
509
|
+
labels: formUtils.getFieldLabels(STOCK_TICKER_SYMBOL_FIELD),
|
|
510
|
+
placeholders: formUtils.getFieldPlaceholders(STOCK_TICKER_SYMBOL_FIELD),
|
|
511
|
+
mask: formUtils.getMask("stockTickerSymbol"),
|
|
512
|
+
guidanceText: formUtils.getFieldGuidanceText(STOCK_TICKER_SYMBOL_FIELD),
|
|
513
|
+
readonly: formUtils.isReadOnly("stockTickerSymbol"),
|
|
514
|
+
shouldValidate,
|
|
515
|
+
handleChangeFor
|
|
516
|
+
}
|
|
517
|
+
) })
|
|
518
|
+
] })
|
|
519
|
+
] }),
|
|
520
|
+
/* @__PURE__ */ jsxs("section", { "data-testid": "registeredBusinessAddress", children: [
|
|
521
|
+
/* @__PURE__ */ jsxs("div", { className: "adyen-kyc-additional-information__section-heading", children: [
|
|
522
|
+
/* @__PURE__ */ jsx(Typography, { el: "h3", variant: "title", children: t(($) => $["registeredBusinessAddress"]) }),
|
|
523
|
+
/* @__PURE__ */ jsx(Typography, { el: "p", variant: "body", children: registrationAddressDescription })
|
|
524
|
+
] }),
|
|
525
|
+
/* @__PURE__ */ jsx(
|
|
526
|
+
Address,
|
|
527
|
+
{
|
|
528
|
+
id: ADDITIONAL_INFORMATION_FORM_ID,
|
|
529
|
+
addressType: "registrationAddress",
|
|
530
|
+
data: {
|
|
531
|
+
...form.data?.additionalInformation?.registrationAddress,
|
|
532
|
+
country
|
|
533
|
+
},
|
|
534
|
+
labels: getAddressSchemaLabelsByCountry(country),
|
|
535
|
+
requiredFields: addressSchema,
|
|
536
|
+
shouldValidate,
|
|
537
|
+
hideCountry: true,
|
|
538
|
+
optionalFields: ["otherAddressInformation"],
|
|
539
|
+
readOnlyFields: verifiedBusiness$1?.state && verifiedBusiness$1?.state === form.data?.basicInformation?.stateOrProvince ? ["stateOrProvince"] : [],
|
|
540
|
+
trustedFields: getNestedTrustedFields(
|
|
541
|
+
"registrationAddress",
|
|
542
|
+
form.data.additionalInformation,
|
|
543
|
+
form.trustedFields?.additionalInformation
|
|
544
|
+
),
|
|
545
|
+
onChange: handleRegistrationAddressChange,
|
|
546
|
+
verifiedBusiness: verifiedBusiness$1,
|
|
547
|
+
verifiedAddress: verifiedAddress?.registrationAddress,
|
|
548
|
+
condensed: true
|
|
549
|
+
}
|
|
550
|
+
)
|
|
551
|
+
] }),
|
|
552
|
+
/* @__PURE__ */ jsxs("section", { "data-testid": "principalPlaceOfBusiness", children: [
|
|
553
|
+
/* @__PURE__ */ jsxs("div", { className: "adyen-kyc-additional-information__section-heading", children: [
|
|
554
|
+
/* @__PURE__ */ jsx(Typography, { el: "h3", variant: "title", children: t(($) => $["principalPlaceOfBusiness"]) }),
|
|
555
|
+
/* @__PURE__ */ jsx(Typography, { el: "p", variant: "body", children: t(($) => $["thePhysicalLocationWhereABusiness"]) })
|
|
556
|
+
] }),
|
|
557
|
+
!mustProvideOperationalAddress && /* @__PURE__ */ jsx(
|
|
558
|
+
Field,
|
|
559
|
+
{
|
|
560
|
+
el: "fieldset",
|
|
561
|
+
name: "operationalAddressIsSame",
|
|
562
|
+
errorMessage: form.errors?.additionalInformation?.operationalAddressIsSame?.errorMessage,
|
|
563
|
+
isValid: form.valid?.additionalInformation?.operationalAddressIsSame,
|
|
564
|
+
children: (childProps) => /* @__PURE__ */ jsx(
|
|
565
|
+
Checkbox,
|
|
566
|
+
{
|
|
567
|
+
...childProps,
|
|
568
|
+
"aria-required": formUtils.isRequiredField("operationalAddressIsSame"),
|
|
569
|
+
"aria-invalid": !form.valid?.additionalInformation?.operationalAddressIsSame,
|
|
570
|
+
name: "operationalAddressIsSame",
|
|
571
|
+
label: formUtils.getLabel("sameAsRegisteredAddress"),
|
|
572
|
+
checked: form.data?.additionalInformation?.operationalAddressIsSame ? form.data?.additionalInformation?.operationalAddressIsSame === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_SAME : true,
|
|
573
|
+
onChange: handleOperationalAddressIsSameChange
|
|
574
|
+
}
|
|
575
|
+
)
|
|
576
|
+
}
|
|
577
|
+
),
|
|
578
|
+
form.data?.additionalInformation?.operationalAddressIsSame === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME && /* @__PURE__ */ jsx(
|
|
579
|
+
Address,
|
|
580
|
+
{
|
|
581
|
+
id: ADDITIONAL_INFORMATION_FORM_ID,
|
|
582
|
+
addressType: "operationalAddress",
|
|
583
|
+
data: {
|
|
584
|
+
...form.defaultData?.additionalInformation?.operationalAddress,
|
|
585
|
+
country
|
|
586
|
+
},
|
|
587
|
+
labels: getAddressSchemaLabelsByCountry(country),
|
|
588
|
+
requiredFields: addressSchema,
|
|
589
|
+
shouldValidate,
|
|
590
|
+
hideCountry: true,
|
|
591
|
+
optionalFields: ["otherAddressInformation"],
|
|
592
|
+
trustedFields: getNestedTrustedFields(
|
|
593
|
+
"operationalAddress",
|
|
594
|
+
form.data?.additionalInformation,
|
|
595
|
+
form.trustedFields?.additionalInformation
|
|
596
|
+
),
|
|
597
|
+
onChange: handleOperationalAddressChange,
|
|
598
|
+
verifiedBusiness: verifiedBusiness$1,
|
|
599
|
+
verifiedAddress: verifiedAddress?.operationalAddress,
|
|
600
|
+
condensed: true
|
|
601
|
+
}
|
|
602
|
+
)
|
|
603
|
+
] })
|
|
604
|
+
] })
|
|
605
|
+
] });
|
|
606
|
+
}
|
|
607
|
+
[
|
|
608
|
+
...COUNTRY_FIELD,
|
|
609
|
+
...LEGAL_COMPANY_NAME_FIELD,
|
|
610
|
+
"jaHaniLegalCompanyName",
|
|
611
|
+
"jaKanaLegalCompanyName",
|
|
612
|
+
...TAX_INFORMATION_FIELD,
|
|
613
|
+
...STATE_FIELD,
|
|
614
|
+
...BUSINESS_REGISTRATION_NUMBER_FIELD,
|
|
615
|
+
...COUNTRY_OF_GOVERNING_LAW_FIELD
|
|
616
|
+
];
|
|
617
|
+
const FormDescription = ({ description }) => {
|
|
618
|
+
const { t } = useTranslation();
|
|
619
|
+
return /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-form-header__description", children: [
|
|
620
|
+
t(($) => $[description]),
|
|
621
|
+
" ",
|
|
622
|
+
/* @__PURE__ */ jsx(Link, { href: "https://www.adyen.com/privacy-policy", external: true, children: t(($) => $["privacyStatement"]) })
|
|
623
|
+
] });
|
|
624
|
+
};
|
|
625
|
+
function BasicInformationMultiform({
|
|
626
|
+
id,
|
|
627
|
+
country,
|
|
628
|
+
shouldValidate,
|
|
629
|
+
heading = "basicInformationFormHeading",
|
|
630
|
+
description = "basicInformationFormDescription",
|
|
631
|
+
validationErrors = {},
|
|
632
|
+
verificationErrors = {},
|
|
633
|
+
disableCountry = false,
|
|
634
|
+
isTopLevelEntity = true
|
|
635
|
+
}) {
|
|
636
|
+
const { t } = useTranslation();
|
|
637
|
+
const { isSettingEnabled } = useSettingsContext();
|
|
638
|
+
const { isExperimentEnabled } = useExperimentsContext();
|
|
639
|
+
const { form } = useFormContext();
|
|
640
|
+
const allowedCountries = useAllowedCountries();
|
|
641
|
+
const isAllowedEditPrefilledCountry = isSettingEnabled(SettingNames.AllowPrefilledCountryEdit);
|
|
642
|
+
const state = form.data?.basicInformation?.stateOrProvince;
|
|
643
|
+
const companyType = form.data?.companyStructure?.entityType;
|
|
644
|
+
const currentCountryTaxInformation = form.data?.basicInformation?.taxInformation?.find(
|
|
645
|
+
(tax) => tax.country === country
|
|
646
|
+
);
|
|
647
|
+
const handleChangeFor = useCallback(
|
|
648
|
+
(fieldName, mode) => form.handleChangeFor(fieldName, "basicInformation", mode),
|
|
649
|
+
[form]
|
|
650
|
+
);
|
|
651
|
+
const formUtils = useMemo(() => {
|
|
652
|
+
const initialProps = {
|
|
653
|
+
data: form.data?.basicInformation ?? {},
|
|
654
|
+
fieldValidationErrors: validationErrors,
|
|
655
|
+
formVerificationErrors: verificationErrors,
|
|
656
|
+
allFields: form.allFields?.basicInformation ?? [],
|
|
657
|
+
requiredFields: form.requiredFields?.basicInformation ?? [],
|
|
658
|
+
optionalFields: form.optionalFields?.basicInformation ?? [],
|
|
659
|
+
trustedFields: form.trustedFields?.basicInformation ?? [],
|
|
660
|
+
obscuredFields: form.obscuredFields?.basicInformation ?? [],
|
|
661
|
+
errors: form.errors?.basicInformation ?? {},
|
|
662
|
+
valid: form.valid?.basicInformation ?? {},
|
|
663
|
+
handleFieldChange: handleChangeFor
|
|
664
|
+
};
|
|
665
|
+
const formUtilProps = initialProps.allFields?.reduce((acc, field) => {
|
|
666
|
+
switch (field) {
|
|
667
|
+
case "country":
|
|
668
|
+
return acc;
|
|
669
|
+
case "legalCompanyName":
|
|
670
|
+
return mergeFieldMetadataIntoProps(
|
|
671
|
+
field,
|
|
672
|
+
resolveFieldMetadata(
|
|
673
|
+
isExperimentEnabled("StrictNameAndAddressValidationV4") ? defaultFieldConfigV4[country] : defaultFieldConfig$2[country],
|
|
674
|
+
{ isBusiness: true },
|
|
675
|
+
isExperimentEnabled("StrictNameAndAddressValidationV4") ? defaultFieldMetadataV4 : defaultFieldMetadata$2
|
|
676
|
+
),
|
|
677
|
+
acc
|
|
678
|
+
);
|
|
679
|
+
case "countryOfGoverningLaw":
|
|
680
|
+
return acc;
|
|
681
|
+
case "stateOrProvince":
|
|
682
|
+
return mergeFieldMetadataIntoProps(
|
|
683
|
+
field,
|
|
684
|
+
resolveFieldMetadata(
|
|
685
|
+
defaultFieldConfig$1[country],
|
|
686
|
+
{ isBusiness: true },
|
|
687
|
+
defaultFieldMetadata$1
|
|
688
|
+
),
|
|
689
|
+
acc
|
|
690
|
+
);
|
|
691
|
+
case "taxInformation":
|
|
692
|
+
return mergeFieldMetadataIntoProps(
|
|
693
|
+
field,
|
|
694
|
+
resolveFieldMetadata(
|
|
695
|
+
taxInformationDefaultFieldConfig[country],
|
|
696
|
+
{
|
|
697
|
+
taxIdNumberType: currentCountryTaxInformation?.type,
|
|
698
|
+
companyType
|
|
699
|
+
},
|
|
700
|
+
taxInformationDefaultFieldMetadata
|
|
701
|
+
),
|
|
702
|
+
acc
|
|
703
|
+
);
|
|
704
|
+
case "registrationNumber":
|
|
705
|
+
return mergeFieldMetadataIntoProps(
|
|
706
|
+
field,
|
|
707
|
+
resolveFieldMetadata(
|
|
708
|
+
registrationNumberDefaultFieldConfig[country],
|
|
709
|
+
{
|
|
710
|
+
companyType,
|
|
711
|
+
registrationNumberType: form.data?.additionalInformation?.registrationNumberType,
|
|
712
|
+
state,
|
|
713
|
+
isExperimentEnabled
|
|
714
|
+
},
|
|
715
|
+
registrationNumberDefaultFieldMetadata
|
|
716
|
+
),
|
|
717
|
+
acc
|
|
718
|
+
);
|
|
719
|
+
case "jaHaniLegalCompanyName":
|
|
720
|
+
return mergeFieldMetadataIntoProps(
|
|
721
|
+
field,
|
|
722
|
+
resolveFieldMetadata(
|
|
723
|
+
localizedLegalCompanyNameFieldConfig.jaHaniLegalCompanyName.config,
|
|
724
|
+
{},
|
|
725
|
+
localizedLegalCompanyNameFieldConfig.jaHaniLegalCompanyName.metadata
|
|
726
|
+
),
|
|
727
|
+
acc
|
|
728
|
+
);
|
|
729
|
+
case "jaKanaLegalCompanyName":
|
|
730
|
+
return mergeFieldMetadataIntoProps(
|
|
731
|
+
field,
|
|
732
|
+
resolveFieldMetadata(
|
|
733
|
+
localizedLegalCompanyNameFieldConfig.jaKanaLegalCompanyName.config,
|
|
734
|
+
{},
|
|
735
|
+
localizedLegalCompanyNameFieldConfig.jaKanaLegalCompanyName.metadata
|
|
736
|
+
),
|
|
737
|
+
acc
|
|
738
|
+
);
|
|
739
|
+
default:
|
|
740
|
+
return acc;
|
|
741
|
+
}
|
|
742
|
+
}, initialProps);
|
|
743
|
+
return createFormUtils(formUtilProps ?? initialProps, t);
|
|
744
|
+
}, [
|
|
745
|
+
companyType,
|
|
746
|
+
country,
|
|
747
|
+
currentCountryTaxInformation?.type,
|
|
748
|
+
form.allFields?.basicInformation,
|
|
749
|
+
form.data?.additionalInformation?.registrationNumberType,
|
|
750
|
+
form.data?.basicInformation,
|
|
751
|
+
form.errors?.basicInformation,
|
|
752
|
+
form.obscuredFields?.basicInformation,
|
|
753
|
+
form.optionalFields?.basicInformation,
|
|
754
|
+
form.requiredFields?.basicInformation,
|
|
755
|
+
form.trustedFields?.basicInformation,
|
|
756
|
+
form.valid?.basicInformation,
|
|
757
|
+
handleChangeFor,
|
|
758
|
+
isExperimentEnabled,
|
|
759
|
+
state,
|
|
760
|
+
t,
|
|
761
|
+
validationErrors,
|
|
762
|
+
verificationErrors
|
|
763
|
+
]);
|
|
764
|
+
const showField = (fieldKeys) => fieldKeys.some((field) => {
|
|
765
|
+
switch (field) {
|
|
766
|
+
case "registrationNumberType":
|
|
767
|
+
case "registrationNumber": {
|
|
768
|
+
return (formUtils.isRequiredField(field) || formUtils.isOptionalField(field)) && form.data.basicInformation?.stateOrProvince;
|
|
769
|
+
}
|
|
770
|
+
default:
|
|
771
|
+
return formUtils.isRequiredField(field) || formUtils.isOptionalField(field);
|
|
772
|
+
}
|
|
773
|
+
});
|
|
774
|
+
const legalCompanyNameFields = useLegalCompanyNameField({
|
|
775
|
+
data: form.data.basicInformation ?? {},
|
|
776
|
+
valid: form.valid.basicInformation ?? {},
|
|
777
|
+
errors: form.errors.basicInformation ?? {},
|
|
778
|
+
fieldProblems: form.fieldProblems.basicInformation ?? {},
|
|
779
|
+
country,
|
|
780
|
+
formUtils,
|
|
781
|
+
fieldOptions: {
|
|
782
|
+
jaHaniLegalCompanyName: {
|
|
783
|
+
onInput: handleChangeFor("jaHaniLegalCompanyName", "input"),
|
|
784
|
+
onBlur: handleChangeFor("jaHaniLegalCompanyName", "blur")
|
|
785
|
+
},
|
|
786
|
+
jaKanaLegalCompanyName: {
|
|
787
|
+
onInput: handleChangeFor("jaKanaLegalCompanyName", "input"),
|
|
788
|
+
onBlur: handleChangeFor("jaKanaLegalCompanyName", "blur")
|
|
789
|
+
},
|
|
790
|
+
legalCompanyName: {
|
|
791
|
+
onInput: handleChangeFor("legalCompanyName", "input"),
|
|
792
|
+
onBlur: handleChangeFor("legalCompanyName", "blur")
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
});
|
|
796
|
+
return /* @__PURE__ */ jsxs("form", { id, className: "adyen-kyc-basic-information", children: [
|
|
797
|
+
/* @__PURE__ */ jsx(FormHeader, { heading: t(($) => $[heading]), children: /* @__PURE__ */ jsx(FormDescription, { slot: "description", description }) }),
|
|
798
|
+
/* @__PURE__ */ jsx(
|
|
799
|
+
ErrorPanel,
|
|
800
|
+
{
|
|
801
|
+
id: "ariaErrorField",
|
|
802
|
+
verificationErrors,
|
|
803
|
+
validationErrors,
|
|
804
|
+
formUtils
|
|
805
|
+
}
|
|
806
|
+
),
|
|
807
|
+
/* @__PURE__ */ jsx("fieldset", { children: /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
|
|
808
|
+
CountryField,
|
|
809
|
+
{
|
|
810
|
+
data: formUtils.getFieldData(form.data?.basicInformation ?? {}, COUNTRY_FIELD),
|
|
811
|
+
valid: formUtils.getFieldValid(form.valid?.basicInformation ?? {}, COUNTRY_FIELD),
|
|
812
|
+
errors: formUtils.getFieldErrors(
|
|
813
|
+
form.errors?.basicInformation ?? {},
|
|
814
|
+
validationErrors,
|
|
815
|
+
COUNTRY_FIELD
|
|
816
|
+
),
|
|
817
|
+
labels: formUtils.getFieldLabels(COUNTRY_FIELD, {
|
|
818
|
+
country: "countryRegionOfEstablishment"
|
|
819
|
+
}),
|
|
820
|
+
readonly: formUtils.isReadOnly("country") || !isAllowedEditPrefilledCountry || Boolean(disableCountry),
|
|
821
|
+
handleChangeFor,
|
|
822
|
+
allowedCountries: isTopLevelEntity ? allowedCountries : void 0
|
|
823
|
+
}
|
|
824
|
+
) }) }),
|
|
825
|
+
/* @__PURE__ */ jsxs("fieldset", { children: [
|
|
826
|
+
showField(COUNTRY_OF_GOVERNING_LAW_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
|
|
827
|
+
CountryOfGoverningLawField,
|
|
828
|
+
{
|
|
829
|
+
data: formUtils.getFieldData(
|
|
830
|
+
form.data?.basicInformation ?? {},
|
|
831
|
+
COUNTRY_OF_GOVERNING_LAW_FIELD
|
|
832
|
+
),
|
|
833
|
+
country,
|
|
834
|
+
valid: formUtils.getFieldValid(
|
|
835
|
+
form.valid?.basicInformation ?? {},
|
|
836
|
+
COUNTRY_OF_GOVERNING_LAW_FIELD
|
|
837
|
+
),
|
|
838
|
+
errors: formUtils.getFieldErrors(
|
|
839
|
+
form.errors?.basicInformation ?? {},
|
|
840
|
+
validationErrors,
|
|
841
|
+
COUNTRY_OF_GOVERNING_LAW_FIELD
|
|
842
|
+
),
|
|
843
|
+
labels: formUtils.getFieldLabels(COUNTRY_OF_GOVERNING_LAW_FIELD),
|
|
844
|
+
readonly: false,
|
|
845
|
+
allowedCountries: isTopLevelEntity ? allowedCountries : void 0,
|
|
846
|
+
handleChangeFor
|
|
847
|
+
}
|
|
848
|
+
) }),
|
|
849
|
+
// fields shown here are abstracted by useLegalCompanyNameField
|
|
850
|
+
legalCompanyNameFields.map((field) => /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
|
|
851
|
+
Field,
|
|
852
|
+
{
|
|
853
|
+
name: field?.name ?? "",
|
|
854
|
+
label: field?.label,
|
|
855
|
+
helper: field?.helper,
|
|
856
|
+
errorMessage: field?.errorMessage,
|
|
857
|
+
isValid: Boolean(field?.isValid),
|
|
858
|
+
children: (childProps) => /* @__PURE__ */ jsx(
|
|
859
|
+
InputText,
|
|
860
|
+
{
|
|
861
|
+
...childProps,
|
|
862
|
+
"aria-required": true,
|
|
863
|
+
"aria-invalid": !field?.isValid,
|
|
864
|
+
name: field?.name,
|
|
865
|
+
value: field?.value,
|
|
866
|
+
readonly: field?.readonly,
|
|
867
|
+
onInput: field ? field.onInput : () => {
|
|
868
|
+
},
|
|
869
|
+
onBlur: field?.onBlur,
|
|
870
|
+
onKeyDown: field?.onKeyDown
|
|
871
|
+
}
|
|
872
|
+
)
|
|
873
|
+
},
|
|
874
|
+
field?.name
|
|
875
|
+
) }, field?.name)),
|
|
876
|
+
showField(TAX_INFORMATION_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
|
|
877
|
+
TaxInformationField,
|
|
878
|
+
{
|
|
879
|
+
data: formUtils.getFieldData(
|
|
880
|
+
form.data?.basicInformation ?? {},
|
|
881
|
+
TAX_INFORMATION_FIELD
|
|
882
|
+
),
|
|
883
|
+
valid: formUtils.getFieldValid(
|
|
884
|
+
form.valid?.basicInformation ?? {},
|
|
885
|
+
TAX_INFORMATION_FIELD
|
|
886
|
+
),
|
|
887
|
+
errors: formUtils.getFieldErrors(
|
|
888
|
+
form.errors?.basicInformation ?? {},
|
|
889
|
+
validationErrors,
|
|
890
|
+
TAX_INFORMATION_FIELD
|
|
891
|
+
),
|
|
892
|
+
labels: formUtils.getFieldLabels(TAX_INFORMATION_FIELD, {
|
|
893
|
+
exemptedFromTax: "iDontHaveATaxId"
|
|
894
|
+
}),
|
|
895
|
+
mask: formUtils.getMask("taxInformation"),
|
|
896
|
+
placeholders: formUtils.getFieldPlaceholders(TAX_INFORMATION_FIELD),
|
|
897
|
+
guidanceText: formUtils.getFieldGuidanceText(TAX_INFORMATION_FIELD),
|
|
898
|
+
readonly: formUtils.isReadOnly("taxInformation"),
|
|
899
|
+
shouldValidate,
|
|
900
|
+
handleChangeFor,
|
|
901
|
+
canExempt: showField(["exemptedFromTax"]),
|
|
902
|
+
registrationNumber: form.data.additionalInformation?.registrationNumber,
|
|
903
|
+
country,
|
|
904
|
+
entityType: companyType,
|
|
905
|
+
defaultData: form.defaultData?.basicInformation?.taxInformation
|
|
906
|
+
}
|
|
907
|
+
) }),
|
|
908
|
+
showField(STATE_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
|
|
909
|
+
StateField,
|
|
910
|
+
{
|
|
911
|
+
data: formUtils.getFieldData(form.data?.basicInformation ?? {}, STATE_FIELD),
|
|
912
|
+
valid: formUtils.getFieldValid(form.valid?.basicInformation ?? {}, STATE_FIELD),
|
|
913
|
+
errors: formUtils.getFieldErrors(
|
|
914
|
+
form.errors?.basicInformation ?? {},
|
|
915
|
+
validationErrors,
|
|
916
|
+
STATE_FIELD
|
|
917
|
+
),
|
|
918
|
+
labels: formUtils.getFieldLabels(STATE_FIELD),
|
|
919
|
+
placeholders: formUtils.getFieldPlaceholders(STATE_FIELD),
|
|
920
|
+
readonly: formUtils.isReadOnly("stateOrProvince"),
|
|
921
|
+
handleChangeFor,
|
|
922
|
+
selectedCountry: country
|
|
923
|
+
}
|
|
924
|
+
) }),
|
|
925
|
+
showField(BUSINESS_REGISTRATION_NUMBER_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
|
|
926
|
+
BusinessRegistrationNumberField,
|
|
927
|
+
{
|
|
928
|
+
data: formUtils.getFieldData(
|
|
929
|
+
form.data?.basicInformation ?? {},
|
|
930
|
+
BUSINESS_REGISTRATION_NUMBER_FIELD
|
|
931
|
+
),
|
|
932
|
+
valid: formUtils.getFieldValid(
|
|
933
|
+
form.valid?.basicInformation ?? {},
|
|
934
|
+
BUSINESS_REGISTRATION_NUMBER_FIELD
|
|
935
|
+
),
|
|
936
|
+
errors: formUtils.getFieldErrors(
|
|
937
|
+
form.errors?.basicInformation ?? {},
|
|
938
|
+
validationErrors,
|
|
939
|
+
BUSINESS_REGISTRATION_NUMBER_FIELD
|
|
940
|
+
),
|
|
941
|
+
labels: formUtils.getFieldLabels(BUSINESS_REGISTRATION_NUMBER_FIELD, {
|
|
942
|
+
exemptedFromRegistrationNumber: "iDontHaveARegistrationNumber"
|
|
943
|
+
}),
|
|
944
|
+
mask: formUtils.getMask("registrationNumber"),
|
|
945
|
+
guidanceText: formUtils.getFieldGuidanceText(BUSINESS_REGISTRATION_NUMBER_FIELD),
|
|
946
|
+
placeholders: formUtils.getFieldPlaceholders(BUSINESS_REGISTRATION_NUMBER_FIELD),
|
|
947
|
+
helperText: formUtils.getFieldHelperText(BUSINESS_REGISTRATION_NUMBER_FIELD),
|
|
948
|
+
readonly: formUtils.isReadOnly("registrationNumber"),
|
|
949
|
+
optional: formUtils.isOptionalField("registrationNumber"),
|
|
950
|
+
shouldValidate,
|
|
951
|
+
handleChangeFor,
|
|
952
|
+
country,
|
|
953
|
+
canExempt: showField(["exemptedFromRegistrationNumber"]),
|
|
954
|
+
companyType
|
|
955
|
+
}
|
|
956
|
+
) })
|
|
957
|
+
] })
|
|
958
|
+
] });
|
|
959
|
+
}
|
|
960
|
+
function CompanyStructureMultiform({
|
|
961
|
+
id,
|
|
962
|
+
country,
|
|
963
|
+
heading = "companyStructureFormName",
|
|
964
|
+
description = "companyStructureFormDescription",
|
|
965
|
+
validationErrors = {},
|
|
966
|
+
verificationErrors = {}
|
|
967
|
+
}) {
|
|
968
|
+
const { t } = useTranslation();
|
|
969
|
+
const { form } = useFormContext();
|
|
970
|
+
const { accountHolder } = useAccountHolder();
|
|
971
|
+
const { isSettingEnabled } = useSettingsContext();
|
|
972
|
+
const canChangeEntityType = isSettingEnabled(SettingNames.AllowLegalEntityTypeChange);
|
|
973
|
+
const formUtils = createFormUtils(
|
|
974
|
+
{ requiredFields: form.requiredFields?.companyStructure ?? [] },
|
|
975
|
+
t
|
|
976
|
+
);
|
|
977
|
+
const excludedTypes = [
|
|
978
|
+
CompanyTypesValues.INCORPORATED_PARTNERSHIP,
|
|
979
|
+
CompanyTypesValues.INCORPORATED_ASSOCIATION
|
|
980
|
+
];
|
|
981
|
+
if (isBankAccountRequestedForOrganization.value) {
|
|
982
|
+
excludedTypes.push(CompanyTypesValues.GOVERNMENTAL_ORGANIZATION);
|
|
983
|
+
}
|
|
984
|
+
const companyTypeRadioOptions = canChangeEntityType && accountHolder !== "aTrust" && accountHolder !== "anUnincorporatedPartnership" ? companyTypeOptions.filter((companyType) => !excludedTypes.includes(companyType)) : companyTypeOptions;
|
|
985
|
+
const companyTypeExamples = useCompanyTypeExamples(country);
|
|
986
|
+
return /* @__PURE__ */ jsxs("form", { id, className: "adyen-kyc-company-structure", children: [
|
|
987
|
+
/* @__PURE__ */ jsx(FormHeader, { heading: t(($) => $[heading]), description: t(($) => $[description]) }),
|
|
988
|
+
/* @__PURE__ */ jsx(
|
|
989
|
+
ErrorPanel,
|
|
990
|
+
{
|
|
991
|
+
id: "ariaErrorField",
|
|
992
|
+
verificationErrors,
|
|
993
|
+
validationErrors,
|
|
994
|
+
formUtils
|
|
995
|
+
}
|
|
996
|
+
),
|
|
997
|
+
/* @__PURE__ */ jsx(
|
|
998
|
+
Field,
|
|
999
|
+
{
|
|
1000
|
+
el: "fieldset",
|
|
1001
|
+
name: "entityType",
|
|
1002
|
+
errorMessage: formUtils.getErrorMessage(
|
|
1003
|
+
"entityType",
|
|
1004
|
+
form.errors?.companyStructure,
|
|
1005
|
+
validationErrors
|
|
1006
|
+
),
|
|
1007
|
+
isValid: form.valid?.companyStructure?.entityType,
|
|
1008
|
+
children: (childProps) => /* @__PURE__ */ jsx(
|
|
1009
|
+
EntityTypeRadioGroupCard,
|
|
1010
|
+
{
|
|
1011
|
+
...childProps,
|
|
1012
|
+
name: "entityType",
|
|
1013
|
+
options: companyTypeRadioOptions,
|
|
1014
|
+
optionId: (option) => companyTypeMetadata[option].id,
|
|
1015
|
+
optionName: (option) => companyTypeMetadata[option].name,
|
|
1016
|
+
optionDescription: (option) => companyTypeMetadata[option].description,
|
|
1017
|
+
selected: form.data?.companyStructure?.entityType,
|
|
1018
|
+
onSelect: form.handleChangeFor("entityType", "companyStructure"),
|
|
1019
|
+
examples: companyTypeExamples,
|
|
1020
|
+
"aria-required": true,
|
|
1021
|
+
"aria-invalid": !form.valid?.companyStructure?.entityType
|
|
1022
|
+
}
|
|
1023
|
+
)
|
|
1024
|
+
}
|
|
1025
|
+
)
|
|
1026
|
+
] });
|
|
1027
|
+
}
|
|
1028
|
+
function BusinessDetailsMultiform({
|
|
1029
|
+
taskType,
|
|
1030
|
+
country,
|
|
1031
|
+
activeForm,
|
|
1032
|
+
shouldValidate,
|
|
1033
|
+
problems = {},
|
|
1034
|
+
handleNextClick,
|
|
1035
|
+
handleBackClick,
|
|
1036
|
+
setLoadingStatus
|
|
1037
|
+
}) {
|
|
1038
|
+
const { i18n } = useI18nContext();
|
|
1039
|
+
const { form } = useFormContext();
|
|
1040
|
+
const companyType = taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY ? CompanyTypesValues.SOLE_PROPRIETORSHIP : form.data.companyStructure?.entityType;
|
|
1041
|
+
function handleChange(formName, fieldName, mode) {
|
|
1042
|
+
return form.handleChangeFor(fieldName, formName, mode);
|
|
1043
|
+
}
|
|
1044
|
+
const renderActiveForm = (activeForm2) => {
|
|
1045
|
+
switch (activeForm2.formId) {
|
|
1046
|
+
case "basicInformation":
|
|
1047
|
+
return /* @__PURE__ */ jsx(
|
|
1048
|
+
BasicInformationMultiform,
|
|
1049
|
+
{
|
|
1050
|
+
id: activeForm2.formId,
|
|
1051
|
+
country,
|
|
1052
|
+
shouldValidate,
|
|
1053
|
+
heading: activeForm2.formHeading,
|
|
1054
|
+
description: activeForm2.formDescription,
|
|
1055
|
+
validationErrors: problems.validationErrors?.[activeForm2.formId],
|
|
1056
|
+
verificationErrors: problems.verificationErrors?.[activeForm2.formId]
|
|
1057
|
+
}
|
|
1058
|
+
);
|
|
1059
|
+
case "businessSelection":
|
|
1060
|
+
return /* @__PURE__ */ jsx(
|
|
1061
|
+
BusinessSelectionMultiform,
|
|
1062
|
+
{
|
|
1063
|
+
id: activeForm2.formId,
|
|
1064
|
+
country,
|
|
1065
|
+
shouldValidate,
|
|
1066
|
+
heading: activeForm2.formHeading,
|
|
1067
|
+
description: activeForm2.formDescription,
|
|
1068
|
+
validationErrors: problems.validationErrors?.[activeForm2.formId],
|
|
1069
|
+
verificationErrors: problems.verificationErrors?.[activeForm2.formId],
|
|
1070
|
+
handleNextClick,
|
|
1071
|
+
handleBackClick,
|
|
1072
|
+
setLoadingStatus
|
|
1073
|
+
}
|
|
1074
|
+
);
|
|
1075
|
+
case "companyStructure":
|
|
1076
|
+
return /* @__PURE__ */ jsx(
|
|
1077
|
+
CompanyStructureMultiform,
|
|
1078
|
+
{
|
|
1079
|
+
id: activeForm2.formId,
|
|
1080
|
+
country,
|
|
1081
|
+
shouldValidate,
|
|
1082
|
+
heading: activeForm2.formHeading,
|
|
1083
|
+
description: activeForm2.formDescription,
|
|
1084
|
+
validationErrors: problems.validationErrors?.[activeForm2.formId],
|
|
1085
|
+
verificationErrors: problems.verificationErrors?.[activeForm2.formId]
|
|
1086
|
+
}
|
|
1087
|
+
);
|
|
1088
|
+
case "additionalInformation":
|
|
1089
|
+
return /* @__PURE__ */ jsx(
|
|
1090
|
+
AdditionalInformationMultiform,
|
|
1091
|
+
{
|
|
1092
|
+
id: activeForm2.formId,
|
|
1093
|
+
country,
|
|
1094
|
+
companyType,
|
|
1095
|
+
shouldValidate,
|
|
1096
|
+
heading: activeForm2.formHeading,
|
|
1097
|
+
description: activeForm2.formDescription,
|
|
1098
|
+
validationErrors: problems.validationErrors?.[activeForm2.formId],
|
|
1099
|
+
verificationErrors: problems.verificationErrors?.[activeForm2.formId]
|
|
1100
|
+
}
|
|
1101
|
+
);
|
|
1102
|
+
case "companyTaxDocument":
|
|
1103
|
+
return country === "US" ? /* @__PURE__ */ jsx(
|
|
1104
|
+
TaxDocument,
|
|
1105
|
+
{
|
|
1106
|
+
id: activeForm2.formId,
|
|
1107
|
+
country,
|
|
1108
|
+
companyType,
|
|
1109
|
+
shouldValidate,
|
|
1110
|
+
heading: activeForm2.formHeading,
|
|
1111
|
+
description: activeForm2.formDescription,
|
|
1112
|
+
fieldValidationErrors: problems.validationErrors?.[activeForm2.formId] ?? {},
|
|
1113
|
+
formVerificationErrors: problems.verificationErrors?.[activeForm2.formId] ?? {},
|
|
1114
|
+
data: form.data.companyTaxDocument,
|
|
1115
|
+
errors: form.errors.companyTaxDocument,
|
|
1116
|
+
valid: form.valid.companyTaxDocument,
|
|
1117
|
+
allFields: form.allFields?.companyTaxDocument,
|
|
1118
|
+
requiredFields: form.requiredFields?.companyTaxDocument,
|
|
1119
|
+
optionalFields: form.optionalFields?.companyTaxDocument,
|
|
1120
|
+
trustedFields: form.trustedFields?.companyTaxDocument,
|
|
1121
|
+
handleFieldChange: () => handleChange("companyTaxDocument", "taxDocument")
|
|
1122
|
+
}
|
|
1123
|
+
) : /* @__PURE__ */ jsx(
|
|
1124
|
+
MemoizedDocumentUpload,
|
|
1125
|
+
{
|
|
1126
|
+
id: activeForm2.formId,
|
|
1127
|
+
country,
|
|
1128
|
+
companyType,
|
|
1129
|
+
shouldValidate,
|
|
1130
|
+
heading: activeForm2.formHeading,
|
|
1131
|
+
description: activeForm2.formDescription,
|
|
1132
|
+
fieldValidationErrors: problems.validationErrors?.[activeForm2.formId] ?? {},
|
|
1133
|
+
formVerificationErrors: problems.verificationErrors?.[activeForm2.formId] ?? {},
|
|
1134
|
+
data: form.data.companyTaxDocument,
|
|
1135
|
+
errors: form.errors.companyTaxDocument,
|
|
1136
|
+
valid: form.valid.companyTaxDocument,
|
|
1137
|
+
allFields: form.allFields?.companyTaxDocument,
|
|
1138
|
+
requiredFields: form.requiredFields?.companyTaxDocument,
|
|
1139
|
+
optionalFields: form.optionalFields?.companyTaxDocument,
|
|
1140
|
+
trustedFields: form.trustedFields?.companyTaxDocument,
|
|
1141
|
+
handleFieldChange: () => handleChange("companyTaxDocument", "taxDocument"),
|
|
1142
|
+
documentField: "taxDocument",
|
|
1143
|
+
documentType: "vatDocument",
|
|
1144
|
+
hidePageCount: true,
|
|
1145
|
+
guidanceContent: /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-u-margin-bottom-24", children: [
|
|
1146
|
+
/* @__PURE__ */ jsxs("div", { className: "adyen-kyc-upload-field__subtitle", children: [
|
|
1147
|
+
" ",
|
|
1148
|
+
i18n.get("requirements")
|
|
1149
|
+
] }),
|
|
1150
|
+
/* @__PURE__ */ jsxs("ul", { children: [
|
|
1151
|
+
/* @__PURE__ */ jsx("li", { children: i18n.get("containsNameOfCompany") }),
|
|
1152
|
+
/* @__PURE__ */ jsx("li", { children: i18n.get("documentShowsTaxIdOfCompany") }),
|
|
1153
|
+
/* @__PURE__ */ jsx("li", { children: i18n.get("issuedByTheTaxAuthority") })
|
|
1154
|
+
] })
|
|
1155
|
+
] })
|
|
1156
|
+
}
|
|
1157
|
+
);
|
|
1158
|
+
case "companyRegistrationDocument":
|
|
1159
|
+
return /* @__PURE__ */ jsx(
|
|
1160
|
+
RegistrationDocument,
|
|
1161
|
+
{
|
|
1162
|
+
id: activeForm2.formId,
|
|
1163
|
+
heading: activeForm2.formHeading,
|
|
1164
|
+
description: activeForm2.formDescription,
|
|
1165
|
+
country,
|
|
1166
|
+
companyType,
|
|
1167
|
+
data: form.data.companyRegistrationDocument,
|
|
1168
|
+
errors: form.errors.companyRegistrationDocument,
|
|
1169
|
+
valid: form.valid.companyRegistrationDocument,
|
|
1170
|
+
allFields: form.allFields?.companyRegistrationDocument,
|
|
1171
|
+
requiredFields: form.requiredFields?.companyRegistrationDocument,
|
|
1172
|
+
optionalFields: form.optionalFields?.companyRegistrationDocument,
|
|
1173
|
+
trustedFields: form.trustedFields?.companyRegistrationDocument,
|
|
1174
|
+
handleFieldChange: () => handleChange("companyRegistrationDocument", "registrationDocument"),
|
|
1175
|
+
shouldValidate,
|
|
1176
|
+
fieldValidationErrors: problems.validationErrors?.[activeForm2.formId] ?? {},
|
|
1177
|
+
formVerificationErrors: problems.verificationErrors?.[activeForm2.formId] ?? {}
|
|
1178
|
+
}
|
|
1179
|
+
);
|
|
1180
|
+
case "companyProofOfDirectorDocument":
|
|
1181
|
+
return /* @__PURE__ */ jsx(
|
|
1182
|
+
ProofOfDirectorDocument,
|
|
1183
|
+
{
|
|
1184
|
+
id: activeForm2.formId,
|
|
1185
|
+
heading: activeForm2.formHeading,
|
|
1186
|
+
description: activeForm2.formDescription,
|
|
1187
|
+
country,
|
|
1188
|
+
data: form.data?.companyProofOfDirectorDocument,
|
|
1189
|
+
errors: form.errors.companyProofOfDirectorDocument,
|
|
1190
|
+
valid: form.valid.companyProofOfDirectorDocument,
|
|
1191
|
+
allFields: form.allFields?.companyProofOfDirectorDocument,
|
|
1192
|
+
requiredFields: form.requiredFields?.companyProofOfDirectorDocument,
|
|
1193
|
+
optionalFields: form.optionalFields?.companyProofOfDirectorDocument,
|
|
1194
|
+
trustedFields: form.trustedFields?.companyProofOfDirectorDocument,
|
|
1195
|
+
handleFieldChange: () => handleChange("companyProofOfDirectorDocument", "proofOfDirector"),
|
|
1196
|
+
shouldValidate,
|
|
1197
|
+
fieldValidationErrors: problems.validationErrors?.[activeForm2.formId] ?? {},
|
|
1198
|
+
formVerificationErrors: problems.verificationErrors?.[activeForm2.formId] ?? {}
|
|
1199
|
+
}
|
|
1200
|
+
);
|
|
1201
|
+
case "companyProofOfSignatoryDocument":
|
|
1202
|
+
return /* @__PURE__ */ jsx(
|
|
1203
|
+
ProofOfSignatoryDocument,
|
|
1204
|
+
{
|
|
1205
|
+
id: activeForm2.formId,
|
|
1206
|
+
heading: activeForm2.formHeading,
|
|
1207
|
+
description: activeForm2.formDescription,
|
|
1208
|
+
country,
|
|
1209
|
+
data: form.data?.companyProofOfSignatoryDocument,
|
|
1210
|
+
errors: form.errors.companyProofOfSignatoryDocument,
|
|
1211
|
+
valid: form.valid.companyProofOfSignatoryDocument,
|
|
1212
|
+
allFields: form.allFields?.companyProofOfSignatoryDocument,
|
|
1213
|
+
requiredFields: form.requiredFields?.companyProofOfSignatoryDocument,
|
|
1214
|
+
optionalFields: form.optionalFields?.companyProofOfSignatoryDocument,
|
|
1215
|
+
trustedFields: form.trustedFields?.companyProofOfSignatoryDocument,
|
|
1216
|
+
handleFieldChange: () => handleChange("companyProofOfSignatoryDocument", "proofOfSignatory"),
|
|
1217
|
+
shouldValidate,
|
|
1218
|
+
fieldValidationErrors: problems.validationErrors?.[activeForm2.formId] ?? {},
|
|
1219
|
+
formVerificationErrors: problems.verificationErrors?.[activeForm2.formId] ?? {}
|
|
1220
|
+
}
|
|
1221
|
+
);
|
|
1222
|
+
case "companyProofOfOwnershipDocument":
|
|
1223
|
+
return /* @__PURE__ */ jsx(
|
|
1224
|
+
ProofOfOwnershipDocument,
|
|
1225
|
+
{
|
|
1226
|
+
id: activeForm2.formId,
|
|
1227
|
+
heading: activeForm2.formHeading,
|
|
1228
|
+
description: activeForm2.formDescription,
|
|
1229
|
+
country,
|
|
1230
|
+
data: form.data?.companyProofOfOwnershipDocument,
|
|
1231
|
+
errors: form.errors.companyProofOfOwnershipDocument,
|
|
1232
|
+
valid: form.valid.companyProofOfOwnershipDocument,
|
|
1233
|
+
allFields: form.allFields?.companyProofOfOwnershipDocument,
|
|
1234
|
+
requiredFields: form.requiredFields?.companyProofOfOwnershipDocument,
|
|
1235
|
+
optionalFields: form.optionalFields?.companyProofOfOwnershipDocument,
|
|
1236
|
+
trustedFields: form.trustedFields?.companyProofOfOwnershipDocument,
|
|
1237
|
+
handleFieldChange: () => handleChange("companyProofOfOwnershipDocument", "proofOfOwnership"),
|
|
1238
|
+
shouldValidate,
|
|
1239
|
+
fieldValidationErrors: problems.validationErrors?.[activeForm2.formId] ?? {},
|
|
1240
|
+
formVerificationErrors: problems.verificationErrors?.[activeForm2.formId] ?? {}
|
|
1241
|
+
}
|
|
1242
|
+
);
|
|
1243
|
+
case "companyConstitutionalDocument":
|
|
1244
|
+
return /* @__PURE__ */ jsx(
|
|
1245
|
+
MemoizedConstitutionalDocument,
|
|
1246
|
+
{
|
|
1247
|
+
id: activeForm2.formId,
|
|
1248
|
+
legalEntityType: LegalEntityTypes.SOLE_PROPRIETORSHIP,
|
|
1249
|
+
country,
|
|
1250
|
+
data: form.data?.companyConstitutionalDocument,
|
|
1251
|
+
errors: form.errors.companyConstitutionalDocument,
|
|
1252
|
+
valid: form.valid.companyConstitutionalDocument,
|
|
1253
|
+
allFields: form.allFields?.companyConstitutionalDocument,
|
|
1254
|
+
requiredFields: form.requiredFields?.companyConstitutionalDocument,
|
|
1255
|
+
optionalFields: form.optionalFields?.companyConstitutionalDocument,
|
|
1256
|
+
trustedFields: form.trustedFields?.companyConstitutionalDocument,
|
|
1257
|
+
handleFieldChange: () => handleChange("companyConstitutionalDocument", "constitutionalDocument"),
|
|
1258
|
+
shouldValidate,
|
|
1259
|
+
fieldValidationErrors: problems.validationErrors?.[activeForm2.formId] ?? {},
|
|
1260
|
+
formVerificationErrors: problems.verificationErrors?.[activeForm2.formId] ?? {}
|
|
1261
|
+
}
|
|
1262
|
+
);
|
|
1263
|
+
case "companyFinancialInformation":
|
|
1264
|
+
return /* @__PURE__ */ jsx(
|
|
1265
|
+
FinancialInformation,
|
|
1266
|
+
{
|
|
1267
|
+
multiForm: form,
|
|
1268
|
+
id: activeForm2.formId,
|
|
1269
|
+
country,
|
|
1270
|
+
heading: i18n.get(activeForm2.formHeading),
|
|
1271
|
+
description: activeForm2.formDescription,
|
|
1272
|
+
data: form.data?.companyFinancialInformation,
|
|
1273
|
+
allFields: form.allFields?.companyFinancialInformation,
|
|
1274
|
+
requiredFields: form.requiredFields?.companyFinancialInformation,
|
|
1275
|
+
optionalFields: form.optionalFields?.companyFinancialInformation,
|
|
1276
|
+
trustedFields: form.trustedFields?.companyFinancialInformation,
|
|
1277
|
+
shouldValidate
|
|
1278
|
+
}
|
|
1279
|
+
);
|
|
1280
|
+
default:
|
|
1281
|
+
return null;
|
|
1282
|
+
}
|
|
1283
|
+
};
|
|
1284
|
+
return /* @__PURE__ */ jsx("div", { className: "adyen-kyc-business-details", children: /* @__PURE__ */ jsx("div", { className: "adyen-kyc-form-wrapper", children: renderActiveForm(activeForm) }) });
|
|
1285
|
+
}
|
|
1286
|
+
function buildRequiredForms({
|
|
1287
|
+
config: { country, forms, requiredFields, optionalFields, isValid, problems },
|
|
1288
|
+
options
|
|
1289
|
+
}) {
|
|
1290
|
+
const usesBusinessSelection = COUNTRIES_USING_COMPANY_SEARCH.includes(country);
|
|
1291
|
+
const filteredForms = Object.values(forms).filter(({ formId }) => {
|
|
1292
|
+
if (usesBusinessSelection) {
|
|
1293
|
+
if (formId === "businessSelection" && options?.hasNoSearchResults) return false;
|
|
1294
|
+
if (formId === "companyStructure" && options?.verifiedBusiness && options.verifiedBusiness.legalForm)
|
|
1295
|
+
return false;
|
|
1296
|
+
}
|
|
1297
|
+
if (requiredFields || optionalFields) {
|
|
1298
|
+
return Boolean(requiredFields?.[formId]) || Boolean(optionalFields?.[formId]) || usesBusinessSelection && formId === "businessSelection";
|
|
1299
|
+
}
|
|
1300
|
+
return true;
|
|
1301
|
+
});
|
|
1302
|
+
const requiredForms = options?.skipSummary ? filteredForms : [...filteredForms, summaryStep];
|
|
1303
|
+
return addValidityToForms(requiredForms, isValid, problems);
|
|
1304
|
+
}
|
|
1305
|
+
function basicInformationValidators({
|
|
1306
|
+
country,
|
|
1307
|
+
taxIdNumberType,
|
|
1308
|
+
companyType,
|
|
1309
|
+
registrationNumberType,
|
|
1310
|
+
state,
|
|
1311
|
+
isExperimentEnabled
|
|
1312
|
+
}) {
|
|
1313
|
+
return {
|
|
1314
|
+
country: CountryFieldValidation().country,
|
|
1315
|
+
countryOfGoverningLaw: CountryOfGoverningLawFieldValidation().countryOfGoverningLaw,
|
|
1316
|
+
legalCompanyName: resolveFieldMetadata(
|
|
1317
|
+
isExperimentEnabled("StrictNameAndAddressValidationV4") ? defaultFieldConfigV4[country] : defaultFieldConfig$2[country],
|
|
1318
|
+
{ isBusiness: true },
|
|
1319
|
+
isExperimentEnabled("StrictNameAndAddressValidationV4") ? defaultFieldMetadataV4 : defaultFieldMetadata$2
|
|
1320
|
+
)?.validators,
|
|
1321
|
+
taxInformation: resolveFieldMetadata(
|
|
1322
|
+
taxInformationDefaultFieldConfig[country],
|
|
1323
|
+
{
|
|
1324
|
+
taxIdNumberType,
|
|
1325
|
+
companyType
|
|
1326
|
+
},
|
|
1327
|
+
taxInformationDefaultFieldMetadata
|
|
1328
|
+
)?.validators,
|
|
1329
|
+
stateOrProvince: resolveFieldMetadata(
|
|
1330
|
+
defaultFieldConfig$1[country],
|
|
1331
|
+
{ isBusiness: true },
|
|
1332
|
+
defaultFieldMetadata$1
|
|
1333
|
+
)?.validators,
|
|
1334
|
+
registrationNumber: resolveFieldMetadata(
|
|
1335
|
+
registrationNumberDefaultFieldConfig[country],
|
|
1336
|
+
{
|
|
1337
|
+
companyType,
|
|
1338
|
+
registrationNumberType,
|
|
1339
|
+
state,
|
|
1340
|
+
isExperimentEnabled
|
|
1341
|
+
},
|
|
1342
|
+
registrationNumberDefaultFieldMetadata
|
|
1343
|
+
)?.validators
|
|
1344
|
+
};
|
|
1345
|
+
}
|
|
1346
|
+
function businessSelectionValidators() {
|
|
1347
|
+
return {
|
|
1348
|
+
hasSelectedBusiness: {
|
|
1349
|
+
modes: ["blur", "input"],
|
|
1350
|
+
validate: (value) => typeof value === "boolean",
|
|
1351
|
+
// indicates a selection was made
|
|
1352
|
+
errorMessage: "fieldIsRequired"
|
|
1353
|
+
}
|
|
1354
|
+
};
|
|
1355
|
+
}
|
|
1356
|
+
function additionalInformationValidators({
|
|
1357
|
+
country,
|
|
1358
|
+
taxIdNumberType,
|
|
1359
|
+
companyType,
|
|
1360
|
+
registrationNumberType,
|
|
1361
|
+
vatNumberType,
|
|
1362
|
+
isExperimentEnabled
|
|
1363
|
+
}) {
|
|
1364
|
+
return {
|
|
1365
|
+
hasDoingBusinessAs: doingBusinessAsAbsentFieldMetadata.validators,
|
|
1366
|
+
doingBusinessAs: doingBusinessAsFieldMetadata.validators,
|
|
1367
|
+
registrationNumber: resolveFieldMetadata(
|
|
1368
|
+
registrationNumberDefaultFieldConfig[country],
|
|
1369
|
+
{
|
|
1370
|
+
companyType,
|
|
1371
|
+
registrationNumberType,
|
|
1372
|
+
isExperimentEnabled
|
|
1373
|
+
},
|
|
1374
|
+
registrationNumberDefaultFieldMetadata
|
|
1375
|
+
)?.validators,
|
|
1376
|
+
exemptedFromRegistrationNumber: exemptFromRegistrationNumberDefaultFieldMetadata.validators,
|
|
1377
|
+
taxInformation: resolveFieldMetadata(
|
|
1378
|
+
taxInformationDefaultFieldConfig[country],
|
|
1379
|
+
{
|
|
1380
|
+
taxIdNumberType,
|
|
1381
|
+
companyType
|
|
1382
|
+
},
|
|
1383
|
+
taxInformationDefaultFieldMetadata
|
|
1384
|
+
).validators,
|
|
1385
|
+
vatNumber: resolveFieldMetadata(
|
|
1386
|
+
defaultFieldConfig[country],
|
|
1387
|
+
{ vatNumberType },
|
|
1388
|
+
defaultFieldMetadata
|
|
1389
|
+
).validators,
|
|
1390
|
+
vatAbsenceReason: vatAbsenceReasonMetadata.validators,
|
|
1391
|
+
eInvoicingCode: eInvoicingCodeFieldMetadata.validators,
|
|
1392
|
+
dateOfIncorporation: dateOfIncorporationFieldMetadata.validators,
|
|
1393
|
+
stockExchangeMIC: stockExchangeMICFieldMetadata.validators,
|
|
1394
|
+
stockISIN: stockISINFieldMetadata.validators,
|
|
1395
|
+
stockTickerSymbol: stockTickerSymbolFieldMetadata.validators
|
|
1396
|
+
};
|
|
1397
|
+
}
|
|
1398
|
+
function BusinessDetailsMultiformDropin({
|
|
1399
|
+
taskType = TaskTypes.BUSINESS_DETAILS,
|
|
1400
|
+
country: propCountry,
|
|
1401
|
+
problems: propProblems,
|
|
1402
|
+
legalEntityResponse,
|
|
1403
|
+
associatedLegalArrangement,
|
|
1404
|
+
// initially undefined when creating entity
|
|
1405
|
+
nestedLegalEntity,
|
|
1406
|
+
// initially undefined when creating entity
|
|
1407
|
+
nestedLegalEntityDetails,
|
|
1408
|
+
// has entity roles for association logic
|
|
1409
|
+
onSubmit: onExternalSubmit,
|
|
1410
|
+
handleHomeClick,
|
|
1411
|
+
asModal = false
|
|
1412
|
+
}) {
|
|
1413
|
+
const { baseUrl, rootLegalEntityId } = useApiContext();
|
|
1414
|
+
const { i18n } = useI18nContext();
|
|
1415
|
+
const userEvents = useAnalyticsContext();
|
|
1416
|
+
const { showToast } = useToastContext();
|
|
1417
|
+
const queryClient = useQueryClient();
|
|
1418
|
+
const { isExperimentEnabled } = useExperimentsContext();
|
|
1419
|
+
const { accountHolder, setAccountHolder } = useAccountHolder();
|
|
1420
|
+
const { mutateAsync: createLegalEntity } = useCreateLegalEntity();
|
|
1421
|
+
const { mutateAsync: updateLegalEntity } = useUpdateLegalEntity();
|
|
1422
|
+
const [country, setCountry] = useState(propCountry);
|
|
1423
|
+
const [documents, setDocuments] = useState();
|
|
1424
|
+
const [problems, setProblems] = useState(propProblems ?? {});
|
|
1425
|
+
const [loadingStatus, setLoadingStatus] = useState("success");
|
|
1426
|
+
const [derivedProps, setDerivedProps] = useState();
|
|
1427
|
+
const [trustedFields, setTrustedFields] = useState(
|
|
1428
|
+
legalEntityResponse?.trustedFields ?? void 0
|
|
1429
|
+
);
|
|
1430
|
+
const defaultForms = useMemo(() => getForms(country), [country]);
|
|
1431
|
+
const documentUtils = documentApiUtils({
|
|
1432
|
+
baseUrl: baseUrl.value,
|
|
1433
|
+
rootLegalEntityId: rootLegalEntityId.value
|
|
1434
|
+
});
|
|
1435
|
+
useEffect(() => {
|
|
1436
|
+
if (!legalEntityResponse?.documentDetails?.length) return;
|
|
1437
|
+
documentUtils.fetchDocuments(legalEntityResponse.documentDetails, legalEntityResponse?.id).then(() => {
|
|
1438
|
+
setDocuments(mapApiDocumentToBusinessDetailsDocuments(legalEntityResponse?.id));
|
|
1439
|
+
}).catch(() => {
|
|
1440
|
+
showToast({ label: i18n.get("failedToFetchRelevantDocuments"), variant: "error" });
|
|
1441
|
+
});
|
|
1442
|
+
}, [legalEntityResponse.documentDetails, legalEntityResponse?.id]);
|
|
1443
|
+
const parseConfiguration = useCallback(
|
|
1444
|
+
({ scenarios }) => composePerScenarioFormConfigurations(scenarios, businessDetailsFieldsPerScenario),
|
|
1445
|
+
[]
|
|
1446
|
+
);
|
|
1447
|
+
const { fieldConfigurations } = useScenarioConfiguration({
|
|
1448
|
+
legalEntityType: LegalEntityTypes.ORGANIZATION,
|
|
1449
|
+
parseConfiguration,
|
|
1450
|
+
setLoadingStatus,
|
|
1451
|
+
country
|
|
1452
|
+
});
|
|
1453
|
+
const defaultData = useMemo(
|
|
1454
|
+
() => ({
|
|
1455
|
+
...mapLegalEntityToBusinessDetailsSchema(legalEntityResponse, {}, isExperimentEnabled),
|
|
1456
|
+
...documents
|
|
1457
|
+
}),
|
|
1458
|
+
[legalEntityResponse, documents, isExperimentEnabled]
|
|
1459
|
+
);
|
|
1460
|
+
const buildFieldValidations = useCallback(
|
|
1461
|
+
(data) => {
|
|
1462
|
+
const taxInfo = data?.basicInformation?.taxInformation ?? data?.additionalInformation?.taxInformation;
|
|
1463
|
+
const taxIdType = taxInfo?.length ? taxInfo.find((taxId) => taxId.country === country)?.type : void 0;
|
|
1464
|
+
const regNumberType = data?.basicInformation?.registrationNumberType ?? data?.additionalInformation?.registrationNumberType;
|
|
1465
|
+
return {
|
|
1466
|
+
basicInformation: basicInformationValidators({
|
|
1467
|
+
country,
|
|
1468
|
+
state: data?.basicInformation?.stateOrProvince,
|
|
1469
|
+
companyType: data?.companyStructure?.entityType,
|
|
1470
|
+
taxIdNumberType: taxIdType,
|
|
1471
|
+
registrationNumberType: regNumberType,
|
|
1472
|
+
isExperimentEnabled
|
|
1473
|
+
}),
|
|
1474
|
+
businessSelection: businessSelectionValidators(),
|
|
1475
|
+
companyStructure: CompanyStructureValidation,
|
|
1476
|
+
additionalInformation: additionalInformationValidators({
|
|
1477
|
+
country,
|
|
1478
|
+
taxIdNumberType: taxIdType,
|
|
1479
|
+
companyType: data?.companyStructure?.entityType,
|
|
1480
|
+
registrationNumberType: regNumberType,
|
|
1481
|
+
vatNumberType: data?.additionalInformation?.vatNumberType,
|
|
1482
|
+
isExperimentEnabled
|
|
1483
|
+
}),
|
|
1484
|
+
financialInformation: financialInfoValidationWithEmployeesRules
|
|
1485
|
+
};
|
|
1486
|
+
},
|
|
1487
|
+
[country, isExperimentEnabled]
|
|
1488
|
+
);
|
|
1489
|
+
const multiForm = useMultiForm({
|
|
1490
|
+
defaultData,
|
|
1491
|
+
allFields: derivedProps?.allFields,
|
|
1492
|
+
requiredFields: derivedProps?.requiredFields,
|
|
1493
|
+
optionalFields: derivedProps?.optionalFields,
|
|
1494
|
+
obscuredFields: derivedProps?.obscuredFields,
|
|
1495
|
+
trustedFields: derivedProps?.trustedFields,
|
|
1496
|
+
rules: buildFieldValidations
|
|
1497
|
+
});
|
|
1498
|
+
const isTinMatched = tinMatched.value;
|
|
1499
|
+
const customRules = useMemo(
|
|
1500
|
+
() => rules({
|
|
1501
|
+
data: multiForm.data,
|
|
1502
|
+
country,
|
|
1503
|
+
taskType,
|
|
1504
|
+
isExperimentEnabled,
|
|
1505
|
+
accountHolder,
|
|
1506
|
+
tinMatched: isTinMatched,
|
|
1507
|
+
rootLegalEntity: legalEntityResponse
|
|
1508
|
+
}),
|
|
1509
|
+
[
|
|
1510
|
+
multiForm.data,
|
|
1511
|
+
country,
|
|
1512
|
+
taskType,
|
|
1513
|
+
isExperimentEnabled,
|
|
1514
|
+
accountHolder,
|
|
1515
|
+
isTinMatched,
|
|
1516
|
+
legalEntityResponse
|
|
1517
|
+
]
|
|
1518
|
+
);
|
|
1519
|
+
useEffect(() => {
|
|
1520
|
+
const props = getPropsFromConfigurations(
|
|
1521
|
+
fieldConfigurations,
|
|
1522
|
+
defaultForms,
|
|
1523
|
+
problems?.remediationActions ? Object.values(problems?.remediationActions) : [],
|
|
1524
|
+
problems?.missingData ?? [],
|
|
1525
|
+
getFieldsWithExistingData(
|
|
1526
|
+
legalEntityResponse,
|
|
1527
|
+
businessDetailsApiKeyMapping,
|
|
1528
|
+
businessDetailsDocumentMapping
|
|
1529
|
+
),
|
|
1530
|
+
customRules,
|
|
1531
|
+
{},
|
|
1532
|
+
{},
|
|
1533
|
+
legalEntityResponse?.type,
|
|
1534
|
+
trustedFields
|
|
1535
|
+
);
|
|
1536
|
+
setDerivedProps(props);
|
|
1537
|
+
}, [
|
|
1538
|
+
customRules,
|
|
1539
|
+
defaultForms,
|
|
1540
|
+
fieldConfigurations,
|
|
1541
|
+
legalEntityResponse,
|
|
1542
|
+
problems?.missingData,
|
|
1543
|
+
problems?.remediationActions,
|
|
1544
|
+
trustedFields
|
|
1545
|
+
]);
|
|
1546
|
+
const [prevCountry, setPrevCountry] = useState(multiForm.data.basicInformation?.country);
|
|
1547
|
+
if (multiForm.data.basicInformation?.country && prevCountry !== multiForm.data.basicInformation?.country) {
|
|
1548
|
+
setCountry(multiForm.data?.basicInformation?.country);
|
|
1549
|
+
setPrevCountry(multiForm.data.basicInformation?.country);
|
|
1550
|
+
setTrustedFields(void 0);
|
|
1551
|
+
}
|
|
1552
|
+
const [forms, setForms] = useState(
|
|
1553
|
+
buildRequiredForms({
|
|
1554
|
+
config: {
|
|
1555
|
+
country,
|
|
1556
|
+
forms: defaultForms,
|
|
1557
|
+
requiredFields: derivedProps?.requiredFields,
|
|
1558
|
+
optionalFields: derivedProps?.optionalFields,
|
|
1559
|
+
isValid: multiForm.isValid ?? {},
|
|
1560
|
+
problems
|
|
1561
|
+
}
|
|
1562
|
+
})
|
|
1563
|
+
);
|
|
1564
|
+
const updateForms = useCallback(
|
|
1565
|
+
({
|
|
1566
|
+
searchResults,
|
|
1567
|
+
verifiedBusiness: verifiedBusiness2
|
|
1568
|
+
}) => {
|
|
1569
|
+
const updatedForms = buildRequiredForms({
|
|
1570
|
+
config: {
|
|
1571
|
+
country,
|
|
1572
|
+
forms: defaultForms,
|
|
1573
|
+
requiredFields: derivedProps?.requiredFields,
|
|
1574
|
+
optionalFields: derivedProps?.optionalFields,
|
|
1575
|
+
isValid: multiForm.isValid ?? {},
|
|
1576
|
+
problems
|
|
1577
|
+
},
|
|
1578
|
+
options: {
|
|
1579
|
+
hasNoSearchResults: searchResults && !searchResults.length,
|
|
1580
|
+
verifiedBusiness: verifiedBusiness2
|
|
1581
|
+
}
|
|
1582
|
+
});
|
|
1583
|
+
setForms(updatedForms);
|
|
1584
|
+
return updatedForms;
|
|
1585
|
+
},
|
|
1586
|
+
[
|
|
1587
|
+
country,
|
|
1588
|
+
defaultForms,
|
|
1589
|
+
derivedProps?.optionalFields,
|
|
1590
|
+
derivedProps?.requiredFields,
|
|
1591
|
+
multiForm.isValid,
|
|
1592
|
+
problems
|
|
1593
|
+
]
|
|
1594
|
+
);
|
|
1595
|
+
const summaryData = useMemo(
|
|
1596
|
+
() => formatDataForSummary(
|
|
1597
|
+
multiForm.data,
|
|
1598
|
+
forms,
|
|
1599
|
+
derivedProps?.labels,
|
|
1600
|
+
i18n,
|
|
1601
|
+
isExperimentEnabled
|
|
1602
|
+
),
|
|
1603
|
+
[derivedProps?.labels, multiForm.data, forms, i18n, isExperimentEnabled]
|
|
1604
|
+
);
|
|
1605
|
+
const associatedLeTrackingParams = useMemo(
|
|
1606
|
+
() => getAssociatedLeAnalyticsPayload({
|
|
1607
|
+
associatedLegalEntity: associatedLegalArrangement
|
|
1608
|
+
}),
|
|
1609
|
+
[associatedLegalArrangement]
|
|
1610
|
+
);
|
|
1611
|
+
const handleTrackNavigation = useCallback(
|
|
1612
|
+
(props) => {
|
|
1613
|
+
trackNavigation({
|
|
1614
|
+
...props,
|
|
1615
|
+
additionalTrackingParams: associatedLeTrackingParams
|
|
1616
|
+
});
|
|
1617
|
+
},
|
|
1618
|
+
[associatedLeTrackingParams]
|
|
1619
|
+
);
|
|
1620
|
+
const submitTask = useCallback(() => {
|
|
1621
|
+
setAccountHolder(accountHolder);
|
|
1622
|
+
return submit({
|
|
1623
|
+
additionalTrackingParams: associatedLeTrackingParams,
|
|
1624
|
+
data: multiForm.data,
|
|
1625
|
+
legalEntityResponse,
|
|
1626
|
+
associatedLegalArrangement,
|
|
1627
|
+
nestedLegalEntity,
|
|
1628
|
+
nestedLegalEntityDetails,
|
|
1629
|
+
problems,
|
|
1630
|
+
taskType: taskType ?? TaskTypes.BUSINESS_DETAILS,
|
|
1631
|
+
accountHolder: accountHolder ?? "theCompanyIWorkFor",
|
|
1632
|
+
forms,
|
|
1633
|
+
documentUtils,
|
|
1634
|
+
i18n,
|
|
1635
|
+
showToast,
|
|
1636
|
+
setLoadingStatus,
|
|
1637
|
+
setProblems,
|
|
1638
|
+
handleUpdateLegalEntity: updateLegalEntity,
|
|
1639
|
+
createLegalEntity,
|
|
1640
|
+
onExternalSubmit,
|
|
1641
|
+
isExperimentEnabled,
|
|
1642
|
+
userEvents
|
|
1643
|
+
});
|
|
1644
|
+
}, [
|
|
1645
|
+
setAccountHolder,
|
|
1646
|
+
accountHolder,
|
|
1647
|
+
associatedLeTrackingParams,
|
|
1648
|
+
multiForm.data,
|
|
1649
|
+
legalEntityResponse,
|
|
1650
|
+
associatedLegalArrangement,
|
|
1651
|
+
nestedLegalEntity,
|
|
1652
|
+
nestedLegalEntityDetails,
|
|
1653
|
+
problems,
|
|
1654
|
+
taskType,
|
|
1655
|
+
forms,
|
|
1656
|
+
documentUtils,
|
|
1657
|
+
i18n,
|
|
1658
|
+
showToast,
|
|
1659
|
+
updateLegalEntity,
|
|
1660
|
+
createLegalEntity,
|
|
1661
|
+
onExternalSubmit,
|
|
1662
|
+
isExperimentEnabled,
|
|
1663
|
+
userEvents
|
|
1664
|
+
]);
|
|
1665
|
+
const {
|
|
1666
|
+
handleNextClick,
|
|
1667
|
+
handleBackClick,
|
|
1668
|
+
activeForm,
|
|
1669
|
+
shouldValidate,
|
|
1670
|
+
gotoFormByFormIndex,
|
|
1671
|
+
steps
|
|
1672
|
+
} = useFormComposer({
|
|
1673
|
+
problems,
|
|
1674
|
+
navigationTrackingParams: associatedLeTrackingParams,
|
|
1675
|
+
forms,
|
|
1676
|
+
onSubmit: submitTask,
|
|
1677
|
+
triggerValidation: multiForm.triggerValidation
|
|
1678
|
+
});
|
|
1679
|
+
const handleBusinessMismatchContinue = () => {
|
|
1680
|
+
setTrustedFields([]);
|
|
1681
|
+
businessMismatchModalOpen.value = false;
|
|
1682
|
+
handleNextClick();
|
|
1683
|
+
};
|
|
1684
|
+
const handleBusinessMismatchCancel = () => {
|
|
1685
|
+
handleBackClick?.();
|
|
1686
|
+
businessMismatchModalOpen.value = false;
|
|
1687
|
+
tinMatched.value = false;
|
|
1688
|
+
};
|
|
1689
|
+
const companySearchQueryInput = {
|
|
1690
|
+
name: multiForm.data?.basicInformation?.legalCompanyName ?? "",
|
|
1691
|
+
country: multiForm.data?.basicInformation?.country,
|
|
1692
|
+
state: multiForm.data?.basicInformation?.stateOrProvince,
|
|
1693
|
+
registrationNumber: multiForm.data?.basicInformation?.registrationNumber
|
|
1694
|
+
};
|
|
1695
|
+
const verifyTinQueryInput = {
|
|
1696
|
+
name: multiForm.data.basicInformation?.legalCompanyName ?? "",
|
|
1697
|
+
tin: multiForm.data?.basicInformation?.taxInformation?.find((taxId) => taxId.country === country)?.number ?? ""
|
|
1698
|
+
};
|
|
1699
|
+
const { data: companySearchResponse } = useCompanySearch(companySearchQueryInput, {
|
|
1700
|
+
enabled: false
|
|
1701
|
+
});
|
|
1702
|
+
useVerifyTin(verifyTinQueryInput, { enabled: false });
|
|
1703
|
+
const attemptBusinessSearch = async () => {
|
|
1704
|
+
try {
|
|
1705
|
+
setLoadingStatus("loading");
|
|
1706
|
+
const searchResponse = await queryClient.fetchQuery({
|
|
1707
|
+
queryKey: ["companySearch", companySearchQueryInput]
|
|
1708
|
+
});
|
|
1709
|
+
const currentForms = updateForms({ searchResults: searchResponse.results });
|
|
1710
|
+
if (!searchResponse.results.length) {
|
|
1711
|
+
const tinVerificationResponse = await queryClient.fetchQuery({
|
|
1712
|
+
queryKey: ["verifyTin", verifyTinQueryInput]
|
|
1713
|
+
});
|
|
1714
|
+
if (!tinVerificationResponse?.matched) {
|
|
1715
|
+
businessMismatchModalOpen.value = true;
|
|
1716
|
+
tinMatched.value = false;
|
|
1717
|
+
return setLoadingStatus("success");
|
|
1718
|
+
} else {
|
|
1719
|
+
tinMatched.value = true;
|
|
1720
|
+
}
|
|
1721
|
+
}
|
|
1722
|
+
setLoadingStatus("success");
|
|
1723
|
+
return handleNextClick(currentForms);
|
|
1724
|
+
} catch {
|
|
1725
|
+
setLoadingStatus("error");
|
|
1726
|
+
}
|
|
1727
|
+
};
|
|
1728
|
+
const overrideNextClick = async () => {
|
|
1729
|
+
if (!activeForm.isValid) return handleNextClick();
|
|
1730
|
+
if (!COUNTRIES_USING_COMPANY_SEARCH.includes(country)) {
|
|
1731
|
+
return handleNextClick();
|
|
1732
|
+
}
|
|
1733
|
+
switch (activeForm.formId) {
|
|
1734
|
+
case "basicInformation": {
|
|
1735
|
+
return await attemptBusinessSearch();
|
|
1736
|
+
}
|
|
1737
|
+
case "businessSelection": {
|
|
1738
|
+
const currentForms = updateForms({
|
|
1739
|
+
searchResults: companySearchResponse?.results,
|
|
1740
|
+
verifiedBusiness: verifiedBusiness.value
|
|
1741
|
+
});
|
|
1742
|
+
return handleNextClick(currentForms);
|
|
1743
|
+
}
|
|
1744
|
+
default:
|
|
1745
|
+
return handleNextClick();
|
|
1746
|
+
}
|
|
1747
|
+
};
|
|
1748
|
+
useEffect(() => {
|
|
1749
|
+
updateForms({
|
|
1750
|
+
searchResults: companySearchResponse?.results,
|
|
1751
|
+
verifiedBusiness: verifiedBusiness.value
|
|
1752
|
+
});
|
|
1753
|
+
}, [updateForms, companySearchResponse?.results]);
|
|
1754
|
+
return /* @__PURE__ */ jsx(FormContextProvider, { form: multiForm, children: /* @__PURE__ */ jsxs(
|
|
1755
|
+
FormFlow,
|
|
1756
|
+
{
|
|
1757
|
+
summary: {
|
|
1758
|
+
data: summaryData,
|
|
1759
|
+
omitted: {
|
|
1760
|
+
keys: ["operationalAddressIsSame"],
|
|
1761
|
+
forms: ["businessSelection"]
|
|
1762
|
+
},
|
|
1763
|
+
problems,
|
|
1764
|
+
trackNavigation: handleTrackNavigation,
|
|
1765
|
+
showLegalCaption: true
|
|
1766
|
+
},
|
|
1767
|
+
asModal,
|
|
1768
|
+
currentStep: steps.current,
|
|
1769
|
+
totalSteps: steps.total,
|
|
1770
|
+
forms,
|
|
1771
|
+
disableNextButton: activeForm.formId === "businessSelection",
|
|
1772
|
+
gotoFormByFormIndex,
|
|
1773
|
+
handleNextClick: overrideNextClick,
|
|
1774
|
+
handleBackClick,
|
|
1775
|
+
handleCancelClick: handleHomeClick,
|
|
1776
|
+
loadingStatus,
|
|
1777
|
+
children: [
|
|
1778
|
+
/* @__PURE__ */ jsx(
|
|
1779
|
+
BusinessDetailsMultiform,
|
|
1780
|
+
{
|
|
1781
|
+
taskType,
|
|
1782
|
+
activeForm,
|
|
1783
|
+
country,
|
|
1784
|
+
shouldValidate,
|
|
1785
|
+
problems,
|
|
1786
|
+
handleNextClick: overrideNextClick,
|
|
1787
|
+
handleBackClick,
|
|
1788
|
+
setLoadingStatus
|
|
1789
|
+
}
|
|
1790
|
+
),
|
|
1791
|
+
businessMismatchModalOpen.value && /* @__PURE__ */ jsx(
|
|
1792
|
+
Confirm,
|
|
1793
|
+
{
|
|
1794
|
+
title: i18n.get("businessSelection__tinVerificationFailureModalHeader"),
|
|
1795
|
+
description: i18n.get("businessSelection__tinVerificationFailureModalContent"),
|
|
1796
|
+
cancelText: i18n.get("businessSelection__tinVerificationFailureModalSecondaryButton"),
|
|
1797
|
+
confirmText: i18n.get("businessSelection__tinVerificationFailureModalPrimaryButton"),
|
|
1798
|
+
onCancel: handleBusinessMismatchCancel,
|
|
1799
|
+
onConfirm: handleBusinessMismatchContinue
|
|
1800
|
+
}
|
|
1801
|
+
)
|
|
1802
|
+
]
|
|
1803
|
+
}
|
|
1804
|
+
) });
|
|
1805
|
+
}
|
|
1806
|
+
const RootBusinessDetailsPage = ({
|
|
1807
|
+
isTargetLegalEntityType = false,
|
|
1808
|
+
onSubmit,
|
|
1809
|
+
handleHomeClick
|
|
1810
|
+
}) => {
|
|
1811
|
+
const { accountHolder } = useAccountHolder();
|
|
1812
|
+
const { data: rootLe } = useLegalEntity(ROOT_LE);
|
|
1813
|
+
const capabilityProblems = useCapabilityProblems();
|
|
1814
|
+
const { isExperimentEnabled } = useExperimentsContext();
|
|
1815
|
+
if (!rootLe) {
|
|
1816
|
+
return /* @__PURE__ */ jsx(Loader, {});
|
|
1817
|
+
}
|
|
1818
|
+
const hasTrust = accountHolder === "aTrust" || isPartOfTrustFromLegalEntity(rootLe);
|
|
1819
|
+
const problems = capabilityProblems ? getProblemsForEntity(capabilityProblems, EntityTypes.LEGAL_ENTITY, rootLe.id) : void 0;
|
|
1820
|
+
return isExperimentEnabled("EnableBusinessDetailsMultiForm") ? /* @__PURE__ */ jsx(
|
|
1821
|
+
BusinessDetailsMultiformDropin,
|
|
1822
|
+
{
|
|
1823
|
+
taskType: TaskTypes.BUSINESS_DETAILS,
|
|
1824
|
+
taskName: hasTrust ? "businessTrusteeDetails" : "businessDetails",
|
|
1825
|
+
legalEntityResponse: rootLe,
|
|
1826
|
+
problems,
|
|
1827
|
+
country: getLegalEntityCountry(rootLe),
|
|
1828
|
+
isTargetLegalEntityType,
|
|
1829
|
+
onSubmit,
|
|
1830
|
+
handleHomeClick
|
|
1831
|
+
}
|
|
1832
|
+
) : /* @__PURE__ */ jsx(
|
|
1833
|
+
BusinessDetailsDropin,
|
|
1834
|
+
{
|
|
1835
|
+
taskType: TaskTypes.BUSINESS_DETAILS,
|
|
1836
|
+
taskName: hasTrust ? "businessTrusteeDetails" : "businessDetails",
|
|
1837
|
+
legalEntityResponse: rootLe,
|
|
1838
|
+
problems,
|
|
1839
|
+
country: getLegalEntityCountry(rootLe),
|
|
1840
|
+
isTargetLegalEntityType,
|
|
1841
|
+
onSubmit,
|
|
1842
|
+
handleHomeClick
|
|
1843
|
+
}
|
|
1844
|
+
);
|
|
1845
|
+
};
|
|
1846
|
+
export {
|
|
1847
|
+
RootBusinessDetailsPage
|
|
1848
|
+
};
|