@adyen/kyc-components 4.26.1 → 4.27.0-beta.1

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 (239) hide show
  1. package/dist/{AcceptTermsOfServiceWorkflow-DXSq3XzA.js → AcceptTermsOfServiceWorkflow-CO6qEeAD.js} +4 -4
  2. package/dist/{Accordion-BAdwrgCR.js → Accordion-CTQfC17W.js} +1 -1
  3. package/dist/{AccountSetupRejected-BLEWjmc8.js → AccountSetupRejected-CFvogFuo.js} +2 -2
  4. package/dist/{AdaptiveWorkflow-DwdMyu1A.js → AdaptiveWorkflow-CTKpyw02.js} +22 -22
  5. package/dist/{AdaptiveWorkflowComponent-DPv1YHos.js → AdaptiveWorkflowComponent-CvTwsWi3.js} +5 -5
  6. package/dist/{AddressFields-B0QVYM-e.js → AddressFields-vl2AeVHz.js} +33 -72
  7. package/dist/{Avatar-C2zeqSSB.js → Avatar-yJfk9A6l.js} +1 -1
  8. package/dist/{BusinessFinancingDropin-evYHYnXE.js → BusinessFinancingDropin-tSylhmJS.js} +123 -55
  9. package/dist/{BusinessFinancingPage-C_agz96E.js → BusinessFinancingPage-9AcfHWyP.js} +6 -6
  10. package/dist/{BusinessRegistrationNumberField-DeYcZlQS.js → BusinessRegistrationNumberField-B6w6LvSZ.js} +6 -6
  11. package/dist/{BusinessRegistrationNumberFieldGroup-D9D0BPdp.js → BusinessRegistrationNumberFieldGroup-CICYxSyn.js} +6 -6
  12. package/dist/{BusinessTypeSelectionPage-DmgeZsex.js → BusinessTypeSelectionPage-lLt_PL1z.js} +13 -13
  13. package/dist/{Button-Dwr6jvJZ.js → Button-BYafPrZH.js} +1 -1
  14. package/dist/{Checkbox-BLyyDG9b.js → Checkbox-DXF-eRBj.js} +8 -8
  15. package/dist/{ComponentGroup-BLvYZoxp.js → ComponentGroup-DNspJrHk.js} +3 -3
  16. package/dist/{ConstitutionalDocument-B3o3NLMO.js → ConstitutionalDocument-Dg3dmkpH.js} +19 -26
  17. package/dist/{ContactDetails-7zYbKJtH.js → ContactDetails-5W0oQVYG.js} +5 -5
  18. package/dist/{ContextGuidance-C2AXK9Ep.js → ContextGuidance-BrbPzdaI.js} +3 -3
  19. package/dist/{CountryField-Bl8gp3wu.js → CountryField-DlMYQYfd.js} +4 -4
  20. package/dist/{Currency-Be6zg8XM.js → Currency-BCJuV60i.js} +16 -10
  21. package/dist/{CustomerSupport-lUVh_sWN.js → CustomerSupport-Bdg11WcM.js} +29 -16
  22. package/dist/{DateField-CO2CodgD.js → DateField-DfnBDOVl.js} +4 -4
  23. package/dist/{DebugModal-l52lDfKB.js → DebugModal-D1RMhAfR.js} +228 -10
  24. package/dist/{DecisionMakerDetails-9y6Fm96G.js → DecisionMakerDetails-Cv_NdD0z.js} +79 -174
  25. package/dist/{DecisionMakerDetailsPage-9kRW2Zh8.js → DecisionMakerDetailsPage-dTsh8vkz.js} +9 -9
  26. package/dist/{DecisionMakers-CYjKftby.js → DecisionMakers-DAhjhaMS.js} +17 -18
  27. package/dist/{Dropzone-QRtCFpVT.js → Dropzone-rk15b_Tb.js} +7 -7
  28. package/dist/{EmailField-D-Ndm0JS.js → EmailField-BOX8HtRe.js} +4 -4
  29. package/dist/{EmbeddedStatus-4YjyzkcD.js → EmbeddedStatus-mdQsQfof.js} +2 -2
  30. package/dist/{EndStateLayout-C5Pqler-.js → EndStateLayout-B-M90Rnh.js} +2 -2
  31. package/dist/{EntityAssociation-CS8XqKk-.js → EntityAssociation-B5Zq7_F6.js} +6 -6
  32. package/dist/{ErrorPanel-DaipnVsu.js → ErrorPanel-BLvDkiVa.js} +10 -17
  33. package/dist/{GlobalEntryModal-COOjZvh7.js → GlobalEntryModal-DZsHeRPL.js} +439 -298
  34. package/dist/{GlobalEntryPage-C9SGXXJk.js → GlobalEntryPage-RyQIoaWL.js} +7 -8
  35. package/dist/{Icon-_YUEZg1p.js → Icon-jVvV1zXc.js} +1 -1
  36. package/dist/{IdentityNumber-D_cOLEsP.js → IdentityNumber-C8CMJtgD.js} +5 -5
  37. package/dist/{IdentityNumberFieldGroup-CoLugvku.js → IdentityNumberFieldGroup-Cj5U1Onz.js} +2 -2
  38. package/dist/{IdentityScreeningWorkflow-B_nLC0Ru.js → IdentityScreeningWorkflow-BCDn25Or.js} +12 -13
  39. package/dist/{IndividualDropin-CRKk-szG.js → IndividualDropin-B6dY0iN3.js} +149 -231
  40. package/dist/{IndustryCodeFieldGroup-0vRXN8GP.js → IndustryCodeFieldGroup-B649faYk.js} +5 -5
  41. package/dist/{InputDate-Cxk_f6Us.js → InputDate-3rYzWzXX.js} +8 -4
  42. package/dist/{InputText-CObXfKKh.js → InputText-OCbzlaaN.js} +2 -2
  43. package/dist/{Introduction-CmhxGGzY.js → Introduction-Duow8A7U.js} +6 -6
  44. package/dist/{InvitedDecisionMakerComponent-BkHurym6.js → InvitedDecisionMakerComponent-BVQ37JLZ.js} +13 -14
  45. package/dist/{JpAddressFields-CuvfbjX6.js → JpAddressFields-Bh7Bvw__.js} +9 -10
  46. package/dist/{LegalCompanyNameField-CkINYTFB.js → LegalCompanyNameField-Yj5Fa3-I.js} +5 -5
  47. package/dist/{LegalRepresentativeDetailsPage-mlE80SrL.js → LegalRepresentativeDetailsPage-C10ojT9w.js} +4 -4
  48. package/dist/{Link-D0Yqc2r0.js → Link-DwPkGikd.js} +1 -1
  49. package/dist/{ListItem-DY-qq1lS.js → ListItem-n927geYb.js} +2 -2
  50. package/dist/{Modal-DnDjAzqZ.js → Modal-jjSjdW5W.js} +3 -3
  51. package/dist/{Name-Dhj905G8.js → Name-D-A5XBTb.js} +4 -4
  52. package/dist/{NumberField-BlDjTB0U.js → NumberField-D291GWYR.js} +4 -4
  53. package/dist/{PatriotActDisclosure-jNLKR-RM.js → PatriotActDisclosure-DMjKJEKH.js} +10 -10
  54. package/dist/{PayoutDetailsDropin-DO1CtLRd.js → PayoutDetailsDropin-B5MNHR3S.js} +41 -43
  55. package/dist/{PayoutDetailsPage-C-W1PCRf.js → PayoutDetailsPage-DMAxzS2V.js} +5 -5
  56. package/dist/{Review-BLcoVl6O.js → Review-BDontauk.js} +6 -6
  57. package/dist/{RootBusinessDetailsPage-DNZi9Zgj.js → RootBusinessDetailsPage-INMIQvN4.js} +4 -4
  58. package/dist/{RootBusinessLinesPage-D2IPigk5.js → RootBusinessLinesPage-BiIb7UVU.js} +22 -23
  59. package/dist/{RootIndividualDetailsPage-Cfa9R28c.js → RootIndividualDetailsPage-BS5BgowF.js} +6 -6
  60. package/dist/{Select-C0Pp8Jeb.js → Select-BRK2a2V5.js} +92 -92
  61. package/dist/{SignPCIComponent-I3asF5GE.js → SignPCIComponent-B5JmN8BT.js} +14 -14
  62. package/dist/{SingpassSelection-C4Ptdwzb.js → SingpassSelection-B84oJmvG.js} +5 -5
  63. package/dist/{SoleProprietorshipPage-CiI2VKw_.js → SoleProprietorshipPage-C-jxJkmQ.js} +4 -4
  64. package/dist/{SourceOfFundsPage-DrJqgPMf.js → SourceOfFundsPage-C27vODL5.js} +24 -24
  65. package/dist/{SourceOfFundsWorkflow-tE06S4__.js → SourceOfFundsWorkflow-DOqaH_wk.js} +4 -4
  66. package/dist/StateField-CRLgYS1X.js +364 -0
  67. package/dist/{Step-CLZTcCEQ.js → Step-BTVKO9gW.js} +5 -5
  68. package/dist/Summary-C9Nr0dot.js +21 -0
  69. package/dist/{SummarySection-v-mSwYL0.js → SummarySection-D67yguze.js} +5 -19
  70. package/dist/{Task-CUr-Zb5N.js → Task-BaQ6wqz5.js} +7 -7
  71. package/dist/{TaskGroup-BGUboNOL.js → TaskGroup-C7lBWbYp.js} +3 -3
  72. package/dist/{TaskListItem-DMkmZn3B.js → TaskListItem-Cu3fSvOJ.js} +10 -10
  73. package/dist/{TaskStepperContextProvider-9wlnwii7.js → TaskStepperContextProvider-DiMf4UV6.js} +1 -1
  74. package/dist/{TaskVerificationStatus-zoxTZ2mt.js → TaskVerificationStatus-C1CllzL1.js} +17 -17
  75. package/dist/{TaxInformationFieldGroup-CraKcKMs.js → TaxInformationFieldGroup-vQoQHydJ.js} +7 -7
  76. package/dist/{TaxReportingDropin-B-ywMdBt.js → TaxReportingDropin-CTnL6VMm.js} +13 -15
  77. package/dist/{TaxReportingWorkflow-BmUdyOKl.js → TaxReportingWorkflow-5_eG0AcD.js} +4 -4
  78. package/dist/{TermsOfServiceManagement-D1Yv4Z5p.js → TermsOfServiceManagement-xL-xisqE.js} +46 -43
  79. package/dist/{TextArea-CyFcFhHo.js → TextArea-CcaUENX2.js} +4 -4
  80. package/dist/{TextField-D61xVlV2.js → TextField-fhhAQSKg.js} +5 -5
  81. package/dist/{TrustDetailsPage-D2FS-As0.js → TrustDetailsPage-DcNS-XWz.js} +61 -54
  82. package/dist/{TrustMemberCompanyPage-DDcSOUi2.js → TrustMemberCompanyPage-xtxgO6d4.js} +5 -5
  83. package/dist/{TrustMemberIndividualPage-CJBz1p3R.js → TrustMemberIndividualPage-BMWAg_eS.js} +4 -4
  84. package/dist/{TrustMemberRoleAndTypePage-OeN1HW_E.js → TrustMemberRoleAndTypePage-DR3pLJf9.js} +43 -36
  85. package/dist/{TrustMembersOverview-DkrEZL6_.js → TrustMembersOverview-D-jTaw37.js} +13 -13
  86. package/dist/{UboTaskItem-Dc6ExVuW.js → UboTaskItem-DsoetWEU.js} +7 -7
  87. package/dist/{UnincorporatedPartnershipIndividualPage-D0ZYvh8k.js → UnincorporatedPartnershipIndividualPage-3sSr2dCv.js} +4 -4
  88. package/dist/{UnincorporatedPartnershipMemberCompanyPage-BtapkuO6.js → UnincorporatedPartnershipMemberCompanyPage-s6NiptRo.js} +5 -5
  89. package/dist/{UnincorporatedPartnershipMemberRoleAndTypePage-CbdYYTQT.js → UnincorporatedPartnershipMemberRoleAndTypePage-Cr6UEryR.js} +9 -9
  90. package/dist/{UnincorporatedPartnershipMembersOverview-Cs1DHVNP.js → UnincorporatedPartnershipMembersOverview-CbwWOxQs.js} +6 -6
  91. package/dist/{VerificationErrorAlert-D9sBE-Tj.js → VerificationErrorAlert-Bm7-u85-.js} +3 -3
  92. package/dist/{WebsiteField-BCoO-m_7.js → WebsiteField-DTlbxzaa.js} +5 -5
  93. package/dist/{Workflow-driWy_eJ.js → Workflow-DT43cTzE.js} +6 -6
  94. package/dist/{accountHolderUtils-BAbeRIOy.js → accountHolderUtils-D0E9se-W.js} +1 -1
  95. package/dist/adyen-business-financing.js +7 -7
  96. package/dist/adyen-individual-configuration.js +6 -6
  97. package/dist/adyen-individual-status.js +5 -5
  98. package/dist/adyen-invited-decision-maker.js +3 -3
  99. package/dist/adyen-onboarding.js +30 -30
  100. package/dist/adyen-terms-of-service-management.js +3 -3
  101. package/dist/adyen-terms-of-service-status.js +3 -3
  102. package/dist/adyen-transfer-instrument-configuration.js +5 -5
  103. package/dist/adyen-transfer-instrument-management.js +13 -13
  104. package/dist/adyen-verification-status.js +3 -3
  105. package/dist/{bafinUtils-COyCy9xG.js → bafinUtils-CvQzDDfD.js} +519 -531
  106. package/dist/{constants-fGRziJEH.js → constants-BOu8Hnt9.js} +6 -6
  107. package/dist/{dropinUtils-cIGIoJvF.js → dropinUtils-DfyQ8xFE.js} +165 -364
  108. package/dist/en-US-8KLaHQaT.js +7 -0
  109. package/dist/{en-US-Cz4JoU20.js → en-US-BMMx67Za.js} +16 -2
  110. package/dist/{en-US-nYL_eSJ-.js → en-US-BfRvYdHX.js} +8 -2
  111. package/dist/en-US-DGdFfmUC.js +136 -0
  112. package/dist/{en-US.instructions-BVNIyLRs.js → en-US.instructions-myDXMUbk.js} +2 -1
  113. package/dist/{error-B9rHWK9Q.js → error-CUHwmdwD.js} +2 -2
  114. package/dist/formatDataForSummary-BMFPIUER.js +498 -0
  115. package/dist/{formatValidationError-BJqU7LCU.js → formatValidationError-B5GNhAeh.js} +2 -2
  116. package/dist/{getDefaultRegistrationNumberType-BcV1GDOs.js → getDefaultRegistrationNumberType-CyaKz1Fj.js} +4 -4
  117. package/dist/{getProblemsForEntity-mdb3Bfpj.js → getProblemsForEntity-FHk416BA.js} +1 -1
  118. package/dist/{getTrustedDecisionMakers-D89oYOLp.js → getTrustedDecisionMakers-DByctgob.js} +1 -1
  119. package/dist/{getValidationError-dcpAlebZ.js → getValidationError-B4YX_EgR.js} +2 -2
  120. package/dist/{legalArrangementUtils-Crgt_L7h.js → legalArrangementUtils-CHlmmcB8.js} +11 -2
  121. package/dist/{mapAddressLocalizationToJpAddressSchema-B9pzYF3B.js → mapAddressLocalizationToJpAddressSchema-BrQMDBLX.js} +2 -2
  122. package/dist/{mapExistingFile-BXfeQxev.js → mapExistingFile-CqbTLZ6i.js} +1 -1
  123. package/dist/mapJpAddressSchemaToAddressLocalizations-BL4eAlDH.js +19 -0
  124. package/dist/{mapTransferInstrumentToPayoutAccount-Ba_L9EEB.js → mapTransferInstrumentToPayoutAccount-DhwdciyT.js} +2 -2
  125. package/dist/{processCapabilities-FL4-KAbd.js → processCapabilities-B75YIdXZ.js} +11 -4
  126. package/dist/{processValidationErrors-DWdgik5u.js → processValidationErrors-Dtt1FnM2.js} +4 -4
  127. package/dist/{resolveEnvironment-BnKqnU98.js → resolveEnvironment-CpWP_8og.js} +53 -16
  128. package/dist/roleMetadata-BW4HRw1l.js +57 -0
  129. package/dist/style.css +218 -230
  130. package/dist/styles-DYaAeu4q.js +218 -230
  131. package/dist/trustMemberType-Ix2sf6e_.js +13 -0
  132. package/dist/types/api/address/useAddressCleanse.d.ts +2 -0
  133. package/dist/types/api/address/useRetrieveAddress.d.ts +1 -0
  134. package/dist/types/api/address/useRetrieveFromPostcodeJp.d.ts +1 -0
  135. package/dist/types/components/BankAccount/tasks/PayoutDetailsDropin/utils.d.ts +7 -2
  136. package/dist/types/components/Business/forms/FinancialInformation/mapping/mapFinancialInformationToFinancialReport.d.ts +1 -1
  137. package/dist/types/components/Business/forms/rules.d.ts +3 -1
  138. package/dist/types/components/Business/utils/formatDataForSummary.d.ts +2 -1
  139. package/dist/types/components/EFP/mapping/businessFinancingKeyMappings.d.ts +78 -0
  140. package/dist/types/components/EFP/tasks/BusinessFinancingDropin/BusinessFinancingFinancialInformation.d.ts +3 -0
  141. package/dist/types/components/EFP/tasks/BusinessFinancingDropin/types.d.ts +2 -1
  142. package/dist/types/components/EFP/tasks/BusinessFinancingDropin/utils.d.ts +6 -3
  143. package/dist/types/components/EFP/tasks/BusinessFinancingDropin/validate.d.ts +3 -0
  144. package/dist/types/components/GlobalEntry/fields/DbaQuestionnaire/DbaQuestionnaire.d.ts +3 -0
  145. package/dist/types/components/GlobalEntry/fields/DbaQuestionnaire/types.d.ts +5 -0
  146. package/dist/types/components/GlobalEntry/fields/LlcQuestionnaire/LlcQuestionnaire.d.ts +3 -0
  147. package/dist/types/components/GlobalEntry/fields/LlcQuestionnaire/types.d.ts +5 -0
  148. package/dist/types/components/GlobalEntry/fields/PaperworkQuestionnaire/PaperworkQuestionnaire.d.ts +1 -6
  149. package/dist/types/components/GlobalEntry/fields/PaperworkQuestionnaire/fieldConfig.d.ts +11 -0
  150. package/dist/types/components/GlobalEntry/fields/PaperworkQuestionnaire/types.d.ts +6 -1
  151. package/dist/types/components/GlobalEntry/fields/Questionnaire/Questionnaire.d.ts +2 -0
  152. package/dist/types/components/GlobalEntry/fields/Questionnaire/types.d.ts +17 -0
  153. package/dist/types/components/GlobalEntry/fields/TrustQuestionnaire/TrustQuestionnaire.d.ts +3 -0
  154. package/dist/types/components/GlobalEntry/fields/TrustQuestionnaire/types.d.ts +5 -0
  155. package/dist/types/components/GlobalEntry/forms/EntityInformation/EntityInformation.d.ts +1 -3
  156. package/dist/types/components/GlobalEntry/forms/EntityInformation/types.d.ts +1 -2
  157. package/dist/types/components/GlobalEntry/forms/RegistrationInformation/types.d.ts +5 -1
  158. package/dist/types/components/GlobalEntry/mapping/globalEntryKeyMapping.d.ts +0 -3
  159. package/dist/types/components/GlobalEntry/mapping/mapGlobalEntrySchemaToLegalEntity.d.ts +2 -3
  160. package/dist/types/components/GlobalEntry/mapping/mapLegalEntityToGlobalEntrySchema.d.ts +1 -6
  161. package/dist/types/components/GlobalEntry/rules.d.ts +5 -2
  162. package/dist/types/components/GlobalEntry/utils/getAvailableCompanyStructures.d.ts +2 -1
  163. package/dist/types/components/GlobalEntry/utils/submitGlobalEntry.d.ts +1 -4
  164. package/dist/types/components/GlobalEntry/utils/utils.d.ts +7 -4
  165. package/dist/types/components/Individual/forms/AdditionalPersonalDetails/AdditionalPersonalDetails.types.d.ts +1 -2
  166. package/dist/types/components/Individual/forms/Individual.rules.d.ts +7 -6
  167. package/dist/types/components/Individual/helpers/findRelevantTaxInformation.d.ts +8 -2
  168. package/dist/types/components/Individual/helpers/getSubmittableTaxInformation.d.ts +20 -0
  169. package/dist/types/components/Individual/mapping/mapIndividualSchemaToLegalEntity.d.ts +5 -3
  170. package/dist/types/components/Individual/tasks/DecisionMakers/DecisionMakerDetails/utils.d.ts +6 -67
  171. package/dist/types/components/Individual/tasks/IndividualDropin/IndividualSummary.d.ts +27 -0
  172. package/dist/types/components/Individual/utils/formatDataForSummary.d.ts +49 -0
  173. package/dist/types/components/Shared/FormFlow/FormFlow.d.ts +1 -1
  174. package/dist/types/components/Shared/FormFlow/FormFlow.types.d.ts +0 -5
  175. package/dist/types/components/Shared/Summary/Summary.d.ts +10 -7
  176. package/dist/types/components/Shared/Summary/types.d.ts +3 -21
  177. package/dist/types/components/Shared/SummarySection/SummaryBulletList.d.ts +8 -0
  178. package/dist/types/components/Shared/devex/DebugListener/DebugTheme.d.ts +2 -0
  179. package/dist/types/components/Shared/devex/DebugListener/customTheme.d.ts +49 -0
  180. package/dist/types/components/Shared/fields/RegistrationAndOperationalAddressFields/types.d.ts +2 -0
  181. package/dist/types/components/Shared/fields/RegistrationAndOperationalAddressFields/utils.d.ts +2 -4
  182. package/dist/types/components/Shared/fields/ReportedValueOptionField/types.d.ts +3 -0
  183. package/dist/types/components/Shared/forms/Address/constants.d.ts +2 -0
  184. package/dist/types/components/Shared/forms/Address/localized/jp/JpAddressFields.d.ts +2 -9
  185. package/dist/types/components/Shared/forms/Address/localized/jp/mapAddressLocalizationToJpAddressSchema.d.ts +2 -2
  186. package/dist/types/components/Shared/forms/Address/localized/jp/mapJpAddressSchemaToAddressLocalizations.d.ts +2 -2
  187. package/dist/types/components/Shared/forms/Address/localized/jp/mapJpAddressSummary.d.ts +2 -4
  188. package/dist/types/components/Shared/forms/Address/rules.d.ts +13 -0
  189. package/dist/types/components/Shared/forms/Address/types.d.ts +7 -1
  190. package/dist/types/components/Shared/forms/Address/utils.d.ts +5 -11
  191. package/dist/types/components/Trust/forms/Trust/rules.d.ts +3 -1
  192. package/dist/types/components/Trust/tasks/RoleAndTypeDropin/formatRoleAndEntityTypeSummary.d.ts +2 -3
  193. package/dist/types/components/Trust/utils/formatDataForSummary.d.ts +2 -1
  194. package/dist/types/core/EmbedShell/EmbedShell.d.ts +4 -1
  195. package/dist/types/core/EmbedShell/useTheme.d.ts +9 -0
  196. package/dist/types/embeds/onboarding/adyen-onboarding.d.ts +1 -1
  197. package/dist/types/embeds/onboarding/adyen-onboarding.types.d.ts +8 -0
  198. package/dist/types/hooks/useStoredStateOrProvince.d.ts +9 -0
  199. package/dist/types/types/datasets/state-code.d.ts +36 -1
  200. package/dist/types/types/form-rules.d.ts +2 -2
  201. package/dist/types/utils/analytics/getPrefilledDetails.d.ts +3 -0
  202. package/dist/types/utils/entityStatusUtil.d.ts +1 -1
  203. package/dist/types/utils/fieldConfigurations.d.ts +1 -1
  204. package/dist/types/utils/legalArrangementUtils.d.ts +2 -0
  205. package/dist/{types-BymnGWO9.js → types-DVMWWwBT.js} +1 -1
  206. package/dist/{form-rules-CZbkNMEw.js → unincorporatedPartnership-CiU2fnqv.js} +38 -4
  207. package/dist/{useBusinessDetailsData-BJau7oMt.js → useBusinessDetailsData-BtEHoBoN.js} +100 -90
  208. package/dist/{useCanSeeIntroduction-BQuCt-eO.js → useCanSeeIntroduction-kxOGIxnh.js} +2 -2
  209. package/dist/useCreateLegalEntity-CgzVD39K.js +24 -0
  210. package/dist/{useDataMissingRemediations-DKjYzfe2.js → useDataMissingRemediations-BfC7ECSn.js} +1 -1
  211. package/dist/{useForm-VDjedfk9.js → useForm-CiHfxEX0.js} +3 -3
  212. package/dist/{useHideTaskStepper-BgCN--mG.js → useHideTaskStepper-Betx9MGy.js} +1 -1
  213. package/dist/{useId-Cs-bSalH.js → useId-ChrmzN7R.js} +2 -2
  214. package/dist/{useNavigate-CKp2oemi.js → useNavigate-xbrKpFCu.js} +33 -33
  215. package/dist/{useSalesChannels-D0q-Vat7.js → useSalesChannels-C2qQmPGf.js} +1 -1
  216. package/dist/{useTaskLandedEvent-QBmeEeS6.js → useTaskLandedEvent-Brv74FDb.js} +1 -1
  217. package/dist/{useTrustMembers-COumqoMC.js → useTrustMembers-BA5fCul_.js} +3 -3
  218. package/dist/{useUnincorporatedPartnershipMembers-DcfQJdVZ.js → useUnincorporatedPartnershipMembers-J6rxK5Ie.js} +2 -2
  219. package/dist/{utils-BFxg3gPM.js → utils-ChZNfG5_.js} +1 -1
  220. package/dist/{utils-BiPEtEaV.js → utils-ClAXyRqf.js} +4 -5
  221. package/dist/{utils-B6TRzLRs.js → utils-Do6-kryk.js} +3 -3
  222. package/dist/utils-VV2acmQG.js +49 -0
  223. package/dist/{validate-Dt3Xmp_L.js → validate-BHOzYoxU.js} +26 -2
  224. package/dist/{validate-BN38Qq-w.js → validate-D5990ODb.js} +20 -9
  225. package/dist/{validate-D3JIeysp.js → validate-Dtiozjlb.js} +4 -4
  226. package/dist/{validate-_7WKym8c.js → validate-NJNmUaTh.js} +11 -5
  227. package/dist/{validateExtractionResult-IRRMwcNi.js → validateExtractionResult-D3AuQo5-.js} +3 -3
  228. package/package.json +6 -5
  229. package/dist/Image-CxnjHtP1.js +0 -33
  230. package/dist/List-qvNxW9lm.js +0 -72
  231. package/dist/StateField-BBGSo1NG.js +0 -296
  232. package/dist/en-US-U0d3NI20.js +0 -7
  233. package/dist/mapJpAddressSchemaToAddressLocalizations-kHaGv8kC.js +0 -75
  234. package/dist/mapLegalEntityToIndividualSchema-D6qGKj-2.js +0 -254
  235. package/dist/trustMemberGuidance-BpeDHAJP.js +0 -27
  236. package/dist/types/components/Shared/NewSummary/NewSummary.d.ts +0 -10
  237. package/dist/types/components/Shared/Summary/summaryItem.d.ts +0 -17
  238. package/dist/types/components/Shared/forms/Address/localized/jp/jpAddressSchema.d.ts +0 -17
  239. package/dist/unincorporatedPartnership-BbNowjM2.js +0 -11
@@ -1,24 +1,25 @@
1
1
  try {
2
2
  let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
3
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "f14a41a0-3e0a-4b1b-ac3c-1160ae1656c8", e._sentryDebugIdIdentifier = "sentry-dbid-f14a41a0-3e0a-4b1b-ac3c-1160ae1656c8");
3
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "aaa8c2f1-bbb4-4871-acb0-27f69ad0bf46", e._sentryDebugIdIdentifier = "sentry-dbid-aaa8c2f1-bbb4-4871-acb0-27f69ad0bf46");
4
4
  } catch (e) {}
5
5
  import { r as useTranslation } from "./translation-CpH8D2NK.js";
6
- import { P as listToRecord, mt as useAccountHolder, x as Alert } from "./resolveEnvironment-BnKqnU98.js";
7
- import { t as Icon } from "./Icon-_YUEZg1p.js";
6
+ import { C as Alert, I as listToRecord, gt as useAccountHolder } from "./resolveEnvironment-CpWP_8og.js";
7
+ import { t as Icon } from "./Icon-jVvV1zXc.js";
8
8
  import { t as Typography } from "./Typography-CAc_f5Iq.js";
9
- import { t as Button } from "./Button-Dwr6jvJZ.js";
9
+ import { t as Button } from "./Button-BYafPrZH.js";
10
10
  import { i as noop, s as keysOf } from "./genUtils-nphCwt1A.js";
11
11
  import { t as CountryCodes } from "./country-code-CJk2hdPu.js";
12
12
  import { t as TaskTypes } from "./taskTypes-3vSkMBDm.js";
13
13
  import { t as DecisionMakerTypes } from "./decisionMaker-CR0qaGWQ.js";
14
14
  import { t as Scenarios } from "./scenarios-nibtmpSb.js";
15
- import { i as useToggleContext, t as Checkbox } from "./Checkbox-BLyyDG9b.js";
16
- import { i as useAnalyticsContext, r as KEYBOARD_KEYS, t as Modal } from "./Modal-DnDjAzqZ.js";
17
- import { t as useId } from "./useId-Cs-bSalH.js";
18
- import { r as resolveFieldMetadata } from "./form-rules-CZbkNMEw.js";
19
- import { f as translateTranslatable, r as Field } from "./Select-C0Pp8Jeb.js";
20
- import { s as Confirm } from "./utils-B6TRzLRs.js";
21
- import { A as nonInputs, C as validateNotEmptyOnBlur, D as alphanumericInputs, E as alphaInputs, M as spacer, O as customInputs, T as uppercase, a as MaskedInput, i as RadioWithLabel, j as numericInputs, k as makeMask, r as RadioGroup, w as validatePatternOnBlur } from "./dropinUtils-cIGIoJvF.js";
15
+ import { i as useToggleContext, t as Checkbox } from "./Checkbox-DXF-eRBj.js";
16
+ import { i as useAnalyticsContext, r as KEYBOARD_KEYS, t as Modal } from "./Modal-jjSjdW5W.js";
17
+ import { t as useId } from "./useId-ChrmzN7R.js";
18
+ import { a as resolveFieldMetadata } from "./unincorporatedPartnership-CiU2fnqv.js";
19
+ import { a as translateTranslatable, o as Field } from "./Select-BRK2a2V5.js";
20
+ import { s as Confirm } from "./utils-Do6-kryk.js";
21
+ import { m as isEmpty } from "./StateField-CRLgYS1X.js";
22
+ import { A as uppercase, F as nonInputs, I as numericInputs, L as spacer, M as alphanumericInputs, N as customInputs, O as validateNotEmptyOnBlur, P as makeMask, a as MaskedInput, i as RadioWithLabel, j as alphaInputs, k as validatePatternOnBlur, r as RadioGroup } from "./dropinUtils-DfyQ8xFE.js";
22
23
  import { useCallback, useEffect, useMemo, useRef, useState } from "preact/hooks";
23
24
  import cx from "classnames";
24
25
  import { Fragment, jsx, jsxs } from "preact/jsx-runtime";
@@ -996,440 +997,169 @@ var businessRegistrationNumberPatterns = {
996
997
  default: /^\d{9}$/
997
998
  }
998
999
  };
1000
+ var Tile_module_default = {
1001
+ "tile-container": "_tile-container_gy997_1",
1002
+ tileContainer: "_tile-container_gy997_1",
1003
+ tile: "_tile_gy997_1",
1004
+ "tile-icon": "_tile-icon_gy997_18",
1005
+ tileIcon: "_tile-icon_gy997_18",
1006
+ "tile-title": "_tile-title_gy997_35",
1007
+ tileTitle: "_tile-title_gy997_35",
1008
+ "tile-checkbox": "_tile-checkbox_gy997_49",
1009
+ tileCheckbox: "_tile-checkbox_gy997_49",
1010
+ "tile-container-horizontal": "_tile-container-horizontal_gy997_89",
1011
+ tileContainerHorizontal: "_tile-container-horizontal_gy997_89",
1012
+ "tile-label": "_tile-label_gy997_100",
1013
+ tileLabel: "_tile-label_gy997_100"
1014
+ };
999
1015
  //#endregion
1000
- //#region src/utils/mapScriptLocalization.ts
1001
- /**
1002
- * Takes a {@link ScriptLocalization} and converts it into a schema with matching field names.
1003
- *
1004
- * E.g.
1005
- * ```ts
1006
- * const scriptLocalization = {
1007
- * script: 'ja-Kana',
1008
- * fields: {
1009
- * firstName: 'アレキサンダー',
1010
- * lastName: 'パトリック',
1011
- * },
1012
- * } as const;
1013
- *
1014
- * const schema = mapApiScriptLocalizationToSchemaFields(scriptLocalization);
1015
- * console.log(schema);
1016
- * // {
1017
- * // jaKanaFirstName: 'アレキサンダー',
1018
- * // jaKanaLastName: 'パトリック'
1019
- * // }
1020
- * ```
1021
- *
1022
- */
1023
- function mapApiScriptLocalizationToSchemaFields(localization) {
1024
- const schema = {};
1025
- const scriptNameInSchema = localization.script.replace("-", "");
1026
- for (const [field, value] of Object.entries(localization.fields)) schema[scriptNameInSchema + field[0].toUpperCase() + field.slice(1)] = value;
1027
- return schema;
1028
- }
1029
- /**
1030
- * Given a schema and a script, takes the fields prefixed with that script and produces a {@link ScriptLocalization}.
1031
- *
1032
- * E.g.
1033
- * ```ts
1034
- * const schema = {
1035
- * firstName: 'Alex',
1036
- * lastName: 'Tompkins',
1037
- * jaKanaFirstName: 'アレキサンダー',
1038
- * jaKanaLastName: 'パトリック',
1039
- * jaHaniFirstName: 'pretend this is hiragana',
1040
- * jaHaniLastName: 'this too',
1041
- * };
1042
- *
1043
- * const localization = mapSchemaFieldsToApiScriptLocalization(schema, 'jaKana');
1044
- * console.log(localization);
1045
- * // {
1046
- * // script: 'ja-Kana',
1047
- * // fields: { firstName: 'アレキサンダー', lastName: 'パトリック' },
1048
- * // };
1049
- * ```
1050
- */
1051
- function mapSchemaFieldsToApiScriptLocalization(data, script) {
1052
- const fields = {};
1053
- for (const [schemaField, value] of Object.entries(data)) if (schemaField.startsWith(script)) {
1054
- let fieldName = schemaField.replace(script, "");
1055
- fieldName = fieldName[0].toLowerCase() + fieldName.slice(1);
1056
- fields[fieldName] = value;
1057
- }
1058
- return {
1059
- script: `${script.slice(0, 2)}-${script.slice(2)}`,
1060
- fields
1016
+ //#region src/components/ui/atoms/Tile/Tile.tsx
1017
+ function Tile({ checked, disabled, icon, id, inputType = "checkbox", isHorizontal, label, name, className, onChange, subTitle, value }) {
1018
+ const inputNode = useRef(null);
1019
+ const uniqId = useId("tile");
1020
+ const idUse = id ?? uniqId;
1021
+ const handleChange = (e) => {
1022
+ if (disabled) return;
1023
+ onChange?.(e.currentTarget.checked);
1024
+ inputNode.current?.focus();
1025
+ };
1026
+ const handleClick = (e) => {
1027
+ if (disabled || inputType === "radio") return;
1028
+ if (checked) {
1029
+ e.preventDefault();
1030
+ onChange?.(false);
1031
+ inputNode.current?.focus();
1032
+ }
1061
1033
  };
1034
+ const handleOnKeyDown = (e) => {
1035
+ if (e.key === KEYBOARD_KEYS.enter || e.key === KEYBOARD_KEYS.space) {
1036
+ e.preventDefault();
1037
+ if (disabled) return;
1038
+ if (inputType === "radio" && !checked) {
1039
+ onChange?.(true);
1040
+ inputNode.current?.focus();
1041
+ } else if (inputType === "checkbox") {
1042
+ onChange?.(!checked);
1043
+ inputNode.current?.focus();
1044
+ }
1045
+ }
1046
+ };
1047
+ return /* @__PURE__ */ jsxs("div", {
1048
+ className: cx(Tile_module_default.tileContainer, className, { [Tile_module_default.tileContainerHorizontal]: isHorizontal }),
1049
+ children: [/* @__PURE__ */ jsx("input", {
1050
+ ref: inputNode,
1051
+ className: Tile_module_default.tileCheckbox,
1052
+ disabled,
1053
+ checked: !!checked,
1054
+ value,
1055
+ id: idUse,
1056
+ name,
1057
+ type: inputType,
1058
+ onKeyDown: handleOnKeyDown,
1059
+ onChange: handleChange,
1060
+ onClick: handleClick,
1061
+ "aria-disabled": disabled,
1062
+ tabIndex: disabled ? -1 : 0
1063
+ }), /* @__PURE__ */ jsxs("label", {
1064
+ htmlFor: idUse,
1065
+ className: Tile_module_default.tile,
1066
+ children: [icon && /* @__PURE__ */ jsx("div", {
1067
+ className: Tile_module_default.tileIcon,
1068
+ children: /* @__PURE__ */ jsx(Icon, {
1069
+ name: icon,
1070
+ testId: icon
1071
+ })
1072
+ }), /* @__PURE__ */ jsxs("div", {
1073
+ className: Tile_module_default.tileLabel,
1074
+ children: [/* @__PURE__ */ jsx(Typography, {
1075
+ el: "h4",
1076
+ variant: "body-strongest",
1077
+ className: Tile_module_default.tileTitle,
1078
+ children: label
1079
+ }), subTitle && /* @__PURE__ */ jsx(Typography, {
1080
+ el: "p",
1081
+ variant: "body",
1082
+ children: subTitle
1083
+ })]
1084
+ })]
1085
+ })]
1086
+ });
1062
1087
  }
1063
- //#endregion
1064
- //#region src/utils/isEmpty.ts
1065
- var isEmpty = (obj, ignoreEmptyProperties = true) => {
1066
- if (obj === null || obj === void 0) return true;
1067
- if (Array.isArray(obj)) return obj.length === 0;
1068
- if (typeof obj !== "object") return false;
1069
- return keysOf(obj).every((key) => !Object.hasOwn(obj, key) || ignoreEmptyProperties && isEmpty(obj[key], true));
1088
+ var TileGroup_module_default = {
1089
+ "tile-group": "_tile-group_6rtof_1",
1090
+ tileGroup: "_tile-group_6rtof_1",
1091
+ "tile-container": "_tile-container_6rtof_8",
1092
+ tileContainer: "_tile-container_6rtof_8",
1093
+ "tile-group-error": "_tile-group-error_6rtof_14",
1094
+ tileGroupError: "_tile-group-error_6rtof_14",
1095
+ "tile-group-error-icon": "_tile-group-error-icon_6rtof_27",
1096
+ tileGroupErrorIcon: "_tile-group-error-icon_6rtof_27",
1097
+ "tile-group-horizontal": "_tile-group-horizontal_6rtof_32",
1098
+ tileGroupHorizontal: "_tile-group-horizontal_6rtof_32"
1070
1099
  };
1071
1100
  //#endregion
1072
- //#region src/utils/businessUtils.ts
1073
- /**
1074
- * @description Countries in this list use the provider-backed company search flow.
1075
- * For these countries, business details can be prefilled from provider results,
1076
- * and search/verification may require tax identifiers (for example TIN or VAT)
1077
- * in addition to company name/registration details.
1078
- *
1079
- * If a country is in this list, it means it will attempt to make an api call for company search.
1080
- * If the api doesnt have a provider for that country, it will return no results like below
1081
- * ```
1082
- * {
1083
- * "results": [],
1084
- * "provider": "NO_PROVIDER"
1085
- * }
1086
- * ```
1087
- */
1088
- var COUNTRIES_USING_COMPANY_SEARCH = [
1089
- CountryCodes.UnitedStates,
1090
- CountryCodes.UnitedKingdom,
1091
- CountryCodes.Germany,
1092
- CountryCodes.France
1093
- ];
1094
- /**
1095
- * Source of truth for registration-number exemption eligibility in Business Details.
1096
- *
1097
- * This map defines which company types can use `exemptedFromRegistrationNumber`, grouped by
1098
- * country. All exemption checks should be derived from this structure to keep behavior consistent
1099
- * across form rules.
1100
- *
1101
- * Interpretation:
1102
- * - Non-empty array: exemption is allowed only for the listed company types.
1103
- * - Empty array: exemption is allowed for that country without company-type restrictions.
1104
- *
1105
- */
1106
- var REGISTRATION_NUMBER_EXEMPTION_RULES = {
1107
- [CountryCodes.Australia]: ["governmentalOrganization", "partnershipIncorporated"],
1108
- [CountryCodes.Austria]: ["soleProprietorship"],
1109
- [CountryCodes.Canada]: ["soleProprietorship"],
1110
- [CountryCodes.Denmark]: ["nonProfit"],
1111
- [CountryCodes.Finland]: ["soleProprietorship"],
1112
- [CountryCodes.Germany]: [
1113
- "governmentalOrganization",
1114
- "nonProfit",
1115
- "soleProprietorship"
1116
- ],
1117
- [CountryCodes.HongKong]: [
1118
- "privateCompany",
1119
- "nonProfit",
1120
- "listedPublicCompany",
1121
- "unlistedPublicCompany",
1122
- "governmentalOrganization",
1123
- "partnershipIncorporated",
1124
- "associationIncorporated"
1125
- ],
1126
- [CountryCodes.Lithuania]: ["soleProprietorship"],
1127
- [CountryCodes.Luxembourg]: ["soleProprietorship"],
1128
- [CountryCodes.NewZealand]: [],
1129
- [CountryCodes.Poland]: ["soleProprietorship"],
1130
- [CountryCodes.Sweden]: ["soleProprietorship"],
1131
- [CountryCodes.Switzerland]: ["soleProprietorship"]
1132
- };
1133
- /**
1134
- * Determines whether a registration-number exemption can be offered for a country and company type.
1135
- *
1136
- * Provide `companyType` when checking a specific entity (including a sole proprietorship); this checks
1137
- * that exact type against the country's rule. Omit it when deciding whether to show the exemption option
1138
- * for all company types in that country; it is then available only when at least one
1139
- * non-sole-proprietorship type is eligible.
1140
- *
1141
- * This distinction prevents sole-proprietorship-only countries from exposing the exemption to
1142
- * businesses while still allowing unrestricted countries (an empty rule) for every entity type.
1143
- */
1144
- var isRegistrationExemptionAllowed = ({ country, companyType }) => {
1145
- const allowedCompanyTypes = REGISTRATION_NUMBER_EXEMPTION_RULES[country];
1146
- if (!allowedCompanyTypes) return false;
1147
- if (allowedCompanyTypes.length === 0) return true;
1148
- return companyType ? allowedCompanyTypes.includes(companyType) : allowedCompanyTypes.some((allowedCompanyType) => allowedCompanyType !== "soleProprietorship");
1149
- };
1150
- var isRegistrationNumberAbsentStateV4Scenario = (country, entityType) => country === CountryCodes.Australia && (entityType === "governmentalOrganization" || entityType === "partnershipIncorporated") || country === CountryCodes.NewZealand;
1151
- var COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION = [
1152
- CountryCodes.HongKong,
1153
- CountryCodes.Mexico,
1154
- CountryCodes.PuertoRico,
1155
- CountryCodes.UnitedStates
1156
- ];
1157
- var COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER = [CountryCodes.Canada, CountryCodes.UnitedStates];
1158
- /**
1159
- * Also used to determine what documenttype needs to be used
1160
- * when uploading tax document in mapping.ts
1161
- * */
1162
- var COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT = [
1163
- CountryCodes.Australia,
1164
- CountryCodes.Canada,
1165
- CountryCodes.Gibraltar,
1166
- CountryCodes.HongKong,
1167
- CountryCodes.NewZealand,
1168
- CountryCodes.PuertoRico,
1169
- CountryCodes.Singapore,
1170
- CountryCodes.UnitedStates,
1171
- CountryCodes.Guernsey,
1172
- CountryCodes.Jersey,
1173
- CountryCodes.IsleOfMan,
1174
- CountryCodes.Mexico,
1175
- CountryCodes.Brazil,
1176
- CountryCodes.Japan
1177
- ];
1178
- var COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_COMPANIES = [];
1179
- var COUNTRIES_REQUIRING_FINANCIAL_INFORMATION = [
1180
- CountryCodes.Austria,
1181
- CountryCodes.Belgium,
1182
- CountryCodes.Croatia,
1183
- CountryCodes.Cyprus,
1184
- CountryCodes.Estonia,
1185
- CountryCodes.Finland,
1186
- CountryCodes.France,
1187
- CountryCodes.Germany,
1188
- CountryCodes.Greece,
1189
- CountryCodes.Ireland,
1190
- CountryCodes.Italy,
1191
- CountryCodes.Latvia,
1192
- CountryCodes.Lithuania,
1193
- CountryCodes.Luxembourg,
1194
- CountryCodes.Malta,
1195
- CountryCodes.Netherlands,
1196
- CountryCodes.Portugal,
1197
- CountryCodes.Slovakia,
1198
- CountryCodes.Slovenia,
1199
- CountryCodes.Spain,
1200
- CountryCodes.UnitedKingdom
1201
- ];
1202
- var COUNTRIES_WITH_POSSIBLE_TRUSTEE_TAXID_ABSENT_V4 = [CountryCodes.Australia];
1203
- var TAX_ID_REQUIRED_COUNTRIES_ORGANIZATION = [
1204
- CountryCodes.Austria,
1205
- CountryCodes.Belgium,
1206
- CountryCodes.Croatia,
1207
- CountryCodes.Cyprus,
1208
- CountryCodes.Germany,
1209
- CountryCodes.Greece,
1210
- CountryCodes.Ireland,
1211
- CountryCodes.Luxembourg,
1212
- CountryCodes.Malta,
1213
- CountryCodes.Netherlands,
1214
- CountryCodes.Slovakia,
1215
- CountryCodes.Slovenia
1216
- ];
1217
- /**
1218
- * Sole proprietorship specific rules
1219
- */
1220
- var COUNTRIES_THAT_DONT_REQUIRE_SOLE_PROP_REGISTRATION = [
1221
- CountryCodes.Australia,
1222
- CountryCodes.Gibraltar,
1223
- CountryCodes.Guernsey,
1224
- CountryCodes.HongKong,
1225
- CountryCodes.Ireland,
1226
- CountryCodes.IsleOfMan,
1227
- CountryCodes.Jersey,
1228
- CountryCodes.Malta,
1229
- CountryCodes.Mexico,
1230
- CountryCodes.PuertoRico,
1231
- CountryCodes.Spain,
1232
- CountryCodes.UnitedKingdom,
1233
- CountryCodes.UnitedStates
1234
- ];
1235
- var COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_SOLE_PROPS = [
1236
- CountryCodes.Canada,
1237
- CountryCodes.PuertoRico,
1238
- CountryCodes.UnitedStates
1239
- ];
1240
- var COUNTRIES_THAT_DO_NOT_USE_TAX_ID_FOR_SOLE_PROP = [CountryCodes.Singapore];
1241
- var COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER_SOLE_PROPS = [CountryCodes.Germany];
1242
- var isUsingCompanySearch = (country, taskType) => {
1243
- if (taskType !== TaskTypes.BUSINESS_DETAILS && taskType !== TaskTypes.GLOBAL_ENTRY) return false;
1244
- return COUNTRIES_USING_COMPANY_SEARCH.includes(country);
1245
- };
1246
- /**
1247
- * A Japanese business has a kanji legal name and a katakana reading of it, neither of which can be
1248
- * derived from the roman one, so they travel beside it as script localizations.
1249
- *
1250
- * @param data the form section holding the localized name fields, whatever the task calls it
1251
- * @returns the localizations that were filled in, so an empty array when neither was asked for
1252
- */
1253
- var mapJapaneseLegalNamesToLocalization = (data) => [mapSchemaFieldsToApiScriptLocalization(data, "jaHani"), mapSchemaFieldsToApiScriptLocalization(data, "jaKana")].filter(({ fields }) => !isEmpty(fields)).map(({ script, fields }) => ({
1254
- script,
1255
- fields: { legalName: fields.legalCompanyName }
1256
- }));
1257
- /**
1258
- * Reads the kanji and katakana legal names back out of the script localizations, so they can
1259
- * prefill the fields they came from.
1260
- *
1261
- * @param localization the organization's script localizations, when it has any
1262
- */
1263
- var mapLocalizationToJapaneseLegalNames = (localization) => (localization ?? []).reduce((schemaFields, { script, fields }) => ({
1264
- ...schemaFields,
1265
- ...mapApiScriptLocalizationToSchemaFields({
1266
- script,
1267
- fields: { legalCompanyName: fields?.legalName }
1268
- })
1269
- }), {});
1270
- var Tile_module_default = {
1271
- "tile-container": "_tile-container_17be3_1",
1272
- tileContainer: "_tile-container_17be3_1",
1273
- tile: "_tile_17be3_1",
1274
- "tile-icon": "_tile-icon_17be3_18",
1275
- tileIcon: "_tile-icon_17be3_18",
1276
- "tile-title": "_tile-title_17be3_35",
1277
- tileTitle: "_tile-title_17be3_35",
1278
- "tile-checkbox": "_tile-checkbox_17be3_49",
1279
- tileCheckbox: "_tile-checkbox_17be3_49",
1280
- "tile-container-horizontal": "_tile-container-horizontal_17be3_89",
1281
- tileContainerHorizontal: "_tile-container-horizontal_17be3_89",
1282
- "tile-label": "_tile-label_17be3_100",
1283
- tileLabel: "_tile-label_17be3_100"
1284
- };
1285
- //#endregion
1286
- //#region src/components/ui/atoms/Tile/Tile.tsx
1287
- function Tile({ checked, disabled, icon, id, inputType = "checkbox", isHorizontal, label, name, className, onChange, subTitle, value }) {
1288
- const inputNode = useRef(null);
1289
- const uniqId = useId("tile");
1290
- const idUse = id ?? uniqId;
1291
- const handleChange = (e) => {
1292
- if (disabled) return;
1293
- onChange?.(e.currentTarget.checked);
1294
- inputNode.current?.focus();
1295
- };
1296
- const handleClick = (e) => {
1297
- if (disabled || inputType === "radio") return;
1298
- if (checked) {
1299
- e.preventDefault();
1300
- onChange?.(false);
1301
- inputNode.current?.focus();
1302
- }
1303
- };
1304
- const handleOnKeyDown = (e) => {
1305
- if (e.key === KEYBOARD_KEYS.enter || e.key === KEYBOARD_KEYS.space) {
1306
- e.preventDefault();
1307
- if (disabled) return;
1308
- if (inputType === "radio" && !checked) {
1309
- onChange?.(true);
1310
- inputNode.current?.focus();
1311
- } else if (inputType === "checkbox") {
1312
- onChange?.(!checked);
1313
- inputNode.current?.focus();
1314
- }
1315
- }
1316
- };
1317
- return /* @__PURE__ */ jsxs("div", {
1318
- className: cx(Tile_module_default.tileContainer, className, { [Tile_module_default.tileContainerHorizontal]: isHorizontal }),
1319
- children: [/* @__PURE__ */ jsx("input", {
1320
- ref: inputNode,
1321
- className: Tile_module_default.tileCheckbox,
1322
- disabled,
1323
- checked: !!checked,
1324
- value,
1325
- id: idUse,
1326
- name,
1327
- type: inputType,
1328
- onKeyDown: handleOnKeyDown,
1329
- onChange: handleChange,
1330
- onClick: handleClick,
1331
- "aria-disabled": disabled,
1332
- tabIndex: disabled ? -1 : 0
1333
- }), /* @__PURE__ */ jsxs("label", {
1334
- htmlFor: idUse,
1335
- className: Tile_module_default.tile,
1336
- children: [icon && /* @__PURE__ */ jsx("div", {
1337
- className: Tile_module_default.tileIcon,
1338
- children: /* @__PURE__ */ jsx(Icon, {
1339
- name: icon,
1340
- testId: icon
1341
- })
1342
- }), /* @__PURE__ */ jsxs("div", {
1343
- className: Tile_module_default.tileLabel,
1344
- children: [/* @__PURE__ */ jsx(Typography, {
1345
- el: "h4",
1346
- variant: "body-strongest",
1347
- className: Tile_module_default.tileTitle,
1348
- children: label
1349
- }), subTitle && /* @__PURE__ */ jsx(Typography, {
1350
- el: "p",
1351
- variant: "body",
1352
- children: subTitle
1353
- })]
1354
- })]
1355
- })]
1356
- });
1357
- }
1358
- var TileGroup_module_default = {
1359
- "tile-group": "_tile-group_6rtof_1",
1360
- tileGroup: "_tile-group_6rtof_1",
1361
- "tile-container": "_tile-container_6rtof_8",
1362
- tileContainer: "_tile-container_6rtof_8",
1363
- "tile-group-error": "_tile-group-error_6rtof_14",
1364
- tileGroupError: "_tile-group-error_6rtof_14",
1365
- "tile-group-error-icon": "_tile-group-error-icon_6rtof_27",
1366
- tileGroupErrorIcon: "_tile-group-error-icon_6rtof_27",
1367
- "tile-group-horizontal": "_tile-group-horizontal_6rtof_32",
1368
- tileGroupHorizontal: "_tile-group-horizontal_6rtof_32"
1369
- };
1370
- //#endregion
1371
- //#region src/components/ui/atoms/TileGroup/TileGroup.tsx
1372
- function TileGroup({ tiles, selected, allowMultiple = false, isHorizontal, name: nameProp, maxSelected = Infinity, errorMessage, onChange = noop, enableTracking = false, trackingFieldName }) {
1373
- const uniqName = useId("tile");
1374
- const name = nameProp ?? uniqName;
1375
- const finalName = allowMultiple ? `${name}[]` : name;
1376
- const inputType = allowMultiple ? "checkbox" : "radio";
1377
- const userEvents = useAnalyticsContext();
1378
- return /* @__PURE__ */ jsxs(Fragment, { children: [!!errorMessage?.message && /* @__PURE__ */ jsxs("div", {
1379
- "aria-live": "polite",
1380
- className: TileGroup_module_default.tileGroupError,
1381
- children: [/* @__PURE__ */ jsx("span", {
1382
- className: TileGroup_module_default.tileGroupErrorIcon,
1383
- children: /* @__PURE__ */ jsx(Icon, { name: "field-error" })
1384
- }), errorMessage.message]
1385
- }), /* @__PURE__ */ jsx("div", {
1386
- className: cx(TileGroup_module_default.tileGroup, { [TileGroup_module_default.tileGroupHorizontal]: isHorizontal }),
1387
- children: tiles.map((tile) => {
1388
- const { value, id, icon, subTitle, label, disabled } = tile;
1389
- const handleChange = (checked) => {
1390
- const newSelected = updateSelectedChoices(tile, checked, selected, allowMultiple);
1391
- if (enableTracking) userEvents.addFieldEvent("Interacted with form field", {
1392
- actionType: "input",
1393
- field: trackingFieldName ?? name,
1394
- returnValue: typeof newSelected === "string" ? newSelected : void 0
1395
- });
1396
- onChange(newSelected);
1397
- };
1398
- return /* @__PURE__ */ jsx(Tile, {
1399
- name: finalName,
1400
- className: TileGroup_module_default.tileContainer,
1401
- inputType,
1402
- isHorizontal,
1403
- checked: choiceIsSelected(tile, selected, allowMultiple),
1404
- label,
1405
- id,
1406
- subTitle,
1407
- icon,
1408
- disabled: !disabled && allowMultiple && selected.length >= maxSelected ? !choiceIsSelected(tile, selected, allowMultiple) : disabled,
1409
- value,
1410
- onChange: handleChange
1411
- }, id);
1412
- })
1413
- })] });
1414
- }
1415
- function choiceIsSelected({ value }, selected, allowMultiple) {
1416
- if (!allowMultiple) return value === selected;
1417
- return selected.includes(value);
1418
- }
1419
- function updateSelectedChoices({ value }, checked, selected, allowMultiple) {
1420
- if (!allowMultiple) return checked ? value : "";
1421
- if (Array.isArray(selected)) {
1422
- if (checked) return allowMultiple ? [...selected, value] : [value];
1423
- return selected.filter((selectedChoice) => selectedChoice !== value);
1424
- }
1425
- return [];
1426
- }
1427
- //#endregion
1428
- //#region src/components/Shared/fields/TaxInformationField/taxIdNumberTypes.ts
1429
- var restrictedEntityTypes = [
1430
- "soleProprietorship",
1431
- "trust",
1432
- "individual"
1101
+ //#region src/components/ui/atoms/TileGroup/TileGroup.tsx
1102
+ function TileGroup({ tiles, selected, allowMultiple = false, isHorizontal, name: nameProp, maxSelected = Infinity, errorMessage, onChange = noop, enableTracking = false, trackingFieldName }) {
1103
+ const uniqName = useId("tile");
1104
+ const name = nameProp ?? uniqName;
1105
+ const finalName = allowMultiple ? `${name}[]` : name;
1106
+ const inputType = allowMultiple ? "checkbox" : "radio";
1107
+ const userEvents = useAnalyticsContext();
1108
+ return /* @__PURE__ */ jsxs(Fragment, { children: [!!errorMessage?.message && /* @__PURE__ */ jsxs("div", {
1109
+ "aria-live": "polite",
1110
+ className: TileGroup_module_default.tileGroupError,
1111
+ children: [/* @__PURE__ */ jsx("span", {
1112
+ className: TileGroup_module_default.tileGroupErrorIcon,
1113
+ children: /* @__PURE__ */ jsx(Icon, { name: "field-error" })
1114
+ }), errorMessage.message]
1115
+ }), /* @__PURE__ */ jsx("div", {
1116
+ className: cx(TileGroup_module_default.tileGroup, { [TileGroup_module_default.tileGroupHorizontal]: isHorizontal }),
1117
+ children: tiles.map((tile) => {
1118
+ const { value, id, icon, subTitle, label, disabled } = tile;
1119
+ const handleChange = (checked) => {
1120
+ const newSelected = updateSelectedChoices(tile, checked, selected, allowMultiple);
1121
+ if (enableTracking) userEvents.addFieldEvent("Interacted with form field", {
1122
+ actionType: "input",
1123
+ field: trackingFieldName ?? name,
1124
+ returnValue: typeof newSelected === "string" ? newSelected : void 0
1125
+ });
1126
+ onChange(newSelected);
1127
+ };
1128
+ return /* @__PURE__ */ jsx(Tile, {
1129
+ name: finalName,
1130
+ className: TileGroup_module_default.tileContainer,
1131
+ inputType,
1132
+ isHorizontal,
1133
+ checked: choiceIsSelected(tile, selected, allowMultiple),
1134
+ label,
1135
+ id,
1136
+ subTitle,
1137
+ icon,
1138
+ disabled: !disabled && allowMultiple && selected.length >= maxSelected ? !choiceIsSelected(tile, selected, allowMultiple) : disabled,
1139
+ value,
1140
+ onChange: handleChange
1141
+ }, id);
1142
+ })
1143
+ })] });
1144
+ }
1145
+ function choiceIsSelected({ value }, selected, allowMultiple) {
1146
+ if (!allowMultiple) return value === selected;
1147
+ return selected.includes(value);
1148
+ }
1149
+ function updateSelectedChoices({ value }, checked, selected, allowMultiple) {
1150
+ if (!allowMultiple) return checked ? value : "";
1151
+ if (Array.isArray(selected)) {
1152
+ if (checked) return allowMultiple ? [...selected, value] : [value];
1153
+ return selected.filter((selectedChoice) => selectedChoice !== value);
1154
+ }
1155
+ return [];
1156
+ }
1157
+ //#endregion
1158
+ //#region src/components/Shared/fields/TaxInformationField/taxIdNumberTypes.ts
1159
+ var restrictedEntityTypes = [
1160
+ "soleProprietorship",
1161
+ "trust",
1162
+ "individual"
1433
1163
  ];
1434
1164
  var isRestrictedEntityType = (entityType) => Boolean(entityType && restrictedEntityTypes.includes(entityType));
1435
1165
  var isApplicableOnlyForSingleRestrictedType = (option) => {
@@ -1747,100 +1477,358 @@ var taxIdNumberOptions = {
1747
1477
  applicableOnlyFor: ["individual"]
1748
1478
  }
1749
1479
  ],
1750
- [CountryCodes.Slovakia]: [{
1751
- id: "RODNE_CISLO",
1752
- name: "taxInformationNumber__SK_Individual",
1753
- applicableOnlyFor: ["individual"]
1754
- }, {
1755
- id: "NATIONAL_IDENTIFICATION_NUMBER",
1756
- name: "taxInformationNumber__SK_Org",
1757
- applicableOnlyFor: ["privateCompany"]
1758
- }],
1759
- [CountryCodes.Slovenia]: [{
1760
- id: "SI_TAX_NUMBER",
1761
- name: "taxInformationNumber__SI_Individual",
1762
- applicableOnlyFor: ["individual"]
1763
- }, {
1764
- id: "NATIONAL_IDENTIFICATION_NUMBER",
1765
- name: "taxInformationNumber__SI_Org",
1766
- applicableOnlyFor: ["privateCompany"]
1767
- }],
1768
- [CountryCodes.SouthAfrica]: [{
1769
- id: "INCOME_TAX_REFERENCE_NUMBER",
1770
- name: "taxInformationNumber__ZA",
1771
- applicableOnlyFor: ["individual"]
1772
- }],
1773
- [CountryCodes.Spain]: [
1774
- {
1775
- id: "DNI",
1776
- name: "dni",
1777
- applicableOnlyFor: ["individual"]
1778
- },
1779
- {
1780
- id: "NIE",
1781
- name: "nie",
1782
- applicableOnlyFor: ["individual"]
1783
- },
1784
- {
1785
- id: "NIF",
1786
- name: "NIF",
1787
- applicableOnlyFor: ["privateCompany"]
1788
- }
1480
+ [CountryCodes.Slovakia]: [{
1481
+ id: "RODNE_CISLO",
1482
+ name: "taxInformationNumber__SK_Individual",
1483
+ applicableOnlyFor: ["individual"]
1484
+ }, {
1485
+ id: "NATIONAL_IDENTIFICATION_NUMBER",
1486
+ name: "taxInformationNumber__SK_Org",
1487
+ applicableOnlyFor: ["privateCompany"]
1488
+ }],
1489
+ [CountryCodes.Slovenia]: [{
1490
+ id: "SI_TAX_NUMBER",
1491
+ name: "taxInformationNumber__SI_Individual",
1492
+ applicableOnlyFor: ["individual"]
1493
+ }, {
1494
+ id: "NATIONAL_IDENTIFICATION_NUMBER",
1495
+ name: "taxInformationNumber__SI_Org",
1496
+ applicableOnlyFor: ["privateCompany"]
1497
+ }],
1498
+ [CountryCodes.SouthAfrica]: [{
1499
+ id: "INCOME_TAX_REFERENCE_NUMBER",
1500
+ name: "taxInformationNumber__ZA",
1501
+ applicableOnlyFor: ["individual"]
1502
+ }],
1503
+ [CountryCodes.Spain]: [
1504
+ {
1505
+ id: "DNI",
1506
+ name: "dni",
1507
+ applicableOnlyFor: ["individual"]
1508
+ },
1509
+ {
1510
+ id: "NIE",
1511
+ name: "nie",
1512
+ applicableOnlyFor: ["individual"]
1513
+ },
1514
+ {
1515
+ id: "NIF",
1516
+ name: "NIF",
1517
+ applicableOnlyFor: ["privateCompany"]
1518
+ }
1519
+ ],
1520
+ [CountryCodes.Sweden]: [{
1521
+ id: "PERSONNUMMER",
1522
+ name: "taxInformationNumber__SE",
1523
+ applicableOnlyFor: ["individual"]
1524
+ }],
1525
+ [CountryCodes.Switzerland]: [{
1526
+ id: "AHV_NUMBER",
1527
+ name: "taxInformationNumber__CH",
1528
+ applicableOnlyFor: ["individual"]
1529
+ }],
1530
+ [CountryCodes.UnitedArabEmirates]: [{
1531
+ id: "EMIRATES_ID",
1532
+ name: "taxInformationNumber__AE",
1533
+ applicableOnlyFor: ["individual"]
1534
+ }],
1535
+ [CountryCodes.UnitedKingdom]: [{
1536
+ id: "UTR",
1537
+ name: "utr"
1538
+ }, {
1539
+ id: "NINO",
1540
+ name: "nationalInsuranceNumber",
1541
+ applicableOnlyFor: ["individual"]
1542
+ }],
1543
+ [CountryCodes.UnitedStates]: [{
1544
+ id: "EIN",
1545
+ name: "ein"
1546
+ }]
1547
+ };
1548
+ var getTaxIdNumberOptions = (country, companyType) => {
1549
+ const optionsForCountry = taxIdNumberOptions[country];
1550
+ if (!optionsForCountry) return optionsForCountry;
1551
+ if (isRestrictedEntityType(companyType)) return optionsForCountry.filter((option) => option.applicableOnlyFor?.includes(companyType) ?? true);
1552
+ return optionsForCountry.filter((option) => !isApplicableOnlyForSingleRestrictedType(option));
1553
+ };
1554
+ var getTaxIdNumberSelectorOptions = (country, companyType, exemptedOptionLabel) => {
1555
+ const availableOptions = getTaxIdNumberOptions(country, companyType) ?? [];
1556
+ if (availableOptions.length === 0 || !exemptedOptionLabel) return availableOptions;
1557
+ return [...availableOptions, {
1558
+ id: "exempted",
1559
+ name: exemptedOptionLabel
1560
+ }];
1561
+ };
1562
+ function getValidCompanyTypesForTaxIdNumberType(country, taxIdNumberType) {
1563
+ if (!taxIdNumberType) return void 0;
1564
+ const taxIdOption = taxIdNumberOptions[country]?.find((option) => option.id === taxIdNumberType);
1565
+ if (!taxIdOption?.applicableOnlyFor) return void 0;
1566
+ const validCompanyTypes = taxIdOption.applicableOnlyFor.filter((type) => type !== "individual" && type !== "trust" && type !== "unincorporatedPartnership");
1567
+ return validCompanyTypes.length > 0 ? validCompanyTypes : void 0;
1568
+ }
1569
+ //#endregion
1570
+ //#region src/utils/mapScriptLocalization.ts
1571
+ /**
1572
+ * Takes a {@link ScriptLocalization} and converts it into a schema with matching field names.
1573
+ *
1574
+ * E.g.
1575
+ * ```ts
1576
+ * const scriptLocalization = {
1577
+ * script: 'ja-Kana',
1578
+ * fields: {
1579
+ * firstName: 'アレキサンダー',
1580
+ * lastName: 'パトリック',
1581
+ * },
1582
+ * } as const;
1583
+ *
1584
+ * const schema = mapApiScriptLocalizationToSchemaFields(scriptLocalization);
1585
+ * console.log(schema);
1586
+ * // {
1587
+ * // jaKanaFirstName: 'アレキサンダー',
1588
+ * // jaKanaLastName: 'パトリック'
1589
+ * // }
1590
+ * ```
1591
+ *
1592
+ */
1593
+ function mapApiScriptLocalizationToSchemaFields(localization) {
1594
+ const schema = {};
1595
+ const scriptNameInSchema = localization.script.replace("-", "");
1596
+ for (const [field, value] of Object.entries(localization.fields)) schema[scriptNameInSchema + field[0].toUpperCase() + field.slice(1)] = value;
1597
+ return schema;
1598
+ }
1599
+ /**
1600
+ * Given a schema and a script, takes the fields prefixed with that script and produces a {@link ScriptLocalization}.
1601
+ *
1602
+ * E.g.
1603
+ * ```ts
1604
+ * const schema = {
1605
+ * firstName: 'Alex',
1606
+ * lastName: 'Tompkins',
1607
+ * jaKanaFirstName: 'アレキサンダー',
1608
+ * jaKanaLastName: 'パトリック',
1609
+ * jaHaniFirstName: 'pretend this is hiragana',
1610
+ * jaHaniLastName: 'this too',
1611
+ * };
1612
+ *
1613
+ * const localization = mapSchemaFieldsToApiScriptLocalization(schema, 'jaKana');
1614
+ * console.log(localization);
1615
+ * // {
1616
+ * // script: 'ja-Kana',
1617
+ * // fields: { firstName: 'アレキサンダー', lastName: 'パトリック' },
1618
+ * // };
1619
+ * ```
1620
+ */
1621
+ function mapSchemaFieldsToApiScriptLocalization(data, script) {
1622
+ const fields = {};
1623
+ for (const [schemaField, value] of Object.entries(data)) if (schemaField.startsWith(script)) {
1624
+ let fieldName = schemaField.replace(script, "");
1625
+ fieldName = fieldName[0].toLowerCase() + fieldName.slice(1);
1626
+ fields[fieldName] = value;
1627
+ }
1628
+ return {
1629
+ script: `${script.slice(0, 2)}-${script.slice(2)}`,
1630
+ fields
1631
+ };
1632
+ }
1633
+ //#endregion
1634
+ //#region src/utils/businessUtils.ts
1635
+ /**
1636
+ * @description Countries in this list use the provider-backed company search flow.
1637
+ * For these countries, business details can be prefilled from provider results,
1638
+ * and search/verification may require tax identifiers (for example TIN or VAT)
1639
+ * in addition to company name/registration details.
1640
+ *
1641
+ * If a country is in this list, it means it will attempt to make an api call for company search.
1642
+ * If the api doesnt have a provider for that country, it will return no results like below
1643
+ * ```
1644
+ * {
1645
+ * "results": [],
1646
+ * "provider": "NO_PROVIDER"
1647
+ * }
1648
+ * ```
1649
+ */
1650
+ var COUNTRIES_USING_COMPANY_SEARCH = [
1651
+ CountryCodes.UnitedStates,
1652
+ CountryCodes.UnitedKingdom,
1653
+ CountryCodes.Germany,
1654
+ CountryCodes.France
1655
+ ];
1656
+ /**
1657
+ * Source of truth for registration-number exemption eligibility in Business Details.
1658
+ *
1659
+ * This map defines which company types can use `exemptedFromRegistrationNumber`, grouped by
1660
+ * country. All exemption checks should be derived from this structure to keep behavior consistent
1661
+ * across form rules.
1662
+ *
1663
+ * Interpretation:
1664
+ * - Non-empty array: exemption is allowed only for the listed company types.
1665
+ * - Empty array: exemption is allowed for that country without company-type restrictions.
1666
+ *
1667
+ */
1668
+ var REGISTRATION_NUMBER_EXEMPTION_RULES = {
1669
+ [CountryCodes.Australia]: ["governmentalOrganization", "partnershipIncorporated"],
1670
+ [CountryCodes.Austria]: ["soleProprietorship"],
1671
+ [CountryCodes.Canada]: ["soleProprietorship"],
1672
+ [CountryCodes.Denmark]: ["nonProfit"],
1673
+ [CountryCodes.Finland]: ["soleProprietorship"],
1674
+ [CountryCodes.Germany]: [
1675
+ "governmentalOrganization",
1676
+ "nonProfit",
1677
+ "soleProprietorship"
1678
+ ],
1679
+ [CountryCodes.HongKong]: [
1680
+ "privateCompany",
1681
+ "nonProfit",
1682
+ "listedPublicCompany",
1683
+ "unlistedPublicCompany",
1684
+ "governmentalOrganization",
1685
+ "partnershipIncorporated",
1686
+ "associationIncorporated"
1789
1687
  ],
1790
- [CountryCodes.Sweden]: [{
1791
- id: "PERSONNUMMER",
1792
- name: "taxInformationNumber__SE",
1793
- applicableOnlyFor: ["individual"]
1794
- }],
1795
- [CountryCodes.Switzerland]: [{
1796
- id: "AHV_NUMBER",
1797
- name: "taxInformationNumber__CH",
1798
- applicableOnlyFor: ["individual"]
1799
- }],
1800
- [CountryCodes.UnitedArabEmirates]: [{
1801
- id: "EMIRATES_ID",
1802
- name: "taxInformationNumber__AE",
1803
- applicableOnlyFor: ["individual"]
1804
- }],
1805
- [CountryCodes.UnitedKingdom]: [{
1806
- id: "UTR",
1807
- name: "utr"
1808
- }, {
1809
- id: "NINO",
1810
- name: "nationalInsuranceNumber",
1811
- applicableOnlyFor: ["individual"]
1812
- }],
1813
- [CountryCodes.UnitedStates]: [{
1814
- id: "EIN",
1815
- name: "ein"
1816
- }]
1817
- };
1818
- var getTaxIdNumberOptions = (country, companyType) => {
1819
- const optionsForCountry = taxIdNumberOptions[country];
1820
- if (!optionsForCountry) return optionsForCountry;
1821
- if (isRestrictedEntityType(companyType)) return optionsForCountry.filter((option) => option.applicableOnlyFor?.includes(companyType) ?? true);
1822
- return optionsForCountry.filter((option) => !isApplicableOnlyForSingleRestrictedType(option));
1688
+ [CountryCodes.Lithuania]: ["soleProprietorship"],
1689
+ [CountryCodes.Luxembourg]: ["soleProprietorship"],
1690
+ [CountryCodes.NewZealand]: [],
1691
+ [CountryCodes.Poland]: ["soleProprietorship"],
1692
+ [CountryCodes.Sweden]: ["soleProprietorship"],
1693
+ [CountryCodes.Switzerland]: ["soleProprietorship"]
1823
1694
  };
1824
- var getTaxIdNumberSelectorOptions = (country, companyType, exemptedOptionLabel) => {
1825
- const availableOptions = getTaxIdNumberOptions(country, companyType) ?? [];
1826
- if (availableOptions.length === 0 || !exemptedOptionLabel) return availableOptions;
1827
- return [...availableOptions, {
1828
- id: "exempted",
1829
- name: exemptedOptionLabel
1830
- }];
1695
+ /**
1696
+ * Determines whether a registration-number exemption can be offered for a country and company type.
1697
+ *
1698
+ * Provide `companyType` when checking a specific entity (including a sole proprietorship); this checks
1699
+ * that exact type against the country's rule. Omit it when deciding whether to show the exemption option
1700
+ * for all company types in that country; it is then available only when at least one
1701
+ * non-sole-proprietorship type is eligible.
1702
+ *
1703
+ * This distinction prevents sole-proprietorship-only countries from exposing the exemption to
1704
+ * businesses while still allowing unrestricted countries (an empty rule) for every entity type.
1705
+ */
1706
+ var isRegistrationExemptionAllowed = ({ country, companyType }) => {
1707
+ const allowedCompanyTypes = REGISTRATION_NUMBER_EXEMPTION_RULES[country];
1708
+ if (!allowedCompanyTypes) return false;
1709
+ if (allowedCompanyTypes.length === 0) return true;
1710
+ return companyType ? allowedCompanyTypes.includes(companyType) : allowedCompanyTypes.some((allowedCompanyType) => allowedCompanyType !== "soleProprietorship");
1831
1711
  };
1832
- function getValidCompanyTypesForTaxIdNumberType(country, taxIdNumberType) {
1833
- if (!taxIdNumberType) return void 0;
1834
- const taxIdOption = taxIdNumberOptions[country]?.find((option) => option.id === taxIdNumberType);
1835
- if (!taxIdOption?.applicableOnlyFor) return void 0;
1836
- const validCompanyTypes = taxIdOption.applicableOnlyFor.filter((type) => type !== "individual" && type !== "trust" && type !== "unincorporatedPartnership");
1837
- return validCompanyTypes.length > 0 ? validCompanyTypes : void 0;
1838
- }
1839
- //#endregion
1840
- //#region src/utils/japanSupportUtils.ts
1841
- var isJapanLocalizationEnabled = (isSettingEnabled = () => false, country) => {
1842
- return country === CountryCodes.Japan && isSettingEnabled("enableJapanLocalization");
1712
+ var isRegistrationNumberAbsentStateV4Scenario = (country, entityType) => country === CountryCodes.Australia && (entityType === "governmentalOrganization" || entityType === "partnershipIncorporated") || country === CountryCodes.NewZealand;
1713
+ var COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION = [
1714
+ CountryCodes.HongKong,
1715
+ CountryCodes.Mexico,
1716
+ CountryCodes.PuertoRico,
1717
+ CountryCodes.UnitedStates
1718
+ ];
1719
+ var COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER = [CountryCodes.Canada, CountryCodes.UnitedStates];
1720
+ /**
1721
+ * Also used to determine what documenttype needs to be used
1722
+ * when uploading tax document in mapping.ts
1723
+ * */
1724
+ var COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT = [
1725
+ CountryCodes.Australia,
1726
+ CountryCodes.Canada,
1727
+ CountryCodes.Gibraltar,
1728
+ CountryCodes.HongKong,
1729
+ CountryCodes.NewZealand,
1730
+ CountryCodes.PuertoRico,
1731
+ CountryCodes.Singapore,
1732
+ CountryCodes.UnitedStates,
1733
+ CountryCodes.Guernsey,
1734
+ CountryCodes.Jersey,
1735
+ CountryCodes.IsleOfMan,
1736
+ CountryCodes.Mexico,
1737
+ CountryCodes.Brazil,
1738
+ CountryCodes.Japan
1739
+ ];
1740
+ var COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_COMPANIES = [];
1741
+ var COUNTRIES_REQUIRING_FINANCIAL_INFORMATION = [
1742
+ CountryCodes.Austria,
1743
+ CountryCodes.Belgium,
1744
+ CountryCodes.Croatia,
1745
+ CountryCodes.Cyprus,
1746
+ CountryCodes.Estonia,
1747
+ CountryCodes.Finland,
1748
+ CountryCodes.France,
1749
+ CountryCodes.Germany,
1750
+ CountryCodes.Greece,
1751
+ CountryCodes.Ireland,
1752
+ CountryCodes.Italy,
1753
+ CountryCodes.Latvia,
1754
+ CountryCodes.Lithuania,
1755
+ CountryCodes.Luxembourg,
1756
+ CountryCodes.Malta,
1757
+ CountryCodes.Netherlands,
1758
+ CountryCodes.Portugal,
1759
+ CountryCodes.Slovakia,
1760
+ CountryCodes.Slovenia,
1761
+ CountryCodes.Spain,
1762
+ CountryCodes.UnitedKingdom
1763
+ ];
1764
+ var COUNTRIES_WITH_POSSIBLE_TRUSTEE_TAXID_ABSENT_V4 = [CountryCodes.Australia];
1765
+ var TAX_ID_REQUIRED_COUNTRIES_ORGANIZATION = [
1766
+ CountryCodes.Austria,
1767
+ CountryCodes.Belgium,
1768
+ CountryCodes.Croatia,
1769
+ CountryCodes.Cyprus,
1770
+ CountryCodes.Germany,
1771
+ CountryCodes.Greece,
1772
+ CountryCodes.Ireland,
1773
+ CountryCodes.Luxembourg,
1774
+ CountryCodes.Malta,
1775
+ CountryCodes.Netherlands,
1776
+ CountryCodes.Slovakia,
1777
+ CountryCodes.Slovenia
1778
+ ];
1779
+ /**
1780
+ * Sole proprietorship specific rules
1781
+ */
1782
+ var COUNTRIES_THAT_DONT_REQUIRE_SOLE_PROP_REGISTRATION = [
1783
+ CountryCodes.Australia,
1784
+ CountryCodes.Gibraltar,
1785
+ CountryCodes.Guernsey,
1786
+ CountryCodes.HongKong,
1787
+ CountryCodes.Ireland,
1788
+ CountryCodes.IsleOfMan,
1789
+ CountryCodes.Jersey,
1790
+ CountryCodes.Malta,
1791
+ CountryCodes.Mexico,
1792
+ CountryCodes.PuertoRico,
1793
+ CountryCodes.Spain,
1794
+ CountryCodes.UnitedKingdom,
1795
+ CountryCodes.UnitedStates
1796
+ ];
1797
+ var COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_SOLE_PROPS = [
1798
+ CountryCodes.Canada,
1799
+ CountryCodes.PuertoRico,
1800
+ CountryCodes.UnitedStates
1801
+ ];
1802
+ var COUNTRIES_THAT_DO_NOT_USE_TAX_ID_FOR_SOLE_PROP = [CountryCodes.Singapore];
1803
+ var COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER_SOLE_PROPS = [CountryCodes.Germany];
1804
+ var isUsingCompanySearch = (country, taskType) => {
1805
+ if (taskType !== TaskTypes.BUSINESS_DETAILS && taskType !== TaskTypes.GLOBAL_ENTRY) return false;
1806
+ return COUNTRIES_USING_COMPANY_SEARCH.includes(country);
1843
1807
  };
1808
+ /**
1809
+ * A Japanese business has a kanji legal name and a katakana reading of it, neither of which can be
1810
+ * derived from the roman one, so they travel beside it as script localizations.
1811
+ *
1812
+ * @param data the form section holding the localized name fields, whatever the task calls it
1813
+ * @returns the localizations that were filled in, so an empty array when neither was asked for
1814
+ */
1815
+ var mapJapaneseLegalNamesToLocalization = (data) => [mapSchemaFieldsToApiScriptLocalization(data, "jaHani"), mapSchemaFieldsToApiScriptLocalization(data, "jaKana")].filter(({ fields }) => !isEmpty(fields)).map(({ script, fields }) => ({
1816
+ script,
1817
+ fields: { legalName: fields.legalCompanyName }
1818
+ }));
1819
+ /**
1820
+ * Reads the kanji and katakana legal names back out of the script localizations, so they can
1821
+ * prefill the fields they came from.
1822
+ *
1823
+ * @param localization the organization's script localizations, when it has any
1824
+ */
1825
+ var mapLocalizationToJapaneseLegalNames = (localization) => (localization ?? []).reduce((schemaFields, { script, fields }) => ({
1826
+ ...schemaFields,
1827
+ ...mapApiScriptLocalizationToSchemaFields({
1828
+ script,
1829
+ fields: { legalCompanyName: fields?.legalName }
1830
+ })
1831
+ }), {});
1844
1832
  //#endregion
1845
1833
  //#region src/utils/textTransformation/toFullWidth.ts
1846
1834
  var applyDelta = (delta) => (char) => String.fromCharCode(char.charCodeAt(0) + delta);
@@ -3545,4 +3533,4 @@ var isBafinSignatoryFlow = ({ taskType, data, scenarios }) => {
3545
3533
  return false;
3546
3534
  };
3547
3535
  //#endregion
3548
- export { COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT as A, isUsingCompanySearch as B, getValidCompanyTypesForTaxIdNumberType as C, COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION as D, COUNTRIES_REQUIRING_FINANCIAL_INFORMATION as E, COUNTRIES_WITH_POSSIBLE_TRUSTEE_TAXID_ABSENT_V4 as F, mapSchemaFieldsToApiScriptLocalization as G, mapLocalizationToJapaneseLegalNames as H, REGISTRATION_NUMBER_EXEMPTION_RULES as I, stateFormatGuidanceText as J, businessRegistrationNumberPatterns as K, TAX_ID_REQUIRED_COUNTRIES_ORGANIZATION as L, COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER_SOLE_PROPS as M, COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_COMPANIES as N, COUNTRIES_THAT_DONT_REQUIRE_SOLE_PROP_REGISTRATION as O, COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_SOLE_PROPS as P, isRegistrationExemptionAllowed as R, getTaxIdNumberOptions as S, TileGroup as T, isEmpty as U, mapJapaneseLegalNamesToLocalization as V, mapApiScriptLocalizationToSchemaFields as W, getTaxInformationPlaceholderText as _, idNowPostSubmit as a, toFullWidth as b, DataConflictsModal as c, removeTaxInfoForCountry as d, upsertTaxInfoForCountry as f, exemptedFromTaxDefaultFieldMetadata as g, exemptedFromTaxDefaultFieldConfig as h, idNowModalChildEntityId as i, COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER as j, COUNTRIES_THAT_DO_NOT_USE_TAX_ID_FOR_SOLE_PROP as k, TAX_INFORMATION_FIELD as l, findExistingTaxInformation as m, isBafinSignatoryFlow as n, shouldShowIdNowModal as o, TaxIdNumberTypeSelector as p, businessRegistrationNumberMasks as q, removeIdVerificationProblemsForBafinSignatory as r, showIdNowModal as s, getIdNowMissingDataPoints as t, TaxInformationField as u, taxInformationDefaultFieldConfig as v, taxIdNumberOptions as w, isJapanLocalizationEnabled as x, taxInformationDefaultFieldMetadata as y, isRegistrationNumberAbsentStateV4Scenario as z };
3536
+ export { COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_SOLE_PROPS as A, mapSchemaFieldsToApiScriptLocalization as B, COUNTRIES_THAT_DONT_REQUIRE_SOLE_PROP_REGISTRATION as C, COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER as D, COUNTRIES_USING_COMPANY_SEARCH as E, isRegistrationNumberAbsentStateV4Scenario as F, businessRegistrationNumberPatterns as G, getValidCompanyTypesForTaxIdNumberType as H, isUsingCompanySearch as I, businessRegistrationNumberMasks as K, mapJapaneseLegalNamesToLocalization as L, REGISTRATION_NUMBER_EXEMPTION_RULES as M, TAX_ID_REQUIRED_COUNTRIES_ORGANIZATION as N, COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER_SOLE_PROPS as O, isRegistrationExemptionAllowed as P, mapLocalizationToJapaneseLegalNames as R, COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION as S, COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT as T, taxIdNumberOptions as U, getTaxIdNumberOptions as V, TileGroup as W, getTaxInformationPlaceholderText as _, idNowPostSubmit as a, toFullWidth as b, DataConflictsModal as c, removeTaxInfoForCountry as d, upsertTaxInfoForCountry as f, exemptedFromTaxDefaultFieldMetadata as g, exemptedFromTaxDefaultFieldConfig as h, idNowModalChildEntityId as i, COUNTRIES_WITH_POSSIBLE_TRUSTEE_TAXID_ABSENT_V4 as j, COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_COMPANIES as k, TAX_INFORMATION_FIELD as l, findExistingTaxInformation as m, isBafinSignatoryFlow as n, shouldShowIdNowModal as o, TaxIdNumberTypeSelector as p, stateFormatGuidanceText as q, removeIdVerificationProblemsForBafinSignatory as r, showIdNowModal as s, getIdNowMissingDataPoints as t, TaxInformationField as u, taxInformationDefaultFieldConfig as v, COUNTRIES_THAT_DO_NOT_USE_TAX_ID_FOR_SOLE_PROP as w, COUNTRIES_REQUIRING_FINANCIAL_INFORMATION as x, taxInformationDefaultFieldMetadata as y, mapApiScriptLocalizationToSchemaFields as z };