@adyen/kyc-components 4.23.0 → 4.24.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/4-people-DKuivE0m.js +35 -0
- package/dist/AcceptTermsOfServiceWorkflow-C3JrMbt5.js +28 -0
- package/dist/Accordion-Dgdxfe-d.js +112 -0
- package/dist/AccountSetupRejected-D63dyojj.js +19 -0
- package/dist/AdaptiveWorkflow-XhWdnJv-.js +33 -0
- package/dist/AdaptiveWorkflowComponent-pMWy1Vig.js +166 -0
- package/dist/AddressFields-BC3QHs2u.js +468 -0
- package/dist/Alert-Cc7p0N5h.js +172 -0
- package/dist/AnalyticsContext-CpimDlw4.js +21 -0
- package/dist/Avatar-oTPu6Ejy.js +54 -0
- package/dist/BusinessFinancingDropin-CxHK6KY3.js +1870 -0
- package/dist/BusinessFinancingPage-teAAjQl8.js +89 -0
- package/dist/BusinessRegistrationNumberField-DKka8aVU.js +103 -0
- package/dist/BusinessRegistrationNumberFieldGroup-Df6_sDA0.js +173 -0
- package/dist/BusinessTypeSelectionPage-BETJH6LZ.js +457 -0
- package/dist/Button-DPJ1k02w.js +108 -0
- package/dist/Checkbox-qfdF12cF.js +60 -0
- package/dist/ComponentGroup-SozxzKWw.js +32 -0
- package/dist/Confirm-DoN9R9Z3.js +77 -0
- package/dist/ConstitutionalDocument-Bxsr1hQb.js +1229 -0
- package/dist/ContactDetails-CiWftLi4.js +516 -0
- package/dist/ContextGuidance-BQPwRscq.js +29 -0
- package/dist/ContractViewer-CG9UNGz1.js +1030 -0
- package/dist/CountryField-DT6-Jr_b.js +38 -0
- package/dist/Currency-oeXHRWzy.js +211 -0
- package/dist/CustomerSupport-D0bE0zga.js +141 -0
- package/dist/DataConflictsModal-CCaMgguu.js +238 -0
- package/dist/DebugModal-Cvp7_Z-i.js +456 -0
- package/dist/DecisionMakerDetails-Bbb_8up2.js +569 -0
- package/dist/DecisionMakerDetailsPage-BDTMzs1X.js +121 -0
- package/dist/DecisionMakers-maoFXpGe.js +594 -0
- package/dist/Dropzone-ttbRg2LI.js +250 -0
- package/dist/EmbeddedStatus-CYd2p4sP.js +129 -0
- package/dist/EndStateLayout-zZPm8S5M.js +83 -0
- package/dist/EntityAssociation-C2_Xuvf5.js +163 -0
- package/dist/ErrorPanel-D4JNFkvi.js +205 -0
- package/dist/Field-DwDJQVSS.js +154 -0
- package/dist/FormFlow.module-DqMxjYHl.js +20 -0
- package/dist/GlobalEntryModal-CLoPJXFE.js +1203 -0
- package/dist/GlobalEntryPage-DNPSSZ3M.js +78 -0
- package/dist/Header-DVLlJ6we.js +93 -0
- package/dist/Icon-4XR6gZzk.js +175 -0
- package/dist/IdentityNumber-3V6ZqvHB.js +540 -0
- package/dist/IdentityNumberFieldGroup-CAjlgTWn.js +57 -0
- package/dist/IdentityScreeningWorkflow-CBStT1hs.js +307 -0
- package/dist/Image-Bn_Yyuof.js +33 -0
- package/dist/IndividualDropin-0t7Oj71F.js +4175 -0
- package/dist/IndustryCodeFieldGroup-C3Zro2ds.js +189 -0
- package/dist/InputDate-Bq3Sb-ZW.js +211 -0
- package/dist/InputText-CFDEmEtp.js +119 -0
- package/dist/Introduction-z2SqIq1W.js +326 -0
- package/dist/InvitedDecisionMakerComponent-CZOVc-t9.js +481 -0
- package/dist/JpAddressFields-F1YCOcbO.js +288 -0
- package/dist/LandingLayout-BsIoIFzs.js +76 -0
- package/dist/LegalCompanyNameField-Cosyjk52.js +108 -0
- package/dist/LegalName-CtqIpsfy.js +33 -0
- package/dist/LegalRepresentativeDetailsPage-DwIARCpj.js +73 -0
- package/dist/Link-CvYhseSD.js +32 -0
- package/dist/ListItem-CYTpdOMa.js +70 -0
- package/dist/Loader-BVtlpTeo.js +92 -0
- package/dist/LoaderWrapper-Dc88hY-P.js +34 -0
- package/dist/MaybeModal-C4ySaA8A.js +24 -0
- package/dist/Modal-CHES6970.js +109 -0
- package/dist/Name-CdCsijr5.js +61 -0
- package/dist/NewSummary-D55f70wB.js +73 -0
- package/dist/NodeRenderer-B3G7pvjG.js +185 -0
- package/dist/PatriotActDisclosure-DqUZeLms.js +266 -0
- package/dist/PayoutDetailsDropin-LKMpfono.js +4104 -0
- package/dist/PayoutDetailsPage-KNHCeXgk.js +69 -0
- package/dist/ProgressBar-DWFxLMUA.js +38 -0
- package/dist/RadioGroup-Bf3DlQnZ.js +47 -0
- package/dist/RadioWithLabel-DQIOEYpF.js +45 -0
- package/dist/Review-CS_-zAlg.js +99 -0
- package/dist/RootBusinessDetailsPage-1z2_FAb6.js +67 -0
- package/dist/RootBusinessLinesPage-BgbkJaW8.js +1464 -0
- package/dist/RootIndividualDetailsPage-DA4hh_gc.js +82 -0
- package/dist/Select-phAxjMBQ.js +782 -0
- package/dist/SignPCIComponent-tBnZMn1u.js +373 -0
- package/dist/SingpassSelection-B6_DsZtn.js +156 -0
- package/dist/SoleProprietorshipPage-2s1kA9ZV.js +69 -0
- package/dist/SourceOfFundsPage-CTjUdOWK.js +2800 -0
- package/dist/SourceOfFundsWorkflow-BZabOpi_.js +28 -0
- package/dist/StateContext-B2_Pqd_y.js +9 -0
- package/dist/StateField-BpMwetvd.js +55 -0
- package/dist/Step-C6XxGAda.js +191 -0
- package/dist/StructuredList-nPasiuLi.js +56 -0
- package/dist/Summary-DM31WxLr.js +235 -0
- package/dist/Task-DwGA1eXE.js +129 -0
- package/dist/TaskGroup-T594JSYM.js +46 -0
- package/dist/TaskListItem-Dx3hKOqG.js +123 -0
- package/dist/TaskStepperContextProvider-DdcsqXT7.js +26 -0
- package/dist/TaskVerificationStatus-DEXk_ndE.js +125 -0
- package/dist/TaxInformationField-CV7SpMH1.js +242 -0
- package/dist/TaxInformationFieldGroup-DI2LzuNr.js +290 -0
- package/dist/TaxReportingDropin-xYwJ-ju7.js +480 -0
- package/dist/TaxReportingWorkflow-BHyHgiI-.js +28 -0
- package/dist/TermsOfServiceManagement-CNQ4J5Gn.js +644 -0
- package/dist/TextArea-qGEo3PFG.js +81 -0
- package/dist/TileGroup-D1-M64Ul.js +172 -0
- package/dist/ToastContext-B_wd2IY2.js +13 -0
- package/dist/ToastContextProvider-DjYKMflX.js +103 -0
- package/dist/TrustDetailsPage-Byj68n3F.js +1172 -0
- package/dist/TrustMemberCompanyPage-Bcz4Ql7s.js +108 -0
- package/dist/TrustMemberIndividualPage-D6CgWF88.js +108 -0
- package/dist/TrustMemberRoleAndTypePage-IUp5FVRW.js +937 -0
- package/dist/TrustMembersOverview-7EoKoSMg.js +453 -0
- package/dist/UboTaskItem-BmcGj5_U.js +115 -0
- package/dist/UnincorporatedPartnershipIndividualPage-BKpJDhhU.js +78 -0
- package/dist/UnincorporatedPartnershipMemberCompanyPage-D8VliL0i.js +78 -0
- package/dist/UnincorporatedPartnershipMemberRoleAndTypePage-D00bHhyf.js +256 -0
- package/dist/UnincorporatedPartnershipMembersOverview-Dw5IMSkd.js +160 -0
- package/dist/VerificationErrorAlert-CixajVtq.js +38 -0
- package/dist/Workflow-CWzMRGHX.js +228 -0
- package/dist/_rolldown_dynamic_import_helper-sGNwd-kR.js +14 -0
- package/dist/accountHolderUtils-CAu4V0ed.js +43 -0
- package/dist/adyen-business-financing.js +38 -37
- package/dist/adyen-individual-configuration.js +65 -65
- package/dist/adyen-individual-status.js +35 -34
- package/dist/adyen-invited-decision-maker.js +3 -3
- package/dist/adyen-onboarding.js +109 -101
- package/dist/adyen-terms-of-service-management.js +3 -3
- package/dist/adyen-terms-of-service-status.js +9 -8
- package/dist/adyen-transfer-instrument-configuration.js +62 -61
- package/dist/adyen-transfer-instrument-management.js +76 -70
- package/dist/adyen-verification-status.js +10 -8
- package/dist/arrow-right-D2hul7WG.js +20 -0
- package/dist/bafinUtils-DDrD6bfK.js +96 -0
- package/dist/bag-CRRS1aow.js +20 -0
- package/dist/bank-BoirCLLW.js +20 -0
- package/dist/bg-BG-B0Ia8sQm.js +7 -0
- package/dist/bg-BG-B2xaZ3wB.js +7 -0
- package/dist/bg-BG-DAR7_x2a.js +7 -0
- package/dist/bg-BG-DqfAUTUt.js +7 -0
- package/dist/bg-BG-ivZjQNJZ.js +7 -0
- package/dist/bin-BOmfqfrr.js +30 -0
- package/dist/birthDateUtils-D6uk7zwm.js +84 -0
- package/dist/businessRegistrationNumberPatterns-A08SLm03.js +982 -0
- package/dist/capital-DTjbiurV.js +23 -0
- package/dist/cash-stack-7KpYpBek.js +33 -0
- package/dist/certificate-BPuoJ6Ip.js +23 -0
- package/dist/checkmark-BiSLf8M1.js +20 -0
- package/dist/checkmark-circle-Ams7bSve.js +28 -0
- package/dist/checkmark-circle-fill-_p4ss4ac.js +30 -0
- package/dist/checkmark-small-3bw4ftPV.js +20 -0
- package/dist/chevron-down-GgZawvoy.js +20 -0
- package/dist/chevron-left-TeZTTvo5.js +20 -0
- package/dist/chevron-right-Cg8XlTxx.js +20 -0
- package/dist/chevron-up-COQUTli0.js +20 -0
- package/dist/circle-CypWzg83.js +30 -0
- package/dist/circle-small-filled-DfdK2A35.js +20 -0
- package/dist/clock-DmfGJ2r9.js +28 -0
- package/dist/coins-CBvbB8_X.js +30 -0
- package/dist/constants-C8yo0_RA.js +233 -0
- package/dist/contract-D1_RJ_xh.js +20 -0
- package/dist/countries-BGMTpyJv.js +41 -0
- package/dist/country-BEZkohEO.js +25 -0
- package/dist/cross-BORHADVQ.js +20 -0
- package/dist/cross-circle-fill-CUXdo1x-.js +30 -0
- package/dist/cross-circle-fill-small-DdoPZZeo.js +20 -0
- package/dist/cs-CZ-BwO4yrI4.js +7 -0
- package/dist/cs-CZ-CHMQYoMF.js +7 -0
- package/dist/cs-CZ-DsKlW7_D.js +7 -0
- package/dist/cs-CZ-NVntX32n.js +7 -0
- package/dist/cs-CZ-ywYpJk1F.js +7 -0
- package/dist/da-DK-BvT8Ob4A.js +7 -0
- package/dist/da-DK-BzBfkSME.js +7 -0
- package/dist/da-DK-CE7jnGea.js +7 -0
- package/dist/da-DK-DH5YNYFM.js +7 -0
- package/dist/da-DK-LPtdP8h0.js +7 -0
- package/dist/datasetUtil-BdHPWsxZ.js +45 -0
- package/dist/de-DE-C9cUCFOi.js +7 -0
- package/dist/de-DE-Cn866nnd.js +7 -0
- package/dist/de-DE-DA4LpyZI.js +7 -0
- package/dist/de-DE-DKkoZQ0X.js +7 -0
- package/dist/de-DE-DY_EJohI.js +7 -0
- package/dist/de-DE-vdy64knk.js +7 -0
- package/dist/debouncedInputEvent-Fwwp_K_-.js +54 -0
- package/dist/debugStore-Dwn1FXrh.js +9 -0
- package/dist/decision-makers-group-iEF9oKPp.js +2673 -0
- package/dist/decisionMakerRoles-C6LMC4mh.js +185 -0
- package/dist/document-1-qvV57JdS.js +20 -0
- package/dist/document-person-DiJ7M8-D.js +28 -0
- package/dist/download-Ca4w0Yfr.js +23 -0
- package/dist/dropinUtils-DTBezwYT.js +491 -0
- package/dist/edit-1-D8VhDchs.js +20 -0
- package/dist/el-GR-ChapyKa7.js +7 -0
- package/dist/el-GR-Cvms0L4K.js +7 -0
- package/dist/el-GR-D9PjIB9j.js +7 -0
- package/dist/el-GR-Ov9hqMNe.js +7 -0
- package/dist/el-GR-aelq5Q0a.js +7 -0
- package/dist/el-GR-zFv0QxMR.js +7 -0
- package/dist/en-US-B7HQdrn_.js +7 -0
- package/dist/en-US-CI7y0UEH.js +7 -0
- package/dist/en-US-C_VjFvk_.js +7 -0
- package/dist/en-US-Cz4JoU20.js +41 -0
- package/dist/en-US-DPr5RN3e.js +7 -0
- package/dist/en-US-U0d3NI20.js +7 -0
- package/dist/en-US-tFsDZf7y.js +7 -0
- package/dist/entityAssociationUtil-CY0grcyH.js +58 -0
- package/dist/error-BvgoQFEI.js +36 -0
- package/dist/es-ES-BQrdtEfn.js +7 -0
- package/dist/es-ES-BdByhG4y.js +7 -0
- package/dist/es-ES-BzlHKYJK.js +7 -0
- package/dist/es-ES-DCUvAmKI.js +7 -0
- package/dist/es-ES-DdrA8McY.js +7 -0
- package/dist/es-ES-DhkTbihW.js +7 -0
- package/dist/es-LA-3WgncmHx.js +7 -0
- package/dist/es-LA-BxtxM3Ty.js +7 -0
- package/dist/es-LA-ChRHGYJP.js +7 -0
- package/dist/es-LA-JRuDva0n.js +7 -0
- package/dist/es-LA-i7tKJmA8.js +7 -0
- package/dist/et-EE-BXY66vAz.js +7 -0
- package/dist/et-EE-D8TSvkoE.js +7 -0
- package/dist/et-EE-DOgb4q9o.js +7 -0
- package/dist/et-EE-HHgM0CfO.js +7 -0
- package/dist/et-EE-V-YOCgoh.js +7 -0
- package/dist/external-link-Dy4le-8Q.js +20 -0
- package/dist/fi-FI-B-eTv4bG.js +7 -0
- package/dist/fi-FI-CClpbvJJ.js +7 -0
- package/dist/fi-FI-CVBmM-U1.js +7 -0
- package/dist/fi-FI-DCYPQ6vS.js +7 -0
- package/dist/fi-FI-DCbhu29J.js +7 -0
- package/dist/fieldConfigurations-CZCFghnK.js +11 -0
- package/dist/form-rules-B0RwhsVw.js +284 -0
- package/dist/formFieldsUtils-CnDkgahc.js +7 -0
- package/dist/formUtils-BHgG8yQZ.js +52 -0
- package/dist/formUtils-DVDcdZsP.js +84 -0
- package/dist/formatCurrency-BetgkQKi.js +23 -0
- package/dist/formatValidationError-q_w9DTrl.js +23 -0
- package/dist/fr-FR-B-jA_cbo.js +7 -0
- package/dist/fr-FR-BIyJL6Jj.js +7 -0
- package/dist/fr-FR-BzyefnBh.js +7 -0
- package/dist/fr-FR-C1xYwHeC.js +7 -0
- package/dist/fr-FR-D0hY9V44.js +7 -0
- package/dist/fr-FR-Doo1FVx-.js +7 -0
- package/dist/genUtils-nphCwt1A.js +60 -0
- package/dist/getDefaultRegistrationNumberType-CIu4WMln.js +1056 -0
- package/dist/getFormSlice-C1ma6Xd4.js +21 -0
- package/dist/getLegalEntityCountry-BK-HHa65.js +15 -0
- package/dist/getName-DgxRqagk.js +34 -0
- package/dist/getProblemsForEntity-Bn6dXidE.js +16 -0
- package/dist/getTrustedDecisionMakers-Ta-pURcL.js +25 -0
- package/dist/getTrustedFields-BJ88GlM-.js +28 -0
- package/dist/gift-Bs_mAgul.js +20 -0
- package/dist/globalStore-WASei98w.js +418 -0
- package/dist/graph-Co0JhGiY.js +32 -0
- package/dist/graph-up-DIvH9haf.js +38 -0
- package/dist/headquarter-BESfDGKh.js +42 -0
- package/dist/hotel-Vne7G5M6.js +33 -0
- package/dist/hr-HR-6Wj5Tf60.js +7 -0
- package/dist/hr-HR-B4FRVzrd.js +7 -0
- package/dist/hr-HR-B6z7-PYE.js +7 -0
- package/dist/hr-HR-BOYktLQ2.js +7 -0
- package/dist/hr-HR-Ct_41fWV.js +7 -0
- package/dist/http-fdIO--pH.js +204 -0
- package/dist/hu-HU-B7ofWKn_.js +7 -0
- package/dist/hu-HU-Bwm4UqZz.js +7 -0
- package/dist/hu-HU-CO_7jvk9.js +7 -0
- package/dist/hu-HU-CgJ_F3l2.js +7 -0
- package/dist/hu-HU-DXK7B0r_.js +7 -0
- package/dist/image-BQM21XCk.js +23 -0
- package/dist/info-DExoPRH5.js +32 -0
- package/dist/info-filled-11KMeUso.js +32 -0
- package/dist/invalidateRootLegalEntity-BHaVREw-.js +45 -0
- package/dist/isEmpty-Uewyl-r6.js +14 -0
- package/dist/isEmptyEntity-3OHnhXqG.js +43 -0
- package/dist/it-IT-BFIW0DCO.js +7 -0
- package/dist/it-IT-CNr6PIu3.js +7 -0
- package/dist/it-IT-CQVFYSVx.js +7 -0
- package/dist/it-IT-DfGdOsTs.js +7 -0
- package/dist/it-IT-DgRuEpeD.js +7 -0
- package/dist/it-IT-tZ7dP-Ia.js +7 -0
- package/dist/ja-JP--tMJF7eu.js +7 -0
- package/dist/ja-JP-BjMyxZiN.js +7 -0
- package/dist/ja-JP-Ct54-uwM.js +7 -0
- package/dist/ja-JP-CtX9NZKD.js +7 -0
- package/dist/ja-JP-DAClbueM.js +7 -0
- package/dist/ja-JP-DOuEAOlh.js +7 -0
- package/dist/keys-Ce8YnRP2.js +20 -0
- package/dist/legalArrangementUtils-C68JdH6I.js +114 -0
- package/dist/listToRecord-DumSkYDz.js +10 -0
- package/dist/location-zRH5zJ8c.js +23 -0
- package/dist/lt-LT-BUuouq_-.js +7 -0
- package/dist/lt-LT-Cs3cvyKf.js +7 -0
- package/dist/lt-LT-DQp7UGdC.js +7 -0
- package/dist/lt-LT-DoYCfhZU.js +7 -0
- package/dist/lt-LT-DqtpAjOg.js +7 -0
- package/dist/lv-LV-BCXqSzkk.js +7 -0
- package/dist/lv-LV-BW0BscAd.js +7 -0
- package/dist/lv-LV-C3p57pZV.js +7 -0
- package/dist/lv-LV-ZmyUvPst.js +7 -0
- package/dist/lv-LV-cKvnQI3j.js +7 -0
- package/dist/mail-i1-zg-cv.js +20 -0
- package/dist/mapAddressLocalizationToJpAddressSchema-DpOIaxj6.js +26 -0
- package/dist/mapExistingFile-BkwRTTRm.js +55 -0
- package/dist/mapJpAddressSchemaToAddressLocalizations-D3VO2nhc.js +74 -0
- package/dist/mapLegalEntityToIndividualSchema-CBKR-InO.js +251 -0
- package/dist/mapScriptLocalization-BCfkZo1y.js +46 -0
- package/dist/mapTransferInstrumentToPayoutAccount-ROfaTly6.js +44 -0
- package/dist/maskHelpers-C0wnCoJl.js +719 -0
- package/dist/minus-circle-filled-CxUdRO8J.js +30 -0
- package/dist/nl-NL-B77Xr99l.js +7 -0
- package/dist/nl-NL-BUwMAW5C.js +7 -0
- package/dist/nl-NL-B_MaTF5h.js +7 -0
- package/dist/nl-NL-CePL3t7P.js +7 -0
- package/dist/nl-NL-DR5SCDAF.js +7 -0
- package/dist/nl-NL-DqGE4Nz5.js +7 -0
- package/dist/no-NO-BePxpMbr.js +7 -0
- package/dist/no-NO-DGCfRiU8.js +7 -0
- package/dist/no-NO-DdI2BI_e.js +7 -0
- package/dist/no-NO-P8SZ1t-h.js +7 -0
- package/dist/no-NO-oL1v_O9N.js +7 -0
- package/dist/options-horizontal-D86T_xAF.js +30 -0
- package/dist/partner-Dje0ykF6.js +30 -0
- package/dist/patternValidators-DsrZkuOO.js +73 -0
- package/dist/pay-by-link-plane-DAiddPu6.js +33 -0
- package/dist/payout-DKiGv3F9.js +38 -0
- package/dist/pdf-CC8vqpTo.js +22320 -0
- package/dist/pdf.worker.min-CdKJICZZ.js +75124 -0
- package/dist/person-DgALGIIz.js +23 -0
- package/dist/pl-PL-6Q3Ue3F5.js +7 -0
- package/dist/pl-PL-B5PBixAB.js +7 -0
- package/dist/pl-PL-BCkw9R28.js +7 -0
- package/dist/pl-PL-BY6KUTBO.js +7 -0
- package/dist/pl-PL-D-s-JI6X.js +7 -0
- package/dist/plus-DlQKP2C9.js +20 -0
- package/dist/plus-circle-filled-BntUOVIJ.js +30 -0
- package/dist/processCapabilities-CWE5UFt8.js +870 -0
- package/dist/processValidationErrors-CjsNfiRK.js +62 -0
- package/dist/pt-BR-B_XHiDCU.js +7 -0
- package/dist/pt-BR-BvNR77Ru.js +7 -0
- package/dist/pt-BR-CrLCMcSz2.js +7 -0
- package/dist/pt-BR-MrUfWW4a.js +7 -0
- package/dist/pt-BR-vwt2tE7H.js +7 -0
- package/dist/pt-PT-B17is9TY.js +7 -0
- package/dist/pt-PT-BZNPd_Tb.js +7 -0
- package/dist/pt-PT-DDYnXawl.js +7 -0
- package/dist/pt-PT-DhF8wwYH.js +7 -0
- package/dist/pt-PT-Du2K44jh.js +7 -0
- package/dist/pt-PT-qAzFgjvF.js +7 -0
- package/dist/recurring-DZgT_ekJ.js +23 -0
- package/dist/resolveEnvironment-B3aGkYuN.js +1000 -0
- package/dist/revenue-accelerate-aMLYFVW6.js +30 -0
- package/dist/ro-RO-B3Fcn95o.js +7 -0
- package/dist/ro-RO-BA5GhaCE.js +7 -0
- package/dist/ro-RO-BmHe4pZ-.js +7 -0
- package/dist/ro-RO-DChAv29z.js +7 -0
- package/dist/ro-RO-W1t7Mnbn.js +7 -0
- package/dist/roleMetadata-Dm1FVuPT.js +56 -0
- package/dist/save-uDNye08N.js +20 -0
- package/dist/search-0OS6oe8N.js +30 -0
- package/dist/show-BWoS9-Y1.js +23 -0
- package/dist/sk-SK-BeNF_m_j.js +7 -0
- package/dist/sk-SK-C9CiQLgt.js +7 -0
- package/dist/sk-SK-CISCMQ2G.js +7 -0
- package/dist/sk-SK-CcoUWnJ4.js +7 -0
- package/dist/sk-SK-D10Kpths.js +7 -0
- package/dist/sl-SI-Bxu4m_5e.js +7 -0
- package/dist/sl-SI-DCMml0lX.js +7 -0
- package/dist/sl-SI-DmYiMn91.js +7 -0
- package/dist/sl-SI-DxomO9JQ.js +7 -0
- package/dist/sl-SI-Qe4hzx5a.js +7 -0
- package/dist/solution-payments-BMal7uJZ.js +20 -0
- package/dist/store-N7ZA4FKy.js +20 -0
- package/dist/style.css +2341 -2252
- package/dist/styles-DYaAeu4q.js +2337 -2248
- package/dist/summaryItem-uDWmtYtt.js +16 -0
- package/dist/sv-SE-B-CXDaXM.js +7 -0
- package/dist/sv-SE-BzPNBHOj.js +7 -0
- package/dist/sv-SE-C9SgeFv6.js +7 -0
- package/dist/sv-SE-DESDUMyu.js +7 -0
- package/dist/sv-SE-Dq6oK7B5.js +7 -0
- package/dist/sv-SE-issaSBHd.js +7 -0
- package/dist/terminal-1-0RlQpbUC.js +30 -0
- package/dist/toFullWidth-Dgy4X4i8.js +52 -0
- package/dist/translation-DbATp_35.js +684 -0
- package/dist/trustUtil-5cyXiJnX.js +98 -0
- package/dist/types/adaptiveWorkflow/components/Fields/TaxInformation/TaxIdTypeSelectorField.d.ts +1 -2
- package/dist/types/adaptiveWorkflow/components/Fields/TaxInformation/TaxInformationFieldGroup.d.ts +1 -2
- package/dist/types/adaptiveWorkflow/utils/utils.d.ts +1 -1
- package/dist/types/api/configurations/useScenarios.d.ts +1 -1
- package/dist/types/api/createLegalEntity/useCreateLegalEntity.d.ts +12 -12
- package/dist/types/api/documentValidation/useDocumentValidate.d.ts +2 -2
- package/dist/types/api/documents/documents.types.d.ts +9 -0
- package/dist/types/api/documents/useCreateDocument.d.ts +10 -3
- package/dist/types/api/documents/useDeleteDocument.d.ts +1 -1
- package/dist/types/api/documents/useDocument.d.ts +1 -1
- package/dist/types/api/documents/useDocuments.d.ts +10 -2
- package/dist/types/api/documents/useUpdateDocument.d.ts +3 -3
- package/dist/types/api/invitedEntity/getInvitedEntityProblems.d.ts +1 -1
- package/dist/types/api/legalEntity/legalEntity.types.d.ts +32 -0
- package/dist/types/api/legalEntity/useLegalEntity.d.ts +92 -92
- package/dist/types/api/legalEntity/useUpdateLegalEntity.d.ts +14 -14
- package/dist/types/api/taskStatus/useTaskStatuses.d.ts +1 -1
- package/dist/types/api/transferInstruments/transferInstruments.types.d.ts +18 -0
- package/dist/types/api/transferInstruments/useCreateTransferInstrument.d.ts +2 -2
- package/dist/types/api/transferInstruments/useTransferInstrument.d.ts +1 -1
- package/dist/types/api/transferInstruments/useUpdateTransferInstrument.d.ts +2 -2
- package/dist/types/api/transferInstruments/useUpdateTrustedTransferInstrument.d.ts +1 -1
- package/dist/types/components/Apps/tasks/TaskList/TaskList.d.ts +1 -1
- package/dist/types/components/BankAccount/fields/BankAccountNumber/fieldConfig.d.ts +2 -0
- package/dist/types/components/BankAccount/forms/BankDocument/types.d.ts +1 -1
- package/dist/types/components/BankAccount/forms/PayoutAccount/types.d.ts +1 -1
- package/dist/types/components/BankAccount/forms/PayoutCountryDetails/types.d.ts +1 -1
- package/dist/types/components/BankAccount/forms/PayoutDetails/PayoutDetails.d.ts +1 -1
- package/dist/types/components/BankAccount/forms/PayoutDetails/types.d.ts +1 -1
- package/dist/types/components/BankAccount/forms/PayoutVerificationMethod/AccountHolderDescriptionFragment.d.ts +1 -1
- package/dist/types/components/BankAccount/forms/PayoutVerificationMethod/types.d.ts +1 -1
- package/dist/types/components/BankAccount/forms/PayoutVerificationMethod/utils.d.ts +1 -1
- package/dist/types/components/BankAccount/mapping/mapPayoutAccountSchemaToApiBankAccount.d.ts +2 -2
- package/dist/types/components/BankAccount/mapping/mapPayoutDetailsToTransferInstrument.d.ts +3 -3
- package/dist/types/components/BankAccount/mapping/mapPayoutDocumentsToApiDocuments.d.ts +2 -2
- package/dist/types/components/BankAccount/mapping/mapTransferInstrumentToPayoutAccount.d.ts +1 -1
- package/dist/types/components/BankAccount/mapping/payoutKeyMappings.d.ts +8 -4
- package/dist/types/components/BankAccount/tasks/PayoutAccount/PayoutAccountTaskListItem.d.ts +2 -2
- package/dist/types/components/BankAccount/tasks/PayoutDetailsDropin/utils.d.ts +1 -1
- package/dist/types/components/Business/hooks/useBusinessDetailsData.d.ts +1 -1
- package/dist/types/components/Business/hooks/useSubmitBusinessDetails.types.d.ts +1 -1
- package/dist/types/components/Business/mapping/businessDetails/businessDetailsKeyMappings.d.ts +4 -4
- package/dist/types/components/Business/mapping/businessDetails/mapBusinessDetailsSchemaToLegalEntity.d.ts +4 -4
- package/dist/types/components/Business/mapping/businessDetails/mapLegalEntityToBusinessDetailsSchema.d.ts +1 -1
- package/dist/types/components/Business/mapping/businessDetails/solePropBusinessDetailsKeyMappings.d.ts +4 -4
- package/dist/types/components/Business/tasks/BusinessDetailsDropin/types.d.ts +1 -1
- package/dist/types/components/Business/utils/buildRequiredForms.d.ts +1 -1
- package/dist/types/components/Business/utils/getAvailableCompanyStructures.d.ts +1 -2
- package/dist/types/components/Business/utils/utils.d.ts +2 -15
- package/dist/types/components/BusinessLines/tasks/types.d.ts +1 -1
- package/dist/types/components/Contract/tasks/PciDropin/types.d.ts +1 -1
- package/dist/types/components/Contract/tasks/ServiceAgreementDropin/types.d.ts +1 -1
- package/dist/types/components/EFP/mapping/businessFinancingKeyMappings.d.ts +33 -33
- package/dist/types/components/EFP/mapping/mapBusinessFinancingToLegalEntity.d.ts +2 -2
- package/dist/types/components/EFP/mapping/mapLegalEntityToBusinessFinancing.d.ts +2 -2
- package/dist/types/components/EFP/tasks/BusinessFinancingDropin/types.d.ts +3 -3
- package/dist/types/components/EFP/tasks/BusinessFinancingDropin/utils.d.ts +3 -4
- package/dist/types/components/EFP/tasks/SourceOfFundsDropin/SourceOfFundsGettingStarted/SourceOfFundsGettingStarted.d.ts +2 -3
- package/dist/types/components/EFP/tasks/SourceOfFundsDropin/SourceOfFundsUploader/SourceOfFundsUpload.d.ts +1 -1
- package/dist/types/components/EFP/tasks/SourceOfFundsDropin/types.d.ts +1 -3
- package/dist/types/components/EFP/tasks/SourceOfFundsDropin/utils.d.ts +13 -5
- package/dist/types/components/EFP/tasks/TaxReportingDropin/TaxReportingGettingStarted.d.ts +2 -2
- package/dist/types/components/EmbeddedDropins/CreateTransferInstrumentComponent/CreateTransferInstrumentComponent.d.ts +1 -1
- package/dist/types/components/EmbeddedDropins/ManageIndividualComponent/ManageIndividualComponent.d.ts +1 -1
- package/dist/types/components/EmbeddedDropins/ManageTransferInstrumentComponent/ManageTransferInstrumentComponent.d.ts +1 -1
- package/dist/types/components/EmbeddedDropins/ManageTransferInstrumentComponent/ManageTransferInstrumentOverview/ManageTransferInstrumentOverview.d.ts +1 -2
- package/dist/types/components/EmbeddedDropins/ManageTransferInstrumentComponent/ManageTransferInstrumentOverviewItem/ManageTransferInstrumentOverviewItem.d.ts +1 -2
- package/dist/types/components/EmbeddedDropins/ManageTransferInstrumentComponent/ManageTransferInstrumentOverviewItemModal/ManageTransferInstrumentOverviewItemModal.d.ts +1 -2
- package/dist/types/components/EmbeddedDropins/OnboardingDropinComponent/DropinComposer/types.d.ts +1 -1
- package/dist/types/components/EmbeddedDropins/ViewVerificationStatus/ViewVerificationStatusComponent.d.ts +1 -1
- package/dist/types/components/GlobalEntry/companyTypeMetadata.d.ts +10 -0
- package/dist/types/components/GlobalEntry/forms/CompanyStructure/CompanyStructure.d.ts +3 -0
- package/dist/types/components/GlobalEntry/forms/CompanyStructure/types.d.ts +10 -0
- package/dist/types/components/GlobalEntry/forms/RegistrationInformation/RegistrationInformation.d.ts +1 -1
- package/dist/types/components/GlobalEntry/mapping/globalEntryKeyMapping.d.ts +15 -0
- package/dist/types/components/GlobalEntry/mapping/mapGlobalEntrySchemaToLegalEntity.d.ts +6 -0
- package/dist/types/components/GlobalEntry/mapping/mapLegalEntityToGlobalEntrySchema.d.ts +9 -0
- package/dist/types/components/GlobalEntry/rules.d.ts +1 -0
- package/dist/types/components/GlobalEntry/tasks/GlobalEntry.d.ts +1 -1
- package/dist/types/components/GlobalEntry/tasks/GlobalEntryModal.d.ts +1 -1
- package/dist/types/components/GlobalEntry/tasks/types.d.ts +2 -0
- package/dist/types/components/GlobalEntry/utils/buildRequiredForms.d.ts +16 -0
- package/dist/types/components/GlobalEntry/utils/getAvailableCompanyStructures.d.ts +12 -0
- package/dist/types/components/GlobalEntry/utils/submitGlobalEntry.d.ts +20 -0
- package/dist/types/components/GlobalEntry/utils/utils.d.ts +18 -0
- package/dist/types/components/GlobalEntry/validate.d.ts +3 -1
- package/dist/types/components/Individual/forms/BasicDetails/BasicDetails.types.d.ts +3 -3
- package/dist/types/components/Individual/forms/IdDocumentUpload/types.d.ts +1 -1
- package/dist/types/components/Individual/forms/IdNowVerificationModal/isIdNowModalOpen.d.ts +8 -8
- package/dist/types/components/Individual/forms/Individual.types.d.ts +2 -3
- package/dist/types/components/Individual/helpers/bafinUtils.d.ts +3 -4
- package/dist/types/components/Individual/helpers/findRelevantTaxInformation.d.ts +28 -0
- package/dist/types/components/Individual/helpers/hasLiveSelfieError.d.ts +11 -0
- package/dist/types/components/Individual/helpers/isManualVerificationOrExistingDoc.d.ts +13 -0
- package/dist/types/components/Individual/mapping/individualKeyMappings.d.ts +4 -4
- package/dist/types/components/Individual/mapping/mapIndividualDocumentToApiDocument.d.ts +2 -2
- package/dist/types/components/Individual/mapping/mapIndividualSchemaToLegalEntity.d.ts +2 -2
- package/dist/types/components/Individual/mapping/mapLegalEntityToIndividualSchema.d.ts +1 -1
- package/dist/types/components/Individual/tasks/DecisionMakers/DecisionMakerDetails/DecisionMakerDetails.types.d.ts +1 -1
- package/dist/types/components/Individual/tasks/DecisionMakers/DecisionMakerDetails/utils.d.ts +34 -10
- package/dist/types/components/Individual/tasks/DecisionMakers/getTrustedDecisionMakers.d.ts +2 -3
- package/dist/types/components/Individual/tasks/DecisionMakers/hooks/useTaskStatusWithTimeout.d.ts +1 -0
- package/dist/types/components/Individual/tasks/DecisionMakers/types.d.ts +2 -3
- package/dist/types/components/Individual/tasks/DecisionMakers/utils.d.ts +1 -1
- package/dist/types/components/Shared/EntityAssociation/types.d.ts +2 -2
- package/dist/types/components/Shared/Introduction/Introduction.d.ts +1 -1
- package/dist/types/components/Shared/Introduction/IntroductionScreen.d.ts +1 -1
- package/dist/types/components/Shared/Introduction/constants.d.ts +1 -1
- package/dist/types/components/Shared/Introduction/copy.d.ts +1 -1
- package/dist/types/components/Shared/SingpassBanner/SingpassBanner.d.ts +1 -1
- package/dist/types/components/Shared/SingpassSelection/types.d.ts +1 -1
- package/dist/types/components/Shared/devex/DebugListener/debugInfo.d.ts +1 -2
- package/dist/types/components/Shared/fields/BusinessRegistrationNumberField/RegistrationNumberTypeSelector/getDefaultRegistrationNumberType.d.ts +1 -2
- package/dist/types/components/Shared/fields/TaxInformationField/TaxIdNumberTypeSelector/TaxIdNumberTypeSelector.d.ts +1 -2
- package/dist/types/components/Shared/fields/TaxInformationField/TaxIdNumberTypeSelector/findExistingTaxInformation.d.ts +10 -0
- package/dist/types/components/Shared/fields/TaxInformationField/fieldConfig.d.ts +3 -4
- package/dist/types/components/Shared/fields/TaxInformationField/taxIdNumberTypes.d.ts +107 -8
- package/dist/types/components/Shared/fields/TaxInformationField/types.d.ts +7 -6
- package/dist/types/components/Shared/fields/VatNumberField/VatNumberTypeSelector/VatNumberTypeSelector.d.ts +1 -2
- package/dist/types/components/Shared/forms/Address/utils.d.ts +1 -1
- package/dist/types/components/Shared/forms/BusinessTypeSelection/types.d.ts +1 -1
- package/dist/types/components/Shared/forms/BusinessTypeSelection/useUpdateLegalEntityAndSelectAccountHolder.d.ts +1 -2
- package/dist/types/components/Shared/forms/BusinessTypeSelection/utils.d.ts +2 -4
- package/dist/types/components/Shared/forms/ConstitutionalDocument/types.d.ts +1 -1
- package/dist/types/components/Shared/forms/DocumentUpload/types.d.ts +1 -1
- package/dist/types/components/Shared/tasks/CustomerSupport/mapping/customerSupportKeyMapping.d.ts +2 -2
- package/dist/types/components/Trust/hooks/useExemptSettlor.d.ts +1 -1
- package/dist/types/components/Trust/hooks/useTrustMemberNavigation.hook.d.ts +1 -1
- package/dist/types/components/Trust/mapping/mapLegalEntityToTrust.d.ts +1 -1
- package/dist/types/components/Trust/mapping/mapTrustDocumentToApiDocument.d.ts +2 -2
- package/dist/types/components/Trust/mapping/mapTrustToLegalEntity.d.ts +2 -2
- package/dist/types/components/Trust/mapping/trustKeyMappings.d.ts +4 -4
- package/dist/types/components/Trust/mapping/trustMembers/getTrustMembers.d.ts +1 -1
- package/dist/types/components/Trust/mapping/trustMembers/mapEntityAssociationsToTrustMembers.d.ts +3 -4
- package/dist/types/components/Trust/mapping/trustMembers/mapRootLegalEntityToTrustMember.d.ts +1 -1
- package/dist/types/components/Trust/tasks/RoleAndTypeDropin/types.d.ts +1 -1
- package/dist/types/components/Trust/tasks/TrustDropin/types.d.ts +1 -1
- package/dist/types/components/Trust/tasks/TrustMembers/types.d.ts +3 -4
- package/dist/types/components/Trust/utils/addOrUpdateAssociatedTrustMember.d.ts +1 -1
- package/dist/types/components/Trust/utils/addOrUpdateUndefinedBeneficiary.d.ts +1 -1
- package/dist/types/components/Trust/utils/createExemptSettlor.d.ts +1 -1
- package/dist/types/components/Trust/utils/deleteAssociatedTrustMember.d.ts +1 -1
- package/dist/types/components/Trust/utils/deleteUndefinedBeneficiary.d.ts +1 -1
- package/dist/types/components/Trust/utils/trustUtil.d.ts +5 -6
- package/dist/types/components/Trust/utils/updateExemptSettlorName.d.ts +1 -1
- package/dist/types/components/UnincorporatedPartnership/hooks/useUnincorporatedPartnershipNavigation.d.ts +1 -2
- package/dist/types/components/UnincorporatedPartnership/mapping/mapLegalEntityToUnincorporatedPartnership.d.ts +1 -1
- package/dist/types/components/UnincorporatedPartnership/mapping/mapUnincorporatedPartnershipToLegalEntity.d.ts +2 -2
- package/dist/types/components/UnincorporatedPartnership/mapping/unincorporatedPartnershipKeyMappings.d.ts +3 -3
- package/dist/types/components/UnincorporatedPartnership/tasks/UnincorporatedPartnershipMembers/types.d.ts +1 -2
- package/dist/types/components/UnincorporatedPartnership/tasks/UnincorporatedPartnershipRoleAndType/types.d.ts +1 -2
- package/dist/types/components/UnincorporatedPartnership/utils/unincorporatedPartnershipMembers.d.ts +3 -4
- package/dist/types/components/ui/molecules/DocumentGuidance/DocumentGuidance.types.d.ts +1 -1
- package/dist/types/context/ToggleContext/types.d.ts +0 -4
- package/dist/types/core/errorMapping.d.ts +3 -4
- package/dist/types/core/models/api/accountIdentification.d.ts +5 -1
- package/dist/types/core/models/api/legal-entity-association.d.ts +0 -19
- package/dist/types/core/process-field-configurations.d.ts +4 -6
- package/dist/types/core/user-events.d.ts +2 -4
- package/dist/types/hooks/introduction/useCanSeeIntroduction.d.ts +1 -1
- package/dist/types/hooks/introduction/useIntroductionScreens.d.ts +1 -1
- package/dist/types/hooks/introduction/useShouldShowIntroduction.d.ts +1 -1
- package/dist/types/hooks/singpass/useSingpassMyInfoLogin.d.ts +1 -1
- package/dist/types/hooks/useAssociatedLegalEntity.d.ts +1 -2
- package/dist/types/hooks/useAssociatedLegalRepresentative.d.ts +1 -1
- package/dist/types/hooks/useBusinessSetup.d.ts +1 -1
- package/dist/types/hooks/useForm/types.d.ts +1 -2
- package/dist/types/hooks/useLegalEntityType.d.ts +1 -2
- package/dist/types/hooks/useScenarioConfiguration.d.ts +1 -1
- package/dist/types/router/DefaultRouteRedirect.d.ts +1 -1
- package/dist/types/router/OnboardingRouter.d.ts +1 -2
- package/dist/types/router/getDefaultTask.d.ts +1 -1
- package/dist/types/stores/globalStore/calculateTaskStatus.d.ts +3 -5
- package/dist/types/stores/globalStore/determineTaskIdentifiers.d.ts +3 -5
- package/dist/types/stores/globalStore/get-task-status.d.ts +4 -4
- package/dist/types/stores/globalStore/globalStore.d.ts +3 -5
- package/dist/types/stores/globalStore/isEmptyEntity.d.ts +1 -1
- package/dist/types/types/businessEntityType.d.ts +1 -2
- package/dist/types/types/errors/capability-problems.d.ts +5 -1
- package/dist/types/types/errors/entity-problems.d.ts +8 -5
- package/dist/types/types/form-rules.d.ts +1 -1
- package/dist/types/utils/accountHolderUtils.d.ts +1 -1
- package/dist/types/utils/addLinkedFields.d.ts +2 -2
- package/dist/types/utils/analytics/debouncedInputEvent.d.ts +4 -4
- package/dist/types/utils/analytics/getAnalyticsAssociatedEntityDetails.d.ts +2 -3
- package/dist/types/utils/analytics/getPrefilledDetails.d.ts +2 -2
- package/dist/types/utils/api/documentUtils.d.ts +21 -10
- package/dist/types/utils/api/getProblemsForEntity.d.ts +1 -1
- package/dist/types/utils/api/processCapabilities.d.ts +11 -4
- package/dist/types/utils/bankUtils.d.ts +5 -0
- package/dist/types/utils/birthDateUtils.d.ts +6 -1
- package/dist/types/utils/businessUtils.d.ts +21 -6
- package/dist/types/utils/customerSupportUtils.d.ts +2 -3
- package/dist/types/utils/decisionMakerRoles.d.ts +4 -5
- package/dist/types/utils/entityAssociationUtil.d.ts +21 -12
- package/dist/types/utils/entityStatusUtil.d.ts +1 -1
- package/dist/types/utils/getFieldsWithExistingData.d.ts +2 -2
- package/dist/types/utils/getLegalEntityCountry.d.ts +1 -1
- package/dist/types/utils/getName.d.ts +3 -3
- package/dist/types/utils/getTrustedFields.d.ts +4 -5
- package/dist/types/utils/mapping/documentGuidanceMap.d.ts +2 -2
- package/dist/types/utils/mapping/getPage.d.ts +3 -4
- package/dist/types/utils/mapping/mappingRecord.d.ts +1 -1
- package/dist/types/utils/roleMetadata.d.ts +1 -1
- package/dist/types/utils/unincorporatedParnershipUtils.d.ts +4 -4
- package/dist/types-B9zXzag-.js +18 -0
- package/dist/types-BA3bcGAv.js +58 -0
- package/dist/types-CZAHRt31.js +147 -0
- package/dist/types-Cwq1JAWT.js +31 -0
- package/dist/upload-C5NC1E4N.js +23 -0
- package/dist/uppercase-DvjwUM0n.js +7 -0
- package/dist/useAccountHolder-DDto9d9n.js +102 -0
- package/dist/useAdaptiveWorkflow-DryNv0zI.js +28 -0
- package/dist/useAllowedCountries-C-nqVePW.js +80 -0
- package/dist/useAnalyticsContext-gSnRnYgV.js +12 -0
- package/dist/useAssociatedLegalEntity-DtZtKlls.js +35 -0
- package/dist/useBusinessDetailsData-DFU0dLxw.js +4732 -0
- package/dist/useBusinessLines-BZfFqvS_.js +27 -0
- package/dist/useCanSeeIntroduction-DQbanJNE.js +38 -0
- package/dist/useCreateLegalEntity-qP7MeAmi.js +24 -0
- package/dist/useDataMissingRemediations-ttUrk09_.js +39 -0
- package/dist/useDataset-CdLBLq98.js +98 -0
- package/dist/useDeleteTransferInstrument-Dtv14H9I.js +31 -0
- package/dist/useForm-CWrbJG44.js +504 -0
- package/dist/useHideTaskStepper-Dk7ZQ3U8.js +26 -0
- package/dist/useId-BkDhUta2.js +28 -0
- package/dist/useIndustryCodes-BMK6IMiW.js +32 -0
- package/dist/useLegalEntity-DHA8TJeV.js +48 -0
- package/dist/useMultiForm-BxASst0O.js +790 -0
- package/dist/useNavigate-CO1Mcekp.js +246 -0
- package/dist/useOnboardingStatus-Cz6-hSX4.js +23 -0
- package/dist/usePciQuestionnaireList-CWz7Ngs6.js +26 -0
- package/dist/useSalesChannels-bV9DgyLW.js +47 -0
- package/dist/useScenarios-Bn93htbx.js +55 -0
- package/dist/useSettingsContext-9O3Aqpfq.js +12 -0
- package/dist/useTaskLandedEvent-DwZHcMEQ.js +26 -0
- package/dist/useTaskStatus-DJxOWvuN.js +23 -0
- package/dist/useTermsOfServiceStatus-CyVxYqpg.js +39 -0
- package/dist/useToastContext-B6Mqc2HY.js +12 -0
- package/dist/useToggleContext-B_YexrbT.js +21 -0
- package/dist/useTrustMembers-DWo3WU8M.js +151 -0
- package/dist/useUnincorporatedPartnershipMembers-DwFPW09D.js +69 -0
- package/dist/useUpdateBusinessLines-JRPjqoe9.js +43 -0
- package/dist/useUpdateLegalEntity-CqmqXsbR.js +29 -0
- package/dist/utils-BWumuCvl.js +210 -0
- package/dist/utils-CJcGZvj1.js +178 -0
- package/dist/utils-CYUYe54m.js +24 -0
- package/dist/utils-Ck_mZapQ.js +1755 -0
- package/dist/utils-DdHbAadK.js +80 -0
- package/dist/utils-SKYT7xU4.js +52 -0
- package/dist/validate-BZ1-ZeKr.js +430 -0
- package/dist/validate-DTz70AWN.js +224 -0
- package/dist/validate-DUcT-JGF.js +178 -0
- package/dist/validate-Dr8UKZCX.js +126 -0
- package/dist/validateExtractionResult-CntKbt8c.js +343 -0
- package/dist/validationError-DV6t8Ubb.js +55 -0
- package/dist/validationResult-bjYBDjbU.js +29 -0
- package/dist/validatorUtils-D2O6AAZn.js +106 -0
- package/dist/warning-circle-fill-C2lMYPJW.js +30 -0
- package/dist/warning-diamond-filled-CQ2DdW5g.js +30 -0
- package/dist/webinar-BpZWqd-g.js +33 -0
- package/package.json +26 -26
- package/dist/4-people-Dxu4nHSX.js +0 -35
- package/dist/AcceptTermsOfServiceWorkflow-CvKbU2WY.js +0 -28
- package/dist/Accordion-Sjyj7C_t.js +0 -112
- package/dist/AccountSetupRejected-Cq_nlmLn.js +0 -18
- package/dist/AdaptiveWorkflow-CM7ZVGXv.js +0 -210
- package/dist/AdaptiveWorkflowComponent-tM1hJ1zF.js +0 -165
- package/dist/AddressFields-BsxEdBvQ.js +0 -464
- package/dist/Avatar-Zp1T9qAL.js +0 -54
- package/dist/BusinessFinancingDropin-vugW4Vvi.js +0 -1857
- package/dist/BusinessFinancingPage-0J_LImeN.js +0 -89
- package/dist/BusinessRegistrationNumberField-qdC_srMn.js +0 -101
- package/dist/BusinessRegistrationNumberFieldGroup-BvC9n4ou.js +0 -171
- package/dist/BusinessTypeSelectionPage-WCEqP4G2.js +0 -457
- package/dist/Button-DfRmINzF.js +0 -108
- package/dist/Checkbox-B730k3Yy.js +0 -108
- package/dist/ComponentGroup-CsnkYMbT.js +0 -32
- package/dist/ConstitutionalDocument-D92EPGmG.js +0 -1224
- package/dist/ContactDetails-DDSd6X0z.js +0 -511
- package/dist/ContextGuidance-B2ew1lzC.js +0 -29
- package/dist/ContractViewer-JtnAXSDa.js +0 -979
- package/dist/Currency-BKTf95Wp.js +0 -210
- package/dist/CustomerSupport-CCFayyJG.js +0 -140
- package/dist/DataConflictsModal-D-fP_eNs.js +0 -237
- package/dist/DebugModal-CG6CvUnj.js +0 -450
- package/dist/DecisionMakerDetails-DWC1nORL.js +0 -565
- package/dist/DecisionMakerDetailsPage-BVXA74FO.js +0 -122
- package/dist/DecisionMakers-Cvm_i6Uf.js +0 -589
- package/dist/Dropzone-CNHxDEc3.js +0 -250
- package/dist/EmbeddedStatus-tbJfdxm8.js +0 -129
- package/dist/EndStateLayout-BK1Hh02g.js +0 -83
- package/dist/EntityAssociation-i903L9Dh.js +0 -163
- package/dist/ErrorPanel-tnFOlOZU.js +0 -205
- package/dist/GlobalEntryModal-DQoIIvGS.js +0 -975
- package/dist/GlobalEntryPage-DLRGPpAu.js +0 -78
- package/dist/Icon-C3S5_kkS.js +0 -175
- package/dist/IdentityNumber-B8MXzXsO.js +0 -536
- package/dist/IdentityNumberFieldGroup-D7xb2TY7.js +0 -57
- package/dist/IdentityScreeningWorkflow-BdGXtdns.js +0 -307
- package/dist/Image-D82terx4.js +0 -33
- package/dist/IndividualDropin-C0vTSDYU.js +0 -4138
- package/dist/IndustryCodeFieldGroup-CGcE5yYR.js +0 -188
- package/dist/InputDate-Ci60MBrH.js +0 -211
- package/dist/InputText-CTpVF0Mu.js +0 -154
- package/dist/Introduction-Dx6DDaL7.js +0 -327
- package/dist/InvitedDecisionMakerComponent-Ckd26d6Y.js +0 -481
- package/dist/JpAddressFields-C9MbL5XV.js +0 -287
- package/dist/LegalCompanyNameField-D0jM5LDT.js +0 -108
- package/dist/LegalName-TjhII9_p.js +0 -33
- package/dist/LegalRepresentativeDetailsPage-CvGtANu3.js +0 -74
- package/dist/Link-c2jAgGgc.js +0 -32
- package/dist/ListItem-C35r8558.js +0 -93
- package/dist/Loader-BEpMlKm2.js +0 -92
- package/dist/Modal-BsivDPTd.js +0 -129
- package/dist/Name-DMf8Uyof.js +0 -61
- package/dist/NewSummary-DxWLTnJy.js +0 -73
- package/dist/PatriotActDisclosure-ChZ_ePr2.js +0 -265
- package/dist/PayoutDetailsDropin-BhtJSFAS.js +0 -4073
- package/dist/PayoutDetailsPage-MW5Pygp2.js +0 -70
- package/dist/RadioGroup-D8DRUJ2o.js +0 -1806
- package/dist/Review-DImhCvoG.js +0 -99
- package/dist/RootBusinessDetailsPage-Cmh9Z_4g.js +0 -68
- package/dist/RootBusinessLinesPage-C_p-CtCH.js +0 -1455
- package/dist/RootIndividualDetailsPage-04cJ6C15.js +0 -80
- package/dist/Select-ByVcS_J2.js +0 -1093
- package/dist/SignPCIComponent-CAwp2xCC.js +0 -370
- package/dist/SingpassSelection-Txx3gp_g.js +0 -157
- package/dist/SoleProprietorshipPage-CWegllTo.js +0 -70
- package/dist/SourceOfFundsPage-B22iW1ow.js +0 -2781
- package/dist/SourceOfFundsWorkflow-BKHZbLR_.js +0 -28
- package/dist/StateField-CsO_28Co.js +0 -296
- package/dist/Step-BUMarnLL.js +0 -191
- package/dist/Task-Bj_CjiHG.js +0 -129
- package/dist/TaskGroup-BMXhoq1Y.js +0 -46
- package/dist/TaskListItem-BIKdDEzU.js +0 -123
- package/dist/TaskStepperContextProvider-D0tKJplv.js +0 -26
- package/dist/TaskVerificationStatus-DPA4ZEPa.js +0 -125
- package/dist/TaxInformationFieldGroup-D_6IRGj9.js +0 -287
- package/dist/TaxReportingDropin-DA475crP.js +0 -475
- package/dist/TaxReportingWorkflow-kcto0Ysw.js +0 -28
- package/dist/TermsOfServiceManagement-HDnaIeWZ.js +0 -635
- package/dist/TextArea-qbFhi8Az.js +0 -81
- package/dist/TrustDetailsPage-BqVS0xOU.js +0 -1155
- package/dist/TrustMemberCompanyPage-DTe7xWpj.js +0 -109
- package/dist/TrustMemberIndividualPage-C1BDs9Rm.js +0 -110
- package/dist/TrustMemberRoleAndTypePage-GXWuitmt.js +0 -927
- package/dist/TrustMembersOverview-BjJ5fPcC.js +0 -449
- package/dist/UboTaskItem-Aq3iNKX0.js +0 -115
- package/dist/UnincorporatedPartnershipIndividualPage-DdPh2_sa.js +0 -79
- package/dist/UnincorporatedPartnershipMemberCompanyPage-h3OTr_91.js +0 -79
- package/dist/UnincorporatedPartnershipMemberRoleAndTypePage-CwemN4fL.js +0 -254
- package/dist/UnincorporatedPartnershipMembersOverview-CUczPfUl.js +0 -158
- package/dist/VerificationErrorAlert-BBfoLMwb.js +0 -64
- package/dist/Workflow-Do7P-qDn.js +0 -228
- package/dist/accountHolderUtils-DMi_DHCU.js +0 -44
- package/dist/arrow-right-Bk-ewsex.js +0 -20
- package/dist/bafinUtils-M2AASP_e.js +0 -1963
- package/dist/bag-9BNq_QQO.js +0 -20
- package/dist/bank-BRbxxVK5.js +0 -20
- package/dist/bg-BG-BtgA44Ui.js +0 -7
- package/dist/bg-BG-DX5QKxJz.js +0 -7
- package/dist/bg-BG-DYkxVgeJ.js +0 -7
- package/dist/bg-BG-K6LIkCdf.js +0 -7
- package/dist/bg-BG-uuNDTOoN.js +0 -7
- package/dist/bin-DE1613_5.js +0 -30
- package/dist/businessRegistrationNumberPatterns-C_MSKHlF.js +0 -981
- package/dist/capital-aNk7ragc.js +0 -23
- package/dist/cash-stack-DuKKc4Qj.js +0 -33
- package/dist/certificate-9gDKvXCm.js +0 -23
- package/dist/checkmark-BuqDN4WO.js +0 -20
- package/dist/checkmark-circle-OqcwA6N6.js +0 -28
- package/dist/checkmark-circle-fill-BfcUovCf.js +0 -30
- package/dist/checkmark-small-CBORXg_J.js +0 -20
- package/dist/chevron-down-CjRta08O.js +0 -20
- package/dist/chevron-left-BEm04mIh.js +0 -20
- package/dist/chevron-right-B2GkHG0J.js +0 -20
- package/dist/chevron-up-BKfe5Btb.js +0 -20
- package/dist/circle-C-uuRI8F.js +0 -30
- package/dist/circle-small-filled-Bkh5_ZEu.js +0 -20
- package/dist/clock-BWfWiMxz.js +0 -28
- package/dist/coins-Cw-jDTUz.js +0 -30
- package/dist/constants-BSBlqXY7.js +0 -231
- package/dist/contract-PFVBW8xa.js +0 -20
- package/dist/countries-BE4iGVAo.js +0 -41
- package/dist/country-zZC2TAQB.js +0 -25
- package/dist/cross-B37j1-r4.js +0 -20
- package/dist/cross-circle-fill-CcjwpLj2.js +0 -30
- package/dist/cross-circle-fill-small-CJ4fddNo.js +0 -20
- package/dist/cs-CZ-BJSrh3Vp.js +0 -7
- package/dist/cs-CZ-CMXGY6Ep.js +0 -7
- package/dist/cs-CZ-Ci8c58xJ.js +0 -7
- package/dist/cs-CZ-Cu1v5FA8.js +0 -7
- package/dist/cs-CZ-lJQmuyHq.js +0 -7
- package/dist/da-DK-B9O3xbY6.js +0 -7
- package/dist/da-DK-BNwXg4DX.js +0 -7
- package/dist/da-DK-C1kmOHvo.js +0 -7
- package/dist/da-DK-D53M_d04.js +0 -7
- package/dist/da-DK-DjAV5d9A.js +0 -7
- package/dist/de-DE-B3sSNcDv.js +0 -7
- package/dist/de-DE-C9N6F5oM.js +0 -7
- package/dist/de-DE-CjMOQMqQ.js +0 -7
- package/dist/de-DE-qJPTCQlG.js +0 -7
- package/dist/de-DE-qSBQE-6M.js +0 -7
- package/dist/de-DE-w4l6boYT.js +0 -7
- package/dist/decision-makers-group-DAoxQRJ3.js +0 -4169
- package/dist/decisionMakerRoles-APTR-Ah_.js +0 -185
- package/dist/document-1-B3vw8uuK.js +0 -20
- package/dist/document-person-CERdIfH0.js +0 -28
- package/dist/download-CthdK4dV.js +0 -23
- package/dist/edit-1-BW7NwWP7.js +0 -20
- package/dist/el-GR-BLNCX9mm.js +0 -7
- package/dist/el-GR-Bx996PXx.js +0 -7
- package/dist/el-GR-CgoxpC-Q.js +0 -7
- package/dist/el-GR-DaAMIpOR.js +0 -7
- package/dist/el-GR-DqTetsjB.js +0 -7
- package/dist/el-GR-pGsVWsOm.js +0 -7
- package/dist/en-US-B82BbZaB.js +0 -7
- package/dist/en-US-BUmtG-Wj.js +0 -27
- package/dist/en-US-C3i5Oge2.js +0 -7
- package/dist/en-US-C8karqc5.js +0 -7
- package/dist/en-US-CJPD8qHc.js +0 -7
- package/dist/en-US-D0fscfsz.js +0 -7
- package/dist/en-US-DapC--Cs.js +0 -7
- package/dist/entityAssociationUtil-CLBR9osP.js +0 -59
- package/dist/error-CpJV-CLa.js +0 -36
- package/dist/es-ES-C14ZT-97.js +0 -7
- package/dist/es-ES-DeT4zIDW.js +0 -7
- package/dist/es-ES-DyB2KXfT.js +0 -7
- package/dist/es-ES-U4-lDfZq.js +0 -7
- package/dist/es-ES-tVQDUTJN.js +0 -7
- package/dist/es-ES-wvcyuTNN.js +0 -7
- package/dist/es-LA-B5IRDCf_.js +0 -7
- package/dist/es-LA-B_hzWiiE.js +0 -7
- package/dist/es-LA-CG_cu1hM.js +0 -7
- package/dist/es-LA-ChLRkx-r.js +0 -7
- package/dist/es-LA-mFT_9PL_.js +0 -7
- package/dist/et-EE-4_ZUNt3W.js +0 -7
- package/dist/et-EE-BCWBT8XN.js +0 -7
- package/dist/et-EE-BQEyJFZb.js +0 -7
- package/dist/et-EE-DSK7kb3n.js +0 -7
- package/dist/et-EE-DWVzz1wR.js +0 -7
- package/dist/external-link-CFgynH5A.js +0 -20
- package/dist/fi-FI-B-7uBAf5.js +0 -7
- package/dist/fi-FI-BeJtSWIh.js +0 -7
- package/dist/fi-FI-Caa9ydMd.js +0 -7
- package/dist/fi-FI-D06EzKrW.js +0 -7
- package/dist/fi-FI-DgMsQBRO.js +0 -7
- package/dist/form-rules-zzbZ2bV6.js +0 -1089
- package/dist/formatCurrency-Cq3WFpdZ.js +0 -23
- package/dist/formatValidationError-BHvKLMYZ.js +0 -23
- package/dist/fr-FR-8a-RK9xd.js +0 -7
- package/dist/fr-FR-BCfqr4jm.js +0 -7
- package/dist/fr-FR-BTJoQq71.js +0 -7
- package/dist/fr-FR-CDv300-8.js +0 -7
- package/dist/fr-FR-D7DTFYe4.js +0 -7
- package/dist/fr-FR-Dl4NL-Nc.js +0 -7
- package/dist/genUtils-Ce61IJs8.js +0 -60
- package/dist/getDefaultRegistrationNumberType-CI1NVzJR.js +0 -1055
- package/dist/getFormSlice-DzRO0UUx.js +0 -52
- package/dist/getLegalEntityCountry-CNE5uei8.js +0 -17
- package/dist/getName-s7qmFean.js +0 -35
- package/dist/getProblemsForEntity-Bh9nSdOW.js +0 -16
- package/dist/getTrustedDecisionMakers-DX3nImM5.js +0 -25
- package/dist/gift-0jLCte2h.js +0 -20
- package/dist/graph-DrxuzQF7.js +0 -32
- package/dist/graph-up-4qLbS2Ds.js +0 -38
- package/dist/headquarter-3o2GHW5H.js +0 -42
- package/dist/hotel-pZlrEAK8.js +0 -33
- package/dist/hr-HR-B11sggmG.js +0 -7
- package/dist/hr-HR-BjxPRJ1o.js +0 -7
- package/dist/hr-HR-COdiWKoq.js +0 -7
- package/dist/hr-HR-CXH5M5JZ.js +0 -7
- package/dist/hr-HR-me1zsMas.js +0 -7
- package/dist/http-DsJtugN1.js +0 -204
- package/dist/hu-HU-BNlsrO-l.js +0 -7
- package/dist/hu-HU-BQ5310Yi.js +0 -7
- package/dist/hu-HU-D1ZZwcl0.js +0 -7
- package/dist/hu-HU-DkSsL94T.js +0 -7
- package/dist/hu-HU-Dp6xOBN_.js +0 -7
- package/dist/image-tfgNnE3G.js +0 -23
- package/dist/info-DJW5JooY.js +0 -32
- package/dist/info-filled-C5mP6T4Z.js +0 -32
- package/dist/it-IT-BORQC-7u.js +0 -7
- package/dist/it-IT-BlaVymCj.js +0 -7
- package/dist/it-IT-CawjvBDX.js +0 -7
- package/dist/it-IT-Cnk7j_gC.js +0 -7
- package/dist/it-IT-DIIRAF4_.js +0 -7
- package/dist/it-IT-x4LV31GV.js +0 -7
- package/dist/ja-JP-CyXnoIu3.js +0 -7
- package/dist/ja-JP-DBne3dbI.js +0 -7
- package/dist/ja-JP-DS8zN3mY.js +0 -7
- package/dist/ja-JP-Dpe9Odla.js +0 -7
- package/dist/ja-JP-DrHQO_Se.js +0 -7
- package/dist/ja-JP-h3E8hgLv.js +0 -7
- package/dist/legal-entity-type-0MfCGzUf.js +0 -13
- package/dist/legalArrangementUtils-xvCxpgzJ.js +0 -113
- package/dist/location-Dk0rAiaT.js +0 -23
- package/dist/lt-LT-8kOI6QVq.js +0 -7
- package/dist/lt-LT-B18sQY9g.js +0 -7
- package/dist/lt-LT-Byl8QeWO.js +0 -7
- package/dist/lt-LT-D3ZUJfjr.js +0 -7
- package/dist/lt-LT-Fc1lOUlz.js +0 -7
- package/dist/lv-LV-C70c94CI.js +0 -7
- package/dist/lv-LV-CXifQKfG.js +0 -7
- package/dist/lv-LV-DctYQmfH.js +0 -7
- package/dist/lv-LV-Mj_iV56f.js +0 -7
- package/dist/lv-LV-adiXoKhv.js +0 -7
- package/dist/mail-DG7MBDNE.js +0 -20
- package/dist/mapAddressLocalizationToJpAddressSchema-TUaHGQh6.js +0 -26
- package/dist/mapExistingFile-CwGW1ru4.js +0 -55
- package/dist/mapJpAddressSchemaToAddressLocalizations-CdP6PRAO.js +0 -73
- package/dist/mapLegalEntityToIndividualSchema-ByhXwZqs.js +0 -214
- package/dist/mapTransferInstrumentToPayoutAccount-6eLKhumO.js +0 -44
- package/dist/minus-circle-filled-DglqAgJW.js +0 -30
- package/dist/nl-NL-BIpptPn4.js +0 -7
- package/dist/nl-NL-BWGCqpWp.js +0 -7
- package/dist/nl-NL-Bv8Zk-6e.js +0 -7
- package/dist/nl-NL-DOB0b0m4.js +0 -7
- package/dist/nl-NL-ehxkZFQd.js +0 -7
- package/dist/nl-NL-jt4eYGEY.js +0 -7
- package/dist/no-NO-BG1sYkpp.js +0 -7
- package/dist/no-NO-CeZQnyyD.js +0 -7
- package/dist/no-NO-Chwg5Roi.js +0 -7
- package/dist/no-NO-Dx_Z3uoZ.js +0 -7
- package/dist/no-NO-P5tRWhV9.js +0 -7
- package/dist/options-horizontal-CTUn7IEx.js +0 -30
- package/dist/partner-1StoI4_W.js +0 -30
- package/dist/pay-by-link-plane-Sa_qkL8C.js +0 -33
- package/dist/payout-BAYSxSqU.js +0 -38
- package/dist/pdf-uNYg4Mqz.js +0 -22315
- package/dist/pdf.worker.min-gK7UJW5a.js +0 -74644
- package/dist/person-Da15_s3G.js +0 -23
- package/dist/pl-PL-BsXtscoI.js +0 -7
- package/dist/pl-PL-CWFdZf24.js +0 -7
- package/dist/pl-PL-DSbuyzBx.js +0 -7
- package/dist/pl-PL-J9S3_lCf.js +0 -7
- package/dist/pl-PL-_KG-ZD1N.js +0 -7
- package/dist/plus-BQccvKkd.js +0 -20
- package/dist/plus-circle-filled-CqC30FRL.js +0 -30
- package/dist/processCapabilities-DRD0Aq2i.js +0 -874
- package/dist/processValidationErrors-oxuCOsth.js +0 -62
- package/dist/pt-BR-B2q9Nl16.js +0 -7
- package/dist/pt-BR-BYbyk6xS.js +0 -7
- package/dist/pt-BR-Cph-P8oH.js +0 -7
- package/dist/pt-BR-D1yTuXWd2.js +0 -7
- package/dist/pt-BR-fKlNUybd.js +0 -7
- package/dist/pt-PT-C1gtp2_N.js +0 -7
- package/dist/pt-PT-CQQkh5PS.js +0 -7
- package/dist/pt-PT-D8ldyR-j.js +0 -7
- package/dist/pt-PT-DAvsI-Tr.js +0 -7
- package/dist/pt-PT-DhokEMPi.js +0 -7
- package/dist/pt-PT-IPhkbQvT.js +0 -7
- package/dist/recurring-DSR1fNMh.js +0 -23
- package/dist/resolveEnvironment-BYEL10Nc.js +0 -2524
- package/dist/revenue-accelerate-CPhAVpPK.js +0 -30
- package/dist/ro-RO-C6xoaASq.js +0 -7
- package/dist/ro-RO-CP_IrOlX.js +0 -7
- package/dist/ro-RO-CQJk7Cpo.js +0 -7
- package/dist/ro-RO-CnMe6Mfw.js +0 -7
- package/dist/ro-RO-_BLhsnIB.js +0 -7
- package/dist/save-DQ-mJX8e.js +0 -20
- package/dist/search-DWqWTW_K.js +0 -30
- package/dist/show-BbhlD3IY.js +0 -23
- package/dist/sk-SK-BOc9IqyW.js +0 -7
- package/dist/sk-SK-Bb1CdAzD.js +0 -7
- package/dist/sk-SK-Br1Y4_CN.js +0 -7
- package/dist/sk-SK-Bx2_85dW.js +0 -7
- package/dist/sk-SK-C889qQFo.js +0 -7
- package/dist/sl-SI-B-Xa0hlk.js +0 -7
- package/dist/sl-SI-BQc61Sz2.js +0 -7
- package/dist/sl-SI-DHPadSTy.js +0 -7
- package/dist/sl-SI-DO9c7geI.js +0 -7
- package/dist/sl-SI-bkhhInrg.js +0 -7
- package/dist/solution-payments-D4BORMsX.js +0 -20
- package/dist/store-DWaq3ZiC.js +0 -20
- package/dist/sv-SE-BXrlr0X5.js +0 -7
- package/dist/sv-SE-Dk81lopg.js +0 -7
- package/dist/sv-SE-DzsWB30f.js +0 -7
- package/dist/sv-SE-IBYnJfbW.js +0 -7
- package/dist/sv-SE-X89Q6ZAq.js +0 -7
- package/dist/sv-SE-l_UVgmVu.js +0 -7
- package/dist/terminal-1-crR-pS_R.js +0 -30
- package/dist/translation-BOm4lmPx.js +0 -657
- package/dist/types/components/GlobalEntry/globalEntryKeyMapping.d.ts +0 -15
- package/dist/types/components/GlobalEntry/utils.d.ts +0 -30
- package/dist/types/components/Shared/fields/TaxInformationField/TaxIdNumberTypeSelector/getDefaultTaxIdNumberType.d.ts +0 -30
- package/dist/types/components/Shared/fields/TaxInformationField/TaxIdNumberTypeSelector/inferTaxIdNumberType.d.ts +0 -13
- package/dist/types/core/models/api/attachment.d.ts +0 -7
- package/dist/types/core/models/api/document.d.ts +0 -25
- package/dist/types/core/models/api/entity-type.d.ts +0 -5
- package/dist/types/core/models/api/legal-arrangement.d.ts +0 -24
- package/dist/types/core/models/api/legal-entity-type.d.ts +0 -8
- package/dist/types/core/models/api/legal-entity.d.ts +0 -36
- package/dist/types/core/models/api/problem.d.ts +0 -12
- package/dist/types/core/models/api/remediating-action.d.ts +0 -5
- package/dist/types/core/models/api/transfer-instrument.d.ts +0 -33
- package/dist/types/core/models/api/trusted-fields-provider.d.ts +0 -5
- package/dist/types/core/models/api/verification-error.d.ts +0 -19
- package/dist/types-BeveNAZK.js +0 -19
- package/dist/types-wRlt8bxb.js +0 -58
- package/dist/upload-D85xAAAm.js +0 -23
- package/dist/useAdaptiveWorkflow-DsQESk9f.js +0 -28
- package/dist/useBusinessDetailsData-Bja80UYy.js +0 -4722
- package/dist/useBusinessLines-BhSN6qCH.js +0 -27
- package/dist/useCanSeeIntroduction-BcfQC4IP.js +0 -38
- package/dist/useDataMissingRemediations-msU1AJvo.js +0 -39
- package/dist/useForm-DbDFfb2S.js +0 -502
- package/dist/useHideTaskStepper-CbMcV9mk.js +0 -26
- package/dist/useId-oOIS1nsj.js +0 -73
- package/dist/useIndustryCodes-uAj90IyS.js +0 -32
- package/dist/useLegalEntity-QQXN6YOm.js +0 -48
- package/dist/useNavigate-CiKOI5QV.js +0 -246
- package/dist/useOnboardingStatus-CsGUjkm-.js +0 -23
- package/dist/usePciQuestionnaireList-CFNJD8pS.js +0 -26
- package/dist/useSalesChannels-BvGJ9PT6.js +0 -47
- package/dist/useScenarios-CGcmXgJv.js +0 -55
- package/dist/useTaskLandedEvent-pmN03gtI.js +0 -26
- package/dist/useTaskStatus-CgrhdaE_.js +0 -23
- package/dist/useTermsOfServiceStatus-DbJDklA2.js +0 -39
- package/dist/useTrustMembers-f13Kf1Zk.js +0 -152
- package/dist/useUnincorporatedPartnershipMembers-K5jkCKfJ.js +0 -70
- package/dist/useUpdateBusinessLines-DCKYTzxd.js +0 -43
- package/dist/utils-2tir5QtF.js +0 -52
- package/dist/utils-BUOt0VrX.js +0 -179
- package/dist/utils-DBIDcVUN.js +0 -214
- package/dist/validate-BpZBKknS.js +0 -224
- package/dist/validate-CPTQceEQ.js +0 -151
- package/dist/validate-YBDlgvjy.js +0 -429
- package/dist/validate-u6nDNwf1.js +0 -126
- package/dist/validateExtractionResult-dH4TewHf.js +0 -343
- package/dist/validationError-B-B3GC86.js +0 -55
- package/dist/warning-circle-fill-BDTmKU1s.js +0 -30
- package/dist/warning-diamond-filled-BjDL-xa8.js +0 -30
- package/dist/webinar-YMbPoCx3.js +0 -33
|
@@ -1,1806 +0,0 @@
|
|
|
1
|
-
try {
|
|
2
|
-
let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
3
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "bc1618e6-a815-49e3-bac3-3bd488e61f54", e._sentryDebugIdIdentifier = "sentry-dbid-bc1618e6-a815-49e3-bac3-3bd488e61f54");
|
|
4
|
-
} catch (e) {}
|
|
5
|
-
import { r as useTranslation } from "./translation-BOm4lmPx.js";
|
|
6
|
-
import { $ as hasRepeatedCharacters, C as useDataset, H as NO_ALPHABET_REGEX, V as LATIN_SPACE_MARK_PUNCTUATION_NUMBERS_REGEX, W as OTHER_ENTITIES_VALID_CHAR_REGEX, ct as standardKanjiValidator, et as hasText, it as isInvalidName, k as Header, lt as standardKatakanaValidator, nt as isEmpty, ot as isValidMinLength, st as matchesRegex, w as datasetIdentifier, z as EMOJI_REGEX } from "./resolveEnvironment-BYEL10Nc.js";
|
|
7
|
-
import { t as createLogger } from "./logger-Z8AeTE4x.js";
|
|
8
|
-
import { n as IconButton, t as Button } from "./Button-DfRmINzF.js";
|
|
9
|
-
import { a as objectsDeepEqual, o as entriesOf } from "./genUtils-Ce61IJs8.js";
|
|
10
|
-
import { t as DecisionMakerTypes } from "./decision-maker-type-NR4GFAeT.js";
|
|
11
|
-
import { n as TrustMemberGuidanceLabels, r as TrustMemberTypes } from "./trustMemberGuidance-CgdU2v0j.js";
|
|
12
|
-
import { i as useAnalyticsContext } from "./Modal-BsivDPTd.js";
|
|
13
|
-
import { i as formDebugInfo } from "./InputText-CTpVF0Mu.js";
|
|
14
|
-
import { t as useId } from "./useId-oOIS1nsj.js";
|
|
15
|
-
import { a as MaybeModal, c as getDataByFields, d as isTranslationObject, f as translateTranslatable, i as ProgressBar, l as omitKeys, o as ValidationResult, p as LoaderWrapper, r as Field, s as addKeys, t as Select } from "./Select-ByVcS_J2.js";
|
|
16
|
-
import { o as StructuredList, s as Confirm } from "./utils-DBIDcVUN.js";
|
|
17
|
-
import { t as Image } from "./Image-D82terx4.js";
|
|
18
|
-
import { t as List } from "./List-ywoRPg-q.js";
|
|
19
|
-
import { r as FormRouterContext, t as ErrorPanel } from "./ErrorPanel-tnFOlOZU.js";
|
|
20
|
-
import { t as UnincorporatedPartnershipMemberTypes } from "./unincorporated-partnership-DNTK5Y_5.js";
|
|
21
|
-
import { lazy } from "preact/compat";
|
|
22
|
-
import { useCallback as useCallback$1, useContext as useContext$1, useEffect as useEffect$1, useMemo as useMemo$1, useReducer, useRef as useRef$1, useState as useState$1 } from "preact/hooks";
|
|
23
|
-
import cx from "classnames";
|
|
24
|
-
import { jsx, jsxs } from "preact/jsx-runtime";
|
|
25
|
-
import { createContext as createContext$1 } from "preact";
|
|
26
|
-
//#region src/context/FormContext/FormContext.ts
|
|
27
|
-
var FormContext = createContext$1(null);
|
|
28
|
-
//#endregion
|
|
29
|
-
//#region src/context/FormContext/FormContextProvider.tsx
|
|
30
|
-
function FormContextProvider({ children, form }) {
|
|
31
|
-
const contextValue = useMemo$1(() => ({ form }), [form]);
|
|
32
|
-
return /* @__PURE__ */ jsx(FormContext.Provider, {
|
|
33
|
-
value: contextValue,
|
|
34
|
-
children
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
//#endregion
|
|
38
|
-
//#region src/hooks/usePageLandedEvent.ts
|
|
39
|
-
/**
|
|
40
|
-
* Hook that automatically sends a "Landed on page" analytics event on when active form changes.
|
|
41
|
-
* Used on form component level (i.e. Basic information, Additional details etc.) to explicitly track page visits.
|
|
42
|
-
* This centralizes the common analytics pattern used across form components.
|
|
43
|
-
*/
|
|
44
|
-
var usePageLandedEvent = (formName) => {
|
|
45
|
-
const userEvents = useAnalyticsContext();
|
|
46
|
-
const oldFormNameRef = useRef$1(void 0);
|
|
47
|
-
if (formName && oldFormNameRef.current !== formName) {
|
|
48
|
-
userEvents.updateSharedEventProperties({ page: formName });
|
|
49
|
-
userEvents.addPageEvent("Landed on page", { actionType: "navigate" });
|
|
50
|
-
oldFormNameRef.current = formName;
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
//#endregion
|
|
54
|
-
//#region src/utils/analytics/trackNavigation.ts
|
|
55
|
-
var trackNavigation = ({ userEvents, actionType, toForm, label, returnValue, additionalTrackingParams }) => {
|
|
56
|
-
userEvents.addPageEvent("Clicked button", {
|
|
57
|
-
actionType,
|
|
58
|
-
toPage: toForm,
|
|
59
|
-
label,
|
|
60
|
-
returnValue,
|
|
61
|
-
...additionalTrackingParams
|
|
62
|
-
});
|
|
63
|
-
};
|
|
64
|
-
//#endregion
|
|
65
|
-
//#region src/utils/formUtils.ts
|
|
66
|
-
var createFormUtils = (props, t) => ({
|
|
67
|
-
getLabel: (field, fallbackLabelKey) => {
|
|
68
|
-
let translationKey = props.labels?.[field] ?? fallbackLabelKey ?? field;
|
|
69
|
-
if (props.labels && !props.labels?.[field] && Object.keys(props.labels).length) {
|
|
70
|
-
const parentKey = Object.keys(props.labels).find((fieldKey) => typeof props.labels?.[fieldKey] === "object");
|
|
71
|
-
if (parentKey) translationKey = props.labels[parentKey][field] ?? translationKey;
|
|
72
|
-
}
|
|
73
|
-
return t(($) => $[translationKey]);
|
|
74
|
-
},
|
|
75
|
-
getMask: (field) => props.masks?.[field],
|
|
76
|
-
isRequiredField: (field, showIfNotInRequiredFields = true) => props.requiredFields ? props.requiredFields.includes(field) && (field !== "role" || field === "role" && props.taskType !== "individual") : showIfNotInRequiredFields,
|
|
77
|
-
isOptionalField: (field) => props.optionalFields?.includes(field) ?? false,
|
|
78
|
-
isVisibleField(field, showIfNotInRequiredFields = true) {
|
|
79
|
-
return this.isRequiredField(field, showIfNotInRequiredFields) || this.isOptionalField(field);
|
|
80
|
-
},
|
|
81
|
-
isReadOnly: (field) => props.readOnly || (props.readOnlyFields ? props.readOnlyFields.includes(field) : false),
|
|
82
|
-
isObscured: (field) => props.obscuredFields ? props.obscuredFields.includes(field) : false,
|
|
83
|
-
isTrusted: (field) => props.trustedFields ? props.trustedFields.includes(field) : false,
|
|
84
|
-
getErrorMessage: (field, errors, fieldProblems) => {
|
|
85
|
-
const errorMessage = errors?.[field]?.errorMessage;
|
|
86
|
-
if (!(!!errorMessage || Boolean(fieldProblems?.[field]))) return;
|
|
87
|
-
return {
|
|
88
|
-
key: (isTranslationObject(errorMessage) ? errorMessage.key : errorMessage) || "invalid",
|
|
89
|
-
message: translateTranslatable(t, errorMessage)
|
|
90
|
-
};
|
|
91
|
-
},
|
|
92
|
-
getFieldData: (formData, fieldKeys) => getDataByFields(formData, fieldKeys),
|
|
93
|
-
getFieldValid: (formValid, fieldKeys) => entriesOf(formValid).reduce((acc, [key, val]) => fieldKeys.includes(key) ? {
|
|
94
|
-
...acc,
|
|
95
|
-
[key]: val
|
|
96
|
-
} : acc, {}),
|
|
97
|
-
getFieldErrors: (formErrors, fieldProblems, fieldKeys) => Object.keys(formErrors).reduce((acc, key) => {
|
|
98
|
-
if (!fieldKeys.includes(key)) return acc;
|
|
99
|
-
const error = formErrors?.[key]?.errorMessage;
|
|
100
|
-
if (!(!!error || Boolean(fieldProblems?.[key]))) return acc;
|
|
101
|
-
const errorKey = isTranslationObject(error) ? error.key : error;
|
|
102
|
-
return {
|
|
103
|
-
...acc,
|
|
104
|
-
[key]: {
|
|
105
|
-
key: errorKey || "invalid",
|
|
106
|
-
message: translateTranslatable(t, error)
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
}, {}),
|
|
110
|
-
getFieldLabels: (fieldKeys, fallbackLabelKeys) => fieldKeys.reduce((acc, field) => {
|
|
111
|
-
let translationKey = props.labels?.[field] ?? fallbackLabelKeys?.[field] ?? field;
|
|
112
|
-
if (props.labels && !props.labels?.[field] && Object.keys(props.labels).length) {
|
|
113
|
-
const parentKey = Object.keys(props.labels).find((fieldKey) => typeof props.labels?.[fieldKey] === "object");
|
|
114
|
-
if (parentKey) translationKey = props.labels[parentKey][field] ?? translationKey;
|
|
115
|
-
}
|
|
116
|
-
return {
|
|
117
|
-
...acc,
|
|
118
|
-
[field]: t(($) => $[translationKey])
|
|
119
|
-
};
|
|
120
|
-
}, {})
|
|
121
|
-
});
|
|
122
|
-
var mergeFieldMetadataIntoProps = (fieldName, metadata, otherProps) => {
|
|
123
|
-
const existingProps = otherProps ?? {};
|
|
124
|
-
return {
|
|
125
|
-
...existingProps,
|
|
126
|
-
labels: {
|
|
127
|
-
...existingProps.labels,
|
|
128
|
-
[fieldName]: metadata.label
|
|
129
|
-
},
|
|
130
|
-
masks: {
|
|
131
|
-
...existingProps.masks,
|
|
132
|
-
[fieldName]: metadata.mask
|
|
133
|
-
},
|
|
134
|
-
validators: {
|
|
135
|
-
...existingProps.validators,
|
|
136
|
-
[fieldName]: metadata.validators
|
|
137
|
-
}
|
|
138
|
-
};
|
|
139
|
-
};
|
|
140
|
-
//#endregion
|
|
141
|
-
//#region src/utils/roleMetadata.ts
|
|
142
|
-
var roleMetadata = {
|
|
143
|
-
[DecisionMakerTypes.CONTROLLING_PERSON]: {
|
|
144
|
-
name: "controllingPerson",
|
|
145
|
-
description: "controllingPersonDescription"
|
|
146
|
-
},
|
|
147
|
-
[DecisionMakerTypes.OWNER]: {
|
|
148
|
-
name: "owner",
|
|
149
|
-
description: "ownerDescription"
|
|
150
|
-
},
|
|
151
|
-
[DecisionMakerTypes.SIGNATORY]: {
|
|
152
|
-
name: "signatory",
|
|
153
|
-
description: "signatoryDescription"
|
|
154
|
-
},
|
|
155
|
-
[DecisionMakerTypes.DIRECTOR]: {
|
|
156
|
-
name: "director",
|
|
157
|
-
description: "directorDescription"
|
|
158
|
-
},
|
|
159
|
-
[TrustMemberTypes.DEFINED_BENEFICIARY]: {
|
|
160
|
-
name: "definedBeneficiary",
|
|
161
|
-
description: "definedBeneficiaryDescription"
|
|
162
|
-
},
|
|
163
|
-
[TrustMemberTypes.UNDEFINED_BENEFICIARY]: {
|
|
164
|
-
name: "undefinedBeneficiary",
|
|
165
|
-
description: "undefinedBeneficiaryDescription"
|
|
166
|
-
},
|
|
167
|
-
[TrustMemberTypes.PROTECTOR]: {
|
|
168
|
-
name: "protector",
|
|
169
|
-
description: "personAppointmentUnderTrustInstrument"
|
|
170
|
-
},
|
|
171
|
-
[TrustMemberTypes.TRUSTEE]: {
|
|
172
|
-
name: "trustee",
|
|
173
|
-
description: "legalOwnerOfProperty"
|
|
174
|
-
},
|
|
175
|
-
[TrustMemberTypes.SETTLOR]: {
|
|
176
|
-
name: "settlor",
|
|
177
|
-
description: "entityEstablishingTrust"
|
|
178
|
-
},
|
|
179
|
-
[TrustMemberGuidanceLabels.BENEFICIARY]: { name: TrustMemberGuidanceLabels.BENEFICIARY },
|
|
180
|
-
[TrustMemberGuidanceLabels.TRUSTEE]: { name: TrustMemberGuidanceLabels.TRUSTEE },
|
|
181
|
-
[UnincorporatedPartnershipMemberTypes.SECONDARY_PARTNER]: {
|
|
182
|
-
name: UnincorporatedPartnershipMemberTypes.SECONDARY_PARTNER,
|
|
183
|
-
description: "secondaryPartnerGuideDescription"
|
|
184
|
-
}
|
|
185
|
-
};
|
|
186
|
-
var getRoleTagVariant = (role) => roleMetadata[role]?.variant ?? "blue";
|
|
187
|
-
var getRoleName = (role) => roleMetadata[role]?.name ?? role;
|
|
188
|
-
var Summary_module_default = {
|
|
189
|
-
summary: "_summary_1op7a_1",
|
|
190
|
-
"summary-content": "_summary-content_1op7a_7",
|
|
191
|
-
summaryContent: "_summary-content_1op7a_7",
|
|
192
|
-
"summary-list": "_summary-list_1op7a_13",
|
|
193
|
-
summaryList: "_summary-list_1op7a_13",
|
|
194
|
-
"summary-list-header": "_summary-list-header_1op7a_27",
|
|
195
|
-
summaryListHeader: "_summary-list-header_1op7a_27",
|
|
196
|
-
"summary-list-header-title": "_summary-list-header-title_1op7a_32",
|
|
197
|
-
summaryListHeaderTitle: "_summary-list-header-title_1op7a_32",
|
|
198
|
-
"summary-list-item": "_summary-list-item_1op7a_41",
|
|
199
|
-
summaryListItem: "_summary-list-item_1op7a_41",
|
|
200
|
-
"summary-list-item-key": "_summary-list-item-key_1op7a_55",
|
|
201
|
-
summaryListItemKey: "_summary-list-item-key_1op7a_55",
|
|
202
|
-
"summary-list-item-value": "_summary-list-item-value_1op7a_67",
|
|
203
|
-
summaryListItemValue: "_summary-list-item-value_1op7a_67",
|
|
204
|
-
"summary-content-legal-caption": "_summary-content-legal-caption_1op7a_73",
|
|
205
|
-
summaryContentLegalCaption: "_summary-content-legal-caption_1op7a_73",
|
|
206
|
-
"summary-content-list": "_summary-content-list_1op7a_88",
|
|
207
|
-
summaryContentList: "_summary-content-list_1op7a_88",
|
|
208
|
-
"summary-content-logo": "_summary-content-logo_1op7a_92",
|
|
209
|
-
summaryContentLogo: "_summary-content-logo_1op7a_92"
|
|
210
|
-
};
|
|
211
|
-
//#endregion
|
|
212
|
-
//#region src/components/Shared/Summary/summaryItem.ts
|
|
213
|
-
var isSummaryItem = (val) => typeof val === "object" && val !== null && "summaryLabel" in val && "summaryValue" in val;
|
|
214
|
-
var summaryItem = (summaryLabel, summaryValue) => ({
|
|
215
|
-
summaryLabel,
|
|
216
|
-
summaryValue
|
|
217
|
-
});
|
|
218
|
-
var preTranslatedSummaryItem = (summaryLabel, summaryValue) => ({
|
|
219
|
-
summaryLabel,
|
|
220
|
-
summaryValue,
|
|
221
|
-
preTranslated: true
|
|
222
|
-
});
|
|
223
|
-
//#endregion
|
|
224
|
-
//#region src/components/Shared/Summary/Summary.tsx
|
|
225
|
-
var onfidoLogo = lazy(() => import("./onfido-logo-CMRuSr8M.js"));
|
|
226
|
-
var summaryStep = {
|
|
227
|
-
formId: "summary",
|
|
228
|
-
formName: "summary"
|
|
229
|
-
};
|
|
230
|
-
/** @deprecated, use NewSummary */
|
|
231
|
-
function Summary({ data, forms, gotoForm, labels, problems, omitted = {}, showFormHeader = true, showSectionHeader = true, showLegalCaption = false, showTaxExemptedLegalCaption = false, useStructuredList = false }) {
|
|
232
|
-
const { t } = useTranslation("common");
|
|
233
|
-
const userEvents = useAnalyticsContext();
|
|
234
|
-
const editForm = (formId) => {
|
|
235
|
-
const formIndex = forms.findIndex((form) => form.formId === formId);
|
|
236
|
-
if (formIndex >= 0) gotoForm(formIndex);
|
|
237
|
-
};
|
|
238
|
-
const allValidationErrors = problems?.validationErrors && Object.values(problems.validationErrors)?.reduce((acc, validError) => ({
|
|
239
|
-
...acc,
|
|
240
|
-
...validError
|
|
241
|
-
}), {});
|
|
242
|
-
const allVerificationErrors = problems?.verificationErrors && Object.values(problems.verificationErrors)?.reduce((acc, verifError) => ({
|
|
243
|
-
...acc,
|
|
244
|
-
...verifError
|
|
245
|
-
}), {});
|
|
246
|
-
const formUtils = createFormUtils({ labels }, t);
|
|
247
|
-
const summarySectionHeader = (formName, formId) => /* @__PURE__ */ jsxs("header", {
|
|
248
|
-
className: Summary_module_default.summaryListHeader,
|
|
249
|
-
children: [/* @__PURE__ */ jsx("h2", {
|
|
250
|
-
className: Summary_module_default.summaryListHeaderTitle,
|
|
251
|
-
children: formName
|
|
252
|
-
}), !omitted.summaryEditButton?.includes(formId) && /* @__PURE__ */ jsx(IconButton, {
|
|
253
|
-
variant: "tertiary",
|
|
254
|
-
icon: "edit",
|
|
255
|
-
onClick: () => {
|
|
256
|
-
trackNavigation({
|
|
257
|
-
userEvents,
|
|
258
|
-
actionType: "edit",
|
|
259
|
-
toForm: formName,
|
|
260
|
-
label: "Pencil icon"
|
|
261
|
-
});
|
|
262
|
-
editForm(formId);
|
|
263
|
-
},
|
|
264
|
-
ariaLabel: t(($) => $["editForm"], { formName })
|
|
265
|
-
})]
|
|
266
|
-
});
|
|
267
|
-
const renderSummarySection = (fieldData, labelData = {}, formName, formId, useStructuredList) => {
|
|
268
|
-
const structuredListItems = Object.entries(fieldData).map(([key, value]) => {
|
|
269
|
-
return {
|
|
270
|
-
term: t(($) => $[labelData[key] || key]),
|
|
271
|
-
details: value
|
|
272
|
-
};
|
|
273
|
-
});
|
|
274
|
-
return !useStructuredList ? /* @__PURE__ */ jsxs(List, {
|
|
275
|
-
variant: "grouped-secondary",
|
|
276
|
-
children: [showSectionHeader && summarySectionHeader(formName, formId), /* @__PURE__ */ jsx("dl", {
|
|
277
|
-
className: Summary_module_default.summaryList,
|
|
278
|
-
children: Array.isArray(fieldData) ? fieldData.map((item) => renderBulletedListField(item)) : renderSummaryItems(fieldData, labelData)
|
|
279
|
-
})]
|
|
280
|
-
}) : /* @__PURE__ */ jsxs(List, {
|
|
281
|
-
variant: "grouped-secondary",
|
|
282
|
-
children: [showSectionHeader && summarySectionHeader(formName, formId), /* @__PURE__ */ jsx(StructuredList, { items: structuredListItems })]
|
|
283
|
-
});
|
|
284
|
-
};
|
|
285
|
-
const renderSummaryContent = (summaryData, useStructuredList) => {
|
|
286
|
-
const summaryList = [];
|
|
287
|
-
forms.forEach(({ formId, formName }) => {
|
|
288
|
-
const currentFormData = summaryData[formId];
|
|
289
|
-
if (!currentFormData || Object.values(currentFormData).every((value) => isEmpty(value)) || formId === summaryStep.formId || omitted.forms?.includes(formId)) return;
|
|
290
|
-
const summaryItems = currentFormData.hasInnerForms ? renderInnerForms(labels?.[formId], formId, currentFormData) : renderSummarySection(currentFormData, labels?.[formId], t(($) => $[typeof labels?.[formId] === "string" ? labels[formId] : formName]), formId, useStructuredList);
|
|
291
|
-
summaryList.push(summaryItems);
|
|
292
|
-
});
|
|
293
|
-
return summaryList;
|
|
294
|
-
};
|
|
295
|
-
const renderInnerForms = (labelData, parentFormId, innerForms = {}) => {
|
|
296
|
-
if (!innerForms) return [];
|
|
297
|
-
const dataList = [];
|
|
298
|
-
Object.entries(innerForms).forEach(([innerFormName, innerFormFieldData]) => {
|
|
299
|
-
const formName = t(($) => $[labelData?.[innerFormName] || innerFormName]);
|
|
300
|
-
if (typeof innerFormFieldData === "object" && innerFormFieldData !== null) {
|
|
301
|
-
if (Object.values(innerFormFieldData).every((value) => isEmpty(value))) return;
|
|
302
|
-
dataList.push(renderSummarySection(innerFormFieldData, labelData, formName, parentFormId));
|
|
303
|
-
}
|
|
304
|
-
});
|
|
305
|
-
return dataList;
|
|
306
|
-
};
|
|
307
|
-
/**
|
|
308
|
-
* Renders a single label-value pair as a field in the summary section.
|
|
309
|
-
*
|
|
310
|
-
* This helper function creates the markup for a single piece of data,
|
|
311
|
-
* displaying a label and its corresponding value using a definition list
|
|
312
|
-
* for semantic correctness (`<dt>` for label, `<dd>` for data).
|
|
313
|
-
*
|
|
314
|
-
* @param label The translated label to display for the field.
|
|
315
|
-
* @param value The value of the field, which can be a simple string or a JSX element for more complex rendering.
|
|
316
|
-
* @returns A JSX element representing the summary field.
|
|
317
|
-
*/
|
|
318
|
-
const renderField = (label, value) => /* @__PURE__ */ jsxs("div", {
|
|
319
|
-
className: Summary_module_default.summaryListItem,
|
|
320
|
-
children: [/* @__PURE__ */ jsx("dt", {
|
|
321
|
-
className: Summary_module_default.summaryListItemKey,
|
|
322
|
-
children: label
|
|
323
|
-
}), /* @__PURE__ */ jsx("dd", {
|
|
324
|
-
className: Summary_module_default.summaryListItemValue,
|
|
325
|
-
children: value
|
|
326
|
-
})]
|
|
327
|
-
});
|
|
328
|
-
const renderBulletedListField = (item) => /* @__PURE__ */ jsx("ul", {
|
|
329
|
-
className: Summary_module_default.summaryContentList,
|
|
330
|
-
children: /* @__PURE__ */ jsx("li", { children: item })
|
|
331
|
-
});
|
|
332
|
-
/**
|
|
333
|
-
* Recursively renders the data fields for a summary section.
|
|
334
|
-
*
|
|
335
|
-
* This function iterates through the properties of the `formData` object.
|
|
336
|
-
* It handles different data types by:
|
|
337
|
-
* - Displaying simple string or number values with their corresponding labels.
|
|
338
|
-
* - Handling 'role' arrays specifically to show a comma-separated list of roles.
|
|
339
|
-
* - Recognizing and rendering `SummaryItem` objects with their custom labels and values.
|
|
340
|
-
* - Recursively calling itself for nested objects to render their properties.
|
|
341
|
-
*
|
|
342
|
-
* Fields listed in the `omitted.keys` prop are skipped.
|
|
343
|
-
*
|
|
344
|
-
* @param formData The data object for the current section, containing key-value pairs to be rendered.
|
|
345
|
-
* @param labelData A map of field keys to their corresponding translation keys for fetching display labels.
|
|
346
|
-
* @returns An array of JSX elements representing the rendered summary fields for the section.
|
|
347
|
-
*/
|
|
348
|
-
const renderSummaryItems = (formData = {}, labelData = {}) => {
|
|
349
|
-
if (!formData) return [];
|
|
350
|
-
if (formData?.idVerificationMethod === "instantVerification") return [renderField(t(($) => $["verificationMethod"]), /* @__PURE__ */ jsx(Image, {
|
|
351
|
-
lazyLoadedImage: onfidoLogo,
|
|
352
|
-
className: Summary_module_default.summaryContentLogo,
|
|
353
|
-
alt: "onfido-logo"
|
|
354
|
-
}))];
|
|
355
|
-
const dataList = [];
|
|
356
|
-
Object.entries(formData).forEach(([field, fieldData]) => {
|
|
357
|
-
if (omitted.keys?.includes(field) || !fieldData) return;
|
|
358
|
-
const fieldName = t(($) => $[labelData[field] || field]);
|
|
359
|
-
if (field === "role" && Array.isArray(fieldData)) {
|
|
360
|
-
const label = fieldData.length > 1 ? t(($) => $["roles"]) : fieldName;
|
|
361
|
-
const roles = fieldData.map((role) => t(($) => $[getRoleName(role)])).join(", ");
|
|
362
|
-
dataList.push(renderField(label, roles));
|
|
363
|
-
} else if (isSummaryItem(fieldData)) {
|
|
364
|
-
const { summaryLabel, summaryValue, preTranslated } = fieldData;
|
|
365
|
-
if (preTranslated) dataList.push(renderField(summaryLabel, summaryValue));
|
|
366
|
-
else dataList.push(renderField(translateTranslatable(t, summaryLabel) ?? "", summaryValue));
|
|
367
|
-
} else if (typeof fieldData === "object") dataList.push(renderSummaryItems(fieldData, labelData));
|
|
368
|
-
else if (["string", "number"].includes(typeof fieldData)) dataList.push(renderField(fieldName, fieldData));
|
|
369
|
-
});
|
|
370
|
-
return dataList;
|
|
371
|
-
};
|
|
372
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
373
|
-
role: "region",
|
|
374
|
-
className: Summary_module_default.summary,
|
|
375
|
-
children: [showFormHeader && /* @__PURE__ */ jsx(Header, {
|
|
376
|
-
title: t(($) => $["summary"]),
|
|
377
|
-
description: t(($) => $["summaryDescription"])
|
|
378
|
-
}), /* @__PURE__ */ jsxs("div", {
|
|
379
|
-
className: Summary_module_default.summaryContent,
|
|
380
|
-
children: [
|
|
381
|
-
/* @__PURE__ */ jsx(ErrorPanel, {
|
|
382
|
-
validationErrors: allValidationErrors,
|
|
383
|
-
verificationErrors: allVerificationErrors,
|
|
384
|
-
formUtils,
|
|
385
|
-
id: "ariaErrorField"
|
|
386
|
-
}),
|
|
387
|
-
renderSummaryContent(data, useStructuredList),
|
|
388
|
-
showLegalCaption && /* @__PURE__ */ jsx("div", {
|
|
389
|
-
className: Summary_module_default.summaryContentLegalCaption,
|
|
390
|
-
children: t(($) => $["summaryLegalCaption"])
|
|
391
|
-
}),
|
|
392
|
-
showTaxExemptedLegalCaption && /* @__PURE__ */ jsxs("div", {
|
|
393
|
-
className: Summary_module_default.summaryContentLegalCaption,
|
|
394
|
-
children: [/* @__PURE__ */ jsx("p", { children: t(($) => $["summaryTaxExemptionLegalCaptionTitle"]) }), /* @__PURE__ */ jsxs("ul", { children: [
|
|
395
|
-
/* @__PURE__ */ jsx("li", { children: t(($) => $["summaryTaxExemptionLegalCaption_1"]) }),
|
|
396
|
-
/* @__PURE__ */ jsx("li", { children: t(($) => $["summaryTaxExemptionLegalCaption_2"]) }),
|
|
397
|
-
/* @__PURE__ */ jsx("li", { children: t(($) => $["summaryTaxExemptionLegalCaption_3"]) })
|
|
398
|
-
] })]
|
|
399
|
-
})
|
|
400
|
-
]
|
|
401
|
-
})]
|
|
402
|
-
});
|
|
403
|
-
}
|
|
404
|
-
//#endregion
|
|
405
|
-
//#region src/utils/scrollToInvalidField.ts
|
|
406
|
-
var INVALID_FIELD_SELECTOR = ".adyen-kyc-field--error, .adyen-kyc-label__text--error";
|
|
407
|
-
var SCROLLABLE_OVERFLOW_VALUES = new Set([
|
|
408
|
-
"auto",
|
|
409
|
-
"scroll",
|
|
410
|
-
"overlay"
|
|
411
|
-
]);
|
|
412
|
-
var isWindow = (container) => container === window;
|
|
413
|
-
var getInvalidFieldTarget = (element) => element.closest(".adyen-kyc-field") ?? element;
|
|
414
|
-
var isCustomElement = (element) => element.tagName.includes("-");
|
|
415
|
-
var queryInvalidField = (root) => {
|
|
416
|
-
const invalidField = root.querySelector(INVALID_FIELD_SELECTOR);
|
|
417
|
-
if (invalidField) return getInvalidFieldTarget(invalidField);
|
|
418
|
-
for (const element of Array.from(root.querySelectorAll("*")).filter(isCustomElement)) {
|
|
419
|
-
if (!element.shadowRoot) continue;
|
|
420
|
-
const shadowInvalidField = queryInvalidField(element.shadowRoot);
|
|
421
|
-
if (shadowInvalidField) return shadowInvalidField;
|
|
422
|
-
}
|
|
423
|
-
return null;
|
|
424
|
-
};
|
|
425
|
-
var isElementVisibleInContainer = (element, container) => {
|
|
426
|
-
const elementRect = element.getBoundingClientRect();
|
|
427
|
-
if (isWindow(container)) return elementRect.top >= 0 && elementRect.bottom <= window.innerHeight;
|
|
428
|
-
const containerRect = container.getBoundingClientRect();
|
|
429
|
-
return elementRect.top >= containerRect.top && elementRect.bottom <= containerRect.bottom;
|
|
430
|
-
};
|
|
431
|
-
var findScrollContainer = (element) => {
|
|
432
|
-
let parent = element.parentElement;
|
|
433
|
-
while (parent) {
|
|
434
|
-
const style = window.getComputedStyle(parent);
|
|
435
|
-
const canScroll = parent.scrollHeight > parent.clientHeight;
|
|
436
|
-
const hasScrollableOverflow = SCROLLABLE_OVERFLOW_VALUES.has(style.overflowY);
|
|
437
|
-
if (canScroll && hasScrollableOverflow) return parent;
|
|
438
|
-
parent = parent.parentElement;
|
|
439
|
-
}
|
|
440
|
-
return window;
|
|
441
|
-
};
|
|
442
|
-
var scrollElementIntoContainer = (element, container) => {
|
|
443
|
-
if (isWindow(container)) {
|
|
444
|
-
element.scrollIntoView({
|
|
445
|
-
behavior: "smooth",
|
|
446
|
-
block: "center"
|
|
447
|
-
});
|
|
448
|
-
return;
|
|
449
|
-
}
|
|
450
|
-
const elementRect = element.getBoundingClientRect();
|
|
451
|
-
const containerRect = container.getBoundingClientRect();
|
|
452
|
-
const offset = elementRect.top - containerRect.top - containerRect.height / 3;
|
|
453
|
-
container.scrollBy({
|
|
454
|
-
top: offset,
|
|
455
|
-
behavior: "smooth"
|
|
456
|
-
});
|
|
457
|
-
};
|
|
458
|
-
var scrollToInvalidField = () => {
|
|
459
|
-
const invalidField = queryInvalidField(document);
|
|
460
|
-
if (!invalidField) return;
|
|
461
|
-
const container = findScrollContainer(invalidField);
|
|
462
|
-
if (isElementVisibleInContainer(invalidField, container)) return;
|
|
463
|
-
scrollElementIntoContainer(invalidField, container);
|
|
464
|
-
};
|
|
465
|
-
//#endregion
|
|
466
|
-
//#region src/hooks/useFormComposer.ts
|
|
467
|
-
var logger$2 = createLogger();
|
|
468
|
-
/**
|
|
469
|
-
* The step we open to for editing an existing entity should be the summary if there are verification errors
|
|
470
|
-
* Otherwise (including for a new entity), just show the first step
|
|
471
|
-
*/
|
|
472
|
-
var getOpeningStep = (forms, remediationActions) => {
|
|
473
|
-
if (remediationActions && Object.keys(remediationActions).length > 0) {
|
|
474
|
-
const allRemediationActions = Object.values(remediationActions).flat().filter((rem) => rem.forms?.length > 0);
|
|
475
|
-
if (allRemediationActions.length === 1 && allRemediationActions[0]?.forms.length === 1) {
|
|
476
|
-
const form = forms.find((form) => form?.formId === allRemediationActions[0]?.forms[0]);
|
|
477
|
-
if (form) return form;
|
|
478
|
-
}
|
|
479
|
-
return forms[forms.length - 1];
|
|
480
|
-
}
|
|
481
|
-
return forms[0];
|
|
482
|
-
};
|
|
483
|
-
var useFormComposer = ({ problems, navigationTrackingParams, forms, externalBackClick, onSubmit, triggerValidation }) => {
|
|
484
|
-
const userEvents = useAnalyticsContext();
|
|
485
|
-
const [shouldValidate, setShouldValidate] = useState$1(false);
|
|
486
|
-
const [activeForm, setActiveForm] = useState$1(forms[0]);
|
|
487
|
-
const isFormSummaryStep = (form) => form.formId === summaryStep.formId;
|
|
488
|
-
const getFormIndex = (formId) => forms.findIndex((form) => form.formId === formId);
|
|
489
|
-
const currentStep = getFormIndex(activeForm.formId);
|
|
490
|
-
const totalSteps = forms.length;
|
|
491
|
-
const isFinalStep = currentStep === totalSteps - 1;
|
|
492
|
-
const isFirstStep = currentStep === 0;
|
|
493
|
-
const firstStepId = forms[0]?.formId;
|
|
494
|
-
usePageLandedEvent(activeForm.formName);
|
|
495
|
-
const [oldForms, setOldForms] = useState$1(forms);
|
|
496
|
-
if (oldForms !== forms) {
|
|
497
|
-
setActiveForm((activeForm) => forms.find(({ formId }) => formId === activeForm.formId) ?? activeForm);
|
|
498
|
-
setOldForms(forms);
|
|
499
|
-
}
|
|
500
|
-
/**
|
|
501
|
-
* Opening step can be calculated once since the problems are already known on drop-in load
|
|
502
|
-
*/
|
|
503
|
-
const [oldFirstStepId, setOldFirstStepId] = useState$1(void 0);
|
|
504
|
-
if (oldFirstStepId !== firstStepId) {
|
|
505
|
-
/** TODO: need a better solution
|
|
506
|
-
* If firstStepId changes it means form configurations are being setup,
|
|
507
|
-
* not able to put forms as the dependency here as it also updates whenever validity changes
|
|
508
|
-
* should separate out forms into forms and validity
|
|
509
|
-
***/
|
|
510
|
-
setActiveForm(getOpeningStep(forms, problems?.remediationActions));
|
|
511
|
-
setOldFirstStepId(firstStepId);
|
|
512
|
-
}
|
|
513
|
-
const gotoFormByFormIndex = (nextFormIndex, currentForms) => {
|
|
514
|
-
setActiveForm(currentForms?.[nextFormIndex] ?? forms[nextFormIndex]);
|
|
515
|
-
};
|
|
516
|
-
/**
|
|
517
|
-
* We often run into a situation where we want to navigate to a specific form immediately after
|
|
518
|
-
* rearranging the forms in the flow.
|
|
519
|
-
*
|
|
520
|
-
* The issue here is that the callback, (e.g. {@link IdVerificationMethod.handleVerifyByInvite})
|
|
521
|
-
* has a reference only to the current forms, not what the forms will be post-rearrangement.
|
|
522
|
-
* Hence, it is impossible to call {@link gotoFormByFormIndex} because we have no idea what the
|
|
523
|
-
* eventual index of the form will be.
|
|
524
|
-
*
|
|
525
|
-
* The solution: set a desired form ID, then resolve the navigation as part of the render
|
|
526
|
-
* once {@link forms} contains it. The subsequent {@link gotoFormByFormIndex} will immediately
|
|
527
|
-
* cancel the current render and trigger a new one.
|
|
528
|
-
*/
|
|
529
|
-
const [desiredFormId, setDesiredFormId] = useState$1();
|
|
530
|
-
if (desiredFormId) {
|
|
531
|
-
const targetFormIndex = forms.findIndex((form) => form.formId === desiredFormId);
|
|
532
|
-
if (targetFormIndex === -1) logger$2.warn(`Desired form ${desiredFormId} not present. \nCurrent forms: ${forms.map((f) => f.formId).join(", ")}`);
|
|
533
|
-
else {
|
|
534
|
-
setDesiredFormId(void 0);
|
|
535
|
-
gotoFormByFormIndex(targetFormIndex);
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
|
-
const gotoFormByFormId = (formId) => {
|
|
539
|
-
setDesiredFormId(formId);
|
|
540
|
-
};
|
|
541
|
-
const trackSubmitClick = () => {
|
|
542
|
-
trackNavigation({
|
|
543
|
-
userEvents,
|
|
544
|
-
actionType: "submit",
|
|
545
|
-
label: "submit",
|
|
546
|
-
additionalTrackingParams: navigationTrackingParams
|
|
547
|
-
});
|
|
548
|
-
};
|
|
549
|
-
const handleNextClick = async (updatedForms) => {
|
|
550
|
-
const currentForms = updatedForms ?? forms;
|
|
551
|
-
if (isFormSummaryStep(activeForm)) {
|
|
552
|
-
trackSubmitClick();
|
|
553
|
-
onSubmit();
|
|
554
|
-
return;
|
|
555
|
-
}
|
|
556
|
-
/**
|
|
557
|
-
* Returns validation result of async validators if any
|
|
558
|
-
*/
|
|
559
|
-
const isAsyncValidationValid = await triggerValidation?.(activeForm.formId) ?? true;
|
|
560
|
-
/**
|
|
561
|
-
* Checks if both static validations and asyncValidations pass
|
|
562
|
-
*/
|
|
563
|
-
if (!activeForm.isValid || !isAsyncValidationValid) {
|
|
564
|
-
/**
|
|
565
|
-
* shouldValidate is not required with useMultiForm
|
|
566
|
-
*/
|
|
567
|
-
setShouldValidate(true);
|
|
568
|
-
requestAnimationFrame(scrollToInvalidField);
|
|
569
|
-
trackNavigation({
|
|
570
|
-
userEvents,
|
|
571
|
-
actionType: "next",
|
|
572
|
-
label: "next",
|
|
573
|
-
returnValue: "validation error",
|
|
574
|
-
additionalTrackingParams: navigationTrackingParams
|
|
575
|
-
});
|
|
576
|
-
return;
|
|
577
|
-
}
|
|
578
|
-
if (isFinalStep) {
|
|
579
|
-
trackSubmitClick();
|
|
580
|
-
onSubmit();
|
|
581
|
-
return;
|
|
582
|
-
}
|
|
583
|
-
setShouldValidate(false);
|
|
584
|
-
const toFormIndex = currentStep + 1;
|
|
585
|
-
gotoFormByFormIndex(toFormIndex, currentForms);
|
|
586
|
-
trackNavigation({
|
|
587
|
-
userEvents,
|
|
588
|
-
actionType: "next",
|
|
589
|
-
toForm: currentForms[toFormIndex]?.formName,
|
|
590
|
-
label: "next",
|
|
591
|
-
returnValue: "success",
|
|
592
|
-
additionalTrackingParams: navigationTrackingParams
|
|
593
|
-
});
|
|
594
|
-
};
|
|
595
|
-
const handleBackClick = () => {
|
|
596
|
-
if (currentStep > 0) {
|
|
597
|
-
const toForm = forms[currentStep - 1];
|
|
598
|
-
setActiveForm(toForm);
|
|
599
|
-
trackNavigation({
|
|
600
|
-
userEvents,
|
|
601
|
-
actionType: "back",
|
|
602
|
-
toForm: toForm?.formName,
|
|
603
|
-
label: "back",
|
|
604
|
-
additionalTrackingParams: navigationTrackingParams
|
|
605
|
-
});
|
|
606
|
-
}
|
|
607
|
-
};
|
|
608
|
-
return {
|
|
609
|
-
handleBackClick: isFirstStep ? externalBackClick : handleBackClick,
|
|
610
|
-
handleNextClick,
|
|
611
|
-
gotoFormByFormIndex,
|
|
612
|
-
gotoFormByFormId,
|
|
613
|
-
activeForm,
|
|
614
|
-
shouldValidate,
|
|
615
|
-
setShouldValidate,
|
|
616
|
-
steps: {
|
|
617
|
-
current: currentStep,
|
|
618
|
-
total: totalSteps
|
|
619
|
-
}
|
|
620
|
-
};
|
|
621
|
-
};
|
|
622
|
-
//#endregion
|
|
623
|
-
//#region src/hooks/useMultiForm/reducer.ts
|
|
624
|
-
/** Checks if a field key exists on the nested data object (even if its value is undefined) */
|
|
625
|
-
var hasOwnNestedField = (data, formName, fieldKey) => {
|
|
626
|
-
const form = data?.[formName];
|
|
627
|
-
return form != null && typeof form === "object" && Object.hasOwn(form, fieldKey);
|
|
628
|
-
};
|
|
629
|
-
var hasValueChanged = (newData, prevData) => {
|
|
630
|
-
if (typeof newData === "object") return !objectsDeepEqual(newData, prevData);
|
|
631
|
-
return newData !== prevData;
|
|
632
|
-
};
|
|
633
|
-
/** Formats and validates a field */
|
|
634
|
-
var processField = ({ key, value, formName, mode, defaultData, data, fieldContext, formatters, staticValidate }) => {
|
|
635
|
-
const formatterFn = formatters?.[key]?.formatter ? formatters[key]?.formatter : formatters?.[key];
|
|
636
|
-
const formattedValue = formatterFn && typeof formatterFn === "function" ? formatterFn(value, fieldContext) : value;
|
|
637
|
-
const fieldHasDefaultValue = key in (defaultData ?? {});
|
|
638
|
-
const fieldHasChanged = defaultData?.[key] !== value;
|
|
639
|
-
const validationResult = (fieldContext.state.obscuredFields?.includes(key) ? fieldHasChanged : fieldHasChanged || fieldHasDefaultValue) ? staticValidate({
|
|
640
|
-
key,
|
|
641
|
-
value: formattedValue,
|
|
642
|
-
mode,
|
|
643
|
-
formName
|
|
644
|
-
}, data, fieldContext) : new ValidationResult([{
|
|
645
|
-
isValid: true,
|
|
646
|
-
hasError: false
|
|
647
|
-
}]);
|
|
648
|
-
const asyncValidationResult = fieldContext.state?.asyncErrors?.[key];
|
|
649
|
-
/** Add any existing async validation result to validation result */
|
|
650
|
-
if (asyncValidationResult) validationResult.addError(asyncValidationResult);
|
|
651
|
-
return [formattedValue, validationResult];
|
|
652
|
-
};
|
|
653
|
-
/**
|
|
654
|
-
* The function takes in the below params and spits out an initial state, by running the validations
|
|
655
|
-
* across all forms and fields. It makes sure all validations are done and only sets the validity
|
|
656
|
-
* instead of the errors, this is to avoid users seeing error immaturely on initial load.
|
|
657
|
-
*
|
|
658
|
-
* @param requiredFields
|
|
659
|
-
* @param staticValidate
|
|
660
|
-
* @param asyncValidate
|
|
661
|
-
* @param defaultData
|
|
662
|
-
* @param obscuredFields
|
|
663
|
-
* @param optionalFields
|
|
664
|
-
* @param trustedFields
|
|
665
|
-
* @param fieldProblems
|
|
666
|
-
* @param formatters
|
|
667
|
-
* @param data
|
|
668
|
-
*/
|
|
669
|
-
function init({ requiredFields, staticValidate, defaultData, obscuredFields, optionalFields, trustedFields, fieldProblems, formatters, data, asyncErrors }) {
|
|
670
|
-
/**
|
|
671
|
-
* Fetches the validation result of a field in a form
|
|
672
|
-
* @param fieldKey
|
|
673
|
-
* @param formName
|
|
674
|
-
*/
|
|
675
|
-
const getProcessedState = (fieldKey, formName) => {
|
|
676
|
-
const [formattedValue, validationResult] = processField({
|
|
677
|
-
key: fieldKey,
|
|
678
|
-
value: hasOwnNestedField(data, formName, fieldKey) ? data?.[formName]?.[fieldKey] ?? null : defaultData?.[formName]?.[fieldKey] ?? null,
|
|
679
|
-
mode: "blur",
|
|
680
|
-
formName,
|
|
681
|
-
formatters: formatters?.[formName],
|
|
682
|
-
defaultData: defaultData?.[formName],
|
|
683
|
-
data,
|
|
684
|
-
fieldContext: { state: {
|
|
685
|
-
data: data?.[formName],
|
|
686
|
-
obscuredFields: obscuredFields?.[formName],
|
|
687
|
-
optionalFields: optionalFields?.[formName],
|
|
688
|
-
trustedFields: trustedFields?.[formName],
|
|
689
|
-
requiredFields: requiredFields?.[formName],
|
|
690
|
-
asyncErrors: asyncErrors?.[formName]
|
|
691
|
-
} },
|
|
692
|
-
staticValidate
|
|
693
|
-
});
|
|
694
|
-
return {
|
|
695
|
-
valid: validationResult.isValid && !fieldProblems?.[formName]?.[fieldKey] || false,
|
|
696
|
-
errors: null,
|
|
697
|
-
data: formattedValue,
|
|
698
|
-
fieldProblems: fieldProblems?.[formName]?.[fieldKey]
|
|
699
|
-
};
|
|
700
|
-
};
|
|
701
|
-
/**
|
|
702
|
-
* requiredFields can be undefined if the configuration api call is not yet completed
|
|
703
|
-
* returned default state in this case
|
|
704
|
-
*/
|
|
705
|
-
if (!requiredFields) return {
|
|
706
|
-
data: defaultData,
|
|
707
|
-
errors: {},
|
|
708
|
-
fieldProblems: {},
|
|
709
|
-
valid: {},
|
|
710
|
-
requiredFields: {},
|
|
711
|
-
asyncErrors: {},
|
|
712
|
-
defaultData
|
|
713
|
-
};
|
|
714
|
-
/**
|
|
715
|
-
* Make sure forms containing only optional fields are also taken into account
|
|
716
|
-
*/
|
|
717
|
-
const formsForOptionalFields = Object.keys(optionalFields ?? {});
|
|
718
|
-
const formsForRequiredFields = Object.keys(requiredFields);
|
|
719
|
-
/**
|
|
720
|
-
* Visits every field and builds a state with the validity
|
|
721
|
-
*/
|
|
722
|
-
return Array.from(new Set([...formsForOptionalFields, ...formsForRequiredFields])).reduce((acc, formName) => {
|
|
723
|
-
const form = formName;
|
|
724
|
-
const optionalsFormFields = optionalFields?.[form] ?? [];
|
|
725
|
-
const requiredFormFields = requiredFields?.[form] ?? [];
|
|
726
|
-
const formState = [...optionalsFormFields, ...requiredFormFields].reduce((acc, field) => {
|
|
727
|
-
const { valid, errors, data, fieldProblems: processedFieldProblems } = getProcessedState(field, form);
|
|
728
|
-
return {
|
|
729
|
-
...acc,
|
|
730
|
-
data: {
|
|
731
|
-
...acc.data,
|
|
732
|
-
[field]: data
|
|
733
|
-
},
|
|
734
|
-
valid: {
|
|
735
|
-
...acc.valid,
|
|
736
|
-
[field]: valid
|
|
737
|
-
},
|
|
738
|
-
errors: {
|
|
739
|
-
...acc.errors,
|
|
740
|
-
[field]: errors
|
|
741
|
-
},
|
|
742
|
-
fieldProblems: {
|
|
743
|
-
...acc.fieldProblems,
|
|
744
|
-
...processedFieldProblems ? { [field]: processedFieldProblems } : {}
|
|
745
|
-
}
|
|
746
|
-
};
|
|
747
|
-
}, {});
|
|
748
|
-
return {
|
|
749
|
-
requiredFields,
|
|
750
|
-
data: {
|
|
751
|
-
...acc.data,
|
|
752
|
-
[formName]: formState.data
|
|
753
|
-
},
|
|
754
|
-
valid: {
|
|
755
|
-
...acc.valid,
|
|
756
|
-
[formName]: formState.valid
|
|
757
|
-
},
|
|
758
|
-
errors: {
|
|
759
|
-
...acc.errors,
|
|
760
|
-
[formName]: formState.errors
|
|
761
|
-
},
|
|
762
|
-
fieldProblems: {
|
|
763
|
-
...acc.fieldProblems,
|
|
764
|
-
[formName]: formState.fieldProblems
|
|
765
|
-
},
|
|
766
|
-
asyncErrors: { ...acc.asyncErrors },
|
|
767
|
-
obscuredFields,
|
|
768
|
-
optionalFields,
|
|
769
|
-
trustedFields,
|
|
770
|
-
defaultData
|
|
771
|
-
};
|
|
772
|
-
}, {
|
|
773
|
-
requiredFields,
|
|
774
|
-
data: {},
|
|
775
|
-
valid: {},
|
|
776
|
-
errors: {},
|
|
777
|
-
fieldProblems: {},
|
|
778
|
-
obscuredFields,
|
|
779
|
-
optionalFields,
|
|
780
|
-
trustedFields,
|
|
781
|
-
asyncErrors: {}
|
|
782
|
-
});
|
|
783
|
-
}
|
|
784
|
-
function reducer({ staticValidate, obscuredFields, optionalFields, trustedFields, formatters, defaultData }) {
|
|
785
|
-
return (state, { type, key, mode, value, formData, formName, selectedSchema, innerFormFields, requiredFields, optionalFields: newOptionalFields, asyncValidationResults }) => {
|
|
786
|
-
const clonedState = structuredClone(state);
|
|
787
|
-
switch (type) {
|
|
788
|
-
case "setData":
|
|
789
|
-
if (!key || !formName) return state;
|
|
790
|
-
clonedState.data[formName] ??= {};
|
|
791
|
-
clonedState.data[formName][key] = value;
|
|
792
|
-
return clonedState;
|
|
793
|
-
case "setFormData": {
|
|
794
|
-
if (!formName || !formData) return state;
|
|
795
|
-
const formRequiredFields = clonedState.requiredFields?.[formName] ?? [];
|
|
796
|
-
const formOptionalFields = clonedState.optionalFields?.[formName] ?? [];
|
|
797
|
-
const allowedFields = [...formRequiredFields, ...formOptionalFields];
|
|
798
|
-
const filteredUpdates = {};
|
|
799
|
-
for (const formDataKey in formData) if (allowedFields.includes(formDataKey)) filteredUpdates[formDataKey] = formData[formDataKey];
|
|
800
|
-
clonedState.data[formName] = filteredUpdates;
|
|
801
|
-
const formValidity = allowedFields.reduce((acc, field) => {
|
|
802
|
-
const [, validation] = processField({
|
|
803
|
-
key: field,
|
|
804
|
-
value: filteredUpdates[field],
|
|
805
|
-
mode: "blur",
|
|
806
|
-
formName,
|
|
807
|
-
defaultData: defaultData?.[formName],
|
|
808
|
-
data: clonedState.data,
|
|
809
|
-
formatters: formatters?.[formName],
|
|
810
|
-
fieldContext: { state: {
|
|
811
|
-
data: clonedState?.data?.[formName],
|
|
812
|
-
obscuredFields: obscuredFields?.[formName],
|
|
813
|
-
optionalFields: optionalFields?.[formName],
|
|
814
|
-
trustedFields: trustedFields?.[formName],
|
|
815
|
-
errors: clonedState.errors?.[formName],
|
|
816
|
-
valid: clonedState.valid?.[formName],
|
|
817
|
-
fieldProblems: clonedState.fieldProblems?.[formName],
|
|
818
|
-
asyncErrors: clonedState.asyncErrors?.[formName]
|
|
819
|
-
} },
|
|
820
|
-
staticValidate
|
|
821
|
-
});
|
|
822
|
-
return {
|
|
823
|
-
...acc,
|
|
824
|
-
[field]: validation.isValid
|
|
825
|
-
};
|
|
826
|
-
}, {});
|
|
827
|
-
clonedState.data[formName] = filteredUpdates;
|
|
828
|
-
clonedState.valid[formName] = formValidity;
|
|
829
|
-
return clonedState;
|
|
830
|
-
}
|
|
831
|
-
case "setValid":
|
|
832
|
-
if (!key || !formName || clonedState.valid[formName]?.[key] === value) return state;
|
|
833
|
-
clonedState.valid[formName] ??= {};
|
|
834
|
-
clonedState.valid[formName][key] = !!value;
|
|
835
|
-
return clonedState;
|
|
836
|
-
case "setErrors":
|
|
837
|
-
if (!key || !formName) return state;
|
|
838
|
-
clonedState.errors[formName] ??= {};
|
|
839
|
-
clonedState.errors[formName][key] = value;
|
|
840
|
-
return clonedState;
|
|
841
|
-
case "setRequiredFields": {
|
|
842
|
-
/**
|
|
843
|
-
* If defaultData changes reset the data in the form to new defaultData
|
|
844
|
-
* Fetching documents are bit delayed, this accomodates that delay
|
|
845
|
-
*/
|
|
846
|
-
const hasDefaultDataChanged = !objectsDeepEqual(defaultData, state.defaultData);
|
|
847
|
-
if (objectsDeepEqual(requiredFields, clonedState.requiredFields) && objectsDeepEqual(newOptionalFields, clonedState.optionalFields) && !hasDefaultDataChanged) return state;
|
|
848
|
-
const updatedData = hasDefaultDataChanged ? defaultData : structuredClone(clonedState.data);
|
|
849
|
-
/**
|
|
850
|
-
* When schema changes without a defaultData refresh, re-add any fields that were
|
|
851
|
-
* previously removed and are now reintroduced from the local stash.
|
|
852
|
-
*
|
|
853
|
-
* This preserves user-entered values across dynamic required/optional transitions,
|
|
854
|
-
* such as when rule-driven fields are temporarily hidden and then shown again.
|
|
855
|
-
*/
|
|
856
|
-
if (!hasDefaultDataChanged && updatedData) for (const formName in requiredFields) {
|
|
857
|
-
const form = formName;
|
|
858
|
-
const prevFields = [...clonedState.requiredFields?.[form] ?? [], ...clonedState.optionalFields?.[form] ?? []];
|
|
859
|
-
[...requiredFields?.[form] ?? [], ...newOptionalFields?.[form] ?? []].filter((field) => !prevFields.includes(field)).forEach((field) => {
|
|
860
|
-
const currentValue = updatedData?.[form]?.[field];
|
|
861
|
-
const localValue = clonedState.local?.[form]?.data?.[field];
|
|
862
|
-
if (typeof currentValue === "undefined" && typeof localValue !== "undefined") {
|
|
863
|
-
if (!updatedData[form]) return;
|
|
864
|
-
updatedData[form][field] = localValue;
|
|
865
|
-
}
|
|
866
|
-
});
|
|
867
|
-
}
|
|
868
|
-
const newState = init({
|
|
869
|
-
requiredFields,
|
|
870
|
-
data: updatedData,
|
|
871
|
-
fieldProblems: clonedState.fieldProblems,
|
|
872
|
-
obscuredFields,
|
|
873
|
-
optionalFields: newOptionalFields,
|
|
874
|
-
trustedFields,
|
|
875
|
-
staticValidate,
|
|
876
|
-
defaultData
|
|
877
|
-
});
|
|
878
|
-
if (hasDefaultDataChanged) return newState;
|
|
879
|
-
/**
|
|
880
|
-
* Persist values of fields that are being removed from the active schema into local.
|
|
881
|
-
*
|
|
882
|
-
* These values are later used to restore data for reintroduced fields in subsequent
|
|
883
|
-
* schema transitions, avoiding silent data loss during dynamic form updates.
|
|
884
|
-
*/
|
|
885
|
-
const local = Object.keys(requiredFields ?? {}).reduce((acc, formName) => {
|
|
886
|
-
const form = formName;
|
|
887
|
-
const prevFields = [...clonedState.requiredFields?.[form] ?? [], ...clonedState.optionalFields?.[form] ?? []];
|
|
888
|
-
const nextFields = [...requiredFields?.[form] ?? [], ...newOptionalFields?.[form] ?? []];
|
|
889
|
-
const removedFields = prevFields.filter((field) => !nextFields.includes(field));
|
|
890
|
-
if (!removedFields.length) {
|
|
891
|
-
if (clonedState.local?.[form]) return {
|
|
892
|
-
...acc,
|
|
893
|
-
[form]: clonedState.local[form]
|
|
894
|
-
};
|
|
895
|
-
return acc;
|
|
896
|
-
}
|
|
897
|
-
const localFormData = {
|
|
898
|
-
...clonedState.local?.[form]?.data ?? {},
|
|
899
|
-
...removedFields.reduce((fieldAcc, field) => {
|
|
900
|
-
const value = clonedState.data?.[form]?.[field];
|
|
901
|
-
if (typeof value !== "undefined") return {
|
|
902
|
-
...fieldAcc,
|
|
903
|
-
[field]: value
|
|
904
|
-
};
|
|
905
|
-
return fieldAcc;
|
|
906
|
-
}, {})
|
|
907
|
-
};
|
|
908
|
-
return {
|
|
909
|
-
...acc,
|
|
910
|
-
[form]: {
|
|
911
|
-
...clonedState.local?.[form] ?? {},
|
|
912
|
-
data: localFormData
|
|
913
|
-
}
|
|
914
|
-
};
|
|
915
|
-
}, {});
|
|
916
|
-
return {
|
|
917
|
-
...newState,
|
|
918
|
-
local
|
|
919
|
-
};
|
|
920
|
-
}
|
|
921
|
-
case "setInnerFormRequiredFields": {
|
|
922
|
-
/**
|
|
923
|
-
* This sets the requiredFields in a single form.
|
|
924
|
-
* Ideally this should not be used anywhere, as this goes against the idea of having all
|
|
925
|
-
* the rules of calculating requiredFields in a single place. keeping this in case we have
|
|
926
|
-
* any exceptional scenarios where this would be required. Can be removed once all forms
|
|
927
|
-
* migrated to useMultiform
|
|
928
|
-
*/
|
|
929
|
-
if (!innerFormFields || !formName) return state;
|
|
930
|
-
const requiredFields = {
|
|
931
|
-
...clonedState.requiredFields,
|
|
932
|
-
[formName]: innerFormFields
|
|
933
|
-
};
|
|
934
|
-
const defaultState = init({
|
|
935
|
-
requiredFields,
|
|
936
|
-
defaultData,
|
|
937
|
-
fieldProblems: clonedState.fieldProblems,
|
|
938
|
-
obscuredFields,
|
|
939
|
-
optionalFields,
|
|
940
|
-
trustedFields,
|
|
941
|
-
staticValidate,
|
|
942
|
-
data: defaultData
|
|
943
|
-
});
|
|
944
|
-
const removedFields = clonedState.optionalFields?.[formName].length ? [...(clonedState.requiredFields?.[formName] ?? []).filter((field) => !innerFormFields.includes(field)), ...clonedState.optionalFields[formName].filter((field) => !optionalFields?.[formName].includes(field))] : clonedState.requiredFields?.[formName].filter((field) => !innerFormFields.includes(field));
|
|
945
|
-
const newFields = optionalFields?.[formName].length ? [...innerFormFields.filter((field) => !clonedState.requiredFields?.[formName].includes(field)), ...(optionalFields[formName] ?? []).filter((field) => !clonedState.optionalFields?.[formName].includes(field))] : innerFormFields.filter((field) => !clonedState.requiredFields?.[formName].includes(field));
|
|
946
|
-
const formLocal = {
|
|
947
|
-
data: omitKeys(clonedState.data?.[formName], newFields),
|
|
948
|
-
errors: omitKeys(clonedState.errors?.[formName], newFields),
|
|
949
|
-
valid: omitKeys(clonedState.valid?.[formName], newFields),
|
|
950
|
-
fieldProblems: omitKeys(clonedState.fieldProblems?.[formName], newFields)
|
|
951
|
-
};
|
|
952
|
-
const local = {
|
|
953
|
-
...clonedState.local,
|
|
954
|
-
[formName]: formLocal
|
|
955
|
-
};
|
|
956
|
-
const updatedFormData = addKeys(omitKeys(clonedState.data?.[formName], removedFields), newFields, null, defaultState.data?.[formName], clonedState.local?.[formName].data);
|
|
957
|
-
const updatedData = {
|
|
958
|
-
...clonedState.data,
|
|
959
|
-
[formName]: updatedFormData
|
|
960
|
-
};
|
|
961
|
-
const updatedFormValidity = addKeys(omitKeys(clonedState.valid?.[formName], removedFields), newFields, false, defaultState.valid?.[formName], clonedState.local?.[formName].valid);
|
|
962
|
-
const updatedValidity = {
|
|
963
|
-
...clonedState.valid,
|
|
964
|
-
[formName]: updatedFormValidity
|
|
965
|
-
};
|
|
966
|
-
const updatedFormErrors = addKeys(omitKeys(clonedState.errors?.[formName], removedFields), newFields, null, defaultState.errors?.[formName], clonedState.local?.[formName].errors);
|
|
967
|
-
const updatedErrors = {
|
|
968
|
-
...clonedState.errors,
|
|
969
|
-
[formName]: updatedFormErrors
|
|
970
|
-
};
|
|
971
|
-
const updatedFormFieldProblems = addKeys(omitKeys(clonedState.fieldProblems?.[formName], removedFields), newFields, false, defaultState.fieldProblems?.[formName], clonedState.local?.[formName].fieldProblems);
|
|
972
|
-
return {
|
|
973
|
-
requiredFields,
|
|
974
|
-
data: updatedData,
|
|
975
|
-
valid: updatedValidity,
|
|
976
|
-
errors: updatedErrors,
|
|
977
|
-
fieldProblems: {
|
|
978
|
-
...clonedState.fieldProblems,
|
|
979
|
-
[formName]: updatedFormFieldProblems
|
|
980
|
-
},
|
|
981
|
-
asyncErrors: clonedState.asyncErrors,
|
|
982
|
-
optionalFields,
|
|
983
|
-
trustedFields,
|
|
984
|
-
local,
|
|
985
|
-
defaultData
|
|
986
|
-
};
|
|
987
|
-
}
|
|
988
|
-
case "updateField": {
|
|
989
|
-
/**
|
|
990
|
-
* Called when a field value changes in form
|
|
991
|
-
* Validates the field and updates data, validity, error in the state for the field
|
|
992
|
-
*/
|
|
993
|
-
if (!key || !mode || !formName) return state;
|
|
994
|
-
const updatedData = {
|
|
995
|
-
...clonedState.data,
|
|
996
|
-
[formName]: {
|
|
997
|
-
...clonedState.data?.[formName],
|
|
998
|
-
[key]: value
|
|
999
|
-
}
|
|
1000
|
-
};
|
|
1001
|
-
/**
|
|
1002
|
-
* Wipe async errors for the field if value has been changed
|
|
1003
|
-
*/
|
|
1004
|
-
const updatedAsyncErrors = hasValueChanged(value, clonedState.data?.[formName]?.[key]) ? {
|
|
1005
|
-
...clonedState.asyncErrors,
|
|
1006
|
-
[formName]: {
|
|
1007
|
-
...clonedState.asyncErrors?.[formName],
|
|
1008
|
-
[key]: null
|
|
1009
|
-
}
|
|
1010
|
-
} : clonedState.asyncErrors;
|
|
1011
|
-
const [formattedValue, validation] = processField({
|
|
1012
|
-
key,
|
|
1013
|
-
value,
|
|
1014
|
-
mode,
|
|
1015
|
-
formName,
|
|
1016
|
-
defaultData: defaultData?.[formName],
|
|
1017
|
-
data: updatedData,
|
|
1018
|
-
formatters: formatters?.[formName],
|
|
1019
|
-
fieldContext: { state: {
|
|
1020
|
-
data: clonedState.data?.[formName],
|
|
1021
|
-
obscuredFields: obscuredFields?.[formName],
|
|
1022
|
-
optionalFields: optionalFields?.[formName],
|
|
1023
|
-
trustedFields: trustedFields?.[formName],
|
|
1024
|
-
errors: clonedState.errors[formName],
|
|
1025
|
-
valid: clonedState.valid[formName],
|
|
1026
|
-
fieldProblems: clonedState.fieldProblems[formName],
|
|
1027
|
-
asyncErrors: updatedAsyncErrors[formName]
|
|
1028
|
-
} },
|
|
1029
|
-
staticValidate
|
|
1030
|
-
});
|
|
1031
|
-
const clearFieldProblems = (clonedState.data?.[formName])?.[key] !== formattedValue;
|
|
1032
|
-
return {
|
|
1033
|
-
...clonedState,
|
|
1034
|
-
data: {
|
|
1035
|
-
...clonedState.data,
|
|
1036
|
-
[formName]: {
|
|
1037
|
-
...clonedState.data?.[formName],
|
|
1038
|
-
[key]: formattedValue
|
|
1039
|
-
}
|
|
1040
|
-
},
|
|
1041
|
-
asyncErrors: updatedAsyncErrors,
|
|
1042
|
-
errors: {
|
|
1043
|
-
...clonedState.errors,
|
|
1044
|
-
[formName]: {
|
|
1045
|
-
...clonedState.errors[formName],
|
|
1046
|
-
[key]: validation.getError() ?? null
|
|
1047
|
-
}
|
|
1048
|
-
},
|
|
1049
|
-
valid: {
|
|
1050
|
-
...clonedState.valid,
|
|
1051
|
-
[formName]: {
|
|
1052
|
-
...clonedState?.valid?.[formName],
|
|
1053
|
-
[key]: (validation.isValid && !clonedState.fieldProblems?.[formName]?.[key]) ?? false
|
|
1054
|
-
}
|
|
1055
|
-
},
|
|
1056
|
-
fieldProblems: {
|
|
1057
|
-
...clonedState.fieldProblems,
|
|
1058
|
-
[formName]: {
|
|
1059
|
-
...clonedState.fieldProblems[formName],
|
|
1060
|
-
...!clearFieldProblems && clonedState.fieldProblems?.[formName]?.[key] ? { [key]: true } : {}
|
|
1061
|
-
}
|
|
1062
|
-
}
|
|
1063
|
-
};
|
|
1064
|
-
}
|
|
1065
|
-
case "validateForm": {
|
|
1066
|
-
/**
|
|
1067
|
-
* Called when triggerValidation('formName') is called, validates all the fields in the form
|
|
1068
|
-
* and populates the errors in the state
|
|
1069
|
-
*/
|
|
1070
|
-
if (!formName) return state;
|
|
1071
|
-
const formFields = clonedState.requiredFields?.[formName];
|
|
1072
|
-
if (!formFields) return state;
|
|
1073
|
-
const formState = (selectedSchema || formFields).reduce((acc, field) => {
|
|
1074
|
-
const formData = clonedState.data?.[formName];
|
|
1075
|
-
const [formattedValue, validation] = processField({
|
|
1076
|
-
key: field,
|
|
1077
|
-
mode: "blur",
|
|
1078
|
-
value: formData?.[field] ?? null,
|
|
1079
|
-
formName,
|
|
1080
|
-
defaultData: defaultData?.[formName],
|
|
1081
|
-
data: clonedState.data,
|
|
1082
|
-
formatters: formatters?.[formName],
|
|
1083
|
-
fieldContext: { state: {
|
|
1084
|
-
data: clonedState.data?.[formName],
|
|
1085
|
-
obscuredFields: obscuredFields?.[formName],
|
|
1086
|
-
optionalFields: optionalFields?.[formName],
|
|
1087
|
-
trustedFields: trustedFields?.[formName],
|
|
1088
|
-
errors: clonedState.errors[formName],
|
|
1089
|
-
valid: clonedState.valid[formName],
|
|
1090
|
-
fieldProblems: clonedState.fieldProblems[formName],
|
|
1091
|
-
asyncErrors: clonedState.asyncErrors[formName]
|
|
1092
|
-
} },
|
|
1093
|
-
staticValidate
|
|
1094
|
-
});
|
|
1095
|
-
const clearFieldProblems = (clonedState?.data?.[formName])?.[field] !== formattedValue;
|
|
1096
|
-
const fieldAsyncValidationResult = asyncValidationResults?.[field];
|
|
1097
|
-
return {
|
|
1098
|
-
data: formData,
|
|
1099
|
-
asyncErrors: {
|
|
1100
|
-
...acc.asyncErrors,
|
|
1101
|
-
[field]: fieldAsyncValidationResult?.getError() ?? null
|
|
1102
|
-
},
|
|
1103
|
-
errors: {
|
|
1104
|
-
...acc.errors,
|
|
1105
|
-
[field]: validation.getError() ?? fieldAsyncValidationResult?.getError() ?? null
|
|
1106
|
-
},
|
|
1107
|
-
valid: {
|
|
1108
|
-
...acc.valid,
|
|
1109
|
-
[field]: validation.isValid && (fieldAsyncValidationResult?.isValid ?? true) && !clonedState.fieldProblems[formName][field]
|
|
1110
|
-
},
|
|
1111
|
-
fieldProblems: {
|
|
1112
|
-
...acc.fieldProblems,
|
|
1113
|
-
...!clearFieldProblems && acc.fieldProblems?.[field] ? { [field]: true } : {}
|
|
1114
|
-
}
|
|
1115
|
-
};
|
|
1116
|
-
}, {});
|
|
1117
|
-
return {
|
|
1118
|
-
...clonedState,
|
|
1119
|
-
errors: {
|
|
1120
|
-
...clonedState.errors,
|
|
1121
|
-
[formName]: formState.errors
|
|
1122
|
-
},
|
|
1123
|
-
asyncErrors: {
|
|
1124
|
-
...clonedState.asyncErrors,
|
|
1125
|
-
[formName]: formState.asyncErrors
|
|
1126
|
-
},
|
|
1127
|
-
valid: {
|
|
1128
|
-
...clonedState.valid,
|
|
1129
|
-
[formName]: formState.valid
|
|
1130
|
-
},
|
|
1131
|
-
fieldProblems: {
|
|
1132
|
-
...clonedState.fieldProblems,
|
|
1133
|
-
[formName]: formState.fieldProblems
|
|
1134
|
-
}
|
|
1135
|
-
};
|
|
1136
|
-
}
|
|
1137
|
-
default: throw new Error("Undefined useForm action");
|
|
1138
|
-
}
|
|
1139
|
-
};
|
|
1140
|
-
}
|
|
1141
|
-
//#endregion
|
|
1142
|
-
//#region src/hooks/useMultiForm/useMultiFormAsyncValidator.ts
|
|
1143
|
-
var logger$1 = createLogger();
|
|
1144
|
-
/**
|
|
1145
|
-
* Returns
|
|
1146
|
-
* - triggerAsyncValidation function which can execute the async validation for a field and populate the sync validation results
|
|
1147
|
-
* - asyncValidationResult state which keeps track of async validations of all fields.
|
|
1148
|
-
* @param asyncRules
|
|
1149
|
-
*/
|
|
1150
|
-
var useMultiFormAsyncValidator = (asyncRules) => {
|
|
1151
|
-
const validResult = {
|
|
1152
|
-
isValid: true,
|
|
1153
|
-
hasError: false
|
|
1154
|
-
};
|
|
1155
|
-
const triggerAsyncValidation = useCallback$1(async (field, formName, data) => {
|
|
1156
|
-
if (!asyncRules) return new ValidationResult([validResult]);
|
|
1157
|
-
const rule = typeof asyncRules === "function" ? asyncRules(data)[formName]?.[field] : asyncRules[formName][field];
|
|
1158
|
-
const value = data?.[formName]?.[field];
|
|
1159
|
-
if (!rule || !value) return new ValidationResult([validResult]);
|
|
1160
|
-
const isValid = await rule.asyncValidate(value).catch(logger$1.error);
|
|
1161
|
-
if (isValid === false) return new ValidationResult([{
|
|
1162
|
-
isValid,
|
|
1163
|
-
errorMessage: typeof rule.errorMessage === "function" ? rule.errorMessage(value) : rule.errorMessage,
|
|
1164
|
-
hasError: !isValid
|
|
1165
|
-
}]);
|
|
1166
|
-
return new ValidationResult([validResult]);
|
|
1167
|
-
}, [asyncRules]);
|
|
1168
|
-
const triggerAsyncFormValidation = async (formName, state, selectedSchema) => {
|
|
1169
|
-
const fields = selectedSchema ?? state.requiredFields?.[formName];
|
|
1170
|
-
if (!fields?.length) return { isValid: true };
|
|
1171
|
-
const asyncValidationResults = await fields.reduce(async (accPromise, fieldName) => {
|
|
1172
|
-
const acc = await accPromise;
|
|
1173
|
-
const asyncValidationResult = await triggerAsyncValidation(fieldName, formName, state.data);
|
|
1174
|
-
return {
|
|
1175
|
-
...acc,
|
|
1176
|
-
[fieldName]: asyncValidationResult
|
|
1177
|
-
};
|
|
1178
|
-
}, Promise.resolve({}));
|
|
1179
|
-
const isValid = Object.values(asyncValidationResults).every((validationResult) => validationResult.isValid);
|
|
1180
|
-
return {
|
|
1181
|
-
...asyncValidationResults,
|
|
1182
|
-
isValid
|
|
1183
|
-
};
|
|
1184
|
-
};
|
|
1185
|
-
return { triggerAsyncFormValidation };
|
|
1186
|
-
};
|
|
1187
|
-
//#endregion
|
|
1188
|
-
//#region src/utils/validation/commonValidators.ts
|
|
1189
|
-
var isTruthyValidator = {
|
|
1190
|
-
validate: (value) => !!value,
|
|
1191
|
-
modes: ["blur"],
|
|
1192
|
-
errorMessage: "fieldIsRequired"
|
|
1193
|
-
};
|
|
1194
|
-
var isNotEmptyValidator = {
|
|
1195
|
-
validate: (value) => !isEmpty(value),
|
|
1196
|
-
modes: ["blur"],
|
|
1197
|
-
errorMessage: "fieldIsRequired"
|
|
1198
|
-
};
|
|
1199
|
-
//#endregion
|
|
1200
|
-
//#region src/hooks/useMultiForm/useMultiFormStaticValidator.ts
|
|
1201
|
-
var useMultiFormStaticValidator = (rules) => {
|
|
1202
|
-
const getRulesForField = useCallback$1((field, form, data) => {
|
|
1203
|
-
const fallbackRule = {
|
|
1204
|
-
validate: () => true,
|
|
1205
|
-
modes: ["blur", "input"]
|
|
1206
|
-
};
|
|
1207
|
-
if (!form) return [fallbackRule];
|
|
1208
|
-
const fieldRules = typeof rules === "function" ? rules(data)?.[form]?.[field] ?? [fallbackRule] : rules?.[form]?.[field] ?? [fallbackRule];
|
|
1209
|
-
return Array.isArray(fieldRules) ? fieldRules : [fieldRules];
|
|
1210
|
-
}, [rules]);
|
|
1211
|
-
return { triggerStaticValidation: useCallback$1(({ key, value, mode = "blur", formName }, data, context) => {
|
|
1212
|
-
const fieldRules = getRulesForField(key, formName, data);
|
|
1213
|
-
const isFieldOptional = !!context?.state.optionalFields?.includes(key);
|
|
1214
|
-
const isFieldObscured = !!context?.state.obscuredFields?.includes(key);
|
|
1215
|
-
if (!isFieldOptional) fieldRules.unshift(isNotEmptyValidator);
|
|
1216
|
-
return new ValidationResult(fieldRules.map((rule) => {
|
|
1217
|
-
const shouldValidate = rule.modes.includes(mode) && !isFieldObscured;
|
|
1218
|
-
const isValid = isFieldOptional && isEmpty(value) ? true : rule.validate(value, context);
|
|
1219
|
-
return {
|
|
1220
|
-
isValid,
|
|
1221
|
-
errorMessage: typeof rule.errorMessage === "function" ? rule.errorMessage(value, context) : rule.errorMessage,
|
|
1222
|
-
hasError: shouldValidate && !isValid
|
|
1223
|
-
};
|
|
1224
|
-
}));
|
|
1225
|
-
}, [getRulesForField]) };
|
|
1226
|
-
};
|
|
1227
|
-
//#endregion
|
|
1228
|
-
//#region src/hooks/useMultiForm/useMultiForm.ts
|
|
1229
|
-
function useMultiForm({ defaultData, rules, asyncRules, fieldProblems, allFields, requiredFields, obscuredFields, optionalFields, trustedFields, formatters }) {
|
|
1230
|
-
const { triggerStaticValidation } = useMultiFormStaticValidator(rules);
|
|
1231
|
-
const { triggerAsyncFormValidation } = useMultiFormAsyncValidator(asyncRules);
|
|
1232
|
-
const getRequiredFields = useMemo$1(() => typeof requiredFields === "function" ? requiredFields : () => requiredFields, [requiredFields]);
|
|
1233
|
-
const getSchema = useMemo$1(() => getRequiredFields(defaultData), [defaultData, getRequiredFields]);
|
|
1234
|
-
const getReducer = useCallback$1(() => reducer({
|
|
1235
|
-
staticValidate: triggerStaticValidation,
|
|
1236
|
-
defaultData,
|
|
1237
|
-
obscuredFields,
|
|
1238
|
-
optionalFields,
|
|
1239
|
-
trustedFields,
|
|
1240
|
-
formatters
|
|
1241
|
-
}), [
|
|
1242
|
-
triggerStaticValidation,
|
|
1243
|
-
obscuredFields,
|
|
1244
|
-
optionalFields,
|
|
1245
|
-
trustedFields,
|
|
1246
|
-
formatters,
|
|
1247
|
-
defaultData
|
|
1248
|
-
]);
|
|
1249
|
-
const initialData = useMemo$1(() => ({
|
|
1250
|
-
requiredFields: getSchema,
|
|
1251
|
-
defaultData,
|
|
1252
|
-
fieldProblems,
|
|
1253
|
-
obscuredFields,
|
|
1254
|
-
optionalFields,
|
|
1255
|
-
trustedFields,
|
|
1256
|
-
formatters,
|
|
1257
|
-
staticValidate: triggerStaticValidation,
|
|
1258
|
-
data: defaultData
|
|
1259
|
-
}), [
|
|
1260
|
-
getSchema,
|
|
1261
|
-
defaultData,
|
|
1262
|
-
fieldProblems,
|
|
1263
|
-
obscuredFields,
|
|
1264
|
-
optionalFields,
|
|
1265
|
-
trustedFields,
|
|
1266
|
-
formatters,
|
|
1267
|
-
triggerStaticValidation
|
|
1268
|
-
]);
|
|
1269
|
-
const [state, dispatch] = useReducer(getReducer(), initialData, init);
|
|
1270
|
-
const isValid = useMemo$1(() => {
|
|
1271
|
-
const formsForOptionalFields = Object.keys(state.optionalFields ?? {});
|
|
1272
|
-
const formsForRequiredFields = Object.keys(state.requiredFields ?? {});
|
|
1273
|
-
return Array.from(new Set([...formsForOptionalFields, ...formsForRequiredFields])).reduce((acc, formName) => {
|
|
1274
|
-
const form = formName;
|
|
1275
|
-
const optionalsFormFields = state.optionalFields?.[form] ?? [];
|
|
1276
|
-
const requiredFormFields = state.requiredFields?.[form] ?? [];
|
|
1277
|
-
const formFields = [...optionalsFormFields, ...requiredFormFields];
|
|
1278
|
-
const formValidity = state.valid[formName] ?? {};
|
|
1279
|
-
return {
|
|
1280
|
-
...acc,
|
|
1281
|
-
[formName]: Object.entries(formValidity)?.every(([field, valid]) => formFields.includes(field) ? valid : true)
|
|
1282
|
-
};
|
|
1283
|
-
}, {});
|
|
1284
|
-
}, [state.requiredFields, state.valid]);
|
|
1285
|
-
const getTargetValue = useCallback$1((formName, key, e) => {
|
|
1286
|
-
if (!e?.target) return e;
|
|
1287
|
-
if (e.target.type === "checkbox") return !state.data?.[formName][key];
|
|
1288
|
-
return e.target.value;
|
|
1289
|
-
}, [state.data]);
|
|
1290
|
-
const setErrors = useCallback$1((formName, key, value) => {
|
|
1291
|
-
dispatch({
|
|
1292
|
-
type: "setErrors",
|
|
1293
|
-
key,
|
|
1294
|
-
value,
|
|
1295
|
-
formName
|
|
1296
|
-
});
|
|
1297
|
-
}, []);
|
|
1298
|
-
const setValid = useCallback$1((formName, key, value) => {
|
|
1299
|
-
dispatch({
|
|
1300
|
-
type: "setValid",
|
|
1301
|
-
key,
|
|
1302
|
-
value,
|
|
1303
|
-
formName
|
|
1304
|
-
});
|
|
1305
|
-
}, []);
|
|
1306
|
-
const setData = useCallback$1((formName, key, value) => {
|
|
1307
|
-
dispatch({
|
|
1308
|
-
type: "setData",
|
|
1309
|
-
key,
|
|
1310
|
-
value,
|
|
1311
|
-
formName
|
|
1312
|
-
});
|
|
1313
|
-
}, []);
|
|
1314
|
-
const setFormData = useCallback$1((formName, formData) => {
|
|
1315
|
-
dispatch({
|
|
1316
|
-
type: "setFormData",
|
|
1317
|
-
formName,
|
|
1318
|
-
formData
|
|
1319
|
-
});
|
|
1320
|
-
}, []);
|
|
1321
|
-
const handleChangeFor = useCallback$1((formName, key, mode = "blur") => (e) => {
|
|
1322
|
-
dispatch({
|
|
1323
|
-
type: "updateField",
|
|
1324
|
-
key,
|
|
1325
|
-
value: getTargetValue(formName, key, e),
|
|
1326
|
-
mode,
|
|
1327
|
-
formName
|
|
1328
|
-
});
|
|
1329
|
-
}, [getTargetValue]);
|
|
1330
|
-
const triggerValidation = useCallback$1(async (formName, selectedSchema) => {
|
|
1331
|
-
const asyncValidationResults = await triggerAsyncFormValidation(formName, state, selectedSchema);
|
|
1332
|
-
dispatch({
|
|
1333
|
-
type: "validateForm",
|
|
1334
|
-
formName,
|
|
1335
|
-
selectedSchema,
|
|
1336
|
-
asyncValidationResults
|
|
1337
|
-
});
|
|
1338
|
-
return asyncValidationResults.isValid;
|
|
1339
|
-
}, [state, triggerAsyncFormValidation]);
|
|
1340
|
-
const resetToDefaultData = useCallback$1(() => {
|
|
1341
|
-
if (!getSchema) return;
|
|
1342
|
-
Object.entries(getSchema).forEach(([formName]) => {
|
|
1343
|
-
const form = formName;
|
|
1344
|
-
const formData = defaultData?.[form];
|
|
1345
|
-
getSchema[form].forEach((field) => {
|
|
1346
|
-
if (!formData || typeof formData[field] !== "undefined") {
|
|
1347
|
-
handleChangeFor(form, field)(formData);
|
|
1348
|
-
return;
|
|
1349
|
-
}
|
|
1350
|
-
setValid(form, field, false);
|
|
1351
|
-
setErrors(form, field, null);
|
|
1352
|
-
setData(form, field, formData[field]);
|
|
1353
|
-
});
|
|
1354
|
-
});
|
|
1355
|
-
}, [
|
|
1356
|
-
defaultData,
|
|
1357
|
-
getSchema,
|
|
1358
|
-
handleChangeFor,
|
|
1359
|
-
setData,
|
|
1360
|
-
setErrors,
|
|
1361
|
-
setValid
|
|
1362
|
-
]);
|
|
1363
|
-
useEffect$1(() => {
|
|
1364
|
-
const requiredFields = getRequiredFields(state.data);
|
|
1365
|
-
if (!requiredFields) return;
|
|
1366
|
-
dispatch({
|
|
1367
|
-
type: "setRequiredFields",
|
|
1368
|
-
requiredFields,
|
|
1369
|
-
defaultData,
|
|
1370
|
-
optionalFields
|
|
1371
|
-
});
|
|
1372
|
-
}, [
|
|
1373
|
-
getRequiredFields,
|
|
1374
|
-
state.data,
|
|
1375
|
-
defaultData,
|
|
1376
|
-
optionalFields
|
|
1377
|
-
]);
|
|
1378
|
-
return {
|
|
1379
|
-
setData,
|
|
1380
|
-
setFormData,
|
|
1381
|
-
setValid,
|
|
1382
|
-
setErrors,
|
|
1383
|
-
handleChangeFor,
|
|
1384
|
-
triggerValidation,
|
|
1385
|
-
resetToDefaultData,
|
|
1386
|
-
isValid,
|
|
1387
|
-
allFields,
|
|
1388
|
-
requiredFields: state.requiredFields,
|
|
1389
|
-
optionalFields: state.optionalFields,
|
|
1390
|
-
trustedFields: state.trustedFields,
|
|
1391
|
-
obscuredFields: state.obscuredFields,
|
|
1392
|
-
valid: state.valid,
|
|
1393
|
-
errors: state.errors,
|
|
1394
|
-
data: state.data,
|
|
1395
|
-
fieldProblems: state.fieldProblems,
|
|
1396
|
-
defaultData,
|
|
1397
|
-
asyncErrors: state.asyncErrors
|
|
1398
|
-
};
|
|
1399
|
-
}
|
|
1400
|
-
//#endregion
|
|
1401
|
-
//#region src/context/FormRouterContext/FormRouterContextProvider.tsx
|
|
1402
|
-
var logger = createLogger();
|
|
1403
|
-
function FormRouterContextProvider({ children, forms, setFormIndex, goToFormByFormId }) {
|
|
1404
|
-
const fieldActionsRef = useRef$1({});
|
|
1405
|
-
const registerFieldAction = useCallback$1((fieldName, action) => {
|
|
1406
|
-
fieldActionsRef.current[fieldName] = action;
|
|
1407
|
-
}, []);
|
|
1408
|
-
const unregisterFieldAction = useCallback$1((fieldName) => {
|
|
1409
|
-
delete fieldActionsRef.current[fieldName];
|
|
1410
|
-
}, []);
|
|
1411
|
-
const getFieldAction = useCallback$1((fieldName) => {
|
|
1412
|
-
return fieldActionsRef.current[fieldName];
|
|
1413
|
-
}, []);
|
|
1414
|
-
const contextValue = useMemo$1(() => ({
|
|
1415
|
-
setFormIndex,
|
|
1416
|
-
goToFormByFormId,
|
|
1417
|
-
goToFormByFieldName: (fieldName) => {
|
|
1418
|
-
if (fieldName === "idDocument") fieldName = "idVerificationMethod";
|
|
1419
|
-
const formIndex = forms.findIndex((form) => form?.fields?.some((field) => field === fieldName));
|
|
1420
|
-
if (formIndex > -1) setFormIndex(formIndex);
|
|
1421
|
-
else logger.error("No form was found to have that field so form navigation failed.");
|
|
1422
|
-
},
|
|
1423
|
-
registerFieldAction,
|
|
1424
|
-
unregisterFieldAction,
|
|
1425
|
-
getFieldAction
|
|
1426
|
-
}), [
|
|
1427
|
-
setFormIndex,
|
|
1428
|
-
goToFormByFormId,
|
|
1429
|
-
registerFieldAction,
|
|
1430
|
-
unregisterFieldAction,
|
|
1431
|
-
getFieldAction,
|
|
1432
|
-
forms
|
|
1433
|
-
]);
|
|
1434
|
-
return /* @__PURE__ */ jsx(FormRouterContext.Provider, {
|
|
1435
|
-
value: contextValue,
|
|
1436
|
-
children
|
|
1437
|
-
});
|
|
1438
|
-
}
|
|
1439
|
-
var FormFlow_module_default = {
|
|
1440
|
-
"form-flow": "_form-flow_lhddu_1",
|
|
1441
|
-
formFlow: "_form-flow_lhddu_1",
|
|
1442
|
-
"form-flow-content": "_form-flow-content_lhddu_9",
|
|
1443
|
-
formFlowContent: "_form-flow-content_lhddu_9",
|
|
1444
|
-
"form-flow-footer": "_form-flow-footer_lhddu_30",
|
|
1445
|
-
formFlowFooter: "_form-flow-footer_lhddu_30",
|
|
1446
|
-
"form-flow-footer-border": "_form-flow-footer-border_lhddu_45",
|
|
1447
|
-
formFlowFooterBorder: "_form-flow-footer-border_lhddu_45",
|
|
1448
|
-
"form-flow-actions": "_form-flow-actions_lhddu_49",
|
|
1449
|
-
formFlowActions: "_form-flow-actions_lhddu_49",
|
|
1450
|
-
"form-flow-primary-actions": "_form-flow-primary-actions_lhddu_56",
|
|
1451
|
-
formFlowPrimaryActions: "_form-flow-primary-actions_lhddu_56"
|
|
1452
|
-
};
|
|
1453
|
-
//#endregion
|
|
1454
|
-
//#region src/components/Shared/FormFlow/FormFlow.tsx
|
|
1455
|
-
var FormFlow = ({ asModal = false, children, currentStep = 0, disableBackButton, disableNextButton, nextButtonLoading = false, forms, activeForm, gotoFormByFormIndex, gotoFormByFormId, handleBackClick, handleCancelClick, handleNextClick, loadingStatus, summary, summaryComponent, totalSteps = 1, isGlobalEntry = false }) => {
|
|
1456
|
-
const contentRef = useRef$1(null);
|
|
1457
|
-
const userEvents = useAnalyticsContext();
|
|
1458
|
-
const { t } = useTranslation("common");
|
|
1459
|
-
const [isConfirmPresented, setIsConfirmPresented] = useState$1(false);
|
|
1460
|
-
const [isSubmitting, setIsSubmitting] = useState$1(false);
|
|
1461
|
-
const isActionDisabled = isSubmitting || isConfirmPresented || loadingStatus === "loading";
|
|
1462
|
-
const hasBackButton = !!handleBackClick;
|
|
1463
|
-
const hasCancelButton = !!handleCancelClick;
|
|
1464
|
-
const isFirstStep = currentStep === 0;
|
|
1465
|
-
const isLastStep = currentStep === totalSteps - 1;
|
|
1466
|
-
const isSingleStepForm = totalSteps < 2;
|
|
1467
|
-
const progress = Math.floor(currentStep / (totalSteps - 1) * 100);
|
|
1468
|
-
const scrollToTop = () => {
|
|
1469
|
-
if (contentRef.current) contentRef.current.scroll({
|
|
1470
|
-
top: 0,
|
|
1471
|
-
behavior: "smooth"
|
|
1472
|
-
});
|
|
1473
|
-
};
|
|
1474
|
-
const handleSubmit = () => {
|
|
1475
|
-
setIsSubmitting(true);
|
|
1476
|
-
Promise.resolve(handleNextClick()).then(() => {
|
|
1477
|
-
setIsSubmitting(false);
|
|
1478
|
-
scrollToTop();
|
|
1479
|
-
});
|
|
1480
|
-
};
|
|
1481
|
-
const handleNext = () => {
|
|
1482
|
-
scrollToTop();
|
|
1483
|
-
handleNextClick();
|
|
1484
|
-
};
|
|
1485
|
-
const handleBack = () => {
|
|
1486
|
-
scrollToTop();
|
|
1487
|
-
handleBackClick?.();
|
|
1488
|
-
};
|
|
1489
|
-
const handleDismiss = () => {
|
|
1490
|
-
if (!hasCancelButton) return;
|
|
1491
|
-
setIsConfirmPresented(true);
|
|
1492
|
-
};
|
|
1493
|
-
const handleCancelDismiss = () => {
|
|
1494
|
-
userEvents.addPageEvent("Closed modal", {
|
|
1495
|
-
actionType: "close",
|
|
1496
|
-
label: "cancel"
|
|
1497
|
-
});
|
|
1498
|
-
setIsConfirmPresented(false);
|
|
1499
|
-
};
|
|
1500
|
-
const handleConfirmDismiss = () => {
|
|
1501
|
-
userEvents.addPageEvent("Clicked button", {
|
|
1502
|
-
actionType: "navigate",
|
|
1503
|
-
label: "leave"
|
|
1504
|
-
});
|
|
1505
|
-
setIsConfirmPresented(false);
|
|
1506
|
-
handleCancelClick?.();
|
|
1507
|
-
};
|
|
1508
|
-
const footerClassName = cx(FormFlow_module_default.formFlowFooter, { [FormFlow_module_default.formFlowFooterBorder]: isSingleStepForm });
|
|
1509
|
-
return /* @__PURE__ */ jsxs(MaybeModal, {
|
|
1510
|
-
inline: !asModal,
|
|
1511
|
-
onClose: handleDismiss,
|
|
1512
|
-
size: "large",
|
|
1513
|
-
showCloseButton: hasCancelButton,
|
|
1514
|
-
children: [/* @__PURE__ */ jsxs("div", {
|
|
1515
|
-
ref: contentRef,
|
|
1516
|
-
className: FormFlow_module_default.formFlow,
|
|
1517
|
-
"data-form-valid": activeForm.isValid,
|
|
1518
|
-
"data-testid": "form-flow",
|
|
1519
|
-
children: [/* @__PURE__ */ jsx("div", {
|
|
1520
|
-
className: FormFlow_module_default.formFlowContent,
|
|
1521
|
-
children: /* @__PURE__ */ jsx(LoaderWrapper, {
|
|
1522
|
-
status: loadingStatus,
|
|
1523
|
-
formOpacityWhenLoading: 0,
|
|
1524
|
-
loaderSize: "large",
|
|
1525
|
-
children: /* @__PURE__ */ jsx(FormRouterContextProvider, {
|
|
1526
|
-
forms,
|
|
1527
|
-
setFormIndex: gotoFormByFormIndex,
|
|
1528
|
-
goToFormByFormId: gotoFormByFormId,
|
|
1529
|
-
children: isLastStep ? summaryComponent ? summaryComponent : summary !== void 0 ? /* @__PURE__ */ jsx(Summary, {
|
|
1530
|
-
...summary,
|
|
1531
|
-
forms,
|
|
1532
|
-
gotoForm: gotoFormByFormIndex
|
|
1533
|
-
}) : children : children
|
|
1534
|
-
})
|
|
1535
|
-
})
|
|
1536
|
-
}), /* @__PURE__ */ jsxs("div", {
|
|
1537
|
-
className: footerClassName,
|
|
1538
|
-
children: [!isSingleStepForm && /* @__PURE__ */ jsx(ProgressBar, {
|
|
1539
|
-
ariaLabel: t(($) => $["progress"]),
|
|
1540
|
-
progress
|
|
1541
|
-
}), /* @__PURE__ */ jsxs("div", {
|
|
1542
|
-
className: FormFlow_module_default.formFlowActions,
|
|
1543
|
-
children: [
|
|
1544
|
-
isFirstStep && hasCancelButton && /* @__PURE__ */ jsx(Button, {
|
|
1545
|
-
disabled: isActionDisabled || disableBackButton,
|
|
1546
|
-
onClick: handleDismiss,
|
|
1547
|
-
variant: "secondary",
|
|
1548
|
-
children: t(($) => $["cancel"])
|
|
1549
|
-
}),
|
|
1550
|
-
!isFirstStep && hasBackButton && /* @__PURE__ */ jsx(Button, {
|
|
1551
|
-
disabled: isActionDisabled || disableBackButton,
|
|
1552
|
-
icon: "chevron-left",
|
|
1553
|
-
onClick: handleBack,
|
|
1554
|
-
variant: "secondary",
|
|
1555
|
-
children: t(($) => $["back"])
|
|
1556
|
-
}),
|
|
1557
|
-
/* @__PURE__ */ jsx("div", {
|
|
1558
|
-
className: FormFlow_module_default.formFlowPrimaryActions,
|
|
1559
|
-
children: isLastStep && !isGlobalEntry ? /* @__PURE__ */ jsx(Button, {
|
|
1560
|
-
onClick: handleSubmit,
|
|
1561
|
-
loading: isSubmitting,
|
|
1562
|
-
children: t(($) => $["submit"])
|
|
1563
|
-
}) : /* @__PURE__ */ jsx(Button, {
|
|
1564
|
-
onClick: handleNext,
|
|
1565
|
-
disabled: isActionDisabled || disableNextButton,
|
|
1566
|
-
loading: nextButtonLoading,
|
|
1567
|
-
children: t(($) => $["continue"])
|
|
1568
|
-
})
|
|
1569
|
-
})
|
|
1570
|
-
]
|
|
1571
|
-
})]
|
|
1572
|
-
})]
|
|
1573
|
-
}), isConfirmPresented && /* @__PURE__ */ jsx(Confirm, {
|
|
1574
|
-
confirmText: t(($) => $["leave"]),
|
|
1575
|
-
description: t(($) => $["unsavedChangesDescription"]),
|
|
1576
|
-
onCancel: handleCancelDismiss,
|
|
1577
|
-
onConfirm: handleConfirmDismiss,
|
|
1578
|
-
title: t(($) => $["unsavedChanges"])
|
|
1579
|
-
})]
|
|
1580
|
-
});
|
|
1581
|
-
};
|
|
1582
|
-
//#endregion
|
|
1583
|
-
//#region src/utils/dropinUtils.ts
|
|
1584
|
-
/**
|
|
1585
|
-
* @@description Based requiredfields and optionalFields determine what forms need to be shown and add a summaryStep in the dropin
|
|
1586
|
-
*
|
|
1587
|
-
* @param forms
|
|
1588
|
-
* @param requiredFields
|
|
1589
|
-
* @param optionalFields
|
|
1590
|
-
* @param skipSummary
|
|
1591
|
-
*/
|
|
1592
|
-
var getRequiredForms = (forms, requiredFields, optionalFields, skipSummary) => {
|
|
1593
|
-
const reasons = [];
|
|
1594
|
-
const requiredForms = Object.values(forms).filter(({ formId }) => {
|
|
1595
|
-
if (requiredFields || optionalFields) {
|
|
1596
|
-
const hasRequired = Boolean(requiredFields?.[formId]?.length);
|
|
1597
|
-
const hasOptional = Boolean(optionalFields?.[formId]?.length);
|
|
1598
|
-
const isIncluded = hasRequired || hasOptional;
|
|
1599
|
-
const inclusionReasons = [];
|
|
1600
|
-
if (hasRequired) inclusionReasons.push("has required fields");
|
|
1601
|
-
if (hasOptional) inclusionReasons.push("has optional fields");
|
|
1602
|
-
if (isIncluded) reasons.push(`Form '${formId}': INCLUDED (${inclusionReasons.join(" & ")})`);
|
|
1603
|
-
else reasons.push(`Form '${formId}': EXCLUDED (no required or optional fields)`);
|
|
1604
|
-
return isIncluded;
|
|
1605
|
-
}
|
|
1606
|
-
reasons.push(`Form '${formId}': INCLUDED (no required/optional fields check)`);
|
|
1607
|
-
return true;
|
|
1608
|
-
});
|
|
1609
|
-
formDebugInfo.value = {
|
|
1610
|
-
...formDebugInfo.value,
|
|
1611
|
-
__FORMS__: {
|
|
1612
|
-
status: "INFO",
|
|
1613
|
-
reasons
|
|
1614
|
-
}
|
|
1615
|
-
};
|
|
1616
|
-
if (skipSummary) return requiredForms;
|
|
1617
|
-
return [...requiredForms, summaryStep];
|
|
1618
|
-
};
|
|
1619
|
-
/**
|
|
1620
|
-
* @description Based on validity of fields from formValidity and existence of validationErrors/Verification errors from backend determine whether the forms needs to be shown as valid or not
|
|
1621
|
-
*
|
|
1622
|
-
* @param forms
|
|
1623
|
-
* @param formValidity
|
|
1624
|
-
* @param problems
|
|
1625
|
-
*/
|
|
1626
|
-
var addValidityToForms = (forms, formValidity, problems) => forms.map(({ formId, formName, fields }) => ({
|
|
1627
|
-
formId,
|
|
1628
|
-
formName,
|
|
1629
|
-
fields,
|
|
1630
|
-
isValid: formValidity?.[formId] ?? false,
|
|
1631
|
-
hasServerValidationErrors: Boolean(problems?.validationErrors?.[formId])
|
|
1632
|
-
}));
|
|
1633
|
-
//#endregion
|
|
1634
|
-
//#region src/context/FormContext/useFormContext.ts
|
|
1635
|
-
function useFormContext() {
|
|
1636
|
-
return useContext$1(FormContext);
|
|
1637
|
-
}
|
|
1638
|
-
//#endregion
|
|
1639
|
-
//#region src/components/Shared/fields/CountryField/CountryField.tsx
|
|
1640
|
-
var COUNTRY_FIELD = ["country"];
|
|
1641
|
-
function CountryField({ name = "country", data, valid, errors, labels, readonly, handleChangeFor, helperText, allowedCountries, handleBlur }) {
|
|
1642
|
-
const { t } = useTranslation("common");
|
|
1643
|
-
const { dataset: countriesFromApi } = useDataset(datasetIdentifier.country);
|
|
1644
|
-
const countries = useMemo$1(() => countriesFromApi.filter((country) => allowedCountries ? allowedCountries.includes(country.id) : true), [allowedCountries, countriesFromApi]);
|
|
1645
|
-
return /* @__PURE__ */ jsx(Field, {
|
|
1646
|
-
name,
|
|
1647
|
-
label: labels?.country || t(($) => $["country"]),
|
|
1648
|
-
errorMessage: errors.country,
|
|
1649
|
-
isValid: valid.country,
|
|
1650
|
-
helper: helperText,
|
|
1651
|
-
dataTestId: "country",
|
|
1652
|
-
children: (childProps) => /* @__PURE__ */ jsx(Select, {
|
|
1653
|
-
...childProps,
|
|
1654
|
-
name,
|
|
1655
|
-
placeholder: t(($) => $["selectCountryRegion"]),
|
|
1656
|
-
selected: data.country,
|
|
1657
|
-
items: countries,
|
|
1658
|
-
readonly: (countries.length === 1 || readonly) && !!data,
|
|
1659
|
-
onChange: handleChangeFor("country"),
|
|
1660
|
-
onBlur: handleBlur
|
|
1661
|
-
})
|
|
1662
|
-
});
|
|
1663
|
-
}
|
|
1664
|
-
//#endregion
|
|
1665
|
-
//#region src/utils/regex/patternValidators.ts
|
|
1666
|
-
var validateNotEmptyOnBlur = {
|
|
1667
|
-
modes: ["blur"],
|
|
1668
|
-
validate: (val) => !isEmpty(val),
|
|
1669
|
-
errorMessage: "fieldIsRequired"
|
|
1670
|
-
};
|
|
1671
|
-
var validateLegalCompanyName = [
|
|
1672
|
-
{
|
|
1673
|
-
modes: ["blur"],
|
|
1674
|
-
validate: hasText,
|
|
1675
|
-
errorMessage: "fieldIsRequired"
|
|
1676
|
-
},
|
|
1677
|
-
{
|
|
1678
|
-
modes: ["blur"],
|
|
1679
|
-
validate: (input) => !matchesRegex(NO_ALPHABET_REGEX, input),
|
|
1680
|
-
errorMessage: "nameMustContainLetters"
|
|
1681
|
-
},
|
|
1682
|
-
{
|
|
1683
|
-
modes: ["blur"],
|
|
1684
|
-
validate: (input) => !matchesRegex(EMOJI_REGEX, input) && !hasRepeatedCharacters(input) && isValidMinLength(input, 3) && !isInvalidName(input) && matchesRegex(OTHER_ENTITIES_VALID_CHAR_REGEX, input),
|
|
1685
|
-
errorMessage: "checkForTypos"
|
|
1686
|
-
}
|
|
1687
|
-
];
|
|
1688
|
-
var validateJaHaniLegalCompanyName = [
|
|
1689
|
-
{
|
|
1690
|
-
modes: ["blur"],
|
|
1691
|
-
validate: hasText,
|
|
1692
|
-
errorMessage: "fieldIsRequired"
|
|
1693
|
-
},
|
|
1694
|
-
{
|
|
1695
|
-
modes: ["blur"],
|
|
1696
|
-
validate: (input) => standardKanjiValidator(input),
|
|
1697
|
-
errorMessage: "nameMustContainLetters"
|
|
1698
|
-
},
|
|
1699
|
-
{
|
|
1700
|
-
modes: ["blur"],
|
|
1701
|
-
validate: (input) => !matchesRegex(EMOJI_REGEX, input) && !hasRepeatedCharacters(input) && isValidMinLength(input, 3) && !isInvalidName(input) && matchesRegex(OTHER_ENTITIES_VALID_CHAR_REGEX, input),
|
|
1702
|
-
errorMessage: "checkForTypos"
|
|
1703
|
-
}
|
|
1704
|
-
];
|
|
1705
|
-
var validateJaKanaLegalCompanyName = [
|
|
1706
|
-
{
|
|
1707
|
-
modes: ["blur"],
|
|
1708
|
-
validate: hasText,
|
|
1709
|
-
errorMessage: "fieldIsRequired"
|
|
1710
|
-
},
|
|
1711
|
-
{
|
|
1712
|
-
modes: ["blur"],
|
|
1713
|
-
validate: (input) => standardKatakanaValidator(input),
|
|
1714
|
-
errorMessage: "ensureValidFullWidthKatakana"
|
|
1715
|
-
},
|
|
1716
|
-
{
|
|
1717
|
-
modes: ["blur"],
|
|
1718
|
-
validate: (input) => !matchesRegex(EMOJI_REGEX, input) && !hasRepeatedCharacters(input) && isValidMinLength(input, 3) && !isInvalidName(input) && matchesRegex(OTHER_ENTITIES_VALID_CHAR_REGEX, input),
|
|
1719
|
-
errorMessage: "checkForTypos"
|
|
1720
|
-
}
|
|
1721
|
-
];
|
|
1722
|
-
var validateLatinSpaceMarkPunctuationNumbersOnlyOnBlur = {
|
|
1723
|
-
modes: ["blur"],
|
|
1724
|
-
validate: (input) => matchesRegex(LATIN_SPACE_MARK_PUNCTUATION_NUMBERS_REGEX, input),
|
|
1725
|
-
errorMessage: "kanjiAndKanaCharactersAreNotAllowed"
|
|
1726
|
-
};
|
|
1727
|
-
var validatePatternOnBlur = (pattern) => ({
|
|
1728
|
-
modes: ["blur"],
|
|
1729
|
-
validate: (val) => !!val && pattern.test(val)
|
|
1730
|
-
});
|
|
1731
|
-
//#endregion
|
|
1732
|
-
//#region src/components/ui/atoms/Radio/Radio.tsx
|
|
1733
|
-
var Radio = ({ id, value, groupName, checked = false, disabled = false, onClick, className, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy }) => /* @__PURE__ */ jsx("input", {
|
|
1734
|
-
"aria-labelledby": ariaLabelledBy,
|
|
1735
|
-
"aria-describedby": ariaDescribedBy,
|
|
1736
|
-
className: cx(["adyen-kyc-input-radio adyen-kyc-input-radio__input", className]),
|
|
1737
|
-
id,
|
|
1738
|
-
type: "radio",
|
|
1739
|
-
checked,
|
|
1740
|
-
name: groupName,
|
|
1741
|
-
onClick,
|
|
1742
|
-
value,
|
|
1743
|
-
disabled
|
|
1744
|
-
});
|
|
1745
|
-
//#endregion
|
|
1746
|
-
//#region src/components/ui/atoms/RadioWithLabel/RadioWithLabel.tsx
|
|
1747
|
-
var RadioWithLabel = ({ value, label, content, groupName, checked = false, disabled = false, onClick }) => {
|
|
1748
|
-
const id = useId("radio");
|
|
1749
|
-
return /* @__PURE__ */ jsxs("label", {
|
|
1750
|
-
htmlFor: id,
|
|
1751
|
-
className: "adyen-kyc-input-radio",
|
|
1752
|
-
children: [/* @__PURE__ */ jsx(Radio, {
|
|
1753
|
-
id,
|
|
1754
|
-
checked,
|
|
1755
|
-
groupName,
|
|
1756
|
-
onClick,
|
|
1757
|
-
value,
|
|
1758
|
-
disabled
|
|
1759
|
-
}), /* @__PURE__ */ jsxs("div", {
|
|
1760
|
-
className: "adyen-kyc-input-radio__content",
|
|
1761
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
1762
|
-
className: "adyen-kyc-input-radio__label adyen-kyc-label__text",
|
|
1763
|
-
children: label
|
|
1764
|
-
}), content]
|
|
1765
|
-
})]
|
|
1766
|
-
});
|
|
1767
|
-
};
|
|
1768
|
-
//#endregion
|
|
1769
|
-
//#region src/components/ui/atoms/RadioGroup/RadioGroup.tsx
|
|
1770
|
-
function RadioGroup({ items, name, onChange, value, disabled = false, horizontal = false, showContentOnlyOnSelected = false, className, enableTracking = false }) {
|
|
1771
|
-
const { t, i18n } = useTranslation("common");
|
|
1772
|
-
const userEvents = useAnalyticsContext();
|
|
1773
|
-
const handleChange = (id) => {
|
|
1774
|
-
if (enableTracking) userEvents.addFieldEvent("Interacted with form field", {
|
|
1775
|
-
actionType: "input",
|
|
1776
|
-
field: name,
|
|
1777
|
-
returnValue: value
|
|
1778
|
-
});
|
|
1779
|
-
onChange(id);
|
|
1780
|
-
};
|
|
1781
|
-
return /* @__PURE__ */ jsx("div", {
|
|
1782
|
-
className: cx([
|
|
1783
|
-
"adyen-kyc-radio-group",
|
|
1784
|
-
{ "adyen-kyc-radio-group--horizontal": horizontal },
|
|
1785
|
-
className
|
|
1786
|
-
]),
|
|
1787
|
-
children: items.map((item) => {
|
|
1788
|
-
const isSelected = item.id === value;
|
|
1789
|
-
const visibleContent = isSelected || !showContentOnlyOnSelected ? item.content : void 0;
|
|
1790
|
-
const keyExists = i18n.exists?.(item.name, { ns: "common" });
|
|
1791
|
-
return /* @__PURE__ */ jsx(RadioWithLabel, {
|
|
1792
|
-
value: item.id,
|
|
1793
|
-
label: keyExists ? t(($) => $[item.name]) : item.name,
|
|
1794
|
-
content: visibleContent,
|
|
1795
|
-
groupName: name,
|
|
1796
|
-
checked: isSelected,
|
|
1797
|
-
disabled,
|
|
1798
|
-
onClick: () => {
|
|
1799
|
-
handleChange(item.id);
|
|
1800
|
-
}
|
|
1801
|
-
}, item.id);
|
|
1802
|
-
})
|
|
1803
|
-
});
|
|
1804
|
-
}
|
|
1805
|
-
//#endregion
|
|
1806
|
-
export { mergeFieldMetadataIntoProps as A, preTranslatedSummaryItem as C, getRoleTagVariant as D, getRoleName as E, FormContextProvider as M, roleMetadata as O, isSummaryItem as S, Summary_module_default as T, isNotEmptyValidator as _, validateLatinSpaceMarkPunctuationNumbersOnlyOnBlur as a, Summary as b, validatePatternOnBlur as c, useFormContext as d, addValidityToForms as f, useMultiForm as g, FormFlow_module_default as h, validateJaKanaLegalCompanyName as i, trackNavigation as j, createFormUtils as k, COUNTRY_FIELD as l, FormFlow as m, RadioWithLabel as n, validateLegalCompanyName as o, getRequiredForms as p, validateJaHaniLegalCompanyName as r, validateNotEmptyOnBlur as s, RadioGroup as t, CountryField as u, isTruthyValidator as v, summaryItem as w, summaryStep as x, useFormComposer as y };
|