@justifi/webcomponents 6.12.6 → 6.12.7-rc.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 (319) hide show
  1. package/dist/cjs/{Analytics-CuYtRPw5.js → Analytics-GZGMuFW6.js} +2 -2
  2. package/dist/cjs/{Plaid-BRSyOOuw.js → Plaid-KasiL5mp.js} +14 -19
  3. package/dist/cjs/{additional-questions-form-step_14.cjs.entry.js → additional-questions-form-step_15.cjs.entry.js} +378 -169
  4. package/dist/cjs/additional-questions_5.cjs.entry.js +7 -7
  5. package/dist/cjs/additional-statement_8.cjs.entry.js +1 -1
  6. package/dist/cjs/bank-account-billing-form-simple_4.cjs.entry.js +4 -4
  7. package/dist/cjs/bank-account-document-form-inputs.cjs.entry.js +21 -0
  8. package/dist/cjs/bank-account-form.cjs.entry.js +2 -2
  9. package/dist/cjs/{business-form-options-D_nM7NDk.js → business-form-options-CnlrfbQ6.js} +51 -0
  10. package/dist/cjs/{business-identity-schema-DuFGX6_i.js → business-identity-schema-CC1wOwXd.js} +11 -7
  11. package/dist/cjs/{business.service-Z9OACEQL.js → business.service-BBovho58.js} +1 -1
  12. package/dist/cjs/card-form.cjs.entry.js +2 -2
  13. package/dist/cjs/{check-pkg-version-CPWLIT6P.js → check-pkg-version-FPtenLmp.js} +1 -1
  14. package/dist/cjs/{checkout.service-BZOyqXgW.js → checkout.service-C0M9hmsL.js} +1 -1
  15. package/dist/cjs/{country-config-aJp8ScEs.js → country-config-Ck-eEeZZ.js} +2 -0
  16. package/dist/cjs/dispute-notification_2.cjs.entry.js +6 -6
  17. package/dist/cjs/{event-types-AU1B76Vm.js → event-types-DDNVjmfR.js} +1 -1
  18. package/dist/cjs/form-address-fields_3.cjs.entry.js +1 -1
  19. package/dist/cjs/form-control-number_2.cjs.entry.js +5 -4
  20. package/dist/cjs/{get-business-aR-C83KX.js → get-business-Ggw-UjXj.js} +2 -2
  21. package/dist/cjs/{get-payment-details-dwhA02Zl.js → get-payment-details-BVKRwME1.js} +2 -2
  22. package/dist/cjs/{get-subaccounts-B1jmSa2d.js → get-subaccounts-RRmcS9xU.js} +2 -2
  23. package/dist/cjs/hidden-input_2.cjs.entry.js +1 -1
  24. package/dist/cjs/{index.esm-C1ZPG85l.js → index.esm-BNETBIV_.js} +0 -18
  25. package/dist/cjs/justifi-apple-pay_11.cjs.entry.js +8 -8
  26. package/dist/cjs/justifi-bank-account-billing-form-simple.cjs.entry.js +5 -5
  27. package/dist/cjs/justifi-bank-account-form.cjs.entry.js +5 -5
  28. package/dist/cjs/justifi-billing-form-full.cjs.entry.js +1 -1
  29. package/dist/cjs/justifi-billing-form.cjs.entry.js +1 -1
  30. package/dist/cjs/justifi-business-details.cjs.entry.js +8 -8
  31. package/dist/cjs/justifi-business-form.cjs.entry.js +13 -13
  32. package/dist/cjs/justifi-card-billing-form-simple.cjs.entry.js +1 -1
  33. package/dist/cjs/justifi-card-form.cjs.entry.js +5 -5
  34. package/dist/cjs/justifi-checkout.cjs.entry.js +5 -5
  35. package/dist/cjs/justifi-checkouts-list-filters.cjs.entry.js +2 -2
  36. package/dist/cjs/justifi-checkouts-list.cjs.entry.js +8 -8
  37. package/dist/cjs/justifi-dispute-management.cjs.entry.js +7 -7
  38. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +6 -6
  39. package/dist/cjs/justifi-order-terminals.cjs.entry.js +9 -9
  40. package/dist/cjs/justifi-payment-details.cjs.entry.js +8 -8
  41. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +9 -9
  42. package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +7 -7
  43. package/dist/cjs/justifi-payments-list-filters.cjs.entry.js +1 -1
  44. package/dist/cjs/justifi-payments-list.cjs.entry.js +7 -7
  45. package/dist/cjs/justifi-payout-details.cjs.entry.js +8 -8
  46. package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +7 -7
  47. package/dist/cjs/justifi-payouts-list-filters.cjs.entry.js +2 -2
  48. package/dist/cjs/justifi-payouts-list.cjs.entry.js +9 -9
  49. package/dist/cjs/justifi-refund-payment.cjs.entry.js +9 -9
  50. package/dist/cjs/justifi-save-new-payment-method.cjs.entry.js +1 -1
  51. package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +6 -6
  52. package/dist/cjs/justifi-skeleton.cjs.entry.js +1 -1
  53. package/dist/cjs/justifi-terminal-orders-list-filters.cjs.entry.js +2 -2
  54. package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +6 -6
  55. package/dist/cjs/justifi-terminals-list-filters.cjs.entry.js +2 -2
  56. package/dist/cjs/justifi-terminals-list.cjs.entry.js +8 -8
  57. package/dist/cjs/loader.cjs.js +1 -1
  58. package/dist/cjs/{package-Dxjq_cJI.js → package-C7Z9XAuc.js} +1 -1
  59. package/dist/cjs/payment-method-option.cjs.entry.js +1 -1
  60. package/dist/cjs/{payment-provisioning-actions-BiSpysjW.js → payment-provisioning-actions-Cn8bgHKu.js} +2 -2
  61. package/dist/cjs/payment-provisioning-form-buttons_2.cjs.entry.js +3 -2
  62. package/dist/cjs/{payment.service-ByrgA_QZ.js → payment.service-CbIxt30x.js} +1 -1
  63. package/dist/cjs/{payout.service-CnQm_BpU.js → payout.service-DVMvsdAf.js} +1 -1
  64. package/dist/cjs/{payouts-status-AuS3Mp0V.js → payouts-status-CzS2CLGW.js} +2 -2
  65. package/dist/cjs/{plaid.service-Dlb8EUR8.js → plaid.service-DNT_DX6z.js} +1 -1
  66. package/dist/cjs/{schema-validations-DNPcvDh5.js → schema-validations-DackMxv7.js} +11 -8
  67. package/dist/cjs/styled-host-Ch0-dxF-.js +11 -0
  68. package/dist/cjs/{terminal.service-BdwHQ3Vv.js → terminal.service-BBHixg-d.js} +1 -1
  69. package/dist/cjs/{utils-FVGp6se3.js → utils-kDsk4nqH.js} +1 -1
  70. package/dist/cjs/webcomponents.cjs.js +1 -1
  71. package/dist/collection/api/Document.js +14 -7
  72. package/dist/collection/collection-manifest.json +2 -0
  73. package/dist/collection/components/business-forms/business-form/business-core-info/business-core-info.js +2 -2
  74. package/dist/collection/components/business-forms/business-form/business-representative/business-representative.js +5 -3
  75. package/dist/collection/components/business-forms/owner-form/owner-form-inputs.js +4 -2
  76. package/dist/collection/components/business-forms/owner-form/owner-form.js +46 -1
  77. package/dist/collection/components/business-forms/payment-provisioning/additional-questions/additional-questions-form-step.js +1 -1
  78. package/dist/collection/components/business-forms/payment-provisioning/bank-account/business-bank-account-form-step.js +6 -114
  79. package/dist/collection/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step.js +1 -1
  80. package/dist/collection/components/business-forms/payment-provisioning/business-owners/business-owners-form-step.js +8 -0
  81. package/dist/collection/components/business-forms/payment-provisioning/business-representative/business-representative-form-inputs.js +4 -2
  82. package/dist/collection/components/business-forms/payment-provisioning/document-upload/document-upload-form-step.js +435 -0
  83. package/dist/collection/components/business-forms/payment-provisioning/document-upload/document-upload-list.js +52 -0
  84. package/dist/collection/components/business-forms/payment-provisioning/document-upload/document-upload-options.js +72 -0
  85. package/dist/collection/components/business-forms/payment-provisioning/justifi-payment-provisioning.js +1 -1
  86. package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning-form-steps.js +3 -2
  87. package/dist/collection/components/business-forms/schemas/business-bank-account-schema.js +10 -38
  88. package/dist/collection/components/business-forms/schemas/business-core-info-schema.js +1 -1
  89. package/dist/collection/components/business-forms/schemas/business-identity-schema.js +7 -3
  90. package/dist/collection/components/business-forms/schemas/schema-validations.js +8 -5
  91. package/dist/collection/components/business-forms/utils/business-form-options.js +50 -0
  92. package/dist/collection/components/business-forms/utils/country-config.js +2 -0
  93. package/dist/collection/ui-components/form/form-control-file.js +1 -1
  94. package/dist/docs.json +496 -64
  95. package/dist/esm/{Analytics-CwckfiSK.js → Analytics-D-apOWeY.js} +2 -2
  96. package/dist/esm/{Plaid-l6nNIjab.js → Plaid-BM3JUIG5.js} +15 -19
  97. package/dist/esm/{additional-questions-form-step_14.entry.js → additional-questions-form-step_15.entry.js} +377 -169
  98. package/dist/esm/additional-questions_5.entry.js +8 -8
  99. package/dist/esm/additional-statement_8.entry.js +1 -1
  100. package/dist/esm/bank-account-billing-form-simple_4.entry.js +4 -4
  101. package/dist/esm/bank-account-document-form-inputs.entry.js +19 -0
  102. package/dist/esm/bank-account-form.entry.js +2 -2
  103. package/dist/esm/{business-form-options-DRalxlqN.js → business-form-options-DXjZp4Rl.js} +51 -1
  104. package/dist/esm/{business-identity-schema-0Q3kck3C.js → business-identity-schema-D8L_UfWl.js} +11 -7
  105. package/dist/esm/{business.service-C31wbMVs.js → business.service-C4BD3pf7.js} +1 -1
  106. package/dist/esm/card-form.entry.js +2 -2
  107. package/dist/esm/{check-pkg-version-Dy2NK3Nn.js → check-pkg-version-Bn8HCDRp.js} +1 -1
  108. package/dist/esm/{checkout.service-cVdOGDuI.js → checkout.service-DmWeKNQs.js} +1 -1
  109. package/dist/esm/{country-config-CdvhLcnT.js → country-config-BW2dUoTJ.js} +2 -0
  110. package/dist/esm/dispute-notification_2.entry.js +6 -6
  111. package/dist/esm/{event-types-DalU_6SB.js → event-types-eIqsrwmW.js} +1 -1
  112. package/dist/esm/form-address-fields_3.entry.js +1 -1
  113. package/dist/esm/form-control-number_2.entry.js +5 -4
  114. package/dist/esm/{get-business-Gg6qn5on.js → get-business-DtFHdc37.js} +2 -2
  115. package/dist/esm/{get-payment-details-BiWgSJau.js → get-payment-details-26GxiYgv.js} +2 -2
  116. package/dist/esm/{get-subaccounts-CkjZeR9U.js → get-subaccounts-xkGMPstt.js} +2 -2
  117. package/dist/esm/hidden-input_2.entry.js +1 -1
  118. package/dist/esm/{index.esm-BHdVU4hV.js → index.esm-KCSohgHx.js} +1 -18
  119. package/dist/esm/justifi-apple-pay_11.entry.js +8 -8
  120. package/dist/esm/justifi-bank-account-billing-form-simple.entry.js +5 -5
  121. package/dist/esm/justifi-bank-account-form.entry.js +5 -5
  122. package/dist/esm/justifi-billing-form-full.entry.js +1 -1
  123. package/dist/esm/justifi-billing-form.entry.js +1 -1
  124. package/dist/esm/justifi-business-details.entry.js +8 -8
  125. package/dist/esm/justifi-business-form.entry.js +13 -13
  126. package/dist/esm/justifi-card-billing-form-simple.entry.js +1 -1
  127. package/dist/esm/justifi-card-form.entry.js +5 -5
  128. package/dist/esm/justifi-checkout.entry.js +5 -5
  129. package/dist/esm/justifi-checkouts-list-filters.entry.js +2 -2
  130. package/dist/esm/justifi-checkouts-list.entry.js +8 -8
  131. package/dist/esm/justifi-dispute-management.entry.js +7 -7
  132. package/dist/esm/justifi-gross-payment-chart.entry.js +6 -6
  133. package/dist/esm/justifi-order-terminals.entry.js +9 -9
  134. package/dist/esm/justifi-payment-details.entry.js +8 -8
  135. package/dist/esm/justifi-payment-provisioning.entry.js +9 -9
  136. package/dist/esm/justifi-payment-transactions-list.entry.js +7 -7
  137. package/dist/esm/justifi-payments-list-filters.entry.js +1 -1
  138. package/dist/esm/justifi-payments-list.entry.js +7 -7
  139. package/dist/esm/justifi-payout-details.entry.js +8 -8
  140. package/dist/esm/justifi-payout-transactions-list.entry.js +7 -7
  141. package/dist/esm/justifi-payouts-list-filters.entry.js +2 -2
  142. package/dist/esm/justifi-payouts-list.entry.js +9 -9
  143. package/dist/esm/justifi-refund-payment.entry.js +9 -9
  144. package/dist/esm/justifi-save-new-payment-method.entry.js +1 -1
  145. package/dist/esm/justifi-season-interruption-insurance.entry.js +6 -6
  146. package/dist/esm/justifi-skeleton.entry.js +1 -1
  147. package/dist/esm/justifi-terminal-orders-list-filters.entry.js +2 -2
  148. package/dist/esm/justifi-terminal-orders-list.entry.js +6 -6
  149. package/dist/esm/justifi-terminals-list-filters.entry.js +2 -2
  150. package/dist/esm/justifi-terminals-list.entry.js +8 -8
  151. package/dist/esm/loader.js +1 -1
  152. package/dist/esm/{package-DAZd_gFd.js → package-D6Pw5qJ5.js} +1 -1
  153. package/dist/esm/payment-method-option.entry.js +1 -1
  154. package/dist/esm/{payment-provisioning-actions-cl5xIYnF.js → payment-provisioning-actions-fWdNDUdq.js} +2 -2
  155. package/dist/esm/payment-provisioning-form-buttons_2.entry.js +3 -2
  156. package/dist/esm/{payment.service-5_u-UzTY.js → payment.service-CWR7jF-K.js} +1 -1
  157. package/dist/esm/{payout.service-D2zS5y8N.js → payout.service-CFU362cH.js} +1 -1
  158. package/dist/esm/{payouts-status-DCjCGTaa.js → payouts-status-D2G7FKu1.js} +2 -2
  159. package/dist/esm/{plaid.service-BiJ65YG8.js → plaid.service-0hd1i5Ga.js} +1 -1
  160. package/dist/esm/{schema-validations-A1o1biOB.js → schema-validations-CjqWFLKt.js} +11 -8
  161. package/dist/esm/styled-host-D84RBv1W.js +9 -0
  162. package/dist/esm/{terminal.service-CIxDfM7V.js → terminal.service-Dr6dERcJ.js} +1 -1
  163. package/dist/esm/{utils-C1B2hVAB.js → utils-q7KOrlSX.js} +1 -1
  164. package/dist/esm/webcomponents.js +1 -1
  165. package/dist/module/Plaid.js +15 -19
  166. package/dist/module/additional-questions-form-step2.js +11 -5
  167. package/dist/module/bank-account-document-form-inputs.js +55 -1
  168. package/dist/module/business-bank-account-form-step2.js +24 -177
  169. package/dist/module/business-core-info-form-step2.js +2 -2
  170. package/dist/module/business-core-info-schema.js +1 -1
  171. package/dist/module/business-core-info2.js +3 -3
  172. package/dist/module/business-documents-on-file2.js +1 -1
  173. package/dist/module/business-form-options.js +51 -1
  174. package/dist/module/business-identity-schema.js +7 -3
  175. package/dist/module/business-owners-form-step2.js +8 -0
  176. package/dist/module/business-representative-form-inputs2.js +5 -3
  177. package/dist/module/business-representative2.js +6 -5
  178. package/dist/module/button.js +1 -1
  179. package/dist/module/country-config.js +2 -0
  180. package/dist/module/document-upload-form-step.d.ts +11 -0
  181. package/dist/module/document-upload-form-step.js +6 -0
  182. package/dist/module/document-upload-form-step2.js +397 -0
  183. package/dist/module/document-upload-list.d.ts +11 -0
  184. package/dist/module/document-upload-list.js +6 -0
  185. package/dist/module/document-upload-list2.js +46 -0
  186. package/dist/module/form-control-number2.js +1 -1
  187. package/dist/module/form-control-textarea2.js +1 -1
  188. package/dist/module/form.js +1 -18
  189. package/dist/module/hidden-input2.js +1 -1
  190. package/dist/module/iframe-input2.js +1 -1
  191. package/dist/module/justifi-checkouts-list-filters.js +1 -1
  192. package/dist/module/justifi-checkouts-list.js +2 -2
  193. package/dist/module/justifi-dispute-management.js +1 -1
  194. package/dist/module/justifi-modular-checkout2.js +1 -1
  195. package/dist/module/justifi-order-terminals.js +2 -2
  196. package/dist/module/justifi-payment-details.js +1 -1
  197. package/dist/module/justifi-payment-provisioning.js +33 -27
  198. package/dist/module/justifi-payment-transactions-list.js +2 -2
  199. package/dist/module/justifi-payments-list.js +1 -1
  200. package/dist/module/justifi-payout-details.js +1 -1
  201. package/dist/module/justifi-payout-transactions-list.js +2 -2
  202. package/dist/module/justifi-payouts-list-filters.js +1 -1
  203. package/dist/module/justifi-payouts-list.js +2 -2
  204. package/dist/module/justifi-refund-payment.js +1 -1
  205. package/dist/module/justifi-terminal-orders-list-filters.js +1 -1
  206. package/dist/module/justifi-terminal-orders-list.js +2 -2
  207. package/dist/module/justifi-terminals-list-filters.js +1 -1
  208. package/dist/module/justifi-terminals-list.js +2 -2
  209. package/dist/module/owner-form-inputs2.js +5 -3
  210. package/dist/module/owner-form2.js +10 -1
  211. package/dist/module/package.js +1 -1
  212. package/dist/module/parts.js +1 -1
  213. package/dist/module/payment-provisioning-actions.js +1 -1
  214. package/dist/module/payment-provisioning-form-steps2.js +35 -28
  215. package/dist/module/plaid-verification2.js +1 -1
  216. package/dist/module/schema-validations.js +8 -5
  217. package/dist/module/skeleton.js +1 -1
  218. package/dist/module/styled-host.js +1 -1
  219. package/dist/module/table.js +1 -1
  220. package/dist/module/terminal-quantity-selector2.js +1 -1
  221. package/dist/types/api/Document.d.ts +15 -2
  222. package/dist/types/components/business-forms/owner-form/owner-form.d.ts +2 -0
  223. package/dist/types/components/business-forms/payment-provisioning/bank-account/business-bank-account-form-step.d.ts +1 -12
  224. package/dist/types/components/business-forms/payment-provisioning/document-upload/document-upload-form-step.d.ts +44 -0
  225. package/dist/types/components/business-forms/payment-provisioning/document-upload/document-upload-list.d.ts +6 -0
  226. package/dist/types/components/business-forms/payment-provisioning/document-upload/document-upload-options.d.ts +44 -0
  227. package/dist/types/components/business-forms/payment-provisioning/payment-provisioning-form-steps.d.ts +1 -0
  228. package/dist/types/components/business-forms/schemas/business-bank-account-schema.d.ts +4 -4
  229. package/dist/types/components/business-forms/utils/business-form-options.d.ts +1 -0
  230. package/dist/types/components.d.ts +67 -0
  231. package/dist/webcomponents/{p-oTtn8xDw.js → p--RbNhyet.js} +1 -1
  232. package/dist/webcomponents/{p-4b39a470.entry.js → p-01ed8fb5.entry.js} +1 -1
  233. package/dist/webcomponents/{p-07eaee91.entry.js → p-0290ca0f.entry.js} +1 -1
  234. package/dist/webcomponents/{p-e02d7751.entry.js → p-0a2be2e2.entry.js} +4 -4
  235. package/dist/webcomponents/{p-ca87c609.entry.js → p-0a4fcb15.entry.js} +1 -1
  236. package/dist/webcomponents/{p-b0b6083f.entry.js → p-0b169fac.entry.js} +1 -1
  237. package/dist/webcomponents/{p-f1b9cbf0.entry.js → p-0e4cda77.entry.js} +1 -1
  238. package/dist/webcomponents/{p-9d676f54.entry.js → p-1006ab39.entry.js} +1 -1
  239. package/dist/webcomponents/{p-d5edbea3.entry.js → p-164a4e64.entry.js} +1 -1
  240. package/dist/webcomponents/{p-bc2dddf3.entry.js → p-1841ee76.entry.js} +1 -1
  241. package/dist/webcomponents/{p-d01a1076.entry.js → p-188a7ebd.entry.js} +1 -1
  242. package/dist/webcomponents/{p-b62ff001.entry.js → p-1e34c488.entry.js} +1 -1
  243. package/dist/webcomponents/{p-a56e43a1.entry.js → p-1e5c96f3.entry.js} +1 -1
  244. package/dist/webcomponents/{p-b21010cb.entry.js → p-233fef57.entry.js} +1 -1
  245. package/dist/webcomponents/p-2e5ec91e.entry.js +1 -0
  246. package/dist/webcomponents/{p-41637e4a.entry.js → p-374ce853.entry.js} +1 -1
  247. package/dist/webcomponents/p-37676092.entry.js +1 -0
  248. package/dist/webcomponents/{p-78c4668b.entry.js → p-3c3fbcca.entry.js} +1 -1
  249. package/dist/webcomponents/{p-c4767c7b.entry.js → p-3e10a0de.entry.js} +1 -1
  250. package/dist/webcomponents/{p-e07506b7.entry.js → p-4673d7d3.entry.js} +1 -1
  251. package/dist/webcomponents/{p-3cefb032.entry.js → p-4b14b7e7.entry.js} +1 -1
  252. package/dist/webcomponents/p-54ee2a30.entry.js +1 -0
  253. package/dist/webcomponents/{p-38209a25.entry.js → p-5ceeaa73.entry.js} +1 -1
  254. package/dist/webcomponents/{p-a9e82502.entry.js → p-6089f91c.entry.js} +1 -1
  255. package/dist/webcomponents/{p-b8351983.entry.js → p-60a0bf1e.entry.js} +1 -1
  256. package/dist/webcomponents/{p-cf3e3394.entry.js → p-63a35210.entry.js} +1 -1
  257. package/dist/webcomponents/{p-08ab97ce.entry.js → p-641c9bdb.entry.js} +1 -1
  258. package/dist/webcomponents/{p-8e56430a.entry.js → p-74aeb76a.entry.js} +1 -1
  259. package/dist/webcomponents/{p-1f34b2f7.entry.js → p-80fdd013.entry.js} +1 -1
  260. package/dist/webcomponents/{p-3ef07f42.entry.js → p-84aaf298.entry.js} +1 -1
  261. package/dist/webcomponents/{p-4ee55e7d.entry.js → p-8a5f0d71.entry.js} +1 -1
  262. package/dist/webcomponents/{p-9153c121.entry.js → p-947950cc.entry.js} +1 -1
  263. package/dist/webcomponents/p-98476956.entry.js +1 -0
  264. package/dist/webcomponents/{p-a2c25cc4.entry.js → p-99792da6.entry.js} +1 -1
  265. package/dist/webcomponents/p-B1yVkh15.js +1 -0
  266. package/dist/webcomponents/{p-Bt4GjEWL.js → p-BBSnDYJw.js} +1 -1
  267. package/dist/webcomponents/{p-av6jyzyC.js → p-BSyTbuZy.js} +1 -1
  268. package/dist/webcomponents/{p-APOabprT.js → p-BrFax4_P.js} +1 -1
  269. package/dist/webcomponents/p-BzXQDB0t.js +1 -0
  270. package/dist/webcomponents/{p-BxKbnILQ.js → p-C-zuQNNP.js} +1 -1
  271. package/dist/webcomponents/{p-Cm9f5fyh.js → p-CDu7TeCZ.js} +1 -1
  272. package/dist/webcomponents/{p-BJu1-9kE.js → p-CL8LyqRI.js} +1 -1
  273. package/dist/webcomponents/{p-fE5A37L5.js → p-Cz0yhyYu.js} +1 -1
  274. package/dist/webcomponents/p-D6Pw5qJ5.js +1 -0
  275. package/dist/webcomponents/p-D9ZHVy-j.js +1 -0
  276. package/dist/webcomponents/{p-BdpSLMs7.js → p-D9rCHoO4.js} +1 -1
  277. package/dist/webcomponents/{p-CKiAlBsU.js → p-D9sqTVmd.js} +1 -1
  278. package/dist/webcomponents/p-DV4n8kZd.js +1 -0
  279. package/dist/webcomponents/{p-Dk26hk5T.js → p-DdeBubpX.js} +1 -1
  280. package/dist/webcomponents/p-DzEdYT8R.js +1 -0
  281. package/dist/webcomponents/{p-NZS8uCtH.js → p-Dzv0P2Ly.js} +1 -1
  282. package/dist/webcomponents/{p-Axa3cgnH.js → p-H0ILKMD2.js} +1 -1
  283. package/dist/webcomponents/{p-a7a1b168.entry.js → p-a3b48ba3.entry.js} +1 -1
  284. package/dist/webcomponents/{p-ebb7b693.entry.js → p-a3fe126f.entry.js} +1 -1
  285. package/dist/webcomponents/p-a9976353.entry.js +1 -0
  286. package/dist/webcomponents/{p-7377f7d1.entry.js → p-ab89cb46.entry.js} +1 -1
  287. package/dist/webcomponents/{p-d79c5ee4.entry.js → p-b17ce21d.entry.js} +1 -1
  288. package/dist/webcomponents/{p-2a5ee558.entry.js → p-b5aa3937.entry.js} +1 -1
  289. package/dist/webcomponents/p-cab840bd.entry.js +1 -0
  290. package/dist/webcomponents/{p-e17b92ec.entry.js → p-cc558e25.entry.js} +1 -1
  291. package/dist/webcomponents/{p-BXyADlAH.js → p-czJ2qSU1.js} +1 -1
  292. package/dist/webcomponents/p-d7ec0b54.entry.js +1 -0
  293. package/dist/webcomponents/{p-6904c62c.entry.js → p-e737077f.entry.js} +1 -1
  294. package/dist/webcomponents/p-eb1b4ead.entry.js +1 -0
  295. package/dist/webcomponents/{p-279c17ac.entry.js → p-f6be288f.entry.js} +1 -1
  296. package/dist/webcomponents/p-n_pmf4AT.js +1 -0
  297. package/dist/webcomponents/p-vUN_uvAi.js +1 -0
  298. package/dist/webcomponents/{p-Ba8jdOkX.js → p-xWuaNtJy.js} +1 -1
  299. package/dist/webcomponents/webcomponents.esm.js +1 -1
  300. package/package.json +14 -14
  301. package/LICENSE +0 -21
  302. package/dist/cjs/styled-host-DAi5SuFa.js +0 -11
  303. package/dist/esm/styled-host-D6byRazK.js +0 -9
  304. package/dist/module/bank-account-document-form-inputs2.js +0 -57
  305. package/dist/webcomponents/p-034fa691.entry.js +0 -1
  306. package/dist/webcomponents/p-2aac2ab6.entry.js +0 -1
  307. package/dist/webcomponents/p-37254105.entry.js +0 -1
  308. package/dist/webcomponents/p-5G1OMxZz.js +0 -1
  309. package/dist/webcomponents/p-9b5ca32c.entry.js +0 -1
  310. package/dist/webcomponents/p-Aacb4jqT.js +0 -1
  311. package/dist/webcomponents/p-BqNNwq6C.js +0 -1
  312. package/dist/webcomponents/p-D8ytux5N.js +0 -1
  313. package/dist/webcomponents/p-DAZd_gFd.js +0 -1
  314. package/dist/webcomponents/p-DrMJliVY.js +0 -1
  315. package/dist/webcomponents/p-XIWgia4J.js +0 -1
  316. package/dist/webcomponents/p-c8bc235f.entry.js +0 -1
  317. package/dist/webcomponents/p-ea254f14.entry.js +0 -1
  318. package/dist/webcomponents/p-ff8cf16c.entry.js +0 -1
  319. package/dist/webcomponents/p-nb_LhbJq.js +0 -1
@@ -0,0 +1,435 @@
1
+ import { h } from "@stencil/core";
2
+ import { ComponentErrorCodes, ComponentErrorSeverity, EntityDocument, } from "../../../../api";
3
+ import { makeGetBusiness, makePostDocumentRecord } from "../payment-provisioning-actions";
4
+ import { BusinessService, DocumentRecordService } from "../../../../api/services/business.service";
5
+ import { CountryCode } from "../../../../utils/country-codes";
6
+ import { BusinessFormStep } from "../../utils";
7
+ import { heading2 } from "../../../../styles/parts";
8
+ import { PaymentProvisioningLoading } from "../payment-provisioning-loading";
9
+ import { buildAllCategories, personalDocGroup1Types, personalDocGroup2Types, } from "./document-upload-options";
10
+ export class DocumentUploadFormStep {
11
+ constructor() {
12
+ this.owners = [];
13
+ this.existingDocuments = [];
14
+ this.selectedCategory = '';
15
+ this.selectedDocType = '';
16
+ this.uploadQueue = [];
17
+ this.isLoading = false;
18
+ this.errors = {};
19
+ this.fileInputKey = 0;
20
+ this.categories = [];
21
+ this.getData = () => {
22
+ this.isLoading = true;
23
+ this.getBusiness({
24
+ onSuccess: (response) => {
25
+ const { owners, documents } = response.data;
26
+ this.owners = owners || [];
27
+ this.existingDocuments = documents || [];
28
+ this.categories = buildAllCategories(this.owners, this.country);
29
+ },
30
+ onError: ({ error, code, severity }) => {
31
+ this.errorEvent.emit({
32
+ message: error,
33
+ errorCode: code,
34
+ severity: severity,
35
+ });
36
+ },
37
+ final: () => {
38
+ this.isLoading = false;
39
+ }
40
+ });
41
+ };
42
+ this.handleCategoryChange = (_name, value) => {
43
+ this.selectedCategory = value;
44
+ this.selectedDocType = '';
45
+ };
46
+ this.handleDocTypeChange = (_name, value) => {
47
+ if (value.startsWith('_') && value.endsWith('_header'))
48
+ return;
49
+ this.selectedDocType = value;
50
+ };
51
+ this.handleFileSelected = async (e) => {
52
+ const fileList = Array.from(e.detail.fileList);
53
+ const category = this.categories.find(c => c.value === this.selectedCategory);
54
+ if (!category)
55
+ return;
56
+ const docTypeOption = category.docTypeOptions.find(o => o.value === this.selectedDocType);
57
+ const docTypeLabel = (docTypeOption === null || docTypeOption === void 0 ? void 0 : docTypeOption.label) || this.selectedDocType;
58
+ const newEntries = fileList.map(file => ({
59
+ categoryLabel: category.label,
60
+ categoryValue: category.value,
61
+ docTypeLabel,
62
+ docTypeValue: this.selectedDocType,
63
+ fileName: file.name,
64
+ file,
65
+ identityId: category.identityId,
66
+ status: 'uploading',
67
+ }));
68
+ const startIndex = this.uploadQueue.length;
69
+ this.uploadQueue = [...this.uploadQueue, ...newEntries];
70
+ this.selectedCategory = '';
71
+ this.selectedDocType = '';
72
+ this.fileInputKey++;
73
+ await Promise.all(newEntries.map(async (entry, i) => {
74
+ const index = startIndex + i;
75
+ try {
76
+ const docData = new EntityDocument({ file: entry.file, document_type: entry.docTypeValue }, this.businessId, entry.identityId);
77
+ const recordCreated = await this.postDocumentRecordData(docData);
78
+ if (!recordCreated) {
79
+ this.uploadQueue = this.uploadQueue.map((e, j) => j === index ? Object.assign(Object.assign({}, e), { status: 'error' }) : e);
80
+ return;
81
+ }
82
+ const uploaded = await this.uploadDocument(docData);
83
+ this.uploadQueue = this.uploadQueue.map((e, j) => j === index ? Object.assign(Object.assign({}, e), { status: uploaded ? 'uploaded' : 'error' }) : e);
84
+ }
85
+ catch (_a) {
86
+ this.uploadQueue = this.uploadQueue.map((e, j) => j === index ? Object.assign(Object.assign({}, e), { status: 'error' }) : e);
87
+ }
88
+ }));
89
+ };
90
+ this.postDocumentRecordData = async (docData) => {
91
+ const payload = docData.record_data;
92
+ return new Promise((resolve) => {
93
+ this.postDocumentRecord({
94
+ payload,
95
+ onSuccess: (response) => {
96
+ resolve(this.handleDocRecordResponse(docData, response));
97
+ },
98
+ onError: ({ error, code, severity }) => {
99
+ this.errorEvent.emit({
100
+ message: error,
101
+ errorCode: code,
102
+ severity: severity,
103
+ });
104
+ resolve(false);
105
+ },
106
+ });
107
+ });
108
+ };
109
+ this.handleDocRecordResponse = (docData, response) => {
110
+ if (response.error) {
111
+ this.errorEvent.emit({
112
+ errorCode: ComponentErrorCodes.POST_ERROR,
113
+ message: response.error.message,
114
+ severity: ComponentErrorSeverity.ERROR,
115
+ data: response.error,
116
+ });
117
+ return false;
118
+ }
119
+ else {
120
+ docData.setPresignedUrl(response.data.presigned_url);
121
+ return true;
122
+ }
123
+ };
124
+ this.uploadDocument = async (docData) => {
125
+ if (!docData.presigned_url) {
126
+ throw new Error('Presigned URL is not set');
127
+ }
128
+ const fileData = await docData.getFileData();
129
+ const response = await fetch(docData.presigned_url, {
130
+ method: 'PUT',
131
+ body: fileData,
132
+ });
133
+ if (!response.ok) {
134
+ this.errorEvent.emit({
135
+ errorCode: ComponentErrorCodes.POST_ERROR,
136
+ message: 'Failed to upload document',
137
+ severity: ComponentErrorSeverity.ERROR,
138
+ });
139
+ return false;
140
+ }
141
+ return true;
142
+ };
143
+ }
144
+ propChanged() {
145
+ this.initializeApi();
146
+ }
147
+ watchHandler(newValue) {
148
+ this.formLoading.emit(newValue);
149
+ }
150
+ async validateAndSubmit({ onSuccess }) {
151
+ const validationErrors = this.validate();
152
+ if (Object.keys(validationErrors).length > 0) {
153
+ this.errors = validationErrors;
154
+ return;
155
+ }
156
+ this.errors = {};
157
+ this.stepCompleteEvent.emit({ response: null, formStep: BusinessFormStep.documentUpload });
158
+ onSuccess();
159
+ }
160
+ componentWillLoad() {
161
+ this.initializeApi();
162
+ if (this.getBusiness) {
163
+ this.getData();
164
+ }
165
+ }
166
+ initializeApi() {
167
+ if (this.authToken && this.businessId) {
168
+ this.getBusiness = makeGetBusiness({
169
+ authToken: this.authToken,
170
+ businessId: this.businessId,
171
+ service: new BusinessService()
172
+ });
173
+ this.postDocumentRecord = makePostDocumentRecord({
174
+ authToken: this.authToken,
175
+ service: new DocumentRecordService()
176
+ });
177
+ }
178
+ else {
179
+ this.errorEvent.emit({
180
+ message: 'Missing required props',
181
+ errorCode: ComponentErrorCodes.MISSING_PROPS,
182
+ severity: ComponentErrorSeverity.ERROR,
183
+ });
184
+ }
185
+ }
186
+ get categoryOptions() {
187
+ return [
188
+ { label: 'Select a category', value: '' },
189
+ ...this.categories.map(c => ({ label: c.label, value: c.value })),
190
+ ];
191
+ }
192
+ get docTypeOptions() {
193
+ if (!this.selectedCategory) {
194
+ return [{ label: 'Select a category first', value: '' }];
195
+ }
196
+ const category = this.categories.find(c => c.value === this.selectedCategory);
197
+ return (category === null || category === void 0 ? void 0 : category.docTypeOptions) || [{ label: 'Select a category first', value: '' }];
198
+ }
199
+ validate() {
200
+ if (this.allowOptionalFields)
201
+ return {};
202
+ const errors = {};
203
+ const financialDocTypes = ['voided_check', 'bank_statement'];
204
+ const hasExistingDoc = (types) => this.existingDocuments.some(doc => types.includes(doc.document_type));
205
+ const hasUploadedDoc = (categoryValue) => this.uploadQueue.some(entry => entry.categoryValue === categoryValue && entry.status === 'uploaded');
206
+ if (!hasUploadedDoc('financial_document') && !hasExistingDoc(financialDocTypes)) {
207
+ errors['financial_document'] = 'Please upload a financial document';
208
+ }
209
+ if (this.country === CountryCode.CAN) {
210
+ const businessDocTypes = ['articles_of_incorporation', 'business_registration'];
211
+ if (!hasUploadedDoc('business_document') && !hasExistingDoc(businessDocTypes)) {
212
+ errors['business_document'] = 'Please upload a business document';
213
+ }
214
+ for (const owner of this.owners) {
215
+ const ownerCategoryValue = `personal_${owner.id}`;
216
+ const ownerDocs = this.uploadQueue.filter(entry => entry.categoryValue === ownerCategoryValue && entry.status === 'uploaded');
217
+ const hasGroup1 = ownerDocs.some(d => personalDocGroup1Types.has(d.docTypeValue));
218
+ const hasGroup2 = ownerDocs.some(d => personalDocGroup2Types.has(d.docTypeValue));
219
+ if (!hasGroup1) {
220
+ errors[`personal_group1_${owner.id}`] =
221
+ `Please upload a Group 1 identity document for ${owner.name}`;
222
+ }
223
+ if (!hasGroup2) {
224
+ errors[`personal_group2_${owner.id}`] =
225
+ `Please upload a Group 2 identity document for ${owner.name}`;
226
+ }
227
+ }
228
+ }
229
+ return errors;
230
+ }
231
+ render() {
232
+ if (this.isLoading) {
233
+ return h(PaymentProvisioningLoading, null);
234
+ }
235
+ return (h("form", null, h("fieldset", null, h("legend", { class: "mb-0", part: heading2 }, "Document Uploads"), h("hr", { class: "mt-2" }), h("business-documents-on-file", { documents: this.existingDocuments, isLoading: this.isLoading })), h("fieldset", { class: "mt-4" }, h("div", { class: "d-flex align-items-center gap-2" }, h("legend", { class: "mb-0", part: heading2 }, "Add Document"), h("form-control-tooltip", { helpText: "Upload documents one at a time. Select the category and type, then choose a file. For identity documents, two documents from different groups are required per owner." })), h("hr", { class: "mt-2" }), h("div", { class: "row gy-3" }, h("div", { class: "col-12 col-md-6" }, h("form-control-select", { name: "document_category", label: "Document Category", options: this.categoryOptions, defaultValue: this.selectedCategory, inputHandler: this.handleCategoryChange })), h("div", { class: "col-12 col-md-6" }, h("form-control-select", { name: "document_type", label: "Document Type", options: this.docTypeOptions, defaultValue: this.selectedDocType, inputHandler: this.handleDocTypeChange, disabled: !this.selectedCategory })), h("div", { class: "col-12" }, h("form-control-file", { key: this.fileInputKey, name: "document_file", label: "Upload Document", documentType: this.selectedDocType, onFileSelected: this.handleFileSelected, disabled: !this.selectedDocType, multiple: false })))), h("document-upload-list", { documents: this.uploadQueue }), Object.keys(this.errors).length > 0 && (h("div", { class: "alert alert-danger mt-3" }, h("ul", { class: "mb-0" }, Object.values(this.errors).map(err => h("li", null, err)))))));
236
+ }
237
+ static get is() { return "document-upload-form-step"; }
238
+ static get properties() {
239
+ return {
240
+ "authToken": {
241
+ "type": "string",
242
+ "mutable": false,
243
+ "complexType": {
244
+ "original": "string",
245
+ "resolved": "string",
246
+ "references": {}
247
+ },
248
+ "required": true,
249
+ "optional": false,
250
+ "docs": {
251
+ "tags": [],
252
+ "text": ""
253
+ },
254
+ "getter": false,
255
+ "setter": false,
256
+ "reflect": false,
257
+ "attribute": "auth-token"
258
+ },
259
+ "businessId": {
260
+ "type": "string",
261
+ "mutable": false,
262
+ "complexType": {
263
+ "original": "string",
264
+ "resolved": "string",
265
+ "references": {}
266
+ },
267
+ "required": true,
268
+ "optional": false,
269
+ "docs": {
270
+ "tags": [],
271
+ "text": ""
272
+ },
273
+ "getter": false,
274
+ "setter": false,
275
+ "reflect": false,
276
+ "attribute": "business-id"
277
+ },
278
+ "allowOptionalFields": {
279
+ "type": "boolean",
280
+ "mutable": false,
281
+ "complexType": {
282
+ "original": "boolean",
283
+ "resolved": "boolean",
284
+ "references": {}
285
+ },
286
+ "required": false,
287
+ "optional": true,
288
+ "docs": {
289
+ "tags": [],
290
+ "text": ""
291
+ },
292
+ "getter": false,
293
+ "setter": false,
294
+ "reflect": false,
295
+ "attribute": "allow-optional-fields"
296
+ },
297
+ "country": {
298
+ "type": "string",
299
+ "mutable": false,
300
+ "complexType": {
301
+ "original": "CountryCode",
302
+ "resolved": "CountryCode.CAN | CountryCode.USA",
303
+ "references": {
304
+ "CountryCode": {
305
+ "location": "import",
306
+ "path": "../../../../utils/country-codes",
307
+ "id": "src/utils/country-codes.ts::CountryCode"
308
+ }
309
+ }
310
+ },
311
+ "required": true,
312
+ "optional": false,
313
+ "docs": {
314
+ "tags": [],
315
+ "text": ""
316
+ },
317
+ "getter": false,
318
+ "setter": false,
319
+ "reflect": false,
320
+ "attribute": "country"
321
+ }
322
+ };
323
+ }
324
+ static get states() {
325
+ return {
326
+ "owners": {},
327
+ "existingDocuments": {},
328
+ "selectedCategory": {},
329
+ "selectedDocType": {},
330
+ "uploadQueue": {},
331
+ "isLoading": {},
332
+ "errors": {},
333
+ "fileInputKey": {},
334
+ "getBusiness": {},
335
+ "postDocumentRecord": {}
336
+ };
337
+ }
338
+ static get events() {
339
+ return [{
340
+ "method": "errorEvent",
341
+ "name": "error-event",
342
+ "bubbles": true,
343
+ "cancelable": true,
344
+ "composed": true,
345
+ "docs": {
346
+ "tags": [],
347
+ "text": ""
348
+ },
349
+ "complexType": {
350
+ "original": "ComponentErrorEvent",
351
+ "resolved": "ComponentErrorEvent",
352
+ "references": {
353
+ "ComponentErrorEvent": {
354
+ "location": "import",
355
+ "path": "../../../../api",
356
+ "id": "src/api/index.ts::ComponentErrorEvent"
357
+ }
358
+ }
359
+ }
360
+ }, {
361
+ "method": "stepCompleteEvent",
362
+ "name": "complete-form-step-event",
363
+ "bubbles": true,
364
+ "cancelable": true,
365
+ "composed": true,
366
+ "docs": {
367
+ "tags": [],
368
+ "text": ""
369
+ },
370
+ "complexType": {
371
+ "original": "ComponentFormStepCompleteEvent",
372
+ "resolved": "ComponentFormStepCompleteEvent",
373
+ "references": {
374
+ "ComponentFormStepCompleteEvent": {
375
+ "location": "import",
376
+ "path": "../../../../api",
377
+ "id": "src/api/index.ts::ComponentFormStepCompleteEvent"
378
+ }
379
+ }
380
+ }
381
+ }, {
382
+ "method": "formLoading",
383
+ "name": "formLoading",
384
+ "bubbles": true,
385
+ "cancelable": true,
386
+ "composed": true,
387
+ "docs": {
388
+ "tags": [],
389
+ "text": ""
390
+ },
391
+ "complexType": {
392
+ "original": "boolean",
393
+ "resolved": "boolean",
394
+ "references": {}
395
+ }
396
+ }];
397
+ }
398
+ static get methods() {
399
+ return {
400
+ "validateAndSubmit": {
401
+ "complexType": {
402
+ "signature": "({ onSuccess }: { onSuccess: any; }) => Promise<void>",
403
+ "parameters": [{
404
+ "name": "__0",
405
+ "type": "{ onSuccess: any; }",
406
+ "docs": ""
407
+ }],
408
+ "references": {
409
+ "Promise": {
410
+ "location": "global",
411
+ "id": "global::Promise"
412
+ }
413
+ },
414
+ "return": "Promise<void>"
415
+ },
416
+ "docs": {
417
+ "text": "",
418
+ "tags": []
419
+ }
420
+ }
421
+ };
422
+ }
423
+ static get watchers() {
424
+ return [{
425
+ "propName": "authToken",
426
+ "methodName": "propChanged"
427
+ }, {
428
+ "propName": "businessId",
429
+ "methodName": "propChanged"
430
+ }, {
431
+ "propName": "isLoading",
432
+ "methodName": "watchHandler"
433
+ }];
434
+ }
435
+ }
@@ -0,0 +1,52 @@
1
+ import { h } from "@stencil/core";
2
+ import { card, heading2, table, tableCell, tableHeadCell } from "../../../../styles/parts";
3
+ export class DocumentUploadList {
4
+ constructor() {
5
+ this.documents = [];
6
+ }
7
+ renderStatus(status) {
8
+ switch (status) {
9
+ case 'uploading':
10
+ return h("span", { class: "badge bg-info" }, "Uploading...");
11
+ case 'uploaded':
12
+ return h("span", { class: "badge bg-success" }, "Uploaded");
13
+ case 'error':
14
+ return h("span", { class: "badge bg-danger" }, "Error");
15
+ }
16
+ }
17
+ render() {
18
+ if (!this.documents.length) {
19
+ return null;
20
+ }
21
+ return (h("div", { class: "mt-4" }, h("div", { class: "card", part: card }, h("div", { class: "card-body" }, h("h5", { class: "card-title", part: heading2 }, "Uploaded Documents"), h("div", { class: "table-responsive" }, h("table", { class: "table table-sm table-borderless", part: table }, h("thead", null, h("tr", null, h("th", { style: { width: '25%' }, part: tableHeadCell, scope: "col" }, "Category"), h("th", { style: { width: '25%' }, part: tableHeadCell, scope: "col" }, "Document Type"), h("th", { style: { width: '30%' }, part: tableHeadCell, scope: "col" }, "File Name"), h("th", { style: { width: '20%' }, part: tableHeadCell, scope: "col" }, "Status"))), h("tbody", null, this.documents.map((doc, index) => (h("tr", { class: index === 0 ? 'border-bottom border-top' : 'border-bottom' }, h("td", { part: tableCell }, doc.categoryLabel), h("td", { part: tableCell }, doc.docTypeLabel), h("td", { part: tableCell }, doc.fileName), h("td", { part: tableCell }, this.renderStatus(doc.status))))))))))));
22
+ }
23
+ static get is() { return "document-upload-list"; }
24
+ static get properties() {
25
+ return {
26
+ "documents": {
27
+ "type": "unknown",
28
+ "mutable": false,
29
+ "complexType": {
30
+ "original": "UploadedDocumentEntry[]",
31
+ "resolved": "UploadedDocumentEntry[]",
32
+ "references": {
33
+ "UploadedDocumentEntry": {
34
+ "location": "import",
35
+ "path": "./document-upload-options",
36
+ "id": "src/components/business-forms/payment-provisioning/document-upload/document-upload-options.ts::UploadedDocumentEntry"
37
+ }
38
+ }
39
+ },
40
+ "required": false,
41
+ "optional": false,
42
+ "docs": {
43
+ "tags": [],
44
+ "text": ""
45
+ },
46
+ "getter": false,
47
+ "setter": false,
48
+ "defaultValue": "[]"
49
+ }
50
+ };
51
+ }
52
+ }
@@ -0,0 +1,72 @@
1
+ import { CountryCode } from "../../../../utils/country-codes";
2
+ export const businessDocumentOptions = [
3
+ { label: 'Select a document type', value: '' },
4
+ { label: 'Articles of Incorporation', value: 'articles_of_incorporation' },
5
+ { label: 'Business Registration', value: 'business_registration' },
6
+ ];
7
+ export const financialDocumentOptions = [
8
+ { label: 'Select a document type', value: '' },
9
+ { label: 'Voided Check', value: 'voided_check' },
10
+ { label: 'Bank Statement', value: 'bank_statement' },
11
+ ];
12
+ export const personalDocGroup1Options = [
13
+ { label: 'Select a document type', value: '' },
14
+ { label: 'Canadian Passport', value: 'passport' },
15
+ { label: 'Canadian Driver\'s License', value: 'driver_license' },
16
+ { label: 'Canadian Government Issued ID Card', value: 'government_id' },
17
+ { label: 'Permanent Resident Card', value: 'resident_card' },
18
+ { label: 'Certificate of Indian Status', value: 'status_card' },
19
+ { label: 'US State Issued Driver\'s License', value: 'driver_license' },
20
+ ];
21
+ export const personalDocGroup2Options = [
22
+ { label: 'Select a document type', value: '' },
23
+ { label: 'Nexus Card (Photo ID)', value: 'nexus_card' },
24
+ { label: 'Canadian Citizenship/Naturalization Card or Certificate', value: 'citizenship_card' },
25
+ { label: 'Foreign Passport', value: 'foreign_passport' },
26
+ { label: 'Canadian Birth Certificate', value: 'birth_certificate' },
27
+ { label: 'Social Insurance Number (SIN) Card', value: 'sin_card' },
28
+ { label: 'Social Security Number (SSN) Card', value: 'ssn_card' },
29
+ ];
30
+ export const staticCategories = [
31
+ {
32
+ label: 'Business Document',
33
+ value: 'business_document',
34
+ docTypeOptions: businessDocumentOptions,
35
+ },
36
+ {
37
+ label: 'Financial Document',
38
+ value: 'financial_document',
39
+ docTypeOptions: financialDocumentOptions,
40
+ },
41
+ ];
42
+ export function buildOwnerCategories(owners) {
43
+ const group1Opts = personalDocGroup1Options.filter(o => o.value !== '');
44
+ const group2Opts = personalDocGroup2Options.filter(o => o.value !== '');
45
+ return owners.map(owner => ({
46
+ label: `${owner.name} - Identity Document`,
47
+ value: `personal_${owner.id}`,
48
+ identityId: owner.id,
49
+ docTypeOptions: [
50
+ { label: 'Select a document type', value: '' },
51
+ { label: '── Group 1 ──', value: '_group1_header' },
52
+ ...group1Opts,
53
+ { label: '── Group 2 ──', value: '_group2_header' },
54
+ ...group2Opts,
55
+ ],
56
+ }));
57
+ }
58
+ export const financialOnlyCategories = [
59
+ {
60
+ label: 'Financial Document',
61
+ value: 'financial_document',
62
+ docTypeOptions: financialDocumentOptions,
63
+ },
64
+ ];
65
+ export function buildAllCategories(owners, country) {
66
+ if (country === CountryCode.USA) {
67
+ return financialOnlyCategories;
68
+ }
69
+ return [...staticCategories, ...buildOwnerCategories(owners)];
70
+ }
71
+ export const personalDocGroup1Types = new Set(personalDocGroup1Options.filter(o => o.value).map(o => o.value));
72
+ export const personalDocGroup2Types = new Set(personalDocGroup2Options.filter(o => o.value).map(o => o.value));
@@ -111,7 +111,7 @@ export class JustifiPaymentProvisioning {
111
111
  else {
112
112
  this.businessLoading = false;
113
113
  }
114
- this.refs = new Array(7);
114
+ this.refs = new Array(8);
115
115
  }
116
116
  disconnectedCallback() {
117
117
  var _a;
@@ -11,14 +11,15 @@ export class PaymentProvisioningFormSteps {
11
11
  3: () => h("business-representative-form-step", { businessId: this.businessId, authToken: this.authToken, ref: (el) => this.refs[3] = el, allowOptionalFields: this.allowOptionalFields, country: this.country }),
12
12
  4: () => h("business-owners-form-step", { businessId: this.businessId, authToken: this.authToken, ref: (el) => this.refs[4] = el, allowOptionalFields: this.allowOptionalFields, country: this.country }),
13
13
  5: () => h("business-bank-account-form-step", { businessId: this.businessId, authToken: this.authToken, ref: (el) => this.refs[5] = el, allowOptionalFields: this.allowOptionalFields, country: this.country }),
14
- 6: () => h("business-terms-conditions-form-step", { businessId: this.businessId, authToken: this.authToken, ref: (el) => this.refs[6] = el, onFormLoading: this.handleFormLoading, allowOptionalFields: this.allowOptionalFields }),
14
+ 6: () => h("document-upload-form-step", { businessId: this.businessId, authToken: this.authToken, ref: (el) => this.refs[6] = el, allowOptionalFields: this.allowOptionalFields, country: this.country }),
15
+ 7: () => h("business-terms-conditions-form-step", { businessId: this.businessId, authToken: this.authToken, ref: (el) => this.refs[7] = el, onFormLoading: this.handleFormLoading, allowOptionalFields: this.allowOptionalFields }),
15
16
  };
16
17
  }
17
18
  get currentStepComponent() {
18
19
  return this.componentStepMapping[this.currentStep]();
19
20
  }
20
21
  render() {
21
- return (h("div", { key: '6bd8ebe91fefb364dd29a741e2cdf8a90aa1351b', class: 'col-12 mb-4' }, this.currentStepComponent));
22
+ return (h("div", { key: 'a249d66ac8348900e21998c4cf89bd02cfeec7c1', class: 'col-12 mb-4' }, this.currentStepComponent));
22
23
  }
23
24
  static get is() { return "payment-provisioning-form-steps"; }
24
25
  static get properties() {
@@ -1,11 +1,7 @@
1
- import { object, mixed, string } from "yup";
1
+ import { object, string } from "yup";
2
2
  import { CountryCode } from "../../../utils/country-codes";
3
- import { EntityDocumentType } from "../../../api/Document";
4
3
  import { accountNumberValidation, accountTypeValidation, bankNameValidation, identityNameValidation, nicknameValidation, routingNumberValidation, } from "./schema-validations";
5
4
  import { numbersOnlyRegex } from "./schema-helpers";
6
- const checkExistingDocs = (documents, documentType) => {
7
- return documents.some((doc) => doc.document_type === documentType);
8
- };
9
5
  const buildCommonFieldRules = (allowOptionalFields) => {
10
6
  if (allowOptionalFields) {
11
7
  return {
@@ -24,30 +20,6 @@ const buildCommonFieldRules = (allowOptionalFields) => {
24
20
  account_number: accountNumberValidation.required('Enter account number'),
25
21
  };
26
22
  };
27
- const buildDocumentRules = (documents, allowOptionalFields) => {
28
- if (allowOptionalFields) {
29
- return {
30
- voided_check: mixed().nullable(),
31
- bank_statement: mixed().nullable(),
32
- };
33
- }
34
- const existingVoidedCheck = checkExistingDocs(documents, EntityDocumentType.voidedCheck);
35
- const existingBankStatement = checkExistingDocs(documents, EntityDocumentType.bankStatement);
36
- const existingDocument = existingVoidedCheck || existingBankStatement;
37
- const documentErrorText = 'Please upload either a voided check or a bank statement. Only one is required.';
38
- return {
39
- voided_check: mixed().when('bank_statement', {
40
- is: (val) => !val && !existingDocument,
41
- then: (schema) => schema.required(documentErrorText),
42
- otherwise: (schema) => schema.notRequired(),
43
- }),
44
- bank_statement: mixed().when('voided_check', {
45
- is: (val) => !val && !existingDocument,
46
- then: (schema) => schema.required(documentErrorText),
47
- otherwise: (schema) => schema.notRequired(),
48
- }),
49
- };
50
- };
51
23
  const buildUSARules = (allowOptionalFields) => {
52
24
  if (allowOptionalFields) {
53
25
  return { routing_number: routingNumberValidation.nullable() };
@@ -72,17 +44,17 @@ const buildCANRules = (allowOptionalFields) => {
72
44
  transit_number: transitNumberValidation.required('Enter transit number'),
73
45
  };
74
46
  };
75
- export const businessBankAccountSchemaUSA = (documents, allowOptionalFields) => {
76
- const shape = Object.assign(Object.assign(Object.assign({}, buildCommonFieldRules(allowOptionalFields)), buildUSARules(allowOptionalFields)), buildDocumentRules(documents, allowOptionalFields));
77
- return object().shape(shape, [['voided_check', 'bank_statement']]);
47
+ export const businessBankAccountSchemaUSA = (allowOptionalFields) => {
48
+ const shape = Object.assign(Object.assign({}, buildCommonFieldRules(allowOptionalFields)), buildUSARules(allowOptionalFields));
49
+ return object().shape(shape);
78
50
  };
79
- export const businessBankAccountSchemaCAN = (documents, allowOptionalFields) => {
80
- const shape = Object.assign(Object.assign(Object.assign({}, buildCommonFieldRules(allowOptionalFields)), buildCANRules(allowOptionalFields)), buildDocumentRules(documents, allowOptionalFields));
81
- return object().shape(shape, [['voided_check', 'bank_statement']]);
51
+ export const businessBankAccountSchemaCAN = (allowOptionalFields) => {
52
+ const shape = Object.assign(Object.assign({}, buildCommonFieldRules(allowOptionalFields)), buildCANRules(allowOptionalFields));
53
+ return object().shape(shape);
82
54
  };
83
55
  // For backward compatibility, default to USA
84
- export const businessBankAccountSchema = (documents, allowOptionalFields) => businessBankAccountSchemaUSA(documents, allowOptionalFields);
56
+ export const businessBankAccountSchema = (allowOptionalFields) => businessBankAccountSchemaUSA(allowOptionalFields);
85
57
  export const bankAccountSchemaByCountry = {
86
- [CountryCode.USA]: (allowOptionalFields, documents = []) => businessBankAccountSchemaUSA(documents, allowOptionalFields),
87
- [CountryCode.CAN]: (allowOptionalFields, documents = []) => businessBankAccountSchemaCAN(documents, allowOptionalFields),
58
+ [CountryCode.USA]: (allowOptionalFields) => businessBankAccountSchemaUSA(allowOptionalFields),
59
+ [CountryCode.CAN]: (allowOptionalFields) => businessBankAccountSchemaCAN(allowOptionalFields),
88
60
  };