@adyen/kyc-components 3.91.0 → 3.92.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (337) hide show
  1. package/dist/{4-people-BzyXLUF9.js → 4-people-BtDi7O9A.js} +2 -2
  2. package/dist/{AcceptTermsOfServiceComponent-Bl8Skw0p.js → AcceptTermsOfServiceComponent-T7eWi57Z.js} +17 -14
  3. package/dist/{Accordion-BxBwztLx.js → Accordion-Boa_Vira.js} +2 -2
  4. package/dist/{AccountSetupRejected-DWnI467S.js → AccountSetupRejected-LAVhMMBt.js} +4 -4
  5. package/dist/{ActionBar-BI8EL50o.js → ActionBar-CK8dwgSJ.js} +1 -1
  6. package/dist/{Address-BUrDDnmR.js → Address-ki-bCjUJ.js} +23 -289
  7. package/dist/{Alert-B83aFhFn.js → Alert-TCEgDc2-.js} +3 -3
  8. package/dist/{Avatar-CWGv3_UH.js → Avatar-AC-D1DKh.js} +2 -2
  9. package/dist/{BusinessFinancingComponent-Dp9pkrSs.js → BusinessFinancingComponent-Cf-EEnyR.js} +6 -6
  10. package/dist/{BusinessFinancingDropin-CxDQONVa.js → BusinessFinancingDropin-DeLlYaOF.js} +30 -22
  11. package/dist/{BusinessFinancingPage-CK4iko3V.js → BusinessFinancingPage-DtX8x3Zp.js} +4 -4
  12. package/dist/{BusinessTypeSelectionPage-BbCt3hSM.js → BusinessTypeSelectionPage-6Ltt53Mu.js} +58 -33
  13. package/dist/{Card-CQrP0PXC.js → Card-Det7uTiv.js} +2 -2
  14. package/dist/{debouncedInputEvent-CFFx_oML.js → Checkbox-D8rB6_HN.js} +3 -38
  15. package/dist/Confirm-Ctfqp-1b.js +64 -0
  16. package/dist/ConstitutionalDocument-TJAc9nDQ.js +2358 -0
  17. package/dist/ContextGuidance-CCknw_Y1.js +34 -0
  18. package/dist/CountryField-DzmOWqiE.js +66 -0
  19. package/dist/{CreateIndividualComponent-B6ecxCd8.js → CreateIndividualComponent-_H34wdze.js} +6 -6
  20. package/dist/{CreateTransferInstrumentComponent-Chqddjgy.js → CreateTransferInstrumentComponent-CmnVEFaB.js} +5 -12
  21. package/dist/{Currency-CkQVLmOQ.js → Currency-C2egEHMF.js} +64 -8
  22. package/dist/{CustomerSupport-BDynvVnl.js → CustomerSupport-DLfbNC-J.js} +12 -10
  23. package/dist/{DebugModal-DAu7rz8a.js → DebugModal-C0uG_A8N.js} +8 -7
  24. package/dist/{DecisionMakerDetailsPage-BBqNmh_M.js → DecisionMakerDetailsPage-BTR-hRwO.js} +6 -6
  25. package/dist/{DecisionMakers-Ddvw0N__.js → DecisionMakers-B4qQ3M6Y.js} +27 -21
  26. package/dist/Dropzone-CKT3THCY.js +218 -0
  27. package/dist/{EmbeddedStatus-BSK268B-.js → EmbeddedStatus-Bst5MPzi.js} +3 -3
  28. package/dist/{EndStateLayout-B8KmFejY.js → EndStateLayout-Ck_Lvgng.js} +2 -2
  29. package/dist/{EntityAssociation-DBPiXzNF.js → EntityAssociation-bcF_I_DK.js} +8 -8
  30. package/dist/{EntityGuidanceStatus-QEzHcb28.js → EntityGuidanceStatus-D6VoRE_0.js} +4 -3
  31. package/dist/ErrorPanel-CFN2G9Vz.js +190 -0
  32. package/dist/Field-B3Vy1-QZ.js +142 -0
  33. package/dist/{FormNavigation-DLJbUsy3.js → FormNavigation-Brw-75s0.js} +3 -3
  34. package/dist/{FormWrapper-41qnDF4W.js → FormWrapper-BcNyCMkD.js} +10 -10
  35. package/dist/Header-YafgG5Nz.js +83 -0
  36. package/dist/Image-Cvb4hnru.js +44 -0
  37. package/dist/{IndividualOnfido-pGSPtITh.js → IndividualOnfidoDropin-Dy5obHs1.js} +3833 -5548
  38. package/dist/InputDate-UCHQ3zOB.js +43 -0
  39. package/dist/InputGroup-WBfGDV5F.js +32 -0
  40. package/dist/InputText-DGKAS6ZI.js +134 -0
  41. package/dist/{Introduction-DaRfsN8P.js → Introduction-DOxSVZ6X.js} +4 -4
  42. package/dist/{JpAddress-BrtEV6zM.js → JpAddress-DClXaVjy.js} +22 -10
  43. package/dist/LandingLayout-co7NR2te.js +60 -0
  44. package/dist/{LegalRepresentativeDetailsPage-XcmRRT7P.js → LegalRepresentativeDetailsPage-DOP3L2r9.js} +4 -4
  45. package/dist/Link-DWTJ55UO.js +35 -0
  46. package/dist/List-BAzyC6sw.js +83 -0
  47. package/dist/{ListItem-DlRGqcSA.js → ListItem-B8D-kUHN.js} +3 -3
  48. package/dist/LoaderWrapper-CUz5NRFr.js +42 -0
  49. package/dist/{ManageIndividualComponent-BpzsaZ1O.js → ManageIndividualComponent-DND7vuna.js} +5 -5
  50. package/dist/{ManageTermsOfServiceComponent-D9i2HO5I.js → ManageTermsOfServiceComponent-ylDupO1E.js} +5 -5
  51. package/dist/{ManageTransferInstrumentComponent-C6LYppym.js → ManageTransferInstrumentComponent-CgUfGP5E.js} +16 -13
  52. package/dist/{Spacer-w89ksCbG.js → MaskedInput-Cn0VAuEp.js} +17 -631
  53. package/dist/{MaybeModal-DW5SxNsJ.js → MaybeModal-CWCEHeOg.js} +3 -3
  54. package/dist/{Modal-B4wxf7HK.js → Modal-pyBUluei.js} +2 -2
  55. package/dist/OnboardingDropinComponent-DwKImil4.js +2306 -0
  56. package/dist/{PayoutDetailsDropin-BKXxBApD.js → PayoutDetailsDropin-lYVb5WCQ.js} +105 -76
  57. package/dist/Radio-BMtxBpnn.js +39 -0
  58. package/dist/RadioGroup-DPc8nUuk.js +98 -0
  59. package/dist/RadioGroupCard-Pj9qq4uW.js +150 -0
  60. package/dist/{Review-DSdM3vGX.js → Review-gkTjl3a8.js} +7 -7
  61. package/dist/{RootBusinessDetailsPage-CqpiMFn9.js → RootBusinessDetailsPage-DjwEzuLA.js} +5 -5
  62. package/dist/{RootBusinessLinesPage-DUIp_zfH.js → RootBusinessLinesPage-2-U3mf6i.js} +104 -50
  63. package/dist/{RootIndividualDetailsPage-BpTbnRMJ.js → RootIndividualDetailsPage-BFYP63_i.js} +6 -6
  64. package/dist/{useForm-_Kjd_HFb.js → Select-D1rFT3T8.js} +10 -775
  65. package/dist/{SignPCIComponent-B-nJZ1cD.js → SignPCIComponent-DqElmjjG.js} +13 -11
  66. package/dist/{SingpassSelection-D7wRmaLb.js → SingpassSelection-eruroIiQ.js} +9 -7
  67. package/dist/{SoleProprietorshipPage-DUVjo6fc.js → SoleProprietorshipPage-7YdzA7iH.js} +4 -4
  68. package/dist/{SourceOfFundsPage-CFDBqD8v.js → SourceOfFundsPage-C_wiSoc4.js} +39 -26
  69. package/dist/Spacer-BK3jDget.js +18 -0
  70. package/dist/{StepProgressIndicator-BvU4jA3I.js → StepProgressIndicator-DLoEzGro.js} +1 -1
  71. package/dist/{StoreProvider-CyzNf7KK.js → StoreProvider-D9IR5HNN.js} +331 -222
  72. package/dist/StructuredList-9dnJRdx_.js +61 -0
  73. package/dist/{Summary-QyNHKBjO.js → Summary-Bq94iVfc.js} +10 -5
  74. package/dist/{InputText-DLAmX8CW.js → TaskVerificationStatus-BLCkXEn6.js} +3 -123
  75. package/dist/TaxInformationField-c-ZWfhUk.js +3134 -0
  76. package/dist/{TaxReportingDropin-Bn2xYbVw.js → TaxReportingDropin-ajO0q4eZ.js} +20 -17
  77. package/dist/TextArea-D9eJloeE.js +103 -0
  78. package/dist/TileGroup-CaY3i_T7.js +203 -0
  79. package/dist/{TrustDetailsPage-D0sr6zMt.js → TrustDetailsPage-BWXZX4-u.js} +40 -27
  80. package/dist/{TrustMemberCompanyPage-4sIP-M16.js → TrustMemberCompanyPage-CJj2BpXu.js} +5 -5
  81. package/dist/{TrustMemberIndividualPage-CelIjIAw.js → TrustMemberIndividualPage-BXp9RXDw.js} +4 -4
  82. package/dist/{TrustMemberRoleAndTypePage-C3CRy717.js → TrustMemberRoleAndTypePage-gYJ5U6RH.js} +24 -14
  83. package/dist/{TrustMembersOverview-HrRgAsno.js → TrustMembersOverview-Chmnt5jS.js} +13 -12
  84. package/dist/{UnincorporatedPartnershipIndividualPage-Dre5_Nuk.js → UnincorporatedPartnershipIndividualPage-DckUiPPY.js} +4 -4
  85. package/dist/{UnincorporatedPartnershipMemberCompanyPage-woQiy94h.js → UnincorporatedPartnershipMemberCompanyPage-Bx0A5Bit.js} +5 -5
  86. package/dist/{UnincorporatedPartnershipMemberRoleAndTypePage-DrirgJXY.js → UnincorporatedPartnershipMemberRoleAndTypePage-CEE1hzIn.js} +23 -16
  87. package/dist/{UnincorporatedPartnershipMembersOverview-BBiRqJkR.js → UnincorporatedPartnershipMembersOverview-wB8K9r6g.js} +10 -9
  88. package/dist/{VerificationErrorAlert-B_ovSmUS.js → VerificationErrorAlert-DZ5OOTBN.js} +4 -4
  89. package/dist/{ViewVerificationStatusComponent-CDQk4Nxa.js → ViewVerificationStatusComponent-BVY4YUJf.js} +4 -4
  90. package/dist/adyen-business-financing.js +3 -3
  91. package/dist/adyen-individual-configuration.js +3 -3
  92. package/dist/adyen-individual-status.js +3 -3
  93. package/dist/adyen-kyc-components.js +21 -20
  94. package/dist/adyen-onboarding.js +3 -3
  95. package/dist/adyen-terms-of-service-management.js +3 -3
  96. package/dist/adyen-terms-of-service-status.js +3 -3
  97. package/dist/adyen-transfer-instrument-configuration.js +3 -3
  98. package/dist/adyen-transfer-instrument-management.js +3 -3
  99. package/dist/adyen-verification-status.js +3 -3
  100. package/dist/{arrow-right-KxA3SvQj.js → arrow-right-BoqwUH_d.js} +2 -2
  101. package/dist/bafinUtils-Wct4TWLH.js +149 -0
  102. package/dist/{bag-BPumznWh.js → bag-BXVWLrwo.js} +2 -2
  103. package/dist/{bank-D6FiNBhs.js → bank-1GvaHPAZ.js} +2 -2
  104. package/dist/{bin-Bz6KOIeE.js → bin-Ba-3ll8T.js} +2 -2
  105. package/dist/{business-lines-DboUCbXw.js → business-lines-BAqTbnBw.js} +2 -2
  106. package/dist/{capital-GVQ3svwN.js → capital-9TKHySO7.js} +2 -2
  107. package/dist/{cash-stack-D9AoDDwt.js → cash-stack-DwYu4xNy.js} +2 -2
  108. package/dist/{certificate-CdEWgHQf.js → certificate-N2YFedpI.js} +2 -2
  109. package/dist/{checkmark-Q7x6tGhy.js → checkmark-D9dGhGpG.js} +2 -2
  110. package/dist/{checkmark-circle-x7dzbp3I.js → checkmark-circle-CFWClLQ6.js} +2 -2
  111. package/dist/{checkmark-circle-fill-CsvN5_PL.js → checkmark-circle-fill-DEB-tuGl.js} +2 -2
  112. package/dist/{checkmark-small-D35myntq.js → checkmark-small-D3VNx2lo.js} +2 -2
  113. package/dist/{chevron-down-C2iDorpW.js → chevron-down-C7SUSYfl.js} +2 -2
  114. package/dist/{chevron-left-ztPO84q-.js → chevron-left-BXmd-S46.js} +2 -2
  115. package/dist/{chevron-right-C_JN0oDt.js → chevron-right-jE6RwM2B.js} +2 -2
  116. package/dist/{chevron-up-CgG8n25g.js → chevron-up-BdfNcqzq.js} +2 -2
  117. package/dist/{circle-Bt3Nlr3q.js → circle-BJPTMCWB.js} +2 -2
  118. package/dist/{circle-small-filled-YMzP6yQU.js → circle-small-filled-BuO8Vg8j.js} +2 -2
  119. package/dist/{clock-BZHremOA.js → clock-DAzaBRWk.js} +2 -2
  120. package/dist/{coins-fkAk6dCo.js → coins-DYdzG5e_.js} +2 -2
  121. package/dist/commonValidators-DcFd5CHs.js +24 -0
  122. package/dist/{contract-BTa4HltT.js → contract-BfJb1t6M.js} +2 -2
  123. package/dist/{cross-Cn09MtQ_.js → cross-CDS_eot4.js} +2 -2
  124. package/dist/{cross-circle-fill-maan7Z5S.js → cross-circle-fill-C-EJ57Yn.js} +2 -2
  125. package/dist/{cross-circle-fill-small-DCz52AuN.js → cross-circle-fill-small-DkPjsuBH.js} +2 -2
  126. package/dist/currency-CrdnaaDu.js +35 -0
  127. package/dist/datasetUtil-BHQp0-xL.js +58 -0
  128. package/dist/debouncedInputEvent-Cv2S512Y.js +46 -0
  129. package/dist/{decision-makers-group-CgddXgrx.js → decision-makers-group-DrvpnEqj.js} +2 -2
  130. package/dist/{digital-wallet-D_IpxnkN.js → digital-wallet-Bx5YM1LY.js} +2 -2
  131. package/dist/{document-1-C08ut-Dt.js → document-1-qlSTF558.js} +2 -2
  132. package/dist/{document-blurred-2Zpodj3_.js → document-blurred-BiWap0xs.js} +2 -2
  133. package/dist/{document-cut-off-ClS7RiOp.js → document-cut-off-aQezqOif.js} +2 -2
  134. package/dist/{document-expired-CjksBq-N.js → document-expired-BhBXaWWQ.js} +2 -2
  135. package/dist/{document-front-DiAairT3.js → document-front-DYuhZGeQ.js} +2 -2
  136. package/dist/{document-person-vxlA6C5f.js → document-person-CDbnTOdV.js} +2 -2
  137. package/dist/{download-Drhk9k1f.js → download-BZQB1WkZ.js} +2 -2
  138. package/dist/{dropinUtils-DCWhMKpQ.js → dropinUtils-BpJn607e.js} +4 -4
  139. package/dist/{edit-1-CFoDTMvQ.js → edit-1-DAqtnOIx.js} +2 -2
  140. package/dist/{en-US-BzrLvydZ.js → en-US-CjjPhkB5.js} +2 -2
  141. package/dist/{external-link-DCMYUMfW.js → external-link-Cg6pJaSJ.js} +2 -2
  142. package/dist/fieldConfig-BPwb1GHc.js +134 -0
  143. package/dist/fieldConfigurations-BUT9DTUH.js +21 -0
  144. package/dist/form-rules-DhbF2mY4.js +13 -0
  145. package/dist/formUtils-BlVlgetw.js +137 -0
  146. package/dist/{funds-in-D8bj0aoE.js → funds-in-CInoUdmG.js} +2 -2
  147. package/dist/{getName-l7X1ZGKx.js → getName-CzpJ9tV7.js} +2 -2
  148. package/dist/getProps-CLJfvUMb.js +156 -0
  149. package/dist/{gift-CQ_DEma7.js → gift-omNInZeB.js} +2 -2
  150. package/dist/{graph-BJmqglH2.js → graph-DunG_uu1.js} +2 -2
  151. package/dist/{graph-up-Bq6adtlX.js → graph-up-BZze4i6m.js} +2 -2
  152. package/dist/{hasDataChanged-BXawTZla.js → hasDataChanged-8e8x8zjz.js} +2 -2
  153. package/dist/{headquarter-DNYyuuFq.js → headquarter-BhpSibFO.js} +2 -2
  154. package/dist/{hotel-BuNql78Z.js → hotel-Cp7VgGCJ.js} +2 -2
  155. package/dist/{house-B6sNRj-B.js → house-BhyBQdR3.js} +2 -2
  156. package/dist/{id-blurred-9dzBOWCE.js → id-blurred-B5lHEP8M.js} +2 -2
  157. package/dist/{id-cut-off-CohJCI2h.js → id-cut-off-Ba1FRzKO.js} +2 -2
  158. package/dist/{id-front-CSZfvdRg.js → id-front-CpNWN6nG.js} +2 -2
  159. package/dist/{id-glare-Q2JWo5ts.js → id-glare-DgCQON8k.js} +2 -2
  160. package/dist/{id-verification-instant-BUVBO4R3.js → id-verification-instant-Byt4Oul6.js} +2 -2
  161. package/dist/{id-verification-manual-B3YZALYU.js → id-verification-manual-CvcTkOSY.js} +2 -2
  162. package/dist/{iframeWidget-CbtmWmoO.js → iframeWidget-D6BlBF0m.js} +4 -4
  163. package/dist/{image-BSihO8lR.js → image-CmB0ioUM.js} +2 -2
  164. package/dist/{info-vHTZWoJ7.js → info-Bb_-xIEK.js} +2 -2
  165. package/dist/{info-filled-SQotHmT9.js → info-filled-CK8LB339.js} +2 -2
  166. package/dist/{instant-verification-Dvvkyfmp.js → instant-verification-UrnuHTYn.js} +2 -2
  167. package/dist/isEmpty-CsYVgjoD.js +23 -0
  168. package/dist/japanSupportUtils-iATUjnbf.js +17 -0
  169. package/dist/jpAddressSchema-De6ix57p.js +28 -0
  170. package/dist/{localizeDateString-BX5t59Ip.js → localizeDateString-BHDr1NID.js} +2 -2
  171. package/dist/{location-Q4oKvnkl.js → location-itJfxrDQ.js} +2 -2
  172. package/dist/{mail-BOdyoVqB.js → mail-VHTlAusn.js} +2 -2
  173. package/dist/makeSelectItemForRole-Bm2NwBxD.js +133 -0
  174. package/dist/{manual-verification-BvZWqA00.js → manual-verification-BO8zgAYT.js} +2 -2
  175. package/dist/{mapExistingFile-Bd7nsoK8.js → mapExistingFile-DNBa6Ekj.js} +80 -5
  176. package/dist/mapJpAddressSchemaToAddressLocalizations-BNb8d51F.js +147 -0
  177. package/dist/{mapLegalEntityToIndividualOnfidoSchema-CQF6zsO7.js → mapLegalEntityToIndividualOnfidoSchema-DREgz5Ms.js} +63 -3
  178. package/dist/{mapTransferInstrumentToPayoutAccount-CacHlKHM.js → mapTransferInstrumentToPayoutAccount-C5NqOfNW.js} +2 -2
  179. package/dist/{minus-circle-filled-kC2IUvKz.js → minus-circle-filled-ZhtJ0GD3.js} +2 -2
  180. package/dist/{onfido-logo-BWSv__sQ.js → onfido-logo-BSkKPH10.js} +2 -2
  181. package/dist/{options-horizontal-CBmbNv7R.js → options-horizontal-GuXvLvV3.js} +2 -2
  182. package/dist/{partner-CPjsrePY.js → partner-QD27Vy4w.js} +2 -2
  183. package/dist/{passport-blurred-B4UDQfmc.js → passport-blurred-CVG493IJ.js} +2 -2
  184. package/dist/{passport-cut-off-C0N2mgLk.js → passport-cut-off-COzA_TmB.js} +2 -2
  185. package/dist/{passport-front-BwA7wR91.js → passport-front-WJleLixT.js} +2 -2
  186. package/dist/{passport-front-green-BL4HmtsB.js → passport-front-green-CZVkCa1n.js} +2 -2
  187. package/dist/{passport-glare-Mg2ixsYA.js → passport-glare-BP5WnJZj.js} +2 -2
  188. package/dist/patternValidators-BXduwLbz.js +83 -0
  189. package/dist/{pay-by-link-plane-BVZndh67.js → pay-by-link-plane-BpY8Q6-B.js} +2 -2
  190. package/dist/{payout-ChUEoLjt.js → payout-DtB68BcZ.js} +2 -2
  191. package/dist/{payout-verification-instant-5u-wvFKv.js → payout-verification-instant-BzpfOQLD.js} +2 -2
  192. package/dist/{payout-verification-manual-BH2mu0UW.js → payout-verification-manual-gNEoeZkV.js} +2 -2
  193. package/dist/{person-DGjUU4S4.js → person-IVZG3t3_.js} +2 -2
  194. package/dist/{plaid-logo-CtActXTN.js → plaid-logo-FsZ7kfL-.js} +2 -2
  195. package/dist/{plus-CWXA5wdX.js → plus-DiALAL8-.js} +2 -2
  196. package/dist/{plus-circle-filled-CbC0u2Y1.js → plus-circle-filled-BzHtTqEN.js} +2 -2
  197. package/dist/{process-field-configurations-BZQqH4-M.js → process-field-configurations-B26ehyAw.js} +3 -3
  198. package/dist/{recurring-CkL4cCM2.js → recurring-DKNs9K3x.js} +2 -2
  199. package/dist/{reporting-DerosUNm.js → reporting-D5ABpLO_.js} +2 -2
  200. package/dist/{resolveEnvironment-C6JtHmZc.js → resolveEnvironment-B5Yrsa4J.js} +3 -3
  201. package/dist/{revenue-accelerate-Dp4Ns_5c.js → revenue-accelerate-D7Sp0V4a.js} +2 -2
  202. package/dist/{review-CxIN9azU.js → review-D4TUjcWF.js} +2 -2
  203. package/dist/roleMetadata-DmgqzhZJ.js +66 -0
  204. package/dist/{rules-ClDW_ZSK.js → rules-B_6RrE9T.js} +6 -5
  205. package/dist/{save-Fgy7EDid.js → save-BfqO2JBI.js} +2 -2
  206. package/dist/{search-C4GZ-Rc1.js → search-Cmzbf5zI.js} +2 -2
  207. package/dist/{show-yPjPmEf8.js → show-IdbU1C6P.js} +2 -2
  208. package/dist/{singpass-logo-BkMSwiGY.js → singpass-logo-wY4xsmTX.js} +2 -2
  209. package/dist/{singpass-verification-instant-hY4eGFwl.js → singpass-verification-instant-JCqTr7Mv.js} +2 -2
  210. package/dist/{singpass-verification-manual-DwhRpy5Q.js → singpass-verification-manual-DQ7XW6R3.js} +2 -2
  211. package/dist/{solution-payments-CNAat9h7.js → solution-payments-DpyE_sdS.js} +2 -2
  212. package/dist/{store-IuAkDRAp.js → store-Btc4GcmU.js} +2 -2
  213. package/dist/style.css +965 -993
  214. package/dist/styles-CLV89_hH.js +965 -993
  215. package/dist/summaryItem-CAQCQSkt.js +18 -0
  216. package/dist/{tax-reporting-graph-DjzwRgE6.js → tax-reporting-graph-hgoilCHZ.js} +2 -2
  217. package/dist/{terminal-1-_me9J9h0.js → terminal-1-D1pwXCoi.js} +2 -2
  218. package/dist/{tink-logo-BcIv93ND.js → tink-logo-DDyjz5eJ.js} +2 -2
  219. package/dist/types/api/businessLines/useCreateBusinessLine.d.ts +1 -1
  220. package/dist/types/api/businessLines/useDeleteBusinessLine.d.ts +1 -1
  221. package/dist/types/api/businessLines/useUpdateBusinessLines.d.ts +1 -1
  222. package/dist/types/api/businessLines/useUpdateSourceOfFunds.d.ts +1 -1
  223. package/dist/types/api/companyDataSet/useClearCompanyData.d.ts +1 -1
  224. package/dist/types/api/createLegalEntity/useCreateLegalEntity.d.ts +1 -1
  225. package/dist/types/api/documentValidation/useDocumentValidate.d.ts +1 -1
  226. package/dist/types/api/documents/useCreateDocument.d.ts +1 -1
  227. package/dist/types/api/documents/useDeleteDocument.d.ts +1 -1
  228. package/dist/types/api/documents/useDocument.d.ts +1 -1
  229. package/dist/types/api/documents/useUpdateDocument.d.ts +1 -1
  230. package/dist/types/api/entityVerifications/useVerifyIdNumber.d.ts +2 -2
  231. package/dist/types/api/idVerificationProviders/idVerificationStartCheck.d.ts +1 -1
  232. package/dist/types/api/idVerificationProviders/useExtractDocumentInformation.d.ts +1 -1
  233. package/dist/types/api/idVerificationProviders/useIdVerificationToken.d.ts +1 -1
  234. package/dist/types/api/legalEntity/useConfirmReview.d.ts +1 -1
  235. package/dist/types/api/legalEntity/useUpdateLegalEntity.d.ts +1 -1
  236. package/dist/types/api/onboardingStatus/useGenerateOnboardingLink.d.ts +1 -1
  237. package/dist/types/api/pci/useSignPci.d.ts +1 -2
  238. package/dist/types/api/taskStatus/useTaskStatus.d.ts +2 -2
  239. package/dist/types/api/termsOfService/useAcceptTermsOfService.d.ts +1 -1
  240. package/dist/types/api/types.d.ts +2 -1
  241. package/dist/types/api/uiAnalytics/useAnalyticsSession.d.ts +1 -1
  242. package/dist/types/api/uiAnalytics/usePushAnalyticEvent.d.ts +1 -1
  243. package/dist/types/api/validation/useValidateAccountIdentification.d.ts +1 -1
  244. package/dist/types/components/BankAccount/forms/BankDocument/types.d.ts +0 -1
  245. package/dist/types/components/BankAccount/forms/BankVerification/types.d.ts +1 -0
  246. package/dist/types/components/BankAccount/forms/BankVerification/verification/overlay/BankVerificationOverlay.d.ts +1 -1
  247. package/dist/types/components/BankAccount/forms/PayoutDetails/types.d.ts +0 -1
  248. package/dist/types/components/BankAccount/mapping/payoutKeyMappings.d.ts +439 -439
  249. package/dist/types/components/BankAccount/tasks/PayoutDetailsDropin/PayoutDetailsDropin.d.ts +1 -1
  250. package/dist/types/components/BankAccount/utils/payoutAccountUtil.d.ts +1 -1
  251. package/dist/types/components/Business/forms/BusinessDetails/form-ids.d.ts +2 -0
  252. package/dist/types/components/Business/forms/BusinessDetails/types.d.ts +1 -0
  253. package/dist/types/components/Business/forms/CompanyStructure/CompanyStructure.d.ts +0 -1
  254. package/dist/types/components/Business/tasks/BusinessDetailsDropin/types.d.ts +1 -1
  255. package/dist/types/components/Business/tasks/BusinessDetailsDropin/utils.d.ts +1 -1
  256. package/dist/types/components/BusinessLines/tasks/BusinessLines/BusinessLinesDropin.d.ts +1 -1
  257. package/dist/types/components/BusinessLines/tasks/types.d.ts +2 -0
  258. package/dist/types/components/BusinessLines/tasks/utils.d.ts +4 -2
  259. package/dist/types/components/EFP/mapping/businessFinancingKeyMappings.d.ts +475 -475
  260. package/dist/types/components/EFP/tasks/SourceOfFundsDropin/utils.d.ts +1 -2
  261. package/dist/types/components/EFP/tasks/TaxReportingDropin/utils.d.ts +1 -2
  262. package/dist/types/components/EmbeddedDropins/BusinessFinancingComponent/utils.d.ts +1 -1
  263. package/dist/types/components/Individual/forms/Individual/Individual.d.ts +41 -3
  264. package/dist/types/components/Individual/forms/Individual/form-ids.d.ts +2 -0
  265. package/dist/types/components/Individual/forms/Individual/types.d.ts +1 -2
  266. package/dist/types/components/Individual/forms/IndividualOnfido/IndividualOnfido.types.d.ts +1 -0
  267. package/dist/types/components/Individual/forms/IndividualOnfido/form-ids.d.ts +2 -0
  268. package/dist/types/components/Individual/tasks/DecisionMakers/DecisionMakerDetails/utils.d.ts +1 -1
  269. package/dist/types/components/Individual/tasks/DecisionMakers/utils.d.ts +1 -1
  270. package/dist/types/components/Shared/Introduction/copy.d.ts +1 -1
  271. package/dist/types/components/Shared/forms/Address/utils.d.ts +1 -1
  272. package/dist/types/components/Shared/forms/BusinessTypeSelection/utils.d.ts +1 -1
  273. package/dist/types/components/Trust/tasks/RoleAndTypeDropin/formatRoleAndEntityTypeSummary.d.ts +1 -1
  274. package/dist/types/components/ui/molecules/EmbeddedStatus/statusToTag.d.ts +1 -1
  275. package/dist/types/core/user-events.d.ts +1 -0
  276. package/dist/types/language/types.d.ts +7 -2
  277. package/dist/types/language/utils.d.ts +1 -2
  278. package/dist/types/types/assert.d.ts +1 -0
  279. package/dist/types/utils/analytics/debouncedInputEvent.d.ts +1 -0
  280. package/dist/types/utils/analytics/getPrefilledDetails.d.ts +28 -0
  281. package/dist/types/utils/api/processCapabilitites.d.ts +13 -0
  282. package/dist/types/utils/entityStatusUtil.d.ts +1 -1
  283. package/dist/types/utils/formUtils.d.ts +1 -2
  284. package/dist/types/utils/getDisplayErrorMessage.d.ts +1 -2
  285. package/dist/types/utils/getName.d.ts +1 -1
  286. package/dist/types/utils/makeSelectItemForRole.d.ts +1 -1
  287. package/dist/types/utils/translation.d.ts +3 -2
  288. package/dist/{types-DDnAZYTj.js → types-C6ntGMCy.js} +3 -26
  289. package/dist/{types-DE1uuPfP.js → types-CpAtsPmJ.js} +1 -1
  290. package/dist/{types-hGeLq0SR.js → types-c9nG7Dev.js} +1 -1
  291. package/dist/unincorporated-partnership-MeN1dp53.js +97 -0
  292. package/dist/{upload-BF65P4KM.js → upload-BmUXjsaU.js} +2 -2
  293. package/dist/{us-check-CYY6Crhr.js → us-check-C1rTBsCY.js} +2 -2
  294. package/dist/{us-check-account-number-C7KE5YzX.js → us-check-account-number-9lI1dXNC.js} +2 -2
  295. package/dist/{us-check-routing-number-DUbhsYAR.js → us-check-routing-number-s_KaAGSM.js} +2 -2
  296. package/dist/{useAssociatedLegalEntity-D_Nk_obe.js → useAssociatedLegalEntity-ahBb64MW.js} +2 -2
  297. package/dist/useBusinessDetailsData-qQ2HRnKK.js +5161 -0
  298. package/dist/{useCreateLegalEntity-DT7ue23d.js → useCreateLegalEntity-Kc8_ZlAe.js} +2 -2
  299. package/dist/useDataset-DfKmlbQd.js +74 -0
  300. package/dist/useForm-9uKM-XKf.js +582 -0
  301. package/dist/{FormFlow-BrgeP70A.js → useFormContext-CvQfKDA3.js} +26 -31
  302. package/dist/{useGlobalData-C7tjZfC0.js → useGlobalData-BVQ2OrIi.js} +3 -3
  303. package/dist/useId-BZ0PA7jP.js +24 -0
  304. package/dist/{useMultiForm-DWozxGN4.js → useMultiForm-pAiPIh7X.js} +4 -4
  305. package/dist/{useOnboardingStatus-DBLS6PUq.js → useOnboardingStatus-BhDBSLB6.js} +1 -1
  306. package/dist/{useScenarios-DD06bWNN.js → useScenarios-DFW21Vhf.js} +2 -2
  307. package/dist/{useTermsOfServiceStatus-D2lYSqHn.js → useTermsOfServiceStatus-BnO0rXiL.js} +1 -1
  308. package/dist/{useToastContext-Cbw29cqc.js → useToastContext-D6Lbxqj9.js} +5 -17
  309. package/dist/{useUnincorporatedPartnershipMembers-Dbb2VjkF.js → useUnincorporatedPartnershipMembers-CIC7xPbD.js} +5 -5
  310. package/dist/useUpdateBusinessLines-WlwUOtSU.js +337 -0
  311. package/dist/{useUpdateLegalEntity-Aubxhgvv.js → useUpdateLegalEntity-CStkUt4I.js} +3 -3
  312. package/dist/utils-7_xBiPO_.js +58 -0
  313. package/dist/utils-BmxzrkCX.js +165 -0
  314. package/dist/{utils-D1-D6fui.js → utils-CB39nVjj.js} +6 -6
  315. package/dist/{utils-DenrGsUh.js → utils-CDAwsXQa.js} +4 -4
  316. package/dist/utils-DOiFhaKn.js +29 -0
  317. package/dist/{documentUtils-Be5wlCwo.js → validate-Bsx2oHT1.js} +170 -6
  318. package/dist/{validate-BxVes1el.js → validate-D-l23QLG.js} +2 -2
  319. package/dist/validate-D4iK6FUk.js +385 -0
  320. package/dist/{validationError-DPP91cM3.js → validationError-DYYlX-5X.js} +2 -2
  321. package/dist/{warning-circle-fill-CEN1WL7A.js → warning-circle-fill-DBvt921B.js} +2 -2
  322. package/dist/{warning-diamond-filled-BfXMlVrG.js → warning-diamond-filled-Lb2od2ry.js} +2 -2
  323. package/dist/{webinar-DqjqrNEv.js → webinar-m9nuFZBt.js} +2 -2
  324. package/dist/{yapily-logo-CZ4ywjwA.js → yapily-logo-BduxhNRA.js} +2 -2
  325. package/package.json +6 -6
  326. package/dist/ConstitutionalDocument-DM6M40MP.js +0 -143
  327. package/dist/CountryField-CsKJAI53.js +0 -843
  328. package/dist/IndividualOnfidoDropin-DZEn2Tf8.js +0 -2575
  329. package/dist/OnboardingDropinComponent-Cx-c_p0i.js +0 -7623
  330. package/dist/getFieldsWithExistingData-CfckMyJ1.js +0 -22
  331. package/dist/mapFinancialReportsToFinancialInformation-Bfvt2G87.js +0 -67
  332. package/dist/mapJpAddressSchemaToAddressLocalizations-CWY2lZGD.js +0 -63
  333. package/dist/types/components/Shared/forms/BusinessTypeSelection/EntityTypeRadioGroupCard.d.ts +0 -11
  334. package/dist/useBusinessDetailsData-DG9EJBH_.js +0 -2441
  335. package/dist/useDataset-DCCxYOjr.js +0 -220
  336. package/dist/useUpdateBusinessLines-8bDYsLav.js +0 -46
  337. package/dist/validate-BgMFLdKI.js +0 -41
@@ -0,0 +1,2358 @@
1
+ ;
2
+ {
3
+ try {
4
+ let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
5
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "aba84a2d-c001-4a06-ba2e-8999d8458139", e._sentryDebugIdIdentifier = "sentry-dbid-aba84a2d-c001-4a06-ba2e-8999d8458139");
6
+ } catch (e) {
7
+ }
8
+ }
9
+ ;
10
+ import { jsx, jsxs, Fragment } from "preact/jsx-runtime";
11
+ import { C as Checkbox } from "./Checkbox-D8rB6_HN.js";
12
+ import { F as Field } from "./Field-B3Vy1-QZ.js";
13
+ import { m as makeMask, n as numericInputs, s as spacer, M as MaskedInput, a as nonInputs, b as alphaInputs, d as alphanumericInputs } from "./MaskedInput-Cn0VAuEp.js";
14
+ import { useMemo, useCallback, useEffect, useRef } from "preact/hooks";
15
+ import { R as RadioGroup } from "./RadioGroup-DPc8nUuk.js";
16
+ import { u as useTranslation, C as CountryCodes, Z as useExperimentsContext, ad as objectsDeepEqual, r as LegalEntityTypes } from "./StoreProvider-D9IR5HNN.js";
17
+ import { j as getCompanyRegistrationNumberOptions, s as stateFormatGuidanceText, m as businessRegistrationNumberMasks, n as businessRegistrationNumberPatterns, v as vatNumberOptions, o as getVatNumberOptions, M as MemoizedDocumentUpload } from "./TaxInformationField-c-ZWfhUk.js";
18
+ import { C as CompanyTypesValues } from "./bafinUtils-Wct4TWLH.js";
19
+ import { v as validatePatternOnBlur, a as validateNotEmptyOnBlur } from "./patternValidators-BXduwLbz.js";
20
+ import { I as InputText } from "./InputText-DGKAS6ZI.js";
21
+ import { u as uppercase } from "./mapExistingFile-DNBa6Ekj.js";
22
+ import { createElement } from "preact";
23
+ import { H as Header } from "./Header-YafgG5Nz.js";
24
+ import { S as StateContextSetter } from "./validate-Bsx2oHT1.js";
25
+ import { u as useForm } from "./useForm-9uKM-XKf.js";
26
+ import { C as ContextGuidance } from "./ContextGuidance-CCknw_Y1.js";
27
+ import { E as ErrorPanel } from "./ErrorPanel-CFN2G9Vz.js";
28
+ import { c as createFormUtils } from "./formUtils-BlVlgetw.js";
29
+ import { a as getFormProps } from "./getProps-CLJfvUMb.js";
30
+ import { A as Address } from "./Address-ki-bCjUJ.js";
31
+ import { memo } from "preact/compat";
32
+ const operationalAddressIsSameIds = {
33
+ OPERATIONAL_ADDRESS_IS_SAME: "OperationAddressAnswerYes",
34
+ OPERATIONAL_ADDRESS_IS_NOT_SAME: "OperationAddressAnswerNo"
35
+ };
36
+ const operationalAddressIsSameItems = [
37
+ {
38
+ id: operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_SAME,
39
+ name: "operationalAddressIsSameItemName"
40
+ },
41
+ {
42
+ id: operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME,
43
+ name: "operationalAddressIsNotSameItemName"
44
+ }
45
+ ];
46
+ function CompanyRegistrationNumberTypeSelector({
47
+ country,
48
+ companyType,
49
+ selected,
50
+ setSelected,
51
+ exemptedOption
52
+ }) {
53
+ const { t } = useTranslation("common");
54
+ const options = useMemo(() => {
55
+ const availableOptions = getCompanyRegistrationNumberOptions(country, companyType) ?? [];
56
+ if (availableOptions.length === 0 || !exemptedOption) return availableOptions;
57
+ return [
58
+ ...availableOptions,
59
+ {
60
+ id: "exempted",
61
+ name: exemptedOption
62
+ }
63
+ ];
64
+ }, [companyType, country, exemptedOption]);
65
+ const handleSelect = useCallback(
66
+ (selectedStr) => {
67
+ const newSelected = selectedStr;
68
+ if (newSelected === "exempted") {
69
+ if (exemptedOption) {
70
+ setSelected(newSelected);
71
+ }
72
+ return;
73
+ }
74
+ setSelected(newSelected);
75
+ },
76
+ [exemptedOption, setSelected]
77
+ );
78
+ useEffect(() => {
79
+ if (options.length > 0 && (!selected || !options.some((option) => option.id === selected))) {
80
+ if (selected === "exempted") return;
81
+ setSelected(options[0].id);
82
+ }
83
+ }, [options, selected, setSelected]);
84
+ if (options.length <= 1) return null;
85
+ return /* @__PURE__ */ jsx(
86
+ Field,
87
+ {
88
+ el: "fieldset",
89
+ name: "companyRegistrationNumberType",
90
+ label: t(($) => $["whichTypeOfRegistrationNumberDoYouHave"]),
91
+ children: (childProps) => /* @__PURE__ */ jsx(
92
+ RadioGroup,
93
+ {
94
+ ...childProps,
95
+ name: "companyRegistrationNumberType",
96
+ items: options,
97
+ value: selected,
98
+ onChange: handleSelect
99
+ }
100
+ )
101
+ }
102
+ );
103
+ }
104
+ const registrationNumberDefaultFieldMetadata = {
105
+ label: "registrationNumber"
106
+ };
107
+ const registrationNumberDefaultFieldConfig = {
108
+ [CountryCodes.Australia]: ({ companyType }) => {
109
+ if (companyType === CompanyTypesValues.INCORPORATED_ASSOCIATION) {
110
+ return {
111
+ label: "incorporatedAssociationRegistrationNumber",
112
+ mask: businessRegistrationNumberMasks[CountryCodes.Australia].associationIncorporated,
113
+ validators: validatePatternOnBlur(
114
+ businessRegistrationNumberPatterns[CountryCodes.Australia].associationIncorporated
115
+ ),
116
+ helperText: "findYourIncorporatedAssociationNumberInThePublicRegistryForYourState",
117
+ guidanceText: {
118
+ key: "enterXToYCharactersForExample",
119
+ values: {
120
+ minChars: "3",
121
+ maxChars: "20",
122
+ example: "200312345A"
123
+ }
124
+ }
125
+ };
126
+ }
127
+ return {
128
+ label: "australianBusinessNumberAcn",
129
+ mask: businessRegistrationNumberMasks[CountryCodes.Australia].default,
130
+ validators: validatePatternOnBlur(
131
+ businessRegistrationNumberPatterns[CountryCodes.Australia].default
132
+ ),
133
+ guidanceText: {
134
+ key: "enterNDigitsForExample",
135
+ values: {
136
+ numDigits: "9",
137
+ example: "123 456 789"
138
+ }
139
+ }
140
+ };
141
+ },
142
+ [CountryCodes.Austria]: ({ registrationNumberType }) => registrationNumberType === "ZVR" ? {
143
+ label: "zentralesVereinsregisterId",
144
+ mask: businessRegistrationNumberMasks[CountryCodes.Austria].ZVR,
145
+ validators: validatePatternOnBlur(
146
+ businessRegistrationNumberPatterns[CountryCodes.Austria].ZVR
147
+ ),
148
+ guidanceText: {
149
+ key: "enterTheRemainingNDigitsForExample",
150
+ values: {
151
+ numDigits: "9-10",
152
+ example: "AT-ZVR-555769679"
153
+ }
154
+ }
155
+ } : {
156
+ label: "firmenbuchnummer",
157
+ mask: businessRegistrationNumberMasks[CountryCodes.Austria].firmenbuchnummer,
158
+ validators: validatePatternOnBlur(
159
+ businessRegistrationNumberPatterns[CountryCodes.Austria].firmenbuchnummer
160
+ ),
161
+ guidanceText: {
162
+ key: "enterAMaximumOfNCharactersWithAMixForExample",
163
+ values: {
164
+ maxChars: "9",
165
+ example: "T1001a, FN89060n"
166
+ }
167
+ }
168
+ },
169
+ [CountryCodes.Belgium]: {
170
+ label: "enterpriseNumber",
171
+ mask: businessRegistrationNumberMasks[CountryCodes.Belgium].default,
172
+ validators: validatePatternOnBlur(
173
+ businessRegistrationNumberPatterns[CountryCodes.Belgium].default
174
+ ),
175
+ guidanceText: {
176
+ key: "enterNDigitsForExample",
177
+ values: {
178
+ numDigits: "10",
179
+ example: "1234567890"
180
+ }
181
+ }
182
+ },
183
+ [CountryCodes.Brazil]: {
184
+ label: "CNPJ",
185
+ mask: businessRegistrationNumberMasks[CountryCodes.Brazil].default,
186
+ validators: validatePatternOnBlur(
187
+ businessRegistrationNumberPatterns[CountryCodes.Brazil].default
188
+ ),
189
+ guidanceText: {
190
+ key: "enterNDigitsForExample",
191
+ values: {
192
+ numDigits: "14",
193
+ example: "28.773.626/8318-21"
194
+ }
195
+ }
196
+ },
197
+ [CountryCodes.Bulgaria]: {
198
+ label: "uniqueIdentificationCode",
199
+ mask: businessRegistrationNumberMasks[CountryCodes.Bulgaria].default,
200
+ validators: validatePatternOnBlur(
201
+ businessRegistrationNumberPatterns[CountryCodes.Bulgaria].default
202
+ ),
203
+ guidanceText: {
204
+ key: "enterNDigitsForExample",
205
+ values: {
206
+ numDigits: "9",
207
+ example: "812114069"
208
+ }
209
+ }
210
+ },
211
+ [CountryCodes.Canada]: {
212
+ label: "businessIncorporationNumber",
213
+ mask: businessRegistrationNumberMasks[CountryCodes.Canada].default,
214
+ validators: validatePatternOnBlur(
215
+ businessRegistrationNumberPatterns[CountryCodes.Canada].default
216
+ ),
217
+ guidanceText: {
218
+ key: "enterXToYCharactersForExample",
219
+ values: {
220
+ minChars: "5",
221
+ maxChars: "10",
222
+ example: "BC1234567"
223
+ }
224
+ }
225
+ },
226
+ [CountryCodes.Croatia]: ({ companyType }) => {
227
+ switch (companyType) {
228
+ case CompanyTypesValues.SOLE_PROPRIETORSHIP:
229
+ return {
230
+ label: "MBO",
231
+ mask: businessRegistrationNumberMasks[CountryCodes.Croatia].soleProprietorship,
232
+ validators: validatePatternOnBlur(
233
+ businessRegistrationNumberPatterns[CountryCodes.Croatia].soleProprietorship
234
+ ),
235
+ guidanceText: {
236
+ key: "enterNDigitsForExample",
237
+ values: {
238
+ numDigits: "8",
239
+ example: "12345678"
240
+ }
241
+ }
242
+ };
243
+ default:
244
+ return {
245
+ label: "MBS",
246
+ mask: businessRegistrationNumberMasks[CountryCodes.Croatia].default,
247
+ validators: validatePatternOnBlur(
248
+ businessRegistrationNumberPatterns[CountryCodes.Croatia].default
249
+ ),
250
+ guidanceText: {
251
+ key: "enterNDigitsForExample",
252
+ values: {
253
+ numDigits: "9",
254
+ example: "080020970"
255
+ }
256
+ }
257
+ };
258
+ }
259
+ },
260
+ [CountryCodes.Cyprus]: {
261
+ label: "cyRegistrationNumber",
262
+ mask: businessRegistrationNumberMasks[CountryCodes.Cyprus].default,
263
+ validators: validatePatternOnBlur(
264
+ businessRegistrationNumberPatterns[CountryCodes.Cyprus].default
265
+ ),
266
+ guidanceText: {
267
+ key: "enterEnglishLetterFollowedByXtoYDigitsForExample",
268
+ values: {
269
+ minDigits: "1",
270
+ maxDigits: "8",
271
+ example: "C12345678"
272
+ }
273
+ }
274
+ },
275
+ [CountryCodes.CzechRepublic]: {
276
+ label: "ICO",
277
+ mask: businessRegistrationNumberMasks[CountryCodes.CzechRepublic].default,
278
+ validators: validatePatternOnBlur(
279
+ businessRegistrationNumberPatterns[CountryCodes.CzechRepublic].default
280
+ ),
281
+ guidanceText: {
282
+ key: "enterXToYDigitsForExample",
283
+ values: {
284
+ minDigits: "8",
285
+ maxDigits: "10",
286
+ example: "12345678"
287
+ }
288
+ }
289
+ },
290
+ [CountryCodes.Denmark]: {
291
+ label: "CVR-nummer",
292
+ mask: businessRegistrationNumberMasks[CountryCodes.Denmark].default,
293
+ validators: validatePatternOnBlur(
294
+ businessRegistrationNumberPatterns[CountryCodes.Denmark].default
295
+ ),
296
+ guidanceText: {
297
+ key: "enterNDigitsForExample",
298
+ values: {
299
+ numDigits: "8",
300
+ example: "22756214"
301
+ }
302
+ }
303
+ },
304
+ [CountryCodes.Estonia]: {
305
+ label: "registrikood",
306
+ mask: businessRegistrationNumberMasks[CountryCodes.Estonia].default,
307
+ validators: validatePatternOnBlur(
308
+ businessRegistrationNumberPatterns[CountryCodes.Estonia].default
309
+ ),
310
+ guidanceText: {
311
+ key: "enterNDigitsForExample",
312
+ values: {
313
+ numDigits: "8",
314
+ example: "10345833"
315
+ }
316
+ }
317
+ },
318
+ [CountryCodes.Finland]: {
319
+ label: "YTunnus",
320
+ mask: businessRegistrationNumberMasks[CountryCodes.Finland].default,
321
+ validators: validatePatternOnBlur(
322
+ businessRegistrationNumberPatterns[CountryCodes.Finland].default
323
+ ),
324
+ guidanceText: {
325
+ key: "enterNDigitsForExample",
326
+ values: {
327
+ numDigits: "8",
328
+ example: "1234567-8"
329
+ }
330
+ }
331
+ },
332
+ [CountryCodes.France]: ({ registrationNumberType }) => registrationNumberType === "RNA" ? {
333
+ label: "rnaNumber",
334
+ mask: businessRegistrationNumberMasks[CountryCodes.France].RNA,
335
+ validators: validatePatternOnBlur(
336
+ businessRegistrationNumberPatterns[CountryCodes.France].RNA
337
+ ),
338
+ guidanceText: {
339
+ key: "enterTheRemainingNDigitsForExample",
340
+ values: {
341
+ numDigits: "9",
342
+ example: "W123456789 or W9M1234567"
343
+ }
344
+ }
345
+ } : {
346
+ label: "siret",
347
+ mask: businessRegistrationNumberMasks[CountryCodes.France].SIRET,
348
+ validators: validatePatternOnBlur(
349
+ businessRegistrationNumberPatterns[CountryCodes.France].SIRET
350
+ ),
351
+ guidanceText: {
352
+ key: "enterNDigitsForExample",
353
+ values: {
354
+ numDigits: "14",
355
+ example: "542051180-00066"
356
+ }
357
+ }
358
+ },
359
+ [CountryCodes.Germany]: {
360
+ label: "handelsregisternummerOrVereinsregisternummer",
361
+ mask: businessRegistrationNumberMasks[CountryCodes.Germany].default,
362
+ validators: validatePatternOnBlur(
363
+ businessRegistrationNumberPatterns[CountryCodes.Germany].default
364
+ ),
365
+ guidanceText: {
366
+ key: "enterAMaximumOfNCharactersWithAMixForExample",
367
+ values: {
368
+ maxChars: "20",
369
+ example: "HRB100484, HRA123456ABCDE-A1234, VR350378A"
370
+ }
371
+ }
372
+ },
373
+ [CountryCodes.Gibraltar]: {
374
+ label: "companyRegistrationNumber",
375
+ mask: businessRegistrationNumberMasks[CountryCodes.Gibraltar].default,
376
+ validators: validatePatternOnBlur(
377
+ businessRegistrationNumberPatterns[CountryCodes.Gibraltar].default
378
+ ),
379
+ guidanceText: {
380
+ key: "enterAMaximumOfNCharactersForExample",
381
+ values: {
382
+ maxChars: "8",
383
+ example: "04366849"
384
+ }
385
+ }
386
+ },
387
+ [CountryCodes.Greece]: {
388
+ label: "GEMI-number",
389
+ mask: businessRegistrationNumberMasks[CountryCodes.Greece].default,
390
+ validators: validatePatternOnBlur(
391
+ businessRegistrationNumberPatterns[CountryCodes.Greece].default
392
+ ),
393
+ guidanceText: {
394
+ key: "enterNDigitsForExample",
395
+ values: {
396
+ numDigits: "12",
397
+ example: "757001000000"
398
+ }
399
+ }
400
+ },
401
+ [CountryCodes.Guernsey]: {
402
+ label: "registrationNumber",
403
+ mask: businessRegistrationNumberMasks[CountryCodes.Guernsey].default,
404
+ validators: validatePatternOnBlur(
405
+ businessRegistrationNumberPatterns[CountryCodes.Guernsey].default
406
+ ),
407
+ guidanceText: {
408
+ key: "enterAMaximumOfNDigitsForExample",
409
+ values: {
410
+ maxDigits: "9",
411
+ example: "123456"
412
+ }
413
+ }
414
+ },
415
+ [CountryCodes.HongKong]: {
416
+ label: "companyRegistrationNumber__HK",
417
+ mask: businessRegistrationNumberMasks[CountryCodes.HongKong].default,
418
+ validators: validatePatternOnBlur(
419
+ businessRegistrationNumberPatterns[CountryCodes.HongKong].default
420
+ ),
421
+ guidanceText: {
422
+ key: "enterNDigitsForExample",
423
+ values: {
424
+ numDigits: "7",
425
+ example: "1234567"
426
+ }
427
+ }
428
+ },
429
+ [CountryCodes.Hungary]: ({ companyType }) => {
430
+ if (companyType === CompanyTypesValues.SOLE_PROPRIETORSHIP) {
431
+ return {
432
+ label: "huRegistrationNumberForSoleProp",
433
+ mask: businessRegistrationNumberMasks[CountryCodes.Hungary].nyilvantartasiSzam,
434
+ validators: validatePatternOnBlur(
435
+ businessRegistrationNumberPatterns[CountryCodes.Hungary].nyilvantartasiSzam
436
+ ),
437
+ guidanceText: {
438
+ key: "enterXToYDigitsForExample",
439
+ values: {
440
+ minDigits: "7",
441
+ maxDigits: "10",
442
+ example: "06123456"
443
+ }
444
+ }
445
+ };
446
+ }
447
+ return {
448
+ label: "huRegistrationNumber",
449
+ mask: businessRegistrationNumberMasks[CountryCodes.Hungary].default,
450
+ validators: validatePatternOnBlur(
451
+ businessRegistrationNumberPatterns[CountryCodes.Hungary].default
452
+ ),
453
+ guidanceText: {
454
+ key: "enterNDigitsForExample",
455
+ values: {
456
+ numDigits: "10",
457
+ example: "06-12-345678"
458
+ }
459
+ }
460
+ };
461
+ },
462
+ [CountryCodes.Ireland]: {
463
+ label: "companyNumber",
464
+ mask: businessRegistrationNumberMasks[CountryCodes.Ireland].default,
465
+ validators: validatePatternOnBlur(
466
+ businessRegistrationNumberPatterns[CountryCodes.Ireland].default
467
+ ),
468
+ guidanceText: {
469
+ key: "enterAMaximumOfNDigitsForExample",
470
+ values: {
471
+ maxDigits: "8",
472
+ example: "10123456"
473
+ }
474
+ }
475
+ },
476
+ [CountryCodes.IsleOfMan]: {
477
+ label: "registrationNumber",
478
+ mask: businessRegistrationNumberMasks[CountryCodes.IsleOfMan].default,
479
+ validators: validatePatternOnBlur(
480
+ businessRegistrationNumberPatterns[CountryCodes.IsleOfMan].default
481
+ ),
482
+ guidanceText: {
483
+ key: "enterNDigitsAndThen1LetterForExample",
484
+ values: {
485
+ numDigits: "6",
486
+ example: "114293C"
487
+ }
488
+ }
489
+ },
490
+ [CountryCodes.Italy]: ({ registrationNumberType }) => {
491
+ switch (registrationNumberType) {
492
+ case "CCIAA":
493
+ return {
494
+ label: "CCIAA",
495
+ mask: businessRegistrationNumberMasks[CountryCodes.Italy].CCIAA,
496
+ validators: validatePatternOnBlur(
497
+ businessRegistrationNumberPatterns[CountryCodes.Italy].CCIAA
498
+ ),
499
+ guidanceText: {
500
+ key: "enterNLettersAndThenXToYDigitsForExample",
501
+ values: {
502
+ numLetters: "2",
503
+ minDigits: "6",
504
+ maxDigits: "7",
505
+ example: "TO0091712"
506
+ }
507
+ }
508
+ };
509
+ case "partitaIVA":
510
+ default:
511
+ return {
512
+ label: "codiceFiscalePartitaIVA",
513
+ validators: validatePatternOnBlur(/^\d{11}$/),
514
+ mask: {
515
+ mask: makeMask(spacer, ...numericInputs(11))
516
+ },
517
+ guidanceText: {
518
+ key: "enterTheRemainingNDigitsForExample",
519
+ values: {
520
+ numDigits: "11",
521
+ example: "47040001100"
522
+ }
523
+ }
524
+ };
525
+ }
526
+ },
527
+ [CountryCodes.Japan]: {
528
+ label: "corporateRegistrationNumber",
529
+ mask: businessRegistrationNumberMasks[CountryCodes.Japan].default,
530
+ validators: validatePatternOnBlur(
531
+ businessRegistrationNumberPatterns[CountryCodes.Japan].default
532
+ ),
533
+ guidanceText: {
534
+ key: "enterAMaximumOfNCharactersForExample",
535
+ values: {
536
+ maxChars: "12",
537
+ example: "224863141686"
538
+ }
539
+ }
540
+ },
541
+ [CountryCodes.Jersey]: {
542
+ label: "registrationNumber",
543
+ mask: businessRegistrationNumberMasks[CountryCodes.Jersey].default,
544
+ validators: validatePatternOnBlur(
545
+ businessRegistrationNumberPatterns[CountryCodes.Jersey].default
546
+ ),
547
+ guidanceText: {
548
+ key: "enterAMaximumOfNCharactersForExample",
549
+ values: {
550
+ maxChars: "9",
551
+ example: "123722"
552
+ }
553
+ }
554
+ },
555
+ [CountryCodes.Latvia]: {
556
+ label: "lvRegistrationNumber",
557
+ mask: businessRegistrationNumberMasks[CountryCodes.Latvia].default,
558
+ validators: validatePatternOnBlur(
559
+ businessRegistrationNumberPatterns[CountryCodes.Latvia].default
560
+ ),
561
+ guidanceText: {
562
+ key: "enterNDigitsForExample",
563
+ values: {
564
+ numDigits: "11",
565
+ example: "50003251661"
566
+ }
567
+ }
568
+ },
569
+ [CountryCodes.Liechtenstein]: {
570
+ label: "liRegistrationNumber",
571
+ mask: businessRegistrationNumberMasks[CountryCodes.Liechtenstein].default,
572
+ validators: validatePatternOnBlur(
573
+ businessRegistrationNumberPatterns[CountryCodes.Liechtenstein].default
574
+ ),
575
+ guidanceText: {
576
+ key: "enterTheRemainingNDigitsForExample",
577
+ values: {
578
+ numDigits: "11",
579
+ example: "FL-0001.012.124-5"
580
+ }
581
+ }
582
+ },
583
+ [CountryCodes.Lithuania]: {
584
+ label: "ltRegistrationNumber",
585
+ mask: businessRegistrationNumberMasks[CountryCodes.Lithuania].default,
586
+ validators: validatePatternOnBlur(
587
+ businessRegistrationNumberPatterns[CountryCodes.Lithuania].default
588
+ ),
589
+ guidanceText: {
590
+ key: "enterXToYDigitsForExample",
591
+ values: {
592
+ minDigits: "6",
593
+ maxDigits: "9",
594
+ example: "123456789"
595
+ }
596
+ }
597
+ },
598
+ [CountryCodes.Luxembourg]: {
599
+ label: "luRegistrationNumber",
600
+ mask: businessRegistrationNumberMasks[CountryCodes.Luxembourg].default,
601
+ validators: validatePatternOnBlur(
602
+ businessRegistrationNumberPatterns[CountryCodes.Luxembourg].default
603
+ ),
604
+ guidanceText: {
605
+ key: "enter1LetterAndThenNDigitsForExample",
606
+ values: {
607
+ example: "C127766"
608
+ }
609
+ }
610
+ },
611
+ [CountryCodes.Malta]: {
612
+ label: "companyRegistrationNumber",
613
+ mask: businessRegistrationNumberMasks[CountryCodes.Malta].default,
614
+ validators: validatePatternOnBlur(
615
+ businessRegistrationNumberPatterns[CountryCodes.Malta].default
616
+ ),
617
+ guidanceText: {
618
+ key: "enterTheRemainingXToYDigitsForExample",
619
+ values: {
620
+ minDigits: "4",
621
+ maxDigits: "6",
622
+ example: "C 43070, P 1234"
623
+ }
624
+ }
625
+ },
626
+ [CountryCodes.Malaysia]: {
627
+ label: "SSM",
628
+ mask: businessRegistrationNumberMasks[CountryCodes.Malaysia].default,
629
+ validators: validatePatternOnBlur(
630
+ businessRegistrationNumberPatterns[CountryCodes.Malaysia].default
631
+ ),
632
+ guidanceText: {
633
+ key: "enterXOrYDigitsForExample",
634
+ values: {
635
+ xDigits: "7",
636
+ yDigits: "12",
637
+ example: "1234567, 201901000005"
638
+ }
639
+ }
640
+ },
641
+ [CountryCodes.Mexico]: {
642
+ label: "RFC",
643
+ mask: businessRegistrationNumberMasks[CountryCodes.Mexico].default,
644
+ validators: validatePatternOnBlur(
645
+ businessRegistrationNumberPatterns[CountryCodes.Mexico].default
646
+ ),
647
+ guidanceText: {
648
+ key: "enterNDigitsForExample",
649
+ values: {
650
+ numDigits: "12",
651
+ example: "LFM200817DGA"
652
+ }
653
+ }
654
+ },
655
+ [CountryCodes.Monaco]: ({ companyType }) => companyType === CompanyTypesValues.SOLE_PROPRIETORSHIP ? {
656
+ label: "mcRegistrationNumberSoleProp",
657
+ mask: businessRegistrationNumberMasks[CountryCodes.Monaco].soleProprietorship,
658
+ validators: validatePatternOnBlur(
659
+ businessRegistrationNumberPatterns[CountryCodes.Monaco].soleProprietorship
660
+ ),
661
+ guidanceText: {
662
+ key: "enterXToYCharactersWithAMixForExample",
663
+ values: {
664
+ minChars: "8",
665
+ maxChars: "11",
666
+ example: "8732P92873"
667
+ }
668
+ }
669
+ } : {
670
+ label: "mcRegistrationNumber",
671
+ mask: businessRegistrationNumberMasks[CountryCodes.Monaco].default,
672
+ validators: validatePatternOnBlur(
673
+ businessRegistrationNumberPatterns[CountryCodes.Monaco].default
674
+ ),
675
+ guidanceText: {
676
+ key: "enterXToYCharactersWithAMixForExample",
677
+ values: {
678
+ minChars: "8",
679
+ maxChars: "11",
680
+ example: "84SB02071"
681
+ }
682
+ }
683
+ },
684
+ [CountryCodes.Netherlands]: {
685
+ label: "chamberOfCommerceRegistrationNumber",
686
+ mask: businessRegistrationNumberMasks[CountryCodes.Netherlands].default,
687
+ validators: validatePatternOnBlur(
688
+ businessRegistrationNumberPatterns[CountryCodes.Netherlands].default
689
+ ),
690
+ guidanceText: {
691
+ key: "enterNDigitsForExample",
692
+ values: {
693
+ numDigits: "8",
694
+ example: "34179503"
695
+ }
696
+ }
697
+ },
698
+ [CountryCodes.NewZealand]: ({ registrationNumberType }) => registrationNumberType === "NZBN" ? {
699
+ label: "NZBN",
700
+ mask: businessRegistrationNumberMasks[CountryCodes.NewZealand].NZBN,
701
+ validators: validatePatternOnBlur(
702
+ businessRegistrationNumberPatterns[CountryCodes.NewZealand].NZBN
703
+ ),
704
+ guidanceText: {
705
+ key: "enterNDigitsForExample",
706
+ values: {
707
+ numDigits: "13",
708
+ example: "1234567890123"
709
+ }
710
+ }
711
+ } : {
712
+ label: "companyNumberNZ",
713
+ mask: businessRegistrationNumberMasks[CountryCodes.NewZealand].companyNumberNZ,
714
+ validators: validatePatternOnBlur(
715
+ businessRegistrationNumberPatterns[CountryCodes.NewZealand].companyNumberNZ
716
+ ),
717
+ guidanceText: {
718
+ key: "enterNDigitsForExample",
719
+ values: {
720
+ numDigits: "7",
721
+ example: "1234567"
722
+ }
723
+ }
724
+ },
725
+ [CountryCodes.Norway]: {
726
+ label: "organisasjonsnummer",
727
+ mask: businessRegistrationNumberMasks[CountryCodes.Norway].default,
728
+ validators: validatePatternOnBlur(
729
+ businessRegistrationNumberPatterns[CountryCodes.Norway].default
730
+ ),
731
+ guidanceText: {
732
+ key: "enterNDigitsForExample",
733
+ values: {
734
+ numDigits: "9",
735
+ example: "923609016"
736
+ }
737
+ }
738
+ },
739
+ [CountryCodes.Poland]: ({ registrationNumberType }) => registrationNumberType === "krsNumber" ? {
740
+ label: "krsNumber",
741
+ mask: businessRegistrationNumberMasks[CountryCodes.Poland].krsNumber,
742
+ validators: validatePatternOnBlur(
743
+ businessRegistrationNumberPatterns[CountryCodes.Poland].krsNumber
744
+ ),
745
+ guidanceText: {
746
+ key: "enterNDigitsForExample",
747
+ values: {
748
+ numDigits: "10",
749
+ example: "1234567890"
750
+ }
751
+ }
752
+ } : {
753
+ label: "regon",
754
+ mask: businessRegistrationNumberMasks[CountryCodes.Poland].regon,
755
+ validators: validatePatternOnBlur(
756
+ businessRegistrationNumberPatterns[CountryCodes.Poland].regon
757
+ ),
758
+ guidanceText: {
759
+ key: "enterNDigitsForExample",
760
+ values: {
761
+ numDigits: "9",
762
+ example: "123456789"
763
+ }
764
+ }
765
+ },
766
+ [CountryCodes.Portugal]: {
767
+ label: "NIPC",
768
+ mask: businessRegistrationNumberMasks[CountryCodes.Portugal].default,
769
+ validators: validatePatternOnBlur(
770
+ businessRegistrationNumberPatterns[CountryCodes.Portugal].default
771
+ ),
772
+ guidanceText: {
773
+ key: "enterNDigitsForExample",
774
+ values: {
775
+ numDigits: "9",
776
+ example: "123456789"
777
+ }
778
+ }
779
+ },
780
+ [CountryCodes.PuertoRico]: {
781
+ // should exactly match CountryCodes.UnitedStates
782
+ },
783
+ [CountryCodes.Romania]: ({ registrationNumberType }) => registrationNumberType === "roRegNumberOldFormat" ? {
784
+ label: "roRegNumberOldFormat_label",
785
+ mask: businessRegistrationNumberMasks[CountryCodes.Romania].roRegNumberOldFormat,
786
+ validators: validatePatternOnBlur(
787
+ businessRegistrationNumberPatterns[CountryCodes.Romania].roRegNumberOldFormat
788
+ ),
789
+ guidanceText: {
790
+ key: "roRegNumberOldFormat_maskGuidance"
791
+ }
792
+ } : {
793
+ label: "roRegNumberNewFormat_label",
794
+ mask: businessRegistrationNumberMasks[CountryCodes.Romania].roRegNumberNewFormat,
795
+ validators: validatePatternOnBlur(
796
+ businessRegistrationNumberPatterns[CountryCodes.Romania].roRegNumberNewFormat
797
+ ),
798
+ guidanceText: {
799
+ key: "roRegNumberNewFormat_maskGuidance"
800
+ }
801
+ },
802
+ [CountryCodes.Singapore]: {
803
+ label: "uen",
804
+ mask: businessRegistrationNumberMasks[CountryCodes.Singapore].default,
805
+ validators: validatePatternOnBlur(
806
+ businessRegistrationNumberPatterns[CountryCodes.Singapore].default
807
+ ),
808
+ guidanceText: {
809
+ key: "enterXToYCharactersWithAMixForExample",
810
+ values: {
811
+ minChars: "9",
812
+ maxChars: "10",
813
+ example: "200312345A"
814
+ }
815
+ }
816
+ },
817
+ [CountryCodes.Slovakia]: {
818
+ label: "skRegistrationNumber",
819
+ mask: businessRegistrationNumberMasks[CountryCodes.Slovakia].default,
820
+ validators: validatePatternOnBlur(
821
+ businessRegistrationNumberPatterns[CountryCodes.Slovakia].default
822
+ ),
823
+ guidanceText: {
824
+ key: "enterNDigitsForExample",
825
+ values: {
826
+ numDigits: "8",
827
+ example: "12345678"
828
+ }
829
+ }
830
+ },
831
+ [CountryCodes.Slovenia]: {
832
+ label: "siRegistrationNumber",
833
+ mask: businessRegistrationNumberMasks[CountryCodes.Slovenia].default,
834
+ validators: validatePatternOnBlur(
835
+ businessRegistrationNumberPatterns[CountryCodes.Slovenia].default
836
+ ),
837
+ guidanceText: {
838
+ key: "enterNDigitsForExample",
839
+ values: {
840
+ numDigits: "10",
841
+ example: "1006500006"
842
+ }
843
+ }
844
+ },
845
+ [CountryCodes.Spain]: {
846
+ label: "NIF",
847
+ mask: businessRegistrationNumberMasks[CountryCodes.Spain].default,
848
+ validators: validatePatternOnBlur(
849
+ businessRegistrationNumberPatterns[CountryCodes.Spain].default
850
+ ),
851
+ guidanceText: {
852
+ key: "enter1LetterAndThenNDigitsForExample",
853
+ values: {
854
+ numDigits: "8",
855
+ example: "A39000013"
856
+ }
857
+ }
858
+ },
859
+ [CountryCodes.Sweden]: {
860
+ label: "organisationsnummer",
861
+ mask: businessRegistrationNumberMasks[CountryCodes.Sweden].default,
862
+ validators: validatePatternOnBlur(
863
+ businessRegistrationNumberPatterns[CountryCodes.Sweden].default
864
+ ),
865
+ guidanceText: {
866
+ key: "enterNDigitsForExample",
867
+ values: {
868
+ numDigits: "10",
869
+ example: "202100-5489"
870
+ }
871
+ }
872
+ },
873
+ [CountryCodes.Switzerland]: {
874
+ label: "chRegistrationNumber",
875
+ mask: businessRegistrationNumberMasks[CountryCodes.Switzerland].default,
876
+ validators: validatePatternOnBlur(
877
+ businessRegistrationNumberPatterns[CountryCodes.Switzerland].default
878
+ ),
879
+ guidanceText: {
880
+ key: "enterTheRemainingNDigitsForExample",
881
+ values: {
882
+ numDigits: "9",
883
+ example: "CHE-123.456.789"
884
+ }
885
+ }
886
+ },
887
+ [CountryCodes.UnitedArabEmirates]: {
888
+ label: "commercialLicence",
889
+ validators: validateNotEmptyOnBlur
890
+ },
891
+ [CountryCodes.UnitedKingdom]: ({ companyType, registrationNumberType }) => {
892
+ const defaultConfig = {
893
+ label: "companyNumber",
894
+ mask: businessRegistrationNumberMasks[CountryCodes.UnitedKingdom].default,
895
+ validators: validatePatternOnBlur(
896
+ businessRegistrationNumberPatterns[CountryCodes.UnitedKingdom].default
897
+ ),
898
+ guidanceText: {
899
+ key: "enterNCharactersForExample",
900
+ values: {
901
+ numChars: "8",
902
+ example: "43668490"
903
+ }
904
+ }
905
+ };
906
+ switch (companyType) {
907
+ case "nonProfit":
908
+ switch (registrationNumberType) {
909
+ case "charity":
910
+ return {
911
+ label: "charityNumber",
912
+ mask: businessRegistrationNumberMasks[CountryCodes.UnitedKingdom].nonProfit,
913
+ validators: validatePatternOnBlur(
914
+ businessRegistrationNumberPatterns[CountryCodes.UnitedKingdom].nonProfit
915
+ ),
916
+ guidanceText: {
917
+ key: "enterThreeDifferingOptionsForExample",
918
+ values: {
919
+ firstOption: "6, 7 or 8 digits",
920
+ secondOption: "6 digits with a 2-letter prefix",
921
+ thirdOption: "6 digits with a suffix like -0",
922
+ firstExample: "123456",
923
+ secondExample: "SC012345",
924
+ thirdExample: "123456-0"
925
+ }
926
+ }
927
+ };
928
+ default:
929
+ return defaultConfig;
930
+ }
931
+ default:
932
+ return defaultConfig;
933
+ }
934
+ },
935
+ [CountryCodes.UnitedStates]: ({ state }) => ({
936
+ label: "registrationNumber__US",
937
+ mask: state ? businessRegistrationNumberMasks[CountryCodes.UnitedStates][state] : businessRegistrationNumberMasks[CountryCodes.UnitedStates].default,
938
+ validators: state ? validatePatternOnBlur(businessRegistrationNumberPatterns[CountryCodes.UnitedStates][state]) : validatePatternOnBlur(
939
+ businessRegistrationNumberPatterns[CountryCodes.UnitedStates].default
940
+ ),
941
+ guidanceText: state ? stateFormatGuidanceText[state] : stateFormatGuidanceText.default
942
+ })
943
+ };
944
+ const exemptFromRegistrationNumberDefaultFieldMetadata = {
945
+ label: "iDontHaveARegistrationNumber"
946
+ };
947
+ const exemptFromRegistrationNumberDefaultFieldConfig = {
948
+ [CountryCodes.Australia]: {
949
+ label: "doNotHaveAcn"
950
+ },
951
+ [CountryCodes.Austria]: {
952
+ label: "doNotHaveFirmenbuchnummer"
953
+ },
954
+ [CountryCodes.Finland]: {
955
+ label: "doNotHaveYTunnus"
956
+ },
957
+ [CountryCodes.HongKong]: {
958
+ label: "iDoNotHaveCompanyRegistrationNumber"
959
+ },
960
+ [CountryCodes.Germany]: {
961
+ label: "doNotHaveHandelsregisternummerOrVereinsregisternummer"
962
+ },
963
+ [CountryCodes.Lithuania]: {
964
+ label: "doNotHaveLtRegistrationNumber"
965
+ },
966
+ [CountryCodes.Luxembourg]: {
967
+ label: "doNotHaveLuRegistrationNumber"
968
+ },
969
+ [CountryCodes.Poland]: {
970
+ label: "doNotHaveRegonKrsNumber"
971
+ },
972
+ [CountryCodes.PuertoRico]: {
973
+ label: "doNotHaveEIN"
974
+ },
975
+ [CountryCodes.Sweden]: {
976
+ label: "doNotHaveOrganisationsnummer"
977
+ },
978
+ [CountryCodes.Switzerland]: {
979
+ label: "doNotHaveChRegistrationNumber"
980
+ }
981
+ };
982
+ const inferCompanyRegistrationNumberType = (registrationNumber, country, companyType) => {
983
+ const optionsForCountry = getCompanyRegistrationNumberOptions(country, companyType);
984
+ const metadataFn = registrationNumberDefaultFieldConfig[country];
985
+ if (!optionsForCountry) return void 0;
986
+ if (optionsForCountry.length === 1)
987
+ return optionsForCountry[0].id;
988
+ if (!optionsForCountry || !metadataFn) return void 0;
989
+ const allMetaData = optionsForCountry.reduce(
990
+ (acc, option) => {
991
+ const meta = typeof metadataFn === "function" ? metadataFn({
992
+ registrationNumberType: option.id,
993
+ companyType
994
+ }) : metadataFn;
995
+ if (meta.label && !acc[meta.label]) {
996
+ acc[meta.label] = meta;
997
+ }
998
+ return acc;
999
+ },
1000
+ {}
1001
+ );
1002
+ for (const option of optionsForCountry) {
1003
+ const fieldMetadata = allMetaData[option.name];
1004
+ if (!fieldMetadata?.validators) continue;
1005
+ const validators = Array.isArray(fieldMetadata.validators) ? fieldMetadata.validators : [fieldMetadata.validators];
1006
+ if (validators.every((validator) => validator.validate(registrationNumber))) {
1007
+ return option.id;
1008
+ }
1009
+ }
1010
+ };
1011
+ function getDefaultRegistrationNumberType(registrationNumber, country, companyType) {
1012
+ return registrationNumber ? inferCompanyRegistrationNumberType(registrationNumber, country, companyType) : getCompanyRegistrationNumberOptions(country, companyType)?.[0]?.id;
1013
+ }
1014
+ const BUSINESS_REGISTRATION_NUMBER_FIELD = ["registrationNumber", "registrationNumberType", "exemptedFromRegistrationNumber"];
1015
+ function BusinessRegistrationNumberField({
1016
+ data,
1017
+ valid,
1018
+ errors,
1019
+ labels,
1020
+ mask,
1021
+ guidanceText,
1022
+ helperText,
1023
+ placeholders,
1024
+ readonly,
1025
+ shouldValidate,
1026
+ optional,
1027
+ handleChangeFor,
1028
+ country,
1029
+ canExempt,
1030
+ companyType
1031
+ }) {
1032
+ const registrationNumberOptions = getCompanyRegistrationNumberOptions(country, companyType);
1033
+ const defaultType = getDefaultRegistrationNumberType(
1034
+ data.registrationNumber,
1035
+ country,
1036
+ companyType
1037
+ );
1038
+ const showExemptedOption = canExempt && !!registrationNumberOptions && registrationNumberOptions.length > 1;
1039
+ const registrationNumberType = data.exemptedFromRegistrationNumber ? "exempted" : data.registrationNumberType ? data.registrationNumberType : defaultType;
1040
+ const handleRegistrationNumberChange = (e, mode) => {
1041
+ const value = typeof e === "string" ? e : e.currentTarget.value;
1042
+ handleChangeFor("registrationNumber", mode)(value);
1043
+ handleChangeFor("registrationNumberType")(registrationNumberType);
1044
+ };
1045
+ const handleExemptedFromRegistrationNumber = (exempt) => {
1046
+ if (exempt) handleChangeFor("registrationNumber")("");
1047
+ handleChangeFor("exemptedFromRegistrationNumber")(exempt);
1048
+ };
1049
+ const handleCompanyRegistrationNumberTypeChange = (regNumberType) => {
1050
+ if (regNumberType === "exempted") {
1051
+ if (!canExempt) {
1052
+ throw Error(`${country} does not allow tax exemptions`);
1053
+ }
1054
+ handleChangeFor("registrationNumber")("");
1055
+ handleChangeFor("exemptedFromRegistrationNumber")(true);
1056
+ handleChangeFor("registrationNumberType")(void 0);
1057
+ return;
1058
+ }
1059
+ if (canExempt && data.exemptedFromRegistrationNumber === true) {
1060
+ handleChangeFor("exemptedFromRegistrationNumber")(false);
1061
+ }
1062
+ handleChangeFor("registrationNumber")("");
1063
+ handleChangeFor("registrationNumberType")(regNumberType);
1064
+ };
1065
+ if (registrationNumberType && registrationNumberType !== "exempted") {
1066
+ const countryHasType = registrationNumberOptions?.find(
1067
+ (option) => option.id === registrationNumberType
1068
+ );
1069
+ if (!countryHasType) {
1070
+ handleChangeFor("registrationNumberType")(defaultType);
1071
+ }
1072
+ }
1073
+ return /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-field__business-registration", children: [
1074
+ /* @__PURE__ */ jsx(
1075
+ CompanyRegistrationNumberTypeSelector,
1076
+ {
1077
+ companyType,
1078
+ country,
1079
+ setSelected: handleCompanyRegistrationNumberTypeChange,
1080
+ selected: registrationNumberType,
1081
+ exemptedOption: showExemptedOption ? labels.exemptedFromRegistrationNumber : false
1082
+ }
1083
+ ),
1084
+ /* @__PURE__ */ jsx(
1085
+ MaskedInput,
1086
+ {
1087
+ "aria-required": true,
1088
+ "aria-invalid": !valid.registrationNumber,
1089
+ name: "registrationNumber",
1090
+ type: "text",
1091
+ value: data?.registrationNumber ?? "",
1092
+ label: labels.registrationNumber ?? "",
1093
+ formatGuidance: guidanceText?.registrationNumber ?? "",
1094
+ placeholder: placeholders?.registrationNumber,
1095
+ errorMessage: errors.registrationNumber,
1096
+ isValid: Boolean(valid.registrationNumber),
1097
+ onInput: (e) => handleRegistrationNumberChange(e, "input"),
1098
+ onBlur: (e) => handleRegistrationNumberChange(e, "blur"),
1099
+ disabled: data.exemptedFromRegistrationNumber,
1100
+ optional,
1101
+ readonly,
1102
+ shouldValidate: !optional && shouldValidate,
1103
+ helper: helperText?.registrationNumber,
1104
+ ...mask
1105
+ }
1106
+ ),
1107
+ canExempt && !showExemptedOption && /* @__PURE__ */ jsx(Field, { name: "exemptedFromRegistrationNumber", children: (childProps) => /* @__PURE__ */ jsx(
1108
+ Checkbox,
1109
+ {
1110
+ ...childProps,
1111
+ "aria-required": false,
1112
+ "aria-invalid": false,
1113
+ name: "exemptedFromRegistrationNumber",
1114
+ value: "exemptedFromRegistrationNumber",
1115
+ checked: Boolean(data.exemptedFromRegistrationNumber),
1116
+ label: labels?.exemptedFromRegistrationNumber,
1117
+ readonly,
1118
+ onChange: handleExemptedFromRegistrationNumber
1119
+ }
1120
+ ) })
1121
+ ] });
1122
+ }
1123
+ const DBA_NAME_FIELD = [
1124
+ "hasDoingBusinessAs",
1125
+ "doingBusinessAs"
1126
+ ];
1127
+ function DBANameField({
1128
+ data,
1129
+ valid,
1130
+ errors,
1131
+ labels,
1132
+ helperText,
1133
+ readonly,
1134
+ handleChangeFor
1135
+ }) {
1136
+ const { t } = useTranslation("common");
1137
+ const hasDoingBusinessAsValue = useMemo(() => {
1138
+ if (typeof data.hasDoingBusinessAs !== "boolean") return void 0;
1139
+ return data.hasDoingBusinessAs ? "yes" : "no";
1140
+ }, [data.hasDoingBusinessAs]);
1141
+ const handleHasDoingBusinessAsChange = (val) => {
1142
+ handleChangeFor("hasDoingBusinessAs")(val === "yes" ? true : false);
1143
+ };
1144
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1145
+ /* @__PURE__ */ jsx(
1146
+ Field,
1147
+ {
1148
+ el: "fieldset",
1149
+ name: "hasDoingBusinessAsName",
1150
+ label: labels.hasDoingBusinessAs ?? t(($) => $["hasDba"]),
1151
+ helper: helperText?.hasDoingBusinessAs ?? t(($) => $["hasDba__helperText"]),
1152
+ isValid: valid.hasDoingBusinessAs,
1153
+ errorMessage: errors.hasDoingBusinessAs,
1154
+ children: (childProps) => /* @__PURE__ */ jsx(
1155
+ RadioGroup,
1156
+ {
1157
+ ...childProps,
1158
+ name: "hasDoingBusinessAs",
1159
+ items: [
1160
+ { id: "yes", name: "yes" },
1161
+ { id: "no", name: "no" }
1162
+ ],
1163
+ value: hasDoingBusinessAsValue,
1164
+ onChange: handleHasDoingBusinessAsChange,
1165
+ horizontal: true
1166
+ }
1167
+ )
1168
+ }
1169
+ ),
1170
+ data.hasDoingBusinessAs && /* @__PURE__ */ jsx(
1171
+ Field,
1172
+ {
1173
+ name: "doingBusinessAs",
1174
+ label: labels.doingBusinessAs ?? t(($) => $["dbaName"]),
1175
+ errorMessage: errors.doingBusinessAs,
1176
+ isValid: valid.doingBusinessAs,
1177
+ children: (childProps) => /* @__PURE__ */ jsx(
1178
+ InputText,
1179
+ {
1180
+ ...childProps,
1181
+ "aria-required": true,
1182
+ "aria-invalid": !valid.doingBusinessAs,
1183
+ name: "doingBusinessAs",
1184
+ value: data.doingBusinessAs,
1185
+ readonly,
1186
+ onInput: handleChangeFor("doingBusinessAs", "input"),
1187
+ onBlur: handleChangeFor("doingBusinessAs", "blur")
1188
+ }
1189
+ )
1190
+ }
1191
+ )
1192
+ ] });
1193
+ }
1194
+ const doingBusinessAsAbsentFieldMetadata = {
1195
+ validators: [validateNotEmptyOnBlur]
1196
+ };
1197
+ const doingBusinessAsFieldMetadata = {
1198
+ label: "doingBusinessAs",
1199
+ validators: [validateNotEmptyOnBlur]
1200
+ };
1201
+ const vatAbsenceReasonMetadata = {
1202
+ validators: [validateNotEmptyOnBlur]
1203
+ };
1204
+ const defaultFieldMetadata = {
1205
+ label: "vatNumber"
1206
+ };
1207
+ const defaultFieldConfig = {
1208
+ [CountryCodes.Austria]: {
1209
+ label: "UST-ID",
1210
+ validators: validatePatternOnBlur(/^ATU\d{8}$/),
1211
+ mask: {
1212
+ mask: makeMask(...nonInputs("ATU", { includeInValue: true }), spacer, ...numericInputs(8))
1213
+ },
1214
+ guidanceText: {
1215
+ key: "enterTheRemainingNDigitsForExample",
1216
+ values: {
1217
+ numDigits: "8",
1218
+ example: "ATU51507409"
1219
+ }
1220
+ }
1221
+ },
1222
+ [CountryCodes.Belgium]: {
1223
+ label: "euVatNumber",
1224
+ validators: validatePatternOnBlur(/^BE[10]\d{9}$/),
1225
+ mask: {
1226
+ mask: makeMask(...nonInputs("BE", { includeInValue: true }), spacer, ...numericInputs(10))
1227
+ },
1228
+ guidanceText: {
1229
+ key: "enterTheRemainingNDigitsForExample",
1230
+ values: {
1231
+ numDigits: "10",
1232
+ example: "BE1234567890"
1233
+ }
1234
+ }
1235
+ },
1236
+ [CountryCodes.Bulgaria]: {
1237
+ label: "identifikacionenNomerDDS",
1238
+ validators: validatePatternOnBlur(/^BG\d{9,10}$/),
1239
+ mask: {
1240
+ mask: makeMask(
1241
+ ...nonInputs("BG", { includeInValue: true }),
1242
+ spacer,
1243
+ ...numericInputs(9),
1244
+ ...numericInputs(1, true)
1245
+ )
1246
+ },
1247
+ guidanceText: {
1248
+ key: "enterTheRemainingXToYDigitsForExample",
1249
+ values: {
1250
+ minDigits: "9",
1251
+ maxDigits: "10",
1252
+ example: "BG1234567890"
1253
+ }
1254
+ }
1255
+ },
1256
+ [CountryCodes.Croatia]: {
1257
+ label: "PDVIdBrojOIB",
1258
+ validators: validatePatternOnBlur(/^HR\d{11}$/),
1259
+ mask: {
1260
+ mask: makeMask(...nonInputs("HR", { includeInValue: true }), spacer, ...numericInputs(11))
1261
+ },
1262
+ guidanceText: {
1263
+ key: "enterTheRemainingNDigitsForExample",
1264
+ values: {
1265
+ numDigits: "11",
1266
+ example: "HR94577403194"
1267
+ }
1268
+ }
1269
+ },
1270
+ [CountryCodes.Cyprus]: {
1271
+ label: "arithmosEngraphes",
1272
+ validators: validatePatternOnBlur(/^CY[A-Z0-9]{9}$/),
1273
+ mask: {
1274
+ mask: makeMask(
1275
+ ...nonInputs("CY", { includeInValue: true }),
1276
+ spacer,
1277
+ ...alphanumericInputs(9)
1278
+ ),
1279
+ transformOnType: uppercase
1280
+ },
1281
+ guidanceText: {
1282
+ key: "enterTheRemainingNCharactersForExample",
1283
+ values: {
1284
+ numChars: "9",
1285
+ example: "CY12345678X"
1286
+ }
1287
+ }
1288
+ },
1289
+ [CountryCodes.CzechRepublic]: {
1290
+ label: "DIC",
1291
+ validators: validatePatternOnBlur(/^CZ\d{8,10}$/),
1292
+ mask: {
1293
+ mask: makeMask(
1294
+ ...nonInputs("CZ", { includeInValue: true }),
1295
+ spacer,
1296
+ ...numericInputs(8),
1297
+ ...numericInputs(2, true)
1298
+ )
1299
+ },
1300
+ guidanceText: {
1301
+ key: "enterTheRemainingXToYDigitsForExample",
1302
+ values: {
1303
+ minDigits: "8",
1304
+ maxDigits: "10",
1305
+ example: "CZ00177041"
1306
+ }
1307
+ }
1308
+ },
1309
+ [CountryCodes.Denmark]: ({ vatNumberType }) => {
1310
+ switch (vatNumberType) {
1311
+ case "stamregister":
1312
+ return {
1313
+ label: "stamregister",
1314
+ validators: validatePatternOnBlur(/^SE\d{8}$/),
1315
+ mask: {
1316
+ mask: makeMask(
1317
+ ...nonInputs("SE", { includeInValue: true }),
1318
+ spacer,
1319
+ ...numericInputs(8)
1320
+ )
1321
+ },
1322
+ guidanceText: {
1323
+ key: "enterTheRemainingNDigitsForExample",
1324
+ values: {
1325
+ numDigits: "8",
1326
+ example: "SE12345678"
1327
+ }
1328
+ }
1329
+ };
1330
+ case "momsregistreringsnummerCVR":
1331
+ default:
1332
+ return {
1333
+ label: "momsregistreringsnummerCVR",
1334
+ validators: validatePatternOnBlur(/^DK\d{8}$/),
1335
+ mask: {
1336
+ mask: makeMask(
1337
+ ...nonInputs("DK", { includeInValue: true }),
1338
+ spacer,
1339
+ ...numericInputs(8)
1340
+ )
1341
+ },
1342
+ guidanceText: {
1343
+ key: "enterTheRemainingNDigitsForExample",
1344
+ values: {
1345
+ numDigits: "8",
1346
+ example: "DK12345678"
1347
+ }
1348
+ }
1349
+ };
1350
+ }
1351
+ },
1352
+ [CountryCodes.Estonia]: {
1353
+ label: "kaibemaksukohustuslaseNumber",
1354
+ validators: validatePatternOnBlur(/^EE\d{9}$/),
1355
+ mask: {
1356
+ mask: makeMask(...nonInputs("EE", { includeInValue: true }), spacer, ...numericInputs(9))
1357
+ },
1358
+ guidanceText: {
1359
+ key: "enterTheRemainingNDigitsForExample",
1360
+ values: {
1361
+ numDigits: "9",
1362
+ example: "EE100254507"
1363
+ }
1364
+ }
1365
+ },
1366
+ [CountryCodes.Finland]: {
1367
+ label: "arvonlisaveronumeroMervardesskattenummer",
1368
+ validators: validatePatternOnBlur(/^FI\d{8}$/),
1369
+ mask: {
1370
+ mask: makeMask(...nonInputs("FI", { includeInValue: true }), spacer, ...numericInputs(8))
1371
+ },
1372
+ guidanceText: {
1373
+ key: "enterTheRemainingNDigitsForExample",
1374
+ values: {
1375
+ numDigits: "9",
1376
+ example: "FI12345678"
1377
+ }
1378
+ }
1379
+ },
1380
+ [CountryCodes.France]: ({ vatNumberType }) => {
1381
+ const sharedMetadata = {
1382
+ validators: validatePatternOnBlur(/^FR\d{11}$/),
1383
+ mask: {
1384
+ mask: makeMask(...nonInputs("FR", { includeInValue: true }), spacer, ...numericInputs(11))
1385
+ }
1386
+ };
1387
+ switch (vatNumberType) {
1388
+ case "NumeroDeTVA":
1389
+ return {
1390
+ ...sharedMetadata,
1391
+ label: "NumeroDeTVA",
1392
+ guidanceText: {
1393
+ key: "enterTheRemainingNDigitsForExample",
1394
+ values: {
1395
+ numDigits: "11",
1396
+ example: "FR12999999999"
1397
+ }
1398
+ }
1399
+ };
1400
+ case "numeroDIdentificationALATaxe":
1401
+ default:
1402
+ return {
1403
+ ...sharedMetadata,
1404
+ label: "numeroDIdentificationALATaxe",
1405
+ guidanceText: {
1406
+ key: "enterTheRemainingNDigitsForExample",
1407
+ values: {
1408
+ numDigits: "11",
1409
+ example: "FR12345678901"
1410
+ }
1411
+ }
1412
+ };
1413
+ }
1414
+ },
1415
+ [CountryCodes.Germany]: {
1416
+ label: "USt-IdNr",
1417
+ validators: validatePatternOnBlur(/^DE\d{9}$/),
1418
+ mask: {
1419
+ mask: makeMask(...nonInputs("DE", { includeInValue: true }), spacer, ...numericInputs(9))
1420
+ },
1421
+ guidanceText: {
1422
+ key: "enterTheRemainingNDigitsForExample",
1423
+ values: {
1424
+ numDigits: "9",
1425
+ example: "DE115235681"
1426
+ }
1427
+ }
1428
+ },
1429
+ [CountryCodes.Greece]: {
1430
+ label: "grTaxId",
1431
+ validators: validatePatternOnBlur(/^EL\d{9}$/),
1432
+ mask: {
1433
+ mask: makeMask(...nonInputs("EL", { includeInValue: true }), spacer, ...numericInputs(9))
1434
+ },
1435
+ guidanceText: {
1436
+ key: "enterTheRemainingNDigitsForExample",
1437
+ values: {
1438
+ numDigits: "9",
1439
+ example: "EL123456789"
1440
+ }
1441
+ }
1442
+ },
1443
+ [CountryCodes.Hungary]: {
1444
+ label: "huTaxId",
1445
+ validators: validatePatternOnBlur(/^HU\d{8}$/),
1446
+ mask: {
1447
+ mask: makeMask(...nonInputs("HU", { includeInValue: true }), spacer, ...numericInputs(8))
1448
+ },
1449
+ guidanceText: {
1450
+ key: "enterTheRemainingNDigitsForExample",
1451
+ values: {
1452
+ numDigits: "8",
1453
+ example: "HU12345678"
1454
+ }
1455
+ }
1456
+ },
1457
+ [CountryCodes.Ireland]: {
1458
+ label: "vatNumber",
1459
+ validators: validatePatternOnBlur(/^IE[A-Z0-9]{8,9}$/),
1460
+ mask: {
1461
+ mask: makeMask(
1462
+ ...nonInputs("IE", { includeInValue: true }),
1463
+ spacer,
1464
+ ...alphanumericInputs(8),
1465
+ ...alphanumericInputs(1, true)
1466
+ ),
1467
+ transformOnType: uppercase
1468
+ },
1469
+ guidanceText: {
1470
+ key: "enterTheRemainingXToYCharactersForExample",
1471
+ values: {
1472
+ minChars: "8",
1473
+ maxChars: "9",
1474
+ example: "IE999999XX"
1475
+ }
1476
+ }
1477
+ },
1478
+ [CountryCodes.Italy]: {
1479
+ label: "partitaIVA",
1480
+ validators: validatePatternOnBlur(/^IT\d{11}$/),
1481
+ mask: {
1482
+ mask: makeMask(...nonInputs("IT", { includeInValue: true }), spacer, ...numericInputs(11))
1483
+ },
1484
+ guidanceText: {
1485
+ key: "enterTheRemainingNDigitsForExample",
1486
+ values: {
1487
+ numDigits: "11",
1488
+ example: "IT47040001100"
1489
+ }
1490
+ }
1491
+ },
1492
+ [CountryCodes.Latvia]: {
1493
+ label: "lvTaxId",
1494
+ validators: validatePatternOnBlur(/^LV\d{11}$/),
1495
+ mask: {
1496
+ mask: makeMask(...nonInputs("LV", { includeInValue: true }), spacer, ...numericInputs(11))
1497
+ },
1498
+ guidanceText: {
1499
+ key: "enterTheRemainingNDigitsForExample",
1500
+ values: {
1501
+ numDigits: "11",
1502
+ example: "LV43603021620"
1503
+ }
1504
+ }
1505
+ },
1506
+ [CountryCodes.Liechtenstein]: {
1507
+ label: "vatRegistrationNumber",
1508
+ validators: validatePatternOnBlur(/^[0-9]{1,6}$/),
1509
+ mask: {
1510
+ mask: makeMask(...numericInputs(1), ...numericInputs(5, true))
1511
+ },
1512
+ guidanceText: {
1513
+ key: "enterAMaximumOfNDigitsForExample",
1514
+ values: {
1515
+ maxDigits: "6",
1516
+ example: "123456"
1517
+ }
1518
+ }
1519
+ },
1520
+ [CountryCodes.Lithuania]: {
1521
+ label: "PVMmoketojoKodas",
1522
+ validators: validatePatternOnBlur(/^LT\d{9,12}$/),
1523
+ mask: {
1524
+ mask: makeMask(
1525
+ ...nonInputs("LT", { includeInValue: true }),
1526
+ spacer,
1527
+ ...numericInputs(9),
1528
+ ...numericInputs(3, true)
1529
+ )
1530
+ },
1531
+ guidanceText: {
1532
+ key: "enterTheRemainingXToYDigitsForExample",
1533
+ values: {
1534
+ minDigits: "9",
1535
+ maxDigits: "12",
1536
+ example: "LT664517219"
1537
+ }
1538
+ }
1539
+ },
1540
+ [CountryCodes.Luxembourg]: {
1541
+ label: "numeroDIdentificationALATaxe",
1542
+ validators: validatePatternOnBlur(/^LU\d{8}$/),
1543
+ mask: {
1544
+ mask: makeMask(...nonInputs("LU", { includeInValue: true }), spacer, ...numericInputs(8))
1545
+ },
1546
+ guidanceText: {
1547
+ key: "enterTheRemainingNDigitsForExample",
1548
+ values: {
1549
+ numDigits: "8",
1550
+ example: "LU18928066"
1551
+ }
1552
+ }
1553
+ },
1554
+ [CountryCodes.Malaysia]: {
1555
+ label: "SST",
1556
+ validators: validatePatternOnBlur(/^([A-Z]\d{2}[-]\d{4}[-]\d{8}|\d{12})$/),
1557
+ guidanceText: {
1558
+ key: "enterXOrYCharactersForExample",
1559
+ values: {
1560
+ xChars: "12",
1561
+ yChars: "14",
1562
+ example: "123456789012, D11-1808-20032117"
1563
+ }
1564
+ }
1565
+ },
1566
+ [CountryCodes.Malta]: {
1567
+ label: "vatNumber",
1568
+ validators: validatePatternOnBlur(/^MT\d{8}$/),
1569
+ mask: {
1570
+ mask: makeMask(...nonInputs("MT", { includeInValue: true }), spacer, ...numericInputs(8))
1571
+ },
1572
+ guidanceText: {
1573
+ key: "enterTheRemainingNDigitsForExample",
1574
+ values: {
1575
+ numDigits: "8",
1576
+ example: "MT12345678"
1577
+ }
1578
+ }
1579
+ },
1580
+ [CountryCodes.Monaco]: {
1581
+ label: "numeroDIdentificationALATaxe",
1582
+ validators: validatePatternOnBlur(/^FR[0-9]{11}$/),
1583
+ mask: {
1584
+ mask: makeMask(...nonInputs("FR", { includeInValue: true }), spacer, ...numericInputs(11))
1585
+ },
1586
+ guidanceText: {
1587
+ key: "enterTheRemainingNDigitsForExample",
1588
+ values: {
1589
+ numDigits: "11",
1590
+ example: "FR12345678999"
1591
+ }
1592
+ }
1593
+ },
1594
+ [CountryCodes.Netherlands]: {
1595
+ label: "btwNummer",
1596
+ validators: validatePatternOnBlur(/^NL\d{9}B\d{2}$/),
1597
+ mask: {
1598
+ mask: makeMask(
1599
+ ...nonInputs("NL", { includeInValue: true }),
1600
+ spacer,
1601
+ ...numericInputs(9),
1602
+ spacer,
1603
+ ...nonInputs("B", { includeInValue: true }),
1604
+ spacer,
1605
+ ...numericInputs(2)
1606
+ ),
1607
+ transformOnType: uppercase
1608
+ },
1609
+ guidanceText: {
1610
+ key: "enterTheRemainingNCharactersForExample",
1611
+ values: {
1612
+ numChars: "12",
1613
+ example: "NL123456789B01"
1614
+ }
1615
+ }
1616
+ },
1617
+ [CountryCodes.Norway]: {
1618
+ label: "mvanummer",
1619
+ validators: validatePatternOnBlur(/^\d{9}MVA$/),
1620
+ mask: {
1621
+ mask: makeMask(
1622
+ ...numericInputs(9),
1623
+ ...nonInputs("MVA", { includeInValue: true, displayEagerly: true })
1624
+ )
1625
+ },
1626
+ guidanceText: {
1627
+ key: "enterNDigitsForExample",
1628
+ values: {
1629
+ numDigits: "9",
1630
+ example: "123456789MVA"
1631
+ }
1632
+ }
1633
+ },
1634
+ [CountryCodes.Poland]: {
1635
+ label: "NIP",
1636
+ validators: validatePatternOnBlur(/^PL\d{10}$/),
1637
+ mask: {
1638
+ mask: makeMask(...nonInputs("PL", { includeInValue: true }), spacer, ...numericInputs(10))
1639
+ },
1640
+ guidanceText: {
1641
+ key: "enterTheRemainingNDigitsForExample",
1642
+ values: {
1643
+ numDigits: "10",
1644
+ example: "PL1234567890"
1645
+ }
1646
+ }
1647
+ },
1648
+ [CountryCodes.Portugal]: {
1649
+ label: "numerodeIVA",
1650
+ validators: validatePatternOnBlur(/^PT\d{9}$/),
1651
+ mask: {
1652
+ mask: makeMask(...nonInputs("PT", { includeInValue: true }), spacer, ...numericInputs(9))
1653
+ },
1654
+ guidanceText: {
1655
+ key: "enterTheRemainingNDigitsForExample",
1656
+ values: {
1657
+ numDigits: "9",
1658
+ example: "PT123456789"
1659
+ }
1660
+ }
1661
+ },
1662
+ [CountryCodes.Romania]: {
1663
+ label: "codulDeIdentificareFiscala",
1664
+ validators: validatePatternOnBlur(/^RO\d{2,12}$/),
1665
+ mask: {
1666
+ mask: makeMask(
1667
+ ...nonInputs("RO", { includeInValue: true }),
1668
+ spacer,
1669
+ ...numericInputs(2),
1670
+ ...numericInputs(8, true)
1671
+ )
1672
+ },
1673
+ guidanceText: {
1674
+ key: "enterTheRemainingXToYDigitsForExample",
1675
+ values: {
1676
+ minDigits: "2",
1677
+ maxDigits: "10",
1678
+ example: "RO12345678"
1679
+ }
1680
+ }
1681
+ },
1682
+ [CountryCodes.Slovakia]: {
1683
+ label: "skTaxId",
1684
+ validators: validatePatternOnBlur(/^SK\d{10}$/),
1685
+ mask: {
1686
+ mask: makeMask(...nonInputs("SK", { includeInValue: true }), spacer, ...numericInputs(10))
1687
+ },
1688
+ guidanceText: {
1689
+ key: "enterTheRemainingNDigitsForExample",
1690
+ values: {
1691
+ numDigits: "10",
1692
+ example: "SK1234567890"
1693
+ }
1694
+ }
1695
+ },
1696
+ [CountryCodes.Slovenia]: {
1697
+ label: "siTaxId",
1698
+ validators: validatePatternOnBlur(/^SI\d{8}$/),
1699
+ mask: {
1700
+ mask: makeMask(...nonInputs("SI", { includeInValue: true }), spacer, ...numericInputs(8))
1701
+ },
1702
+ guidanceText: {
1703
+ key: "enterTheRemainingNDigitsForExample",
1704
+ values: {
1705
+ numDigits: "8",
1706
+ example: "SI12345678"
1707
+ }
1708
+ }
1709
+ },
1710
+ [CountryCodes.Spain]: {
1711
+ label: "NIFdeIVA",
1712
+ validators: validatePatternOnBlur(/^ES[A-Z0-9]\d{7}[A-Z0-9]$/),
1713
+ mask: {
1714
+ mask: makeMask(
1715
+ ...nonInputs("ES", { includeInValue: true }),
1716
+ spacer,
1717
+ ...alphanumericInputs(9)
1718
+ ),
1719
+ transformOnType: uppercase
1720
+ },
1721
+ guidanceText: {
1722
+ key: "enterTheRemainingNCharactersForExample",
1723
+ values: {
1724
+ numChars: "9",
1725
+ example: "ES12345678X"
1726
+ }
1727
+ }
1728
+ },
1729
+ [CountryCodes.Sweden]: {
1730
+ label: "vatNummerMomsregistreringsnummerOrMomsnummer",
1731
+ validators: validatePatternOnBlur(/^SE\d{12}$/),
1732
+ mask: {
1733
+ mask: makeMask(...nonInputs("SE", { includeInValue: true }), spacer, ...numericInputs(12))
1734
+ },
1735
+ guidanceText: {
1736
+ key: "enterTheRemainingNDigitsForExample",
1737
+ values: {
1738
+ numDigits: "12",
1739
+ example: "SE123456789001"
1740
+ }
1741
+ }
1742
+ },
1743
+ [CountryCodes.Switzerland]: {
1744
+ label: "Mehrwertsteuernummer",
1745
+ // CHE123456789TVA | CHE....MWST | CHE.......IVA
1746
+ validators: validatePatternOnBlur(/^CHE\d{9}(TVA|MWST|IVA)$/),
1747
+ mask: {
1748
+ mask: makeMask(
1749
+ ...nonInputs("CHE", { includeInValue: true }),
1750
+ ...nonInputs(" - "),
1751
+ ...numericInputs(3),
1752
+ ...nonInputs(" . "),
1753
+ ...numericInputs(3),
1754
+ ...nonInputs(" . "),
1755
+ ...numericInputs(3),
1756
+ spacer,
1757
+ ...alphaInputs(3),
1758
+ ...alphaInputs(1, true)
1759
+ ),
1760
+ transformOnType: uppercase
1761
+ },
1762
+ guidanceText: {
1763
+ key: "enterTheRemainingNDigitsThenXToYLettersForExample",
1764
+ values: {
1765
+ numDigits: "9",
1766
+ minLetters: "3",
1767
+ maxLetters: "4",
1768
+ example: "CHE-123.456.789 TVA"
1769
+ }
1770
+ }
1771
+ },
1772
+ [CountryCodes.UnitedArabEmirates]: {
1773
+ label: "vatRegistrationNumber",
1774
+ validators: validateNotEmptyOnBlur
1775
+ },
1776
+ [CountryCodes.UnitedKingdom]: {
1777
+ label: "vatRegistrationNumber",
1778
+ validators: validatePatternOnBlur(/^GB\d{9,12}$/),
1779
+ mask: {
1780
+ mask: makeMask(
1781
+ ...nonInputs("GB", { includeInValue: true }),
1782
+ spacer,
1783
+ ...numericInputs(9),
1784
+ ...numericInputs(3, true)
1785
+ )
1786
+ },
1787
+ guidanceText: {
1788
+ key: "enterTheRemainingXToYDigitsForExample",
1789
+ values: {
1790
+ minDigits: "9",
1791
+ maxDigits: "12",
1792
+ example: "GB1234567890"
1793
+ }
1794
+ }
1795
+ },
1796
+ /**
1797
+ * NOT YET SUPPORTED
1798
+ * These are brought over from the old pattern files. We have no idea if they are accurate or not.
1799
+ * See https://en.wikipedia.org/wiki/VAT_identification_number
1800
+ */
1801
+ [CountryCodes.Albania]: {
1802
+ validators: validatePatternOnBlur(/^[JKLM][A-Z0-9]{8}[A-Z]$/)
1803
+ },
1804
+ [CountryCodes.Belarus]: {
1805
+ validators: validatePatternOnBlur(/^\d{9}$/)
1806
+ },
1807
+ [CountryCodes.RussianFederation]: {
1808
+ validators: validatePatternOnBlur(/^(\d{10}|\d{12})$/)
1809
+ },
1810
+ [CountryCodes.SanMarino]: {
1811
+ validators: validatePatternOnBlur(/^\d{5}$/)
1812
+ },
1813
+ [CountryCodes.Serbia]: {
1814
+ validators: validatePatternOnBlur(/^\d{9}$/)
1815
+ },
1816
+ [CountryCodes.Turkey]: {
1817
+ validators: validatePatternOnBlur(/^\d{10}$/)
1818
+ },
1819
+ [CountryCodes.Ukraine]: {
1820
+ validators: validatePatternOnBlur(/^\d{12}$/)
1821
+ },
1822
+ [CountryCodes.Argentina]: {
1823
+ validators: validatePatternOnBlur(/^\d{11}$/)
1824
+ },
1825
+ [CountryCodes.Chile]: {
1826
+ validators: validatePatternOnBlur(/^\d{9}$/)
1827
+ },
1828
+ [CountryCodes.Colombia]: {
1829
+ validators: validatePatternOnBlur(/^\d{10}$/)
1830
+ },
1831
+ [CountryCodes.CostaRica]: {
1832
+ validators: validatePatternOnBlur(/^\d{9,12}$/)
1833
+ },
1834
+ [CountryCodes.Ecuador]: {
1835
+ validators: validatePatternOnBlur(/^\d{13}$/)
1836
+ },
1837
+ [CountryCodes.Guatemala]: {
1838
+ validators: validatePatternOnBlur(/^\d{8}$/)
1839
+ },
1840
+ [CountryCodes.Peru]: {
1841
+ validators: validatePatternOnBlur(/^\d{11}$/)
1842
+ },
1843
+ [CountryCodes.Venezuela]: {
1844
+ validators: validatePatternOnBlur(/^[JGVE]-\d{8}-?\d$/)
1845
+ }
1846
+ };
1847
+ const inferVatNumberType = (vatNumber, country) => {
1848
+ const optionsForCountry = vatNumberOptions[country];
1849
+ const metadataFn = defaultFieldConfig[country];
1850
+ if (!optionsForCountry || !metadataFn) return void 0;
1851
+ for (const option of optionsForCountry) {
1852
+ const fieldMetadata = typeof metadataFn === "function" ? metadataFn({
1853
+ vatNumberType: option.id
1854
+ }) : metadataFn;
1855
+ if (!fieldMetadata.validators) continue;
1856
+ const validators = Array.isArray(fieldMetadata.validators) ? fieldMetadata.validators : [fieldMetadata.validators];
1857
+ if (validators.every((validator) => validator.validate(vatNumber))) {
1858
+ return option.id;
1859
+ }
1860
+ }
1861
+ };
1862
+ function getDefaultVatNumberType(vatNumber, country) {
1863
+ return vatNumber ? inferVatNumberType(vatNumber, country) : vatNumberOptions[country]?.[0]?.id;
1864
+ }
1865
+ function VatNumberTypeSelector({
1866
+ country,
1867
+ companyType,
1868
+ selected,
1869
+ setSelected,
1870
+ exemptedOption
1871
+ }) {
1872
+ const { t } = useTranslation("common");
1873
+ const handleSelect = useCallback(
1874
+ (selectedStr) => {
1875
+ const newSelected = selectedStr;
1876
+ if (newSelected === "exempted") {
1877
+ if (exemptedOption) {
1878
+ setSelected(newSelected, true);
1879
+ }
1880
+ return;
1881
+ }
1882
+ setSelected(newSelected, false);
1883
+ },
1884
+ [exemptedOption, setSelected]
1885
+ );
1886
+ const options = useMemo(() => {
1887
+ const availableOptions = getVatNumberOptions(country, companyType) ?? [];
1888
+ if (availableOptions.length === 0 || !exemptedOption) return availableOptions;
1889
+ return [
1890
+ ...availableOptions,
1891
+ {
1892
+ id: "exempted",
1893
+ name: exemptedOption
1894
+ }
1895
+ ];
1896
+ }, [country, companyType, exemptedOption]);
1897
+ useEffect(() => {
1898
+ if (!selected && options.length > 0) {
1899
+ handleSelect(options[0].id);
1900
+ }
1901
+ }, [options, selected, handleSelect]);
1902
+ if (options.length <= 1) return null;
1903
+ return /* @__PURE__ */ jsx(
1904
+ Field,
1905
+ {
1906
+ el: "fieldset",
1907
+ name: "vatNumberType",
1908
+ label: t(($) => $["whichTypeOfTaxIdNumberDoYouHave"]),
1909
+ children: (childProps) => /* @__PURE__ */ jsx(
1910
+ RadioGroup,
1911
+ {
1912
+ ...childProps,
1913
+ name: "vatNumberType",
1914
+ items: options,
1915
+ value: selected,
1916
+ onChange: handleSelect
1917
+ }
1918
+ )
1919
+ }
1920
+ );
1921
+ }
1922
+ const VAT_NUMBER_FIELD = [
1923
+ "vatNumber",
1924
+ "vatNumberType",
1925
+ "exemptedFromVat",
1926
+ "vatAbsenceReason"
1927
+ ];
1928
+ function VatNumberField({
1929
+ data,
1930
+ valid,
1931
+ errors,
1932
+ labels,
1933
+ mask,
1934
+ guidanceText,
1935
+ placeholders,
1936
+ readonly,
1937
+ optional,
1938
+ shouldValidate,
1939
+ handleChangeFor,
1940
+ canExempt,
1941
+ country
1942
+ }) {
1943
+ const { isExperimentEnabled } = useExperimentsContext();
1944
+ const options = vatNumberOptions[country];
1945
+ const defaultType = getDefaultVatNumberType(data.vatNumber, country);
1946
+ const vatAbsenceReasons = isExperimentEnabled("ShowExtraTaxExemptionReasons") ? ["belowTaxThreshold", "industryExemption", "countryWithoutVatOrGstSystem"] : ["belowTaxThreshold", "industryExemption"];
1947
+ const showVatExemptedOptions = canExempt && options?.length > 1;
1948
+ const vatNumberType = data.exemptedFromVat ? "exempted" : data.vatNumberType ? data.vatNumberType : defaultType;
1949
+ const handleVatNumberChange = (e, mode) => {
1950
+ const value = typeof e === "string" ? e : e.currentTarget.value;
1951
+ handleChangeFor("vatNumber", mode)(value);
1952
+ handleChangeFor("vatNumberType")(vatNumberType);
1953
+ };
1954
+ const handleVatNumberTypeChange = (vatType, exemptValue) => {
1955
+ if (vatType === "exempted") {
1956
+ if (!canExempt) {
1957
+ throw Error(`${country} does not allow VAT exemptions`);
1958
+ }
1959
+ handleChangeFor("vatNumber")(null);
1960
+ handleChangeFor("vatNumberType")(void 0);
1961
+ handleChangeFor("exemptedFromVat")(exemptValue);
1962
+ return;
1963
+ }
1964
+ if (canExempt) {
1965
+ handleChangeFor("exemptedFromVat")(exemptValue);
1966
+ }
1967
+ handleChangeFor("vatNumberType")(vatType);
1968
+ };
1969
+ if (vatNumberType && vatNumberType !== "exempted") {
1970
+ const countryHasType = options?.find((option) => option.id === vatNumberType);
1971
+ if (!countryHasType) {
1972
+ handleChangeFor("vatNumberType")(defaultType);
1973
+ }
1974
+ }
1975
+ if (data.exemptedFromVat === false && data.vatAbsenceReason) {
1976
+ handleChangeFor("vatAbsenceReason")(null);
1977
+ }
1978
+ return /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-field__vat-number", children: [
1979
+ /* @__PURE__ */ jsx(
1980
+ VatNumberTypeSelector,
1981
+ {
1982
+ country,
1983
+ setSelected: handleVatNumberTypeChange,
1984
+ selected: vatNumberType,
1985
+ exemptedOption: showVatExemptedOptions ? labels.exemptedFromVat : false
1986
+ }
1987
+ ),
1988
+ /* @__PURE__ */ jsx(
1989
+ MaskedInput,
1990
+ {
1991
+ type: "text",
1992
+ "aria-required": true,
1993
+ "aria-invalid": !valid.vatNumber,
1994
+ name: "vatNumber",
1995
+ value: data?.vatNumber ?? "",
1996
+ label: labels.vatNumber ?? "",
1997
+ formatGuidance: guidanceText?.vatNumber ?? "",
1998
+ placeholder: placeholders?.vatNumber,
1999
+ errorMessage: errors.vatNumber,
2000
+ isValid: Boolean(valid.vatNumber),
2001
+ onInput: (e) => handleVatNumberChange(e, "input"),
2002
+ onBlur: (e) => handleVatNumberChange(e, "blur"),
2003
+ disabled: data.exemptedFromVat,
2004
+ readonly,
2005
+ optional,
2006
+ shouldValidate,
2007
+ ...mask
2008
+ }
2009
+ ),
2010
+ canExempt && !showVatExemptedOptions && /* @__PURE__ */ jsx(Field, { name: "exemptedFromVat", children: (childProps) => /* @__PURE__ */ jsx(
2011
+ Checkbox,
2012
+ {
2013
+ ...childProps,
2014
+ "aria-required": false,
2015
+ "aria-invalid": false,
2016
+ name: "exemptedFromVat",
2017
+ label: labels?.exemptedFromVat,
2018
+ value: "exemptedFromVat",
2019
+ checked: Boolean(data.exemptedFromVat),
2020
+ onChange: (e) => handleVatNumberTypeChange("exempted", e)
2021
+ }
2022
+ ) }),
2023
+ data.exemptedFromVat && /* @__PURE__ */ jsx(
2024
+ Field,
2025
+ {
2026
+ el: "fieldset",
2027
+ name: "vatAbsenceReason",
2028
+ label: labels?.vatAbsenceReason,
2029
+ errorMessage: errors.vatAbsenceReason,
2030
+ isValid: valid.vatAbsenceReason,
2031
+ children: (childProps) => /* @__PURE__ */ jsx(
2032
+ RadioGroup,
2033
+ {
2034
+ ...childProps,
2035
+ name: "vatAbsenceReason",
2036
+ onChange: handleChangeFor("vatAbsenceReason"),
2037
+ value: data.vatAbsenceReason,
2038
+ items: vatAbsenceReasons.map((reason) => ({ id: reason, name: reason }))
2039
+ }
2040
+ )
2041
+ }
2042
+ )
2043
+ ] });
2044
+ }
2045
+ const registrationAddressValidationRules = {
2046
+ operationalAddressIsSame: {
2047
+ modes: ["blur"],
2048
+ validate: (operationalAddressIsSame) => !!operationalAddressIsSame,
2049
+ errorMessage: "fieldIsRequired"
2050
+ }
2051
+ };
2052
+ const registrationAddressFields = [
2053
+ "registrationAddress",
2054
+ "operationalAddress",
2055
+ "operationalAddressIsSame"
2056
+ ];
2057
+ const registrationAddressForms = {
2058
+ registrationAddress: {
2059
+ formId: "registrationAddress"
2060
+ },
2061
+ operationalAddress: {
2062
+ formId: "operationalAddress"
2063
+ }
2064
+ };
2065
+ const registrationAddressFormID = registrationAddressForms.registrationAddress.formId;
2066
+ const operationalAddressFormID = registrationAddressForms.operationalAddress.formId;
2067
+ function RegistrationAddress(props) {
2068
+ const { t } = useTranslation("common");
2069
+ const { id, heading, description, country, data, validators, problems } = props;
2070
+ const {
2071
+ requiredFields: registrationAddressRequiredFields,
2072
+ optionalFields: registrationAddressOptionalFields,
2073
+ readOnlyFields: registrationAddressReadOnlyFields,
2074
+ obscuredFields: registrationAddressObscuredFields,
2075
+ verifyFields: registrationAddressVerifyFields,
2076
+ trustedFields: registrationAddressTrustedFields
2077
+ } = getFormProps(props, registrationAddressFormID);
2078
+ const {
2079
+ data: formData,
2080
+ valid: formValid,
2081
+ errors: formErrors,
2082
+ fieldProblems: formFieldProblems,
2083
+ handleChangeFor,
2084
+ setValid
2085
+ } = useForm({
2086
+ ...props,
2087
+ schema: ["operationalAddressIsSame"],
2088
+ defaultData: data,
2089
+ rules: validators || registrationAddressValidationRules,
2090
+ obscuredFields: [],
2091
+ optionalFields: registrationAddressOptionalFields,
2092
+ trustedFields: registrationAddressTrustedFields
2093
+ });
2094
+ const mergedProps = {
2095
+ ...props,
2096
+ requiredFields: registrationAddressRequiredFields,
2097
+ optionalFields: registrationAddressOptionalFields,
2098
+ readOnlyFields: registrationAddressReadOnlyFields,
2099
+ obscuredFields: registrationAddressObscuredFields,
2100
+ trustedFields: registrationAddressTrustedFields
2101
+ };
2102
+ const formUtils = createFormUtils(mergedProps, t);
2103
+ const stateRef = useRef({ setState: null });
2104
+ useEffect(() => {
2105
+ stateRef?.current?.setState?.({
2106
+ type: "addToState",
2107
+ value: {
2108
+ data: formData,
2109
+ valid: formValid,
2110
+ errors: formErrors,
2111
+ fieldProblems: formFieldProblems,
2112
+ dataStoreId: id,
2113
+ schema: [
2114
+ "registrationAddress",
2115
+ "operationalAddressIsSame",
2116
+ ...isOperationAddressNotSame() ? ["operationalAddress"] : []
2117
+ ]
2118
+ }
2119
+ });
2120
+ }, [formData, formValid, formErrors, formFieldProblems]);
2121
+ const isOperationAddressNotSame = () => formData.operationalAddressIsSame === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME;
2122
+ const registrationAddressFormProps = getFormProps(props, registrationAddressFormID);
2123
+ const operationalAddressFormProps = getFormProps(props, operationalAddressFormID);
2124
+ const handleRegistrationAddressChange = (state) => {
2125
+ handleChangeFor("registrationAddress")(state.data);
2126
+ setValid("registrationAddress", Boolean(state.isValid));
2127
+ };
2128
+ const handleOperationalAddressChange = (state) => {
2129
+ handleChangeFor("operationalAddress")(state.data);
2130
+ setValid("operationalAddress", Boolean(state.isValid));
2131
+ };
2132
+ const handleOperationalAddressIsSameChange = (value) => {
2133
+ handleChangeFor("operationalAddressIsSame")(value);
2134
+ if (value === "OperationAddressAnswerYes") setValid("operationalAddress", true);
2135
+ };
2136
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
2137
+ /* @__PURE__ */ jsx(StateContextSetter, { owner: id, stateRef }),
2138
+ heading && /* @__PURE__ */ jsx(Header, { title: heading, description }),
2139
+ /* @__PURE__ */ jsx(
2140
+ ErrorPanel,
2141
+ {
2142
+ verificationErrors: id ? problems?.verificationErrors?.[id] : void 0,
2143
+ validationErrors: id ? problems?.validationErrors?.[id] : void 0,
2144
+ formUtils,
2145
+ id: "ariaErrorField"
2146
+ }
2147
+ ),
2148
+ /* @__PURE__ */ jsx(
2149
+ ContextGuidance,
2150
+ {
2151
+ titleId: "whyDoINeedToFillInThisInformation",
2152
+ contentId: "reasonForFillingCompanyAddressDetails",
2153
+ title: t(($) => $["whyDoINeedToFillInThisInformation"]),
2154
+ content: t(($) => $["reasonForFillingCompanyAddressDetails"])
2155
+ }
2156
+ ),
2157
+ /* @__PURE__ */ jsx(
2158
+ Address,
2159
+ {
2160
+ ...registrationAddressFormProps,
2161
+ data: { ...registrationAddressFormProps?.data, country },
2162
+ hideCountry: true,
2163
+ id,
2164
+ addressType: "registrationAddress",
2165
+ optionalFields: ["otherAddressInformation"],
2166
+ onChange: handleRegistrationAddressChange
2167
+ }
2168
+ ),
2169
+ /* @__PURE__ */ jsx(Header, { title: t(($) => $["operationalAddressHeader"]), secondary: true }),
2170
+ /* @__PURE__ */ jsx(
2171
+ Field,
2172
+ {
2173
+ el: "fieldset",
2174
+ name: "operationalAddressIsSame",
2175
+ label: formUtils.getLabel("operationalAddressIsSame"),
2176
+ errorMessage: formErrors.operationalAddressIsSame?.errorMessage,
2177
+ children: (childProps) => /* @__PURE__ */ jsx(
2178
+ RadioGroup,
2179
+ {
2180
+ ...childProps,
2181
+ name: "operationalAddressIsSame",
2182
+ items: operationalAddressIsSameItems,
2183
+ value: formData.operationalAddressIsSame,
2184
+ disabled: formUtils.isReadOnly("operationalAddressIsSame"),
2185
+ onChange: handleOperationalAddressIsSameChange,
2186
+ "aria-required": true,
2187
+ "aria-invalid": !formValid.operationalAddressIsSame
2188
+ }
2189
+ )
2190
+ }
2191
+ ),
2192
+ isOperationAddressNotSame() && /* @__PURE__ */ createElement(
2193
+ Address,
2194
+ {
2195
+ ...operationalAddressFormProps,
2196
+ key: "operationalAddress",
2197
+ data: { ...operationalAddressFormProps?.data, country },
2198
+ hideCountry: true,
2199
+ id,
2200
+ optionalFields: ["otherAddressInformation"],
2201
+ addressType: "operationalAddress",
2202
+ onChange: handleOperationalAddressChange
2203
+ }
2204
+ )
2205
+ ] });
2206
+ }
2207
+ const ConstitutionalDocumentTypes = {
2208
+ BUSINESS_NAME_FILING: "doingBusinessAsNameFiling",
2209
+ TAX_FILING: "taxFiling",
2210
+ EMPLOYER_IDENTIFICATION_NUMBER_VERIFICATION_LETTER: "einVerificationLetter",
2211
+ BUSINESS_REGISTRATION_DOCUMENT: "businessRegistrationDocument",
2212
+ TRUST_DEED: "trustDeed",
2213
+ TRUST_INSTRUMENT: "trustInstrument",
2214
+ PARTNERSHIP_AGREEMENT: "partnershipAgreement",
2215
+ MEETING_MINUTES: "meetingMinutes"
2216
+ };
2217
+ const getConstitutionDocumentTypeOptionsMapping = (legalEntityType, country) => {
2218
+ switch (legalEntityType) {
2219
+ case LegalEntityTypes.SOLE_PROPRIETORSHIP:
2220
+ switch (country) {
2221
+ case "FR":
2222
+ return [
2223
+ {
2224
+ id: ConstitutionalDocumentTypes.BUSINESS_NAME_FILING,
2225
+ name: "doingBusinessAsNameFiling__FR"
2226
+ },
2227
+ { id: ConstitutionalDocumentTypes.TAX_FILING, name: "taxFiling" },
2228
+ {
2229
+ id: ConstitutionalDocumentTypes.BUSINESS_REGISTRATION_DOCUMENT,
2230
+ name: "businessRegistrationDocument__FR"
2231
+ }
2232
+ ];
2233
+ case "US":
2234
+ return [
2235
+ {
2236
+ id: ConstitutionalDocumentTypes.BUSINESS_NAME_FILING,
2237
+ name: "doingBusinessAsNameFiling__US"
2238
+ },
2239
+ { id: ConstitutionalDocumentTypes.TAX_FILING, name: "taxFiling__US" },
2240
+ {
2241
+ id: ConstitutionalDocumentTypes.EMPLOYER_IDENTIFICATION_NUMBER_VERIFICATION_LETTER,
2242
+ name: "einVerificationLetter"
2243
+ }
2244
+ ];
2245
+ default:
2246
+ return [
2247
+ {
2248
+ id: ConstitutionalDocumentTypes.BUSINESS_NAME_FILING,
2249
+ name: "doingBusinessAsNameFiling"
2250
+ },
2251
+ { id: ConstitutionalDocumentTypes.TAX_FILING, name: "taxFiling" }
2252
+ ];
2253
+ }
2254
+ case LegalEntityTypes.UNINCORPORATED_PARTNERSHIP:
2255
+ return [
2256
+ {
2257
+ id: ConstitutionalDocumentTypes.PARTNERSHIP_AGREEMENT,
2258
+ name: "partnershipAgreement"
2259
+ },
2260
+ {
2261
+ id: ConstitutionalDocumentTypes.MEETING_MINUTES,
2262
+ name: "meetingMinutes"
2263
+ }
2264
+ ];
2265
+ default:
2266
+ return [
2267
+ { id: ConstitutionalDocumentTypes.TRUST_DEED, name: "trustDeed" },
2268
+ { id: ConstitutionalDocumentTypes.TRUST_INSTRUMENT, name: "trustInstrument" }
2269
+ ];
2270
+ }
2271
+ };
2272
+ function getLegalEntityTypeBasedConstitutionalDocumentHeaderDescriptionTranslationkey(legalEntityType) {
2273
+ switch (legalEntityType) {
2274
+ case LegalEntityTypes.SOLE_PROPRIETORSHIP:
2275
+ return "constitutionalDocumentSoleProprietorshipHeaderDescription";
2276
+ case LegalEntityTypes.TRUST:
2277
+ return "constitutionalDocumentTrustHeaderDescription";
2278
+ case LegalEntityTypes.UNINCORPORATED_PARTNERSHIP:
2279
+ return "constitutionalDocumentUnincorporatedPartnershipDescription";
2280
+ default:
2281
+ return "constitutionalDocumentHeaderDescription";
2282
+ }
2283
+ }
2284
+ const unincorporatedPartnershipRequirementsVariants = ["Name", "Details", "UpToDate"];
2285
+ function ConstitutionalDocumentUpload({
2286
+ id,
2287
+ legalEntityType,
2288
+ ...props
2289
+ }) {
2290
+ const { t } = useTranslation(["common"]);
2291
+ const isUnincorporatedPartnership = legalEntityType === LegalEntityTypes.UNINCORPORATED_PARTNERSHIP;
2292
+ const constitutionalDocumentRequirements = getConstitutionDocumentTypeOptionsMapping(
2293
+ legalEntityType,
2294
+ props.country
2295
+ );
2296
+ const guidanceContent = /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-upload-field__guidance adyen-kyc-u-margin-bottom-24", children: [
2297
+ /* @__PURE__ */ jsx("strong", { children: t(($) => $["uploadOneOfTheseDocuments"]) }),
2298
+ /* @__PURE__ */ jsx("ul", { children: constitutionalDocumentRequirements?.map(({ name }, i) => /* @__PURE__ */ jsx("li", { children: t(($) => $[name]) }, i)) }),
2299
+ isUnincorporatedPartnership && /* @__PURE__ */ jsxs(Fragment, { children: [
2300
+ /* @__PURE__ */ jsx("strong", { children: t(($) => $["documentRequirements"]) }),
2301
+ /* @__PURE__ */ jsx("ul", { children: unincorporatedPartnershipRequirementsVariants.map((item, i) => /* @__PURE__ */ jsx("li", { children: t(
2302
+ ($) => $[`documentRequirementsUnincorporatedPartnership${item}`],
2303
+ { ns: "common" }
2304
+ ) }, i)) })
2305
+ ] }),
2306
+ props.country !== "US" && !isUnincorporatedPartnership && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-u-margin-y-16", children: /* @__PURE__ */ jsxs("span", { children: [
2307
+ t(($) => $["infoInUploadedDocumentIsTrue"]),
2308
+ " "
2309
+ ] }) })
2310
+ ] });
2311
+ return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
2312
+ MemoizedDocumentUpload,
2313
+ {
2314
+ ...props,
2315
+ documentType: "constitutionalDocument",
2316
+ documentField: "constitutionalDocument",
2317
+ heading: t(($) => $["constitutionalDocumentHeader"]),
2318
+ description: t(
2319
+ ($) => $[getLegalEntityTypeBasedConstitutionalDocumentHeaderDescriptionTranslationkey(
2320
+ legalEntityType
2321
+ )],
2322
+ { ns: "common" }
2323
+ ),
2324
+ guidanceContent,
2325
+ id,
2326
+ hidePageCount: true
2327
+ }
2328
+ ) });
2329
+ }
2330
+ const MemoizedConstitutionalDocument = memo(
2331
+ ConstitutionalDocumentUpload,
2332
+ (prevProps, nextProps) => objectsDeepEqual(prevProps.requiredFields, nextProps.requiredFields) && objectsDeepEqual(prevProps.data, nextProps.data) && objectsDeepEqual(prevProps.formVerificationErrors, nextProps.formVerificationErrors) && objectsDeepEqual(prevProps.fieldValidationErrors, nextProps.fieldValidationErrors) && prevProps.shouldValidate === nextProps.shouldValidate
2333
+ );
2334
+ export {
2335
+ BUSINESS_REGISTRATION_NUMBER_FIELD as B,
2336
+ DBA_NAME_FIELD as D,
2337
+ MemoizedConstitutionalDocument as M,
2338
+ RegistrationAddress as R,
2339
+ VAT_NUMBER_FIELD as V,
2340
+ defaultFieldConfig as a,
2341
+ registrationNumberDefaultFieldMetadata as b,
2342
+ registrationNumberDefaultFieldConfig as c,
2343
+ defaultFieldMetadata as d,
2344
+ doingBusinessAsFieldMetadata as e,
2345
+ doingBusinessAsAbsentFieldMetadata as f,
2346
+ DBANameField as g,
2347
+ BusinessRegistrationNumberField as h,
2348
+ VatNumberField as i,
2349
+ getDefaultRegistrationNumberType as j,
2350
+ getDefaultVatNumberType as k,
2351
+ inferCompanyRegistrationNumberType as l,
2352
+ exemptFromRegistrationNumberDefaultFieldMetadata as m,
2353
+ exemptFromRegistrationNumberDefaultFieldConfig as n,
2354
+ operationalAddressIsSameIds as o,
2355
+ operationalAddressIsSameItems as p,
2356
+ registrationAddressFields as r,
2357
+ vatAbsenceReasonMetadata as v
2358
+ };