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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (453) hide show
  1. package/dist/{AcceptTermsOfServiceComponent-Bjj3cdYk.js → AcceptTermsOfServiceComponent-Bp_pbi8W.js} +43 -15
  2. package/dist/{AccountSetupRejected-CSQTnRkO.js → AccountSetupRejected-DHaw05S_.js} +6 -4
  3. package/dist/Address-T_L756Fd.js +1076 -0
  4. package/dist/Alert-BZ-Nbp3n.js +231 -0
  5. package/dist/{Avatar-DL_WbHEO.js → Avatar-CZRMcyig.js} +2 -2
  6. package/dist/BusinessDetailsDropin-BCEl6ugY.js +5088 -0
  7. package/dist/BusinessFinancingComponent-C6_BGjEv.js +45 -0
  8. package/dist/{BusinessFinancingDropin-MrOVSlPu.js → BusinessFinancingDropin-Bu7y-kHJ.js} +51 -26
  9. package/dist/BusinessFinancingPage-D0NzYc0c.js +40 -0
  10. package/dist/{BusinessTypeSelectionPage-DJ5bfr8m.js → BusinessTypeSelectionPage-D7LnoZsb.js} +9 -5
  11. package/dist/Card-BEgeVmvV.js +145 -0
  12. package/dist/Confirm-CgkKXlLy.js +64 -0
  13. package/dist/{ContractViewer-z3KbE1Vf.js → ContractViewer-Byp71k2e.js} +34 -46
  14. package/dist/CountryField-DrVg4pbc.js +864 -0
  15. package/dist/CreateIndividualComponent-DiIekvBi.js +72 -0
  16. package/dist/CreateTransferInstrumentComponent-CntLlhRB.js +67 -0
  17. package/dist/Currency-DvQxk7WJ.js +238 -0
  18. package/dist/{CustomerSupport-CUPUElh7.js → CustomerSupport-BAdzjndM.js} +10 -6
  19. package/dist/{DebugModal-BC-xS3Y1.js → DebugModal-Dr3FKql6.js} +8 -5
  20. package/dist/DecisionMakerDetailsPage-DPlXbmD6.js +100 -0
  21. package/dist/{DecisionMakers-5m_hI3ko.js → DecisionMakers-Doo6HxK4.js} +247 -134
  22. package/dist/DetailViewLayout-Z9cuUp4X.js +65 -0
  23. package/dist/Dropzone-E3lXPgPY.js +218 -0
  24. package/dist/{EmbeddedStatus-8yA_zZvi.js → EmbeddedStatus-C17AoFjV.js} +4 -4
  25. package/dist/EndStateLayout-Bc-JoLaP.js +71 -0
  26. package/dist/{FormFlow-6j8qCSuK.js → FormFlow-Di-9Yq0J.js} +8 -2
  27. package/dist/FormNavigation-Ch8lpQQK.js +162 -0
  28. package/dist/{IndividualOnfidoDropin-B0G_nHXY.js → IndividualOnfidoDropin-CYTsxyiK.js} +3240 -258
  29. package/dist/InputDate-D1xYE8M2.js +43 -0
  30. package/dist/InputGroup-WBfGDV5F.js +32 -0
  31. package/dist/InputText-oE96xgGf.js +161 -0
  32. package/dist/{Introduction-aPZmTW68.js → Introduction-DgTGlm3M.js} +58 -4
  33. package/dist/LegalRepresentativeDetailsPage-MdE-WFrw.js +61 -0
  34. package/dist/Link-FLNV2uQx.js +35 -0
  35. package/dist/ManageIndividualComponent-Mu9yOtmo.js +47 -0
  36. package/dist/ManageTermsOfServiceComponent-DrIHTlGb.js +47 -0
  37. package/dist/{ManageTransferInstrumentComponent-Ds1QZxxR.js → ManageTransferInstrumentComponent-D7fZtGPd.js} +37 -42
  38. package/dist/MaskedInput-CP1lOY03.js +799 -0
  39. package/dist/MaybeModal-DebkHJrB.js +25 -0
  40. package/dist/Modal-DQZ4dMFr.js +136 -0
  41. package/dist/{OnboardingDropinComponent-DLvTQVTE.js → OnboardingDropinComponent-DpN0iLAh.js} +235 -90
  42. package/dist/PayoutDetailsDropin-oU6yHXFO.js +3694 -0
  43. package/dist/RadioGroup-C1kODuZr.js +143 -0
  44. package/dist/RegistrationAddress-bS2rqYF2.js +2334 -0
  45. package/dist/{Review-DEeOefPe.js → Review-BID_uj8P.js} +8 -4
  46. package/dist/{RootBusinessDetailsPage-B2VBJ6x2.js → RootBusinessDetailsPage-DSSqJDxv.js} +66 -44
  47. package/dist/RootIndividualDetailsPage-CqGLe5Fd.js +77 -0
  48. package/dist/SignPCIComponent-WJxyytsK.js +294 -0
  49. package/dist/{SingpassSelection--f8TDTJH.js → SingpassSelection-BkLexUYc.js} +19 -11
  50. package/dist/SoleProprietorshipPage-CQH-lT79.js +50 -0
  51. package/dist/{SourceOfFundsPage-avNGxkCP.js → SourceOfFundsPage-qO5AsbyN.js} +49 -32
  52. package/dist/Spacer-BK3jDget.js +18 -0
  53. package/dist/StepProgressIndicator-B6jW885Y.js +78 -0
  54. package/dist/StoreProvider-DOveEVCE.js +7072 -0
  55. package/dist/StructuredList-DaepaiVE.js +38 -0
  56. package/dist/{TaskItemStatus-DMPUHtWU.js → TaskItemStatus-gY3QqCXW.js} +4 -3
  57. package/dist/{TaskStatusIndicator-Bfc4X_jG.js → TaskStatusIndicator-DjKfmLWk.js} +3 -3
  58. package/dist/TaxInformationField-BjN-COCm.js +3062 -0
  59. package/dist/{TaxReportingDropin-B7FXPbLq.js → TaxReportingDropin-XLlkh9dR.js} +28 -17
  60. package/dist/{TileGroup-DUoq3Lh4.js → TileGroup-Bf_KPczL.js} +4 -2
  61. package/dist/{TrustDetailsPage-J4MShc8J.js → TrustDetailsPage-BLeUJoAV.js} +506 -19
  62. package/dist/TrustMemberCompanyPage-Bsm7gi_e.js +60 -0
  63. package/dist/TrustMemberIndividualPage-CzHIlZHD.js +66 -0
  64. package/dist/UnincorporatedPartnershipIndividualPage-DpJ-j3fn.js +66 -0
  65. package/dist/UnincorporatedPartnershipMemberCompanyPage-2Wgz_aQr.js +64 -0
  66. package/dist/{ViewVerificationStatusComponent-ZtYIqtnO.js → ViewVerificationStatusComponent-B15vbIws.js} +4 -3
  67. package/dist/adyen-business-financing.js +33 -22
  68. package/dist/adyen-individual-configuration.js +59 -0
  69. package/dist/adyen-individual-status.js +47 -0
  70. package/dist/adyen-kyc-components.js +28 -15
  71. package/dist/adyen-onboarding.js +3 -3
  72. package/dist/adyen-terms-of-service-management.js +63 -0
  73. package/dist/adyen-terms-of-service-status.js +47 -0
  74. package/dist/adyen-transfer-instrument-configuration.js +73 -0
  75. package/dist/adyen-transfer-instrument-management.js +61 -0
  76. package/dist/adyen-verification-status.js +44 -36
  77. package/dist/analytics-2hGA-cx1.js +61 -0
  78. package/dist/{LandingLayout-Xi3iuRMx.js → bafinUtils-CVA17xYo.js} +218 -8
  79. package/dist/basePatterns-BwdnMQxI.js +15 -0
  80. package/dist/bg-BG-B0-ZcjR0.js +22 -0
  81. package/dist/{bg-BG-BiYtb1Tz.js → bg-BG-BYkC3yKf.js} +4 -1
  82. package/dist/bg-BG-CW9c658c.js +13 -0
  83. package/dist/bg-BG-CZ8v3rdy.js +30 -0
  84. package/dist/{bg-BG-Dy6-IwuZ.js → bg-BG-D5192UVe.js} +9 -2
  85. package/dist/{bg-BG-NMIts2sa.js → bg-BG-QC5irNEG.js} +2 -4
  86. package/dist/commonValidators-DCM5UhH6.js +24 -0
  87. package/dist/{cs-CZ-Dbow28-o.js → cs-CZ-DOqH0WeT.js} +9 -2
  88. package/dist/cs-CZ-Dk1ePReM.js +22 -0
  89. package/dist/cs-CZ-Dx6momCa.js +30 -0
  90. package/dist/cs-CZ-dU9fnQ1g.js +13 -0
  91. package/dist/{cs-CZ-Csr_35T-.js → cs-CZ-t297LwYw.js} +2 -4
  92. package/dist/{cs-CZ-wdftovLe.js → cs-CZ-zTkICtXj.js} +4 -1
  93. package/dist/currency-BGwQyxBo.js +36 -0
  94. package/dist/{da-DK-Adj8R5Qn.js → da-DK-B45X2VaJ.js} +9 -2
  95. package/dist/da-DK-BJ7aTPir.js +13 -0
  96. package/dist/{da-DK-Dm8o1giq.js → da-DK-BoQic3Gy.js} +2 -4
  97. package/dist/{da-DK-4QAKic_C.js → da-DK-D0N1TVVU.js} +4 -1
  98. package/dist/da-DK-D4H69PX3.js +30 -0
  99. package/dist/da-DK-DStNe471.js +22 -0
  100. package/dist/de-DE-C78RLE2G.js +13 -0
  101. package/dist/de-DE-CGoBPCPv.js +22 -0
  102. package/dist/{de-DE-BG0tKqvi.js → de-DE-CWvgMDqU.js} +9 -2
  103. package/dist/{de-DE-BzumFI3T.js → de-DE-Dtuu-nE7.js} +4 -1
  104. package/dist/{de-DE-DMFaycio.js → de-DE-Dwagawx1.js} +2 -4
  105. package/dist/de-DE-wp5-H-ov.js +30 -0
  106. package/dist/{digital-wallet-with-local-currencies-POeLD54e.js → digital-wallet-D_IpxnkN.js} +3 -3
  107. package/dist/dropinUtils-1GeCqEl1.js +192 -0
  108. package/dist/el-GR-B69zcWyB.js +22 -0
  109. package/dist/el-GR-BZRKurtr.js +13 -0
  110. package/dist/{el-GR-DerT143K.js → el-GR-C3rkK_oc.js} +9 -2
  111. package/dist/el-GR-CK2heqPJ.js +30 -0
  112. package/dist/{el-GR-CGeBAkDN.js → el-GR-CxwhV-TX.js} +2 -4
  113. package/dist/{el-GR-CXmTklMq.js → el-GR-DaO38A1s.js} +4 -1
  114. package/dist/emitEvent-CzZf80Am.js +28 -0
  115. package/dist/{en-US-DLm6gy6T.js → en-US-546hB2Wn.js} +3 -1
  116. package/dist/{en-US-CkZcSKGh.js → en-US-BbAzROHT.js} +5 -4
  117. package/dist/en-US-CAm3meB1.js +30 -0
  118. package/dist/{en-US-SbE0c1gn.js → en-US-DIdQJky-.js} +1 -2
  119. package/dist/en-US.instructions-Ddr7AO05.js +22 -0
  120. package/dist/{es-ES-BhQOdKge.js → es-ES-BsQpwaPN.js} +4 -1
  121. package/dist/{es-ES-pXHx3ODy.js → es-ES-Bsoco8Fj.js} +2 -4
  122. package/dist/es-ES-BtUSEzkE.js +13 -0
  123. package/dist/es-ES-CKMfS8Yy.js +22 -0
  124. package/dist/{es-ES-BM4U0hT3.js → es-ES-DKCCgVF8.js} +9 -2
  125. package/dist/es-ES-Ds3-DtqZ.js +30 -0
  126. package/dist/et-EE-BCnK305R.js +13 -0
  127. package/dist/{et-EE-OJg_PSHf.js → et-EE-Bc6ioJRG.js} +9 -2
  128. package/dist/et-EE-Co-8akjV.js +30 -0
  129. package/dist/{et-EE-CFlzRBEx.js → et-EE-DF_GqBgK.js} +4 -1
  130. package/dist/{et-EE-QLVnr6Vl.js → et-EE-DdGlUpaQ.js} +2 -4
  131. package/dist/et-EE-Dw-aPF7J.js +22 -0
  132. package/dist/{fi-FI-Djollt2G.js → fi-FI-BJ9RzrL3.js} +4 -1
  133. package/dist/{fi-FI-DT351N-G.js → fi-FI-ClnsYt3L.js} +2 -4
  134. package/dist/fi-FI-Cvar63RH.js +13 -0
  135. package/dist/fi-FI-DPNeTsJS.js +30 -0
  136. package/dist/{fi-FI-BJ2l42Pj.js → fi-FI-Hhku9Lmc.js} +9 -2
  137. package/dist/fi-FI-REYOX46I.js +22 -0
  138. package/dist/fieldConfigurations-DPY7jB8k.js +458 -0
  139. package/dist/form-rules-DhbF2mY4.js +13 -0
  140. package/dist/fr-FR-B5543Fe-.js +13 -0
  141. package/dist/{fr-FR-g7lmxEsI.js → fr-FR-BYuKsZIb.js} +9 -2
  142. package/dist/{fr-FR-BNXXNUX_.js → fr-FR-CJI0bIig.js} +2 -4
  143. package/dist/{fr-FR-l36qBV3a.js → fr-FR-CNR5-s9g.js} +4 -1
  144. package/dist/fr-FR-ChmNQciP.js +30 -0
  145. package/dist/fr-FR-D9qaP6nx.js +22 -0
  146. package/dist/getName-CGZCNwuc.js +41 -0
  147. package/dist/{hasDataChanged-CTE9vdfO.js → hasDataChanged-Of2J5c2Y.js} +2 -2
  148. package/dist/{hr-HR-B8AZ4eHJ.js → hr-HR-C0yWizOX.js} +2 -4
  149. package/dist/{hr-HR-CDUE36Dg.js → hr-HR-CPO5Yw2B.js} +9 -2
  150. package/dist/hr-HR-CbxEvbrE.js +22 -0
  151. package/dist/{hr-HR-DTCY4iL8.js → hr-HR-CjA4MWAU.js} +4 -1
  152. package/dist/hr-HR-DqC8Cgs6.js +30 -0
  153. package/dist/hr-HR-ZreFlbK9.js +13 -0
  154. package/dist/hu-HU-B3BihdGh.js +13 -0
  155. package/dist/hu-HU-BOanVlKb.js +30 -0
  156. package/dist/hu-HU-D0C6UfXB.js +22 -0
  157. package/dist/{hu-HU-BznXPoc2.js → hu-HU-NhwFr6o-.js} +4 -1
  158. package/dist/{hu-HU-Bmf13NMf.js → hu-HU-mo_0ULJG.js} +9 -2
  159. package/dist/{hu-HU-DRi6Dz9U.js → hu-HU-wnSie9tz.js} +2 -4
  160. package/dist/iframeWidget-DQYem3Qa.js +234 -0
  161. package/dist/{payout-verification-instant-BIcnFP-p.js → instant-verification-Dvvkyfmp.js} +3 -3
  162. package/dist/isEmpty-DBj6NFoa.js +23 -0
  163. package/dist/{it-IT-BEWyAQUU.js → it-IT-BV9K87FK.js} +4 -1
  164. package/dist/{it-IT-BeYbInCQ.js → it-IT-BeC2Y1F8.js} +2 -4
  165. package/dist/it-IT-Biduphjt.js +22 -0
  166. package/dist/it-IT-Dd6xGSe-.js +13 -0
  167. package/dist/{it-IT-DYIx7myn.js → it-IT-Nl57jui-.js} +9 -2
  168. package/dist/it-IT-eCrTB65E.js +30 -0
  169. package/dist/ja-JP-B2txEVPx.js +22 -0
  170. package/dist/ja-JP-BJljbFIZ.js +30 -0
  171. package/dist/{ja-JP-BhS-_dIx.js → ja-JP-CbgaW99b.js} +2 -2
  172. package/dist/{ja-JP-tx1DbZYD.js → ja-JP-D3oQAH7z.js} +10 -3
  173. package/dist/{ja-JP-D7oL6xGY.js → ja-JP-DXcP0ojZ.js} +13 -10
  174. package/dist/{ja-JP-C1OQ16fo.js → ja-JP-YoU7mNrK.js} +2 -4
  175. package/dist/ja-JP-iTbqSPNL.js +13 -0
  176. package/dist/keys-BpNgnAsD.js +23 -0
  177. package/dist/{localizeDateString-DaAGYSWR.js → localizeDateString-BxmEwC2K.js} +2 -2
  178. package/dist/{lt-LT-BxScCodJ.js → lt-LT-CVasDmF3.js} +9 -2
  179. package/dist/lt-LT-C_YMgjp9.js +22 -0
  180. package/dist/lt-LT-DE-4IXNG.js +13 -0
  181. package/dist/{lt-LT-_MzAcXJo.js → lt-LT-DIe4cKlu.js} +2 -4
  182. package/dist/lt-LT-DckQGgoT.js +30 -0
  183. package/dist/{lt-LT-De7dLXxI.js → lt-LT-tXTApHm2.js} +4 -1
  184. package/dist/lv-LV-B3sT3_cw.js +22 -0
  185. package/dist/lv-LV-CeivEZms.js +13 -0
  186. package/dist/lv-LV-DP9oRTFv.js +30 -0
  187. package/dist/{lv-LV-De9rdme0.js → lv-LV-DSaQNC67.js} +4 -1
  188. package/dist/{lv-LV-CRhXAjn6.js → lv-LV-DXgW5zWl.js} +2 -4
  189. package/dist/{lv-LV-F9_Fiu3w.js → lv-LV-Sbsv8-nD.js} +9 -2
  190. package/dist/{payout-verification-manual-DH9-DdlZ.js → manual-verification-BvZWqA00.js} +3 -3
  191. package/dist/mapExistingFile-gPqgSwUG.js +231 -0
  192. package/dist/mapScriptLocalization-DFBF9KfC.js +72 -0
  193. package/dist/mapTransferInstrumentToPayoutAccount-DNWPt3mW.js +30 -0
  194. package/dist/{nl-NL-Cht7cSwD.js → nl-NL-BHkRnVrj.js} +9 -2
  195. package/dist/{nl-NL-Dbx0ZmI7.js → nl-NL-Cysslsh2.js} +2 -4
  196. package/dist/nl-NL-D2QKudfh.js +30 -0
  197. package/dist/nl-NL-DVENFpd5.js +13 -0
  198. package/dist/{nl-NL-lZcJhRsP.js → nl-NL-DywVQ9km.js} +4 -1
  199. package/dist/nl-NL-G1wVnmzT.js +22 -0
  200. package/dist/{no-NO-BEIyAMmZ.js → no-NO-B8oxqfNI.js} +4 -1
  201. package/dist/no-NO-BTtAuqCb.js +22 -0
  202. package/dist/no-NO-C_snYWBc.js +30 -0
  203. package/dist/no-NO-Dn2UkdoI.js +13 -0
  204. package/dist/{no-NO-BQAqVzF4.js → no-NO-kaAdT9B8.js} +9 -2
  205. package/dist/{no-NO-C0sfkp82.js → no-NO-zSnPtrDi.js} +2 -4
  206. package/dist/pl-PL--qPaNyJD.js +22 -0
  207. package/dist/{pl-PL-DD3wVcKc.js → pl-PL-C89s21hn.js} +4 -1
  208. package/dist/pl-PL-CQ6c2Qz_.js +30 -0
  209. package/dist/{pl-PL-CqxMKpBm.js → pl-PL-DD8JN4Qf.js} +9 -2
  210. package/dist/pl-PL-DFAzuceF.js +13 -0
  211. package/dist/{pl-PL-DAPGaxWi.js → pl-PL-UB5J5JcB.js} +2 -4
  212. package/dist/{pt-PT-BsDCHbWN.js → pt-PT-BvK00TeI.js} +4 -1
  213. package/dist/pt-PT-C-hbNnsB.js +30 -0
  214. package/dist/{pt-PT-BY9rcwcF.js → pt-PT-CjsyP_OK.js} +2 -4
  215. package/dist/pt-PT-Dk48OVtf.js +22 -0
  216. package/dist/{pt-PT-CBbmkr_J.js → pt-PT-Xm-pm3mb.js} +9 -2
  217. package/dist/pt-PT-_o5xgnxS.js +13 -0
  218. package/dist/{resolveEnvironment-D0tYcn_s.js → resolveEnvironment-DJiDAGo-.js} +3 -3
  219. package/dist/ro-RO-BLuOjrS0.js +22 -0
  220. package/dist/ro-RO-BrTWk1Ui.js +30 -0
  221. package/dist/{ro-RO-IY3AMhwm.js → ro-RO-C3m6aJVP.js} +9 -2
  222. package/dist/{ro-RO-DJLWmWZ4.js → ro-RO-C8yYXQc_.js} +2 -4
  223. package/dist/{ro-RO-CUg8-CQ8.js → ro-RO-CpGd9emB.js} +4 -1
  224. package/dist/ro-RO-D7c_Rj8V.js +13 -0
  225. package/dist/{rules-DXnRkeBJ.js → rules-Bo1d6dAJ.js} +5 -2
  226. package/dist/sk-SK-BBSuh2fA.js +13 -0
  227. package/dist/sk-SK-BTFtoPmI.js +30 -0
  228. package/dist/{sk-SK-BDKRZ2mM.js → sk-SK-BVc-vNQm.js} +9 -2
  229. package/dist/sk-SK-C1Ky2nl_.js +22 -0
  230. package/dist/{sk-SK-B7o3L57C.js → sk-SK-DbOE9C6n.js} +2 -4
  231. package/dist/{sk-SK-Cjrkrb85.js → sk-SK-DlX5KvBV.js} +4 -1
  232. package/dist/sl-SI-BB7iVcFI.js +22 -0
  233. package/dist/sl-SI-BLTuWNf5.js +13 -0
  234. package/dist/sl-SI-BhVTSmhQ.js +30 -0
  235. package/dist/{sl-SI-C8CMAkD0.js → sl-SI-Br0UEUPL.js} +2 -4
  236. package/dist/{sl-SI-BB0suyr1.js → sl-SI-D_rqR0D7.js} +9 -2
  237. package/dist/{sl-SI-BE_ndzZ2.js → sl-SI-NI2OJAvm.js} +4 -1
  238. package/dist/style.css +3226 -2972
  239. package/dist/styles-CLV89_hH.js +3226 -2972
  240. package/dist/sv-SE-66rqYTxi.js +30 -0
  241. package/dist/{sv-SE-DYruQSzt.js → sv-SE-B3zoXMuH.js} +9 -2
  242. package/dist/sv-SE-BUfESAQK.js +13 -0
  243. package/dist/{sv-SE-Bwh0wKFk.js → sv-SE-BtXmvxx4.js} +2 -4
  244. package/dist/{sv-SE-BryiIPVv.js → sv-SE-CAZpDX9G.js} +4 -1
  245. package/dist/sv-SE-DbI-1JqN.js +22 -0
  246. package/dist/translation-IYHo-_Mc.js +472 -0
  247. package/dist/types/api/configurations/useScenarios.d.ts +8 -7
  248. package/dist/types/api/idNowProvider/idNowProvider.types.d.ts +1 -1
  249. package/dist/types/api/idNowProvider/useIdNowProvider.d.ts +9 -5
  250. package/dist/types/api/industryCodes/industryCodes.types.d.ts +2 -0
  251. package/dist/types/api/industryCodes/useIndustryCodes.d.ts +6 -0
  252. package/dist/types/api/queryKeys.d.ts +2 -1
  253. package/dist/types/components/BankAccount/forms/PayoutDetails/PayoutDetails.d.ts +1 -0
  254. package/dist/types/components/BankAccount/forms/PayoutVerificationMethod/payoutVerificationMethodMetadata.d.ts +3 -3
  255. package/dist/types/components/BankAccount/tasks/PayoutDetailsDropin/payoutDetailsFormConfig.d.ts +0 -9
  256. package/dist/types/components/Business/forms/BasicInformation/BasicInformationMultiform.d.ts +0 -1
  257. package/dist/types/components/Business/forms/BusinessDetails/forms.d.ts +7 -1
  258. package/dist/types/components/Business/forms/rules.d.ts +1 -3
  259. package/dist/types/components/Business/tasks/BusinessDetailsDropin/utils.d.ts +1 -2
  260. package/dist/types/components/Business/tasks/BusinessDetailsMultiformDropin/BusinessDetailsMultiform.d.ts +1 -1
  261. package/dist/types/components/Contract/tasks/ServiceAgreementDropin/ServiceAgreementDropin.d.ts +1 -1
  262. package/dist/types/components/Contract/tasks/ServiceAgreementDropin/types.d.ts +1 -0
  263. package/dist/types/components/EFP/mapping/businessFinancingKeyMappings.d.ts +0 -3
  264. package/dist/types/components/EFP/tasks/SourceOfFundsDropin/utils.d.ts +0 -1
  265. package/dist/types/components/EmbeddedDropins/AcceptTermsOfServiceComponent/AcceptTermsOfServiceComponent.d.ts +4 -3
  266. package/dist/types/components/EmbeddedDropins/ManageTransferInstrumentComponent/ManageTransferInstrumentOverviewItemModal/ManageTransferInstrumentOverviewItemModal.d.ts +0 -1
  267. package/dist/types/components/Individual/fields/NameFields/types.d.ts +4 -18
  268. package/dist/types/components/Individual/forms/Individual/IdVerificationMethod/idVerificationMethodMetadata.d.ts +3 -3
  269. package/dist/types/components/Individual/forms/Individual/Individual.d.ts +4 -0
  270. package/dist/types/components/Individual/forms/Individual/ProofOfRelationship/types.d.ts +0 -5
  271. package/dist/types/components/Individual/forms/IndividualOnfido/AdditionalPersonalDetails/AdditionalPersonalDetails.types.d.ts +1 -1
  272. package/dist/types/components/Individual/forms/IndividualOnfido/BasicDetails/BasicDetails.types.d.ts +1 -1
  273. package/dist/types/components/Individual/forms/IndividualOnfido/IdNowVerificationModal/IdNowVerificationModal.d.ts +4 -0
  274. package/dist/types/components/Individual/forms/IndividualOnfido/IdNowVerificationModal/isIdNowModalOpen.d.ts +17 -0
  275. package/dist/types/components/Individual/forms/IndividualOnfido/IdVerificationMethod/IdVerificationMethod.types.d.ts +2 -0
  276. package/dist/types/components/Individual/forms/IndividualOnfido/IdVerificationMethod/mapExtractionResultToSchema.d.ts +2 -1
  277. package/dist/types/components/Individual/forms/IndividualOnfido/IdVerificationMethod/validateExtractionResult.d.ts +12 -0
  278. package/dist/types/components/Individual/forms/IndividualOnfido/IndividualOnfido.types.d.ts +5 -3
  279. package/dist/types/components/Individual/helpers/bafinUtils.d.ts +35 -0
  280. package/dist/types/components/Individual/helpers/isDecisionMakerTask.d.ts +2 -0
  281. package/dist/types/components/Individual/helpers/shouldShowMotionCapture.d.ts +2 -2
  282. package/dist/types/components/Individual/pages/DecisionMakerDetailsPage.d.ts +2 -1
  283. package/dist/types/components/Shared/SingpassBanner/ProviderButton/ProviderButton.d.ts +7 -0
  284. package/dist/types/components/Shared/fields/IdFieldTypeSelector/countryIdNumberTypes.d.ts +1 -1
  285. package/dist/types/components/Shared/fields/LocalizedLegalCompanyNameField/fieldConfig.d.ts +4 -5
  286. package/dist/types/components/Shared/fields/LocalizedLegalCompanyNameField/types.d.ts +4 -5
  287. package/dist/types/components/Shared/forms/Address/utils.d.ts +1 -1
  288. package/dist/types/components/Trust/forms/Trust/Trust.d.ts +1 -0
  289. package/dist/types/components/Trust/forms/TrustRegistrationDetails/types.d.ts +1 -2
  290. package/dist/types/components/Trust/tasks/TrustMembers/TrustMembersOverview.d.ts +2 -1
  291. package/dist/types/components/UnincorporatedPartnership/pages/UnincorporatedPartnershipMemberCompanyPage.d.ts +2 -1
  292. package/dist/types/components/ui/atoms/ActionsMenu/ActionsMenu.d.ts +2 -1
  293. package/dist/types/components/ui/atoms/Button/Button.types.d.ts +4 -5
  294. package/dist/types/components/ui/atoms/Image/Image.d.ts +18 -0
  295. package/dist/types/components/ui/atoms/ListItem/ListItem.d.ts +2 -1
  296. package/dist/types/components/ui/atoms/Modal/MaybeModal.d.ts +1 -1
  297. package/dist/types/components/ui/atoms/RadioGroupCard/RadioGroupCard.types.d.ts +0 -14
  298. package/dist/types/components/ui/atoms/RadioWithLabel/RadioWithLabel.d.ts +2 -1
  299. package/dist/types/components/ui/atoms/Remove/Remove.d.ts +1 -1
  300. package/dist/types/components/ui/atoms/SelectList/SelectList.d.ts +1 -0
  301. package/dist/types/components/ui/atoms/StepProgressIndicator/StepProgressIndicator.d.ts +2 -1
  302. package/dist/types/components/ui/atoms/StructuredList/StructuredList.d.ts +2 -1
  303. package/dist/types/components/ui/atoms/Svg/svgs.d.ts +0 -76
  304. package/dist/types/components/ui/atoms/TaskStatusIndicator/TaskStatusIndicator.d.ts +4 -4
  305. package/dist/types/components/ui/layout/DetailViewLayout/DetailViewLayout.d.ts +12 -0
  306. package/dist/types/components/ui/layout/EndStateLayout/EndStateLayout.d.ts +13 -0
  307. package/dist/types/components/ui/layout/LandingLayout/LandingLayout.d.ts +8 -3
  308. package/dist/types/components/ui/layout/StackLayout/StackLayout.d.ts +2 -1
  309. package/dist/types/components/ui/molecules/DocumentGuidance/DocumentGuidance.types.d.ts +2 -3
  310. package/dist/types/components/ui/molecules/InputCurrency/InputCurrency.d.ts +2 -1
  311. package/dist/types/components/ui/molecules/InputEmail/InputEmail.d.ts +2 -1
  312. package/dist/types/components/ui/molecules/InputGroup/InputGroup.d.ts +2 -1
  313. package/dist/types/components/ui/molecules/InputTelephone/InputTelephone.d.ts +2 -1
  314. package/dist/types/components/ui/molecules/InputText/InputText.d.ts +2 -0
  315. package/dist/types/components/ui/molecules/MaskedInput/MaskedInput.d.ts +0 -1
  316. package/dist/types/components/ui/molecules/Tabs/Tabs.d.ts +1 -1
  317. package/dist/types/context/StateContext/types.d.ts +1 -1
  318. package/dist/types/core/models/api/accountIdentification.d.ts +5 -4
  319. package/dist/types/core/models/api/contracts.d.ts +1 -1
  320. package/dist/types/core/models/api/get-scenarios.d.ts +11 -5
  321. package/dist/types/core/models/api/individual.d.ts +5 -10
  322. package/dist/types/core/models/api/legal-arrangement.d.ts +0 -8
  323. package/dist/types/core/models/api/organization.d.ts +4 -8
  324. package/dist/types/core/models/api/scriptLocalization.d.ts +9 -0
  325. package/dist/types/core/process-field-configurations.d.ts +14 -3
  326. package/dist/types/embeds/business-financing/AdyenBusinessFinancing.d.ts +1 -1
  327. package/dist/types/embeds/business-financing/adyen-business-financing.types.d.ts +1 -5
  328. package/dist/types/embeds/emitEvent.d.ts +14 -0
  329. package/dist/types/embeds/{individual → individual-configuration}/AdyenIndividual.d.ts +2 -2
  330. package/dist/types/embeds/{individual/adyen-individual.types.d.ts → individual-configuration/adyen-individual-configuration.types.d.ts} +2 -2
  331. package/dist/types/embeds/{manage-individual → individual-status}/AdyenManageIndividual.d.ts +3 -3
  332. package/dist/types/embeds/{manage-individual/adyen-manage-individual.types.d.ts → individual-status/adyen-individual-status.types.d.ts} +1 -1
  333. package/dist/types/embeds/{terms-of-service → terms-of-service-management}/AdyenTermsOfService.d.ts +2 -2
  334. package/dist/types/embeds/{terms-of-service/adyen-terms-of-service.types.d.ts → terms-of-service-management/adyen-terms-of-service-management.types.d.ts} +4 -3
  335. package/dist/types/embeds/{manage-terms-of-service → terms-of-service-status}/AdyenManageTermsOfService.d.ts +2 -2
  336. package/dist/types/embeds/{manage-terms-of-service → terms-of-service-status}/adyen-manage-terms-of-service.types.d.ts +1 -1
  337. package/dist/types/embeds/{transfer-instrument → transfer-instrument-configuration}/AdyenTransferInstrument.d.ts +2 -2
  338. package/dist/types/embeds/{transfer-instrument/adyen-transfer-instrument.types.d.ts → transfer-instrument-configuration/adyen-transfer-instrument-configuration.types.d.ts} +2 -2
  339. package/dist/types/embeds/{manage-transfer-instruments → transfer-instrument-management}/AdyenManageTransferInstrument.d.ts +5 -6
  340. package/dist/types/embeds/{manage-transfer-instruments/adyen-manage-transfer-instruments.types.d.ts → transfer-instrument-management/adyen-transfer-instrument-management.types.d.ts} +3 -4
  341. package/dist/types/embeds/verification-status/adyen-verification-status.types.d.ts +3 -3
  342. package/dist/types/hooks/introduction/useIntroductionScreens.d.ts +2 -1
  343. package/dist/types/hooks/introduction/useShouldShowIntroduction.d.ts +2 -1
  344. package/dist/types/hooks/useMultiForm/types.d.ts +4 -4
  345. package/dist/types/language/utils.d.ts +1 -1
  346. package/dist/types/types/localizedScriptSchema.d.ts +22 -0
  347. package/dist/types/utils/addLinkedFields.d.ts +7 -1
  348. package/dist/types/utils/entityStatusUtil.d.ts +1 -1
  349. package/dist/types/utils/formUtils.d.ts +1 -1
  350. package/dist/types/utils/getDisplayErrorMessage.d.ts +1 -1
  351. package/dist/types/utils/getName.d.ts +2 -1
  352. package/dist/types/utils/makeSelectItemForRole.d.ts +1 -1
  353. package/dist/types/utils/mapScriptLocalization.d.ts +55 -0
  354. package/dist/types/utils/masking/masks/businessRegistrationNumberMasks.d.ts +5 -0
  355. package/dist/types/utils/translation.d.ts +6 -0
  356. package/dist/types-CAznNNSI.js +160 -0
  357. package/dist/types-D2sEEWDi.js +64 -0
  358. package/dist/types-DHWLJwxd.js +74 -0
  359. package/dist/useAssociatedLegalEntity-Bp8XC2L3.js +33 -0
  360. package/dist/useDataset-D4mnA6DC.js +120 -0
  361. package/dist/useForm-B58-dXq6.js +1694 -0
  362. package/dist/useFormContext-beqGS11A.js +23 -0
  363. package/dist/useGlobalData-BrYDijKl.js +205 -0
  364. package/dist/{useMultiForm-CuBrV4Tk.js → useMultiForm-PsSG8YB6.js} +8 -3
  365. package/dist/{useOnboardingStatus-DUB9BH7M.js → useOnboardingStatus--VMqrDT7.js} +2 -2
  366. package/dist/useScenarios-Bf3RLF-w.js +46 -0
  367. package/dist/{useTermsOfServiceStatus-BblV2n-A.js → useTermsOfServiceStatus-3C9pGiD7.js} +2 -2
  368. package/dist/useToastContext-DuFRr5GY.js +51 -0
  369. package/dist/useUnincorporatedPartnershipMembers-Jv04xMZi.js +99 -0
  370. package/dist/utils-Ble2523K.js +159 -0
  371. package/dist/utils-CJuL6b9p.js +29 -0
  372. package/dist/{utils-CoNP20Mi.js → utils-CPUXDoS0.js} +46 -4
  373. package/dist/utils-DNSfZiio.js +70 -0
  374. package/dist/validate-BtJFnIGb.js +605 -0
  375. package/dist/{validate-BPEF-9EC.js → validate-BxKz7xY8.js} +2 -2
  376. package/dist/validate-DN9Kvy9b.js +382 -0
  377. package/dist/validationError-Dr817hGf.js +86 -0
  378. package/package.json +66 -69
  379. package/dist/BusinessDetailsDropin-JZ29P1pI.js +0 -2163
  380. package/dist/BusinessFinancingComponent-AAD0wzc0.js +0 -38
  381. package/dist/BusinessFinancingPage-DWvnRK3f.js +0 -35
  382. package/dist/CreateIndividualComponent-CO0NnimV.js +0 -64
  383. package/dist/CreateTransferInstrumentComponent-CpUB63yl.js +0 -55
  384. package/dist/DecisionMakerDetailsPage-DBsCSIAU.js +0 -80
  385. package/dist/FormEndState-s8NUp0x5.js +0 -59
  386. package/dist/LegalRepresentativeDetailsPage-Beh9_16w.js +0 -55
  387. package/dist/ManageIndividualComponent-C5ll1EKq.js +0 -42
  388. package/dist/ManageTermsOfServiceComponent-BYgWiamd.js +0 -40
  389. package/dist/RootIndividualDetailsPage-Bi7xeUYJ.js +0 -71
  390. package/dist/SignPCIComponent-Dgnvmjbr.js +0 -279
  391. package/dist/SoleProprietorshipPage-DMYrwSK2.js +0 -44
  392. package/dist/StoreProvider-QThALSrj.js +0 -31918
  393. package/dist/TrustMemberCompanyPage-DKNQ_vHF.js +0 -54
  394. package/dist/TrustMemberIndividualPage-CFo3Is4F.js +0 -60
  395. package/dist/UnincorporatedPartnershipIndividualPage-CfllAxUK.js +0 -60
  396. package/dist/UnincorporatedPartnershipMemberCompanyPage-779IUOW2.js +0 -57
  397. package/dist/VerificationErrorAlert-BtsLa_Ty.js +0 -77
  398. package/dist/adyen-a-filled-czhSM_bc.js +0 -14
  399. package/dist/adyen-individual.js +0 -50
  400. package/dist/adyen-manage-individual.js +0 -48
  401. package/dist/adyen-manage-terms-of-service.js +0 -48
  402. package/dist/adyen-manage-transfer-instruments.js +0 -63
  403. package/dist/adyen-terms-of-service.js +0 -60
  404. package/dist/adyen-transfer-instrument.js +0 -64
  405. package/dist/arrow-left-Dtc2gya1.js +0 -14
  406. package/dist/bg-BG-BvSUDgGF.js +0 -13
  407. package/dist/cs-CZ-y4mvq4Lv.js +0 -13
  408. package/dist/da-DK-qgQOVjDp.js +0 -13
  409. package/dist/de-DE-pSdsxBpQ.js +0 -13
  410. package/dist/document-plus-NwgAdjyB.js +0 -17
  411. package/dist/el-GR-Bvjk5Sw8.js +0 -13
  412. package/dist/en-US-Bq2Twy6x.js +0 -54
  413. package/dist/es-ES-Dy1uR2H_.js +0 -13
  414. package/dist/et-EE-d9V24rcf.js +0 -13
  415. package/dist/fi-FI-B0fnAFV2.js +0 -13
  416. package/dist/fr-FR-BoKzVp2q.js +0 -13
  417. package/dist/getFieldsWithExistingData-CUMH8N-C.js +0 -22
  418. package/dist/hide-CigAXbWC.js +0 -18
  419. package/dist/hr-HR-CF0AHQzi.js +0 -13
  420. package/dist/hu-HU-CSPhOvLC.js +0 -13
  421. package/dist/idea-DwJIwJHR.js +0 -18
  422. package/dist/instant-verification-method-BGfknV9x.js +0 -28
  423. package/dist/it-IT-BH-eqIKH.js +0 -13
  424. package/dist/ja-JP-B3yqM_FM.js +0 -13
  425. package/dist/lt-LT-Lzl_Cbw-.js +0 -13
  426. package/dist/lv-LV-y00wN1pj.js +0 -13
  427. package/dist/mapFinancialReportsToFinancialInformation-Bo2uW3j7.js +0 -66
  428. package/dist/nl-NL-DmnFXAQC.js +0 -13
  429. package/dist/no-NO-DbvFfP96.js +0 -13
  430. package/dist/pl-PL--mmxopYA.js +0 -13
  431. package/dist/plus-small-Dj1WRyFM.js +0 -14
  432. package/dist/pt-PT-BVzXBFp7.js +0 -13
  433. package/dist/ro-RO-Cdmevo9A.js +0 -13
  434. package/dist/ru-RU-FZb2upqh.js +0 -13
  435. package/dist/sk-SK-nfeuTcY5.js +0 -13
  436. package/dist/sl-SI-DUTZDqkP.js +0 -13
  437. package/dist/sv-SE-BTx2XKAp.js +0 -13
  438. package/dist/types/components/Individual/mapping/mapLocalization.d.ts +0 -3
  439. package/dist/types/components/ui/atoms/OutlinedIcon/OutlinedIcon.d.ts +0 -5
  440. package/dist/types/components/ui/atoms/ProviderButton/ProviderButton.d.ts +0 -3
  441. package/dist/types/components/ui/atoms/ProviderButton/ProviderButton.types.d.ts +0 -5
  442. package/dist/types/components/ui/molecules/FormEndState/FormEndState.d.ts +0 -2
  443. package/dist/types/components/ui/molecules/FormEndState/types.d.ts +0 -8
  444. package/dist/useUpdateLegalEntity-56mDjaQA.js +0 -57
  445. package/dist/validate-Bgc1XuQl.js +0 -40
  446. package/dist/zh-CN-wUb4MmTZ.js +0 -13
  447. package/dist/zh-TW-DNTXHLKa.js +0 -13
  448. /package/dist/types/embeds/{individual/adyen-individual.d.ts → individual-configuration/adyen-individual-configuration.d.ts} +0 -0
  449. /package/dist/types/embeds/{manage-individual/adyen-manage-individual.d.ts → individual-status/adyen-individual-status.d.ts} +0 -0
  450. /package/dist/types/embeds/{manage-terms-of-service/adyen-manage-terms-of-service.d.ts → terms-of-service-management/adyen-terms-of-service-management.d.ts} +0 -0
  451. /package/dist/types/embeds/{manage-transfer-instruments/adyen-manage-transfer-instruments.d.ts → terms-of-service-status/adyen-terms-of-service-status.d.ts} +0 -0
  452. /package/dist/types/embeds/{terms-of-service/adyen-terms-of-service.d.ts → transfer-instrument-configuration/adyen-transfer-instrument-configuration.d.ts} +0 -0
  453. /package/dist/types/embeds/{transfer-instrument/adyen-transfer-instrument.d.ts → transfer-instrument-management/adyen-transfer-instrument-management.d.ts} +0 -0
@@ -0,0 +1,3062 @@
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] = "2faa1728-14bc-4cb2-bc6a-091c71d19c5d", e._sentryDebugIdIdentifier = "sentry-dbid-2faa1728-14bc-4cb2-bc6a-091c71d19c5d");
6
+ } catch (e) {
7
+ }
8
+ }
9
+ ;
10
+ import { bx as getNestedPropertyKeys, af as objectsDeepEqual, a as useTranslation, c as useLegalEntity, R as ROOT_LE, a8 as CountryCodes, y as LegalEntityTypes, M as TaskTypes, aD as keysOf, X as useExperimentsContext } from "./StoreProvider-DOveEVCE.js";
11
+ import { jsxs, jsx, Fragment } from "preact/jsx-runtime";
12
+ import { memo } from "preact/compat";
13
+ import { useState, useRef, useEffect, useCallback, useMemo } from "preact/hooks";
14
+ import { a as useForm, F as Field, c as Select, C as Checkbox } from "./useForm-B58-dXq6.js";
15
+ import { c as createFormUtils, F as FormHeader, E as ErrorPanel } from "./CountryField-DrVg4pbc.js";
16
+ import { T as TextArea, f as validatePatternOnBlur, c as validateNotEmptyOnBlur, a as useAccountHolder } from "./fieldConfigurations-DPY7jB8k.js";
17
+ import { S as StateContextSetter } from "./validate-BtJFnIGb.js";
18
+ import { D as DocumentGuidance, u as uppercase } from "./mapExistingFile-gPqgSwUG.js";
19
+ import { D as Dropzone } from "./Dropzone-E3lXPgPY.js";
20
+ import { C as CompanyTypesValues } from "./bafinUtils-CVA17xYo.js";
21
+ import { m as makeMask, n as numericInputs, a as nonInputs, d as alphanumericInputs, c as customInputs, b as alphaInputs, s as spacer, M as MaskedInput } from "./MaskedInput-CP1lOY03.js";
22
+ import { C as COUNTRIES_WITH_STATES_DATASET } from "./utils-Ble2523K.js";
23
+ import { c as createFormRules } from "./form-rules-DhbF2mY4.js";
24
+ import { i as isDateOlderThanAYear } from "./Address-T_L756Fd.js";
25
+ import { R as RadioGroup } from "./RadioGroup-C1kODuZr.js";
26
+ const getFieldsWithExistingData = (legalEntity, keyMapping, documentMapping, knownProblematicFields = []) => {
27
+ const apiFieldsWithExistingData = getNestedPropertyKeys(legalEntity);
28
+ const nonDocumentFields = apiFieldsWithExistingData.map((field) => keyMapping[field]).filter(Boolean).filter((field) => !knownProblematicFields.includes(field));
29
+ if (documentMapping && legalEntity.documentDetails?.length) {
30
+ const documentFields = legalEntity.documentDetails.map((document) => documentMapping[document.type]).filter(Boolean);
31
+ return [...nonDocumentFields, ...documentFields];
32
+ }
33
+ return nonDocumentFields;
34
+ };
35
+ const descriptionField = "adyen-kyc-description-field";
36
+ const styles = {
37
+ descriptionField
38
+ };
39
+ const DESCRIPTION_CHARACTERS_LIMIT = 200;
40
+ function DocumentUpload({
41
+ documentType,
42
+ documentField,
43
+ guidanceHeader,
44
+ documentTypeSelect,
45
+ guidanceContent,
46
+ handleFieldChange,
47
+ requiredFields,
48
+ data: dataProp,
49
+ valid: validProp,
50
+ errors: errorProp,
51
+ fieldValidationErrors: propFieldValidationErrors,
52
+ supportsMultipleUploads,
53
+ maxNumberOfFiles = 1,
54
+ label,
55
+ extraDropzoneDescription,
56
+ hidePageCount,
57
+ ...props
58
+ }) {
59
+ const { t } = useTranslation("common");
60
+ const [document, setDocument] = useState();
61
+ const form = useForm({
62
+ ...props,
63
+ schema: ["description"],
64
+ defaultData: dataProp,
65
+ rules: props.validators,
66
+ fieldProblems: propFieldValidationErrors
67
+ });
68
+ const { handleChangeFor, triggerValidation, setData } = form;
69
+ let { data, errors, valid, fieldProblems } = form;
70
+ const formUtils = createFormUtils(props, t);
71
+ const stateRef = useRef({ setState: null });
72
+ const isOptional = !(props?.formVerificationErrors && Object.keys(props?.formVerificationErrors)?.length === 0);
73
+ useEffect(() => {
74
+ if (isOptional) {
75
+ triggerValidation();
76
+ }
77
+ }, [dataProp]);
78
+ useEffect(() => {
79
+ stateRef.current.setState?.({
80
+ type: "addToState",
81
+ value: {
82
+ data,
83
+ valid,
84
+ errors,
85
+ fieldProblems,
86
+ dataStoreId: props.id,
87
+ schema: requiredFields
88
+ }
89
+ });
90
+ }, [data, valid, errors, fieldProblems]);
91
+ useEffect(() => {
92
+ setDocument({
93
+ [documentField]: dataProp?.[documentField]
94
+ });
95
+ setData("description", dataProp?.description);
96
+ triggerValidation();
97
+ }, [dataProp]);
98
+ if (handleFieldChange && requiredFields && propFieldValidationErrors) {
99
+ data = dataProp ?? {};
100
+ errors = errorProp;
101
+ valid = validProp;
102
+ fieldProblems = propFieldValidationErrors;
103
+ }
104
+ return /* @__PURE__ */ jsxs(
105
+ "div",
106
+ {
107
+ className: `adyen-kyc-company-document-upload adyen-kyc-company-document-upload--${documentField}`,
108
+ children: [
109
+ /* @__PURE__ */ jsx(StateContextSetter, { owner: props.id, stateRef }),
110
+ /* @__PURE__ */ jsx(FormHeader, { heading: props.heading, description: props.description }),
111
+ /* @__PURE__ */ jsx(
112
+ ErrorPanel,
113
+ {
114
+ verificationErrors: props?.formVerificationErrors,
115
+ validationErrors: propFieldValidationErrors,
116
+ formUtils,
117
+ id: "ariaErrorField"
118
+ }
119
+ ),
120
+ formUtils.isRequiredField(documentField) && /* @__PURE__ */ jsxs(Fragment, { children: [
121
+ guidanceHeader,
122
+ documentTypeSelect && /* @__PURE__ */ jsx(Field, { name: "documentType", label: t(($) => $["selectDocumentType"]), children: (childProps) => /* @__PURE__ */ jsx(
123
+ Select,
124
+ {
125
+ ...childProps,
126
+ onChange: (e) => documentTypeSelect.setSelectedType(e.target.value),
127
+ name: "documentType",
128
+ placeholder: t(($) => $["selectDocument"]),
129
+ selected: documentTypeSelect.selectedType,
130
+ items: documentTypeSelect.options.map(({ id, name }) => ({
131
+ id,
132
+ name: t(($) => $[name])
133
+ }))
134
+ }
135
+ ) }),
136
+ /* @__PURE__ */ jsx("div", { children: guidanceContent }),
137
+ /* @__PURE__ */ jsx(DocumentGuidance, { type: documentType, className: "adyen-kyc-u-margin-bottom-24" }),
138
+ /* @__PURE__ */ jsx(
139
+ Dropzone,
140
+ {
141
+ defaultData: document ?? data,
142
+ id: props.id,
143
+ isOptional: isOptional || formUtils.isOptionalField(documentField),
144
+ maxSize: documentType === "constitutionalDocument" ? 31457280 : void 0,
145
+ name: documentField,
146
+ shouldValidate: props.shouldValidate,
147
+ handleFieldChange,
148
+ errors,
149
+ fieldValidationErrors: fieldProblems,
150
+ valid,
151
+ multiple: supportsMultipleUploads,
152
+ maxNumberOfFiles: maxNumberOfFiles ?? 1,
153
+ label,
154
+ extraDropzoneDescription,
155
+ hidePageCount
156
+ }
157
+ )
158
+ ] }),
159
+ formUtils.isRequiredField("description") && /* @__PURE__ */ jsx("div", { className: styles.descriptionField, children: /* @__PURE__ */ jsx(
160
+ Field,
161
+ {
162
+ name: "description",
163
+ label: formUtils.getLabel("descriptionOptional"),
164
+ errorMessage: formUtils.getErrorMessage("description", errors, fieldProblems),
165
+ isValid: valid.description,
166
+ children: (childProps) => /* @__PURE__ */ jsx(
167
+ TextArea,
168
+ {
169
+ ...childProps,
170
+ name: "description",
171
+ value: data.description,
172
+ maxLength: DESCRIPTION_CHARACTERS_LIMIT,
173
+ onInput: handleChangeFor("description"),
174
+ "aria-invalid": !valid.description,
175
+ handleFieldChange: handleFieldChange?.("description"),
176
+ errors,
177
+ fieldValidationErrors: fieldProblems,
178
+ valid
179
+ }
180
+ )
181
+ }
182
+ ) })
183
+ ]
184
+ }
185
+ );
186
+ }
187
+ const MemoizedDocumentUpload = memo(
188
+ DocumentUpload,
189
+ (prevProps, nextProps) => prevProps.shouldValidate === nextProps.shouldValidate && objectsDeepEqual(prevProps.requiredFields, nextProps.requiredFields) && objectsDeepEqual(prevProps.errors, nextProps.errors) && objectsDeepEqual(prevProps.optionalFields, nextProps.optionalFields) && objectsDeepEqual(prevProps.data, nextProps.data) && objectsDeepEqual(prevProps.formVerificationErrors, nextProps.formVerificationErrors) && objectsDeepEqual(prevProps.fieldValidationErrors, nextProps.fieldValidationErrors) && objectsDeepEqual(prevProps.documentTypeSelect, nextProps.documentTypeSelect) && prevProps.documentField === nextProps.documentField && prevProps.name === nextProps.name && prevProps.country === nextProps.country && prevProps.companyType === nextProps.companyType
190
+ );
191
+ const useCapabilities = () => {
192
+ const { data: rootLegalEntity } = useLegalEntity(ROOT_LE);
193
+ return rootLegalEntity?.capabilities;
194
+ };
195
+ const companyRegistrationNumberOptions = {
196
+ [CountryCodes.Australia]: [
197
+ {
198
+ id: "incorporatedAssociationRegistrationNumber",
199
+ name: "incorporatedAssociationRegistrationNumber",
200
+ applicableOnlyFor: [CompanyTypesValues.INCORPORATED_ASSOCIATION]
201
+ },
202
+ { id: "australianBusinessNumberAcn", name: "australianBusinessNumberAcn" }
203
+ ],
204
+ [CountryCodes.Austria]: [
205
+ {
206
+ id: "firmenbuchnummer",
207
+ name: "firmenbuchnummer"
208
+ },
209
+ {
210
+ id: "ZVR",
211
+ name: "zentralesVereinsregisterId",
212
+ applicableOnlyFor: [
213
+ CompanyTypesValues.NON_PROFIT_OR_CHARITABLE,
214
+ CompanyTypesValues.INCORPORATED_ASSOCIATION
215
+ ]
216
+ }
217
+ ],
218
+ [CountryCodes.Croatia]: [
219
+ { id: "MBO", name: "MBO" },
220
+ { id: "MBS", name: "MBS" }
221
+ ],
222
+ [CountryCodes.France]: [
223
+ {
224
+ id: "SIRET",
225
+ name: "siret"
226
+ },
227
+ {
228
+ id: "RNA",
229
+ name: "rnaNumber",
230
+ applicableOnlyFor: [CompanyTypesValues.NON_PROFIT_OR_CHARITABLE]
231
+ }
232
+ ],
233
+ [CountryCodes.Hungary]: [
234
+ {
235
+ id: "nyilvantartasiSzam",
236
+ name: "huRegistrationNumberForSoleProp",
237
+ applicableOnlyFor: [CompanyTypesValues.SOLE_PROPRIETORSHIP]
238
+ }
239
+ ],
240
+ [CountryCodes.Italy]: [
241
+ {
242
+ id: "partitaIVA",
243
+ name: "codiceFiscalePartitaIVA"
244
+ },
245
+ {
246
+ id: "CCIAA",
247
+ name: "CCIAA"
248
+ }
249
+ ],
250
+ [CountryCodes.Monaco]: [
251
+ {
252
+ id: "mcRegistrationNumberSoleProp",
253
+ name: "mcRegistrationNumberSoleProp",
254
+ applicableOnlyFor: [CompanyTypesValues.SOLE_PROPRIETORSHIP]
255
+ },
256
+ {
257
+ id: "mcRegistrationNumber",
258
+ name: "mcRegistrationNumber",
259
+ applicableOnlyFor: [
260
+ CompanyTypesValues.PRIVATE_COMPANY,
261
+ CompanyTypesValues.GOVERNMENTAL_ORGANIZATION,
262
+ CompanyTypesValues.INCORPORATED_ASSOCIATION,
263
+ CompanyTypesValues.INCORPORATED_PARTNERSHIP,
264
+ CompanyTypesValues.NON_PROFIT_OR_CHARITABLE,
265
+ CompanyTypesValues.UNINCORPORATED_PARTNERSHIP,
266
+ CompanyTypesValues.UNLISTED_PUBLIC_COMPANY
267
+ ]
268
+ }
269
+ ],
270
+ [CountryCodes.NewZealand]: [
271
+ {
272
+ id: "NZBN",
273
+ name: "NZBN"
274
+ },
275
+ {
276
+ id: "companyNumberNZ",
277
+ name: "companyNumberNZ",
278
+ applicableOnlyFor: [
279
+ CompanyTypesValues.PRIVATE_COMPANY,
280
+ CompanyTypesValues.PUBLIC_COMPANY,
281
+ CompanyTypesValues.UNLISTED_PUBLIC_COMPANY
282
+ ]
283
+ }
284
+ ],
285
+ [CountryCodes.Romania]: [
286
+ {
287
+ id: "roRegNumberNewFormat",
288
+ name: "roRegNumberNewFormat_label"
289
+ },
290
+ {
291
+ id: "roRegNumberOldFormat",
292
+ name: "roRegNumberOldFormat_label"
293
+ }
294
+ ],
295
+ [CountryCodes.Poland]: [
296
+ {
297
+ id: "regon",
298
+ name: "regon"
299
+ },
300
+ {
301
+ id: "krsNumber",
302
+ name: "krsNumber"
303
+ }
304
+ ],
305
+ [CountryCodes.UnitedKingdom]: [
306
+ {
307
+ id: "charity",
308
+ name: "charityNumber",
309
+ applicableOnlyFor: [CompanyTypesValues.NON_PROFIT_OR_CHARITABLE]
310
+ },
311
+ {
312
+ id: "companyNumber",
313
+ name: "companyNumber",
314
+ applicableOnlyFor: [
315
+ CompanyTypesValues.PRIVATE_COMPANY,
316
+ CompanyTypesValues.GOVERNMENTAL_ORGANIZATION,
317
+ CompanyTypesValues.INCORPORATED_ASSOCIATION,
318
+ CompanyTypesValues.INCORPORATED_PARTNERSHIP,
319
+ CompanyTypesValues.NON_PROFIT_OR_CHARITABLE,
320
+ CompanyTypesValues.UNINCORPORATED_PARTNERSHIP,
321
+ CompanyTypesValues.UNLISTED_PUBLIC_COMPANY,
322
+ CompanyTypesValues.PUBLIC_COMPANY
323
+ ]
324
+ }
325
+ ]
326
+ };
327
+ const getCompanyRegistrationNumberOptions = (country, companyType) => {
328
+ const optionsForCountry = companyRegistrationNumberOptions[country];
329
+ if (!companyType || !optionsForCountry) return optionsForCountry;
330
+ return optionsForCountry.filter(
331
+ (option) => option.applicableOnlyFor?.includes(companyType) ?? true
332
+ );
333
+ };
334
+ const individualIdNumberOptions = {
335
+ [CountryCodes.Spain]: [
336
+ {
337
+ id: "dni",
338
+ name: "dni"
339
+ },
340
+ {
341
+ id: "nie",
342
+ name: "nie"
343
+ }
344
+ ]
345
+ };
346
+ const additionallIdNumberOptions = {
347
+ [CountryCodes.NewZealand]: [
348
+ {
349
+ id: "driversLicense",
350
+ name: "driversLicense"
351
+ },
352
+ {
353
+ id: "passport",
354
+ name: "passportNumber"
355
+ }
356
+ ],
357
+ [CountryCodes.HongKong]: [
358
+ {
359
+ id: "proofOfIdentityCard",
360
+ name: "stateIssuedProofOfIdentityCard"
361
+ },
362
+ {
363
+ id: "driversLicense",
364
+ name: "driversLicense"
365
+ },
366
+ {
367
+ id: "passport",
368
+ name: "passportNumber"
369
+ }
370
+ ],
371
+ [CountryCodes.Australia]: [
372
+ {
373
+ id: "driversLicense",
374
+ name: "driversLicense"
375
+ },
376
+ {
377
+ id: "passport",
378
+ name: "passportNumber"
379
+ }
380
+ ]
381
+ };
382
+ const taxIdNumberOptions = {
383
+ [CountryCodes.Australia]: [
384
+ {
385
+ id: "ABN",
386
+ name: "australianBusinessNumberAbn"
387
+ }
388
+ ],
389
+ [CountryCodes.Belgium]: [
390
+ {
391
+ id: "BUSINESS_NUMMER",
392
+ name: "businessNumber",
393
+ applicableOnlyFor: [
394
+ CompanyTypesValues.SOLE_PROPRIETORSHIP,
395
+ CompanyTypesValues.PRIVATE_COMPANY,
396
+ CompanyTypesValues.GOVERNMENTAL_ORGANIZATION,
397
+ CompanyTypesValues.INCORPORATED_ASSOCIATION,
398
+ CompanyTypesValues.INCORPORATED_PARTNERSHIP,
399
+ CompanyTypesValues.NON_PROFIT_OR_CHARITABLE,
400
+ CompanyTypesValues.UNINCORPORATED_PARTNERSHIP,
401
+ CompanyTypesValues.UNLISTED_PUBLIC_COMPANY
402
+ ]
403
+ },
404
+ {
405
+ id: "NUMERO_NATIONAL",
406
+ name: "taxInformationNumber__BE_Individual",
407
+ applicableOnlyFor: [LegalEntityTypes.INDIVIDUAL]
408
+ }
409
+ ],
410
+ [CountryCodes.Brazil]: [{ id: "CNPJ", name: "CNPJ" }],
411
+ [CountryCodes.Canada]: [{ id: "BUSINESS_NUMBER", name: "businessNumber" }],
412
+ [CountryCodes.Germany]: [
413
+ {
414
+ id: "STEUERNUMMER",
415
+ name: "taxInformationNumber__DE",
416
+ applicableOnlyFor: [
417
+ CompanyTypesValues.SOLE_PROPRIETORSHIP,
418
+ CompanyTypesValues.PRIVATE_COMPANY,
419
+ CompanyTypesValues.GOVERNMENTAL_ORGANIZATION,
420
+ CompanyTypesValues.INCORPORATED_ASSOCIATION,
421
+ CompanyTypesValues.INCORPORATED_PARTNERSHIP,
422
+ CompanyTypesValues.NON_PROFIT_OR_CHARITABLE,
423
+ CompanyTypesValues.UNINCORPORATED_PARTNERSHIP,
424
+ CompanyTypesValues.UNLISTED_PUBLIC_COMPANY
425
+ ]
426
+ },
427
+ {
428
+ id: "IDNR",
429
+ name: "taxInformationNumber__DE_Individual",
430
+ applicableOnlyFor: [LegalEntityTypes.INDIVIDUAL]
431
+ }
432
+ ],
433
+ [CountryCodes.Gibraltar]: [
434
+ { id: "GI_TAXPAYER_REFERENCE_NUMBER", name: "taxpayerReferenceNumber" }
435
+ ],
436
+ [CountryCodes.Guernsey]: [
437
+ { id: "GG_REGISTRATION_NUMBER", name: "taxInformationNumber" },
438
+ {
439
+ id: "TIN_GG",
440
+ name: "nationalInsuranceNumber",
441
+ applicableOnlyFor: [CompanyTypesValues.SOLE_PROPRIETORSHIP]
442
+ }
443
+ ],
444
+ [CountryCodes.HongKong]: [
445
+ {
446
+ id: "BRN",
447
+ name: "taxInformationNumber__HK"
448
+ }
449
+ ],
450
+ [CountryCodes.Ireland]: [
451
+ {
452
+ id: "TRN",
453
+ name: "trnNumber",
454
+ applicableOnlyFor: [CompanyTypesValues.UNINCORPORATED_PARTNERSHIP]
455
+ }
456
+ ],
457
+ [CountryCodes.IsleOfMan]: [{ id: "IM_TAX_REFERENCE_NUMBER", name: "taxReferenceNumber" }],
458
+ [CountryCodes.Japan]: [{ id: "CORPORATE_NUMBER", name: "taxInformationNumber" }],
459
+ [CountryCodes.Jersey]: [
460
+ {
461
+ id: "TIN_JE",
462
+ name: "taxIdentificationNumber"
463
+ },
464
+ {
465
+ id: "SSN",
466
+ name: "socialSecurityNumber",
467
+ applicableOnlyFor: [CompanyTypesValues.SOLE_PROPRIETORSHIP]
468
+ }
469
+ ],
470
+ [CountryCodes.Netherlands]: [
471
+ {
472
+ id: "RSIN",
473
+ name: "rsinNumber",
474
+ applicableOnlyFor: [
475
+ CompanyTypesValues.PRIVATE_COMPANY,
476
+ CompanyTypesValues.GOVERNMENTAL_ORGANIZATION,
477
+ CompanyTypesValues.INCORPORATED_ASSOCIATION,
478
+ CompanyTypesValues.INCORPORATED_PARTNERSHIP,
479
+ CompanyTypesValues.NON_PROFIT_OR_CHARITABLE,
480
+ CompanyTypesValues.UNINCORPORATED_PARTNERSHIP,
481
+ CompanyTypesValues.UNLISTED_PUBLIC_COMPANY
482
+ ]
483
+ },
484
+ {
485
+ id: "BSN",
486
+ name: "bsnNumber",
487
+ applicableOnlyFor: [LegalEntityTypes.INDIVIDUAL]
488
+ }
489
+ ],
490
+ [CountryCodes.NewZealand]: [
491
+ {
492
+ id: "IRD",
493
+ name: "irdNumber"
494
+ }
495
+ ],
496
+ [CountryCodes.PuertoRico]: [
497
+ {
498
+ id: "EIN",
499
+ name: "ein"
500
+ }
501
+ ],
502
+ [CountryCodes.Singapore]: [
503
+ {
504
+ id: "GST",
505
+ name: "gst"
506
+ },
507
+ {
508
+ id: "UEN",
509
+ name: "uen"
510
+ }
511
+ ],
512
+ [CountryCodes.Spain]: [
513
+ {
514
+ id: "dni",
515
+ name: "dni",
516
+ applicableOnlyFor: [LegalEntityTypes.INDIVIDUAL]
517
+ },
518
+ {
519
+ id: "nie",
520
+ name: "nie",
521
+ applicableOnlyFor: [LegalEntityTypes.INDIVIDUAL]
522
+ }
523
+ ],
524
+ [CountryCodes.UnitedKingdom]: [
525
+ {
526
+ id: "UTR",
527
+ name: "utr"
528
+ },
529
+ {
530
+ id: "NINO",
531
+ name: "nationalInsuranceNumber",
532
+ applicableOnlyFor: [LegalEntityTypes.INDIVIDUAL]
533
+ }
534
+ ],
535
+ [CountryCodes.UnitedStates]: [
536
+ {
537
+ id: "EIN",
538
+ name: "ein"
539
+ }
540
+ ]
541
+ };
542
+ const vatNumberOptions = {
543
+ [CountryCodes.Austria]: [{ id: "UST-ID", name: "UST-ID" }],
544
+ [CountryCodes.Belgium]: [{ id: "euVatNumber", name: "euVatNumber" }],
545
+ [CountryCodes.Bulgaria]: [{ id: "identifikacionenNomerDDS", name: "identifikacionenNomerDDS" }],
546
+ [CountryCodes.Croatia]: [{ id: "PDVIdBrojOIB", name: "PDVIdBrojOIB" }],
547
+ [CountryCodes.Cyprus]: [{ id: "arithmosEngraphes", name: "arithmosEngraphes" }],
548
+ [CountryCodes.CzechRepublic]: [{ id: "DIC", name: "DIC" }],
549
+ [CountryCodes.Denmark]: [
550
+ {
551
+ id: "momsregistreringsnummerCVR",
552
+ name: "momsregistreringsnummerCVR"
553
+ },
554
+ {
555
+ id: "stamregister",
556
+ name: "stamregister"
557
+ }
558
+ ],
559
+ [CountryCodes.Estonia]: [
560
+ { id: "kaibemaksukohustuslaseNumber", name: "kaibemaksukohustuslaseNumber" }
561
+ ],
562
+ [CountryCodes.Finland]: [
563
+ {
564
+ id: "arvonlisaveronumeroMervardesskattenummer",
565
+ name: "arvonlisaveronumeroMervardesskattenummer"
566
+ }
567
+ ],
568
+ [CountryCodes.France]: [
569
+ {
570
+ id: "numeroDIdentificationALATaxe",
571
+ name: "numeroDIdentificationALATaxe"
572
+ },
573
+ {
574
+ id: "NumeroDeTVA",
575
+ name: "NumeroDeTVA"
576
+ }
577
+ ],
578
+ [CountryCodes.Germany]: [{ id: "USt-IdNr", name: "USt-IdNr" }],
579
+ [CountryCodes.Greece]: [{ id: "grTaxId", name: "grTaxId" }],
580
+ [CountryCodes.Hungary]: [{ id: "huTaxId", name: "huTaxId" }],
581
+ [CountryCodes.Ireland]: [{ id: "vatNumber", name: "vatNumber" }],
582
+ [CountryCodes.Italy]: [{ id: "partitaIVA", name: "partitaIVA" }],
583
+ [CountryCodes.Latvia]: [{ id: "lvTaxId", name: "lvTaxId" }],
584
+ [CountryCodes.Liechtenstein]: [{ id: "vatRegistrationNumber", name: "vatRegistrationNumber" }],
585
+ [CountryCodes.Lithuania]: [{ id: "PVMmoketojoKodas", name: "PVMmoketojoKodas" }],
586
+ [CountryCodes.Luxembourg]: [
587
+ { id: "numeroDIdentificationALATaxe", name: "numeroDIdentificationALATaxe" }
588
+ ],
589
+ [CountryCodes.Malaysia]: [{ id: "SST", name: "SST" }],
590
+ [CountryCodes.Malta]: [{ id: "vatNumber", name: "vatNumber" }],
591
+ [CountryCodes.Monaco]: [
592
+ { id: "numeroDIdentificationALATaxe", name: "numeroDIdentificationALATaxe" }
593
+ ],
594
+ [CountryCodes.Netherlands]: [{ id: "btwNummer", name: "btwNummer" }],
595
+ [CountryCodes.Norway]: [{ id: "mvanummer", name: "mvanummer" }],
596
+ [CountryCodes.Poland]: [{ id: "NIP", name: "NIP" }],
597
+ [CountryCodes.Portugal]: [{ id: "numerodeIVA", name: "numerodeIVA" }],
598
+ [CountryCodes.Romania]: [
599
+ { id: "codulDeIdentificareFiscala", name: "codulDeIdentificareFiscala" }
600
+ ],
601
+ [CountryCodes.Slovakia]: [{ id: "skTaxId", name: "skTaxId" }],
602
+ [CountryCodes.Slovenia]: [{ id: "siTaxId", name: "siTaxId" }],
603
+ [CountryCodes.Spain]: [{ id: "NIFdeIVA", name: "NIFdeIVA" }],
604
+ [CountryCodes.Sweden]: [
605
+ {
606
+ id: "vatNummerMomsregistreringsnummerOrMomsnummer",
607
+ name: "vatNummerMomsregistreringsnummerOrMomsnummer"
608
+ }
609
+ ],
610
+ [CountryCodes.Switzerland]: [{ id: "Mehrwertsteuernummer", name: "Mehrwertsteuernummer" }],
611
+ [CountryCodes.UnitedArabEmirates]: [
612
+ { id: "vatRegistrationNumber", name: "vatRegistrationNumber" }
613
+ ],
614
+ [CountryCodes.UnitedKingdom]: [{ id: "vatRegistrationNumber", name: "vatRegistrationNumber" }]
615
+ };
616
+ const getTaxIdNumberOptions = (country, companyType) => {
617
+ const optionsForCountry = taxIdNumberOptions[country];
618
+ if (!companyType || !optionsForCountry) return optionsForCountry;
619
+ return optionsForCountry.filter(
620
+ (option) => option.applicableOnlyFor?.includes(companyType) ?? true
621
+ );
622
+ };
623
+ const getVatNumberOptions = (country, companyType) => {
624
+ const optionsForCountry = vatNumberOptions[country];
625
+ if (!companyType || !optionsForCountry) return optionsForCountry;
626
+ return optionsForCountry.filter(
627
+ (option) => option.applicableOnlyFor?.includes(companyType) ?? true
628
+ );
629
+ };
630
+ const StateCodesUS = {
631
+ Alabama: "AL",
632
+ Alaska: "AK",
633
+ Arizona: "AZ",
634
+ Arkansas: "AR",
635
+ California: "CA",
636
+ Colorado: "CO",
637
+ Connecticut: "CT",
638
+ Delaware: "DE",
639
+ DistrictOfColumbia: "DC",
640
+ Florida: "FL",
641
+ Georgia: "GA",
642
+ Hawaii: "HI",
643
+ Idaho: "ID",
644
+ Illinois: "IL",
645
+ Indiana: "IN",
646
+ Iowa: "IA",
647
+ Kansas: "KS",
648
+ Kentucky: "KY",
649
+ Louisiana: "LA",
650
+ Maine: "ME",
651
+ Maryland: "MD",
652
+ Massachusetts: "MA",
653
+ Michigan: "MI",
654
+ Minnesota: "MN",
655
+ Mississippi: "MS",
656
+ Missouri: "MO",
657
+ Montana: "MT",
658
+ Nebraska: "NE",
659
+ Nevada: "NV",
660
+ NewHampshire: "NH",
661
+ NewJersey: "NJ",
662
+ NewMexico: "NM",
663
+ NewYork: "NY",
664
+ NorthCarolina: "NC",
665
+ NorthDakota: "ND",
666
+ Ohio: "OH",
667
+ Oklahoma: "OK",
668
+ Oregon: "OR",
669
+ Pennsylvania: "PA",
670
+ RhodeIsland: "RI",
671
+ SouthCarolina: "SC",
672
+ SouthDakota: "SD",
673
+ Tennessee: "TN",
674
+ Texas: "TX",
675
+ Utah: "UT",
676
+ Vermont: "VT",
677
+ Virginia: "VA",
678
+ Washington: "WA",
679
+ WestVirginia: "WV",
680
+ Wisconsin: "WI",
681
+ Wyoming: "WY"
682
+ };
683
+ const businessRegistrationNumberMasks = {
684
+ [CountryCodes.Austria]: {
685
+ firmenbuchnummer: {
686
+ mask: makeMask(
687
+ {
688
+ type: "input",
689
+ allow: /[TF]/
690
+ },
691
+ {
692
+ type: "input",
693
+ allow: /N/,
694
+ optional: true
695
+ },
696
+ ...numericInputs(3),
697
+ ...numericInputs(3, true),
698
+ { type: "input", allow: /[a-z]/ }
699
+ )
700
+ },
701
+ ZVR: {
702
+ mask: makeMask(
703
+ ...nonInputs("AT", { includeInValue: true }),
704
+ spacer,
705
+ ...nonInputs("-", { includeInValue: true }),
706
+ spacer,
707
+ ...nonInputs("ZVR", { includeInValue: true }),
708
+ spacer,
709
+ ...nonInputs("-", { includeInValue: true }),
710
+ spacer,
711
+ ...numericInputs(9),
712
+ ...numericInputs(1, true)
713
+ )
714
+ }
715
+ },
716
+ [CountryCodes.Australia]: {
717
+ default: {
718
+ mask: makeMask(...numericInputs(3), spacer, ...numericInputs(3), spacer, ...numericInputs(3))
719
+ },
720
+ associationIncorporated: {
721
+ mask: makeMask(...alphanumericInputs(3), ...alphanumericInputs(20, true)),
722
+ transformOnType: uppercase
723
+ }
724
+ },
725
+ [CountryCodes.Belgium]: { default: { mask: makeMask(...numericInputs(10)) } },
726
+ [CountryCodes.Brazil]: {
727
+ default: {
728
+ mask: makeMask(
729
+ ...numericInputs(2),
730
+ ...nonInputs(" . "),
731
+ ...numericInputs(3),
732
+ ...nonInputs(" . "),
733
+ ...numericInputs(3),
734
+ ...nonInputs(" / "),
735
+ ...numericInputs(4),
736
+ ...nonInputs(" - "),
737
+ ...numericInputs(2)
738
+ )
739
+ }
740
+ },
741
+ [CountryCodes.Bulgaria]: { default: { mask: makeMask(...numericInputs(9)) } },
742
+ [CountryCodes.Canada]: {
743
+ default: {
744
+ mask: makeMask(...alphanumericInputs(5), ...alphanumericInputs(5, true)),
745
+ transformOnType: uppercase
746
+ }
747
+ },
748
+ [CountryCodes.Croatia]: {
749
+ default: {
750
+ mask: makeMask(...numericInputs(9))
751
+ },
752
+ [CompanyTypesValues.SOLE_PROPRIETORSHIP]: {
753
+ mask: makeMask(...numericInputs(8))
754
+ }
755
+ },
756
+ [CountryCodes.Cyprus]: {
757
+ default: {
758
+ mask: makeMask(...customInputs(1, /^[COP]$/), ...numericInputs(1), ...numericInputs(7, true)),
759
+ transformOnType: uppercase
760
+ }
761
+ },
762
+ [CountryCodes.CzechRepublic]: {
763
+ default: { mask: makeMask(...numericInputs(8), ...numericInputs(2, true)) }
764
+ },
765
+ [CountryCodes.Denmark]: { default: { mask: makeMask(...numericInputs(8)) } },
766
+ [CountryCodes.Estonia]: { default: { mask: makeMask(...numericInputs(8)) } },
767
+ [CountryCodes.Finland]: {
768
+ default: {
769
+ mask: makeMask(
770
+ ...numericInputs(7),
771
+ spacer,
772
+ ...nonInputs("-", { includeInValue: true }),
773
+ spacer,
774
+ ...numericInputs(1)
775
+ )
776
+ }
777
+ },
778
+ [CountryCodes.France]: {
779
+ SIRET: { mask: makeMask(...numericInputs(9), ...nonInputs(" - "), ...numericInputs(5)) },
780
+ RNA: {
781
+ mask: makeMask(
782
+ ...nonInputs("W", { includeInValue: true }),
783
+ ...numericInputs(1),
784
+ ...alphanumericInputs(1),
785
+ ...numericInputs(7)
786
+ )
787
+ }
788
+ },
789
+ [CountryCodes.Germany]: {
790
+ default: {
791
+ mask: makeMask(...alphanumericInputs(3), ...customInputs(17, /[A-Z0-9-]/, true)),
792
+ transformOnType: uppercase
793
+ }
794
+ },
795
+ [CountryCodes.Gibraltar]: {
796
+ default: {
797
+ mask: makeMask(...alphanumericInputs(1), ...alphanumericInputs(7, true)),
798
+ transformOnType: uppercase
799
+ }
800
+ },
801
+ [CountryCodes.Greece]: { default: { mask: makeMask(...numericInputs(12)) } },
802
+ [CountryCodes.Guernsey]: {
803
+ default: { mask: makeMask(...numericInputs(1), ...numericInputs(8, true)) }
804
+ },
805
+ [CountryCodes.HongKong]: { default: { mask: makeMask(...numericInputs(7)) } },
806
+ [CountryCodes.Hungary]: {
807
+ default: {
808
+ mask: makeMask(
809
+ ...numericInputs(2),
810
+ ...nonInputs(" - "),
811
+ ...numericInputs(2),
812
+ ...nonInputs(" - "),
813
+ ...numericInputs(6)
814
+ )
815
+ },
816
+ nyilvantartasiSzam: {
817
+ mask: makeMask(...numericInputs(10))
818
+ }
819
+ },
820
+ [CountryCodes.Ireland]: {
821
+ default: { mask: makeMask(...numericInputs(1), ...numericInputs(7, true)) }
822
+ },
823
+ [CountryCodes.IsleOfMan]: {
824
+ default: { mask: makeMask(...numericInputs(6), ...alphaInputs(1)), transformOnType: uppercase }
825
+ },
826
+ [CountryCodes.Italy]: {
827
+ partitaIVA: { mask: makeMask(...numericInputs(11)) },
828
+ CCIAA: {
829
+ mask: makeMask(...alphaInputs(2), ...numericInputs(6), ...numericInputs(1, true)),
830
+ transformOnType: uppercase
831
+ }
832
+ },
833
+ [CountryCodes.Japan]: {
834
+ default: { mask: makeMask(...numericInputs(12)) }
835
+ },
836
+ [CountryCodes.Jersey]: {
837
+ default: {
838
+ mask: makeMask(...alphanumericInputs(1), ...alphanumericInputs(8, true)),
839
+ transformOnType: uppercase
840
+ }
841
+ },
842
+ [CountryCodes.Latvia]: { default: { mask: makeMask(...numericInputs(11)) } },
843
+ [CountryCodes.Liechtenstein]: {
844
+ default: {
845
+ mask: makeMask(
846
+ ...nonInputs("FL", { includeInValue: true }),
847
+ spacer,
848
+ ...nonInputs("-", { includeInValue: true }),
849
+ spacer,
850
+ ...numericInputs(4),
851
+ spacer,
852
+ ...nonInputs(".", { includeInValue: true }),
853
+ spacer,
854
+ ...numericInputs(3),
855
+ spacer,
856
+ ...nonInputs(".", { includeInValue: true }),
857
+ spacer,
858
+ ...numericInputs(3),
859
+ spacer,
860
+ ...nonInputs("-", { includeInValue: true }),
861
+ spacer,
862
+ ...numericInputs(1)
863
+ )
864
+ }
865
+ },
866
+ [CountryCodes.Lithuania]: {
867
+ default: { mask: makeMask(...numericInputs(6), ...numericInputs(3, true)) }
868
+ },
869
+ [CountryCodes.Luxembourg]: {
870
+ default: {
871
+ mask: makeMask(...alphaInputs(1), ...numericInputs(9, true)),
872
+ transformOnType: uppercase
873
+ }
874
+ },
875
+ [CountryCodes.Malaysia]: {
876
+ default: { mask: makeMask(...numericInputs(7), ...numericInputs(5, true)) }
877
+ },
878
+ [CountryCodes.Malta]: {
879
+ default: {
880
+ mask: makeMask(
881
+ ...customInputs(1, /[CP]/),
882
+ spacer,
883
+ ...numericInputs(4),
884
+ ...numericInputs(2, true)
885
+ ),
886
+ transformOnType: uppercase
887
+ }
888
+ },
889
+ [CountryCodes.Mexico]: { default: { mask: makeMask(...alphanumericInputs(12)) } },
890
+ [CountryCodes.Monaco]: {
891
+ default: {
892
+ mask: makeMask(...alphanumericInputs(8), ...alphanumericInputs(3, true)),
893
+ transformOnType: uppercase
894
+ },
895
+ [CompanyTypesValues.SOLE_PROPRIETORSHIP]: {
896
+ mask: makeMask(...alphanumericInputs(8), ...alphanumericInputs(3, true)),
897
+ transformOnType: uppercase
898
+ }
899
+ },
900
+ [CountryCodes.Netherlands]: { default: { mask: makeMask(...numericInputs(8)) } },
901
+ [CountryCodes.NewZealand]: {
902
+ NZBN: { mask: makeMask(...numericInputs(13)) },
903
+ companyNumberNZ: { mask: makeMask(...numericInputs(7)) }
904
+ },
905
+ [CountryCodes.Norway]: { default: { mask: makeMask(...numericInputs(9)) } },
906
+ [CountryCodes.Poland]: {
907
+ krsNumber: { mask: makeMask(...numericInputs(10)) },
908
+ regon: { mask: makeMask(...numericInputs(9)) }
909
+ },
910
+ [CountryCodes.Portugal]: { default: { mask: makeMask(...numericInputs(9)) } },
911
+ [CountryCodes.Romania]: {
912
+ roRegNumberOldFormat: {
913
+ mask: makeMask(
914
+ ...alphaInputs(1),
915
+ ...numericInputs(1),
916
+ ...numericInputs(1, true),
917
+ ...customInputs(1, /[/]/),
918
+ ...numericInputs(1),
919
+ ...numericInputs(8, true),
920
+ ...customInputs(1, /[/]/),
921
+ ...numericInputs(4)
922
+ ),
923
+ transformOnType: uppercase
924
+ },
925
+ roRegNumberNewFormat: {
926
+ mask: makeMask(
927
+ {
928
+ type: "input",
929
+ allow: /[JFC]/
930
+ },
931
+ ...numericInputs(13)
932
+ ),
933
+ transformOnType: uppercase
934
+ }
935
+ },
936
+ [CountryCodes.Singapore]: {
937
+ default: {
938
+ mask: makeMask(...alphanumericInputs(9), ...alphanumericInputs(1, true)),
939
+ transformOnType: uppercase
940
+ }
941
+ },
942
+ [CountryCodes.Slovakia]: { default: { mask: makeMask(...numericInputs(8)) } },
943
+ [CountryCodes.Slovenia]: { default: { mask: makeMask(...numericInputs(10)) } },
944
+ [CountryCodes.Spain]: {
945
+ default: {
946
+ mask: makeMask(...alphaInputs(1), ...alphanumericInputs(8)),
947
+ transformOnType: uppercase
948
+ }
949
+ },
950
+ [CountryCodes.Sweden]: {
951
+ default: { mask: makeMask(...numericInputs(6), ...nonInputs(" - "), ...numericInputs(4)) }
952
+ },
953
+ [CountryCodes.Switzerland]: {
954
+ default: {
955
+ mask: makeMask(
956
+ ...nonInputs("CHE", { includeInValue: true }),
957
+ ...nonInputs(" - "),
958
+ ...numericInputs(3),
959
+ ...nonInputs(" . "),
960
+ ...numericInputs(3),
961
+ ...nonInputs(" . "),
962
+ ...numericInputs(3)
963
+ )
964
+ }
965
+ },
966
+ [CountryCodes.UnitedKingdom]: {
967
+ default: { mask: makeMask(...alphanumericInputs(8)), transformOnType: uppercase },
968
+ nonProfit: {
969
+ mask: makeMask(
970
+ ...alphanumericInputs(6),
971
+ ...customInputs(1, /[a-zA-Z0-9-]/, true),
972
+ ...alphanumericInputs(1, true)
973
+ ),
974
+ transformOnType: uppercase
975
+ }
976
+ },
977
+ [CountryCodes.UnitedStates]: {
978
+ [StateCodesUS.Alabama]: {
979
+ mask: makeMask(...numericInputs(9), ...nonInputs(" "), ...nonInputs(StateCodesUS.Alabama)),
980
+ transformOnType: uppercase
981
+ },
982
+ [StateCodesUS.Alaska]: {
983
+ mask: makeMask(...numericInputs(8), ...nonInputs(" "), ...nonInputs(StateCodesUS.Alaska)),
984
+ transformOnType: uppercase
985
+ },
986
+ [StateCodesUS.Arizona]: {
987
+ mask: makeMask(...numericInputs(8), ...nonInputs(" "), ...nonInputs(StateCodesUS.Arizona)),
988
+ transformOnType: uppercase
989
+ },
990
+ [StateCodesUS.Arkansas]: {
991
+ mask: makeMask(
992
+ {
993
+ type: "input",
994
+ allow: /[8]/
995
+ },
996
+ ...numericInputs(8),
997
+ ...nonInputs(" "),
998
+ ...nonInputs(StateCodesUS.Arkansas)
999
+ ),
1000
+ transformOnType: uppercase
1001
+ },
1002
+ [StateCodesUS.California]: {
1003
+ mask: makeMask(
1004
+ ...numericInputs(7),
1005
+ ...numericInputs(5, true),
1006
+ ...nonInputs(" "),
1007
+ ...nonInputs(StateCodesUS.California)
1008
+ ),
1009
+ transformOnType: uppercase
1010
+ },
1011
+ [StateCodesUS.Colorado]: {
1012
+ mask: makeMask(...numericInputs(11), ...nonInputs(" "), ...nonInputs(StateCodesUS.Colorado)),
1013
+ transformOnType: uppercase
1014
+ },
1015
+ [StateCodesUS.Connecticut]: {
1016
+ mask: makeMask(
1017
+ ...numericInputs(7),
1018
+ ...nonInputs(" "),
1019
+ ...nonInputs(StateCodesUS.Connecticut)
1020
+ ),
1021
+ transformOnType: uppercase
1022
+ },
1023
+ [StateCodesUS.Delaware]: {
1024
+ mask: makeMask(...numericInputs(7), ...nonInputs(" "), ...nonInputs(StateCodesUS.Delaware)),
1025
+ transformOnType: uppercase
1026
+ },
1027
+ [StateCodesUS.Florida]: {
1028
+ mask: makeMask(
1029
+ ...numericInputs(6),
1030
+ ...numericInputs(6, true),
1031
+ ...nonInputs(" "),
1032
+ ...nonInputs(StateCodesUS.Florida)
1033
+ ),
1034
+ transformOnType: uppercase
1035
+ },
1036
+ [StateCodesUS.Georgia]: {
1037
+ mask: makeMask(...numericInputs(8), ...nonInputs(" "), ...nonInputs(StateCodesUS.Georgia)),
1038
+ transformOnType: uppercase
1039
+ },
1040
+ [StateCodesUS.Hawaii]: {
1041
+ mask: makeMask(
1042
+ ...numericInputs(5),
1043
+ ...numericInputs(3, true),
1044
+ {
1045
+ type: "input",
1046
+ allow: /[CDFLNPTZ]/
1047
+ },
1048
+ {
1049
+ type: "input",
1050
+ allow: /[1-8Z]/
1051
+ },
1052
+ ...nonInputs(" "),
1053
+ ...nonInputs(StateCodesUS.Hawaii)
1054
+ ),
1055
+ transformOnType: uppercase
1056
+ },
1057
+ [StateCodesUS.Idaho]: {
1058
+ mask: makeMask(...numericInputs(6), ...nonInputs(" "), ...nonInputs(StateCodesUS.Idaho)),
1059
+ transformOnType: uppercase
1060
+ },
1061
+ [StateCodesUS.Illinois]: {
1062
+ mask: makeMask(...numericInputs(8), ...nonInputs(" "), ...nonInputs(StateCodesUS.Illinois)),
1063
+ transformOnType: uppercase
1064
+ },
1065
+ [StateCodesUS.Indiana]: {
1066
+ mask: makeMask(...numericInputs(10), ...nonInputs(" "), ...nonInputs(StateCodesUS.Indiana)),
1067
+ transformOnType: uppercase
1068
+ },
1069
+ [StateCodesUS.Iowa]: {
1070
+ mask: makeMask(
1071
+ ...numericInputs(6),
1072
+ ...numericInputs(2, true),
1073
+ ...nonInputs(" "),
1074
+ ...nonInputs(StateCodesUS.Iowa)
1075
+ ),
1076
+ transformOnType: uppercase
1077
+ },
1078
+ [StateCodesUS.Kansas]: {
1079
+ mask: makeMask(
1080
+ ...numericInputs(7),
1081
+ ...numericInputs(2, true),
1082
+ ...nonInputs(" "),
1083
+ ...nonInputs(StateCodesUS.Kansas)
1084
+ ),
1085
+ transformOnType: uppercase
1086
+ },
1087
+ [StateCodesUS.Kentucky]: {
1088
+ mask: makeMask(
1089
+ ...numericInputs(9),
1090
+ ...numericInputs(1, true),
1091
+ ...nonInputs(" "),
1092
+ ...nonInputs(StateCodesUS.Kentucky)
1093
+ ),
1094
+ transformOnType: uppercase
1095
+ },
1096
+ [StateCodesUS.Louisiana]: {
1097
+ mask: makeMask(
1098
+ ...numericInputs(9),
1099
+ ...numericInputs(1, true),
1100
+ ...nonInputs(" "),
1101
+ ...nonInputs(StateCodesUS.Louisiana)
1102
+ ),
1103
+ transformOnType: uppercase
1104
+ },
1105
+ [StateCodesUS.Maine]: {
1106
+ mask: makeMask(...numericInputs(8), ...nonInputs(" "), ...nonInputs(StateCodesUS.Maine)),
1107
+ transformOnType: uppercase
1108
+ },
1109
+ [StateCodesUS.Maryland]: {
1110
+ mask: makeMask(...numericInputs(8), ...nonInputs(" "), ...nonInputs(StateCodesUS.Maryland)),
1111
+ transformOnType: uppercase
1112
+ },
1113
+ [StateCodesUS.Massachusetts]: {
1114
+ mask: makeMask(
1115
+ ...numericInputs(10),
1116
+ ...nonInputs(" "),
1117
+ ...nonInputs(StateCodesUS.Massachusetts)
1118
+ ),
1119
+ transformOnType: uppercase
1120
+ },
1121
+ [StateCodesUS.Michigan]: {
1122
+ mask: makeMask(
1123
+ ...numericInputs(6),
1124
+ ...numericInputs(3, true),
1125
+ ...nonInputs(" "),
1126
+ ...nonInputs(StateCodesUS.Michigan)
1127
+ ),
1128
+ transformOnType: uppercase
1129
+ },
1130
+ [StateCodesUS.Minnesota]: {
1131
+ mask: makeMask(...numericInputs(7), ...nonInputs(" "), ...nonInputs(StateCodesUS.Minnesota)),
1132
+ transformOnType: uppercase
1133
+ },
1134
+ [StateCodesUS.Mississippi]: {
1135
+ mask: makeMask(
1136
+ ...numericInputs(7),
1137
+ ...numericInputs(3, true),
1138
+ ...nonInputs(" "),
1139
+ ...nonInputs(StateCodesUS.Mississippi)
1140
+ ),
1141
+ transformOnType: uppercase
1142
+ },
1143
+ [StateCodesUS.Missouri]: {
1144
+ mask: makeMask(...numericInputs(10), ...nonInputs(" "), ...nonInputs(StateCodesUS.Missouri)),
1145
+ transformOnType: uppercase
1146
+ },
1147
+ [StateCodesUS.Montana]: {
1148
+ mask: makeMask(...numericInputs(7), ...nonInputs(" "), ...nonInputs(StateCodesUS.Montana)),
1149
+ transformOnType: uppercase
1150
+ },
1151
+ [StateCodesUS.Nebraska]: {
1152
+ mask: makeMask(
1153
+ ...numericInputs(9),
1154
+ ...numericInputs(2, true),
1155
+ ...nonInputs(" "),
1156
+ ...nonInputs(StateCodesUS.Nebraska)
1157
+ ),
1158
+ transformOnType: uppercase
1159
+ },
1160
+ [StateCodesUS.Nevada]: {
1161
+ mask: makeMask(
1162
+ ...numericInputs(9),
1163
+ ...numericInputs(2, true),
1164
+ ...nonInputs(" "),
1165
+ ...nonInputs(StateCodesUS.Nevada)
1166
+ ),
1167
+ transformOnType: uppercase
1168
+ },
1169
+ [StateCodesUS.NewHampshire]: {
1170
+ mask: makeMask(
1171
+ ...numericInputs(9),
1172
+ ...nonInputs(" "),
1173
+ ...nonInputs(StateCodesUS.NewHampshire)
1174
+ ),
1175
+ transformOnType: uppercase
1176
+ },
1177
+ [StateCodesUS.NewJersey]: {
1178
+ mask: makeMask(...numericInputs(10), ...nonInputs(" "), ...nonInputs(StateCodesUS.NewJersey)),
1179
+ transformOnType: uppercase
1180
+ },
1181
+ [StateCodesUS.NewMexico]: {
1182
+ mask: makeMask(...numericInputs(6), ...nonInputs(" "), ...nonInputs(StateCodesUS.NewMexico)),
1183
+ transformOnType: uppercase
1184
+ },
1185
+ [StateCodesUS.NewYork]: {
1186
+ mask: makeMask(...numericInputs(7), ...nonInputs(" "), ...nonInputs(StateCodesUS.NewYork)),
1187
+ transformOnType: uppercase
1188
+ },
1189
+ [StateCodesUS.NorthCarolina]: {
1190
+ mask: makeMask(
1191
+ ...numericInputs(7),
1192
+ ...nonInputs(" "),
1193
+ ...nonInputs(StateCodesUS.NorthCarolina)
1194
+ ),
1195
+ transformOnType: uppercase
1196
+ },
1197
+ [StateCodesUS.NorthDakota]: {
1198
+ mask: makeMask(
1199
+ ...numericInputs(7),
1200
+ ...numericInputs(3, true),
1201
+ ...nonInputs(" "),
1202
+ ...nonInputs(StateCodesUS.NorthDakota)
1203
+ ),
1204
+ transformOnType: uppercase
1205
+ },
1206
+ [StateCodesUS.Ohio]: {
1207
+ mask: makeMask(...numericInputs(10), ...nonInputs(" "), ...nonInputs(StateCodesUS.Ohio)),
1208
+ transformOnType: uppercase
1209
+ },
1210
+ [StateCodesUS.Oklahoma]: {
1211
+ mask: makeMask(...numericInputs(10), ...nonInputs(" "), ...nonInputs(StateCodesUS.Oklahoma)),
1212
+ transformOnType: uppercase
1213
+ },
1214
+ [StateCodesUS.Oregon]: {
1215
+ mask: makeMask(...numericInputs(9), ...nonInputs(" "), ...nonInputs(StateCodesUS.Oregon)),
1216
+ transformOnType: uppercase
1217
+ },
1218
+ [StateCodesUS.Pennsylvania]: {
1219
+ mask: makeMask(
1220
+ ...numericInputs(7),
1221
+ ...nonInputs(" "),
1222
+ ...nonInputs(StateCodesUS.Pennsylvania)
1223
+ ),
1224
+ transformOnType: uppercase
1225
+ },
1226
+ [StateCodesUS.RhodeIsland]: {
1227
+ mask: makeMask(
1228
+ ...numericInputs(7),
1229
+ ...nonInputs(" "),
1230
+ ...nonInputs(StateCodesUS.RhodeIsland)
1231
+ ),
1232
+ transformOnType: uppercase
1233
+ },
1234
+ [StateCodesUS.SouthCarolina]: {
1235
+ mask: makeMask(
1236
+ ...numericInputs(7),
1237
+ ...nonInputs(" "),
1238
+ ...nonInputs(StateCodesUS.SouthCarolina)
1239
+ ),
1240
+ transformOnType: uppercase
1241
+ },
1242
+ [StateCodesUS.SouthDakota]: {
1243
+ mask: makeMask(
1244
+ ...numericInputs(7),
1245
+ ...nonInputs(" "),
1246
+ ...nonInputs(StateCodesUS.SouthDakota)
1247
+ ),
1248
+ transformOnType: uppercase
1249
+ },
1250
+ [StateCodesUS.Tennessee]: {
1251
+ mask: makeMask(...numericInputs(6), ...nonInputs(" "), ...nonInputs(StateCodesUS.Tennessee)),
1252
+ transformOnType: uppercase
1253
+ },
1254
+ [StateCodesUS.Texas]: {
1255
+ mask: makeMask(...numericInputs(10), ...nonInputs(" "), ...nonInputs(StateCodesUS.Texas)),
1256
+ transformOnType: uppercase
1257
+ },
1258
+ [StateCodesUS.Utah]: {
1259
+ mask: makeMask(...numericInputs(7), ...nonInputs(" "), ...nonInputs(StateCodesUS.Utah)),
1260
+ transformOnType: uppercase
1261
+ },
1262
+ [StateCodesUS.Vermont]: {
1263
+ mask: makeMask(...numericInputs(6), ...nonInputs(" "), ...nonInputs(StateCodesUS.Vermont)),
1264
+ transformOnType: uppercase
1265
+ },
1266
+ [StateCodesUS.Virginia]: {
1267
+ mask: makeMask(...numericInputs(7), ...nonInputs(" "), ...nonInputs(StateCodesUS.Virginia)),
1268
+ transformOnType: uppercase
1269
+ },
1270
+ [StateCodesUS.Washington]: {
1271
+ mask: makeMask(...numericInputs(9), ...nonInputs(" "), ...nonInputs(StateCodesUS.Washington)),
1272
+ transformOnType: uppercase
1273
+ },
1274
+ [StateCodesUS.WestVirginia]: {
1275
+ mask: makeMask(
1276
+ ...numericInputs(6),
1277
+ ...nonInputs(" "),
1278
+ ...nonInputs(StateCodesUS.WestVirginia)
1279
+ ),
1280
+ transformOnType: uppercase
1281
+ },
1282
+ [StateCodesUS.Wisconsin]: {
1283
+ mask: makeMask(...numericInputs(6), ...nonInputs(" "), ...nonInputs(StateCodesUS.Wisconsin)),
1284
+ transformOnType: uppercase
1285
+ },
1286
+ [StateCodesUS.Wyoming]: {
1287
+ mask: makeMask(...numericInputs(6), ...nonInputs(" "), ...nonInputs(StateCodesUS.Wyoming)),
1288
+ transformOnType: uppercase
1289
+ },
1290
+ [StateCodesUS.DistrictOfColumbia]: {
1291
+ mask: makeMask(...numericInputs(9)),
1292
+ transformOnType: uppercase
1293
+ },
1294
+ default: {
1295
+ mask: makeMask(...numericInputs(9)),
1296
+ transformOnType: uppercase
1297
+ }
1298
+ }
1299
+ };
1300
+ const stateFormatGuidanceText = {
1301
+ [StateCodesUS.Alabama]: {
1302
+ key: "enterNDigitsForExample",
1303
+ values: {
1304
+ numDigits: "9",
1305
+ example: "123456789 AL"
1306
+ }
1307
+ },
1308
+ [StateCodesUS.Alaska]: {
1309
+ key: "enterNDigitsForExample",
1310
+ values: {
1311
+ numDigits: "8",
1312
+ example: "12345678 AK"
1313
+ }
1314
+ },
1315
+ [StateCodesUS.Arizona]: {
1316
+ key: "enterNDigitsForExample",
1317
+ values: {
1318
+ numDigits: "8",
1319
+ example: "12345678 AZ"
1320
+ }
1321
+ },
1322
+ [StateCodesUS.Arkansas]: {
1323
+ key: "enterTheRemainingNDigitsForExample",
1324
+ values: {
1325
+ numDigits: "8",
1326
+ example: "800000001 AR"
1327
+ }
1328
+ },
1329
+ [StateCodesUS.California]: {
1330
+ key: "enterXOrYDigitsForExample",
1331
+ values: {
1332
+ xDigits: "8",
1333
+ yDigits: "12",
1334
+ example: "12345678 CA"
1335
+ }
1336
+ },
1337
+ [StateCodesUS.Colorado]: {
1338
+ key: "enterNDigitsForExample",
1339
+ values: {
1340
+ numDigits: "11",
1341
+ example: "12345678901 CO"
1342
+ }
1343
+ },
1344
+ [StateCodesUS.Connecticut]: {
1345
+ key: "enterNDigitsForExample",
1346
+ values: {
1347
+ numDigits: "7",
1348
+ example: "1234567 CT"
1349
+ }
1350
+ },
1351
+ [StateCodesUS.Delaware]: {
1352
+ key: "enterNDigitsForExample",
1353
+ values: {
1354
+ numDigits: "7",
1355
+ example: "1234567 DE"
1356
+ }
1357
+ },
1358
+ [StateCodesUS.Florida]: {
1359
+ key: "enterXOrYDigitsForExample",
1360
+ values: {
1361
+ xDigits: "6",
1362
+ yDigits: "12",
1363
+ example: "123456789012 FL"
1364
+ }
1365
+ },
1366
+ [StateCodesUS.Georgia]: {
1367
+ key: "enterNDigitsForExample",
1368
+ values: {
1369
+ numDigits: "8",
1370
+ example: "12345678 GA"
1371
+ }
1372
+ },
1373
+ [StateCodesUS.Hawaii]: {
1374
+ key: "validationPleaseEnterAValidBusinessRegistrationNumberWithFormat",
1375
+ values: {
1376
+ example: "12345678ZZ HI"
1377
+ }
1378
+ },
1379
+ [StateCodesUS.Idaho]: {
1380
+ key: "enterNDigitsForExample",
1381
+ values: {
1382
+ numDigits: "6",
1383
+ example: "123456 ID"
1384
+ }
1385
+ },
1386
+ [StateCodesUS.Illinois]: {
1387
+ key: "enterNDigitsForExample",
1388
+ values: {
1389
+ numDigits: "8",
1390
+ example: "12345678 IL"
1391
+ }
1392
+ },
1393
+ [StateCodesUS.Indiana]: {
1394
+ key: "enterNDigitsForExample",
1395
+ values: {
1396
+ numDigits: "10",
1397
+ example: "1234567890 IN"
1398
+ }
1399
+ },
1400
+ [StateCodesUS.Iowa]: {
1401
+ key: "enterXToYDigitsForExample",
1402
+ values: {
1403
+ minDigits: "6",
1404
+ maxDigits: "8",
1405
+ example: "12345678 IA"
1406
+ }
1407
+ },
1408
+ [StateCodesUS.Kansas]: {
1409
+ key: "enterXToYDigitsForExample",
1410
+ values: {
1411
+ minDigits: "7",
1412
+ maxDigits: "9",
1413
+ example: "1234567890 KS"
1414
+ }
1415
+ },
1416
+ [StateCodesUS.Kentucky]: {
1417
+ key: "enterXToYDigitsForExample",
1418
+ values: {
1419
+ minDigits: "9",
1420
+ maxDigits: "10",
1421
+ example: "1234567890 KY"
1422
+ }
1423
+ },
1424
+ [StateCodesUS.Louisiana]: {
1425
+ key: "enterXToYDigitsForExample",
1426
+ values: {
1427
+ minDigits: "9",
1428
+ maxDigits: "10",
1429
+ example: "1234567890 LA"
1430
+ }
1431
+ },
1432
+ [StateCodesUS.Maine]: {
1433
+ key: "enterNDigitsForExample",
1434
+ values: {
1435
+ numDigits: "8",
1436
+ example: "12345678 ME"
1437
+ }
1438
+ },
1439
+ [StateCodesUS.Maryland]: {
1440
+ key: "enterNDigitsForExample",
1441
+ values: {
1442
+ numDigits: "8",
1443
+ example: "12345678 MD"
1444
+ }
1445
+ },
1446
+ [StateCodesUS.Massachusetts]: {
1447
+ key: "enterNDigitsForExample",
1448
+ values: {
1449
+ numDigits: "10",
1450
+ example: "1234567890 MA"
1451
+ }
1452
+ },
1453
+ [StateCodesUS.Michigan]: {
1454
+ key: "enterXOrYDigitsForExample",
1455
+ values: {
1456
+ xDigits: "6",
1457
+ yDigits: "9",
1458
+ example: "123456 MI"
1459
+ }
1460
+ },
1461
+ [StateCodesUS.Minnesota]: {
1462
+ key: "enterNDigitsForExample",
1463
+ values: {
1464
+ numDigits: "7",
1465
+ example: "1234567 MN"
1466
+ }
1467
+ },
1468
+ [StateCodesUS.Mississippi]: {
1469
+ key: "enterXToYDigitsForExample",
1470
+ values: {
1471
+ minDigits: "7",
1472
+ maxDigits: "10",
1473
+ example: "1234567 MS"
1474
+ }
1475
+ },
1476
+ [StateCodesUS.Missouri]: {
1477
+ key: "enterNDigitsForExample",
1478
+ values: {
1479
+ numDigits: "10",
1480
+ example: "1234567890 MO"
1481
+ }
1482
+ },
1483
+ [StateCodesUS.Montana]: {
1484
+ key: "enterNDigitsForExample",
1485
+ values: {
1486
+ numDigits: "7",
1487
+ example: "1234567 MT"
1488
+ }
1489
+ },
1490
+ [StateCodesUS.Nebraska]: {
1491
+ key: "enterXToYDigitsForExample",
1492
+ values: {
1493
+ minDigits: "9",
1494
+ maxDigits: "11",
1495
+ example: "123456789 NE"
1496
+ }
1497
+ },
1498
+ [StateCodesUS.Nevada]: {
1499
+ key: "enterXToYDigitsForExample",
1500
+ values: {
1501
+ minDigits: "9",
1502
+ maxDigits: "11",
1503
+ example: "123456789 NV"
1504
+ }
1505
+ },
1506
+ [StateCodesUS.NewHampshire]: {
1507
+ key: "enterNDigitsForExample",
1508
+ values: {
1509
+ numDigits: "9",
1510
+ example: "123456789 NH"
1511
+ }
1512
+ },
1513
+ [StateCodesUS.NewJersey]: {
1514
+ key: "enterNDigitsForExample",
1515
+ values: {
1516
+ numDigits: "10",
1517
+ example: "1234567890 NJ"
1518
+ }
1519
+ },
1520
+ [StateCodesUS.NewMexico]: {
1521
+ key: "enterNDigitsForExample",
1522
+ values: {
1523
+ numDigits: "6",
1524
+ example: "123456 NM"
1525
+ }
1526
+ },
1527
+ [StateCodesUS.NewYork]: {
1528
+ key: "enterNDigitsForExample",
1529
+ values: {
1530
+ numDigits: "7",
1531
+ example: "1234567 NY"
1532
+ }
1533
+ },
1534
+ [StateCodesUS.NorthCarolina]: {
1535
+ key: "enterNDigitsForExample",
1536
+ values: {
1537
+ numDigits: "7",
1538
+ example: "1234567 NC"
1539
+ }
1540
+ },
1541
+ [StateCodesUS.NorthDakota]: {
1542
+ key: "enterXToYDigitsForExample",
1543
+ values: {
1544
+ minDigits: "7",
1545
+ maxDigits: "10",
1546
+ example: "1234567 ND"
1547
+ }
1548
+ },
1549
+ [StateCodesUS.Ohio]: {
1550
+ key: "enterNDigitsForExample",
1551
+ values: {
1552
+ numDigits: "10",
1553
+ example: "1234567890 OH"
1554
+ }
1555
+ },
1556
+ [StateCodesUS.Oklahoma]: {
1557
+ key: "enterNDigitsForExample",
1558
+ values: {
1559
+ numDigits: "10",
1560
+ example: "1234567890 OK"
1561
+ }
1562
+ },
1563
+ [StateCodesUS.Oregon]: {
1564
+ key: "enterNDigitsForExample",
1565
+ values: {
1566
+ numDigits: "9",
1567
+ example: "123456789 OR"
1568
+ }
1569
+ },
1570
+ [StateCodesUS.Pennsylvania]: {
1571
+ key: "enterNDigitsForExample",
1572
+ values: {
1573
+ numDigits: "7",
1574
+ example: "1234567 PA"
1575
+ }
1576
+ },
1577
+ [StateCodesUS.RhodeIsland]: {
1578
+ key: "enterNDigitsForExample",
1579
+ values: {
1580
+ numDigits: "7",
1581
+ example: "1234567 RI"
1582
+ }
1583
+ },
1584
+ [StateCodesUS.SouthCarolina]: {
1585
+ key: "enterNDigitsForExample",
1586
+ values: {
1587
+ numDigits: "7",
1588
+ example: "1234567 SC"
1589
+ }
1590
+ },
1591
+ [StateCodesUS.SouthDakota]: {
1592
+ key: "enterNDigitsForExample",
1593
+ values: {
1594
+ numDigits: "7",
1595
+ example: "1234567 SD"
1596
+ }
1597
+ },
1598
+ [StateCodesUS.Tennessee]: {
1599
+ key: "enterNDigitsForExample",
1600
+ values: {
1601
+ numDigits: "6",
1602
+ example: "123456 TN"
1603
+ }
1604
+ },
1605
+ [StateCodesUS.Texas]: {
1606
+ key: "enterNDigitsForExample",
1607
+ values: {
1608
+ numDigits: "10",
1609
+ example: "1234567890 TX"
1610
+ }
1611
+ },
1612
+ [StateCodesUS.Utah]: {
1613
+ key: "enterNDigitsForExample",
1614
+ values: {
1615
+ numDigits: "7",
1616
+ example: "1234567 UT"
1617
+ }
1618
+ },
1619
+ [StateCodesUS.Vermont]: {
1620
+ key: "enterNDigitsForExample",
1621
+ values: {
1622
+ numDigits: "6",
1623
+ example: "123456 VT"
1624
+ }
1625
+ },
1626
+ [StateCodesUS.Virginia]: {
1627
+ key: "enterNDigitsForExample",
1628
+ values: {
1629
+ numDigits: "7",
1630
+ example: "1234567 VA"
1631
+ }
1632
+ },
1633
+ [StateCodesUS.Washington]: {
1634
+ key: "enterNDigitsForExample",
1635
+ values: {
1636
+ numDigits: "9",
1637
+ example: "123456789 WA"
1638
+ }
1639
+ },
1640
+ [StateCodesUS.WestVirginia]: {
1641
+ key: "enterNDigitsForExample",
1642
+ values: {
1643
+ numDigits: "6",
1644
+ example: "123456 WV"
1645
+ }
1646
+ },
1647
+ [StateCodesUS.Wisconsin]: {
1648
+ key: "enterNDigitsForExample",
1649
+ values: {
1650
+ numDigits: "6",
1651
+ example: "123456 WI"
1652
+ }
1653
+ },
1654
+ [StateCodesUS.Wyoming]: {
1655
+ key: "enterNDigitsForExample",
1656
+ values: {
1657
+ numDigits: "6",
1658
+ example: "123456 WY"
1659
+ }
1660
+ },
1661
+ [StateCodesUS.DistrictOfColumbia]: {
1662
+ key: "enterNDigitsForExample",
1663
+ values: {
1664
+ numDigits: "9",
1665
+ example: "123456789"
1666
+ }
1667
+ },
1668
+ default: {
1669
+ key: "enterNDigitsForExample",
1670
+ values: {
1671
+ numDigits: "9",
1672
+ example: "123456789"
1673
+ }
1674
+ }
1675
+ };
1676
+ const businessRegistrationNumberPatterns = {
1677
+ [CountryCodes.Australia]: { default: /^\d{9}$/, associationIncorporated: /^[a-zA-Z0-9]{3,20}$/ },
1678
+ [CountryCodes.Austria]: {
1679
+ firmenbuchnummer: /^(FN|T)\d{3,6}[a-z]$/,
1680
+ ZVR: /^(AT-ZVR-)\d{9,10}$/
1681
+ },
1682
+ [CountryCodes.Belgium]: { default: /^\d{10}$/ },
1683
+ [CountryCodes.Brazil]: { default: /^\d{14}$/ },
1684
+ [CountryCodes.Bulgaria]: { default: /^\d{9}$/ },
1685
+ [CountryCodes.Canada]: { default: /^[a-zA-Z0-9]{5,10}$/ },
1686
+ [CountryCodes.Croatia]: { default: /^\d{9}$/, soleProprietorship: /^\d{8}$/ },
1687
+ [CountryCodes.Cyprus]: { default: /^[COP]{1}\d{1,8}$/ },
1688
+ [CountryCodes.CzechRepublic]: { default: /^\d{8,10}$/ },
1689
+ [CountryCodes.Denmark]: { default: /^\d{8}$/ },
1690
+ [CountryCodes.Estonia]: { default: /^\d{8}$/ },
1691
+ [CountryCodes.Finland]: { default: /^\d{7}-?\d$/ },
1692
+ [CountryCodes.France]: {
1693
+ SIRET: /^\d{9}-?\d{5}$/,
1694
+ RNA: /^W(\d{9}|\d[A-Za-z]\d{7})$/
1695
+ },
1696
+ [CountryCodes.Gibraltar]: { default: /^[a-zA-Z0-9]{1,8}$/ },
1697
+ [CountryCodes.Germany]: { default: /^[A-Z]{2,3}\d{1,6}[A-Z]{0,5}(?:-[A-Z]\d{4})?$/ },
1698
+ [CountryCodes.Greece]: { default: /^\d{12}$/ },
1699
+ [CountryCodes.Guernsey]: { default: /^\d{1,9}$/ },
1700
+ [CountryCodes.HongKong]: { default: /^\d{7}$/ },
1701
+ [CountryCodes.Hungary]: { default: /^\d{10}$/, nyilvantartasiSzam: /^\d{7,10}$/ },
1702
+ [CountryCodes.Iceland]: { default: /^\d{10}$/ },
1703
+ [CountryCodes.India]: { default: /^\d{21}$/ },
1704
+ [CountryCodes.Indonesia]: { default: /^\d{12}$/ },
1705
+ [CountryCodes.Ireland]: { default: /^[1-9]\d{1,7}$/ },
1706
+ [CountryCodes.IsleOfMan]: { default: /^\d{6}[A-Z]$/ },
1707
+ [CountryCodes.Italy]: { partitaIVA: /^\d{11}$/, CCIAA: /^[a-zA-Z]{2}\d{6,7}$/ },
1708
+ [CountryCodes.Japan]: { default: /^\d{12}$/ },
1709
+ [CountryCodes.Jersey]: { default: /^[a-zA-Z0-9]{1,9}$/ },
1710
+ [CountryCodes.Korea]: { default: /^\d{10}$/ },
1711
+ [CountryCodes.Latvia]: { default: /^\d{11}$/ },
1712
+ [CountryCodes.Liechtenstein]: { default: /FL-[0-9]{4}[.][0-9]{3}[.][0-9]{3}-[0-9]$/ },
1713
+ [CountryCodes.Lithuania]: { default: /^\d{6,9}$/ },
1714
+ [CountryCodes.Luxembourg]: { default: /^[a-zA-Z]\d{1,9}$/ },
1715
+ [CountryCodes.Malaysia]: { default: /^\d{7}$|^\d{12}$/ },
1716
+ [CountryCodes.Malta]: { default: /^[CP]\s?\d{4,6}$/ },
1717
+ [CountryCodes.Mexico]: { default: /^\D{3}\d{6}\w{3}$/ },
1718
+ [CountryCodes.Monaco]: {
1719
+ default: /^[0-9]{2}[A-Z]{1,3}[0-9]{5}$/,
1720
+ soleProprietorship: /^\d{2,4}[A-Z]\d{5}$/
1721
+ },
1722
+ [CountryCodes.Netherlands]: { default: /^\d{8}$/ },
1723
+ [CountryCodes.NewZealand]: { NZBN: /^\d{13}$/, companyNumberNZ: /^\d{7}$/ },
1724
+ [CountryCodes.Norway]: { default: /^\d{9}$/ },
1725
+ [CountryCodes.Poland]: { krsNumber: /^\d{10}$/, regon: /^\d{9}$/ },
1726
+ [CountryCodes.Portugal]: { default: /^\d{9}$/ },
1727
+ [CountryCodes.Romania]: {
1728
+ roRegNumberOldFormat: /^[A-Z]\d{1,2}\/\d{1,9}\/\d{4}$/,
1729
+ roRegNumberNewFormat: /^[JFC]\d{13}$/
1730
+ },
1731
+ [CountryCodes.Singapore]: { default: /^[a-zA-Z0-9]{9,10}$/ },
1732
+ [CountryCodes.Slovakia]: { default: /^\d{8}$/ },
1733
+ [CountryCodes.Slovenia]: { default: /^\d{10}$/ },
1734
+ [CountryCodes.Spain]: { default: /^[a-zA-Z][a-zA-Z0-9]{8}$/ },
1735
+ [CountryCodes.Sweden]: { default: /^\d{10}$/ },
1736
+ [CountryCodes.Switzerland]: { default: /^CHE\d{9}$|^CH\d{11}$/ },
1737
+ [CountryCodes.UnitedKingdom]: {
1738
+ default: /^[a-zA-Z0-9]{8}$/,
1739
+ nonProfit: /^(?:(?:[A-Z]{2})?\d{6}|\d{6,8}|\d{6}-\d)$/
1740
+ },
1741
+ [CountryCodes.UnitedStates]: {
1742
+ [StateCodesUS.Alabama]: /^\d{9}$/,
1743
+ [StateCodesUS.Alaska]: /^\d{8}$/,
1744
+ [StateCodesUS.Arizona]: /^\d{8}$/,
1745
+ [StateCodesUS.Arkansas]: /^8\d{8}$/,
1746
+ [StateCodesUS.California]: /^\d{7}$|^\d{12}$/,
1747
+ [StateCodesUS.Colorado]: /^\d{11}$/,
1748
+ [StateCodesUS.Connecticut]: /^\d{7}$/,
1749
+ [StateCodesUS.Delaware]: /^\d{7}$/,
1750
+ [StateCodesUS.Florida]: /^\d{6}$|^\d{12}$/,
1751
+ [StateCodesUS.Georgia]: /^\d{8}$/,
1752
+ [StateCodesUS.Hawaii]: /^\d{5,8}(C1|C2|C3|C4|C5|D1|D2|D3|D4|F1|F2|L1|L2|N1|N2|P1|P2|T1|T2|T3|T4|T5|T6|T7|T8|ZZ)$/,
1753
+ [StateCodesUS.Idaho]: /^\d{6}$/,
1754
+ [StateCodesUS.Illinois]: /^\d{8}$/,
1755
+ [StateCodesUS.Indiana]: /^\d{10}$/,
1756
+ [StateCodesUS.Iowa]: /^\d{6,8}$/,
1757
+ [StateCodesUS.Kansas]: /^\d{7,9}$/,
1758
+ [StateCodesUS.Kentucky]: /^\d{9,10}$/,
1759
+ [StateCodesUS.Louisiana]: /^\d{9,10}$/,
1760
+ [StateCodesUS.Maine]: /^\d{8}$/,
1761
+ [StateCodesUS.Maryland]: /^\d{8}$/,
1762
+ [StateCodesUS.Massachusetts]: /^\d{10}$/,
1763
+ [StateCodesUS.Michigan]: /^\d{6}$|^\d{9}$/,
1764
+ [StateCodesUS.Minnesota]: /^\d{7}$/,
1765
+ [StateCodesUS.Mississippi]: /^\d{7,10}$/,
1766
+ [StateCodesUS.Missouri]: /^\d{10}$/,
1767
+ [StateCodesUS.Montana]: /^\d{7}$/,
1768
+ [StateCodesUS.Nebraska]: /^\d{9,11}$/,
1769
+ [StateCodesUS.Nevada]: /^\d{9,11}$/,
1770
+ [StateCodesUS.NewHampshire]: /^\d{9}$/,
1771
+ [StateCodesUS.NewJersey]: /^\d{10}$/,
1772
+ [StateCodesUS.NewMexico]: /^\d{6}$/,
1773
+ [StateCodesUS.NewYork]: /^\d{7}$/,
1774
+ [StateCodesUS.NorthCarolina]: /^\d{7}$/,
1775
+ [StateCodesUS.NorthDakota]: /^\d{7,10}$/,
1776
+ [StateCodesUS.Ohio]: /^\d{10}$/,
1777
+ [StateCodesUS.Oklahoma]: /^\d{10}$/,
1778
+ [StateCodesUS.Oregon]: /^\d{9}$/,
1779
+ [StateCodesUS.Pennsylvania]: /^\d{7}$/,
1780
+ [StateCodesUS.RhodeIsland]: /^\d{7}$/,
1781
+ [StateCodesUS.SouthCarolina]: /^\d{7}$/,
1782
+ [StateCodesUS.SouthDakota]: /^\d{7}$/,
1783
+ [StateCodesUS.Tennessee]: /^\d{6}$/,
1784
+ [StateCodesUS.Texas]: /^\d{10}$/,
1785
+ [StateCodesUS.Utah]: /^\d{7}$/,
1786
+ [StateCodesUS.Vermont]: /^\d{6}$/,
1787
+ [StateCodesUS.Virginia]: /^\d{7}$/,
1788
+ [StateCodesUS.Washington]: /^\d{9}$/,
1789
+ [StateCodesUS.WestVirginia]: /^\d{6}$/,
1790
+ [StateCodesUS.Wisconsin]: /^\d{6}$/,
1791
+ [StateCodesUS.Wyoming]: /^\d{6}$/,
1792
+ [StateCodesUS.DistrictOfColumbia]: /^\d{9}$/,
1793
+ default: /^\d{9}$/
1794
+ }
1795
+ };
1796
+ const taxInformationDefaultFieldMetadata = {
1797
+ label: "taxId"
1798
+ };
1799
+ const exemptedFromTaxDefaultFieldMetadata = {
1800
+ label: "iDontHaveATaxId"
1801
+ };
1802
+ const mapValidators = (validators, country) => {
1803
+ return validators.map(
1804
+ (validator) => ({
1805
+ ...validator,
1806
+ validate: (taxInformation) => {
1807
+ const taxInfo = taxInformation?.find((taxId) => country === taxId.country);
1808
+ if (taxInfo?.numberAbsent) return true;
1809
+ return taxInfo?.number ? validator.validate(taxInfo.number) : false;
1810
+ }
1811
+ })
1812
+ );
1813
+ };
1814
+ const taxInformationDefaultFieldConfig = {
1815
+ [CountryCodes.Australia]: {
1816
+ label: "australianBusinessNumberAbn",
1817
+ validators: mapValidators([validatePatternOnBlur(/^\d{11}$/)], CountryCodes.Australia),
1818
+ mask: {
1819
+ mask: makeMask(
1820
+ ...numericInputs(2),
1821
+ spacer,
1822
+ ...numericInputs(3),
1823
+ spacer,
1824
+ ...numericInputs(3),
1825
+ spacer,
1826
+ ...numericInputs(3)
1827
+ )
1828
+ },
1829
+ guidanceText: {
1830
+ key: "enterNDigitsForExample",
1831
+ values: {
1832
+ numDigits: "11",
1833
+ example: "51 824 753 556"
1834
+ }
1835
+ }
1836
+ },
1837
+ [CountryCodes.Belgium]: ({ companyType }) => {
1838
+ switch (companyType) {
1839
+ case LegalEntityTypes.INDIVIDUAL:
1840
+ return {
1841
+ label: "taxInformationNumber__BE_Individual",
1842
+ placeholder: "taxInformationNumber__placeHolder__BE_Individual",
1843
+ validators: mapValidators([validatePatternOnBlur(/^\d{11}$/)], CountryCodes.Belgium),
1844
+ mask: { mask: makeMask(...numericInputs(11)) },
1845
+ guidanceText: {
1846
+ key: "validationPleaseEnterAValidIdNumberWithExample",
1847
+ values: {
1848
+ example: "99999999999",
1849
+ idType: "Numeró National"
1850
+ }
1851
+ }
1852
+ };
1853
+ default:
1854
+ return {
1855
+ label: "taxInformationNumber__BE",
1856
+ placeholder: "taxInformationNumber__placeHolder__BE",
1857
+ validators: mapValidators([validatePatternOnBlur(/^\d{10}$/)], CountryCodes.Belgium),
1858
+ mask: { mask: makeMask(...numericInputs(10)) },
1859
+ guidanceText: {
1860
+ key: "validationPleaseEnterAValidIdNumberWithExample",
1861
+ values: {
1862
+ example: "0123321123",
1863
+ idType: "Business nummer"
1864
+ }
1865
+ }
1866
+ };
1867
+ }
1868
+ },
1869
+ [CountryCodes.Canada]: {
1870
+ label: "businessNumber",
1871
+ validators: mapValidators([validatePatternOnBlur(/^\d{9}$/)], CountryCodes.Canada),
1872
+ mask: { mask: makeMask(...numericInputs(9)) },
1873
+ guidanceText: {
1874
+ key: "enterNDigitsForExample",
1875
+ values: {
1876
+ numDigits: "9",
1877
+ example: "123456789"
1878
+ }
1879
+ }
1880
+ },
1881
+ [CountryCodes.France]: {
1882
+ label: "taxInformationNumber__FR",
1883
+ placeholder: "taxInformationNumber__placeHolder__FR",
1884
+ validators: mapValidators([validatePatternOnBlur(/^\s*(\d\s*){13}$/)], CountryCodes.France),
1885
+ mask: {
1886
+ mask: makeMask(
1887
+ ...numericInputs(2),
1888
+ spacer,
1889
+ ...numericInputs(2),
1890
+ spacer,
1891
+ ...numericInputs(3),
1892
+ spacer,
1893
+ ...numericInputs(3),
1894
+ spacer,
1895
+ ...numericInputs(3)
1896
+ )
1897
+ },
1898
+ guidanceText: {
1899
+ key: "validationPleaseEnterAValidIdNumberWithExample",
1900
+ values: {
1901
+ example: "30 23 217 600 053",
1902
+ idType: "Numéro SPI"
1903
+ }
1904
+ }
1905
+ },
1906
+ [CountryCodes.Germany]: ({ companyType }) => {
1907
+ switch (companyType) {
1908
+ case LegalEntityTypes.INDIVIDUAL:
1909
+ return {
1910
+ label: "taxInformationNumber__DE_Individual",
1911
+ placeholder: "taxInformationNumber__placeHolder__DE_Individual",
1912
+ validators: mapValidators([validatePatternOnBlur(/^\d{11}$/)], CountryCodes.Germany),
1913
+ mask: { mask: makeMask(...numericInputs(11)) },
1914
+ guidanceText: {
1915
+ key: "validationPleaseEnterAValidIdNumberWithExample",
1916
+ values: {
1917
+ example: "26954371827",
1918
+ idType: "IdNr"
1919
+ }
1920
+ }
1921
+ };
1922
+ default:
1923
+ return {
1924
+ label: "taxInformationNumber__DE",
1925
+ placeholder: "taxInformationNumber__placeHolder__DE",
1926
+ validators: mapValidators([validatePatternOnBlur(/^\d{10,11}$/)], CountryCodes.Germany),
1927
+ mask: { mask: makeMask(...numericInputs(11)) },
1928
+ guidanceText: {
1929
+ key: "validationPleaseEnterAValidIdNumberWithExample",
1930
+ values: {
1931
+ example: "14310260208",
1932
+ idType: "Steuernummer"
1933
+ }
1934
+ }
1935
+ };
1936
+ }
1937
+ },
1938
+ [CountryCodes.Gibraltar]: {
1939
+ label: "taxpayerReferenceNumber",
1940
+ validators: mapValidators([validatePatternOnBlur(/^\d{1,7}$/)], CountryCodes.Gibraltar),
1941
+ mask: {
1942
+ mask: makeMask(...numericInputs(1), ...numericInputs(6, true))
1943
+ },
1944
+ guidanceText: {
1945
+ key: "enterAMaximumOfNDigitsForExample",
1946
+ values: {
1947
+ maxDigits: "7",
1948
+ example: "123456"
1949
+ }
1950
+ }
1951
+ },
1952
+ [CountryCodes.Guernsey]: ({ companyType }) => {
1953
+ switch (companyType) {
1954
+ case CompanyTypesValues.SOLE_PROPRIETORSHIP:
1955
+ return {
1956
+ label: "nationalInsuranceNumber",
1957
+ validators: mapValidators(
1958
+ [validatePatternOnBlur(/^GY\d{6}[A-D]$/)],
1959
+ CountryCodes.Guernsey
1960
+ ),
1961
+ mask: {
1962
+ mask: makeMask(
1963
+ ...nonInputs("GY", { includeInValue: true }),
1964
+ spacer,
1965
+ ...numericInputs(2),
1966
+ spacer,
1967
+ ...numericInputs(2),
1968
+ spacer,
1969
+ ...numericInputs(2),
1970
+ spacer,
1971
+ {
1972
+ type: "input",
1973
+ allow: /[A-D]/
1974
+ }
1975
+ ),
1976
+ transformOnType: uppercase
1977
+ },
1978
+ guidanceText: {
1979
+ key: "enterTheRemainingNCharactersForExample",
1980
+ values: {
1981
+ numChars: "7",
1982
+ example: "GY 12 34 56 A"
1983
+ }
1984
+ }
1985
+ };
1986
+ default:
1987
+ return {
1988
+ label: "taxInformationNumber",
1989
+ mask: businessRegistrationNumberMasks[CountryCodes.Guernsey].default,
1990
+ validators: mapValidators(
1991
+ [
1992
+ validatePatternOnBlur(
1993
+ businessRegistrationNumberPatterns[CountryCodes.Guernsey].default
1994
+ )
1995
+ ],
1996
+ CountryCodes.Guernsey
1997
+ ),
1998
+ guidanceText: {
1999
+ key: "enterAMaximumOfNDigitsForExample",
2000
+ values: {
2001
+ maxDigits: "9",
2002
+ example: "123456"
2003
+ }
2004
+ }
2005
+ };
2006
+ }
2007
+ },
2008
+ [CountryCodes.HongKong]: {
2009
+ label: "taxInformationNumber__HK",
2010
+ validators: mapValidators([validatePatternOnBlur(/^\d{8}$/)], CountryCodes.HongKong),
2011
+ mask: { mask: makeMask(...numericInputs(8)) },
2012
+ guidanceText: {
2013
+ key: "enterNDigitsForExample",
2014
+ values: {
2015
+ numDigits: "8",
2016
+ example: "70569713"
2017
+ }
2018
+ }
2019
+ },
2020
+ [CountryCodes.Jersey]: ({ taxIdNumberType, companyType }) => {
2021
+ switch (taxIdNumberType) {
2022
+ case "SSN":
2023
+ return {
2024
+ label: "socialSecurityNumber",
2025
+ validators: mapValidators(
2026
+ [validatePatternOnBlur(/^[A-Z]{2}\d{6}[A-Z]$/)],
2027
+ CountryCodes.Jersey
2028
+ ),
2029
+ mask: {
2030
+ mask: makeMask(...alphaInputs(2), ...numericInputs(6), ...alphaInputs(1)),
2031
+ transformOnType: uppercase
2032
+ },
2033
+ guidanceText: {
2034
+ key: "enterNCharactersForExample",
2035
+ values: {
2036
+ numChars: "9",
2037
+ example: "JY000000A"
2038
+ }
2039
+ }
2040
+ };
2041
+ case "TIN_JE":
2042
+ default:
2043
+ switch (companyType) {
2044
+ case CompanyTypesValues.SOLE_PROPRIETORSHIP:
2045
+ return {
2046
+ label: "taxIdentificationNumber",
2047
+ validators: mapValidators([validatePatternOnBlur(/^\d{10}$/)], CountryCodes.Jersey),
2048
+ mask: {
2049
+ mask: makeMask(
2050
+ ...numericInputs(3),
2051
+ ...nonInputs(" - "),
2052
+ ...numericInputs(3),
2053
+ ...nonInputs(" - "),
2054
+ ...numericInputs(4)
2055
+ )
2056
+ },
2057
+ guidanceText: {
2058
+ key: "enterNDigitsForExample",
2059
+ values: {
2060
+ numDigits: "10",
2061
+ example: "100-100-1000"
2062
+ }
2063
+ }
2064
+ };
2065
+ default:
2066
+ return {
2067
+ label: "taxIdentificationNumber",
2068
+ validators: mapValidators(
2069
+ [validatePatternOnBlur(/^[A-Z]{2}\d{5}$/)],
2070
+ CountryCodes.Jersey
2071
+ ),
2072
+ mask: {
2073
+ mask: makeMask(...alphaInputs(2), ...numericInputs(5)),
2074
+ transformOnType: uppercase
2075
+ },
2076
+ guidanceText: {
2077
+ key: "enterNCharactersForExample",
2078
+ values: {
2079
+ numChars: "7",
2080
+ example: "CC17261"
2081
+ }
2082
+ }
2083
+ };
2084
+ }
2085
+ }
2086
+ },
2087
+ [CountryCodes.Ireland]: {
2088
+ label: "trnNumber",
2089
+ validators: mapValidators(
2090
+ [validatePatternOnBlur(/^(\d{7})([a-zA-Z])([a-zA-Z]?)$/)],
2091
+ CountryCodes.Ireland
2092
+ ),
2093
+ mask: {
2094
+ mask: makeMask(...numericInputs(7), ...alphaInputs(1), ...alphaInputs(1, true))
2095
+ },
2096
+ guidanceText: {
2097
+ key: "enterXDigitsThenXToYLettersForExample",
2098
+ values: {
2099
+ numDigits: "7",
2100
+ minLetters: "1",
2101
+ maxLetters: "2",
2102
+ example: "1497955KA"
2103
+ }
2104
+ }
2105
+ },
2106
+ [CountryCodes.IsleOfMan]: {
2107
+ label: "taxReferenceNumber",
2108
+ validators: mapValidators([validatePatternOnBlur(/^[HCX]\d{8}$/)], CountryCodes.IsleOfMan),
2109
+ mask: {
2110
+ mask: makeMask(
2111
+ {
2112
+ type: "input",
2113
+ allow: /[HCX]/
2114
+ },
2115
+ ...numericInputs(6),
2116
+ ...nonInputs(" - "),
2117
+ ...numericInputs(2)
2118
+ ),
2119
+ transformOnType: uppercase
2120
+ },
2121
+ guidanceText: {
2122
+ key: "enterNCharactersForExample",
2123
+ values: {
2124
+ numChars: "9",
2125
+ example: "C155673-79"
2126
+ }
2127
+ }
2128
+ },
2129
+ [CountryCodes.Netherlands]: ({ companyType }) => {
2130
+ switch (companyType) {
2131
+ case LegalEntityTypes.INDIVIDUAL:
2132
+ return {
2133
+ label: "bsnNumber",
2134
+ placeholder: "taxInformationNumber__placeHolder__NL",
2135
+ validators: mapValidators([validatePatternOnBlur(/^\d{9}$/)], CountryCodes.Netherlands),
2136
+ mask: { mask: makeMask(...numericInputs(9)) },
2137
+ guidanceText: {
2138
+ key: "validationPleaseEnterAValidIdNumberWithExample",
2139
+ values: {
2140
+ example: "999999999",
2141
+ idType: "BSN"
2142
+ }
2143
+ }
2144
+ };
2145
+ default:
2146
+ return {
2147
+ label: "rsinNumber",
2148
+ placeholder: "taxInformationNumber__placeHolder__NL",
2149
+ validators: mapValidators([validatePatternOnBlur(/^\d{9}$/)], CountryCodes.Netherlands),
2150
+ mask: { mask: makeMask(...numericInputs(9)) },
2151
+ guidanceText: {
2152
+ key: "validationPleaseEnterAValidIdNumberWithExample",
2153
+ values: {
2154
+ example: "811786523",
2155
+ idType: "RSIN"
2156
+ }
2157
+ }
2158
+ };
2159
+ }
2160
+ },
2161
+ [CountryCodes.NewZealand]: {
2162
+ label: "irdNumber",
2163
+ validators: mapValidators([validatePatternOnBlur(/^\d{8,9}$/)], CountryCodes.NewZealand),
2164
+ mask: {
2165
+ mask: makeMask(...numericInputs(8), ...numericInputs(1, true))
2166
+ },
2167
+ guidanceText: {
2168
+ key: "enterXToYDigitsForExample",
2169
+ values: {
2170
+ minDigits: "8",
2171
+ maxDigits: "9",
2172
+ example: "12345678"
2173
+ }
2174
+ }
2175
+ },
2176
+ // Special case for SG in which we also save the registration number as the TaxID if that selection has been made
2177
+ [CountryCodes.Singapore]: {
2178
+ label: "gst",
2179
+ validators: mapValidators([validatePatternOnBlur(/^[A-Z0-9]{9,10}$/)], CountryCodes.Singapore),
2180
+ mask: {
2181
+ mask: makeMask(
2182
+ ...alphanumericInputs(2),
2183
+ ...nonInputs(" - "),
2184
+ ...alphanumericInputs(7),
2185
+ ...nonInputs(" - "),
2186
+ ...alphanumericInputs(1)
2187
+ ),
2188
+ transformOnType: uppercase
2189
+ },
2190
+ guidanceText: {
2191
+ key: "enterNCharactersForExample",
2192
+ values: {
2193
+ numChars: "10",
2194
+ example: "M212345678"
2195
+ }
2196
+ }
2197
+ },
2198
+ [CountryCodes.PuertoRico]: {
2199
+ // should exactly match CountryCodes.UnitedStates
2200
+ label: "taxInformationNumber__US",
2201
+ helperText: "taxInformationNumber__helperText__US",
2202
+ placeholder: "taxInformationNumber__placeHolder__US",
2203
+ validators: mapValidators([validatePatternOnBlur(/^\d{9}$/)], CountryCodes.PuertoRico),
2204
+ mask: {
2205
+ mask: makeMask(...numericInputs(2), ...nonInputs(" - "), ...numericInputs(7))
2206
+ },
2207
+ guidanceText: {
2208
+ key: "validationPleaseEnterAValidEINWithFormat",
2209
+ values: {
2210
+ format: "XX-XXXXXXX",
2211
+ example: "98-7654321"
2212
+ }
2213
+ }
2214
+ },
2215
+ [CountryCodes.UnitedKingdom]: ({ taxIdNumberType, companyType }) => {
2216
+ switch (companyType) {
2217
+ case LegalEntityTypes.INDIVIDUAL:
2218
+ switch (taxIdNumberType) {
2219
+ case "NINO":
2220
+ return {
2221
+ label: "nationalInsuranceNumber",
2222
+ placeholder: "taxInformationNumber__placeHolder__GB",
2223
+ validators: mapValidators(
2224
+ [validatePatternOnBlur(/^[A-Z]{2}\d{6}[A-D]$/)],
2225
+ CountryCodes.UnitedKingdom
2226
+ ),
2227
+ guidanceText: {
2228
+ key: "validationPleaseEnterAValidIdNumberWithExample",
2229
+ values: {
2230
+ example: "AA123456C",
2231
+ idType: "NINO"
2232
+ }
2233
+ }
2234
+ };
2235
+ default:
2236
+ return {
2237
+ label: "utr",
2238
+ placeholder: "taxInformationNumber__placeHolder__GB",
2239
+ validators: mapValidators(
2240
+ [validatePatternOnBlur(/^\d{10}$/)],
2241
+ CountryCodes.UnitedKingdom
2242
+ ),
2243
+ mask: { mask: makeMask(...numericInputs(10)) },
2244
+ guidanceText: {
2245
+ key: "validationPleaseEnterAValidIdNumberWithExample",
2246
+ values: {
2247
+ example: "6669863459",
2248
+ idType: "UTR"
2249
+ }
2250
+ }
2251
+ };
2252
+ }
2253
+ default:
2254
+ return {
2255
+ label: "utr",
2256
+ placeholder: "taxInformationNumber__placeHolder__GB",
2257
+ validators: mapValidators(
2258
+ [validatePatternOnBlur(/^\d{10}$/)],
2259
+ CountryCodes.UnitedKingdom
2260
+ ),
2261
+ mask: { mask: makeMask(...numericInputs(10)) },
2262
+ guidanceText: {
2263
+ key: "validationPleaseEnterAValidIdNumberWithExample",
2264
+ values: {
2265
+ example: "6669863459",
2266
+ idType: "UTR"
2267
+ }
2268
+ }
2269
+ };
2270
+ }
2271
+ },
2272
+ [CountryCodes.UnitedStates]: {
2273
+ label: "taxInformationNumber__US",
2274
+ helperText: "taxInformationNumber__helperText__US",
2275
+ placeholder: "taxInformationNumber__placeHolder__US",
2276
+ validators: mapValidators(
2277
+ [validateNotEmptyOnBlur, validatePatternOnBlur(/^\d{9}$/)],
2278
+ CountryCodes.UnitedStates
2279
+ ),
2280
+ mask: {
2281
+ mask: makeMask(...numericInputs(2), ...nonInputs(" - "), ...numericInputs(7))
2282
+ },
2283
+ guidanceText: {
2284
+ key: "validationPleaseEnterAValidEINWithFormat",
2285
+ values: {
2286
+ format: "XX-XXXXXXX",
2287
+ example: "98-7654321"
2288
+ }
2289
+ }
2290
+ },
2291
+ /**
2292
+ * NOT YET SUPPORTED
2293
+ * These are brought over from the old pattern files. We have no idea if they are accurate or not.
2294
+ * See https://en.wikipedia.org/wiki/VAT_identification_number
2295
+ */
2296
+ [CountryCodes.India]: {
2297
+ validators: mapValidators([validatePatternOnBlur(/^[A-Z0-9]{15}$/)], CountryCodes.India)
2298
+ },
2299
+ [CountryCodes.Japan]: {
2300
+ label: "taxInformationNumber__JP",
2301
+ validators: mapValidators([validatePatternOnBlur(/^\d{13}$/)], CountryCodes.Japan)
2302
+ },
2303
+ [CountryCodes.Philippines]: {
2304
+ validators: mapValidators([validatePatternOnBlur(/^\d{12}$/)], CountryCodes.Philippines)
2305
+ }
2306
+ };
2307
+ const exemptedFromTaxDefaultFieldConfig = {
2308
+ [CountryCodes.Australia]: {
2309
+ label: "doNotHaveAbn"
2310
+ }
2311
+ };
2312
+ const countryToTaxInfoTypeMap = {
2313
+ US: "EIN",
2314
+ AU: "ABN",
2315
+ NZ: "IRD",
2316
+ HK: "BRN",
2317
+ SG: "GST"
2318
+ };
2319
+ const isFinancialInformationRequired = (isFinancialInformationExperimentEnabled, taskType, country, capabilities, legalEntityType) => {
2320
+ const isOrganization = legalEntityType === LegalEntityTypes.ORGANIZATION;
2321
+ if (!isFinancialInformationExperimentEnabled || !COUNTRIES_REQUIRING_FINANCIAL_INFORMATION.includes(country)) {
2322
+ return void 0;
2323
+ }
2324
+ if (country === CountryCodes.UnitedKingdom && (taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY || taskType === TaskTypes.BUSINESS_DETAILS)) {
2325
+ return "REQUIRED";
2326
+ }
2327
+ if (taskType === TaskTypes.BUSINESS_DETAILS && isOrganization) {
2328
+ if (keysOf(capabilities ?? {}).some((capability) => capability === "issueBankAccount")) {
2329
+ return "REQUIRED";
2330
+ }
2331
+ }
2332
+ return void 0;
2333
+ };
2334
+ const COUNTRIES_THAT_DONT_REQUIRE_SOLE_PROP_REGISTRATION = [
2335
+ CountryCodes.Australia,
2336
+ CountryCodes.Gibraltar,
2337
+ CountryCodes.Guernsey,
2338
+ CountryCodes.HongKong,
2339
+ CountryCodes.Ireland,
2340
+ CountryCodes.IsleOfMan,
2341
+ CountryCodes.Jersey,
2342
+ CountryCodes.Malta,
2343
+ CountryCodes.PuertoRico,
2344
+ CountryCodes.Spain,
2345
+ CountryCodes.UnitedKingdom,
2346
+ CountryCodes.UnitedStates
2347
+ ];
2348
+ const COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION = [
2349
+ CountryCodes.HongKong,
2350
+ CountryCodes.PuertoRico,
2351
+ CountryCodes.UnitedStates
2352
+ ];
2353
+ const COUNTRIES_WITH_POSSIBLE_REGISTRATION_EXEMPTIONS_FOR_ORGANIZATIONS = [];
2354
+ const COUNTRIES_WITH_POSSIBLE_REGISTRATION_EXEMPTIONS_FOR_SOLE_PROPS = [
2355
+ CountryCodes.Austria,
2356
+ CountryCodes.Canada,
2357
+ CountryCodes.Finland,
2358
+ CountryCodes.Germany,
2359
+ CountryCodes.Lithuania,
2360
+ CountryCodes.Luxembourg,
2361
+ CountryCodes.NewZealand,
2362
+ CountryCodes.Poland,
2363
+ CountryCodes.Sweden,
2364
+ CountryCodes.Switzerland
2365
+ ];
2366
+ const COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER = [
2367
+ CountryCodes.Canada,
2368
+ CountryCodes.UnitedStates
2369
+ ];
2370
+ const COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT = [
2371
+ CountryCodes.Australia,
2372
+ CountryCodes.Canada,
2373
+ CountryCodes.Gibraltar,
2374
+ CountryCodes.HongKong,
2375
+ CountryCodes.NewZealand,
2376
+ CountryCodes.PuertoRico,
2377
+ CountryCodes.Singapore,
2378
+ CountryCodes.UnitedStates,
2379
+ CountryCodes.Guernsey,
2380
+ CountryCodes.Jersey,
2381
+ CountryCodes.IsleOfMan,
2382
+ CountryCodes.Mexico,
2383
+ CountryCodes.Brazil,
2384
+ CountryCodes.Japan
2385
+ ];
2386
+ const COUNTRIES_THAT_DO_NOT_USE_TAX_ID_FOR_SOLE_PROP = [
2387
+ CountryCodes.Singapore
2388
+ ];
2389
+ const COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_COMPANIES = [
2390
+ // strictly a subset of countries which use tax ID
2391
+ // right now in all countries companies must provide a tax ID - but maybe there will be exemptions in future?
2392
+ ];
2393
+ const COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_SOLE_PROPS = [
2394
+ // strictly a subset of countries which use tax ID
2395
+ CountryCodes.Canada,
2396
+ CountryCodes.PuertoRico,
2397
+ CountryCodes.UnitedStates
2398
+ ];
2399
+ const COUNTRIES_THAT_REQUIRE_DATE_OF_INCORPORATION = [
2400
+ CountryCodes.HongKong,
2401
+ CountryCodes.Singapore
2402
+ ];
2403
+ const COUNTRIES_THAT_USES_UEN_OR_GST = [CountryCodes.Singapore];
2404
+ const COUNTRIES_USING_COMPANY_SEARCH = [
2405
+ CountryCodes.UnitedStates
2406
+ ];
2407
+ const COUNTRY_OF_GOVERNING_LAW_POSSIBLE = [
2408
+ CountryCodes.UnitedKingdom
2409
+ ];
2410
+ const COUNTRIES_REQUIRING_FINANCIAL_INFORMATION = [
2411
+ CountryCodes.UnitedKingdom,
2412
+ CountryCodes.Netherlands,
2413
+ CountryCodes.France,
2414
+ CountryCodes.Germany,
2415
+ CountryCodes.Spain,
2416
+ CountryCodes.Belgium
2417
+ ];
2418
+ const COUNTRIES_REQUIRING_E_INVOICING_CODE = [
2419
+ /**
2420
+ * @description These are the countries for which E-Invoicing code is a compliance requirement. There will be more in the future.
2421
+ */
2422
+ CountryCodes.Italy
2423
+ ];
2424
+ const COUNTRIES_WITH_POSSIBLE_TRUSTEE_TAXID_ABSENT_V4 = [
2425
+ CountryCodes.Australia
2426
+ ];
2427
+ const TAX_ID_REQUIRED_COUNTRIES_ORGANIZATION = [
2428
+ CountryCodes.UnitedKingdom,
2429
+ CountryCodes.Netherlands,
2430
+ CountryCodes.Germany,
2431
+ CountryCodes.Belgium
2432
+ ];
2433
+ const isRegistrationNumberAbsentStateV4Scenario = (country, entityType) => {
2434
+ return country === CountryCodes.Australia && (entityType === CompanyTypesValues.GOVERNMENTAL_ORGANIZATION || entityType === CompanyTypesValues.INCORPORATED_PARTNERSHIP) || country === CountryCodes.NewZealand;
2435
+ };
2436
+ const rules = ({
2437
+ data,
2438
+ country,
2439
+ taskType,
2440
+ isExperimentEnabled = () => false,
2441
+ accountHolder,
2442
+ rootLegalEntity,
2443
+ tinMatched
2444
+ }) => {
2445
+ const countryRequiresDateOfIncorporationForCompanies = () => {
2446
+ if (COUNTRIES_THAT_REQUIRE_DATE_OF_INCORPORATION.includes(country)) {
2447
+ return "REQUIRED";
2448
+ }
2449
+ };
2450
+ const countryRequiresFinancialInformation = () => {
2451
+ if (isExperimentEnabled("EnableFinancialInformationComponentV4") && COUNTRIES_REQUIRING_FINANCIAL_INFORMATION.includes(country)) {
2452
+ const isFinancialInformationExperimentEnabled = isExperimentEnabled(
2453
+ "EnableFinancialInformationComponentV4"
2454
+ );
2455
+ const leType = rootLegalEntity?.type;
2456
+ return isFinancialInformationRequired(
2457
+ isFinancialInformationExperimentEnabled,
2458
+ taskType,
2459
+ country,
2460
+ rootLegalEntity?.capabilities,
2461
+ leType
2462
+ );
2463
+ }
2464
+ };
2465
+ return createFormRules({
2466
+ requireDoingBusinessAsName: () => {
2467
+ if (isExperimentEnabled("EnableBusinessDetailsMultiForm")) {
2468
+ return data.additionalInformation?.hasDoingBusinessAs ? "REQUIRED" : void 0;
2469
+ }
2470
+ },
2471
+ countryRequiresStateOrProvince: () => {
2472
+ if (COUNTRIES_WITH_STATES_DATASET.includes(country)) {
2473
+ return "REQUIRED";
2474
+ }
2475
+ },
2476
+ ifPubliclyTradedCompany: () => {
2477
+ if (data.companyStructure?.entityType === CompanyTypesValues.PUBLIC_COMPANY) {
2478
+ return "REQUIRED";
2479
+ }
2480
+ },
2481
+ countryUsesVat: () => {
2482
+ if (!COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT.includes(country)) {
2483
+ return Boolean(data.additionalInformation?.exemptedFromVat) === true ? "OPTIONAL" : "REQUIRED";
2484
+ }
2485
+ },
2486
+ vatNumberType: () => {
2487
+ if (!COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT.includes(country)) {
2488
+ return "OPTIONAL";
2489
+ }
2490
+ },
2491
+ isVatExempt: () => {
2492
+ if (!COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT.includes(country)) {
2493
+ return Boolean(data.additionalInformation?.exemptedFromVat) === true ? "REQUIRED" : "OPTIONAL";
2494
+ }
2495
+ },
2496
+ countryUsesTaxId: () => {
2497
+ const isExemptFromTax = Boolean(
2498
+ data.basicInformation?.exemptedFromTax ?? data.additionalInformation?.exemptedFromTax
2499
+ );
2500
+ if (isExperimentEnabled("EnableTaxIdRequiredForBusinessAccountsScenarios") && TAX_ID_REQUIRED_COUNTRIES_ORGANIZATION.includes(country) && rootLegalEntity?.type === "organization" && // SOE-5931 - TODO: investigate L scenario returned to show this on the backend
2501
+ keysOf(rootLegalEntity?.capabilities ?? {}).includes("issueBankAccount")) {
2502
+ return isExemptFromTax ? "OPTIONAL" : "REQUIRED";
2503
+ }
2504
+ if (COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT.includes(country) && !(taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY && COUNTRIES_THAT_DO_NOT_USE_TAX_ID_FOR_SOLE_PROP.includes(country))) {
2505
+ return isExemptFromTax ? "OPTIONAL" : "REQUIRED";
2506
+ }
2507
+ },
2508
+ companyRegistrationNumberExemptionAllowed: () => {
2509
+ const isExemptFromRegistrationNumber = Boolean(
2510
+ data.basicInformation?.exemptedFromRegistrationNumber ?? data.additionalInformation?.exemptedFromRegistrationNumber
2511
+ );
2512
+ if (isExperimentEnabled("EnableRegistrationAndTaxAbsentStatesV4") && isRegistrationNumberAbsentStateV4Scenario(country, data.companyStructure?.entityType)) {
2513
+ return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
2514
+ }
2515
+ switch (taskType) {
2516
+ case TaskTypes.SOLE_PROPRIETOR_COMPANY: {
2517
+ if (!COUNTRIES_WITH_POSSIBLE_REGISTRATION_EXEMPTIONS_FOR_SOLE_PROPS.includes(country))
2518
+ return;
2519
+ return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
2520
+ }
2521
+ default: {
2522
+ switch (country) {
2523
+ case CountryCodes.Germany: {
2524
+ if (data.companyStructure?.entityType === CompanyTypesValues.GOVERNMENTAL_ORGANIZATION || data.companyStructure?.entityType === CompanyTypesValues.NON_PROFIT_OR_CHARITABLE) {
2525
+ return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
2526
+ }
2527
+ return;
2528
+ }
2529
+ case CountryCodes.Denmark: {
2530
+ if (data.companyStructure?.entityType === CompanyTypesValues.NON_PROFIT_OR_CHARITABLE) {
2531
+ return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
2532
+ }
2533
+ return;
2534
+ }
2535
+ default: {
2536
+ if (!COUNTRIES_WITH_POSSIBLE_REGISTRATION_EXEMPTIONS_FOR_ORGANIZATIONS.includes(country))
2537
+ return;
2538
+ return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
2539
+ }
2540
+ }
2541
+ }
2542
+ }
2543
+ },
2544
+ countryOfGoverningLawRequired: () => {
2545
+ if (isExperimentEnabled("EnableCountryOfGoverningLawForUKCompanies") && COUNTRY_OF_GOVERNING_LAW_POSSIBLE.includes(data.basicInformation?.country)) {
2546
+ return "REQUIRED";
2547
+ }
2548
+ },
2549
+ countryRequiresRegistrationNumber: () => {
2550
+ const isExemptFromRegistrationNumber = Boolean(
2551
+ data.basicInformation?.exemptedFromRegistrationNumber ?? data.additionalInformation?.exemptedFromRegistrationNumber
2552
+ );
2553
+ switch (taskType) {
2554
+ case TaskTypes.SOLE_PROPRIETOR_COMPANY: {
2555
+ if (COUNTRIES_THAT_DONT_REQUIRE_SOLE_PROP_REGISTRATION.includes(country)) return;
2556
+ return isExemptFromRegistrationNumber ? "OPTIONAL" : "REQUIRED";
2557
+ }
2558
+ default: {
2559
+ if (COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER.includes(country)) {
2560
+ return "OPTIONAL";
2561
+ }
2562
+ if (!COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION.includes(country)) {
2563
+ return isExemptFromRegistrationNumber ? "OPTIONAL" : "REQUIRED";
2564
+ }
2565
+ }
2566
+ }
2567
+ },
2568
+ registrationNumberType: () => {
2569
+ switch (taskType) {
2570
+ case TaskTypes.SOLE_PROPRIETOR_COMPANY: {
2571
+ if (COUNTRIES_THAT_DONT_REQUIRE_SOLE_PROP_REGISTRATION.includes(country)) return;
2572
+ return "OPTIONAL";
2573
+ }
2574
+ default: {
2575
+ if (COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER.includes(country)) {
2576
+ return "OPTIONAL";
2577
+ }
2578
+ if (COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION.includes(country)) return;
2579
+ return "OPTIONAL";
2580
+ }
2581
+ }
2582
+ },
2583
+ countryUsesUenOrGst: () => {
2584
+ if (taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY) {
2585
+ return;
2586
+ }
2587
+ if (COUNTRIES_THAT_USES_UEN_OR_GST.includes(country)) {
2588
+ return "REQUIRED";
2589
+ }
2590
+ },
2591
+ countryHasTaxExemptions: () => {
2592
+ const isExemptFromTax = Boolean(
2593
+ data.basicInformation?.exemptedFromTax ?? data.additionalInformation?.exemptedFromTax
2594
+ );
2595
+ switch (taskType) {
2596
+ case TaskTypes.SOLE_PROPRIETOR_COMPANY: {
2597
+ if (!COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_SOLE_PROPS.includes(country)) return;
2598
+ return isExemptFromTax ? "REQUIRED" : "OPTIONAL";
2599
+ }
2600
+ default: {
2601
+ if (isExperimentEnabled("EnableRegistrationAndTaxAbsentStatesV4") && COUNTRIES_WITH_POSSIBLE_TRUSTEE_TAXID_ABSENT_V4.includes(country) && accountHolder === "aTrust") {
2602
+ return isExemptFromTax ? "REQUIRED" : "OPTIONAL";
2603
+ }
2604
+ if (COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_COMPANIES.includes(country)) {
2605
+ return isExemptFromTax ? "REQUIRED" : "OPTIONAL";
2606
+ }
2607
+ }
2608
+ }
2609
+ },
2610
+ countryUsingCompanySearch: () => {
2611
+ if (taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY) {
2612
+ return;
2613
+ }
2614
+ if (COUNTRIES_USING_COMPANY_SEARCH.includes(country)) {
2615
+ return "REQUIRED";
2616
+ }
2617
+ },
2618
+ countryRequiresFinancialInformation,
2619
+ isDateOfIncorporationRequired: () => {
2620
+ if (isExperimentEnabled("EnableIncorporationDateBasedFinancialValidationForHO")) {
2621
+ return countryRequiresDateOfIncorporationForCompanies() || countryRequiresFinancialInformation();
2622
+ }
2623
+ return countryRequiresDateOfIncorporationForCompanies();
2624
+ },
2625
+ isFinancialReportingFieldsRequired: () => {
2626
+ if (isExperimentEnabled("EnableIncorporationDateBasedFinancialValidationForHO")) {
2627
+ return countryRequiresFinancialInformation() === "REQUIRED" && isDateOlderThanAYear(data.additionalInformation?.dateOfIncorporation) ? "REQUIRED" : void 0;
2628
+ }
2629
+ return countryRequiresFinancialInformation();
2630
+ },
2631
+ annualTurnoverRequired: () => {
2632
+ if (isExperimentEnabled("EnableBusinessDetailsMultiForm") && data.companyFinancialInformation?.reportedValueOption === "annualTurnover") {
2633
+ return "REQUIRED";
2634
+ }
2635
+ },
2636
+ netAssetsRequired: () => {
2637
+ if (isExperimentEnabled("EnableBusinessDetailsMultiForm") && data.companyFinancialInformation?.reportedValueOption === "netAssets") {
2638
+ return "REQUIRED";
2639
+ }
2640
+ },
2641
+ balanceSheetTotalRequired: () => {
2642
+ if (isExperimentEnabled("EnableBusinessDetailsMultiForm") && data.companyFinancialInformation?.reportedValueOption === "balanceSheetTotal") {
2643
+ return "REQUIRED";
2644
+ }
2645
+ },
2646
+ isEInvoicingCodeEnabled: () => {
2647
+ if (isExperimentEnabled("EnableEInvoicingCodeField") && COUNTRIES_REQUIRING_E_INVOICING_CODE.includes(country)) {
2648
+ return "REQUIRED";
2649
+ }
2650
+ },
2651
+ ifCountryUsAndTinFailed: () => {
2652
+ if (taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY) {
2653
+ return;
2654
+ }
2655
+ if (tinMatched === false && country === CountryCodes.UnitedStates) {
2656
+ return "REQUIRED";
2657
+ }
2658
+ },
2659
+ businessRequiresCompanyType: () => {
2660
+ if (taskType !== TaskTypes.SOLE_PROPRIETOR_COMPANY) {
2661
+ return "REQUIRED";
2662
+ }
2663
+ },
2664
+ japaneseLegalCompanyName: () => {
2665
+ if (country === CountryCodes.Japan) {
2666
+ return "REQUIRED";
2667
+ }
2668
+ },
2669
+ requireBusinessSelection: () => {
2670
+ if (taskType !== TaskTypes.SOLE_PROPRIETOR_COMPANY && COUNTRIES_USING_COMPANY_SEARCH.includes(country) && isExperimentEnabled("EnableBusinessDetailsMultiForm")) {
2671
+ return "REQUIRED";
2672
+ }
2673
+ }
2674
+ });
2675
+ };
2676
+ const inferTaxIdNumberType = (taxInformation, country, companyType) => {
2677
+ if (!taxInformation) return void 0;
2678
+ const optionsForCountry = getTaxIdNumberOptions(country, companyType);
2679
+ const metadataFn = taxInformationDefaultFieldConfig[country];
2680
+ if (!optionsForCountry || !metadataFn) return void 0;
2681
+ if (optionsForCountry.length === 1) return optionsForCountry[0].id;
2682
+ const allMetaData = optionsForCountry.reduce(
2683
+ (acc, option) => {
2684
+ const meta = typeof metadataFn === "function" ? metadataFn({
2685
+ taxIdNumberType: option.id,
2686
+ companyType
2687
+ }) : metadataFn;
2688
+ if (meta.label && !acc[meta.label]) {
2689
+ acc[meta.label] = meta;
2690
+ }
2691
+ return acc;
2692
+ },
2693
+ {}
2694
+ );
2695
+ for (const option of optionsForCountry) {
2696
+ const fieldMetadata = allMetaData[option.name];
2697
+ if (!fieldMetadata?.validators) continue;
2698
+ const validators = Array.isArray(fieldMetadata.validators) ? fieldMetadata.validators : [fieldMetadata.validators];
2699
+ if (validators.every((validator) => validator.validate(taxInformation))) {
2700
+ return option.id;
2701
+ }
2702
+ }
2703
+ };
2704
+ function findExistingTaxInformation(taxInformation, country) {
2705
+ return taxInformation?.find((taxId) => taxId.country === country);
2706
+ }
2707
+ function getDefaultTaxIdNumberType(taxInformation, country, entityType) {
2708
+ const existingTaxInformation = findExistingTaxInformation(taxInformation, country);
2709
+ return (
2710
+ // First check if we already have a type set
2711
+ existingTaxInformation?.type ?? (existingTaxInformation?.number ? (
2712
+ // If we have a number but no type, try to infer it
2713
+ inferTaxIdNumberType(taxInformation, country, entityType)
2714
+ ) : (
2715
+ // Otherwise use the first available tax ID option for this country and entity type
2716
+ getTaxIdNumberOptions(country, entityType)?.[0]?.id
2717
+ ))
2718
+ );
2719
+ }
2720
+ function TaxIdNumberTypeSelector({
2721
+ country,
2722
+ companyType,
2723
+ selected,
2724
+ setSelected,
2725
+ exemptedOption,
2726
+ isUsSoleProp,
2727
+ errorMessage
2728
+ }) {
2729
+ const { t } = useTranslation("common");
2730
+ const handleSelect = useCallback(
2731
+ (selectedStr) => {
2732
+ const newSelected = selectedStr;
2733
+ if (newSelected === "exempted") {
2734
+ if (exemptedOption) {
2735
+ setSelected(newSelected);
2736
+ }
2737
+ return;
2738
+ }
2739
+ setSelected(newSelected);
2740
+ },
2741
+ [exemptedOption, setSelected]
2742
+ );
2743
+ const options = useMemo(() => {
2744
+ const availableOptions = getTaxIdNumberOptions(country, companyType) ?? [];
2745
+ if (availableOptions.length === 0 || !exemptedOption) return availableOptions;
2746
+ return [
2747
+ ...availableOptions,
2748
+ {
2749
+ id: "exempted",
2750
+ name: exemptedOption
2751
+ }
2752
+ ];
2753
+ }, [country, companyType, exemptedOption]);
2754
+ useEffect(() => {
2755
+ if (!isUsSoleProp && !selected && options.length > 0) {
2756
+ handleSelect(options[0].id);
2757
+ }
2758
+ }, [options, selected, handleSelect, isUsSoleProp]);
2759
+ if (options.length <= 1) return null;
2760
+ return /* @__PURE__ */ jsx(
2761
+ Field,
2762
+ {
2763
+ el: "fieldset",
2764
+ name: "taxIdNumberType",
2765
+ label: t(($) => $["whichTaxpayerIdentificationNumberDoYouUse"]),
2766
+ errorMessage: !!errorMessage,
2767
+ children: (childProps) => /* @__PURE__ */ jsx(
2768
+ RadioGroup,
2769
+ {
2770
+ ...childProps,
2771
+ name: "taxIdNumberType",
2772
+ items: options,
2773
+ value: selected,
2774
+ onChange: handleSelect
2775
+ }
2776
+ )
2777
+ }
2778
+ );
2779
+ }
2780
+ const TAX_INFORMATION_FIELD = [
2781
+ "taxInformation",
2782
+ "exemptedFromTax",
2783
+ "isUen"
2784
+ ];
2785
+ function TaxInformationField({
2786
+ data,
2787
+ valid,
2788
+ errors,
2789
+ labels,
2790
+ mask,
2791
+ guidanceText,
2792
+ placeholders,
2793
+ readonly,
2794
+ optional,
2795
+ shouldValidate,
2796
+ handleChangeFor,
2797
+ country,
2798
+ canExempt,
2799
+ registrationNumber,
2800
+ entityType,
2801
+ defaultData
2802
+ }) {
2803
+ const { isExperimentEnabled } = useExperimentsContext();
2804
+ const { t } = useTranslation("common");
2805
+ const { accountHolder } = useAccountHolder();
2806
+ const currentCountryTaxInformation = useMemo(
2807
+ () => data?.taxInformation?.find((taxInfo) => taxInfo.country === country),
2808
+ [data, country]
2809
+ );
2810
+ const isUsSoleProp = country === "US" && entityType === CompanyTypesValues.SOLE_PROPRIETORSHIP;
2811
+ const exemptionLabel = isUsSoleProp ? t(($) => $["socialSecurityNumber"]) : labels.exemptedFromTax;
2812
+ const shouldRenderInput = isUsSoleProp ? currentCountryTaxInformation?.type === "EIN" : !data.isUen;
2813
+ const options = getTaxIdNumberOptions(country, entityType);
2814
+ const showTaxIdExemptedOptions = canExempt && (options?.length ?? 0) > 1 || isUsSoleProp;
2815
+ const canSaveAbsentState = isExperimentEnabled("EnableRegistrationAndTaxAbsentStatesV4") && COUNTRIES_WITH_POSSIBLE_TRUSTEE_TAXID_ABSENT_V4.includes(country) && accountHolder === "aTrust";
2816
+ const taxIdNumberType = useMemo(() => {
2817
+ if (isUsSoleProp) {
2818
+ return data.exemptedFromTax ? "exempted" : currentCountryTaxInformation?.type ? currentCountryTaxInformation?.type : void 0;
2819
+ }
2820
+ return data.exemptedFromTax ? "exempted" : currentCountryTaxInformation?.type ? currentCountryTaxInformation?.type : getDefaultTaxIdNumberType(data.taxInformation, country, entityType);
2821
+ }, [
2822
+ country,
2823
+ currentCountryTaxInformation?.type,
2824
+ data.exemptedFromTax,
2825
+ data.taxInformation,
2826
+ entityType,
2827
+ isUsSoleProp
2828
+ ]);
2829
+ const handleTaxInformationChange = (e, key, mode) => {
2830
+ const value = e ? typeof e === "string" ? e : e?.target?.value : void 0;
2831
+ switch (key) {
2832
+ case "number": {
2833
+ const newTaxInformation = canSaveAbsentState ? {
2834
+ country,
2835
+ number: value,
2836
+ type: currentCountryTaxInformation?.type ?? taxIdNumberType,
2837
+ numberAbsent: false
2838
+ } : {
2839
+ country,
2840
+ number: value,
2841
+ type: currentCountryTaxInformation?.type ?? taxIdNumberType
2842
+ };
2843
+ if (!data.taxInformation) {
2844
+ return handleChangeFor("taxInformation", mode)([newTaxInformation]);
2845
+ }
2846
+ const taxInformation = currentCountryTaxInformation ? data.taxInformation : [...data.taxInformation, newTaxInformation];
2847
+ const updatedTaxInformation = taxInformation.map((taxInfo) => {
2848
+ if (taxInfo.country !== country) return taxInfo;
2849
+ return newTaxInformation;
2850
+ });
2851
+ return handleChangeFor("taxInformation", mode)(updatedTaxInformation);
2852
+ }
2853
+ case "type": {
2854
+ const newTaxInformation = canSaveAbsentState ? {
2855
+ country,
2856
+ number: currentCountryTaxInformation?.number,
2857
+ type: value,
2858
+ numberAbsent: false
2859
+ } : {
2860
+ country,
2861
+ number: currentCountryTaxInformation?.number,
2862
+ type: value
2863
+ };
2864
+ if (!data.taxInformation) {
2865
+ return handleChangeFor("taxInformation", mode)([newTaxInformation]);
2866
+ }
2867
+ const taxInformation = currentCountryTaxInformation ? data.taxInformation : [...data.taxInformation, newTaxInformation];
2868
+ const updatedTaxInformation = taxInformation.map((taxInfo) => {
2869
+ if (taxInfo.country !== country) return taxInfo;
2870
+ return newTaxInformation;
2871
+ });
2872
+ return handleChangeFor("taxInformation", mode)(updatedTaxInformation);
2873
+ }
2874
+ }
2875
+ };
2876
+ useEffect(() => {
2877
+ const hasSavedTaxId = defaultData?.find((taxId) => taxId.country === country);
2878
+ if (currentCountryTaxInformation?.country === country) return;
2879
+ if (currentCountryTaxInformation && !hasSavedTaxId) return;
2880
+ if (entityType === CompanyTypesValues.SOLE_PROPRIETORSHIP) return;
2881
+ handleChangeFor("taxInformation", "input")(defaultData);
2882
+ const newCountryOptions = getTaxIdNumberOptions(country, entityType);
2883
+ if (newCountryOptions && newCountryOptions.length > 0) {
2884
+ handleTaxInformationChange(newCountryOptions[0].id, "type", "input");
2885
+ } else {
2886
+ handleTaxInformationChange(void 0, "type", "input");
2887
+ }
2888
+ }, [country]);
2889
+ const removeCurrentCountryTaxInformation = () => {
2890
+ const filterdTaxInformation = data.taxInformation?.filter((taxId) => taxId.country !== country);
2891
+ handleChangeFor("taxInformation", "input")(filterdTaxInformation);
2892
+ };
2893
+ const setUenAsTaxId = (uen) => {
2894
+ if (!data.taxInformation) {
2895
+ return handleChangeFor(
2896
+ "taxInformation",
2897
+ "blur"
2898
+ )([
2899
+ {
2900
+ country,
2901
+ number: uen ?? "",
2902
+ type: "UEN"
2903
+ }
2904
+ ]);
2905
+ }
2906
+ const taxInformation = currentCountryTaxInformation ? data.taxInformation : [
2907
+ ...data.taxInformation,
2908
+ {
2909
+ country,
2910
+ number: uen ?? "",
2911
+ type: "UEN"
2912
+ }
2913
+ ];
2914
+ const updatedTaxInformation = taxInformation.map((taxInfo) => {
2915
+ if (taxInfo.country !== country) return taxInfo;
2916
+ return {
2917
+ country,
2918
+ number: uen ?? "",
2919
+ type: "UEN"
2920
+ };
2921
+ });
2922
+ return handleChangeFor("taxInformation", "blur")(updatedTaxInformation);
2923
+ };
2924
+ useEffect(() => {
2925
+ if (country === "SG" && data.isUen && currentCountryTaxInformation?.number !== registrationNumber) {
2926
+ setUenAsTaxId(registrationNumber);
2927
+ }
2928
+ }, [registrationNumber]);
2929
+ const addTaxAbsentStatus = (exempted) => {
2930
+ if (!data.taxInformation) {
2931
+ const updatedTaxInformation2 = [
2932
+ {
2933
+ country,
2934
+ numberAbsent: exempted
2935
+ }
2936
+ ];
2937
+ return handleChangeFor("taxInformation", "input")(updatedTaxInformation2);
2938
+ }
2939
+ const taxInformation = currentCountryTaxInformation ? data.taxInformation : [
2940
+ ...data.taxInformation,
2941
+ {
2942
+ country,
2943
+ numberAbsent: exempted
2944
+ }
2945
+ ];
2946
+ const updatedTaxInformation = taxInformation.map((taxInfo) => {
2947
+ if (taxInfo.country !== country) return taxInfo;
2948
+ return {
2949
+ country,
2950
+ numberAbsent: exempted
2951
+ };
2952
+ });
2953
+ return handleChangeFor("taxInformation", "input")(updatedTaxInformation);
2954
+ };
2955
+ const handleTaxIdNumberTypeChange = (taxIdType) => {
2956
+ if (!canExempt && taxIdType === "exempted") {
2957
+ throw Error(`${country} does not allow tax exemptions`);
2958
+ }
2959
+ switch (taxIdType) {
2960
+ case "exempted":
2961
+ handleChangeFor("exemptedFromTax")(true);
2962
+ handleTaxInformationChange(void 0, "type", "input");
2963
+ return canSaveAbsentState ? addTaxAbsentStatus(true) : removeCurrentCountryTaxInformation();
2964
+ default:
2965
+ handleChangeFor("exemptedFromTax")(false);
2966
+ }
2967
+ if (country === "SG") {
2968
+ if (taxIdType === "UEN") {
2969
+ handleChangeFor("isUen")(true);
2970
+ setUenAsTaxId(registrationNumber);
2971
+ } else {
2972
+ handleChangeFor("isUen")(false);
2973
+ removeCurrentCountryTaxInformation();
2974
+ }
2975
+ }
2976
+ handleTaxInformationChange(taxIdType, "type", "input");
2977
+ };
2978
+ const handleExemptedFromTaxChange = (exempted) => {
2979
+ if (canSaveAbsentState) {
2980
+ addTaxAbsentStatus(exempted);
2981
+ handleChangeFor("exemptedFromTax")(exempted);
2982
+ } else {
2983
+ handleChangeFor("exemptedFromTax")(exempted);
2984
+ removeCurrentCountryTaxInformation();
2985
+ }
2986
+ };
2987
+ return /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-field__tax-information", children: [
2988
+ /* @__PURE__ */ jsx(
2989
+ TaxIdNumberTypeSelector,
2990
+ {
2991
+ country,
2992
+ companyType: entityType,
2993
+ setSelected: handleTaxIdNumberTypeChange,
2994
+ selected: taxIdNumberType,
2995
+ exemptedOption: showTaxIdExemptedOptions ? exemptionLabel : false,
2996
+ isUsSoleProp,
2997
+ errorMessage: isUsSoleProp ? errors.taxInformation : false
2998
+ }
2999
+ ),
3000
+ shouldRenderInput && /* @__PURE__ */ jsx(
3001
+ MaskedInput,
3002
+ {
3003
+ type: "text",
3004
+ "aria-required": true,
3005
+ "aria-invalid": !valid.taxInformation,
3006
+ name: "taxInformation",
3007
+ label: labels.taxInformation ?? "",
3008
+ formatGuidance: guidanceText?.taxInformation ?? "",
3009
+ value: currentCountryTaxInformation?.number ?? "",
3010
+ errorMessage: errors.taxInformation,
3011
+ placeholder: placeholders?.taxInformation,
3012
+ isValid: Boolean(valid.taxInformation) && !!currentCountryTaxInformation,
3013
+ onInput: (e) => handleTaxInformationChange(e, "number", "input"),
3014
+ onBlur: (e) => handleTaxInformationChange(e, "number", "blur"),
3015
+ disabled: data.exemptedFromTax || data.isUen,
3016
+ readonly,
3017
+ optional,
3018
+ shouldValidate,
3019
+ ...mask
3020
+ }
3021
+ ),
3022
+ canExempt && !showTaxIdExemptedOptions && /* @__PURE__ */ jsx(Field, { name: "exemptedFromTax", children: (childProps) => /* @__PURE__ */ jsx(
3023
+ Checkbox,
3024
+ {
3025
+ ...childProps,
3026
+ "aria-required": false,
3027
+ "aria-invalid": false,
3028
+ name: "exemptedFromTax",
3029
+ label: labels.exemptedFromTax,
3030
+ value: "exemptedFromTax",
3031
+ checked: Boolean(data.exemptedFromTax),
3032
+ onChange: handleExemptedFromTaxChange
3033
+ }
3034
+ ) })
3035
+ ] });
3036
+ }
3037
+ export {
3038
+ COUNTRIES_USING_COMPANY_SEARCH as C,
3039
+ MemoizedDocumentUpload as M,
3040
+ StateCodesUS as S,
3041
+ TaxInformationField as T,
3042
+ additionallIdNumberOptions as a,
3043
+ taxInformationDefaultFieldConfig as b,
3044
+ TAX_INFORMATION_FIELD as c,
3045
+ exemptedFromTaxDefaultFieldConfig as d,
3046
+ exemptedFromTaxDefaultFieldMetadata as e,
3047
+ COUNTRY_OF_GOVERNING_LAW_POSSIBLE as f,
3048
+ getFieldsWithExistingData as g,
3049
+ isRegistrationNumberAbsentStateV4Scenario as h,
3050
+ individualIdNumberOptions as i,
3051
+ COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT as j,
3052
+ getCompanyRegistrationNumberOptions as k,
3053
+ countryToTaxInfoTypeMap as l,
3054
+ businessRegistrationNumberMasks as m,
3055
+ businessRegistrationNumberPatterns as n,
3056
+ getVatNumberOptions as o,
3057
+ rules as r,
3058
+ stateFormatGuidanceText as s,
3059
+ taxInformationDefaultFieldMetadata as t,
3060
+ useCapabilities as u,
3061
+ vatNumberOptions as v
3062
+ };