@adyen/kyc-components 4.0.0-beta.5 → 4.0.0-beta.7

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 (453) hide show
  1. package/dist/{AcceptTermsOfServiceComponent-Bjj3cdYk.js → AcceptTermsOfServiceComponent-BPD80NBV.js} +43 -15
  2. package/dist/{AccountSetupRejected-CSQTnRkO.js → AccountSetupRejected-DMxK6_NZ.js} +6 -4
  3. package/dist/Address-BxCJg97r.js +1076 -0
  4. package/dist/Alert-JxANwoOi.js +231 -0
  5. package/dist/{Avatar-DL_WbHEO.js → Avatar-BEsogKxf.js} +2 -2
  6. package/dist/BusinessDetailsDropin-3EfuXcxm.js +5088 -0
  7. package/dist/BusinessFinancingComponent-C7-oATO_.js +45 -0
  8. package/dist/{BusinessFinancingDropin-MrOVSlPu.js → BusinessFinancingDropin-Cszqojtx.js} +51 -26
  9. package/dist/BusinessFinancingPage-BcmQhmS2.js +40 -0
  10. package/dist/{BusinessTypeSelectionPage-DJ5bfr8m.js → BusinessTypeSelectionPage-CkX2PhOw.js} +9 -5
  11. package/dist/Card-DPXJw_ou.js +145 -0
  12. package/dist/Confirm-C6hGSEWi.js +64 -0
  13. package/dist/{ContractViewer-z3KbE1Vf.js → ContractViewer-Byp71k2e.js} +34 -46
  14. package/dist/CountryField-ziRVRc5r.js +864 -0
  15. package/dist/CreateIndividualComponent-C87nTEy0.js +72 -0
  16. package/dist/CreateTransferInstrumentComponent-BH92eRcz.js +67 -0
  17. package/dist/Currency-DAbA2YTu.js +238 -0
  18. package/dist/{CustomerSupport-CUPUElh7.js → CustomerSupport-C2Ugl1ZJ.js} +10 -6
  19. package/dist/{DebugModal-BC-xS3Y1.js → DebugModal-BiGsN2MR.js} +8 -5
  20. package/dist/DecisionMakerDetailsPage-BKqkZ5TL.js +100 -0
  21. package/dist/{DecisionMakers-5m_hI3ko.js → DecisionMakers-Dfub_FaY.js} +247 -134
  22. package/dist/DetailViewLayout-Z9cuUp4X.js +65 -0
  23. package/dist/Dropzone-DwdkWB-s.js +218 -0
  24. package/dist/{EmbeddedStatus-8yA_zZvi.js → EmbeddedStatus-C2FaB1kG.js} +4 -4
  25. package/dist/EndStateLayout-BhU2LTbj.js +71 -0
  26. package/dist/{FormFlow-6j8qCSuK.js → FormFlow-BaU8ND7m.js} +8 -2
  27. package/dist/FormNavigation-BAN7IHi5.js +162 -0
  28. package/dist/{IndividualOnfidoDropin-B0G_nHXY.js → IndividualOnfidoDropin-ZdnLLkuv.js} +3240 -258
  29. package/dist/InputDate-DgqNliIM.js +43 -0
  30. package/dist/InputGroup-WBfGDV5F.js +32 -0
  31. package/dist/InputText-CufyDwPI.js +161 -0
  32. package/dist/{Introduction-aPZmTW68.js → Introduction-BMLVCUN7.js} +58 -4
  33. package/dist/LegalRepresentativeDetailsPage-Z1TS1eMK.js +61 -0
  34. package/dist/Link-D6KEr49t.js +35 -0
  35. package/dist/ManageIndividualComponent-B0P2UcYb.js +47 -0
  36. package/dist/ManageTermsOfServiceComponent-BVGYJlbf.js +47 -0
  37. package/dist/{ManageTransferInstrumentComponent-Ds1QZxxR.js → ManageTransferInstrumentComponent-BLOM9_st.js} +37 -42
  38. package/dist/MaskedInput-CMGa4-AZ.js +799 -0
  39. package/dist/MaybeModal-C32AiZaM.js +25 -0
  40. package/dist/Modal-BvBRzt44.js +136 -0
  41. package/dist/{OnboardingDropinComponent-DLvTQVTE.js → OnboardingDropinComponent-BdhXxmZJ.js} +235 -90
  42. package/dist/PayoutDetailsDropin-CFOc-3Cg.js +3694 -0
  43. package/dist/RadioGroup-CnXRr_Ap.js +143 -0
  44. package/dist/RegistrationAddress-C48VQay3.js +2334 -0
  45. package/dist/{Review-DEeOefPe.js → Review-Dp8VRYjm.js} +8 -4
  46. package/dist/{RootBusinessDetailsPage-B2VBJ6x2.js → RootBusinessDetailsPage-C9oZvSeQ.js} +66 -44
  47. package/dist/RootIndividualDetailsPage-BHTLpnk6.js +77 -0
  48. package/dist/SignPCIComponent-Mtb9Ipxw.js +294 -0
  49. package/dist/{SingpassSelection--f8TDTJH.js → SingpassSelection-C5WwyGgd.js} +19 -11
  50. package/dist/SoleProprietorshipPage-Dweeg8jm.js +50 -0
  51. package/dist/{SourceOfFundsPage-avNGxkCP.js → SourceOfFundsPage-PEf5WB77.js} +49 -32
  52. package/dist/Spacer-BK3jDget.js +18 -0
  53. package/dist/StepProgressIndicator-D-k_XSe0.js +78 -0
  54. package/dist/StoreProvider-_YW7glEh.js +7072 -0
  55. package/dist/StructuredList-DaepaiVE.js +38 -0
  56. package/dist/{TaskItemStatus-DMPUHtWU.js → TaskItemStatus-3Xrr8mL4.js} +4 -3
  57. package/dist/{TaskStatusIndicator-Bfc4X_jG.js → TaskStatusIndicator-B1ZRr1qx.js} +3 -3
  58. package/dist/TaxInformationField-Cc4iBLBk.js +3062 -0
  59. package/dist/{TaxReportingDropin-B7FXPbLq.js → TaxReportingDropin-yiL_vTaE.js} +28 -17
  60. package/dist/{TileGroup-DUoq3Lh4.js → TileGroup-C0Rfm3yy.js} +4 -2
  61. package/dist/{TrustDetailsPage-J4MShc8J.js → TrustDetailsPage-D_ZIBi6O.js} +506 -19
  62. package/dist/TrustMemberCompanyPage-DkzAv8u6.js +60 -0
  63. package/dist/TrustMemberIndividualPage-DXWrDuq4.js +66 -0
  64. package/dist/UnincorporatedPartnershipIndividualPage-B6tWGs6K.js +66 -0
  65. package/dist/UnincorporatedPartnershipMemberCompanyPage-C_awQ-ZH.js +64 -0
  66. package/dist/{ViewVerificationStatusComponent-ZtYIqtnO.js → ViewVerificationStatusComponent-DjO4MIbD.js} +4 -3
  67. package/dist/adyen-business-financing.js +33 -22
  68. package/dist/adyen-individual-configuration.js +59 -0
  69. package/dist/adyen-individual-status.js +47 -0
  70. package/dist/adyen-kyc-components.js +28 -15
  71. package/dist/adyen-onboarding.js +3 -3
  72. package/dist/adyen-terms-of-service-management.js +63 -0
  73. package/dist/adyen-terms-of-service-status.js +47 -0
  74. package/dist/adyen-transfer-instrument-configuration.js +73 -0
  75. package/dist/adyen-transfer-instrument-management.js +61 -0
  76. package/dist/adyen-verification-status.js +44 -36
  77. package/dist/analytics-BY--2-JY.js +61 -0
  78. package/dist/{LandingLayout-Xi3iuRMx.js → bafinUtils-DJvocoVP.js} +218 -8
  79. package/dist/basePatterns-BwdnMQxI.js +15 -0
  80. package/dist/bg-BG-B0-ZcjR0.js +22 -0
  81. package/dist/{bg-BG-BiYtb1Tz.js → bg-BG-BYkC3yKf.js} +4 -1
  82. package/dist/bg-BG-CW9c658c.js +13 -0
  83. package/dist/bg-BG-CZ8v3rdy.js +30 -0
  84. package/dist/{bg-BG-Dy6-IwuZ.js → bg-BG-D5192UVe.js} +9 -2
  85. package/dist/{bg-BG-NMIts2sa.js → bg-BG-QC5irNEG.js} +2 -4
  86. package/dist/commonValidators-DcQ7Z0J8.js +24 -0
  87. package/dist/{cs-CZ-Dbow28-o.js → cs-CZ-DOqH0WeT.js} +9 -2
  88. package/dist/cs-CZ-Dk1ePReM.js +22 -0
  89. package/dist/cs-CZ-Dx6momCa.js +30 -0
  90. package/dist/cs-CZ-dU9fnQ1g.js +13 -0
  91. package/dist/{cs-CZ-Csr_35T-.js → cs-CZ-t297LwYw.js} +2 -4
  92. package/dist/{cs-CZ-wdftovLe.js → cs-CZ-zTkICtXj.js} +4 -1
  93. package/dist/currency-BGwQyxBo.js +36 -0
  94. package/dist/{da-DK-Adj8R5Qn.js → da-DK-B45X2VaJ.js} +9 -2
  95. package/dist/da-DK-BJ7aTPir.js +13 -0
  96. package/dist/{da-DK-Dm8o1giq.js → da-DK-BoQic3Gy.js} +2 -4
  97. package/dist/{da-DK-4QAKic_C.js → da-DK-D0N1TVVU.js} +4 -1
  98. package/dist/da-DK-D4H69PX3.js +30 -0
  99. package/dist/da-DK-DStNe471.js +22 -0
  100. package/dist/de-DE-C78RLE2G.js +13 -0
  101. package/dist/de-DE-CGoBPCPv.js +22 -0
  102. package/dist/{de-DE-BG0tKqvi.js → de-DE-CWvgMDqU.js} +9 -2
  103. package/dist/{de-DE-BzumFI3T.js → de-DE-Dtuu-nE7.js} +4 -1
  104. package/dist/{de-DE-DMFaycio.js → de-DE-Dwagawx1.js} +2 -4
  105. package/dist/de-DE-wp5-H-ov.js +30 -0
  106. package/dist/{digital-wallet-with-local-currencies-POeLD54e.js → digital-wallet-D_IpxnkN.js} +3 -3
  107. package/dist/dropinUtils-CMGrblnm.js +192 -0
  108. package/dist/el-GR-B69zcWyB.js +22 -0
  109. package/dist/el-GR-BZRKurtr.js +13 -0
  110. package/dist/{el-GR-DerT143K.js → el-GR-C3rkK_oc.js} +9 -2
  111. package/dist/el-GR-CK2heqPJ.js +30 -0
  112. package/dist/{el-GR-CGeBAkDN.js → el-GR-CxwhV-TX.js} +2 -4
  113. package/dist/{el-GR-CXmTklMq.js → el-GR-DaO38A1s.js} +4 -1
  114. package/dist/emitEvent-CzZf80Am.js +28 -0
  115. package/dist/{en-US-DLm6gy6T.js → en-US-546hB2Wn.js} +3 -1
  116. package/dist/{en-US-CkZcSKGh.js → en-US-BbAzROHT.js} +5 -4
  117. package/dist/en-US-CAm3meB1.js +30 -0
  118. package/dist/{en-US-SbE0c1gn.js → en-US-DIdQJky-.js} +1 -2
  119. package/dist/en-US.instructions-Ddr7AO05.js +22 -0
  120. package/dist/{es-ES-BhQOdKge.js → es-ES-BsQpwaPN.js} +4 -1
  121. package/dist/{es-ES-pXHx3ODy.js → es-ES-Bsoco8Fj.js} +2 -4
  122. package/dist/es-ES-BtUSEzkE.js +13 -0
  123. package/dist/es-ES-CKMfS8Yy.js +22 -0
  124. package/dist/{es-ES-BM4U0hT3.js → es-ES-DKCCgVF8.js} +9 -2
  125. package/dist/es-ES-Ds3-DtqZ.js +30 -0
  126. package/dist/et-EE-BCnK305R.js +13 -0
  127. package/dist/{et-EE-OJg_PSHf.js → et-EE-Bc6ioJRG.js} +9 -2
  128. package/dist/et-EE-Co-8akjV.js +30 -0
  129. package/dist/{et-EE-CFlzRBEx.js → et-EE-DF_GqBgK.js} +4 -1
  130. package/dist/{et-EE-QLVnr6Vl.js → et-EE-DdGlUpaQ.js} +2 -4
  131. package/dist/et-EE-Dw-aPF7J.js +22 -0
  132. package/dist/{fi-FI-Djollt2G.js → fi-FI-BJ9RzrL3.js} +4 -1
  133. package/dist/{fi-FI-DT351N-G.js → fi-FI-ClnsYt3L.js} +2 -4
  134. package/dist/fi-FI-Cvar63RH.js +13 -0
  135. package/dist/fi-FI-DPNeTsJS.js +30 -0
  136. package/dist/{fi-FI-BJ2l42Pj.js → fi-FI-Hhku9Lmc.js} +9 -2
  137. package/dist/fi-FI-REYOX46I.js +22 -0
  138. package/dist/fieldConfigurations-Bct_fXIF.js +458 -0
  139. package/dist/form-rules-DhbF2mY4.js +13 -0
  140. package/dist/fr-FR-B5543Fe-.js +13 -0
  141. package/dist/{fr-FR-g7lmxEsI.js → fr-FR-BYuKsZIb.js} +9 -2
  142. package/dist/{fr-FR-BNXXNUX_.js → fr-FR-CJI0bIig.js} +2 -4
  143. package/dist/{fr-FR-l36qBV3a.js → fr-FR-CNR5-s9g.js} +4 -1
  144. package/dist/fr-FR-ChmNQciP.js +30 -0
  145. package/dist/fr-FR-D9qaP6nx.js +22 -0
  146. package/dist/getName-BfigaSFZ.js +41 -0
  147. package/dist/{hasDataChanged-CTE9vdfO.js → hasDataChanged-D5Rq4ntg.js} +2 -2
  148. package/dist/{hr-HR-B8AZ4eHJ.js → hr-HR-C0yWizOX.js} +2 -4
  149. package/dist/{hr-HR-CDUE36Dg.js → hr-HR-CPO5Yw2B.js} +9 -2
  150. package/dist/hr-HR-CbxEvbrE.js +22 -0
  151. package/dist/{hr-HR-DTCY4iL8.js → hr-HR-CjA4MWAU.js} +4 -1
  152. package/dist/hr-HR-DqC8Cgs6.js +30 -0
  153. package/dist/hr-HR-ZreFlbK9.js +13 -0
  154. package/dist/hu-HU-B3BihdGh.js +13 -0
  155. package/dist/hu-HU-BOanVlKb.js +30 -0
  156. package/dist/hu-HU-D0C6UfXB.js +22 -0
  157. package/dist/{hu-HU-BznXPoc2.js → hu-HU-NhwFr6o-.js} +4 -1
  158. package/dist/{hu-HU-Bmf13NMf.js → hu-HU-mo_0ULJG.js} +9 -2
  159. package/dist/{hu-HU-DRi6Dz9U.js → hu-HU-wnSie9tz.js} +2 -4
  160. package/dist/iframeWidget-D2bi8wJe.js +234 -0
  161. package/dist/{payout-verification-instant-BIcnFP-p.js → instant-verification-Dvvkyfmp.js} +3 -3
  162. package/dist/isEmpty-Ck0I6out.js +23 -0
  163. package/dist/{it-IT-BEWyAQUU.js → it-IT-BV9K87FK.js} +4 -1
  164. package/dist/{it-IT-BeYbInCQ.js → it-IT-BeC2Y1F8.js} +2 -4
  165. package/dist/it-IT-Biduphjt.js +22 -0
  166. package/dist/it-IT-Dd6xGSe-.js +13 -0
  167. package/dist/{it-IT-DYIx7myn.js → it-IT-Nl57jui-.js} +9 -2
  168. package/dist/it-IT-eCrTB65E.js +30 -0
  169. package/dist/ja-JP-B2txEVPx.js +22 -0
  170. package/dist/ja-JP-BJljbFIZ.js +30 -0
  171. package/dist/{ja-JP-BhS-_dIx.js → ja-JP-CbgaW99b.js} +2 -2
  172. package/dist/{ja-JP-tx1DbZYD.js → ja-JP-D3oQAH7z.js} +10 -3
  173. package/dist/{ja-JP-D7oL6xGY.js → ja-JP-DXcP0ojZ.js} +13 -10
  174. package/dist/{ja-JP-C1OQ16fo.js → ja-JP-YoU7mNrK.js} +2 -4
  175. package/dist/ja-JP-iTbqSPNL.js +13 -0
  176. package/dist/keys-BpNgnAsD.js +23 -0
  177. package/dist/{localizeDateString-DaAGYSWR.js → localizeDateString-DmnKzDGI.js} +2 -2
  178. package/dist/{lt-LT-BxScCodJ.js → lt-LT-CVasDmF3.js} +9 -2
  179. package/dist/lt-LT-C_YMgjp9.js +22 -0
  180. package/dist/lt-LT-DE-4IXNG.js +13 -0
  181. package/dist/{lt-LT-_MzAcXJo.js → lt-LT-DIe4cKlu.js} +2 -4
  182. package/dist/lt-LT-DckQGgoT.js +30 -0
  183. package/dist/{lt-LT-De7dLXxI.js → lt-LT-tXTApHm2.js} +4 -1
  184. package/dist/lv-LV-B3sT3_cw.js +22 -0
  185. package/dist/lv-LV-CeivEZms.js +13 -0
  186. package/dist/lv-LV-DP9oRTFv.js +30 -0
  187. package/dist/{lv-LV-De9rdme0.js → lv-LV-DSaQNC67.js} +4 -1
  188. package/dist/{lv-LV-CRhXAjn6.js → lv-LV-DXgW5zWl.js} +2 -4
  189. package/dist/{lv-LV-F9_Fiu3w.js → lv-LV-Sbsv8-nD.js} +9 -2
  190. package/dist/{payout-verification-manual-DH9-DdlZ.js → manual-verification-BvZWqA00.js} +3 -3
  191. package/dist/mapExistingFile-qQ4y79Lm.js +231 -0
  192. package/dist/mapScriptLocalization-D7RKQgK6.js +72 -0
  193. package/dist/mapTransferInstrumentToPayoutAccount-BbdTQhjr.js +30 -0
  194. package/dist/{nl-NL-Cht7cSwD.js → nl-NL-BHkRnVrj.js} +9 -2
  195. package/dist/{nl-NL-Dbx0ZmI7.js → nl-NL-Cysslsh2.js} +2 -4
  196. package/dist/nl-NL-D2QKudfh.js +30 -0
  197. package/dist/nl-NL-DVENFpd5.js +13 -0
  198. package/dist/{nl-NL-lZcJhRsP.js → nl-NL-DywVQ9km.js} +4 -1
  199. package/dist/nl-NL-G1wVnmzT.js +22 -0
  200. package/dist/{no-NO-BEIyAMmZ.js → no-NO-B8oxqfNI.js} +4 -1
  201. package/dist/no-NO-BTtAuqCb.js +22 -0
  202. package/dist/no-NO-C_snYWBc.js +30 -0
  203. package/dist/no-NO-Dn2UkdoI.js +13 -0
  204. package/dist/{no-NO-BQAqVzF4.js → no-NO-kaAdT9B8.js} +9 -2
  205. package/dist/{no-NO-C0sfkp82.js → no-NO-zSnPtrDi.js} +2 -4
  206. package/dist/pl-PL--qPaNyJD.js +22 -0
  207. package/dist/{pl-PL-DD3wVcKc.js → pl-PL-C89s21hn.js} +4 -1
  208. package/dist/pl-PL-CQ6c2Qz_.js +30 -0
  209. package/dist/{pl-PL-CqxMKpBm.js → pl-PL-DD8JN4Qf.js} +9 -2
  210. package/dist/pl-PL-DFAzuceF.js +13 -0
  211. package/dist/{pl-PL-DAPGaxWi.js → pl-PL-UB5J5JcB.js} +2 -4
  212. package/dist/{pt-PT-BsDCHbWN.js → pt-PT-BvK00TeI.js} +4 -1
  213. package/dist/pt-PT-C-hbNnsB.js +30 -0
  214. package/dist/{pt-PT-BY9rcwcF.js → pt-PT-CjsyP_OK.js} +2 -4
  215. package/dist/pt-PT-Dk48OVtf.js +22 -0
  216. package/dist/{pt-PT-CBbmkr_J.js → pt-PT-Xm-pm3mb.js} +9 -2
  217. package/dist/pt-PT-_o5xgnxS.js +13 -0
  218. package/dist/{resolveEnvironment-D0tYcn_s.js → resolveEnvironment-D4ONN9a2.js} +3 -3
  219. package/dist/ro-RO-BLuOjrS0.js +22 -0
  220. package/dist/ro-RO-BrTWk1Ui.js +30 -0
  221. package/dist/{ro-RO-IY3AMhwm.js → ro-RO-C3m6aJVP.js} +9 -2
  222. package/dist/{ro-RO-DJLWmWZ4.js → ro-RO-C8yYXQc_.js} +2 -4
  223. package/dist/{ro-RO-CUg8-CQ8.js → ro-RO-CpGd9emB.js} +4 -1
  224. package/dist/ro-RO-D7c_Rj8V.js +13 -0
  225. package/dist/{rules-DXnRkeBJ.js → rules-DD7cnV-t.js} +5 -2
  226. package/dist/sk-SK-BBSuh2fA.js +13 -0
  227. package/dist/sk-SK-BTFtoPmI.js +30 -0
  228. package/dist/{sk-SK-BDKRZ2mM.js → sk-SK-BVc-vNQm.js} +9 -2
  229. package/dist/sk-SK-C1Ky2nl_.js +22 -0
  230. package/dist/{sk-SK-B7o3L57C.js → sk-SK-DbOE9C6n.js} +2 -4
  231. package/dist/{sk-SK-Cjrkrb85.js → sk-SK-DlX5KvBV.js} +4 -1
  232. package/dist/sl-SI-BB7iVcFI.js +22 -0
  233. package/dist/sl-SI-BLTuWNf5.js +13 -0
  234. package/dist/sl-SI-BhVTSmhQ.js +30 -0
  235. package/dist/{sl-SI-C8CMAkD0.js → sl-SI-Br0UEUPL.js} +2 -4
  236. package/dist/{sl-SI-BB0suyr1.js → sl-SI-D_rqR0D7.js} +9 -2
  237. package/dist/{sl-SI-BE_ndzZ2.js → sl-SI-NI2OJAvm.js} +4 -1
  238. package/dist/style.css +3226 -2972
  239. package/dist/styles-CLV89_hH.js +3226 -2972
  240. package/dist/sv-SE-66rqYTxi.js +30 -0
  241. package/dist/{sv-SE-DYruQSzt.js → sv-SE-B3zoXMuH.js} +9 -2
  242. package/dist/sv-SE-BUfESAQK.js +13 -0
  243. package/dist/{sv-SE-Bwh0wKFk.js → sv-SE-BtXmvxx4.js} +2 -4
  244. package/dist/{sv-SE-BryiIPVv.js → sv-SE-CAZpDX9G.js} +4 -1
  245. package/dist/sv-SE-DbI-1JqN.js +22 -0
  246. package/dist/translation-CpuWYSlU.js +472 -0
  247. package/dist/types/api/configurations/useScenarios.d.ts +8 -7
  248. package/dist/types/api/idNowProvider/idNowProvider.types.d.ts +1 -1
  249. package/dist/types/api/idNowProvider/useIdNowProvider.d.ts +9 -5
  250. package/dist/types/api/industryCodes/industryCodes.types.d.ts +2 -0
  251. package/dist/types/api/industryCodes/useIndustryCodes.d.ts +6 -0
  252. package/dist/types/api/queryKeys.d.ts +2 -1
  253. package/dist/types/components/BankAccount/forms/PayoutDetails/PayoutDetails.d.ts +1 -0
  254. package/dist/types/components/BankAccount/forms/PayoutVerificationMethod/payoutVerificationMethodMetadata.d.ts +3 -3
  255. package/dist/types/components/BankAccount/tasks/PayoutDetailsDropin/payoutDetailsFormConfig.d.ts +0 -9
  256. package/dist/types/components/Business/forms/BasicInformation/BasicInformationMultiform.d.ts +0 -1
  257. package/dist/types/components/Business/forms/BusinessDetails/forms.d.ts +7 -1
  258. package/dist/types/components/Business/forms/rules.d.ts +1 -3
  259. package/dist/types/components/Business/tasks/BusinessDetailsDropin/utils.d.ts +1 -2
  260. package/dist/types/components/Business/tasks/BusinessDetailsMultiformDropin/BusinessDetailsMultiform.d.ts +1 -1
  261. package/dist/types/components/Contract/tasks/ServiceAgreementDropin/ServiceAgreementDropin.d.ts +1 -1
  262. package/dist/types/components/Contract/tasks/ServiceAgreementDropin/types.d.ts +1 -0
  263. package/dist/types/components/EFP/mapping/businessFinancingKeyMappings.d.ts +0 -3
  264. package/dist/types/components/EFP/tasks/SourceOfFundsDropin/utils.d.ts +0 -1
  265. package/dist/types/components/EmbeddedDropins/AcceptTermsOfServiceComponent/AcceptTermsOfServiceComponent.d.ts +4 -3
  266. package/dist/types/components/EmbeddedDropins/ManageTransferInstrumentComponent/ManageTransferInstrumentOverviewItemModal/ManageTransferInstrumentOverviewItemModal.d.ts +0 -1
  267. package/dist/types/components/Individual/fields/NameFields/types.d.ts +4 -18
  268. package/dist/types/components/Individual/forms/Individual/IdVerificationMethod/idVerificationMethodMetadata.d.ts +3 -3
  269. package/dist/types/components/Individual/forms/Individual/Individual.d.ts +4 -0
  270. package/dist/types/components/Individual/forms/Individual/ProofOfRelationship/types.d.ts +0 -5
  271. package/dist/types/components/Individual/forms/IndividualOnfido/AdditionalPersonalDetails/AdditionalPersonalDetails.types.d.ts +1 -1
  272. package/dist/types/components/Individual/forms/IndividualOnfido/BasicDetails/BasicDetails.types.d.ts +1 -1
  273. package/dist/types/components/Individual/forms/IndividualOnfido/IdNowVerificationModal/IdNowVerificationModal.d.ts +4 -0
  274. package/dist/types/components/Individual/forms/IndividualOnfido/IdNowVerificationModal/isIdNowModalOpen.d.ts +17 -0
  275. package/dist/types/components/Individual/forms/IndividualOnfido/IdVerificationMethod/IdVerificationMethod.types.d.ts +2 -0
  276. package/dist/types/components/Individual/forms/IndividualOnfido/IdVerificationMethod/mapExtractionResultToSchema.d.ts +2 -1
  277. package/dist/types/components/Individual/forms/IndividualOnfido/IdVerificationMethod/validateExtractionResult.d.ts +12 -0
  278. package/dist/types/components/Individual/forms/IndividualOnfido/IndividualOnfido.types.d.ts +5 -3
  279. package/dist/types/components/Individual/helpers/bafinUtils.d.ts +35 -0
  280. package/dist/types/components/Individual/helpers/isDecisionMakerTask.d.ts +2 -0
  281. package/dist/types/components/Individual/helpers/shouldShowMotionCapture.d.ts +2 -2
  282. package/dist/types/components/Individual/pages/DecisionMakerDetailsPage.d.ts +2 -1
  283. package/dist/types/components/Shared/SingpassBanner/ProviderButton/ProviderButton.d.ts +7 -0
  284. package/dist/types/components/Shared/fields/IdFieldTypeSelector/countryIdNumberTypes.d.ts +1 -1
  285. package/dist/types/components/Shared/fields/LocalizedLegalCompanyNameField/fieldConfig.d.ts +4 -5
  286. package/dist/types/components/Shared/fields/LocalizedLegalCompanyNameField/types.d.ts +4 -5
  287. package/dist/types/components/Shared/forms/Address/utils.d.ts +1 -1
  288. package/dist/types/components/Trust/forms/Trust/Trust.d.ts +1 -0
  289. package/dist/types/components/Trust/forms/TrustRegistrationDetails/types.d.ts +1 -2
  290. package/dist/types/components/Trust/tasks/TrustMembers/TrustMembersOverview.d.ts +2 -1
  291. package/dist/types/components/UnincorporatedPartnership/pages/UnincorporatedPartnershipMemberCompanyPage.d.ts +2 -1
  292. package/dist/types/components/ui/atoms/ActionsMenu/ActionsMenu.d.ts +2 -1
  293. package/dist/types/components/ui/atoms/Button/Button.types.d.ts +4 -5
  294. package/dist/types/components/ui/atoms/Image/Image.d.ts +18 -0
  295. package/dist/types/components/ui/atoms/ListItem/ListItem.d.ts +2 -1
  296. package/dist/types/components/ui/atoms/Modal/MaybeModal.d.ts +1 -1
  297. package/dist/types/components/ui/atoms/RadioGroupCard/RadioGroupCard.types.d.ts +0 -14
  298. package/dist/types/components/ui/atoms/RadioWithLabel/RadioWithLabel.d.ts +2 -1
  299. package/dist/types/components/ui/atoms/Remove/Remove.d.ts +1 -1
  300. package/dist/types/components/ui/atoms/SelectList/SelectList.d.ts +1 -0
  301. package/dist/types/components/ui/atoms/StepProgressIndicator/StepProgressIndicator.d.ts +2 -1
  302. package/dist/types/components/ui/atoms/StructuredList/StructuredList.d.ts +2 -1
  303. package/dist/types/components/ui/atoms/Svg/svgs.d.ts +0 -76
  304. package/dist/types/components/ui/atoms/TaskStatusIndicator/TaskStatusIndicator.d.ts +4 -4
  305. package/dist/types/components/ui/layout/DetailViewLayout/DetailViewLayout.d.ts +12 -0
  306. package/dist/types/components/ui/layout/EndStateLayout/EndStateLayout.d.ts +13 -0
  307. package/dist/types/components/ui/layout/LandingLayout/LandingLayout.d.ts +8 -3
  308. package/dist/types/components/ui/layout/StackLayout/StackLayout.d.ts +2 -1
  309. package/dist/types/components/ui/molecules/DocumentGuidance/DocumentGuidance.types.d.ts +2 -3
  310. package/dist/types/components/ui/molecules/InputCurrency/InputCurrency.d.ts +2 -1
  311. package/dist/types/components/ui/molecules/InputEmail/InputEmail.d.ts +2 -1
  312. package/dist/types/components/ui/molecules/InputGroup/InputGroup.d.ts +2 -1
  313. package/dist/types/components/ui/molecules/InputTelephone/InputTelephone.d.ts +2 -1
  314. package/dist/types/components/ui/molecules/InputText/InputText.d.ts +2 -0
  315. package/dist/types/components/ui/molecules/MaskedInput/MaskedInput.d.ts +0 -1
  316. package/dist/types/components/ui/molecules/Tabs/Tabs.d.ts +1 -1
  317. package/dist/types/context/StateContext/types.d.ts +1 -1
  318. package/dist/types/core/models/api/accountIdentification.d.ts +5 -4
  319. package/dist/types/core/models/api/contracts.d.ts +1 -1
  320. package/dist/types/core/models/api/get-scenarios.d.ts +11 -5
  321. package/dist/types/core/models/api/individual.d.ts +5 -10
  322. package/dist/types/core/models/api/legal-arrangement.d.ts +0 -8
  323. package/dist/types/core/models/api/organization.d.ts +4 -8
  324. package/dist/types/core/models/api/scriptLocalization.d.ts +9 -0
  325. package/dist/types/core/process-field-configurations.d.ts +14 -3
  326. package/dist/types/embeds/business-financing/AdyenBusinessFinancing.d.ts +1 -1
  327. package/dist/types/embeds/business-financing/adyen-business-financing.types.d.ts +1 -5
  328. package/dist/types/embeds/emitEvent.d.ts +14 -0
  329. package/dist/types/embeds/{individual → individual-configuration}/AdyenIndividual.d.ts +4 -4
  330. package/dist/types/embeds/{individual/adyen-individual.types.d.ts → individual-configuration/adyen-individual-configuration.types.d.ts} +7 -7
  331. package/dist/types/embeds/{manage-individual → individual-status}/AdyenManageIndividual.d.ts +5 -5
  332. package/dist/types/embeds/{manage-individual/adyen-manage-individual.types.d.ts → individual-status/adyen-individual-status.types.d.ts} +6 -6
  333. package/dist/types/embeds/{terms-of-service → terms-of-service-management}/AdyenTermsOfService.d.ts +4 -4
  334. package/dist/types/embeds/{terms-of-service/adyen-terms-of-service.types.d.ts → terms-of-service-management/adyen-terms-of-service-management.types.d.ts} +9 -8
  335. package/dist/types/embeds/{manage-terms-of-service → terms-of-service-status}/AdyenManageTermsOfService.d.ts +5 -5
  336. package/dist/types/embeds/{manage-terms-of-service/adyen-manage-terms-of-service.types.d.ts → terms-of-service-status/adyen-terms-of-service-status.types.d.ts} +6 -6
  337. package/dist/types/embeds/{transfer-instrument → transfer-instrument-configuration}/AdyenTransferInstrument.d.ts +4 -4
  338. package/dist/types/embeds/{transfer-instrument/adyen-transfer-instrument.types.d.ts → transfer-instrument-configuration/adyen-transfer-instrument-configuration.types.d.ts} +7 -7
  339. package/dist/types/embeds/{manage-transfer-instruments → transfer-instrument-management}/AdyenManageTransferInstrument.d.ts +7 -8
  340. package/dist/types/embeds/{manage-transfer-instruments/adyen-manage-transfer-instruments.types.d.ts → transfer-instrument-management/adyen-transfer-instrument-management.types.d.ts} +8 -9
  341. package/dist/types/embeds/verification-status/adyen-verification-status.types.d.ts +3 -3
  342. package/dist/types/hooks/introduction/useIntroductionScreens.d.ts +2 -1
  343. package/dist/types/hooks/introduction/useShouldShowIntroduction.d.ts +2 -1
  344. package/dist/types/hooks/useMultiForm/types.d.ts +4 -4
  345. package/dist/types/language/utils.d.ts +1 -1
  346. package/dist/types/types/localizedScriptSchema.d.ts +22 -0
  347. package/dist/types/utils/addLinkedFields.d.ts +7 -1
  348. package/dist/types/utils/entityStatusUtil.d.ts +1 -1
  349. package/dist/types/utils/formUtils.d.ts +1 -1
  350. package/dist/types/utils/getDisplayErrorMessage.d.ts +1 -1
  351. package/dist/types/utils/getName.d.ts +2 -1
  352. package/dist/types/utils/makeSelectItemForRole.d.ts +1 -1
  353. package/dist/types/utils/mapScriptLocalization.d.ts +55 -0
  354. package/dist/types/utils/masking/masks/businessRegistrationNumberMasks.d.ts +5 -0
  355. package/dist/types/utils/translation.d.ts +6 -0
  356. package/dist/types-CAznNNSI.js +160 -0
  357. package/dist/types-Cj8YOGeo.js +64 -0
  358. package/dist/types-DW8AoV0s.js +74 -0
  359. package/dist/useAssociatedLegalEntity-DpMCDRB2.js +33 -0
  360. package/dist/useDataset-DgGo4v2J.js +120 -0
  361. package/dist/useForm-C66YXYZG.js +1694 -0
  362. package/dist/useFormContext-beqGS11A.js +23 -0
  363. package/dist/useGlobalData-CLK6kHPg.js +205 -0
  364. package/dist/{useMultiForm-CuBrV4Tk.js → useMultiForm-C2Py7qyc.js} +8 -3
  365. package/dist/{useOnboardingStatus-DUB9BH7M.js → useOnboardingStatus-CAefy-E-.js} +2 -2
  366. package/dist/useScenarios-B9C3euGm.js +46 -0
  367. package/dist/{useTermsOfServiceStatus-BblV2n-A.js → useTermsOfServiceStatus-BoQcnXHY.js} +2 -2
  368. package/dist/useToastContext-DGtAfUak.js +51 -0
  369. package/dist/useUnincorporatedPartnershipMembers-DWYujkfV.js +99 -0
  370. package/dist/utils-398Z4KKf.js +29 -0
  371. package/dist/utils-DNSfZiio.js +70 -0
  372. package/dist/utils-DgGLUM4O.js +159 -0
  373. package/dist/{utils-CoNP20Mi.js → utils-DxvZeEUH.js} +46 -4
  374. package/dist/{validate-BPEF-9EC.js → validate--KA-U0Fs.js} +2 -2
  375. package/dist/validate-BrsSh5ej.js +382 -0
  376. package/dist/validate-ZwWxhap7.js +605 -0
  377. package/dist/validationError-DeiIFLRV.js +86 -0
  378. package/package.json +67 -70
  379. package/dist/BusinessDetailsDropin-JZ29P1pI.js +0 -2163
  380. package/dist/BusinessFinancingComponent-AAD0wzc0.js +0 -38
  381. package/dist/BusinessFinancingPage-DWvnRK3f.js +0 -35
  382. package/dist/CreateIndividualComponent-CO0NnimV.js +0 -64
  383. package/dist/CreateTransferInstrumentComponent-CpUB63yl.js +0 -55
  384. package/dist/DecisionMakerDetailsPage-DBsCSIAU.js +0 -80
  385. package/dist/FormEndState-s8NUp0x5.js +0 -59
  386. package/dist/LegalRepresentativeDetailsPage-Beh9_16w.js +0 -55
  387. package/dist/ManageIndividualComponent-C5ll1EKq.js +0 -42
  388. package/dist/ManageTermsOfServiceComponent-BYgWiamd.js +0 -40
  389. package/dist/RootIndividualDetailsPage-Bi7xeUYJ.js +0 -71
  390. package/dist/SignPCIComponent-Dgnvmjbr.js +0 -279
  391. package/dist/SoleProprietorshipPage-DMYrwSK2.js +0 -44
  392. package/dist/StoreProvider-QThALSrj.js +0 -31918
  393. package/dist/TrustMemberCompanyPage-DKNQ_vHF.js +0 -54
  394. package/dist/TrustMemberIndividualPage-CFo3Is4F.js +0 -60
  395. package/dist/UnincorporatedPartnershipIndividualPage-CfllAxUK.js +0 -60
  396. package/dist/UnincorporatedPartnershipMemberCompanyPage-779IUOW2.js +0 -57
  397. package/dist/VerificationErrorAlert-BtsLa_Ty.js +0 -77
  398. package/dist/adyen-a-filled-czhSM_bc.js +0 -14
  399. package/dist/adyen-individual.js +0 -50
  400. package/dist/adyen-manage-individual.js +0 -48
  401. package/dist/adyen-manage-terms-of-service.js +0 -48
  402. package/dist/adyen-manage-transfer-instruments.js +0 -63
  403. package/dist/adyen-terms-of-service.js +0 -60
  404. package/dist/adyen-transfer-instrument.js +0 -64
  405. package/dist/arrow-left-Dtc2gya1.js +0 -14
  406. package/dist/bg-BG-BvSUDgGF.js +0 -13
  407. package/dist/cs-CZ-y4mvq4Lv.js +0 -13
  408. package/dist/da-DK-qgQOVjDp.js +0 -13
  409. package/dist/de-DE-pSdsxBpQ.js +0 -13
  410. package/dist/document-plus-NwgAdjyB.js +0 -17
  411. package/dist/el-GR-Bvjk5Sw8.js +0 -13
  412. package/dist/en-US-Bq2Twy6x.js +0 -54
  413. package/dist/es-ES-Dy1uR2H_.js +0 -13
  414. package/dist/et-EE-d9V24rcf.js +0 -13
  415. package/dist/fi-FI-B0fnAFV2.js +0 -13
  416. package/dist/fr-FR-BoKzVp2q.js +0 -13
  417. package/dist/getFieldsWithExistingData-CUMH8N-C.js +0 -22
  418. package/dist/hide-CigAXbWC.js +0 -18
  419. package/dist/hr-HR-CF0AHQzi.js +0 -13
  420. package/dist/hu-HU-CSPhOvLC.js +0 -13
  421. package/dist/idea-DwJIwJHR.js +0 -18
  422. package/dist/instant-verification-method-BGfknV9x.js +0 -28
  423. package/dist/it-IT-BH-eqIKH.js +0 -13
  424. package/dist/ja-JP-B3yqM_FM.js +0 -13
  425. package/dist/lt-LT-Lzl_Cbw-.js +0 -13
  426. package/dist/lv-LV-y00wN1pj.js +0 -13
  427. package/dist/mapFinancialReportsToFinancialInformation-Bo2uW3j7.js +0 -66
  428. package/dist/nl-NL-DmnFXAQC.js +0 -13
  429. package/dist/no-NO-DbvFfP96.js +0 -13
  430. package/dist/pl-PL--mmxopYA.js +0 -13
  431. package/dist/plus-small-Dj1WRyFM.js +0 -14
  432. package/dist/pt-PT-BVzXBFp7.js +0 -13
  433. package/dist/ro-RO-Cdmevo9A.js +0 -13
  434. package/dist/ru-RU-FZb2upqh.js +0 -13
  435. package/dist/sk-SK-nfeuTcY5.js +0 -13
  436. package/dist/sl-SI-DUTZDqkP.js +0 -13
  437. package/dist/sv-SE-BTx2XKAp.js +0 -13
  438. package/dist/types/components/Individual/mapping/mapLocalization.d.ts +0 -3
  439. package/dist/types/components/ui/atoms/OutlinedIcon/OutlinedIcon.d.ts +0 -5
  440. package/dist/types/components/ui/atoms/ProviderButton/ProviderButton.d.ts +0 -3
  441. package/dist/types/components/ui/atoms/ProviderButton/ProviderButton.types.d.ts +0 -5
  442. package/dist/types/components/ui/molecules/FormEndState/FormEndState.d.ts +0 -2
  443. package/dist/types/components/ui/molecules/FormEndState/types.d.ts +0 -8
  444. package/dist/useUpdateLegalEntity-56mDjaQA.js +0 -57
  445. package/dist/validate-Bgc1XuQl.js +0 -40
  446. package/dist/zh-CN-wUb4MmTZ.js +0 -13
  447. package/dist/zh-TW-DNTXHLKa.js +0 -13
  448. /package/dist/types/embeds/{individual/adyen-individual.d.ts → individual-configuration/adyen-individual-configuration.d.ts} +0 -0
  449. /package/dist/types/embeds/{manage-individual/adyen-manage-individual.d.ts → individual-status/adyen-individual-status.d.ts} +0 -0
  450. /package/dist/types/embeds/{manage-terms-of-service/adyen-manage-terms-of-service.d.ts → terms-of-service-management/adyen-terms-of-service-management.d.ts} +0 -0
  451. /package/dist/types/embeds/{manage-transfer-instruments/adyen-manage-transfer-instruments.d.ts → terms-of-service-status/adyen-terms-of-service-status.d.ts} +0 -0
  452. /package/dist/types/embeds/{terms-of-service/adyen-terms-of-service.d.ts → transfer-instrument-configuration/adyen-transfer-instrument-configuration.d.ts} +0 -0
  453. /package/dist/types/embeds/{transfer-instrument/adyen-transfer-instrument.d.ts → transfer-instrument-management/adyen-transfer-instrument-management.d.ts} +0 -0
@@ -2,24 +2,59 @@
2
2
  {
3
3
  try {
4
4
  let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
5
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "cfe534b6-6e6d-48d8-b10f-96ac912068e6", e._sentryDebugIdIdentifier = "sentry-dbid-cfe534b6-6e6d-48d8-b10f-96ac912068e6");
5
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "8deae5d4-2e44-4c12-8eb2-dac9caaf8aef", e._sentryDebugIdIdentifier = "sentry-dbid-8deae5d4-2e44-4c12-8eb2-dac9caaf8aef");
6
6
  } catch (e) {
7
7
  }
8
8
  }
9
9
  ;
10
- import { jsx, jsxs, Fragment } from "preact/jsx-runtime";
11
- import { useMemo, useState, useEffect, useCallback } from "preact/hooks";
12
- import { a as useApiContext, bp as useMutation, t as httpPost, bX as matchesRegex, bY as trimValWithOneSpace, bZ as NO_ALPHABET_REGEX, b_ as EMOJI_REGEX, b$ as hasRepeatedCharacters, c0 as isInvalidName, c1 as INDIVIDUAL_VALID_CHAR_REGEX, c2 as getFormattingRegEx, c3 as SPECIAL_CHARS, c4 as standardKatakanaValidator, c5 as standardKanjiValidator, av as resolveFieldMetadata, as as CountryCodes, c6 as getSSNType, at as isEmpty, c7 as defaultFieldMetadata, c8 as defaultFieldConfig, c9 as defaultFieldMetadata$1, ca as fieldConfig, $ as TaskTypes, cb as taxInformationDefaultFieldMetadata, O as LegalEntityTypes, cc as taxInformationDefaultFieldConfig, cd as getAgeToday, ce as euCountries, cf as getIdDocument, cg as getDocument, ch as mapExistingFile, ci as getPageName, cj as getLocalizedIdDocumentTypeOptions, ck as getPage, cl as createDocumentRequest, bA as formatObject, cm as individualApiKeyMapping, b7 as individualComponentsKeyMapping, bz as reverseMapping, cn as getNomineeFromAssociation, co as drop, a0 as createLogger, X as useAccountHolder, u as useI18nContext, a3 as useAnalyticsContext, a9 as useToastContext, aa as useExperimentsContext, v as useSettingsContext, cp as documentApiUtils, cq as useProviderStatus, g as getLegalEntityCountry, bP as getAssociatedLeAnalyticsPayload, cr as addressValidators, cs as getAsyncIdNumberValidationRule, ct as getAsyncPhoneValidationRules, cu as addressFormatters, cv as useScenarios, cw as setHasMotionCaptureScenario, cx as useScenarioConfiguration, cy as getPropsFromConfigurations, cz as individualForms, cA as showIndividualMotionCapture, bQ as getRequiredForms, bR as addValidityToForms, cB as getAllowedDecisionMakerRoles, ba as datasetUtilities, bS as useFormComposer, bT as trackNavigation, cC as Individual, cD as composePerScenarioFormConfigurations, cE as omitObscuredFieldsIfUnchanged, cF as filterOutUnwantedAssociationsIfRootLE, bU as isValidationError, bV as processValidationErrors, bW as isMaintenanceModeError, bk as cloneObject, cG as mapAddressLabels, cH as individualDocumentForms, cI as individualDocumentMapping, cJ as individualObscuredFields, cK as mergeAttachments, cL as getFileExtention, ao as getOwnEntityAssociations, cM as hasNomineesChanged, cN as attachNomineeToRole, cO as idVerificationProviderId, cP as doArraysMatch, N as Typography, G as Button, aD as Field, cQ as DecisionMakerTypes, cR as createFormRules, cS as getAvailableDecisionMakerRoleTypes, cT as allowedCountriesForNominee, bL as getAddressSchemaForCountry, bM as COUNTRIES_WITH_STATES_DATASET, cU as Scenarios, cV as isLowRiskCountry, bu as Select, cW as isTruthyValidator, cX as licenseCardNumberDefaultMetadata, cY as licenseCardNumberDefaultConfig, au as mergeFieldMetadataIntoProps, c as useTranslation, aC as createFormUtils, bK as useFormContext, az as getFieldProps, cZ as idNumberFields, c_ as IdentityNumber, c$ as additionallIdNumberOptions, d0 as MaskedInput, bJ as InputDate, d1 as formatDateObj, d2 as DriversLicense, d3 as addressFields, b as useAllowedCountries, w as SettingNames, F as FormHeader, aB as ErrorPanel, aJ as CountryField, bN as Address, bO as getAddressSchemaLabelsByCountry, bD as Link, bi as Confirm, d4 as getAgeRangeForLegalRepresentative, d5 as IndividualIdNumberTypeSelector, d6 as TaxInformationField, bE as InputText, d7 as PatriotActDisclosure, d8 as isLegalRepresentativeNeeded, aA as nameFields, d9 as decisionMakerRoleFields, da as nomineeFields, db as contactDetailFields, K as Alert, aZ as ContextGuidance, b4 as TrustedFieldsProviders, dc as DecisionMakerRole, dd as NomineeDecisionMakerRole, de as LocalizedNameFields, df as ContactDetails, dg as keysOf, b3 as objectsDeepEqual, dh as isEmpty$1, di as RadioWithLabel, dj as listToRecord, bc as Modal, dk as pick, dl as IdVerification, bh as Spacer, a2 as IconButton, e as useDataset, f as datasetIdentifier, L as Loader, H as Svg, dm as IdDocumentManualUpload, M as translateStringOrObject, aX as Trans, dn as idDocumentUploadFields, dp as useFormRouterContext, dq as getFormProps, dr as useCapabilities, ds as hasMotionCaptureScenario, dt as setShowIndividualMotionCapture, du as shouldShowMotionCapture, dv as MemoizedProofOfRelationship, dw as MemoizedDocumentUpload, dx as MemoizedProofOfResidencyUpload, dy as individualOnfidoApiKeyMapping, dz as individualOnfidoBaseMapping, br as useQueryClient, dA as individualOnfidoDocumentMapping, dB as individualOnfidoObscuredFields } from "./StoreProvider-QThALSrj.js";
13
- import { u as useCreateLegalEntity, a as useUpdateLegalEntity } from "./useUpdateLegalEntity-56mDjaQA.js";
14
- import { c as contactDetailsValidationRules, u as useValidatePhoneNumberImperatively } from "./validate-Bgc1XuQl.js";
15
- import { F as FormContextProvider, a as FormFlow } from "./FormFlow-6j8qCSuK.js";
16
- import { u as useSingpassMyInfoLogin, L as LandingLayout } from "./LandingLayout-Xi3iuRMx.js";
17
- import { u as useMultiForm } from "./useMultiForm-CuBrV4Tk.js";
18
- import { g as getFieldsWithExistingData } from "./getFieldsWithExistingData-CUMH8N-C.js";
19
- import { l as localizeDateString } from "./localizeDateString-DaAGYSWR.js";
20
- import { r as rules, D as DECISION_MAKER_TYPES_WITH_JOBTITLE$1 } from "./rules-DXnRkeBJ.js";
10
+ import { jsxs, jsx, Fragment } from "preact/jsx-runtime";
11
+ import { useRef, useEffect, useMemo, useState, useCallback } from "preact/hooks";
12
+ import { u as useScenarios } from "./useScenarios-B9C3euGm.js";
13
+ import { R as RadioGroup, u as useCreateLegalEntity, a as useUpdateLegalEntity, b as RadioWithLabel } from "./RadioGroup-CnXRr_Ap.js";
14
+ import { u as useProviderStatus, A as Address, a as addressValidators, b as addressFormatters } from "./Address-BxCJg97r.js";
15
+ import { c as contactDetailFields, C as ContactDetails, a as contactDetailsValidationRules, d as defaultFieldMetadata$1, f as fieldConfig, u as useValidatePhoneNumberImperatively, g as getAsyncPhoneValidationRules } from "./validate-BrsSh5ej.js";
16
+ import { b as useApiContext, aA as useMutation, k as httpPost, ap as matchesRegex, aU as trimValWithOneSpace, aq as NO_ALPHABET_REGEX, ar as EMOJI_REGEX, as as hasRepeatedCharacters, at as isInvalidName, aV as INDIVIDUAL_VALID_CHAR_REGEX, aW as getFormattingRegEx, aX as SPECIAL_CHARS, a8 as CountryCodes, al as Scenarios, ak as DecisionMakerTypes, M as TaskTypes, a as useTranslation, j as useQuery, N as createLogger, u as useI18nContext, x as Typography, V as Icon, m as useSettingsContext, X as useExperimentsContext, y as LegalEntityTypes, aY as getLegalRepresentativeWarningMessage, af as objectsDeepEqual, aw as standardKatakanaValidator, ax as standardKanjiValidator, a9 as isEmpty, aZ as getAgeToday, a_ as euCountries, a$ as individualApiKeyMapping, ah as individualComponentsKeyMapping, aS as reverseMapping, b0 as getNomineeFromAssociation, b1 as drop, U as useAnalyticsContext, g as getLegalEntityCountry, b2 as getAllowedDecisionMakerRoles, b3 as filterOutUnwantedAssociationsIfRootLE, ay as cloneObject, b4 as individualDocumentMapping, b5 as individualObscuredFields, a6 as getOwnEntityAssociations, b6 as hasNomineesChanged, b7 as attachNomineeToRole, aG as doArraysMatch, B as Button, q as skipToken, o as httpGet, aC as useQueryClient, L as Loader, b8 as getAvailableDecisionMakerRoleTypes, b9 as allowedCountriesForNominee, ba as isLowRiskCountry, bb as getAgeRangeForLegalRepresentative, bc as isLegalRepresentativeNeeded, aD as keysOf, bd as listToRecord, be as pick, P as IconButton, w as translateStringOrObject, bf as individualOnfidoApiKeyMapping, bg as individualOnfidoBaseMapping, bh as individualOnfidoDocumentMapping, bi as individualOnfidoObscuredFields } from "./StoreProvider-_YW7glEh.js";
17
+ import { F as FormContextProvider, a as FormFlow } from "./FormFlow-BaU8ND7m.js";
18
+ import { u as useToastContext } from "./useToastContext-DGtAfUak.js";
19
+ import { g as getAssociatedLeAnalyticsPayload } from "./analytics-BY--2-JY.js";
20
+ import { g as getIdDocument, a as getDocument, c as createDocumentRequest, d as documentApiUtils, b as getPropsFromConfigurations, e as composePerScenarioFormConfigurations, m as mergeAttachments, f as getFileExtention } from "./validate-ZwWxhap7.js";
21
+ import { M as MultiSelectList, m as makeSelectItemForRole, n as nameFields, N as Name, a as useSingpassMyInfoLogin, b as idNowModalChildEntityId, L as LandingLayout, s as showIdNowModal, i as isBafinSignatoryFlow, c as shouldShowIdNowModal } from "./bafinUtils-DJvocoVP.js";
22
+ import { f as validatePatternOnBlur, R as RadioGroupCard, C as ContextGuidance, I as Image, r as resolveFieldMetadata, e as TrustedFieldsProviders, a as useAccountHolder } from "./fieldConfigurations-Bct_fXIF.js";
23
+ import { g as getRequiredForms, a as addValidityToForms, u as useFormComposer, t as trackNavigation } from "./dropinUtils-CMGrblnm.js";
24
+ import { u as useMultiForm } from "./useMultiForm-C2Py7qyc.js";
25
+ import { u as uppercase, D as DocumentGuidance, m as mapExistingFile, g as getPageName, a as getPage, b as useScenarioConfiguration } from "./mapExistingFile-qQ4y79Lm.js";
26
+ import { b as addressFields, m as mapAddressLabels, g as getAddressSchemaForCountry, C as COUNTRIES_WITH_STATES_DATASET, a as getAddressSchemaLabelsByCountry } from "./utils-DgGLUM4O.js";
27
+ import { i as isValidationError, p as processValidationErrors, a as isMaintenanceModeError } from "./validationError-DeiIFLRV.js";
28
+ import { u as useDataset, d as datasetIdentifier, a as datasetUtilities } from "./useDataset-DgGo4v2J.js";
29
+ import { i as individualIdNumberOptions, a as additionallIdNumberOptions, t as taxInformationDefaultFieldMetadata, b as taxInformationDefaultFieldConfig, T as TaxInformationField, M as MemoizedDocumentUpload, u as useCapabilities, g as getFieldsWithExistingData } from "./TaxInformationField-Cc4iBLBk.js";
30
+ import { l as localizeDateString } from "./localizeDateString-DmnKzDGI.js";
31
+ import { o as omitObscuredFieldsIfUnchanged, I as IFrameWidget } from "./iframeWidget-D2bi8wJe.js";
32
+ import { g as getLocalizedIdDocumentTypeOptions } from "./utils-398Z4KKf.js";
33
+ import { F as FormHeader, E as ErrorPanel, c as createFormUtils, m as mergeFieldMetadataIntoProps, g as getFieldProps, C as CountryField, f as getFormProps, u as useFormRouterContext } from "./CountryField-ziRVRc5r.js";
34
+ import { u as useFormContext } from "./useFormContext-beqGS11A.js";
35
+ import { lazy, forwardRef, memo } from "preact/compat";
36
+ import { F as Field, c as Select, L as LoaderWrapper, C as Checkbox } from "./useForm-C66YXYZG.js";
37
+ import { L as Link } from "./Link-D6KEr49t.js";
38
+ import { T as Trans } from "./translation-CpuWYSlU.js";
39
+ import { I as InputText, S as SettingNames } from "./InputText-CufyDwPI.js";
40
+ import { u as useAllowedCountries, m as mapSchemaFieldsToApiScriptLocalization, a as mapApiScriptLocalizationToSchemaFields } from "./mapScriptLocalization-D7RKQgK6.js";
41
+ import { a as Alert } from "./Alert-JxANwoOi.js";
42
+ import { I as InputDate, f as formatDateObj } from "./InputDate-DgqNliIM.js";
43
+ import { m as makeMask, n as numericInputs, a as nonInputs, b as alphaInputs, c as customInputs, s as spacer, d as alphanumericInputs, M as MaskedInput } from "./MaskedInput-CMGa4-AZ.js";
44
+ import { i as isTruthyValidator } from "./commonValidators-DcQ7Z0J8.js";
45
+ import { r as rules, D as DECISION_MAKER_TYPES_WITH_JOBTITLE$1 } from "./rules-DD7cnV-t.js";
46
+ import { i as isEmpty$1 } from "./isEmpty-Ck0I6out.js";
47
+ import { f as formatObject } from "./utils-DNSfZiio.js";
21
48
  import { signal, computed } from "@preact/signals";
22
- import { T as TileGroup } from "./TileGroup-DUoq3Lh4.js";
49
+ import { Show } from "@preact/signals/utils";
50
+ import { T as TileGroup } from "./TileGroup-C0Rfm3yy.js";
51
+ import { M as Modal } from "./Modal-BvBRzt44.js";
52
+ import { C as Confirm } from "./Confirm-C6hGSEWi.js";
53
+ import { a as getIndividualLegalEntityName } from "./getName-BfigaSFZ.js";
54
+ import { D as Dropzone } from "./Dropzone-DwdkWB-s.js";
55
+ import { c as createFormRules } from "./form-rules-DhbF2mY4.js";
56
+ import { Onfido } from "onfido-sdk-ui";
57
+ import { S as Spacer } from "./Spacer-BK3jDget.js";
23
58
  const verifyIdNumber = async (legalEntityId, baseUrl, data) => {
24
59
  return await httpPost(
25
60
  {
@@ -100,11 +135,2713 @@ const nameFormatters = {
100
135
  formatter: (val) => val ? trimValWithOneSpace(val).replace(specialCharsRegEx, "") : void 0
101
136
  }
102
137
  };
138
+ const CountryIdNumberPatterns = {
139
+ [CountryCodes.Brazil]: /^\d{11}$/,
140
+ [CountryCodes.Canada]: /^\d{9}$/,
141
+ [CountryCodes.Croatia]: /^\d{11}$/,
142
+ [CountryCodes.Denmark]: /^\d{10}$/,
143
+ [CountryCodes.Italy]: /^[A-Z]{6}[0-9]{2}[ABCDEHLMPRST][0-9]{2}[A-Z][0-9]{3}[A-Z]$/,
144
+ [CountryCodes.Poland]: /^\d{11}$/,
145
+ [CountryCodes.Romania]: /^\d{13}$/,
146
+ [CountryCodes.Singapore]: /^[A-Z][0-9]{7}[A-Z]$/,
147
+ [CountryCodes.Spain]: {
148
+ dni: /(^[KL]?\d{8}[A-Z]$)/,
149
+ nie: /(^[MXYZ]\d{7,8}[A-Z]$)/
150
+ },
151
+ [CountryCodes.Sweden]: /^\d{10}$|^\d{12}$/,
152
+ [CountryCodes.UnitedStates]: {
153
+ // used by CountryCodes.PuertoRico
154
+ ssn: /^\d{9}$/,
155
+ ssnLastFour: /^\d{4}$/
156
+ }
157
+ };
158
+ const DriversLicenseCardNumberPatterns = {
159
+ [CountryCodes.NewZealand]: /^[\d]{3}$/,
160
+ [CountryCodes.Australia]: /^[A-Z0-9]{5,11}$/
161
+ };
162
+ const DriversLicenseNumberPatterns = {
163
+ [CountryCodes.Australia]: /^[A-Za-z0-9]{5,11}$/,
164
+ [CountryCodes.HongKong]: /^[A-Z0-9]{8}$/,
165
+ [CountryCodes.NewZealand]: /^[A-Z]{2}[0-9]{6}$/
166
+ };
167
+ const PassportNumberPatterns = {
168
+ [CountryCodes.Australia]: /^[A-Z0-9]{8,9}$/,
169
+ [CountryCodes.HongKong]: /^[A-Z0-9]{9}$/,
170
+ [CountryCodes.NewZealand]: /^[A-Z0-9]{8,9}$/
171
+ };
172
+ const ProofOfIdentityCardPatterns = {
173
+ [CountryCodes.HongKong]: /^[A-Z]{1,2}[0-9]{6}[0-9A]$/
174
+ };
175
+ const COUNTRY_ID_NUMBER_MASKS = {
176
+ [CountryCodes.PuertoRico]: { length: 4 },
177
+ [CountryCodes.UnitedStates]: { length: 4 }
178
+ };
179
+ const COUNTRY_ID_NUMBER_UNMASKED = {
180
+ [CountryCodes.PuertoRico]: { length: 9 },
181
+ [CountryCodes.UnitedStates]: { length: 9 }
182
+ };
183
+ const ID_NUMBER_VERIFICATION_COUNTRIES = [
184
+ CountryCodes.PuertoRico,
185
+ CountryCodes.UnitedStates
186
+ ];
187
+ const FIELD = "idNumber";
188
+ const handleVerifyIdNumber = async (formData, verifyFn) => {
189
+ const country = formData.residencyCountry;
190
+ const verified = { field: "idNumber", isVerified: true };
191
+ if (formData.idNumberExempt || !country) {
192
+ return verified;
193
+ }
194
+ if (!ID_NUMBER_VERIFICATION_COUNTRIES.includes(country)) {
195
+ return verified;
196
+ }
197
+ const isCountryWithMaskedIdNumber = Object.keys(COUNTRY_ID_NUMBER_MASKS).includes(country);
198
+ const isValueMasked = formData.idNumber?.length === COUNTRY_ID_NUMBER_MASKS[country]?.length;
199
+ const hasCompleteValue = formData.idNumber?.length === COUNTRY_ID_NUMBER_UNMASKED[country]?.length;
200
+ if (isCountryWithMaskedIdNumber && isValueMasked) return verified;
201
+ if (!hasCompleteValue) {
202
+ return { field: "idNumber", isVerified: false };
203
+ }
204
+ const response = await verifyFn({
205
+ name: {
206
+ firstName: formData.firstName || "",
207
+ lastName: formData.lastName || ""
208
+ },
209
+ countryCode: country,
210
+ idNumber: formData.idNumber || ""
211
+ });
212
+ const isNotVerified = response?.status === 422 || response?.verified === "false";
213
+ if (isNotVerified)
214
+ return {
215
+ field: FIELD,
216
+ isVerified: false
217
+ };
218
+ return {
219
+ field: FIELD,
220
+ isVerified: true
221
+ };
222
+ };
223
+ const getAsyncIdNumberValidationRule = (verifyIdNumber2, personalDetails) => ({
224
+ idNumber: {
225
+ asyncValidate: async (idNumber) => {
226
+ if (!idNumber || !personalDetails) return false;
227
+ return (await handleVerifyIdNumber(personalDetails, verifyIdNumber2)).isVerified;
228
+ },
229
+ errorMessage: "unableToVerifyTheIdNumber",
230
+ modes: ["blur", "input"]
231
+ }
232
+ });
233
+ const defaultFieldMetadata = {
234
+ label: "idNumber"
235
+ };
236
+ const defaultFieldConfig = {
237
+ [CountryCodes.Brazil]: {
238
+ label: "cadastroDePessoasFisicas",
239
+ mask: {
240
+ mask: makeMask(
241
+ ...numericInputs(3),
242
+ ...nonInputs(" . "),
243
+ ...numericInputs(3),
244
+ ...nonInputs(" . "),
245
+ ...numericInputs(3),
246
+ ...nonInputs(" - "),
247
+ ...numericInputs(2)
248
+ )
249
+ },
250
+ validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.Brazil]),
251
+ guidanceText: {
252
+ key: "enterNDigitsForExample",
253
+ values: {
254
+ numDigits: "11",
255
+ example: "231.002.999-00"
256
+ }
257
+ }
258
+ },
259
+ [CountryCodes.Canada]: {
260
+ label: "socialInsuranceNumber",
261
+ mask: {
262
+ mask: makeMask(...numericInputs(3), spacer, ...numericInputs(3), spacer, ...numericInputs(3))
263
+ },
264
+ validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.Canada]),
265
+ guidanceText: {
266
+ key: "enterNDigitsForExample",
267
+ values: {
268
+ numDigits: "9",
269
+ example: "046 454 286"
270
+ }
271
+ }
272
+ },
273
+ [CountryCodes.Croatia]: {
274
+ label: "oib",
275
+ mask: { mask: makeMask(...numericInputs(11)) },
276
+ validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.Croatia]),
277
+ guidanceText: {
278
+ key: "enterNDigitsForExample",
279
+ values: {
280
+ numDigits: "11",
281
+ example: "94577403194"
282
+ }
283
+ }
284
+ },
285
+ [CountryCodes.Denmark]: {
286
+ label: "detCentralePersonregister",
287
+ mask: {
288
+ mask: makeMask(...numericInputs(6), ...nonInputs(" - "), ...numericInputs(4))
289
+ },
290
+ validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.Denmark]),
291
+ guidanceText: {
292
+ key: "enterNDigitsForExample",
293
+ values: {
294
+ numDigits: "10",
295
+ example: "010111-1113"
296
+ }
297
+ }
298
+ },
299
+ [CountryCodes.Italy]: {
300
+ label: "codiceFiscale",
301
+ mask: {
302
+ mask: makeMask(
303
+ ...alphaInputs(6),
304
+ ...numericInputs(2),
305
+ ...customInputs(1, /^[ABCDEHLMPRST]$/),
306
+ ...numericInputs(2),
307
+ ...alphaInputs(1),
308
+ ...numericInputs(3),
309
+ ...alphaInputs(1)
310
+ ),
311
+ transformOnType: uppercase
312
+ },
313
+ validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.Italy]),
314
+ guidanceText: {
315
+ key: "enterNCharactersWithAMixForExample",
316
+ values: {
317
+ numChars: "16",
318
+ example: "YULSQG40E60L271T"
319
+ }
320
+ }
321
+ },
322
+ [CountryCodes.Poland]: {
323
+ label: "peselNumber",
324
+ mask: { mask: makeMask(...numericInputs(11)) },
325
+ validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.Poland]),
326
+ guidanceText: {
327
+ key: "enterNDigitsForExample",
328
+ values: {
329
+ numDigits: "11",
330
+ example: "23012224757"
331
+ }
332
+ }
333
+ },
334
+ [CountryCodes.PuertoRico]: ({ idNumberType }) => {
335
+ switch (idNumberType) {
336
+ case "ssn":
337
+ return {
338
+ label: "socialSecurityNumber",
339
+ mask: {
340
+ mask: makeMask(
341
+ ...numericInputs(3),
342
+ ...nonInputs(" - "),
343
+ ...numericInputs(2),
344
+ ...nonInputs(" - "),
345
+ ...numericInputs(4)
346
+ )
347
+ },
348
+ validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.UnitedStates].ssn),
349
+ guidanceText: {
350
+ key: "enterNDigitsForExample",
351
+ values: {
352
+ numDigits: "9",
353
+ example: "123-12-1234"
354
+ }
355
+ }
356
+ };
357
+ case "ssnLastFour":
358
+ default:
359
+ return {
360
+ label: "last4DigitsOfSocialSecurityNumber",
361
+ mask: {
362
+ mask: makeMask(...numericInputs(4))
363
+ },
364
+ validators: {
365
+ modes: ["blur"],
366
+ validate: (val) => !!val && CountryIdNumberPatterns[CountryCodes.UnitedStates].ssnLastFour.test(val),
367
+ errorMessage: "mustContain4Digits"
368
+ }
369
+ };
370
+ }
371
+ },
372
+ [CountryCodes.Romania]: {
373
+ label: "codNumericPersonal",
374
+ mask: { mask: makeMask(...numericInputs(13)) },
375
+ validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.Romania]),
376
+ guidanceText: {
377
+ key: "enterNDigitsForExample",
378
+ values: {
379
+ numDigits: "13",
380
+ example: "8001011234567"
381
+ }
382
+ }
383
+ },
384
+ [CountryCodes.Singapore]: {
385
+ label: "nric",
386
+ mask: {
387
+ mask: makeMask(...alphaInputs(1), ...numericInputs(7), ...alphaInputs(1)),
388
+ transformOnType: uppercase
389
+ },
390
+ validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.Singapore]),
391
+ guidanceText: {
392
+ key: "enterNCharactersWithAMixForExample",
393
+ values: {
394
+ numChars: "9",
395
+ example: "T9123456J"
396
+ }
397
+ }
398
+ },
399
+ [CountryCodes.Spain]: ({ idNumberType }) => {
400
+ switch (idNumberType) {
401
+ case "dni":
402
+ return {
403
+ label: "dni",
404
+ mask: {
405
+ mask: makeMask(
406
+ ...customInputs(1, /^[KL]$/, true),
407
+ ...numericInputs(8),
408
+ ...alphaInputs(1)
409
+ ),
410
+ transformOnType: uppercase
411
+ },
412
+ validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.Spain].dni),
413
+ guidanceText: {
414
+ key: "enterXToYCharactersWithAMixForExample",
415
+ values: {
416
+ minChars: "9",
417
+ maxChars: "10",
418
+ example: "12345678A or L12345678A"
419
+ }
420
+ }
421
+ };
422
+ case "nie":
423
+ default:
424
+ return {
425
+ label: "nie",
426
+ mask: {
427
+ mask: makeMask(
428
+ ...customInputs(1, /^[MXYZ]$/),
429
+ ...numericInputs(7),
430
+ ...numericInputs(1, true),
431
+ ...alphaInputs(1)
432
+ ),
433
+ transformOnType: uppercase
434
+ },
435
+ validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.Spain].nie),
436
+ guidanceText: {
437
+ key: "enterXToYCharactersWithAMixForExample",
438
+ values: {
439
+ minChars: "9",
440
+ maxChars: "10",
441
+ example: "X12345678A or Z6527153N"
442
+ }
443
+ }
444
+ };
445
+ }
446
+ },
447
+ [CountryCodes.Sweden]: {
448
+ label: "personnummer",
449
+ mask: {
450
+ mask: makeMask(
451
+ ...numericInputs(6),
452
+ ...numericInputs(2, true),
453
+ ...nonInputs(" - "),
454
+ ...numericInputs(4)
455
+ )
456
+ },
457
+ validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.Sweden]),
458
+ guidanceText: {
459
+ key: "enterXOrYDigitsForExample",
460
+ values: {
461
+ xDigits: "10",
462
+ yDigits: "12",
463
+ example: "640823-3234 or 19640823-3234"
464
+ }
465
+ }
466
+ },
467
+ [CountryCodes.UnitedStates]: ({ idNumberType }) => {
468
+ switch (idNumberType) {
469
+ case "ssn":
470
+ return {
471
+ label: "socialSecurityNumber",
472
+ mask: {
473
+ mask: makeMask(
474
+ ...numericInputs(3),
475
+ ...nonInputs(" - "),
476
+ ...numericInputs(2),
477
+ ...nonInputs(" - "),
478
+ ...numericInputs(4)
479
+ )
480
+ },
481
+ validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.UnitedStates].ssn),
482
+ guidanceText: {
483
+ key: "enterNDigitsForExample",
484
+ values: {
485
+ numDigits: "9",
486
+ example: "123-12-1234"
487
+ }
488
+ }
489
+ };
490
+ case "ssnLastFour":
491
+ default:
492
+ return {
493
+ label: "last4DigitsOfSocialSecurityNumber",
494
+ mask: {
495
+ mask: makeMask(...numericInputs(4))
496
+ },
497
+ validators: {
498
+ modes: ["blur"],
499
+ validate: (val) => !!val && CountryIdNumberPatterns[CountryCodes.UnitedStates].ssnLastFour.test(val),
500
+ errorMessage: "mustContain4Digits"
501
+ }
502
+ };
503
+ }
504
+ },
505
+ [CountryCodes.NewZealand]: ({ idNumberType }) => {
506
+ switch (idNumberType) {
507
+ case "passport":
508
+ return {
509
+ label: "passportNumber",
510
+ mask: {
511
+ mask: makeMask(...alphanumericInputs(9)),
512
+ transformOnType: uppercase
513
+ },
514
+ validators: validatePatternOnBlur(PassportNumberPatterns[CountryCodes.NewZealand]),
515
+ guidanceText: {
516
+ key: "enterXToYCharactersWithAMixForExample",
517
+ values: {
518
+ minChars: "8",
519
+ maxChars: "9",
520
+ example: "RA000750"
521
+ }
522
+ }
523
+ };
524
+ case "driversLicense":
525
+ default:
526
+ return {
527
+ label: "licenseNumber",
528
+ mask: {
529
+ mask: makeMask(...alphaInputs(2), ...numericInputs(6)),
530
+ transformOnType: uppercase
531
+ },
532
+ validators: validatePatternOnBlur(DriversLicenseNumberPatterns[CountryCodes.NewZealand]),
533
+ guidanceText: {
534
+ key: "enterNCharactersWithAMixForExample",
535
+ values: {
536
+ numChars: "8",
537
+ example: "KA111112"
538
+ }
539
+ }
540
+ };
541
+ }
542
+ },
543
+ [CountryCodes.HongKong]: ({ idNumberType }) => {
544
+ switch (idNumberType) {
545
+ case "proofOfIdentityCard":
546
+ return {
547
+ label: "hkid",
548
+ mask: {
549
+ mask: makeMask(
550
+ ...alphaInputs(1),
551
+ ...alphaInputs(1, true),
552
+ ...numericInputs(6),
553
+ ...nonInputs("(", { displayEagerly: false }),
554
+ ...customInputs(1, /^[0-9A]$/),
555
+ ...nonInputs(")")
556
+ ),
557
+ transformOnType: uppercase
558
+ },
559
+ validators: validatePatternOnBlur(ProofOfIdentityCardPatterns[CountryCodes.HongKong]),
560
+ guidanceText: {
561
+ key: "enterXToYCharactersWithAMixForExample",
562
+ values: {
563
+ minChars: "8",
564
+ maxChars: "9",
565
+ example: "Z683365(5) or AB123456(A)"
566
+ }
567
+ }
568
+ };
569
+ case "passport":
570
+ return {
571
+ label: "passportNumber",
572
+ mask: {
573
+ mask: makeMask(...alphanumericInputs(9)),
574
+ transformOnType: uppercase
575
+ },
576
+ validators: validatePatternOnBlur(PassportNumberPatterns[CountryCodes.HongKong]),
577
+ guidanceText: {
578
+ key: "enterNCharactersWithAMixForExample",
579
+ values: {
580
+ numChars: "9",
581
+ example: "H12345678"
582
+ }
583
+ }
584
+ };
585
+ case "driversLicense":
586
+ default:
587
+ return {
588
+ label: "licenseNumber",
589
+ mask: {
590
+ mask: makeMask(...alphanumericInputs(7), spacer, ...alphanumericInputs(1)),
591
+ transformOnType: uppercase
592
+ },
593
+ validators: validatePatternOnBlur(DriversLicenseNumberPatterns[CountryCodes.HongKong]),
594
+ guidanceText: {
595
+ key: "enterNCharactersForExample",
596
+ values: {
597
+ numChars: "8",
598
+ example: "A123452 0"
599
+ }
600
+ }
601
+ };
602
+ }
603
+ },
604
+ [CountryCodes.Australia]: ({ idNumberType }) => {
605
+ switch (idNumberType) {
606
+ case "passport":
607
+ return {
608
+ label: "passportNumber",
609
+ mask: {
610
+ mask: makeMask(...alphanumericInputs(9)),
611
+ transformOnType: uppercase
612
+ },
613
+ validators: validatePatternOnBlur(PassportNumberPatterns[CountryCodes.Australia]),
614
+ guidanceText: {
615
+ key: "enterXToYCharactersWithAMixForExample",
616
+ values: {
617
+ minChars: "8",
618
+ maxChars: "9",
619
+ example: "RA0123456"
620
+ }
621
+ }
622
+ };
623
+ case "driversLicense":
624
+ default:
625
+ return {
626
+ label: "licenseNumber",
627
+ mask: {
628
+ mask: makeMask(...alphanumericInputs(6), ...alphanumericInputs(5, true)),
629
+ transformOnType: uppercase
630
+ },
631
+ validators: validatePatternOnBlur(DriversLicenseNumberPatterns[CountryCodes.Australia]),
632
+ guidanceText: {
633
+ key: "enterXToYCharactersWithAMixForExample",
634
+ values: {
635
+ minChars: "5",
636
+ maxChars: "11",
637
+ example: "2093628291"
638
+ }
639
+ }
640
+ };
641
+ }
642
+ }
643
+ };
644
+ const licenseCardNumberDefaultMetadata = {
645
+ label: "licenseCardNumber"
646
+ };
647
+ const licenseCardNumberDefaultConfig = {
648
+ [CountryCodes.NewZealand]: {
649
+ label: "licenceVersionNumber",
650
+ mask: { mask: makeMask(...numericInputs(3)) },
651
+ validators: validatePatternOnBlur(DriversLicenseCardNumberPatterns[CountryCodes.NewZealand]),
652
+ guidanceText: {
653
+ key: "enterNDigitsForExample",
654
+ values: {
655
+ numDigits: "3",
656
+ example: "108"
657
+ }
658
+ }
659
+ },
660
+ [CountryCodes.Australia]: {
661
+ label: "licenseCardNumber",
662
+ mask: {
663
+ mask: makeMask(...alphanumericInputs(6), ...alphanumericInputs(5, true)),
664
+ transformOnType: uppercase
665
+ },
666
+ validators: validatePatternOnBlur(DriversLicenseCardNumberPatterns[CountryCodes.Australia]),
667
+ guidanceText: {
668
+ key: "enterXToYCharactersWithAMixForExample",
669
+ values: {
670
+ minChars: "5",
671
+ maxChars: "11",
672
+ example: "2093628291"
673
+ }
674
+ }
675
+ }
676
+ };
677
+ const idNumberExemptDefaultMetadata = {
678
+ label: "identityNumberExempt"
679
+ };
680
+ const idNumberExemptDefaultConfig = {
681
+ [CountryCodes.UnitedStates]: {
682
+ label: "identityNumberExempt__US"
683
+ },
684
+ [CountryCodes.Canada]: {
685
+ label: "identityNumberExempt__CA"
686
+ },
687
+ [CountryCodes.Singapore]: {
688
+ label: "uploadDocumentForNric"
689
+ }
690
+ };
103
691
  const onfidoDocumentTypeMapping = [
104
692
  { id: "driversLicense", name: "driversLicense", hasBackPage: true },
105
693
  { id: "identityCard", name: "identityCard", hasBackPage: true },
106
694
  { id: "passport", name: "passport", hasBackPage: false }
107
695
  ];
696
+ const idVerificationProviderId = signal();
697
+ const showIndividualMotionCapture = signal(void 0);
698
+ const setShowIndividualMotionCapture = (showMotionCapture) => {
699
+ showIndividualMotionCapture.value = showMotionCapture;
700
+ };
701
+ const hasMotionCaptureScenario = signal(void 0);
702
+ const setHasMotionCaptureScenario = (scenarios) => {
703
+ hasMotionCaptureScenario.value = scenarios?.includes(Scenarios.L_MOTION);
704
+ };
705
+ const allowedRolesForMotionCapture = [DecisionMakerTypes.SIGNATORY];
706
+ const shouldShowMotionCapture = ({
707
+ capabilities,
708
+ userRoles,
709
+ taskType,
710
+ hasMotionScenario
711
+ }) => {
712
+ if (!hasMotionScenario) {
713
+ return false;
714
+ }
715
+ const isIndividual = taskType === TaskTypes.INDIVIDUAL;
716
+ const hasRequiredRole = userRoles?.some((role) => allowedRolesForMotionCapture.includes(role));
717
+ const hasRequiredCapability = capabilities?.issueBankAccount?.requested ?? false;
718
+ return (isIndividual || hasRequiredRole) && hasRequiredCapability;
719
+ };
720
+ const idDocumentUploadFields = [
721
+ "idDocumentType",
722
+ "idFrontPage",
723
+ "idBackPage",
724
+ "instantIdVerificationData"
725
+ ];
726
+ function IdDocumentManualUpload(props) {
727
+ const { t } = useTranslation(["common", "individual"]);
728
+ const { data, id, name, errors, valid, handleFieldChange, country } = props;
729
+ if (!handleFieldChange) {
730
+ return;
731
+ }
732
+ const isOptional = !(props?.formVerificationErrors && Object.keys(props?.formVerificationErrors)?.length === 0);
733
+ const idDocumentTypeOptions = getLocalizedIdDocumentTypeOptions(country);
734
+ const hasBackPage = (documentType) => {
735
+ if (documentType) {
736
+ return idDocumentTypeOptions.find(({ id: id2 }) => documentType === id2)?.hasBackPage;
737
+ }
738
+ };
739
+ const hasBack = hasBackPage(data?.idDocumentType);
740
+ const formUtils = createFormUtils(props, t);
741
+ return /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-individual-document-upload adyen-kyc-individual-document-upload--idDocument", children: [
742
+ /* @__PURE__ */ jsx(FormHeader, { heading: t(($) => $["idDocument"]) }),
743
+ /* @__PURE__ */ jsx(
744
+ ErrorPanel,
745
+ {
746
+ verificationErrors: props?.formVerificationErrors,
747
+ validationErrors: props?.fieldValidationErrors,
748
+ formUtils,
749
+ id: "ariaErrorField"
750
+ }
751
+ ),
752
+ /* @__PURE__ */ jsx("div", { className: "adyen-kyc-document-upload__subtitle", children: /* @__PURE__ */ jsx(Trans, { t, i18nKey: ($) => $["idUploadDocumentSubtitle"], values: { name } }) }),
753
+ /* @__PURE__ */ jsx(
754
+ Field,
755
+ {
756
+ name: "idDocumentType",
757
+ label: t(($) => $["selectDocumentType"]),
758
+ errorMessage: errors?.idDocumentType?.errorMessage,
759
+ isValid: valid?.idDocumentType,
760
+ children: (childProps) => /* @__PURE__ */ jsx(
761
+ Select,
762
+ {
763
+ ...childProps,
764
+ onChange: handleFieldChange("idDocumentType", "input"),
765
+ name: "idDocumentType",
766
+ placeholder: t(($) => $["selectDocument"]),
767
+ selected: data?.idDocumentType,
768
+ items: idDocumentTypeOptions.map(({ id: id2, name: name2 }) => ({
769
+ id: id2,
770
+ name: t(($) => $[name2])
771
+ }))
772
+ }
773
+ )
774
+ }
775
+ ),
776
+ /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-upload-field__subtitle", children: [
777
+ " ",
778
+ t(($) => $["requirements"])
779
+ ] }),
780
+ /* @__PURE__ */ jsxs("ul", { children: [
781
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["documentNotExpiredOrDamaged"], { ns: "individual" }) }),
782
+ /* @__PURE__ */ jsx("li", { children: hasBackPage(data?.idDocumentType) ? t(($) => $["includeFrontAndBack"], { ns: "individual" }) : t(($) => $["providePageWithPhotoAndCode"], { ns: "individual" }) }),
783
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["fullDocumentVisible"], { ns: "individual" }) }),
784
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["imagesInColor"], { ns: "individual" }) })
785
+ ] }),
786
+ data?.idDocumentType && /* @__PURE__ */ jsxs(Fragment, { children: [
787
+ /* @__PURE__ */ jsx(DocumentGuidance, { type: data?.idDocumentType, className: "adyen-kyc-u-margin-y-16" }),
788
+ /* @__PURE__ */ jsx(
789
+ Dropzone,
790
+ {
791
+ name: "idFrontPage",
792
+ label: t(($) => $["frontPage"], { ns: "individual" }),
793
+ defaultData: data,
794
+ id,
795
+ isOptional,
796
+ shouldValidate: true,
797
+ handleFieldChange,
798
+ errors,
799
+ valid
800
+ }
801
+ )
802
+ ] }),
803
+ data?.idDocumentType && hasBack && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-u-margin-top-16", children: /* @__PURE__ */ jsx(
804
+ Dropzone,
805
+ {
806
+ name: "idBackPage",
807
+ label: t(($) => $["backPage"], { ns: "individual" }),
808
+ defaultData: data,
809
+ id,
810
+ isOptional,
811
+ shouldValidate: true,
812
+ handleFieldChange,
813
+ errors,
814
+ valid
815
+ }
816
+ ) })
817
+ ] });
818
+ }
819
+ const getIdVerificationToken = async (rootLegalEntityId, baseUrl, request) => httpPost(
820
+ {
821
+ baseUrl,
822
+ path: `legalEntities/${rootLegalEntityId}/providers/idVerification/initiate`
823
+ },
824
+ request
825
+ );
826
+ const useIdVerificationToken = ({ firstName, lastName, residencyCountry }, legalEntityId, options2) => {
827
+ const { rootLegalEntityId, baseUrl } = useApiContext();
828
+ const data = firstName && lastName && residencyCountry ? {
829
+ name: { firstName, lastName },
830
+ country: residencyCountry,
831
+ origin: `${window.location.origin}/*`,
832
+ consents: [
833
+ {
834
+ name: "privacy_notices_read",
835
+ granted: true
836
+ }
837
+ ],
838
+ ...legalEntityId ? { legalEntityId } : {}
839
+ // Do not include legalEntityId if we don't know yet. Eg.: decision-makers flow the associated legalEntityId.
840
+ } : void 0;
841
+ return useQuery({
842
+ enabled: Boolean(firstName && lastName && residencyCountry),
843
+ queryKey: ["idVerificationToken", data],
844
+ queryFn: () => getIdVerificationToken(rootLegalEntityId.value, baseUrl.value, data),
845
+ ...options2
846
+ });
847
+ };
848
+ const containerId = "adyen-kyc-id-verification";
849
+ const getOnfidoLocaleConfig = (i18n) => {
850
+ const language = i18n.locale.substring(0, 2);
851
+ return language === "en" ? {
852
+ locale: language,
853
+ phrases: {
854
+ "country_select.button_primary": i18n.get("continue"),
855
+ "doc_submit.title_id_back": i18n.get("identityCardBack"),
856
+ "doc_submit.title_id_front": i18n.get("identityCardFront"),
857
+ "doc_submit.title_license_back": i18n.get("drivinglicenseBack"),
858
+ "doc_submit.title_license_front": i18n.get("drivinglicenseFront"),
859
+ "doc_submit.title_passport": i18n.get("passportPhotoPage"),
860
+ "doc_submit.title_permit_back": i18n.get("residencePermitBack"),
861
+ "doc_submit.title_permit_front": i18n.get("residencePermitFront")
862
+ }
863
+ } : language;
864
+ };
865
+ const initOnfido = async ({
866
+ containerEl,
867
+ token,
868
+ i18n,
869
+ onIdVerificationComplete,
870
+ onIdVerificationError,
871
+ showMotionCapture
872
+ }) => {
873
+ const steps = [
874
+ {
875
+ type: "document",
876
+ options: {
877
+ documentTypes: {
878
+ passport: true,
879
+ driving_licence: true,
880
+ national_identity_card: true,
881
+ residence_permit: false
882
+ }
883
+ }
884
+ },
885
+ showMotionCapture ? { type: "face", options: { requestedVariant: "motion" } } : void 0
886
+ ].filter(Boolean);
887
+ return Onfido.init({
888
+ token,
889
+ containerEl,
890
+ disableAnalytics: false,
891
+ onComplete: onIdVerificationComplete,
892
+ onError: onIdVerificationError,
893
+ steps,
894
+ language: getOnfidoLocaleConfig(i18n)
895
+ });
896
+ };
897
+ const logger$6 = createLogger();
898
+ function IdVerification({
899
+ minimumApplicantDetails,
900
+ legalEntityId,
901
+ onIdVerificationError,
902
+ onIdVerificationComplete
903
+ }) {
904
+ const containerRef = useRef(null);
905
+ const { i18n } = useI18nContext();
906
+ const {
907
+ data: tokenResponse,
908
+ isLoading,
909
+ isError
910
+ } = useIdVerificationToken(minimumApplicantDetails, legalEntityId);
911
+ const onfidoSdk = useRef();
912
+ useEffect(() => {
913
+ (async () => {
914
+ if (!tokenResponse) return;
915
+ const { sdkToken, id: providerId } = tokenResponse;
916
+ if (!containerRef.current) throw new Error("No container for Onfido found");
917
+ idVerificationProviderId.value = providerId;
918
+ onfidoSdk.current = await initOnfido({
919
+ containerEl: containerRef.current,
920
+ token: sdkToken,
921
+ i18n,
922
+ onIdVerificationError,
923
+ onIdVerificationComplete,
924
+ language: getOnfidoLocaleConfig(i18n),
925
+ showMotionCapture: showIndividualMotionCapture.value
926
+ });
927
+ })().catch(logger$6.error);
928
+ return async () => {
929
+ if (onfidoSdk.current) await onfidoSdk.current.tearDown();
930
+ };
931
+ }, [tokenResponse, i18n]);
932
+ return /* @__PURE__ */ jsx(
933
+ LoaderWrapper,
934
+ {
935
+ status: tokenResponse ? "success" : isLoading ? "loading" : isError ? "error" : "pending",
936
+ children: /* @__PURE__ */ jsx("div", { ref: containerRef, className: containerId })
937
+ }
938
+ );
939
+ }
940
+ function IdDocumentAlreadyUpload(props) {
941
+ const { onClickSubmitDocumentAgain } = props;
942
+ const { t } = useTranslation(["individual"]);
943
+ const { t: commonT } = useTranslation("common");
944
+ const formUtils = createFormUtils(props, commonT);
945
+ return /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-individual-document-upload adyen-kyc-individual-document-upload--idDocument", children: [
946
+ /* @__PURE__ */ jsx(FormHeader, { heading: t(($) => $["documentVerification"]) }),
947
+ /* @__PURE__ */ jsx(
948
+ ErrorPanel,
949
+ {
950
+ verificationErrors: props?.formVerificationErrors,
951
+ validationErrors: props?.fieldValidationErrors,
952
+ formUtils,
953
+ id: "ariaErrorField"
954
+ }
955
+ ),
956
+ /* @__PURE__ */ jsx("div", { className: "adyen-kyc-upload-field__subtitle", children: t(($) => $["youHaveSuccessfullyProvidedTheIdDocument"]) }),
957
+ /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-upload-field__subtitle", children: [
958
+ /* @__PURE__ */ jsxs("span", { children: [
959
+ t(($) => $["madeAMistake"]),
960
+ " "
961
+ ] }),
962
+ /* @__PURE__ */ jsx(
963
+ "button",
964
+ {
965
+ className: "adyen-kyc-link",
966
+ title: t(($) => $["submitIdDocumentsAgain"]),
967
+ type: "button",
968
+ onClick: onClickSubmitDocumentAgain,
969
+ children: t(($) => $["submitIdDocumentsAgain"])
970
+ }
971
+ )
972
+ ] })
973
+ ] });
974
+ }
975
+ const logger$5 = createLogger();
976
+ function IdDocumentInstantVerification(props) {
977
+ const { data, minimumApplicantDetails, legalEntityId, handleOnBack, handleFieldChange } = props;
978
+ const { i18n } = useI18nContext();
979
+ const handleIdVerificationComplete = (onfidoResult) => {
980
+ handleFieldChange?.("instantIdVerificationData")(onfidoResult);
981
+ handleFieldChange?.("idDocumentType")(onfidoResult.document_front?.type);
982
+ };
983
+ const onClickSubmitDocumentAgain = () => {
984
+ handleFieldChange?.("instantIdVerificationData")(null);
985
+ handleFieldChange?.("idDocumentType")(null);
986
+ };
987
+ const isAlreadyUploaded = !!data?.idDocumentType || !!data?.instantIdVerificationData;
988
+ return /* @__PURE__ */ jsx("div", { className: "adyen-kyc-individual-document-upload adyen-kyc-individual-document-upload--idDocument", children: isAlreadyUploaded ? /* @__PURE__ */ jsx(IdDocumentAlreadyUpload, { onClickSubmitDocumentAgain }) : /* @__PURE__ */ jsxs(Fragment, { children: [
989
+ minimumApplicantDetails && /* @__PURE__ */ jsx(
990
+ IdVerification,
991
+ {
992
+ minimumApplicantDetails,
993
+ legalEntityId,
994
+ onIdVerificationComplete: handleIdVerificationComplete,
995
+ onIdVerificationError: logger$5.error
996
+ }
997
+ ),
998
+ /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-document-upload__manual-upload", children: [
999
+ i18n.get("canNotCompleteInstantVerification"),
1000
+ " ",
1001
+ /* @__PURE__ */ jsx(
1002
+ "button",
1003
+ {
1004
+ className: "adyen-kyc-link",
1005
+ title: i18n.get("goBackAndProvideDocumentScans"),
1006
+ type: "button",
1007
+ onClick: () => {
1008
+ handleOnBack?.();
1009
+ },
1010
+ children: i18n.get("goBackAndProvideDocumentScans")
1011
+ }
1012
+ )
1013
+ ] })
1014
+ ] }) });
1015
+ }
1016
+ function IdDocumentUpload(props) {
1017
+ const { idVerificationMethodSelected, minimumApplicantDetails, legalEntityId, country } = props;
1018
+ const { data: providerStatus } = useProviderStatus({
1019
+ providers: ["idDocument"],
1020
+ country
1021
+ });
1022
+ return idVerificationMethodSelected === "instantVerification" && providerStatus?.statuses.idDocument.enabled ? /* @__PURE__ */ jsx(
1023
+ IdDocumentInstantVerification,
1024
+ {
1025
+ ...props,
1026
+ minimumApplicantDetails,
1027
+ legalEntityId
1028
+ }
1029
+ ) : /* @__PURE__ */ jsx(IdDocumentManualUpload, { ...props });
1030
+ }
1031
+ const idVerificationMethods = ["instantVerification", "manualVerification"];
1032
+ const instantIdVerificationMethods = ["instantVerification"];
1033
+ const instantVerificationImage = lazy(
1034
+ () => import("./id-verification-instant-BUVBO4R3.js")
1035
+ );
1036
+ const manualVerificationImage = lazy(
1037
+ () => import("./id-verification-manual-B3YZALYU.js")
1038
+ );
1039
+ const methodsMetadata = {
1040
+ instantVerification: {
1041
+ name: "instantVerification",
1042
+ description: "instantIDVerificationDescription",
1043
+ svgImport: instantVerificationImage,
1044
+ provider: {
1045
+ name: "Onfido",
1046
+ svgName: `onfido-logo`
1047
+ }
1048
+ },
1049
+ manualVerification: {
1050
+ name: "manualUpload",
1051
+ description: "manualIDVerificationDescription",
1052
+ svgImport: manualVerificationImage
1053
+ }
1054
+ };
1055
+ const IdVerificationMethodOptionIcon = ({
1056
+ method
1057
+ }) => {
1058
+ const { svgImport } = methodsMetadata[method];
1059
+ return /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-radio-group-card__illustration", children: [
1060
+ /* @__PURE__ */ jsx(Image, { lazyLoadedImage: svgImport }),
1061
+ ";"
1062
+ ] });
1063
+ };
1064
+ const IdVerificationMethodOptionFooter = ({
1065
+ method
1066
+ }) => {
1067
+ const { t } = useTranslation("common");
1068
+ const { provider } = methodsMetadata[method];
1069
+ return provider ? /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "adyen-kyc-field-verification-methods__footer", children: [
1070
+ t(($) => $["poweredBy"]),
1071
+ /* @__PURE__ */ jsx(
1072
+ Icon,
1073
+ {
1074
+ className: "adyen-kyc-field-verification-methods__logo",
1075
+ name: provider.svgName,
1076
+ title: provider.name
1077
+ }
1078
+ )
1079
+ ] }) : null;
1080
+ };
1081
+ function IdVerificationMethod$1(props) {
1082
+ const {
1083
+ data,
1084
+ fieldValidationErrors,
1085
+ formVerificationErrors,
1086
+ name,
1087
+ countryOfResidence,
1088
+ handleFieldChange,
1089
+ errors
1090
+ } = props;
1091
+ const { t } = useTranslation(["individual"]);
1092
+ const { t: commonT } = useTranslation("common");
1093
+ if (!handleFieldChange) {
1094
+ return;
1095
+ }
1096
+ const formUtils = createFormUtils(props, commonT);
1097
+ const allowedIdVerificationMethods = showIndividualMotionCapture.value ? instantIdVerificationMethods : idVerificationMethods;
1098
+ return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs("form", { className: "adyen-kyc-verification-method", children: [
1099
+ /* @__PURE__ */ jsx(FormHeader, { heading: t(($) => $["verifyIndividualIdentity"], { name }) }),
1100
+ /* @__PURE__ */ jsx(
1101
+ ErrorPanel,
1102
+ {
1103
+ verificationErrors: formVerificationErrors,
1104
+ validationErrors: fieldValidationErrors,
1105
+ formUtils,
1106
+ id: "ariaErrorField"
1107
+ }
1108
+ ),
1109
+ /* @__PURE__ */ jsx(
1110
+ Field,
1111
+ {
1112
+ el: "fieldset",
1113
+ name: "verificationMethods",
1114
+ errorMessage: formUtils.getErrorMessage(
1115
+ "idVerificationMethod",
1116
+ errors,
1117
+ fieldValidationErrors
1118
+ ),
1119
+ children: (childProps) => /* @__PURE__ */ jsx(
1120
+ RadioGroupCard,
1121
+ {
1122
+ ...childProps,
1123
+ name: "idVerificationMethod",
1124
+ options: allowedIdVerificationMethods,
1125
+ onSelect: handleFieldChange("idVerificationMethod"),
1126
+ selected: data?.idVerificationMethod,
1127
+ optionId: (method) => method,
1128
+ optionName: (method) => methodsMetadata[method].name,
1129
+ optionDescription: (method) => methodsMetadata[method].description,
1130
+ className: "adyen-kyc-field-verification-methods",
1131
+ optionClassNames: () => ({
1132
+ label: "adyen-kyc-field-verification-methods__card"
1133
+ }),
1134
+ renderOptionIcon: (method) => /* @__PURE__ */ jsx(IdVerificationMethodOptionIcon, { method }),
1135
+ renderOptionFooter: (method) => /* @__PURE__ */ jsx(IdVerificationMethodOptionFooter, { method }),
1136
+ floatingRadio: true
1137
+ }
1138
+ )
1139
+ }
1140
+ ),
1141
+ /* @__PURE__ */ jsx(
1142
+ ContextGuidance,
1143
+ {
1144
+ title: t(($) => $["howVerificationWithOnfidoWork"]),
1145
+ content: /* @__PURE__ */ jsxs(Fragment, { children: [
1146
+ /* @__PURE__ */ jsx(Typography, { className: "adyen-kyc-u-margin-bottom-8", children: t(($) => $["onfidoIsOurTrustedPartner"]) }),
1147
+ /* @__PURE__ */ jsxs("ul", { children: [
1148
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["usePhoneToScanId"]) }),
1149
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["onfidoWillGiveFeedbackInRealTime"]) }),
1150
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["theIdCheckWillBeAutomaticallyValidated"]) })
1151
+ ] }),
1152
+ /* @__PURE__ */ jsx(Typography, { className: "adyen-kyc-u-margin-bottom-8", children: t(($) => $["adyenKeepsDataAsLongAsLegallyRequired"]) }),
1153
+ /* @__PURE__ */ jsx(Link, { href: "https://www.adyen.com/policies-and-disclaimer/privacy-policy", external: true, children: commonT(($) => $["adyenPrivacyPolicy"]) })
1154
+ ] }),
1155
+ titleId: "howVerificationWithOnfidoWork",
1156
+ contentId: "howVerificationWithOnfidoWorkContent"
1157
+ }
1158
+ ),
1159
+ (countryOfResidence === CountryCodes.PuertoRico || countryOfResidence === CountryCodes.UnitedStates) && data?.idVerificationMethod === "instantVerification" && /* @__PURE__ */ jsx(
1160
+ Trans,
1161
+ {
1162
+ t,
1163
+ ns: "individual",
1164
+ i18nKey: ($) => $["byProceedingToTheNextStepYouConfirmThatYouHaveReadUnderstandAndAcceptTheTerms"],
1165
+ components: {
1166
+ el1: /* @__PURE__ */ jsx(Link, { href: "https://onfido.com/privacy/", external: true, inline: true, children: "text" }),
1167
+ el2: /* @__PURE__ */ jsx(Link, { href: "https://onfido.com/terms-of-service/", external: true, inline: true, children: "text" })
1168
+ }
1169
+ }
1170
+ )
1171
+ ] }) });
1172
+ }
1173
+ function IndividualIdNumberTypeSelector({
1174
+ country,
1175
+ selected,
1176
+ handleFieldChange
1177
+ }) {
1178
+ const { t } = useTranslation("common");
1179
+ const options2 = useMemo(
1180
+ () => individualIdNumberOptions[country] ?? [],
1181
+ [country]
1182
+ );
1183
+ useEffect(() => {
1184
+ if (!selected && options2.length > 0) {
1185
+ handleFieldChange(options2[0].id);
1186
+ }
1187
+ }, [options2, selected, handleFieldChange]);
1188
+ if (options2.length <= 1) return null;
1189
+ return /* @__PURE__ */ jsx(
1190
+ Field,
1191
+ {
1192
+ el: "fieldset",
1193
+ name: "individualIdNumberType",
1194
+ label: t(($) => $["whichTypeOfIdNumberDoYouHave"]),
1195
+ children: (childProps) => /* @__PURE__ */ jsx(
1196
+ RadioGroup,
1197
+ {
1198
+ ...childProps,
1199
+ name: "individualIdNumberType",
1200
+ items: options2,
1201
+ value: selected,
1202
+ onChange: (value) => handleFieldChange(value)
1203
+ }
1204
+ )
1205
+ }
1206
+ );
1207
+ }
1208
+ const PatriotActDisclosure = () => {
1209
+ const { t } = useTranslation("common");
1210
+ return /* @__PURE__ */ jsx("div", { className: "adyen-kyc-u-margin-bottom-12", children: /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: t(($) => $["toHelpTheGovernmentFight"]) }) });
1211
+ };
1212
+ const decisionMakerRoleFields = ["role"];
1213
+ const DecisionMakerRole = (props) => {
1214
+ const {
1215
+ data,
1216
+ fieldValidationErrors,
1217
+ allowedRoles,
1218
+ trustedRoles = [],
1219
+ handleFieldChange,
1220
+ valid,
1221
+ errors
1222
+ } = props;
1223
+ const { t } = useTranslation("common");
1224
+ const formUtils = createFormUtils(props, t);
1225
+ const changeRoles = (roles) => {
1226
+ handleFieldChange?.("role", "input")(roles);
1227
+ };
1228
+ return /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field__role", children: formUtils.isRequiredField("role", false) && /* @__PURE__ */ jsx(
1229
+ Field,
1230
+ {
1231
+ el: "fieldset",
1232
+ name: "role",
1233
+ label: formUtils.getLabel("role", "selectAllTheRolesThatThisDecisionMakerHolds"),
1234
+ errorMessage: formUtils.getErrorMessage("role", errors, fieldValidationErrors),
1235
+ isValid: valid?.role,
1236
+ showErrorIconBottom: true,
1237
+ children: (childProps) => /* @__PURE__ */ jsx(
1238
+ MultiSelectList,
1239
+ {
1240
+ ...childProps,
1241
+ options: allowedRoles ?? [],
1242
+ selected: data?.role ?? [],
1243
+ onSelect: changeRoles,
1244
+ mapToSelectItem: (role) => ({
1245
+ ...makeSelectItemForRole(role, t),
1246
+ disabled: allowedRoles && !allowedRoles.includes(role) || trustedRoles.includes(role)
1247
+ })
1248
+ }
1249
+ )
1250
+ }
1251
+ ) });
1252
+ };
1253
+ const nomineeFields = [
1254
+ "nomineeDirector",
1255
+ "nomineeShareholder"
1256
+ ];
1257
+ const NomineeRadioIds = {
1258
+ YES: "Yes",
1259
+ NO: "No"
1260
+ };
1261
+ const nomineeRadioItems = [
1262
+ {
1263
+ id: NomineeRadioIds.YES,
1264
+ name: "yes"
1265
+ },
1266
+ {
1267
+ id: NomineeRadioIds.NO,
1268
+ name: "no"
1269
+ }
1270
+ ];
1271
+ const NomineeDecisionMakerRole = (props) => {
1272
+ const { data, fieldValidationErrors, errors, handleFieldChange, valid } = props;
1273
+ const { t } = useTranslation("individual");
1274
+ const { t: commonT } = useTranslation("common");
1275
+ const formUtils = createFormUtils(props, commonT);
1276
+ if (!handleFieldChange) {
1277
+ return;
1278
+ }
1279
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1280
+ formUtils.isRequiredField("nomineeShareholder") && /* @__PURE__ */ jsx(
1281
+ Field,
1282
+ {
1283
+ el: "fieldset",
1284
+ name: "nomineeShareholder",
1285
+ classNameModifiers: ["nominee"],
1286
+ label: formUtils.getLabel("nomineeShareholder", "isThisPersonANomineeShareholder"),
1287
+ errorMessage: formUtils.getErrorMessage(
1288
+ "nomineeShareholder",
1289
+ errors,
1290
+ fieldValidationErrors
1291
+ ),
1292
+ helper: t(($) => $["aNomineeShareholderHoldsShares"]),
1293
+ children: (childProps) => /* @__PURE__ */ jsx(
1294
+ RadioGroup,
1295
+ {
1296
+ ...childProps,
1297
+ name: "nomineeShareholder",
1298
+ items: nomineeRadioItems,
1299
+ value: data?.nomineeShareholder,
1300
+ disabled: false,
1301
+ onChange: handleFieldChange("nomineeShareholder"),
1302
+ "aria-required": true,
1303
+ "aria-invalid": !valid?.nomineeShareholder
1304
+ }
1305
+ )
1306
+ }
1307
+ ),
1308
+ formUtils.isRequiredField("nomineeDirector") && /* @__PURE__ */ jsx(
1309
+ Field,
1310
+ {
1311
+ el: "fieldset",
1312
+ name: "nomineeDirector",
1313
+ classNameModifiers: ["nominee"],
1314
+ label: formUtils.getLabel("nomineeDirector", "isThisPersonANomineeDirector"),
1315
+ errorMessage: formUtils.getErrorMessage("nomineeDirector", errors, fieldValidationErrors),
1316
+ helper: t(($) => $["aNomineeDirectorIsAppointed"]),
1317
+ children: (childProps) => /* @__PURE__ */ jsx(
1318
+ RadioGroup,
1319
+ {
1320
+ ...childProps,
1321
+ name: "nomineeDirector",
1322
+ items: nomineeRadioItems,
1323
+ value: data?.nomineeDirector,
1324
+ disabled: false,
1325
+ onChange: handleFieldChange("nomineeDirector"),
1326
+ "aria-required": true,
1327
+ "aria-invalid": !valid?.nomineeDirector
1328
+ }
1329
+ )
1330
+ }
1331
+ )
1332
+ ] });
1333
+ };
1334
+ const idNumberFields = ["idNumber", "idNumberExempt"];
1335
+ function IdentityNumber(props) {
1336
+ const { t } = useTranslation("common");
1337
+ const {
1338
+ country,
1339
+ data,
1340
+ errors,
1341
+ fieldValidationErrors,
1342
+ idNumberType,
1343
+ obscuredFields,
1344
+ requiredFields,
1345
+ optionalFields,
1346
+ fieldConfig: propFieldConfig,
1347
+ readOnlyFields,
1348
+ handleFieldChange,
1349
+ valid
1350
+ } = props;
1351
+ if (!handleFieldChange) {
1352
+ return;
1353
+ }
1354
+ const fieldConfig2 = propFieldConfig ?? defaultFieldConfig;
1355
+ const metadata = resolveFieldMetadata(
1356
+ fieldConfig2[country],
1357
+ { idNumberType },
1358
+ defaultFieldMetadata
1359
+ );
1360
+ const idNumberExemptMetadata = resolveFieldMetadata(
1361
+ idNumberExemptDefaultConfig[country],
1362
+ {},
1363
+ idNumberExemptDefaultMetadata
1364
+ );
1365
+ const mergedProps = mergeFieldMetadataIntoProps(
1366
+ "idNumberExempt",
1367
+ idNumberExemptMetadata,
1368
+ mergeFieldMetadataIntoProps("idNumber", metadata, {
1369
+ requiredFields,
1370
+ optionalFields,
1371
+ obscuredFields,
1372
+ readOnlyFields
1373
+ })
1374
+ );
1375
+ const formUtils = createFormUtils(mergedProps, t);
1376
+ const errorMessage = formUtils.getErrorMessage("idNumber", errors, fieldValidationErrors);
1377
+ return /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field__id-number", children: formUtils.isVisibleField("idNumber") && /* @__PURE__ */ jsxs(Fragment, { children: [
1378
+ /* @__PURE__ */ jsx(
1379
+ MaskedInput,
1380
+ {
1381
+ name: "idNumber",
1382
+ type: "text",
1383
+ label: formUtils.getLabel("idNumber", "idNumber"),
1384
+ formatGuidance: formUtils.getGuidanceText("idNumber"),
1385
+ errorMessage,
1386
+ shouldValidate: errors?.idNumber?.hasError,
1387
+ isValid: !!valid?.idNumber,
1388
+ "aria-required": formUtils.isRequiredField("idNumber"),
1389
+ "aria-invalid": !valid?.idNumber,
1390
+ disabled: data?.idNumberExempt,
1391
+ onBlur: handleFieldChange("idNumber", "blur"),
1392
+ readonly: formUtils.isReadOnly("idNumber"),
1393
+ value: data?.idNumberExempt ? "" : data?.idNumber ?? "",
1394
+ onInput: (e) => {
1395
+ handleFieldChange("idNumber", "input")(e);
1396
+ handleFieldChange("idNumberExempt", "input")(false);
1397
+ },
1398
+ acceptObscuredValue: formUtils?.isObscured("idNumber"),
1399
+ ...formUtils.getMask("idNumber")
1400
+ }
1401
+ ),
1402
+ /* @__PURE__ */ jsx(Field, { name: "idNumberExempt", children: (childProps) => formUtils.isVisibleField("idNumberExempt") && /* @__PURE__ */ jsx(
1403
+ Checkbox,
1404
+ {
1405
+ ...childProps,
1406
+ label: formUtils.getLabel("idNumberExempt"),
1407
+ checked: Boolean(data?.idNumberExempt),
1408
+ name: "idNumberExempt",
1409
+ onChange: handleFieldChange("idNumberExempt")
1410
+ }
1411
+ ) })
1412
+ ] }) });
1413
+ }
1414
+ function NameFields(props) {
1415
+ const { formProps, fieldConfigs } = props;
1416
+ const { t } = useTranslation("common");
1417
+ const { data, handleFieldChange, errors, fieldValidationErrors } = formProps;
1418
+ if (!handleFieldChange) {
1419
+ return;
1420
+ }
1421
+ const formUtils = createFormUtils(formProps, t);
1422
+ return /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: fieldConfigs.map(
1423
+ ({ name, isValid, label, helper }) => formUtils.isRequiredField(name) && /* @__PURE__ */ jsx(
1424
+ Field,
1425
+ {
1426
+ name,
1427
+ label: formUtils.getLabel(label),
1428
+ errorMessage: formUtils.getErrorMessage(name, errors, fieldValidationErrors),
1429
+ isValid,
1430
+ helper: helper && formUtils.getLabel(helper),
1431
+ children: (childProps) => /* @__PURE__ */ jsx(
1432
+ InputText,
1433
+ {
1434
+ ...childProps,
1435
+ name,
1436
+ value: data?.[name],
1437
+ readonly: formUtils.isReadOnly(name),
1438
+ onInput: handleFieldChange(name, "input"),
1439
+ onBlur: handleFieldChange(name, "blur"),
1440
+ trimOnBlur: true,
1441
+ spellCheck: false,
1442
+ "aria-required": true,
1443
+ "aria-invalid": !isValid
1444
+ }
1445
+ )
1446
+ },
1447
+ name
1448
+ )
1449
+ ) });
1450
+ }
1451
+ const jaHaniNameFields = [
1452
+ "jaHaniFirstName",
1453
+ "jaHaniLastName"
1454
+ ];
1455
+ const jaKanaNameFields = [
1456
+ "jaKanaFirstName",
1457
+ "jaKanaLastName"
1458
+ ];
1459
+ const LocalizedNameFields = (props) => {
1460
+ const { errors, id, handleFieldChange, country } = props;
1461
+ const jaHaniNameProps = getFieldProps(props, jaHaniNameFields);
1462
+ const jaKanaNameProps = getFieldProps(props, jaKanaNameFields);
1463
+ const nameProps = getFieldProps(props, nameFields);
1464
+ if (country === CountryCodes.Japan) {
1465
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1466
+ !!jaHaniNameProps?.requiredFields?.length && /* @__PURE__ */ jsx(
1467
+ NameFields,
1468
+ {
1469
+ fieldConfigs: [
1470
+ {
1471
+ name: "jaHaniLastName",
1472
+ label: "jaHaniLastName",
1473
+ isValid: jaHaniNameProps.valid?.jaHaniLastName
1474
+ },
1475
+ {
1476
+ name: "jaHaniFirstName",
1477
+ label: "jaHaniFirstName",
1478
+ isValid: jaHaniNameProps.valid?.jaHaniFirstName
1479
+ }
1480
+ ],
1481
+ formProps: {
1482
+ ...jaHaniNameProps,
1483
+ dataStoreId: id,
1484
+ errors,
1485
+ handleFieldChange
1486
+ }
1487
+ }
1488
+ ),
1489
+ !!jaKanaNameProps?.requiredFields?.length && /* @__PURE__ */ jsx(
1490
+ NameFields,
1491
+ {
1492
+ fieldConfigs: [
1493
+ {
1494
+ name: "jaKanaLastName",
1495
+ label: "jaKanaLastName",
1496
+ isValid: jaKanaNameProps.valid?.jaKanaLastName
1497
+ },
1498
+ {
1499
+ name: "jaKanaFirstName",
1500
+ label: "jaKanaFirstName",
1501
+ isValid: jaKanaNameProps.valid?.jaKanaFirstName
1502
+ }
1503
+ ],
1504
+ formProps: {
1505
+ ...jaKanaNameProps,
1506
+ dataStoreId: id,
1507
+ errors,
1508
+ handleFieldChange
1509
+ }
1510
+ }
1511
+ ),
1512
+ !!nameProps?.requiredFields?.length && /* @__PURE__ */ jsx(
1513
+ NameFields,
1514
+ {
1515
+ fieldConfigs: [
1516
+ {
1517
+ name: "lastName",
1518
+ label: "lastName__JP",
1519
+ isValid: nameProps.valid?.lastName
1520
+ },
1521
+ {
1522
+ name: "firstName",
1523
+ label: "firstName__JP",
1524
+ isValid: nameProps.valid?.firstName
1525
+ }
1526
+ ],
1527
+ formProps: {
1528
+ ...nameProps,
1529
+ dataStoreId: id,
1530
+ errors,
1531
+ handleFieldChange
1532
+ }
1533
+ }
1534
+ )
1535
+ ] });
1536
+ }
1537
+ return /* @__PURE__ */ jsx(Name, { ...nameProps, dataStoreId: id, errors, handleFieldChange });
1538
+ };
1539
+ const isDecisionMakerTask = (taskType) => taskType === TaskTypes.DECISION_MAKER || taskType === TaskTypes.TRUST_MEMBER_COMPANY_OWNER || taskType === TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY_OWNER;
1540
+ const DriversLicense = ({
1541
+ country,
1542
+ driversLicense,
1543
+ onIssuerStateChange,
1544
+ onLicenseNumberInput,
1545
+ onLicenseNumberBlur,
1546
+ onCardNumberInput,
1547
+ onCardNumberBlur,
1548
+ formUtils,
1549
+ isValid,
1550
+ errorMessages,
1551
+ shouldValidate
1552
+ }) => {
1553
+ const { i18n } = useI18nContext();
1554
+ const { dataset: auStates } = useDataset(datasetIdentifier.state("AU"));
1555
+ const isCountryAustralia = country === CountryCodes.Australia;
1556
+ const isCountryNewZealand = country === CountryCodes.NewZealand;
1557
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1558
+ isCountryAustralia && onIssuerStateChange !== void 0 && /* @__PURE__ */ jsx(
1559
+ Field,
1560
+ {
1561
+ name: "issuerState",
1562
+ label: formUtils.getLabel("issuerState"),
1563
+ isValid: isValid.issuerState,
1564
+ errorMessage: errorMessages.issuerState,
1565
+ children: (childProps) => /* @__PURE__ */ jsx(
1566
+ Select,
1567
+ {
1568
+ ...childProps,
1569
+ name: "issuerState",
1570
+ onChange: onIssuerStateChange,
1571
+ isInvalid: false,
1572
+ items: auStates,
1573
+ placeholder: i18n.get("selectState"),
1574
+ selected: driversLicense.issuerState
1575
+ }
1576
+ )
1577
+ }
1578
+ ),
1579
+ /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-field-wrapper", children: [
1580
+ /* @__PURE__ */ jsx(
1581
+ MaskedInput,
1582
+ {
1583
+ name: "idNumber",
1584
+ type: "text",
1585
+ label: formUtils.getLabel("idNumber", "idNumber"),
1586
+ formatGuidance: formUtils.getGuidanceText("idNumber"),
1587
+ errorMessage: errorMessages.idNumber,
1588
+ shouldValidate,
1589
+ isValid: Boolean(isValid.idNumber),
1590
+ "aria-required": formUtils.isRequiredField("idNumber"),
1591
+ "aria-invalid": !isValid.idNumber,
1592
+ onBlur: onLicenseNumberBlur,
1593
+ readonly: formUtils.isReadOnly("idNumber"),
1594
+ value: driversLicense.idNumber ?? "",
1595
+ onInput: onLicenseNumberInput,
1596
+ acceptObscuredValue: formUtils?.isObscured("idNumber"),
1597
+ ...formUtils.getMask("idNumber")
1598
+ }
1599
+ ),
1600
+ /* @__PURE__ */ jsx(
1601
+ MaskedInput,
1602
+ {
1603
+ name: "licenseCardNumber",
1604
+ type: "text",
1605
+ label: formUtils.getLabel("licenseCardNumber", "licenseCardNumber"),
1606
+ formatGuidance: formUtils.getGuidanceText("licenseCardNumber"),
1607
+ errorMessage: errorMessages.licenseCardNumber,
1608
+ shouldValidate,
1609
+ isValid: Boolean(isValid.licenseCardNumber),
1610
+ "aria-required": formUtils.isRequiredField("licenseCardNumber"),
1611
+ "aria-invalid": !isValid.licenseCardNumber,
1612
+ onBlur: onCardNumberBlur,
1613
+ readonly: formUtils.isReadOnly("licenseCardNumber"),
1614
+ value: driversLicense.licenseCardNumber ?? "",
1615
+ onInput: onCardNumberInput,
1616
+ acceptObscuredValue: formUtils?.isObscured("licenseCardNumber"),
1617
+ ...formUtils.getMask("licenseCardNumber")
1618
+ }
1619
+ )
1620
+ ] }),
1621
+ (isCountryAustralia || isCountryNewZealand) && /* @__PURE__ */ jsx(
1622
+ ContextGuidance,
1623
+ {
1624
+ title: i18n.get("whereCanIFindTheseNumbersOnMyDriversLicense"),
1625
+ content: /* @__PURE__ */ jsxs(Fragment, { children: [
1626
+ isCountryAustralia ? `${i18n.get("whereToFindNumbersOnDriversLicense")} ` : `${i18n.get("whereToFindNumbersOnDriversLicense__NZ")} `,
1627
+ /* @__PURE__ */ jsx(
1628
+ Link,
1629
+ {
1630
+ href: isCountryAustralia ? "https://www.usi.gov.au/about/forms-id/drivers-licence" : "https://www.nzta.govt.nz/driver-licences/getting-a-licence/your-driver-licence-explained/",
1631
+ children: i18n.get("iStillCantFindIt")
1632
+ }
1633
+ )
1634
+ ] }),
1635
+ titleId: "whereCanIFindTheseNumbersOnMyDriversLicense",
1636
+ contentId: "whereToFindNumbersOnDriversLicense"
1637
+ }
1638
+ )
1639
+ ] });
1640
+ };
1641
+ const TypeOfIdentity$1 = ({
1642
+ availableIdentityTypesOptions,
1643
+ selectedIdentityType,
1644
+ setSelectedIdentityType,
1645
+ label,
1646
+ errorMessage,
1647
+ isValid
1648
+ }) => {
1649
+ const { i18n } = useI18nContext();
1650
+ return /* @__PURE__ */ jsx(
1651
+ Field,
1652
+ {
1653
+ name: "typeOfIdentity",
1654
+ label,
1655
+ errorMessage,
1656
+ isValid,
1657
+ helper: i18n.get("typeOfIdentitySubtitle"),
1658
+ children: (childProps) => /* @__PURE__ */ jsx(
1659
+ Select,
1660
+ {
1661
+ ...childProps,
1662
+ name: "typeOfIdentity",
1663
+ isInvalid: false,
1664
+ items: availableIdentityTypesOptions.map(({ id, name }) => ({
1665
+ id,
1666
+ name: i18n.get(name)
1667
+ })),
1668
+ placeholder: i18n.get("selectOne"),
1669
+ selected: selectedIdentityType,
1670
+ onChange: (event) => setSelectedIdentityType(event.target.value)
1671
+ }
1672
+ )
1673
+ }
1674
+ );
1675
+ };
1676
+ const auIdentityValidationRules = {
1677
+ typeOfIdentity: [isTruthyValidator],
1678
+ issuerState: [isTruthyValidator]
1679
+ };
1680
+ const licenseCardNumberMetaData$1 = resolveFieldMetadata(
1681
+ licenseCardNumberDefaultConfig[CountryCodes.Australia],
1682
+ {},
1683
+ licenseCardNumberDefaultMetadata
1684
+ );
1685
+ function IdentityAu({
1686
+ labels,
1687
+ data,
1688
+ placeholders,
1689
+ helperText,
1690
+ requiredFields,
1691
+ readOnlyFields,
1692
+ optionalFields,
1693
+ obscuredFields,
1694
+ shouldValidate,
1695
+ fieldValidationErrors,
1696
+ handleFieldChange,
1697
+ validators,
1698
+ valid,
1699
+ errors
1700
+ }) {
1701
+ const initialFormUtilProps = {
1702
+ validators: {
1703
+ ...auIdentityValidationRules,
1704
+ ...validators
1705
+ },
1706
+ labels,
1707
+ obscuredFields,
1708
+ placeholders,
1709
+ helperText,
1710
+ readOnlyFields,
1711
+ optionalFields,
1712
+ requiredFields
1713
+ };
1714
+ const mergedProps = useMemo(() => {
1715
+ const idNumberMetadata = resolveFieldMetadata(
1716
+ defaultFieldConfig[CountryCodes.Australia],
1717
+ { idNumberType: data?.typeOfIdentity },
1718
+ defaultFieldMetadata
1719
+ );
1720
+ return mergeFieldMetadataIntoProps(
1721
+ "idNumber",
1722
+ idNumberMetadata,
1723
+ mergeFieldMetadataIntoProps(
1724
+ "licenseCardNumber",
1725
+ licenseCardNumberMetaData$1,
1726
+ initialFormUtilProps
1727
+ )
1728
+ );
1729
+ }, [data?.typeOfIdentity]);
1730
+ const { t } = useTranslation("common");
1731
+ const formUtils = useMemo(() => createFormUtils(mergedProps, t), [mergedProps]);
1732
+ if (!handleFieldChange) {
1733
+ return;
1734
+ }
1735
+ if (data?.typeOfIdentity === "nationalIdNumber") {
1736
+ handleFieldChange("typeOfIdentity")(void 0);
1737
+ }
1738
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1739
+ /* @__PURE__ */ jsx(
1740
+ TypeOfIdentity$1,
1741
+ {
1742
+ availableIdentityTypesOptions: additionallIdNumberOptions.AU,
1743
+ selectedIdentityType: data?.typeOfIdentity,
1744
+ setSelectedIdentityType: handleFieldChange("typeOfIdentity"),
1745
+ label: formUtils.getLabel("typeOfIdentity"),
1746
+ isValid: Boolean(valid?.typeOfIdentity),
1747
+ errorMessage: formUtils.getErrorMessage("typeOfIdentity", errors, fieldValidationErrors)
1748
+ }
1749
+ ),
1750
+ data?.typeOfIdentity === "passport" ? /* @__PURE__ */ jsx(
1751
+ MaskedInput,
1752
+ {
1753
+ name: "idNumber",
1754
+ type: "text",
1755
+ label: formUtils.getLabel("idNumber", "idNumber"),
1756
+ formatGuidance: formUtils.getGuidanceText("idNumber"),
1757
+ errorMessage: formUtils.getErrorMessage("idNumber", errors, fieldValidationErrors),
1758
+ shouldValidate,
1759
+ isValid: Boolean(valid?.idNumber),
1760
+ "aria-required": formUtils.isRequiredField("idNumber"),
1761
+ "aria-invalid": !valid?.idNumber,
1762
+ onBlur: handleFieldChange("idNumber", "blur"),
1763
+ readonly: formUtils.isReadOnly("idNumber"),
1764
+ value: data?.idNumber ?? "",
1765
+ onInput: handleFieldChange("idNumber", "input"),
1766
+ acceptObscuredValue: formUtils?.isObscured("idNumber"),
1767
+ ...formUtils.getMask("idNumber")
1768
+ }
1769
+ ) : data?.typeOfIdentity === "driversLicense" ? /* @__PURE__ */ jsx(
1770
+ DriversLicense,
1771
+ {
1772
+ country: CountryCodes.Australia,
1773
+ driversLicense: data,
1774
+ onIssuerStateChange: handleFieldChange("issuerState"),
1775
+ onLicenseNumberInput: handleFieldChange("idNumber", "input"),
1776
+ onLicenseNumberBlur: handleFieldChange("idNumber", "blur"),
1777
+ onCardNumberInput: handleFieldChange("licenseCardNumber", "input"),
1778
+ onCardNumberBlur: handleFieldChange("licenseCardNumber", "blur"),
1779
+ formUtils,
1780
+ isValid: {
1781
+ idNumber: Boolean(valid?.idNumber),
1782
+ licenseCardNumber: Boolean(valid?.licenseCardNumber),
1783
+ issuerState: Boolean(valid?.issuerState)
1784
+ },
1785
+ errorMessages: {
1786
+ idNumber: formUtils.getErrorMessage("idNumber", errors, fieldValidationErrors),
1787
+ licenseCardNumber: formUtils.getErrorMessage(
1788
+ "licenseCardNumber",
1789
+ errors,
1790
+ fieldValidationErrors
1791
+ ),
1792
+ issuerState: formUtils.getErrorMessage("issuerState", errors, fieldValidationErrors)
1793
+ },
1794
+ shouldValidate
1795
+ }
1796
+ ) : void 0
1797
+ ] });
1798
+ }
1799
+ const identityValidationRules$1 = {
1800
+ typeOfIdentity: [isTruthyValidator]
1801
+ };
1802
+ function IdentityHK({
1803
+ labels,
1804
+ data,
1805
+ placeholders,
1806
+ helperText,
1807
+ requiredFields,
1808
+ readOnlyFields,
1809
+ optionalFields,
1810
+ obscuredFields,
1811
+ shouldValidate,
1812
+ fieldValidationErrors,
1813
+ handleFieldChange,
1814
+ validators,
1815
+ valid,
1816
+ errors
1817
+ }) {
1818
+ const [identityType, setIdentityType] = useState(
1819
+ data?.typeOfIdentity
1820
+ );
1821
+ if (data?.typeOfIdentity === "nationalIdNumber") {
1822
+ data.typeOfIdentity = void 0;
1823
+ }
1824
+ const initialFormUtilProps = {
1825
+ validators: {
1826
+ ...identityValidationRules$1,
1827
+ ...validators
1828
+ },
1829
+ labels,
1830
+ obscuredFields,
1831
+ placeholders,
1832
+ helperText,
1833
+ readOnlyFields,
1834
+ optionalFields,
1835
+ requiredFields
1836
+ };
1837
+ const mergedProps = useMemo(() => {
1838
+ const idNumberMetadata = resolveFieldMetadata(
1839
+ defaultFieldConfig[CountryCodes.HongKong],
1840
+ {
1841
+ idNumberType: identityType
1842
+ },
1843
+ defaultFieldMetadata
1844
+ );
1845
+ return mergeFieldMetadataIntoProps("idNumber", idNumberMetadata, initialFormUtilProps);
1846
+ }, [identityType]);
1847
+ useEffect(() => {
1848
+ if (data?.typeOfIdentity) {
1849
+ setIdentityType(data.typeOfIdentity);
1850
+ }
1851
+ }, [data?.typeOfIdentity]);
1852
+ const { t } = useTranslation("common");
1853
+ const formUtils = createFormUtils(mergedProps, t);
1854
+ if (!handleFieldChange) {
1855
+ return;
1856
+ }
1857
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1858
+ /* @__PURE__ */ jsx(
1859
+ TypeOfIdentity$1,
1860
+ {
1861
+ availableIdentityTypesOptions: additionallIdNumberOptions.HK,
1862
+ selectedIdentityType: identityType,
1863
+ setSelectedIdentityType: handleFieldChange("typeOfIdentity"),
1864
+ label: formUtils.getLabel("typeOfIdentity"),
1865
+ isValid: Boolean(valid?.typeOfIdentity),
1866
+ errorMessage: formUtils.getErrorMessage("typeOfIdentity", errors, fieldValidationErrors)
1867
+ }
1868
+ ),
1869
+ /* @__PURE__ */ jsx(
1870
+ MaskedInput,
1871
+ {
1872
+ name: "idNumber",
1873
+ type: "text",
1874
+ label: formUtils.getLabel("idNumber", "idNumber"),
1875
+ formatGuidance: formUtils.getGuidanceText("idNumber"),
1876
+ errorMessage: formUtils.getErrorMessage("idNumber", errors, fieldValidationErrors),
1877
+ shouldValidate,
1878
+ isValid: Boolean(valid?.idNumber),
1879
+ "aria-required": formUtils.isRequiredField("idNumber"),
1880
+ "aria-invalid": Boolean(!valid?.idNumber),
1881
+ onBlur: handleFieldChange("idNumber", "blur"),
1882
+ readonly: formUtils.isReadOnly("idNumber"),
1883
+ value: data?.idNumber ?? "",
1884
+ onInput: handleFieldChange("idNumber", "input"),
1885
+ acceptObscuredValue: formUtils?.isObscured("idNumber"),
1886
+ ...formUtils.getMask("idNumber")
1887
+ }
1888
+ )
1889
+ ] });
1890
+ }
1891
+ const nzIdentityValidationRules = {
1892
+ typeOfIdentity: [isTruthyValidator]
1893
+ };
1894
+ const licenseCardNumberMetaData = resolveFieldMetadata(
1895
+ licenseCardNumberDefaultConfig[CountryCodes.NewZealand],
1896
+ {},
1897
+ licenseCardNumberDefaultMetadata
1898
+ );
1899
+ function IdentityNZ({
1900
+ labels,
1901
+ data,
1902
+ placeholders,
1903
+ helperText,
1904
+ requiredFields,
1905
+ readOnlyFields,
1906
+ optionalFields,
1907
+ obscuredFields,
1908
+ shouldValidate,
1909
+ fieldValidationErrors,
1910
+ handleFieldChange,
1911
+ validators,
1912
+ valid,
1913
+ errors
1914
+ }) {
1915
+ const [identityType, setIdentityType] = useState(
1916
+ data?.typeOfIdentity
1917
+ );
1918
+ if (data?.typeOfIdentity === "nationalIdNumber") {
1919
+ data.typeOfIdentity = void 0;
1920
+ }
1921
+ const initialFormUtilProps = {
1922
+ validators: {
1923
+ ...nzIdentityValidationRules,
1924
+ ...validators
1925
+ },
1926
+ labels,
1927
+ obscuredFields,
1928
+ placeholders,
1929
+ helperText,
1930
+ readOnlyFields,
1931
+ optionalFields,
1932
+ requiredFields
1933
+ };
1934
+ const mergedProps = useMemo(() => {
1935
+ const idNumberMetadata = resolveFieldMetadata(
1936
+ defaultFieldConfig[CountryCodes.NewZealand],
1937
+ { idNumberType: identityType },
1938
+ defaultFieldMetadata
1939
+ );
1940
+ return mergeFieldMetadataIntoProps(
1941
+ "idNumber",
1942
+ idNumberMetadata,
1943
+ mergeFieldMetadataIntoProps(
1944
+ "licenseCardNumber",
1945
+ licenseCardNumberMetaData,
1946
+ initialFormUtilProps
1947
+ )
1948
+ );
1949
+ }, [identityType]);
1950
+ useEffect(() => {
1951
+ if (data?.typeOfIdentity) {
1952
+ setIdentityType(data.typeOfIdentity);
1953
+ }
1954
+ }, [data?.typeOfIdentity]);
1955
+ const { t } = useTranslation("common");
1956
+ const formUtils = createFormUtils(mergedProps, t);
1957
+ const today = /* @__PURE__ */ new Date();
1958
+ const maxExpiryDateSelection = new Date((/* @__PURE__ */ new Date()).setFullYear(today.getFullYear() + 10));
1959
+ if (!handleFieldChange) {
1960
+ return;
1961
+ }
1962
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1963
+ /* @__PURE__ */ jsx(
1964
+ TypeOfIdentity$1,
1965
+ {
1966
+ availableIdentityTypesOptions: additionallIdNumberOptions.NZ,
1967
+ selectedIdentityType: identityType,
1968
+ setSelectedIdentityType: handleFieldChange("typeOfIdentity"),
1969
+ label: formUtils.getLabel("typeOfIdentity"),
1970
+ isValid: !!valid?.typeOfIdentity,
1971
+ errorMessage: formUtils.getErrorMessage("typeOfIdentity", errors, fieldValidationErrors)
1972
+ }
1973
+ ),
1974
+ data?.typeOfIdentity === "passport" ? /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-field-wrapper", children: [
1975
+ /* @__PURE__ */ jsx(
1976
+ MaskedInput,
1977
+ {
1978
+ name: "idNumber",
1979
+ type: "text",
1980
+ label: formUtils.getLabel("idNumber", "idNumber"),
1981
+ formatGuidance: formUtils.getGuidanceText("idNumber"),
1982
+ errorMessage: formUtils.getErrorMessage("idNumber", errors, fieldValidationErrors),
1983
+ shouldValidate,
1984
+ isValid: !!valid?.idNumber,
1985
+ "aria-required": formUtils.isRequiredField("idNumber"),
1986
+ "aria-invalid": !valid?.idNumber,
1987
+ onBlur: handleFieldChange("idNumber", "blur"),
1988
+ readonly: formUtils.isReadOnly("idNumber"),
1989
+ value: data?.idNumber ?? "",
1990
+ onInput: handleFieldChange("idNumber", "input"),
1991
+ acceptObscuredValue: formUtils?.isObscured("idNumber"),
1992
+ ...formUtils.getMask("idNumber")
1993
+ }
1994
+ ),
1995
+ /* @__PURE__ */ jsx(
1996
+ Field,
1997
+ {
1998
+ name: "expiryDate",
1999
+ label: formUtils.getLabel("passportExpiryDate"),
2000
+ errorMessage: formUtils.getErrorMessage("expiryDate", errors, fieldValidationErrors),
2001
+ isValid: valid?.expiryDate,
2002
+ children: (childProps) => /* @__PURE__ */ jsx(
2003
+ InputDate,
2004
+ {
2005
+ ...childProps,
2006
+ name: "expiryDate",
2007
+ value: data?.expiryDate,
2008
+ placeholder: t(($) => $["datePlaceholder"]),
2009
+ readonly: formUtils.isReadOnly("expiryDate"),
2010
+ onInput: handleFieldChange("expiryDate", "input"),
2011
+ onBlur: handleFieldChange("expiryDate", "blur"),
2012
+ "aria-required": true,
2013
+ "aria-invalid": !valid?.expiryDate,
2014
+ min: formatDateObj(today),
2015
+ max: formatDateObj(maxExpiryDateSelection)
2016
+ }
2017
+ )
2018
+ }
2019
+ )
2020
+ ] }) : data?.typeOfIdentity === "driversLicense" ? /* @__PURE__ */ jsx(
2021
+ DriversLicense,
2022
+ {
2023
+ country: CountryCodes.NewZealand,
2024
+ driversLicense: data,
2025
+ onLicenseNumberInput: handleFieldChange("idNumber", "input"),
2026
+ onLicenseNumberBlur: handleFieldChange("idNumber", "blur"),
2027
+ onCardNumberInput: handleFieldChange("licenseCardNumber", "input"),
2028
+ onCardNumberBlur: handleFieldChange("licenseCardNumber", "blur"),
2029
+ formUtils,
2030
+ isValid: {
2031
+ idNumber: Boolean(valid?.idNumber),
2032
+ licenseCardNumber: Boolean(valid?.licenseCardNumber)
2033
+ },
2034
+ errorMessages: {
2035
+ idNumber: formUtils.getErrorMessage("idNumber", errors, fieldValidationErrors),
2036
+ licenseCardNumber: formUtils.getErrorMessage(
2037
+ "licenseCardNumber",
2038
+ errors,
2039
+ fieldValidationErrors
2040
+ )
2041
+ },
2042
+ shouldValidate
2043
+ }
2044
+ ) : void 0
2045
+ ] });
2046
+ }
2047
+ const ERROR_CODES = {
2048
+ SSN_REMEDIATION: "1_316",
2049
+ SSN_4_DIGITS_VALIDATION: "1_3062",
2050
+ PERSONAL_DETAILS_VALIDATION: "1_30"
2051
+ };
2052
+ const getSSNType = (formVerifcationErrors, existingIdNumber) => {
2053
+ const individualDetailsError = formVerifcationErrors?.[ERROR_CODES.PERSONAL_DETAILS_VALIDATION];
2054
+ const fourDigitsValidationError = individualDetailsError?.[ERROR_CODES.SSN_4_DIGITS_VALIDATION]?.some((error) => error.code === ERROR_CODES.SSN_REMEDIATION);
2055
+ const ssnType = fourDigitsValidationError || existingIdNumber?.length === 9 ? "ssn" : "ssnLastFour";
2056
+ return ssnType;
2057
+ };
2058
+ const IdentityUS = forwardRef((props, ref) => {
2059
+ const { form } = useFormContext();
2060
+ const defaultIdNumber = form?.defaultData?.personalDetails?.idNumber;
2061
+ const ssnType = getSSNType(props.formVerificationErrors, defaultIdNumber);
2062
+ return /* @__PURE__ */ jsx(IdentityNumber, { ...props, idNumberType: ssnType, ref });
2063
+ });
2064
+ const additionalIdentityInfoFields$1 = [
2065
+ "typeOfIdentity",
2066
+ "licenseCardNumber",
2067
+ "issuerState",
2068
+ "expiryDate"
2069
+ ];
2070
+ const identityFields = [
2071
+ ...additionalIdentityInfoFields$1,
2072
+ "idNumber"
2073
+ ];
2074
+ function Identity$1(props) {
2075
+ const { personalDetails, country, errors, idNumberType, handleFieldChange } = props;
2076
+ const identityProps = getFieldProps(personalDetails, idNumberFields);
2077
+ const { id: dataStoreId } = personalDetails;
2078
+ if (country === "US") {
2079
+ return /* @__PURE__ */ jsx(
2080
+ IdentityUS,
2081
+ {
2082
+ ...identityProps,
2083
+ errors,
2084
+ dataStoreId,
2085
+ country,
2086
+ formVerificationErrors: personalDetails.formVerificationErrors,
2087
+ handleFieldChange
2088
+ }
2089
+ );
2090
+ }
2091
+ const countrySpecificIdentityMap = {
2092
+ [CountryCodes.Australia]: IdentityAu,
2093
+ [CountryCodes.HongKong]: IdentityHK,
2094
+ [CountryCodes.NewZealand]: IdentityNZ
2095
+ };
2096
+ const Identity2 = countrySpecificIdentityMap[country];
2097
+ if (!Identity2) {
2098
+ return /* @__PURE__ */ jsx(
2099
+ IdentityNumber,
2100
+ {
2101
+ ...identityProps,
2102
+ errors,
2103
+ country,
2104
+ dataStoreId,
2105
+ idNumberType,
2106
+ handleFieldChange
2107
+ }
2108
+ );
2109
+ }
2110
+ const countrySpecificIdentityProps = getFieldProps(personalDetails, identityFields);
2111
+ return /* @__PURE__ */ jsx(
2112
+ Identity2,
2113
+ {
2114
+ ...{
2115
+ ...countrySpecificIdentityProps,
2116
+ dataStoreId
2117
+ },
2118
+ handleFieldChange
2119
+ }
2120
+ );
2121
+ }
2122
+ const personalDetailsFields = [
2123
+ ...nameFields,
2124
+ "birthDate",
2125
+ ...idNumberFields,
2126
+ ...additionalIdentityInfoFields$1,
2127
+ "residencyCountry",
2128
+ "nationality",
2129
+ "jobTitle",
2130
+ ...decisionMakerRoleFields,
2131
+ ...nomineeFields,
2132
+ ...contactDetailFields,
2133
+ "relationship",
2134
+ "taxInformation",
2135
+ "jaHaniFirstName",
2136
+ "jaHaniLastName",
2137
+ "jaKanaFirstName",
2138
+ "jaKanaLastName"
2139
+ ];
2140
+ const relationshipOptions = [
2141
+ {
2142
+ id: "parent",
2143
+ name: "parent"
2144
+ },
2145
+ {
2146
+ id: "guardian",
2147
+ name: "guardian"
2148
+ }
2149
+ ];
2150
+ function PersonalDetails(props) {
2151
+ const { t } = useTranslation("common");
2152
+ const { i18n } = useI18nContext();
2153
+ const { isSettingEnabled } = useSettingsContext();
2154
+ const allowedCountries = useAllowedCountries();
2155
+ const { isExperimentEnabled } = useExperimentsContext();
2156
+ const isAgeVerificationEnabled = isExperimentEnabled("EnableAgeVerification");
2157
+ const isLegalAgeEnforced = isSettingEnabled(SettingNames.EnforceLegalAge);
2158
+ const { form } = useFormContext();
2159
+ const { handleChangeFor, triggerValidation } = form;
2160
+ const {
2161
+ data,
2162
+ formVerificationErrors,
2163
+ heading,
2164
+ id: personalDetailsId,
2165
+ fallbackCountry,
2166
+ underageRootIndividualName,
2167
+ readOnlyFields,
2168
+ taskType,
2169
+ trustedFieldsProvider,
2170
+ trustedRoles,
2171
+ valid,
2172
+ shouldValidate,
2173
+ fieldValidationErrors,
2174
+ errors
2175
+ } = props;
2176
+ const isTopLevelEntity = taskType === TaskTypes.INDIVIDUAL;
2177
+ const isLegalRepresentativeDetailsTask = taskType === TaskTypes.LEGAL_REPRESENTATIVE_DETAILS;
2178
+ const countryRequiringNationality = data?.residencyCountry ?? fallbackCountry;
2179
+ const isAllowedEditPrefilledCountry = isSettingEnabled(SettingNames.AllowPrefilledCountryEdit);
2180
+ const mergedProps = mergeFieldMetadataIntoProps(
2181
+ "taxInformation",
2182
+ resolveFieldMetadata(
2183
+ taxInformationDefaultFieldConfig[countryRequiringNationality],
2184
+ {
2185
+ taxIdNumberType: form.data.personalDetails?.taxInformation?.find(
2186
+ (taxId) => taxId.country === countryRequiringNationality
2187
+ )?.type,
2188
+ companyType: LegalEntityTypes.INDIVIDUAL
2189
+ },
2190
+ taxInformationDefaultFieldMetadata
2191
+ ),
2192
+ props
2193
+ );
2194
+ const formUtils = createFormUtils(mergedProps, t);
2195
+ const decisionMakerRoleProps = getFieldProps(props, decisionMakerRoleFields);
2196
+ const nomineeProps = getFieldProps(props, nomineeFields);
2197
+ const contactDetailsFormProps = getFieldProps(props, contactDetailFields);
2198
+ const localizedNameFieldsProps = getFieldProps(props, [
2199
+ "jaHaniFirstName",
2200
+ "jaHaniLastName",
2201
+ "jaKanaFirstName",
2202
+ "jaKanaLastName",
2203
+ ...nameFields
2204
+ ]);
2205
+ const birthDateErrorMessage = formUtils.getErrorMessage(
2206
+ "birthDate",
2207
+ errors,
2208
+ fieldValidationErrors
2209
+ );
2210
+ const getAlertProps = () => {
2211
+ if (typeof birthDateErrorMessage !== "boolean") {
2212
+ return { title: i18n.get(birthDateErrorMessage), variant: "error" };
2213
+ }
2214
+ if (isLegalAgeEnforced) {
2215
+ return;
2216
+ }
2217
+ const translatableWarningMessage = getLegalRepresentativeWarningMessage({
2218
+ data,
2219
+ taskType
2220
+ });
2221
+ if (translatableWarningMessage) {
2222
+ return {
2223
+ title: i18n.get(translatableWarningMessage.title),
2224
+ variant: "warning",
2225
+ children: i18n.get(translatableWarningMessage.message),
2226
+ className: "adyen-kyc-u-margin-bottom-24"
2227
+ };
2228
+ }
2229
+ };
2230
+ const alertProps = getAlertProps();
2231
+ const handleFieldChange = (fieldName, mode) => handleChangeFor(fieldName, "personalDetails", mode);
2232
+ return /* @__PURE__ */ jsxs("form", { className: "adyen-kyc-individual__personal-details", "aria-describedby": "ariaErrorField", children: [
2233
+ /* @__PURE__ */ jsx(FormHeader, { heading }),
2234
+ /* @__PURE__ */ jsx(
2235
+ ErrorPanel,
2236
+ {
2237
+ verificationErrors: formVerificationErrors,
2238
+ validationErrors: fieldValidationErrors,
2239
+ formUtils,
2240
+ id: "ariaErrorField"
2241
+ }
2242
+ ),
2243
+ data?.residencyCountry === "US" && isTopLevelEntity ? /* @__PURE__ */ jsx(PatriotActDisclosure, {}) : void 0,
2244
+ isLegalRepresentativeDetailsTask && underageRootIndividualName && /* @__PURE__ */ jsx(
2245
+ Alert,
2246
+ {
2247
+ variant: "info",
2248
+ className: "adyen-kyc-u-margin-bottom-10",
2249
+ title: i18n.get({
2250
+ key: "legalRepresentativeFor",
2251
+ values: {
2252
+ firstName: underageRootIndividualName.firstName,
2253
+ lastName: underageRootIndividualName.lastName
2254
+ }
2255
+ })
2256
+ }
2257
+ ),
2258
+ /* @__PURE__ */ jsx(
2259
+ ContextGuidance,
2260
+ {
2261
+ title: i18n.get("whyDoINeedToFillInThisInformation"),
2262
+ content: i18n.get("reasonForFillingIndividualPersonalDetails"),
2263
+ titleId: "whyDoINeedToFillInThisInformation",
2264
+ contentId: "reasonForFillingIndividualPersonalDetails"
2265
+ }
2266
+ ),
2267
+ isDecisionMakerTask(taskType) && trustedFieldsProvider === TrustedFieldsProviders.SINGPASS && readOnlyFields && /* @__PURE__ */ jsx(Typography, { color: "secondary", variant: "caption", children: i18n.get(
2268
+ "weSelectedSomeRolesBasedOnMyinfoBusinessDataAboutYourCompanysAppointmentHoldersAndShareholders"
2269
+ ) }),
2270
+ isDecisionMakerTask(taskType) && /* @__PURE__ */ jsxs(Fragment, { children: [
2271
+ /* @__PURE__ */ jsx(
2272
+ DecisionMakerRole,
2273
+ {
2274
+ ...decisionMakerRoleProps,
2275
+ taskType,
2276
+ dataStoreId: personalDetailsId,
2277
+ allowedRoles: props?.allowedRoles,
2278
+ trustedRoles,
2279
+ country: countryRequiringNationality,
2280
+ handleFieldChange
2281
+ }
2282
+ ),
2283
+ /* @__PURE__ */ jsx(
2284
+ NomineeDecisionMakerRole,
2285
+ {
2286
+ ...nomineeProps,
2287
+ roles: data?.role,
2288
+ country: countryRequiringNationality,
2289
+ handleFieldChange
2290
+ }
2291
+ )
2292
+ ] }),
2293
+ /* @__PURE__ */ jsx(LocalizedNameFields, { ...localizedNameFieldsProps, handleFieldChange }),
2294
+ !isAgeVerificationEnabled && formUtils.isRequiredField("birthDate") && // we reverse the order of birthDate and Country field in age verification feature
2295
+ /* @__PURE__ */ jsx(
2296
+ Field,
2297
+ {
2298
+ name: "birthDate",
2299
+ label: formUtils.getLabel("birthDate"),
2300
+ errorMessage: isAgeVerificationEnabled && birthDateErrorMessage ? true : birthDateErrorMessage,
2301
+ isValid: fieldValidationErrors?.birthDate,
2302
+ children: (childProps) => /* @__PURE__ */ jsx(
2303
+ InputDate,
2304
+ {
2305
+ ...childProps,
2306
+ name: "birthDate",
2307
+ value: data?.birthDate,
2308
+ placeholder: i18n.get("datePlaceholder"),
2309
+ readonly: formUtils.isReadOnly("birthDate"),
2310
+ onInput: handleFieldChange("birthDate", "input"),
2311
+ onBlur: handleFieldChange("birthDate", "blur"),
2312
+ "aria-required": true,
2313
+ "aria-invalid": !fieldValidationErrors?.birthDate,
2314
+ max: formatDateObj(/* @__PURE__ */ new Date())
2315
+ }
2316
+ )
2317
+ }
2318
+ ),
2319
+ formUtils.isRequiredField("residencyCountry") && /* @__PURE__ */ jsx(
2320
+ CountryField,
2321
+ {
2322
+ data: { country: data?.residencyCountry },
2323
+ valid: { country: fieldValidationErrors?.residencyCountry },
2324
+ errors: {
2325
+ country: formUtils.getErrorMessage("residencyCountry", errors, fieldValidationErrors)
2326
+ },
2327
+ labels: { country: formUtils.getLabel("residencyCountry") },
2328
+ readonly: !isAllowedEditPrefilledCountry && !isDecisionMakerTask || formUtils.isReadOnly("residencyCountry"),
2329
+ allowedCountries: isTopLevelEntity ? allowedCountries : void 0,
2330
+ handleChangeFor: () => (e) => {
2331
+ handleFieldChange("residencyCountry", "input")(e);
2332
+ handleChangeFor("country", "address")(e);
2333
+ }
2334
+ }
2335
+ ),
2336
+ isAgeVerificationEnabled && formUtils.isRequiredField("relationship") && underageRootIndividualName && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
2337
+ Field,
2338
+ {
2339
+ el: "fieldset",
2340
+ name: "relationship",
2341
+ label: i18n.get({
2342
+ key: "relationshipTo",
2343
+ values: {
2344
+ firstName: underageRootIndividualName.firstName,
2345
+ lastName: underageRootIndividualName.lastName
2346
+ }
2347
+ }),
2348
+ errorMessage: formUtils.getErrorMessage("relationship", {}, {}),
2349
+ children: (childProps) => /* @__PURE__ */ jsx(
2350
+ RadioGroup,
2351
+ {
2352
+ ...childProps,
2353
+ name: "relationship",
2354
+ items: relationshipOptions,
2355
+ value: data?.relationship,
2356
+ onChange: handleFieldChange("relationship", "input"),
2357
+ "aria-required": true
2358
+ }
2359
+ )
2360
+ }
2361
+ ) }),
2362
+ isAgeVerificationEnabled && formUtils.isRequiredField("birthDate") && /* @__PURE__ */ jsxs(Fragment, { children: [
2363
+ /* @__PURE__ */ jsx(
2364
+ Field,
2365
+ {
2366
+ name: "birthDate",
2367
+ label: formUtils.getLabel("birthDate"),
2368
+ errorMessage: isAgeVerificationEnabled && birthDateErrorMessage ? true : birthDateErrorMessage,
2369
+ isValid: valid?.birthDate,
2370
+ children: (childProps) => /* @__PURE__ */ jsx(
2371
+ InputDate,
2372
+ {
2373
+ ...childProps,
2374
+ name: "birthDate",
2375
+ value: data?.birthDate,
2376
+ placeholder: i18n.get("datePlaceholder"),
2377
+ readonly: formUtils.isReadOnly("birthDate"),
2378
+ onInput: handleFieldChange("birthDate", "input"),
2379
+ onBlur: handleFieldChange("birthDate", "blur"),
2380
+ "aria-required": true,
2381
+ "aria-invalid": !valid?.birthDate,
2382
+ max: formatDateObj(/* @__PURE__ */ new Date())
2383
+ }
2384
+ )
2385
+ }
2386
+ ),
2387
+ isAgeVerificationEnabled && alertProps && /* @__PURE__ */ jsx(Alert, { ...alertProps })
2388
+ ] }),
2389
+ /* @__PURE__ */ jsx(
2390
+ IndividualIdNumberTypeSelector,
2391
+ {
2392
+ country: data?.residencyCountry ?? fallbackCountry,
2393
+ selected: data?.typeOfIdentity,
2394
+ handleFieldChange: handleFieldChange("typeOfIdentity", "input")
2395
+ }
2396
+ ),
2397
+ /* @__PURE__ */ jsx(
2398
+ Identity$1,
2399
+ {
2400
+ personalDetails: props,
2401
+ country: data?.residencyCountry ?? fallbackCountry,
2402
+ errors: errors ?? {},
2403
+ idNumberType: data?.typeOfIdentity,
2404
+ handleFieldChange
2405
+ }
2406
+ ),
2407
+ formUtils.isRequiredField("nationality") && /* @__PURE__ */ jsx(
2408
+ CountryField,
2409
+ {
2410
+ data: { country: data?.nationality },
2411
+ valid: { country: valid?.nationality },
2412
+ name: "nationality",
2413
+ errors: {
2414
+ country: formUtils.getErrorMessage("nationality", errors, fieldValidationErrors)
2415
+ },
2416
+ labels: { country: formUtils.getLabel("nationality") },
2417
+ readonly: formUtils.isReadOnly("nationality"),
2418
+ handleChangeFor: () => handleFieldChange("nationality", "input")
2419
+ }
2420
+ ),
2421
+ Boolean(contactDetailsFormProps?.requiredFields?.length) && /* @__PURE__ */ jsx(
2422
+ ContactDetails,
2423
+ {
2424
+ ...contactDetailsFormProps,
2425
+ dataStoreId: personalDetailsId,
2426
+ country: data?.residencyCountry ?? fallbackCountry,
2427
+ handleFieldChange,
2428
+ triggerValidation: () => triggerValidation("personalDetails")
2429
+ }
2430
+ ),
2431
+ formUtils.isRequiredField("jobTitle", false) && /* @__PURE__ */ jsx(
2432
+ Field,
2433
+ {
2434
+ name: "jobTitle",
2435
+ label: formUtils.getLabel("jobTitle"),
2436
+ errorMessage: formUtils.getErrorMessage("jobTitle", errors, fieldValidationErrors),
2437
+ children: (childProps) => /* @__PURE__ */ jsx(
2438
+ InputText,
2439
+ {
2440
+ ...childProps,
2441
+ name: "jobTitle",
2442
+ value: data?.jobTitle,
2443
+ placeholder: formUtils.getPlaceholder("jobTitle"),
2444
+ readonly: formUtils.isReadOnly("jobTitle"),
2445
+ onInput: handleFieldChange("jobTitle", "input"),
2446
+ onBlur: handleFieldChange("jobTitle", "blur"),
2447
+ "aria-required": true,
2448
+ "aria-invalid": !valid?.jobTitle
2449
+ }
2450
+ )
2451
+ }
2452
+ ),
2453
+ formUtils.isRequiredField("taxInformation", false) && /* @__PURE__ */ jsx(
2454
+ TaxInformationField,
2455
+ {
2456
+ data: { taxInformation: data?.taxInformation },
2457
+ valid: { taxInformation: valid?.taxInformation },
2458
+ errors: {
2459
+ taxInformation: formUtils.getErrorMessage(
2460
+ "taxInformation",
2461
+ errors,
2462
+ fieldValidationErrors
2463
+ )
2464
+ },
2465
+ labels: formUtils.getFieldLabels(["taxInformation"]),
2466
+ mask: formUtils.getMask("taxInformation"),
2467
+ guidanceText: formUtils.getFieldGuidanceText(["taxInformation"]),
2468
+ readonly: formUtils.isReadOnly("taxInformation"),
2469
+ shouldValidate,
2470
+ handleChangeFor: handleFieldChange,
2471
+ canExempt: false,
2472
+ country: countryRequiringNationality,
2473
+ entityType: LegalEntityTypes.INDIVIDUAL,
2474
+ defaultData: data?.taxInformation
2475
+ }
2476
+ )
2477
+ ] });
2478
+ }
2479
+ const ProofOfRelationshipDocumentTypes = {
2480
+ BIRTH_CERTIFICATE: "birthCertificate",
2481
+ GUARDIANSHIP_CERTIFICATE: "guardianshipCertificate",
2482
+ ADOPTION_CERTIFICATE: "adoptionCertificate"
2483
+ };
2484
+ const proofOfRelationshipDocumentOptions = [
2485
+ { id: ProofOfRelationshipDocumentTypes.BIRTH_CERTIFICATE, name: "birthCertificate" },
2486
+ {
2487
+ id: ProofOfRelationshipDocumentTypes.GUARDIANSHIP_CERTIFICATE,
2488
+ name: "guardianshipCertificate"
2489
+ },
2490
+ {
2491
+ id: ProofOfRelationshipDocumentTypes.ADOPTION_CERTIFICATE,
2492
+ name: "adoptionCertificate"
2493
+ }
2494
+ ];
2495
+ function ProofOfRelationship({ id, ...props }) {
2496
+ const { i18n } = useI18nContext();
2497
+ const [proofOfRelationshipDocumentType, setProofOfRelationshipDocumentType] = useState(
2498
+ proofOfRelationshipDocumentOptions[0].id
2499
+ );
2500
+ const proofOfResidencyGuidanceContent = /* @__PURE__ */ jsxs(Fragment, { children: [
2501
+ /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-upload-field__subtitle", children: [
2502
+ " ",
2503
+ i18n.get("requirements")
2504
+ ] }),
2505
+ /* @__PURE__ */ jsxs("ul", { children: [
2506
+ /* @__PURE__ */ jsx("li", { children: i18n.get("documentAddressedToName", { values: { name: props.name } }) }),
2507
+ /* @__PURE__ */ jsx("li", { children: i18n.get("showAddressStateCountry") }),
2508
+ /* @__PURE__ */ jsx("li", { children: i18n.get("fullDocumentVisibleWithReadableText") }),
2509
+ /* @__PURE__ */ jsx("li", { children: i18n.get("documentCannotBeDamaged") })
2510
+ ] })
2511
+ ] });
2512
+ return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
2513
+ MemoizedDocumentUpload,
2514
+ {
2515
+ ...props,
2516
+ documentField: "proofOfRelationship",
2517
+ documentType: "proofOfRelationship",
2518
+ heading: i18n.get("proofOfRelationship"),
2519
+ guidanceHeader: /* @__PURE__ */ jsx("div", { className: "adyen-kyc-document-upload__subtitle adyen-kyc-u-margin-bottom-16", children: i18n.get("proofOfResidenceDocumentTypeLabel", { values: { name: props.name } }) }),
2520
+ documentTypeSelect: {
2521
+ selectedType: proofOfRelationshipDocumentType,
2522
+ setSelectedType: setProofOfRelationshipDocumentType,
2523
+ options: proofOfRelationshipDocumentOptions
2524
+ },
2525
+ guidanceContent: proofOfResidencyGuidanceContent,
2526
+ id
2527
+ }
2528
+ ) });
2529
+ }
2530
+ const MemoizedProofOfRelationship = memo(
2531
+ ProofOfRelationship,
2532
+ (prevProps, nextProps) => objectsDeepEqual(prevProps.data, nextProps.data) && objectsDeepEqual(prevProps.formVerificationErrors, nextProps.formVerificationErrors) && objectsDeepEqual(prevProps.fieldValidationErrors, nextProps.fieldValidationErrors) && objectsDeepEqual(prevProps.requiredFields, nextProps.requiredFields) && prevProps.shouldValidate === nextProps.shouldValidate && prevProps.name === nextProps.name
2533
+ );
2534
+ const ProofOfResidenceDocumentTypes = {
2535
+ BANK_STATEMENT: "bankStatement",
2536
+ UTILITY_BILL: "utilityBill",
2537
+ GOVERNMENT_ISSUED_CORRESPONDENCE: "governmentIssuedCorrespondence",
2538
+ TAXATION_DOCUMENT: "taxationDocument",
2539
+ EXTRACT_FROM_MUNICIPAL_PERSONAL_RECORDS_DATABASE: "extractFromMunicipalPersonalRecordsDatabase",
2540
+ SALARY_SLIP: "salarySlip",
2541
+ MORTGAGE_STATEMENT: "mortgageStatement",
2542
+ CERTIFICATE_OF_VOTER_REGISTRATION: "certificateOfVoterRegistration"
2543
+ };
2544
+ const proofOfResidenceDocumentOptions = [
2545
+ { id: ProofOfResidenceDocumentTypes.BANK_STATEMENT, name: "bankStatementDocument" },
2546
+ { id: ProofOfResidenceDocumentTypes.UTILITY_BILL, name: "utilityBill" },
2547
+ {
2548
+ id: ProofOfResidenceDocumentTypes.GOVERNMENT_ISSUED_CORRESPONDENCE,
2549
+ name: "governmentIssuedCorrespondence"
2550
+ },
2551
+ { id: ProofOfResidenceDocumentTypes.TAXATION_DOCUMENT, name: "taxationDocument" },
2552
+ {
2553
+ id: ProofOfResidenceDocumentTypes.EXTRACT_FROM_MUNICIPAL_PERSONAL_RECORDS_DATABASE,
2554
+ name: "extractFromMunicipalPersonalRecordsDatabase"
2555
+ },
2556
+ { id: ProofOfResidenceDocumentTypes.SALARY_SLIP, name: "salarySlip" },
2557
+ { id: ProofOfResidenceDocumentTypes.MORTGAGE_STATEMENT, name: "mortgageStatement" },
2558
+ {
2559
+ id: ProofOfResidenceDocumentTypes.CERTIFICATE_OF_VOTER_REGISTRATION,
2560
+ name: "certificateOfVoterRegistration"
2561
+ }
2562
+ ];
2563
+ function ProofOfResidency({ id, ...props }) {
2564
+ const { i18n } = useI18nContext();
2565
+ const [proofOfResidenceDocumentType, setProofOfResidenceDocumentType] = useState(
2566
+ proofOfResidenceDocumentOptions[0].id
2567
+ );
2568
+ const isMortgageOrVoterRegistration = proofOfResidenceDocumentType === ProofOfResidenceDocumentTypes.MORTGAGE_STATEMENT || proofOfResidenceDocumentType === ProofOfResidenceDocumentTypes.CERTIFICATE_OF_VOTER_REGISTRATION;
2569
+ const proofOfResidencyGuidanceContent = /* @__PURE__ */ jsxs(Fragment, { children: [
2570
+ /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-upload-field__subtitle", children: [
2571
+ " ",
2572
+ i18n.get("requirements")
2573
+ ] }),
2574
+ /* @__PURE__ */ jsxs("ul", { children: [
2575
+ /* @__PURE__ */ jsx("li", { children: i18n.get("documentAddressedToName", { values: { name: props.name } }) }),
2576
+ /* @__PURE__ */ jsx("li", { children: i18n.get("showAddressStateCountry") }),
2577
+ /* @__PURE__ */ jsx("li", { children: isMortgageOrVoterRegistration ? i18n.get("dateOnDocumentNoOlderThanXMonths", { values: { numberOfMonths: 12 } }) : i18n.get("dateOnDocumentNoOlderThanXMonths", { values: { numberOfMonths: 3 } }) }),
2578
+ /* @__PURE__ */ jsx("li", { children: i18n.get("fullDocumentVisibleWithReadableText") }),
2579
+ /* @__PURE__ */ jsx("li", { children: i18n.get("documentCannotBeDamaged") })
2580
+ ] })
2581
+ ] });
2582
+ return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
2583
+ MemoizedDocumentUpload,
2584
+ {
2585
+ ...props,
2586
+ documentField: "proofOfResidency",
2587
+ documentType: "proofOfResidency",
2588
+ heading: i18n.get("proofOfResidency"),
2589
+ guidanceHeader: /* @__PURE__ */ jsx("div", { className: "adyen-kyc-document-upload__subtitle adyen-kyc-u-margin-bottom-16", children: i18n.get("proofOfResidenceDocumentTypeLabel", { values: { name: props.name } }) }),
2590
+ documentTypeSelect: {
2591
+ selectedType: proofOfResidenceDocumentType,
2592
+ setSelectedType: setProofOfResidenceDocumentType,
2593
+ options: proofOfResidenceDocumentOptions
2594
+ },
2595
+ guidanceContent: proofOfResidencyGuidanceContent,
2596
+ id
2597
+ }
2598
+ ) });
2599
+ }
2600
+ const MemoizedProofOfResidencyUpload = memo(
2601
+ ProofOfResidency,
2602
+ (prevProps, nextProps) => objectsDeepEqual(prevProps.data, nextProps.data) && objectsDeepEqual(prevProps.formVerificationErrors, nextProps.formVerificationErrors) && objectsDeepEqual(prevProps.fieldValidationErrors, nextProps.fieldValidationErrors) && objectsDeepEqual(prevProps.requiredFields, nextProps.requiredFields) && prevProps.shouldValidate === nextProps.shouldValidate && prevProps.name === nextProps.name
2603
+ );
2604
+ const individualForms = {
2605
+ personalDetails: {
2606
+ formId: "personalDetails",
2607
+ formName: "personalDetails",
2608
+ fields: personalDetailsFields
2609
+ },
2610
+ address: {
2611
+ formId: "address",
2612
+ formName: "address",
2613
+ fields: addressFields
2614
+ },
2615
+ idVerificationMethod: {
2616
+ formId: "idVerificationMethod",
2617
+ formName: "verificationMethod",
2618
+ fields: ["idVerificationMethod"]
2619
+ },
2620
+ idDocument: {
2621
+ formId: "idDocument",
2622
+ formName: "idDocument",
2623
+ fields: [...idDocumentUploadFields]
2624
+ },
2625
+ proofOfResidency: {
2626
+ formId: "proofOfResidency",
2627
+ formName: "proofOfResidency",
2628
+ fields: ["proofOfResidency"]
2629
+ },
2630
+ proofOfNationalId: {
2631
+ formId: "proofOfNationalId",
2632
+ formName: "proofOfNationalId",
2633
+ fields: ["proofOfNationalId"]
2634
+ },
2635
+ proofOfRelationship: {
2636
+ formId: "proofOfRelationship",
2637
+ formName: "proofOfRelationship",
2638
+ fields: ["proofOfRelationship"]
2639
+ }
2640
+ };
2641
+ const personalDetailsFormID = individualForms.personalDetails.formId;
2642
+ const addressFormID = individualForms.address.formId;
2643
+ const idDocumentFormID = individualForms.idDocument.formId;
2644
+ const idVerificationMethodFormID$1 = individualForms.idVerificationMethod.formId;
2645
+ const proofOfResidencyFormID$1 = individualForms.proofOfResidency.formId;
2646
+ const proofOfNationalIdFormID$1 = individualForms.proofOfNationalId.formId;
2647
+ const proofOfRelationshipFormID$1 = individualForms.proofOfRelationship.formId;
2648
+ const individualDocumentForms = [
2649
+ idVerificationMethodFormID$1,
2650
+ idDocumentFormID,
2651
+ proofOfResidencyFormID$1,
2652
+ proofOfNationalIdFormID$1,
2653
+ proofOfRelationshipFormID$1
2654
+ ];
2655
+ function Individual(props) {
2656
+ const { t } = useTranslation(["individual", "common"]);
2657
+ const { form } = useFormContext();
2658
+ const { errors, valid, fieldProblems: fieldValidationErrors, handleChangeFor } = form;
2659
+ const {
2660
+ activeForm: propActiveForm,
2661
+ allowedRoles,
2662
+ country,
2663
+ data,
2664
+ onBack,
2665
+ onNext,
2666
+ parentLegalEntity,
2667
+ setHideFooter,
2668
+ taskType,
2669
+ trustedFields,
2670
+ trustedFieldsProvider,
2671
+ trustedRoles,
2672
+ legalEntityId
2673
+ } = props;
2674
+ const personalFormProps = getFormProps(props, personalDetailsFormID);
2675
+ const addressFormProps = getFormProps(props, addressFormID);
2676
+ const idDocumentFormProps = getFormProps(props, idDocumentFormID);
2677
+ const idVerificationMethodFormProps = getFormProps(props, idVerificationMethodFormID$1);
2678
+ const proofOfResidencyFormProps = getFormProps(props, proofOfResidencyFormID$1);
2679
+ const proofOfNationalIdFormProps = getFormProps(props, proofOfNationalIdFormID$1);
2680
+ const proofOfRelationshipFormProps = getFormProps(props, proofOfRelationshipFormID$1);
2681
+ const fullName = `${data?.personalDetails?.firstName} ${data?.personalDetails?.lastName}`;
2682
+ const minimumApplicantDetails = {
2683
+ firstName: data?.personalDetails?.firstName,
2684
+ lastName: data?.personalDetails?.lastName,
2685
+ residencyCountry: data?.personalDetails?.residencyCountry
2686
+ };
2687
+ const isLegalRepresentativeDetailsTask = taskType === TaskTypes.LEGAL_REPRESENTATIVE_DETAILS;
2688
+ const { data: providerStatus } = useProviderStatus({
2689
+ providers: ["idDocument"],
2690
+ country
2691
+ });
2692
+ useEffect(() => {
2693
+ const isIdDocumentFormActive = propActiveForm?.formId === idDocumentFormID;
2694
+ const isInstantIdVerificationEnabled = data?.idVerificationMethod?.idVerificationMethod === "instantVerification" && providerStatus?.statuses.idDocument.enabled;
2695
+ const isIdAlreadyUploaded = data?.idDocument?.instantIdVerificationData || data?.idDocument?.idDocumentType;
2696
+ setHideFooter?.(
2697
+ Boolean(isIdDocumentFormActive && !isIdAlreadyUploaded && isInstantIdVerificationEnabled)
2698
+ );
2699
+ }, [
2700
+ propActiveForm,
2701
+ data?.idVerificationMethod?.idVerificationMethod,
2702
+ data?.idDocument?.instantIdVerificationData,
2703
+ data?.idDocument?.idDocumentType
2704
+ ]);
2705
+ const handleFieldChange = (formName) => (fieldName, mode) => handleChangeFor(fieldName, formName, mode);
2706
+ const capabilities = useCapabilities();
2707
+ const hasMotionCaptureScenarioValue = hasMotionCaptureScenario?.value;
2708
+ useEffect(() => {
2709
+ setShowIndividualMotionCapture(
2710
+ shouldShowMotionCapture({
2711
+ capabilities,
2712
+ userRoles: data?.personalDetails?.role,
2713
+ taskType,
2714
+ hasMotionScenario: hasMotionCaptureScenarioValue
2715
+ })
2716
+ );
2717
+ }, [data?.personalDetails?.role, capabilities, taskType, hasMotionCaptureScenarioValue]);
2718
+ const renderActiveForm = (activeForm) => /* @__PURE__ */ jsxs(Fragment, { children: [
2719
+ activeForm.formId === personalDetailsFormID && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-form-wrapper", children: /* @__PURE__ */ jsx(
2720
+ PersonalDetails,
2721
+ {
2722
+ ...personalFormProps,
2723
+ data: data?.personalDetails ?? {},
2724
+ heading: isLegalRepresentativeDetailsTask ? t(($) => $["legalRepresentativeDetails"]) : t(($) => $["personalDetails"], { ns: "common" }),
2725
+ taskType,
2726
+ id: personalDetailsFormID,
2727
+ allowedRoles,
2728
+ underageRootIndividualName: parentLegalEntity?.individual?.name,
2729
+ fallbackCountry: country,
2730
+ trustedFieldsProvider,
2731
+ trustedRoles,
2732
+ errors: errors?.personalDetails,
2733
+ fieldValidationErrors: fieldValidationErrors?.personalDetails,
2734
+ valid: valid?.personalDetails
2735
+ }
2736
+ ) }),
2737
+ activeForm.formId === addressFormID && /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-form-wrapper", children: [
2738
+ /* @__PURE__ */ jsx(FormHeader, { heading: t(($) => $["providePersonalAddress"]) }),
2739
+ /* @__PURE__ */ jsx(
2740
+ ContextGuidance,
2741
+ {
2742
+ title: t(($) => $["whyDoINeedToFillInThisInformation"], { ns: "common" }),
2743
+ content: t(($) => $["weHaveToMakeSureThatEveryone"]),
2744
+ titleId: "whyDoINeedToFillInThisInformation",
2745
+ contentId: "reasonForFillingIndividualAddressDetails"
2746
+ }
2747
+ ),
2748
+ /* @__PURE__ */ jsx(
2749
+ Address,
2750
+ {
2751
+ ...addressFormProps,
2752
+ id: addressFormID,
2753
+ data: {
2754
+ ...data?.address,
2755
+ country: data?.personalDetails?.residencyCountry ?? data?.address?.country ?? country
2756
+ },
2757
+ addressType: "residentialAddress",
2758
+ optionalFields: ["otherAddressInformation"],
2759
+ trustedFields: trustedFields?.address,
2760
+ hideCountry: true,
2761
+ errors: errors?.address,
2762
+ fieldValidationErrors: fieldValidationErrors?.address,
2763
+ valid: valid?.address,
2764
+ handleFieldChange: handleFieldChange("address")
2765
+ }
2766
+ )
2767
+ ] }),
2768
+ activeForm.formId === idVerificationMethodFormID$1 && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-form-wrapper", children: /* @__PURE__ */ jsx(
2769
+ IdVerificationMethod$1,
2770
+ {
2771
+ ...idVerificationMethodFormProps,
2772
+ data: data?.idVerificationMethod,
2773
+ name: fullName,
2774
+ id: idVerificationMethodFormID$1,
2775
+ countryOfResidence: data?.personalDetails?.residencyCountry,
2776
+ errors: errors?.idVerificationMethod,
2777
+ fieldValidationErrors: fieldValidationErrors?.idVerificationMethod,
2778
+ valid: valid?.idVerificationMethod,
2779
+ handleFieldChange: handleFieldChange("idVerificationMethod")
2780
+ }
2781
+ ) }),
2782
+ activeForm.formId === idDocumentFormID && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-form-wrapper", children: /* @__PURE__ */ jsx(
2783
+ IdDocumentUpload,
2784
+ {
2785
+ ...idDocumentFormProps,
2786
+ data: data?.idDocument,
2787
+ name: fullName,
2788
+ minimumApplicantDetails,
2789
+ id: idDocumentFormID,
2790
+ legalEntityId,
2791
+ handleOnBack: onBack,
2792
+ handleOnNext: onNext,
2793
+ idVerificationMethodSelected: data?.idVerificationMethod?.idVerificationMethod,
2794
+ errors: errors.idDocument,
2795
+ fieldValidationErrors: fieldValidationErrors.idDocument,
2796
+ valid: valid.idDocument,
2797
+ handleFieldChange: handleFieldChange("idDocument"),
2798
+ country: data?.personalDetails?.residencyCountry ?? data?.address?.country ?? country
2799
+ }
2800
+ ) }),
2801
+ activeForm.formId === proofOfResidencyFormID$1 && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-form-wrapper", children: /* @__PURE__ */ jsx(
2802
+ MemoizedProofOfResidencyUpload,
2803
+ {
2804
+ ...proofOfResidencyFormProps,
2805
+ data: data?.proofOfResidency,
2806
+ id: proofOfResidencyFormID$1,
2807
+ name: fullName,
2808
+ errors: errors.proofOfResidency,
2809
+ fieldValidationErrors: fieldValidationErrors.proofOfResidency,
2810
+ valid: valid.proofOfResidency,
2811
+ handleFieldChange: handleFieldChange("proofOfResidency")
2812
+ }
2813
+ ) }),
2814
+ activeForm.formId === proofOfNationalIdFormID$1 && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-form-wrapper", children: /* @__PURE__ */ jsx(
2815
+ MemoizedDocumentUpload,
2816
+ {
2817
+ ...proofOfNationalIdFormProps,
2818
+ data: data?.proofOfNationalId,
2819
+ documentField: "proofOfNationalId",
2820
+ documentType: "registrationDocument",
2821
+ heading: t(($) => $["proofOfNationalId"], { ns: "common" }),
2822
+ id: proofOfNationalIdFormID$1,
2823
+ errors: errors.proofOfNationalId,
2824
+ fieldValidationErrors: fieldValidationErrors.proofOfNationalId,
2825
+ valid: valid.proofOfNationalId,
2826
+ handleFieldChange: handleFieldChange("proofOfNationalId")
2827
+ }
2828
+ ) }),
2829
+ activeForm.formId === proofOfRelationshipFormID$1 && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-form-wrapper", children: /* @__PURE__ */ jsx(
2830
+ MemoizedProofOfRelationship,
2831
+ {
2832
+ ...proofOfRelationshipFormProps,
2833
+ data: data?.proofOfRelationship,
2834
+ id: proofOfRelationshipFormID$1,
2835
+ name: fullName,
2836
+ errors: errors.proofOfRelationship,
2837
+ fieldValidationErrors: fieldValidationErrors.proofOfRelationship,
2838
+ valid: valid.proofOfRelationship,
2839
+ handleFieldChange: handleFieldChange("proofOfRelationship")
2840
+ }
2841
+ ) })
2842
+ ] });
2843
+ return /* @__PURE__ */ jsx("div", { className: "adyen-kyc-individual", children: renderActiveForm(propActiveForm) });
2844
+ }
108
2845
  const jaHaniNameValidationRules = {
109
2846
  jaHaniFirstName: [
110
2847
  {
@@ -348,28 +3085,6 @@ const adjustIdentificationData = (data, apiData) => {
348
3085
  };
349
3086
  }
350
3087
  };
351
- const mapNameLocalization = (data) => {
352
- const localization = [];
353
- if (data.jaHaniFirstName || data.jaHaniLastName) {
354
- localization.push({
355
- script: "ja-Hani",
356
- fields: {
357
- firstName: data.jaHaniFirstName,
358
- lastName: data.jaHaniLastName
359
- }
360
- });
361
- }
362
- if (data.jaKanaFirstName || data.jaKanaLastName) {
363
- localization.push({
364
- script: "ja-Kana",
365
- fields: {
366
- firstName: data.jaKanaFirstName,
367
- lastName: data.jaKanaLastName
368
- }
369
- });
370
- }
371
- return localization;
372
- };
373
3088
  const mapIndividualToLegalEntity = (data) => {
374
3089
  const requestObj = {
375
3090
  ...formatObject(data, individualApiKeyMapping)
@@ -381,7 +3096,10 @@ const mapIndividualToLegalEntity = (data) => {
381
3096
  personalDetails,
382
3097
  requestObj.individual.identificationData
383
3098
  );
384
- const localization = mapNameLocalization(personalDetails);
3099
+ const localization = [
3100
+ mapSchemaFieldsToApiScriptLocalization(personalDetails, "jaHani"),
3101
+ mapSchemaFieldsToApiScriptLocalization(personalDetails, "jaKana")
3102
+ ].filter(({ fields }) => !isEmpty$1(fields));
385
3103
  if (localization.length) {
386
3104
  requestObj.individual.name.localization = localization;
387
3105
  }
@@ -426,33 +3144,12 @@ const mapLegalEntityToIndividual = (legalEntity, isChangingType, isRoleFieldNeed
426
3144
  };
427
3145
  }
428
3146
  if (legalEntity?.individual?.residentialAddress.country === "JP" && legalEntity.individual?.name?.localization) {
429
- const configs = [
430
- {
431
- script: "ja-Hani",
432
- mappingFunction: (l) => ({
433
- jaHaniFirstName: l.fields?.firstName,
434
- jaHaniLastName: l.fields?.lastName
435
- })
436
- },
437
- {
438
- script: "ja-Kana",
439
- mappingFunction: (l) => ({
440
- jaKanaFirstName: l.fields?.firstName,
441
- jaKanaLastName: l.fields?.lastName
442
- })
443
- }
444
- ];
445
- configs.forEach((config) => {
446
- const localizationToMap = legalEntity.individual?.name.localization?.find(
447
- (l) => l.script === config.script
448
- );
449
- if (localizationToMap) {
450
- individualData.personalDetails = {
451
- ...individualData.personalDetails,
452
- ...config.mappingFunction(localizationToMap)
453
- };
454
- }
455
- });
3147
+ for (const scriptLoc of legalEntity.individual.name.localization) {
3148
+ individualData.personalDetails = {
3149
+ ...individualData.personalDetails,
3150
+ ...mapApiScriptLocalizationToSchemaFields(scriptLoc)
3151
+ };
3152
+ }
456
3153
  }
457
3154
  if (!parentLegalEntity?.entityAssociations) {
458
3155
  return individualData;
@@ -800,7 +3497,10 @@ function IndividualDropin({
800
3497
  rules: individualFieldValidations,
801
3498
  asyncRules: individualFieldAsyncValidations,
802
3499
  optionalFields: derivedProps?.optionalFields,
803
- formatters
3500
+ formatters,
3501
+ obscuredFields: {
3502
+ personalDetails: ["idNumber"]
3503
+ }
804
3504
  });
805
3505
  const { data = dataFromResponse } = form;
806
3506
  useEffect(() => {
@@ -831,12 +3531,12 @@ function IndividualDropin({
831
3531
  [country, matchingScenario, data, taskType, problems]
832
3532
  );
833
3533
  useEffect(() => {
834
- const derivedProps2 = getPropsFromConfigurations(
835
- fieldConfigurations,
836
- individualForms,
837
- problems?.remediationActions ? Object.values(problems?.remediationActions) : [],
838
- problems?.missingData ?? [],
839
- legalEntityResponse ? getFieldsWithExistingData(
3534
+ const derivedProps2 = getPropsFromConfigurations({
3535
+ scenarioConfiguration: fieldConfigurations,
3536
+ forms: individualForms,
3537
+ remediationActions: problems?.remediationActions ? Object.values(problems?.remediationActions) : [],
3538
+ dataMissingErrors: problems?.missingData ?? [],
3539
+ fieldsWithExistingData: legalEntityResponse ? getFieldsWithExistingData(
840
3540
  legalEntityResponse,
841
3541
  individualApiKeyMapping,
842
3542
  individualDocumentMapping,
@@ -848,13 +3548,11 @@ function IndividualDropin({
848
3548
  "personalDetails.issuerState"
849
3549
  ]
850
3550
  ) : [],
851
- fieldsFromCustomRules,
852
- {},
853
- {},
854
- legalEntityResponse?.type,
855
- [],
856
- true
857
- );
3551
+ customRules: fieldsFromCustomRules,
3552
+ legalEntityType: legalEntityResponse?.type,
3553
+ legalEntityTrustedFields: [],
3554
+ remediationFieldAsOptional: true
3555
+ });
858
3556
  const updatedDerivedProps = mandateIdVerificationForMotionCapture(
859
3557
  showIndividualMotionCapture?.value,
860
3558
  derivedProps2
@@ -1103,7 +3801,7 @@ function IndividualDropin({
1103
3801
  const formatIdDocument = (idDocument2) => {
1104
3802
  if (!idDocument2) return void 0;
1105
3803
  const documentType = idDocument2?.instantIdVerificationData ? onfidoDocumentTypeMapping.find(
1106
- (document) => idDocument2.instantIdVerificationData?.document_front.type === document.id
3804
+ (document2) => idDocument2.instantIdVerificationData?.document_front.type === document2.id
1107
3805
  ) : idDocumentTypeOptions.find(({ id }) => idDocument2.idDocumentType === id);
1108
3806
  if (!documentType) return void 0;
1109
3807
  const frontPage = idDocument2.idFrontPage?.[0];
@@ -1363,7 +4061,7 @@ const basicDetailsValidators = ({
1363
4061
  });
1364
4062
  const guidanceQuestion = "adyen-kyc-guidance-question";
1365
4063
  const options = "adyen-kyc-options";
1366
- const styles$4 = {
4064
+ const styles$5 = {
1367
4065
  guidanceQuestion,
1368
4066
  options
1369
4067
  };
@@ -1396,10 +4094,10 @@ const GuidanceQuestion = (props) => {
1396
4094
  };
1397
4095
  const yesTileLabel = yesLabel ?? i18n.get("yes");
1398
4096
  const noTileLabel = noLabel ?? i18n.get("no");
1399
- return /* @__PURE__ */ jsxs("div", { className: styles$4.guidanceQuestion, children: [
4097
+ return /* @__PURE__ */ jsxs("div", { className: styles$5.guidanceQuestion, children: [
1400
4098
  /* @__PURE__ */ jsx(Typography, { variant: "body", el: "p", children: question }),
1401
4099
  descriptionLinkText && onDescriptionLinkClick && /* @__PURE__ */ jsx(Button, { variant: "link", onClick: onDescriptionLinkClick, children: descriptionLinkText }),
1402
- /* @__PURE__ */ jsx(Field, { name, className: styles$4.options, children: () => /* @__PURE__ */ jsx(
4100
+ /* @__PURE__ */ jsx(Field, { name, className: styles$5.options, children: () => /* @__PURE__ */ jsx(
1403
4101
  TileGroup,
1404
4102
  {
1405
4103
  allowMultiple: false,
@@ -1417,6 +4115,251 @@ const GuidanceQuestion = (props) => {
1417
4115
  ) })
1418
4116
  ] });
1419
4117
  };
4118
+ const getIdNowProviderIdentificationStatus = async (rootLegalEntityId, baseUrl, legalEntityId) => {
4119
+ return httpGet({
4120
+ baseUrl,
4121
+ path: `legalEntities/${rootLegalEntityId}/child/${legalEntityId}/provider/idnow/identification/status`,
4122
+ errorHandler: async (response) => {
4123
+ const responseData = await response;
4124
+ if (responseData.status === 404) {
4125
+ return { status: 404, message: responseData.detail, errorCode: responseData.errorCode };
4126
+ }
4127
+ }
4128
+ });
4129
+ };
4130
+ const useIdNowIdentificationStatus = (legalEntityId, options2) => {
4131
+ const { rootLegalEntityId, baseUrl } = useApiContext();
4132
+ return useQuery({
4133
+ queryKey: legalEntityId === skipToken ? [] : ["idNowProviderIdentificationStatus", legalEntityId],
4134
+ queryFn: legalEntityId === skipToken ? skipToken : () => getIdNowProviderIdentificationStatus(
4135
+ rootLegalEntityId.value,
4136
+ baseUrl.value,
4137
+ legalEntityId
4138
+ ),
4139
+ ...options2
4140
+ });
4141
+ };
4142
+ const idNowProviderStartIdentification = async (rootLegalEntityId, baseUrl, legalEntityId) => {
4143
+ return httpPost({
4144
+ baseUrl,
4145
+ path: `legalEntities/${rootLegalEntityId}/child/${legalEntityId}/provider/idnow/identification/start`
4146
+ });
4147
+ };
4148
+ const useIdNowStartIdentification = (legalEntityId, options2) => {
4149
+ const { rootLegalEntityId, baseUrl } = useApiContext();
4150
+ return useQuery({
4151
+ queryKey: legalEntityId === skipToken ? [] : ["idNowProviderStartIdentification", legalEntityId],
4152
+ queryFn: legalEntityId === skipToken ? skipToken : () => idNowProviderStartIdentification(rootLegalEntityId.value, baseUrl.value, legalEntityId),
4153
+ ...options2
4154
+ });
4155
+ };
4156
+ const idnowHeader = "adyen-kyc-idnow-header";
4157
+ const idnowVerificationHeaderIframeContainer = "adyen-kyc-idnow-verification-header-iframe-container";
4158
+ const idnowVerificationHeaderIframe = "adyen-kyc-idnow-verification-header-iframe";
4159
+ const idnowVerificationHeaderImage = "adyen-kyc-idnow-verification-header-image";
4160
+ const styles$4 = {
4161
+ idnowHeader,
4162
+ idnowVerificationHeaderIframeContainer,
4163
+ idnowVerificationHeaderIframe,
4164
+ idnowVerificationHeaderImage
4165
+ };
4166
+ const passportFrontGreenImage$1 = lazy(
4167
+ () => import("./passport-front-green-BL4HmtsB.js")
4168
+ );
4169
+ const isIdNowSuccessful = (status) => {
4170
+ const providerStatus = status?.providerStatus;
4171
+ return providerStatus === "SUCCESS" || providerStatus === "SUCCESS_DATA_CHANGED" || providerStatus === "REVIEW_PENDING";
4172
+ };
4173
+ const IdNowVerificationModal = ({ handleFinish }) => {
4174
+ const { t } = useTranslation(["individual", "common"]);
4175
+ const [isConfirmPresented, setIsConfirmPresented] = useState(false);
4176
+ const [genericError, setGenericError] = useState(false);
4177
+ const widgetContainerRef = useRef(null);
4178
+ const iFrameRef = useRef(null);
4179
+ const iFrameWidgetRef = useRef(null);
4180
+ const [page, setPage] = useState(1);
4181
+ const queryClient = useQueryClient();
4182
+ const { showToast } = useToastContext();
4183
+ const {
4184
+ data: idNowStatus,
4185
+ isLoading: isStatusLoading,
4186
+ refetch: refetchIdNowIdentificationStatus
4187
+ } = useIdNowIdentificationStatus(idNowModalChildEntityId.value?.id ?? skipToken, {
4188
+ enabled: !!idNowModalChildEntityId.value?.id,
4189
+ refetchOnMount: "always",
4190
+ refetchInterval: 1e4,
4191
+ // poll every 10 seconds
4192
+ retry: (failureCount, error) => {
4193
+ if ("status" in error && error.status === 404) return false;
4194
+ return failureCount < 3;
4195
+ }
4196
+ });
4197
+ const {
4198
+ data: idNowStart,
4199
+ isLoading,
4200
+ isError: idNowStartError,
4201
+ refetch: refetchIdNowStartIdentification
4202
+ } = useIdNowStartIdentification(idNowModalChildEntityId.value?.id ?? skipToken, {
4203
+ enabled: !!idNowModalChildEntityId.value?.id && page === 2
4204
+ });
4205
+ const handleDismiss = () => {
4206
+ setIsConfirmPresented(true);
4207
+ };
4208
+ const handleCancelDismiss = () => {
4209
+ setIsConfirmPresented(false);
4210
+ };
4211
+ const handleConfirmDismiss = () => {
4212
+ setPage(1);
4213
+ setGenericError(false);
4214
+ setIsConfirmPresented(false);
4215
+ showIdNowModal.value = false;
4216
+ if (idNowStartError && idNowModalChildEntityId.value?.id) {
4217
+ queryClient.resetQueries({
4218
+ queryKey: ["idNowProviderStartIdentification", idNowModalChildEntityId.value?.id]
4219
+ });
4220
+ }
4221
+ idNowModalChildEntityId.value = void 0;
4222
+ iFrameWidgetRef.current?.unmount();
4223
+ iFrameRef.current?.remove();
4224
+ handleFinish?.();
4225
+ };
4226
+ if (idNowStatus?.status === "finished") {
4227
+ if (isIdNowSuccessful(idNowStatus)) {
4228
+ showToast({
4229
+ label: t(($) => $["successfullyUpdatedDetails"], { ns: "common" }),
4230
+ variant: "success"
4231
+ });
4232
+ handleConfirmDismiss();
4233
+ } else {
4234
+ if (page === 2) {
4235
+ handleConfirmDismiss();
4236
+ }
4237
+ }
4238
+ }
4239
+ if (!isLoading && idNowStartError) {
4240
+ setGenericError(true);
4241
+ setPage(1);
4242
+ }
4243
+ const initializeIdNowWidget = useCallback(async (url) => {
4244
+ const container = widgetContainerRef.current;
4245
+ if (!container) {
4246
+ return;
4247
+ }
4248
+ const iFrame = document.createElement("iframe");
4249
+ iFrameRef.current = iFrame;
4250
+ iFrame.setAttribute("allowFullscreen", "true");
4251
+ iFrame.classList.add(styles$4.idnowVerificationHeaderIframe);
4252
+ iFrame.setAttribute("height", "800");
4253
+ iFrame.setAttribute(
4254
+ "allow",
4255
+ "camera *;microphone *;geolocation *;clipboard-read *;clipboard-write *"
4256
+ );
4257
+ container.appendChild(iFrame);
4258
+ try {
4259
+ iFrameWidgetRef.current = new IFrameWidget(iFrame, url, "idnow", "");
4260
+ await iFrameWidgetRef.current.mountAndWaitForResponse();
4261
+ } catch (err) {
4262
+ console.error("Error occurred:", err);
4263
+ setGenericError(true);
4264
+ setPage(1);
4265
+ }
4266
+ }, []);
4267
+ useEffect(() => {
4268
+ if (page === 2 && !isLoading && idNowStart && idNowStart?.url) {
4269
+ (async () => {
4270
+ await refetchIdNowIdentificationStatus();
4271
+ await initializeIdNowWidget(idNowStart.url);
4272
+ })();
4273
+ }
4274
+ return () => {
4275
+ iFrameWidgetRef.current?.unmount();
4276
+ iFrameRef.current?.remove();
4277
+ };
4278
+ }, [isLoading, page, initializeIdNowWidget, refetchIdNowIdentificationStatus, idNowStart]);
4279
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
4280
+ !isStatusLoading && /* @__PURE__ */ jsxs(
4281
+ Modal,
4282
+ {
4283
+ size: page === 2 ? "large" : "medium",
4284
+ showCloseButton: !isLoading && !isStatusLoading,
4285
+ onClose: handleDismiss,
4286
+ ariaLabel: t(($) => $["identityVerification"], { ns: "common" }),
4287
+ children: [
4288
+ page === 1 && /* @__PURE__ */ jsx("div", { className: styles$4.idnowHeader, children: /* @__PURE__ */ jsx(
4289
+ LandingLayout,
4290
+ {
4291
+ media: /* @__PURE__ */ jsx(
4292
+ Image,
4293
+ {
4294
+ className: styles$4.idnowVerificationHeaderImage,
4295
+ lazyLoadedImage: passportFrontGreenImage$1
4296
+ }
4297
+ ),
4298
+ title: t(($) => $["identityVerification"], { ns: "common" }),
4299
+ description: /* @__PURE__ */ jsxs(Fragment, { children: [
4300
+ t(($) => $["idNowDescription"], { ns: "individual" }),
4301
+ /* @__PURE__ */ jsx("br", {}),
4302
+ /* @__PURE__ */ jsx("br", {}),
4303
+ getIndividualLegalEntityName(idNowModalChildEntityId.value) && t(($) => $["idNowDescriptionName"], {
4304
+ ns: "individual",
4305
+ name: getIndividualLegalEntityName(idNowModalChildEntityId.value)
4306
+ })
4307
+ ] }),
4308
+ error: !isLoading && genericError ? /* @__PURE__ */ jsx(
4309
+ Alert,
4310
+ {
4311
+ variant: "error",
4312
+ title: t(($) => $["thereWasAnErrorTryAgain"], { ns: "common" })
4313
+ }
4314
+ ) : void 0,
4315
+ actions: /* @__PURE__ */ jsxs(Fragment, { children: [
4316
+ /* @__PURE__ */ jsx(
4317
+ Button,
4318
+ {
4319
+ onClick: async () => {
4320
+ setGenericError(false);
4321
+ setPage(2);
4322
+ await refetchIdNowStartIdentification();
4323
+ },
4324
+ disabled: isLoading || isStatusLoading || idNowStatus?.status === "finished" && isIdNowSuccessful(idNowStatus),
4325
+ fullWidth: true,
4326
+ children: idNowStatus?.status === "pending" ? t(($) => $["continueVerification"], { ns: "common" }) : t(($) => $["startVerification"], { ns: "common" })
4327
+ }
4328
+ ),
4329
+ /* @__PURE__ */ jsx(
4330
+ Button,
4331
+ {
4332
+ disabled: isLoading || isStatusLoading,
4333
+ variant: "tertiary",
4334
+ onClick: handleConfirmDismiss,
4335
+ fullWidth: true,
4336
+ children: t(($) => $["finishLater"], { ns: "common" })
4337
+ }
4338
+ )
4339
+ ] })
4340
+ }
4341
+ ) }),
4342
+ page === 2 && (isLoading ? /* @__PURE__ */ jsx(Loader, {}) : /* @__PURE__ */ jsx(
4343
+ "div",
4344
+ {
4345
+ ref: widgetContainerRef,
4346
+ className: styles$4.idnowVerificationHeaderIframeContainer
4347
+ }
4348
+ ))
4349
+ ]
4350
+ }
4351
+ ),
4352
+ isConfirmPresented && /* @__PURE__ */ jsx(
4353
+ Confirm,
4354
+ {
4355
+ confirmText: t(($) => $["leave"], { ns: "common" }),
4356
+ onCancel: handleCancelDismiss,
4357
+ onConfirm: handleConfirmDismiss,
4358
+ title: t(($) => $["unsavedChanges"], { ns: "common" })
4359
+ }
4360
+ )
4361
+ ] });
4362
+ };
1420
4363
  const areArraysDifferent = (a = [], b = []) => {
1421
4364
  if (a.length !== b.length) {
1422
4365
  return true;
@@ -1485,6 +4428,7 @@ const DECISION_MAKER_TYPES_WITH_JOBTITLE = [
1485
4428
  DecisionMakerTypes.CONTROLLING_PERSON
1486
4429
  ];
1487
4430
  const ID_MISSING_DATA_ERROR_CODE = "2_8071";
4431
+ const REMEDIATION_CODES_UPLOAD_ID = ["1_301", "1_302", "1_303"];
1488
4432
  const individualOnfidoRules = ({
1489
4433
  matchingScenario,
1490
4434
  data,
@@ -1555,12 +4499,12 @@ const individualOnfidoRules = ({
1555
4499
  return idDocumentOption?.hasBackPage ? REQUIRED : void 0;
1556
4500
  },
1557
4501
  isProofOfResidencyRequired: () => {
4502
+ if (isBafinSignatoryFlow({ taskType, data, scenarios: matchingScenario })) {
4503
+ return void 0;
4504
+ }
1558
4505
  if (data.proofOfResidency?.proofOfResidency?.length) {
1559
4506
  return REQUIRED;
1560
4507
  }
1561
- if (taskType === TaskTypes.DECISION_MAKER && data.basicDetails?.role?.includes(DecisionMakerTypes.SIGNATORY) && matchingScenario?.includes(Scenarios.L_BAFIN)) {
1562
- return void 0;
1563
- }
1564
4508
  const isInstantFlow = data?.idVerificationMethod?.idVerificationMethod === "instantVerification";
1565
4509
  if (!isInstantFlow) {
1566
4510
  return void 0;
@@ -1577,12 +4521,15 @@ const individualOnfidoRules = ({
1577
4521
  }
1578
4522
  },
1579
4523
  isProofOfNationalIdRequired: () => {
4524
+ if (isBafinSignatoryFlow({ taskType, data, scenarios: matchingScenario })) {
4525
+ return void 0;
4526
+ }
1580
4527
  if (data.proofOfNationalId?.proofOfNationalId?.length) {
1581
4528
  return REQUIRED;
1582
4529
  }
1583
4530
  },
1584
4531
  isIdVerificationMethodRequired: () => {
1585
- if (taskType === TaskTypes.DECISION_MAKER && data.basicDetails?.role?.includes(DecisionMakerTypes.SIGNATORY) && matchingScenario?.includes(Scenarios.L_BAFIN)) {
4532
+ if (isBafinSignatoryFlow({ taskType, data, scenarios: matchingScenario })) {
1586
4533
  return void 0;
1587
4534
  }
1588
4535
  return REQUIRED;
@@ -1606,12 +4553,12 @@ const individualOnfidoRules = ({
1606
4553
  }
1607
4554
  },
1608
4555
  isPlaceOfBirthRequired: () => {
1609
- if (taskType === TaskTypes.DECISION_MAKER && data.basicDetails?.role?.includes(DecisionMakerTypes.SIGNATORY) && matchingScenario?.includes(Scenarios.L_BAFIN)) {
4556
+ if (isBafinSignatoryFlow({ taskType, data, scenarios: matchingScenario })) {
1610
4557
  return REQUIRED;
1611
4558
  }
1612
4559
  },
1613
4560
  nationalityIfRequiredForRole: () => {
1614
- if (taskType === TaskTypes.DECISION_MAKER && data.basicDetails?.role?.includes(DecisionMakerTypes.SIGNATORY) && matchingScenario?.includes(Scenarios.L_BAFIN)) {
4561
+ if (isBafinSignatoryFlow({ taskType, data, scenarios: matchingScenario })) {
1615
4562
  return REQUIRED;
1616
4563
  }
1617
4564
  const enableNationalitySGHK = isExperimentEnabled("EnableNationalitySGHK");
@@ -1677,28 +4624,46 @@ const individualOnfidoRules = ({
1677
4624
  }
1678
4625
  },
1679
4626
  isUsingInstantVerificationOrHasExistingDocument: () => {
4627
+ if (isBafinSignatoryFlow({ taskType, data, scenarios: matchingScenario })) {
4628
+ return void 0;
4629
+ }
1680
4630
  const isUsingInstantVerification = data?.idVerificationMethod?.idVerificationMethod === "instantVerification";
1681
4631
  const existingDocument = data?.idVerificationMethod?.idDocument;
1682
4632
  return isUsingInstantVerification || existingDocument ? REQUIRED : void 0;
1683
4633
  },
1684
4634
  isManualIdFlow: () => {
4635
+ if (isBafinSignatoryFlow({ taskType, data, scenarios: matchingScenario })) {
4636
+ return void 0;
4637
+ }
1685
4638
  const isManualFlow = data?.idVerificationMethod?.idVerificationMethod === "manualVerification";
1686
4639
  return isManualFlow ? "REQUIRED" : void 0;
1687
4640
  },
1688
4641
  isManualIdFlowAndNotProvidingIdNumber: () => {
4642
+ if (isBafinSignatoryFlow({ taskType, data, scenarios: matchingScenario })) {
4643
+ return void 0;
4644
+ }
1689
4645
  const hasMissingId = problems?.missingData?.some(
1690
4646
  (error) => error.code === ID_MISSING_DATA_ERROR_CODE
1691
4647
  );
1692
4648
  const isManualFlow = data?.idVerificationMethod?.idVerificationMethod === "manualVerification";
1693
4649
  const idNumberExempt = data?.additionalPersonalDetails?.idNumberExempt;
1694
- return isManualFlow && (idNumberExempt || hasMissingId) ? "REQUIRED" : void 0;
4650
+ const hasIdRemediationAction = Object.keys(problems?.remediationActions ?? {}).some(
4651
+ (code) => REMEDIATION_CODES_UPLOAD_ID.includes(code)
4652
+ );
4653
+ return isManualFlow && (idNumberExempt || hasMissingId || hasIdRemediationAction) ? "REQUIRED" : void 0;
1695
4654
  },
1696
4655
  isManualIdFlowAndHasMissingData: () => {
4656
+ if (isBafinSignatoryFlow({ taskType, data, scenarios: matchingScenario })) {
4657
+ return void 0;
4658
+ }
1697
4659
  const hasMissingId = problems?.missingData?.some(
1698
4660
  (error) => error.code === ID_MISSING_DATA_ERROR_CODE
1699
4661
  );
4662
+ const hasIdRemediationAction = Object.keys(problems?.remediationActions ?? {}).some(
4663
+ (code) => REMEDIATION_CODES_UPLOAD_ID.includes(code)
4664
+ );
1700
4665
  const isManualFlow = data?.idVerificationMethod?.idVerificationMethod === "manualVerification";
1701
- return isManualFlow && hasMissingId ? "REQUIRED" : void 0;
4666
+ return isManualFlow && (hasMissingId || hasIdRemediationAction) ? "REQUIRED" : void 0;
1702
4667
  },
1703
4668
  idVerificationRequired: () => {
1704
4669
  return REQUIRED;
@@ -1714,11 +4679,10 @@ const individualOnfidoRules = ({
1714
4679
  }
1715
4680
  },
1716
4681
  isDirectorRequiredForCountry: () => {
1717
- const availableDecisionMakers = getAvailableDecisionMakerRoleTypes(country, matchingScenario);
1718
- const isDirectorRequired = availableDecisionMakers.some(
4682
+ const decisionMakerCountry = rootLegalEntity ? getLegalEntityCountry(rootLegalEntity) : country;
4683
+ if (getAvailableDecisionMakerRoleTypes(decisionMakerCountry, matchingScenario).some(
1719
4684
  (maker) => maker.roleType === DecisionMakerTypes.DIRECTOR
1720
- );
1721
- if (isDirectorRequired) {
4685
+ )) {
1722
4686
  return "REQUIRED";
1723
4687
  }
1724
4688
  },
@@ -1755,7 +4719,7 @@ const TypeOfIdentity = ({
1755
4719
  id,
1756
4720
  name: i18n.get(name)
1757
4721
  })),
1758
- placeholder: i18n.get("id"),
4722
+ placeholder: i18n.get("selectOne"),
1759
4723
  selected: selectedIdentityType,
1760
4724
  onChange: (event) => setSelectedIdentityType(event.target.value)
1761
4725
  }
@@ -1823,7 +4787,7 @@ function Identity(props) {
1823
4787
  optionalFields,
1824
4788
  requiredFields
1825
4789
  ]);
1826
- const licenseCardNumberMetaData = resolveFieldMetadata(
4790
+ const licenseCardNumberMetaData2 = resolveFieldMetadata(
1827
4791
  licenseCardNumberDefaultConfig[country],
1828
4792
  {},
1829
4793
  licenseCardNumberDefaultMetadata
@@ -1839,12 +4803,12 @@ function Identity(props) {
1839
4803
  idNumberMetadata,
1840
4804
  mergeFieldMetadataIntoProps(
1841
4805
  "licenseCardNumber",
1842
- licenseCardNumberMetaData,
4806
+ licenseCardNumberMetaData2,
1843
4807
  initialFormUtilProps
1844
4808
  )
1845
4809
  );
1846
- }, [country, data?.typeOfIdentity, initialFormUtilProps, licenseCardNumberMetaData]);
1847
- const { t } = useTranslation();
4810
+ }, [country, data?.typeOfIdentity, initialFormUtilProps, licenseCardNumberMetaData2]);
4811
+ const { t } = useTranslation("common");
1848
4812
  const formUtils = useMemo(() => createFormUtils(mergedProps, t), [mergedProps, t]);
1849
4813
  const { form } = useFormContext();
1850
4814
  const defaultIdNumber = form?.defaultData?.additionalPersonalDetails?.idNumber;
@@ -2064,6 +5028,7 @@ function AdditionalPersonalDetails(props) {
2064
5028
  }
2065
5029
  };
2066
5030
  const isRootIndividual = taskType === TaskTypes.INDIVIDUAL;
5031
+ const canEditCountry = isSettingEnabled(SettingNames.AllowPrefilledCountryEdit) || isDecisionMakerTask(taskType);
2067
5032
  return /* @__PURE__ */ jsxs("form", { className: "adyen-kyc-individual__personal-details", "aria-describedby": "ariaErrorField", children: [
2068
5033
  /* @__PURE__ */ jsx(FormHeader, { heading }),
2069
5034
  /* @__PURE__ */ jsx(
@@ -2088,7 +5053,7 @@ function AdditionalPersonalDetails(props) {
2088
5053
  country: formUtils.getErrorMessage("country", errors, fieldValidationErrors)
2089
5054
  },
2090
5055
  labels: { country: formUtils.getLabel("country") },
2091
- readonly: formUtils.isReadOnly("country"),
5056
+ readonly: formUtils.isReadOnly("country") || !canEditCountry,
2092
5057
  allowedCountries: isRootIndividual ? allowedCountries : void 0,
2093
5058
  handleChangeFor: handleFieldChange
2094
5059
  }
@@ -2252,7 +5217,7 @@ const basicDetailsFields = [
2252
5217
  "jaKanaLastName"
2253
5218
  ];
2254
5219
  function BasicDetails(props) {
2255
- const { t } = useTranslation();
5220
+ const { t } = useTranslation("common");
2256
5221
  const { i18n } = useI18nContext();
2257
5222
  const {
2258
5223
  form: { triggerValidation }
@@ -2276,7 +5241,6 @@ function BasicDetails(props) {
2276
5241
  errors,
2277
5242
  handleFieldChange
2278
5243
  } = props;
2279
- const isDecisionMakerTask = taskType === TaskTypes.DECISION_MAKER || taskType === TaskTypes.TRUST_MEMBER_COMPANY_OWNER || taskType === TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY_OWNER;
2280
5244
  const isLegalRepresentativeDetailsTask = taskType === TaskTypes.LEGAL_REPRESENTATIVE_DETAILS;
2281
5245
  const formUtils = createFormUtils(props, t);
2282
5246
  const decisionMakerRoleProps = getFieldProps(props, decisionMakerRoleFields);
@@ -2325,10 +5289,10 @@ function BasicDetails(props) {
2325
5289
  contentId: "reasonForFillingIndividualPersonalDetails"
2326
5290
  }
2327
5291
  ),
2328
- isDecisionMakerTask && trustedFieldsProvider === TrustedFieldsProviders.SINGPASS && readOnlyFields && /* @__PURE__ */ jsx(Typography, { color: "secondary", variant: "caption", children: i18n.get(
5292
+ isDecisionMakerTask(taskType) && trustedFieldsProvider === TrustedFieldsProviders.SINGPASS && readOnlyFields && /* @__PURE__ */ jsx(Typography, { color: "secondary", variant: "caption", children: i18n.get(
2329
5293
  "weSelectedSomeRolesBasedOnMyinfoBusinessDataAboutYourCompanysAppointmentHoldersAndShareholders"
2330
5294
  ) }),
2331
- isDecisionMakerTask && (isGuidedDecisionMakersFlowDisabled || !isGuidedDecisionMakersFlowEnabled) && /* @__PURE__ */ jsxs(Fragment, { children: [
5295
+ isDecisionMakerTask(taskType) && (isGuidedDecisionMakersFlowDisabled || !isGuidedDecisionMakersFlowEnabled) && /* @__PURE__ */ jsxs(Fragment, { children: [
2332
5296
  /* @__PURE__ */ jsx(
2333
5297
  DecisionMakerRole,
2334
5298
  {
@@ -2713,10 +5677,8 @@ const DataConflictsModal = ({
2713
5677
  ] });
2714
5678
  };
2715
5679
  const verificationHeaderImage = "adyen-kyc-verification-header-image";
2716
- const verifyOnfidoError = "adyen-kyc-verify-onfido-error";
2717
5680
  const styles$1 = {
2718
- verificationHeaderImage,
2719
- verifyOnfidoError
5681
+ verificationHeaderImage
2720
5682
  };
2721
5683
  const toIndividualOnfidoConflictSchema = ({
2722
5684
  basicDetails,
@@ -2773,7 +5735,7 @@ const fromIndividualOnfidoConflictSchema = ({
2773
5735
  }
2774
5736
  });
2775
5737
  const logger$3 = createLogger();
2776
- const mapExtractionResultToSchema = (result) => {
5738
+ const mapExtractionResultToSchema = (result, restrictCountryOfResidenceTo) => {
2777
5739
  const {
2778
5740
  firstName,
2779
5741
  lastName,
@@ -2795,11 +5757,21 @@ const mapExtractionResultToSchema = (result) => {
2795
5757
  },
2796
5758
  additionalPersonalDetails: {}
2797
5759
  };
5760
+ let issuingCountryIsCountryOfResidency = false;
5761
+ if (issuingCountry) {
5762
+ const countryFromOcr = issuingCountry;
5763
+ if (!restrictCountryOfResidenceTo || restrictCountryOfResidenceTo.includes(countryFromOcr)) {
5764
+ schema.additionalPersonalDetails.country = countryFromOcr;
5765
+ issuingCountryIsCountryOfResidency = true;
5766
+ } else {
5767
+ schema.additionalPersonalDetails.nationality = countryFromOcr;
5768
+ issuingCountryIsCountryOfResidency = false;
5769
+ }
5770
+ }
2798
5771
  if (dateOfBirth) schema.additionalPersonalDetails.birthDate = dateOfBirth;
2799
- if (issuingCountry) schema.additionalPersonalDetails.country = issuingCountry;
2800
5772
  if (issuingState) schema.additionalPersonalDetails.issuerState = issuingState;
2801
5773
  if (nationality2) schema.additionalPersonalDetails.nationality = nationality2;
2802
- if (address && Object.keys(address).length > 0)
5774
+ if (address && issuingCountryIsCountryOfResidency && Object.keys(address).length > 0)
2803
5775
  schema.additionalPersonalDetails = {
2804
5776
  ...schema.additionalPersonalDetails,
2805
5777
  ...mapAddressToSchema(address)
@@ -2830,15 +5802,13 @@ const mapAddressToSchema = ({
2830
5802
  street2,
2831
5803
  city,
2832
5804
  postalCode,
2833
- stateOrProvince,
2834
- country
5805
+ stateOrProvince
2835
5806
  }) => ({
2836
5807
  address: street,
2837
5808
  otherAddressInformation: street2,
2838
5809
  city,
2839
5810
  postalCode,
2840
- stateOrProvince,
2841
- country
5811
+ stateOrProvince
2842
5812
  });
2843
5813
  const OnfidoVerificationModal = ({
2844
5814
  closeModal,
@@ -2862,14 +5832,14 @@ const uploadedDocument = "adyen-kyc-uploaded-document";
2862
5832
  const styles = {
2863
5833
  uploadedDocument
2864
5834
  };
2865
- const UploadedDocument = ({ document, onDelete, onUpdate }) => {
5835
+ const UploadedDocument = ({ document: document2, onDelete, onUpdate }) => {
2866
5836
  const { i18n } = useI18nContext();
2867
5837
  return /* @__PURE__ */ jsxs("article", { className: styles.uploadedDocument, children: [
2868
5838
  /* @__PURE__ */ jsxs("div", { children: [
2869
- /* @__PURE__ */ jsx(Typography, { el: "h4", variant: "title", children: i18n.get(document.idDocumentType) }),
5839
+ /* @__PURE__ */ jsx(Typography, { el: "h4", variant: "title", children: i18n.get(document2.idDocumentType) }),
2870
5840
  /* @__PURE__ */ jsx(Typography, { el: "p", variant: "body", children: i18n.get("uploadedOn", {
2871
5841
  values: {
2872
- date: localizeDateString(document.modificationDate, i18n.locale, {
5842
+ date: localizeDateString(document2.modificationDate, i18n.locale, {
2873
5843
  month: "short"
2874
5844
  }) ?? ""
2875
5845
  }
@@ -2888,7 +5858,28 @@ const UploadedDocument = ({ document, onDelete, onUpdate }) => {
2888
5858
  /* @__PURE__ */ jsx(Button, { onClick: onUpdate, variant: "secondary", children: i18n.get("update") })
2889
5859
  ] });
2890
5860
  };
5861
+ const validateExtractionResult = (extractionResult) => {
5862
+ const { isExpired, isValidDocumentType, isUnderage, minimumOnboardingAge } = extractionResult;
5863
+ if (isExpired) {
5864
+ return { key: "theDocumentYouUploadedIsExpired" };
5865
+ }
5866
+ if (!isValidDocumentType) {
5867
+ return { key: "theDocumentTypeYouUploadedIsNotSupported" };
5868
+ }
5869
+ if (isUnderage) {
5870
+ return {
5871
+ key: "weDontAcceptDocumentsOrInformationAboutAnyoneYoungerThan_",
5872
+ options: {
5873
+ values: { minimumOnboardingAge: minimumOnboardingAge?.toString() ?? "" }
5874
+ }
5875
+ };
5876
+ }
5877
+ return null;
5878
+ };
2891
5879
  const logger$2 = createLogger();
5880
+ const passportFrontGreenImage = lazy(
5881
+ () => import("./passport-front-green-BL4HmtsB.js")
5882
+ );
2892
5883
  const idVerificationMethodFields = [
2893
5884
  "idVerificationMethod",
2894
5885
  "idDocument"
@@ -2896,12 +5887,14 @@ const idVerificationMethodFields = [
2896
5887
  function IdVerificationMethod(props) {
2897
5888
  const {
2898
5889
  legalEntityId,
5890
+ taskType,
2899
5891
  handlers,
2900
5892
  formVerificationErrors,
2901
5893
  fieldValidationErrors,
2902
5894
  hasLiveSelfieErrorCode
2903
5895
  } = props;
2904
- const { t, i18n } = useTranslation(["individual", "common"]);
5896
+ const { t, i18n } = useTranslation(["individual"]);
5897
+ const { t: commonT } = useTranslation("common");
2905
5898
  const userEvents = useAnalyticsContext();
2906
5899
  const extractDocumentInformation2 = useExtractDocumentInformation();
2907
5900
  const {
@@ -2922,9 +5915,21 @@ function IdVerificationMethod(props) {
2922
5915
  const [ocrExtractedData, setOcrExtractedData] = useState(
2923
5916
  void 0
2924
5917
  );
5918
+ const allowedCountries = useAllowedCountries();
5919
+ const { isSettingEnabled } = useSettingsContext();
5920
+ const canEditPrefilledCountry = isSettingEnabled(SettingNames.AllowPrefilledCountryEdit);
5921
+ const restrictCountryOfResidenceTo = useMemo(() => {
5922
+ if (isDecisionMakerTask(taskType)) {
5923
+ return void 0;
5924
+ }
5925
+ if (!canEditPrefilledCountry) {
5926
+ return [data.additionalPersonalDetails.country];
5927
+ }
5928
+ return allowedCountries;
5929
+ }, [allowedCountries, canEditPrefilledCountry, data.additionalPersonalDetails, taskType]);
2925
5930
  const extractedData = useMemo(
2926
- () => ocrExtractedData ? mapExtractionResultToSchema(ocrExtractedData) : void 0,
2927
- [ocrExtractedData]
5931
+ () => ocrExtractedData ? mapExtractionResultToSchema(ocrExtractedData, restrictCountryOfResidenceTo) : void 0,
5932
+ [ocrExtractedData, restrictCountryOfResidenceTo]
2928
5933
  );
2929
5934
  const comparableExistingData = useMemo(() => toIndividualOnfidoConflictSchema(data), [data]);
2930
5935
  const comparableExtractedData = useMemo(
@@ -2944,24 +5949,6 @@ function IdVerificationMethod(props) {
2944
5949
  setOcrExtractedData(void 0);
2945
5950
  handlers.handleContinueToAdditionalDetails();
2946
5951
  };
2947
- const validateExtractionResult = (extractionResult) => {
2948
- const { isExpired, isValidDocumentType, isUnderage, minimumOnboardingAge } = extractionResult;
2949
- if (isExpired) {
2950
- return { key: "theDocumentYouUploadedIsExpired" };
2951
- }
2952
- if (!isValidDocumentType) {
2953
- return { key: "theDocumentTypeYouUploadedIsNotSupported" };
2954
- }
2955
- if (isUnderage) {
2956
- return {
2957
- key: "weDontAcceptDocumentsOrInformationAboutAnyoneYoungerThan_",
2958
- options: {
2959
- values: { minimumOnboardingAge: minimumOnboardingAge?.toString() ?? "" }
2960
- }
2961
- };
2962
- }
2963
- return null;
2964
- };
2965
5952
  const { hasConflicts, conflictingProperties, resolvedData } = useDataConflicts(
2966
5953
  comparableExistingData,
2967
5954
  comparableExtractedData,
@@ -3095,7 +6082,7 @@ function IdVerificationMethod(props) {
3095
6082
  handlers.handleUpdateDocument();
3096
6083
  };
3097
6084
  const modalProvidedData = resolvedData || comparableExistingData;
3098
- const formUtils = createFormUtils(props, i18n.t);
6085
+ const formUtils = createFormUtils(props, commonT);
3099
6086
  isNextStepDisabled.value = showLoadingSpinner;
3100
6087
  return /* @__PURE__ */ jsxs(Fragment, { children: [
3101
6088
  /* @__PURE__ */ jsx(
@@ -3111,26 +6098,23 @@ function IdVerificationMethod(props) {
3111
6098
  LandingLayout,
3112
6099
  {
3113
6100
  media: /* @__PURE__ */ jsx(
3114
- Svg,
6101
+ Image,
3115
6102
  {
3116
- type: "image",
3117
6103
  className: styles$1.verificationHeaderImage,
3118
- name: "passport-front-green",
3119
- title: t(($) => $["instantIDVerificationDescription"], { ns: "common" })
6104
+ lazyLoadedImage: passportFrontGreenImage
3120
6105
  }
3121
6106
  ),
3122
- title: t(($) => $["identityVerification"], { ns: "common" }),
6107
+ title: commonT(($) => $["identityVerification"]),
3123
6108
  description: showIndividualMotionCapture?.value ? t(($) => $["toHelpProtectAgainstFraudAndKeepOurServices"]) : /* @__PURE__ */ jsxs(Fragment, { children: [
3124
- t(($) => $["takeOrUploadAPhoto"], { ns: "common" }),
6109
+ commonT(($) => $["takeOrUploadAPhoto"]),
3125
6110
  " ",
3126
- /* @__PURE__ */ jsx(Link, { href: "https://onfido.com", external: true, inline: true, children: t(($) => $["onfido"], { ns: "common" }) })
6111
+ /* @__PURE__ */ jsx(Link, { href: "https://onfido.com", external: true, inline: true, children: commonT(($) => $["onfido"]) })
3127
6112
  ] }),
3128
- helpAction: error ? /* @__PURE__ */ jsx(
6113
+ error: error ? /* @__PURE__ */ jsx(
3129
6114
  Alert,
3130
6115
  {
3131
6116
  variant: "error",
3132
- title: t(($) => $[error.key], { ...error.options?.values, ns: "common" }),
3133
- className: styles$1.verifyOnfidoError
6117
+ title: commonT(($) => $[error.key], { ...error.options?.values })
3134
6118
  }
3135
6119
  ) : void 0,
3136
6120
  actions: /* @__PURE__ */ jsx(Fragment, { children: showLoadingSpinner ? /* @__PURE__ */ jsx(Loader, { size: "large" }) : !hasExistingDocument && /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -3141,7 +6125,7 @@ function IdVerificationMethod(props) {
3141
6125
  onClick: launchOnfido,
3142
6126
  disabled: status === "extractionLoading",
3143
6127
  loading: status === "extractionLoading",
3144
- children: t(($) => $["startVerification"], { ns: "common" })
6128
+ children: commonT(($) => $["startVerification"])
3145
6129
  }
3146
6130
  ),
3147
6131
  !showIndividualMotionCapture?.value && /* @__PURE__ */ jsx(
@@ -3150,7 +6134,7 @@ function IdVerificationMethod(props) {
3150
6134
  onClick: () => setStatus("confirmManualFlowModal"),
3151
6135
  variant: "secondary",
3152
6136
  fullWidth: true,
3153
- children: t(($) => $["addDetailsManually"], { ns: "common" })
6137
+ children: commonT(($) => $["addDetailsManually"])
3154
6138
  }
3155
6139
  )
3156
6140
  ] }) }),
@@ -3169,11 +6153,11 @@ function IdVerificationMethod(props) {
3169
6153
  " ",
3170
6154
  /* @__PURE__ */ jsx(Link, { href: "https://onfido.com/facial-scan-policy-and-release/", external: true, inline: true, children: t(($) => $["onfidoFacialScanPolicy"]) }),
3171
6155
  " ",
3172
- /* @__PURE__ */ jsx(Link, { href: "https://onfido.com/privacy/", external: true, inline: true, children: t(($) => $["privacyPolicy"], { ns: "common" }) }),
6156
+ /* @__PURE__ */ jsx(Link, { href: "https://onfido.com/privacy/", external: true, inline: true, children: commonT(($) => $["privacyPolicy"]) }),
3173
6157
  " ",
3174
- t(($) => $["and"], { ns: "common" }),
6158
+ commonT(($) => $["and"]),
3175
6159
  " ",
3176
- /* @__PURE__ */ jsx(Link, { href: "https://onfido.com/terms-of-service/", external: true, inline: true, children: t(($) => $["termsOfService"], { ns: "common" }) }),
6160
+ /* @__PURE__ */ jsx(Link, { href: "https://onfido.com/terms-of-service/", external: true, inline: true, children: commonT(($) => $["termsOfService"]) }),
3177
6161
  "."
3178
6162
  ] })
3179
6163
  )
@@ -3204,7 +6188,7 @@ function IdVerificationMethod(props) {
3204
6188
  {
3205
6189
  title: t(($) => $["deleteIdDocument"]),
3206
6190
  description: t(($) => $["youMayBeAskedToReUpload"]),
3207
- confirmText: t(($) => $["deleteDocument"], { ns: "common" }),
6191
+ confirmText: commonT(($) => $["deleteDocument"]),
3208
6192
  onCancel: handleCancelDeleteDocument,
3209
6193
  onConfirm: handleDeleteDocument,
3210
6194
  critical: true
@@ -3238,6 +6222,7 @@ const ManualIdUpload = () => {
3238
6222
  const valid = form.valid.manualIdUpload;
3239
6223
  const errors = form.errors.manualIdUpload;
3240
6224
  const name = `${form.data.basicDetails?.firstName} ${form.data.basicDetails?.lastName}`;
6225
+ const country = form.data.additionalPersonalDetails?.country;
3241
6226
  const handleFieldChange = (fieldName, mode) => handleChangeFor(fieldName, "manualIdUpload", mode);
3242
6227
  return /* @__PURE__ */ jsx(
3243
6228
  IdDocumentManualUpload,
@@ -3246,7 +6231,8 @@ const ManualIdUpload = () => {
3246
6231
  valid,
3247
6232
  errors,
3248
6233
  name,
3249
- handleFieldChange
6234
+ handleFieldChange,
6235
+ country
3250
6236
  }
3251
6237
  );
3252
6238
  };
@@ -3321,7 +6307,7 @@ function SignatoryQuestionnaire(props) {
3321
6307
  ] });
3322
6308
  }
3323
6309
  const UboQuestionnaireModalContent = ({ modalType }) => {
3324
- const { t } = useTranslation();
6310
+ const { t } = useTranslation("common");
3325
6311
  const { i18n } = useI18nContext();
3326
6312
  switch (modalType) {
3327
6313
  case "isOwner":
@@ -3607,7 +6593,8 @@ function IndividualOnfido(props) {
3607
6593
  problems,
3608
6594
  onNext,
3609
6595
  setNextHandler,
3610
- handleHomeClick
6596
+ handleHomeClick,
6597
+ scenarios
3611
6598
  } = props;
3612
6599
  const basicDetailsFormProps = getFormProps(props, basicDetailsFormID);
3613
6600
  const signatoryQuestionnaireFormProps = getFormProps(props, signatoryQuestionnaireFormID);
@@ -3692,10 +6679,10 @@ function IndividualOnfido(props) {
3692
6679
  capabilities,
3693
6680
  userRoles: data?.basicDetails?.role,
3694
6681
  taskType,
3695
- hasMotionScenario: hasMotionCaptureScenarioValue
6682
+ hasMotionScenario: data?.basicDetails?.role?.includes(DecisionMakerTypes.SIGNATORY) && scenarios?.includes(Scenarios.L_BAFIN) ? false : hasMotionCaptureScenarioValue
3696
6683
  })
3697
6684
  );
3698
- }, [data?.basicDetails?.role, taskType, capabilities, hasMotionCaptureScenarioValue]);
6685
+ }, [data?.basicDetails?.role, scenarios, taskType, capabilities, hasMotionCaptureScenarioValue]);
3699
6686
  const fullName = `${data?.basicDetails?.firstName} ${data?.basicDetails?.lastName}`;
3700
6687
  const handleFieldChange = (formName) => (fieldName, mode) => handleChangeFor(fieldName, formName, mode);
3701
6688
  const hasLiveSelfieErrorCode = problems?.missingData?.some(
@@ -3753,6 +6740,7 @@ function IndividualOnfido(props) {
3753
6740
  IdVerificationMethod,
3754
6741
  {
3755
6742
  legalEntityId,
6743
+ taskType,
3756
6744
  handlers: {
3757
6745
  handleContinueToAdditionalDetails,
3758
6746
  handleDeleteDocument,
@@ -3909,7 +6897,10 @@ const mapIndividualOnfidoSchemaToLegalEntity = (individualOnfido, isExperimentEn
3909
6897
  legalEntity.individual.identificationData
3910
6898
  );
3911
6899
  }
3912
- const localization = mapNameLocalization(individualOnfido.basicDetails ?? {});
6900
+ const localization = [
6901
+ mapSchemaFieldsToApiScriptLocalization(individualOnfido.basicDetails ?? {}, "jaHani"),
6902
+ mapSchemaFieldsToApiScriptLocalization(individualOnfido.basicDetails ?? {}, "jaKana")
6903
+ ].filter(({ fields }) => !isEmpty$1(fields));
3913
6904
  if (localization.length) {
3914
6905
  legalEntity.individual.name.localization = localization;
3915
6906
  }
@@ -3977,33 +6968,12 @@ const mapLegalEntityToIndividualOnfidoSchema = (legalEntity, isChangingType, isR
3977
6968
  individualOnfido.additionalPersonalDetails.typeOfIdentity = apiIdentityTypeToIdentityTypeMap[legalEntity.individual.identificationData.type];
3978
6969
  }
3979
6970
  if (legalEntity.individual?.name?.localization) {
3980
- const configs = [
3981
- {
3982
- script: "ja-Hani",
3983
- mappingFunction: (l) => ({
3984
- jaHaniFirstName: l.fields?.firstName,
3985
- jaHaniLastName: l.fields?.lastName
3986
- })
3987
- },
3988
- {
3989
- script: "ja-Kana",
3990
- mappingFunction: (l) => ({
3991
- jaKanaFirstName: l.fields?.firstName,
3992
- jaKanaLastName: l.fields?.lastName
3993
- })
3994
- }
3995
- ];
3996
- configs.forEach((config) => {
3997
- const localizationToMap = legalEntity.individual?.name.localization?.find(
3998
- (l) => l.script === config.script
3999
- );
4000
- if (localizationToMap) {
4001
- individualOnfido.basicDetails = {
4002
- ...individualOnfido.basicDetails,
4003
- ...config.mappingFunction(localizationToMap)
4004
- };
4005
- }
4006
- });
6971
+ for (const scriptLoc of legalEntity.individual.name.localization) {
6972
+ individualOnfido.basicDetails = {
6973
+ ...individualOnfido.basicDetails,
6974
+ ...mapApiScriptLocalizationToSchemaFields(scriptLoc)
6975
+ };
6976
+ }
4007
6977
  }
4008
6978
  if (!parentLegalEntity?.entityAssociations) {
4009
6979
  return individualOnfido;
@@ -4041,7 +7011,7 @@ const mapLegalEntityToIndividualOnfidoSchema = (legalEntity, isChangingType, isR
4041
7011
  return individualOnfido;
4042
7012
  };
4043
7013
  const mapDocumentDetailToIdDocument = (documents) => {
4044
- const activeDocument = documents.find((document) => document.active);
7014
+ const activeDocument = documents.find((document2) => document2.active);
4045
7015
  return activeDocument ? {
4046
7016
  idDocumentType: activeDocument.type,
4047
7017
  modificationDate: activeDocument.modificationDate
@@ -4395,7 +7365,10 @@ function IndividualOnfidoDropin({
4395
7365
  defaultData,
4396
7366
  rules: individualFieldValidations,
4397
7367
  asyncRules: individualFieldAsyncValidations,
4398
- optionalFields: derivedProps?.optionalFields
7368
+ optionalFields: derivedProps?.optionalFields,
7369
+ obscuredFields: {
7370
+ additionalPersonalDetails: ["idNumber"]
7371
+ }
4399
7372
  });
4400
7373
  const documentUtils = documentApiUtils({
4401
7374
  baseUrl: baseUrl.value,
@@ -4430,12 +7403,12 @@ function IndividualOnfidoDropin({
4430
7403
  [country, matchingScenario, data, isExperimentEnabled, parentLegalEntity, taskType, problems]
4431
7404
  );
4432
7405
  useEffect(() => {
4433
- const derivedProps2 = getPropsFromConfigurations(
4434
- fieldConfigurations,
4435
- individualOnfidoForms,
4436
- problems?.remediationActions ? Object.values(problems?.remediationActions) : [],
4437
- problems?.missingData ?? [],
4438
- legalEntityResponse ? getFieldsWithExistingData(
7406
+ const derivedProps2 = getPropsFromConfigurations({
7407
+ scenarioConfiguration: fieldConfigurations,
7408
+ forms: individualOnfidoForms,
7409
+ remediationActions: problems?.remediationActions ? Object.values(problems?.remediationActions) : [],
7410
+ dataMissingErrors: problems?.missingData ?? [],
7411
+ fieldsWithExistingData: legalEntityResponse ? getFieldsWithExistingData(
4439
7412
  legalEntityResponse,
4440
7413
  individualOnfidoApiKeyMapping,
4441
7414
  individualOnfidoDocumentMapping,
@@ -4446,13 +7419,11 @@ function IndividualOnfidoDropin({
4446
7419
  "additionalPersonalDetails.issuerState"
4447
7420
  ]
4448
7421
  ) : [],
4449
- fieldsFromCustomRules,
4450
- {},
4451
- {},
4452
- legalEntityResponse?.type,
4453
- [],
4454
- true
4455
- );
7422
+ customRules: fieldsFromCustomRules,
7423
+ legalEntityType: legalEntityResponse?.type,
7424
+ legalEntityTrustedFields: [],
7425
+ remediationFieldAsOptional: true
7426
+ });
4456
7427
  const updatedDerivedProps = mandateIdVerificationForMotionCapture(
4457
7428
  showIndividualMotionCapture?.value,
4458
7429
  derivedProps2
@@ -4633,18 +7604,21 @@ function IndividualOnfidoDropin({
4633
7604
  legalEntityResponse,
4634
7605
  accountHolder || void 0
4635
7606
  );
4636
- const createdLegalEntity = await submitLegalEntity({
7607
+ const submittedLegalEntity = await submitLegalEntity({
4637
7608
  dataSubmitted,
4638
7609
  legalEntity,
4639
7610
  idDocumentType
4640
7611
  });
4641
7612
  setAccountHolder(accountHolder);
4642
7613
  if (dataSubmitted.idVerificationMethod && dataSubmitted.idVerificationMethod?.idVerificationMethod !== "existingDocument" || hasVerificationErrors) {
4643
- await submitDocuments({ legalEntity: createdLegalEntity, dataSubmitted });
7614
+ const isBafinSignatory = dataSubmitted?.basicDetails?.role?.includes(DecisionMakerTypes.SIGNATORY) && matchingScenario?.includes(Scenarios.L_BAFIN);
7615
+ if (!isBafinSignatory) {
7616
+ await submitDocuments({ legalEntity: submittedLegalEntity, dataSubmitted });
7617
+ }
4644
7618
  }
4645
7619
  if (parentLegalEntity) {
4646
7620
  await attachAssociationToParentLegalEntity({
4647
- legalEntity: createdLegalEntity,
7621
+ legalEntity: submittedLegalEntity,
4648
7622
  parentLE: parentLegalEntity,
4649
7623
  dataSubmitted
4650
7624
  });
@@ -4653,9 +7627,10 @@ function IndividualOnfidoDropin({
4653
7627
  refetchType: "all"
4654
7628
  });
4655
7629
  }
7630
+ idNowModalChildEntityId.value = submittedLegalEntity;
4656
7631
  setLoadingStatus("success");
4657
7632
  clearToasts();
4658
- externalOnSubmit?.(dataSubmitted);
7633
+ externalOnSubmit?.(dataSubmitted, matchingScenario);
4659
7634
  } catch (e) {
4660
7635
  const eventsAdditionalData = {};
4661
7636
  logger.error("Failed to update individual", e);
@@ -4689,7 +7664,7 @@ function IndividualOnfidoDropin({
4689
7664
  const formatIdDocument = (idDocument2) => {
4690
7665
  if (!idDocument2) return void 0;
4691
7666
  const documentType = idDocument2?.instantIdVerificationData ? onfidoDocumentTypeMapping.find(
4692
- (document) => idDocument2.instantIdVerificationData?.document_front.type === document.id
7667
+ (document2) => idDocument2.instantIdVerificationData?.document_front.type === document2.id
4693
7668
  ) : idDocumentTypeOptions.find(({ id }) => idDocument2.idDocumentType === id);
4694
7669
  if (!documentType) return void 0;
4695
7670
  const frontPage = idDocument2.idFrontPage?.[0];
@@ -4800,9 +7775,12 @@ function IndividualOnfidoDropin({
4800
7775
  ...data?.additionalPersonalDetails?.idNumberExempt ? ["idNumber"] : [],
4801
7776
  ...isManualVerificationOrExistingDoc(data?.idVerificationMethod?.idVerificationMethod) ? ["idVerificationMethod", "modificationDate"] : []
4802
7777
  ];
7778
+ const isUploadEmpty = !data?.manualIdUpload || Object.keys(data?.manualIdUpload).length === 0;
4803
7779
  const omittedFormsForSummary = [
4804
- ...data?.idVerificationMethod?.idVerificationMethod === "instantVerification" ? ["idDocument"] : [],
4805
- ...data?.idVerificationMethod?.idVerificationMethod === "manualVerification" ? ["idVerificationMethod"] : []
7780
+ // 1. Omit idDocument if instant OR (manual/existing AND upload is empty)
7781
+ ...data?.idVerificationMethod?.idVerificationMethod === "instantVerification" || isManualVerificationOrExistingDoc(data?.idVerificationMethod?.idVerificationMethod) && isUploadEmpty ? ["idDocument"] : [],
7782
+ // 2. Omit idVerificationMethod if manual or existing
7783
+ ...isManualVerificationOrExistingDoc(data?.idVerificationMethod?.idVerificationMethod) ? ["idVerificationMethod"] : []
4806
7784
  ];
4807
7785
  const customLabelsForSummary = {
4808
7786
  idVerificationMethod: data?.idVerificationMethod?.idVerificationMethod === "instantVerification" ? "idVerificationMethod" : "idDocument"
@@ -4835,56 +7813,60 @@ function IndividualOnfidoDropin({
4835
7813
  },
4836
7814
  [associatedLeTrackingParams]
4837
7815
  );
4838
- return /* @__PURE__ */ jsx(FormContextProvider, { form, children: /* @__PURE__ */ jsx(
4839
- FormFlow,
4840
- {
4841
- summary: {
4842
- data: formatDataForSummary(),
4843
- omitted: {
4844
- keys: omittedKeysForSummary,
4845
- forms: omittedFormsForSummary
4846
- },
4847
- problems,
4848
- trackNavigation: handleTrackNavigation,
4849
- labels: customLabelsForSummary
4850
- },
4851
- asModal,
4852
- currentStep: steps.current,
4853
- disableNextButton: disableNextButton.value,
4854
- forms,
4855
- gotoFormByFormIndex,
4856
- handleBackClick,
4857
- handleCancelClick: handleHomeClick,
4858
- handleNextClick: nextHandler || handleNextClick,
4859
- loadingStatus,
4860
- totalSteps: steps.total,
4861
- children: /* @__PURE__ */ jsx(
4862
- IndividualOnfido,
4863
- {
4864
- ...derivedProps,
4865
- requiredFields,
4866
- data,
4867
- defaultCountry: country,
4868
- activeForm,
4869
- forms,
4870
- taskType,
7816
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
7817
+ /* @__PURE__ */ jsx(Show, { when: shouldShowIdNowModal, children: /* @__PURE__ */ jsx(IdNowVerificationModal, { handleFinish: handleHomeClick }) }),
7818
+ /* @__PURE__ */ jsx(FormContextProvider, { form, children: /* @__PURE__ */ jsx(
7819
+ FormFlow,
7820
+ {
7821
+ summary: {
7822
+ data: formatDataForSummary(),
7823
+ omitted: {
7824
+ keys: omittedKeysForSummary,
7825
+ forms: omittedFormsForSummary
7826
+ },
4871
7827
  problems,
4872
- onNext: handleNextClick,
4873
- onBack: handleBackClick,
4874
- legalEntityId: legalEntityResponse?.id,
4875
- allowedRoles: roleTypes,
4876
- shouldValidate,
4877
- accountHolder,
4878
- parentLegalEntity,
4879
- trustedFields,
4880
- trustedFieldsProvider,
4881
- trustedRoles,
4882
- setNextHandler,
4883
- handleHomeClick
4884
- }
4885
- )
4886
- }
4887
- ) });
7828
+ trackNavigation: handleTrackNavigation,
7829
+ labels: customLabelsForSummary
7830
+ },
7831
+ asModal,
7832
+ currentStep: steps.current,
7833
+ disableNextButton: disableNextButton.value,
7834
+ forms,
7835
+ gotoFormByFormIndex,
7836
+ handleBackClick,
7837
+ handleCancelClick: handleHomeClick,
7838
+ handleNextClick: nextHandler || handleNextClick,
7839
+ loadingStatus,
7840
+ totalSteps: steps.total,
7841
+ children: /* @__PURE__ */ jsx(
7842
+ IndividualOnfido,
7843
+ {
7844
+ ...derivedProps,
7845
+ requiredFields,
7846
+ data,
7847
+ defaultCountry: country,
7848
+ activeForm,
7849
+ forms,
7850
+ scenarios,
7851
+ taskType,
7852
+ problems,
7853
+ onNext: handleNextClick,
7854
+ onBack: handleBackClick,
7855
+ legalEntityId: legalEntityResponse?.id,
7856
+ allowedRoles: roleTypes,
7857
+ shouldValidate,
7858
+ accountHolder,
7859
+ parentLegalEntity,
7860
+ trustedFields,
7861
+ trustedFieldsProvider,
7862
+ trustedRoles,
7863
+ setNextHandler,
7864
+ handleHomeClick
7865
+ }
7866
+ )
7867
+ }
7868
+ ) })
7869
+ ] });
4888
7870
  }
4889
7871
  export {
4890
7872
  IndividualOnfidoDropin as I,