@adyen/kyc-components 4.23.0 → 4.24.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1012) hide show
  1. package/dist/4-people-DKuivE0m.js +35 -0
  2. package/dist/AcceptTermsOfServiceWorkflow-C3JrMbt5.js +28 -0
  3. package/dist/Accordion-Dgdxfe-d.js +112 -0
  4. package/dist/AccountSetupRejected-D63dyojj.js +19 -0
  5. package/dist/AdaptiveWorkflow-XhWdnJv-.js +33 -0
  6. package/dist/AdaptiveWorkflowComponent-pMWy1Vig.js +166 -0
  7. package/dist/AddressFields-BC3QHs2u.js +468 -0
  8. package/dist/Alert-Cc7p0N5h.js +172 -0
  9. package/dist/AnalyticsContext-CpimDlw4.js +21 -0
  10. package/dist/Avatar-oTPu6Ejy.js +54 -0
  11. package/dist/BusinessFinancingDropin-CxHK6KY3.js +1870 -0
  12. package/dist/BusinessFinancingPage-teAAjQl8.js +89 -0
  13. package/dist/BusinessRegistrationNumberField-DKka8aVU.js +103 -0
  14. package/dist/BusinessRegistrationNumberFieldGroup-Df6_sDA0.js +173 -0
  15. package/dist/BusinessTypeSelectionPage-BETJH6LZ.js +457 -0
  16. package/dist/Button-DPJ1k02w.js +108 -0
  17. package/dist/Checkbox-qfdF12cF.js +60 -0
  18. package/dist/ComponentGroup-SozxzKWw.js +32 -0
  19. package/dist/Confirm-DoN9R9Z3.js +77 -0
  20. package/dist/ConstitutionalDocument-Bxsr1hQb.js +1229 -0
  21. package/dist/ContactDetails-CiWftLi4.js +516 -0
  22. package/dist/ContextGuidance-BQPwRscq.js +29 -0
  23. package/dist/ContractViewer-CG9UNGz1.js +1030 -0
  24. package/dist/CountryField-DT6-Jr_b.js +38 -0
  25. package/dist/Currency-oeXHRWzy.js +211 -0
  26. package/dist/CustomerSupport-D0bE0zga.js +141 -0
  27. package/dist/DataConflictsModal-CCaMgguu.js +238 -0
  28. package/dist/DebugModal-Cvp7_Z-i.js +456 -0
  29. package/dist/DecisionMakerDetails-Bbb_8up2.js +569 -0
  30. package/dist/DecisionMakerDetailsPage-BDTMzs1X.js +121 -0
  31. package/dist/DecisionMakers-maoFXpGe.js +594 -0
  32. package/dist/Dropzone-ttbRg2LI.js +250 -0
  33. package/dist/EmbeddedStatus-CYd2p4sP.js +129 -0
  34. package/dist/EndStateLayout-zZPm8S5M.js +83 -0
  35. package/dist/EntityAssociation-C2_Xuvf5.js +163 -0
  36. package/dist/ErrorPanel-D4JNFkvi.js +205 -0
  37. package/dist/Field-DwDJQVSS.js +154 -0
  38. package/dist/FormFlow.module-DqMxjYHl.js +20 -0
  39. package/dist/GlobalEntryModal-CLoPJXFE.js +1203 -0
  40. package/dist/GlobalEntryPage-DNPSSZ3M.js +78 -0
  41. package/dist/Header-DVLlJ6we.js +93 -0
  42. package/dist/Icon-4XR6gZzk.js +175 -0
  43. package/dist/IdentityNumber-3V6ZqvHB.js +540 -0
  44. package/dist/IdentityNumberFieldGroup-CAjlgTWn.js +57 -0
  45. package/dist/IdentityScreeningWorkflow-CBStT1hs.js +307 -0
  46. package/dist/Image-Bn_Yyuof.js +33 -0
  47. package/dist/IndividualDropin-0t7Oj71F.js +4175 -0
  48. package/dist/IndustryCodeFieldGroup-C3Zro2ds.js +189 -0
  49. package/dist/InputDate-Bq3Sb-ZW.js +211 -0
  50. package/dist/InputText-CFDEmEtp.js +119 -0
  51. package/dist/Introduction-z2SqIq1W.js +326 -0
  52. package/dist/InvitedDecisionMakerComponent-CZOVc-t9.js +481 -0
  53. package/dist/JpAddressFields-F1YCOcbO.js +288 -0
  54. package/dist/LandingLayout-BsIoIFzs.js +76 -0
  55. package/dist/LegalCompanyNameField-Cosyjk52.js +108 -0
  56. package/dist/LegalName-CtqIpsfy.js +33 -0
  57. package/dist/LegalRepresentativeDetailsPage-DwIARCpj.js +73 -0
  58. package/dist/Link-CvYhseSD.js +32 -0
  59. package/dist/ListItem-CYTpdOMa.js +70 -0
  60. package/dist/Loader-BVtlpTeo.js +92 -0
  61. package/dist/LoaderWrapper-Dc88hY-P.js +34 -0
  62. package/dist/MaybeModal-C4ySaA8A.js +24 -0
  63. package/dist/Modal-CHES6970.js +109 -0
  64. package/dist/Name-CdCsijr5.js +61 -0
  65. package/dist/NewSummary-D55f70wB.js +73 -0
  66. package/dist/NodeRenderer-B3G7pvjG.js +185 -0
  67. package/dist/PatriotActDisclosure-DqUZeLms.js +266 -0
  68. package/dist/PayoutDetailsDropin-LKMpfono.js +4104 -0
  69. package/dist/PayoutDetailsPage-KNHCeXgk.js +69 -0
  70. package/dist/ProgressBar-DWFxLMUA.js +38 -0
  71. package/dist/RadioGroup-Bf3DlQnZ.js +47 -0
  72. package/dist/RadioWithLabel-DQIOEYpF.js +45 -0
  73. package/dist/Review-CS_-zAlg.js +99 -0
  74. package/dist/RootBusinessDetailsPage-1z2_FAb6.js +67 -0
  75. package/dist/RootBusinessLinesPage-BgbkJaW8.js +1464 -0
  76. package/dist/RootIndividualDetailsPage-DA4hh_gc.js +82 -0
  77. package/dist/Select-phAxjMBQ.js +782 -0
  78. package/dist/SignPCIComponent-tBnZMn1u.js +373 -0
  79. package/dist/SingpassSelection-B6_DsZtn.js +156 -0
  80. package/dist/SoleProprietorshipPage-2s1kA9ZV.js +69 -0
  81. package/dist/SourceOfFundsPage-CTjUdOWK.js +2800 -0
  82. package/dist/SourceOfFundsWorkflow-BZabOpi_.js +28 -0
  83. package/dist/StateContext-B2_Pqd_y.js +9 -0
  84. package/dist/StateField-BpMwetvd.js +55 -0
  85. package/dist/Step-C6XxGAda.js +191 -0
  86. package/dist/StructuredList-nPasiuLi.js +56 -0
  87. package/dist/Summary-DM31WxLr.js +235 -0
  88. package/dist/Task-DwGA1eXE.js +129 -0
  89. package/dist/TaskGroup-T594JSYM.js +46 -0
  90. package/dist/TaskListItem-Dx3hKOqG.js +123 -0
  91. package/dist/TaskStepperContextProvider-DdcsqXT7.js +26 -0
  92. package/dist/TaskVerificationStatus-DEXk_ndE.js +125 -0
  93. package/dist/TaxInformationField-CV7SpMH1.js +242 -0
  94. package/dist/TaxInformationFieldGroup-DI2LzuNr.js +290 -0
  95. package/dist/TaxReportingDropin-xYwJ-ju7.js +480 -0
  96. package/dist/TaxReportingWorkflow-BHyHgiI-.js +28 -0
  97. package/dist/TermsOfServiceManagement-CNQ4J5Gn.js +644 -0
  98. package/dist/TextArea-qGEo3PFG.js +81 -0
  99. package/dist/TileGroup-D1-M64Ul.js +172 -0
  100. package/dist/ToastContext-B_wd2IY2.js +13 -0
  101. package/dist/ToastContextProvider-DjYKMflX.js +103 -0
  102. package/dist/TrustDetailsPage-Byj68n3F.js +1172 -0
  103. package/dist/TrustMemberCompanyPage-Bcz4Ql7s.js +108 -0
  104. package/dist/TrustMemberIndividualPage-D6CgWF88.js +108 -0
  105. package/dist/TrustMemberRoleAndTypePage-IUp5FVRW.js +937 -0
  106. package/dist/TrustMembersOverview-7EoKoSMg.js +453 -0
  107. package/dist/UboTaskItem-BmcGj5_U.js +115 -0
  108. package/dist/UnincorporatedPartnershipIndividualPage-BKpJDhhU.js +78 -0
  109. package/dist/UnincorporatedPartnershipMemberCompanyPage-D8VliL0i.js +78 -0
  110. package/dist/UnincorporatedPartnershipMemberRoleAndTypePage-D00bHhyf.js +256 -0
  111. package/dist/UnincorporatedPartnershipMembersOverview-Dw5IMSkd.js +160 -0
  112. package/dist/VerificationErrorAlert-CixajVtq.js +38 -0
  113. package/dist/Workflow-CWzMRGHX.js +228 -0
  114. package/dist/_rolldown_dynamic_import_helper-sGNwd-kR.js +14 -0
  115. package/dist/accountHolderUtils-CAu4V0ed.js +43 -0
  116. package/dist/adyen-business-financing.js +38 -37
  117. package/dist/adyen-individual-configuration.js +65 -65
  118. package/dist/adyen-individual-status.js +35 -34
  119. package/dist/adyen-invited-decision-maker.js +3 -3
  120. package/dist/adyen-onboarding.js +109 -101
  121. package/dist/adyen-terms-of-service-management.js +3 -3
  122. package/dist/adyen-terms-of-service-status.js +9 -8
  123. package/dist/adyen-transfer-instrument-configuration.js +62 -61
  124. package/dist/adyen-transfer-instrument-management.js +76 -70
  125. package/dist/adyen-verification-status.js +10 -8
  126. package/dist/arrow-right-D2hul7WG.js +20 -0
  127. package/dist/bafinUtils-DDrD6bfK.js +96 -0
  128. package/dist/bag-CRRS1aow.js +20 -0
  129. package/dist/bank-BoirCLLW.js +20 -0
  130. package/dist/bg-BG-B0Ia8sQm.js +7 -0
  131. package/dist/bg-BG-B2xaZ3wB.js +7 -0
  132. package/dist/bg-BG-DAR7_x2a.js +7 -0
  133. package/dist/bg-BG-DqfAUTUt.js +7 -0
  134. package/dist/bg-BG-ivZjQNJZ.js +7 -0
  135. package/dist/bin-BOmfqfrr.js +30 -0
  136. package/dist/birthDateUtils-D6uk7zwm.js +84 -0
  137. package/dist/businessRegistrationNumberPatterns-A08SLm03.js +982 -0
  138. package/dist/capital-DTjbiurV.js +23 -0
  139. package/dist/cash-stack-7KpYpBek.js +33 -0
  140. package/dist/certificate-BPuoJ6Ip.js +23 -0
  141. package/dist/checkmark-BiSLf8M1.js +20 -0
  142. package/dist/checkmark-circle-Ams7bSve.js +28 -0
  143. package/dist/checkmark-circle-fill-_p4ss4ac.js +30 -0
  144. package/dist/checkmark-small-3bw4ftPV.js +20 -0
  145. package/dist/chevron-down-GgZawvoy.js +20 -0
  146. package/dist/chevron-left-TeZTTvo5.js +20 -0
  147. package/dist/chevron-right-Cg8XlTxx.js +20 -0
  148. package/dist/chevron-up-COQUTli0.js +20 -0
  149. package/dist/circle-CypWzg83.js +30 -0
  150. package/dist/circle-small-filled-DfdK2A35.js +20 -0
  151. package/dist/clock-DmfGJ2r9.js +28 -0
  152. package/dist/coins-CBvbB8_X.js +30 -0
  153. package/dist/constants-C8yo0_RA.js +233 -0
  154. package/dist/contract-D1_RJ_xh.js +20 -0
  155. package/dist/countries-BGMTpyJv.js +41 -0
  156. package/dist/country-BEZkohEO.js +25 -0
  157. package/dist/cross-BORHADVQ.js +20 -0
  158. package/dist/cross-circle-fill-CUXdo1x-.js +30 -0
  159. package/dist/cross-circle-fill-small-DdoPZZeo.js +20 -0
  160. package/dist/cs-CZ-BwO4yrI4.js +7 -0
  161. package/dist/cs-CZ-CHMQYoMF.js +7 -0
  162. package/dist/cs-CZ-DsKlW7_D.js +7 -0
  163. package/dist/cs-CZ-NVntX32n.js +7 -0
  164. package/dist/cs-CZ-ywYpJk1F.js +7 -0
  165. package/dist/da-DK-BvT8Ob4A.js +7 -0
  166. package/dist/da-DK-BzBfkSME.js +7 -0
  167. package/dist/da-DK-CE7jnGea.js +7 -0
  168. package/dist/da-DK-DH5YNYFM.js +7 -0
  169. package/dist/da-DK-LPtdP8h0.js +7 -0
  170. package/dist/datasetUtil-BdHPWsxZ.js +45 -0
  171. package/dist/de-DE-C9cUCFOi.js +7 -0
  172. package/dist/de-DE-Cn866nnd.js +7 -0
  173. package/dist/de-DE-DA4LpyZI.js +7 -0
  174. package/dist/de-DE-DKkoZQ0X.js +7 -0
  175. package/dist/de-DE-DY_EJohI.js +7 -0
  176. package/dist/de-DE-vdy64knk.js +7 -0
  177. package/dist/debouncedInputEvent-Fwwp_K_-.js +54 -0
  178. package/dist/debugStore-Dwn1FXrh.js +9 -0
  179. package/dist/decision-makers-group-iEF9oKPp.js +2673 -0
  180. package/dist/decisionMakerRoles-C6LMC4mh.js +185 -0
  181. package/dist/document-1-qvV57JdS.js +20 -0
  182. package/dist/document-person-DiJ7M8-D.js +28 -0
  183. package/dist/download-Ca4w0Yfr.js +23 -0
  184. package/dist/dropinUtils-DTBezwYT.js +491 -0
  185. package/dist/edit-1-D8VhDchs.js +20 -0
  186. package/dist/el-GR-ChapyKa7.js +7 -0
  187. package/dist/el-GR-Cvms0L4K.js +7 -0
  188. package/dist/el-GR-D9PjIB9j.js +7 -0
  189. package/dist/el-GR-Ov9hqMNe.js +7 -0
  190. package/dist/el-GR-aelq5Q0a.js +7 -0
  191. package/dist/el-GR-zFv0QxMR.js +7 -0
  192. package/dist/en-US-B7HQdrn_.js +7 -0
  193. package/dist/en-US-CI7y0UEH.js +7 -0
  194. package/dist/en-US-C_VjFvk_.js +7 -0
  195. package/dist/en-US-Cz4JoU20.js +41 -0
  196. package/dist/en-US-DPr5RN3e.js +7 -0
  197. package/dist/en-US-U0d3NI20.js +7 -0
  198. package/dist/en-US-tFsDZf7y.js +7 -0
  199. package/dist/entityAssociationUtil-CY0grcyH.js +58 -0
  200. package/dist/error-BvgoQFEI.js +36 -0
  201. package/dist/es-ES-BQrdtEfn.js +7 -0
  202. package/dist/es-ES-BdByhG4y.js +7 -0
  203. package/dist/es-ES-BzlHKYJK.js +7 -0
  204. package/dist/es-ES-DCUvAmKI.js +7 -0
  205. package/dist/es-ES-DdrA8McY.js +7 -0
  206. package/dist/es-ES-DhkTbihW.js +7 -0
  207. package/dist/es-LA-3WgncmHx.js +7 -0
  208. package/dist/es-LA-BxtxM3Ty.js +7 -0
  209. package/dist/es-LA-ChRHGYJP.js +7 -0
  210. package/dist/es-LA-JRuDva0n.js +7 -0
  211. package/dist/es-LA-i7tKJmA8.js +7 -0
  212. package/dist/et-EE-BXY66vAz.js +7 -0
  213. package/dist/et-EE-D8TSvkoE.js +7 -0
  214. package/dist/et-EE-DOgb4q9o.js +7 -0
  215. package/dist/et-EE-HHgM0CfO.js +7 -0
  216. package/dist/et-EE-V-YOCgoh.js +7 -0
  217. package/dist/external-link-Dy4le-8Q.js +20 -0
  218. package/dist/fi-FI-B-eTv4bG.js +7 -0
  219. package/dist/fi-FI-CClpbvJJ.js +7 -0
  220. package/dist/fi-FI-CVBmM-U1.js +7 -0
  221. package/dist/fi-FI-DCYPQ6vS.js +7 -0
  222. package/dist/fi-FI-DCbhu29J.js +7 -0
  223. package/dist/fieldConfigurations-CZCFghnK.js +11 -0
  224. package/dist/form-rules-B0RwhsVw.js +284 -0
  225. package/dist/formFieldsUtils-CnDkgahc.js +7 -0
  226. package/dist/formUtils-BHgG8yQZ.js +52 -0
  227. package/dist/formUtils-DVDcdZsP.js +84 -0
  228. package/dist/formatCurrency-BetgkQKi.js +23 -0
  229. package/dist/formatValidationError-q_w9DTrl.js +23 -0
  230. package/dist/fr-FR-B-jA_cbo.js +7 -0
  231. package/dist/fr-FR-BIyJL6Jj.js +7 -0
  232. package/dist/fr-FR-BzyefnBh.js +7 -0
  233. package/dist/fr-FR-C1xYwHeC.js +7 -0
  234. package/dist/fr-FR-D0hY9V44.js +7 -0
  235. package/dist/fr-FR-Doo1FVx-.js +7 -0
  236. package/dist/genUtils-nphCwt1A.js +60 -0
  237. package/dist/getDefaultRegistrationNumberType-CIu4WMln.js +1056 -0
  238. package/dist/getFormSlice-C1ma6Xd4.js +21 -0
  239. package/dist/getLegalEntityCountry-BK-HHa65.js +15 -0
  240. package/dist/getName-DgxRqagk.js +34 -0
  241. package/dist/getProblemsForEntity-Bn6dXidE.js +16 -0
  242. package/dist/getTrustedDecisionMakers-Ta-pURcL.js +25 -0
  243. package/dist/getTrustedFields-BJ88GlM-.js +28 -0
  244. package/dist/gift-Bs_mAgul.js +20 -0
  245. package/dist/globalStore-WASei98w.js +418 -0
  246. package/dist/graph-Co0JhGiY.js +32 -0
  247. package/dist/graph-up-DIvH9haf.js +38 -0
  248. package/dist/headquarter-BESfDGKh.js +42 -0
  249. package/dist/hotel-Vne7G5M6.js +33 -0
  250. package/dist/hr-HR-6Wj5Tf60.js +7 -0
  251. package/dist/hr-HR-B4FRVzrd.js +7 -0
  252. package/dist/hr-HR-B6z7-PYE.js +7 -0
  253. package/dist/hr-HR-BOYktLQ2.js +7 -0
  254. package/dist/hr-HR-Ct_41fWV.js +7 -0
  255. package/dist/http-fdIO--pH.js +204 -0
  256. package/dist/hu-HU-B7ofWKn_.js +7 -0
  257. package/dist/hu-HU-Bwm4UqZz.js +7 -0
  258. package/dist/hu-HU-CO_7jvk9.js +7 -0
  259. package/dist/hu-HU-CgJ_F3l2.js +7 -0
  260. package/dist/hu-HU-DXK7B0r_.js +7 -0
  261. package/dist/image-BQM21XCk.js +23 -0
  262. package/dist/info-DExoPRH5.js +32 -0
  263. package/dist/info-filled-11KMeUso.js +32 -0
  264. package/dist/invalidateRootLegalEntity-BHaVREw-.js +45 -0
  265. package/dist/isEmpty-Uewyl-r6.js +14 -0
  266. package/dist/isEmptyEntity-3OHnhXqG.js +43 -0
  267. package/dist/it-IT-BFIW0DCO.js +7 -0
  268. package/dist/it-IT-CNr6PIu3.js +7 -0
  269. package/dist/it-IT-CQVFYSVx.js +7 -0
  270. package/dist/it-IT-DfGdOsTs.js +7 -0
  271. package/dist/it-IT-DgRuEpeD.js +7 -0
  272. package/dist/it-IT-tZ7dP-Ia.js +7 -0
  273. package/dist/ja-JP--tMJF7eu.js +7 -0
  274. package/dist/ja-JP-BjMyxZiN.js +7 -0
  275. package/dist/ja-JP-Ct54-uwM.js +7 -0
  276. package/dist/ja-JP-CtX9NZKD.js +7 -0
  277. package/dist/ja-JP-DAClbueM.js +7 -0
  278. package/dist/ja-JP-DOuEAOlh.js +7 -0
  279. package/dist/keys-Ce8YnRP2.js +20 -0
  280. package/dist/legalArrangementUtils-C68JdH6I.js +114 -0
  281. package/dist/listToRecord-DumSkYDz.js +10 -0
  282. package/dist/location-zRH5zJ8c.js +23 -0
  283. package/dist/lt-LT-BUuouq_-.js +7 -0
  284. package/dist/lt-LT-Cs3cvyKf.js +7 -0
  285. package/dist/lt-LT-DQp7UGdC.js +7 -0
  286. package/dist/lt-LT-DoYCfhZU.js +7 -0
  287. package/dist/lt-LT-DqtpAjOg.js +7 -0
  288. package/dist/lv-LV-BCXqSzkk.js +7 -0
  289. package/dist/lv-LV-BW0BscAd.js +7 -0
  290. package/dist/lv-LV-C3p57pZV.js +7 -0
  291. package/dist/lv-LV-ZmyUvPst.js +7 -0
  292. package/dist/lv-LV-cKvnQI3j.js +7 -0
  293. package/dist/mail-i1-zg-cv.js +20 -0
  294. package/dist/mapAddressLocalizationToJpAddressSchema-DpOIaxj6.js +26 -0
  295. package/dist/mapExistingFile-BkwRTTRm.js +55 -0
  296. package/dist/mapJpAddressSchemaToAddressLocalizations-D3VO2nhc.js +74 -0
  297. package/dist/mapLegalEntityToIndividualSchema-CBKR-InO.js +251 -0
  298. package/dist/mapScriptLocalization-BCfkZo1y.js +46 -0
  299. package/dist/mapTransferInstrumentToPayoutAccount-ROfaTly6.js +44 -0
  300. package/dist/maskHelpers-C0wnCoJl.js +719 -0
  301. package/dist/minus-circle-filled-CxUdRO8J.js +30 -0
  302. package/dist/nl-NL-B77Xr99l.js +7 -0
  303. package/dist/nl-NL-BUwMAW5C.js +7 -0
  304. package/dist/nl-NL-B_MaTF5h.js +7 -0
  305. package/dist/nl-NL-CePL3t7P.js +7 -0
  306. package/dist/nl-NL-DR5SCDAF.js +7 -0
  307. package/dist/nl-NL-DqGE4Nz5.js +7 -0
  308. package/dist/no-NO-BePxpMbr.js +7 -0
  309. package/dist/no-NO-DGCfRiU8.js +7 -0
  310. package/dist/no-NO-DdI2BI_e.js +7 -0
  311. package/dist/no-NO-P8SZ1t-h.js +7 -0
  312. package/dist/no-NO-oL1v_O9N.js +7 -0
  313. package/dist/options-horizontal-D86T_xAF.js +30 -0
  314. package/dist/partner-Dje0ykF6.js +30 -0
  315. package/dist/patternValidators-DsrZkuOO.js +73 -0
  316. package/dist/pay-by-link-plane-DAiddPu6.js +33 -0
  317. package/dist/payout-DKiGv3F9.js +38 -0
  318. package/dist/pdf-CC8vqpTo.js +22320 -0
  319. package/dist/pdf.worker.min-CdKJICZZ.js +75124 -0
  320. package/dist/person-DgALGIIz.js +23 -0
  321. package/dist/pl-PL-6Q3Ue3F5.js +7 -0
  322. package/dist/pl-PL-B5PBixAB.js +7 -0
  323. package/dist/pl-PL-BCkw9R28.js +7 -0
  324. package/dist/pl-PL-BY6KUTBO.js +7 -0
  325. package/dist/pl-PL-D-s-JI6X.js +7 -0
  326. package/dist/plus-DlQKP2C9.js +20 -0
  327. package/dist/plus-circle-filled-BntUOVIJ.js +30 -0
  328. package/dist/processCapabilities-CWE5UFt8.js +870 -0
  329. package/dist/processValidationErrors-CjsNfiRK.js +62 -0
  330. package/dist/pt-BR-B_XHiDCU.js +7 -0
  331. package/dist/pt-BR-BvNR77Ru.js +7 -0
  332. package/dist/pt-BR-CrLCMcSz2.js +7 -0
  333. package/dist/pt-BR-MrUfWW4a.js +7 -0
  334. package/dist/pt-BR-vwt2tE7H.js +7 -0
  335. package/dist/pt-PT-B17is9TY.js +7 -0
  336. package/dist/pt-PT-BZNPd_Tb.js +7 -0
  337. package/dist/pt-PT-DDYnXawl.js +7 -0
  338. package/dist/pt-PT-DhF8wwYH.js +7 -0
  339. package/dist/pt-PT-Du2K44jh.js +7 -0
  340. package/dist/pt-PT-qAzFgjvF.js +7 -0
  341. package/dist/recurring-DZgT_ekJ.js +23 -0
  342. package/dist/resolveEnvironment-B3aGkYuN.js +1000 -0
  343. package/dist/revenue-accelerate-aMLYFVW6.js +30 -0
  344. package/dist/ro-RO-B3Fcn95o.js +7 -0
  345. package/dist/ro-RO-BA5GhaCE.js +7 -0
  346. package/dist/ro-RO-BmHe4pZ-.js +7 -0
  347. package/dist/ro-RO-DChAv29z.js +7 -0
  348. package/dist/ro-RO-W1t7Mnbn.js +7 -0
  349. package/dist/roleMetadata-Dm1FVuPT.js +56 -0
  350. package/dist/save-uDNye08N.js +20 -0
  351. package/dist/search-0OS6oe8N.js +30 -0
  352. package/dist/show-BWoS9-Y1.js +23 -0
  353. package/dist/sk-SK-BeNF_m_j.js +7 -0
  354. package/dist/sk-SK-C9CiQLgt.js +7 -0
  355. package/dist/sk-SK-CISCMQ2G.js +7 -0
  356. package/dist/sk-SK-CcoUWnJ4.js +7 -0
  357. package/dist/sk-SK-D10Kpths.js +7 -0
  358. package/dist/sl-SI-Bxu4m_5e.js +7 -0
  359. package/dist/sl-SI-DCMml0lX.js +7 -0
  360. package/dist/sl-SI-DmYiMn91.js +7 -0
  361. package/dist/sl-SI-DxomO9JQ.js +7 -0
  362. package/dist/sl-SI-Qe4hzx5a.js +7 -0
  363. package/dist/solution-payments-BMal7uJZ.js +20 -0
  364. package/dist/store-N7ZA4FKy.js +20 -0
  365. package/dist/style.css +2341 -2252
  366. package/dist/styles-DYaAeu4q.js +2337 -2248
  367. package/dist/summaryItem-uDWmtYtt.js +16 -0
  368. package/dist/sv-SE-B-CXDaXM.js +7 -0
  369. package/dist/sv-SE-BzPNBHOj.js +7 -0
  370. package/dist/sv-SE-C9SgeFv6.js +7 -0
  371. package/dist/sv-SE-DESDUMyu.js +7 -0
  372. package/dist/sv-SE-Dq6oK7B5.js +7 -0
  373. package/dist/sv-SE-issaSBHd.js +7 -0
  374. package/dist/terminal-1-0RlQpbUC.js +30 -0
  375. package/dist/toFullWidth-Dgy4X4i8.js +52 -0
  376. package/dist/translation-DbATp_35.js +684 -0
  377. package/dist/trustUtil-5cyXiJnX.js +98 -0
  378. package/dist/types/adaptiveWorkflow/components/Fields/TaxInformation/TaxIdTypeSelectorField.d.ts +1 -2
  379. package/dist/types/adaptiveWorkflow/components/Fields/TaxInformation/TaxInformationFieldGroup.d.ts +1 -2
  380. package/dist/types/adaptiveWorkflow/utils/utils.d.ts +1 -1
  381. package/dist/types/api/configurations/useScenarios.d.ts +1 -1
  382. package/dist/types/api/createLegalEntity/useCreateLegalEntity.d.ts +12 -12
  383. package/dist/types/api/documentValidation/useDocumentValidate.d.ts +2 -2
  384. package/dist/types/api/documents/documents.types.d.ts +9 -0
  385. package/dist/types/api/documents/useCreateDocument.d.ts +10 -3
  386. package/dist/types/api/documents/useDeleteDocument.d.ts +1 -1
  387. package/dist/types/api/documents/useDocument.d.ts +1 -1
  388. package/dist/types/api/documents/useDocuments.d.ts +10 -2
  389. package/dist/types/api/documents/useUpdateDocument.d.ts +3 -3
  390. package/dist/types/api/invitedEntity/getInvitedEntityProblems.d.ts +1 -1
  391. package/dist/types/api/legalEntity/legalEntity.types.d.ts +32 -0
  392. package/dist/types/api/legalEntity/useLegalEntity.d.ts +92 -92
  393. package/dist/types/api/legalEntity/useUpdateLegalEntity.d.ts +14 -14
  394. package/dist/types/api/taskStatus/useTaskStatuses.d.ts +1 -1
  395. package/dist/types/api/transferInstruments/transferInstruments.types.d.ts +18 -0
  396. package/dist/types/api/transferInstruments/useCreateTransferInstrument.d.ts +2 -2
  397. package/dist/types/api/transferInstruments/useTransferInstrument.d.ts +1 -1
  398. package/dist/types/api/transferInstruments/useUpdateTransferInstrument.d.ts +2 -2
  399. package/dist/types/api/transferInstruments/useUpdateTrustedTransferInstrument.d.ts +1 -1
  400. package/dist/types/components/Apps/tasks/TaskList/TaskList.d.ts +1 -1
  401. package/dist/types/components/BankAccount/fields/BankAccountNumber/fieldConfig.d.ts +2 -0
  402. package/dist/types/components/BankAccount/forms/BankDocument/types.d.ts +1 -1
  403. package/dist/types/components/BankAccount/forms/PayoutAccount/types.d.ts +1 -1
  404. package/dist/types/components/BankAccount/forms/PayoutCountryDetails/types.d.ts +1 -1
  405. package/dist/types/components/BankAccount/forms/PayoutDetails/PayoutDetails.d.ts +1 -1
  406. package/dist/types/components/BankAccount/forms/PayoutDetails/types.d.ts +1 -1
  407. package/dist/types/components/BankAccount/forms/PayoutVerificationMethod/AccountHolderDescriptionFragment.d.ts +1 -1
  408. package/dist/types/components/BankAccount/forms/PayoutVerificationMethod/types.d.ts +1 -1
  409. package/dist/types/components/BankAccount/forms/PayoutVerificationMethod/utils.d.ts +1 -1
  410. package/dist/types/components/BankAccount/mapping/mapPayoutAccountSchemaToApiBankAccount.d.ts +2 -2
  411. package/dist/types/components/BankAccount/mapping/mapPayoutDetailsToTransferInstrument.d.ts +3 -3
  412. package/dist/types/components/BankAccount/mapping/mapPayoutDocumentsToApiDocuments.d.ts +2 -2
  413. package/dist/types/components/BankAccount/mapping/mapTransferInstrumentToPayoutAccount.d.ts +1 -1
  414. package/dist/types/components/BankAccount/mapping/payoutKeyMappings.d.ts +8 -4
  415. package/dist/types/components/BankAccount/tasks/PayoutAccount/PayoutAccountTaskListItem.d.ts +2 -2
  416. package/dist/types/components/BankAccount/tasks/PayoutDetailsDropin/utils.d.ts +1 -1
  417. package/dist/types/components/Business/hooks/useBusinessDetailsData.d.ts +1 -1
  418. package/dist/types/components/Business/hooks/useSubmitBusinessDetails.types.d.ts +1 -1
  419. package/dist/types/components/Business/mapping/businessDetails/businessDetailsKeyMappings.d.ts +4 -4
  420. package/dist/types/components/Business/mapping/businessDetails/mapBusinessDetailsSchemaToLegalEntity.d.ts +4 -4
  421. package/dist/types/components/Business/mapping/businessDetails/mapLegalEntityToBusinessDetailsSchema.d.ts +1 -1
  422. package/dist/types/components/Business/mapping/businessDetails/solePropBusinessDetailsKeyMappings.d.ts +4 -4
  423. package/dist/types/components/Business/tasks/BusinessDetailsDropin/types.d.ts +1 -1
  424. package/dist/types/components/Business/utils/buildRequiredForms.d.ts +1 -1
  425. package/dist/types/components/Business/utils/getAvailableCompanyStructures.d.ts +1 -2
  426. package/dist/types/components/Business/utils/utils.d.ts +2 -15
  427. package/dist/types/components/BusinessLines/tasks/types.d.ts +1 -1
  428. package/dist/types/components/Contract/tasks/PciDropin/types.d.ts +1 -1
  429. package/dist/types/components/Contract/tasks/ServiceAgreementDropin/types.d.ts +1 -1
  430. package/dist/types/components/EFP/mapping/businessFinancingKeyMappings.d.ts +33 -33
  431. package/dist/types/components/EFP/mapping/mapBusinessFinancingToLegalEntity.d.ts +2 -2
  432. package/dist/types/components/EFP/mapping/mapLegalEntityToBusinessFinancing.d.ts +2 -2
  433. package/dist/types/components/EFP/tasks/BusinessFinancingDropin/types.d.ts +3 -3
  434. package/dist/types/components/EFP/tasks/BusinessFinancingDropin/utils.d.ts +3 -4
  435. package/dist/types/components/EFP/tasks/SourceOfFundsDropin/SourceOfFundsGettingStarted/SourceOfFundsGettingStarted.d.ts +2 -3
  436. package/dist/types/components/EFP/tasks/SourceOfFundsDropin/SourceOfFundsUploader/SourceOfFundsUpload.d.ts +1 -1
  437. package/dist/types/components/EFP/tasks/SourceOfFundsDropin/types.d.ts +1 -3
  438. package/dist/types/components/EFP/tasks/SourceOfFundsDropin/utils.d.ts +13 -5
  439. package/dist/types/components/EFP/tasks/TaxReportingDropin/TaxReportingGettingStarted.d.ts +2 -2
  440. package/dist/types/components/EmbeddedDropins/CreateTransferInstrumentComponent/CreateTransferInstrumentComponent.d.ts +1 -1
  441. package/dist/types/components/EmbeddedDropins/ManageIndividualComponent/ManageIndividualComponent.d.ts +1 -1
  442. package/dist/types/components/EmbeddedDropins/ManageTransferInstrumentComponent/ManageTransferInstrumentComponent.d.ts +1 -1
  443. package/dist/types/components/EmbeddedDropins/ManageTransferInstrumentComponent/ManageTransferInstrumentOverview/ManageTransferInstrumentOverview.d.ts +1 -2
  444. package/dist/types/components/EmbeddedDropins/ManageTransferInstrumentComponent/ManageTransferInstrumentOverviewItem/ManageTransferInstrumentOverviewItem.d.ts +1 -2
  445. package/dist/types/components/EmbeddedDropins/ManageTransferInstrumentComponent/ManageTransferInstrumentOverviewItemModal/ManageTransferInstrumentOverviewItemModal.d.ts +1 -2
  446. package/dist/types/components/EmbeddedDropins/OnboardingDropinComponent/DropinComposer/types.d.ts +1 -1
  447. package/dist/types/components/EmbeddedDropins/ViewVerificationStatus/ViewVerificationStatusComponent.d.ts +1 -1
  448. package/dist/types/components/GlobalEntry/companyTypeMetadata.d.ts +10 -0
  449. package/dist/types/components/GlobalEntry/forms/CompanyStructure/CompanyStructure.d.ts +3 -0
  450. package/dist/types/components/GlobalEntry/forms/CompanyStructure/types.d.ts +10 -0
  451. package/dist/types/components/GlobalEntry/forms/RegistrationInformation/RegistrationInformation.d.ts +1 -1
  452. package/dist/types/components/GlobalEntry/mapping/globalEntryKeyMapping.d.ts +15 -0
  453. package/dist/types/components/GlobalEntry/mapping/mapGlobalEntrySchemaToLegalEntity.d.ts +6 -0
  454. package/dist/types/components/GlobalEntry/mapping/mapLegalEntityToGlobalEntrySchema.d.ts +9 -0
  455. package/dist/types/components/GlobalEntry/rules.d.ts +1 -0
  456. package/dist/types/components/GlobalEntry/tasks/GlobalEntry.d.ts +1 -1
  457. package/dist/types/components/GlobalEntry/tasks/GlobalEntryModal.d.ts +1 -1
  458. package/dist/types/components/GlobalEntry/tasks/types.d.ts +2 -0
  459. package/dist/types/components/GlobalEntry/utils/buildRequiredForms.d.ts +16 -0
  460. package/dist/types/components/GlobalEntry/utils/getAvailableCompanyStructures.d.ts +12 -0
  461. package/dist/types/components/GlobalEntry/utils/submitGlobalEntry.d.ts +20 -0
  462. package/dist/types/components/GlobalEntry/utils/utils.d.ts +18 -0
  463. package/dist/types/components/GlobalEntry/validate.d.ts +3 -1
  464. package/dist/types/components/Individual/forms/BasicDetails/BasicDetails.types.d.ts +3 -3
  465. package/dist/types/components/Individual/forms/IdDocumentUpload/types.d.ts +1 -1
  466. package/dist/types/components/Individual/forms/IdNowVerificationModal/isIdNowModalOpen.d.ts +8 -8
  467. package/dist/types/components/Individual/forms/Individual.types.d.ts +2 -3
  468. package/dist/types/components/Individual/helpers/bafinUtils.d.ts +3 -4
  469. package/dist/types/components/Individual/helpers/findRelevantTaxInformation.d.ts +28 -0
  470. package/dist/types/components/Individual/helpers/hasLiveSelfieError.d.ts +11 -0
  471. package/dist/types/components/Individual/helpers/isManualVerificationOrExistingDoc.d.ts +13 -0
  472. package/dist/types/components/Individual/mapping/individualKeyMappings.d.ts +4 -4
  473. package/dist/types/components/Individual/mapping/mapIndividualDocumentToApiDocument.d.ts +2 -2
  474. package/dist/types/components/Individual/mapping/mapIndividualSchemaToLegalEntity.d.ts +2 -2
  475. package/dist/types/components/Individual/mapping/mapLegalEntityToIndividualSchema.d.ts +1 -1
  476. package/dist/types/components/Individual/tasks/DecisionMakers/DecisionMakerDetails/DecisionMakerDetails.types.d.ts +1 -1
  477. package/dist/types/components/Individual/tasks/DecisionMakers/DecisionMakerDetails/utils.d.ts +34 -10
  478. package/dist/types/components/Individual/tasks/DecisionMakers/getTrustedDecisionMakers.d.ts +2 -3
  479. package/dist/types/components/Individual/tasks/DecisionMakers/hooks/useTaskStatusWithTimeout.d.ts +1 -0
  480. package/dist/types/components/Individual/tasks/DecisionMakers/types.d.ts +2 -3
  481. package/dist/types/components/Individual/tasks/DecisionMakers/utils.d.ts +1 -1
  482. package/dist/types/components/Shared/EntityAssociation/types.d.ts +2 -2
  483. package/dist/types/components/Shared/Introduction/Introduction.d.ts +1 -1
  484. package/dist/types/components/Shared/Introduction/IntroductionScreen.d.ts +1 -1
  485. package/dist/types/components/Shared/Introduction/constants.d.ts +1 -1
  486. package/dist/types/components/Shared/Introduction/copy.d.ts +1 -1
  487. package/dist/types/components/Shared/SingpassBanner/SingpassBanner.d.ts +1 -1
  488. package/dist/types/components/Shared/SingpassSelection/types.d.ts +1 -1
  489. package/dist/types/components/Shared/devex/DebugListener/debugInfo.d.ts +1 -2
  490. package/dist/types/components/Shared/fields/BusinessRegistrationNumberField/RegistrationNumberTypeSelector/getDefaultRegistrationNumberType.d.ts +1 -2
  491. package/dist/types/components/Shared/fields/TaxInformationField/TaxIdNumberTypeSelector/TaxIdNumberTypeSelector.d.ts +1 -2
  492. package/dist/types/components/Shared/fields/TaxInformationField/TaxIdNumberTypeSelector/findExistingTaxInformation.d.ts +10 -0
  493. package/dist/types/components/Shared/fields/TaxInformationField/fieldConfig.d.ts +3 -4
  494. package/dist/types/components/Shared/fields/TaxInformationField/taxIdNumberTypes.d.ts +107 -8
  495. package/dist/types/components/Shared/fields/TaxInformationField/types.d.ts +7 -6
  496. package/dist/types/components/Shared/fields/VatNumberField/VatNumberTypeSelector/VatNumberTypeSelector.d.ts +1 -2
  497. package/dist/types/components/Shared/forms/Address/utils.d.ts +1 -1
  498. package/dist/types/components/Shared/forms/BusinessTypeSelection/types.d.ts +1 -1
  499. package/dist/types/components/Shared/forms/BusinessTypeSelection/useUpdateLegalEntityAndSelectAccountHolder.d.ts +1 -2
  500. package/dist/types/components/Shared/forms/BusinessTypeSelection/utils.d.ts +2 -4
  501. package/dist/types/components/Shared/forms/ConstitutionalDocument/types.d.ts +1 -1
  502. package/dist/types/components/Shared/forms/DocumentUpload/types.d.ts +1 -1
  503. package/dist/types/components/Shared/tasks/CustomerSupport/mapping/customerSupportKeyMapping.d.ts +2 -2
  504. package/dist/types/components/Trust/hooks/useExemptSettlor.d.ts +1 -1
  505. package/dist/types/components/Trust/hooks/useTrustMemberNavigation.hook.d.ts +1 -1
  506. package/dist/types/components/Trust/mapping/mapLegalEntityToTrust.d.ts +1 -1
  507. package/dist/types/components/Trust/mapping/mapTrustDocumentToApiDocument.d.ts +2 -2
  508. package/dist/types/components/Trust/mapping/mapTrustToLegalEntity.d.ts +2 -2
  509. package/dist/types/components/Trust/mapping/trustKeyMappings.d.ts +4 -4
  510. package/dist/types/components/Trust/mapping/trustMembers/getTrustMembers.d.ts +1 -1
  511. package/dist/types/components/Trust/mapping/trustMembers/mapEntityAssociationsToTrustMembers.d.ts +3 -4
  512. package/dist/types/components/Trust/mapping/trustMembers/mapRootLegalEntityToTrustMember.d.ts +1 -1
  513. package/dist/types/components/Trust/tasks/RoleAndTypeDropin/types.d.ts +1 -1
  514. package/dist/types/components/Trust/tasks/TrustDropin/types.d.ts +1 -1
  515. package/dist/types/components/Trust/tasks/TrustMembers/types.d.ts +3 -4
  516. package/dist/types/components/Trust/utils/addOrUpdateAssociatedTrustMember.d.ts +1 -1
  517. package/dist/types/components/Trust/utils/addOrUpdateUndefinedBeneficiary.d.ts +1 -1
  518. package/dist/types/components/Trust/utils/createExemptSettlor.d.ts +1 -1
  519. package/dist/types/components/Trust/utils/deleteAssociatedTrustMember.d.ts +1 -1
  520. package/dist/types/components/Trust/utils/deleteUndefinedBeneficiary.d.ts +1 -1
  521. package/dist/types/components/Trust/utils/trustUtil.d.ts +5 -6
  522. package/dist/types/components/Trust/utils/updateExemptSettlorName.d.ts +1 -1
  523. package/dist/types/components/UnincorporatedPartnership/hooks/useUnincorporatedPartnershipNavigation.d.ts +1 -2
  524. package/dist/types/components/UnincorporatedPartnership/mapping/mapLegalEntityToUnincorporatedPartnership.d.ts +1 -1
  525. package/dist/types/components/UnincorporatedPartnership/mapping/mapUnincorporatedPartnershipToLegalEntity.d.ts +2 -2
  526. package/dist/types/components/UnincorporatedPartnership/mapping/unincorporatedPartnershipKeyMappings.d.ts +3 -3
  527. package/dist/types/components/UnincorporatedPartnership/tasks/UnincorporatedPartnershipMembers/types.d.ts +1 -2
  528. package/dist/types/components/UnincorporatedPartnership/tasks/UnincorporatedPartnershipRoleAndType/types.d.ts +1 -2
  529. package/dist/types/components/UnincorporatedPartnership/utils/unincorporatedPartnershipMembers.d.ts +3 -4
  530. package/dist/types/components/ui/molecules/DocumentGuidance/DocumentGuidance.types.d.ts +1 -1
  531. package/dist/types/context/ToggleContext/types.d.ts +0 -4
  532. package/dist/types/core/errorMapping.d.ts +3 -4
  533. package/dist/types/core/models/api/accountIdentification.d.ts +5 -1
  534. package/dist/types/core/models/api/legal-entity-association.d.ts +0 -19
  535. package/dist/types/core/process-field-configurations.d.ts +4 -6
  536. package/dist/types/core/user-events.d.ts +2 -4
  537. package/dist/types/hooks/introduction/useCanSeeIntroduction.d.ts +1 -1
  538. package/dist/types/hooks/introduction/useIntroductionScreens.d.ts +1 -1
  539. package/dist/types/hooks/introduction/useShouldShowIntroduction.d.ts +1 -1
  540. package/dist/types/hooks/singpass/useSingpassMyInfoLogin.d.ts +1 -1
  541. package/dist/types/hooks/useAssociatedLegalEntity.d.ts +1 -2
  542. package/dist/types/hooks/useAssociatedLegalRepresentative.d.ts +1 -1
  543. package/dist/types/hooks/useBusinessSetup.d.ts +1 -1
  544. package/dist/types/hooks/useForm/types.d.ts +1 -2
  545. package/dist/types/hooks/useLegalEntityType.d.ts +1 -2
  546. package/dist/types/hooks/useScenarioConfiguration.d.ts +1 -1
  547. package/dist/types/router/DefaultRouteRedirect.d.ts +1 -1
  548. package/dist/types/router/OnboardingRouter.d.ts +1 -2
  549. package/dist/types/router/getDefaultTask.d.ts +1 -1
  550. package/dist/types/stores/globalStore/calculateTaskStatus.d.ts +3 -5
  551. package/dist/types/stores/globalStore/determineTaskIdentifiers.d.ts +3 -5
  552. package/dist/types/stores/globalStore/get-task-status.d.ts +4 -4
  553. package/dist/types/stores/globalStore/globalStore.d.ts +3 -5
  554. package/dist/types/stores/globalStore/isEmptyEntity.d.ts +1 -1
  555. package/dist/types/types/businessEntityType.d.ts +1 -2
  556. package/dist/types/types/errors/capability-problems.d.ts +5 -1
  557. package/dist/types/types/errors/entity-problems.d.ts +8 -5
  558. package/dist/types/types/form-rules.d.ts +1 -1
  559. package/dist/types/utils/accountHolderUtils.d.ts +1 -1
  560. package/dist/types/utils/addLinkedFields.d.ts +2 -2
  561. package/dist/types/utils/analytics/debouncedInputEvent.d.ts +4 -4
  562. package/dist/types/utils/analytics/getAnalyticsAssociatedEntityDetails.d.ts +2 -3
  563. package/dist/types/utils/analytics/getPrefilledDetails.d.ts +2 -2
  564. package/dist/types/utils/api/documentUtils.d.ts +21 -10
  565. package/dist/types/utils/api/getProblemsForEntity.d.ts +1 -1
  566. package/dist/types/utils/api/processCapabilities.d.ts +11 -4
  567. package/dist/types/utils/bankUtils.d.ts +5 -0
  568. package/dist/types/utils/birthDateUtils.d.ts +6 -1
  569. package/dist/types/utils/businessUtils.d.ts +21 -6
  570. package/dist/types/utils/customerSupportUtils.d.ts +2 -3
  571. package/dist/types/utils/decisionMakerRoles.d.ts +4 -5
  572. package/dist/types/utils/entityAssociationUtil.d.ts +21 -12
  573. package/dist/types/utils/entityStatusUtil.d.ts +1 -1
  574. package/dist/types/utils/getFieldsWithExistingData.d.ts +2 -2
  575. package/dist/types/utils/getLegalEntityCountry.d.ts +1 -1
  576. package/dist/types/utils/getName.d.ts +3 -3
  577. package/dist/types/utils/getTrustedFields.d.ts +4 -5
  578. package/dist/types/utils/mapping/documentGuidanceMap.d.ts +2 -2
  579. package/dist/types/utils/mapping/getPage.d.ts +3 -4
  580. package/dist/types/utils/mapping/mappingRecord.d.ts +1 -1
  581. package/dist/types/utils/roleMetadata.d.ts +1 -1
  582. package/dist/types/utils/unincorporatedParnershipUtils.d.ts +4 -4
  583. package/dist/types-B9zXzag-.js +18 -0
  584. package/dist/types-BA3bcGAv.js +58 -0
  585. package/dist/types-CZAHRt31.js +147 -0
  586. package/dist/types-Cwq1JAWT.js +31 -0
  587. package/dist/upload-C5NC1E4N.js +23 -0
  588. package/dist/uppercase-DvjwUM0n.js +7 -0
  589. package/dist/useAccountHolder-DDto9d9n.js +102 -0
  590. package/dist/useAdaptiveWorkflow-DryNv0zI.js +28 -0
  591. package/dist/useAllowedCountries-C-nqVePW.js +80 -0
  592. package/dist/useAnalyticsContext-gSnRnYgV.js +12 -0
  593. package/dist/useAssociatedLegalEntity-DtZtKlls.js +35 -0
  594. package/dist/useBusinessDetailsData-DFU0dLxw.js +4732 -0
  595. package/dist/useBusinessLines-BZfFqvS_.js +27 -0
  596. package/dist/useCanSeeIntroduction-DQbanJNE.js +38 -0
  597. package/dist/useCreateLegalEntity-qP7MeAmi.js +24 -0
  598. package/dist/useDataMissingRemediations-ttUrk09_.js +39 -0
  599. package/dist/useDataset-CdLBLq98.js +98 -0
  600. package/dist/useDeleteTransferInstrument-Dtv14H9I.js +31 -0
  601. package/dist/useForm-CWrbJG44.js +504 -0
  602. package/dist/useHideTaskStepper-Dk7ZQ3U8.js +26 -0
  603. package/dist/useId-BkDhUta2.js +28 -0
  604. package/dist/useIndustryCodes-BMK6IMiW.js +32 -0
  605. package/dist/useLegalEntity-DHA8TJeV.js +48 -0
  606. package/dist/useMultiForm-BxASst0O.js +790 -0
  607. package/dist/useNavigate-CO1Mcekp.js +246 -0
  608. package/dist/useOnboardingStatus-Cz6-hSX4.js +23 -0
  609. package/dist/usePciQuestionnaireList-CWz7Ngs6.js +26 -0
  610. package/dist/useSalesChannels-bV9DgyLW.js +47 -0
  611. package/dist/useScenarios-Bn93htbx.js +55 -0
  612. package/dist/useSettingsContext-9O3Aqpfq.js +12 -0
  613. package/dist/useTaskLandedEvent-DwZHcMEQ.js +26 -0
  614. package/dist/useTaskStatus-DJxOWvuN.js +23 -0
  615. package/dist/useTermsOfServiceStatus-CyVxYqpg.js +39 -0
  616. package/dist/useToastContext-B6Mqc2HY.js +12 -0
  617. package/dist/useToggleContext-B_YexrbT.js +21 -0
  618. package/dist/useTrustMembers-DWo3WU8M.js +151 -0
  619. package/dist/useUnincorporatedPartnershipMembers-DwFPW09D.js +69 -0
  620. package/dist/useUpdateBusinessLines-JRPjqoe9.js +43 -0
  621. package/dist/useUpdateLegalEntity-CqmqXsbR.js +29 -0
  622. package/dist/utils-BWumuCvl.js +210 -0
  623. package/dist/utils-CJcGZvj1.js +178 -0
  624. package/dist/utils-CYUYe54m.js +24 -0
  625. package/dist/utils-Ck_mZapQ.js +1755 -0
  626. package/dist/utils-DdHbAadK.js +80 -0
  627. package/dist/utils-SKYT7xU4.js +52 -0
  628. package/dist/validate-BZ1-ZeKr.js +430 -0
  629. package/dist/validate-DTz70AWN.js +224 -0
  630. package/dist/validate-DUcT-JGF.js +178 -0
  631. package/dist/validate-Dr8UKZCX.js +126 -0
  632. package/dist/validateExtractionResult-CntKbt8c.js +343 -0
  633. package/dist/validationError-DV6t8Ubb.js +55 -0
  634. package/dist/validationResult-bjYBDjbU.js +29 -0
  635. package/dist/validatorUtils-D2O6AAZn.js +106 -0
  636. package/dist/warning-circle-fill-C2lMYPJW.js +30 -0
  637. package/dist/warning-diamond-filled-CQ2DdW5g.js +30 -0
  638. package/dist/webinar-BpZWqd-g.js +33 -0
  639. package/package.json +26 -26
  640. package/dist/4-people-Dxu4nHSX.js +0 -35
  641. package/dist/AcceptTermsOfServiceWorkflow-CvKbU2WY.js +0 -28
  642. package/dist/Accordion-Sjyj7C_t.js +0 -112
  643. package/dist/AccountSetupRejected-Cq_nlmLn.js +0 -18
  644. package/dist/AdaptiveWorkflow-CM7ZVGXv.js +0 -210
  645. package/dist/AdaptiveWorkflowComponent-tM1hJ1zF.js +0 -165
  646. package/dist/AddressFields-BsxEdBvQ.js +0 -464
  647. package/dist/Avatar-Zp1T9qAL.js +0 -54
  648. package/dist/BusinessFinancingDropin-vugW4Vvi.js +0 -1857
  649. package/dist/BusinessFinancingPage-0J_LImeN.js +0 -89
  650. package/dist/BusinessRegistrationNumberField-qdC_srMn.js +0 -101
  651. package/dist/BusinessRegistrationNumberFieldGroup-BvC9n4ou.js +0 -171
  652. package/dist/BusinessTypeSelectionPage-WCEqP4G2.js +0 -457
  653. package/dist/Button-DfRmINzF.js +0 -108
  654. package/dist/Checkbox-B730k3Yy.js +0 -108
  655. package/dist/ComponentGroup-CsnkYMbT.js +0 -32
  656. package/dist/ConstitutionalDocument-D92EPGmG.js +0 -1224
  657. package/dist/ContactDetails-DDSd6X0z.js +0 -511
  658. package/dist/ContextGuidance-B2ew1lzC.js +0 -29
  659. package/dist/ContractViewer-JtnAXSDa.js +0 -979
  660. package/dist/Currency-BKTf95Wp.js +0 -210
  661. package/dist/CustomerSupport-CCFayyJG.js +0 -140
  662. package/dist/DataConflictsModal-D-fP_eNs.js +0 -237
  663. package/dist/DebugModal-CG6CvUnj.js +0 -450
  664. package/dist/DecisionMakerDetails-DWC1nORL.js +0 -565
  665. package/dist/DecisionMakerDetailsPage-BVXA74FO.js +0 -122
  666. package/dist/DecisionMakers-Cvm_i6Uf.js +0 -589
  667. package/dist/Dropzone-CNHxDEc3.js +0 -250
  668. package/dist/EmbeddedStatus-tbJfdxm8.js +0 -129
  669. package/dist/EndStateLayout-BK1Hh02g.js +0 -83
  670. package/dist/EntityAssociation-i903L9Dh.js +0 -163
  671. package/dist/ErrorPanel-tnFOlOZU.js +0 -205
  672. package/dist/GlobalEntryModal-DQoIIvGS.js +0 -975
  673. package/dist/GlobalEntryPage-DLRGPpAu.js +0 -78
  674. package/dist/Icon-C3S5_kkS.js +0 -175
  675. package/dist/IdentityNumber-B8MXzXsO.js +0 -536
  676. package/dist/IdentityNumberFieldGroup-D7xb2TY7.js +0 -57
  677. package/dist/IdentityScreeningWorkflow-BdGXtdns.js +0 -307
  678. package/dist/Image-D82terx4.js +0 -33
  679. package/dist/IndividualDropin-C0vTSDYU.js +0 -4138
  680. package/dist/IndustryCodeFieldGroup-CGcE5yYR.js +0 -188
  681. package/dist/InputDate-Ci60MBrH.js +0 -211
  682. package/dist/InputText-CTpVF0Mu.js +0 -154
  683. package/dist/Introduction-Dx6DDaL7.js +0 -327
  684. package/dist/InvitedDecisionMakerComponent-Ckd26d6Y.js +0 -481
  685. package/dist/JpAddressFields-C9MbL5XV.js +0 -287
  686. package/dist/LegalCompanyNameField-D0jM5LDT.js +0 -108
  687. package/dist/LegalName-TjhII9_p.js +0 -33
  688. package/dist/LegalRepresentativeDetailsPage-CvGtANu3.js +0 -74
  689. package/dist/Link-c2jAgGgc.js +0 -32
  690. package/dist/ListItem-C35r8558.js +0 -93
  691. package/dist/Loader-BEpMlKm2.js +0 -92
  692. package/dist/Modal-BsivDPTd.js +0 -129
  693. package/dist/Name-DMf8Uyof.js +0 -61
  694. package/dist/NewSummary-DxWLTnJy.js +0 -73
  695. package/dist/PatriotActDisclosure-ChZ_ePr2.js +0 -265
  696. package/dist/PayoutDetailsDropin-BhtJSFAS.js +0 -4073
  697. package/dist/PayoutDetailsPage-MW5Pygp2.js +0 -70
  698. package/dist/RadioGroup-D8DRUJ2o.js +0 -1806
  699. package/dist/Review-DImhCvoG.js +0 -99
  700. package/dist/RootBusinessDetailsPage-Cmh9Z_4g.js +0 -68
  701. package/dist/RootBusinessLinesPage-C_p-CtCH.js +0 -1455
  702. package/dist/RootIndividualDetailsPage-04cJ6C15.js +0 -80
  703. package/dist/Select-ByVcS_J2.js +0 -1093
  704. package/dist/SignPCIComponent-CAwp2xCC.js +0 -370
  705. package/dist/SingpassSelection-Txx3gp_g.js +0 -157
  706. package/dist/SoleProprietorshipPage-CWegllTo.js +0 -70
  707. package/dist/SourceOfFundsPage-B22iW1ow.js +0 -2781
  708. package/dist/SourceOfFundsWorkflow-BKHZbLR_.js +0 -28
  709. package/dist/StateField-CsO_28Co.js +0 -296
  710. package/dist/Step-BUMarnLL.js +0 -191
  711. package/dist/Task-Bj_CjiHG.js +0 -129
  712. package/dist/TaskGroup-BMXhoq1Y.js +0 -46
  713. package/dist/TaskListItem-BIKdDEzU.js +0 -123
  714. package/dist/TaskStepperContextProvider-D0tKJplv.js +0 -26
  715. package/dist/TaskVerificationStatus-DPA4ZEPa.js +0 -125
  716. package/dist/TaxInformationFieldGroup-D_6IRGj9.js +0 -287
  717. package/dist/TaxReportingDropin-DA475crP.js +0 -475
  718. package/dist/TaxReportingWorkflow-kcto0Ysw.js +0 -28
  719. package/dist/TermsOfServiceManagement-HDnaIeWZ.js +0 -635
  720. package/dist/TextArea-qbFhi8Az.js +0 -81
  721. package/dist/TrustDetailsPage-BqVS0xOU.js +0 -1155
  722. package/dist/TrustMemberCompanyPage-DTe7xWpj.js +0 -109
  723. package/dist/TrustMemberIndividualPage-C1BDs9Rm.js +0 -110
  724. package/dist/TrustMemberRoleAndTypePage-GXWuitmt.js +0 -927
  725. package/dist/TrustMembersOverview-BjJ5fPcC.js +0 -449
  726. package/dist/UboTaskItem-Aq3iNKX0.js +0 -115
  727. package/dist/UnincorporatedPartnershipIndividualPage-DdPh2_sa.js +0 -79
  728. package/dist/UnincorporatedPartnershipMemberCompanyPage-h3OTr_91.js +0 -79
  729. package/dist/UnincorporatedPartnershipMemberRoleAndTypePage-CwemN4fL.js +0 -254
  730. package/dist/UnincorporatedPartnershipMembersOverview-CUczPfUl.js +0 -158
  731. package/dist/VerificationErrorAlert-BBfoLMwb.js +0 -64
  732. package/dist/Workflow-Do7P-qDn.js +0 -228
  733. package/dist/accountHolderUtils-DMi_DHCU.js +0 -44
  734. package/dist/arrow-right-Bk-ewsex.js +0 -20
  735. package/dist/bafinUtils-M2AASP_e.js +0 -1963
  736. package/dist/bag-9BNq_QQO.js +0 -20
  737. package/dist/bank-BRbxxVK5.js +0 -20
  738. package/dist/bg-BG-BtgA44Ui.js +0 -7
  739. package/dist/bg-BG-DX5QKxJz.js +0 -7
  740. package/dist/bg-BG-DYkxVgeJ.js +0 -7
  741. package/dist/bg-BG-K6LIkCdf.js +0 -7
  742. package/dist/bg-BG-uuNDTOoN.js +0 -7
  743. package/dist/bin-DE1613_5.js +0 -30
  744. package/dist/businessRegistrationNumberPatterns-C_MSKHlF.js +0 -981
  745. package/dist/capital-aNk7ragc.js +0 -23
  746. package/dist/cash-stack-DuKKc4Qj.js +0 -33
  747. package/dist/certificate-9gDKvXCm.js +0 -23
  748. package/dist/checkmark-BuqDN4WO.js +0 -20
  749. package/dist/checkmark-circle-OqcwA6N6.js +0 -28
  750. package/dist/checkmark-circle-fill-BfcUovCf.js +0 -30
  751. package/dist/checkmark-small-CBORXg_J.js +0 -20
  752. package/dist/chevron-down-CjRta08O.js +0 -20
  753. package/dist/chevron-left-BEm04mIh.js +0 -20
  754. package/dist/chevron-right-B2GkHG0J.js +0 -20
  755. package/dist/chevron-up-BKfe5Btb.js +0 -20
  756. package/dist/circle-C-uuRI8F.js +0 -30
  757. package/dist/circle-small-filled-Bkh5_ZEu.js +0 -20
  758. package/dist/clock-BWfWiMxz.js +0 -28
  759. package/dist/coins-Cw-jDTUz.js +0 -30
  760. package/dist/constants-BSBlqXY7.js +0 -231
  761. package/dist/contract-PFVBW8xa.js +0 -20
  762. package/dist/countries-BE4iGVAo.js +0 -41
  763. package/dist/country-zZC2TAQB.js +0 -25
  764. package/dist/cross-B37j1-r4.js +0 -20
  765. package/dist/cross-circle-fill-CcjwpLj2.js +0 -30
  766. package/dist/cross-circle-fill-small-CJ4fddNo.js +0 -20
  767. package/dist/cs-CZ-BJSrh3Vp.js +0 -7
  768. package/dist/cs-CZ-CMXGY6Ep.js +0 -7
  769. package/dist/cs-CZ-Ci8c58xJ.js +0 -7
  770. package/dist/cs-CZ-Cu1v5FA8.js +0 -7
  771. package/dist/cs-CZ-lJQmuyHq.js +0 -7
  772. package/dist/da-DK-B9O3xbY6.js +0 -7
  773. package/dist/da-DK-BNwXg4DX.js +0 -7
  774. package/dist/da-DK-C1kmOHvo.js +0 -7
  775. package/dist/da-DK-D53M_d04.js +0 -7
  776. package/dist/da-DK-DjAV5d9A.js +0 -7
  777. package/dist/de-DE-B3sSNcDv.js +0 -7
  778. package/dist/de-DE-C9N6F5oM.js +0 -7
  779. package/dist/de-DE-CjMOQMqQ.js +0 -7
  780. package/dist/de-DE-qJPTCQlG.js +0 -7
  781. package/dist/de-DE-qSBQE-6M.js +0 -7
  782. package/dist/de-DE-w4l6boYT.js +0 -7
  783. package/dist/decision-makers-group-DAoxQRJ3.js +0 -4169
  784. package/dist/decisionMakerRoles-APTR-Ah_.js +0 -185
  785. package/dist/document-1-B3vw8uuK.js +0 -20
  786. package/dist/document-person-CERdIfH0.js +0 -28
  787. package/dist/download-CthdK4dV.js +0 -23
  788. package/dist/edit-1-BW7NwWP7.js +0 -20
  789. package/dist/el-GR-BLNCX9mm.js +0 -7
  790. package/dist/el-GR-Bx996PXx.js +0 -7
  791. package/dist/el-GR-CgoxpC-Q.js +0 -7
  792. package/dist/el-GR-DaAMIpOR.js +0 -7
  793. package/dist/el-GR-DqTetsjB.js +0 -7
  794. package/dist/el-GR-pGsVWsOm.js +0 -7
  795. package/dist/en-US-B82BbZaB.js +0 -7
  796. package/dist/en-US-BUmtG-Wj.js +0 -27
  797. package/dist/en-US-C3i5Oge2.js +0 -7
  798. package/dist/en-US-C8karqc5.js +0 -7
  799. package/dist/en-US-CJPD8qHc.js +0 -7
  800. package/dist/en-US-D0fscfsz.js +0 -7
  801. package/dist/en-US-DapC--Cs.js +0 -7
  802. package/dist/entityAssociationUtil-CLBR9osP.js +0 -59
  803. package/dist/error-CpJV-CLa.js +0 -36
  804. package/dist/es-ES-C14ZT-97.js +0 -7
  805. package/dist/es-ES-DeT4zIDW.js +0 -7
  806. package/dist/es-ES-DyB2KXfT.js +0 -7
  807. package/dist/es-ES-U4-lDfZq.js +0 -7
  808. package/dist/es-ES-tVQDUTJN.js +0 -7
  809. package/dist/es-ES-wvcyuTNN.js +0 -7
  810. package/dist/es-LA-B5IRDCf_.js +0 -7
  811. package/dist/es-LA-B_hzWiiE.js +0 -7
  812. package/dist/es-LA-CG_cu1hM.js +0 -7
  813. package/dist/es-LA-ChLRkx-r.js +0 -7
  814. package/dist/es-LA-mFT_9PL_.js +0 -7
  815. package/dist/et-EE-4_ZUNt3W.js +0 -7
  816. package/dist/et-EE-BCWBT8XN.js +0 -7
  817. package/dist/et-EE-BQEyJFZb.js +0 -7
  818. package/dist/et-EE-DSK7kb3n.js +0 -7
  819. package/dist/et-EE-DWVzz1wR.js +0 -7
  820. package/dist/external-link-CFgynH5A.js +0 -20
  821. package/dist/fi-FI-B-7uBAf5.js +0 -7
  822. package/dist/fi-FI-BeJtSWIh.js +0 -7
  823. package/dist/fi-FI-Caa9ydMd.js +0 -7
  824. package/dist/fi-FI-D06EzKrW.js +0 -7
  825. package/dist/fi-FI-DgMsQBRO.js +0 -7
  826. package/dist/form-rules-zzbZ2bV6.js +0 -1089
  827. package/dist/formatCurrency-Cq3WFpdZ.js +0 -23
  828. package/dist/formatValidationError-BHvKLMYZ.js +0 -23
  829. package/dist/fr-FR-8a-RK9xd.js +0 -7
  830. package/dist/fr-FR-BCfqr4jm.js +0 -7
  831. package/dist/fr-FR-BTJoQq71.js +0 -7
  832. package/dist/fr-FR-CDv300-8.js +0 -7
  833. package/dist/fr-FR-D7DTFYe4.js +0 -7
  834. package/dist/fr-FR-Dl4NL-Nc.js +0 -7
  835. package/dist/genUtils-Ce61IJs8.js +0 -60
  836. package/dist/getDefaultRegistrationNumberType-CI1NVzJR.js +0 -1055
  837. package/dist/getFormSlice-DzRO0UUx.js +0 -52
  838. package/dist/getLegalEntityCountry-CNE5uei8.js +0 -17
  839. package/dist/getName-s7qmFean.js +0 -35
  840. package/dist/getProblemsForEntity-Bh9nSdOW.js +0 -16
  841. package/dist/getTrustedDecisionMakers-DX3nImM5.js +0 -25
  842. package/dist/gift-0jLCte2h.js +0 -20
  843. package/dist/graph-DrxuzQF7.js +0 -32
  844. package/dist/graph-up-4qLbS2Ds.js +0 -38
  845. package/dist/headquarter-3o2GHW5H.js +0 -42
  846. package/dist/hotel-pZlrEAK8.js +0 -33
  847. package/dist/hr-HR-B11sggmG.js +0 -7
  848. package/dist/hr-HR-BjxPRJ1o.js +0 -7
  849. package/dist/hr-HR-COdiWKoq.js +0 -7
  850. package/dist/hr-HR-CXH5M5JZ.js +0 -7
  851. package/dist/hr-HR-me1zsMas.js +0 -7
  852. package/dist/http-DsJtugN1.js +0 -204
  853. package/dist/hu-HU-BNlsrO-l.js +0 -7
  854. package/dist/hu-HU-BQ5310Yi.js +0 -7
  855. package/dist/hu-HU-D1ZZwcl0.js +0 -7
  856. package/dist/hu-HU-DkSsL94T.js +0 -7
  857. package/dist/hu-HU-Dp6xOBN_.js +0 -7
  858. package/dist/image-tfgNnE3G.js +0 -23
  859. package/dist/info-DJW5JooY.js +0 -32
  860. package/dist/info-filled-C5mP6T4Z.js +0 -32
  861. package/dist/it-IT-BORQC-7u.js +0 -7
  862. package/dist/it-IT-BlaVymCj.js +0 -7
  863. package/dist/it-IT-CawjvBDX.js +0 -7
  864. package/dist/it-IT-Cnk7j_gC.js +0 -7
  865. package/dist/it-IT-DIIRAF4_.js +0 -7
  866. package/dist/it-IT-x4LV31GV.js +0 -7
  867. package/dist/ja-JP-CyXnoIu3.js +0 -7
  868. package/dist/ja-JP-DBne3dbI.js +0 -7
  869. package/dist/ja-JP-DS8zN3mY.js +0 -7
  870. package/dist/ja-JP-Dpe9Odla.js +0 -7
  871. package/dist/ja-JP-DrHQO_Se.js +0 -7
  872. package/dist/ja-JP-h3E8hgLv.js +0 -7
  873. package/dist/legal-entity-type-0MfCGzUf.js +0 -13
  874. package/dist/legalArrangementUtils-xvCxpgzJ.js +0 -113
  875. package/dist/location-Dk0rAiaT.js +0 -23
  876. package/dist/lt-LT-8kOI6QVq.js +0 -7
  877. package/dist/lt-LT-B18sQY9g.js +0 -7
  878. package/dist/lt-LT-Byl8QeWO.js +0 -7
  879. package/dist/lt-LT-D3ZUJfjr.js +0 -7
  880. package/dist/lt-LT-Fc1lOUlz.js +0 -7
  881. package/dist/lv-LV-C70c94CI.js +0 -7
  882. package/dist/lv-LV-CXifQKfG.js +0 -7
  883. package/dist/lv-LV-DctYQmfH.js +0 -7
  884. package/dist/lv-LV-Mj_iV56f.js +0 -7
  885. package/dist/lv-LV-adiXoKhv.js +0 -7
  886. package/dist/mail-DG7MBDNE.js +0 -20
  887. package/dist/mapAddressLocalizationToJpAddressSchema-TUaHGQh6.js +0 -26
  888. package/dist/mapExistingFile-CwGW1ru4.js +0 -55
  889. package/dist/mapJpAddressSchemaToAddressLocalizations-CdP6PRAO.js +0 -73
  890. package/dist/mapLegalEntityToIndividualSchema-ByhXwZqs.js +0 -214
  891. package/dist/mapTransferInstrumentToPayoutAccount-6eLKhumO.js +0 -44
  892. package/dist/minus-circle-filled-DglqAgJW.js +0 -30
  893. package/dist/nl-NL-BIpptPn4.js +0 -7
  894. package/dist/nl-NL-BWGCqpWp.js +0 -7
  895. package/dist/nl-NL-Bv8Zk-6e.js +0 -7
  896. package/dist/nl-NL-DOB0b0m4.js +0 -7
  897. package/dist/nl-NL-ehxkZFQd.js +0 -7
  898. package/dist/nl-NL-jt4eYGEY.js +0 -7
  899. package/dist/no-NO-BG1sYkpp.js +0 -7
  900. package/dist/no-NO-CeZQnyyD.js +0 -7
  901. package/dist/no-NO-Chwg5Roi.js +0 -7
  902. package/dist/no-NO-Dx_Z3uoZ.js +0 -7
  903. package/dist/no-NO-P5tRWhV9.js +0 -7
  904. package/dist/options-horizontal-CTUn7IEx.js +0 -30
  905. package/dist/partner-1StoI4_W.js +0 -30
  906. package/dist/pay-by-link-plane-Sa_qkL8C.js +0 -33
  907. package/dist/payout-BAYSxSqU.js +0 -38
  908. package/dist/pdf-uNYg4Mqz.js +0 -22315
  909. package/dist/pdf.worker.min-gK7UJW5a.js +0 -74644
  910. package/dist/person-Da15_s3G.js +0 -23
  911. package/dist/pl-PL-BsXtscoI.js +0 -7
  912. package/dist/pl-PL-CWFdZf24.js +0 -7
  913. package/dist/pl-PL-DSbuyzBx.js +0 -7
  914. package/dist/pl-PL-J9S3_lCf.js +0 -7
  915. package/dist/pl-PL-_KG-ZD1N.js +0 -7
  916. package/dist/plus-BQccvKkd.js +0 -20
  917. package/dist/plus-circle-filled-CqC30FRL.js +0 -30
  918. package/dist/processCapabilities-DRD0Aq2i.js +0 -874
  919. package/dist/processValidationErrors-oxuCOsth.js +0 -62
  920. package/dist/pt-BR-B2q9Nl16.js +0 -7
  921. package/dist/pt-BR-BYbyk6xS.js +0 -7
  922. package/dist/pt-BR-Cph-P8oH.js +0 -7
  923. package/dist/pt-BR-D1yTuXWd2.js +0 -7
  924. package/dist/pt-BR-fKlNUybd.js +0 -7
  925. package/dist/pt-PT-C1gtp2_N.js +0 -7
  926. package/dist/pt-PT-CQQkh5PS.js +0 -7
  927. package/dist/pt-PT-D8ldyR-j.js +0 -7
  928. package/dist/pt-PT-DAvsI-Tr.js +0 -7
  929. package/dist/pt-PT-DhokEMPi.js +0 -7
  930. package/dist/pt-PT-IPhkbQvT.js +0 -7
  931. package/dist/recurring-DSR1fNMh.js +0 -23
  932. package/dist/resolveEnvironment-BYEL10Nc.js +0 -2524
  933. package/dist/revenue-accelerate-CPhAVpPK.js +0 -30
  934. package/dist/ro-RO-C6xoaASq.js +0 -7
  935. package/dist/ro-RO-CP_IrOlX.js +0 -7
  936. package/dist/ro-RO-CQJk7Cpo.js +0 -7
  937. package/dist/ro-RO-CnMe6Mfw.js +0 -7
  938. package/dist/ro-RO-_BLhsnIB.js +0 -7
  939. package/dist/save-DQ-mJX8e.js +0 -20
  940. package/dist/search-DWqWTW_K.js +0 -30
  941. package/dist/show-BbhlD3IY.js +0 -23
  942. package/dist/sk-SK-BOc9IqyW.js +0 -7
  943. package/dist/sk-SK-Bb1CdAzD.js +0 -7
  944. package/dist/sk-SK-Br1Y4_CN.js +0 -7
  945. package/dist/sk-SK-Bx2_85dW.js +0 -7
  946. package/dist/sk-SK-C889qQFo.js +0 -7
  947. package/dist/sl-SI-B-Xa0hlk.js +0 -7
  948. package/dist/sl-SI-BQc61Sz2.js +0 -7
  949. package/dist/sl-SI-DHPadSTy.js +0 -7
  950. package/dist/sl-SI-DO9c7geI.js +0 -7
  951. package/dist/sl-SI-bkhhInrg.js +0 -7
  952. package/dist/solution-payments-D4BORMsX.js +0 -20
  953. package/dist/store-DWaq3ZiC.js +0 -20
  954. package/dist/sv-SE-BXrlr0X5.js +0 -7
  955. package/dist/sv-SE-Dk81lopg.js +0 -7
  956. package/dist/sv-SE-DzsWB30f.js +0 -7
  957. package/dist/sv-SE-IBYnJfbW.js +0 -7
  958. package/dist/sv-SE-X89Q6ZAq.js +0 -7
  959. package/dist/sv-SE-l_UVgmVu.js +0 -7
  960. package/dist/terminal-1-crR-pS_R.js +0 -30
  961. package/dist/translation-BOm4lmPx.js +0 -657
  962. package/dist/types/components/GlobalEntry/globalEntryKeyMapping.d.ts +0 -15
  963. package/dist/types/components/GlobalEntry/utils.d.ts +0 -30
  964. package/dist/types/components/Shared/fields/TaxInformationField/TaxIdNumberTypeSelector/getDefaultTaxIdNumberType.d.ts +0 -30
  965. package/dist/types/components/Shared/fields/TaxInformationField/TaxIdNumberTypeSelector/inferTaxIdNumberType.d.ts +0 -13
  966. package/dist/types/core/models/api/attachment.d.ts +0 -7
  967. package/dist/types/core/models/api/document.d.ts +0 -25
  968. package/dist/types/core/models/api/entity-type.d.ts +0 -5
  969. package/dist/types/core/models/api/legal-arrangement.d.ts +0 -24
  970. package/dist/types/core/models/api/legal-entity-type.d.ts +0 -8
  971. package/dist/types/core/models/api/legal-entity.d.ts +0 -36
  972. package/dist/types/core/models/api/problem.d.ts +0 -12
  973. package/dist/types/core/models/api/remediating-action.d.ts +0 -5
  974. package/dist/types/core/models/api/transfer-instrument.d.ts +0 -33
  975. package/dist/types/core/models/api/trusted-fields-provider.d.ts +0 -5
  976. package/dist/types/core/models/api/verification-error.d.ts +0 -19
  977. package/dist/types-BeveNAZK.js +0 -19
  978. package/dist/types-wRlt8bxb.js +0 -58
  979. package/dist/upload-D85xAAAm.js +0 -23
  980. package/dist/useAdaptiveWorkflow-DsQESk9f.js +0 -28
  981. package/dist/useBusinessDetailsData-Bja80UYy.js +0 -4722
  982. package/dist/useBusinessLines-BhSN6qCH.js +0 -27
  983. package/dist/useCanSeeIntroduction-BcfQC4IP.js +0 -38
  984. package/dist/useDataMissingRemediations-msU1AJvo.js +0 -39
  985. package/dist/useForm-DbDFfb2S.js +0 -502
  986. package/dist/useHideTaskStepper-CbMcV9mk.js +0 -26
  987. package/dist/useId-oOIS1nsj.js +0 -73
  988. package/dist/useIndustryCodes-uAj90IyS.js +0 -32
  989. package/dist/useLegalEntity-QQXN6YOm.js +0 -48
  990. package/dist/useNavigate-CiKOI5QV.js +0 -246
  991. package/dist/useOnboardingStatus-CsGUjkm-.js +0 -23
  992. package/dist/usePciQuestionnaireList-CFNJD8pS.js +0 -26
  993. package/dist/useSalesChannels-BvGJ9PT6.js +0 -47
  994. package/dist/useScenarios-CGcmXgJv.js +0 -55
  995. package/dist/useTaskLandedEvent-pmN03gtI.js +0 -26
  996. package/dist/useTaskStatus-CgrhdaE_.js +0 -23
  997. package/dist/useTermsOfServiceStatus-DbJDklA2.js +0 -39
  998. package/dist/useTrustMembers-f13Kf1Zk.js +0 -152
  999. package/dist/useUnincorporatedPartnershipMembers-K5jkCKfJ.js +0 -70
  1000. package/dist/useUpdateBusinessLines-DCKYTzxd.js +0 -43
  1001. package/dist/utils-2tir5QtF.js +0 -52
  1002. package/dist/utils-BUOt0VrX.js +0 -179
  1003. package/dist/utils-DBIDcVUN.js +0 -214
  1004. package/dist/validate-BpZBKknS.js +0 -224
  1005. package/dist/validate-CPTQceEQ.js +0 -151
  1006. package/dist/validate-YBDlgvjy.js +0 -429
  1007. package/dist/validate-u6nDNwf1.js +0 -126
  1008. package/dist/validateExtractionResult-dH4TewHf.js +0 -343
  1009. package/dist/validationError-B-B3GC86.js +0 -55
  1010. package/dist/warning-circle-fill-BDTmKU1s.js +0 -30
  1011. package/dist/warning-diamond-filled-BjDL-xa8.js +0 -30
  1012. package/dist/webinar-YMbPoCx3.js +0 -33
@@ -1,4722 +0,0 @@
1
- try {
2
- let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
3
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "9a238734-8c3f-455a-8c68-c3f026359fd0", e._sentryDebugIdIdentifier = "sentry-dbid-9a238734-8c3f-455a-8c68-c3f026359fd0");
4
- } catch (e) {}
5
- import { r as useTranslation } from "./translation-BOm4lmPx.js";
6
- import { E as useAllowedCountries, T as datasetUtilities, at as isUndefinedOrNull, ft as useSettingsContext, j as useToggleContext, k as Header, nt as isEmpty, pt as useAccountHolder, rt as isISIN, x as Alert } from "./resolveEnvironment-BYEL10Nc.js";
7
- import { t as createLogger } from "./logger-Z8AeTE4x.js";
8
- import { t as Typography } from "./Typography-CAc_f5Iq.js";
9
- import { t as Loader } from "./Loader-BEpMlKm2.js";
10
- import { t as Button } from "./Button-DfRmINzF.js";
11
- import { r as httpPost, s as useApiContext } from "./http-DsJtugN1.js";
12
- import { r as useLegalEntity, t as ROOT_LE } from "./useLegalEntity-QQXN6YOm.js";
13
- import { t as LegalEntityTypes } from "./legal-entity-type-0MfCGzUf.js";
14
- import { a as objectsDeepEqual, n as doArraysMatch, o as entriesOf, s as keysOf } from "./genUtils-Ce61IJs8.js";
15
- import { t as StackLayout } from "./StackLayout-IUdNMDgW.js";
16
- import { t as TaskVerificationStatus } from "./TaskVerificationStatus-DPA4ZEPa.js";
17
- import { n as TASK_STATUS_POLLING_INTERVAL_MS } from "./taskStatus-BtekPA8E.js";
18
- import { t as CountryCodes } from "./country-code-CJk2hdPu.js";
19
- import { _ as businessDetailsKeyMapping, f as solePropBusinessDetailsApiKeyMapping, g as businessDetailsDocumentMapping, h as businessDetailsApiKeyMapping, m as solePropBusinessDetailsKeyMapping, p as solePropBusinessDetailsDocumentMapping } from "./processCapabilities-DRD0Aq2i.js";
20
- import { t as TaskTypes } from "./taskTypes-3vSkMBDm.js";
21
- import { r as filterOutUnwantedAssociationsIfRootLE, s as getOwnEntityAssociations } from "./entityAssociationUtil-CLBR9osP.js";
22
- import { t as Scenarios } from "./get-scenarios-Bb-paHmJ.js";
23
- import { i as useAnalyticsContext, n as ModalContent, t as Modal } from "./Modal-BsivDPTd.js";
24
- import { t as HandlerContext } from "./HandlerContext-DeMa68z0.js";
25
- import { a as SettingNames, t as InputText } from "./InputText-CTpVF0Mu.js";
26
- import { _ as getPropsFromConfigurations, c as numericInputs, g as composePerScenarioFormConfigurations, i as alphanumericInputs, m as resolveFieldMetadata, n as uppercase, o as makeMask, r as alphaInputs, t as createFormRules, u as MaskedInput, v as LandingLayout } from "./form-rules-zzbZ2bV6.js";
27
- import { t as ListItem } from "./ListItem-C35r8558.js";
28
- import { t as getFormSlice } from "./getFormSlice-DzRO0UUx.js";
29
- import { t as useBusinessLines } from "./useBusinessLines-BhSN6qCH.js";
30
- import { t as Card } from "./Card-BCGLpdw7.js";
31
- import { n as useInvalidateRootLegalEntity, r as useToastContext } from "./useId-oOIS1nsj.js";
32
- import { p as LoaderWrapper, r as Field } from "./Select-ByVcS_J2.js";
33
- import { o as StructuredList, r as formatObject, s as Confirm } from "./utils-DBIDcVUN.js";
34
- import { c as mapAddressLabelsNewSummary, d as COUNTRIES_WITH_STATES_DATASET, i as getAddressSchemaForCountry, m as useCreateLegalEntity, n as StateField, o as getKeyForField, p as useUpdateLegalEntity, r as stateFieldMetadata, t as STATE_FIELD } from "./StateField-CsO_28Co.js";
35
- import { A as mergeFieldMetadataIntoProps, M as FormContextProvider, T as Summary_module_default, c as validatePatternOnBlur, d as useFormContext, f as addValidityToForms, g as useMultiForm, k as createFormUtils, l as COUNTRY_FIELD, m as FormFlow, s as validateNotEmptyOnBlur, t as RadioGroup, u as CountryField, x as summaryStep, y as useFormComposer } from "./RadioGroup-D8DRUJ2o.js";
36
- import { t as Image } from "./Image-D82terx4.js";
37
- import { t as ErrorPanel } from "./ErrorPanel-tnFOlOZU.js";
38
- import { r as useDebouncedCallback, t as Checkbox } from "./Checkbox-B730k3Yy.js";
39
- import { a as defaultFieldMetadata, i as defaultFieldConfigV4, o as defaultFieldMetadataV4, r as defaultFieldConfig, t as LEGAL_COMPANY_NAME_FIELD } from "./LegalCompanyNameField-D0jM5LDT.js";
40
- import { a as isRegistrationNumberAbsentStateV4Scenario, c as CountryOfGoverningLawField, i as isRegistrationExemptionAllowed, l as useLegalCompanyNameField, n as getCountryOfGoverningLaw, o as COUNTRY_OF_GOVERNING_LAW_POSSIBLE, r as isFinancialInformationRequired, s as COUNTRY_OF_GOVERNING_LAW_FIELD, t as CountryOfGoverningLawFieldValidation, u as localizedLegalCompanyNameFieldConfig } from "./validate-CPTQceEQ.js";
41
- import { A as TAX_ID_REQUIRED_COUNTRIES_ORGANIZATION, B as taxInformationDefaultFieldConfig, C as COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER, D as COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_SOLE_PROPS, E as COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_COMPANIES, M as mapJapaneseLegalNamesToLocalization, N as mapLocalizationToJapaneseLegalNames, O as COUNTRIES_WITH_POSSIBLE_TRUSTEE_TAXID_ABSENT_V4, P as isEmpty$1, S as COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT, T as COUNTRIES_WITH_POSSIBLE_REGISTRATION_EXEMPTIONS_FOR_SOLE_PROPS, U as isJapanLocalizationEnabled, V as taxInformationDefaultFieldMetadata, _ as taxIdNumberOptions, b as COUNTRIES_THAT_DONT_REQUIRE_SOLE_PROP_REGISTRATION, c as TileGroup, g as getValidCompanyTypesForTaxIdNumberType, h as getTaxIdNumberOptions, j as isUsingCompanySearch, k as REGISTRATION_NUMBER_EXEMPTION_RULES, l as TAX_INFORMATION_FIELD, u as TaxInformationField, w as COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER_SOLE_PROPS, x as COUNTRIES_THAT_DO_NOT_USE_TAX_ID_FOR_SOLE_PROP, y as COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION, z as getTaxInformationPlaceholderText } from "./bafinUtils-M2AASP_e.js";
42
- import { a as getValidCompanyTypesForRegistrationNumberType, i as getCompanyRegistrationNumberOptions, l as registrationNumberDefaultFieldConfig, n as inferCompanyRegistrationNumberType, s as exemptFromRegistrationNumberDefaultFieldMetadata, t as getDefaultRegistrationNumberType, u as registrationNumberDefaultFieldMetadata } from "./getDefaultRegistrationNumberType-CI1NVzJR.js";
43
- import { n as BusinessRegistrationNumberField, t as BUSINESS_REGISTRATION_NUMBER_FIELD } from "./BusinessRegistrationNumberField-qdC_srMn.js";
44
- import { n as LEGAL_ARRANGEMENT_COUNTRIES_REQUIRING_DATE_OF_INCORPORATION } from "./legalArrangementUtils-xvCxpgzJ.js";
45
- import { t as useScenarios } from "./useScenarios-CGcmXgJv.js";
46
- import { o as nestAddressSchema, r as flattenAddressSchema } from "./AddressFields-BsxEdBvQ.js";
47
- import { i as useScenarioConfiguration, r as getPageName, t as mapExistingFile } from "./mapExistingFile-CwGW1ru4.js";
48
- import { t as useTaskLandedEvent } from "./useTaskLandedEvent-pmN03gtI.js";
49
- import { i as JP_ADDRESS_REQUIRED_FIELDS, r as mapJpAddressSummaryNewSummary, t as mapJpAddressSchemaToAddressLocalizations } from "./mapJpAddressSchemaToAddressLocalizations-CdP6PRAO.js";
50
- import { n as isMaintenanceModeError, t as processValidationErrors } from "./processValidationErrors-oxuCOsth.js";
51
- import { a as createDocumentRequest, c as getDocuments, f as mergeProofOfOwnershipAttachments, l as getFileExtention, o as documentApiUtils, s as getDocument } from "./validate-YBDlgvjy.js";
52
- import { i as getFieldsWithExistingData, n as MemoizedDocumentUpload, t as PatriotActDisclosure } from "./PatriotActDisclosure-ChZ_ePr2.js";
53
- import { a as isValidationError, r as isBusinessSelectionLegalArrangementError } from "./validationError-B-B3GC86.js";
54
- import { i as formatAddressForCleanse, n as formatDateObj, o as useAddressCleanseImperatively, t as InputDate } from "./InputDate-Ci60MBrH.js";
55
- import { t as addressValidators } from "./validate-BpZBKknS.js";
56
- import { t as capitalize } from "./getProps-DVqK7eRw.js";
57
- import { t as Link } from "./Link-c2jAgGgc.js";
58
- import { t as formatValidationError } from "./formatValidationError-BHvKLMYZ.js";
59
- import { t as DataConflictsModal } from "./DataConflictsModal-D-fP_eNs.js";
60
- import { t as mapAddressLocalizationToJpAddressSchema } from "./mapAddressLocalizationToJpAddressSchema-TUaHGQh6.js";
61
- import { t as currencyByCountry } from "./types-wRlt8bxb.js";
62
- import { t as Divider } from "./Divider-BENvVRnz.js";
63
- import { n as SummarySection, t as NewSummary } from "./NewSummary-DxWLTnJy.js";
64
- import { t as DetailViewLayout } from "./DetailViewLayout-DNCGEd7b.js";
65
- import { a as LegalFormField, c as isDateOlderThanAYear, i as InputCurrency, l as mapAddressData, n as Currency, o as mapFinancialReportsToFinancialInformation, r as InputNumber, s as mapFinancialInformationToFinancialReport, t as CURRENCY_FIELD } from "./Currency-BKTf95Wp.js";
66
- import { t as useTaskStatus } from "./useTaskStatus-CgrhdaE_.js";
67
- import { t as useIndustryCodes } from "./useIndustryCodes-uAj90IyS.js";
68
- import { n as formatCurrency } from "./formatCurrency-Cq3WFpdZ.js";
69
- import { n as useCreateBusinessLine, t as useUpdateBusinessLine } from "./useUpdateBusinessLines-DCKYTzxd.js";
70
- import { _ as dateOfIncorporationFieldMetadata, a as defaultFieldConfig$1, c as REGISTRATION_AND_OPERATIONAL_ADDRESS_FIELDS, d as doingBusinessAsFieldMetadata, f as DBANameField, h as DateOfIncorporationField, i as getDefaultVatNumberType, l as RegistrationAndOperationalAddressFields, m as DATE_OF_INCORPORATION_FIELD, n as VAT_NUMBER_FIELD, o as defaultFieldMetadata$1, p as DBA_NAME_FIELD, r as VatNumberField, s as vatAbsenceReasonMetadata, t as MemoizedConstitutionalDocument, u as doingBusinessAsAbsentFieldMetadata } from "./ConstitutionalDocument-D92EPGmG.js";
71
- import { f as industryCodeFieldMetadata, l as IndustryCodeField, t as INDUSTRY_CODE_FIELD } from "./constants-BSBlqXY7.js";
72
- import { s as organizationTypesToSkipCompanyStructureForm } from "./utils-BUOt0VrX.js";
73
- import { lazy } from "preact/compat";
74
- import { useCallback as useCallback$1, useContext as useContext$1, useEffect as useEffect$1, useMemo as useMemo$1, useRef as useRef$1, useState as useState$1 } from "preact/hooks";
75
- import cx from "classnames";
76
- import { Fragment as Fragment$1, jsx, jsxs } from "preact/jsx-runtime";
77
- import { createModel, signal, useModel, useSignal } from "@preact/signals";
78
- import { queryOptions, skipToken, useMutation, useQuery, useQueryClient } from "@tanstack/preact-query";
79
- import { createContext as createContext$1 } from "preact";
80
- import { Show } from "@preact/signals/utils";
81
- //#region src/components/Shared/fields/EInvoicingCodeField/EInvoicingCodeField.tsx
82
- var EINVOICING_CODE_FIELD = ["eInvoicingCode"];
83
- function EInvoicingCodeField({ data, valid, errors, labels, readonly, mask, shouldValidate, handleChangeFor }) {
84
- const { t } = useTranslation("common");
85
- const [noInvoicingCode, setNoInvoicingCode] = useState$1(false);
86
- const handleNoInvoicingCode = () => {
87
- setNoInvoicingCode(!noInvoicingCode);
88
- handleChangeFor("eInvoicingCode")("0000000");
89
- };
90
- return /* @__PURE__ */ jsxs("div", {
91
- className: "adyen-kyc-field",
92
- children: [/* @__PURE__ */ jsx(MaskedInput, {
93
- name: "eInvoicingCode",
94
- type: "text",
95
- label: labels.eInvoicingCode ?? "",
96
- formatGuidance: t(($) => $["the7CharacterIdentifierAssignedToThis"], { example: "MP10YNU" }),
97
- errorMessage: errors.eInvoicingCode,
98
- isValid: valid.eInvoicingCode ?? false,
99
- value: data.eInvoicingCode ?? "",
100
- readonly: readonly || noInvoicingCode,
101
- shouldValidate,
102
- onInput: handleChangeFor("eInvoicingCode", "input"),
103
- onBlur: handleChangeFor("eInvoicingCode", "blur"),
104
- disabled: noInvoicingCode,
105
- "aria-required": true,
106
- "aria-invalid": !valid.eInvoicingCode,
107
- ...mask
108
- }), /* @__PURE__ */ jsx(Field, {
109
- name: "noEInvoicingCode",
110
- children: (childProps) => /* @__PURE__ */ jsx(Checkbox, {
111
- ...childProps,
112
- name: "noEInvoicingCode",
113
- "aria-required": false,
114
- "aria-invalid": false,
115
- label: t(($) => $["thisCompanyDoesntHaveAnSDI"]),
116
- checked: noInvoicingCode,
117
- onChange: handleNoInvoicingCode
118
- })
119
- })]
120
- });
121
- }
122
- //#endregion
123
- //#region src/components/Shared/fields/EInvoicingCodeField/fieldConfig.ts
124
- var eInvoicingCodeFieldMetadata = {
125
- validators: validatePatternOnBlur(/^[A-Z0-9]{7}$/),
126
- mask: {
127
- mask: makeMask(...alphanumericInputs(16)),
128
- transformOnType: uppercase
129
- }
130
- };
131
- var legalEntityIdentifierFieldMetadata = {
132
- validators: [{
133
- modes: ["blur"],
134
- validate: (val) => {
135
- const isValidLength = val ? val.length === 20 : false;
136
- const hasLettersAndNumbers = val ? /[a-zA-Z]/.test(val) && /[0-9]/.test(val) : false;
137
- return isValidLength && hasLettersAndNumbers;
138
- },
139
- errorMessage: {
140
- key: "enterNCharactersWithAMixForExample",
141
- values: {
142
- numChars: "20",
143
- example: "529900T8BM49AURSDO55"
144
- }
145
- }
146
- }],
147
- mask: {
148
- mask: makeMask(...alphanumericInputs(20)),
149
- transformOnType: uppercase
150
- }
151
- };
152
- //#endregion
153
- //#region src/components/Shared/fields/LegalEntityIdentifierField/LegalEntityIdentifierField.tsx
154
- var LEGAL_ENTITY_IDENTIFIER_FIELD = ["legalEntityIdentifier", "exemptedFromLegalEntityIdentifier"];
155
- function LegalEntityIdentifierField({ data, valid, errors, handleChangeFor, shouldValidate, canExempt = true }) {
156
- const { t } = useTranslation("common");
157
- const isExempted = Boolean(data.exemptedFromLegalEntityIdentifier);
158
- const handleExemptedChange = (isChecked) => {
159
- handleChangeFor("exemptedFromLegalEntityIdentifier", "blur")(isChecked);
160
- if (isChecked) handleChangeFor("legalEntityIdentifier", "input")("");
161
- };
162
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(MaskedInput, {
163
- type: "text",
164
- name: "legalEntityIdentifier",
165
- label: t(($) => $["legalEntityIdentifier"]),
166
- onInput: handleChangeFor("legalEntityIdentifier", "input"),
167
- onBlur: handleChangeFor("legalEntityIdentifier", "blur"),
168
- value: data.legalEntityIdentifier ?? "",
169
- isValid: Boolean(valid?.legalEntityIdentifier),
170
- errorMessage: errors.legalEntityIdentifier,
171
- disabled: isExempted,
172
- helper: /* @__PURE__ */ jsxs(Typography, {
173
- variant: "caption",
174
- color: "secondary",
175
- children: [
176
- t(($) => $["aUniqueIdentifierForGlobalFinancialReporting"]),
177
- " ",
178
- /* @__PURE__ */ jsx(Link, {
179
- href: "https://search.gleif.org/#/search/",
180
- external: true,
181
- inline: true,
182
- children: t(($) => $["lookUpYourLEI"])
183
- })
184
- ]
185
- }),
186
- helperPosition: "below",
187
- persistHelper: true,
188
- shouldValidate,
189
- mask: legalEntityIdentifierFieldMetadata.mask?.mask,
190
- transformOnType: legalEntityIdentifierFieldMetadata.mask?.transformOnType
191
- }), canExempt && /* @__PURE__ */ jsx(Field, {
192
- name: "exemptedFromLegalEntityIdentifier",
193
- children: (childProps) => /* @__PURE__ */ jsx(Checkbox, {
194
- ...childProps,
195
- name: "exemptedFromLegalEntityIdentifier",
196
- value: "exemptedFromLegalEntityIdentifier",
197
- checked: isExempted,
198
- label: t(($) => $["iDontHaveAnLEI"]),
199
- onChange: handleExemptedChange
200
- })
201
- })] });
202
- }
203
- //#endregion
204
- //#region src/components/Shared/fields/StockExchangeMICField/fieldConfig.ts
205
- var stockExchangeMICFieldMetadata = {
206
- validators: [validateNotEmptyOnBlur, validatePatternOnBlur(/^[a-zA-Z0-9]{4}$/)],
207
- mask: {
208
- mask: makeMask(...alphanumericInputs(4)),
209
- transformOnType: uppercase
210
- }
211
- };
212
- //#endregion
213
- //#region src/components/Shared/fields/StockExchangeMICField/StockExchangeMICField.tsx
214
- var STOCK_EXCHANGE_MIC_FIELD = ["stockExchangeMIC"];
215
- function StockExchangeMICField({ data, valid, errors, readonly, mask, shouldValidate, handleChangeFor }) {
216
- const { t } = useTranslation("common");
217
- return /* @__PURE__ */ jsx(MaskedInput, {
218
- name: "stockExchangeMIC",
219
- type: "text",
220
- label: t(($) => $["stockExchangeMIC"]),
221
- formatGuidance: t(($) => $["enterNCharactersForExample"], {
222
- numChars: "4",
223
- example: "XNAS"
224
- }),
225
- ...mask,
226
- errorMessage: errors.stockExchangeMIC,
227
- isValid: valid.stockExchangeMIC ?? false,
228
- value: data.stockExchangeMIC ?? "",
229
- readonly,
230
- shouldValidate,
231
- onInput: handleChangeFor("stockExchangeMIC", "input"),
232
- onBlur: handleChangeFor("stockExchangeMIC", "blur"),
233
- "aria-required": true,
234
- "aria-invalid": !valid.stockExchangeMIC
235
- });
236
- }
237
- //#endregion
238
- //#region src/components/Shared/fields/StockISINField/fieldConfig.ts
239
- var stockISINFieldMetadata = {
240
- validators: [validateNotEmptyOnBlur, {
241
- modes: ["blur"],
242
- validate: (value) => !!value && isISIN(value)
243
- }],
244
- mask: {
245
- mask: makeMask(...alphaInputs(2), ...alphanumericInputs(9), ...numericInputs(1)),
246
- transformOnType: uppercase
247
- }
248
- };
249
- //#endregion
250
- //#region src/components/Shared/fields/StockISINField/StockISINField.tsx
251
- var STOCK_ISIN_FIELD = ["stockISIN"];
252
- function StockISINField({ data, valid, errors, readonly, mask, shouldValidate, handleChangeFor }) {
253
- const { t } = useTranslation("common");
254
- return /* @__PURE__ */ jsx(MaskedInput, {
255
- name: "stockISIN",
256
- type: "text",
257
- label: t(($) => $["stockISIN"]),
258
- formatGuidance: t(($) => $["validationPleaseEnterAValidStockISIN"], { example: "NL0012969182" }),
259
- ...mask,
260
- errorMessage: errors.stockISIN,
261
- isValid: valid.stockISIN ?? false,
262
- value: data.stockISIN ?? "",
263
- readonly,
264
- shouldValidate,
265
- onInput: handleChangeFor("stockISIN", "input"),
266
- onBlur: handleChangeFor("stockISIN", "blur"),
267
- "aria-required": true,
268
- "aria-invalid": !valid.stockISIN
269
- });
270
- }
271
- //#endregion
272
- //#region src/components/Shared/fields/StockTickerSymbol/fieldConfig.ts
273
- var stockTickerSymbolFieldMetadata = {
274
- validators: [validateNotEmptyOnBlur, validatePatternOnBlur(/^[A-Z\d]{1,5}$/)],
275
- mask: {
276
- mask: makeMask(...alphanumericInputs(1), ...alphanumericInputs(4)),
277
- transformOnType: uppercase
278
- }
279
- };
280
- //#endregion
281
- //#region src/components/Shared/fields/StockTickerSymbol/StockTickerSymbolField.tsx
282
- var STOCK_TICKER_SYMBOL_FIELD = ["stockTickerSymbol"];
283
- function StockTickerSymbolField({ data, valid, errors, readonly, mask, shouldValidate, handleChangeFor }) {
284
- const { t } = useTranslation("common");
285
- return /* @__PURE__ */ jsx(MaskedInput, {
286
- name: "stockTickerSymbol",
287
- type: "text",
288
- label: t(($) => $["stockTickerSymbol"]),
289
- formatGuidance: t(($) => $["enterAMaximumOfNCharactersForExample"], {
290
- maxChars: "5",
291
- example: "ADYEN"
292
- }),
293
- ...mask,
294
- errorMessage: errors.stockTickerSymbol,
295
- isValid: valid.stockTickerSymbol ?? false,
296
- value: data.stockTickerSymbol ?? "",
297
- readonly,
298
- shouldValidate,
299
- onInput: handleChangeFor("stockTickerSymbol", "input"),
300
- onBlur: handleChangeFor("stockTickerSymbol", "blur"),
301
- "aria-required": true,
302
- "aria-invalid": !valid.stockTickerSymbol
303
- });
304
- }
305
- //#endregion
306
- //#region src/components/EFP/fields/LegalFormField/types.ts
307
- var LEGAL_FORM_FIELDS = ["legalForm", "legalFormLabel"];
308
- var legalFormFieldMetadata = {
309
- label: "legalForm",
310
- validators: [validateNotEmptyOnBlur]
311
- };
312
- //#endregion
313
- //#region src/api/companyDataSet/useClearCompanyData.ts
314
- var clearCompanyData = async (legalEntityId, baseUrl) => {
315
- return httpPost({
316
- baseUrl,
317
- path: `legalEntities/${legalEntityId}/companyDataset/clearCompanyData`
318
- });
319
- };
320
- var useClearCompanyData = (options) => {
321
- const { rootLegalEntityId, baseUrl } = useApiContext();
322
- const logger = createLogger();
323
- return useMutation({
324
- mutationFn: () => {
325
- return clearCompanyData(rootLegalEntityId.value, baseUrl.value);
326
- },
327
- retry: 0,
328
- onError: (e) => logger.error(e),
329
- ...options
330
- });
331
- };
332
- var BasicInformation_module_default = {
333
- "basic-information": "_basic-information_1rbd4_1",
334
- basicInformation: "_basic-information_1rbd4_1"
335
- };
336
- //#endregion
337
- //#region src/components/Business/forms/BasicInformation/BasicInformation.tsx
338
- var BASIC_INFORMATION_FIELDS = [
339
- ...COUNTRY_FIELD,
340
- ...LEGAL_COMPANY_NAME_FIELD,
341
- "jaHaniLegalCompanyName",
342
- "jaKanaLegalCompanyName",
343
- ...TAX_INFORMATION_FIELD,
344
- ...STATE_FIELD,
345
- ...BUSINESS_REGISTRATION_NUMBER_FIELD,
346
- ...COUNTRY_OF_GOVERNING_LAW_FIELD
347
- ];
348
- var FormDescription = ({ description, t }) => {
349
- return /* @__PURE__ */ jsxs("div", { children: [
350
- description,
351
- " ",
352
- /* @__PURE__ */ jsx(Link, {
353
- href: "https://www.adyen.com/privacy-policy",
354
- external: true,
355
- children: t(($) => $["privacyStatement"])
356
- })
357
- ] });
358
- };
359
- var EMPTY_OBJ$5 = {};
360
- function BasicInformation({ id, country, shouldValidate, fieldValidationErrors = EMPTY_OBJ$5, formVerificationErrors = EMPTY_OBJ$5, isTopLevelEntity, disableCountry, companyType, taskType }) {
361
- const { t } = useTranslation(["common", "business"]);
362
- const { t: businessT } = useTranslation("business");
363
- const { isSettingEnabled } = useSettingsContext();
364
- const { form } = useFormContext();
365
- const allowedCountries = useAllowedCountries();
366
- const isAllowedEditPrefilledCountry = isSettingEnabled(SettingNames.AllowPrefilledCountryEdit);
367
- const { data, defaultData, valid, errors, requiredFields, optionalFields, obscuredFields, trustedFields, fieldProblems, handleChange: handleChangeFor } = getFormSlice(form, "basicInformation");
368
- const state = data?.stateOrProvince;
369
- const currentCountryTaxInformation = data?.taxInformation?.find((tax) => tax.country === country);
370
- const formUtils = useMemo$1(() => createFormUtils({
371
- requiredFields,
372
- optionalFields,
373
- trustedFields,
374
- obscuredFields
375
- }, t), [
376
- requiredFields,
377
- optionalFields,
378
- trustedFields,
379
- obscuredFields,
380
- t
381
- ]);
382
- const showField = (fieldKeys) => fieldKeys.some((field) => {
383
- switch (field) {
384
- case "registrationNumberType":
385
- case "registrationNumber":
386
- if (isUsingCompanySearch(country, taskType)) return data?.country === "US" ? (formUtils.isRequiredField(field) || formUtils.isOptionalField(field)) && data?.stateOrProvince : formUtils.isRequiredField(field) || formUtils.isOptionalField(field);
387
- return formUtils.isRequiredField(field) || formUtils.isOptionalField(field);
388
- default: return formUtils.isRequiredField(field) || formUtils.isOptionalField(field);
389
- }
390
- });
391
- const legalCompanyNameFields = useLegalCompanyNameField({
392
- data: data ?? {},
393
- valid: valid ?? {},
394
- errors: errors ?? {},
395
- fieldProblems: fieldProblems ?? {},
396
- country,
397
- formUtils,
398
- handleChange: handleChangeFor,
399
- t: businessT
400
- });
401
- return /* @__PURE__ */ jsxs("form", {
402
- id,
403
- className: BasicInformation_module_default.basicInformation,
404
- children: [
405
- /* @__PURE__ */ jsx(Header, {
406
- title: t(($) => $["basicInformationFormHeading"], { ns: "business" }),
407
- children: /* @__PURE__ */ jsx(FormDescription, {
408
- slot: "description",
409
- description: t(($) => $["basicInformationFormDescription"], { ns: "business" }),
410
- t
411
- })
412
- }),
413
- /* @__PURE__ */ jsx(ErrorPanel, {
414
- id: "ariaErrorField",
415
- verificationErrors: formVerificationErrors,
416
- validationErrors: fieldValidationErrors,
417
- formUtils
418
- }),
419
- legalCompanyNameFields.map((field) => /* @__PURE__ */ jsx(Field, {
420
- name: field?.name ?? "",
421
- label: field?.label,
422
- formatGuidance: field?.guidance,
423
- errorMessage: field?.errorMessage,
424
- isValid: Boolean(field?.isValid),
425
- children: (childProps) => /* @__PURE__ */ jsx(InputText, {
426
- ...childProps,
427
- "aria-required": true,
428
- "aria-invalid": !field?.isValid,
429
- name: field?.name,
430
- value: field?.value,
431
- readonly: field?.readonly,
432
- onInput: field ? field.onInput : () => {},
433
- transformInput: field?.transformInput,
434
- transformMode: field?.transformMode,
435
- onBlur: field?.onBlur,
436
- onKeyDown: field?.onKeyDown
437
- })
438
- }, field?.name)),
439
- /* @__PURE__ */ jsxs("fieldset", { children: [
440
- /* @__PURE__ */ jsx(CountryField, {
441
- data: formUtils.getFieldData(data ?? {}, COUNTRY_FIELD),
442
- valid: formUtils.getFieldValid(valid ?? {}, COUNTRY_FIELD),
443
- errors: formUtils.getFieldErrors(errors ?? {}, fieldValidationErrors, COUNTRY_FIELD),
444
- labels: formUtils.getFieldLabels(COUNTRY_FIELD, { country: "countryRegionOfEstablishment" }),
445
- readonly: formUtils.isReadOnly("country") || !isAllowedEditPrefilledCountry || Boolean(disableCountry),
446
- handleChangeFor,
447
- allowedCountries: isTopLevelEntity ? allowedCountries : void 0
448
- }),
449
- showField(COUNTRY_OF_GOVERNING_LAW_FIELD) && /* @__PURE__ */ jsx(CountryOfGoverningLawField, {
450
- data: formUtils.getFieldData(data ?? {}, COUNTRY_OF_GOVERNING_LAW_FIELD),
451
- country,
452
- valid: formUtils.getFieldValid(valid ?? {}, COUNTRY_OF_GOVERNING_LAW_FIELD),
453
- errors: formUtils.getFieldErrors(errors ?? {}, fieldValidationErrors, COUNTRY_OF_GOVERNING_LAW_FIELD),
454
- allowedCountries: isTopLevelEntity ? allowedCountries : void 0,
455
- handleChangeFor
456
- }),
457
- showField(STATE_FIELD) && /* @__PURE__ */ jsx(StateField, {
458
- data: formUtils.getFieldData(data ?? {}, STATE_FIELD),
459
- valid: formUtils.getFieldValid(valid ?? {}, STATE_FIELD),
460
- errors: formUtils.getFieldErrors(errors ?? {}, fieldValidationErrors, STATE_FIELD),
461
- labelOverride: t(($) => $["whereIsYourBusinessRegistered"]),
462
- readonly: formUtils.isReadOnly("stateOrProvince"),
463
- handleChangeFor,
464
- selectedCountry: country
465
- }),
466
- showField(TAX_INFORMATION_FIELD) && /* @__PURE__ */ jsx(TaxInformationField, {
467
- data: formUtils.getFieldData(data ?? {}, TAX_INFORMATION_FIELD),
468
- valid: formUtils.getFieldValid(valid ?? {}, TAX_INFORMATION_FIELD),
469
- errors: formUtils.getFieldErrors(errors ?? {}, fieldValidationErrors, TAX_INFORMATION_FIELD),
470
- placeholder: getTaxInformationPlaceholderText({
471
- country,
472
- companyType,
473
- taxIdNumberType: currentCountryTaxInformation?.type
474
- }),
475
- readonly: formUtils.isReadOnly("taxInformation"),
476
- shouldValidate,
477
- handleChangeFor,
478
- canExempt: showField(["exemptedFromTax"]),
479
- registrationNumber: data?.registrationNumber,
480
- country,
481
- entityType: companyType,
482
- defaultData: defaultData?.taxInformation
483
- }),
484
- showField(BUSINESS_REGISTRATION_NUMBER_FIELD) && /* @__PURE__ */ jsx(BusinessRegistrationNumberField, {
485
- data: formUtils.getFieldData(data ?? {}, BUSINESS_REGISTRATION_NUMBER_FIELD),
486
- valid: formUtils.getFieldValid(valid ?? {}, BUSINESS_REGISTRATION_NUMBER_FIELD),
487
- errors: formUtils.getFieldErrors(errors ?? {}, fieldValidationErrors, BUSINESS_REGISTRATION_NUMBER_FIELD),
488
- readonly: formUtils.isReadOnly("registrationNumber"),
489
- optional: formUtils.isOptionalField("registrationNumber"),
490
- shouldValidate,
491
- handleChangeFor,
492
- country,
493
- state,
494
- canExempt: showField(["exemptedFromRegistrationNumber"]),
495
- companyType
496
- })
497
- ] }),
498
- country === "US" && /* @__PURE__ */ jsx(PatriotActDisclosure, {})
499
- ]
500
- });
501
- }
502
- //#endregion
503
- //#region src/utils/performance.ts
504
- /**
505
- * Start timing an operation
506
- * @param key - Unique identifier for the operation
507
- * @param timings - Map to store timing information
508
- * @returns The start timestamp
509
- */
510
- var startTiming = (key, timings = /* @__PURE__ */ new Map()) => {
511
- const startTime = Date.now();
512
- timings.set(key, { startTime });
513
- return startTime;
514
- };
515
- /**
516
- * End timing an operation and calculate duration
517
- * @param key - Unique identifier for the operation
518
- * @param timings - Map containing timing information
519
- * @returns The duration in milliseconds, or undefined if timing wasn't started
520
- */
521
- var endTiming = (key, timings) => {
522
- const timing = timings.get(key);
523
- if (!timing || timing.endTime) return;
524
- const endTime = Date.now();
525
- const duration = endTime - timing.startTime;
526
- const updatedTiming = {
527
- ...timing,
528
- endTime,
529
- duration
530
- };
531
- timings.set(key, updatedTiming);
532
- return duration;
533
- };
534
- /**
535
- * Execute a function with automatic timing
536
- * @param key - Unique identifier for the operation
537
- * @param fn - Function to execute
538
- * @param analytics - UserEvents instance for logging
539
- * @param timings - Optional map to store timing information
540
- * @returns Promise that resolves with the function result and timing duration
541
- */
542
- var withTiming = async (key, fn, analytics, timings = /* @__PURE__ */ new Map()) => {
543
- startTiming(key, timings);
544
- try {
545
- const result = await fn();
546
- const duration = endTiming(key, timings) || 0;
547
- analytics.addEvent("Performance", {
548
- actionType: "resolve",
549
- actionLevel: "page",
550
- label: key,
551
- additionalData: { duration }
552
- });
553
- return {
554
- result,
555
- duration
556
- };
557
- } catch (error) {
558
- const duration = endTiming(key, timings) || 0;
559
- analytics.addEvent("Performance", {
560
- actionType: "reject",
561
- actionLevel: "page",
562
- label: key,
563
- additionalData: { duration }
564
- });
565
- throw error;
566
- }
567
- };
568
- /**
569
- * Convenience function to track async operation timing
570
- * @param key - Unique identifier for the operation
571
- * @param fn - Function to execute
572
- * @param analytics - UserEvents instance for logging
573
- * @returns Promise that resolves with the function result
574
- */
575
- var trackPerformance = async (key, fn, analytics) => {
576
- const { result } = await withTiming(key, fn, analytics);
577
- return result;
578
- };
579
- //#endregion
580
- //#region src/api/companySearch/useCompanySearch.ts
581
- /**
582
- * Supports querying declaratively (`useCompanySearch` hook) and imperatively
583
- * (`queryClient.fetchQuery()`) with the same config, ensuring no deviation occurs
584
- * between the two types.
585
- */
586
- var companySearchQueryOptions = (rootLegalEntityId, baseUrl, data, userEvents, options) => {
587
- return queryOptions({
588
- queryKey: ["companySearch", data],
589
- queryFn: () => trackPerformance("companySearchNetworkTime", () => handleCompanySearch(rootLegalEntityId, baseUrl, data), userEvents),
590
- retry: 0,
591
- meta: {
592
- onSuccess: (data) => {
593
- userEvents.addPageEvent("Success", {
594
- actionType: "resolve",
595
- returnValue: "companySearch",
596
- additionalData: {
597
- numberOfResults: data.results.length,
598
- ..."provider" in data && { provider: data.provider }
599
- }
600
- });
601
- },
602
- onError: () => {
603
- userEvents.addPageEvent("Encountered error", {
604
- actionType: "resolve",
605
- returnValue: "companySearch",
606
- returnType: "backend"
607
- });
608
- }
609
- },
610
- ...options
611
- });
612
- };
613
- var useCompanySearch = (data, options) => {
614
- const { rootLegalEntityId, baseUrl } = useApiContext();
615
- const userEvents = useAnalyticsContext();
616
- return useQuery(companySearchQueryOptions(rootLegalEntityId.value, baseUrl.value, data, userEvents, options));
617
- };
618
- var handleCompanySearch = async (rootLegalEntityId, baseUrl, data) => {
619
- return httpPost({
620
- baseUrl,
621
- path: `legalEntities/${rootLegalEntityId}/companySearch/search`
622
- }, {
623
- name: data.name,
624
- country: data.country,
625
- stateOrProvince: data.state,
626
- ...data.registrationNumber ? { registrationNumber: data.registrationNumber } : {},
627
- resultSizeLimit: data.resultSizeLimit ?? 15
628
- });
629
- };
630
- //#endregion
631
- //#region src/api/companyDataSet/handleCompanyDataset.ts
632
- var handleCompanyDataset = async (rootLegalEntityId, baseUrl, data) => {
633
- return httpPost({
634
- baseUrl,
635
- path: `legalEntities/${rootLegalEntityId}/companyDataset/select`
636
- }, data);
637
- };
638
- //#endregion
639
- //#region src/api/tinVerification/useVerifyTin.ts
640
- /**
641
- * Supports querying declaratively (`useVerifyTin` hook) and imperatively
642
- * (`queryClient.fetchQuery()`) with the same config, ensuring no deviation occurs
643
- * between the two types.
644
- */
645
- var verifyTinQueryOptions = (rootLegalEntityId, baseUrl, data, userEvents, options) => {
646
- return queryOptions({
647
- queryKey: ["verifyTin", data],
648
- queryFn: data ? () => trackPerformance("verifyTinNetworkTime", () => verifyTin(rootLegalEntityId, baseUrl, data), userEvents) : skipToken,
649
- retry: 0,
650
- meta: {
651
- onSuccess: (data) => {
652
- if (data.matched === true) userEvents.addPageEvent("Success", {
653
- actionType: "verify",
654
- returnValue: "verifyTin",
655
- returnType: "validation"
656
- });
657
- else userEvents.addPageEvent("Encountered error", {
658
- actionType: "verify",
659
- returnValue: "verifyTin",
660
- returnType: "validation"
661
- });
662
- },
663
- onError: () => {
664
- userEvents.addPageEvent("Encountered error", {
665
- actionType: "verify",
666
- returnValue: "verifyTin",
667
- returnType: "backend"
668
- });
669
- }
670
- },
671
- ...options
672
- });
673
- };
674
- var verifyTin = async (legalEntityId, baseUrl, data) => {
675
- return httpPost({
676
- baseUrl,
677
- path: `legalEntities/${legalEntityId}/verifyTin`
678
- }, data);
679
- };
680
- //#endregion
681
- //#region src/api/companySelection/useCompanySelection.ts
682
- var useCompanySelection = (options) => {
683
- const { rootLegalEntityId, baseUrl } = useApiContext();
684
- const userEvents = useAnalyticsContext();
685
- const queryClient = useQueryClient();
686
- return useMutation({
687
- mutationFn: async (data) => trackPerformance("companySelectionNetworkTime", () => handleCompanySelection(rootLegalEntityId.value, baseUrl.value, queryClient, data, userEvents), userEvents),
688
- onSuccess: (data) => {
689
- userEvents.addPageEvent("Success", {
690
- actionType: "select",
691
- returnValue: "companySelection",
692
- returnType: "validation",
693
- additionalData: { tinMatched: data.tinMatched === true }
694
- });
695
- },
696
- onError: () => {
697
- userEvents.addPageEvent("Encountered error", {
698
- actionType: "select",
699
- returnValue: "companySelection",
700
- returnType: "backend"
701
- });
702
- },
703
- retry: (count, error) => {
704
- if ("errorCode" in error && typeof error.errorCode == "string") {
705
- if (error.errorCode === "00_422") return false;
706
- }
707
- return count === 0;
708
- },
709
- ...options
710
- });
711
- };
712
- var handleCompanySelection = async (rootLegalEntityId, baseUrl, queryClient, data, userEvents) => {
713
- switch (data.country) {
714
- case CountryCodes.UnitedStates: {
715
- const verifyTinQueryInput = {
716
- name: data.name,
717
- tin: data.tin
718
- };
719
- const [companyDatasetResult, tinMatchResult] = await Promise.allSettled([handleCompanyDataset(rootLegalEntityId, baseUrl, { id: data.id }), queryClient.fetchQuery(verifyTinQueryOptions(rootLegalEntityId, baseUrl, verifyTinQueryInput, userEvents))]);
720
- if (companyDatasetResult.status === "rejected") throw companyDatasetResult;
721
- return {
722
- ...companyDatasetResult.value,
723
- tinMatched: tinMatchResult.status === "fulfilled" ? tinMatchResult.value.matched : false
724
- };
725
- }
726
- default: {
727
- const companyDatasetResult = await handleCompanyDataset(rootLegalEntityId, baseUrl, { id: data.id });
728
- return {
729
- ...companyDatasetResult,
730
- registrationNumberMatched: companyDatasetResult.registrationNumber && data.registrationNumber ? data.registrationNumber === companyDatasetResult.registrationNumber : void 0
731
- };
732
- }
733
- }
734
- };
735
- //#endregion
736
- //#region src/components/Business/forms/BusinessSelection/BusinessInformationCard/BusinessInformationCard.tsx
737
- function BusinessInformation({ fetching, selectedBusiness }) {
738
- const { t } = useTranslation(["common", "business"]);
739
- const items = useMemo$1(() => selectedBusiness ? entriesOf(selectedBusiness).reduce((acc, [key, value]) => {
740
- switch (key) {
741
- case "legalForm":
742
- if (value) acc[0].details = value;
743
- break;
744
- case "name":
745
- if (value) acc[1].details = value;
746
- break;
747
- case "registeredAddress":
748
- case "principalPlaceOfBusinessAddress":
749
- if (value && typeof value !== "string" && "fullAddress" in value) acc[2].details = value.fullAddress;
750
- break;
751
- default: break;
752
- }
753
- return acc;
754
- }, [
755
- {
756
- term: t(($) => $["legalForm"], { ns: "common" }),
757
- details: ""
758
- },
759
- {
760
- term: t(($) => $["legalCompanyName"], { ns: "common" }),
761
- details: ""
762
- },
763
- {
764
- term: t(($) => $["address"], { ns: "common" }),
765
- details: ""
766
- }
767
- ]).filter((item) => !!item.details) : [], [selectedBusiness, t]);
768
- if (fetching) return /* @__PURE__ */ jsx(Loader, { size: "large" });
769
- return /* @__PURE__ */ jsx(StructuredList, { items });
770
- }
771
- function BusinessInformationCard({ result, isSelected, currentBusinessSelection, fetching, error, handleSelectBusiness, retryCompanySelection }) {
772
- const { t } = useTranslation(["common", "business"]);
773
- const isLegalArrangementError = error && isBusinessSelectionLegalArrangementError(error);
774
- return /* @__PURE__ */ jsx(Card, {
775
- selected: isSelected,
776
- onClick: isSelected ? void 0 : handleSelectBusiness,
777
- children: /* @__PURE__ */ jsxs(StackLayout, { children: [/* @__PURE__ */ jsx(ListItem, {
778
- avatar: {
779
- iconName: "company",
780
- circle: true
781
- },
782
- title: result.name,
783
- description: result.registrationNumber,
784
- accessory: fetching && isSelected ? /* @__PURE__ */ jsx(Loader, { size: "medium" }) : null
785
- }), isSelected && !fetching && !isLegalArrangementError && /* @__PURE__ */ jsx(StackLayout, { children: error ? /* @__PURE__ */ jsx(Alert, {
786
- variant: "info",
787
- type: "callToAction",
788
- title: t(($) => $["businessDetailsFailedToLoad"], { ns: "business" }),
789
- actions: /* @__PURE__ */ jsx(Button, {
790
- testId: "reloadBusiness",
791
- onClick: retryCompanySelection,
792
- variant: "link",
793
- children: t(($) => $["tryAgain"], { ns: "common" })
794
- }),
795
- testId: "failedToLoad"
796
- }) : /* @__PURE__ */ jsx(Card, {
797
- variant: "secondary",
798
- padding: "large",
799
- children: /* @__PURE__ */ jsx(BusinessInformation, {
800
- fetching,
801
- selectedBusiness: currentBusinessSelection
802
- })
803
- }) })] })
804
- });
805
- }
806
- function CompanyNotListedCard({ isSelected, handleSelectBusiness, fetching }) {
807
- const { t } = useTranslation(["business"]);
808
- return /* @__PURE__ */ jsx(Card, {
809
- selected: isSelected,
810
- onClick: isSelected ? void 0 : handleSelectBusiness,
811
- children: /* @__PURE__ */ jsx(ListItem, {
812
- title: t(($) => $["myBusinessIsntHere"], { ns: "business" }),
813
- accessory: fetching && isSelected ? /* @__PURE__ */ jsx(Loader, { size: "medium" }) : null
814
- })
815
- });
816
- }
817
- //#endregion
818
- //#region src/components/Business/forms/BusinessSelection/BusinessSelection.tsx
819
- var BUSINESS_SELECTION_FIELDS = ["selectedBusinessId"];
820
- var EMPTY_OBJ$4 = {};
821
- function BusinessSelection({ id, country, fieldValidationErrors = EMPTY_OBJ$4, formVerificationErrors = EMPTY_OBJ$4 }) {
822
- const { t } = useTranslation(["common", "business"]);
823
- const { baseUrl, rootLegalEntityId } = useApiContext();
824
- const { form } = useFormContext();
825
- const queryClient = useQueryClient();
826
- const userEvents = useAnalyticsContext();
827
- const logger = createLogger();
828
- const companySearchStateModel = useContext$1(CompanySearchStateContext);
829
- const { data, valid, errors, allFields, requiredFields, optionalFields, obscuredFields, trustedFields, handleChange: handleChangeFor } = getFormSlice(form, "businessSelection");
830
- const { data: companySearchResponse, isLoading: searching } = useCompanySearch({
831
- name: companySearchStateModel.companySearchName.value ?? "",
832
- country,
833
- state: form.data.basicInformation?.stateOrProvince,
834
- registrationNumber: form.data.basicInformation?.registrationNumber
835
- });
836
- const { data: selectData, error: selectError, mutateAsync: selectCompany, reset: resetSelectMutationState } = useCompanySelection();
837
- const { mutateAsync: clearCompanyData } = useClearCompanyData();
838
- const currentTin = form.data.basicInformation?.taxInformation?.find((taxId) => taxId.country === country)?.number;
839
- const currentRegistrationNumber = form.data.basicInformation?.registrationNumber;
840
- /**
841
- * This ID is internal to this form, controlling selection for UI & data flow purposes. The
842
- * multiform state is used to determine whether the form is set & valid, ready for the user to progress.
843
- */
844
- const selectedId = useSignal("");
845
- const isSelectPending = useSignal(false);
846
- const selectedCompanyIdx = companySearchResponse?.results.findIndex((searchResult) => searchResult.resultId === selectedId.value);
847
- /**
848
- * Reset company selection when re-entering form.
849
- *
850
- * The mutation makes this a bit awkward, as we won't have any data when re-entering. Whilst we
851
- * could perhaps auto-select the result, without caching, we'd have another spinner & wait time for
852
- * the user. Better to force a manual re-selection to work around our rough implementation details.
853
- */
854
- const isInitializedRef = useRef$1(false);
855
- if (!isInitializedRef.current) {
856
- if (data?.selectedBusinessId) {
857
- handleChangeFor("selectedBusinessId", "blur")("");
858
- form.setErrors("businessSelection", "selectedBusinessId", null);
859
- }
860
- isInitializedRef.current = true;
861
- }
862
- const fetchCompanyData = async (result) => {
863
- isSelectPending.value = true;
864
- resetSelectMutationState();
865
- try {
866
- const companySelectionResponse = await selectCompany({
867
- id: result.resultId,
868
- name: result.name,
869
- tin: currentTin ?? "",
870
- registrationNumber: currentRegistrationNumber ?? "",
871
- country
872
- });
873
- handleChangeFor("selectedBusinessId", "blur")(result.resultId);
874
- companySearchStateModel.selectCompany(companySelectionResponse, selectedCompanyIdx, country);
875
- } catch (e) {
876
- if (isBusinessSelectionLegalArrangementError(e)) {
877
- companySearchStateModel.disallowSelection("LEGAL_ARRANGEMENT");
878
- handleChangeFor("selectedBusinessId", "blur")("LEGAL_ARRANGEMENT_ERR");
879
- } else logger.error(e);
880
- } finally {
881
- isSelectPending.value = false;
882
- }
883
- };
884
- const handleSelectBusiness = (result) => {
885
- selectedId.value = result.resultId;
886
- companySearchStateModel.resetCompanySearchData();
887
- fetchCompanyData(result);
888
- };
889
- const handleSelectNotListed = async () => {
890
- selectedId.value = "notListed";
891
- companySearchStateModel.resetCompanySearchData();
892
- await clearCompanyData();
893
- if (country !== CountryCodes.UnitedStates) return handleChangeFor("selectedBusinessId", "blur")("notListed");
894
- try {
895
- isSelectPending.value = true;
896
- const tinVerificationParams = {
897
- name: form.data.basicInformation?.legalCompanyName ?? "",
898
- tin: currentTin ?? ""
899
- };
900
- const { matched } = await queryClient.fetchQuery(verifyTinQueryOptions(rootLegalEntityId.peek(), baseUrl.peek(), tinVerificationParams, userEvents));
901
- companySearchStateModel.setVerificationMatched(!!matched);
902
- handleChangeFor("selectedBusinessId", "blur")("notListed");
903
- } catch (e) {
904
- logger.error(e);
905
- companySearchStateModel.setVerificationMatched(false);
906
- handleChangeFor("selectedBusinessId", "blur")("notListed");
907
- } finally {
908
- isSelectPending.value = false;
909
- }
910
- };
911
- const formUtils = useMemo$1(() => {
912
- return createFormUtils({
913
- data: data ?? {},
914
- fieldValidationErrors,
915
- formVerificationErrors,
916
- allFields: allFields ?? [],
917
- requiredFields: requiredFields ?? [],
918
- optionalFields: optionalFields ?? [],
919
- trustedFields: trustedFields ?? [],
920
- obscuredFields: obscuredFields ?? [],
921
- errors: errors ?? {},
922
- valid: valid ?? {}
923
- }, t);
924
- }, [
925
- allFields,
926
- data,
927
- errors,
928
- obscuredFields,
929
- optionalFields,
930
- requiredFields,
931
- trustedFields,
932
- valid,
933
- t,
934
- fieldValidationErrors,
935
- formVerificationErrors
936
- ]);
937
- return /* @__PURE__ */ jsx("form", {
938
- id,
939
- children: /* @__PURE__ */ jsxs(LoaderWrapper, {
940
- loaderSize: "large",
941
- status: searching ? "loading" : "success",
942
- children: [
943
- /* @__PURE__ */ jsx(Header, { title: t(($) => $["businessSelectionFormHeading"], { ns: "business" }) }),
944
- /* @__PURE__ */ jsx(ErrorPanel, {
945
- id: "ariaErrorField",
946
- verificationErrors: formVerificationErrors,
947
- validationErrors: fieldValidationErrors,
948
- formUtils
949
- }),
950
- /* @__PURE__ */ jsx(Field, {
951
- el: "fieldset",
952
- name: "selectedBusinessId",
953
- errorMessage: formUtils.getErrorMessage("selectedBusinessId", errors, fieldValidationErrors),
954
- isValid: valid?.selectedBusinessId,
955
- children: () => /* @__PURE__ */ jsxs(StackLayout, { children: [companySearchResponse?.results.map((result) => /* @__PURE__ */ jsx(BusinessInformationCard, {
956
- result,
957
- isSelected: selectedId.value === result.resultId,
958
- currentBusinessSelection: selectData,
959
- fetching: isSelectPending.value,
960
- error: selectError,
961
- handleSelectBusiness: () => handleSelectBusiness(result),
962
- retryCompanySelection: () => fetchCompanyData(result)
963
- }, result.resultId)), /* @__PURE__ */ jsx(CompanyNotListedCard, {
964
- isSelected: selectedId.value === "notListed",
965
- handleSelectBusiness: handleSelectNotListed,
966
- fetching: isSelectPending.value
967
- })] })
968
- })
969
- ]
970
- })
971
- });
972
- }
973
- //#endregion
974
- //#region src/datasets/generators/getCompanyTypeExamplesForCountry.ts
975
- var companyTypeExamples = /* @__PURE__ */ Object.assign({
976
- "../localized/companyTypeExamples/AT.json": () => import("./AT-BNvEEyA1.js"),
977
- "../localized/companyTypeExamples/AU.json": () => import("./AU-yI1HPsCK.js"),
978
- "../localized/companyTypeExamples/BE.json": () => import("./BE-BsQPppoQ.js"),
979
- "../localized/companyTypeExamples/BR.json": () => import("./BR-Df_k79xR.js"),
980
- "../localized/companyTypeExamples/CA.json": () => import("./CA-Drxrt6ud.js"),
981
- "../localized/companyTypeExamples/CH.json": () => import("./CH-C93Zls9o.js"),
982
- "../localized/companyTypeExamples/CZ.json": () => import("./CZ-Bk7V7DHn.js"),
983
- "../localized/companyTypeExamples/DE.json": () => import("./DE-CKGX5CHO.js"),
984
- "../localized/companyTypeExamples/DK.json": () => import("./DK-DORnwCWQ.js"),
985
- "../localized/companyTypeExamples/ES.json": () => import("./ES-C89tOy9e.js"),
986
- "../localized/companyTypeExamples/FI.json": () => import("./FI-DCXniiD4.js"),
987
- "../localized/companyTypeExamples/FR.json": () => import("./FR-CxvXXv-O.js"),
988
- "../localized/companyTypeExamples/GB.json": () => import("./GB-DCF0Nkem.js"),
989
- "../localized/companyTypeExamples/HK.json": () => import("./HK-C1qODiFA.js"),
990
- "../localized/companyTypeExamples/HR.json": () => import("./HR-DomyNfJ0.js"),
991
- "../localized/companyTypeExamples/HU.json": () => import("./HU-HvuEJeUR.js"),
992
- "../localized/companyTypeExamples/IE.json": () => import("./IE-DwzVxL1C.js"),
993
- "../localized/companyTypeExamples/IT.json": () => import("./IT-CISIu45c.js"),
994
- "../localized/companyTypeExamples/LT.json": () => import("./LT-DnvVPVhz.js"),
995
- "../localized/companyTypeExamples/MX.json": () => import("./MX-CXUYOKFF.js"),
996
- "../localized/companyTypeExamples/NL.json": () => import("./NL-Bn2QKc20.js"),
997
- "../localized/companyTypeExamples/NO.json": () => import("./NO-D7BSfuUs.js"),
998
- "../localized/companyTypeExamples/PL.json": () => import("./PL-CtjljK4S.js"),
999
- "../localized/companyTypeExamples/PT.json": () => import("./PT-Ck3Uvmoz.js"),
1000
- "../localized/companyTypeExamples/RO.json": () => import("./RO-CewdEU2z.js"),
1001
- "../localized/companyTypeExamples/SE.json": () => import("./SE-DzRKAJvT.js"),
1002
- "../localized/companyTypeExamples/SG.json": () => import("./SG-sKZVzzs9.js"),
1003
- "../localized/companyTypeExamples/SI.json": () => import("./SI-BIBw5Y4Z.js"),
1004
- "../localized/companyTypeExamples/SK.json": () => import("./SK-M9wg6on5.js"),
1005
- "../localized/companyTypeExamples/US.json": () => import("./US-D3s6UvEg.js")
1006
- });
1007
- var logger$1 = createLogger();
1008
- var getCompanyTypeExamplesForCountry = async (country) => {
1009
- const importForCountry = companyTypeExamples[`../localized/companyTypeExamples/${country}.json`];
1010
- if (!importForCountry) {
1011
- logger$1.warn(`No company type examples available for ${country}`);
1012
- return {};
1013
- }
1014
- return (await importForCountry()).default;
1015
- };
1016
- var useCompanyTypeExamples = (country) => {
1017
- const [examples, setExamples] = useState$1();
1018
- useEffect$1(() => {
1019
- getCompanyTypeExamplesForCountry(country).then(setExamples).catch(console.error);
1020
- }, [country]);
1021
- return examples;
1022
- };
1023
- //#endregion
1024
- //#region src/components/Business/utils/companyTypeMetadata.ts
1025
- var companyTypeMetadata = {
1026
- privateCompany: {
1027
- id: "privateCompany",
1028
- name: "privateCompanyTitle",
1029
- description: "privateCompanyDescription"
1030
- },
1031
- listedPublicCompany: {
1032
- id: "listedPublicCompany",
1033
- name: "publicCompanyTitle",
1034
- description: "publicCompanyDescription"
1035
- },
1036
- partnershipIncorporated: {
1037
- id: "partnershipIncorporated",
1038
- name: "partnershipIncorporated",
1039
- description: "partnershipIncorporatedDescription"
1040
- },
1041
- nonProfit: {
1042
- id: "nonProfit",
1043
- name: "nonProfitOrCharitableOrgTitle",
1044
- description: "nonProfitOrCharitableOrgDescription"
1045
- },
1046
- governmentalOrganization: {
1047
- id: "governmentalOrganization",
1048
- name: "governmentalOrganizationTitle",
1049
- description: "governmentalOrganizationDescription"
1050
- },
1051
- associationIncorporated: {
1052
- id: "associationIncorporated",
1053
- name: "associationIncorporated",
1054
- description: "associationIncorporatedDescription"
1055
- }
1056
- };
1057
- var companyTypeOptions = Object.keys(companyTypeMetadata);
1058
- //#endregion
1059
- //#region src/components/Business/utils/getAvailableCompanyStructures.ts
1060
- function getAvailableCompanyStructures({ country, registrationNumberType, registrationNumberExempt, taxIdNumberType, legalEntity, accountHolder, isSettingEnabled }) {
1061
- const isRootOrganization = isSettingEnabled(SettingNames.AllowLegalEntityTypeChange) && accountHolder !== "aTrust" && accountHolder !== "anUnincorporatedPartnership";
1062
- const excludedTypes = !!legalEntity.capabilities?.issueBankAccount?.requested ? [
1063
- "partnershipIncorporated",
1064
- "associationIncorporated",
1065
- "governmentalOrganization"
1066
- ] : ["partnershipIncorporated", "associationIncorporated"];
1067
- const companyTypeRadioOptions = isRootOrganization ? companyTypeOptions.filter((companyType) => !excludedTypes.includes(companyType)) : companyTypeOptions;
1068
- const validCompanyTypesByRegistrationNumber = registrationNumberExempt && isRegistrationExemptionAllowed(country) ? REGISTRATION_NUMBER_EXEMPTION_RULES[country] : getValidCompanyTypesForRegistrationNumberType(country, registrationNumberType);
1069
- const validCompanyTypesForRegistrationNumber = new Set(validCompanyTypesByRegistrationNumber);
1070
- const validCompanyTypesForTaxId = new Set(getValidCompanyTypesForTaxIdNumberType(country, taxIdNumberType));
1071
- const constrainedCompanyTypeRadioOptions = companyTypeRadioOptions.filter((companyType) => (!validCompanyTypesForRegistrationNumber.size || validCompanyTypesForRegistrationNumber.has(companyType)) && (!validCompanyTypesForTaxId.size || validCompanyTypesForTaxId.has(companyType)));
1072
- return constrainedCompanyTypeRadioOptions.length > 0 ? constrainedCompanyTypeRadioOptions : companyTypeRadioOptions;
1073
- }
1074
- //#endregion
1075
- //#region src/components/Business/forms/CompanyStructure/CompanyStructure.tsx
1076
- var COMPANY_STRUCTURE_FIELDS = ["entityType"];
1077
- var EMPTY_OBJ$3 = {};
1078
- function CompanyStructure({ id, country, fieldValidationErrors = EMPTY_OBJ$3, formVerificationErrors = EMPTY_OBJ$3 }) {
1079
- const { t } = useTranslation([
1080
- "common",
1081
- "business",
1082
- "ui"
1083
- ]);
1084
- const { form } = useFormContext();
1085
- const { accountHolder } = useAccountHolder();
1086
- const { rootLegalEntityId } = useApiContext();
1087
- const { data: legalEntity } = useLegalEntity(rootLegalEntityId.value);
1088
- const { isSettingEnabled } = useSettingsContext();
1089
- const { data, valid, errors, requiredFields, handleChange: handleChangeFor } = getFormSlice(form, "companyStructure");
1090
- const formUtils = createFormUtils({ requiredFields: requiredFields ?? [] }, t);
1091
- const registrationNumberType = form.data.basicInformation?.registrationNumberType;
1092
- const taxIdNumberType = form.data.basicInformation?.taxInformation?.find((taxInformation) => taxInformation.country === country)?.type;
1093
- const registrationNumberExempt = form.data.basicInformation?.exemptedFromRegistrationNumber;
1094
- const availableCompanyTypeRadioOptions = getAvailableCompanyStructures({
1095
- country,
1096
- registrationNumberType,
1097
- registrationNumberExempt,
1098
- taxIdNumberType,
1099
- legalEntity: legalEntity || {},
1100
- accountHolder,
1101
- isSettingEnabled
1102
- });
1103
- const companyTypeExamples = useCompanyTypeExamples(country);
1104
- const companyTiles = availableCompanyTypeRadioOptions.map((option) => {
1105
- const description = t(($) => $[companyTypeMetadata[option].description], { ns: "business" });
1106
- const examples = companyTypeExamples?.[option];
1107
- const subTitle = examples ? `${description} ${t(($) => $["forExample_"], {
1108
- examples: examples.join(", "),
1109
- interpolation: { escapeValue: false },
1110
- ns: "ui"
1111
- })}` : description;
1112
- return {
1113
- value: option,
1114
- label: t(($) => $[companyTypeMetadata[option].name], { ns: "business" }),
1115
- subTitle
1116
- };
1117
- });
1118
- return /* @__PURE__ */ jsxs("form", {
1119
- id,
1120
- children: [
1121
- /* @__PURE__ */ jsx(Header, {
1122
- title: t(($) => $["companyStructureFormHeading"], { ns: "business" }),
1123
- description: t(($) => $["companyStructureFormDescription"], { ns: "business" })
1124
- }),
1125
- /* @__PURE__ */ jsx(ErrorPanel, {
1126
- id: "ariaErrorField",
1127
- verificationErrors: formVerificationErrors,
1128
- validationErrors: fieldValidationErrors,
1129
- formUtils
1130
- }),
1131
- /* @__PURE__ */ jsx(Field, {
1132
- el: "fieldset",
1133
- name: "entityType",
1134
- errorMessage: formUtils.getErrorMessage("entityType", errors, fieldValidationErrors),
1135
- isValid: valid?.entityType,
1136
- children: (childProps) => /* @__PURE__ */ jsx(TileGroup, {
1137
- ...childProps,
1138
- name: "entityType",
1139
- tiles: companyTiles,
1140
- selected: data?.entityType ?? "",
1141
- onChange: (value) => handleChangeFor("entityType")(value),
1142
- isHorizontal: true,
1143
- "aria-required": true,
1144
- "aria-invalid": !valid?.entityType
1145
- })
1146
- })
1147
- ]
1148
- });
1149
- }
1150
- //#endregion
1151
- //#region src/components/Shared/fields/FinancialReportingDate/FinancialReportingDate.tsx
1152
- var FINANCIAL_REPORTING_DATE_FIELD = ["financialReportingDate"];
1153
- function FinancialReportingDate({ data, valid, errors, labels, readonly, handleChangeFor }) {
1154
- const { t } = useTranslation("common");
1155
- return /* @__PURE__ */ jsx(Field, {
1156
- name: "financialReportingDate",
1157
- label: labels.financialReportingDate,
1158
- helper: t(($) => $["dateOfTotalAssetsCalculation"]),
1159
- helperPosition: "below",
1160
- errorMessage: errors.financialReportingDate,
1161
- isValid: valid.financialReportingDate,
1162
- children: (childProps) => /* @__PURE__ */ jsx(InputDate, {
1163
- ...childProps,
1164
- name: "financialReportingDate",
1165
- value: data.financialReportingDate,
1166
- onInput: handleChangeFor("financialReportingDate", "input"),
1167
- onBlur: handleChangeFor("financialReportingDate", "blur"),
1168
- "aria-required": true,
1169
- "aria-invalid": !valid.financialReportingDate,
1170
- readonly,
1171
- max: formatDateObj(/* @__PURE__ */ new Date())
1172
- })
1173
- });
1174
- }
1175
- //#endregion
1176
- //#region src/components/Shared/fields/NumberOfEmployees/NumberOfEmployees.tsx
1177
- var NUMBER_OF_EMPLOYEES_FIELD = ["numberOfEmployees"];
1178
- function NumberOfEmployees({ data, valid, errors, labels, readonly, handleChangeFor }) {
1179
- return /* @__PURE__ */ jsx(Field, {
1180
- name: "numberOfEmployees",
1181
- label: labels.numberOfEmployees,
1182
- errorMessage: errors.numberOfEmployees,
1183
- isValid: valid.numberOfEmployees,
1184
- children: (childProps) => /* @__PURE__ */ jsx(InputNumber, {
1185
- ...childProps,
1186
- "aria-required": true,
1187
- "aria-invalid": !valid.numberOfEmployees,
1188
- name: "numberOfEmployees",
1189
- min: "1",
1190
- step: "1",
1191
- value: data.numberOfEmployees,
1192
- readonly,
1193
- onInput: handleChangeFor("numberOfEmployees", "input"),
1194
- onBlur: handleChangeFor("numberOfEmployees", "blur")
1195
- })
1196
- });
1197
- }
1198
- var ReportedValueOptionField_module_default = {
1199
- "reported-value-options": "_reported-value-options_tqpoa_1",
1200
- reportedValueOptions: "_reported-value-options_tqpoa_1",
1201
- "reported-value": "_reported-value_tqpoa_1",
1202
- reportedValue: "_reported-value_tqpoa_1",
1203
- "reported-value-input": "_reported-value-input_tqpoa_11",
1204
- reportedValueInput: "_reported-value-input_tqpoa_11",
1205
- "reported-value-field": "_reported-value-field_tqpoa_15",
1206
- reportedValueField: "_reported-value-field_tqpoa_15"
1207
- };
1208
- //#endregion
1209
- //#region src/components/Shared/fields/ReportedValueOptionField/ReportedValue.tsx
1210
- var ReportedValue = ({ currency, amount, onAmountChanged, label, helper, fieldName, errorMessage, isValid }) => {
1211
- const { i18n } = useTranslation();
1212
- return /* @__PURE__ */ jsx("div", {
1213
- className: ReportedValueOptionField_module_default.reportedValue,
1214
- children: /* @__PURE__ */ jsx(Field, {
1215
- name: fieldName,
1216
- errorMessage,
1217
- isValid,
1218
- helper,
1219
- className: ReportedValueOptionField_module_default.reportedValueField,
1220
- children: (childProps) => /* @__PURE__ */ jsx(InputCurrency, {
1221
- ...childProps,
1222
- locale: i18n.language,
1223
- currency,
1224
- amount,
1225
- onAmountChanged,
1226
- className: ReportedValueOptionField_module_default.reportedValueInput,
1227
- "aria-label": label
1228
- })
1229
- })
1230
- });
1231
- };
1232
- //#endregion
1233
- //#region src/components/Shared/fields/ReportedValueOptionField/ReportedValueOptionField.tsx
1234
- var REPORTED_VALUE_OPTION_FIELD = [
1235
- "reportedValueOption",
1236
- "balanceSheetTotal",
1237
- "annualTurnover"
1238
- ];
1239
- function ReportedValueOptionField({ data, valid, errors, handleChangeFor, currency }) {
1240
- const { t } = useTranslation("common");
1241
- const updateReportedValueOption = (option) => {
1242
- if (data.reportedValueOption) handleChangeFor(data.reportedValueOption)(null);
1243
- const newReportedValue = option;
1244
- handleChangeFor("reportedValueOption")(newReportedValue);
1245
- };
1246
- return /* @__PURE__ */ jsx(Field, {
1247
- el: "fieldset",
1248
- name: "reportedValueOption",
1249
- label: t(($) => $["reportedValue"]),
1250
- errorMessage: errors.reportedValueOption,
1251
- helper: t(($) => $["useFiguresFromTheMostRecentYearAvailable"]),
1252
- isValid: Boolean(valid.reportedValueOption),
1253
- children: (childProps) => /* @__PURE__ */ jsx(RadioGroup, {
1254
- name: "reportedValueOption",
1255
- ...childProps,
1256
- value: data.reportedValueOption,
1257
- items: [{
1258
- id: "balanceSheetTotal",
1259
- name: "balanceSheetTotal",
1260
- content: /* @__PURE__ */ jsx(ReportedValue, {
1261
- label: t(($) => $["balanceSheetTotal"]),
1262
- currency,
1263
- amount: data.balanceSheetTotal,
1264
- onAmountChanged: handleChangeFor("balanceSheetTotal"),
1265
- fieldName: "balanceSheetTotal",
1266
- isValid: valid.balanceSheetTotal,
1267
- errorMessage: errors.balanceSheetTotal
1268
- })
1269
- }, {
1270
- id: "annualTurnover",
1271
- name: "annualTurnover",
1272
- content: /* @__PURE__ */ jsx(ReportedValue, {
1273
- label: t(($) => $["annualTurnover"]),
1274
- currency,
1275
- amount: data.annualTurnover,
1276
- onAmountChanged: handleChangeFor("annualTurnover"),
1277
- fieldName: "annualTurnover",
1278
- isValid: valid.annualTurnover,
1279
- errorMessage: errors.annualTurnover
1280
- })
1281
- }],
1282
- onChange: updateReportedValueOption,
1283
- showContentOnlyOnSelected: true,
1284
- className: ReportedValueOptionField_module_default.reportedValueOptions
1285
- })
1286
- });
1287
- }
1288
- //#endregion
1289
- //#region src/components/Business/forms/FinancialInformation/FinancialInformation.tsx
1290
- var financialInformationFieldsForEu = [
1291
- ...FINANCIAL_REPORTING_DATE_FIELD,
1292
- ...CURRENCY_FIELD,
1293
- ...REPORTED_VALUE_OPTION_FIELD
1294
- ];
1295
- var financialInformationFields = [
1296
- ...NUMBER_OF_EMPLOYEES_FIELD,
1297
- ...FINANCIAL_REPORTING_DATE_FIELD,
1298
- ...CURRENCY_FIELD,
1299
- ...REPORTED_VALUE_OPTION_FIELD
1300
- ];
1301
- var EMPTY_OBJ$2 = {};
1302
- function FinancialInformation({ id, country, fieldValidationErrors = EMPTY_OBJ$2, formVerificationErrors = EMPTY_OBJ$2 }) {
1303
- const { t } = useTranslation("common");
1304
- const { form } = useFormContext();
1305
- const defaultCurrency = currencyByCountry[country]?.[0] ?? "EUR";
1306
- const { data, valid, errors, allFields, requiredFields, optionalFields, obscuredFields, trustedFields, fieldProblems, handleChange: handleChangeFor } = getFormSlice(form, "companyFinancialInformation");
1307
- const formUtils = useMemo$1(() => createFormUtils({
1308
- data: data ?? {},
1309
- fieldValidationErrors,
1310
- formVerificationErrors,
1311
- allFields: allFields ?? [],
1312
- requiredFields: requiredFields ?? [],
1313
- optionalFields: optionalFields ?? [],
1314
- trustedFields: trustedFields ?? [],
1315
- obscuredFields: obscuredFields ?? [],
1316
- errors: errors ?? {},
1317
- valid: valid ?? {},
1318
- handleFieldChange: handleChangeFor
1319
- }, t), [
1320
- data,
1321
- fieldValidationErrors,
1322
- formVerificationErrors,
1323
- allFields,
1324
- requiredFields,
1325
- optionalFields,
1326
- trustedFields,
1327
- obscuredFields,
1328
- errors,
1329
- valid,
1330
- handleChangeFor,
1331
- t
1332
- ]);
1333
- const showField = (fieldKeys) => fieldKeys.some((field) => formUtils.isRequiredField(field) || formUtils.isOptionalField(field));
1334
- return /* @__PURE__ */ jsxs("form", {
1335
- id,
1336
- children: [
1337
- /* @__PURE__ */ jsx(Header, { title: t(($) => $["companyFinancialInformationFormHeading"], { ns: "business" }) }),
1338
- /* @__PURE__ */ jsx(ErrorPanel, {
1339
- id: "ariaErrorField",
1340
- verificationErrors: formVerificationErrors,
1341
- validationErrors: fieldValidationErrors,
1342
- formUtils
1343
- }),
1344
- country === CountryCodes.UnitedKingdom && /* @__PURE__ */ jsx(NumberOfEmployees, {
1345
- data: formUtils.getFieldData(data ?? {}, NUMBER_OF_EMPLOYEES_FIELD),
1346
- errors: formUtils.getFieldErrors(errors ?? {}, fieldProblems, NUMBER_OF_EMPLOYEES_FIELD),
1347
- handleChangeFor,
1348
- labels: formUtils.getFieldLabels(NUMBER_OF_EMPLOYEES_FIELD),
1349
- readonly: formUtils.isReadOnly("numberOfEmployees"),
1350
- valid: formUtils.getFieldValid(valid ?? {}, NUMBER_OF_EMPLOYEES_FIELD)
1351
- }),
1352
- showField(FINANCIAL_REPORTING_DATE_FIELD) && /* @__PURE__ */ jsx(FinancialReportingDate, {
1353
- data: formUtils.getFieldData(data ?? {}, FINANCIAL_REPORTING_DATE_FIELD),
1354
- errors: formUtils.getFieldErrors(errors ?? {}, fieldProblems, FINANCIAL_REPORTING_DATE_FIELD),
1355
- handleChangeFor,
1356
- labels: formUtils.getFieldLabels(FINANCIAL_REPORTING_DATE_FIELD),
1357
- readonly: formUtils.isReadOnly("financialReportingDate"),
1358
- valid: formUtils.getFieldValid(valid ?? {}, FINANCIAL_REPORTING_DATE_FIELD)
1359
- }),
1360
- showField(CURRENCY_FIELD) && /* @__PURE__ */ jsx(Currency, {
1361
- country,
1362
- labels: { currency: t(($) => $["reportingCurrency"]) },
1363
- data: formUtils.getFieldData(data ?? {}, CURRENCY_FIELD),
1364
- errors: formUtils.getFieldErrors(errors ?? {}, fieldProblems, CURRENCY_FIELD),
1365
- handleChangeFor,
1366
- readonly: formUtils.isReadOnly("currency"),
1367
- valid: formUtils.getFieldValid(valid ?? {}, CURRENCY_FIELD)
1368
- }),
1369
- showField(REPORTED_VALUE_OPTION_FIELD) && /* @__PURE__ */ jsx(ReportedValueOptionField, {
1370
- data: formUtils.getFieldData(data ?? {}, REPORTED_VALUE_OPTION_FIELD),
1371
- valid: formUtils.getFieldValid(valid ?? {}, REPORTED_VALUE_OPTION_FIELD),
1372
- errors: formUtils.getFieldErrors(errors ?? {}, fieldProblems, REPORTED_VALUE_OPTION_FIELD),
1373
- handleChangeFor,
1374
- currency: data?.currency ?? defaultCurrency
1375
- })
1376
- ]
1377
- });
1378
- }
1379
- //#endregion
1380
- //#region src/components/Business/forms/ProofOfAddressDocument/ProofOfAddressDocument.tsx
1381
- var GuidanceContent$5 = ({ t }) => {
1382
- return /* @__PURE__ */ jsx("div", {
1383
- className: "adyen-kyc-upload-field__guidance",
1384
- children: /* @__PURE__ */ jsxs("div", {
1385
- className: "u-margin-bottom-24",
1386
- children: [/* @__PURE__ */ jsx("strong", { children: t(($) => $["documentRequirements"], { ns: "common" }) }), /* @__PURE__ */ jsxs("ul", { children: [
1387
- /* @__PURE__ */ jsx("li", { children: t(($) => $["yourBusinesssLegalName"], { ns: "business" }) }),
1388
- /* @__PURE__ */ jsx("li", { children: t(($) => $["theCompleteAddress"], { ns: "business" }) }),
1389
- /* @__PURE__ */ jsx("li", { children: t(($) => $["anIssueDateWithinTheLast12Months"], { ns: "business" }) }),
1390
- /* @__PURE__ */ jsx("li", { children: t(($) => $["clearReadableText"], { ns: "business" }) })
1391
- ] })]
1392
- })
1393
- });
1394
- };
1395
- function ProofOfAddressDocument({ id, country, ...props }) {
1396
- const { t } = useTranslation(["common", "business"]);
1397
- return /* @__PURE__ */ jsx(MemoizedDocumentUpload, {
1398
- ...props,
1399
- id,
1400
- heading: t(($) => $["uploadProofOfAddress"], { ns: "business" }),
1401
- description: t(($) => $["toFinishVerifyingYourBusinessWeNeedAnOfficialDocumentThatConfirmsItsAddress"], { ns: "business" }),
1402
- documentField: "proofOfAddress",
1403
- documentType: "proofOfAddress",
1404
- guidanceContent: /* @__PURE__ */ jsx(GuidanceContent$5, { t }),
1405
- country,
1406
- hidePageCount: true
1407
- });
1408
- }
1409
- //#endregion
1410
- //#region src/components/Business/forms/ProofOfDirectorDocument/ProofOfDirectorDocument.tsx
1411
- var documentTypes$2 = [{
1412
- id: "Internal company document",
1413
- name: "internalCompanyDocument"
1414
- }, {
1415
- id: "Business registry statement",
1416
- name: "businessRegistryStatement"
1417
- }];
1418
- var GuidanceContent$4 = ({ t }) => {
1419
- return /* @__PURE__ */ jsx("div", {
1420
- className: "adyen-kyc-upload-field__guidance",
1421
- children: /* @__PURE__ */ jsxs("div", {
1422
- className: "u-margin-bottom-24",
1423
- children: [/* @__PURE__ */ jsx("strong", { children: t(($) => $["documentRequirements"], { ns: "common" }) }), /* @__PURE__ */ jsxs("ul", { children: [
1424
- /* @__PURE__ */ jsx("li", { children: t(($) => $["includesTheDirectorsFullName"], { ns: "business" }) }),
1425
- /* @__PURE__ */ jsx("li", { children: t(($) => $["includesEvidenceOfTheIndividualsRole"], { ns: "business" }) }),
1426
- /* @__PURE__ */ jsx("li", { children: t(($) => $["issuedOrSignedByALegalRepresentative"], { ns: "business" }) })
1427
- ] })]
1428
- })
1429
- });
1430
- };
1431
- function ProofOfDirectorDocument({ id, country, ...props }) {
1432
- const { t } = useTranslation(["common", "business"]);
1433
- const [selectedDocumentName, setSelectedDocumentName] = useState$1(documentTypes$2[0].id);
1434
- return /* @__PURE__ */ jsx(MemoizedDocumentUpload, {
1435
- ...props,
1436
- id,
1437
- heading: t(($) => $["uploadYourOrganizationProofOfDirector"], { ns: "business" }),
1438
- description: t(($) => $["weNeedAnOfficialDocument"], { ns: "business" }),
1439
- documentField: "proofOfDirector",
1440
- documentType: "proofOfDirector",
1441
- guidanceContent: /* @__PURE__ */ jsx(GuidanceContent$4, { t }),
1442
- country,
1443
- hidePageCount: true,
1444
- documentTypeSelect: {
1445
- selectedType: selectedDocumentName,
1446
- setSelectedType: setSelectedDocumentName,
1447
- options: documentTypes$2
1448
- }
1449
- });
1450
- }
1451
- //#endregion
1452
- //#region src/components/Business/forms/ProofOfOwnershipDocument/ProofOfOwnershipDocument.tsx
1453
- var DOC_TYPE_FOR_MULTI_UPLOAD = "Organizational chart and supporting document";
1454
- var documentTypes$1 = [{
1455
- id: "Certified Organizational chart",
1456
- name: "certifiedOrganizationalChart"
1457
- }, {
1458
- id: "Organizational chart and supporting document",
1459
- name: "organizationalChartAndSupportingDocument"
1460
- }];
1461
- var GuidanceContent$3 = ({ selectedDocumentName, t }) => {
1462
- const [showGuidanceModal, setShowGuidanceModal] = useState$1(false);
1463
- return /* @__PURE__ */ jsx("div", {
1464
- className: "adyen-kyc-upload-field__guidance",
1465
- children: /* @__PURE__ */ jsxs("div", {
1466
- className: "u-margin-bottom-24",
1467
- children: [
1468
- /* @__PURE__ */ jsx("strong", { children: t(($) => $["documentRequirements"], { ns: "common" }) }),
1469
- selectedDocumentName === "Certified Organizational chart" ? /* @__PURE__ */ jsxs("ul", { children: [
1470
- /* @__PURE__ */ jsx("li", { children: t(($) => $["showsOwnershipAndControllingRelations"], { ns: "business" }) }),
1471
- /* @__PURE__ */ jsx("li", { children: t(($) => $["entitiesMustIncludeANameLegalStructureAndCountryRegionOfRegistration"], { ns: "business" }) }),
1472
- /* @__PURE__ */ jsx("li", { children: t(($) => $["signedByALawyerAccountantAuditorWithinTheLast6Months"], { ns: "business" }) })
1473
- ] }) : /* @__PURE__ */ jsxs("ul", { children: [/* @__PURE__ */ jsx("li", { children: t(($) => $["oneOrganizationalChartShowingOwnershipAndControllingRelations"], { ns: "business" }) }), /* @__PURE__ */ jsxs("ul", { children: [/* @__PURE__ */ jsx("li", { children: t(($) => $["entitiesMustIncludeANameLegalStructureAndCountryRegionOfRegistration"], { ns: "business" }) }), /* @__PURE__ */ jsxs("li", { children: [
1474
- /* @__PURE__ */ jsxs("span", { children: [t(($) => $["one"], { ns: "common" }), " "] }),
1475
- /* @__PURE__ */ jsx(Button, {
1476
- onClick: () => setShowGuidanceModal(true),
1477
- variant: "link",
1478
- children: t(($) => $["supportingDocument"], { ns: "common" })
1479
- }),
1480
- /* @__PURE__ */ jsxs("span", { children: [" ", t(($) => $["describingTheOrganizationAndItsUBOSignedWithinTheLast6Months"], { ns: "business" })] })
1481
- ] })] })] }),
1482
- showGuidanceModal && /* @__PURE__ */ jsx(Modal, {
1483
- size: "small",
1484
- onClose: () => setShowGuidanceModal(false),
1485
- ariaLabel: t(($) => $["whichDocumentsQualifyToProveOwnership"], { ns: "business" }),
1486
- children: /* @__PURE__ */ jsxs(ModalContent, { children: [
1487
- /* @__PURE__ */ jsx(Typography, {
1488
- el: "h1",
1489
- variant: "title-l",
1490
- className: "u-margin-bottom-32 u-margin-top-32",
1491
- children: t(($) => $["whichDocumentsQualifyToProveOwnership"], { ns: "business" })
1492
- }),
1493
- /* @__PURE__ */ jsx(Typography, {
1494
- el: "p",
1495
- variant: "body",
1496
- children: t(($) => $["theDocumentsWeCanAcceptToProveOwnershipAre"], { ns: "business" })
1497
- }),
1498
- /* @__PURE__ */ jsxs("ul", { children: [
1499
- /* @__PURE__ */ jsx("li", { children: t(($) => $["securitiesRegister"], { ns: "business" }) }),
1500
- /* @__PURE__ */ jsx("li", { children: t(($) => $["shareholderRegister"], { ns: "business" }) }),
1501
- /* @__PURE__ */ jsx("li", { children: t(($) => $["ultimateBeneficialOwnerRegister"], { ns: "business" }) }),
1502
- /* @__PURE__ */ jsx("li", { children: t(($) => $["articlesOfIncorporation"], { ns: "business" }) }),
1503
- /* @__PURE__ */ jsx("li", { children: t(($) => $["annualReports"], { ns: "business" }) }),
1504
- /* @__PURE__ */ jsx("li", { children: t(($) => $["annualReturns"], { ns: "business" }) }),
1505
- /* @__PURE__ */ jsx("li", { children: t(($) => $["certificateOfCorporateStatus"], { ns: "business" }) }),
1506
- /* @__PURE__ */ jsx("li", { children: t(($) => $["shareholderAgreements"], { ns: "business" }) }),
1507
- /* @__PURE__ */ jsx("li", { children: t(($) => $["assignmentAgreements"], { ns: "business" }) }),
1508
- /* @__PURE__ */ jsx("li", { children: t(($) => $["partnershipAgreements"], { ns: "business" }) }),
1509
- /* @__PURE__ */ jsx("li", { children: t(($) => $["boardOfDirectorsMeetingRecords"], { ns: "business" }) }),
1510
- /* @__PURE__ */ jsx("li", { children: t(($) => $["registrationDocument"], { ns: "business" }) }),
1511
- /* @__PURE__ */ jsx("li", { children: t(($) => $["certificateOfIncumbency"], { ns: "business" }) })
1512
- ] })
1513
- ] })
1514
- })
1515
- ]
1516
- })
1517
- });
1518
- };
1519
- function ProofOfOwnershipDocument({ id, country, ...props }) {
1520
- const { t } = useTranslation(["common", "business"]);
1521
- const [selectedDocumentName, setSelectedDocumentName] = useState$1(documentTypes$1[0].id);
1522
- const supportsMultiple = selectedDocumentName === DOC_TYPE_FOR_MULTI_UPLOAD;
1523
- useEffect$1(() => {
1524
- if (props.data?.proofOfOwnership?.length === 2) setSelectedDocumentName(DOC_TYPE_FOR_MULTI_UPLOAD);
1525
- }, [props.data?.proofOfOwnership]);
1526
- return /* @__PURE__ */ jsx(MemoizedDocumentUpload, {
1527
- ...props,
1528
- id,
1529
- heading: t(($) => $["uploadYourOrganizationProofOfOwnership"], { ns: "business" }),
1530
- description: t(($) => $["weNeedAnOfficialDocumentForOwnership"], { ns: "business" }),
1531
- documentField: "proofOfOwnership",
1532
- documentType: "proofOfOwnership",
1533
- guidanceContent: /* @__PURE__ */ jsx(GuidanceContent$3, {
1534
- selectedDocumentName,
1535
- t
1536
- }),
1537
- country,
1538
- label: t(($) => $["uploadYourDocuments"], { ns: "business" }),
1539
- documentTypeSelect: {
1540
- selectedType: selectedDocumentName,
1541
- setSelectedType: setSelectedDocumentName,
1542
- options: documentTypes$1
1543
- },
1544
- hidePageCount: true,
1545
- supportsMultipleUploads: supportsMultiple,
1546
- maxNumberOfFiles: supportsMultiple ? 2 : 1,
1547
- extraDropzoneDescription: supportsMultiple ? t(($) => $["oneOrganizationalChartAndOneSupportingDocument"], { ns: "business" }) : void 0
1548
- });
1549
- }
1550
- //#endregion
1551
- //#region src/components/Business/forms/ProofOfSignatoryDocument/ProofOfSignatoryDocument.tsx
1552
- var documentTypes = [{
1553
- id: "Trade registry document",
1554
- name: "tradeRegistryDocument"
1555
- }, {
1556
- id: "Internal company document",
1557
- name: "internalCompanyDocument"
1558
- }];
1559
- var GuidanceContent$2 = ({ t }) => {
1560
- return /* @__PURE__ */ jsx("div", {
1561
- className: "adyen-kyc-upload-field__guidance",
1562
- children: /* @__PURE__ */ jsxs("div", {
1563
- className: "u-margin-bottom-24",
1564
- children: [/* @__PURE__ */ jsx("strong", { children: t(($) => $["documentRequirements"], { ns: "common" }) }), /* @__PURE__ */ jsxs("ul", { children: [
1565
- /* @__PURE__ */ jsx("li", { children: t(($) => $["includesTheSignatorysFullName"], { ns: "business" }) }),
1566
- /* @__PURE__ */ jsx("li", { children: t(($) => $["includesEvidenceOfTheIndividualsRoleSignatory"], { ns: "business" }) }),
1567
- /* @__PURE__ */ jsx("li", { children: t(($) => $["issuedOrSignedByALegalRepresentative"], { ns: "business" }) })
1568
- ] })]
1569
- })
1570
- });
1571
- };
1572
- function ProofOfSignatoryDocument({ id, country, ...props }) {
1573
- const { t } = useTranslation(["common", "business"]);
1574
- const [selectedDocumentName, setSelectedDocumentName] = useState$1(documentTypes[0].id);
1575
- return /* @__PURE__ */ jsx(MemoizedDocumentUpload, {
1576
- ...props,
1577
- id,
1578
- heading: t(($) => $["uploadYourOrganizationProofOfSignatory"], { ns: "business" }),
1579
- description: t(($) => $["weNeedAnOfficialDocumentSignatory"], { ns: "business" }),
1580
- documentField: "proofOfSignatory",
1581
- documentType: "proofOfSignatory",
1582
- guidanceContent: /* @__PURE__ */ jsx(GuidanceContent$2, { t }),
1583
- country,
1584
- hidePageCount: true,
1585
- documentTypeSelect: {
1586
- selectedType: selectedDocumentName,
1587
- setSelectedType: setSelectedDocumentName,
1588
- options: documentTypes
1589
- }
1590
- });
1591
- }
1592
- //#endregion
1593
- //#region src/components/Business/forms/RegistrationDocument/config.ts
1594
- var ACCEPTED_DOCUMENTS_MAP$1 = {
1595
- [CountryCodes.PuertoRico]: {
1596
- privateCompany: {
1597
- header: "acceptedDocumentsForPrivateCompanies",
1598
- documents: [
1599
- "certificateOfIncorporation",
1600
- "certificateOfFormation",
1601
- "secretaryOfStateFiling__PR"
1602
- ]
1603
- },
1604
- listedPublicCompany: {
1605
- header: "acceptedDocumentsForPublicCompanies",
1606
- documents: ["certificateOfIncorporation", "certificateOfFormation"]
1607
- },
1608
- unlistedPublicCompany: {
1609
- header: "acceptedDocumentsForPublicCompanies",
1610
- documents: ["certificateOfIncorporation", "certificateOfFormation"]
1611
- },
1612
- governmentalOrganization: {
1613
- header: "acceptedDocumentsForGovernment",
1614
- documents: ["charter"]
1615
- },
1616
- nonProfit: {
1617
- header: "acceptedDocumentsForNonProfit",
1618
- documents: [
1619
- "articlesOfIncorporation",
1620
- "meetingRecords",
1621
- "secretaryOfStateRegDoc__PR",
1622
- "certificateOfIncumbency"
1623
- ]
1624
- },
1625
- partnershipIncorporated: {
1626
- header: "acceptedDocumentsForPartnerships",
1627
- documents: ["partnerShipAgreement", "secretaryOfStateFiling__PR"]
1628
- }
1629
- },
1630
- [CountryCodes.UnitedStates]: {
1631
- privateCompany: {
1632
- header: "acceptedDocumentsForPrivateCompanies",
1633
- documents: [
1634
- "certificateOfIncorporation",
1635
- "certificateOfFormation",
1636
- "secretaryOfStateFiling"
1637
- ]
1638
- },
1639
- listedPublicCompany: {
1640
- header: "acceptedDocumentsForPublicCompanies",
1641
- documents: ["certificateOfIncorporation", "certificateOfFormation"]
1642
- },
1643
- unlistedPublicCompany: {
1644
- header: "acceptedDocumentsForPublicCompanies",
1645
- documents: ["certificateOfIncorporation", "certificateOfFormation"]
1646
- },
1647
- governmentalOrganization: {
1648
- header: "acceptedDocumentsForGovernment",
1649
- documents: ["charter"]
1650
- },
1651
- nonProfit: {
1652
- header: "acceptedDocumentsForNonProfit",
1653
- documents: [
1654
- "articlesOfIncorporation",
1655
- "meetingRecords",
1656
- "secretaryOfStateRegDoc",
1657
- "certificateOfIncumbency"
1658
- ]
1659
- },
1660
- partnershipIncorporated: {
1661
- header: "acceptedDocumentsForPartnerships",
1662
- documents: ["partnerShipAgreement", "secretaryOfStateFiling"]
1663
- }
1664
- }
1665
- };
1666
- //#endregion
1667
- //#region src/components/Business/forms/RegistrationDocument/RegistrationDocument.tsx
1668
- var GuidanceContent$1 = ({ country, companyType, t }) => {
1669
- const acceptedDocGuidance = ACCEPTED_DOCUMENTS_MAP$1[country]?.[companyType];
1670
- return /* @__PURE__ */ jsx("div", {
1671
- className: "adyen-kyc-upload-field__guidance",
1672
- children: country === "US" || country === "MX" ? /* @__PURE__ */ jsxs(Fragment$1, { children: [acceptedDocGuidance && /* @__PURE__ */ jsxs("div", {
1673
- className: "u-margin-bottom-24",
1674
- children: [/* @__PURE__ */ jsx("strong", { children: t(($) => $[acceptedDocGuidance.header], { ns: "business" }) }), /* @__PURE__ */ jsx("ul", { children: acceptedDocGuidance.documents.map((document, i) => /* @__PURE__ */ jsx("li", { children: t(($) => $[document], { ns: "business" }) }, i)) })]
1675
- }), /* @__PURE__ */ jsxs("div", {
1676
- className: "u-margin-bottom-24",
1677
- children: [/* @__PURE__ */ jsx("strong", { children: t(($) => $["documentRequirements"], { ns: "common" }) }), /* @__PURE__ */ jsx("ul", { children: /* @__PURE__ */ jsx("li", { children: t(($) => $["includesLegalCompanyName"], { ns: "business" }) }) })]
1678
- })] }) : /* @__PURE__ */ jsxs("div", {
1679
- className: "u-margin-bottom-24",
1680
- children: [/* @__PURE__ */ jsx("strong", { children: t(($) => $["documentRequirements"], { ns: "common" }) }), /* @__PURE__ */ jsx("ul", { children: /* @__PURE__ */ jsx("li", { children: t(($) => $["documentIssuedByGovernmentAuthority"], { ns: "business" }) }) })]
1681
- })
1682
- });
1683
- };
1684
- function RegistrationDocument({ id, country, companyType = "privateCompany", ...props }) {
1685
- const { t } = useTranslation(["common", "business"]);
1686
- const config = getLabelConfig(country);
1687
- return /* @__PURE__ */ jsx(MemoizedDocumentUpload, {
1688
- ...props,
1689
- id,
1690
- heading: t(($) => $[config.heading], { ns: "business" }),
1691
- description: t(($) => $["companyRegistrationDocumentFormDescription"], { ns: "business" }),
1692
- documentField: "registrationDocument",
1693
- documentType: "registrationDocument",
1694
- guidanceContent: /* @__PURE__ */ jsx(GuidanceContent$1, {
1695
- country,
1696
- companyType,
1697
- t
1698
- }),
1699
- companyType,
1700
- country,
1701
- hidePageCount: true
1702
- });
1703
- }
1704
- function getLabelConfig(country) {
1705
- switch (country) {
1706
- case "MX": return { heading: "uploadAConstanciaDeSituacionFiscalDocument" };
1707
- default: return { heading: "companyRegistrationDocumentFormHeading" };
1708
- }
1709
- }
1710
- //#endregion
1711
- //#region src/components/Business/forms/TaxDocument/config.ts
1712
- var ACCEPTED_DOCUMENTS_MAP = {
1713
- [CountryCodes.PuertoRico]: {
1714
- privateCompany: {
1715
- header: "acceptedDocumentsForPrivateCompanies",
1716
- documents: ["irsCP575"]
1717
- },
1718
- listedPublicCompany: {
1719
- header: "acceptedDocumentsForPublicCompanies",
1720
- documents: ["annualReport", "secForm10k"]
1721
- },
1722
- unlistedPublicCompany: {
1723
- header: "acceptedDocumentsForPublicCompanies",
1724
- documents: ["annualReport", "secForm10k"]
1725
- },
1726
- nonProfit: {
1727
- header: "acceptedDocumentsForNonProfit",
1728
- documents: ["annualReport"]
1729
- },
1730
- partnershipIncorporated: {
1731
- header: "acceptedDocumentsForPartnerships",
1732
- documents: ["irsScheduleK1"]
1733
- }
1734
- },
1735
- [CountryCodes.UnitedStates]: {
1736
- privateCompany: {
1737
- header: "acceptedDocumentsForPrivateCompanies",
1738
- documents: ["irsCP575"]
1739
- },
1740
- listedPublicCompany: {
1741
- header: "acceptedDocumentsForPublicCompanies",
1742
- documents: ["annualReport", "secForm10k"]
1743
- },
1744
- unlistedPublicCompany: {
1745
- header: "acceptedDocumentsForPublicCompanies",
1746
- documents: ["annualReport", "secForm10k"]
1747
- },
1748
- nonProfit: {
1749
- header: "acceptedDocumentsForNonProfit",
1750
- documents: ["annualReport"]
1751
- },
1752
- partnershipIncorporated: {
1753
- header: "acceptedDocumentsForPartnerships",
1754
- documents: ["irsScheduleK1"]
1755
- }
1756
- }
1757
- };
1758
- //#endregion
1759
- //#region src/components/Business/forms/TaxDocument/TaxDocument.tsx
1760
- var GuidanceContent = ({ country, companyType }) => {
1761
- const { t } = useTranslation(["common", "business"]);
1762
- const acceptedDocGuidance = ACCEPTED_DOCUMENTS_MAP[country]?.[companyType];
1763
- return /* @__PURE__ */ jsx("div", {
1764
- className: "adyen-kyc-upload-field__guidance",
1765
- children: country === "US" ? /* @__PURE__ */ jsxs(Fragment$1, { children: [acceptedDocGuidance && /* @__PURE__ */ jsxs("div", {
1766
- className: "u-margin-bottom-24",
1767
- children: [/* @__PURE__ */ jsx("strong", { children: t(($) => $[acceptedDocGuidance.header], { ns: "business" }) }), /* @__PURE__ */ jsx("ul", { children: acceptedDocGuidance.documents.map((document, i) => /* @__PURE__ */ jsx("li", { children: t(($) => $[document], { ns: "business" }) }, i)) })]
1768
- }), /* @__PURE__ */ jsxs("div", {
1769
- className: "u-margin-bottom-24",
1770
- children: [/* @__PURE__ */ jsx("strong", { children: t(($) => $["documentRequirements"], { ns: "common" }) }), /* @__PURE__ */ jsxs("ul", { children: [/* @__PURE__ */ jsx("li", { children: t(($) => $["includesLegalCompanyName"], { ns: "business" }) }), /* @__PURE__ */ jsx("li", { children: t(($) => $["includesEIN"], { ns: "business" }) })] })]
1771
- })] }) : /* @__PURE__ */ jsxs("div", {
1772
- className: "u-margin-bottom-24",
1773
- children: [/* @__PURE__ */ jsx("div", {
1774
- className: "adyen-kyc-upload-field__subtitle",
1775
- children: t(($) => $["documentRequirements"], { ns: "common" })
1776
- }), /* @__PURE__ */ jsxs("ul", { children: [
1777
- /* @__PURE__ */ jsx("li", { children: t(($) => $["containsNameOfCompany"], { ns: "business" }) }),
1778
- /* @__PURE__ */ jsx("li", { children: t(($) => $["documentShowsTaxIdOfCompany"], { ns: "business" }) }),
1779
- /* @__PURE__ */ jsx("li", { children: t(($) => $["issuedByTheTaxAuthority"], { ns: "business" }) })
1780
- ] })]
1781
- })
1782
- });
1783
- };
1784
- function TaxDocument({ id, country, companyType = "privateCompany", ...props }) {
1785
- const { t } = useTranslation("business");
1786
- return /* @__PURE__ */ jsx(MemoizedDocumentUpload, {
1787
- ...props,
1788
- id,
1789
- heading: t(($) => $["companyTaxDocumentFormHeading"]),
1790
- description: t(($) => $["companyTaxDocumentFormDescription"]),
1791
- documentField: "taxDocument",
1792
- documentType: "proofOfOrganizationTaxInfo",
1793
- guidanceContent: /* @__PURE__ */ jsx(GuidanceContent, {
1794
- country,
1795
- companyType
1796
- }),
1797
- companyType,
1798
- country,
1799
- hidePageCount: true
1800
- });
1801
- }
1802
- //#endregion
1803
- //#region src/components/Business/forms/BusinessDetails/BusinessDetails.tsx
1804
- var VatDocument = ({ children }) => {
1805
- return children;
1806
- };
1807
- var EMPTY_OBJ$1 = {};
1808
- function BusinessDetails({ taskType, country, activeForm, shouldValidate, problems = EMPTY_OBJ$1, isTopLevelEntity }) {
1809
- const { t } = useTranslation(["common", "business"]);
1810
- const { form } = useFormContext();
1811
- const companyType = taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY ? "soleProprietorship" : form.data.companyStructure?.entityType;
1812
- function handleChange(formName, fieldName, mode) {
1813
- return form.handleChangeFor(formName, fieldName, mode);
1814
- }
1815
- const renderActiveForm = (activeForm) => {
1816
- switch (activeForm.formId) {
1817
- case "basicInformation": return /* @__PURE__ */ jsx(BasicInformation, {
1818
- id: activeForm.formId,
1819
- country,
1820
- shouldValidate,
1821
- fieldValidationErrors: problems.validationErrors?.[activeForm.formId],
1822
- formVerificationErrors: problems.verificationErrors?.[activeForm.formId],
1823
- companyType,
1824
- isTopLevelEntity,
1825
- disableCountry: taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY,
1826
- taskType
1827
- });
1828
- case "businessSelection": return /* @__PURE__ */ jsx(BusinessSelection, {
1829
- id: activeForm.formId,
1830
- country,
1831
- shouldValidate,
1832
- fieldValidationErrors: problems.validationErrors?.[activeForm.formId],
1833
- formVerificationErrors: problems.verificationErrors?.[activeForm.formId]
1834
- });
1835
- case "companyStructure": return /* @__PURE__ */ jsx(CompanyStructure, {
1836
- id: activeForm.formId,
1837
- country,
1838
- shouldValidate,
1839
- fieldValidationErrors: problems.validationErrors?.[activeForm.formId],
1840
- formVerificationErrors: problems.verificationErrors?.[activeForm.formId]
1841
- });
1842
- case "additionalInformation": return /* @__PURE__ */ jsx(AdditionalInformation, {
1843
- id: activeForm.formId,
1844
- country,
1845
- companyType,
1846
- shouldValidate,
1847
- fieldValidationErrors: problems.validationErrors?.[activeForm.formId],
1848
- formVerificationErrors: problems.verificationErrors?.[activeForm.formId]
1849
- });
1850
- case "companyTaxDocument": return country === "US" ? /* @__PURE__ */ jsx(TaxDocument, {
1851
- id: activeForm.formId,
1852
- country,
1853
- companyType,
1854
- shouldValidate,
1855
- fieldValidationErrors: problems.validationErrors?.[activeForm.formId] ?? {},
1856
- formVerificationErrors: problems.verificationErrors?.[activeForm.formId] ?? {},
1857
- data: form.data.companyTaxDocument,
1858
- errors: form.errors.companyTaxDocument,
1859
- valid: form.valid.companyTaxDocument,
1860
- allFields: form.allFields?.companyTaxDocument,
1861
- requiredFields: form.requiredFields?.companyTaxDocument,
1862
- optionalFields: form.optionalFields?.companyTaxDocument,
1863
- trustedFields: form.trustedFields?.companyTaxDocument,
1864
- handleFieldChange: (fieldName) => handleChange("companyTaxDocument", fieldName)
1865
- }) : /* @__PURE__ */ jsx(VatDocument, { children: /* @__PURE__ */ jsx(MemoizedDocumentUpload, {
1866
- id: activeForm.formId,
1867
- country,
1868
- companyType,
1869
- shouldValidate,
1870
- heading: t(($) => $["companyTaxDocumentFormHeading"], { ns: "business" }),
1871
- description: t(($) => $["companyTaxDocumentFormDescription"], { ns: "business" }),
1872
- fieldValidationErrors: problems.validationErrors?.[activeForm.formId] ?? {},
1873
- formVerificationErrors: problems.verificationErrors?.[activeForm.formId] ?? {},
1874
- data: form.data.companyTaxDocument,
1875
- errors: form.errors.companyTaxDocument,
1876
- valid: form.valid.companyTaxDocument,
1877
- allFields: form.allFields?.companyTaxDocument,
1878
- requiredFields: form.requiredFields?.companyTaxDocument,
1879
- optionalFields: form.optionalFields?.companyTaxDocument,
1880
- trustedFields: form.trustedFields?.companyTaxDocument,
1881
- handleFieldChange: (fieldName) => handleChange("companyTaxDocument", fieldName),
1882
- documentField: "taxDocument",
1883
- documentType: "vatDocument",
1884
- hidePageCount: true,
1885
- guidanceContent: /* @__PURE__ */ jsxs("div", {
1886
- className: "u-margin-bottom-24",
1887
- children: [/* @__PURE__ */ jsxs("div", {
1888
- className: "adyen-kyc-upload-field__subtitle",
1889
- children: [" ", t(($) => $["requirements"], { ns: "common" })]
1890
- }), /* @__PURE__ */ jsxs("ul", { children: [
1891
- /* @__PURE__ */ jsx("li", { children: t(($) => $["containsNameOfCompany"], { ns: "business" }) }),
1892
- /* @__PURE__ */ jsx("li", { children: t(($) => $["documentShowsTaxIdOfCompany"], { ns: "business" }) }),
1893
- /* @__PURE__ */ jsx("li", { children: t(($) => $["issuedByTheTaxAuthority"], { ns: "business" }) })
1894
- ] })]
1895
- })
1896
- }) });
1897
- case "companyRegistrationDocument": return /* @__PURE__ */ jsx(RegistrationDocument, {
1898
- id: activeForm.formId,
1899
- country,
1900
- companyType,
1901
- data: form.data.companyRegistrationDocument,
1902
- errors: form.errors.companyRegistrationDocument,
1903
- valid: form.valid.companyRegistrationDocument,
1904
- allFields: form.allFields?.companyRegistrationDocument,
1905
- requiredFields: form.requiredFields?.companyRegistrationDocument,
1906
- optionalFields: form.optionalFields?.companyRegistrationDocument,
1907
- trustedFields: form.trustedFields?.companyRegistrationDocument,
1908
- handleFieldChange: (fieldName) => handleChange("companyRegistrationDocument", fieldName),
1909
- shouldValidate,
1910
- fieldValidationErrors: problems.validationErrors?.[activeForm.formId] ?? {},
1911
- formVerificationErrors: problems.verificationErrors?.[activeForm.formId] ?? {}
1912
- });
1913
- case "companyProofOfDirectorDocument": return /* @__PURE__ */ jsx(ProofOfDirectorDocument, {
1914
- id: activeForm.formId,
1915
- country,
1916
- data: form.data.companyProofOfDirectorDocument,
1917
- errors: form.errors.companyProofOfDirectorDocument,
1918
- valid: form.valid.companyProofOfDirectorDocument,
1919
- allFields: form.allFields?.companyProofOfDirectorDocument,
1920
- requiredFields: form.requiredFields?.companyProofOfDirectorDocument,
1921
- optionalFields: form.optionalFields?.companyProofOfDirectorDocument,
1922
- trustedFields: form.trustedFields?.companyProofOfDirectorDocument,
1923
- handleFieldChange: (fieldName) => handleChange("companyProofOfDirectorDocument", fieldName),
1924
- shouldValidate,
1925
- fieldValidationErrors: problems.validationErrors?.[activeForm.formId] ?? {},
1926
- formVerificationErrors: problems.verificationErrors?.[activeForm.formId] ?? {}
1927
- });
1928
- case "companyProofOfSignatoryDocument": return /* @__PURE__ */ jsx(ProofOfSignatoryDocument, {
1929
- id: activeForm.formId,
1930
- country,
1931
- data: form.data.companyProofOfSignatoryDocument,
1932
- errors: form.errors.companyProofOfSignatoryDocument,
1933
- valid: form.valid.companyProofOfSignatoryDocument,
1934
- allFields: form.allFields?.companyProofOfSignatoryDocument,
1935
- requiredFields: form.requiredFields?.companyProofOfSignatoryDocument,
1936
- optionalFields: form.optionalFields?.companyProofOfSignatoryDocument,
1937
- trustedFields: form.trustedFields?.companyProofOfSignatoryDocument,
1938
- handleFieldChange: (fieldName) => handleChange("companyProofOfSignatoryDocument", fieldName),
1939
- shouldValidate,
1940
- fieldValidationErrors: problems.validationErrors?.[activeForm.formId] ?? {},
1941
- formVerificationErrors: problems.verificationErrors?.[activeForm.formId] ?? {}
1942
- });
1943
- case "companyProofOfAddressDocument": return /* @__PURE__ */ jsx(ProofOfAddressDocument, {
1944
- id: activeForm.formId,
1945
- country,
1946
- data: form.data.companyProofOfAddressDocument,
1947
- errors: form.errors.companyProofOfAddressDocument,
1948
- valid: form.valid.companyProofOfAddressDocument,
1949
- allFields: form.allFields?.companyProofOfAddressDocument,
1950
- requiredFields: form.requiredFields?.companyProofOfAddressDocument,
1951
- optionalFields: form.optionalFields?.companyProofOfAddressDocument,
1952
- trustedFields: form.trustedFields?.companyProofOfAddressDocument,
1953
- handleFieldChange: (fieldName) => handleChange("companyProofOfAddressDocument", fieldName),
1954
- shouldValidate,
1955
- fieldValidationErrors: problems.validationErrors?.[activeForm.formId] ?? {},
1956
- formVerificationErrors: problems.verificationErrors?.[activeForm.formId] ?? {}
1957
- });
1958
- case "companyProofOfOwnershipDocument": return /* @__PURE__ */ jsx(ProofOfOwnershipDocument, {
1959
- id: activeForm.formId,
1960
- country,
1961
- data: form.data.companyProofOfOwnershipDocument,
1962
- errors: form.errors.companyProofOfOwnershipDocument,
1963
- valid: form.valid.companyProofOfOwnershipDocument,
1964
- allFields: form.allFields?.companyProofOfOwnershipDocument,
1965
- requiredFields: form.requiredFields?.companyProofOfOwnershipDocument,
1966
- optionalFields: form.optionalFields?.companyProofOfOwnershipDocument,
1967
- trustedFields: form.trustedFields?.companyProofOfOwnershipDocument,
1968
- handleFieldChange: (fieldName) => handleChange("companyProofOfOwnershipDocument", fieldName),
1969
- shouldValidate,
1970
- fieldValidationErrors: problems.validationErrors?.[activeForm.formId] ?? {},
1971
- formVerificationErrors: problems.verificationErrors?.[activeForm.formId] ?? {}
1972
- });
1973
- case "companyConstitutionalDocument": return /* @__PURE__ */ jsx(MemoizedConstitutionalDocument, {
1974
- id: activeForm.formId,
1975
- legalEntityType: LegalEntityTypes.SOLE_PROPRIETORSHIP,
1976
- country,
1977
- data: form.data.companyConstitutionalDocument,
1978
- errors: form.errors.companyConstitutionalDocument,
1979
- valid: form.valid.companyConstitutionalDocument,
1980
- allFields: form.allFields?.companyConstitutionalDocument,
1981
- requiredFields: form.requiredFields?.companyConstitutionalDocument,
1982
- optionalFields: form.optionalFields?.companyConstitutionalDocument,
1983
- trustedFields: form.trustedFields?.companyConstitutionalDocument,
1984
- handleFieldChange: (fieldName) => handleChange("companyConstitutionalDocument", fieldName),
1985
- shouldValidate,
1986
- fieldValidationErrors: problems.validationErrors?.[activeForm.formId] ?? {},
1987
- formVerificationErrors: problems.verificationErrors?.[activeForm.formId] ?? {}
1988
- });
1989
- case "companyFinancialInformation": return /* @__PURE__ */ jsx(FinancialInformation, {
1990
- id: activeForm.formId,
1991
- country,
1992
- shouldValidate,
1993
- fieldValidationErrors: problems.validationErrors?.[activeForm.formId] ?? {},
1994
- formVerificationErrors: problems.verificationErrors?.[activeForm.formId] ?? {}
1995
- });
1996
- default: return null;
1997
- }
1998
- };
1999
- return /* @__PURE__ */ jsx("div", { children: renderActiveForm(activeForm) });
2000
- }
2001
- //#endregion
2002
- //#region src/components/Business/forms/CompanyStructure/validate.ts
2003
- var CompanyStructureValidation = { entityType: {
2004
- modes: ["blur"],
2005
- validate: (entityType) => !isEmpty(entityType),
2006
- errorMessage: "fieldIsRequired"
2007
- } };
2008
- //#endregion
2009
- //#region src/components/Shared/fields/Currency/fieldConfig.ts
2010
- var currencyMetadata = { validators: {
2011
- modes: ["blur"],
2012
- validate: (currency) => !isEmpty(currency),
2013
- errorMessage: "fieldIsRequired"
2014
- } };
2015
- //#endregion
2016
- //#region src/components/Shared/fields/FinancialReportingDate/fieldConfig.ts
2017
- var financialReportingDateMetadata = { validators: [{
2018
- modes: ["blur"],
2019
- validate: (date) => !isEmpty(date),
2020
- errorMessage: "fieldIsRequired"
2021
- }, {
2022
- modes: ["blur"],
2023
- validate: (date) => date ? new Date(date) < /* @__PURE__ */ new Date() : false,
2024
- errorMessage: "invalidFinancialReportingDate"
2025
- }] };
2026
- //#endregion
2027
- //#region src/components/Shared/fields/NumberOfEmployees/fieldConfig.ts
2028
- var numberOfEmployeesMetadata = { validators: [{
2029
- modes: ["blur"],
2030
- validate: (numberOfEmployees) => !isEmpty(numberOfEmployees),
2031
- errorMessage: "fieldIsRequired"
2032
- }, {
2033
- modes: ["blur"],
2034
- validate: (numberOfEmployees) => Number.isInteger(Number(numberOfEmployees)) && Number(numberOfEmployees) > 0,
2035
- errorMessage: "pleaseEnterAValidWholeNumber"
2036
- }] };
2037
- //#endregion
2038
- //#region src/components/Business/forms/FinancialInformation/validate.ts
2039
- var financialInfoValidationRules = {
2040
- financialReportingDate: financialReportingDateMetadata.validators,
2041
- currency: currencyMetadata.validators,
2042
- reportedValueOption: { validators: {
2043
- modes: ["blur"],
2044
- validate: (option) => !isEmpty(option),
2045
- errorMessage: "fieldIsRequired"
2046
- } }.validators,
2047
- balanceSheetTotal: { validators: {
2048
- modes: ["blur"],
2049
- validate: (amount) => !isUndefinedOrNull(amount),
2050
- errorMessage: "fieldIsRequired"
2051
- } }.validators,
2052
- annualTurnover: { validators: {
2053
- modes: ["blur"],
2054
- validate: (amount) => !isUndefinedOrNull(amount),
2055
- errorMessage: "fieldIsRequired"
2056
- } }.validators
2057
- };
2058
- var financialInfoValidationEmployeesOnlyRules = { numberOfEmployees: numberOfEmployeesMetadata.validators };
2059
- var financialInfoValidationWithEmployeesRules = {
2060
- ...financialInfoValidationRules,
2061
- ...financialInfoValidationEmployeesOnlyRules
2062
- };
2063
- //#endregion
2064
- //#region src/components/Business/forms/rules.constants.ts
2065
- var COUNTRIES_REQUIRING_E_INVOICING_CODE = [CountryCodes.Italy];
2066
- var ORGANIZATION_COUNTRIES_REQUIRING_DATE_OF_INCORPORATION = [
2067
- CountryCodes.HongKong,
2068
- CountryCodes.Singapore,
2069
- CountryCodes.India,
2070
- CountryCodes.Japan,
2071
- CountryCodes.UnitedArabEmirates
2072
- ];
2073
- var COUNTRIES_THAT_USES_UEN_OR_GST = [CountryCodes.Singapore];
2074
- //#endregion
2075
- //#region src/components/Business/forms/rules.ts
2076
- var rules = ({ data, defaultData, verifiedBusiness, country, taskType, isFeatureEnabled = () => false, isSettingEnabled = () => false, getSetting = () => void 0, accountHolder, rootLegalEntity, tinMatched }) => {
2077
- const countryRequiresDateOfIncorporationForCompanies = () => {
2078
- switch (taskType) {
2079
- case "SOLE_PROPRIETOR_COMPANY": return LEGAL_ARRANGEMENT_COUNTRIES_REQUIRING_DATE_OF_INCORPORATION.includes(country) ? "REQUIRED" : void 0;
2080
- default: return ORGANIZATION_COUNTRIES_REQUIRING_DATE_OF_INCORPORATION.includes(country) ? "REQUIRED" : void 0;
2081
- }
2082
- };
2083
- const countryRequiresFinancialInformation = () => {
2084
- const isFinancialInformationFeatureEnabled = isFeatureEnabled("EnableFinancialInformationComponentV4");
2085
- const leType = rootLegalEntity?.type;
2086
- return isFinancialInformationRequired(isFinancialInformationFeatureEnabled, taskType, country, rootLegalEntity?.capabilities, leType);
2087
- };
2088
- const hasFinancialInformation = (financialInformation) => {
2089
- if (!financialInformation) return false;
2090
- return financialInformation.numberOfEmployees != null || Boolean(financialInformation.financialReportingDate) || Boolean(financialInformation.currency) || financialInformation.balanceSheetTotal != null || financialInformation.annualTurnover != null;
2091
- };
2092
- const addressFieldRule = (field, isOperational) => {
2093
- if (isOperational && data.additionalInformation?.operationalAddressIsSame) return void 0;
2094
- if (field === "country") return "REQUIRED";
2095
- if (isJapanLocalizationEnabled(isFeatureEnabled, country)) {
2096
- if (field === "street") return "OPTIONAL";
2097
- return JP_ADDRESS_REQUIRED_FIELDS.includes(field) ? "REQUIRED" : "OPTIONAL";
2098
- }
2099
- if (!getAddressSchemaForCountry(country).includes(field)) return void 0;
2100
- if (field === "street2") return "OPTIONAL";
2101
- if (field === "stateOrProvince") return COUNTRIES_WITH_STATES_DATASET.includes(country) ? "REQUIRED" : void 0;
2102
- return "REQUIRED";
2103
- };
2104
- return createFormRules({
2105
- requireDoingBusinessAsName: () => {
2106
- return data.additionalInformation?.hasDoingBusinessAs ? "REQUIRED" : void 0;
2107
- },
2108
- countryRequiresStateOrProvince: () => {
2109
- if (COUNTRIES_WITH_STATES_DATASET.includes(country)) return "REQUIRED";
2110
- },
2111
- ifPubliclyTradedCompany: () => {
2112
- if (data.companyStructure?.entityType === "listedPublicCompany") return "REQUIRED";
2113
- },
2114
- countryUsesVat: () => {
2115
- if (!COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT.includes(country)) return data.additionalInformation?.exemptedFromVat ? "OPTIONAL" : "REQUIRED";
2116
- },
2117
- vatNumberType: () => {
2118
- if (!COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT.includes(country)) return "OPTIONAL";
2119
- },
2120
- isVatExempt: () => {
2121
- if (!COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT.includes(country)) return data.additionalInformation?.exemptedFromVat ? "REQUIRED" : "OPTIONAL";
2122
- },
2123
- countryUsesTaxId: () => {
2124
- const requiredUnlessExempt = Boolean(data.basicInformation?.exemptedFromTax) ? "OPTIONAL" : "REQUIRED";
2125
- const usesTaxIdInsteadOfVat = COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT.includes(country);
2126
- if (rootLegalEntity?.type === "organization" && keysOf(rootLegalEntity.capabilities ?? {}).includes("issueBankAccount")) {
2127
- if (TAX_ID_REQUIRED_COUNTRIES_ORGANIZATION.includes(country)) return requiredUnlessExempt;
2128
- if (country === CountryCodes.Italy && data.basicInformation?.registrationNumberType === "CCIAA") return requiredUnlessExempt;
2129
- }
2130
- if (taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY && COUNTRIES_THAT_DO_NOT_USE_TAX_ID_FOR_SOLE_PROP.includes(country)) return;
2131
- return usesTaxIdInsteadOfVat ? requiredUnlessExempt : void 0;
2132
- },
2133
- companyRegistrationNumberExemptionAllowed: () => {
2134
- const isExemptFromRegistrationNumber = Boolean(data.basicInformation?.exemptedFromRegistrationNumber);
2135
- if (taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY) {
2136
- if (!COUNTRIES_WITH_POSSIBLE_REGISTRATION_EXEMPTIONS_FOR_SOLE_PROPS.includes(country)) return;
2137
- return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
2138
- }
2139
- if (!isRegistrationExemptionAllowed(country)) return;
2140
- const companyType = data.companyStructure?.entityType;
2141
- const allowedTypes = REGISTRATION_NUMBER_EXEMPTION_RULES[country];
2142
- if (allowedTypes.length > 0 && companyType && !allowedTypes.includes(companyType)) return;
2143
- /**
2144
- * Country-specific guard checks before applying the shared exemption rule result.
2145
- *
2146
- * - HK first enforces the legacy registration-number presence guard for existing entities.
2147
- * - AU/NZ then enforce the absent-state V4 feature flag gate.
2148
- */
2149
- switch (country) {
2150
- case CountryCodes.HongKong:
2151
- if (!defaultData?.basicInformation?.registrationNumber) return;
2152
- return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
2153
- case CountryCodes.Australia:
2154
- case CountryCodes.NewZealand:
2155
- if (!isFeatureEnabled("EnableRegistrationAndTaxAbsentStatesV4")) return;
2156
- return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
2157
- default: return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
2158
- }
2159
- },
2160
- countryOfGoverningLawRequired: () => {
2161
- if (isFeatureEnabled("EnableCountryOfGoverningLawForUKCompanies") && COUNTRY_OF_GOVERNING_LAW_POSSIBLE.includes(data.basicInformation?.country)) return "REQUIRED";
2162
- },
2163
- countryRequiresRegistrationNumber: () => {
2164
- const isExemptFromRegistrationNumber = Boolean(data.basicInformation?.exemptedFromRegistrationNumber);
2165
- switch (taskType) {
2166
- case TaskTypes.SOLE_PROPRIETOR_COMPANY:
2167
- if (COUNTRIES_THAT_DONT_REQUIRE_SOLE_PROP_REGISTRATION.includes(country)) return;
2168
- if (COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER_SOLE_PROPS.includes(country)) return "OPTIONAL";
2169
- return isExemptFromRegistrationNumber ? "OPTIONAL" : "REQUIRED";
2170
- default:
2171
- if (COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER.includes(country)) return "OPTIONAL";
2172
- if (country === CountryCodes.HongKong) {
2173
- if (!defaultData?.basicInformation?.registrationNumber) return;
2174
- return isExemptFromRegistrationNumber ? "OPTIONAL" : "REQUIRED";
2175
- }
2176
- if (!COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION.includes(country)) return isExemptFromRegistrationNumber ? void 0 : "REQUIRED";
2177
- }
2178
- },
2179
- registrationNumberType: () => {
2180
- switch (taskType) {
2181
- case TaskTypes.SOLE_PROPRIETOR_COMPANY:
2182
- if (COUNTRIES_THAT_DONT_REQUIRE_SOLE_PROP_REGISTRATION.includes(country)) return;
2183
- return "OPTIONAL";
2184
- default:
2185
- if (COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER.includes(country)) return "OPTIONAL";
2186
- if (COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION.includes(country)) return;
2187
- return "OPTIONAL";
2188
- }
2189
- },
2190
- countryUsesUenOrGst: () => {
2191
- if (taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY) return;
2192
- if (COUNTRIES_THAT_USES_UEN_OR_GST.includes(country)) return "REQUIRED";
2193
- },
2194
- countryHasTaxExemptions: () => {
2195
- const isExemptFromTax = Boolean(data.basicInformation?.exemptedFromTax);
2196
- switch (taskType) {
2197
- case TaskTypes.SOLE_PROPRIETOR_COMPANY:
2198
- if (!COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_SOLE_PROPS.includes(country)) return;
2199
- return isExemptFromTax ? "REQUIRED" : "OPTIONAL";
2200
- default:
2201
- if (isFeatureEnabled("EnableRegistrationAndTaxAbsentStatesV4") && COUNTRIES_WITH_POSSIBLE_TRUSTEE_TAXID_ABSENT_V4.includes(country) && accountHolder === "aTrust") return isExemptFromTax ? "REQUIRED" : "OPTIONAL";
2202
- if (COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_COMPANIES.includes(country)) return isExemptFromTax ? "REQUIRED" : "OPTIONAL";
2203
- }
2204
- },
2205
- usingCompanySearch: () => {
2206
- if (isUsingCompanySearch(country, taskType)) return "REQUIRED";
2207
- },
2208
- requireStateOrProvinceForCompanySearch: () => {
2209
- if (isUsingCompanySearch(country, taskType) && COUNTRIES_WITH_STATES_DATASET.includes(country)) return "REQUIRED";
2210
- },
2211
- countryRequiresFinancialInformation,
2212
- isDateOfIncorporationRequired: () => {
2213
- return countryRequiresDateOfIncorporationForCompanies() || countryRequiresFinancialInformation();
2214
- },
2215
- isFinancialReportingFieldsRequired: () => {
2216
- if (countryRequiresFinancialInformation() !== "REQUIRED") return;
2217
- if (isDateOlderThanAYear(data.additionalInformation?.dateOfIncorporation)) return "REQUIRED";
2218
- /**
2219
- * MultiForm recalculates required/optional schemas when rules change and reindexes form state
2220
- * against those schemas. If these financial fields are not included, provider-applied values can
2221
- * be pruned and appear to reset. Keeping them OPTIONAL by default when the feature is enabled
2222
- * (instead of undefined) preserves existing values in the form while still avoiding hard validation
2223
- * requirements when provider data is partial.
2224
- */
2225
- if (hasFinancialInformation(verifiedBusiness?.financialInformation) || hasFinancialInformation(data.companyFinancialInformation)) return "OPTIONAL";
2226
- },
2227
- isIndustryCodeRequired: () => {
2228
- return isSettingEnabled(SettingNames.AllowBusinessLines) ? "REQUIRED" : void 0;
2229
- },
2230
- annualTurnoverRequired: () => {
2231
- if (data.companyFinancialInformation?.reportedValueOption === "annualTurnover") return "REQUIRED";
2232
- },
2233
- balanceSheetTotalRequired: () => {
2234
- if (data.companyFinancialInformation?.reportedValueOption === "balanceSheetTotal") return "REQUIRED";
2235
- },
2236
- isResidentialAddressIndicatorEnabled: () => {
2237
- if (isFeatureEnabled("EnableResidentialAddressIndicator")) return "OPTIONAL";
2238
- },
2239
- isEInvoicingCodeEnabled: () => {
2240
- if (isFeatureEnabled("EnableEInvoicingCodeField") && COUNTRIES_REQUIRING_E_INVOICING_CODE.includes(country)) return "REQUIRED";
2241
- },
2242
- isTaxDocumentRequired: () => {
2243
- if (tinMatched === false && country === CountryCodes.UnitedStates) return "REQUIRED";
2244
- },
2245
- isRegistrationDocumentRequired: () => {
2246
- if (getSetting("merchantType") === "direct" && country === CountryCodes.Mexico) return "REQUIRED";
2247
- },
2248
- businessRequiresCompanyType: () => {
2249
- if (taskType !== TaskTypes.SOLE_PROPRIETOR_COMPANY) return "REQUIRED";
2250
- },
2251
- japaneseLegalCompanyName: () => {
2252
- if (isJapanLocalizationEnabled(isFeatureEnabled, country)) return "REQUIRED";
2253
- },
2254
- requireLEI: () => {
2255
- if (!isFeatureEnabled("EnableLegalEntityIdentifierField") || taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY) return;
2256
- return data.additionalInformation?.exemptedFromLegalEntityIdentifier ? "OPTIONAL" : "REQUIRED";
2257
- },
2258
- requireLEIExemption: () => {
2259
- if (!isFeatureEnabled("EnableLegalEntityIdentifierField") || taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY) return;
2260
- return data.additionalInformation?.exemptedFromLegalEntityIdentifier ? "REQUIRED" : "OPTIONAL";
2261
- },
2262
- registrationAddressStreetRequired: () => addressFieldRule("street", false),
2263
- registrationAddressStreet2Required: () => addressFieldRule("street2", false),
2264
- registrationAddressCityRequired: () => addressFieldRule("city", false),
2265
- registrationAddressPostalCodeRequired: () => addressFieldRule("postalCode", false),
2266
- registrationAddressStateOrProvinceRequired: () => addressFieldRule("stateOrProvince", false),
2267
- registrationAddressCountryRequired: () => addressFieldRule("country", false),
2268
- operationalAddressStreetRequired: () => addressFieldRule("street", true),
2269
- operationalAddressStreet2Required: () => addressFieldRule("street2", true),
2270
- operationalAddressCityRequired: () => addressFieldRule("city", true),
2271
- operationalAddressPostalCodeRequired: () => addressFieldRule("postalCode", true),
2272
- operationalAddressStateOrProvinceRequired: () => addressFieldRule("stateOrProvince", true),
2273
- operationalAddressCountryRequired: () => addressFieldRule("country", true),
2274
- /** Localized */
2275
- /** JP */
2276
- registrationAddressJaHaniStateOrProvinceRequired: () => addressFieldRule("jaHaniStateOrProvince", false),
2277
- registrationAddressJaHaniCityRequired: () => addressFieldRule("jaHaniCity", false),
2278
- registrationAddressJaHaniStreetRequired: () => addressFieldRule("jaHaniStreet", false),
2279
- registrationAddressJaKanaStateOrProvinceRequired: () => addressFieldRule("jaKanaStateOrProvince", false),
2280
- registrationAddressJaKanaCityRequired: () => addressFieldRule("jaKanaCity", false),
2281
- registrationAddressStreet2FullWidthRequired: () => addressFieldRule("street2FullWidth", false),
2282
- operationalAddressJaHaniStateOrProvinceRequired: () => addressFieldRule("jaHaniStateOrProvince", true),
2283
- operationalAddressJaHaniCityRequired: () => addressFieldRule("jaHaniCity", true),
2284
- operationalAddressJaHaniStreetRequired: () => addressFieldRule("jaHaniStreet", true),
2285
- operationalAddressJaKanaStateOrProvinceRequired: () => addressFieldRule("jaKanaStateOrProvince", true),
2286
- operationalAddressJaKanaCityRequired: () => addressFieldRule("jaKanaCity", true),
2287
- operationalAddressStreet2FullWidthRequired: () => addressFieldRule("street2FullWidth", true)
2288
- });
2289
- };
2290
- //#endregion
2291
- //#region src/utils/stripWhitespace.ts
2292
- var stripWhitespace = (str) => str.replace(/\s/g, "");
2293
- //#endregion
2294
- //#region src/utils/toNormalizedString.ts
2295
- var toNormalizedString = (s) => stripWhitespace(s.toLowerCase());
2296
- //#endregion
2297
- //#region src/utils/isNormalizedStringMatch.ts
2298
- var isNormalizedStringMatch = (s1, s2) => toNormalizedString(s1) === toNormalizedString(s2);
2299
- //#endregion
2300
- //#region src/components/Business/hooks/useCompanySearchNextClickOverrides.ts
2301
- function useCompanySearchNextClickOverrides({ country, multiForm, companySearchStateModel, getRequiredForms, skipBusinessSelection, setLoadingStatus, isTinMatched, tinMismatchModalOpen, legalArrangementModalOpen, registrationNumberMismatchModalOpen }) {
2302
- const { baseUrl, rootLegalEntityId } = useApiContext();
2303
- const userEvents = useAnalyticsContext();
2304
- const queryClient = useQueryClient();
2305
- const { mutateAsync: selectCompany } = useCompanySelection();
2306
- const { mutateAsync: clearCompanyData } = useClearCompanyData();
2307
- const logger = createLogger();
2308
- const getInferredRegistrationNumberType = () => {
2309
- const selectedCompany = companySearchStateModel.selectedCompany.peek();
2310
- if (country === CountryCodes.UnitedStates || !selectedCompany?.registrationNumber) return;
2311
- return inferCompanyRegistrationNumberType(selectedCompany.registrationNumber, country, selectedCompany.companyType);
2312
- };
2313
- const isVerificationFailed = () => country === CountryCodes.UnitedStates ? !companySearchStateModel.verificationMatched.value : companySearchStateModel.verificationMatched.value === false;
2314
- /**
2315
- * Returns `null` for non-navs, such as showing the TIN mismatch model for 0 or 1 results
2316
- */
2317
- const attemptBusinessSearch = async () => {
2318
- const formsWithoutSearchResults = getRequiredForms({ skipBusinessSelection: true });
2319
- if (!multiForm.data.basicInformation?.legalCompanyName) return formsWithoutSearchResults;
2320
- setLoadingStatus("loading");
2321
- companySearchStateModel.resetCompanySearchData();
2322
- let searchResponse = {
2323
- results: [],
2324
- provider: "NO_PROVIDER"
2325
- };
2326
- try {
2327
- companySearchStateModel.companySearchName.value = multiForm.data.basicInformation?.legalCompanyName;
2328
- const companySearchInput = {
2329
- name: multiForm.data.basicInformation?.legalCompanyName,
2330
- country: multiForm.data.basicInformation?.country,
2331
- state: multiForm.data.basicInformation?.stateOrProvince,
2332
- registrationNumber: multiForm.data.basicInformation?.registrationNumber
2333
- };
2334
- searchResponse = await trackPerformance("companySearch", () => queryClient.fetchQuery(companySearchQueryOptions(rootLegalEntityId.peek(), baseUrl.peek(), companySearchInput, userEvents)), userEvents);
2335
- } catch (e) {
2336
- logger.error(e);
2337
- setLoadingStatus("error");
2338
- return formsWithoutSearchResults;
2339
- }
2340
- const tin = multiForm.data.basicInformation?.taxInformation?.find((taxId) => taxId.country === country)?.number ?? "";
2341
- const registrationNumber = multiForm.data.basicInformation?.registrationNumber ?? "";
2342
- skipBusinessSelection.value = searchResponse.results.length === 0;
2343
- const currentForms = getRequiredForms({ skipBusinessSelection: skipBusinessSelection.peek() });
2344
- switch (searchResponse.results.length) {
2345
- case 0:
2346
- if (country === CountryCodes.UnitedStates) try {
2347
- const verifyTinQueryInput = {
2348
- name: multiForm.data.basicInformation?.legalCompanyName,
2349
- tin
2350
- };
2351
- const tinVerificationResponse = await queryClient.fetchQuery(verifyTinQueryOptions(rootLegalEntityId.peek(), baseUrl.peek(), verifyTinQueryInput, userEvents));
2352
- setLoadingStatus("success");
2353
- const tinMatched = !!tinVerificationResponse.matched;
2354
- companySearchStateModel.setVerificationMatched(tinMatched);
2355
- if (companySearchStateModel.verificationMatched.value) return currentForms;
2356
- tinMismatchModalOpen.value = true;
2357
- return null;
2358
- } catch (e) {
2359
- logger.error(e);
2360
- setLoadingStatus("error");
2361
- return currentForms;
2362
- }
2363
- setLoadingStatus("success");
2364
- return currentForms;
2365
- case 1:
2366
- if (!isNormalizedStringMatch(multiForm.data.basicInformation?.legalCompanyName, searchResponse.results[0].name)) {
2367
- setLoadingStatus("success");
2368
- return currentForms;
2369
- }
2370
- try {
2371
- const companySelectionResponse = await selectCompany({
2372
- state: multiForm.data.basicInformation?.stateOrProvince,
2373
- name: multiForm.data.basicInformation?.legalCompanyName,
2374
- tin,
2375
- registrationNumber,
2376
- id: searchResponse.results[0].resultId,
2377
- country
2378
- });
2379
- companySearchStateModel.selectCompany(companySelectionResponse, -1, country);
2380
- setLoadingStatus("success");
2381
- if (isVerificationFailed()) {
2382
- await clearCompanyData();
2383
- return currentForms;
2384
- } else {
2385
- companySearchStateModel.confirmCompany(multiForm, country);
2386
- skipBusinessSelection.value = true;
2387
- return getRequiredForms({
2388
- skipBusinessSelection: skipBusinessSelection.peek(),
2389
- skipCompanyStructure: !!companySearchStateModel.verifiedBusiness.value?.legalForm || !!getInferredRegistrationNumberType()
2390
- });
2391
- }
2392
- } catch (e) {
2393
- logger.error(e);
2394
- setLoadingStatus("error");
2395
- await clearCompanyData();
2396
- return formsWithoutSearchResults;
2397
- }
2398
- default:
2399
- setLoadingStatus("success");
2400
- return currentForms;
2401
- }
2402
- };
2403
- const confirmBusinessSelection = async () => {
2404
- const selectedBusinessId = multiForm.data.businessSelection.selectedBusinessId;
2405
- if (companySearchStateModel.disallowedSelectionReason.value) {
2406
- switch (companySearchStateModel.disallowedSelectionReason.value) {
2407
- case "LEGAL_ARRANGEMENT":
2408
- legalArrangementModalOpen.value = true;
2409
- break;
2410
- default:
2411
- logger.error("Unhandled disallowed selection reason");
2412
- break;
2413
- }
2414
- return null;
2415
- }
2416
- switch (selectedBusinessId) {
2417
- case "notListed":
2418
- if (country === CountryCodes.UnitedStates && isVerificationFailed()) isTinMatched.value = false;
2419
- return getRequiredForms({});
2420
- default:
2421
- switch (country) {
2422
- case CountryCodes.UnitedStates:
2423
- if (isVerificationFailed()) {
2424
- tinMismatchModalOpen.value = true;
2425
- return null;
2426
- }
2427
- break;
2428
- default:
2429
- if (isVerificationFailed()) {
2430
- registrationNumberMismatchModalOpen.value = true;
2431
- return null;
2432
- }
2433
- break;
2434
- }
2435
- companySearchStateModel.confirmCompany(multiForm, country);
2436
- return getRequiredForms({ skipCompanyStructure: !!companySearchStateModel.verifiedBusiness.value?.legalForm || !!getInferredRegistrationNumberType() });
2437
- }
2438
- };
2439
- return {
2440
- attemptBusinessSearch,
2441
- confirmBusinessSelection
2442
- };
2443
- }
2444
- //#endregion
2445
- //#region src/components/Business/hooks/usePrefetchCompanySearch.ts
2446
- var getRootElement = () => {
2447
- const onboardingWC = document.querySelector("adyen-onboarding");
2448
- return (onboardingWC && onboardingWC?.shadowRoot) ?? document;
2449
- };
2450
- var getRelatedFields = (country) => {
2451
- const baseFields = [
2452
- "legalCompanyName",
2453
- "country",
2454
- "registrationNumber"
2455
- ];
2456
- switch (country) {
2457
- case "US": return baseFields.concat(["stateOrProvince"]);
2458
- default: return baseFields;
2459
- }
2460
- };
2461
- function usePrefetchCompanySearch({ country, multiForm, activeFormId, isUsingCompanySearch }) {
2462
- const queryClient = useQueryClient();
2463
- const { baseUrl, rootLegalEntityId } = useApiContext();
2464
- const userEvents = useAnalyticsContext();
2465
- const debouncedCompanySearchPrefetch = useDebouncedCallback(useCallback$1(async () => {
2466
- const root = getRootElement(), activeElementName = (root.activeElement && root.activeElement.getAttribute("name")) ?? "";
2467
- const fieldNames = getRelatedFields(country);
2468
- let allRelatedFieldsAreValid = true, noRelatedFieldsAreFocused = true;
2469
- for (const fieldName of fieldNames) {
2470
- if (multiForm.valid.basicInformation?.[fieldName] === false) allRelatedFieldsAreValid = false;
2471
- if (activeElementName && activeElementName === fieldName) noRelatedFieldsAreFocused = false;
2472
- }
2473
- if (!allRelatedFieldsAreValid || !noRelatedFieldsAreFocused) return;
2474
- const companySearchInput = {
2475
- name: multiForm.data.basicInformation?.legalCompanyName ?? "",
2476
- country: multiForm.data.basicInformation?.country,
2477
- state: multiForm.data.basicInformation?.stateOrProvince,
2478
- registrationNumber: multiForm.data.basicInformation?.registrationNumber
2479
- };
2480
- await queryClient.prefetchQuery(companySearchQueryOptions(rootLegalEntityId.peek(), baseUrl.peek(), companySearchInput, userEvents));
2481
- }, [
2482
- baseUrl,
2483
- country,
2484
- multiForm.data.basicInformation?.country,
2485
- multiForm.data.basicInformation?.legalCompanyName,
2486
- multiForm.data.basicInformation?.registrationNumber,
2487
- multiForm.data.basicInformation?.stateOrProvince,
2488
- multiForm.valid.basicInformation,
2489
- queryClient,
2490
- rootLegalEntityId,
2491
- userEvents
2492
- ]), 500);
2493
- /**
2494
- * Re-fires prefetch when fields lose focus, with extra filtering within
2495
- * the handler to determine whether the search should continue after being debounced.
2496
- */
2497
- useEffect$1(() => {
2498
- const prefetch = () => {
2499
- if (activeFormId !== "basicInformation" || !isUsingCompanySearch) return;
2500
- debouncedCompanySearchPrefetch();
2501
- };
2502
- const root = getRootElement();
2503
- root.addEventListener("focusout", prefetch);
2504
- return () => root.removeEventListener("focusout", prefetch);
2505
- }, [
2506
- activeFormId,
2507
- debouncedCompanySearchPrefetch,
2508
- isUsingCompanySearch
2509
- ]);
2510
- }
2511
- //#endregion
2512
- //#region src/core/utils.ts
2513
- var adjustFormData = (oldFormData, newFormData) => {
2514
- return Array.from(new Set([...keysOf(oldFormData), ...keysOf(newFormData)]).keys()).reduce((acc, key) => {
2515
- const oldValue = oldFormData[key];
2516
- const newValue = newFormData[key];
2517
- if (!isUndefinedOrNull(newValue)) return {
2518
- ...acc,
2519
- [key]: newValue
2520
- };
2521
- if (Array.isArray(oldValue)) return {
2522
- ...acc,
2523
- [key]: []
2524
- };
2525
- if (typeof oldValue === "number") return {
2526
- ...acc,
2527
- [key]: null
2528
- };
2529
- if (typeof oldValue === "string") return {
2530
- ...acc,
2531
- [key]: ""
2532
- };
2533
- return {
2534
- ...acc,
2535
- [key]: ""
2536
- };
2537
- }, {});
2538
- };
2539
- /**
2540
- * Set fields on the schema which have been removed to the appropriate "deleted" value.
2541
- *
2542
- * E.g. removed `string` fields are set to `""`, removed `number`s to `null`.
2543
- *
2544
- * Doesn't mutate the original object.
2545
- *
2546
- * @param newData - actual form data submitted from the frontend
2547
- * @param existingData - `Schema`-fied version of the existing LE data we got from the BE
2548
- * @returns filtered data
2549
- */
2550
- var setRemovedFieldsOnSchemaToDeletedValue = (newData, existingData) => {
2551
- return Array.from(new Set([...keysOf(existingData), ...keysOf(newData)]).keys()).reduce((adjusted, formId) => {
2552
- const oldFormData = existingData[formId];
2553
- const newFormData = newData[formId];
2554
- if (isUndefinedOrNull(oldFormData)) return {
2555
- ...adjusted,
2556
- [formId]: newFormData
2557
- };
2558
- if (isUndefinedOrNull(newFormData)) return adjusted;
2559
- return {
2560
- ...adjusted,
2561
- [formId]: adjustFormData(oldFormData, newFormData)
2562
- };
2563
- }, {});
2564
- };
2565
- //#endregion
2566
- //#region src/components/Business/mapping/businessDetails/businessBankAccountTaxIdUtils.ts
2567
- var BUSINESS_BANK_ACCOUNT_TAX_ID_COUNTRIES = [
2568
- CountryCodes.Estonia,
2569
- CountryCodes.Finland,
2570
- CountryCodes.France,
2571
- CountryCodes.Italy,
2572
- CountryCodes.Latvia,
2573
- CountryCodes.Lithuania,
2574
- CountryCodes.Portugal,
2575
- CountryCodes.Spain
2576
- ];
2577
- /**
2578
- * Italian registration number subtypes that are NOT valid Codice Fiscale and therefore
2579
- * cannot be reused as `taxInformation`. Users who select these must provide a Tax ID
2580
- * (Codice Fiscale) separately.
2581
- */
2582
- var IT_REGISTRATION_TYPES_WITHOUT_TAX_ID_REUSE = ["CCIAA"];
2583
- /**
2584
- * Checks if a country requires business bank account tax ID validation
2585
- * @param country - The country code to check
2586
- * @returns true if the country requires business bank account tax ID, false otherwise
2587
- */
2588
- var isBusinessBankAccountTaxIdCountry = (country) => {
2589
- return country ? BUSINESS_BANK_ACCOUNT_TAX_ID_COUNTRIES.includes(country) : false;
2590
- };
2591
- /**
2592
- * Whether the entered `registrationNumber` should be reused as `taxInformation`
2593
- * for a business bank account (see `isBusinessBankAccountTaxIdCountry`).
2594
- *
2595
- * For most countries this is equivalent to {@link isBusinessBankAccountTaxIdCountry}.
2596
- * Italy has an additional constraint: the CCIAA number is not a valid Codice Fiscale,
2597
- * so it must not be reused as `taxInformation`.
2598
- */
2599
- var shouldReuseRegistrationNumberAsTaxId = (country, registrationNumberType) => {
2600
- if (!isBusinessBankAccountTaxIdCountry(country)) return false;
2601
- if (country === CountryCodes.Italy && registrationNumberType) return !IT_REGISTRATION_TYPES_WITHOUT_TAX_ID_REUSE.includes(registrationNumberType);
2602
- return true;
2603
- };
2604
- //#endregion
2605
- //#region src/components/Business/mapping/businessDetails/mapBusinessDetailsSchemaToLegalEntity.ts
2606
- var mapBusinessDetailsDocumentToApiDocument = async (data, entityId) => {
2607
- const { companyRegistrationDocument, companyTaxDocument, companyProofOfDirectorDocument, companyConstitutionalDocument, companyProofOfSignatoryDocument, companyProofOfAddressDocument, companyProofOfOwnershipDocument, basicInformation } = data;
2608
- const taxDocumentType = COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT.includes(basicInformation?.country) ? "proofOfOrganizationTaxInfo" : "vatDocument";
2609
- return (await Promise.all([
2610
- createDocumentRequest({
2611
- entityId,
2612
- entityType: "legalEntity",
2613
- documentType: "registrationDocument",
2614
- description: companyRegistrationDocument?.description,
2615
- page1: companyRegistrationDocument?.registrationDocument?.[0]
2616
- }),
2617
- createDocumentRequest({
2618
- entityId,
2619
- entityType: "legalEntity",
2620
- documentType: taxDocumentType,
2621
- description: companyTaxDocument?.description,
2622
- page1: companyTaxDocument?.taxDocument?.[0]
2623
- }),
2624
- createDocumentRequest({
2625
- entityId,
2626
- entityType: "legalEntity",
2627
- documentType: "proofOfDirector",
2628
- description: companyProofOfDirectorDocument?.description,
2629
- page1: companyProofOfDirectorDocument?.proofOfDirector?.[0]
2630
- }),
2631
- createDocumentRequest({
2632
- entityId,
2633
- entityType: "legalEntity",
2634
- documentType: "constitutionalDocument",
2635
- description: companyConstitutionalDocument?.description,
2636
- page1: companyConstitutionalDocument?.constitutionalDocument?.[0]
2637
- }),
2638
- createDocumentRequest({
2639
- entityId,
2640
- entityType: "legalEntity",
2641
- documentType: "proofOfSignatory",
2642
- description: companyProofOfSignatoryDocument?.description,
2643
- page1: companyProofOfSignatoryDocument?.proofOfSignatory?.[0]
2644
- }),
2645
- createDocumentRequest({
2646
- entityId,
2647
- entityType: "legalEntity",
2648
- documentType: "proofOfOwnership",
2649
- description: companyProofOfOwnershipDocument?.description,
2650
- page1: companyProofOfOwnershipDocument?.proofOfOwnership?.[0],
2651
- page2: companyProofOfOwnershipDocument?.proofOfOwnership?.[1]
2652
- }),
2653
- createDocumentRequest({
2654
- entityId,
2655
- entityType: "legalEntity",
2656
- documentType: "proofOfAddress",
2657
- description: companyProofOfAddressDocument?.description,
2658
- page1: companyProofOfAddressDocument?.proofOfAddress?.[0]
2659
- })
2660
- ])).filter(Boolean);
2661
- };
2662
- var mapBusinessDetailsSchemaToLegalEntity = (data, accountHolder, isFeatureEnabled, taskType, matchingScenario, rootLegalEntity) => {
2663
- const isSoleProp = accountHolder === "mySoleProprietorName";
2664
- const requestObj = { ...formatObject(data, isSoleProp ? solePropBusinessDetailsApiKeyMapping : businessDetailsApiKeyMapping) };
2665
- delete requestObj.organization?.legalFormDescription;
2666
- const canSaveRegNumberAbsentState = isFeatureEnabled("EnableRegistrationAndTaxAbsentStatesV4") && isRegistrationNumberAbsentStateV4Scenario(data.basicInformation?.country, data.companyStructure?.entityType);
2667
- const [taxData, registrationNumber, registrationNumberType] = [
2668
- data.basicInformation?.taxInformation,
2669
- data.basicInformation?.registrationNumber,
2670
- data.basicInformation?.registrationNumberType
2671
- ];
2672
- const localization = mapJapaneseLegalNamesToLocalization(data.basicInformation ?? {});
2673
- const doingBusinessAs = data.additionalInformation?.doingBusinessAs ?? "";
2674
- const entityObject = isSoleProp ? requestObj.soleProprietorship : requestObj.organization;
2675
- if (entityObject) {
2676
- if (taxData) entityObject.taxInformation = taxData;
2677
- if (rootLegalEntity?.type === "organization" && keysOf(rootLegalEntity.capabilities ?? {}).includes("issueBankAccount") && matchingScenario?.includes(Scenarios.L) && registrationNumber && data.basicInformation?.country && shouldReuseRegistrationNumberAsTaxId(data.basicInformation?.country, registrationNumberType)) {
2678
- const taxCountry = data.basicInformation.country;
2679
- const privateCompanyTaxOptions = getTaxIdNumberOptions(taxCountry, "privateCompany");
2680
- entityObject.taxInformation = [{
2681
- country: taxCountry,
2682
- number: registrationNumber,
2683
- type: privateCompanyTaxOptions && privateCompanyTaxOptions.length > 0 ? privateCompanyTaxOptions[0]["id"] : ""
2684
- }];
2685
- }
2686
- if (isSoleProp && !!data.basicInformation?.country) entityObject.countryOfGoverningLaw = data.basicInformation.country;
2687
- if (taskType !== TaskTypes.BUSINESS_DETAILS && entityObject.vatAbsenceReason === "") entityObject.vatAbsenceReason = null;
2688
- if (registrationNumber) {
2689
- entityObject.registrationNumber = registrationNumber;
2690
- if (canSaveRegNumberAbsentState && !isSoleProp) entityObject.registrationNumberAbsent = false;
2691
- }
2692
- if (!isSoleProp && localization.length > 0) entityObject.localization = localization;
2693
- if (data.basicInformation?.exemptedFromRegistrationNumber && canSaveRegNumberAbsentState && !isSoleProp) entityObject.registrationNumberAbsent = data.basicInformation.exemptedFromRegistrationNumber;
2694
- if (data.additionalInformation?.vatAbsenceReason) entityObject.vatNumber = "";
2695
- if (isFeatureEnabled("EnableDoingBusinessAsNameV4")) {
2696
- if (typeof data.additionalInformation?.hasDoingBusinessAs !== "undefined") entityObject.doingBusinessAsAbsent = !data.additionalInformation.hasDoingBusinessAs;
2697
- } else {
2698
- entityObject.doingBusinessAs = doingBusinessAs || data.basicInformation?.legalCompanyName;
2699
- delete entityObject.doingBusinessAsAbsent;
2700
- }
2701
- if (!isFeatureEnabled("EnableResidentialAddressIndicator")) delete entityObject.residentialAddressIndicator;
2702
- if (data.additionalInformation?.operationalAddressIsSame && entityObject.principalPlaceOfBusiness) entityObject.principalPlaceOfBusiness = structuredClone(entityObject.registeredAddress);
2703
- const addressLocalizations = mapJpAddressSchemaToAddressLocalizations(nestAddressSchema("registrationAddress", data.additionalInformation));
2704
- if (addressLocalizations.length > 0) entityObject.registeredAddress.localization = addressLocalizations;
2705
- if (entityObject.principalPlaceOfBusiness?.localization) delete entityObject.principalPlaceOfBusiness?.localization;
2706
- if (entityObject.registeredAddress?.country && entityObject.registeredAddress?.stateOrProvince && !COUNTRIES_WITH_STATES_DATASET.includes(entityObject.registeredAddress?.country)) entityObject.registeredAddress.stateOrProvince = "";
2707
- if (!isEmpty$1(data.companyFinancialInformation)) entityObject.financialReports = [mapFinancialInformationToFinancialReport(data.companyFinancialInformation, data.additionalInformation?.dateOfIncorporation)];
2708
- }
2709
- requestObj.type = isSoleProp ? LegalEntityTypes.SOLE_PROPRIETORSHIP : LegalEntityTypes.ORGANIZATION;
2710
- if (entityObject?.registeredAddress.country === "US") delete entityObject.registrationNumber;
2711
- if (!canSaveRegNumberAbsentState && !isSoleProp) delete requestObj.organization?.registrationNumberAbsent;
2712
- return requestObj;
2713
- };
2714
- //#endregion
2715
- //#region src/components/Business/mapping/businessDetails/mapLegalEntityToBusinessDetailsSchema.ts
2716
- var mapApiDocumentToBusinessDetailsDocuments = (entityId) => {
2717
- const registrationDocument = getDocument(entityId, "registrationDocument");
2718
- const taxDocument = getDocument(entityId, "vatDocument") ?? getDocument(entityId, "proofOfOrganizationTaxInfo");
2719
- const proofOfDirector = getDocument(entityId, "proofOfDirector");
2720
- const proofOfSignatory = getDocument(entityId, "proofOfSignatory");
2721
- const proofOfOwnership = getDocuments(entityId, "proofOfOwnership");
2722
- const constitutionalDocument = getDocument(entityId, "constitutionalDocument");
2723
- const mergedProofOfOwnershipAttachments = proofOfOwnership.flatMap((doc) => doc.attachments);
2724
- return {
2725
- companyRegistrationDocument: registrationDocument ? { registrationDocument: [mapExistingFile(getPageName(registrationDocument))] } : void 0,
2726
- companyTaxDocument: taxDocument ? { taxDocument: [mapExistingFile(getPageName(taxDocument))] } : void 0,
2727
- companyProofOfDirectorDocument: proofOfDirector ? { proofOfDirector: [mapExistingFile(getPageName(proofOfDirector))] } : void 0,
2728
- companyProofOfSignatoryDocument: proofOfSignatory ? { proofOfSignatory: [mapExistingFile(getPageName(proofOfSignatory))] } : void 0,
2729
- companyProofOfOwnershipDocument: mergedProofOfOwnershipAttachments.length > 0 ? { proofOfOwnership: mergedProofOfOwnershipAttachments.map((attachment) => mapExistingFile(attachment.pageName ?? "")) } : void 0,
2730
- companyConstitutionalDocument: constitutionalDocument ? { constitutionalDocument: [mapExistingFile(getPageName(constitutionalDocument))] } : void 0
2731
- };
2732
- };
2733
- var mapBasicInformation = ({ data, legalEntity, taskType }) => {
2734
- if (!data || !data.country) return;
2735
- const companyType = legalEntity?.type === "organization" ? legalEntity.organization?.type : void 0;
2736
- const isUen = mapIsUen(data.taxInformation, data.registrationNumber, data.country);
2737
- const registrationNumberType = getDefaultRegistrationNumberType(data.registrationNumber, data.country, void 0);
2738
- const registrationNumberExemption = !data.registrationNumber && !!companyType && isRegistrationExemptionAllowed(data.country) && (() => {
2739
- const allowedEntityTypes = REGISTRATION_NUMBER_EXEMPTION_RULES[data.country];
2740
- return allowedEntityTypes.length === 0 || allowedEntityTypes.includes(companyType);
2741
- })() ? { exemptedFromRegistrationNumber: true } : {};
2742
- return isUsingCompanySearch(data.country, taskType) ? {
2743
- ...data,
2744
- registrationNumberType,
2745
- ...registrationNumberExemption,
2746
- ...isUen
2747
- } : entriesOf(data).reduce((acc, [field]) => {
2748
- if (!["stateOrProvince"].includes(field)) return {
2749
- ...acc,
2750
- [field]: data[field]
2751
- };
2752
- return acc;
2753
- }, {
2754
- registrationNumberType,
2755
- ...registrationNumberExemption,
2756
- ...isUen
2757
- });
2758
- };
2759
- var mapDbaName = (legalEntity) => {
2760
- const entity = legalEntity.type === "organization" ? legalEntity.organization : legalEntity.soleProprietorship;
2761
- const dbaName = {};
2762
- if (typeof entity?.doingBusinessAsAbsent !== "undefined") dbaName.hasDoingBusinessAs = !entity.doingBusinessAsAbsent;
2763
- else if (entity?.doingBusinessAs) dbaName.hasDoingBusinessAs = entity.doingBusinessAs !== (legalEntity.type === "organization" ? legalEntity.organization?.legalName : legalEntity.soleProprietorship?.name);
2764
- else dbaName.hasDoingBusinessAs = void 0;
2765
- if (legalEntity.organization?.doingBusinessAs) dbaName.doingBusinessAs = legalEntity.organization.doingBusinessAs;
2766
- return dbaName;
2767
- };
2768
- var mapIsUen = (taxInformation, registrationNumber, country) => {
2769
- const currentCountryTaxInfo = taxInformation?.find((taxInfo) => taxInfo.country === country);
2770
- if (!currentCountryTaxInfo || country !== "SG") return {};
2771
- return {
2772
- registrationNumber: currentCountryTaxInfo.type === "UEN" ? currentCountryTaxInfo.number : registrationNumber,
2773
- isUen: currentCountryTaxInfo.type === "UEN"
2774
- };
2775
- };
2776
- var applyLocalizedAddressFields = (data, prefix, localization) => {
2777
- const flatAddress = flattenAddressSchema(prefix, localization);
2778
- for (const field in flatAddress) {
2779
- if (flatAddress[field] === void 0) continue;
2780
- data[field] = flatAddress[field];
2781
- }
2782
- };
2783
- var mapAdditionalInformation = ({ data, legalEntity }) => {
2784
- if (!data) return;
2785
- const entity = legalEntity.type === "organization" ? legalEntity.organization : legalEntity.soleProprietorship;
2786
- const currentCountry = entity?.registeredAddress.country;
2787
- const dbaNameFields = mapDbaName(legalEntity);
2788
- const vatNumberType = getDefaultVatNumberType(entity?.vatNumber, currentCountry);
2789
- const operationalAddressIsSame = !(entity?.principalPlaceOfBusiness && !objectsDeepEqual(entity.principalPlaceOfBusiness, entity.registeredAddress));
2790
- if (entity?.registeredAddress.localization) applyLocalizedAddressFields(data, "registrationAddress", mapAddressLocalizationToJpAddressSchema(entity.registeredAddress.localization));
2791
- if (entity?.principalPlaceOfBusiness?.localization) applyLocalizedAddressFields(data, "operationalAddress", mapAddressLocalizationToJpAddressSchema(entity.principalPlaceOfBusiness.localization));
2792
- return {
2793
- ...entriesOf(data).reduce((acc, [field]) => ({
2794
- ...acc,
2795
- [field]: data[field]
2796
- }), {
2797
- operationalAddressIsSame,
2798
- vatNumberType
2799
- }),
2800
- ...dbaNameFields
2801
- };
2802
- };
2803
- var mapLegalEntityToBusinessDetailsSchema = ({ legalEntity, parentEntity, taskType, isFeatureEnabled }) => {
2804
- if (!legalEntity) return {};
2805
- const { companyRegistrationDocument, companyTaxDocument, companyProofOfDirectorDocument, companyProofOfSignatoryDocument, companyProofOfOwnershipDocument, companyConstitutionalDocument } = mapApiDocumentToBusinessDetailsDocuments(legalEntity.id);
2806
- const buildSolePropSchema = () => {
2807
- const solePropData = formatObject(legalEntity, solePropBusinessDetailsKeyMapping);
2808
- const country = solePropData.additionalInformation?.registrationAddressCountry ?? parentEntity?.individual?.residentialAddress.country;
2809
- if (legalEntity.soleProprietorship?.financialReports) solePropData.companyFinancialInformation = mapFinancialReportsToFinancialInformation(legalEntity.soleProprietorship.financialReports);
2810
- return {
2811
- ...solePropData,
2812
- basicInformation: {
2813
- ...solePropData.basicInformation,
2814
- country
2815
- },
2816
- companyConstitutionalDocument
2817
- };
2818
- };
2819
- const orgSchema = {
2820
- ...formatObject(legalEntity, businessDetailsKeyMapping),
2821
- businessSelection: {},
2822
- companyRegistrationDocument,
2823
- companyTaxDocument,
2824
- companyProofOfDirectorDocument,
2825
- companyProofOfSignatoryDocument,
2826
- companyProofOfOwnershipDocument,
2827
- companyFinancialInformation: {}
2828
- };
2829
- const businessDetailsSchema = legalEntity.type === "organization" ? orgSchema : buildSolePropSchema();
2830
- return entriesOf(businessDetailsSchema).reduce((componentData, [key]) => {
2831
- switch (key) {
2832
- case "basicInformation": return {
2833
- ...componentData,
2834
- [key]: {
2835
- ...mapBasicInformation({
2836
- data: businessDetailsSchema[key],
2837
- legalEntity,
2838
- taskType,
2839
- isFeatureEnabled
2840
- }),
2841
- ...mapLocalizationToJapaneseLegalNames(legalEntity?.organization?.localization)
2842
- }
2843
- };
2844
- case "businessSelection": return {
2845
- ...componentData,
2846
- [key]: { selectedBusinessId: "" }
2847
- };
2848
- case "companyStructure": return {
2849
- ...componentData,
2850
- [key]: { ...businessDetailsSchema[key] }
2851
- };
2852
- case "additionalInformation": return {
2853
- ...componentData,
2854
- [key]: mapAdditionalInformation({
2855
- data: businessDetailsSchema[key],
2856
- legalEntity
2857
- })
2858
- };
2859
- case "companyRegistrationDocument": return {
2860
- ...componentData,
2861
- [key]: businessDetailsSchema[key]
2862
- };
2863
- case "companyTaxDocument": return {
2864
- ...componentData,
2865
- [key]: businessDetailsSchema[key]
2866
- };
2867
- case "companyProofOfDirectorDocument": return {
2868
- ...componentData,
2869
- [key]: businessDetailsSchema[key]
2870
- };
2871
- case "companyProofOfSignatoryDocument": return {
2872
- ...componentData,
2873
- [key]: businessDetailsSchema[key]
2874
- };
2875
- case "companyProofOfOwnershipDocument": return {
2876
- ...componentData,
2877
- [key]: businessDetailsSchema[key]
2878
- };
2879
- case "companyConstitutionalDocument": return {
2880
- ...componentData,
2881
- [key]: businessDetailsSchema[key]
2882
- };
2883
- case "companyFinancialInformation": {
2884
- const financialReports = legalEntity.type === "organization" ? legalEntity.organization?.financialReports : legalEntity.soleProprietorship?.financialReports;
2885
- return financialReports?.length ? {
2886
- ...componentData,
2887
- [key]: mapFinancialReportsToFinancialInformation(financialReports)
2888
- } : componentData;
2889
- }
2890
- default: return componentData;
2891
- }
2892
- }, {});
2893
- };
2894
- //#endregion
2895
- //#region src/components/Business/hooks/useSubmitBusinessDetails.ts
2896
- function useSubmitBusinessDetails({ country, data, forms, legalEntityResponse, associatedLegalArrangement, nestedLegalEntity, nestedLegalEntityDetails, efpBusinessLines, taskType, problems, setProblems, setLoadingStatus, onExternalSubmit }) {
2897
- const { t } = useTranslation(["common", "business"]);
2898
- const { baseUrl, rootLegalEntityId } = useApiContext();
2899
- const userEvents = useAnalyticsContext();
2900
- const { accountHolder: accountHolderMaybe } = useAccountHolder();
2901
- const { showToast } = useToastContext();
2902
- const { isFeatureEnabled } = useToggleContext();
2903
- const { data: matchingScenario } = useScenarios(country, LegalEntityTypes.ORGANIZATION);
2904
- const { mutateAsync: createLegalEntity } = useCreateLegalEntity();
2905
- const { mutateAsync: updateLegalEntity } = useUpdateLegalEntity();
2906
- const { mutateAsync: createBusinessLine } = useCreateBusinessLine();
2907
- const { mutateAsync: updateBusinessLine } = useUpdateBusinessLine();
2908
- const invalidateRootLegalEntity = useInvalidateRootLegalEntity();
2909
- const documentUtils = documentApiUtils({
2910
- baseUrl: baseUrl.value,
2911
- rootLegalEntityId: rootLegalEntityId.value
2912
- });
2913
- return useCallback$1(async () => {
2914
- const accountHolder = accountHolderMaybe ?? "theCompanyIWorkFor";
2915
- const logger = createLogger();
2916
- setLoadingStatus("loading");
2917
- let trackingPayload = {
2918
- actionType: "submit",
2919
- companyStructure: data.companyStructure?.entityType,
2920
- countryOfRegistration: data.basicInformation?.country,
2921
- legalEntityName: accountHolder === "theCompanyIWorkFor" ? data.basicInformation?.legalCompanyName : void 0,
2922
- usedAdditionalAddress: !data.additionalInformation?.operationalAddressIsSame
2923
- };
2924
- /**
2925
- * Root entity is legalEntityResponse,
2926
- * Sole prop is associatedLegalArrangment and is undefined on initial creation
2927
- * Trust Member Company is nestedLegalEntity and is undefined on initial creation
2928
- */
2929
- const entityToUpdate = (() => {
2930
- switch (taskType) {
2931
- case TaskTypes.SOLE_PROPRIETOR_COMPANY: return associatedLegalArrangement;
2932
- case TaskTypes.TRUST_MEMBER_COMPANY:
2933
- case TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY: return nestedLegalEntity;
2934
- case TaskTypes.BUSINESS_DETAILS:
2935
- default: return legalEntityResponse;
2936
- }
2937
- })();
2938
- const handleSubmitLegalEntity = async (legalEntity) => {
2939
- if (taskType === TaskTypes.TRUST_MEMBER_COMPANY && !nestedLegalEntity?.id || taskType === TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY && !nestedLegalEntity?.id || taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY && !associatedLegalArrangement?.id) return await createLegalEntity(legalEntity);
2940
- else {
2941
- const { type: _type, ...rest } = legalEntity;
2942
- return updateLegalEntity({
2943
- ...rest,
2944
- id: entityToUpdate?.id ?? legalEntityResponse.id
2945
- });
2946
- }
2947
- };
2948
- const associateLegalEntityWithParent = async ({ legalEntity, associatedLegalArrangement, nestedLegalEntityDetails }) => {
2949
- if (nestedLegalEntityDetails && associatedLegalArrangement) {
2950
- const existingEntityAssociations = getOwnEntityAssociations(associatedLegalArrangement);
2951
- const existingRoles = existingEntityAssociations.filter((ea) => ea.legalEntityId === associatedLegalArrangement.id).map(({ type }) => type);
2952
- const newRoles = nestedLegalEntityDetails.roles;
2953
- if (!doArraysMatch(existingRoles, newRoles)) await updateLegalEntity({
2954
- id: associatedLegalArrangement.id,
2955
- entityAssociations: [...newRoles.map((role) => ({
2956
- type: role,
2957
- legalEntityId: legalEntity.id
2958
- })), ...existingEntityAssociations.filter((ea) => ea.legalEntityId !== legalEntity.id)]
2959
- });
2960
- return;
2961
- } else await updateLegalEntity({
2962
- entityAssociations: [{
2963
- type: LegalEntityTypes.SOLE_PROPRIETORSHIP,
2964
- legalEntityId: legalEntity.id
2965
- }],
2966
- id: legalEntityResponse.id
2967
- });
2968
- };
2969
- const filteredData = setRemovedFieldsOnSchemaToDeletedValue(data, mapLegalEntityToBusinessDetailsSchema({
2970
- legalEntity: entityToUpdate,
2971
- parentEntity: void 0,
2972
- taskType,
2973
- isFeatureEnabled
2974
- }));
2975
- if (filteredData.basicInformation && !filteredData.basicInformation.taxInformation) filteredData.basicInformation.taxInformation = void 0;
2976
- const countryOfGoverningLaw = getCountryOfGoverningLaw(isFeatureEnabled("EnableCountryOfGoverningLawForUKCompanies"), filteredData.basicInformation);
2977
- if (filteredData.basicInformation) if (countryOfGoverningLaw) filteredData.basicInformation.countryOfGoverningLaw = countryOfGoverningLaw;
2978
- else delete filteredData.basicInformation.countryOfGoverningLaw;
2979
- try {
2980
- const mappedLegalEntity = {
2981
- ...mapBusinessDetailsSchemaToLegalEntity(filteredData, accountHolder, isFeatureEnabled, taskType, matchingScenario, legalEntityResponse),
2982
- entityAssociations: filterOutUnwantedAssociationsIfRootLE(taskType, entityToUpdate, accountHolder)
2983
- };
2984
- if (mappedLegalEntity.type === LegalEntityTypes.ORGANIZATION && (legalEntityResponse.organization?.registeredAddress.country !== mappedLegalEntity.organization?.registeredAddress.country || legalEntityResponse.organization?.countryOfGoverningLaw !== mappedLegalEntity.organization?.countryOfGoverningLaw) && legalEntityResponse.organization?.support) mappedLegalEntity.organization.support = determineCustomerSupport(legalEntityResponse.organization.support, mappedLegalEntity.organization?.registeredAddress.country);
2985
- const legalEntity = await handleSubmitLegalEntity(mappedLegalEntity);
2986
- /**
2987
- * Sole prop only associated during initial creation but for
2988
- * trust member company, association can also be updated with changed roles
2989
- */
2990
- if (taskType === TaskTypes.TRUST_MEMBER_COMPANY || taskType === TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY || taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY && !associatedLegalArrangement?.id) await associateLegalEntityWithParent({
2991
- legalEntity,
2992
- associatedLegalArrangement,
2993
- nestedLegalEntityDetails
2994
- });
2995
- if (forms.some((form) => documentFormsIds.includes(form.formId))) await submitDocuments({
2996
- data,
2997
- legalEntity,
2998
- documentUtils,
2999
- userEvents
3000
- });
3001
- await submitBusinessLines({
3002
- data,
3003
- legalEntity: legalEntityResponse,
3004
- efpBusinessLines,
3005
- createBusinessLine,
3006
- updateBusinessLine,
3007
- matchingScenario,
3008
- t,
3009
- showToast
3010
- });
3011
- userEvents.addTaskEvent("Success", trackingPayload);
3012
- showToast({
3013
- label: t(($) => $["successfullyUpdatedDetails"], { ns: "common" }),
3014
- variant: "success"
3015
- });
3016
- await invalidateRootLegalEntity();
3017
- onExternalSubmit(data);
3018
- } catch (err) {
3019
- if (isValidationError(err)) {
3020
- const getErrors = processValidationErrors(err, TaskTypes.BUSINESS_DETAILS);
3021
- if (getErrors && !Object.keys(getErrors).length) {
3022
- showToast({
3023
- label: t(($) => $["failedToUpdateDetails"], { ns: "common" }),
3024
- variant: "error"
3025
- });
3026
- const unmappedErrorNames = err.invalidFields.map((field) => field.name).filter(Boolean);
3027
- if (unmappedErrorNames.length) trackingPayload = {
3028
- ...trackingPayload,
3029
- additionalData: { unmappedErrorNames }
3030
- };
3031
- } else setProblems({
3032
- ...problems,
3033
- validationErrors: getErrors
3034
- });
3035
- }
3036
- if (isMaintenanceModeError(err)) showToast({
3037
- label: t(($) => $["maintenanceModeMessage"], { ns: "common" }),
3038
- variant: "error",
3039
- duration: "indefinite"
3040
- });
3041
- if (!isValidationError(err) && !isMaintenanceModeError(err)) showToast({
3042
- label: t(($) => $["failedToUpdateDetails"], { ns: "common" }),
3043
- variant: "error"
3044
- });
3045
- logger.error(err);
3046
- userEvents.addTaskEvent("Encountered error", {
3047
- ...trackingPayload,
3048
- returnType: err?.errorCode,
3049
- returnValue: err?.title || "backend"
3050
- });
3051
- throw err;
3052
- } finally {
3053
- setLoadingStatus("success");
3054
- }
3055
- }, [
3056
- accountHolderMaybe,
3057
- associatedLegalArrangement,
3058
- createBusinessLine,
3059
- createLegalEntity,
3060
- data,
3061
- documentUtils,
3062
- efpBusinessLines,
3063
- forms,
3064
- invalidateRootLegalEntity,
3065
- isFeatureEnabled,
3066
- legalEntityResponse,
3067
- matchingScenario,
3068
- nestedLegalEntity,
3069
- nestedLegalEntityDetails,
3070
- onExternalSubmit,
3071
- problems,
3072
- setLoadingStatus,
3073
- setProblems,
3074
- showToast,
3075
- t,
3076
- taskType,
3077
- updateBusinessLine,
3078
- updateLegalEntity,
3079
- userEvents
3080
- ]);
3081
- }
3082
- async function submitDocuments({ data, legalEntity, documentUtils, userEvents }) {
3083
- const logger = createLogger();
3084
- const formattedDocument = await mapBusinessDetailsDocumentToApiDocument(data, legalEntity.id);
3085
- formattedDocument.forEach((doc) => {
3086
- const existingDoc = getDocument(legalEntity.id, doc.type);
3087
- if (doc.type === "proofOfOwnership" && existingDoc && doc.attachments?.length) doc.attachments = mergeProofOfOwnershipAttachments(existingDoc.attachments, doc.attachments).filter((attachment) => attachment.pageName);
3088
- });
3089
- try {
3090
- await documentUtils.uploadDocuments(formattedDocument, legalEntity.id);
3091
- formattedDocument.forEach((doc) => {
3092
- userEvents.addTaskEvent("Success", {
3093
- actionType: "upload",
3094
- documentType: doc.type,
3095
- fileExtention: doc.attachments?.map((item) => getFileExtention(item.pageName)).filter((item) => item !== void 0) ?? []
3096
- });
3097
- });
3098
- } catch (err) {
3099
- logger.error(err);
3100
- userEvents.addTaskEvent("Encountered error", {
3101
- actionType: "upload",
3102
- returnType: err.errorCode,
3103
- returnValue: err.title ?? err.message
3104
- });
3105
- }
3106
- }
3107
- async function submitBusinessLines({ data, legalEntity, efpBusinessLines, createBusinessLine, updateBusinessLine, matchingScenario, t, showToast }) {
3108
- const primaryIndustryCode = data.additionalInformation?.industryCodes && data.additionalInformation.industryCodes[0].id;
3109
- if (!primaryIndustryCode) return;
3110
- const logger = createLogger();
3111
- const bankingBusinessLines = [];
3112
- const issuingBusinessLines = [];
3113
- if (efpBusinessLines) for (const bl of efpBusinessLines) if (bl.service === "banking") bankingBusinessLines.push(bl);
3114
- else issuingBusinessLines.push(bl);
3115
- const promises = [];
3116
- const operations = [];
3117
- const updateOrCreateBusinessLinesIfNeeded = (businessLines, requestedCapability, service) => {
3118
- if (businessLines.length) for (const bl of businessLines) {
3119
- if (bl.industryCode === primaryIndustryCode) continue;
3120
- const payload = {
3121
- id: bl.id,
3122
- legalEntityId: legalEntity.id,
3123
- industryCode: primaryIndustryCode,
3124
- service
3125
- };
3126
- promises.push(updateBusinessLine(payload));
3127
- operations.push(payload);
3128
- }
3129
- else if (requestedCapability) {
3130
- const payload = {
3131
- legalEntityId: legalEntity.id,
3132
- industryCode: primaryIndustryCode,
3133
- service
3134
- };
3135
- promises.push(createBusinessLine(payload));
3136
- operations.push(payload);
3137
- }
3138
- };
3139
- updateOrCreateBusinessLinesIfNeeded(bankingBusinessLines, !!matchingScenario?.includes("L_BANKING"), "banking");
3140
- updateOrCreateBusinessLinesIfNeeded(issuingBusinessLines, !!matchingScenario?.includes("L_ISSUING"), "issuing");
3141
- let hadRejection = false;
3142
- (await Promise.allSettled(promises)).forEach((result, idx) => {
3143
- if (result.status !== "rejected") return;
3144
- const op = operations[idx];
3145
- logger.log(`Failed to ${op.id ? "update" : "create"} business line with payload: ${JSON.stringify(op)}`);
3146
- hadRejection = true;
3147
- });
3148
- if (hadRejection) showToast({
3149
- label: t(($) => $["failedToUpdateEfpBusinessLines"], { ns: "business" }),
3150
- variant: "error"
3151
- });
3152
- }
3153
- var determineCustomerSupport = (customerSupport, country) => {
3154
- switch (country) {
3155
- case CountryCodes.Japan: return unsetCustomerSupportNumber(customerSupport);
3156
- default: return;
3157
- }
3158
- };
3159
- var unsetCustomerSupportNumber = (customerSupport) => {
3160
- return customerSupport ? {
3161
- email: customerSupport.email,
3162
- phone: {
3163
- number: "",
3164
- type: "mobile"
3165
- }
3166
- } : void 0;
3167
- };
3168
- //#endregion
3169
- //#region src/context/handlerContext/useHandlerContext.ts
3170
- function useHandlerContext() {
3171
- return useContext$1(HandlerContext);
3172
- }
3173
- //#endregion
3174
- //#region src/components/Business/modals/LegalArrangementModal.tsx
3175
- function LegalArrangementModal({ onCancel }) {
3176
- const { t } = useTranslation(["common", "business"]);
3177
- const { onNavigateToTask } = useHandlerContext();
3178
- return /* @__PURE__ */ jsx(Confirm, {
3179
- title: t(($) => $["thisBusinessIsntRegisteredAsACompany"], { ns: "business" }),
3180
- description: t(($) => $["ifThisIsYourBusinessGoBackAndChooseADifferentSetup"], { ns: "business" }),
3181
- cancelText: t(($) => $["close"], { ns: "common" }),
3182
- confirmText: t(($) => $["continue"], { ns: "common" }),
3183
- onCancel,
3184
- onConfirm: () => onNavigateToTask?.(TaskTypes.BUSINESS_TYPE_SELECTION),
3185
- analyticsEventLabel: "legalArrangementModal"
3186
- });
3187
- }
3188
- //#endregion
3189
- //#region src/components/Business/modals/RegistrationNumberMismatchModal.tsx
3190
- function RegistrationNumberMismatchModal({ companySearchStateModel, registrationNumberMismatchModalOpen, confirmDataSelection }) {
3191
- const { t } = useTranslation(["common", "business"]);
3192
- const { form } = useFormContext();
3193
- const { data } = getFormSlice(form, "basicInformation");
3194
- const country = data?.country;
3195
- const providedData = {
3196
- registrationNumber: data?.registrationNumber,
3197
- registrationNumberType: data?.registrationNumberType
3198
- };
3199
- const detectedData = {
3200
- registrationNumber: companySearchStateModel.selectedCompany.value?.registrationNumber,
3201
- registrationNumberType: void 0
3202
- };
3203
- const registrationNumberType = data?.exemptedFromRegistrationNumber ? "exempted" : data?.registrationNumberType;
3204
- const { label: registrationNumberLabel } = resolveFieldMetadata(registrationNumberDefaultFieldConfig[country], {
3205
- registrationNumberType: registrationNumberType === "exempted" ? void 0 : registrationNumberType,
3206
- state: data?.stateOrProvince || void 0
3207
- }, registrationNumberDefaultFieldMetadata);
3208
- return /* @__PURE__ */ jsx(DataConflictsModal, {
3209
- providedData,
3210
- detectedData,
3211
- conflictingProperties: ["registrationNumber"],
3212
- formatters: {},
3213
- labels: { registrationNumber: providedData.registrationNumberType === detectedData.registrationNumberType ? registrationNumberLabel : "registrationNumber" },
3214
- title: t(($) => $["verifyYourBusinesssDetails"], { ns: "business" }),
3215
- explanation: t(($) => $["selectTheOptionWithTheMostCorrectDetailsToContinue"], { ns: "business" }),
3216
- onCancel: () => registrationNumberMismatchModalOpen.value = false,
3217
- onContinue: confirmDataSelection,
3218
- listOnly: true
3219
- });
3220
- }
3221
- //#endregion
3222
- //#region src/components/Business/modals/TinMismatchModal.tsx
3223
- function TinMismatchModal({ onCancel, onConfirm }) {
3224
- const { t } = useTranslation(["common", "business"]);
3225
- const modalDescriptionKey = typeof useContext$1(CompanySearchStateContext).selectedCompany.value === "undefined" ? "theEinDidntMatchLegalBusinessName" : "itLooksLikeThisBusinessUsesADifferentEIN";
3226
- return /* @__PURE__ */ jsx(Confirm, {
3227
- title: t(($) => $["employerIdentificationNumberDoesntMatch"], { ns: "business" }),
3228
- description: t(($) => $[modalDescriptionKey], { ns: "business" }),
3229
- cancelText: t(($) => $["close"], { ns: "common" }),
3230
- confirmText: t(($) => $["continue"], { ns: "common" }),
3231
- onCancel,
3232
- onConfirm,
3233
- analyticsEventLabel: "tinVerificationFailureModal"
3234
- });
3235
- }
3236
- //#endregion
3237
- //#region src/components/Business/utils/buildRequiredForms.ts
3238
- function buildRequiredForms({ config: { forms, requiredFields, optionalFields, isValid, problems, isSettingEnabled, accountHolder, legalEntityResponse }, options }) {
3239
- /**
3240
- * Skip company structure if:
3241
- * - Only a single company structure is available
3242
- * - The legal form is already provided from a 3rd party provider
3243
- * - The legal entity type is allowed to skip company structure
3244
- * - The account holder is not a trust or unincorporated partnership
3245
- *
3246
- * This needs to be done here and not the rules because when selecting incorporated association or incorporated partnership, we set the entityType value in the
3247
- * multiform data. This means that even if the rules say we don't need this value, because the data is present we show add that field to required fields.
3248
- */
3249
- const skipCompanyStructure = options?.skipCompanyStructure || isSettingEnabled(SettingNames.AllowLegalEntityTypeChange) && organizationTypesToSkipCompanyStructureForm.includes(legalEntityResponse.organization?.type ?? "") && accountHolder !== "aTrust" && accountHolder !== "anUnincorporatedPartnership";
3250
- const filteredForms = Object.values(forms).filter(({ formId }) => {
3251
- if (formId === "businessSelection") {
3252
- if (options?.skipBusinessSelection) return false;
3253
- }
3254
- if (formId === "companyStructure") {
3255
- if (skipCompanyStructure) return false;
3256
- }
3257
- if (requiredFields || optionalFields) return Boolean(requiredFields?.[formId]) || Boolean(optionalFields?.[formId]);
3258
- return true;
3259
- });
3260
- return addValidityToForms(options?.skipSummary ? filteredForms : [...filteredForms, summaryStep], isValid, problems);
3261
- }
3262
- //#endregion
3263
- //#region src/components/Business/utils/formatDataForSummary.ts
3264
- function createStructuredListItem(term, details, t) {
3265
- if (!details) return;
3266
- return {
3267
- term: t(($) => $[term], { ns: "common" }),
3268
- details
3269
- };
3270
- }
3271
- var formatBasicInformation = (data, datasetUtils, companyType, isCountryOfGoverningLawEnabled) => {
3272
- const country = data.country;
3273
- const taxInfoForCountry = data.taxInformation?.find((taxInfo) => taxInfo.country === country);
3274
- let taxIdLabel = "taxInformationNumber";
3275
- if (country in taxIdNumberOptions) {
3276
- const numberOption = taxIdNumberOptions[country]?.find((taxOption) => taxOption.id === taxInfoForCountry?.type);
3277
- if (numberOption) taxIdLabel = numberOption.name;
3278
- }
3279
- const registrationNumberLabel = resolveFieldMetadata(registrationNumberDefaultFieldConfig[country], {
3280
- companyType,
3281
- registrationNumberType: data.registrationNumber ? inferCompanyRegistrationNumberType(data.registrationNumber, country, companyType) : getCompanyRegistrationNumberOptions(country, companyType)?.[0]?.id
3282
- }, registrationNumberDefaultFieldMetadata).label ?? "";
3283
- return {
3284
- legalCompanyName: data.legalCompanyName,
3285
- country: datasetUtils.getCountryName(data.country),
3286
- [getKeyForField("stateOrProvince", data.country)]: datasetUtils.getStateName(data.stateOrProvince, data.country),
3287
- [taxIdLabel]: taxInfoForCountry?.number,
3288
- [registrationNumberLabel]: data.registrationNumber,
3289
- countryOfGoverningLaw: datasetUtils.getCountryName(getCountryOfGoverningLaw(isCountryOfGoverningLawEnabled, data))
3290
- };
3291
- };
3292
- var formatAdditionalInformation = (data) => {
3293
- return {
3294
- businessStructure: data.legalFormLabel,
3295
- doingBusinessAs: data.doingBusinessAs,
3296
- industry: data.industryCodes?.[0].name,
3297
- vatNumber: data.vatNumber,
3298
- vatAbsenceReason: data.vatAbsenceReason,
3299
- legalEntityIdentifier: data.legalEntityIdentifier,
3300
- dateOfIncorporation: data.dateOfIncorporation,
3301
- stockExchangeMIC: data.stockExchangeMIC,
3302
- stockISIN: data.stockISIN,
3303
- stockTickerSymbol: data.stockTickerSymbol,
3304
- eInvoicingCode: data.eInvoicingCode
3305
- };
3306
- };
3307
- var formatAddress = (data, datasetUtils, country, version) => {
3308
- return country === CountryCodes.Japan && version === 4 ? mapJpAddressSummaryNewSummary(data, datasetUtils) : mapAddressLabelsNewSummary(data, datasetUtils);
3309
- };
3310
- var formatFinancialInformationSummary = (data, language, country, dateOfIncorporation) => {
3311
- if (!data) return {};
3312
- if (dateOfIncorporation && !isDateOlderThanAYear(dateOfIncorporation)) return country === CountryCodes.UnitedKingdom ? { numberOfEmployees: data.numberOfEmployees } : {};
3313
- return {
3314
- currency: data.currency,
3315
- financialReportingDate: data.financialReportingDate,
3316
- ...country === CountryCodes.UnitedKingdom ? { numberOfEmployees: data.numberOfEmployees } : {},
3317
- ...data.balanceSheetTotal ? { balanceSheetTotal: formatCurrency(data.balanceSheetTotal, data.currency, language) } : {},
3318
- ...data.annualTurnover ? { annualTurnover: formatCurrency(data.annualTurnover, data.currency, language) } : {}
3319
- };
3320
- };
3321
- var formatDataForSummary = (data, forms, t, language, isFeatureEnabled, version) => {
3322
- const OMITTED_FORMS = ["businessSelection", "summary"];
3323
- const datasetUtils = datasetUtilities(language);
3324
- const isCountryOfGoverningLawEnabled = isFeatureEnabled("EnableCountryOfGoverningLawForUKCompanies");
3325
- const getSummaryItemsForForm = (formId) => {
3326
- if (!data[formId]) return {};
3327
- switch (formId) {
3328
- case "basicInformation": return formatBasicInformation(data[formId], datasetUtils, data.companyStructure?.entityType, isCountryOfGoverningLawEnabled);
3329
- case "companyStructure": return { entityType: t(($) => $[companyTypeMetadata[data[formId]?.entityType]?.name], { ns: "business" }) };
3330
- case "additionalInformation": return formatAdditionalInformation(data[formId]);
3331
- case "companyRegistrationDocument": return {
3332
- fileName: data[formId].registrationDocument?.[0]?.name,
3333
- description: data[formId].description
3334
- };
3335
- case "companyTaxDocument": return {
3336
- fileName: data[formId]?.taxDocument?.[0]?.name,
3337
- description: data[formId].description
3338
- };
3339
- case "companyProofOfAddressDocument": return {
3340
- fileName: data[formId]?.proofOfAddress?.[0]?.name,
3341
- description: data[formId].description
3342
- };
3343
- case "companyConstitutionalDocument": return {
3344
- fileName: data[formId]?.constitutionalDocument?.[0]?.name,
3345
- description: data[formId].description
3346
- };
3347
- case "companyProofOfDirectorDocument": return {
3348
- fileName: data[formId]?.proofOfDirector?.[0]?.name,
3349
- description: data[formId].description
3350
- };
3351
- case "companyProofOfSignatoryDocument": return {
3352
- fileName: data[formId]?.proofOfSignatory?.[0]?.name,
3353
- description: data[formId].description
3354
- };
3355
- case "companyProofOfOwnershipDocument": return {
3356
- fileName: data[formId].proofOfOwnership?.map((doc) => doc.name).join("\n"),
3357
- description: data[formId].description
3358
- };
3359
- case "companyFinancialInformation": return formatFinancialInformationSummary(data[formId], language, data.basicInformation?.country, data.additionalInformation?.dateOfIncorporation);
3360
- default: return {};
3361
- }
3362
- };
3363
- const translateAndFilterMappedSummary = (data) => {
3364
- const tmp = [];
3365
- for (const summaryItem in data) {
3366
- const item = createStructuredListItem(summaryItem, data[summaryItem], t);
3367
- if (item) tmp.push(item);
3368
- }
3369
- return tmp;
3370
- };
3371
- const summarySectionData = [];
3372
- for (const form of forms) {
3373
- if (OMITTED_FORMS.includes(form.formId)) continue;
3374
- const summaryItems = translateAndFilterMappedSummary(getSummaryItemsForForm(form.formId));
3375
- if (summaryItems.length > 0) summarySectionData.push({
3376
- formId: form.formId,
3377
- label: t(($) => $[form.formName], { ns: "common" }),
3378
- items: summaryItems
3379
- });
3380
- if (form.formId === "additionalInformation") {
3381
- const registrationAddressSummaryItems = translateAndFilterMappedSummary(formatAddress(nestAddressSchema("registrationAddress", data.additionalInformation), datasetUtils, data.basicInformation?.country, version));
3382
- if (registrationAddressSummaryItems.length > 0) summarySectionData.push({
3383
- formId: "registrationAddress",
3384
- label: t(($) => $["registrationAddress"], { ns: "common" }),
3385
- items: registrationAddressSummaryItems
3386
- });
3387
- if (!data[form.formId]?.operationalAddressIsSame) {
3388
- const operationalAddressSummaryItems = translateAndFilterMappedSummary(formatAddress(nestAddressSchema("operationalAddress", data.additionalInformation), datasetUtils, data.basicInformation?.country, version));
3389
- if (operationalAddressSummaryItems.length > 0) summarySectionData.push({
3390
- formId: "operationalAddress",
3391
- label: t(($) => $["operationalAddress"], { ns: "common" }),
3392
- items: operationalAddressSummaryItems
3393
- });
3394
- }
3395
- }
3396
- }
3397
- return summarySectionData;
3398
- };
3399
- //#endregion
3400
- //#region src/components/Business/tasks/BusinessDetailsDropin/businessDetailsFormConfig.ts
3401
- var businessDetailsBase = {
3402
- country: { rule: "REQUIRED" },
3403
- entityType: { rule: "businessRequiresCompanyType" },
3404
- legalCompanyName: { rule: "REQUIRED" },
3405
- jaHaniLegalCompanyName: { rule: "japaneseLegalCompanyName" },
3406
- jaKanaLegalCompanyName: { rule: "japaneseLegalCompanyName" },
3407
- hasDoingBusinessAs: { rule: "REQUIRED" },
3408
- doingBusinessAs: { rule: "requireDoingBusinessAsName" },
3409
- residentialAddressIndicator: { rule: "isResidentialAddressIndicatorEnabled" },
3410
- operationalAddressIsSame: { rule: "REQUIRED" },
3411
- legalEntityIdentifier: { rule: "requireLEI" },
3412
- exemptedFromLegalEntityIdentifier: { rule: "requireLEIExemption" },
3413
- selectedBusinessId: { rule: "usingCompanySearch" },
3414
- stateOrProvince: { rule: "requireStateOrProvinceForCompanySearch" },
3415
- stockExchangeMIC: { rule: "ifPubliclyTradedCompany" },
3416
- stockISIN: { rule: "ifPubliclyTradedCompany" },
3417
- stockTickerSymbol: { rule: "ifPubliclyTradedCompany" },
3418
- dateOfIncorporation: { rule: "isDateOfIncorporationRequired" },
3419
- registrationNumber: { rule: "countryRequiresRegistrationNumber" },
3420
- registrationNumberType: { rule: "registrationNumberType" },
3421
- exemptedFromRegistrationNumber: { rule: "companyRegistrationNumberExemptionAllowed" },
3422
- eInvoicingCode: { rule: "isEInvoicingCodeEnabled" },
3423
- countryOfGoverningLaw: { rule: "countryOfGoverningLawRequired" },
3424
- taxDocument: { rule: "isTaxDocumentRequired" },
3425
- registrationDocument: { rule: "isRegistrationDocumentRequired" },
3426
- registrationAddressStreet: { rule: "registrationAddressStreetRequired" },
3427
- registrationAddressStreet2: { rule: "registrationAddressStreet2Required" },
3428
- registrationAddressCity: { rule: "registrationAddressCityRequired" },
3429
- registrationAddressPostalCode: { rule: "registrationAddressPostalCodeRequired" },
3430
- registrationAddressStateOrProvince: { rule: "registrationAddressStateOrProvinceRequired" },
3431
- registrationAddressCountry: { rule: "registrationAddressCountryRequired" },
3432
- operationalAddressStreet: { rule: "operationalAddressStreetRequired" },
3433
- operationalAddressStreet2: { rule: "operationalAddressStreet2Required" },
3434
- operationalAddressCity: { rule: "operationalAddressCityRequired" },
3435
- operationalAddressPostalCode: { rule: "operationalAddressPostalCodeRequired" },
3436
- operationalAddressStateOrProvince: { rule: "operationalAddressStateOrProvinceRequired" },
3437
- operationalAddressCountry: { rule: "operationalAddressCountryRequired" },
3438
- registrationAddressJaHaniStateOrProvince: { rule: "registrationAddressJaHaniStateOrProvinceRequired" },
3439
- registrationAddressJaHaniCity: { rule: "registrationAddressJaHaniCityRequired" },
3440
- registrationAddressJaHaniStreet: { rule: "registrationAddressJaHaniStreetRequired" },
3441
- registrationAddressJaKanaStateOrProvince: { rule: "registrationAddressJaKanaStateOrProvinceRequired" },
3442
- registrationAddressJaKanaCity: { rule: "registrationAddressJaKanaCityRequired" },
3443
- registrationAddressStreet2FullWidth: { rule: "registrationAddressStreet2FullWidthRequired" },
3444
- operationalAddressJaHaniStateOrProvince: { rule: "operationalAddressJaHaniStateOrProvinceRequired" },
3445
- operationalAddressJaHaniCity: { rule: "operationalAddressJaHaniCityRequired" },
3446
- operationalAddressJaHaniStreet: { rule: "operationalAddressJaHaniStreetRequired" },
3447
- operationalAddressJaKanaStateOrProvince: { rule: "operationalAddressJaKanaStateOrProvinceRequired" },
3448
- operationalAddressJaKanaCity: { rule: "operationalAddressJaKanaCityRequired" },
3449
- operationalAddressStreet2FullWidth: { rule: "operationalAddressStreet2FullWidthRequired" }
3450
- };
3451
- var taxInformationBase = {
3452
- vatNumber: { rule: "countryUsesVat" },
3453
- vatNumberType: { rule: "vatNumberType" },
3454
- exemptedFromVat: { rule: "isVatExempt" },
3455
- vatAbsenceReason: { rule: "isVatExempt" },
3456
- taxInformation: { rule: "countryUsesTaxId" },
3457
- exemptedFromTax: { rule: "countryHasTaxExemptions" },
3458
- isUen: { rule: "countryUsesUenOrGst" }
3459
- };
3460
- var financialInformationBase = {
3461
- numberOfEmployees: { rule: "countryRequiresFinancialInformation" },
3462
- financialReportingDate: { rule: "isFinancialReportingFieldsRequired" },
3463
- currency: { rule: "isFinancialReportingFieldsRequired" },
3464
- reportedValueOption: { rule: "isFinancialReportingFieldsRequired" },
3465
- annualTurnover: { rule: "annualTurnoverRequired" },
3466
- balanceSheetTotal: { rule: "balanceSheetTotalRequired" }
3467
- };
3468
- var businessDetailsFieldsPerScenario = {
3469
- L0: {
3470
- country: { rule: "REQUIRED" },
3471
- legalCompanyName: { rule: "REQUIRED" },
3472
- stateOrProvince: { rule: "usingCompanySearch" },
3473
- ...financialInformationBase
3474
- },
3475
- L1: {
3476
- ...businessDetailsBase,
3477
- ...financialInformationBase
3478
- },
3479
- L: {
3480
- ...businessDetailsBase,
3481
- ...taxInformationBase,
3482
- ...financialInformationBase
3483
- },
3484
- L_PROOFOFADDRESS: { proofOfAddress: { rule: "REQUIRED" } },
3485
- L_REGDOC: { registrationDocument: { rule: "REQUIRED" } },
3486
- L_TAXDOC: { taxDocument: { rule: "REQUIRED" } },
3487
- L_BAFIN: { legalForm: { rule: "REQUIRED" } },
3488
- L_ISSUING: { industryCodes: { rule: "isIndustryCodeRequired" } },
3489
- L_BANKING: { industryCodes: { rule: "isIndustryCodeRequired" } }
3490
- };
3491
- //#endregion
3492
- //#region src/components/Business/tasks/BusinessDetailsDropin/BusinessDetailsGettingStarted.tsx
3493
- var businessDetailsImage = lazy(() => import("./business-details-CPkvjYXG.js"));
3494
- var BusinessDetailsGettingStarted = ({ openModal, handleCancelClick, t, data: summaryData }) => {
3495
- const { data: taskStatus } = useTaskStatus(TaskTypes.BUSINESS_DETAILS, { refetchInterval: TASK_STATUS_POLLING_INTERVAL_MS });
3496
- return /* @__PURE__ */ jsx("div", {
3497
- style: {
3498
- maxWidth: 450,
3499
- margin: "0 auto"
3500
- },
3501
- children: (taskStatus?.status ?? "DETAILS_REQUIRED") === "DETAILS_REQUIRED" ? /* @__PURE__ */ jsx(LandingLayout, {
3502
- title: t(($) => $["businessDetails"], { ns: "common" }),
3503
- description: t(($) => $["businessDetailsGettingStarted"], { ns: "business" }),
3504
- media: /* @__PURE__ */ jsx(Image, { lazyLoadedImage: businessDetailsImage }),
3505
- actions: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Button, {
3506
- fullWidth: true,
3507
- onClick: openModal,
3508
- children: t(($) => $["getStarted"], { ns: "common" })
3509
- }), /* @__PURE__ */ jsx(Button, {
3510
- variant: "tertiary",
3511
- fullWidth: true,
3512
- onClick: handleCancelClick,
3513
- children: t(($) => $["finishLater"], { ns: "common" })
3514
- })] })
3515
- }) : /* @__PURE__ */ jsxs(StackLayout, {
3516
- align: "center",
3517
- children: [/* @__PURE__ */ jsx(TaskVerificationStatus, { status: taskStatus?.status ?? "FINISHED" }), /* @__PURE__ */ jsx(DetailViewLayout, {
3518
- title: t(($) => $["businessDetails"], { ns: "common" }),
3519
- align: "center",
3520
- description: t(($) => $["theDetailsWeCollected"], { ns: "business" }),
3521
- actions: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Button, {
3522
- onClick: openModal,
3523
- children: t(($) => $["edit"], { ns: "common" })
3524
- }), /* @__PURE__ */ jsx(Button, {
3525
- variant: "secondary",
3526
- onClick: handleCancelClick,
3527
- fullWidth: true,
3528
- children: t(($) => $["goBackToTaskList"], { ns: "common" })
3529
- })] }),
3530
- children: summaryData?.map(({ formId, label, items }) => /* @__PURE__ */ jsx(SummarySection, {
3531
- formId,
3532
- label,
3533
- items
3534
- }, formId))
3535
- })]
3536
- })
3537
- });
3538
- };
3539
- //#endregion
3540
- //#region src/components/Business/utils/applyVerifiedBusinessData.ts
3541
- var applyFinancialInformation = (form, verifiedData) => {
3542
- const financialInformation = verifiedData?.financialInformation;
3543
- if (!financialInformation) return;
3544
- const verifiedFinancialReportingDate = financialInformation.financialReportingDate;
3545
- const currentFinancialReportingDate = form.data.companyFinancialInformation?.financialReportingDate;
3546
- if (!currentFinancialReportingDate || verifiedFinancialReportingDate && verifiedFinancialReportingDate >= currentFinancialReportingDate) {
3547
- if (financialInformation.numberOfEmployees != null) form.handleChangeFor("companyFinancialInformation", "numberOfEmployees")(financialInformation.numberOfEmployees);
3548
- if (financialInformation.financialReportingDate) form.handleChangeFor("companyFinancialInformation", "financialReportingDate")(financialInformation.financialReportingDate);
3549
- if (financialInformation.currency) form.handleChangeFor("companyFinancialInformation", "currency")(financialInformation.currency);
3550
- /**
3551
- * Determine which reported value option to select based on available data
3552
- * Priority: balanceSheetTotal > annualTurnover
3553
- */
3554
- const selectedReportedValueOption = financialInformation.balanceSheetTotal != null ? "balanceSheetTotal" : financialInformation.annualTurnover != null ? "annualTurnover" : null;
3555
- if (selectedReportedValueOption) {
3556
- const selectedReportedValue = selectedReportedValueOption === "balanceSheetTotal" ? financialInformation.balanceSheetTotal : financialInformation.annualTurnover;
3557
- const nonSelectedReportedValueOption = selectedReportedValueOption === "balanceSheetTotal" ? "annualTurnover" : "balanceSheetTotal";
3558
- form.handleChangeFor("companyFinancialInformation", "reportedValueOption")(selectedReportedValueOption);
3559
- form.handleChangeFor("companyFinancialInformation", selectedReportedValueOption)(selectedReportedValue);
3560
- form.handleChangeFor("companyFinancialInformation", nonSelectedReportedValueOption)(void 0);
3561
- }
3562
- }
3563
- };
3564
- var applyVerifiedBusinessData = (form, country, verifiedData, options) => {
3565
- if (!verifiedData) return;
3566
- form.handleChangeFor("basicInformation", "legalCompanyName")(verifiedData.name);
3567
- if (!options?.preserveRegistrationNumber && country !== CountryCodes.UnitedStates && verifiedData.registrationNumber) {
3568
- form.handleChangeFor("basicInformation", "registrationNumber")(verifiedData.registrationNumber);
3569
- const inferredRegistrationNumberType = inferCompanyRegistrationNumberType(verifiedData.registrationNumber, country, verifiedData.companyType);
3570
- form.handleChangeFor("basicInformation", "registrationNumberType")(inferredRegistrationNumberType);
3571
- }
3572
- const companyType = options?.companyTypeOverride ?? verifiedData.companyType;
3573
- if (companyType) form.handleChangeFor("companyStructure", "entityType")(companyType);
3574
- if (!(form.defaultData?.additionalInformation?.registrationAddressStreet || form.defaultData?.additionalInformation?.operationalAddressStreet)) {
3575
- if (verifiedData.principalPlaceOfBusinessAddress) form.handleChangeFor("additionalInformation", "operationalAddressIsSame", "input")(false);
3576
- const addressFields = [...form.requiredFields?.additionalInformation ?? [], ...form.optionalFields?.additionalInformation ?? []];
3577
- const applyVerifiedAddress = (prefix, address) => {
3578
- const flatVerifiedAddress = flattenAddressSchema(prefix, {
3579
- ...address,
3580
- country
3581
- });
3582
- for (const field in flatVerifiedAddress) {
3583
- const fieldValue = flatVerifiedAddress[field];
3584
- if (fieldValue === void 0 || !addressFields.includes(field)) continue;
3585
- form.handleChangeFor("additionalInformation", field)(fieldValue);
3586
- }
3587
- };
3588
- if (verifiedData.registeredAddress) applyVerifiedAddress("registrationAddress", mapAddressData(verifiedData.registeredAddress));
3589
- if (verifiedData.principalPlaceOfBusinessAddress) applyVerifiedAddress("operationalAddress", mapAddressData(verifiedData.principalPlaceOfBusinessAddress));
3590
- }
3591
- applyFinancialInformation(form, verifiedData);
3592
- };
3593
- //#endregion
3594
- //#region src/components/Business/tasks/BusinessDetailsDropin/businessDetailsStore.ts
3595
- var CompanySearchStateModel = createModel((userEvents) => {
3596
- const companySearchName = signal();
3597
- const selectedCompany = signal(void 0);
3598
- const verifiedBusiness = signal(void 0);
3599
- const verificationMatched = signal(void 0);
3600
- /** We cannot allow selections in a few situations, this is used to track them */
3601
- const disallowedSelectionReason = signal(void 0);
3602
- /** Only used for MixPanel tracking, not meant to be exposed */
3603
- const selectedCompanyIdx = signal(-1);
3604
- const resetCompanySearchData = () => {
3605
- selectedCompany.value = void 0;
3606
- verifiedBusiness.value = void 0;
3607
- verificationMatched.value = void 0;
3608
- disallowedSelectionReason.value = void 0;
3609
- selectedCompanyIdx.value = -1;
3610
- };
3611
- return {
3612
- companySearchName,
3613
- selectedCompany,
3614
- verifiedBusiness,
3615
- verificationMatched,
3616
- disallowedSelectionReason,
3617
- resetCompanySearchData,
3618
- disallowSelection: (reason) => {
3619
- resetCompanySearchData();
3620
- disallowedSelectionReason.value = reason;
3621
- },
3622
- setVerificationMatched: (value) => {
3623
- resetCompanySearchData();
3624
- verificationMatched.value = value;
3625
- },
3626
- selectCompany: (selected, idx, country) => {
3627
- resetCompanySearchData();
3628
- selectedCompany.value = selected;
3629
- verificationMatched.value = country === CountryCodes.UnitedStates ? selected.tinMatched : selected.registrationNumberMatched;
3630
- /** `-1` indicates auto-selection, not a manual user interaction */
3631
- if (idx > -1) {
3632
- selectedCompanyIdx.value = idx;
3633
- selectBusinessAnalytics(userEvents, idx);
3634
- }
3635
- },
3636
- confirmCompany: (multiform, country, options) => {
3637
- verifiedBusiness.value = selectedCompany.value;
3638
- applyVerifiedBusinessData(multiform, country, selectedCompany.value, options);
3639
- if (selectedCompanyIdx.value > -1) confirmBusinessAnalytics(userEvents, selectedCompanyIdx.value);
3640
- }
3641
- };
3642
- });
3643
- function selectBusinessAnalytics(userEvents, idx) {
3644
- userEvents.addPageEvent("Clicked button", {
3645
- actionType: "select",
3646
- label: "selectBusiness",
3647
- additionalData: { companyIdx: idx }
3648
- });
3649
- }
3650
- function confirmBusinessAnalytics(userEvents, idx) {
3651
- userEvents.addPageEvent("Clicked button", {
3652
- actionType: "select",
3653
- label: "confirmBusiness",
3654
- additionalData: { companyIdx: idx }
3655
- });
3656
- }
3657
- //#endregion
3658
- //#region src/components/Shared/fields/CountryField/validate.ts
3659
- var CountryFieldValidation = () => ({ country: {
3660
- modes: ["blur"],
3661
- validate: (country) => !isEmpty(country),
3662
- errorMessage: "fieldIsRequired"
3663
- } });
3664
- //#endregion
3665
- //#region src/components/Business/tasks/BusinessDetailsDropin/validate.ts
3666
- var logger = createLogger();
3667
- function basicInformationValidators({ country, taxIdNumberType, companyType, registrationNumberType, state, isFeatureEnabled }) {
3668
- return {
3669
- country: CountryFieldValidation().country,
3670
- countryOfGoverningLaw: CountryOfGoverningLawFieldValidation().countryOfGoverningLaw,
3671
- legalCompanyName: resolveFieldMetadata(isFeatureEnabled("StrictNameAndAddressValidationV4") ? defaultFieldConfigV4[country] : defaultFieldConfig[country], {}, isFeatureEnabled("StrictNameAndAddressValidationV4") ? defaultFieldMetadataV4 : defaultFieldMetadata).validators,
3672
- taxInformation: resolveFieldMetadata(taxInformationDefaultFieldConfig[country], {
3673
- taxIdNumberType,
3674
- companyType
3675
- }, taxInformationDefaultFieldMetadata).validators,
3676
- stateOrProvince: stateFieldMetadata.validators,
3677
- registrationNumber: resolveFieldMetadata(registrationNumberDefaultFieldConfig[country], {
3678
- companyType,
3679
- registrationNumberType,
3680
- state,
3681
- isFeatureEnabled
3682
- }, registrationNumberDefaultFieldMetadata).validators,
3683
- exemptedFromRegistrationNumber: exemptFromRegistrationNumberDefaultFieldMetadata.validators,
3684
- jaHaniLegalCompanyName: resolveFieldMetadata(localizedLegalCompanyNameFieldConfig.jaHaniLegalCompanyName.config, {}, localizedLegalCompanyNameFieldConfig.jaHaniLegalCompanyName.metadata).validators,
3685
- jaKanaLegalCompanyName: resolveFieldMetadata(localizedLegalCompanyNameFieldConfig.jaKanaLegalCompanyName.config, {}, localizedLegalCompanyNameFieldConfig.jaKanaLegalCompanyName.metadata).validators
3686
- };
3687
- }
3688
- function businessSelectionValidators() {
3689
- return { selectedBusinessId: {
3690
- modes: ["blur", "input"],
3691
- validate: (val) => !isEmpty(val),
3692
- errorMessage: "fieldIsRequired"
3693
- } };
3694
- }
3695
- function prefixAddressValidators(prefix, rules) {
3696
- const validators = {};
3697
- for (const field in rules) validators[`${prefix}${capitalize(field)}`] = rules[field];
3698
- return validators;
3699
- }
3700
- function additionalInformationValidators({ country, vatNumberType, isFeatureEnabled, t }) {
3701
- const addressRules = addressValidators({
3702
- isFeatureEnabled,
3703
- country,
3704
- t
3705
- });
3706
- return {
3707
- hasDoingBusinessAs: doingBusinessAsAbsentFieldMetadata.validators,
3708
- doingBusinessAs: doingBusinessAsFieldMetadata.validators,
3709
- legalEntityIdentifier: legalEntityIdentifierFieldMetadata.validators,
3710
- vatNumber: resolveFieldMetadata(defaultFieldConfig$1[country], { vatNumberType }, defaultFieldMetadata$1).validators,
3711
- vatAbsenceReason: vatAbsenceReasonMetadata.validators,
3712
- eInvoicingCode: eInvoicingCodeFieldMetadata.validators,
3713
- industryCodes: industryCodeFieldMetadata.validators,
3714
- dateOfIncorporation: dateOfIncorporationFieldMetadata.validators,
3715
- stockExchangeMIC: stockExchangeMICFieldMetadata.validators,
3716
- stockISIN: stockISINFieldMetadata.validators,
3717
- stockTickerSymbol: stockTickerSymbolFieldMetadata.validators,
3718
- ...prefixAddressValidators("registrationAddress", addressRules),
3719
- ...prefixAddressValidators("operationalAddress", addressRules)
3720
- };
3721
- }
3722
- var preventPoBoxValidation = (cleanseAddress, formData) => ({ operationalAddressStreet: {
3723
- modes: [],
3724
- errorMessage: "addressPoBoxError",
3725
- asyncValidate: async (street) => {
3726
- const country = formData?.basicInformation?.country;
3727
- if (!street || !country) return true;
3728
- const text = formatAddressForCleanse({
3729
- ...nestAddressSchema("operationalAddress", formData.additionalInformation),
3730
- street
3731
- });
3732
- if (!text) return true;
3733
- try {
3734
- const { poBox } = await cleanseAddress({
3735
- text,
3736
- country
3737
- });
3738
- return !poBox;
3739
- } catch (error) {
3740
- logger.error("Error while checking if address is PO box", error);
3741
- return true;
3742
- }
3743
- }
3744
- } });
3745
- //#endregion
3746
- //#region src/components/Business/tasks/BusinessDetailsDropin/BusinessDetailsDropin.tsx
3747
- var CompanySearchStateContext = createContext$1({});
3748
- function BusinessDetailsDropin({ taskType, country: propCountry, problems: propProblems, legalEntityResponse, efpBusinessLines, documents, associatedLegalArrangement, nestedLegalEntity, nestedLegalEntityDetails, onSubmit: onExternalSubmit, handleHomeClick }) {
3749
- const { t, i18n } = useTranslation(["common", "business"]);
3750
- const userEvents = useAnalyticsContext();
3751
- const { isFeatureEnabled } = useToggleContext();
3752
- const isBusinessDetailsModalEnabled = taskType === TaskTypes.BUSINESS_DETAILS;
3753
- const { isSettingEnabled } = useSettingsContext();
3754
- const { accountHolder } = useAccountHolder();
3755
- const logger = createLogger();
3756
- const { mutateAsync: clearCompanyData } = useClearCompanyData();
3757
- /**
3758
- * Analytics
3759
- */
3760
- useTaskLandedEvent(taskType);
3761
- const isAssociationTaskType = taskType !== TaskTypes.BUSINESS_DETAILS;
3762
- const legalEntityType = taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY ? LegalEntityTypes.SOLE_PROPRIETORSHIP : LegalEntityTypes.ORGANIZATION;
3763
- /**
3764
- * Business Details is used for updating root entities of type 'Organization'
3765
- * and for both creating/updating associated arrangements of types 'Sole
3766
- * Proprietorship' and 'Trust Member Company' so must determine the subject entity
3767
- *
3768
- * Sole Props are associated to legalEntityResponse (root legal entity)
3769
- * Trust Member company are a nested association to associatedLegalArrangement
3770
- */
3771
- const subjectEntity = !isAssociationTaskType ? legalEntityResponse : taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY ? associatedLegalArrangement : nestedLegalEntity;
3772
- const [country, setCountry] = useState$1(propCountry);
3773
- const [problems, setProblems] = useState$1(propProblems ?? {});
3774
- const [loadingStatus, setLoadingStatus] = useState$1("success");
3775
- const [derivedProps, setDerivedProps] = useState$1();
3776
- const [trustedFields, setTrustedFields] = useState$1(subjectEntity?.trustedFields ?? void 0);
3777
- const [isAddingBusinessDetails, setIsAddingBusinessDetails] = useState$1(false);
3778
- const [hasEnteredFormFlowBefore, setHasEnteredFormFlowBefore] = useState$1(false);
3779
- const companySearchStateModel = useModel(() => new CompanySearchStateModel(userEvents));
3780
- const tinMismatchModalOpen = useSignal(false);
3781
- const legalArrangementModalOpen = useSignal(false);
3782
- const registrationNumberMismatchModalOpen = useSignal(false);
3783
- const defaultForms = useMemo$1(() => getForms(country), [country]);
3784
- const { fieldConfigurations } = useScenarioConfiguration({
3785
- legalEntityType,
3786
- parseConfiguration: useCallback$1(({ scenarios }) => composePerScenarioFormConfigurations(scenarios, businessDetailsFieldsPerScenario), []),
3787
- setLoadingStatus,
3788
- country
3789
- });
3790
- const defaultData = useMemo$1(() => {
3791
- const mapped = mapLegalEntityToBusinessDetailsSchema({
3792
- legalEntity: !isAssociationTaskType ? legalEntityResponse : taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY ? associatedLegalArrangement ?? legalEntityResponse : nestedLegalEntity,
3793
- parentEntity: taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY ? legalEntityResponse : void 0,
3794
- taskType,
3795
- isFeatureEnabled
3796
- });
3797
- const initialEfpBusinessLineData = isSettingEnabled("allowBusinessLines") && efpBusinessLines && efpBusinessLines.length > 0 ? { additionalInformation: {
3798
- ...mapped.additionalInformation,
3799
- industryCodes: [{
3800
- id: efpBusinessLines[0].industryCode,
3801
- name: `${efpBusinessLines[0].industryCode} - ${efpBusinessLines[0].industryCodeDescription}`
3802
- }]
3803
- } } : {};
3804
- return {
3805
- ...mapped,
3806
- ...documents,
3807
- ...initialEfpBusinessLineData
3808
- };
3809
- }, [
3810
- isAssociationTaskType,
3811
- legalEntityResponse,
3812
- taskType,
3813
- associatedLegalArrangement,
3814
- nestedLegalEntity,
3815
- isFeatureEnabled,
3816
- isSettingEnabled,
3817
- efpBusinessLines,
3818
- documents
3819
- ]);
3820
- const buildFieldValidations = useCallback$1((data) => {
3821
- const taxInfo = data?.basicInformation?.taxInformation;
3822
- const taxIdType = taxInfo?.length ? taxInfo.find((taxId) => taxId.country === country)?.type : void 0;
3823
- const regNumberType = data?.basicInformation?.registrationNumberType;
3824
- const companyType = taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY ? "soleProprietorship" : data?.companyStructure?.entityType;
3825
- return {
3826
- basicInformation: basicInformationValidators({
3827
- country,
3828
- state: data?.basicInformation?.stateOrProvince,
3829
- companyType,
3830
- taxIdNumberType: taxIdType,
3831
- registrationNumberType: regNumberType,
3832
- isFeatureEnabled,
3833
- t
3834
- }),
3835
- businessSelection: businessSelectionValidators(),
3836
- companyStructure: CompanyStructureValidation,
3837
- additionalInformation: additionalInformationValidators({
3838
- country,
3839
- taxIdNumberType: taxIdType,
3840
- companyType,
3841
- registrationNumberType: regNumberType,
3842
- vatNumberType: data?.additionalInformation?.vatNumberType,
3843
- isFeatureEnabled,
3844
- t
3845
- }),
3846
- companyFinancialInformation: financialInfoValidationWithEmployeesRules
3847
- };
3848
- }, [
3849
- country,
3850
- isFeatureEnabled,
3851
- t,
3852
- taskType
3853
- ]);
3854
- const cleanseAddress = useAddressCleanseImperatively();
3855
- const buildAsyncFieldValidations = useCallback$1((data) => ({ additionalInformation: { operationalAddressStreet: preventPoBoxValidation(cleanseAddress, data).operationalAddressStreet } }), [cleanseAddress]);
3856
- const multiForm = useMultiForm({
3857
- defaultData,
3858
- allFields: derivedProps?.allFields,
3859
- requiredFields: derivedProps?.requiredFields,
3860
- optionalFields: derivedProps?.optionalFields,
3861
- obscuredFields: derivedProps?.obscuredFields,
3862
- trustedFields: derivedProps?.trustedFields,
3863
- rules: buildFieldValidations,
3864
- asyncRules: buildAsyncFieldValidations
3865
- });
3866
- /**
3867
- * Whilst this value _could_ be easily derived from existing values, it's intentionally distinct.
3868
- * `tinMatched`, from the company search model, updates immediately from the API response but we only
3869
- * want to insert the tax doc once the user actually navigates forward, hence, another state value set on nav.
3870
- */
3871
- const isTinMatched = useSignal(void 0);
3872
- const customRules = useMemo$1(() => rules({
3873
- data: multiForm.data,
3874
- defaultData,
3875
- verifiedBusiness: companySearchStateModel.verifiedBusiness.value,
3876
- country,
3877
- taskType,
3878
- isFeatureEnabled,
3879
- isSettingEnabled,
3880
- accountHolder,
3881
- tinMatched: isTinMatched.value,
3882
- rootLegalEntity: legalEntityResponse
3883
- }), [
3884
- multiForm.data,
3885
- defaultData,
3886
- companySearchStateModel.verifiedBusiness.value,
3887
- country,
3888
- taskType,
3889
- isFeatureEnabled,
3890
- isSettingEnabled,
3891
- accountHolder,
3892
- isTinMatched.value,
3893
- legalEntityResponse
3894
- ]);
3895
- useEffect$1(() => {
3896
- setDerivedProps(getPropsFromConfigurations({
3897
- scenarioConfiguration: fieldConfigurations,
3898
- forms: defaultForms,
3899
- remediationActions: problems.remediationActions ? Object.values(problems.remediationActions) : [],
3900
- dataMissingErrors: problems.missingData ?? [],
3901
- fieldsWithExistingData: subjectEntity ? subjectEntity.type === LegalEntityTypes.SOLE_PROPRIETORSHIP ? getFieldsWithExistingData(subjectEntity, solePropBusinessDetailsApiKeyMapping, solePropBusinessDetailsDocumentMapping) : getFieldsWithExistingData(subjectEntity, businessDetailsApiKeyMapping, businessDetailsDocumentMapping) : [],
3902
- customRules,
3903
- legalEntityType: subjectEntity?.type,
3904
- legalEntityTrustedFields: trustedFields
3905
- }));
3906
- }, [
3907
- customRules,
3908
- defaultForms,
3909
- subjectEntity,
3910
- problems.missingData,
3911
- problems.remediationActions,
3912
- trustedFields,
3913
- fieldConfigurations
3914
- ]);
3915
- /**
3916
- * Current country value must be kept in sync with what is selected in basicInformation form
3917
- */
3918
- const [prevCountry, setPrevCountry] = useState$1(multiForm.data.basicInformation?.country);
3919
- if (multiForm.data.basicInformation?.country && prevCountry !== multiForm.data.basicInformation.country) {
3920
- setCountry(multiForm.data.basicInformation.country);
3921
- setPrevCountry(multiForm.data.basicInformation.country);
3922
- setTrustedFields(void 0);
3923
- companySearchStateModel.resetCompanySearchData();
3924
- multiForm.handleChangeFor("companyStructure", "entityType")(void 0);
3925
- }
3926
- /**
3927
- * The company structures that are still valid given the registration number type and tax ID
3928
- * number type currently in the form.
3929
- */
3930
- const availableCompanyStructures = useMemo$1(() => getAvailableCompanyStructures({
3931
- country,
3932
- registrationNumberType: multiForm.data.basicInformation?.registrationNumberType,
3933
- registrationNumberExempt: multiForm.data.basicInformation?.exemptedFromRegistrationNumber,
3934
- taxIdNumberType: multiForm.data.basicInformation?.taxInformation?.find((taxInformation) => taxInformation.country === country)?.type,
3935
- legalEntity: legalEntityResponse,
3936
- accountHolder,
3937
- isSettingEnabled
3938
- }), [
3939
- accountHolder,
3940
- country,
3941
- isSettingEnabled,
3942
- legalEntityResponse,
3943
- multiForm.data.basicInformation?.exemptedFromRegistrationNumber,
3944
- multiForm.data.basicInformation?.registrationNumberType,
3945
- multiForm.data.basicInformation?.taxInformation
3946
- ]);
3947
- /**
3948
- * Infer the company structure based on the registration number type and tax ID number type
3949
- * This is used to automatically select the company structure when the user has already provided
3950
- * the necessary information to uniquely identify the company structure
3951
- */
3952
- const inferredCompanyStructure = useMemo$1(() => {
3953
- if (taskType !== "BUSINESS_DETAILS") return void 0;
3954
- if (multiForm.data.companyStructure?.entityType && multiForm.data.companyStructure?.entityType === "associationIncorporated" || multiForm.data.companyStructure?.entityType === "partnershipIncorporated") return;
3955
- return availableCompanyStructures.length === 1 ? availableCompanyStructures[0] : void 0;
3956
- }, [
3957
- availableCompanyStructures,
3958
- multiForm.data.companyStructure?.entityType,
3959
- taskType
3960
- ]);
3961
- const applyInferredCompanyStructure = () => {
3962
- if (!inferredCompanyStructure) return;
3963
- if (multiForm.data.companyStructure?.entityType === inferredCompanyStructure) return;
3964
- multiForm.handleChangeFor("companyStructure", "entityType")(inferredCompanyStructure);
3965
- };
3966
- const getRequiredForms = useCallback$1((options) => {
3967
- return buildRequiredForms({
3968
- config: {
3969
- forms: defaultForms,
3970
- requiredFields: derivedProps?.requiredFields,
3971
- optionalFields: derivedProps?.optionalFields,
3972
- isValid: multiForm.isValid ?? {},
3973
- problems,
3974
- isSettingEnabled,
3975
- accountHolder,
3976
- legalEntityResponse
3977
- },
3978
- options: {
3979
- skipCompanyStructure: !!inferredCompanyStructure,
3980
- ...options
3981
- }
3982
- });
3983
- }, [
3984
- inferredCompanyStructure,
3985
- accountHolder,
3986
- defaultForms,
3987
- derivedProps?.optionalFields,
3988
- derivedProps?.requiredFields,
3989
- isSettingEnabled,
3990
- legalEntityResponse,
3991
- multiForm.isValid,
3992
- problems
3993
- ]);
3994
- const skipBusinessSelection = useSignal(true);
3995
- const forms = useMemo$1(() => getRequiredForms({
3996
- skipBusinessSelection: skipBusinessSelection.value,
3997
- skipCompanyStructure: !!companySearchStateModel.verifiedBusiness.value?.legalForm || !!inferredCompanyStructure
3998
- }), [
3999
- getRequiredForms,
4000
- skipBusinessSelection.value,
4001
- companySearchStateModel.verifiedBusiness.value,
4002
- inferredCompanyStructure
4003
- ]);
4004
- const submit = useSubmitBusinessDetails({
4005
- country,
4006
- data: multiForm.data,
4007
- forms,
4008
- legalEntityResponse,
4009
- associatedLegalArrangement,
4010
- nestedLegalEntity,
4011
- nestedLegalEntityDetails,
4012
- efpBusinessLines,
4013
- taskType,
4014
- problems,
4015
- setProblems,
4016
- setLoadingStatus,
4017
- onExternalSubmit
4018
- });
4019
- const { handleNextClick, handleBackClick, activeForm, shouldValidate, gotoFormByFormIndex, gotoFormByFormId, steps } = useFormComposer({
4020
- problems,
4021
- forms,
4022
- onSubmit: useCallback$1(async () => {
4023
- try {
4024
- await submit();
4025
- setIsAddingBusinessDetails(false);
4026
- } catch (error) {
4027
- logger.error(error);
4028
- } finally {
4029
- setHasEnteredFormFlowBefore(true);
4030
- }
4031
- }, [logger, submit]),
4032
- triggerValidation: multiForm.triggerValidation
4033
- });
4034
- const tinMismatchConfirm = () => {
4035
- setTrustedFields([]);
4036
- tinMismatchModalOpen.value = false;
4037
- /**
4038
- * Only true when there are no search results.
4039
- *
4040
- * If the user is on 'Business Selection', we don't want to remove the page out from under them as
4041
- * nav can get a bit weird when doing so. Instead, we'll only remove it from the flow if the user is
4042
- * still on 'Basic Information', the only other place this modal is accessible from.
4043
- */
4044
- skipBusinessSelection.value = activeForm.formId !== "businessSelection";
4045
- companySearchStateModel.confirmCompany(multiForm, country);
4046
- if (country === CountryCodes.UnitedStates && companySearchStateModel.verificationMatched.value === false) isTinMatched.value = false;
4047
- handleNextClick(getRequiredForms({
4048
- skipBusinessSelection: skipBusinessSelection.value,
4049
- skipCompanyStructure: !!companySearchStateModel.verifiedBusiness.value?.legalForm
4050
- }));
4051
- };
4052
- usePrefetchCompanySearch({
4053
- country,
4054
- multiForm,
4055
- activeFormId: activeForm.formId,
4056
- isUsingCompanySearch: isUsingCompanySearch(country, taskType)
4057
- });
4058
- const { attemptBusinessSearch, confirmBusinessSelection } = useCompanySearchNextClickOverrides({
4059
- country,
4060
- multiForm,
4061
- companySearchStateModel,
4062
- getRequiredForms,
4063
- skipBusinessSelection,
4064
- setLoadingStatus,
4065
- isTinMatched,
4066
- tinMismatchModalOpen,
4067
- legalArrangementModalOpen,
4068
- registrationNumberMismatchModalOpen
4069
- });
4070
- const overrideNextClick = async () => {
4071
- if (!activeForm.isValid) return handleNextClick();
4072
- if (activeForm.formId === "basicInformation") applyInferredCompanyStructure();
4073
- if (!isUsingCompanySearch(country, taskType)) return handleNextClick();
4074
- switch (activeForm.formId) {
4075
- case "basicInformation": {
4076
- const currentForms = await attemptBusinessSearch();
4077
- if (currentForms === null) return;
4078
- return handleNextClick(currentForms);
4079
- }
4080
- case "businessSelection": {
4081
- const currentForms = await confirmBusinessSelection();
4082
- if (currentForms === null) return;
4083
- return handleNextClick(currentForms);
4084
- }
4085
- default: return handleNextClick();
4086
- }
4087
- };
4088
- const handleCancelClick = () => {
4089
- setIsAddingBusinessDetails(false);
4090
- setHasEnteredFormFlowBefore(true);
4091
- };
4092
- const summarySections = useMemo$1(() => {
4093
- if (activeForm.formId !== "summary") return [];
4094
- return formatDataForSummary(multiForm.data, forms, t, i18n.language, isFeatureEnabled);
4095
- }, [
4096
- multiForm.data,
4097
- forms,
4098
- t,
4099
- i18n.language,
4100
- isFeatureEnabled,
4101
- activeForm
4102
- ]);
4103
- const defaultDataSummarySections = useMemo$1(() => formatDataForSummary(multiForm.defaultData ?? {}, forms, t, i18n.language, isFeatureEnabled), [
4104
- multiForm.defaultData,
4105
- forms,
4106
- t,
4107
- i18n.language,
4108
- isFeatureEnabled
4109
- ]);
4110
- const handleEditForm = (formId) => {
4111
- if (formId === "registrationAddress" || formId === "operationalAddress") {
4112
- const addressFormIdx = forms.findIndex((form) => form.formId === "additionalInformation");
4113
- if (addressFormIdx > -1) gotoFormByFormIndex(addressFormIdx);
4114
- return;
4115
- }
4116
- const formIdx = forms.findIndex((form) => form.formId === formId);
4117
- if (formIdx > -1) gotoFormByFormIndex(formIdx);
4118
- };
4119
- const allValidationErrors = {};
4120
- for (const form in problems.validationErrors) for (const validationError in problems.validationErrors[form]) allValidationErrors[validationError] = problems.validationErrors[form][validationError];
4121
- const allVerificationErrors = {};
4122
- for (const form in problems.verificationErrors) for (const verificationError in problems.verificationErrors[form]) allVerificationErrors[verificationError] = problems.verificationErrors[form][verificationError];
4123
- const shouldAutoOpenFormForErrors = (Object.keys(allValidationErrors).length > 0 || Object.keys(allVerificationErrors).length > 0) && !hasEnteredFormFlowBefore;
4124
- const shouldRenderFormFlow = !isBusinessDetailsModalEnabled || isAddingBusinessDetails || shouldAutoOpenFormForErrors;
4125
- const confirmDataSelection = async (resolvedData) => {
4126
- const userProvided = resolvedData.registrationNumber !== companySearchStateModel.selectedCompany.value?.registrationNumber;
4127
- userEvents.addPageEvent("Clicked button", {
4128
- actionType: "select",
4129
- label: "confirmCompanyConflictResolution",
4130
- additionalData: { selection: userProvided ? "manual" : "recommended" }
4131
- });
4132
- /**
4133
- * If the user is on 'Business Selection', we don't want to remove the page out from under them as
4134
- * nav can get a bit weird when doing so. Instead, we'll only remove it from the flow if the user is
4135
- * still on 'Basic Information', the only other place this modal is accessible from.
4136
- */
4137
- skipBusinessSelection.value = activeForm.formId !== "businessSelection";
4138
- if (userProvided) {
4139
- registrationNumberMismatchModalOpen.value = false;
4140
- /**
4141
- * The user keeps their own registration number, but the rest of the provider's data
4142
- * (legal name, addresses, financial information) is still worth applying.
4143
- *
4144
- * The provider's company type can only be applied if it's compatible with the user's
4145
- * registration number — a GB charity number, for example, cannot belong to a
4146
- * `privateCompany`. When it isn't compatible we discard it and fall back to the company
4147
- * types the registration number allows: exactly one means we can infer it, otherwise the
4148
- * user picks it on the company structure step.
4149
- */
4150
- const providerCompanyType = companySearchStateModel.selectedCompany.value?.companyType;
4151
- const resolvedCompanyType = !!providerCompanyType && availableCompanyStructures.includes(providerCompanyType) ? providerCompanyType : inferredCompanyStructure;
4152
- companySearchStateModel.confirmCompany(multiForm, country, {
4153
- preserveRegistrationNumber: true,
4154
- companyTypeOverride: resolvedCompanyType
4155
- });
4156
- await clearCompanyData();
4157
- handleNextClick(getRequiredForms({
4158
- skipBusinessSelection: skipBusinessSelection.peek(),
4159
- skipCompanyStructure: !!resolvedCompanyType
4160
- }));
4161
- } else {
4162
- companySearchStateModel.confirmCompany(multiForm, country);
4163
- registrationNumberMismatchModalOpen.value = false;
4164
- const inferredRegistrationNumberType = resolvedData.registrationNumber ? inferCompanyRegistrationNumberType(resolvedData.registrationNumber, country, companySearchStateModel.verifiedBusiness.value?.companyType) : void 0;
4165
- handleNextClick(getRequiredForms({
4166
- skipCompanyStructure: !!companySearchStateModel.verifiedBusiness.value?.legalForm || !!inferredRegistrationNumberType,
4167
- skipBusinessSelection: skipBusinessSelection.peek()
4168
- }));
4169
- }
4170
- };
4171
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [isBusinessDetailsModalEnabled && /* @__PURE__ */ jsx(BusinessDetailsGettingStarted, {
4172
- openModal: () => {
4173
- setIsAddingBusinessDetails(true);
4174
- setHasEnteredFormFlowBefore(true);
4175
- },
4176
- handleCancelClick: () => handleHomeClick?.(),
4177
- data: defaultDataSummarySections,
4178
- t
4179
- }), shouldRenderFormFlow && /* @__PURE__ */ jsx(FormContextProvider, {
4180
- form: multiForm,
4181
- children: /* @__PURE__ */ jsx(FormFlow, {
4182
- summaryComponent: /* @__PURE__ */ jsxs(NewSummary, {
4183
- sections: summarySections,
4184
- handleEditForm,
4185
- children: [/* @__PURE__ */ jsx(ErrorPanel, {
4186
- validationErrors: allValidationErrors,
4187
- verificationErrors: allVerificationErrors,
4188
- formUtils: createFormUtils({ labels: {} }, t),
4189
- id: "ariaErrorField",
4190
- slot: "errorPanel"
4191
- }), /* @__PURE__ */ jsx("div", {
4192
- className: Summary_module_default.summaryContentLegalCaption,
4193
- slot: "extraContent",
4194
- children: t(($) => $["summaryLegalCaption"])
4195
- })]
4196
- }),
4197
- asModal: isBusinessDetailsModalEnabled,
4198
- currentStep: steps.current,
4199
- totalSteps: steps.total,
4200
- forms,
4201
- activeForm,
4202
- gotoFormByFormIndex,
4203
- gotoFormByFormId,
4204
- handleNextClick: overrideNextClick,
4205
- handleBackClick,
4206
- handleCancelClick: isBusinessDetailsModalEnabled ? handleCancelClick : handleHomeClick,
4207
- loadingStatus,
4208
- children: /* @__PURE__ */ jsxs(CompanySearchStateContext.Provider, {
4209
- value: companySearchStateModel,
4210
- children: [
4211
- /* @__PURE__ */ jsx(BusinessDetails, {
4212
- taskType,
4213
- activeForm,
4214
- country,
4215
- shouldValidate,
4216
- problems,
4217
- isTopLevelEntity: taskType === TaskTypes.BUSINESS_DETAILS
4218
- }),
4219
- /* @__PURE__ */ jsx(Show, {
4220
- when: tinMismatchModalOpen,
4221
- children: /* @__PURE__ */ jsx(TinMismatchModal, {
4222
- onCancel: () => tinMismatchModalOpen.value = false,
4223
- onConfirm: tinMismatchConfirm
4224
- })
4225
- }),
4226
- /* @__PURE__ */ jsx(Show, {
4227
- when: legalArrangementModalOpen,
4228
- children: /* @__PURE__ */ jsx(LegalArrangementModal, { onCancel: () => legalArrangementModalOpen.value = false })
4229
- }),
4230
- /* @__PURE__ */ jsx(Show, {
4231
- when: registrationNumberMismatchModalOpen,
4232
- children: /* @__PURE__ */ jsx(RegistrationNumberMismatchModal, {
4233
- companySearchStateModel,
4234
- registrationNumberMismatchModalOpen,
4235
- confirmDataSelection
4236
- })
4237
- })
4238
- ]
4239
- })
4240
- })
4241
- })] });
4242
- }
4243
- var AdditionalInformation_module_default = {
4244
- "additional-information-content": "_additional-information-content_1oltc_1",
4245
- additionalInformationContent: "_additional-information-content_1oltc_1",
4246
- "additional-information-section-heading": "_additional-information-section-heading_1oltc_7",
4247
- additionalInformationSectionHeading: "_additional-information-section-heading_1oltc_7"
4248
- };
4249
- var VerifiedBusinessCard_module_default = {
4250
- "verified-business-card": "_verified-business-card_wxp4s_1",
4251
- verifiedBusinessCard: "_verified-business-card_wxp4s_1",
4252
- "verified-business-card-content": "_verified-business-card-content_wxp4s_9",
4253
- verifiedBusinessCardContent: "_verified-business-card-content_wxp4s_9",
4254
- "verified-business-card-content-collapsed": "_verified-business-card-content-collapsed_wxp4s_20",
4255
- verifiedBusinessCardContentCollapsed: "_verified-business-card-content-collapsed_wxp4s_20",
4256
- "verified-business-card-content-expanded": "_verified-business-card-content-expanded_wxp4s_28",
4257
- verifiedBusinessCardContentExpanded: "_verified-business-card-content-expanded_wxp4s_28",
4258
- "verified-business-card-expand-button": "_verified-business-card-expand-button_wxp4s_32",
4259
- verifiedBusinessCardExpandButton: "_verified-business-card-expand-button_wxp4s_32"
4260
- };
4261
- //#endregion
4262
- //#region src/components/Business/forms/AdditionalInformation/VerifiedBusinessCard/VerifiedBusinessCard.tsx
4263
- function VerifiedBusinessCard({ verifiedBusiness, verifiedAddress }) {
4264
- const { t } = useTranslation(["common"]);
4265
- const [expanded, setExpanded] = useState$1(false);
4266
- const address = verifiedAddress?.street && verifiedAddress.city && verifiedAddress.stateOrProvince && verifiedAddress.postalCode ? `${verifiedAddress.street} ${verifiedAddress.city} ${verifiedAddress.stateOrProvince} ${verifiedAddress.postalCode}` : verifiedAddress?.street;
4267
- const addressLink = `https://www.google.com/maps/place/${address?.replaceAll(" ", "+")}`;
4268
- const baseItems = useMemo$1(() => [{
4269
- term: t(($) => $["legalCompanyName"], { ns: "common" }),
4270
- details: verifiedBusiness?.name
4271
- }, {
4272
- term: t(($) => $["registrationNumber"], { ns: "common" }),
4273
- details: verifiedBusiness?.registrationNumber
4274
- }].filter((item) => !!item.details), [
4275
- verifiedBusiness?.name,
4276
- verifiedBusiness?.registrationNumber,
4277
- t
4278
- ]);
4279
- const expandedItems = useMemo$1(() => [{
4280
- term: t(($) => $["legalForm"], { ns: "common" }),
4281
- details: verifiedBusiness?.legalForm
4282
- }, {
4283
- term: t(($) => $["address"], { ns: "common" }),
4284
- details: address && /* @__PURE__ */ jsxs(Fragment$1, { children: [
4285
- address,
4286
- /* @__PURE__ */ jsx("br", {}),
4287
- /* @__PURE__ */ jsx(Link, {
4288
- href: addressLink,
4289
- external: true,
4290
- children: t(($) => $["showOnMap"], { ns: "common" })
4291
- })
4292
- ] })
4293
- }].filter((item) => !!item.details), [
4294
- address,
4295
- addressLink,
4296
- t,
4297
- verifiedBusiness?.legalForm
4298
- ]);
4299
- const expandedContentClasses = cx(VerifiedBusinessCard_module_default.verifiedBusinessCardContent, {
4300
- [VerifiedBusinessCard_module_default.verifiedBusinessCardContentCollapsed]: !expanded,
4301
- [VerifiedBusinessCard_module_default.verifiedBusinessCardContentExpanded]: expanded
4302
- });
4303
- return /* @__PURE__ */ jsxs("section", {
4304
- className: VerifiedBusinessCard_module_default.verifiedBusinessCard,
4305
- children: [
4306
- /* @__PURE__ */ jsxs("div", {
4307
- className: VerifiedBusinessCard_module_default.verifiedBusinessCardContent,
4308
- children: [/* @__PURE__ */ jsx(StructuredList, { items: baseItems }), /* @__PURE__ */ jsx(Divider, {})]
4309
- }),
4310
- /* @__PURE__ */ jsxs("div", {
4311
- className: expandedContentClasses,
4312
- children: [/* @__PURE__ */ jsx(StructuredList, { items: expandedItems }), /* @__PURE__ */ jsx(Divider, {})]
4313
- }),
4314
- /* @__PURE__ */ jsx("div", {
4315
- className: VerifiedBusinessCard_module_default.verifiedBusinessCardExpandButton,
4316
- children: /* @__PURE__ */ jsx(Button, {
4317
- variant: "link",
4318
- onClick: () => setExpanded(!expanded),
4319
- children: expanded ? t(($) => $["hideDetails"], { ns: "common" }) : t(($) => $["showDetails"], { ns: "common" })
4320
- })
4321
- })
4322
- ]
4323
- });
4324
- }
4325
- //#endregion
4326
- //#region src/components/Business/forms/AdditionalInformation/AdditionalInformation.tsx
4327
- var ADDITIONAL_INFORMATION_FIELDS = [
4328
- ...DBA_NAME_FIELD,
4329
- ...VAT_NUMBER_FIELD,
4330
- ...LEGAL_ENTITY_IDENTIFIER_FIELD,
4331
- ...INDUSTRY_CODE_FIELD,
4332
- ...DATE_OF_INCORPORATION_FIELD,
4333
- ...STOCK_EXCHANGE_MIC_FIELD,
4334
- ...STOCK_ISIN_FIELD,
4335
- ...STOCK_TICKER_SYMBOL_FIELD,
4336
- ...EINVOICING_CODE_FIELD,
4337
- "legalFormDescription",
4338
- "residentialAddressIndicator",
4339
- ...LEGAL_FORM_FIELDS,
4340
- ...REGISTRATION_AND_OPERATIONAL_ADDRESS_FIELDS
4341
- ];
4342
- var EMPTY_OBJ = {};
4343
- function AdditionalInformation({ id, country, companyType, shouldValidate, fieldValidationErrors = EMPTY_OBJ, formVerificationErrors = EMPTY_OBJ }) {
4344
- const { t, i18n } = useTranslation(["common", "business"]);
4345
- const { form } = useFormContext();
4346
- const verifiedBusiness = useContext$1(CompanySearchStateContext).verifiedBusiness.value;
4347
- const showVerified = !!verifiedBusiness;
4348
- const showStockData = companyType === "listedPublicCompany";
4349
- const { data: matchingScenario } = useScenarios(country, LegalEntityTypes.ORGANIZATION);
4350
- const businessLineTypes = [];
4351
- if (matchingScenario?.includes("L_BANKING")) businessLineTypes.push("banking");
4352
- if (matchingScenario?.includes("L_ISSUING")) businessLineTypes.push("issuing");
4353
- const { data, defaultData, valid, errors, allFields, requiredFields, optionalFields, obscuredFields, trustedFields, handleChange: handleChangeFor } = getFormSlice(form, "additionalInformation");
4354
- /**
4355
- * Map the existing verified address data returned from the business data provider to our local address schema.
4356
- * This must be done differently than the other verified data as the address
4357
- * component maintains its own local form state.
4358
- */
4359
- const verifiedAddress = useMemo$1(() => {
4360
- if (!verifiedBusiness) return void 0;
4361
- if (defaultData?.registrationAddressStreet || defaultData?.operationalAddressStreet) return { override: { street: "" } };
4362
- return {
4363
- ...verifiedBusiness.registeredAddress && { registrationAddress: mapAddressData(verifiedBusiness.registeredAddress) },
4364
- ...verifiedBusiness.principalPlaceOfBusinessAddress && { operationalAddress: mapAddressData(verifiedBusiness.principalPlaceOfBusinessAddress) }
4365
- };
4366
- }, [
4367
- verifiedBusiness,
4368
- defaultData?.registrationAddressStreet,
4369
- defaultData?.operationalAddressStreet
4370
- ]);
4371
- const formUtils = useMemo$1(() => {
4372
- const initialProps = {
4373
- data: data ?? {},
4374
- fieldValidationErrors,
4375
- formVerificationErrors,
4376
- allFields: allFields ?? [],
4377
- requiredFields: requiredFields ?? [],
4378
- optionalFields: optionalFields ?? [],
4379
- trustedFields: trustedFields ?? [],
4380
- obscuredFields: obscuredFields ?? [],
4381
- errors: errors ?? {},
4382
- valid: valid ?? {},
4383
- handleFieldChange: handleChangeFor
4384
- };
4385
- const formUtilProps = initialProps.allFields?.reduce((acc, field) => {
4386
- switch (field) {
4387
- case "hasDoingBusinessAs": return mergeFieldMetadataIntoProps("hasDoingBusinessAs", doingBusinessAsAbsentFieldMetadata, acc);
4388
- case "doingBusinessAs": return mergeFieldMetadataIntoProps("doingBusinessAs", doingBusinessAsFieldMetadata, acc);
4389
- case "vatNumber": return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig$1[country], { vatNumberType: data?.vatNumberType }, defaultFieldMetadata$1), acc);
4390
- case "vatAbsenceReason": return mergeFieldMetadataIntoProps("vatAbsenceReason", vatAbsenceReasonMetadata, acc);
4391
- case "eInvoicingCode": return mergeFieldMetadataIntoProps("eInvoicingCode", eInvoicingCodeFieldMetadata, acc);
4392
- case "industryCodes": return mergeFieldMetadataIntoProps("industryCodes", industryCodeFieldMetadata, acc);
4393
- case "dateOfIncorporation": return mergeFieldMetadataIntoProps("dateOfIncorporation", dateOfIncorporationFieldMetadata, acc);
4394
- case "stockExchangeMIC": return mergeFieldMetadataIntoProps("stockExchangeMIC", stockExchangeMICFieldMetadata, acc);
4395
- case "stockISIN": return mergeFieldMetadataIntoProps("stockISIN", stockISINFieldMetadata, acc);
4396
- case "stockTickerSymbol": return mergeFieldMetadataIntoProps("stockTickerSymbol", stockTickerSymbolFieldMetadata, acc);
4397
- case "legalForm": return mergeFieldMetadataIntoProps("legalForm", legalFormFieldMetadata, acc);
4398
- default: return acc;
4399
- }
4400
- }, initialProps);
4401
- return createFormUtils(formUtilProps ?? initialProps, t);
4402
- }, [
4403
- country,
4404
- allFields,
4405
- data,
4406
- errors,
4407
- obscuredFields,
4408
- optionalFields,
4409
- requiredFields,
4410
- trustedFields,
4411
- valid,
4412
- handleChangeFor,
4413
- t,
4414
- fieldValidationErrors,
4415
- formVerificationErrors
4416
- ]);
4417
- const showField = (fieldKeys) => fieldKeys.some((field) => formUtils.isRequiredField(field) || formUtils.isOptionalField(field));
4418
- const { data: industryCodes } = useIndustryCodes(businessLineTypes, i18n.language, { enabled: showField(INDUSTRY_CODE_FIELD) });
4419
- return /* @__PURE__ */ jsxs("form", {
4420
- id,
4421
- children: [
4422
- /* @__PURE__ */ jsx(Header, { title: t(($) => $["additionalInformationFormHeading"], { ns: "business" }) }),
4423
- /* @__PURE__ */ jsx(ErrorPanel, {
4424
- id: "ariaErrorField",
4425
- verificationErrors: formVerificationErrors,
4426
- validationErrors: fieldValidationErrors,
4427
- formUtils
4428
- }),
4429
- /* @__PURE__ */ jsxs("div", {
4430
- className: AdditionalInformation_module_default.additionalInformationContent,
4431
- children: [
4432
- showVerified && /* @__PURE__ */ jsxs("section", { children: [/* @__PURE__ */ jsx("div", {
4433
- className: AdditionalInformation_module_default.additionalInformationSectionHeading,
4434
- children: /* @__PURE__ */ jsx(Typography, {
4435
- el: "h3",
4436
- variant: "title",
4437
- children: t(($) => $["verifiedInformation"], { ns: "business" })
4438
- })
4439
- }), /* @__PURE__ */ jsx(VerifiedBusinessCard, {
4440
- verifiedBusiness,
4441
- verifiedAddress: verifiedAddress?.override ?? verifiedAddress?.registrationAddress ?? verifiedAddress?.operationalAddress
4442
- })] }),
4443
- /* @__PURE__ */ jsxs("section", { children: [showVerified && /* @__PURE__ */ jsx("div", {
4444
- className: AdditionalInformation_module_default.additionalInformationSectionHeading,
4445
- children: /* @__PURE__ */ jsx(Typography, {
4446
- el: "h3",
4447
- variant: "title",
4448
- children: t(($) => $["otherBusinessInformation"], { ns: "business" })
4449
- })
4450
- }), /* @__PURE__ */ jsxs("fieldset", { children: [
4451
- showField(LEGAL_FORM_FIELDS) && /* @__PURE__ */ jsx(LegalFormField, {
4452
- name: "legalForm",
4453
- countryCode: country,
4454
- data: { legalForm: formUtils.getFieldData(data ?? {}, LEGAL_FORM_FIELDS).legalForm },
4455
- valid: formUtils.getFieldValid(valid ?? {}, LEGAL_FORM_FIELDS),
4456
- errorMessage: formatValidationError(errors?.legalForm?.errorMessage, t),
4457
- handleChangeFor,
4458
- readonly: false,
4459
- label: formUtils.getLabel("legalForm", "businessStructure")
4460
- }),
4461
- showField(DBA_NAME_FIELD) && /* @__PURE__ */ jsx(DBANameField, {
4462
- data: formUtils.getFieldData(data ?? {}, DBA_NAME_FIELD),
4463
- valid: formUtils.getFieldValid(valid ?? {}, DBA_NAME_FIELD),
4464
- errors: formUtils.getFieldErrors(errors ?? {}, fieldValidationErrors, DBA_NAME_FIELD),
4465
- readonly: formUtils.isReadOnly("doingBusinessAs"),
4466
- handleChangeFor
4467
- }),
4468
- showField(VAT_NUMBER_FIELD) && /* @__PURE__ */ jsx(VatNumberField, {
4469
- data: formUtils.getFieldData(data ?? {}, VAT_NUMBER_FIELD),
4470
- valid: formUtils.getFieldValid(valid ?? {}, VAT_NUMBER_FIELD),
4471
- errors: formUtils.getFieldErrors(errors ?? {}, fieldValidationErrors, VAT_NUMBER_FIELD),
4472
- labels: formUtils.getFieldLabels(VAT_NUMBER_FIELD, { exemptedFromVat: "iDontHaveAVatNumber" }),
4473
- mask: formUtils.getMask("vatNumber"),
4474
- readonly: formUtils.isReadOnly("vatNumber"),
4475
- handleChangeFor,
4476
- country,
4477
- canExempt: showField(["exemptedFromVat"]),
4478
- shouldValidate
4479
- }),
4480
- showField(LEGAL_ENTITY_IDENTIFIER_FIELD) && /* @__PURE__ */ jsx(LegalEntityIdentifierField, {
4481
- data: formUtils.getFieldData(data ?? {}, LEGAL_ENTITY_IDENTIFIER_FIELD),
4482
- valid: formUtils.getFieldValid(valid ?? {}, LEGAL_ENTITY_IDENTIFIER_FIELD),
4483
- errors: formUtils.getFieldErrors(errors ?? {}, fieldValidationErrors, LEGAL_ENTITY_IDENTIFIER_FIELD),
4484
- handleChangeFor,
4485
- shouldValidate
4486
- }),
4487
- formUtils.isRequiredField("eInvoicingCode", false) && /* @__PURE__ */ jsx(EInvoicingCodeField, {
4488
- data: formUtils.getFieldData(data ?? {}, EINVOICING_CODE_FIELD),
4489
- valid: formUtils.getFieldValid(valid ?? {}, EINVOICING_CODE_FIELD),
4490
- errors: formUtils.getFieldErrors(errors ?? {}, fieldValidationErrors, EINVOICING_CODE_FIELD),
4491
- labels: formUtils.getFieldLabels(EINVOICING_CODE_FIELD),
4492
- mask: formUtils.getMask("eInvoicingCode"),
4493
- readonly: formUtils.isReadOnly("eInvoicingCode"),
4494
- handleChangeFor
4495
- }),
4496
- showField(INDUSTRY_CODE_FIELD) && /* @__PURE__ */ jsx(IndustryCodeField, {
4497
- data: formUtils.getFieldData(data ?? {}, INDUSTRY_CODE_FIELD),
4498
- valid: formUtils.getFieldValid(valid ?? {}, INDUSTRY_CODE_FIELD),
4499
- errors: formUtils.getFieldErrors(errors ?? {}, fieldValidationErrors, INDUSTRY_CODE_FIELD),
4500
- guidanceText: t(($) => $["primaryIndustryCodeGuidance"], { ns: "business" }),
4501
- readonly: formUtils.isReadOnly("industryCodes"),
4502
- handleChangeFor,
4503
- businessLineTypes,
4504
- single: true,
4505
- industryCodes: industryCodes ?? []
4506
- }),
4507
- showField(DATE_OF_INCORPORATION_FIELD) && /* @__PURE__ */ jsx(DateOfIncorporationField, {
4508
- data: formUtils.getFieldData(data ?? {}, DATE_OF_INCORPORATION_FIELD),
4509
- valid: formUtils.getFieldValid(valid ?? {}, DATE_OF_INCORPORATION_FIELD),
4510
- errors: formUtils.getFieldErrors(errors ?? {}, fieldValidationErrors, DATE_OF_INCORPORATION_FIELD),
4511
- placeholder: t(($) => $["datePlaceholder"]),
4512
- readonly: formUtils.isReadOnly("dateOfIncorporation"),
4513
- handleChangeFor,
4514
- country
4515
- })
4516
- ] })] }),
4517
- showStockData && /* @__PURE__ */ jsxs("section", { children: [/* @__PURE__ */ jsx("div", {
4518
- className: AdditionalInformation_module_default.additionalInformationSectionHeading,
4519
- children: /* @__PURE__ */ jsx(Typography, {
4520
- el: "h3",
4521
- variant: "title",
4522
- children: t(($) => $["stockExchangeInformation"], { ns: "business" })
4523
- })
4524
- }), /* @__PURE__ */ jsxs("fieldset", { children: [
4525
- showField(STOCK_EXCHANGE_MIC_FIELD) && /* @__PURE__ */ jsx(StockExchangeMICField, {
4526
- data: formUtils.getFieldData(data ?? {}, STOCK_EXCHANGE_MIC_FIELD),
4527
- valid: formUtils.getFieldValid(valid ?? {}, STOCK_EXCHANGE_MIC_FIELD),
4528
- errors: formUtils.getFieldErrors(errors ?? {}, fieldValidationErrors, STOCK_EXCHANGE_MIC_FIELD),
4529
- mask: formUtils.getMask("stockExchangeMIC"),
4530
- readonly: formUtils.isReadOnly("stockExchangeMIC"),
4531
- shouldValidate,
4532
- handleChangeFor
4533
- }),
4534
- showField(STOCK_ISIN_FIELD) && /* @__PURE__ */ jsx(StockISINField, {
4535
- data: formUtils.getFieldData(data ?? {}, STOCK_ISIN_FIELD),
4536
- valid: formUtils.getFieldValid(valid ?? {}, STOCK_ISIN_FIELD),
4537
- errors: formUtils.getFieldErrors(errors ?? {}, fieldValidationErrors, STOCK_ISIN_FIELD),
4538
- mask: formUtils.getMask("stockISIN"),
4539
- readonly: formUtils.isReadOnly("stockISIN"),
4540
- shouldValidate,
4541
- handleChangeFor
4542
- }),
4543
- showField(STOCK_TICKER_SYMBOL_FIELD) && /* @__PURE__ */ jsx(StockTickerSymbolField, {
4544
- data: formUtils.getFieldData(data ?? {}, STOCK_TICKER_SYMBOL_FIELD),
4545
- valid: formUtils.getFieldValid(valid ?? {}, STOCK_TICKER_SYMBOL_FIELD),
4546
- errors: formUtils.getFieldErrors(errors ?? {}, fieldValidationErrors, STOCK_TICKER_SYMBOL_FIELD),
4547
- mask: formUtils.getMask("stockTickerSymbol"),
4548
- readonly: formUtils.isReadOnly("stockTickerSymbol"),
4549
- shouldValidate,
4550
- handleChangeFor
4551
- })
4552
- ] })] }),
4553
- /* @__PURE__ */ jsx(RegistrationAndOperationalAddressFields, {
4554
- country,
4555
- readOnlyAddressFields: verifiedBusiness?.registeredAddress?.state && verifiedBusiness.registeredAddress.state === form.data.basicInformation?.stateOrProvince ? ["stateOrProvince"] : [],
4556
- entityType: "business",
4557
- data,
4558
- valid,
4559
- errors,
4560
- requiredFields,
4561
- optionalFields,
4562
- trustedFields,
4563
- fieldValidationErrors,
4564
- handleChangeFor,
4565
- formUtils
4566
- })
4567
- ]
4568
- })
4569
- ]
4570
- });
4571
- }
4572
- //#endregion
4573
- //#region src/components/Business/forms/BusinessDetails/forms.ts
4574
- var getFinancialInformationFields = (country) => {
4575
- return country === CountryCodes.UnitedKingdom ? financialInformationFields : financialInformationFieldsForEu;
4576
- };
4577
- var staticBusinessDetailsForms = {
4578
- basicInformation: {
4579
- formId: "basicInformation",
4580
- formName: "basicInformationFormName",
4581
- fields: BASIC_INFORMATION_FIELDS
4582
- },
4583
- businessSelection: {
4584
- formId: "businessSelection",
4585
- formName: "businessSelectionFormName",
4586
- fields: BUSINESS_SELECTION_FIELDS
4587
- },
4588
- companyStructure: {
4589
- formId: "companyStructure",
4590
- formName: "companyStructureFormName",
4591
- fields: COMPANY_STRUCTURE_FIELDS
4592
- },
4593
- additionalInformation: {
4594
- formId: "additionalInformation",
4595
- formName: "additionalInformationFormName",
4596
- fields: ADDITIONAL_INFORMATION_FIELDS
4597
- },
4598
- companyRegistrationDocument: {
4599
- formId: "companyRegistrationDocument",
4600
- formName: "companyRegistrationDocumentFormName",
4601
- fields: ["registrationDocument"]
4602
- },
4603
- companyTaxDocument: {
4604
- formId: "companyTaxDocument",
4605
- formName: "companyTaxDocumentFormName",
4606
- fields: ["taxDocument"]
4607
- },
4608
- companyProofOfDirectorDocument: {
4609
- formId: "companyProofOfDirectorDocument",
4610
- formName: "proofOfDirectorFormName",
4611
- fields: ["proofOfDirector"]
4612
- },
4613
- companyProofOfSignatoryDocument: {
4614
- formId: "companyProofOfSignatoryDocument",
4615
- formName: "proofOfSignatoryFormName",
4616
- fields: ["proofOfSignatory"]
4617
- },
4618
- companyProofOfAddressDocument: {
4619
- formId: "companyProofOfAddressDocument",
4620
- formName: "proofOfAddressFormName",
4621
- fields: ["proofOfAddress"]
4622
- },
4623
- companyProofOfOwnershipDocument: {
4624
- formId: "companyProofOfOwnershipDocument",
4625
- formName: "proofOfOwnershipFormName",
4626
- fields: ["proofOfOwnership"]
4627
- },
4628
- companyConstitutionalDocument: {
4629
- formId: "companyConstitutionalDocument",
4630
- formName: "constitutionalDocumentFormName",
4631
- fields: ["constitutionalDocument"]
4632
- }
4633
- };
4634
- var getForms = (country) => ({
4635
- basicInformation: staticBusinessDetailsForms.basicInformation,
4636
- businessSelection: staticBusinessDetailsForms.businessSelection,
4637
- companyStructure: staticBusinessDetailsForms.companyStructure,
4638
- additionalInformation: staticBusinessDetailsForms.additionalInformation,
4639
- companyRegistrationDocument: staticBusinessDetailsForms.companyRegistrationDocument,
4640
- companyTaxDocument: staticBusinessDetailsForms.companyTaxDocument,
4641
- companyProofOfDirectorDocument: staticBusinessDetailsForms.companyProofOfDirectorDocument,
4642
- companyProofOfSignatoryDocument: staticBusinessDetailsForms.companyProofOfSignatoryDocument,
4643
- companyProofOfAddressDocument: staticBusinessDetailsForms.companyProofOfAddressDocument,
4644
- companyProofOfOwnershipDocument: staticBusinessDetailsForms.companyProofOfOwnershipDocument,
4645
- companyFinancialInformation: {
4646
- formId: "companyFinancialInformation",
4647
- formName: "financialInformation",
4648
- fields: getFinancialInformationFields(country)
4649
- },
4650
- companyConstitutionalDocument: staticBusinessDetailsForms.companyConstitutionalDocument
4651
- });
4652
- var documentFormsIds = [
4653
- "companyRegistrationDocument",
4654
- "companyTaxDocument",
4655
- "companyProofOfDirectorDocument",
4656
- "companyProofOfSignatoryDocument",
4657
- "companyProofOfAddressDocument",
4658
- "companyConstitutionalDocument",
4659
- "companyProofOfOwnershipDocument"
4660
- ];
4661
- //#endregion
4662
- //#region src/api/documents/useDocuments.ts
4663
- var useDocuments = (documentDetails, entityId, options) => {
4664
- const { rootLegalEntityId, baseUrl } = useApiContext();
4665
- const documentUtils = documentApiUtils({
4666
- baseUrl: baseUrl.value,
4667
- rootLegalEntityId: rootLegalEntityId.value
4668
- });
4669
- return useQuery({
4670
- queryKey: [
4671
- "documents",
4672
- documentDetails.map((details) => details.id).sort((a, b) => a.localeCompare(b)).join(","),
4673
- entityId
4674
- ],
4675
- queryFn: () => documentUtils.fetchDocuments(documentDetails, entityId),
4676
- retry: 0,
4677
- ...options
4678
- });
4679
- };
4680
- //#endregion
4681
- //#region src/components/Business/hooks/useBusinessDetailsData.ts
4682
- var ALLOWED_SOF_SERVICES = ["issuing", "banking"];
4683
- function useBusinessDetailsData(taskType, associatedLegalArrangement, nestedLegalEntity) {
4684
- const { t } = useTranslation(["common"]);
4685
- const { data: rootLe } = useLegalEntity(ROOT_LE);
4686
- const { accountHolder } = useAccountHolder();
4687
- const { showToast } = useToastContext();
4688
- const { isSettingEnabled } = useSettingsContext();
4689
- const { data: efpBusinessLines, isLoading: fetchingEfpBusinessLines } = useBusinessLines(ALLOWED_SOF_SERVICES, { enabled: isSettingEnabled("allowBusinessLines") });
4690
- const isSoleProp = accountHolder === "mySoleProprietorName";
4691
- const subjectEntity = !(taskType !== TaskTypes.BUSINESS_DETAILS) ? rootLe : isSoleProp ? associatedLegalArrangement : nestedLegalEntity;
4692
- const { isLoading: fetchingDocuments, isError } = useDocuments(subjectEntity?.documentDetails || [], subjectEntity?.id || "", { enabled: subjectEntity?.documentDetails && subjectEntity.documentDetails.length > 0 });
4693
- useEffect$1(() => {
4694
- if (isError) showToast({
4695
- label: t(($) => $["failedToFetchRelevantDocuments"], { ns: "common" }),
4696
- variant: "error"
4697
- });
4698
- }, [
4699
- isError,
4700
- showToast,
4701
- t
4702
- ]);
4703
- let mappedDocs;
4704
- if (subjectEntity?.id) mappedDocs = mapApiDocumentToBusinessDetailsDocuments(subjectEntity.id);
4705
- return rootLe && !fetchingEfpBusinessLines && !fetchingDocuments ? {
4706
- data: {
4707
- rootLe,
4708
- efpBusinessLines,
4709
- documents: mappedDocs
4710
- },
4711
- isLoading: false
4712
- } : {
4713
- data: {
4714
- rootLe,
4715
- efpBusinessLines,
4716
- documents: mappedDocs
4717
- },
4718
- isLoading: true
4719
- };
4720
- }
4721
- //#endregion
4722
- export { getForms as n, BusinessDetailsDropin as r, useBusinessDetailsData as t };