@adyen/kyc-components 3.82.6 → 3.83.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-BzyXLUF9.js +24 -0
- package/dist/{AD-CyP5INSp.js → AD-BQAadLyG.js} +2 -2
- package/dist/{AT-DJLlevck.js → AT-BI8ju2NH.js} +2 -2
- package/dist/{AcceptTermsOfServiceComponent-BX6X0BUP.js → AcceptTermsOfServiceComponent-DqS5JP99.js} +16 -17
- package/dist/{AccountSetupRejected-CTRKTCIy.js → AccountSetupRejected-4ALfhW_L.js} +5 -5
- package/dist/{Address-DK4ne77p.js → Address-Dbboddow.js} +11 -9
- package/dist/{Alert-BuZyBPdN.js → Alert-Bnbg5-Pq.js} +3 -3
- package/dist/{Avatar-CbdryeRw.js → Avatar-DNO46xfe.js} +1 -1
- package/dist/{BE-B-m_4F41.js → BE-nWHKW0xQ.js} +2 -2
- package/dist/{BG-BVR5ytc-.js → BG-DlvaKo4n.js} +2 -2
- package/dist/{BusinessDetailsDropin-ClyiCBup.js → BusinessDetailsDropin-C1MwQS77.js} +76 -39
- package/dist/{BusinessFinancingComponent-DPNV3HMP.js → BusinessFinancingComponent-BD-Q5UNJ.js} +7 -7
- package/dist/{BusinessFinancingDropin-CdMGYRnw.js → BusinessFinancingDropin-D1sEtbRy.js} +20 -24
- package/dist/{BusinessFinancingPage-C0Uu9ymj.js → BusinessFinancingPage-DYsPxu--.js} +5 -5
- package/dist/{BusinessTypeSelectionPage-cA2bpq2g.js → BusinessTypeSelectionPage-CBOhSoXo.js} +7 -7
- package/dist/{CH-CesIKOYy.js → CH-TX4BTE2y.js} +2 -2
- package/dist/{CY-BnJ7k_mN.js → CY-D59Nypl7.js} +2 -2
- package/dist/{CZ-BiPeoA9G.js → CZ-B6iI1GbE.js} +3 -3
- package/dist/{Card-edBKJLEt.js → Card-DmTLVDJg.js} +4 -4
- package/dist/{CountryField-C_sYT__J.js → CountryField-JJ69pIsL.js} +228 -26
- package/dist/CreateIndividualComponent-DGVAMUoq.js +72 -0
- package/dist/CreateTransferInstrumentComponent-BtDto_KK.js +67 -0
- package/dist/{Currency-D6KhyloS.js → Currency-CO9RGZ-W.js} +6 -6
- package/dist/{CustomerSupport-CE5FGUuM.js → CustomerSupport-JIlKPBua.js} +8 -9
- package/dist/{DE-DdcbG-CC.js → DE-CsuX_tSL.js} +2 -2
- package/dist/{DK-DA8qRrzq.js → DK-oQEFrF6o.js} +3 -3
- package/dist/{DebugModal-DUAUNeYo.js → DebugModal-hvJnGijW.js} +6 -6
- package/dist/{DecisionMakerDetailsPage-CGbNrGr4.js → DecisionMakerDetailsPage-DzfGLE9c.js} +8 -8
- package/dist/{DecisionMakers-vOa33-7u.js → DecisionMakers-BrjIskXn.js} +39 -37
- package/dist/{Dropzone-SgdJbpTa.js → Dropzone-H0yzmOuC.js} +5 -5
- package/dist/{EE-CaXoPgZz.js → EE-3WZV5Ejt.js} +2 -2
- package/dist/{ES-Bt_oaIaf.js → ES-NfxpqbC2.js} +2 -2
- package/dist/{EmbeddedStatus-B4deNn1f.js → EmbeddedStatus-DRHq4osc.js} +3 -3
- package/dist/{EndStateLayout-7LZJ5bjr.js → EndStateLayout-D3cbZj-M.js} +1 -1
- package/dist/{FI-C5V3lLuN.js → FI-CHQIvHa-.js} +2 -2
- package/dist/{FR-Bc1tLIC4.js → FR-MWZyWX3x.js} +2 -2
- package/dist/{FormNavigation-Nu5JeRyn.js → FormNavigation-DB53eN8d.js} +3 -3
- package/dist/{GG-BGuqxplU.js → GG-CPoMVQPc.js} +3 -3
- package/dist/{GI-CROkpYrU.js → GI-DxmBwVD_.js} +3 -3
- package/dist/{GR-B9c2boG8.js → GR-Rk0pXlNw.js} +2 -2
- package/dist/{HR-p4luVYpu.js → HR-WapHW2fw.js} +2 -2
- package/dist/{HU-D8vJYkDH.js → HU-DCOMuOhe.js} +3 -3
- package/dist/{IE-Cli_j7Al.js → IE-BkgtVgDi.js} +2 -2
- package/dist/{IM-mpIyBn16.js → IM-Wr4iDT94.js} +3 -3
- package/dist/{IS-02zCAdvq.js → IS-C-Cgc6zp.js} +2 -2
- package/dist/{IT-CzURFhrK.js → IT-CXekiddL.js} +2 -2
- package/dist/{IndividualOnfidoDropin-D7TnpsQU.js → IndividualOnfidoDropin-BSsHN6bE.js} +165 -85
- package/dist/{InputDate-B9qJD-ND.js → InputDate-8Nu20eZ3.js} +2 -2
- package/dist/{InputText-1Il1vZcv.js → InputText-YzvoboLM.js} +5 -4
- package/dist/{Introduction-Dekg5qYo.js → Introduction-DW__UMHd.js} +6 -6
- package/dist/{JE-MFwIYti7.js → JE-B4gj54Hg.js} +3 -3
- package/dist/JpAddress-AH8J7G-1.js +263 -0
- package/dist/{LI-DA06W10W.js → LI-L0ZAALRT.js} +2 -2
- package/dist/{LT-DuU6E2Ct.js → LT-Ao2uagV9.js} +2 -2
- package/dist/{LU-BQHhNpDy.js → LU-B7LRUuc6.js} +2 -2
- package/dist/{LV-DN7wckbP.js → LV-DZeGjA2G.js} +2 -2
- package/dist/{LegalRepresentativeDetailsPage-DwcLwFbT.js → LegalRepresentativeDetailsPage-D5-FwAj4.js} +6 -6
- package/dist/{Link-Bigd4y5z.js → Link-BActvJTh.js} +1 -1
- package/dist/{MC-DtSWC4jS.js → MC-EDVNGWhy.js} +2 -2
- package/dist/{MT-DeDMQ1f_.js → MT-B9my7RlP.js} +2 -2
- package/dist/{ManageIndividualComponent-CU4PQYlU.js → ManageIndividualComponent-qB_pBsto.js} +6 -6
- package/dist/{ManageTermsOfServiceComponent-H0CLn7hm.js → ManageTermsOfServiceComponent-BbX3sUEl.js} +6 -6
- package/dist/{ManageTransferInstrumentComponent-DvSHKmA4.js → ManageTransferInstrumentComponent-CyESUoUz.js} +14 -16
- package/dist/{MaskedInput-DOcrkP6N.js → MaskedInput-BWUgQjO8.js} +5 -5
- package/dist/{Modal-C_l3DNDD.js → Modal-m2wGafQr.js} +16 -3
- package/dist/{NL-aVL0NAp-.js → NL-VXAFOhV5.js} +2 -2
- package/dist/{NO-D7EOiQA1.js → NO-Cx1VSh2W.js} +3 -3
- package/dist/OnboardingDropinComponent-B_HrYU_Q.js +5184 -0
- package/dist/{PL-Bg7axKQA.js → PL-BZW1hGvD.js} +3 -3
- package/dist/{PT-hB1HnBM2.js → PT-OpU4MU3L.js} +2 -2
- package/dist/{PayoutDetailsDropin-gEQIVa-_.js → PayoutDetailsDropin-DKda6B79.js} +113 -132
- package/dist/{RO-BLlC4CKq.js → RO-Cz6Sh0ls.js} +2 -2
- package/dist/{useMultiForm-YCECZtje.js → RadioGroup-wbcMSLjR.js} +341 -6
- package/dist/{RegistrationAddress-u6ooNR8V.js → RegistrationAddress-CNHmGFVw.js} +16 -22
- package/dist/{Review-KJya8jDh.js → Review-DsZWCgw-.js} +7 -7
- package/dist/{RootBusinessDetailsPage-D7jcycWp.js → RootBusinessDetailsPage-DBFDBVcm.js} +76 -31
- package/dist/{RootIndividualDetailsPage-Z7OWhMNa.js → RootIndividualDetailsPage-Cs5KK8mp.js} +6 -6
- package/dist/{SE-q25Qt85B.js → SE-B5K-FkQd.js} +3 -3
- package/dist/{SI-BzA-ozn6.js → SI-BOGTNLPa.js} +2 -2
- package/dist/{SK-DOTdLJPw.js → SK-BOVrp_Av.js} +2 -2
- package/dist/{SM-B4BIgmhk.js → SM-meowwILA.js} +2 -2
- package/dist/{SignPCIComponent-TDythDLu.js → SignPCIComponent-BkKgy5SY.js} +11 -12
- package/dist/{SingpassSelection-Ba5I6QIT.js → SingpassSelection-1p60WZAA.js} +4 -4
- package/dist/{SoleProprietorshipPage-CyFrpYBH.js → SoleProprietorshipPage-CurXL6lM.js} +6 -6
- package/dist/{SourceOfFundsPage-Bfm1rSfQ.js → SourceOfFundsPage-CK07pzLd.js} +27 -29
- package/dist/{StepProgressIndicator-e_1dBLgd.js → StepProgressIndicator-BeTto_2p.js} +1 -1
- package/dist/{StoreProvider-BWVRmzZI.js → StoreProvider-A-G7e1lx.js} +156 -155
- package/dist/{TaskItemStatus-BPcD795U.js → TaskItemStatus-pqH7c81D.js} +3 -3
- package/dist/{TaskStatusIndicator-D1QM67cG.js → TaskStatusIndicator-CXE_39rY.js} +1 -1
- package/dist/{TaxInformationField-kgi89UR0.js → TaxInformationField-DAk10aD9.js} +44 -33
- package/dist/{TaxReportingDropin-CN94V8po.js → TaxReportingDropin-DV-sUx83.js} +17 -21
- package/dist/{TileGroup-CzoPqlmw.js → TileGroup-B-lHzCf6.js} +4 -4
- package/dist/{TrustDetailsPage-CZWseCEm.js → TrustDetailsPage-CLMUK1Il.js} +22 -24
- package/dist/{TrustMemberCompanyPage-CA8r7z8j.js → TrustMemberCompanyPage-PRdv40Ja.js} +7 -7
- package/dist/{TrustMemberIndividualPage-DSSEL22O.js → TrustMemberIndividualPage-CEhnzMU5.js} +6 -6
- package/dist/{UnincorporatedPartnershipIndividualPage-BFgJl-aO.js → UnincorporatedPartnershipIndividualPage-yx0uYx8f.js} +6 -6
- package/dist/{UnincorporatedPartnershipMemberCompanyPage-YBViXOCI.js → UnincorporatedPartnershipMemberCompanyPage-C0uyHj9d.js} +7 -7
- package/dist/{VA-bPXdCnwD.js → VA-DXsYTCoh.js} +2 -2
- package/dist/{ViewVerificationStatusComponent-i059vJSd.js → ViewVerificationStatusComponent-DbFIYQqA.js} +4 -4
- package/dist/adyen-business-financing.js +3 -3
- package/dist/{adyen-individual.js → adyen-individual-configuration.js} +5 -5
- package/dist/{adyen-manage-individual.js → adyen-individual-status.js} +5 -5
- package/dist/adyen-kyc-components.js +21 -21
- package/dist/adyen-onboarding.js +3 -3
- package/dist/{adyen-terms-of-service.js → adyen-terms-of-service-management.js} +5 -5
- package/dist/{adyen-manage-terms-of-service.js → adyen-terms-of-service-status.js} +5 -5
- package/dist/{adyen-transfer-instrument.js → adyen-transfer-instrument-configuration.js} +5 -5
- package/dist/{adyen-manage-transfer-instruments.js → adyen-transfer-instrument-management.js} +5 -5
- package/dist/adyen-verification-status.js +3 -3
- package/dist/{analytics-oZidjUEi.js → analytics-BQgqf5ON.js} +2 -2
- package/dist/{arrow-right-D_mdkZmE.js → arrow-right-KxA3SvQj.js} +2 -2
- package/dist/{bafinUtils-CZB8qEIB.js → bafinUtils-BMhhhQMt.js} +6 -6
- package/dist/{bag-DpxmyXfR.js → bag-BPumznWh.js} +2 -2
- package/dist/{bank-gyBvaSp4.js → bank-D6FiNBhs.js} +2 -2
- package/dist/{bg-BG-QC5irNEG.js → bg-BG-Bot37sd7.js} +4 -1
- package/dist/bg-BG-Cp58y2fj.js +13 -0
- package/dist/bg-BG-GVhnrvRn.js +49 -0
- package/dist/bg-BG-ZJvmfx01.js +13 -0
- package/dist/{bg-BG-CMomhopf.js → bg-BG-fgdGvtqa.js} +3 -1
- package/dist/bin-Bz6KOIeE.js +18 -0
- package/dist/capital-GVQ3svwN.js +17 -0
- package/dist/{cash-stack-Ds76Du8m.js → cash-stack-D9AoDDwt.js} +3 -3
- package/dist/{certificate-D6xjhThs.js → certificate-CdEWgHQf.js} +3 -3
- package/dist/{checkmark-tfEAu7lj.js → checkmark-Q7x6tGhy.js} +2 -2
- package/dist/checkmark-circle-fill-CsvN5_PL.js +17 -0
- package/dist/{checkmark-circle-nACBJ24q.js → checkmark-circle-x7dzbp3I.js} +3 -3
- package/dist/{checkmark-small-63w5fAxg.js → checkmark-small-D35myntq.js} +2 -2
- package/dist/{chevron-down-CkQS-knD.js → chevron-down-C2iDorpW.js} +2 -2
- package/dist/{chevron-left-CBCMdMx6.js → chevron-left-ztPO84q-.js} +2 -2
- package/dist/{chevron-right-dIVWvPJu.js → chevron-right-C_JN0oDt.js} +2 -2
- package/dist/{chevron-up-D93IGU9z.js → chevron-up-CgG8n25g.js} +2 -2
- package/dist/circle-Bt3Nlr3q.js +17 -0
- package/dist/coins-fkAk6dCo.js +17 -0
- package/dist/{contract-DI03_xrF.js → contract-BTa4HltT.js} +2 -2
- package/dist/{cross-o4n5KXxG.js → cross-Cn09MtQ_.js} +2 -2
- package/dist/{cross-circle-fill-small-CHMDaA3q.js → cross-circle-fill-small-DCz52AuN.js} +2 -2
- package/dist/{cs-CZ-t297LwYw.js → cs-CZ-BEynVkgn.js} +4 -1
- package/dist/cs-CZ-CVpbQMSY.js +45 -0
- package/dist/cs-CZ-DMwpeH56.js +13 -0
- package/dist/cs-CZ-De4wbl1W.js +13 -0
- package/dist/{cs-CZ-DMzortvO.js → cs-CZ-DwiXbzIv.js} +3 -1
- package/dist/da-DK-BK6TE3SH.js +13 -0
- package/dist/da-DK-DLcvdXDS.js +45 -0
- package/dist/{da-DK-BoQic3Gy.js → da-DK-DmL_Ja3L.js} +4 -1
- package/dist/da-DK-R0sNbjuQ.js +13 -0
- package/dist/{da-DK-q2b_1elr.js → da-DK-Y6PJ69rt.js} +3 -1
- package/dist/{de-DE-Dwagawx1.js → de-DE-BahIk-1-.js} +4 -1
- package/dist/de-DE-CKZrABo7.js +45 -0
- package/dist/de-DE-D9r_yUSr.js +13 -0
- package/dist/de-DE-ZQioXTGO.js +13 -0
- package/dist/{de-DE-D2ByeIZs.js → de-DE-xdQMmrrt.js} +3 -1
- package/dist/{document-1-DsCi9vmX.js → document-1-C08ut-Dt.js} +2 -2
- package/dist/document-person-vxlA6C5f.js +20 -0
- package/dist/download-Drhk9k1f.js +17 -0
- package/dist/edit-1-CFoDTMvQ.js +14 -0
- package/dist/el-GR-B06F8VNw.js +13 -0
- package/dist/el-GR-C_y2406P.js +45 -0
- package/dist/{el-GR-DGW388LZ.js → el-GR-DR_5DKI1.js} +3 -1
- package/dist/{el-GR-CxwhV-TX.js → el-GR-TZUpX1j3.js} +4 -1
- package/dist/el-GR-kj1-bNjH.js +13 -0
- package/dist/en-US-BaWkkHh3.js +13 -0
- package/dist/{en-US-CQ3angjM.js → en-US-DI1dH0ZB.js} +6 -4
- package/dist/en-US-nL0-_PSp.js +52 -0
- package/dist/{es-ES-Bsoco8Fj.js → es-ES-BPDeEYGv.js} +4 -1
- package/dist/es-ES-D6Uauj9W.js +13 -0
- package/dist/es-ES-DdT2wJTP.js +45 -0
- package/dist/es-ES-XCII5d8J.js +13 -0
- package/dist/{es-ES-WWftn3JX.js → es-ES-keMO-LlU.js} +3 -1
- package/dist/{et-EE-D5lRJbMZ.js → et-EE-CLuAFAri.js} +3 -1
- package/dist/et-EE-DHwaH1by.js +13 -0
- package/dist/et-EE-DNcqO4R9.js +13 -0
- package/dist/{et-EE-DdGlUpaQ.js → et-EE-DftDBzjA.js} +4 -1
- package/dist/et-EE-Y890kc89.js +45 -0
- package/dist/{external-link-BjladU3E.js → external-link-DCMYUMfW.js} +2 -2
- package/dist/fi-FI-67pS4_t6.js +13 -0
- package/dist/{fi-FI-D9E_KaJi.js → fi-FI-CBHr-_To.js} +3 -1
- package/dist/fi-FI-DKxJM0k6.js +45 -0
- package/dist/fi-FI-DTgF3AuK.js +13 -0
- package/dist/{fi-FI-ClnsYt3L.js → fi-FI-LpkpSl5X.js} +4 -1
- package/dist/{fieldConfigurations-DfVO1kZe.js → fieldConfigurations-T_MugRKB.js} +284 -13
- package/dist/{fr-FR-Cv0k-3Xc.js → fr-FR-B3qQW3oG.js} +3 -1
- package/dist/fr-FR-BZbWBKOT.js +13 -0
- package/dist/fr-FR-BxO1IR9C.js +45 -0
- package/dist/fr-FR-CsogZlc6.js +13 -0
- package/dist/{fr-FR-CJI0bIig.js → fr-FR-CuSchzjE.js} +4 -1
- package/dist/{getName-Bxt44SQU.js → getName-BFp9WNDh.js} +2 -2
- package/dist/gift-CQ_DEma7.js +14 -0
- package/dist/{graph-DwYwlplw.js → graph-BJmqglH2.js} +3 -3
- package/dist/{graph-up-DpbCSPbc.js → graph-up-Bq6adtlX.js} +6 -6
- package/dist/{hasDataChanged-C9eGmQUM.js → hasDataChanged-DutOih4i.js} +2 -2
- package/dist/headquarter-DNYyuuFq.js +21 -0
- package/dist/{hotel-JX0bjsSA.js → hotel-BuNql78Z.js} +3 -3
- package/dist/hr-HR-B3boX_dq.js +13 -0
- package/dist/hr-HR-CJ5rmUrZ.js +13 -0
- package/dist/{hr-HR-CzSrqEFA.js → hr-HR-DMV2OsPs.js} +3 -1
- package/dist/{hr-HR-C0yWizOX.js → hr-HR-DST-QbRI.js} +4 -1
- package/dist/hr-HR-DghVS0jH.js +45 -0
- package/dist/{hu-HU-wnSie9tz.js → hu-HU-BgHugMwG.js} +4 -1
- package/dist/hu-HU-CJh8OY-w.js +45 -0
- package/dist/{hu-HU-zK6nUqWr.js → hu-HU-CPWGnq22.js} +3 -1
- package/dist/hu-HU-CX5vJbE8.js +13 -0
- package/dist/hu-HU-CYfNXKwk.js +13 -0
- package/dist/{iframeWidget-CxrzJ-jZ.js → iframeWidget-Cgmtvmy0.js} +4 -4
- package/dist/image-BSihO8lR.js +17 -0
- package/dist/info-vHTZWoJ7.js +21 -0
- package/dist/{isEmpty-Dl3kuoC1.js → isEmpty-Sr9awRZt.js} +2 -2
- package/dist/{it-IT-C_fNHhjE.js → it-IT-CRmaykgQ.js} +3 -1
- package/dist/it-IT-Cepap1v0.js +13 -0
- package/dist/it-IT-Dn9AGEIq.js +13 -0
- package/dist/{it-IT-BeC2Y1F8.js → it-IT-p_DER3dq.js} +4 -1
- package/dist/it-IT-vJt2CGXz.js +45 -0
- package/dist/ja-JP-Ajo-tIow.js +23 -0
- package/dist/{ja-JP-YoU7mNrK.js → ja-JP-C870wgmw.js} +6 -3
- package/dist/ja-JP-Cm2wakN6.js +45 -0
- package/dist/{ja-JP-weDU8GLW.js → ja-JP-DCOsVkrk.js} +12 -10
- package/dist/ja-JP-DRJ0RpUn.js +13 -0
- package/dist/ja-JP-DT0qGp0i.js +110 -0
- package/dist/{localizeDateString-BdokUyCZ.js → localizeDateString-VOGoCyNH.js} +1 -1
- package/dist/location-Q4oKvnkl.js +17 -0
- package/dist/{lt-LT-BUYY0LaT.js → lt-LT-0CK0Iin7.js} +3 -1
- package/dist/lt-LT-3rmXgF6K.js +13 -0
- package/dist/lt-LT-CrCYV_jv.js +45 -0
- package/dist/{lt-LT-DIe4cKlu.js → lt-LT-Dxde15Cc.js} +4 -1
- package/dist/lt-LT-lJLUJnzd.js +13 -0
- package/dist/lv-LV-CBex8RS9.js +13 -0
- package/dist/{lv-LV-B9js9VoA.js → lv-LV-CSxppAD_.js} +3 -1
- package/dist/lv-LV-CaFrxG3S.js +45 -0
- package/dist/{lv-LV-DXgW5zWl.js → lv-LV-DDvnyHlO.js} +4 -1
- package/dist/lv-LV-DPZgF65i.js +13 -0
- package/dist/mail-BOdyoVqB.js +14 -0
- package/dist/{mapExistingFile-D4k-V3zd.js → mapExistingFile-BqDqKrRC.js} +5 -5
- package/dist/{mapScriptLocalization-CFHDZfTm.js → mapScriptLocalization-nzUbVbLu.js} +4 -4
- package/dist/{mapTransferInstrumentToPayoutAccount-C23Q8Nvb.js → mapTransferInstrumentToPayoutAccount-3EChpLFt.js} +2 -2
- package/dist/{minus-circle-filled-BGKeHaxJ.js → minus-circle-filled-kC2IUvKz.js} +3 -3
- package/dist/nl-NL-BIcLB7e6.js +13 -0
- package/dist/nl-NL-BQJjhn7U.js +45 -0
- package/dist/nl-NL-CU6c8oyY.js +13 -0
- package/dist/{nl-NL-DLedC3mO.js → nl-NL-RfK34nkp.js} +3 -1
- package/dist/{nl-NL-Cysslsh2.js → nl-NL-Uf_myU_8.js} +4 -1
- package/dist/no-NO-BWpBc9_J.js +13 -0
- package/dist/{no-NO-CpVal4cV.js → no-NO-BWzGost-.js} +3 -1
- package/dist/no-NO-CSia2Bd5.js +45 -0
- package/dist/{no-NO-zSnPtrDi.js → no-NO-DZ1y_9mq.js} +4 -1
- package/dist/no-NO-YuIAbtuI.js +13 -0
- package/dist/{options-horizontal-nJ9-ButA.js → options-horizontal-CBmbNv7R.js} +4 -4
- package/dist/partner-CPjsrePY.js +18 -0
- package/dist/pay-by-link-plane-BVZndh67.js +22 -0
- package/dist/{payout-iEmHhgQ4.js → payout-ChUEoLjt.js} +6 -6
- package/dist/person-DGjUU4S4.js +17 -0
- package/dist/pl-PL-6WyUmy0K.js +45 -0
- package/dist/{pl-PL-UB5J5JcB.js → pl-PL-B1tVRX3A.js} +4 -1
- package/dist/pl-PL-B87v7Wzw.js +13 -0
- package/dist/pl-PL-B9eq4QTe.js +13 -0
- package/dist/{pl-PL-1ylK-_FE.js → pl-PL-DFrOIiCG.js} +3 -1
- package/dist/{plus-CwLva7fq.js → plus-CWXA5wdX.js} +2 -2
- package/dist/plus-circle-filled-CbC0u2Y1.js +17 -0
- package/dist/pt-BR-BD3-Ecm8.js +36 -0
- package/dist/pt-BR-BljlblJ5.js +23 -0
- package/dist/{form-rules-DhbF2mY4.js → pt-BR-CI2ZzGeN.js} +5 -3
- package/dist/pt-BR-Cmr5LoAm.js +22 -0
- package/dist/pt-BR-CrKxuloz.js +13 -0
- package/dist/pt-BR-CxjlToN4.js +37 -0
- package/dist/{pt-PT-C-hbNnsB.js → pt-BR-DMCle1o_.js} +10 -10
- package/dist/pt-BR-DeDXIlM_.js +35 -0
- package/dist/pt-BR-DtLKiYpp.js +60 -0
- package/dist/pt-BR-nU_2Wbo5.js +54 -0
- package/dist/pt-PT-BNJcehJa.js +13 -0
- package/dist/{pt-PT-BkvMsoK4.js → pt-PT-CU13UUwT.js} +3 -1
- package/dist/pt-PT-CWYxqUbN.js +45 -0
- package/dist/pt-PT-Cu735tNP.js +13 -0
- package/dist/{pt-PT-CjsyP_OK.js → pt-PT-DpBfkgVw.js} +4 -1
- package/dist/{reporting-DlRoibD7.js → reporting-DerosUNm.js} +1 -2
- package/dist/{resolveEnvironment-DwCUq9vS.js → resolveEnvironment-CRebgq_d.js} +3 -3
- package/dist/revenue-accelerate-Dp4Ns_5c.js +17 -0
- package/dist/{ro-RO-Dfx0g3bU.js → ro-RO-B2u2q1Ez.js} +3 -1
- package/dist/ro-RO-B75duQ_N.js +13 -0
- package/dist/{ro-RO-C8yYXQc_.js → ro-RO-BF1Q86nQ.js} +4 -1
- package/dist/ro-RO-BWQeseQ_.js +45 -0
- package/dist/ro-RO-DkHxxgVT.js +13 -0
- package/dist/{rules-DsgQHF9g.js → rules-DZhctDpD.js} +5 -5
- package/dist/save-Fgy7EDid.js +14 -0
- package/dist/search-C4GZ-Rc1.js +17 -0
- package/dist/{show-uL6I-rMo.js → show-yPjPmEf8.js} +3 -3
- package/dist/{sk-SK-iO863_t2.js → sk-SK-BWA3fAcI.js} +3 -1
- package/dist/sk-SK-Cv76Qa3V.js +13 -0
- package/dist/sk-SK-DUZblaeq.js +13 -0
- package/dist/sk-SK-DnNuh37c.js +45 -0
- package/dist/{sk-SK-DbOE9C6n.js → sk-SK-Rd06VJ5k.js} +4 -1
- package/dist/{sl-SI-Cth2Qa5T.js → sl-SI-B7zbwoZn.js} +3 -1
- package/dist/{sl-SI-Br0UEUPL.js → sl-SI-BuIFB5zU.js} +4 -1
- package/dist/sl-SI-CyNtynTN.js +13 -0
- package/dist/sl-SI-D212isFw.js +45 -0
- package/dist/sl-SI-vyebIKls.js +13 -0
- package/dist/{solution-payments-DTAuLSWF.js → solution-payments-CNAat9h7.js} +2 -2
- package/dist/store-IuAkDRAp.js +14 -0
- package/dist/style.css +533 -390
- package/dist/styles-CLV89_hH.js +533 -390
- package/dist/sv-SE-1eeTTIj7.js +13 -0
- package/dist/sv-SE-BcTCn-cn.js +13 -0
- package/dist/{sv-SE-BtXmvxx4.js → sv-SE-BwJgkIDf.js} +4 -1
- package/dist/sv-SE-Ca1bxZf3.js +45 -0
- package/dist/{sv-SE-OPOHtqtP.js → sv-SE-Hi07uLM9.js} +3 -1
- package/dist/terminal-1-_me9J9h0.js +18 -0
- package/dist/{translation-Cy20sz7q.js → translation-Dh8Ktt7L.js} +2 -2
- package/dist/types/api/address/useAddressCleanse.d.ts +6 -2
- package/dist/types/api/address/useRetrieveAddress.d.ts +3 -1
- package/dist/types/api/address/useRetrieveFromPostcodeJp.d.ts +18 -0
- package/dist/types/api/industryCodes/useIndustryCodes.d.ts +3 -3
- package/dist/types/components/BankAccount/mapping/payoutKeyMappings.d.ts +408 -0
- package/dist/types/components/Business/forms/AdditionalInformation/types.d.ts +2 -1
- package/dist/types/components/Business/forms/rules.d.ts +2 -1
- package/dist/types/components/Business/utils/requestingCapabilities.d.ts +3 -0
- package/dist/types/components/BusinessLines/fields/SalesChannels/SalesChannels.d.ts +3 -0
- package/dist/types/components/BusinessLines/fields/SalesChannels/types.d.ts +6 -0
- package/dist/types/components/BusinessLines/fields/WebDataField/WebDataField.d.ts +3 -0
- package/dist/types/components/BusinessLines/fields/WebDataField/types.d.ts +10 -0
- package/dist/types/components/BusinessLines/forms/IndustryCodesForm/IndustryCodesForm.d.ts +2 -0
- package/dist/types/components/BusinessLines/forms/IndustryCodesForm/types.d.ts +2 -0
- package/dist/types/components/BusinessLines/forms/SalesChannelsForm/SalesChannelsForm.d.ts +2 -0
- package/dist/types/components/BusinessLines/forms/SalesChannelsForm/types.d.ts +3 -0
- package/dist/types/components/BusinessLines/forms/rules.d.ts +5 -0
- package/dist/types/components/BusinessLines/tasks/BusinessLines/BusinessLines.d.ts +8 -0
- package/dist/types/components/BusinessLines/tasks/BusinessLines/BusinessLinesDropin.d.ts +2 -0
- package/dist/types/components/BusinessLines/tasks/types.d.ts +15 -0
- package/dist/types/components/BusinessLines/tasks/utils.d.ts +21 -0
- package/dist/types/components/BusinessLines/tasks/validate.d.ts +9 -0
- package/dist/types/components/EFP/mapping/businessFinancingKeyMappings.d.ts +571 -1
- package/dist/types/components/Individual/forms/IndividualOnfido/AdditionalPersonalDetails/AdditionalPersonalDetails.types.d.ts +2 -1
- package/dist/types/components/Individual/forms/IndividualOnfido/IndividualOnfido.rules.d.ts +1 -1
- package/dist/types/components/Shared/Summary/Summary.d.ts +1 -1
- package/dist/types/components/Shared/Summary/types.d.ts +1 -0
- package/dist/types/components/Shared/fields/IdFieldTypeSelector/VatNumberTypeSelector.d.ts +1 -1
- package/dist/types/components/Shared/fields/IndustryCodeField/IndustryCodeField.d.ts +5 -0
- package/dist/types/components/Shared/fields/IndustryCodeField/fieldConfig.d.ts +3 -0
- package/dist/types/components/Shared/fields/IndustryCodeField/types.d.ts +18 -0
- package/dist/types/components/Shared/fields/IndustryCodeField/validate.d.ts +3 -0
- package/dist/types/components/Shared/forms/Address/localized/jp/JpAddress.d.ts +7 -0
- package/dist/types/components/Shared/forms/Address/localized/jp/ReadonlyTextField.d.ts +7 -0
- package/dist/types/components/Shared/forms/Address/localized/jp/jpAddressSchema.d.ts +5 -0
- package/dist/types/components/Shared/forms/Address/utils.d.ts +1 -1
- package/dist/types/components/ui/atoms/Carousel/Carousel.d.ts +30 -0
- package/dist/types/components/ui/atoms/Typography/Typography.types.d.ts +1 -1
- package/dist/types/components/ui/molecules/DocumentGuidance/DocumentGuidance.types.d.ts +1 -2
- package/dist/types/context/SettingsContext/types.d.ts +2 -0
- package/dist/types/context/StateContext/types.d.ts +2 -1
- package/dist/types/core/models/api/address.d.ts +5 -0
- package/dist/types/core/models/api/capability.d.ts +20 -0
- package/dist/types/embeds/{individual → individual-configuration}/AdyenIndividual.d.ts +4 -4
- package/dist/types/embeds/{individual/adyen-individual.types.d.ts → individual-configuration/adyen-individual-configuration.types.d.ts} +5 -5
- package/dist/types/embeds/{manage-individual → individual-status}/AdyenManageIndividual.d.ts +4 -4
- package/dist/types/embeds/{manage-individual/adyen-manage-individual.types.d.ts → individual-status/adyen-individual-status.types.d.ts} +5 -5
- package/dist/types/embeds/{terms-of-service → terms-of-service-management}/AdyenTermsOfService.d.ts +4 -4
- package/dist/types/embeds/{terms-of-service/adyen-terms-of-service.types.d.ts → terms-of-service-management/adyen-terms-of-service-management.types.d.ts} +5 -5
- package/dist/types/embeds/{manage-terms-of-service → terms-of-service-status}/AdyenManageTermsOfService.d.ts +4 -4
- package/dist/types/embeds/{manage-terms-of-service/adyen-manage-terms-of-service.types.d.ts → terms-of-service-status/adyen-terms-of-service-status.types.d.ts} +5 -5
- package/dist/types/embeds/{transfer-instrument → transfer-instrument-configuration}/AdyenTransferInstrument.d.ts +4 -4
- package/dist/types/embeds/{transfer-instrument/adyen-transfer-instrument.types.d.ts → transfer-instrument-configuration/adyen-transfer-instrument-configuration.types.d.ts} +5 -5
- package/dist/types/embeds/{manage-transfer-instruments → transfer-instrument-management}/AdyenManageTransferInstrument.d.ts +4 -4
- package/dist/types/embeds/{manage-transfer-instruments/adyen-manage-transfer-instruments.types.d.ts → transfer-instrument-management/adyen-transfer-instrument-management.types.d.ts} +5 -5
- package/dist/types/types/form-rules.d.ts +2 -0
- package/dist/types/utils/entityStatusUtil.d.ts +1 -1
- package/dist/{types-BWgKGATO.js → types-C6-GEzQu.js} +2 -2
- package/dist/{types-DXWB1vfp.js → types-D59r-wMh.js} +2 -2
- package/dist/upload-BF65P4KM.js +17 -0
- package/dist/{useAssociatedLegalEntity-ew_9FM-o.js → useAssociatedLegalEntity-BvtBJ3BL.js} +1 -1
- package/dist/{useDataset-HQyCvU4d.js → useDataset-Zu4EOFnX.js} +79 -2
- package/dist/{useForm-BSzxrzKr.js → useForm-DJPITpbv.js} +18 -7
- package/dist/{useGlobalData-CWGnqesg.js → useGlobalData-fv415QuQ.js} +8 -10
- package/dist/{useOnboardingStatus-CfrtaISk.js → useOnboardingStatus-DXxwhYIb.js} +1 -1
- package/dist/{useScenarios-CnNDKwQA.js → useScenarios-CxSE098Q.js} +2 -2
- package/dist/{useTermsOfServiceStatus-B_Rs-b89.js → useTermsOfServiceStatus--IFMZSWz.js} +1 -1
- package/dist/{useToastContext-Dzwox5LN.js → useToastContext-BD1TnfkF.js} +2 -2
- package/dist/{useUnincorporatedPartnershipMembers-BIZriWIQ.js → useUnincorporatedPartnershipMembers-Bs4GeINH.js} +5 -5
- package/dist/{utils-BueyuQ5T.js → utils-B0IWmbB9.js} +7 -7
- package/dist/{utils-IqRD7HwH.js → utils-Bp9s2iP_.js} +2 -2
- package/dist/{utils-CDpZOWl9.js → utils-ER2TBROJ.js} +2 -2
- package/dist/{validate-BeCraJUP.js → validate-BDkQUYkG.js} +7 -7
- package/dist/{validate-Cy-GFhBf.js → validate-BvMUdxph.js} +7 -293
- package/dist/{validate-BY_qKb5w.js → validate-DUy9VcNg.js} +2 -2
- package/dist/{validationError-BgoAyQGl.js → validationError-D8qHV56i.js} +2 -2
- package/dist/warning-circle-fill-CEN1WL7A.js +17 -0
- package/dist/warning-filled-F54KIN6Z.js +14 -0
- package/dist/webinar-DqjqrNEv.js +22 -0
- package/package.json +38 -39
- package/dist/4-people-CCqdlDEw.js +0 -24
- package/dist/Confirm-DEPrORD3.js +0 -64
- package/dist/CreateIndividualComponent-a-M_kU9e.js +0 -72
- package/dist/CreateTransferInstrumentComponent-B-XFE0CK.js +0 -67
- package/dist/FormFlow-C8-l6PKR.js +0 -216
- package/dist/MaybeModal-sqtEGip-.js +0 -25
- package/dist/OnboardingDropinComponent-BpbxXLWL.js +0 -4311
- package/dist/RadioGroup-RvJMyv9L.js +0 -143
- package/dist/StructuredList-DaepaiVE.js +0 -38
- package/dist/bg-BG-BYkC3yKf.js +0 -58
- package/dist/bg-BG-CW9c658c.js +0 -13
- package/dist/bg-BG-CZ8v3rdy.js +0 -30
- package/dist/bin-Bgdj6KzC.js +0 -18
- package/dist/capital-CF9_Ev99.js +0 -17
- package/dist/checkmark-circle-fill-BhvuqTl9.js +0 -17
- package/dist/circle-Dgfa7GUy.js +0 -17
- package/dist/coins-CFu331p2.js +0 -17
- package/dist/commonValidators-B-B1D3s5.js +0 -24
- package/dist/cs-CZ-Dx6momCa.js +0 -30
- package/dist/cs-CZ-dU9fnQ1g.js +0 -13
- package/dist/cs-CZ-zTkICtXj.js +0 -58
- package/dist/da-DK-BJ7aTPir.js +0 -13
- package/dist/da-DK-D0N1TVVU.js +0 -58
- package/dist/da-DK-D4H69PX3.js +0 -30
- package/dist/de-DE-C78RLE2G.js +0 -13
- package/dist/de-DE-Dtuu-nE7.js +0 -58
- package/dist/de-DE-wp5-H-ov.js +0 -30
- package/dist/document-person-DBlLin9u.js +0 -20
- package/dist/download-B8_c4ARV.js +0 -17
- package/dist/dropinUtils-A2RmsU4F.js +0 -192
- package/dist/edit-1-D6f6zk9p.js +0 -14
- package/dist/el-GR-BZRKurtr.js +0 -13
- package/dist/el-GR-CK2heqPJ.js +0 -30
- package/dist/el-GR-DaO38A1s.js +0 -58
- package/dist/en-US-546hB2Wn.js +0 -60
- package/dist/en-US-CAm3meB1.js +0 -30
- package/dist/es-ES-BsQpwaPN.js +0 -58
- package/dist/es-ES-BtUSEzkE.js +0 -13
- package/dist/es-ES-Ds3-DtqZ.js +0 -30
- package/dist/et-EE-BCnK305R.js +0 -13
- package/dist/et-EE-Co-8akjV.js +0 -30
- package/dist/et-EE-DF_GqBgK.js +0 -58
- package/dist/fi-FI-BJ9RzrL3.js +0 -58
- package/dist/fi-FI-Cvar63RH.js +0 -13
- package/dist/fi-FI-DPNeTsJS.js +0 -30
- package/dist/fr-FR-B5543Fe-.js +0 -13
- package/dist/fr-FR-CNR5-s9g.js +0 -58
- package/dist/fr-FR-ChmNQciP.js +0 -30
- package/dist/gift-SdNY6AqI.js +0 -14
- package/dist/headquarter-C6AsewcP.js +0 -21
- package/dist/hr-HR-CjA4MWAU.js +0 -58
- package/dist/hr-HR-DqC8Cgs6.js +0 -30
- package/dist/hr-HR-ZreFlbK9.js +0 -13
- package/dist/hu-HU-B3BihdGh.js +0 -13
- package/dist/hu-HU-BOanVlKb.js +0 -30
- package/dist/hu-HU-NhwFr6o-.js +0 -58
- package/dist/image-eUqBiRX_.js +0 -17
- package/dist/info-Wao3PEQK.js +0 -21
- package/dist/it-IT-BV9K87FK.js +0 -58
- package/dist/it-IT-Dd6xGSe-.js +0 -13
- package/dist/it-IT-eCrTB65E.js +0 -30
- package/dist/ja-JP-BJljbFIZ.js +0 -30
- package/dist/ja-JP-BUz3qN-V.js +0 -23
- package/dist/ja-JP-DXcP0ojZ.js +0 -58
- package/dist/ja-JP-iTbqSPNL.js +0 -13
- package/dist/keys-BpNgnAsD.js +0 -23
- package/dist/location-YXhcBMDy.js +0 -17
- package/dist/lt-LT-DE-4IXNG.js +0 -13
- package/dist/lt-LT-DckQGgoT.js +0 -30
- package/dist/lt-LT-tXTApHm2.js +0 -58
- package/dist/lv-LV-CeivEZms.js +0 -13
- package/dist/lv-LV-DP9oRTFv.js +0 -30
- package/dist/lv-LV-DSaQNC67.js +0 -58
- package/dist/mail-Z_IE_hkw.js +0 -14
- package/dist/nl-NL-D2QKudfh.js +0 -30
- package/dist/nl-NL-DVENFpd5.js +0 -13
- package/dist/nl-NL-DywVQ9km.js +0 -58
- package/dist/no-NO-B8oxqfNI.js +0 -58
- package/dist/no-NO-C_snYWBc.js +0 -30
- package/dist/no-NO-Dn2UkdoI.js +0 -13
- package/dist/partner-COG2_Erh.js +0 -21
- package/dist/pay-by-link-plane-Pv7Babgn.js +0 -22
- package/dist/person-CdGfItMU.js +0 -17
- package/dist/pl-PL-C89s21hn.js +0 -58
- package/dist/pl-PL-CQ6c2Qz_.js +0 -30
- package/dist/pl-PL-DFAzuceF.js +0 -13
- package/dist/plus-circle-filled-Cnf1oJTm.js +0 -17
- package/dist/pt-PT-BvK00TeI.js +0 -58
- package/dist/pt-PT-_o5xgnxS.js +0 -13
- package/dist/revenue-accelerate-rtXA-8EE.js +0 -17
- package/dist/ro-RO-BrTWk1Ui.js +0 -30
- package/dist/ro-RO-CpGd9emB.js +0 -58
- package/dist/ro-RO-D7c_Rj8V.js +0 -13
- package/dist/save-BofgDbDX.js +0 -14
- package/dist/search-BjMkvQh0.js +0 -17
- package/dist/sk-SK-BBSuh2fA.js +0 -13
- package/dist/sk-SK-BTFtoPmI.js +0 -30
- package/dist/sk-SK-DlX5KvBV.js +0 -58
- package/dist/sl-SI-BLTuWNf5.js +0 -13
- package/dist/sl-SI-BhVTSmhQ.js +0 -30
- package/dist/sl-SI-NI2OJAvm.js +0 -58
- package/dist/store-CkhgQMl0.js +0 -14
- package/dist/sv-SE-66rqYTxi.js +0 -30
- package/dist/sv-SE-BUfESAQK.js +0 -13
- package/dist/sv-SE-CAZpDX9G.js +0 -58
- package/dist/terminal-1-ewywjFJI.js +0 -18
- package/dist/types/components/BusinessLines/tasks/BusinessLinesDropin.d.ts +0 -5
- package/dist/types/utils/bankVerification/animation.d.ts +0 -2
- package/dist/upload-XDhHhAHV.js +0 -17
- package/dist/useFormContext-beqGS11A.js +0 -23
- package/dist/warning-circle-fill-DADaWT65.js +0 -17
- package/dist/warning-filled-BfAQN-BF.js +0 -14
- package/dist/webinar-BJWDRK2H.js +0 -22
- /package/dist/types/components/BusinessLines/tasks/{BusinessLinesGettingStarted → BusinessLines}/BusinessLinesGettingStarted.d.ts +0 -0
- /package/dist/types/embeds/{individual/adyen-individual.d.ts → individual-configuration/adyen-individual-configuration.d.ts} +0 -0
- /package/dist/types/embeds/{manage-individual/adyen-manage-individual.d.ts → individual-status/adyen-individual-status.d.ts} +0 -0
- /package/dist/types/embeds/{manage-terms-of-service/adyen-manage-terms-of-service.d.ts → terms-of-service-management/adyen-terms-of-service-management.d.ts} +0 -0
- /package/dist/types/embeds/{manage-transfer-instruments/adyen-manage-transfer-instruments.d.ts → terms-of-service-status/adyen-terms-of-service-status.d.ts} +0 -0
- /package/dist/types/embeds/{terms-of-service/adyen-terms-of-service.d.ts → transfer-instrument-configuration/adyen-transfer-instrument-configuration.d.ts} +0 -0
- /package/dist/types/embeds/{transfer-instrument/adyen-transfer-instrument.d.ts → transfer-instrument-management/adyen-transfer-instrument-management.d.ts} +0 -0
|
@@ -1,4311 +0,0 @@
|
|
|
1
|
-
;
|
|
2
|
-
{
|
|
3
|
-
try {
|
|
4
|
-
let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
5
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "a1e2ddba-d4c3-415d-9100-0b42465d10ba", e._sentryDebugIdIdentifier = "sentry-dbid-a1e2ddba-d4c3-415d-9100-0b42465d10ba");
|
|
6
|
-
} catch (e) {
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
;
|
|
10
|
-
import { a as addResourceBundles, _ as __variableDynamicImportRuntimeHelper, T as Trans } from "./translation-Cy20sz7q.js";
|
|
11
|
-
import { jsx, jsxs, Fragment } from "preact/jsx-runtime";
|
|
12
|
-
import { b as useApiContext, j as useQuery, k as httpPost, m as useSettingsContext, o as httpGet, p as getLegalRepresentative, c as useLegalEntity, q as skipToken, r as doesLegalEntityRequiresLegalRepresentative, a as useTranslation, B as Button, t as Svg, v as Skeleton, w as translateStringOrObject, x as Typography, y as LegalEntityTypes, z as isPartOfTrustFromLegalEntity, C as hasSolePropInLegalEntity, G as hasOwnEntityAssociationOfType, H as isEmptyEntity, J as EntityTypes, K as DATA_MISSING_DECISION_MAKER_ERROR_CODE_MAPPING, M as TaskTypes, N as createLogger, O as TaskStatuses, P as IconButton, U as useAnalyticsContext, V as Icon, W as noop, X as useExperimentsContext, Y as isInstantVerifiedAccount, Z as getObscuredAccountNumber, _ as useGetTaskStatus, R as ROOT_LE, L as Loader, $ as useGlobalStore, a0 as isPartOfUnincorporatedPartnership, a1 as getOwnSignatories, a2 as getOwnDecisionMakersLegalEntityIds, a3 as getOwnSolePropProblems, a4 as getOwnTrustProblems, a5 as getOwnUnincorporatedPartnershipProblems, a6 as getOwnEntityAssociations, a7 as TrustMemberTypes, u as useI18nContext, a8 as CountryCodes, a9 as isEmpty, g as getLegalEntityCountry, aa as getDecisionMakerDescriptionMap, ab as TRUST_DEFAULT_DESCRIPTIONS_MAP, ac as DEFAULT_TRUST_MEMBER_REQUIREMENTS, ad as hasAllCapabilitiesResolved, ae as hasRejectedCapabilities, af as objectsDeepEqual } from "./StoreProvider-BWVRmzZI.js";
|
|
13
|
-
import { lazy, Suspense } from "preact/compat";
|
|
14
|
-
import { useMemo, useCallback, useEffect, useState, useRef } from "preact/hooks";
|
|
15
|
-
import { u as useLocalStorage, a as useAccountHolder, b as useCapabilityProblems, I as Image, v as validateLegalCompanyName, c as validateNotEmptyOnBlur, d as validateLatinSpaceMarkPunctuationOnlyOnBlur, r as resolveFieldMetadata, R as RadioGroupCard, T as TextArea, C as ContextGuidance, e as TrustedFieldsProviders } from "./fieldConfigurations-DfVO1kZe.js";
|
|
16
|
-
import { C as CompanyTypesValues, h as handleKeys, u as useSetting, L as LandingLayout, n as nameFields, M as MultiSelectList, m as makeSelectItemForRole, N as Name, a as useSingpassMyInfoLogin, i as isBafinSignatoryFlow, s as showIdNowModal } from "./bafinUtils-CZB8qEIB.js";
|
|
17
|
-
import { u as useAssociatedLegalEntity } from "./useAssociatedLegalEntity-ew_9FM-o.js";
|
|
18
|
-
import cx from "classnames";
|
|
19
|
-
import { a as Alert } from "./Alert-BuZyBPdN.js";
|
|
20
|
-
import { u as useTermsOfServiceStatus, a as useTermsOfServiceAcceptanceInfos } from "./useTermsOfServiceStatus-B_Rs-b89.js";
|
|
21
|
-
import { S as SettingNames, I as InputText } from "./InputText-1Il1vZcv.js";
|
|
22
|
-
import { u as useToastContext } from "./useToastContext-Dzwox5LN.js";
|
|
23
|
-
import { C as Card, V as VerificationErrorAlert, u as useDeleteTransferInstrument } from "./Card-edBKJLEt.js";
|
|
24
|
-
import { signal } from "@preact/signals";
|
|
25
|
-
import { d as downloadFile } from "./file-CiG1D0zy.js";
|
|
26
|
-
import { A as Avatar } from "./Avatar-CbdryeRw.js";
|
|
27
|
-
import { L as LoaderWrapper, F as Field, a as useForm } from "./useForm-BSzxrzKr.js";
|
|
28
|
-
import { T as TaskItemStatus } from "./TaskItemStatus-BPcD795U.js";
|
|
29
|
-
import { g as getLegalEntityNameBasedOnType } from "./getName-Bxt44SQU.js";
|
|
30
|
-
import { u as useCreateLegalEntity, a as useUpdateLegalEntity, R as RadioGroup } from "./RadioGroup-RvJMyv9L.js";
|
|
31
|
-
import { F as FormNavigation, A as ActionBar } from "./FormNavigation-Nu5JeRyn.js";
|
|
32
|
-
import { m as mergeFieldMetadataIntoProps, g as getFieldProps, F as FormHeader, E as ErrorPanel, c as createFormUtils, C as CountryField, a as COUNTRY_FIELD, s as summaryItem, b as getRoleName, d as summaryStep, S as Summary, U as UnincorporatedPartnershipMemberTypes, e as getRoleTagVariant } from "./CountryField-C_sYT__J.js";
|
|
33
|
-
import { K as KEYBOARD_KEYS } from "./keys-BpNgnAsD.js";
|
|
34
|
-
import { T as Tag } from "./Tag-DdkVScyr.js";
|
|
35
|
-
import { u as useUnincorporatedPartnershipMembers, d as deleteUnincorporatedPartnershipMember } from "./useUnincorporatedPartnershipMembers-BIZriWIQ.js";
|
|
36
|
-
const getPciStatus = async (legalEntityId, baseUrl, data) => {
|
|
37
|
-
return httpPost(
|
|
38
|
-
{
|
|
39
|
-
baseUrl,
|
|
40
|
-
path: `legalEntities/${legalEntityId}/pci/signingRequired`
|
|
41
|
-
},
|
|
42
|
-
data
|
|
43
|
-
);
|
|
44
|
-
};
|
|
45
|
-
const usePciStatus = (data, options) => {
|
|
46
|
-
const { rootLegalEntityId, baseUrl } = useApiContext();
|
|
47
|
-
return useQuery({
|
|
48
|
-
queryKey: ["pciStatus", data],
|
|
49
|
-
queryFn: () => getPciStatus(rootLegalEntityId.value, baseUrl.value, data),
|
|
50
|
-
...options
|
|
51
|
-
});
|
|
52
|
-
};
|
|
53
|
-
function useSalesChannelsSettings() {
|
|
54
|
-
const { isSettingEnabled } = useSettingsContext();
|
|
55
|
-
return useMemo(() => {
|
|
56
|
-
const settings = [];
|
|
57
|
-
if (isSettingEnabled(SettingNames.RequirePciSignEcommerce)) {
|
|
58
|
-
settings.push("eCommerce");
|
|
59
|
-
}
|
|
60
|
-
if (isSettingEnabled(SettingNames.RequirePciSignPos)) {
|
|
61
|
-
settings.push("pos");
|
|
62
|
-
}
|
|
63
|
-
if (isSettingEnabled(SettingNames.RequirePciSignEcomMoto)) {
|
|
64
|
-
settings.push("ecomMoto");
|
|
65
|
-
}
|
|
66
|
-
if (isSettingEnabled(SettingNames.RequirePciSignPosMoto)) {
|
|
67
|
-
settings.push("posMoto");
|
|
68
|
-
}
|
|
69
|
-
return settings;
|
|
70
|
-
}, [isSettingEnabled]);
|
|
71
|
-
}
|
|
72
|
-
const getTaskTypes = async (id, baseUrl) => {
|
|
73
|
-
return httpGet({
|
|
74
|
-
baseUrl,
|
|
75
|
-
path: `legalEntities/${id}/configurations/tasks`
|
|
76
|
-
});
|
|
77
|
-
};
|
|
78
|
-
const useTaskTypes = (options) => {
|
|
79
|
-
const { rootLegalEntityId, baseUrl } = useApiContext();
|
|
80
|
-
return useQuery({
|
|
81
|
-
queryKey: ["taskTypes"],
|
|
82
|
-
queryFn: () => getTaskTypes(rootLegalEntityId.value, baseUrl.value),
|
|
83
|
-
...options
|
|
84
|
-
});
|
|
85
|
-
};
|
|
86
|
-
const getHasSeenIntroductionStorageKey = (legalEntityId) => `COMPLETED_INTRO-${legalEntityId}`;
|
|
87
|
-
const useHasSeenIntroduction = ({ legalEntityId }) => {
|
|
88
|
-
const [hasSeenIntroduction, setHasSeenIntroduction] = useLocalStorage(
|
|
89
|
-
getHasSeenIntroductionStorageKey(legalEntityId),
|
|
90
|
-
false
|
|
91
|
-
);
|
|
92
|
-
return { hasSeenIntroduction, setHasSeenIntroduction };
|
|
93
|
-
};
|
|
94
|
-
const getHasSeenSingpassSelectionStorageKey = (legalEntityId) => `COMPLETED_SINGPASS_SELECTION-${legalEntityId}`;
|
|
95
|
-
const useHasSeenSingpassSelection = ({
|
|
96
|
-
legalEntityId
|
|
97
|
-
}) => {
|
|
98
|
-
const [hasSeenSingpassSelection, setHasSeenSingpassSelection] = useLocalStorage(
|
|
99
|
-
getHasSeenSingpassSelectionStorageKey(legalEntityId),
|
|
100
|
-
false
|
|
101
|
-
);
|
|
102
|
-
return { hasSeenSingpassSelection, setHasSeenSingpassSelection };
|
|
103
|
-
};
|
|
104
|
-
const useAssociatedLegalRepresentative = (legalEntity) => {
|
|
105
|
-
const matchingAssociation = useMemo(() => {
|
|
106
|
-
if (!legalEntity) return void 0;
|
|
107
|
-
return getLegalRepresentative(legalEntity);
|
|
108
|
-
}, [legalEntity]);
|
|
109
|
-
const { data } = useLegalEntity(
|
|
110
|
-
doesLegalEntityRequiresLegalRepresentative(legalEntity) && matchingAssociation?.legalEntityId ? matchingAssociation.legalEntityId : skipToken
|
|
111
|
-
);
|
|
112
|
-
return data;
|
|
113
|
-
};
|
|
114
|
-
const getCanSeeEntitySelectionStorageKey = (legalEntityId) => `ENTITY_SELECTION_SEEN-${legalEntityId}`;
|
|
115
|
-
const useCanSeeEntitySelection = (legalEntityId) => {
|
|
116
|
-
const [canSeeEntitySelectionFromLocalStorage, setCanSeeEntitySelectionIntoLocalStorage] = useLocalStorage(getCanSeeEntitySelectionStorageKey(legalEntityId), true);
|
|
117
|
-
return {
|
|
118
|
-
canSeeEntitySelection: canSeeEntitySelectionFromLocalStorage,
|
|
119
|
-
setCanSeeEntitySelection: setCanSeeEntitySelectionIntoLocalStorage
|
|
120
|
-
};
|
|
121
|
-
};
|
|
122
|
-
const providerButton = "adyen-kyc-provider-button";
|
|
123
|
-
const providerButtonDisplayName = "adyen-kyc-provider-button-display-name";
|
|
124
|
-
const styles$5 = {
|
|
125
|
-
providerButton,
|
|
126
|
-
providerButtonDisplayName
|
|
127
|
-
};
|
|
128
|
-
const ProviderButton = ({ provider, onClick }) => {
|
|
129
|
-
const { t } = useTranslation("ui");
|
|
130
|
-
const providerLogo = {
|
|
131
|
-
singpassMyInfo: "singpass-logo",
|
|
132
|
-
singpassMyInfoBusiness: "singpass-logo"
|
|
133
|
-
};
|
|
134
|
-
const providerDisplayName = {
|
|
135
|
-
singpassMyInfo: "Singpass",
|
|
136
|
-
singpassMyInfoBusiness: "Singpass"
|
|
137
|
-
};
|
|
138
|
-
const buttonLabel = {
|
|
139
|
-
singpassMyInfo: t(($) => $["retrieveMyinfo"]),
|
|
140
|
-
singpassMyInfoBusiness: t(($) => $["retrieveMyinfoBusiness"])
|
|
141
|
-
};
|
|
142
|
-
return /* @__PURE__ */ jsx(Button, { onClick, fullWidth: true, variant: "secondary", children: /* @__PURE__ */ jsxs("div", { className: styles$5.providerButton, children: [
|
|
143
|
-
buttonLabel[provider],
|
|
144
|
-
/* @__PURE__ */ jsx("span", { className: styles$5.providerButtonDisplayName, children: providerDisplayName[provider] }),
|
|
145
|
-
/* @__PURE__ */ jsx(Svg, { name: providerLogo[provider], type: "image" })
|
|
146
|
-
] }) });
|
|
147
|
-
};
|
|
148
|
-
const legalEntityTypeToSubtitleTranslationKey = {
|
|
149
|
-
[LegalEntityTypes.INDIVIDUAL]: "myInfoYouCanGetVerifiedDetails",
|
|
150
|
-
[LegalEntityTypes.ORGANIZATION]: "myInfoBusinessYouCanGetVerifiedDetails"
|
|
151
|
-
};
|
|
152
|
-
const legalEntityTypeToProviderButtonKey = {
|
|
153
|
-
[LegalEntityTypes.INDIVIDUAL]: "singpassMyInfo",
|
|
154
|
-
[LegalEntityTypes.ORGANIZATION]: "singpassMyInfoBusiness"
|
|
155
|
-
};
|
|
156
|
-
const successAlertTitleText = {
|
|
157
|
-
[LegalEntityTypes.INDIVIDUAL]: "myinfoDetailsRetrieved",
|
|
158
|
-
[LegalEntityTypes.ORGANIZATION]: "myinfoBusinessDetailsRetrieved"
|
|
159
|
-
};
|
|
160
|
-
const successAlertContentText = {
|
|
161
|
-
[LegalEntityTypes.INDIVIDUAL]: "yourDetailsArePreFilledInTheRelevantSections",
|
|
162
|
-
[LegalEntityTypes.ORGANIZATION]: "yourBusinesssDetailsArePreFilledInTheRelevantSections"
|
|
163
|
-
};
|
|
164
|
-
const SingpassBanner = ({
|
|
165
|
-
isLoading,
|
|
166
|
-
isSuccess,
|
|
167
|
-
errorMessage,
|
|
168
|
-
onClick,
|
|
169
|
-
onAlertClose,
|
|
170
|
-
onMessage,
|
|
171
|
-
legalEntityType
|
|
172
|
-
}) => {
|
|
173
|
-
const { t } = useTranslation("common");
|
|
174
|
-
const { baseUrl } = useApiContext();
|
|
175
|
-
const singpassEventListener = useCallback(
|
|
176
|
-
(event) => {
|
|
177
|
-
if (event.origin !== new URL(baseUrl.value).origin) return;
|
|
178
|
-
onMessage({ data: { isSuccessful: event.data.isSuccessful } });
|
|
179
|
-
},
|
|
180
|
-
[baseUrl.value, onMessage]
|
|
181
|
-
);
|
|
182
|
-
useEffect(() => {
|
|
183
|
-
window.addEventListener("message", singpassEventListener);
|
|
184
|
-
return () => window.removeEventListener("message", singpassEventListener);
|
|
185
|
-
}, [singpassEventListener]);
|
|
186
|
-
const channel = new BroadcastChannel("sgidprovider");
|
|
187
|
-
useEffect(() => {
|
|
188
|
-
channel.onmessage = onMessage;
|
|
189
|
-
return () => channel.close();
|
|
190
|
-
}, [channel, onMessage]);
|
|
191
|
-
if (isLoading) {
|
|
192
|
-
return /* @__PURE__ */ jsx(Skeleton, {});
|
|
193
|
-
}
|
|
194
|
-
if (isSuccess) {
|
|
195
|
-
const successTitleText = successAlertTitleText[legalEntityType];
|
|
196
|
-
const successContentText = successAlertContentText[legalEntityType];
|
|
197
|
-
return /* @__PURE__ */ jsx(
|
|
198
|
-
Alert,
|
|
199
|
-
{
|
|
200
|
-
variant: "success",
|
|
201
|
-
title: successTitleText && t(($) => $[successTitleText]),
|
|
202
|
-
onClose: onAlertClose,
|
|
203
|
-
children: successContentText && t(($) => $[successContentText])
|
|
204
|
-
}
|
|
205
|
-
);
|
|
206
|
-
}
|
|
207
|
-
const providerName = legalEntityTypeToProviderButtonKey[legalEntityType];
|
|
208
|
-
if (errorMessage) {
|
|
209
|
-
return /* @__PURE__ */ jsx(
|
|
210
|
-
Alert,
|
|
211
|
-
{
|
|
212
|
-
variant: "warning",
|
|
213
|
-
title: translateStringOrObject(t, errorMessage),
|
|
214
|
-
onClose: onAlertClose,
|
|
215
|
-
children: /* @__PURE__ */ jsxs(Typography, { variant: "body", children: [
|
|
216
|
-
t(($) => $["tryAgainOrContinueEnteringTheDetailsYourself"]),
|
|
217
|
-
providerName && /* @__PURE__ */ jsx(ProviderButton, { provider: providerName, onClick })
|
|
218
|
-
] })
|
|
219
|
-
}
|
|
220
|
-
);
|
|
221
|
-
}
|
|
222
|
-
const subtitleTranslationKey = legalEntityTypeToSubtitleTranslationKey[legalEntityType];
|
|
223
|
-
return /* @__PURE__ */ jsxs(
|
|
224
|
-
Alert,
|
|
225
|
-
{
|
|
226
|
-
className: cx("adyen-task-list-singpass-banner"),
|
|
227
|
-
icon: false,
|
|
228
|
-
title: t(($) => $["getSetUpInstantly"]),
|
|
229
|
-
children: [
|
|
230
|
-
subtitleTranslationKey && /* @__PURE__ */ jsx("div", { className: cx("adyen-task-list-singpass-banner__subtitle"), children: t(($) => $[subtitleTranslationKey]) }),
|
|
231
|
-
providerName && /* @__PURE__ */ jsx(ProviderButton, { provider: providerName, onClick })
|
|
232
|
-
]
|
|
233
|
-
}
|
|
234
|
-
);
|
|
235
|
-
};
|
|
236
|
-
const getPciQuestionnaire = async (legalEntityId, baseUrl, documentId) => {
|
|
237
|
-
return httpGet({
|
|
238
|
-
baseUrl,
|
|
239
|
-
path: `legalEntities/${legalEntityId}/pci/questionnaires/${documentId}`
|
|
240
|
-
});
|
|
241
|
-
};
|
|
242
|
-
const getPciQuestionnaireList = async (legalEntityId, baseUrl) => {
|
|
243
|
-
return httpGet({
|
|
244
|
-
baseUrl,
|
|
245
|
-
path: `legalEntities/${legalEntityId}/pci/questionnaires`
|
|
246
|
-
});
|
|
247
|
-
};
|
|
248
|
-
const usePciQuestionnaireList = (options) => {
|
|
249
|
-
const { rootLegalEntityId, baseUrl } = useApiContext();
|
|
250
|
-
return useQuery({
|
|
251
|
-
queryKey: ["pciQuestionnaireList"],
|
|
252
|
-
queryFn: () => getPciQuestionnaireList(rootLegalEntityId.value, baseUrl.value),
|
|
253
|
-
...options
|
|
254
|
-
});
|
|
255
|
-
};
|
|
256
|
-
const getTaskStatus = async (legalEntityId, baseUrl) => {
|
|
257
|
-
return httpGet({
|
|
258
|
-
baseUrl,
|
|
259
|
-
path: `legalEntities/${legalEntityId}/taskStatus`
|
|
260
|
-
});
|
|
261
|
-
};
|
|
262
|
-
const useTaskStatus = (options) => {
|
|
263
|
-
const { rootLegalEntityId, baseUrl } = useApiContext();
|
|
264
|
-
return useQuery({
|
|
265
|
-
queryKey: ["taskStatus"],
|
|
266
|
-
queryFn: () => getTaskStatus(rootLegalEntityId.value, baseUrl.value),
|
|
267
|
-
...options
|
|
268
|
-
});
|
|
269
|
-
};
|
|
270
|
-
const useLegalEntityType = ({
|
|
271
|
-
legalEntity
|
|
272
|
-
}) => {
|
|
273
|
-
const isTrust = isPartOfTrustFromLegalEntity(legalEntity);
|
|
274
|
-
const isSoleProprietor = hasSolePropInLegalEntity(legalEntity);
|
|
275
|
-
const hasLegalAssociation = isTrust || isSoleProprietor;
|
|
276
|
-
switch (legalEntity.type) {
|
|
277
|
-
case LegalEntityTypes.INDIVIDUAL:
|
|
278
|
-
case LegalEntityTypes.ORGANIZATION:
|
|
279
|
-
if (!hasLegalAssociation) return legalEntity.type;
|
|
280
|
-
if (isSoleProprietor) return LegalEntityTypes.SOLE_PROPRIETORSHIP;
|
|
281
|
-
if (isTrust) return LegalEntityTypes.TRUST;
|
|
282
|
-
break;
|
|
283
|
-
default:
|
|
284
|
-
return void 0;
|
|
285
|
-
}
|
|
286
|
-
};
|
|
287
|
-
const useCanSeeIntroduction = ({ legalEntity }) => {
|
|
288
|
-
const legalEntityType = useLegalEntityType({ legalEntity });
|
|
289
|
-
const { isSettingEnabled } = useSettingsContext();
|
|
290
|
-
switch (legalEntityType) {
|
|
291
|
-
case LegalEntityTypes.INDIVIDUAL:
|
|
292
|
-
return !isSettingEnabled(SettingNames.HideOnboardingIntroductionIndividual);
|
|
293
|
-
case LegalEntityTypes.ORGANIZATION:
|
|
294
|
-
return !isSettingEnabled(SettingNames.HideOnboardingIntroductionOrganization);
|
|
295
|
-
case LegalEntityTypes.SOLE_PROPRIETORSHIP:
|
|
296
|
-
return !isSettingEnabled(SettingNames.HideOnboardingIntroductionSoleProprietor);
|
|
297
|
-
case LegalEntityTypes.TRUST:
|
|
298
|
-
return !isSettingEnabled(SettingNames.HideOnboardingIntroductionTrust);
|
|
299
|
-
default:
|
|
300
|
-
return false;
|
|
301
|
-
}
|
|
302
|
-
};
|
|
303
|
-
const capabilitiesToPreventTypeChange = [
|
|
304
|
-
"receivePayments",
|
|
305
|
-
"issueCard",
|
|
306
|
-
"useCard",
|
|
307
|
-
"withdrawFromAtm",
|
|
308
|
-
"withdrawFromAtmInRestrictedCountries",
|
|
309
|
-
"useCardInRestrictedCountries",
|
|
310
|
-
"useCardInRestrictedIndustries",
|
|
311
|
-
"issueBankAccount",
|
|
312
|
-
"sendToThirdParty",
|
|
313
|
-
"receiveFromThirdParty",
|
|
314
|
-
"getGrantOffers",
|
|
315
|
-
"receiveGrants"
|
|
316
|
-
];
|
|
317
|
-
const entityTypeToCorrespondingAccountHolderOption = {
|
|
318
|
-
[LegalEntityTypes.INDIVIDUAL]: "myName",
|
|
319
|
-
[LegalEntityTypes.ORGANIZATION]: "theCompanyIWorkFor",
|
|
320
|
-
[LegalEntityTypes.SOLE_PROPRIETORSHIP]: "mySoleProprietorName",
|
|
321
|
-
[LegalEntityTypes.TRUST]: "aTrust",
|
|
322
|
-
[LegalEntityTypes.UNINCORPORATED_PARTNERSHIP]: "anUnincorporatedPartnership"
|
|
323
|
-
};
|
|
324
|
-
const getDefaultAccountHolderType = (legalEntityResponse, isTypeChanging = false, accountHolder) => {
|
|
325
|
-
if (accountHolder) {
|
|
326
|
-
return accountHolder;
|
|
327
|
-
}
|
|
328
|
-
if (!legalEntityResponse?.type) return void 0;
|
|
329
|
-
if (hasOwnEntityAssociationOfType(
|
|
330
|
-
LegalEntityTypes.SOLE_PROPRIETORSHIP,
|
|
331
|
-
legalEntityResponse.entityAssociations,
|
|
332
|
-
legalEntityResponse.id
|
|
333
|
-
)) {
|
|
334
|
-
return "mySoleProprietorName";
|
|
335
|
-
}
|
|
336
|
-
if (hasOwnEntityAssociationOfType(
|
|
337
|
-
LegalEntityTypes.TRUST,
|
|
338
|
-
legalEntityResponse.entityAssociations,
|
|
339
|
-
legalEntityResponse.id
|
|
340
|
-
)) {
|
|
341
|
-
return "aTrust";
|
|
342
|
-
}
|
|
343
|
-
if (hasOwnEntityAssociationOfType(
|
|
344
|
-
LegalEntityTypes.UNINCORPORATED_PARTNERSHIP,
|
|
345
|
-
legalEntityResponse.entityAssociations,
|
|
346
|
-
legalEntityResponse.id
|
|
347
|
-
)) {
|
|
348
|
-
return "anUnincorporatedPartnership";
|
|
349
|
-
}
|
|
350
|
-
if (isTypeChanging || !isEmptyEntity(legalEntityResponse)) {
|
|
351
|
-
return entityTypeToCorrespondingAccountHolderOption[legalEntityResponse.type];
|
|
352
|
-
}
|
|
353
|
-
};
|
|
354
|
-
const allowIndividualWithoutSoleProp = (capabilities) => !capabilities?.map((c) => c.replace("Commercial", "").replace("Consumer", "")).some((c) => capabilitiesToPreventTypeChange.includes(c));
|
|
355
|
-
const BusinessTypes = {
|
|
356
|
-
INDIVIDUAL: "individual",
|
|
357
|
-
COMPANY: "company",
|
|
358
|
-
INCORPORATED_PARTNERSHIP: "partnershipIncorporated",
|
|
359
|
-
UNINCORPORATED_PARTNERSHIP: "partnershipUnincorporated",
|
|
360
|
-
INDIVIDUAL_TRUSTEE: "individualTrustee",
|
|
361
|
-
COMPANY_TRUSTEE: "companyTrustee",
|
|
362
|
-
SOLE_PROPRIETORSHIP: "soleProprietorship",
|
|
363
|
-
INCORPORATE_ASSOCIATION: "associationIncorporated"
|
|
364
|
-
};
|
|
365
|
-
const businessTypeMapping = {
|
|
366
|
-
myName: {
|
|
367
|
-
[LegalEntityTypes.INDIVIDUAL]: BusinessTypes.INDIVIDUAL
|
|
368
|
-
},
|
|
369
|
-
theCompanyIWorkFor: {
|
|
370
|
-
[LegalEntityTypes.ORGANIZATION]: BusinessTypes.COMPANY
|
|
371
|
-
},
|
|
372
|
-
mySoleProprietorName: {
|
|
373
|
-
[LegalEntityTypes.INDIVIDUAL]: BusinessTypes.SOLE_PROPRIETORSHIP
|
|
374
|
-
},
|
|
375
|
-
aTrust: {
|
|
376
|
-
[LegalEntityTypes.INDIVIDUAL]: BusinessTypes.INDIVIDUAL_TRUSTEE,
|
|
377
|
-
[LegalEntityTypes.ORGANIZATION]: BusinessTypes.COMPANY_TRUSTEE
|
|
378
|
-
},
|
|
379
|
-
anUnincorporatedPartnership: {
|
|
380
|
-
[LegalEntityTypes.INDIVIDUAL]: BusinessTypes.UNINCORPORATED_PARTNERSHIP,
|
|
381
|
-
[LegalEntityTypes.ORGANIZATION]: BusinessTypes.UNINCORPORATED_PARTNERSHIP
|
|
382
|
-
}
|
|
383
|
-
};
|
|
384
|
-
const companyTypesMapping = {
|
|
385
|
-
[CompanyTypesValues.INCORPORATED_PARTNERSHIP]: BusinessTypes.INCORPORATED_PARTNERSHIP,
|
|
386
|
-
[CompanyTypesValues.INCORPORATED_ASSOCIATION]: BusinessTypes.INCORPORATE_ASSOCIATION,
|
|
387
|
-
[CompanyTypesValues.PUBLIC_COMPANY]: BusinessTypes.COMPANY,
|
|
388
|
-
[CompanyTypesValues.PRIVATE_COMPANY]: BusinessTypes.COMPANY,
|
|
389
|
-
[CompanyTypesValues.UNLISTED_PUBLIC_COMPANY]: BusinessTypes.COMPANY,
|
|
390
|
-
[CompanyTypesValues.GOVERNMENTAL_ORGANIZATION]: BusinessTypes.COMPANY,
|
|
391
|
-
[CompanyTypesValues.NON_PROFIT_OR_CHARITABLE]: BusinessTypes.COMPANY,
|
|
392
|
-
[CompanyTypesValues.SOLE_PROPRIETORSHIP]: BusinessTypes.SOLE_PROPRIETORSHIP
|
|
393
|
-
};
|
|
394
|
-
const useBusinessSetup = (legalEntityResponse) => {
|
|
395
|
-
const { accountHolder } = useAccountHolder();
|
|
396
|
-
const accountHolderType = accountHolder || getDefaultAccountHolderType(legalEntityResponse);
|
|
397
|
-
const organizationType = legalEntityResponse?.organization?.type;
|
|
398
|
-
const businessSetup = accountHolderType === "theCompanyIWorkFor" && organizationType ? companyTypesMapping[organizationType] : businessTypeMapping[accountHolderType]?.[legalEntityResponse?.type];
|
|
399
|
-
return businessSetup;
|
|
400
|
-
};
|
|
401
|
-
function useDataMissingRemediations({
|
|
402
|
-
legalEntityId,
|
|
403
|
-
problems
|
|
404
|
-
}) {
|
|
405
|
-
const { t } = useTranslation("common");
|
|
406
|
-
const decisionMakersRemediationMessage = useMemo(() => {
|
|
407
|
-
const remediationCodes = problems[EntityTypes.LEGAL_ENTITY]?.[legalEntityId]?.missingData?.reduce((remediations, error) => {
|
|
408
|
-
const remediation = DATA_MISSING_DECISION_MAKER_ERROR_CODE_MAPPING[error.code];
|
|
409
|
-
return remediation ? [...remediations, remediation] : remediations;
|
|
410
|
-
}, []);
|
|
411
|
-
const uniqueRemediations = [...new Set(remediationCodes)];
|
|
412
|
-
switch (uniqueRemediations?.length) {
|
|
413
|
-
case void 0:
|
|
414
|
-
case 0:
|
|
415
|
-
return void 0;
|
|
416
|
-
case 1:
|
|
417
|
-
return uniqueRemediations[0] ? t(($) => $[`remediationMessage_${uniqueRemediations[0]}`]) : t(($) => $["missingMultipleDecisionMakers"]);
|
|
418
|
-
default:
|
|
419
|
-
return t(($) => $["missingMultipleDecisionMakers"]);
|
|
420
|
-
}
|
|
421
|
-
}, [problems, t, legalEntityId]);
|
|
422
|
-
return {
|
|
423
|
-
remediationMessages: {
|
|
424
|
-
[TaskTypes.DECISION_MAKER]: decisionMakersRemediationMessage
|
|
425
|
-
}
|
|
426
|
-
};
|
|
427
|
-
}
|
|
428
|
-
const logger$2 = createLogger();
|
|
429
|
-
const normalizeTaskStatuses = (taskStatuses) => {
|
|
430
|
-
return taskStatuses?.statuses?.reduce((acc, currentTask) => {
|
|
431
|
-
const status = TaskStatuses[currentTask.status];
|
|
432
|
-
const statusEntries = currentTask.taskStatusEntries;
|
|
433
|
-
acc[currentTask.type] = {
|
|
434
|
-
status: status ?? TaskStatuses.DETAILS_REQUIRED,
|
|
435
|
-
taskStatusEntries: statusEntries
|
|
436
|
-
};
|
|
437
|
-
return acc;
|
|
438
|
-
}, {});
|
|
439
|
-
};
|
|
440
|
-
const TASK_STATUS_POLLING_INTERVAL_MS = 3e3;
|
|
441
|
-
const TASK_STATUS_COMPLETED_POLLING_INTERVAL_MS = 6e3;
|
|
442
|
-
const getAccountTaskStatus = (accountId, payinPayoutTaskStatus) => {
|
|
443
|
-
const taskStatusEntries = payinPayoutTaskStatus?.taskStatusEntries;
|
|
444
|
-
const taskStatusEntry = taskStatusEntries?.find((entry) => entry.id.includes(accountId));
|
|
445
|
-
if (!taskStatusEntry) {
|
|
446
|
-
logger$2.warn(`No task status for this account: ${accountId}`);
|
|
447
|
-
return payinPayoutTaskStatus?.status ?? TaskStatuses.PROCESSING;
|
|
448
|
-
}
|
|
449
|
-
return TaskStatuses[taskStatusEntry.status];
|
|
450
|
-
};
|
|
451
|
-
const normalizedTaskStatusStore = signal(void 0);
|
|
452
|
-
const setNormalizedTaskStatusStore = (taskStatus) => {
|
|
453
|
-
normalizedTaskStatusStore.value = taskStatus;
|
|
454
|
-
};
|
|
455
|
-
const Remove = ({
|
|
456
|
-
onRemove,
|
|
457
|
-
onRemoveStatusChange,
|
|
458
|
-
isRemoveDisabled = false,
|
|
459
|
-
handleIsRemoveDisabled
|
|
460
|
-
}) => {
|
|
461
|
-
const { t } = useTranslation("ui");
|
|
462
|
-
const [undoTimer, setUndoTimer] = useState(5);
|
|
463
|
-
const [isRemoving, setIsRemoving] = useState(false);
|
|
464
|
-
useEffect(() => {
|
|
465
|
-
let undoInterval;
|
|
466
|
-
if (isRemoving && undoTimer > 0) {
|
|
467
|
-
undoInterval = setInterval(() => {
|
|
468
|
-
setUndoTimer((prevCount) => prevCount - 1);
|
|
469
|
-
}, 1e3);
|
|
470
|
-
}
|
|
471
|
-
return () => {
|
|
472
|
-
clearInterval(undoInterval);
|
|
473
|
-
};
|
|
474
|
-
}, [isRemoving, undoTimer]);
|
|
475
|
-
const onClickHandler = (event) => {
|
|
476
|
-
event.stopPropagation();
|
|
477
|
-
event.preventDefault();
|
|
478
|
-
if (!isRemoving) {
|
|
479
|
-
setIsRemoving(true);
|
|
480
|
-
onRemoveStatusChange?.(true);
|
|
481
|
-
handleIsRemoveDisabled?.(true);
|
|
482
|
-
} else {
|
|
483
|
-
setUndoTimer(5);
|
|
484
|
-
setIsRemoving(false);
|
|
485
|
-
onRemoveStatusChange?.(false);
|
|
486
|
-
handleIsRemoveDisabled?.(false);
|
|
487
|
-
}
|
|
488
|
-
};
|
|
489
|
-
useEffect(() => {
|
|
490
|
-
if (undoTimer === 0 && isRemoving) {
|
|
491
|
-
(async () => {
|
|
492
|
-
setIsRemoving(false);
|
|
493
|
-
await onRemove();
|
|
494
|
-
onRemoveStatusChange?.(false);
|
|
495
|
-
handleIsRemoveDisabled?.(false);
|
|
496
|
-
})();
|
|
497
|
-
}
|
|
498
|
-
}, [undoTimer, isRemoving, onRemoveStatusChange, handleIsRemoveDisabled, onRemove]);
|
|
499
|
-
return isRemoving ? /* @__PURE__ */ jsx(Button, { variant: "tertiary", onClick: onClickHandler, children: t(($) => $["undoWithTimer"], { secondsLeft: undoTimer }) }) : /* @__PURE__ */ jsx(
|
|
500
|
-
IconButton,
|
|
501
|
-
{
|
|
502
|
-
ariaLabel: t(($) => $["remove"]),
|
|
503
|
-
icon: "bin",
|
|
504
|
-
variant: "tertiary",
|
|
505
|
-
onClick: onClickHandler,
|
|
506
|
-
disabled: isRemoveDisabled
|
|
507
|
-
}
|
|
508
|
-
);
|
|
509
|
-
};
|
|
510
|
-
const TaskListItem = ({
|
|
511
|
-
titleKey,
|
|
512
|
-
title,
|
|
513
|
-
icon,
|
|
514
|
-
status,
|
|
515
|
-
statusLabel,
|
|
516
|
-
onNavigateToTask,
|
|
517
|
-
disabled = false,
|
|
518
|
-
problems,
|
|
519
|
-
downloadHandler,
|
|
520
|
-
info,
|
|
521
|
-
loading = false,
|
|
522
|
-
showErrorAlerts = "onErrorStatus",
|
|
523
|
-
warningMessage,
|
|
524
|
-
removeEntity,
|
|
525
|
-
isRemoveDisabled = false,
|
|
526
|
-
handleIsRemoveDisabled,
|
|
527
|
-
testId,
|
|
528
|
-
enableTracking = true,
|
|
529
|
-
fallbackErrorMessage
|
|
530
|
-
}) => {
|
|
531
|
-
const { t } = useTranslation("common");
|
|
532
|
-
const userEvents = useAnalyticsContext();
|
|
533
|
-
const shouldShowErrorAlert = showErrorAlerts === "always" || showErrorAlerts === "onErrorStatus" && status === TaskStatuses.ERROR;
|
|
534
|
-
const [isStatusRemoving, setIsStatusRemoving] = useState(false);
|
|
535
|
-
const handleNavigateToTask = () => {
|
|
536
|
-
if (enableTracking) {
|
|
537
|
-
userEvents.addJourneyEvent("Clicked button", {
|
|
538
|
-
actionType: "open",
|
|
539
|
-
task: void 0,
|
|
540
|
-
label: titleKey
|
|
541
|
-
});
|
|
542
|
-
}
|
|
543
|
-
onNavigateToTask?.();
|
|
544
|
-
};
|
|
545
|
-
const avatarVariant = disabled ? "disabled" : "primary";
|
|
546
|
-
return /* @__PURE__ */ jsx(
|
|
547
|
-
Card,
|
|
548
|
-
{
|
|
549
|
-
stateful: onNavigateToTask && !loading && !disabled,
|
|
550
|
-
warningMessage,
|
|
551
|
-
onClick: loading ? void 0 : handleNavigateToTask,
|
|
552
|
-
onKeyDown: handleKeys(["Enter"], handleNavigateToTask ?? noop),
|
|
553
|
-
className: "adyen-task",
|
|
554
|
-
disabled,
|
|
555
|
-
children: /* @__PURE__ */ jsxs(
|
|
556
|
-
LoaderWrapper,
|
|
557
|
-
{
|
|
558
|
-
status: loading ? "loading" : "success",
|
|
559
|
-
formOpacityWhenLoading: 0.3,
|
|
560
|
-
loaderSize: "medium",
|
|
561
|
-
children: [
|
|
562
|
-
/* @__PURE__ */ jsxs("div", { className: "adyen-task-item", "data-testid": testId, children: [
|
|
563
|
-
/* @__PURE__ */ jsxs("div", { className: "adyen-task-item__header", children: [
|
|
564
|
-
/* @__PURE__ */ jsxs("div", { className: "adyen-task-item__heading", children: [
|
|
565
|
-
/* @__PURE__ */ jsx(Avatar, { variant: avatarVariant, iconName: icon }),
|
|
566
|
-
/* @__PURE__ */ jsx("div", { className: "adyen-task-item__body", children: /* @__PURE__ */ jsx("span", { className: "adyen-task-item__title", children: title || t(($) => $[titleKey]) }) })
|
|
567
|
-
] }),
|
|
568
|
-
info && /* @__PURE__ */ jsxs("div", { className: "adyen-task-item__info", children: [
|
|
569
|
-
/* @__PURE__ */ jsx(Icon, { name: "info-circle" }),
|
|
570
|
-
/* @__PURE__ */ jsx("span", { children: info })
|
|
571
|
-
] })
|
|
572
|
-
] }),
|
|
573
|
-
/* @__PURE__ */ jsxs("aside", { className: "adyen-task-item__status", children: [
|
|
574
|
-
/* @__PURE__ */ jsx(
|
|
575
|
-
TaskItemStatus,
|
|
576
|
-
{
|
|
577
|
-
status: isStatusRemoving ? TaskStatuses.REMOVING : status,
|
|
578
|
-
statusLabel,
|
|
579
|
-
downloadHandler
|
|
580
|
-
}
|
|
581
|
-
),
|
|
582
|
-
typeof removeEntity === "function" && typeof handleIsRemoveDisabled === "function" ? /* @__PURE__ */ jsx("div", { className: "adyen-task-item__remove", children: /* @__PURE__ */ jsx(
|
|
583
|
-
Remove,
|
|
584
|
-
{
|
|
585
|
-
onRemove: removeEntity,
|
|
586
|
-
onRemoveStatusChange: setIsStatusRemoving,
|
|
587
|
-
isRemoveDisabled,
|
|
588
|
-
handleIsRemoveDisabled
|
|
589
|
-
}
|
|
590
|
-
) }) : /* @__PURE__ */ jsx(Icon, { name: "chevron-right" })
|
|
591
|
-
] })
|
|
592
|
-
] }),
|
|
593
|
-
shouldShowErrorAlert && /* @__PURE__ */ jsx(
|
|
594
|
-
VerificationErrorAlert,
|
|
595
|
-
{
|
|
596
|
-
className: "adyen-task-item-alert",
|
|
597
|
-
problems,
|
|
598
|
-
fallbackErrorMessage
|
|
599
|
-
}
|
|
600
|
-
)
|
|
601
|
-
]
|
|
602
|
-
}
|
|
603
|
-
)
|
|
604
|
-
}
|
|
605
|
-
);
|
|
606
|
-
};
|
|
607
|
-
const PayoutAccountTaskListItem = ({
|
|
608
|
-
account,
|
|
609
|
-
capabilityProblems,
|
|
610
|
-
onNavigateToTask,
|
|
611
|
-
payinPayoutTaskStatus
|
|
612
|
-
}) => {
|
|
613
|
-
const { t } = useTranslation("common");
|
|
614
|
-
const { showToast } = useToastContext();
|
|
615
|
-
const { isExperimentEnabled } = useExperimentsContext();
|
|
616
|
-
const { mutateAsync: deleteTransferInstrument } = useDeleteTransferInstrument();
|
|
617
|
-
const [isDeletingTransferInstrument, setIsDeletingTransferInstrument] = useState(false);
|
|
618
|
-
const isInstantVerificationAccount = isInstantVerifiedAccount(account);
|
|
619
|
-
const [isRemoveDisabled, setIsRemoveDisabled] = useState(false);
|
|
620
|
-
const obscuredAccountNumber = getObscuredAccountNumber(account);
|
|
621
|
-
const getTaskStatus2 = useGetTaskStatus();
|
|
622
|
-
const status = isExperimentEnabled("UseTaskStatusApiForPayout") ? getAccountTaskStatus(account.id, payinPayoutTaskStatus) : getTaskStatus2(TaskTypes.PAYOUT, account.id);
|
|
623
|
-
const handleDeleteTransferInstrument = async () => {
|
|
624
|
-
try {
|
|
625
|
-
await deleteTransferInstrument(account.id);
|
|
626
|
-
showToast({ label: t(($) => $["transferInstrumentDeleted"]), variant: "success" });
|
|
627
|
-
} catch {
|
|
628
|
-
showToast({ label: t(($) => $["failedToDeletePayoutAccount"]), variant: "error" });
|
|
629
|
-
}
|
|
630
|
-
};
|
|
631
|
-
return /* @__PURE__ */ jsx(
|
|
632
|
-
TaskListItem,
|
|
633
|
-
{
|
|
634
|
-
disabled: isInstantVerificationAccount && status === TaskStatuses.PROCESSING,
|
|
635
|
-
onNavigateToTask: isInstantVerificationAccount ? void 0 : onNavigateToTask,
|
|
636
|
-
icon: "payout",
|
|
637
|
-
titleKey: "accountNumber",
|
|
638
|
-
title: obscuredAccountNumber,
|
|
639
|
-
status,
|
|
640
|
-
problems: capabilityProblems?.BankAccount?.[account.id],
|
|
641
|
-
fallbackErrorMessage: isInstantVerificationAccount ? t(($) => $["verificationErrorMessageTrustedTransferInstrument"]) : void 0,
|
|
642
|
-
loading: isDeletingTransferInstrument,
|
|
643
|
-
removeEntity: () => {
|
|
644
|
-
setIsDeletingTransferInstrument(true);
|
|
645
|
-
handleDeleteTransferInstrument();
|
|
646
|
-
},
|
|
647
|
-
isRemoveDisabled,
|
|
648
|
-
handleIsRemoveDisabled: setIsRemoveDisabled
|
|
649
|
-
}
|
|
650
|
-
);
|
|
651
|
-
};
|
|
652
|
-
function CardGroup({ className, children, spaced = false }) {
|
|
653
|
-
const baseClass = spaced ? "adyen-kyc-card-group-spaced" : "adyen-kyc-card-group";
|
|
654
|
-
return /* @__PURE__ */ jsx("section", { className: cx(baseClass, className), children });
|
|
655
|
-
}
|
|
656
|
-
const TaskListGroup = ({ title, children }) => /* @__PURE__ */ jsxs("article", { className: "adyen-task-list-group", children: [
|
|
657
|
-
title && /* @__PURE__ */ jsx("header", { className: "adyen-task-list-group__header", children: /* @__PURE__ */ jsx(Typography, { el: "h4", variant: "body-stronger", color: "secondary", children: title }) }),
|
|
658
|
-
/* @__PURE__ */ jsx("div", { className: "adyen-kyc-card__body", children: /* @__PURE__ */ jsx(CardGroup, { className: "adyen-task-list-group__items", children }) })
|
|
659
|
-
] });
|
|
660
|
-
const LEGAL_ENTITY_BASE_TASKS = [
|
|
661
|
-
TaskTypes.INDIVIDUAL,
|
|
662
|
-
TaskTypes.BUSINESS_DETAILS,
|
|
663
|
-
TaskTypes.DECISION_MAKER_OVERVIEW
|
|
664
|
-
];
|
|
665
|
-
const CONTRACT_TASKS = [TaskTypes.SERVICE_AGREEMENT, TaskTypes.PCI_DSS];
|
|
666
|
-
function TaskList({ onNavigateToTask, singpassComponent }) {
|
|
667
|
-
const { data: rootLe, isLoading } = useLegalEntity(ROOT_LE);
|
|
668
|
-
const capabilityProblems = useCapabilityProblems() ?? {};
|
|
669
|
-
if (isLoading || !rootLe) {
|
|
670
|
-
return /* @__PURE__ */ jsx(Loader, { size: "large" });
|
|
671
|
-
}
|
|
672
|
-
return /* @__PURE__ */ jsx(
|
|
673
|
-
TaskListInner,
|
|
674
|
-
{
|
|
675
|
-
onNavigateToTask,
|
|
676
|
-
singpassComponent,
|
|
677
|
-
legalEntityResponse: rootLe,
|
|
678
|
-
capabilityProblems
|
|
679
|
-
}
|
|
680
|
-
);
|
|
681
|
-
}
|
|
682
|
-
function TaskListInner({
|
|
683
|
-
onNavigateToTask,
|
|
684
|
-
legalEntityResponse,
|
|
685
|
-
capabilityProblems,
|
|
686
|
-
singpassComponent
|
|
687
|
-
}) {
|
|
688
|
-
const userEvents = useAnalyticsContext();
|
|
689
|
-
const { t } = useTranslation("common");
|
|
690
|
-
const { showToast } = useToastContext();
|
|
691
|
-
const { rootLegalEntityId, baseUrl } = useApiContext();
|
|
692
|
-
const { isSettingEnabled } = useSettingsContext();
|
|
693
|
-
const { isExperimentEnabled } = useExperimentsContext();
|
|
694
|
-
const { accountHolder } = useAccountHolder();
|
|
695
|
-
const tasks = useGlobalStore().tasks.value;
|
|
696
|
-
const getTaskStatus2 = useGetTaskStatus();
|
|
697
|
-
const businessSetup = useBusinessSetup(legalEntityResponse);
|
|
698
|
-
const canSeeIntroduction = useCanSeeIntroduction({ legalEntity: legalEntityResponse });
|
|
699
|
-
const additionalSalesChannels = useSalesChannelsSettings();
|
|
700
|
-
const { remediationMessages } = useDataMissingRemediations({
|
|
701
|
-
legalEntityId: legalEntityResponse.id,
|
|
702
|
-
problems: capabilityProblems
|
|
703
|
-
});
|
|
704
|
-
const { data: pciStatus } = usePciStatus(
|
|
705
|
-
{ additionalSalesChannels },
|
|
706
|
-
{ enabled: tasks.includes(TaskTypes.PCI_DSS) }
|
|
707
|
-
);
|
|
708
|
-
const { data: pciQuestionnaireList } = usePciQuestionnaireList();
|
|
709
|
-
const { data: termsOfServiceStatus } = useTermsOfServiceStatus();
|
|
710
|
-
const { data: termsOfServiceStatusAcceptanceInfos } = useTermsOfServiceAcceptanceInfos();
|
|
711
|
-
const { data: taskStatuses } = useTaskStatus({
|
|
712
|
-
refetchInterval: (query) => {
|
|
713
|
-
const { data: response } = query.state || {};
|
|
714
|
-
const statuses = response?.statuses;
|
|
715
|
-
const areAllTasksFinishedOrEmpty = statuses?.length === 0 || statuses?.every((task) => task.status === "FINISHED");
|
|
716
|
-
return areAllTasksFinishedOrEmpty ? TASK_STATUS_COMPLETED_POLLING_INTERVAL_MS : TASK_STATUS_POLLING_INTERVAL_MS;
|
|
717
|
-
}
|
|
718
|
-
});
|
|
719
|
-
const canChangeEntityType = isSettingEnabled(SettingNames.AllowLegalEntityTypeChange);
|
|
720
|
-
const hidePayoutAccountTaskExperiment = isExperimentEnabled("HidePayoutAccountTask");
|
|
721
|
-
const hidePciTaskExperiment = isExperimentEnabled("HidePciTask");
|
|
722
|
-
const showCustomerSupportV4 = isExperimentEnabled("ShowCustomerSupportV4");
|
|
723
|
-
const EnableSignPCIBeforeTOS = isExperimentEnabled("EnableSignPCIBeforeTOS");
|
|
724
|
-
const transferInstrumentLimit = useSetting("transferInstrumentLimit");
|
|
725
|
-
const normalizedTasks = normalizeTaskStatuses(taskStatuses);
|
|
726
|
-
setNormalizedTaskStatusStore(normalizedTasks);
|
|
727
|
-
const payinPayoutTaskStatus = normalizedTasks?.PAYOUT ?? normalizedTasks?.PAYIN;
|
|
728
|
-
const businessDetailsTaskStatus = isExperimentEnabled("EnableBusinessDetailsTaskStatusService") ? normalizedTasks?.BUSINESS_DETAILS?.status ?? TaskStatuses.DETAILS_REQUIRED : getTaskStatus2(TaskTypes.BUSINESS_DETAILS);
|
|
729
|
-
const isReview = Boolean(
|
|
730
|
-
capabilityProblems?.LegalEntity?.[legalEntityResponse.id]?.isReviewRequired
|
|
731
|
-
);
|
|
732
|
-
const hasTrust = accountHolder === "aTrust" || isPartOfTrustFromLegalEntity(legalEntityResponse);
|
|
733
|
-
const hasUnincorporatedPartnership = accountHolder === "anUnincorporatedPartnership" || isPartOfUnincorporatedPartnership(legalEntityResponse);
|
|
734
|
-
const hasSoleProprietorship = accountHolder === "mySoleProprietorName" || hasSolePropInLegalEntity(legalEntityResponse);
|
|
735
|
-
const isLegalRepresentativeRequired = isExperimentEnabled("EnableAgeVerification") && doesLegalEntityRequiresLegalRepresentative(legalEntityResponse);
|
|
736
|
-
const legalRepresentative = isLegalRepresentativeRequired && getLegalRepresentative(legalEntityResponse);
|
|
737
|
-
const transferInstruments = legalEntityResponse?.transferInstruments || [];
|
|
738
|
-
const canAddPayoutAccount = legalEntityResponse?.organization?.legalName || legalEntityResponse?.individual?.name;
|
|
739
|
-
const hasPayinTaskNotPayout = tasks.includes(TaskTypes.PAYIN) && !tasks.includes(TaskTypes.PAYOUT);
|
|
740
|
-
const payoutTaskDescriptionKey = isReview ? "payoutAccountsDescriptionReview" : "payoutAccountsDescription";
|
|
741
|
-
const pciHasDocuments = !!pciQuestionnaireList?.data?.length;
|
|
742
|
-
const canSignPci = (
|
|
743
|
-
// PCI requires decision makers to be added
|
|
744
|
-
legalEntityResponse.type === LegalEntityTypes.ORGANIZATION && !!legalEntityResponse?.entityAssociations?.length || legalEntityResponse.type === LegalEntityTypes.INDIVIDUAL && !!legalEntityResponse?.entityAssociations?.length
|
|
745
|
-
);
|
|
746
|
-
const canDownloadPci = !pciStatus?.signingRequired && pciHasDocuments;
|
|
747
|
-
const hasSignedPci = !pciStatus?.signingRequired && canSignPci;
|
|
748
|
-
const serviceAgreementTypes = termsOfServiceStatus?.termsOfServiceTypes ?? [];
|
|
749
|
-
const serviceAgreementAcceptanceInfos = termsOfServiceStatusAcceptanceInfos?.data ?? [];
|
|
750
|
-
const hasServiceAgreementSigners = legalEntityResponse.type === LegalEntityTypes.ORGANIZATION && getOwnSignatories(legalEntityResponse).length || Boolean(legalRepresentative) || legalEntityResponse.type === LegalEntityTypes.INDIVIDUAL && !!legalEntityResponse?.individual;
|
|
751
|
-
const hasTaskOfGroupAccountDetails = tasks.some((task) => LEGAL_ENTITY_BASE_TASKS.includes(task));
|
|
752
|
-
const hasContractTasks = tasks.some((task) => CONTRACT_TASKS.includes(task));
|
|
753
|
-
const hasFinancingTasks = tasks.includes(TaskTypes.BUSINESS_FINANCING) || tasks.includes(TaskTypes.SOURCE_OF_FUNDS);
|
|
754
|
-
const showServiceAgreementTask = tasks.includes(TaskTypes.SERVICE_AGREEMENT) && (serviceAgreementTypes.length > 0 || serviceAgreementAcceptanceInfos.length > 0);
|
|
755
|
-
const showPciTask = tasks.includes(TaskTypes.PCI_DSS) && (canDownloadPci || pciStatus?.signingRequired) && !hidePciTaskExperiment;
|
|
756
|
-
const showContractTasks = hasContractTasks && (showPciTask || showServiceAgreementTask);
|
|
757
|
-
const shouldSignPciFirst = showServiceAgreementTask && showPciTask && !hasSignedPci;
|
|
758
|
-
const areServiceAgreementTasksDisabled = EnableSignPCIBeforeTOS ? !hasServiceAgreementSigners || shouldSignPciFirst : !hasServiceAgreementSigners;
|
|
759
|
-
const isPciTaskDisabled = !pciStatus?.signingRequired || !canSignPci;
|
|
760
|
-
const getBusinessTaskListTitleKey = () => {
|
|
761
|
-
if (hasUnincorporatedPartnership) {
|
|
762
|
-
return "tellUsMoreAboutPrimaryPartner";
|
|
763
|
-
} else if (tasks.includes(TaskTypes.BUSINESS_DETAILS)) {
|
|
764
|
-
return isReview ? "businessAccountDetailsDescriptionReview" : "businessAccountDetailsDescription";
|
|
765
|
-
} else if (canChangeEntityType) {
|
|
766
|
-
return "provideFewDetailsAboutYourself";
|
|
767
|
-
} else {
|
|
768
|
-
return "accountDetailsDescription";
|
|
769
|
-
}
|
|
770
|
-
};
|
|
771
|
-
const getEmptyBankAccountProblems = () => {
|
|
772
|
-
const transferInstrumentId = legalEntityResponse?.transferInstruments?.[0]?.id;
|
|
773
|
-
return transferInstrumentId ? capabilityProblems?.BankAccount?.[transferInstrumentId] : void 0;
|
|
774
|
-
};
|
|
775
|
-
const onEditBusinessSetupClick = () => {
|
|
776
|
-
userEvents.addTaskEvent("Clicked button", {
|
|
777
|
-
task: TaskTypes.TASKS_OVERVIEW,
|
|
778
|
-
actionType: "edit"
|
|
779
|
-
});
|
|
780
|
-
onNavigateToTask(TaskTypes.BUSINESS_TYPE_SELECTION);
|
|
781
|
-
};
|
|
782
|
-
const onPciDownload = async () => {
|
|
783
|
-
try {
|
|
784
|
-
const response = await getPciQuestionnaireList(rootLegalEntityId.value, baseUrl.value);
|
|
785
|
-
if (!response.data) return;
|
|
786
|
-
await Promise.all(
|
|
787
|
-
response.data.map(async (pciQuestionnaireInfo) => {
|
|
788
|
-
const pciQuestionnaire = await getPciQuestionnaire(
|
|
789
|
-
rootLegalEntityId.value,
|
|
790
|
-
baseUrl.value,
|
|
791
|
-
pciQuestionnaireInfo.id
|
|
792
|
-
);
|
|
793
|
-
await downloadFile(pciQuestionnaire.content, `${pciQuestionnaire.id}.pdf`);
|
|
794
|
-
})
|
|
795
|
-
);
|
|
796
|
-
} catch {
|
|
797
|
-
showToast({ label: t(($) => $["failedToDownloadPci"]), variant: "error" });
|
|
798
|
-
} finally {
|
|
799
|
-
userEvents.addTaskEvent("Clicked button", {
|
|
800
|
-
task: TaskTypes.PCI_DSS,
|
|
801
|
-
actionType: "download"
|
|
802
|
-
});
|
|
803
|
-
}
|
|
804
|
-
};
|
|
805
|
-
const handleOnNavigateToTaskReview = () => onNavigateToTask(TaskTypes.REVIEW);
|
|
806
|
-
const handleOnNavigateToTaskIndividual = () => onNavigateToTask(TaskTypes.INDIVIDUAL);
|
|
807
|
-
const handleOnNavigateToTaskBusinessDetails = () => onNavigateToTask(TaskTypes.BUSINESS_DETAILS);
|
|
808
|
-
const handleOnNavigateToTaskBusinessLines = () => onNavigateToTask(TaskTypes.BUSINESS_LINES);
|
|
809
|
-
const handleOnNavigateToTaskCustomerSupport = () => onNavigateToTask(TaskTypes.CUSTOMER_SUPPORT);
|
|
810
|
-
const handleOnNavigateToTaskDecisionMaker = () => onNavigateToTask(TaskTypes.DECISION_MAKER_OVERVIEW);
|
|
811
|
-
const handleOnNavigateToTaskTrust = () => onNavigateToTask(TaskTypes.TRUST);
|
|
812
|
-
const handleOnNavigateToTaskTrustMember = () => onNavigateToTask(TaskTypes.TRUST_MEMBER_OVERVIEW);
|
|
813
|
-
const handleOnNavigateToTaskPayout = (id) => hasPayinTaskNotPayout ? onNavigateToTask(TaskTypes.PAYIN, id) : onNavigateToTask(TaskTypes.PAYOUT, id);
|
|
814
|
-
const handleOnNavigateToPci = () => !canDownloadPci && onNavigateToTask(TaskTypes.PCI_DSS);
|
|
815
|
-
const handleOnNavigateToSoleProp = () => onNavigateToTask(TaskTypes.SOLE_PROPRIETOR_COMPANY);
|
|
816
|
-
const handleOnNavigateToServiceAgreement = () => onNavigateToTask(TaskTypes.SERVICE_AGREEMENT);
|
|
817
|
-
const handleOnNavigateToTaskLegalRepresentative = () => onNavigateToTask(TaskTypes.LEGAL_REPRESENTATIVE_DETAILS);
|
|
818
|
-
const handleOnNavigateToSourceOfFunds = () => onNavigateToTask(TaskTypes.SOURCE_OF_FUNDS);
|
|
819
|
-
const handleOnNavigateToBusinessFinancing = () => onNavigateToTask(TaskTypes.BUSINESS_FINANCING);
|
|
820
|
-
const handleOnNavigateToTaxReporting = () => onNavigateToTask(TaskTypes.TAX_REPORTING);
|
|
821
|
-
const showDecisionMakersWarning = Boolean(
|
|
822
|
-
getOwnDecisionMakersLegalEntityIds(legalEntityResponse).length && remediationMessages.DECISION_MAKER
|
|
823
|
-
);
|
|
824
|
-
useEffect(() => {
|
|
825
|
-
if (showDecisionMakersWarning) {
|
|
826
|
-
userEvents.addTaskEvent("Encountered error", {
|
|
827
|
-
task: TaskTypes.TASKS_OVERVIEW,
|
|
828
|
-
actionType: "alert",
|
|
829
|
-
returnValue: "missingDecisionMaker"
|
|
830
|
-
});
|
|
831
|
-
}
|
|
832
|
-
}, [showDecisionMakersWarning, userEvents]);
|
|
833
|
-
return /* @__PURE__ */ jsxs("div", { className: "adyen-task-list__container", children: [
|
|
834
|
-
canSeeIntroduction && /* @__PURE__ */ jsx("div", { className: "adyen-task-list__nav", children: /* @__PURE__ */ jsx(Button, { variant: "link", onClick: () => onNavigateToTask(TaskTypes.INTRODUCTION), children: t(($) => $["goToIntroduction"]) }) }),
|
|
835
|
-
canChangeEntityType && /* @__PURE__ */ jsxs("header", { className: "adyen-task-list__heading", children: [
|
|
836
|
-
/* @__PURE__ */ jsx(Typography, { el: "h1", variant: "title-l", children: t(($) => $["setUpYourAccount"]) }),
|
|
837
|
-
/* @__PURE__ */ jsxs(Typography, { el: "p", variant: "title", className: "adyen-task-list__description", children: [
|
|
838
|
-
/* @__PURE__ */ jsx(Typography, { el: "span", variant: "body-strongest", children: t(($) => $["yourBusinessSetup"], {
|
|
839
|
-
businessSetup: businessSetup ? t(($) => $[businessSetup]) : t(($) => $["unknown"])
|
|
840
|
-
}) }),
|
|
841
|
-
/* @__PURE__ */ jsx(
|
|
842
|
-
IconButton,
|
|
843
|
-
{
|
|
844
|
-
ariaLabel: t(($) => $["editBusinessSetup"]),
|
|
845
|
-
icon: "edit",
|
|
846
|
-
variant: "tertiary",
|
|
847
|
-
onClick: onEditBusinessSetupClick
|
|
848
|
-
}
|
|
849
|
-
)
|
|
850
|
-
] })
|
|
851
|
-
] }),
|
|
852
|
-
singpassComponent,
|
|
853
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
854
|
-
hasTaskOfGroupAccountDetails && /* @__PURE__ */ jsxs(TaskListGroup, { title: t(($) => $[getBusinessTaskListTitleKey()]), children: [
|
|
855
|
-
tasks.includes(TaskTypes.INDIVIDUAL) && /* @__PURE__ */ jsx(
|
|
856
|
-
TaskListItem,
|
|
857
|
-
{
|
|
858
|
-
onNavigateToTask: handleOnNavigateToTaskIndividual,
|
|
859
|
-
icon: "decision-maker",
|
|
860
|
-
titleKey: hasTrust ? "trusteePersonalDetails" : hasUnincorporatedPartnership ? "primaryPartnerDetails" : "personalDetails",
|
|
861
|
-
status: getTaskStatus2(TaskTypes.INDIVIDUAL),
|
|
862
|
-
problems: capabilityProblems?.LegalEntity?.[legalEntityResponse.id]
|
|
863
|
-
}
|
|
864
|
-
),
|
|
865
|
-
tasks.includes(TaskTypes.BUSINESS_DETAILS) && /* @__PURE__ */ jsx(
|
|
866
|
-
TaskListItem,
|
|
867
|
-
{
|
|
868
|
-
testId: TaskTypes.BUSINESS_DETAILS,
|
|
869
|
-
onNavigateToTask: handleOnNavigateToTaskBusinessDetails,
|
|
870
|
-
icon: "company",
|
|
871
|
-
titleKey: hasTrust ? "businessTrusteeDetails" : hasUnincorporatedPartnership ? "primaryPartnerDetails" : "businessDetails",
|
|
872
|
-
status: businessDetailsTaskStatus,
|
|
873
|
-
problems: capabilityProblems?.LegalEntity?.[legalEntityResponse.id]
|
|
874
|
-
}
|
|
875
|
-
),
|
|
876
|
-
hasSoleProprietorship && /* @__PURE__ */ jsx(
|
|
877
|
-
TaskListItem,
|
|
878
|
-
{
|
|
879
|
-
onNavigateToTask: handleOnNavigateToSoleProp,
|
|
880
|
-
icon: "company",
|
|
881
|
-
titleKey: canChangeEntityType ? "soleProprietorshipDetails" : "soleProprietorDetails",
|
|
882
|
-
status: getTaskStatus2(TaskTypes.SOLE_PROPRIETOR_COMPANY),
|
|
883
|
-
problems: getOwnSolePropProblems(legalEntityResponse, capabilityProblems)
|
|
884
|
-
}
|
|
885
|
-
),
|
|
886
|
-
isLegalRepresentativeRequired && /* @__PURE__ */ jsx(
|
|
887
|
-
TaskListItem,
|
|
888
|
-
{
|
|
889
|
-
onNavigateToTask: handleOnNavigateToTaskLegalRepresentative,
|
|
890
|
-
icon: "decision-maker",
|
|
891
|
-
titleKey: "legalRepresentative",
|
|
892
|
-
status: getTaskStatus2(TaskTypes.LEGAL_REPRESENTATIVE_DETAILS)
|
|
893
|
-
}
|
|
894
|
-
),
|
|
895
|
-
tasks.includes(TaskTypes.DECISION_MAKER_OVERVIEW) && /* @__PURE__ */ jsx(
|
|
896
|
-
TaskListItem,
|
|
897
|
-
{
|
|
898
|
-
onNavigateToTask: handleOnNavigateToTaskDecisionMaker,
|
|
899
|
-
icon: "decision-maker",
|
|
900
|
-
titleKey: hasUnincorporatedPartnership ? "entityDecisionMakers" : "decisionMakers",
|
|
901
|
-
status: getTaskStatus2(TaskTypes.DECISION_MAKER_OVERVIEW),
|
|
902
|
-
warningMessage: showDecisionMakersWarning ? remediationMessages[TaskTypes.DECISION_MAKER] : void 0
|
|
903
|
-
}
|
|
904
|
-
),
|
|
905
|
-
tasks.includes(TaskTypes.BUSINESS_LINES) && /* @__PURE__ */ jsx(
|
|
906
|
-
TaskListItem,
|
|
907
|
-
{
|
|
908
|
-
testId: TaskTypes.BUSINESS_LINES,
|
|
909
|
-
onNavigateToTask: handleOnNavigateToTaskBusinessLines,
|
|
910
|
-
icon: "solutionPayments",
|
|
911
|
-
titleKey: "businessLines",
|
|
912
|
-
status: getTaskStatus2(TaskTypes.BUSINESS_LINES)
|
|
913
|
-
}
|
|
914
|
-
),
|
|
915
|
-
showCustomerSupportV4 && tasks.includes(TaskTypes.CUSTOMER_SUPPORT) && /* @__PURE__ */ jsx(
|
|
916
|
-
TaskListItem,
|
|
917
|
-
{
|
|
918
|
-
onNavigateToTask: handleOnNavigateToTaskCustomerSupport,
|
|
919
|
-
icon: "webinar",
|
|
920
|
-
titleKey: "customerSupport",
|
|
921
|
-
status: normalizedTasks?.CUSTOMER_SUPPORT?.status ?? TaskStatuses.DETAILS_REQUIRED
|
|
922
|
-
}
|
|
923
|
-
)
|
|
924
|
-
] }),
|
|
925
|
-
hasTrust && /* @__PURE__ */ jsxs(TaskListGroup, { title: t(($) => $["trustDetailsDescription"]), children: [
|
|
926
|
-
/* @__PURE__ */ jsx(
|
|
927
|
-
TaskListItem,
|
|
928
|
-
{
|
|
929
|
-
onNavigateToTask: handleOnNavigateToTaskTrust,
|
|
930
|
-
icon: "trust",
|
|
931
|
-
titleKey: "trustDetails",
|
|
932
|
-
status: getTaskStatus2(TaskTypes.TRUST),
|
|
933
|
-
problems: getOwnTrustProblems(legalEntityResponse, capabilityProblems)
|
|
934
|
-
}
|
|
935
|
-
),
|
|
936
|
-
/* @__PURE__ */ jsx(
|
|
937
|
-
TaskListItem,
|
|
938
|
-
{
|
|
939
|
-
onNavigateToTask: handleOnNavigateToTaskTrustMember,
|
|
940
|
-
icon: "decision-maker",
|
|
941
|
-
titleKey: "trustMembers",
|
|
942
|
-
status: getTaskStatus2(TaskTypes.TRUST_MEMBER_OVERVIEW)
|
|
943
|
-
}
|
|
944
|
-
)
|
|
945
|
-
] }),
|
|
946
|
-
hasUnincorporatedPartnership && /* @__PURE__ */ jsxs(TaskListGroup, { title: t(($) => $["partnershipUnincorporated"]), children: [
|
|
947
|
-
/* @__PURE__ */ jsx(
|
|
948
|
-
TaskListItem,
|
|
949
|
-
{
|
|
950
|
-
onNavigateToTask: () => onNavigateToTask(TaskTypes.UNINCORPORATED_PARTNERSHIP),
|
|
951
|
-
icon: "trust",
|
|
952
|
-
titleKey: "unincorporatedDetails",
|
|
953
|
-
status: getTaskStatus2(TaskTypes.UNINCORPORATED_PARTNERSHIP),
|
|
954
|
-
problems: getOwnUnincorporatedPartnershipProblems(
|
|
955
|
-
legalEntityResponse,
|
|
956
|
-
capabilityProblems
|
|
957
|
-
)
|
|
958
|
-
}
|
|
959
|
-
),
|
|
960
|
-
/* @__PURE__ */ jsx(
|
|
961
|
-
TaskListItem,
|
|
962
|
-
{
|
|
963
|
-
onNavigateToTask: () => {
|
|
964
|
-
if (!isPartOfUnincorporatedPartnership(legalEntityResponse)) {
|
|
965
|
-
onNavigateToTask(TaskTypes.UNINCORPORATED_PARTNERSHIP);
|
|
966
|
-
} else {
|
|
967
|
-
onNavigateToTask(TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_OVERVIEW);
|
|
968
|
-
}
|
|
969
|
-
},
|
|
970
|
-
icon: "decision-maker",
|
|
971
|
-
titleKey: "unincorporatedPartnershipMembers",
|
|
972
|
-
status: getTaskStatus2(TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_OVERVIEW)
|
|
973
|
-
}
|
|
974
|
-
)
|
|
975
|
-
] }),
|
|
976
|
-
hasFinancingTasks && /* @__PURE__ */ jsxs(TaskListGroup, { children: [
|
|
977
|
-
tasks.includes(TaskTypes.SOURCE_OF_FUNDS) && /* @__PURE__ */ jsx(
|
|
978
|
-
TaskListItem,
|
|
979
|
-
{
|
|
980
|
-
onNavigateToTask: handleOnNavigateToSourceOfFunds,
|
|
981
|
-
icon: "cash-stack",
|
|
982
|
-
titleKey: "fundingSources",
|
|
983
|
-
status: normalizedTasks?.SOURCE_OF_FUNDS?.status ?? TaskStatuses.DETAILS_REQUIRED
|
|
984
|
-
}
|
|
985
|
-
),
|
|
986
|
-
tasks.includes(TaskTypes.BUSINESS_FINANCING) && /* @__PURE__ */ jsx(
|
|
987
|
-
TaskListItem,
|
|
988
|
-
{
|
|
989
|
-
onNavigateToTask: handleOnNavigateToBusinessFinancing,
|
|
990
|
-
icon: "capital",
|
|
991
|
-
titleKey: "businessFinancing",
|
|
992
|
-
status: normalizedTasks?.BUSINESS_FINANCING?.status ?? TaskStatuses.DETAILS_REQUIRED
|
|
993
|
-
}
|
|
994
|
-
)
|
|
995
|
-
] }),
|
|
996
|
-
tasks.includes(TaskTypes.TAX_REPORTING) && /* @__PURE__ */ jsx(TaskListGroup, { children: /* @__PURE__ */ jsx(
|
|
997
|
-
TaskListItem,
|
|
998
|
-
{
|
|
999
|
-
onNavigateToTask: handleOnNavigateToTaxReporting,
|
|
1000
|
-
icon: "reporting",
|
|
1001
|
-
titleKey: "taxReporting",
|
|
1002
|
-
status: normalizedTasks?.TAX_REPORTING?.status ?? TaskStatuses.DETAILS_REQUIRED
|
|
1003
|
-
}
|
|
1004
|
-
) }),
|
|
1005
|
-
(tasks.includes(TaskTypes.PAYOUT) || tasks.includes(TaskTypes.PAYIN)) && !hidePayoutAccountTaskExperiment && /* @__PURE__ */ jsx(
|
|
1006
|
-
TaskListGroup,
|
|
1007
|
-
{
|
|
1008
|
-
title: canChangeEntityType ? t(($) => $["payoutBankAccounts"]) : t(
|
|
1009
|
-
($) => $[hasPayinTaskNotPayout ? "payinAccountsDescription" : payoutTaskDescriptionKey]
|
|
1010
|
-
),
|
|
1011
|
-
children: transferInstruments.length > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1012
|
-
transferInstruments.map((transferInstrument) => /* @__PURE__ */ jsx(
|
|
1013
|
-
PayoutAccountTaskListItem,
|
|
1014
|
-
{
|
|
1015
|
-
account: transferInstrument,
|
|
1016
|
-
capabilityProblems,
|
|
1017
|
-
onNavigateToTask: () => handleOnNavigateToTaskPayout(transferInstrument.id),
|
|
1018
|
-
payinPayoutTaskStatus
|
|
1019
|
-
},
|
|
1020
|
-
transferInstrument.id
|
|
1021
|
-
)),
|
|
1022
|
-
!transferInstrumentLimit || transferInstruments.length < transferInstrumentLimit ? /* @__PURE__ */ jsxs(
|
|
1023
|
-
Card,
|
|
1024
|
-
{
|
|
1025
|
-
stateful: true,
|
|
1026
|
-
onClick: () => handleOnNavigateToTaskPayout(),
|
|
1027
|
-
className: "adyen-task adyen-kyc-add-payout",
|
|
1028
|
-
disabled: !canAddPayoutAccount,
|
|
1029
|
-
children: [
|
|
1030
|
-
/* @__PURE__ */ jsx(Icon, { name: "plus", className: "adyen-task-list__card-icon " }),
|
|
1031
|
-
/* @__PURE__ */ jsx("span", { children: canChangeEntityType ? t(($) => $["addExtraBankAccount"]) : t(
|
|
1032
|
-
($) => $[hasPayinTaskNotPayout ? "addExtraPayinAccount" : "addExtraPayoutAccount"]
|
|
1033
|
-
) })
|
|
1034
|
-
]
|
|
1035
|
-
}
|
|
1036
|
-
) : null
|
|
1037
|
-
] }) : /* @__PURE__ */ jsx(
|
|
1038
|
-
TaskListItem,
|
|
1039
|
-
{
|
|
1040
|
-
onNavigateToTask: () => handleOnNavigateToTaskPayout(),
|
|
1041
|
-
icon: "payout",
|
|
1042
|
-
titleKey: canChangeEntityType ? "bankAccountDetails" : hasPayinTaskNotPayout ? "payinDetails" : "payoutDetails",
|
|
1043
|
-
status: TaskStatuses.DETAILS_REQUIRED,
|
|
1044
|
-
disabled: !canAddPayoutAccount,
|
|
1045
|
-
problems: getEmptyBankAccountProblems()
|
|
1046
|
-
}
|
|
1047
|
-
)
|
|
1048
|
-
}
|
|
1049
|
-
),
|
|
1050
|
-
showContractTasks && /* @__PURE__ */ jsxs(TaskListGroup, { title: t(($) => $["reviewAndSignLegalDisclosures"]), children: [
|
|
1051
|
-
showPciTask && /* @__PURE__ */ jsx(
|
|
1052
|
-
TaskListItem,
|
|
1053
|
-
{
|
|
1054
|
-
onNavigateToTask: handleOnNavigateToPci,
|
|
1055
|
-
icon: "pci",
|
|
1056
|
-
titleKey: "pciDssQuestionnaire",
|
|
1057
|
-
status: canDownloadPci ? TaskStatuses.DOWNLOAD : TaskStatuses.SIGN,
|
|
1058
|
-
statusLabel: canDownloadPci ? t(($) => $["downloadACopy"]) : void 0,
|
|
1059
|
-
downloadHandler: onPciDownload,
|
|
1060
|
-
disabled: isPciTaskDisabled,
|
|
1061
|
-
info: isPciTaskDisabled && !canDownloadPci ? t(($) => $["requiresDecisionMakers"]) : void 0
|
|
1062
|
-
}
|
|
1063
|
-
),
|
|
1064
|
-
showServiceAgreementTask && /* @__PURE__ */ jsx(
|
|
1065
|
-
TaskListItem,
|
|
1066
|
-
{
|
|
1067
|
-
onNavigateToTask: handleOnNavigateToServiceAgreement,
|
|
1068
|
-
icon: "contract",
|
|
1069
|
-
titleKey: "signServiceAgreement",
|
|
1070
|
-
disabled: areServiceAgreementTasksDisabled,
|
|
1071
|
-
status: serviceAgreementTypes.length ? TaskStatuses.SIGN : TaskStatuses.SIGNED,
|
|
1072
|
-
info: EnableSignPCIBeforeTOS && shouldSignPciFirst ? t(($) => $["signPciFirst"]) : !hasServiceAgreementSigners ? t(($) => $["requiresSignatory"]) : void 0
|
|
1073
|
-
}
|
|
1074
|
-
)
|
|
1075
|
-
] }),
|
|
1076
|
-
isReview && /* @__PURE__ */ jsx(TaskListGroup, { title: t(($) => $["pleaseEnsureTheFollowing"]), children: /* @__PURE__ */ jsx(
|
|
1077
|
-
TaskListItem,
|
|
1078
|
-
{
|
|
1079
|
-
onNavigateToTask: handleOnNavigateToTaskReview,
|
|
1080
|
-
icon: "review",
|
|
1081
|
-
titleKey: "submitReviewOfYourData",
|
|
1082
|
-
status: TaskStatuses.SUBMIT,
|
|
1083
|
-
problems: capabilityProblems?.LegalEntity?.[legalEntityResponse.id],
|
|
1084
|
-
showErrorAlerts: "always"
|
|
1085
|
-
}
|
|
1086
|
-
) })
|
|
1087
|
-
] })
|
|
1088
|
-
] });
|
|
1089
|
-
}
|
|
1090
|
-
const isNewEntity = Symbol("isNewEntity");
|
|
1091
|
-
const businessLines$1 = "adyen-kyc-business-lines";
|
|
1092
|
-
const styles$4 = {
|
|
1093
|
-
businessLines: businessLines$1
|
|
1094
|
-
};
|
|
1095
|
-
const businessLines = lazy(() => import("./business-lines-DboUCbXw.js"));
|
|
1096
|
-
const BusinessLinesGettingStarted = ({
|
|
1097
|
-
handleGettingStartedClick,
|
|
1098
|
-
handleCancelClick
|
|
1099
|
-
}) => {
|
|
1100
|
-
const { t } = useTranslation(["businessLines", "common"]);
|
|
1101
|
-
return /* @__PURE__ */ jsx(
|
|
1102
|
-
LandingLayout,
|
|
1103
|
-
{
|
|
1104
|
-
title: t(($) => $["businessLines"]),
|
|
1105
|
-
description: t(($) => $["businessLinesGettingStarted"]),
|
|
1106
|
-
media: /* @__PURE__ */ jsx(Image, { lazyLoadedImage: businessLines }),
|
|
1107
|
-
actions: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1108
|
-
/* @__PURE__ */ jsx(Button, { fullWidth: true, onClick: handleGettingStartedClick, children: t(($) => $["gettingStarted"], { ns: "common" }) }),
|
|
1109
|
-
/* @__PURE__ */ jsx(Button, { variant: "tertiary", fullWidth: true, onClick: handleCancelClick, children: t(($) => $["finishLater"], { ns: "common" }) })
|
|
1110
|
-
] })
|
|
1111
|
-
}
|
|
1112
|
-
);
|
|
1113
|
-
};
|
|
1114
|
-
function BusinessLinesDropin({ handleHomeClick }) {
|
|
1115
|
-
const [gettingStarted, setGettingStarted] = useState(true);
|
|
1116
|
-
return /* @__PURE__ */ jsx("div", { className: styles$4.businessLines, children: gettingStarted && /* @__PURE__ */ jsx(
|
|
1117
|
-
BusinessLinesGettingStarted,
|
|
1118
|
-
{
|
|
1119
|
-
handleGettingStartedClick: () => setGettingStarted(false),
|
|
1120
|
-
handleCancelClick: () => handleHomeClick?.()
|
|
1121
|
-
}
|
|
1122
|
-
) });
|
|
1123
|
-
}
|
|
1124
|
-
const RootBusinessLinesPage = ({ handleHomeClick }) => {
|
|
1125
|
-
const { data: rootLe } = useLegalEntity(ROOT_LE);
|
|
1126
|
-
const { i18n } = useTranslation();
|
|
1127
|
-
addResourceBundles(i18n, i18n.language, [
|
|
1128
|
-
{ ns: "businessLines", importFn: () => __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "../language/bg-BG.json": () => import("./bg-BG-B0-ZcjR0.js"), "../language/cs-CZ.json": () => import("./cs-CZ-Dk1ePReM.js"), "../language/da-DK.json": () => import("./da-DK-DStNe471.js"), "../language/de-DE.json": () => import("./de-DE-CGoBPCPv.js"), "../language/el-GR.json": () => import("./el-GR-B69zcWyB.js"), "../language/en-US.json": () => import("./en-US-CQ3angjM.js"), "../language/es-ES.json": () => import("./es-ES-CKMfS8Yy.js"), "../language/et-EE.json": () => import("./et-EE-Dw-aPF7J.js"), "../language/fi-FI.json": () => import("./fi-FI-REYOX46I.js"), "../language/fr-FR.json": () => import("./fr-FR-D9qaP6nx.js"), "../language/hr-HR.json": () => import("./hr-HR-CbxEvbrE.js"), "../language/hu-HU.json": () => import("./hu-HU-D0C6UfXB.js"), "../language/it-IT.json": () => import("./it-IT-Biduphjt.js"), "../language/ja-JP.json": () => import("./ja-JP-B2txEVPx.js"), "../language/lt-LT.json": () => import("./lt-LT-C_YMgjp9.js"), "../language/lv-LV.json": () => import("./lv-LV-B3sT3_cw.js"), "../language/nl-NL.json": () => import("./nl-NL-G1wVnmzT.js"), "../language/no-NO.json": () => import("./no-NO-BTtAuqCb.js"), "../language/pl-PL.json": () => import("./pl-PL--qPaNyJD.js"), "../language/pt-PT.json": () => import("./pt-PT-Dk48OVtf.js"), "../language/ro-RO.json": () => import("./ro-RO-BLuOjrS0.js"), "../language/sk-SK.json": () => import("./sk-SK-C1Ky2nl_.js"), "../language/sl-SI.json": () => import("./sl-SI-BB7iVcFI.js"), "../language/sv-SE.json": () => import("./sv-SE-DbI-1JqN.js") }), `../language/${i18n.language}.json`, 3) }
|
|
1129
|
-
]);
|
|
1130
|
-
if (!rootLe) {
|
|
1131
|
-
return /* @__PURE__ */ jsx(Loader, {});
|
|
1132
|
-
}
|
|
1133
|
-
return /* @__PURE__ */ jsx(BusinessLinesDropin, { handleHomeClick });
|
|
1134
|
-
};
|
|
1135
|
-
const useExemptSettlor = ({
|
|
1136
|
-
trust
|
|
1137
|
-
}) => {
|
|
1138
|
-
const matchingAssociation = useMemo(() => {
|
|
1139
|
-
if (!trust) return void 0;
|
|
1140
|
-
return getOwnEntityAssociations(trust).find(
|
|
1141
|
-
(association) => association.type === TrustMemberTypes.SETTLOR && Boolean(association.settlorExemptionReason)
|
|
1142
|
-
);
|
|
1143
|
-
}, [trust]);
|
|
1144
|
-
const { data } = useLegalEntity(matchingAssociation?.legalEntityId ?? skipToken);
|
|
1145
|
-
return data;
|
|
1146
|
-
};
|
|
1147
|
-
const splitAtFirstOccurrence = (str, separator) => {
|
|
1148
|
-
const firstOccurrence = str.indexOf(separator);
|
|
1149
|
-
if (firstOccurrence === -1) return [str];
|
|
1150
|
-
return [str.slice(0, firstOccurrence), str.slice(firstOccurrence + 1)];
|
|
1151
|
-
};
|
|
1152
|
-
const getTrustMemberOwnerId = (trustMemberId, entityAssociations) => entityAssociations.find((association) => association.associatorId === trustMemberId)?.legalEntityId;
|
|
1153
|
-
const getFallbackName = (exemptSettlorAssociation) => {
|
|
1154
|
-
const [firstName, lastName] = splitAtFirstOccurrence(exemptSettlorAssociation.name ?? "", " ");
|
|
1155
|
-
return {
|
|
1156
|
-
firstName,
|
|
1157
|
-
lastName
|
|
1158
|
-
};
|
|
1159
|
-
};
|
|
1160
|
-
const convertEntityAssociationIntoTrustMember = (association, associations, exemptSettlorLE) => {
|
|
1161
|
-
if (association.settlorExemptionReason) {
|
|
1162
|
-
return {
|
|
1163
|
-
trustMemberType: "exemptSettlor",
|
|
1164
|
-
roles: [TrustMemberTypes.SETTLOR],
|
|
1165
|
-
legalEntityType: association.entityType,
|
|
1166
|
-
legalEntityId: association.legalEntityId,
|
|
1167
|
-
settlorExemptionReason: association.settlorExemptionReason,
|
|
1168
|
-
exemptSettlorName: association.entityType === LegalEntityTypes.INDIVIDUAL ? exemptSettlorLE?.individual?.name ?? getFallbackName(association) : void 0,
|
|
1169
|
-
name: association.name
|
|
1170
|
-
};
|
|
1171
|
-
}
|
|
1172
|
-
if (association.entityType === LegalEntityTypes.ORGANIZATION)
|
|
1173
|
-
return {
|
|
1174
|
-
trustMemberType: "company",
|
|
1175
|
-
roles: [],
|
|
1176
|
-
legalEntityType: LegalEntityTypes.ORGANIZATION,
|
|
1177
|
-
legalEntityId: association.legalEntityId,
|
|
1178
|
-
name: association.name,
|
|
1179
|
-
ownerId: getTrustMemberOwnerId(association.legalEntityId, associations)
|
|
1180
|
-
};
|
|
1181
|
-
if (association.entityType === LegalEntityTypes.INDIVIDUAL)
|
|
1182
|
-
return {
|
|
1183
|
-
trustMemberType: "regular",
|
|
1184
|
-
roles: [],
|
|
1185
|
-
legalEntityType: LegalEntityTypes.INDIVIDUAL,
|
|
1186
|
-
legalEntityId: association.legalEntityId,
|
|
1187
|
-
name: association.name
|
|
1188
|
-
};
|
|
1189
|
-
throw new Error(`Not a valid trust member: ${JSON.stringify(association)}`);
|
|
1190
|
-
};
|
|
1191
|
-
const mapEntityAssociationsToTrustMembers = (trustEntityId, entityAssociations, exemptSettlorLE) => {
|
|
1192
|
-
const mappedTrustMembers = entityAssociations.reduce(
|
|
1193
|
-
(acc, entityAssociation) => {
|
|
1194
|
-
if (!Object.values(TrustMemberTypes).includes(entityAssociation.type) || entityAssociation.associatorId !== trustEntityId || !entityAssociation.legalEntityId) {
|
|
1195
|
-
return acc;
|
|
1196
|
-
}
|
|
1197
|
-
const trustMember = acc[entityAssociation.legalEntityId] ?? convertEntityAssociationIntoTrustMember(
|
|
1198
|
-
entityAssociation,
|
|
1199
|
-
entityAssociations,
|
|
1200
|
-
exemptSettlorLE
|
|
1201
|
-
);
|
|
1202
|
-
const trustMemberType = entityAssociation.type;
|
|
1203
|
-
acc[entityAssociation.legalEntityId] = {
|
|
1204
|
-
...trustMember,
|
|
1205
|
-
roles: [.../* @__PURE__ */ new Set([...trustMember.roles, trustMemberType])]
|
|
1206
|
-
};
|
|
1207
|
-
return acc;
|
|
1208
|
-
},
|
|
1209
|
-
{}
|
|
1210
|
-
);
|
|
1211
|
-
return Object.values(mappedTrustMembers);
|
|
1212
|
-
};
|
|
1213
|
-
const mapRootLegalEntityToTrustMember = (rootLegalEntity) => ({
|
|
1214
|
-
trustMemberType: "rootTrustee",
|
|
1215
|
-
roles: [TrustMemberTypes.TRUSTEE],
|
|
1216
|
-
legalEntityType: rootLegalEntity.type,
|
|
1217
|
-
legalEntityId: rootLegalEntity.id,
|
|
1218
|
-
name: getLegalEntityNameBasedOnType(rootLegalEntity)
|
|
1219
|
-
});
|
|
1220
|
-
const mapUndefinedBeneficiaryInfoToTrustMembers = (undefinedBeneficiaryInfo) => undefinedBeneficiaryInfo.map(({ reference, description }) => ({
|
|
1221
|
-
trustMemberType: "undefinedBeneficiary",
|
|
1222
|
-
roles: [TrustMemberTypes.UNDEFINED_BENEFICIARY],
|
|
1223
|
-
reference,
|
|
1224
|
-
description
|
|
1225
|
-
}));
|
|
1226
|
-
const getTrustMembers = (trustLE, rootLegalEntity, exemptSettlorLE) => [
|
|
1227
|
-
mapRootLegalEntityToTrustMember(rootLegalEntity),
|
|
1228
|
-
...mapEntityAssociationsToTrustMembers(
|
|
1229
|
-
trustLE.id,
|
|
1230
|
-
trustLE.entityAssociations ?? [],
|
|
1231
|
-
exemptSettlorLE
|
|
1232
|
-
),
|
|
1233
|
-
...mapUndefinedBeneficiaryInfoToTrustMembers(trustLE.trust?.undefinedBeneficiaryInfo ?? [])
|
|
1234
|
-
];
|
|
1235
|
-
const combineRootLegalEntityWithEntityAssociations = (rootLegalEntity, entityAssociations) => {
|
|
1236
|
-
const allowedRolesForRootLegalEntity = [
|
|
1237
|
-
TrustMemberTypes.SETTLOR,
|
|
1238
|
-
TrustMemberTypes.PROTECTOR,
|
|
1239
|
-
TrustMemberTypes.DEFINED_BENEFICIARY
|
|
1240
|
-
];
|
|
1241
|
-
const roles = entityAssociations.map((entityAssociation) => entityAssociation.type).filter((role) => allowedRolesForRootLegalEntity.includes(role));
|
|
1242
|
-
return {
|
|
1243
|
-
trustMemberType: "rootTrustee",
|
|
1244
|
-
roles: [...roles, TrustMemberTypes.TRUSTEE],
|
|
1245
|
-
legalEntityType: rootLegalEntity.type,
|
|
1246
|
-
legalEntityId: rootLegalEntity.id,
|
|
1247
|
-
name: getLegalEntityNameBasedOnType(rootLegalEntity)
|
|
1248
|
-
};
|
|
1249
|
-
};
|
|
1250
|
-
const getRootTrusteeTrustMembers = (trustLE, rootLegalEntity, exemptSettlorLE) => {
|
|
1251
|
-
const entityAssociations = trustLE.entityAssociations ?? [];
|
|
1252
|
-
const rootLegalEntityAssociations = entityAssociations.filter(
|
|
1253
|
-
(a) => a.legalEntityId === rootLegalEntity.id
|
|
1254
|
-
);
|
|
1255
|
-
const nonRootLegalEntityAssociations = entityAssociations.filter(
|
|
1256
|
-
(a) => a.legalEntityId !== rootLegalEntity.id
|
|
1257
|
-
);
|
|
1258
|
-
return [
|
|
1259
|
-
combineRootLegalEntityWithEntityAssociations(rootLegalEntity, rootLegalEntityAssociations),
|
|
1260
|
-
...mapEntityAssociationsToTrustMembers(
|
|
1261
|
-
trustLE.id,
|
|
1262
|
-
nonRootLegalEntityAssociations ?? [],
|
|
1263
|
-
exemptSettlorLE
|
|
1264
|
-
),
|
|
1265
|
-
...mapUndefinedBeneficiaryInfoToTrustMembers(trustLE.trust?.undefinedBeneficiaryInfo ?? [])
|
|
1266
|
-
];
|
|
1267
|
-
};
|
|
1268
|
-
function useTrustMembers() {
|
|
1269
|
-
const { data: rootLegalEntity } = useLegalEntity(ROOT_LE);
|
|
1270
|
-
const { data: trust } = useAssociatedLegalEntity(rootLegalEntity, LegalEntityTypes.TRUST);
|
|
1271
|
-
const { isExperimentEnabled } = useExperimentsContext();
|
|
1272
|
-
const exemptSettlor = useExemptSettlor({
|
|
1273
|
-
trust
|
|
1274
|
-
});
|
|
1275
|
-
const allowMoreRolesForMainRootTrustee = isExperimentEnabled("AllowMoreRolesForMainRootTrustee");
|
|
1276
|
-
return useMemo(() => {
|
|
1277
|
-
if (!rootLegalEntity || !trust?.trust) return [];
|
|
1278
|
-
return allowMoreRolesForMainRootTrustee ? getRootTrusteeTrustMembers(trust, rootLegalEntity, exemptSettlor) : getTrustMembers(trust, rootLegalEntity, exemptSettlor);
|
|
1279
|
-
}, [rootLegalEntity, trust, exemptSettlor, allowMoreRolesForMainRootTrustee]);
|
|
1280
|
-
}
|
|
1281
|
-
const useTrustMemberNavigation = ({ navigateTo, trust }) => {
|
|
1282
|
-
const { i18n } = useI18nContext();
|
|
1283
|
-
const { showToast } = useToastContext();
|
|
1284
|
-
const [trustMember, setTrustMember] = useState();
|
|
1285
|
-
const { setTrustMembers } = useGlobalStore();
|
|
1286
|
-
const trustMembers = useTrustMembers();
|
|
1287
|
-
const memberId = trustMember?.trustMemberType === "undefinedBeneficiary" ? trustMember.reference : trustMember?.legalEntityId;
|
|
1288
|
-
useEffect(() => setTrustMembers(trustMembers), [trustMembers]);
|
|
1289
|
-
const onNavigateToTrustMemberEditDetails = async (tm) => {
|
|
1290
|
-
try {
|
|
1291
|
-
if (tm.legalEntityId === isNewEntity) {
|
|
1292
|
-
setTrustMember(tm);
|
|
1293
|
-
}
|
|
1294
|
-
navigateTo(
|
|
1295
|
-
tm.trustMemberType === "company" ? TaskTypes.TRUST_MEMBER_COMPANY : TaskTypes.TRUST_MEMBER_INDIVIDUAL
|
|
1296
|
-
);
|
|
1297
|
-
} catch {
|
|
1298
|
-
showToast({ label: i18n.get("failedToFetchTrustMemberDetails"), variant: "error" });
|
|
1299
|
-
}
|
|
1300
|
-
};
|
|
1301
|
-
const onNavigateToTrustMemberRoleAndType = (tm) => {
|
|
1302
|
-
setTrustMember(tm === "new" ? void 0 : tm);
|
|
1303
|
-
navigateTo(TaskTypes.TRUST_MEMBER_ROLE_AND_TYPE);
|
|
1304
|
-
};
|
|
1305
|
-
const onNavigateToTrust = async (task = TaskTypes.TRUST) => {
|
|
1306
|
-
try {
|
|
1307
|
-
if (trust) {
|
|
1308
|
-
navigateTo(task);
|
|
1309
|
-
} else {
|
|
1310
|
-
navigateTo(TaskTypes.TRUST);
|
|
1311
|
-
}
|
|
1312
|
-
} catch {
|
|
1313
|
-
showToast({ label: i18n.get("failedToFetchTrustDetails"), variant: "error" });
|
|
1314
|
-
}
|
|
1315
|
-
};
|
|
1316
|
-
return {
|
|
1317
|
-
trustMember,
|
|
1318
|
-
trustMemberId: memberId === isNewEntity ? void 0 : memberId,
|
|
1319
|
-
// Do not pass Symbol('isNewEntity') as trustMemberId
|
|
1320
|
-
trustMembers,
|
|
1321
|
-
onNavigateToTrust,
|
|
1322
|
-
onNavigateToTrustMemberRoleAndType,
|
|
1323
|
-
onNavigateToTrustMemberEditDetails
|
|
1324
|
-
};
|
|
1325
|
-
};
|
|
1326
|
-
const DropinLayout = ({ content, footer }) => /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-dropin", children: [
|
|
1327
|
-
/* @__PURE__ */ jsx("div", { className: "adyen-kyc-dropin__content", children: /* @__PURE__ */ jsx("div", { className: "adyen-kyc-dropin__content-main", children: content }) }),
|
|
1328
|
-
footer && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-dropin__footer-container", children: footer })
|
|
1329
|
-
] });
|
|
1330
|
-
const defaultFieldMetadata = {
|
|
1331
|
-
label: "legalCompanyName",
|
|
1332
|
-
helperText: "legalCompanyName__helperText",
|
|
1333
|
-
validators: validateNotEmptyOnBlur
|
|
1334
|
-
};
|
|
1335
|
-
const defaultFieldConfig = {
|
|
1336
|
-
[CountryCodes.Australia]: {
|
|
1337
|
-
label: "legalCompanyName",
|
|
1338
|
-
helperText: "legalCompanyName__helperText__AU",
|
|
1339
|
-
validators: validateNotEmptyOnBlur
|
|
1340
|
-
},
|
|
1341
|
-
[CountryCodes.HongKong]: {
|
|
1342
|
-
label: "legalCompanyName",
|
|
1343
|
-
helperText: "legalCompanyName__helperText__HK",
|
|
1344
|
-
validators: validateNotEmptyOnBlur
|
|
1345
|
-
},
|
|
1346
|
-
[CountryCodes.Netherlands]: {
|
|
1347
|
-
label: "legalCompanyName",
|
|
1348
|
-
helperText: "legalCompanyName__helperText__NL",
|
|
1349
|
-
validators: validateNotEmptyOnBlur
|
|
1350
|
-
},
|
|
1351
|
-
[CountryCodes.Singapore]: {
|
|
1352
|
-
label: "legalCompanyName",
|
|
1353
|
-
helperText: "legalCompanyName__helperText__SG",
|
|
1354
|
-
validators: validateNotEmptyOnBlur
|
|
1355
|
-
},
|
|
1356
|
-
[CountryCodes.UnitedStates]: ({ isBusiness }) => ({
|
|
1357
|
-
label: "legalCompanyName__US",
|
|
1358
|
-
helperText: isBusiness ? "legalCompanyName__helperText__US__business" : "legalCompanyName__helperText__US",
|
|
1359
|
-
validators: validateNotEmptyOnBlur
|
|
1360
|
-
})
|
|
1361
|
-
};
|
|
1362
|
-
const defaultFieldMetadataV4 = {
|
|
1363
|
-
label: "legalCompanyName",
|
|
1364
|
-
helperText: "legalCompanyName__helperText",
|
|
1365
|
-
validators: validateLegalCompanyName
|
|
1366
|
-
};
|
|
1367
|
-
const defaultFieldConfigV4 = {
|
|
1368
|
-
[CountryCodes.Australia]: {
|
|
1369
|
-
label: "legalCompanyName",
|
|
1370
|
-
helperText: "legalCompanyName__helperText__AU",
|
|
1371
|
-
validators: validateLegalCompanyName
|
|
1372
|
-
},
|
|
1373
|
-
[CountryCodes.HongKong]: {
|
|
1374
|
-
label: "legalCompanyName",
|
|
1375
|
-
helperText: "legalCompanyName__helperText__HK",
|
|
1376
|
-
validators: validateLegalCompanyName
|
|
1377
|
-
},
|
|
1378
|
-
[CountryCodes.Netherlands]: {
|
|
1379
|
-
label: "legalCompanyName",
|
|
1380
|
-
helperText: "legalCompanyName__helperText__NL",
|
|
1381
|
-
validators: validateLegalCompanyName
|
|
1382
|
-
},
|
|
1383
|
-
[CountryCodes.Singapore]: {
|
|
1384
|
-
label: "legalCompanyName",
|
|
1385
|
-
helperText: "legalCompanyName__helperText__SG",
|
|
1386
|
-
validators: validateLegalCompanyName
|
|
1387
|
-
},
|
|
1388
|
-
[CountryCodes.UnitedStates]: ({ isBusiness }) => ({
|
|
1389
|
-
label: "legalCompanyName__US",
|
|
1390
|
-
helperText: isBusiness ? "legalCompanyName__helperText__US__business" : "legalCompanyName__helperText__US",
|
|
1391
|
-
validators: validateLegalCompanyName
|
|
1392
|
-
}),
|
|
1393
|
-
[CountryCodes.Japan]: {
|
|
1394
|
-
label: "legalCompanyName__JP",
|
|
1395
|
-
helperText: void 0,
|
|
1396
|
-
validators: [...validateLegalCompanyName, validateLatinSpaceMarkPunctuationOnlyOnBlur]
|
|
1397
|
-
}
|
|
1398
|
-
};
|
|
1399
|
-
const LEGAL_COMPANY_NAME_FIELD = [
|
|
1400
|
-
"legalCompanyName"
|
|
1401
|
-
];
|
|
1402
|
-
function LegalCompanyNameField({
|
|
1403
|
-
data,
|
|
1404
|
-
valid,
|
|
1405
|
-
errors,
|
|
1406
|
-
labels,
|
|
1407
|
-
helperText,
|
|
1408
|
-
readonly,
|
|
1409
|
-
handleChangeFor
|
|
1410
|
-
}) {
|
|
1411
|
-
const handleKeyDown = (e) => {
|
|
1412
|
-
if (e.key === KEYBOARD_KEYS.enter) {
|
|
1413
|
-
e.preventDefault();
|
|
1414
|
-
}
|
|
1415
|
-
};
|
|
1416
|
-
return /* @__PURE__ */ jsx(
|
|
1417
|
-
Field,
|
|
1418
|
-
{
|
|
1419
|
-
name: "legalCompanyName",
|
|
1420
|
-
label: labels.legalCompanyName,
|
|
1421
|
-
helper: helperText?.legalCompanyName,
|
|
1422
|
-
errorMessage: errors.legalCompanyName,
|
|
1423
|
-
isValid: valid.legalCompanyName,
|
|
1424
|
-
children: (childProps) => /* @__PURE__ */ jsx(
|
|
1425
|
-
InputText,
|
|
1426
|
-
{
|
|
1427
|
-
...childProps,
|
|
1428
|
-
"aria-required": true,
|
|
1429
|
-
"aria-invalid": !valid.legalCompanyName,
|
|
1430
|
-
name: "legalCompanyName",
|
|
1431
|
-
value: data.legalCompanyName,
|
|
1432
|
-
readonly,
|
|
1433
|
-
onInput: handleChangeFor("legalCompanyName", "input"),
|
|
1434
|
-
onBlur: handleChangeFor("legalCompanyName", "blur"),
|
|
1435
|
-
onKeyDown: handleKeyDown
|
|
1436
|
-
}
|
|
1437
|
-
)
|
|
1438
|
-
}
|
|
1439
|
-
);
|
|
1440
|
-
}
|
|
1441
|
-
const convertExistingSettlorExemptionReasons = (existingReasons) => {
|
|
1442
|
-
if (!existingReasons || !existingReasons.length) return ["noneOfTheAbove"];
|
|
1443
|
-
return existingReasons;
|
|
1444
|
-
};
|
|
1445
|
-
const convertExistingTrustMember = (trustMember) => {
|
|
1446
|
-
switch (trustMember.trustMemberType) {
|
|
1447
|
-
case "undefinedBeneficiary":
|
|
1448
|
-
return {
|
|
1449
|
-
entityType: LegalEntityTypes.INDIVIDUAL,
|
|
1450
|
-
role: ["undefinedBeneficiary"],
|
|
1451
|
-
descriptionUndefinedBeneficiary: trustMember.description
|
|
1452
|
-
};
|
|
1453
|
-
case "regular":
|
|
1454
|
-
case "company":
|
|
1455
|
-
return {
|
|
1456
|
-
entityType: trustMember.legalEntityType,
|
|
1457
|
-
role: trustMember.roles,
|
|
1458
|
-
settlorExemptionReason: ["noneOfTheAbove"],
|
|
1459
|
-
country: trustMember.trustMemberType === "company" ? trustMember.country : void 0,
|
|
1460
|
-
legalCompanyName: trustMember.trustMemberType === "company" ? trustMember.name : void 0
|
|
1461
|
-
};
|
|
1462
|
-
case "rootTrustee":
|
|
1463
|
-
return {
|
|
1464
|
-
trustMemberType: trustMember.trustMemberType,
|
|
1465
|
-
entityType: trustMember.legalEntityType,
|
|
1466
|
-
role: trustMember.roles,
|
|
1467
|
-
settlorExemptionReason: ["noneOfTheAbove"]
|
|
1468
|
-
};
|
|
1469
|
-
case "exemptSettlor":
|
|
1470
|
-
return {
|
|
1471
|
-
entityType: trustMember.legalEntityType,
|
|
1472
|
-
role: ["settlor"],
|
|
1473
|
-
settlorExemptionReason: convertExistingSettlorExemptionReasons(
|
|
1474
|
-
trustMember.settlorExemptionReason
|
|
1475
|
-
),
|
|
1476
|
-
firstName: trustMember.exemptSettlorName?.firstName,
|
|
1477
|
-
lastName: trustMember.exemptSettlorName?.lastName,
|
|
1478
|
-
legalCompanyName: trustMember.name,
|
|
1479
|
-
country: trustMember.country
|
|
1480
|
-
};
|
|
1481
|
-
}
|
|
1482
|
-
};
|
|
1483
|
-
const convertRootTrusteeTrustMember = (trustMember) => ({
|
|
1484
|
-
trustMemberType: trustMember.trustMemberType,
|
|
1485
|
-
entityType: trustMember.legalEntityType,
|
|
1486
|
-
role: trustMember.roles,
|
|
1487
|
-
settlorExemptionReason: ["noneOfTheAbove"]
|
|
1488
|
-
});
|
|
1489
|
-
const allowedCrossoverRolesMatrix = {
|
|
1490
|
-
settlor: ["secondaryTrustee", "protector"],
|
|
1491
|
-
secondaryTrustee: ["settlor", "protector", "definedBeneficiary"],
|
|
1492
|
-
protector: ["settlor", "secondaryTrustee", "definedBeneficiary"],
|
|
1493
|
-
definedBeneficiary: ["secondaryTrustee", "protector"],
|
|
1494
|
-
undefinedBeneficiary: []
|
|
1495
|
-
};
|
|
1496
|
-
const allowedCrossoverRolesMatrixByTrustMemberAndLegalEntityType = {
|
|
1497
|
-
rootTrustee: {
|
|
1498
|
-
[LegalEntityTypes.INDIVIDUAL]: {
|
|
1499
|
-
settlor: ["secondaryTrustee", "protector"],
|
|
1500
|
-
secondaryTrustee: ["settlor", "protector", "definedBeneficiary"],
|
|
1501
|
-
protector: ["settlor", "secondaryTrustee", "definedBeneficiary"],
|
|
1502
|
-
definedBeneficiary: ["secondaryTrustee", "protector"],
|
|
1503
|
-
undefinedBeneficiary: []
|
|
1504
|
-
},
|
|
1505
|
-
[LegalEntityTypes.ORGANIZATION]: {
|
|
1506
|
-
settlor: ["secondaryTrustee", "protector"],
|
|
1507
|
-
secondaryTrustee: ["settlor", "protector"],
|
|
1508
|
-
protector: ["settlor", "secondaryTrustee"],
|
|
1509
|
-
definedBeneficiary: [],
|
|
1510
|
-
undefinedBeneficiary: []
|
|
1511
|
-
}
|
|
1512
|
-
}
|
|
1513
|
-
};
|
|
1514
|
-
const getAllowedCrossoverRolesMatrixByTrustMemberAndLegalEntityType = (trustMember) => {
|
|
1515
|
-
const { trustMemberType } = trustMember;
|
|
1516
|
-
if (trustMemberType === "undefinedBeneficiary") {
|
|
1517
|
-
return allowedCrossoverRolesMatrix;
|
|
1518
|
-
}
|
|
1519
|
-
const crossoverRolesByTrustMember = allowedCrossoverRolesMatrixByTrustMemberAndLegalEntityType[trustMemberType];
|
|
1520
|
-
if (!crossoverRolesByTrustMember) {
|
|
1521
|
-
return allowedCrossoverRolesMatrix;
|
|
1522
|
-
}
|
|
1523
|
-
const crossoverRoles = crossoverRolesByTrustMember[trustMember.legalEntityType];
|
|
1524
|
-
if (!crossoverRoles) {
|
|
1525
|
-
return allowedCrossoverRolesMatrix;
|
|
1526
|
-
}
|
|
1527
|
-
return crossoverRoles;
|
|
1528
|
-
};
|
|
1529
|
-
const availablesRolesByTrustMemberTypeAndLegalEntityType = {
|
|
1530
|
-
rootTrustee: {
|
|
1531
|
-
[LegalEntityTypes.INDIVIDUAL]: ["settlor", "protector", "definedBeneficiary"],
|
|
1532
|
-
[LegalEntityTypes.ORGANIZATION]: ["settlor", "protector"]
|
|
1533
|
-
}
|
|
1534
|
-
};
|
|
1535
|
-
const getAvailableRolesByTrustMemberTypeAndLegalEntityType = (currentRoles, trustMember) => {
|
|
1536
|
-
if (!currentRoles?.length) {
|
|
1537
|
-
const { trustMemberType, legalEntityType } = trustMember;
|
|
1538
|
-
const availableRolesByTrustMemberType = availablesRolesByTrustMemberTypeAndLegalEntityType[trustMemberType];
|
|
1539
|
-
if (!availableRolesByTrustMemberType) {
|
|
1540
|
-
return Object.values(TrustMemberTypes);
|
|
1541
|
-
}
|
|
1542
|
-
const availableRoles = availableRolesByTrustMemberType[legalEntityType];
|
|
1543
|
-
if (!availableRoles) {
|
|
1544
|
-
return Object.values(TrustMemberTypes);
|
|
1545
|
-
}
|
|
1546
|
-
return availableRoles;
|
|
1547
|
-
}
|
|
1548
|
-
const crossoverRolesMatrix = trustMember ? getAllowedCrossoverRolesMatrixByTrustMemberAndLegalEntityType(trustMember) : allowedCrossoverRolesMatrix;
|
|
1549
|
-
const roles = currentRoles.map((role) => [role, ...crossoverRolesMatrix[role]]).reduce(
|
|
1550
|
-
(existingAllowed, allowedForRole) => existingAllowed.filter((role) => allowedForRole.includes(role))
|
|
1551
|
-
);
|
|
1552
|
-
return roles.filter((r) => r !== "secondaryTrustee");
|
|
1553
|
-
};
|
|
1554
|
-
const getAvailableRoles = (currentRoles) => {
|
|
1555
|
-
if (!currentRoles?.length) return Object.values(TrustMemberTypes);
|
|
1556
|
-
return currentRoles.map((role) => [role, ...allowedCrossoverRolesMatrix[role]]).reduce(
|
|
1557
|
-
(existingAllowed, allowedForRole) => existingAllowed.filter((role) => allowedForRole.includes(role))
|
|
1558
|
-
);
|
|
1559
|
-
};
|
|
1560
|
-
const trustMemberLegalEntityTypes = [
|
|
1561
|
-
LegalEntityTypes.INDIVIDUAL,
|
|
1562
|
-
LegalEntityTypes.ORGANIZATION
|
|
1563
|
-
];
|
|
1564
|
-
const countriesWhereSettlorExemptionReasonNotApplicable = [CountryCodes.NewZealand];
|
|
1565
|
-
const settlorExemptionReasons = [
|
|
1566
|
-
"contributionBelowThreshold",
|
|
1567
|
-
"professionalServiceProvider",
|
|
1568
|
-
"deceased"
|
|
1569
|
-
];
|
|
1570
|
-
const settlorExemptionReasonWithNoneOfTheAbove = [
|
|
1571
|
-
...settlorExemptionReasons,
|
|
1572
|
-
"noneOfTheAbove"
|
|
1573
|
-
];
|
|
1574
|
-
const couldBeExemptSettlor = (data, country) => data.entityType === LegalEntityTypes.INDIVIDUAL && data.role !== void 0 && data.role.includes("settlor") && !data.role.some((role) => role !== "settlor") && (!country || !countriesWhereSettlorExemptionReasonNotApplicable.includes(country));
|
|
1575
|
-
const isExemptSettlor = (data) => data.settlorExemptionReason?.some((reason) => reason !== "noneOfTheAbove") ?? false;
|
|
1576
|
-
const isOrganizationAndSettlor = (data) => data.entityType === LegalEntityTypes.ORGANIZATION && data.role?.length === 1 && data.role[0] === "settlor";
|
|
1577
|
-
const roleAndTypeValidationRules = {
|
|
1578
|
-
entityType: {
|
|
1579
|
-
modes: ["blur"],
|
|
1580
|
-
validate: (entityType) => !isEmpty(entityType),
|
|
1581
|
-
errorMessage: "fieldIsRequired"
|
|
1582
|
-
},
|
|
1583
|
-
role: {
|
|
1584
|
-
modes: ["blur"],
|
|
1585
|
-
validate: (role) => !!role?.length,
|
|
1586
|
-
errorMessage: "fieldIsRequired"
|
|
1587
|
-
},
|
|
1588
|
-
descriptionUndefinedBeneficiary: {
|
|
1589
|
-
modes: ["blur"],
|
|
1590
|
-
validate: (description) => !isEmpty(description),
|
|
1591
|
-
errorMessage: "fieldIsRequired"
|
|
1592
|
-
},
|
|
1593
|
-
settlorExemptionReason: {
|
|
1594
|
-
modes: ["blur"],
|
|
1595
|
-
validate: (reasons) => Boolean(reasons?.length),
|
|
1596
|
-
errorMessage: "fieldIsRequired"
|
|
1597
|
-
},
|
|
1598
|
-
country: {
|
|
1599
|
-
modes: ["blur"],
|
|
1600
|
-
validate: (country) => !!country,
|
|
1601
|
-
errorMessage: "fieldIsRequired"
|
|
1602
|
-
},
|
|
1603
|
-
legalCompanyName: {
|
|
1604
|
-
modes: ["blur"],
|
|
1605
|
-
validate: (name) => !!name,
|
|
1606
|
-
errorMessage: "fieldIsRequired"
|
|
1607
|
-
}
|
|
1608
|
-
};
|
|
1609
|
-
const CHARACTERS_LIMIT = 256;
|
|
1610
|
-
const leTypeCardDetails$1 = {
|
|
1611
|
-
[LegalEntityTypes.INDIVIDUAL]: {
|
|
1612
|
-
id: "individual",
|
|
1613
|
-
name: "naturalPersonTitle",
|
|
1614
|
-
description: "naturalPersonDescription"
|
|
1615
|
-
},
|
|
1616
|
-
[LegalEntityTypes.ORGANIZATION]: {
|
|
1617
|
-
id: "organization",
|
|
1618
|
-
name: "businessEntityTitle",
|
|
1619
|
-
description: "businessEntityDescription"
|
|
1620
|
-
}
|
|
1621
|
-
};
|
|
1622
|
-
const convertExistingTrustMemberToDefaultData = (trustMember, allowMoreRolesForMainRootTrusteeEnabled) => {
|
|
1623
|
-
if (!trustMember) {
|
|
1624
|
-
return {};
|
|
1625
|
-
}
|
|
1626
|
-
if (allowMoreRolesForMainRootTrusteeEnabled && trustMember.trustMemberType === "rootTrustee") {
|
|
1627
|
-
return convertRootTrusteeTrustMember(trustMember);
|
|
1628
|
-
}
|
|
1629
|
-
return convertExistingTrustMember(trustMember);
|
|
1630
|
-
};
|
|
1631
|
-
const TrustRoleAndEntityType = (props) => {
|
|
1632
|
-
const { t } = useTranslation("common");
|
|
1633
|
-
const { i18n } = useI18nContext();
|
|
1634
|
-
const {
|
|
1635
|
-
existingTrustMember,
|
|
1636
|
-
isOrganizationSettlorWithExemptionEnabled,
|
|
1637
|
-
onChange,
|
|
1638
|
-
id,
|
|
1639
|
-
country,
|
|
1640
|
-
fieldValidationErrors,
|
|
1641
|
-
formVerificationErrors
|
|
1642
|
-
} = props;
|
|
1643
|
-
const trustRoleAndEntityTypeCountry = country;
|
|
1644
|
-
let mergedProps = props;
|
|
1645
|
-
mergedProps = mergeFieldMetadataIntoProps(
|
|
1646
|
-
"legalCompanyName",
|
|
1647
|
-
resolveFieldMetadata(
|
|
1648
|
-
defaultFieldConfig[trustRoleAndEntityTypeCountry],
|
|
1649
|
-
{ isBusiness: false },
|
|
1650
|
-
defaultFieldMetadata
|
|
1651
|
-
),
|
|
1652
|
-
mergedProps
|
|
1653
|
-
);
|
|
1654
|
-
const { isExperimentEnabled } = useExperimentsContext();
|
|
1655
|
-
const allowMoreRolesForMainRootTrusteeEnabled = isExperimentEnabled(
|
|
1656
|
-
"AllowMoreRolesForMainRootTrustee"
|
|
1657
|
-
);
|
|
1658
|
-
const defaultData = convertExistingTrustMemberToDefaultData(
|
|
1659
|
-
existingTrustMember,
|
|
1660
|
-
allowMoreRolesForMainRootTrusteeEnabled
|
|
1661
|
-
);
|
|
1662
|
-
const formUtils = createFormUtils(mergedProps, t);
|
|
1663
|
-
const decideFields = (data2) => {
|
|
1664
|
-
if (data2.role?.includes("undefinedBeneficiary")) {
|
|
1665
|
-
return ["role", "descriptionUndefinedBeneficiary"];
|
|
1666
|
-
}
|
|
1667
|
-
if (data2.role?.length) {
|
|
1668
|
-
if (isOrganizationSettlorWithExemptionEnabled && isOrganizationAndSettlor(data2)) {
|
|
1669
|
-
return ["role", "entityType", "settlorExemptionReason", "country", "legalCompanyName"];
|
|
1670
|
-
}
|
|
1671
|
-
if (couldBeExemptSettlor(data2, country)) {
|
|
1672
|
-
return isExemptSettlor(data2) ? ["role", "entityType", "settlorExemptionReason", "firstName", "lastName"] : ["role", "entityType", "settlorExemptionReason"];
|
|
1673
|
-
}
|
|
1674
|
-
return allowMoreRolesForMainRootTrusteeEnabled ? ["role", "entityType", "trustMemberType"] : ["role", "entityType"];
|
|
1675
|
-
}
|
|
1676
|
-
return ["role"];
|
|
1677
|
-
};
|
|
1678
|
-
const { data, valid, schema, errors, fieldProblems, handleChangeFor, isValid } = useForm({
|
|
1679
|
-
...props,
|
|
1680
|
-
schema: decideFields,
|
|
1681
|
-
rules: roleAndTypeValidationRules,
|
|
1682
|
-
defaultData,
|
|
1683
|
-
fieldProblems: fieldValidationErrors
|
|
1684
|
-
});
|
|
1685
|
-
const availableRoles = allowMoreRolesForMainRootTrusteeEnabled && existingTrustMember?.trustMemberType === "rootTrustee" ? getAvailableRolesByTrustMemberTypeAndLegalEntityType(data.role, existingTrustMember) : getAvailableRoles(data.role);
|
|
1686
|
-
const { data: exemptSettlorLe } = useLegalEntity(
|
|
1687
|
-
isOrganizationSettlorWithExemptionEnabled && existingTrustMember && existingTrustMember.trustMemberType === "exemptSettlor" && existingTrustMember.legalEntityId !== isNewEntity && existingTrustMember.roles !== void 0 && existingTrustMember.roles.length === 1 && existingTrustMember.roles[0] === "settlor" ? existingTrustMember.legalEntityId : skipToken
|
|
1688
|
-
);
|
|
1689
|
-
useEffect(() => {
|
|
1690
|
-
if (exemptSettlorLe && exemptSettlorLe.organization) {
|
|
1691
|
-
handleChangeFor("country")(exemptSettlorLe.organization.registeredAddress.country);
|
|
1692
|
-
}
|
|
1693
|
-
}, [exemptSettlorLe]);
|
|
1694
|
-
useEffect(() => {
|
|
1695
|
-
onChange?.({
|
|
1696
|
-
schema,
|
|
1697
|
-
data,
|
|
1698
|
-
errors,
|
|
1699
|
-
valid,
|
|
1700
|
-
isValid,
|
|
1701
|
-
dataStoreId: id,
|
|
1702
|
-
fieldProblems
|
|
1703
|
-
});
|
|
1704
|
-
}, [schema, data, isValid, i18n, errors, valid, id, fieldProblems]);
|
|
1705
|
-
const onInputDescription = (e) => {
|
|
1706
|
-
const { value } = e.target;
|
|
1707
|
-
handleChangeFor("descriptionUndefinedBeneficiary")(value);
|
|
1708
|
-
};
|
|
1709
|
-
const changeRoles = (roles) => {
|
|
1710
|
-
handleChangeFor("role")(roles);
|
|
1711
|
-
if (roles.includes("undefinedBeneficiary")) {
|
|
1712
|
-
handleChangeFor("entityType")(void 0);
|
|
1713
|
-
} else {
|
|
1714
|
-
handleChangeFor("descriptionUndefinedBeneficiary")(void 0);
|
|
1715
|
-
}
|
|
1716
|
-
};
|
|
1717
|
-
const changeSettlorExemptionReasons = (exemptionReasons) => {
|
|
1718
|
-
if (exemptionReasons.includes("noneOfTheAbove")) {
|
|
1719
|
-
handleChangeFor("settlorExemptionReason")(
|
|
1720
|
-
data.settlorExemptionReason?.includes("noneOfTheAbove") ? exemptionReasons.filter((reason) => reason !== "noneOfTheAbove") : ["noneOfTheAbove"]
|
|
1721
|
-
);
|
|
1722
|
-
return;
|
|
1723
|
-
}
|
|
1724
|
-
handleChangeFor("settlorExemptionReason")(exemptionReasons);
|
|
1725
|
-
};
|
|
1726
|
-
const nameProps = getFieldProps(props, nameFields);
|
|
1727
|
-
const onEntityTypeChange = (value) => {
|
|
1728
|
-
if (isOrganizationSettlorWithExemptionEnabled && value === LegalEntityTypes.ORGANIZATION && data.role?.length === 1 && data.role[0] === "settlor") {
|
|
1729
|
-
changeSettlorExemptionReasons(["professionalServiceProvider"]);
|
|
1730
|
-
}
|
|
1731
|
-
handleChangeFor("entityType")(value);
|
|
1732
|
-
};
|
|
1733
|
-
return /* @__PURE__ */ jsxs("form", { className: "adyen-kyc-trust__role-and-entity-type adyen-kyc-u-width-full", children: [
|
|
1734
|
-
/* @__PURE__ */ jsx(FormHeader, { heading: i18n.get("roleAndEntityType") }),
|
|
1735
|
-
/* @__PURE__ */ jsx(
|
|
1736
|
-
ErrorPanel,
|
|
1737
|
-
{
|
|
1738
|
-
verificationErrors: formVerificationErrors,
|
|
1739
|
-
validationErrors: fieldValidationErrors,
|
|
1740
|
-
formUtils,
|
|
1741
|
-
id: "ariaErrorField"
|
|
1742
|
-
}
|
|
1743
|
-
),
|
|
1744
|
-
/* @__PURE__ */ jsx(
|
|
1745
|
-
Field,
|
|
1746
|
-
{
|
|
1747
|
-
el: "fieldset",
|
|
1748
|
-
name: "role",
|
|
1749
|
-
label: formUtils.getLabel("role", "selectTheApplicableRoles"),
|
|
1750
|
-
errorMessage: formUtils.getErrorMessage("role", errors, fieldProblems),
|
|
1751
|
-
isValid: valid.role,
|
|
1752
|
-
disabled: availableRoles.length === 0,
|
|
1753
|
-
showErrorIconBottom: true,
|
|
1754
|
-
children: (childProps) => /* @__PURE__ */ jsx(
|
|
1755
|
-
MultiSelectList,
|
|
1756
|
-
{
|
|
1757
|
-
...childProps,
|
|
1758
|
-
options: Object.values(TrustMemberTypes),
|
|
1759
|
-
selected: data.role ?? [],
|
|
1760
|
-
onSelect: changeRoles,
|
|
1761
|
-
mapToSelectItem: (role) => ({
|
|
1762
|
-
...makeSelectItemForRole(role, t),
|
|
1763
|
-
disabled: !availableRoles.includes(role)
|
|
1764
|
-
})
|
|
1765
|
-
}
|
|
1766
|
-
)
|
|
1767
|
-
}
|
|
1768
|
-
),
|
|
1769
|
-
schema?.includes("entityType") && /* @__PURE__ */ jsx(
|
|
1770
|
-
Field,
|
|
1771
|
-
{
|
|
1772
|
-
el: "fieldset",
|
|
1773
|
-
name: "entityType",
|
|
1774
|
-
errorMessage: formUtils.getErrorMessage("entityType", errors, fieldProblems),
|
|
1775
|
-
label: formUtils.getLabel("entityType", "whatTypeOfYourMembersEntity"),
|
|
1776
|
-
classNameModifiers: ["entityType"],
|
|
1777
|
-
disabled: Boolean(existingTrustMember),
|
|
1778
|
-
children: (childProps) => /* @__PURE__ */ jsx(
|
|
1779
|
-
RadioGroupCard,
|
|
1780
|
-
{
|
|
1781
|
-
...childProps,
|
|
1782
|
-
name: "entityType",
|
|
1783
|
-
options: trustMemberLegalEntityTypes,
|
|
1784
|
-
onSelect: onEntityTypeChange,
|
|
1785
|
-
selected: data.entityType,
|
|
1786
|
-
optionId: (option) => leTypeCardDetails$1[option].id,
|
|
1787
|
-
optionName: (option) => leTypeCardDetails$1[option].name,
|
|
1788
|
-
optionDescription: (option) => leTypeCardDetails$1[option].description,
|
|
1789
|
-
"aria-required": true,
|
|
1790
|
-
"aria-invalid": !valid.entityType,
|
|
1791
|
-
floatingRadio: true
|
|
1792
|
-
}
|
|
1793
|
-
)
|
|
1794
|
-
}
|
|
1795
|
-
),
|
|
1796
|
-
schema?.includes("descriptionUndefinedBeneficiary") && /* @__PURE__ */ jsx(
|
|
1797
|
-
Field,
|
|
1798
|
-
{
|
|
1799
|
-
name: "descriptionUndefinedBeneficiary",
|
|
1800
|
-
label: formUtils.getLabel("description"),
|
|
1801
|
-
isValid: valid.descriptionUndefinedBeneficiary,
|
|
1802
|
-
errorMessage: formUtils.getErrorMessage(
|
|
1803
|
-
"descriptionUndefinedBeneficiary",
|
|
1804
|
-
errors,
|
|
1805
|
-
fieldProblems
|
|
1806
|
-
),
|
|
1807
|
-
children: (childProps) => /* @__PURE__ */ jsx(
|
|
1808
|
-
TextArea,
|
|
1809
|
-
{
|
|
1810
|
-
...childProps,
|
|
1811
|
-
name: "descriptionUndefinedBeneficiary",
|
|
1812
|
-
value: data.descriptionUndefinedBeneficiary,
|
|
1813
|
-
maxLength: CHARACTERS_LIMIT,
|
|
1814
|
-
onInput: onInputDescription,
|
|
1815
|
-
helper: i18n.get("describeWhoIsABeneficiaryInYourTrust"),
|
|
1816
|
-
"aria-required": true,
|
|
1817
|
-
"aria-invalid": !valid.descriptionUndefinedBeneficiary
|
|
1818
|
-
}
|
|
1819
|
-
)
|
|
1820
|
-
}
|
|
1821
|
-
),
|
|
1822
|
-
schema?.includes("settlorExemptionReason") && !isOrganizationAndSettlor(data) && /* @__PURE__ */ jsx(
|
|
1823
|
-
Field,
|
|
1824
|
-
{
|
|
1825
|
-
el: "fieldset",
|
|
1826
|
-
name: "settlorExemptionReason",
|
|
1827
|
-
label: formUtils.getLabel("settlorExemptionReason", "whichOfTheseApplyToTheSettlor"),
|
|
1828
|
-
isValid: valid.settlorExemptionReason,
|
|
1829
|
-
errorMessage: formUtils.getErrorMessage("settlorExemptionReason", errors, fieldProblems),
|
|
1830
|
-
showErrorIconBottom: true,
|
|
1831
|
-
children: (childProps) => /* @__PURE__ */ jsx(
|
|
1832
|
-
MultiSelectList,
|
|
1833
|
-
{
|
|
1834
|
-
...childProps,
|
|
1835
|
-
options: settlorExemptionReasonWithNoneOfTheAbove,
|
|
1836
|
-
selected: data.settlorExemptionReason ?? [],
|
|
1837
|
-
onSelect: changeSettlorExemptionReasons,
|
|
1838
|
-
mapToSelectItem: (reason) => ({
|
|
1839
|
-
id: reason,
|
|
1840
|
-
name: i18n.get(reason)
|
|
1841
|
-
})
|
|
1842
|
-
}
|
|
1843
|
-
)
|
|
1844
|
-
}
|
|
1845
|
-
),
|
|
1846
|
-
data.trustMemberType !== "rootTrustee" && (schema.includes("firstName") || schema.includes("lastName")) ? /* @__PURE__ */ jsx(
|
|
1847
|
-
Name,
|
|
1848
|
-
{
|
|
1849
|
-
...nameProps,
|
|
1850
|
-
data: {
|
|
1851
|
-
firstName: defaultData.firstName,
|
|
1852
|
-
lastName: defaultData.lastName
|
|
1853
|
-
},
|
|
1854
|
-
requiredFields: schema.filter(
|
|
1855
|
-
(field) => nameFields.includes(field)
|
|
1856
|
-
),
|
|
1857
|
-
labels: {
|
|
1858
|
-
firstName: "firstNameOfSettlor",
|
|
1859
|
-
lastName: "lastNameOfSettlor",
|
|
1860
|
-
enterNameExactlyAsAppearInID: "enterSettlorsFirstNameExactlyAsItAppearsInID",
|
|
1861
|
-
enterLastNameExactlyAsAppearInID: "enterSettlorsLastNameExactlyAsItAppearsInID"
|
|
1862
|
-
},
|
|
1863
|
-
errors,
|
|
1864
|
-
fieldValidationErrors: fieldProblems,
|
|
1865
|
-
handleFieldChange: handleChangeFor,
|
|
1866
|
-
valid,
|
|
1867
|
-
dataStoreId: id
|
|
1868
|
-
}
|
|
1869
|
-
) : void 0,
|
|
1870
|
-
isOrganizationSettlorWithExemptionEnabled && schema?.includes("country") && schema?.includes("legalCompanyName") ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1871
|
-
/* @__PURE__ */ jsx(
|
|
1872
|
-
CountryField,
|
|
1873
|
-
{
|
|
1874
|
-
data: formUtils.getFieldData(data, COUNTRY_FIELD),
|
|
1875
|
-
valid: formUtils.getFieldValid(valid, COUNTRY_FIELD),
|
|
1876
|
-
errors: formUtils.getFieldErrors(errors, fieldProblems, COUNTRY_FIELD),
|
|
1877
|
-
labels: formUtils.getFieldLabels(COUNTRY_FIELD),
|
|
1878
|
-
readonly: false,
|
|
1879
|
-
allowedCountries: void 0,
|
|
1880
|
-
handleChangeFor
|
|
1881
|
-
}
|
|
1882
|
-
),
|
|
1883
|
-
/* @__PURE__ */ jsx(
|
|
1884
|
-
LegalCompanyNameField,
|
|
1885
|
-
{
|
|
1886
|
-
data: formUtils.getFieldData(data, LEGAL_COMPANY_NAME_FIELD),
|
|
1887
|
-
valid: formUtils.getFieldValid(valid, LEGAL_COMPANY_NAME_FIELD),
|
|
1888
|
-
errors: formUtils.getFieldErrors(errors, fieldProblems, LEGAL_COMPANY_NAME_FIELD),
|
|
1889
|
-
labels: formUtils.getFieldLabels(LEGAL_COMPANY_NAME_FIELD),
|
|
1890
|
-
helperText: formUtils.getFieldHelperText(LEGAL_COMPANY_NAME_FIELD, {
|
|
1891
|
-
legalCompanyName: "legalCompanyName__helperText"
|
|
1892
|
-
}),
|
|
1893
|
-
readonly: false,
|
|
1894
|
-
handleChangeFor
|
|
1895
|
-
}
|
|
1896
|
-
)
|
|
1897
|
-
] }) : void 0
|
|
1898
|
-
] });
|
|
1899
|
-
};
|
|
1900
|
-
const mapTrustMemberToEntityAssociations = (trustMember) => {
|
|
1901
|
-
if (trustMember.legalEntityId === isNewEntity) {
|
|
1902
|
-
throw Error("Cannot map a new trust member, you must create it first");
|
|
1903
|
-
}
|
|
1904
|
-
if (trustMember.trustMemberType === "exemptSettlor")
|
|
1905
|
-
return [
|
|
1906
|
-
{
|
|
1907
|
-
legalEntityId: trustMember.legalEntityId,
|
|
1908
|
-
entityType: trustMember.legalEntityType,
|
|
1909
|
-
type: TrustMemberTypes.SETTLOR,
|
|
1910
|
-
settlorExemptionReason: trustMember.settlorExemptionReason,
|
|
1911
|
-
name: trustMember.legalEntityType === LegalEntityTypes.INDIVIDUAL ? `${trustMember.exemptSettlorName?.firstName} ${trustMember.exemptSettlorName?.lastName}` : trustMember.name ?? ""
|
|
1912
|
-
}
|
|
1913
|
-
];
|
|
1914
|
-
return trustMember.roles.map((role) => ({
|
|
1915
|
-
legalEntityId: trustMember.legalEntityId,
|
|
1916
|
-
type: role
|
|
1917
|
-
}));
|
|
1918
|
-
};
|
|
1919
|
-
const addOrUpdateAssociatedTrustMember = async ({
|
|
1920
|
-
newOrUpdated,
|
|
1921
|
-
trust,
|
|
1922
|
-
updateLegalEntity
|
|
1923
|
-
}) => {
|
|
1924
|
-
const otherAssociations = getOwnEntityAssociations(trust).filter(
|
|
1925
|
-
(existingAssociation) => existingAssociation.legalEntityId !== newOrUpdated.legalEntityId
|
|
1926
|
-
);
|
|
1927
|
-
const updatedAssociations = mapTrustMemberToEntityAssociations(newOrUpdated);
|
|
1928
|
-
const patchLE = {
|
|
1929
|
-
entityAssociations: [...otherAssociations, ...updatedAssociations]
|
|
1930
|
-
};
|
|
1931
|
-
await updateLegalEntity({ ...patchLE, id: trust.id });
|
|
1932
|
-
};
|
|
1933
|
-
const updateRootTrusteeTrustMember = async ({
|
|
1934
|
-
trustMember,
|
|
1935
|
-
trust,
|
|
1936
|
-
updateLegalEntity
|
|
1937
|
-
}) => {
|
|
1938
|
-
const otherAssociations = getOwnEntityAssociations(trust).filter(
|
|
1939
|
-
(existingAssociation) => existingAssociation.legalEntityId !== trustMember.legalEntityId
|
|
1940
|
-
);
|
|
1941
|
-
const updatedAssociations = mapRootTrustMemberToEntityAssociations(trustMember);
|
|
1942
|
-
const patchLE = {
|
|
1943
|
-
entityAssociations: [...otherAssociations, ...updatedAssociations]
|
|
1944
|
-
};
|
|
1945
|
-
await updateLegalEntity({ ...patchLE, id: trust.id });
|
|
1946
|
-
};
|
|
1947
|
-
const mapRootTrustMemberToEntityAssociations = (trustMember) => trustMember.roles.filter((r) => r !== "secondaryTrustee").map((role) => ({
|
|
1948
|
-
legalEntityId: trustMember.legalEntityId,
|
|
1949
|
-
type: role
|
|
1950
|
-
}));
|
|
1951
|
-
const addOrUpdateUndefinedBeneficiary = async ({
|
|
1952
|
-
newOrUpdated,
|
|
1953
|
-
trust,
|
|
1954
|
-
updateLegalEntity
|
|
1955
|
-
}) => {
|
|
1956
|
-
const otherUndefinedBeneficiaries = trust.trust?.undefinedBeneficiaryInfo?.filter(
|
|
1957
|
-
(ub) => ub.reference !== newOrUpdated.reference
|
|
1958
|
-
) ?? [];
|
|
1959
|
-
const patchLE = {
|
|
1960
|
-
trust: {
|
|
1961
|
-
undefinedBeneficiaryInfo: [
|
|
1962
|
-
...otherUndefinedBeneficiaries,
|
|
1963
|
-
newOrUpdated.reference === isNewEntity ? {
|
|
1964
|
-
description: newOrUpdated.description
|
|
1965
|
-
} : {
|
|
1966
|
-
reference: newOrUpdated.reference,
|
|
1967
|
-
description: newOrUpdated.description
|
|
1968
|
-
}
|
|
1969
|
-
]
|
|
1970
|
-
}
|
|
1971
|
-
};
|
|
1972
|
-
await updateLegalEntity({ ...patchLE, id: trust.id });
|
|
1973
|
-
};
|
|
1974
|
-
const createExemptSettlor = async ({
|
|
1975
|
-
exemptSettlor,
|
|
1976
|
-
trust,
|
|
1977
|
-
handleCreateLegalEntity
|
|
1978
|
-
}) => {
|
|
1979
|
-
const exemptSettlorLE = {
|
|
1980
|
-
type: LegalEntityTypes.INDIVIDUAL,
|
|
1981
|
-
individual: {
|
|
1982
|
-
name: {
|
|
1983
|
-
firstName: exemptSettlor.exemptSettlorName?.firstName ?? "",
|
|
1984
|
-
lastName: exemptSettlor.exemptSettlorName?.lastName ?? ""
|
|
1985
|
-
},
|
|
1986
|
-
residentialAddress: {
|
|
1987
|
-
country: trust.trust.registeredAddress.country
|
|
1988
|
-
}
|
|
1989
|
-
}
|
|
1990
|
-
};
|
|
1991
|
-
return handleCreateLegalEntity(exemptSettlorLE);
|
|
1992
|
-
};
|
|
1993
|
-
const createOrganizationExemptSettlor = async ({
|
|
1994
|
-
exemptSettlor,
|
|
1995
|
-
handleCreateLegalEntity
|
|
1996
|
-
}) => {
|
|
1997
|
-
const exemptSettlorLE = {
|
|
1998
|
-
type: LegalEntityTypes.ORGANIZATION,
|
|
1999
|
-
organization: {
|
|
2000
|
-
legalName: exemptSettlor.name ?? "",
|
|
2001
|
-
registeredAddress: {
|
|
2002
|
-
country: exemptSettlor.country ?? "NL"
|
|
2003
|
-
}
|
|
2004
|
-
}
|
|
2005
|
-
};
|
|
2006
|
-
return handleCreateLegalEntity(exemptSettlorLE);
|
|
2007
|
-
};
|
|
2008
|
-
const exemptSettlorNamesTheSame = (existingSettlor, newSettlor) => JSON.stringify(existingSettlor.exemptSettlorName) === JSON.stringify(newSettlor.exemptSettlorName);
|
|
2009
|
-
const updateExemptSettlorName = async ({
|
|
2010
|
-
exemptSettlor,
|
|
2011
|
-
updateLegalEntity
|
|
2012
|
-
}) => {
|
|
2013
|
-
const exemptSettlorPatch = {
|
|
2014
|
-
individual: {
|
|
2015
|
-
name: {
|
|
2016
|
-
firstName: exemptSettlor.exemptSettlorName?.firstName,
|
|
2017
|
-
lastName: exemptSettlor.exemptSettlorName?.lastName
|
|
2018
|
-
}
|
|
2019
|
-
}
|
|
2020
|
-
};
|
|
2021
|
-
return updateLegalEntity({
|
|
2022
|
-
...exemptSettlorPatch,
|
|
2023
|
-
id: exemptSettlor.legalEntityId
|
|
2024
|
-
});
|
|
2025
|
-
};
|
|
2026
|
-
const updateOrganizationExemptSettlorName = async ({
|
|
2027
|
-
exemptSettlor,
|
|
2028
|
-
updateLegalEntity
|
|
2029
|
-
}) => {
|
|
2030
|
-
const exemptSettlorPatch = {
|
|
2031
|
-
organization: {
|
|
2032
|
-
legalName: exemptSettlor.name,
|
|
2033
|
-
registeredAddress: {
|
|
2034
|
-
country: exemptSettlor.country
|
|
2035
|
-
}
|
|
2036
|
-
}
|
|
2037
|
-
};
|
|
2038
|
-
return updateLegalEntity({
|
|
2039
|
-
...exemptSettlorPatch,
|
|
2040
|
-
id: exemptSettlor.legalEntityId
|
|
2041
|
-
});
|
|
2042
|
-
};
|
|
2043
|
-
const settlorExemptionReasonsList = "adyen-kyc-settlor-exemption-reasons-list";
|
|
2044
|
-
const styles$3 = {
|
|
2045
|
-
settlorExemptionReasonsList
|
|
2046
|
-
};
|
|
2047
|
-
const formatRolesForSummary = (roles, i18n) => roles.map((role) => i18n.get(getRoleName(role))).join(", ");
|
|
2048
|
-
const formatSettlorExemptionReasonsForSummary = (reasons, i18n) => /* @__PURE__ */ jsx("ul", { className: styles$3.settlorExemptionReasonsList, children: reasons.map((reason) => /* @__PURE__ */ jsx("li", { children: i18n.get(reason) }, reason)) });
|
|
2049
|
-
const formatRoleAndEntityTypeSummary = (data, i18n, isOrganizationSettlorWithExemptionEnabled) => {
|
|
2050
|
-
const { trustMemberType, roles } = data;
|
|
2051
|
-
const role = formatRolesForSummary(roles, i18n);
|
|
2052
|
-
switch (trustMemberType) {
|
|
2053
|
-
case "undefinedBeneficiary":
|
|
2054
|
-
return {
|
|
2055
|
-
role,
|
|
2056
|
-
descriptionUndefinedBeneficiary: data.description
|
|
2057
|
-
};
|
|
2058
|
-
case "exemptSettlor":
|
|
2059
|
-
return {
|
|
2060
|
-
role,
|
|
2061
|
-
entityType: i18n.get(data.legalEntityType),
|
|
2062
|
-
firstName: data.exemptSettlorName?.firstName,
|
|
2063
|
-
lastName: data.exemptSettlorName?.lastName,
|
|
2064
|
-
country: isOrganizationSettlorWithExemptionEnabled ? data.country : void 0,
|
|
2065
|
-
legalCompanyName: isOrganizationSettlorWithExemptionEnabled ? data.name : void 0,
|
|
2066
|
-
settlorExemptionReason: summaryItem(
|
|
2067
|
-
"otherInformation",
|
|
2068
|
-
formatSettlorExemptionReasonsForSummary(data.settlorExemptionReason ?? [], i18n)
|
|
2069
|
-
)
|
|
2070
|
-
};
|
|
2071
|
-
case "company":
|
|
2072
|
-
case "rootTrustee":
|
|
2073
|
-
case "regular":
|
|
2074
|
-
return {};
|
|
2075
|
-
}
|
|
2076
|
-
};
|
|
2077
|
-
const summary = {
|
|
2078
|
-
formId: "summary",
|
|
2079
|
-
formName: "summary"
|
|
2080
|
-
};
|
|
2081
|
-
const regularForms$1 = {
|
|
2082
|
-
roleAndEntityType: {
|
|
2083
|
-
formId: "roleAndEntityType",
|
|
2084
|
-
formName: "roleAndEntityType",
|
|
2085
|
-
fields: ["role", "entityType"]
|
|
2086
|
-
},
|
|
2087
|
-
memberDetails: {
|
|
2088
|
-
formId: "memberDetails",
|
|
2089
|
-
formName: "memberDetails"
|
|
2090
|
-
},
|
|
2091
|
-
summary
|
|
2092
|
-
};
|
|
2093
|
-
const undefinedBeneficiaryForms = {
|
|
2094
|
-
roleAndEntityType: {
|
|
2095
|
-
formId: "roleAndEntityType",
|
|
2096
|
-
formName: "roleAndEntityType",
|
|
2097
|
-
fields: ["role", "entityType", "descriptionUndefinedBeneficiary"]
|
|
2098
|
-
},
|
|
2099
|
-
summary
|
|
2100
|
-
};
|
|
2101
|
-
const exemptSettlorForms = {
|
|
2102
|
-
roleAndEntityType: {
|
|
2103
|
-
formId: "roleAndEntityType",
|
|
2104
|
-
formName: "roleAndEntityType",
|
|
2105
|
-
fields: ["role", "entityType", "settlorExemptionReason"]
|
|
2106
|
-
},
|
|
2107
|
-
summary
|
|
2108
|
-
};
|
|
2109
|
-
const decideForms = (trustMember) => {
|
|
2110
|
-
if (trustMember === "incomplete") return regularForms$1;
|
|
2111
|
-
switch (trustMember.trustMemberType) {
|
|
2112
|
-
case "undefinedBeneficiary":
|
|
2113
|
-
return undefinedBeneficiaryForms;
|
|
2114
|
-
case "exemptSettlor":
|
|
2115
|
-
return exemptSettlorForms;
|
|
2116
|
-
case "rootTrustee":
|
|
2117
|
-
return exemptSettlorForms;
|
|
2118
|
-
case "regular":
|
|
2119
|
-
case "company":
|
|
2120
|
-
return regularForms$1;
|
|
2121
|
-
}
|
|
2122
|
-
};
|
|
2123
|
-
const convertDataToTrustMember = (data, existingTrustMember, isOrganizationSettlorWithExemptionReasonEnabled = false) => {
|
|
2124
|
-
const existingId = existingTrustMember ? existingTrustMember.trustMemberType === "undefinedBeneficiary" ? existingTrustMember.reference : existingTrustMember.legalEntityId : void 0;
|
|
2125
|
-
if (data.trustMemberType === "rootTrustee") {
|
|
2126
|
-
return {
|
|
2127
|
-
trustMemberType: "rootTrustee",
|
|
2128
|
-
roles: data.role ?? [],
|
|
2129
|
-
legalEntityType: data.entityType ?? LegalEntityTypes.ORGANIZATION,
|
|
2130
|
-
legalEntityId: "",
|
|
2131
|
-
name: data.firstName ?? ""
|
|
2132
|
-
};
|
|
2133
|
-
}
|
|
2134
|
-
if (data.role?.length) {
|
|
2135
|
-
if (isExemptSettlor(data)) {
|
|
2136
|
-
if (isOrganizationSettlorWithExemptionReasonEnabled && data.entityType === LegalEntityTypes.ORGANIZATION) {
|
|
2137
|
-
return {
|
|
2138
|
-
trustMemberType: "exemptSettlor",
|
|
2139
|
-
roles: [TrustMemberTypes.SETTLOR],
|
|
2140
|
-
legalEntityType: LegalEntityTypes.ORGANIZATION,
|
|
2141
|
-
legalEntityId: existingId ?? isNewEntity,
|
|
2142
|
-
name: data.legalCompanyName ?? "",
|
|
2143
|
-
settlorExemptionReason: ["professionalServiceProvider"],
|
|
2144
|
-
country: data.country
|
|
2145
|
-
};
|
|
2146
|
-
}
|
|
2147
|
-
return {
|
|
2148
|
-
trustMemberType: "exemptSettlor",
|
|
2149
|
-
roles: [TrustMemberTypes.SETTLOR],
|
|
2150
|
-
legalEntityType: LegalEntityTypes.INDIVIDUAL,
|
|
2151
|
-
settlorExemptionReason: data.settlorExemptionReason.filter(
|
|
2152
|
-
(reason) => reason !== "noneOfTheAbove"
|
|
2153
|
-
),
|
|
2154
|
-
exemptSettlorName: {
|
|
2155
|
-
firstName: data.firstName ?? "",
|
|
2156
|
-
lastName: data.lastName ?? ""
|
|
2157
|
-
},
|
|
2158
|
-
legalEntityId: existingId ?? isNewEntity
|
|
2159
|
-
};
|
|
2160
|
-
}
|
|
2161
|
-
if (data.role.includes("undefinedBeneficiary"))
|
|
2162
|
-
return {
|
|
2163
|
-
trustMemberType: "undefinedBeneficiary",
|
|
2164
|
-
roles: [TrustMemberTypes.UNDEFINED_BENEFICIARY],
|
|
2165
|
-
description: data.descriptionUndefinedBeneficiary ?? "",
|
|
2166
|
-
reference: existingId ?? isNewEntity
|
|
2167
|
-
};
|
|
2168
|
-
if (data.entityType === LegalEntityTypes.ORGANIZATION) {
|
|
2169
|
-
return {
|
|
2170
|
-
trustMemberType: "company",
|
|
2171
|
-
roles: data.role,
|
|
2172
|
-
legalEntityType: LegalEntityTypes.ORGANIZATION,
|
|
2173
|
-
legalEntityId: existingId ?? isNewEntity,
|
|
2174
|
-
name: data.legalCompanyName ?? "",
|
|
2175
|
-
country: data.country
|
|
2176
|
-
};
|
|
2177
|
-
}
|
|
2178
|
-
if (data.entityType === LegalEntityTypes.INDIVIDUAL)
|
|
2179
|
-
return {
|
|
2180
|
-
trustMemberType: "regular",
|
|
2181
|
-
roles: data.role,
|
|
2182
|
-
legalEntityType: LegalEntityTypes.INDIVIDUAL,
|
|
2183
|
-
legalEntityId: existingId ?? isNewEntity,
|
|
2184
|
-
name: ""
|
|
2185
|
-
};
|
|
2186
|
-
}
|
|
2187
|
-
return "incomplete";
|
|
2188
|
-
};
|
|
2189
|
-
const logger$1 = createLogger();
|
|
2190
|
-
function RoleAndTypeDropin({
|
|
2191
|
-
trust,
|
|
2192
|
-
trustMemberLe,
|
|
2193
|
-
existingTrustMember,
|
|
2194
|
-
navigateToFullDropinFor,
|
|
2195
|
-
navigateBack,
|
|
2196
|
-
country
|
|
2197
|
-
}) {
|
|
2198
|
-
const { i18n } = useI18nContext();
|
|
2199
|
-
const { isExperimentEnabled } = useExperimentsContext();
|
|
2200
|
-
const allowMoreRolesForMainRootTrustee = isExperimentEnabled("AllowMoreRolesForMainRootTrustee");
|
|
2201
|
-
const [trustMember, setTrustMember] = useState(
|
|
2202
|
-
existingTrustMember ?? "incomplete"
|
|
2203
|
-
);
|
|
2204
|
-
const [shouldValidate, setShouldValidate] = useState(false);
|
|
2205
|
-
const { showToast } = useToastContext();
|
|
2206
|
-
const isOrganizationSettlorWithExemptionReasonEnabled = (country2) => country2 === CountryCodes.Australia;
|
|
2207
|
-
const isOrganizationSettlorWithExemptionEnabled = isOrganizationSettlorWithExemptionReasonEnabled(
|
|
2208
|
-
trust?.trust?.countryOfGoverningLaw
|
|
2209
|
-
);
|
|
2210
|
-
const formList = decideForms(trustMember);
|
|
2211
|
-
const forms = Object.values(formList);
|
|
2212
|
-
const [formValidity, setFormValidity] = useState({
|
|
2213
|
-
roleAndEntityType: false
|
|
2214
|
-
});
|
|
2215
|
-
const [activeForm, setActiveForm] = useState(regularForms$1.roleAndEntityType);
|
|
2216
|
-
const isSummaryStep = activeForm.formId === summaryStep.formId;
|
|
2217
|
-
const { mutateAsync: createLegalEntity } = useCreateLegalEntity();
|
|
2218
|
-
const { mutateAsync: updateLegalEntity } = useUpdateLegalEntity();
|
|
2219
|
-
const addOrUpdateTrustMember = async (updated, existing) => {
|
|
2220
|
-
if (trust === void 0) {
|
|
2221
|
-
throw new Error("No associated trust");
|
|
2222
|
-
}
|
|
2223
|
-
try {
|
|
2224
|
-
switch (updated.trustMemberType) {
|
|
2225
|
-
case "undefinedBeneficiary":
|
|
2226
|
-
await addOrUpdateUndefinedBeneficiary({
|
|
2227
|
-
newOrUpdated: updated,
|
|
2228
|
-
trust,
|
|
2229
|
-
updateLegalEntity
|
|
2230
|
-
});
|
|
2231
|
-
break;
|
|
2232
|
-
case "exemptSettlor":
|
|
2233
|
-
if (!existing) {
|
|
2234
|
-
const newSettlorLE = isOrganizationSettlorWithExemptionEnabled && updated.legalEntityType === "organization" ? await createOrganizationExemptSettlor({
|
|
2235
|
-
exemptSettlor: updated,
|
|
2236
|
-
handleCreateLegalEntity: createLegalEntity
|
|
2237
|
-
}) : await createExemptSettlor({
|
|
2238
|
-
exemptSettlor: updated,
|
|
2239
|
-
trust,
|
|
2240
|
-
handleCreateLegalEntity: createLegalEntity
|
|
2241
|
-
});
|
|
2242
|
-
updated.legalEntityId = newSettlorLE.id;
|
|
2243
|
-
}
|
|
2244
|
-
if (existing && !exemptSettlorNamesTheSame(existing, updated)) ;
|
|
2245
|
-
if (existing && isOrganizationSettlorWithExemptionEnabled && updated.legalEntityType === "organization") ;
|
|
2246
|
-
await addOrUpdateAssociatedTrustMember({
|
|
2247
|
-
newOrUpdated: updated,
|
|
2248
|
-
trust,
|
|
2249
|
-
updateLegalEntity
|
|
2250
|
-
});
|
|
2251
|
-
break;
|
|
2252
|
-
case "regular":
|
|
2253
|
-
case "company":
|
|
2254
|
-
await addOrUpdateAssociatedTrustMember({
|
|
2255
|
-
newOrUpdated: updated,
|
|
2256
|
-
trust,
|
|
2257
|
-
updateLegalEntity
|
|
2258
|
-
});
|
|
2259
|
-
break;
|
|
2260
|
-
case "rootTrustee":
|
|
2261
|
-
if (allowMoreRolesForMainRootTrustee && existing) ;
|
|
2262
|
-
break;
|
|
2263
|
-
default:
|
|
2264
|
-
logger$1.warn(
|
|
2265
|
-
`Updating trust member type "${updated.trustMemberType}" is not implemented.`
|
|
2266
|
-
);
|
|
2267
|
-
}
|
|
2268
|
-
showToast({ label: i18n.get("successfullyUpdatedDetails"), variant: "success" });
|
|
2269
|
-
navigateBack();
|
|
2270
|
-
} catch (err) {
|
|
2271
|
-
logger$1.error(err);
|
|
2272
|
-
showToast({ label: i18n.get("failedToUpdateDetails"), variant: "error" });
|
|
2273
|
-
}
|
|
2274
|
-
};
|
|
2275
|
-
const summaryData = trustMember === "incomplete" ? {} : {
|
|
2276
|
-
roleAndEntityType: formatRoleAndEntityTypeSummary(
|
|
2277
|
-
trustMember,
|
|
2278
|
-
i18n,
|
|
2279
|
-
isOrganizationSettlorWithExemptionEnabled
|
|
2280
|
-
)
|
|
2281
|
-
};
|
|
2282
|
-
const onNavigateToNextStep = () => {
|
|
2283
|
-
if (isSummaryStep && trustMember !== "incomplete") {
|
|
2284
|
-
addOrUpdateTrustMember(trustMember);
|
|
2285
|
-
return;
|
|
2286
|
-
}
|
|
2287
|
-
gotoFormByFormIndex(forms.findIndex((form) => form.formId === activeForm.formId) + 1);
|
|
2288
|
-
};
|
|
2289
|
-
const onTrustMemberChange = ({
|
|
2290
|
-
data,
|
|
2291
|
-
isValid = false,
|
|
2292
|
-
dataStoreId = void 0
|
|
2293
|
-
}) => {
|
|
2294
|
-
if (dataStoreId) {
|
|
2295
|
-
setFormValidity({ ...formValidity, [dataStoreId]: isValid });
|
|
2296
|
-
}
|
|
2297
|
-
setTrustMember(
|
|
2298
|
-
convertDataToTrustMember(
|
|
2299
|
-
data,
|
|
2300
|
-
existingTrustMember,
|
|
2301
|
-
isOrganizationSettlorWithExemptionEnabled
|
|
2302
|
-
)
|
|
2303
|
-
);
|
|
2304
|
-
};
|
|
2305
|
-
const saveRolesAndNavigate = async () => {
|
|
2306
|
-
if (trustMember === "incomplete") return;
|
|
2307
|
-
if (hasRolesChanged(trustMember.roles, existingTrustMember?.roles)) {
|
|
2308
|
-
addOrUpdateTrustMember(trustMember);
|
|
2309
|
-
}
|
|
2310
|
-
navigateBack();
|
|
2311
|
-
};
|
|
2312
|
-
const hasRolesChanged = (newRoles = [], existingRoles = []) => newRoles.length !== existingRoles.length || !newRoles.every((newRole) => existingRoles.includes(newRole));
|
|
2313
|
-
const formsWithValidity = forms.map((form) => ({
|
|
2314
|
-
formId: form.formId,
|
|
2315
|
-
formName: form.formName,
|
|
2316
|
-
isValid: formValidity[form.formId]
|
|
2317
|
-
}));
|
|
2318
|
-
const gotoFormByFormIndex = (formIndex) => {
|
|
2319
|
-
const targetForm = forms[formIndex];
|
|
2320
|
-
if (!formValidity.roleAndEntityType || trustMember === "incomplete") {
|
|
2321
|
-
setShouldValidate(true);
|
|
2322
|
-
return;
|
|
2323
|
-
}
|
|
2324
|
-
if (trustMember.trustMemberType === "regular" || trustMember.trustMemberType === "company") {
|
|
2325
|
-
if (targetForm.formId === regularForms$1.memberDetails.formId) {
|
|
2326
|
-
navigateToFullDropinFor(trustMember);
|
|
2327
|
-
return;
|
|
2328
|
-
}
|
|
2329
|
-
if (targetForm.formId === summaryStep.formId) return;
|
|
2330
|
-
}
|
|
2331
|
-
setActiveForm(targetForm);
|
|
2332
|
-
};
|
|
2333
|
-
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2334
|
-
/* @__PURE__ */ jsx("div", { className: "adyen-kyc-dropin__sidebar-wrapper", children: /* @__PURE__ */ jsx(
|
|
2335
|
-
FormNavigation,
|
|
2336
|
-
{
|
|
2337
|
-
forms: formsWithValidity,
|
|
2338
|
-
activeForm: formsWithValidity.find((form) => form.formId === activeForm.formId),
|
|
2339
|
-
taskName: "trustMembers",
|
|
2340
|
-
gotoForm: gotoFormByFormIndex
|
|
2341
|
-
}
|
|
2342
|
-
) }),
|
|
2343
|
-
/* @__PURE__ */ jsxs("div", { className: "adyen-kyc-form-container", children: [
|
|
2344
|
-
/* @__PURE__ */ jsx(
|
|
2345
|
-
"div",
|
|
2346
|
-
{
|
|
2347
|
-
className: activeForm.formId !== "roleAndEntityType" ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper",
|
|
2348
|
-
children: /* @__PURE__ */ jsx(
|
|
2349
|
-
TrustRoleAndEntityType,
|
|
2350
|
-
{
|
|
2351
|
-
id: "roleAndEntityType",
|
|
2352
|
-
existingTrustMember,
|
|
2353
|
-
onChange: onTrustMemberChange,
|
|
2354
|
-
shouldValidate,
|
|
2355
|
-
isOrganizationSettlorWithExemptionEnabled,
|
|
2356
|
-
country
|
|
2357
|
-
}
|
|
2358
|
-
)
|
|
2359
|
-
}
|
|
2360
|
-
),
|
|
2361
|
-
isSummaryStep && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-form-wrapper", children: /* @__PURE__ */ jsx(
|
|
2362
|
-
Summary,
|
|
2363
|
-
{
|
|
2364
|
-
data: summaryData,
|
|
2365
|
-
forms: [undefinedBeneficiaryForms.roleAndEntityType],
|
|
2366
|
-
gotoForm: gotoFormByFormIndex
|
|
2367
|
-
}
|
|
2368
|
-
) }),
|
|
2369
|
-
/* @__PURE__ */ jsx(
|
|
2370
|
-
ActionBar,
|
|
2371
|
-
{
|
|
2372
|
-
onNext: onNavigateToNextStep,
|
|
2373
|
-
onHome: saveRolesAndNavigate,
|
|
2374
|
-
nextButtonLabel: isSummaryStep ? i18n.get("submit") : i18n.get("continue"),
|
|
2375
|
-
homeButtonLabel: i18n.get("saveAndGoToOverview")
|
|
2376
|
-
}
|
|
2377
|
-
)
|
|
2378
|
-
] })
|
|
2379
|
-
] });
|
|
2380
|
-
return /* @__PURE__ */ jsx(DropinLayout, { content });
|
|
2381
|
-
}
|
|
2382
|
-
function TrustMemberRoleAndTypePage({
|
|
2383
|
-
trustId,
|
|
2384
|
-
memberId,
|
|
2385
|
-
navigateToFullDropinFor,
|
|
2386
|
-
navigateBack
|
|
2387
|
-
}) {
|
|
2388
|
-
const { data: memberLe } = useLegalEntity(memberId ?? skipToken);
|
|
2389
|
-
const { data: trustLe } = useLegalEntity(trustId);
|
|
2390
|
-
const trustMembers = useTrustMembers();
|
|
2391
|
-
if (!trustLe || memberId && !memberLe) {
|
|
2392
|
-
return /* @__PURE__ */ jsx(Loader, {});
|
|
2393
|
-
}
|
|
2394
|
-
const country = getLegalEntityCountry(memberLe ?? trustLe);
|
|
2395
|
-
const trustMember = memberId ? trustMembers.find(
|
|
2396
|
-
(tm) => tm.trustMemberType !== "undefinedBeneficiary" && tm.legalEntityId === memberId
|
|
2397
|
-
) : void 0;
|
|
2398
|
-
return /* @__PURE__ */ jsx(
|
|
2399
|
-
RoleAndTypeDropin,
|
|
2400
|
-
{
|
|
2401
|
-
trust: trustLe,
|
|
2402
|
-
trustMemberLe: memberLe,
|
|
2403
|
-
existingTrustMember: trustMember,
|
|
2404
|
-
country,
|
|
2405
|
-
navigateToFullDropinFor,
|
|
2406
|
-
navigateBack
|
|
2407
|
-
}
|
|
2408
|
-
);
|
|
2409
|
-
}
|
|
2410
|
-
const UNINCORPORATED_PARTNERSHIP__DEFAULT_DESCRIPTIONS_MAP = {
|
|
2411
|
-
[UnincorporatedPartnershipMemberTypes.SECONDARY_PARTNER]: "provideAtLeastOneSecondaryPartner",
|
|
2412
|
-
[UnincorporatedPartnershipMemberTypes.OWNER]: "provideAllOwners",
|
|
2413
|
-
[UnincorporatedPartnershipMemberTypes.CONTROLLING_PERSON]: "ifNoOwnersSpecifyControllingPersons"
|
|
2414
|
-
};
|
|
2415
|
-
const iconStatus = (current, min) => {
|
|
2416
|
-
const isSatisfied = current > 0 && current >= min;
|
|
2417
|
-
return isSatisfied ? "satisfied" : "empty";
|
|
2418
|
-
};
|
|
2419
|
-
const getEntityStatusRuleDescription = (country, currentTask, entityLabel) => {
|
|
2420
|
-
const defaultMessage = getDecisionMakerDescriptionMap(country)[entityLabel];
|
|
2421
|
-
switch (currentTask) {
|
|
2422
|
-
case TaskTypes.TRUST_MEMBER_OVERVIEW: {
|
|
2423
|
-
return TRUST_DEFAULT_DESCRIPTIONS_MAP[entityLabel];
|
|
2424
|
-
}
|
|
2425
|
-
case TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_OVERVIEW: {
|
|
2426
|
-
return UNINCORPORATED_PARTNERSHIP__DEFAULT_DESCRIPTIONS_MAP[entityLabel] || defaultMessage;
|
|
2427
|
-
}
|
|
2428
|
-
default: {
|
|
2429
|
-
return defaultMessage;
|
|
2430
|
-
}
|
|
2431
|
-
}
|
|
2432
|
-
};
|
|
2433
|
-
const EntityStatusIcon = ({ status }) => {
|
|
2434
|
-
switch (status) {
|
|
2435
|
-
case "empty":
|
|
2436
|
-
return /* @__PURE__ */ jsx(
|
|
2437
|
-
Icon,
|
|
2438
|
-
{
|
|
2439
|
-
name: "checkmark-circle",
|
|
2440
|
-
className: "adyen-kyc-entity-status__icon adyen-kyc-entity-status__icon--empty",
|
|
2441
|
-
testId: "empty-icon"
|
|
2442
|
-
}
|
|
2443
|
-
);
|
|
2444
|
-
case "satisfied":
|
|
2445
|
-
return /* @__PURE__ */ jsx(
|
|
2446
|
-
Icon,
|
|
2447
|
-
{
|
|
2448
|
-
name: "checkmark",
|
|
2449
|
-
className: "adyen-kyc-entity-status__icon adyen-kyc-entity-status__icon--satisfied",
|
|
2450
|
-
testId: "satisfied-icon"
|
|
2451
|
-
}
|
|
2452
|
-
);
|
|
2453
|
-
default:
|
|
2454
|
-
return /* @__PURE__ */ jsx(
|
|
2455
|
-
Icon,
|
|
2456
|
-
{
|
|
2457
|
-
name: "circle",
|
|
2458
|
-
className: "adyen-kyc-entity-status__icon adyen-kyc-entity-status__icon--empty",
|
|
2459
|
-
testId: "empty-icon"
|
|
2460
|
-
}
|
|
2461
|
-
);
|
|
2462
|
-
}
|
|
2463
|
-
};
|
|
2464
|
-
const EntityGuidanceStatus = ({
|
|
2465
|
-
country,
|
|
2466
|
-
currentTask,
|
|
2467
|
-
entityLabel,
|
|
2468
|
-
status
|
|
2469
|
-
}) => {
|
|
2470
|
-
const { t } = useTranslation("common");
|
|
2471
|
-
return /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-entity-status__container", children: [
|
|
2472
|
-
/* @__PURE__ */ jsx(EntityStatusIcon, { status }),
|
|
2473
|
-
/* @__PURE__ */ jsx(
|
|
2474
|
-
Tag,
|
|
2475
|
-
{
|
|
2476
|
-
className: "adyen-kyc-entity-status__tag",
|
|
2477
|
-
variant: getRoleTagVariant(entityLabel),
|
|
2478
|
-
children: t(($) => $[getRoleName(entityLabel)])
|
|
2479
|
-
},
|
|
2480
|
-
entityLabel
|
|
2481
|
-
),
|
|
2482
|
-
/* @__PURE__ */ jsx(
|
|
2483
|
-
"span",
|
|
2484
|
-
{
|
|
2485
|
-
className: "adyen-kyc-entity-status--text",
|
|
2486
|
-
"data-testid": `${entityLabel}-rule--description`,
|
|
2487
|
-
children: /* @__PURE__ */ jsx(
|
|
2488
|
-
Trans,
|
|
2489
|
-
{
|
|
2490
|
-
t,
|
|
2491
|
-
i18nKey: ($) => $[getEntityStatusRuleDescription(country, currentTask, entityLabel)]
|
|
2492
|
-
}
|
|
2493
|
-
)
|
|
2494
|
-
}
|
|
2495
|
-
)
|
|
2496
|
-
] });
|
|
2497
|
-
};
|
|
2498
|
-
const deleteAssociatedTrustMember = async ({
|
|
2499
|
-
associatedTrustMember,
|
|
2500
|
-
trust,
|
|
2501
|
-
asyncMutation
|
|
2502
|
-
}) => {
|
|
2503
|
-
const ownEntityAssociations = getOwnEntityAssociations(trust);
|
|
2504
|
-
const updatedTrustAssociations = {
|
|
2505
|
-
entityAssociations: ownEntityAssociations.filter(
|
|
2506
|
-
(entityAssociation) => entityAssociation.legalEntityId !== associatedTrustMember.legalEntityId
|
|
2507
|
-
)
|
|
2508
|
-
};
|
|
2509
|
-
await asyncMutation({ ...updatedTrustAssociations, id: trust.id });
|
|
2510
|
-
};
|
|
2511
|
-
const deleteUndefinedBeneficiary = async ({
|
|
2512
|
-
undefinedBeneficiary,
|
|
2513
|
-
trust,
|
|
2514
|
-
asyncMutation
|
|
2515
|
-
}) => {
|
|
2516
|
-
const existingUndefinedBeneficiaries = trust.trust?.undefinedBeneficiaryInfo ?? [];
|
|
2517
|
-
const updatedTrust = {
|
|
2518
|
-
trust: {
|
|
2519
|
-
undefinedBeneficiaryInfo: existingUndefinedBeneficiaries.filter(
|
|
2520
|
-
(ub) => ub.reference !== undefinedBeneficiary.reference
|
|
2521
|
-
)
|
|
2522
|
-
}
|
|
2523
|
-
};
|
|
2524
|
-
await asyncMutation({ ...updatedTrust, id: trust.id });
|
|
2525
|
-
};
|
|
2526
|
-
function useClickAwayListener(ref, onClickAway) {
|
|
2527
|
-
const handleClickAway = useCallback(
|
|
2528
|
-
(event) => {
|
|
2529
|
-
if (ref.current && !ref.current.contains(event.target)) {
|
|
2530
|
-
onClickAway();
|
|
2531
|
-
}
|
|
2532
|
-
},
|
|
2533
|
-
[ref, onClickAway]
|
|
2534
|
-
);
|
|
2535
|
-
useEffect(() => {
|
|
2536
|
-
document.addEventListener("mousedown", handleClickAway);
|
|
2537
|
-
return () => {
|
|
2538
|
-
document.removeEventListener("mousedown", handleClickAway);
|
|
2539
|
-
};
|
|
2540
|
-
}, [handleClickAway]);
|
|
2541
|
-
}
|
|
2542
|
-
const ClickAwayWrapper = ({ children, onClickAway, ...divProps }) => {
|
|
2543
|
-
const ref = useRef(null);
|
|
2544
|
-
useClickAwayListener(ref, onClickAway);
|
|
2545
|
-
return /* @__PURE__ */ jsx("div", { ref, ...divProps, children });
|
|
2546
|
-
};
|
|
2547
|
-
const actionsMenu = "adyen-kyc-actions-menu";
|
|
2548
|
-
const styles$2 = {
|
|
2549
|
-
actionsMenu
|
|
2550
|
-
};
|
|
2551
|
-
const ActionsMenu = ({ options, open, setOpen }) => {
|
|
2552
|
-
const menuItems = options.map(({ label, onSelect, icon }) => /* @__PURE__ */ jsx(
|
|
2553
|
-
Button,
|
|
2554
|
-
{
|
|
2555
|
-
onClick: (event) => {
|
|
2556
|
-
event.stopPropagation();
|
|
2557
|
-
setOpen(false);
|
|
2558
|
-
onSelect();
|
|
2559
|
-
},
|
|
2560
|
-
variant: "tertiary",
|
|
2561
|
-
icon,
|
|
2562
|
-
children: label
|
|
2563
|
-
},
|
|
2564
|
-
label
|
|
2565
|
-
));
|
|
2566
|
-
return open ? /* @__PURE__ */ jsx(ClickAwayWrapper, { onClickAway: () => setOpen(false), className: styles$2.actionsMenu, role: "menu", children: menuItems }) : null;
|
|
2567
|
-
};
|
|
2568
|
-
const EntityAssociation = ({
|
|
2569
|
-
name,
|
|
2570
|
-
types,
|
|
2571
|
-
status,
|
|
2572
|
-
actions,
|
|
2573
|
-
problems,
|
|
2574
|
-
infoContent,
|
|
2575
|
-
onNavigateToEntity,
|
|
2576
|
-
removeEntity,
|
|
2577
|
-
isRemoveDisabled = false,
|
|
2578
|
-
handleIsRemoveDisabled
|
|
2579
|
-
}) => {
|
|
2580
|
-
const { t } = useTranslation("common");
|
|
2581
|
-
const [showingActions, setShowingActions] = useState(false);
|
|
2582
|
-
const [isStatusRemoving, setIsStatusRemoving] = useState(false);
|
|
2583
|
-
return /* @__PURE__ */ jsxs(
|
|
2584
|
-
Card,
|
|
2585
|
-
{
|
|
2586
|
-
className: "adyen-kyc-entity-association",
|
|
2587
|
-
stateful: Boolean(onNavigateToEntity),
|
|
2588
|
-
onClick: onNavigateToEntity,
|
|
2589
|
-
onKeyDown: handleKeys(["Enter"], onNavigateToEntity ?? noop),
|
|
2590
|
-
children: [
|
|
2591
|
-
/* @__PURE__ */ jsxs("div", { className: "adyen-kyc-entity-association__top", children: [
|
|
2592
|
-
/* @__PURE__ */ jsx("h3", { className: "adyen-kyc-entity-association__title", children: name }),
|
|
2593
|
-
/* @__PURE__ */ jsxs("div", { className: "adyen-kyc-entity-association__info", children: [
|
|
2594
|
-
/* @__PURE__ */ jsx(TaskItemStatus, { status: isStatusRemoving ? TaskStatuses.REMOVING : status }),
|
|
2595
|
-
actions && /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-entity-association__actions", children: [
|
|
2596
|
-
/* @__PURE__ */ jsx(
|
|
2597
|
-
IconButton,
|
|
2598
|
-
{
|
|
2599
|
-
variant: "tertiary",
|
|
2600
|
-
icon: "more-horiz",
|
|
2601
|
-
onClick: (event) => {
|
|
2602
|
-
event.stopPropagation();
|
|
2603
|
-
setShowingActions(!showingActions);
|
|
2604
|
-
},
|
|
2605
|
-
ariaLabel: t(($) => $["toggleAssociationMenu"], { name })
|
|
2606
|
-
}
|
|
2607
|
-
),
|
|
2608
|
-
/* @__PURE__ */ jsx(ActionsMenu, { options: actions, open: showingActions, setOpen: setShowingActions })
|
|
2609
|
-
] }),
|
|
2610
|
-
typeof removeEntity === "function" && typeof handleIsRemoveDisabled === "function" && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-entity-association__remove", children: /* @__PURE__ */ jsx(
|
|
2611
|
-
Remove,
|
|
2612
|
-
{
|
|
2613
|
-
onRemove: removeEntity,
|
|
2614
|
-
onRemoveStatusChange: setIsStatusRemoving,
|
|
2615
|
-
isRemoveDisabled,
|
|
2616
|
-
handleIsRemoveDisabled
|
|
2617
|
-
}
|
|
2618
|
-
) })
|
|
2619
|
-
] })
|
|
2620
|
-
] }),
|
|
2621
|
-
/* @__PURE__ */ jsx("div", { children: types.map((type) => /* @__PURE__ */ jsx(
|
|
2622
|
-
Tag,
|
|
2623
|
-
{
|
|
2624
|
-
className: "adyen-kyc-entity-association__tag",
|
|
2625
|
-
variant: getRoleTagVariant(type),
|
|
2626
|
-
children: t(($) => $[getRoleName(type)])
|
|
2627
|
-
},
|
|
2628
|
-
type
|
|
2629
|
-
)) }),
|
|
2630
|
-
status === TaskStatuses.ERROR && /* @__PURE__ */ jsx(
|
|
2631
|
-
VerificationErrorAlert,
|
|
2632
|
-
{
|
|
2633
|
-
className: "adyen-kyc-entity-association-alert",
|
|
2634
|
-
problems
|
|
2635
|
-
}
|
|
2636
|
-
),
|
|
2637
|
-
infoContent
|
|
2638
|
-
]
|
|
2639
|
-
}
|
|
2640
|
-
);
|
|
2641
|
-
};
|
|
2642
|
-
const CompanyTrustMemberTaskItem = ({
|
|
2643
|
-
companyTrustMember,
|
|
2644
|
-
taskStatus,
|
|
2645
|
-
onEditOwner,
|
|
2646
|
-
onAddOwner,
|
|
2647
|
-
onEdit,
|
|
2648
|
-
onDelete
|
|
2649
|
-
}) => {
|
|
2650
|
-
const { i18n } = useI18nContext();
|
|
2651
|
-
const actions = [
|
|
2652
|
-
{
|
|
2653
|
-
icon: "edit",
|
|
2654
|
-
onSelect: onEdit,
|
|
2655
|
-
label: i18n.get("editTrustMember", { values: { trustMember: companyTrustMember.name } })
|
|
2656
|
-
},
|
|
2657
|
-
companyTrustMember.ownerId ? {
|
|
2658
|
-
icon: "edit",
|
|
2659
|
-
onSelect: onEditOwner,
|
|
2660
|
-
label: i18n.get("editOwnerOfTrustMember", {
|
|
2661
|
-
values: { trustMember: companyTrustMember.name }
|
|
2662
|
-
})
|
|
2663
|
-
} : {
|
|
2664
|
-
icon: "plus",
|
|
2665
|
-
onSelect: onAddOwner,
|
|
2666
|
-
label: i18n.get("addOwnerToTrustMember", {
|
|
2667
|
-
values: { trustMember: companyTrustMember.name }
|
|
2668
|
-
})
|
|
2669
|
-
},
|
|
2670
|
-
{
|
|
2671
|
-
icon: "bin",
|
|
2672
|
-
onSelect: onDelete,
|
|
2673
|
-
label: i18n.get("removeTrustMember", { values: { trustMember: companyTrustMember.name } })
|
|
2674
|
-
}
|
|
2675
|
-
];
|
|
2676
|
-
const infoContent = companyTrustMember.ownerId ? void 0 : /* @__PURE__ */ jsx(
|
|
2677
|
-
Alert,
|
|
2678
|
-
{
|
|
2679
|
-
title: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2680
|
-
i18n.get("helpUsVerifyCompany"),
|
|
2681
|
-
" ",
|
|
2682
|
-
/* @__PURE__ */ jsx(Button, { onClick: onAddOwner, variant: "link", children: i18n.get("providePersonalDetailsOfOwner") })
|
|
2683
|
-
] }),
|
|
2684
|
-
className: "add-owner-alert"
|
|
2685
|
-
}
|
|
2686
|
-
);
|
|
2687
|
-
return /* @__PURE__ */ jsx(
|
|
2688
|
-
EntityAssociation,
|
|
2689
|
-
{
|
|
2690
|
-
types: companyTrustMember.roles,
|
|
2691
|
-
name: companyTrustMember.name,
|
|
2692
|
-
status: taskStatus,
|
|
2693
|
-
actions,
|
|
2694
|
-
infoContent,
|
|
2695
|
-
onNavigateToEntity: onEdit
|
|
2696
|
-
},
|
|
2697
|
-
companyTrustMember.legalEntityId
|
|
2698
|
-
);
|
|
2699
|
-
};
|
|
2700
|
-
const ExemptSettlorTaskItem = ({
|
|
2701
|
-
exemptSettlor,
|
|
2702
|
-
taskStatus,
|
|
2703
|
-
onEdit,
|
|
2704
|
-
onDelete
|
|
2705
|
-
}) => {
|
|
2706
|
-
const { i18n } = useI18nContext();
|
|
2707
|
-
const settlorName = exemptSettlor.legalEntityType === LegalEntityTypes.INDIVIDUAL ? `${exemptSettlor.exemptSettlorName?.firstName} ${exemptSettlor.exemptSettlorName?.lastName}` : exemptSettlor.name ?? "";
|
|
2708
|
-
const actions = [
|
|
2709
|
-
{
|
|
2710
|
-
icon: "edit",
|
|
2711
|
-
onSelect: onEdit,
|
|
2712
|
-
label: i18n.get("editTrustMember", { values: { trustMember: settlorName } })
|
|
2713
|
-
},
|
|
2714
|
-
{
|
|
2715
|
-
icon: "bin",
|
|
2716
|
-
onSelect: onDelete,
|
|
2717
|
-
label: i18n.get("removeTrustMember", { values: { trustMember: settlorName } })
|
|
2718
|
-
}
|
|
2719
|
-
];
|
|
2720
|
-
return /* @__PURE__ */ jsx(
|
|
2721
|
-
EntityAssociation,
|
|
2722
|
-
{
|
|
2723
|
-
types: exemptSettlor.roles,
|
|
2724
|
-
name: settlorName,
|
|
2725
|
-
status: taskStatus,
|
|
2726
|
-
actions,
|
|
2727
|
-
onNavigateToEntity: onEdit
|
|
2728
|
-
},
|
|
2729
|
-
exemptSettlor.legalEntityId
|
|
2730
|
-
);
|
|
2731
|
-
};
|
|
2732
|
-
const RegularTrustMemberTaskItem = ({
|
|
2733
|
-
trustMember,
|
|
2734
|
-
taskStatus,
|
|
2735
|
-
onEdit,
|
|
2736
|
-
onDelete
|
|
2737
|
-
}) => {
|
|
2738
|
-
const { i18n } = useI18nContext();
|
|
2739
|
-
const actions = [
|
|
2740
|
-
{
|
|
2741
|
-
icon: "edit",
|
|
2742
|
-
onSelect: onEdit,
|
|
2743
|
-
label: i18n.get("editTrustMember", { values: { trustMember: trustMember.name } })
|
|
2744
|
-
},
|
|
2745
|
-
{
|
|
2746
|
-
icon: "bin",
|
|
2747
|
-
onSelect: onDelete,
|
|
2748
|
-
label: i18n.get("removeTrustMember", { values: { trustMember: trustMember.name } })
|
|
2749
|
-
}
|
|
2750
|
-
];
|
|
2751
|
-
return /* @__PURE__ */ jsx(
|
|
2752
|
-
EntityAssociation,
|
|
2753
|
-
{
|
|
2754
|
-
types: trustMember.roles,
|
|
2755
|
-
name: trustMember.name,
|
|
2756
|
-
status: taskStatus,
|
|
2757
|
-
actions,
|
|
2758
|
-
onNavigateToEntity: onEdit
|
|
2759
|
-
},
|
|
2760
|
-
trustMember.legalEntityId
|
|
2761
|
-
);
|
|
2762
|
-
};
|
|
2763
|
-
const RootTrusteeTaskItem = ({
|
|
2764
|
-
rootTrustee,
|
|
2765
|
-
taskStatus,
|
|
2766
|
-
onEdit
|
|
2767
|
-
}) => {
|
|
2768
|
-
const { i18n } = useI18nContext();
|
|
2769
|
-
const actions = [
|
|
2770
|
-
{
|
|
2771
|
-
icon: "edit",
|
|
2772
|
-
onSelect: onEdit,
|
|
2773
|
-
label: i18n.get("editTrustMember", { values: { trustMember: rootTrustee.name } })
|
|
2774
|
-
}
|
|
2775
|
-
];
|
|
2776
|
-
const { isExperimentEnabled } = useExperimentsContext();
|
|
2777
|
-
const isAllowMoreRolesForMainRootTrustee = isExperimentEnabled(
|
|
2778
|
-
"AllowMoreRolesForMainRootTrustee"
|
|
2779
|
-
);
|
|
2780
|
-
return /* @__PURE__ */ jsx(
|
|
2781
|
-
EntityAssociation,
|
|
2782
|
-
{
|
|
2783
|
-
types: isExperimentEnabled("AllowMoreRolesForMainRootTrustee") ? rootTrustee.roles : [TrustMemberTypes.TRUSTEE],
|
|
2784
|
-
name: rootTrustee.name,
|
|
2785
|
-
status: taskStatus,
|
|
2786
|
-
actions: isAllowMoreRolesForMainRootTrustee ? actions : void 0
|
|
2787
|
-
}
|
|
2788
|
-
);
|
|
2789
|
-
};
|
|
2790
|
-
const UndefinedBeneficiaryTaskItem = ({
|
|
2791
|
-
undefinedBeneficiary,
|
|
2792
|
-
onEdit,
|
|
2793
|
-
onDelete
|
|
2794
|
-
}) => {
|
|
2795
|
-
const { i18n } = useI18nContext();
|
|
2796
|
-
const actions = [
|
|
2797
|
-
{
|
|
2798
|
-
icon: "edit",
|
|
2799
|
-
onSelect: onEdit,
|
|
2800
|
-
label: i18n.get("editTrustMember", {
|
|
2801
|
-
values: { trustMember: i18n.get("undefinedBeneficiary") }
|
|
2802
|
-
})
|
|
2803
|
-
},
|
|
2804
|
-
{
|
|
2805
|
-
icon: "bin",
|
|
2806
|
-
onSelect: onDelete,
|
|
2807
|
-
label: i18n.get("removeTrustMember", {
|
|
2808
|
-
values: { trustMember: i18n.get("undefinedBeneficiary") }
|
|
2809
|
-
})
|
|
2810
|
-
}
|
|
2811
|
-
];
|
|
2812
|
-
return /* @__PURE__ */ jsx(
|
|
2813
|
-
EntityAssociation,
|
|
2814
|
-
{
|
|
2815
|
-
name: undefinedBeneficiary.description,
|
|
2816
|
-
types: [TrustMemberTypes.UNDEFINED_BENEFICIARY],
|
|
2817
|
-
status: TaskStatuses.FINISHED,
|
|
2818
|
-
actions,
|
|
2819
|
-
onNavigateToEntity: onEdit
|
|
2820
|
-
},
|
|
2821
|
-
undefinedBeneficiary.reference
|
|
2822
|
-
);
|
|
2823
|
-
};
|
|
2824
|
-
const TrustMembersOverview = ({
|
|
2825
|
-
navigateBackToTaskList,
|
|
2826
|
-
navigateToEditTrustMember,
|
|
2827
|
-
navigateToEditTrustMemberOwner
|
|
2828
|
-
}) => {
|
|
2829
|
-
const { data: rootLe, isLoading } = useLegalEntity(ROOT_LE);
|
|
2830
|
-
const { data: trustLe, refetch: refetchTrust } = useAssociatedLegalEntity(
|
|
2831
|
-
rootLe,
|
|
2832
|
-
LegalEntityTypes.TRUST
|
|
2833
|
-
);
|
|
2834
|
-
const trustMembers = useTrustMembers();
|
|
2835
|
-
const { mutateAsync: updateLegalEntity } = useUpdateLegalEntity();
|
|
2836
|
-
const { showToast } = useToastContext();
|
|
2837
|
-
const { i18n } = useI18nContext();
|
|
2838
|
-
if (isLoading || !rootLe || !trustLe) {
|
|
2839
|
-
return /* @__PURE__ */ jsx(Loader, { size: "large" });
|
|
2840
|
-
}
|
|
2841
|
-
const deleteTrustMember = async (trustMember) => {
|
|
2842
|
-
try {
|
|
2843
|
-
switch (trustMember.trustMemberType) {
|
|
2844
|
-
case "regular":
|
|
2845
|
-
case "exemptSettlor":
|
|
2846
|
-
case "company":
|
|
2847
|
-
await deleteAssociatedTrustMember({
|
|
2848
|
-
associatedTrustMember: trustMember,
|
|
2849
|
-
trust: trustLe,
|
|
2850
|
-
asyncMutation: updateLegalEntity
|
|
2851
|
-
});
|
|
2852
|
-
break;
|
|
2853
|
-
case "undefinedBeneficiary":
|
|
2854
|
-
await deleteUndefinedBeneficiary({
|
|
2855
|
-
undefinedBeneficiary: trustMember,
|
|
2856
|
-
trust: trustLe,
|
|
2857
|
-
asyncMutation: updateLegalEntity
|
|
2858
|
-
});
|
|
2859
|
-
break;
|
|
2860
|
-
case "rootTrustee":
|
|
2861
|
-
throw new Error("Cannot delete root trustee");
|
|
2862
|
-
}
|
|
2863
|
-
await refetchTrust();
|
|
2864
|
-
showToast({ variant: "success", label: i18n.get("successFullyRemovedTrustMember") });
|
|
2865
|
-
} catch {
|
|
2866
|
-
showToast({ variant: "error", label: i18n.get("failedToRemoveTrustMember") });
|
|
2867
|
-
}
|
|
2868
|
-
};
|
|
2869
|
-
return /* @__PURE__ */ jsx(
|
|
2870
|
-
TrustMembersOverviewInner,
|
|
2871
|
-
{
|
|
2872
|
-
trustMembers,
|
|
2873
|
-
deleteTrustMember,
|
|
2874
|
-
navigateBackToTaskList,
|
|
2875
|
-
navigateToEditTrustMember,
|
|
2876
|
-
navigateToEditTrustMemberOwner
|
|
2877
|
-
}
|
|
2878
|
-
);
|
|
2879
|
-
};
|
|
2880
|
-
const TrustMembersOverviewInner = ({
|
|
2881
|
-
trustMembers,
|
|
2882
|
-
deleteTrustMember,
|
|
2883
|
-
navigateBackToTaskList,
|
|
2884
|
-
navigateToEditTrustMember,
|
|
2885
|
-
navigateToEditTrustMemberOwner
|
|
2886
|
-
}) => {
|
|
2887
|
-
const { i18n } = useI18nContext();
|
|
2888
|
-
const { t } = useTranslation("common");
|
|
2889
|
-
const trustMemberRequirements = DEFAULT_TRUST_MEMBER_REQUIREMENTS;
|
|
2890
|
-
const trustMembersWithOneOfGivenRoles = (roleTypes) => trustMembers.filter(
|
|
2891
|
-
({ roles }) => roleTypes.some((label) => roles.includes(label))
|
|
2892
|
-
);
|
|
2893
|
-
const { isExperimentEnabled } = useExperimentsContext();
|
|
2894
|
-
const allowMoreRolesForMainRootTrustee = isExperimentEnabled("AllowMoreRolesForMainRootTrustee");
|
|
2895
|
-
const getTaskStatus2 = useGetTaskStatus();
|
|
2896
|
-
return /* @__PURE__ */ jsx(
|
|
2897
|
-
DropinLayout,
|
|
2898
|
-
{
|
|
2899
|
-
content: /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-trust-members adyen-kyc-u-width-full", children: [
|
|
2900
|
-
/* @__PURE__ */ jsx(
|
|
2901
|
-
FormHeader,
|
|
2902
|
-
{
|
|
2903
|
-
heading: i18n.get("trustMembers"),
|
|
2904
|
-
description: i18n.get("trustMembersDescription")
|
|
2905
|
-
}
|
|
2906
|
-
),
|
|
2907
|
-
/* @__PURE__ */ jsx("div", { className: "adyen-kyc-trust-members__container", children: trustMemberRequirements.map(({ roleTypes, min, label }) => /* @__PURE__ */ jsx(
|
|
2908
|
-
EntityGuidanceStatus,
|
|
2909
|
-
{
|
|
2910
|
-
country: CountryCodes.Australia,
|
|
2911
|
-
currentTask: TaskTypes.TRUST_MEMBER_OVERVIEW,
|
|
2912
|
-
entityLabel: label,
|
|
2913
|
-
status: iconStatus(trustMembersWithOneOfGivenRoles(roleTypes).length, min)
|
|
2914
|
-
},
|
|
2915
|
-
label
|
|
2916
|
-
)) }),
|
|
2917
|
-
/* @__PURE__ */ jsx(
|
|
2918
|
-
ContextGuidance,
|
|
2919
|
-
{
|
|
2920
|
-
title: i18n.get("whatIsTheDifferenceBetweenTheseRoles"),
|
|
2921
|
-
content: /* @__PURE__ */ jsx("ul", { className: "adyen-kyc-guidance-list", children: trustMemberRequirements.map(({ label }) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Trans, { t, ns: "common", i18nKey: ($) => $[`${label}GuideDescription`] }) }, label)) }),
|
|
2922
|
-
titleId: "whatIsTheDifferenceBetweenTheseRoles",
|
|
2923
|
-
contentId: "differenceBetweenTrustMemberRoles"
|
|
2924
|
-
}
|
|
2925
|
-
),
|
|
2926
|
-
/* @__PURE__ */ jsx(CardGroup, { children: trustMembers.map((trustMember) => {
|
|
2927
|
-
switch (trustMember.trustMemberType) {
|
|
2928
|
-
case "rootTrustee":
|
|
2929
|
-
return /* @__PURE__ */ jsx(
|
|
2930
|
-
RootTrusteeTaskItem,
|
|
2931
|
-
{
|
|
2932
|
-
rootTrustee: trustMember,
|
|
2933
|
-
taskStatus: getTaskStatus2(
|
|
2934
|
-
trustMember.legalEntityType == "organization" ? TaskTypes.TRUST_MEMBER_COMPANY : TaskTypes.TRUST_MEMBER_INDIVIDUAL,
|
|
2935
|
-
String(trustMember.legalEntityId)
|
|
2936
|
-
),
|
|
2937
|
-
onEdit: allowMoreRolesForMainRootTrustee ? () => navigateToEditTrustMember(trustMember) : () => {
|
|
2938
|
-
}
|
|
2939
|
-
},
|
|
2940
|
-
trustMember.legalEntityId
|
|
2941
|
-
);
|
|
2942
|
-
case "regular":
|
|
2943
|
-
return /* @__PURE__ */ jsx(
|
|
2944
|
-
RegularTrustMemberTaskItem,
|
|
2945
|
-
{
|
|
2946
|
-
trustMember,
|
|
2947
|
-
taskStatus: getTaskStatus2(
|
|
2948
|
-
TaskTypes.TRUST_MEMBER_INDIVIDUAL,
|
|
2949
|
-
String(trustMember.legalEntityId)
|
|
2950
|
-
),
|
|
2951
|
-
onEdit: () => navigateToEditTrustMember(trustMember),
|
|
2952
|
-
onDelete: () => deleteTrustMember(trustMember)
|
|
2953
|
-
},
|
|
2954
|
-
trustMember.legalEntityId
|
|
2955
|
-
);
|
|
2956
|
-
case "company":
|
|
2957
|
-
return /* @__PURE__ */ jsx(
|
|
2958
|
-
CompanyTrustMemberTaskItem,
|
|
2959
|
-
{
|
|
2960
|
-
companyTrustMember: trustMember,
|
|
2961
|
-
taskStatus: getTaskStatus2(
|
|
2962
|
-
TaskTypes.TRUST_MEMBER_COMPANY,
|
|
2963
|
-
String(trustMember.legalEntityId)
|
|
2964
|
-
),
|
|
2965
|
-
onEdit: () => navigateToEditTrustMember(trustMember),
|
|
2966
|
-
onDelete: () => deleteTrustMember(trustMember),
|
|
2967
|
-
onEditOwner: () => navigateToEditTrustMemberOwner(
|
|
2968
|
-
trustMember.ownerId,
|
|
2969
|
-
trustMember.legalEntityId
|
|
2970
|
-
),
|
|
2971
|
-
onAddOwner: () => navigateToEditTrustMemberOwner("", trustMember.legalEntityId)
|
|
2972
|
-
},
|
|
2973
|
-
trustMember.legalEntityId
|
|
2974
|
-
);
|
|
2975
|
-
case "exemptSettlor":
|
|
2976
|
-
return /* @__PURE__ */ jsx(
|
|
2977
|
-
ExemptSettlorTaskItem,
|
|
2978
|
-
{
|
|
2979
|
-
exemptSettlor: trustMember,
|
|
2980
|
-
taskStatus: getTaskStatus2(
|
|
2981
|
-
TaskTypes.TRUST_MEMBER_INDIVIDUAL,
|
|
2982
|
-
String(trustMember.legalEntityId)
|
|
2983
|
-
),
|
|
2984
|
-
onEdit: () => navigateToEditTrustMember(trustMember),
|
|
2985
|
-
onDelete: () => deleteTrustMember(trustMember)
|
|
2986
|
-
},
|
|
2987
|
-
trustMember.legalEntityId
|
|
2988
|
-
);
|
|
2989
|
-
case "undefinedBeneficiary":
|
|
2990
|
-
return /* @__PURE__ */ jsx(
|
|
2991
|
-
UndefinedBeneficiaryTaskItem,
|
|
2992
|
-
{
|
|
2993
|
-
undefinedBeneficiary: trustMember,
|
|
2994
|
-
onEdit: () => navigateToEditTrustMember(trustMember),
|
|
2995
|
-
onDelete: () => deleteTrustMember(trustMember)
|
|
2996
|
-
},
|
|
2997
|
-
trustMember.reference
|
|
2998
|
-
);
|
|
2999
|
-
}
|
|
3000
|
-
}) }),
|
|
3001
|
-
/* @__PURE__ */ jsx(
|
|
3002
|
-
Button,
|
|
3003
|
-
{
|
|
3004
|
-
variant: "secondary",
|
|
3005
|
-
icon: "plus",
|
|
3006
|
-
onClick: (e) => {
|
|
3007
|
-
e.stopPropagation();
|
|
3008
|
-
navigateToEditTrustMember("new");
|
|
3009
|
-
},
|
|
3010
|
-
children: i18n.get("addTrustMember")
|
|
3011
|
-
}
|
|
3012
|
-
),
|
|
3013
|
-
/* @__PURE__ */ jsx(
|
|
3014
|
-
ActionBar,
|
|
3015
|
-
{
|
|
3016
|
-
onHome: navigateBackToTaskList,
|
|
3017
|
-
homeButtonLabel: i18n.get("saveAndGoToOverview")
|
|
3018
|
-
}
|
|
3019
|
-
)
|
|
3020
|
-
] })
|
|
3021
|
-
}
|
|
3022
|
-
);
|
|
3023
|
-
};
|
|
3024
|
-
const createDefaultMember = (selectedMember, selectedEntityType, selectedRoles) => {
|
|
3025
|
-
const firstRole = selectedRoles?.[0];
|
|
3026
|
-
return {
|
|
3027
|
-
memberType: selectedMember?.memberType || firstRole,
|
|
3028
|
-
roles: selectedRoles || selectedMember?.roles || [UnincorporatedPartnershipMemberTypes.SECONDARY_PARTNER],
|
|
3029
|
-
legalEntityType: selectedEntityType,
|
|
3030
|
-
legalEntityId: selectedMember?.legalEntityId || "",
|
|
3031
|
-
name: selectedMember?.name || ""
|
|
3032
|
-
};
|
|
3033
|
-
};
|
|
3034
|
-
const useUnincorporatedPartnershipNavigation = ({ navigateTo }) => {
|
|
3035
|
-
const [activeMember, setActiveMember] = useState();
|
|
3036
|
-
const { rootLegalEntityId } = useApiContext();
|
|
3037
|
-
const onNavigateToMember = async ({
|
|
3038
|
-
selectedMember,
|
|
3039
|
-
selectedRoles,
|
|
3040
|
-
selectedEntityType,
|
|
3041
|
-
roleAndType
|
|
3042
|
-
}) => {
|
|
3043
|
-
const createdMember = createDefaultMember(selectedMember, selectedEntityType, selectedRoles);
|
|
3044
|
-
setActiveMember(createdMember);
|
|
3045
|
-
if (rootLegalEntityId.value === createdMember?.legalEntityId) {
|
|
3046
|
-
navigateTo(
|
|
3047
|
-
createdMember.legalEntityType === LegalEntityTypes.INDIVIDUAL ? TaskTypes.INDIVIDUAL : TaskTypes.BUSINESS_DETAILS
|
|
3048
|
-
);
|
|
3049
|
-
return;
|
|
3050
|
-
}
|
|
3051
|
-
if (roleAndType) {
|
|
3052
|
-
navigateTo(TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_ROLE_AND_TYPE);
|
|
3053
|
-
return;
|
|
3054
|
-
}
|
|
3055
|
-
navigateTo(
|
|
3056
|
-
createdMember?.legalEntityType === LegalEntityTypes.ORGANIZATION ? TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY : TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_INDIVIDUAL
|
|
3057
|
-
);
|
|
3058
|
-
};
|
|
3059
|
-
return {
|
|
3060
|
-
onNavigateToMember,
|
|
3061
|
-
activeMember,
|
|
3062
|
-
setActiveMember
|
|
3063
|
-
};
|
|
3064
|
-
};
|
|
3065
|
-
const adyenKycRoleAndTypeContainer = "adyen-kyc-adyen-kyc-role-and-type-container";
|
|
3066
|
-
const adyenKycRoleAndTypeActionBar = "adyen-kyc-adyen-kyc-role-and-type-action-bar";
|
|
3067
|
-
const inlineRadioGroup = "adyen-kyc-inline-radio-group";
|
|
3068
|
-
const styles$1 = {
|
|
3069
|
-
adyenKycRoleAndTypeContainer,
|
|
3070
|
-
adyenKycRoleAndTypeActionBar,
|
|
3071
|
-
inlineRadioGroup
|
|
3072
|
-
};
|
|
3073
|
-
const UnincorporatedPartnershipRadioGroup = ({
|
|
3074
|
-
memberType,
|
|
3075
|
-
errorMessage,
|
|
3076
|
-
handleChangeFor,
|
|
3077
|
-
value
|
|
3078
|
-
}) => {
|
|
3079
|
-
const { i18n } = useI18nContext();
|
|
3080
|
-
return /* @__PURE__ */ jsx(
|
|
3081
|
-
Field,
|
|
3082
|
-
{
|
|
3083
|
-
el: "fieldset",
|
|
3084
|
-
name: memberType,
|
|
3085
|
-
label: i18n.get(
|
|
3086
|
-
memberType === UnincorporatedPartnershipMemberTypes.OWNER ? "ownerDescriptionAsPartner" : "controllerDescriptionAsPartner"
|
|
3087
|
-
),
|
|
3088
|
-
className: styles$1.inlineRadioGroup,
|
|
3089
|
-
errorMessage,
|
|
3090
|
-
children: (childProps) => /* @__PURE__ */ jsx(
|
|
3091
|
-
RadioGroup,
|
|
3092
|
-
{
|
|
3093
|
-
...childProps,
|
|
3094
|
-
name: memberType,
|
|
3095
|
-
items: [
|
|
3096
|
-
{ id: "yes", name: "yes" },
|
|
3097
|
-
{ id: "no", name: "no" }
|
|
3098
|
-
],
|
|
3099
|
-
value,
|
|
3100
|
-
onChange: (id) => handleChangeFor(memberType)(
|
|
3101
|
-
id
|
|
3102
|
-
),
|
|
3103
|
-
horizontal: true
|
|
3104
|
-
}
|
|
3105
|
-
)
|
|
3106
|
-
}
|
|
3107
|
-
);
|
|
3108
|
-
};
|
|
3109
|
-
const unincorporatedPartnershipRoleAndTypeValidationRules = {
|
|
3110
|
-
entityType: {
|
|
3111
|
-
modes: ["blur"],
|
|
3112
|
-
validate: (entityType) => !isEmpty(entityType),
|
|
3113
|
-
errorMessage: "fieldIsRequired"
|
|
3114
|
-
},
|
|
3115
|
-
uboThroughControl: {
|
|
3116
|
-
modes: ["blur"],
|
|
3117
|
-
validate: (value) => !!value,
|
|
3118
|
-
errorMessage: "fieldIsRequired"
|
|
3119
|
-
},
|
|
3120
|
-
uboThroughOwnership: {
|
|
3121
|
-
modes: ["blur"],
|
|
3122
|
-
validate: (value) => !!value,
|
|
3123
|
-
errorMessage: "fieldIsRequired"
|
|
3124
|
-
}
|
|
3125
|
-
};
|
|
3126
|
-
const regularForms = {
|
|
3127
|
-
roleAndEntityType: {
|
|
3128
|
-
formId: "roleAndEntityType",
|
|
3129
|
-
formName: "roleAndEntityType",
|
|
3130
|
-
fields: ["role", "entityType"]
|
|
3131
|
-
},
|
|
3132
|
-
memberDetails: {
|
|
3133
|
-
formId: "memberDetails",
|
|
3134
|
-
formName: "memberDetails"
|
|
3135
|
-
}
|
|
3136
|
-
};
|
|
3137
|
-
const leTypeCardDetails = {
|
|
3138
|
-
[LegalEntityTypes.INDIVIDUAL]: {
|
|
3139
|
-
id: "individual",
|
|
3140
|
-
name: "individualMember",
|
|
3141
|
-
description: "partnerNotABusiness"
|
|
3142
|
-
},
|
|
3143
|
-
[LegalEntityTypes.ORGANIZATION]: {
|
|
3144
|
-
id: "organization",
|
|
3145
|
-
name: "companyMember",
|
|
3146
|
-
description: "partnerIsABusiness"
|
|
3147
|
-
}
|
|
3148
|
-
};
|
|
3149
|
-
function getUboStatus(roles, roleType, existingMember) {
|
|
3150
|
-
if (!existingMember) {
|
|
3151
|
-
return void 0;
|
|
3152
|
-
}
|
|
3153
|
-
return roles?.includes(roleType) ? "yes" : "no";
|
|
3154
|
-
}
|
|
3155
|
-
function UnincorporatedPartnershipRoleAndTypeDropin({
|
|
3156
|
-
onNavigateToMember,
|
|
3157
|
-
activeMember
|
|
3158
|
-
}) {
|
|
3159
|
-
const { t } = useTranslation(["common", "unincorpPartnership"]);
|
|
3160
|
-
const [shouldValidate, setShouldValidate] = useState(false);
|
|
3161
|
-
const activeForm = regularForms.roleAndEntityType;
|
|
3162
|
-
const formUtils = createFormUtils(
|
|
3163
|
-
{},
|
|
3164
|
-
t
|
|
3165
|
-
);
|
|
3166
|
-
const formsWithValidity = Object.values(regularForms).map((form) => ({
|
|
3167
|
-
formId: form.formId,
|
|
3168
|
-
formName: form.formName,
|
|
3169
|
-
isValid: false
|
|
3170
|
-
}));
|
|
3171
|
-
const existingMember = activeMember?.legalEntityId;
|
|
3172
|
-
const defaultData = {
|
|
3173
|
-
entityType: activeMember?.legalEntityType,
|
|
3174
|
-
uboThroughControl: getUboStatus(
|
|
3175
|
-
activeMember?.roles,
|
|
3176
|
-
UnincorporatedPartnershipMemberTypes.CONTROLLING_PERSON,
|
|
3177
|
-
existingMember
|
|
3178
|
-
),
|
|
3179
|
-
uboThroughOwnership: getUboStatus(
|
|
3180
|
-
activeMember?.roles,
|
|
3181
|
-
UnincorporatedPartnershipMemberTypes.OWNER,
|
|
3182
|
-
existingMember
|
|
3183
|
-
)
|
|
3184
|
-
};
|
|
3185
|
-
const decideFields = (data2) => {
|
|
3186
|
-
if (data2.entityType === LegalEntityTypes.INDIVIDUAL) {
|
|
3187
|
-
return ["entityType", "uboThroughControl", "uboThroughOwnership"];
|
|
3188
|
-
}
|
|
3189
|
-
return ["entityType"];
|
|
3190
|
-
};
|
|
3191
|
-
const { data, schema, errors, fieldProblems, handleChangeFor } = useForm({
|
|
3192
|
-
schema: decideFields,
|
|
3193
|
-
rules: unincorporatedPartnershipRoleAndTypeValidationRules,
|
|
3194
|
-
defaultData,
|
|
3195
|
-
shouldValidate
|
|
3196
|
-
});
|
|
3197
|
-
const onNextClick = () => {
|
|
3198
|
-
if (Object.values(data).some((fieldValue) => !fieldValue) && data.entityType !== LegalEntityTypes.ORGANIZATION) {
|
|
3199
|
-
setShouldValidate(true);
|
|
3200
|
-
return;
|
|
3201
|
-
}
|
|
3202
|
-
const selectedRoles = [
|
|
3203
|
-
UnincorporatedPartnershipMemberTypes.SECONDARY_PARTNER
|
|
3204
|
-
];
|
|
3205
|
-
if (data.entityType === LegalEntityTypes.INDIVIDUAL) {
|
|
3206
|
-
if (data.uboThroughControl === "yes") {
|
|
3207
|
-
selectedRoles.push(UnincorporatedPartnershipMemberTypes.CONTROLLING_PERSON);
|
|
3208
|
-
}
|
|
3209
|
-
if (data.uboThroughOwnership === "yes") {
|
|
3210
|
-
selectedRoles.push(UnincorporatedPartnershipMemberTypes.OWNER);
|
|
3211
|
-
}
|
|
3212
|
-
}
|
|
3213
|
-
onNavigateToMember({
|
|
3214
|
-
selectedMember: activeMember,
|
|
3215
|
-
selectedRoles,
|
|
3216
|
-
selectedEntityType: data.entityType
|
|
3217
|
-
});
|
|
3218
|
-
};
|
|
3219
|
-
return /* @__PURE__ */ jsxs("div", { className: styles$1.adyenKycRoleAndTypeContainer, children: [
|
|
3220
|
-
/* @__PURE__ */ jsx("div", { className: "adyen-kyc-dropin__sidebar-wrapper", children: /* @__PURE__ */ jsx(
|
|
3221
|
-
FormNavigation,
|
|
3222
|
-
{
|
|
3223
|
-
forms: formsWithValidity,
|
|
3224
|
-
activeForm: formsWithValidity.find((form) => form.formId === activeForm.formId) || formsWithValidity?.[0],
|
|
3225
|
-
taskName: "unincorporatedPartnershipMembers",
|
|
3226
|
-
gotoForm: () => {
|
|
3227
|
-
}
|
|
3228
|
-
}
|
|
3229
|
-
) }),
|
|
3230
|
-
/* @__PURE__ */ jsxs("div", { className: "adyen-kyc-form-container", children: [
|
|
3231
|
-
/* @__PURE__ */ jsx(
|
|
3232
|
-
"div",
|
|
3233
|
-
{
|
|
3234
|
-
className: "adyen-kyc-form-wrapper",
|
|
3235
|
-
children: /* @__PURE__ */ jsxs("form", { className: "adyen-kyc-trust__role-and-entity-type adyen-kyc-u-width-full", children: [
|
|
3236
|
-
/* @__PURE__ */ jsx(
|
|
3237
|
-
FormHeader,
|
|
3238
|
-
{
|
|
3239
|
-
heading: t(($) => $["roleAndEntityType"]),
|
|
3240
|
-
description: t(($) => $["partnerRoleDescription"], { ns: "unincorpPartnership" })
|
|
3241
|
-
}
|
|
3242
|
-
),
|
|
3243
|
-
/* @__PURE__ */ jsx(
|
|
3244
|
-
Field,
|
|
3245
|
-
{
|
|
3246
|
-
el: "fieldset",
|
|
3247
|
-
name: "entityType",
|
|
3248
|
-
label: formUtils.getLabel("entityType", "whatTypeOfEntityIsPartner"),
|
|
3249
|
-
errorMessage: formUtils.getErrorMessage("entityType", errors, fieldProblems),
|
|
3250
|
-
children: (childProps) => /* @__PURE__ */ jsx(
|
|
3251
|
-
RadioGroupCard,
|
|
3252
|
-
{
|
|
3253
|
-
...childProps,
|
|
3254
|
-
name: "entityType",
|
|
3255
|
-
options: trustMemberLegalEntityTypes,
|
|
3256
|
-
selected: data?.entityType,
|
|
3257
|
-
onSelect: (option) => handleChangeFor("entityType")(option),
|
|
3258
|
-
optionId: (option) => leTypeCardDetails[option].id,
|
|
3259
|
-
optionName: (option) => leTypeCardDetails[option].name,
|
|
3260
|
-
optionDescription: (option) => leTypeCardDetails[option].description,
|
|
3261
|
-
"aria-required": true
|
|
3262
|
-
}
|
|
3263
|
-
)
|
|
3264
|
-
}
|
|
3265
|
-
),
|
|
3266
|
-
schema.includes("uboThroughOwnership") && /* @__PURE__ */ jsx(
|
|
3267
|
-
UnincorporatedPartnershipRadioGroup,
|
|
3268
|
-
{
|
|
3269
|
-
memberType: UnincorporatedPartnershipMemberTypes.OWNER,
|
|
3270
|
-
handleChangeFor,
|
|
3271
|
-
errorMessage: formUtils.getErrorMessage(
|
|
3272
|
-
UnincorporatedPartnershipMemberTypes.OWNER,
|
|
3273
|
-
errors,
|
|
3274
|
-
fieldProblems
|
|
3275
|
-
),
|
|
3276
|
-
value: data?.uboThroughOwnership
|
|
3277
|
-
}
|
|
3278
|
-
),
|
|
3279
|
-
schema.includes("uboThroughControl") && /* @__PURE__ */ jsx(
|
|
3280
|
-
UnincorporatedPartnershipRadioGroup,
|
|
3281
|
-
{
|
|
3282
|
-
memberType: UnincorporatedPartnershipMemberTypes.CONTROLLING_PERSON,
|
|
3283
|
-
handleChangeFor,
|
|
3284
|
-
errorMessage: formUtils.getErrorMessage(
|
|
3285
|
-
UnincorporatedPartnershipMemberTypes.CONTROLLING_PERSON,
|
|
3286
|
-
errors,
|
|
3287
|
-
fieldProblems
|
|
3288
|
-
),
|
|
3289
|
-
value: data?.uboThroughControl
|
|
3290
|
-
}
|
|
3291
|
-
)
|
|
3292
|
-
] })
|
|
3293
|
-
}
|
|
3294
|
-
),
|
|
3295
|
-
/* @__PURE__ */ jsx("div", { className: styles$1.adyenKycRoleAndTypeActionBar, children: /* @__PURE__ */ jsx(Button, { onClick: onNextClick, children: t(($) => $["continue"]) }) })
|
|
3296
|
-
] })
|
|
3297
|
-
] });
|
|
3298
|
-
}
|
|
3299
|
-
function UnincorporatedPartnershipMemberRoleAndTypePage({
|
|
3300
|
-
memberId,
|
|
3301
|
-
onNavigateToMember,
|
|
3302
|
-
navigateBack
|
|
3303
|
-
}) {
|
|
3304
|
-
const { i18n } = useTranslation();
|
|
3305
|
-
const { data: memberLe } = useLegalEntity(memberId || skipToken);
|
|
3306
|
-
const unincorporatedPartnershipMembers = useUnincorporatedPartnershipMembers();
|
|
3307
|
-
addResourceBundles(i18n, i18n.language, [
|
|
3308
|
-
{
|
|
3309
|
-
ns: "unincorpPartnership",
|
|
3310
|
-
importFn: () => __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "../language/bg-BG.json": () => import("./bg-BG-hFblesn-.js"), "../language/cs-CZ.json": () => import("./cs-CZ-B8IPRc47.js"), "../language/da-DK.json": () => import("./da-DK-BTpZzEgA.js"), "../language/de-DE.json": () => import("./de-DE-DjOUNvp6.js"), "../language/el-GR.json": () => import("./el-GR-Cu9HwD-f.js"), "../language/en-US.json": () => import("./en-US-BTYdAWXp.js"), "../language/es-ES.json": () => import("./es-ES-Cj7q7fWO.js"), "../language/et-EE.json": () => import("./et-EE-Dor3enPS.js"), "../language/fi-FI.json": () => import("./fi-FI-BNcnKrJ9.js"), "../language/fr-FR.json": () => import("./fr-FR-Bn3D6mmY.js"), "../language/hr-HR.json": () => import("./hr-HR-CNzbyo9r.js"), "../language/hu-HU.json": () => import("./hu-HU-BSOiZA7a.js"), "../language/it-IT.json": () => import("./it-IT-DvM-9LpM.js"), "../language/ja-JP.json": () => import("./ja-JP-GXkLvnQ4.js"), "../language/lt-LT.json": () => import("./lt-LT-DNjXmQPv.js"), "../language/lv-LV.json": () => import("./lv-LV-ChOoZuhc.js"), "../language/nl-NL.json": () => import("./nl-NL-BHqiO21q.js"), "../language/no-NO.json": () => import("./no-NO-CKT9kLAH.js"), "../language/pl-PL.json": () => import("./pl-PL-D6heiKsH.js"), "../language/pt-PT.json": () => import("./pt-PT-D2elvnDU.js"), "../language/ro-RO.json": () => import("./ro-RO-DL9V1CMj.js"), "../language/sk-SK.json": () => import("./sk-SK-BSioQTMW.js"), "../language/sl-SI.json": () => import("./sl-SI-BylvpF-X.js"), "../language/sv-SE.json": () => import("./sv-SE-Dwz1yTrB.js") }), `../language/${i18n.language}.json`, 3)
|
|
3311
|
-
}
|
|
3312
|
-
]);
|
|
3313
|
-
if (memberId && !memberLe) {
|
|
3314
|
-
return /* @__PURE__ */ jsx(Loader, {});
|
|
3315
|
-
}
|
|
3316
|
-
const unincorporatedPartnershipMember = memberId ? unincorporatedPartnershipMembers.find((tm) => tm.legalEntityId === memberId) : void 0;
|
|
3317
|
-
return /* @__PURE__ */ jsx(
|
|
3318
|
-
UnincorporatedPartnershipRoleAndTypeDropin,
|
|
3319
|
-
{
|
|
3320
|
-
activeMember: unincorporatedPartnershipMember,
|
|
3321
|
-
onNavigateToMember,
|
|
3322
|
-
navigateBack
|
|
3323
|
-
}
|
|
3324
|
-
);
|
|
3325
|
-
}
|
|
3326
|
-
const alertHeader = "adyen-kyc-alert-header";
|
|
3327
|
-
const styles = {
|
|
3328
|
-
alertHeader
|
|
3329
|
-
};
|
|
3330
|
-
const isPrimaryPartner = (member) => member?.roles?.includes("primaryPartner");
|
|
3331
|
-
const isMemberMissingOwner = (member) => {
|
|
3332
|
-
return !isPrimaryPartner(member) && member.legalEntityType === LegalEntityTypes.ORGANIZATION && !member.ownerId;
|
|
3333
|
-
};
|
|
3334
|
-
const UnincorporatedPartnershipMembersOverview = ({
|
|
3335
|
-
navigateBackToTaskList,
|
|
3336
|
-
navigateToEditMember,
|
|
3337
|
-
navigateToEditMemberOwner
|
|
3338
|
-
}) => {
|
|
3339
|
-
const { i18n } = useI18nContext();
|
|
3340
|
-
const { i18n: i18next } = useTranslation();
|
|
3341
|
-
const { data: rootLe } = useLegalEntity(ROOT_LE);
|
|
3342
|
-
const { data: partnershipLe, refetch: refetchPartnership } = useAssociatedLegalEntity(
|
|
3343
|
-
rootLe,
|
|
3344
|
-
LegalEntityTypes.UNINCORPORATED_PARTNERSHIP
|
|
3345
|
-
);
|
|
3346
|
-
const partnershipMembers = useUnincorporatedPartnershipMembers();
|
|
3347
|
-
const { mutateAsync: updateLegalEntity } = useUpdateLegalEntity();
|
|
3348
|
-
const { setUnincorporatedPartnershipMembers } = useGlobalStore();
|
|
3349
|
-
addResourceBundles(i18next, i18next.language, [
|
|
3350
|
-
{
|
|
3351
|
-
ns: "unincorpPartnership",
|
|
3352
|
-
importFn: () => __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "../../language/bg-BG.json": () => import("./bg-BG-hFblesn-.js"), "../../language/cs-CZ.json": () => import("./cs-CZ-B8IPRc47.js"), "../../language/da-DK.json": () => import("./da-DK-BTpZzEgA.js"), "../../language/de-DE.json": () => import("./de-DE-DjOUNvp6.js"), "../../language/el-GR.json": () => import("./el-GR-Cu9HwD-f.js"), "../../language/en-US.json": () => import("./en-US-BTYdAWXp.js"), "../../language/es-ES.json": () => import("./es-ES-Cj7q7fWO.js"), "../../language/et-EE.json": () => import("./et-EE-Dor3enPS.js"), "../../language/fi-FI.json": () => import("./fi-FI-BNcnKrJ9.js"), "../../language/fr-FR.json": () => import("./fr-FR-Bn3D6mmY.js"), "../../language/hr-HR.json": () => import("./hr-HR-CNzbyo9r.js"), "../../language/hu-HU.json": () => import("./hu-HU-BSOiZA7a.js"), "../../language/it-IT.json": () => import("./it-IT-DvM-9LpM.js"), "../../language/ja-JP.json": () => import("./ja-JP-GXkLvnQ4.js"), "../../language/lt-LT.json": () => import("./lt-LT-DNjXmQPv.js"), "../../language/lv-LV.json": () => import("./lv-LV-ChOoZuhc.js"), "../../language/nl-NL.json": () => import("./nl-NL-BHqiO21q.js"), "../../language/no-NO.json": () => import("./no-NO-CKT9kLAH.js"), "../../language/pl-PL.json": () => import("./pl-PL-D6heiKsH.js"), "../../language/pt-PT.json": () => import("./pt-PT-D2elvnDU.js"), "../../language/ro-RO.json": () => import("./ro-RO-DL9V1CMj.js"), "../../language/sk-SK.json": () => import("./sk-SK-BSioQTMW.js"), "../../language/sl-SI.json": () => import("./sl-SI-BylvpF-X.js"), "../../language/sv-SE.json": () => import("./sv-SE-Dwz1yTrB.js") }), `../../language/${i18next.language}.json`, 4)
|
|
3353
|
-
}
|
|
3354
|
-
]);
|
|
3355
|
-
useEffect(
|
|
3356
|
-
() => setUnincorporatedPartnershipMembers(partnershipMembers),
|
|
3357
|
-
[partnershipMembers, setUnincorporatedPartnershipMembers]
|
|
3358
|
-
);
|
|
3359
|
-
const getTaskStatus2 = useGetTaskStatus();
|
|
3360
|
-
if (!rootLe || !partnershipLe) {
|
|
3361
|
-
return /* @__PURE__ */ jsx(Loader, { size: "large" });
|
|
3362
|
-
}
|
|
3363
|
-
const deleteMember = async (member) => {
|
|
3364
|
-
try {
|
|
3365
|
-
await deleteUnincorporatedPartnershipMember({
|
|
3366
|
-
associatedMember: member,
|
|
3367
|
-
unincorporatedPartnership: partnershipLe,
|
|
3368
|
-
updateLegalEntity
|
|
3369
|
-
});
|
|
3370
|
-
await refetchPartnership();
|
|
3371
|
-
} catch (error) {
|
|
3372
|
-
console.error(error);
|
|
3373
|
-
}
|
|
3374
|
-
};
|
|
3375
|
-
const getActions = (member) => {
|
|
3376
|
-
const baseActions = [
|
|
3377
|
-
{
|
|
3378
|
-
icon: "edit",
|
|
3379
|
-
onSelect: () => navigateToEditMember(member),
|
|
3380
|
-
label: i18n.get("editTrustMember", {
|
|
3381
|
-
values: { trustMember: member.name }
|
|
3382
|
-
})
|
|
3383
|
-
}
|
|
3384
|
-
];
|
|
3385
|
-
if (member.legalEntityType === LegalEntityTypes.ORGANIZATION && !isPrimaryPartner(member)) {
|
|
3386
|
-
const missingOwner = isMemberMissingOwner(member);
|
|
3387
|
-
baseActions.push({
|
|
3388
|
-
icon: missingOwner ? "plus" : "edit",
|
|
3389
|
-
onSelect: () => navigateToEditMemberOwner(member?.ownerId, member?.legalEntityId),
|
|
3390
|
-
label: i18n.get(missingOwner ? "addOwnerToTrustMember" : "editOwnerOfTrustMember", {
|
|
3391
|
-
values: { trustMember: member.name }
|
|
3392
|
-
})
|
|
3393
|
-
});
|
|
3394
|
-
}
|
|
3395
|
-
if (!isPrimaryPartner(member)) {
|
|
3396
|
-
baseActions.push({
|
|
3397
|
-
icon: "bin",
|
|
3398
|
-
onSelect: () => deleteMember(member),
|
|
3399
|
-
label: i18n.get("removeTrustMember", {
|
|
3400
|
-
values: { trustMember: member.name }
|
|
3401
|
-
})
|
|
3402
|
-
});
|
|
3403
|
-
}
|
|
3404
|
-
return baseActions;
|
|
3405
|
-
};
|
|
3406
|
-
const infoContent = (member) => /* @__PURE__ */ jsx(
|
|
3407
|
-
Alert,
|
|
3408
|
-
{
|
|
3409
|
-
className: styles.alertHeader,
|
|
3410
|
-
title: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3411
|
-
i18n.get("helpUsVerifyCompany"),
|
|
3412
|
-
" ",
|
|
3413
|
-
/* @__PURE__ */ jsx(
|
|
3414
|
-
Button,
|
|
3415
|
-
{
|
|
3416
|
-
onClick: (e) => {
|
|
3417
|
-
e.preventDefault();
|
|
3418
|
-
e.stopPropagation();
|
|
3419
|
-
navigateToEditMemberOwner(member?.ownerId, member?.legalEntityId);
|
|
3420
|
-
},
|
|
3421
|
-
variant: "link",
|
|
3422
|
-
children: i18n.get("providePersonalDetailsOfOwner")
|
|
3423
|
-
}
|
|
3424
|
-
)
|
|
3425
|
-
] })
|
|
3426
|
-
}
|
|
3427
|
-
);
|
|
3428
|
-
return /* @__PURE__ */ jsx(
|
|
3429
|
-
DropinLayout,
|
|
3430
|
-
{
|
|
3431
|
-
content: /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-u-width-full", children: [
|
|
3432
|
-
/* @__PURE__ */ jsx(
|
|
3433
|
-
FormHeader,
|
|
3434
|
-
{
|
|
3435
|
-
heading: i18n.get("partnershipMembers"),
|
|
3436
|
-
description: i18n.get("partnershipMembersDescription")
|
|
3437
|
-
}
|
|
3438
|
-
),
|
|
3439
|
-
/* @__PURE__ */ jsxs(CardGroup, { children: [
|
|
3440
|
-
partnershipMembers.map((member) => {
|
|
3441
|
-
return /* @__PURE__ */ jsx(
|
|
3442
|
-
EntityAssociation,
|
|
3443
|
-
{
|
|
3444
|
-
types: member.roles,
|
|
3445
|
-
name: member.name,
|
|
3446
|
-
status: getTaskStatus2(
|
|
3447
|
-
member.legalEntityType === LegalEntityTypes.INDIVIDUAL ? TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_INDIVIDUAL : TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY,
|
|
3448
|
-
member.legalEntityId
|
|
3449
|
-
),
|
|
3450
|
-
actions: getActions(member),
|
|
3451
|
-
onNavigateToEntity: () => navigateToEditMember(member),
|
|
3452
|
-
infoContent: isMemberMissingOwner(member) ? infoContent(member) : void 0
|
|
3453
|
-
},
|
|
3454
|
-
member.legalEntityId
|
|
3455
|
-
);
|
|
3456
|
-
}),
|
|
3457
|
-
/* @__PURE__ */ jsx(
|
|
3458
|
-
Button,
|
|
3459
|
-
{
|
|
3460
|
-
variant: "secondary",
|
|
3461
|
-
icon: "plus",
|
|
3462
|
-
onClick: () => navigateToEditMember(void 0),
|
|
3463
|
-
fullWidth: true,
|
|
3464
|
-
children: i18n.get("addPartner")
|
|
3465
|
-
}
|
|
3466
|
-
)
|
|
3467
|
-
] }),
|
|
3468
|
-
/* @__PURE__ */ jsx(
|
|
3469
|
-
ActionBar,
|
|
3470
|
-
{
|
|
3471
|
-
onHome: navigateBackToTaskList,
|
|
3472
|
-
homeButtonLabel: i18n.get("saveAndGoToOverview")
|
|
3473
|
-
}
|
|
3474
|
-
)
|
|
3475
|
-
] })
|
|
3476
|
-
}
|
|
3477
|
-
);
|
|
3478
|
-
};
|
|
3479
|
-
const useShouldShowIntroduction = ({
|
|
3480
|
-
legalEntity
|
|
3481
|
-
}) => {
|
|
3482
|
-
const canSeeIntroduction = useCanSeeIntroduction({ legalEntity });
|
|
3483
|
-
const { hasSeenIntroduction } = useHasSeenIntroduction({ legalEntityId: legalEntity.id });
|
|
3484
|
-
return canSeeIntroduction && !hasSeenIntroduction;
|
|
3485
|
-
};
|
|
3486
|
-
const useNavigation = ({ legalEntity, onNavigate }) => {
|
|
3487
|
-
const { isSettingEnabled } = useSettingsContext();
|
|
3488
|
-
const userEvents = useAnalyticsContext();
|
|
3489
|
-
const showServiceAgreementsFirst = isSettingEnabled(SettingNames.ShowServiceAgreementsFirst);
|
|
3490
|
-
const showBusinessFinancingFirst = isSettingEnabled(SettingNames.ShowBusinessFinancingFirst);
|
|
3491
|
-
const canChangeEntityType = isSettingEnabled(SettingNames.AllowLegalEntityTypeChange);
|
|
3492
|
-
const showIntroduction = useShouldShowIntroduction({ legalEntity });
|
|
3493
|
-
const { hasSeenSingpassSelection } = useHasSeenSingpassSelection({
|
|
3494
|
-
legalEntityId: legalEntity.id
|
|
3495
|
-
});
|
|
3496
|
-
const { accountHolder } = useAccountHolder();
|
|
3497
|
-
const { canSeeEntitySelection } = useCanSeeEntitySelection(legalEntity.id);
|
|
3498
|
-
const { isEligibleForSingpass } = useSingpassMyInfoLogin({
|
|
3499
|
-
legalEntity,
|
|
3500
|
-
accountHolder
|
|
3501
|
-
});
|
|
3502
|
-
const shouldShowSingpassSelection = isEligibleForSingpass && !hasSeenSingpassSelection;
|
|
3503
|
-
const [taskHistory, setTaskHistory] = useState(["default"]);
|
|
3504
|
-
const actualTasks = taskHistory.filter((task) => task !== "default");
|
|
3505
|
-
const handleNavigation = useCallback(
|
|
3506
|
-
(task) => {
|
|
3507
|
-
userEvents.updateBaseTrackingPayload({ task });
|
|
3508
|
-
onNavigate?.(task);
|
|
3509
|
-
},
|
|
3510
|
-
[onNavigate]
|
|
3511
|
-
);
|
|
3512
|
-
const navigateTo = useCallback(
|
|
3513
|
-
(task, deletePreviousHistory = false) => {
|
|
3514
|
-
const pushNewTask = () => setTaskHistory((taskHistory2) => deletePreviousHistory ? [task] : [...taskHistory2, task]);
|
|
3515
|
-
if (task === "default") {
|
|
3516
|
-
setTimeout(pushNewTask);
|
|
3517
|
-
} else {
|
|
3518
|
-
pushNewTask();
|
|
3519
|
-
handleNavigation(task);
|
|
3520
|
-
}
|
|
3521
|
-
},
|
|
3522
|
-
[handleNavigation]
|
|
3523
|
-
);
|
|
3524
|
-
const navigateBack = useCallback(
|
|
3525
|
-
(stepCount = 1) => {
|
|
3526
|
-
if (taskHistory.length <= 1) return;
|
|
3527
|
-
const prevTask = taskHistory[taskHistory.length - (stepCount + 1)];
|
|
3528
|
-
if (prevTask === "default") {
|
|
3529
|
-
throw Error("Cannot navigate back to 'default' task");
|
|
3530
|
-
}
|
|
3531
|
-
if (prevTask === TaskTypes.TASKS_OVERVIEW) {
|
|
3532
|
-
setTaskHistory([TaskTypes.TASKS_OVERVIEW]);
|
|
3533
|
-
handleNavigation?.(TaskTypes.TASKS_OVERVIEW);
|
|
3534
|
-
return;
|
|
3535
|
-
}
|
|
3536
|
-
setTaskHistory(taskHistory.slice(0, -1 * stepCount));
|
|
3537
|
-
handleNavigation?.(prevTask);
|
|
3538
|
-
userEvents.updateBaseTrackingPayload({ task: prevTask });
|
|
3539
|
-
},
|
|
3540
|
-
[taskHistory, handleNavigation]
|
|
3541
|
-
);
|
|
3542
|
-
useEffect(() => {
|
|
3543
|
-
if (!window.history.state) window.history.pushState({}, "");
|
|
3544
|
-
const handleBrowserBackButton = () => {
|
|
3545
|
-
if (window.history.state === null) window.history.pushState({}, "");
|
|
3546
|
-
navigateTo(TaskTypes.TASKS_OVERVIEW);
|
|
3547
|
-
};
|
|
3548
|
-
window.addEventListener("popstate", handleBrowserBackButton);
|
|
3549
|
-
return () => {
|
|
3550
|
-
window.removeEventListener("popstate", handleBrowserBackButton);
|
|
3551
|
-
};
|
|
3552
|
-
}, [navigateTo]);
|
|
3553
|
-
useEffect(() => {
|
|
3554
|
-
const pushedTask = taskHistory[taskHistory.length - 1];
|
|
3555
|
-
if (pushedTask === "default") {
|
|
3556
|
-
const defaultTask = getDefaultTask({
|
|
3557
|
-
legalEntity,
|
|
3558
|
-
canSeeEntitySelection,
|
|
3559
|
-
showIntroduction,
|
|
3560
|
-
canChangeEntityType,
|
|
3561
|
-
shouldShowSingpassSelection,
|
|
3562
|
-
showServiceAgreementsFirst,
|
|
3563
|
-
showBusinessFinancingFirst
|
|
3564
|
-
});
|
|
3565
|
-
setTaskHistory([...taskHistory.slice(0, taskHistory.length - 1), defaultTask]);
|
|
3566
|
-
}
|
|
3567
|
-
}, [
|
|
3568
|
-
legalEntity,
|
|
3569
|
-
accountHolder,
|
|
3570
|
-
showIntroduction,
|
|
3571
|
-
canChangeEntityType,
|
|
3572
|
-
shouldShowSingpassSelection,
|
|
3573
|
-
showServiceAgreementsFirst,
|
|
3574
|
-
taskHistory,
|
|
3575
|
-
showBusinessFinancingFirst
|
|
3576
|
-
]);
|
|
3577
|
-
return {
|
|
3578
|
-
currentTask: actualTasks[actualTasks.length - 1],
|
|
3579
|
-
previousTask: actualTasks[actualTasks.length - 2],
|
|
3580
|
-
navigateBack,
|
|
3581
|
-
navigateTo
|
|
3582
|
-
};
|
|
3583
|
-
};
|
|
3584
|
-
const getDefaultTask = ({
|
|
3585
|
-
legalEntity,
|
|
3586
|
-
canSeeEntitySelection,
|
|
3587
|
-
canChangeEntityType,
|
|
3588
|
-
showIntroduction,
|
|
3589
|
-
shouldShowSingpassSelection,
|
|
3590
|
-
showServiceAgreementsFirst,
|
|
3591
|
-
showBusinessFinancingFirst
|
|
3592
|
-
}) => {
|
|
3593
|
-
const hasLegalEntityProgressedBeyondEntitySelection = hasProgressedBeyondEntitySelection(legalEntity);
|
|
3594
|
-
if (showServiceAgreementsFirst) {
|
|
3595
|
-
return TaskTypes.SERVICE_AGREEMENT;
|
|
3596
|
-
}
|
|
3597
|
-
if (showBusinessFinancingFirst) {
|
|
3598
|
-
return TaskTypes.BUSINESS_FINANCING;
|
|
3599
|
-
}
|
|
3600
|
-
if (canChangeEntityType && canSeeEntitySelection && !hasLegalEntityProgressedBeyondEntitySelection)
|
|
3601
|
-
return TaskTypes.BUSINESS_TYPE_SELECTION;
|
|
3602
|
-
if (showIntroduction) return TaskTypes.INTRODUCTION;
|
|
3603
|
-
if (shouldShowSingpassSelection) return TaskTypes.SINGPASS_SELECTION;
|
|
3604
|
-
return TaskTypes.TASKS_OVERVIEW;
|
|
3605
|
-
};
|
|
3606
|
-
const hasProgressedBeyondEntitySelection = (legalEntity) => {
|
|
3607
|
-
const hasOwnEntityAssocation = legalEntity.entityAssociations?.some(
|
|
3608
|
-
(ea) => ea.associatorId === legalEntity.id
|
|
3609
|
-
);
|
|
3610
|
-
const hasOrganizationType = legalEntity.organization?.type;
|
|
3611
|
-
return hasOwnEntityAssocation || !!hasOrganizationType;
|
|
3612
|
-
};
|
|
3613
|
-
const Introduction = lazy(
|
|
3614
|
-
async () => (await import("./Introduction-Dekg5qYo.js")).Introduction
|
|
3615
|
-
);
|
|
3616
|
-
const BusinessTypeSelectionPage = lazy(
|
|
3617
|
-
async () => (await import("./BusinessTypeSelectionPage-cA2bpq2g.js")).BusinessTypeSelectionPage
|
|
3618
|
-
);
|
|
3619
|
-
const SingpassSelection = lazy(
|
|
3620
|
-
async () => (await import("./SingpassSelection-Ba5I6QIT.js")).SingpassSelection
|
|
3621
|
-
);
|
|
3622
|
-
const AccountSetupRejected = lazy(
|
|
3623
|
-
async () => (await import("./AccountSetupRejected-CTRKTCIy.js")).AccountSetupRejected
|
|
3624
|
-
);
|
|
3625
|
-
const DecisionMakers = lazy(
|
|
3626
|
-
async () => (await import("./DecisionMakers-vOa33-7u.js")).DecisionMakers
|
|
3627
|
-
);
|
|
3628
|
-
const CustomerSupport = lazy(
|
|
3629
|
-
async () => (await import("./CustomerSupport-CE5FGUuM.js")).CustomerSupport
|
|
3630
|
-
);
|
|
3631
|
-
const Review = lazy(async () => (await import("./Review-KJya8jDh.js")).Review);
|
|
3632
|
-
const SignPCIComponent = lazy(
|
|
3633
|
-
async () => (await import("./SignPCIComponent-TDythDLu.js")).SignPCIComponent
|
|
3634
|
-
);
|
|
3635
|
-
const AcceptTermsOfService = lazy(
|
|
3636
|
-
async () => (await import("./AcceptTermsOfServiceComponent-BX6X0BUP.js")).AcceptTermsOfServiceComponent
|
|
3637
|
-
);
|
|
3638
|
-
const TaxReportingDropin = lazy(
|
|
3639
|
-
async () => (await import("./TaxReportingDropin-CN94V8po.js")).TaxReportingDropin
|
|
3640
|
-
);
|
|
3641
|
-
const PayoutDetailsPage = lazy(
|
|
3642
|
-
async () => (await import("./PayoutDetailsDropin-gEQIVa-_.js").then((n) => n.a)).PayoutDetailsPage
|
|
3643
|
-
);
|
|
3644
|
-
const RootBusinessDetailsPage = lazy(
|
|
3645
|
-
async () => (await import("./RootBusinessDetailsPage-D7jcycWp.js")).RootBusinessDetailsPage
|
|
3646
|
-
);
|
|
3647
|
-
const SoleProprietorshipPage = lazy(
|
|
3648
|
-
async () => (await import("./SoleProprietorshipPage-CyFrpYBH.js")).SoleProprietorshipPage
|
|
3649
|
-
);
|
|
3650
|
-
const TrustMemberCompanyPage = lazy(
|
|
3651
|
-
async () => (await import("./TrustMemberCompanyPage-CA8r7z8j.js")).TrustMemberCompanyPage
|
|
3652
|
-
);
|
|
3653
|
-
const UnincorporatedPartnershipMemberCompanyPage = lazy(
|
|
3654
|
-
async () => (await import("./UnincorporatedPartnershipMemberCompanyPage-YBViXOCI.js")).UnincorporatedPartnershipMemberCompanyPage
|
|
3655
|
-
);
|
|
3656
|
-
const BusinessFinancingPage = lazy(
|
|
3657
|
-
async () => (await import("./BusinessFinancingPage-C0Uu9ymj.js")).BusinessFinancingPage
|
|
3658
|
-
);
|
|
3659
|
-
const TrustDetailsPage = lazy(
|
|
3660
|
-
async () => (await import("./TrustDetailsPage-CZWseCEm.js")).TrustDetailsPage
|
|
3661
|
-
);
|
|
3662
|
-
const SourceOfFundsPage = lazy(
|
|
3663
|
-
async () => (await import("./SourceOfFundsPage-Bfm1rSfQ.js")).SourceOfFundsPage
|
|
3664
|
-
);
|
|
3665
|
-
const RootIndividualDetailsPage = lazy(
|
|
3666
|
-
async () => (await import("./RootIndividualDetailsPage-Z7OWhMNa.js")).RootIndividualDetailsPage
|
|
3667
|
-
);
|
|
3668
|
-
const LegalRepresentativeDetailsPage = lazy(
|
|
3669
|
-
async () => (await import("./LegalRepresentativeDetailsPage-DwcLwFbT.js")).LegalRepresentativeDetailsPage
|
|
3670
|
-
);
|
|
3671
|
-
const TrustMemberIndividualPage = lazy(
|
|
3672
|
-
async () => (await import("./TrustMemberIndividualPage-DSSEL22O.js")).TrustMemberIndividualPage
|
|
3673
|
-
);
|
|
3674
|
-
const UnincorporatedPartnershipIndividualPage = lazy(
|
|
3675
|
-
async () => (await import("./UnincorporatedPartnershipIndividualPage-BFgJl-aO.js")).UnincorporatedPartnershipIndividualPage
|
|
3676
|
-
);
|
|
3677
|
-
const DecisionMakerDetailsPage = lazy(
|
|
3678
|
-
async () => (await import("./DecisionMakerDetailsPage-CGbNrGr4.js")).DecisionMakerDetailsPage
|
|
3679
|
-
);
|
|
3680
|
-
function isIn(values, x) {
|
|
3681
|
-
return values.includes(x);
|
|
3682
|
-
}
|
|
3683
|
-
const PAGES_WITH_POLLING = [TaskTypes.DECISION_MAKER_OVERVIEW, TaskTypes.TASKS_OVERVIEW];
|
|
3684
|
-
const logger = createLogger();
|
|
3685
|
-
function DropinComposer({
|
|
3686
|
-
legalEntityResponse,
|
|
3687
|
-
onSubmit,
|
|
3688
|
-
onNavigate = noop,
|
|
3689
|
-
openBankingPartnerConfigId
|
|
3690
|
-
}) {
|
|
3691
|
-
const { accountHolder, setAccountHolder } = useAccountHolder();
|
|
3692
|
-
const { setCanSeeEntitySelection } = useCanSeeEntitySelection(legalEntityResponse.id);
|
|
3693
|
-
const userEvents = useAnalyticsContext();
|
|
3694
|
-
const { experiments } = useExperimentsContext();
|
|
3695
|
-
const { setHasSeenSingpassSelection } = useHasSeenSingpassSelection({
|
|
3696
|
-
legalEntityId: legalEntityResponse.id
|
|
3697
|
-
});
|
|
3698
|
-
const { setHasSeenIntroduction } = useHasSeenIntroduction({
|
|
3699
|
-
legalEntityId: legalEntityResponse.id
|
|
3700
|
-
});
|
|
3701
|
-
const { currentTask, previousTask, navigateTo, navigateBack } = useNavigation({
|
|
3702
|
-
legalEntity: legalEntityResponse,
|
|
3703
|
-
onNavigate
|
|
3704
|
-
});
|
|
3705
|
-
const {
|
|
3706
|
-
rootLegalEntity: rootLegalEntitySignal,
|
|
3707
|
-
rootLegalEntityCountry: rootLegalEntityCountrySignal,
|
|
3708
|
-
taskTypes: taskTypesSignal,
|
|
3709
|
-
setRootLegalEntity,
|
|
3710
|
-
setTaskTypes,
|
|
3711
|
-
setAccountHolder: setAccountHolderInGlobalStore
|
|
3712
|
-
} = useGlobalStore();
|
|
3713
|
-
const rootLegalEntity = rootLegalEntitySignal.value;
|
|
3714
|
-
const rootLegalEntityCountry = rootLegalEntityCountrySignal.value;
|
|
3715
|
-
const taskTypes = taskTypesSignal.value;
|
|
3716
|
-
const { data: rawTaskTypes, isLoading: isLoadingConfiguration } = useTaskTypes();
|
|
3717
|
-
useEffect(() => {
|
|
3718
|
-
if (rawTaskTypes) setTaskTypes(rawTaskTypes);
|
|
3719
|
-
}, [rawTaskTypes, setTaskTypes]);
|
|
3720
|
-
const { data: legalEntityData, refetch: refetchLegalEntity } = useLegalEntity(
|
|
3721
|
-
legalEntityResponse.id,
|
|
3722
|
-
{
|
|
3723
|
-
refetchInterval: (query) => {
|
|
3724
|
-
const legalEntityData2 = query.state.data;
|
|
3725
|
-
if (legalEntityData2) {
|
|
3726
|
-
return !currentTask || !isIn(PAGES_WITH_POLLING, currentTask) || hasAllCapabilitiesResolved(legalEntityData2) || hasRejectedCapabilities(legalEntityData2) ? false : 3e3;
|
|
3727
|
-
}
|
|
3728
|
-
return 3e3;
|
|
3729
|
-
}
|
|
3730
|
-
}
|
|
3731
|
-
);
|
|
3732
|
-
useEffect(() => {
|
|
3733
|
-
if (legalEntityData && !objectsDeepEqual(legalEntityData, rootLegalEntity)) {
|
|
3734
|
-
setRootLegalEntity(legalEntityData);
|
|
3735
|
-
}
|
|
3736
|
-
}, [legalEntityData]);
|
|
3737
|
-
const [currentTransferInstrumentId, setCurrentTransferInstrumentId] = useState();
|
|
3738
|
-
const {
|
|
3739
|
-
isEligibleForSingpass,
|
|
3740
|
-
state: singpassLoginState,
|
|
3741
|
-
handleInitiateSingpassMyInfoLogin,
|
|
3742
|
-
handleSingpassMyInfoLoginSuccess,
|
|
3743
|
-
handleSingpassMyInfoLoginFailure,
|
|
3744
|
-
handleSingpassMyInfoLoginReset,
|
|
3745
|
-
trustedFields: singpassTrustedFields,
|
|
3746
|
-
trustedEntityAssociations
|
|
3747
|
-
} = useSingpassMyInfoLogin({
|
|
3748
|
-
legalEntity: rootLegalEntity,
|
|
3749
|
-
accountHolder
|
|
3750
|
-
});
|
|
3751
|
-
const singpassTabRef = useRef(null);
|
|
3752
|
-
const { data: trust, refetch: refetchTrust } = useAssociatedLegalEntity(
|
|
3753
|
-
rootLegalEntity,
|
|
3754
|
-
LegalEntityTypes.TRUST
|
|
3755
|
-
);
|
|
3756
|
-
const { data: unincorporatedPartnership, refetch: refetchUnincorporatedPartnership } = useAssociatedLegalEntity(rootLegalEntity, LegalEntityTypes.UNINCORPORATED_PARTNERSHIP);
|
|
3757
|
-
const { data: soleProp } = useAssociatedLegalEntity(
|
|
3758
|
-
rootLegalEntity,
|
|
3759
|
-
LegalEntityTypes.SOLE_PROPRIETORSHIP
|
|
3760
|
-
);
|
|
3761
|
-
const [parentId, setParentId] = useState();
|
|
3762
|
-
const [currentDecisionMakerId, setCurrentDecisionMakerId] = useState();
|
|
3763
|
-
const { data: currentDecisionMaker } = useLegalEntity(currentDecisionMakerId ?? skipToken);
|
|
3764
|
-
const associatedLegalRepresentative = useAssociatedLegalRepresentative(rootLegalEntity);
|
|
3765
|
-
const [targetLegalEntityType, setTargetLegalEntityType] = useState();
|
|
3766
|
-
const {
|
|
3767
|
-
trustMember,
|
|
3768
|
-
trustMemberId,
|
|
3769
|
-
onNavigateToTrust,
|
|
3770
|
-
onNavigateToTrustMemberRoleAndType,
|
|
3771
|
-
onNavigateToTrustMemberEditDetails
|
|
3772
|
-
} = useTrustMemberNavigation({
|
|
3773
|
-
trust,
|
|
3774
|
-
navigateTo
|
|
3775
|
-
});
|
|
3776
|
-
const {
|
|
3777
|
-
onNavigateToMember,
|
|
3778
|
-
activeMember: unincorporatedPartnershipMember,
|
|
3779
|
-
setActiveMember
|
|
3780
|
-
} = useUnincorporatedPartnershipNavigation({
|
|
3781
|
-
navigateTo
|
|
3782
|
-
});
|
|
3783
|
-
const handleSingpassSelectionNextClick = async (method) => {
|
|
3784
|
-
if (method === "singpass") {
|
|
3785
|
-
try {
|
|
3786
|
-
const authUrl = await handleInitiateSingpassMyInfoLogin();
|
|
3787
|
-
if (!authUrl) {
|
|
3788
|
-
throw new Error("OpenId authentication url not");
|
|
3789
|
-
}
|
|
3790
|
-
setHasSeenSingpassSelection(true);
|
|
3791
|
-
singpassTabRef.current = window.open(authUrl, "_blank");
|
|
3792
|
-
singpassTabRef.current?.focus();
|
|
3793
|
-
} catch (e) {
|
|
3794
|
-
logger.error(e);
|
|
3795
|
-
if (typeof e === "string") handleSingpassMyInfoLoginFailure(e);
|
|
3796
|
-
}
|
|
3797
|
-
}
|
|
3798
|
-
if (method === "manual") {
|
|
3799
|
-
setHasSeenSingpassSelection(true);
|
|
3800
|
-
}
|
|
3801
|
-
navigateTo(TaskTypes.TASKS_OVERVIEW);
|
|
3802
|
-
};
|
|
3803
|
-
const onNavigateToDecisionMakerIndividual = async (task, id, parentId2) => {
|
|
3804
|
-
setParentId(parentId2 ?? rootLegalEntity.id);
|
|
3805
|
-
setCurrentDecisionMakerId(id);
|
|
3806
|
-
navigateTo(task);
|
|
3807
|
-
};
|
|
3808
|
-
const onNavigateToPayinOrPayout = async (id, task = TaskTypes.PAYOUT) => {
|
|
3809
|
-
if (id) {
|
|
3810
|
-
try {
|
|
3811
|
-
setCurrentTransferInstrumentId(id);
|
|
3812
|
-
} finally {
|
|
3813
|
-
navigateTo(task);
|
|
3814
|
-
}
|
|
3815
|
-
} else {
|
|
3816
|
-
setCurrentTransferInstrumentId(void 0);
|
|
3817
|
-
navigateTo(task);
|
|
3818
|
-
}
|
|
3819
|
-
};
|
|
3820
|
-
const onNavigateToTask = async (task, id) => {
|
|
3821
|
-
switch (task) {
|
|
3822
|
-
case TaskTypes.PAYOUT:
|
|
3823
|
-
await onNavigateToPayinOrPayout(id, TaskTypes.PAYOUT);
|
|
3824
|
-
break;
|
|
3825
|
-
case TaskTypes.PAYIN:
|
|
3826
|
-
await onNavigateToPayinOrPayout(id, TaskTypes.PAYIN);
|
|
3827
|
-
break;
|
|
3828
|
-
case TaskTypes.TRUST: {
|
|
3829
|
-
await onNavigateToTrust();
|
|
3830
|
-
break;
|
|
3831
|
-
}
|
|
3832
|
-
case TaskTypes.TRUST_MEMBER_OVERVIEW: {
|
|
3833
|
-
await onNavigateToTrust(TaskTypes.TRUST_MEMBER_OVERVIEW);
|
|
3834
|
-
break;
|
|
3835
|
-
}
|
|
3836
|
-
case TaskTypes.SOLE_PROPRIETOR_COMPANY: {
|
|
3837
|
-
await navigateTo(TaskTypes.SOLE_PROPRIETOR_COMPANY);
|
|
3838
|
-
break;
|
|
3839
|
-
}
|
|
3840
|
-
default:
|
|
3841
|
-
navigateTo(task);
|
|
3842
|
-
}
|
|
3843
|
-
};
|
|
3844
|
-
const handleOnSubmit = async (data, backStepCount) => {
|
|
3845
|
-
onSubmit?.(data);
|
|
3846
|
-
await refetchLegalEntity();
|
|
3847
|
-
navigateBack(backStepCount);
|
|
3848
|
-
};
|
|
3849
|
-
useEffect(() => {
|
|
3850
|
-
userEvents.addJourneyEvent("Landed on page", { actionType: "start" });
|
|
3851
|
-
}, []);
|
|
3852
|
-
useEffect(() => {
|
|
3853
|
-
userEvents.updateBaseTrackingPayload({ task: currentTask });
|
|
3854
|
-
}, [currentTask]);
|
|
3855
|
-
useEffect(() => {
|
|
3856
|
-
if (hasRejectedCapabilities(rootLegalEntity)) {
|
|
3857
|
-
navigateTo(TaskTypes.CAPABILITY_REJECTED, true);
|
|
3858
|
-
}
|
|
3859
|
-
}, [rootLegalEntity]);
|
|
3860
|
-
useEffect(() => {
|
|
3861
|
-
const newAccountHolder = getDefaultAccountHolderType(rootLegalEntity, false, accountHolder);
|
|
3862
|
-
if (newAccountHolder !== accountHolder) setAccountHolder(newAccountHolder);
|
|
3863
|
-
}, [accountHolder, rootLegalEntity]);
|
|
3864
|
-
useEffect(() => setAccountHolderInGlobalStore(accountHolder), [accountHolder]);
|
|
3865
|
-
const { rootLegalEntityId } = useApiContext();
|
|
3866
|
-
rootLegalEntityId.value = rootLegalEntity.id;
|
|
3867
|
-
useEffect(() => {
|
|
3868
|
-
const enabledExperimentNames = Object.entries(experiments).filter(([key, value]) => key.includes("_") && value).map(([key]) => key);
|
|
3869
|
-
if (!enabledExperimentNames.length) return;
|
|
3870
|
-
enabledExperimentNames.forEach((experiment) => {
|
|
3871
|
-
const [name, variant] = experiment.split("_");
|
|
3872
|
-
userEvents.trackExperiment({ name, variant });
|
|
3873
|
-
});
|
|
3874
|
-
}, [experiments]);
|
|
3875
|
-
const singpassBanner = isEligibleForSingpass ? /* @__PURE__ */ jsx(
|
|
3876
|
-
SingpassBanner,
|
|
3877
|
-
{
|
|
3878
|
-
...singpassLoginState,
|
|
3879
|
-
onAlertClose: () => {
|
|
3880
|
-
handleSingpassMyInfoLoginReset();
|
|
3881
|
-
},
|
|
3882
|
-
onClick: async () => {
|
|
3883
|
-
try {
|
|
3884
|
-
const authUrl = await handleInitiateSingpassMyInfoLogin();
|
|
3885
|
-
singpassTabRef.current = window.open(authUrl);
|
|
3886
|
-
singpassTabRef.current?.focus();
|
|
3887
|
-
} catch (e) {
|
|
3888
|
-
logger.error(e);
|
|
3889
|
-
if (typeof e === "string") handleSingpassMyInfoLoginFailure(e);
|
|
3890
|
-
}
|
|
3891
|
-
},
|
|
3892
|
-
onMessage: async ({ data: { isSuccessful } }) => {
|
|
3893
|
-
if (isSuccessful) {
|
|
3894
|
-
handleSingpassMyInfoLoginSuccess();
|
|
3895
|
-
await refetchLegalEntity();
|
|
3896
|
-
singpassTabRef.current?.close();
|
|
3897
|
-
} else {
|
|
3898
|
-
handleSingpassMyInfoLoginFailure(
|
|
3899
|
-
legalEntityResponse.type === LegalEntityTypes.INDIVIDUAL ? "weCouldntConnectToMyinfo" : "weCouldntConnectToMyinfoBusiness"
|
|
3900
|
-
);
|
|
3901
|
-
}
|
|
3902
|
-
},
|
|
3903
|
-
legalEntityType: legalEntityResponse?.type
|
|
3904
|
-
}
|
|
3905
|
-
) : void 0;
|
|
3906
|
-
if (isLoadingConfiguration) {
|
|
3907
|
-
return /* @__PURE__ */ jsx(Skeleton, {});
|
|
3908
|
-
}
|
|
3909
|
-
switch (currentTask) {
|
|
3910
|
-
case TaskTypes.BUSINESS_TYPE_SELECTION:
|
|
3911
|
-
return /* @__PURE__ */ jsx("div", { className: "adyen-kyc-u-display-flex adyen-kyc-u-justify-content-center", children: /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
3912
|
-
BusinessTypeSelectionPage,
|
|
3913
|
-
{
|
|
3914
|
-
onComplete: async (newAccountHolder) => {
|
|
3915
|
-
setAccountHolder(newAccountHolder);
|
|
3916
|
-
setCanSeeEntitySelection(false);
|
|
3917
|
-
await refetchLegalEntity();
|
|
3918
|
-
navigateTo("default");
|
|
3919
|
-
},
|
|
3920
|
-
onBack: previousTask ? navigateBack : void 0
|
|
3921
|
-
}
|
|
3922
|
-
) }) });
|
|
3923
|
-
case TaskTypes.SINGPASS_SELECTION:
|
|
3924
|
-
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
3925
|
-
SingpassSelection,
|
|
3926
|
-
{
|
|
3927
|
-
handleNextClick: handleSingpassSelectionNextClick,
|
|
3928
|
-
accountHolder,
|
|
3929
|
-
legalEntityType: rootLegalEntity.type
|
|
3930
|
-
}
|
|
3931
|
-
) });
|
|
3932
|
-
case TaskTypes.INTRODUCTION:
|
|
3933
|
-
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
3934
|
-
Introduction,
|
|
3935
|
-
{
|
|
3936
|
-
onExitIntroduction: () => {
|
|
3937
|
-
setHasSeenIntroduction(true);
|
|
3938
|
-
navigateTo("default");
|
|
3939
|
-
},
|
|
3940
|
-
tasks: taskTypes
|
|
3941
|
-
}
|
|
3942
|
-
) });
|
|
3943
|
-
case TaskTypes.CAPABILITY_REJECTED:
|
|
3944
|
-
return /* @__PURE__ */ jsxs(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: [
|
|
3945
|
-
/* @__PURE__ */ jsx(AccountSetupRejected, {}),
|
|
3946
|
-
";"
|
|
3947
|
-
] });
|
|
3948
|
-
case TaskTypes.TASKS_OVERVIEW:
|
|
3949
|
-
return /* @__PURE__ */ jsx(TaskList, { onNavigateToTask, singpassComponent: singpassBanner });
|
|
3950
|
-
case TaskTypes.DECISION_MAKER_OVERVIEW:
|
|
3951
|
-
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
3952
|
-
DecisionMakers,
|
|
3953
|
-
{
|
|
3954
|
-
onNavigateToIndividual: (legalEntityId) => onNavigateToDecisionMakerIndividual(TaskTypes.DECISION_MAKER, legalEntityId),
|
|
3955
|
-
navigateBackToTaskList: navigateBack,
|
|
3956
|
-
trustedEntityAssociations
|
|
3957
|
-
}
|
|
3958
|
-
) });
|
|
3959
|
-
case TaskTypes.INDIVIDUAL:
|
|
3960
|
-
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
3961
|
-
RootIndividualDetailsPage,
|
|
3962
|
-
{
|
|
3963
|
-
onSubmit: async (data) => {
|
|
3964
|
-
onSubmit?.(data);
|
|
3965
|
-
await refetchLegalEntity();
|
|
3966
|
-
navigateTo(TaskTypes.TASKS_OVERVIEW);
|
|
3967
|
-
setTargetLegalEntityType(void 0);
|
|
3968
|
-
},
|
|
3969
|
-
handleHomeClick: () => navigateTo(TaskTypes.TASKS_OVERVIEW),
|
|
3970
|
-
isTargetLegalEntityType: targetLegalEntityType === LegalEntityTypes.INDIVIDUAL,
|
|
3971
|
-
trustedFields: singpassTrustedFields,
|
|
3972
|
-
trustedFieldsProvider: isEligibleForSingpass ? TrustedFieldsProviders.SINGPASS : void 0
|
|
3973
|
-
}
|
|
3974
|
-
) });
|
|
3975
|
-
case TaskTypes.CUSTOMER_SUPPORT:
|
|
3976
|
-
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
3977
|
-
CustomerSupport,
|
|
3978
|
-
{
|
|
3979
|
-
country: rootLegalEntityCountry,
|
|
3980
|
-
onSubmit: () => navigateTo(TaskTypes.TASKS_OVERVIEW)
|
|
3981
|
-
}
|
|
3982
|
-
) });
|
|
3983
|
-
case TaskTypes.REVIEW:
|
|
3984
|
-
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(Review, { handleHomeClick: () => navigateTo(TaskTypes.TASKS_OVERVIEW) }) });
|
|
3985
|
-
case TaskTypes.DECISION_MAKER:
|
|
3986
|
-
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
3987
|
-
DecisionMakerDetailsPage,
|
|
3988
|
-
{
|
|
3989
|
-
decisionMakerId: currentDecisionMaker?.id,
|
|
3990
|
-
parentCompanyId: parentId,
|
|
3991
|
-
onSubmit: async (data, scenario) => {
|
|
3992
|
-
onSubmit?.(data);
|
|
3993
|
-
await refetchLegalEntity();
|
|
3994
|
-
if (isBafinSignatoryFlow({
|
|
3995
|
-
taskType: TaskTypes.DECISION_MAKER,
|
|
3996
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
3997
|
-
// @ts-ignore basicDetails will be there when it's IndividualOnfidoSchema
|
|
3998
|
-
data,
|
|
3999
|
-
scenarios: scenario
|
|
4000
|
-
})) {
|
|
4001
|
-
showIdNowModal.value = true;
|
|
4002
|
-
} else {
|
|
4003
|
-
navigateBack();
|
|
4004
|
-
}
|
|
4005
|
-
},
|
|
4006
|
-
handleHomeClick: navigateBack,
|
|
4007
|
-
trustedFields: singpassTrustedFields,
|
|
4008
|
-
trustedFieldsProvider: isEligibleForSingpass ? TrustedFieldsProviders.SINGPASS : void 0,
|
|
4009
|
-
trustedRoles: trustedEntityAssociations.find((ea) => ea.reference === currentDecisionMaker?.id)?.types || []
|
|
4010
|
-
}
|
|
4011
|
-
) });
|
|
4012
|
-
case TaskTypes.TRUST_MEMBER_COMPANY_OWNER:
|
|
4013
|
-
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
4014
|
-
DecisionMakerDetailsPage,
|
|
4015
|
-
{
|
|
4016
|
-
taskType: TaskTypes.TRUST_MEMBER_COMPANY_OWNER,
|
|
4017
|
-
parentCompanyId: parentId,
|
|
4018
|
-
decisionMakerId: currentDecisionMakerId,
|
|
4019
|
-
onSubmit: async (data) => {
|
|
4020
|
-
await handleOnSubmit(data);
|
|
4021
|
-
await refetchTrust();
|
|
4022
|
-
},
|
|
4023
|
-
handleHomeClick: navigateBack
|
|
4024
|
-
}
|
|
4025
|
-
) });
|
|
4026
|
-
case TaskTypes.TRUST_MEMBER_INDIVIDUAL:
|
|
4027
|
-
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
4028
|
-
TrustMemberIndividualPage,
|
|
4029
|
-
{
|
|
4030
|
-
memberId: trustMemberId,
|
|
4031
|
-
trustId: trust.id,
|
|
4032
|
-
newMember: trustMember?.legalEntityId === isNewEntity ? trustMember : void 0,
|
|
4033
|
-
onSubmit: async (data) => {
|
|
4034
|
-
await handleOnSubmit(data, 2);
|
|
4035
|
-
await refetchTrust();
|
|
4036
|
-
},
|
|
4037
|
-
handleBackClick: navigateBack,
|
|
4038
|
-
handleHomeClick: () => navigateTo(TaskTypes.TRUST_MEMBER_OVERVIEW)
|
|
4039
|
-
}
|
|
4040
|
-
) });
|
|
4041
|
-
case TaskTypes.TRUST_MEMBER_COMPANY:
|
|
4042
|
-
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
4043
|
-
TrustMemberCompanyPage,
|
|
4044
|
-
{
|
|
4045
|
-
trustId: trust.id,
|
|
4046
|
-
trustMemberCompanyId: trustMemberId,
|
|
4047
|
-
newMember: trustMember?.legalEntityId === isNewEntity ? trustMember : void 0,
|
|
4048
|
-
onSubmit: async (data) => {
|
|
4049
|
-
await handleOnSubmit(data, 2);
|
|
4050
|
-
await refetchTrust();
|
|
4051
|
-
},
|
|
4052
|
-
handleHomeClick: navigateBack,
|
|
4053
|
-
isTargetLegalEntityType: targetLegalEntityType === LegalEntityTypes.ORGANIZATION
|
|
4054
|
-
}
|
|
4055
|
-
) });
|
|
4056
|
-
case TaskTypes.BUSINESS_DETAILS:
|
|
4057
|
-
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
4058
|
-
RootBusinessDetailsPage,
|
|
4059
|
-
{
|
|
4060
|
-
onSubmit: async (data) => {
|
|
4061
|
-
onSubmit?.(data);
|
|
4062
|
-
await refetchLegalEntity();
|
|
4063
|
-
navigateTo(TaskTypes.TASKS_OVERVIEW);
|
|
4064
|
-
setTargetLegalEntityType(void 0);
|
|
4065
|
-
},
|
|
4066
|
-
handleHomeClick: navigateBack,
|
|
4067
|
-
isTargetLegalEntityType: targetLegalEntityType === LegalEntityTypes.ORGANIZATION
|
|
4068
|
-
}
|
|
4069
|
-
) });
|
|
4070
|
-
case TaskTypes.PAYOUT:
|
|
4071
|
-
case TaskTypes.PAYIN:
|
|
4072
|
-
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
4073
|
-
PayoutDetailsPage,
|
|
4074
|
-
{
|
|
4075
|
-
taskType: currentTask,
|
|
4076
|
-
transferInstrumentId: currentTransferInstrumentId,
|
|
4077
|
-
setTransferInstrumentId: setCurrentTransferInstrumentId,
|
|
4078
|
-
handleHomeClick: navigateBack,
|
|
4079
|
-
openBankingPartnerConfigId,
|
|
4080
|
-
onSubmit: handleOnSubmit
|
|
4081
|
-
}
|
|
4082
|
-
) });
|
|
4083
|
-
case TaskTypes.TRUST:
|
|
4084
|
-
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
4085
|
-
TrustDetailsPage,
|
|
4086
|
-
{
|
|
4087
|
-
taskType: TaskTypes.TRUST,
|
|
4088
|
-
trustId: trust?.id,
|
|
4089
|
-
onSubmit: (data) => handleOnSubmit(data, 1),
|
|
4090
|
-
handleHomeClick: navigateBack
|
|
4091
|
-
}
|
|
4092
|
-
) });
|
|
4093
|
-
case TaskTypes.TRUST_MEMBER_OVERVIEW:
|
|
4094
|
-
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
4095
|
-
TrustMembersOverview,
|
|
4096
|
-
{
|
|
4097
|
-
navigateBackToTaskList: navigateBack,
|
|
4098
|
-
navigateToEditTrustMember: onNavigateToTrustMemberRoleAndType,
|
|
4099
|
-
navigateToEditTrustMemberOwner: (trustMemberOwnerId, trustMemberId2) => onNavigateToDecisionMakerIndividual(
|
|
4100
|
-
TaskTypes.TRUST_MEMBER_COMPANY_OWNER,
|
|
4101
|
-
trustMemberOwnerId,
|
|
4102
|
-
trustMemberId2
|
|
4103
|
-
)
|
|
4104
|
-
}
|
|
4105
|
-
) });
|
|
4106
|
-
case TaskTypes.TRUST_MEMBER_ROLE_AND_TYPE:
|
|
4107
|
-
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
4108
|
-
TrustMemberRoleAndTypePage,
|
|
4109
|
-
{
|
|
4110
|
-
trustId: trust.id,
|
|
4111
|
-
memberId: trustMemberId,
|
|
4112
|
-
navigateToFullDropinFor: onNavigateToTrustMemberEditDetails,
|
|
4113
|
-
navigateBack: async () => {
|
|
4114
|
-
await refetchTrust();
|
|
4115
|
-
navigateBack();
|
|
4116
|
-
}
|
|
4117
|
-
}
|
|
4118
|
-
) });
|
|
4119
|
-
case TaskTypes.UNINCORPORATED_PARTNERSHIP:
|
|
4120
|
-
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
4121
|
-
TrustDetailsPage,
|
|
4122
|
-
{
|
|
4123
|
-
taskType: TaskTypes.UNINCORPORATED_PARTNERSHIP,
|
|
4124
|
-
trustId: unincorporatedPartnership?.id,
|
|
4125
|
-
onSubmit: (data) => handleOnSubmit(data, 1),
|
|
4126
|
-
handleHomeClick: navigateBack
|
|
4127
|
-
}
|
|
4128
|
-
) });
|
|
4129
|
-
case TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_OVERVIEW:
|
|
4130
|
-
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
4131
|
-
UnincorporatedPartnershipMembersOverview,
|
|
4132
|
-
{
|
|
4133
|
-
navigateBackToTaskList: navigateBack,
|
|
4134
|
-
navigateToEditMember: (member) => onNavigateToMember({
|
|
4135
|
-
selectedMember: member,
|
|
4136
|
-
selectedEntityType: member?.legalEntityType,
|
|
4137
|
-
selectedRoles: member?.roles,
|
|
4138
|
-
roleAndType: true
|
|
4139
|
-
}),
|
|
4140
|
-
navigateToEditMemberOwner: (memberOwnerId, memberId) => {
|
|
4141
|
-
setActiveMember({ legalEntityId: memberId });
|
|
4142
|
-
onNavigateToDecisionMakerIndividual(
|
|
4143
|
-
TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY_OWNER,
|
|
4144
|
-
memberOwnerId,
|
|
4145
|
-
memberId
|
|
4146
|
-
);
|
|
4147
|
-
}
|
|
4148
|
-
}
|
|
4149
|
-
) });
|
|
4150
|
-
case TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY:
|
|
4151
|
-
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
4152
|
-
UnincorporatedPartnershipMemberCompanyPage,
|
|
4153
|
-
{
|
|
4154
|
-
partnershipId: unincorporatedPartnership.id,
|
|
4155
|
-
partnershipMemberCompanyId: unincorporatedPartnershipMember?.legalEntityId,
|
|
4156
|
-
newMember: (
|
|
4157
|
-
// empty string for legalEntityId means it's a new member
|
|
4158
|
-
unincorporatedPartnershipMember?.legalEntityId === "" ? unincorporatedPartnershipMember : void 0
|
|
4159
|
-
),
|
|
4160
|
-
onSubmit: (data) => handleOnSubmit(data, 2),
|
|
4161
|
-
handleHomeClick: navigateBack,
|
|
4162
|
-
isTargetLegalEntityType: targetLegalEntityType === LegalEntityTypes.ORGANIZATION
|
|
4163
|
-
}
|
|
4164
|
-
) });
|
|
4165
|
-
case TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY_OWNER:
|
|
4166
|
-
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
4167
|
-
DecisionMakerDetailsPage,
|
|
4168
|
-
{
|
|
4169
|
-
taskType: TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY_OWNER,
|
|
4170
|
-
parentCompanyId: unincorporatedPartnershipMember?.legalEntityId,
|
|
4171
|
-
decisionMakerId: currentDecisionMakerId,
|
|
4172
|
-
onSubmit: async (data) => {
|
|
4173
|
-
await handleOnSubmit(data);
|
|
4174
|
-
await refetchUnincorporatedPartnership();
|
|
4175
|
-
},
|
|
4176
|
-
handleHomeClick: navigateBack
|
|
4177
|
-
}
|
|
4178
|
-
) });
|
|
4179
|
-
case TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_INDIVIDUAL:
|
|
4180
|
-
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
4181
|
-
UnincorporatedPartnershipIndividualPage,
|
|
4182
|
-
{
|
|
4183
|
-
memberId: unincorporatedPartnershipMember?.legalEntityId,
|
|
4184
|
-
partnershipId: unincorporatedPartnership.id,
|
|
4185
|
-
member: unincorporatedPartnershipMember,
|
|
4186
|
-
onSubmit: (data) => {
|
|
4187
|
-
handleOnSubmit(data, 2);
|
|
4188
|
-
refetchUnincorporatedPartnership();
|
|
4189
|
-
},
|
|
4190
|
-
handleBackClick: navigateBack,
|
|
4191
|
-
handleHomeClick: () => navigateTo(TaskTypes.TRUST_MEMBER_OVERVIEW)
|
|
4192
|
-
}
|
|
4193
|
-
) });
|
|
4194
|
-
case TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_ROLE_AND_TYPE:
|
|
4195
|
-
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
4196
|
-
UnincorporatedPartnershipMemberRoleAndTypePage,
|
|
4197
|
-
{
|
|
4198
|
-
memberId: unincorporatedPartnershipMember?.legalEntityId,
|
|
4199
|
-
onNavigateToMember,
|
|
4200
|
-
navigateBack: async () => {
|
|
4201
|
-
await refetchUnincorporatedPartnership();
|
|
4202
|
-
navigateBack();
|
|
4203
|
-
}
|
|
4204
|
-
}
|
|
4205
|
-
) });
|
|
4206
|
-
case TaskTypes.PCI_DSS:
|
|
4207
|
-
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(SignPCIComponent, { onClose: navigateBack }) });
|
|
4208
|
-
case TaskTypes.SOLE_PROPRIETOR_COMPANY:
|
|
4209
|
-
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
4210
|
-
SoleProprietorshipPage,
|
|
4211
|
-
{
|
|
4212
|
-
solePropId: soleProp?.id,
|
|
4213
|
-
onSubmit: (data) => handleOnSubmit(data, 1),
|
|
4214
|
-
handleHomeClick: navigateBack,
|
|
4215
|
-
isTargetLegalEntityType: targetLegalEntityType === LegalEntityTypes.ORGANIZATION
|
|
4216
|
-
}
|
|
4217
|
-
) });
|
|
4218
|
-
case TaskTypes.SERVICE_AGREEMENT:
|
|
4219
|
-
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
4220
|
-
AcceptTermsOfService,
|
|
4221
|
-
{
|
|
4222
|
-
legalEntityId: rootLegalEntity.id,
|
|
4223
|
-
onClose: navigateBack,
|
|
4224
|
-
asEmbedded: false,
|
|
4225
|
-
handleAddSigner: () => {
|
|
4226
|
-
onNavigateToDecisionMakerIndividual(TaskTypes.DECISION_MAKER);
|
|
4227
|
-
}
|
|
4228
|
-
}
|
|
4229
|
-
) });
|
|
4230
|
-
case TaskTypes.LEGAL_REPRESENTATIVE_DETAILS:
|
|
4231
|
-
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
4232
|
-
LegalRepresentativeDetailsPage,
|
|
4233
|
-
{
|
|
4234
|
-
legalRepresentativeId: associatedLegalRepresentative?.id,
|
|
4235
|
-
onSubmit: handleOnSubmit,
|
|
4236
|
-
handleHomeClick: navigateBack
|
|
4237
|
-
}
|
|
4238
|
-
) });
|
|
4239
|
-
case TaskTypes.SOURCE_OF_FUNDS:
|
|
4240
|
-
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
4241
|
-
SourceOfFundsPage,
|
|
4242
|
-
{
|
|
4243
|
-
onSubmit: handleOnSubmit,
|
|
4244
|
-
handleHomeClick: () => navigateTo(TaskTypes.TASKS_OVERVIEW)
|
|
4245
|
-
}
|
|
4246
|
-
) });
|
|
4247
|
-
case TaskTypes.BUSINESS_FINANCING:
|
|
4248
|
-
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
4249
|
-
BusinessFinancingPage,
|
|
4250
|
-
{
|
|
4251
|
-
onSubmit: async (data) => {
|
|
4252
|
-
onSubmit?.(data);
|
|
4253
|
-
await refetchLegalEntity();
|
|
4254
|
-
navigateTo(TaskTypes.TASKS_OVERVIEW);
|
|
4255
|
-
},
|
|
4256
|
-
handleHomeClick: () => navigateTo(TaskTypes.TASKS_OVERVIEW)
|
|
4257
|
-
}
|
|
4258
|
-
) });
|
|
4259
|
-
case TaskTypes.TAX_REPORTING:
|
|
4260
|
-
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(TaxReportingDropin, { handleHomeClick: () => navigateTo(TaskTypes.TASKS_OVERVIEW) }) });
|
|
4261
|
-
case TaskTypes.BUSINESS_LINES:
|
|
4262
|
-
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(RootBusinessLinesPage, { handleHomeClick: () => navigateTo(TaskTypes.TASKS_OVERVIEW) }) });
|
|
4263
|
-
default:
|
|
4264
|
-
return null;
|
|
4265
|
-
}
|
|
4266
|
-
}
|
|
4267
|
-
function OnboardingDropinComponent({
|
|
4268
|
-
legalEntityId,
|
|
4269
|
-
openBankingPartnerConfigId
|
|
4270
|
-
}) {
|
|
4271
|
-
if (!legalEntityId) {
|
|
4272
|
-
throw new Error("Must provide at-least legalEntityId");
|
|
4273
|
-
}
|
|
4274
|
-
const { i18n } = useTranslation();
|
|
4275
|
-
addResourceBundles(i18n, i18n.language, [
|
|
4276
|
-
{
|
|
4277
|
-
ns: "common",
|
|
4278
|
-
importFn: () => __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "../../../language/locales/bg-BG.json": () => import("./bg-BG-CW9c658c.js"), "../../../language/locales/cs-CZ.json": () => import("./cs-CZ-dU9fnQ1g.js"), "../../../language/locales/da-DK.json": () => import("./da-DK-BJ7aTPir.js"), "../../../language/locales/de-DE.json": () => import("./de-DE-C78RLE2G.js"), "../../../language/locales/el-GR.json": () => import("./el-GR-BZRKurtr.js"), "../../../language/locales/en-US.instructions.json": () => import("./en-US.instructions-Ddr7AO05.js"), "../../../language/locales/en-US.json": () => import("./StoreProvider-BWVRmzZI.js").then((n) => n.bN), "../../../language/locales/es-ES.json": () => import("./es-ES-BtUSEzkE.js"), "../../../language/locales/et-EE.json": () => import("./et-EE-BCnK305R.js"), "../../../language/locales/fi-FI.json": () => import("./fi-FI-Cvar63RH.js"), "../../../language/locales/fr-FR.json": () => import("./fr-FR-B5543Fe-.js"), "../../../language/locales/hr-HR.json": () => import("./hr-HR-ZreFlbK9.js"), "../../../language/locales/hu-HU.json": () => import("./hu-HU-B3BihdGh.js"), "../../../language/locales/it-IT.json": () => import("./it-IT-Dd6xGSe-.js"), "../../../language/locales/ja-JP.json": () => import("./ja-JP-iTbqSPNL.js"), "../../../language/locales/lt-LT.json": () => import("./lt-LT-DE-4IXNG.js"), "../../../language/locales/lv-LV.json": () => import("./lv-LV-CeivEZms.js"), "../../../language/locales/nl-NL.json": () => import("./nl-NL-DVENFpd5.js"), "../../../language/locales/no-NO.json": () => import("./no-NO-Dn2UkdoI.js"), "../../../language/locales/pl-PL.json": () => import("./pl-PL-DFAzuceF.js"), "../../../language/locales/pt-PT.json": () => import("./pt-PT-_o5xgnxS.js"), "../../../language/locales/ro-RO.json": () => import("./ro-RO-D7c_Rj8V.js"), "../../../language/locales/sk-SK.json": () => import("./sk-SK-BBSuh2fA.js"), "../../../language/locales/sl-SI.json": () => import("./sl-SI-BLTuWNf5.js"), "../../../language/locales/sv-SE.json": () => import("./sv-SE-BUfESAQK.js") }), `../../../language/locales/${i18n.language}.json`, 6)
|
|
4279
|
-
},
|
|
4280
|
-
{ ns: "ui", importFn: () => __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "../../ui/language/bg-BG.json": () => import("./bg-BG-CZ8v3rdy.js"), "../../ui/language/cs-CZ.json": () => import("./cs-CZ-Dx6momCa.js"), "../../ui/language/da-DK.json": () => import("./da-DK-D4H69PX3.js"), "../../ui/language/de-DE.json": () => import("./de-DE-wp5-H-ov.js"), "../../ui/language/el-GR.json": () => import("./el-GR-CK2heqPJ.js"), "../../ui/language/en-US.json": () => import("./en-US-CAm3meB1.js"), "../../ui/language/es-ES.json": () => import("./es-ES-Ds3-DtqZ.js"), "../../ui/language/et-EE.json": () => import("./et-EE-Co-8akjV.js"), "../../ui/language/fi-FI.json": () => import("./fi-FI-DPNeTsJS.js"), "../../ui/language/fr-FR.json": () => import("./fr-FR-ChmNQciP.js"), "../../ui/language/hr-HR.json": () => import("./hr-HR-DqC8Cgs6.js"), "../../ui/language/hu-HU.json": () => import("./hu-HU-BOanVlKb.js"), "../../ui/language/it-IT.json": () => import("./it-IT-eCrTB65E.js"), "../../ui/language/ja-JP.json": () => import("./ja-JP-BJljbFIZ.js"), "../../ui/language/lt-LT.json": () => import("./lt-LT-DckQGgoT.js"), "../../ui/language/lv-LV.json": () => import("./lv-LV-DP9oRTFv.js"), "../../ui/language/nl-NL.json": () => import("./nl-NL-D2QKudfh.js"), "../../ui/language/no-NO.json": () => import("./no-NO-C_snYWBc.js"), "../../ui/language/pl-PL.json": () => import("./pl-PL-CQ6c2Qz_.js"), "../../ui/language/pt-PT.json": () => import("./pt-PT-C-hbNnsB.js"), "../../ui/language/ro-RO.json": () => import("./ro-RO-BrTWk1Ui.js"), "../../ui/language/sk-SK.json": () => import("./sk-SK-BTFtoPmI.js"), "../../ui/language/sl-SI.json": () => import("./sl-SI-BhVTSmhQ.js"), "../../ui/language/sv-SE.json": () => import("./sv-SE-66rqYTxi.js") }), `../../ui/language/${i18n.language}.json`, 5) }
|
|
4281
|
-
]);
|
|
4282
|
-
const { data: legalEntityData } = useLegalEntity(ROOT_LE);
|
|
4283
|
-
return !legalEntityData ? /* @__PURE__ */ jsx(Loader, {}) : /* @__PURE__ */ jsx(
|
|
4284
|
-
DropinComposer,
|
|
4285
|
-
{
|
|
4286
|
-
legalEntityResponse: legalEntityData,
|
|
4287
|
-
openBankingPartnerConfigId
|
|
4288
|
-
}
|
|
4289
|
-
);
|
|
4290
|
-
}
|
|
4291
|
-
export {
|
|
4292
|
-
CardGroup as C,
|
|
4293
|
-
DropinLayout as D,
|
|
4294
|
-
EntityGuidanceStatus as E,
|
|
4295
|
-
LEGAL_COMPANY_NAME_FIELD as L,
|
|
4296
|
-
OnboardingDropinComponent as O,
|
|
4297
|
-
usePciStatus as a,
|
|
4298
|
-
useCanSeeIntroduction as b,
|
|
4299
|
-
useLegalEntityType as c,
|
|
4300
|
-
allowIndividualWithoutSoleProp as d,
|
|
4301
|
-
useDataMissingRemediations as e,
|
|
4302
|
-
EntityAssociation as f,
|
|
4303
|
-
defaultFieldMetadataV4 as g,
|
|
4304
|
-
defaultFieldMetadata as h,
|
|
4305
|
-
iconStatus as i,
|
|
4306
|
-
defaultFieldConfigV4 as j,
|
|
4307
|
-
defaultFieldConfig as k,
|
|
4308
|
-
useTrustMembers as l,
|
|
4309
|
-
normalizedTaskStatusStore as n,
|
|
4310
|
-
useSalesChannelsSettings as u
|
|
4311
|
-
};
|