@adyen/kyc-components 4.0.0-compact.0 → 4.0.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 (1113) hide show
  1. package/README.md +30 -43
  2. package/dist/4-people-BzyXLUF9.js +24 -0
  3. package/dist/AD-BQAadLyG.js +23 -0
  4. package/dist/AT-BI8ju2NH.js +23 -0
  5. package/dist/AcceptTermsOfServiceComponent-CmHBNGjM.js +659 -0
  6. package/dist/Accordion-Cp_VkxR6.js +88 -0
  7. package/dist/AccountSetupRejected-CoxWTlar.js +26 -0
  8. package/dist/ActionBar-CxUKVmTE.js +31 -0
  9. package/dist/Address-Db6Q_KUo.js +1348 -0
  10. package/dist/Alert-DEiOX0nw.js +159 -0
  11. package/dist/Avatar-3K6S_tIS.js +60 -0
  12. package/dist/BE-nWHKW0xQ.js +23 -0
  13. package/dist/BG-DlvaKo4n.js +27 -0
  14. package/dist/BusinessDetailsMultiformDropin-CYoIN4Fa.js +4220 -0
  15. package/dist/BusinessFinancingComponent-DyvM-fsY.js +54 -0
  16. package/dist/BusinessFinancingDropin-BOvR4LwU.js +1853 -0
  17. package/dist/BusinessFinancingPage-8C0ztBfS.js +43 -0
  18. package/dist/BusinessTypeSelectionPage-DpZAsa8K.js +427 -0
  19. package/dist/CH-TX4BTE2y.js +23 -0
  20. package/dist/CY-D59Nypl7.js +23 -0
  21. package/dist/CZ-B6iI1GbE.js +33 -0
  22. package/dist/Card-CdpPhK9y.js +82 -0
  23. package/dist/ConstitutionalDocument-NLs6ka9K.js +143 -0
  24. package/dist/CountryField-9w8wRZMW.js +843 -0
  25. package/dist/CreateIndividualComponent-zGcoEyq0.js +71 -0
  26. package/dist/CreateTransferInstrumentComponent-Ct_v-IyH.js +63 -0
  27. package/dist/Currency-53s7DEeh.js +183 -0
  28. package/dist/CustomerSupport-BRcUQ4fR.js +153 -0
  29. package/dist/DE-CsuX_tSL.js +23 -0
  30. package/dist/DK-oQEFrF6o.js +33 -0
  31. package/dist/DebugModal-CokbXGK9.js +413 -0
  32. package/dist/DecisionMakerDetailsPage-B5cLY8iP.js +106 -0
  33. package/dist/DecisionMakers-BQ24LfqB.js +830 -0
  34. package/dist/DropinLayout-CBP_cHLC.js +17 -0
  35. package/dist/EE-3WZV5Ejt.js +23 -0
  36. package/dist/ES-NfxpqbC2.js +23 -0
  37. package/dist/EmbeddedStatus-DB9B_u3L.js +99 -0
  38. package/dist/EndStateLayout-BWC5aqVS.js +71 -0
  39. package/dist/EntityAssociation-gzYdcHoL.js +159 -0
  40. package/dist/EntityGuidanceStatus-BKeZKnbP.js +105 -0
  41. package/dist/FI-CHQIvHa-.js +23 -0
  42. package/dist/FR-MWZyWX3x.js +23 -0
  43. package/dist/FormFlow-Cf3Ff2qw.js +224 -0
  44. package/dist/FormNavigation-CjgZbv9G.js +144 -0
  45. package/dist/FormWrapper-dbBZegkX.js +135 -0
  46. package/dist/GG-CPoMVQPc.js +33 -0
  47. package/dist/GI-DxmBwVD_.js +41 -0
  48. package/dist/GR-Rk0pXlNw.js +23 -0
  49. package/dist/HR-WapHW2fw.js +23 -0
  50. package/dist/HU-DCOMuOhe.js +32 -0
  51. package/dist/IE-BkgtVgDi.js +23 -0
  52. package/dist/IM-Wr4iDT94.js +33 -0
  53. package/dist/IS-C-Cgc6zp.js +27 -0
  54. package/dist/IT-CXekiddL.js +23 -0
  55. package/dist/IndividualOnfido-Cc7dydKq.js +9594 -0
  56. package/dist/IndividualOnfidoDropin-BpU2cL4E.js +2497 -0
  57. package/dist/InputText-Dsw9kiwL.js +249 -0
  58. package/dist/Introduction-C8mTk4l_.js +300 -0
  59. package/dist/JE-B4gj54Hg.js +33 -0
  60. package/dist/JpAddress-R81eO-aY.js +280 -0
  61. package/dist/LI-L0ZAALRT.js +23 -0
  62. package/dist/LT-Ao2uagV9.js +23 -0
  63. package/dist/LU-B7LRUuc6.js +23 -0
  64. package/dist/LV-DZeGjA2G.js +23 -0
  65. package/dist/LegalRepresentativeDetailsPage-DIQX18v2.js +60 -0
  66. package/dist/ListItem-D3p6EgP_.js +69 -0
  67. package/dist/MC-EDVNGWhy.js +23 -0
  68. package/dist/MT-B9my7RlP.js +23 -0
  69. package/dist/ManageIndividualComponent-CmM-vP9E.js +46 -0
  70. package/dist/ManageTermsOfServiceComponent-C3hXZJx5.js +52 -0
  71. package/dist/ManageTransferInstrumentComponent-co6LYrVY.js +287 -0
  72. package/dist/MaybeModal-BVQOzETz.js +25 -0
  73. package/dist/Modal-CloeVnNp.js +149 -0
  74. package/dist/NL-VXAFOhV5.js +23 -0
  75. package/dist/NO-Cx1VSh2W.js +32 -0
  76. package/dist/OnboardingDropinComponent-CDAK4v1o.js +7908 -0
  77. package/dist/PL-BZW1hGvD.js +32 -0
  78. package/dist/PT-OpU4MU3L.js +23 -0
  79. package/dist/PayoutDetailsDropin-DCrlrNki.js +4841 -0
  80. package/dist/RO-Cz6Sh0ls.js +23 -0
  81. package/dist/Review-Dqn49vJM.js +83 -0
  82. package/dist/RootBusinessDetailsPage-DSEq3TIn.js +61 -0
  83. package/dist/RootBusinessLinesPage-CbPhOber.js +1118 -0
  84. package/dist/RootIndividualDetailsPage-Bp_7gSIB.js +71 -0
  85. package/dist/SE-B5K-FkQd.js +33 -0
  86. package/dist/SI-BOGTNLPa.js +23 -0
  87. package/dist/SK-BOVrp_Av.js +23 -0
  88. package/dist/SM-meowwILA.js +23 -0
  89. package/dist/SignPCIComponent-B6kYuqT_.js +304 -0
  90. package/dist/SingpassSelection-aDrNTYr3.js +130 -0
  91. package/dist/SoleProprietorshipPage-HnUsyjKp.js +60 -0
  92. package/dist/SourceOfFundsPage-BkMEIV_L.js +2383 -0
  93. package/dist/StepProgressIndicator-BgeMe93n.js +78 -0
  94. package/dist/StoreProvider-BFN15Go9.js +7674 -0
  95. package/dist/Summary-BkE_c8pU.js +204 -0
  96. package/dist/TaxReportingDropin-LG9zvOMN.js +502 -0
  97. package/dist/TrustDetailsPage-C8w8pEvB.js +2149 -0
  98. package/dist/TrustMemberCompanyPage-IDEwpLW3.js +73 -0
  99. package/dist/TrustMemberIndividualPage-rKB3iVFk.js +66 -0
  100. package/dist/TrustMemberRoleAndTypePage-CLtX8V0M.js +985 -0
  101. package/dist/TrustMembersOverview-Bs203hm0.js +438 -0
  102. package/dist/UnincorporatedPartnershipIndividualPage-CBTaUEld.js +65 -0
  103. package/dist/UnincorporatedPartnershipMemberCompanyPage-ZnLe9Uq3.js +76 -0
  104. package/dist/UnincorporatedPartnershipMemberRoleAndTypePage-BXImA2c_.js +281 -0
  105. package/dist/UnincorporatedPartnershipMembersOverview-c7k2JzcO.js +172 -0
  106. package/dist/VA-DXsYTCoh.js +23 -0
  107. package/dist/VerificationErrorAlert-uubpHQGE.js +79 -0
  108. package/dist/ViewVerificationStatusComponent-DO9L2hEO.js +180 -0
  109. package/dist/adyen-business-financing.js +5 -6
  110. package/dist/adyen-individual-configuration.js +7 -8
  111. package/dist/adyen-individual-status.js +7 -8
  112. package/dist/adyen-kyc-components.js +38 -33
  113. package/dist/adyen-onboarding.js +4 -5
  114. package/dist/adyen-terms-of-service-management.js +7 -8
  115. package/dist/adyen-terms-of-service-status.js +7 -8
  116. package/dist/adyen-transfer-instrument-configuration.js +7 -8
  117. package/dist/adyen-transfer-instrument-management.js +7 -8
  118. package/dist/adyen-verification-status.js +5 -6
  119. package/dist/arrow-right-KxA3SvQj.js +14 -0
  120. package/dist/bag-BPumznWh.js +14 -0
  121. package/dist/bank-D6FiNBhs.js +14 -0
  122. package/dist/bg-BG-B7Xs_t04.js +13 -0
  123. package/dist/bg-BG-BY3Wa361.js +54 -0
  124. package/dist/bg-BG-BvLl6gaB.js +13 -0
  125. package/dist/bg-BG-CepHap8j.js +68 -0
  126. package/dist/bg-BG-Coja327N.js +24 -0
  127. package/dist/bg-BG-D9J6LnkI.js +57 -0
  128. package/dist/bg-BG-DH45-0B-.js +29 -0
  129. package/dist/bg-BG-DRkMqyL8.js +13 -0
  130. package/dist/bg-BG-DcxZ1tmt.js +32 -0
  131. package/dist/bg-BG-Dp4LxSP7.js +37 -0
  132. package/dist/bg-BG-DpIAKQve.js +113 -0
  133. package/dist/bg-BG-er0t4jTs.js +27 -0
  134. package/dist/bg-BG-mLSjG76Q.js +13 -0
  135. package/dist/bg-BG-wVquMNtT.js +55 -0
  136. package/dist/bin-Bz6KOIeE.js +18 -0
  137. package/dist/capital-GVQ3svwN.js +17 -0
  138. package/dist/cash-stack-D9AoDDwt.js +22 -0
  139. package/dist/certificate-CdEWgHQf.js +17 -0
  140. package/dist/checkmark-Q7x6tGhy.js +14 -0
  141. package/dist/checkmark-circle-fill-CsvN5_PL.js +17 -0
  142. package/dist/checkmark-circle-x7dzbp3I.js +20 -0
  143. package/dist/checkmark-small-D35myntq.js +14 -0
  144. package/dist/chevron-down-C2iDorpW.js +14 -0
  145. package/dist/chevron-left-ztPO84q-.js +14 -0
  146. package/dist/chevron-right-C_JN0oDt.js +14 -0
  147. package/dist/chevron-up-CgG8n25g.js +14 -0
  148. package/dist/circle-Bt3Nlr3q.js +17 -0
  149. package/dist/circle-small-filled-YMzP6yQU.js +14 -0
  150. package/dist/clock-BZHremOA.js +20 -0
  151. package/dist/coins-fkAk6dCo.js +17 -0
  152. package/dist/contract-BTa4HltT.js +14 -0
  153. package/dist/cross-Cn09MtQ_.js +14 -0
  154. package/dist/cross-circle-fill-small-DCz52AuN.js +14 -0
  155. package/dist/cs-CZ--jOkoHVS.js +55 -0
  156. package/dist/cs-CZ-BDf9m4Rw.js +113 -0
  157. package/dist/cs-CZ-BEFeaKsV.js +54 -0
  158. package/dist/cs-CZ-BP7niQM9.js +68 -0
  159. package/dist/cs-CZ-BSWXexr4.js +13 -0
  160. package/dist/cs-CZ-BsV9NiQ2.js +13 -0
  161. package/dist/cs-CZ-CQNBae2b.js +27 -0
  162. package/dist/cs-CZ-CyLqoG1j.js +37 -0
  163. package/dist/cs-CZ-D4Hg-t16.js +32 -0
  164. package/dist/cs-CZ-DPVMeRye.js +29 -0
  165. package/dist/cs-CZ-DXtJsBPz.js +24 -0
  166. package/dist/cs-CZ-DY_pQqAT.js +57 -0
  167. package/dist/cs-CZ-DalFZigH.js +13 -0
  168. package/dist/cs-CZ-hT5w5It6.js +13 -0
  169. package/dist/da-DK-CI-vfqPo.js +113 -0
  170. package/dist/da-DK-D4Ojw97o.js +13 -0
  171. package/dist/da-DK-DCJhV2qS.js +32 -0
  172. package/dist/da-DK-DU4dCNEw.js +29 -0
  173. package/dist/da-DK-DWA8uOd8.js +24 -0
  174. package/dist/da-DK-DYpfNZdP.js +37 -0
  175. package/dist/da-DK-DZwlENGe.js +13 -0
  176. package/dist/da-DK-Dc0QYG8m.js +68 -0
  177. package/dist/da-DK-JHZnsI59.js +55 -0
  178. package/dist/da-DK-P3YSaBqs.js +13 -0
  179. package/dist/da-DK-R_y7YwqQ.js +13 -0
  180. package/dist/da-DK-gnPgzwrG.js +27 -0
  181. package/dist/da-DK-jK7c9UL0.js +57 -0
  182. package/dist/de-DE-BR6CLZw6.js +13 -0
  183. package/dist/de-DE-BXt1K0Tr.js +37 -0
  184. package/dist/de-DE-BcuLmcC8.js +13 -0
  185. package/dist/de-DE-D3lLuF8z.js +27 -0
  186. package/dist/de-DE-D50lGOJE.js +24 -0
  187. package/dist/de-DE-DXR3EpEc.js +13 -0
  188. package/dist/de-DE-DwOQKCuU.js +32 -0
  189. package/dist/de-DE-Dz2OsS1F.js +68 -0
  190. package/dist/de-DE-Dz2l6jRl.js +29 -0
  191. package/dist/de-DE-VGGEkxUT.js +55 -0
  192. package/dist/de-DE-nG2MBigU.js +113 -0
  193. package/dist/de-DE-opyC1JO-.js +13 -0
  194. package/dist/de-DE-wmerDL2e.js +57 -0
  195. package/dist/debouncedInputEvent-Dlbc7VjU.js +109 -0
  196. package/dist/debugStore-BvbyN1Oi.js +14 -0
  197. package/dist/document-1-C08ut-Dt.js +14 -0
  198. package/dist/document-person-vxlA6C5f.js +20 -0
  199. package/dist/documentUtils-CUgKVLK4.js +218 -0
  200. package/dist/download-Drhk9k1f.js +17 -0
  201. package/dist/dropinUtils-D2lBlNWp.js +202 -0
  202. package/dist/edit-1-CFoDTMvQ.js +14 -0
  203. package/dist/el-GR-B3FHqTOX.js +13 -0
  204. package/dist/el-GR-B5j7VZ3E.js +54 -0
  205. package/dist/el-GR-B90M6tcZ.js +37 -0
  206. package/dist/el-GR-BHG69mXl.js +68 -0
  207. package/dist/el-GR-BX-MyQZY.js +113 -0
  208. package/dist/el-GR-Btrk_npt.js +57 -0
  209. package/dist/el-GR-CKHMsdx2.js +24 -0
  210. package/dist/el-GR-CWd7XYDU.js +13 -0
  211. package/dist/el-GR-CofvCav-.js +13 -0
  212. package/dist/el-GR-DtFE64KX.js +13 -0
  213. package/dist/el-GR-Hk4NbZSY.js +32 -0
  214. package/dist/el-GR-MLFY-Gg7.js +29 -0
  215. package/dist/el-GR-XRux2Wpv.js +27 -0
  216. package/dist/el-GR-gkaKwnln.js +55 -0
  217. package/dist/en-US-B96dpVon.js +27 -0
  218. package/dist/en-US-BPI4FZwa.js +113 -0
  219. package/dist/en-US-BQZhzROc.js +32 -0
  220. package/dist/en-US-CozY33On.js +13 -0
  221. package/dist/en-US-CzEL6t1W.js +55 -0
  222. package/dist/en-US-D-B35AoN.js +68 -0
  223. package/dist/en-US-D2yrwtzT.js +24 -0
  224. package/dist/en-US-DYo4OF-P.js +29 -0
  225. package/dist/en-US-Dg505Oh3.js +37 -0
  226. package/dist/en-US-fyGPkcqX.js +13 -0
  227. package/dist/en-US-gsp7CD_E.js +57 -0
  228. package/dist/en-US-h0JneJJl.js +13 -0
  229. package/dist/es-ES-0ROz-BJh.js +29 -0
  230. package/dist/es-ES-BAg3NqQO.js +13 -0
  231. package/dist/es-ES-BI_jdT67.js +68 -0
  232. package/dist/es-ES-BOoPqnPI.js +32 -0
  233. package/dist/es-ES-BhINIOee.js +13 -0
  234. package/dist/es-ES-BhNhIf08.js +37 -0
  235. package/dist/es-ES-Bn9_0wK0.js +55 -0
  236. package/dist/es-ES-CEp-ttVJ.js +13 -0
  237. package/dist/es-ES-CXDJLKAI.js +27 -0
  238. package/dist/es-ES-DF_L5EDd.js +24 -0
  239. package/dist/es-ES-Q16q2JJ6.js +113 -0
  240. package/dist/es-ES-Qnc0Q6JH.js +57 -0
  241. package/dist/es-ES-yMXcOjDL.js +13 -0
  242. package/dist/et-EE--cL_YqWe.js +27 -0
  243. package/dist/et-EE-BMgFCxds.js +37 -0
  244. package/dist/et-EE-BYSnV6Iq.js +55 -0
  245. package/dist/et-EE-Be__VK7Y.js +32 -0
  246. package/dist/et-EE-Bk2IHQWP.js +13 -0
  247. package/dist/et-EE-BuBiNLCi.js +24 -0
  248. package/dist/et-EE-C8RrUpLm.js +13 -0
  249. package/dist/et-EE-C_PZO2aI.js +68 -0
  250. package/dist/et-EE-Ci8RU2wg.js +13 -0
  251. package/dist/et-EE-DUWZ2Vqm.js +54 -0
  252. package/dist/et-EE-DmShD6oS.js +113 -0
  253. package/dist/et-EE-TzXANcP2.js +57 -0
  254. package/dist/et-EE-esci5847.js +29 -0
  255. package/dist/et-EE-x29FUaYN.js +118 -0
  256. package/dist/external-link-DCMYUMfW.js +14 -0
  257. package/dist/fi-FI-B_P4BAda.js +113 -0
  258. package/dist/fi-FI-CDISJifz.js +13 -0
  259. package/dist/fi-FI-DH6jpo9K.js +24 -0
  260. package/dist/fi-FI-DjlB2a7k.js +13 -0
  261. package/dist/fi-FI-Dn2MC8uW.js +57 -0
  262. package/dist/fi-FI-MiyuQqH8.js +13 -0
  263. package/dist/fi-FI-PVFqd5Ra.js +55 -0
  264. package/dist/fi-FI-bZzNB1WB.js +32 -0
  265. package/dist/fi-FI-fArobrt5.js +27 -0
  266. package/dist/fi-FI-hwzizPnr.js +68 -0
  267. package/dist/fi-FI-xXrvDLFe.js +29 -0
  268. package/dist/fi-FI-xqnQ38yC.js +13 -0
  269. package/dist/fi-FI-ysUrBilO.js +37 -0
  270. package/dist/fieldConfigurations-C38LzPl3.js +1402 -0
  271. package/dist/fr-FR-BSvSKazD.js +37 -0
  272. package/dist/fr-FR-BSynpexF.js +13 -0
  273. package/dist/fr-FR-BWX14yb7.js +57 -0
  274. package/dist/fr-FR-BnblnBsx.js +24 -0
  275. package/dist/fr-FR-Bw9O-QAU.js +29 -0
  276. package/dist/fr-FR-CUdiBCVB.js +113 -0
  277. package/dist/fr-FR-CYZXbwc9.js +68 -0
  278. package/dist/fr-FR-CiwkAb3E.js +27 -0
  279. package/dist/fr-FR-DGMVrsJv.js +13 -0
  280. package/dist/fr-FR-Dx-CiPdB.js +13 -0
  281. package/dist/fr-FR-aJ3cg4x0.js +13 -0
  282. package/dist/fr-FR-cTKcuHqX.js +32 -0
  283. package/dist/fr-FR-mJK4hjwD.js +55 -0
  284. package/dist/getFieldsWithExistingData-B0l_1eCG.js +22 -0
  285. package/dist/getName-CIw0MR9e.js +48 -0
  286. package/dist/gift-CQ_DEma7.js +14 -0
  287. package/dist/graph-BJmqglH2.js +21 -0
  288. package/dist/graph-up-Bq6adtlX.js +20 -0
  289. package/dist/hasDataChanged-B-_hLK5I.js +19 -0
  290. package/dist/headquarter-DNYyuuFq.js +21 -0
  291. package/dist/hotel-BuNql78Z.js +22 -0
  292. package/dist/hr-HR-BHt_jklG.js +13 -0
  293. package/dist/hr-HR-BLpGb4f2.js +37 -0
  294. package/dist/hr-HR-CXpCIMhI.js +113 -0
  295. package/dist/hr-HR-CZLSQruE.js +57 -0
  296. package/dist/hr-HR-CnP5sqih.js +54 -0
  297. package/dist/hr-HR-ComCqan_.js +32 -0
  298. package/dist/hr-HR-D5V7g9H2.js +13 -0
  299. package/dist/hr-HR-D8_yhtIo.js +29 -0
  300. package/dist/hr-HR-De5kHU8U.js +24 -0
  301. package/dist/hr-HR-DtfHQVe0.js +27 -0
  302. package/dist/hr-HR-VivDwwdW.js +13 -0
  303. package/dist/hr-HR-bE6cvRCQ.js +68 -0
  304. package/dist/hr-HR-n7aMHIpM.js +13 -0
  305. package/dist/hr-HR-qmYyO-nT.js +55 -0
  306. package/dist/hu-HU-BTlpbCpc.js +54 -0
  307. package/dist/hu-HU-BcogZby3.js +24 -0
  308. package/dist/hu-HU-CS-7iNS4.js +55 -0
  309. package/dist/hu-HU-Ca9Hex26.js +37 -0
  310. package/dist/hu-HU-DDsdPI5V.js +13 -0
  311. package/dist/hu-HU-DG-NUDx4.js +68 -0
  312. package/dist/hu-HU-DUGz5q5D.js +32 -0
  313. package/dist/hu-HU-D_DvlCMw.js +13 -0
  314. package/dist/hu-HU-DqEBeq-w.js +113 -0
  315. package/dist/hu-HU-I4-KFzvz.js +27 -0
  316. package/dist/hu-HU-KliQetm5.js +29 -0
  317. package/dist/hu-HU-WEtpzb41.js +13 -0
  318. package/dist/hu-HU-hbVM6tMS.js +13 -0
  319. package/dist/hu-HU-kp8Go5hZ.js +57 -0
  320. package/dist/iframeWidget-yBLSAmf8.js +234 -0
  321. package/dist/image-BSihO8lR.js +17 -0
  322. package/dist/info-vHTZWoJ7.js +21 -0
  323. package/dist/it-IT-B0YGvVgW.js +57 -0
  324. package/dist/it-IT-BTWkWSJq.js +55 -0
  325. package/dist/it-IT-C2MZo4KT.js +13 -0
  326. package/dist/it-IT-C_651bEP.js +13 -0
  327. package/dist/it-IT-Ckv8Ce4e.js +24 -0
  328. package/dist/it-IT-DERflsUd.js +32 -0
  329. package/dist/it-IT-DIbH-udG.js +27 -0
  330. package/dist/it-IT-DLm11dH5.js +13 -0
  331. package/dist/it-IT-Erh1DIlj.js +68 -0
  332. package/dist/it-IT-MwpjRAG6.js +29 -0
  333. package/dist/it-IT-NCFAqV1F.js +113 -0
  334. package/dist/it-IT-Qfzc8jnW.js +37 -0
  335. package/dist/it-IT-yV7ewjWU.js +13 -0
  336. package/dist/ja-JP-2u5fqLWF.js +29 -0
  337. package/dist/ja-JP-Bktpl_2b.js +118 -0
  338. package/dist/ja-JP-BoxeBgOv.js +32 -0
  339. package/dist/ja-JP-CHQ64lw1.js +37 -0
  340. package/dist/ja-JP-CSz7fEkn.js +55 -0
  341. package/dist/ja-JP-CWe8f7m4.js +13 -0
  342. package/dist/ja-JP-C_-moDrA.js +113 -0
  343. package/dist/ja-JP-CbgaW99b.js +54 -0
  344. package/dist/ja-JP-Ctsk4z4q.js +151 -0
  345. package/dist/ja-JP-CvNJvxkQ.js +218 -0
  346. package/dist/ja-JP-Dz9IVH4p.js +57 -0
  347. package/dist/ja-JP-FWHXsXlW.js +24 -0
  348. package/dist/ja-JP-ThzG9vIo.js +68 -0
  349. package/dist/ja-JP-bz7ekGnF.js +27 -0
  350. package/dist/localizeDateString-C-G2nUor.js +27 -0
  351. package/dist/location-Q4oKvnkl.js +17 -0
  352. package/dist/lt-LT-0RKZeraM.js +37 -0
  353. package/dist/lt-LT-B6XmKUXx.js +55 -0
  354. package/dist/lt-LT-BEsBoIQ9.js +29 -0
  355. package/dist/lt-LT-BLsIcCtE.js +27 -0
  356. package/dist/lt-LT-CU5qHa7a.js +113 -0
  357. package/dist/lt-LT-CYiW52tl.js +13 -0
  358. package/dist/lt-LT-Cg9c0kae.js +13 -0
  359. package/dist/lt-LT-Ci357QYQ.js +13 -0
  360. package/dist/lt-LT-D5Rhxm1h.js +32 -0
  361. package/dist/lt-LT-DDdq07sX.js +24 -0
  362. package/dist/lt-LT-DTQGR9M0.js +54 -0
  363. package/dist/lt-LT-Nd1uRoIj.js +68 -0
  364. package/dist/lt-LT-W6fTjwB5.js +13 -0
  365. package/dist/lt-LT-l9rzkFg9.js +57 -0
  366. package/dist/lv-LV-BQ4F1GrV.js +54 -0
  367. package/dist/lv-LV-Bh-WQp0K.js +37 -0
  368. package/dist/lv-LV-C7hMdPcY.js +27 -0
  369. package/dist/lv-LV-CG1zToz7.js +32 -0
  370. package/dist/lv-LV-CgMxfFK8.js +13 -0
  371. package/dist/lv-LV-CkyuY2ji.js +24 -0
  372. package/dist/lv-LV-CpGkmcLz.js +113 -0
  373. package/dist/lv-LV-CxUmQHF9.js +13 -0
  374. package/dist/lv-LV-DKhV24CI.js +68 -0
  375. package/dist/lv-LV-DYbb5pkt.js +57 -0
  376. package/dist/lv-LV-DsSpy50n.js +55 -0
  377. package/dist/lv-LV-DsxFGThp.js +13 -0
  378. package/dist/lv-LV-Dxe-A5vo.js +13 -0
  379. package/dist/lv-LV-Veji7-on.js +29 -0
  380. package/dist/mail-BOdyoVqB.js +14 -0
  381. package/dist/mapAddressLocalizationToJpAddressSchema-vJWbpAyq.js +56 -0
  382. package/dist/mapExistingFile-BhW5UmN9.js +156 -0
  383. package/dist/mapFinancialReportsToFinancialInformation-Dl-cl9eQ.js +67 -0
  384. package/dist/mapJpAddressSchemaToAddressLocalizations-KFAvfuC1.js +63 -0
  385. package/dist/mapLegalEntityToIndividualOnfidoSchema-D51tRiYd.js +143 -0
  386. package/dist/mapTransferInstrumentToPayoutAccount-CU5wx0wJ.js +33 -0
  387. package/dist/minus-circle-filled-kC2IUvKz.js +17 -0
  388. package/dist/nl-NL-BMUYBqlF.js +57 -0
  389. package/dist/nl-NL-Bk-1-C0e.js +13 -0
  390. package/dist/nl-NL-BuW3jWdI.js +29 -0
  391. package/dist/nl-NL-Bx5p0nXL.js +24 -0
  392. package/dist/nl-NL-CMw-FwQV.js +13 -0
  393. package/dist/nl-NL-CTf7zH4M.js +55 -0
  394. package/dist/nl-NL-Cjlmc0Ii.js +32 -0
  395. package/dist/nl-NL-D7gBNWEY.js +37 -0
  396. package/dist/nl-NL-DKMs4pB2.js +13 -0
  397. package/dist/nl-NL-DMpB18Te.js +113 -0
  398. package/dist/nl-NL-JChnFdCY.js +13 -0
  399. package/dist/nl-NL-NlkjOSYi.js +27 -0
  400. package/dist/nl-NL-O9GCHMDA.js +68 -0
  401. package/dist/no-NO--OoWld_l.js +13 -0
  402. package/dist/no-NO-B-oUwe9q.js +13 -0
  403. package/dist/no-NO-Bs3-6MDM.js +24 -0
  404. package/dist/no-NO-C-gCYc9q.js +37 -0
  405. package/dist/no-NO-CA0EizAy.js +29 -0
  406. package/dist/no-NO-CA1aR6Wh.js +68 -0
  407. package/dist/no-NO-CY_XHrYd.js +32 -0
  408. package/dist/no-NO-Ca5qoVaU.js +113 -0
  409. package/dist/no-NO-Crlsj6HG.js +27 -0
  410. package/dist/no-NO-DKbWxgF-.js +57 -0
  411. package/dist/no-NO-DN9qf-_I.js +13 -0
  412. package/dist/no-NO-Dhj0Fh__.js +13 -0
  413. package/dist/no-NO-RfTK9KAV.js +55 -0
  414. package/dist/options-horizontal-CBmbNv7R.js +18 -0
  415. package/dist/partner-CPjsrePY.js +18 -0
  416. package/dist/pay-by-link-plane-BVZndh67.js +22 -0
  417. package/dist/payout-ChUEoLjt.js +20 -0
  418. package/dist/payout-verification-instant-5u-wvFKv.js +41 -0
  419. package/dist/payout-verification-manual-BH2mu0UW.js +90 -0
  420. package/dist/person-DGjUU4S4.js +17 -0
  421. package/dist/pl-PL-B0zGy_b4.js +57 -0
  422. package/dist/pl-PL-BKDK0_G8.js +68 -0
  423. package/dist/pl-PL-BSI0zHO1.js +113 -0
  424. package/dist/pl-PL-BzhEoDb5.js +24 -0
  425. package/dist/pl-PL-C_MvVzPy.js +32 -0
  426. package/dist/pl-PL-D7nhdbfR.js +29 -0
  427. package/dist/pl-PL-DGSYzOx6.js +13 -0
  428. package/dist/pl-PL-DYxD6VJ_.js +27 -0
  429. package/dist/pl-PL-DtJ3sgVO.js +13 -0
  430. package/dist/pl-PL-Duj3tncM.js +13 -0
  431. package/dist/pl-PL-Dy8qWH39.js +55 -0
  432. package/dist/pl-PL-LnVPufjb.js +37 -0
  433. package/dist/pl-PL-kGaeUP-w.js +54 -0
  434. package/dist/pl-PL-p8YxqOFg.js +13 -0
  435. package/dist/plus-CWXA5wdX.js +14 -0
  436. package/dist/plus-circle-filled-CbC0u2Y1.js +17 -0
  437. package/dist/process-field-configurations-DoOFQqtn.js +324 -0
  438. package/dist/pt-BR--kaJvtE6.js +57 -0
  439. package/dist/pt-BR-BbFJsIVX.js +55 -0
  440. package/dist/pt-BR-Be5ZycMV.js +13 -0
  441. package/dist/pt-BR-BfxgHKY4.js +27 -0
  442. package/dist/pt-BR-C0I_kTQ6.js +13 -0
  443. package/dist/pt-BR-CBAe0SnK.js +32 -0
  444. package/dist/pt-BR-Cj8MlQyq.js +113 -0
  445. package/dist/pt-BR-Cm4vZocb.js +13 -0
  446. package/dist/pt-BR-D1nTSLod.js +29 -0
  447. package/dist/pt-BR-DKrMpM6v.js +13 -0
  448. package/dist/pt-BR-DSENwwGu.js +24 -0
  449. package/dist/pt-BR-NtLaWlnZ.js +68 -0
  450. package/dist/pt-BR-nU_2Wbo5.js +54 -0
  451. package/dist/pt-BR-ur86nRrK.js +37 -0
  452. package/dist/pt-PT-B4F_5NWi.js +55 -0
  453. package/dist/pt-PT-B9L50746.js +29 -0
  454. package/dist/pt-PT-BJjCTMYf.js +13 -0
  455. package/dist/pt-PT-BJkVzfAJ.js +113 -0
  456. package/dist/pt-PT-BR-BI5Jn.js +13 -0
  457. package/dist/pt-PT-BZ5ZZm6G.js +57 -0
  458. package/dist/pt-PT-Bf4IV7wp.js +13 -0
  459. package/dist/pt-PT-Bh7v8xbp.js +13 -0
  460. package/dist/pt-PT-CIo3mlXL.js +24 -0
  461. package/dist/pt-PT-CVNEcs32.js +37 -0
  462. package/dist/pt-PT-DSxxVA0f.js +68 -0
  463. package/dist/pt-PT-Dm5DRDrd.js +32 -0
  464. package/dist/pt-PT-TKg5FLat.js +27 -0
  465. package/dist/recurring-CkL4cCM2.js +17 -0
  466. package/dist/reporting-DerosUNm.js +16 -0
  467. package/dist/resolveEnvironment-Dyejukh7.js +164 -0
  468. package/dist/revenue-accelerate-Dp4Ns_5c.js +17 -0
  469. package/dist/ro-RO-3rOfS17N.js +27 -0
  470. package/dist/ro-RO-4j2I7YM7.js +13 -0
  471. package/dist/ro-RO-5I4Q_FyK.js +13 -0
  472. package/dist/ro-RO-B5YT9vP-.js +32 -0
  473. package/dist/ro-RO-B8leE4ZJ.js +13 -0
  474. package/dist/ro-RO-Bybq8JFn.js +68 -0
  475. package/dist/ro-RO-C83h2zHZ.js +54 -0
  476. package/dist/ro-RO-CICjAFys.js +55 -0
  477. package/dist/ro-RO-CdSsgoUG.js +57 -0
  478. package/dist/ro-RO-DjGku_3y.js +13 -0
  479. package/dist/ro-RO-DvG65dTt.js +29 -0
  480. package/dist/ro-RO-ILTvlS9i.js +24 -0
  481. package/dist/ro-RO-RgC5M6CE.js +113 -0
  482. package/dist/ro-RO-i7lojG2G.js +37 -0
  483. package/dist/rules-DP604XPJ.js +314 -0
  484. package/dist/save-Fgy7EDid.js +14 -0
  485. package/dist/search-C4GZ-Rc1.js +17 -0
  486. package/dist/show-yPjPmEf8.js +17 -0
  487. package/dist/sk-SK-0BVxI7bf.js +113 -0
  488. package/dist/sk-SK-B5brxU1N.js +37 -0
  489. package/dist/sk-SK-BMJgOJoa.js +29 -0
  490. package/dist/sk-SK-BRd5TN22.js +55 -0
  491. package/dist/sk-SK-BVmoP_EU.js +13 -0
  492. package/dist/sk-SK-BWwRIx2d.js +13 -0
  493. package/dist/sk-SK-Bb18qPBw.js +13 -0
  494. package/dist/sk-SK-BiBWPJUf.js +57 -0
  495. package/dist/sk-SK-C5Qmv4E6.js +13 -0
  496. package/dist/sk-SK-C6rMIxpz.js +68 -0
  497. package/dist/sk-SK-CgLJIuJw.js +54 -0
  498. package/dist/sk-SK-CjrLvDMx.js +27 -0
  499. package/dist/sk-SK-Cv23cDQO.js +24 -0
  500. package/dist/sk-SK-S6iF1WDH.js +32 -0
  501. package/dist/sl-SI-6s8xycKg.js +13 -0
  502. package/dist/sl-SI-BMF8YtOm.js +29 -0
  503. package/dist/sl-SI-BZpXMHiG.js +13 -0
  504. package/dist/sl-SI-BxImW_RL.js +113 -0
  505. package/dist/sl-SI-C-C-KJCX.js +27 -0
  506. package/dist/sl-SI-CUCrzJQv.js +37 -0
  507. package/dist/sl-SI-CaJmYb6p.js +13 -0
  508. package/dist/sl-SI-D8dDckrW.js +55 -0
  509. package/dist/sl-SI-DEaeEVKB.js +24 -0
  510. package/dist/sl-SI-DqUEy_Cm.js +32 -0
  511. package/dist/sl-SI-DtdGMD6i.js +57 -0
  512. package/dist/sl-SI-ZxyvdgdS.js +13 -0
  513. package/dist/sl-SI-tPwbFvOI.js +68 -0
  514. package/dist/solution-payments-CNAat9h7.js +14 -0
  515. package/dist/store-IuAkDRAp.js +14 -0
  516. package/dist/style.css +2143 -1744
  517. package/dist/styles-CLV89_hH.js +2143 -1744
  518. package/dist/sv-SE-B1sbgsnh.js +13 -0
  519. package/dist/sv-SE-BHfydid5.js +27 -0
  520. package/dist/sv-SE-BUq1X9F0.js +113 -0
  521. package/dist/sv-SE-BYC_f8r7.js +29 -0
  522. package/dist/sv-SE-C6uPh9g5.js +37 -0
  523. package/dist/sv-SE-CCFIf86P.js +13 -0
  524. package/dist/sv-SE-CRBRuE8Z.js +32 -0
  525. package/dist/sv-SE-CXaMlJCI.js +24 -0
  526. package/dist/sv-SE-DGpvVvWj.js +55 -0
  527. package/dist/sv-SE-D_ZnGxiQ.js +13 -0
  528. package/dist/sv-SE-DsPdegWB.js +13 -0
  529. package/dist/sv-SE-K1QT1cOt.js +68 -0
  530. package/dist/sv-SE-kR514dO1.js +57 -0
  531. package/dist/terminal-1-_me9J9h0.js +18 -0
  532. package/dist/trackNavigation-db_h46BT.js +28 -0
  533. package/dist/types/api/address/useAddressCleanse.d.ts +6 -2
  534. package/dist/types/api/address/useRetrieveAddress.d.ts +3 -1
  535. package/dist/types/api/address/useRetrieveFromPostcodeJp.d.ts +18 -0
  536. package/dist/types/api/businessLines/businessLines.types.d.ts +16 -0
  537. package/dist/types/api/businessLines/useBusinessLines.d.ts +4 -2
  538. package/dist/types/api/businessLines/useCreateBusinessLine.d.ts +7 -0
  539. package/dist/types/api/businessLines/useDeleteBusinessLine.d.ts +5 -0
  540. package/dist/types/api/businessLines/useUpdateBusinessLines.d.ts +7 -0
  541. package/dist/types/api/businessLines/useUpdateSourceOfFunds.d.ts +1 -0
  542. package/dist/types/api/companySearch/useCompanySearch.d.ts +1 -0
  543. package/dist/types/api/configurations/useScenarios.d.ts +12 -12
  544. package/dist/types/api/documentValidation/useDocumentValidate.d.ts +15 -0
  545. package/dist/types/api/industryCodes/industryCodes.types.d.ts +2 -1
  546. package/dist/types/api/industryCodes/useIndustryCodes.d.ts +3 -3
  547. package/dist/types/api/legalEntity/useLegalEntity.d.ts +16 -16
  548. package/dist/types/api/pci/pci.types.d.ts +17 -0
  549. package/dist/types/api/pci/usePciQuestionnaire.d.ts +6 -0
  550. package/dist/types/api/pci/usePciQuestionnaireList.d.ts +12 -0
  551. package/dist/types/api/pci/usePciStatus.d.ts +6 -0
  552. package/dist/types/api/pci/usePciTemplate.d.ts +8 -0
  553. package/dist/types/api/queryKeys.d.ts +5 -4
  554. package/dist/types/components/BankAccount/fields/BankAccountFormat/types.d.ts +2 -1
  555. package/dist/types/components/BankAccount/fields/PreferredCurrency/PreferredCurrency.d.ts +10 -0
  556. package/dist/types/components/BankAccount/forms/BankDocument/BankDocumentClassification.d.ts +5 -0
  557. package/dist/types/components/BankAccount/forms/BankDocument/BankDocumentRequirementsModal.d.ts +6 -0
  558. package/dist/types/components/BankAccount/forms/BankDocument/types.d.ts +2 -2
  559. package/dist/types/components/BankAccount/forms/BankDocument/validate.d.ts +3 -0
  560. package/dist/types/components/BankAccount/forms/BankVerification/BankVerification.d.ts +1 -1
  561. package/dist/types/components/BankAccount/forms/BankVerification/types.d.ts +7 -0
  562. package/dist/types/components/BankAccount/forms/BankVerification/verification/overlay/BankVerificationOverlay.d.ts +3 -0
  563. package/dist/types/components/BankAccount/forms/PayoutAccount/payoutAccountFormat.d.ts +1 -1
  564. package/dist/types/components/BankAccount/forms/PayoutAccount/types.d.ts +2 -0
  565. package/dist/types/components/BankAccount/forms/PayoutCountryDetails/PayoutCountryDetails.d.ts +3 -0
  566. package/dist/types/components/BankAccount/forms/PayoutCountryDetails/PayoutRequirementsModal.d.ts +8 -0
  567. package/dist/types/components/BankAccount/forms/PayoutCountryDetails/types.d.ts +13 -0
  568. package/dist/types/components/BankAccount/forms/PayoutDetails/PayoutDetails.d.ts +6 -1
  569. package/dist/types/components/BankAccount/forms/PayoutDetails/types.d.ts +2 -0
  570. package/dist/types/components/BankAccount/forms/PayoutVerificationMethod/PayoutVerificationMethod.d.ts +1 -2
  571. package/dist/types/components/BankAccount/forms/PayoutVerificationMethod/payoutVerificationMethodMetadata.d.ts +5 -5
  572. package/dist/types/components/BankAccount/forms/PayoutVerificationMethod/utils.d.ts +2 -0
  573. package/dist/types/components/BankAccount/mapping/mapPayoutAccountSchemaToApiBankAccount.d.ts +3 -2
  574. package/dist/types/components/BankAccount/mapping/mapPayoutDetailsToTransferInstrument.d.ts +2 -1
  575. package/dist/types/components/BankAccount/mapping/mapTransferInstrumentToPayoutAccount.d.ts +1 -1
  576. package/dist/types/components/BankAccount/mapping/payoutKeyMappings.d.ts +1052 -642
  577. package/dist/types/components/BankAccount/pages/PayoutDetailsPage.d.ts +1 -1
  578. package/dist/types/components/BankAccount/tasks/PayoutDetailsDropin/PayoutDetailsDropin.d.ts +1 -0
  579. package/dist/types/components/BankAccount/tasks/PayoutDetailsDropin/payoutDetailsFormConfig.d.ts +1 -1
  580. package/dist/types/components/BankAccount/tasks/PayoutDetailsDropin/utils.d.ts +3 -3
  581. package/dist/types/components/BankAccount/utils/payoutAccountUtil.d.ts +5 -4
  582. package/dist/types/components/Business/forms/AdditionalInformation/types.d.ts +2 -1
  583. package/dist/types/components/Business/forms/BasicInformation/BasicInformationMultiform.d.ts +5 -3
  584. package/dist/types/components/Business/forms/RegistrationDocument/types.d.ts +3 -3
  585. package/dist/types/components/Business/forms/TaxDocument/types.d.ts +3 -3
  586. package/dist/types/components/Business/forms/rules.d.ts +3 -1
  587. package/dist/types/components/Business/pages/RootBusinessDetailsPage.d.ts +1 -1
  588. package/dist/types/components/Business/tasks/BusinessDetailsDropin/businessDetailsStore.d.ts +5 -4
  589. package/dist/types/components/Business/tasks/BusinessDetailsDropin/types.d.ts +9 -6
  590. package/dist/types/components/Business/tasks/BusinessDetailsDropin/utils.d.ts +3 -3
  591. package/dist/types/components/Business/tasks/BusinessDetailsMultiformDropin/BusinessDetailsMultiform.d.ts +2 -1
  592. package/dist/types/components/Business/tasks/BusinessDetailsMultiformDropin/utils.d.ts +0 -2
  593. package/dist/types/components/Business/utils/applyVerifiedBusinessData.d.ts +5 -0
  594. package/dist/types/components/Business/utils/companyTypeMetadata.d.ts +3 -3
  595. package/dist/types/components/Business/utils/requestingCapabilities.d.ts +3 -0
  596. package/dist/types/components/BusinessLines/constants.d.ts +23 -0
  597. package/dist/types/components/BusinessLines/fields/Carousel/Carousel.d.ts +30 -0
  598. package/dist/types/components/BusinessLines/fields/SalesChannels/SalesChannels.d.ts +2 -0
  599. package/dist/types/components/BusinessLines/fields/SalesChannels/types.d.ts +6 -0
  600. package/dist/types/components/BusinessLines/fields/WebDataField/WebDataField.d.ts +2 -0
  601. package/dist/types/components/BusinessLines/fields/WebDataField/types.d.ts +6 -0
  602. package/dist/types/components/BusinessLines/forms/IndustryCodesForm/IndustryCodesForm.d.ts +2 -0
  603. package/dist/types/components/BusinessLines/forms/IndustryCodesForm/types.d.ts +2 -0
  604. package/dist/types/components/BusinessLines/forms/SalesChannelsForm/SalesChannelsForm.d.ts +2 -0
  605. package/dist/types/components/BusinessLines/forms/SalesChannelsForm/types.d.ts +3 -0
  606. package/dist/types/components/BusinessLines/forms/rules.d.ts +5 -0
  607. package/dist/types/components/BusinessLines/tasks/BusinessLines/BusinessLineModal/BusinessLineModal.d.ts +6 -0
  608. package/dist/types/components/BusinessLines/tasks/BusinessLines/BusinessLines.d.ts +9 -0
  609. package/dist/types/components/BusinessLines/tasks/BusinessLines/BusinessLinesDropin.d.ts +2 -0
  610. package/dist/types/components/BusinessLines/tasks/BusinessLines/BusinessLinesStore.d.ts +3 -0
  611. package/dist/types/components/BusinessLines/tasks/BusinessLines/ExistingBusinessLines/ExistingBusinessLines.d.ts +8 -0
  612. package/dist/types/components/BusinessLines/tasks/types.d.ts +17 -0
  613. package/dist/types/components/BusinessLines/tasks/utils.d.ts +21 -0
  614. package/dist/types/components/BusinessLines/tasks/validate.d.ts +9 -0
  615. package/dist/types/components/Contract/hooks/useSalesChannels.d.ts +2 -0
  616. package/dist/types/components/EFP/mapping/businessFinancingKeyMappings.d.ts +1328 -758
  617. package/dist/types/components/EFP/tasks/BusinessFinancingDropin/BusinessFinancingBasicCompanyInformation.d.ts +0 -1
  618. package/dist/types/components/EFP/tasks/BusinessFinancingDropin/BusinessFinancingBusinessInformation.d.ts +0 -1
  619. package/dist/types/components/EFP/tasks/BusinessFinancingDropin/BusinessFinancingFinancialInformation.d.ts +0 -1
  620. package/dist/types/components/EFP/tasks/BusinessFinancingDropin/BusinessFinancingOwnershipStructure.d.ts +0 -1
  621. package/dist/types/components/EFP/tasks/BusinessFinancingDropin/BusinessFinancingRegisteredAddress.d.ts +0 -1
  622. package/dist/types/components/EFP/tasks/BusinessFinancingDropin/types.d.ts +7 -5
  623. package/dist/types/components/EFP/tasks/SourceOfFundsDropin/SourceOfFundsType.d.ts +3 -0
  624. package/dist/types/components/EFP/tasks/SourceOfFundsDropin/sofStore.d.ts +1 -1
  625. package/dist/types/components/EFP/tasks/SourceOfFundsDropin/utils.d.ts +14 -13
  626. package/dist/types/components/EFP/tasks/TaxReportingDropin/taxClassificationStore.d.ts +1 -1
  627. package/dist/types/components/EFP/tasks/TaxReportingDropin/utils.d.ts +6 -6
  628. package/dist/types/components/EmbeddedDropins/BusinessFinancingComponent/BusinessFinancingComponent.d.ts +1 -1
  629. package/dist/types/components/EmbeddedDropins/BusinessFinancingComponent/utils.d.ts +3 -3
  630. package/dist/types/components/EmbeddedDropins/SignPCIComponent/SignPCIComponent.d.ts +3 -1
  631. package/dist/types/components/EmbeddedDropins/ViewVerificationStatus/content.d.ts +3 -3
  632. package/dist/types/components/Individual/fields/NameFields/NameFields.d.ts +3 -0
  633. package/dist/types/components/Individual/forms/Individual/IdVerification/idVerificationProviderId.d.ts +1 -1
  634. package/dist/types/components/Individual/forms/Individual/IdVerificationMethod/idVerificationMethodMetadata.d.ts +3 -3
  635. package/dist/types/components/Individual/forms/IndividualOnfido/AdditionalPersonalDetails/AdditionalPersonalDetails.types.d.ts +2 -1
  636. package/dist/types/components/Individual/forms/IndividualOnfido/IdNowVerificationModal/isIdNowModalOpen.d.ts +3 -3
  637. package/dist/types/components/Individual/forms/IndividualOnfido/IndividualOnfido.rules.d.ts +1 -1
  638. package/dist/types/components/Individual/forms/IndividualOnfido/UboQuestionnaire/UboQuestionnaire.types.d.ts +4 -1
  639. package/dist/types/components/Individual/forms/IndividualOnfido/UboQuestionnaire/UboQuestionnaireModalContent.d.ts +3 -1
  640. package/dist/types/components/Individual/helpers/shouldShowMotionCapture.d.ts +2 -2
  641. package/dist/types/components/Individual/pages/DecisionMakerDetailsPage.d.ts +2 -8
  642. package/dist/types/components/Individual/pages/RootIndividualDetailsPage.d.ts +2 -6
  643. package/dist/types/components/Individual/tasks/DecisionMakers/DecisionMakerDetails/DecisionMakerDetails.d.ts +1 -1
  644. package/dist/types/components/Individual/tasks/DecisionMakers/DecisionMakerDetails/DecisionMakerDetails.types.d.ts +2 -0
  645. package/dist/types/components/Individual/tasks/DecisionMakers/DecisionMakerDetails/utils.d.ts +57 -0
  646. package/dist/types/components/Individual/tasks/DecisionMakers/RemediationAlerts/RemediationAlerts.d.ts +7 -0
  647. package/dist/types/components/Individual/tasks/DecisionMakers/RemediationAlerts/remediation.config.d.ts +19 -0
  648. package/dist/types/components/Individual/tasks/DecisionMakers/types.d.ts +0 -2
  649. package/dist/types/components/Individual/tasks/DecisionMakers/utils.d.ts +3 -0
  650. package/dist/types/components/Individual/tasks/IndividualOnfidoDropin/IndividualOnfidoStore.d.ts +1 -1
  651. package/dist/types/components/Shared/EntityAssociation/EntityAssociation.d.ts +1 -1
  652. package/dist/types/components/Shared/EntityAssociation/types.d.ts +2 -4
  653. package/dist/types/components/Shared/FormNavigation/FormNavigation.d.ts +1 -1
  654. package/dist/types/components/Shared/FormNavigation/types.d.ts +0 -2
  655. package/dist/types/components/Shared/FormWrapper/FormWrapper.d.ts +1 -3
  656. package/dist/types/components/Shared/Introduction/copy.d.ts +2 -2
  657. package/dist/types/components/Shared/Summary/Summary.d.ts +1 -1
  658. package/dist/types/components/Shared/Summary/types.d.ts +1 -2
  659. package/dist/types/components/Shared/TaskVerificationStatus/TaskVerificationStatus.d.ts +18 -0
  660. package/dist/types/components/Shared/devex/DebugListener/DebugFormData.d.ts +1 -0
  661. package/dist/types/components/Shared/devex/DebugListener/debugStore.d.ts +5 -0
  662. package/dist/types/components/Shared/fields/IdFieldTypeSelector/VatNumberTypeSelector.d.ts +1 -1
  663. package/dist/types/components/Shared/fields/IndustryCodeField/IndustryCodeField.d.ts +4 -0
  664. package/dist/types/components/Shared/fields/IndustryCodeField/fieldConfig.d.ts +3 -0
  665. package/dist/types/components/Shared/fields/IndustryCodeField/types.d.ts +22 -0
  666. package/dist/types/components/Shared/fields/IndustryCodeField/validate.d.ts +3 -0
  667. package/dist/types/components/Shared/fields/LocalizedLegalCompanyNameField/fieldConfig.d.ts +4 -4
  668. package/dist/types/components/Shared/forms/Address/localized/jp/JpAddress.d.ts +7 -0
  669. package/dist/types/components/Shared/forms/Address/localized/jp/ReadonlyTextField.d.ts +7 -0
  670. package/dist/types/components/Shared/forms/Address/localized/jp/jpAddressSchema.d.ts +5 -0
  671. package/dist/types/components/Shared/forms/Address/localized/jp/mapAddressLocalizationToJpAddressSchema.d.ts +3 -0
  672. package/dist/types/components/Shared/forms/Address/localized/jp/mapJpAddressSchemaToAddressLocalizations.d.ts +3 -0
  673. package/dist/types/components/Shared/forms/Address/localized/jp/mapJpAddressSummary.d.ts +4 -0
  674. package/dist/types/components/Shared/forms/Address/utils.d.ts +3 -2
  675. package/dist/types/components/Shared/forms/FinancialInformation/formatFinancialInformationSummary.d.ts +1 -2
  676. package/dist/types/components/Shared/forms/RegistrationAddress/RegistrationAddressMultiform.d.ts +3 -0
  677. package/dist/types/components/Shared/forms/RegistrationAddress/types.d.ts +3 -2
  678. package/dist/types/components/Shared/tasks/CustomerSupport/mapping/customerSupportKeyMapping.d.ts +4 -0
  679. package/dist/types/components/Shared/tasks/TaskList/TaskList.d.ts +3 -1
  680. package/dist/types/components/Shared/tasks/TaskList/TaskListItem.d.ts +1 -1
  681. package/dist/types/components/Shared/tasks/TaskList/types.d.ts +4 -12
  682. package/dist/types/components/Shared/tasks/TaskList/utils.d.ts +1 -1
  683. package/dist/types/components/SoleProprietorship/pages/SoleProprietorshipPage.d.ts +1 -2
  684. package/dist/types/components/Trust/forms/TrustRegistrationDetails/TrustRegistrationDetailsMultiform.d.ts +2 -0
  685. package/dist/types/components/Trust/hooks/useTrustMemberNavigation.hook.d.ts +1 -16
  686. package/dist/types/components/Trust/pages/TrustMemberCompanyPage.d.ts +1 -2
  687. package/dist/types/components/Trust/tasks/RoleAndTypeDropin/formatRoleAndEntityTypeSummary.d.ts +2 -2
  688. package/dist/types/components/Trust/tasks/TrustDropin/TrustMultiform.d.ts +21 -0
  689. package/dist/types/components/Trust/tasks/TrustDropin/TrustMultiformDropin.d.ts +2 -0
  690. package/dist/types/components/Trust/tasks/TrustDropin/validate.d.ts +5 -0
  691. package/dist/types/components/UnincorporatedPartnership/pages/UnincorporatedPartnershipMemberCompanyPage.d.ts +1 -2
  692. package/dist/types/components/ui/atoms/Header/Header.d.ts +12 -0
  693. package/dist/types/components/ui/atoms/ListItem/ListItem.d.ts +1 -2
  694. package/dist/types/components/ui/atoms/RadioCard/RadioCard.d.ts +1 -0
  695. package/dist/types/components/ui/atoms/RadioGroup/RadioGroup.d.ts +1 -1
  696. package/dist/types/components/ui/atoms/RadioGroupCard/RadioGroupCard.d.ts +4 -4
  697. package/dist/types/components/ui/atoms/RadioGroupCard/RadioGroupCard.types.d.ts +8 -9
  698. package/dist/types/components/ui/atoms/Status/Status.d.ts +9 -3
  699. package/dist/types/components/ui/atoms/Svg/svgs.d.ts +6 -0
  700. package/dist/types/components/ui/atoms/TileGroup/TileGroup.d.ts +3 -1
  701. package/dist/types/components/ui/atoms/Typography/Typography.types.d.ts +1 -1
  702. package/dist/types/components/ui/layout/StackLayout/StackLayout.d.ts +29 -7
  703. package/dist/types/components/ui/molecules/Card/Card.d.ts +1 -1
  704. package/dist/types/components/ui/molecules/Card/types.d.ts +1 -0
  705. package/dist/types/components/ui/molecules/DocumentGuidance/DocumentGuidance.types.d.ts +1 -2
  706. package/dist/types/components/ui/molecules/Dropzone/FilePicker.d.ts +2 -1
  707. package/dist/types/components/ui/molecules/Dropzone/types.d.ts +1 -0
  708. package/dist/types/components/ui/molecules/EmbeddedStatus/EmbeddedStatus.d.ts +2 -23
  709. package/dist/types/components/ui/molecules/EmbeddedStatus/statusToTag.d.ts +3 -3
  710. package/dist/types/components/ui/molecules/EmbeddedStatus/types.d.ts +23 -0
  711. package/dist/types/context/ExperimentContext/types.d.ts +24 -20
  712. package/dist/types/context/I18nProvider/I18nContext.d.ts +3 -0
  713. package/dist/types/context/SettingsContext/SettingsProvider.d.ts +1 -1
  714. package/dist/types/context/SettingsContext/types.d.ts +3 -0
  715. package/dist/types/context/StateContext/types.d.ts +2 -1
  716. package/dist/types/core/errorMapping.d.ts +4 -1
  717. package/dist/types/core/models/api/address.d.ts +5 -0
  718. package/dist/types/core/models/api/capability.d.ts +20 -0
  719. package/dist/types/core/models/api/legal-entity-association.d.ts +1 -1
  720. package/dist/types/core/models/api/source-of-funds.d.ts +5 -0
  721. package/dist/types/core/models/api/transfer-instrument.d.ts +2 -0
  722. package/dist/types/core/process-field-configurations.d.ts +4 -1
  723. package/dist/types/core/user-events.d.ts +22 -11
  724. package/dist/types/datasets/generators/getAccountFormatForCountry.d.ts +1 -0
  725. package/dist/types/embeds/individual-configuration/AdyenIndividual.d.ts +3 -3
  726. package/dist/types/embeds/individual-configuration/adyen-individual-configuration.types.d.ts +5 -5
  727. package/dist/types/embeds/individual-status/AdyenManageIndividual.d.ts +3 -3
  728. package/dist/types/embeds/individual-status/adyen-individual-status.types.d.ts +5 -5
  729. package/dist/types/embeds/terms-of-service-management/AdyenTermsOfService.d.ts +3 -3
  730. package/dist/types/embeds/terms-of-service-management/adyen-terms-of-service-management.types.d.ts +5 -5
  731. package/dist/types/embeds/terms-of-service-status/AdyenManageTermsOfService.d.ts +3 -3
  732. package/dist/types/embeds/terms-of-service-status/adyen-terms-of-service-status.types.d.ts +39 -0
  733. package/dist/types/embeds/transfer-instrument-configuration/AdyenTransferInstrument.d.ts +3 -3
  734. package/dist/types/embeds/transfer-instrument-configuration/adyen-transfer-instrument-configuration.types.d.ts +5 -5
  735. package/dist/types/embeds/transfer-instrument-management/AdyenManageTransferInstrument.d.ts +3 -3
  736. package/dist/types/embeds/transfer-instrument-management/adyen-transfer-instrument-management.types.d.ts +5 -5
  737. package/dist/types/hooks/singpass/useSingpassMyInfoLogin.d.ts +2 -6
  738. package/dist/types/hooks/useAnalytics/useAnalytics.d.ts +16 -0
  739. package/dist/types/hooks/useLegalCompanyNameField/useLegalCompanyNameField.d.ts +6 -8
  740. package/dist/types/hooks/useUboQuestionnaire.d.ts +25 -0
  741. package/dist/types/language/Language.d.ts +10 -0
  742. package/dist/types/language/types.d.ts +21 -7
  743. package/dist/types/language/utils.d.ts +2 -2
  744. package/dist/types/stores/globalStore/taskTypes.d.ts +1 -1
  745. package/dist/types/types/form-rules.d.ts +2 -0
  746. package/dist/types/utils/addLinkedFields.d.ts +26 -2
  747. package/dist/types/utils/analytics/convertToEmbeddedEvent.d.ts +9 -0
  748. package/dist/types/utils/analytics/debouncedInputEvent.d.ts +30 -0
  749. package/dist/types/utils/analytics/getAnalyticsAssociatedEntityDetails.d.ts +13 -0
  750. package/dist/types/utils/analytics/trackNavigation.d.ts +10 -0
  751. package/dist/types/utils/api/documentUtils.d.ts +1 -0
  752. package/dist/types/utils/entityStatusUtil.d.ts +1 -1
  753. package/dist/types/utils/filterProblemsByTaskForms.d.ts +12 -0
  754. package/dist/types/utils/getName.d.ts +1 -1
  755. package/dist/types/utils/getSSNType.d.ts +1 -0
  756. package/dist/types/utils/getTrustedFields.d.ts +9 -0
  757. package/dist/types/utils/textTransformation/toFullWidth.d.ts +6 -0
  758. package/dist/types/utils/translation.d.ts +3 -2
  759. package/dist/types/utils/validatorUtils.d.ts +1 -0
  760. package/dist/types-C972Lk6s.js +34 -0
  761. package/dist/types-CLz74bOT.js +88 -0
  762. package/dist/types-Ctv8hbzY.js +74 -0
  763. package/dist/types-f66rmUFy.js +164 -0
  764. package/dist/upload-BF65P4KM.js +17 -0
  765. package/dist/useAssociatedLegalEntity-DAB1oG6O.js +33 -0
  766. package/dist/useCreateLegalEntity-BK5YcHA-.js +31 -0
  767. package/dist/useDataset-BtfHQp4w.js +220 -0
  768. package/dist/useForm-wQyeWa1b.js +1623 -0
  769. package/dist/useGlobalData-B33uuhtd.js +68 -0
  770. package/dist/useMultiForm-rZmCYsI4.js +864 -0
  771. package/dist/useOnboardingStatus-BbIpiZR4.js +27 -0
  772. package/dist/useScenarios-DPOodENA.js +46 -0
  773. package/dist/useTermsOfServiceStatus-DKeMR4Xi.js +42 -0
  774. package/dist/useToastContext-BK9oGWtb.js +60 -0
  775. package/dist/useUnincorporatedPartnershipMembers-Cdts5Hbn.js +99 -0
  776. package/dist/useUpdateBusinessLines-CWYtpMwr.js +46 -0
  777. package/dist/useUpdateLegalEntity-oa8qEzc4.js +39 -0
  778. package/dist/utils-AP5TpAhf.js +774 -0
  779. package/dist/utils-COz1RbbA.js +237 -0
  780. package/dist/validate-BYwVLb-X.js +41 -0
  781. package/dist/validate-CBVdP51L.js +100 -0
  782. package/dist/validationError-CvZLhw5H.js +86 -0
  783. package/dist/warning-circle-fill-CEN1WL7A.js +17 -0
  784. package/dist/warning-diamond-filled-BfXMlVrG.js +17 -0
  785. package/dist/webinar-DqjqrNEv.js +22 -0
  786. package/package.json +82 -83
  787. package/dist/4-people-CCqdlDEw.js +0 -24
  788. package/dist/AD-CyP5INSp.js +0 -23
  789. package/dist/AT-DJLlevck.js +0 -23
  790. package/dist/AcceptTermsOfServiceComponent-BF24NWVw.js +0 -657
  791. package/dist/AccountSetupRejected-2t22lJUo.js +0 -26
  792. package/dist/Address-DSwfzWFu.js +0 -1076
  793. package/dist/Alert-C24s_Ygs.js +0 -231
  794. package/dist/Avatar-DQjt5Lk2.js +0 -60
  795. package/dist/BE-B-m_4F41.js +0 -23
  796. package/dist/BG-BVR5ytc-.js +0 -27
  797. package/dist/BusinessDetailsDropin-CRFPvWuD.js +0 -5088
  798. package/dist/BusinessFinancingComponent-y2_kC8bx.js +0 -45
  799. package/dist/BusinessFinancingDropin-C-xm14b8.js +0 -1811
  800. package/dist/BusinessFinancingPage-BOG7yrw6.js +0 -40
  801. package/dist/BusinessTypeSelectionPage-ujY2jj6B.js +0 -426
  802. package/dist/CH-CesIKOYy.js +0 -23
  803. package/dist/CY-BnJ7k_mN.js +0 -23
  804. package/dist/CZ-BiPeoA9G.js +0 -33
  805. package/dist/Card-BMuquALf.js +0 -145
  806. package/dist/Confirm-DwutojkY.js +0 -64
  807. package/dist/CountryField-D0YZrov9.js +0 -864
  808. package/dist/CreateIndividualComponent-VZWLAo0l.js +0 -72
  809. package/dist/CreateTransferInstrumentComponent-OtReN6Cy.js +0 -67
  810. package/dist/Currency-BECbMsi5.js +0 -238
  811. package/dist/CustomerSupport-B8zC_huY.js +0 -141
  812. package/dist/DE-DdcbG-CC.js +0 -23
  813. package/dist/DK-DA8qRrzq.js +0 -33
  814. package/dist/DebugModal-CshTHx0o.js +0 -328
  815. package/dist/DecisionMakerDetailsPage-BJUwR4R7.js +0 -100
  816. package/dist/DecisionMakers-BDNa3HcC.js +0 -591
  817. package/dist/Dropzone-D6dXhmL4.js +0 -218
  818. package/dist/EE-CaXoPgZz.js +0 -23
  819. package/dist/ES-Bt_oaIaf.js +0 -23
  820. package/dist/EmbeddedStatus-BHTZcjUN.js +0 -100
  821. package/dist/EndStateLayout-CyGtLyvf.js +0 -71
  822. package/dist/FI-C5V3lLuN.js +0 -23
  823. package/dist/FR-Bc1tLIC4.js +0 -23
  824. package/dist/FormFlow-CZ9f5X0C.js +0 -216
  825. package/dist/FormNavigation-ezxkIqdb.js +0 -162
  826. package/dist/GG-BGuqxplU.js +0 -33
  827. package/dist/GI-CROkpYrU.js +0 -41
  828. package/dist/GR-B9c2boG8.js +0 -23
  829. package/dist/HR-p4luVYpu.js +0 -23
  830. package/dist/HU-D8vJYkDH.js +0 -32
  831. package/dist/IE-Cli_j7Al.js +0 -23
  832. package/dist/IM-mpIyBn16.js +0 -33
  833. package/dist/IS-02zCAdvq.js +0 -27
  834. package/dist/IT-CzURFhrK.js +0 -23
  835. package/dist/IndividualOnfidoDropin-vuHu-O_C.js +0 -7874
  836. package/dist/InputDate-CHygOGiS.js +0 -43
  837. package/dist/InputGroup-WBfGDV5F.js +0 -32
  838. package/dist/InputText-BX5sG9WJ.js +0 -161
  839. package/dist/Introduction-BsKwELuc.js +0 -304
  840. package/dist/JE-MFwIYti7.js +0 -33
  841. package/dist/LI-DA06W10W.js +0 -23
  842. package/dist/LT-DuU6E2Ct.js +0 -23
  843. package/dist/LU-BQHhNpDy.js +0 -23
  844. package/dist/LV-DN7wckbP.js +0 -23
  845. package/dist/LegalRepresentativeDetailsPage-DtMHe1Nq.js +0 -61
  846. package/dist/Link-BFdxU8qh.js +0 -35
  847. package/dist/MC-DtSWC4jS.js +0 -23
  848. package/dist/MT-DeDMQ1f_.js +0 -23
  849. package/dist/ManageIndividualComponent-By_fCmN1.js +0 -47
  850. package/dist/ManageTermsOfServiceComponent-D7F44OPD.js +0 -47
  851. package/dist/ManageTransferInstrumentComponent-DywpP5PK.js +0 -294
  852. package/dist/MaskedInput-BZ7t98eu.js +0 -799
  853. package/dist/MaybeModal-CE9kYOrU.js +0 -25
  854. package/dist/Modal-nMRQDTF7.js +0 -136
  855. package/dist/NL-aVL0NAp-.js +0 -23
  856. package/dist/NO-D7EOiQA1.js +0 -32
  857. package/dist/OnboardingDropinComponent-B0GrJ_pR.js +0 -4301
  858. package/dist/PL-Bg7axKQA.js +0 -32
  859. package/dist/PT-hB1HnBM2.js +0 -23
  860. package/dist/PayoutDetailsDropin-BJIqXmPn.js +0 -3694
  861. package/dist/RO-BLlC4CKq.js +0 -23
  862. package/dist/RadioGroup-CYDXrtrO.js +0 -143
  863. package/dist/RegistrationAddress-qtMZa31b.js +0 -2334
  864. package/dist/Review-D7NEYFoT.js +0 -82
  865. package/dist/RootBusinessDetailsPage-rCbGLBEv.js +0 -1870
  866. package/dist/RootIndividualDetailsPage-B3TkB6Xj.js +0 -77
  867. package/dist/SE-q25Qt85B.js +0 -33
  868. package/dist/SI-BzA-ozn6.js +0 -23
  869. package/dist/SK-DOTdLJPw.js +0 -23
  870. package/dist/SM-B4BIgmhk.js +0 -23
  871. package/dist/SignPCIComponent-C0iYfSl6.js +0 -294
  872. package/dist/SingpassSelection-ClMlwfoj.js +0 -130
  873. package/dist/SoleProprietorshipPage-JKNrAy74.js +0 -50
  874. package/dist/SourceOfFundsPage-D-pN33-9.js +0 -3101
  875. package/dist/Spacer-BK3jDget.js +0 -18
  876. package/dist/StepProgressIndicator-BWCQmDeV.js +0 -78
  877. package/dist/StoreProvider-BlaJzXSZ.js +0 -7072
  878. package/dist/StructuredList-DaepaiVE.js +0 -38
  879. package/dist/TaskItemStatus-B38keERo.js +0 -125
  880. package/dist/TaskStatusIndicator-BIvTrQtf.js +0 -69
  881. package/dist/TaxInformationField-DS0m73if.js +0 -3062
  882. package/dist/TaxReportingDropin-CVbVkFhv.js +0 -499
  883. package/dist/TileGroup-CztY53P9.js +0 -174
  884. package/dist/TrustDetailsPage-C791Wu5u.js +0 -1205
  885. package/dist/TrustMemberCompanyPage-BOQ5D3y4.js +0 -60
  886. package/dist/TrustMemberIndividualPage-BPIXX2Mh.js +0 -66
  887. package/dist/UnincorporatedPartnershipIndividualPage-vzn0R02z.js +0 -66
  888. package/dist/UnincorporatedPartnershipMemberCompanyPage-C-kGU5Sh.js +0 -64
  889. package/dist/VA-bPXdCnwD.js +0 -23
  890. package/dist/ViewVerificationStatusComponent-BTW-Vw9I.js +0 -177
  891. package/dist/analytics-3-a-Od7Z.js +0 -61
  892. package/dist/arrow-right-D_mdkZmE.js +0 -14
  893. package/dist/bafinUtils-Bar3qiJA.js +0 -457
  894. package/dist/bag-DpxmyXfR.js +0 -14
  895. package/dist/bank-gyBvaSp4.js +0 -14
  896. package/dist/bin-Bgdj6KzC.js +0 -18
  897. package/dist/capital-CF9_Ev99.js +0 -17
  898. package/dist/cash-stack-Ds76Du8m.js +0 -22
  899. package/dist/certificate-D6xjhThs.js +0 -17
  900. package/dist/checkmark-circle-fill-BhvuqTl9.js +0 -17
  901. package/dist/checkmark-circle-nACBJ24q.js +0 -20
  902. package/dist/checkmark-small-63w5fAxg.js +0 -14
  903. package/dist/checkmark-tfEAu7lj.js +0 -14
  904. package/dist/chevron-down-CkQS-knD.js +0 -14
  905. package/dist/chevron-left-CBCMdMx6.js +0 -14
  906. package/dist/chevron-right-dIVWvPJu.js +0 -14
  907. package/dist/chevron-up-D93IGU9z.js +0 -14
  908. package/dist/circle-Dgfa7GUy.js +0 -17
  909. package/dist/coins-CFu331p2.js +0 -17
  910. package/dist/commonValidators-Bk0SSjsH.js +0 -24
  911. package/dist/contract-DI03_xrF.js +0 -14
  912. package/dist/cross-circle-fill-small-CHMDaA3q.js +0 -14
  913. package/dist/cross-o4n5KXxG.js +0 -14
  914. package/dist/currency-BGwQyxBo.js +0 -36
  915. package/dist/da-DK-B45X2VaJ.js +0 -35
  916. package/dist/da-DK-BJ7aTPir.js +0 -13
  917. package/dist/da-DK-BTpZzEgA.js +0 -15
  918. package/dist/da-DK-BoQic3Gy.js +0 -33
  919. package/dist/da-DK-CeNMXUfE.js +0 -23
  920. package/dist/da-DK-D0N1TVVU.js +0 -58
  921. package/dist/da-DK-D4H69PX3.js +0 -30
  922. package/dist/da-DK-DStNe471.js +0 -22
  923. package/dist/da-DK-q2b_1elr.js +0 -35
  924. package/dist/de-DE-C78RLE2G.js +0 -13
  925. package/dist/de-DE-CGoBPCPv.js +0 -22
  926. package/dist/de-DE-CWvgMDqU.js +0 -35
  927. package/dist/de-DE-D2ByeIZs.js +0 -35
  928. package/dist/de-DE-DjOUNvp6.js +0 -15
  929. package/dist/de-DE-Dtuu-nE7.js +0 -58
  930. package/dist/de-DE-Dwagawx1.js +0 -33
  931. package/dist/de-DE-JI-7mvxy.js +0 -23
  932. package/dist/de-DE-wp5-H-ov.js +0 -30
  933. package/dist/document-1-DsCi9vmX.js +0 -14
  934. package/dist/document-person-DBlLin9u.js +0 -20
  935. package/dist/download-B8_c4ARV.js +0 -17
  936. package/dist/dropinUtils-DHp5v5jB.js +0 -192
  937. package/dist/edit-1-D6f6zk9p.js +0 -14
  938. package/dist/en-US-546hB2Wn.js +0 -60
  939. package/dist/en-US-BQpgt41j.js +0 -37
  940. package/dist/en-US-BTYdAWXp.js +0 -15
  941. package/dist/en-US-BbAzROHT.js +0 -36
  942. package/dist/en-US-CAm3meB1.js +0 -30
  943. package/dist/en-US-CQ3angjM.js +0 -22
  944. package/dist/en-US-DHq7VYFs.js +0 -23
  945. package/dist/en-US-DIdQJky-.js +0 -35
  946. package/dist/es-ES-BsQpwaPN.js +0 -58
  947. package/dist/es-ES-Bsoco8Fj.js +0 -33
  948. package/dist/es-ES-BtUSEzkE.js +0 -13
  949. package/dist/es-ES-CKMfS8Yy.js +0 -22
  950. package/dist/es-ES-Cj7q7fWO.js +0 -15
  951. package/dist/es-ES-DKCCgVF8.js +0 -35
  952. package/dist/es-ES-DOVPTeyf.js +0 -23
  953. package/dist/es-ES-Ds3-DtqZ.js +0 -30
  954. package/dist/es-ES-WWftn3JX.js +0 -35
  955. package/dist/external-link-BjladU3E.js +0 -14
  956. package/dist/fi-FI-BJ9RzrL3.js +0 -58
  957. package/dist/fi-FI-BNcnKrJ9.js +0 -15
  958. package/dist/fi-FI-ClnsYt3L.js +0 -33
  959. package/dist/fi-FI-Cvar63RH.js +0 -13
  960. package/dist/fi-FI-D522KHGk.js +0 -23
  961. package/dist/fi-FI-D9E_KaJi.js +0 -35
  962. package/dist/fi-FI-DPNeTsJS.js +0 -30
  963. package/dist/fi-FI-Hhku9Lmc.js +0 -35
  964. package/dist/fi-FI-REYOX46I.js +0 -22
  965. package/dist/fieldConfigurations-B8bDFQ53.js +0 -458
  966. package/dist/form-rules-DhbF2mY4.js +0 -13
  967. package/dist/formatCurrency-CMOSdJMB.js +0 -29
  968. package/dist/fr-FR-B5543Fe-.js +0 -13
  969. package/dist/fr-FR-BYuKsZIb.js +0 -35
  970. package/dist/fr-FR-Bn3D6mmY.js +0 -15
  971. package/dist/fr-FR-CJI0bIig.js +0 -33
  972. package/dist/fr-FR-CNR5-s9g.js +0 -58
  973. package/dist/fr-FR-ChmNQciP.js +0 -30
  974. package/dist/fr-FR-Cv0k-3Xc.js +0 -35
  975. package/dist/fr-FR-D9qaP6nx.js +0 -22
  976. package/dist/fr-FR-DInQKkTd.js +0 -23
  977. package/dist/getName-DJlhsDj_.js +0 -41
  978. package/dist/gift-SdNY6AqI.js +0 -14
  979. package/dist/graph-DwYwlplw.js +0 -21
  980. package/dist/graph-up-DpbCSPbc.js +0 -20
  981. package/dist/hasDataChanged-BgvxL-Hx.js +0 -19
  982. package/dist/headquarter-C6AsewcP.js +0 -21
  983. package/dist/hotel-JX0bjsSA.js +0 -22
  984. package/dist/iframeWidget-Bftkd3v_.js +0 -234
  985. package/dist/image-eUqBiRX_.js +0 -17
  986. package/dist/info-Wao3PEQK.js +0 -21
  987. package/dist/isEmpty-CuQFhMf0.js +0 -23
  988. package/dist/it-IT-BV9K87FK.js +0 -58
  989. package/dist/it-IT-BeC2Y1F8.js +0 -33
  990. package/dist/it-IT-Biduphjt.js +0 -22
  991. package/dist/it-IT-C_fNHhjE.js +0 -35
  992. package/dist/it-IT-CjEYONJg.js +0 -23
  993. package/dist/it-IT-Dd6xGSe-.js +0 -13
  994. package/dist/it-IT-DvM-9LpM.js +0 -15
  995. package/dist/it-IT-Nl57jui-.js +0 -35
  996. package/dist/it-IT-eCrTB65E.js +0 -30
  997. package/dist/keys-BpNgnAsD.js +0 -23
  998. package/dist/localizeDateString-DHsivjy2.js +0 -27
  999. package/dist/location-YXhcBMDy.js +0 -17
  1000. package/dist/mail-Z_IE_hkw.js +0 -14
  1001. package/dist/mapExistingFile-DW5ktJzM.js +0 -231
  1002. package/dist/mapScriptLocalization-CI-Ydp2z.js +0 -72
  1003. package/dist/mapTransferInstrumentToPayoutAccount-CAoOlPMA.js +0 -30
  1004. package/dist/minus-circle-filled-BGKeHaxJ.js +0 -17
  1005. package/dist/nl-NL-BHkRnVrj.js +0 -35
  1006. package/dist/nl-NL-BHqiO21q.js +0 -15
  1007. package/dist/nl-NL-Cysslsh2.js +0 -33
  1008. package/dist/nl-NL-D2QKudfh.js +0 -30
  1009. package/dist/nl-NL-DLedC3mO.js +0 -35
  1010. package/dist/nl-NL-DVENFpd5.js +0 -13
  1011. package/dist/nl-NL-DywVQ9km.js +0 -58
  1012. package/dist/nl-NL-G1wVnmzT.js +0 -22
  1013. package/dist/nl-NL-Zcq0bXd-.js +0 -23
  1014. package/dist/no-NO-B8oxqfNI.js +0 -58
  1015. package/dist/no-NO-BTtAuqCb.js +0 -22
  1016. package/dist/no-NO-BxReX6oF.js +0 -23
  1017. package/dist/no-NO-CKT9kLAH.js +0 -15
  1018. package/dist/no-NO-C_snYWBc.js +0 -30
  1019. package/dist/no-NO-CpVal4cV.js +0 -35
  1020. package/dist/no-NO-Dn2UkdoI.js +0 -13
  1021. package/dist/no-NO-kaAdT9B8.js +0 -35
  1022. package/dist/no-NO-zSnPtrDi.js +0 -33
  1023. package/dist/options-horizontal-nJ9-ButA.js +0 -18
  1024. package/dist/partner-COG2_Erh.js +0 -21
  1025. package/dist/pay-by-link-plane-Pv7Babgn.js +0 -22
  1026. package/dist/payout-iEmHhgQ4.js +0 -20
  1027. package/dist/person-CdGfItMU.js +0 -17
  1028. package/dist/plus-CwLva7fq.js +0 -14
  1029. package/dist/plus-circle-filled-Cnf1oJTm.js +0 -17
  1030. package/dist/pt-PT-BkvMsoK4.js +0 -35
  1031. package/dist/pt-PT-BvK00TeI.js +0 -58
  1032. package/dist/pt-PT-C-hbNnsB.js +0 -30
  1033. package/dist/pt-PT-CjsyP_OK.js +0 -33
  1034. package/dist/pt-PT-D2elvnDU.js +0 -15
  1035. package/dist/pt-PT-Dk48OVtf.js +0 -22
  1036. package/dist/pt-PT-N0njcfLO.js +0 -23
  1037. package/dist/pt-PT-Xm-pm3mb.js +0 -35
  1038. package/dist/pt-PT-_o5xgnxS.js +0 -13
  1039. package/dist/reporting-DlRoibD7.js +0 -17
  1040. package/dist/resolveEnvironment-BGYn6Ls_.js +0 -84
  1041. package/dist/revenue-accelerate-rtXA-8EE.js +0 -17
  1042. package/dist/rules-DP3jxPzq.js +0 -311
  1043. package/dist/save-BofgDbDX.js +0 -14
  1044. package/dist/search-BjMkvQh0.js +0 -17
  1045. package/dist/show-uL6I-rMo.js +0 -17
  1046. package/dist/sl-SI-BB7iVcFI.js +0 -22
  1047. package/dist/sl-SI-BhVTSmhQ.js +0 -30
  1048. package/dist/sl-SI-Br0UEUPL.js +0 -33
  1049. package/dist/sl-SI-BylvpF-X.js +0 -15
  1050. package/dist/sl-SI-Cth2Qa5T.js +0 -35
  1051. package/dist/sl-SI-D_rqR0D7.js +0 -35
  1052. package/dist/sl-SI-MZoDApq9.js +0 -23
  1053. package/dist/sl-SI-NI2OJAvm.js +0 -58
  1054. package/dist/solution-payments-DTAuLSWF.js +0 -14
  1055. package/dist/store-CkhgQMl0.js +0 -14
  1056. package/dist/sv-SE-66rqYTxi.js +0 -30
  1057. package/dist/sv-SE-B3zoXMuH.js +0 -35
  1058. package/dist/sv-SE-BUfESAQK.js +0 -13
  1059. package/dist/sv-SE-BtXmvxx4.js +0 -33
  1060. package/dist/sv-SE-CAZpDX9G.js +0 -58
  1061. package/dist/sv-SE-DCFSf4Oj.js +0 -23
  1062. package/dist/sv-SE-DbI-1JqN.js +0 -22
  1063. package/dist/sv-SE-Dwz1yTrB.js +0 -15
  1064. package/dist/sv-SE-OPOHtqtP.js +0 -35
  1065. package/dist/terminal-1-ewywjFJI.js +0 -18
  1066. package/dist/toCapitalized-Bq7laD0b.js +0 -13
  1067. package/dist/translation-DJHWTow9.js +0 -472
  1068. package/dist/types/api/pciTemplate/pciTemplate.types.d.ts +0 -9
  1069. package/dist/types/api/pciTemplate/usePciQuestionnaire.d.ts +0 -6
  1070. package/dist/types/api/pciTemplate/usePciQuestionnaireList.d.ts +0 -12
  1071. package/dist/types/api/pciTemplate/usePciStatus.d.ts +0 -6
  1072. package/dist/types/api/pciTemplate/usePciTemplate.d.ts +0 -14
  1073. package/dist/types/components/BusinessLines/tasks/BusinessLinesDropin.d.ts +0 -5
  1074. package/dist/types/components/Contract/hooks/useSalesChannelsSettings.d.ts +0 -3
  1075. package/dist/types/components/Shared/tasks/TaskList/TaskItemStatus.d.ts +0 -2
  1076. package/dist/types/components/ui/atoms/FormHeader/FormHeader.d.ts +0 -8
  1077. package/dist/types/components/ui/atoms/Remove/Remove.d.ts +0 -2
  1078. package/dist/types/components/ui/atoms/Remove/Remove.types.d.ts +0 -9
  1079. package/dist/types/components/ui/atoms/Status/Status.types.d.ts +0 -8
  1080. package/dist/types/components/ui/atoms/TaskStatusIndicator/TaskStatusIndicator.d.ts +0 -11
  1081. package/dist/types/components/ui/molecules/Card/CardGroup.d.ts +0 -3
  1082. package/dist/types/core/analytics.d.ts +0 -31
  1083. package/dist/types/embeds/terms-of-service-status/adyen-manage-terms-of-service.types.d.ts +0 -39
  1084. package/dist/types/hooks/useAnalytics.d.ts +0 -22
  1085. package/dist/types/utils/bankVerification/animation.d.ts +0 -2
  1086. package/dist/types/utils/trackNavigation.d.ts +0 -10
  1087. package/dist/types-CAznNNSI.js +0 -160
  1088. package/dist/types-CP1NRoE8.js +0 -74
  1089. package/dist/types-K58FM7k4.js +0 -64
  1090. package/dist/upload-XDhHhAHV.js +0 -17
  1091. package/dist/useAssociatedLegalEntity-G30FPhOX.js +0 -33
  1092. package/dist/useDataset-BgvQQEKd.js +0 -120
  1093. package/dist/useForm-C1DW3mPC.js +0 -1694
  1094. package/dist/useFormContext-beqGS11A.js +0 -23
  1095. package/dist/useGlobalData-jb7ua9I6.js +0 -205
  1096. package/dist/useMultiForm-BucfLW49.js +0 -864
  1097. package/dist/useOnboardingStatus-CTgWLZxC.js +0 -27
  1098. package/dist/useScenarios-B7IWZ3xW.js +0 -46
  1099. package/dist/useTermsOfServiceStatus-B0dIrYTA.js +0 -42
  1100. package/dist/useToastContext-DGMeMy5R.js +0 -51
  1101. package/dist/useUnincorporatedPartnershipMembers-BCvmGMOX.js +0 -99
  1102. package/dist/utils-Bwnj33y_.js +0 -277
  1103. package/dist/utils-CXtNbmpA.js +0 -29
  1104. package/dist/utils-CgOzbb9O.js +0 -159
  1105. package/dist/validate-B5PwC1oL.js +0 -100
  1106. package/dist/validate-BRz0LPdo.js +0 -382
  1107. package/dist/validate-CvtamBXH.js +0 -605
  1108. package/dist/validationError-DOCbfk7K.js +0 -86
  1109. package/dist/warning-circle-fill-DADaWT65.js +0 -17
  1110. package/dist/warning-filled-BfAQN-BF.js +0 -14
  1111. package/dist/webinar-BJWDRK2H.js +0 -22
  1112. /package/dist/types/api/{pciTemplate → pci}/useSignPci.d.ts +0 -0
  1113. /package/dist/types/components/BusinessLines/tasks/{BusinessLinesGettingStarted → BusinessLines}/BusinessLinesGettingStarted.d.ts +0 -0
@@ -0,0 +1,4841 @@
1
+ ;
2
+ {
3
+ try {
4
+ let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
5
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "d3d85f93-b586-44e8-8aca-f81c15a6c88f", e._sentryDebugIdIdentifier = "sentry-dbid-d3d85f93-b586-44e8-8aca-f81c15a6c88f");
6
+ } catch (e) {
7
+ }
8
+ }
9
+ ;
10
+ import { jsx, jsxs, Fragment } from "preact/jsx-runtime";
11
+ import { signal } from "@preact/signals";
12
+ import { useState, useEffect, useRef, useMemo, useCallback, useContext } from "preact/hooks";
13
+ import { b as useApiContext, j as useQuery, k as httpPost, m as httpGet, a1 as useMutation, a2 as useQueryClient, U as createLogger, C as CountryCodes, u as useTranslation, c as useLegalEntity, R as ROOT_LE, t as LegalEntityTypes, a as addResourceBundles, L as Loader, N as EntityTypes, _ as __variableDynamicImportRuntimeHelper, a0 as useAnalyticsContext, a3 as Icon, H as Typography, B as Button, aj as objectsDeepEqual, aU as doArraysMatch, X as isEmpty, p as useExperimentsContext, bf as getSdkToken, J as hasOwnEntityAssociationOfType, M as useAccountHolder, o as useSettingsContext, g as getLegalEntityCountry, an as Trans, bg as EEA_Countries, bh as isAccountIdentifierObscured, bi as hasEmptyFields, bj as extractFieldName, bk as concatenateFieldNames, ap as keysOf, az as getCapabilityProblems, P as TaskTypes, aA as cloneObject, x as skipToken } from "./StoreProvider-BFN15Go9.js";
14
+ import { u as useTransferInstrument, m as mapTransferInstrumentToPayoutAccount } from "./mapTransferInstrumentToPayoutAccount-CU5wx0wJ.js";
15
+ import { u as useForm, F as Field, S as Select, L as LoaderWrapper } from "./useForm-wQyeWa1b.js";
16
+ import { E as ExperimentNames } from "./types-f66rmUFy.js";
17
+ import { I as InputText, S as SettingNames } from "./InputText-Dsw9kiwL.js";
18
+ import { u as useGlobalDataSlice, a as useGlobalData, c as useResetGlobalData, b as useStateContext } from "./useGlobalData-B33uuhtd.js";
19
+ import { c as useInvalidateRootLegalEntity, a as useToastContext } from "./useToastContext-BK9oGWtb.js";
20
+ import { a as augmentWithCountryConfigs, g as getPropsFromConfigurations } from "./process-field-configurations-DoOFQqtn.js";
21
+ import { g as getRequiredForms, a as addValidityToForms, u as useFormComposer } from "./dropinUtils-D2lBlNWp.js";
22
+ import { A as AdyenKycSdkError, p as payoutAccountFormat, m as mapExistingFile, g as getPageName, u as useScenarioConfiguration, b as useUnifyLoadingStatus } from "./mapExistingFile-BhW5UmN9.js";
23
+ import { u as useDataset, d as datasetIdentifier, C as Confirm, a as datasetUtilities } from "./useDataset-BtfHQp4w.js";
24
+ import { c as currencyByCountry, C as Currencies } from "./types-CLz74bOT.js";
25
+ import { F as FormWrapper } from "./FormWrapper-dbBZegkX.js";
26
+ import { i as isValidationError, p as processValidationErrors, b as isIdDocumentUploadError, c as isBankStatementUploadError, a as isMaintenanceModeError, m as mapCreateOrUpdateTransferInstrumentErrorMessageToTranslatable } from "./validationError-CvZLhw5H.js";
27
+ import { f as fileToBase64, a as getDocument, c as createDocumentRequest, d as documentApiUtils, b as getFileExtention } from "./documentUtils-CUgKVLK4.js";
28
+ import { g as getLegalEntityNameBasedOnType, b as getPayoutAccountHolderName } from "./getName-CIw0MR9e.js";
29
+ import { I as IFrameWidget, o as omitObscuredFieldsIfUnchanged } from "./iframeWidget-yBLSAmf8.js";
30
+ import { Show } from "@preact/signals/utils";
31
+ import { s as summaryStep } from "./Summary-BkE_c8pU.js";
32
+ import { c as createFormUtils, H as Header, E as ErrorPanel, S as StackLayout, e as isNotEmptyValidator, m as mergeFieldMetadataIntoProps, d as getFieldProps, C as CountryField, a as Link, g as getFormProps, s as summaryItem } from "./CountryField-9w8wRZMW.js";
33
+ import { u as useAssociatedLegalEntity } from "./useAssociatedLegalEntity-DAB1oG6O.js";
34
+ import { i as useCapabilityProblems, j as getProblemsForEntity, D as DropzoneFile, p as bytesToSize, l as defaultFileValidationOptions, o as fileValidationRules, S as StateContextSetter, q as DocumentGuidance, t as TextArea, m as makeMask, n as numericInputs, c as nonInputs, s as spacer, k as customInputs, v as validatePatternOnBlur, r as resolveFieldMetadata, M as MaskedInput, b as alphanumericInputs, u as uppercase, d as alphaInputs, I as Image, R as RadioGroupCard, C as ContextGuidance, x as createFormRules } from "./fieldConfigurations-C38LzPl3.js";
35
+ import cx from "classnames";
36
+ import { memo, useRef as useRef$1, useState as useState$1, useMemo as useMemo$1, useEffect as useEffect$1, lazy } from "preact/compat";
37
+ import { u as useUnincorporatedPartnershipMembers } from "./useUnincorporatedPartnershipMembers-Cdts5Hbn.js";
38
+ import { b as bankStatementDescriptionPattern } from "./basePatterns-BwdnMQxI.js";
39
+ import { M as Modal } from "./Modal-CloeVnNp.js";
40
+ import { E as EndStateLayout } from "./EndStateLayout-BWC5aqVS.js";
41
+ import { createContext } from "preact";
42
+ import { a as Alert } from "./Alert-DEiOX0nw.js";
43
+ import { A as ActionBar } from "./ActionBar-CxUKVmTE.js";
44
+ import OpenBankingSDK from "@adyen/openbankingsdk";
45
+ import { T as Tag } from "./Tag-DdkVScyr.js";
46
+ import { C as Card } from "./Card-CdpPhK9y.js";
47
+ const getCheck = async (legalEntityId, baseUrl, data) => {
48
+ return httpPost(
49
+ {
50
+ baseUrl,
51
+ path: `legalEntities/${legalEntityId}/checks/bankAccount`
52
+ },
53
+ data
54
+ );
55
+ };
56
+ const useCheck = (data, options) => {
57
+ const { rootLegalEntityId, baseUrl: url } = useApiContext();
58
+ return useQuery({
59
+ queryKey: ["checkAsAService", data],
60
+ queryFn: () => getCheck(rootLegalEntityId.value, url.value, data),
61
+ ...options
62
+ });
63
+ };
64
+ const getBankVerificationProviders = async (legalEntityId, baseUrl, queryParams) => {
65
+ const { country, locale, configId } = queryParams;
66
+ const providerParams = new URLSearchParams({
67
+ country,
68
+ locale,
69
+ ...configId && { configId }
70
+ });
71
+ return httpGet({
72
+ baseUrl,
73
+ path: `legalEntities/${legalEntityId}/transferInstruments/trusted/providers?${providerParams}`
74
+ });
75
+ };
76
+ const useBankVerificationProviders = (queryParams, options) => {
77
+ const { rootLegalEntityId, baseUrl } = useApiContext();
78
+ return useQuery({
79
+ queryKey: ["bankVerificationProviders", queryParams],
80
+ queryFn: () => getBankVerificationProviders(rootLegalEntityId.value, baseUrl.value, queryParams),
81
+ ...options
82
+ });
83
+ };
84
+ const createTransferInstrument = async (rootLegalEntityId, baseUrl, transferInstrument) => {
85
+ return httpPost(
86
+ {
87
+ baseUrl,
88
+ path: `legalEntities/${rootLegalEntityId}/transferInstruments`
89
+ },
90
+ transferInstrument
91
+ );
92
+ };
93
+ const createTrustedTransferInstrument = async (legalEntityId, baseUrl, data) => {
94
+ return httpPost(
95
+ {
96
+ baseUrl,
97
+ path: `legalEntities/${legalEntityId}/transferInstruments/trusted`
98
+ },
99
+ data
100
+ );
101
+ };
102
+ const useCreateTrustedTransferInstrument = (options) => {
103
+ const { rootLegalEntityId, baseUrl } = useApiContext();
104
+ return useMutation({
105
+ mutationFn: (data) => createTrustedTransferInstrument(rootLegalEntityId.value, baseUrl.value, data),
106
+ ...options
107
+ });
108
+ };
109
+ const updateTransferInstrument = async (legalEntityId, baseUrl, transferInstrument, transferInstrumentId) => {
110
+ return httpPost(
111
+ {
112
+ baseUrl,
113
+ path: `legalEntities/${legalEntityId}/transferInstruments/${transferInstrumentId}`
114
+ },
115
+ transferInstrument
116
+ );
117
+ };
118
+ const useUpdateTransferInstrument = (options) => {
119
+ const { rootLegalEntityId, baseUrl } = useApiContext();
120
+ const queryClient = useQueryClient();
121
+ return useMutation({
122
+ mutationFn: ({ transferInstrument, transferInstrumentId }) => updateTransferInstrument(
123
+ rootLegalEntityId.value,
124
+ baseUrl.value,
125
+ transferInstrument,
126
+ transferInstrumentId
127
+ ),
128
+ onSuccess: async (transferInstrument) => {
129
+ queryClient.setQueryData(["transferInstrument", transferInstrument.id], transferInstrument);
130
+ await queryClient.invalidateQueries({
131
+ // Invalidate transfer instruments on root LE
132
+ queryKey: ["transferInstruments"]
133
+ });
134
+ },
135
+ ...options
136
+ });
137
+ };
138
+ const accountFormatsImports = /* @__PURE__ */ Object.assign({ "../accountFormats/AD.json": () => import("./AD-BQAadLyG.js"), "../accountFormats/AE.json": () => import("./AE-mIZ12t47.js"), "../accountFormats/AI.json": () => import("./AI-CYOqGKk2.js"), "../accountFormats/AL.json": () => import("./AL-BX1fEo1A.js"), "../accountFormats/AR.json": () => import("./AR-C9kMRnHG.js"), "../accountFormats/AS.json": () => import("./AS-B0TMZQ6o.js"), "../accountFormats/AT.json": () => import("./AT-BI8ju2NH.js"), "../accountFormats/AU.json": () => import("./AU-B5LSe4bo.js"), "../accountFormats/AX.json": () => import("./AX-Z6f6EnJc.js"), "../accountFormats/AZ.json": () => import("./AZ-BqrKjWMH.js"), "../accountFormats/BA.json": () => import("./BA-BbP72Tn6.js"), "../accountFormats/BE.json": () => import("./BE-nWHKW0xQ.js"), "../accountFormats/BG.json": () => import("./BG-DlvaKo4n.js"), "../accountFormats/BH.json": () => import("./BH-Ded1Eyrc.js"), "../accountFormats/BM.json": () => import("./BM-CBl-UQUl.js"), "../accountFormats/BR.json": () => import("./BR-DsY9PZVZ.js"), "../accountFormats/BS.json": () => import("./BS-dBfArxRw.js"), "../accountFormats/BV.json": () => import("./BV-D0QBsH7-.js"), "../accountFormats/BY.json": () => import("./BY-BsQUo3fM.js"), "../accountFormats/CA.json": () => import("./CA-DT4cmOOe.js"), "../accountFormats/CH.json": () => import("./CH-TX4BTE2y.js"), "../accountFormats/CN.json": () => import("./CN-BV-5PSpq.js"), "../accountFormats/CR.json": () => import("./CR-Dtv-rXg9.js"), "../accountFormats/CY.json": () => import("./CY-D59Nypl7.js"), "../accountFormats/CZ.json": () => import("./CZ-B6iI1GbE.js"), "../accountFormats/DE.json": () => import("./DE-CsuX_tSL.js"), "../accountFormats/DK.json": () => import("./DK-oQEFrF6o.js"), "../accountFormats/DO.json": () => import("./DO-B1BWc3Iy.js"), "../accountFormats/EC.json": () => import("./EC-DbNXe71-.js"), "../accountFormats/EE.json": () => import("./EE-3WZV5Ejt.js"), "../accountFormats/ES.json": () => import("./ES-NfxpqbC2.js"), "../accountFormats/FI.json": () => import("./FI-CHQIvHa-.js"), "../accountFormats/FJ.json": () => import("./FJ-CBdbPf5l.js"), "../accountFormats/FO.json": () => import("./FO-1pD1p939.js"), "../accountFormats/FR.json": () => import("./FR-MWZyWX3x.js"), "../accountFormats/GB.json": () => import("./GB-CCYHTagl.js"), "../accountFormats/GE.json": () => import("./GE-Deog1a3Z.js"), "../accountFormats/GF.json": () => import("./GF-Cda8N7A4.js"), "../accountFormats/GG.json": () => import("./GG-CPoMVQPc.js"), "../accountFormats/GI.json": () => import("./GI-DxmBwVD_.js"), "../accountFormats/GL.json": () => import("./GL-0vO9Of9c.js"), "../accountFormats/GP.json": () => import("./GP-za-3opp-.js"), "../accountFormats/GR.json": () => import("./GR-Rk0pXlNw.js"), "../accountFormats/GT.json": () => import("./GT-C1jhs-Dx.js"), "../accountFormats/GU.json": () => import("./GU-CALV5vh1.js"), "../accountFormats/HK.json": () => import("./HK-BB3PIq-Z.js"), "../accountFormats/HR.json": () => import("./HR-WapHW2fw.js"), "../accountFormats/HU.json": () => import("./HU-DCOMuOhe.js"), "../accountFormats/ID.json": () => import("./ID-BcOv4SXj.js"), "../accountFormats/IE.json": () => import("./IE-BkgtVgDi.js"), "../accountFormats/IL.json": () => import("./IL-CQ0yHRRe.js"), "../accountFormats/IM.json": () => import("./IM-Wr4iDT94.js"), "../accountFormats/IN.json": () => import("./IN-BhEI9o7G.js"), "../accountFormats/IS.json": () => import("./IS-C-Cgc6zp.js"), "../accountFormats/IT.json": () => import("./IT-CXekiddL.js"), "../accountFormats/JE.json": () => import("./JE-B4gj54Hg.js"), "../accountFormats/JM.json": () => import("./JM-BMGgBK6y.js"), "../accountFormats/JO.json": () => import("./JO-rY8A8f9C.js"), "../accountFormats/JP.json": () => import("./JP-BQG5dF1Y.js"), "../accountFormats/KR.json": () => import("./KR-74SwXHka.js"), "../accountFormats/KW.json": () => import("./KW-CcVPOJ8B.js"), "../accountFormats/KY.json": () => import("./KY-DXCeltYA.js"), "../accountFormats/KZ.json": () => import("./KZ-CZNjdp22.js"), "../accountFormats/LB.json": () => import("./LB-DZ5YfAsO.js"), "../accountFormats/LI.json": () => import("./LI-L0ZAALRT.js"), "../accountFormats/LT.json": () => import("./LT-Ao2uagV9.js"), "../accountFormats/LU.json": () => import("./LU-B7LRUuc6.js"), "../accountFormats/LV.json": () => import("./LV-DZeGjA2G.js"), "../accountFormats/MC.json": () => import("./MC-EDVNGWhy.js"), "../accountFormats/MD.json": () => import("./MD-DVc0183a.js"), "../accountFormats/ME.json": () => import("./ME-DiJhSuli.js"), "../accountFormats/MK.json": () => import("./MK-BZxslBTS.js"), "../accountFormats/MP.json": () => import("./MP-7IpnbfCj.js"), "../accountFormats/MQ.json": () => import("./MQ-DusG_no1.js"), "../accountFormats/MR.json": () => import("./MR-DaBVNHqN.js"), "../accountFormats/MT.json": () => import("./MT-B9my7RlP.js"), "../accountFormats/MU.json": () => import("./MU-D3gGVu1R.js"), "../accountFormats/MX.json": () => import("./MX-CZVOFg3D.js"), "../accountFormats/MY.json": () => import("./MY-ym71svTa.js"), "../accountFormats/NC.json": () => import("./NC-xzMvjp9-.js"), "../accountFormats/NL.json": () => import("./NL-VXAFOhV5.js"), "../accountFormats/NO.json": () => import("./NO-Cx1VSh2W.js"), "../accountFormats/NZ.json": () => import("./NZ-BP7_Q9Om.js"), "../accountFormats/PE.json": () => import("./PE-CdxgPh3v.js"), "../accountFormats/PF.json": () => import("./PF-CstaOd9Z.js"), "../accountFormats/PH.json": () => import("./PH-BYgMDYIH.js"), "../accountFormats/PK.json": () => import("./PK-bLhtgsEk.js"), "../accountFormats/PL.json": () => import("./PL-BZW1hGvD.js"), "../accountFormats/PM.json": () => import("./PM-BWbxAh4u.js"), "../accountFormats/PR.json": () => import("./PR-CFPKXEXp.js"), "../accountFormats/PS.json": () => import("./PS-B8obOOWY.js"), "../accountFormats/PT.json": () => import("./PT-OpU4MU3L.js"), "../accountFormats/QA.json": () => import("./QA-CSfx-mvb.js"), "../accountFormats/RE.json": () => import("./RE-BApq1FJ6.js"), "../accountFormats/RO.json": () => import("./RO-Cz6Sh0ls.js"), "../accountFormats/RS.json": () => import("./RS-BCenke-W.js"), "../accountFormats/RU.json": () => import("./RU-D27RC7dq.js"), "../accountFormats/SA.json": () => import("./SA-C9VgxCgm.js"), "../accountFormats/SE.json": () => import("./SE-B5K-FkQd.js"), "../accountFormats/SG.json": () => import("./SG-DoCqjlFi.js"), "../accountFormats/SI.json": () => import("./SI-BOGTNLPa.js"), "../accountFormats/SJ.json": () => import("./SJ-Z9jwQQlz.js"), "../accountFormats/SK.json": () => import("./SK-BOVrp_Av.js"), "../accountFormats/SM.json": () => import("./SM-meowwILA.js"), "../accountFormats/TF.json": () => import("./TF-BOWng-Dz.js"), "../accountFormats/TH.json": () => import("./TH-CvyXLcZK.js"), "../accountFormats/TL.json": () => import("./TL-BWslydRz.js"), "../accountFormats/TN.json": () => import("./TN-Cjd3bM_V.js"), "../accountFormats/TR.json": () => import("./TR-BBx5CuWS.js"), "../accountFormats/TT.json": () => import("./TT-D4-z5BA-.js"), "../accountFormats/TW.json": () => import("./TW-BC8YpnMr.js"), "../accountFormats/UA.json": () => import("./UA-DrXUnAe6.js"), "../accountFormats/US.json": () => import("./US-D8dI5_i1.js"), "../accountFormats/UY.json": () => import("./UY-DEHqLXhX.js"), "../accountFormats/VA.json": () => import("./VA-DXsYTCoh.js"), "../accountFormats/VG.json": () => import("./VG-DnKAVCsi.js"), "../accountFormats/VI.json": () => import("./VI-CU9MA9ux.js"), "../accountFormats/VN.json": () => import("./VN-CTSqsmB6.js"), "../accountFormats/WF.json": () => import("./WF-CwHbsjtJ.js"), "../accountFormats/YT.json": () => import("./YT-BCyAAbo7.js"), "../accountFormats/ZA.json": () => import("./ZA-NU7slima.js") });
139
+ const getAccountFormatsForCountry = async (country) => {
140
+ const importForCountry = accountFormatsImports[`../accountFormats/${country}.json`];
141
+ if (!importForCountry) {
142
+ throw Error(`No account formats available for ${country}`);
143
+ }
144
+ const countryBankFormats = (await importForCountry()).default;
145
+ const expandedBankFormats = {
146
+ ...countryBankFormats,
147
+ numberAndBic: {
148
+ bankStatementRequirement: "OPTIONAL",
149
+ fields: ["bankAccountNumber", "swiftCode"]
150
+ }
151
+ };
152
+ return expandedBankFormats;
153
+ };
154
+ const validateAccountIdentification = async (baseUrl, data) => {
155
+ return httpPost(
156
+ {
157
+ baseUrl,
158
+ path: `validations/accountidentification`
159
+ },
160
+ {
161
+ accountIdentification: {
162
+ ...data
163
+ }
164
+ }
165
+ );
166
+ };
167
+ const useValidateAccountIdentification = (options) => {
168
+ const { baseUrl } = useApiContext();
169
+ return useMutation({
170
+ mutationFn: (data) => validateAccountIdentification(baseUrl.value, data),
171
+ ...options
172
+ });
173
+ };
174
+ const useAsyncAccountDetailsValidationRules = (payload, hasEmptyFields2, isAccountNumberMasked) => {
175
+ const [timeoutId, setTimeoutId] = useState(null);
176
+ const [accountValidationData, setAccountValidationData] = useState({
177
+ invalidFields: [],
178
+ valid: false
179
+ });
180
+ const { mutateAsync } = useValidateAccountIdentification();
181
+ useEffect(() => {
182
+ const fetchAccountDetails = async (accountIdentificationPayload) => {
183
+ try {
184
+ const accountIdentificationResponse = await mutateAsync(accountIdentificationPayload);
185
+ setAccountValidationData(accountIdentificationResponse);
186
+ } catch (error) {
187
+ console.error("Error fetching account details:", error);
188
+ }
189
+ };
190
+ if (payload && !hasEmptyFields2 && !isAccountNumberMasked) {
191
+ if (timeoutId !== null) {
192
+ clearTimeout(timeoutId);
193
+ }
194
+ setTimeoutId(
195
+ setTimeout(() => {
196
+ fetchAccountDetails(payload);
197
+ setTimeoutId(null);
198
+ }, 500)
199
+ );
200
+ }
201
+ }, [mutateAsync, hasEmptyFields2, payload]);
202
+ return accountValidationData;
203
+ };
204
+ const logger = createLogger();
205
+ const getAccountIdentificationFromPayoutAccountSchema = (payoutAccount, bankCountry, enabledCrossBorderPayouts) => {
206
+ if ("iban" in payoutAccount && payoutAccount.iban) {
207
+ return {
208
+ type: "iban",
209
+ iban: payoutAccount.iban
210
+ };
211
+ }
212
+ if (enabledCrossBorderPayouts && "bankAccountNumber" in payoutAccount && payoutAccount.bankAccountNumber && "swiftCode" in payoutAccount && payoutAccount.swiftCode) {
213
+ return {
214
+ type: "numberAndBic",
215
+ bic: payoutAccount.swiftCode,
216
+ accountNumber: payoutAccount.bankAccountNumber
217
+ };
218
+ }
219
+ switch (bankCountry) {
220
+ case CountryCodes.Australia:
221
+ return {
222
+ type: "auLocal",
223
+ accountNumber: payoutAccount.bankAccountNumber,
224
+ bsbCode: payoutAccount.branchCode
225
+ };
226
+ case CountryCodes.Brazil:
227
+ return {
228
+ type: "brLocal",
229
+ accountNumber: payoutAccount.bankAccountNumber,
230
+ ispb: payoutAccount.bankCode,
231
+ bankCode: payoutAccount.bankName,
232
+ branchNumber: payoutAccount.branchCode
233
+ };
234
+ case CountryCodes.Canada:
235
+ return {
236
+ type: "caLocal",
237
+ accountNumber: payoutAccount.bankAccountNumber,
238
+ institutionNumber: payoutAccount.bankCode,
239
+ transitNumber: payoutAccount.branchCode
240
+ };
241
+ case CountryCodes.CzechRepublic:
242
+ return {
243
+ type: "czLocal",
244
+ accountNumber: payoutAccount.bankAccountNumber,
245
+ bankCode: payoutAccount.bankCode
246
+ };
247
+ case CountryCodes.Denmark:
248
+ return {
249
+ type: "dkLocal",
250
+ accountNumber: payoutAccount.bankAccountNumber,
251
+ bankCode: payoutAccount.bankCode
252
+ };
253
+ case CountryCodes.HongKong:
254
+ return {
255
+ type: "hkLocal",
256
+ accountNumber: payoutAccount.bankAccountNumber,
257
+ clearingCode: payoutAccount.bankCode
258
+ };
259
+ case CountryCodes.NewZealand:
260
+ return {
261
+ type: "nzLocal",
262
+ accountNumber: payoutAccount.bankAccountNumber?.replaceAll("-", "")
263
+ };
264
+ case CountryCodes.Sweden:
265
+ return {
266
+ type: "seLocal",
267
+ accountNumber: payoutAccount.bankAccountNumber,
268
+ clearingNumber: payoutAccount.branchCode
269
+ };
270
+ case CountryCodes.Singapore:
271
+ return {
272
+ type: "sgLocal",
273
+ accountNumber: payoutAccount.bankAccountNumber,
274
+ bic: payoutAccount.swiftCode
275
+ };
276
+ case CountryCodes.IsleOfMan:
277
+ case CountryCodes.Guernsey:
278
+ case CountryCodes.Gibraltar:
279
+ case CountryCodes.Jersey:
280
+ case CountryCodes.UnitedKingdom:
281
+ return {
282
+ type: "ukLocal",
283
+ // for some reason GB's account identification is called `ukLocalAccountIdentification`
284
+ accountNumber: payoutAccount.bankAccountNumber,
285
+ sortCode: payoutAccount.branchCode
286
+ };
287
+ case CountryCodes.NorthernMarianaIslands:
288
+ case CountryCodes.Guam:
289
+ case CountryCodes.VirginIslandsUS:
290
+ case CountryCodes.AmericanSamoa:
291
+ case CountryCodes.PuertoRico:
292
+ case CountryCodes.UnitedStates:
293
+ return {
294
+ type: "usLocal",
295
+ accountNumber: payoutAccount.bankAccountNumber,
296
+ routingNumber: payoutAccount.branchCode
297
+ };
298
+ default:
299
+ logger.log(`${bankCountry.toLowerCase()}Local is not a configured region`);
300
+ return {
301
+ type: `${bankCountry.toLowerCase()}Local`,
302
+ accountNumber: payoutAccount.bankAccountNumber
303
+ };
304
+ }
305
+ };
306
+ const mapPayoutAccountSchemaToApiBankAccount = (payoutAccount, bankCountry, preferredCurrency, enabledCrossBorderPayouts) => ({
307
+ accountIdentification: getAccountIdentificationFromPayoutAccountSchema(
308
+ payoutAccount,
309
+ bankCountry,
310
+ enabledCrossBorderPayouts
311
+ ),
312
+ preferredCurrencyCode: preferredCurrency,
313
+ countryCode: bankCountry,
314
+ bankName: payoutAccount.bankName
315
+ });
316
+ const showPayoutVerificationMethodError = signal(false);
317
+ function PayoutDetailsPage({
318
+ transferInstrumentId,
319
+ setTransferInstrumentId,
320
+ taskType,
321
+ openBankingPartnerConfigId,
322
+ onSubmit,
323
+ handleHomeClick
324
+ }) {
325
+ const { i18n } = useTranslation();
326
+ const { data: rootLe } = useLegalEntity(ROOT_LE);
327
+ const { data: associatedLe, isLoading: associatedLeIsLoading } = useAssociatedLegalEntity(
328
+ rootLe,
329
+ [
330
+ LegalEntityTypes.SOLE_PROPRIETORSHIP,
331
+ LegalEntityTypes.TRUST,
332
+ LegalEntityTypes.UNINCORPORATED_PARTNERSHIP
333
+ ]
334
+ );
335
+ const capabilityProblems = useCapabilityProblems();
336
+ addResourceBundles(i18n, [
337
+ { ns: "banking", importFn: (lang) => __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "../language/bg-BG.json": () => import("./bg-BG-DRkMqyL8.js"), "../language/cs-CZ.json": () => import("./cs-CZ-DalFZigH.js"), "../language/da-DK.json": () => import("./da-DK-P3YSaBqs.js"), "../language/de-DE.json": () => import("./de-DE-opyC1JO-.js"), "../language/el-GR.json": () => import("./el-GR-CWd7XYDU.js"), "../language/en-US.json": () => import("./en-US-h0JneJJl.js"), "../language/es-ES.json": () => import("./es-ES-BhINIOee.js"), "../language/et-EE.json": () => import("./et-EE-x29FUaYN.js"), "../language/fi-FI.json": () => import("./fi-FI-CDISJifz.js"), "../language/fr-FR.json": () => import("./fr-FR-aJ3cg4x0.js"), "../language/hr-HR.json": () => import("./hr-HR-VivDwwdW.js"), "../language/hu-HU.json": () => import("./hu-HU-WEtpzb41.js"), "../language/it-IT.json": () => import("./it-IT-C2MZo4KT.js"), "../language/ja-JP.json": () => import("./ja-JP-Bktpl_2b.js"), "../language/lt-LT.json": () => import("./lt-LT-W6fTjwB5.js"), "../language/lv-LV.json": () => import("./lv-LV-CxUmQHF9.js"), "../language/nl-NL.json": () => import("./nl-NL-Bk-1-C0e.js"), "../language/no-NO.json": () => import("./no-NO-DN9qf-_I.js"), "../language/pl-PL.json": () => import("./pl-PL-Duj3tncM.js"), "../language/pt-BR.json": () => import("./pt-BR-Cm4vZocb.js"), "../language/pt-PT.json": () => import("./pt-PT-BJjCTMYf.js"), "../language/ro-RO.json": () => import("./ro-RO-B8leE4ZJ.js"), "../language/sk-SK.json": () => import("./sk-SK-BWwRIx2d.js"), "../language/sl-SI.json": () => import("./sl-SI-6s8xycKg.js"), "../language/sv-SE.json": () => import("./sv-SE-B1sbgsnh.js") }), `../language/${lang}.json`, 3) }
338
+ ]);
339
+ if (!rootLe || associatedLeIsLoading) {
340
+ return /* @__PURE__ */ jsx(Loader, {});
341
+ }
342
+ const problems = capabilityProblems && transferInstrumentId ? getProblemsForEntity(capabilityProblems, EntityTypes.BANK_ACCOUNT, transferInstrumentId) : void 0;
343
+ return /* @__PURE__ */ jsx(
344
+ PayoutDetailsDropin,
345
+ {
346
+ taskType,
347
+ currentTransferInstrumentId: transferInstrumentId,
348
+ setCurrentTransferInstrumentId: setTransferInstrumentId,
349
+ legalEntityResponse: rootLe,
350
+ associatedLegalArrangement: associatedLe,
351
+ problems,
352
+ onSubmit,
353
+ handleHomeClick,
354
+ navigateBackToTaskList: handleHomeClick,
355
+ openBankingPartnerConfigId
356
+ }
357
+ );
358
+ }
359
+ const PayoutDetailsPage$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
360
+ __proto__: null,
361
+ PayoutDetailsPage,
362
+ showPayoutVerificationMethodError
363
+ }, Symbol.toStringTag, { value: "Module" }));
364
+ function FilePicker({
365
+ files,
366
+ setFiles,
367
+ isValid,
368
+ errorMessage,
369
+ multiple = false,
370
+ label,
371
+ name,
372
+ iconPrefix = "generic-document",
373
+ enableTracking = false,
374
+ id,
375
+ loading,
376
+ // file validation options
377
+ allowedFileTypes,
378
+ maxSize,
379
+ isOptional,
380
+ maxNumberOfFiles,
381
+ // a11y
382
+ "aria-describedby": ariaDescribedBy,
383
+ "aria-labelledby": ariaLabelledBy
384
+ }) {
385
+ const { t } = useTranslation("ui");
386
+ const userEvents = useAnalyticsContext();
387
+ const fileInput = useRef(null);
388
+ const [dragged, setDragged] = useState(false);
389
+ const hasRequiredError = errorMessage === "fieldIsRequired";
390
+ const showDropzone = files.length < maxNumberOfFiles;
391
+ const openFilePicker = () => fileInput.current?.click();
392
+ const handleFileDelete = (fileToDelete) => setFiles(files.filter((file) => file !== fileToDelete));
393
+ const handleDragEnter = (e) => {
394
+ e.preventDefault();
395
+ e.stopPropagation();
396
+ };
397
+ const handleDragLeave = (e) => {
398
+ e.preventDefault();
399
+ e.stopPropagation();
400
+ setDragged(false);
401
+ };
402
+ const handleDragOver = (e) => {
403
+ e.preventDefault();
404
+ e.stopPropagation();
405
+ setDragged(true);
406
+ };
407
+ const handleDrop = (e) => {
408
+ e.preventDefault();
409
+ e.stopPropagation();
410
+ if (e.dataTransfer) addFiles(e.dataTransfer.files);
411
+ setDragged(false);
412
+ };
413
+ const handleFilesChosen = (e) => {
414
+ const fileInput2 = e.target;
415
+ if (fileInput2.files) addFiles(fileInput2.files);
416
+ };
417
+ const addFiles = (newFiles) => {
418
+ if (enableTracking) {
419
+ userEvents.addFieldEvent("Interacted with form field", {
420
+ actionType: "change",
421
+ field: name || "dropzone"
422
+ });
423
+ }
424
+ setFiles([...newFiles, ...files]);
425
+ };
426
+ const allowedFileTypesString = allowedFileTypes.join(", ");
427
+ return /* @__PURE__ */ jsxs("div", { children: [
428
+ label && /* @__PURE__ */ jsx(
429
+ "div",
430
+ {
431
+ className: cx("adyen-kyc-label__text", {
432
+ "adyen-kyc-label__text--error": hasRequiredError
433
+ }),
434
+ children: label
435
+ }
436
+ ),
437
+ files.map((file) => /* @__PURE__ */ jsx(
438
+ DropzoneFile,
439
+ {
440
+ file,
441
+ onDelete: () => handleFileDelete(file),
442
+ errorMessage,
443
+ iconPrefix,
444
+ loading
445
+ },
446
+ file
447
+ )),
448
+ showDropzone && /* @__PURE__ */ jsxs(
449
+ "div",
450
+ {
451
+ role: "region",
452
+ className: cx("adyen-kyc-dropzone", {
453
+ "adyen-kyc-dropzone--dragged": dragged,
454
+ "adyen-kyc-dropzone--error": !dragged && hasRequiredError
455
+ }),
456
+ onDrop: handleDrop,
457
+ onDragOver: handleDragOver,
458
+ onDragEnter: handleDragEnter,
459
+ onDragLeave: handleDragLeave,
460
+ children: [
461
+ /* @__PURE__ */ jsx("div", { className: "adyen-kyc-dropzone__icon", children: /* @__PURE__ */ jsx(Icon, { name: "upload" }) }),
462
+ /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-dropzone__labels", children: [
463
+ /* @__PURE__ */ jsx(Typography, { el: "h4", variant: "body-strongest", children: t(($) => $["dropFileToUpload"]) }),
464
+ /* @__PURE__ */ jsx(Typography, { color: "secondary", children: t(($) => $["supportedFileTypes"], { fileTypes: allowedFileTypesString }) }),
465
+ /* @__PURE__ */ jsx(Typography, { color: "secondary", children: t(($) => $["maxFileSize"], { maxSize: bytesToSize(maxSize) }) }),
466
+ /* @__PURE__ */ jsx(Typography, { color: "secondary", children: t(($) => $["upToFiles"], { maxFiles: maxNumberOfFiles }) })
467
+ ] }),
468
+ /* @__PURE__ */ jsx("div", { className: "adyen-kyc-dropzone__button", children: /* @__PURE__ */ jsx(Button, { onClick: openFilePicker, variant: "secondary", children: t(($) => $["browseFiles"]) }) }),
469
+ /* @__PURE__ */ jsx(
470
+ "input",
471
+ {
472
+ id,
473
+ className: "adyen-kyc-dropzone__input",
474
+ ref: fileInput,
475
+ multiple,
476
+ accept: allowedFileTypesString,
477
+ onChange: handleFilesChosen,
478
+ type: "file",
479
+ "aria-required": !isOptional,
480
+ "aria-describedby": ariaDescribedBy,
481
+ "aria-labelledby": ariaLabelledBy,
482
+ "data-testid": "hidden-file-input",
483
+ "aria-invalid": !isValid
484
+ }
485
+ )
486
+ ]
487
+ }
488
+ ),
489
+ hasRequiredError && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-error-text", children: t(($) => $["fieldIsRequired"]) })
490
+ ] });
491
+ }
492
+ const bankDocument = "adyen-kyc-bank-document";
493
+ const bankDocumentDocumentUpload = "adyen-kyc-bank-document-document-upload";
494
+ const bankDocumentDocumentDescription = "adyen-kyc-bank-document-document-description";
495
+ const styles$5 = {
496
+ bankDocument,
497
+ bankDocumentDocumentUpload,
498
+ bankDocumentDocumentDescription
499
+ };
500
+ const documentRequirements$1 = "adyen-kyc-document-requirements";
501
+ const documentRequirementsSubtitle = "adyen-kyc-document-requirements-subtitle";
502
+ const styles$4 = {
503
+ documentRequirements: documentRequirements$1,
504
+ documentRequirementsSubtitle
505
+ };
506
+ const BankDocumentTypes = {
507
+ BANK_STATEMENT: "bankStatement",
508
+ DEPOSIT_SLIP: "depositSlip",
509
+ SCREENSHOT_OF_BANK: "screenshotOfOnlineBankingEnviroment",
510
+ A_LETTER_FROM_YOUR_BANK: "aLetterFromYourBank",
511
+ CHECK: "check"
512
+ };
513
+ const bankDocumentOptions = [
514
+ { id: BankDocumentTypes.BANK_STATEMENT, name: "bankStatementDocument" },
515
+ { id: BankDocumentTypes.DEPOSIT_SLIP, name: "depositSlip" },
516
+ { id: BankDocumentTypes.SCREENSHOT_OF_BANK, name: "screenshotOfOnlineBankingEnviroment" },
517
+ { id: BankDocumentTypes.A_LETTER_FROM_YOUR_BANK, name: "aLetterFromYourBank" },
518
+ { id: BankDocumentTypes.CHECK, name: "check" }
519
+ ];
520
+ const BankDocumentRequirement = {
521
+ ACCOUNT_NAME_INDIVIDUAL: "bankAccountNameIndividual",
522
+ ACCOUNT_NAME_ORGANIZATION: "bankAccountNameOrganization",
523
+ ACCOUNT_NAME_WITH_SOLE_PROP: "bankAccountNameWithSoleProprietor",
524
+ ACCOUNT_NAME_WITH_TRUST: "bankAccountNameWithTrust",
525
+ ACCOUNT_NAME_WITH_UNINCORPORATED_PARTNERSHIP: "accountMustBeInTheNameOfUnincorporatedPartnership",
526
+ ACCOUNT_NUMBER_OR_IBAN: "accountNumberOrIbanVisible",
527
+ ACCOUNT_NUMBER: "accountNumberVisible",
528
+ ACCOUNT_NUMBER_FULL_OR_PARTIAL: "accountNumberFullOrPartialVisible",
529
+ DATE_ON_DOCUMENT: "datedInTheLastXMonths",
530
+ COUNTRY_OF_BANK: "showsCountryOfBankAccount",
531
+ OFFICIAL_DOCUMENT: "hasToBeOfficialDocumentFromBank",
532
+ STAMP_OR_SIGNATURE: "hasBankStampOrBankSignature",
533
+ HIGH_RESOLUTION_CHECK: "highResolutionCheck"
534
+ };
535
+ const accountNameRequirement = {
536
+ [LegalEntityTypes.INDIVIDUAL]: {
537
+ default: BankDocumentRequirement.ACCOUNT_NAME_INDIVIDUAL
538
+ },
539
+ [LegalEntityTypes.ORGANIZATION]: {
540
+ default: BankDocumentRequirement.ACCOUNT_NAME_ORGANIZATION
541
+ }
542
+ };
543
+ const accountNameRequirementWithLegalArrangement = {
544
+ [LegalEntityTypes.INDIVIDUAL]: {
545
+ [LegalEntityTypes.SOLE_PROPRIETORSHIP]: {
546
+ default: BankDocumentRequirement.ACCOUNT_NAME_WITH_SOLE_PROP
547
+ },
548
+ [LegalEntityTypes.TRUST]: {
549
+ [CountryCodes.UnitedStates]: "bankAccountNameWithTrust_US",
550
+ default: BankDocumentRequirement.ACCOUNT_NAME_WITH_TRUST
551
+ },
552
+ [LegalEntityTypes.UNINCORPORATED_PARTNERSHIP]: {
553
+ default: BankDocumentRequirement.ACCOUNT_NAME_WITH_UNINCORPORATED_PARTNERSHIP
554
+ }
555
+ },
556
+ [LegalEntityTypes.ORGANIZATION]: {
557
+ [LegalEntityTypes.TRUST]: {
558
+ [CountryCodes.UnitedStates]: "bankAccountNameWithTrust_US",
559
+ default: BankDocumentRequirement.ACCOUNT_NAME_WITH_TRUST
560
+ },
561
+ [LegalEntityTypes.UNINCORPORATED_PARTNERSHIP]: {
562
+ default: BankDocumentRequirement.ACCOUNT_NAME_WITH_UNINCORPORATED_PARTNERSHIP
563
+ }
564
+ }
565
+ };
566
+ const applyNamedModifiers = (country, documentModifiers) => {
567
+ if (!documentModifiers.associatedEntityType || !documentModifiers.associatedEntityLegalName) {
568
+ switch (documentModifiers.rootEntityType) {
569
+ case LegalEntityTypes.INDIVIDUAL:
570
+ return {
571
+ key: accountNameRequirement[LegalEntityTypes.INDIVIDUAL].default,
572
+ options: { values: { individualLegalName: documentModifiers.rootEntityLegalName } }
573
+ };
574
+ case LegalEntityTypes.ORGANIZATION:
575
+ default:
576
+ return {
577
+ key: accountNameRequirement[LegalEntityTypes.ORGANIZATION].default,
578
+ options: { values: { companyLegalName: documentModifiers.rootEntityLegalName } }
579
+ };
580
+ }
581
+ }
582
+ switch (documentModifiers.rootEntityType) {
583
+ case LegalEntityTypes.INDIVIDUAL:
584
+ switch (documentModifiers.associatedEntityType) {
585
+ case LegalEntityTypes.TRUST:
586
+ return {
587
+ key: accountNameRequirementWithLegalArrangement[LegalEntityTypes.INDIVIDUAL][LegalEntityTypes.TRUST]?.[country] ?? accountNameRequirementWithLegalArrangement[LegalEntityTypes.INDIVIDUAL][LegalEntityTypes.TRUST].default,
588
+ options: {
589
+ values: {
590
+ trusteeName: documentModifiers.rootEntityLegalName,
591
+ trustLegalName: documentModifiers.associatedEntityLegalName,
592
+ trustTradingName: documentModifiers.associatedEntityTradingName ?? documentModifiers.associatedEntityLegalName
593
+ }
594
+ }
595
+ };
596
+ case LegalEntityTypes.UNINCORPORATED_PARTNERSHIP:
597
+ return {
598
+ key: accountNameRequirementWithLegalArrangement[LegalEntityTypes.INDIVIDUAL][LegalEntityTypes.UNINCORPORATED_PARTNERSHIP]?.[country] ?? accountNameRequirementWithLegalArrangement[LegalEntityTypes.INDIVIDUAL][LegalEntityTypes.UNINCORPORATED_PARTNERSHIP].default,
599
+ options: {
600
+ values: {
601
+ partnerNames: documentModifiers.unincorporatedPartnershipMembers || "",
602
+ partnershipName: documentModifiers.associatedEntityLegalName
603
+ }
604
+ }
605
+ };
606
+ case LegalEntityTypes.SOLE_PROPRIETORSHIP:
607
+ default:
608
+ return {
609
+ key: accountNameRequirementWithLegalArrangement[LegalEntityTypes.INDIVIDUAL][LegalEntityTypes.SOLE_PROPRIETORSHIP].default,
610
+ options: {
611
+ values: {
612
+ individualLegalName: documentModifiers.rootEntityLegalName,
613
+ soleProprietorshipName: documentModifiers.associatedEntityLegalName
614
+ }
615
+ }
616
+ };
617
+ }
618
+ case LegalEntityTypes.ORGANIZATION:
619
+ default:
620
+ switch (documentModifiers.associatedEntityType) {
621
+ case LegalEntityTypes.TRUST:
622
+ return {
623
+ key: accountNameRequirementWithLegalArrangement[LegalEntityTypes.ORGANIZATION][LegalEntityTypes.TRUST]?.[country] ?? accountNameRequirementWithLegalArrangement[LegalEntityTypes.ORGANIZATION][LegalEntityTypes.TRUST].default,
624
+ options: {
625
+ values: {
626
+ trusteeName: documentModifiers.rootEntityLegalName,
627
+ trustLegalName: documentModifiers.associatedEntityLegalName,
628
+ trustTradingName: documentModifiers.associatedEntityTradingName ?? documentModifiers.associatedEntityLegalName
629
+ }
630
+ }
631
+ };
632
+ case LegalEntityTypes.UNINCORPORATED_PARTNERSHIP:
633
+ return {
634
+ key: accountNameRequirementWithLegalArrangement[LegalEntityTypes.ORGANIZATION][LegalEntityTypes.UNINCORPORATED_PARTNERSHIP]?.[country] ?? accountNameRequirementWithLegalArrangement[LegalEntityTypes.ORGANIZATION][LegalEntityTypes.UNINCORPORATED_PARTNERSHIP].default,
635
+ options: {
636
+ values: {
637
+ partnerNames: documentModifiers.unincorporatedPartnershipMembers || "",
638
+ partnershipName: documentModifiers.associatedEntityLegalName
639
+ }
640
+ }
641
+ };
642
+ default:
643
+ return { key: accountNameRequirement[LegalEntityTypes.ORGANIZATION].default };
644
+ }
645
+ }
646
+ };
647
+ const getBankDocumentRequirements = (country, documentType, documentModifiers) => {
648
+ const isBasedInUS = country === "US";
649
+ const baseRequirements = isBasedInUS ? [{ key: BankDocumentRequirement.OFFICIAL_DOCUMENT }] : [
650
+ { key: BankDocumentRequirement.OFFICIAL_DOCUMENT },
651
+ { key: BankDocumentRequirement.COUNTRY_OF_BANK }
652
+ ];
653
+ const accountNumberRequirement = isBasedInUS ? documentType === BankDocumentTypes.CHECK || documentType === BankDocumentTypes.DEPOSIT_SLIP ? [{ key: BankDocumentRequirement.ACCOUNT_NUMBER }] : [{ key: BankDocumentRequirement.ACCOUNT_NUMBER_FULL_OR_PARTIAL }] : [{ key: BankDocumentRequirement.ACCOUNT_NUMBER_OR_IBAN }];
654
+ const requireLast12Months = isBasedInUS ? documentType === BankDocumentTypes.A_LETTER_FROM_YOUR_BANK || documentType === BankDocumentTypes.BANK_STATEMENT : documentType !== BankDocumentTypes.SCREENSHOT_OF_BANK;
655
+ const requireStampOrSignature = !isBasedInUS && (documentType === BankDocumentTypes.DEPOSIT_SLIP || documentType === BankDocumentTypes.A_LETTER_FROM_YOUR_BANK);
656
+ const requirements = [
657
+ applyNamedModifiers(country, documentModifiers),
658
+ ...accountNumberRequirement,
659
+ ...baseRequirements
660
+ ];
661
+ if (requireLast12Months) {
662
+ requirements.push({
663
+ key: BankDocumentRequirement.DATE_ON_DOCUMENT,
664
+ options: { values: { number: 12 } }
665
+ });
666
+ }
667
+ if (requireStampOrSignature) {
668
+ requirements.push({ key: BankDocumentRequirement.STAMP_OR_SIGNATURE });
669
+ }
670
+ if (isBasedInUS && documentType === BankDocumentTypes.CHECK) {
671
+ requirements.push({ key: BankDocumentRequirement.HIGH_RESOLUTION_CHECK });
672
+ }
673
+ return requirements;
674
+ };
675
+ const BankDocumentRequirements = ({
676
+ country,
677
+ documentType,
678
+ documentModifiers
679
+ }) => {
680
+ const { t } = useTranslation("banking");
681
+ const { t: commonT } = useTranslation("common");
682
+ const documentRequirements2 = getBankDocumentRequirements(
683
+ country,
684
+ documentType,
685
+ documentModifiers
686
+ );
687
+ return /* @__PURE__ */ jsxs("div", { className: styles$4.documentRequirements, children: [
688
+ /* @__PURE__ */ jsx("strong", { className: styles$4.documentRequirementsSubtitle, children: commonT(($) => $["documentRequirements"]) }),
689
+ /* @__PURE__ */ jsx("ul", { children: documentRequirements2.map(({ key, options }, i) => /* @__PURE__ */ jsx("li", { "data-testid": key, children: t(($) => $[key], options?.values) }, i)) })
690
+ ] });
691
+ };
692
+ const bankDocumentValidationRules = {
693
+ description: {
694
+ modes: ["blur"],
695
+ validate: (description2) => description2 ? bankStatementDescriptionPattern.test(description2) : true,
696
+ errorMessage: "invalidFormatBankStatementDescription"
697
+ }
698
+ };
699
+ const getValidationIssuesKeys = (validationResponse) => {
700
+ const issues2 = [];
701
+ const { blurryOrLowQuality, documentType } = validationResponse;
702
+ if (blurryOrLowQuality) {
703
+ issues2.push("documentIsntReadable");
704
+ }
705
+ if (documentType === "other" || documentType !== "bankDocument") {
706
+ issues2.push("documentIsNotBankDocument");
707
+ }
708
+ if (!documentType || documentType === "other") {
709
+ issues2.push("documentNameMissing");
710
+ }
711
+ return issues2;
712
+ };
713
+ const CHARACTERS_LIMIT$1 = 200;
714
+ const bankDocumentFields = [
715
+ "documentType",
716
+ "bankStatementDocument",
717
+ "description"
718
+ ];
719
+ function BankDocument(props) {
720
+ const {
721
+ legalEntity,
722
+ associatedLegalArrangement,
723
+ country,
724
+ optionalFields,
725
+ validators,
726
+ data: bankData,
727
+ id,
728
+ description: description2,
729
+ heading,
730
+ formIsActive,
731
+ fieldValidationErrors,
732
+ shouldValidate
733
+ } = props;
734
+ const { t } = useTranslation("banking");
735
+ const { t: commonT } = useTranslation("common");
736
+ const stateRef = useRef({ setState: null });
737
+ const isBankStatementOptional = optionalFields?.includes("bankStatementDocument") ?? false;
738
+ const formUtils = createFormUtils(props, commonT);
739
+ const bankStatementValidationOptions = useMemo(
740
+ () => ({
741
+ ...defaultFileValidationOptions,
742
+ isOptional: isBankStatementOptional
743
+ }),
744
+ [isBankStatementOptional]
745
+ );
746
+ const rules2 = useMemo(
747
+ () => ({
748
+ ...validators || bankDocumentValidationRules,
749
+ bankStatementDocument: fileValidationRules(bankStatementValidationOptions)
750
+ }),
751
+ [bankStatementValidationOptions, validators]
752
+ );
753
+ const { handleChangeFor, data, setData, valid, fieldProblems, errors, triggerValidation } = useForm({
754
+ ...props,
755
+ schema: bankDocumentFields,
756
+ defaultData: bankData,
757
+ rules: rules2,
758
+ fieldProblems: fieldValidationErrors,
759
+ shouldValidate
760
+ });
761
+ useEffect(() => {
762
+ if (formIsActive) {
763
+ triggerValidation();
764
+ }
765
+ }, [formIsActive, triggerValidation]);
766
+ const alreadyUploadedDocuments = useMemo(
767
+ () => bankData?.bankStatementDocument ?? [],
768
+ [bankData?.bankStatementDocument]
769
+ );
770
+ const hasAlreadyUploadedDocuments = alreadyUploadedDocuments.length > 0;
771
+ const usingExistingUploadedDocuments = data.bankStatementDocument && doArraysMatch(alreadyUploadedDocuments, data.bankStatementDocument);
772
+ useEffect(() => {
773
+ if (hasAlreadyUploadedDocuments) {
774
+ setData("bankStatementDocument", alreadyUploadedDocuments);
775
+ if (bankData?.description) setData("description", bankData.description);
776
+ triggerValidation();
777
+ }
778
+ }, [
779
+ alreadyUploadedDocuments,
780
+ hasAlreadyUploadedDocuments,
781
+ bankData?.description,
782
+ setData,
783
+ triggerValidation
784
+ ]);
785
+ useEffect(() => {
786
+ stateRef.current?.setState?.({
787
+ type: "addToState",
788
+ value: {
789
+ data,
790
+ valid,
791
+ errors,
792
+ fieldProblems,
793
+ dataStoreId: id,
794
+ schema: bankDocumentFields
795
+ }
796
+ });
797
+ }, [data, valid, errors, fieldProblems, id]);
798
+ const getBankDocumentOptions = () => bankDocumentOptions.map(({ id: id2, name }) => ({ id: id2, name: t(($) => $[name]) }));
799
+ const unincorporatedPartnershipMembers = useUnincorporatedPartnershipMembers();
800
+ const documentsModifiers = useMemo(
801
+ () => ({
802
+ rootEntityType: legalEntity.type,
803
+ rootEntityLegalName: getLegalEntityNameBasedOnType(legalEntity),
804
+ associatedEntityType: associatedLegalArrangement?.type,
805
+ associatedEntityLegalName: associatedLegalArrangement?.[associatedLegalArrangement?.type]?.name,
806
+ associatedEntityTradingName: associatedLegalArrangement?.[associatedLegalArrangement?.type]?.doingBusinessAs,
807
+ unincorporatedPartnershipMembers: unincorporatedPartnershipMembers?.map((member) => member?.name)?.join(", ")
808
+ }),
809
+ [legalEntity, associatedLegalArrangement, unincorporatedPartnershipMembers]
810
+ );
811
+ return /* @__PURE__ */ jsxs("form", { className: styles$5.bankDocument, children: [
812
+ /* @__PURE__ */ jsx(StateContextSetter, { owner: id, stateRef }),
813
+ heading && /* @__PURE__ */ jsx(Header, { title: heading, description: description2 }),
814
+ /* @__PURE__ */ jsx(
815
+ ErrorPanel,
816
+ {
817
+ verificationErrors: props?.formVerificationErrors,
818
+ validationErrors: props?.fieldValidationErrors,
819
+ formUtils,
820
+ id: "ariaErrorField"
821
+ }
822
+ ),
823
+ formUtils.isVisibleField("bankStatementDocument") && /* @__PURE__ */ jsxs(Fragment, { children: [
824
+ !usingExistingUploadedDocuments && /* @__PURE__ */ jsx(
825
+ Field,
826
+ {
827
+ name: "documentType",
828
+ label: formUtils.getLabel("bankStatementDocument", "selectDocumentType"),
829
+ className: "adyen-kyc-bank-document__document-type",
830
+ children: (childProps) => /* @__PURE__ */ jsx(
831
+ Select,
832
+ {
833
+ ...childProps,
834
+ onChange: handleChangeFor("documentType"),
835
+ name: "documentType",
836
+ placeholder: commonT(($) => $["selectDocument"]),
837
+ isInvalid: false,
838
+ items: getBankDocumentOptions(),
839
+ selected: data.documentType
840
+ }
841
+ )
842
+ }
843
+ ),
844
+ data.documentType ? /* @__PURE__ */ jsxs(Fragment, { children: [
845
+ country ? /* @__PURE__ */ jsx(
846
+ BankDocumentRequirements,
847
+ {
848
+ country,
849
+ documentType: data.documentType,
850
+ documentModifiers: documentsModifiers
851
+ }
852
+ ) : void 0,
853
+ /* @__PURE__ */ jsx(DocumentGuidance, { type: "bankStatement", className: "adyen-kyc-u-margin-y-24" })
854
+ ] }) : null,
855
+ data.documentType || usingExistingUploadedDocuments ? /* @__PURE__ */ jsx(
856
+ Field,
857
+ {
858
+ className: cx(styles$5.bankDocumentDocumentUpload, "adyen-kyc-upload-field"),
859
+ name: "bankStatementDocument",
860
+ isValid: valid.bankStatementDocument,
861
+ children: (childProps) => /* @__PURE__ */ jsx(
862
+ FilePicker,
863
+ {
864
+ ...childProps,
865
+ name: "bankStatementDocument",
866
+ files: data.bankStatementDocument ?? [],
867
+ setFiles: handleChangeFor("bankStatementDocument"),
868
+ isValid: valid.bankStatementDocument ?? isBankStatementOptional,
869
+ errorMessage: errors.bankStatementDocument?.errorMessage,
870
+ ...bankStatementValidationOptions
871
+ }
872
+ )
873
+ }
874
+ ) : null
875
+ ] }),
876
+ data.documentType || usingExistingUploadedDocuments ? /* @__PURE__ */ jsx(
877
+ Field,
878
+ {
879
+ className: cx(styles$5.bankDocumentDocumentDescription),
880
+ name: "description",
881
+ label: formUtils.getLabel("bankDocumentFileDescription"),
882
+ errorMessage: formUtils.getErrorMessage("description", errors, fieldProblems),
883
+ isValid: valid.description,
884
+ children: (childProps) => /* @__PURE__ */ jsx(
885
+ TextArea,
886
+ {
887
+ ...childProps,
888
+ name: "description",
889
+ value: data.description,
890
+ maxLength: CHARACTERS_LIMIT$1,
891
+ onInput: handleChangeFor("description"),
892
+ "aria-invalid": !valid.description
893
+ }
894
+ )
895
+ }
896
+ ) : null
897
+ ] });
898
+ }
899
+ const MemoizedBankDocument = memo(
900
+ BankDocument,
901
+ (prevProps, nextProps) => objectsDeepEqual(prevProps.requiredFields, nextProps.requiredFields) && objectsDeepEqual(prevProps.optionalFields, nextProps.optionalFields) && objectsDeepEqual(prevProps.data, nextProps.data) && objectsDeepEqual(prevProps.formVerificationErrors, nextProps.formVerificationErrors) && objectsDeepEqual(prevProps.fieldValidationErrors, nextProps.fieldValidationErrors) && prevProps.country === nextProps.country && prevProps.shouldValidate === nextProps.shouldValidate && prevProps.heading === nextProps.heading && prevProps.formIsActive === nextProps.formIsActive
902
+ );
903
+ const validateDocument = async (context, document2) => {
904
+ const { baseUrl, rootLegalEntityId } = context;
905
+ return httpPost(
906
+ {
907
+ baseUrl,
908
+ path: `legalEntities/${rootLegalEntityId}/genai/classify`
909
+ },
910
+ document2
911
+ );
912
+ };
913
+ const useValidateDocument = (options) => {
914
+ const { rootLegalEntityId, baseUrl } = useApiContext();
915
+ return useMutation({
916
+ mutationFn: (payload) => validateDocument(
917
+ { rootLegalEntityId: rootLegalEntityId.value, baseUrl: baseUrl.value },
918
+ payload
919
+ ),
920
+ retry: 0,
921
+ ...options
922
+ });
923
+ };
924
+ const bankDocumentClassification = "adyen-kyc-bank-document-classification";
925
+ const requirementsList = "adyen-kyc-requirements-list";
926
+ const filePickerDisabled = "adyen-kyc-file-picker-disabled";
927
+ const reviewModal = "adyen-kyc-review-modal";
928
+ const preview = "adyen-kyc-preview";
929
+ const previewImage = "adyen-kyc-preview-image";
930
+ const content = "adyen-kyc-content";
931
+ const actions = "adyen-kyc-actions";
932
+ const title$1 = "adyen-kyc-title";
933
+ const description = "adyen-kyc-description";
934
+ const issues = "adyen-kyc-issues";
935
+ const confirmationModal = "adyen-kyc-confirmation-modal";
936
+ const styles$3 = {
937
+ bankDocumentClassification,
938
+ requirementsList,
939
+ filePickerDisabled,
940
+ reviewModal,
941
+ preview,
942
+ previewImage,
943
+ content,
944
+ actions,
945
+ title: title$1,
946
+ description,
947
+ issues,
948
+ confirmationModal
949
+ };
950
+ function RequirementsSection({ titleKey, requirementKeys }) {
951
+ const { t } = useTranslation("banking");
952
+ return /* @__PURE__ */ jsxs("div", { children: [
953
+ /* @__PURE__ */ jsx(Typography, { variant: "body-stronger", el: "h4", className: "adyen-kyc-u-margin-bottom-8", children: t(($) => $[titleKey]) }),
954
+ /* @__PURE__ */ jsx("ul", { children: requirementKeys.map((key) => /* @__PURE__ */ jsx("li", { children: t(($) => $[key]) }, key)) })
955
+ ] });
956
+ }
957
+ const commonRequirementsKeys = [
958
+ "bankAccountInYourName",
959
+ "includesFullOrPartialAccountNumber",
960
+ "includesBankLogoOrName"
961
+ ];
962
+ const documentRequirements = [
963
+ {
964
+ titleKey: "bankStatements",
965
+ additionalKeys: ["datedInLast12Months"]
966
+ },
967
+ {
968
+ titleKey: "depositSlips"
969
+ },
970
+ {
971
+ titleKey: "onlineBankingScreenshots"
972
+ },
973
+ {
974
+ titleKey: "lettersFromBank",
975
+ additionalKeys: ["datedInLast12Months"]
976
+ },
977
+ {
978
+ titleKey: "checks",
979
+ additionalKeys: ["highResolutionImageFullCheck"]
980
+ }
981
+ ];
982
+ function BankDocumentRequirementsModal({
983
+ isOpen,
984
+ onClose
985
+ }) {
986
+ const { t } = useTranslation("banking");
987
+ if (!isOpen) return null;
988
+ return /* @__PURE__ */ jsx(Modal, { ariaLabel: t(($) => $["moreAboutBankDocuments"]), onClose, size: "medium", inset: true, children: /* @__PURE__ */ jsxs(StackLayout, { gap: "large", children: [
989
+ /* @__PURE__ */ jsx(Typography, { variant: "title-l", el: "h1", children: t(($) => $["moreAboutBankDocuments"]) }),
990
+ /* @__PURE__ */ jsxs("div", { children: [
991
+ /* @__PURE__ */ jsx(Typography, { variant: "body-stronger", el: "h3", className: "adyen-kyc-u-margin-bottom-8", children: t(($) => $["whyDoIHaveToUploadBankDocument"]) }),
992
+ /* @__PURE__ */ jsx(Typography, { variant: "body", children: t(($) => $["bankDocumentFraudPrevention"]) })
993
+ ] }),
994
+ /* @__PURE__ */ jsxs("div", { children: [
995
+ /* @__PURE__ */ jsx(Typography, { variant: "body-stronger", el: "h3", className: "adyen-kyc-u-margin-bottom-8", children: t(($) => $["whatAreDocumentRequirements"]) }),
996
+ /* @__PURE__ */ jsx(Typography, { variant: "body", children: t(($) => $["bankDocumentRequirementsIntro"]) })
997
+ ] }),
998
+ documentRequirements.map(({ titleKey, additionalKeys }) => /* @__PURE__ */ jsx(
999
+ RequirementsSection,
1000
+ {
1001
+ titleKey,
1002
+ requirementKeys: commonRequirementsKeys.concat(additionalKeys || [])
1003
+ },
1004
+ titleKey
1005
+ ))
1006
+ ] }) });
1007
+ }
1008
+ const CHARACTERS_LIMIT = 200;
1009
+ const bankDocumentClassificationFields = [
1010
+ "bankStatementDocument",
1011
+ "description"
1012
+ ];
1013
+ function BankDocumentClassification(props) {
1014
+ const {
1015
+ legalEntity,
1016
+ optionalFields,
1017
+ validators,
1018
+ data: bankData,
1019
+ id,
1020
+ formIsActive,
1021
+ fieldValidationErrors,
1022
+ formVerificationErrors,
1023
+ shouldValidate
1024
+ } = props;
1025
+ const { t } = useTranslation("banking");
1026
+ const { t: commonT } = useTranslation("common");
1027
+ const stateRef = useRef$1({ setState: null });
1028
+ const [showReviewModal, setShowReviewModal] = useState$1(false);
1029
+ const [showConfirmationModal, setShowConfirmationModal] = useState$1(false);
1030
+ const [showRequirementsModal, setShowRequirementsModal] = useState$1(false);
1031
+ const [validationResponse, setValidationResponse] = useState$1(
1032
+ null
1033
+ );
1034
+ const [showEndState, setShowEndState] = useState$1(false);
1035
+ const inputRef = useRef$1(null);
1036
+ const logger2 = createLogger();
1037
+ const userEvents = useAnalyticsContext();
1038
+ const isBankStatementOptional = optionalFields?.includes("bankStatementDocument") ?? false;
1039
+ const formUtils = createFormUtils(props, commonT);
1040
+ const bankStatementValidationOptions = useMemo$1(
1041
+ () => ({
1042
+ ...defaultFileValidationOptions,
1043
+ isOptional: isBankStatementOptional
1044
+ }),
1045
+ [isBankStatementOptional]
1046
+ );
1047
+ const rules2 = useMemo$1(
1048
+ () => ({
1049
+ ...validators || bankDocumentValidationRules,
1050
+ bankStatementDocument: fileValidationRules(bankStatementValidationOptions)
1051
+ }),
1052
+ [bankStatementValidationOptions, validators]
1053
+ );
1054
+ const { handleChangeFor, data, setData, valid, fieldProblems, errors, triggerValidation } = useForm({
1055
+ ...props,
1056
+ schema: bankDocumentClassificationFields,
1057
+ defaultData: bankData,
1058
+ rules: rules2,
1059
+ fieldProblems: fieldValidationErrors,
1060
+ shouldValidate
1061
+ });
1062
+ const validateDocumentMutation = useValidateDocument({
1063
+ onSuccess: (response) => {
1064
+ setValidationResponse(response);
1065
+ if (response?.blurryOrLowQuality || response?.documentType === "other" || response?.documentType !== "bankDocument") {
1066
+ userEvents.addEvent("Opened modal", {
1067
+ actionType: "open",
1068
+ actionLevel: "journey",
1069
+ label: "bankDocumentClassification"
1070
+ });
1071
+ setShowReviewModal(true);
1072
+ } else {
1073
+ setShowEndState(true);
1074
+ userEvents.addEvent("Success", {
1075
+ actionType: "upload",
1076
+ actionLevel: "journey",
1077
+ label: "bankDocumentClassification"
1078
+ });
1079
+ setTimeout(() => {
1080
+ setShowEndState(false);
1081
+ setShowReviewModal(false);
1082
+ }, 2e3);
1083
+ }
1084
+ },
1085
+ onError: (error) => {
1086
+ userEvents.addEvent("Encountered error", {
1087
+ actionType: "upload",
1088
+ actionLevel: "journey",
1089
+ label: "bankDocumentClassification"
1090
+ });
1091
+ logger2.error("Document validation failed:", error);
1092
+ setShowReviewModal(false);
1093
+ setValidationResponse(null);
1094
+ }
1095
+ });
1096
+ const handleDocumentUpload = async (files) => {
1097
+ setData("bankStatementDocument", files);
1098
+ triggerValidation();
1099
+ if (files.length > 0) {
1100
+ const file = files[0];
1101
+ if (file && file instanceof File) {
1102
+ try {
1103
+ const base64Content = await fileToBase64(file);
1104
+ const document2 = {
1105
+ documentType: "bankStatement",
1106
+ fileName: file.name,
1107
+ sessionId: legalEntity.id,
1108
+ attachments: [
1109
+ {
1110
+ content: base64Content,
1111
+ pageName: file.name
1112
+ }
1113
+ ]
1114
+ };
1115
+ validateDocumentMutation.mutate(document2);
1116
+ } catch (error) {
1117
+ logger2.error("Error processing document:", error);
1118
+ }
1119
+ }
1120
+ }
1121
+ };
1122
+ useEffect$1(() => {
1123
+ if (formIsActive && isBankStatementOptional) {
1124
+ triggerValidation();
1125
+ }
1126
+ }, [formIsActive, isBankStatementOptional, triggerValidation]);
1127
+ const alreadyUploadedDocuments = useMemo$1(
1128
+ () => bankData?.bankStatementDocument ?? [],
1129
+ [bankData?.bankStatementDocument]
1130
+ );
1131
+ useEffect$1(() => {
1132
+ if (alreadyUploadedDocuments.length > 0) {
1133
+ setData("bankStatementDocument", alreadyUploadedDocuments);
1134
+ if (bankData?.description) setData("description", bankData.description);
1135
+ triggerValidation();
1136
+ }
1137
+ }, [alreadyUploadedDocuments, bankData?.description, setData, triggerValidation]);
1138
+ useEffect$1(() => {
1139
+ stateRef.current?.setState?.({
1140
+ type: "addToState",
1141
+ value: {
1142
+ data,
1143
+ valid,
1144
+ errors,
1145
+ fieldProblems,
1146
+ dataStoreId: id,
1147
+ schema: bankDocumentClassificationFields
1148
+ }
1149
+ });
1150
+ }, [data, valid, errors, fieldProblems, id]);
1151
+ const documentsModifiers = useMemo$1(
1152
+ () => ({
1153
+ rootEntityType: legalEntity.type,
1154
+ rootEntityLegalName: getLegalEntityNameBasedOnType(legalEntity)
1155
+ }),
1156
+ [legalEntity]
1157
+ );
1158
+ const handleUploadNewDocument = () => {
1159
+ userEvents.addEvent("Clicked button", {
1160
+ actionType: "next",
1161
+ actionLevel: "journey",
1162
+ label: "bankDocumentClassificationUploadNewDocument"
1163
+ });
1164
+ inputRef.current?.click();
1165
+ };
1166
+ const handleContinueAnyway = () => {
1167
+ setShowConfirmationModal(true);
1168
+ };
1169
+ const handleConfirmationCancel = () => {
1170
+ setShowConfirmationModal(false);
1171
+ };
1172
+ const handleUseDocument = () => {
1173
+ setShowConfirmationModal(false);
1174
+ setShowReviewModal(false);
1175
+ userEvents.addEvent("Clicked button", {
1176
+ actionType: "next",
1177
+ actionLevel: "journey",
1178
+ label: "bankDocumentClassificationContinueAnyway"
1179
+ });
1180
+ };
1181
+ const documentPreview = useMemo$1(() => {
1182
+ if (!data.bankStatementDocument?.[0] || !showReviewModal) return null;
1183
+ const file = data.bankStatementDocument?.[0];
1184
+ return file.type === "application/pdf" || file.name.toLowerCase().endsWith(".pdf") ? /* @__PURE__ */ jsx(
1185
+ "object",
1186
+ {
1187
+ width: "100%",
1188
+ height: "100%",
1189
+ data: URL.createObjectURL(file),
1190
+ type: "application/pdf",
1191
+ "aria-label": t(($) => $["reviewDocument"]),
1192
+ "data-testid": "pdf-preview"
1193
+ }
1194
+ ) : /* @__PURE__ */ jsx("img", { src: URL.createObjectURL(file), alt: t(($) => $["reviewDocument"]) });
1195
+ }, [data?.bankStatementDocument, showReviewModal, t]);
1196
+ return /* @__PURE__ */ jsxs("div", { className: styles$3.bankDocumentPage, children: [
1197
+ /* @__PURE__ */ jsxs("form", { className: styles$3.bankDocumentClassification, children: [
1198
+ /* @__PURE__ */ jsx(StateContextSetter, { owner: id, stateRef }),
1199
+ /* @__PURE__ */ jsx(
1200
+ Header,
1201
+ {
1202
+ title: t(
1203
+ ($) => $[isBankStatementOptional ? "uploadABankDocumentOptional" : "uploadABankDocument"]
1204
+ ),
1205
+ description: t(($) => $["toVerifyYourBankAccountDetails"]),
1206
+ children: /* @__PURE__ */ jsx(Button, { slot: "actions", variant: "link", onClick: () => setShowRequirementsModal(true), children: commonT(($) => $["learnMore"]) })
1207
+ }
1208
+ ),
1209
+ /* @__PURE__ */ jsx(
1210
+ ErrorPanel,
1211
+ {
1212
+ verificationErrors: formVerificationErrors,
1213
+ validationErrors: fieldValidationErrors,
1214
+ formUtils,
1215
+ id: "ariaErrorField"
1216
+ }
1217
+ ),
1218
+ /* @__PURE__ */ jsxs("div", { children: [
1219
+ /* @__PURE__ */ jsx("h3", { className: styles$3.requirementsList, children: t(($) => $["documentRequirements"]) }),
1220
+ /* @__PURE__ */ jsxs("ul", { className: styles$3.requirementsList, children: [
1221
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["documentRequirementNameOrBusiness"], {
1222
+ businessName: documentsModifiers.rootEntityLegalName
1223
+ }) }),
1224
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["documentRequirementAccountNumber"]) }),
1225
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["documentRequirementBankInfo"]) })
1226
+ ] })
1227
+ ] }),
1228
+ /* @__PURE__ */ jsx(
1229
+ Field,
1230
+ {
1231
+ className: cx("adyen-kyc-upload-field"),
1232
+ name: "bankStatementDocument",
1233
+ isValid: valid.bankStatementDocument,
1234
+ children: (childProps) => /* @__PURE__ */ jsx("div", { className: validateDocumentMutation.isPending ? styles$3.filePickerDisabled : "", children: /* @__PURE__ */ jsx(
1235
+ FilePicker,
1236
+ {
1237
+ ...childProps,
1238
+ name: "bankStatementDocument",
1239
+ files: data.bankStatementDocument ?? [],
1240
+ setFiles: handleDocumentUpload,
1241
+ isValid: valid.bankStatementDocument ?? isBankStatementOptional,
1242
+ errorMessage: errors.bankStatementDocument?.errorMessage,
1243
+ loading: validateDocumentMutation.isPending,
1244
+ ...bankStatementValidationOptions
1245
+ }
1246
+ ) })
1247
+ }
1248
+ ),
1249
+ data.bankStatementDocument?.length ? /* @__PURE__ */ jsx(
1250
+ Field,
1251
+ {
1252
+ className: "adyen-kyc-document-description",
1253
+ name: "description",
1254
+ label: formUtils.getLabel("bankDocumentFileDescription"),
1255
+ errorMessage: formUtils.getErrorMessage("description", errors, fieldProblems),
1256
+ isValid: valid.description,
1257
+ children: (childProps) => /* @__PURE__ */ jsx(
1258
+ TextArea,
1259
+ {
1260
+ ...childProps,
1261
+ name: "description",
1262
+ value: data.description,
1263
+ maxLength: CHARACTERS_LIMIT,
1264
+ onInput: handleChangeFor("description"),
1265
+ "aria-invalid": !valid.description
1266
+ }
1267
+ )
1268
+ }
1269
+ ) : void 0
1270
+ ] }),
1271
+ showReviewModal && /* @__PURE__ */ jsx(
1272
+ Modal,
1273
+ {
1274
+ ariaLabel: t(($) => $["reviewDocument"]),
1275
+ size: showEndState ? "small" : "medium",
1276
+ inset: showEndState,
1277
+ showCloseButton: !showEndState,
1278
+ onClose: !showEndState ? handleContinueAnyway : void 0,
1279
+ children: showEndState ? /* @__PURE__ */ jsx(EndStateLayout, { title: t(($) => $["documentUploaded"]) }) : /* @__PURE__ */ jsxs("div", { className: styles$3.reviewModal, children: [
1280
+ /* @__PURE__ */ jsx("div", { className: styles$3.preview, children: /* @__PURE__ */ jsx("div", { className: styles$3.previewImage, children: documentPreview }) }),
1281
+ /* @__PURE__ */ jsxs("div", { className: styles$3.content, children: [
1282
+ /* @__PURE__ */ jsx("h2", { className: styles$3.title, children: t(($) => $["reviewDocument"]) }),
1283
+ /* @__PURE__ */ jsx("p", { className: styles$3.description, children: t(($) => $["reviewDocumentDescription"]) }),
1284
+ /* @__PURE__ */ jsx(Button, { variant: "link", onClick: () => setShowRequirementsModal(true), children: commonT(($) => $["learnMore"]) }),
1285
+ /* @__PURE__ */ jsx("ul", { className: styles$3.issues, children: validationResponse && getValidationIssuesKeys(validationResponse).map((issue, index) => /* @__PURE__ */ jsx("li", { children: t(($) => $[issue]) }, index)) }),
1286
+ /* @__PURE__ */ jsxs("div", { className: styles$3.actions, children: [
1287
+ /* @__PURE__ */ jsx(
1288
+ Button,
1289
+ {
1290
+ variant: "secondary",
1291
+ disabled: validateDocumentMutation.isPending,
1292
+ onClick: handleContinueAnyway,
1293
+ children: commonT(($) => $["continue"])
1294
+ }
1295
+ ),
1296
+ /* @__PURE__ */ jsx(
1297
+ Button,
1298
+ {
1299
+ loading: validateDocumentMutation.isPending,
1300
+ variant: "primary",
1301
+ onClick: handleUploadNewDocument,
1302
+ children: t(($) => $["uploadNewDocument"])
1303
+ }
1304
+ )
1305
+ ] })
1306
+ ] })
1307
+ ] })
1308
+ }
1309
+ ),
1310
+ showConfirmationModal && /* @__PURE__ */ jsx(
1311
+ Modal,
1312
+ {
1313
+ ariaLabel: t(($) => $["useThisDocument"]),
1314
+ size: "small",
1315
+ onClose: handleConfirmationCancel,
1316
+ children: /* @__PURE__ */ jsxs("div", { className: styles$3.confirmationModal, children: [
1317
+ /* @__PURE__ */ jsx("h2", { className: styles$3.title, children: t(($) => $["useThisDocument"]) }),
1318
+ /* @__PURE__ */ jsx("p", { className: styles$3.description, children: t(($) => $["thisDocumentNeedstoBeReviewedManually"]) }),
1319
+ /* @__PURE__ */ jsxs("div", { className: styles$3.actions, children: [
1320
+ /* @__PURE__ */ jsx(Button, { variant: "secondary", onClick: handleConfirmationCancel, children: commonT(($) => $["cancel"]) }),
1321
+ /* @__PURE__ */ jsx(Button, { variant: "primary", onClick: handleUseDocument, children: t(($) => $["useDocument"]) })
1322
+ ] })
1323
+ ] })
1324
+ }
1325
+ ),
1326
+ /* @__PURE__ */ jsx(
1327
+ BankDocumentRequirementsModal,
1328
+ {
1329
+ isOpen: showRequirementsModal,
1330
+ onClose: () => setShowRequirementsModal(false)
1331
+ }
1332
+ ),
1333
+ /* @__PURE__ */ jsx(
1334
+ "input",
1335
+ {
1336
+ id,
1337
+ ref: inputRef,
1338
+ className: "adyen-kyc-dropzone__input",
1339
+ onChange: (e) => {
1340
+ const fileInput = e.target;
1341
+ if (fileInput?.files?.length) handleDocumentUpload([...fileInput.files]);
1342
+ },
1343
+ type: "file",
1344
+ accept: defaultFileValidationOptions.allowedFileTypes.join(", ")
1345
+ }
1346
+ )
1347
+ ] });
1348
+ }
1349
+ const MemoizedBankDocumentClassification = memo(
1350
+ BankDocumentClassification,
1351
+ (prevProps, nextProps) => objectsDeepEqual(prevProps.requiredFields, nextProps.requiredFields) && objectsDeepEqual(prevProps.optionalFields, nextProps.optionalFields) && objectsDeepEqual(prevProps.data, nextProps.data) && objectsDeepEqual(prevProps.formVerificationErrors, nextProps.formVerificationErrors) && objectsDeepEqual(prevProps.fieldValidationErrors, nextProps.fieldValidationErrors) && prevProps.country === nextProps.country && prevProps.shouldValidate === nextProps.shouldValidate && prevProps.heading === nextProps.heading && prevProps.formIsActive === nextProps.formIsActive
1352
+ );
1353
+ const bankVerificationValidationRules = {
1354
+ verifiedAccountHolder: {
1355
+ modes: ["blur"],
1356
+ validate: (verifiedAccountHolder) => !isEmpty(verifiedAccountHolder),
1357
+ errorMessage: "fieldIsRequired"
1358
+ },
1359
+ verifiedBankCountry: {
1360
+ modes: ["blur"],
1361
+ validate: (verifiedBankCountry) => !isEmpty(verifiedBankCountry),
1362
+ errorMessage: "fieldIsRequired"
1363
+ },
1364
+ verifiedBankName: {
1365
+ modes: ["blur"],
1366
+ validate: (verifiedBankName) => !isEmpty(verifiedBankName),
1367
+ errorMessage: "fieldIsRequired"
1368
+ },
1369
+ verifiedCurrencyCode: {
1370
+ modes: ["blur"],
1371
+ validate: (verifiedCurrencyCode) => !isEmpty(verifiedCurrencyCode),
1372
+ errorMessage: "fieldIsRequired"
1373
+ },
1374
+ verifiedBankAccountNumber: {
1375
+ modes: ["blur"],
1376
+ validate: (verifiedBankAccountNumber) => !isEmpty(verifiedBankAccountNumber),
1377
+ errorMessage: "fieldIsRequired"
1378
+ }
1379
+ };
1380
+ const handleBankVerificationError = async (legalEntityId, baseUrl, bankVerificationErrorParams) => {
1381
+ return httpPost(
1382
+ {
1383
+ baseUrl,
1384
+ path: `legalEntities/${legalEntityId}/transferInstruments/trusted/error`
1385
+ },
1386
+ bankVerificationErrorParams
1387
+ );
1388
+ };
1389
+ const useHandleBankVerificationError = (options) => {
1390
+ const { rootLegalEntityId, baseUrl } = useApiContext();
1391
+ return useMutation({
1392
+ mutationFn: (params) => handleBankVerificationError(rootLegalEntityId.value, baseUrl.value, params),
1393
+ ...options
1394
+ });
1395
+ };
1396
+ const VerificationWidgetCallbackActions = {
1397
+ HANDLE_EXCEPTION: "handle_exception",
1398
+ VERIFICATION_SUCCESS: "verification_success",
1399
+ RETRY_VERIFICATION: "retry_verification",
1400
+ HANDLE_EVENT: "handle_event"
1401
+ };
1402
+ const WIDGET_CONTAINER_CLASS$1 = `adyen-kyc-bank-verification-widget-container`;
1403
+ function BankVerificationOverlay({
1404
+ url,
1405
+ setBankVerificationError,
1406
+ onBack,
1407
+ retrieveBankAccountInfo,
1408
+ createTrustedTransferInstrument: createTrustedTransferInstrument2
1409
+ }) {
1410
+ const { t } = useTranslation("banking");
1411
+ const userEvents = useAnalyticsContext();
1412
+ const widgetContainerRef = useRef(null);
1413
+ const { mutateAsync: handleBankVerificationError2 } = useHandleBankVerificationError();
1414
+ const trackVerificationError = (returnValue) => {
1415
+ userEvents.addPageEvent("Encountered error", {
1416
+ actionType: "add",
1417
+ returnType: "sdk error",
1418
+ returnValue
1419
+ });
1420
+ };
1421
+ const DEFAULT_ERROR = {
1422
+ error: "UNKNOWN_ERROR",
1423
+ message: t(($) => $["weCouldntCompleteTheAccountCheck"])
1424
+ };
1425
+ useEffect(() => {
1426
+ setBankVerificationError(null);
1427
+ }, [setBankVerificationError]);
1428
+ const widgetCallback = useCallback(
1429
+ (payload) => {
1430
+ const errorContent = t(($) => $["tryAgainOrManualAccountDetails"]);
1431
+ switch (payload.action) {
1432
+ case VerificationWidgetCallbackActions.HANDLE_EXCEPTION: {
1433
+ let errorTitle;
1434
+ const { err } = payload;
1435
+ switch (!(err instanceof Error) && err?.error) {
1436
+ case "USER_CANCELLED":
1437
+ errorTitle = "";
1438
+ break;
1439
+ case "CONNECTION_ERROR":
1440
+ errorTitle = t(($) => $["couldNotEstablishBankConnection"]);
1441
+ break;
1442
+ case "GENERIC_ERROR":
1443
+ errorTitle = t(($) => $["ranIntoTechnicalError"]);
1444
+ break;
1445
+ case "UNKNOWN_ERROR":
1446
+ default: {
1447
+ errorTitle = t(($) => $["couldNotCompleteAccountCheck"]);
1448
+ break;
1449
+ }
1450
+ }
1451
+ if (errorTitle) {
1452
+ setBankVerificationError({ title: errorTitle, content: errorContent });
1453
+ }
1454
+ showInstantVerificationPayoutModal.value = false;
1455
+ onBack?.();
1456
+ break;
1457
+ }
1458
+ case VerificationWidgetCallbackActions.RETRY_VERIFICATION:
1459
+ setBankVerificationError({
1460
+ title: t(($) => $["failedInitializeInstantVerification"]),
1461
+ content: errorContent
1462
+ });
1463
+ onBack?.();
1464
+ break;
1465
+ case VerificationWidgetCallbackActions.HANDLE_EVENT: {
1466
+ const { name, provider } = payload.event;
1467
+ if (name === "institution_selected" && provider === "plaid") {
1468
+ widgetContainerRef.current?.classList.add(`${WIDGET_CONTAINER_CLASS$1}--plaid-modal`);
1469
+ }
1470
+ break;
1471
+ }
1472
+ case VerificationWidgetCallbackActions.VERIFICATION_SUCCESS: {
1473
+ const { accounts } = payload.result;
1474
+ if (accounts) retrieveBankAccountInfo(accounts[0]);
1475
+ }
1476
+ }
1477
+ },
1478
+ [t, retrieveBankAccountInfo, onBack, setBankVerificationError]
1479
+ );
1480
+ useEffect(() => {
1481
+ const container = widgetContainerRef.current;
1482
+ if (!container) return;
1483
+ const openBanking = OpenBankingSDK.create({
1484
+ divElement: container,
1485
+ link: url,
1486
+ successHandler: (code, state) => {
1487
+ createTrustedTransferInstrument2?.(code, state).then((res) => {
1488
+ userEvents.addPageEvent("Success", { actionType: "add" });
1489
+ if (res) {
1490
+ widgetCallback({
1491
+ action: VerificationWidgetCallbackActions.VERIFICATION_SUCCESS,
1492
+ result: res
1493
+ });
1494
+ }
1495
+ }).catch(() => {
1496
+ trackVerificationError(DEFAULT_ERROR.error);
1497
+ widgetCallback({
1498
+ action: VerificationWidgetCallbackActions.HANDLE_EXCEPTION,
1499
+ err: DEFAULT_ERROR
1500
+ });
1501
+ });
1502
+ },
1503
+ errorHandler: (errorCode, errorMessage, state, metadata) => {
1504
+ trackVerificationError(errorCode);
1505
+ handleBankVerificationError2?.({
1506
+ errorCode,
1507
+ errorMessage,
1508
+ state,
1509
+ metadata: metadata && Object.fromEntries(metadata)
1510
+ }).then(
1511
+ (error) => widgetCallback({
1512
+ action: VerificationWidgetCallbackActions.HANDLE_EXCEPTION,
1513
+ err: error
1514
+ })
1515
+ ).catch(
1516
+ () => widgetCallback({
1517
+ action: VerificationWidgetCallbackActions.HANDLE_EXCEPTION,
1518
+ err: DEFAULT_ERROR
1519
+ })
1520
+ );
1521
+ },
1522
+ eventHandler: (eventName, provider) => {
1523
+ widgetCallback({
1524
+ action: VerificationWidgetCallbackActions.HANDLE_EVENT,
1525
+ event: { name: eventName, provider }
1526
+ });
1527
+ }
1528
+ });
1529
+ openBanking.open();
1530
+ container.classList.add(WIDGET_CONTAINER_CLASS$1, `${WIDGET_CONTAINER_CLASS$1}--fullscreen`);
1531
+ return () => {
1532
+ openBanking?.destroy();
1533
+ };
1534
+ }, []);
1535
+ return /* @__PURE__ */ jsx("div", { ref: widgetContainerRef });
1536
+ }
1537
+ const WIDGET_IFRAME_CLASS = "adyen-kyc-bank-verification-widget";
1538
+ const WIDGET_CONTAINER_CLASS = `${WIDGET_IFRAME_CLASS}-container`;
1539
+ function BankVerificationWidget({
1540
+ url,
1541
+ vendor,
1542
+ setBankVerificationError,
1543
+ setHideVerificationWidget,
1544
+ onBack,
1545
+ retrieveBankAccountInfo,
1546
+ createTrustedTransferInstrument: createTrustedTransferInstrument2,
1547
+ fullscreen
1548
+ }) {
1549
+ const { t } = useTranslation("banking");
1550
+ const userEvents = useAnalyticsContext();
1551
+ const { isExperimentEnabled } = useExperimentsContext();
1552
+ const widgetContainerRef = useRef(null);
1553
+ const sdkToken = getSdkToken();
1554
+ const { mutateAsync: handleBankVerificationError2 } = useHandleBankVerificationError();
1555
+ const trackVerificationError = (returnValue) => {
1556
+ userEvents.addPageEvent("Encountered error", {
1557
+ actionType: "add",
1558
+ returnType: "sdk error",
1559
+ returnValue
1560
+ });
1561
+ };
1562
+ const DEFAULT_ERROR = {
1563
+ error: "UNKNOWN_ERROR",
1564
+ message: t(($) => $["weCouldntCompleteTheAccountCheck"])
1565
+ };
1566
+ setBankVerificationError(null);
1567
+ const widgetCallback = useCallback(
1568
+ (payload) => {
1569
+ const errorContent = t(($) => $["tryAgainOrManualAccountDetails"]);
1570
+ switch (payload.action) {
1571
+ case VerificationWidgetCallbackActions.HANDLE_EXCEPTION: {
1572
+ let errorTitle;
1573
+ const { err } = payload;
1574
+ switch (!(err instanceof Error) && err?.error) {
1575
+ case "USER_CANCELLED":
1576
+ errorTitle = "";
1577
+ break;
1578
+ case "CONNECTION_ERROR":
1579
+ errorTitle = t(($) => $["couldNotEstablishBankConnection"]);
1580
+ break;
1581
+ case "GENERIC_ERROR":
1582
+ errorTitle = t(($) => $["ranIntoTechnicalError"]);
1583
+ break;
1584
+ case "UNKNOWN_ERROR":
1585
+ default: {
1586
+ errorTitle = t(($) => $["couldNotCompleteAccountCheck"]);
1587
+ break;
1588
+ }
1589
+ }
1590
+ if (errorTitle) {
1591
+ setBankVerificationError({ title: errorTitle, content: errorContent });
1592
+ }
1593
+ setHideVerificationWidget(true);
1594
+ if (isExperimentEnabled(ExperimentNames.EnablePayoutVerificationMethodPageRedesign)) {
1595
+ showInstantVerificationPayoutModal.value = false;
1596
+ }
1597
+ onBack?.();
1598
+ break;
1599
+ }
1600
+ case VerificationWidgetCallbackActions.RETRY_VERIFICATION:
1601
+ setBankVerificationError({
1602
+ title: t(($) => $["failedInitializeInstantVerification"]),
1603
+ content: errorContent
1604
+ });
1605
+ setHideVerificationWidget(true);
1606
+ onBack?.();
1607
+ break;
1608
+ case VerificationWidgetCallbackActions.HANDLE_EVENT: {
1609
+ const { name, provider } = payload.event;
1610
+ if (name === "institution_selected" && provider === "plaid") {
1611
+ widgetContainerRef.current?.classList.add(`${WIDGET_CONTAINER_CLASS}--plaid-modal`);
1612
+ }
1613
+ break;
1614
+ }
1615
+ case VerificationWidgetCallbackActions.VERIFICATION_SUCCESS: {
1616
+ const { accounts } = payload.result;
1617
+ if (accounts) retrieveBankAccountInfo(accounts[0]);
1618
+ setHideVerificationWidget(true);
1619
+ }
1620
+ }
1621
+ },
1622
+ [t, retrieveBankAccountInfo, onBack, setBankVerificationError, setHideVerificationWidget]
1623
+ );
1624
+ useEffect(
1625
+ () => {
1626
+ const container = widgetContainerRef.current;
1627
+ if (!container) return;
1628
+ let iFrame;
1629
+ let iFrameWidget;
1630
+ let openBanking;
1631
+ if (createTrustedTransferInstrument2) {
1632
+ openBanking = OpenBankingSDK.create({
1633
+ divElement: container,
1634
+ link: url,
1635
+ successHandler: (code, state) => {
1636
+ createTrustedTransferInstrument2(code, state).then((res) => {
1637
+ userEvents.addPageEvent("Success", { actionType: "add" });
1638
+ if (res) {
1639
+ widgetCallback({
1640
+ action: VerificationWidgetCallbackActions.VERIFICATION_SUCCESS,
1641
+ result: res
1642
+ });
1643
+ }
1644
+ }).catch(() => {
1645
+ trackVerificationError(DEFAULT_ERROR.error);
1646
+ widgetCallback({
1647
+ action: VerificationWidgetCallbackActions.HANDLE_EXCEPTION,
1648
+ err: DEFAULT_ERROR
1649
+ });
1650
+ });
1651
+ },
1652
+ errorHandler: (errorCode, errorMessage, state, metadata) => {
1653
+ trackVerificationError(errorCode);
1654
+ handleBankVerificationError2?.({
1655
+ errorCode,
1656
+ errorMessage,
1657
+ state,
1658
+ metadata: metadata && Object.fromEntries(metadata)
1659
+ }).then(
1660
+ (error) => widgetCallback({
1661
+ action: VerificationWidgetCallbackActions.HANDLE_EXCEPTION,
1662
+ err: error
1663
+ })
1664
+ ).catch(
1665
+ () => widgetCallback({
1666
+ action: VerificationWidgetCallbackActions.HANDLE_EXCEPTION,
1667
+ err: DEFAULT_ERROR
1668
+ })
1669
+ );
1670
+ },
1671
+ eventHandler: (eventName, provider) => {
1672
+ widgetCallback({
1673
+ action: VerificationWidgetCallbackActions.HANDLE_EVENT,
1674
+ event: { name: eventName, provider }
1675
+ });
1676
+ }
1677
+ });
1678
+ openBanking.open();
1679
+ } else {
1680
+ iFrame = document.createElement("iframe");
1681
+ iFrame.setAttribute("allowFullscreen", "true");
1682
+ iFrame.classList.add(WIDGET_IFRAME_CLASS);
1683
+ container.appendChild(iFrame);
1684
+ requestAnimationFrame(async () => {
1685
+ try {
1686
+ iFrameWidget = new IFrameWidget(iFrame, url, vendor, sdkToken);
1687
+ const result = await iFrameWidget.mountAndWaitForResponse();
1688
+ widgetCallback({
1689
+ action: VerificationWidgetCallbackActions.VERIFICATION_SUCCESS,
1690
+ result
1691
+ });
1692
+ userEvents.addPageEvent("Success", { actionType: "add" });
1693
+ } catch (err) {
1694
+ if (err instanceof AdyenKycSdkError) {
1695
+ switch (err.message) {
1696
+ case "WIDGET_ACCOUNT_COMMIT_FAILURE":
1697
+ return widgetCallback({
1698
+ action: VerificationWidgetCallbackActions.HANDLE_EXCEPTION,
1699
+ err: err.sourceError
1700
+ });
1701
+ case "WIDGET_LAUNCH_FAILED":
1702
+ case "WIDGET_URL_MALFORMED":
1703
+ case "WIDGET_TIMEOUT":
1704
+ return widgetCallback({
1705
+ action: VerificationWidgetCallbackActions.RETRY_VERIFICATION
1706
+ });
1707
+ default:
1708
+ return widgetCallback({
1709
+ action: VerificationWidgetCallbackActions.HANDLE_EXCEPTION,
1710
+ err: {
1711
+ error: err?.name ?? VerificationWidgetCallbackActions.HANDLE_EXCEPTION,
1712
+ message: err.sourceError?.message ?? VerificationWidgetCallbackActions.HANDLE_EXCEPTION
1713
+ }
1714
+ });
1715
+ }
1716
+ }
1717
+ trackVerificationError(err instanceof AdyenKycSdkError ? err.message : "sdk error");
1718
+ return widgetCallback({
1719
+ action: VerificationWidgetCallbackActions.HANDLE_EXCEPTION,
1720
+ err
1721
+ });
1722
+ }
1723
+ });
1724
+ }
1725
+ container.classList.add(WIDGET_CONTAINER_CLASS);
1726
+ if (fullscreen) {
1727
+ container.classList.add(`${WIDGET_CONTAINER_CLASS}--fullscreen`);
1728
+ }
1729
+ return () => {
1730
+ iFrameWidget?.unmount();
1731
+ iFrame?.remove();
1732
+ openBanking?.destroy();
1733
+ };
1734
+ },
1735
+ // Effect dependencies have been omitted here, which isn't intended. However, there seems to be
1736
+ // some problematic behaviour in the overall flow with the dependencies present, which requires
1737
+ // further debugging and tracing to resolve (totally out of the scope of this component).
1738
+ // [url, vendor, widgetCallback]
1739
+ []
1740
+ );
1741
+ return /* @__PURE__ */ jsx("div", { ref: widgetContainerRef });
1742
+ }
1743
+ const accountVerificationFields = [
1744
+ "verifiedAccountHolder",
1745
+ "verifiedBankCountry",
1746
+ "verifiedBankName",
1747
+ "verifiedCurrencyCode",
1748
+ "verifiedBankAccountNumber"
1749
+ ];
1750
+ const InstantVerificationErrorContext = createContext(null);
1751
+ const useInstantVerificationErrorNotification = (notificationVisibilityDuration) => {
1752
+ const [errorNotification, setErrorNotification] = useState(null);
1753
+ const dismissNotificationTimeoutRef = useRef();
1754
+ const clearNotificationTimeout = useCallback(() => {
1755
+ if (dismissNotificationTimeoutRef.current) {
1756
+ clearTimeout(dismissNotificationTimeoutRef.current);
1757
+ dismissNotificationTimeoutRef.current = void 0;
1758
+ }
1759
+ }, []);
1760
+ useEffect(() => {
1761
+ clearNotificationTimeout();
1762
+ if (errorNotification && notificationVisibilityDuration > 0) {
1763
+ dismissNotificationTimeoutRef.current = setTimeout(() => {
1764
+ setErrorNotification(null);
1765
+ clearNotificationTimeout();
1766
+ }, notificationVisibilityDuration);
1767
+ }
1768
+ return () => clearNotificationTimeout();
1769
+ }, [errorNotification, clearNotificationTimeout, notificationVisibilityDuration]);
1770
+ return [errorNotification, setErrorNotification];
1771
+ };
1772
+ function BankVerification(props) {
1773
+ const {
1774
+ heading,
1775
+ setBankVerificationError,
1776
+ onBack,
1777
+ hideSidebar,
1778
+ setBankInfoValidated,
1779
+ bankInfoValidated,
1780
+ formIsActive,
1781
+ createTrustedTransferInstrument: createTrustedTransferInstrument2,
1782
+ country,
1783
+ data: propData,
1784
+ provider,
1785
+ id,
1786
+ fieldValidationErrors
1787
+ } = props;
1788
+ const { t } = useTranslation("banking");
1789
+ const { t: commonT } = useTranslation("common");
1790
+ const { isExperimentEnabled } = useExperimentsContext();
1791
+ const invalidateRootLegalEntity = useInvalidateRootLegalEntity();
1792
+ const schema = accountVerificationFields;
1793
+ const stateRef = useRef({ setState: null });
1794
+ const [hideVerificationWidget, setHideVerificationWidget] = useState(false);
1795
+ const isPayoutVerificationMethodPageRedesignEnabled = isExperimentEnabled(
1796
+ ExperimentNames.EnablePayoutVerificationMethodPageRedesign
1797
+ );
1798
+ const { handleChangeFor, data, valid, errors, isValid, triggerValidation, fieldProblems } = useForm({
1799
+ ...props,
1800
+ schema,
1801
+ defaultData: propData,
1802
+ rules: bankVerificationValidationRules,
1803
+ fieldProblems: fieldValidationErrors
1804
+ });
1805
+ const retrieveBankAccountInfo = async ({
1806
+ realLastFour,
1807
+ number,
1808
+ bankName
1809
+ }) => {
1810
+ handleChangeFor("verifiedBankAccountNumber")(realLastFour ? `*******${realLastFour}` : number);
1811
+ handleChangeFor("verifiedBankName")(bankName);
1812
+ handleChangeFor("verifiedBankCountry")(country);
1813
+ handleChangeFor("verifiedAccountHolder")(propData?.verifiedAccountHolder);
1814
+ handleChangeFor("verifiedCurrencyCode")(
1815
+ propData?.verifiedCurrencyCode ?? currencyByCountry[country]?.[0]
1816
+ );
1817
+ setBankInfoValidated?.(true);
1818
+ hideSidebar?.(false);
1819
+ triggerValidation();
1820
+ await invalidateRootLegalEntity();
1821
+ if (isPayoutVerificationMethodPageRedesignEnabled) {
1822
+ showInstantVerificationPayoutModal.value = false;
1823
+ }
1824
+ };
1825
+ const handleOnBack = () => {
1826
+ setHideVerificationWidget(false);
1827
+ onBack?.();
1828
+ };
1829
+ useEffect(() => {
1830
+ stateRef.current.setState?.({
1831
+ type: "addToState",
1832
+ value: {
1833
+ data,
1834
+ valid,
1835
+ errors,
1836
+ fieldProblems,
1837
+ dataStoreId: id,
1838
+ schema
1839
+ }
1840
+ });
1841
+ }, [data, valid, errors, isValid]);
1842
+ useEffect(() => {
1843
+ if (!isPayoutVerificationMethodPageRedesignEnabled) {
1844
+ hideSidebar?.(formIsActive && !bankInfoValidated);
1845
+ return () => hideSidebar?.(false);
1846
+ }
1847
+ }, [bankInfoValidated, formIsActive]);
1848
+ if (isPayoutVerificationMethodPageRedesignEnabled && provider) {
1849
+ if (bankInfoValidated) {
1850
+ return null;
1851
+ }
1852
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1853
+ /* @__PURE__ */ jsx(StateContextSetter, { owner: id, stateRef }),
1854
+ /* @__PURE__ */ jsx(
1855
+ BankVerificationOverlay,
1856
+ {
1857
+ url: provider.redirectUrl,
1858
+ setBankVerificationError,
1859
+ onBack: handleOnBack,
1860
+ retrieveBankAccountInfo,
1861
+ createTrustedTransferInstrument: createTrustedTransferInstrument2
1862
+ }
1863
+ )
1864
+ ] });
1865
+ }
1866
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1867
+ /* @__PURE__ */ jsx(StateContextSetter, { owner: id, stateRef }),
1868
+ bankInfoValidated && /* @__PURE__ */ jsxs(Fragment, { children: [
1869
+ heading && /* @__PURE__ */ jsx(Header, { title: heading }),
1870
+ /* @__PURE__ */ jsx(Alert, { title: t(($) => $["youSuccessfullyVerifiedAccount"]), variant: "success" })
1871
+ ] }),
1872
+ provider && formIsActive && !bankInfoValidated && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-bank-verification-container", children: /* @__PURE__ */ jsx("form", { className: "adyen-kyc-bank-verification", children: !hideVerificationWidget ? /* @__PURE__ */ jsxs(Fragment, { children: [
1873
+ /* @__PURE__ */ jsx(
1874
+ BankVerificationWidget,
1875
+ {
1876
+ url: provider.redirectUrl,
1877
+ vendor: provider.name,
1878
+ setBankVerificationError,
1879
+ setHideVerificationWidget,
1880
+ onBack: handleOnBack,
1881
+ retrieveBankAccountInfo,
1882
+ createTrustedTransferInstrument: createTrustedTransferInstrument2
1883
+ }
1884
+ ),
1885
+ /* @__PURE__ */ jsx(ActionBar, { onBack: handleOnBack, backButtonLabel: commonT(($) => $["goBack"]) })
1886
+ ] }) : void 0 }) })
1887
+ ] });
1888
+ }
1889
+ function BankAccountFormat(props) {
1890
+ const { t } = useTranslation(["banking"]);
1891
+ const { bankAccountFormat, handleAccountFormatChange } = props;
1892
+ const bankFormatOptions = [
1893
+ {
1894
+ id: "iban",
1895
+ name: t(($) => $["ibanFormat"])
1896
+ },
1897
+ {
1898
+ id: "local",
1899
+ name: t(($) => $["localFormat"])
1900
+ }
1901
+ ];
1902
+ return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Field, { name: "bankAccountFormat", label: t(($) => $["bankAccountFormat"]), children: (childProps) => /* @__PURE__ */ jsx(
1903
+ Select,
1904
+ {
1905
+ ...childProps,
1906
+ onChange: (e) => handleAccountFormatChange?.(e?.target?.value),
1907
+ name: "bankAccountFormat",
1908
+ placeholder: t(($) => $["localFormat"]),
1909
+ selected: bankAccountFormat,
1910
+ items: bankFormatOptions
1911
+ }
1912
+ ) }) });
1913
+ }
1914
+ const simpleBankAccountNumberMetadata = (example, length, maxLength) => {
1915
+ if (maxLength) {
1916
+ return {
1917
+ label: "bankAccountNumber",
1918
+ validators: validatePatternOnBlur(new RegExp(`^\\d{${length},${maxLength}}$`)),
1919
+ mask: {
1920
+ mask: makeMask(...numericInputs(length), ...numericInputs(maxLength - length, true))
1921
+ },
1922
+ guidanceText: {
1923
+ key: "enterAMaximumOfNDigitsForExample",
1924
+ values: {
1925
+ maxDigits: `${maxLength}`,
1926
+ example
1927
+ }
1928
+ }
1929
+ };
1930
+ }
1931
+ return {
1932
+ label: "bankAccountNumber",
1933
+ validators: validatePatternOnBlur(new RegExp(`^\\d{${length}}$`)),
1934
+ mask: { mask: makeMask(...numericInputs(length)) },
1935
+ guidanceText: {
1936
+ key: "enterNDigitsForExample",
1937
+ values: {
1938
+ numDigits: `${length}`,
1939
+ example
1940
+ }
1941
+ }
1942
+ };
1943
+ };
1944
+ const defaultFieldMetadata$3 = {
1945
+ label: "bankAccountNumber",
1946
+ validators: isNotEmptyValidator
1947
+ };
1948
+ const defaultFieldConfig$3 = {
1949
+ [CountryCodes.CzechRepublic]: {
1950
+ // Validators & masks pulled from https://docs.adyen.com/api-explorer/legalentity/4/post/transferInstruments#request-bankAccount-accountIdentification-CZLocalAccountIdentification
1951
+ label: "bankAccountNumber",
1952
+ validators: validatePatternOnBlur(/^((\d{2}|\d{6})-)?\d*\d{2}$/),
1953
+ mask: {
1954
+ mask: makeMask(
1955
+ ...numericInputs(2),
1956
+ ...customInputs(1, /-|\d/),
1957
+ ...numericInputs(3),
1958
+ ...customInputs(1, /-|\d/),
1959
+ ...numericInputs(10)
1960
+ )
1961
+ },
1962
+ guidanceText: {
1963
+ key: "enterXToYDigitsWithOrWithoutPrefixForExample",
1964
+ values: {
1965
+ minDigits: "2",
1966
+ maxDigits: "16",
1967
+ firstExample: "19-123457",
1968
+ secondExample: "123457"
1969
+ }
1970
+ }
1971
+ },
1972
+ [CountryCodes.Denmark]: simpleBankAccountNumberMetadata("2621955959", 10),
1973
+ [CountryCodes.Norway]: simpleBankAccountNumberMetadata("86011117947", 11),
1974
+ [CountryCodes.UnitedKingdom]: simpleBankAccountNumberMetadata("10000003", 8),
1975
+ [CountryCodes.Australia]: simpleBankAccountNumberMetadata("0001234", 5, 10),
1976
+ [CountryCodes.Brazil]: simpleBankAccountNumberMetadata("0009795493", 4, 12),
1977
+ [CountryCodes.Canada]: simpleBankAccountNumberMetadata("10220001111", 5, 12),
1978
+ [CountryCodes.HongKong]: {
1979
+ label: "bankAccountNumber",
1980
+ validators: validatePatternOnBlur(new RegExp(`^\\d{${6},${18}}$`)),
1981
+ mask: {
1982
+ mask: makeMask(...numericInputs(6), ...numericInputs(12, true))
1983
+ },
1984
+ guidanceText: {
1985
+ key: "enterAccountNumberWithBranchCodeForExample",
1986
+ values: {
1987
+ minDigits: "9",
1988
+ maxDigits: "15",
1989
+ example: "790000000"
1990
+ }
1991
+ }
1992
+ },
1993
+ [CountryCodes.Hungary]: simpleBankAccountNumberMetadata("117730161111101800000000", 24),
1994
+ [CountryCodes.Singapore]: simpleBankAccountNumberMetadata("0052312891876", 4, 19),
1995
+ [CountryCodes.Sweden]: simpleBankAccountNumberMetadata("123456789", 7, 10),
1996
+ [CountryCodes.UnitedStates]: simpleBankAccountNumberMetadata("10220001111", 3, 17),
1997
+ [CountryCodes.Poland]: {
1998
+ label: "bankAccountNumber",
1999
+ validators: validatePatternOnBlur(/^\d{26}$/),
2000
+ mask: {
2001
+ mask: makeMask(
2002
+ ...numericInputs(2),
2003
+ spacer,
2004
+ ...numericInputs(4),
2005
+ spacer,
2006
+ ...numericInputs(4),
2007
+ spacer,
2008
+ ...numericInputs(4),
2009
+ spacer,
2010
+ ...numericInputs(4),
2011
+ spacer,
2012
+ ...numericInputs(4),
2013
+ spacer,
2014
+ ...numericInputs(4)
2015
+ )
2016
+ },
2017
+ guidanceText: {
2018
+ key: "enterNDigitsForExample",
2019
+ values: {
2020
+ numDigits: "26",
2021
+ example: "98 1090 2402 7474 4662 2173 1624"
2022
+ }
2023
+ }
2024
+ },
2025
+ [CountryCodes.NewZealand]: {
2026
+ label: "bankAccountNumber",
2027
+ validators: validatePatternOnBlur(/^\d{15,16}$/),
2028
+ mask: {
2029
+ mask: makeMask(
2030
+ ...numericInputs(2),
2031
+ ...nonInputs(" - "),
2032
+ ...numericInputs(4),
2033
+ ...nonInputs(" - "),
2034
+ ...numericInputs(7),
2035
+ ...nonInputs(" - "),
2036
+ ...numericInputs(2),
2037
+ ...numericInputs(1, true)
2038
+ )
2039
+ },
2040
+ guidanceText: {
2041
+ key: "enterXToYDigitsForExample",
2042
+ values: {
2043
+ minDigits: "15",
2044
+ maxDigits: "16",
2045
+ example: "12-8765-9876543-043"
2046
+ }
2047
+ }
2048
+ }
2049
+ };
2050
+ const bankAccountNumberFields = ["bankAccountNumber"];
2051
+ function BankAccountNumber(props) {
2052
+ const { t } = useTranslation("common");
2053
+ const { country, fieldConfig = defaultFieldConfig$3, onFocus, onBlur } = props;
2054
+ const metadata = resolveFieldMetadata(fieldConfig[country], {}, defaultFieldMetadata$3);
2055
+ const mergedProps = mergeFieldMetadataIntoProps("bankAccountNumber", metadata, props);
2056
+ const { handleChangeFor, data, valid, errors, fieldProblems } = useForm({
2057
+ ...mergedProps,
2058
+ schema: bankAccountNumberFields,
2059
+ rules: mergedProps.validators,
2060
+ defaultData: mergedProps.data,
2061
+ fieldProblems: mergedProps?.fieldValidationErrors,
2062
+ obscuredFields: mergedProps.obscuredFields
2063
+ });
2064
+ const handleBlur = () => {
2065
+ onBlur?.();
2066
+ handleChangeFor("bankAccountNumber", "blur");
2067
+ };
2068
+ const { updateStateSlice } = useGlobalDataSlice(
2069
+ "payoutAccountDetails"
2070
+ );
2071
+ useEffect(() => {
2072
+ updateStateSlice({ data, valid, errors, fieldProblems });
2073
+ }, [data, valid, errors]);
2074
+ const formUtils = createFormUtils(mergedProps, t);
2075
+ return /* @__PURE__ */ jsx(
2076
+ MaskedInput,
2077
+ {
2078
+ name: "bankAccountNumber",
2079
+ type: "text",
2080
+ label: formUtils.getLabel("bankAccountNumber"),
2081
+ formatGuidance: formUtils.getGuidanceText("bankAccountNumber"),
2082
+ ...formUtils.getMask("bankAccountNumber"),
2083
+ isValid: valid.bankAccountNumber,
2084
+ errorMessage: formUtils.getErrorMessage("bankAccountNumber", errors, fieldProblems),
2085
+ "aria-required": true,
2086
+ "aria-invalid": !valid.bankAccountNumber,
2087
+ onBlur: handleBlur,
2088
+ onInput: handleChangeFor("bankAccountNumber", "input"),
2089
+ onFocus,
2090
+ readonly: formUtils.isReadOnly("bankAccountNumber"),
2091
+ value: data.bankAccountNumber ?? "",
2092
+ acceptObscuredValue: formUtils.isObscured("bankAccountNumber")
2093
+ }
2094
+ );
2095
+ }
2096
+ const bankCityFields = ["bankCity"];
2097
+ function BankCity(props) {
2098
+ const { t } = useTranslation("common");
2099
+ const { validators, data: bankCityData, fieldValidationErrors } = props;
2100
+ const { handleChangeFor, data, valid, errors, fieldProblems } = useForm({
2101
+ ...props,
2102
+ schema: bankCityFields,
2103
+ rules: validators,
2104
+ defaultData: bankCityData,
2105
+ fieldProblems: fieldValidationErrors
2106
+ });
2107
+ const { updateStateSlice } = useGlobalDataSlice(
2108
+ "payoutAccountDetails"
2109
+ );
2110
+ useEffect(() => {
2111
+ updateStateSlice({ data, valid, errors, fieldProblems });
2112
+ }, [data, valid, errors]);
2113
+ const formUtils = createFormUtils(props, t);
2114
+ return /* @__PURE__ */ jsx(
2115
+ Field,
2116
+ {
2117
+ name: "bankCity",
2118
+ label: formUtils.getLabel("bankCity"),
2119
+ errorMessage: formUtils.getErrorMessage("bankCity", errors, fieldProblems),
2120
+ isValid: valid.bankCity,
2121
+ children: (childProps) => /* @__PURE__ */ jsx(
2122
+ InputText,
2123
+ {
2124
+ ...childProps,
2125
+ name: "bankCity",
2126
+ value: data.bankCity,
2127
+ readonly: formUtils.isReadOnly("bankCity"),
2128
+ onInput: handleChangeFor("bankCity", "input"),
2129
+ onBlur: handleChangeFor("bankCity", "blur"),
2130
+ "aria-required": true,
2131
+ "aria-invalid": !valid.bankCity
2132
+ }
2133
+ )
2134
+ }
2135
+ );
2136
+ }
2137
+ const defaultFieldMetadata$2 = {
2138
+ label: "bankCode",
2139
+ validators: isNotEmptyValidator
2140
+ };
2141
+ const simpleBankCodeMetadata = (length, example, label) => ({
2142
+ label: label ?? "bankCode",
2143
+ validators: validatePatternOnBlur(new RegExp(`^\\d{${length}}$`)),
2144
+ mask: {
2145
+ mask: makeMask(...numericInputs(length))
2146
+ },
2147
+ guidanceText: {
2148
+ key: "enterNDigitsForExample",
2149
+ values: {
2150
+ numDigits: `${length}`,
2151
+ example
2152
+ }
2153
+ }
2154
+ });
2155
+ const defaultFieldConfig$2 = {
2156
+ [CountryCodes.Brazil]: simpleBankCodeMetadata(3, "123"),
2157
+ [CountryCodes.Canada]: simpleBankCodeMetadata(3, "100", "institutionNumber"),
2158
+ [CountryCodes.CzechRepublic]: simpleBankCodeMetadata(4, "0800"),
2159
+ [CountryCodes.Denmark]: simpleBankCodeMetadata(4, "5051"),
2160
+ [CountryCodes.HongKong]: simpleBankCodeMetadata(3, "250", "bankCode"),
2161
+ [CountryCodes.Norway]: simpleBankCodeMetadata(4, "8601"),
2162
+ // Not yet implemented
2163
+ [CountryCodes.Ecuador]: simpleBankCodeMetadata(4, "1234"),
2164
+ [CountryCodes.Japan]: simpleBankCodeMetadata(4, "1234"),
2165
+ [CountryCodes.Taiwan]: simpleBankCodeMetadata(3, "123")
2166
+ };
2167
+ const bankCodeFields = ["bankCode"];
2168
+ function BankCode(props) {
2169
+ const { t } = useTranslation("common");
2170
+ const { country, fieldConfig = defaultFieldConfig$2 } = props;
2171
+ const metadata = resolveFieldMetadata(fieldConfig[country], {}, defaultFieldMetadata$2);
2172
+ const mergedProps = mergeFieldMetadataIntoProps("bankCode", metadata, props);
2173
+ const { handleChangeFor, data, valid, errors, fieldProblems } = useForm({
2174
+ ...mergedProps,
2175
+ schema: bankCodeFields,
2176
+ rules: mergedProps.validators,
2177
+ defaultData: mergedProps.data,
2178
+ fieldProblems: mergedProps.fieldValidationErrors
2179
+ });
2180
+ const { updateStateSlice } = useGlobalDataSlice(
2181
+ "payoutAccountDetails"
2182
+ );
2183
+ useEffect(() => {
2184
+ updateStateSlice({ data, valid, errors, fieldProblems });
2185
+ }, [data, valid, errors]);
2186
+ const formUtils = createFormUtils(mergedProps, t);
2187
+ return /* @__PURE__ */ jsx(
2188
+ MaskedInput,
2189
+ {
2190
+ name: "bankCode",
2191
+ type: "text",
2192
+ label: formUtils.getLabel("bankCode"),
2193
+ errorMessage: formUtils.getErrorMessage("bankCode", errors, fieldProblems),
2194
+ formatGuidance: formUtils.getGuidanceText("bankCode"),
2195
+ ...formUtils.getMask("bankCode"),
2196
+ isValid: valid.bankCode,
2197
+ value: data.bankCode ?? "",
2198
+ readonly: formUtils.isReadOnly("bankCode"),
2199
+ onInput: handleChangeFor("bankCode", "input"),
2200
+ onBlur: handleChangeFor("bankCode", "blur"),
2201
+ "aria-required": true,
2202
+ "aria-invalid": !valid.bankCode
2203
+ }
2204
+ );
2205
+ }
2206
+ const bankNameFields = ["bankName"];
2207
+ function BankName(props) {
2208
+ const { t } = useTranslation("common");
2209
+ const { validators, data: bankNameData, fieldValidationErrors } = props;
2210
+ const { handleChangeFor, data, valid, errors, fieldProblems } = useForm({
2211
+ ...props,
2212
+ schema: bankNameFields,
2213
+ rules: validators,
2214
+ defaultData: bankNameData,
2215
+ fieldProblems: fieldValidationErrors
2216
+ });
2217
+ const { updateStateSlice } = useGlobalDataSlice(
2218
+ "payoutAccountDetails"
2219
+ );
2220
+ useEffect(() => {
2221
+ updateStateSlice({ data, valid, errors, fieldProblems });
2222
+ }, [data, valid, errors]);
2223
+ const formUtils = createFormUtils(props, t);
2224
+ return /* @__PURE__ */ jsx(
2225
+ Field,
2226
+ {
2227
+ name: "bankName",
2228
+ label: formUtils.getLabel("bankName"),
2229
+ errorMessage: formUtils.getErrorMessage("bankName", errors, fieldProblems),
2230
+ isValid: valid.bankName,
2231
+ children: (childProps) => /* @__PURE__ */ jsx(
2232
+ InputText,
2233
+ {
2234
+ ...childProps,
2235
+ name: "bankName",
2236
+ value: data.bankName,
2237
+ readonly: formUtils.isReadOnly("bankName"),
2238
+ onInput: handleChangeFor("bankName", "input"),
2239
+ onBlur: handleChangeFor("bankName", "blur"),
2240
+ "aria-required": true,
2241
+ "aria-invalid": !valid.bankName
2242
+ }
2243
+ )
2244
+ }
2245
+ );
2246
+ }
2247
+ const defaultFieldMetadata$1 = {
2248
+ label: "branchCode",
2249
+ validators: isNotEmptyValidator
2250
+ };
2251
+ const defaultFieldConfig$1 = {
2252
+ [CountryCodes.UnitedKingdom]: {
2253
+ label: "sortCode",
2254
+ validators: validatePatternOnBlur(/^\d{6}$/),
2255
+ mask: { mask: makeMask(...numericInputs(6)) },
2256
+ guidanceText: {
2257
+ key: "enterNDigitsForExample",
2258
+ values: {
2259
+ numDigits: "6",
2260
+ example: "401199"
2261
+ }
2262
+ }
2263
+ },
2264
+ [CountryCodes.Australia]: {
2265
+ label: "bsbNumber",
2266
+ validators: validatePatternOnBlur(/^\d{6}$/),
2267
+ mask: { mask: makeMask(...numericInputs(3), ...nonInputs(" - "), ...numericInputs(3)) },
2268
+ guidanceText: {
2269
+ key: "enterNDigitsForExample",
2270
+ values: {
2271
+ numDigits: "6",
2272
+ example: "033-547"
2273
+ }
2274
+ }
2275
+ },
2276
+ [CountryCodes.Brazil]: {
2277
+ label: "branchCode",
2278
+ validators: validatePatternOnBlur(/^\d{1,5}$/),
2279
+ mask: { mask: makeMask(...numericInputs(1), ...numericInputs(4, true)) },
2280
+ guidanceText: {
2281
+ key: "enterAMaximumOfNDigitsForExample",
2282
+ values: {
2283
+ maxDigits: "5",
2284
+ example: "36257"
2285
+ }
2286
+ }
2287
+ },
2288
+ [CountryCodes.Canada]: {
2289
+ label: "transitNumber",
2290
+ validators: validatePatternOnBlur(/^\d{5}$/),
2291
+ mask: { mask: makeMask(...numericInputs(5)) },
2292
+ guidanceText: {
2293
+ key: "enterNDigitsForExample",
2294
+ values: {
2295
+ numDigits: "5",
2296
+ example: "27601"
2297
+ }
2298
+ }
2299
+ },
2300
+ [CountryCodes.UnitedStates]: {
2301
+ label: "routingNumber",
2302
+ validators: validatePatternOnBlur(/^\d{9}$/),
2303
+ mask: { mask: makeMask(...numericInputs(9)) },
2304
+ guidanceText: {
2305
+ key: "enterNDigitsForExample",
2306
+ values: {
2307
+ numDigits: "9",
2308
+ example: "107005432"
2309
+ }
2310
+ }
2311
+ },
2312
+ [CountryCodes.Sweden]: {
2313
+ label: "branchCode",
2314
+ validators: validatePatternOnBlur(/^\d{4,5}$/),
2315
+ mask: {
2316
+ mask: makeMask(
2317
+ ...numericInputs(4),
2318
+ ...nonInputs(" - ", { displayEagerly: false }),
2319
+ ...numericInputs(1, true)
2320
+ )
2321
+ },
2322
+ guidanceText: {
2323
+ key: "enterXToYDigitsForExample",
2324
+ values: {
2325
+ minDigits: "4",
2326
+ maxDigits: "5",
2327
+ example: "5678 or 7635-2"
2328
+ }
2329
+ }
2330
+ },
2331
+ // Not yet implemented
2332
+ [CountryCodes.Indonesia]: {
2333
+ label: "clearingCode",
2334
+ validators: isNotEmptyValidator
2335
+ }
2336
+ };
2337
+ const branchCodeFields = ["branchCode"];
2338
+ function BranchCode(props) {
2339
+ const { t } = useTranslation("common");
2340
+ const { country, fieldConfig = defaultFieldConfig$1, onFocus, onBlur } = props;
2341
+ const metadata = resolveFieldMetadata(fieldConfig[country], {}, defaultFieldMetadata$1);
2342
+ const mergedProps = mergeFieldMetadataIntoProps("branchCode", metadata, props);
2343
+ const { handleChangeFor, data, valid, errors, fieldProblems } = useForm({
2344
+ ...mergedProps,
2345
+ schema: branchCodeFields,
2346
+ rules: mergedProps.validators,
2347
+ defaultData: mergedProps.data,
2348
+ fieldProblems: mergedProps?.fieldValidationErrors
2349
+ });
2350
+ const { updateStateSlice } = useGlobalDataSlice(
2351
+ "payoutAccountDetails"
2352
+ );
2353
+ const handleBlur = () => {
2354
+ onBlur?.();
2355
+ handleChangeFor("branchCode", "blur");
2356
+ };
2357
+ useEffect(() => {
2358
+ updateStateSlice({ data, valid, errors, fieldProblems });
2359
+ }, [data, valid, errors]);
2360
+ const formUtils = createFormUtils(mergedProps, t);
2361
+ return /* @__PURE__ */ jsx(
2362
+ MaskedInput,
2363
+ {
2364
+ name: "branchCode",
2365
+ type: "text",
2366
+ label: formUtils.getLabel("branchCode"),
2367
+ formatGuidance: formUtils.getGuidanceText("branchCode"),
2368
+ ...formUtils.getMask("branchCode"),
2369
+ errorMessage: formUtils.getErrorMessage("branchCode", errors, fieldProblems),
2370
+ isValid: valid.branchCode,
2371
+ value: data.branchCode ?? "",
2372
+ readonly: formUtils.isReadOnly("branchCode"),
2373
+ onInput: handleChangeFor("branchCode", "input"),
2374
+ onBlur: handleBlur,
2375
+ onFocus,
2376
+ "aria-required": true,
2377
+ "aria-invalid": !valid.branchCode
2378
+ }
2379
+ );
2380
+ }
2381
+ const bbanPatternsByCountry = {
2382
+ [CountryCodes.Albania]: /\d{8}[\dA-Z]{16}/,
2383
+ [CountryCodes.Andorra]: /\d{8}[\dA-Z]{12}/,
2384
+ [CountryCodes.Austria]: /\d{16}/,
2385
+ [CountryCodes.Azerbaijan]: /[\dA-Z]{4}\d{20}/,
2386
+ [CountryCodes.Belgium]: /\d{12}/,
2387
+ [CountryCodes.Bahrain]: /[A-Z]{4}[\dA-Z]{14}/,
2388
+ [CountryCodes.BosniaAndHerzegovina]: /\d{16}/,
2389
+ [CountryCodes.Brazil]: /\d{23}[A-Z][\dA-Z]/,
2390
+ [CountryCodes.Bulgaria]: /[A-Z]{4}\d{6}[\dA-Z]{8}/,
2391
+ [CountryCodes.CostaRica]: /\d{17}/,
2392
+ [CountryCodes.Croatia]: /\d{17}/,
2393
+ [CountryCodes.Cyprus]: /\d{8}[\dA-Z]{16}/,
2394
+ [CountryCodes.CzechRepublic]: /\d{20}/,
2395
+ [CountryCodes.Denmark]: /\d{14}/,
2396
+ [CountryCodes.DominicanRepublic]: /[A-Z]{4}\d{20}/,
2397
+ [CountryCodes.Estonia]: /\d{16}/,
2398
+ [CountryCodes.FaroeIslands]: /\d{14}/,
2399
+ [CountryCodes.Finland]: /\d{14}/,
2400
+ [CountryCodes.France]: /\d{10}[\dA-Z]{11}\d{2}/,
2401
+ [CountryCodes.Georgia]: /[\dA-Z]{2}\d{16}/,
2402
+ [CountryCodes.Germany]: /\d{18}/,
2403
+ [CountryCodes.Gibraltar]: /[A-Z]{4}[\dA-Z]{15}/,
2404
+ [CountryCodes.Greece]: /\d{7}[\dA-Z]{16}/,
2405
+ [CountryCodes.Greenland]: /\d{14}/,
2406
+ [CountryCodes.Guatemala]: /[\dA-Z]{4}[\dA-Z]{20}/,
2407
+ [CountryCodes.Hungary]: /\d{24}/,
2408
+ [CountryCodes.Iceland]: /\d{22}/,
2409
+ [CountryCodes.Ireland]: /[\dA-Z]{4}\d{14}/,
2410
+ [CountryCodes.Israel]: /\d{19}/,
2411
+ [CountryCodes.Italy]: /[A-Z]\d{10}[\dA-Z]{12}/,
2412
+ [CountryCodes.Kazakhstan]: /\d{3}[\dA-Z]{13}/,
2413
+ [CountryCodes.Kuwait]: /[A-Z]{4}[\dA-Z]{22}/,
2414
+ [CountryCodes.Latvia]: /[A-Z]{4}[\dA-Z]{13}/,
2415
+ [CountryCodes.Lebanon]: /\d{4}[\dA-Z]{20}/,
2416
+ [CountryCodes.Liechtenstein]: /\d{5}[\dA-Z]{12}/,
2417
+ [CountryCodes.Lithuania]: /\d{16}/,
2418
+ [CountryCodes.Luxembourg]: /\d{3}[\dA-Z]{13}/,
2419
+ [CountryCodes.Macedonia]: /\d{3}[\dA-Z]{10}\d{2}/,
2420
+ [CountryCodes.Malta]: /[A-Z]{4}\d{5}[\dA-Z]{18}/,
2421
+ [CountryCodes.Mauritania]: /\d{23}/,
2422
+ [CountryCodes.Mauritius]: /[A-Z]{4}\d{19}[A-Z]{3}/,
2423
+ [CountryCodes.Monaco]: /\d{10}[\dA-Z]{11}\d{2}/,
2424
+ [CountryCodes.Moldova]: /[\dA-Z]{2}\d{18}/,
2425
+ [CountryCodes.Montenegro]: /\d{18}/,
2426
+ [CountryCodes.Netherlands]: /[A-Z]{4}\d{10}/,
2427
+ [CountryCodes.Norway]: /\d{11}/,
2428
+ [CountryCodes.Pakistan]: /[\dA-Z]{4}\d{16}/,
2429
+ [CountryCodes.PalestinianTerritory]: /[\dA-Z]{4}\d{21}/,
2430
+ [CountryCodes.Poland]: /\d{24}/,
2431
+ [CountryCodes.Portugal]: /\d{21}/,
2432
+ [CountryCodes.Romania]: /[A-Z]{4}[\dA-Z]{16}/,
2433
+ [CountryCodes.SanMarino]: /[A-Z]\d{10}[\dA-Z]{12}/,
2434
+ [CountryCodes.SaudiArabia]: /\d{2}[\dA-Z]{18}/,
2435
+ [CountryCodes.Serbia]: /\d{18}/,
2436
+ [CountryCodes.Slovakia]: /\d{20}/,
2437
+ [CountryCodes.Slovenia]: /\d{15}/,
2438
+ [CountryCodes.Spain]: /\d{20}/,
2439
+ [CountryCodes.Sweden]: /\d{20}/,
2440
+ [CountryCodes.Switzerland]: /\d{5}[\dA-Z]{12}/,
2441
+ [CountryCodes.Tunisia]: /\d{20}/,
2442
+ [CountryCodes.Turkey]: /\d{5}[\dA-Z]{17}/,
2443
+ [CountryCodes.UnitedArabEmirates]: /\d{3}\d{16}/,
2444
+ [CountryCodes.UnitedKingdom]: /[A-Z]{4}\d{14}/,
2445
+ [CountryCodes.VirginIslandsBritish]: /[\dA-Z]{4}\d{16}/
2446
+ };
2447
+ const customPrefixByCountry = {
2448
+ [CountryCodes.Guernsey]: "GB",
2449
+ [CountryCodes.Jersey]: "GB",
2450
+ [CountryCodes.IsleOfMan]: "GB"
2451
+ };
2452
+ function ibanValidator(input, bankCountry) {
2453
+ if (isEmpty(input)) return false;
2454
+ const ibanInput = input.replace(/ /g, "").toUpperCase();
2455
+ if (!/^([a-zA-Z0-9]{4} ){2,8}[a-zA-Z0-9]{1,4}|[a-zA-Z0-9]{12,34}$/.test(ibanInput)) {
2456
+ return false;
2457
+ }
2458
+ const countryCode = ibanInput.substring(0, 2);
2459
+ const allowedPrefix = customPrefixByCountry[bankCountry] ?? bankCountry;
2460
+ if (countryCode !== allowedPrefix) {
2461
+ return {
2462
+ key: "yourIbanShouldBeginWith_",
2463
+ values: {
2464
+ countryCode: allowedPrefix
2465
+ }
2466
+ };
2467
+ }
2468
+ const bbanPattern = bbanPatternsByCountry[countryCode];
2469
+ if (bbanPattern) {
2470
+ const ibanPattern = new RegExp(`^[A-Z]{2}\\d{2}${bbanPattern.source}$`, "");
2471
+ if (!ibanPattern.test(ibanInput)) {
2472
+ return false;
2473
+ }
2474
+ }
2475
+ const ibanCheck = ibanInput.substring(4, ibanInput.length) + ibanInput.substring(0, 4);
2476
+ let leadingZeroes = true;
2477
+ let ibanCheckDigits = "";
2478
+ for (let i = 0; i < ibanCheck.length; i += 1) {
2479
+ const charAt = ibanCheck.charAt(i);
2480
+ if (charAt !== "0") {
2481
+ leadingZeroes = false;
2482
+ }
2483
+ if (!leadingZeroes) {
2484
+ ibanCheckDigits += "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(charAt);
2485
+ }
2486
+ }
2487
+ let cRest = 0;
2488
+ for (let p = 0; p < ibanCheckDigits.length; p += 1) {
2489
+ const cChar = ibanCheckDigits.charAt(p);
2490
+ const cOperator = +`${cRest}${cChar}`;
2491
+ cRest = cOperator % 97;
2492
+ }
2493
+ return cRest === 1;
2494
+ }
2495
+ const validateIbanOnBlurAndInput = (country) => ({
2496
+ modes: ["blur", "input"],
2497
+ validate: (iban) => ibanValidator(iban, country) === true,
2498
+ errorMessage: (iban) => {
2499
+ const result = ibanValidator(iban, country);
2500
+ return typeof result === "boolean" ? void 0 : result;
2501
+ }
2502
+ });
2503
+ const ibanMask = (country, inputLength, allowLettersInBban) => {
2504
+ const tokens = [];
2505
+ tokens.push(...nonInputs(country, { includeInValue: true }), ...numericInputs(2));
2506
+ inputLength -= 2;
2507
+ const inputToken = allowLettersInBban ? alphanumericInputs : numericInputs;
2508
+ const numGroups = Math.floor(inputLength / 4);
2509
+ const remainder = inputLength % 4;
2510
+ for (let i = 0; i < numGroups; i += 1) {
2511
+ tokens.push(spacer, ...inputToken(4));
2512
+ }
2513
+ if (remainder > 0) {
2514
+ tokens.push(spacer, ...inputToken(remainder));
2515
+ }
2516
+ return {
2517
+ mask: makeMask(...tokens),
2518
+ transformOnType: allowLettersInBban ? uppercase : void 0
2519
+ };
2520
+ };
2521
+ const ibanGuidance = (type, numDigitsOrChars, example) => type === "digits" ? {
2522
+ key: "enterTheRemainingNDigitsForExample",
2523
+ values: {
2524
+ numDigits: `${numDigitsOrChars}`,
2525
+ example
2526
+ }
2527
+ } : {
2528
+ key: "enterTheRemainingNCharactersForExample",
2529
+ values: {
2530
+ numChars: `${numDigitsOrChars}`,
2531
+ example
2532
+ }
2533
+ };
2534
+ const ibanMetadata = (country, inputLength, example, allowLettersInBban) => ({
2535
+ label: "iban",
2536
+ validators: validateIbanOnBlurAndInput(country),
2537
+ mask: ibanMask(country, inputLength, allowLettersInBban),
2538
+ guidanceText: ibanGuidance(allowLettersInBban ? "characters" : "digits", inputLength, example)
2539
+ });
2540
+ const gbIbanMetadata = ibanMetadata(
2541
+ CountryCodes.UnitedKingdom,
2542
+ 20,
2543
+ "GB09 BARC 2003 9554 8297 59",
2544
+ true
2545
+ );
2546
+ const defaultFieldMetadata = {
2547
+ label: "iban",
2548
+ validators: isNotEmptyValidator
2549
+ };
2550
+ const defaultFieldConfig = {
2551
+ [CountryCodes.Austria]: ibanMetadata(CountryCodes.Austria, 18, "AT88 5400 0746 7265 9747"),
2552
+ [CountryCodes.Belgium]: ibanMetadata(CountryCodes.Belgium, 14, "BE59 9788 6743 2226"),
2553
+ [CountryCodes.Croatia]: ibanMetadata(CountryCodes.Croatia, 19, "HR51 2484 0083 5929 6973 8"),
2554
+ [CountryCodes.Cyprus]: ibanMetadata(
2555
+ CountryCodes.Cyprus,
2556
+ 26,
2557
+ "CY16 5183 1221 8756 5858 5388 7678"
2558
+ ),
2559
+ [CountryCodes.CzechRepublic]: ibanMetadata(
2560
+ CountryCodes.CzechRepublic,
2561
+ 22,
2562
+ "CZ23 5051 3674 5924 5233 3465"
2563
+ ),
2564
+ [CountryCodes.Denmark]: ibanMetadata(CountryCodes.Denmark, 16, "DK95 2000 0123 4567 89"),
2565
+ [CountryCodes.Estonia]: ibanMetadata(CountryCodes.Estonia, 18, "EE26 1291 5123 1542 6371"),
2566
+ [CountryCodes.Finland]: ibanMetadata(CountryCodes.Finland, 16, "FI03 9319 8995 3742 51"),
2567
+ [CountryCodes.Germany]: ibanMetadata(CountryCodes.Germany, 20, "DE91 1000 0000 0123 4567 89"),
2568
+ [CountryCodes.Greece]: ibanMetadata(CountryCodes.Greece, 25, "GR57 0107 7142 7681 6687 9575 217"),
2569
+ [CountryCodes.Hungary]: ibanMetadata(
2570
+ CountryCodes.Hungary,
2571
+ 26,
2572
+ "HU68 1070 0024 3428 4128 3192 4812"
2573
+ ),
2574
+ [CountryCodes.Lithuania]: ibanMetadata(CountryCodes.Lithuania, 18, "LT59 9244 6228 2176 2762"),
2575
+ [CountryCodes.Luxembourg]: ibanMetadata(CountryCodes.Luxembourg, 18, "LU71 0106 9242 5365 8562"),
2576
+ [CountryCodes.Norway]: ibanMetadata(CountryCodes.Norway, 13, "NO83 3000 1234 567"),
2577
+ [CountryCodes.Poland]: ibanMetadata(
2578
+ CountryCodes.Poland,
2579
+ 26,
2580
+ "PL98 1090 2402 7474 4662 2173 1624"
2581
+ ),
2582
+ [CountryCodes.Portugal]: ibanMetadata(
2583
+ CountryCodes.Portugal,
2584
+ 23,
2585
+ "PT42 0035 0651 8646 9119 5263 5"
2586
+ ),
2587
+ [CountryCodes.Slovakia]: ibanMetadata(CountryCodes.Slovakia, 22, "SK25 5173 1333 4916 3219 3521"),
2588
+ [CountryCodes.Slovenia]: ibanMetadata(CountryCodes.Slovenia, 17, "SI56 1920 0123 4567 892"),
2589
+ [CountryCodes.Spain]: ibanMetadata(CountryCodes.Spain, 22, "ES76 1465 5599 9226 7623 2635"),
2590
+ [CountryCodes.Sweden]: ibanMetadata(CountryCodes.Sweden, 22, "SE72 8000 0810 3400 0978 3242"),
2591
+ // These include letters in the BBAN (bank account number)
2592
+ [CountryCodes.Bulgaria]: ibanMetadata(
2593
+ CountryCodes.Bulgaria,
2594
+ 20,
2595
+ "BG17 BNPA 9440 4432 7749 93",
2596
+ true
2597
+ ),
2598
+ [CountryCodes.France]: ibanMetadata(
2599
+ CountryCodes.France,
2600
+ 25,
2601
+ "FR64 1009 6000 4035 3425 9742 Y90",
2602
+ true
2603
+ ),
2604
+ [CountryCodes.Gibraltar]: ibanMetadata(
2605
+ CountryCodes.Gibraltar,
2606
+ 21,
2607
+ "GI96 JYJT 9899 9587 8655 898",
2608
+ true
2609
+ ),
2610
+ [CountryCodes.Ireland]: ibanMetadata(
2611
+ CountryCodes.Ireland,
2612
+ 20,
2613
+ "IE64 IRCE 9205 0112 3456 78",
2614
+ true
2615
+ ),
2616
+ [CountryCodes.Italy]: ibanMetadata(
2617
+ CountryCodes.Italy,
2618
+ 25,
2619
+ "IT06 L030 0203 2809 8485 8934 882",
2620
+ true
2621
+ ),
2622
+ [CountryCodes.Latvia]: ibanMetadata(CountryCodes.Latvia, 19, "LV80 BANK 0000 4351 9500 1", true),
2623
+ [CountryCodes.Liechtenstein]: ibanMetadata(
2624
+ CountryCodes.Liechtenstein,
2625
+ 19,
2626
+ "LI21 0881 0000 2324 013A A",
2627
+ true
2628
+ ),
2629
+ [CountryCodes.Malta]: ibanMetadata(
2630
+ CountryCodes.Malta,
2631
+ 29,
2632
+ "MT03 VIXW 2487 8926 8575 8586 8929 858",
2633
+ true
2634
+ ),
2635
+ [CountryCodes.Monaco]: ibanMetadata(
2636
+ CountryCodes.Monaco,
2637
+ 25,
2638
+ "MC58 1122 2000 0101 2345 6789 030",
2639
+ true
2640
+ ),
2641
+ [CountryCodes.Netherlands]: ibanMetadata(
2642
+ CountryCodes.Netherlands,
2643
+ 16,
2644
+ "NL50 ABNA 4452 7591 49",
2645
+ true
2646
+ ),
2647
+ [CountryCodes.Romania]: ibanMetadata(
2648
+ CountryCodes.Romania,
2649
+ 22,
2650
+ "RO36 PORL 9596 9966 4965 4284",
2651
+ true
2652
+ ),
2653
+ [CountryCodes.Switzerland]: ibanMetadata(
2654
+ CountryCodes.Switzerland,
2655
+ 19,
2656
+ "CH56 0483 5012 3456 7800 9",
2657
+ true
2658
+ ),
2659
+ [CountryCodes.UnitedKingdom]: gbIbanMetadata,
2660
+ // IBANs for Guernsey, Jersey, and Isle of Man also use United Kingdom's format (starting with `GB`)
2661
+ [CountryCodes.Guernsey]: gbIbanMetadata,
2662
+ [CountryCodes.Jersey]: gbIbanMetadata,
2663
+ [CountryCodes.IsleOfMan]: gbIbanMetadata
2664
+ };
2665
+ const ibanFields = ["iban"];
2666
+ function Iban(props) {
2667
+ const { t } = useTranslation("common");
2668
+ const {
2669
+ country,
2670
+ fieldConfig = defaultFieldConfig,
2671
+ data: ibanData,
2672
+ obscuredFields,
2673
+ fieldValidationErrors
2674
+ } = props;
2675
+ const metadata = resolveFieldMetadata(fieldConfig[country], {}, defaultFieldMetadata);
2676
+ const mergedProps = mergeFieldMetadataIntoProps("iban", metadata, props);
2677
+ const { handleChangeFor, data, valid, errors, fieldProblems } = useForm({
2678
+ ...mergedProps,
2679
+ schema: ibanFields,
2680
+ rules: mergedProps.validators,
2681
+ defaultData: ibanData,
2682
+ fieldProblems: fieldValidationErrors,
2683
+ obscuredFields
2684
+ });
2685
+ const { updateStateSlice } = useGlobalDataSlice(
2686
+ "payoutAccountDetails"
2687
+ );
2688
+ useEffect(() => {
2689
+ updateStateSlice({ data, valid, errors, fieldProblems });
2690
+ }, [data, errors, valid]);
2691
+ const formUtils = createFormUtils(mergedProps, t);
2692
+ return /* @__PURE__ */ jsx(
2693
+ MaskedInput,
2694
+ {
2695
+ name: "iban",
2696
+ type: "text",
2697
+ label: formUtils.getLabel("iban"),
2698
+ formatGuidance: formUtils.getGuidanceText("iban"),
2699
+ ...formUtils.getMask("iban"),
2700
+ errorMessage: formUtils.getErrorMessage("iban", errors, fieldProblems),
2701
+ isValid: valid.iban,
2702
+ value: data.iban ?? "",
2703
+ readonly: formUtils.isReadOnly("iban"),
2704
+ onInput: handleChangeFor("iban", "blur"),
2705
+ onBlur: handleChangeFor("iban", "blur"),
2706
+ "aria-required": true,
2707
+ "aria-invalid": !valid.iban,
2708
+ acceptObscuredValue: formUtils.isObscured("iban")
2709
+ }
2710
+ );
2711
+ }
2712
+ const swiftCodeFieldMetadata = {
2713
+ label: "bicSwift",
2714
+ validators: validatePatternOnBlur(/^([a-zA-Z0-9]{8}|[a-zA-Z0-9]{11})$/),
2715
+ mask: {
2716
+ mask: makeMask(...alphaInputs(6), ...alphanumericInputs(2), ...alphanumericInputs(3, true)),
2717
+ transformOnType: uppercase
2718
+ },
2719
+ guidanceText: {
2720
+ key: "enterXOrYCharactersForExample",
2721
+ values: {
2722
+ xChars: "8",
2723
+ yChars: "11",
2724
+ example: "BANKDE65287"
2725
+ }
2726
+ }
2727
+ };
2728
+ const swiftCodeFields = ["swiftCode"];
2729
+ function SwiftCode(props) {
2730
+ const { t } = useTranslation("common");
2731
+ const mergedProps = mergeFieldMetadataIntoProps("swiftCode", swiftCodeFieldMetadata, props);
2732
+ const { handleChangeFor, data, valid, errors, fieldProblems } = useForm({
2733
+ ...mergedProps,
2734
+ schema: swiftCodeFields,
2735
+ rules: mergedProps.validators,
2736
+ defaultData: mergedProps.data,
2737
+ fieldProblems: mergedProps?.fieldValidationErrors
2738
+ });
2739
+ const { updateStateSlice } = useGlobalDataSlice(
2740
+ "payoutAccountDetails"
2741
+ );
2742
+ useEffect(() => {
2743
+ updateStateSlice({ data, valid, errors, fieldProblems });
2744
+ }, [data, valid, errors]);
2745
+ const formUtils = createFormUtils(mergedProps, t);
2746
+ return /* @__PURE__ */ jsx(
2747
+ MaskedInput,
2748
+ {
2749
+ name: "swiftCode",
2750
+ type: "text",
2751
+ label: formUtils.getLabel("swiftCode"),
2752
+ formatGuidance: formUtils.getGuidanceText("swiftCode"),
2753
+ ...formUtils.getMask("swiftCode"),
2754
+ errorMessage: formUtils.getErrorMessage("swiftCode", errors, fieldProblems),
2755
+ isValid: valid.swiftCode,
2756
+ value: data.swiftCode ?? "",
2757
+ readonly: formUtils.isReadOnly("swiftCode"),
2758
+ onInput: handleChangeFor("swiftCode", "input"),
2759
+ onBlur: handleChangeFor("swiftCode", "blur"),
2760
+ "aria-required": true,
2761
+ "aria-invalid": !valid.swiftCode
2762
+ }
2763
+ );
2764
+ }
2765
+ const countriesWithMultipleCurrencies = /* @__PURE__ */ new Set([
2766
+ CountryCodes.Bulgaria,
2767
+ CountryCodes.Canada,
2768
+ CountryCodes.Croatia,
2769
+ CountryCodes.CzechRepublic,
2770
+ CountryCodes.Hungary,
2771
+ CountryCodes.Romania,
2772
+ CountryCodes.Switzerland
2773
+ ]);
2774
+ const countriesWithLocalFormat = /* @__PURE__ */ new Set([
2775
+ CountryCodes.CzechRepublic,
2776
+ CountryCodes.Denmark,
2777
+ CountryCodes.Hungary,
2778
+ CountryCodes.Norway,
2779
+ CountryCodes.Poland,
2780
+ CountryCodes.Sweden,
2781
+ CountryCodes.UnitedKingdom
2782
+ ]);
2783
+ const payoutCurrencySupport = {
2784
+ [CountryCodes.Sweden]: {
2785
+ local: [Currencies.SEK],
2786
+ iban: [Currencies.EUR, Currencies.SEK]
2787
+ },
2788
+ [CountryCodes.Canada]: {
2789
+ local: [Currencies.CAD, Currencies.USD],
2790
+ iban: [Currencies.CAD, Currencies.USD]
2791
+ }
2792
+ };
2793
+ const shouldShowCheckGuidance = (country) => country === "US";
2794
+ const shouldShowPayoutAccountFormatSelector = (country) => countriesWithLocalFormat.has(country);
2795
+ const shouldShowPayoutAlert = (country) => shouldShowPayoutAccountFormatSelector(country) || countriesWithMultipleCurrencies.has(country);
2796
+ const getSupportedCurrencyGuidance = (t, country, requiredFields) => {
2797
+ const format = requiredFields.includes("iban") ? "iban" : "local";
2798
+ if (!shouldShowPayoutAlert(country)) {
2799
+ return;
2800
+ }
2801
+ const supportedCurrencies = getSupportedCurrenciesPerFormat(country, format);
2802
+ if (!supportedCurrencies) {
2803
+ return;
2804
+ }
2805
+ return supportedCurrencies.length > 1 ? t(($) => $["payoutIn_Or_"], {
2806
+ currencyOne: supportedCurrencies[0],
2807
+ currencyTwo: supportedCurrencies[1]
2808
+ }) : t(($) => $["payoutInOnly_"], { currency: supportedCurrencies[0] });
2809
+ };
2810
+ const getSupportedCurrenciesPerFormat = (country, format) => {
2811
+ const supportedCurrencies = payoutCurrencySupport[country];
2812
+ if (!supportedCurrencies) {
2813
+ const defaultCurrency = currencyByCountry[country]?.[0];
2814
+ if (!defaultCurrency) {
2815
+ return;
2816
+ }
2817
+ return format === "iban" ? [Currencies.EUR, defaultCurrency] : [defaultCurrency];
2818
+ }
2819
+ return supportedCurrencies[format];
2820
+ };
2821
+ const isLocalCurrency = (country, currency) => {
2822
+ if (!country || !currency) {
2823
+ return false;
2824
+ }
2825
+ const supportedCurrencies = currencyByCountry[country];
2826
+ return supportedCurrencies?.includes(currency) ?? false;
2827
+ };
2828
+ const AccountHolderDescriptionFragment = ({
2829
+ legalEntityResponse
2830
+ }) => {
2831
+ const { t } = useTranslation("banking");
2832
+ const hasSolePropEntityAssociations = hasOwnEntityAssociationOfType(
2833
+ LegalEntityTypes.SOLE_PROPRIETORSHIP,
2834
+ legalEntityResponse.entityAssociations,
2835
+ legalEntityResponse.id
2836
+ );
2837
+ const { accountHolder } = useAccountHolder();
2838
+ const unincorporatedPartnershipMembers = useUnincorporatedPartnershipMembers();
2839
+ if (accountHolder === "mySoleProprietorName" || hasSolePropEntityAssociations) {
2840
+ const soleProp = legalEntityResponse.entityAssociations?.find(
2841
+ (ea) => ea.entityType === "soleProprietorship"
2842
+ );
2843
+ const { individual: individual2 } = legalEntityResponse;
2844
+ return /* @__PURE__ */ jsxs(Typography, { children: [
2845
+ `${t(($) => $["bankAccountHasToBeInYourName"])} `,
2846
+ /* @__PURE__ */ jsx(
2847
+ Typography,
2848
+ {
2849
+ el: "span",
2850
+ variant: "body-stronger",
2851
+ children: `${individual2?.name.firstName} ${individual2?.name.lastName}`
2852
+ }
2853
+ ),
2854
+ ` ${t(($) => $["orSoleProprietorshipName"])} `,
2855
+ " ",
2856
+ /* @__PURE__ */ jsx(Typography, { el: "span", variant: "body-stronger", children: `${soleProp?.name ?? ""}` })
2857
+ ] });
2858
+ }
2859
+ const hasTrustsEntityAssociations = hasOwnEntityAssociationOfType(
2860
+ LegalEntityTypes.TRUST,
2861
+ legalEntityResponse.entityAssociations,
2862
+ legalEntityResponse.id
2863
+ );
2864
+ if (accountHolder === "aTrust" || hasTrustsEntityAssociations) {
2865
+ const trust = legalEntityResponse.entityAssociations?.find((ea) => ea.entityType === "trust");
2866
+ if (legalEntityResponse.type === LegalEntityTypes.INDIVIDUAL) {
2867
+ return /* @__PURE__ */ jsxs(Typography, { children: [
2868
+ `${t(($) => $["bankAccountToHaveSameNameAsTrust"])} `,
2869
+ /* @__PURE__ */ jsx(Typography, { el: "span", variant: "body-stronger", children: t(($) => $["trusteeAsTrusteeForTrust"], {
2870
+ trusteeName: `${legalEntityResponse?.individual?.name.firstName} ${legalEntityResponse?.individual?.name.lastName}`,
2871
+ trustName: trust?.name ?? ""
2872
+ }) })
2873
+ ] });
2874
+ }
2875
+ const companyTrusteeBankAccountName = legalEntityResponse?.organization?.legalName !== legalEntityResponse?.organization?.doingBusinessAs ? t(($) => $["trusteeAsTrusteeForTrustDoingBusinessAs"], {
2876
+ trusteeName: legalEntityResponse?.organization?.legalName ?? "",
2877
+ trustName: trust?.name ?? "",
2878
+ tradingName: legalEntityResponse?.organization?.doingBusinessAs
2879
+ }) : t(($) => $["trusteeAsTrusteeForTrust"], {
2880
+ trusteeName: legalEntityResponse?.organization?.legalName ?? "",
2881
+ trustName: trust?.name ?? ""
2882
+ });
2883
+ return /* @__PURE__ */ jsxs(Typography, { children: [
2884
+ `${t(($) => $["bankAccountToHaveSameNameAsTrust"])} `,
2885
+ /* @__PURE__ */ jsx(Typography, { el: "span", variant: "body-stronger", children: companyTrusteeBankAccountName })
2886
+ ] });
2887
+ }
2888
+ const hasUnincorporatedPartnershipEntityAssociations = hasOwnEntityAssociationOfType(
2889
+ LegalEntityTypes.UNINCORPORATED_PARTNERSHIP,
2890
+ legalEntityResponse.entityAssociations,
2891
+ legalEntityResponse.id
2892
+ );
2893
+ if (accountHolder === "anUnincorporatedPartnership" || hasUnincorporatedPartnershipEntityAssociations) {
2894
+ const unincorporatedPartnership = legalEntityResponse?.entityAssociations?.find(
2895
+ (ea) => ea.entityType === "unincorporatedPartnership"
2896
+ );
2897
+ const partnerNames = unincorporatedPartnershipMembers?.map((member) => member?.name)?.sort();
2898
+ return /* @__PURE__ */ jsx(Typography, { children: `${t(($) => $["bankAccountToHaveSameNameAsUnincorporatedPartnership"], {
2899
+ partnerNames: `${partnerNames?.join(", ")}`,
2900
+ partnershipName: unincorporatedPartnership?.name ?? ""
2901
+ })} ` });
2902
+ }
2903
+ if (legalEntityResponse.type === LegalEntityTypes.ORGANIZATION) {
2904
+ return /* @__PURE__ */ jsxs(Typography, { children: [
2905
+ `${t(($) => $["bankAccountHasToBeInYourCompanyName"])} `,
2906
+ /* @__PURE__ */ jsx(Typography, { el: "span", variant: "body-stronger", children: legalEntityResponse?.organization?.legalName })
2907
+ ] });
2908
+ }
2909
+ const { individual } = legalEntityResponse;
2910
+ return /* @__PURE__ */ jsxs(Typography, { children: [
2911
+ `${t(($) => $["bankAccountHasToBeInYourName"])} `,
2912
+ /* @__PURE__ */ jsx(
2913
+ Typography,
2914
+ {
2915
+ el: "span",
2916
+ variant: "body-stronger",
2917
+ children: `${individual?.name.firstName} ${individual?.name.lastName}`
2918
+ }
2919
+ )
2920
+ ] });
2921
+ };
2922
+ const checkGuidance = "adyen-kyc-check-guidance";
2923
+ const checkGuidanceImage = "adyen-kyc-check-guidance-image";
2924
+ const checkGuidanceAnnotated = "adyen-kyc-check-guidance-annotated";
2925
+ const checkGuidanceInactive = "adyen-kyc-check-guidance-inactive";
2926
+ const styles$2 = {
2927
+ checkGuidance,
2928
+ checkGuidanceImage,
2929
+ checkGuidanceAnnotated,
2930
+ checkGuidanceInactive
2931
+ };
2932
+ const usCheckAccount = lazy(() => import("./us-check-account-number-C7KE5YzX.js"));
2933
+ const usCheckRouting = lazy(() => import("./us-check-routing-number-DUbhsYAR.js"));
2934
+ const usCheck = lazy(() => import("./us-check-CYY6Crhr.js"));
2935
+ const CheckGuidance = ({ annotated }) => {
2936
+ return /* @__PURE__ */ jsxs("div", { className: styles$2.checkGuidance, children: [
2937
+ /* @__PURE__ */ jsx(
2938
+ Image,
2939
+ {
2940
+ lazyLoadedImage: usCheckAccount,
2941
+ className: cx(styles$2.checkGuidanceImage, styles$2.checkGuidanceAnnotated, {
2942
+ [styles$2.checkGuidanceInactive]: annotated !== "account"
2943
+ })
2944
+ }
2945
+ ),
2946
+ /* @__PURE__ */ jsx(
2947
+ Image,
2948
+ {
2949
+ lazyLoadedImage: usCheckRouting,
2950
+ className: cx(styles$2.checkGuidanceImage, styles$2.checkGuidanceAnnotated, {
2951
+ [styles$2.checkGuidanceInactive]: annotated !== "routing"
2952
+ })
2953
+ }
2954
+ ),
2955
+ /* @__PURE__ */ jsx(Image, { lazyLoadedImage: usCheck, className: styles$2.checkGuidanceImage })
2956
+ ] });
2957
+ };
2958
+ const payoutAccountFields = [
2959
+ "accountHolder",
2960
+ ...ibanFields,
2961
+ ...branchCodeFields,
2962
+ ...swiftCodeFields,
2963
+ ...bankAccountNumberFields,
2964
+ ...bankNameFields,
2965
+ ...bankCodeFields
2966
+ ];
2967
+ function PayoutAccount(props) {
2968
+ const accountFormat = payoutAccountFormat.value;
2969
+ const { t } = useTranslation("banking");
2970
+ const { t: commonT } = useTranslation("common");
2971
+ const [checkAnnotation, setCheckAnnotation] = useState();
2972
+ const { isExperimentEnabled } = useExperimentsContext();
2973
+ const isCrossBorderPayoutsEnabled = isExperimentEnabled("EnableCrossBorderPayouts");
2974
+ const { isSettingEnabled } = useSettingsContext();
2975
+ const bankAccountFormatSelectionAllowed = isSettingEnabled(
2976
+ SettingNames.AllowBankAccountFormatSelection
2977
+ );
2978
+ const {
2979
+ heading,
2980
+ country,
2981
+ id,
2982
+ legalEntityResponse,
2983
+ requiredFields = [],
2984
+ arePayoutAccountDetailsInvalid,
2985
+ invalidFieldNames,
2986
+ formVerificationErrors,
2987
+ fieldValidationErrors,
2988
+ preferredCurrencyCode
2989
+ } = props;
2990
+ const showCheckGuidance = shouldShowCheckGuidance(country);
2991
+ const formUtils = createFormUtils({ ...props, requiredFields }, commonT);
2992
+ const bankAccountNumberProps = getFieldProps(props, bankAccountNumberFields);
2993
+ const swiftCodeProps = getFieldProps(props, swiftCodeFields);
2994
+ const ibanProps = getFieldProps(
2995
+ props,
2996
+ ibanFields
2997
+ );
2998
+ const branchCodeProps = getFieldProps(props, branchCodeFields);
2999
+ const bankNameProps = getFieldProps(props, bankNameFields);
3000
+ const bankCodeProps = getFieldProps(props, bankCodeFields);
3001
+ const bankCityProps = getFieldProps(props, bankCityFields);
3002
+ const { clearStateSlice } = useGlobalDataSlice(
3003
+ "payoutAccountDetails"
3004
+ );
3005
+ const handleAccountFormatChange = (accountFormat2) => {
3006
+ clearStateSlice();
3007
+ payoutAccountFormat.value = accountFormat2;
3008
+ };
3009
+ const localCurrency = isCrossBorderPayoutsEnabled ? isLocalCurrency(country, preferredCurrencyCode) : true;
3010
+ const isEUR = preferredCurrencyCode === "EUR";
3011
+ useEffect(() => {
3012
+ if (!isCrossBorderPayoutsEnabled) {
3013
+ return;
3014
+ }
3015
+ if (isEUR && localCurrency) {
3016
+ handleAccountFormatChange?.("iban");
3017
+ return;
3018
+ }
3019
+ if (!localCurrency) {
3020
+ handleAccountFormatChange?.("numberAndBic");
3021
+ }
3022
+ }, [country, preferredCurrencyCode]);
3023
+ return /* @__PURE__ */ jsxs("form", { className: "adyen-kyc-individual__payout-account", "aria-describedby": "ariaErrorField", children: [
3024
+ heading && /* @__PURE__ */ jsx(Header, { title: heading, children: /* @__PURE__ */ jsx(
3025
+ AccountHolderDescriptionFragment,
3026
+ {
3027
+ slot: "description",
3028
+ legalEntityResponse
3029
+ }
3030
+ ) }),
3031
+ /* @__PURE__ */ jsx(
3032
+ ErrorPanel,
3033
+ {
3034
+ verificationErrors: formVerificationErrors,
3035
+ validationErrors: fieldValidationErrors,
3036
+ formUtils,
3037
+ id: "ariaErrorField"
3038
+ }
3039
+ ),
3040
+ showCheckGuidance ? /* @__PURE__ */ jsx(CheckGuidance, { annotated: checkAnnotation }) : void 0,
3041
+ bankAccountFormatSelectionAllowed && shouldShowPayoutAccountFormatSelector(country) && accountFormat && localCurrency && !isEUR && /* @__PURE__ */ jsx(
3042
+ BankAccountFormat,
3043
+ {
3044
+ bankAccountFormat: accountFormat,
3045
+ handleAccountFormatChange
3046
+ }
3047
+ ),
3048
+ formUtils.isRequiredField("branchCode") && /* @__PURE__ */ jsx(
3049
+ BranchCode,
3050
+ {
3051
+ ...branchCodeProps,
3052
+ country,
3053
+ dataStoreId: id,
3054
+ onFocus: showCheckGuidance ? () => setCheckAnnotation("routing") : void 0,
3055
+ onBlur: showCheckGuidance ? () => setCheckAnnotation(void 0) : void 0
3056
+ }
3057
+ ),
3058
+ formUtils.isRequiredField("bankAccountNumber") && /* @__PURE__ */ jsx(
3059
+ BankAccountNumber,
3060
+ {
3061
+ ...bankAccountNumberProps,
3062
+ country,
3063
+ dataStoreId: id,
3064
+ onFocus: showCheckGuidance ? () => setCheckAnnotation("account") : void 0,
3065
+ onBlur: showCheckGuidance ? () => setCheckAnnotation(void 0) : void 0
3066
+ }
3067
+ ),
3068
+ formUtils.isRequiredField("iban") && /* @__PURE__ */ jsx(Iban, { ...ibanProps, dataStoreId: id, country }),
3069
+ formUtils.isRequiredField("swiftCode") && /* @__PURE__ */ jsx(SwiftCode, { ...swiftCodeProps, dataStoreId: id }),
3070
+ formUtils.isRequiredField("bankName") && /* @__PURE__ */ jsx(BankName, { ...bankNameProps, dataStoreId: id }),
3071
+ formUtils.isRequiredField("bankCode") && /* @__PURE__ */ jsx(BankCode, { ...bankCodeProps, country, dataStoreId: id }),
3072
+ formUtils.isRequiredField("bankCity") && /* @__PURE__ */ jsx(BankCity, { ...bankCityProps, dataStoreId: id }),
3073
+ shouldShowPayoutAlert(country) && !isCrossBorderPayoutsEnabled && /* @__PURE__ */ jsx(
3074
+ Alert,
3075
+ {
3076
+ title: getSupportedCurrencyGuidance(t, country, requiredFields),
3077
+ className: "adyen-kyc-u-margin-bottom-8"
3078
+ }
3079
+ ),
3080
+ !isCrossBorderPayoutsEnabled && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "tertiary", children: t(($) => $["thisAccountWillBeVerifiedToPrevent"]) }),
3081
+ arePayoutAccountDetailsInvalid && /* @__PURE__ */ jsx(
3082
+ Alert,
3083
+ {
3084
+ className: "adyen-kyc-u-margin-top-16",
3085
+ variant: "error",
3086
+ title: invalidFieldNames ? t(($) => $["pleaseEnterValidField"], {
3087
+ fieldNames: invalidFieldNames
3088
+ }) : t(($) => $["pleaseEnterValidAccountDetails"])
3089
+ }
3090
+ )
3091
+ ] });
3092
+ }
3093
+ const currenciesDataset = /* @__PURE__ */ JSON.parse('[{"currencyCode":"AED","description":"UAE Dirham","exponent":2,"symbol":""},{"currencyCode":"ALL","description":"Albanian Lek","exponent":2,"symbol":"L"},{"currencyCode":"AMD","description":"Armenian Dram","exponent":2,"symbol":""},{"currencyCode":"ANG","description":"Antillian Guilder","exponent":2,"symbol":"Naƒ"},{"currencyCode":"AOA","description":"Angolan kwanza","exponent":2,"symbol":""},{"currencyCode":"ARS","description":"Nuevo Argentine Peso","exponent":2,"symbol":"$"},{"currencyCode":"AUD","description":"Australian Dollar","exponent":2,"symbol":"A$"},{"currencyCode":"AWG","description":"Aruban Guilder","exponent":2,"symbol":""},{"currencyCode":"AZN","description":"Azerbaijani manat","exponent":2,"symbol":"man"},{"currencyCode":"BAM","description":"Bosnia and Herzegovina Convertible Marks","exponent":2,"symbol":""},{"currencyCode":"BBD","description":"Barbados Dollar","exponent":2,"symbol":""},{"currencyCode":"BDT","description":"Bangladesh Taka","exponent":2,"symbol":""},{"currencyCode":"BGL","description":"Bulgaria Lev","exponent":2,"symbol":""},{"currencyCode":"BGN","description":"New Bulgarian Lev","exponent":2,"symbol":""},{"currencyCode":"BHD","description":"Bahraini Dinar","exponent":3,"symbol":""},{"currencyCode":"BMD","description":"Bermudian Dollar","exponent":2,"symbol":""},{"currencyCode":"BND","description":"Brunei Dollar","exponent":2,"symbol":""},{"currencyCode":"BOB","description":"Bolivia Boliviano","exponent":2,"symbol":""},{"currencyCode":"BRL","description":"Brazilian Real","exponent":2,"symbol":"R$"},{"currencyCode":"BSD","description":"Bahamian Dollar","exponent":2,"symbol":""},{"currencyCode":"BTN","description":"Bhutan Ngultrum","exponent":2,"symbol":"Nu."},{"currencyCode":"BWP","description":"Botswana Pula","exponent":2,"symbol":""},{"currencyCode":"BYN","description":"Belarusian Ruble","exponent":2,"symbol":"Br"},{"currencyCode":"BYR","description":"Belarusian Ruble","exponent":0,"symbol":"Br"},{"currencyCode":"BZD","description":"Belize Dollar","exponent":2,"symbol":""},{"currencyCode":"CAD","description":"Canadian Dollar","exponent":2,"symbol":"$"},{"currencyCode":"CHF","description":"Swiss Franc","exponent":2,"symbol":""},{"currencyCode":"CLP","description":"Chilean Peso","exponent":2,"symbol":"$"},{"currencyCode":"CNY","description":"Yuan Renminbi","exponent":2,"symbol":"¥"},{"currencyCode":"COP","description":"Colombian Peso","exponent":2,"symbol":"₱"},{"currencyCode":"CRC","description":"Costa Rican Colon","exponent":2,"symbol":""},{"currencyCode":"CSD","description":"Serbian Dinar","exponent":2,"symbol":""},{"currencyCode":"CUP","description":"Cuban Peso","exponent":2,"symbol":""},{"currencyCode":"CVE","description":"Cape Verdi Escudo","exponent":0,"symbol":""},{"currencyCode":"CZK","description":"Czech Koruna","exponent":2,"symbol":""},{"currencyCode":"DJF","description":"Djibouti Franc","exponent":0,"symbol":""},{"currencyCode":"DKK","description":"Danish Krone","exponent":2,"symbol":"kr"},{"currencyCode":"DOP","description":"Dominican Republic Peso","exponent":2,"symbol":""},{"currencyCode":"DZD","description":"Algerian Dinar","exponent":2,"symbol":""},{"currencyCode":"EEK","description":"Estonian Krone","exponent":2,"symbol":""},{"currencyCode":"EGP","description":"Egyptian Pound","exponent":2,"symbol":"£"},{"currencyCode":"ETB","description":"Ethiopian Birr","exponent":2,"symbol":""},{"currencyCode":"EUR","description":"Euro","exponent":2,"symbol":"€"},{"currencyCode":"FJD","description":"Fiji Dollar","exponent":2,"symbol":"$"},{"currencyCode":"FKP","description":"Falkland Islands Pound","exponent":2,"symbol":""},{"currencyCode":"GBP","description":"Pound Sterling","exponent":2,"symbol":"£"},{"currencyCode":"GEL","description":"Georgian Lari","exponent":2,"symbol":""},{"currencyCode":"GHC","description":"Ghanaian Cedi (2nd)","exponent":0,"symbol":""},{"currencyCode":"GHS","description":"Ghanaian Cedi (3rd)","exponent":2,"symbol":"GH₵"},{"currencyCode":"GIP","description":"Gibraltar Pound","exponent":2,"symbol":""},{"currencyCode":"GMD","description":"Gambia Delasi","exponent":2,"symbol":""},{"currencyCode":"GNF","description":"Guinea Franc","exponent":0,"symbol":""},{"currencyCode":"GTQ","description":"Guatemala Quetzal","exponent":2,"symbol":""},{"currencyCode":"GYD","description":"Guyanese Dollar","exponent":2,"symbol":""},{"currencyCode":"HKD","description":"Hong Kong Dollar","exponent":2,"symbol":"$"},{"currencyCode":"HNL","description":"Honduras Lempira","exponent":2,"symbol":""},{"currencyCode":"HRK","description":"Croatia Kuna","exponent":2,"symbol":""},{"currencyCode":"HTG","description":"Haitian Gourde","exponent":2,"symbol":""},{"currencyCode":"HUF","description":"Hungarian Forint","exponent":2,"symbol":"Ft"},{"currencyCode":"IDR","description":"Indonesian Rupiah","exponent":0,"symbol":""},{"currencyCode":"ILS","description":"New Israeli Scheqel","exponent":2,"symbol":"₪"},{"currencyCode":"INR","description":"Indian Rupee","exponent":2,"symbol":"₨"},{"currencyCode":"IQD","description":"Iraqi Dinar","exponent":3,"symbol":""},{"currencyCode":"ISK","description":"Iceland Krona","exponent":2,"symbol":""},{"currencyCode":"JMD","description":"Jamaican Dollar","exponent":2,"symbol":""},{"currencyCode":"JOD","description":"Jordanian Dinar","exponent":3,"symbol":""},{"currencyCode":"JPY","description":"Japanese Yen","exponent":0,"symbol":"¥"},{"currencyCode":"KES","description":"Kenyan Shilling","exponent":2,"symbol":""},{"currencyCode":"KGS","description":"Kyrgyzstan Som","exponent":2,"symbol":""},{"currencyCode":"KHR","description":"Cambodia Riel","exponent":2,"symbol":""},{"currencyCode":"KMF","description":"Comoro Franc","exponent":0,"symbol":""},{"currencyCode":"KRW","description":"South-Korean Won","exponent":0,"symbol":"₩"},{"currencyCode":"KWD","description":"Kuwaiti Dinar","exponent":3,"symbol":""},{"currencyCode":"KYD","description":"Cayman Islands Dollar","exponent":2,"symbol":""},{"currencyCode":"KZT","description":"Kazakhstani Tenge","exponent":2,"symbol":"8"},{"currencyCode":"LAK","description":"Laos Kip","exponent":2,"symbol":""},{"currencyCode":"LBP","description":"Lebanese Pound","exponent":2,"symbol":"£"},{"currencyCode":"LKR","description":"Sri Lanka Rupee","exponent":2,"symbol":"₨"},{"currencyCode":"LTL","description":"Lithunianian Litas","exponent":2,"symbol":""},{"currencyCode":"LVL","description":"Latvian Lats","exponent":2,"symbol":""},{"currencyCode":"LYD","description":"Libyan Dinar","exponent":3,"symbol":""},{"currencyCode":"MAD","description":"Moroccan Dirham","exponent":2,"symbol":""},{"currencyCode":"MDL","description":"Moldovia Leu","exponent":2,"symbol":""},{"currencyCode":"MKD","description":"Macedonian Denar","exponent":2,"symbol":"ден"},{"currencyCode":"MMK","description":"Myanmar Kyat","exponent":2,"symbol":""},{"currencyCode":"MNT","description":"Mongolia Tugrik","exponent":2,"symbol":""},{"currencyCode":"MOP","description":"Macau Pataca","exponent":2,"symbol":""},{"currencyCode":"MRO","description":"Mauritania Ouguiya","exponent":1,"symbol":""},{"currencyCode":"MRU","description":"Mauritania Ouguiya","exponent":2,"symbol":""},{"currencyCode":"MUR","description":"Mauritius Rupee","exponent":2,"symbol":""},{"currencyCode":"MVR","description":"Maldives Rufiyaa","exponent":2,"symbol":""},{"currencyCode":"MWK","description":"Malawi Kwacha","exponent":2,"symbol":""},{"currencyCode":"MXN","description":"Mexican Peso","exponent":2,"symbol":"$"},{"currencyCode":"MXP","description":"Mexican Peso","exponent":2,"symbol":""},{"currencyCode":"MYR","description":"Malaysian Ringgit","exponent":2,"symbol":""},{"currencyCode":"MZN","description":"Mozambican Metical","exponent":2,"symbol":""},{"currencyCode":"NAD","description":"Namibian Dollar","exponent":2,"symbol":"$"},{"currencyCode":"NGN","description":"Nigerian naira","exponent":2,"symbol":"&"},{"currencyCode":"NIO","description":"Nicaragua Cordoba Oro","exponent":2,"symbol":""},{"currencyCode":"NOK","description":"Norwegian Krone","exponent":2,"symbol":""},{"currencyCode":"NPR","description":"Nepalese Rupee","exponent":2,"symbol":""},{"currencyCode":"NZD","description":"New Zealand Dollar","exponent":2,"symbol":"$"},{"currencyCode":"OMR","description":"Rial Omani","exponent":3,"symbol":"﷼"},{"currencyCode":"PAB","description":"Panamanian Balboa","exponent":2,"symbol":""},{"currencyCode":"PEN","description":"Peruvian Nuevo Sol","exponent":2,"symbol":"S/."},{"currencyCode":"PGK","description":"New Guinea Kina","exponent":2,"symbol":""},{"currencyCode":"PHP","description":"Philippine Peso","exponent":2,"symbol":"₱"},{"currencyCode":"PKR","description":"Pakistan Rupee","exponent":2,"symbol":"₨"},{"currencyCode":"PLN","description":"New Polish Zloty","exponent":2,"symbol":""},{"currencyCode":"PYG","description":"Paraguay Guarani","exponent":0,"symbol":""},{"currencyCode":"QAR","description":"Qatari Rial","exponent":2,"symbol":"﷼"},{"currencyCode":"ROL","description":"Romanian Lei","exponent":2,"symbol":""},{"currencyCode":"RON","description":"New Romanian Lei","exponent":2,"symbol":""},{"currencyCode":"RSD","description":"Serbian Dinar","exponent":2,"symbol":"РСД"},{"currencyCode":"RUB","description":"Russian Ruble","exponent":2,"symbol":"руб"},{"currencyCode":"RWF","description":"Rwanda Franc","exponent":0,"symbol":""},{"currencyCode":"SAR","description":"Saudi Riyal","exponent":2,"symbol":"﷼"},{"currencyCode":"SBD","description":"Solomon Island Dollar","exponent":2,"symbol":""},{"currencyCode":"SCR","description":"Seychelles Rupee","exponent":2,"symbol":""},{"currencyCode":"SEK","description":"Swedish Krone","exponent":2,"symbol":"kr"},{"currencyCode":"SGD","description":"Singapore Dollar","exponent":2,"symbol":"$"},{"currencyCode":"SHP","description":"St. Helena Pound","exponent":2,"symbol":""},{"currencyCode":"SKK","description":"Slovak Koruna","exponent":2,"symbol":""},{"currencyCode":"SLE","description":"Sierra Leone Leone","exponent":2,"symbol":"Le"},{"currencyCode":"SLL","description":"Sierra Leone Leone","exponent":2,"symbol":""},{"currencyCode":"SOS","description":"Somalia Shilling","exponent":2,"symbol":""},{"currencyCode":"SRD","description":"Surinamese dollar","exponent":2,"symbol":"Sr$"},{"currencyCode":"STD","description":"Sao Tome & Principe Dobra","exponent":2,"symbol":""},{"currencyCode":"STN","description":"Sao Tome & Principe Dobra","exponent":2,"symbol":""},{"currencyCode":"SVC","description":"El Salvador Colón","exponent":2,"symbol":"₡"},{"currencyCode":"SZL","description":"Swaziland Lilangeni","exponent":2,"symbol":""},{"currencyCode":"THB","description":"Thai Baht","exponent":2,"symbol":"฿"},{"currencyCode":"TND","description":"Tunisian Dinar","exponent":3,"symbol":""},{"currencyCode":"TOP","description":"Tonga Pa’anga","exponent":2,"symbol":""},{"currencyCode":"TRY","description":"New Turkish Lira","exponent":2,"symbol":"₤"},{"currencyCode":"TTD","description":"Trinidad & Tobago Dollar","exponent":2,"symbol":""},{"currencyCode":"TWD","description":"New Taiwan Dollar","exponent":2,"symbol":"元"},{"currencyCode":"TZS","description":"Tanzanian Shilling","exponent":2,"symbol":""},{"currencyCode":"UAH","description":"Ukraine Hryvnia","exponent":2,"symbol":""},{"currencyCode":"UGX","description":"Uganda Shilling","exponent":0,"symbol":""},{"currencyCode":"USD","description":"US Dollars","exponent":2,"symbol":"$"},{"currencyCode":"UYU","description":"Peso Uruguayo","exponent":2,"symbol":"₱"},{"currencyCode":"UZS","description":"Uzbekistani Som","exponent":2,"symbol":"som"},{"currencyCode":"VEF","description":"Venezuelan Bolívar","exponent":2,"symbol":"Bs.F."},{"currencyCode":"VND","description":"Vietnamese New Dong","exponent":0,"symbol":"₫"},{"currencyCode":"VUV","description":"Vanuatu Vatu","exponent":0,"symbol":""},{"currencyCode":"WST","description":"Samoan Tala","exponent":2,"symbol":""},{"currencyCode":"XAF","description":"CFA Franc BEAC","exponent":0,"symbol":""},{"currencyCode":"XCD","description":"East Carribean Dollar","exponent":2,"symbol":"EC$"},{"currencyCode":"XOF","description":"CFA Franc BCEAO","exponent":0,"symbol":""},{"currencyCode":"XPF","description":"CFP Franc","exponent":0,"symbol":""},{"currencyCode":"YER","description":"Yemeni Rial","exponent":2,"symbol":""},{"currencyCode":"ZAR","description":"South African Rand","exponent":2,"symbol":"R"},{"currencyCode":"ZMK","description":"Zambia Kwacha","exponent":2,"symbol":""},{"currencyCode":"ZMW","description":"Zambian Kwacha","exponent":2,"symbol":""}]');
3094
+ const ALLOWED_PAYOUT_CURRENCIES = Object.keys(Currencies);
3095
+ const PreferredCurrency = (props) => {
3096
+ const { country, preferredCurrency, handleChangeFor } = props;
3097
+ const { t } = useTranslation(["common", "banking"]);
3098
+ const currencyDescriptionByCode = new Map(
3099
+ currenciesDataset.map((currency) => [currency.currencyCode, currency.description])
3100
+ );
3101
+ const getPrioritizedCurrencies = () => {
3102
+ const countryPreferredCurrencies = currencyByCountry[country] || [];
3103
+ const allowedCountryCurrencies = countryPreferredCurrencies.filter(
3104
+ (currency) => ALLOWED_PAYOUT_CURRENCIES.includes(currency)
3105
+ );
3106
+ const otherAllowedCurrencies = ALLOWED_PAYOUT_CURRENCIES.filter(
3107
+ (currency) => !allowedCountryCurrencies.includes(currency)
3108
+ );
3109
+ if (allowedCountryCurrencies.length > 0 && otherAllowedCurrencies.length > 0) {
3110
+ return [...allowedCountryCurrencies, null, ...otherAllowedCurrencies];
3111
+ }
3112
+ return [...allowedCountryCurrencies, ...otherAllowedCurrencies];
3113
+ };
3114
+ const prioritizedCurrencies = getPrioritizedCurrencies();
3115
+ const currenciesAsOptions = prioritizedCurrencies.map((currency) => {
3116
+ if (currency === null) {
3117
+ return {
3118
+ id: "separator",
3119
+ name: " ",
3120
+ disabled: true
3121
+ };
3122
+ }
3123
+ const description2 = currencyDescriptionByCode.get(currency);
3124
+ const label = description2 ? `${description2} (${currency})` : currency;
3125
+ return {
3126
+ id: currency,
3127
+ name: label
3128
+ };
3129
+ });
3130
+ const selectCurrency = (e) => {
3131
+ if (e.id === "separator") {
3132
+ return;
3133
+ }
3134
+ handleChangeFor("preferredCurrency")(e.id);
3135
+ };
3136
+ return /* @__PURE__ */ jsx(
3137
+ Field,
3138
+ {
3139
+ name: "preferredCurrency",
3140
+ label: t(($) => $["preferredPayoutCurrency"], { ns: "banking" }),
3141
+ helper: t(($) => $["ifYouChooseAPayoutCurrencyThatDoesntMatchYourBankAccount"], {
3142
+ ns: "banking"
3143
+ }),
3144
+ helperPosition: "below",
3145
+ children: (childProps) => /* @__PURE__ */ jsx(
3146
+ Select,
3147
+ {
3148
+ ...childProps,
3149
+ onSelect: selectCurrency,
3150
+ name: "preferredPayoutCurrency",
3151
+ placeholder: t(($) => $["localFormat"], { ns: "banking" }),
3152
+ selected: preferredCurrency,
3153
+ items: currenciesAsOptions || []
3154
+ }
3155
+ )
3156
+ }
3157
+ );
3158
+ };
3159
+ const getMustHaveSameAccountHolderNameTransKey = (legalEntityType) => {
3160
+ switch (legalEntityType) {
3161
+ case "individual":
3162
+ case "soleProprietorship":
3163
+ return "theBankAccountHolderMustBeInYourName";
3164
+ case "organization":
3165
+ case "trust":
3166
+ case "unincorporatedPartnership":
3167
+ return "theBankAccountHolderMustHaveTheSameNameAsYourCompany";
3168
+ default:
3169
+ return "theBankAccountHolderMustHaveTheSameNameAsYourCompany";
3170
+ }
3171
+ };
3172
+ const payoutModalContent = "adyen-kyc-payout-modal-content";
3173
+ const title = "adyen-kyc-title";
3174
+ const section = "adyen-kyc-section";
3175
+ const sectionTitle = "adyen-kyc-section-title";
3176
+ const sectionText = "adyen-kyc-section-text";
3177
+ const simplerTermsBox = "adyen-kyc-simpler-terms-box";
3178
+ const simplerTermsTitle = "adyen-kyc-simpler-terms-title";
3179
+ const bulletList = "adyen-kyc-bullet-list";
3180
+ const styles$1 = {
3181
+ payoutModalContent,
3182
+ title,
3183
+ section,
3184
+ sectionTitle,
3185
+ sectionText,
3186
+ simplerTermsBox,
3187
+ simplerTermsTitle,
3188
+ bulletList
3189
+ };
3190
+ function PayoutRequirementsModal({
3191
+ isOpen,
3192
+ onClose,
3193
+ provider
3194
+ }) {
3195
+ const { t } = useTranslation("banking");
3196
+ if (!isOpen) return null;
3197
+ return /* @__PURE__ */ jsx(
3198
+ Modal,
3199
+ {
3200
+ ariaLabel: t(($) => $["aboutPayoutBankAccounts"]),
3201
+ onClose,
3202
+ size: "medium",
3203
+ showCloseButton: true,
3204
+ inset: true,
3205
+ children: /* @__PURE__ */ jsxs("div", { className: styles$1.payoutModalContent, children: [
3206
+ /* @__PURE__ */ jsx(Typography, { variant: "title-m", el: "h1", className: styles$1.title, children: t(($) => $["aboutPayoutBankAccounts"]) }),
3207
+ /* @__PURE__ */ jsxs("div", { className: styles$1.section, children: [
3208
+ /* @__PURE__ */ jsx(Typography, { variant: "body-strongest", el: "h3", className: styles$1.sectionTitle, children: t(($) => $["doesMyBankAccountNeedToBeInSameCountry"]) }),
3209
+ /* @__PURE__ */ jsx(Typography, { variant: "body", className: styles$1.sectionText, children: t(($) => $["countryDependsExplanation"]) })
3210
+ ] }),
3211
+ /* @__PURE__ */ jsxs("div", { className: styles$1.section, children: [
3212
+ /* @__PURE__ */ jsx(Typography, { variant: "body-strongest", el: "h3", className: styles$1.sectionTitle, children: t(($) => $["whichPayoutCurrencyShouldIChoose"]) }),
3213
+ /* @__PURE__ */ jsx(Typography, { variant: "body", className: styles$1.sectionText, children: t(($) => $["currencyRecommendation"]) }),
3214
+ /* @__PURE__ */ jsxs("div", { className: styles$1.simplerTermsBox, children: [
3215
+ /* @__PURE__ */ jsx(Typography, { variant: "body-strongest", el: "h4", className: styles$1.simplerTermsTitle, children: t(($) => $["inSimplerTerms"]) }),
3216
+ /* @__PURE__ */ jsx(Typography, { variant: "body", children: t(($) => $["currencySimplerTerms"]) })
3217
+ ] })
3218
+ ] }),
3219
+ provider && /* @__PURE__ */ jsxs("div", { className: styles$1.section, children: [
3220
+ /* @__PURE__ */ jsx(Typography, { variant: "body-strongest", el: "h3", className: styles$1.sectionTitle, children: t(($) => $["howDoesVerificationWithOurPartnerWork"], {
3221
+ provider: provider?.name
3222
+ }) }),
3223
+ /* @__PURE__ */ jsx(Typography, { className: styles$1.sectionText, children: t(($) => $["isOurTrustedPartnerHelpingSpeedUpSetup"], {
3224
+ provider: provider?.name
3225
+ }) }),
3226
+ /* @__PURE__ */ jsxs("ul", { className: styles$1.bulletList, children: [
3227
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["selectTheBankToReceivePayouts"]) }),
3228
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["loginIntoYourBankingEnvironment"]) }),
3229
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["yourBankWillConfirmYourAccountDetails"]) })
3230
+ ] }),
3231
+ /* @__PURE__ */ jsx(Typography, { children: t(($) => $["adyenWillOnlyGetTemporaryAccess"]) })
3232
+ ] })
3233
+ ] })
3234
+ }
3235
+ );
3236
+ }
3237
+ const payoutCountryDetailsFields = [
3238
+ "bankCountry",
3239
+ "preferredCurrency"
3240
+ ];
3241
+ const DEFAULT_CURRENCY_FALLBACK = "USD";
3242
+ const getDefaultCurrencyForCountry = (country) => currencyByCountry[country]?.[0] ?? DEFAULT_CURRENCY_FALLBACK;
3243
+ const getCountryCodeFromEvent = (event) => event?.target?.value;
3244
+ function PayoutCountryDetails(props) {
3245
+ const { legalEntityResponse, data: propData, provider } = props;
3246
+ const { t: commonT } = useTranslation("common");
3247
+ const { t } = useTranslation("banking");
3248
+ const { isSettingEnabled } = useSettingsContext();
3249
+ const country = getLegalEntityCountry(legalEntityResponse);
3250
+ const [isModalOpen, setIsModalOpen] = useState(false);
3251
+ const legalEntityType = legalEntityResponse.type;
3252
+ const defaultCurrency = getDefaultCurrencyForCountry(country);
3253
+ const { handleChangeFor, data, valid, errors, fieldProblems } = useForm({
3254
+ ...props,
3255
+ schema: payoutCountryDetailsFields,
3256
+ defaultData: {
3257
+ bankCountry: propData?.bankCountry ?? country,
3258
+ preferredCurrency: propData?.preferredCurrency ?? defaultCurrency
3259
+ },
3260
+ shouldValidate: true
3261
+ });
3262
+ const formUtils = createFormUtils(props, commonT);
3263
+ const allowedBankCountries = Object.keys(currencyByCountry);
3264
+ const canChangeEntityType = isSettingEnabled(SettingNames.AllowLegalEntityTypeChange);
3265
+ const accountHolder = getPayoutAccountHolderName(legalEntityResponse, t);
3266
+ const description2 = canChangeEntityType ? /* @__PURE__ */ jsx(AccountHolderDescriptionFragment, { legalEntityResponse }) : /* @__PURE__ */ jsxs(Typography, { children: [
3267
+ t(($) => $["forYouToReceiveYourPayouts"]),
3268
+ " ",
3269
+ /* @__PURE__ */ jsx(
3270
+ Trans,
3271
+ {
3272
+ t,
3273
+ ns: "banking",
3274
+ i18nKey: ($) => $[getMustHaveSameAccountHolderNameTransKey(legalEntityType)],
3275
+ values: { name: accountHolder, companyName: accountHolder }
3276
+ }
3277
+ )
3278
+ ] });
3279
+ const descriptionExtra = /* @__PURE__ */ jsx("div", { className: "adyen-kyc-u-margin-bottom-12", children: /* @__PURE__ */ jsx(
3280
+ Trans,
3281
+ {
3282
+ t,
3283
+ ns: "banking",
3284
+ i18nKey: ($) => $["payoutAccountsMustMeetSomeRequirements"],
3285
+ components: {
3286
+ requirementsLink: /* @__PURE__ */ jsx(
3287
+ "button",
3288
+ {
3289
+ type: "button",
3290
+ onClick: () => setIsModalOpen(true),
3291
+ style: {
3292
+ background: "none",
3293
+ border: "none",
3294
+ color: "inherit",
3295
+ textDecoration: "underline",
3296
+ cursor: "pointer",
3297
+ padding: 0,
3298
+ font: "inherit"
3299
+ }
3300
+ }
3301
+ )
3302
+ }
3303
+ }
3304
+ ) });
3305
+ const { updateStateSlice } = useGlobalDataSlice(
3306
+ "payoutCountryDetails"
3307
+ );
3308
+ useEffect(() => {
3309
+ updateStateSlice({ data, valid, errors, fieldProblems });
3310
+ }, [data, valid, errors, updateStateSlice, fieldProblems]);
3311
+ const updateCountryField = (event) => {
3312
+ const updatedCountry = getCountryCodeFromEvent(event);
3313
+ handleChangeFor("bankCountry", "input")(updatedCountry);
3314
+ handleChangeFor("preferredCurrency", "input")(getDefaultCurrencyForCountry(updatedCountry));
3315
+ };
3316
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
3317
+ /* @__PURE__ */ jsxs("form", { style: { minHeight: "480px" }, children: [
3318
+ /* @__PURE__ */ jsx(Header, { title: t(($) => $["payoutBankAccount"]), children: /* @__PURE__ */ jsxs("div", { slot: "description", className: "adyen-kyc-form-header__description", children: [
3319
+ description2,
3320
+ descriptionExtra
3321
+ ] }) }),
3322
+ /* @__PURE__ */ jsx(
3323
+ CountryField,
3324
+ {
3325
+ data: { country: data.bankCountry },
3326
+ valid: { country: valid?.bankCountry },
3327
+ errors: { country: formUtils.getErrorMessage("bankCountry", errors, fieldProblems) },
3328
+ labels: { country: t(($) => $["bankAccountCountryRegion"]) },
3329
+ readonly: false,
3330
+ allowedCountries: allowedBankCountries,
3331
+ handleChangeFor: () => updateCountryField
3332
+ }
3333
+ ),
3334
+ /* @__PURE__ */ jsx(
3335
+ PreferredCurrency,
3336
+ {
3337
+ country: data.bankCountry,
3338
+ preferredCurrency: data.preferredCurrency ?? defaultCurrency,
3339
+ handleChangeFor
3340
+ }
3341
+ )
3342
+ ] }),
3343
+ /* @__PURE__ */ jsx(
3344
+ PayoutRequirementsModal,
3345
+ {
3346
+ isOpen: isModalOpen,
3347
+ onClose: () => setIsModalOpen(false),
3348
+ provider
3349
+ }
3350
+ )
3351
+ ] });
3352
+ }
3353
+ const regions = {
3354
+ europe: [
3355
+ ...EEA_Countries,
3356
+ CountryCodes.Switzerland,
3357
+ CountryCodes.UnitedKingdom,
3358
+ CountryCodes.Gibraltar
3359
+ ],
3360
+ apac: [CountryCodes.NewZealand, CountryCodes.Australia]
3361
+ };
3362
+ const getAllowedBankCountries = (country) => Object.values(regions).find((countriesInARegion) => countriesInARegion.includes(country)) ?? [
3363
+ country
3364
+ ];
3365
+ const tinkLogo = lazy(() => import("./tink-logo-BcIv93ND.js"));
3366
+ const plaidLogo = lazy(() => import("./plaid-logo-CtActXTN.js"));
3367
+ const yapilyLogo = lazy(() => import("./yapily-logo-CZ4ywjwA.js"));
3368
+ const instantVerificationImage = lazy(
3369
+ () => import("./instant-verification-Dvvkyfmp.js")
3370
+ );
3371
+ const manualVerificationImage = lazy(
3372
+ () => import("./manual-verification-BvZWqA00.js")
3373
+ );
3374
+ const instantVerificationImageNew = lazy(
3375
+ () => import("./payout-verification-instant-5u-wvFKv.js")
3376
+ );
3377
+ const manualVerificationImageNew = lazy(
3378
+ () => import("./payout-verification-manual-BH2mu0UW.js")
3379
+ );
3380
+ const getProviderIconName = (providerName) => {
3381
+ switch (providerName?.toLowerCase()) {
3382
+ case "tink":
3383
+ return tinkLogo;
3384
+ case "plaid":
3385
+ return plaidLogo;
3386
+ case "yapily":
3387
+ return yapilyLogo;
3388
+ default:
3389
+ return void 0;
3390
+ }
3391
+ };
3392
+ const makePayoutVerificationMethodsMetadata = (instantVerificationProviderName, makePayoutVerificationMethodsMetadata2) => ({
3393
+ instantVerification: {
3394
+ name: "verifyViaMobileBankingAppOrWebsite",
3395
+ subtitle: "instant",
3396
+ svgImport: makePayoutVerificationMethodsMetadata2 ? instantVerificationImageNew : instantVerificationImage,
3397
+ description: "instantVerificationDescription",
3398
+ provider: instantVerificationProviderName ? {
3399
+ name: instantVerificationProviderName,
3400
+ svgImport: getProviderIconName(instantVerificationProviderName)
3401
+ } : void 0
3402
+ },
3403
+ manualVerification: {
3404
+ name: "uploadABankStatement",
3405
+ subtitle: "mayTakeAFewDays",
3406
+ description: "manualVerificationDescription",
3407
+ svgImport: makePayoutVerificationMethodsMetadata2 ? manualVerificationImageNew : manualVerificationImage
3408
+ }
3409
+ });
3410
+ const payoutVerificationMethods = ["instantVerification", "manualVerification"];
3411
+ const fieldVerificationMethods = "adyen-kyc-field-verification-methods";
3412
+ const fieldVerificationMethodsCard = "adyen-kyc-field-verification-methods-card";
3413
+ const fieldVerificationMethodsFooter = "adyen-kyc-field-verification-methods-footer";
3414
+ const fieldVerificationMethodsLogo = "adyen-kyc-field-verification-methods-logo";
3415
+ const radioGroupCardIllustration = "adyen-kyc-radio-group-card-illustration";
3416
+ const instantVerificationError = "adyen-kyc-instant-verification-error";
3417
+ const payoutVerificationMethodCard = "adyen-kyc-payout-verification-method-card";
3418
+ const payoutVerificationMethodCardDisabled = "adyen-kyc-payout-verification-method-card-disabled";
3419
+ const payoutVerificationMethodCardImage = "adyen-kyc-payout-verification-method-card-image";
3420
+ const payoutVerificationMethodCardContent = "adyen-kyc-payout-verification-method-card-content";
3421
+ const payoutVerificationMethodCardTitle = "adyen-kyc-payout-verification-method-card-title";
3422
+ const payoutVerificationMethodCardSubtitle = "adyen-kyc-payout-verification-method-card-subtitle";
3423
+ const payoutVerificationMethodCardBody = "adyen-kyc-payout-verification-method-card-body";
3424
+ const payoutVerificationMethodCardImageContainer = "adyen-kyc-payout-verification-method-card-image-container";
3425
+ const styles = {
3426
+ fieldVerificationMethods,
3427
+ fieldVerificationMethodsCard,
3428
+ fieldVerificationMethodsFooter,
3429
+ fieldVerificationMethodsLogo,
3430
+ radioGroupCardIllustration,
3431
+ instantVerificationError,
3432
+ payoutVerificationMethodCard,
3433
+ payoutVerificationMethodCardDisabled,
3434
+ payoutVerificationMethodCardImage,
3435
+ payoutVerificationMethodCardContent,
3436
+ payoutVerificationMethodCardTitle,
3437
+ payoutVerificationMethodCardSubtitle,
3438
+ payoutVerificationMethodCardBody,
3439
+ payoutVerificationMethodCardImageContainer
3440
+ };
3441
+ const PayoutVerificationMethodOptionIcon = ({
3442
+ method,
3443
+ methodsMetadata
3444
+ }) => {
3445
+ const { svgImport } = methodsMetadata[method];
3446
+ return /* @__PURE__ */ jsx(Image, { className: styles.payoutVerificationMethodCardImage, lazyLoadedImage: svgImport });
3447
+ };
3448
+ const PayoutVerificationMethodOptionCard = ({
3449
+ payoutMethod,
3450
+ title: title2,
3451
+ subtitle,
3452
+ tag,
3453
+ selectVerificationMethod,
3454
+ payoutVerificationMethod,
3455
+ methodsMetadata,
3456
+ bankInfoValidated,
3457
+ instantVerificationAvailable
3458
+ }) => {
3459
+ const isInstantVerificationCard = payoutMethod === "instantVerification";
3460
+ const isCardDisabled = bankInfoValidated || isInstantVerificationCard && !instantVerificationAvailable;
3461
+ return /* @__PURE__ */ jsxs(
3462
+ Card,
3463
+ {
3464
+ className: cx(styles.payoutVerificationMethodCard, {
3465
+ "adyen-kyc-u-margin-bottom-8": isInstantVerificationCard,
3466
+ [styles.payoutVerificationMethodCardDisabled]: isCardDisabled
3467
+ }),
3468
+ bodyClassName: styles.payoutVerificationMethodCardBody,
3469
+ onClick: () => selectVerificationMethod(payoutMethod),
3470
+ stateful: true,
3471
+ active: payoutMethod === payoutVerificationMethod,
3472
+ disabled: isCardDisabled,
3473
+ children: [
3474
+ /* @__PURE__ */ jsx("div", { className: styles.payoutVerificationMethodCardImageContainer, children: /* @__PURE__ */ jsx(
3475
+ PayoutVerificationMethodOptionIcon,
3476
+ {
3477
+ method: payoutMethod,
3478
+ methodsMetadata
3479
+ }
3480
+ ) }),
3481
+ /* @__PURE__ */ jsxs("div", { className: styles.payoutVerificationMethodCardContent, children: [
3482
+ tag,
3483
+ /* @__PURE__ */ jsx(
3484
+ Typography,
3485
+ {
3486
+ el: "h4",
3487
+ variant: "body-strongest",
3488
+ className: styles.payoutVerificationMethodCardTitle,
3489
+ children: title2
3490
+ }
3491
+ ),
3492
+ /* @__PURE__ */ jsx(
3493
+ Typography,
3494
+ {
3495
+ el: "p",
3496
+ variant: "body",
3497
+ color: "secondary",
3498
+ className: styles.payoutVerificationMethodCardSubtitle,
3499
+ children: subtitle
3500
+ }
3501
+ )
3502
+ ] })
3503
+ ]
3504
+ },
3505
+ payoutMethod
3506
+ );
3507
+ };
3508
+ const payoutVerificationMethodFields = ["payoutVerificationMethod", "bankCountry", ...accountVerificationFields];
3509
+ function PayoutVerificationMethod(props) {
3510
+ const {
3511
+ heading,
3512
+ country,
3513
+ accountHolder,
3514
+ provider,
3515
+ bankVendorsLoadingStatus,
3516
+ instantVerificationAvailable,
3517
+ legalEntityResponse,
3518
+ validators,
3519
+ bankInfoValidated,
3520
+ data: payoutVerificationMethodData,
3521
+ fieldValidationErrors,
3522
+ formVerificationErrors
3523
+ } = props;
3524
+ const { type: legalEntityType } = legalEntityResponse;
3525
+ const { t } = useTranslation("banking");
3526
+ const { t: commonT } = useTranslation("common");
3527
+ const instantVerificationError2 = useContext(InstantVerificationErrorContext);
3528
+ const { isSettingEnabled } = useSettingsContext();
3529
+ const { isExperimentEnabled } = useExperimentsContext();
3530
+ const canChangeEntityType = isSettingEnabled(SettingNames.AllowLegalEntityTypeChange);
3531
+ const isPayoutVerificationMethodPageRedesignEnabled = isExperimentEnabled(
3532
+ ExperimentNames.EnablePayoutVerificationMethodPageRedesign
3533
+ );
3534
+ const intraRegionCrossBorderPayoutsAllowed = isSettingEnabled(
3535
+ SettingNames.AllowIntraRegionCrossBorderPayout
3536
+ );
3537
+ const enabledUnbiasedVerificationMethod = isExperimentEnabled(
3538
+ "BankVerificationMethodAutonomy_UnbiasedSelection"
3539
+ );
3540
+ const [hasSelectedMethod, setHasSelectedMethod] = useState(false);
3541
+ const { handleChangeFor, data, valid, errors, fieldProblems } = useForm({
3542
+ ...props,
3543
+ schema: payoutVerificationMethodFields,
3544
+ defaultData: {
3545
+ verifiedAccountHolder: accountHolder,
3546
+ verifiedCurrencyCode: currencyByCountry[country]?.[0],
3547
+ bankCountry: country,
3548
+ ...payoutVerificationMethodData
3549
+ },
3550
+ rules: validators || {
3551
+ payoutVerificationMethod: {
3552
+ modes: ["blur"],
3553
+ validate: (payoutVerificationMethod) => !enabledUnbiasedVerificationMethod || !!payoutVerificationMethod
3554
+ }
3555
+ },
3556
+ fieldProblems: fieldValidationErrors
3557
+ });
3558
+ const formUtils = createFormUtils(props, commonT);
3559
+ const { sliceData, updateStateSlice } = useGlobalDataSlice("payoutVerificationMethod");
3560
+ const { clearStateSlice: clearPayoutAccountDetails } = useGlobalDataSlice("payoutAccountDetails");
3561
+ useEffect(
3562
+ () => updateStateSlice({ data: { ...sliceData, ...data }, errors, valid, fieldProblems }),
3563
+ [data, errors, fieldProblems, valid]
3564
+ );
3565
+ const methodsMetadata = makePayoutVerificationMethodsMetadata(
3566
+ provider?.name,
3567
+ isPayoutVerificationMethodPageRedesignEnabled
3568
+ );
3569
+ const PayoutVerificationMethodOptionFooter = ({
3570
+ method,
3571
+ methodsMetadata: methodsMetadata2
3572
+ }) => {
3573
+ const { t: t2 } = useTranslation("common");
3574
+ const { provider: provider2 } = methodsMetadata2[method];
3575
+ return provider2 ? /* @__PURE__ */ jsxs(Typography, { el: "div", variant: "caption", className: styles.fieldVerificationMethodsFooter, children: [
3576
+ t2(($) => $["poweredBy"]),
3577
+ provider2.svgImport ? /* @__PURE__ */ jsx(
3578
+ Image,
3579
+ {
3580
+ className: styles.fieldVerificationMethodsLogo,
3581
+ lazyLoadedImage: provider2.svgImport
3582
+ }
3583
+ ) : ` ${provider2.name}`
3584
+ ] }) : null;
3585
+ };
3586
+ const selectVerificationMethod = (method) => {
3587
+ setHasSelectedMethod(true);
3588
+ handleChangeFor("payoutVerificationMethod")(method);
3589
+ };
3590
+ useEffect(() => {
3591
+ if (bankInfoValidated || enabledUnbiasedVerificationMethod) return;
3592
+ if (!hasSelectedMethod && instantVerificationAvailable && data.payoutVerificationMethod !== "instantVerification") {
3593
+ handleChangeFor("payoutVerificationMethod")("instantVerification");
3594
+ }
3595
+ if (!instantVerificationAvailable && data.payoutVerificationMethod !== "manualVerification") {
3596
+ handleChangeFor("payoutVerificationMethod")("manualVerification");
3597
+ }
3598
+ }, [
3599
+ data.payoutVerificationMethod,
3600
+ handleChangeFor,
3601
+ instantVerificationAvailable,
3602
+ hasSelectedMethod,
3603
+ bankInfoValidated
3604
+ ]);
3605
+ const { dataset: countries } = useDataset(datasetIdentifier.country);
3606
+ const bankCountryName = countries.find((country2) => country2.id === data.bankCountry)?.name ?? data.bankCountry;
3607
+ const allowedBankCountries = getAllowedBankCountries(country);
3608
+ const countryField = /* @__PURE__ */ jsx(
3609
+ CountryField,
3610
+ {
3611
+ data: { country: data.bankCountry },
3612
+ valid: { country: valid?.bankCountry },
3613
+ errors: { country: formUtils.getErrorMessage("bankCountry", errors, fieldProblems) },
3614
+ labels: { country: t(($) => $["bankAccountCountryRegion"]) },
3615
+ readonly: !intraRegionCrossBorderPayoutsAllowed || allowedBankCountries.length === 1 || bankInfoValidated,
3616
+ allowedCountries: allowedBankCountries,
3617
+ handleChangeFor: () => (e) => {
3618
+ clearPayoutAccountDetails();
3619
+ return handleChangeFor("bankCountry", "input")(e);
3620
+ },
3621
+ helperText: {
3622
+ country: intraRegionCrossBorderPayoutsAllowed ? void 0 : t(
3623
+ ($) => $[legalEntityType === LegalEntityTypes.INDIVIDUAL ? "youCanOnlyUseABankAccountInTheCountryRegionWhereYouLive" : "youCanOnlyUseABankAccountInTheCountryRegionWhereYourCompanyIsRegistered"]
3624
+ )
3625
+ }
3626
+ }
3627
+ );
3628
+ const description2 = canChangeEntityType ? /* @__PURE__ */ jsx(AccountHolderDescriptionFragment, { legalEntityResponse }) : /* @__PURE__ */ jsxs(Typography, { children: [
3629
+ t(($) => $["forYouToReceiveYourPayouts"]),
3630
+ " ",
3631
+ /* @__PURE__ */ jsx(
3632
+ Trans,
3633
+ {
3634
+ t,
3635
+ ns: "banking",
3636
+ i18nKey: ($) => $[getMustHaveSameAccountHolderNameTransKey(legalEntityType)],
3637
+ values: { name: accountHolder, companyName: accountHolder }
3638
+ }
3639
+ )
3640
+ ] });
3641
+ return /* @__PURE__ */ jsxs("form", { className: styles.payoutVerificationMethod, children: [
3642
+ heading && /* @__PURE__ */ jsx(Header, { title: heading, children: /* @__PURE__ */ jsx("template", { slot: "description", children: description2 }) }),
3643
+ instantVerificationError2 && /* @__PURE__ */ jsx(
3644
+ Alert,
3645
+ {
3646
+ variant: "error",
3647
+ className: styles.instantVerificationError,
3648
+ title: instantVerificationError2.title,
3649
+ children: instantVerificationError2.content && /* @__PURE__ */ jsx("p", { className: "adyen-kyc-u-margin-0", children: instantVerificationError2.content })
3650
+ }
3651
+ ),
3652
+ !isExperimentEnabled(ExperimentNames.EnableCrossBorderPayouts) && countryField,
3653
+ /* @__PURE__ */ jsx(
3654
+ Field,
3655
+ {
3656
+ el: "fieldset",
3657
+ name: "verificationMethods",
3658
+ label: formUtils.getLabel("payoutVerificationMethod", "verificationMethod"),
3659
+ errorMessage: formUtils.getErrorMessage("payoutVerificationMethod", errors, fieldProblems),
3660
+ helper: instantVerificationAvailable ? void 0 : t(($) => $["weDoNotYetSupportInstantVerificationForBankAccountsIn"], {
3661
+ countryName: bankCountryName
3662
+ }),
3663
+ children: (childProps) => isPayoutVerificationMethodPageRedesignEnabled ? /* @__PURE__ */ jsxs(Fragment, { children: [
3664
+ /* @__PURE__ */ jsx(
3665
+ PayoutVerificationMethodOptionCard,
3666
+ {
3667
+ payoutMethod: "instantVerification",
3668
+ title: t(($) => $["logInWithYourBank"]),
3669
+ subtitle: t(($) => $["theFastestWayToVerifyYourAccount"]),
3670
+ tag: /* @__PURE__ */ jsx(Tag, { variant: "blue", className: "adyen-kyc-u-margin-bottom-8", children: t(($) => $["recommended"]) }),
3671
+ selectVerificationMethod,
3672
+ methodsMetadata,
3673
+ payoutVerificationMethod: data.payoutVerificationMethod,
3674
+ instantVerificationAvailable,
3675
+ bankInfoValidated
3676
+ }
3677
+ ),
3678
+ /* @__PURE__ */ jsx(
3679
+ PayoutVerificationMethodOptionCard,
3680
+ {
3681
+ payoutMethod: "manualVerification",
3682
+ title: t(($) => $["verifyManually"]),
3683
+ subtitle: t(($) => $["enterYourAccountsDetailsOnYourOwn"]),
3684
+ selectVerificationMethod,
3685
+ methodsMetadata,
3686
+ payoutVerificationMethod: data.payoutVerificationMethod
3687
+ }
3688
+ )
3689
+ ] }) : /* @__PURE__ */ jsx(
3690
+ RadioGroupCard,
3691
+ {
3692
+ ...childProps,
3693
+ name: "verificationMethod",
3694
+ options: payoutVerificationMethods,
3695
+ onSelect: selectVerificationMethod,
3696
+ selected: data.payoutVerificationMethod,
3697
+ optionId: (method) => method,
3698
+ optionName: (method) => t(($) => $[methodsMetadata[method].name]),
3699
+ optionDescription: (method) => t(($) => $[methodsMetadata[method].description]),
3700
+ optionSubtitle: (method) => t(($) => $[methodsMetadata[method].subtitle]),
3701
+ className: styles.fieldVerificationMethods,
3702
+ optionClassNames: () => ({
3703
+ label: styles.fieldVerificationMethodsCard
3704
+ }),
3705
+ isOptionDisabled: (option) => bankInfoValidated || option === "instantVerification" && !instantVerificationAvailable,
3706
+ renderOptionIcon: (method) => /* @__PURE__ */ jsx("div", { className: styles.radioGroupCardIllustration, children: /* @__PURE__ */ jsx(
3707
+ PayoutVerificationMethodOptionIcon,
3708
+ {
3709
+ method,
3710
+ methodsMetadata
3711
+ }
3712
+ ) }),
3713
+ renderOptionFooter: (method) => /* @__PURE__ */ jsx(
3714
+ PayoutVerificationMethodOptionFooter,
3715
+ {
3716
+ method,
3717
+ methodsMetadata
3718
+ }
3719
+ ),
3720
+ floatingRadio: true
3721
+ }
3722
+ )
3723
+ }
3724
+ ),
3725
+ /* @__PURE__ */ jsx(
3726
+ ErrorPanel,
3727
+ {
3728
+ verificationErrors: formVerificationErrors,
3729
+ validationErrors: fieldValidationErrors,
3730
+ formUtils,
3731
+ id: "ariaErrorField"
3732
+ }
3733
+ ),
3734
+ provider && bankVendorsLoadingStatus === "success" ? /* @__PURE__ */ jsx(
3735
+ ContextGuidance,
3736
+ {
3737
+ titleId: "howDoesVerificationWithOurPartnerWorks",
3738
+ contentId: "bankVerificationWithPartnerSteps",
3739
+ title: t(($) => $["howDoesVerificationWithOurPartnerWork"], {
3740
+ provider: provider.name
3741
+ }),
3742
+ content: /* @__PURE__ */ jsxs(Fragment, { children: [
3743
+ /* @__PURE__ */ jsx(Typography, { children: t(($) => $["isOurTrustedPartnerHelpingSpeedUpSetup"], {
3744
+ provider: provider.name
3745
+ }) }),
3746
+ /* @__PURE__ */ jsxs("ul", { children: [
3747
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["selectTheBankToReceivePayouts"]) }),
3748
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["loginIntoYourBankingEnvironment"]) }),
3749
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["yourBankWillConfirmYourAccountDetails"]) })
3750
+ ] }),
3751
+ /* @__PURE__ */ jsx(Typography, { children: t(($) => $["adyenWillOnlyGetTemporaryAccess"]) }),
3752
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", children: /* @__PURE__ */ jsx(Link, { href: "https://www.adyen.com/policies-and-disclaimer/privacy-policy", external: true, children: commonT(($) => $["adyenPrivacyPolicy"]) }) })
3753
+ ] })
3754
+ }
3755
+ ) : void 0
3756
+ ] });
3757
+ }
3758
+ const payoutSteps = {
3759
+ payoutCountryDetails: {
3760
+ formId: "payoutCountryDetails",
3761
+ formName: "payoutCountryDetails",
3762
+ fields: payoutCountryDetailsFields
3763
+ },
3764
+ payoutVerificationMethod: {
3765
+ formId: "payoutVerificationMethod",
3766
+ formName: "verificationMethod",
3767
+ fields: payoutVerificationMethodFields
3768
+ },
3769
+ payoutAccountDetails: {
3770
+ formId: "payoutAccountDetails",
3771
+ formName: "bankAccount",
3772
+ fields: payoutAccountFields
3773
+ },
3774
+ payoutAccountDocuments: {
3775
+ formId: "payoutAccountDocuments",
3776
+ formName: "bankDocument",
3777
+ formHeader: "bankDocumentHeader",
3778
+ fields: bankDocumentFields
3779
+ },
3780
+ payoutAccountVerification: {
3781
+ formId: "payoutAccountVerification",
3782
+ formName: "instantVerification",
3783
+ fields: accountVerificationFields
3784
+ }
3785
+ };
3786
+ const PayoutCountryDetailsFormID = payoutSteps.payoutCountryDetails.formId;
3787
+ const PayoutVerificationMethodFormID = payoutSteps.payoutVerificationMethod.formId;
3788
+ const PayoutAccountDocumentsFormID = payoutSteps.payoutAccountDocuments.formId;
3789
+ const PayoutAccountVerificationFormID = payoutSteps.payoutAccountVerification.formId;
3790
+ function PayoutDetails(props) {
3791
+ const { t } = useTranslation("banking");
3792
+ const { t: commonT } = useTranslation("common");
3793
+ const {
3794
+ activeForm,
3795
+ legalEntityResponse,
3796
+ associatedLegalArrangement,
3797
+ provider,
3798
+ bankVendorsLoadingStatus,
3799
+ instantVerificationAvailable,
3800
+ setHideSidebar,
3801
+ setSkipSubmit,
3802
+ createTrustedTransferInstrument: createTrustedTransferInstrument2,
3803
+ accountDetailsFromInput,
3804
+ country,
3805
+ accountHolder,
3806
+ data: propData,
3807
+ onBack,
3808
+ trustedTransferInstrumentId
3809
+ } = props;
3810
+ const [instantVerificationError2, setInstantVerificationError] = useInstantVerificationErrorNotification(1e4);
3811
+ const payoutCountryDetailsFormProps = getFormProps(props, PayoutCountryDetailsFormID);
3812
+ const verificationMethodFormProps = getFormProps(props, PayoutVerificationMethodFormID);
3813
+ const accountVerificationFormProps = getFormProps(props, PayoutAccountVerificationFormID);
3814
+ const payoutAccountFormProps = getFormProps(props, payoutSteps.payoutAccountDetails.formId);
3815
+ const bankDocumentFormProps = getFormProps(props, PayoutAccountDocumentsFormID);
3816
+ const { isExperimentEnabled } = useExperimentsContext();
3817
+ const isCrossBorderPayoutsEnabled = isExperimentEnabled("EnableCrossBorderPayouts");
3818
+ const isBankStatementDocumentOptional = createFormUtils(
3819
+ bankDocumentFormProps ?? {},
3820
+ commonT
3821
+ ).isOptionalField("bankStatementDocument");
3822
+ const globalData = useGlobalData();
3823
+ const data = isEmpty(globalData) || propData?.payoutAccountDetails?.transferInstrumentId ? propData : globalData;
3824
+ const resetData = useResetGlobalData();
3825
+ const verifyInstantly = data?.payoutVerificationMethod?.payoutVerificationMethod === "instantVerification";
3826
+ const bankCountry = (isExperimentEnabled(ExperimentNames.EnableCrossBorderPayouts) ? data?.payoutCountryDetails?.bankCountry : data?.payoutVerificationMethod?.bankCountry) ?? country;
3827
+ useEffect(() => resetData(), [resetData]);
3828
+ useEffect(() => {
3829
+ if (activeForm?.formId === summaryStep.formId && verifyInstantly && trustedTransferInstrumentId) {
3830
+ setSkipSubmit?.(true);
3831
+ }
3832
+ }, [activeForm, trustedTransferInstrumentId]);
3833
+ const [bankInfoValidated, setBankInfoValidated] = useState(false);
3834
+ const [arePayoutAccountDetailsInvalid, setArePayoutAccountDetailsInvalid] = useState(false);
3835
+ const [invalidFieldNames, setInvalidFieldNames] = useState("");
3836
+ const payload = useMemo(
3837
+ () => bankCountry && accountDetailsFromInput ? getAccountIdentificationFromPayoutAccountSchema(
3838
+ accountDetailsFromInput,
3839
+ bankCountry,
3840
+ isCrossBorderPayoutsEnabled
3841
+ ) : {},
3842
+ [accountDetailsFromInput, bankCountry]
3843
+ );
3844
+ const validateAccountDetails = useAsyncAccountDetailsValidationRules(
3845
+ payload,
3846
+ hasEmptyFields(payload),
3847
+ isAccountIdentifierObscured(payload)
3848
+ );
3849
+ const resetInvalidFieldState = () => {
3850
+ setInvalidFieldNames("");
3851
+ setArePayoutAccountDetailsInvalid(false);
3852
+ };
3853
+ useEffect(() => {
3854
+ if (validateAccountDetails?.invalidFields && validateAccountDetails.invalidFields.length > 0) {
3855
+ const fieldNames = validateAccountDetails.invalidFields.map((field) => extractFieldName(field.name)).map((key) => commonT(($) => $[key]));
3856
+ const invalidFieldsString = concatenateFieldNames(fieldNames);
3857
+ setInvalidFieldNames(invalidFieldsString);
3858
+ setArePayoutAccountDetailsInvalid(true);
3859
+ } else {
3860
+ resetInvalidFieldState();
3861
+ }
3862
+ }, [t, validateAccountDetails]);
3863
+ return /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-payout", children: [
3864
+ /* @__PURE__ */ jsx(
3865
+ "div",
3866
+ {
3867
+ className: activeForm?.formId !== "payoutCountryDetails" ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper",
3868
+ children: /* @__PURE__ */ jsx(
3869
+ PayoutCountryDetails,
3870
+ {
3871
+ ...payoutCountryDetailsFormProps,
3872
+ legalEntityResponse,
3873
+ provider
3874
+ }
3875
+ )
3876
+ }
3877
+ ),
3878
+ /* @__PURE__ */ jsx(
3879
+ "div",
3880
+ {
3881
+ className: activeForm?.formId !== PayoutVerificationMethodFormID ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper",
3882
+ children: /* @__PURE__ */ jsx(InstantVerificationErrorContext.Provider, { value: instantVerificationError2, children: /* @__PURE__ */ jsx(
3883
+ PayoutVerificationMethod,
3884
+ {
3885
+ ...verificationMethodFormProps,
3886
+ id: PayoutVerificationMethodFormID,
3887
+ heading: t(($) => $["addABankAccountForPayouts"]),
3888
+ country,
3889
+ accountHolder,
3890
+ legalEntityResponse,
3891
+ provider,
3892
+ bankVendorsLoadingStatus,
3893
+ bankInfoValidated,
3894
+ instantVerificationAvailable
3895
+ }
3896
+ ) })
3897
+ }
3898
+ ),
3899
+ verifyInstantly ? /* @__PURE__ */ jsx(
3900
+ "div",
3901
+ {
3902
+ className: activeForm?.formId !== PayoutAccountVerificationFormID ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper",
3903
+ children: /* @__PURE__ */ jsx(
3904
+ BankVerification,
3905
+ {
3906
+ ...accountVerificationFormProps,
3907
+ heading: t(($) => $["bankAccountVerification"]),
3908
+ id: PayoutAccountVerificationFormID,
3909
+ provider,
3910
+ country: bankCountry,
3911
+ onBack,
3912
+ hideSidebar: setHideSidebar,
3913
+ setBankVerificationError: setInstantVerificationError,
3914
+ bankInfoValidated,
3915
+ setBankInfoValidated,
3916
+ formIsActive: activeForm?.formId === PayoutAccountVerificationFormID,
3917
+ createTrustedTransferInstrument: createTrustedTransferInstrument2
3918
+ }
3919
+ )
3920
+ }
3921
+ ) : /* @__PURE__ */ jsxs(Fragment, { children: [
3922
+ /* @__PURE__ */ jsx(
3923
+ "div",
3924
+ {
3925
+ className: activeForm?.formId !== payoutSteps.payoutAccountDetails.formId ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper",
3926
+ children: /* @__PURE__ */ jsx(
3927
+ PayoutAccount,
3928
+ {
3929
+ ...payoutAccountFormProps,
3930
+ heading: t(($) => $["addABankAccountForPayouts"]),
3931
+ id: payoutSteps.payoutAccountDetails.formId,
3932
+ country: bankCountry,
3933
+ legalEntityResponse,
3934
+ arePayoutAccountDetailsInvalid,
3935
+ invalidFieldNames,
3936
+ preferredCurrencyCode: globalData?.payoutCountryDetails?.preferredCurrency
3937
+ }
3938
+ )
3939
+ }
3940
+ ),
3941
+ /* @__PURE__ */ jsx(
3942
+ "div",
3943
+ {
3944
+ className: activeForm?.formId !== PayoutAccountDocumentsFormID ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper",
3945
+ children: isExperimentEnabled(ExperimentNames.EnableBankDocumentClassification) ? /* @__PURE__ */ jsx(
3946
+ MemoizedBankDocumentClassification,
3947
+ {
3948
+ ...bankDocumentFormProps,
3949
+ id: PayoutAccountDocumentsFormID,
3950
+ legalEntity: legalEntityResponse,
3951
+ associatedLegalArrangement,
3952
+ country: bankCountry,
3953
+ formIsActive: activeForm?.formId === PayoutAccountDocumentsFormID
3954
+ }
3955
+ ) : /* @__PURE__ */ jsx(
3956
+ MemoizedBankDocument,
3957
+ {
3958
+ ...bankDocumentFormProps,
3959
+ heading: t(
3960
+ ($) => $[isBankStatementDocumentOptional ? "uploadABankDocumentOptional" : "uploadABankDocument"]
3961
+ ),
3962
+ description: t(
3963
+ ($) => $[legalEntityResponse.type === "individual" ? "toHelpVerifyYourBankDetailsIndividual" : "toHelpVerifyYourBankDetailsBusiness"]
3964
+ ),
3965
+ id: PayoutAccountDocumentsFormID,
3966
+ legalEntity: legalEntityResponse,
3967
+ associatedLegalArrangement,
3968
+ country: bankCountry,
3969
+ formIsActive: activeForm?.formId === PayoutAccountDocumentsFormID
3970
+ }
3971
+ )
3972
+ }
3973
+ )
3974
+ ] }),
3975
+ /* @__PURE__ */ jsx(Show, { when: showPayoutVerificationMethodError, children: /* @__PURE__ */ jsx(
3976
+ Confirm,
3977
+ {
3978
+ analyticsEventLabel: "payoutVerificationMethodError",
3979
+ title: t(($) => $["toContinuePleaseChooseAVerificationMethod"]),
3980
+ confirmText: commonT(($) => $["ok"]),
3981
+ onConfirm: () => {
3982
+ showPayoutVerificationMethodError.value = false;
3983
+ }
3984
+ }
3985
+ ) }),
3986
+ /* @__PURE__ */ jsx(Show, { when: showInstantVerificationPayoutModal, children: /* @__PURE__ */ jsx(
3987
+ BankVerification,
3988
+ {
3989
+ ...accountVerificationFormProps,
3990
+ heading: t(($) => $["bankAccountVerification"]),
3991
+ id: PayoutAccountVerificationFormID,
3992
+ provider,
3993
+ country: bankCountry,
3994
+ onBack,
3995
+ hideSidebar: setHideSidebar,
3996
+ setBankVerificationError: setInstantVerificationError,
3997
+ bankInfoValidated,
3998
+ setBankInfoValidated,
3999
+ formIsActive: activeForm?.formId === PayoutVerificationMethodFormID,
4000
+ createTrustedTransferInstrument: createTrustedTransferInstrument2
4001
+ }
4002
+ ) })
4003
+ ] });
4004
+ }
4005
+ const rules = ({
4006
+ data,
4007
+ requiredFields,
4008
+ isExperimentEnabled
4009
+ }) => createFormRules({
4010
+ whenUsingManualVerification: () => {
4011
+ if (!data.payoutVerificationMethod) return;
4012
+ if (data?.payoutVerificationMethod?.payoutVerificationMethod === "manualVerification") {
4013
+ return "REQUIRED";
4014
+ }
4015
+ },
4016
+ whenUsingInstantVerification: () => {
4017
+ if (!data.payoutVerificationMethod) {
4018
+ return "REQUIRED";
4019
+ }
4020
+ if (data?.payoutVerificationMethod?.payoutVerificationMethod === "instantVerification") {
4021
+ return "REQUIRED";
4022
+ }
4023
+ },
4024
+ verifiedBankAccountNumber: () => {
4025
+ if (data?.payoutVerificationMethod?.payoutVerificationMethod === "instantVerification") {
4026
+ return "REQUIRED";
4027
+ }
4028
+ },
4029
+ bankStatementRequirement: () => {
4030
+ if (data?.payoutVerificationMethod?.payoutVerificationMethod !== "instantVerification" && (isExperimentEnabled?.("EnableCheckOnCreateBankAccount") || isExperimentEnabled?.("BankVerificationFlowOptimization_CAASIntegration"))) {
4031
+ return "REQUIRED";
4032
+ }
4033
+ if (data?.payoutVerificationMethod?.payoutVerificationMethod === "manualVerification") {
4034
+ return requiredFields?.bankStatementRequirement;
4035
+ }
4036
+ },
4037
+ // "bankStatement description" field is always "optional" and it's coupled with bank statement document.
4038
+ bankStatementDescription: () => {
4039
+ if (data?.payoutVerificationMethod?.payoutVerificationMethod === "manualVerification" && !!requiredFields?.bankStatementRequirement) {
4040
+ return "OPTIONAL";
4041
+ }
4042
+ }
4043
+ });
4044
+ const mapApiDocumentToPayoutDocuments = (entityId) => {
4045
+ const bankStatement = getDocument(entityId, "bankStatement");
4046
+ if (!bankStatement) throw new Error(`bankStatement with id ${entityId} not found`);
4047
+ return {
4048
+ bankStatementDocument: [mapExistingFile(getPageName(bankStatement))],
4049
+ description: bankStatement.description
4050
+ };
4051
+ };
4052
+ const mapPayoutDetailsToTransferInstrument = ({
4053
+ data,
4054
+ legalEntity,
4055
+ enabledCrossBorderPayouts
4056
+ }) => {
4057
+ if (!data.payoutAccountDetails || !data.payoutVerificationMethod) {
4058
+ throw new Error("Missing payout details data");
4059
+ }
4060
+ if (enabledCrossBorderPayouts && !data.payoutCountryDetails) {
4061
+ throw new Error("Missing payout details data");
4062
+ }
4063
+ const bankCountry = enabledCrossBorderPayouts ? data.payoutCountryDetails?.bankCountry : data.payoutVerificationMethod?.bankCountry;
4064
+ const preferredCurrency = enabledCrossBorderPayouts ? data.payoutCountryDetails?.preferredCurrency : void 0;
4065
+ return {
4066
+ bankAccount: mapPayoutAccountSchemaToApiBankAccount(
4067
+ data.payoutAccountDetails,
4068
+ bankCountry,
4069
+ preferredCurrency,
4070
+ enabledCrossBorderPayouts
4071
+ ),
4072
+ legalEntityId: legalEntity.id,
4073
+ type: "bankAccount"
4074
+ };
4075
+ };
4076
+ const mapPayoutDocumentsToApiDocuments = async (data, entityId) => {
4077
+ const { bankStatementDocument, description: description2 } = data.payoutAccountDocuments ?? {};
4078
+ if (!bankStatementDocument) {
4079
+ throw new Error("Bank statement document missing");
4080
+ }
4081
+ const page1 = bankStatementDocument[0];
4082
+ if (!page1) {
4083
+ throw new Error("Document needs at least one page");
4084
+ }
4085
+ const existingDocument = getDocument(entityId, "bankStatement");
4086
+ return await createDocumentRequest({
4087
+ entityId,
4088
+ entityType: "bankAccount",
4089
+ documentType: "bankStatement",
4090
+ page1,
4091
+ description: description2,
4092
+ existingDocument
4093
+ });
4094
+ };
4095
+ const CUSTOM_LABELS = {
4096
+ verifiedAccountHolder: "accountHolder",
4097
+ verifiedBankCountry: "bankCountry",
4098
+ verifiedBankName: "bankName",
4099
+ verifiedCurrencyCode: "currencyCode",
4100
+ verifiedBankAccountNumber: "bankAccountNumber"
4101
+ };
4102
+ const formatAccountVerificationSummary = (data) => {
4103
+ if (!data) return {};
4104
+ const summary = {};
4105
+ keysOf(CUSTOM_LABELS).forEach((key) => {
4106
+ if (!data[key]) return;
4107
+ summary[key] = summaryItem(CUSTOM_LABELS[key], data[key]);
4108
+ });
4109
+ return summary;
4110
+ };
4111
+ const obscuredPayoutFields = ["bankAccountNumber", "iban"];
4112
+ const payoutDetailsCountryConfig = {
4113
+ [CountryCodes.Canada]: {
4114
+ bankStatementDocument: {
4115
+ label: "listitemVoidedChequeBankLetterBankStatementOnline"
4116
+ }
4117
+ },
4118
+ [CountryCodes.UnitedKingdom]: {
4119
+ bankCity: {
4120
+ label: "bankCityTown"
4121
+ },
4122
+ bankStatementDocument: {
4123
+ label: "listitemVoidedChequeBankLetterBankStatementOnline"
4124
+ }
4125
+ }
4126
+ };
4127
+ const parseConfiguration = ({
4128
+ requiredFields,
4129
+ country,
4130
+ bankVerificationAvailable
4131
+ }) => parsePayoutScenarios({
4132
+ requiredFields: requiredFields?.fields,
4133
+ country,
4134
+ bankVerificationAvailable
4135
+ });
4136
+ function parsePayoutScenarios({
4137
+ requiredFields,
4138
+ country,
4139
+ bankVerificationAvailable
4140
+ }) {
4141
+ if (!requiredFields) return {};
4142
+ let formConfig = {
4143
+ payoutVerificationMethod: {
4144
+ rule: "REQUIRED"
4145
+ },
4146
+ bankCountry: {
4147
+ rule: "REQUIRED"
4148
+ },
4149
+ bankStatementDocument: {
4150
+ rule: "bankStatementRequirement"
4151
+ },
4152
+ description: {
4153
+ rule: "bankStatementDescription"
4154
+ }
4155
+ };
4156
+ requiredFields.forEach((fieldName) => {
4157
+ formConfig[fieldName] = {
4158
+ rule: bankVerificationAvailable ? "whenUsingManualVerification" : "REQUIRED",
4159
+ obscured: obscuredPayoutFields.includes(fieldName)
4160
+ };
4161
+ });
4162
+ if (bankVerificationAvailable) {
4163
+ formConfig = {
4164
+ ...formConfig,
4165
+ verifiedAccountHolder: {
4166
+ rule: "whenUsingInstantVerification"
4167
+ },
4168
+ verifiedBankCountry: {
4169
+ rule: "whenUsingInstantVerification"
4170
+ },
4171
+ verifiedBankName: {
4172
+ rule: "whenUsingInstantVerification"
4173
+ },
4174
+ verifiedCurrencyCode: {
4175
+ rule: "whenUsingInstantVerification"
4176
+ },
4177
+ verifiedBankAccountNumber: {
4178
+ rule: "whenUsingInstantVerification"
4179
+ }
4180
+ };
4181
+ }
4182
+ return augmentWithCountryConfigs(payoutDetailsCountryConfig[country], formConfig);
4183
+ }
4184
+ const getAppropriatePayoutDetailsSteps = (isEditing, instantVerificationAvailable, canChangeCountry, isCrossBorderEnabled) => {
4185
+ const dependentSteps = {
4186
+ payoutCountryDetails: payoutSteps.payoutCountryDetails,
4187
+ payoutVerificationMethod: payoutSteps.payoutVerificationMethod,
4188
+ payoutAccountDetails: payoutSteps.payoutAccountDetails,
4189
+ payoutAccountDocuments: payoutSteps.payoutAccountDocuments,
4190
+ payoutAccountVerification: payoutSteps.payoutAccountVerification
4191
+ };
4192
+ if (!isCrossBorderEnabled) {
4193
+ delete dependentSteps["payoutCountryDetails"];
4194
+ }
4195
+ if (isEditing || !instantVerificationAvailable && !canChangeCountry) {
4196
+ delete dependentSteps["payoutVerificationMethod"];
4197
+ }
4198
+ return dependentSteps;
4199
+ };
4200
+ const getInvalidFieldsErrorHeader = (invalidField) => {
4201
+ switch (invalidField) {
4202
+ case "LEGAL_BUSINESS_NAME":
4203
+ case "FIRST_NAME":
4204
+ case "LAST_NAME":
4205
+ return "caasBankAccountHolderDoesNotMatch";
4206
+ default:
4207
+ return "weCouldntCompleteTheAccountCheck";
4208
+ }
4209
+ };
4210
+ const getInvalidFieldsErrorContent = (invalidField) => {
4211
+ switch (invalidField) {
4212
+ case "LEGAL_BUSINESS_NAME":
4213
+ return "caasBankAccountMustBeInYourNameYourBusinessLegalNameOrDoingBusinessAs";
4214
+ case "FIRST_NAME":
4215
+ case "LAST_NAME":
4216
+ return "caasBankAccountMustBeInYourName";
4217
+ default:
4218
+ return "weCouldntCompleteTheAccountCheck";
4219
+ }
4220
+ };
4221
+ const defaultInvalidErrorMessage = {
4222
+ header: "weCouldntCompleteTheAccountCheck",
4223
+ content: "weCouldntCompleteTheAccountCheck"
4224
+ };
4225
+ const getInvalidFieldsErrorMessage = (errors) => {
4226
+ if (!errors || errors.length === 0) {
4227
+ return defaultInvalidErrorMessage;
4228
+ }
4229
+ const [firstError] = errors;
4230
+ const { invalidFields } = firstError;
4231
+ if (!invalidFields || invalidFields.length === 0) {
4232
+ return defaultInvalidErrorMessage;
4233
+ }
4234
+ const [firstInvalidField] = invalidFields;
4235
+ return {
4236
+ header: getInvalidFieldsErrorHeader(firstInvalidField),
4237
+ content: getInvalidFieldsErrorContent(firstInvalidField)
4238
+ };
4239
+ };
4240
+ const getPayoutVerificationMethod = (transferInstrument, instantVerificationEnabled, enabledUnbiasedVerificationMethod) => {
4241
+ if (transferInstrument) {
4242
+ return "manualVerification";
4243
+ } else {
4244
+ return enabledUnbiasedVerificationMethod || !instantVerificationEnabled ? void 0 : "instantVerification";
4245
+ }
4246
+ };
4247
+ const showInstantVerificationPayoutModal = signal(false);
4248
+ function PayoutDetailsDropin({
4249
+ legalEntityResponse,
4250
+ associatedLegalArrangement,
4251
+ problems: propProblems,
4252
+ onSubmit: externalOnSubmit,
4253
+ onChange,
4254
+ asModal = false,
4255
+ handleCloseClick,
4256
+ taskType: propTaskType,
4257
+ handleHomeClick,
4258
+ currentTransferInstrumentId,
4259
+ setCurrentTransferInstrumentId,
4260
+ navigateBackToTaskList,
4261
+ handleBackClick: externalBackClick,
4262
+ hideSidebar,
4263
+ openBankingPartnerConfigId
4264
+ }) {
4265
+ const { baseUrl, rootLegalEntityId } = useApiContext();
4266
+ const {
4267
+ data: transferInstrument,
4268
+ refetch: refetchTransferInstrument,
4269
+ isLoading: isTransferInstrumentLoading
4270
+ } = useTransferInstrument(currentTransferInstrumentId ?? skipToken);
4271
+ const { mutateAsync: handleUpdateTransferInstrument } = useUpdateTransferInstrument();
4272
+ const {
4273
+ mutateAsync: handleCreateTrustedTransferInstrument,
4274
+ status: createTrustedTransferInstrumentStatus
4275
+ } = useCreateTrustedTransferInstrument();
4276
+ const [previousTrustedInstrumentStatus, setPreviousTrustedInstrumentStatus] = useState(
4277
+ createTrustedTransferInstrumentStatus
4278
+ );
4279
+ const { t, i18n: i18next } = useTranslation("banking");
4280
+ const { t: commonT } = useTranslation("common");
4281
+ const userEvents = useAnalyticsContext();
4282
+ const { showToast, clearToasts } = useToastContext();
4283
+ const { isExperimentEnabled } = useExperimentsContext();
4284
+ const { isSettingEnabled } = useSettingsContext();
4285
+ const enabledCrossBorderPayouts = isExperimentEnabled(ExperimentNames.EnableCrossBorderPayouts);
4286
+ const defaultPayoutCountry = getLegalEntityCountry(legalEntityResponse);
4287
+ const existingPayoutDetails = useMemo(
4288
+ () => transferInstrument ? mapTransferInstrumentToPayoutAccount(transferInstrument, enabledCrossBorderPayouts) : void 0,
4289
+ [transferInstrument]
4290
+ );
4291
+ const [documents, setDocuments] = useState();
4292
+ const [isCaasCalled, setIsCaasCalled] = useState(false);
4293
+ const enableCheckOnCreateBankAccount = isExperimentEnabled("EnableCheckOnCreateBankAccount") || isExperimentEnabled("BankVerificationFlowOptimization_CAASIntegration");
4294
+ const enabledUnbiasedVerificationMethod = isExperimentEnabled(
4295
+ "BankVerificationMethodAutonomy_UnbiasedSelection"
4296
+ );
4297
+ const isPayoutVerificationMethodPageRedesignEnabled = isExperimentEnabled(
4298
+ ExperimentNames.EnablePayoutVerificationMethodPageRedesign
4299
+ );
4300
+ const accountHolder = getPayoutAccountHolderName(legalEntityResponse, t);
4301
+ const fallbackCurrency = currencyByCountry[defaultPayoutCountry]?.[0];
4302
+ const accountHolderName = accountHolder || getLegalEntityNameBasedOnType(legalEntityResponse);
4303
+ const instantVerificationEnabled = Boolean(
4304
+ !isTransferInstrumentLoading && !transferInstrument && isSettingEnabled("instantBankVerification")
4305
+ );
4306
+ const taskType = propTaskType ?? TaskTypes.PAYOUT;
4307
+ const [trustedTransferInstrumentId, setTrustedTransferInstrumentId] = useState();
4308
+ const prefilledData = {
4309
+ payoutCountryDetails: {
4310
+ bankCountry: existingPayoutDetails?.payoutCountryDetails?.bankCountry ?? defaultPayoutCountry,
4311
+ preferredCurrency: existingPayoutDetails?.payoutCountryDetails?.preferredCurrency
4312
+ },
4313
+ payoutAccountDetails: {
4314
+ accountHolder: accountHolderName,
4315
+ currency: fallbackCurrency,
4316
+ ...existingPayoutDetails?.payoutAccountDetails
4317
+ },
4318
+ payoutVerificationMethod: {
4319
+ payoutVerificationMethod: getPayoutVerificationMethod(
4320
+ transferInstrument,
4321
+ instantVerificationEnabled,
4322
+ enabledUnbiasedVerificationMethod
4323
+ ),
4324
+ bankCountry: defaultPayoutCountry,
4325
+ ...existingPayoutDetails?.payoutVerificationMethod
4326
+ },
4327
+ payoutAccountVerification: {
4328
+ verifiedAccountHolder: accountHolderName,
4329
+ verifiedBankCountry: defaultPayoutCountry,
4330
+ ...existingPayoutDetails?.payoutAccountVerification
4331
+ }
4332
+ };
4333
+ const documentUtils = documentApiUtils({
4334
+ baseUrl: baseUrl.value,
4335
+ rootLegalEntityId: rootLegalEntityId.value
4336
+ });
4337
+ const {
4338
+ state: { currentState }
4339
+ } = useStateContext();
4340
+ const formValidity = currentState.validityByForm;
4341
+ const bankAccountCountry = (enabledCrossBorderPayouts ? currentState?.data?.payoutCountryDetails?.bankCountry : currentState?.data?.payoutVerificationMethod?.bankCountry) ?? defaultPayoutCountry;
4342
+ const [hideFooterAndSidebar, setHideFooterAndSidebar] = useState(false);
4343
+ const [skipSubmit, setSkipSubmit] = useState(false);
4344
+ const [loadingStatus, setLoadingStatus] = useState("loading");
4345
+ const [isSubmitting, setIsSubmitting] = useState(false);
4346
+ const [configurationLoadingStatus, setConfigurationLoadingStatus] = useState("loading");
4347
+ const [data, setData] = useState(prefilledData);
4348
+ const [problems, setProblems] = useState(
4349
+ propProblems || (transferInstrument?.id ? getCapabilityProblems(legalEntityResponse, bankAccountCountry)?.BankAccount?.[transferInstrument.id] : void 0)
4350
+ );
4351
+ const [accountDetailsFromInput, setAccountDetailsFromInput] = useState(
4352
+ prefilledData.payoutAccountDetails
4353
+ );
4354
+ const isMaskedBankAccountNumber = data.payoutAccountDetails?.bankAccountNumber?.includes("*") || data.payoutAccountDetails?.iban?.includes("*");
4355
+ const existingBankAccountFormat = transferInstrument ? transferInstrument?.bankAccount?.accountIdentification?.type === "numberAndBic" ? "numberAndBic" : existingPayoutDetails?.payoutAccountDetails?.iban ? "iban" : "local" : void 0;
4356
+ const checkAsAServiceAnalyticsProps = {
4357
+ "Experiment name": ExperimentNames.BankVerificationFlowOptimization_CAASIntegration,
4358
+ "Experiment value": enableCheckOnCreateBankAccount ? "TREATMENT" : "CONTROL"
4359
+ };
4360
+ useEffect(() => {
4361
+ userEvents.updateBaseTrackingPayload({ task: taskType });
4362
+ userEvents.addTaskEvent("Landed on page", {
4363
+ actionType: "start",
4364
+ ...checkAsAServiceAnalyticsProps
4365
+ });
4366
+ }, []);
4367
+ useEffect(() => {
4368
+ setData({
4369
+ ...currentState.data,
4370
+ payoutAccountDetails: {
4371
+ ...currentState.data?.payoutAccountDetails,
4372
+ currency: currencyByCountry[bankAccountCountry]?.[0]
4373
+ }
4374
+ });
4375
+ onChange?.(currentState);
4376
+ }, [bankAccountCountry, currentState, onChange]);
4377
+ const {
4378
+ data: providers,
4379
+ refetch: refetchBankVerificationProviders,
4380
+ status: bankVendorsLoadingStatus
4381
+ } = useBankVerificationProviders(
4382
+ {
4383
+ country: bankAccountCountry,
4384
+ configId: openBankingPartnerConfigId,
4385
+ locale: i18next.language
4386
+ },
4387
+ {
4388
+ enabled: instantVerificationEnabled
4389
+ }
4390
+ );
4391
+ const instantVerificationAvailable = useMemo(
4392
+ () => Boolean(instantVerificationEnabled && providers?.[0]?.redirectUrl),
4393
+ [instantVerificationEnabled, providers]
4394
+ );
4395
+ const getPayoutAccountFormatData = useCallback(
4396
+ async () => getAccountFormatsForCountry(bankAccountCountry),
4397
+ [bankAccountCountry]
4398
+ );
4399
+ const { fieldConfigurations, requiredFields } = useScenarioConfiguration({
4400
+ parseConfiguration,
4401
+ legalEntityType: legalEntityResponse.type,
4402
+ getPayoutAccountFormatData,
4403
+ instantVerificationAvailable,
4404
+ setLoadingStatus: setConfigurationLoadingStatus,
4405
+ country: bankAccountCountry,
4406
+ existingBankAccountFormat
4407
+ });
4408
+ const fieldsFromCustomRules = useMemo(
4409
+ () => rules({
4410
+ data,
4411
+ requiredFields,
4412
+ isExperimentEnabled
4413
+ }),
4414
+ [bankAccountCountry, data, taskType, isExperimentEnabled]
4415
+ );
4416
+ const apiBankAccount = useMemo(() => {
4417
+ const payoutAccountDetails = data.payoutAccountDetails ?? { bankAccountNumber: "" };
4418
+ return mapPayoutAccountSchemaToApiBankAccount(payoutAccountDetails, bankAccountCountry);
4419
+ }, [data, bankAccountCountry]);
4420
+ const {
4421
+ data: checkAsAServiceData,
4422
+ refetch: refetchCheckAsAService,
4423
+ isLoading: isCheckAsAServiceLoading,
4424
+ isError: isCheckAsAServiceError
4425
+ } = useCheck(apiBankAccount.accountIdentification, {
4426
+ enabled: false
4427
+ });
4428
+ const checkAsAServiceResultStatus = checkAsAServiceData?.status;
4429
+ const checkAsAServiceResultErrors = checkAsAServiceData?.errors;
4430
+ const provider = providers?.[0];
4431
+ const isInstantVerificationFlow = data.payoutVerificationMethod?.payoutVerificationMethod === "instantVerification";
4432
+ const [isModalOpen, setIsModalOpen] = useState(false);
4433
+ const payoutDetailsSteps = useMemo(() => {
4434
+ const appropriatePayoutDetailsSteps = getAppropriatePayoutDetailsSteps(
4435
+ Boolean(prefilledData?.payoutAccountDetails?.transferInstrumentId),
4436
+ instantVerificationAvailable,
4437
+ isSettingEnabled(SettingNames.AllowIntraRegionCrossBorderPayout),
4438
+ enabledCrossBorderPayouts
4439
+ );
4440
+ if (enableCheckOnCreateBankAccount && !isCheckAsAServiceError && (checkAsAServiceResultStatus === "VALID" || checkAsAServiceResultStatus === void 0) && !isMaskedBankAccountNumber) {
4441
+ delete appropriatePayoutDetailsSteps[payoutSteps.payoutAccountDocuments.formId];
4442
+ }
4443
+ return appropriatePayoutDetailsSteps;
4444
+ }, [
4445
+ providers,
4446
+ enableCheckOnCreateBankAccount,
4447
+ checkAsAServiceResultStatus,
4448
+ isCheckAsAServiceError,
4449
+ isMaskedBankAccountNumber
4450
+ ]);
4451
+ const derivedProps = useMemo(() => {
4452
+ return getPropsFromConfigurations({
4453
+ scenarioConfiguration: fieldConfigurations,
4454
+ forms: payoutDetailsSteps,
4455
+ remediationActions: problems?.remediationActions ? Object.values(problems?.remediationActions) : [],
4456
+ dataMissingErrors: problems?.missingData ?? [],
4457
+ fieldsWithExistingData: [],
4458
+ customRules: fieldsFromCustomRules,
4459
+ legalEntityType: legalEntityResponse.type
4460
+ });
4461
+ }, [
4462
+ fieldConfigurations,
4463
+ payoutDetailsSteps,
4464
+ problems?.remediationActions,
4465
+ problems?.missingData,
4466
+ fieldsFromCustomRules,
4467
+ legalEntityResponse.type
4468
+ ]);
4469
+ useUnifyLoadingStatus(
4470
+ setLoadingStatus,
4471
+ configurationLoadingStatus,
4472
+ // bank vendor loading status only matters when we fetch bank vendors
4473
+ instantVerificationEnabled ? bankVendorsLoadingStatus : "success",
4474
+ isSubmitting ? "loading" : "success"
4475
+ );
4476
+ const forms = useMemo(() => {
4477
+ const requiredForms = getRequiredForms(
4478
+ payoutDetailsSteps,
4479
+ derivedProps?.requiredFields,
4480
+ derivedProps?.optionalFields
4481
+ );
4482
+ return addValidityToForms(requiredForms, formValidity, problems);
4483
+ }, [derivedProps, formValidity, problems, payoutDetailsSteps]);
4484
+ useEffect(() => {
4485
+ if (!transferInstrument?.documentDetails?.length) return;
4486
+ if (transferInstrument.id) {
4487
+ documentUtils.fetchDocuments(transferInstrument.documentDetails, transferInstrument.id).then(() => {
4488
+ setDocuments(mapApiDocumentToPayoutDocuments(transferInstrument.id));
4489
+ }).catch(() => {
4490
+ showToast({
4491
+ label: commonT(($) => $["failedToFetchRelevantDocuments"]),
4492
+ variant: "error"
4493
+ });
4494
+ });
4495
+ }
4496
+ }, [transferInstrument?.documentDetails]);
4497
+ const submitDocuments = async ({
4498
+ forms: forms2,
4499
+ transferInstrument: transferInstrument2,
4500
+ dataSubmitted
4501
+ }) => {
4502
+ const isRequiredDocuments = isDocumentsRequired(forms2);
4503
+ if (isRequiredDocuments) {
4504
+ const documentToUpload = await mapPayoutDocumentsToApiDocuments(
4505
+ dataSubmitted,
4506
+ transferInstrument2.id
4507
+ );
4508
+ if (documentToUpload) {
4509
+ try {
4510
+ const documents2 = await documentUtils.uploadDocuments(
4511
+ [documentToUpload],
4512
+ transferInstrument2.id
4513
+ );
4514
+ documents2.forEach((document2) => {
4515
+ userEvents.addTaskEvent("Success", {
4516
+ actionType: "upload",
4517
+ documentType: dataSubmitted.payoutAccountDocuments?.documentType ?? document2.type,
4518
+ // tracks BankDocumentTypes
4519
+ fileExtention: document2.attachments?.map((item) => getFileExtention(item.pageName ?? "")).filter((item) => item !== void 0) ?? void 0
4520
+ });
4521
+ });
4522
+ } catch {
4523
+ setProblems({
4524
+ ...problems,
4525
+ validationErrors: {
4526
+ payoutAccountDocuments: { bankStatementDocument: true }
4527
+ }
4528
+ });
4529
+ throw new Error(commonT(($) => $["remediationMessage_1_704"]));
4530
+ } finally {
4531
+ await refetchTransferInstrument?.();
4532
+ }
4533
+ }
4534
+ }
4535
+ };
4536
+ useEffect(() => {
4537
+ const payoutAccountData = cloneObject(data)?.payoutAccountDetails;
4538
+ if (payoutAccountData) setAccountDetailsFromInput(payoutAccountData);
4539
+ }, [data]);
4540
+ const onSubmit = async () => {
4541
+ setIsSubmitting(true);
4542
+ const dataSubmitted = cloneObject(data);
4543
+ const { payoutAccountDetails, payoutVerificationMethod } = dataSubmitted;
4544
+ const baseTracking = {
4545
+ actionType: "submit",
4546
+ documentType: "bankStatement",
4547
+ bankCountry: payoutVerificationMethod?.bankCountry ?? defaultPayoutCountry,
4548
+ bankCurrency: payoutAccountDetails?.currency ?? null
4549
+ };
4550
+ let transferInstrumentFromInput = mapPayoutDetailsToTransferInstrument({
4551
+ data: dataSubmitted,
4552
+ legalEntity: legalEntityResponse,
4553
+ enabledCrossBorderPayouts
4554
+ });
4555
+ transferInstrumentFromInput = omitObscuredFieldsIfUnchanged(
4556
+ ["bankAccount.accountIdentification.accountNumber", "bankAccount.accountIdentification.iban"],
4557
+ transferInstrumentFromInput,
4558
+ transferInstrument
4559
+ );
4560
+ try {
4561
+ if (!transferInstrumentFromInput) return;
4562
+ const response = await (transferInstrument ? handleUpdateTransferInstrument({
4563
+ transferInstrument: transferInstrumentFromInput,
4564
+ transferInstrumentId: transferInstrument.id
4565
+ }) : createTransferInstrument(
4566
+ rootLegalEntityId.value,
4567
+ baseUrl.value,
4568
+ transferInstrumentFromInput
4569
+ ));
4570
+ setCurrentTransferInstrumentId?.(response?.id);
4571
+ userEvents.addTaskEvent("Success", {
4572
+ ...baseTracking,
4573
+ ...checkAsAServiceAnalyticsProps
4574
+ });
4575
+ try {
4576
+ await submitDocuments({ forms, transferInstrument: response, dataSubmitted });
4577
+ clearToasts();
4578
+ externalOnSubmit?.({ ...dataSubmitted, id: response?.id });
4579
+ } catch (e) {
4580
+ showToast({ label: e.message, variant: "error" });
4581
+ } finally {
4582
+ setIsSubmitting(false);
4583
+ }
4584
+ } catch (e) {
4585
+ if (isValidationError(e)) {
4586
+ const validationErrors = processValidationErrors(e, taskType);
4587
+ setProblems({ ...problems, validationErrors });
4588
+ } else if (isIdDocumentUploadError(e)) {
4589
+ showToast({ label: t(($) => $["idDocumentAlreadyUploaded"]), variant: "error" });
4590
+ } else if (isBankStatementUploadError(e)) {
4591
+ showToast({ label: t(($) => $["bankStatementAlreadyUploaded"]), variant: "error" });
4592
+ } else if (isMaintenanceModeError(e)) {
4593
+ showToast({
4594
+ label: commonT(($) => $["maintenanceModeMessage"]),
4595
+ variant: "error",
4596
+ duration: "indefinite"
4597
+ });
4598
+ } else {
4599
+ const errorTranslatable = mapCreateOrUpdateTransferInstrumentErrorMessageToTranslatable(e);
4600
+ showToast({ label: commonT(($) => $[errorTranslatable]), variant: "error" });
4601
+ }
4602
+ setIsSubmitting(false);
4603
+ userEvents.addTaskEvent("Encountered error", {
4604
+ ...baseTracking,
4605
+ returnType: e?.errorCode || "backend",
4606
+ returnValue: e?.title || e?.message,
4607
+ ...checkAsAServiceAnalyticsProps
4608
+ });
4609
+ }
4610
+ };
4611
+ const isDocumentsRequired = (forms2) => forms2.some((form) => form.formId === payoutSteps.payoutAccountDocuments.formId);
4612
+ const formatFileSummaryData = (bankDocuments) => {
4613
+ const bankStatementDocument = bankDocuments?.bankStatementDocument?.[0];
4614
+ return {
4615
+ documentType: bankDocuments?.documentType && commonT(($) => $[bankDocuments?.documentType]),
4616
+ fileName: bankStatementDocument?.name,
4617
+ description: bankDocuments?.description
4618
+ };
4619
+ };
4620
+ const canSubmit = () => {
4621
+ if (isInstantVerificationFlow) {
4622
+ return false;
4623
+ }
4624
+ const bankDetails = data.payoutAccountDetails;
4625
+ return !isEmpty(bankDetails) && Object.values(bankDetails).every(Boolean);
4626
+ };
4627
+ const datasetUtils = datasetUtilities(i18next.language);
4628
+ const formatDataForSummary = () => {
4629
+ const summaryData = cloneObject(data);
4630
+ summaryData.payoutAccountDetails.accountHolder = accountHolderName;
4631
+ if (summaryData.payoutVerificationMethod?.bankCountry && summaryData.payoutAccountDetails) {
4632
+ summaryData.payoutAccountDetails.bankCountry = datasetUtils.getCountryName(
4633
+ summaryData.payoutVerificationMethod.bankCountry
4634
+ );
4635
+ }
4636
+ if (summaryData.payoutAccountDocuments) {
4637
+ summaryData.payoutAccountDocuments = formatFileSummaryData(data?.payoutAccountDocuments);
4638
+ }
4639
+ summaryData.payoutAccountVerification = formatAccountVerificationSummary(
4640
+ data.payoutAccountVerification
4641
+ );
4642
+ return summaryData;
4643
+ };
4644
+ const createTrustedTransferInstrumentHandler = async (code, state) => {
4645
+ try {
4646
+ const trustedTransferInstrument = await handleCreateTrustedTransferInstrument({
4647
+ code,
4648
+ state
4649
+ });
4650
+ if (trustedTransferInstrument) {
4651
+ setTrustedTransferInstrumentId(trustedTransferInstrument.verificationReference);
4652
+ return trustedTransferInstrument;
4653
+ }
4654
+ } catch (e) {
4655
+ refetchBankVerificationProviders();
4656
+ const errorTranslatable = mapCreateOrUpdateTransferInstrumentErrorMessageToTranslatable(e);
4657
+ if (errorTranslatable === "transferInstrumentLimitHasAlreadyBeenMet") {
4658
+ showToast({ label: commonT(($) => $[errorTranslatable]), variant: "error" });
4659
+ }
4660
+ throw e;
4661
+ }
4662
+ };
4663
+ const {
4664
+ handleNextClick,
4665
+ handleBackClick,
4666
+ activeForm,
4667
+ setShouldValidate,
4668
+ gotoFormByFormIndex,
4669
+ steps
4670
+ } = useFormComposer({
4671
+ problems,
4672
+ forms,
4673
+ externalBackClick,
4674
+ navigationTrackingParams: {
4675
+ ...checkAsAServiceAnalyticsProps
4676
+ },
4677
+ onSubmit: skipSubmit ? async () => {
4678
+ if (enabledCrossBorderPayouts && trustedTransferInstrumentId) {
4679
+ try {
4680
+ await handleUpdateTransferInstrument({
4681
+ transferInstrument: {
4682
+ legalEntityId: rootLegalEntityId.value,
4683
+ bankAccount: {
4684
+ preferredCurrencyCode: data.payoutCountryDetails?.preferredCurrency,
4685
+ trustedSource: true
4686
+ },
4687
+ type: "bankAccount"
4688
+ },
4689
+ transferInstrumentId: trustedTransferInstrumentId
4690
+ });
4691
+ } catch {
4692
+ showToast({ label: commonT(($) => $["failedToUpdateDetails"]), variant: "error" });
4693
+ }
4694
+ }
4695
+ if (trustedTransferInstrumentId) {
4696
+ externalOnSubmit?.({ ...data, id: trustedTransferInstrumentId });
4697
+ }
4698
+ userEvents.addTaskEvent("Success", {
4699
+ actionType: "submit"
4700
+ });
4701
+ navigateBackToTaskList?.();
4702
+ } : onSubmit
4703
+ });
4704
+ useEffect(() => {
4705
+ if (isCaasCalled && forms) {
4706
+ if (checkAsAServiceResultStatus !== "VALID") {
4707
+ const formIndex = forms.findIndex((f) => f.formId === "payoutAccountDocuments");
4708
+ if (formIndex > -1) {
4709
+ gotoFormByFormIndex(formIndex);
4710
+ }
4711
+ }
4712
+ if (checkAsAServiceResultStatus === "VALID") {
4713
+ handleNextClick();
4714
+ }
4715
+ }
4716
+ setIsCaasCalled(false);
4717
+ }, [forms, checkAsAServiceResultStatus, isCaasCalled]);
4718
+ const handleFormNextClick = async () => {
4719
+ if (isPayoutVerificationMethodPageRedesignEnabled && activeForm.formId === "payoutVerificationMethod") {
4720
+ if (isInstantVerificationFlow) {
4721
+ showInstantVerificationPayoutModal.value = true;
4722
+ return;
4723
+ } else {
4724
+ handleNextClick();
4725
+ }
4726
+ }
4727
+ if (!data?.payoutVerificationMethod?.payoutVerificationMethod) {
4728
+ showPayoutVerificationMethodError.value = true;
4729
+ return;
4730
+ }
4731
+ if (enableCheckOnCreateBankAccount && activeForm.formId === "payoutAccountDetails" && activeForm.isValid && data.payoutAccountDetails && !isMaskedBankAccountNumber) {
4732
+ try {
4733
+ const { data: response } = await refetchCheckAsAService();
4734
+ setIsCaasCalled(true);
4735
+ if (response?.status === "INCOMPLETE_INPUT") {
4736
+ setIsModalOpen(true);
4737
+ }
4738
+ } catch {
4739
+ handleNextClick();
4740
+ }
4741
+ } else {
4742
+ handleNextClick();
4743
+ }
4744
+ };
4745
+ if (previousTrustedInstrumentStatus !== createTrustedTransferInstrumentStatus) {
4746
+ if (activeForm.formId === "payoutAccountVerification" && activeForm.isValid && createTrustedTransferInstrumentStatus === "success" && data.payoutAccountVerification?.verifiedBankAccountNumber) {
4747
+ handleNextClick();
4748
+ setPreviousTrustedInstrumentStatus(createTrustedTransferInstrumentStatus);
4749
+ }
4750
+ if (isExperimentEnabled(ExperimentNames.EnablePayoutVerificationMethodPageRedesign) && activeForm.formId === "payoutVerificationMethod" && createTrustedTransferInstrumentStatus === "success") {
4751
+ gotoFormByFormIndex(forms.length - 1);
4752
+ setPreviousTrustedInstrumentStatus(createTrustedTransferInstrumentStatus);
4753
+ }
4754
+ }
4755
+ const omittedForms = data?.payoutVerificationMethod?.payoutVerificationMethod === "instantVerification" ? [] : [payoutSteps.payoutVerificationMethod.formId];
4756
+ const { header: invalidFieldHeader, content: invalidFieldContent } = getInvalidFieldsErrorMessage(
4757
+ checkAsAServiceResultErrors ?? []
4758
+ );
4759
+ return /* @__PURE__ */ jsxs(
4760
+ LoaderWrapper,
4761
+ {
4762
+ showSpinner: true,
4763
+ status: isCheckAsAServiceLoading || isModalOpen || createTrustedTransferInstrumentStatus === "pending" ? "loading" : "success",
4764
+ formOpacityWhenLoading: 0.3,
4765
+ children: [
4766
+ isModalOpen && /* @__PURE__ */ jsx(
4767
+ Confirm,
4768
+ {
4769
+ title: t(($) => $[invalidFieldHeader]),
4770
+ description: t(($) => $[invalidFieldContent]),
4771
+ cancelText: commonT(($) => $["editDetails"]),
4772
+ confirmText: t(($) => $["continueAnyway"]),
4773
+ onConfirm: () => {
4774
+ handleNextClick();
4775
+ setIsModalOpen(false);
4776
+ },
4777
+ onCancel: () => {
4778
+ gotoFormByFormIndex(0);
4779
+ setIsModalOpen(false);
4780
+ }
4781
+ }
4782
+ ),
4783
+ /* @__PURE__ */ jsx(
4784
+ FormWrapper,
4785
+ {
4786
+ taskName: taskType === TaskTypes.PAYIN ? "payinDetails" : "payoutDetails",
4787
+ activeForm,
4788
+ summary: {
4789
+ data: formatDataForSummary(),
4790
+ omitted: {
4791
+ keys: ["transferInstrumentId", "payoutVerificationMethod"],
4792
+ forms: omittedForms,
4793
+ summaryEditButton: ["payoutVerificationMethod"]
4794
+ }
4795
+ },
4796
+ handleBackClick: !isPayoutVerificationMethodPageRedesignEnabled || activeForm.formId !== "summary" ? handleBackClick : void 0,
4797
+ handleNextClick: handleFormNextClick,
4798
+ handleHomeClick,
4799
+ handleCloseClick,
4800
+ hideSidebar: hideSidebar || hideFooterAndSidebar,
4801
+ hideFooter: hideFooterAndSidebar,
4802
+ loadingStatus: isTransferInstrumentLoading ? "loading" : loadingStatus,
4803
+ asModal,
4804
+ forms,
4805
+ onSubmit,
4806
+ gotoFormByFormIndex,
4807
+ validateForm: () => setShouldValidate(true),
4808
+ canSubmit: canSubmit(),
4809
+ problems,
4810
+ steps,
4811
+ children: (!isTransferInstrumentLoading || isSubmitting) && /* @__PURE__ */ jsx(
4812
+ PayoutDetails,
4813
+ {
4814
+ ...derivedProps,
4815
+ data: { ...prefilledData, payoutAccountDocuments: documents },
4816
+ country: defaultPayoutCountry,
4817
+ activeForm,
4818
+ onBack: handleBackClick,
4819
+ accountHolder: accountHolder ?? getLegalEntityNameBasedOnType(legalEntityResponse),
4820
+ setHideSidebar: setHideFooterAndSidebar,
4821
+ setSkipSubmit,
4822
+ legalEntityResponse,
4823
+ associatedLegalArrangement,
4824
+ provider,
4825
+ bankVendorsLoadingStatus,
4826
+ instantVerificationAvailable,
4827
+ createTrustedTransferInstrument: createTrustedTransferInstrumentHandler,
4828
+ accountDetailsFromInput,
4829
+ trustedTransferInstrumentId
4830
+ }
4831
+ )
4832
+ }
4833
+ )
4834
+ ]
4835
+ }
4836
+ );
4837
+ }
4838
+ export {
4839
+ PayoutDetailsDropin as P,
4840
+ PayoutDetailsPage$1 as a
4841
+ };