@adyen/kyc-components 3.75.0 → 3.76.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AcceptTermsOfServiceComponent-D9BqzBSv.js → AcceptTermsOfServiceComponent-3E8Il5o6.js} +13 -13
- package/dist/{AccountSetupRejected-DDAukYal.js → AccountSetupRejected-3pxfVQJh.js} +2 -2
- package/dist/{Avatar-BbZMTb8k.js → Avatar-w8iols1r.js} +2 -2
- package/dist/{BusinessDetailsDropin-DnzFYLRt.js → BusinessDetailsDropin-BdNUM5PA.js} +16 -11
- package/dist/{BusinessFinancingComponent-bvZd44Rw.js → BusinessFinancingComponent-Ds_Xgeep.js} +2 -2
- package/dist/{BusinessFinancingDropin-BX3j5n4C.js → BusinessFinancingDropin-B7r2WGiX.js} +549 -602
- package/dist/{BusinessFinancingPage-CJfiMMfk.js → BusinessFinancingPage-DpseIuTN.js} +2 -2
- package/dist/{BusinessTypeSelectionPage-Bik9pa-u.js → BusinessTypeSelectionPage-BP84EyUt.js} +8 -6
- package/dist/ContractViewer-BrJWrgKk.js +938 -0
- package/dist/{CreateIndividualComponent-CoDfMD_a.js → CreateIndividualComponent-eEsyKzGC.js} +3 -3
- package/dist/{CreateTransferInstrumentComponent-BAiNYpnJ.js → CreateTransferInstrumentComponent-BTLcFd-H.js} +2 -2
- package/dist/{CustomerSupport-Bdgvjix7.js → CustomerSupport-DY_0BLgx.js} +5 -5
- package/dist/{DebugModal-CP_i_HwK.js → DebugModal-dS_iU5yB.js} +8 -8
- package/dist/{DecisionMakerDetailsPage-CQYnk9Xn.js → DecisionMakerDetailsPage-DcMuIHCt.js} +3 -3
- package/dist/{DecisionMakers-DIbnecVR.js → DecisionMakers-BYikcBnN.js} +4 -4
- package/dist/{ES-JRIf-4xI.js → ES-BlWV7xvh.js} +4 -6
- package/dist/{EmbeddedStatus-7QJ_s7hU.js → EmbeddedStatus-CII97Leo.js} +12 -4
- package/dist/{FormEndState-QUOVERNX.js → FormEndState-CZ6KCgSg.js} +2 -2
- package/dist/{FormFlow-5amikWjq.js → FormFlow-B8-6ExTs.js} +2 -2
- package/dist/{IndividualOnfidoDropin-CSCL01a1.js → IndividualOnfidoDropin-CWEFFU8Z.js} +430 -111
- package/dist/{Introduction-DBSQEy6y.js → Introduction-CJ-vn9GL.js} +3 -3
- package/dist/{LegalRepresentativeDetailsPage-CrjuBP77.js → LegalRepresentativeDetailsPage-CU2yZa1V.js} +3 -3
- package/dist/{ManageIndividualComponent-CJKe2m5v.js → ManageIndividualComponent-DsV7yIaQ.js} +3 -3
- package/dist/{ManagePCIComponent-0UNI8r60.js → ManagePCIComponent-ClK6UPby.js} +3 -3
- package/dist/{ManageTermsOfServiceComponent-BzPvl0Uj.js → ManageTermsOfServiceComponent-5NkdcSug.js} +3 -3
- package/dist/{ManageTransferInstrumentComponent-DDFqLUKi.js → ManageTransferInstrumentComponent-6vB0oU1P.js} +4 -4
- package/dist/{OnboardingDropinComponent-CSKoOnT3.js → OnboardingDropinComponent-C6ShEXmS.js} +35 -37
- package/dist/{ProviderButton-dT0L8DyH.js → ProviderButton-CZzRh5_w.js} +2 -2
- package/dist/{Review-j_fM9ZVG.js → Review-B6CMmiPA.js} +3 -3
- package/dist/{RootBusinessDetailsPage-DE9lxNvR.js → RootBusinessDetailsPage-BLXlZst2.js} +3 -3
- package/dist/{RootIndividualDetailsPage-C9snBMjZ.js → RootIndividualDetailsPage-6gLqhrlP.js} +3 -3
- package/dist/{SignPCIComponent-CFVC6kgV.js → SignPCIComponent-DyO9DwX3.js} +5 -5
- package/dist/{SingpassSelection-DhZ0lKPK.js → SingpassSelection-vRtJGcpJ.js} +2 -2
- package/dist/{SoleProprietorshipPage-COYe6zum.js → SoleProprietorshipPage-Ct22koOh.js} +4 -4
- package/dist/{SourceOfFunds.module-CGbDhT49.js → SourceOfFunds.module-_vRTDqII.js} +2 -2
- package/dist/{SourceOfFundsPage-BvkaxOZI.js → SourceOfFundsPage-CTIV8szk.js} +26 -32
- package/dist/{StoreProvider-CtNk8ekh.js → StoreProvider-DM45wVPv.js} +1932 -1801
- package/dist/{TaskItemStatus-D9sCIHON.js → TaskItemStatus-DkwylP-j.js} +2 -2
- package/dist/{TaxReportingDropin-DNYZLN8P.js → TaxReportingDropin-b-pvErAT.js} +7 -7
- package/dist/{TileGroup-Cx7Y_NBf.js → TileGroup-C3XSiC3m.js} +2 -2
- package/dist/{TrustDetailsPage-BSBZ9f9z.js → TrustDetailsPage-DXZeqMEJ.js} +23 -18
- package/dist/{TrustMemberCompanyPage-BUuLS-57.js → TrustMemberCompanyPage-C32or905.js} +4 -4
- package/dist/{TrustMemberIndividualPage-Dl9JzqNb.js → TrustMemberIndividualPage-BQkmNAR-.js} +3 -3
- package/dist/{UnincorporatedPartnershipIndividualPage-DJOZzVIP.js → UnincorporatedPartnershipIndividualPage-CZ_ilPuJ.js} +3 -3
- package/dist/{UnincorporatedPartnershipMemberCompanyPage-B7sGrwJD.js → UnincorporatedPartnershipMemberCompanyPage-BaYSbVqH.js} +3 -3
- package/dist/{VerificationErrorAlert-BNvtGKmX.js → VerificationErrorAlert-9fpwho6Z.js} +1 -1
- package/dist/{ViewVerificationStatusComponent-BW1v9vLK.js → ViewVerificationStatusComponent-DI1ROy_K.js} +3 -3
- package/dist/adyen-business-financing.js +2 -2
- package/dist/adyen-individual.js +2 -2
- package/dist/adyen-kyc-components.js +16 -15
- package/dist/adyen-manage-individual.js +2 -2
- package/dist/adyen-manage-pci.js +2 -2
- package/dist/adyen-manage-terms-of-service.js +2 -2
- package/dist/adyen-manage-transfer-instruments.js +2 -2
- package/dist/adyen-onboarding.js +2 -2
- package/dist/adyen-sign-pci.js +2 -2
- 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/{bg-BG-BV_GOHGg.js → bg-BG-COTwZXwN.js} +11 -5
- package/dist/{cs-CZ-CZDCUWRh.js → cs-CZ-DUlgJKVq.js} +11 -5
- package/dist/{css-BeplOBd-.js → css-DLrTXL5E.js} +1 -1
- package/dist/{da-DK-BmTgxKpq.js → da-DK-BDzDHhVR.js} +11 -5
- package/dist/{de-DE-DZeG8NVg.js → de-DE-DJdgXqS_.js} +10 -4
- package/dist/{el-GR-C3likHBP.js → el-GR-D5i9BNyh.js} +11 -5
- package/dist/{es-ES-DHhHHeU-.js → es-ES-VOSWszW5.js} +11 -5
- package/dist/{et-EE-CiD_oBu3.js → et-EE-Bp4Ngsn4.js} +10 -4
- package/dist/{fi-FI-DAZqSyjL.js → fi-FI-DaujOE-a.js} +10 -4
- package/dist/{fr-FR-vs5BYMWx.js → fr-FR-BdPZxk11.js} +11 -5
- package/dist/{getFieldsWithExistingData-CW5dHE28.js → getFieldsWithExistingData-BpnXzG0Z.js} +2 -2
- package/dist/{hasDataChanged-CYQbu-tN.js → hasDataChanged-BaY3OsmC.js} +1 -1
- package/dist/{hr-HR-CcaMvc2K.js → hr-HR-BY7C7NxY.js} +10 -4
- package/dist/{hu-HU-CzBd9g0P.js → hu-HU-DHCty-Tc.js} +11 -5
- package/dist/{it-IT-BXIdTOUw.js → it-IT-BMsuhZEQ.js} +11 -5
- package/dist/{ja-JP-CngmcMI-.js → ja-JP-BYDz1z2G.js} +10 -4
- package/dist/{json-QZSVaICP.js → json-CS3b3jJ1.js} +1 -1
- package/dist/{localizeDateString-CjNwvcza.js → localizeDateString-C2CJszPy.js} +2 -2
- package/dist/{lt-LT-Dpyaroh2.js → lt-LT-DNJ9V9xV.js} +10 -4
- package/dist/{lv-LV-CCcm8aDW.js → lv-LV-CFJwN5wq.js} +11 -5
- package/dist/{mapFinancialReportsToFinancialInformation-CLDDiIVD.js → mapFinancialReportsToFinancialInformation-BN4Vmw7c.js} +2 -2
- package/dist/{nl-NL-gYpP7VMA.js → nl-NL-DibAf790.js} +11 -5
- package/dist/{no-NO-nOXLv4rO.js → no-NO-DHCy5rXx.js} +11 -5
- package/dist/{pl-PL-Dwlwj1ob.js → pl-PL-eZBNH5HH.js} +11 -5
- package/dist/{plaintext-B8616351.js → plaintext-CXAD4WEx.js} +1 -1
- package/dist/{pt-PT-DbQbuaCm.js → pt-PT-CiN_Wmfe.js} +10 -4
- package/dist/{resolveEnvironment-CCdmx-Up.js → resolveEnvironment-5aP6q0Hz.js} +3 -3
- package/dist/{ro-RO-ZTuJtIop.js → ro-RO-CgyMTvLc.js} +10 -4
- package/dist/{rules-CPHbHoD6.js → rules-CoKrBCOP.js} +12 -5
- package/dist/{sk-SK-Ba8jBCvr.js → sk-SK-B5qlQB_U.js} +10 -4
- package/dist/{sl-SI-DszG8wEm.js → sl-SI-8PPfrGzL.js} +10 -4
- package/dist/style.css +1818 -2569
- package/dist/styles-CLV89_hH.js +1819 -2570
- package/dist/{sv-SE-Fo7zzjiG.js → sv-SE-ZWLw6D3j.js} +11 -5
- package/dist/types/api/address/useAddressCleanse.d.ts +1 -1
- package/dist/types/api/configurations/useScenarios.d.ts +18 -12
- package/dist/types/api/createLegalEntity/useCreateLegalEntity.d.ts +11 -11
- package/dist/types/api/idNowProvider/idNowProvider.types.d.ts +7 -0
- package/dist/types/api/idNowProvider/useIdNowProvider.d.ts +14 -0
- package/dist/types/api/legalEntity/useLegalEntity.d.ts +285 -223
- package/dist/types/api/legalEntity/useUpdateLegalEntity.d.ts +11 -11
- package/dist/types/api/queryKeys.d.ts +2 -1
- package/dist/types/components/BankAccount/forms/BankDocument/BankDocument.d.ts +0 -1
- package/dist/types/components/BankAccount/forms/BankDocument/BankDocumentRequirements.d.ts +0 -1
- package/dist/types/components/BankAccount/forms/BankVerification/BankVerification.d.ts +2 -2
- package/dist/types/components/BankAccount/forms/PayoutAccount/CheckGuidance/CheckGuidance.d.ts +0 -1
- package/dist/types/components/BankAccount/forms/PayoutDetails/PayoutDetails.d.ts +0 -1
- package/dist/types/components/BankAccount/forms/PayoutDetails/rules.d.ts +5 -5
- package/dist/types/components/BankAccount/mapping/mapPayoutDocumentsToApiDocuments.d.ts +1 -1
- package/dist/types/components/BankAccount/mapping/payoutKeyMappings.d.ts +1919 -1919
- package/dist/types/components/BankAccount/utils/payoutAccountUtil.d.ts +1 -1
- package/dist/types/components/Business/forms/AdditionalInformation/utils.d.ts +1 -0
- package/dist/types/components/Business/forms/BusinessSelection/BusinessSelection.d.ts +1 -1
- package/dist/types/components/Business/forms/rules.d.ts +20 -18
- package/dist/types/components/Business/tasks/BusinessDetailsDropin/businessDetailsStore.d.ts +2 -2
- package/dist/types/components/Contract/tasks/ServiceAgreementDropin/ServiceAgreementDropin.d.ts +0 -1
- package/dist/types/components/EFP/fields/LegalFormField/types.d.ts +1 -0
- package/dist/types/components/EFP/fields/NaceCodeField/types.d.ts +1 -0
- package/dist/types/components/EFP/mapping/businessFinancingKeyMappings.d.ts +2355 -24
- package/dist/types/components/EFP/mapping/mapBusinessFinancingToLegalEntity.d.ts +2 -2
- package/dist/types/components/EFP/mapping/mapLegalEntityToBusinessFinancing.d.ts +1 -2
- package/dist/types/components/EFP/tasks/BusinessFinancingDropin/BusinessFinancingBasicCompanyInformation.d.ts +5 -1
- package/dist/types/components/EFP/tasks/BusinessFinancingDropin/BusinessFinancingBusinessInformation.d.ts +10 -1
- package/dist/types/components/EFP/tasks/BusinessFinancingDropin/BusinessFinancingFinancialInformation.d.ts +11 -1
- package/dist/types/components/EFP/tasks/BusinessFinancingDropin/BusinessFinancingLegalInformation.d.ts +6 -1
- package/dist/types/components/EFP/tasks/BusinessFinancingDropin/BusinessFinancingOwnershipStructure.d.ts +7 -2
- package/dist/types/components/EFP/tasks/BusinessFinancingDropin/BusinessFinancingRegisteredAddress.d.ts +7 -1
- package/dist/types/components/EFP/tasks/BusinessFinancingDropin/types.d.ts +25 -110
- package/dist/types/components/EFP/tasks/BusinessFinancingDropin/utils.d.ts +16 -3
- package/dist/types/components/EFP/tasks/BusinessFinancingDropin/validate.d.ts +22 -0
- package/dist/types/components/EFP/tasks/SourceOfFundsDropin/sofStore.d.ts +1 -1
- package/dist/types/components/EFP/tasks/TaxReportingDropin/taxClassificationStore.d.ts +1 -1
- package/dist/types/components/EmbeddedDropins/BusinessFinancingComponent/utils.d.ts +3 -3
- package/dist/types/components/EmbeddedDropins/OnboardingDropinComponent/DropinComposer/DropinComposer.d.ts +1 -1
- package/dist/types/components/Individual/fields/DecisionMakerRole/NomineeDecisionMakerRole.d.ts +1 -1
- package/dist/types/components/Individual/fields/IdentityNumber/IdentityNumber.d.ts +1 -1
- package/dist/types/components/Individual/fields/LocalizedNameFields/LocalizedNameFields.d.ts +2 -2
- package/dist/types/components/Individual/fields/LocalizedNameFields/types.d.ts +9 -0
- package/dist/types/components/Individual/fields/NameFields/NameFields.d.ts +1 -1
- package/dist/types/components/Individual/forms/Individual/IdDocumentUpload/IdDocumentManualUpload.d.ts +1 -1
- package/dist/types/components/Individual/forms/Individual/IdDocumentUpload/types.d.ts +1 -1
- package/dist/types/components/Individual/forms/Individual/IdVerification/idVerificationProviderId.d.ts +1 -1
- package/dist/types/components/Individual/forms/Individual/IdVerificationMethod/IdVerificationMethod.d.ts +1 -1
- package/dist/types/components/Individual/forms/Individual/PersonalDetails/Identity/IdentityAu/IdentityAu.d.ts +1 -1
- package/dist/types/components/Individual/forms/Individual/PersonalDetails/Identity/IdentityHK/IdentityHK.d.ts +1 -1
- package/dist/types/components/Individual/forms/Individual/PersonalDetails/Identity/IdentityNZ/IdentityNZ.d.ts +1 -1
- package/dist/types/components/Individual/forms/Individual/PersonalDetails/Identity/identityUS/IdentityUS.d.ts +1 -1
- package/dist/types/components/Individual/forms/Individual/PersonalDetails/types.d.ts +4 -3
- package/dist/types/components/Individual/forms/Individual/rules.d.ts +31 -31
- package/dist/types/components/Individual/forms/Individual/types.d.ts +4 -4
- package/dist/types/components/Individual/forms/IndividualOnfido/AdditionalPersonalDetails/AdditionalPersonalDetails.d.ts +1 -1
- package/dist/types/components/Individual/forms/IndividualOnfido/AdditionalPersonalDetails/Identity/Identity.d.ts +1 -1
- package/dist/types/components/Individual/forms/IndividualOnfido/BasicDetails/BasicDetails.d.ts +1 -1
- package/dist/types/components/Individual/forms/IndividualOnfido/BasicDetails/BasicDetails.types.d.ts +2 -1
- package/dist/types/components/Individual/forms/IndividualOnfido/DataConflictsModal/ConflictRow.d.ts +1 -1
- package/dist/types/components/Individual/forms/IndividualOnfido/IndividualOnfido.rules.d.ts +34 -32
- package/dist/types/components/Individual/forms/IndividualOnfido/SignatoryQuestionnaire/SignatoryQuestionnaire.d.ts +1 -1
- package/dist/types/components/Individual/forms/IndividualOnfido/UboQuestionnaire/RichText.d.ts +1 -1
- package/dist/types/components/Individual/forms/IndividualOnfido/UboQuestionnaire/UboQuestionnaire.d.ts +1 -1
- package/dist/types/components/Individual/forms/IndividualOnfido/UboQuestionnaire/UboQuestionnaire.types.d.ts +2 -0
- package/dist/types/components/Individual/forms/IndividualOnfido/UboQuestionnaire/UboQuestionnaireModalContent.d.ts +1 -1
- package/dist/types/components/Individual/helpers/shouldShowMotionCapture.d.ts +2 -2
- package/dist/types/components/Individual/mapping/mapIndividualOnfidoSchemaToLegalEntity.d.ts +3 -1
- package/dist/types/components/Individual/mapping/mapLocalization.d.ts +2 -2
- package/dist/types/components/Shared/Summary/summaryItem.d.ts +1 -1
- package/dist/types/components/Shared/Summary/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/CountryField/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/IdFieldTypeSelector/CompanyRegistrationNumberTypeSelector.d.ts +1 -1
- package/dist/types/components/Shared/fields/IdFieldTypeSelector/IndividualIdNumberTypeSelector.d.ts +1 -1
- package/dist/types/components/Shared/fields/IdFieldTypeSelector/TaxIdNumberTypeSelector.d.ts +1 -1
- package/dist/types/components/Shared/fields/IdFieldTypeSelector/VatNumberTypeSelector.d.ts +1 -1
- package/dist/types/components/Shared/fields/IdFieldTypeSelector/countryIdNumberTypes.d.ts +9 -0
- package/dist/types/components/Shared/fields/Name/Name.d.ts +1 -1
- package/dist/types/components/Shared/fields/StateField/StateField.d.ts +1 -1
- package/dist/types/components/Shared/forms/Address/AddressField.d.ts +1 -1
- package/dist/types/components/Shared/forms/Address/utils.d.ts +2 -2
- package/dist/types/components/Shared/forms/BusinessTypeSelection/utils.d.ts +5 -5
- package/dist/types/components/Shared/forms/ContactDetails/ContactDetails.d.ts +1 -1
- package/dist/types/components/Shared/forms/FinancialInformation/validate.d.ts +1 -0
- package/dist/types/components/Shared/tasks/TaskList/utils.d.ts +1 -1
- package/dist/types/components/Trust/forms/Trust/Trust.d.ts +19 -3
- package/dist/types/components/Trust/forms/Trust/rules.d.ts +5 -5
- package/dist/types/components/Trust/hooks/useTrustMemberNavigation.hook.d.ts +14 -14
- package/dist/types/components/Trust/mapping/mapTrustDocumentToApiDocument.d.ts +1 -1
- package/dist/types/components/Trust/utils/trustUtil.d.ts +1 -1
- package/dist/types/components/UnincorporatedPartnership/hooks/useUnincorporatedPartnershipNavigation.d.ts +2 -2
- package/dist/types/components/UnincorporatedPartnership/utils/unincorporatedParnershipUtil.d.ts +1 -1
- package/dist/types/components/ui/atoms/ActionsMenu/ActionsMenu.d.ts +1 -1
- package/dist/types/components/ui/atoms/FormHeader/FormHeader.d.ts +1 -1
- package/dist/types/components/ui/atoms/InputBase/InputBase.d.ts +1 -1
- package/dist/types/components/ui/atoms/Svg/Svg.d.ts +1 -1
- package/dist/types/components/ui/atoms/TaskStatusIndicator/TaskStatusIndicator.d.ts +1 -1
- package/dist/types/components/ui/molecules/Alert/Alert.d.ts +1 -1
- package/dist/types/components/ui/molecules/Confirm/Confirm.d.ts +1 -1
- package/dist/types/components/ui/molecules/Confirm/Confirm.types.d.ts +1 -0
- package/dist/types/components/ui/molecules/Dropzone/Dropzone.d.ts +2 -1
- package/dist/types/components/ui/molecules/ErrorPanel/ErrorPanel.d.ts +1 -1
- package/dist/types/components/ui/molecules/ErrorPanel/VerificationErrors.d.ts +2 -1
- package/dist/types/components/ui/molecules/ErrorPanel/types.d.ts +1 -1
- package/dist/types/components/ui/molecules/InputEmail/InputEmail.d.ts +1 -1
- package/dist/types/components/ui/molecules/InputTelephone/InputTelephone.d.ts +1 -1
- package/dist/types/components/ui/molecules/InputText/InputText.d.ts +1 -1
- package/dist/types/context/ExperimentContext/types.d.ts +2 -1
- package/dist/types/context/FormContext/FormContext.d.ts +1 -1
- package/dist/types/context/FormRouterContext/FormRouterContext.d.ts +1 -1
- package/dist/types/context/SettingsContext/SettingsContext.d.ts +1 -1
- package/dist/types/context/StateContext/StateContext.d.ts +1 -1
- package/dist/types/context/StateContext/StateContextSetter.d.ts +1 -1
- package/dist/types/context/StateContext/StateReducer.d.ts +4 -10
- package/dist/types/context/StateContext/types.d.ts +19 -16
- package/dist/types/context/StateContext/useGlobalData.d.ts +2 -2
- package/dist/types/core/EmbedShell/EmbedShell.d.ts +1 -1
- package/dist/types/core/UIElement/UIElement.d.ts +1 -1
- package/dist/types/core/analytics.d.ts +10 -10
- package/dist/types/core/environment/resolveEnvironment.d.ts +1 -1
- package/dist/types/core/error.d.ts +1 -1
- package/dist/types/core/models/api/get-scenarios.d.ts +2 -1
- package/dist/types/core/models/api/legal-entity-association.d.ts +5 -0
- package/dist/types/core/process-field-configurations.d.ts +5 -5
- package/dist/types/core/user-events.d.ts +3 -1
- package/dist/types/datasets/generators/getBusinessTypeExamplesForCountry.d.ts +1 -1
- package/dist/types/datasets/generators/getCompanyTypeExamplesForCountry.d.ts +1 -1
- package/dist/types/datasets/generators/getLegalArrangementTypeExamplesForCountry.d.ts +1 -1
- package/dist/types/hooks/introduction/useIntroductionScreens.d.ts +1 -1
- package/dist/types/hooks/singpass/useSingpassMyInfoLogin.d.ts +1 -1
- package/dist/types/hooks/useForm/types.d.ts +8 -10
- package/dist/types/stores/globalStore/globalStore.d.ts +1 -1
- package/dist/types/types/errors/maintenance-mode-error.d.ts +1 -1
- package/dist/types/utils/api/processValidationErrors.d.ts +1 -1
- package/dist/types/utils/birthDateUtils.d.ts +2 -2
- package/dist/types/utils/entityAssociationUtil.d.ts +1 -1
- package/dist/types/utils/entityStatusUtil.d.ts +1 -1
- package/dist/types/utils/mapping/utils.d.ts +7 -10
- package/dist/types/utils/omitObscuredFieldsIfUnchanged.d.ts +1 -1
- package/dist/types/utils/trackNavigation.d.ts +1 -2
- package/dist/types/utils/validation/validationResult.d.ts +1 -1
- package/dist/types/utils/validatorUtils.d.ts +2 -2
- package/dist/{useMultiForm-BgEu8uhi.js → useMultiForm-Cbc7WnPQ.js} +2 -2
- package/dist/{useOnboardingStatus-DvoTlJ5K.js → useOnboardingStatus-nLGnJrfb.js} +1 -1
- package/dist/{useSalesChannelsSettings-Bjwl16F8.js → useSalesChannelsSettings-dKcm_JOS.js} +1 -1
- package/dist/{useTermsOfServiceStatus-C2Xb56D8.js → useTermsOfServiceStatus-DMsljkdm.js} +1 -1
- package/dist/{useUpdateLegalEntity-FAhW-hcz.js → useUpdateLegalEntity-DUM-neeX.js} +1 -1
- package/dist/{utils-BL1_bJaN.js → utils-xFYHze6e.js} +4 -4
- package/dist/{validate-DGJXjEC8.js → validate-CHEcOPfd.js} +1 -1
- package/dist/validate-CuwYJGc9.js +94 -0
- package/dist/{yaml-vHfLYJJq.js → yaml-DpwguEvd.js} +1 -1
- package/package.json +31 -31
- package/dist/ContractViewer-BwG3C5dW.js +0 -980
- package/dist/individualFormConfig-C7P-qsgN.js +0 -183
- package/dist/validate-BIlxlfqG.js +0 -245
|
@@ -2,33 +2,22 @@
|
|
|
2
2
|
{
|
|
3
3
|
try {
|
|
4
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] = "
|
|
5
|
+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "2832759d-3336-47e2-bf5d-6d8ad658e92d", e._sentryDebugIdIdentifier = "sentry-dbid-2832759d-3336-47e2-bf5d-6d8ad658e92d");
|
|
6
6
|
} catch (e) {
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
;
|
|
10
10
|
import { jsx, jsxs, Fragment } from "preact/jsx-runtime";
|
|
11
|
-
import {
|
|
12
|
-
import { u as useCreateLegalEntity, a as useUpdateLegalEntity } from "./useUpdateLegalEntity-
|
|
13
|
-
import { bQ as reverseMapping, bR as formatObject, bS as isEeaCountry, y as LegalEntityType, ba as cloneObject,
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { b as
|
|
20
|
-
const MANDATORY_FIELDS_BUSINESS_FINANCING = [
|
|
21
|
-
"company.numberOfEmployees",
|
|
22
|
-
"parentCompany.numberOfEmployees",
|
|
23
|
-
"ultimateParentCompany.numberOfEmployees"
|
|
24
|
-
];
|
|
11
|
+
import { useRef, useEffect, useCallback, useMemo, useState } from "preact/hooks";
|
|
12
|
+
import { u as useCreateLegalEntity, a as useUpdateLegalEntity } from "./useUpdateLegalEntity-DUM-neeX.js";
|
|
13
|
+
import { bQ as reverseMapping, bR as formatObject, bS as isEeaCountry, y as LegalEntityType, ba as cloneObject, p as useApiContext, q as useQuery, r as httpGet, b as useI18nContext, az as Field, bJ as Select, C as Typography, ay as createFormUtils, aV as RadioGroup, bT as Link, bp as InputText, bb as currencyByCountry, bU as InputNumber, bV as InputDate, bW as Currency, bX as CURRENCY_FIELD, bY as InputCurrency, bK as useFormContext, av as getFieldProps, ax as ErrorPanel, bZ as getAddressSchemaForCountry, b_ as COUNTRIES_WITH_STATES_DATASET, b$ as Address, c0 as getAddressSchemaLabelsByCountry, $ as useAnalyticsContext, be as useInvalidateRootLegalEntity, an as useAssociatedLegalEntity, b0 as datasetUtilities, a5 as useToastContext, J as useSettingsContext, K as SettingNames, c1 as getAssociatedLeAnalyticsPayload, bN as getRequiredForms, bO as addValidityToForms, bP as useFormComposer, c2 as trackNavigation, L as Loader, a3 as Icon, Z as Button, c3 as isValidationError, c4 as processValidationErrors, c5 as isMaintenanceModeError } from "./StoreProvider-DM45wVPv.js";
|
|
14
|
+
import { F as FormContextProvider, a as FormFlow } from "./FormFlow-B8-6ExTs.js";
|
|
15
|
+
import { u as useMultiForm } from "./useMultiForm-Cbc7WnPQ.js";
|
|
16
|
+
import { F as FormEndState } from "./FormEndState-CZ6KCgSg.js";
|
|
17
|
+
import { l as localizeDateString } from "./localizeDateString-C2CJszPy.js";
|
|
18
|
+
import { m as mapFinancialReportsToFinancialInformation, a as mapFinancialInformationToFinancialReport } from "./mapFinancialReportsToFinancialInformation-BN4Vmw7c.js";
|
|
19
|
+
import { b as businessFinancingMultiformRules } from "./validate-CuwYJGc9.js";
|
|
25
20
|
const businessFinancingBaseMapping = {
|
|
26
|
-
// TODO delete the financialReports keys, they wouldn't get mapped correctly anyway
|
|
27
|
-
numberOfEmployees: "organization.financialReports.employeeCount",
|
|
28
|
-
annualTurnover: "organization.financialReports.annualTurnover",
|
|
29
|
-
netAssets: "organization.financialReports.netAssets",
|
|
30
|
-
financialReportingDate: "organization.financialReports.dateOfFinancialData",
|
|
31
|
-
currency: "organization.financialReports.currencyOfFinancialData",
|
|
32
21
|
legalProceedingsDate: "organization.dateOfInitiationOfLegalProceeding",
|
|
33
22
|
legalInformationInsolvency: "organization.statusOfLegalProceeding",
|
|
34
23
|
legalEntityIdentifier: "organization.globalLegalEntityIdentifier",
|
|
@@ -40,13 +29,7 @@ const businessFinancingBaseMapping = {
|
|
|
40
29
|
"registrationAddress.postalCode": "organization.registeredAddress.postalCode",
|
|
41
30
|
"registrationAddress.stateOrProvince": "organization.registeredAddress.stateOrProvince",
|
|
42
31
|
"registrationAddress.address": "organization.registeredAddress.street",
|
|
43
|
-
"registrationAddress.otherAddressInformation": "organization.registeredAddress.street2"
|
|
44
|
-
"principalPlaceOfBusiness.city": "organization.principalPlaceOfBusiness.city",
|
|
45
|
-
"principalPlaceOfBusiness.country": "organization.principalPlaceOfBusiness.country",
|
|
46
|
-
"principalPlaceOfBusiness.postalCode": "organization.principalPlaceOfBusiness.postalCode",
|
|
47
|
-
"principalPlaceOfBusiness.stateOrProvince": "organization.principalPlaceOfBusiness.stateOrProvince",
|
|
48
|
-
"principalPlaceOfBusiness.address": "organization.principalPlaceOfBusiness.street",
|
|
49
|
-
"principalPlaceOfBusiness.otherAddressInformation": "organization.principalPlaceOfBusiness.street2"
|
|
32
|
+
"registrationAddress.otherAddressInformation": "organization.registeredAddress.street2"
|
|
50
33
|
};
|
|
51
34
|
const businessFinancingComponentsKeyMapping = {
|
|
52
35
|
...businessFinancingBaseMapping
|
|
@@ -55,7 +38,10 @@ const businessFinancingApiKeyMapping = {
|
|
|
55
38
|
...reverseMapping(businessFinancingBaseMapping)
|
|
56
39
|
};
|
|
57
40
|
const mapBusinessFinancingToLegalEntity = (data) => ({
|
|
58
|
-
...formatObject(
|
|
41
|
+
...formatObject(
|
|
42
|
+
data,
|
|
43
|
+
businessFinancingApiKeyMapping
|
|
44
|
+
)
|
|
59
45
|
});
|
|
60
46
|
var BusinessFinancingPagesEnums = /* @__PURE__ */ ((BusinessFinancingPagesEnums2) => {
|
|
61
47
|
BusinessFinancingPagesEnums2["COMPANY_PAGE"] = "company";
|
|
@@ -105,7 +91,6 @@ const parentCompaniesSchemaKeys = [
|
|
|
105
91
|
"numberOfEmployees",
|
|
106
92
|
"doesYourCompanyHaveLEI",
|
|
107
93
|
"legalEntityIdentifier",
|
|
108
|
-
"doesNotKnowNumberOfEmployees",
|
|
109
94
|
"isThisAddressTheMainHeadquarters",
|
|
110
95
|
"financialReportingDate",
|
|
111
96
|
"currency",
|
|
@@ -158,6 +143,15 @@ const entityHasUltimateParentCompany = (data) => {
|
|
|
158
143
|
var _a, _b;
|
|
159
144
|
return ((_a = data.company) == null ? void 0 : _a.isParentOwnedByAnotherCompany) && ((_b = data.company) == null ? void 0 : _b.isParentOwnedByAnotherCompany) === "Yes";
|
|
160
145
|
};
|
|
146
|
+
const financialReportsToString = (financialReports) => {
|
|
147
|
+
return {
|
|
148
|
+
...financialReports,
|
|
149
|
+
numberOfEmployees: financialReports.numberOfEmployees ? financialReports.numberOfEmployees.toString() : void 0,
|
|
150
|
+
netAssets: financialReports.netAssets ? financialReports.netAssets.toString() : void 0,
|
|
151
|
+
annualTurnover: financialReports.annualTurnover ? financialReports.annualTurnover.toString() : void 0,
|
|
152
|
+
balanceSheetTotal: financialReports.balanceSheetTotal ? financialReports.balanceSheetTotal.toString() : void 0
|
|
153
|
+
};
|
|
154
|
+
};
|
|
161
155
|
const prepareBusinessFinancingSubmitData = (businessFinancingIndex, data, rootLegalEntity) => {
|
|
162
156
|
var _a, _b, _c;
|
|
163
157
|
const businessFinancingData = data[businessFinancingIndex];
|
|
@@ -168,15 +162,18 @@ const prepareBusinessFinancingSubmitData = (businessFinancingIndex, data, rootLe
|
|
|
168
162
|
if (businessFinancingIndex === BusinessFinancingIndex.ULTIMATE_PARENT_COMPANY && (!entityHasUltimateParentCompany(data) || !entityHasParentCompany(data))) {
|
|
169
163
|
return null;
|
|
170
164
|
}
|
|
171
|
-
const businessFinancingDetails = mapBusinessFinancingToLegalEntity(
|
|
172
|
-
businessFinancingData
|
|
173
|
-
);
|
|
165
|
+
const businessFinancingDetails = mapBusinessFinancingToLegalEntity(businessFinancingData);
|
|
174
166
|
if (!businessFinancingDetails.organization) return null;
|
|
175
167
|
const businessFinancingCountry = ((_a = businessFinancingDetails.organization.registeredAddress) == null ? void 0 : _a.country) || ((_c = (_b = rootLegalEntity == null ? void 0 : rootLegalEntity.organization) == null ? void 0 : _b.registeredAddress) == null ? void 0 : _c.country);
|
|
176
|
-
if (
|
|
177
|
-
const
|
|
178
|
-
businessFinancingData
|
|
179
|
-
|
|
168
|
+
if (businessFinancingData.financialReportingDate && isEeaCountry(businessFinancingCountry)) {
|
|
169
|
+
const finReports = {
|
|
170
|
+
currency: businessFinancingData.currency,
|
|
171
|
+
financialReportingDate: businessFinancingData.financialReportingDate,
|
|
172
|
+
numberOfEmployees: businessFinancingData.numberOfEmployees ? Number(businessFinancingData.numberOfEmployees) : void 0,
|
|
173
|
+
netAssets: businessFinancingData.netAssets ? Number(businessFinancingData.netAssets) : void 0,
|
|
174
|
+
annualTurnover: businessFinancingData.annualTurnover ? Number(businessFinancingData.annualTurnover) : void 0
|
|
175
|
+
};
|
|
176
|
+
const businessFinancingFinancialReport = mapFinancialInformationToFinancialReport(finReports);
|
|
180
177
|
businessFinancingDetails.organization.financialReports = [businessFinancingFinancialReport];
|
|
181
178
|
}
|
|
182
179
|
if (!isEeaCountry(businessFinancingCountry)) {
|
|
@@ -212,11 +209,19 @@ const appendBusinessFinancingData = (legalOrganization, businessFinancingData) =
|
|
|
212
209
|
let financialReportData = {};
|
|
213
210
|
if (legalOrganization.financialReports) {
|
|
214
211
|
const financialReportsArray = Array.isArray(legalOrganization.financialReports) ? legalOrganization.financialReports : [legalOrganization.financialReports];
|
|
215
|
-
|
|
212
|
+
const financialInformationSchema = mapFinancialReportsToFinancialInformation(
|
|
213
|
+
financialReportsArray,
|
|
214
|
+
false
|
|
215
|
+
);
|
|
216
|
+
financialReportData = financialReportsToString(financialInformationSchema);
|
|
217
|
+
if (financialReportData.numberOfEmployees) {
|
|
218
|
+
financialReportData.numberOfEmployees = financialReportData.numberOfEmployees.toString();
|
|
219
|
+
}
|
|
216
220
|
}
|
|
217
221
|
return {
|
|
218
222
|
...clonedBusinessFinancingData,
|
|
219
223
|
...financialReportData,
|
|
224
|
+
numberOfEmployees: financialReportData.numberOfEmployees ? financialReportData.numberOfEmployees.toString() : void 0,
|
|
220
225
|
doesYourCompanyHaveLEI: legalOrganization.globalLegalEntityIdentifier ? "Yes" : "No",
|
|
221
226
|
isThisAddressTheMainHeadquarters: legalOrganization.principalPlaceOfBusiness ? "Yes" : clonedBusinessFinancingData.isThisAddressTheMainHeadquarters
|
|
222
227
|
};
|
|
@@ -278,6 +283,39 @@ const getParentCompanySchemaKeys = (currentData, schemaKeys) => {
|
|
|
278
283
|
}
|
|
279
284
|
return schemaKeys.filter((field) => !fieldsToRemove.includes(field));
|
|
280
285
|
};
|
|
286
|
+
const getBusinessFinancingRequiredFields = (data) => {
|
|
287
|
+
let requiredFields = {
|
|
288
|
+
company: companySchemaKeys
|
|
289
|
+
};
|
|
290
|
+
if (!data) {
|
|
291
|
+
return requiredFields;
|
|
292
|
+
}
|
|
293
|
+
const { company, parentCompany = {}, ultimateParentCompany = {} } = data;
|
|
294
|
+
if (company) {
|
|
295
|
+
requiredFields.company = getCompanySchemaKeys("NL", company, companySchemaKeys);
|
|
296
|
+
}
|
|
297
|
+
if ((company == null ? void 0 : company.isCompanyOwnedByAnotherCompany) === "Yes") {
|
|
298
|
+
const parentCompanyRequiredFields = getParentCompanySchemaKeys(
|
|
299
|
+
parentCompany,
|
|
300
|
+
parentCompaniesSchemaKeys
|
|
301
|
+
);
|
|
302
|
+
requiredFields = {
|
|
303
|
+
...requiredFields,
|
|
304
|
+
parentCompany: parentCompanyRequiredFields
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
if ((company == null ? void 0 : company.isParentOwnedByAnotherCompany) === "Yes") {
|
|
308
|
+
const ultimateParentCompanyRequiredFields = getParentCompanySchemaKeys(
|
|
309
|
+
ultimateParentCompany,
|
|
310
|
+
parentCompaniesSchemaKeys
|
|
311
|
+
);
|
|
312
|
+
requiredFields = {
|
|
313
|
+
...requiredFields,
|
|
314
|
+
ultimateParentCompany: ultimateParentCompanyRequiredFields
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
return requiredFields;
|
|
318
|
+
};
|
|
281
319
|
const customLabels = {
|
|
282
320
|
company: {
|
|
283
321
|
legalForm: "businessStructure",
|
|
@@ -319,7 +357,7 @@ const getFormattedAmount = (value, currency) => {
|
|
|
319
357
|
const formattedValue = Number(value).toLocaleString(userLocale);
|
|
320
358
|
return `${currency} ${formattedValue}`;
|
|
321
359
|
};
|
|
322
|
-
const formatDataForSummary = (
|
|
360
|
+
const formatDataForSummary = (i18n, datasetUtils, data) => {
|
|
323
361
|
var _a, _b, _c, _d, _e;
|
|
324
362
|
const summaryData = cloneObject(data) || {};
|
|
325
363
|
if (summaryData.company) {
|
|
@@ -383,10 +421,6 @@ const formatDataForSummary = (data, i18n, datasetUtils) => {
|
|
|
383
421
|
}
|
|
384
422
|
return summaryData;
|
|
385
423
|
};
|
|
386
|
-
const canSubmit = (data) => MANDATORY_FIELDS_BUSINESS_FINANCING.every((detail) => {
|
|
387
|
-
const value = getProp(data, detail);
|
|
388
|
-
return !isEmpty(value);
|
|
389
|
-
});
|
|
390
424
|
const mapLegalEntityToBusinessFinancing = (legalEntity) => formatObject(legalEntity, businessFinancingComponentsKeyMapping);
|
|
391
425
|
const getLegalForms = async (countryCode, baseUrl) => {
|
|
392
426
|
return httpGet({
|
|
@@ -416,21 +450,35 @@ function LegalFormField({
|
|
|
416
450
|
}) {
|
|
417
451
|
const { i18n } = useI18nContext();
|
|
418
452
|
const { data: legalFormsData } = useLegalForms(countryCode);
|
|
419
|
-
const
|
|
453
|
+
const handleChangeForRef = useRef(handleChangeFor);
|
|
454
|
+
useEffect(() => {
|
|
455
|
+
handleChangeForRef.current = handleChangeFor;
|
|
456
|
+
}, [handleChangeFor]);
|
|
457
|
+
const handleChangeForLegalForm = useCallback(
|
|
458
|
+
(e) => {
|
|
459
|
+
const legalFormEvent = {
|
|
460
|
+
target: {
|
|
461
|
+
name: "legalForm",
|
|
462
|
+
value: e.target.value
|
|
463
|
+
}
|
|
464
|
+
};
|
|
465
|
+
handleChangeFor("legalForm")(legalFormEvent);
|
|
466
|
+
},
|
|
467
|
+
[handleChangeFor]
|
|
468
|
+
);
|
|
469
|
+
useEffect(() => {
|
|
420
470
|
var _a;
|
|
421
|
-
const legalFormValue = e.target.value;
|
|
422
471
|
const selectedLabel = (_a = legalFormsData == null ? void 0 : legalFormsData.find(
|
|
423
|
-
(legalForm) => legalForm.id ===
|
|
472
|
+
(legalForm) => legalForm.id === data.legalForm
|
|
424
473
|
)) == null ? void 0 : _a.name;
|
|
425
474
|
const legalFormEvent = {
|
|
426
475
|
target: {
|
|
427
|
-
name: "
|
|
428
|
-
value:
|
|
429
|
-
label: selectedLabel
|
|
476
|
+
name: "legalFormLabel",
|
|
477
|
+
value: selectedLabel
|
|
430
478
|
}
|
|
431
479
|
};
|
|
432
|
-
|
|
433
|
-
};
|
|
480
|
+
handleChangeForRef.current("legalFormLabel")(legalFormEvent);
|
|
481
|
+
}, [data.legalForm, legalFormsData]);
|
|
434
482
|
return /* @__PURE__ */ jsx(
|
|
435
483
|
Field,
|
|
436
484
|
{
|
|
@@ -482,21 +530,30 @@ function NaceCodeField({
|
|
|
482
530
|
}) {
|
|
483
531
|
const { i18n } = useI18nContext();
|
|
484
532
|
const { data: naceCodesData } = useNaceCodes();
|
|
533
|
+
const handleChangeForRef = useRef(handleChangeFor);
|
|
534
|
+
useEffect(() => {
|
|
535
|
+
handleChangeForRef.current = handleChangeFor;
|
|
536
|
+
}, [handleChangeFor]);
|
|
485
537
|
const handleChangeForNaceCode = (e) => {
|
|
486
|
-
var _a;
|
|
487
|
-
const naceCodeFormValue = e.target.value;
|
|
488
|
-
const selectedLabel = (_a = naceCodesData == null ? void 0 : naceCodesData.find(
|
|
489
|
-
(naceCode) => naceCode.id === naceCodeFormValue
|
|
490
|
-
)) == null ? void 0 : _a.name;
|
|
491
538
|
const naceCodeEvent = {
|
|
492
539
|
target: {
|
|
493
540
|
name: "naceCode",
|
|
494
|
-
value: e.target.value
|
|
495
|
-
label: selectedLabel
|
|
541
|
+
value: e.target.value
|
|
496
542
|
}
|
|
497
543
|
};
|
|
498
544
|
handleChangeFor("naceCode")(naceCodeEvent);
|
|
499
545
|
};
|
|
546
|
+
useEffect(() => {
|
|
547
|
+
var _a;
|
|
548
|
+
const selectedLabel = (_a = naceCodesData == null ? void 0 : naceCodesData.find((naceCode) => naceCode.id === data.naceCode)) == null ? void 0 : _a.name;
|
|
549
|
+
const naceCodeEvent = {
|
|
550
|
+
target: {
|
|
551
|
+
name: "naceCodeLabel",
|
|
552
|
+
value: selectedLabel
|
|
553
|
+
}
|
|
554
|
+
};
|
|
555
|
+
handleChangeForRef.current("naceCodeLabel")(naceCodeEvent);
|
|
556
|
+
}, [data.naceCode, naceCodesData]);
|
|
500
557
|
return /* @__PURE__ */ jsx(
|
|
501
558
|
Field,
|
|
502
559
|
{
|
|
@@ -521,51 +578,44 @@ function NaceCodeField({
|
|
|
521
578
|
}
|
|
522
579
|
);
|
|
523
580
|
}
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
581
|
+
const businessInformationFields = [
|
|
582
|
+
"legalForm",
|
|
583
|
+
"naceCode",
|
|
584
|
+
"naceCodeLabel",
|
|
585
|
+
"legalFormLabel",
|
|
586
|
+
"doesYourCompanyHaveLEI",
|
|
587
|
+
"legalEntityIdentifier"
|
|
588
|
+
];
|
|
589
|
+
function BusinessFinancingBusinessInformation(props) {
|
|
590
|
+
const {
|
|
591
|
+
data,
|
|
592
|
+
valid,
|
|
593
|
+
errors,
|
|
594
|
+
country,
|
|
595
|
+
handleFieldChange,
|
|
596
|
+
fieldValidationErrors,
|
|
597
|
+
targetPage,
|
|
598
|
+
sectionHeading
|
|
599
|
+
} = props;
|
|
536
600
|
const { i18n } = useI18nContext();
|
|
601
|
+
const formUtils = createFormUtils(props, i18n);
|
|
602
|
+
if (!handleFieldChange) {
|
|
603
|
+
return;
|
|
604
|
+
}
|
|
537
605
|
const isMainCompany = targetPage === BusinessFinancingPagesEnums.COMPANY_PAGE;
|
|
538
|
-
const companyCountry = targetPage === BusinessFinancingPagesEnums.COMPANY_PAGE ? country : (_a = data == null ? void 0 : data.registrationAddress) == null ? void 0 : _a.country;
|
|
539
|
-
const handleChangeWithLabel = (key) => (e) => {
|
|
540
|
-
const labelKey = `${key}Label`;
|
|
541
|
-
const fieldEvent = {
|
|
542
|
-
target: {
|
|
543
|
-
name: key,
|
|
544
|
-
value: e.target.value
|
|
545
|
-
}
|
|
546
|
-
};
|
|
547
|
-
const labelEvent = {
|
|
548
|
-
target: {
|
|
549
|
-
name: labelKey,
|
|
550
|
-
value: e.target.label
|
|
551
|
-
}
|
|
552
|
-
};
|
|
553
|
-
handleChangeFor(key)(fieldEvent);
|
|
554
|
-
handleChangeFor(labelKey)(labelEvent);
|
|
555
|
-
};
|
|
556
606
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
557
607
|
/* @__PURE__ */ jsx(Typography, { el: "h3", variant: "title", children: i18n.get(sectionHeading || "yourBusinessInformation") }),
|
|
558
608
|
/* @__PURE__ */ jsx(
|
|
559
609
|
LegalFormField,
|
|
560
610
|
{
|
|
561
611
|
name: "legalForm",
|
|
562
|
-
countryCode:
|
|
612
|
+
countryCode: country,
|
|
563
613
|
data: {
|
|
564
|
-
legalForm: data.legalForm
|
|
614
|
+
legalForm: data == null ? void 0 : data.legalForm
|
|
565
615
|
},
|
|
566
|
-
valid: { legalForm: valid.legalForm },
|
|
567
|
-
errorMessage: formUtils.getErrorMessage("legalForm", errors,
|
|
568
|
-
handleChangeFor:
|
|
616
|
+
valid: { legalForm: valid == null ? void 0 : valid.legalForm },
|
|
617
|
+
errorMessage: formUtils.getErrorMessage("legalForm", errors, fieldValidationErrors),
|
|
618
|
+
handleChangeFor: handleFieldChange,
|
|
569
619
|
readonly: false,
|
|
570
620
|
label: formUtils.getLabel("legalForm", "businessStructure")
|
|
571
621
|
}
|
|
@@ -574,10 +624,10 @@ function BusinessFinancingBusinessInformation({
|
|
|
574
624
|
NaceCodeField,
|
|
575
625
|
{
|
|
576
626
|
name: "naceCode",
|
|
577
|
-
data: { naceCode: data.naceCode },
|
|
578
|
-
valid: { naceCode: valid.naceCode },
|
|
579
|
-
errorMessage: formUtils.getErrorMessage("naceCode", errors,
|
|
580
|
-
handleChangeFor:
|
|
627
|
+
data: { naceCode: data == null ? void 0 : data.naceCode },
|
|
628
|
+
valid: { naceCode: valid == null ? void 0 : valid.naceCode },
|
|
629
|
+
errorMessage: formUtils.getErrorMessage("naceCode", errors, fieldValidationErrors),
|
|
630
|
+
handleChangeFor: handleFieldChange,
|
|
581
631
|
readonly: false,
|
|
582
632
|
label: formUtils.getLabel("naceCode", "industryAndNaceCode")
|
|
583
633
|
}
|
|
@@ -594,29 +644,37 @@ function BusinessFinancingBusinessInformation({
|
|
|
594
644
|
" ",
|
|
595
645
|
/* @__PURE__ */ jsx(Link, { href: "https://search.gleif.org/#/search/", external: true, inline: true, children: i18n.get("lookUpYourLEI") })
|
|
596
646
|
] }),
|
|
597
|
-
errorMessage: formUtils.getErrorMessage(
|
|
647
|
+
errorMessage: formUtils.getErrorMessage(
|
|
648
|
+
"doesYourCompanyHaveLEI",
|
|
649
|
+
errors,
|
|
650
|
+
fieldValidationErrors
|
|
651
|
+
),
|
|
598
652
|
children: (childProps) => /* @__PURE__ */ jsx(
|
|
599
653
|
RadioGroup,
|
|
600
654
|
{
|
|
601
655
|
...childProps,
|
|
602
656
|
name: "doesYourCompanyHaveLEI",
|
|
603
657
|
items: isMainCompany ? businessFinancingRadioItems : businessFinancingParentRadioItems,
|
|
604
|
-
value: data.doesYourCompanyHaveLEI,
|
|
658
|
+
value: data == null ? void 0 : data.doesYourCompanyHaveLEI,
|
|
605
659
|
disabled: false,
|
|
606
|
-
onChange:
|
|
660
|
+
onChange: handleFieldChange("doesYourCompanyHaveLEI"),
|
|
607
661
|
"aria-required": true,
|
|
608
|
-
"aria-invalid": !valid.doesYourCompanyHaveLEI
|
|
662
|
+
"aria-invalid": !(valid == null ? void 0 : valid.doesYourCompanyHaveLEI)
|
|
609
663
|
}
|
|
610
664
|
)
|
|
611
665
|
}
|
|
612
666
|
),
|
|
613
|
-
data.doesYourCompanyHaveLEI === "Yes" && /* @__PURE__ */ jsx(
|
|
667
|
+
(data == null ? void 0 : data.doesYourCompanyHaveLEI) === "Yes" && /* @__PURE__ */ jsx(
|
|
614
668
|
Field,
|
|
615
669
|
{
|
|
616
670
|
name: "legalEntityIdentifier",
|
|
617
671
|
label: formUtils.getLabel("legalEntityIdentifier", "legalEntityIdentifier"),
|
|
618
|
-
errorMessage: formUtils.getErrorMessage(
|
|
619
|
-
|
|
672
|
+
errorMessage: formUtils.getErrorMessage(
|
|
673
|
+
"legalEntityIdentifier",
|
|
674
|
+
errors,
|
|
675
|
+
fieldValidationErrors
|
|
676
|
+
),
|
|
677
|
+
isValid: valid == null ? void 0 : valid.legalEntityIdentifier,
|
|
620
678
|
helper: i18n.get("enterNCharactersWithAMixForExample", {
|
|
621
679
|
values: {
|
|
622
680
|
numChars: 20,
|
|
@@ -628,14 +686,14 @@ function BusinessFinancingBusinessInformation({
|
|
|
628
686
|
{
|
|
629
687
|
...childProps,
|
|
630
688
|
name: "legalEntityIdentifier",
|
|
631
|
-
value: data.legalEntityIdentifier,
|
|
689
|
+
value: data == null ? void 0 : data.legalEntityIdentifier,
|
|
632
690
|
readonly: false,
|
|
633
691
|
classNameModifiers: ["legalName"],
|
|
634
|
-
onInput:
|
|
635
|
-
onBlur:
|
|
692
|
+
onInput: handleFieldChange("legalEntityIdentifier", "input"),
|
|
693
|
+
onBlur: handleFieldChange("legalEntityIdentifier", "blur"),
|
|
636
694
|
"aria-required": true,
|
|
637
|
-
"aria-invalid": !valid.legalEntityIdentifier,
|
|
638
|
-
isValid: valid.legalEntityIdentifier
|
|
695
|
+
"aria-invalid": !(valid == null ? void 0 : valid.legalEntityIdentifier),
|
|
696
|
+
isValid: valid == null ? void 0 : valid.legalEntityIdentifier
|
|
639
697
|
}
|
|
640
698
|
)
|
|
641
699
|
}
|
|
@@ -643,31 +701,28 @@ function BusinessFinancingBusinessInformation({
|
|
|
643
701
|
] });
|
|
644
702
|
}
|
|
645
703
|
const TODAY_DATE$1 = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
}
|
|
657
|
-
var _a;
|
|
704
|
+
const financialInformationFields = [
|
|
705
|
+
"numberOfEmployees",
|
|
706
|
+
"financialReportingDate",
|
|
707
|
+
"doesYourCompanyHaveLEI",
|
|
708
|
+
"legalEntityIdentifier",
|
|
709
|
+
"currency",
|
|
710
|
+
"netAssets",
|
|
711
|
+
"annualTurnover"
|
|
712
|
+
];
|
|
713
|
+
function BusinessFinancingFinancialInformation(props) {
|
|
714
|
+
const { data, valid, errors, country, sectionHeading, handleFieldChange, fieldValidationErrors } = props;
|
|
658
715
|
const { i18n } = useI18nContext();
|
|
716
|
+
const formUtils = createFormUtils(props, i18n);
|
|
717
|
+
const currenciesForCurrCountry = useMemo(() => currencyByCountry[country] ?? [], [country]);
|
|
718
|
+
if (!handleFieldChange) {
|
|
719
|
+
return;
|
|
720
|
+
}
|
|
659
721
|
const financialData = data;
|
|
660
722
|
const financialErrors = errors;
|
|
661
723
|
const isFinancialDataValid = valid;
|
|
662
|
-
const currenciesForCurrCountry = useMemo(() => currencyByCountry[country] ?? [], [country]);
|
|
663
724
|
const [firstCurrency] = currenciesForCurrCountry;
|
|
664
725
|
const defaultCurrency = firstCurrency ?? "EUR";
|
|
665
|
-
useEffect(() => {
|
|
666
|
-
if ((currenciesForCurrCountry == null ? void 0 : currenciesForCurrCountry.length) === 1) {
|
|
667
|
-
financialData.currency = firstCurrency;
|
|
668
|
-
setValidCurrency("currency", true);
|
|
669
|
-
}
|
|
670
|
-
}, [currenciesForCurrCountry, firstCurrency, setValidCurrency, financialData]);
|
|
671
726
|
return /* @__PURE__ */ jsxs("section", { children: [
|
|
672
727
|
/* @__PURE__ */ jsx(Typography, { el: "h3", variant: "title", children: i18n.get(sectionHeading || "financialInformation") }),
|
|
673
728
|
/* @__PURE__ */ jsx(
|
|
@@ -675,21 +730,21 @@ function BusinessFinancingFinancialInformation({
|
|
|
675
730
|
{
|
|
676
731
|
name: "numberOfEmployees",
|
|
677
732
|
label: formUtils.getLabel("numberOfEmployees", "numberOfEmployees"),
|
|
678
|
-
errorMessage: formUtils.getErrorMessage("numberOfEmployees", errors,
|
|
679
|
-
isValid: valid.numberOfEmployees,
|
|
733
|
+
errorMessage: formUtils.getErrorMessage("numberOfEmployees", errors, fieldValidationErrors),
|
|
734
|
+
isValid: valid == null ? void 0 : valid.numberOfEmployees,
|
|
680
735
|
classNameModifiers: ["numberOfEmployees"],
|
|
681
736
|
children: (childProps) => /* @__PURE__ */ jsx(
|
|
682
737
|
InputNumber,
|
|
683
738
|
{
|
|
684
739
|
...childProps,
|
|
685
740
|
"aria-required": true,
|
|
686
|
-
"aria-invalid": !valid.numberOfEmployees,
|
|
741
|
+
"aria-invalid": !(valid == null ? void 0 : valid.numberOfEmployees),
|
|
687
742
|
name: "numberOfEmployees",
|
|
688
743
|
min: "0",
|
|
689
744
|
step: "1",
|
|
690
|
-
value: data.numberOfEmployees,
|
|
691
|
-
onInput:
|
|
692
|
-
onBlur:
|
|
745
|
+
value: data == null ? void 0 : data.numberOfEmployees,
|
|
746
|
+
onInput: handleFieldChange("numberOfEmployees", "input"),
|
|
747
|
+
onBlur: handleFieldChange("numberOfEmployees", "blur")
|
|
693
748
|
}
|
|
694
749
|
)
|
|
695
750
|
}
|
|
@@ -700,19 +755,23 @@ function BusinessFinancingFinancialInformation({
|
|
|
700
755
|
name: "financialReportingDate",
|
|
701
756
|
label: formUtils.getLabel("financialReportingDate", "financialReportingDate"),
|
|
702
757
|
helper: i18n.get("dateOfTotalAssetsCalculation"),
|
|
703
|
-
errorMessage: formUtils.getErrorMessage(
|
|
704
|
-
|
|
758
|
+
errorMessage: formUtils.getErrorMessage(
|
|
759
|
+
"financialReportingDate",
|
|
760
|
+
errors,
|
|
761
|
+
fieldValidationErrors
|
|
762
|
+
),
|
|
763
|
+
isValid: valid == null ? void 0 : valid.financialReportingDate,
|
|
705
764
|
classNameModifiers: ["financialReportingDate"],
|
|
706
765
|
children: (childProps) => /* @__PURE__ */ jsx(
|
|
707
766
|
InputDate,
|
|
708
767
|
{
|
|
709
768
|
...childProps,
|
|
710
769
|
name: "financialReportingDate",
|
|
711
|
-
value: data.financialReportingDate,
|
|
712
|
-
onInput:
|
|
713
|
-
onBlur:
|
|
770
|
+
value: data == null ? void 0 : data.financialReportingDate,
|
|
771
|
+
onInput: handleFieldChange("financialReportingDate", "input"),
|
|
772
|
+
onBlur: handleFieldChange("financialReportingDate", "blur"),
|
|
714
773
|
"aria-required": true,
|
|
715
|
-
"aria-invalid": !valid.financialReportingDate,
|
|
774
|
+
"aria-invalid": !(valid == null ? void 0 : valid.financialReportingDate),
|
|
716
775
|
max: TODAY_DATE$1
|
|
717
776
|
}
|
|
718
777
|
)
|
|
@@ -721,10 +780,10 @@ function BusinessFinancingFinancialInformation({
|
|
|
721
780
|
/* @__PURE__ */ jsx(
|
|
722
781
|
Currency,
|
|
723
782
|
{
|
|
724
|
-
country
|
|
783
|
+
country,
|
|
725
784
|
data: formUtils.getFieldData(financialData, CURRENCY_FIELD),
|
|
726
|
-
errors: formUtils.getFieldErrors(financialErrors,
|
|
727
|
-
handleChangeFor,
|
|
785
|
+
errors: formUtils.getFieldErrors(financialErrors, fieldValidationErrors, CURRENCY_FIELD),
|
|
786
|
+
handleChangeFor: handleFieldChange,
|
|
728
787
|
labels: { currency: i18n.get("reportingCurrency") },
|
|
729
788
|
readonly: formUtils.isReadOnly("currency"),
|
|
730
789
|
valid: formUtils.getFieldValid(isFinancialDataValid, CURRENCY_FIELD)
|
|
@@ -737,15 +796,15 @@ function BusinessFinancingFinancialInformation({
|
|
|
737
796
|
name: "netAssets",
|
|
738
797
|
label: formUtils.getLabel("netAssets", "totalAssets"),
|
|
739
798
|
helper: i18n.get("totalAssetsHelper"),
|
|
740
|
-
errorMessage: formUtils.getErrorMessage("netAssets", errors,
|
|
799
|
+
errorMessage: formUtils.getErrorMessage("netAssets", errors, fieldValidationErrors),
|
|
741
800
|
children: (childProps) => /* @__PURE__ */ jsx(
|
|
742
801
|
InputCurrency,
|
|
743
802
|
{
|
|
744
803
|
...childProps,
|
|
745
804
|
locale: i18n.locale,
|
|
746
|
-
currency: data.currency ?? defaultCurrency,
|
|
747
|
-
amount: data.netAssets,
|
|
748
|
-
onAmountChanged:
|
|
805
|
+
currency: (data == null ? void 0 : data.currency) ?? defaultCurrency,
|
|
806
|
+
amount: (data == null ? void 0 : data.netAssets) ? Number(data == null ? void 0 : data.netAssets) : void 0,
|
|
807
|
+
onAmountChanged: handleFieldChange("netAssets")
|
|
749
808
|
}
|
|
750
809
|
)
|
|
751
810
|
}
|
|
@@ -756,16 +815,16 @@ function BusinessFinancingFinancialInformation({
|
|
|
756
815
|
name: "annualTurnover",
|
|
757
816
|
label: formUtils.getLabel("annualTurnover", "annualTurnover"),
|
|
758
817
|
helper: i18n.get("annualTurnoverHelper"),
|
|
759
|
-
errorMessage: formUtils.getErrorMessage("annualTurnover", errors,
|
|
818
|
+
errorMessage: formUtils.getErrorMessage("annualTurnover", errors, fieldValidationErrors),
|
|
760
819
|
children: (childProps) => /* @__PURE__ */ jsx(
|
|
761
820
|
InputCurrency,
|
|
762
821
|
{
|
|
763
822
|
...childProps,
|
|
764
823
|
name: "annualTurnover",
|
|
765
824
|
locale: i18n.locale,
|
|
766
|
-
currency: data.currency ?? defaultCurrency,
|
|
767
|
-
amount: data.annualTurnover,
|
|
768
|
-
onAmountChanged:
|
|
825
|
+
currency: (data == null ? void 0 : data.currency) ?? defaultCurrency,
|
|
826
|
+
amount: (data == null ? void 0 : data.annualTurnover) ? Number(data == null ? void 0 : data.annualTurnover) : void 0,
|
|
827
|
+
onAmountChanged: handleFieldChange("annualTurnover")
|
|
769
828
|
}
|
|
770
829
|
)
|
|
771
830
|
}
|
|
@@ -774,16 +833,17 @@ function BusinessFinancingFinancialInformation({
|
|
|
774
833
|
] });
|
|
775
834
|
}
|
|
776
835
|
const TODAY_DATE = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
handleChangeFor,
|
|
784
|
-
sectionHeading
|
|
785
|
-
}) {
|
|
836
|
+
const legalInformationFields = [
|
|
837
|
+
"legalInformationInsolvency",
|
|
838
|
+
"legalProceedingsDate"
|
|
839
|
+
];
|
|
840
|
+
function BusinessFinancingLegalInformation(props) {
|
|
841
|
+
const { data, valid, errors, fieldValidationErrors, handleFieldChange, sectionHeading } = props;
|
|
786
842
|
const { i18n } = useI18nContext();
|
|
843
|
+
const formUtils = createFormUtils(props, i18n);
|
|
844
|
+
if (!handleFieldChange) {
|
|
845
|
+
return;
|
|
846
|
+
}
|
|
787
847
|
const legalInformationInsolvencyItems = [
|
|
788
848
|
{ id: "noLegalActionsTaken", name: i18n.get("no") },
|
|
789
849
|
{ id: "underJudicialAdministration", name: i18n.get("underJudicialAdministration") },
|
|
@@ -791,7 +851,7 @@ function BusinessFinancingLegalInformation({
|
|
|
791
851
|
{ id: "otherLegalMeasures", name: i18n.get("otherLegalMeasures") },
|
|
792
852
|
{ id: "iDontKnow", name: i18n.get("iDontKnow") }
|
|
793
853
|
];
|
|
794
|
-
const showLegalProceedingsDateField = data.legalInformationInsolvency && !["noLegalActionsTaken", "iDontKnow"].includes(data.legalInformationInsolvency);
|
|
854
|
+
const showLegalProceedingsDateField = (data == null ? void 0 : data.legalInformationInsolvency) && !["noLegalActionsTaken", "iDontKnow"].includes(data == null ? void 0 : data.legalInformationInsolvency);
|
|
795
855
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
796
856
|
/* @__PURE__ */ jsx(Typography, { el: "h3", variant: "title", children: i18n.get(sectionHeading || "legalInformation") }),
|
|
797
857
|
/* @__PURE__ */ jsx(
|
|
@@ -802,20 +862,20 @@ function BusinessFinancingLegalInformation({
|
|
|
802
862
|
errorMessage: formUtils.getErrorMessage(
|
|
803
863
|
"legalInformationInsolvency",
|
|
804
864
|
errors,
|
|
805
|
-
|
|
865
|
+
fieldValidationErrors
|
|
806
866
|
),
|
|
807
|
-
isValid: valid.legalInformationInsolvency,
|
|
867
|
+
isValid: valid == null ? void 0 : valid.legalInformationInsolvency,
|
|
808
868
|
children: (childProps) => /* @__PURE__ */ jsx(
|
|
809
869
|
Select,
|
|
810
870
|
{
|
|
811
871
|
...childProps,
|
|
812
|
-
onChange:
|
|
872
|
+
onChange: handleFieldChange("legalInformationInsolvency", "blur"),
|
|
813
873
|
name: "legalInformationInsolvency",
|
|
814
874
|
placeholder: i18n.get("selectOne"),
|
|
815
|
-
selected: data.legalInformationInsolvency,
|
|
875
|
+
selected: data == null ? void 0 : data.legalInformationInsolvency,
|
|
816
876
|
items: legalInformationInsolvencyItems,
|
|
817
877
|
"aria-required": true,
|
|
818
|
-
"aria-invalid": !valid.legalInformationInsolvency
|
|
878
|
+
"aria-invalid": !(valid == null ? void 0 : valid.legalInformationInsolvency)
|
|
819
879
|
}
|
|
820
880
|
)
|
|
821
881
|
}
|
|
@@ -825,8 +885,12 @@ function BusinessFinancingLegalInformation({
|
|
|
825
885
|
{
|
|
826
886
|
name: "legalProceedingsDate",
|
|
827
887
|
label: formUtils.getLabel("legalProceedingsDate", "legalProceedingsDate"),
|
|
828
|
-
errorMessage: formUtils.getErrorMessage(
|
|
829
|
-
|
|
888
|
+
errorMessage: formUtils.getErrorMessage(
|
|
889
|
+
"legalProceedingsDate",
|
|
890
|
+
errors,
|
|
891
|
+
fieldValidationErrors
|
|
892
|
+
),
|
|
893
|
+
isValid: valid == null ? void 0 : valid.legalProceedingsDate,
|
|
830
894
|
children: (childProps) => /* @__PURE__ */ jsx(
|
|
831
895
|
InputDate,
|
|
832
896
|
{
|
|
@@ -834,10 +898,10 @@ function BusinessFinancingLegalInformation({
|
|
|
834
898
|
name: "legalProceedingsDate",
|
|
835
899
|
value: data.legalProceedingsDate,
|
|
836
900
|
classNameModifiers: ["legalProceedingsDate"],
|
|
837
|
-
onInput:
|
|
838
|
-
onBlur:
|
|
901
|
+
onInput: handleFieldChange("legalProceedingsDate", "input"),
|
|
902
|
+
onBlur: handleFieldChange("legalProceedingsDate", "blur"),
|
|
839
903
|
"aria-required": true,
|
|
840
|
-
"aria-invalid": !valid.legalProceedingsDate,
|
|
904
|
+
"aria-invalid": !(valid == null ? void 0 : valid.legalProceedingsDate),
|
|
841
905
|
max: TODAY_DATE
|
|
842
906
|
}
|
|
843
907
|
)
|
|
@@ -845,16 +909,17 @@ function BusinessFinancingLegalInformation({
|
|
|
845
909
|
)
|
|
846
910
|
] });
|
|
847
911
|
}
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
handleChangeFor,
|
|
855
|
-
legalEntity
|
|
856
|
-
}) {
|
|
912
|
+
const ownershipStructureFields = [
|
|
913
|
+
"isCompanyOwnedByAnotherCompany",
|
|
914
|
+
"isParentOwnedByAnotherCompany"
|
|
915
|
+
];
|
|
916
|
+
function BusinessFinancingOwnershipStructure(props) {
|
|
917
|
+
const { data, valid, errors = {}, legalEntity, fieldValidationErrors, handleFieldChange } = props;
|
|
857
918
|
const { i18n } = useI18nContext();
|
|
919
|
+
const formUtils = createFormUtils(props, i18n);
|
|
920
|
+
if (!handleFieldChange) {
|
|
921
|
+
return;
|
|
922
|
+
}
|
|
858
923
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
859
924
|
/* @__PURE__ */ jsx(Typography, { el: "h3", variant: "title", children: i18n.get("ownershipStructure") }),
|
|
860
925
|
/* @__PURE__ */ jsx(
|
|
@@ -869,7 +934,7 @@ function BusinessFinancingOwnershipStructure({
|
|
|
869
934
|
errorMessage: formUtils.getErrorMessage(
|
|
870
935
|
"isCompanyOwnedByAnotherCompany",
|
|
871
936
|
errors,
|
|
872
|
-
|
|
937
|
+
fieldValidationErrors
|
|
873
938
|
),
|
|
874
939
|
helper: /* @__PURE__ */ jsx(Typography, { el: "div", variant: "body", color: "secondary", children: /* @__PURE__ */ jsx("span", { children: i18n.get("thisMeansYouHaveAParentCompany") }) }),
|
|
875
940
|
children: (childProps) => /* @__PURE__ */ jsx(
|
|
@@ -878,11 +943,11 @@ function BusinessFinancingOwnershipStructure({
|
|
|
878
943
|
...childProps,
|
|
879
944
|
name: "isCompanyOwnedByAnotherCompany",
|
|
880
945
|
items: businessFinancingRadioItems,
|
|
881
|
-
value: data.isCompanyOwnedByAnotherCompany,
|
|
946
|
+
value: data == null ? void 0 : data.isCompanyOwnedByAnotherCompany,
|
|
882
947
|
disabled: false,
|
|
883
|
-
onChange:
|
|
948
|
+
onChange: handleFieldChange("isCompanyOwnedByAnotherCompany"),
|
|
884
949
|
"aria-required": true,
|
|
885
|
-
"aria-invalid": !valid.isCompanyOwnedByAnotherCompany
|
|
950
|
+
"aria-invalid": !(valid == null ? void 0 : valid.isCompanyOwnedByAnotherCompany)
|
|
886
951
|
}
|
|
887
952
|
)
|
|
888
953
|
}
|
|
@@ -896,9 +961,9 @@ function BusinessFinancingOwnershipStructure({
|
|
|
896
961
|
label: formUtils.getLabel("isParentOwnedByAnotherCompany"),
|
|
897
962
|
helper: /* @__PURE__ */ jsx(Typography, { el: "div", variant: "body", color: "secondary", children: /* @__PURE__ */ jsx("span", { children: i18n.get("thisMeansYouHaveAnUltimateParentCompany") }) }),
|
|
898
963
|
errorMessage: formUtils.getErrorMessage(
|
|
899
|
-
"
|
|
964
|
+
"isCompanyOwnedByAnotherCompany",
|
|
900
965
|
errors,
|
|
901
|
-
|
|
966
|
+
fieldValidationErrors
|
|
902
967
|
),
|
|
903
968
|
children: (childProps) => /* @__PURE__ */ jsx(
|
|
904
969
|
RadioGroup,
|
|
@@ -908,9 +973,9 @@ function BusinessFinancingOwnershipStructure({
|
|
|
908
973
|
items: businessFinancingRadioItems,
|
|
909
974
|
value: data.isParentOwnedByAnotherCompany,
|
|
910
975
|
disabled: false,
|
|
911
|
-
onChange:
|
|
976
|
+
onChange: handleFieldChange("isCompanyOwnedByAnotherCompany"),
|
|
912
977
|
"aria-required": true,
|
|
913
|
-
"aria-invalid": !valid.isParentOwnedByAnotherCompany
|
|
978
|
+
"aria-invalid": !(valid == null ? void 0 : valid.isParentOwnedByAnotherCompany)
|
|
914
979
|
}
|
|
915
980
|
)
|
|
916
981
|
}
|
|
@@ -920,35 +985,15 @@ function BusinessFinancingOwnershipStructure({
|
|
|
920
985
|
function AdditionalFieldsForBusinessFinancingCompany(props) {
|
|
921
986
|
const { i18n } = useI18nContext();
|
|
922
987
|
const {
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
formVerificationErrors,
|
|
927
|
-
legalEntity
|
|
928
|
-
} = props;
|
|
929
|
-
const getFormSchema = useCallback(
|
|
930
|
-
(currentData) => getCompanySchemaKeys(country, currentData, companySchemaKeys),
|
|
931
|
-
[]
|
|
932
|
-
);
|
|
933
|
-
const { handleChangeFor, data, schema, valid, errors, fieldProblems, setValid } = useForm({
|
|
934
|
-
...props,
|
|
935
|
-
schema: getFormSchema,
|
|
936
|
-
defaultData: businessFinancingCompanyDetailsData,
|
|
937
|
-
rules: validators || businessFinancingCompanyDetailsValidations,
|
|
938
|
-
fieldProblems: props == null ? void 0 : props.fieldValidationErrors
|
|
939
|
-
});
|
|
988
|
+
form: { handleChangeFor, data }
|
|
989
|
+
} = useFormContext();
|
|
990
|
+
const { country, formVerificationErrors, legalEntity } = props;
|
|
940
991
|
const formUtils = createFormUtils(props, i18n);
|
|
941
|
-
const
|
|
942
|
-
const
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
valid,
|
|
947
|
-
errors,
|
|
948
|
-
fieldProblems,
|
|
949
|
-
schema
|
|
950
|
-
});
|
|
951
|
-
}, [data, valid, errors, schema, fieldProblems]);
|
|
992
|
+
const handleChange = (fieldName, mode) => handleChangeFor(fieldName, "company", mode);
|
|
993
|
+
const ownershipStructureProps = getFieldProps(props, ownershipStructureFields);
|
|
994
|
+
const businessInformationProps = getFieldProps(props, businessInformationFields);
|
|
995
|
+
const financialInformationProps = getFieldProps(props, financialInformationFields);
|
|
996
|
+
const legalInformationProps = getFieldProps(props, legalInformationFields);
|
|
952
997
|
return /* @__PURE__ */ jsxs("form", { className: "adyen-kyc__high-exposure-company", children: [
|
|
953
998
|
/* @__PURE__ */ jsx(Typography, { el: "h1", variant: "title-l", children: i18n.get("additionalInformationForBusinessFinancing") }),
|
|
954
999
|
/* @__PURE__ */ jsx(Typography, { el: "p", variant: "body", children: i18n.get("beforeSubmittingYourCapitalLoanApplication") }),
|
|
@@ -964,71 +1009,56 @@ function AdditionalFieldsForBusinessFinancingCompany(props) {
|
|
|
964
1009
|
/* @__PURE__ */ jsx(
|
|
965
1010
|
BusinessFinancingBusinessInformation,
|
|
966
1011
|
{
|
|
967
|
-
...
|
|
968
|
-
|
|
969
|
-
errors,
|
|
970
|
-
data,
|
|
971
|
-
valid,
|
|
1012
|
+
...businessInformationProps,
|
|
1013
|
+
handleFieldChange: handleChange,
|
|
972
1014
|
country,
|
|
973
|
-
formUtils,
|
|
974
|
-
fieldProblems,
|
|
975
1015
|
targetPage: BusinessFinancingPagesEnums.COMPANY_PAGE,
|
|
976
|
-
sectionHeading: "yourBusinessInformation"
|
|
1016
|
+
sectionHeading: "yourBusinessInformation",
|
|
1017
|
+
data: formUtils.getFieldData((data == null ? void 0 : data.company) ?? {}, businessInformationFields)
|
|
977
1018
|
}
|
|
978
1019
|
),
|
|
979
1020
|
/* @__PURE__ */ jsx(
|
|
980
1021
|
BusinessFinancingOwnershipStructure,
|
|
981
1022
|
{
|
|
982
|
-
...
|
|
983
|
-
handleChangeFor,
|
|
984
|
-
errors,
|
|
985
|
-
data,
|
|
986
|
-
valid,
|
|
1023
|
+
...ownershipStructureProps,
|
|
987
1024
|
legalEntity,
|
|
988
|
-
|
|
989
|
-
|
|
1025
|
+
handleFieldChange: handleChange,
|
|
1026
|
+
data: formUtils.getFieldData((data == null ? void 0 : data.company) ?? {}, ownershipStructureFields)
|
|
990
1027
|
}
|
|
991
1028
|
),
|
|
992
1029
|
isEeaCountry(country) && /* @__PURE__ */ jsx(
|
|
993
1030
|
BusinessFinancingFinancialInformation,
|
|
994
1031
|
{
|
|
995
|
-
...
|
|
996
|
-
|
|
997
|
-
errors,
|
|
998
|
-
data,
|
|
999
|
-
valid,
|
|
1032
|
+
...financialInformationProps,
|
|
1033
|
+
handleFieldChange: handleChange,
|
|
1000
1034
|
country,
|
|
1001
|
-
formUtils,
|
|
1002
|
-
fieldProblems,
|
|
1003
1035
|
targetPage: BusinessFinancingPagesEnums.COMPANY_PAGE,
|
|
1004
|
-
|
|
1036
|
+
data: formUtils.getFieldData((data == null ? void 0 : data.company) ?? {}, financialInformationFields)
|
|
1005
1037
|
}
|
|
1006
1038
|
),
|
|
1007
1039
|
/* @__PURE__ */ jsx(
|
|
1008
1040
|
BusinessFinancingLegalInformation,
|
|
1009
1041
|
{
|
|
1010
|
-
...
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
formUtils,
|
|
1016
|
-
fieldProblems,
|
|
1017
|
-
targetPage: BusinessFinancingPagesEnums.COMPANY_PAGE
|
|
1042
|
+
...legalInformationProps,
|
|
1043
|
+
country,
|
|
1044
|
+
handleFieldChange: handleChange,
|
|
1045
|
+
targetPage: BusinessFinancingPagesEnums.COMPANY_PAGE,
|
|
1046
|
+
sectionHeading: "legalInformation",
|
|
1047
|
+
data: formUtils.getFieldData((data == null ? void 0 : data.company) ?? {}, legalInformationFields)
|
|
1018
1048
|
}
|
|
1019
1049
|
)
|
|
1020
1050
|
] });
|
|
1021
1051
|
}
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
errors,
|
|
1027
|
-
fieldProblems,
|
|
1028
|
-
handleChangeFor,
|
|
1029
|
-
sectionHeading
|
|
1030
|
-
}) {
|
|
1052
|
+
const basicInformationFields = [
|
|
1053
|
+
"legalName"
|
|
1054
|
+
];
|
|
1055
|
+
function BusinessFinancingBasicCompanyInformation(props) {
|
|
1056
|
+
const { data, valid, errors, fieldValidationErrors, handleFieldChange, sectionHeading } = props;
|
|
1031
1057
|
const { i18n } = useI18nContext();
|
|
1058
|
+
const formUtils = createFormUtils(props, i18n);
|
|
1059
|
+
if (!handleFieldChange) {
|
|
1060
|
+
return;
|
|
1061
|
+
}
|
|
1032
1062
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1033
1063
|
/* @__PURE__ */ jsx(Typography, { el: "h3", variant: "title", children: i18n.get(sectionHeading || "basicCompanyInformation") }),
|
|
1034
1064
|
/* @__PURE__ */ jsx(
|
|
@@ -1037,21 +1067,21 @@ function BusinessFinancingBasicCompanyInformation({
|
|
|
1037
1067
|
name: "legalName",
|
|
1038
1068
|
label: formUtils.getLabel("legalName", "legalName"),
|
|
1039
1069
|
classNameModifiers: ["legalName"],
|
|
1040
|
-
errorMessage: formUtils.getErrorMessage("legalName", errors,
|
|
1041
|
-
isValid: valid.legalName,
|
|
1070
|
+
errorMessage: formUtils.getErrorMessage("legalName", errors, fieldValidationErrors),
|
|
1071
|
+
isValid: valid == null ? void 0 : valid.legalName,
|
|
1042
1072
|
helper: i18n.get("legalNameIsUsedToIdentifyABusinessWithTheGovernment"),
|
|
1043
1073
|
children: (childProps) => /* @__PURE__ */ jsx(
|
|
1044
1074
|
InputText,
|
|
1045
1075
|
{
|
|
1046
1076
|
...childProps,
|
|
1047
1077
|
name: "legalName",
|
|
1048
|
-
value: data.legalName,
|
|
1078
|
+
value: data == null ? void 0 : data.legalName,
|
|
1049
1079
|
readonly: false,
|
|
1050
1080
|
classNameModifiers: ["legalName"],
|
|
1051
|
-
onInput:
|
|
1052
|
-
onBlur:
|
|
1081
|
+
onInput: handleFieldChange("legalName", "input"),
|
|
1082
|
+
onBlur: handleFieldChange("legalName", "blur"),
|
|
1053
1083
|
"aria-required": true,
|
|
1054
|
-
"aria-invalid": !valid.legalName
|
|
1084
|
+
"aria-invalid": !(valid == null ? void 0 : valid.legalName)
|
|
1055
1085
|
}
|
|
1056
1086
|
)
|
|
1057
1087
|
}
|
|
@@ -1059,23 +1089,26 @@ function BusinessFinancingBasicCompanyInformation({
|
|
|
1059
1089
|
] });
|
|
1060
1090
|
}
|
|
1061
1091
|
const OPTIONAL_ADDRESS_FIELDS = ["otherAddressInformation"];
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1092
|
+
const registeredAddressFields = [
|
|
1093
|
+
"isThisAddressTheMainHeadquarters",
|
|
1094
|
+
"registrationAddress"
|
|
1095
|
+
];
|
|
1096
|
+
function BusinessFinancingRegisteredAddress(props) {
|
|
1097
|
+
var _a;
|
|
1098
|
+
const {
|
|
1099
|
+
data,
|
|
1100
|
+
valid,
|
|
1101
|
+
errors,
|
|
1102
|
+
fieldValidationErrors,
|
|
1103
|
+
shouldValidate,
|
|
1104
|
+
defaultData,
|
|
1105
|
+
handleFieldChange,
|
|
1106
|
+
formId,
|
|
1107
|
+
legalEntity,
|
|
1108
|
+
sectionHeading
|
|
1109
|
+
} = props;
|
|
1076
1110
|
const { i18n } = useI18nContext();
|
|
1077
|
-
const
|
|
1078
|
-
const data = formId === "parentCompany" ? parentCompany : ultimateParentCompany;
|
|
1111
|
+
const formUtils = createFormUtils(props, i18n);
|
|
1079
1112
|
const addressCountry = (_a = data == null ? void 0 : data.registrationAddress) == null ? void 0 : _a.country;
|
|
1080
1113
|
const addressSchema = useMemo(() => {
|
|
1081
1114
|
return getAddressSchemaForCountry(addressCountry).filter((field) => {
|
|
@@ -1085,27 +1118,15 @@ function BusinessFinancingRegisteredAddress({
|
|
|
1085
1118
|
return true;
|
|
1086
1119
|
});
|
|
1087
1120
|
}, [addressCountry]);
|
|
1121
|
+
if (!handleFieldChange) {
|
|
1122
|
+
return;
|
|
1123
|
+
}
|
|
1088
1124
|
const handleRegistrationAddressChange = (state) => {
|
|
1089
1125
|
if (!state.data.country) {
|
|
1090
1126
|
state.data.country = addressCountry;
|
|
1091
1127
|
}
|
|
1092
|
-
|
|
1093
|
-
if (setValid) {
|
|
1094
|
-
setValid("registrationAddress", Boolean(state.isValid));
|
|
1095
|
-
}
|
|
1128
|
+
handleFieldChange("registrationAddress")(state.data);
|
|
1096
1129
|
};
|
|
1097
|
-
useEffect(() => {
|
|
1098
|
-
var _a2, _b2;
|
|
1099
|
-
const countryCurrencies = ((_a2 = data == null ? void 0 : data.registrationAddress) == null ? void 0 : _a2.country) ? currencyByCountry[(_b2 = data == null ? void 0 : data.registrationAddress) == null ? void 0 : _b2.country] : null;
|
|
1100
|
-
if ((countryCurrencies == null ? void 0 : countryCurrencies.length) === 1) {
|
|
1101
|
-
handleChangeFor("currency")({
|
|
1102
|
-
target: {
|
|
1103
|
-
name: "currency",
|
|
1104
|
-
value: countryCurrencies[0]
|
|
1105
|
-
}
|
|
1106
|
-
});
|
|
1107
|
-
}
|
|
1108
|
-
}, [(_b = data == null ? void 0 : data.registrationAddress) == null ? void 0 : _b.country]);
|
|
1109
1130
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1110
1131
|
/* @__PURE__ */ jsx(Typography, { el: "h3", variant: "title", children: i18n.get(sectionHeading || "registeredAddress") }),
|
|
1111
1132
|
/* @__PURE__ */ jsx(Typography, { el: "h3", variant: "caption", children: i18n.get("addressRegisteredWithSecretaryOfState") }),
|
|
@@ -1121,7 +1142,7 @@ function BusinessFinancingRegisteredAddress({
|
|
|
1121
1142
|
errorMessage: formUtils.getErrorMessage(
|
|
1122
1143
|
"isThisAddressTheMainHeadquarters",
|
|
1123
1144
|
errors,
|
|
1124
|
-
|
|
1145
|
+
fieldValidationErrors
|
|
1125
1146
|
),
|
|
1126
1147
|
children: (childProps) => /* @__PURE__ */ jsx(
|
|
1127
1148
|
RadioGroup,
|
|
@@ -1131,9 +1152,9 @@ function BusinessFinancingRegisteredAddress({
|
|
|
1131
1152
|
items: businessFinancingRadioItems,
|
|
1132
1153
|
value: data == null ? void 0 : data.isThisAddressTheMainHeadquarters,
|
|
1133
1154
|
disabled: false,
|
|
1134
|
-
onChange:
|
|
1155
|
+
onChange: handleFieldChange("isThisAddressTheMainHeadquarters"),
|
|
1135
1156
|
"aria-required": true,
|
|
1136
|
-
"aria-invalid": !valid.isThisAddressTheMainHeadquarters
|
|
1157
|
+
"aria-invalid": !(valid == null ? void 0 : valid.isThisAddressTheMainHeadquarters)
|
|
1137
1158
|
}
|
|
1138
1159
|
)
|
|
1139
1160
|
}
|
|
@@ -1156,40 +1177,19 @@ function BusinessFinancingRegisteredAddress({
|
|
|
1156
1177
|
}
|
|
1157
1178
|
const parentCompanyFormId$1 = businessFinancingForms.parentCompany.formId;
|
|
1158
1179
|
function AdditionalFieldsForBusinessFinancingParentCompany(props) {
|
|
1159
|
-
var _a;
|
|
1160
|
-
const {
|
|
1161
|
-
shouldValidate,
|
|
1162
|
-
data: businessFinancingParentCompanyDetailsData,
|
|
1163
|
-
country,
|
|
1164
|
-
formVerificationErrors
|
|
1165
|
-
} = props;
|
|
1180
|
+
var _a, _b, _c, _d, _e, _f;
|
|
1166
1181
|
const { i18n } = useI18nContext();
|
|
1167
|
-
const
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
const { handleChangeFor, data, valid, schema, setValid, errors, fieldProblems } = useForm({
|
|
1172
|
-
...props,
|
|
1173
|
-
schema: getFormSchema,
|
|
1174
|
-
defaultData: businessFinancingParentCompanyDetailsData,
|
|
1175
|
-
rules: businessFinancingParentCompanyDetailsValidations,
|
|
1176
|
-
fieldProblems: props == null ? void 0 : props.fieldValidationErrors,
|
|
1177
|
-
shouldValidate
|
|
1178
|
-
});
|
|
1182
|
+
const {
|
|
1183
|
+
form: { handleChangeFor, data }
|
|
1184
|
+
} = useFormContext();
|
|
1185
|
+
const { country, formVerificationErrors } = props;
|
|
1179
1186
|
const formUtils = createFormUtils(props, i18n);
|
|
1180
|
-
const
|
|
1181
|
-
const
|
|
1182
|
-
|
|
1183
|
-
);
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
data,
|
|
1187
|
-
valid,
|
|
1188
|
-
errors,
|
|
1189
|
-
fieldProblems,
|
|
1190
|
-
schema
|
|
1191
|
-
});
|
|
1192
|
-
}, [data, valid, errors, schema, fieldProblems]);
|
|
1187
|
+
const handleChange = (fieldName, mode) => handleChangeFor(fieldName, "parentCompany", mode);
|
|
1188
|
+
const basicCompanyInformationProps = getFieldProps(props, basicInformationFields);
|
|
1189
|
+
const registeredAddressProps = getFieldProps(props, registeredAddressFields);
|
|
1190
|
+
const businessInformationProps = getFieldProps(props, businessInformationFields);
|
|
1191
|
+
const financialInformationProps = getFieldProps(props, financialInformationFields);
|
|
1192
|
+
const legalInformationProps = getFieldProps(props, legalInformationFields);
|
|
1193
1193
|
return /* @__PURE__ */ jsxs("form", { className: "adyen-kyc__high-exposure-parent-company", children: [
|
|
1194
1194
|
/* @__PURE__ */ jsx(Typography, { el: "h1", variant: "title-l", children: i18n.get("parentCompanyInformation") }),
|
|
1195
1195
|
/* @__PURE__ */ jsx(Typography, { el: "p", variant: "body", children: i18n.get("inThePreviousStepOwnedByAParentCompany") }),
|
|
@@ -1205,116 +1205,72 @@ function AdditionalFieldsForBusinessFinancingParentCompany(props) {
|
|
|
1205
1205
|
/* @__PURE__ */ jsx(
|
|
1206
1206
|
BusinessFinancingBasicCompanyInformation,
|
|
1207
1207
|
{
|
|
1208
|
-
...
|
|
1209
|
-
handleChangeFor: businessFinancingHandleChangeFor,
|
|
1208
|
+
...basicCompanyInformationProps,
|
|
1210
1209
|
sectionHeading: "basicCompanyInformation",
|
|
1211
|
-
|
|
1212
|
-
data,
|
|
1213
|
-
valid,
|
|
1214
|
-
formUtils,
|
|
1215
|
-
fieldProblems
|
|
1210
|
+
handleFieldChange: handleChange,
|
|
1211
|
+
data: formUtils.getFieldData((data == null ? void 0 : data.parentCompany) ?? {}, basicInformationFields)
|
|
1216
1212
|
}
|
|
1217
1213
|
),
|
|
1218
1214
|
/* @__PURE__ */ jsx(
|
|
1219
1215
|
BusinessFinancingRegisteredAddress,
|
|
1220
1216
|
{
|
|
1221
|
-
...
|
|
1217
|
+
...registeredAddressProps,
|
|
1222
1218
|
formId: parentCompanyFormId$1,
|
|
1223
|
-
handleChangeFor: businessFinancingHandleChangeFor,
|
|
1224
1219
|
sectionHeading: "registeredAddress",
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
setValid,
|
|
1229
|
-
formUtils,
|
|
1230
|
-
fieldProblems,
|
|
1231
|
-
targetPage: BusinessFinancingPagesEnums.PARENT_COMPANY_PAGE,
|
|
1232
|
-
shouldValidate
|
|
1220
|
+
defaultData: data == null ? void 0 : data.parentCompany,
|
|
1221
|
+
handleFieldChange: handleChange,
|
|
1222
|
+
data: formUtils.getFieldData((data == null ? void 0 : data.parentCompany) ?? {}, registeredAddressFields)
|
|
1233
1223
|
}
|
|
1234
1224
|
),
|
|
1235
1225
|
/* @__PURE__ */ jsx(
|
|
1236
1226
|
BusinessFinancingBusinessInformation,
|
|
1237
1227
|
{
|
|
1238
|
-
...
|
|
1239
|
-
handleChangeFor: businessFinancingHandleChangeFor,
|
|
1228
|
+
...businessInformationProps,
|
|
1240
1229
|
sectionHeading: "additionalCompanyInformation",
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
formUtils,
|
|
1246
|
-
fieldProblems,
|
|
1247
|
-
targetPage: BusinessFinancingPagesEnums.PARENT_COMPANY_PAGE
|
|
1230
|
+
country: ((_b = (_a = data == null ? void 0 : data.parentCompany) == null ? void 0 : _a.registrationAddress) == null ? void 0 : _b.country) ?? country,
|
|
1231
|
+
targetPage: BusinessFinancingPagesEnums.PARENT_COMPANY_PAGE,
|
|
1232
|
+
handleFieldChange: handleChange,
|
|
1233
|
+
data: formUtils.getFieldData((data == null ? void 0 : data.parentCompany) ?? {}, businessInformationFields)
|
|
1248
1234
|
}
|
|
1249
1235
|
),
|
|
1250
|
-
isEeaCountry((
|
|
1236
|
+
isEeaCountry((_d = (_c = data == null ? void 0 : data.parentCompany) == null ? void 0 : _c.registrationAddress) == null ? void 0 : _d.country) && /* @__PURE__ */ jsx(
|
|
1251
1237
|
BusinessFinancingFinancialInformation,
|
|
1252
1238
|
{
|
|
1253
|
-
...
|
|
1254
|
-
|
|
1255
|
-
errors,
|
|
1256
|
-
data,
|
|
1257
|
-
valid,
|
|
1258
|
-
country,
|
|
1259
|
-
formUtils,
|
|
1260
|
-
fieldProblems,
|
|
1239
|
+
...financialInformationProps,
|
|
1240
|
+
country: ((_f = (_e = data == null ? void 0 : data.parentCompany) == null ? void 0 : _e.registrationAddress) == null ? void 0 : _f.country) ?? country,
|
|
1261
1241
|
targetPage: BusinessFinancingPagesEnums.PARENT_COMPANY_PAGE,
|
|
1262
|
-
|
|
1242
|
+
handleFieldChange: handleChange,
|
|
1243
|
+
data: formUtils.getFieldData((data == null ? void 0 : data.parentCompany) ?? {}, financialInformationFields)
|
|
1263
1244
|
}
|
|
1264
1245
|
),
|
|
1265
1246
|
/* @__PURE__ */ jsx(
|
|
1266
1247
|
BusinessFinancingLegalInformation,
|
|
1267
1248
|
{
|
|
1268
|
-
...
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
formUtils,
|
|
1274
|
-
fieldProblems,
|
|
1275
|
-
targetPage: BusinessFinancingPagesEnums.PARENT_COMPANY_PAGE
|
|
1249
|
+
...legalInformationProps,
|
|
1250
|
+
country,
|
|
1251
|
+
targetPage: BusinessFinancingPagesEnums.PARENT_COMPANY_PAGE,
|
|
1252
|
+
sectionHeading: "legalInformation",
|
|
1253
|
+
handleFieldChange: handleChange,
|
|
1254
|
+
data: formUtils.getFieldData((data == null ? void 0 : data.parentCompany) ?? {}, legalInformationFields)
|
|
1276
1255
|
}
|
|
1277
1256
|
)
|
|
1278
1257
|
] });
|
|
1279
1258
|
}
|
|
1280
1259
|
const ultimateParentCompanyFormId$1 = businessFinancingForms.ultimateParentCompany.formId;
|
|
1281
1260
|
function AdditionalFieldsForBusinessFinancingUltimateParentCompany(props) {
|
|
1282
|
-
var _a;
|
|
1283
|
-
const {
|
|
1284
|
-
data: additionalFieldsForBusinessFinancingUltimateParentCompanyData,
|
|
1285
|
-
validators,
|
|
1286
|
-
formVerificationErrors,
|
|
1287
|
-
country
|
|
1288
|
-
} = props;
|
|
1261
|
+
var _a, _b;
|
|
1262
|
+
const { formVerificationErrors, country } = props;
|
|
1289
1263
|
const { i18n } = useI18nContext();
|
|
1290
|
-
const
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
);
|
|
1294
|
-
const
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
});
|
|
1301
|
-
const formUtils = createFormUtils(
|
|
1302
|
-
props,
|
|
1303
|
-
i18n
|
|
1304
|
-
);
|
|
1305
|
-
const businessFinancingHandleChangeFor = handleChangeFor;
|
|
1306
|
-
const { updateStateSlice } = useGlobalDataSlice(
|
|
1307
|
-
"ultimateParentCompany"
|
|
1308
|
-
);
|
|
1309
|
-
useEffect(() => {
|
|
1310
|
-
updateStateSlice == null ? void 0 : updateStateSlice({
|
|
1311
|
-
data,
|
|
1312
|
-
valid,
|
|
1313
|
-
errors,
|
|
1314
|
-
fieldProblems,
|
|
1315
|
-
schema
|
|
1316
|
-
});
|
|
1317
|
-
}, [data, valid, errors, schema, fieldProblems]);
|
|
1264
|
+
const formUtils = createFormUtils(props, i18n);
|
|
1265
|
+
const {
|
|
1266
|
+
form: { handleChangeFor, data }
|
|
1267
|
+
} = useFormContext();
|
|
1268
|
+
const handleChange = (fieldName, mode) => handleChangeFor(fieldName, "ultimateParentCompany", mode);
|
|
1269
|
+
const basicCompanyInformationProps = getFieldProps(props, basicInformationFields);
|
|
1270
|
+
const registeredAddressProps = getFieldProps(props, registeredAddressFields);
|
|
1271
|
+
const businessInformationProps = getFieldProps(props, businessInformationFields);
|
|
1272
|
+
const financialInformationProps = getFieldProps(props, financialInformationFields);
|
|
1273
|
+
const legalInformationProps = getFieldProps(props, legalInformationFields);
|
|
1318
1274
|
return /* @__PURE__ */ jsxs("form", { className: "adyen-kyc__high-exposure-ultimate-parent-company", children: [
|
|
1319
1275
|
/* @__PURE__ */ jsx(Typography, { el: "h1", variant: "title-l", children: i18n.get("ultimateParentCompanyInformation") }),
|
|
1320
1276
|
/* @__PURE__ */ jsx(Typography, { el: "p", variant: "body", children: i18n.get("inThePreviousStepOwnedByAnUltimateParentCompany") }),
|
|
@@ -1330,76 +1286,69 @@ function AdditionalFieldsForBusinessFinancingUltimateParentCompany(props) {
|
|
|
1330
1286
|
/* @__PURE__ */ jsx(
|
|
1331
1287
|
BusinessFinancingBasicCompanyInformation,
|
|
1332
1288
|
{
|
|
1333
|
-
...
|
|
1334
|
-
handleChangeFor: businessFinancingHandleChangeFor,
|
|
1289
|
+
...basicCompanyInformationProps,
|
|
1335
1290
|
sectionHeading: "businessInformation",
|
|
1336
|
-
|
|
1337
|
-
data,
|
|
1338
|
-
valid,
|
|
1339
|
-
formUtils,
|
|
1340
|
-
fieldProblems
|
|
1291
|
+
handleFieldChange: handleChange,
|
|
1292
|
+
data: formUtils.getFieldData((data == null ? void 0 : data.ultimateParentCompany) ?? {}, basicInformationFields)
|
|
1341
1293
|
}
|
|
1342
1294
|
),
|
|
1343
1295
|
/* @__PURE__ */ jsx(
|
|
1344
1296
|
BusinessFinancingRegisteredAddress,
|
|
1345
1297
|
{
|
|
1346
|
-
...
|
|
1298
|
+
...registeredAddressProps,
|
|
1347
1299
|
formId: ultimateParentCompanyFormId$1,
|
|
1348
|
-
handleChangeFor: businessFinancingHandleChangeFor,
|
|
1349
1300
|
sectionHeading: "registeredAddress",
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
formUtils,
|
|
1354
|
-
fieldProblems,
|
|
1355
|
-
targetPage: BusinessFinancingPagesEnums.ULTIMATE_PARENT_COMPANY_PAGE
|
|
1301
|
+
defaultData: data == null ? void 0 : data.ultimateParentCompany,
|
|
1302
|
+
handleFieldChange: handleChange,
|
|
1303
|
+
data: formUtils.getFieldData((data == null ? void 0 : data.ultimateParentCompany) ?? {}, registeredAddressFields)
|
|
1356
1304
|
}
|
|
1357
1305
|
),
|
|
1358
1306
|
/* @__PURE__ */ jsx(
|
|
1359
1307
|
BusinessFinancingBusinessInformation,
|
|
1360
1308
|
{
|
|
1361
|
-
...
|
|
1362
|
-
handleChangeFor: businessFinancingHandleChangeFor,
|
|
1309
|
+
...businessInformationProps,
|
|
1363
1310
|
sectionHeading: "additionalCompanyInformation",
|
|
1364
|
-
errors,
|
|
1365
|
-
data,
|
|
1366
|
-
valid,
|
|
1367
1311
|
country,
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1312
|
+
targetPage: BusinessFinancingPagesEnums.ULTIMATE_PARENT_COMPANY_PAGE,
|
|
1313
|
+
handleFieldChange: handleChange,
|
|
1314
|
+
data: formUtils.getFieldData((data == null ? void 0 : data.ultimateParentCompany) ?? {}, businessInformationFields)
|
|
1371
1315
|
}
|
|
1372
1316
|
),
|
|
1373
|
-
isEeaCountry((_a = data == null ? void 0 : data.
|
|
1317
|
+
isEeaCountry((_b = (_a = data == null ? void 0 : data.ultimateParentCompany) == null ? void 0 : _a.registrationAddress) == null ? void 0 : _b.country) && /* @__PURE__ */ jsx(
|
|
1374
1318
|
BusinessFinancingFinancialInformation,
|
|
1375
1319
|
{
|
|
1376
|
-
...
|
|
1377
|
-
handleChangeFor: businessFinancingHandleChangeFor,
|
|
1378
|
-
errors,
|
|
1379
|
-
data,
|
|
1380
|
-
valid,
|
|
1320
|
+
...financialInformationProps,
|
|
1381
1321
|
country,
|
|
1382
|
-
formUtils,
|
|
1383
|
-
fieldProblems,
|
|
1384
1322
|
targetPage: BusinessFinancingPagesEnums.ULTIMATE_PARENT_COMPANY_PAGE,
|
|
1385
|
-
|
|
1323
|
+
handleFieldChange: handleChange,
|
|
1324
|
+
data: formUtils.getFieldData(
|
|
1325
|
+
(data == null ? void 0 : data.ultimateParentCompany) ?? {},
|
|
1326
|
+
financialInformationFields
|
|
1327
|
+
)
|
|
1386
1328
|
}
|
|
1387
1329
|
),
|
|
1388
1330
|
/* @__PURE__ */ jsx(
|
|
1389
1331
|
BusinessFinancingLegalInformation,
|
|
1390
1332
|
{
|
|
1391
|
-
...
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
formUtils,
|
|
1397
|
-
fieldProblems,
|
|
1398
|
-
targetPage: BusinessFinancingPagesEnums.ULTIMATE_PARENT_COMPANY_PAGE
|
|
1333
|
+
...legalInformationProps,
|
|
1334
|
+
country,
|
|
1335
|
+
sectionHeading: "legalInformation",
|
|
1336
|
+
targetPage: BusinessFinancingPagesEnums.ULTIMATE_PARENT_COMPANY_PAGE,
|
|
1337
|
+
handleFieldChange: handleChange,
|
|
1338
|
+
data: formUtils.getFieldData((data == null ? void 0 : data.ultimateParentCompany) ?? {}, legalInformationFields)
|
|
1399
1339
|
}
|
|
1400
1340
|
)
|
|
1401
1341
|
] });
|
|
1402
1342
|
}
|
|
1343
|
+
const getOrgAnalyticsData = (prefix, details) => {
|
|
1344
|
+
const org = details == null ? void 0 : details.organization;
|
|
1345
|
+
if (!org) return {};
|
|
1346
|
+
return {
|
|
1347
|
+
[`${prefix}--economicSector`]: (org == null ? void 0 : org.economicSector) ?? "",
|
|
1348
|
+
[`${prefix}--legalForm`]: (org == null ? void 0 : org.legalForm) ?? "",
|
|
1349
|
+
[`${prefix}--statusOfLegalProceeding`]: (org == null ? void 0 : org.statusOfLegalProceeding) ?? ""
|
|
1350
|
+
};
|
|
1351
|
+
};
|
|
1403
1352
|
const businessFinancingFormsRequiredFields = {
|
|
1404
1353
|
company: businessFinancingForms.company.fields,
|
|
1405
1354
|
parentCompany: businessFinancingForms.parentCompany.fields,
|
|
@@ -1408,8 +1357,6 @@ const businessFinancingFormsRequiredFields = {
|
|
|
1408
1357
|
const parentCompanyFormId = businessFinancingForms.parentCompany.formId;
|
|
1409
1358
|
const companyFormId = businessFinancingForms.company.formId;
|
|
1410
1359
|
const ultimateParentCompanyFormId = businessFinancingForms.ultimateParentCompany.formId;
|
|
1411
|
-
const parseBusinessFinancingScenarios = (scenarios) => composePerScenarioFormConfigurations(scenarios, fieldsPerScenario);
|
|
1412
|
-
const parseConfiguration = ({ scenarios }) => parseBusinessFinancingScenarios(scenarios);
|
|
1413
1360
|
function BusinessFinancingDropin(props) {
|
|
1414
1361
|
var _a, _b;
|
|
1415
1362
|
const {
|
|
@@ -1422,7 +1369,6 @@ function BusinessFinancingDropin(props) {
|
|
|
1422
1369
|
} = props;
|
|
1423
1370
|
const userEvents = useAnalyticsContext();
|
|
1424
1371
|
const [defaultData, setDefaultData] = useState();
|
|
1425
|
-
const [data, setData] = useState({});
|
|
1426
1372
|
useRef(null);
|
|
1427
1373
|
const invalidateRootLegalEntity = useInvalidateRootLegalEntity();
|
|
1428
1374
|
const { mutateAsync: createLegalEntity } = useCreateLegalEntity();
|
|
@@ -1431,34 +1377,37 @@ function BusinessFinancingDropin(props) {
|
|
|
1431
1377
|
const { data: ultimateParentCompany, isLoading: ultimateParentCompanyIsLoading } = useAssociatedLegalEntity(rootLegalEntity, "ultimateParentCompany");
|
|
1432
1378
|
const derivedData = useMemo(() => {
|
|
1433
1379
|
if (immediateParentCompanyIsLoading || ultimateParentCompanyIsLoading) return void 0;
|
|
1434
|
-
const
|
|
1435
|
-
|
|
1380
|
+
const dataFromResponse = {};
|
|
1381
|
+
dataFromResponse.company = mapLegalEntityToBusinessFinancing(
|
|
1436
1382
|
rootLegalEntity
|
|
1437
1383
|
);
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1384
|
+
dataFromResponse.company = appendBusinessFinancingData(
|
|
1385
|
+
rootLegalEntity.organization,
|
|
1386
|
+
dataFromResponse.company
|
|
1387
|
+
);
|
|
1388
|
+
dataFromResponse.company.isCompanyOwnedByAnotherCompany = "No";
|
|
1389
|
+
dataFromResponse.company.isParentOwnedByAnotherCompany = "No";
|
|
1441
1390
|
if (immediateParentCompany) {
|
|
1442
|
-
|
|
1391
|
+
dataFromResponse.parentCompany = mapLegalEntityToBusinessFinancing(
|
|
1443
1392
|
immediateParentCompany
|
|
1444
1393
|
);
|
|
1445
|
-
|
|
1394
|
+
dataFromResponse.parentCompany = appendBusinessFinancingData(
|
|
1446
1395
|
immediateParentCompany.organization,
|
|
1447
|
-
|
|
1396
|
+
dataFromResponse.parentCompany
|
|
1448
1397
|
);
|
|
1449
|
-
|
|
1398
|
+
dataFromResponse.company.isCompanyOwnedByAnotherCompany = "Yes";
|
|
1450
1399
|
}
|
|
1451
1400
|
if (ultimateParentCompany) {
|
|
1452
|
-
|
|
1401
|
+
dataFromResponse.ultimateParentCompany = mapLegalEntityToBusinessFinancing(
|
|
1453
1402
|
ultimateParentCompany
|
|
1454
1403
|
);
|
|
1455
|
-
|
|
1404
|
+
dataFromResponse.ultimateParentCompany = appendBusinessFinancingData(
|
|
1456
1405
|
ultimateParentCompany.organization,
|
|
1457
|
-
|
|
1406
|
+
dataFromResponse.ultimateParentCompany
|
|
1458
1407
|
);
|
|
1459
|
-
|
|
1408
|
+
dataFromResponse.company.isParentOwnedByAnotherCompany = "Yes";
|
|
1460
1409
|
}
|
|
1461
|
-
return
|
|
1410
|
+
return dataFromResponse;
|
|
1462
1411
|
}, [
|
|
1463
1412
|
immediateParentCompanyIsLoading,
|
|
1464
1413
|
ultimateParentCompanyIsLoading,
|
|
@@ -1473,10 +1422,9 @@ function BusinessFinancingDropin(props) {
|
|
|
1473
1422
|
}, [userEvents]);
|
|
1474
1423
|
useEffect(() => {
|
|
1475
1424
|
if (derivedData) {
|
|
1476
|
-
|
|
1477
|
-
if (!defaultData) setDefaultData({ ...derivedData });
|
|
1425
|
+
setDefaultData({ ...derivedData });
|
|
1478
1426
|
}
|
|
1479
|
-
}, [derivedData
|
|
1427
|
+
}, [derivedData]);
|
|
1480
1428
|
const { i18n } = useI18nContext();
|
|
1481
1429
|
const datasetUtils = datasetUtilities(i18n.locale);
|
|
1482
1430
|
const [problems, setProblems] = useState();
|
|
@@ -1484,85 +1432,26 @@ function BusinessFinancingDropin(props) {
|
|
|
1484
1432
|
const [showEndState, setShowEndState] = useState(false);
|
|
1485
1433
|
const [businessFinancingRequiredForms, setBusinessFinancingRequiredForms] = useState(businessFinancingForms);
|
|
1486
1434
|
const { showToast } = useToastContext();
|
|
1487
|
-
const { fieldConfigurations } = useScenarioConfiguration({
|
|
1488
|
-
parseConfiguration,
|
|
1489
|
-
legalEntityType: LegalEntityType.ORGANIZATION,
|
|
1490
|
-
setLoadingStatus,
|
|
1491
|
-
country
|
|
1492
|
-
});
|
|
1493
|
-
const derivedProps = useMemo(
|
|
1494
|
-
() => getPropsFromConfigurations(
|
|
1495
|
-
fieldConfigurations,
|
|
1496
|
-
businessFinancingForms,
|
|
1497
|
-
(problems == null ? void 0 : problems.remediationActions) ? Object.values(problems == null ? void 0 : problems.remediationActions) : [],
|
|
1498
|
-
(problems == null ? void 0 : problems.missingData) ?? [],
|
|
1499
|
-
// TODO this is not a valid key mapping so we can't put it here
|
|
1500
|
-
// rootLegalEntity
|
|
1501
|
-
// ? getFieldsWithExistingData(rootLegalEntity, businessFinancingApiKeyMapping)
|
|
1502
|
-
// : [],
|
|
1503
|
-
[],
|
|
1504
|
-
{},
|
|
1505
|
-
{},
|
|
1506
|
-
{},
|
|
1507
|
-
rootLegalEntity == null ? void 0 : rootLegalEntity.type,
|
|
1508
|
-
rootLegalEntity == null ? void 0 : rootLegalEntity.trustedFields
|
|
1509
|
-
),
|
|
1510
|
-
[fieldConfigurations, problems == null ? void 0 : problems.missingData, problems == null ? void 0 : problems.remediationActions, rootLegalEntity]
|
|
1511
|
-
);
|
|
1512
|
-
const {
|
|
1513
|
-
state: { currentState }
|
|
1514
|
-
} = useStateContext();
|
|
1515
|
-
const formValidity = currentState.validityByForm;
|
|
1516
|
-
useEffect(() => {
|
|
1517
|
-
const newState = {
|
|
1518
|
-
...data,
|
|
1519
|
-
...currentState.data
|
|
1520
|
-
};
|
|
1521
|
-
setData(newState);
|
|
1522
|
-
}, [currentState]);
|
|
1523
|
-
useEffect(() => {
|
|
1524
|
-
var _a2, _b2;
|
|
1525
|
-
const showParentCompany = ((_a2 = data == null ? void 0 : data.company) == null ? void 0 : _a2.isCompanyOwnedByAnotherCompany) === "Yes";
|
|
1526
|
-
const showUltimateParentCompany = ((_b2 = data == null ? void 0 : data.company) == null ? void 0 : _b2.isParentOwnedByAnotherCompany) === "Yes";
|
|
1527
|
-
let updateForms = {
|
|
1528
|
-
company: { ...businessFinancingForms.company }
|
|
1529
|
-
};
|
|
1530
|
-
if (showParentCompany) {
|
|
1531
|
-
updateForms = { ...updateForms, parentCompany: businessFinancingForms.parentCompany };
|
|
1532
|
-
}
|
|
1533
|
-
if (showParentCompany && showUltimateParentCompany) {
|
|
1534
|
-
updateForms = {
|
|
1535
|
-
...updateForms,
|
|
1536
|
-
ultimateParentCompany: businessFinancingForms.ultimateParentCompany
|
|
1537
|
-
};
|
|
1538
|
-
}
|
|
1539
|
-
setBusinessFinancingRequiredForms(updateForms);
|
|
1540
|
-
}, [(_a = data == null ? void 0 : data.company) == null ? void 0 : _a.isCompanyOwnedByAnotherCompany, (_b = data == null ? void 0 : data.company) == null ? void 0 : _b.isParentOwnedByAnotherCompany]);
|
|
1541
|
-
const forms = useMemo(() => {
|
|
1542
|
-
const requiredForms = getRequiredForms(
|
|
1543
|
-
businessFinancingRequiredForms,
|
|
1544
|
-
businessFinancingFormsRequiredFields,
|
|
1545
|
-
derivedProps == null ? void 0 : derivedProps.optionalFields
|
|
1546
|
-
);
|
|
1547
|
-
return addValidityToForms(requiredForms, formValidity, problems);
|
|
1548
|
-
}, [derivedProps == null ? void 0 : derivedProps.optionalFields, formValidity, businessFinancingRequiredForms, problems]);
|
|
1549
1435
|
const { isSettingEnabled } = useSettingsContext();
|
|
1550
1436
|
const showBusinessFinancingFirst = isSettingEnabled(SettingNames.ShowBusinessFinancingFirst);
|
|
1551
1437
|
const onSubmit = async () => {
|
|
1552
1438
|
setLoadingStatus("loading");
|
|
1439
|
+
if (!umfData) {
|
|
1440
|
+
return;
|
|
1441
|
+
}
|
|
1553
1442
|
const companyBusinessFinancingDetails = prepareBusinessFinancingSubmitData(
|
|
1554
1443
|
BusinessFinancingIndex.COMPANY,
|
|
1555
|
-
|
|
1444
|
+
umfData,
|
|
1556
1445
|
rootLegalEntity
|
|
1557
1446
|
);
|
|
1558
1447
|
const parentCompanyBusinessFinancingDetails = prepareBusinessFinancingSubmitData(
|
|
1559
1448
|
BusinessFinancingIndex.PARENT_COMPANY,
|
|
1560
|
-
|
|
1449
|
+
umfData,
|
|
1561
1450
|
rootLegalEntity
|
|
1562
1451
|
);
|
|
1563
1452
|
const ultimateParentCompanyBusinessFinancingDetails = prepareBusinessFinancingSubmitData(
|
|
1564
1453
|
BusinessFinancingIndex.ULTIMATE_PARENT_COMPANY,
|
|
1565
|
-
|
|
1454
|
+
umfData,
|
|
1566
1455
|
rootLegalEntity
|
|
1567
1456
|
);
|
|
1568
1457
|
if (!companyBusinessFinancingDetails || !rootLegalEntity) {
|
|
@@ -1633,6 +1522,14 @@ function BusinessFinancingDropin(props) {
|
|
|
1633
1522
|
companyBusinessFinancingDetails.entityAssociations = [
|
|
1634
1523
|
...businessFinancingEntityAssociations
|
|
1635
1524
|
];
|
|
1525
|
+
const eventsAdditionalData = {
|
|
1526
|
+
...getOrgAnalyticsData("Business", companyBusinessFinancingDetails),
|
|
1527
|
+
...getOrgAnalyticsData("ParentCompany", parentCompanyBusinessFinancingDetails),
|
|
1528
|
+
...getOrgAnalyticsData(
|
|
1529
|
+
"UltimateParentCompany",
|
|
1530
|
+
ultimateParentCompanyBusinessFinancingDetails
|
|
1531
|
+
)
|
|
1532
|
+
};
|
|
1636
1533
|
try {
|
|
1637
1534
|
await handleBusinessFinancingFormSubmission(
|
|
1638
1535
|
BusinessFinancingIndex.COMPANY,
|
|
@@ -1643,13 +1540,14 @@ function BusinessFinancingDropin(props) {
|
|
|
1643
1540
|
);
|
|
1644
1541
|
userEvents.addTaskEvent("Success", {
|
|
1645
1542
|
actionType: "submit",
|
|
1646
|
-
returnValue: entitiesToTrack
|
|
1543
|
+
returnValue: entitiesToTrack,
|
|
1544
|
+
additionalData: eventsAdditionalData
|
|
1647
1545
|
});
|
|
1648
1546
|
await invalidateRootLegalEntity();
|
|
1649
1547
|
if (showBusinessFinancingFirst || isStandaloneComponent) {
|
|
1650
1548
|
setShowEndState(true);
|
|
1651
1549
|
} else {
|
|
1652
|
-
externalOnSubmit == null ? void 0 : externalOnSubmit({ ...
|
|
1550
|
+
externalOnSubmit == null ? void 0 : externalOnSubmit({ ...umfData });
|
|
1653
1551
|
}
|
|
1654
1552
|
} catch (e) {
|
|
1655
1553
|
showToast({ label: i18n.get("failedToUpdateDetails"), variant: "error" });
|
|
@@ -1694,29 +1592,73 @@ function BusinessFinancingDropin(props) {
|
|
|
1694
1592
|
associatedLegalEntity: rootLegalEntity
|
|
1695
1593
|
});
|
|
1696
1594
|
const omittedSummaryKeys = ["naceCodeLabel", "legalFormLabel", "currency"];
|
|
1595
|
+
const [requiredFields, setRequiredFields] = useState(void 0);
|
|
1596
|
+
const form = useMultiForm({
|
|
1597
|
+
requiredFields,
|
|
1598
|
+
defaultData: derivedData,
|
|
1599
|
+
rules: businessFinancingMultiformRules
|
|
1600
|
+
});
|
|
1601
|
+
const { data: umfData = derivedData } = form;
|
|
1602
|
+
useEffect(() => {
|
|
1603
|
+
var _a2, _b2;
|
|
1604
|
+
const showParentCompany = ((_a2 = umfData == null ? void 0 : umfData.company) == null ? void 0 : _a2.isCompanyOwnedByAnotherCompany) === "Yes";
|
|
1605
|
+
const showUltimateParentCompany = ((_b2 = umfData == null ? void 0 : umfData.company) == null ? void 0 : _b2.isParentOwnedByAnotherCompany) === "Yes";
|
|
1606
|
+
let updateForms = {
|
|
1607
|
+
company: { ...businessFinancingForms.company }
|
|
1608
|
+
};
|
|
1609
|
+
if (showParentCompany) {
|
|
1610
|
+
updateForms = { ...updateForms, parentCompany: businessFinancingForms.parentCompany };
|
|
1611
|
+
}
|
|
1612
|
+
if (showParentCompany && showUltimateParentCompany) {
|
|
1613
|
+
updateForms = {
|
|
1614
|
+
...updateForms,
|
|
1615
|
+
ultimateParentCompany: businessFinancingForms.ultimateParentCompany
|
|
1616
|
+
};
|
|
1617
|
+
}
|
|
1618
|
+
setBusinessFinancingRequiredForms(updateForms);
|
|
1619
|
+
}, [
|
|
1620
|
+
(_a = umfData == null ? void 0 : umfData.company) == null ? void 0 : _a.isCompanyOwnedByAnotherCompany,
|
|
1621
|
+
(_b = umfData == null ? void 0 : umfData.company) == null ? void 0 : _b.isParentOwnedByAnotherCompany
|
|
1622
|
+
]);
|
|
1623
|
+
useEffect(() => {
|
|
1624
|
+
const reqs = getBusinessFinancingRequiredFields(umfData);
|
|
1625
|
+
setRequiredFields(reqs);
|
|
1626
|
+
}, [umfData]);
|
|
1627
|
+
const forms = useMemo(() => {
|
|
1628
|
+
const requiredForms = getRequiredForms(
|
|
1629
|
+
businessFinancingRequiredForms,
|
|
1630
|
+
businessFinancingFormsRequiredFields,
|
|
1631
|
+
{}
|
|
1632
|
+
);
|
|
1633
|
+
return addValidityToForms(requiredForms, form.isValid, problems);
|
|
1634
|
+
}, [
|
|
1635
|
+
businessFinancingRequiredForms,
|
|
1636
|
+
form.isValid,
|
|
1637
|
+
businessFinancingFormsRequiredFields,
|
|
1638
|
+
problems
|
|
1639
|
+
]);
|
|
1697
1640
|
const {
|
|
1698
1641
|
handleNextClick,
|
|
1699
1642
|
handleBackClick,
|
|
1700
1643
|
activeForm,
|
|
1701
|
-
setShouldValidate,
|
|
1702
1644
|
gotoFormByFormIndex,
|
|
1703
|
-
|
|
1704
|
-
|
|
1645
|
+
steps,
|
|
1646
|
+
shouldValidate
|
|
1705
1647
|
} = useFormComposer({
|
|
1706
1648
|
problems,
|
|
1707
1649
|
navigationTrackingParams: associatedLeTrackingParams,
|
|
1708
1650
|
forms,
|
|
1709
1651
|
onSubmit
|
|
1710
1652
|
});
|
|
1711
|
-
const
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1653
|
+
const handleTrackNavigation = useCallback(
|
|
1654
|
+
(props2) => {
|
|
1655
|
+
trackNavigation({
|
|
1656
|
+
...props2,
|
|
1657
|
+
additionalTrackingParams: associatedLeTrackingParams
|
|
1658
|
+
});
|
|
1659
|
+
},
|
|
1660
|
+
[associatedLeTrackingParams]
|
|
1661
|
+
);
|
|
1720
1662
|
const homeClick = () => {
|
|
1721
1663
|
trackNavigation({
|
|
1722
1664
|
userEvents,
|
|
@@ -1726,75 +1668,80 @@ function BusinessFinancingDropin(props) {
|
|
|
1726
1668
|
});
|
|
1727
1669
|
handleHomeClick == null ? void 0 : handleHomeClick();
|
|
1728
1670
|
};
|
|
1729
|
-
const
|
|
1730
|
-
|
|
1731
|
-
/* @__PURE__ */
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1671
|
+
const renderActiveForm = (selectedForm) => {
|
|
1672
|
+
var _a2, _b2, _c, _d, _e, _f;
|
|
1673
|
+
return /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-form-wrapper", children: [
|
|
1674
|
+
selectedForm.formId === companyFormId && /* @__PURE__ */ jsx(
|
|
1675
|
+
AdditionalFieldsForBusinessFinancingCompany,
|
|
1676
|
+
{
|
|
1677
|
+
data: defaultData == null ? void 0 : defaultData.company,
|
|
1678
|
+
legalEntity: rootLegalEntity,
|
|
1679
|
+
heading: i18n.get("additionalInformationForBusinessFinancing"),
|
|
1680
|
+
id: companyFormId,
|
|
1681
|
+
country,
|
|
1682
|
+
shouldValidate,
|
|
1683
|
+
fieldValidationErrors: (_a2 = problems == null ? void 0 : problems.validationErrors) == null ? void 0 : _a2[selectedForm == null ? void 0 : selectedForm.formId],
|
|
1684
|
+
formVerificationErrors: (_b2 = problems == null ? void 0 : problems.verificationErrors) == null ? void 0 : _b2[selectedForm == null ? void 0 : selectedForm.formId],
|
|
1685
|
+
errors: (_c = form.errors) == null ? void 0 : _c.company,
|
|
1686
|
+
valid: (_d = form.valid) == null ? void 0 : _d.company
|
|
1687
|
+
}
|
|
1688
|
+
),
|
|
1689
|
+
selectedForm.formId === parentCompanyFormId && /* @__PURE__ */ jsx(
|
|
1690
|
+
AdditionalFieldsForBusinessFinancingParentCompany,
|
|
1691
|
+
{
|
|
1692
|
+
data: defaultData == null ? void 0 : defaultData.parentCompany,
|
|
1693
|
+
heading: i18n.get("parentCompanyInformation"),
|
|
1694
|
+
id: companyFormId,
|
|
1695
|
+
country,
|
|
1696
|
+
shouldValidate,
|
|
1697
|
+
errors: (_e = form.errors) == null ? void 0 : _e.parentCompany
|
|
1698
|
+
}
|
|
1699
|
+
),
|
|
1700
|
+
selectedForm.formId === ultimateParentCompanyFormId && /* @__PURE__ */ jsx(
|
|
1701
|
+
AdditionalFieldsForBusinessFinancingUltimateParentCompany,
|
|
1702
|
+
{
|
|
1703
|
+
data: defaultData == null ? void 0 : defaultData.ultimateParentCompany,
|
|
1704
|
+
heading: i18n.get("ultimateParentCompanyInformation"),
|
|
1705
|
+
id: companyFormId,
|
|
1706
|
+
country,
|
|
1707
|
+
shouldValidate,
|
|
1708
|
+
errors: (_f = form.errors) == null ? void 0 : _f.ultimateParentCompany
|
|
1709
|
+
}
|
|
1710
|
+
)
|
|
1711
|
+
] });
|
|
1712
|
+
};
|
|
1763
1713
|
if (!(defaultData == null ? void 0 : defaultData.company)) {
|
|
1764
1714
|
return /* @__PURE__ */ jsx(Loader, {});
|
|
1765
1715
|
}
|
|
1766
1716
|
return showEndState ? /* @__PURE__ */ jsxs(FormEndState, { variant: "success", children: [
|
|
1767
1717
|
/* @__PURE__ */ jsx("template", { slot: "title", children: i18n.get("applicationSubmittedSuccessfully") }),
|
|
1768
1718
|
/* @__PURE__ */ jsx("template", { slot: "icon", children: /* @__PURE__ */ jsx(Icon, { name: "checkmark" }) }),
|
|
1769
|
-
/* @__PURE__ */ jsx("template", { slot: "actions", children: externalOnSubmit && !showBusinessFinancingFirst && /* @__PURE__ */ jsx(Button, { onClick: () => externalOnSubmit == null ? void 0 : externalOnSubmit({ ...
|
|
1719
|
+
/* @__PURE__ */ jsx("template", { slot: "actions", children: externalOnSubmit && !showBusinessFinancingFirst && /* @__PURE__ */ jsx(Button, { onClick: () => externalOnSubmit == null ? void 0 : externalOnSubmit({ ...umfData }), children: externalOnSubmitLabel || i18n.get("finish") }) }),
|
|
1770
1720
|
/* @__PURE__ */ jsx("div", { children: i18n.get("yourLoanApplicationHasBeenReceived") })
|
|
1771
|
-
] }) : /* @__PURE__ */ jsx(
|
|
1772
|
-
|
|
1721
|
+
] }) : /* @__PURE__ */ jsx(FormContextProvider, { form, children: /* @__PURE__ */ jsx(
|
|
1722
|
+
FormFlow,
|
|
1773
1723
|
{
|
|
1774
|
-
taskName: "businessFinancing",
|
|
1775
|
-
handleNextClick,
|
|
1776
|
-
handleBackClick,
|
|
1777
|
-
gotoFormByFormIndex,
|
|
1778
|
-
loadingStatus,
|
|
1779
|
-
forms,
|
|
1780
|
-
activeForm,
|
|
1781
|
-
navigationTrackingParams: associatedLeTrackingParams,
|
|
1782
|
-
onSubmit,
|
|
1783
|
-
validateForm: () => setShouldValidate(true),
|
|
1784
|
-
canSubmit: canSubmit(data) && hasDataChanged(defaultData, data),
|
|
1785
|
-
problems,
|
|
1786
|
-
handleHomeClick: homeClick,
|
|
1787
1724
|
summary: {
|
|
1788
|
-
data: formatDataForSummary(
|
|
1789
|
-
labels: customLabels,
|
|
1725
|
+
data: formatDataForSummary(i18n, datasetUtils, umfData),
|
|
1790
1726
|
omitted: {
|
|
1791
1727
|
keys: omittedSummaryKeys
|
|
1792
|
-
}
|
|
1728
|
+
},
|
|
1729
|
+
problems,
|
|
1730
|
+
trackNavigation: handleTrackNavigation,
|
|
1731
|
+
labels: customLabels
|
|
1793
1732
|
},
|
|
1794
|
-
steps,
|
|
1733
|
+
currentStep: steps.current,
|
|
1734
|
+
disableNextButton: !activeForm.isValid,
|
|
1735
|
+
forms,
|
|
1736
|
+
gotoFormByFormIndex,
|
|
1737
|
+
handleBackClick,
|
|
1738
|
+
handleCancelClick: homeClick,
|
|
1739
|
+
handleNextClick,
|
|
1740
|
+
loadingStatus,
|
|
1741
|
+
totalSteps: steps.total,
|
|
1795
1742
|
children: /* @__PURE__ */ jsx("div", { children: renderActiveForm(activeForm || businessFinancingForms.company) })
|
|
1796
1743
|
}
|
|
1797
|
-
);
|
|
1744
|
+
) });
|
|
1798
1745
|
}
|
|
1799
1746
|
export {
|
|
1800
1747
|
BusinessFinancingDropin as B
|