@adyen/kyc-components 3.85.0 → 3.86.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.
Files changed (398) hide show
  1. package/dist/{AcceptTermsOfServiceComponent-DWt6MA7A.js → AcceptTermsOfServiceComponent-DzMlzUjz.js} +16 -17
  2. package/dist/{Accordion-DQSd9JrF.js → Accordion-ZHPTn2Gl.js} +2 -2
  3. package/dist/{AccountSetupRejected-Y2jV7DOd.js → AccountSetupRejected-DON-7H74.js} +4 -4
  4. package/dist/{Address-CN31gTRW.js → Address-ChPj2pfR.js} +337 -22
  5. package/dist/{Alert-B2qwr9au.js → Alert-CeZqoFeT.js} +3 -3
  6. package/dist/{Avatar-CrL6cVDB.js → Avatar-zXT7v3KF.js} +2 -2
  7. package/dist/{BusinessDetailsMultiformDropin-BB1mTi0Z.js → BusinessDetailsMultiformDropin-DKiYg8gJ.js} +89 -3112
  8. package/dist/{BusinessFinancingComponent-BevBrUTE.js → BusinessFinancingComponent-BRziB5i-.js} +6 -6
  9. package/dist/{BusinessFinancingDropin-BgU5hfv0.js → BusinessFinancingDropin-CUmKL5bO.js} +21 -38
  10. package/dist/{BusinessFinancingPage-u2Xu42u-.js → BusinessFinancingPage-DhhnCxFQ.js} +4 -4
  11. package/dist/{BusinessTypeSelectionPage-BNxEzkjO.js → BusinessTypeSelectionPage-B_dVM7cC.js} +9 -8
  12. package/dist/Card-Bz2B4J0v.js +82 -0
  13. package/dist/ConstitutionalDocument-Dt9O9bVo.js +143 -0
  14. package/dist/{CountryField-CFppUh42.js → CountryField-Bv9P8dRJ.js} +110 -78
  15. package/dist/CreateIndividualComponent-Mw4AiW_M.js +71 -0
  16. package/dist/CreateTransferInstrumentComponent-usUQlcH_.js +66 -0
  17. package/dist/{Currency-Zz8j3LFf.js → Currency-SzvigNNo.js} +8 -63
  18. package/dist/{CustomerSupport-CkqG00fn.js → CustomerSupport-C_KLB51k.js} +21 -9
  19. package/dist/{DebugModal-Cxp_Lbjk.js → DebugModal-DYolUZQS.js} +9 -9
  20. package/dist/{DecisionMakerDetailsPage-kpoxsSYP.js → DecisionMakerDetailsPage-C2BzKLSi.js} +7 -7
  21. package/dist/{DecisionMakers-DMboYynJ.js → DecisionMakers-DTYzQWdY.js} +18 -20
  22. package/dist/{EmbeddedStatus-DdZv9Kwp.js → EmbeddedStatus-jepajhAF.js} +3 -3
  23. package/dist/{EndStateLayout-Cswr0wiZ.js → EndStateLayout-DQm7Xrqx.js} +2 -2
  24. package/dist/{useFormContext-DrrsFJH7.js → FormFlow-A9b0QEcM.js} +10 -16
  25. package/dist/{FormNavigation-DrejHtXO.js → FormNavigation-DEdNWaAc.js} +5 -5
  26. package/dist/{useGlobalData-rR_jnTzW.js → FormWrapper-DjWyqVD2.js} +12 -79
  27. package/dist/{IndividualOnfidoDropin-CydUe7_6.js → IndividualOnfido-BMIkKHvJ.js} +8187 -6328
  28. package/dist/IndividualOnfidoDropin-DBQF0Onh.js +2502 -0
  29. package/dist/{InputText-EX5kyD9L.js → InputText-BG-TiSNN.js} +4 -4
  30. package/dist/{Introduction-DncY2r7T.js → Introduction-BgoEJd8o.js} +4 -4
  31. package/dist/{JpAddress-BTfvrykR.js → JpAddress-Jxj9u4D5.js} +8 -8
  32. package/dist/{LegalRepresentativeDetailsPage-DxqaU2W7.js → LegalRepresentativeDetailsPage-BH5AnQhk.js} +5 -5
  33. package/dist/{ListItem-pn0XFAz_.js → ListItem-DIDj0vuO.js} +3 -3
  34. package/dist/{ManageIndividualComponent-CKRuUS0t.js → ManageIndividualComponent-CJKXW8rK.js} +5 -5
  35. package/dist/{ManageTermsOfServiceComponent-DDgriC3w.js → ManageTermsOfServiceComponent-DNf00D1s.js} +5 -5
  36. package/dist/{ManageTransferInstrumentComponent-BoQn6JaV.js → ManageTransferInstrumentComponent-gVWN389q.js} +14 -13
  37. package/dist/{MaybeModal-B1X7K4z1.js → MaybeModal-D51ALTH6.js} +3 -3
  38. package/dist/{Modal-ConNvgj4.js → Modal-C9aImxis.js} +2 -2
  39. package/dist/OnboardingDropinComponent-D-tQ12Sy.js +9791 -0
  40. package/dist/{PayoutDetailsDropin-CHOa81Ot.js → PayoutDetailsDropin-CxWPXV7j.js} +288 -158
  41. package/dist/{Review-BAuL4AQ-.js → Review-CRhM6n_P.js} +8 -8
  42. package/dist/RootBusinessDetailsPage-DZrT_e0g.js +61 -0
  43. package/dist/{RootBusinessLinesPage-D-YRRyIW.js → RootBusinessLinesPage-CJUpoVy5.js} +267 -144
  44. package/dist/RootIndividualDetailsPage-pqVuzOoJ.js +80 -0
  45. package/dist/{SignPCIComponent-B6FQiV5E.js → SignPCIComponent-BNbx3OzX.js} +11 -11
  46. package/dist/{SingpassSelection-DxGUYazk.js → SingpassSelection-BAa3S705.js} +4 -5
  47. package/dist/SoleProprietorshipPage-Bhw3GBKP.js +60 -0
  48. package/dist/{SourceOfFundsPage-Ce-Mim_H.js → SourceOfFundsPage-CJXpHSgo.js} +24 -29
  49. package/dist/{StepProgressIndicator-BymtNCPV.js → StepProgressIndicator-Dncrs7ra.js} +2 -2
  50. package/dist/{StoreProvider-BYjTSjnX.js → StoreProvider-CWnZNw9D.js} +427 -305
  51. package/dist/{TaskItemStatus-BholBQ7C.js → TaskItemStatus-D3ri_-L2.js} +3 -3
  52. package/dist/{TaxReportingDropin-CSa5vto5.js → TaxReportingDropin-Du7KU--L.js} +15 -17
  53. package/dist/{TrustDetailsPage-CYMeuEyr.js → TrustDetailsPage-SGmHwgzj.js} +24 -32
  54. package/dist/{TrustMemberCompanyPage-DICY9KDR.js → TrustMemberCompanyPage-BkQ9q4_T.js} +6 -6
  55. package/dist/{TrustMemberIndividualPage-DUGmI852.js → TrustMemberIndividualPage-CIr73hS-.js} +5 -5
  56. package/dist/UnincorporatedPartnershipIndividualPage-DQxHTyUp.js +65 -0
  57. package/dist/{UnincorporatedPartnershipMemberCompanyPage-CuvkBZ2N.js → UnincorporatedPartnershipMemberCompanyPage-DOWqNUHn.js} +6 -6
  58. package/dist/VerificationErrorAlert-DDsMxj76.js +79 -0
  59. package/dist/{ViewVerificationStatusComponent-zXuO8CY1.js → ViewVerificationStatusComponent-Hqp0gnec.js} +4 -4
  60. package/dist/adyen-business-financing.js +3 -3
  61. package/dist/adyen-individual-configuration.js +3 -3
  62. package/dist/adyen-individual-status.js +3 -3
  63. package/dist/adyen-kyc-components.js +20 -20
  64. package/dist/adyen-onboarding.js +2 -2
  65. package/dist/adyen-terms-of-service-management.js +3 -3
  66. package/dist/adyen-terms-of-service-status.js +3 -3
  67. package/dist/adyen-transfer-instrument-configuration.js +3 -3
  68. package/dist/adyen-transfer-instrument-management.js +3 -3
  69. package/dist/adyen-verification-status.js +3 -3
  70. package/dist/{bg-BG-fr-xfUBV.js → bg-BG-B1GR6lKu.js} +3 -1
  71. package/dist/{bg-BG-BIOMFPaW.js → bg-BG-BC1dwNN2.js} +2 -5
  72. package/dist/bg-BG-BJo9yIYj.js +13 -0
  73. package/dist/bg-BG-D8qq7TQJ.js +94 -0
  74. package/dist/bg-BG-a6CQ0hKw.js +13 -0
  75. package/dist/{bg-BG-Cs_1PU3v.js → bg-BG-e6Rs6yz_.js} +4 -1
  76. package/dist/{cs-CZ-DNWTRefA.js → cs-CZ-2foXfkBk.js} +2 -5
  77. package/dist/cs-CZ-BAr1-JAS.js +13 -0
  78. package/dist/cs-CZ-ChGeQ9s0.js +94 -0
  79. package/dist/{cs-CZ-C0sNB1Fm.js → cs-CZ-DBQXByj7.js} +3 -1
  80. package/dist/cs-CZ-LGBI1w0Z.js +13 -0
  81. package/dist/{cs-CZ-B2WAqmaW.js → cs-CZ-Q6NVYK-k.js} +4 -1
  82. package/dist/da-DK-914Viqia.js +13 -0
  83. package/dist/{da-DK-8dk9Q_Wk.js → da-DK-CjjWmhN6.js} +3 -1
  84. package/dist/da-DK-CyHH8kX3.js +94 -0
  85. package/dist/{da-DK-D-eeokQn.js → da-DK-DSYEF7Q1.js} +4 -1
  86. package/dist/{da-DK-D-PlwKvZ.js → da-DK-DU3_xdWg.js} +2 -5
  87. package/dist/da-DK-DoHb4ssx.js +13 -0
  88. package/dist/{de-DE-Dcs3W1fT.js → de-DE-B9-ILIdw.js} +4 -1
  89. package/dist/{de-DE-4GAd_srm.js → de-DE-BODG29hR.js} +2 -5
  90. package/dist/de-DE-BXKZNAA1.js +13 -0
  91. package/dist/de-DE-DL6SrIBE.js +94 -0
  92. package/dist/{de-DE-CCyKie8B.js → de-DE-DoQHxDRp.js} +3 -1
  93. package/dist/de-DE-R6YgDOo5.js +13 -0
  94. package/dist/{analytics-DkXXx2b6.js → debouncedInputEvent-B3Lwtvx_.js} +7 -21
  95. package/dist/{validate-DzaSMOa2.js → documentUtils-C2iCagu9.js} +3 -167
  96. package/dist/{dropinUtils-CCEDaAJW.js → dropinUtils-L9qJuAw0.js} +4 -20
  97. package/dist/el-GR-BnMw4HQ7.js +13 -0
  98. package/dist/{el-GR-D7zMcBtK.js → el-GR-CnoZeZlX.js} +3 -1
  99. package/dist/{el-GR-DBum-QDu.js → el-GR-DYjcbiSc.js} +4 -1
  100. package/dist/{el-GR-Ddnh0NhQ.js → el-GR-DcIdm3iK.js} +2 -5
  101. package/dist/el-GR-DgaUGjyJ.js +13 -0
  102. package/dist/el-GR-l0JeDNPy.js +94 -0
  103. package/dist/{en-US-DjF6iC7G.js → en-US-BxEW5N6f.js} +44 -5
  104. package/dist/{en-US-BwDZ0WHW.js → en-US-C5WyUweF.js} +3 -1
  105. package/dist/en-US-CTZwL084.js +13 -0
  106. package/dist/{en-US-BCFNoF5y.js → en-US-DYo4OF-P.js} +8 -7
  107. package/dist/{en-US-DdeSoN_2.js → en-US-gsp7CD_E.js} +5 -1
  108. package/dist/{es-ES-JvAvmB2A.js → es-ES-BMrse1nQ.js} +3 -1
  109. package/dist/es-ES-BWAlCq7R.js +13 -0
  110. package/dist/{es-ES-C7XjLOHi.js → es-ES-C-tTuMLH.js} +4 -1
  111. package/dist/es-ES-C1ClJ2XE.js +94 -0
  112. package/dist/{es-ES-C4lENXHH.js → es-ES-CMQqgMEJ.js} +2 -5
  113. package/dist/es-ES-dMSfTLXF.js +13 -0
  114. package/dist/{et-EE-SJf3_Ega.js → et-EE-BE8bHZns.js} +3 -1
  115. package/dist/et-EE-BG_Y29oV.js +94 -0
  116. package/dist/{et-EE-BUG05EDz.js → et-EE-BzLAp08F.js} +4 -1
  117. package/dist/et-EE-D9SV0taO.js +13 -0
  118. package/dist/{et-EE-3EQr-1cj.js → et-EE-DcpuYQwB.js} +2 -5
  119. package/dist/et-EE-l977xCZ_.js +13 -0
  120. package/dist/fi-FI-0ScajGUB.js +13 -0
  121. package/dist/{fi-FI-Byvvcxxq.js → fi-FI-4GTHkwOL.js} +2 -5
  122. package/dist/{fi-FI-Cy2hAl0B.js → fi-FI-Bmu7sndb.js} +3 -1
  123. package/dist/fi-FI-C7GrKbXx.js +13 -0
  124. package/dist/fi-FI-bIhXiQPL.js +94 -0
  125. package/dist/{fi-FI-CEzjKgiz.js → fi-FI-pyHLbmel.js} +4 -1
  126. package/dist/{MaskedInput-DB6EYmfa.js → fieldConfigurations-DVV23oeM.js} +616 -14
  127. package/dist/{fr-FR-E_UubsZ-.js → fr-FR-Ba-HRBQ7.js} +2 -5
  128. package/dist/fr-FR-Bj275MRb.js +94 -0
  129. package/dist/fr-FR-CqCcxkgA.js +13 -0
  130. package/dist/{fr-FR-DNJiLv9b.js → fr-FR-DG3tEkdN.js} +4 -1
  131. package/dist/fr-FR-o45TzYMp.js +13 -0
  132. package/dist/{fr-FR-BmW46mYd.js → fr-FR-ufKVxWpT.js} +3 -1
  133. package/dist/getFieldsWithExistingData-C6JBh3D6.js +22 -0
  134. package/dist/{getName-Dc03c4n_.js → getName-k5oRc0oZ.js} +9 -2
  135. package/dist/{hasDataChanged-CUdKM92N.js → hasDataChanged-CogwJI1I.js} +2 -2
  136. package/dist/{hr-HR-TVOgDkBf.js → hr-HR-BFx1T11G.js} +2 -5
  137. package/dist/{hr-HR-WMnlxMEY.js → hr-HR-BRFErTkv.js} +4 -1
  138. package/dist/{hr-HR-c1Si_0s4.js → hr-HR-BYXLJcPZ.js} +3 -1
  139. package/dist/hr-HR-CL0q_D2U.js +94 -0
  140. package/dist/hr-HR-CoCrArfg.js +13 -0
  141. package/dist/hr-HR-YG9hvMMj.js +13 -0
  142. package/dist/hu-HU-BrxUJuJh.js +13 -0
  143. package/dist/{hu-HU-B2nrl0pw.js → hu-HU-CJA8w351.js} +4 -1
  144. package/dist/hu-HU-DIurnBC3.js +13 -0
  145. package/dist/{hu-HU-DRONW_47.js → hu-HU-GXvzHwu9.js} +2 -5
  146. package/dist/{hu-HU-CibGC8KY.js → hu-HU-J4qBifyy.js} +3 -1
  147. package/dist/hu-HU-cLqGFTTR.js +94 -0
  148. package/dist/{iframeWidget-BWwxgbNs.js → iframeWidget-D2CKFlJk.js} +4 -4
  149. package/dist/{it-IT-BMjuva_2.js → it-IT-B_5GkLBx.js} +3 -1
  150. package/dist/{it-IT-DuBLJIdz.js → it-IT-Bw3VIHJB.js} +2 -5
  151. package/dist/it-IT-C0Qk47kh.js +94 -0
  152. package/dist/it-IT-CNS4NmYX.js +13 -0
  153. package/dist/it-IT-Cztl5jRY.js +13 -0
  154. package/dist/{it-IT-BRmX2jEi.js → it-IT-mhNjrQZn.js} +4 -1
  155. package/dist/{ja-JP-Cr_qjpZ2.js → ja-JP-BUrknIDB.js} +3 -1
  156. package/dist/{ja-JP-CCnzjx-u.js → ja-JP-BxEWI56P.js} +9 -1
  157. package/dist/{ja-JP-gRRH8Eph.js → ja-JP-CfrHlRGC.js} +4 -1
  158. package/dist/{ja-JP-CJ_j_HAA.js → ja-JP-DI7lRfpI.js} +2 -5
  159. package/dist/ja-JP-DSdZj-it.js +94 -0
  160. package/dist/ja-JP-DXkV1ta4.js +13 -0
  161. package/dist/{localizeDateString-rfEOu5f7.js → localizeDateString-ZCoTLjs1.js} +2 -2
  162. package/dist/lt-LT-BJTBEa5D.js +13 -0
  163. package/dist/lt-LT-C-dKiExL.js +94 -0
  164. package/dist/{lt-LT-BJQDUanx.js → lt-LT-C0Acftnm.js} +4 -1
  165. package/dist/lt-LT-D1viSP-v.js +13 -0
  166. package/dist/{lt-LT-DjNjg3Pl.js → lt-LT-L0wG5Pd2.js} +3 -1
  167. package/dist/{lt-LT-CBBDNCnp.js → lt-LT-ewVNPhQN.js} +2 -5
  168. package/dist/lv-LV-AkiOewnL.js +13 -0
  169. package/dist/{lv-LV-h3nTokkM.js → lv-LV-Bnq61WAt.js} +4 -1
  170. package/dist/{lv-LV-BpRfRfMz.js → lv-LV-DFvpmmGg.js} +3 -1
  171. package/dist/lv-LV-GI-ZDM0K.js +13 -0
  172. package/dist/{lv-LV-CtIe38WU.js → lv-LV-JqXvRt4T.js} +2 -5
  173. package/dist/lv-LV-UkEOuqFz.js +94 -0
  174. package/dist/{mapExistingFile-D_HVWRXe.js → mapExistingFile-txzqej6F.js} +5 -80
  175. package/dist/mapFinancialReportsToFinancialInformation-DoTIj0Q-.js +67 -0
  176. package/dist/mapJpAddressSchemaToAddressLocalizations-pPCQCgRx.js +63 -0
  177. package/dist/{mapLegalEntityToIndividualOnfidoSchema-DsQrqqP5.js → mapLegalEntityToIndividualOnfidoSchema-B8NxtO2j.js} +3 -63
  178. package/dist/{mapTransferInstrumentToPayoutAccount-MugvfqfK.js → mapTransferInstrumentToPayoutAccount-D9lyD7nx.js} +2 -2
  179. package/dist/nl-NL-B6B4Z_tr.js +13 -0
  180. package/dist/nl-NL-Cfr5hMtI.js +94 -0
  181. package/dist/{nl-NL-CE4l8R5l.js → nl-NL-DR1wVqQC.js} +2 -5
  182. package/dist/{nl-NL-oaBDOlm6.js → nl-NL-UhpFianh.js} +3 -1
  183. package/dist/nl-NL-VneIcgWO.js +13 -0
  184. package/dist/{nl-NL-YzDSCWLL.js → nl-NL-donw5yvS.js} +4 -1
  185. package/dist/no-NO-ASO8Je2l.js +94 -0
  186. package/dist/{no-NO-B1_YJlMP.js → no-NO-BZmigu6-.js} +2 -5
  187. package/dist/{no-NO-BTrfxWS7.js → no-NO-DRF-gOWI.js} +3 -1
  188. package/dist/{no-NO-Big2B13b.js → no-NO-Dev7r3VA.js} +4 -1
  189. package/dist/no-NO-Dn1LUbDp.js +13 -0
  190. package/dist/no-NO-Dqp598Ox.js +13 -0
  191. package/dist/payout-verification-instant-5u-wvFKv.js +41 -0
  192. package/dist/payout-verification-manual-BJsf7QPE.js +90 -0
  193. package/dist/{pl-PL-DGYFY42P.js → pl-PL-BKxhMICw.js} +2 -5
  194. package/dist/pl-PL-C1cP4Qpn.js +13 -0
  195. package/dist/pl-PL-CG4rvgUo.js +94 -0
  196. package/dist/{pl-PL-C72GTDxW.js → pl-PL-CHyLS1B7.js} +3 -1
  197. package/dist/{pl-PL-CL483jMb.js → pl-PL-DU_Xulyu.js} +4 -1
  198. package/dist/pl-PL-Zdh_Xu43.js +13 -0
  199. package/dist/{process-field-configurations-CiECrUSj.js → process-field-configurations-D2EUZow3.js} +3 -3
  200. package/dist/{pt-BR-CtFCi7U4.js → pt-BR-CFZE5Nop.js} +3 -1
  201. package/dist/{pt-BR-DJOzf0y2.js → pt-BR-DeXo4rsi.js} +4 -1
  202. package/dist/pt-BR-DkzLiK7Y.js +13 -0
  203. package/dist/pt-BR-DqLaaG4L.js +13 -0
  204. package/dist/pt-BR-IWTcYKu9.js +94 -0
  205. package/dist/{pt-BR-Co8OqKh-.js → pt-BR-wAIdhUru.js} +2 -5
  206. package/dist/{pt-PT-XAn7WGle.js → pt-PT-Bc9JI4eu.js} +3 -1
  207. package/dist/{pt-PT-pKLoM66X.js → pt-PT-C1qHVe7L.js} +2 -5
  208. package/dist/pt-PT-CoTUf3zo.js +13 -0
  209. package/dist/{pt-PT-B3qoJ3Fr.js → pt-PT-DkJdR6SS.js} +4 -1
  210. package/dist/pt-PT-LZZYQKaC.js +94 -0
  211. package/dist/pt-PT-uiREjC_e.js +13 -0
  212. package/dist/{resolveEnvironment-DTYC79J1.js → resolveEnvironment-CU4TOfg6.js} +3 -3
  213. package/dist/{ro-RO-Ct_BJvsc.js → ro-RO-BDjHimxe.js} +4 -1
  214. package/dist/{ro-RO-qX8X1Q1m.js → ro-RO-BFzooIri.js} +3 -1
  215. package/dist/ro-RO-C835aMET.js +13 -0
  216. package/dist/ro-RO-_HSYnLLu.js +13 -0
  217. package/dist/{ro-RO-D3rQ93wa.js → ro-RO-juw6hKRk.js} +2 -5
  218. package/dist/ro-RO-nVSeNtIQ.js +94 -0
  219. package/dist/{rules-BfrH23mO.js → rules-LaFMJfnA.js} +4 -5
  220. package/dist/{sk-SK-CmH1I1tp.js → sk-SK-BM57awWi.js} +2 -5
  221. package/dist/sk-SK-BX0wsQH4.js +94 -0
  222. package/dist/sk-SK-D6KtBU3q.js +13 -0
  223. package/dist/{sk-SK-CjdK4BKW.js → sk-SK-DRuiKuEp.js} +3 -1
  224. package/dist/sk-SK-K03EHmJF.js +13 -0
  225. package/dist/{sk-SK-FGK1FMMO.js → sk-SK-atqQJid1.js} +4 -1
  226. package/dist/{sl-SI-lPxRRPsh.js → sl-SI-CmYmQ6nG.js} +3 -1
  227. package/dist/{sl-SI-Cz28AFTz.js → sl-SI-CwKpXVCh.js} +4 -1
  228. package/dist/sl-SI-Dt7rovIT.js +94 -0
  229. package/dist/{sl-SI-hnlbW1OT.js → sl-SI-g2WSP0Tj.js} +2 -5
  230. package/dist/sl-SI-gM40Ay3W.js +13 -0
  231. package/dist/sl-SI-wYYQibM-.js +13 -0
  232. package/dist/style.css +931 -892
  233. package/dist/styles-CLV89_hH.js +931 -892
  234. package/dist/sv-SE-Bnhsdw8c.js +13 -0
  235. package/dist/{sv-SE-DLl7OGxl.js → sv-SE-CGCP_6VE.js} +4 -1
  236. package/dist/{sv-SE-BPpQ-05i.js → sv-SE-CHomf31L.js} +3 -1
  237. package/dist/{sv-SE-7Cbo1oic.js → sv-SE-Cfs0NHgG.js} +2 -5
  238. package/dist/sv-SE-DqzH809e.js +94 -0
  239. package/dist/sv-SE-uisfAT9L.js +13 -0
  240. package/dist/{useForm-CNi1k1NR.js → trackNavigation-gyYoCNvj.js} +25 -8
  241. package/dist/types/api/businessLines/businessLines.types.d.ts +7 -2
  242. package/dist/types/api/businessLines/useDeleteBusinessLine.d.ts +5 -0
  243. package/dist/types/api/businessLines/useUpdateBusinessLines.d.ts +7 -0
  244. package/dist/types/api/businessLines/useUpdateSourceOfFunds.d.ts +1 -0
  245. package/dist/types/components/BankAccount/forms/BankDocument/types.d.ts +2 -2
  246. package/dist/types/components/BankAccount/forms/PayoutDetails/PayoutDetails.d.ts +0 -1
  247. package/dist/types/components/BankAccount/forms/PayoutVerificationMethod/PayoutVerificationMethod.d.ts +1 -2
  248. package/dist/types/components/BankAccount/forms/PayoutVerificationMethod/payoutVerificationMethodMetadata.d.ts +1 -1
  249. package/dist/types/components/BankAccount/mapping/payoutKeyMappings.d.ts +51 -51
  250. package/dist/types/components/BankAccount/tasks/PayoutDetailsDropin/PayoutDetailsDropin.d.ts +1 -0
  251. package/dist/types/components/BankAccount/tasks/PayoutDetailsDropin/utils.d.ts +3 -3
  252. package/dist/types/components/BankAccount/utils/payoutAccountUtil.d.ts +2 -2
  253. package/dist/types/components/Business/tasks/BusinessDetailsDropin/types.d.ts +1 -3
  254. package/dist/types/components/Business/tasks/BusinessDetailsDropin/utils.d.ts +1 -1
  255. package/dist/types/components/BusinessLines/fields/WebDataField/types.d.ts +2 -4
  256. package/dist/types/components/BusinessLines/forms/rules.d.ts +5 -0
  257. package/dist/types/components/BusinessLines/tasks/BusinessLines/BusinessLinesStore.d.ts +2 -0
  258. package/dist/types/components/BusinessLines/tasks/BusinessLines/ExistingBusinessLines/BusinessLineModal.d.ts +3 -2
  259. package/dist/types/components/BusinessLines/tasks/utils.d.ts +11 -2
  260. package/dist/types/components/EFP/mapping/businessFinancingKeyMappings.d.ts +124 -124
  261. package/dist/types/components/Shared/FormNavigation/FormNavigation.d.ts +1 -1
  262. package/dist/types/components/Shared/FormNavigation/types.d.ts +0 -2
  263. package/dist/types/components/Shared/FormWrapper/FormWrapper.d.ts +1 -3
  264. package/dist/types/components/Shared/Summary/Summary.d.ts +1 -1
  265. package/dist/types/components/Shared/Summary/types.d.ts +0 -2
  266. package/dist/types/components/Shared/forms/Address/utils.d.ts +1 -1
  267. package/dist/types/components/Shared/tasks/CustomerSupport/mapping/customerSupportKeyMapping.d.ts +4 -0
  268. package/dist/types/context/ExperimentContext/types.d.ts +12 -0
  269. package/dist/types/core/errorMapping.d.ts +4 -1
  270. package/dist/types/core/user-events.d.ts +7 -9
  271. package/dist/types/hooks/{useAnalytics.d.ts → useAnalytics/useAnalytics.d.ts} +1 -7
  272. package/dist/types/utils/analytics/convertToEmbeddedEvent.d.ts +9 -0
  273. package/dist/types/utils/analytics/debouncedInputEvent.d.ts +19 -0
  274. package/dist/types/utils/analytics/getAnalyticsAssociatedEntityDetails.d.ts +13 -0
  275. package/dist/types/utils/{trackNavigation.d.ts → analytics/trackNavigation.d.ts} +1 -1
  276. package/dist/types/utils/entityStatusUtil.d.ts +1 -1
  277. package/dist/types/utils/filterProblemsByTaskForms.d.ts +12 -0
  278. package/dist/types/utils/getName.d.ts +1 -1
  279. package/dist/{types-DNH7oNbA.js → types-C1FJZQd1.js} +2 -2
  280. package/dist/{types-SBNit_kK.js → types-D0aacEF5.js} +27 -3
  281. package/dist/{types-DHmyPbAn.js → types-DQVZ5BSQ.js} +14 -2
  282. package/dist/{useAssociatedLegalEntity-CmhNWabq.js → useAssociatedLegalEntity-CuTN8T5x.js} +2 -2
  283. package/dist/{useDataset-C0A9qR_N.js → useDataset-C4vcroxo.js} +3 -3
  284. package/dist/{useMultiForm-CU58VvHX.js → useMultiForm-GpoMvhwU.js} +4 -4
  285. package/dist/{useOnboardingStatus-DuIJSnGH.js → useOnboardingStatus-Cifcsbcr.js} +1 -1
  286. package/dist/{useScenarios-T0NF0gUi.js → useScenarios-AyvycExm.js} +2 -2
  287. package/dist/{useTermsOfServiceStatus-1oGd6y18.js → useTermsOfServiceStatus-yhwwFpfh.js} +1 -1
  288. package/dist/{useToastContext-DHgUoF6x.js → useToastContext-CCxuinr_.js} +2 -2
  289. package/dist/{useUnincorporatedPartnershipMembers-57G1Bu4k.js → useUnincorporatedPartnershipMembers-D_N_aPNq.js} +62 -7
  290. package/dist/{utils-DZz9bCID.js → utils-U0nEMoML.js} +6 -46
  291. package/dist/validate-BRRbVwma.js +41 -0
  292. package/dist/{validate-Bz6-McmI.js → validate-Bqbj3vVS.js} +2 -2
  293. package/dist/{validationError-Ci4nlmhZ.js → validationError-DhRqgFgA.js} +2 -2
  294. package/package.json +1 -1
  295. package/dist/Card-N9psV2kP.js +0 -147
  296. package/dist/CreateIndividualComponent-BL3dK960.js +0 -71
  297. package/dist/CreateTransferInstrumentComponent-kxMU_XVD.js +0 -66
  298. package/dist/Divider-DiS12D_i.js +0 -239
  299. package/dist/Dropzone-DSyKXnbD.js +0 -218
  300. package/dist/Image-BhBefhke.js +0 -22
  301. package/dist/InputDate-C2j7qA_b.js +0 -43
  302. package/dist/InputGroup-WBfGDV5F.js +0 -32
  303. package/dist/LandingLayout-Ca68Z9DA.js +0 -60
  304. package/dist/Link-BS6Zpegg.js +0 -35
  305. package/dist/OnboardingDropinComponent-IKzrTT3r.js +0 -4274
  306. package/dist/RadioGroup-DhwjhH0X.js +0 -144
  307. package/dist/RegistrationAddress-BnyrwF-X.js +0 -2337
  308. package/dist/RootBusinessDetailsPage-BFR4Sxfp.js +0 -61
  309. package/dist/RootIndividualDetailsPage-D6lLtamt.js +0 -76
  310. package/dist/SoleProprietorshipPage-BKlAFmwp.js +0 -60
  311. package/dist/Spacer-BK3jDget.js +0 -18
  312. package/dist/TaxInformationField-DCjcBMwQ.js +0 -3094
  313. package/dist/TileGroup-BkTpSpVX.js +0 -174
  314. package/dist/UnincorporatedPartnershipIndividualPage-DZZc7sEn.js +0 -65
  315. package/dist/bafinUtils-DkP3ZoN4.js +0 -366
  316. package/dist/bg-BG-BLe6BCNz.js +0 -13
  317. package/dist/bg-BG-BPsOhDfg.js +0 -13
  318. package/dist/bg-BG-z3gZQvGq.js +0 -42
  319. package/dist/commonValidators-BLvtzPWZ.js +0 -24
  320. package/dist/cs-CZ-C5lyVYlZ.js +0 -42
  321. package/dist/cs-CZ-CHzJM-ii.js +0 -13
  322. package/dist/cs-CZ-xoLsda7i.js +0 -13
  323. package/dist/currency-BGwQyxBo.js +0 -36
  324. package/dist/da-DK-CYl2jko-.js +0 -42
  325. package/dist/da-DK-D-TJghBi.js +0 -13
  326. package/dist/da-DK-XNMYSp7w.js +0 -13
  327. package/dist/de-DE-BI7AAdOv.js +0 -13
  328. package/dist/de-DE-CCmlaL2F.js +0 -13
  329. package/dist/de-DE-DlUEkik0.js +0 -42
  330. package/dist/el-GR-DZ8GheJK.js +0 -42
  331. package/dist/el-GR-DoCIcce-.js +0 -13
  332. package/dist/el-GR-kYiInIQ9.js +0 -13
  333. package/dist/en-US-DYpvuCLO.js +0 -13
  334. package/dist/es-ES-CJMsyMAc.js +0 -13
  335. package/dist/es-ES-CnNU6AJv.js +0 -13
  336. package/dist/es-ES-D0c0MoqK.js +0 -42
  337. package/dist/et-EE-BR4OXRfV.js +0 -13
  338. package/dist/et-EE-C4Fwyr7-.js +0 -42
  339. package/dist/et-EE-sB7wkSA3.js +0 -13
  340. package/dist/fi-FI-BbqwYcLI.js +0 -13
  341. package/dist/fi-FI-bRXb-Q_i.js +0 -42
  342. package/dist/fi-FI-u5GxMZsq.js +0 -13
  343. package/dist/fieldConfigurations-BsOQ678Q.js +0 -448
  344. package/dist/form-rules-DhbF2mY4.js +0 -13
  345. package/dist/fr-FR-CMjrAkKl.js +0 -13
  346. package/dist/fr-FR-Cr-Y1vIy.js +0 -13
  347. package/dist/fr-FR-JLPKgufm.js +0 -42
  348. package/dist/hr-HR-Bhsop3CT.js +0 -13
  349. package/dist/hr-HR-D26Gz-HL.js +0 -42
  350. package/dist/hr-HR-D8cBxUFa.js +0 -13
  351. package/dist/hu-HU-BVfkOdJe.js +0 -13
  352. package/dist/hu-HU-BZCFneWx.js +0 -42
  353. package/dist/hu-HU-D2j1ISVk.js +0 -13
  354. package/dist/isEmpty-B0GMAw4K.js +0 -23
  355. package/dist/it-IT-C7Sg1k4p.js +0 -13
  356. package/dist/it-IT-CwA8megO.js +0 -13
  357. package/dist/it-IT-mScKLwBR.js +0 -42
  358. package/dist/ja-JP-DyELKS9Q.js +0 -42
  359. package/dist/ja-JP-GSbqID7o.js +0 -13
  360. package/dist/jpAddressSchema-ULGNNt5U.js +0 -27
  361. package/dist/lt-LT-C5nNCk4_.js +0 -13
  362. package/dist/lt-LT-CLPQVRpJ.js +0 -42
  363. package/dist/lt-LT-DSiutpRl.js +0 -13
  364. package/dist/lv-LV-C62XiDE5.js +0 -13
  365. package/dist/lv-LV-CEK8Re4d.js +0 -13
  366. package/dist/lv-LV-Cu-MJMVO.js +0 -42
  367. package/dist/mapJpAddressSchemaToAddressLocalizations-D7YGYa9S.js +0 -147
  368. package/dist/nl-NL-BOJ6zuBr.js +0 -13
  369. package/dist/nl-NL-DOQPxTX-.js +0 -13
  370. package/dist/nl-NL-pVdpCCOx.js +0 -42
  371. package/dist/no-NO-CRULNwNn.js +0 -42
  372. package/dist/no-NO-Cp3-tDMw.js +0 -13
  373. package/dist/no-NO-CuwTDFSf.js +0 -13
  374. package/dist/pl-PL-1-MrLPXu.js +0 -13
  375. package/dist/pl-PL-CtDHmbhp.js +0 -13
  376. package/dist/pl-PL-CxCiWdAF.js +0 -42
  377. package/dist/pt-BR-Br_cHzGx.js +0 -13
  378. package/dist/pt-BR-DnKEuslh.js +0 -13
  379. package/dist/pt-BR-apPtB2cK.js +0 -42
  380. package/dist/pt-PT-CLwCij2I.js +0 -13
  381. package/dist/pt-PT-Coa6J7SM.js +0 -42
  382. package/dist/pt-PT-cjbtYBUX.js +0 -13
  383. package/dist/ro-RO-BTqq5BPM.js +0 -42
  384. package/dist/ro-RO-CGhIjlpU.js +0 -13
  385. package/dist/ro-RO-Cmk-sVDr.js +0 -13
  386. package/dist/sk-SK-Bo5nvxWQ.js +0 -13
  387. package/dist/sk-SK-Do6CKNU4.js +0 -13
  388. package/dist/sk-SK-welR06By.js +0 -42
  389. package/dist/sl-SI-B9N6vA08.js +0 -42
  390. package/dist/sl-SI-CrTRlNnN.js +0 -13
  391. package/dist/sl-SI-cY-L2ma-.js +0 -13
  392. package/dist/sv-SE-BtwPrLEA.js +0 -13
  393. package/dist/sv-SE-D6al0j6W.js +0 -42
  394. package/dist/sv-SE-WPziDPQa.js +0 -13
  395. package/dist/types/utils/analytics.d.ts +0 -31
  396. package/dist/utils-AieP90ex.js +0 -29
  397. package/dist/utils-Bd79Y_6k.js +0 -165
  398. package/dist/validate-WO7yAOk4.js +0 -382
@@ -2,2711 +2,46 @@
2
2
  {
3
3
  try {
4
4
  let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
5
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "a1fc772e-b3dc-49bf-a81c-7f515c8d1f45", e._sentryDebugIdIdentifier = "sentry-dbid-a1fc772e-b3dc-49bf-a81c-7f515c8d1f45");
5
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "1006498c-61d0-4dcf-8328-0d5ef92e84ba", e._sentryDebugIdIdentifier = "sentry-dbid-1006498c-61d0-4dcf-8328-0d5ef92e84ba");
6
6
  } catch (e) {
7
7
  }
8
8
  }
9
9
  ;
10
10
  import { jsx, jsxs, Fragment } from "preact/jsx-runtime";
11
- import { b as useApiContext, aD as useMutation, k as httpPost, j as useQuery, q as skipToken, u as useTranslation, af as useI18nContext, aa as isEmpty, i as isUndefinedOrNull, a9 as CountryCodes, bA as isISIN, B as Button, c as useLegalEntity, R as ROOT_LE, X as useExperimentsContext, x as Typography, L as Loader, aC as entriesOf, P as useAnalyticsContext, m as useSettingsContext, N as createLogger, aF as useQueryClient, M as TaskTypes, y as LegalEntityTypes, al as businessDetailsComponentsKeyMapping, bB as solePropBusinessDetailsKeyMapping, ai as objectsDeepEqual, aG as keysOf, bC as solePropBusinessDetailsApiKeyMapping, bp as businessDetailsApiKeyMapping, a$ as filterOutUnwantedAssociationsIfRootLE, aZ as drop, a7 as getOwnEntityAssociations, aJ as doArraysMatch, ap as getCapabilityProblems, bD as solePropBusinessDetailsDocumentMapping, bE as businessDetailsDocumentMapping } from "./StoreProvider-BYjTSjnX.js";
12
- import { useEffect, useCallback, useState, useMemo, useRef } from "preact/hooks";
13
- import { R as RadioGroup, u as useCreateLegalEntity, a as useUpdateLegalEntity } from "./RadioGroup-DhwjhH0X.js";
14
- import { S as SettingNames, I as InputText } from "./InputText-EX5kyD9L.js";
15
- import { h as hasDataChanged } from "./hasDataChanged-CUdKM92N.js";
16
- import { u as useGlobalDataSlice, a as useGlobalData, c as useStateContext, F as FormWrapper } from "./useGlobalData-rR_jnTzW.js";
17
- import { u as useToastContext } from "./useToastContext-DHgUoF6x.js";
18
- import { c as composePerScenarioFormConfigurations, g as getPropsFromConfigurations } from "./process-field-configurations-CiECrUSj.js";
19
- import { c as validateNotEmptyOnBlur, f as validatePatternOnBlur, r as resolveFieldMetadata, h as validateJaKanaLegalCompanyName, i as validateJaHaniLegalCompanyName, a as useAccountHolder } from "./fieldConfigurations-BsOQ678Q.js";
20
- import { g as getRequiredForms, a as addValidityToForms, u as useFormComposer, t as trackNavigation } from "./dropinUtils-CCEDaAJW.js";
21
- import { u as uppercase, m as mapExistingFile, g as getPageName, b as useScenarioConfiguration } from "./mapExistingFile-D_HVWRXe.js";
22
- import { S as StructuredList, a as datasetUtilities, C as Confirm } from "./useDataset-C0A9qR_N.js";
23
- import { E as EntityTypeRadioGroupCard, o as organizationTypesToSkipCompanyStructureForm } from "./utils-DZz9bCID.js";
24
- import { C as Checkbox, u as useDebouncedCallback, g as getAssociatedLeAnalyticsPayload } from "./analytics-DkXXx2b6.js";
25
- import { a as getDocument, c as createDocumentRequest, b as getFileExtention, d as documentApiUtils } from "./validate-DzaSMOa2.js";
26
- import { S as StateCodesUS, c as TAX_INFORMATION_FIELD, r as requestingBanking, d as requestingIssuing, e as exemptedFromTaxDefaultFieldMetadata, f as exemptedFromTaxDefaultFieldConfig, t as taxInformationDefaultFieldMetadata, b as taxInformationDefaultFieldConfig, T as TaxInformationField, C as COUNTRY_OF_GOVERNING_LAW_POSSIBLE, h as COUNTRIES_USING_COMPANY_SEARCH, M as MemoizedDocumentUpload, j as isRegistrationNumberAbsentStateV4Scenario, k as COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT, l as getCompanyRegistrationNumberOptions, m as countryToTaxInfoTypeMap, n as rules, g as getFieldsWithExistingData } from "./TaxInformationField-DCjcBMwQ.js";
11
+ import { u as useTranslation, B as Button, y as Typography, V as CountryCodes, W as useI18nContext, O as TaskTypes, z as LegalEntityTypes, a0 as entriesOf, ar as businessDetailsComponentsKeyMapping, bC as solePropBusinessDetailsKeyMapping, ao as objectsDeepEqual, av as keysOf, i as isUndefinedOrNull, bD as solePropBusinessDetailsApiKeyMapping, bs as businessDetailsApiKeyMapping, P as createLogger, bb as filterOutUnwantedAssociationsIfRootLE, X as isEmpty$1, b9 as drop, ag as getOwnEntityAssociations, a_ as doArraysMatch, K as useAccountHolder, a1 as useAnalyticsContext, $ as useExperimentsContext, m as useSettingsContext, b as useApiContext, a3 as useQueryClient, bE as solePropBusinessDetailsDocumentMapping, bF as businessDetailsDocumentMapping, c as useLegalEntity, R as ROOT_LE, L as Loader } from "./StoreProvider-CWnZNw9D.js";
12
+ import { useState, useEffect, useRef, useCallback, useMemo } from "preact/hooks";
13
+ import { h as getForms, B as BasicInformation, C as CompanyStructure, A as AdditionalInformation, F as FinancialInformation, k as getDefaultRegistrationNumberType, l as getDefaultVatNumberType, m as FIELDS_NEEDED_FOR_COMPANY_SEARCH, o as companyTypeMetadata, p as documentFormsIds, r as registrationNumberDefaultFieldMetadata, q as inferCompanyRegistrationNumberType, s as registrationNumberDefaultFieldConfig, v as verifiedBusiness, t as setIsBankAccountRequestedForOrganization, w as useCompanySearch, x as useCompanySelection, y as useVerifyTin, z as useClearCompanyData, G as isNormalizedStringMatch, H as setVerifiedBusiness, I as useDebouncedState, J as legalFormFieldMetadata, K as stockTickerSymbolFieldMetadata, L as stockISINFieldMetadata, M as stockExchangeMICFieldMetadata, N as dateOfIncorporationFieldMetadata, P as industryCodeFieldMetadata, Q as eInvoicingCodeFieldMetadata, R as vatAbsenceReasonMetadata, S as defaultFieldMetadata, T as defaultFieldConfig, U as doingBusinessAsFieldMetadata, V as doingBusinessAsAbsentFieldMetadata, W as VerifiedBusinessCard, X as LEGAL_FORM_FIELDS, Y as DBA_NAME_FIELD, Z as DBANameField, _ as BUSINESS_REGISTRATION_NUMBER_FIELD, $ as BusinessRegistrationNumberField, a0 as VAT_NUMBER_FIELD, a1 as VatNumberField, a2 as EInvoicingCodeField, a3 as EINVOICING_CODE_FIELD, a4 as INDUSTRY_CODE_FIELD, a5 as IndustryCodeField, a6 as DATE_OF_INCORPORATION_FIELD, a7 as DateOfIncorporationField, a8 as STOCK_EXCHANGE_MIC_FIELD, a9 as StockExchangeMICField, aa as STOCK_ISIN_FIELD, ab as StockISINField, ac as STOCK_TICKER_SYMBOL_FIELD, ad as StockTickerSymbolField, ae as ADDITIONAL_INFORMATION_FORM_ID, af as localizedLegalCompanyNameFieldConfig, ag as defaultFieldMetadata$1, ah as defaultFieldConfig$1, ai as defaultFieldMetadataV4, aj as defaultFieldMetadata$2, ak as defaultFieldConfigV4, al as defaultFieldConfig$2, am as useLegalCompanyNameField, an as COUNTRY_OF_GOVERNING_LAW_FIELD, ao as CountryOfGoverningLawField, ap as LEGAL_COMPANY_NAME_FIELD, aq as isBankAccountRequestedForOrganization, ar as companyTypeOptions, as as useCompanyTypeExamples, E as EntityTypeRadioGroupCard, at as BusinessSelectionMultiform, au as isVerifiedSingleCompanySearchResult, av as exemptFromRegistrationNumberDefaultFieldMetadata, aw as CountryOfGoverningLawFieldValidation, ax as CountryFieldValidation, ay as financialInfoValidationWithEmployeesRules, az as CompanyStructureValidation, aA as tinMatched, aB as businessMismatchModalOpen, aC as applyVerifiedBusinessData, aD as KOMPANY_SEARCH_FAILURE } from "./OnboardingDropinComponent-D-tQ12Sy.js";
14
+ import { o as operationalAddressIsSameIds, n as isDateOlderThanAYear, t as mapAddressLabels, v as getKeyForField, j as useCreateLegalEntity, k as useUpdateLegalEntity, i as useFormContext, g as getAddressSchemaForCountry, C as COUNTRIES_WITH_STATES_DATASET, u as useAddressCleanse, b as formatAddressForCleanse, m as mapAddressData, A as Address, d as getNestedTrustedFields, e as getAddressSchemaLabelsByCountry, S as STATE_FIELD, h as StateField } from "./Address-ChPj2pfR.js";
15
+ import { S as SettingNames, I as InputText } from "./InputText-BG-TiSNN.js";
16
+ import { h as hasDataChanged } from "./hasDataChanged-CogwJI1I.js";
17
+ import { a as useGlobalData, b as useStateContext } from "./useUnincorporatedPartnershipMembers-D_N_aPNq.js";
18
+ import { u as useToastContext } from "./useToastContext-CCxuinr_.js";
19
+ import { c as composePerScenarioFormConfigurations, g as getPropsFromConfigurations } from "./process-field-configurations-D2EUZow3.js";
20
+ import { g as getRequiredForms, a as addValidityToForms, u as useFormComposer } from "./dropinUtils-L9qJuAw0.js";
21
+ import { m as mapExistingFile, g as getPageName, u as useScenarioConfiguration } from "./mapExistingFile-txzqej6F.js";
22
+ import { a as datasetUtilities, C as Confirm } from "./useDataset-C4vcroxo.js";
23
+ import { o as organizationTypesToSkipCompanyStructureForm } from "./utils-U0nEMoML.js";
24
+ import { F as FormWrapper } from "./FormWrapper-DjWyqVD2.js";
25
+ import { a as getDocument, c as createDocumentRequest, b as getFileExtention, d as documentApiUtils } from "./documentUtils-C2iCagu9.js";
26
+ import { g as getFieldsWithExistingData } from "./getFieldsWithExistingData-C6JBh3D6.js";
27
27
  import cx from "classnames";
28
- import { C as CompanyTypesValues, h as handleKeys } from "./bafinUtils-DkP3ZoN4.js";
29
- import { D as DBA_NAME_FIELD, B as BUSINESS_REGISTRATION_NUMBER_FIELD, V as VAT_NUMBER_FIELD, r as registrationAddressFields, v as vatAbsenceReasonMetadata, d as defaultFieldMetadata$1, g as getDefaultVatNumberType, a as defaultFieldConfig$1, e as exemptFromRegistrationNumberDefaultFieldMetadata, b as exemptFromRegistrationNumberDefaultFieldConfig, c as registrationNumberDefaultFieldMetadata, f as getDefaultRegistrationNumberType, h as registrationNumberDefaultFieldConfig, i as doingBusinessAsFieldMetadata, j as doingBusinessAsAbsentFieldMetadata, k as DBANameField, l as BusinessRegistrationNumberField, m as VatNumberField, M as MemoizedConstitutionalDocument, n as inferCompanyRegistrationNumberType } from "./RegistrationAddress-BnyrwF-X.js";
30
- import { c as createFormUtils, H as Header, m as mergeFieldMetadataIntoProps, E as ErrorPanel, C as CountryField, S as StackLayout, a as COUNTRY_FIELD, h as getFormProps, s as summaryItem, d as summaryStep } from "./CountryField-CFppUh42.js";
31
- import { u as useFormContext, F as FormContextProvider, a as FormFlow } from "./useFormContext-DrrsFJH7.js";
32
- import { u as useMultiForm } from "./useMultiForm-CU58VvHX.js";
33
- import { c as useAddressCleanse, f as formatAddressForCleanse, m as mapAddressData, d as applyVerifiedBusinessData$1, o as operationalAddressIsSameIds, A as Address, g as getNestedTrustedFields, S as STATE_FIELD, e as StateField, i as isDateOlderThanAYear } from "./Address-CN31gTRW.js";
34
- import { F as Field, a as useForm, L as LoaderWrapper } from "./useForm-CNi1k1NR.js";
35
- import { I as InputNumber, c as InputCurrency, b as CURRENCY_FIELD, C as Currency, L as LegalFormField, m as mapFinancialReportsToFinancialInformation, a as mapFinancialInformationToFinancialReport } from "./Currency-Zz8j3LFf.js";
36
- import { c as currencyByCountry } from "./types-SBNit_kK.js";
37
- import { I as InputDate, f as formatDateObj } from "./InputDate-C2j7qA_b.js";
38
- import { Suspense, lazy } from "preact/compat";
39
- import { M as MaskedInput, m as makeMask, d as alphanumericInputs, b as alphaInputs, n as numericInputs } from "./MaskedInput-DB6EYmfa.js";
40
- import { D as Divider, I as INDUSTRY_CODE_FIELD, i as industryCodeFieldMetadata, a as IndustryCodeField } from "./Divider-DiS12D_i.js";
41
- import { g as getAddressSchemaForCountry, C as COUNTRIES_WITH_STATES_DATASET, a as getAddressSchemaLabelsByCountry, m as mapAddressLabels, c as getKeyForField } from "./utils-Bd79Y_6k.js";
42
- import { signal } from "@preact/signals";
43
- import { L as Link } from "./Link-BS6Zpegg.js";
44
- import { t as toFullWidth, u as useAllowedCountries, m as mapJpAddressSchemaToAddressLocalizations, a as mapJpAddressSummary } from "./mapJpAddressSchemaToAddressLocalizations-D7YGYa9S.js";
45
- import { K as KEYBOARD_KEYS, M as Modal, a as ModalContent } from "./Modal-ConNvgj4.js";
46
- import { L as LEGAL_COMPANY_NAME_FIELD, g as defaultFieldMetadataV4, h as defaultFieldMetadata$2, j as defaultFieldConfigV4, k as defaultFieldConfig$2 } from "./OnboardingDropinComponent-IKzrTT3r.js";
47
- import { a as Alert } from "./Alert-B2qwr9au.js";
48
- import { C as Card } from "./Card-N9psV2kP.js";
49
- import { b as mapAddressLocalizationToJpAddressSchema, a as mapApiScriptLocalizationToSchemaFields, m as mapSchemaFieldsToApiScriptLocalization } from "./mapAddressLocalizationToJpAddressSchema-vJWbpAyq.js";
50
- import { f as formatObject, g as getProp } from "./utils-DNSfZiio.js";
51
- import { f as formatCurrency } from "./formatCurrency-CMOSdJMB.js";
52
- import { i as isValidationError, p as processValidationErrors, a as isMaintenanceModeError } from "./validationError-Ci4nlmhZ.js";
53
- import { i as isEmpty$1 } from "./isEmpty-B0GMAw4K.js";
54
- const clearCompanyData = async (legalEntityId, baseUrl) => {
55
- return httpPost({
56
- baseUrl,
57
- path: `legalEntities/${legalEntityId}/companyDataset/clearCompanyData`
58
- });
59
- };
60
- const useClearCompanyData = (options) => {
61
- const { rootLegalEntityId, baseUrl } = useApiContext();
62
- return useMutation({
63
- mutationFn: () => {
64
- return clearCompanyData(rootLegalEntityId.value, baseUrl.value);
65
- },
66
- retry: 0,
67
- ...options
68
- });
69
- };
70
- const LOW_RISK_COMPANY_DATA_COMPLIANCE_WINDOW = 1577664e5;
71
- const KNOWN_BROKEN_PRIMARY_SOURCE_CONNECTIONS = [
72
- StateCodesUS.Arkansas,
73
- StateCodesUS.Connecticut,
74
- StateCodesUS.Georgia,
75
- StateCodesUS.Hawaii,
76
- StateCodesUS.Indiana,
77
- StateCodesUS.Kentucky,
78
- StateCodesUS.Maryland,
79
- StateCodesUS.Minnesota,
80
- StateCodesUS.Missouri,
81
- StateCodesUS.Montana,
82
- StateCodesUS.NewHampshire,
83
- StateCodesUS.NewMexico,
84
- StateCodesUS.SouthCarolina,
85
- StateCodesUS.Utah,
86
- StateCodesUS.Vermont,
87
- StateCodesUS.Wisconsin,
88
- StateCodesUS.Wyoming
89
- ];
90
- const KNOWN_DISALLOWED_INDEX_DATASET_STATES = [
91
- StateCodesUS.California,
92
- StateCodesUS.Florida,
93
- StateCodesUS.Illinois,
94
- StateCodesUS.Texas
95
- ];
96
- const KOMPANY_SEARCH_FAILURE = "Kompany index and deep search both failed to complete";
97
- const useCompanySearch = (data, options) => {
98
- const { rootLegalEntityId, baseUrl } = useApiContext();
99
- return useQuery({
100
- queryKey: ["companySearch", data],
101
- queryFn: () => handleCompanySearch(rootLegalEntityId.value, baseUrl.value, data),
102
- // TODO: Remove this once Moody's resolves & bug
103
- select: (data2) => {
104
- const transformedResults = data2.results.map((item) => ({
105
- ...item,
106
- name: item.name.replaceAll("&", "&")
107
- }));
108
- return {
109
- results: transformedResults
110
- };
111
- },
112
- retry: 0,
113
- ...options
114
- });
115
- };
116
- const handleCompanySearch = async (rootLegalEntityId, baseUrl, data) => {
117
- const getRequestPayload = (text) => ({
118
- text,
119
- country: data.country,
120
- state: data.state,
121
- limit: data.limit ?? 15
122
- });
123
- const nameSearchPayload = getRequestPayload(data.name);
124
- const registrationSearchPayload = getRequestPayload(data.registrationNumber);
125
- const searchRequest = async (requestPayload, path) => {
126
- return httpPost(
127
- {
128
- baseUrl,
129
- path: `legalEntities/${rootLegalEntityId}/companySearch${path ? "/" + path : ""}`
130
- },
131
- requestPayload
132
- );
133
- };
134
- const companyDeepSearch = async () => await searchRequest(nameSearchPayload, "deep");
135
- const companyIndexSearch = async () => await searchRequest(nameSearchPayload);
136
- const companyRegistrationNumberDeepSearch = async () => await searchRequest(registrationSearchPayload, "deepSearchByRegistrationNumber");
137
- const companyRegistrationNumberIndexSearch = async () => await searchRequest(registrationSearchPayload, "searchByRegistrationNumber");
138
- const primarySourceSearch = async (indexSearch, deepSearch) => {
139
- let response;
140
- try {
141
- response = await deepSearch();
142
- } catch {
143
- try {
144
- response = await indexSearch();
145
- } catch {
146
- throw new Error(KOMPANY_SEARCH_FAILURE);
147
- }
148
- }
149
- return response;
150
- };
151
- const searchByRegistrationNumber = async () => {
152
- return KNOWN_BROKEN_PRIMARY_SOURCE_CONNECTIONS.includes(data.state) ? await companyRegistrationNumberIndexSearch() : await primarySourceSearch(
153
- companyRegistrationNumberIndexSearch,
154
- companyRegistrationNumberDeepSearch
155
- );
156
- };
157
- const searchByCompanyName = async () => {
158
- return KNOWN_BROKEN_PRIMARY_SOURCE_CONNECTIONS.includes(data.state) ? await companyIndexSearch() : await primarySourceSearch(companyIndexSearch, companyDeepSearch);
159
- };
160
- if (data.registrationNumber) {
161
- const registrationNumberResponse = await searchByRegistrationNumber();
162
- return registrationNumberResponse.results.length > 0 ? registrationNumberResponse : await searchByCompanyName();
163
- }
164
- return await searchByCompanyName();
165
- };
166
- const handleCompanyDataset = async (rootLegalEntityId, baseUrl, data) => {
167
- const requestPayload = {
168
- companyId: data.company.id,
169
- country: "US",
170
- state: data.state
171
- };
172
- const searchRequest = async (path) => {
173
- return httpPost(
174
- {
175
- baseUrl,
176
- path: `legalEntities/${rootLegalEntityId}/companyDataset${path ? "/" + path : ""}`
177
- },
178
- requestPayload
179
- );
180
- };
181
- const getCompanyDataset = async () => await searchRequest();
182
- const refreshCompanyDataset = async () => await searchRequest("refreshed");
183
- const date = (/* @__PURE__ */ new Date()).toDateString();
184
- const isDataCompliant = data.company.lastUpdate ? Date.parse(date) - Date.parse(data.company.lastUpdate) < LOW_RISK_COMPANY_DATA_COMPLIANCE_WINDOW : false;
185
- if (data.state) {
186
- return isDataCompliant && !KNOWN_DISALLOWED_INDEX_DATASET_STATES.includes(data.state) ? await getCompanyDataset() : await refreshCompanyDataset();
187
- }
188
- return isDataCompliant ? await getCompanyDataset() : await refreshCompanyDataset();
189
- };
190
- const useVerifyTin = (data, options) => {
191
- const { rootLegalEntityId, baseUrl } = useApiContext();
192
- return useQuery({
193
- queryKey: ["verifyTin", data],
194
- queryFn: data ? () => verifyTin(rootLegalEntityId.value, baseUrl.value, data) : skipToken,
195
- retry: 0,
196
- ...options
197
- });
198
- };
199
- const verifyTin = async (legalEntityId, baseUrl, data) => {
200
- return httpPost(
201
- {
202
- baseUrl,
203
- path: `legalEntities/${legalEntityId}/verifyTin`
204
- },
205
- data
206
- );
207
- };
208
- const useCompanySelection = (data, options) => {
209
- const { rootLegalEntityId, baseUrl } = useApiContext();
210
- return useQuery({
211
- queryKey: ["companySelection", data],
212
- queryFn: data ? () => handleCompanySelection(rootLegalEntityId.value, baseUrl.value, data) : skipToken,
213
- retry: 0,
214
- ...options,
215
- // TODO: Remove this once Moody's resolves &amp; bug
216
- select: (data2) => {
217
- const transformedResults = {
218
- ...data2,
219
- name: data2.name.replaceAll("&amp;", "&")
220
- };
221
- return transformedResults;
222
- }
223
- });
224
- };
225
- const handleCompanySelection = async (rootLegalEntityId, baseUrl, data) => {
226
- const [companyDatasetResult, tinMatch] = await Promise.all([
227
- handleCompanyDataset(rootLegalEntityId, baseUrl, {
228
- company: data.company,
229
- state: data.state
230
- }),
231
- verifyTin(rootLegalEntityId, baseUrl, { name: data.name, tin: data.tin })
232
- ]);
233
- return {
234
- ...companyDatasetResult,
235
- tinMatched: tinMatch?.matched
236
- };
237
- };
238
- const stripWhitespace = (str) => str.replace(/\s/g, "");
239
- const toNormalizedString = (s) => stripWhitespace(s.toLowerCase());
240
- const isNormalizedStringMatch = (s1, s2) => toNormalizedString(s1) === toNormalizedString(s2);
241
- const FINANCIAL_REPORTING_DATE_FIELD = [
242
- "financialReportingDate"
243
- ];
244
- function FinancialReportingDate({
245
- data,
246
- valid,
247
- errors,
248
- labels,
249
- readonly,
250
- handleChangeFor
251
- }) {
252
- const { t } = useTranslation("common");
253
- return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
254
- Field,
255
- {
256
- name: "financialReportingDate",
257
- label: labels.financialReportingDate,
258
- helper: t(($) => $["dateOfTotalAssetsCalculation"]),
259
- helperPosition: "below",
260
- errorMessage: errors.financialReportingDate,
261
- isValid: valid.financialReportingDate,
262
- children: (childProps) => /* @__PURE__ */ jsx(
263
- InputDate,
264
- {
265
- ...childProps,
266
- name: "financialReportingDate",
267
- value: data.financialReportingDate,
268
- onInput: handleChangeFor("financialReportingDate", "input"),
269
- onBlur: handleChangeFor("financialReportingDate", "blur"),
270
- "aria-required": true,
271
- "aria-invalid": !valid.financialReportingDate,
272
- readonly,
273
- max: formatDateObj(/* @__PURE__ */ new Date())
274
- }
275
- )
276
- }
277
- ) });
278
- }
279
- const NUMBER_OF_EMPLOYEES_FIELD = [
280
- "numberOfEmployees"
281
- ];
282
- function NumberOfEmployees({
283
- data,
284
- valid,
285
- errors,
286
- labels,
287
- readonly,
288
- handleChangeFor,
289
- helperText
290
- }) {
291
- return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
292
- Field,
293
- {
294
- name: "numberOfEmployees",
295
- label: labels.numberOfEmployees,
296
- helper: helperText?.numberOfEmployees,
297
- errorMessage: errors.numberOfEmployees,
298
- isValid: valid.numberOfEmployees,
299
- children: (childProps) => /* @__PURE__ */ jsx(
300
- InputNumber,
301
- {
302
- ...childProps,
303
- "aria-required": true,
304
- "aria-invalid": !valid.numberOfEmployees,
305
- name: "numberOfEmployees",
306
- min: "1",
307
- step: "1",
308
- value: data.numberOfEmployees,
309
- readonly,
310
- onInput: handleChangeFor("numberOfEmployees", "input"),
311
- onBlur: handleChangeFor("numberOfEmployees", "blur")
312
- }
313
- )
314
- }
315
- ) });
316
- }
317
- const financialInformationReportedValueOptions = "adyen-kyc-financial-information-reported-value-options";
318
- const styles$1 = {
319
- financialInformationReportedValueOptions
320
- };
321
- const reportedValue = "adyen-kyc-reported-value";
322
- const reportedValueInput = "adyen-kyc-reported-value-input";
323
- const styles = {
324
- reportedValue,
325
- reportedValueInput
326
- };
327
- const ReportedValue = ({
328
- currency,
329
- amount,
330
- onAmountChanged,
331
- label,
332
- helper,
333
- fieldName,
334
- errorMessage,
335
- isValid
336
- }) => {
337
- const { i18n } = useI18nContext();
338
- return /* @__PURE__ */ jsx("div", { className: styles.reportedValue, children: /* @__PURE__ */ jsx(Field, { name: fieldName, errorMessage, isValid, helper, children: (childProps) => /* @__PURE__ */ jsx(
339
- InputCurrency,
340
- {
341
- ...childProps,
342
- locale: i18n.locale,
343
- currency,
344
- amount,
345
- onAmountChanged,
346
- className: styles.reportedValueInput,
347
- "aria-label": label
348
- }
349
- ) }) });
350
- };
351
- const financialInfoValidationRules = {
352
- financialReportingDate: [
353
- {
354
- modes: ["blur"],
355
- validate: (date) => !isEmpty(date),
356
- errorMessage: "fieldIsRequired"
357
- },
358
- {
359
- modes: ["blur"],
360
- validate: (date) => date ? new Date(date) < /* @__PURE__ */ new Date() : false,
361
- errorMessage: "invalidFinancialReportingDate"
362
- }
363
- ],
364
- currency: [
365
- {
366
- modes: ["blur"],
367
- validate: (currency) => !isEmpty(currency),
368
- errorMessage: "fieldIsRequired"
369
- }
370
- ],
371
- reportedValueOption: {
372
- modes: ["blur"],
373
- validate: (option) => !isEmpty(option),
374
- errorMessage: "fieldIsRequired"
375
- },
376
- balanceSheetTotal: {
377
- modes: ["blur"],
378
- validate: (amount) => !isUndefinedOrNull(amount),
379
- errorMessage: "fieldIsRequired"
380
- },
381
- annualTurnover: {
382
- modes: ["blur"],
383
- validate: (amount) => !isUndefinedOrNull(amount),
384
- errorMessage: "fieldIsRequired"
385
- }
386
- };
387
- const financialInfoValidationEmployeesOnlyRules = {
388
- numberOfEmployees: [
389
- {
390
- modes: ["blur"],
391
- validate: (numberOfEmployees) => !isEmpty(numberOfEmployees),
392
- errorMessage: "fieldIsRequired"
393
- },
394
- {
395
- modes: ["blur"],
396
- validate: (numberOfEmployees) => Number.isInteger(Number(numberOfEmployees)) && Number(numberOfEmployees) > 0,
397
- errorMessage: "pleaseEnterAValidWholeNumber"
398
- }
399
- ]
400
- };
401
- const financialInfoValidationWithEmployeesRules = {
402
- ...financialInfoValidationRules,
403
- ...financialInfoValidationEmployeesOnlyRules
404
- };
405
- const financialInformationFieldsForEu = [
406
- ...FINANCIAL_REPORTING_DATE_FIELD,
407
- ...CURRENCY_FIELD,
408
- "reportedValueOption"
409
- ];
410
- const financialInformationFields = [
411
- ...NUMBER_OF_EMPLOYEES_FIELD,
412
- ...FINANCIAL_REPORTING_DATE_FIELD,
413
- ...CURRENCY_FIELD,
414
- "reportedValueOption"
415
- ];
416
- function FinancialInformation(props) {
417
- const { t } = useTranslation("common");
418
- const {
419
- id,
420
- country,
421
- data: financialInformationData,
422
- heading,
423
- multiForm,
424
- fieldValidationErrors
425
- } = props;
426
- const defaultCurrency = currencyByCountry[country]?.[0] ?? "EUR";
427
- const formUtils = createFormUtils(props, t);
428
- const showReportingFields = formUtils.isRequiredField("financialReportingDate");
429
- const getSchema = (data2) => [
430
- ...financialInformationFields,
431
- ...data2.reportedValueOption ? [data2.reportedValueOption] : []
432
- ];
433
- const getValidator = () => {
434
- if (!showReportingFields) {
435
- return financialInfoValidationEmployeesOnlyRules;
436
- }
437
- if (country === CountryCodes.UnitedKingdom) {
438
- return financialInfoValidationWithEmployeesRules;
439
- }
440
- return financialInfoValidationRules;
441
- };
442
- const { handleChangeFor, data, valid, errors, fieldProblems, schema } = useForm({
443
- ...props,
444
- schema: getSchema,
445
- defaultData: financialInformationData,
446
- rules: getValidator(),
447
- fieldProblems: fieldValidationErrors
448
- });
449
- const { updateStateSlice } = useGlobalDataSlice(id);
450
- useEffect(() => {
451
- updateStateSlice({
452
- data,
453
- valid,
454
- errors,
455
- fieldProblems,
456
- schema
457
- });
458
- }, [data, valid, errors, fieldProblems, schema, updateStateSlice]);
459
- const handleChange = useCallback(
460
- (fieldName, mode) => multiForm ? multiForm.handleChangeFor(fieldName, "companyFinancialInformation", mode) : handleChangeFor(fieldName, mode),
461
- [handleChangeFor, multiForm]
462
- );
463
- const formData = multiForm ? multiForm.data?.companyFinancialInformation ?? {} : data;
464
- const formErrors = multiForm ? multiForm.errors?.companyFinancialInformation ?? {} : errors;
465
- const formValid = multiForm ? multiForm.valid?.companyFinancialInformation ?? {} : valid;
466
- const formFieldProblems = multiForm ? multiForm.fieldProblems.companyFinancialInformation ?? {} : fieldProblems;
467
- const updateReportedValueOption = (option) => {
468
- if (formData.reportedValueOption) {
469
- handleChange(formData.reportedValueOption)(null);
470
- }
471
- const newReportedValue = option;
472
- handleChange("reportedValueOption")(newReportedValue);
473
- };
474
- return /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-company-financial-information", children: [
475
- heading && /* @__PURE__ */ jsx(Header, { title: heading }),
476
- country === CountryCodes.UnitedKingdom && /* @__PURE__ */ jsx(
477
- NumberOfEmployees,
478
- {
479
- data: formUtils.getFieldData(formData, NUMBER_OF_EMPLOYEES_FIELD),
480
- errors: formUtils.getFieldErrors(
481
- formErrors,
482
- formFieldProblems,
483
- NUMBER_OF_EMPLOYEES_FIELD
484
- ),
485
- handleChangeFor: handleChange,
486
- labels: formUtils.getFieldLabels(NUMBER_OF_EMPLOYEES_FIELD),
487
- readonly: formUtils.isReadOnly("numberOfEmployees"),
488
- valid: formUtils.getFieldValid(formValid, NUMBER_OF_EMPLOYEES_FIELD)
489
- }
490
- ),
491
- showReportingFields && /* @__PURE__ */ jsxs(Fragment, { children: [
492
- /* @__PURE__ */ jsx(
493
- FinancialReportingDate,
494
- {
495
- data: formUtils.getFieldData(formData, FINANCIAL_REPORTING_DATE_FIELD),
496
- errors: formUtils.getFieldErrors(
497
- formErrors,
498
- formFieldProblems,
499
- FINANCIAL_REPORTING_DATE_FIELD
500
- ),
501
- handleChangeFor: handleChange,
502
- labels: formUtils.getFieldLabels(FINANCIAL_REPORTING_DATE_FIELD),
503
- readonly: formUtils.isReadOnly("financialReportingDate"),
504
- valid: formUtils.getFieldValid(formValid, FINANCIAL_REPORTING_DATE_FIELD)
505
- }
506
- ),
507
- /* @__PURE__ */ jsx(
508
- Currency,
509
- {
510
- country,
511
- labels: { currency: t(($) => $["reportingCurrency"]) },
512
- data: formUtils.getFieldData(formData, CURRENCY_FIELD),
513
- errors: formUtils.getFieldErrors(formErrors, formFieldProblems, CURRENCY_FIELD),
514
- handleChangeFor: handleChange,
515
- readonly: formUtils.isReadOnly("currency"),
516
- valid: formUtils.getFieldValid(formValid, CURRENCY_FIELD)
517
- }
518
- ),
519
- /* @__PURE__ */ jsx(
520
- Field,
521
- {
522
- el: "fieldset",
523
- name: "reportedValueOption",
524
- label: t(($) => $["reportedValue"]),
525
- errorMessage: formUtils.getErrorMessage(
526
- "reportedValueOption",
527
- formErrors,
528
- formFieldProblems
529
- ),
530
- helper: t(($) => $["useFiguresFromTheMostRecentYearAvailable"]),
531
- isValid: formValid.reportedValueOption,
532
- children: (childProps) => /* @__PURE__ */ jsx(
533
- RadioGroup,
534
- {
535
- name: "reportedValueOption",
536
- ...childProps,
537
- value: formData.reportedValueOption,
538
- items: [
539
- {
540
- id: "balanceSheetTotal",
541
- name: "balanceSheetTotal",
542
- content: /* @__PURE__ */ jsx(
543
- ReportedValue,
544
- {
545
- label: t(($) => $["balanceSheetTotal"]),
546
- currency: formData.currency ?? defaultCurrency,
547
- amount: formData.balanceSheetTotal,
548
- onAmountChanged: handleChange("balanceSheetTotal"),
549
- fieldName: "balanceSheetTotal",
550
- isValid: formValid.balanceSheetTotal,
551
- errorMessage: formUtils.getErrorMessage(
552
- "balanceSheetTotal",
553
- formErrors,
554
- formFieldProblems
555
- )
556
- }
557
- )
558
- },
559
- {
560
- id: "annualTurnover",
561
- name: "annualTurnover",
562
- content: /* @__PURE__ */ jsx(
563
- ReportedValue,
564
- {
565
- label: t(($) => $["annualTurnover"]),
566
- currency: formData.currency ?? defaultCurrency,
567
- amount: formData.annualTurnover,
568
- onAmountChanged: handleChange("annualTurnover"),
569
- fieldName: "annualTurnover",
570
- isValid: formValid.annualTurnover,
571
- errorMessage: formUtils.getErrorMessage(
572
- "annualTurnover",
573
- formErrors,
574
- formFieldProblems
575
- )
576
- }
577
- )
578
- }
579
- ],
580
- onChange: updateReportedValueOption,
581
- showContentOnlyOnSelected: true,
582
- className: styles$1.financialInformationReportedValueOptions
583
- }
584
- )
585
- }
586
- )
587
- ] })
588
- ] });
589
- }
590
- const DATE_OF_INCORPORATION_FIELD = [
591
- "dateOfIncorporation"
592
- ];
593
- function DateOfIncorporationField({
594
- data,
595
- valid,
596
- errors,
597
- labels,
598
- placeholders,
599
- readonly,
600
- handleChangeFor
601
- }) {
602
- return /* @__PURE__ */ jsx(
603
- Field,
604
- {
605
- name: "dateOfIncorporation",
606
- label: labels.dateOfIncorporation,
607
- errorMessage: errors.dateOfIncorporation,
608
- isValid: valid.dateOfIncorporation,
609
- children: (childProps) => /* @__PURE__ */ jsx(
610
- InputDate,
611
- {
612
- ...childProps,
613
- "aria-required": true,
614
- "aria-invalid": !valid.dateOfIncorporation,
615
- name: "dateOfIncorporation",
616
- value: data.dateOfIncorporation,
617
- placeholder: placeholders?.dateOfIncorporation,
618
- readonly,
619
- onInput: handleChangeFor("dateOfIncorporation", "input"),
620
- onBlur: handleChangeFor("dateOfIncorporation", "blur"),
621
- max: formatDateObj(/* @__PURE__ */ new Date()),
622
- min: formatDateObj(new Date(1900, 0, 1))
623
- }
624
- )
625
- }
626
- );
627
- }
628
- const validateDateOfIncorporation = (dateOfIncorporation) => {
629
- if (!dateOfIncorporation) {
630
- return false;
631
- }
632
- const date = new Date(dateOfIncorporation);
633
- return date < /* @__PURE__ */ new Date() && date > new Date(1900, 0, 1);
634
- };
635
- const dateOfIncorporationFieldMetadata = {
636
- label: "dateOfIncorporation",
637
- validators: [
638
- validateNotEmptyOnBlur,
639
- {
640
- modes: ["blur"],
641
- validate: validateDateOfIncorporation,
642
- errorMessage: "invalidDateOfIncorporation"
643
- }
644
- ]
645
- };
646
- const EINVOICING_CODE_FIELD = ["eInvoicingCode"];
647
- function EInvoicingCodeField({
648
- data,
649
- valid,
650
- errors,
651
- labels,
652
- placeholders,
653
- readonly,
654
- mask,
655
- guidanceText,
656
- shouldValidate,
657
- handleChangeFor
658
- }) {
659
- const { t } = useTranslation("common");
660
- const [noInvoicingCode, setNoInvoicingCode] = useState(false);
661
- const handleNoInvoicingCode = () => {
662
- setNoInvoicingCode(!noInvoicingCode);
663
- handleChangeFor("eInvoicingCode")("0000000");
664
- };
665
- return /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-field", children: [
666
- /* @__PURE__ */ jsx(
667
- MaskedInput,
668
- {
669
- name: "eInvoicingCode",
670
- type: "text",
671
- label: labels.eInvoicingCode ?? "",
672
- formatGuidance: guidanceText?.eInvoicingCode,
673
- placeholder: placeholders?.eInvoicingCode,
674
- errorMessage: errors.eInvoicingCode,
675
- isValid: valid.eInvoicingCode ?? false,
676
- value: data.eInvoicingCode ?? "",
677
- readonly: readonly || noInvoicingCode,
678
- shouldValidate,
679
- onInput: handleChangeFor("eInvoicingCode", "input"),
680
- onBlur: handleChangeFor("eInvoicingCode", "blur"),
681
- disabled: noInvoicingCode,
682
- "aria-required": true,
683
- "aria-invalid": !valid.eInvoicingCode,
684
- ...mask
685
- }
686
- ),
687
- /* @__PURE__ */ jsx(Field, { name: "noEInvoicingCode", children: (childProps) => /* @__PURE__ */ jsx(
688
- Checkbox,
689
- {
690
- ...childProps,
691
- name: "noEInvoicingCode",
692
- "aria-required": false,
693
- "aria-invalid": false,
694
- label: t(($) => $["thisCompanyDoesntHaveAnSDI"]),
695
- checked: noInvoicingCode,
696
- onChange: handleNoInvoicingCode
697
- }
698
- ) })
699
- ] });
700
- }
701
- const eInvoicingCodeFieldMetadata = {
702
- validators: validatePatternOnBlur(/^[A-Z0-9]{7}$/),
703
- mask: {
704
- mask: makeMask(...alphanumericInputs(16)),
705
- transformOnType: uppercase
706
- },
707
- guidanceText: {
708
- key: "the7CharacterIdentifierAssignedToThis",
709
- values: {
710
- example: "MP10YNU"
711
- }
712
- }
713
- };
714
- const stockExchangeMICFieldMetadata = {
715
- label: "stockExchangeMIC",
716
- validators: [validateNotEmptyOnBlur, validatePatternOnBlur(/^[a-zA-Z0-9]{4}$/)],
717
- mask: {
718
- mask: makeMask(...alphanumericInputs(4)),
719
- transformOnType: uppercase
720
- },
721
- guidanceText: {
722
- key: "enterNCharactersForExample",
723
- values: {
724
- numChars: "4",
725
- example: "XNAS"
726
- }
727
- }
728
- };
729
- const STOCK_EXCHANGE_MIC_FIELD = [
730
- "stockExchangeMIC"
731
- ];
732
- function StockExchangeMICField({
733
- data,
734
- valid,
735
- errors,
736
- labels,
737
- placeholders,
738
- readonly,
739
- mask,
740
- guidanceText,
741
- shouldValidate,
742
- handleChangeFor
743
- }) {
744
- return /* @__PURE__ */ jsx(
745
- MaskedInput,
746
- {
747
- name: "stockExchangeMIC",
748
- type: "text",
749
- label: labels.stockExchangeMIC ?? "",
750
- formatGuidance: guidanceText?.stockExchangeMIC,
751
- placeholder: placeholders?.stockExchangeMIC,
752
- ...mask,
753
- errorMessage: errors.stockExchangeMIC,
754
- isValid: valid.stockExchangeMIC ?? false,
755
- value: data.stockExchangeMIC ?? "",
756
- readonly,
757
- shouldValidate,
758
- onInput: handleChangeFor("stockExchangeMIC", "input"),
759
- onBlur: handleChangeFor("stockExchangeMIC", "blur"),
760
- "aria-required": true,
761
- "aria-invalid": !valid.stockExchangeMIC
762
- }
763
- );
764
- }
765
- const stockISINFieldMetadata = {
766
- label: "stockISIN",
767
- validators: [
768
- validateNotEmptyOnBlur,
769
- {
770
- modes: ["blur"],
771
- validate: (value) => !!value && isISIN(value)
772
- }
773
- ],
774
- mask: {
775
- mask: makeMask(...alphaInputs(2), ...alphanumericInputs(9), ...numericInputs(1)),
776
- transformOnType: uppercase
777
- },
778
- helperText: "stockISINHelper",
779
- guidanceText: {
780
- key: "validationPleaseEnterAValidStockISIN",
781
- values: {
782
- example: "NL0012969182"
783
- }
784
- }
785
- };
786
- const STOCK_ISIN_FIELD = ["stockISIN"];
787
- function StockISINField({
788
- data,
789
- valid,
790
- errors,
791
- labels,
792
- placeholders,
793
- readonly,
794
- mask,
795
- guidanceText,
796
- shouldValidate,
797
- handleChangeFor
798
- }) {
799
- return /* @__PURE__ */ jsx(
800
- MaskedInput,
801
- {
802
- name: "stockISIN",
803
- type: "text",
804
- label: labels.stockISIN ?? "",
805
- formatGuidance: guidanceText?.stockISIN,
806
- placeholder: placeholders?.stockISIN,
807
- ...mask,
808
- errorMessage: errors.stockISIN,
809
- isValid: valid.stockISIN ?? false,
810
- value: data.stockISIN ?? "",
811
- readonly,
812
- shouldValidate,
813
- onInput: handleChangeFor("stockISIN", "input"),
814
- onBlur: handleChangeFor("stockISIN", "blur"),
815
- "aria-required": true,
816
- "aria-invalid": !valid.stockISIN
817
- }
818
- );
819
- }
820
- const stockTickerSymbolFieldMetadata = {
821
- label: "stockTickerSymbol",
822
- validators: [validateNotEmptyOnBlur, validatePatternOnBlur(/^[A-Z\d]{1,5}$/)],
823
- mask: {
824
- mask: makeMask(...alphanumericInputs(1), ...alphanumericInputs(4)),
825
- transformOnType: uppercase
826
- },
827
- guidanceText: {
828
- key: "enterAMaximumOfNCharactersForExample",
829
- values: {
830
- maxChars: "5",
831
- example: "ADYEN"
832
- }
833
- }
834
- };
835
- const STOCK_TICKER_SYMBOL_FIELD = [
836
- "stockTickerSymbol"
837
- ];
838
- function StockTickerSymbolField({
839
- data,
840
- valid,
841
- errors,
842
- labels,
843
- placeholders,
844
- readonly,
845
- mask,
846
- guidanceText,
847
- shouldValidate,
848
- handleChangeFor
849
- }) {
850
- return /* @__PURE__ */ jsx(
851
- MaskedInput,
852
- {
853
- name: "stockTickerSymbol",
854
- type: "text",
855
- label: labels.stockTickerSymbol ?? "",
856
- formatGuidance: guidanceText?.stockTickerSymbol,
857
- placeholder: placeholders?.stockTickerSymbol,
858
- ...mask,
859
- errorMessage: errors.stockTickerSymbol,
860
- isValid: valid.stockTickerSymbol ?? false,
861
- value: data.stockTickerSymbol ?? "",
862
- readonly,
863
- shouldValidate,
864
- onInput: handleChangeFor("stockTickerSymbol", "input"),
865
- onBlur: handleChangeFor("stockTickerSymbol", "blur"),
866
- "aria-required": true,
867
- "aria-invalid": !valid.stockTickerSymbol
868
- }
869
- );
870
- }
871
- function useDebouncedState(wait, initialState) {
872
- const [state, _setState] = useState(initialState);
873
- const setState = useDebouncedCallback(_setState, wait);
874
- return [state, setState];
875
- }
876
- const LEGAL_FORM_FIELDS = ["legalForm", "legalFormLabel"];
877
- const legalFormFieldMetadata = {
878
- label: "legalForm",
879
- validators: [validateNotEmptyOnBlur]
880
- };
881
- const isBankAccountRequestedForOrganization = signal(void 0);
882
- const setIsBankAccountRequestedForOrganization = (hasRequest) => {
883
- isBankAccountRequestedForOrganization.value = hasRequest;
884
- };
885
- const tinMatched = signal(void 0);
886
- const businessMismatchModalOpen = signal(false);
887
- const verifiedBusiness = signal(void 0);
888
- const isVerifiedSingleCompanySearchResult = signal(false);
889
- const setVerifiedBusiness = (company) => {
890
- verifiedBusiness.value = company;
891
- };
892
- function VerifiedBusinessCard({
893
- verifiedBusiness: verifiedBusiness2,
894
- verifiedAddress
895
- }) {
896
- const { i18n } = useI18nContext();
897
- const [expanded, setExpanded] = useState(false);
898
- const address = verifiedAddress?.address && verifiedAddress?.city && verifiedAddress?.stateOrProvince && verifiedAddress?.postalCode ? `${verifiedAddress?.address} ${verifiedAddress.city} ${verifiedAddress.stateOrProvince} ${verifiedAddress.postalCode}` : verifiedBusiness2?.address;
899
- const addressLink = `https://www.google.com/maps/place/${address?.replaceAll(" ", "+")}`;
900
- const baseItems = useMemo(
901
- () => [
902
- {
903
- term: i18n.get("legalCompanyName__US"),
904
- details: verifiedBusiness2?.name
905
- },
906
- {
907
- term: i18n.get("registrationNumber__US"),
908
- details: verifiedBusiness2?.registrationNumber
909
- }
910
- ].filter((item) => !!item.details),
911
- [verifiedBusiness2?.name, verifiedBusiness2?.registrationNumber, i18n]
912
- );
913
- const expandedItems = useMemo(
914
- () => [
915
- {
916
- term: i18n.get("legalForm"),
917
- details: verifiedBusiness2?.legalForm
918
- },
919
- {
920
- term: i18n.get("address"),
921
- details: address && /* @__PURE__ */ jsxs(Fragment, { children: [
922
- address,
923
- /* @__PURE__ */ jsx("br", {}),
924
- /* @__PURE__ */ jsx(Link, { href: addressLink, external: true, children: i18n.get("showOnMap") })
925
- ] })
926
- }
927
- ].filter((item) => !!item.details),
928
- [address, addressLink, i18n, verifiedBusiness2?.legalForm]
929
- );
930
- const expandedContentClasses = cx("adyen-kyc-verified-business-card__content", {
931
- "adyen-kyc-verified-business-card__content--collapsed": !expanded,
932
- "adyen-kyc-verified-business-card__content--expanded": expanded
933
- });
934
- return /* @__PURE__ */ jsxs("section", { className: "adyen-kyc-verified-business-card", children: [
935
- /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-verified-business-card__content", children: [
936
- /* @__PURE__ */ jsx(StructuredList, { items: baseItems }),
937
- /* @__PURE__ */ jsx(Divider, {})
938
- ] }),
939
- /* @__PURE__ */ jsxs("div", { className: expandedContentClasses, children: [
940
- /* @__PURE__ */ jsx(StructuredList, { items: expandedItems }),
941
- /* @__PURE__ */ jsx(Divider, {})
942
- ] }),
943
- /* @__PURE__ */ jsx("div", { className: "adyen-kyc-verified-business-card__expand-button", children: /* @__PURE__ */ jsx(Button, { variant: "link", onClick: () => setExpanded(!expanded), children: expanded ? i18n.get("hideDetails") : i18n.get("showDetails") }) })
944
- ] });
945
- }
946
- const LazyJpAddress$1 = lazy(
947
- async () => (await import("./JpAddress-BTfvrykR.js")).JpAddress
948
- );
949
- const ADDITIONAL_INFORMATION_FORM_ID = "additionalInformation";
950
- const ADDITIONAL_INFORMATION_FIELDS = [
951
- ...DBA_NAME_FIELD,
952
- ...BUSINESS_REGISTRATION_NUMBER_FIELD,
953
- ...TAX_INFORMATION_FIELD,
954
- ...VAT_NUMBER_FIELD,
955
- ...INDUSTRY_CODE_FIELD,
956
- ...DATE_OF_INCORPORATION_FIELD,
957
- ...STOCK_EXCHANGE_MIC_FIELD,
958
- ...STOCK_ISIN_FIELD,
959
- ...STOCK_TICKER_SYMBOL_FIELD,
960
- ...EINVOICING_CODE_FIELD,
961
- "legalFormDescription",
962
- ...LEGAL_FORM_FIELDS,
963
- ...registrationAddressFields
964
- ];
965
- function AdditionalInformation({
966
- data,
967
- labels,
968
- placeholders,
969
- helperText,
970
- heading,
971
- description,
972
- readOnly,
973
- shouldValidate,
974
- formVerificationErrors,
975
- fieldValidationErrors,
976
- allFields,
977
- requiredFields,
978
- obscuredFields,
979
- optionalFields,
980
- readOnlyFields,
981
- trustedFields,
982
- country,
983
- companyType = CompanyTypesValues.PRIVATE_COMPANY,
984
- showCompanyStructure
985
- }) {
986
- const { basicInformation } = useGlobalData();
987
- const { sliceData, updateStateSlice } = useGlobalDataSlice(ADDITIONAL_INFORMATION_FORM_ID);
988
- const { data: rootLegalEntity } = useLegalEntity(ROOT_LE);
989
- const { t, i18n } = useTranslation(["business", "businessLines"]);
990
- const { t: commonT } = useTranslation("common");
991
- const { isExperimentEnabled } = useExperimentsContext();
992
- const verifiedBusiness$1 = verifiedBusiness.value;
993
- const showVerified = !!verifiedBusiness$1;
994
- const showStockData = companyType === CompanyTypesValues.PUBLIC_COMPANY;
995
- const addressSchema = getAddressSchemaForCountry(country).filter(
996
- (field) => !COUNTRIES_WITH_STATES_DATASET.includes(country) ? field !== "stateOrProvince" : true
997
- );
998
- const currentCountryTaxInformation = sliceData?.taxInformation?.find(
999
- (tax) => tax.country === country
1000
- );
1001
- const businessLineTypes = [];
1002
- if (requestingBanking(rootLegalEntity)) {
1003
- businessLineTypes.push("banking");
1004
- }
1005
- if (requestingIssuing(rootLegalEntity)) {
1006
- businessLineTypes.push("issuing");
1007
- }
1008
- const initialFormUtilsProps = useMemo(
1009
- () => ({
1010
- data,
1011
- labels,
1012
- placeholders,
1013
- helperText,
1014
- readOnly,
1015
- allFields,
1016
- requiredFields,
1017
- readOnlyFields,
1018
- optionalFields,
1019
- obscuredFields,
1020
- trustedFields,
1021
- shouldValidate
1022
- }),
1023
- [
1024
- data,
1025
- labels,
1026
- placeholders,
1027
- helperText,
1028
- readOnly,
1029
- allFields,
1030
- requiredFields,
1031
- readOnlyFields,
1032
- optionalFields,
1033
- obscuredFields,
1034
- trustedFields,
1035
- shouldValidate
1036
- ]
1037
- );
1038
- const getFormSchema = useCallback(
1039
- (currentData) => {
1040
- const fieldsToRemove = [];
1041
- if (currentData.exemptedFromVat) {
1042
- fieldsToRemove.push("vatNumber");
1043
- } else {
1044
- fieldsToRemove.push("vatAbsenceReason");
1045
- }
1046
- if (currentData.exemptedFromTax && !isExperimentEnabled("EnableRegistrationAndTaxAbsentStatesV4")) {
1047
- fieldsToRemove.push("taxInformation");
1048
- }
1049
- if (currentData.exemptedFromRegistrationNumber) {
1050
- fieldsToRemove.push("registrationNumber");
1051
- }
1052
- if (!currentData.hasDoingBusinessAs) {
1053
- fieldsToRemove.push("doingBusinessAs");
1054
- }
1055
- return initialFormUtilsProps.requiredFields?.filter(
1056
- (field) => !fieldsToRemove.includes(field)
1057
- ) ?? [...DBA_NAME_FIELD];
1058
- },
1059
- [initialFormUtilsProps.requiredFields, isExperimentEnabled]
1060
- );
1061
- const mergedFieldProps = useMemo(
1062
- () => initialFormUtilsProps.allFields?.reduce((acc, field) => {
1063
- switch (field) {
1064
- case "hasDoingBusinessAs":
1065
- return mergeFieldMetadataIntoProps(
1066
- "hasDoingBusinessAs",
1067
- doingBusinessAsAbsentFieldMetadata,
1068
- acc
1069
- );
1070
- case "doingBusinessAs":
1071
- return mergeFieldMetadataIntoProps(
1072
- "doingBusinessAs",
1073
- doingBusinessAsFieldMetadata,
1074
- acc
1075
- );
1076
- case "registrationNumber":
1077
- return mergeFieldMetadataIntoProps(
1078
- field,
1079
- resolveFieldMetadata(
1080
- registrationNumberDefaultFieldConfig[country],
1081
- {
1082
- companyType,
1083
- registrationNumberType: sliceData?.registrationNumberType ?? getDefaultRegistrationNumberType(
1084
- sliceData?.registrationNumber,
1085
- country,
1086
- companyType
1087
- ),
1088
- isExperimentEnabled
1089
- },
1090
- registrationNumberDefaultFieldMetadata
1091
- ),
1092
- acc
1093
- );
1094
- case "exemptedFromRegistrationNumber":
1095
- return mergeFieldMetadataIntoProps(
1096
- field,
1097
- resolveFieldMetadata(
1098
- exemptFromRegistrationNumberDefaultFieldConfig[country],
1099
- {},
1100
- exemptFromRegistrationNumberDefaultFieldMetadata
1101
- ),
1102
- acc
1103
- );
1104
- case "taxInformation":
1105
- return mergeFieldMetadataIntoProps(
1106
- field,
1107
- resolveFieldMetadata(
1108
- taxInformationDefaultFieldConfig[country],
1109
- {
1110
- taxIdNumberType: currentCountryTaxInformation?.type,
1111
- companyType
1112
- },
1113
- taxInformationDefaultFieldMetadata
1114
- ),
1115
- acc
1116
- );
1117
- case "exemptedFromTax":
1118
- return mergeFieldMetadataIntoProps(
1119
- field,
1120
- resolveFieldMetadata(
1121
- exemptedFromTaxDefaultFieldConfig[country],
1122
- {},
1123
- exemptedFromTaxDefaultFieldMetadata
1124
- ),
1125
- acc
1126
- );
1127
- case "vatNumber":
1128
- return mergeFieldMetadataIntoProps(
1129
- field,
1130
- resolveFieldMetadata(
1131
- defaultFieldConfig$1[country],
1132
- {
1133
- vatNumberType: sliceData?.vatNumberType ?? getDefaultVatNumberType(sliceData?.vatNumber, country)
1134
- },
1135
- defaultFieldMetadata$1
1136
- ),
1137
- acc
1138
- );
1139
- case "vatAbsenceReason":
1140
- return mergeFieldMetadataIntoProps("vatAbsenceReason", vatAbsenceReasonMetadata, acc);
1141
- case "eInvoicingCode":
1142
- return mergeFieldMetadataIntoProps("eInvoicingCode", eInvoicingCodeFieldMetadata, acc);
1143
- case "industryCodes":
1144
- return mergeFieldMetadataIntoProps("industryCodes", industryCodeFieldMetadata, acc);
1145
- case "dateOfIncorporation":
1146
- return mergeFieldMetadataIntoProps(
1147
- "dateOfIncorporation",
1148
- dateOfIncorporationFieldMetadata,
1149
- acc
1150
- );
1151
- case "stockExchangeMIC":
1152
- return mergeFieldMetadataIntoProps(
1153
- "stockExchangeMIC",
1154
- stockExchangeMICFieldMetadata,
1155
- acc
1156
- );
1157
- case "stockISIN":
1158
- return mergeFieldMetadataIntoProps("stockISIN", stockISINFieldMetadata, acc);
1159
- case "stockTickerSymbol":
1160
- return mergeFieldMetadataIntoProps(
1161
- "stockTickerSymbol",
1162
- stockTickerSymbolFieldMetadata,
1163
- acc
1164
- );
1165
- case "legalForm":
1166
- return mergeFieldMetadataIntoProps("legalForm", legalFormFieldMetadata, acc);
1167
- default:
1168
- return acc;
1169
- }
1170
- }, initialFormUtilsProps),
1171
- [
1172
- companyType,
1173
- country,
1174
- currentCountryTaxInformation?.type,
1175
- initialFormUtilsProps,
1176
- isExperimentEnabled,
1177
- sliceData
1178
- ]
1179
- );
1180
- const mergedDefaultData = useMemo(() => {
1181
- if (!verifiedBusiness$1) return data;
1182
- return {
1183
- ...data,
1184
- registrationAddress: {
1185
- address: verifiedBusiness$1.street,
1186
- city: verifiedBusiness$1.city,
1187
- postalCode: verifiedBusiness$1.zipCode,
1188
- stateOrProvince: verifiedBusiness$1.state,
1189
- country: verifiedBusiness$1.country
1190
- }
1191
- };
1192
- }, [data, verifiedBusiness$1]);
1193
- const {
1194
- schema: formSchema,
1195
- data: formData,
1196
- errors: formErrors,
1197
- valid: formValid,
1198
- fieldProblems: formFieldProblems,
1199
- handleChangeFor,
1200
- resetToDefaultData,
1201
- setValid
1202
- } = useForm({
1203
- schema: getFormSchema,
1204
- defaultData: mergedDefaultData,
1205
- rules: mergedFieldProps?.validators,
1206
- optionalFields: mergedFieldProps?.optionalFields,
1207
- obscuredFields: mergedFieldProps?.obscuredFields,
1208
- trustedFields: mergedFieldProps?.trustedFields,
1209
- fieldProblems: fieldValidationErrors,
1210
- shouldValidate
1211
- });
1212
- const datasetUtils = datasetUtilities(i18n.language);
1213
- const formUtils = createFormUtils(
1214
- mergedFieldProps ?? initialFormUtilsProps,
1215
- commonT
1216
- );
1217
- useEffect(() => {
1218
- updateStateSlice({
1219
- schema: formSchema,
1220
- data: formData,
1221
- errors: formErrors,
1222
- valid: formValid,
1223
- fieldProblems: formFieldProblems
1224
- });
1225
- }, [formSchema, formData, formErrors, formValid, formFieldProblems, updateStateSlice]);
1226
- const [addressToCheck, setAddressToCheck] = useDebouncedState(500);
1227
- const { data: cleansedRegistrationAddress } = useAddressCleanse(
1228
- {
1229
- text: addressToCheck,
1230
- country: formData?.registrationAddress?.country ?? country
1231
- },
1232
- { enabled: Boolean(addressToCheck) && country !== CountryCodes.Japan }
1233
- );
1234
- const mustProvideOperationalAddress = cleansedRegistrationAddress?.poBox ?? false;
1235
- useEffect(
1236
- () => setAddressToCheck(formatAddressForCleanse(formData?.registrationAddress ?? {})),
1237
- [formData?.registrationAddress, setAddressToCheck]
1238
- );
1239
- const verifiedAddress = useMemo(() => {
1240
- if (!verifiedBusiness$1) return void 0;
1241
- return verifiedBusiness$1.isPrincipalAddress || verifiedBusiness$1.state && basicInformation?.stateOrProvince !== verifiedBusiness$1.state ? { operationalAddress: { ...mapAddressData(verifiedBusiness$1), country } } : {
1242
- registrationAddress: {
1243
- ...mapAddressData(verifiedBusiness$1),
1244
- country,
1245
- stateOrProvince: basicInformation?.stateOrProvince
1246
- }
1247
- };
1248
- }, [verifiedBusiness$1, basicInformation?.stateOrProvince, country]);
1249
- useEffect(() => {
1250
- applyVerifiedBusinessData$1(verifiedBusiness$1, handleChangeFor);
1251
- if (basicInformation && verifiedBusiness$1?.name) {
1252
- basicInformation.legalCompanyName = verifiedBusiness$1.name;
1253
- }
1254
- }, [verifiedBusiness$1]);
1255
- useEffect(() => {
1256
- if (!verifiedBusiness$1 && !showCompanyStructure) resetToDefaultData();
1257
- }, [verifiedBusiness$1]);
1258
- const showField = (fieldKeys) => fieldKeys.some((field) => formUtils.isRequiredField(field) || formUtils.isOptionalField(field));
1259
- const handleRegistrationAddressChange = (state) => {
1260
- handleChangeFor("registrationAddress")(state.data);
1261
- setValid("registrationAddress", Boolean(state.isValid));
1262
- };
1263
- const handleOperationalAddressChange = (state) => {
1264
- handleChangeFor("operationalAddress")(state.data);
1265
- setValid("operationalAddress", Boolean(state.isValid));
1266
- };
1267
- const handleOperationalAddressIsSameChange = useCallback(
1268
- (isChecked) => {
1269
- if (isChecked) {
1270
- handleChangeFor("operationalAddressIsSame")(
1271
- operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_SAME
1272
- );
1273
- setValid("operationalAddress", true);
1274
- } else {
1275
- handleChangeFor("operationalAddressIsSame")(
1276
- operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME
1277
- );
1278
- }
1279
- },
1280
- [handleChangeFor, setValid]
1281
- );
1282
- useEffect(() => {
1283
- if (mustProvideOperationalAddress && formData.operationalAddressIsSame !== operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME) {
1284
- handleOperationalAddressIsSameChange(false);
1285
- }
1286
- }, [
1287
- handleOperationalAddressIsSameChange,
1288
- mustProvideOperationalAddress,
1289
- formData.operationalAddressIsSame
1290
- ]);
1291
- const registrationAddressDescription = useMemo(() => {
1292
- if (formData.registrationAddress?.country) {
1293
- return ["US", "NL", "CZ"].includes(formData.registrationAddress.country) ? t(($) => $["youBusinessOfficalAddressInTheCounty"], {
1294
- country: datasetUtils.getCountryName(formData.registrationAddress.country)
1295
- }) : t(($) => $["youBusinessOfficalAddressInCounty"], {
1296
- country: datasetUtils.getCountryName(formData.registrationAddress.country)
1297
- });
1298
- }
1299
- return t(($) => $["youBusinessOfficalAddress"]);
1300
- }, [datasetUtils, formData?.registrationAddress?.country, i18n]);
1301
- return /* @__PURE__ */ jsxs("form", { id: ADDITIONAL_INFORMATION_FORM_ID, className: "adyen-kyc-additional-information", children: [
1302
- heading && /* @__PURE__ */ jsx(Header, { title: heading, description }),
1303
- /* @__PURE__ */ jsx(
1304
- ErrorPanel,
1305
- {
1306
- id: "ariaErrorField",
1307
- verificationErrors: formVerificationErrors,
1308
- validationErrors: fieldValidationErrors,
1309
- formUtils
1310
- }
1311
- ),
1312
- /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-additional-information__content", children: [
1313
- showVerified && /* @__PURE__ */ jsxs("section", { children: [
1314
- /* @__PURE__ */ jsx("div", { className: "adyen-kyc-additional-information__section-heading", children: /* @__PURE__ */ jsx(Typography, { el: "h3", variant: "title", children: t(($) => $["verifiedInformation"]) }) }),
1315
- /* @__PURE__ */ jsx(
1316
- VerifiedBusinessCard,
1317
- {
1318
- verifiedBusiness: verifiedBusiness$1,
1319
- verifiedAddress: verifiedAddress?.registrationAddress ?? verifiedAddress?.operationalAddress
1320
- }
1321
- )
1322
- ] }),
1323
- /* @__PURE__ */ jsxs("section", { children: [
1324
- showVerified && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-additional-information__section-heading", children: /* @__PURE__ */ jsx(Typography, { el: "h3", variant: "title", children: t(($) => $["otherBusinessInformation"]) }) }),
1325
- /* @__PURE__ */ jsxs("fieldset", { children: [
1326
- showField(LEGAL_FORM_FIELDS) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
1327
- LegalFormField,
1328
- {
1329
- name: "legalForm",
1330
- countryCode: country,
1331
- data: {
1332
- legalForm: formUtils.getFieldData(formData, LEGAL_FORM_FIELDS)?.legalForm
1333
- },
1334
- valid: formUtils.getFieldValid(formValid, LEGAL_FORM_FIELDS),
1335
- errorMessage: formErrors.legalForm?.errorMessage,
1336
- handleChangeFor,
1337
- readonly: false,
1338
- label: formUtils.getLabel("legalForm", "businessStructure")
1339
- }
1340
- ) }),
1341
- /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
1342
- DBANameField,
1343
- {
1344
- data: formUtils.getFieldData(formData, DBA_NAME_FIELD),
1345
- valid: formUtils.getFieldValid(formValid, DBA_NAME_FIELD),
1346
- errors: formUtils.getFieldErrors(formErrors, formFieldProblems, DBA_NAME_FIELD),
1347
- labels: formUtils.getFieldLabels(DBA_NAME_FIELD, {
1348
- hasDoingBusinessAs: "hasDba"
1349
- }),
1350
- readonly: formUtils.isReadOnly("doingBusinessAs"),
1351
- handleChangeFor
1352
- }
1353
- ) }),
1354
- showField(BUSINESS_REGISTRATION_NUMBER_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
1355
- BusinessRegistrationNumberField,
1356
- {
1357
- data: formUtils.getFieldData(formData, BUSINESS_REGISTRATION_NUMBER_FIELD),
1358
- valid: formUtils.getFieldValid(formValid, BUSINESS_REGISTRATION_NUMBER_FIELD),
1359
- errors: formUtils.getFieldErrors(
1360
- formErrors,
1361
- formFieldProblems,
1362
- BUSINESS_REGISTRATION_NUMBER_FIELD
1363
- ),
1364
- labels: formUtils.getFieldLabels(BUSINESS_REGISTRATION_NUMBER_FIELD, {
1365
- exemptedFromRegistrationNumber: "iDontHaveARegistrationNumber"
1366
- }),
1367
- mask: formUtils.getMask("registrationNumber"),
1368
- guidanceText: formUtils.getFieldGuidanceText(BUSINESS_REGISTRATION_NUMBER_FIELD),
1369
- placeholders: formUtils.getFieldPlaceholders(BUSINESS_REGISTRATION_NUMBER_FIELD),
1370
- helperText: formUtils.getFieldHelperText(BUSINESS_REGISTRATION_NUMBER_FIELD),
1371
- readonly: formUtils.isReadOnly("registrationNumber"),
1372
- optional: formUtils.isOptionalField("registrationNumber"),
1373
- shouldValidate,
1374
- handleChangeFor,
1375
- country,
1376
- canExempt: formUtils.isRequiredField("exemptedFromRegistrationNumber"),
1377
- companyType
1378
- }
1379
- ) }),
1380
- showField(TAX_INFORMATION_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
1381
- TaxInformationField,
1382
- {
1383
- data: formUtils.getFieldData(formData, TAX_INFORMATION_FIELD),
1384
- valid: formUtils.getFieldValid(formValid, TAX_INFORMATION_FIELD),
1385
- errors: formUtils.getFieldErrors(
1386
- formErrors,
1387
- formFieldProblems,
1388
- TAX_INFORMATION_FIELD
1389
- ),
1390
- labels: formUtils.getFieldLabels(TAX_INFORMATION_FIELD, {
1391
- exemptedFromTax: "iDontHaveATaxId"
1392
- }),
1393
- mask: formUtils.getMask("taxInformation"),
1394
- guidanceText: formUtils.getFieldGuidanceText(TAX_INFORMATION_FIELD),
1395
- readonly: formUtils.isReadOnly("taxInformation"),
1396
- shouldValidate,
1397
- handleChangeFor,
1398
- canExempt: formUtils.isRequiredField("exemptedFromTax"),
1399
- country,
1400
- entityType: companyType,
1401
- defaultData: data?.taxInformation,
1402
- registrationNumber: formData?.registrationNumber
1403
- }
1404
- ) }),
1405
- showField(VAT_NUMBER_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
1406
- VatNumberField,
1407
- {
1408
- data: formUtils.getFieldData(formData, VAT_NUMBER_FIELD),
1409
- valid: formUtils.getFieldValid(formValid, VAT_NUMBER_FIELD),
1410
- errors: formUtils.getFieldErrors(formErrors, formFieldProblems, VAT_NUMBER_FIELD),
1411
- labels: formUtils.getFieldLabels(VAT_NUMBER_FIELD, {
1412
- exemptedFromVat: "iDontHaveAVatNumber"
1413
- }),
1414
- mask: formUtils.getMask("vatNumber"),
1415
- guidanceText: formUtils.getFieldGuidanceText(VAT_NUMBER_FIELD),
1416
- placeholders: formUtils.getFieldPlaceholders(VAT_NUMBER_FIELD),
1417
- readonly: formUtils.isReadOnly("vatNumber"),
1418
- handleChangeFor,
1419
- country,
1420
- canExempt: formUtils.isRequiredField("exemptedFromVat") || formUtils.isOptionalField("exemptedFromVat"),
1421
- shouldValidate
1422
- }
1423
- ) }),
1424
- formUtils.isRequiredField("eInvoicingCode", false) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
1425
- EInvoicingCodeField,
1426
- {
1427
- data: formUtils.getFieldData(formData, EINVOICING_CODE_FIELD),
1428
- valid: formUtils.getFieldValid(formValid, EINVOICING_CODE_FIELD),
1429
- errors: formUtils.getFieldErrors(
1430
- formErrors,
1431
- formFieldProblems,
1432
- EINVOICING_CODE_FIELD
1433
- ),
1434
- labels: formUtils.getFieldLabels(EINVOICING_CODE_FIELD),
1435
- placeholders: formUtils.getFieldPlaceholders(EINVOICING_CODE_FIELD),
1436
- mask: formUtils.getMask("eInvoicingCode"),
1437
- guidanceText: formUtils.getFieldGuidanceText(EINVOICING_CODE_FIELD),
1438
- readonly: formUtils.isReadOnly("eInvoicingCode"),
1439
- handleChangeFor
1440
- }
1441
- ) }),
1442
- showField(INDUSTRY_CODE_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
1443
- IndustryCodeField,
1444
- {
1445
- data: formUtils.getFieldData(formData, INDUSTRY_CODE_FIELD),
1446
- valid: formUtils.getFieldValid(formValid, INDUSTRY_CODE_FIELD),
1447
- errors: formUtils.getFieldErrors(
1448
- formErrors,
1449
- formFieldProblems,
1450
- INDUSTRY_CODE_FIELD
1451
- ),
1452
- labels: {
1453
- industryCodes: t(($) => $["industry"], {
1454
- ns: "businessLines"
1455
- })
1456
- },
1457
- guidanceText: {
1458
- industryCodes: t(($) => $["primaryIndustryCodeGuidance"], {
1459
- ns: "businessLines"
1460
- })
1461
- },
1462
- readonly: formUtils.isReadOnly("industryCodes"),
1463
- handleChangeFor,
1464
- businessLineTypes,
1465
- single: true
1466
- }
1467
- ) }),
1468
- showField(DATE_OF_INCORPORATION_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
1469
- DateOfIncorporationField,
1470
- {
1471
- data: formUtils.getFieldData(formData, DATE_OF_INCORPORATION_FIELD),
1472
- valid: formUtils.getFieldValid(formValid, DATE_OF_INCORPORATION_FIELD),
1473
- errors: formUtils.getFieldErrors(
1474
- formErrors,
1475
- formFieldProblems,
1476
- DATE_OF_INCORPORATION_FIELD
1477
- ),
1478
- labels: formUtils.getFieldLabels(DATE_OF_INCORPORATION_FIELD),
1479
- placeholders: formUtils.getFieldPlaceholders(DATE_OF_INCORPORATION_FIELD, {
1480
- dateOfIncorporation: "datePlaceholder"
1481
- }),
1482
- readonly: formUtils.isReadOnly("dateOfIncorporation"),
1483
- handleChangeFor
1484
- }
1485
- ) })
1486
- ] })
1487
- ] }),
1488
- showStockData && /* @__PURE__ */ jsxs("section", { children: [
1489
- /* @__PURE__ */ jsx("div", { className: "adyen-kyc-additional-information__section-heading", children: /* @__PURE__ */ jsx(Typography, { el: "h3", variant: "title", children: t(($) => $["stockExchangeInformation"]) }) }),
1490
- /* @__PURE__ */ jsxs("fieldset", { children: [
1491
- showField(STOCK_EXCHANGE_MIC_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
1492
- StockExchangeMICField,
1493
- {
1494
- data: formUtils.getFieldData(formData, STOCK_EXCHANGE_MIC_FIELD),
1495
- valid: formUtils.getFieldValid(formValid, STOCK_EXCHANGE_MIC_FIELD),
1496
- errors: formUtils.getFieldErrors(
1497
- formErrors,
1498
- formFieldProblems,
1499
- STOCK_EXCHANGE_MIC_FIELD
1500
- ),
1501
- labels: formUtils.getFieldLabels(STOCK_EXCHANGE_MIC_FIELD),
1502
- placeholders: formUtils.getFieldPlaceholders(STOCK_EXCHANGE_MIC_FIELD),
1503
- mask: formUtils.getMask("stockExchangeMIC"),
1504
- guidanceText: formUtils.getFieldGuidanceText(STOCK_EXCHANGE_MIC_FIELD),
1505
- readonly: formUtils.isReadOnly("stockExchangeMIC"),
1506
- shouldValidate,
1507
- handleChangeFor
1508
- }
1509
- ) }),
1510
- showField(STOCK_ISIN_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
1511
- StockISINField,
1512
- {
1513
- data: formUtils.getFieldData(formData, STOCK_ISIN_FIELD),
1514
- valid: formUtils.getFieldValid(formValid, STOCK_ISIN_FIELD),
1515
- errors: formUtils.getFieldErrors(
1516
- formErrors,
1517
- formFieldProblems,
1518
- STOCK_ISIN_FIELD
1519
- ),
1520
- labels: formUtils.getFieldLabels(STOCK_ISIN_FIELD),
1521
- placeholders: formUtils.getFieldPlaceholders(STOCK_ISIN_FIELD),
1522
- mask: formUtils.getMask("stockISIN"),
1523
- guidanceText: formUtils.getFieldGuidanceText(STOCK_ISIN_FIELD),
1524
- readonly: formUtils.isReadOnly("stockISIN"),
1525
- shouldValidate,
1526
- handleChangeFor
1527
- }
1528
- ) }),
1529
- showField(STOCK_TICKER_SYMBOL_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
1530
- StockTickerSymbolField,
1531
- {
1532
- data: formUtils.getFieldData(formData, STOCK_TICKER_SYMBOL_FIELD),
1533
- valid: formUtils.getFieldValid(formValid, STOCK_TICKER_SYMBOL_FIELD),
1534
- errors: formUtils.getFieldErrors(
1535
- formErrors,
1536
- formFieldProblems,
1537
- STOCK_TICKER_SYMBOL_FIELD
1538
- ),
1539
- labels: formUtils.getFieldLabels(STOCK_TICKER_SYMBOL_FIELD),
1540
- placeholders: formUtils.getFieldPlaceholders(STOCK_TICKER_SYMBOL_FIELD),
1541
- mask: formUtils.getMask("stockTickerSymbol"),
1542
- guidanceText: formUtils.getFieldGuidanceText(STOCK_TICKER_SYMBOL_FIELD),
1543
- readonly: formUtils.isReadOnly("stockTickerSymbol"),
1544
- shouldValidate,
1545
- handleChangeFor
1546
- }
1547
- ) })
1548
- ] })
1549
- ] }),
1550
- /* @__PURE__ */ jsxs("section", { "data-testid": "registeredBusinessAddress", children: [
1551
- /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-additional-information__section-heading", children: [
1552
- /* @__PURE__ */ jsx(Typography, { el: "h3", variant: "title", children: t(($) => $["registeredBusinessAddress"]) }),
1553
- /* @__PURE__ */ jsx(Typography, { el: "p", variant: "body", children: registrationAddressDescription })
1554
- ] }),
1555
- country === CountryCodes.Japan ? /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
1556
- LazyJpAddress$1,
1557
- {
1558
- id: ADDITIONAL_INFORMATION_FORM_ID,
1559
- addressType: "registrationAddress",
1560
- data: { ...mergedDefaultData?.registrationAddress, country },
1561
- shouldValidate,
1562
- onChange: handleRegistrationAddressChange
1563
- }
1564
- ) }) : /* @__PURE__ */ jsx(
1565
- Address,
1566
- {
1567
- id: ADDITIONAL_INFORMATION_FORM_ID,
1568
- addressType: "registrationAddress",
1569
- data: {
1570
- ...mergedDefaultData?.registrationAddress,
1571
- country
1572
- },
1573
- labels: getAddressSchemaLabelsByCountry(
1574
- data?.registrationAddress?.country ?? country
1575
- ),
1576
- requiredFields: addressSchema,
1577
- shouldValidate,
1578
- hideCountry: true,
1579
- optionalFields: ["otherAddressInformation"],
1580
- readOnlyFields: verifiedBusiness$1?.state && verifiedBusiness$1?.state === basicInformation?.stateOrProvince ? ["stateOrProvince"] : [],
1581
- trustedFields: getNestedTrustedFields("registrationAddress", data, trustedFields),
1582
- onChange: handleRegistrationAddressChange,
1583
- verifiedBusiness: verifiedBusiness$1,
1584
- verifiedAddress: verifiedAddress?.registrationAddress,
1585
- condensed: true
1586
- }
1587
- )
1588
- ] }),
1589
- /* @__PURE__ */ jsxs("section", { "data-testid": "principalPlaceOfBusiness", children: [
1590
- /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-additional-information__section-heading", children: [
1591
- /* @__PURE__ */ jsx(Typography, { el: "h3", variant: "title", children: t(($) => $["principalPlaceOfBusiness"]) }),
1592
- /* @__PURE__ */ jsx(Typography, { el: "p", variant: "body", children: t(($) => $["thePhysicalLocationWhereABusiness"]) })
1593
- ] }),
1594
- !mustProvideOperationalAddress && /* @__PURE__ */ jsx(
1595
- Field,
1596
- {
1597
- name: "operationalAddressIsSame",
1598
- errorMessage: formErrors.operationalAddressIsSame,
1599
- isValid: formValid.operationalAddressIsSame,
1600
- children: (childProps) => /* @__PURE__ */ jsx(
1601
- Checkbox,
1602
- {
1603
- ...childProps,
1604
- "aria-required": formUtils.isRequiredField("operationalAddressIsSame"),
1605
- "aria-invalid": !formValid.operationalAddressIsSame,
1606
- name: "operationalAddressIsSame",
1607
- label: formUtils.getLabel("sameAsRegisteredAddress"),
1608
- checked: formData.operationalAddressIsSame ? formData.operationalAddressIsSame === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_SAME : true,
1609
- onChange: handleOperationalAddressIsSameChange
1610
- }
1611
- )
1612
- }
1613
- ),
1614
- formData.operationalAddressIsSame === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME && (country === CountryCodes.Japan ? /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
1615
- LazyJpAddress$1,
1616
- {
1617
- id: ADDITIONAL_INFORMATION_FORM_ID,
1618
- addressType: "operationalAddress",
1619
- data: { ...mergedDefaultData?.operationalAddress, country },
1620
- shouldValidate,
1621
- onChange: handleOperationalAddressChange
1622
- }
1623
- ) }) : /* @__PURE__ */ jsx(
1624
- Address,
1625
- {
1626
- id: ADDITIONAL_INFORMATION_FORM_ID,
1627
- addressType: "operationalAddress",
1628
- data: {
1629
- ...mergedDefaultData?.operationalAddress,
1630
- country
1631
- },
1632
- labels: getAddressSchemaLabelsByCountry(
1633
- data?.operationalAddress?.country ?? country
1634
- ),
1635
- requiredFields: addressSchema,
1636
- shouldValidate,
1637
- hideCountry: true,
1638
- optionalFields: ["otherAddressInformation"],
1639
- trustedFields: getNestedTrustedFields("operationalAddress", data, trustedFields),
1640
- onChange: handleOperationalAddressChange,
1641
- verifiedBusiness: verifiedBusiness$1,
1642
- verifiedAddress: verifiedAddress?.operationalAddress,
1643
- condensed: true
1644
- }
1645
- ))
1646
- ] })
1647
- ] })
1648
- ] });
1649
- }
1650
- const JAPANESE_LEGAL_COMPANY_NAME_FIELDS = ["jaHaniLegalCompanyName", "jaKanaLegalCompanyName"];
1651
- function useLegalCompanyNameField({
1652
- data,
1653
- valid,
1654
- errors,
1655
- fieldProblems,
1656
- country,
1657
- formUtils,
1658
- handleChange
1659
- }) {
1660
- const fieldKeys = getFieldKeys(country);
1661
- const labels = formUtils.getFieldLabels(fieldKeys);
1662
- const fieldErrors = formUtils.getFieldErrors(errors, fieldProblems, fieldKeys);
1663
- const helperTexts = formUtils.getFieldHelperText(fieldKeys, {
1664
- legalCompanyName: "legalCompanyName__helperText"
1665
- });
1666
- const fieldsTransformInput = {
1667
- jaHaniLegalCompanyName: (value) => toFullWidth(value),
1668
- jaKanaLegalCompanyName: (value) => toFullWidth(value)
1669
- };
1670
- const fieldsTransformMode = {
1671
- jaHaniLegalCompanyName: "blur",
1672
- jaKanaLegalCompanyName: "blur"
1673
- };
1674
- return fieldKeys.map((fieldKey) => {
1675
- const shouldShowField = formUtils.isRequiredField(fieldKey) || formUtils.isOptionalField(fieldKey);
1676
- if (shouldShowField) {
1677
- return {
1678
- name: fieldKey,
1679
- value: data[fieldKey] ?? "",
1680
- readonly: formUtils.isReadOnly(fieldKey),
1681
- onInput: handleChange(fieldKey, "input"),
1682
- onBlur: handleChange(fieldKey, "blur"),
1683
- isValid: valid[fieldKey],
1684
- errorMessage: fieldErrors[fieldKey],
1685
- label: labels[fieldKey],
1686
- helper: helperTexts[fieldKey],
1687
- onKeyDown: handleKeyDown,
1688
- transformInput: fieldsTransformInput[fieldKey],
1689
- transformMode: fieldsTransformMode[fieldKey]
1690
- };
1691
- }
1692
- });
1693
- }
1694
- const getFieldKeys = (country) => {
1695
- switch (country) {
1696
- case "JP":
1697
- return [...JAPANESE_LEGAL_COMPANY_NAME_FIELDS, ...LEGAL_COMPANY_NAME_FIELD];
1698
- default:
1699
- return LEGAL_COMPANY_NAME_FIELD;
1700
- }
1701
- };
1702
- const handleKeyDown = (e) => {
1703
- if (e.key === KEYBOARD_KEYS.enter) {
1704
- e.preventDefault();
1705
- }
1706
- };
1707
- const CountryFieldValidation = () => ({
1708
- country: {
1709
- modes: ["blur"],
1710
- validate: (country) => !isEmpty(country),
1711
- errorMessage: "fieldIsRequired"
1712
- }
1713
- });
1714
- const COUNTRY_OF_GOVERNING_LAW_FIELD = [
1715
- "countryOfGoverningLaw"
1716
- ];
1717
- function CountryOfGoverningLawField({
1718
- data,
1719
- valid,
1720
- errors,
1721
- labels,
1722
- readonly,
1723
- handleChangeFor,
1724
- helperText,
1725
- allowedCountries,
1726
- country
1727
- }) {
1728
- const { t } = useTranslation("common");
1729
- useEffect(() => {
1730
- if (country === CountryCodes.UnitedKingdom && !data.countryOfGoverningLaw) {
1731
- const countryOfGoverningLawEvent = {
1732
- target: {
1733
- name: "countryOfGoverningLaw",
1734
- value: CountryCodes.UnitedKingdom
1735
- }
1736
- };
1737
- handleChangeFor("countryOfGoverningLaw")(countryOfGoverningLawEvent);
1738
- }
1739
- }, [country]);
1740
- return /* @__PURE__ */ jsx(
1741
- CountryField,
1742
- {
1743
- name: "countryOfGoverningLaw",
1744
- data: { country: data.countryOfGoverningLaw },
1745
- valid: { country: valid.countryOfGoverningLaw },
1746
- errors: {
1747
- country: errors.countryOfGoverningLaw
1748
- },
1749
- labels: { country: labels?.countryOfGoverningLaw || t(($) => $["countryOfGoverningLaw"]) },
1750
- readonly,
1751
- allowedCountries,
1752
- handleChangeFor: () => handleChangeFor("countryOfGoverningLaw"),
1753
- helperText: { country: helperText?.countryOfGoverningLaw }
1754
- }
1755
- );
1756
- }
1757
- const CountryOfGoverningLawFieldValidation = () => ({
1758
- countryOfGoverningLaw: {
1759
- modes: ["blur"],
1760
- validate: (countryOfGoverningLaw) => !isEmpty(countryOfGoverningLaw),
1761
- errorMessage: "fieldIsRequired"
1762
- }
1763
- });
1764
- const defaultJaHaniLegalCompanyNameFieldMetadata = {
1765
- label: "jaHaniLegalCompanyName"
1766
- };
1767
- const defaultJaKanaLegalCompanyNameFieldMetadata = {
1768
- label: "jaKanaLegalCompanyName"
1769
- };
1770
- const defaultJaHaniLegalCompanyNameFieldConfig = {
1771
- label: "jaHaniLegalCompanyName",
1772
- validators: validateJaHaniLegalCompanyName
1773
- };
1774
- const defaultJaKanaLegalCompanyNameFieldConfig = {
1775
- label: "jaKanaLegalCompanyName",
1776
- validators: validateJaKanaLegalCompanyName
1777
- };
1778
- const localizedLegalCompanyNameFieldConfig = {
1779
- jaHaniLegalCompanyName: {
1780
- config: defaultJaHaniLegalCompanyNameFieldConfig,
1781
- metadata: defaultJaHaniLegalCompanyNameFieldMetadata
1782
- },
1783
- jaKanaLegalCompanyName: {
1784
- config: defaultJaKanaLegalCompanyNameFieldConfig,
1785
- metadata: defaultJaKanaLegalCompanyNameFieldMetadata
1786
- }
1787
- };
1788
- const defaultFieldMetadata = {
1789
- label: "stateOrProvince",
1790
- placeholder: "stateOrProvince__placeHolder",
1791
- validators: validateNotEmptyOnBlur
1792
- };
1793
- const defaultFieldConfig = {
1794
- [CountryCodes.Australia]: {
1795
- label: "state",
1796
- placeholder: "selectState",
1797
- validators: validateNotEmptyOnBlur
1798
- },
1799
- [CountryCodes.Brazil]: {
1800
- label: "state",
1801
- placeholder: "selectState",
1802
- validators: validateNotEmptyOnBlur
1803
- },
1804
- [CountryCodes.Canada]: {
1805
- label: "provinceOrTerritory",
1806
- placeholder: "selectProvinceOrTerritory",
1807
- validators: validateNotEmptyOnBlur
1808
- },
1809
- [CountryCodes.NewZealand]: {
1810
- label: "region",
1811
- validators: validateNotEmptyOnBlur
1812
- },
1813
- [CountryCodes.UnitedStates]: ({ isBusiness }) => ({
1814
- label: isBusiness ? "stateOrProvince__US__business" : "state",
1815
- placeholder: "stateOrProvince__placeHolder__US",
1816
- validators: validateNotEmptyOnBlur
1817
- })
1818
- };
1819
- function BusinessInformation({ fetching, selectedBusiness }) {
1820
- const { t } = useTranslation(["common", "business"]);
1821
- const businessInformationClasses = cx("adyen-kyc-business-information", {
1822
- "adyen-kyc-business-information--fetching": fetching
1823
- });
1824
- const items = useMemo(
1825
- () => selectedBusiness ? entriesOf(selectedBusiness).reduce(
1826
- (acc, [key, value]) => {
1827
- switch (key) {
1828
- case "legalForm":
1829
- if (value) acc[0].details = value;
1830
- break;
1831
- case "name":
1832
- if (value) acc[1].details = value;
1833
- break;
1834
- case "address":
1835
- if (value) acc[2].details = value;
1836
- break;
1837
- }
1838
- return acc;
1839
- },
1840
- [
1841
- {
1842
- term: t(($) => $["legalForm"], { ns: "common" }),
1843
- details: ""
1844
- },
1845
- {
1846
- term: t(($) => $["legalCompanyName__US"], { ns: "common" }),
1847
- details: ""
1848
- },
1849
- {
1850
- term: t(($) => $["address"], { ns: "common" }),
1851
- details: ""
1852
- }
1853
- ]
1854
- ).filter((item) => !!item.details) : [],
1855
- [selectedBusiness, t]
1856
- );
1857
- if (fetching) {
1858
- return /* @__PURE__ */ jsx("div", { className: businessInformationClasses, children: /* @__PURE__ */ jsx(Loader, { size: "large" }) });
1859
- }
1860
- if (!fetching) {
1861
- return /* @__PURE__ */ jsx("div", { className: businessInformationClasses, children: /* @__PURE__ */ jsx(StructuredList, { items }) });
1862
- }
1863
- return null;
1864
- }
1865
- function BusinessInformationCard({
1866
- result,
1867
- selectedBusinessId,
1868
- currentBusinessSelection,
1869
- fetching,
1870
- fetchingError,
1871
- invalidTin,
1872
- setIsBusinessSelection,
1873
- handleSelectBusiness,
1874
- refetchCompanySelection,
1875
- handleConfirmSelection,
1876
- handleBackClick
1877
- }) {
1878
- const { t } = useTranslation(["common", "business"]);
1879
- const excludeResultAsGovernmentEntity = useMemo(
1880
- () => isBankAccountRequestedForOrganization.value && currentBusinessSelection?.organizationType === "GOVERNMENTAL_ORGANIZATION",
1881
- [currentBusinessSelection]
1882
- );
1883
- const showSelectButton = useMemo(
1884
- () => !fetching && !fetchingError && currentBusinessSelection && !excludeResultAsGovernmentEntity,
1885
- [currentBusinessSelection, excludeResultAsGovernmentEntity, fetching, fetchingError]
1886
- );
1887
- const handleGoBack = () => {
1888
- if (handleBackClick) {
1889
- handleBackClick();
1890
- } else {
1891
- setIsBusinessSelection?.(false);
1892
- }
1893
- };
1894
- return /* @__PURE__ */ jsx(
1895
- Card,
1896
- {
1897
- "aria-selected": selectedBusinessId === result.id,
1898
- className: "adyen-kyc-business-information-card",
1899
- title: result.name,
1900
- subTitle: result.registrationNumber,
1901
- stateful: true,
1902
- fetching: fetching && selectedBusinessId === result.id,
1903
- active: selectedBusinessId === result.id,
1904
- headerButton: selectedBusinessId === result.id && showSelectButton ? /* @__PURE__ */ jsx(
1905
- Button,
1906
- {
1907
- onClick: () => handleConfirmSelection(currentBusinessSelection),
1908
- testId: "selectBusiness",
1909
- disabled: invalidTin,
1910
- children: t(($) => $["thisIsMyBusiness"], { ns: "business" })
1911
- }
1912
- ) : null,
1913
- onClick: () => handleSelectBusiness(result),
1914
- onKeyDown: handleKeys(["Enter"], () => handleSelectBusiness(result)),
1915
- children: selectedBusinessId === result.id && /* @__PURE__ */ jsxs(Fragment, { children: [
1916
- /* @__PURE__ */ jsx(Divider, {}),
1917
- invalidTin && /* @__PURE__ */ jsx(
1918
- Alert,
1919
- {
1920
- variant: "warning",
1921
- type: "callToAction",
1922
- title: t(($) => $["businessSelection__invalidTin"], { ns: "business" }),
1923
- actions: /* @__PURE__ */ jsx(Button, { testId: "backBtn", onClick: handleGoBack, variant: "link", children: t(($) => $["back"], { ns: "common" }) }),
1924
- testId: "invalidTin"
1925
- }
1926
- ),
1927
- fetchingError && /* @__PURE__ */ jsx(
1928
- Alert,
1929
- {
1930
- variant: "info",
1931
- type: "callToAction",
1932
- title: t(($) => $["businessSelection__failedToLoad"], { ns: "business" }),
1933
- actions: /* @__PURE__ */ jsx(
1934
- Button,
1935
- {
1936
- testId: "reloadBusiness",
1937
- onClick: () => refetchCompanySelection(),
1938
- variant: "link",
1939
- children: t(($) => $["tryAgain"], { ns: "common" })
1940
- }
1941
- ),
1942
- testId: "failedToLoad"
1943
- }
1944
- ),
1945
- excludeResultAsGovernmentEntity && /* @__PURE__ */ jsx(
1946
- Alert,
1947
- {
1948
- variant: "info",
1949
- type: "callToAction",
1950
- title: t(($) => $["businessSelection__unableToOnboardGovernmentEntity"], {
1951
- ns: "business"
1952
- }),
1953
- actions: /* @__PURE__ */ jsx(Button, { onClick: handleGoBack, variant: "link", children: t(($) => $["goBack"], { ns: "common" }) })
1954
- }
1955
- ),
1956
- !fetchingError && !excludeResultAsGovernmentEntity && /* @__PURE__ */ jsx(BusinessInformation, { fetching, selectedBusiness: currentBusinessSelection })
1957
- ] })
1958
- }
1959
- );
1960
- }
1961
- function BusinessSelection({
1962
- showCompanyStructure,
1963
- loading,
1964
- searchResults,
1965
- proceedToManualDataEntry,
1966
- handleNextClick,
1967
- setIsBusinessSelection,
1968
- setShowCompanyStructure
1969
- }) {
1970
- const { t } = useTranslation(["common", "business"]);
1971
- const userEvents = useAnalyticsContext();
1972
- const { basicInformation } = useGlobalData();
1973
- const {
1974
- state: { currentState }
1975
- } = useStateContext();
1976
- const [selectedBusinessId, setSelectedBusinessId] = useState();
1977
- const [fetchParams, setFetchParams] = useState();
1978
- const {
1979
- data: businessData,
1980
- isError: fetchingError,
1981
- isLoading: fetching,
1982
- refetch: refetchCompanySelection
1983
- } = useCompanySelection(fetchParams);
1984
- if (fetching) {
1985
- setVerifiedBusiness(void 0);
1986
- }
1987
- const [prevBusinessData, setPrevBusinessData] = useState(businessData);
1988
- if (prevBusinessData !== businessData) {
1989
- if (businessData?.tinMatched === true && !verifiedBusiness.value) {
1990
- userEvents.addPageEvent("Success", {
1991
- actionType: "select",
1992
- returnValue: "companySelection"
1993
- });
1994
- if (!businessData?.legalForm) {
1995
- setShowCompanyStructure(true);
1996
- handleNextClick();
1997
- }
1998
- setVerifiedBusiness(businessData);
1999
- } else {
2000
- userEvents.addPageEvent("Encountered error", {
2001
- actionType: "select",
2002
- returnValue: "companySelection"
2003
- });
2004
- }
2005
- setPrevBusinessData(businessData);
2006
- }
2007
- const currentTin = basicInformation?.taxInformation?.find(
2008
- (taxId) => taxId.country === basicInformation.country
2009
- )?.number;
2010
- const handleSelectBusiness = useCallback(
2011
- async (result) => {
2012
- if ((!selectedBusinessId || selectedBusinessId !== result.id) && currentTin) {
2013
- userEvents.addPageEvent("Clicked button", {
2014
- actionType: "select",
2015
- label: "selectBusiness",
2016
- additionalData: {
2017
- companyIdx: searchResults?.findIndex((searchResult) => searchResult.id === result.id)
2018
- }
2019
- });
2020
- setSelectedBusinessId(result.id);
2021
- setFetchParams({
2022
- company: result,
2023
- state: basicInformation?.stateOrProvince,
2024
- name: result.name,
2025
- tin: currentTin
2026
- });
2027
- }
2028
- },
2029
- [searchResults, basicInformation?.stateOrProvince, selectedBusinessId, currentTin, userEvents]
2030
- );
2031
- const handleConfirmSelection = async () => {
2032
- handleNextClick();
2033
- };
2034
- const showLoader = loading || fetching && searchResults?.length === 1;
2035
- const businessSelectionClasses = cx("adyen-kyc-business-selection", {
2036
- "adyen-kyc-business-selection--loading": showLoader
2037
- });
2038
- const loaderClasses = cx("adyen-kyc-business-selection__loader", {
2039
- "adyen-kyc-business-selection__loader--hide": !showLoader
2040
- });
2041
- if (searchResults?.length) {
2042
- const idxNameMatch = searchResults.findIndex(
2043
- (result) => isNormalizedStringMatch(
2044
- currentState?.data?.basicInformation?.legalCompanyName || "",
2045
- result.name
2046
- )
2047
- );
2048
- if (idxNameMatch > -1) {
2049
- searchResults.unshift(searchResults.splice(idxNameMatch, 1)[0]);
2050
- }
2051
- }
2052
- if (searchResults?.length && !showCompanyStructure || showLoader) {
2053
- return /* @__PURE__ */ jsxs("div", { className: businessSelectionClasses, children: [
2054
- /* @__PURE__ */ jsx("div", { className: loaderClasses, "data-testId": "business-selection-loader", children: /* @__PURE__ */ jsx(Loader, { size: "large" }) }),
2055
- !!(searchResults?.length && !showCompanyStructure && !showLoader) && /* @__PURE__ */ jsxs(Fragment, { children: [
2056
- /* @__PURE__ */ jsx(Header, { title: t(($) => $["businessSelectionFormHeading"], { ns: "common" }) }),
2057
- /* @__PURE__ */ jsx(StackLayout, { children: searchResults?.map((result) => /* @__PURE__ */ jsx(
2058
- BusinessInformationCard,
2059
- {
2060
- result,
2061
- selectedBusinessId,
2062
- currentBusinessSelection: businessData,
2063
- fetching,
2064
- fetchingError,
2065
- invalidTin: businessData?.tinMatched === false,
2066
- handleSelectBusiness,
2067
- refetchCompanySelection,
2068
- handleConfirmSelection,
2069
- setIsBusinessSelection
2070
- },
2071
- result.id
2072
- )) }),
2073
- /* @__PURE__ */ jsxs(
2074
- Typography,
2075
- {
2076
- el: "span",
2077
- color: "secondary",
2078
- className: "adyen-kyc-business-selection__footer",
2079
- children: [
2080
- t(($) => $["businessSelection__footer"], { ns: "business" }),
2081
- /* @__PURE__ */ jsx(Button, { variant: "link", onClick: proceedToManualDataEntry, testId: "manualDataEntry", children: t(($) => $["businessSelection__footerButton"], { ns: "business" }) })
2082
- ]
2083
- }
2084
- )
2085
- ] })
2086
- ] });
2087
- }
2088
- return null;
2089
- }
2090
- const BASIC_INFORMATION_FORM_ID = "basicInformation";
2091
- const BASIC_INFORMATION_FIELDS = [
2092
- ...COUNTRY_FIELD,
2093
- ...LEGAL_COMPANY_NAME_FIELD,
2094
- "jaHaniLegalCompanyName",
2095
- "jaKanaLegalCompanyName",
2096
- ...TAX_INFORMATION_FIELD,
2097
- ...STATE_FIELD,
2098
- ...BUSINESS_REGISTRATION_NUMBER_FIELD,
2099
- ...COUNTRY_OF_GOVERNING_LAW_FIELD
2100
- ];
2101
- function BasicInformation({
2102
- data,
2103
- labels,
2104
- placeholders,
2105
- helperText,
2106
- heading,
2107
- description,
2108
- readOnly,
2109
- shouldValidate,
2110
- formVerificationErrors,
2111
- fieldValidationErrors,
2112
- allFields,
2113
- requiredFields,
2114
- obscuredFields,
2115
- optionalFields,
2116
- readOnlyFields,
2117
- trustedFields,
2118
- country,
2119
- companyType = CompanyTypesValues.PRIVATE_COMPANY,
2120
- isTopLevelEntity,
2121
- className,
2122
- showBusinessSelection,
2123
- showCompanyStructure,
2124
- isActiveForm,
2125
- loading,
2126
- searchResults,
2127
- proceedToManualDataEntry,
2128
- handleNextClick,
2129
- setShowBusinessSelection,
2130
- setShowCompanyStructure,
2131
- disableCountry
2132
- }) {
2133
- const { updateStateSlice, sliceData } = useGlobalDataSlice(BASIC_INFORMATION_FORM_ID);
2134
- const { t } = useTranslation("common");
2135
- const { isSettingEnabled } = useSettingsContext();
2136
- const { isExperimentEnabled } = useExperimentsContext();
2137
- const allowedCountries = useAllowedCountries();
2138
- const isAllowedEditPrefilledCountry = isSettingEnabled(SettingNames.AllowPrefilledCountryEdit);
2139
- const verifiedBusiness$1 = verifiedBusiness.value;
2140
- const currentCountryTaxInformation = sliceData?.taxInformation?.find(
2141
- (tax) => tax.country === country
2142
- );
2143
- const getFormSchema = useCallback(
2144
- (currentData) => {
2145
- const fieldsToRemove = [];
2146
- if (currentData.country !== CountryCodes.UnitedKingdom) {
2147
- fieldsToRemove.push("countryOfGoverningLaw");
2148
- }
2149
- if (currentData.exemptedFromTax) {
2150
- fieldsToRemove.push("taxInformation");
2151
- }
2152
- return requiredFields?.filter((field) => !fieldsToRemove.includes(field)) ?? [
2153
- ...COUNTRY_FIELD,
2154
- ...LEGAL_COMPANY_NAME_FIELD
2155
- ];
2156
- },
2157
- [requiredFields]
2158
- );
2159
- const initialFormUtilsProps = useMemo(
2160
- () => ({
2161
- labels,
2162
- placeholders,
2163
- helperText,
2164
- readOnly,
2165
- allFields,
2166
- requiredFields,
2167
- readOnlyFields,
2168
- optionalFields,
2169
- obscuredFields,
2170
- trustedFields,
2171
- shouldValidate
2172
- }),
2173
- [
2174
- allFields,
2175
- helperText,
2176
- labels,
2177
- obscuredFields,
2178
- optionalFields,
2179
- placeholders,
2180
- readOnly,
2181
- readOnlyFields,
2182
- requiredFields,
2183
- trustedFields,
2184
- shouldValidate
2185
- ]
2186
- );
2187
- const mergedFieldProps = useMemo(
2188
- () => initialFormUtilsProps.allFields?.reduce((acc, field) => {
2189
- switch (field) {
2190
- case "country":
2191
- return {
2192
- ...acc,
2193
- validators: { ...acc.validators, ...CountryFieldValidation() }
2194
- };
2195
- case "legalCompanyName":
2196
- return mergeFieldMetadataIntoProps(
2197
- field,
2198
- resolveFieldMetadata(
2199
- isExperimentEnabled("StrictNameAndAddressValidationV4") ? defaultFieldConfigV4[country] : defaultFieldConfig$2[country],
2200
- { isBusiness: true },
2201
- isExperimentEnabled("StrictNameAndAddressValidationV4") ? defaultFieldMetadataV4 : defaultFieldMetadata$2
2202
- ),
2203
- acc
2204
- );
2205
- case "countryOfGoverningLaw":
2206
- return {
2207
- ...acc,
2208
- validators: { ...acc.validators, ...CountryOfGoverningLawFieldValidation() }
2209
- };
2210
- case "stateOrProvince":
2211
- return mergeFieldMetadataIntoProps(
2212
- field,
2213
- resolveFieldMetadata(
2214
- defaultFieldConfig[country],
2215
- { isBusiness: true },
2216
- defaultFieldMetadata
2217
- ),
2218
- acc
2219
- );
2220
- case "taxInformation":
2221
- return mergeFieldMetadataIntoProps(
2222
- field,
2223
- resolveFieldMetadata(
2224
- taxInformationDefaultFieldConfig[country],
2225
- {
2226
- taxIdNumberType: currentCountryTaxInformation?.type,
2227
- companyType
2228
- },
2229
- taxInformationDefaultFieldMetadata
2230
- ),
2231
- acc
2232
- );
2233
- case "registrationNumber":
2234
- return mergeFieldMetadataIntoProps(
2235
- field,
2236
- resolveFieldMetadata(
2237
- registrationNumberDefaultFieldConfig[country],
2238
- {
2239
- companyType,
2240
- registrationNumberType: sliceData?.registrationNumberType,
2241
- state: sliceData?.stateOrProvince,
2242
- isExperimentEnabled
2243
- },
2244
- registrationNumberDefaultFieldMetadata
2245
- ),
2246
- acc
2247
- );
2248
- case "exemptedFromRegistrationNumber":
2249
- return mergeFieldMetadataIntoProps(
2250
- field,
2251
- resolveFieldMetadata(
2252
- exemptFromRegistrationNumberDefaultFieldConfig[country],
2253
- {},
2254
- exemptFromRegistrationNumberDefaultFieldMetadata
2255
- ),
2256
- acc
2257
- );
2258
- case "jaHaniLegalCompanyName":
2259
- return mergeFieldMetadataIntoProps(
2260
- field,
2261
- resolveFieldMetadata(
2262
- localizedLegalCompanyNameFieldConfig.jaHaniLegalCompanyName.config,
2263
- {},
2264
- localizedLegalCompanyNameFieldConfig.jaHaniLegalCompanyName.metadata
2265
- ),
2266
- acc
2267
- );
2268
- case "jaKanaLegalCompanyName":
2269
- return mergeFieldMetadataIntoProps(
2270
- field,
2271
- resolveFieldMetadata(
2272
- localizedLegalCompanyNameFieldConfig.jaKanaLegalCompanyName.config,
2273
- {},
2274
- localizedLegalCompanyNameFieldConfig.jaKanaLegalCompanyName.metadata
2275
- ),
2276
- acc
2277
- );
2278
- default:
2279
- return acc;
2280
- }
2281
- }, initialFormUtilsProps),
2282
- [
2283
- initialFormUtilsProps,
2284
- isExperimentEnabled,
2285
- country,
2286
- currentCountryTaxInformation?.type,
2287
- companyType,
2288
- sliceData
2289
- ]
2290
- );
2291
- const {
2292
- schema: formSchema,
2293
- data: formData,
2294
- errors: formErrors,
2295
- valid: formValid,
2296
- fieldProblems: formFieldProblems,
2297
- handleChangeFor
2298
- } = useForm({
2299
- schema: getFormSchema,
2300
- defaultData: data,
2301
- rules: mergedFieldProps?.validators,
2302
- optionalFields: mergedFieldProps?.optionalFields,
2303
- obscuredFields: mergedFieldProps?.obscuredFields,
2304
- trustedFields: mergedFieldProps?.trustedFields,
2305
- fieldProblems: fieldValidationErrors,
2306
- shouldValidate
2307
- });
2308
- const formUtils = createFormUtils(
2309
- mergedFieldProps ?? initialFormUtilsProps,
2310
- t
2311
- );
2312
- useEffect(() => {
2313
- updateStateSlice({
2314
- schema: formSchema,
2315
- data: formData,
2316
- errors: formErrors,
2317
- valid: formValid,
2318
- fieldProblems: formFieldProblems
2319
- });
2320
- }, [formSchema, formData, formErrors, formFieldProblems, formValid, updateStateSlice]);
2321
- useEffect(() => {
2322
- if (!isActiveForm && !searchResults?.length) setShowBusinessSelection(false);
2323
- }, [isActiveForm, searchResults?.length, setShowBusinessSelection]);
2324
- useEffect(() => {
2325
- if (showBusinessSelection && showCompanyStructure && isActiveForm) {
2326
- handleNextClick();
2327
- if (verifiedBusiness$1) setShowBusinessSelection(false);
2328
- }
2329
- }, [
2330
- showBusinessSelection,
2331
- showCompanyStructure,
2332
- handleNextClick,
2333
- isActiveForm,
2334
- verifiedBusiness$1,
2335
- setShowBusinessSelection
2336
- ]);
2337
- const classNames = className ? cx("adyen-kyc-basic-information", className) : "adyen-kyc-basic-information";
2338
- const showField = (fieldKeys) => fieldKeys.some((field) => {
2339
- switch (field) {
2340
- case "registrationNumber": {
2341
- return (formUtils.isRequiredField(field) || formUtils.isOptionalField(field)) && formData?.stateOrProvince;
2342
- }
2343
- default:
2344
- return formUtils.isRequiredField(field) || formUtils.isOptionalField(field);
2345
- }
2346
- });
2347
- const legalCompanyNameFields = useLegalCompanyNameField({
2348
- data: formData,
2349
- valid: formValid,
2350
- errors: formErrors,
2351
- fieldProblems: formFieldProblems,
2352
- country,
2353
- formUtils,
2354
- handleChange: handleChangeFor
2355
- });
2356
- if (showBusinessSelection) {
2357
- return /* @__PURE__ */ jsx(
2358
- BusinessSelection,
2359
- {
2360
- showCompanyStructure,
2361
- loading,
2362
- searchResults,
2363
- proceedToManualDataEntry,
2364
- handleNextClick,
2365
- setIsBusinessSelection: setShowBusinessSelection,
2366
- setShowCompanyStructure
2367
- }
2368
- );
2369
- }
2370
- return /* @__PURE__ */ jsxs("form", { id: BASIC_INFORMATION_FORM_ID, className: classNames, children: [
2371
- heading && /* @__PURE__ */ jsx(Header, { title: heading, children: /* @__PURE__ */ jsxs("template", { slot: "description", children: [
2372
- description,
2373
- " ",
2374
- /* @__PURE__ */ jsx(Link, { href: "https://www.adyen.com/privacy-policy", external: true, children: t(($) => $["privacyStatement"]) })
2375
- ] }) }),
2376
- /* @__PURE__ */ jsx(
2377
- ErrorPanel,
2378
- {
2379
- id: "ariaErrorField",
2380
- verificationErrors: formVerificationErrors,
2381
- validationErrors: fieldValidationErrors,
2382
- formUtils
2383
- }
2384
- ),
2385
- /* @__PURE__ */ jsx("fieldset", { children: /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
2386
- CountryField,
2387
- {
2388
- data: formUtils.getFieldData(formData, COUNTRY_FIELD),
2389
- valid: formUtils.getFieldValid(formValid, COUNTRY_FIELD),
2390
- errors: formUtils.getFieldErrors(formErrors, formFieldProblems, COUNTRY_FIELD),
2391
- labels: formUtils.getFieldLabels(COUNTRY_FIELD, {
2392
- country: "countryRegionOfEstablishment"
2393
- }),
2394
- readonly: formUtils.isReadOnly("country") || !isAllowedEditPrefilledCountry || Boolean(disableCountry),
2395
- handleChangeFor,
2396
- allowedCountries: isTopLevelEntity ? allowedCountries : void 0
2397
- }
2398
- ) }) }),
2399
- COUNTRY_OF_GOVERNING_LAW_POSSIBLE.includes(formData.country ?? country) && showField(COUNTRY_OF_GOVERNING_LAW_FIELD) && /* @__PURE__ */ jsx(
2400
- CountryOfGoverningLawField,
2401
- {
2402
- data: formUtils.getFieldData(formData, COUNTRY_OF_GOVERNING_LAW_FIELD),
2403
- country: sliceData?.country,
2404
- valid: formUtils.getFieldValid(formValid, COUNTRY_OF_GOVERNING_LAW_FIELD),
2405
- errors: formUtils.getFieldErrors(
2406
- formErrors,
2407
- formFieldProblems,
2408
- COUNTRY_OF_GOVERNING_LAW_FIELD
2409
- ),
2410
- labels: formUtils.getFieldLabels(COUNTRY_OF_GOVERNING_LAW_FIELD),
2411
- readonly: false,
2412
- allowedCountries: isTopLevelEntity ? allowedCountries : void 0,
2413
- handleChangeFor
2414
- }
2415
- ),
2416
- // fields shown here are abstracted by useLegalCompanyNameField
2417
- legalCompanyNameFields.map((field) => /* @__PURE__ */ jsx(
2418
- Field,
2419
- {
2420
- name: field?.name ?? "",
2421
- label: field?.label,
2422
- helper: field?.helper,
2423
- errorMessage: field?.errorMessage,
2424
- isValid: field?.isValid,
2425
- children: (childProps) => /* @__PURE__ */ jsx(
2426
- InputText,
2427
- {
2428
- ...childProps,
2429
- "aria-required": true,
2430
- "aria-invalid": !field?.isValid,
2431
- name: field?.name,
2432
- value: field?.value,
2433
- readonly: field?.readonly,
2434
- onInput: field ? field.onInput : () => {
2435
- },
2436
- transformInput: field?.transformInput,
2437
- transformMode: field?.transformMode,
2438
- onBlur: field?.onBlur,
2439
- onKeyDown: field?.onKeyDown
2440
- }
2441
- )
2442
- },
2443
- field?.name
2444
- )),
2445
- COUNTRIES_USING_COMPANY_SEARCH.includes(formData.country ?? country) && /* @__PURE__ */ jsxs("fieldset", { children: [
2446
- showField(TAX_INFORMATION_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
2447
- TaxInformationField,
2448
- {
2449
- data: formUtils.getFieldData(formData, TAX_INFORMATION_FIELD),
2450
- valid: formUtils.getFieldValid(formValid, TAX_INFORMATION_FIELD),
2451
- errors: formUtils.getFieldErrors(
2452
- formErrors,
2453
- formFieldProblems,
2454
- TAX_INFORMATION_FIELD
2455
- ),
2456
- labels: formUtils.getFieldLabels(TAX_INFORMATION_FIELD, {
2457
- exemptedFromTax: "iDontHaveATaxId"
2458
- }),
2459
- mask: formUtils.getMask("taxInformation"),
2460
- placeholders: formUtils.getFieldPlaceholders(TAX_INFORMATION_FIELD),
2461
- guidanceText: formUtils.getFieldGuidanceText(TAX_INFORMATION_FIELD),
2462
- readonly: formUtils.isReadOnly("taxInformation"),
2463
- shouldValidate,
2464
- handleChangeFor,
2465
- canExempt: showField(["exemptedFromTax"]),
2466
- registrationNumber: formData.registrationNumber,
2467
- country: formData.country ?? country,
2468
- entityType: companyType,
2469
- defaultData: data?.taxInformation
2470
- }
2471
- ) }),
2472
- showField(STATE_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
2473
- StateField,
2474
- {
2475
- data: formUtils.getFieldData(formData, STATE_FIELD),
2476
- valid: formUtils.getFieldValid(formValid, STATE_FIELD),
2477
- errors: formUtils.getFieldErrors(formErrors, formFieldProblems, STATE_FIELD),
2478
- labels: formUtils.getFieldLabels(STATE_FIELD),
2479
- placeholders: formUtils.getFieldPlaceholders(STATE_FIELD),
2480
- readonly: formUtils.isReadOnly("stateOrProvince"),
2481
- handleChangeFor,
2482
- selectedCountry: formData.country
2483
- }
2484
- ) }),
2485
- showField(BUSINESS_REGISTRATION_NUMBER_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
2486
- BusinessRegistrationNumberField,
2487
- {
2488
- data: formUtils.getFieldData(formData, BUSINESS_REGISTRATION_NUMBER_FIELD),
2489
- valid: formUtils.getFieldValid(formValid, BUSINESS_REGISTRATION_NUMBER_FIELD),
2490
- errors: formUtils.getFieldErrors(
2491
- formErrors,
2492
- formFieldProblems,
2493
- BUSINESS_REGISTRATION_NUMBER_FIELD
2494
- ),
2495
- labels: formUtils.getFieldLabels(BUSINESS_REGISTRATION_NUMBER_FIELD, {
2496
- exemptedFromRegistrationNumber: "iDontHaveARegistrationNumber"
2497
- }),
2498
- mask: formUtils.getMask("registrationNumber"),
2499
- guidanceText: formUtils.getFieldGuidanceText(BUSINESS_REGISTRATION_NUMBER_FIELD),
2500
- placeholders: formUtils.getFieldPlaceholders(BUSINESS_REGISTRATION_NUMBER_FIELD),
2501
- helperText: formUtils.getFieldHelperText(BUSINESS_REGISTRATION_NUMBER_FIELD),
2502
- readonly: formUtils.isReadOnly("registrationNumber"),
2503
- optional: formUtils.isOptionalField("registrationNumber"),
2504
- shouldValidate,
2505
- handleChangeFor,
2506
- country: formData.country ?? country,
2507
- canExempt: formUtils.isRequiredField("exemptedFromRegistrationNumber"),
2508
- companyType
2509
- }
2510
- ) })
2511
- ] })
2512
- ] });
2513
- }
2514
- const companyTypeExamples = /* @__PURE__ */ Object.assign({ "../localized/companyTypeExamples/AT.json": () => import("./AT-TzG2NGTc.js"), "../localized/companyTypeExamples/AU.json": () => import("./AU-CdwbD1qm.js"), "../localized/companyTypeExamples/BE.json": () => import("./BE-CLggPbli.js"), "../localized/companyTypeExamples/BR.json": () => import("./BR-BEHEZpeV.js"), "../localized/companyTypeExamples/CA.json": () => import("./CA-BD18g8mh.js"), "../localized/companyTypeExamples/CH.json": () => import("./CH-BmabUdOH.js"), "../localized/companyTypeExamples/CZ.json": () => import("./CZ-DlzxobtN.js"), "../localized/companyTypeExamples/DE.json": () => import("./DE-C_Lc7NP5.js"), "../localized/companyTypeExamples/DK.json": () => import("./DK-CVF9z_0t.js"), "../localized/companyTypeExamples/ES.json": () => import("./ES-BlWV7xvh.js"), "../localized/companyTypeExamples/FI.json": () => import("./FI-CF0teHDu.js"), "../localized/companyTypeExamples/FR.json": () => import("./FR-3wQ9FMtt.js"), "../localized/companyTypeExamples/GB.json": () => import("./GB-C_AXeEDs.js"), "../localized/companyTypeExamples/HK.json": () => import("./HK-B16JHR8k.js"), "../localized/companyTypeExamples/HR.json": () => import("./HR-BRAjQoOH.js"), "../localized/companyTypeExamples/HU.json": () => import("./HU-DuWGRPke.js"), "../localized/companyTypeExamples/IE.json": () => import("./IE-BCDIfZoA.js"), "../localized/companyTypeExamples/IT.json": () => import("./IT-C1-PEPAb.js"), "../localized/companyTypeExamples/LT.json": () => import("./LT-V-VsHKlY.js"), "../localized/companyTypeExamples/NL.json": () => import("./NL-4Y7A2IJp.js"), "../localized/companyTypeExamples/NO.json": () => import("./NO-Div5P6IZ.js"), "../localized/companyTypeExamples/PL.json": () => import("./PL-DKgMtNxx.js"), "../localized/companyTypeExamples/PT.json": () => import("./PT-CpKb15My.js"), "../localized/companyTypeExamples/RO.json": () => import("./RO-Bmsg2YGZ.js"), "../localized/companyTypeExamples/SE.json": () => import("./SE-Br1yrUhV.js"), "../localized/companyTypeExamples/SG.json": () => import("./SG-d-PTZAoA.js"), "../localized/companyTypeExamples/SI.json": () => import("./SI-BPx_gt1n.js"), "../localized/companyTypeExamples/SK.json": () => import("./SK-DeSZ6Sa9.js"), "../localized/companyTypeExamples/US.json": () => import("./US-CZw-MX1-.js") });
2515
- const logger = createLogger();
2516
- const getCompanyTypeExamplesForCountry = async (country) => {
2517
- const importForCountry = companyTypeExamples[`../localized/companyTypeExamples/${country}.json`];
2518
- if (!importForCountry) {
2519
- logger.warn(`No company type examples available for ${country}`);
2520
- return {};
2521
- }
2522
- return (await importForCountry()).default;
2523
- };
2524
- const useCompanyTypeExamples = (country) => {
2525
- const [examples, setExamples] = useState();
2526
- useEffect(() => {
2527
- getCompanyTypeExamplesForCountry(country).then(setExamples).catch(console.error);
2528
- }, [country]);
2529
- return examples;
2530
- };
2531
- const mapOrganizationTypeToCompanyType = (organizationType) => {
2532
- switch (organizationType) {
2533
- case "BUSINESS":
2534
- return CompanyTypesValues.PRIVATE_COMPANY;
2535
- case "NON_PROFIT":
2536
- return CompanyTypesValues.NON_PROFIT_OR_CHARITABLE;
2537
- case "PUBLIC_COMPANY":
2538
- case "LISTED_PUBLIC_COMPANY":
2539
- return CompanyTypesValues.PUBLIC_COMPANY;
2540
- case "UNLISTED_PUBLIC_COMPANY":
2541
- return CompanyTypesValues.UNLISTED_PUBLIC_COMPANY;
2542
- case "GOVERNMENTAL_ORGANIZATION":
2543
- return CompanyTypesValues.GOVERNMENTAL_ORGANIZATION;
2544
- case "SOLE_PROPRIETOR":
2545
- return CompanyTypesValues.SOLE_PROPRIETORSHIP;
2546
- case "PARTNERSHIP_INCORPORATED":
2547
- return CompanyTypesValues.INCORPORATED_PARTNERSHIP;
2548
- case "ASSOCIATION_INCORPORATED":
2549
- return CompanyTypesValues.INCORPORATED_ASSOCIATION;
2550
- default:
2551
- return CompanyTypesValues.PRIVATE_COMPANY;
2552
- }
2553
- };
2554
- const companyTypeMetadata = {
2555
- [CompanyTypesValues.PRIVATE_COMPANY]: {
2556
- id: CompanyTypesValues.PRIVATE_COMPANY,
2557
- name: "privateCompanyTitle",
2558
- description: "privateCompanyDescription"
2559
- },
2560
- [CompanyTypesValues.PUBLIC_COMPANY]: {
2561
- id: CompanyTypesValues.PUBLIC_COMPANY,
2562
- name: "publicCompanyTitle",
2563
- description: "publicCompanyDescription"
2564
- },
2565
- [CompanyTypesValues.INCORPORATED_PARTNERSHIP]: {
2566
- id: CompanyTypesValues.INCORPORATED_PARTNERSHIP,
2567
- name: "partnershipIncorporated",
2568
- description: "partnershipIncorporatedDescription"
2569
- },
2570
- [CompanyTypesValues.NON_PROFIT_OR_CHARITABLE]: {
2571
- id: CompanyTypesValues.NON_PROFIT_OR_CHARITABLE,
2572
- name: "nonProfitOrCharitableOrgTitle",
2573
- description: "nonProfitOrCharitableOrgDescription"
2574
- },
2575
- [CompanyTypesValues.GOVERNMENTAL_ORGANIZATION]: {
2576
- id: CompanyTypesValues.GOVERNMENTAL_ORGANIZATION,
2577
- name: "governmentalOrganizationTitle",
2578
- description: "governmentalOrganizationDescription"
2579
- },
2580
- [CompanyTypesValues.INCORPORATED_ASSOCIATION]: {
2581
- id: CompanyTypesValues.INCORPORATED_ASSOCIATION,
2582
- name: "associationIncorporated",
2583
- description: "associationIncorporatedDescription"
2584
- }
2585
- };
2586
- const companyTypeOptions = Object.keys(companyTypeMetadata);
2587
- const CompanyStructureValidation = {
2588
- entityType: {
2589
- modes: ["blur"],
2590
- validate: (entityType) => !isEmpty(entityType),
2591
- errorMessage: "fieldIsRequired"
2592
- }
2593
- };
2594
- const COMPANY_STRUCTURE_FORM_ID = "companyStructure";
2595
- const companyStructureFields = ["entityType"];
2596
- function CompanyStructure({
2597
- data,
2598
- labels,
2599
- heading,
2600
- description,
2601
- formVerificationErrors,
2602
- fieldValidationErrors,
2603
- requiredFields,
2604
- country,
2605
- showCompanyStructure,
2606
- shouldValidate
2607
- }) {
2608
- const { t } = useTranslation(["common", "business"]);
2609
- const { isExperimentEnabled } = useExperimentsContext();
2610
- const { accountHolder } = useAccountHolder();
2611
- const { isSettingEnabled } = useSettingsContext();
2612
- const canChangeEntityType = isSettingEnabled(SettingNames.AllowLegalEntityTypeChange);
2613
- const verifiedBusiness$1 = verifiedBusiness.value;
2614
- const { updateStateSlice } = useGlobalDataSlice(COMPANY_STRUCTURE_FORM_ID);
2615
- const schema = requiredFields ? [...requiredFields] : companyStructureFields;
2616
- const {
2617
- schema: formSchema,
2618
- data: formData,
2619
- valid: formValid,
2620
- errors: formErrors,
2621
- fieldProblems: formFieldProblems,
2622
- handleChangeFor,
2623
- setData,
2624
- setValid
2625
- } = useForm({
2626
- schema,
2627
- defaultData: data,
2628
- rules: CompanyStructureValidation,
2629
- fieldProblems: fieldValidationErrors,
2630
- shouldValidate
2631
- });
2632
- const formUtils = createFormUtils({ labels, requiredFields }, t);
2633
- useEffect(() => {
2634
- if (!showCompanyStructure && !verifiedBusiness$1 && !data?.entityType) {
2635
- setValid("entityType", false);
2636
- return setData("entityType", data?.entityType);
2637
- }
2638
- if (!verifiedBusiness$1 && data?.entityType) {
2639
- return handleChangeFor("entityType")(data?.entityType);
2640
- }
2641
- const type = mapOrganizationTypeToCompanyType(verifiedBusiness$1?.organizationType);
2642
- if (verifiedBusiness$1 && type && data?.entityType !== type) {
2643
- return handleChangeFor("entityType")(type);
2644
- }
2645
- }, [
2646
- data?.entityType,
2647
- isExperimentEnabled,
2648
- setData,
2649
- setValid,
2650
- showCompanyStructure,
2651
- verifiedBusiness$1
2652
- ]);
2653
- useEffect(() => {
2654
- updateStateSlice({
2655
- schema: formSchema,
2656
- data: formData,
2657
- errors: formErrors,
2658
- valid: formValid,
2659
- fieldProblems: formFieldProblems
2660
- });
2661
- }, [formSchema, formData, formErrors, formValid, formFieldProblems, updateStateSlice]);
2662
- const excludedTypes = [
2663
- CompanyTypesValues.INCORPORATED_PARTNERSHIP,
2664
- CompanyTypesValues.INCORPORATED_ASSOCIATION
2665
- ];
2666
- if (isBankAccountRequestedForOrganization.value) {
2667
- excludedTypes.push(CompanyTypesValues.GOVERNMENTAL_ORGANIZATION);
2668
- }
2669
- const companyTypeRadioOptions = canChangeEntityType && accountHolder !== "aTrust" ? companyTypeOptions.filter((companyType) => !excludedTypes.includes(companyType)) : companyTypeOptions;
2670
- const companyTypeExamples2 = useCompanyTypeExamples(country);
2671
- return /* @__PURE__ */ jsxs("form", { children: [
2672
- heading && /* @__PURE__ */ jsx(Header, { title: heading, description }),
2673
- /* @__PURE__ */ jsx(
2674
- ErrorPanel,
2675
- {
2676
- verificationErrors: formVerificationErrors,
2677
- validationErrors: fieldValidationErrors,
2678
- formUtils,
2679
- id: "ariaErrorField"
2680
- }
2681
- ),
2682
- /* @__PURE__ */ jsx(
2683
- Field,
2684
- {
2685
- el: "fieldset",
2686
- name: "entityType",
2687
- errorMessage: formUtils.getErrorMessage("entityType", formErrors, formFieldProblems),
2688
- isValid: formValid.entityType,
2689
- classNameModifiers: ["entityType"],
2690
- children: (childProps) => /* @__PURE__ */ jsx(
2691
- EntityTypeRadioGroupCard,
2692
- {
2693
- ...childProps,
2694
- name: "entityType",
2695
- options: companyTypeRadioOptions,
2696
- optionId: (option) => companyTypeMetadata[option].id,
2697
- optionName: (option) => t(($) => $[companyTypeMetadata[option].name], { ns: "business" }),
2698
- optionDescription: (option) => t(($) => $[companyTypeMetadata[option].description], { ns: "business" }),
2699
- selected: formData.entityType,
2700
- onSelect: handleChangeFor("entityType"),
2701
- examples: companyTypeExamples2,
2702
- "aria-required": true,
2703
- "aria-invalid": !formValid.entityType
2704
- }
2705
- )
2706
- }
2707
- )
2708
- ] });
2709
- }
28
+ import { a1 as MemoizedDocumentUpload, C as CompanyTypesValues, m as COUNTRIES_USING_COMPANY_SEARCH, a2 as isRegistrationNumberAbsentStateV4Scenario, G as isEmpty, a3 as COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT, g as getCompanyRegistrationNumberOptions, t as taxInformationDefaultFieldMetadata, a4 as countryToTaxInfoTypeMap, h as taxInformationDefaultFieldConfig, a5 as rules, r as requestingBanking, d as requestingIssuing, T as TAX_INFORMATION_FIELD, i as TaxInformationField, u as useAllowedCountries, l as COUNTRY_OF_GOVERNING_LAW_POSSIBLE } from "./IndividualOnfido-BMIkKHvJ.js";
29
+ import { M as MemoizedConstitutionalDocument } from "./ConstitutionalDocument-Dt9O9bVo.js";
30
+ import { g as getFormProps, s as summaryItem, m as mergeFieldMetadataIntoProps, c as createFormUtils, H as Header, E as ErrorPanel, C as CountryField, b as COUNTRY_FIELD, a as Link, f as summaryStep } from "./CountryField-Bv9P8dRJ.js";
31
+ import { F as FormContextProvider, a as FormFlow } from "./FormFlow-A9b0QEcM.js";
32
+ import { u as useMultiForm } from "./useMultiForm-GpoMvhwU.js";
33
+ import { b as mapAddressLocalizationToJpAddressSchema, a as mapApiScriptLocalizationToSchemaFields, m as mapSchemaFieldsToApiScriptLocalization } from "./mapAddressLocalizationToJpAddressSchema-vJWbpAyq.js";
34
+ import { m as mapFinancialReportsToFinancialInformation, a as mapFinancialInformationToFinancialReport } from "./mapFinancialReportsToFinancialInformation-DoTIj0Q-.js";
35
+ import { f as formatObject, g as getProp } from "./utils-DNSfZiio.js";
36
+ import { m as mapJpAddressSchemaToAddressLocalizations, a as mapJpAddressSummary } from "./mapJpAddressSchemaToAddressLocalizations-pPCQCgRx.js";
37
+ import { f as formatCurrency } from "./formatCurrency-CMOSdJMB.js";
38
+ import { i as isValidationError, p as processValidationErrors, a as isMaintenanceModeError } from "./validationError-DhRqgFgA.js";
39
+ import { r as resolveFieldMetadata } from "./fieldConfigurations-DVV23oeM.js";
40
+ import { Suspense, lazy } from "preact/compat";
41
+ import { C as Checkbox } from "./debouncedInputEvent-B3Lwtvx_.js";
42
+ import { F as Field } from "./trackNavigation-gyYoCNvj.js";
43
+ import { L as LegalFormField } from "./Currency-SzvigNNo.js";
44
+ import { M as Modal, a as ModalContent } from "./Modal-C9aImxis.js";
2710
45
  const documentTypes$2 = [
2711
46
  { id: "Internal company document", name: "internalCompanyDocument" },
2712
47
  { id: "Business registry statement", name: "businessRegistryStatement" }
@@ -3131,330 +466,6 @@ function TaxDocument({
3131
466
  }
3132
467
  );
3133
468
  }
3134
- const applyVerifiedBusinessData = (form, country, verifiedData) => {
3135
- if (!verifiedData) return;
3136
- form.handleChangeFor("legalCompanyName", "basicInformation")(verifiedData.name);
3137
- form.handleChangeFor(
3138
- "entityType",
3139
- "companyStructure"
3140
- )(mapOrganizationTypeToCompanyType(verifiedData.organizationType));
3141
- const verifiedAddress = verifiedData.isPrincipalAddress || verifiedData.state && form.data?.basicInformation?.stateOrProvince !== verifiedData.state ? { operationalAddress: { ...mapAddressData(verifiedData), country } } : {
3142
- registrationAddress: {
3143
- ...mapAddressData(verifiedData),
3144
- country,
3145
- stateOrProvince: form.data?.basicInformation?.stateOrProvince
3146
- }
3147
- };
3148
- if (verifiedData.isPrincipalAddress) {
3149
- form.handleChangeFor(
3150
- "operationalAddressIsSame",
3151
- "additionalInformation",
3152
- "input"
3153
- )(operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME);
3154
- }
3155
- if (verifiedAddress.registrationAddress) {
3156
- form.handleChangeFor(
3157
- "registrationAddress",
3158
- "additionalInformation"
3159
- )(verifiedAddress.registrationAddress);
3160
- }
3161
- if (verifiedAddress.operationalAddress) {
3162
- form.handleChangeFor(
3163
- "operationalAddress",
3164
- "additionalInformation"
3165
- )(verifiedAddress.operationalAddress);
3166
- }
3167
- };
3168
- const BUSINESS_SELECTION_FIELDS = [
3169
- "hasSelectedBusiness"
3170
- ];
3171
- function BusinessSelectionMultiform({
3172
- country,
3173
- heading = "businessSelectionFormHeading",
3174
- validationErrors = {},
3175
- verificationErrors = {},
3176
- handleNextClick,
3177
- handleBackClick,
3178
- setLoadingStatus
3179
- }) {
3180
- const { t } = useTranslation(["common", "business"]);
3181
- const { form } = useFormContext();
3182
- const queryClient = useQueryClient();
3183
- const userEvents = useAnalyticsContext();
3184
- const [selectedBusinessId, setSelectedBusinessId] = useState();
3185
- const [fetchParams, setFetchParams] = useState();
3186
- const { data: companySearchResponse, isLoading: searching } = useCompanySearch({
3187
- name: form.data?.basicInformation?.legalCompanyName ?? "",
3188
- country,
3189
- state: form.data?.basicInformation?.stateOrProvince,
3190
- registrationNumber: form.data?.basicInformation?.registrationNumber
3191
- });
3192
- const {
3193
- data: businessData,
3194
- isError: fetchingError,
3195
- isLoading: fetching,
3196
- refetch: refetchCompanySelection
3197
- } = useCompanySelection(fetchParams);
3198
- const currentTin = form.data.basicInformation?.taxInformation?.find(
3199
- (taxId) => taxId.country === country
3200
- )?.number;
3201
- const [prevBusinessData, setPrevBusinessData] = useState(businessData);
3202
- if (prevBusinessData !== businessData) {
3203
- if (businessData?.tinMatched === true) {
3204
- tinMatched.value = true;
3205
- userEvents.addPageEvent("Success", {
3206
- actionType: "select",
3207
- returnValue: "companySelection"
3208
- });
3209
- verifiedBusiness.value = businessData;
3210
- } else {
3211
- userEvents.addPageEvent("Encountered error", {
3212
- actionType: "select",
3213
- returnValue: "companySelection"
3214
- });
3215
- }
3216
- setPrevBusinessData(businessData);
3217
- }
3218
- if (fetching) {
3219
- verifiedBusiness.value = void 0;
3220
- }
3221
- const { mutateAsync: clearCompanyData2 } = useClearCompanyData();
3222
- const handleChange = useCallback(
3223
- (fieldName, mode) => form.handleChangeFor(fieldName, "businessSelection", mode),
3224
- [form]
3225
- );
3226
- const handleSelectBusiness = async (result) => {
3227
- if ((!selectedBusinessId || selectedBusinessId !== result.id) && currentTin) {
3228
- userEvents.addPageEvent("Clicked button", {
3229
- actionType: "select",
3230
- label: "selectBusiness",
3231
- additionalData: {
3232
- companyIdx: companySearchResponse?.results.findIndex(
3233
- (searchResult) => searchResult.id === result.id
3234
- )
3235
- }
3236
- });
3237
- setSelectedBusinessId(result.id);
3238
- setFetchParams({
3239
- company: result,
3240
- state: form.data.basicInformation?.stateOrProvince,
3241
- name: result.name,
3242
- tin: currentTin
3243
- });
3244
- }
3245
- };
3246
- const handleConfirmSelection = async () => {
3247
- applyVerifiedBusinessData(form, country, verifiedBusiness.value);
3248
- handleChange("hasSelectedBusiness", "blur")(true);
3249
- handleNextClick();
3250
- };
3251
- const restoreDefaultState = () => {
3252
- form.handleChangeFor(
3253
- "legalCompanyName",
3254
- "basicInformation"
3255
- )(form.defaultData?.basicInformation?.legalCompanyName);
3256
- form.handleChangeFor(
3257
- "entityType",
3258
- "companyStructure",
3259
- "input"
3260
- )(form.defaultData?.companyStructure?.entityType);
3261
- };
3262
- const tinVerificationParams = {
3263
- name: form.data.basicInformation?.legalCompanyName ?? "",
3264
- tin: form.data.basicInformation?.taxInformation?.[0]?.number ?? ""
3265
- };
3266
- useVerifyTin(tinVerificationParams, { enabled: false });
3267
- const proceedToManualDataEntry = async () => {
3268
- clearCompanyData2();
3269
- restoreDefaultState();
3270
- verifiedBusiness.value = void 0;
3271
- try {
3272
- setLoadingStatus("loading");
3273
- const { matched } = await queryClient.fetchQuery({
3274
- queryKey: ["verifyTin", tinVerificationParams]
3275
- });
3276
- tinMatched.value = matched;
3277
- if (matched === false) {
3278
- businessMismatchModalOpen.value = true;
3279
- } else {
3280
- handleChange("hasSelectedBusiness", "blur")(false);
3281
- handleNextClick();
3282
- }
3283
- } catch (e) {
3284
- console.log(e);
3285
- } finally {
3286
- setLoadingStatus("success");
3287
- }
3288
- };
3289
- const formUtils = useMemo(() => {
3290
- return createFormUtils(
3291
- {
3292
- data: form.data?.businessSelection ?? {},
3293
- allFields: form.allFields?.businessSelection ?? [],
3294
- requiredFields: form.requiredFields?.businessSelection ?? [],
3295
- optionalFields: form.optionalFields?.businessSelection ?? [],
3296
- trustedFields: form.trustedFields?.businessSelection ?? [],
3297
- obscuredFields: form.obscuredFields?.businessSelection ?? [],
3298
- errors: form.errors?.businessSelection ?? {},
3299
- valid: form.valid?.businessSelection ?? {}
3300
- },
3301
- t
3302
- );
3303
- }, [
3304
- form.allFields?.businessSelection,
3305
- form.data?.businessSelection,
3306
- form.errors?.businessSelection,
3307
- form.obscuredFields?.businessSelection,
3308
- form.optionalFields?.businessSelection,
3309
- form.requiredFields?.businessSelection,
3310
- form.trustedFields?.businessSelection,
3311
- form.valid?.businessSelection,
3312
- t,
3313
- validationErrors,
3314
- verificationErrors
3315
- ]);
3316
- return /* @__PURE__ */ jsx("div", { className: "adyen-kyc-business-selection", children: /* @__PURE__ */ jsxs(LoaderWrapper, { loaderSize: "large", status: searching ? "loading" : "success", children: [
3317
- /* @__PURE__ */ jsx(Header, { title: t(($) => $[heading]) }),
3318
- /* @__PURE__ */ jsx(
3319
- ErrorPanel,
3320
- {
3321
- id: "ariaErrorField",
3322
- verificationErrors,
3323
- validationErrors,
3324
- formUtils
3325
- }
3326
- ),
3327
- /* @__PURE__ */ jsx(StackLayout, { children: companySearchResponse?.results?.map((result) => /* @__PURE__ */ jsx(
3328
- BusinessInformationCard,
3329
- {
3330
- result,
3331
- selectedBusinessId,
3332
- currentBusinessSelection: businessData,
3333
- fetching,
3334
- fetchingError,
3335
- invalidTin: businessData?.tinMatched === false,
3336
- handleSelectBusiness,
3337
- handleConfirmSelection,
3338
- refetchCompanySelection,
3339
- handleBackClick
3340
- },
3341
- result.id
3342
- )) }),
3343
- /* @__PURE__ */ jsxs(Typography, { el: "span", color: "secondary", className: "adyen-kyc-business-selection__footer", children: [
3344
- t(($) => $["businessSelection__footer"], { ns: "business" }),
3345
- /* @__PURE__ */ jsx(Button, { variant: "link", onClick: proceedToManualDataEntry, testId: "manualDataEntry", children: t(($) => $["businessSelection__footerButton"], { ns: "business" }) })
3346
- ] })
3347
- ] }) });
3348
- }
3349
- const FIELDS_NEEDED_FOR_COMPANY_SEARCH = [...STATE_FIELD, ...TAX_INFORMATION_FIELD, ...BUSINESS_REGISTRATION_NUMBER_FIELD];
3350
- const getBasicInformationFields = (country) => {
3351
- let fields = [...BASIC_INFORMATION_FIELDS];
3352
- if (!COUNTRIES_USING_COMPANY_SEARCH.includes(country)) {
3353
- fields = fields.filter((field) => !FIELDS_NEEDED_FOR_COMPANY_SEARCH.includes(field));
3354
- }
3355
- return fields;
3356
- };
3357
- const getFinancialInformationFields = (country) => {
3358
- const fields = country === CountryCodes.UnitedKingdom ? financialInformationFields : financialInformationFieldsForEu;
3359
- return [...fields, "netAssets", "balanceSheetTotal", "annualTurnover"];
3360
- };
3361
- const staticBusinessDetailsForms = {
3362
- businessSelection: {
3363
- formId: "businessSelection",
3364
- formName: "businessSelectionFormHeading",
3365
- formHeading: "businessSelectionFormHeading",
3366
- fields: BUSINESS_SELECTION_FIELDS
3367
- },
3368
- companyStructure: {
3369
- formId: "companyStructure",
3370
- formName: "companyStructureFormName",
3371
- formHeading: "companyStructureFormName",
3372
- formDescription: "companyStructureFormDescription",
3373
- fields: companyStructureFields
3374
- },
3375
- companyRegistrationDocument: {
3376
- formId: "companyRegistrationDocument",
3377
- formName: "companyRegistrationDocumentFormName",
3378
- formHeading: "companyRegistrationDocumentFormHeading",
3379
- formDescription: "companyRegistrationDocumentFormDescription",
3380
- fields: ["registrationDocument"]
3381
- },
3382
- companyTaxDocument: {
3383
- formId: "companyTaxDocument",
3384
- formName: "companyTaxDocumentFormName",
3385
- formHeading: "companyTaxDocumentFormHeading",
3386
- formDescription: "companyTaxDocumentFormDescription",
3387
- fields: ["taxDocument"]
3388
- },
3389
- companyProofOfDirectorDocument: {
3390
- formId: "companyProofOfDirectorDocument",
3391
- formName: "proofOfDirector",
3392
- formHeading: "uploadYourOrganizationProofOfDirector",
3393
- formDescription: "weNeedAnOfficialDocument",
3394
- fields: ["proofOfDirector"]
3395
- },
3396
- companyProofOfSignatoryDocument: {
3397
- formId: "companyProofOfSignatoryDocument",
3398
- formName: "proofOfSignatory",
3399
- formHeading: "uploadYourOrganizationProofOfSignatory",
3400
- formDescription: "weNeedAnOfficialDocumentSignatory",
3401
- fields: ["proofOfSignatory"]
3402
- },
3403
- companyProofOfOwnershipDocument: {
3404
- formId: "companyProofOfOwnershipDocument",
3405
- formName: "proofOfOwnership",
3406
- formHeading: "uploadYourOrganizationProofOfOwnership",
3407
- formDescription: "weNeedAnOfficialDocumentForOwnership",
3408
- fields: ["proofOfOwnership"]
3409
- },
3410
- companyConstitutionalDocument: {
3411
- formId: "companyConstitutionalDocument",
3412
- formName: "constitutionalDocument",
3413
- formHeading: "constitutionalDocumentHeader",
3414
- formDescription: "constitutionalDocumentHeaderDescription",
3415
- fields: ["constitutionalDocument"]
3416
- }
3417
- };
3418
- const getForms = (country) => ({
3419
- basicInformation: {
3420
- formId: "basicInformation",
3421
- formName: "basicInformationFormName",
3422
- formHeading: "basicInformationFormHeading",
3423
- formDescription: "basicInformationFormDescription",
3424
- fields: getBasicInformationFields(country)
3425
- },
3426
- businessSelection: staticBusinessDetailsForms.businessSelection,
3427
- companyStructure: staticBusinessDetailsForms.companyStructure,
3428
- additionalInformation: {
3429
- formId: "additionalInformation",
3430
- formName: "additionalInformationFormName",
3431
- formHeading: "additionalInformationFormHeading",
3432
- fields: COUNTRIES_USING_COMPANY_SEARCH.includes(country) ? ADDITIONAL_INFORMATION_FIELDS.filter(
3433
- (field) => !FIELDS_NEEDED_FOR_COMPANY_SEARCH.includes(field)
3434
- ) : ADDITIONAL_INFORMATION_FIELDS
3435
- },
3436
- companyRegistrationDocument: staticBusinessDetailsForms.companyRegistrationDocument,
3437
- companyTaxDocument: staticBusinessDetailsForms.companyTaxDocument,
3438
- companyProofOfDirectorDocument: staticBusinessDetailsForms.companyProofOfDirectorDocument,
3439
- companyProofOfSignatoryDocument: staticBusinessDetailsForms.companyProofOfSignatoryDocument,
3440
- companyProofOfOwnershipDocument: staticBusinessDetailsForms.companyProofOfOwnershipDocument,
3441
- companyFinancialInformation: {
3442
- formId: "companyFinancialInformation",
3443
- formName: "financialInformation",
3444
- formHeading: "companyFinancialInformationFormHeading",
3445
- formDescription: "companyFinancialInformationFormDescription",
3446
- fields: getFinancialInformationFields(country)
3447
- },
3448
- companyConstitutionalDocument: staticBusinessDetailsForms.companyConstitutionalDocument
3449
- });
3450
- const documentFormsIds = [
3451
- "companyRegistrationDocument",
3452
- "companyTaxDocument",
3453
- "companyProofOfDirectorDocument",
3454
- "companyProofOfSignatoryDocument",
3455
- "companyConstitutionalDocument",
3456
- "companyProofOfOwnershipDocument"
3457
- ];
3458
469
  function BusinessDetails(props) {
3459
470
  const { i18n } = useI18nContext();
3460
471
  const { t } = useTranslation("business");
@@ -4076,13 +1087,13 @@ const mapBusinessDetailsSchemaToLegalEntity = (data, accountHolder, isExperiment
4076
1087
  const localization = [
4077
1088
  mapSchemaFieldsToApiScriptLocalization(data.basicInformation ?? {}, "jaHani"),
4078
1089
  mapSchemaFieldsToApiScriptLocalization(data.basicInformation ?? {}, "jaKana")
4079
- ].filter(({ fields }) => !isEmpty$1(fields)).map(({ script, fields }) => ({
1090
+ ].filter(({ fields }) => !isEmpty(fields)).map(({ script, fields }) => ({
4080
1091
  script,
4081
1092
  // mismatch between API `legalName` and schema `legalCompanyName`
4082
1093
  fields: { legalName: fields.legalCompanyName }
4083
1094
  }));
4084
1095
  const doingBusinessAs = data.additionalInformation?.doingBusinessAs ?? "";
4085
- const entityObject = isEmpty$1(data.companyStructure) ? requestObj.soleProprietorship : requestObj.organization;
1096
+ const entityObject = isEmpty(data.companyStructure) ? requestObj.soleProprietorship : requestObj.organization;
4086
1097
  if (entityObject) {
4087
1098
  if (taxData) {
4088
1099
  entityObject.taxInformation = taxData;
@@ -4123,7 +1134,7 @@ const mapBusinessDetailsSchemaToLegalEntity = (data, accountHolder, isExperiment
4123
1134
  if (addressLocalizations.length > 0)
4124
1135
  entityObject.registeredAddress.localization = addressLocalizations;
4125
1136
  }
4126
- if (!isEmpty$1(data.companyFinancialInformation)) {
1137
+ if (!isEmpty(data.companyFinancialInformation)) {
4127
1138
  const isIncorporationDateDependencyEnabled = isExperimentEnabled(
4128
1139
  "EnableIncorporationDateBasedFinancialValidationForHO"
4129
1140
  );
@@ -4150,7 +1161,7 @@ const MANDATORY_FIELDS_BUSINESS_DETAILS = [
4150
1161
  ];
4151
1162
  const canSubmit = (data) => MANDATORY_FIELDS_BUSINESS_DETAILS.every((detail) => {
4152
1163
  const value = getProp(data, detail);
4153
- return !isEmpty(value);
1164
+ return !isEmpty$1(value);
4154
1165
  });
4155
1166
  const isDocumentsRequired = (forms) => forms.some((form) => documentFormsIds.includes(form.formId));
4156
1167
  const removeConditionalForms = (forms, isSkippingCompanyStructure) => isSkippingCompanyStructure ? forms.filter((f) => f.formId !== "companyStructure" && f.formId !== "companyType") : forms;
@@ -4338,18 +1349,16 @@ async function submitDocuments({
4338
1349
  legalEntity,
4339
1350
  forms,
4340
1351
  documentUtils,
4341
- additionalTrackingParams,
4342
1352
  userEvents
4343
1353
  }) {
4344
1354
  if (!isDocumentsRequired(forms)) return;
4345
- const logger2 = createLogger();
1355
+ const logger = createLogger();
4346
1356
  const formattedDocument = await mapBusinessDetailsDocumentToApiDocument(data, legalEntity.id);
4347
1357
  try {
4348
1358
  if (formattedDocument) {
4349
1359
  await documentUtils.uploadDocuments(formattedDocument, legalEntity.id);
4350
1360
  formattedDocument.forEach((doc) => {
4351
1361
  userEvents?.addTaskEvent("Success", {
4352
- ...additionalTrackingParams,
4353
1362
  actionType: "upload",
4354
1363
  documentType: doc.type,
4355
1364
  fileExtention: doc.attachments?.map((item) => getFileExtention(item.pageName)).filter((item) => item !== void 0) ?? []
@@ -4357,9 +1366,8 @@ async function submitDocuments({
4357
1366
  });
4358
1367
  }
4359
1368
  } catch (err) {
4360
- logger2.error(err);
1369
+ logger.error(err);
4361
1370
  userEvents.addTaskEvent("Encountered error", {
4362
- ...additionalTrackingParams,
4363
1371
  actionType: "upload",
4364
1372
  returnType: err.errorCode,
4365
1373
  returnValue: err.title ?? err.message
@@ -4367,7 +1375,6 @@ async function submitDocuments({
4367
1375
  }
4368
1376
  }
4369
1377
  async function submit({
4370
- additionalTrackingParams,
4371
1378
  data,
4372
1379
  legalEntityResponse,
4373
1380
  associatedLegalArrangement,
@@ -4388,10 +1395,9 @@ async function submit({
4388
1395
  isExperimentEnabled,
4389
1396
  userEvents
4390
1397
  }) {
4391
- const logger2 = createLogger();
1398
+ const logger = createLogger();
4392
1399
  setLoadingStatus("loading");
4393
1400
  let trackingPayload = {
4394
- ...additionalTrackingParams,
4395
1401
  actionType: "submit",
4396
1402
  companyStructure: data.companyStructure?.entityType ?? null,
4397
1403
  countryOfRegistration: data.basicInformation?.country ?? null,
@@ -4487,6 +1493,12 @@ async function submit({
4487
1493
  accountHolder
4488
1494
  )
4489
1495
  };
1496
+ if (mappedLegalEntity.type === LegalEntityTypes.ORGANIZATION && legalEntityResponse.organization?.countryOfGoverningLaw !== mappedLegalEntity.organization?.countryOfGoverningLaw && legalEntityResponse.organization?.support) {
1497
+ mappedLegalEntity.organization.support = determineCustomerSupport(
1498
+ legalEntityResponse.organization.support,
1499
+ mappedLegalEntity.organization?.countryOfGoverningLaw
1500
+ );
1501
+ }
4490
1502
  const legalEntity = await handleSubmitLegalEntity(mappedLegalEntity);
4491
1503
  if (taskType === TaskTypes.TRUST_MEMBER_COMPANY || taskType === TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY || taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY && !associatedLegalArrangement?.id) {
4492
1504
  await associateLegalEntityWithParent({
@@ -4498,7 +1510,6 @@ async function submit({
4498
1510
  await submitDocuments({
4499
1511
  data,
4500
1512
  legalEntity,
4501
- additionalTrackingParams,
4502
1513
  documentUtils,
4503
1514
  forms,
4504
1515
  userEvents
@@ -4544,7 +1555,7 @@ async function submit({
4544
1555
  variant: "error"
4545
1556
  });
4546
1557
  }
4547
- logger2.error(err);
1558
+ logger.error(err);
4548
1559
  userEvents?.addTaskEvent("Encountered error", {
4549
1560
  ...trackingPayload,
4550
1561
  returnType: err?.errorCode,
@@ -4563,6 +1574,20 @@ const getCountryOfGoverningLaw = (isCountryOfGoverningLawEnabled, basicData) =>
4563
1574
  }
4564
1575
  return basicData?.countryOfGoverningLaw;
4565
1576
  };
1577
+ const determineCustomerSupport = (customerSupport, country) => {
1578
+ switch (country) {
1579
+ case CountryCodes.Japan:
1580
+ return unsetCustomerSupportNumber(customerSupport);
1581
+ default:
1582
+ return customerSupport;
1583
+ }
1584
+ };
1585
+ const unsetCustomerSupportNumber = (customerSupport) => {
1586
+ return customerSupport ? {
1587
+ email: customerSupport.email,
1588
+ phone: { number: "", type: "mobile" }
1589
+ } : void 0;
1590
+ };
4566
1591
  function BusinessDetailsDropin({
4567
1592
  country,
4568
1593
  problems,
@@ -4610,12 +1635,6 @@ function BusinessDetailsDropin({
4610
1635
  setIsBankAccountRequestedForOrganization(isBankAccountRequested);
4611
1636
  }, [legalEntityResponse]);
4612
1637
  const subjectEntity = !isAssociationTaskType ? legalEntityResponse : isSoleProp ? associatedLegalArrangement : nestedLegalEntity;
4613
- const associatedLeTrackingParams = useMemo(
4614
- () => getAssociatedLeAnalyticsPayload({
4615
- associatedLegalEntity: associatedLegalArrangement
4616
- }),
4617
- [associatedLegalArrangement]
4618
- );
4619
1638
  useEffect(() => {
4620
1639
  userEvents.updateBaseTrackingPayload({ task: taskType });
4621
1640
  userEvents.addTaskEvent("Landed on page", {
@@ -4623,8 +1642,7 @@ function BusinessDetailsDropin({
4623
1642
  ...subjectEntity?.id && subjectEntity?.type && {
4624
1643
  legalEntityId: subjectEntity.id,
4625
1644
  entityType: subjectEntity.type
4626
- },
4627
- ...associatedLeTrackingParams
1645
+ }
4628
1646
  });
4629
1647
  }, []);
4630
1648
  const [tinMatched2, setTinMatched] = useState(void 0);
@@ -4636,9 +1654,7 @@ function BusinessDetailsDropin({
4636
1654
  );
4637
1655
  });
4638
1656
  const [trustedFields, setTrustedFields] = useState(subjectEntity?.trustedFields ?? void 0);
4639
- const [currentProblems, setCurrentProblems] = useState(
4640
- problems ?? getCapabilityProblems(legalEntityResponse, currentCountry)?.LegalEntity?.[legalEntityResponse.id] ?? {}
4641
- );
1657
+ const [currentProblems, setCurrentProblems] = useState(problems ?? {});
4642
1658
  const [showCompanyStructure, setShowCompanyStructure] = useState(
4643
1659
  currentCountry !== "US" && !isSoleProp
4644
1660
  );
@@ -4767,17 +1783,10 @@ function BusinessDetailsDropin({
4767
1783
  ...subjectEntity?.id && subjectEntity?.type && {
4768
1784
  legalEntityId: subjectEntity.id,
4769
1785
  entityType: subjectEntity.type
4770
- },
4771
- ...associatedLeTrackingParams
1786
+ }
4772
1787
  });
4773
1788
  }
4774
- }, [
4775
- searchingCompanies,
4776
- companySearchResults,
4777
- userEvents,
4778
- subjectEntity,
4779
- associatedLeTrackingParams
4780
- ]);
1789
+ }, [searchingCompanies, companySearchResults, userEvents, subjectEntity]);
4781
1790
  const {
4782
1791
  data: singleCompanyDatasetAndTinResponse,
4783
1792
  isLoading: fetchingDataset,
@@ -4826,11 +1835,10 @@ function BusinessDetailsDropin({
4826
1835
  );
4827
1836
  const { mutateAsync: createLegalEntity } = useCreateLegalEntity();
4828
1837
  const { mutateAsync: updateLegalEntity } = useUpdateLegalEntity();
4829
- const { mutateAsync: clearCompanyData2, isPending: resettingTrustedData } = useClearCompanyData();
1838
+ const { mutateAsync: clearCompanyData, isPending: resettingTrustedData } = useClearCompanyData();
4830
1839
  const submitTask = useCallback(() => {
4831
1840
  setAccountHolder(accountHolder);
4832
1841
  return submit({
4833
- additionalTrackingParams: associatedLeTrackingParams,
4834
1842
  data: currentState.data,
4835
1843
  legalEntityResponse,
4836
1844
  associatedLegalArrangement,
@@ -4854,7 +1862,6 @@ function BusinessDetailsDropin({
4854
1862
  }, [
4855
1863
  setAccountHolder,
4856
1864
  accountHolder,
4857
- associatedLeTrackingParams,
4858
1865
  currentState.data,
4859
1866
  legalEntityResponse,
4860
1867
  associatedLegalArrangement,
@@ -4882,13 +1889,12 @@ function BusinessDetailsDropin({
4882
1889
  steps
4883
1890
  } = useFormComposer({
4884
1891
  problems: currentProblems,
4885
- navigationTrackingParams: associatedLeTrackingParams,
4886
1892
  forms,
4887
1893
  onSubmit: submitTask
4888
1894
  });
4889
1895
  const loading = fetchingDataset || searchingCompanies || resettingTrustedData;
4890
1896
  const proceedToManualDataEntry = useCallback(async () => {
4891
- await clearCompanyData2().then(async () => {
1897
+ await clearCompanyData().then(async () => {
4892
1898
  if (!isUS) {
4893
1899
  setShowCompanyStructure(true);
4894
1900
  return;
@@ -4909,21 +1915,19 @@ function BusinessDetailsDropin({
4909
1915
  actionType: "submit",
4910
1916
  returnValue: "tinVerificationFailure",
4911
1917
  legalEntityId: subjectEntity.id,
4912
- entityType: subjectEntity.type,
4913
- ...associatedLeTrackingParams
1918
+ entityType: subjectEntity.type
4914
1919
  });
4915
1920
  }
4916
1921
  }
4917
1922
  });
4918
1923
  }, [
4919
- clearCompanyData2,
1924
+ clearCompanyData,
4920
1925
  isUS,
4921
1926
  businessName,
4922
1927
  tin,
4923
1928
  getCompanySelection,
4924
1929
  subjectEntity?.id,
4925
1930
  subjectEntity?.type,
4926
- associatedLeTrackingParams,
4927
1931
  userEvents
4928
1932
  ]);
4929
1933
  if (prevCompanySearchResults !== companySearchResults) {
@@ -5121,7 +2125,6 @@ function BusinessDetailsDropin({
5121
2125
  forms,
5122
2126
  activeForm,
5123
2127
  validateForm: () => setShouldValidate(true),
5124
- navigationTrackingParams: associatedLeTrackingParams,
5125
2128
  onSubmit: submitTask,
5126
2129
  problems: currentProblems,
5127
2130
  canSubmit: canSubmitForm,
@@ -5179,7 +2182,7 @@ function BusinessDetailsDropin({
5179
2182
  );
5180
2183
  }
5181
2184
  const LazyJpAddress = lazy(
5182
- async () => (await import("./JpAddress-BTfvrykR.js")).JpAddress
2185
+ async () => (await import("./JpAddress-Jxj9u4D5.js")).JpAddress
5183
2186
  );
5184
2187
  function AdditionalInformationMultiform({
5185
2188
  id,
@@ -5191,7 +2194,7 @@ function AdditionalInformationMultiform({
5191
2194
  validationErrors = {},
5192
2195
  verificationErrors = {}
5193
2196
  }) {
5194
- const { t, i18n } = useTranslation(["common", "business", "businessLines"]);
2197
+ const { t, i18n } = useTranslation(["common", "business"]);
5195
2198
  const { form } = useFormContext();
5196
2199
  const { isExperimentEnabled } = useExperimentsContext();
5197
2200
  const { data: rootLegalEntity } = useLegalEntity(ROOT_LE);
@@ -5330,9 +2333,9 @@ function AdditionalInformationMultiform({
5330
2333
  return mergeFieldMetadataIntoProps(
5331
2334
  field,
5332
2335
  resolveFieldMetadata(
5333
- defaultFieldConfig$1[country],
2336
+ defaultFieldConfig[country],
5334
2337
  { vatNumberType: form.data?.additionalInformation?.vatNumberType },
5335
- defaultFieldMetadata$1
2338
+ defaultFieldMetadata
5336
2339
  ),
5337
2340
  acc
5338
2341
  );
@@ -5610,12 +2613,12 @@ function AdditionalInformationMultiform({
5610
2613
  ),
5611
2614
  labels: {
5612
2615
  industryCodes: t(($) => $["industry"], {
5613
- ns: "businessLines"
2616
+ ns: "business"
5614
2617
  })
5615
2618
  },
5616
2619
  guidanceText: {
5617
2620
  industryCodes: t(($) => $["primaryIndustryCodeGuidance"], {
5618
- ns: "businessLines"
2621
+ ns: "business"
5619
2622
  })
5620
2623
  },
5621
2624
  readonly: formUtils.isReadOnly("industryCodes"),
@@ -5913,9 +2916,9 @@ function BasicInformationMultiform({
5913
2916
  return mergeFieldMetadataIntoProps(
5914
2917
  field,
5915
2918
  resolveFieldMetadata(
5916
- defaultFieldConfig[country],
2919
+ defaultFieldConfig$1[country],
5917
2920
  { isBusiness: true },
5918
- defaultFieldMetadata
2921
+ defaultFieldMetadata$1
5919
2922
  ),
5920
2923
  acc
5921
2924
  );
@@ -6202,7 +3205,7 @@ function CompanyStructureMultiform({
6202
3205
  excludedTypes.push(CompanyTypesValues.GOVERNMENTAL_ORGANIZATION);
6203
3206
  }
6204
3207
  const companyTypeRadioOptions = canChangeEntityType && accountHolder !== "aTrust" && accountHolder !== "anUnincorporatedPartnership" ? companyTypeOptions.filter((companyType) => !excludedTypes.includes(companyType)) : companyTypeOptions;
6205
- const companyTypeExamples2 = useCompanyTypeExamples(country);
3208
+ const companyTypeExamples = useCompanyTypeExamples(country);
6206
3209
  return /* @__PURE__ */ jsxs("form", { id, className: "adyen-kyc-company-structure", children: [
6207
3210
  /* @__PURE__ */ jsx(Header, { title: t(($) => $[heading]), description: t(($) => $[description]) }),
6208
3211
  /* @__PURE__ */ jsx(
@@ -6236,7 +3239,7 @@ function CompanyStructureMultiform({
6236
3239
  optionDescription: (option) => t(($) => $[companyTypeMetadata[option].description], { ns: "business" }),
6237
3240
  selected: form.data?.companyStructure?.entityType,
6238
3241
  onSelect: form.handleChangeFor("entityType", "companyStructure"),
6239
- examples: companyTypeExamples2,
3242
+ examples: companyTypeExamples,
6240
3243
  "aria-required": true,
6241
3244
  "aria-invalid": !form.valid?.companyStructure?.entityType
6242
3245
  }
@@ -6551,9 +3554,9 @@ function basicInformationValidators({
6551
3554
  taxInformationDefaultFieldMetadata
6552
3555
  )?.validators,
6553
3556
  stateOrProvince: resolveFieldMetadata(
6554
- defaultFieldConfig[country],
3557
+ defaultFieldConfig$1[country],
6555
3558
  { isBusiness: true },
6556
- defaultFieldMetadata
3559
+ defaultFieldMetadata$1
6557
3560
  )?.validators,
6558
3561
  registrationNumber: resolveFieldMetadata(
6559
3562
  registrationNumberDefaultFieldConfig[country],
@@ -6607,9 +3610,9 @@ function additionalInformationValidators({
6607
3610
  taxInformationDefaultFieldMetadata
6608
3611
  ).validators,
6609
3612
  vatNumber: resolveFieldMetadata(
6610
- defaultFieldConfig$1[country],
3613
+ defaultFieldConfig[country],
6611
3614
  { vatNumberType },
6612
- defaultFieldMetadata$1
3615
+ defaultFieldMetadata
6613
3616
  ).validators,
6614
3617
  vatAbsenceReason: vatAbsenceReasonMetadata.validators,
6615
3618
  eInvoicingCode: eInvoicingCodeFieldMetadata.validators,
@@ -6671,21 +3674,6 @@ function BusinessDetailsMultiformDropin({
6671
3674
  });
6672
3675
  });
6673
3676
  }, [subjectEntity?.documentDetails, subjectEntity?.id]);
6674
- const associatedLeTrackingParams = useMemo(
6675
- () => getAssociatedLeAnalyticsPayload({
6676
- associatedLegalEntity: associatedLegalArrangement
6677
- }),
6678
- [associatedLegalArrangement]
6679
- );
6680
- const handleTrackNavigation = useCallback(
6681
- (props) => {
6682
- trackNavigation({
6683
- ...props,
6684
- additionalTrackingParams: associatedLeTrackingParams
6685
- });
6686
- },
6687
- [associatedLeTrackingParams]
6688
- );
6689
3677
  useEffect(() => {
6690
3678
  userEvents.updateBaseTrackingPayload({ task: taskType });
6691
3679
  userEvents.addTaskEvent("Landed on page", {
@@ -6693,8 +3681,7 @@ function BusinessDetailsMultiformDropin({
6693
3681
  ...subjectEntity?.id && subjectEntity?.type && {
6694
3682
  legalEntityId: subjectEntity.id,
6695
3683
  entityType: subjectEntity.type
6696
- },
6697
- ...associatedLeTrackingParams
3684
+ }
6698
3685
  });
6699
3686
  }, []);
6700
3687
  const parseConfiguration = useCallback(
@@ -6874,7 +3861,6 @@ function BusinessDetailsMultiformDropin({
6874
3861
  const submitTask = useCallback(() => {
6875
3862
  setAccountHolder(accountHolder);
6876
3863
  return submit({
6877
- additionalTrackingParams: associatedLeTrackingParams,
6878
3864
  data: multiForm.data,
6879
3865
  legalEntityResponse,
6880
3866
  associatedLegalArrangement,
@@ -6898,7 +3884,6 @@ function BusinessDetailsMultiformDropin({
6898
3884
  }, [
6899
3885
  setAccountHolder,
6900
3886
  accountHolder,
6901
- associatedLeTrackingParams,
6902
3887
  multiForm.data,
6903
3888
  legalEntityResponse,
6904
3889
  associatedLegalArrangement,
@@ -6925,7 +3910,6 @@ function BusinessDetailsMultiformDropin({
6925
3910
  steps
6926
3911
  } = useFormComposer({
6927
3912
  problems,
6928
- navigationTrackingParams: associatedLeTrackingParams,
6929
3913
  forms,
6930
3914
  onSubmit: submitTask,
6931
3915
  triggerValidation: multiForm.triggerValidation
@@ -6968,17 +3952,10 @@ function BusinessDetailsMultiformDropin({
6968
3952
  ...subjectEntity?.id && subjectEntity?.type && {
6969
3953
  legalEntityId: subjectEntity.id,
6970
3954
  entityType: subjectEntity.type
6971
- },
6972
- ...associatedLeTrackingParams
3955
+ }
6973
3956
  });
6974
3957
  }
6975
- }, [
6976
- searchingCompanies,
6977
- userEvents,
6978
- subjectEntity,
6979
- associatedLeTrackingParams,
6980
- companySearchResponse?.results
6981
- ]);
3958
+ }, [searchingCompanies, userEvents, subjectEntity, companySearchResponse?.results]);
6982
3959
  const companySelectionInput = {
6983
3960
  company: companySearchResponse?.results[0],
6984
3961
  state: multiForm.data.basicInformation?.stateOrProvince,
@@ -7083,7 +4060,6 @@ function BusinessDetailsMultiformDropin({
7083
4060
  forms: ["businessSelection"]
7084
4061
  },
7085
4062
  problems,
7086
- trackNavigation: handleTrackNavigation,
7087
4063
  showLegalCaption: true
7088
4064
  },
7089
4065
  asModal,
@@ -7129,7 +4105,8 @@ function BusinessDetailsMultiformDropin({
7129
4105
  { ns: "business" }
7130
4106
  ),
7131
4107
  onCancel: handleBusinessMismatchCancel,
7132
- onConfirm: handleBusinessMismatchContinue
4108
+ onConfirm: handleBusinessMismatchContinue,
4109
+ analyticsEventLabel: "tinVerificationFailureModal"
7133
4110
  }
7134
4111
  )
7135
4112
  ]