@adyen/kyc-components 4.21.0 → 4.22.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AcceptTermsOfServiceWorkflow-DrB_fPrZ.js → AcceptTermsOfServiceWorkflow-CLA1JNzc.js} +5 -5
- package/dist/{Accordion-DC7Iuj-J.js → Accordion-Cwp-Xc7e.js} +1 -1
- package/dist/{AccountSetupRejected-DoXfDWqU.js → AccountSetupRejected-B2h3LRDZ.js} +1 -1
- package/dist/{AdaptiveWorkflow-J27A0gN7.js → AdaptiveWorkflow-BHooRzh_.js} +17 -17
- package/dist/{AdaptiveWorkflowComponent-D6pqqlwM.js → AdaptiveWorkflowComponent-D1EALddI.js} +54 -54
- package/dist/{AddressField-M0N4sAfl.js → AddressFields-CU23S3JV.js} +108 -173
- package/dist/{Avatar-BKTdqNpO.js → Avatar-BbOb0bui.js} +1 -1
- package/dist/{BusinessFinancingDropin-DemdZ7gf.js → BusinessFinancingDropin-Cc0oB8ka.js} +104 -199
- package/dist/{BusinessFinancingPage-_0QYXpNT.js → BusinessFinancingPage-D0EmBl9D.js} +30 -30
- package/dist/BusinessRegistrationNumberField-c8mvmS4m.js +101 -0
- package/dist/{BusinessRegistrationNumberFieldGroup-C7gU9147.js → BusinessRegistrationNumberFieldGroup-DNZALTo_.js} +5 -6
- package/dist/{BusinessTypeSelectionPage-BDhSt6pA.js → BusinessTypeSelectionPage-CYjrUqoM.js} +13 -13
- package/dist/{Button-DSD_afG_.js → Button-oqvTDztg.js} +1 -1
- package/dist/{Checkbox-Bc98rXHW.js → Checkbox-2Rp9bWYN.js} +1 -1
- package/dist/{ComponentGroup-btCOkWx3.js → ComponentGroup-DbWo8fnI.js} +3 -3
- package/dist/{BusinessRegistrationNumberField-B2_WSs7X.js → ConstitutionalDocument-64rqHz7d.js} +67 -105
- package/dist/{ContactDetails-CtYPAJYy.js → ContactDetails-ucx3UuP8.js} +5 -5
- package/dist/{ContextGuidance-CQ6rdW_a.js → ContextGuidance-CIwiyrm9.js} +2 -2
- package/dist/{Currency-BlBJnPV7.js → Currency-fvQfdQ2i.js} +5 -5
- package/dist/{CustomerSupport-CrCRjZZq.js → CustomerSupport-CHHRYNTG.js} +13 -12
- package/dist/{DataConflictsModal-iMz4Afov.js → DataConflictsModal-BJHJVW3V.js} +6 -6
- package/dist/{DebugModal-BAf5ZU42.js → DebugModal-CptS2b87.js} +10 -10
- package/dist/{DecisionMakerDetails-DX5nw1Co.js → DecisionMakerDetails-a_G8S1S9.js} +12 -12
- package/dist/{DecisionMakerDetailsPage-BJn9whGe.js → DecisionMakerDetailsPage-BsiheWPy.js} +34 -34
- package/dist/{DecisionMakers-C6IDwXGe.js → DecisionMakers-DC3r2UzN.js} +40 -40
- package/dist/{Dropzone-pCIXbO4I.js → Dropzone-CTdbCPiL.js} +7 -7
- package/dist/{EmbeddedStatus-CkSg9-9r.js → EmbeddedStatus-DqanSUWu.js} +3 -3
- package/dist/{EndStateLayout-CarfWtTC.js → EndStateLayout-CRNRpDeu.js} +2 -2
- package/dist/{EntityAssociation-DFnGtIFI.js → EntityAssociation-DqTOqixv.js} +6 -6
- package/dist/{ErrorPanel-ugcZz_Be.js → ErrorPanel-jcVYNW8o.js} +3 -3
- package/dist/GlobalEntryModal-Bwy0lfz2.js +951 -0
- package/dist/{GlobalEntryPage-GK_Vfoub.js → GlobalEntryPage-DPKND7LX.js} +12 -9
- package/dist/{Icon-CurE93CX.js → Icon-BblJeZYj.js} +1 -1
- package/dist/{IdentityNumber-9wipDyP1.js → IdentityNumber-D9t0xamT.js} +5 -5
- package/dist/{IdentityNumberFieldGroup-PyIIIJ0a.js → IdentityNumberFieldGroup-0Ll_77LW.js} +2 -2
- package/dist/{IdentityScreeningWorkflow-DCru4Ax4.js → IdentityScreeningWorkflow-DESXjfuC.js} +13 -13
- package/dist/{Individual.rules-PTvR4V7c.js → Individual.rules-4BHmKpNa.js} +4 -4
- package/dist/{IndividualDropin-odcDbuOv.js → IndividualDropin-CMejkT3R.js} +251 -226
- package/dist/{IndustryCodeFieldGroup-NJw6ULN9.js → IndustryCodeFieldGroup-xFrcCogG.js} +4 -4
- package/dist/InputDate-DMcomeFj.js +211 -0
- package/dist/{InputText-BvrH0bId.js → InputText-BqeL5dXt.js} +3 -3
- package/dist/{Introduction-Cc1kb6ZF.js → Introduction-6WPMkIpx.js} +6 -6
- package/dist/{InvitedDecisionMakerComponent-CqRP9jG_.js → InvitedDecisionMakerComponent-w0xQxDgC.js} +61 -61
- package/dist/{JpAddressFields-gw_fQGFK.js → JpAddressFields-Cic1nSNI.js} +8 -8
- package/dist/{LegalCompanyNameField-BmLuKn05.js → LegalCompanyNameField-Dl60xD84.js} +5 -5
- package/dist/{LegalName-CeRLeIRV.js → LegalName-DDKN6L93.js} +3 -3
- package/dist/{LegalRepresentativeDetailsPage-V35wZbnY.js → LegalRepresentativeDetailsPage-B2ubp7Rb.js} +30 -30
- package/dist/{Link-B-gN0d8l.js → Link-Bb1XDrs1.js} +1 -1
- package/dist/{ListItem-BGdnopqb.js → ListItem-CI4fqIkg.js} +2 -2
- package/dist/{Modal-smcFQS1n.js → Modal-By_wpf9o.js} +3 -3
- package/dist/{Name-CjSRwrBX.js → Name-BpKVUmoY.js} +4 -4
- package/dist/{NewSummary-BBgZk5N5.js → NewSummary-Bmi54FYk.js} +6 -6
- package/dist/{PatriotActDisclosure-DMB5NHHl.js → PatriotActDisclosure-DsZX3cb-.js} +10 -113
- package/dist/{PayoutDetailsDropin-B-hXWFtT.js → PayoutDetailsDropin-BkzjalFb.js} +26 -26
- package/dist/{PayoutDetailsPage-C_lCST-K.js → PayoutDetailsPage-BLbHUm0I.js} +7 -7
- package/dist/{RadioGroup-CdF_CJsU.js → RadioGroup-e6Ty_ggj.js} +12 -19
- package/dist/{Review-D5P6Ac8i.js → Review-BG_iSaAN.js} +6 -6
- package/dist/{RootBusinessDetailsPage-DVI9j8Ml.js → RootBusinessDetailsPage-D6ZEfFr4.js} +30 -30
- package/dist/{RootBusinessLinesPage-W9tYnmw0.js → RootBusinessLinesPage-B6Swhdyx.js} +23 -23
- package/dist/{RootIndividualDetailsPage-DOdcTAg9.js → RootIndividualDetailsPage-2Bu7fbyB.js} +31 -31
- package/dist/{Select-VeoEeZS8.js → Select-CrcaoG0i.js} +6 -6
- package/dist/{SignPCIComponent-NpbyWtsj.js → SignPCIComponent-B4Iz8PXX.js} +38 -38
- package/dist/{SingpassSelection-CYThm6K3.js → SingpassSelection-D2NSiGzi.js} +4 -4
- package/dist/{SoleProprietorshipPage-o0P3YdSD.js → SoleProprietorshipPage-bJ6oea6W.js} +30 -30
- package/dist/{SourceOfFundsPage-CzKXKYUk.js → SourceOfFundsPage-Bu9e93PV.js} +26 -28
- package/dist/{SourceOfFundsWorkflow-qqY2jygF.js → SourceOfFundsWorkflow-CW7McbuG.js} +5 -5
- package/dist/{StateField-Bez_WtWb.js → StateField-BnyUQjAj.js} +49 -34
- package/dist/{Step-Onf402RU.js → Step-CZq7qzCe.js} +9 -13
- package/dist/{Task-DiyDnOz9.js → Task-Jhx4xFyF.js} +11 -11
- package/dist/{TaskGroup-CIR21I_w.js → TaskGroup-CHPDt1lw.js} +3 -3
- package/dist/{TaskListItem-DHIH6gi-.js → TaskListItem-BAHYod3y.js} +10 -10
- package/dist/TaskStepperContextProvider-BtpYUg5S.js +26 -0
- package/dist/{TaskVerificationStatus-DCfFNRJc.js → TaskVerificationStatus-onOyOzoM.js} +1 -1
- package/dist/{TaxInformationFieldGroup-D_wL_Vik.js → TaxInformationFieldGroup-D4bSgrDG.js} +7 -8
- package/dist/{TaxReportingDropin-KSc9a6fn.js → TaxReportingDropin-BD-WaKf5.js} +14 -14
- package/dist/{TaxReportingWorkflow-CxxK1I0P.js → TaxReportingWorkflow-UVCd2CGW.js} +5 -5
- package/dist/{TermsOfServiceManagement-BjVUvy6A.js → TermsOfServiceManagement-Czlvu-_X.js} +37 -37
- package/dist/{TextArea-CZ6EPFIm.js → TextArea-Doiwq6Fz.js} +4 -4
- package/dist/{TrustDetailsPage-CMH_pooy.js → TrustDetailsPage-Do_Pgp5e.js} +79 -70
- package/dist/TrustMemberCompanyPage-COKJWVwj.js +109 -0
- package/dist/TrustMemberIndividualPage-BTzYVATe.js +110 -0
- package/dist/{TrustMemberRoleAndTypePage-DtbIRzd6.js → TrustMemberRoleAndTypePage-CvT2NyPL.js} +40 -40
- package/dist/{TrustMembersOverview-CyiHoXHO.js → TrustMembersOverview-Dx2d70H1.js} +36 -36
- package/dist/{UboTaskItem-DehpjG8P.js → UboTaskItem-DItfn-Pd.js} +11 -11
- package/dist/{UnincorporatedPartnershipIndividualPage-B51DLOKD.js → UnincorporatedPartnershipIndividualPage-CLBFd1-S.js} +30 -30
- package/dist/{UnincorporatedPartnershipMemberCompanyPage-DwxgFOUv.js → UnincorporatedPartnershipMemberCompanyPage-5RlKVr20.js} +31 -31
- package/dist/{UnincorporatedPartnershipMemberRoleAndTypePage-CGcWrzzR.js → UnincorporatedPartnershipMemberRoleAndTypePage-D3j7kPUH.js} +8 -8
- package/dist/{UnincorporatedPartnershipMembersOverview-CYKGg4bE.js → UnincorporatedPartnershipMembersOverview-BrypfDgd.js} +7 -7
- package/dist/{VerificationErrorAlert-DHnpqmkb.js → VerificationErrorAlert-Dg0EN5Gg.js} +2 -2
- package/dist/{Workflow-CKPX92cv.js → Workflow-BbFLvLAf.js} +6 -6
- package/dist/{accountHolderUtils--ZEylxaF.js → accountHolderUtils-BnH2f3aW.js} +1 -1
- package/dist/adyen-business-financing.js +31 -31
- package/dist/adyen-individual-configuration.js +56 -56
- package/dist/adyen-individual-status.js +29 -29
- package/dist/adyen-invited-decision-maker.js +3 -3
- package/dist/adyen-onboarding.js +67 -60
- package/dist/adyen-terms-of-service-management.js +3 -3
- package/dist/adyen-terms-of-service-status.js +3 -3
- package/dist/adyen-transfer-instrument-configuration.js +30 -30
- package/dist/adyen-transfer-instrument-management.js +38 -38
- package/dist/adyen-verification-status.js +3 -3
- package/dist/{bafinUtils-DkDlAHgN.js → bafinUtils-F8i4raV6.js} +45 -21
- package/dist/{bg-BG-D4mSRREu.js → bg-BG-BizRzO_4.js} +2 -2
- package/dist/bg-BG-BtgA44Ui.js +7 -0
- package/dist/{bg-BG-BeFIiwVZ.js → bg-BG-DFFyUYhz.js} +1 -4
- package/dist/bg-BG-DYkxVgeJ.js +7 -0
- package/dist/{constants-CpzwsYLt.js → constants-C1GRcz1y.js} +4 -4
- package/dist/cs-CZ-Ci8c58xJ.js +7 -0
- package/dist/{cs-CZ-DHfA1xjQ.js → cs-CZ-DbxpNCVt.js} +1 -4
- package/dist/cs-CZ-DcUnrLLF.js +7 -0
- package/dist/cs-CZ-lJQmuyHq.js +7 -0
- package/dist/da-DK-C1kmOHvo.js +7 -0
- package/dist/da-DK-D53M_d04.js +7 -0
- package/dist/da-DK-DxZQbdeO.js +7 -0
- package/dist/{da-DK--DlccBc0.js → da-DK-zLJRzcB1.js} +1 -4
- package/dist/{de-DE-B_iHAkLT.js → de-DE-BMfqDClD.js} +1 -4
- package/dist/de-DE-BnxQPuqK.js +7 -0
- package/dist/de-DE-qJPTCQlG.js +7 -0
- package/dist/de-DE-qSBQE-6M.js +7 -0
- package/dist/el-GR-Bx996PXx.js +7 -0
- package/dist/el-GR-CgoxpC-Q.js +7 -0
- package/dist/{el-GR-C6jyW53I.js → el-GR-Dv4ru2dp.js} +2 -2
- package/dist/{el-GR-D09thseu.js → el-GR-RfSX8m4j.js} +1 -4
- package/dist/{en-US-Del1h5SS.js → en-US-BUmtG-Wj.js} +5 -1
- package/dist/en-US-C_-DId-G.js +7 -0
- package/dist/{error-DYzwu0no.js → error-3d6yiTPF.js} +3 -3
- package/dist/{es-ES-Bpxn6XGC.js → es-ES-CYw82sbG.js} +1 -4
- package/dist/es-ES-DNhmrVEV.js +7 -0
- package/dist/es-ES-DyB2KXfT.js +7 -0
- package/dist/es-ES-U4-lDfZq.js +7 -0
- package/dist/es-LA-B5IRDCf_.js +7 -0
- package/dist/{es-LA-C8U1qPSu.js → es-LA-BctkHpgC.js} +5 -5
- package/dist/es-LA-C9A4OcR1.js +7 -0
- package/dist/{es-LA-DWAiA7Dw.js → es-LA-CG_cu1hM.js} +2 -2
- package/dist/{es-LA-CJdZb5eY.js → es-LA-CgkOJrPJ.js} +2 -2
- package/dist/es-LA-ChLRkx-r.js +7 -0
- package/dist/{es-LA-CjxlB1WZ.js → es-LA-DDXEJd1M.js} +1 -4
- package/dist/{es-LA-DBBkFhgU.js → es-LA-DcnCNM5a.js} +2 -2
- package/dist/es-LA-Oe31aP7N.js +7 -0
- package/dist/{es-LA-CE8hE_Qb.js → es-LA-s415mKU0.js} +2 -2
- package/dist/et-EE-4_ZUNt3W.js +7 -0
- package/dist/et-EE-BgBr1C0u.js +7 -0
- package/dist/{et-EE-Dtc7YYb4.js → et-EE-BlZkCwz8.js} +1 -4
- package/dist/et-EE-DSK7kb3n.js +7 -0
- package/dist/fi-FI-BSsXGaNE.js +7 -0
- package/dist/{fi-FI-DBhYlO4B.js → fi-FI-CNoPIGJP.js} +1 -4
- package/dist/fi-FI-D06EzKrW.js +7 -0
- package/dist/fi-FI-DgMsQBRO.js +7 -0
- package/dist/{form-rules-Cy_z1LiE.js → form-rules-BhIs9ilj.js} +82 -75
- package/dist/{formatValidationError-DGv-uwBi.js → formatValidationError-DdKr3rgo.js} +1 -1
- package/dist/fr-FR-BTJoQq71.js +7 -0
- package/dist/{fr-FR-Dsh0Vb20.js → fr-FR-C88I1PF4.js} +2 -2
- package/dist/{fr-FR-N8UDU_0Y.js → fr-FR-CQZLvhS1.js} +1 -4
- package/dist/fr-FR-Dl4NL-Nc.js +7 -0
- package/dist/{CompanyRegistrationNumberTypeSelector-CX4-v376.js → getDefaultRegistrationNumberType-CfU1YUaz.js} +49 -49
- package/dist/{useAssociatedLegalEntity-BdcoiUby.js → getFormSlice-DzRO0UUx.js} +19 -2
- package/dist/{getProblemsForEntity-CTxd78-9.js → getProblemsForEntity-CfzojTAS.js} +1 -1
- package/dist/{getTrustedDecisionMakers-DWVtW7JE.js → getTrustedDecisionMakers-Brlr-pKL.js} +1 -1
- package/dist/hr-HR-B11sggmG.js +7 -0
- package/dist/{hr-HR-GLRwxTIZ.js → hr-HR-C6-nBPZJ.js} +1 -4
- package/dist/hr-HR-COdiWKoq.js +7 -0
- package/dist/hr-HR-HlAOaG4N.js +7 -0
- package/dist/{hu-HU-s1MKqwI4.js → hu-HU-CKm1kMo5.js} +1 -4
- package/dist/hu-HU-DkSsL94T.js +7 -0
- package/dist/hu-HU-Dp6xOBN_.js +7 -0
- package/dist/hu-HU-s1kS1v8Y.js +7 -0
- package/dist/it-IT-BlaVymCj.js +7 -0
- package/dist/it-IT-CawjvBDX.js +7 -0
- package/dist/{it-IT-xXO07yyz.js → it-IT-DPOJ9mKi.js} +2 -2
- package/dist/{it-IT-2reNk09A.js → it-IT-DjUFw9e_.js} +1 -4
- package/dist/{ja-JP-Bf97gKqg.js → ja-JP-Ce_xNqZj.js} +1 -4
- package/dist/ja-JP-DGj167Zw.js +7 -0
- package/dist/ja-JP-Dpe9Odla.js +7 -0
- package/dist/ja-JP-h3E8hgLv.js +7 -0
- package/dist/{types-CdxNdaM6.js → legalArrangementUtils-skU_cq9L.js} +4 -3
- package/dist/lt-LT-B18sQY9g.js +7 -0
- package/dist/{lt-LT-BUgsY7cD.js → lt-LT-BQD7QWIk.js} +1 -4
- package/dist/lt-LT-CEpjHJry.js +7 -0
- package/dist/lt-LT-Fc1lOUlz.js +7 -0
- package/dist/lv-LV-COsG0cJY.js +7 -0
- package/dist/{lv-LV-BpniO6xp.js → lv-LV-DHwdYWGZ.js} +1 -4
- package/dist/lv-LV-DctYQmfH.js +7 -0
- package/dist/lv-LV-adiXoKhv.js +7 -0
- package/dist/{mapExistingFile-R6-FnjjY.js → mapExistingFile-CDahgHsP.js} +1 -1
- package/dist/{mapJpAddressSchemaToAddressLocalizations-C-kAGmiq.js → mapJpAddressSchemaToAddressLocalizations-CWb68lJV.js} +2 -2
- package/dist/{mapLegalEntityToIndividualSchema-BIisj-RE.js → mapLegalEntityToIndividualSchema-B3XhBnaa.js} +7 -7
- package/dist/{mapTransferInstrumentToPayoutAccount-D-RdVquH.js → mapTransferInstrumentToPayoutAccount-n4ffPJ2c.js} +3 -3
- package/dist/nl-NL-9sJ9sG_Q.js +7 -0
- package/dist/nl-NL-BIpptPn4.js +7 -0
- package/dist/{nl-NL-_B3Ey_x1.js → nl-NL-Cdmgljzx.js} +1 -4
- package/dist/nl-NL-DOB0b0m4.js +7 -0
- package/dist/no-NO-BG1sYkpp.js +7 -0
- package/dist/no-NO-DnsCTUl4.js +7 -0
- package/dist/{no-NO-CytzrDfA.js → no-NO-MhaaDGft.js} +1 -4
- package/dist/no-NO-P5tRWhV9.js +7 -0
- package/dist/{pl-PL-DLBeIbY5.js → pl-PL-B0tX08_r.js} +1 -4
- package/dist/pl-PL-BX9Xsn_R.js +7 -0
- package/dist/pl-PL-J9S3_lCf.js +7 -0
- package/dist/pl-PL-_KG-ZD1N.js +7 -0
- package/dist/{processCapabilities-uXoRmB5x.js → processCapabilities-BfskhjUw.js} +2 -1
- package/dist/{processValidationErrors-CxYdVSIk.js → processValidationErrors-BfqJR1rP.js} +4 -4
- package/dist/pt-BR-BYbyk6xS.js +7 -0
- package/dist/{pt-BR-Cf5Jif3w.js → pt-BR-CExpeuK1.js} +1 -4
- package/dist/pt-BR-D23HWCOv2.js +7 -0
- package/dist/pt-BR-fKlNUybd.js +7 -0
- package/dist/{pt-PT-Cg7oMqTO.js → pt-PT-CedGAyU5.js} +1 -4
- package/dist/pt-PT-D8ldyR-j.js +7 -0
- package/dist/pt-PT-DAvsI-Tr.js +7 -0
- package/dist/pt-PT-oMj1KA74.js +7 -0
- package/dist/{resolveEnvironment-iYzRliVi.js → resolveEnvironment-Bp-RuIhz.js} +69 -70
- package/dist/{ro-RO-UHWXt9rv.js → ro-RO-C-lRWe1h.js} +1 -4
- package/dist/ro-RO-CQJk7Cpo.js +7 -0
- package/dist/ro-RO-CnMe6Mfw.js +7 -0
- package/dist/ro-RO-Cri5-XPn.js +7 -0
- package/dist/sk-SK-Br1Y4_CN.js +7 -0
- package/dist/sk-SK-Bx2_85dW.js +7 -0
- package/dist/{sk-SK-BQHhBpDH.js → sk-SK-D1duuBif.js} +1 -4
- package/dist/sk-SK-XvPPBgTO.js +7 -0
- package/dist/sl-SI-B31X-t8A.js +7 -0
- package/dist/sl-SI-DHPadSTy.js +7 -0
- package/dist/{sl-SI-DOAJBgQV.js → sl-SI-DO9c7geI.js} +2 -2
- package/dist/{sl-SI-CTrggdef.js → sl-SI-iGtJR9Tk.js} +1 -4
- package/dist/style.css +21 -0
- package/dist/styles-DYaAeu4q.js +21 -0
- package/dist/{sv-SE-Bk55FXGN.js → sv-SE-9GnBnxvb.js} +1 -4
- package/dist/sv-SE-BXrlr0X5.js +7 -0
- package/dist/sv-SE-DBANqFwL.js +7 -0
- package/dist/sv-SE-l_UVgmVu.js +7 -0
- package/dist/types/adaptiveWorkflow/context/TaskStepperContext/TaskStepperContext.d.ts +19 -9
- package/dist/types/adaptiveWorkflow/context/TaskStepperContext/TaskStepperContextProvider.d.ts +0 -8
- package/dist/types/adaptiveWorkflow/context/TaskStepperContext/useTaskStepperContext.d.ts +1 -1
- package/dist/types/components/Business/forms/rules.constants.d.ts +2 -40
- package/dist/types/components/Business/utils/utils.d.ts +1 -1
- package/dist/types/components/EFP/mapping/businessFinancingKeyMappings.d.ts +6 -8
- package/dist/types/components/EFP/tasks/BusinessFinancingDropin/BusinessFinancingRegisteredAddress.d.ts +13 -2
- package/dist/types/components/EFP/tasks/BusinessFinancingDropin/utils.d.ts +1 -1
- package/dist/types/components/EFP/tasks/BusinessFinancingDropin/validate.d.ts +12 -3
- package/dist/types/components/GlobalEntry/fields/EntitySetupField/EntitySetupField.d.ts +5 -0
- package/dist/types/components/GlobalEntry/fields/EntitySetupField/types.d.ts +1 -1
- package/dist/types/components/GlobalEntry/fields/PrimaryPartnerTypeField/PrimaryPartnerTypeField.d.ts +3 -0
- package/dist/types/components/GlobalEntry/fields/PrimaryPartnerTypeField/types.d.ts +5 -0
- package/dist/types/components/GlobalEntry/forms/PrimaryPartner/PrimaryPartner.d.ts +4 -0
- package/dist/types/components/GlobalEntry/forms/PrimaryPartner/types.d.ts +2 -0
- package/dist/types/components/GlobalEntry/forms/RegistrationInformation/types.d.ts +2 -1
- package/dist/types/components/GlobalEntry/globalEntryKeyMapping.d.ts +15 -0
- package/dist/types/components/GlobalEntry/rules.d.ts +8 -3
- package/dist/types/components/GlobalEntry/tasks/GlobalEntryModal.d.ts +6 -2
- package/dist/types/components/GlobalEntry/tasks/GlobalEntryPage.d.ts +5 -1
- package/dist/types/components/GlobalEntry/tasks/types.d.ts +2 -0
- package/dist/types/components/GlobalEntry/utils.d.ts +22 -1
- package/dist/types/components/GlobalEntry/validate.d.ts +2 -0
- package/dist/types/components/Shared/FormFlow/FormFlow.d.ts +1 -1
- package/dist/types/components/Shared/FormFlow/FormFlow.types.d.ts +1 -0
- package/dist/types/components/Shared/fields/DateOfIncorporationField/DateOfIncorporationField.d.ts +1 -1
- package/dist/types/components/Shared/fields/DateOfIncorporationField/fieldConfig.d.ts +2 -1
- package/dist/types/components/Shared/fields/DateOfIncorporationField/types.d.ts +2 -0
- package/dist/types/components/Shared/fields/RegistrationAndOperationalAddressFields/utils.d.ts +1 -1
- package/dist/types/components/Shared/fields/StateField/StateField.d.ts +1 -1
- package/dist/types/components/Shared/fields/StateField/fieldConfig.d.ts +2 -7
- package/dist/types/components/Shared/fields/StateField/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/TaxInformationField/TaxInformationField.d.ts +1 -1
- package/dist/types/components/Shared/fields/TaxInformationField/types.d.ts +1 -1
- package/dist/types/components/Shared/forms/Address/utils.d.ts +1 -1
- package/dist/types/components/Trust/forms/Trust/rules.d.ts +1 -0
- package/dist/types/components/Trust/forms/TrustRegistrationDetails/types.d.ts +2 -1
- package/dist/types/hooks/useLegalCompanyNameField/useLegalCompanyNameField.d.ts +1 -1
- package/dist/types/router/routeConfig.d.ts +1 -1
- package/dist/types/utils/businessUtils.d.ts +38 -0
- package/dist/types/utils/entityStatusUtil.d.ts +1 -1
- package/dist/types/{components/UnincorporatedPartnership/types/types.d.ts → utils/legalArrangementUtils.d.ts} +2 -1
- package/dist/types/{components/UnincorporatedPartnership/utils/unincorporatedParnershipUtil.d.ts → utils/unincorporatedParnershipUtils.d.ts} +3 -3
- package/dist/{types-Ai_80DXu.js → types-C6GnB9nH.js} +1 -1
- package/dist/{useBusinessDetailsData-Dt4JqZ87.js → useBusinessDetailsData-UyUhXzON.js} +82 -182
- package/dist/{useCanSeeIntroduction-CMzerxJL.js → useCanSeeIntroduction-C6qXZZe8.js} +3 -3
- package/dist/{useDataMissingRemediations-Cd-jucOu.js → useDataMissingRemediations-D-NZOgal.js} +1 -1
- package/dist/{useForm-CEXA_F3u.js → useForm-BhfuVkAR.js} +2 -2
- package/dist/{useHideTaskStepper-MdPt1zI8.js → useHideTaskStepper-Dlzsx-RK.js} +9 -8
- package/dist/{useId-CZMbF_sJ.js → useId-DqpXTon5.js} +1 -1
- package/dist/{useNavigate-RRamr3fr.js → useNavigate-Xc0HARgb.js} +33 -33
- package/dist/{useSalesChannels-B9PV1rQa.js → useSalesChannels-gzi6QOI7.js} +3 -3
- package/dist/{useTaskLandedEvent-DbQ2E-rM.js → useTaskLandedEvent-BXv-wuAJ.js} +1 -1
- package/dist/useTaskStepperContext-DCNMsKUc.js +51 -0
- package/dist/{useTrustMembers-gdgm1nJI.js → useTrustMembers-wjNlRtOm.js} +3 -3
- package/dist/{useUnincorporatedPartnershipMembers-00l8eNLk.js → useUnincorporatedPartnershipMembers-CfpBIS06.js} +2 -2
- package/dist/{utils-DxOvaA3u.js → utils-DebuaWe9.js} +6 -6
- package/dist/{StructuredList-36A9DDQa.js → utils-DyriwmGv.js} +94 -5
- package/dist/{utils-CFaGY5aD.js → utils-P67T6pKI.js} +1 -1
- package/dist/{validate-BbOeJY9-.js → validate-C2fajdCR.js} +4 -4
- package/dist/{validate--p4TuNQC.js → validate-DruWE6jY.js} +68 -51
- package/dist/{validate-BevFCyzw.js → validate-DzNLLQoR.js} +5 -31
- package/dist/validate-MsZ6MiUq.js +151 -0
- package/dist/{validateExtractionResult-BnSV5Z6F.js → validateExtractionResult-BfwUJj1D.js} +2 -2
- package/dist/{validationError-BLSF1VbX.js → validationError-DudGlB6v.js} +2 -2
- package/package.json +1 -1
- package/dist/GlobalEntryModal-DAf4bqoT.js +0 -589
- package/dist/InputDate-Cgld5B0-.js +0 -52
- package/dist/TaskStepperContextProvider-DuM9tlet.js +0 -81
- package/dist/TrustMemberCompanyPage-Bzcvc0Cz.js +0 -109
- package/dist/TrustMemberIndividualPage-DN_epZ5a.js +0 -110
- package/dist/bg-BG-CXqERnFH.js +0 -7
- package/dist/bg-BG-DbS559bK.js +0 -7
- package/dist/cs-CZ-4yvBEVL0.js +0 -7
- package/dist/cs-CZ-DAXMHrMi.js +0 -7
- package/dist/cs-CZ-DySBJFlc.js +0 -7
- package/dist/da-DK-BVaEiAWd.js +0 -7
- package/dist/da-DK-BuvKW6Sq.js +0 -7
- package/dist/da-DK-D3mbpcHG.js +0 -7
- package/dist/de-DE-BQaqplTp.js +0 -7
- package/dist/de-DE-BqujMxXu.js +0 -7
- package/dist/de-DE-D6R-XC2F.js +0 -7
- package/dist/el-GR-B1NjHThy.js +0 -7
- package/dist/el-GR-CedmhUFh.js +0 -7
- package/dist/en-US-D4NrsDmW.js +0 -7
- package/dist/es-ES-BM5RTwb7.js +0 -7
- package/dist/es-ES-C64v4NJD.js +0 -7
- package/dist/es-ES-DTUHhE47.js +0 -7
- package/dist/es-LA-B7pY2dp1.js +0 -7
- package/dist/es-LA-BjZq9RK_.js +0 -7
- package/dist/es-LA-CcMAcJ7u.js +0 -7
- package/dist/es-LA-DlL8vCjJ.js +0 -7
- package/dist/et-EE-DqhEsLik.js +0 -7
- package/dist/et-EE-FtKFvr3u.js +0 -7
- package/dist/et-EE-wDQx9HoZ.js +0 -7
- package/dist/fi-FI-KMP96Qxc.js +0 -7
- package/dist/fi-FI-RfGqWbnB.js +0 -7
- package/dist/fi-FI-SFw2grVp.js +0 -7
- package/dist/fr-FR-C8IPWMDL.js +0 -7
- package/dist/fr-FR-zDxTr2D3.js +0 -7
- package/dist/getFormSlice-C1ma6Xd4.js +0 -21
- package/dist/hr-HR-COvc9TZy.js +0 -7
- package/dist/hr-HR-Cqgf9B0v.js +0 -7
- package/dist/hr-HR-DPjuJ54x.js +0 -7
- package/dist/hu-HU-DIjDe5aa.js +0 -7
- package/dist/hu-HU-DyM1X3r6.js +0 -7
- package/dist/hu-HU-hB61p4H9.js +0 -7
- package/dist/it-IT-BKTDLRBT.js +0 -7
- package/dist/it-IT-BMXQzE0P.js +0 -7
- package/dist/ja-JP-BhHK_ru2.js +0 -7
- package/dist/ja-JP-BuFZko8b.js +0 -7
- package/dist/ja-JP-DbLRpEVj.js +0 -7
- package/dist/lt-LT-Be3q6tyu.js +0 -7
- package/dist/lt-LT-Btr5el2q.js +0 -7
- package/dist/lt-LT-D4raqCUa.js +0 -7
- package/dist/lv-LV-8wOWTo3r.js +0 -7
- package/dist/lv-LV-DBms129k.js +0 -7
- package/dist/lv-LV-DCeyOqHY.js +0 -7
- package/dist/nl-NL-CdHkQcOS.js +0 -7
- package/dist/nl-NL-Dyb3tkBi.js +0 -7
- package/dist/nl-NL-UhYf45fo.js +0 -7
- package/dist/no-NO-B-xCUkf4.js +0 -7
- package/dist/no-NO-DN7Ovyir.js +0 -7
- package/dist/no-NO-DXDddmYv.js +0 -7
- package/dist/pl-PL-BmiDQi18.js +0 -7
- package/dist/pl-PL-CBwRmIu5.js +0 -7
- package/dist/pl-PL-Cc09pXO8.js +0 -7
- package/dist/pt-BR-DA4PVtVa2.js +0 -7
- package/dist/pt-BR-DXGEP6IP.js +0 -7
- package/dist/pt-BR-hMhyqixD.js +0 -7
- package/dist/pt-PT-BXIKj_3F.js +0 -7
- package/dist/pt-PT-D2qX_lOd.js +0 -7
- package/dist/pt-PT-QU0CQs-d.js +0 -7
- package/dist/ro-RO-CQjOM8e-.js +0 -7
- package/dist/ro-RO-D4TQUwVB.js +0 -7
- package/dist/ro-RO-DNye-gMC.js +0 -7
- package/dist/sk-SK-2jlbtz2r.js +0 -7
- package/dist/sk-SK-CszMszV5.js +0 -7
- package/dist/sk-SK-CwbBfCsU.js +0 -7
- package/dist/sl-SI-9XdXVgB8.js +0 -7
- package/dist/sl-SI-Cyx0QtxG.js +0 -7
- package/dist/sv-SE--LlaHl85.js +0 -7
- package/dist/sv-SE-CqhSdYBe.js +0 -7
- package/dist/sv-SE-kbf3zbjX.js +0 -7
- package/dist/types/components/Shared/forms/Address/Address.d.ts +0 -3
- package/dist/useCreateLegalEntity-CYZd_62a.js +0 -24
- package/dist/useTaskStepperContext-BIEhTt1x.js +0 -15
- package/dist/useUpdateLegalEntity-Cp9Cq-yR.js +0 -29
- package/dist/utils-DdHbAadK.js +0 -80
- package/dist/validate-BjD_UO5x.js +0 -125
|
@@ -0,0 +1,951 @@
|
|
|
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] = "1e5c168c-f150-4f88-8412-5ef3e319f6a5", e._sentryDebugIdIdentifier = "sentry-dbid-1e5c168c-f150-4f88-8412-5ef3e319f6a5");
|
|
4
|
+
} catch (e) {}
|
|
5
|
+
import { n as addResourceBundles, r as useTranslation } from "./translation-BOm4lmPx.js";
|
|
6
|
+
import { A as _rolldown_dynamic_import_helper_default, E as useAllowedCountries, j as useToggleContext, k as Header, pt as useAccountHolder, v as isPartOfUnincorporatedPartnership, x as Alert } from "./resolveEnvironment-Bp-RuIhz.js";
|
|
7
|
+
import { t as createLogger } from "./logger-Z8AeTE4x.js";
|
|
8
|
+
import { t as Typography } from "./Typography-CAc_f5Iq.js";
|
|
9
|
+
import { t as Button } from "./Button-oqvTDztg.js";
|
|
10
|
+
import { t as LegalEntityTypes } from "./legal-entity-type-0MfCGzUf.js";
|
|
11
|
+
import { t as getLegalEntityCountry } from "./getLegalEntityCountry-CNE5uei8.js";
|
|
12
|
+
import { s as keysOf } from "./genUtils-Ce61IJs8.js";
|
|
13
|
+
import { t as StackLayout } from "./StackLayout-IUdNMDgW.js";
|
|
14
|
+
import { t as CountryCodes } from "./country-code-CJk2hdPu.js";
|
|
15
|
+
import { y as reverseMapping } from "./processCapabilities-BfskhjUw.js";
|
|
16
|
+
import { t as TaskTypes } from "./taskTypes-3vSkMBDm.js";
|
|
17
|
+
import { f as hasSolePropInLegalEntity, s as getOwnEntityAssociations } from "./entityAssociationUtil-CLBR9osP.js";
|
|
18
|
+
import { t as InputText } from "./InputText-BqeL5dXt.js";
|
|
19
|
+
import { _ as getPropsFromConfigurations, m as resolveFieldMetadata, t as createFormRules } from "./form-rules-BhIs9ilj.js";
|
|
20
|
+
import { t as ListItem } from "./ListItem-CI4fqIkg.js";
|
|
21
|
+
import { n as useAssociatedLegalEntity, t as getFormSlice } from "./getFormSlice-DzRO0UUx.js";
|
|
22
|
+
import { t as Card } from "./Card-BCGLpdw7.js";
|
|
23
|
+
import { r as useToastContext } from "./useId-DqpXTon5.js";
|
|
24
|
+
import { A as TAX_ID_REQUIRED_COUNTRIES_ORGANIZATION, C as COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER, D as COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_SOLE_PROPS, E as COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_COMPANIES, F as taxInformationDefaultFieldConfig, H as CompanyTypesValues, I as taxInformationDefaultFieldMetadata, O as COUNTRIES_WITH_POSSIBLE_TRUSTEE_TAXID_ABSENT_V4, P as getTaxInformationPlaceholderText, S as COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT, T as COUNTRIES_WITH_POSSIBLE_REGISTRATION_EXEMPTIONS_FOR_SOLE_PROPS, V as isJapanLocalizationEnabled, b as COUNTRIES_THAT_DONT_REQUIRE_SOLE_PROP_REGISTRATION, c as TileGroup, j as isUsingCompanySearch, k as REGISTRATION_NUMBER_EXEMPTION_RULES, l as TAX_INFORMATION_FIELD, u as TaxInformationField, w as COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER_SOLE_PROPS, x as COUNTRIES_THAT_DO_NOT_USE_TAX_ID_FOR_SOLE_PROP, y as COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION } from "./bafinUtils-F8i4raV6.js";
|
|
25
|
+
import { r as Field } from "./Select-CrcaoG0i.js";
|
|
26
|
+
import { r as formatObject } from "./utils-DyriwmGv.js";
|
|
27
|
+
import { d as COUNTRIES_WITH_STATES_DATASET, m as useCreateLegalEntity, n as StateField, p as useUpdateLegalEntity, r as stateFieldMetadata, t as STATE_FIELD } from "./StateField-BnyUQjAj.js";
|
|
28
|
+
import { M as FormContextProvider, d as useFormContext, f as addValidityToForms, g as useMultiForm, k as createFormUtils, l as COUNTRY_FIELD, m as FormFlow, p as getRequiredForms, u as CountryField, y as useFormComposer } from "./RadioGroup-e6Ty_ggj.js";
|
|
29
|
+
import { t as List } from "./List-ywoRPg-q.js";
|
|
30
|
+
import { a as defaultFieldMetadata, i as defaultFieldConfigV4, o as defaultFieldMetadataV4, r as defaultFieldConfig, t as LEGAL_COMPANY_NAME_FIELD } from "./LegalCompanyNameField-Dl60xD84.js";
|
|
31
|
+
import { c as CountryOfGoverningLawField, i as isRegistrationExemptionAllowed, l as useLegalCompanyNameField, o as COUNTRY_OF_GOVERNING_LAW_POSSIBLE, s as COUNTRY_OF_GOVERNING_LAW_FIELD, t as CountryOfGoverningLawFieldValidation } from "./validate-MsZ6MiUq.js";
|
|
32
|
+
import { l as registrationNumberDefaultFieldConfig, u as registrationNumberDefaultFieldMetadata } from "./getDefaultRegistrationNumberType-CfU1YUaz.js";
|
|
33
|
+
import { n as BusinessRegistrationNumberField, t as BUSINESS_REGISTRATION_NUMBER_FIELD } from "./BusinessRegistrationNumberField-c8mvmS4m.js";
|
|
34
|
+
import { useCallback, useEffect, useMemo, useState } from "preact/compat";
|
|
35
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "preact/jsx-runtime";
|
|
36
|
+
import { signal } from "@preact/signals";
|
|
37
|
+
//#region src/components/GlobalEntry/globalEntryStore.ts
|
|
38
|
+
var showGlobalEntryModal = signal(false);
|
|
39
|
+
var EntitySetupField_module_default = {
|
|
40
|
+
"entity-setup-option": "_entity-setup-option_1ykiv_1",
|
|
41
|
+
entitySetupOption: "_entity-setup-option_1ykiv_1"
|
|
42
|
+
};
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region src/components/GlobalEntry/fields/EntitySetupField/EntitySetupField.tsx
|
|
45
|
+
var ENTITY_SETUP_FIELD = ["entitySetup"];
|
|
46
|
+
/**
|
|
47
|
+
* Determines whether an organization exists at all, rather than what the legal entity is.
|
|
48
|
+
* `partOfABusiness` does not imply an organization legal entity: an individual in an
|
|
49
|
+
* Unincorporated Partnership or Trust picks it too.
|
|
50
|
+
*/
|
|
51
|
+
var EntitySetupField = ({ data, valid, errors, handleChangeFor }) => {
|
|
52
|
+
const { t: globalT } = useTranslation("globalEntry");
|
|
53
|
+
const entitySetupOptions = [{
|
|
54
|
+
value: "justMe",
|
|
55
|
+
label: globalT(($) => $["itsJustMe"]),
|
|
56
|
+
iconName: "user"
|
|
57
|
+
}, {
|
|
58
|
+
value: "partOfABusiness",
|
|
59
|
+
label: globalT(($) => $["imPartOfABusinessOrOrganization"]),
|
|
60
|
+
iconName: "company"
|
|
61
|
+
}];
|
|
62
|
+
return /* @__PURE__ */ jsx(Field, {
|
|
63
|
+
el: "fieldset",
|
|
64
|
+
name: "entitySetup",
|
|
65
|
+
errorMessage: errors.entitySetup,
|
|
66
|
+
isValid: valid?.entitySetup,
|
|
67
|
+
label: globalT(($) => $["howIsYourBusinessSetup"]),
|
|
68
|
+
children: () => /* @__PURE__ */ jsx(List, {
|
|
69
|
+
dividers: false,
|
|
70
|
+
padding: "large",
|
|
71
|
+
children: entitySetupOptions.map((option) => /* @__PURE__ */ jsx("div", {
|
|
72
|
+
className: EntitySetupField_module_default.entitySetupOption,
|
|
73
|
+
children: /* @__PURE__ */ jsx(Card, {
|
|
74
|
+
selected: data?.entitySetup === option.value,
|
|
75
|
+
onClick: () => handleChangeFor("entitySetup")(option.value),
|
|
76
|
+
children: /* @__PURE__ */ jsx(ListItem, {
|
|
77
|
+
title: option.label,
|
|
78
|
+
avatar: {
|
|
79
|
+
iconName: option.iconName,
|
|
80
|
+
circle: true
|
|
81
|
+
}
|
|
82
|
+
})
|
|
83
|
+
})
|
|
84
|
+
}, option.value))
|
|
85
|
+
})
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region src/components/GlobalEntry/forms/EntityInformation/EntityInformation.tsx
|
|
90
|
+
var ENTITY_INFORMATION_FIELDS = [
|
|
91
|
+
...COUNTRY_FIELD,
|
|
92
|
+
...STATE_FIELD,
|
|
93
|
+
...ENTITY_SETUP_FIELD
|
|
94
|
+
];
|
|
95
|
+
var EntityInformation = ({ id, country }) => {
|
|
96
|
+
const { form } = useFormContext();
|
|
97
|
+
const { t: commonT } = useTranslation("common");
|
|
98
|
+
const { t: globalEntryT } = useTranslation("globalEntry");
|
|
99
|
+
const allowedCountries = useAllowedCountries();
|
|
100
|
+
const { data, errors, valid, requiredFields, optionalFields, trustedFields, fieldProblems, handleChange: handleChangeFor } = getFormSlice(form, "entityInformation");
|
|
101
|
+
const formUtils = createFormUtils({
|
|
102
|
+
requiredFields,
|
|
103
|
+
optionalFields,
|
|
104
|
+
trustedFields
|
|
105
|
+
}, commonT);
|
|
106
|
+
const showField = (fieldKeys) => fieldKeys.some((field) => formUtils.isRequiredField(field) || formUtils.isOptionalField(field));
|
|
107
|
+
return /* @__PURE__ */ jsxs("form", {
|
|
108
|
+
id,
|
|
109
|
+
children: [
|
|
110
|
+
/* @__PURE__ */ jsx(Header, {
|
|
111
|
+
title: commonT(($) => $["tellUsAboutYourBusiness"]),
|
|
112
|
+
description: globalEntryT(($) => $["toHelpYouGetSetUp"])
|
|
113
|
+
}),
|
|
114
|
+
/* @__PURE__ */ jsx(CountryField, {
|
|
115
|
+
data: { country: data?.country },
|
|
116
|
+
valid: { country: valid?.country },
|
|
117
|
+
errors: { country: formUtils.getErrorMessage("country", errors, fieldProblems) },
|
|
118
|
+
labels: { country: globalEntryT(($) => $["whereIsYourBusinessLocated"]) },
|
|
119
|
+
readonly: false,
|
|
120
|
+
allowedCountries,
|
|
121
|
+
handleChangeFor
|
|
122
|
+
}),
|
|
123
|
+
showField(STATE_FIELD) && /* @__PURE__ */ jsx(StateField, {
|
|
124
|
+
data: { stateOrProvince: data?.stateOrProvince },
|
|
125
|
+
valid: { stateOrProvince: valid?.stateOrProvince },
|
|
126
|
+
errors: { stateOrProvince: formUtils.getErrorMessage("stateOrProvince", errors, fieldProblems) },
|
|
127
|
+
selectedCountry: country,
|
|
128
|
+
readonly: false,
|
|
129
|
+
handleChangeFor,
|
|
130
|
+
labelOverride: commonT(($) => $["whereIsYourBusinessRegistered"])
|
|
131
|
+
}),
|
|
132
|
+
/* @__PURE__ */ jsx(EntitySetupField, {
|
|
133
|
+
data: { entitySetup: data?.entitySetup },
|
|
134
|
+
valid: { entitySetup: valid?.entitySetup },
|
|
135
|
+
errors: { entitySetup: formUtils.getErrorMessage("entitySetup", errors, fieldProblems) },
|
|
136
|
+
handleChangeFor
|
|
137
|
+
})
|
|
138
|
+
]
|
|
139
|
+
});
|
|
140
|
+
};
|
|
141
|
+
var PrimaryPartnerTypeField_module_default = {
|
|
142
|
+
"primary-partner-type": "_primary-partner-type_1omkz_1",
|
|
143
|
+
primaryPartnerType: "_primary-partner-type_1omkz_1"
|
|
144
|
+
};
|
|
145
|
+
//#endregion
|
|
146
|
+
//#region src/components/GlobalEntry/fields/PrimaryPartnerTypeField/PrimaryPartnerTypeField.tsx
|
|
147
|
+
var PRIMARY_PARTNER_TYPE_FIELD = ["primaryPartnerType"];
|
|
148
|
+
var PrimaryPartnerTypeField = ({ data, valid, errors, handleChangeFor }) => {
|
|
149
|
+
const { t: globalEntryT } = useTranslation("globalEntry");
|
|
150
|
+
const partnerTypeOptions = [{
|
|
151
|
+
value: "individual",
|
|
152
|
+
label: globalEntryT(($) => $["anIndividual"]),
|
|
153
|
+
iconName: "user"
|
|
154
|
+
}, {
|
|
155
|
+
value: "organization",
|
|
156
|
+
label: globalEntryT(($) => $["aBusinessEntity"]),
|
|
157
|
+
iconName: "company"
|
|
158
|
+
}];
|
|
159
|
+
return /* @__PURE__ */ jsx(Field, {
|
|
160
|
+
el: "fieldset",
|
|
161
|
+
name: "primaryPartnerType",
|
|
162
|
+
errorMessage: errors.primaryPartnerType,
|
|
163
|
+
isValid: valid?.primaryPartnerType,
|
|
164
|
+
label: globalEntryT(($) => $["whatTypeOfEntityIsTheFirstPrimaryPartner"]),
|
|
165
|
+
formatGuidance: globalEntryT(($) => $["wellStartByCollectingInformationAboutOnePartner"]),
|
|
166
|
+
children: () => /* @__PURE__ */ jsx(List, {
|
|
167
|
+
dividers: false,
|
|
168
|
+
padding: "large",
|
|
169
|
+
children: partnerTypeOptions.map((option) => /* @__PURE__ */ jsx("div", {
|
|
170
|
+
className: PrimaryPartnerTypeField_module_default.primaryPartnerType,
|
|
171
|
+
children: /* @__PURE__ */ jsx(Card, {
|
|
172
|
+
selected: data?.primaryPartnerType === option.value,
|
|
173
|
+
onClick: () => handleChangeFor("primaryPartnerType")(option.value),
|
|
174
|
+
children: /* @__PURE__ */ jsx(ListItem, {
|
|
175
|
+
title: option.label,
|
|
176
|
+
avatar: {
|
|
177
|
+
iconName: option.iconName,
|
|
178
|
+
circle: true
|
|
179
|
+
}
|
|
180
|
+
})
|
|
181
|
+
})
|
|
182
|
+
}, option.value))
|
|
183
|
+
})
|
|
184
|
+
});
|
|
185
|
+
};
|
|
186
|
+
//#endregion
|
|
187
|
+
//#region src/components/GlobalEntry/forms/PrimaryPartner/PrimaryPartner.tsx
|
|
188
|
+
var PRIMARY_PARTNER_FIELDS = [...PRIMARY_PARTNER_TYPE_FIELD];
|
|
189
|
+
var PrimaryPartner = ({ id }) => {
|
|
190
|
+
const { form } = useFormContext();
|
|
191
|
+
const { t: commonT } = useTranslation("common");
|
|
192
|
+
const { t: globalEntryT } = useTranslation("globalEntry");
|
|
193
|
+
const { data, errors, valid, requiredFields, optionalFields, trustedFields, fieldProblems, handleChange: handleChangeFor } = getFormSlice(form, "primaryPartner");
|
|
194
|
+
const formUtils = createFormUtils({
|
|
195
|
+
requiredFields,
|
|
196
|
+
optionalFields,
|
|
197
|
+
trustedFields
|
|
198
|
+
}, commonT);
|
|
199
|
+
return /* @__PURE__ */ jsxs("form", {
|
|
200
|
+
id,
|
|
201
|
+
children: [/* @__PURE__ */ jsx(Header, {
|
|
202
|
+
title: commonT(($) => $["tellUsAboutYourBusiness"]),
|
|
203
|
+
description: globalEntryT(($) => $["toHelpYouGetSetUp"])
|
|
204
|
+
}), /* @__PURE__ */ jsx(PrimaryPartnerTypeField, {
|
|
205
|
+
data: { primaryPartnerType: data?.primaryPartnerType },
|
|
206
|
+
valid: { primaryPartnerType: valid?.primaryPartnerType },
|
|
207
|
+
errors: { primaryPartnerType: formUtils.getErrorMessage("primaryPartnerType", errors, fieldProblems) },
|
|
208
|
+
handleChangeFor
|
|
209
|
+
})]
|
|
210
|
+
});
|
|
211
|
+
};
|
|
212
|
+
//#endregion
|
|
213
|
+
//#region src/components/GlobalEntry/fields/PaperworkQuestionnaire/PaperworkQuestionnaire.tsx
|
|
214
|
+
var PAPERWORK_QUESTIONNAIRE_FIELD = ["filedPaperwork"];
|
|
215
|
+
function PaperworkQuestionnaire({ data, valid, handleChangeFor, errors, label }) {
|
|
216
|
+
const { t } = useTranslation(["globalEntry", "common"]);
|
|
217
|
+
return /* @__PURE__ */ jsx(Field, {
|
|
218
|
+
el: "fieldset",
|
|
219
|
+
name: "PaperworkQuestionnaire",
|
|
220
|
+
label,
|
|
221
|
+
isValid: valid.filedPaperwork,
|
|
222
|
+
errorMessage: errors.filedPaperwork,
|
|
223
|
+
children: () => /* @__PURE__ */ jsxs(StackLayout, { children: [/* @__PURE__ */ jsx(Button, {
|
|
224
|
+
variant: "link",
|
|
225
|
+
onClick: () => {},
|
|
226
|
+
children: /* @__PURE__ */ jsx(Typography, { children: t(($) => $["whatDoesThisMean"], { ns: "common" }) })
|
|
227
|
+
}), /* @__PURE__ */ jsx(TileGroup, {
|
|
228
|
+
name: "filedPaperwork",
|
|
229
|
+
selected: data.filedPaperwork ?? "",
|
|
230
|
+
isHorizontal: true,
|
|
231
|
+
onChange: (value) => handleChangeFor("filedPaperwork")(value),
|
|
232
|
+
tiles: [{
|
|
233
|
+
label: t(($) => $["yes"], { ns: "common" }),
|
|
234
|
+
value: "yes"
|
|
235
|
+
}, {
|
|
236
|
+
label: t(($) => $["no"], { ns: "common" }),
|
|
237
|
+
value: "no"
|
|
238
|
+
}]
|
|
239
|
+
})] })
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
//#endregion
|
|
243
|
+
//#region src/components/GlobalEntry/fields/UnincorporatedOrganizationTypeField/UnincorporatedOrganizationTypeField.tsx
|
|
244
|
+
var UNINCORPORATED_ORGANIZATION_TYPE_FIELD = ["unincorporatedOrganizationType"];
|
|
245
|
+
var UnincorporatedOrganizationTypeField = ({ data, valid, errors, handleChangeFor }) => {
|
|
246
|
+
const { t } = useTranslation("globalEntry");
|
|
247
|
+
const tiles = [{
|
|
248
|
+
label: t(($) => $["unincorporatedPartnership"]),
|
|
249
|
+
value: "unincorporatedPartnership",
|
|
250
|
+
icon: "trust"
|
|
251
|
+
}, {
|
|
252
|
+
label: t(($) => $["unincorporatedAssociation"]),
|
|
253
|
+
value: "unincorporatedAssociation",
|
|
254
|
+
icon: "trust"
|
|
255
|
+
}];
|
|
256
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Field, {
|
|
257
|
+
el: "fieldset",
|
|
258
|
+
name: "unincorporatedOrganizationType",
|
|
259
|
+
label: t(($) => $["whichBestDescribesYourOrganization"]),
|
|
260
|
+
errorMessage: errors.unincorporatedOrganizationType,
|
|
261
|
+
isValid: valid?.unincorporatedOrganizationType,
|
|
262
|
+
children: () => /* @__PURE__ */ jsxs(StackLayout, { children: [/* @__PURE__ */ jsx(Button, {
|
|
263
|
+
variant: "link",
|
|
264
|
+
onClick: () => {},
|
|
265
|
+
children: /* @__PURE__ */ jsx(Typography, { children: t(($) => $["whatDoesThisMean"], { ns: "common" }) })
|
|
266
|
+
}), /* @__PURE__ */ jsx(TileGroup, {
|
|
267
|
+
name: "unincorporatedOrganizationType",
|
|
268
|
+
selected: data?.unincorporatedOrganizationType ?? "",
|
|
269
|
+
onChange: (value) => handleChangeFor("unincorporatedOrganizationType")(value),
|
|
270
|
+
tiles,
|
|
271
|
+
isHorizontal: true
|
|
272
|
+
})] })
|
|
273
|
+
}), data?.unincorporatedOrganizationType === "unincorporatedAssociation" && /* @__PURE__ */ jsx(Alert, {
|
|
274
|
+
variant: "error",
|
|
275
|
+
title: t(($) => $["unincorporatedAssociationsArentSupported"]),
|
|
276
|
+
children: /* @__PURE__ */ jsx(Typography, {
|
|
277
|
+
variant: "body",
|
|
278
|
+
children: t(($) => $["contactYourPlatformsSupportForHelp"])
|
|
279
|
+
})
|
|
280
|
+
})] });
|
|
281
|
+
};
|
|
282
|
+
//#endregion
|
|
283
|
+
//#region src/components/GlobalEntry/globalEntryKeyMapping.ts
|
|
284
|
+
/**
|
|
285
|
+
* Schema-keyed mapping, for reading a legal entity into the form schema.
|
|
286
|
+
*/
|
|
287
|
+
var globalEntryKeyMappingForOrgs = {
|
|
288
|
+
"entityInformation.country": "organization.registeredAddress.country",
|
|
289
|
+
"entityInformation.stateOrProvince": "organization.registeredAddress.stateOrProvince",
|
|
290
|
+
"registrationInformation.legalCompanyName": "organization.legalName",
|
|
291
|
+
"registrationInformation.registrationNumber": "organization.registrationNumber",
|
|
292
|
+
"registrationInformation.exemptedFromRegistrationNumber": "organization.registrationNumberAbsent",
|
|
293
|
+
"registrationInformation.taxInformation": "organization.taxInformation",
|
|
294
|
+
"registrationInformation.countryOfGoverningLaw": "organization.countryOfGoverningLaw"
|
|
295
|
+
};
|
|
296
|
+
var globalEntryKeyMappingForIndividuals = {
|
|
297
|
+
"entityInformation.country": "individual.residentialAddress.country",
|
|
298
|
+
"entityInformation.stateOrProvince": "individual.residentialAddress.stateOrProvince"
|
|
299
|
+
};
|
|
300
|
+
var globalEntryKeyMappingForSoleProps = {
|
|
301
|
+
"entityInformation.country": "soleProprietorship.registeredAddress.country",
|
|
302
|
+
"entityInformation.stateOrProvince": "soleProprietorship.registeredAddress.stateOrProvince",
|
|
303
|
+
"registrationInformation.legalCompanyName": "soleProprietorship.name",
|
|
304
|
+
"registrationInformation.registrationNumber": "soleProprietorship.registrationNumber",
|
|
305
|
+
"registrationInformation.taxInformation": "soleProprietorship.taxInformation",
|
|
306
|
+
"registrationInformation.exemptedFromTax": "soleProprietorship.taxAbsent",
|
|
307
|
+
"registrationInformation.countryOfGoverningLaw": "soleProprietorship.countryOfGoverningLaw"
|
|
308
|
+
};
|
|
309
|
+
/** Api-keyed mapping, for building the legal entity request from the form schema */
|
|
310
|
+
var globalEntryApiKeyMappingForOrgs = reverseMapping(globalEntryKeyMappingForOrgs);
|
|
311
|
+
/** Api-keyed mapping, for building the sole proprietorship request from the form schema */
|
|
312
|
+
var globalEntryApiKeyMappingForSoleProps = reverseMapping(globalEntryKeyMappingForSoleProps);
|
|
313
|
+
/** Api-keyed mapping, for building the legal entity request from the form schema */
|
|
314
|
+
var globalEntryApiKeyMappingForIndividuals = reverseMapping(globalEntryKeyMappingForIndividuals);
|
|
315
|
+
//#endregion
|
|
316
|
+
//#region src/components/GlobalEntry/utils.ts
|
|
317
|
+
var getGlobalEntryCompanyType = (legalEntity, data) => {
|
|
318
|
+
if (data.entityInformation.entitySetup === "partOfABusiness") {
|
|
319
|
+
if (legalEntity?.organization?.type) return legalEntity?.organization?.type || void 0;
|
|
320
|
+
}
|
|
321
|
+
if (data.entityInformation.entitySetup === "justMe") {
|
|
322
|
+
const hasSoleProprietorshipAssociation = legalEntity && hasSolePropInLegalEntity(legalEntity);
|
|
323
|
+
return data.registrationInformation.filedPaperwork === "yes" || hasSoleProprietorshipAssociation ? CompanyTypesValues.SOLE_PROPRIETORSHIP : LegalEntityTypes.INDIVIDUAL;
|
|
324
|
+
}
|
|
325
|
+
};
|
|
326
|
+
var determineEntitySetup = (legalEntity) => {
|
|
327
|
+
if (isPartOfUnincorporatedPartnership(legalEntity) && legalEntity.type === "individual") return "partOfABusiness";
|
|
328
|
+
if (legalEntity.type === "individual") return "justMe";
|
|
329
|
+
return "partOfABusiness";
|
|
330
|
+
};
|
|
331
|
+
/**
|
|
332
|
+
* @param legalEntity the root entity
|
|
333
|
+
* @param associatedSoleProp the proprietorship associated to the root, when there is one. It holds
|
|
334
|
+
* the registration details the root does not, so editing an existing proprietorship prefills.
|
|
335
|
+
*/
|
|
336
|
+
var mapLegalEntityToGlobalEntrySchema = (legalEntity, associatedSoleProp) => {
|
|
337
|
+
const soleProprietorship = associatedSoleProp?.soleProprietorship ?? (legalEntity.type === LegalEntityTypes.SOLE_PROPRIETORSHIP ? legalEntity.soleProprietorship : void 0);
|
|
338
|
+
const isSoleProprietorship = !!soleProprietorship;
|
|
339
|
+
const taxInformation = isSoleProprietorship ? soleProprietorship.taxInformation : legalEntity.organization?.taxInformation;
|
|
340
|
+
const registrationNumber = isSoleProprietorship ? soleProprietorship.registrationNumber : legalEntity.organization?.registrationNumber;
|
|
341
|
+
const currentCountryTaxInformation = taxInformation?.find((taxInformationItem) => taxInformationItem.country === getLegalEntityCountry(legalEntity));
|
|
342
|
+
const isUen = currentCountryTaxInformation?.type === "UEN";
|
|
343
|
+
return {
|
|
344
|
+
entityInformation: {
|
|
345
|
+
entitySetup: determineEntitySetup(legalEntity),
|
|
346
|
+
country: getLegalEntityCountry(legalEntity)
|
|
347
|
+
},
|
|
348
|
+
registrationInformation: {
|
|
349
|
+
filedPaperwork: taxInformation ? "yes" : isPartOfUnincorporatedPartnership(legalEntity) ? "no" : null,
|
|
350
|
+
unincorporatedOrganizationType: isPartOfUnincorporatedPartnership(legalEntity) ? "unincorporatedPartnership" : void 0,
|
|
351
|
+
legalCompanyName: isSoleProprietorship ? soleProprietorship.name : legalEntity.organization?.legalName,
|
|
352
|
+
registrationNumber: isUen ? currentCountryTaxInformation?.number : registrationNumber,
|
|
353
|
+
exemptedFromRegistrationNumber: isSoleProprietorship ? soleProprietorship.taxAbsent : legalEntity.organization?.registrationNumberAbsent,
|
|
354
|
+
countryOfGoverningLaw: isSoleProprietorship ? soleProprietorship.countryOfGoverningLaw : legalEntity.organization?.countryOfGoverningLaw,
|
|
355
|
+
taxInformation,
|
|
356
|
+
isUen
|
|
357
|
+
},
|
|
358
|
+
primaryPartner: { primaryPartnerType: isPartOfUnincorporatedPartnership(legalEntity) ? legalEntity.type === "individual" ? "individual" : "organization" : void 0 }
|
|
359
|
+
};
|
|
360
|
+
};
|
|
361
|
+
var isSoleProprietorship = (data) => data.entityInformation?.entitySetup === "justMe" && data.registrationInformation?.filedPaperwork === "yes";
|
|
362
|
+
var isUnincorporatedPartnership = (data) => data.entityInformation?.entitySetup === "partOfABusiness" && data.registrationInformation?.unincorporatedOrganizationType === "unincorporatedPartnership";
|
|
363
|
+
/**
|
|
364
|
+
* If switching to a non-SoleProp or a non-UnincorporatedPartnership, the associations
|
|
365
|
+
* should be dropped.
|
|
366
|
+
*/
|
|
367
|
+
var shouldClearEntityAssociations = (data, legalEntity) => getOwnEntityAssociations(legalEntity).length > 0 && !isSoleProprietorship(data) && !isUnincorporatedPartnership(data);
|
|
368
|
+
/**
|
|
369
|
+
* `justMe` is always a natural person. Being part of a business only makes the entity an
|
|
370
|
+
* `organization` when the primary partner is not an individual, because an individual partner in an
|
|
371
|
+
* unincorporated partnership stays an individual legal entity.
|
|
372
|
+
*/
|
|
373
|
+
var determineLegalEntityType = (data) => data.entityInformation?.entitySetup === "partOfABusiness" && data.primaryPartner?.primaryPartnerType !== "individual" ? LegalEntityTypes.ORGANIZATION : LegalEntityTypes.INDIVIDUAL;
|
|
374
|
+
var determineEntityAssociations = (data, legalEntity, newSoleProp) => {
|
|
375
|
+
/** Sole props are the only association we create and associate in Global Entry */
|
|
376
|
+
if (newSoleProp) return [{
|
|
377
|
+
type: LegalEntityTypes.SOLE_PROPRIETORSHIP,
|
|
378
|
+
legalEntityId: newSoleProp.id
|
|
379
|
+
}];
|
|
380
|
+
return shouldClearEntityAssociations(data, legalEntity) ? [] : void 0;
|
|
381
|
+
};
|
|
382
|
+
var mapGlobalEntrySchemaToLegalEntity = (data, legalEntity, newSoleProp) => {
|
|
383
|
+
const mapping = determineLegalEntityType(data) === LegalEntityTypes.ORGANIZATION ? globalEntryApiKeyMappingForOrgs : globalEntryApiKeyMappingForIndividuals;
|
|
384
|
+
const entityAssociations = determineEntityAssociations(data, legalEntity, newSoleProp);
|
|
385
|
+
return {
|
|
386
|
+
...formatObject(data, mapping),
|
|
387
|
+
id: legalEntity.id,
|
|
388
|
+
type: determineLegalEntityType(data),
|
|
389
|
+
...entityAssociations && { entityAssociations }
|
|
390
|
+
};
|
|
391
|
+
};
|
|
392
|
+
var mapGlobalEntrySchemaToSoleProp = (data) => {
|
|
393
|
+
const { soleProprietorship } = formatObject(data, globalEntryApiKeyMappingForSoleProps);
|
|
394
|
+
return {
|
|
395
|
+
type: LegalEntityTypes.SOLE_PROPRIETORSHIP,
|
|
396
|
+
soleProprietorship: {
|
|
397
|
+
...soleProprietorship,
|
|
398
|
+
/**
|
|
399
|
+
* A proprietorship always has a governing law, but the field is only put to the user in the
|
|
400
|
+
* countries that can differ from where they registered, so the rest fall back to that.
|
|
401
|
+
*/
|
|
402
|
+
countryOfGoverningLaw: data.registrationInformation?.countryOfGoverningLaw ?? data.entityInformation?.country
|
|
403
|
+
}
|
|
404
|
+
};
|
|
405
|
+
};
|
|
406
|
+
/**
|
|
407
|
+
* The account holder is derived from the form data, not sent to the API and is kept client-side.
|
|
408
|
+
*/
|
|
409
|
+
var determineAccountHolder = (data) => {
|
|
410
|
+
const entitySetup = data.entityInformation?.entitySetup;
|
|
411
|
+
const { filedPaperwork, unincorporatedOrganizationType } = data.registrationInformation;
|
|
412
|
+
if (entitySetup === "justMe") return filedPaperwork === "yes" ? "mySoleProprietorName" : "myName";
|
|
413
|
+
if (entitySetup === "partOfABusiness") {
|
|
414
|
+
if (unincorporatedOrganizationType === "unincorporatedPartnership") return "anUnincorporatedPartnership";
|
|
415
|
+
if (filedPaperwork === "yes") return "theCompanyIWorkFor";
|
|
416
|
+
}
|
|
417
|
+
};
|
|
418
|
+
var submitGlobalEntry = async ({ legalEntity, associatedSoleProp, data, updateLegalEntity, createLegalEntity }) => {
|
|
419
|
+
let newSoleProp;
|
|
420
|
+
if (isSoleProprietorship(data)) {
|
|
421
|
+
const mappedSolePropData = mapGlobalEntrySchemaToSoleProp(data);
|
|
422
|
+
if (associatedSoleProp?.id) {
|
|
423
|
+
const { type: _type, ...soleProprietorshipDetails } = mappedSolePropData;
|
|
424
|
+
await updateLegalEntity({
|
|
425
|
+
...soleProprietorshipDetails,
|
|
426
|
+
id: associatedSoleProp.id
|
|
427
|
+
});
|
|
428
|
+
} else
|
|
429
|
+
/**
|
|
430
|
+
* Created first so the entity can be associated to it below, which keeps this to a single
|
|
431
|
+
* write against the entity itself.
|
|
432
|
+
*/
|
|
433
|
+
newSoleProp = await createLegalEntity(mappedSolePropData);
|
|
434
|
+
}
|
|
435
|
+
const { type: targetType, ...legalEntityData } = mapGlobalEntrySchemaToLegalEntity(data, legalEntity, newSoleProp ? newSoleProp : void 0);
|
|
436
|
+
/**
|
|
437
|
+
* LEM rejects a change of type in the same request as the data
|
|
438
|
+
*/
|
|
439
|
+
if (targetType !== legalEntity.type) await updateLegalEntity({
|
|
440
|
+
id: legalEntity.id,
|
|
441
|
+
type: targetType
|
|
442
|
+
});
|
|
443
|
+
await updateLegalEntity(legalEntityData);
|
|
444
|
+
return determineAccountHolder(data);
|
|
445
|
+
};
|
|
446
|
+
//#endregion
|
|
447
|
+
//#region src/components/GlobalEntry/forms/RegistrationInformation/RegistrationInformation.tsx
|
|
448
|
+
var REGISTRATION_INFORMATION_FIELDS = [
|
|
449
|
+
...PAPERWORK_QUESTIONNAIRE_FIELD,
|
|
450
|
+
...UNINCORPORATED_ORGANIZATION_TYPE_FIELD,
|
|
451
|
+
...LEGAL_COMPANY_NAME_FIELD,
|
|
452
|
+
"jaHaniLegalCompanyName",
|
|
453
|
+
"jaKanaLegalCompanyName",
|
|
454
|
+
...COUNTRY_OF_GOVERNING_LAW_FIELD,
|
|
455
|
+
...BUSINESS_REGISTRATION_NUMBER_FIELD,
|
|
456
|
+
...TAX_INFORMATION_FIELD
|
|
457
|
+
];
|
|
458
|
+
var RegistrationInformation = ({ id, shouldValidate, legalEntity, country }) => {
|
|
459
|
+
const { form } = useFormContext();
|
|
460
|
+
const { t: commonT } = useTranslation("common");
|
|
461
|
+
const { t: globalEntryT } = useTranslation("globalEntry");
|
|
462
|
+
const { t: businessT } = useTranslation("business");
|
|
463
|
+
const { defaultData } = form;
|
|
464
|
+
const { data, errors, valid, requiredFields, optionalFields, trustedFields, fieldProblems, handleChange: handleChangeFor } = getFormSlice(form, "registrationInformation");
|
|
465
|
+
const companyType = getGlobalEntryCompanyType(legalEntity, form.data);
|
|
466
|
+
const registrationCompanyType = companyType === "individual" ? void 0 : companyType;
|
|
467
|
+
const formUtils = createFormUtils({
|
|
468
|
+
requiredFields,
|
|
469
|
+
optionalFields,
|
|
470
|
+
trustedFields
|
|
471
|
+
}, commonT);
|
|
472
|
+
const legalCompanyNameFields = useLegalCompanyNameField({
|
|
473
|
+
data: data ?? {},
|
|
474
|
+
valid: valid ?? {},
|
|
475
|
+
errors: errors ?? {},
|
|
476
|
+
fieldProblems: fieldProblems ?? {},
|
|
477
|
+
country,
|
|
478
|
+
formUtils,
|
|
479
|
+
handleChange: handleChangeFor,
|
|
480
|
+
t: businessT
|
|
481
|
+
});
|
|
482
|
+
const showField = (fieldKeys) => fieldKeys.some((field) => formUtils.isRequiredField(field) || formUtils.isOptionalField(field));
|
|
483
|
+
return /* @__PURE__ */ jsxs("form", {
|
|
484
|
+
id,
|
|
485
|
+
children: [
|
|
486
|
+
/* @__PURE__ */ jsx(Header, {
|
|
487
|
+
title: commonT(($) => $["tellUsAboutYourBusiness"]),
|
|
488
|
+
description: globalEntryT(($) => $["toHelpYouGetSetUp"])
|
|
489
|
+
}),
|
|
490
|
+
/* @__PURE__ */ jsx(PaperworkQuestionnaire, {
|
|
491
|
+
data: { filedPaperwork: data.filedPaperwork },
|
|
492
|
+
valid: { filedPaperwork: valid.filedPaperwork },
|
|
493
|
+
errors: { filedPaperwork: formUtils.getErrorMessage("filedPaperwork", errors, fieldProblems) },
|
|
494
|
+
label: form.data.entityInformation.entitySetup === "partOfABusiness" ? globalEntryT(($) => $["hasPaperworkBeenFiled"]) : globalEntryT(($) => $["areYourBusinessActivitiesRegisteredWithAGovernmentAuthority"]),
|
|
495
|
+
handleChangeFor
|
|
496
|
+
}),
|
|
497
|
+
showField(COUNTRY_OF_GOVERNING_LAW_FIELD) && /* @__PURE__ */ jsx(CountryOfGoverningLawField, {
|
|
498
|
+
data: { countryOfGoverningLaw: data.countryOfGoverningLaw },
|
|
499
|
+
valid: { countryOfGoverningLaw: valid.countryOfGoverningLaw },
|
|
500
|
+
errors: { countryOfGoverningLaw: formUtils.getErrorMessage("countryOfGoverningLaw", errors, fieldProblems) },
|
|
501
|
+
country,
|
|
502
|
+
handleChangeFor
|
|
503
|
+
}),
|
|
504
|
+
showField(UNINCORPORATED_ORGANIZATION_TYPE_FIELD) && /* @__PURE__ */ jsx(UnincorporatedOrganizationTypeField, {
|
|
505
|
+
data: { unincorporatedOrganizationType: data.unincorporatedOrganizationType },
|
|
506
|
+
valid: { unincorporatedOrganizationType: valid.unincorporatedOrganizationType },
|
|
507
|
+
errors: { unincorporatedOrganizationType: formUtils.getErrorMessage("unincorporatedOrganizationType", errors, fieldProblems) },
|
|
508
|
+
handleChangeFor
|
|
509
|
+
}),
|
|
510
|
+
showField(LEGAL_COMPANY_NAME_FIELD) && legalCompanyNameFields.filter(Boolean).map((field) => /* @__PURE__ */ jsx(Field, {
|
|
511
|
+
name: field?.name ?? "",
|
|
512
|
+
label: field?.label,
|
|
513
|
+
formatGuidance: field?.guidance,
|
|
514
|
+
errorMessage: field?.errorMessage,
|
|
515
|
+
isValid: Boolean(field?.isValid),
|
|
516
|
+
children: (childProps) => /* @__PURE__ */ jsx(InputText, {
|
|
517
|
+
...childProps,
|
|
518
|
+
"aria-required": true,
|
|
519
|
+
"aria-invalid": !field?.isValid,
|
|
520
|
+
name: field?.name,
|
|
521
|
+
value: field?.value,
|
|
522
|
+
readonly: field?.readonly,
|
|
523
|
+
onInput: field ? field.onInput : () => {},
|
|
524
|
+
transformInput: field?.transformInput,
|
|
525
|
+
transformMode: field?.transformMode,
|
|
526
|
+
onBlur: field?.onBlur,
|
|
527
|
+
onKeyDown: field?.onKeyDown
|
|
528
|
+
})
|
|
529
|
+
}, field?.name)),
|
|
530
|
+
showField(TAX_INFORMATION_FIELD) && /* @__PURE__ */ jsx(TaxInformationField, {
|
|
531
|
+
data: {
|
|
532
|
+
taxInformation: data.taxInformation,
|
|
533
|
+
exemptedFromTax: data.exemptedFromTax,
|
|
534
|
+
isUen: data.isUen
|
|
535
|
+
},
|
|
536
|
+
valid: {
|
|
537
|
+
taxInformation: valid.taxInformation,
|
|
538
|
+
exemptedFromTax: valid.exemptedFromTax,
|
|
539
|
+
isUen: valid.isUen
|
|
540
|
+
},
|
|
541
|
+
errors: formUtils.getFieldErrors(errors, fieldProblems, TAX_INFORMATION_FIELD),
|
|
542
|
+
placeholder: getTaxInformationPlaceholderText({
|
|
543
|
+
country,
|
|
544
|
+
companyType,
|
|
545
|
+
taxIdNumberType: data?.taxInformation?.find((tax) => tax.country === country)?.type
|
|
546
|
+
}),
|
|
547
|
+
shouldValidate,
|
|
548
|
+
readonly: formUtils.isReadOnly("taxInformation"),
|
|
549
|
+
handleChangeFor,
|
|
550
|
+
canExempt: showField(["exemptedFromTax"]),
|
|
551
|
+
registrationNumber: data.registrationNumber,
|
|
552
|
+
country,
|
|
553
|
+
entityType: companyType,
|
|
554
|
+
defaultData: defaultData?.registrationInformation.taxInformation
|
|
555
|
+
}),
|
|
556
|
+
showField(BUSINESS_REGISTRATION_NUMBER_FIELD) && /* @__PURE__ */ jsx(BusinessRegistrationNumberField, {
|
|
557
|
+
data: {
|
|
558
|
+
registrationNumber: data.registrationNumber,
|
|
559
|
+
registrationNumberType: data.registrationNumberType,
|
|
560
|
+
exemptedFromRegistrationNumber: data.exemptedFromRegistrationNumber
|
|
561
|
+
},
|
|
562
|
+
valid: {
|
|
563
|
+
registrationNumber: valid.registrationNumber,
|
|
564
|
+
registrationNumberType: valid.registrationNumberType,
|
|
565
|
+
exemptedFromRegistrationNumber: valid.exemptedFromRegistrationNumber
|
|
566
|
+
},
|
|
567
|
+
errors: formUtils.getFieldErrors(errors, fieldProblems, BUSINESS_REGISTRATION_NUMBER_FIELD),
|
|
568
|
+
shouldValidate,
|
|
569
|
+
readonly: formUtils.isReadOnly("registrationNumber"),
|
|
570
|
+
optional: formUtils.isOptionalField("registrationNumber"),
|
|
571
|
+
handleChangeFor,
|
|
572
|
+
country,
|
|
573
|
+
state: form.data.entityInformation.stateOrProvince,
|
|
574
|
+
canExempt: showField(["exemptedFromRegistrationNumber"]),
|
|
575
|
+
companyType: registrationCompanyType
|
|
576
|
+
})
|
|
577
|
+
]
|
|
578
|
+
});
|
|
579
|
+
};
|
|
580
|
+
//#endregion
|
|
581
|
+
//#region src/components/GlobalEntry/constants.ts
|
|
582
|
+
var globalEntryForms = {
|
|
583
|
+
entityInformation: {
|
|
584
|
+
formId: "entityInformation",
|
|
585
|
+
formName: "entityInformationFormName",
|
|
586
|
+
fields: ENTITY_INFORMATION_FIELDS
|
|
587
|
+
},
|
|
588
|
+
registrationInformation: {
|
|
589
|
+
formId: "registrationInformation",
|
|
590
|
+
formName: "registrationInformationFormName",
|
|
591
|
+
fields: REGISTRATION_INFORMATION_FIELDS
|
|
592
|
+
},
|
|
593
|
+
primaryPartner: {
|
|
594
|
+
formId: "primaryPartner",
|
|
595
|
+
formName: "primaryPartnerFormName",
|
|
596
|
+
fields: PRIMARY_PARTNER_FIELDS
|
|
597
|
+
}
|
|
598
|
+
};
|
|
599
|
+
//#endregion
|
|
600
|
+
//#region src/components/GlobalEntry/rules.ts
|
|
601
|
+
var globalEntryFieldRuleConfigurations = {
|
|
602
|
+
entitySetup: { rule: "entitySetupRequired" },
|
|
603
|
+
primaryPartnerType: { rule: "primaryPartnerTypeRequired" },
|
|
604
|
+
country: { rule: "countryRequired" },
|
|
605
|
+
stateOrProvince: { rule: "requireStateOrProvinceForCompanySearch" },
|
|
606
|
+
countryOfGoverningLaw: { rule: "countryOfGoverningLawRequired" },
|
|
607
|
+
filedPaperwork: { rule: "filedPaperworkRequired" },
|
|
608
|
+
unincorporatedOrganizationType: { rule: "unincorporatedOrganizationTypeRequired" },
|
|
609
|
+
legalCompanyName: { rule: "legalCompanyNameRequired" },
|
|
610
|
+
jaHaniLegalCompanyName: { rule: "jaHaniLegalCompanyName" },
|
|
611
|
+
jaKanaLegalCompanyName: { rule: "jaKanaLegalCompanyName" },
|
|
612
|
+
registrationNumber: { rule: "countryRequiresRegistrationNumber" },
|
|
613
|
+
registrationNumberType: { rule: "registrationNumberType" },
|
|
614
|
+
exemptedFromRegistrationNumber: { rule: "companyRegistrationNumberExemptionAllowed" },
|
|
615
|
+
taxInformation: { rule: "taxInformationRequired" },
|
|
616
|
+
exemptedFromTax: { rule: "countryHasTaxExemptions" }
|
|
617
|
+
};
|
|
618
|
+
var globalEntryCustomRules = ({ accountHolder, data, isFeatureEnabled = () => false, country, taskType, rootLegalEntity }) => {
|
|
619
|
+
const hasFiledPaperwork = data.registrationInformation?.filedPaperwork === "yes";
|
|
620
|
+
const hasAnsweredPaperworkQuestion = !!data.registrationInformation?.filedPaperwork;
|
|
621
|
+
const isPartOfABusiness = data.entityInformation?.entitySetup === "partOfABusiness";
|
|
622
|
+
const isSoleProp = isSoleProprietorship(data);
|
|
623
|
+
const isExemptFromRegistrationNumber = Boolean(data.registrationInformation?.exemptedFromRegistrationNumber);
|
|
624
|
+
const existingRegistrationNumber = rootLegalEntity?.type === "soleProprietorship" ? rootLegalEntity.soleProprietorship?.registrationNumber : rootLegalEntity?.organization?.registrationNumber;
|
|
625
|
+
const isUnincorporatedOrganization = isPartOfABusiness && data?.registrationInformation?.filedPaperwork === "no";
|
|
626
|
+
return createFormRules({
|
|
627
|
+
entitySetupRequired: () => "REQUIRED",
|
|
628
|
+
countryRequired: () => "REQUIRED",
|
|
629
|
+
requireStateOrProvinceForCompanySearch: () => {
|
|
630
|
+
if (isUsingCompanySearch(country, taskType) && COUNTRIES_WITH_STATES_DATASET.includes(country)) return "REQUIRED";
|
|
631
|
+
},
|
|
632
|
+
countryOfGoverningLawRequired: () => {
|
|
633
|
+
if (isFeatureEnabled("EnableCountryOfGoverningLawForUKCompanies") && COUNTRY_OF_GOVERNING_LAW_POSSIBLE.includes(country) && (isPartOfABusiness || isSoleProp) && hasAnsweredPaperworkQuestion) return "REQUIRED";
|
|
634
|
+
},
|
|
635
|
+
filedPaperworkRequired: () => "REQUIRED",
|
|
636
|
+
unincorporatedOrganizationTypeRequired: () => isUnincorporatedOrganization ? "REQUIRED" : void 0,
|
|
637
|
+
legalCompanyNameRequired: () => hasFiledPaperwork ? "REQUIRED" : void 0,
|
|
638
|
+
jaHaniLegalCompanyName: () => {
|
|
639
|
+
if (hasFiledPaperwork && isJapanLocalizationEnabled(isFeatureEnabled, country)) return "REQUIRED";
|
|
640
|
+
},
|
|
641
|
+
jaKanaLegalCompanyName: () => {
|
|
642
|
+
if (hasFiledPaperwork && isJapanLocalizationEnabled(isFeatureEnabled, country)) return "REQUIRED";
|
|
643
|
+
},
|
|
644
|
+
countryRequiresRegistrationNumber: () => {
|
|
645
|
+
if (!hasFiledPaperwork) return;
|
|
646
|
+
if (isSoleProp) {
|
|
647
|
+
if (COUNTRIES_THAT_DONT_REQUIRE_SOLE_PROP_REGISTRATION.includes(country)) return;
|
|
648
|
+
if (COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER_SOLE_PROPS.includes(country)) return "OPTIONAL";
|
|
649
|
+
return isExemptFromRegistrationNumber ? "OPTIONAL" : "REQUIRED";
|
|
650
|
+
}
|
|
651
|
+
if (isPartOfABusiness) {
|
|
652
|
+
if (COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER.includes(country)) return "OPTIONAL";
|
|
653
|
+
if (country === CountryCodes.HongKong) {
|
|
654
|
+
if (!existingRegistrationNumber) return;
|
|
655
|
+
return isExemptFromRegistrationNumber ? "OPTIONAL" : "REQUIRED";
|
|
656
|
+
}
|
|
657
|
+
if (!COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION.includes(country)) return isExemptFromRegistrationNumber ? void 0 : "REQUIRED";
|
|
658
|
+
}
|
|
659
|
+
},
|
|
660
|
+
registrationNumberType: () => {
|
|
661
|
+
if (!hasFiledPaperwork) return;
|
|
662
|
+
if (isSoleProp) return COUNTRIES_THAT_DONT_REQUIRE_SOLE_PROP_REGISTRATION.includes(country) ? void 0 : "OPTIONAL";
|
|
663
|
+
if (isPartOfABusiness) {
|
|
664
|
+
if (COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER.includes(country)) return "OPTIONAL";
|
|
665
|
+
if (COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION.includes(country)) return;
|
|
666
|
+
return "OPTIONAL";
|
|
667
|
+
}
|
|
668
|
+
},
|
|
669
|
+
companyRegistrationNumberExemptionAllowed: () => {
|
|
670
|
+
if (!hasFiledPaperwork) return;
|
|
671
|
+
if (isSoleProp) {
|
|
672
|
+
if (!COUNTRIES_WITH_POSSIBLE_REGISTRATION_EXEMPTIONS_FOR_SOLE_PROPS.includes(country)) return;
|
|
673
|
+
return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
|
|
674
|
+
}
|
|
675
|
+
if (isPartOfABusiness) {
|
|
676
|
+
const companyType = getGlobalEntryCompanyType(rootLegalEntity, data);
|
|
677
|
+
if (!isRegistrationExemptionAllowed(country)) return;
|
|
678
|
+
const allowedTypes = REGISTRATION_NUMBER_EXEMPTION_RULES[country];
|
|
679
|
+
if (allowedTypes.length > 0 && !allowedTypes.includes(companyType)) return;
|
|
680
|
+
/**
|
|
681
|
+
* Country-specific guard checks before applying the shared exemption rule result.
|
|
682
|
+
*
|
|
683
|
+
* - HK first enforces the legacy registration-number presence guard for existing entities.
|
|
684
|
+
* - AU/NZ then enforce the absent-state V4 feature flag gate.
|
|
685
|
+
*/
|
|
686
|
+
switch (country) {
|
|
687
|
+
case CountryCodes.HongKong:
|
|
688
|
+
if (!existingRegistrationNumber) return;
|
|
689
|
+
return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
|
|
690
|
+
case CountryCodes.Australia:
|
|
691
|
+
case CountryCodes.NewZealand:
|
|
692
|
+
if (!isFeatureEnabled("EnableRegistrationAndTaxAbsentStatesV4")) return;
|
|
693
|
+
return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
|
|
694
|
+
default: return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
},
|
|
698
|
+
taxInformationRequired: () => {
|
|
699
|
+
const requiredUnlessExempt = Boolean(data.registrationInformation?.exemptedFromTax) ? "OPTIONAL" : "REQUIRED";
|
|
700
|
+
const usesTaxIdInsteadOfVat = COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT.includes(country);
|
|
701
|
+
if (!hasFiledPaperwork) return;
|
|
702
|
+
if (isPartOfABusiness) {
|
|
703
|
+
if (rootLegalEntity?.type === "organization" && keysOf(rootLegalEntity.capabilities ?? {}).includes("issueBankAccount")) {
|
|
704
|
+
if (TAX_ID_REQUIRED_COUNTRIES_ORGANIZATION.includes(country)) return requiredUnlessExempt;
|
|
705
|
+
if (country === CountryCodes.Italy && data.registrationInformation?.registrationNumberType === "CCIAA") return requiredUnlessExempt;
|
|
706
|
+
}
|
|
707
|
+
if (usesTaxIdInsteadOfVat) return requiredUnlessExempt;
|
|
708
|
+
}
|
|
709
|
+
if (isSoleProp) {
|
|
710
|
+
if (COUNTRIES_THAT_DO_NOT_USE_TAX_ID_FOR_SOLE_PROP.includes(country)) return;
|
|
711
|
+
if (usesTaxIdInsteadOfVat) return requiredUnlessExempt;
|
|
712
|
+
}
|
|
713
|
+
},
|
|
714
|
+
countryHasTaxExemptions: () => {
|
|
715
|
+
if (!hasFiledPaperwork) return;
|
|
716
|
+
const isExemptFromTax = Boolean(data.registrationInformation?.exemptedFromTax);
|
|
717
|
+
if (isSoleProp) {
|
|
718
|
+
if (!COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_SOLE_PROPS.includes(country)) return;
|
|
719
|
+
return isExemptFromTax ? "REQUIRED" : "OPTIONAL";
|
|
720
|
+
}
|
|
721
|
+
if (isFeatureEnabled("EnableRegistrationAndTaxAbsentStatesV4") && COUNTRIES_WITH_POSSIBLE_TRUSTEE_TAXID_ABSENT_V4.includes(country) && accountHolder === "aTrust") return isExemptFromTax ? "REQUIRED" : "OPTIONAL";
|
|
722
|
+
if (COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_COMPANIES.includes(country)) return isExemptFromTax ? "REQUIRED" : "OPTIONAL";
|
|
723
|
+
},
|
|
724
|
+
primaryPartnerTypeRequired: () => isUnincorporatedOrganization && data.registrationInformation.unincorporatedOrganizationType === "unincorporatedPartnership" ? "REQUIRED" : void 0
|
|
725
|
+
});
|
|
726
|
+
};
|
|
727
|
+
//#endregion
|
|
728
|
+
//#region src/components/GlobalEntry/validate.ts
|
|
729
|
+
var globalEntryValidationRules = ({ data, legalEntity, isFeatureEnabled = () => false }) => {
|
|
730
|
+
const country = data?.entityInformation?.country ?? getLegalEntityCountry(legalEntity);
|
|
731
|
+
const countryOfGoverningLawValidators = CountryOfGoverningLawFieldValidation().countryOfGoverningLaw;
|
|
732
|
+
const useStrictNameValidation = isFeatureEnabled("StrictNameAndAddressValidationV4");
|
|
733
|
+
const legalCompanyNameValidators = resolveFieldMetadata(useStrictNameValidation ? defaultFieldConfigV4[country] : defaultFieldConfig[country], {}, useStrictNameValidation ? defaultFieldMetadataV4 : defaultFieldMetadata).validators;
|
|
734
|
+
const stateValidators = stateFieldMetadata.validators;
|
|
735
|
+
const taxIdNumberType = data?.registrationInformation?.taxInformation?.find((taxInformation) => taxInformation.country === country)?.type;
|
|
736
|
+
const companyType = data ? getGlobalEntryCompanyType(legalEntity, data) : void 0;
|
|
737
|
+
const taxInformationValidators = resolveFieldMetadata(taxInformationDefaultFieldConfig[country], {
|
|
738
|
+
taxIdNumberType,
|
|
739
|
+
companyType
|
|
740
|
+
}, taxInformationDefaultFieldMetadata).validators;
|
|
741
|
+
const registrationNumberValidators = resolveFieldMetadata(registrationNumberDefaultFieldConfig[country], {
|
|
742
|
+
registrationNumberType: data?.registrationInformation?.registrationNumberType,
|
|
743
|
+
state: data?.entityInformation?.stateOrProvince
|
|
744
|
+
}, registrationNumberDefaultFieldMetadata).validators;
|
|
745
|
+
return {
|
|
746
|
+
entityInformation: { stateOrProvince: stateValidators },
|
|
747
|
+
primaryPartner: { primaryPartnerType: {
|
|
748
|
+
validate: (value) => !!value,
|
|
749
|
+
modes: ["blur", "input"]
|
|
750
|
+
} },
|
|
751
|
+
registrationInformation: {
|
|
752
|
+
countryOfGoverningLaw: countryOfGoverningLawValidators,
|
|
753
|
+
legalCompanyName: legalCompanyNameValidators,
|
|
754
|
+
registrationNumber: registrationNumberValidators,
|
|
755
|
+
taxInformation: taxInformationValidators,
|
|
756
|
+
unincorporatedOrganizationType: {
|
|
757
|
+
validate: (value) => !!value && value !== "unincorporatedAssociation",
|
|
758
|
+
modes: ["blur", "input"]
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
};
|
|
762
|
+
};
|
|
763
|
+
//#endregion
|
|
764
|
+
//#region src/components/GlobalEntry/tasks/GlobalEntry.tsx
|
|
765
|
+
var GlobalEntry = ({ activeForm, legalEntity, shouldValidate, country }) => {
|
|
766
|
+
switch (activeForm.formId) {
|
|
767
|
+
case globalEntryForms.entityInformation.formId: return /* @__PURE__ */ jsx(EntityInformation, {
|
|
768
|
+
id: activeForm.formId,
|
|
769
|
+
country
|
|
770
|
+
});
|
|
771
|
+
case globalEntryForms.registrationInformation.formId: return /* @__PURE__ */ jsx(RegistrationInformation, {
|
|
772
|
+
id: activeForm.formId,
|
|
773
|
+
legalEntity,
|
|
774
|
+
shouldValidate,
|
|
775
|
+
country
|
|
776
|
+
});
|
|
777
|
+
case globalEntryForms.primaryPartner.formId: return /* @__PURE__ */ jsx(PrimaryPartner, { id: activeForm.formId });
|
|
778
|
+
default: return null;
|
|
779
|
+
}
|
|
780
|
+
};
|
|
781
|
+
//#endregion
|
|
782
|
+
//#region src/components/GlobalEntry/tasks/GlobalEntryModal.tsx
|
|
783
|
+
var GlobalEntryModal = ({ rootLegalEntity, onComplete }) => {
|
|
784
|
+
const { i18n, t } = useTranslation(["common", "globalEntry"]);
|
|
785
|
+
const { isFeatureEnabled } = useToggleContext();
|
|
786
|
+
const logger = createLogger();
|
|
787
|
+
const { showToast } = useToastContext();
|
|
788
|
+
const { accountHolder } = useAccountHolder();
|
|
789
|
+
const [derivedProps, setDerivedProps] = useState();
|
|
790
|
+
addResourceBundles(i18n, [{
|
|
791
|
+
ns: "globalEntry",
|
|
792
|
+
importFn: (lang) => _rolldown_dynamic_import_helper_default(/* @__PURE__ */ Object.assign({
|
|
793
|
+
"../language/bg-BG.json": () => import("./bg-BG-DpSUitm0.js"),
|
|
794
|
+
"../language/cs-CZ.json": () => import("./cs-CZ-C_VaBRMS.js"),
|
|
795
|
+
"../language/da-DK.json": () => import("./da-DK-BfaKncp5.js"),
|
|
796
|
+
"../language/de-DE.json": () => import("./de-DE-GUfA18ps.js"),
|
|
797
|
+
"../language/el-GR.json": () => import("./el-GR-CJqHd-CD.js"),
|
|
798
|
+
"../language/en-US.json": () => import("./en-US-BUmtG-Wj.js"),
|
|
799
|
+
"../language/es-ES.json": () => import("./es-ES-IobfbI71.js"),
|
|
800
|
+
"../language/es-LA.json": () => import("./es-LA--YYwwbVo.js"),
|
|
801
|
+
"../language/et-EE.json": () => import("./et-EE-DqYCOl2Y.js"),
|
|
802
|
+
"../language/fi-FI.json": () => import("./fi-FI-DSCFTLoG.js"),
|
|
803
|
+
"../language/fr-FR.json": () => import("./fr-FR-ZWnkRO7z.js"),
|
|
804
|
+
"../language/hr-HR.json": () => import("./hr-HR-2a3ywU0e.js"),
|
|
805
|
+
"../language/hu-HU.json": () => import("./hu-HU-BOXBLK1a.js"),
|
|
806
|
+
"../language/it-IT.json": () => import("./it-IT-Dj2NtH7G.js"),
|
|
807
|
+
"../language/ja-JP.json": () => import("./ja-JP-lXTbRXBb.js"),
|
|
808
|
+
"../language/lt-LT.json": () => import("./lt-LT-COUN4qC5.js"),
|
|
809
|
+
"../language/lv-LV.json": () => import("./lv-LV-DKbvF9t_.js"),
|
|
810
|
+
"../language/nl-NL.json": () => import("./nl-NL-CtK4OR3t.js"),
|
|
811
|
+
"../language/no-NO.json": () => import("./no-NO-CxZumo2p.js"),
|
|
812
|
+
"../language/pl-PL.json": () => import("./pl-PL-Csv1Lg5y.js"),
|
|
813
|
+
"../language/pt-BR.json": () => import("./pt-BR-IBsCApUj.js"),
|
|
814
|
+
"../language/pt-PT.json": () => import("./pt-PT-CYKk0WDI.js"),
|
|
815
|
+
"../language/ro-RO.json": () => import("./ro-RO-23qEGblz.js"),
|
|
816
|
+
"../language/sk-SK.json": () => import("./sk-SK-D8j8B4ng.js"),
|
|
817
|
+
"../language/sl-SI.json": () => import("./sl-SI-333ryFnM.js"),
|
|
818
|
+
"../language/sv-SE.json": () => import("./sv-SE-CwsP7bTA.js")
|
|
819
|
+
}), `../language/${lang}.json`, 3)
|
|
820
|
+
}]);
|
|
821
|
+
addResourceBundles(i18n, [{
|
|
822
|
+
ns: "business",
|
|
823
|
+
importFn: (lang) => _rolldown_dynamic_import_helper_default(/* @__PURE__ */ Object.assign({
|
|
824
|
+
"../../Business/language/bg-BG.json": () => import("./bg-BG-DYkxVgeJ.js"),
|
|
825
|
+
"../../Business/language/cs-CZ.json": () => import("./cs-CZ-lJQmuyHq.js"),
|
|
826
|
+
"../../Business/language/da-DK.json": () => import("./da-DK-D53M_d04.js"),
|
|
827
|
+
"../../Business/language/de-DE.json": () => import("./de-DE-qJPTCQlG.js"),
|
|
828
|
+
"../../Business/language/el-GR.json": () => import("./el-GR-Bx996PXx.js"),
|
|
829
|
+
"../../Business/language/en-US.json": () => import("./en-US-CJPD8qHc.js"),
|
|
830
|
+
"../../Business/language/es-ES.json": () => import("./es-ES-U4-lDfZq.js"),
|
|
831
|
+
"../../Business/language/es-LA.json": () => import("./es-LA-B5IRDCf_.js"),
|
|
832
|
+
"../../Business/language/et-EE.json": () => import("./et-EE-4_ZUNt3W.js"),
|
|
833
|
+
"../../Business/language/fi-FI.json": () => import("./fi-FI-D06EzKrW.js"),
|
|
834
|
+
"../../Business/language/fr-FR.json": () => import("./fr-FR-Dl4NL-Nc.js"),
|
|
835
|
+
"../../Business/language/hr-HR.json": () => import("./hr-HR-B11sggmG.js"),
|
|
836
|
+
"../../Business/language/hu-HU.json": () => import("./hu-HU-Dp6xOBN_.js"),
|
|
837
|
+
"../../Business/language/it-IT.json": () => import("./it-IT-BlaVymCj.js"),
|
|
838
|
+
"../../Business/language/ja-JP.json": () => import("./ja-JP-h3E8hgLv.js"),
|
|
839
|
+
"../../Business/language/lt-LT.json": () => import("./lt-LT-B18sQY9g.js"),
|
|
840
|
+
"../../Business/language/lv-LV.json": () => import("./lv-LV-adiXoKhv.js"),
|
|
841
|
+
"../../Business/language/nl-NL.json": () => import("./nl-NL-DOB0b0m4.js"),
|
|
842
|
+
"../../Business/language/no-NO.json": () => import("./no-NO-BG1sYkpp.js"),
|
|
843
|
+
"../../Business/language/pl-PL.json": () => import("./pl-PL-J9S3_lCf.js"),
|
|
844
|
+
"../../Business/language/pt-BR.json": () => import("./pt-BR-BYbyk6xS.js"),
|
|
845
|
+
"../../Business/language/pt-PT.json": () => import("./pt-PT-D8ldyR-j.js"),
|
|
846
|
+
"../../Business/language/ro-RO.json": () => import("./ro-RO-CnMe6Mfw.js"),
|
|
847
|
+
"../../Business/language/sk-SK.json": () => import("./sk-SK-Br1Y4_CN.js"),
|
|
848
|
+
"../../Business/language/sl-SI.json": () => import("./sl-SI-DHPadSTy.js"),
|
|
849
|
+
"../../Business/language/sv-SE.json": () => import("./sv-SE-BXrlr0X5.js")
|
|
850
|
+
}), `../../Business/language/${lang}.json`, 5)
|
|
851
|
+
}]);
|
|
852
|
+
const handleClose = () => {
|
|
853
|
+
showGlobalEntryModal.value = false;
|
|
854
|
+
};
|
|
855
|
+
const buildFieldValidations = useCallback((data) => globalEntryValidationRules({
|
|
856
|
+
data,
|
|
857
|
+
legalEntity: rootLegalEntity,
|
|
858
|
+
isFeatureEnabled
|
|
859
|
+
}), [isFeatureEnabled, rootLegalEntity]);
|
|
860
|
+
/** Holds the registration details when the user already trades as a sole proprietor */
|
|
861
|
+
const { data: associatedSoleProp } = useAssociatedLegalEntity(rootLegalEntity, LegalEntityTypes.SOLE_PROPRIETORSHIP);
|
|
862
|
+
const multiForm = useMultiForm({
|
|
863
|
+
defaultData: useMemo(() => mapLegalEntityToGlobalEntrySchema(rootLegalEntity, associatedSoleProp), [rootLegalEntity, associatedSoleProp]),
|
|
864
|
+
requiredFields: derivedProps?.requiredFields,
|
|
865
|
+
optionalFields: derivedProps?.optionalFields,
|
|
866
|
+
allFields: derivedProps?.allFields,
|
|
867
|
+
rules: buildFieldValidations
|
|
868
|
+
});
|
|
869
|
+
const { isValid: formValidity, data, triggerValidation } = multiForm;
|
|
870
|
+
const country = data.entityInformation?.country ?? getLegalEntityCountry(rootLegalEntity);
|
|
871
|
+
const rules = useMemo(() => globalEntryCustomRules({
|
|
872
|
+
data,
|
|
873
|
+
isFeatureEnabled,
|
|
874
|
+
country,
|
|
875
|
+
taskType: TaskTypes.GLOBAL_ENTRY,
|
|
876
|
+
accountHolder,
|
|
877
|
+
rootLegalEntity
|
|
878
|
+
}), [
|
|
879
|
+
accountHolder,
|
|
880
|
+
isFeatureEnabled,
|
|
881
|
+
country,
|
|
882
|
+
data,
|
|
883
|
+
rootLegalEntity
|
|
884
|
+
]);
|
|
885
|
+
useEffect(() => {
|
|
886
|
+
setDerivedProps(getPropsFromConfigurations({
|
|
887
|
+
scenarioConfiguration: globalEntryFieldRuleConfigurations,
|
|
888
|
+
forms: globalEntryForms,
|
|
889
|
+
remediationActions: [],
|
|
890
|
+
dataMissingErrors: [],
|
|
891
|
+
fieldsWithExistingData: [],
|
|
892
|
+
customRules: rules,
|
|
893
|
+
legalEntityType: rootLegalEntity?.type
|
|
894
|
+
}));
|
|
895
|
+
}, [rootLegalEntity?.type, rules]);
|
|
896
|
+
const forms = useMemo(() => {
|
|
897
|
+
return addValidityToForms(getRequiredForms(globalEntryForms, derivedProps?.requiredFields, derivedProps?.optionalFields, true), formValidity, void 0);
|
|
898
|
+
}, [derivedProps, formValidity]);
|
|
899
|
+
const { mutateAsync: updateLegalEntity, isPending: isUpdatingLegalEntity } = useUpdateLegalEntity();
|
|
900
|
+
const { mutateAsync: createLegalEntity, isPending: isCreatingLegalEntity } = useCreateLegalEntity();
|
|
901
|
+
const isSubmitting = isUpdatingLegalEntity || isCreatingLegalEntity;
|
|
902
|
+
const handleSubmit = async () => {
|
|
903
|
+
try {
|
|
904
|
+
const newAccountHolder = await submitGlobalEntry({
|
|
905
|
+
legalEntity: rootLegalEntity,
|
|
906
|
+
associatedSoleProp,
|
|
907
|
+
data,
|
|
908
|
+
updateLegalEntity,
|
|
909
|
+
createLegalEntity
|
|
910
|
+
});
|
|
911
|
+
if (newAccountHolder) onComplete(newAccountHolder);
|
|
912
|
+
showGlobalEntryModal.value = false;
|
|
913
|
+
} catch (err) {
|
|
914
|
+
logger.error(err);
|
|
915
|
+
showToast({
|
|
916
|
+
label: t(($) => $["failedToUpdateDetails"], { ns: "common" }),
|
|
917
|
+
variant: "error"
|
|
918
|
+
});
|
|
919
|
+
}
|
|
920
|
+
};
|
|
921
|
+
const { activeForm, handleNextClick, handleBackClick, steps, gotoFormByFormId, gotoFormByFormIndex, shouldValidate } = useFormComposer({
|
|
922
|
+
onSubmit: handleSubmit,
|
|
923
|
+
forms,
|
|
924
|
+
triggerValidation
|
|
925
|
+
});
|
|
926
|
+
return /* @__PURE__ */ jsx(FormContextProvider, {
|
|
927
|
+
form: multiForm,
|
|
928
|
+
children: /* @__PURE__ */ jsx(FormFlow, {
|
|
929
|
+
asModal: true,
|
|
930
|
+
activeForm,
|
|
931
|
+
handleNextClick,
|
|
932
|
+
handleBackClick,
|
|
933
|
+
handleCancelClick: handleClose,
|
|
934
|
+
forms,
|
|
935
|
+
gotoFormByFormIndex,
|
|
936
|
+
gotoFormByFormId,
|
|
937
|
+
loadingStatus: isSubmitting ? "loading" : "success",
|
|
938
|
+
currentStep: steps.current,
|
|
939
|
+
totalSteps: steps.total,
|
|
940
|
+
isGlobalEntry: true,
|
|
941
|
+
children: /* @__PURE__ */ jsx(GlobalEntry, {
|
|
942
|
+
activeForm,
|
|
943
|
+
shouldValidate,
|
|
944
|
+
legalEntity: rootLegalEntity,
|
|
945
|
+
country
|
|
946
|
+
})
|
|
947
|
+
})
|
|
948
|
+
});
|
|
949
|
+
};
|
|
950
|
+
//#endregion
|
|
951
|
+
export { showGlobalEntryModal as n, GlobalEntryModal as t };
|