@justifi/webcomponents 6.10.4 → 6.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (484) hide show
  1. package/dist/cjs/{Plaid-B_UkFjIV.js → Plaid-DR9WDZ98.js} +1 -1
  2. package/dist/cjs/additional-questions-details_5.cjs.entry.js +2 -2
  3. package/dist/cjs/{badge-Bd6H9TX2.js → badge-GBNtUypt.js} +1 -1
  4. package/dist/cjs/bank-account-document-form-inputs_9.cjs.entry.js +9 -9
  5. package/dist/cjs/bank-account-form.cjs.entry.js +2 -2
  6. package/dist/cjs/business-details-core.cjs.entry.js +3 -3
  7. package/dist/cjs/{business.service-Kplx8w_D.js → business.service-mliLE8kX.js} +1 -1
  8. package/dist/cjs/{button-DAbSQPoU.js → button-CR9Rl1-o.js} +1 -1
  9. package/dist/cjs/card-form.cjs.entry.js +2 -2
  10. package/dist/cjs/{check-pkg-version-Mv0ez8Cf.js → check-pkg-version-Di4JmtKX.js} +2 -2
  11. package/dist/cjs/{checkout.service-B2toaeKY.js → checkout.service-Cok0vRot.js} +1 -1
  12. package/dist/cjs/checkouts-list-core.cjs.entry.js +6 -6
  13. package/dist/cjs/{checkouts-table-KuNixae0.js → checkouts-table-CCxrsy0x.js} +2 -2
  14. package/dist/cjs/custom-popper_2.cjs.entry.js +3 -3
  15. package/dist/cjs/{dispute.service-C4n1SOsu.js → dispute.service-DEH_I2G9.js} +1 -1
  16. package/dist/cjs/form-alert_5.cjs.entry.js +1 -1
  17. package/dist/cjs/form-control-checkbox.cjs.entry.js +3 -3
  18. package/dist/cjs/form-control-date.cjs.entry.js +4 -4
  19. package/dist/cjs/{form-control-error-text-C4Wqr79O.js → form-control-error-text-BO58Y6zF.js} +1 -1
  20. package/dist/cjs/form-control-file-v2_2.cjs.entry.js +5 -5
  21. package/dist/cjs/{form-control-help-text-Bo9d_mCH.js → form-control-help-text-BdbTxD5g.js} +1 -1
  22. package/dist/cjs/form-control-monetary-provisioning.cjs.entry.js +3 -3
  23. package/dist/cjs/form-control-monetary.cjs.entry.js +5 -5
  24. package/dist/cjs/form-control-number-masked_3.cjs.entry.js +4 -4
  25. package/dist/cjs/form-control-number_3.cjs.entry.js +6 -6
  26. package/dist/cjs/form-control-radio.cjs.entry.js +3 -3
  27. package/dist/cjs/form-control-select_2.cjs.entry.js +6 -6
  28. package/dist/cjs/{get-payment-details-Atcodhcd.js → get-payment-details-DNpOyUyR.js} +1 -1
  29. package/dist/cjs/{get-subaccounts-BUyf9EhG.js → get-subaccounts-BQW_RPW5.js} +1 -1
  30. package/dist/cjs/gross-payment-chart-core.cjs.entry.js +4 -4
  31. package/dist/cjs/{header-1-DR-eAlp1.js → header-1-CsBQoo1f.js} +1 -1
  32. package/dist/cjs/{header-3-kgnQtxEu.js → header-3-DCYJhPro.js} +1 -1
  33. package/dist/cjs/hidden-input_2.cjs.entry.js +7 -7
  34. package/dist/cjs/{insurance-state-CRhLwPxQ.js → insurance-state-Xe2auE-N.js} +1 -1
  35. package/dist/cjs/internal-tokenize-payment-method_7.cjs.entry.js +12 -12
  36. package/dist/cjs/justifi-additional-questions-form-step_9.cjs.entry.js +6 -6
  37. package/dist/cjs/justifi-additional-statement_8.cjs.entry.js +9 -9
  38. package/dist/cjs/justifi-apple-pay_8.cjs.entry.js +14 -14
  39. package/dist/cjs/justifi-bank-account-billing-form-simple_3.cjs.entry.js +2 -2
  40. package/dist/cjs/justifi-business-details.cjs.entry.js +6 -6
  41. package/dist/cjs/justifi-business-form.cjs.entry.js +8 -8
  42. package/dist/cjs/justifi-checkout.cjs.entry.js +4 -4
  43. package/dist/cjs/justifi-checkouts-list-filters.cjs.entry.js +6 -5
  44. package/dist/cjs/justifi-checkouts-list.cjs.entry.js +9 -9
  45. package/dist/cjs/justifi-details.cjs.entry.js +2 -2
  46. package/dist/cjs/justifi-dispute-management-core.cjs.entry.js +1 -1
  47. package/dist/cjs/justifi-dispute-management.cjs.entry.js +5 -5
  48. package/dist/cjs/justifi-dispute-notification_3.cjs.entry.js +11 -11
  49. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +5 -5
  50. package/dist/cjs/justifi-order-terminals.cjs.entry.js +8 -8
  51. package/dist/cjs/justifi-payment-details.cjs.entry.js +7 -7
  52. package/dist/cjs/justifi-payment-provisioning-core.cjs.entry.js +4 -4
  53. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +4 -4
  54. package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +8 -8
  55. package/dist/cjs/justifi-payments-list-filters.cjs.entry.js +4 -4
  56. package/dist/cjs/justifi-payments-list.cjs.entry.js +9 -9
  57. package/dist/cjs/justifi-payout-details.cjs.entry.js +6 -6
  58. package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +8 -8
  59. package/dist/cjs/justifi-payouts-list-filters.cjs.entry.js +5 -5
  60. package/dist/cjs/justifi-payouts-list.cjs.entry.js +10 -10
  61. package/dist/cjs/justifi-refund-payment.cjs.entry.js +8 -8
  62. package/dist/cjs/justifi-saved-payment-method.cjs.entry.js +1 -1
  63. package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +6 -6
  64. package/dist/cjs/justifi-skeleton.cjs.entry.js +3 -3
  65. package/dist/cjs/justifi-terminal-orders-list-filters.cjs.entry.js +10 -6
  66. package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +7 -7
  67. package/dist/cjs/justifi-terminals-list-filters.cjs.entry.js +5 -3
  68. package/dist/cjs/justifi-terminals-list.cjs.entry.js +9 -9
  69. package/dist/cjs/justifi-tokenize-payment-method.cjs.entry.js +1 -1
  70. package/dist/cjs/loader.cjs.js +1 -1
  71. package/dist/cjs/{package-OpgJzVo3.js → package-D8NG-zuY.js} +1 -1
  72. package/dist/cjs/pagination-menu.cjs.entry.js +1 -1
  73. package/dist/cjs/{parts-WjOn_TIy.js → parts-BXshb_S-.js} +3 -70
  74. package/dist/cjs/payment-details-core.cjs.entry.js +14 -14
  75. package/dist/cjs/payment-method-option.cjs.entry.js +2 -2
  76. package/dist/cjs/{payment-provisioning-loading-BHAFHTuI.js → payment-provisioning-loading-tM9WWmxv.js} +1 -1
  77. package/dist/cjs/{payment.service-CxSGTv_O.js → payment.service-Dl9UExDw.js} +1 -1
  78. package/dist/cjs/payments-list-core.cjs.entry.js +8 -8
  79. package/dist/cjs/{payments-status-BngaUiWA.js → payments-status-Bj_bCKUP.js} +1 -1
  80. package/dist/cjs/{payments-table-DFOF8yrM.js → payments-table-CUxpxNnc.js} +2 -2
  81. package/dist/cjs/payout-details-core.cjs.entry.js +9 -9
  82. package/dist/cjs/{payout.service-CO2wDM6M.js → payout.service-kaFewwx4.js} +1 -1
  83. package/dist/cjs/payouts-list-core.cjs.entry.js +8 -8
  84. package/dist/cjs/{payouts-status-CP5T9uAc.js → payouts-status-DXZ5fl4v.js} +1 -1
  85. package/dist/cjs/{payouts-table-CHNRLZ3K.js → payouts-table-Dex2W8r1.js} +2 -2
  86. package/dist/cjs/{plaid.service-DvbLnuph.js → plaid.service-CK1ouCBC.js} +1 -1
  87. package/dist/cjs/{skeleton-BfN_sjaY.js → skeleton-DvRCiQlA.js} +1 -1
  88. package/dist/cjs/{spinner-51BOfCoS.js → spinner-C6ZGOB2P.js} +1 -1
  89. package/dist/cjs/{table-CimkSek7.js → table-DjbNv28p.js} +2 -2
  90. package/dist/cjs/table-filters-menu.cjs.entry.js +3 -3
  91. package/dist/cjs/terminal-orders-list-core.cjs.entry.js +7 -7
  92. package/dist/cjs/{terminal-orders-table-DDLvv83x.js → terminal-orders-table-07fV7wGh.js} +3 -3
  93. package/dist/cjs/terminal-quantity-selector.cjs.entry.js +2 -2
  94. package/dist/cjs/{terminal.service-CUVwCH-a.js → terminal.service-UUoIe0IR.js} +1 -1
  95. package/dist/cjs/terminals-list-core.cjs.entry.js +7 -7
  96. package/dist/cjs/{terminals-table-BU73whCF.js → terminals-table-DmnAuog5.js} +2 -2
  97. package/dist/cjs/{utils-CowQ4GdN.js → utils-8RGQVADu.js} +1 -1
  98. package/dist/cjs/webcomponents.cjs.js +1 -1
  99. package/dist/collection/api/Terminal.js +1 -1
  100. package/dist/collection/api/services/apple-pay.service.js +1 -1
  101. package/dist/collection/components/checkouts-list/checkouts-list-filters.js +24 -4
  102. package/dist/collection/components/checkouts-list/checkouts-list.js +1 -1
  103. package/dist/collection/components/dispute-management/dispute-management-core.js +1 -1
  104. package/dist/collection/components/dispute-management/dispute-management.js +1 -1
  105. package/dist/collection/components/dispute-management/dispute-notification.js +2 -2
  106. package/dist/collection/components/dispute-management/dispute-response/additional-statement.js +1 -1
  107. package/dist/collection/components/dispute-management/dispute-response/cancellation-policy.js +1 -1
  108. package/dist/collection/components/dispute-management/dispute-response/customer-details.js +1 -1
  109. package/dist/collection/components/dispute-management/dispute-response/dispute-response-core.js +1 -1
  110. package/dist/collection/components/dispute-management/dispute-response/dispute-response.js +1 -1
  111. package/dist/collection/components/dispute-management/dispute-response/duplicate-charge.js +1 -1
  112. package/dist/collection/components/dispute-management/dispute-response/electronic-evidence.js +1 -1
  113. package/dist/collection/components/dispute-management/dispute-response/product-or-service.js +1 -1
  114. package/dist/collection/components/dispute-management/dispute-response/refund-policy.js +1 -1
  115. package/dist/collection/components/dispute-management/dispute-response/shipping-details.js +1 -1
  116. package/dist/collection/components/filters/table-filters-menu.js +1 -1
  117. package/dist/collection/components/gross-payment-chart/gross-payment-chart-core.js +1 -1
  118. package/dist/collection/components/modular-checkout/modular-checkout.js +1 -1
  119. package/dist/collection/components/modular-checkout/sub-components/bank-account.js +2 -2
  120. package/dist/collection/components/modular-checkout/sub-components/card-form.js +2 -2
  121. package/dist/collection/components/modular-checkout/sub-components/payment-method-option.js +1 -1
  122. package/dist/collection/components/modular-checkout/sub-components/summary.js +1 -1
  123. package/dist/collection/components/order-terminals/order-terminals.js +1 -1
  124. package/dist/collection/components/order-terminals/terminal-quantity-selector/terminal-quantity-selector.js +1 -1
  125. package/dist/collection/components/payment-details/payment-details-core.js +8 -8
  126. package/dist/collection/components/payment-transactions-list/payment-transactions-list.js +1 -1
  127. package/dist/collection/components/payments-list/payments-list-core.js +1 -1
  128. package/dist/collection/components/payments-list/payments-list-filters.js +4 -4
  129. package/dist/collection/components/payments-list/payments-list.js +1 -1
  130. package/dist/collection/components/payout-details/payout-details-core.js +3 -3
  131. package/dist/collection/components/payout-transactions-list/payout-transactions-list.js +1 -1
  132. package/dist/collection/components/payouts-list/payouts-list-core.js +1 -1
  133. package/dist/collection/components/payouts-list/payouts-list-filters.js +4 -4
  134. package/dist/collection/components/payouts-list/payouts-list.js +1 -1
  135. package/dist/collection/components/terminal-orders-list/terminal-orders-list-core.js +1 -1
  136. package/dist/collection/components/terminal-orders-list/terminal-orders-list-filters.js +27 -5
  137. package/dist/collection/components/terminal-orders-list/terminal-orders-list.js +1 -1
  138. package/dist/collection/components/terminals-list/terminals-list-core.js +1 -1
  139. package/dist/collection/components/terminals-list/terminals-list-filters.js +42 -2
  140. package/dist/collection/components/terminals-list/terminals-list.js +1 -1
  141. package/dist/collection/components/tokenize-payment-method/internal-tokenize-payment-method.js +1 -1
  142. package/dist/collection/components/tokenize-payment-method/tokenize-payment-method.js +1 -1
  143. package/dist/collection/styles/parts.js +1 -40
  144. package/dist/collection/ui-components/custom-popper/custom-popper.js +2 -2
  145. package/dist/collection/ui-components/form/form-control-date.js +2 -2
  146. package/dist/collection/ui-components/form/form-control-file-v2.js +1 -1
  147. package/dist/collection/ui-components/form/form-control-file.js +2 -2
  148. package/dist/collection/ui-components/form/form-control-monetary.js +2 -2
  149. package/dist/collection/ui-components/form/form-control-number-masked.js +2 -2
  150. package/dist/collection/ui-components/form/form-control-number.js +2 -2
  151. package/dist/collection/ui-components/form/form-control-radio.js +2 -2
  152. package/dist/collection/ui-components/form/form-control-select.js +2 -2
  153. package/dist/collection/ui-components/form/form-control-text.js +2 -2
  154. package/dist/collection/ui-components/form/form-control-textarea.js +2 -2
  155. package/dist/collection/ui-components/form/hidden-input.js +1 -1
  156. package/dist/collection/ui-components/form/iframe-input.js +3 -3
  157. package/dist/collection/ui-components/shadow-dom-components/justifi-button.js +1 -1
  158. package/dist/collection/ui-components/shadow-dom-components/justifi-header.js +1 -1
  159. package/dist/collection/ui-components/shadow-dom-components/justifi-skeleton.js +1 -1
  160. package/dist/docs.json +104 -3
  161. package/dist/esm/{Plaid-Cmyilr-q.js → Plaid-DOdR_CNb.js} +1 -1
  162. package/dist/esm/additional-questions-details_5.entry.js +2 -2
  163. package/dist/esm/{badge-BfWXAKIJ.js → badge-guwZ0VTf.js} +1 -1
  164. package/dist/esm/bank-account-document-form-inputs_9.entry.js +9 -9
  165. package/dist/esm/bank-account-form.entry.js +2 -2
  166. package/dist/esm/business-details-core.entry.js +3 -3
  167. package/dist/esm/{business.service-CS-wQJoN.js → business.service-DSolii9Q.js} +1 -1
  168. package/dist/esm/{button-DoF-zpiW.js → button-CdXktiZq.js} +1 -1
  169. package/dist/esm/card-form.entry.js +2 -2
  170. package/dist/esm/{check-pkg-version-QOngucT4.js → check-pkg-version-Dn83YYz_.js} +2 -2
  171. package/dist/esm/{checkout.service-BcQ_onZq.js → checkout.service-BTXHVtxI.js} +1 -1
  172. package/dist/esm/checkouts-list-core.entry.js +6 -6
  173. package/dist/esm/{checkouts-table-XjFiAWCw.js → checkouts-table-Bf6gjMf8.js} +2 -2
  174. package/dist/esm/custom-popper_2.entry.js +3 -3
  175. package/dist/esm/{dispute.service-B_oe0uFV.js → dispute.service-CpDEYnHy.js} +1 -1
  176. package/dist/esm/form-alert_5.entry.js +1 -1
  177. package/dist/esm/form-control-checkbox.entry.js +3 -3
  178. package/dist/esm/form-control-date.entry.js +4 -4
  179. package/dist/esm/{form-control-error-text-D5B0Wy4Q.js → form-control-error-text-JYoDicr0.js} +1 -1
  180. package/dist/esm/form-control-file-v2_2.entry.js +5 -5
  181. package/dist/esm/{form-control-help-text-XuRclELV.js → form-control-help-text-DxL7yVgi.js} +1 -1
  182. package/dist/esm/form-control-monetary-provisioning.entry.js +3 -3
  183. package/dist/esm/form-control-monetary.entry.js +5 -5
  184. package/dist/esm/form-control-number-masked_3.entry.js +4 -4
  185. package/dist/esm/form-control-number_3.entry.js +6 -6
  186. package/dist/esm/form-control-radio.entry.js +3 -3
  187. package/dist/esm/form-control-select_2.entry.js +6 -6
  188. package/dist/esm/{get-payment-details-BdewJSTH.js → get-payment-details-VEzqfeuZ.js} +1 -1
  189. package/dist/esm/{get-subaccounts-BFALCYFr.js → get-subaccounts-DUdsxExJ.js} +1 -1
  190. package/dist/esm/gross-payment-chart-core.entry.js +4 -4
  191. package/dist/esm/{header-1-BIaO3iDb.js → header-1-CU8Erek9.js} +1 -1
  192. package/dist/esm/{header-3-UswhFvUr.js → header-3-BwJ-9MsW.js} +1 -1
  193. package/dist/esm/hidden-input_2.entry.js +7 -7
  194. package/dist/esm/{insurance-state-MpA7uaXF.js → insurance-state-gsU4kKgc.js} +1 -1
  195. package/dist/esm/internal-tokenize-payment-method_7.entry.js +12 -12
  196. package/dist/esm/justifi-additional-questions-form-step_9.entry.js +6 -6
  197. package/dist/esm/justifi-additional-statement_8.entry.js +9 -9
  198. package/dist/esm/justifi-apple-pay_8.entry.js +14 -14
  199. package/dist/esm/justifi-bank-account-billing-form-simple_3.entry.js +2 -2
  200. package/dist/esm/justifi-business-details.entry.js +6 -6
  201. package/dist/esm/justifi-business-form.entry.js +8 -8
  202. package/dist/esm/justifi-checkout.entry.js +4 -4
  203. package/dist/esm/justifi-checkouts-list-filters.entry.js +6 -5
  204. package/dist/esm/justifi-checkouts-list.entry.js +9 -9
  205. package/dist/esm/justifi-details.entry.js +2 -2
  206. package/dist/esm/justifi-dispute-management-core.entry.js +1 -1
  207. package/dist/esm/justifi-dispute-management.entry.js +5 -5
  208. package/dist/esm/justifi-dispute-notification_3.entry.js +11 -11
  209. package/dist/esm/justifi-gross-payment-chart.entry.js +5 -5
  210. package/dist/esm/justifi-order-terminals.entry.js +8 -8
  211. package/dist/esm/justifi-payment-details.entry.js +7 -7
  212. package/dist/esm/justifi-payment-provisioning-core.entry.js +4 -4
  213. package/dist/esm/justifi-payment-provisioning.entry.js +4 -4
  214. package/dist/esm/justifi-payment-transactions-list.entry.js +8 -8
  215. package/dist/esm/justifi-payments-list-filters.entry.js +4 -4
  216. package/dist/esm/justifi-payments-list.entry.js +9 -9
  217. package/dist/esm/justifi-payout-details.entry.js +6 -6
  218. package/dist/esm/justifi-payout-transactions-list.entry.js +8 -8
  219. package/dist/esm/justifi-payouts-list-filters.entry.js +5 -5
  220. package/dist/esm/justifi-payouts-list.entry.js +10 -10
  221. package/dist/esm/justifi-refund-payment.entry.js +8 -8
  222. package/dist/esm/justifi-saved-payment-method.entry.js +1 -1
  223. package/dist/esm/justifi-season-interruption-insurance.entry.js +6 -6
  224. package/dist/esm/justifi-skeleton.entry.js +3 -3
  225. package/dist/esm/justifi-terminal-orders-list-filters.entry.js +10 -6
  226. package/dist/esm/justifi-terminal-orders-list.entry.js +7 -7
  227. package/dist/esm/justifi-terminals-list-filters.entry.js +5 -3
  228. package/dist/esm/justifi-terminals-list.entry.js +9 -9
  229. package/dist/esm/justifi-tokenize-payment-method.entry.js +1 -1
  230. package/dist/esm/loader.js +1 -1
  231. package/dist/esm/{package-Cc6518FT.js → package-qNXIkzDE.js} +1 -1
  232. package/dist/esm/pagination-menu.entry.js +1 -1
  233. package/dist/esm/parts-D3V9AE6o.js +110 -0
  234. package/dist/esm/payment-details-core.entry.js +14 -14
  235. package/dist/esm/payment-method-option.entry.js +2 -2
  236. package/dist/esm/{payment-provisioning-loading-DRFgrvp1.js → payment-provisioning-loading-CQfDKCwy.js} +1 -1
  237. package/dist/esm/{payment.service-Nvz1TYZB.js → payment.service-BjU4B__W.js} +1 -1
  238. package/dist/esm/payments-list-core.entry.js +8 -8
  239. package/dist/esm/{payments-status-Dkt38hpB.js → payments-status-DT4VNKKg.js} +1 -1
  240. package/dist/esm/{payments-table-ghXGJ-N6.js → payments-table-BJ1F2ZZU.js} +2 -2
  241. package/dist/esm/payout-details-core.entry.js +9 -9
  242. package/dist/esm/{payout.service-tTxsxoqF.js → payout.service-CzCd8AaC.js} +1 -1
  243. package/dist/esm/payouts-list-core.entry.js +8 -8
  244. package/dist/esm/{payouts-status-B4iry-1w.js → payouts-status-LTNE_gQc.js} +1 -1
  245. package/dist/esm/{payouts-table-CBsTdL9_.js → payouts-table-Yp2d9OgA.js} +2 -2
  246. package/dist/esm/{plaid.service-C59iS7tB.js → plaid.service-D61Eq14d.js} +1 -1
  247. package/dist/esm/{skeleton-DzBAY0bs.js → skeleton-CV6EpBqb.js} +1 -1
  248. package/dist/esm/{spinner-DQpyMqKv.js → spinner-CG3aWl8K.js} +1 -1
  249. package/dist/esm/{table-BwxLvetJ.js → table-DZ6rurWg.js} +2 -2
  250. package/dist/esm/table-filters-menu.entry.js +3 -3
  251. package/dist/esm/terminal-orders-list-core.entry.js +7 -7
  252. package/dist/esm/{terminal-orders-table-Cy0qV96Y.js → terminal-orders-table-CJg6dKsL.js} +3 -3
  253. package/dist/esm/terminal-quantity-selector.entry.js +2 -2
  254. package/dist/esm/{terminal.service-Dv1-CZ4Y.js → terminal.service-BBdRhDxm.js} +1 -1
  255. package/dist/esm/terminals-list-core.entry.js +7 -7
  256. package/dist/esm/{terminals-table-BQQs_JoR.js → terminals-table-iGSICJeZ.js} +2 -2
  257. package/dist/esm/{utils-BGbtbDiV.js → utils-DUArY3am.js} +1 -1
  258. package/dist/esm/webcomponents.js +1 -1
  259. package/dist/module/Plaid.js +1 -1
  260. package/dist/module/additional-statement.js +1 -1
  261. package/dist/module/apple-pay.js +1 -1
  262. package/dist/module/bank-account.js +2 -2
  263. package/dist/module/cancellation-policy.js +1 -1
  264. package/dist/module/card-form2.js +2 -2
  265. package/dist/module/checkouts-list-core2.js +1 -1
  266. package/dist/module/custom-popper2.js +2 -2
  267. package/dist/module/customer-details.js +1 -1
  268. package/dist/module/dispute-management-core.js +1 -1
  269. package/dist/module/dispute-notification.js +2 -2
  270. package/dist/module/dispute-response-core.js +1 -1
  271. package/dist/module/dispute-response.js +1 -1
  272. package/dist/module/duplicate-charge.js +1 -1
  273. package/dist/module/electronic-evidence.js +1 -1
  274. package/dist/module/form-control-date2.js +2 -2
  275. package/dist/module/form-control-file-v22.js +1 -1
  276. package/dist/module/form-control-file2.js +2 -2
  277. package/dist/module/form-control-monetary2.js +2 -2
  278. package/dist/module/form-control-number-masked2.js +2 -2
  279. package/dist/module/form-control-number2.js +2 -2
  280. package/dist/module/form-control-radio2.js +2 -2
  281. package/dist/module/form-control-select2.js +2 -2
  282. package/dist/module/form-control-text2.js +2 -2
  283. package/dist/module/form-control-textarea2.js +2 -2
  284. package/dist/module/gross-payment-chart-core2.js +1 -1
  285. package/dist/module/hidden-input2.js +1 -1
  286. package/dist/module/iframe-input2.js +3 -3
  287. package/dist/module/internal-tokenize-payment-method2.js +1 -1
  288. package/dist/module/justifi-button2.js +1 -1
  289. package/dist/module/justifi-checkouts-list-filters.js +6 -4
  290. package/dist/module/justifi-checkouts-list.js +1 -1
  291. package/dist/module/justifi-dispute-management.js +1 -1
  292. package/dist/module/justifi-header2.js +1 -1
  293. package/dist/module/justifi-order-terminals.js +1 -1
  294. package/dist/module/justifi-payment-transactions-list.js +2 -2
  295. package/dist/module/justifi-payments-list-filters.js +4 -4
  296. package/dist/module/justifi-payments-list.js +1 -1
  297. package/dist/module/justifi-payout-transactions-list.js +2 -2
  298. package/dist/module/justifi-payouts-list-filters.js +4 -4
  299. package/dist/module/justifi-payouts-list.js +1 -1
  300. package/dist/module/justifi-skeleton.js +1 -1
  301. package/dist/module/justifi-terminal-orders-list-filters.js +22 -12
  302. package/dist/module/justifi-terminal-orders-list.js +1 -1
  303. package/dist/module/justifi-terminals-list-filters.js +6 -2
  304. package/dist/module/justifi-terminals-list.js +1 -1
  305. package/dist/module/justifi-tokenize-payment-method.js +1 -1
  306. package/dist/module/modular-checkout.js +1 -1
  307. package/dist/module/package.js +1 -1
  308. package/dist/module/parts.js +2 -41
  309. package/dist/module/payment-details-core2.js +8 -8
  310. package/dist/module/payment-method-option.js +1 -1
  311. package/dist/module/payments-list-core2.js +2 -2
  312. package/dist/module/payout-details-core2.js +3 -3
  313. package/dist/module/payouts-list-core2.js +2 -2
  314. package/dist/module/product-or-service.js +1 -1
  315. package/dist/module/refund-policy.js +1 -1
  316. package/dist/module/shipping-details.js +1 -1
  317. package/dist/module/summary.js +1 -1
  318. package/dist/module/table-filters-menu2.js +2 -2
  319. package/dist/module/table.js +1 -1
  320. package/dist/module/terminal-orders-list-core2.js +2 -2
  321. package/dist/module/terminal-quantity-selector2.js +1 -1
  322. package/dist/module/terminals-list-core2.js +2 -2
  323. package/dist/types/api/Checkout.d.ts +1 -0
  324. package/dist/types/api/Terminal.d.ts +3 -1
  325. package/dist/types/api/TerminalOrder.d.ts +1 -0
  326. package/dist/types/components/checkouts-list/checkouts-list-filters.d.ts +1 -0
  327. package/dist/types/components/terminal-orders-list/terminal-orders-list-filters.d.ts +2 -0
  328. package/dist/types/components/terminals-list/terminals-list-filters.d.ts +2 -0
  329. package/dist/types/components.d.ts +8 -0
  330. package/dist/types/styles/parts.d.ts +1 -35
  331. package/dist/webcomponents/{p-DqtDbB8E.js → p--UanYWb-.js} +1 -1
  332. package/dist/webcomponents/p-03b913e8.entry.js +1 -0
  333. package/dist/webcomponents/{p-fa876b02.entry.js → p-12b662e3.entry.js} +1 -1
  334. package/dist/webcomponents/{p-d07748fa.entry.js → p-132c8d4c.entry.js} +4 -4
  335. package/dist/webcomponents/{p-ec9f527d.entry.js → p-15919744.entry.js} +1 -1
  336. package/dist/webcomponents/{p-c5540693.entry.js → p-19e82b02.entry.js} +1 -1
  337. package/dist/webcomponents/p-19f22078.entry.js +1 -0
  338. package/dist/webcomponents/p-1ddbbba8.entry.js +1 -0
  339. package/dist/webcomponents/p-1fc96f35.entry.js +1 -0
  340. package/dist/webcomponents/{p-3cfc202a.entry.js → p-251f6c90.entry.js} +1 -1
  341. package/dist/webcomponents/p-2758d129.entry.js +1 -0
  342. package/dist/webcomponents/p-2V38oZhe.js +1 -0
  343. package/dist/webcomponents/{p-DrSNQm-e.js → p-2xM1wp0u.js} +1 -1
  344. package/dist/webcomponents/p-320aac60.entry.js +1 -0
  345. package/dist/webcomponents/{p-cb09959d.entry.js → p-337fb232.entry.js} +1 -1
  346. package/dist/webcomponents/p-3490ede8.entry.js +1 -0
  347. package/dist/webcomponents/{p-393c9065.entry.js → p-368d8543.entry.js} +1 -1
  348. package/dist/webcomponents/{p-b3675b20.entry.js → p-3bf56699.entry.js} +1 -1
  349. package/dist/webcomponents/p-3cd30c7a.entry.js +1 -0
  350. package/dist/webcomponents/{p-a75bc18b.entry.js → p-3f9c7b04.entry.js} +1 -1
  351. package/dist/webcomponents/p-426fd524.entry.js +1 -0
  352. package/dist/webcomponents/{p-e0cca91e.entry.js → p-4ae0227a.entry.js} +1 -1
  353. package/dist/webcomponents/p-50a34a13.entry.js +1 -0
  354. package/dist/webcomponents/{p-43c70ddf.entry.js → p-5148f836.entry.js} +1 -1
  355. package/dist/webcomponents/{p-a6d56b36.entry.js → p-541da1ed.entry.js} +1 -1
  356. package/dist/webcomponents/{p-fe0feef1.entry.js → p-55605664.entry.js} +1 -1
  357. package/dist/webcomponents/p-55b478bc.entry.js +1 -0
  358. package/dist/webcomponents/{p-9eeaf2f9.entry.js → p-57e09f09.entry.js} +1 -1
  359. package/dist/webcomponents/p-5b4dfe0e.entry.js +1 -0
  360. package/dist/webcomponents/p-5c70a772.entry.js +1 -0
  361. package/dist/webcomponents/{p-bafe9deb.entry.js → p-60df1c18.entry.js} +1 -1
  362. package/dist/webcomponents/p-6Nv8l5n8.js +1 -0
  363. package/dist/webcomponents/{p-5d5e26f7.entry.js → p-6cdea3ef.entry.js} +1 -1
  364. package/dist/webcomponents/p-7703ada7.entry.js +1 -0
  365. package/dist/webcomponents/{p-319ac08d.entry.js → p-77d0f2e2.entry.js} +1 -1
  366. package/dist/webcomponents/{p-df110446.entry.js → p-7cb910cf.entry.js} +1 -1
  367. package/dist/webcomponents/p-8ed651b1.entry.js +1 -0
  368. package/dist/webcomponents/{p-e4ef4a19.entry.js → p-97e27e4a.entry.js} +1 -1
  369. package/dist/webcomponents/{p-a0134f5a.entry.js → p-9ed5d349.entry.js} +1 -1
  370. package/dist/webcomponents/p-BPpqjhPu.js +1 -0
  371. package/dist/webcomponents/p-BU9iZ8OM.js +1 -0
  372. package/dist/webcomponents/p-BXT1uJVr.js +1 -0
  373. package/dist/webcomponents/p-BYLHkONM.js +1 -0
  374. package/dist/webcomponents/{p-DvptzT44.js → p-BrcAwFqw.js} +1 -1
  375. package/dist/webcomponents/p-C0tps2ph.js +1 -0
  376. package/dist/webcomponents/{p-CV5ZI_qC.js → p-C5CtnV8A.js} +1 -1
  377. package/dist/webcomponents/{p-b4MDVEve.js → p-CMLfjWil.js} +1 -1
  378. package/dist/webcomponents/p-COZ-9O53.js +1 -0
  379. package/dist/webcomponents/p-C_WlV7F_.js +1 -0
  380. package/dist/webcomponents/p-Csh7hxly.js +1 -0
  381. package/dist/webcomponents/{p-CMq8FpAG.js → p-D-cvuqv1.js} +1 -1
  382. package/dist/webcomponents/p-D3V9AE6o.js +1 -0
  383. package/dist/webcomponents/p-DSmuL_bZ.js +1 -0
  384. package/dist/webcomponents/{p-B_KHnbK8.js → p-DdR4lBzU.js} +1 -1
  385. package/dist/webcomponents/{p-6V4e6Fb_.js → p-DnZY6aQX.js} +1 -1
  386. package/dist/webcomponents/p-DzeWzcho.js +1 -0
  387. package/dist/webcomponents/{p-CkX7qWsc.js → p-ERB63T7J.js} +1 -1
  388. package/dist/webcomponents/p-FcERM7LF.js +1 -0
  389. package/dist/webcomponents/{p-CemnnRdZ.js → p-XxcNbSyO.js} +1 -1
  390. package/dist/webcomponents/p-_BHErKTQ.js +1 -0
  391. package/dist/webcomponents/{p-941eac67.entry.js → p-a109b3a1.entry.js} +1 -1
  392. package/dist/webcomponents/{p-06af9f9f.entry.js → p-a5db7147.entry.js} +1 -1
  393. package/dist/webcomponents/p-b08bca2b.entry.js +1 -0
  394. package/dist/webcomponents/p-b2c237c6.entry.js +1 -0
  395. package/dist/webcomponents/p-b2d5f105.entry.js +1 -0
  396. package/dist/webcomponents/p-b8fc6dff.entry.js +1 -0
  397. package/dist/webcomponents/p-c595d3fb.entry.js +1 -0
  398. package/dist/webcomponents/{p-277bc549.entry.js → p-c751bb5f.entry.js} +1 -1
  399. package/dist/webcomponents/p-c9f94919.entry.js +1 -0
  400. package/dist/webcomponents/{p-6b6d8263.entry.js → p-ca307ba0.entry.js} +1 -1
  401. package/dist/webcomponents/p-ca7e369f.entry.js +1 -0
  402. package/dist/webcomponents/p-cab4c787.entry.js +1 -0
  403. package/dist/webcomponents/p-cd220f6c.entry.js +1 -0
  404. package/dist/webcomponents/{p-f2110cd2.entry.js → p-cd2c2256.entry.js} +1 -1
  405. package/dist/webcomponents/p-cd7a4048.entry.js +1 -0
  406. package/dist/webcomponents/p-d5d8ccd9.entry.js +1 -0
  407. package/dist/webcomponents/p-e646422f.entry.js +1 -0
  408. package/dist/webcomponents/p-e72d05b1.entry.js +1 -0
  409. package/dist/webcomponents/p-e86c713b.entry.js +1 -0
  410. package/dist/webcomponents/p-e9d7f988.entry.js +1 -0
  411. package/dist/webcomponents/p-ef98982e.entry.js +1 -0
  412. package/dist/webcomponents/p-f1562dab.entry.js +1 -0
  413. package/dist/webcomponents/p-f23b4474.entry.js +1 -0
  414. package/dist/webcomponents/{p-79d76cd4.entry.js → p-f4074e9a.entry.js} +1 -1
  415. package/dist/webcomponents/p-f44008d9.entry.js +1 -0
  416. package/dist/webcomponents/{p-5d4e607a.entry.js → p-f657995a.entry.js} +1 -1
  417. package/dist/webcomponents/p-fa3b5072.entry.js +1 -0
  418. package/dist/webcomponents/p-fb58eb13.entry.js +1 -0
  419. package/dist/webcomponents/{p-dbf2ba9e.entry.js → p-fff25a5f.entry.js} +1 -1
  420. package/dist/webcomponents/p-o83Uy7sW.js +1 -0
  421. package/dist/webcomponents/p-qNXIkzDE.js +1 -0
  422. package/dist/webcomponents/{p-BHA4oSi3.js → p-rgpO5xc3.js} +1 -1
  423. package/dist/webcomponents/p-t6eP44Li.js +1 -0
  424. package/dist/webcomponents/{p-C47u26qr.js → p-vIYW-hye.js} +1 -1
  425. package/dist/webcomponents/p-xvmoHDSy.js +1 -0
  426. package/dist/webcomponents/{p-3kNggPyP.js → p-zGGZEiGQ.js} +1 -1
  427. package/dist/webcomponents/webcomponents.esm.js +1 -1
  428. package/package.json +1 -1
  429. package/dist/esm/parts-c8J1gsDg.js +0 -149
  430. package/dist/webcomponents/p-01a84bc8.entry.js +0 -1
  431. package/dist/webcomponents/p-02cf51ab.entry.js +0 -1
  432. package/dist/webcomponents/p-0559b9c1.entry.js +0 -1
  433. package/dist/webcomponents/p-09401e56.entry.js +0 -1
  434. package/dist/webcomponents/p-2531ee6c.entry.js +0 -1
  435. package/dist/webcomponents/p-27518699.entry.js +0 -1
  436. package/dist/webcomponents/p-2b60c926.entry.js +0 -1
  437. package/dist/webcomponents/p-32bf8202.entry.js +0 -1
  438. package/dist/webcomponents/p-3469a272.entry.js +0 -1
  439. package/dist/webcomponents/p-37407a7f.entry.js +0 -1
  440. package/dist/webcomponents/p-392c431d.entry.js +0 -1
  441. package/dist/webcomponents/p-4556535d.entry.js +0 -1
  442. package/dist/webcomponents/p-559ff95b.entry.js +0 -1
  443. package/dist/webcomponents/p-56362fb6.entry.js +0 -1
  444. package/dist/webcomponents/p-5895654d.entry.js +0 -1
  445. package/dist/webcomponents/p-64d78daf.entry.js +0 -1
  446. package/dist/webcomponents/p-654573c2.entry.js +0 -1
  447. package/dist/webcomponents/p-6986bd9d.entry.js +0 -1
  448. package/dist/webcomponents/p-6b6195c9.entry.js +0 -1
  449. package/dist/webcomponents/p-71b6fdd9.entry.js +0 -1
  450. package/dist/webcomponents/p-77CuiIig.js +0 -1
  451. package/dist/webcomponents/p-79975b5d.entry.js +0 -1
  452. package/dist/webcomponents/p-81b3f90f.entry.js +0 -1
  453. package/dist/webcomponents/p-8Wa_-5QM.js +0 -1
  454. package/dist/webcomponents/p-91bf7445.entry.js +0 -1
  455. package/dist/webcomponents/p-91ee58e0.entry.js +0 -1
  456. package/dist/webcomponents/p-9438f755.entry.js +0 -1
  457. package/dist/webcomponents/p-95b78da8.entry.js +0 -1
  458. package/dist/webcomponents/p-98a1b12a.entry.js +0 -1
  459. package/dist/webcomponents/p-BBNT9yj5.js +0 -1
  460. package/dist/webcomponents/p-BMqYkvp1.js +0 -1
  461. package/dist/webcomponents/p-BiNakvsa.js +0 -1
  462. package/dist/webcomponents/p-BnVuFEgH.js +0 -1
  463. package/dist/webcomponents/p-BylxH1fV.js +0 -1
  464. package/dist/webcomponents/p-CVa33GsE.js +0 -1
  465. package/dist/webcomponents/p-CVkk7TvR.js +0 -1
  466. package/dist/webcomponents/p-Cc6518FT.js +0 -1
  467. package/dist/webcomponents/p-CmRrs0bo.js +0 -1
  468. package/dist/webcomponents/p-CmYy5XDp.js +0 -1
  469. package/dist/webcomponents/p-CncaMWc8.js +0 -1
  470. package/dist/webcomponents/p-CtxSp8dd.js +0 -1
  471. package/dist/webcomponents/p-DL3PPUGZ.js +0 -1
  472. package/dist/webcomponents/p-DmrpBh4P.js +0 -1
  473. package/dist/webcomponents/p-PtJwUDIK.js +0 -1
  474. package/dist/webcomponents/p-abc769fa.entry.js +0 -1
  475. package/dist/webcomponents/p-b9248f88.entry.js +0 -1
  476. package/dist/webcomponents/p-bb4da414.entry.js +0 -1
  477. package/dist/webcomponents/p-c8J1gsDg.js +0 -1
  478. package/dist/webcomponents/p-d0abe57d.entry.js +0 -1
  479. package/dist/webcomponents/p-d47909f1.entry.js +0 -1
  480. package/dist/webcomponents/p-d6bf1592.entry.js +0 -1
  481. package/dist/webcomponents/p-eEJMJXTG.js +0 -1
  482. package/dist/webcomponents/p-ee06f2fa.entry.js +0 -1
  483. package/dist/webcomponents/p-f01cdb9f.entry.js +0 -1
  484. package/dist/webcomponents/p-f9f0a5c8.entry.js +0 -1
@@ -0,0 +1 @@
1
+ import{h as t,r as e,c as i,H as s,g as n}from"./p-CV0Pyo1O.js";import{A as o}from"./p-55QcjheA.js";import{A as a,r,s as l,t as c,u as h,v as d,w as u,I as p,m as y,n as m,o as v}from"./p-_BHErKTQ.js";import{S as M}from"./p-BqNNwq6C.js";import"./p-CZfYo5-1.js";import{S as g}from"./p-C0tps2ph.js";import{c as f,o as b,g as w,a as k,b as j}from"./p-Daew0gTO.js";import{t as T,r as A}from"./p-D3V9AE6o.js";import{f as N}from"./p-MeSAYDNh.js";import{w as P,c as E}from"./p-DVJaoI_m.js";import{H as I}from"./p-t6eP44Li.js";import{H as C,b as D,h as x,i as L}from"./p-2xM1wp0u.js";import{H as O}from"./p-FcERM7LF.js";import{J as S,c as z}from"./p-zGGZEiGQ.js";import"./p-HXpYMWUU.js";import{C as R,a as _,b as U}from"./p-Cjcsf8ku.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import{g as Y,a as B}from"./p-D2muobcE.js";import{C as Q}from"./p-rgpO5xc3.js";import{P as F}from"./p-DzeWzcho.js";import{P as V,a as G,b as H}from"./p-DkoufM1t.js";import{C as Z}from"./p-ZpPDShvP.js";import"./p-D8GTwl9v.js";import"./p-qNXIkzDE.js";var W;!function(t){t.UNAVAILABLE="UNAVAILABLE",t.SESSION_ERROR="SESSION_ERROR",t.MERCHANT_VALIDATION_ERROR="MERCHANT_VALIDATION_ERROR",t.PAYMENT_PROCESSING_ERROR="PAYMENT_PROCESSING_ERROR",t.USER_CANCELLED="USER_CANCELLED"}(W||(W={}));class q{constructor(){this.api=o()}initialize(t){if(this.applePayConfig=new a(t),!this.applePayConfig.isValid)throw new Error("Invalid Apple Pay configuration provided")}async validateMerchant(t,e){try{return await this.api.post({endpoint:"apple_pay/merchant_session",authToken:t,headers:{"Sub-Account":e},body:{domain:window.location.hostname,display_name:this.applePayConfig.displayName}})}catch(t){throw console.error("Backend validation failed:",t),new Error("Merchant validation failed")}}async processPayment(t,e,i){const s=await this.api.post({endpoint:"apple_pay/process_token",authToken:t,body:i,headers:{"Sub-Account":e}});return{success:s.id&&!!s.data.token,data:s}}isAvailable(){return r.isApplePaySupported()&&r.canMakePayments()}async canMakePaymentsWithActiveCard(){if(!this.applePayConfig)throw new Error("Apple Pay not initialized. Call initialize() first.");return await r.canMakePaymentsWithActiveCard(this.applePayConfig.merchantIdentifier)}async startPaymentSession(t,e,i){if(!this.applePayConfig)throw console.error("[ApplePayService] Missing applePayConfig. Did you call initialize()?"),new Error("Apple Pay not initialized. Call initialize() first.");const s=new l(t);if(!s.isValid){const t=[];throw s.countryCode||t.push("countryCode"),s.currencyCode||t.push("currencyCode"),s.merchantCapabilities&&0!==s.merchantCapabilities.length||t.push("merchantCapabilities"),s.supportedNetworks&&0!==s.supportedNetworks.length||t.push("supportedNetworks"),s.total&&s.total.label&&s.total.amount||t.push("total"),console.error("[ApplePayService] Payment request is invalid. Missing/invalid:",t),new Error("Invalid payment request provided")}return this.currentPaymentRequest=s,new Promise(((t,n)=>{try{if("undefined"==typeof window||!("ApplePaySession"in window))return console.error("[ApplePayService] ApplePaySession not available on window"),n({success:!1,error:{code:W.UNAVAILABLE,message:"ApplePaySession API is not available in this environment"}});this.currentSession=new window.ApplePaySession(3,s),this.setupSessionEventHandlers(t,n,e,i),this.currentSession.begin()}catch(t){console.error("[ApplePayService] Exception while starting session:",t),n({success:!1,error:{code:W.SESSION_ERROR,message:t instanceof Error?t.message:"Failed to start Apple Pay session"}})}}))}abortPaymentSession(){this.currentSession&&(this.currentSession.abort(),this.currentSession=void 0,this.currentPaymentRequest=void 0)}setupSessionEventHandlers(t,e,i,s){this.currentSession&&this.applePayConfig&&this.currentPaymentRequest?(this.currentSession.onvalidatemerchant=async()=>{try{if(!i)throw console.error("[ApplePayService] Missing authToken for merchant validation"),new Error("Authentication token not provided.");const t=await this.validateMerchant(i,s);try{this.currentSession.completeMerchantValidation(t)}catch(t){throw console.error("Error calling completeMerchantValidation:",t),t}}catch(t){console.error("=== MERCHANT VALIDATION ERROR ==="),console.error("Error during merchant validation:",t),t&&t.stack&&console.error("Error stack:",t.stack),this.currentSession.abort(),e({success:!1,error:{code:W.MERCHANT_VALIDATION_ERROR,message:t instanceof Error?t.message:"Merchant validation failed"}})}},this.currentSession.onpaymentauthorized=async n=>{try{const o=n.payment,a=Object.assign(Object.assign({},o.token),{product_details:{name:this.currentPaymentRequest.total.label,price:r.parseAmount(this.currentPaymentRequest.total.amount),description:this.currentPaymentRequest.total.label}}),l=await this.processPayment(i,s,a);l.success?(this.currentSession.completePayment({status:c.STATUS_SUCCESS}),t({success:!0,token:o.token,paymentMethodId:l.data.id})):(console.error("PSP reported payment failure:",l.data),this.currentSession.completePayment({status:c.STATUS_FAILURE}),e({success:!1,error:{code:W.PAYMENT_PROCESSING_ERROR,message:"Payment processing failed"}}))}catch(t){console.error("=== PAYMENT PROCESSING ERROR ==="),console.error("Error processing payment:",t),t&&t.stack&&console.error("Error stack:",t.stack),this.currentSession.completePayment({status:c.STATUS_FAILURE}),e({success:!1,error:{code:W.PAYMENT_PROCESSING_ERROR,message:t instanceof Error?t.message:"Payment processing failed"}})}finally{this.currentSession=void 0,this.currentPaymentRequest=void 0}},this.currentSession.onpaymentmethodselected=()=>{const t={newTotal:this.currentPaymentRequest.total,newLineItems:this.currentPaymentRequest.lineItems||[]};try{this.currentSession.completePaymentMethodSelection(t)}catch(t){console.error("Error completing payment method selection:",t),this.currentSession.abort()}},this.currentSession.onshippingmethodselected=()=>{this.currentSession.completeShippingMethodSelection({status:c.STATUS_SUCCESS,newTotal:this.currentPaymentRequest.total,newLineItems:this.currentPaymentRequest.lineItems||[]})},this.currentSession.oncancel=t=>{if(t.sessionError)switch(console.error(t.sessionError),t.sessionError.code){case"unknown":console.error("Unknown error - likely merchant validation issue"),console.error("This usually means:"),console.error("1. Merchant certificate is invalid or expired"),console.error("2. Merchant identifier mismatch"),console.error("3. Backend validation endpoint issues");break;case"invalidMerchantSession":console.error("Invalid merchant session provided"),console.error("Check that the merchant session from backend is valid");break;case"userCancel":console.error("User cancelled the payment");break;default:console.error("Other error code:",t.sessionError.code)}this.currentSession=void 0,this.currentPaymentRequest=void 0,e({success:!1,error:{code:W.USER_CANCELLED,message:"User cancelled the Apple Pay session"}})},"onerror"in this.currentSession&&(this.currentSession.onerror=t=>{console.error("=== APPLE PAY SESSION ERROR ==="),console.error("Session error:",t),this.currentSession=void 0,this.currentPaymentRequest=void 0,e({success:!1,error:{code:W.SESSION_ERROR,message:"Apple Pay session error occurred"}})})):console.error("[ApplePayService] setupSessionEventHandlers called without required state",{hasSession:Boolean(this.currentSession),hasConfig:Boolean(this.applePayConfig),hasPaymentRequest:Boolean(this.currentPaymentRequest)})}static createPaymentRequest(t,e,i="US",s="USD"){return{countryCode:i,currencyCode:s,merchantCapabilities:r.getDefaultMerchantCapabilities(),supportedNetworks:r.getDefaultSupportedNetworks(),total:r.createLineItem(e,t)}}getApplePayConfig(){return this.applePayConfig}}const J=e=>{const{isLoading:i}=e;return i?t("div",{class:"container-fluid p-0"},t("div",{class:"row mb-3"},t("div",{class:"col-12 align-content-center"},t(g,{height:"44px",width:"100%",styles:{borderRadius:"8px"}})))):null},X=e=>t("div",{class:"apple-pay-button-container"},t("button",Object.assign({class:(()=>{let t="apple-pay-button";switch(e.buttonStyle){case h.WHITE:t+=" apple-pay-button-white";break;case h.WHITE_OUTLINE:t+=" apple-pay-button-white-outline";break;default:t+=" apple-pay-button-black"}switch(e.buttonType){case d.BUY:t+=" apple-pay-button-type-buy";break;case d.DONATE:t+=" apple-pay-button-type-donate";break;default:t+=" apple-pay-button-type-plain"}return(e.disabled||e.isProcessing||!e.isAvailable)&&(t+=" disabled"),t})(),style:{width:e.width,height:e.height},onClick:()=>{!e.disabled&&!e.isProcessing&&e.isAvailable&&e.clickHandler&&e.clickHandler()},disabled:e.disabled||e.isProcessing||!e.isAvailable,"aria-label":"Pay with Apple Pay",type:"button"},e),e.isProcessing&&t("div",{class:"processing-overlay"},t("div",{class:"spinner"}),t("span",null,"Processing..."))),t("style",null,"\n .apple-pay-button-container {\n display: block;\n position: relative;\n width: 100%;\n }\n\n /* Apple Pay CSS classes - these are the official Apple Pay button styles */\n .apple-pay-button {\n display: inline-block;\n -webkit-appearance: -apple-pay-button;\n -apple-pay-button-type: plain; /* default */\n -apple-pay-button-style: black; /* default */\n border-radius: 8px;\n cursor: pointer;\n border: none;\n outline: none;\n transition: opacity 0.2s ease;\n position: relative;\n }\n\n /* Button styles */\n .apple-pay-button.apple-pay-button-black {\n -apple-pay-button-style: black;\n }\n\n .apple-pay-button.apple-pay-button-white {\n -apple-pay-button-style: white;\n }\n\n .apple-pay-button.apple-pay-button-white-outline {\n -apple-pay-button-style: white-outline;\n }\n\n /* Button types */\n .apple-pay-button.apple-pay-button-type-plain {\n -apple-pay-button-type: plain;\n }\n\n .apple-pay-button.apple-pay-button-type-buy {\n -apple-pay-button-type: buy;\n }\n\n .apple-pay-button.apple-pay-button-type-donate {\n -apple-pay-button-type: donate;\n }\n\n /* Hover and disabled states */\n .apple-pay-button:hover:not(.disabled) {\n opacity: 0.9;\n }\n\n .apple-pay-button.disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n /* Processing overlay */\n .processing-overlay {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n background: rgba(0, 0, 0, 0.8);\n color: white;\n border-radius: 8px;\n font-size: 14px;\n font-weight: 500;\n }\n\n .spinner {\n width: 16px;\n height: 16px;\n border: 2px solid rgba(255, 255, 255, 0.3);\n border-top: 2px solid #fff;\n border-radius: 50%;\n animation: spin 1s linear infinite;\n }\n\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n\n /* Responsive design */\n @media (max-width: 480px) {\n .apple-pay-button {\n width: 100% !important;\n min-width: 200px;\n }\n }\n ")),$=class{constructor(t){e(this,t),this.applePayStarted=i(this,"applePayStarted",7),this.applePayCompleted=i(this,"applePayCompleted",7),this.applePayCancelled=i(this,"applePayCancelled",7),this.applePayError=i(this,"applePayError",7),this.countryCode="US",this.merchantIdentifier="merchant.com.staging-justifi.checkout-dev",this.merchantDisplayName="JustiFi Checkout",this.initiativeContext="dev-checkout.justifi-staging.com",this.buttonType=d.PLAIN,this.buttonStyle=h.BLACK,this.disabled=!1,this.showSkeleton=!0,this.width="100%",this.height="48px",this.isLoading=!0,this.isProcessing=!1,this.isAvailable=!1,this.canMakePayments=!1,this.isConfigValid=!0,this.error=null,this.handleApplePayClick=async()=>{var t,e,i;if(!this.isProcessing&&!this.disabled&&this.isAvailable)try{this.isProcessing=!0,this.error=null,this.applePayStarted.emit();const i={countryCode:this.countryCode,currencyCode:f.paymentCurrency,merchantCapabilities:[u.SUPPORTS_3DS,u.SUPPORTS_CREDIT,u.SUPPORTS_DEBIT],supportedNetworks:r.getDefaultSupportedNetworks(),total:r.createLineItem(f.paymentDescription,f.paymentAmount)},s=await this.applePayService.startPaymentSession(i,f.authToken,f.accountId);s.success?this.applePayCompleted.emit({success:!0,token:s.token,paymentMethodId:s.paymentMethodId}):(this.applePayCompleted.emit({success:!1,error:s.error}),this.applePayError.emit({error:(null===(t=s.error)||void 0===t?void 0:t.message)||"Payment failed",code:(null===(e=s.error)||void 0===e?void 0:e.code)||$.ErrorCode.PAYMENT_FAILED}))}catch(t){if((null===(i=null==t?void 0:t.error)||void 0===i?void 0:i.code)===W.USER_CANCELLED)this.applePayCancelled.emit();else{const e=t instanceof Error?t.message:"Payment failed";this.error=e,this.applePayError.emit({error:e,code:$.ErrorCode.PAYMENT_FAILED}),this.applePayCompleted.emit({success:!1,error:e})}}finally{this.isProcessing=!1}}}async initializeApplePay(){try{if(this.isLoading=!0,this.error=null,this.isConfigValid=!0,!(Boolean(f.paymentAmount)&&Boolean(f.paymentCurrency)&&Boolean(f.authToken)))return this.error="Missing required Apple Pay configuration",this.isConfigValid=!1,console.error("Apple Pay config error: missing required values",{paymentAmount:f.paymentAmount,paymentCurrency:f.paymentCurrency,hasAuthToken:Boolean(f.authToken),accountId:f.accountId}),this.applePayError.emit({error:this.error,code:$.ErrorCode.CONFIG_ERROR}),void(this.isLoading=!1);if(this.isAvailable=r.isApplePaySupported(),this.canMakePayments=r.canMakePayments(),!this.isAvailable)return this.error="Apple Pay is not supported on this device",console.error(this.error),this.applePayError.emit({error:this.error,code:$.ErrorCode.NOT_SUPPORTED}),void(this.isLoading=!1);if(!this.canMakePayments)return this.error="Apple Pay is not available",console.error(this.error),this.applePayError.emit({error:this.error,code:$.ErrorCode.NOT_AVAILABLE}),void(this.isLoading=!1);const t={merchantIdentifier:this.merchantIdentifier,displayName:this.merchantDisplayName,initiative:"web",initiativeContext:this.initiativeContext,buttonType:this.buttonType,buttonStyle:this.buttonStyle};this.applePayService=new q,this.applePayService.initialize(t),await this.applePayService.canMakePaymentsWithActiveCard()||console.warn("No Apple Pay cards available, but continuing...")}catch(t){console.error("Apple Pay initialization error:",t),this.error=t instanceof Error?t.message:"Failed to initialize Apple Pay",this.applePayError.emit({error:this.error,code:$.ErrorCode.INITIALIZATION_ERROR})}finally{this.isLoading=!1}}async isSupported(){return this.isAvailable&&this.canMakePayments}async getPaymentMethods(){return this.isAvailable?r.getDefaultSupportedNetworks():[]}async abort(){this.applePayService.abortPaymentSession(),this.isProcessing=!1,this.applePayCancelled.emit()}render(){if(!f.applePayEnabled)return null;const e=!this.isLoading&&this.isAvailable&&this.canMakePayments&&this.isConfigValid;return t(M,null,f.checkoutLoaded&&t("script",{async:!0,src:"https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js",onLoad:()=>{this.initializeApplePay()}}),t("div",{class:"apple-pay-container"},t(J,{isLoading:this.isLoading}),e&&t(X,{buttonType:this.buttonType,buttonStyle:this.buttonStyle,disabled:this.disabled,isProcessing:this.isProcessing,isAvailable:this.isAvailable,clickHandler:this.handleApplePayClick,width:this.width,height:this.height})),t("style",null,"\n .apple-pay-container {\n width: 100%;\n }\n "))}};$.ErrorCode={CONFIG_ERROR:"CONFIG_ERROR",NOT_SUPPORTED:"NOT_SUPPORTED",NOT_AVAILABLE:"NOT_AVAILABLE",INITIALIZATION_ERROR:"INITIALIZATION_ERROR",PAYMENT_FAILED:"PAYMENT_FAILED"};const K=class{constructor(t){e(this,t)}render(){return t(M,{key:"74b2a1ebf22f1f7e7cb0cfbbbba8a3f8cd528a6b"},t("section",{key:"6ea0bd41680b937c0ff88aa0f73c1ac4bccee9b9"},t("div",{key:"6ca013f92dbaf076bda9a65c98acdf5c8192b22a"},t("div",{key:"62f166bdc0b47e8cda03ee4d549736aaf336727e",part:T},null==f?void 0:f.paymentDescription),t("div",{key:"c681ecba3bbceac71993833f8861393dc5751b4c"},t("span",{key:"46eaedc091f44c2d3bad94cb6a05098385be8ebc",part:T},"Total")," ",t("span",{key:"ad70de1a38c2c7625562cee3a745a6a61235f4cf",part:T},N(+(null==f?void 0:f.totalAmount)))))))}},tt=e=>{const{isLoading:i}=e;return i?t("div",{class:"container-fluid p-0"},t("div",{class:"row mb-3"},t("div",{class:"col-12 align-content-center"},t(g,{height:"44px",width:"100%",styles:{borderRadius:"8px"}})))):null};var et;!function(t){t.initialize="justifi.googlePay.initialize",t.ready="justifi.googlePay.ready",t.sdkLoaded="justifi.googlePay.sdkLoaded",t.initializeResult="justifi.googlePay.initializeResult",t.error="justifi.googlePay.error",t.buttonClicked="justifi.googlePay.buttonClicked",t.startPayment="justifi.googlePay.startPayment",t.paymentSuccess="justifi.googlePay.paymentSuccess",t.paymentCanceled="justifi.googlePay.paymentCanceled",t.paymentError="justifi.googlePay.paymentError"}(et||(et={}));const it=class{constructor(t){e(this,t),this.googlePayCompleted=i(this,"googlePayCompleted",7),this.googlePayCancelled=i(this,"googlePayCancelled",7),this.environment="TEST",this.iframeReady=!1,this.sdkLoaded=!1,this.isReadyToPay=!1,this.handleMessage=t=>{if(t.origin!==this.iframeOrigin)return;const{eventType:e,data:i}=t.data||{};switch(e){case et.ready:this.iframeReady=!0;break;case et.sdkLoaded:this.sdkLoaded=!0,this.sendInitialize();break;case et.initializeResult:this.isReadyToPay=i.isReadyToPay,i.error&&console.error("Init error:",i.error);break;case et.error:console.error("Google Pay error:",i);break;case et.buttonClicked:this.sendStartPayment();break;case et.paymentSuccess:this.googlePayCompleted.emit({success:!0,paymentMethodId:i.paymentMethodId,cardNetwork:i.cardNetwork,cardDetails:i.cardDetails});break;case et.paymentCanceled:this.googlePayCancelled.emit();break;case et.paymentError:this.googlePayCompleted.emit({success:!1,error:{code:i.code,message:i.message}})}}}async componentWillLoad(){await P(),this.iframeOrigin=E.iframeOrigin}componentDidLoad(){window.addEventListener("message",this.handleMessage)}disconnectedCallback(){window.removeEventListener("message",this.handleMessage)}sendInitialize(){var t;(null===(t=this.iframeElement)||void 0===t?void 0:t.contentWindow)&&this.iframeElement.contentWindow.postMessage({eventType:et.initialize,data:{environment:this.environment,gatewayMerchantId:f.accountId,merchantName:this.merchantName,authToken:f.authToken,accountId:f.accountId}},this.iframeOrigin)}sendStartPayment(){var t;if(!(null===(t=this.iframeElement)||void 0===t?void 0:t.contentWindow))return;const e={totalPrice:String(f.paymentAmount/100),totalPriceStatus:"FINAL",currencyCode:f.paymentCurrency||"USD"};this.iframeElement.contentWindow.postMessage({eventType:et.startPayment,data:e},this.iframeOrigin)}render(){return f.googlePayEnabled?t(s,null,t(tt,{isLoading:!this.isReadyToPay}),t("iframe",{ref:t=>this.iframeElement=t,src:`${this.iframeOrigin}/v2/googlePay`,style:{border:"none",width:"100%",height:"48px",display:this.isReadyToPay?"block":"none"}})):(console.warn("Google Pay is not enabled for this checkout"),null)}},st=class{constructor(t){e(this,t),this.levels={h1:I,h2:C,h3:O},this.level="h1"}render(){return t(M,{key:"c1e23a5b492761bc527abc1bd59145dcd40b429f"},t(this.levels[this.level],{key:"f7865a78f1671fdc7844805ef241188b5855afbf",text:this.text,class:this.class}))}},nt=class{constructor(t){e(this,t),this.errorEvent=i(this,"error-event",7),this.submitEvent=i(this,"submit-event",7),this.checkoutChangedEvent=i(this,"checkout-changed",7),this.plaidService=new F,this.handleGooglePayCompleted=t=>{const{success:e,paymentMethodId:i,error:s}=t.detail||{};e&&i?(f.paymentToken=i,f.selectedPaymentMethod={type:V.GOOGLE_PAY},this.submitCheckout()):this.errorEvent.emit({message:s&&s.message||"Google Pay payment failed",errorCode:_.TOKENIZE_ERROR,severity:R.ERROR})},this.handleGooglePayCancelled=()=>{f.paymentToken=void 0,f.selectedPaymentMethod=void 0},this.handleApplePayCompleted=t=>{const{success:e,token:i,paymentMethodId:s,error:n}=t.detail;e&&i?(f.paymentToken=s,f.selectedPaymentMethod={type:V.APPLE_PAY},this.submitCheckout()):(console.error("Apple Pay completed but failed:",n),this.errorEvent.emit({message:(null==n?void 0:n.message)||"Apple Pay payment failed",errorCode:_.TOKENIZE_ERROR,severity:R.ERROR}))},this.handleApplePayError=t=>{const{error:e,code:i}=t.detail;console.error("Apple Pay error:",e),this.errorEvent.emit({message:e||"Apple Pay error occurred",errorCode:`APPLE_PAY_${i}`,severity:R.ERROR})},this.handleApplePayCancelled=()=>{f.paymentToken=void 0,f.selectedPaymentMethod=void 0}}connectedCallback(){this.observer=new MutationObserver((()=>{this.queryFormRefs(),this.setupApplePayListeners(),this.setupGooglePayListeners()})),this.observer.observe(this.hostEl,{childList:!0,subtree:!0}),f.checkoutId=this.checkoutId;const t={authToken:this.authToken,checkoutId:this.checkoutId,service:new Q};this.getCheckout=(({authToken:t,checkoutId:e,service:i})=>async({onSuccess:s,onError:n})=>{var o;try{const a=await i.fetchCheckout(t,e);if(a.error)return n({error:B(a.error),code:Y(null===(o=a.error)||void 0===o?void 0:o.code),severity:R.ERROR});s({checkout:a.data})}catch(t){const e=Y(null==t?void 0:t.code);return n({error:t.message||t,code:e,severity:R.ERROR})}})(t),this.completeCheckout=(({authToken:t,checkoutId:e,service:i})=>async({payment:s,onSuccess:n,onError:o})=>{var a;try{const r=await i.complete(t,e,s);if(r.error)return o({error:B(r.error),code:Y(null===(a=r.error)||void 0===a?void 0:a.code),severity:R.ERROR});n({checkout:r.data})}catch(t){const e=Y(null==t?void 0:t.code);return o({error:t.message||t,code:e,severity:R.ERROR})}})(t),b((()=>{this.emitCheckoutChanged()}))}componentWillLoad(){this.analytics=new S(this),z(),f.authToken=this.authToken,this.fetchCheckout(),D("set",(t=>{const e=L[t];void 0!==e&&x(t,e)&&this.fetchCheckout()}))}componentDidLoad(){this.queryFormRefs(),this.setupApplePayListeners(),this.setupGooglePayListeners()}disconnectedCallback(){var t;null===(t=this.observer)||void 0===t||t.disconnect(),this.removeApplePayListeners(),this.removeGooglePayListeners()}fetchCheckout(){this.authToken&&this.checkoutId?this.getCheckout&&this.getCheckout({onSuccess:({checkout:t})=>{this.updateStore(t),t.status!==p.completed?t.status!==p.expired||this.errorEvent.emit({message:U.CHECKOUT_EXPIRED,errorCode:_.CHECKOUT_EXPIRED,severity:R.ERROR}):this.errorEvent.emit({message:U.CHECKOUT_ALREADY_COMPLETED,errorCode:_.CHECKOUT_ALREADY_COMPLETED,severity:R.ERROR})},onError:t=>{this.errorEvent.emit({message:t.message,errorCode:t.code,severity:t.severity})}}):this.errorEvent.emit({message:U.NOT_AUTHENTICATED,errorCode:_.NOT_AUTHENTICATED,severity:R.ERROR})}updateStore(t){var e,i,s,n,o,a,r;f.accountId=t.account_id,f.checkoutLoaded=!0,f.paymentMethods=t.payment_methods.map((t=>new G(t))),f.paymentMethodGroupId=t.payment_method_group_id,f.paymentDescription=t.payment_description,f.totalAmount=t.total_amount,f.paymentAmount=t.payment_amount,f.bnplEnabled=t.payment_settings.bnpl_payments,f.insuranceEnabled=t.payment_settings.insurance_payments,f.bankAccountVerification=null===(e=t.payment_settings)||void 0===e?void 0:e.bank_account_verification,f.applePayEnabled=null===(i=t.payment_settings)||void 0===i?void 0:i.apple_payments,f.googlePayEnabled=null===(s=t.payment_settings)||void 0===s?void 0:s.google_payments,f.bnplProviderClientId=null===(n=null==t?void 0:t.bnpl)||void 0===n?void 0:n.provider_client_id,f.bnplProviderMode=null===(o=null==t?void 0:t.bnpl)||void 0===o?void 0:o.provider_mode,f.bnplProviderApiVersion=null===(a=null==t?void 0:t.bnpl)||void 0===a?void 0:a.provider_api_version,f.bnplProviderCheckoutUrl=null===(r=null==t?void 0:t.bnpl)||void 0===r?void 0:r.provider_checkout_url}emitCheckoutChanged(){const t={availablePaymentMethodTypes:w(),selectedPaymentMethod:f.selectedPaymentMethod,savedPaymentMethods:f.paymentMethods};this.checkoutChangedEvent.emit(t)}queryFormRefs(){this.billingFormRef=this.hostEl.querySelector("justifi-billing-form, justifi-bank-account-billing-form-simple, justifi-card-billing-form-simple, justifi-billing-form-full"),this.applePayRef=this.hostEl.querySelector("justifi-apple-pay"),this.googlePayRef=this.hostEl.querySelector("justifi-google-pay"),this.paymentMethodFormRef=this.hostEl.querySelector("justifi-card-form, justifi-bank-account-form, justifi-tokenize-payment-method"),this.insuranceFormRef=this.hostEl.querySelector("justifi-season-interruption-insurance")}setupApplePayListeners(){this.applePayRef&&(this.applePayRef.addEventListener("applePayCompleted",this.handleApplePayCompleted),this.applePayRef.addEventListener("applePayError",this.handleApplePayError),this.applePayRef.addEventListener("applePayCancelled",this.handleApplePayCancelled))}removeApplePayListeners(){this.applePayRef&&(this.applePayRef.removeEventListener("applePayCompleted",this.handleApplePayCompleted),this.applePayRef.removeEventListener("applePayError",this.handleApplePayError),this.applePayRef.removeEventListener("applePayCancelled",this.handleApplePayCancelled))}setupGooglePayListeners(){this.googlePayRef&&(this.googlePayRef.addEventListener("googlePayCompleted",this.handleGooglePayCompleted),this.googlePayRef.addEventListener("googlePayCancelled",this.handleGooglePayCancelled))}removeGooglePayListeners(){this.googlePayRef&&(this.googlePayRef.removeEventListener("googlePayCompleted",this.handleGooglePayCompleted),this.googlePayRef.removeEventListener("googlePayCancelled",this.handleGooglePayCancelled))}async tokenizePaymentMethod(t){var e,i,s;const n=null!==(i=await(null===(e=this.billingFormRef)||void 0===e?void 0:e.getValues()))&&void 0!==i?i:{},o=Object.assign(Object.assign({},t),n),a=Object.assign({accountId:f.accountId,payment_method_group_id:void 0},o);f.savePaymentMethod&&(a.payment_method_group_id=f.paymentMethodGroupId);const r=await(null===(s=this.paymentMethodFormRef)||void 0===s?void 0:s.tokenize({clientId:this.authToken,paymentMethodMetadata:a,account:f.accountId}));return r.error?r:(f.paymentToken=r.id,r.id)}async setSelectedPaymentMethod(t){f.selectedPaymentMethod=t,f.paymentToken=t.id||void 0}async validate(){var t,e;const i=[];f.insuranceEnabled&&this.insuranceFormRef&&i.push(this.insuranceFormRef.validate());const s=(null===(t=f.selectedPaymentMethod)||void 0===t?void 0:t.type)===V.NEW_CARD,n=(null===(e=f.selectedPaymentMethod)||void 0===e?void 0:e.type)===V.NEW_BANK_ACCOUNT;if((s||n)&&(this.paymentMethodFormRef&&i.push(this.paymentMethodFormRef.validate()),this.billingFormRef&&i.push(this.billingFormRef.validate())),0===i.length)return!0;try{return!!(await Promise.all(i)).every((t=>"boolean"==typeof t?t:!1!==(null==t?void 0:t.isValid)))||(this.errorEvent.emit({message:"Validation error",errorCode:_.VALIDATION_ERROR,severity:R.ERROR}),!1)}catch(t){return!1}}async submitCheckout(t){var e,i,s,n,o;const a=await this.validate();if(!f.selectedPaymentMethod)return void this.errorEvent.emit({message:"No payment method selected.",errorCode:_.VALIDATION_ERROR,severity:R.ERROR});const r=(null===(e=f.selectedPaymentMethod)||void 0===e?void 0:e.type)===V.NEW_CARD,l=(null===(i=f.selectedPaymentMethod)||void 0===i?void 0:i.type)===V.NEW_BANK_ACCOUNT,c=(null===(s=f.selectedPaymentMethod)||void 0===s?void 0:s.type)===V.PLAID;if(r||l){const e=await this.tokenizePaymentMethod(t);if(null==e?void 0:e.error)return void this.errorEvent.emit({message:e.error.message,errorCode:_.TOKENIZE_ERROR,severity:R.ERROR})}if(c&&!f.paymentToken){const t=f.plaidPublicToken,e=f.plaidLinkTokenId;if(!t)return void this.errorEvent.emit({message:"Missing Plaid public token. Please connect your bank.",errorCode:_.TOKENIZE_ERROR,severity:R.ERROR});try{const i=await this.plaidService.tokenizeBankAccount(f.authToken,f.accountId,t,e||void 0,f.savePaymentMethod?f.paymentMethodGroupId:void 0);if(null==i?void 0:i.error)return void this.errorEvent.emit({message:"string"==typeof i.error?i.error:i.error.message||"Failed to tokenize bank account",errorCode:_.TOKENIZE_ERROR,severity:R.ERROR});const s=null==i?void 0:i.data,o=(null===(n=null==s?void 0:s.bank_account)||void 0===n?void 0:n.token)||(null==s?void 0:s.token)||(null==s?void 0:s.id);f.paymentToken=o}catch(t){return void this.errorEvent.emit({message:(null==t?void 0:t.message)||"Plaid exchange error",errorCode:_.TOKENIZE_ERROR,severity:R.ERROR})}}if(!a)return void this.errorEvent.emit({message:"Please fill in all required fields.",errorCode:_.VALIDATION_ERROR,severity:R.ERROR});if(!f.paymentToken)return void this.errorEvent.emit({message:"Payment token not found.",errorCode:_.TOKENIZE_ERROR,severity:R.ERROR});let h;if(h={payment_mode:(t=>{switch(t){case V.NEW_CARD:case V.SAVED_CARD:case V.NEW_BANK_ACCOUNT:case V.SAVED_BANK_ACCOUNT:case V.PLAID:return H.ECOM;case V.SEZZLE:return H.BNPL;case V.APPLE_PAY:return H.APPLE_PAY;case V.GOOGLE_PAY:return H.GOOGLE_PAY;default:return}})(null===(o=f.selectedPaymentMethod)||void 0===o?void 0:o.type),payment_token:f.paymentToken},this.preCompleteHook){const t=k();try{await new Promise(((e,i)=>{this.preCompleteHook(t,(()=>e()),(()=>i()))}))}catch(t){return void console.log("Checkout cancelled by preCompleteHook",t)}}this.completeCheckout({payment:h,onSuccess:({checkout:t})=>{this.submitEvent.emit({checkout:t,message:"Checkout completed successfully"})},onError:t=>{this.errorEvent.emit({message:t.message,errorCode:_.COMPLETE_CHECKOUT_ERROR,severity:R.ERROR})}})}render(){return t(s,{key:"dc4f1c1a2e9cc32100415e732817d4aaec063d89"})}get hostEl(){return n(this)}},ot=class{constructor(t){e(this,t),this.paymentMethodOptionSelected=i(this,"paymentMethodOptionSelected",7),this.plaidError=i(this,"plaidError",7),this.plaidErrorRecovered=i(this,"plaidErrorRecovered",7),this.isAuthenticating=!1,this.publicToken=null,this.linkToken=null,this.linkTokenId=null,this.error=null,this.plaidLink=null,this.isSelected=!1,this.retryCount=0,this.isRetrying=!1,this.plaidService=new F,this.maxRetries=3,this.retryDelay=2e3,this.timeoutId=null,this.abortController=null,this.hasLoggedDisabledWarning=!1,this.waitForStoreAndInitialize=()=>{f.authToken&&f.accountId&&f.checkoutId?this.initializePlaidLink():setTimeout((()=>{this.waitForStoreAndInitialize()}),100)},this.initializePlaidLink=async()=>{try{if(void 0===window.Plaid)return void this.handleError({code:v.PLAID_SDK_LOAD_FAILED,message:m[v.PLAID_SDK_LOAD_FAILED],severity:y[v.PLAID_SDK_LOAD_FAILED],retryable:!0,userAction:"Refresh the page and try again"});if(await this.getLinkToken(),!this.linkToken)return void this.handleError({code:v.PLAID_LINK_TOKEN_FAILED,message:m[v.PLAID_LINK_TOKEN_FAILED],severity:y[v.PLAID_LINK_TOKEN_FAILED],retryable:!0,userAction:"Click to try again"});const t=window.Plaid;this.plaidLink=t.create({token:this.linkToken,onSuccess:this.handlePlaidSuccess,onExit:this.handlePlaidExit,onEvent:this.handlePlaidEvent,onLoad:this.handlePlaidLoad})}catch(t){this.handleError({code:v.PLAID_LINK_INIT_FAILED,message:m[v.PLAID_LINK_INIT_FAILED],severity:y[v.PLAID_LINK_INIT_FAILED],originalError:t,retryable:!0,userAction:"Click to try again"})}},this.getLinkToken=async()=>{var t,e,i,s,n;try{if(!f.authToken||!f.accountId)return void this.handleError({code:v.PLAID_LINK_TOKEN_FAILED,message:"Missing authentication. Please refresh the page and try again.",severity:R.ERROR,retryable:!1,userAction:"Refresh the page"});this.abortController=new AbortController,this.timeoutId=setTimeout((()=>{var t;null===(t=this.abortController)||void 0===t||t.abort()}),3e4);const e=await this.plaidService.getLinkToken(f.authToken,f.accountId,f.checkoutId,this.abortController.signal);if(this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null),e.error)throw new Error("string"==typeof e.error?e.error:e.error.message||"Failed to get link token");this.linkToken=e.data.link_token,this.linkTokenId=(null==e?void 0:e.id)||(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.id)||null,this.linkTokenId&&(f.plaidLinkTokenId=this.linkTokenId)}catch(t){this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null);let o=v.PLAID_LINK_TOKEN_FAILED,a=m[o],r=!0;"AbortError"===t.name?(o=v.PLAID_TIMEOUT,a=m[o],r=!0):(null===(e=t.message)||void 0===e?void 0:e.includes("network"))||(null===(i=t.message)||void 0===i?void 0:i.includes("fetch"))?(o=v.PLAID_NETWORK_ERROR,a=m[o],r=!0):((null===(s=t.message)||void 0===s?void 0:s.includes("401"))||(null===(n=t.message)||void 0===n?void 0:n.includes("unauthorized")))&&(o=v.PLAID_INVALID_CREDENTIALS,a="Authentication failed. Please refresh the page and try again.",r=!1),this.handleError({code:o,message:a,severity:y[o],originalError:t,retryable:r,userAction:r?"Click to try again":"Refresh the page"})}},this.mapApiErrorToPlaidError=t=>{if("string"==typeof t){if(t.includes("rate_limit"))return v.PLAID_RATE_LIMITED;if(t.includes("maintenance"))return v.PLAID_MAINTENANCE;if(t.includes("not_authenticated"))return v.PLAID_INVALID_CREDENTIALS}if(null==t?void 0:t.code)switch(t.code){case"rate_limited":return v.PLAID_RATE_LIMITED;case"maintenance":return v.PLAID_MAINTENANCE;case"not_authenticated":return v.PLAID_INVALID_CREDENTIALS;default:return v.PLAID_LINK_TOKEN_FAILED}return v.PLAID_LINK_TOKEN_FAILED},this.openPlaidLink=()=>{this.plaidLink&&this.linkToken&&(this.isAuthenticating=!0,this.clearError(),this.plaidLink.open())},this.handlePlaidSuccess=t=>{this.publicToken=t,this.isAuthenticating=!1,this.clearError(),this.retryCount=0,this.isSelected||(this.isSelected=!0,f.selectedPaymentMethod={type:V.PLAID}),this.plaidErrorRecovered.emit({code:"plaid-success",message:"Bank account connected successfully",severity:R.INFO}),f.plaidPublicToken=t},this.handlePlaidExit=t=>{this.isAuthenticating=!1,t&&this.handlePlaidError(t)},this.handlePlaidEvent=(t,e)=>{switch(t){case"OPEN":this.isAuthenticating=!0;break;case"CLOSE":this.isAuthenticating=!1;break;case"ERROR":this.handlePlaidError(e)}},this.handlePlaidLoad=()=>{},this.handlePlaidError=t=>{let e=v.PLAID_AUTHENTICATION_FAILED,i=m[e],s=!0,n="Click to try again";if(t.error_code)switch(t.error_code){case"INVALID_CREDENTIALS":e=v.PLAID_INVALID_CREDENTIALS,i=m[e],s=!0;break;case"ITEM_LOGIN_REQUIRED":e=v.PLAID_INVALID_CREDENTIALS,i="Your bank requires re-authentication. Please try again.",s=!0;break;case"ITEM_LOCKED":e=v.PLAID_ACCOUNT_LOCKED,i=m[e],s=!1,n="Contact your bank";break;case"INSTITUTION_NOT_RESPONDING":e=v.PLAID_MAINTENANCE,i=m[e],s=!0;break;case"RATE_LIMIT_EXCEEDED":e=v.PLAID_RATE_LIMITED,i=m[e],s=!0;break;case"INVALID_REQUEST":e=v.PLAID_AUTHENTICATION_FAILED,i="Invalid request. Please try again.",s=!0;break;case"PLAID_ERROR":e=v.PLAID_AUTHENTICATION_FAILED,i=t.error_message||"Bank authentication failed. Please try again.",s=!0;break;default:t.error_message&&(i=t.error_message)}if(t.error_message){const o=t.error_message.toLowerCase();o.includes("not supported")||o.includes("unsupported")?(e=v.PLAID_BANK_NOT_SUPPORTED,i=m[e],s=!1,n="Try a different payment method"):(o.includes("expired")||o.includes("timeout"))&&(e=v.PLAID_TOKEN_EXPIRED,i=m[e],s=!0)}this.handleError({code:e,message:i,severity:y[e],originalError:t,retryable:s,userAction:n}),this.isAuthenticating=!1},this.handleError=t=>{this.error=t,this.plaidError.emit({code:t.code,message:t.message,severity:t.severity,data:{originalError:t.originalError,retryable:t.retryable,userAction:t.userAction,retryCount:this.retryCount}}),console.error("Plaid error:",t),t.retryable&&this.retryCount<this.maxRetries&&this.scheduleRetry()},this.scheduleRetry=()=>{this.isRetrying||(this.isRetrying=!0,this.retryCount++,setTimeout((()=>{this.isRetrying=!1,this.clearError(),this.waitForStoreAndInitialize()}),this.retryDelay*this.retryCount))},this.clearError=()=>{this.error&&(this.error=null,this.retryCount=0)},this.syncWithStore=()=>{var t;const e=(null===(t=f.selectedPaymentMethod)||void 0===t?void 0:t.type)===V.PLAID;this.isSelected!==e&&(this.isSelected=e)}}onSelectionChange(t){var e;t&&(null===(e=f.selectedPaymentMethod)||void 0===e?void 0:e.type)!==V.PLAID&&(f.selectedPaymentMethod={type:V.PLAID}),!t||!this.plaidLink||this.publicToken||this.isAuthenticating||this.error||this.openPlaidLink()}componentDidRender(){this.scriptRef&&(this.scriptRef.onload=()=>{this.waitForStoreAndInitialize()},this.scriptRef.onerror=()=>{this.handleError({code:v.PLAID_SDK_LOAD_FAILED,message:m[v.PLAID_SDK_LOAD_FAILED],severity:y[v.PLAID_SDK_LOAD_FAILED],retryable:!0,userAction:"Refresh the page and try again"})})}componentWillLoad(){var t;this.isSelected=(null===(t=f.selectedPaymentMethod)||void 0===t?void 0:t.type)===V.PLAID}async resolvePaymentMethod(){return this.publicToken?{token:this.publicToken,data:{type:"bank_account",plaid_public_token:this.publicToken}}:{validationError:!0}}async getPaymentToken(){return f.paymentToken}async handleSelectionClick(){if(this.isSelected=!0,f.selectedPaymentMethod={type:V.PLAID},this.error)return this.clearError(),void this.waitForStoreAndInitialize();!this.plaidLink||this.publicToken||this.isAuthenticating||this.openPlaidLink()}async setSelected(t){this.isSelected=t,t&&(f.selectedPaymentMethod={type:V.PLAID})}async isCurrentlySelected(){return this.isSelected}async deselect(){this.isSelected=!1}async reset(){this.publicToken=null,this.clearError(),this.isAuthenticating=!1,this.linkToken=null,this.plaidLink=null,this.retryCount=0,this.isRetrying=!1,this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null),this.abortController&&(this.abortController.abort(),this.abortController=null)}async isReadyForAuthentication(){return!(!this.plaidLink||!this.linkToken||this.isAuthenticating)}async retry(){this.error&&this.error.retryable&&(this.clearError(),this.waitForStoreAndInitialize())}async getErrorInfo(){return this.error}componentDidLoad(){const t=j("selectedPaymentMethod",this.syncWithStore);this.unsubscribeFromStore=t}disconnectedCallback(){this.unsubscribeFromStore&&this.unsubscribeFromStore(),this.timeoutId&&clearTimeout(this.timeoutId),this.abortController&&this.abortController.abort()}render(){if(!0!==f.bankAccountVerification)return this.hasLoggedDisabledWarning||(console.warn("[PlaidPaymentMethod] bank_account_verification is disabled. Component will not render."),this.hasLoggedDisabledWarning=!0),null;const e=t("img",{class:"plaid-logo-img",src:"data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ4IiB2aWV3Qm94PSIwIDAgMjggMjkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgY2xhc3M9ImNzcy0xcmRhajhtIj48ZyBmaWxsPSIjMTExIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0yNS43NjI5IDI2LjI2MjhMMjggMTcuNTMwOUwyNC45NjkxIDE0LjUwMDFMMjcuOTk5OSAxMS40NjkxTDI1Ljc2MjggMi43MzcwNkwxNy4wMzA5IDAuNUwxNC4wMDAxIDMuNTMxTDEwLjk2OSAwLjUwMDE0TDIuMjM3MDYgMi43MzczNEwwIDExLjQ2OTFMMy4wMzEyOCAxNC40OTk5TDAuMDAwMTQgMTcuNTMxTDIuMjM3MiAyNi4yNjI5TDEwLjk2OTEgMjguNUwxNC4wMDAxIDI1LjQ2OUwxNy4wMzEgMjguNDk5OUwyNS43NjI5IDI2LjI2MjhaTTE1LjczMjEgMjMuNzM3MUwxOC42MTg2IDIwLjg1MDVMMjIuMjkxMiAyNC41MjMzTDE3LjY5NTYgMjUuNzAwN0wxNS43MzIxIDIzLjczNzFaTTExLjExMzYgOS44ODE1NEwxNC4wMDAzIDYuOTk1MDJMMTYuODg2OCA5Ljg4MTRMMTQuMDAwMSAxMi43Njc5TDExLjExMzYgOS44ODE1NFpNMTIuMjY4MiAxNC41TDkuMzgxNTQgMTcuMzg2NUw2LjQ5NTAyIDE0LjVMOS4zODE1NCAxMS42MTM1TDEyLjI2ODIgMTQuNVpNMTguNjE4NyAxMS42MTMzTDIxLjUwNTMgMTQuNUwxOC42MTg2IDE3LjM4NjVMMTUuNzMyMSAxNC41TDE4LjYxODcgMTEuNjEzM1pNMTYuODg2NyAxOS4xMTg2TDE0LjAwMDEgMjIuMDA1MUwxMS4xMTM1IDE5LjExODVMMTQuMDAwMSAxNi4yMzE5TDE2Ljg4NjcgMTkuMTE4NlpNMTAuMzA0NCAyNS43MDA3TDUuNzA4NjQgMjQuNTIzM0w5LjM4MTU0IDIwLjg1MDRMMTIuMjY4MiAyMy43MzcxTDEwLjMwNDQgMjUuNzAwN1pNNC43NjMwOCAxNi4yMzE5TDcuNjQ5NiAxOS4xMTg1TDMuOTc2NyAyMi43OTE0TDIuNzk5MyAxOC4xOTU3TDQuNzYzMDggMTYuMjMxOVpNMy45NzY3IDYuMjA4MzZMNy42NDk3NCA5Ljg4MTRMNC43NjMwOCAxMi43NjgxTDIuNzk5MyAxMC44MDQxTDMuOTc2NyA2LjIwODM2Wk0xMi4yNjgzIDUuMjYyOTRMOS4zODE2OCA4LjE0OTZMNS43MDg5MiA0LjQ3NjdMMTAuMzA0NyAzLjI5OTNMMTIuMjY4MyA1LjI2Mjk0Wk0xNy42OTU5IDMuMjk5M0wyMi4yOTE1IDQuNDc2N0wxOC42MTg2IDguMTQ5NDZMMTUuNzMyMSA1LjI2Mjk0TDE3LjY5NTkgMy4yOTkzWk0yMy4yMzcyIDEyLjc2ODFMMjAuMzUwNSA5Ljg4MTRMMjQuMDIzMyA2LjIwODc4TDI1LjIwMDcgMTAuODA0NkwyMy4yMzcyIDEyLjc2ODFaTTI0LjAyMzMgMjIuNzkxNEwyMC4zNTA1IDE5LjExODZMMjMuMjM3MiAxNi4yMzIxTDI1LjIwMDcgMTguMTk1N0wyNC4wMjMzIDIyLjc5MTRaIj48L3BhdGg+PC9nPjwvc3ZnPgo=",alt:"Plaid",title:"Plaid",style:{display:"inline",width:"20px",height:"20px",marginLeft:"5px",marginTop:"-2px"}});return t(M,{class:"payment-method"},t("script",{src:"https://cdn.plaid.com/link/v2/stable/link-initialize.js",async:!0,ref:t=>this.scriptRef=t}),t("div",{title:"Pay with Plaid"},t("div",{onClick:t=>{t.preventDefault(),this.handleSelectionClick()}},"Pay with Bank Account ",e," "),(()=>this.error?t("div",{class:(this.error.severity===R.ERROR?"text-danger":this.error.severity===R.WARNING?"text-warning":"text-info")+" mt-2"},t("small",null,this.error.message),t("br",null),t("small",{class:"text-muted"},this.error.userAction,this.error.retryable&&this.retryCount<this.maxRetries&&t("span",null," • Auto-retry in progress..."))):null)(),(()=>this.error?null:this.isAuthenticating?t("div",{class:"text-info mt-2"},t("small",null,"Connecting to your bank...")):this.publicToken?t("div",{class:"text-success mt-2"},t("small",null,"✓ Bank account connected successfully")):!this.isSelected||this.publicToken||this.error||this.isAuthenticating?null:t("div",{class:"text-muted mt-2"},t("small",null,"Click to connect your bank account")))()))}static get watchers(){return{isSelected:["onSelectionChange"]}}},at=class{constructor(t){e(this,t),this.onPaymentMethodOptionClick=t=>e=>{e.preventDefault(),f.selectedPaymentMethod={id:t.id,type:t.type},f.paymentToken=t.id},this.isAllowedPaymentMethod=t=>!(t===V.SAVED_CARD&&f.disableCreditCard||t===V.SAVED_BANK_ACCOUNT&&f.disableBankAccount)}componentWillLoad(){f.paymentMethods.length||console.warn("No saved payment methods available."),f.disablePaymentMethodGroup&&console.warn("Payment method group is disabled.")}render(){return f.disablePaymentMethodGroup?null:t(M,null,t("div",{class:"saved-payment-methods"},f.paymentMethods.length?f.paymentMethods.filter((t=>this.isAllowedPaymentMethod(t.type))).map((e=>t("div",{class:"radio-list-item p-3",part:A,onClick:this.onPaymentMethodOptionClick(e)},t("form-control-radio",{name:"paymentMethodType",value:null==e?void 0:e.id,checked:f.paymentToken===(null==e?void 0:e.id),label:`${Z[null==e?void 0:e.brand]||""} *${null==e?void 0:e.acct_last_four}`})))):null))}},rt=t("img",{class:"sezzle-smart-button-logo-img",src:"https://media.sezzle.com/branding/2.0/Sezzle_Logo_FullColor.svg",alt:"Sezzle",style:{display:"inline",width:"80px",marginLeft:"5px",marginTop:"-5px"}}),lt=class{constructor(t){e(this,t),this.paymentMethodOptionSelected=i(this,"paymentMethodOptionSelected",7),this.paymentMethodOptionId=V.SEZZLE,this.initializeSezzleCheckout=()=>{let t;this.sezzlePromise=new Promise((e=>{t=e}));const e=Number(f.paymentAmount),i=new(0,window.Checkout)({mode:"popup",publicKey:f.bnplProviderClientId,apiMode:f.bnplProviderMode,apiVersion:f.bnplProviderApiVersion});i.sezzleButtonElement=this.sezzleButtonRef,i.init({onClick:function(t){t.preventDefault(),i.startCheckout({checkout_url:f.bnplProviderCheckoutUrl})},onComplete:e=>t({bnpl:e.data}),onCancel:e=>t({bnpl:e.data}),onFailure:e=>t({bnpl:e.data})}),this.sezzleCheckout=i,this.installmentPlan=this.sezzleCheckout.getInstallmentPlan(e)}}componentDidRender(){this.scriptRef&&(this.scriptRef.onload=()=>{this.sezzleButtonRef=document.createElement("button"),this.initializeSezzleCheckout()})}async resolvePaymentMethod(t){return t.isValid?(this.sezzleButtonRef.click(),this.sezzlePromise):{validationError:!0}}async handleSelectionClick(){f.selectedPaymentMethod={type:V.SEZZLE},this.paymentMethodOptionSelected.emit(this.paymentMethodOptionId)}render(){var e,i;return f.bnplEnabled?t(M,{class:"payment-method"},t("script",{src:"https://checkout-sdk.sezzle.com/checkout.min.js",async:!0,ref:t=>this.scriptRef=t}),t("div",null,t("div",null,"Buy now, pay later with ",rt),this.installmentPlan&&t("small",null,t("span",null,null===(e=this.installmentPlan)||void 0===e?void 0:e.installments.length)," ",t("span",null,this.installmentPlan.schedule," payments of")," ",t("span",{class:"fw-bold"},N(null===(i=this.installmentPlan)||void 0===i?void 0:i.installments[0].amountInCents))))):(console.warn("justifi-sezzle-payment-method: BNPL is not enabled for this account."),null)}};export{$ as justifi_apple_pay,K as justifi_checkout_summary,it as justifi_google_pay,st as justifi_header,nt as justifi_modular_checkout,ot as justifi_plaid_payment_method,at as justifi_saved_payment_methods,lt as justifi_sezzle_payment_method}
@@ -0,0 +1 @@
1
+ import{h as e,r as t,c as a}from"./p-CV0Pyo1O.js";import{j as s,e as i,d}from"./p-MeSAYDNh.js";import{a as c,b as o,D as r,c as l,C as h,E as f}from"./p-COZ-9O53.js";import{B as b}from"./p-o83Uy7sW.js";import{S as n}from"./p-BqNNwq6C.js";import"./p-CZfYo5-1.js";import{M as p}from"./p-BXT1uJVr.js";import{S as u}from"./p-C0tps2ph.js";import{a as y,B as v}from"./p-BPpqjhPu.js";import"./p-HXpYMWUU.js";import"./p-D3V9AE6o.js";const m=()=>e("div",{class:"row gap-3"},e("div",{class:"col-12"},e(u,{width:"35%",height:"30px"})),e("div",{class:"col-12"},e(u,{width:"70%"})),e("div",{class:"col-12"},e(u,{width:"40%"})),e("div",{class:"col-12"},e(u,{width:"40%"})),e("div",{class:"col-12"},e(u,{width:"100%"})),e("div",{class:"col-12"},e(u,{width:"80%"}))),k=class{constructor(e){t(this,e),this.errorEvent=a(this,"error-event",7),this.recordClickEvent=a(this,"record-click-event",7),this.enableRecordClick=!1,this.loading=!0,this.errorMessage=null,this.downloadCSV=()=>{this.getPayoutCSV({payoutId:this.payout.id,onError:({error:e,code:t,severity:a})=>{this.errorMessage=e,this.errorEvent.emit({message:e,errorCode:t,severity:a})}})},this.handleRecordClick=e=>{this.recordClickEvent.emit({id:e,type:"account"})}}componentWillLoad(){this.getPayout&&this.fetchData()}getPayoutWatcher(){this.fetchData()}fetchData(){this.loading=!0,this.getPayout({onSuccess:e=>{this.errorMessage=null,this.payout=e,this.loading=!1},onError:({error:e,code:t,severity:a})=>{this.errorMessage=e,this.errorEvent.emit({message:e,errorCode:t,severity:a}),this.loading=!1}})}formatMethod(e){return"ach"===e?"ACH":s(e)}render(){var t;return e(n,{key:"d335394cbcbf7159e13b44c488719de949b166dc"},this.loading&&e(m,{key:"7c72354aad37f4cce64d036ce05a0957803ea6b5"}),!this.loading&&this.errorMessage&&f(this.errorMessage),!this.loading&&this.payout&&e("justifi-details",{key:"8ba9a6f04d4a91b9e99d226f8c81f64773433f01",errorMessage:this.errorMessage},e(c,{key:"e96e1c53a9efc0907895388b1bcae92e04aacd49",slot:"head-info",badge:e("div",{class:"d-flex gap-1"},p(null===(t=this.payout)||void 0===t?void 0:t.status),e(y,"expedited"===this.payout.settlement_priority?{variant:v.WARNING,title:"Expedited",text:"Expedited"}:{variant:v.SECONDARY,title:"Standard",text:"Standard"})),title:this.payout.formattedPaymentAmount(this.payout.amount)},e(o,{key:"1bb438ad0a8b0ff564752e0661a1b49d8ac77ca8",classes:"border-1 border-end",title:"Updated At",value:`${i(this.payout.updated_at)} ${d(this.payout.updated_at)}`}),e(o,{key:"d00a9debc99172b289e7152ae06b3827c2b36855",classes:"border-1 border-end",title:"Created At",value:`${i(this.payout.created_at)} ${d(this.payout.created_at)}`}),e(o,{key:"78417a3170bc3115188be6268fa5a3126b751e7f",title:"ID",value:this.payout.id}),e("div",{key:"e38d3da9d335078c95e8c58a4125478f4ba2fb6e",class:"m-4"},e(b,{key:"5c229f88885389be98cade9abdd8a0c60d78f94a",variant:"outline-secondary",class:"btn btn-outline-secondary d-flex align-items-center",onClick:this.downloadCSV},"Export CSV"))),e("div",{key:"9b195abd5d28bff4196d80c543eee9c9304e96b6",slot:"detail-sections"},e(r,{key:"c64ad00954c81a00de12b9c6da9737b1692e3d2c",sectionTitle:"Details"}),e("div",{key:"6caa6a55a2ce061959df55eb8a2c1fe379028289",class:"d-flex flex-column gap-2 w-100"},e(l,{key:"ba4d06bb2b68aa22d683511602f6d12d5dd4d507",title:"Date paid",value:i(this.payout.deposits_at)}),e(l,{key:"f7ee0717c7395c5effa81464b1becf616c61a02b",title:"Statement Description",value:this.payout.description}),e(l,{key:"1c142e531e9cf8e16f4dc67114060d2f2cce0b0c",title:"Payout Method",value:this.formatMethod(this.payout.delivery_method)}),e(l,{key:"f0d78701957991cb2efefc24b3a162b736be490d",title:"Amount",value:this.payout.formattedPaymentAmount(this.payout.amount)}),e(l,{key:"a75896cf9a33c9bbf8f13c1774a6db829d0f5f7f",title:"Fee",value:this.payout.formattedPaymentAmount(this.payout.fees_total)})),e(r,{key:"22cd3beaaa38900b86ac810dd08c1a61f8593f75",sectionTitle:"Account"}),e("div",{key:"f6980d28e7c9ef4339b86baaa9849658e39ed286",class:"d-flex flex-column gap-2 w-100"},e(l,{key:"ae7bc36f7839496d26a44e1a78a9ce3df7fc4f19",title:"ID",value:this.payout.account_id,onClick:this.enableRecordClick?()=>this.handleRecordClick(this.payout.account_id):void 0}),e(l,{key:"ebed350562e7a6dc16f8d883645854c27f734c6b",title:"Account Type",value:this.payout.bank_account.account_type}),e(l,{key:"51d885752922ca9fdc76905f1ea58ecfc245f036",title:"Institution",value:this.payout.bank_account.account_type}),e(l,{key:"26da2532c8b1b5e8e2495d9522c2da937b917baa",title:"Routing Number",value:this.payout.bank_account.routing_number}),e(l,{key:"d485027365ddc9f28833b659f583c9a66c2b532a",title:"Account Number",value:`**** ${this.payout.bank_account.account_number_last4}`})),this.payout.metadata&&[e(r,{key:"e34be3a7a4f2e43d677747429cbbe746424db7ae",sectionTitle:"Metadata"}),e("div",{key:"b1c6324d0eefcde79e2281a311ae58df5391636f",class:"d-table gap-2 w-100"},e(h,{key:"539d31351ea9dd4af7ac973ca79fa572f4194613",metadata:this.payout.metadata}))])))}static get watchers(){return{getPayout:["getPayoutWatcher"]}}};export{k as payout_details_core}
@@ -1 +1 @@
1
- import{r as e,h as n,H as t,c as i,g as o}from"./p-CV0Pyo1O.js";import{c as r}from"./p-D8GTwl9v.js";import{az as s,X as a,Z as c,_ as d,$ as u}from"./p-c8J1gsDg.js";import{g as f}from"./p-BFTU3MAI.js";import{F as l}from"./p-BBNT9yj5.js";import{p as h}from"./p-Cc6518FT.js";const m=r({focused:{boxShadow:"",border:""},focusedAndInvalid:{boxShadow:"",border:""},fontStyles:{fontFamily:"",fontSize:"",fontWeight:"",lineHeight:"",margin:"",padding:""}}),{state:w,set:g}=m,b=class{constructor(n){e(this,n),this.isFocused=!1,this.errorText=""}focusWithoutPageScroll(e){if(e)try{e.focus({preventScroll:!0})}catch(n){const{scrollX:t,scrollY:i}=window;e.focus(),window.scrollTo(t,i)}}async componentDidLoad(){const e=await this.getBaseFontStyles();g("fontStyles",e);const n=await this.getFocusedStyles();g("focused",n);const t=await this.getFocusedAndInvalidStyles();g("focusedAndInvalid",t)}async getBaseFontStyles(){return new Promise((e=>{setTimeout((()=>{const n=getComputedStyle(this.hiddenInput);e({fontFamily:n.fontFamily,fontSize:n.fontSize,fontWeight:n.fontWeight,lineHeight:n.lineHeight,margin:n.margin,padding:n.padding,color:n.color})}),500)}))}async getFocusedStyles(){return new Promise((e=>{this.focusWithoutPageScroll(this.hiddenInput),setTimeout((()=>{this.hiddenInput.blur();let n=getComputedStyle(this.hiddenInput);e({boxShadow:n.boxShadow,border:n.border})}),500)}))}async getFocusedAndInvalidStyles(){return new Promise((e=>{this.focusWithoutPageScroll(this.hiddenInput),this.errorText="Error",setTimeout((()=>{const n=getComputedStyle(this.hiddenInput),t={boxShadow:n.boxShadow,border:n.border};this.hiddenInput.blur(),e(t)}),500)}))}get part(){return this.isFocused&&this.errorText?s:this.errorText?a:this.isFocused?c:d}render(){return n(t,{key:"05cefc92dac95360d470070c64fbc0318c666214"},n("input",{key:"02c9a6001a394b96cbc09b6d906287b81c20e98f",ref:e=>this.hiddenInput=e,type:"text",class:this.errorText?"form-control is-invalid":"form-control",onFocus:()=>this.isFocused=!0,onBlur:()=>this.isFocused=!1,part:this.part,tabindex:"-1",style:{height:"0",opacity:"0",pointerEvents:"none",animation:"none"}}))}};var p,y,v={exports:{}},k=f((p||(p=1,y=v,console.info("\nIFRAME-RESIZER\n\nIframe-Resizer 5 is now available via the following two packages:\n\n * @iframe-resizer/parent\n * @iframe-resizer/child\n\nAdditionally their are also new versions of iframe-resizer for React, Vue, and jQuery.\n\nVersion 5 of iframe-resizer has been extensively rewritten to use modern browser APIs, which has enabled significantly better performance and greater accuracy in the detection of content resizing events.\n\nPlease see https://iframe-resizer.com/upgrade for more details.\n"),function(e){if("undefined"!=typeof window){var n,t,i=0,o=!1,r=!1,s="[iFrameSizer]",a=null,c=window.requestAnimationFrame,d=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),u={},f=null,l=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,license:"1jqr0si6pnt",log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,mouseEvents:!0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){k("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}}),h={};window.jQuery!==e&&((t=window.jQuery).fn?t.fn.iFrameResize||(t.fn.iFrameResize=function(e){return this.filter("iframe").each((function(n,t){W(t,e)})).end()}):v("","Unable to bind to jQuery, it is not fully loaded.")),y.exports=L(),window.iFrameResize=window.iFrameResize||L()}function m(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function w(e,n,t){e.addEventListener(n,t,!1)}function g(e,n,t){e.removeEventListener(n,t,!1)}function b(e){return u[e]?u[e].log:o}function p(e,n){x("log",e,n,b(e))}function v(e,n){x("info",e,n,b(e))}function k(e,n){x("warn",e,n,!0)}function x(e,n,t,i){!0===i&&"object"==typeof window.console&&console[e](function(e){return s+"["+function(e){var n="Host page: "+e;return window.top!==window.self&&(n=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+e:"Nested host page: "+e),n}(e)+"]"}(n),t)}function z(e){function n(){t("Height"),t("Width"),C((function(){R(A),T(P),l("onResized",A)}),A,"init")}function t(e){var n=Number(u[P]["max"+e]),t=Number(u[P]["min"+e]),i=e.toLowerCase(),o=Number(A[i]);p(P,"Checking "+i+" is in range "+t+"-"+n),o<t&&(o=t,p(P,"Set "+i+" to min value")),o>n&&(o=n,p(P,"Set "+i+" to max value")),A[i]=""+o}function i(e){return W.slice(W.indexOf(":")+7+e)}function o(e,n){var t,i;t=function(){var t,i;N("Send Page Info","pageInfo:"+(t=document.body.getBoundingClientRect(),i=A.iframe.getBoundingClientRect(),JSON.stringify({iframeHeight:i.height,iframeWidth:i.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(i.top-t.top,10),offsetLeft:parseInt(i.left-t.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})),e,n)},h[i=n]||(h[i]=setTimeout((function(){h[i]=null,t()}),32))}function r(e){var n=e.getBoundingClientRect();return M(P),{x:Math.floor(Number(n.left)+Number(a.x)),y:Math.floor(Number(n.top)+Number(a.y))}}function c(e){var n=e?r(A.iframe):{x:0,y:0},t={x:Number(A.width)+n.x,y:Number(A.height)+n.y};p(P,"Reposition requested from iFrame (offset x:"+n.x+" y:"+n.y+")"),window.top===window.self?(a=t,d(),p(P,"--")):window.parentIFrame?window.parentIFrame["scrollTo"+(e?"Offset":"")](t.x,t.y):k(P,"Unable to scroll to requested position, window.parentIFrame not found")}function d(){!1===l("onScroll",a)?j():T(P)}function f(e){var n={};if(0===Number(A.width)&&0===Number(A.height)){var t=i(9).split(":");n={x:t[1],y:t[0]}}else n={x:A.width,y:A.height};l(e,{iframe:A.iframe,screenX:Number(n.x),screenY:Number(n.y),type:A.type})}function l(e,n){return F(P,e,n)}var m,b,y,x,z,I,W=e.data,A={},P=null;"[iFrameResizerChild]Ready"===W?function(){for(var e in u)N("iFrame requested init",E(e),u[e].iframe,e)}():s===(""+W).slice(0,13)&&W.slice(13).split(":")[0]in u?(x=(y=W.slice(13).split(":"))[1]?parseInt(y[1],10):0,z=u[y[0]]&&u[y[0]].iframe,I=getComputedStyle(z),A={iframe:z,id:y[0],height:x+function(e){return"border-box"!==e.boxSizing?0:(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}(I)+function(e){return"border-box"!==e.boxSizing?0:(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}(I),width:y[2],type:y[3]},u[P=A.id]&&(u[P].loaded=!0),(b=A.type in{true:1,false:1,undefined:1})&&p(P,"Ignoring init message from meta parent page"),!b&&function(e){var n=!0;return u[e]||(n=!1,k(A.type+" No settings for "+e+". Message was: "+W)),n}(P)&&(p(P,"Received: "+W),m=!0,null===A.iframe&&(k(P,"IFrame ("+A.id+") not found"),m=!1),m&&function(){var n,t=e.origin,i=u[P]&&u[P].checkOrigin;if(i&&""+t!="null"&&!(i.constructor===Array?function(){var e=0,n=!1;for(p(P,"Checking connection is from allowed list of origins: "+i);e<i.length;e++)if(i[e]===t){n=!0;break}return n}():(p(P,"Checking connection is from: "+(n=u[P]&&u[P].remoteHost)),t===n)))throw new Error("Unexpected message received from: "+t+" for "+A.iframe.id+". Message was: "+e.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}()&&function(){switch(u[P]&&u[P].firstRun&&u[P]&&(u[P].firstRun=!1),A.type){case"close":S(A.iframe);break;case"message":m=i(6),p(P,"onMessage passed: {iframe: "+A.iframe.id+", message: "+m+"}"),l("onMessage",{iframe:A.iframe,message:JSON.parse(m)}),p(P,"--");break;case"mouseenter":f("onMouseEnter");break;case"mouseleave":f("onMouseLeave");break;case"autoResize":u[P].autoResize=JSON.parse(i(9));break;case"scrollTo":c(!1);break;case"scrollToOffset":c(!0);break;case"pageInfo":o(u[P]&&u[P].iframe,P),function(){function e(e,i){function r(){u[t]?o(u[t].iframe,t):n()}["scroll","resize"].forEach((function(n){p(t,e+n+" listener for sendPageInfo"),i(window,n,r)}))}function n(){e("Remove ",g)}var t=P;e("Add ",w),u[t]&&(u[t].stopPageInfo=n)}();break;case"pageInfoStop":u[P]&&u[P].stopPageInfo&&(u[P].stopPageInfo(),delete u[P].stopPageInfo);break;case"inPageLink":t=i(9).split("#")[1]||"",s=decodeURIComponent(t),(h=document.getElementById(s)||document.getElementsByName(s)[0])?(e=r(h),p(P,"Moving to in page link (#"+t+") at x: "+e.x+" y: "+e.y),a={x:e.x,y:e.y},d(),p(P,"--")):window.top===window.self?p(P,"In page link #"+t+" not found"):window.parentIFrame?window.parentIFrame.moveToAnchor(t):p(P,"In page link #"+t+" not found and window.parentIFrame not found");break;case"reset":O(A);break;case"init":n(),l("onInit",A.iframe);break;default:0===Number(A.width)&&0===Number(A.height)?k("Unsupported message received ("+A.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):n()}var e,t,s,h,m}())):v(P,"Ignored: "+W)}function F(e,n,t){var i=null,o=null;if(u[e]){if("function"!=typeof(i=u[e][n]))throw new TypeError(n+" on iFrame["+e+"] is not a function");o=i(t)}return o}function I(e){delete u[e.id]}function S(e){var t=e.id;if(!1!==F(t,"onClose",t)){p(t,"Removing iFrame: "+t);try{e.parentNode&&e.parentNode.removeChild(e)}catch(e){k(e)}F(t,"onClosed",t),p(t,"--"),I(e),n&&(n.disconnect(),n=null)}else p(t,"Close iframe cancelled by onClose event")}function M(n){null===a&&p(n,"Get page position: "+(a={x:window.pageXOffset===e?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===e?document.documentElement.scrollTop:window.pageYOffset}).x+","+a.y)}function T(e){null!==a&&(window.scrollTo(a.x,a.y),p(e,"Set page position: "+a.x+","+a.y),j())}function j(){a=null}function O(e){p(e.id,"Size reset requested by "+("init"===e.type?"host page":"iFrame")),M(e.id),C((function(){R(e),N("reset","reset",e.iframe,e.id)}),e,"reset")}function R(e){function n(n){r||"0"!==e[n]||(r=!0,p(i,"Hidden iFrame detected, creating visibility listener"),function(){function e(){Object.keys(u).forEach((function(e){!function(e){function n(n){return"0px"===(u[e]&&u[e].iframe.style[n])}u[e]&&null!==u[e].iframe.offsetParent&&(n("height")||n("width"))&&N("Visibility change","resize",u[e].iframe,e)}(e)}))}function n(n){p("window","Mutation observed: "+n[0].target+" "+n[0].type),A(e,16)}var t,i=m();i&&(t=document.querySelector("body"),new i(n).observe(t,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}))}())}function t(t){!function(n){e.id?(e.iframe.style[n]=e[n]+"px",p(e.id,"IFrame ("+i+") "+n+" set to "+e[n]+"px")):p("undefined","messageData id not set")}(t),n(t)}var i=e.iframe.id;u[i]&&(u[i].sizeHeight&&t("height"),u[i].sizeWidth&&t("width"))}function C(e,n,t){t!==n.type&&c&&!window.jasmine?(p(n.id,"Requesting animation frame"),c(e)):e()}function N(e,n,t,i,o){var r,a=!1;u[i=i||t.id]&&(t&&"contentWindow"in t&&null!==t.contentWindow?(p(i,"["+e+"] Sending msg to iframe["+i+"] ("+n+") targetOrigin: "+(r=u[i]&&u[i].targetOrigin)),t.contentWindow.postMessage(s+n,r)):k(i,"["+e+"] IFrame("+i+") not found"),o&&u[i]&&u[i].warningTimeout&&(u[i].msgTimeout=setTimeout((function(){!u[i]||u[i].loaded||a||(a=!0,k(i,"IFrame has not responded within "+u[i].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))}),u[i].warningTimeout)))}function E(e){return e+":"+u[e].bodyMarginV1+":"+u[e].sizeWidth+":"+u[e].log+":"+u[e].interval+":"+u[e].enablePublicMethods+":"+u[e].autoResize+":"+u[e].bodyMargin+":"+u[e].heightCalculationMethod+":"+u[e].bodyBackground+":"+u[e].bodyPadding+":"+u[e].tolerance+":"+u[e].inPageLinks+":"+u[e].resizeFrom+":"+u[e].widthCalculationMethod+":"+u[e].mouseEvents}function W(t,r){function s(e){var n=e.split("Callback");if(2===n.length){var t="on"+n[0].charAt(0).toUpperCase()+n[0].slice(1);this[t]=this[e],delete this[e],k(f,"Deprecated: '"+e+"' has been renamed '"+t+"'. The old method will be removed in the next major version.")}}var a,c,f=function(e){if("string"!=typeof e)throw new TypeError("Invaild id for iFrame. Expected String");var n;return""===e&&(t.id=(n=r&&r.id||l.id+i++,null!==document.getElementById(n)&&(n+=i++),e=n),o=(r||{}).log,p(e,"Added missing iframe ID: "+e+" ("+t.src+")")),e}(t.id);f in u&&"iFrameResizer"in t?k(f,"Ignored iFrame, already setup."):(function(e){var n;e=e||{},u[f]=Object.create(null),u[f].iframe=t,u[f].firstRun=!0,u[f].remoteHost=t.src&&t.src.split("/").slice(0,3).join("/"),function(e){if("object"!=typeof e)throw new TypeError("Options is not an object")}(e),Object.keys(e).forEach(s,e),function(e){for(var n in l)Object.prototype.hasOwnProperty.call(l,n)&&(u[f][n]=Object.prototype.hasOwnProperty.call(e,n)?e[n]:l[n])}(e),u[f]&&(u[f].targetOrigin=!0===u[f].checkOrigin?""===(n=u[f].remoteHost)||null!==n.match(/^(about:blank|javascript:|file:\/\/)/)?"*":n:"*")}(r),function(){switch(p(f,"IFrame scrolling "+(u[f]&&u[f].scrolling?"enabled":"disabled")+" for "+f),t.style.overflow=!1===(u[f]&&u[f].scrolling)?"hidden":"auto",u[f]&&u[f].scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=u[f]?u[f].scrolling:"no"}}(),function(){function e(e){var n=u[f][e];1/0!==n&&0!==n&&(t.style[e]="number"==typeof n?n+"px":n,p(f,"Set "+e+" = "+t.style[e]))}function n(e){if(u[f]["min"+e]>u[f]["max"+e])throw new Error("Value for min"+e+" can not be greater than max"+e)}n("Height"),n("Width"),e("maxHeight"),e("minHeight"),e("maxWidth"),e("minWidth")}(),"number"!=typeof(u[f]&&u[f].bodyMargin)&&"0"!==(u[f]&&u[f].bodyMargin)||(u[f].bodyMarginV1=u[f].bodyMargin,u[f].bodyMargin=u[f].bodyMargin+"px"),a=E(f),(c=m())&&(n=function(e){if(!t.parentNode)return null;var n=new e((function(e){e.forEach((function(e){Array.prototype.slice.call(e.removedNodes).forEach((function(e){e===t&&S(t)}))}))}));return n.observe(t.parentNode,{childList:!0}),n}(c)),w(t,"load",(function(){N("iFrame.onload",a,t,e,!0),(!u[f]||!u[f].firstRun)&&u[f]&&u[f].heightCalculationMethod in d&&O({iframe:t,height:0,width:0,type:"init"})})),N("init",a,t,e,!0),u[f]&&(u[f].iframe.iFrameResizer={close:S.bind(null,u[f].iframe),removeListeners:I.bind(null,u[f].iframe),resize:N.bind(null,"Window resize","resize",u[f].iframe),moveToAnchor:function(e){N("Move to anchor","moveToAnchor:"+e,u[f].iframe,f)},sendMessage:function(e){N("Send Message","message:"+(e=JSON.stringify(e)),u[f].iframe,f)}}))}function A(e,n){null===f&&(f=setTimeout((function(){f=null,e()}),n))}function P(){"hidden"!==document.visibilityState&&(p("document","Trigger event: Visibility change"),A((function(){H("Tab Visible","resize")}),16))}function H(e,n){Object.keys(u).forEach((function(t){(function(e){return u[e]&&"parent"===u[e].resizeFrom&&u[e].autoResize&&!u[e].firstRun})(t)&&N(e,n,u[t].iframe,t)}))}function L(){function n(e,n){n&&(function(){if(!n.tagName)throw new TypeError("Object is not a valid DOM element");if("IFRAME"!==n.tagName.toUpperCase())throw new TypeError("Expected <IFRAME> tag, found <"+n.tagName+">")}(),W(n,e),t.push(n))}var t;return function(){var e,n=["moz","webkit","o","ms"];for(e=0;e<n.length&&!c;e+=1)c=window[n[e]+"RequestAnimationFrame"];c?c=c.bind(window):p("setup","RequestAnimationFrame not supported")}(),w(window,"message",z),w(window,"resize",(function(){p("window","Trigger event: resize"),A((function(){H("Window resize","resize")}),16)})),w(document,"visibilitychange",P),w(document,"-webkit-visibilitychange",P),function(i,o){switch(t=[],function(e){e&&e.enablePublicMethods&&k("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}(i),typeof o){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(o||"iframe"),n.bind(e,i));break;case"object":n(i,o);break;default:throw new TypeError("Unexpected data type ("+typeof o+")")}return t}}}()),v.exports));class x{constructor(e,n){this.iframe=e,this.iframeOrigin=n}postMessage(e,n){const t=Object.assign({eventType:e},n);this.iframe.contentWindow.postMessage(t,this.iframeOrigin)}addMessageListener(e){window.addEventListener("message",e)}removeMessageListener(e){window.removeEventListener("message",e)}postMessageWithResponseListener(e,n){return new Promise((t=>{const i=n=>{n.data.eventType===e&&(window.removeEventListener("message",i),t(n.data.data))};window.addEventListener("message",i),this.postMessage(e,n)}))}}const z=class{constructor(n){e(this,n),this.iframeLoaded=i(this,"iframeLoaded",7),this.isFocused=!1,this.isValid=!0,this.dispatchMessageEvent=e=>{const{eventType:n,data:t}=e.data;(null==t?void 0:t.id)===this.inputId&&("focused"===n&&(this.isFocused=!0),"blurred"===n&&(this.isFocused=!1))}}disconnectedCallback(){this.frameService.removeMessageListener(this.dispatchMessageEvent)}async validate(){const e=await this.frameService.postMessageWithResponseListener("validate");return this.isValid=e.isValid,this.errorText=e.error.message,e}async tokenize(e,n,t){return this.frameService.postMessageWithResponseListener("tokenize",{clientId:e,paymentMethodMetadata:n,account:t,componentVersion:h.version})}initializeFrameCommunicationService(){var e;this.frameService=new x(this.iframeElement,this.iframeOrigin),null===(e=this.frameService)||void 0===e||e.addMessageListener(this.dispatchMessageEvent)}get part(){return this.isFocused&&!this.isValid?s:this.isValid?this.isFocused?c:d:a}get style(){return this.isFocused?this.isValid?w.focused:w.focusedAndInvalid:null}get urlParams(){const e=Object.fromEntries(Object.entries(w.fontStyles).map((([e,n])=>[e,btoa(String(n))])));return new URLSearchParams(e).toString()}render(){return n(t,{key:"ebf24e9c73ea9a7f352dfc7368678117144745c3",class:"form-group d-flex flex-column"},n("div",{key:"e88393af9005c217ad3cc2504e8285629339402c",style:{visibility:this.iframeLoaded?"visible":"hidden",height:this.iframeLoaded?"auto":"0"}},n("label",{key:"47591ac9c82096e9bde5b5706b08c9dc8461788b",class:"form-label",htmlFor:"",part:u},this.label||""),n("div",{key:"b39265660ede091bd365d983a702202469adab97",class:"p-0 d-flex form-control "+(this.isValid?"":"is-invalid"),part:this.part,style:Object.assign(Object.assign({},this.style),{overflow:"hidden"})},n("iframe",{key:"12354fce7a91119a17d577df02c2f627ebc10b98",id:this.inputId,name:this.inputId,src:`${this.iframeOrigin}?${this.urlParams}`,ref:e=>{this.iframeElement=e,this.initializeFrameCommunicationService()},width:"100%",onLoad:()=>{k({log:!1,onResized:()=>{this.iframeLoaded.emit()}},this.iframeElement)}})),n(l,{key:"604488d6da7e2ff87e24e3eed0a77b3a6231106e",errorText:this.errorText,name:this.inputId})))}get el(){return o(this)}};export{b as hidden_input,z as iframe_input}
1
+ import{r as e,h as n,H as t,c as i,g as o}from"./p-CV0Pyo1O.js";import{c as r}from"./p-D8GTwl9v.js";import{a7 as s,v as a,x as c,y as d,z as u}from"./p-D3V9AE6o.js";import{g as f}from"./p-BFTU3MAI.js";import{F as l}from"./p-BU9iZ8OM.js";import{p as h}from"./p-qNXIkzDE.js";const m=r({focused:{boxShadow:"",border:""},focusedAndInvalid:{boxShadow:"",border:""},fontStyles:{fontFamily:"",fontSize:"",fontWeight:"",lineHeight:"",margin:"",padding:""}}),{state:w,set:g}=m,b=class{constructor(n){e(this,n),this.isFocused=!1,this.errorText=""}focusWithoutPageScroll(e){if(e)try{e.focus({preventScroll:!0})}catch(n){const{scrollX:t,scrollY:i}=window;e.focus(),window.scrollTo(t,i)}}async componentDidLoad(){const e=await this.getBaseFontStyles();g("fontStyles",e);const n=await this.getFocusedStyles();g("focused",n);const t=await this.getFocusedAndInvalidStyles();g("focusedAndInvalid",t)}async getBaseFontStyles(){return new Promise((e=>{setTimeout((()=>{const n=getComputedStyle(this.hiddenInput);e({fontFamily:n.fontFamily,fontSize:n.fontSize,fontWeight:n.fontWeight,lineHeight:n.lineHeight,margin:n.margin,padding:n.padding,color:n.color})}),500)}))}async getFocusedStyles(){return new Promise((e=>{this.focusWithoutPageScroll(this.hiddenInput),setTimeout((()=>{this.hiddenInput.blur();let n=getComputedStyle(this.hiddenInput);e({boxShadow:n.boxShadow,border:n.border})}),500)}))}async getFocusedAndInvalidStyles(){return new Promise((e=>{this.focusWithoutPageScroll(this.hiddenInput),this.errorText="Error",setTimeout((()=>{const n=getComputedStyle(this.hiddenInput),t={boxShadow:n.boxShadow,border:n.border};this.hiddenInput.blur(),e(t)}),500)}))}get part(){return this.isFocused&&this.errorText?s:this.errorText?a:this.isFocused?c:d}render(){return n(t,{key:"5697b5e318914b8866bc6ad2fb2009e5f8c8d80f"},n("input",{key:"3370d11bc6e5a49f28dd2e95bf1d92ee7a0dd892",ref:e=>this.hiddenInput=e,type:"text",class:this.errorText?"form-control is-invalid":"form-control",onFocus:()=>this.isFocused=!0,onBlur:()=>this.isFocused=!1,part:this.part,tabindex:"-1",style:{height:"0",opacity:"0",pointerEvents:"none",animation:"none"}}))}};var p,y,v={exports:{}},k=f((p||(p=1,y=v,console.info("\nIFRAME-RESIZER\n\nIframe-Resizer 5 is now available via the following two packages:\n\n * @iframe-resizer/parent\n * @iframe-resizer/child\n\nAdditionally their are also new versions of iframe-resizer for React, Vue, and jQuery.\n\nVersion 5 of iframe-resizer has been extensively rewritten to use modern browser APIs, which has enabled significantly better performance and greater accuracy in the detection of content resizing events.\n\nPlease see https://iframe-resizer.com/upgrade for more details.\n"),function(e){if("undefined"!=typeof window){var n,t,i=0,o=!1,r=!1,s="[iFrameSizer]",a=null,c=window.requestAnimationFrame,d=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),u={},f=null,l=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,license:"1jqr0si6pnt",log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,mouseEvents:!0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){k("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}}),h={};window.jQuery!==e&&((t=window.jQuery).fn?t.fn.iFrameResize||(t.fn.iFrameResize=function(e){return this.filter("iframe").each((function(n,t){A(t,e)})).end()}):v("","Unable to bind to jQuery, it is not fully loaded.")),y.exports=L(),window.iFrameResize=window.iFrameResize||L()}function m(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function w(e,n,t){e.addEventListener(n,t,!1)}function g(e,n,t){e.removeEventListener(n,t,!1)}function b(e){return u[e]?u[e].log:o}function p(e,n){x("log",e,n,b(e))}function v(e,n){x("info",e,n,b(e))}function k(e,n){x("warn",e,n,!0)}function x(e,n,t,i){!0===i&&"object"==typeof window.console&&console[e](function(e){return s+"["+function(e){var n="Host page: "+e;return window.top!==window.self&&(n=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+e:"Nested host page: "+e),n}(e)+"]"}(n),t)}function z(e){function n(){t("Height"),t("Width"),E((function(){R(W),T(P),l("onResized",W)}),W,"init")}function t(e){var n=Number(u[P]["max"+e]),t=Number(u[P]["min"+e]),i=e.toLowerCase(),o=Number(W[i]);p(P,"Checking "+i+" is in range "+t+"-"+n),o<t&&(o=t,p(P,"Set "+i+" to min value")),o>n&&(o=n,p(P,"Set "+i+" to max value")),W[i]=""+o}function i(e){return A.slice(A.indexOf(":")+7+e)}function o(e,n){var t,i;t=function(){var t,i;C("Send Page Info","pageInfo:"+(t=document.body.getBoundingClientRect(),i=W.iframe.getBoundingClientRect(),JSON.stringify({iframeHeight:i.height,iframeWidth:i.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(i.top-t.top,10),offsetLeft:parseInt(i.left-t.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})),e,n)},h[i=n]||(h[i]=setTimeout((function(){h[i]=null,t()}),32))}function r(e){var n=e.getBoundingClientRect();return M(P),{x:Math.floor(Number(n.left)+Number(a.x)),y:Math.floor(Number(n.top)+Number(a.y))}}function c(e){var n=e?r(W.iframe):{x:0,y:0},t={x:Number(W.width)+n.x,y:Number(W.height)+n.y};p(P,"Reposition requested from iFrame (offset x:"+n.x+" y:"+n.y+")"),window.top===window.self?(a=t,d(),p(P,"--")):window.parentIFrame?window.parentIFrame["scrollTo"+(e?"Offset":"")](t.x,t.y):k(P,"Unable to scroll to requested position, window.parentIFrame not found")}function d(){!1===l("onScroll",a)?j():T(P)}function f(e){var n={};if(0===Number(W.width)&&0===Number(W.height)){var t=i(9).split(":");n={x:t[1],y:t[0]}}else n={x:W.width,y:W.height};l(e,{iframe:W.iframe,screenX:Number(n.x),screenY:Number(n.y),type:W.type})}function l(e,n){return I(P,e,n)}var m,b,y,x,z,S,A=e.data,W={},P=null;"[iFrameResizerChild]Ready"===A?function(){for(var e in u)C("iFrame requested init",N(e),u[e].iframe,e)}():s===(""+A).slice(0,13)&&A.slice(13).split(":")[0]in u?(x=(y=A.slice(13).split(":"))[1]?parseInt(y[1],10):0,z=u[y[0]]&&u[y[0]].iframe,S=getComputedStyle(z),W={iframe:z,id:y[0],height:x+function(e){return"border-box"!==e.boxSizing?0:(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}(S)+function(e){return"border-box"!==e.boxSizing?0:(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}(S),width:y[2],type:y[3]},u[P=W.id]&&(u[P].loaded=!0),(b=W.type in{true:1,false:1,undefined:1})&&p(P,"Ignoring init message from meta parent page"),!b&&function(e){var n=!0;return u[e]||(n=!1,k(W.type+" No settings for "+e+". Message was: "+A)),n}(P)&&(p(P,"Received: "+A),m=!0,null===W.iframe&&(k(P,"IFrame ("+W.id+") not found"),m=!1),m&&function(){var n,t=e.origin,i=u[P]&&u[P].checkOrigin;if(i&&""+t!="null"&&!(i.constructor===Array?function(){var e=0,n=!1;for(p(P,"Checking connection is from allowed list of origins: "+i);e<i.length;e++)if(i[e]===t){n=!0;break}return n}():(p(P,"Checking connection is from: "+(n=u[P]&&u[P].remoteHost)),t===n)))throw new Error("Unexpected message received from: "+t+" for "+W.iframe.id+". Message was: "+e.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}()&&function(){switch(u[P]&&u[P].firstRun&&u[P]&&(u[P].firstRun=!1),W.type){case"close":F(W.iframe);break;case"message":m=i(6),p(P,"onMessage passed: {iframe: "+W.iframe.id+", message: "+m+"}"),l("onMessage",{iframe:W.iframe,message:JSON.parse(m)}),p(P,"--");break;case"mouseenter":f("onMouseEnter");break;case"mouseleave":f("onMouseLeave");break;case"autoResize":u[P].autoResize=JSON.parse(i(9));break;case"scrollTo":c(!1);break;case"scrollToOffset":c(!0);break;case"pageInfo":o(u[P]&&u[P].iframe,P),function(){function e(e,i){function r(){u[t]?o(u[t].iframe,t):n()}["scroll","resize"].forEach((function(n){p(t,e+n+" listener for sendPageInfo"),i(window,n,r)}))}function n(){e("Remove ",g)}var t=P;e("Add ",w),u[t]&&(u[t].stopPageInfo=n)}();break;case"pageInfoStop":u[P]&&u[P].stopPageInfo&&(u[P].stopPageInfo(),delete u[P].stopPageInfo);break;case"inPageLink":t=i(9).split("#")[1]||"",s=decodeURIComponent(t),(h=document.getElementById(s)||document.getElementsByName(s)[0])?(e=r(h),p(P,"Moving to in page link (#"+t+") at x: "+e.x+" y: "+e.y),a={x:e.x,y:e.y},d(),p(P,"--")):window.top===window.self?p(P,"In page link #"+t+" not found"):window.parentIFrame?window.parentIFrame.moveToAnchor(t):p(P,"In page link #"+t+" not found and window.parentIFrame not found");break;case"reset":O(W);break;case"init":n(),l("onInit",W.iframe);break;default:0===Number(W.width)&&0===Number(W.height)?k("Unsupported message received ("+W.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):n()}var e,t,s,h,m}())):v(P,"Ignored: "+A)}function I(e,n,t){var i=null,o=null;if(u[e]){if("function"!=typeof(i=u[e][n]))throw new TypeError(n+" on iFrame["+e+"] is not a function");o=i(t)}return o}function S(e){delete u[e.id]}function F(e){var t=e.id;if(!1!==I(t,"onClose",t)){p(t,"Removing iFrame: "+t);try{e.parentNode&&e.parentNode.removeChild(e)}catch(e){k(e)}I(t,"onClosed",t),p(t,"--"),S(e),n&&(n.disconnect(),n=null)}else p(t,"Close iframe cancelled by onClose event")}function M(n){null===a&&p(n,"Get page position: "+(a={x:window.pageXOffset===e?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===e?document.documentElement.scrollTop:window.pageYOffset}).x+","+a.y)}function T(e){null!==a&&(window.scrollTo(a.x,a.y),p(e,"Set page position: "+a.x+","+a.y),j())}function j(){a=null}function O(e){p(e.id,"Size reset requested by "+("init"===e.type?"host page":"iFrame")),M(e.id),E((function(){R(e),C("reset","reset",e.iframe,e.id)}),e,"reset")}function R(e){function n(n){r||"0"!==e[n]||(r=!0,p(i,"Hidden iFrame detected, creating visibility listener"),function(){function e(){Object.keys(u).forEach((function(e){!function(e){function n(n){return"0px"===(u[e]&&u[e].iframe.style[n])}u[e]&&null!==u[e].iframe.offsetParent&&(n("height")||n("width"))&&C("Visibility change","resize",u[e].iframe,e)}(e)}))}function n(n){p("window","Mutation observed: "+n[0].target+" "+n[0].type),W(e,16)}var t,i=m();i&&(t=document.querySelector("body"),new i(n).observe(t,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}))}())}function t(t){!function(n){e.id?(e.iframe.style[n]=e[n]+"px",p(e.id,"IFrame ("+i+") "+n+" set to "+e[n]+"px")):p("undefined","messageData id not set")}(t),n(t)}var i=e.iframe.id;u[i]&&(u[i].sizeHeight&&t("height"),u[i].sizeWidth&&t("width"))}function E(e,n,t){t!==n.type&&c&&!window.jasmine?(p(n.id,"Requesting animation frame"),c(e)):e()}function C(e,n,t,i,o){var r,a=!1;u[i=i||t.id]&&(t&&"contentWindow"in t&&null!==t.contentWindow?(p(i,"["+e+"] Sending msg to iframe["+i+"] ("+n+") targetOrigin: "+(r=u[i]&&u[i].targetOrigin)),t.contentWindow.postMessage(s+n,r)):k(i,"["+e+"] IFrame("+i+") not found"),o&&u[i]&&u[i].warningTimeout&&(u[i].msgTimeout=setTimeout((function(){!u[i]||u[i].loaded||a||(a=!0,k(i,"IFrame has not responded within "+u[i].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))}),u[i].warningTimeout)))}function N(e){return e+":"+u[e].bodyMarginV1+":"+u[e].sizeWidth+":"+u[e].log+":"+u[e].interval+":"+u[e].enablePublicMethods+":"+u[e].autoResize+":"+u[e].bodyMargin+":"+u[e].heightCalculationMethod+":"+u[e].bodyBackground+":"+u[e].bodyPadding+":"+u[e].tolerance+":"+u[e].inPageLinks+":"+u[e].resizeFrom+":"+u[e].widthCalculationMethod+":"+u[e].mouseEvents}function A(t,r){function s(e){var n=e.split("Callback");if(2===n.length){var t="on"+n[0].charAt(0).toUpperCase()+n[0].slice(1);this[t]=this[e],delete this[e],k(f,"Deprecated: '"+e+"' has been renamed '"+t+"'. The old method will be removed in the next major version.")}}var a,c,f=function(e){if("string"!=typeof e)throw new TypeError("Invaild id for iFrame. Expected String");var n;return""===e&&(t.id=(n=r&&r.id||l.id+i++,null!==document.getElementById(n)&&(n+=i++),e=n),o=(r||{}).log,p(e,"Added missing iframe ID: "+e+" ("+t.src+")")),e}(t.id);f in u&&"iFrameResizer"in t?k(f,"Ignored iFrame, already setup."):(function(e){var n;e=e||{},u[f]=Object.create(null),u[f].iframe=t,u[f].firstRun=!0,u[f].remoteHost=t.src&&t.src.split("/").slice(0,3).join("/"),function(e){if("object"!=typeof e)throw new TypeError("Options is not an object")}(e),Object.keys(e).forEach(s,e),function(e){for(var n in l)Object.prototype.hasOwnProperty.call(l,n)&&(u[f][n]=Object.prototype.hasOwnProperty.call(e,n)?e[n]:l[n])}(e),u[f]&&(u[f].targetOrigin=!0===u[f].checkOrigin?""===(n=u[f].remoteHost)||null!==n.match(/^(about:blank|javascript:|file:\/\/)/)?"*":n:"*")}(r),function(){switch(p(f,"IFrame scrolling "+(u[f]&&u[f].scrolling?"enabled":"disabled")+" for "+f),t.style.overflow=!1===(u[f]&&u[f].scrolling)?"hidden":"auto",u[f]&&u[f].scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=u[f]?u[f].scrolling:"no"}}(),function(){function e(e){var n=u[f][e];1/0!==n&&0!==n&&(t.style[e]="number"==typeof n?n+"px":n,p(f,"Set "+e+" = "+t.style[e]))}function n(e){if(u[f]["min"+e]>u[f]["max"+e])throw new Error("Value for min"+e+" can not be greater than max"+e)}n("Height"),n("Width"),e("maxHeight"),e("minHeight"),e("maxWidth"),e("minWidth")}(),"number"!=typeof(u[f]&&u[f].bodyMargin)&&"0"!==(u[f]&&u[f].bodyMargin)||(u[f].bodyMarginV1=u[f].bodyMargin,u[f].bodyMargin=u[f].bodyMargin+"px"),a=N(f),(c=m())&&(n=function(e){if(!t.parentNode)return null;var n=new e((function(e){e.forEach((function(e){Array.prototype.slice.call(e.removedNodes).forEach((function(e){e===t&&F(t)}))}))}));return n.observe(t.parentNode,{childList:!0}),n}(c)),w(t,"load",(function(){C("iFrame.onload",a,t,e,!0),(!u[f]||!u[f].firstRun)&&u[f]&&u[f].heightCalculationMethod in d&&O({iframe:t,height:0,width:0,type:"init"})})),C("init",a,t,e,!0),u[f]&&(u[f].iframe.iFrameResizer={close:F.bind(null,u[f].iframe),removeListeners:S.bind(null,u[f].iframe),resize:C.bind(null,"Window resize","resize",u[f].iframe),moveToAnchor:function(e){C("Move to anchor","moveToAnchor:"+e,u[f].iframe,f)},sendMessage:function(e){C("Send Message","message:"+(e=JSON.stringify(e)),u[f].iframe,f)}}))}function W(e,n){null===f&&(f=setTimeout((function(){f=null,e()}),n))}function P(){"hidden"!==document.visibilityState&&(p("document","Trigger event: Visibility change"),W((function(){H("Tab Visible","resize")}),16))}function H(e,n){Object.keys(u).forEach((function(t){(function(e){return u[e]&&"parent"===u[e].resizeFrom&&u[e].autoResize&&!u[e].firstRun})(t)&&C(e,n,u[t].iframe,t)}))}function L(){function n(e,n){n&&(function(){if(!n.tagName)throw new TypeError("Object is not a valid DOM element");if("IFRAME"!==n.tagName.toUpperCase())throw new TypeError("Expected <IFRAME> tag, found <"+n.tagName+">")}(),A(n,e),t.push(n))}var t;return function(){var e,n=["moz","webkit","o","ms"];for(e=0;e<n.length&&!c;e+=1)c=window[n[e]+"RequestAnimationFrame"];c?c=c.bind(window):p("setup","RequestAnimationFrame not supported")}(),w(window,"message",z),w(window,"resize",(function(){p("window","Trigger event: resize"),W((function(){H("Window resize","resize")}),16)})),w(document,"visibilitychange",P),w(document,"-webkit-visibilitychange",P),function(i,o){switch(t=[],function(e){e&&e.enablePublicMethods&&k("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}(i),typeof o){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(o||"iframe"),n.bind(e,i));break;case"object":n(i,o);break;default:throw new TypeError("Unexpected data type ("+typeof o+")")}return t}}}()),v.exports));class x{constructor(e,n){this.iframe=e,this.iframeOrigin=n}postMessage(e,n){const t=Object.assign({eventType:e},n);this.iframe.contentWindow.postMessage(t,this.iframeOrigin)}addMessageListener(e){window.addEventListener("message",e)}removeMessageListener(e){window.removeEventListener("message",e)}postMessageWithResponseListener(e,n){return new Promise((t=>{const i=n=>{n.data.eventType===e&&(window.removeEventListener("message",i),t(n.data.data))};window.addEventListener("message",i),this.postMessage(e,n)}))}}const z=class{constructor(n){e(this,n),this.iframeLoaded=i(this,"iframeLoaded",7),this.isFocused=!1,this.isValid=!0,this.dispatchMessageEvent=e=>{const{eventType:n,data:t}=e.data;(null==t?void 0:t.id)===this.inputId&&("focused"===n&&(this.isFocused=!0),"blurred"===n&&(this.isFocused=!1))}}disconnectedCallback(){this.frameService.removeMessageListener(this.dispatchMessageEvent)}async validate(){const e=await this.frameService.postMessageWithResponseListener("validate");return this.isValid=e.isValid,this.errorText=e.error.message,e}async tokenize(e,n,t){return this.frameService.postMessageWithResponseListener("tokenize",{clientId:e,paymentMethodMetadata:n,account:t,componentVersion:h.version})}initializeFrameCommunicationService(){var e;this.frameService=new x(this.iframeElement,this.iframeOrigin),null===(e=this.frameService)||void 0===e||e.addMessageListener(this.dispatchMessageEvent)}get part(){return this.isFocused&&!this.isValid?s:this.isValid?this.isFocused?c:d:a}get style(){return this.isFocused?this.isValid?w.focused:w.focusedAndInvalid:null}get urlParams(){const e=Object.fromEntries(Object.entries(w.fontStyles).map((([e,n])=>[e,btoa(String(n))])));return new URLSearchParams(e).toString()}render(){return n(t,{key:"e85f5a2417ccc46ac8df23a695c6ef3fcd71577e",class:"form-group d-flex flex-column"},n("div",{key:"02878f7fb1e720aa97a67e72d5f1711e0fbd0668",style:{visibility:this.iframeLoaded?"visible":"hidden",height:this.iframeLoaded?"auto":"0"}},n("label",{key:"57c46b739fb284c4ee618594f04cc5ff128bf16c",class:"form-label",htmlFor:"",part:u},this.label||""),n("div",{key:"4634650c721673a52ea55e331154a624c19266dc",class:"p-0 d-flex form-control "+(this.isValid?"":"is-invalid"),part:this.part,style:Object.assign(Object.assign({},this.style),{overflow:"hidden"})},n("iframe",{key:"facd226e399f41537657603c50c45887c1177c42",id:this.inputId,name:this.inputId,src:`${this.iframeOrigin}?${this.urlParams}`,ref:e=>{this.iframeElement=e,this.initializeFrameCommunicationService()},width:"100%",onLoad:()=>{k({log:!1,onResized:()=>{this.iframeLoaded.emit()}},this.iframeElement)}})),n(l,{key:"73c34b9ab89a21e6b3203904988bf8a542eb01f8",errorText:this.errorText,name:this.inputId})))}get el(){return o(this)}};export{b as hidden_input,z as iframe_input}
@@ -0,0 +1 @@
1
+ import{r as t,c as s,h as e}from"./p-CV0Pyo1O.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import"./p-Cjcsf8ku.js";import"./p-_BHErKTQ.js";import{p as i}from"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import{T as a,a as r,b as h,c as o,d as c,e as n,f as p,g as d,h as f,i as m,j as u,k as b,l as g}from"./p-Csh7hxly.js";import{T as y}from"./p-CZfYo5-1.js";import{t as l,a as j}from"./p-vIYW-hye.js";import{o as k,g as C}from"./p-Dw63wyhO.js";import"./p-D8GTwl9v.js";import"./p-MeSAYDNh.js";import"./p-D3V9AE6o.js";import"./p-BYLHkONM.js";import"./p-BPpqjhPu.js";const w=class{constructor(e){t(this,e),this.clickEvent=s(this,"click-event",7),this.errorEvent=s(this,"error-event",7),this.terminals=[],this.subAccounts=[],this.loading=!0,this.paging=i,this.pagingParams={},this.handleClickPrevious=t=>{this.pagingParams={before_cursor:t},this.clickEvent.emit({name:y.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:y.next})},this.rowClickHandler=t=>{const s=t.target.closest("tr").dataset.rowEntityId;if(!s)return;const e=this.terminals.find((t=>t.id===s));this.clickEvent.emit({name:y.row,data:e})}}updateOnPropChange(){this.fetchData()}componentWillLoad(){this.terminalsTable=new a(this.terminals,this.columns,l,j),this.getTerminals&&this.getSubAccounts&&this.fetchData(),k("set",(()=>{this.pagingParams={}})),k("reset",(()=>{this.pagingParams={},this.errorMessage=""}))}fetchData(){this.loading=!0,this.getTerminals({params:this.terminalParams,onSuccess:async({terminals:t,pagingInfo:s})=>{this.terminals=t,this.paging=s,this.terminalsTable.collectionData=this.terminals,this.terminalsTable.columnKeys.includes("sub_account_name")?await this.fetchSubAccounts():this.loading=!1},onError:({error:t,code:s,severity:e})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:s,message:t,severity:e}),this.loading=!1}})}async fetchSubAccounts(){this.getSubAccounts({params:this.subAccountParams,onSuccess:({subAccounts:t})=>{this.subAccounts=t,this.terminals=this.terminals.map((t=>{var s;return t.sub_account_name=null===(s=this.subAccounts.find((s=>s.id===t.account_id)))||void 0===s?void 0:s.name,t})),this.loading=!1},onError:({error:t,code:s,severity:e})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:s,message:t,severity:e}),this.loading=!1}})}get terminalParams(){const t=C();return Object.assign(Object.assign({},t),this.pagingParams)}get subAccountParams(){let t=this.terminals.map((t=>t.account_id));return{sub_account_id:[...new Set(t)].join(",")}}get entityId(){return this.terminals.map((t=>t.id))}get showEmptyState(){return!this.loading&&!this.errorMessage&&this.terminalsTable.rowData.length<1}get showErrorState(){return!this.loading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.loading}render(){return e(g,{key:"babe023df8ec976de3e284e80d8e0ec0b2c19b79"},e(r,{key:"d2d5f53cc2d743917ec8fd15f0f69efe75727501"},e(h,{key:"1a078b11b484d4e6ebfc3ccc5aefc69f99faae79"},e(o,{key:"8776607ed0d4c15010132a7f27966213ea816092"},this.terminalsTable.columnData.map((t=>t)))),e(c,{key:"61905ac71df9b3d268a77771b382b928ed5aa01a"},e(n,{key:"7929fa99216050360f2b36fcd2ec06dec6da0e3a",columnSpan:this.terminalsTable.columnKeys.length,isLoading:this.loading}),e(p,{key:"8bac75644df059915e3852ef472e8e4edd687026",isEmpty:this.showEmptyState,columnSpan:this.terminalsTable.columnKeys.length}),e(d,{key:"34968591017d975c8d13a9cf532f378e52e11d55",columnSpan:this.terminalsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.terminalsTable.rowData.map(((t,s)=>e(f,{"data-test-id":"table-row","data-row-entity-id":this.entityId[s],onClick:this.rowClickHandler},t)))),this.paging&&e(m,{key:"641649961418c64af80a4ab3e63bbbee2fb71076"},e(u,{key:"a2355762274b2ce15217ff86cac3e2ddecf7569d"},e(b,{key:"f5d8fd0878a3bdc9e93b1e2f08654f51c8bbba2f",colSpan:this.terminalsTable.columnData.length},e("pagination-menu",{key:"64e85e2ffc0280af6caf521fed496cc41df0a8b3",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})}))))))}static get watchers(){return{pagingParams:["updateOnPropChange"],getTerminals:["updateOnPropChange"],getSubAccounts:["updateOnPropChange"],columns:["updateOnPropChange"]}}};export{w as terminals_list_core}
@@ -1 +1 @@
1
- import{h as s,F as t,r as i,c as e}from"./p-CV0Pyo1O.js";import{E as l}from"./p-BylxH1fV.js";import{S as r}from"./p-BqNNwq6C.js";import"./p-CZfYo5-1.js";import{S as o}from"./p-CmYy5XDp.js";import"./p-c8J1gsDg.js";const n=()=>{const i=()=>s("div",{class:"mt-5"},s(o,{width:"40%",height:"1.5rem"}),s("hr",null),s("div",{class:"row g-3"},s("div",{class:"col-12 col-md-6"},s(o,null),s(o,null),s(o,null)),s("div",{class:"col-12 col-md-6"},s(o,null),s(o,null),s(o,null))));return s(t,null,s(i,null),s(i,null),s(i,null),s(i,null))};var a;!function(s){s.LOADING="loading",s.READY="ready",s.ERROR="error"}(a||(a={}));const d=class{constructor(s){i(this,s),this.errorEvent=e(this,"error-event",7),this.renderState=a.LOADING}async componentWillLoad(){this.getBusiness&&this.fetchData()}fetchData(){this.renderState=a.LOADING,this.getBusiness({onSuccess:({business:s})=>{this.business=s,this.renderState=a.READY},onError:({error:s,code:t,severity:i})=>{this.errorMessage=s,this.renderState=a.ERROR,this.errorEvent.emit({errorCode:t,message:s,severity:i})}})}render(){return s(r,null,this.renderState===a.LOADING?s(n,null):this.renderState===a.ERROR?l(this.errorMessage):s("justifi-details",{errorMessage:this.errorMessage},s("div",{slot:"detail-sections"},s("core-info-details",{business:this.business}),s("legal-address-details",{legalAddress:this.business.legal_address}),s("representative-details",{representative:this.business.representative}),s("owner-details",{owners:this.business.owners}),s("additional-questions-details",{additionalQuestions:this.business.additional_questions}))))}};export{d as business_details_core}
1
+ import{h as s,F as t,r as i,c as e}from"./p-CV0Pyo1O.js";import{E as l}from"./p-COZ-9O53.js";import{S as r}from"./p-BqNNwq6C.js";import"./p-CZfYo5-1.js";import{S as o}from"./p-C0tps2ph.js";import"./p-D3V9AE6o.js";const n=()=>{const i=()=>s("div",{class:"mt-5"},s(o,{width:"40%",height:"1.5rem"}),s("hr",null),s("div",{class:"row g-3"},s("div",{class:"col-12 col-md-6"},s(o,null),s(o,null),s(o,null)),s("div",{class:"col-12 col-md-6"},s(o,null),s(o,null),s(o,null))));return s(t,null,s(i,null),s(i,null),s(i,null),s(i,null))};var a;!function(s){s.LOADING="loading",s.READY="ready",s.ERROR="error"}(a||(a={}));const d=class{constructor(s){i(this,s),this.errorEvent=e(this,"error-event",7),this.renderState=a.LOADING}async componentWillLoad(){this.getBusiness&&this.fetchData()}fetchData(){this.renderState=a.LOADING,this.getBusiness({onSuccess:({business:s})=>{this.business=s,this.renderState=a.READY},onError:({error:s,code:t,severity:i})=>{this.errorMessage=s,this.renderState=a.ERROR,this.errorEvent.emit({errorCode:t,message:s,severity:i})}})}render(){return s(r,null,this.renderState===a.LOADING?s(n,null):this.renderState===a.ERROR?l(this.errorMessage):s("justifi-details",{errorMessage:this.errorMessage},s("div",{slot:"detail-sections"},s("core-info-details",{business:this.business}),s("legal-address-details",{legalAddress:this.business.legal_address}),s("representative-details",{representative:this.business.representative}),s("owner-details",{owners:this.business.owners}),s("additional-questions-details",{additionalQuestions:this.business.additional_questions}))))}};export{d as business_details_core}
@@ -0,0 +1 @@
1
+ import{r as t,c as s,h as o}from"./p-CV0Pyo1O.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{C as i,a as r}from"./p-Cjcsf8ku.js";import{C as e}from"./p-_BHErKTQ.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import{g as c,a}from"./p-D2muobcE.js";import{c as n,J as p}from"./p-zGGZEiGQ.js";import{C as h}from"./p-rgpO5xc3.js";import{m as u,S as m}from"./p-6Nv8l5n8.js";import{S as d}from"./p-BqNNwq6C.js";import"./p-CZfYo5-1.js";import{d as j}from"./p-C5CtnV8A.js";import"./p-D8GTwl9v.js";import"./p-MeSAYDNh.js";import"./p-qNXIkzDE.js";import"./p-55QcjheA.js";import"./p-BPpqjhPu.js";import"./p-D3V9AE6o.js";const l=class{constructor(o){t(this,o),this.errorEvent=s(this,"error-event",7),this.errorMessage=null,this.columns=j,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)}}componentWillLoad(){n(),this.analytics=new p(this),this.initializeGetData()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetData()}initializeGetData(){this.initializeGetCheckouts(),this.initializeGetSubAccounts()}initializeGetCheckouts(){const t=this.subAccountId||this.accountId;t&&this.authToken?this.getCheckouts=(({accountId:t,authToken:s,service:o})=>async({params:r,onSuccess:n,onError:p})=>{var h,u;try{const m=await o.fetchCheckouts(t,s,r);if(m.error)return p({error:a(m.error),code:c(null===(u=m.error)||void 0===u?void 0:u.code),severity:i.ERROR});{const t=Object.assign({},m.page_info);n({checkouts:(null===(h=m.data)||void 0===h?void 0:h.map((t=>new e(t))))||[],pagingInfo:t})}}catch(t){const s=c(null==t?void 0:t.code);return p({error:t.message||t,code:s,severity:i.ERROR})}})({accountId:t,authToken:this.authToken,service:new h}):(this.errorMessage="Account ID/Sub Account ID and Auth Token are required",this.errorEvent.emit({errorCode:r.MISSING_PROPS,message:this.errorMessage,severity:i.ERROR}))}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=u({primaryAccountId:this.accountId,authToken:this.authToken,service:new m}))}render(){return o(d,{key:"4a6f911872310fdcb2600a6833eef5d7001033d6"},o("checkouts-list-core",{key:"d30b728b7ca2e6b1b26483f9a0c91b2afe7ea194",getCheckouts:this.getCheckouts,getSubAccounts:this.getSubAccounts,"onError-event":this.handleErrorEvent,columns:this.columns}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"],subAccountId:["propChanged"]}}};export{l as justifi_checkouts_list}
@@ -0,0 +1 @@
1
+ import{r as t,c as e,h as i,g as s,H as a}from"./p-CV0Pyo1O.js";import{S as r}from"./p-BqNNwq6C.js";import"./p-CZfYo5-1.js";import{c as n,J as d}from"./p-zGGZEiGQ.js";import{w as o,c}from"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{a as h,C as l}from"./p-Cjcsf8ku.js";import"./p-_BHErKTQ.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import{c as u}from"./p-Daew0gTO.js";import{P as b}from"./p-DkoufM1t.js";import{S as f}from"./p-C0tps2ph.js";import{b as m}from"./p-MeSAYDNh.js";import{B as p}from"./p-o83Uy7sW.js";import{r as y}from"./p-D3V9AE6o.js";import"./p-qNXIkzDE.js";import"./p-55QcjheA.js";import"./p-D8GTwl9v.js";const v=class{constructor(i){t(this,i),this.radioClick=e(this,"radio-click",7),this.checked=!1,this.hidden=!1,this.handleClick=()=>{this.radioClick.emit(this.value)}}render(){return i(r,{key:"1ae40f787970160e38b72f917bda96f480d2a890"},i("div",{key:"2130596c8294cc38365e6126806735da0f93ef4a",class:`radio-list-item p-3 ${this.class||""}`,part:y,onClick:this.handleClick,hidden:this.hidden},i("form-control-radio",{key:"7d5524f518430f2bfd1c9863f354318929353cfb",name:this.name,value:this.value,checked:this.checked,label:this.label,inputHandler:()=>null})))}},k={[b.NEW_BANK_ACCOUNT]:"New bank account",[b.NEW_CARD]:"New credit or debit card"},g="Payment form not ready",w="Validation error",j=class{constructor(i){t(this,i),this.errorEvent=e(this,"error-event",7),this.submitEvent=e(this,"submit-event",7),this.computedHideSubmitButton=!1,this.isLoading=!1,this.submitButtonText="Submit"}paymentMethodsChanged(){this.setDefaultSelectedPaymentMethod()}connectedCallback(){this.setDefaultSelectedPaymentMethod(),this.setComputedHideSubmitButton()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup(),this.unsubscribeFromStore&&this.unsubscribeFromStore()}componentWillLoad(){n(),this.analytics=new d(this)}handleRadioClick(t){this.selectedPaymentMethod=t.detail,u.selectedPaymentMethod={type:t.detail}}async fillBillingForm(t){var e;null===(e=this.billingFormRef)||void 0===e||e.fill(t)}async tokenizePaymentMethod(t){null==t||t.preventDefault(),this.validateRequiredProps(),this.isLoading=!0;try{if(!(await this.validate()).isValid)return this.errorEvent.emit({errorCode:h.TOKENIZE_ERROR,message:w}),void(this.isLoading=!1);const t=await this.resolvePaymentMethod({isValid:!0});return t.error&&this.emitError({errorCode:t.error.code,message:t.error.message}),this.submitEvent.emit({response:t}),t}catch(t){const e=this.createErrorResponse(h.TOKENIZE_ERROR,t.message);return this.emitError({errorCode:h.TOKENIZE_ERROR,message:t.message}),this.submitEvent.emit({response:e}),e}finally{this.isLoading=!1}}async validate(){if(!this.areFormsReady())return{isValid:!1,errors:{general:g}};const[t,e]=await Promise.all([this.billingFormRef.validate(),this.paymentMethodFormRef.validate()]);return{isValid:t.isValid&&e.isValid,errors:Object.assign(Object.assign({},t.errors),e.errors)}}async tokenize(){try{const t=await this.billingFormRef.getValues(),e={clientId:this.authToken||u.authToken,account:this.accountId||u.accountId,paymentMethodMetadata:this.buildPaymentMethodMetadata(t)};return await this.paymentMethodFormRef.tokenize(e)}catch(t){return t}}validateRequiredProps(){this.authToken||u.authToken||this.emitError({errorCode:h.TOKENIZE_ERROR,message:"Auth token is required when using the tokenize-payment-method component not slotted in justifi-modular-checkout"}),this.accountId||u.accountId||this.emitError({errorCode:h.TOKENIZE_ERROR,message:"Account ID is required when using the tokenize-payment-method component not slotted in justifi-modular-checkout"})}setDefaultSelectedPaymentMethod(){this.selectedPaymentMethod||(this.disableCreditCard?this.disableBankAccount||(this.selectedPaymentMethod=b.NEW_BANK_ACCOUNT,u.selectedPaymentMethod={type:b.NEW_BANK_ACCOUNT}):(this.selectedPaymentMethod=b.NEW_CARD,u.selectedPaymentMethod={type:b.NEW_CARD}))}setComputedHideSubmitButton(){if(void 0!==this.hideSubmitButton)return void(this.computedHideSubmitButton=this.hideSubmitButton);const t=this.isSlottedWithinModularCheckout();this.computedHideSubmitButton=t}isSlottedWithinModularCheckout(){var t;let e=null===(t=this.host)||void 0===t?void 0:t.parentElement;for(;e;){if("JUSTIFI-MODULAR-CHECKOUT"===e.tagName)return!0;e=e.parentElement}return!1}get availablePaymentMethods(){const t=[];return this.disableCreditCard||t.push(b.NEW_CARD),this.disableBankAccount||t.push(b.NEW_BANK_ACCOUNT),t}areFormsReady(){return!(!this.billingFormRef||!this.paymentMethodFormRef)}emitError(t){this.errorEvent.emit(Object.assign(Object.assign({},t),{severity:l.ERROR}))}createErrorResponse(t,e){return{error:{code:t,message:e,decline_code:void 0}}}async resolvePaymentMethod(t){if(!this.areFormsReady())return this.createErrorResponse("form_not_ready",g);try{const e=await this.validate();if(!e.isValid||!t.isValid){const t=Object.values(e.errors)[0]||w;return{validationError:!0,error:{code:"validation_error",message:String(t),decline_code:void 0}}}return await this.performTokenization()}catch(t){return{error:t}}}async performTokenization(){var t,e;const i=await this.tokenize();if(i.error)return{error:i.error};const s=i.data;return{token:(null===(t=s.card)||void 0===t?void 0:t.token)||(null===(e=s.bank_account)||void 0===e?void 0:e.token),data:s}}buildPaymentMethodMetadata(t){return this.shouldSavePaymentMethod?Object.assign(Object.assign({},t),{payment_method_group_id:this.paymentMethodGroupID}):Object.assign({},t)}get paymentMethodGroupID(){return this.paymentMethodGroupId||u.paymentMethodGroupId}get shouldSavePaymentMethod(){return!(!this.paymentMethodGroupId&&!u.savePaymentMethod)}get shouldHideRadioInput(){return this.disableCreditCard||this.disableBankAccount}renderPaymentMethodOption(t){const e=this.selectedPaymentMethod===t&&void 0===u.selectedPaymentMethod.id;return i("div",{class:"payment-method"},i("justifi-radio-list-item",{name:"paymentMethodType",value:t,checked:e,label:k[t],hidden:this.shouldHideRadioInput}),e&&this.renderSelectedPaymentMethodForm(t))}renderSelectedPaymentMethodForm(t){return i("div",{class:"mt-4 pb-4"},this.renderPaymentMethodForm(t),i("div",{class:"mt-4"},i("justifi-billing-form",{ref:t=>this.billingFormRef=t,hideCardBillingForm:this.hideCardBillingForm,hideBankAccountBillingForm:this.hideBankAccountBillingForm,paymentMethodType:t})),i("div",{class:"mt-4"},i("justifi-save-new-payment-method",{hidden:!this.paymentMethodGroupID,label:this.savePaymentMethodLabel})))}renderPaymentMethodForm(t){return i(t===b.NEW_CARD?"justifi-card-form":"justifi-bank-account-form",{ref:t=>this.paymentMethodFormRef=t})}render(){return i(r,{key:"86d79320ea44f9e791ab91739075d160769743fb"},i("form",{key:"d8b62d8d0442085822a51eeaef816809e2bd1f05"},i("fieldset",{key:"c792bba0b82c19f05ce551b95157479d407113e2"},i("div",{key:"57e93910091e25344a371ac081aa657c683049b4",class:"row gy-3"},i("div",{key:"bc63e26c74b247ec4d5d5ee9510d8370b9e36f17",class:"col-12"},this.availablePaymentMethods.map((t=>this.renderPaymentMethodOption(t)))),i("div",{key:"1d9acd0beee80e8b339204d7328a0d2e9078b9a3",class:"col-12"},i("justifi-button",{key:"18a968b57420f0690e6f6c98b5e108f769b61d4b",text:this.submitButtonText,variant:"primary",type:"submit",clickHandler:t=>this.tokenizePaymentMethod(t),isLoading:this.isLoading,"data-testid":"submit-button",hidden:this.computedHideSubmitButton}))))))}get host(){return s(this)}static get watchers(){return{disableCreditCard:["paymentMethodsChanged"],disableBankAccount:["paymentMethodsChanged"]}}},C=t=>{const{isReady:e}=t;return e?null:i("div",{class:"container-fluid p-0"},i("div",{class:"row mb-3"},i("div",{class:"col-12 align-content-end"},i(f,{height:"18px",width:"120px"}),i(f,{height:"36px"}))),i("div",{class:"row"},i("div",{class:"col-12 align-content-end"},i(f,{height:"18px",width:"110px"}),i(f,{height:"36px"}))))},M=class{constructor(e){t(this,e),this.isReady=!1}async componentWillLoad(){await o(),this.iframeOrigin=c.iframeOrigin,this.tabId=m(),n(),this.analytics=new d(this)}componentDidRender(){Promise.all([this.accountNumberIframeElement,this.routingNumberIframeElement].map((t=>new Promise((e=>{t.addEventListener("iframeLoaded",(()=>{e()}))}))))).then((()=>{this.isReady=!0}))}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}async validate(){const t=await this.accountNumberIframeElement.validate(),e=await this.routingNumberIframeElement.validate();return t&&e}async tokenize({clientId:t,paymentMethodMetadata:e,account:i}){return this.accountNumberIframeElement.tokenize(t,e,i)}render(){return i(r,{key:"b9674b4e8cfd28e440f28c3e08772bc879f0d1b6"},i(C,{key:"87adb553cd4fefac370379bbfcc373fbd8935f60",isReady:this.isReady}),i("hidden-input",{key:"1395bba6465865528e94e945ca614107027e86c4"}),i("div",{key:"7ce58ad6226ac6cb3c4ec45895a5e3a94885d3a9",class:"container-fluid p-0",style:{opacity:this.isReady?"1":"0",height:this.isReady?"auto":"0"}},i("div",{key:"85a4a2955404571823404bd9aa46c0744b5f1469",class:"row mb-3"},i("iframe-input",{key:"af85c82af0770b89bbba09347b5f3bf65d581e5a",inputId:"accountNumber",ref:t=>this.accountNumberIframeElement=t,label:"Account Number",iframeOrigin:`${this.iframeOrigin}/v2/accountNumber?tabId=${this.tabId}`})),i("div",{key:"201171891252c6384e47657b007e7e0381d12cfa",class:"row"},i("iframe-input",{key:"1f2b63b6cb11c0dd906727aaba3127e68ecb540c",inputId:"routingNumber",ref:t=>this.routingNumberIframeElement=t,label:"Routing Number",iframeOrigin:`${this.iframeOrigin}/v2/routingNumber?tabId=${this.tabId}`}))))}},_=class{constructor(e){t(this,e)}get showSimpleCardBillingForm(){return this.paymentMethodType===b.NEW_CARD&&this.hideCardBillingForm}get showSimpleBankAccountBillingForm(){return this.paymentMethodType===b.NEW_BANK_ACCOUNT&&this.hideBankAccountBillingForm}async getValues(){var t;return null===(t=this.selectedFormRef)||void 0===t?void 0:t.getValues()}async fill(t){var e;null===(e=this.selectedFormRef)||void 0===e||e.fill(t)}async validate(){var t;return null===(t=this.selectedFormRef)||void 0===t?void 0:t.validate()}render(){return i(a,null,i(this.showSimpleBankAccountBillingForm?"justifi-bank-account-billing-form-simple":this.showSimpleCardBillingForm?"justifi-card-billing-form-simple":"justifi-billing-form-full",{legend:this.legend,ref:t=>this.selectedFormRef=t}))}},x=class{constructor(e){t(this,e),this.variant="primary",this.type="button"}render(){return i(r,{key:"b9a4be42df1dbeca39a2c310ab6375cc2c1946f3"},i(p,{key:"04bfb3aaa6af8b2dafa07dbcebaf6b7a03a07442",variant:this.variant,isLoading:this.isLoading,clickHandler:this.clickHandler,class:this.class,type:this.type,disabled:this.disabled,style:this.customStyle},this.text))}},I=t=>{const{isReady:e}=t;return e?null:i("div",{class:"container-fluid p-0"},i("div",{class:"mb-3"},i(f,{height:"18px",width:"100px"}),i(f,{height:"36px"})),i("div",{class:"row"},i("div",{class:"col-4 align-content-end"},i(f,{height:"18px",width:"80px"}),i(f,{height:"36px"})),i("div",{class:"col-4 align-content-end"},i(f,{height:"36px"})),i("div",{class:"col-4 align-content-end"},i(f,{height:"18px",width:"30px"}),i(f,{height:"36px"}))))},P=class{constructor(e){t(this,e),this.isReady=!1}async componentWillLoad(){await o(),this.iframeOrigin=c.iframeOrigin,this.tabId=m(),n(),this.analytics=new d(this)}componentDidRender(){Promise.all([this.cardNumberIframeElement,this.expirationMonthIframeElement,this.expirationYearIframeElement,this.cvvIframeElement].map((t=>new Promise((e=>{t.addEventListener("iframeLoaded",(()=>{e()}))}))))).then((()=>{this.isReady=!0}))}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}async validate(){const t=await this.cardNumberIframeElement.validate(),e=await this.expirationMonthIframeElement.validate(),i=await this.expirationYearIframeElement.validate(),s=await this.cvvIframeElement.validate();return t&&e&&i&&s}async tokenize({clientId:t,paymentMethodMetadata:e,account:i}){return this.cardNumberIframeElement.tokenize(t,e,i)}render(){return i(r,{key:"20d4ea593b1f53fdbe8cc301e64c1a7743802678"},i(I,{key:"f3d2569ddcf94c8cf5f07ba4e1a862d6991c686e",isReady:this.isReady}),i("hidden-input",{key:"4804eb065aa5c2c21a84cd5e4ae02d8e00544081"}),i("div",{key:"0c98ea9d4218a70a95b620a969481083aac623f3",class:"container-fluid p-0",style:{opacity:this.isReady?"1":"0",height:this.isReady?"auto":"0"}},i("div",{key:"6674294528ffdf8b3e90aa75827d88c891f74f65",class:"mb-3"},i("iframe-input",{key:"a08798d454cf5b7e572c334bdf3238f08071fa43",inputId:"cardNumber",ref:t=>this.cardNumberIframeElement=t,label:"Card Number",iframeOrigin:`${this.iframeOrigin}/v2/cardNumber?tabId=${this.tabId}`})),i("div",{key:"e5aca3795c1788bd0862f7dbf28dec58bbcc3f03",class:"row"},i("div",{key:"29c8dcbf332349d1b81e98b17630de0cd3ef8b77",class:"col-4 align-content-end"},i("iframe-input",{key:"88dd4b4601010543f2d02b4b5ca6814431de1e63",inputId:"expirationMonth",ref:t=>this.expirationMonthIframeElement=t,label:"Expiration",iframeOrigin:`${this.iframeOrigin}/v2/expirationMonth?tabId=${this.tabId}`})),i("div",{key:"d7b557547cdb3e18103c9ad0588733448a22d4f6",class:"col-4 align-content-end"},i("iframe-input",{key:"2b9915cd264167e2c3080688290765590061ae6d",inputId:"expirationYear",ref:t=>this.expirationYearIframeElement=t,label:"",iframeOrigin:`${this.iframeOrigin}/v2/expirationYear?tabId=${this.tabId}`})),i("div",{key:"241ead4a324fc65ddc787e8fa81cb8ed62e3114d",class:"col-4 align-content-end"},i("iframe-input",{key:"c254b90ef75b5bcf1ff86bddf2d488de0a2bb709",inputId:"CVV",ref:t=>this.cvvIframeElement=t,label:"CVV",iframeOrigin:`${this.iframeOrigin}/v2/CVV?tabId=${this.tabId}`})))))}},O=class{constructor(i){t(this,i),this.checkboxChanged=e(this,"checkboxChanged",7),this.label="Save New Payment Method",this.isChecked=!1,this.handleCheckboxChange=(t,e)=>{this.isChecked=e,u.savePaymentMethod=e,this.checkboxChanged.emit(this.isChecked)}}render(){return i(r,{key:"981f6a84fc14a7b687e1b6567b30fb9f861b0aa2"},i("form-control-checkbox",{key:"566f6261d19f96b87b9382b26a86b71461a29d08",label:this.label||"Save New Payment Method",name:"saveNewPaymentMethod",checked:this.isChecked,inputHandler:this.handleCheckboxChange}))}};export{j as internal_tokenize_payment_method,M as justifi_bank_account_form,_ as justifi_billing_form,x as justifi_button,P as justifi_card_form,v as justifi_radio_list_item,O as justifi_save_new_payment_method}
@@ -0,0 +1 @@
1
+ import{r as s,h as t}from"./p-CV0Pyo1O.js";import{S as o}from"./p-BqNNwq6C.js";import{S as f}from"./p-C0tps2ph.js";import"./p-D3V9AE6o.js";const r=class{constructor(t){s(this,t)}render(){return t(o,{key:"d19fcf55df4b5b001d31af93c263fef39fc0d160"},t(f,{key:"9ab49d76aa71146287fff2013050e008342f0275",component:this.component,height:this.height,width:this.width,className:this.class,styles:this.customStyle}))}};export{r as justifi_skeleton}
@@ -1 +1 @@
1
- import{r as e,c as t,h as i}from"./p-CV0Pyo1O.js";import{c as a,J as s}from"./p-3kNggPyP.js";import{c as d}from"./p-Daew0gTO.js";import{c}from"./p-c8J1gsDg.js";import{S as o}from"./p-BqNNwq6C.js";import"./p-CZfYo5-1.js";import{P as f}from"./p-DkoufM1t.js";import"./p-Cc6518FT.js";import"./p-55QcjheA.js";import"./p-DVJaoI_m.js";import"./p-D8GTwl9v.js";import"./p-MeSAYDNh.js";import"./p-HXpYMWUU.js";import"./p-Cjcsf8ku.js";import"./p-BiNakvsa.js";import"./p-BH0Xfn-F.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";const h=class{constructor(i){e(this,i),this.errorEvent=t(this,"error-event",7),this.loadedEvent=t(this,"loaded",7),this.submitEvent=t(this,"submit-event",7),this.availablePaymentMethods=[],this.errorMessage="",this.insuranceToggled=!1,this.isSubmitting=!1,this.disableBankAccount=!1,this.disableBnpl=!1,this.disableCreditCard=!1,this.disablePaymentMethodGroup=!1,this.hideBankAccountBillingForm=!1,this.hideCardBillingForm=!1}propChanged(){this.updateStore()}connectedCallback(){this.authToken&&this.checkoutId&&this.updateStore()}componentWillLoad(){a(),this.analytics=new s(this)}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}checkoutComplete(e){this.isSubmitting=!1}checkoutError(e){console.error("[justifi-checkout] error-event received",null==e?void 0:e.detail),this.isSubmitting=!1}checkoutChanged(e){this.availablePaymentMethods=this.disableBnpl?e.detail.availablePaymentMethodTypes.filter((e=>e!==f.SEZZLE)):e.detail.availablePaymentMethodTypes}async fillBillingForm(e){var t;d.billingFormFields=e,null===(t=this.tokenizePaymentMethodRef)||void 0===t||t.fillBillingForm(e)}async validate(){var e;return{isValid:await(null===(e=this.modularCheckoutRef)||void 0===e?void 0:e.validate())}}updateStore(){d.checkoutId=this.checkoutId,d.authToken=this.authToken,d.disableCreditCard=this.disableCreditCard,d.disableBankAccount=this.disableBankAccount,d.disablePaymentMethodGroup=this.disablePaymentMethodGroup}async submit(e){var t;this.isSubmitting=!0,null===(t=this.modularCheckoutRef)||void 0===t||t.submitCheckout(d.billingFormFields)}get showPaymentTypeHeader(){return!this.disableCreditCard&&!this.disableBankAccount}render(){var e,t;return i(o,{key:"6bbc4c4997d14ac9040b8f88075a7e9b53208d4c"},i("justifi-modular-checkout",{key:"9b11e7df277e5e9f70cd8928f865a2e62cfc8293",ref:e=>{this.modularCheckoutRef=e},authToken:this.authToken,checkoutId:this.checkoutId,preCompleteHook:this.preCompleteHook},i("div",{key:"c64981c31fd2d022f886b0613bd47bd0b0fe5f2a",class:"row gy-3 jfi-checkout-core"},i("div",{key:"8f01af25b281a19f7fc83451a44f63836efadc20",class:"col-12",part:c},i("justifi-header",{key:"d729ed0b26c94e74d8ce824fcf97bd3002e3a9d0",text:"Summary",level:"h2",class:"fs-5 fw-bold pb-3"}),i("section",{key:"9cc9863b1dd2531bda52e609bba5c7c8f9883cb1"},i("justifi-checkout-summary",{key:"00f36de593e245982bfe03c8867881fedfb7d43f"}))),i("div",{key:"3fe5390d7b8b2fbcdbfff4b71d4b7c43ddae9ff6",class:"col-12 mt-4"},i("slot",{key:"84fa5a7e7772124d7fa61a9317499618850eb0bb",name:"insurance"})),i("div",{key:"c8d1553c6041c0e000eab9dc953a23aa089a3f90",class:"col-12 mt-4"},i("justifi-header",{key:"a08fc163ba437f767ab88d78ac55ae003b09a567",text:"Payment",level:"h2",class:"fs-5 fw-bold pb-3"}),this.showPaymentTypeHeader&&i("justifi-header",{key:"bff5fc2986d37bbe49a5253d43db55663ee7be74",text:"Select payment type",level:"h3",class:"fs-6 fw-bold lh-lg"}),i("div",{key:"f5ca969400444639b09e423b154e47abf89c731f",class:"d-flex flex-column"},i("section",{key:"b70209321ebefd161ae3113293c62fe953913f2e"},i("div",{key:"4df7539a9b8d6b52d47ad32974a59ab2d366b4b2"},this.availablePaymentMethods.includes(f.APPLE_PAY)&&i("div",{key:"023deb9a1d025e36cc2b07c3ea8144e0068ea470",class:"mb-3"},i("justifi-apple-pay",{key:"4e52440f329bae25194e71fa30190218f5c1cecb"})),this.availablePaymentMethods.includes(f.GOOGLE_PAY)&&i("div",{key:"83e12debb25e0ef095ca40d87054411396238754",class:"mb-3"},i("justifi-google-pay",{key:"ed6312e39ff4a98c819cf1853f416c6fbf845323",ref:e=>this.googlePayRef=e})),i("justifi-saved-payment-methods",{key:"e059fda26ec54c4f908754663fa23f26c3df8f0c"}),this.availablePaymentMethods.includes(f.SEZZLE)&&i("justifi-radio-list-item",{key:"3d836539d5850abfd956b39bede6efad5954bdad",name:"paymentMethodType",value:f.SEZZLE,checked:(null===(e=null==d?void 0:d.selectedPaymentMethod)||void 0===e?void 0:e.type)===f.SEZZLE,label:i("justifi-sezzle-payment-method",{ref:e=>this.sezzlePaymentMethodRef=e}),"onRadio-click":()=>{var e;null===(e=this.sezzlePaymentMethodRef)||void 0===e||e.handleSelectionClick()}}),this.availablePaymentMethods.includes(f.PLAID)&&!this.disableBnpl&&i("justifi-radio-list-item",{key:"ac0ac64e9f7586764e3f5671c74794c80ffcff54",name:"paymentMethodType",value:f.PLAID,checked:(null===(t=null==d?void 0:d.selectedPaymentMethod)||void 0===t?void 0:t.type)===f.PLAID,label:i("justifi-plaid-payment-method",{ref:e=>this.plaidPaymentMethodRef=e}),"onRadio-click":()=>{var e;null===(e=this.plaidPaymentMethodRef)||void 0===e||e.handleSelectionClick()}}),i("internal-tokenize-payment-method",{key:"894e7a5bfef2eefa5d045928bb6fab3b1f39bd5e",ref:e=>this.tokenizePaymentMethodRef=e,authToken:this.authToken,accountId:d.accountId,disableCreditCard:this.disableCreditCard,disableBankAccount:this.disableBankAccount,hideCardBillingForm:this.hideCardBillingForm,hideBankAccountBillingForm:this.hideBankAccountBillingForm,hideSubmitButton:!0,paymentMethodGroupId:d.paymentMethodGroupId}))))),i("div",{key:"2121952545d38693f11426ef8146b39956d4f427",class:"mt-4"},i("justifi-button",{key:"5e7cf3c699048943df68c0506a34617d0b14bf07",text:"Pay",type:"submit",variant:"primary",clickHandler:e=>this.submit(e),disabled:this.isSubmitting,isLoading:this.isSubmitting,customStyle:{width:"100%",textAlign:"center"}})))))}static get watchers(){return{authToken:["propChanged"],checkoutId:["propChanged"],disableCreditCard:["propChanged"],disableBankAccount:["propChanged"],disablePaymentMethodGroup:["propChanged"]}}};export{h as justifi_checkout}
1
+ import{r as e,c as t,h as i}from"./p-CV0Pyo1O.js";import{c as a,J as s}from"./p-zGGZEiGQ.js";import{c as d}from"./p-Daew0gTO.js";import{c}from"./p-D3V9AE6o.js";import{S as o}from"./p-BqNNwq6C.js";import"./p-CZfYo5-1.js";import{P as f}from"./p-DkoufM1t.js";import"./p-qNXIkzDE.js";import"./p-55QcjheA.js";import"./p-DVJaoI_m.js";import"./p-D8GTwl9v.js";import"./p-MeSAYDNh.js";import"./p-HXpYMWUU.js";import"./p-Cjcsf8ku.js";import"./p-_BHErKTQ.js";import"./p-BH0Xfn-F.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";const h=class{constructor(i){e(this,i),this.errorEvent=t(this,"error-event",7),this.loadedEvent=t(this,"loaded",7),this.submitEvent=t(this,"submit-event",7),this.availablePaymentMethods=[],this.errorMessage="",this.insuranceToggled=!1,this.isSubmitting=!1,this.disableBankAccount=!1,this.disableBnpl=!1,this.disableCreditCard=!1,this.disablePaymentMethodGroup=!1,this.hideBankAccountBillingForm=!1,this.hideCardBillingForm=!1}propChanged(){this.updateStore()}connectedCallback(){this.authToken&&this.checkoutId&&this.updateStore()}componentWillLoad(){a(),this.analytics=new s(this)}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}checkoutComplete(e){this.isSubmitting=!1}checkoutError(e){console.error("[justifi-checkout] error-event received",null==e?void 0:e.detail),this.isSubmitting=!1}checkoutChanged(e){this.availablePaymentMethods=this.disableBnpl?e.detail.availablePaymentMethodTypes.filter((e=>e!==f.SEZZLE)):e.detail.availablePaymentMethodTypes}async fillBillingForm(e){var t;d.billingFormFields=e,null===(t=this.tokenizePaymentMethodRef)||void 0===t||t.fillBillingForm(e)}async validate(){var e;return{isValid:await(null===(e=this.modularCheckoutRef)||void 0===e?void 0:e.validate())}}updateStore(){d.checkoutId=this.checkoutId,d.authToken=this.authToken,d.disableCreditCard=this.disableCreditCard,d.disableBankAccount=this.disableBankAccount,d.disablePaymentMethodGroup=this.disablePaymentMethodGroup}async submit(e){var t;this.isSubmitting=!0,null===(t=this.modularCheckoutRef)||void 0===t||t.submitCheckout(d.billingFormFields)}get showPaymentTypeHeader(){return!this.disableCreditCard&&!this.disableBankAccount}render(){var e,t;return i(o,{key:"6bbc4c4997d14ac9040b8f88075a7e9b53208d4c"},i("justifi-modular-checkout",{key:"9b11e7df277e5e9f70cd8928f865a2e62cfc8293",ref:e=>{this.modularCheckoutRef=e},authToken:this.authToken,checkoutId:this.checkoutId,preCompleteHook:this.preCompleteHook},i("div",{key:"c64981c31fd2d022f886b0613bd47bd0b0fe5f2a",class:"row gy-3 jfi-checkout-core"},i("div",{key:"8f01af25b281a19f7fc83451a44f63836efadc20",class:"col-12",part:c},i("justifi-header",{key:"d729ed0b26c94e74d8ce824fcf97bd3002e3a9d0",text:"Summary",level:"h2",class:"fs-5 fw-bold pb-3"}),i("section",{key:"9cc9863b1dd2531bda52e609bba5c7c8f9883cb1"},i("justifi-checkout-summary",{key:"00f36de593e245982bfe03c8867881fedfb7d43f"}))),i("div",{key:"3fe5390d7b8b2fbcdbfff4b71d4b7c43ddae9ff6",class:"col-12 mt-4"},i("slot",{key:"84fa5a7e7772124d7fa61a9317499618850eb0bb",name:"insurance"})),i("div",{key:"c8d1553c6041c0e000eab9dc953a23aa089a3f90",class:"col-12 mt-4"},i("justifi-header",{key:"a08fc163ba437f767ab88d78ac55ae003b09a567",text:"Payment",level:"h2",class:"fs-5 fw-bold pb-3"}),this.showPaymentTypeHeader&&i("justifi-header",{key:"bff5fc2986d37bbe49a5253d43db55663ee7be74",text:"Select payment type",level:"h3",class:"fs-6 fw-bold lh-lg"}),i("div",{key:"f5ca969400444639b09e423b154e47abf89c731f",class:"d-flex flex-column"},i("section",{key:"b70209321ebefd161ae3113293c62fe953913f2e"},i("div",{key:"4df7539a9b8d6b52d47ad32974a59ab2d366b4b2"},this.availablePaymentMethods.includes(f.APPLE_PAY)&&i("div",{key:"023deb9a1d025e36cc2b07c3ea8144e0068ea470",class:"mb-3"},i("justifi-apple-pay",{key:"4e52440f329bae25194e71fa30190218f5c1cecb"})),this.availablePaymentMethods.includes(f.GOOGLE_PAY)&&i("div",{key:"83e12debb25e0ef095ca40d87054411396238754",class:"mb-3"},i("justifi-google-pay",{key:"ed6312e39ff4a98c819cf1853f416c6fbf845323",ref:e=>this.googlePayRef=e})),i("justifi-saved-payment-methods",{key:"e059fda26ec54c4f908754663fa23f26c3df8f0c"}),this.availablePaymentMethods.includes(f.SEZZLE)&&i("justifi-radio-list-item",{key:"3d836539d5850abfd956b39bede6efad5954bdad",name:"paymentMethodType",value:f.SEZZLE,checked:(null===(e=null==d?void 0:d.selectedPaymentMethod)||void 0===e?void 0:e.type)===f.SEZZLE,label:i("justifi-sezzle-payment-method",{ref:e=>this.sezzlePaymentMethodRef=e}),"onRadio-click":()=>{var e;null===(e=this.sezzlePaymentMethodRef)||void 0===e||e.handleSelectionClick()}}),this.availablePaymentMethods.includes(f.PLAID)&&!this.disableBnpl&&i("justifi-radio-list-item",{key:"ac0ac64e9f7586764e3f5671c74794c80ffcff54",name:"paymentMethodType",value:f.PLAID,checked:(null===(t=null==d?void 0:d.selectedPaymentMethod)||void 0===t?void 0:t.type)===f.PLAID,label:i("justifi-plaid-payment-method",{ref:e=>this.plaidPaymentMethodRef=e}),"onRadio-click":()=>{var e;null===(e=this.plaidPaymentMethodRef)||void 0===e||e.handleSelectionClick()}}),i("internal-tokenize-payment-method",{key:"894e7a5bfef2eefa5d045928bb6fab3b1f39bd5e",ref:e=>this.tokenizePaymentMethodRef=e,authToken:this.authToken,accountId:d.accountId,disableCreditCard:this.disableCreditCard,disableBankAccount:this.disableBankAccount,hideCardBillingForm:this.hideCardBillingForm,hideBankAccountBillingForm:this.hideBankAccountBillingForm,hideSubmitButton:!0,paymentMethodGroupId:d.paymentMethodGroupId}))))),i("div",{key:"2121952545d38693f11426ef8146b39956d4f427",class:"mt-4"},i("justifi-button",{key:"5e7cf3c699048943df68c0506a34617d0b14bf07",text:"Pay",type:"submit",variant:"primary",clickHandler:e=>this.submit(e),disabled:this.isSubmitting,isLoading:this.isSubmitting,customStyle:{width:"100%",textAlign:"center"}})))))}static get watchers(){return{authToken:["propChanged"],checkoutId:["propChanged"],disableCreditCard:["propChanged"],disableBankAccount:["propChanged"],disablePaymentMethodGroup:["propChanged"]}}};export{h as justifi_checkout}
@@ -0,0 +1 @@
1
+ import{r as t,c as s,h as e,H as a}from"./p-CV0Pyo1O.js";import{v as i,w as o,x as c,y as r,z as h,A as n}from"./p-D3V9AE6o.js";import{F as f}from"./p-DSmuL_bZ.js";import{F as l}from"./p-BU9iZ8OM.js";import"./p-CZfYo5-1.js";import{f as p}from"./p-MeSAYDNh.js";import"./p-HXpYMWUU.js";const m=class{constructor(e){t(this,e),this.formControlInput=s(this,"formControlInput",7),this.formControlBlur=s(this,"formControlBlur",7),this.isFocused=!1,this.defaultValue="0",this.formatRawValue=t=>t.replace(/\D/g,""),this.formatDisplayValue=t=>p(+t,void 0,!0),this.updateInput=t=>{const s=this.formControl.name,e=this.formatRawValue(t);this.formControl.value=this.formatDisplayValue(e),this.inputHandler(s,e),this.formControlInput.emit({name:s,value:e})}}handleDefaultValueChange(t){this.updateInput(t)}componentDidLoad(){this.updateInput(this.defaultValue)}get inputPart(){return this.errorText?i:this.disabled?o:this.isFocused?c:r}render(){return e(a,{key:"2c0e7cdc644343a61c87852733ee805739ecaaa1"},e("div",{key:"998eb7ec3125af116e876e837982d2f37285ce4c",class:"form-group d-flex flex-column"},e("label",{key:"90cff5cbb09cf4f39c04c12c10eae45a6ada97c5",part:h,class:"form-label",htmlFor:this.name},this.label),e(f,{key:"be23587b830c4e6e96abcd53a78108543c5ad1c4",name:this.name,helpText:this.helpText}),e("div",{key:"6f47b9e86f4af9c641f26dc631fabc917bc06e8c",class:"input-group"},e("span",{key:"0e39a178edf94795851c0c52dc054a8a61c2643b",class:"input-group-text",part:n},"$"),e("input",{key:"8bb615087578002c9990dbf7528536ae2cb7aa01",ref:t=>this.formControl=t,id:this.name,name:this.name,onFocus:()=>this.isFocused=!0,onBlur:()=>{this.isFocused=!1,this.formControlBlur.emit()},onInput:t=>this.updateInput(t.target.value),onKeyDown:this.keyDownHandler,onPaste:this.keyDownHandler,maxLength:this.maxLength,part:this.inputPart,class:this.errorText?"form-control is-invalid":"form-control",type:"text",disabled:this.disabled})),e(l,{key:"d97f18500d2fe6cf23bad8a872f1d0e965ccb114",errorText:this.errorText,name:this.name})))}static get watchers(){return{defaultValue:["handleDefaultValueChange"]}}};export{m as form_control_monetary}
@@ -0,0 +1 @@
1
+ import{r as e,h as a}from"./p-CV0Pyo1O.js";import{l as t}from"./p-C_ifLmT1.js";import"./p-DVJaoI_m.js";import{c as s,a as l}from"./p-MeSAYDNh.js";import"./p-Cjcsf8ku.js";import{I as i,a as d}from"./p-_BHErKTQ.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import{f as c,p as o,c as r}from"./p-CpGEMRkH.js";import{f as p,a as b}from"./p-D3V9AE6o.js";import{S as f}from"./p-BqNNwq6C.js";import"./p-CZfYo5-1.js";import"./p-BFTU3MAI.js";import"./p-D8GTwl9v.js";import"./p-HXpYMWUU.js";const m=class{constructor(a){e(this,a),this.setParamsOnChange=(e,a)=>{c[e]=a},this.handleDateInput=(e,a)=>{const t=s(a,{setExactTime:!0});this.setParamsOnChange(e,t)}}componentWillLoad(){this.debouncedSetParamsOnChange=t.debounce(this.setParamsOnChange,300),Object.entries({status:this.checkoutStatus,payment_mode:this.paymentMode,checkout_id:this.checkoutId,successful_payment_id:this.successfulPaymentId,created_after:this.createdAfter,created_before:this.createdBefore}).forEach((([e,a])=>{a&&(o[e]=a)}))}get checkoutStatusOptions(){return[{label:"All",value:""},{label:"Created",value:i.created},{label:"Completed",value:i.completed},{label:"Attempted",value:i.attempted},{label:"Expired",value:i.expired}]}get checkoutPaymentModeOptions(){return[{label:"All",value:""},{label:"E-commerce",value:d.ecom},{label:"BNPL",value:d.bnpl},{label:"Apple Pay",value:d.apple_pay}]}render(){const e=Object.assign({},c);return a(f,{key:"8b9b9383e9b15d440fc3555bf3071ddb633cfb8b"},a("table-filters-menu",{key:"588ab98c35a944eb4fd4855dc603f3f988fb8411",params:e,clearParams:r,part:p},a("div",{key:"a52e4c7ed908568108031c9e43f41563dcec099c",class:"grid-cols-2 gap-3 p-1"},a("div",{key:"26bdc175f9bb5c0d53e5d979a31ddbc60c8b1101",class:"p-2"},a("form-control-text",{key:"46bf2d112facf89bb820a4f67936de87832e8283",name:"checkout_id",label:"Checkout ID",inputHandler:this.debouncedSetParamsOnChange,defaultValue:this.checkoutId||c.checkout_id,disabled:!!this.checkoutId,part:b})),a("div",{key:"441a50bf1ad6be8efc77d197927920ea8e4454de",class:"p-2"},a("form-control-text",{key:"533c6cd714268d50eb212ea7a32538e68236b03a",name:"successful_payment_id",label:"Successful Payment ID",inputHandler:this.debouncedSetParamsOnChange,defaultValue:this.successfulPaymentId||c.successful_payment_id,disabled:!!this.successfulPaymentId,part:b})),a("div",{key:"bfd92f93d3fa3380ce858425f0032cb1fa6155e2",class:"p-2"},a("form-control-select",{key:"b35919ba574500a8921a6396c8c8e74b5a3555a4",name:"status",label:"Status",options:this.checkoutStatusOptions,inputHandler:this.setParamsOnChange,defaultValue:this.checkoutStatus||c.status||"",disabled:!!this.checkoutStatus,part:b})),a("div",{key:"19dc994790222c1e7951275a93722affd30f3309",class:"p-2"},a("form-control-select",{key:"6d5719c8080b2d2899b189ebbceeb538a2d4e6cb",name:"payment_mode",label:"Payment Mode",options:this.checkoutPaymentModeOptions,inputHandler:this.setParamsOnChange,defaultValue:this.paymentMode||c.payment_mode||"",disabled:!!this.paymentMode,part:b})),a("div",{key:"297fdb846109a9f88e6ba72fbf2d84aabadfcd11",class:"p-2"},a("form-control-date",{key:"1385937605ae2d547a7c789b2a03f70cb53c59ef",name:"created_after",label:"Created After",inputHandler:this.handleDateInput,defaultValue:l(this.createdAfter,{showInputDateTime:!0})||l(c.created_after,{showInputDateTime:!0}),showTime:!0,disabled:!!this.createdAfter,part:b})),a("div",{key:"b4bb5a4b6a5125d60ebb8820e0660d8505ecfc63",class:"p-2"},a("form-control-date",{key:"91a48596c2411dfd185b791643a3329c81300628",name:"created_before",label:"Created Before",inputHandler:this.handleDateInput,defaultValue:l(this.createdBefore,{showInputDateTime:!0})||l(c.created_before,{showInputDateTime:!0}),showTime:!0,disabled:!!this.createdBefore,part:b})))))}};export{m as justifi_checkouts_list_filters}
@@ -0,0 +1 @@
1
+ import{r as t,c as s,h as e,H as a}from"./p-CV0Pyo1O.js";import{M as i,N as h,O as r,P as o,Q as c,z as f}from"./p-D3V9AE6o.js";const l=class{constructor(e){t(this,e),this.formControlInput=s(this,"formControlInput",7),this.formControlBlur=s(this,"formControlBlur",7),this.isFocused=!1,this.inputHandler=()=>{},this.disabled=!1,this.errorText="",this.handleFormControlInput=t=>{const s=t.target.getAttribute("name");this.inputHandler(s,this.value),this.formControlInput.emit({name:s,value:this.value})}}get part(){return this.errorText?i:this.isFocused&&this.checked?h:this.checked?r:this.isFocused?o:c}render(){return e(a,{key:"fcb9bd7844b2e2f2e6407a8e61518c6ace87a5a2",class:"form-group d-flex flex-column"},e("div",{key:"189a20da8a1731e58c6acfefc1b9ee3c69fab51b",class:"form-check"},e("input",{key:"10d4f36dda13f27ee7e142b5e7f6d968a959fc99",ref:t=>this.radioElement=t,type:"radio",id:`${this.name}-${this.value}`,name:this.name,onFocus:()=>this.isFocused=!0,onBlur:()=>{this.isFocused=!1,this.formControlBlur.emit()},onChange:this.handleFormControlInput,part:this.part,class:this.errorText?"form-check-input is-invalid":"form-check-input",disabled:this.disabled,value:this.value,checked:this.checked}),e("label",{key:"3b197897facca29a319ed9837657e9f21b1bbf5b",class:"form-check-label",htmlFor:`${this.name}-${this.value}`,part:f},this.label)),e("form-control-help-text",{key:"9a6916c08a3a36ab071d80d62465e9278aa7ab97",helpText:this.helpText,name:this.name}),e("form-control-error-text",{key:"ef989f755e5abd3d4a4569fb31dcdb534b0ceee2",errorText:this.errorText,name:this.name}))}};export{l as form_control_radio}
@@ -0,0 +1 @@
1
+ import{r as e,h as a}from"./p-CV0Pyo1O.js";import{f as t,p as s,c as r}from"./p-AMVhBsGv.js";import{f as l,a as d}from"./p-D3V9AE6o.js";import{S as o}from"./p-BqNNwq6C.js";import"./p-CZfYo5-1.js";import{c as i,a as p}from"./p-MeSAYDNh.js";import"./p-DVJaoI_m.js";import"./p-Cjcsf8ku.js";import{P as f}from"./p-_BHErKTQ.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import"./p-D8GTwl9v.js";import"./p-HXpYMWUU.js";const c=class{constructor(a){e(this,a),this.setParamsOnChange=(e,a)=>{t[e]=a},this.handleDateInput=(e,a)=>{const t=i(a,{setEndOfDay:!0});this.setParamsOnChange(e,t)}}componentWillLoad(){Object.entries({status:this.status,created_after:this.createdAfter,created_before:this.createdBefore}).forEach((([e,a])=>{a&&(s[e]=a)}))}get statusOptions(){return[{label:"All",value:""},{label:f.paid,value:"paid"},{label:f.failed,value:"failed"},{label:f.forwarded,value:"forwarded"},{label:f.scheduled,value:"scheduled"},{label:f.in_transit,value:"in_transit"},{label:f.canceled,value:"canceled"}]}render(){const e=Object.assign({},t);return a(o,{key:"f8e989bee50f9d877f46081060811c1e82d73fef"},a("table-filters-menu",{key:"58f57d4b7cc46b06b90591cd978b83303bddd699",params:e,clearParams:r,part:l},a("div",{key:"4f8ce19e11804635b63e604968305fb331e82e8b",class:"grid-cols-2 gap-3 p-1"},a("div",{key:"750eb629811a2695c94b12a055bfa583666fa9a0",class:"p-2"},a("form-control-select",{key:"741c7cea7c16d5f750c4fb70036db61451f694b1",name:"status",label:"Status",options:this.statusOptions,inputHandler:this.setParamsOnChange,defaultValue:this.status||t.status||"",disabled:!!this.status,part:d})),a("div",{key:"1da6031e4521d46c35819a3dca111e576f627719",class:"p-2"},a("form-control-date",{key:"5b1f782e23da892428b0e8c4ec863a5119842841",name:"created_after",label:"Created After",inputHandler:this.handleDateInput,defaultValue:p(this.createdAfter,{showInputDate:!0})||p(t.created_after,{showInputDate:!0}),disabled:!!this.createdAfter,part:d})),a("div",{key:"a1b19375d9e7cd6ec6aaf86daa0b50f0af41aea6",class:"p-2"},a("form-control-date",{key:"910a6d4dd397c09eaba5037f387014266de019f4",name:"created_before",label:"Created Before",inputHandler:this.handleDateInput,defaultValue:p(this.createdBefore,{showInputDate:!0})||p(t.created_before,{showInputDate:!0}),disabled:!!this.createdBefore,part:d})))))}};export{c as justifi_payouts_list_filters}
@@ -0,0 +1 @@
1
+ import{r as t,c as s,h as i,H as a}from"./p-CV0Pyo1O.js";import{I as e}from"./p-Ce_F4E0f.js";import{C as h}from"./p-CVaOFfrI.js";import{G as r,z as o,A as n,v as c,w as f,x as l}from"./p-D3V9AE6o.js";import{F as d}from"./p-DSmuL_bZ.js";import{F as m}from"./p-BU9iZ8OM.js";import"./p-CZfYo5-1.js";const p=class{constructor(i){t(this,i),this.formControlInput=s(this,"formControlInput",7),this.formControlBlur=s(this,"formControlBlur",7),this.imask=null,this.isFocused=!1,this.errorText="",this.defaultValue="0",this.inputHandler=()=>{},this.maskOptions=h.DECIMAL,this.disabled=!1,this.initializeIMask=()=>{this.textInput&&(this.imask=e(this.textInput,this.maskOptions),this.imask.on("accept",(()=>{const t=this.imask.unmaskedValue;this.inputHandler(this.name,t),this.formControlInput.emit({name:this.name,value:t})})),this.textInput.addEventListener("blur",(()=>this.formControlBlur.emit())))},this.handleFormControlInput=t=>{const s=t.target.getAttribute("name");this.formControlInput.emit({name:s,value:this.imask.unmaskedValue})},this.updateInput=t=>{this.imask&&(this.imask.value=String(t))}}handleDefaultValueChange(t){this.updateInput(t)}componentDidLoad(){this.initializeIMask(),this.updateInput(this.defaultValue)}disconnectedCallback(){var t;null===(t=this.imask)||void 0===t||t.destroy()}get inputPart(){let t=r;return this.errorText&&(t=c),this.disabled&&(t=f),this.isFocused&&(t=l),t}render(){return i(a,{key:"7a72954c74f3cb31f92d565835de4aceb874a1b5"},i("div",{key:"e05612ec4b1b195a24f5a2d2a00ca5b284b4c2f7",class:"form-group d-flex flex-column"},i("label",{key:"ffabdebea58878f550cad78430783bcb8372f2c1",part:o,class:"form-label",htmlFor:this.name},this.label),i("div",{key:"3593ef8b4adda873a7d6b1789253bc6e1748dcfc",class:"input-group"},i("span",{key:"b42f4a51f38451ee36fff437b3a60bd1292d6307",class:"input-group-text",part:n},"$"),i("input",{key:"d49072c9c3653540fc8edca8a8dd86ad34bef902",ref:t=>this.textInput=t,id:this.name,name:this.name,onFocus:()=>this.isFocused=!0,onBlur:()=>{this.isFocused=!1,this.formControlBlur.emit()},onInput:this.handleFormControlInput,part:this.inputPart,class:this.errorText?"form-control monetary is-invalid":"form-control monetary",type:"text",disabled:this.disabled})),i(d,{key:"d714b88d923f5f38f1b66620c5513ce7c82a7ef0",helpText:this.helpText,name:this.name}),i(m,{key:"47b9d96f588785bb2597b16a685c18889e1945c1",errorText:this.errorText,name:this.name})))}static get watchers(){return{defaultValue:["handleDefaultValueChange"]}}};export{p as form_control_monetary_provisioning}
@@ -0,0 +1 @@
1
+ import{r as e,h as t,H as a,c as i,g as s}from"./p-CV0Pyo1O.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{C as l}from"./p-Cjcsf8ku.js";import{E as o,m as n,n as r,o as c}from"./p-_BHErKTQ.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import{a as d}from"./p-Bt4GjEWL.js";import"./p-XYgDHrVL.js";import{n as h}from"./p-BnjCmwMr.js";import{t as u,F as f,b,ab as m,q as p,ak as v,y,z as k,v as L,w as g,x,a2 as T,a3 as w}from"./p-D3V9AE6o.js";import{s as _,e as N,d as j}from"./p-MeSAYDNh.js";import{S as A}from"./p-C0tps2ph.js";import"./p-CZfYo5-1.js";import{F as C}from"./p-BU9iZ8OM.js";import{u as E,a as H,b as V}from"./p-C6o0liMT.js";import{P as D,I}from"./p-CVaOFfrI.js";import{c as O}from"./p-_-2E_vYf.js";import{c as M,d as F,e as B}from"./p-R0FDNhyd.js";import{I as R}from"./p--UanYWb-.js";import{B as P}from"./p-o83Uy7sW.js";import{S}from"./p-BqNNwq6C.js";import{P as Z}from"./p-DzeWzcho.js";import"./p-D8GTwl9v.js";import"./p-D2muobcE.js";import"./p-55QcjheA.js";const U=class{constructor(t){e(this,t)}render(){return t("div",{key:"7f9ea576aad16f3c2ea45c987a38878ea65f2df2",class:"row gy-3"},t("div",{key:"316fe3f20df7c7dce2b8903e6073e0fe7920e5e8",class:"col-12"},t("form-control-file",{key:"320d6b7f3de2cfeeb30eb1e08ca4122123854ffd",name:"voided_check",label:"Voided Check",documentType:o.voidedCheck,inputHandler:this.inputHandler,onFileSelected:this.storeFiles,errorText:this.errors.voided_check,multiple:!0})),t("div",{key:"f33a936c61c14c701e40d375e4dfc4c554b8293c",class:"col-12"},t("form-control-file",{key:"1e160d8211a71175d6a45b10590fb2c8774f61e1",name:"bank_statement",label:"Bank Statement",documentType:o.bankStatement,inputHandler:this.inputHandler,onFileSelected:this.storeFiles,errorText:this.errors.bank_statement,multiple:!0})))}},Y=class{constructor(t){e(this,t)}render(){var e,a,i,s,l,o;return t("div",{key:"5dc7139f54d11979410d0d67ca29e65b02f30200",class:"row gy-3"},t("div",{key:"118f15bf02855b24baec5ce2a2c3cf5b241b3da4",class:"col-12"},this.formDisabled?t("bank-account-read-only-value",{label:"Bank Name",value:null===(e=this.defaultValue)||void 0===e?void 0:e.bank_name}):t("form-control-text",{name:"bank_name",label:"Bank Name",defaultValue:this.defaultValue.bank_name,errorText:this.errors.bank_name,inputHandler:this.inputHandler})),t("div",{key:"db03eccee03ec4b7d0de637306315982a2cd770d",class:"col-12"},this.formDisabled?t("bank-account-read-only-value",{label:"Nickname",value:null===(a=this.defaultValue)||void 0===a?void 0:a.nickname}):t("form-control-text",{name:"nickname",label:"Nickname",defaultValue:this.defaultValue.nickname,errorText:this.errors.nickname,inputHandler:this.inputHandler})),t("div",{key:"217120e0052b8ee41cac8f901ac4d9742b0c6ea9",class:"col-12"},this.formDisabled?t("bank-account-read-only-value",{label:"Account Owner Name",value:null===(i=this.defaultValue)||void 0===i?void 0:i.account_owner_name}):t("form-control-text",{name:"account_owner_name",label:"Account Owner Name",defaultValue:this.defaultValue.account_owner_name,errorText:this.errors.account_owner_name,inputHandler:this.inputHandler})),t("div",{key:"f589511545d6262966a6fa2888cb78babacfb770",class:"col-12"},this.formDisabled?t("bank-account-read-only-value",{label:"Account Type",value:null===(s=this.defaultValue)||void 0===s?void 0:s.account_type}):t("form-control-select",{name:"account_type",label:"Account Type",options:d,defaultValue:this.defaultValue.account_type,errorText:this.errors.account_type,inputHandler:this.inputHandler})),t("div",{key:"24df83bb2666cee381c266608c43f3fd729db4cf",class:"col-6"},this.formDisabled?t("bank-account-read-only-value",{label:"Account Number",value:(null===(l=this.defaultValue)||void 0===l?void 0:l.account_number_last4)?`**** ${this.defaultValue.account_number_last4}`:""}):t("form-control-text",{name:"account_number",label:"Account Number",defaultValue:this.defaultValue.account_number,maxLength:17,errorText:this.errors.account_number,inputHandler:this.inputHandler,keyDownHandler:h,helpText:"Please copy the account number as shown on your statement/check. Do not include spaces or dashes."})),t("div",{key:"75fe11d71e57707d088f8a90a250621fce82647f",class:"col-6"},this.formDisabled?t("bank-account-read-only-value",{label:"Routing Number",value:(null===(o=this.defaultValue)||void 0===o?void 0:o.routing_number)||""}):t("form-control-text",{name:"routing_number",label:"Routing Number",defaultValue:this.defaultValue.routing_number,maxLength:9,errorText:this.errors.routing_number,inputHandler:this.inputHandler,keyDownHandler:h,helpText:"A valid routing number is nine digits. Please include any leading or trailing zeroes."})))}},z=class{constructor(t){e(this,t)}render(){var e,a,i,s,l,o,n;return t("div",{key:"34cbf10449df73748095fd7122d0ae1355a83e13",class:"row gy-3"},t("div",{key:"607cc5cbc70fdd2d5a325bef7002a44740394282",class:"col-12"},this.formDisabled?t("bank-account-read-only-value",{label:"Bank Name",value:null===(e=this.defaultValue)||void 0===e?void 0:e.bank_name}):t("form-control-text",{name:"bank_name",label:"Bank Name",defaultValue:this.defaultValue.bank_name,errorText:this.errors.bank_name,inputHandler:this.inputHandler})),t("div",{key:"f57f4cd733f2dd439d6d83f32078371618f5fa06",class:"col-12"},this.formDisabled?t("bank-account-read-only-value",{label:"Nickname",value:null===(a=this.defaultValue)||void 0===a?void 0:a.nickname}):t("form-control-text",{name:"nickname",label:"Nickname",defaultValue:this.defaultValue.nickname,errorText:this.errors.nickname,inputHandler:this.inputHandler})),t("div",{key:"b92dface0116321ea990bfcaf1b036b5629385db",class:"col-12"},this.formDisabled?t("bank-account-read-only-value",{label:"Account Owner Name",value:null===(i=this.defaultValue)||void 0===i?void 0:i.account_owner_name}):t("form-control-text",{name:"account_owner_name",label:"Account Owner Name",defaultValue:this.defaultValue.account_owner_name,errorText:this.errors.account_owner_name,inputHandler:this.inputHandler})),t("div",{key:"45d68efa47de76ee420cedfb97e82f498a2de97b",class:"col-12"},this.formDisabled?t("bank-account-read-only-value",{label:"Account Type",value:null===(s=this.defaultValue)||void 0===s?void 0:s.account_type}):t("form-control-select",{name:"account_type",label:"Account Type",options:d,defaultValue:this.defaultValue.account_type,errorText:this.errors.account_type,inputHandler:this.inputHandler})),t("div",{key:"8419925e8470d63d506e1f7e82ccdf1a1132ecc0",class:"col-3"},this.formDisabled?t("bank-account-read-only-value",{label:"Transit Number",value:(null===(l=this.defaultValue)||void 0===l?void 0:l.transit_number)||""}):t("form-control-text",{name:"transit_number",label:"Transit Number",defaultValue:this.defaultValue.transit_number,maxLength:5,errorText:this.errors.transit_number,inputHandler:this.inputHandler,keyDownHandler:h,helpText:"5 digits"})),t("div",{key:"aa6e83c409e0cf93f1903394f63c0b719ec8808e",class:"col-3"},this.formDisabled?t("bank-account-read-only-value",{label:"Institution Number",value:(null===(o=this.defaultValue)||void 0===o?void 0:o.institution_number)||""}):t("form-control-text",{name:"institution_number",label:"Institution Number",defaultValue:this.defaultValue.institution_number,maxLength:3,errorText:this.errors.institution_number,inputHandler:this.inputHandler,keyDownHandler:h,helpText:"3 digits"})),t("div",{key:"029058c023daca9d0488f45478af6edafe359df7",class:"col-6"},this.formDisabled?t("bank-account-read-only-value",{label:"Account Number",value:(null===(n=this.defaultValue)||void 0===n?void 0:n.account_number_last4)?`**** ${this.defaultValue.account_number_last4}`:""}):t("form-control-text",{name:"account_number",label:"Account Number",defaultValue:this.defaultValue.account_number,maxLength:17,errorText:this.errors.account_number,inputHandler:this.inputHandler,keyDownHandler:h,helpText:"Please copy the account number as shown on your statement. Do not include spaces or dashes."})))}},W=class{constructor(t){e(this,t)}render(){return t("div",{key:"ad9eadcf49dbc67e51cd814d3ded334a587cc17c"},t("label",{key:"b8ba3d8b7ef9fc33e0e0870f71b7df5dbfae4759",class:"form-label",part:u},this.label),t("div",{key:"1839bdadb96b3c814c73991530497f9a7be6a10d",part:u},this.value||""))}},q=class{constructor(t){e(this,t),this.documents=[],this.isLoading=!1}render(){return this.isLoading?t(A,{height:"50px"}):this.documents.length?t(a,null,t("div",{class:"card",part:f},t("div",{class:"card-body"},t("h5",{class:"card-title",part:b},"Documents Already on File"),t("div",{class:"table-responsive"},t("table",{class:"table table-sm table-borderless",part:m},t("thead",null,t("tr",null,t("th",{style:{width:"25%"},part:p,scope:"col"},"File Name"),t("th",{style:{width:"25%"},part:p,scope:"col"},"File Type"),t("th",{style:{width:"25%"},part:p,scope:"col"},"Document Type"),t("th",{style:{width:"25%"},part:p,scope:"col"},"Date Uploaded"))),t("tbody",null,this.documents.sort(((e,t)=>e.document_type.localeCompare(t.document_type))).map(((e,a)=>t("tr",{class:0===a?"border-bottom border-top":"border-bottom"},t("td",{part:v},e.file_name),t("td",{part:v},e.file_type),t("td",{part:v},_(e.document_type)),t("td",{part:v},`${N(e.created_at)} - ${j(e.created_at)}`))))))))),t("hr",null)):null}},$=class{constructor(t){e(this,t),this.formControlInput=i(this,"formControlInput",7),this.formControlBlur=i(this,"formControlBlur",7),this.fileSelected=i(this,"fileSelected",7),this.isFocused=!1,this.errorText="",this.inputHandler=()=>{},this.disabled=!1,this.handleFormControlInput=e=>{const t=e.target,a=t.getAttribute("name");this.inputHandler(a,t.value),this.formControlInput.emit({name:a,value:t.value})},this.changeHandler=()=>{const e=this.fileInput.files;e&&this.fileSelected.emit({fileList:e,document_type:this.documentType})}}componentDidLoad(){this.fileInput=this.el.querySelector("input")}get part(){let e=y;return this.errorText&&(e=L),this.disabled&&(e=g),this.isFocused&&(e=x),e}render(){return t(a,{key:"5dae73a138845ac8e08102905fb9ccae526519b5"},t("div",{key:"38fa7c7c23abf18530a1508e93dee487382f8456",class:"form-group d-flex flex-column"},t("div",{key:"3c90cfef275acbc2383f3af046b342408e524659",class:"d-flex align-items-start gap-2"},t("label",{key:"65af257367512c58f75bff6ecc09248148c0929f",part:k,class:"form-label",htmlFor:this.name},this.label),t("form-control-tooltip",{key:"d54ddf27dd6197f52487e342963e442dc04aa459",helpText:this.helpText})),t("input",{key:"033108ddee4cac2aca98bcde260ab391e24b8ce5",ref:e=>this.fileInput=e,type:"file",name:this.name,part:this.part,class:this.errorText?"form-control is-invalid":"form-control",multiple:this.multiple,disabled:this.disabled,onChange:this.changeHandler,onInput:this.handleFormControlInput,onFocus:()=>this.isFocused=!0,onBlur:()=>{this.isFocused=!1,this.formControlBlur.emit()}}),t(C,{key:"81aec26bc0781bbcfe531d37c0dd4bf6966ef9ce",errorText:this.errorText,name:this.name})))}get el(){return s(this)}},G=class{constructor(t){e(this,t),this.isEditingIdentification=!1,this.inputHandler=(e,t)=>{E(this.formController,{[e]:t})},this.onAddressFormUpdate=e=>{H(this.formController,Object.assign(Object.assign({},this.formController.values.getValue().address),e))}}render(){var e,a,i,s,l,o,n,r,c;return t("form",{key:"a9c0f6332bf302d5eb9f93c4ca045d572a40468f"},t("fieldset",{key:"115c564826335a9c7b670bbc0409912c3eb7a4aa"},t("div",{key:"6de8909b4b2f3c7d8ec4665aad77ef59cdf035b4",class:"d-flex align-items-center gap-2"},t("legend",{key:"bb8b5a3775eae450a866356a9e149a0bf57b5699",class:"mb-0",part:b},"Representative"),t("form-control-tooltip",{key:"a0296d4a3c35a039525f39501e117ee6fdd12257",helpText:"The representative for your business needs to be someone who has significant control over managing your business’s finance. You will have an opportunity to add owners later in the form."})),t("hr",{key:"abbee22f5664275f27dd8eeb2b12c87b059ff024",class:"mt-2"}),t("div",{key:"e165ff125df62dc1d22b7329fe7fe2ff200cbbb3",class:"row gy-3"},t("div",{key:"114ff752eeda3ffa90529ff6bc675b874f543336",class:"col-12 col-md-8"},t("form-control-text",{key:"8b6ce9f4a327ca5282aa32c226f671945aa10404",name:"name",label:"Full Name",defaultValue:null===(e=this.representativeDefaultValue)||void 0===e?void 0:e.name,errorText:this.errors.name,inputHandler:this.inputHandler})),t("div",{key:"bce864367883c6bbf7bd0841114a3dbb39db692b",class:"col-12 col-md-4"},t("form-control-text",{key:"ec3e72dc3f84c0daee2c6509f7dbf2bad22f5db6",name:"title",label:"Title",defaultValue:null===(a=this.representativeDefaultValue)||void 0===a?void 0:a.title,errorText:this.errors.title,inputHandler:this.inputHandler,helpText:"Role at your business, e.g. President, CEO, Treasurer."})),t("div",{key:"200ae959d897d9d22016553d3c586cf3f0438dd9",class:"col-12 col-md-6"},t("form-control-text",{key:"4f77d6ca6c3c85edabc11af6f5703ab1327f05e7",name:"email",label:"Email Address",defaultValue:null===(i=this.representativeDefaultValue)||void 0===i?void 0:i.email,errorText:this.errors.email,inputHandler:this.inputHandler})),t("div",{key:"cf642ee73f7ae8b254920a3f781c23dc456f16ae",class:"col-12 col-md-6"},t("form-control-number-masked",{key:"df609213bec728f17b2527a2e99ff3e0e69604aa",name:"phone",label:"Phone Number",defaultValue:null===(s=this.representativeDefaultValue)||void 0===s?void 0:s.phone,errorText:this.errors.phone,inputHandler:this.inputHandler,mask:D.US})),t("div",{key:"2e4565c06976723ae4e497a5305cea7468bac2f4",class:"col-12 col-md-4"},t("form-control-date",{key:"ca7d4bf05c32d1d9983df430d338cc3433015957",name:"dob_full",label:"Birth Date",defaultValue:null===(l=this.representativeDefaultValue)||void 0===l?void 0:l.dob_full,errorText:this.errors.dob_full,inputHandler:this.inputHandler,onFormControlInput:e=>V(e,this.formController),helpText:"Must be 18 or older."})),t("div",{key:"f6cbe1b7f4e5575f626e6d73f31b4a1a09ac33e3",class:"col-12 col-md-8"},!(null===(o=this.representativeDefaultValue)||void 0===o?void 0:o.ssn_last4)||this.isEditingIdentification?t("form-control-number-masked",{name:"identification_number",label:O[this.country].idNumberLabel,defaultValue:this.isEditingIdentification?"":null===(n=this.representativeDefaultValue)||void 0===n?void 0:n.identification_number,errorText:this.errors.identification_number,inputHandler:this.inputHandler,mask:I[this.country],helpText:O[this.country].identityHelpText}):t("div",null,t("label",{class:"form-label",part:k},O[this.country].idNumberLabel),t("div",{class:"input-group mb-3"},t("input",{type:"text",class:"form-control",part:g,value:`****${null===(r=this.representativeDefaultValue)||void 0===r?void 0:r.ssn_last4}`,disabled:!0}),t("button",{class:"btn btn-secondary",type:"button",part:T,onClick:()=>{this.isEditingIdentification=!0,E(this.formController,{identification_number:"",ssn_last4:null})}},"Change")))),t("div",{key:"e3fa556dece2feaf5eb175ae3734c2319777ef48",class:"col-12"},t("justifi-identity-address-form",{key:"fe3d349371d11b8a246b9c31aebd7d9c84e03f8e",errors:this.errors.address,defaultValues:null===(c=this.representativeDefaultValue)||void 0===c?void 0:c.address,handleFormUpdate:this.onAddressFormUpdate,country:this.country})))))}},X=class{constructor(t){e(this,t),this.errorEvent=i(this,"error-event",7)}async validate(){return this.coreComponent.validate()}async submit(){return this.coreComponent.submit()}async validateAndSubmit({onSuccess:e}){this.coreComponent.validateAndSubmit({onSuccess:e})}componentWillLoad(){this.initializeApi()}initializeApi(){this.authToken&&(this.getOwner=M({authToken:this.authToken,identityId:this.ownerId,service:new R}),this.patchOwner=F({authToken:this.authToken,identityId:this.ownerId,service:new R}),this.postOwner=B({authToken:this.authToken,service:new R}))}render(){return t("owner-form-core",{key:"47c36dfc76ac8a108950e17770d1a0fb06fe4e42",ownerId:this.ownerId,businessId:this.businessId,getOwner:this.getOwner,patchOwner:this.patchOwner,postOwner:this.postOwner,allowOptionalFields:this.allowOptionalFields,removeOwner:this.removeOwner,newFormOpen:this.newFormOpen,ownersLength:this.ownersLength,country:this.country,ref:e=>this.coreComponent=e})}},Q=class{constructor(t){e(this,t),this.plaidVerificationSuccess=i(this,"plaidVerificationSuccess",7),this.plaidVerificationError=i(this,"plaidVerificationError",7),this.linkToken=null,this.linkTokenId=null,this.plaidLink=null,this.isAuthenticating=!1,this.isSuccess=!1,this.error=null,this.isLoading=!1,this.plaidService=new Z,this.abortController=null,this.timeoutId=null,this.initializePlaidLink=async()=>{try{if(void 0===window.Plaid)return void this.handleError({code:c.PLAID_SDK_LOAD_FAILED,message:r[c.PLAID_SDK_LOAD_FAILED],severity:n[c.PLAID_SDK_LOAD_FAILED],retryable:!0,userAction:"Refresh the page and try again"});if(await this.getLinkToken(),!this.linkToken)return void this.handleError({code:c.PLAID_LINK_TOKEN_FAILED,message:r[c.PLAID_LINK_TOKEN_FAILED],severity:n[c.PLAID_LINK_TOKEN_FAILED],retryable:!0,userAction:"Click to try again"});const e=window.Plaid;this.plaidLink=e.create({token:this.linkToken,onSuccess:this.handlePlaidSuccess,onExit:this.handlePlaidExit,onEvent:this.handlePlaidEvent,onLoad:this.handlePlaidLoad})}catch(e){this.handleError({code:c.PLAID_LINK_INIT_FAILED,message:r[c.PLAID_LINK_INIT_FAILED],severity:n[c.PLAID_LINK_INIT_FAILED],originalError:e,retryable:!0,userAction:"Click to try again"})}},this.getLinkToken=async()=>{var e,t,a,i;try{if(!this.authToken||!this.accountId)return void this.handleError({code:c.PLAID_LINK_TOKEN_FAILED,message:"Missing authentication. Please provide authToken and accountId.",severity:l.ERROR,retryable:!1,userAction:"Provide required props"});this.abortController=new AbortController,this.timeoutId=setTimeout((()=>{var e;null===(e=this.abortController)||void 0===e||e.abort()}),3e4);const e=await this.plaidService.getLinkTokenForVerification(this.authToken,this.businessId,this.abortController.signal);if(this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null),e.error)throw new Error("string"==typeof e.error?e.error:e.error.message||"Failed to get link token");this.linkToken=e.data.link_token,this.linkTokenId=e.data.id}catch(s){this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null);let l=c.PLAID_LINK_TOKEN_FAILED,o=r[l],d=!0;"AbortError"===s.name?(l=c.PLAID_TIMEOUT,o=r[l],d=!0):(null===(e=s.message)||void 0===e?void 0:e.includes("network"))||(null===(t=s.message)||void 0===t?void 0:t.includes("fetch"))?(l=c.PLAID_NETWORK_ERROR,o=r[l],d=!0):((null===(a=s.message)||void 0===a?void 0:a.includes("401"))||(null===(i=s.message)||void 0===i?void 0:i.includes("unauthorized")))&&(l=c.PLAID_INVALID_CREDENTIALS,o="Authentication failed. Please check your credentials.",d=!1),this.handleError({code:l,message:o,severity:n[l],originalError:s,retryable:d,userAction:d?"Click to try again":"Check your credentials"})}},this.openPlaidLink=()=>{this.plaidLink&&this.linkToken&&(this.isAuthenticating=!0,this.clearError(),this.plaidLink.open())},this.handlePlaidSuccess=async e=>{var t;this.isAuthenticating=!1,this.isLoading=!0,this.clearError();try{const a=await this.plaidService.postPlaidVerifiedBankAccountData(this.authToken,this.businessId,{public_token:e,link_token_id:this.linkTokenId},null===(t=this.abortController)||void 0===t?void 0:t.signal);if(a.error)throw new Error("string"==typeof a.error?a.error:a.error.message||"Failed to verify bank account");this.isSuccess=!0,this.isLoading=!1,this.plaidVerificationSuccess.emit({publicToken:e,bankAccount:a.data})}catch(e){this.isLoading=!1,this.handleError({code:c.PLAID_AUTHENTICATION_FAILED,message:(null==e?void 0:e.message)||"Failed to verify bank account",severity:n[c.PLAID_AUTHENTICATION_FAILED],originalError:e,retryable:!0,userAction:"Click to try again"})}},this.handlePlaidExit=e=>{this.isAuthenticating=!1,e&&this.handlePlaidError(e)},this.handlePlaidEvent=(e,t)=>{switch(e){case"OPEN":this.isAuthenticating=!0;break;case"CLOSE":this.isAuthenticating=!1;break;case"ERROR":this.handlePlaidError(t)}},this.handlePlaidLoad=()=>{},this.handlePlaidError=e=>{let t=c.PLAID_AUTHENTICATION_FAILED,a=r[t],i=!0,s="Click to try again";if(e.error_code)switch(e.error_code){case"INVALID_CREDENTIALS":t=c.PLAID_INVALID_CREDENTIALS,a=r[t],i=!0;break;case"ITEM_LOGIN_REQUIRED":t=c.PLAID_INVALID_CREDENTIALS,a="Your bank requires re-authentication. Please try again.",i=!0;break;case"ITEM_LOCKED":t=c.PLAID_ACCOUNT_LOCKED,a=r[t],i=!1,s="Contact your bank";break;case"INSTITUTION_NOT_RESPONDING":t=c.PLAID_MAINTENANCE,a=r[t],i=!0;break;case"RATE_LIMIT_EXCEEDED":t=c.PLAID_RATE_LIMITED,a=r[t],i=!0;break;default:e.error_message&&(a=e.error_message)}this.handleError({code:t,message:a,severity:n[t],originalError:e,retryable:i,userAction:s}),this.isAuthenticating=!1},this.handleError=e=>{this.error=e,this.isLoading=!1,this.plaidVerificationError.emit(e),console.error("Plaid verification error:",e)},this.clearError=()=>{this.error&&(this.error=null)}}componentDidRender(){this.scriptRef&&(this.scriptRef.onload=()=>{this.initializePlaidLink()},this.scriptRef.onerror=()=>{this.handleError({code:c.PLAID_SDK_LOAD_FAILED,message:r[c.PLAID_SDK_LOAD_FAILED],severity:n[c.PLAID_SDK_LOAD_FAILED],retryable:!0,userAction:"Refresh the page and try again"})})}disconnectedCallback(){this.timeoutId&&clearTimeout(this.timeoutId),this.abortController&&this.abortController.abort()}render(){const e=t("svg",{class:"plaid-logo-img",height:"20",width:"20",viewBox:"0 0 28 29",xmlns:"http://www.w3.org/2000/svg",style:{display:"inline",marginLeft:"5px",marginRight:"5px",marginTop:"-2px"}},t("g",{fill:"#fff","fill-rule":"evenodd"},t("path",{d:"M25.7629 26.2628L28 17.5309L24.9691 14.5001L27.9999 11.4691L25.7628 2.73706L17.0309 0.5L14.0001 3.531L10.969 0.50014L2.23706 2.73734L0 11.4691L3.03128 14.4999L0.00014 17.531L2.2372 26.2629L10.9691 28.5L14.0001 25.469L17.031 28.4999L25.7629 26.2628ZM15.7321 23.7371L18.6186 20.8505L22.2912 24.5233L17.6956 25.7007L15.7321 23.7371ZM11.1136 9.88154L14.0003 6.99502L16.8868 9.8814L14.0001 12.7679L11.1136 9.88154ZM12.2682 14.5L9.38154 17.3865L6.49502 14.5L9.38154 11.6135L12.2682 14.5ZM18.6187 11.6133L21.5053 14.5L18.6186 17.3865L15.7321 14.5L18.6187 11.6133ZM16.8867 19.1186L14.0001 22.0051L11.1135 19.1185L14.0001 16.2319L16.8867 19.1186ZM10.3044 25.7007L5.70864 24.5233L9.38154 20.8504L12.2682 23.7371L10.3044 25.7007ZM4.76308 16.2319L7.6496 19.1185L3.9767 22.7914L2.7993 18.1957L4.76308 16.2319ZM3.9767 6.20836L7.64974 9.8814L4.76308 12.7681L2.7993 10.8041L3.9767 6.20836ZM12.2683 5.26294L9.38168 8.1496L5.70892 4.4767L10.3047 3.2993L12.2683 5.26294ZM17.6959 3.2993L22.2915 4.4767L18.6186 8.14946L15.7321 5.26294L17.6959 3.2993ZM23.2372 12.7681L20.3505 9.8814L24.0233 6.20878L25.2007 10.8046L23.2372 12.7681ZM24.0233 22.7914L20.3505 19.1186L23.2372 16.2321L25.2007 18.1957L24.0233 22.7914Z"})));return t(S,null,t("script",{src:"https://cdn.plaid.com/link/v2/stable/link-initialize.js",async:!0,ref:e=>this.scriptRef=e}),t("div",null,t("div",{class:"mb-3"},t(P,{variant:"primary",type:"button",onClick:e=>{e.preventDefault(),this.openPlaidLink()},disabled:this.isLoading,part:w},"Connect with Plaid ",e," (instant verification)")),(()=>this.error?t("div",{class:(this.error.severity===l.ERROR?"text-danger":this.error.severity===l.WARNING?"text-warning":"text-info")+" mt-2"},t("small",null,this.error.message),t("br",null),this.error.userAction&&t("small",{class:"text-muted"},this.error.userAction)):null)(),(()=>this.error?null:this.isLoading?t("div",{class:"text-info mt-2"},t("small",null,"Verifying bank account...")):this.isSuccess?t("div",{class:"text-success mt-2"},t("small",null,"✓ Bank account verified successfully")):this.isAuthenticating?t("div",{class:"text-info mt-2"},t("small",null,"Connecting to your bank...")):null)()))}};export{U as bank_account_document_form_inputs,Y as bank_account_form_inputs,z as bank_account_form_inputs_canada,W as bank_account_read_only_value,q as business_documents_on_file,$ as form_control_file,G as justifi_business_representative_form_inputs,X as justifi_owner_form,Q as plaid_verification}
@@ -0,0 +1 @@
1
+ import{r as s,c as t,h as e,H as i}from"./p-CV0Pyo1O.js";import{C as r,a as n}from"./p-Cjcsf8ku.js";import{m as o,b as a,f as h,g as c}from"./p-R0FDNhyd.js";import{B as l,a as d,D as u}from"./p--UanYWb-.js";import{a as m,c as p,b}from"./p-BovgIz83.js";import{F as f,c as v,a as y,b as g,d as w}from"./p-CKiAlBsU.js";import{A as _,C as k,e as j,R as C,f as T}from"./p-BcNb9bVO.js";import{C as x,P as O}from"./p-CVaOFfrI.js";import{b as S,a2 as E,E as I,z as A,w as L,am as B}from"./p-D3V9AE6o.js";import{P as D}from"./p-C_WlV7F_.js";import{b as P,c as H}from"./p-Bt4GjEWL.js";import{a as V,B as F}from"./p-XYgDHrVL.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{E as W,p as q,q as M}from"./p-_BHErKTQ.js";import"./p-CLHwhyvu.js";import"./p-BH0Xfn-F.js";import{A as U,B as Y,v as z,C as N,D as R,E as G,F as X}from"./p-HT_4DkD0.js";import{B as Q}from"./p-o83Uy7sW.js";import"./p-CZfYo5-1.js";import{c as J}from"./p-_-2E_vYf.js";import{d as K,e as $}from"./p-D8EGHc_m.js";import{A as Z}from"./p-55QcjheA.js";import"./p-D2muobcE.js";import"./p-BFTU3MAI.js";import"./p-C0tps2ph.js";import"./p-D8GTwl9v.js";import"./p-MeSAYDNh.js";class ss{constructor(s){this.id=s.id,this.account_owner_name=s.account_owner_name,this.full_name=s.full_name,this.account_type=s.account_type,this.account_number=s.account_number,this.acct_last_four=s.acct_last_four,this.account_number_last4=s.account_number_last4,this.routing_number=s.routing_number,this.institution_number=s.institution_number,this.transit_number=s.transit_number,this.bank_name=s.bank_name,this.country=s.country,this.currency=s.currency,this.nickname=s.nickname,this.metadata=s.metadata,this.business_id=s.business_id,this.platform_account_id=s.platform_account_id,this.created_at=s.created_at,this.updated_at=s.updated_at}get payload(){return{account_owner_name:this.account_owner_name||"",account_type:this.account_type||"",account_number:this.account_number||"",routing_number:this.routing_number||"",institution_number:this.institution_number||"",transit_number:this.transit_number||"",bank_name:this.bank_name||"",nickname:this.nickname||"",business_id:this.business_id||""}}}const ts=class{constructor(e){s(this,e),this.errorEvent=t(this,"error-event",7),this.stepCompleteEvent=t(this,"complete-form-step-event",7),this.formLoading=t(this,"formLoading",7),this.errors={},this.additional_questions={},this.recurringPayments=!1,this.isLoading=!1,this.getData=()=>{this.formLoading.emit(!0),this.isLoading=!0,this.getBusiness({onSuccess:s=>{this.additional_questions=new _(s.data.additional_questions||{}),this.formController.setInitialValues(Object.assign({},this.additional_questions))},onError:({error:s,code:t,severity:e})=>{this.errorEvent.emit({message:s,errorCode:t,severity:e})},final:()=>{this.formLoading.emit(!1),this.isLoading=!1}})},this.sendData=s=>{let t;this.formLoading.emit(!0),this.patchBusiness({payload:this.patchPayload,onSuccess:e=>{t=e,s()},onError:({error:s,code:e,severity:i})=>{t=s,this.errorEvent.emit({message:s,errorCode:e,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:t,formStep:V.additionalQuestions}),this.formLoading.emit(!1)}})},this.inputHandler=(s,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:t})),this.additional_questions=new _(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:t}))}}propChanged(){this.initializeApi()}recurringPaymentsWatcher(s){this.recurringPayments="Yes"===(null==s?void 0:s.business_recurring_payments)}async validateAndSubmit({onSuccess:s}){this.formController.validateAndSubmit((()=>this.sendData(s)))}get patchPayload(){return{additional_questions:new _(this.formController.values.getValue()).payload}}componentWillLoad(){this.initializeApi(),this.formController=new f(m(this.allowOptionalFields))}componentDidLoad(){this.getBusiness&&this.getData(),this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=o({authToken:this.authToken,businessId:this.businessId,service:new l}),this.patchBusiness=a({authToken:this.authToken,businessId:this.businessId,service:new l})):this.errorEvent.emit({message:"Missing required props",errorCode:n.MISSING_PROPS,severity:r.ERROR})}render(){var s,t,i,r,n;const o=this.formController.getInitialValues();return this.isLoading?e(D,null):e("form",null,e("fieldset",null,e("div",{class:"d-flex align-items-center gap-2"},e("legend",{class:"mb-0",part:S},"Additional Questions"),e("form-control-tooltip",{helpText:"This information helps us understand the business and identify and monitor trends to safeguard you and your customers."})),e("hr",{class:"mt-2"}),e("div",{class:"row gy-3"},e("div",{class:"col-12 col-md-6"},e("form-control-monetary-provisioning",{name:"business_revenue",label:"What is your business' estimated annual revenue from its primary business activities?",inputHandler:this.inputHandler,errorText:null===(s=this.errors)||void 0===s?void 0:s.business_revenue,defaultValue:null==o?void 0:o.business_revenue,maskOptions:x.WHOLE})),e("div",{class:"col-12 col-md-6"},e("form-control-monetary-provisioning",{name:"business_payment_volume",label:"What is your business' annual credit card & ACH volume anticipated to process?",inputHandler:this.inputHandler,errorText:null===(t=this.errors)||void 0===t?void 0:t.business_payment_volume,defaultValue:null==o?void 0:o.business_payment_volume,maskOptions:x.WHOLE})),e("div",{class:"col-12"},e("form-control-text",{name:"business_average_transaction_amount",label:"What is your average transaction size?",inputHandler:this.inputHandler,errorText:null===(i=this.errors)||void 0===i?void 0:i.business_average_transaction_amount,defaultValue:null==o?void 0:o.business_average_transaction_amount})),e("div",{class:"col-12"},e("form-control-select",{name:"business_when_service_received",label:"On average, how long after paying will your customers typically receive their goods or services?",inputHandler:this.inputHandler,errorText:null===(r=this.errors)||void 0===r?void 0:r.business_when_service_received,options:P,defaultValue:null==o?void 0:o.business_when_service_received})),e("div",{class:"col-12"},e("form-control-text",{name:"business_other_payment_details",label:"Is there anything else you would like us to know about how your customers pay the business? (optional)",inputHandler:this.inputHandler,errorText:null===(n=this.errors)||void 0===n?void 0:n.business_other_payment_details,defaultValue:null==o?void 0:o.business_other_payment_details})))))}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"],additional_questions:["recurringPaymentsWatcher"]}}},es=(s,t)=>s.some((s=>s.document_type===t)),is=s=>s?{bank_name:R.nullable(),nickname:N.nullable(),account_owner_name:z.nullable(),account_type:Y.nullable(),account_number:U.nullable()}:{bank_name:R.required("Enter bank name"),nickname:N.required("Enter nickname"),account_owner_name:z.required("Enter account owner name"),account_type:Y.required("Select account type"),account_number:U.required("Enter account number")},rs=(s,t)=>{if(t)return{voided_check:g().nullable(),bank_statement:g().nullable()};const e=es(s,W.voidedCheck),i=es(s,W.bankStatement),r=e||i,n="Please upload either a voided check or a bank statement. Only one is required.";return{voided_check:g().when("bank_statement",{is:s=>!s&&!r,then:s=>s.required(n),otherwise:s=>s.notRequired()}),bank_statement:g().when("voided_check",{is:s=>!s&&!r,then:s=>s.required(n),otherwise:s=>s.notRequired()})}},ns={[k.USA]:(s,t=[])=>((s,t)=>{const e=Object.assign(Object.assign(Object.assign({},is(t)),(s=>s?{routing_number:X.nullable()}:{routing_number:X.required("Enter routing number")})(t)),rs(s,t));return v().shape(e,[["voided_check","bank_statement"]])})(t,s),[k.CAN]:(s,t=[])=>((s,t)=>{const e=Object.assign(Object.assign(Object.assign({},is(t)),(s=>{const t=y().length(3,"Institution number must be 3 digits").matches(G,"Enter valid institution number"),e=y().length(5,"Transit number must be 5 digits").matches(G,"Enter valid transit number");return s?{institution_number:t.nullable(),transit_number:e.nullable()}:{institution_number:t.required("Enter institution number"),transit_number:e.required("Enter transit number")}})(t)),rs(s,t));return v().shape(e,[["voided_check","bank_statement"]])})(t,s)},os=class{constructor(e){s(this,e),this.errorEvent=t(this,"error-event",7),this.stepCompleteEvent=t(this,"complete-form-step-event",7),this.formLoading=t(this,"formLoading",7),this.errors={},this.bankAccount={},this.existingDocuments=[],this.documentData=new q,this.isLoading=!1,this.viewMode="manual",this.bankAccountVerification=!1,this.platformAccountId=null,this.getSchema=()=>(0,ns[this.country])(this.allowOptionalFields,this.existingDocuments),this.initializeFormController=()=>{this.formController=new f(this.getSchema()),this.formController.setInitialValues("readonly"===this.viewMode?Object.assign({},this.bankAccount):{business_id:this.businessId}),this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))},this.inputHandler=(s,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:t}))},this.storeFiles=s=>{const t=Array.from(s.detail.fileList),e=s.detail.document_type,i=t.map((s=>new M({file:s,document_type:e},this.businessId)));this.documentData[e]=i},this.getData=()=>{this.isLoading=!0,this.getBusiness({onSuccess:s=>{this.processBusinessResponse(s.data),this.determineViewMode()},onError:({error:s,code:t,severity:e})=>{this.errorEvent.emit({message:s,errorCode:t,severity:e})},final:()=>{this.initializeFormController(),this.isLoading=!1}})},this.handleChangeBankAccount=()=>{this.viewMode=this.plaidAvailable?"plaid":"manual",this.documentData=new q,this.initializeFormController()},this.handleCancel=()=>{this.viewMode=this.existingBankAccount?"readonly":"plaid",this.documentData=new q,this.initializeFormController()},this.handleToggleToManualEntry=()=>{this.viewMode="manual"},this.handleToggleToPlaidVerification=()=>{this.viewMode="plaid"},this.handleSaveBankAccount=async()=>{this.formController.validateAndSubmit((()=>{this.sendData((()=>{}))}))},this.postDocumentRecordData=async s=>{this.isLoading=!0;const t=s.record_data;return new Promise((e=>{this.postDocumentRecord({payload:t,onSuccess:t=>{e(this.handleDocRecordResponse(s,t))},onError:({error:s,code:t,severity:i})=>{this.errorEvent.emit({message:s,errorCode:t,severity:i}),e(!1)}})}))},this.handleDocRecordResponse=(s,t)=>t.error?(this.errorEvent.emit({errorCode:n.POST_ERROR,message:t.error.message,severity:r.ERROR,data:t.error}),!1):(s.setPresignedUrl(t.data.presigned_url),!0),this.uploadDocument=async s=>{if(!s.presigned_url)throw new Error("Presigned URL is not set");const t=await s.getFileData(),e=await fetch(s.presigned_url,{method:"PUT",body:t});return this.handleUploadResponse(e)},this.handleUploadResponse=s=>!s.error||(this.errorEvent.emit({errorCode:n.POST_ERROR,message:s.error.message,severity:r.ERROR,data:s.error}),!1)}propChanged(){this.initializeApi()}watchHandler(s){this.formLoading.emit(s)}async validateAndSubmit({onSuccess:s}){"readonly"===this.viewMode?this.sendData(s):this.formController.validateAndSubmit((()=>this.sendData(s)))}componentWillLoad(){this.initializeApi(),this.getBusiness&&this.getData(),this.formController=new f(this.getSchema())}componentDidLoad(){this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=o({authToken:this.authToken,businessId:this.businessId,service:new l}),this.postBankAccount=h({authToken:this.authToken,service:new d}),this.postDocumentRecord=c({authToken:this.authToken,service:new u})):this.errorEvent.emit({message:"Missing required props",errorCode:n.MISSING_PROPS,severity:r.ERROR})}get postPayload(){const s=this.formController.values.getValue();return new ss(s).payload}get existingBankAccount(){var s;return!!(null===(s=this.bankAccount)||void 0===s?void 0:s.id)}get plaidAvailable(){return this.bankAccountVerification&&!!this.platformAccountId}get showCancel(){return this.bankAccountVerification||this.existingBankAccount}processBusinessResponse(s){const{bank_accounts:t,documents:e,settings:i,platform_account_id:r}=s;t.length>0?this.bankAccount=new ss(t[t.length-1]):(this.bankAccount=new ss({}),this.bankAccount.business_id=this.businessId),this.existingDocuments=e,this.bankAccountVerification=!0===i.bank_account_verification,this.platformAccountId=r}determineViewMode(){this.viewMode=this.existingBankAccount?"readonly":this.plaidAvailable?"plaid":"manual"}async sendData(s){try{if("manual"===this.viewMode&&!await this.postBankAccountData())return;if(!await this.postBusinessDocuments())return;"manual"===this.viewMode&&(this.viewMode="readonly",await this.refreshBankAccountData()),s()}catch(s){this.errorEvent.emit({message:s,errorCode:n.POST_ERROR,severity:r.ERROR})}}async postBankAccountData(){let s;return this.isLoading=!0,new Promise((t=>{let e=!1;this.postBankAccount({payload:this.postPayload,onSuccess:t=>{s=t,e=!0},onError:({error:s,code:t,severity:i})=>{e=!1,this.errorEvent.emit({message:s,errorCode:t,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:s,formStep:V.bankAccount}),this.isLoading=!1,t(e)}})}))}async refreshBankAccountData(){return new Promise((s=>{this.isLoading=!0,this.getBusiness({onSuccess:s=>{this.processBusinessResponse(s.data),this.determineViewMode(),this.initializeFormController()},onError:({error:s,code:t,severity:e})=>{this.errorEvent.emit({message:s,errorCode:t,severity:e})},final:()=>{this.isLoading=!1,s()}})}))}async postBusinessDocuments(){this.isLoading=!0;try{const s=Object.values(this.documentData).flat();return!s.length||!(await Promise.all(s.map((s=>this.postDocumentRecordData(s))))).includes(!1)&&!(await Promise.all(s.map((s=>this.uploadDocument(s))))).includes(!1)}finally{this.isLoading=!1}}renderBankAccountInputs(s){const t=this.formController.getInitialValues();return e(this.country===k.CAN?"bank-account-form-inputs-canada":"bank-account-form-inputs",{defaultValue:t,errors:this.errors,inputHandler:this.inputHandler,formDisabled:s})}renderReadonlyView(){return e("div",null,this.renderBankAccountInputs(!0),e("div",{class:"mt-3"},e(Q,{variant:"secondary",type:"button",onClick:this.handleChangeBankAccount,disabled:this.isLoading,part:E},"Change Bank Account")))}renderPlaidView(){return e("div",{class:"mt-3"},e("plaid-verification",{authToken:this.authToken,accountId:this.platformAccountId,businessId:this.businessId,onPlaidVerificationSuccess:()=>{this.viewMode="readonly",this.refreshBankAccountData()}}),e("div",{class:"mt-3"},e(Q,{type:"button",variant:"link",className:"p-0",onClick:this.handleToggleToManualEntry,disabled:this.isLoading,part:I},"Enter bank details manually (document upload required)")))}renderManualEntryView(){return e("div",null,this.plaidAvailable&&e("div",{class:"mb-3"},e(Q,{type:"button",variant:"secondary",onClick:this.handleToggleToPlaidVerification,disabled:this.isLoading,part:E},"Link bank account with Plaid instead")),this.renderBankAccountInputs(!1),e("div",{class:"mt-3 d-flex gap-2"},this.showCancel&&e(Q,{variant:"secondary",type:"button",onClick:this.handleCancel,disabled:this.isLoading,part:E},"Cancel"),e(Q,{variant:"primary",type:"button",onClick:this.handleSaveBankAccount,disabled:this.isLoading,isLoading:this.isLoading},"Save Bank Account")))}renderDocumentUploads(){return e("fieldset",{class:"mt-4"},e("div",{class:"d-flex align-items-center gap-2"},e("legend",{class:"mb-0",part:S},"Document Uploads"),e("form-control-tooltip",{helpText:"One document (voided check or bank statement) is required for underwriting purposes. It needs to visibly show the name tied to the account and the account number. Various file formats such as PDF, DOC, DOCX, JPEG are accepted. Multiple files can be uploaded for each document category."})),e("hr",{class:"mt-2"}),e("business-documents-on-file",{documents:this.existingDocuments,isLoading:this.isLoading}),e("bank-account-document-form-inputs",{inputHandler:this.inputHandler,errors:this.errors,storeFiles:this.storeFiles}))}render(){return this.isLoading?e(D,null):e("form",null,e("fieldset",{class:"mb-4"},e("div",{class:"d-flex align-items-center gap-2"},e("legend",{class:"mb-0",part:S},"Bank Account Info"),e("form-control-tooltip",{helpText:"This direct deposit account is the designated bank account where incoming funds will be deposited. The name of this account must match the registered business name exactly. We are not able to accept personal accounts unless your business is a registered sole proprietorship."})),e("hr",{class:"mt-2"}),"readonly"===this.viewMode&&this.renderReadonlyView(),"plaid"===this.viewMode&&this.renderPlaidView(),"manual"===this.viewMode&&this.renderManualEntryView()),"plaid"!==this.viewMode&&this.renderDocumentUploads())}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"],isLoading:["watchHandler"]}}},as=class{constructor(e){s(this,e),this.errorEvent=t(this,"error-event",7),this.stepCompleteEvent=t(this,"complete-form-step-event",7),this.formLoading=t(this,"formLoading",7),this.errors={},this.coreInfo={},this.isLoading=!1,this.isEditingTaxId=!1,this.getData=()=>{this.getBusiness&&(this.formLoading.emit(!0),this.isLoading=!0,this.getBusiness({onSuccess:s=>{this.coreInfo=new j(s.data),this.formController.setInitialValues(Object.assign({},this.coreInfo))},onError:({error:s,code:t,severity:e})=>{this.errorEvent.emit({message:s,errorCode:t,severity:e})},final:()=>{this.formLoading.emit(!1),this.isLoading=!1}}))},this.sendData=s=>{let t;this.formLoading.emit(!0),this.patchBusiness({payload:this.patchPayload,onSuccess:e=>{t=e,s(),this.isEditingTaxId=!1},onError:({error:s,code:e,severity:i,rawError:r})=>{t=s,r&&"object"==typeof r&&r.param&&this.formController.setFieldError(r.param,r.message),this.errorEvent.emit({message:s,errorCode:e,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:t,formStep:V.businessInfo}),this.formLoading.emit(!1)}})},this.inputHandler=(s,t)=>{this.errors[s]&&this.formController.clearFieldError(s),this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:t}))}}propChanged(){this.initializeApi()}async validateAndSubmit({onSuccess:s}){this.formController.validateAndSubmit((()=>this.sendData(s)))}get patchPayload(){return new j(this.formController.values.getValue()).payload}componentWillLoad(){this.initializeApi();const s=this.country===k.CAN?p(this.allowOptionalFields):b(this.allowOptionalFields);this.formController=new f(s),this.getData()}componentDidLoad(){this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=o({authToken:this.authToken,businessId:this.businessId,service:new l}),this.patchBusiness=a({authToken:this.authToken,businessId:this.businessId,service:new l})):this.errorEvent.emit({message:"Missing required props",errorCode:n.MISSING_PROPS,severity:r.ERROR})}render(){var s,t;const i=this.formController.getInitialValues();return this.isLoading?e(D,null):e("form",null,e("fieldset",null,e("div",{class:"d-flex align-items-center gap-2"},e("legend",{class:"mb-0",part:S},"Business Information")),e("hr",{class:"mt-2"}),e("div",{class:"row gy-3"},e("div",{class:"col-12 col-md-6"},e("form-control-text",{name:"legal_name",label:"Business Name",defaultValue:i.legal_name,errorText:this.errors.legal_name,inputHandler:this.inputHandler,helpText:"Enter this exactly as it appears on your tax records (don't use acronyms or abbreviations unless you registered that way)."})),e("div",{class:"col-12 col-md-6"},e("form-control-text",{name:"doing_business_as",label:"Doing Business As (DBA)",defaultValue:i.doing_business_as,errorText:this.errors.doing_business_as,inputHandler:this.inputHandler,helpText:"Enter this exactly as it appears on your tax records (leave blank if you don't have a registered DBA/trade name)"})),e("div",{class:"col-12 col-md-8"},e("form-control-select",{name:"classification",label:"Business Classification",options:H,defaultValue:i.classification,errorText:this.errors.classification,inputHandler:this.inputHandler})),e("div",{class:"col-12 col-md-4"},e("form-control-date",{name:"date_of_incorporation",label:"Date of Registration",defaultValue:i.date_of_incorporation,errorText:this.errors.date_of_incorporation,inputHandler:this.inputHandler})),e("div",{class:"col-12 col-md-6"},e("form-control-text",{name:"industry",label:"Industry",defaultValue:i.industry,errorText:this.errors.industry,inputHandler:this.inputHandler,helpText:"Describe what you sell"})),e("div",{class:"col-12 col-md-6"},!(null===(s=this.coreInfo)||void 0===s?void 0:s.tax_id_last4)||this.isEditingTaxId?e("form-control-number-masked",{name:"tax_id",label:J[this.country].taxIdLabel,defaultValue:this.isEditingTaxId?"":i.tax_id,errorText:this.errors.tax_id,inputHandler:this.inputHandler,mask:"000000000",helpText:J[this.country].taxIdHelpText}):e("div",null,e("label",{class:"form-label",part:A},J[this.country].taxIdLabel),e("div",{class:"input-group mb-3"},e("input",{type:"text",class:"form-control",part:L,value:`****${null===(t=this.coreInfo)||void 0===t?void 0:t.tax_id_last4}`,disabled:!0}),e("button",{class:"btn btn-secondary",type:"button",part:E,onClick:()=>{this.isEditingTaxId=!0,this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{tax_id:"",tax_id_last4:null}))}},"Change")))),e("div",{class:"col-12"},e("form-control-text",{name:"website_url",label:"Business Website URL",defaultValue:i.website_url,errorText:this.errors.website_url,inputHandler:this.inputHandler,helpText:"Don't have a live website? You can use your social media business page, app store link, or staging site URL."})),e("div",{class:"col-12 col-md-6"},e("form-control-text",{name:"email",label:"Business Email Address",defaultValue:i.email,errorText:this.errors.email,inputHandler:this.inputHandler})),e("div",{class:"col-12 col-md-6"},e("form-control-number-masked",{name:"phone",label:"Business Phone Number",defaultValue:i.phone,errorText:this.errors.phone,inputHandler:this.inputHandler,mask:O.US})))))}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},hs=class{constructor(e){s(this,e),this.clickEvent=t(this,"click-event",7),this.stepCompleteEvent=t(this,"complete-form-step-event",7),this.errorEvent=t(this,"error-event",7),this.formLoading=t(this,"formLoading",7),this.ownersPayload=[],this.refs=[],this.isLoading=!1,this.representativeIsOwner=null,this.matchRef=(s,t)=>{if(null===s)return;const e=this.ownersPayload.findIndex((s=>s.id===t));-1!==e&&(this.refs.length!==this.ownersPayload.length&&this.manageRefs(),this.refs[e]=s)},this.getData=()=>{this.formLoading.emit(!0),this.isLoading=!0,this.getBusiness({onSuccess:s=>{this.representative=new C(s.data.representative||{}),s.data.owners.length?this.ownersPayload=s.data.owners.map((s=>({id:s.id}))):this.addOwnerForm()},onError:({error:s,code:t,severity:e})=>{this.errorEvent.emit({message:s,errorCode:t,severity:e})},final:()=>{this.formLoading.emit(!1),this.isLoading=!1,this.manageRefs()}})},this.sendData=async s=>{let t;this.formLoading.emit(!0),this.patchBusiness({payload:{owners:this.ownersPayload},onSuccess:e=>{t=e,s()},onError:({error:s,code:e,severity:i})=>{t=s,this.errorEvent.emit({message:s,errorCode:e,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:t,formStep:V.owners}),this.formLoading.emit(!1)}})},this.addOwnerForm=s=>{this.newFormOpen=!0,this.ownersPayload=[...this.ownersPayload,{id:""}],s&&this.clickEvent.emit({name:F.addOwnerForm})},this.removeOwnerForm=s=>{this.ownersPayload=this.ownersPayload.filter((t=>t.id!==s)),this.newFormOpen&&(this.newFormOpen=!1)},this.handleRepresentativeIsOwnerChange=s=>{this.representativeIsOwner=s,this.representativeIsOwner&&(this.formLoading.emit(!0),this.isLoading=!0,this.ownersPayload=this.ownersPayload.filter((s=>""!==s.id)),this.patchBusiness({payload:{owners:[{id:this.representative.id},...this.ownersPayload]},onSuccess:()=>{this.getData(),this.newFormOpen=!1},finally:()=>{this.isLoading=!1,this.formLoading.emit(!1)}}))}}propChanged(){this.initializeApi()}get showAddOwnerButton(){return this.ownersPayload.length<4&&!this.newFormOpen}manageRefs(){this.refs=this.ownersPayload.map((s=>s.id))}async validateAndSubmit({onSuccess:s}){const t=this.refs.map((s=>s.validate()));if(!(await Promise.all(t)).every((s=>s)))return;const e=this.refs.map((s=>s.submit()));(await Promise.all(e)).every((s=>s))&&this.sendData(s)}componentWillLoad(){this.initializeApi(),this.getBusiness&&this.getData()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=o({authToken:this.authToken,businessId:this.businessId,service:new l}),this.patchBusiness=a({authToken:this.authToken,businessId:this.businessId,service:new l})):this.errorEvent.emit({message:"Missing required props",errorCode:n.MISSING_PROPS,severity:r.ERROR})}ownersWatcher(){this.manageRefs()}handleOwnerSubmit(s){const t=s.detail,e=this.ownersPayload.map((s=>s.id===t.id?t:s));e.includes(t)||(e[this.ownersPayload.findIndex((s=>!s.id))]=t,this.newFormOpen&&(this.newFormOpen=!1)),this.ownersPayload=e}render(){if(this.isLoading)return e(i,null,e(D,null));const s=this.ownersPayload.some((s=>s.id===this.representative.id)),t=null===this.representativeIsOwner&&!s;return e(i,null,e("div",null,e("div",{class:"d-flex align-items-center gap-2"},e("legend",{class:"mb-0",part:S},"Owners"),e("form-control-tooltip",{helpText:"For partnerships, LLCs or privately held corporations, the business is required to apply with all individuals with 25% or more ownership to the application. For charities and registered non-profits, the business is required to apply with 1 individual with substantial control over the entity, such as a board member or director."})),e("hr",{class:"mt-2"}),t&&e("div",{class:"alert alert-warning mb-3",part:B},e("div",{class:"card-body"},e("div",{class:"d-flex align-items-center mb-3"},e("strong",null,"Is the representative of this business also an owner?")),e("div",{class:"d-flex gap-2"},e(Q,{variant:"primary",onClick:()=>this.handleRepresentativeIsOwnerChange(!0)},"Yes"),e(Q,{variant:"secondary",onClick:()=>this.handleRepresentativeIsOwnerChange(!1)},"No")))),e("div",{class:"row gy-3"},this.ownersPayload.map((s=>e("justifi-owner-form",{key:s.id,authToken:this.authToken,businessId:this.businessId,ownerId:s.id,removeOwner:this.removeOwnerForm,newFormOpen:this.newFormOpen,ownersLength:this.ownersPayload.length,country:this.country,allowOptionalFields:this.allowOptionalFields,ref:t=>this.matchRef(t,s.id)})))),e("div",{class:"d-flex justify-content-start"},e("div",{class:"gap-2"},e(Q,{variant:"primary",onClick:()=>this.addOwnerForm(!0),hidden:!this.showAddOwnerButton},"Add Owner")))))}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"],ownersPayload:["ownersWatcher"]}}},cs=class{constructor(e){s(this,e),this.errorEvent=t(this,"error-event",7),this.stepCompleteEvent=t(this,"complete-form-step-event",7),this.formLoading=t(this,"formLoading",7),this.errors={},this.representative={},this.isLoading=!1,this.getData=()=>{this.getBusiness&&this.formController&&(this.formLoading.emit(!0),this.isLoading=!0,this.getBusiness({onSuccess:s=>{this.representative=new C(s.data.representative||{}),this.representative.address.country=this.country,this.formController.setInitialValues(Object.assign({},this.representative))},onError:({error:s,code:t,severity:e})=>{this.errorEvent.emit({message:s,errorCode:t,severity:e})},final:()=>{this.formLoading.emit(!1),this.isLoading=!1}}))},this.sendData=s=>{let t;this.formLoading.emit(!0),this.patchBusiness({payload:this.patchPayload,onSuccess:e=>{t=e,s()},onError:({error:s,code:e,severity:i})=>{t=s,this.errorEvent.emit({message:s,errorCode:e,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:t,formStep:V.representative}),this.formLoading.emit(!1)}})}}propChanged(){this.initializeApi(),this.getData()}async validateAndSubmit({onSuccess:s}){this.formController.validateAndSubmit((()=>this.sendData(s)))}componentWillLoad(){this.initializeApi(),this.initializeForm()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=o({authToken:this.authToken,businessId:this.businessId,service:new l}),this.patchBusiness=a({authToken:this.authToken,businessId:this.businessId,service:new l})):this.errorEvent.emit({message:"Missing required props",errorCode:n.MISSING_PROPS,severity:r.ERROR})}initializeForm(){const s=K[this.country];s?(this.formController=new f(s("representative",this.allowOptionalFields)),this.getData()):this.errorEvent.emit({message:"Missing schema for selected country",errorCode:n.MISSING_PROPS,severity:r.ERROR})}componentDidLoad(){this.formController&&this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}get patchPayload(){return{representative:new C(this.formController.values.getValue()).payload}}render(){return!this.formController||this.isLoading?e(D,null):e("justifi-business-representative-form-inputs",{representativeDefaultValue:this.formController.getInitialValues(),errors:this.errors,formController:this.formController,country:this.country})}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},ls=class{constructor(e){s(this,e),this.stepCompleteEvent=t(this,"complete-form-step-event",7),this.errorEvent=t(this,"error-event",7),this.formLoading=t(this,"formLoading",7),this.formCompleted=t(this,"formCompleted",7),this.errors={},this.fetchData=async()=>{this.formLoading.emit(!0);try{const s=await this.api.get({endpoint:this.businessEndpoint,authToken:this.authToken});this.acceptedTermsBefore=s.data.terms_conditions_accepted}catch(s){this.errorEvent.emit({errorCode:n.FETCH_ERROR,message:s.message,severity:r.ERROR,data:s})}finally{this.formLoading.emit(!1)}},this.sendData=async s=>{this.formLoading.emit(!0);try{const t=this.termsPayload,e=await this.api.post({endpoint:this.termsConditionsEndpoint,body:t,authToken:this.authToken});this.handleResponse(e,s)}catch(s){this.errorEvent.emit({errorCode:n.POST_ERROR,message:s.message,severity:r.ERROR,data:s})}finally{this.formLoading.emit(!1)}},this.inputHandler=(s,t)=>{this.acceptedTerms=t,this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:t}))}}get businessEndpoint(){return`entities/business/${this.businessId}`}get termsConditionsEndpoint(){return"entities/terms_and_conditions"}get formHelperText(){return this.acceptedTermsBefore?"You have already accepted the terms and conditions.":null}get termsPayload(){return{business_id:this.businessId,accepted:this.formController.values.getValue().accepted,user_agent:window.navigator.userAgent}}async componentWillLoad(){this.api=Z(),this.formController=new f((s=>{const t=v({accepted:w().oneOf([!0],"You must agree to the terms and conditions to continue").required("You must agree to the terms and conditions to continue")}),e=v({accepted:w().nullable()});return s?e:t})(this.allowOptionalFields)),this.businessId&&this.authToken&&this.fetchData()}handleResponse(s,t){s.error?this.errorEvent.emit({errorCode:n.POST_ERROR,message:s.error.message,severity:r.ERROR,data:s.error}):t(),this.stepCompleteEvent.emit({response:s,formStep:V.termsAndConditions}),this.formCompleted.emit()}async validateAndSubmit({onSuccess:s}){this.acceptedTermsBefore?(this.stepCompleteEvent.emit({response:null,formStep:V.termsAndConditions,metadata:"no data submitted"}),this.formCompleted.emit(),s()):this.formController.validateAndSubmit((()=>this.sendData(s)))}componentDidLoad(){this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}get merchantAgreementLink(){return e("a",{href:"https://justifi.tech/merchant-agreement/",target:"_blank",rel:"noopener noreferrer"},"merchant agreement")}render(){return e("form",{key:"33336d0a66d63ce39951822fd570a9a0689e714d"},e("fieldset",{key:"fcfdb59eef671cb408ed99e2dad20d6be706688a"},e("legend",{key:"f0cf7f0ac15c90cf36ee25d4bf986c0e781a2e92",part:S},"Terms and Conditions"),e("hr",{key:"d5c820e7d6523f931040a994bd103d69fd644c45"}),e("div",{key:"681b584de14afe121f5dc69ee0bad1cab51ba0d1"},e("p",{key:"7c597bf891a108d303739126b806ded5220f56ab"},"Please read and accept the ",this.merchantAgreementLink," to submit your provisioning request.")),e("br",{key:"52854c5a07611180be40df21a5f60d7d9d4c4cb7"}),e("div",{key:"7448b3f6138b996edac137b961367725e3b40556",class:"row-gy-3"},e("div",{key:"c732deb4e1e3a2d04dd4e09914543a7f594af108",class:"col-12"},e("form-control-checkbox",{key:"fca18e4843aef20d13790029b114b2ecaeb6ffa2",name:"accepted",label:"I agree to the terms and conditions",inputHandler:this.inputHandler,errorText:this.errors.accepted,disabled:this.acceptedTermsBefore,helpText:this.formHelperText,checked:this.acceptedTerms})))))}},ds=class{constructor(e){s(this,e),this.errorEvent=t(this,"error-event",7),this.stepCompleteEvent=t(this,"complete-form-step-event",7),this.formLoading=t(this,"formLoading",7),this.errors={},this.legal_address={},this.isLoading=!1,this.getData=()=>{this.getBusiness&&(this.formLoading.emit(!0),this.isLoading=!0,this.getBusiness({onSuccess:s=>{const t=new T((s.data||{}).legal_address||{});this.legal_address=Object.assign(Object.assign({},t),{country:this.country}),this.formController.setInitialValues(Object.assign({},this.legal_address))},onError:({error:s,code:t,severity:e})=>{this.errorEvent.emit({message:s,errorCode:t,severity:e})},final:()=>{this.formLoading.emit(!1),this.isLoading=!1}}))},this.sendData=s=>{let t;this.formLoading.emit(!0),this.patchBusiness({payload:this.patchPayload,onSuccess:e=>{t=e,s()},onError:({error:s,code:e,severity:i})=>{t=s,this.errorEvent.emit({message:s,errorCode:e,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:t,formStep:V.legalAddress}),this.formLoading.emit(!1)}})},this.inputHandler=(s,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:t}))}}propChanged(){this.initializeApi()}async validateAndSubmit({onSuccess:s}){this.formController.validateAndSubmit((()=>this.sendData(s)))}get patchPayload(){return{legal_address:new T(this.formController.values.getValue()).payload}}componentWillLoad(){this.initializeApi(),this.formController=new f((0,$[this.country])(this.allowOptionalFields)),this.getData()}componentDidLoad(){this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=o({authToken:this.authToken,businessId:this.businessId,service:new l}),this.patchBusiness=a({authToken:this.authToken,businessId:this.businessId,service:new l})):this.errorEvent.emit({message:"Missing required props",errorCode:n.MISSING_PROPS,severity:r.ERROR})}render(){var s;const t=null===(s=this.formController)||void 0===s?void 0:s.getInitialValues();return this.isLoading?e(D,null):e("form",null,e("fieldset",null,e("div",{class:"d-flex align-items-center gap-2"},e("legend",{class:"mb-0",part:S},"Legal Address of your Business"),e("form-control-tooltip",{helpText:"No PO Boxes."})),e("hr",{class:"mt-2"}),e("justifi-form-address-fields",{country:this.country,errors:this.errors,defaultValues:t,inputHandler:this.inputHandler})))}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},us=class{constructor(t){s(this,t)}get showPreviousStepButton(){return this.currentStep>0}get showNextStepButton(){return this.currentStep<this.totalSteps}get showSubmitButton(){return this.currentStep===this.totalSteps}render(){return e("div",{key:"53ba6c809e1968712b333f4bcf2798dbca186ddb",class:"d-flex gap-2"},e(Q,{key:"b45c60083ccf6589cae0c63ce6b66c18da340dc7",variant:"secondary",type:"button",onClick:()=>this.previousStepButtonOnClick(),disabled:this.formDisabled,hidden:!this.showPreviousStepButton},"Previous"),e(Q,{key:"27372798da0276de44d1563a4688486e7cc91d64",variant:"primary",type:"button",onClick:s=>this.nextStepButtonOnClick(s,F.nextStep),disabled:this.formDisabled,isLoading:this.formLoading,hidden:!this.showNextStepButton},"Next"),e(Q,{key:"8bc14ca8fe951caf276f8ed03e502486e11acbe2",variant:"primary",type:"submit",onClick:s=>this.nextStepButtonOnClick(s,F.submit),disabled:this.formDisabled,isLoading:this.formLoading,hidden:!this.showSubmitButton},"Submit"))}},ms=class{constructor(t){s(this,t),this.allowOptionalFields=!1,this.country=k.USA,this.componentStepMapping={0:()=>e("justifi-business-core-info-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[0]=s,allowOptionalFields:this.allowOptionalFields,country:this.country}),1:()=>e("justifi-legal-address-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[1]=s,allowOptionalFields:this.allowOptionalFields,country:this.country}),2:()=>e("justifi-additional-questions-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[2]=s,allowOptionalFields:this.allowOptionalFields}),3:()=>e("justifi-business-representative-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[3]=s,allowOptionalFields:this.allowOptionalFields,country:this.country}),4:()=>e("justifi-business-owners-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[4]=s,allowOptionalFields:this.allowOptionalFields,country:this.country}),5:()=>e("justifi-business-bank-account-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[5]=s,allowOptionalFields:this.allowOptionalFields,country:this.country}),6:()=>e("justifi-business-terms-conditions-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[6]=s,onFormLoading:this.handleFormLoading,allowOptionalFields:this.allowOptionalFields})}}get currentStepComponent(){return this.componentStepMapping[this.currentStep]()}render(){return e("div",{key:"ff7c9e688009383fdbe18c9824fa578d2338900c",class:"col-12 mb-4"},this.currentStepComponent)}};export{ts as justifi_additional_questions_form_step,os as justifi_business_bank_account_form_step,as as justifi_business_core_info_form_step,hs as justifi_business_owners_form_step,cs as justifi_business_representative_form_step,ls as justifi_business_terms_conditions_form_step,ds as justifi_legal_address_form_step,us as justifi_payment_provisioning_form_buttons,ms as justifi_payment_provisioning_form_steps}