@justifi/webcomponents 6.14.4-rc.2 → 6.14.4

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 (447) hide show
  1. package/LICENSE +21 -0
  2. package/dist/cjs/{Analytics-DahOCpJB.js → Analytics-CMv0MKQ4.js} +3 -3
  3. package/dist/cjs/{Api-B4fSXAdi.js → Api-ChUqJ75C.js} +2 -2
  4. package/dist/cjs/{Plaid-CbaU5Arm.js → Plaid-B2o4c_Ej.js} +2 -0
  5. package/dist/cjs/additional-questions-form-step_15.cjs.entry.js +9 -9
  6. package/dist/cjs/{additional-questions_5.cjs.entry.js → additional-questions_4.cjs.entry.js} +0 -16
  7. package/dist/cjs/additional-statement_8.cjs.entry.js +8 -8
  8. package/dist/cjs/bank-account-billing-form-simple_4.cjs.entry.js +2 -2
  9. package/dist/cjs/bank-account-document-form-inputs.cjs.entry.js +3 -3
  10. package/dist/cjs/bank-account-form.cjs.entry.js +77 -27
  11. package/dist/cjs/{business.service-BAjtyKsg.js → business.service-BSoN1ENP.js} +2 -2
  12. package/dist/cjs/card-form.cjs.entry.js +79 -26
  13. package/dist/cjs/{check-pkg-version-DR4Ghb6-.js → check-pkg-version-mt-o0WFo.js} +1 -1
  14. package/dist/cjs/{checkout-actions-Cm38ZPqN.js → checkout-actions-VCJi-q4z.js} +2 -2
  15. package/dist/cjs/{checkout.service-DyL8PSeF.js → checkout.service-BDUrLWyA.js} +2 -2
  16. package/dist/cjs/{checkout.store-CZHrIuaP.js → checkout.store-DOa1-SjA.js} +18 -4
  17. package/dist/cjs/{payments-list-params-state-vGJZ6Oe2.js → checkouts-list-params-state-DDpRrUTY.js} +1 -1
  18. package/dist/cjs/{config-state-BIgGhhe9.js → config-state-C1YMiFpR.js} +1 -1
  19. package/dist/cjs/dispute-notification_2.cjs.entry.js +12 -12
  20. package/dist/cjs/{event-types-DyRIxSSS.js → event-types-DlZRGu3q.js} +2 -2
  21. package/dist/cjs/{hidden-input_2.cjs.entry.js → form-alert_3.cjs.entry.js} +34 -12
  22. package/dist/cjs/form-control-checkbox.cjs.entry.js +2 -2
  23. package/dist/cjs/form-control-select_2.cjs.entry.js +2 -2
  24. package/dist/cjs/{get-business-B3Jf5X7U.js → get-business-BBDsPv-b.js} +2 -2
  25. package/dist/cjs/{get-payment-details-Q9lHwr8Y.js → get-payment-details-BYZeUFAB.js} +3 -3
  26. package/dist/cjs/{get-subaccounts-Csq0SIVV.js → get-subaccounts-w4iQAASi.js} +4 -4
  27. package/dist/cjs/{index-W-zoNiyM.js → index-DDrfAj-j.js} +21 -15
  28. package/dist/cjs/{insurance-state-B-XQRmMs.js → insurance-state-CHQD1ZGw.js} +1 -1
  29. package/dist/cjs/justifi-apple-pay_11.cjs.entry.js +22 -26
  30. package/dist/cjs/justifi-bank-account-billing-form-simple.cjs.entry.js +7 -7
  31. package/dist/cjs/justifi-bank-account-form.cjs.entry.js +7 -7
  32. package/dist/cjs/justifi-business-details.cjs.entry.js +10 -10
  33. package/dist/cjs/justifi-business-form.cjs.entry.js +10 -10
  34. package/dist/cjs/justifi-card-form.cjs.entry.js +7 -7
  35. package/dist/cjs/justifi-checkout-qr-code.cjs.entry.js +7 -7
  36. package/dist/cjs/justifi-checkout.cjs.entry.js +10 -15
  37. package/dist/cjs/justifi-checkouts-list-filters.cjs.entry.js +6 -6
  38. package/dist/cjs/justifi-checkouts-list.cjs.entry.js +13 -13
  39. package/dist/cjs/justifi-config-provider.cjs.entry.js +2 -2
  40. package/dist/cjs/justifi-dispute-management.cjs.entry.js +10 -10
  41. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +8 -8
  42. package/dist/cjs/justifi-order-terminals.cjs.entry.js +11 -11
  43. package/dist/cjs/justifi-payment-details.cjs.entry.js +10 -10
  44. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +10 -10
  45. package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +9 -9
  46. package/dist/cjs/justifi-payments-list-filters.cjs.entry.js +2 -2
  47. package/dist/cjs/justifi-payments-list.cjs.entry.js +10 -10
  48. package/dist/cjs/justifi-payout-details.cjs.entry.js +10 -10
  49. package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +9 -9
  50. package/dist/cjs/justifi-payouts-list-filters.cjs.entry.js +4 -4
  51. package/dist/cjs/justifi-payouts-list.cjs.entry.js +12 -12
  52. package/dist/cjs/justifi-qr-terminal.cjs.entry.js +10 -10
  53. package/dist/cjs/justifi-refund-payment.cjs.entry.js +12 -12
  54. package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +10 -10
  55. package/dist/cjs/justifi-terminal-orders-list-filters.cjs.entry.js +4 -4
  56. package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +9 -9
  57. package/dist/cjs/justifi-terminals-list-filters.cjs.entry.js +4 -4
  58. package/dist/cjs/justifi-terminals-list.cjs.entry.js +11 -11
  59. package/dist/cjs/loader.cjs.js +1 -1
  60. package/dist/cjs/{package-DkLJAjev.js → package-V2lnhWch.js} +1 -1
  61. package/dist/cjs/{payment-provisioning-actions-DeURi9ZW.js → payment-provisioning-actions-CIsDrh8k.js} +2 -2
  62. package/dist/cjs/{payment.service-CBMsLP9b.js → payment.service-CUuADjYH.js} +2 -2
  63. package/dist/cjs/{checkouts-list-params-state-vGJZ6Oe2.js → payments-list-params-state-DDpRrUTY.js} +1 -1
  64. package/dist/cjs/{payout.service-BAturpCC.js → payout.service-D_gucuzq.js} +2 -2
  65. package/dist/cjs/{payouts-list-params-state-vGJZ6Oe2.js → payouts-list-params-state-DDpRrUTY.js} +1 -1
  66. package/dist/cjs/{payouts-status-BKO9VMJ_.js → payouts-status-DVU5138C.js} +2 -2
  67. package/dist/cjs/{plaid.service-DJ42fz7B.js → plaid.service-DIPjzg_M.js} +2 -2
  68. package/dist/cjs/save-new-payment-method.cjs.entry.js +2 -2
  69. package/dist/cjs/table-filters-menu.cjs.entry.js +1 -1
  70. package/dist/cjs/{terminal-orders-list-params-state-vGJZ6Oe2.js → terminal-orders-list-params-state-DDpRrUTY.js} +1 -1
  71. package/dist/cjs/{terminal.service-C4ksBqBo.js → terminal.service-DVxXWBU7.js} +2 -2
  72. package/dist/cjs/terminals-list-params-state-DDpRrUTY.js +22 -0
  73. package/dist/cjs/{utils-8zgGi717.js → utils-WrOn06xB.js} +1 -1
  74. package/dist/cjs/webcomponents.cjs.js +1 -1
  75. package/dist/collection/api/ComponentError.js +2 -0
  76. package/dist/collection/collection-manifest.json +2 -2
  77. package/dist/collection/components/checkout/bank-account-form/bank-account-form-skeleton.js +1 -5
  78. package/dist/collection/components/checkout/bank-account-form/bank-account-form.js +93 -19
  79. package/dist/collection/components/checkout/card-form/card-form-skeleton.js +1 -5
  80. package/dist/collection/components/checkout/card-form/card-form.js +96 -19
  81. package/dist/collection/components/checkout/justifi-checkout.js +2 -7
  82. package/dist/collection/components/checkout/test/use-bridged-fake-timers.js +14 -0
  83. package/dist/collection/components/checkouts-list/checkouts-list-filters.js +2 -2
  84. package/dist/collection/components/checkouts-list/justifi-checkouts-list.js +2 -2
  85. package/dist/collection/components/dispute-management/dispute-notification.js +2 -2
  86. package/dist/collection/components/dispute-management/dispute-response/additional-statement.js +1 -1
  87. package/dist/collection/components/dispute-management/dispute-response/cancellation-policy.js +1 -1
  88. package/dist/collection/components/dispute-management/dispute-response/customer-details.js +1 -1
  89. package/dist/collection/components/dispute-management/dispute-response/dispute-response.js +1 -1
  90. package/dist/collection/components/dispute-management/dispute-response/duplicate-charge.js +1 -1
  91. package/dist/collection/components/dispute-management/dispute-response/electronic-evidence.js +1 -1
  92. package/dist/collection/components/dispute-management/dispute-response/product-or-service.js +1 -1
  93. package/dist/collection/components/dispute-management/dispute-response/refund-policy.js +1 -1
  94. package/dist/collection/components/dispute-management/dispute-response/shipping-details.js +1 -1
  95. package/dist/collection/components/dispute-management/justifi-dispute-management.js +1 -1
  96. package/dist/collection/components/filters/table-filters-menu.js +1 -1
  97. package/dist/collection/components/modular-checkout/justifi-modular-checkout.js +8 -5
  98. package/dist/collection/components/modular-checkout/sub-components/justifi-apple-pay.js +1 -8
  99. package/dist/collection/components/refund-payment/justifi-refund-payment.js +2 -2
  100. package/dist/collection/store/checkout.store.js +17 -3
  101. package/dist/collection/ui-components/form/form-control-checkbox.js +2 -2
  102. package/dist/collection/ui-components/form/form-control-select.js +2 -2
  103. package/dist/collection/ui-components/form/iframe-input.js +26 -3
  104. package/dist/docs.json +100 -18
  105. package/dist/esm/{Analytics-WT1A3bAb.js → Analytics-C8-CZjVs.js} +4 -4
  106. package/dist/esm/{Api-DoxYyzWs.js → Api-BmZr64rt.js} +2 -2
  107. package/dist/esm/{Business-BcNb9bVO.js → Business-DaDqgDrb.js} +1 -1
  108. package/dist/esm/{Plaid-D389VmvK.js → Plaid-DJ-4YL0_.js} +2 -0
  109. package/dist/esm/additional-questions-details_5.entry.js +2 -2
  110. package/dist/esm/additional-questions-form-step_15.entry.js +19 -19
  111. package/dist/esm/{additional-questions_5.entry.js → additional-questions_4.entry.js} +5 -20
  112. package/dist/esm/additional-statement_8.entry.js +9 -9
  113. package/dist/esm/{badge-Dlcl9qdm.js → badge-B7QMpafx.js} +1 -1
  114. package/dist/esm/bank-account-billing-form-simple_4.entry.js +8 -8
  115. package/dist/esm/bank-account-document-form-inputs.entry.js +4 -4
  116. package/dist/esm/bank-account-form.entry.js +80 -30
  117. package/dist/esm/bank-account-read-only-value.entry.js +1 -1
  118. package/dist/esm/{business-form-options-DXjZp4Rl.js → business-form-options-BxVQL9ar.js} +1 -1
  119. package/dist/esm/{business-identity-schema-CXfLi-Wi.js → business-identity-schema-BkmRlnQo.js} +3 -3
  120. package/dist/esm/{business.service-DhBcj7ui.js → business.service-BTTf2CSv.js} +3 -3
  121. package/dist/esm/{button-BvzOzV4l.js → button-CBzHAOFW.js} +1 -1
  122. package/dist/esm/card-form.entry.js +82 -29
  123. package/dist/esm/{check-pkg-version-BL_f_mbi.js → check-pkg-version-B697jYyG.js} +1 -1
  124. package/dist/esm/{checkout-actions-Bmn6v-SS.js → checkout-actions-DhL8YxrK.js} +2 -2
  125. package/dist/esm/{checkout.service-NUZlIPnJ.js → checkout.service-B3BXVtHv.js} +3 -3
  126. package/dist/esm/{checkout.store-DibfdUMm.js → checkout.store-B6amfNq_.js} +18 -4
  127. package/dist/esm/{checkouts-list-params-state-CiGfmyWW.js → checkouts-list-params-state-DfRLZrOO.js} +1 -1
  128. package/dist/esm/{config-state-kKn89dp1.js → config-state-BKOsYBXZ.js} +1 -1
  129. package/dist/esm/{country-config-CEJVOOGe.js → country-config-CJwnhkdq.js} +1 -1
  130. package/dist/esm/custom-popper_2.entry.js +1 -1
  131. package/dist/esm/dispute-notification_2.entry.js +16 -16
  132. package/dist/esm/{event-types-CXLixpiw.js → event-types-DEIzZDtB.js} +3 -3
  133. package/dist/esm/form-address-fields_3.entry.js +4 -4
  134. package/dist/esm/{hidden-input_2.entry.js → form-alert_3.entry.js} +29 -8
  135. package/dist/esm/form-control-checkbox.entry.js +5 -5
  136. package/dist/esm/form-control-date.entry.js +2 -2
  137. package/dist/esm/{form-control-error-text-Di9QePY5.js → form-control-error-text-FyanxO4T.js} +1 -1
  138. package/dist/esm/form-control-file-v2_2.entry.js +2 -2
  139. package/dist/esm/form-control-file.entry.js +2 -2
  140. package/dist/esm/{form-control-help-text-DGMpMuAm.js → form-control-help-text-DxvEdU36.js} +1 -1
  141. package/dist/esm/form-control-monetary-provisioning.entry.js +3 -3
  142. package/dist/esm/form-control-monetary.entry.js +3 -3
  143. package/dist/esm/form-control-number_2.entry.js +7 -7
  144. package/dist/esm/form-control-radio.entry.js +1 -1
  145. package/dist/esm/form-control-select_2.entry.js +4 -4
  146. package/dist/esm/{get-business-CDr7VlTq.js → get-business-BSyOONF0.js} +3 -3
  147. package/dist/esm/{get-payment-details-CpM_upcS.js → get-payment-details-CoGzqJ6o.js} +4 -4
  148. package/dist/esm/{get-subaccounts-Dnf1EKn1.js → get-subaccounts-CnKtCpiU.js} +5 -5
  149. package/dist/esm/{header-1-evYxFIGN.js → header-1-BI0o3rMW.js} +1 -1
  150. package/dist/esm/{header-3-BUDap2xY.js → header-3-DNqRk_HO.js} +1 -1
  151. package/dist/esm/{index-cDVGjRkU.js → index-3wWWWrhn.js} +21 -15
  152. package/dist/esm/{input-handlers-1lVyzImK.js → input-handlers-Dfuc6aDW.js} +1 -1
  153. package/dist/esm/{insurance-state-C5OZqDCT.js → insurance-state-DM0VaTpH.js} +2 -2
  154. package/dist/esm/internal-button.entry.js +2 -2
  155. package/dist/esm/justifi-apple-pay_11.entry.js +27 -31
  156. package/dist/esm/justifi-bank-account-billing-form-simple.entry.js +8 -8
  157. package/dist/esm/justifi-bank-account-form.entry.js +8 -8
  158. package/dist/esm/justifi-business-details.entry.js +14 -14
  159. package/dist/esm/justifi-business-form.entry.js +19 -19
  160. package/dist/esm/justifi-card-form.entry.js +8 -8
  161. package/dist/esm/justifi-checkout-qr-code.entry.js +8 -8
  162. package/dist/esm/justifi-checkout.entry.js +12 -17
  163. package/dist/esm/justifi-checkouts-list-filters.entry.js +8 -8
  164. package/dist/esm/justifi-checkouts-list.entry.js +18 -18
  165. package/dist/esm/justifi-config-provider.entry.js +2 -2
  166. package/dist/esm/justifi-details.entry.js +2 -2
  167. package/dist/esm/justifi-dispute-management.entry.js +11 -11
  168. package/dist/esm/justifi-gross-payment-chart.entry.js +12 -12
  169. package/dist/esm/justifi-order-terminals.entry.js +14 -14
  170. package/dist/esm/justifi-payment-details.entry.js +16 -16
  171. package/dist/esm/justifi-payment-provisioning.entry.js +15 -15
  172. package/dist/esm/justifi-payment-transactions-list.entry.js +13 -13
  173. package/dist/esm/justifi-payments-list-filters.entry.js +3 -3
  174. package/dist/esm/justifi-payments-list.entry.js +16 -16
  175. package/dist/esm/justifi-payout-details.entry.js +16 -16
  176. package/dist/esm/justifi-payout-transactions-list.entry.js +13 -13
  177. package/dist/esm/justifi-payouts-list-filters.entry.js +6 -6
  178. package/dist/esm/justifi-payouts-list.entry.js +17 -17
  179. package/dist/esm/justifi-qr-terminal.entry.js +11 -11
  180. package/dist/esm/justifi-refund-payment.entry.js +16 -16
  181. package/dist/esm/justifi-saved-payment-method.entry.js +1 -1
  182. package/dist/esm/justifi-season-interruption-insurance.entry.js +13 -13
  183. package/dist/esm/justifi-skeleton.entry.js +2 -2
  184. package/dist/esm/justifi-terminal-orders-list-filters.entry.js +6 -6
  185. package/dist/esm/justifi-terminal-orders-list.entry.js +14 -14
  186. package/dist/esm/justifi-terminals-list-filters.entry.js +6 -6
  187. package/dist/esm/justifi-terminals-list.entry.js +16 -16
  188. package/dist/esm/loader.js +1 -1
  189. package/dist/esm/{package-CrTWHVKE.js → package-DlhPMNzz.js} +1 -1
  190. package/dist/esm/pagination-menu.entry.js +1 -1
  191. package/dist/esm/{parts-CPKMvyV_.js → parts-Bu7gdOaV.js} +1 -1
  192. package/dist/esm/payment-method-option.entry.js +1 -1
  193. package/dist/esm/{payment-provisioning-actions-BJYx_JgF.js → payment-provisioning-actions-DJKGndr3.js} +2 -2
  194. package/dist/esm/payment-provisioning-form-buttons_2.entry.js +3 -3
  195. package/dist/esm/{payment-provisioning-loading-Dve2xQA4.js → payment-provisioning-loading-BxHRVFDi.js} +1 -1
  196. package/dist/esm/{payment.service-UBuViC7e.js → payment.service-Ciw1eGvT.js} +3 -3
  197. package/dist/esm/{payments-list-params-state-CiGfmyWW.js → payments-list-params-state-DfRLZrOO.js} +1 -1
  198. package/dist/esm/{payments-status-BlVUt4C1.js → payments-status-If2fvwlv.js} +1 -1
  199. package/dist/esm/{payout.service-CV2uYm-0.js → payout.service-2jjZOOvC.js} +3 -3
  200. package/dist/esm/{payouts-list-params-state-CiGfmyWW.js → payouts-list-params-state-DfRLZrOO.js} +1 -1
  201. package/dist/esm/{payouts-status-BnB9006T.js → payouts-status-C0nijel1.js} +3 -3
  202. package/dist/esm/{plaid.service-B0mFmUgQ.js → plaid.service-CuAL_uL3.js} +3 -3
  203. package/dist/esm/radio-list-item.entry.js +1 -1
  204. package/dist/esm/save-new-payment-method.entry.js +2 -2
  205. package/dist/esm/{schema-validations-DJilm-Nh.js → schema-validations-8dbMCACI.js} +3 -3
  206. package/dist/esm/{skeleton-BEHo2ypu.js → skeleton-dbktEkFS.js} +1 -1
  207. package/dist/esm/{spinner-DIiQZd6_.js → spinner-EZmqiSfd.js} +1 -1
  208. package/dist/esm/{table-DqGfsdys.js → table-CD17nv9n.js} +2 -2
  209. package/dist/esm/table-filters-menu.entry.js +3 -3
  210. package/dist/esm/{terminal-orders-list-params-state-CiGfmyWW.js → terminal-orders-list-params-state-DfRLZrOO.js} +1 -1
  211. package/dist/esm/terminal-quantity-selector.entry.js +1 -1
  212. package/dist/esm/{terminal.service-ClKFvbFw.js → terminal.service-Di5Ma4sp.js} +3 -3
  213. package/dist/esm/terminals-list-params-state-DfRLZrOO.js +16 -0
  214. package/dist/esm/{utils-CX6puxwf.js → utils-BFduyAPr.js} +1 -1
  215. package/dist/esm/{utils-BdBZQD1G.js → utils-D6LKoG0M.js} +1 -1
  216. package/dist/esm/webcomponents.js +1 -1
  217. package/dist/module/Plaid.js +2 -0
  218. package/dist/module/additional-statement2.js +1 -1
  219. package/dist/module/bank-account-form2.js +84 -25
  220. package/dist/module/business-bank-account-form-step2.js +1 -1
  221. package/dist/module/business-core-info-form-step2.js +1 -1
  222. package/dist/module/business-core-info2.js +1 -1
  223. package/dist/module/business-documents-on-file2.js +1 -1
  224. package/dist/module/business-owners-form-step2.js +1 -1
  225. package/dist/module/business-representative-form-inputs2.js +1 -1
  226. package/dist/module/business-representative2.js +1 -1
  227. package/dist/module/button.js +1 -1
  228. package/dist/module/cancellation-policy2.js +1 -1
  229. package/dist/module/card-form2.js +87 -25
  230. package/dist/module/checkout.store.js +17 -3
  231. package/dist/module/customer-details2.js +1 -1
  232. package/dist/module/dispute-notification2.js +3 -3
  233. package/dist/module/dispute-response2.js +2 -2
  234. package/dist/module/document-upload-list2.js +1 -1
  235. package/dist/module/duplicate-charge2.js +1 -1
  236. package/dist/module/electronic-evidence2.js +1 -1
  237. package/dist/module/form-alert2.js +1 -1
  238. package/dist/module/form-control-checkbox2.js +3 -3
  239. package/dist/module/form-control-select2.js +2 -2
  240. package/dist/module/header-3.js +1 -1
  241. package/dist/module/iframe-input2.js +11 -4
  242. package/dist/module/index3.js +21 -15
  243. package/dist/module/justifi-apple-pay2.js +1 -8
  244. package/dist/module/justifi-bank-account-form.js +8 -2
  245. package/dist/module/justifi-card-form.js +8 -2
  246. package/dist/module/justifi-checkout.js +22 -21
  247. package/dist/module/justifi-checkouts-list-filters.js +2 -2
  248. package/dist/module/justifi-checkouts-list.js +3 -3
  249. package/dist/module/justifi-dispute-management.js +1 -1
  250. package/dist/module/justifi-modular-checkout2.js +8 -5
  251. package/dist/module/justifi-order-terminals.js +1 -1
  252. package/dist/module/justifi-payment-transactions-list.js +1 -1
  253. package/dist/module/justifi-payments-list.js +1 -1
  254. package/dist/module/justifi-payout-transactions-list.js +1 -1
  255. package/dist/module/justifi-payouts-list.js +1 -1
  256. package/dist/module/justifi-refund-payment.js +2 -2
  257. package/dist/module/justifi-terminal-orders-list.js +1 -1
  258. package/dist/module/justifi-terminals-list.js +1 -1
  259. package/dist/module/justifi-tokenize-payment-method2.js +20 -14
  260. package/dist/module/owner-form-inputs2.js +1 -1
  261. package/dist/module/owner-form2.js +1 -1
  262. package/dist/module/package.js +1 -1
  263. package/dist/module/parts.js +1 -1
  264. package/dist/module/plaid-verification2.js +1 -1
  265. package/dist/module/product-or-service2.js +1 -1
  266. package/dist/module/refund-policy2.js +1 -1
  267. package/dist/module/shipping-details2.js +1 -1
  268. package/dist/module/table-filters-menu2.js +1 -1
  269. package/dist/module/table.js +1 -1
  270. package/dist/module/terminal-quantity-selector2.js +1 -1
  271. package/dist/types/api/ComponentError.d.ts +2 -0
  272. package/dist/types/components/checkout/bank-account-form/bank-account-form-skeleton.d.ts +1 -4
  273. package/dist/types/components/checkout/bank-account-form/bank-account-form.d.ts +11 -1
  274. package/dist/types/components/checkout/card-form/card-form-skeleton.d.ts +1 -4
  275. package/dist/types/components/checkout/card-form/card-form.d.ts +12 -2
  276. package/dist/types/components/checkout/test/use-bridged-fake-timers.d.ts +1 -0
  277. package/dist/types/components/modular-checkout/justifi-modular-checkout.d.ts +1 -0
  278. package/dist/types/components/modular-checkout/sub-components/justifi-apple-pay.d.ts +0 -1
  279. package/dist/types/components.d.ts +33 -0
  280. package/dist/types/store/checkout.store.d.ts +1 -3
  281. package/dist/types/ui-components/form/iframe-input.d.ts +2 -0
  282. package/dist/webcomponents/{p-c1ada405.entry.js → p-003cd0b9.entry.js} +1 -1
  283. package/dist/webcomponents/p-041a22dd.entry.js +1 -0
  284. package/dist/webcomponents/{p-ec6978cb.entry.js → p-0464be7b.entry.js} +1 -1
  285. package/dist/webcomponents/p-0ae95f48.entry.js +1 -0
  286. package/dist/webcomponents/p-0c2848c8.entry.js +1 -0
  287. package/dist/webcomponents/{p-26fe714a.entry.js → p-11294ee2.entry.js} +1 -1
  288. package/dist/webcomponents/{p-b46f303d.entry.js → p-1255176f.entry.js} +1 -1
  289. package/dist/webcomponents/{p-1cff91b7.entry.js → p-15934f30.entry.js} +1 -1
  290. package/dist/webcomponents/p-19721f28.entry.js +1 -0
  291. package/dist/webcomponents/{p-2ba48cf1.entry.js → p-1a1591e3.entry.js} +1 -1
  292. package/dist/webcomponents/{p-0a4fcb15.entry.js → p-1cdbe8c1.entry.js} +1 -1
  293. package/dist/webcomponents/{p-debc4768.entry.js → p-2139497d.entry.js} +1 -1
  294. package/dist/webcomponents/{p-f8734760.entry.js → p-34a4924b.entry.js} +1 -1
  295. package/dist/webcomponents/p-359e35b5.entry.js +1 -0
  296. package/dist/webcomponents/{p-8fd18ce2.entry.js → p-36d7033b.entry.js} +1 -1
  297. package/dist/webcomponents/{p-dc0cc4aa.entry.js → p-3ef039ec.entry.js} +1 -1
  298. package/dist/webcomponents/p-40332723.entry.js +1 -0
  299. package/dist/webcomponents/{p-65c3288f.entry.js → p-465e9e1c.entry.js} +1 -1
  300. package/dist/webcomponents/{p-b03e361e.entry.js → p-49e40ebe.entry.js} +1 -1
  301. package/dist/webcomponents/{p-5a58f606.entry.js → p-4d60d249.entry.js} +1 -1
  302. package/dist/webcomponents/p-546e5799.entry.js +1 -0
  303. package/dist/webcomponents/{p-2dfdecbb.entry.js → p-558677a7.entry.js} +1 -1
  304. package/dist/webcomponents/{p-f953fd60.entry.js → p-568b81a2.entry.js} +1 -1
  305. package/dist/webcomponents/{p-BS8j0DWf.js → p-5_w3jWjY.js} +1 -1
  306. package/dist/webcomponents/{p-73deced9.entry.js → p-61eae8cd.entry.js} +1 -1
  307. package/dist/webcomponents/p-63ed941e.entry.js +1 -0
  308. package/dist/webcomponents/p-661f50a9.entry.js +1 -0
  309. package/dist/webcomponents/p-6f34fa90.entry.js +1 -0
  310. package/dist/webcomponents/{p-e020f003.entry.js → p-6f88f836.entry.js} +1 -1
  311. package/dist/webcomponents/{p-9399f4f1.entry.js → p-715df6a8.entry.js} +1 -1
  312. package/dist/webcomponents/p-73f97f6a.entry.js +1 -0
  313. package/dist/webcomponents/{p-06d3d9b6.entry.js → p-74de23d8.entry.js} +1 -1
  314. package/dist/webcomponents/{p-6f5d9579.entry.js → p-8507bd99.entry.js} +1 -1
  315. package/dist/webcomponents/p-851a5865.entry.js +1 -0
  316. package/dist/webcomponents/p-8bf07094.entry.js +1 -0
  317. package/dist/webcomponents/p-8fO8CrtQ.js +1 -0
  318. package/dist/webcomponents/p-9c506058.entry.js +1 -0
  319. package/dist/webcomponents/{p-c1209de0.entry.js → p-9f3b1212.entry.js} +1 -1
  320. package/dist/webcomponents/p-B-Ik8b-s.js +1 -0
  321. package/dist/webcomponents/p-B4Xi-t8v.js +1 -0
  322. package/dist/webcomponents/{p-DVJaoI_m.js → p-B4vLfYnZ.js} +1 -1
  323. package/dist/webcomponents/p-BAB1lPu0.js +1 -0
  324. package/dist/webcomponents/p-BLhz_ggG.js +1 -0
  325. package/dist/webcomponents/p-BTuqVZ6O.js +1 -0
  326. package/dist/webcomponents/{p-Cu7hgXL1.js → p-Bh6Q8AqQ.js} +1 -1
  327. package/dist/webcomponents/{p-D1_eip6x.js → p-Bi_GCMx0.js} +1 -1
  328. package/dist/webcomponents/{p-C7lKXwUt.js → p-BpFSR2PV.js} +1 -1
  329. package/dist/webcomponents/{p-CB69z5Eh.js → p-BsnuluAl.js} +1 -1
  330. package/dist/webcomponents/{p-CPKMvyV_.js → p-Bu7gdOaV.js} +1 -1
  331. package/dist/webcomponents/p-BzjgvHHT.js +1 -0
  332. package/dist/webcomponents/{p-DfL-8Yvt.js → p-C1x6dkgs.js} +1 -1
  333. package/dist/webcomponents/p-CArdj6i_.js +1 -0
  334. package/dist/webcomponents/p-CGnRD4wF.js +1 -0
  335. package/dist/webcomponents/p-CLZcevBz.js +1 -0
  336. package/dist/webcomponents/p-CMvr3y5s.js +1 -0
  337. package/dist/webcomponents/{p-CHo7TfsM.js → p-CU2Dwa94.js} +1 -1
  338. package/dist/webcomponents/p-CZk3i5Tu.js +1 -0
  339. package/dist/webcomponents/p-CaLXuYmg.js +1 -0
  340. package/dist/webcomponents/{p-DPA5TKvQ.js → p-CawcnSoV.js} +1 -1
  341. package/dist/webcomponents/p-CbyGKcz_.js +1 -0
  342. package/dist/webcomponents/{p-CvFpXdzD.js → p-CfYe14W-.js} +1 -1
  343. package/dist/webcomponents/p-Chs1q3Hw.js +1 -0
  344. package/dist/webcomponents/{p-B9fbqJSf.js → p-Co3Rtlnu.js} +1 -1
  345. package/dist/webcomponents/p-CumGHL0N.js +1 -0
  346. package/dist/webcomponents/p-D1H6VUbM.js +1 -0
  347. package/dist/webcomponents/p-D437Px2O.js +1 -0
  348. package/dist/webcomponents/p-DCwSevh5.js +1 -0
  349. package/dist/webcomponents/p-DD9-ceDZ.js +1 -0
  350. package/dist/webcomponents/p-DNuxxP2B.js +1 -0
  351. package/dist/webcomponents/p-DNxN6bjU.js +1 -0
  352. package/dist/webcomponents/p-DUtecvro.js +1 -0
  353. package/dist/webcomponents/{p-BICxxa69.js → p-DZr0wLGh.js} +1 -1
  354. package/dist/webcomponents/{p-BcNb9bVO.js → p-DaDqgDrb.js} +1 -1
  355. package/dist/webcomponents/p-DgTOxu8x.js +1 -0
  356. package/dist/webcomponents/p-Dl0CAW76.js +1 -0
  357. package/dist/webcomponents/p-DlhPMNzz.js +1 -0
  358. package/dist/webcomponents/{p-DHB_XJ12.js → p-Do9dxNjh.js} +1 -1
  359. package/dist/webcomponents/{p-BGD3uog3.js → p-DwLofzXZ.js} +1 -1
  360. package/dist/webcomponents/{p-CHw7tICr.js → p-Dz8KJn2G.js} +1 -1
  361. package/dist/webcomponents/p-MPer3Rw7.js +1 -0
  362. package/dist/webcomponents/{p-BBSnDYJw.js → p-OReJ-ZQb.js} +1 -1
  363. package/dist/webcomponents/{p-33070a71.entry.js → p-a0515894.entry.js} +1 -1
  364. package/dist/webcomponents/{p-76ded81e.entry.js → p-a14d3d7d.entry.js} +1 -1
  365. package/dist/webcomponents/{p-2599e169.entry.js → p-a6f68a03.entry.js} +1 -1
  366. package/dist/webcomponents/{p-49c13952.entry.js → p-af0c6421.entry.js} +1 -1
  367. package/dist/webcomponents/p-b140a8b8.entry.js +1 -0
  368. package/dist/webcomponents/{p-528eef2d.entry.js → p-b17fabdc.entry.js} +1 -1
  369. package/dist/webcomponents/{p-db09f306.entry.js → p-b2129553.entry.js} +1 -1
  370. package/dist/webcomponents/{p-605bd107.entry.js → p-b39dd96b.entry.js} +1 -1
  371. package/dist/webcomponents/{p-8476b45a.entry.js → p-b4d216cf.entry.js} +1 -1
  372. package/dist/webcomponents/{p-e1e91bbb.entry.js → p-b8d46fc5.entry.js} +1 -1
  373. package/dist/webcomponents/{p-53d775b9.entry.js → p-b945fa49.entry.js} +1 -1
  374. package/dist/webcomponents/{p-75b5d6ac.entry.js → p-b9b5d046.entry.js} +1 -1
  375. package/dist/webcomponents/p-bc435cae.entry.js +1 -0
  376. package/dist/webcomponents/{p-52b25165.entry.js → p-bd46911b.entry.js} +1 -1
  377. package/dist/webcomponents/p-bf3866b3.entry.js +1 -0
  378. package/dist/webcomponents/p-c4799285.entry.js +1 -0
  379. package/dist/webcomponents/p-cb5d2198.entry.js +1 -0
  380. package/dist/webcomponents/p-cb977890.entry.js +1 -0
  381. package/dist/webcomponents/{p-58e8d646.entry.js → p-d6122124.entry.js} +1 -1
  382. package/dist/webcomponents/{p-67a444f7.entry.js → p-db71a012.entry.js} +1 -1
  383. package/dist/webcomponents/p-dd2654f5.entry.js +1 -0
  384. package/dist/webcomponents/{p-14a03ad0.entry.js → p-de8c6cd4.entry.js} +1 -1
  385. package/dist/webcomponents/p-eBK-iWrz.js +1 -0
  386. package/dist/webcomponents/{p-9735a37b.entry.js → p-ee78df81.entry.js} +1 -1
  387. package/dist/webcomponents/p-f0083ace.entry.js +1 -0
  388. package/dist/webcomponents/{p-eccc1fc6.entry.js → p-f6941969.entry.js} +1 -1
  389. package/dist/webcomponents/p-f9d0b34d.entry.js +1 -0
  390. package/dist/webcomponents/{p-396ed502.entry.js → p-fbd08a2e.entry.js} +4 -4
  391. package/dist/webcomponents/p-x2oNTAWh.js +1 -0
  392. package/dist/webcomponents/webcomponents.esm.js +1 -1
  393. package/package.json +15 -15
  394. package/dist/cjs/terminals-list-params-state-vGJZ6Oe2.js +0 -22
  395. package/dist/esm/terminals-list-params-state-CiGfmyWW.js +0 -16
  396. package/dist/webcomponents/p-0f2a1ac9.entry.js +0 -1
  397. package/dist/webcomponents/p-1b51dea9.entry.js +0 -1
  398. package/dist/webcomponents/p-1de248b1.entry.js +0 -1
  399. package/dist/webcomponents/p-1e3f096f.entry.js +0 -1
  400. package/dist/webcomponents/p-25215ee7.entry.js +0 -1
  401. package/dist/webcomponents/p-6fe329d6.entry.js +0 -1
  402. package/dist/webcomponents/p-7d61e758.entry.js +0 -1
  403. package/dist/webcomponents/p-7dfe47bf.entry.js +0 -1
  404. package/dist/webcomponents/p-86e0ac37.entry.js +0 -1
  405. package/dist/webcomponents/p-8fabef40.entry.js +0 -1
  406. package/dist/webcomponents/p-925ca097.entry.js +0 -1
  407. package/dist/webcomponents/p-9cc293aa.entry.js +0 -1
  408. package/dist/webcomponents/p-AMVhBsGv.js +0 -1
  409. package/dist/webcomponents/p-AyLerOda.js +0 -1
  410. package/dist/webcomponents/p-B5gBiARs.js +0 -1
  411. package/dist/webcomponents/p-BPTtWj7E.js +0 -1
  412. package/dist/webcomponents/p-B_i1R4O_.js +0 -1
  413. package/dist/webcomponents/p-BmrZbyuT.js +0 -1
  414. package/dist/webcomponents/p-BwPS3971.js +0 -1
  415. package/dist/webcomponents/p-C-Jgmek8.js +0 -1
  416. package/dist/webcomponents/p-C6o0liMT.js +0 -1
  417. package/dist/webcomponents/p-CXIRxyAr.js +0 -1
  418. package/dist/webcomponents/p-CXZRiaUw.js +0 -1
  419. package/dist/webcomponents/p-Ce_W43gc.js +0 -1
  420. package/dist/webcomponents/p-CpGEMRkH.js +0 -1
  421. package/dist/webcomponents/p-CqiVXthx.js +0 -1
  422. package/dist/webcomponents/p-CrTWHVKE.js +0 -1
  423. package/dist/webcomponents/p-D8GTwl9v.js +0 -1
  424. package/dist/webcomponents/p-DMB1dln7.js +0 -1
  425. package/dist/webcomponents/p-DSclFZ32.js +0 -1
  426. package/dist/webcomponents/p-DYHjzFnJ.js +0 -1
  427. package/dist/webcomponents/p-Dm07nLGs.js +0 -1
  428. package/dist/webcomponents/p-Dsm1jN-a.js +0 -1
  429. package/dist/webcomponents/p-Dw63wyhO.js +0 -1
  430. package/dist/webcomponents/p-DyPk4BJt.js +0 -1
  431. package/dist/webcomponents/p-ECg6MX8R.js +0 -1
  432. package/dist/webcomponents/p-Sr5nnVDM.js +0 -1
  433. package/dist/webcomponents/p-Xf0jRfzp.js +0 -1
  434. package/dist/webcomponents/p-a55fe1c2.entry.js +0 -1
  435. package/dist/webcomponents/p-a7c7898d.entry.js +0 -1
  436. package/dist/webcomponents/p-aa3f1d88.entry.js +0 -1
  437. package/dist/webcomponents/p-b2c4f61b.entry.js +0 -1
  438. package/dist/webcomponents/p-b8fcb871.entry.js +0 -1
  439. package/dist/webcomponents/p-ca9886fd.entry.js +0 -1
  440. package/dist/webcomponents/p-d2c8cc7d.entry.js +0 -1
  441. package/dist/webcomponents/p-e3021e22.entry.js +0 -1
  442. package/dist/webcomponents/p-e704d652.entry.js +0 -1
  443. package/dist/webcomponents/p-e7cfee5a.entry.js +0 -1
  444. package/dist/webcomponents/p-fd9b4f83.entry.js +0 -1
  445. package/dist/webcomponents/p-jIDKmNHy.js +0 -1
  446. package/dist/webcomponents/p-rpFC83GL.js +0 -1
  447. package/dist/webcomponents/p-uZ5KAseb.js +0 -1
@@ -0,0 +1 @@
1
+ import{r as t,c as e,h as i,H as s,g as n}from"./p-CV0Pyo1O.js";import{A as a}from"./p-C1x6dkgs.js";import{A as o,r,s as l,t as h,u as c,v as d,w as u,C as p,b as y,c as m,I as v,x as g,y as f,z as b}from"./p-8fO8CrtQ.js";import{S as M}from"./p-05AWudQe.js";import"./p-CZfYo5-1.js";import{S as k}from"./p-eBK-iWrz.js";import{c as w,o as j,a as P,g as T,b as A}from"./p-DNxN6bjU.js";import{t as N,r as C}from"./p-Bu7gdOaV.js";import{f as I}from"./p-Ds_P-dB8.js";import{w as E,c as D}from"./p-B4vLfYnZ.js";import{H as O}from"./p-CZk3i5Tu.js";import{H as S,b as x,h as L,i as z}from"./p-x2oNTAWh.js";import{H as _}from"./p-BAB1lPu0.js";import{J as R}from"./p-BpFSR2PV.js";import{c as U}from"./p-DwLofzXZ.js";import"./p-HXpYMWUU.js";import"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";import{m as B,a as F}from"./p-Dl0CAW76.js";import{C as Y}from"./p-CumGHL0N.js";import{P as Q}from"./p-Chs1q3Hw.js";import{P as V,a as H,b as W}from"./p-DkoufM1t.js";import{C as Z}from"./p-ZpPDShvP.js";import"./p-DlhPMNzz.js";import"./p-DgTOxu8x.js";import"./p-D1H6VUbM.js";const G=class{constructor(i){t(this,i),this.radioClick=e(this,"radio-click",7),this.checked=!1,this.hidden=!1}render(){return i(M,{key:"02955940079320bd9c6bf94e239545385ac36458"},i("radio-list-item",{key:"fc6b98e456e4326b843b2b3248b7327436767cf4",name:this.name,value:this.value,label:this.label,checked:this.checked,hidden:this.hidden,class:this.class,"onRadio-click":t=>this.radioClick.emit(t.detail)}))}};var q;!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"}(q||(q={}));class J{constructor(){this.api=a()}initialize(t){if(this.applePayConfig=new o(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:q.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:q.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:q.MERCHANT_VALIDATION_ERROR,message:t instanceof Error?t.message:"Merchant validation failed"}})}},this.currentSession.onpaymentauthorized=async n=>{try{const a=n.payment,o=Object.assign(Object.assign({},a.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,o);l.success?(this.currentSession.completePayment({status:h.STATUS_SUCCESS}),t({success:!0,token:a.token,paymentMethodId:l.data.id})):(console.error("PSP reported payment failure:",l.data),this.currentSession.completePayment({status:h.STATUS_FAILURE}),e({success:!1,error:{code:q.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:h.STATUS_FAILURE}),e({success:!1,error:{code:q.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:h.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:q.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:q.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 K=t=>{const{isLoading:e}=t;return e?i("div",{class:"container-fluid p-0"},i("div",{class:"row mb-3"},i("div",{class:"col-12 align-content-center"},i(k,{height:"44px",width:"100%",styles:{borderRadius:"8px"}})))):null},X=t=>i("div",{class:"apple-pay-button-container"},i("button",Object.assign({class:(()=>{let e="apple-pay-button";switch(t.buttonStyle){case c.WHITE:e+=" apple-pay-button-white";break;case c.WHITE_OUTLINE:e+=" apple-pay-button-white-outline";break;default:e+=" apple-pay-button-black"}switch(t.buttonType){case d.BUY:e+=" apple-pay-button-type-buy";break;case d.DONATE:e+=" apple-pay-button-type-donate";break;default:e+=" apple-pay-button-type-plain"}return(t.disabled||t.isProcessing||!t.isAvailable)&&(e+=" disabled"),e})(),style:{width:t.width,height:t.height},onClick:()=>{!t.disabled&&!t.isProcessing&&t.isAvailable&&t.clickHandler&&t.clickHandler()},disabled:t.disabled||t.isProcessing||!t.isAvailable,"aria-label":"Pay with Apple Pay",type:"button"},t),t.isProcessing&&i("div",{class:"processing-overlay"},i("div",{class:"spinner"}),i("span",null,"Processing..."))),i("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(i){t(this,i),this.applePayStarted=e(this,"applePayStarted",7),this.applePayCompleted=e(this,"applePayCompleted",7),this.applePayCancelled=e(this,"applePayCancelled",7),this.applePayError=e(this,"applePayError",7),this.sdkLoaded=!1,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=c.BLACK,this.disabled=!1,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:w.paymentCurrency,merchantCapabilities:[u.SUPPORTS_3DS,u.SUPPORTS_CREDIT,u.SUPPORTS_DEBIT],supportedNetworks:r.getDefaultSupportedNetworks(),total:r.createLineItem(w.paymentDescription,w.paymentAmount)},s=await this.applePayService.startPaymentSession(i,w.authToken,w.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)===q.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}}}componentWillLoad(){this.isAvailable=r.isApplePaySupported(),this.isAvailable?w.checkoutLoaded?this.loadApplePaySDK():j("checkoutLoaded",(t=>{t&&this.loadApplePaySDK()})):this.isLoading=!1}loadApplePaySDK(){if(this.sdkLoaded)return;this.sdkLoaded=!0;const t=document.createElement("script");t.src="https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js",t.async=!0,t.onload=()=>this.initializeApplePay(),document.head.appendChild(t)}async initializeApplePay(){try{if(this.isLoading=!0,this.error=null,this.isConfigValid=!0,!(Boolean(w.paymentAmount)&&Boolean(w.paymentCurrency)&&Boolean(w.authToken)))return this.error="Missing required Apple Pay configuration",this.isConfigValid=!1,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",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",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 J,this.applePayService.initialize(t),await this.applePayService.canMakePaymentsWithActiveCard()||console.warn("No Apple Pay cards available, but continuing...")}catch(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(){var t;null===(t=this.applePayService)||void 0===t||t.abortPaymentSession(),this.isProcessing=!1,this.applePayCancelled.emit()}render(){if(!w.applePayEnabled)return null;if(!this.isAvailable)return null;const t=!this.isLoading&&this.isAvailable&&this.canMakePayments&&this.isConfigValid;return i(M,null,i("div",{class:"apple-pay-container"},i(K,{isLoading:this.isLoading}),t&&i(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})),i("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 tt=class{constructor(e){t(this,e),this.variant="primary",this.type="button"}render(){return i(M,{key:"241fe8903788f0442b42bf5a6835d152d1944967"},i("internal-button",{key:"7c13bd1fa53cf9faae26e521af5a40a08659fe92",text:this.text,variant:this.variant,isLoading:this.isLoading,clickHandler:this.clickHandler,type:this.type,disabled:this.disabled,class:this.class,customStyle:this.customStyle,hidden:this.hidden}))}},et=class{constructor(e){t(this,e)}render(){return i(M,{key:"336fa6563952ee7905c2ed4a3330d73bbb33a0eb"},i("section",{key:"48b8798a925d618f5a2c52d743190207b78eb70a"},i("div",{key:"81d91167c10ccc49acb039ea54a9f97f4aa6e305"},i("div",{key:"9744242f2c2c3082e9c1a3af6e716ec4cb28f1fd",part:N},null==w?void 0:w.paymentDescription),i("div",{key:"438062935abd2f00495c432ef6652e3808e5215f"},i("span",{key:"e3f24d9c52ddae0206cbefe61bd08f24697fe28e",part:N},"Total")," ",i("span",{key:"9835cb60de31a2c8946b7ac2dd6d1fa82f223110",part:N},I(+(null==w?void 0:w.totalAmount)))))))}},it=t=>{const{isLoading:e}=t;return e?i("div",{class:"container-fluid p-0"},i("div",{class:"row mb-3"},i("div",{class:"col-12 align-content-center"},i(k,{height:"44px",width:"100%",styles:{borderRadius:"8px"}})))):null};var st;!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"}(st||(st={}));const nt=class{constructor(i){t(this,i),this.googlePayStarted=e(this,"googlePayStarted",7),this.googlePayCompleted=e(this,"googlePayCompleted",7),this.googlePayCancelled=e(this,"googlePayCancelled",7),this.merchantDisplayName="JustiFi Checkout",this.useNativePaymentRequest=!1,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 st.ready:this.iframeReady=!0;break;case st.sdkLoaded:this.sdkLoaded=!0,this.sendInitialize();break;case st.initializeResult:this.isReadyToPay=i.isReadyToPay,i.error&&console.error("Init error:",i.error);break;case st.error:console.error("Google Pay error:",i);break;case st.buttonClicked:this.googlePayStarted.emit(),this.sendStartPayment();break;case st.paymentSuccess:this.googlePayCompleted.emit({success:!0,paymentMethodId:i.paymentMethodId,cardNetwork:i.cardNetwork,cardDetails:i.cardDetails});break;case st.paymentCanceled:this.googlePayCancelled.emit();break;case st.paymentError:this.googlePayCompleted.emit({success:!1,error:{code:i.code,message:i.message}})}}}async componentWillLoad(){await E(),this.iframeOrigin=D.iframeOrigin}componentDidLoad(){window.addEventListener("message",this.handleMessage)}disconnectedCallback(){window.removeEventListener("message",this.handleMessage)}googlePayEnvironment(){return void 0!==this.environment?this.environment:"test"===w.checkoutMode?"TEST":"PRODUCTION"}sendInitialize(){var t;if(!(null===(t=this.iframeElement)||void 0===t?void 0:t.contentWindow))return;const e={environment:this.googlePayEnvironment(),gatewayMerchantId:w.accountId,merchantName:this.merchantDisplayName,authToken:w.authToken,accountId:w.accountId,useNativePaymentRequest:this.useNativePaymentRequest};this.iframeElement.contentWindow.postMessage({eventType:st.initialize,data:e},this.iframeOrigin)}sendStartPayment(){var t;if(!(null===(t=this.iframeElement)||void 0===t?void 0:t.contentWindow))return;const e={totalPrice:String(w.paymentAmount/100),totalPriceStatus:"FINAL",currencyCode:w.paymentCurrency||"USD"};this.iframeElement.contentWindow.postMessage({eventType:st.startPayment,data:e},this.iframeOrigin)}render(){return w.checkoutLoaded?w.googlePayEnabled?i(s,null,i(it,{isLoading:!this.isReadyToPay}),i("iframe",{ref:t=>this.iframeElement=t,src:`${this.iframeOrigin}/v2/googlePay`,allow:"payment",style:{border:"none",width:"100%",height:"48px",display:this.isReadyToPay?"block":"none"}})):(console.warn("Google Pay is not enabled for this checkout"),null):null}},at=class{constructor(e){t(this,e),this.levels={h1:O,h2:S,h3:_},this.level="h1"}render(){return i(M,{key:"5a0872ee486bdba3ba1c86145946889bb7d151f2"},i(this.levels[this.level],{key:"89807e249cdf64f7ef80800276cb50966083f28e",text:this.text,class:this.class}))}},ot=class{constructor(i){t(this,i),this.errorEvent=e(this,"error-event",7),this.submitEvent=e(this,"submit-event",7),this.checkoutChangedEvent=e(this,"checkout-changed",7),this.plaidService=new Q,this.handleApplePayStarted=()=>{w.isWalletProcessing=!0},this.handleGooglePayStarted=()=>{w.isWalletProcessing=!0},this.handleGooglePayCompleted=t=>{const{success:e,paymentMethodId:i,error:s}=t.detail||{};e&&i?(w.isWalletProcessing=!1,w.paymentToken=i,w.selectedPaymentMethod={type:V.GOOGLE_PAY},this.submitCheckout()):(w.isWalletProcessing=!1,this.errorEvent.emit({message:s&&s.message||"Google Pay payment failed",errorCode:y.TOKENIZE_ERROR,severity:p.ERROR}))},this.handleGooglePayCancelled=()=>{w.isWalletProcessing=!1,w.paymentToken=void 0,w.selectedPaymentMethod=void 0},this.handleApplePayCompleted=t=>{const{success:e,token:i,paymentMethodId:s,error:n}=t.detail;e&&i?(w.isWalletProcessing=!1,w.paymentToken=s,w.selectedPaymentMethod={type:V.APPLE_PAY},this.submitCheckout()):(w.isWalletProcessing=!1,console.error("Apple Pay completed but failed:",n),this.errorEvent.emit({message:(null==n?void 0:n.message)||"Apple Pay payment failed",errorCode:y.TOKENIZE_ERROR,severity:p.ERROR}))},this.handleApplePayError=t=>{w.isWalletProcessing=!1;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:p.ERROR})},this.handleApplePayCancelled=()=>{w.isWalletProcessing=!1,w.paymentToken=void 0,w.selectedPaymentMethod=void 0}}connectedCallback(){var t;this.observer=new MutationObserver((()=>{this.queryFormRefs(),this.setupApplePayListeners(),this.setupGooglePayListeners()})),this.observer.observe(this.hostEl,{childList:!0,subtree:!0}),w.checkoutId=this.checkoutId;const e={authToken:this.authToken,checkoutId:this.checkoutId,service:new Y};this.getCheckout=B(e),this.completeCheckout=F(e),null===(t=this.unsubscribeCheckoutChanges)||void 0===t||t.call(this),this.unsubscribeCheckoutChanges=P((()=>{this.emitCheckoutChanged()}))}componentWillLoad(){this.analytics=new R(this),U(),w.authToken=this.authToken,this.fetchCheckout(),x("set",(t=>{const e=z[t];void 0!==e&&L(t,e)&&this.fetchCheckout()}))}componentDidLoad(){this.queryFormRefs(),this.setupApplePayListeners(),this.setupGooglePayListeners()}disconnectedCallback(){var t,e;null===(t=this.unsubscribeCheckoutChanges)||void 0===t||t.call(this),this.unsubscribeCheckoutChanges=void 0,null===(e=this.observer)||void 0===e||e.disconnect(),this.removeApplePayListeners(),this.removeGooglePayListeners()}fetchCheckout(){this.authToken&&this.checkoutId?this.getCheckout&&this.getCheckout({onSuccess:({checkout:t})=>{this.updateStore(t),t.status!==v.completed?t.status!==v.expired||this.errorEvent.emit({message:m.CHECKOUT_EXPIRED,errorCode:y.CHECKOUT_EXPIRED,severity:p.ERROR}):this.errorEvent.emit({message:m.CHECKOUT_ALREADY_COMPLETED,errorCode:y.CHECKOUT_ALREADY_COMPLETED,severity:p.ERROR})},onError:t=>{this.errorEvent.emit({message:t.message,errorCode:t.code,severity:t.severity})}}):this.errorEvent.emit({message:m.NOT_AUTHENTICATED,errorCode:y.NOT_AUTHENTICATED,severity:p.ERROR})}updateStore(t){var e,i,s,n,a,o,r,l;w.accountId=t.account_id,w.checkoutLoaded=!0;const h=null!=t.mode?String(t.mode).toLowerCase():"";w.checkoutMode="test"===h?"test":"live"===h?"live":null;const c=t.payment_methods.map((t=>new H(t))),d=Boolean(null===(e=t.payment_settings)||void 0===e?void 0:e.ach_payments);w.paymentMethods=c.filter((t=>t.type!==V.SAVED_BANK_ACCOUNT||d)),w.paymentMethodGroupId=t.payment_method_group_id,w.paymentDescription=t.payment_description,w.totalAmount=t.total_amount,w.paymentAmount=t.payment_amount,w.bnplEnabled=t.payment_settings.bnpl_payments,w.insuranceEnabled=t.payment_settings.insurance_payments,w.bankAccountVerification=null===(i=t.payment_settings)||void 0===i?void 0:i.bank_account_verification,w.applePayEnabled=null===(s=t.payment_settings)||void 0===s?void 0:s.apple_payments,w.googlePayEnabled=null===(n=t.payment_settings)||void 0===n?void 0:n.google_payments,w.achPaymentsEnabled=d,w.bnplProviderClientId=null===(a=null==t?void 0:t.bnpl)||void 0===a?void 0:a.provider_client_id,w.bnplProviderMode=null===(o=null==t?void 0:t.bnpl)||void 0===o?void 0:o.provider_mode,w.bnplProviderApiVersion=null===(r=null==t?void 0:t.bnpl)||void 0===r?void 0:r.provider_api_version,w.bnplProviderCheckoutUrl=null===(l=null==t?void 0:t.bnpl)||void 0===l?void 0:l.provider_checkout_url}emitCheckoutChanged(){const t={availablePaymentMethodTypes:T(),selectedPaymentMethod:w.selectedPaymentMethod,savedPaymentMethods:w.paymentMethods};this.checkoutChangedEvent.emit(t)}queryFormRefs(){if(this.billingFormRef=this.hostEl.querySelector("justifi-billing-form, justifi-bank-account-billing-form-simple, justifi-card-billing-form-simple, justifi-billing-form-full, justifi-tokenize-payment-method"),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"),!w.selectedPaymentMethod&&this.paymentMethodFormRef){const t=this.paymentMethodFormRef.tagName.toLowerCase();"justifi-card-form"===t?w.selectedPaymentMethod={type:V.NEW_CARD}:"justifi-bank-account-form"!==t||w.checkoutLoaded&&!w.achPaymentsEnabled||(w.selectedPaymentMethod={type:V.NEW_BANK_ACCOUNT})}this.insuranceFormRef=this.hostEl.querySelector("justifi-season-interruption-insurance")}setupApplePayListeners(){this.applePayRef&&(this.applePayRef.addEventListener("applePayStarted",this.handleApplePayStarted),this.applePayRef.addEventListener("applePayCompleted",this.handleApplePayCompleted),this.applePayRef.addEventListener("applePayError",this.handleApplePayError),this.applePayRef.addEventListener("applePayCancelled",this.handleApplePayCancelled))}removeApplePayListeners(){this.applePayRef&&(this.applePayRef.removeEventListener("applePayStarted",this.handleApplePayStarted),this.applePayRef.removeEventListener("applePayCompleted",this.handleApplePayCompleted),this.applePayRef.removeEventListener("applePayError",this.handleApplePayError),this.applePayRef.removeEventListener("applePayCancelled",this.handleApplePayCancelled))}setupGooglePayListeners(){this.googlePayRef&&(this.googlePayRef.addEventListener("googlePayStarted",this.handleGooglePayStarted),this.googlePayRef.addEventListener("googlePayCompleted",this.handleGooglePayCompleted),this.googlePayRef.addEventListener("googlePayCancelled",this.handleGooglePayCancelled))}removeGooglePayListeners(){this.googlePayRef&&(this.googlePayRef.removeEventListener("googlePayStarted",this.handleGooglePayStarted),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:{},a=Object.assign(Object.assign({},t),n),o=Object.assign({accountId:w.accountId,payment_method_group_id:void 0},a);w.savePaymentMethod&&(o.payment_method_group_id=w.paymentMethodGroupId);const r=await(null===(s=this.paymentMethodFormRef)||void 0===s?void 0:s.tokenize({clientId:this.authToken,paymentMethodMetadata:o,account:w.accountId}));return r.error?r:(w.paymentToken=r.id,r.id)}async fillBillingForm(t){w.billingFormFields=t}async setSelectedPaymentMethod(t){w.selectedPaymentMethod=t,w.paymentToken=t.id||void 0}async validate(){var t,e;const i=[];w.insuranceEnabled&&this.insuranceFormRef&&i.push(this.insuranceFormRef.validate());const s=(null===(t=w.selectedPaymentMethod)||void 0===t?void 0:t.type)===V.NEW_CARD,n=(null===(e=w.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:y.VALIDATION_ERROR,severity:p.ERROR}),!1)}catch(t){return!1}}async submitCheckout(t){var e,i,s,n,a;if(w.isSubmitting)return;w.isSubmitting=!0;const o=await this.validate();if(!w.selectedPaymentMethod)return w.isSubmitting=!1,void this.errorEvent.emit({message:"No payment method selected.",errorCode:y.VALIDATION_ERROR,severity:p.ERROR});const r=(null===(e=w.selectedPaymentMethod)||void 0===e?void 0:e.type)===V.NEW_CARD,l=(null===(i=w.selectedPaymentMethod)||void 0===i?void 0:i.type)===V.NEW_BANK_ACCOUNT,h=(null===(s=w.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 w.isSubmitting=!1,void this.errorEvent.emit({message:e.error.message,errorCode:y.TOKENIZE_ERROR,severity:p.ERROR})}if(h&&!w.paymentToken){const t=w.plaidPublicToken,e=w.plaidLinkTokenId;if(!t)return w.isSubmitting=!1,void this.errorEvent.emit({message:"Missing Plaid public token. Please connect your bank.",errorCode:y.TOKENIZE_ERROR,severity:p.ERROR});try{const i=await this.plaidService.tokenizeBankAccount(w.authToken,w.accountId,t,e||void 0,w.savePaymentMethod?w.paymentMethodGroupId:void 0);if(null==i?void 0:i.error)return w.isSubmitting=!1,void this.errorEvent.emit({message:"string"==typeof i.error?i.error:i.error.message||"Failed to tokenize bank account",errorCode:y.TOKENIZE_ERROR,severity:p.ERROR});const s=null==i?void 0:i.data,a=(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);w.paymentToken=a}catch(t){return w.isSubmitting=!1,void this.errorEvent.emit({message:(null==t?void 0:t.message)||"Plaid exchange error",errorCode:y.TOKENIZE_ERROR,severity:p.ERROR})}}if(!o)return w.isSubmitting=!1,void this.errorEvent.emit({message:"Please fill in all required fields.",errorCode:y.VALIDATION_ERROR,severity:p.ERROR});if(!w.paymentToken)return w.isSubmitting=!1,void this.errorEvent.emit({message:"Payment token not found.",errorCode:y.TOKENIZE_ERROR,severity:p.ERROR});const c={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 W.ECOM;case V.SEZZLE:return W.BNPL;case V.APPLE_PAY:return W.APPLE_PAY;case V.GOOGLE_PAY:return W.GOOGLE_PAY;default:return}})(null===(a=w.selectedPaymentMethod)||void 0===a?void 0:a.type),payment_token:w.paymentToken};if(this.preCompleteHook){const t=A();try{await new Promise(((e,i)=>{this.preCompleteHook(t,(()=>e()),(()=>i()))}))}catch(t){return w.isSubmitting=!1,void console.log("Checkout cancelled by preCompleteHook",t)}}this.completeCheckout({payment:c,onSuccess:({checkout:t})=>{w.isSubmitting=!1,this.submitEvent.emit({checkout:t,message:"Checkout completed successfully"})},onError:t=>{w.isSubmitting=!1,this.errorEvent.emit({message:t.message,errorCode:y.COMPLETE_CHECKOUT_ERROR,severity:p.ERROR})}})}render(){return i(s,{key:"95cee2812d5dfb7593acad24a259cc075f195334"})}get hostEl(){return n(this)}},rt=class{constructor(i){t(this,i),this.paymentMethodOptionSelected=e(this,"paymentMethodOptionSelected",7),this.plaidError=e(this,"plaidError",7),this.plaidErrorRecovered=e(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.sdkLoaded=!1,this.plaidService=new Q,this.maxRetries=3,this.retryDelay=2e3,this.timeoutId=null,this.abortController=null,this.hasLoggedDisabledWarning=!1,this.hasLoggedAchPaymentsDisabledWarning=!1,this.waitForStoreAndInitialize=()=>{w.authToken&&w.accountId&&w.checkoutId?this.initializePlaidLink():setTimeout((()=>{this.waitForStoreAndInitialize()}),100)},this.initializePlaidLink=async()=>{try{if(void 0===window.Plaid)return void this.handleError({code:b.PLAID_SDK_LOAD_FAILED,message:f[b.PLAID_SDK_LOAD_FAILED],severity:g[b.PLAID_SDK_LOAD_FAILED],retryable:!0,userAction:"Refresh the page and try again"});if(await this.getLinkToken(),!this.linkToken)return void this.handleError({code:b.PLAID_LINK_TOKEN_FAILED,message:f[b.PLAID_LINK_TOKEN_FAILED],severity:g[b.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:b.PLAID_LINK_INIT_FAILED,message:f[b.PLAID_LINK_INIT_FAILED],severity:g[b.PLAID_LINK_INIT_FAILED],originalError:t,retryable:!0,userAction:"Click to try again"})}},this.getLinkToken=async()=>{var t,e,i,s,n;try{if(!w.authToken||!w.accountId)return void this.handleError({code:b.PLAID_LINK_TOKEN_FAILED,message:"Missing authentication. Please refresh the page and try again.",severity:p.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(w.authToken,w.accountId,w.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&&(w.plaidLinkTokenId=this.linkTokenId)}catch(t){this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null);let a=b.PLAID_LINK_TOKEN_FAILED,o=f[a],r=!0;"AbortError"===t.name?(a=b.PLAID_TIMEOUT,o=f[a],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"))?(a=b.PLAID_NETWORK_ERROR,o=f[a],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")))&&(a=b.PLAID_INVALID_CREDENTIALS,o="Authentication failed. Please refresh the page and try again.",r=!1),this.handleError({code:a,message:o,severity:g[a],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 b.PLAID_RATE_LIMITED;if(t.includes("maintenance"))return b.PLAID_MAINTENANCE;if(t.includes("not_authenticated"))return b.PLAID_INVALID_CREDENTIALS}if(null==t?void 0:t.code)switch(t.code){case"rate_limited":return b.PLAID_RATE_LIMITED;case"maintenance":return b.PLAID_MAINTENANCE;case"not_authenticated":return b.PLAID_INVALID_CREDENTIALS;default:return b.PLAID_LINK_TOKEN_FAILED}return b.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,w.selectedPaymentMethod={type:V.PLAID}),this.plaidErrorRecovered.emit({code:"plaid-success",message:"Bank account connected successfully",severity:p.INFO}),w.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=b.PLAID_AUTHENTICATION_FAILED,i=f[e],s=!0,n="Click to try again";if(t.error_code)switch(t.error_code){case"INVALID_CREDENTIALS":e=b.PLAID_INVALID_CREDENTIALS,i=f[e],s=!0;break;case"ITEM_LOGIN_REQUIRED":e=b.PLAID_INVALID_CREDENTIALS,i="Your bank requires re-authentication. Please try again.",s=!0;break;case"ITEM_LOCKED":e=b.PLAID_ACCOUNT_LOCKED,i=f[e],s=!1,n="Contact your bank";break;case"INSTITUTION_NOT_RESPONDING":e=b.PLAID_MAINTENANCE,i=f[e],s=!0;break;case"RATE_LIMIT_EXCEEDED":e=b.PLAID_RATE_LIMITED,i=f[e],s=!0;break;case"INVALID_REQUEST":e=b.PLAID_AUTHENTICATION_FAILED,i="Invalid request. Please try again.",s=!0;break;case"PLAID_ERROR":e=b.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 a=t.error_message.toLowerCase();a.includes("not supported")||a.includes("unsupported")?(e=b.PLAID_BANK_NOT_SUPPORTED,i=f[e],s=!1,n="Try a different payment method"):(a.includes("expired")||a.includes("timeout"))&&(e=b.PLAID_TOKEN_EXPIRED,i=f[e],s=!0)}this.handleError({code:e,message:i,severity:g[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=w.selectedPaymentMethod)||void 0===t?void 0:t.type)===V.PLAID;this.isSelected!==e&&(this.isSelected=e)}}onSelectionChange(t){var e;t&&(null===(e=w.selectedPaymentMethod)||void 0===e?void 0:e.type)!==V.PLAID&&(w.selectedPaymentMethod={type:V.PLAID}),!t||!this.plaidLink||this.publicToken||this.isAuthenticating||this.error||this.openPlaidLink()}componentWillLoad(){var t;this.isSelected=(null===(t=w.selectedPaymentMethod)||void 0===t?void 0:t.type)===V.PLAID,!0===w.bankAccountVerification&&(w.checkoutLoaded?w.achPaymentsEnabled&&this.loadPlaidSDK():j("checkoutLoaded",(t=>{t&&!0===w.bankAccountVerification&&w.achPaymentsEnabled&&this.loadPlaidSDK()})))}loadPlaidSDK(){if(this.sdkLoaded)return;this.sdkLoaded=!0;const t=document.createElement("script");t.src="https://cdn.plaid.com/link/v2/stable/link-initialize.js",t.async=!0,t.onload=()=>this.initializePlaidLink(),t.onerror=()=>{this.handleError({code:b.PLAID_SDK_LOAD_FAILED,message:f[b.PLAID_SDK_LOAD_FAILED],severity:g[b.PLAID_SDK_LOAD_FAILED],retryable:!0,userAction:"Refresh the page and try again"})},document.head.appendChild(t)}async resolvePaymentMethod(){return this.publicToken?{token:this.publicToken,data:{type:"bank_account",plaid_public_token:this.publicToken}}:{validationError:!0}}async getPaymentToken(){return w.paymentToken}async handleSelectionClick(){if(this.isSelected=!0,w.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&&(w.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(w.checkoutLoaded&&!w.achPaymentsEnabled)return this.hasLoggedAchPaymentsDisabledWarning||(console.warn("[JustifiPlaidPaymentMethod] ACH payments are disabled for this checkout. Component will not render."),this.hasLoggedAchPaymentsDisabledWarning=!0),null;if(!0!==w.bankAccountVerification)return this.hasLoggedDisabledWarning||(console.warn("[JustifiPlaidPaymentMethod] bank_account_verification is disabled. Component will not render."),this.hasLoggedDisabledWarning=!0),null;const t=i("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 i(M,{class:"payment-method"},i("div",{title:"Pay with Plaid"},i("div",{onClick:t=>{t.preventDefault(),this.handleSelectionClick()}},"Pay with Bank Account ",t," "),(()=>this.error?i("div",{class:(this.error.severity===p.ERROR?"text-danger":this.error.severity===p.WARNING?"text-warning":"text-info")+" mt-2"},i("small",null,this.error.message),i("br",null),i("small",{class:"text-muted"},this.error.userAction,this.error.retryable&&this.retryCount<this.maxRetries&&i("span",null," • Auto-retry in progress..."))):null)(),(()=>this.error?null:this.isAuthenticating?i("div",{class:"text-info mt-2"},i("small",null,"Connecting to your bank...")):this.publicToken?i("div",{class:"text-success mt-2"},i("small",null,"✓ Bank account connected successfully")):!this.isSelected||this.publicToken||this.error||this.isAuthenticating?null:i("div",{class:"text-muted mt-2"},i("small",null,"Click to connect your bank account")))()))}static get watchers(){return{isSelected:["onSelectionChange"]}}},lt=class{constructor(e){t(this,e),this.onPaymentMethodOptionClick=t=>e=>{e.preventDefault(),w.selectedPaymentMethod={id:t.id,type:t.type},w.paymentToken=t.id},this.isAllowedPaymentMethod=t=>!(t===V.SAVED_CARD&&w.disableCreditCard||t===V.SAVED_BANK_ACCOUNT&&w.disableBankAccount)}componentWillLoad(){w.checkoutLoaded&&(w.paymentMethods.length||console.warn("No saved payment methods available."),w.disablePaymentMethodGroup&&console.warn("Payment method group is disabled."))}render(){return w.disablePaymentMethodGroup?null:i(M,null,i("div",{class:"saved-payment-methods"},w.paymentMethods.length?w.paymentMethods.filter((t=>this.isAllowedPaymentMethod(t.type))).map((t=>i("div",{class:"radio-list-item p-3",part:C,onClick:this.onPaymentMethodOptionClick(t)},i("form-control-radio",{name:"paymentMethodType",value:null==t?void 0:t.id,checked:w.paymentToken===(null==t?void 0:t.id),label:`${Z[null==t?void 0:t.brand]||""} *${null==t?void 0:t.acct_last_four}`})))):null))}},ht=i("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"}}),ct=class{constructor(i){t(this,i),this.paymentMethodOptionSelected=e(this,"paymentMethodOptionSelected",7),this.paymentMethodOptionId=V.SEZZLE,this.initializeSezzleCheckout=()=>{let t;this.sezzlePromise=new Promise((e=>{t=e}));const e=Number(w.paymentAmount),i=new(0,window.Checkout)({mode:"popup",publicKey:w.bnplProviderClientId,apiMode:w.bnplProviderMode,apiVersion:w.bnplProviderApiVersion});i.sezzleButtonElement=this.sezzleButtonRef,i.init({onClick:function(t){t.preventDefault(),i.startCheckout({checkout_url:w.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(){w.selectedPaymentMethod={type:V.SEZZLE},this.paymentMethodOptionSelected.emit(this.paymentMethodOptionId)}render(){var t,e;return w.bnplEnabled?i(M,{class:"payment-method"},i("script",{src:"https://checkout-sdk.sezzle.com/checkout.min.js",async:!0,ref:t=>this.scriptRef=t}),i("div",null,i("div",null,"Buy now, pay later with ",ht),this.installmentPlan&&i("small",null,i("span",null,null===(t=this.installmentPlan)||void 0===t?void 0:t.installments.length)," ",i("span",null,this.installmentPlan.schedule," payments of")," ",i("span",{class:"fw-bold"},I(null===(e=this.installmentPlan)||void 0===e?void 0:e.installments[0].amountInCents))))):(console.warn("justifi-sezzle-payment-method: BNPL is not enabled for this account."),null)}},dt={[V.NEW_BANK_ACCOUNT]:"New bank account",[V.NEW_CARD]:"New credit or debit card"},ut="Payment form not ready",pt="Validation error",yt=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(){U(),this.analytics=new R(this)}handleRadioClick(t){this.selectedPaymentMethod=t.detail,w.selectedPaymentMethod={type:t.detail}}async tokenizePaymentMethod(t){null==t||t.preventDefault(),this.validateRequiredProps(),this.isLoading=!0;try{if(!(await this.validate()).isValid)return this.errorEvent.emit({errorCode:y.TOKENIZE_ERROR,message:pt}),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(y.TOKENIZE_ERROR,t.message);return this.emitError({errorCode:y.TOKENIZE_ERROR,message:t.message}),this.submitEvent.emit({response:e}),e}finally{this.isLoading=!1}}async fillBillingForm(t){w.billingFormFields=t}async validate(){if(!this.areFormsReady())return{isValid:!1,errors:{general:ut}};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 getValues(){return this.billingFormRef.getValues()}async tokenize(){try{const t=await this.billingFormRef.getValues(),e={clientId:this.authToken||w.authToken,account:this.accountId||w.accountId,paymentMethodMetadata:this.buildPaymentMethodMetadata(t)};return await this.paymentMethodFormRef.tokenize(e)}catch(t){return t}}validateRequiredProps(){this.authToken||w.authToken||this.emitError({errorCode:y.TOKENIZE_ERROR,message:"Auth token is required when using the tokenize-payment-method component not slotted in justifi-modular-checkout"}),this.accountId||w.accountId||this.emitError({errorCode:y.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||w.checkoutLoaded&&!w.achPaymentsEnabled||(this.selectedPaymentMethod=V.NEW_BANK_ACCOUNT,w.selectedPaymentMethod={type:V.NEW_BANK_ACCOUNT}):(this.selectedPaymentMethod=V.NEW_CARD,w.selectedPaymentMethod={type:V.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=[],e=!w.checkoutLoaded||w.achPaymentsEnabled;return this.disableCreditCard||t.push(V.NEW_CARD),!this.disableBankAccount&&e&&t.push(V.NEW_BANK_ACCOUNT),t}areFormsReady(){return!(!this.billingFormRef||!this.paymentMethodFormRef)}emitError(t){this.errorEvent.emit(Object.assign(Object.assign({},t),{severity:p.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",ut);try{const e=await this.validate();if(!e.isValid||!t.isValid){const t=Object.values(e.errors)[0]||pt;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||w.paymentMethodGroupId}get shouldSavePaymentMethod(){return!(!this.paymentMethodGroupId&&!w.savePaymentMethod)}get shouldHideRadioInput(){return this.disableCreditCard||this.disableBankAccount}renderPaymentMethodOption(t){const e=this.selectedPaymentMethod===t&&void 0===w.selectedPaymentMethod.id;return i("div",{class:"payment-method"},i("radio-list-item",{name:"paymentMethodType",value:t,checked:e,label:dt[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("billing-form",{ref:t=>{t&&(this.billingFormRef=t)},hideCardBillingForm:this.hideCardBillingForm,hideBankAccountBillingForm:this.hideBankAccountBillingForm,paymentMethodType:t})),i("div",{class:"mt-4"},i("save-new-payment-method",{hidden:!this.paymentMethodGroupID,label:this.savePaymentMethodLabel})))}renderPaymentMethodForm(t){return i(t===V.NEW_CARD?"card-form":"bank-account-form",{ref:t=>{t&&(this.paymentMethodFormRef=t)}})}render(){return i(M,{key:"bc76697688be332ef84db56e61b6b455a6d1e986"},i("form",{key:"8f64f55f945d4ff4ed0f144c724dbd71278ec771"},i("fieldset",{key:"15b6d388117738391089cf91f999247cddb29714"},i("div",{key:"a4e23f7808b446dff6f7da437dba3cb57d2d62aa",class:"row gy-3"},i("div",{key:"63b0584d217d9bb50036eb7d5837e7287be58760",class:"col-12"},this.availablePaymentMethods.map((t=>this.renderPaymentMethodOption(t)))),i("div",{key:"c9345be3429cd8ab01a84e8584270938feceba39",class:"col-12"},i("internal-button",{key:"aa56df7b6b1250e9b81fbc281b969d2a37a05428",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 n(this)}static get watchers(){return{disableCreditCard:["paymentMethodsChanged"],disableBankAccount:["paymentMethodsChanged"]}}};export{$ as justifi_apple_pay,tt as justifi_button,et as justifi_checkout_summary,nt as justifi_google_pay,at as justifi_header,ot as justifi_modular_checkout,rt as justifi_plaid_payment_method,G as justifi_radio_list_item,lt as justifi_saved_payment_methods,ct as justifi_sezzle_payment_method,yt as justifi_tokenize_payment_method}
@@ -0,0 +1 @@
1
+ import{r as e,h as n,H as t,c as i,g as o}from"./p-CV0Pyo1O.js";import{al as r,a3 as s,q as a,v as c,w as d,x as u}from"./p-Bu7gdOaV.js";import{c as l}from"./p-DgTOxu8x.js";import{g as f}from"./p-BFTU3MAI.js";import{F as h}from"./p-CLZcevBz.js";import{p as m}from"./p-DlhPMNzz.js";const w=class{constructor(n){e(this,n)}render(){return this.text?this.hideAlert?null:n("div",{class:"alert alert-danger d-flex align-items-center",role:"alert",part:r},n("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"currentColor",class:"bi bi-exclamation-triangle-fill flex-shrink-0 me-2",viewBox:"0 0 16 16",role:"img","aria-label":"Warning:"},n("path",{d:"M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"})),n("div",null,this.text)):null}},g=l({focused:{boxShadow:"",border:""},focusedAndInvalid:{boxShadow:"",border:""},fontStyles:{fontFamily:"",fontSize:"",fontWeight:"",lineHeight:"",margin:"",padding:""}}),{state:b,set:p}=g,y=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();p("fontStyles",e);const n=await this.getFocusedStyles();p("focused",n);const t=await this.getFocusedAndInvalidStyles();p("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();const 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:"c3b2f0cb5160d888b3ecbaca95285749c0b71002"},n("input",{key:"f6d0ad00733d086dfa09b646f7599d60f91e5f50",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 v,x,k={exports:{}},z=f((v||(v=1,x=k,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={},l=null,f=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(){v("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){L(t,e)})).end()}):y("","Unable to bind to jQuery, it is not fully loaded.")),x.exports=H(),window.iFrameResize=window.iFrameResize||H()}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){k("log",e,n,b(e))}function y(e,n){k("info",e,n,b(e))}function v(e,n){k("warn",e,n,!0)}function k(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(W),T(A),f("onResized",W)}),W,"init")}function t(e){var n=Number(u[A]["max"+e]),t=Number(u[A]["min"+e]),i=e.toLowerCase(),o=Number(W[i]);p(A,"Checking "+i+" is in range "+t+"-"+n),o<t&&(o=t,p(A,"Set "+i+" to min value")),o>n&&(o=n,p(A,"Set "+i+" to max value")),W[i]=""+o}function i(e){return L.slice(L.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=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(A),{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(A,"Reposition requested from iFrame (offset x:"+n.x+" y:"+n.y+")"),window.top===window.self?(a=t,d(),p(A,"--")):window.parentIFrame?window.parentIFrame["scrollTo"+(e?"Offset":"")](t.x,t.y):v(A,"Unable to scroll to requested position, window.parentIFrame not found")}function d(){!1===f("onScroll",a)?O():T(A)}function l(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};f(e,{iframe:W.iframe,screenX:Number(n.x),screenY:Number(n.y),type:W.type})}function f(e,n){return S(A,e,n)}var m,b,x,k,z,I,L=e.data,W={},A=null;"[iFrameResizerChild]Ready"===L?function(){for(var e in u)N("iFrame requested init",E(e),u[e].iframe,e)}():s===(""+L).slice(0,13)&&L.slice(13).split(":")[0]in u?(k=(x=L.slice(13).split(":"))[1]?parseInt(x[1],10):0,z=u[x[0]]&&u[x[0]].iframe,I=getComputedStyle(z),W={iframe:z,id:x[0],height:k+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:x[2],type:x[3]},u[A=W.id]&&(u[A].loaded=!0),(b=W.type in{true:1,false:1,undefined:1})&&p(A,"Ignoring init message from meta parent page"),!b&&function(e){var n=!0;return u[e]||(n=!1,v(W.type+" No settings for "+e+". Message was: "+L)),n}(A)&&(p(A,"Received: "+L),m=!0,null===W.iframe&&(v(A,"IFrame ("+W.id+") not found"),m=!1),m&&function(){var n,t=e.origin,i=u[A]&&u[A].checkOrigin;if(i&&""+t!="null"&&!(i.constructor===Array?function(){var e=0,n=!1;for(p(A,"Checking connection is from allowed list of origins: "+i);e<i.length;e++)if(i[e]===t){n=!0;break}return n}():(p(A,"Checking connection is from: "+(n=u[A]&&u[A].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[A]&&u[A].firstRun&&u[A]&&(u[A].firstRun=!1),W.type){case"close":F(W.iframe);break;case"message":m=i(6),p(A,"onMessage passed: {iframe: "+W.iframe.id+", message: "+m+"}"),f("onMessage",{iframe:W.iframe,message:JSON.parse(m)}),p(A,"--");break;case"mouseenter":l("onMouseEnter");break;case"mouseleave":l("onMouseLeave");break;case"autoResize":u[A].autoResize=JSON.parse(i(9));break;case"scrollTo":c(!1);break;case"scrollToOffset":c(!0);break;case"pageInfo":o(u[A]&&u[A].iframe,A),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=A;e("Add ",w),u[t]&&(u[t].stopPageInfo=n)}();break;case"pageInfoStop":u[A]&&u[A].stopPageInfo&&(u[A].stopPageInfo(),delete u[A].stopPageInfo);break;case"inPageLink":t=i(9).split("#")[1]||"",s=decodeURIComponent(t),(h=document.getElementById(s)||document.getElementsByName(s)[0])?(e=r(h),p(A,"Moving to in page link (#"+t+") at x: "+e.x+" y: "+e.y),a={x:e.x,y:e.y},d(),p(A,"--")):window.top===window.self?p(A,"In page link #"+t+" not found"):window.parentIFrame?window.parentIFrame.moveToAnchor(t):p(A,"In page link #"+t+" not found and window.parentIFrame not found");break;case"reset":j(W);break;case"init":n(),f("onInit",W.iframe);break;default:0===Number(W.width)&&0===Number(W.height)?v("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}())):y(A,"Ignored: "+L)}function S(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 F(e){var t=e.id;if(!1!==S(t,"onClose",t)){p(t,"Removing iFrame: "+t);try{e.parentNode&&e.parentNode.removeChild(e)}catch(e){v(e)}S(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),O())}function O(){a=null}function j(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),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 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)):v(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,v(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 L(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],v(l,"Deprecated: '"+e+"' has been renamed '"+t+"'. The old method will be removed in the next major version.")}}var a,c,l=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||f.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);l in u&&"iFrameResizer"in t?v(l,"Ignored iFrame, already setup."):(function(e){var n;e=e||{},u[l]=Object.create(null),u[l].iframe=t,u[l].firstRun=!0,u[l].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 f)Object.prototype.hasOwnProperty.call(f,n)&&(u[l][n]=Object.prototype.hasOwnProperty.call(e,n)?e[n]:f[n])}(e),u[l]&&(u[l].targetOrigin=!0===u[l].checkOrigin?""===(n=u[l].remoteHost)||null!==n.match(/^(about:blank|javascript:|file:\/\/)/)?"*":n:"*")}(r),function(){switch(p(l,"IFrame scrolling "+(u[l]&&u[l].scrolling?"enabled":"disabled")+" for "+l),t.style.overflow=!1===(u[l]&&u[l].scrolling)?"hidden":"auto",u[l]&&u[l].scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=u[l]?u[l].scrolling:"no"}}(),function(){function e(e){var n=u[l][e];1/0!==n&&0!==n&&(t.style[e]="number"==typeof n?n+"px":n,p(l,"Set "+e+" = "+t.style[e]))}function n(e){if(u[l]["min"+e]>u[l]["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[l]&&u[l].bodyMargin)&&"0"!==(u[l]&&u[l].bodyMargin)||(u[l].bodyMarginV1=u[l].bodyMargin,u[l].bodyMargin=u[l].bodyMargin+"px"),a=E(l),(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(){N("iFrame.onload",a,t,e,!0),(!u[l]||!u[l].firstRun)&&u[l]&&u[l].heightCalculationMethod in d&&j({iframe:t,height:0,width:0,type:"init"})})),N("init",a,t,e,!0),u[l]&&(u[l].iframe.iFrameResizer={close:F.bind(null,u[l].iframe),removeListeners:I.bind(null,u[l].iframe),resize:N.bind(null,"Window resize","resize",u[l].iframe),moveToAnchor:function(e){N("Move to anchor","moveToAnchor:"+e,u[l].iframe,l)},sendMessage:function(e){N("Send Message","message:"+(e=JSON.stringify(e)),u[l].iframe,l)}}))}function W(e,n){null===l&&(l=setTimeout((function(){l=null,e()}),n))}function A(){"hidden"!==document.visibilityState&&(p("document","Trigger event: Visibility change"),W((function(){P("Tab Visible","resize")}),16))}function P(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 H(){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+">")}(),L(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(){P("Window resize","resize")}),16)})),w(document,"visibilitychange",A),w(document,"-webkit-visibilitychange",A),function(i,o){switch(t=[],function(e){e&&e.enablePublicMethods&&v("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}}}()),k.exports));class S{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 I=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:m.version})}async reload(){this.iframeElement.src=this.iframeSrc}initializeFrameCommunicationService(){var e;this.frameService=new S(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?b.focused:b.focusedAndInvalid:null}get urlParams(){const e=Object.fromEntries(Object.entries(b.fontStyles).map((([e,n])=>[e,btoa(String(n))])));return new URLSearchParams(e).toString()}get iframeSrc(){return`${this.iframeOrigin}?${this.urlParams}`}render(){return n(t,{key:"ec85f26f88845957744034690b1ab0342009485c",class:"form-group d-flex flex-column"},n("div",{key:"e4b29dedfa037218b984bbcd00d3aed3bf6987bd",style:{visibility:this.iframeLoaded?"visible":"hidden",height:this.iframeLoaded?"auto":"0"}},n("label",{key:"9e9539cc47e48b835dac8a0510899e6a2a25b46b",class:"form-label",htmlFor:"",part:u},this.label||""),n("div",{key:"45b0ef6167e59c542b7e72e9dbdb76c9d29bcfb1",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:"f52a24114c2e6de9cb110b20db28782125f3db9f",id:this.inputId,name:this.inputId,src:this.iframeSrc,ref:e=>{this.iframeElement=e,this.initializeFrameCommunicationService()},width:"100%",onLoad:()=>{z({log:!1,onResized:()=>{this.iframeLoaded.emit()}},this.iframeElement)}})),n(h,{key:"6cec57e9a2d5ef4901302087e270255248cde0f1",errorText:this.errorText,name:this.inputId})))}get el(){return o(this)}};export{w as form_alert,y as hidden_input,I as iframe_input}
@@ -0,0 +1 @@
1
+ import{f as t}from"./p-Ds_P-dB8.js";var i,s,e,n,a,r,h,o,c,d,u,l,p,f,m,_,y,v,g,k,w,P,b,A,C,S,x,D,U,T,B,E,z;!function(t){t.IFRAME_LOAD_ERROR="iframe-load-error",t.MISSING_PROPS="missing-props",t.FETCH_ERROR="fetch-error",t.PATCH_ERROR="patch-error",t.POST_ERROR="post-error",t.UNKNOWN_ERROR="unknown-error",t.TOKENIZE_ERROR="tokenize-error",t.COMPLETE_CHECKOUT_ERROR="complete-checkout-error",t.CHECKOUT_ALREADY_COMPLETED="checkout-already-completed",t.CHECKOUT_EXPIRED="checkout-expired",t.NOT_AUTHENTICATED="not-authenticated",t.INVALID_PARAMETER="invalid-parameter",t.PROVISIONING_REQUESTED="provisioning-already-requested",t.INVALID_REFUND_AMOUNT="invalid-refund-amount",t.VALIDATION_ERROR="validation-error"}(i||(i={})),function(t){t.INFO="info",t.WARNING="warning",t.ERROR="error"}(s||(s={})),function(t){t.IFRAME_LOAD_ERROR="Payment form failed to load. Please try again.",t.NOT_AUTHENTICATED="Not authenticated. Please provide a valid auth token, checkout id, and account id.",t.CHECKOUT_ALREADY_COMPLETED="Checkout already completed. Please create a new checkout.",t.CHECKOUT_EXPIRED="Checkout expired. Please create a new checkout."}(e||(e={}));class F{constructor(t){this.payment_mode=n[t.payment_mode],this.payment_token=t.payment_token,this.payment_status=t.payment_status,this.payment_response=t.payment_response,this.payment_error_code=t.payment_error_code,this.payment_error_description=t.payment_error_description,this.checkout_id=t.checkout_id,this.additional_transactions=t.additional_transactions,this.payment_id=t.payment_id,this.payment_method_id=t.payment_method_id,this.status=t.status,this.created_at=t.created_at,this.updated_at=t.updated_at}}class I{constructor(t){var i;this.id=t.id,this.description=t.description,this.payment_intent_id=t.payment_intent_id,this.account_id=t.account_id,this.platform_account_id=t.platform_account_id,this.payment_amount=t.payment_amount,this.payment_client_id=t.payment_client_id,this.payment_description=t.payment_description,this.payment_methods=t.payment_methods,this.payment_method_group_id=t.payment_method_group_id,this.payment_settings=t.payment_settings,this.bnpl=t.bnpl,this.total_amount=t.total_amount,this.insurance_amount=t.insurance_amount,this.status=r[t.status],this.payment_currency=t.payment_currency,this.mode=t.mode,this.statement_descriptor=t.statement_descriptor,this.application_fees=t.application_fees,this.successful_payment_id=t.successful_payment_id,this.created_at=t.created_at,this.updated_at=t.updated_at,this.completions=null===(i=t.completions)||void 0===i?void 0:i.map((t=>new F(t)))}get payment_mode(){var t,i,s,e,a,r;let h;if(!this.completions||0===this.completions.length)return n.unknown;const o=this.completions.sort(((t,i)=>new Date(i.updated_at).getTime()-new Date(t.updated_at).getTime()))[0];return o.payment_mode?h=o.payment_mode:(null===(s=null===(i=null===(t=o.payment_response)||void 0===t?void 0:t.data)||void 0===i?void 0:i.payment_method)||void 0===s?void 0:s.card)?h=n.card:(null===(r=null===(a=null===(e=o.payment_response)||void 0===e?void 0:e.data)||void 0===a?void 0:a.payment_method)||void 0===r?void 0:r.bank_account)&&(h=n.bank_account),h}formattedPaymentAmount(i){return t(i,this.payment_currency)}}!function(t){t.bnpl="Buy Now Pay Later",t.ecom="E-commerce",t.card="Card",t.bank_account="Bank Account",t.card_present="Card Present",t.apple_pay="Apple Pay",t.unknown=""}(n||(n={})),function(t){t.bnpl="bnpl",t.ecom="ecom",t.apple_pay="apple_pay"}(a||(a={})),function(t){t.created="created",t.completed="completed",t.attempted="attempted",t.expired="expired"}(r||(r={})),function(t){t.failed="failed",t.succeeded="succeeded"}(h||(h={})),function(t){t.won="won",t.lost="lost",t.underReview="under_review",t.needsResponse="needs_response"}(o||(o={}));class M{get needsResponse(){return this.status==o.needsResponse}get underReview(){return this.status==o.underReview}get won(){return this.status==o.won}get lost(){return this.status==o.lost}constructor(t){this.id=t.id,this.amount=t.amount,this.currency=t.currency,this.payment_id=t.payment_id,this.reason=t.reason,this.due_date=t.due_date,this.status=t.status,this.metadata=t.metadata,this.created_at=t.created_at,this.updated_at=t.updated_at,this.dispute_response=t.dispute_response?new N(t.dispute_response):void 0}}class N{constructor(t){this.additional_statement=t.additional_statement,this.cancellation_policy_disclosure=t.cancellation_policy_disclosure,this.cancellation_rebuttal=t.cancellation_rebuttal,this.customer_billing_address=t.customer_billing_address,this.customer_email_address=t.customer_email_address,this.customer_name=t.customer_name,this.customer_purchase_ip_address=t.customer_purchase_ip_address,this.duplicate_charge_explanation=t.duplicate_charge_explanation,this.product_description=t.product_description,this.refund_policy_disclosure=t.refund_policy_disclosure,this.refund_refusal_explanation=t.refund_refusal_explanation,this.service_date=t.service_date,this.shipping_address=t.shipping_address,this.shipping_carrier=t.shipping_carrier,this.shipping_date=t.shipping_date,this.shipping_tracking_number=t.shipping_tracking_number,this.duplicate_charge_original_payment_id=t.duplicate_charge_original_payment_id}}!function(t){t.automatic="automatic",t.manual="manual"}(c||(c={})),function(t){t.card="card",t.bankAccount="bankAccount",t.sezzle="sezzle",t.plaid="plaid",t.applePay="applePay"}(d||(d={})),function(t){t.card="Card",t.bankAccount="ACH",t.unknown="Unknown"}(u||(u={})),function(t){t.pending="pending",t.automatic="automatic",t.authorized="authorized",t.succeeded="succeeded",t.failed="failed",t.canceled="canceled",t.disputed="disputed",t.fully_refunded="fully_refunded",t.partially_refunded="partially_refunded"}(l||(l={})),function(t){t.usd="usd",t.cad="cad"}(p||(p={}));class R{constructor(t){this.card=t.card?new j(t.card):void 0,this.bank_account=t.bank_account?new q(t.bank_account):void 0}get payersName(){return this.card?this.card.name:this.bank_account?this.bank_account.name:null}get lastFourDigits(){return this.card?`**** ${this.card.acct_last_four}`:this.bank_account?`**** ${this.bank_account.acct_last_four}`:null}}class q{constructor(t){this.id=t.id,this.acct_last_four=t.acct_last_four,this.name=t.name,this.brand=t.brand,this.token=t.token,this.created_at=t.created_at,this.updated_at=t.updated_at}}class j{constructor(t){this.id=t.id||"",this.acct_last_four=t.acct_last_four,this.name=t.name,this.brand=t.brand,this.token=t.token,this.created_at=t.created_at,this.updated_at=t.updated_at}}class L{constructor(t){this.id=t.id,this.account_id=t.account_id,this.currency=t.currency,this.amount=t.amount,this.amount_disputed=t.amount_disputed,this.amount_refundable=t.amount_refundable,this.amount_refunded=t.amount_refunded,this.balance=t.balance,this.captured=t.captured,this.capture_strategy=t.capture_strategy,this.description=t.description,this.disputed=t.disputed,this.disputes=t.disputes,this.error_code=t.error_code,this.error_description=t.error_description,this.expedited=t.expedited,this.fee_amount=t.fee_amount,this.is_test=t.is_test,this.metadata=t.metadata,this.payment_method=new R(t.payment_method),this.payment_intent_id=t.payment_intent_id,this.refunded=t.refunded,this.status=t.status,this.created_at=t.created_at,this.updated_at=t.updated_at}get disputedStatus(){const t=this.disputes.some((t=>t.status===o.lost));return this.disputed?t?o.lost:"open":null}get payment_type(){return this.payment_method?this.payment_method.card?u.card:u.bankAccount:u.unknown}get payers_name(){return this.payment_method.payersName}get last_four_digits(){return this.payment_method.lastFourDigits}formattedPaymentAmount(i){return t(i,this.currency)}}!function(t){t.payment="payment",t.paymentFee="payment_fee",t.payout="payout",t.refund="refund",t.feeRefund="fee_refund",t.dispute="dispute",t.disputeFee="dispute_fee",t.disputeFeeRefund="dispute_fee_refund",t.disputeRefund="dispute_refund",t.applicationFeeReturned="application_fee_returned"}(f||(f={}));class V{constructor(t){this.id=t.id,this.amount=t.amount,this.balance=t.balance,this.currency=t.currency,this.financial_transaction_id=t.financial_transaction_id,this.payment_id=t.payment_id,this.payment_balance_txn_type=t.payment_balance_txn_type,this.source_id=t.source_id,this.source_type=t.source_type,this.created_at=t.created_at,this.updated_at=t.updated_at}get displayTransactionId(){return this.payment_balance_txn_type===f.paymentFee||this.payment_balance_txn_type===f.applicationFeeReturned?"--":this.source_id}formattedPaymentAmount(i){return t(i,this.currency)}}!function(t){t.paid="paid",t.failed="failed",t.forwarded="forwarded",t.scheduled="scheduled",t.in_transit="in_transit",t.canceled="canceled"}(m||(m={})),function(t){t.paid="Paid",t.failed="Failed",t.forwarded="Forwarded",t.scheduled="Scheduled",t.in_transit="In Transit",t.canceled="Canceled"}(_||(_={}));class Y{constructor(t){this.id=t.id,this.account_id=t.account_id,this.currency=t.currency,this.amount=t.amount,this.bank_account=t.bank_account,this.delivery_method=t.delivery_method||"standard",this.description=t.description,this.deposits_at=t.deposits_at,this.fees_total=t.fees_total,this.refunds_count=t.refunds_count,this.refunds_total=t.refunds_total,this.payments_count=t.payments_count,this.payments_total=t.payments_total,this.payout_type=t.payout_type,this.other_total=t.other_total,this.status=t.status,this.metadata=t.metadata,this.created_at=t.created_at,this.updated_at=t.updated_at,this.settlement_priority=t.settlement_priority||"standard"}formattedPaymentAmount(i){return t(i,this.currency)}}!function(t){t.fee="fee",t.payment="payment",t.payout="payout",t.sellerPaymentRefund="seller_payment_refund",t.disputeAmountCollected="dispute_amount_collected",t.disputeFeeCollected="dispute_fee_collected",t.sellerPayment="seller_payment",t.transfer="transfer",t.partnerPlatformProceedsCredit="partner_platform_proceeds_credit"}(y||(y={}));class ${constructor(t){this.id=t.id,this.account_id=t.account_id,this.payout_id=t.payout_id,this.financial_transaction_id=t.financial_transaction_id,this.amount=t.amount,this.fee=t.fee,this.net=t.net,this.currency=t.currency,this.source_id=t.source_id,this.description=t.description,this.txn_type=t.txn_type,this.created_at=t.created_at,this.available_on=t.available_on,this.updated_at=t.updated_at}formattedPaymentAmount(i){return t(i,this.currency)}}!function(t){t.connected="connected",t.disconnected="disconnected",t.unknown="unknown",t.pending_configuration="pending_configuration",t.archived="archived"}(v||(v={})),function(t){t.verifone="verifone"}(g||(g={}));class H{constructor(t){this.id=t.id||"",this.status=t.status,this.account_id=t.account_id||"",this.platform_account_id=t.platform_account_id||"",this.provider=t.provider||null,this.provider_id=t.provider_id||"",this.provider_serial_number=t.provider_serial_number||"",this.created_at=t.created_at||"",this.updated_at=t.updated_at||"",this.verified_at=t.verified_at||"",this.nickname=t.nickname||"",this.model_name=t.model_name||null}}!function(t){t.boardingOnly="boarding_only",t.boardingShipping="boarding_shipping"}(k||(k={})),function(t){t.created="created",t.submitted="submitted",t.completed="completed",t.in_progress="in_progress",t.on_hold="on_hold",t.canceled="canceled"}(w||(w={}));class Q{constructor(t){this.id=t.id,this.business_id=t.business_id,this.company_name=t.company_name,this.sub_account_id=t.sub_account_id,this.provider=t.provider||g.verifone,this.order_items=[],this.order_type=t.order_type,this.order_status=t.order_status,this.terminals=t.terminals,this.created_at=t.created_at,this.updated_at=t.updated_at}get payload(){return{business_id:this.business_id,sub_account_id:this.sub_account_id,order_type:this.order_type,order_items:this.order_items}}get totalQuantity(){return this.order_items.reduce(((t,i)=>t+i.quantity),0)}updateTerminal(t,i){if(0===i)return void(this.order_items=this.order_items.filter((i=>i.model_name!==t)));const s=this.order_items.find((i=>i.model_name===t));s?s.quantity=i:this.order_items.push({model_name:t,quantity:i})}}!function(t){t.v400="v400",t.p400="p400+",t.e285="e285"}(P||(P={}));class W{constructor(t){this.id=t.id,this.model_name=t.model_name,this.description=t.description,this.image_url=t.image_url,this.help_url=t.help_url}}!function(t){t.test="test",t.live="live"}(b||(b={})),function(t){t.created="created",t.submitted="submitted",t.information_needed="information_needed",t.rejected="rejected",t.enabled="enabled",t.disabled="disabled",t.archived="archived"}(A||(A={}));class G{constructor(t){this.id=t.id,this.name=t.name,this.account_type=t.account_type,this.status=t.status,this.currency=t.currency,this.platform_account_id=t.platform_account_id,this.payout_account_id=t.payout_account_id,this.business_id=t.business_id,this.application_fee_rates=t.application_fee_rates,this.processing_ready=t.processing_ready,this.payout_ready=t.payout_ready,this.related_accounts=t.related_accounts,this.created_at=t.created_at,this.updated_at=t.updated_at}}!function(t){t.voidedCheck="voided_check",t.balanceSheet="balance_sheet",t.bankStatement="bank_statement",t.governmentId="government_id",t.profitAndLossStatement="profit_and_loss_statement",t.taxReturn="tax_return",t.other="other",t.articlesOfIncorporation="articles_of_incorporation",t.businessRegistration="business_registration",t.passport="passport",t.driverLicense="driver_license",t.residentCard="resident_card",t.statusCard="status_card",t.nexusCard="nexus_card",t.citizenshipCard="citizenship_card",t.foreignPassport="foreign_passport",t.birthCertificate="birth_certificate",t.sinCard="sin_card",t.ssnCard="ssn_card"}(C||(C={})),function(t){t.pending="pending",t.uploaded="uploaded",t.canceled="canceled",t.needed="needed"}(S||(S={}));class J{constructor(t,i){this.fileData=null,this.file=t.file,this.document_type=t.document_type,this.presigned_url=null,this.record_data={business_id:i,document_type:this.document_type,file_name:this.file.name,file_type:this.file.type}}async getFileData(){if(this.fileData)return this.fileData;const t=new Promise(((t,i)=>{const s=new FileReader;s.onload=i=>{this.fileData=i.target.result,t(this.fileData)},s.onerror=()=>{i(new Error("Error reading file"))},s.readAsArrayBuffer(this.file)}));return await t}setPresignedUrl(t){this.presigned_url=t}}!function(t){t.succeeded="succeeded",t.failed="failed"}(x||(x={})),function(t){t.customerRequest="customer_request",t.duplicate="duplicate",t.fraudulent="fraudulent"}(D||(D={}));class K{constructor(t){this.amount=t.amount,this.reason=t.reason,this.description=t.description,this.metadata=t.metadata}}!function(t){t.STATUS_SUCCESS="STATUS_SUCCESS",t.STATUS_FAILURE="STATUS_FAILURE"}(U||(U={})),function(t){t.PLAIN="plain",t.BUY="buy",t.SET_UP="set-up",t.DONATE="donate",t.CHECK_OUT="check-out",t.BOOK="book",t.SUBSCRIBE="subscribe"}(T||(T={})),function(t){t.BLACK="black",t.WHITE="white",t.WHITE_OUTLINE="white-outline"}(B||(B={})),function(t){t.SUPPORTS_3DS="supports3DS",t.SUPPORTS_EMV="supportsEMV",t.SUPPORTS_CREDIT="supportsCredit",t.SUPPORTS_DEBIT="supportsDebit"}(E||(E={}));class O{constructor(t){this.merchantIdentifier=t.merchantIdentifier,this.displayName=t.displayName,this.initiative=t.initiative,this.initiativeContext=t.initiativeContext,this.buttonType=t.buttonType||T.PLAIN,this.buttonStyle=t.buttonStyle||B.BLACK,this.buttonLocale=t.buttonLocale||"en-US"}get isValid(){return!!(this.merchantIdentifier&&this.displayName&&this.initiative&&this.initiativeContext)}}class X{constructor(t){this.countryCode=t.countryCode,this.currencyCode=t.currencyCode,this.merchantCapabilities=t.merchantCapabilities,this.supportedNetworks=t.supportedNetworks,this.total=t.total,this.lineItems=t.lineItems,this.shippingMethods=t.shippingMethods,this.applicationData=t.applicationData,this.supportedCountries=t.supportedCountries}get isValid(){var t,i,s,e;return!!(this.countryCode&&this.currencyCode&&(null===(t=this.merchantCapabilities)||void 0===t?void 0:t.length)&&(null===(i=this.supportedNetworks)||void 0===i?void 0:i.length)&&(null===(s=this.total)||void 0===s?void 0:s.label)&&(null===(e=this.total)||void 0===e?void 0:e.amount))}}class Z{static isApplePaySupported(){var t;return"undefined"!=typeof window&&"ApplePaySession"in window&&(null===(t=window.ApplePaySession)||void 0===t?void 0:t.supportsVersion(3))}static canMakePayments(){var t;return this.isApplePaySupported()&&(null===(t=window.ApplePaySession)||void 0===t?void 0:t.canMakePayments())||!1}static async canMakePaymentsWithActiveCard(t){var i;if(!this.isApplePaySupported())return!1;try{return await(null===(i=window.ApplePaySession)||void 0===i?void 0:i.canMakePaymentsWithActiveCard(t))||!1}catch(t){return console.error("Error checking Apple Pay active card:",t),!1}}static formatAmount(t){return(t/100).toFixed(2)}static parseAmount(t){return Math.round(100*parseFloat(t))}static createLineItem(t,i,s="final"){return{label:t,amount:this.formatAmount(i),type:s}}static getDefaultSupportedNetworks(){return["amex","discover","masterCard","visa"]}static getDefaultMerchantCapabilities(){return[E.SUPPORTS_3DS,E.SUPPORTS_EMV,E.SUPPORTS_CREDIT,E.SUPPORTS_DEBIT]}}!function(t){t.PLAID_SDK_LOAD_FAILED="plaid-sdk-load-failed",t.PLAID_LINK_INIT_FAILED="plaid-link-init-failed",t.PLAID_LINK_TOKEN_FAILED="plaid-link-token-failed",t.PLAID_AUTHENTICATION_FAILED="plaid-authentication-failed",t.PLAID_BANK_NOT_SUPPORTED="plaid-bank-not-supported",t.PLAID_TOKEN_EXPIRED="plaid-token-expired",t.PLAID_NETWORK_ERROR="plaid-network-error",t.PLAID_USER_CANCELLED="plaid-user-cancelled",t.PLAID_TIMEOUT="plaid-timeout",t.PLAID_INVALID_CREDENTIALS="plaid-invalid-credentials",t.PLAID_ACCOUNT_LOCKED="plaid-account-locked",t.PLAID_MAINTENANCE="plaid-maintenance",t.PLAID_RATE_LIMITED="plaid-rate-limited"}(z||(z={}));const tt={[z.PLAID_SDK_LOAD_FAILED]:"Unable to load Plaid. Please refresh the page and try again.",[z.PLAID_LINK_INIT_FAILED]:"Unable to initialize bank connection. Please try again.",[z.PLAID_LINK_TOKEN_FAILED]:"Unable to connect to bank service. Please try again.",[z.PLAID_AUTHENTICATION_FAILED]:"Bank authentication failed. Please try again.",[z.PLAID_BANK_NOT_SUPPORTED]:"Your bank is not currently supported. Please try a different payment method.",[z.PLAID_TOKEN_EXPIRED]:"Your bank session has expired. Please reconnect your account.",[z.PLAID_NETWORK_ERROR]:"Network connection issue. Please check your internet connection and try again.",[z.PLAID_USER_CANCELLED]:"Bank connection was cancelled. Click to try again.",[z.PLAID_TIMEOUT]:"Bank connection timed out. Please try again.",[z.PLAID_INVALID_CREDENTIALS]:"Invalid bank credentials. Please check your username and password.",[z.PLAID_ACCOUNT_LOCKED]:"Your bank account is temporarily locked. Please contact your bank.",[z.PLAID_MAINTENANCE]:"Bank service is temporarily unavailable. Please try again later.",[z.PLAID_RATE_LIMITED]:"Too many connection attempts. Please wait a moment and try again."},it={[z.PLAID_SDK_LOAD_FAILED]:s.ERROR,[z.PLAID_LINK_INIT_FAILED]:s.ERROR,[z.PLAID_LINK_TOKEN_FAILED]:s.ERROR,[z.PLAID_AUTHENTICATION_FAILED]:s.ERROR,[z.PLAID_BANK_NOT_SUPPORTED]:s.WARNING,[z.PLAID_TOKEN_EXPIRED]:s.WARNING,[z.PLAID_NETWORK_ERROR]:s.WARNING,[z.PLAID_USER_CANCELLED]:s.INFO,[z.PLAID_TIMEOUT]:s.WARNING,[z.PLAID_INVALID_CREDENTIALS]:s.ERROR,[z.PLAID_ACCOUNT_LOCKED]:s.ERROR,[z.PLAID_MAINTENANCE]:s.WARNING,[z.PLAID_RATE_LIMITED]:s.WARNING};export{O as A,J as B,s as C,M as D,C as E,r as I,_ as P,D as R,G as S,w as T,a,i as b,e as c,h as d,L as e,k as f,v as g,o as h,l as i,V as j,Y as k,$ as l,I as m,H as n,W as o,Q as p,K as q,Z as r,X as s,U as t,B as u,T as v,E as w,it as x,tt as y,z}
@@ -0,0 +1 @@
1
+ import{r as e,h as a}from"./p-CV0Pyo1O.js";import{l as t}from"./p-OeJ-3w3l.js";import{f as s,p as r,c as l}from"./p-DUtecvro.js";import{f as d,a as i}from"./p-Bu7gdOaV.js";import{S as o}from"./p-05AWudQe.js";import"./p-CZfYo5-1.js";import"./p-B4vLfYnZ.js";import{c,a as p}from"./p-Ds_P-dB8.js";import{T as b,f}from"./p-8fO8CrtQ.js";import"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";import"./p-BFTU3MAI.js";import"./p-DgTOxu8x.js";import"./p-HXpYMWUU.js";const n=class{constructor(a){e(this,a),this.setParamsOnChange=(e,a)=>{s[e]=a},this.handleDateInput=(e,a)=>{const t=c(a,{setExactTime:!0});this.setParamsOnChange(e,t)}}componentWillLoad(){this.debouncedSetParamsOnChange=t.debounce(this.setParamsOnChange,300),Object.entries({order_status:this.orderStatus,order_type:this.orderType,created_after:this.createdAfter,created_before:this.createdBefore,company_name:this.companyName}).forEach((([e,a])=>{a&&(r[e]=a)}))}get terminalOrderStatusOptions(){return[{label:"All",value:""},{label:"Created",value:b.created},{label:"Completed",value:b.completed},{label:"Submitted",value:b.submitted},{label:"In Progress",value:b.in_progress},{label:"On Hold",value:b.on_hold},{label:"Canceled",value:b.canceled}]}get terminalOrderTypeOptions(){return[{label:"All",value:""},{label:"Boarding Only",value:f.boardingOnly},{label:"Boarding Shipping",value:f.boardingShipping}]}render(){const e=Object.assign({},s);return a(o,{key:"287baf0a2de1287195105adbebd501d2bccd21d7"},a("table-filters-menu",{key:"b0112de1075f459780d01528f017780c9ceedb18",params:e,clearParams:l,part:d},a("div",{key:"f9acabaf7d2edbe4eabb81edc92b2378ef563012",class:"grid-cols-2 gap-3 p-1"},a("div",{key:"e76d3b3771b8084fc5f6bf32fac2c75c3da87abb",class:"p-2"},a("form-control-select",{key:"9c687e7202a310500e85d3cbce29268ac04cdd4a",name:"order_status",label:"Order Status",options:this.terminalOrderStatusOptions,inputHandler:this.setParamsOnChange,defaultValue:this.orderStatus||s.order_status||"",disabled:!!this.orderStatus,part:i})),a("div",{key:"345ebc972663899a456a7a660863cd81a9770a87",class:"p-2"},a("form-control-select",{key:"26879377755e826a1d1f236ab5e54a22415451e8",name:"order_type",label:"Order Type",options:this.terminalOrderTypeOptions,inputHandler:this.setParamsOnChange,defaultValue:this.orderType||s.order_type||"",disabled:!!this.orderType,part:i})),a("div",{key:"2a7df2b8c9a3bfbbd76cca1a732c01521b08dd34",class:"p-2"},a("form-control-date",{key:"3fbceb80eaf7ae48e02221961317d8c77ec2c5a5",name:"created_after",label:"Created After",inputHandler:this.handleDateInput,defaultValue:p(this.createdAfter,{showInputDateTime:!0})||p(s.created_after,{showInputDateTime:!0}),showTime:!0,disabled:!!this.createdAfter,part:i})),a("div",{key:"4c3c59ab54215591c5b0eb9a26c45a0265e48d96",class:"p-2"},a("form-control-date",{key:"aea46abb41595c0cc5d82edd0f1f09425c0a1701",name:"created_before",label:"Created Before",inputHandler:this.handleDateInput,defaultValue:p(this.createdBefore,{showInputDateTime:!0})||p(s.created_before,{showInputDateTime:!0}),showTime:!0,disabled:!!this.createdBefore,part:i})),a("div",{key:"e83af454cde29c12fcd6e2e37093bf70fd03718c",class:"p-2"},a("form-control-text",{key:"3c5fe84b5883b7df6247ed1eba1a15871cb882b5",name:"company_name",label:"Company Name",inputHandler:this.debouncedSetParamsOnChange,defaultValue:this.companyName||s.company_name,disabled:!!this.companyName,part:i})))))}};export{n as justifi_terminal_orders_list_filters}
@@ -1 +1 @@
1
- import{h as t,r as e,c as i}from"./p-CV0Pyo1O.js";import{n as s,C as a,b as r}from"./p-AyLerOda.js";import{J as o}from"./p-C7lKXwUt.js";import{c as n}from"./p-BGD3uog3.js";import{T as c}from"./p-BS8j0DWf.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{p as h}from"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import{g as d,a as p}from"./p-CXZRiaUw.js";import{m,S as u}from"./p-B_i1R4O_.js";import{S as l}from"./p-05AWudQe.js";import{T as f,a as b,b as v,c as g,d as y,e as j,f as k,g as C,h as _,i as w,j as T,k as S,l as D}from"./p-BICxxa69.js";import{T as O}from"./p-CZfYo5-1.js";import{B as P,a as I}from"./p-CHw7tICr.js";import{a6 as A,a7 as x}from"./p-CPKMvyV_.js";import{j as B}from"./p-Ds_P-dB8.js";import{o as E,g as V}from"./p-Dw63wyhO.js";import"./p-CrTWHVKE.js";import"./p-DfL-8Yvt.js";import"./p-D8GTwl9v.js";import"./p-CqiVXthx.js";const G={nickname:()=>t("th",{part:A,scope:"col",title:"The nickname associated with the terminal"},"Nickname"),model_name:()=>t("th",{part:A,scope:"col",title:"The model name of the terminal"},"Model Name"),id:()=>t("th",{part:A,scope:"col",title:"The ID of the terminal"},"ID"),provider:()=>t("th",{part:A,scope:"col",title:"The provider of the terminal"},"Provider"),provider_serial_number:()=>t("th",{part:A,scope:"col",title:"The serial number of the terminal"},"Serial Number"),device_id:()=>t("th",{part:A,scope:"col",title:"The device/provider ID of the terminal"},"Device ID"),sub_account_name:()=>t("th",{part:A,scope:"col",title:"The sub account associated with the terminal"},"Sub Account"),status:()=>t("th",{part:A,scope:"col",title:"The current status of each terminal"},"Status")},L={nickname:(e,i)=>t("td",{part:x(i)},e.nickname),model_name:(e,i)=>t("td",{part:x(i)},e.model_name),id:(e,i)=>t("td",{part:x(i)},e.id),provider:(e,i)=>t("td",{part:x(i)},B(e.provider)),provider_serial_number:(e,i)=>t("td",{part:x(i)},e.provider_serial_number),device_id:(e,i)=>t("td",{part:x(i)},e.provider_id),sub_account_name:(e,i)=>t("td",{part:x(i)},e.sub_account_name),status:(e,i)=>t("td",{part:x(i)},t(I,Object.assign({},{connected:{variant:P.SUCCESS,title:"This terminal is connected",text:"Connected"},disconnected:{variant:P.DANGER,title:"This terminal is disconnected",text:"Disconnected"},unknown:{variant:P.SECONDARY,title:"The status of this terminal is unknown",text:"Unknown"},pending_configuration:{variant:P.WARNING,title:"This terminal is pending configuration",text:"Pending configuration"},archived:{variant:P.SECONDARY,title:"This terminal is archived",text:"Archived"}}[e.status])))},N=class{constructor(t){e(this,t),this.clickEvent=i(this,"click-event",7),this.errorEvent=i(this,"error-event",7),this.terminals=[],this.subAccounts=[],this.loading=!0,this.paging=h,this.pagingParams={},this.columns="nickname,provider_serial_number,status",this.handleClickPrevious=t=>{this.pagingParams={before_cursor:t},this.clickEvent.emit({name:O.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:O.next})},this.rowClickHandler=t=>{const e=t.target.closest("tr").dataset.rowEntityId;if(!e)return;const i=this.terminals.find((t=>t.id===e));this.clickEvent.emit({name:O.row,data:i})}}componentWillLoad(){n(),this.analytics=new o(this),this.terminalsTable=new f(this.terminals,this.columns,G,L),this.initializeGetData(),this.getTerminals&&this.getSubAccounts&&this.fetchData(),E("set",(()=>{this.pagingParams={}})),E("reset",(()=>{this.pagingParams={},this.errorMessage=""}))}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetData()}updateOnPropChange(){this.fetchData()}initializeGetData(){this.initializeGetTerminals(),this.initializeGetSubAccounts()}initializeGetTerminals(){this.accountId&&this.authToken?this.getTerminals=(({id:t,authToken:e,service:i})=>async({params:r,onSuccess:o,onError:n})=>{var c,h;try{const m=await i.fetchTerminals(t,e,r);if(m.error)return n({error:p(m.error),code:d(null===(h=m.error)||void 0===h?void 0:h.code),severity:a.ERROR});{const t=Object.assign({},m.page_info);o({terminals:(null===(c=m.data)||void 0===c?void 0:c.map((t=>new s(t))))||[],pagingInfo:t})}}catch(t){const e=d(null==t?void 0:t.code);return n({error:t.message||t,code:e,severity:a.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new c}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:r.MISSING_PROPS,message:this.errorMessage,severity:a.ERROR}))}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=m({primaryAccountId:this.accountId,authToken:this.authToken,service:new u}))}fetchData(){this.loading=!0,this.getTerminals({params:this.terminalParams,onSuccess:async({terminals:t,pagingInfo:e})=>{this.terminals=t,this.paging=e,this.terminalsTable.collectionData=this.terminals,this.terminalsTable.columnKeys.includes("sub_account_name")?await this.fetchSubAccounts():this.loading=!1},onError:({error:t,code:e,severity:i})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:e,message:t,severity:i}),this.loading=!1}})}async fetchSubAccounts(){this.getSubAccounts({params:this.subAccountParams,onSuccess:({subAccounts:t})=>{this.subAccounts=t,this.terminals=this.terminals.map((t=>{var e;return t.sub_account_name=null===(e=this.subAccounts.find((e=>e.id===t.account_id)))||void 0===e?void 0:e.name,t})),this.loading=!1},onError:({error:t,code:e,severity:i})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:e,message:t,severity:i}),this.loading=!1}})}get terminalParams(){const t=V();return Object.assign(Object.assign({},t),this.pagingParams)}get subAccountParams(){const 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 t(l,{key:"69c475e7a428c549a05f21bbd9bd80ce6d77836b"},t(b,{key:"a3d916daff63336299366f27959b8e54134f54c5"},t(v,{key:"412538503e7a212bd7b5723dddad82abe95fc3c2"},t(g,{key:"5501e72fd1931b1ffc17e6bf0d09d692b9cfbe17"},t(y,{key:"e0391a60a807cbdba97ef11f04275eb3072dc40c"},this.terminalsTable.columnData.map((t=>t)))),t(j,{key:"56686e423499aff459fa3d6d93fae0fd7621b10b"},t(k,{key:"0b70b5a0132754b1ce14e8baaeb7a9932c73b0ad",columnSpan:this.terminalsTable.columnKeys.length,isLoading:this.loading}),t(C,{key:"1230c30259de7ad89a1ccf1bb709db5bdda9152f",isEmpty:this.showEmptyState,columnSpan:this.terminalsTable.columnKeys.length}),t(_,{key:"fc5dbeae973d56980e077fa861d0bf95f282cbec",columnSpan:this.terminalsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.terminalsTable.rowData.map(((e,i)=>t(w,{"data-test-id":"table-row","data-row-entity-id":this.entityId[i],onClick:this.rowClickHandler},e)))),this.paging&&t(T,{key:"c68e2cb14c8fa6a56243803e440cc13388ffaaf4"},t(S,{key:"bcc17671c48f5a397dff15333a49305a443aef21"},t(D,{key:"92a690d558b001bb346c2e17fb1e02691ec2a029",colSpan:this.terminalsTable.columnData.length},t("pagination-menu",{key:"2a8233397675c7af4fd95df203eb4438f1c4adbd",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"],pagingParams:["updateOnPropChange"],getTerminals:["updateOnPropChange"],getSubAccounts:["updateOnPropChange"],columns:["updateOnPropChange"]}}};export{N as justifi_terminals_list}
1
+ import{h as t,r as e,c as i}from"./p-CV0Pyo1O.js";import{n as s,C as a,b as r}from"./p-8fO8CrtQ.js";import{J as n}from"./p-BpFSR2PV.js";import{c as o}from"./p-DwLofzXZ.js";import{T as c}from"./p-5_w3jWjY.js";import"./p-B4vLfYnZ.js";import"./p-HXpYMWUU.js";import{p as h}from"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";import{g as d,a as p}from"./p-D1H6VUbM.js";import{m,S as u}from"./p-D437Px2O.js";import{S as l}from"./p-05AWudQe.js";import{T as f,a as b,b as v,c as g,d as j,e as k,f as y,g as w,h as T,i as _,j as C,k as D,l as S}from"./p-DZr0wLGh.js";import{T as P}from"./p-CZfYo5-1.js";import{B as O,a as x}from"./p-Dz8KJn2G.js";import{a6 as A,a7 as I}from"./p-Bu7gdOaV.js";import{j as z}from"./p-Ds_P-dB8.js";import{o as B,g as E}from"./p-BzjgvHHT.js";import"./p-DlhPMNzz.js";import"./p-C1x6dkgs.js";import"./p-DgTOxu8x.js";import"./p-MPer3Rw7.js";const L={nickname:()=>t("th",{part:A,scope:"col",title:"The nickname associated with the terminal"},"Nickname"),model_name:()=>t("th",{part:A,scope:"col",title:"The model name of the terminal"},"Model Name"),id:()=>t("th",{part:A,scope:"col",title:"The ID of the terminal"},"ID"),provider:()=>t("th",{part:A,scope:"col",title:"The provider of the terminal"},"Provider"),provider_serial_number:()=>t("th",{part:A,scope:"col",title:"The serial number of the terminal"},"Serial Number"),device_id:()=>t("th",{part:A,scope:"col",title:"The device/provider ID of the terminal"},"Device ID"),sub_account_name:()=>t("th",{part:A,scope:"col",title:"The sub account associated with the terminal"},"Sub Account"),status:()=>t("th",{part:A,scope:"col",title:"The current status of each terminal"},"Status")},M={nickname:(e,i)=>t("td",{part:I(i)},e.nickname),model_name:(e,i)=>t("td",{part:I(i)},e.model_name),id:(e,i)=>t("td",{part:I(i)},e.id),provider:(e,i)=>t("td",{part:I(i)},z(e.provider)),provider_serial_number:(e,i)=>t("td",{part:I(i)},e.provider_serial_number),device_id:(e,i)=>t("td",{part:I(i)},e.provider_id),sub_account_name:(e,i)=>t("td",{part:I(i)},e.sub_account_name),status:(e,i)=>t("td",{part:I(i)},t(x,Object.assign({},{connected:{variant:O.SUCCESS,title:"This terminal is connected",text:"Connected"},disconnected:{variant:O.DANGER,title:"This terminal is disconnected",text:"Disconnected"},unknown:{variant:O.SECONDARY,title:"The status of this terminal is unknown",text:"Unknown"},pending_configuration:{variant:O.WARNING,title:"This terminal is pending configuration",text:"Pending configuration"},archived:{variant:O.SECONDARY,title:"This terminal is archived",text:"Archived"}}[e.status])))},G=class{constructor(t){e(this,t),this.clickEvent=i(this,"click-event",7),this.errorEvent=i(this,"error-event",7),this.terminals=[],this.subAccounts=[],this.loading=!0,this.paging=h,this.pagingParams={},this.columns="nickname,provider_serial_number,status",this.handleClickPrevious=t=>{this.pagingParams={before_cursor:t},this.clickEvent.emit({name:P.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:P.next})},this.rowClickHandler=t=>{const e=t.target.closest("tr").dataset.rowEntityId;if(!e)return;const i=this.terminals.find((t=>t.id===e));this.clickEvent.emit({name:P.row,data:i})}}componentWillLoad(){o(),this.analytics=new n(this),this.terminalsTable=new f(this.terminals,this.columns,L,M),this.initializeGetData(),this.getTerminals&&this.getSubAccounts&&this.fetchData(),B("set",(()=>{this.pagingParams={}})),B("reset",(()=>{this.pagingParams={},this.errorMessage=""}))}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetData()}updateOnPropChange(){this.fetchData()}initializeGetData(){this.initializeGetTerminals(),this.initializeGetSubAccounts()}initializeGetTerminals(){this.accountId&&this.authToken?this.getTerminals=(({id:t,authToken:e,service:i})=>async({params:r,onSuccess:n,onError:o})=>{var c,h;try{const m=await i.fetchTerminals(t,e,r);if(m.error)return o({error:p(m.error),code:d(null===(h=m.error)||void 0===h?void 0:h.code),severity:a.ERROR});{const t=Object.assign({},m.page_info);n({terminals:(null===(c=m.data)||void 0===c?void 0:c.map((t=>new s(t))))||[],pagingInfo:t})}}catch(t){const e=d(null==t?void 0:t.code);return o({error:t.message||t,code:e,severity:a.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new c}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:r.MISSING_PROPS,message:this.errorMessage,severity:a.ERROR}))}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=m({primaryAccountId:this.accountId,authToken:this.authToken,service:new u}))}fetchData(){this.loading=!0,this.getTerminals({params:this.terminalParams,onSuccess:async({terminals:t,pagingInfo:e})=>{this.terminals=t,this.paging=e,this.terminalsTable.collectionData=this.terminals,this.terminalsTable.columnKeys.includes("sub_account_name")?await this.fetchSubAccounts():this.loading=!1},onError:({error:t,code:e,severity:i})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:e,message:t,severity:i}),this.loading=!1}})}async fetchSubAccounts(){this.getSubAccounts({params:this.subAccountParams,onSuccess:({subAccounts:t})=>{this.subAccounts=t,this.terminals=this.terminals.map((t=>{var e;return t.sub_account_name=null===(e=this.subAccounts.find((e=>e.id===t.account_id)))||void 0===e?void 0:e.name,t})),this.loading=!1},onError:({error:t,code:e,severity:i})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:e,message:t,severity:i}),this.loading=!1}})}get terminalParams(){const t=E();return Object.assign(Object.assign({},t),this.pagingParams)}get subAccountParams(){const 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 t(l,{key:"69c475e7a428c549a05f21bbd9bd80ce6d77836b"},t(b,{key:"a3d916daff63336299366f27959b8e54134f54c5"},t(v,{key:"412538503e7a212bd7b5723dddad82abe95fc3c2"},t(g,{key:"5501e72fd1931b1ffc17e6bf0d09d692b9cfbe17"},t(j,{key:"e0391a60a807cbdba97ef11f04275eb3072dc40c"},this.terminalsTable.columnData.map((t=>t)))),t(k,{key:"56686e423499aff459fa3d6d93fae0fd7621b10b"},t(y,{key:"0b70b5a0132754b1ce14e8baaeb7a9932c73b0ad",columnSpan:this.terminalsTable.columnKeys.length,isLoading:this.loading}),t(w,{key:"1230c30259de7ad89a1ccf1bb709db5bdda9152f",isEmpty:this.showEmptyState,columnSpan:this.terminalsTable.columnKeys.length}),t(T,{key:"fc5dbeae973d56980e077fa861d0bf95f282cbec",columnSpan:this.terminalsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.terminalsTable.rowData.map(((e,i)=>t(_,{"data-test-id":"table-row","data-row-entity-id":this.entityId[i],onClick:this.rowClickHandler},e)))),this.paging&&t(C,{key:"c68e2cb14c8fa6a56243803e440cc13388ffaaf4"},t(D,{key:"bcc17671c48f5a397dff15333a49305a443aef21"},t(S,{key:"92a690d558b001bb346c2e17fb1e02691ec2a029",colSpan:this.terminalsTable.columnData.length},t("pagination-menu",{key:"2a8233397675c7af4fd95df203eb4438f1c4adbd",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"],pagingParams:["updateOnPropChange"],getTerminals:["updateOnPropChange"],getSubAccounts:["updateOnPropChange"],columns:["updateOnPropChange"]}}};export{G as justifi_terminals_list}
@@ -0,0 +1 @@
1
+ import{h as l}from"./p-CV0Pyo1O.js";import{S as s}from"./p-eBK-iWrz.js";import"./p-CZfYo5-1.js";const i=()=>l("div",{class:"row gap-3"},l("div",{class:"col-12"},l(s,{width:"25%"})),l("div",{class:"col-12"},l(s,{width:"100%"})),l("div",{class:"col-12 d-flex gap-3"},l(s,{width:"50%"}),l(s,{width:"50%"})),l("div",{class:"col-12 d-flex gap-3"},l(s,{width:"65%"}),l(s,{width:"35%"}))),d=()=>l("div",{class:"row gap-5"},l("div",{class:"col-12"},l(s,{width:"40%",height:"40px"})),l(i,null),l(i,null),l(i,null));export{d as P}
@@ -0,0 +1 @@
1
+ import{A as t}from"./p-C1x6dkgs.js";import"./p-8fO8CrtQ.js";import"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";const n=t();class a{async fetchPayments(t,a,s){return n.get({endpoint:`account/${t}/payments`,params:s,authToken:a})}async fetchPayment(t,a){return n.get({endpoint:`payments/${t}`,authToken:a})}async fetchPaymentTransactions(t,a,s){return n.get({endpoint:`payments/${t}/payment_balance_transactions`,params:s,authToken:a})}}export{a as P}
@@ -1 +1 @@
1
- import{c as t}from"./p-D8GTwl9v.js";const s={apiOrigin:"https://wc-proxy.justifi.ai",iframeOrigin:"https://components.justifi.ai",accountId:""},i=t((()=>s)),{state:e}=i;let o;const a=new Promise((t=>{o=t})),c=t=>{Object.assign(e,t),o()},n=(t=200)=>new Promise((s=>{const i=setTimeout((()=>{s()}),t);a.then((()=>{clearTimeout(i),s()}))}));export{e as c,c as s,n as w}
1
+ import{c as t}from"./p-DgTOxu8x.js";const s={apiOrigin:"https://wc-proxy.justifi.ai",iframeOrigin:"https://components.justifi.ai",accountId:""},i=t((()=>s)),{state:e}=i;let o;const a=new Promise((t=>{o=t})),c=t=>{Object.assign(e,t),o()},n=(t=200)=>new Promise((s=>{const i=setTimeout((()=>{s()}),t);a.then((()=>{clearTimeout(i),s()}))}));export{e as c,c as s,n as w}
@@ -0,0 +1 @@
1
+ import{h as o}from"./p-CV0Pyo1O.js";import{A as r}from"./p-Bu7gdOaV.js";const s=s=>o("h3",{class:`header-3 ${null==s?void 0:s.class}`,part:r},s.text);export{s as H}
@@ -0,0 +1 @@
1
+ import{c as s}from"./p-DgTOxu8x.js";const t={},a={},o=s((()=>t)),{state:c,on:e}=o,p=s((()=>a)),{state:j}=p,r=()=>Object.assign(Object.assign({},c),j),x=()=>{o.reset()};export{x as c,c as f,r as g,e as o,j as p}
@@ -0,0 +1 @@
1
+ import{h as t}from"./p-CV0Pyo1O.js";import{t as e}from"./p-Bu7gdOaV.js";const o=o=>{const{helpText:r,name:m}=o;return r?t("small",{class:"form-text text-muted",id:`form-help-text-${m}`,part:e},r):null};export{o as F}
@@ -1 +1 @@
1
- import{h as s}from"./p-CV0Pyo1O.js";import{t,h as a,b as l,l as e}from"./p-CPKMvyV_.js";const o=a=>s("main",{class:"p-4 d-flex justify-content-center text-center",style:{fontSize:"1.2rem"}},s("p",{part:t},a)),c=t=>s("h2",{part:l,class:"mt-4 fs-5 border-bottom pb-3"},t.sectionTitle),r=({title:a,value:l,onClick:o})=>a&&l?s("div",{class:"row justify-content-between"},s("div",{class:"col-12 col-md-4"},s("span",{class:"fw-bold",part:t},a)),s("div",{class:"col-12 col-md-8 "+(o?"text-decoration-underline text-primary":""),style:{cursor:o?"pointer":"auto"},onClick:()=>o&&o()},s("span",{class:"text-wrap",part:o?e:t},l))):null,p=({title:a,value:e,classes:o})=>s("div",{class:`d-flex flex-column ${o}`},s("span",{class:"fw-bold border-1 border-bottom ps-2 pe-2",part:l},a),s("span",{class:"pt-2 ps-2 pe-2",part:t},e)),n=({title:l,slot:e,badge:o},c)=>s("div",{slot:e,class:"p-2"},s("div",{class:"d-flex flex-row align-items-center gap-2 mb-2"},s("h1",{class:"m-0",part:a},l),o),s("div",{class:"d-flex flex-row align-items-top",part:t},c)),i=({metadata:t})=>t&&Object.keys(t).length?s("div",{class:"mt-4"},s("pre",{class:"p-2","aria-label":"metadata content"},s("code",null,JSON.stringify(t,null,2)))):null;export{i as C,c as D,o as E,n as a,p as b,r as c}
1
+ import{h as s}from"./p-CV0Pyo1O.js";import{t,h as a,b as l,l as e}from"./p-Bu7gdOaV.js";const o=a=>s("main",{class:"p-4 d-flex justify-content-center text-center",style:{fontSize:"1.2rem"}},s("p",{part:t},a)),c=t=>s("h2",{part:l,class:"mt-4 fs-5 border-bottom pb-3"},t.sectionTitle),r=({title:a,value:l,onClick:o})=>a&&l?s("div",{class:"row justify-content-between"},s("div",{class:"col-12 col-md-4"},s("span",{class:"fw-bold",part:t},a)),s("div",{class:"col-12 col-md-8 "+(o?"text-decoration-underline text-primary":""),style:{cursor:o?"pointer":"auto"},onClick:()=>o&&o()},s("span",{class:"text-wrap",part:o?e:t},l))):null,p=({title:a,value:e,classes:o})=>s("div",{class:`d-flex flex-column ${o}`},s("span",{class:"fw-bold border-1 border-bottom ps-2 pe-2",part:l},a),s("span",{class:"pt-2 ps-2 pe-2",part:t},e)),n=({title:l,slot:e,badge:o},c)=>s("div",{slot:e,class:"p-2"},s("div",{class:"d-flex flex-row align-items-center gap-2 mb-2"},s("h1",{class:"m-0",part:a},l),o),s("div",{class:"d-flex flex-row align-items-top",part:t},c)),i=({metadata:t})=>t&&Object.keys(t).length?s("div",{class:"mt-4"},s("pre",{class:"p-2","aria-label":"metadata content"},s("code",null,JSON.stringify(t,null,2)))):null;export{i as C,c as D,o as E,n as a,p as b,r as c}
@@ -1 +1 @@
1
- import{h as e}from"./p-CV0Pyo1O.js";import{B as t,a}from"./p-CHw7tICr.js";var d;!function(e){e.SUCCEEDED="succeeded",e.AUTHORIZED="authorized",e.PENDING="pending",e.ACH_FAILED="achFailed",e.FAILED="failed",e.CANCELED="canceled",e.DISPUTED="disputed",e.DISPUTE_LOST="dispute_lost",e.FULLY_REFUNDED="fully_refunded",e.PARTIALLY_REFUNDED="partially_refunded"}(d||(d={}));const i=d=>e(a,Object.assign({},{succeeded:{variant:t.SUCCESS,title:"This payment was successfully captured",text:"Succeeded"},authorized:{variant:t.PRIMARY,title:"This card payment was authorized, but not captured. It could still succeed or fail.",text:"Authorized"},pending:{variant:t.PRIMARY,title:"This ACH payment was processed, but the funds have not settled. It could still succeed or fail.",text:"Pending"},achFailed:{variant:t.DANGER,title:"The funds couldn't be collected for this ACH payment (in addition to the original payment, an ACH return and fee will appear in a payout)",text:"ACH Failed"},failed:{variant:t.DANGER,title:"This card payment did not go through (it will not appear in a payout)",text:"Failed"},canceled:{variant:t.DANGER,title:"This payment was canceled",text:"Canceled"},disputed:{variant:t.WARNING,title:"The account holder disputed this payment. The amount has been returned and a fee assessed.",text:"Disputed"},dispute_lost:{variant:t.SECONDARY,title:"The cardholder has won the dispute.",text:"Dispute Lost"},fully_refunded:{variant:t.SECONDARY,title:"The full amount of this payment has been refunded",text:"Fully Refunded"},partially_refunded:{variant:t.SECONDARY,title:"A portion of this payment has been refunded",text:"Partially Refunded"}}[d]));export{i as M,d as P}
1
+ import{h as e}from"./p-CV0Pyo1O.js";import{B as t,a}from"./p-Dz8KJn2G.js";var d;!function(e){e.SUCCEEDED="succeeded",e.AUTHORIZED="authorized",e.PENDING="pending",e.ACH_FAILED="achFailed",e.FAILED="failed",e.CANCELED="canceled",e.DISPUTED="disputed",e.DISPUTE_LOST="dispute_lost",e.FULLY_REFUNDED="fully_refunded",e.PARTIALLY_REFUNDED="partially_refunded"}(d||(d={}));const i=d=>e(a,Object.assign({},{succeeded:{variant:t.SUCCESS,title:"This payment was successfully captured",text:"Succeeded"},authorized:{variant:t.PRIMARY,title:"This card payment was authorized, but not captured. It could still succeed or fail.",text:"Authorized"},pending:{variant:t.PRIMARY,title:"This ACH payment was processed, but the funds have not settled. It could still succeed or fail.",text:"Pending"},achFailed:{variant:t.DANGER,title:"The funds couldn't be collected for this ACH payment (in addition to the original payment, an ACH return and fee will appear in a payout)",text:"ACH Failed"},failed:{variant:t.DANGER,title:"This card payment did not go through (it will not appear in a payout)",text:"Failed"},canceled:{variant:t.DANGER,title:"This payment was canceled",text:"Canceled"},disputed:{variant:t.WARNING,title:"The account holder disputed this payment. The amount has been returned and a fee assessed.",text:"Disputed"},dispute_lost:{variant:t.SECONDARY,title:"The cardholder has won the dispute.",text:"Dispute Lost"},fully_refunded:{variant:t.SECONDARY,title:"The full amount of this payment has been refunded",text:"Fully Refunded"},partially_refunded:{variant:t.SECONDARY,title:"A portion of this payment has been refunded",text:"Partially Refunded"}}[d]));export{i as M,d as P}
@@ -1 +1 @@
1
- import{p as t}from"./p-CrTWHVKE.js";import{A as s}from"./p-DfL-8Yvt.js";import"./p-AyLerOda.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";const i=s();class e{async record(t){return i.post({endpoint:"analytics",body:t})}}class n{constructor(t){this.eventListeners=new Map,this.handleCustomEvent=async t=>{await this.service.record(t)},window.location.origin.includes("localhost")||window.location.origin.includes("docs.justifi.tech")||(this.service=new e,this.componentInstance=t,this.setUpBasicData(),this.setupLifecycleTracking(),this.trackCustomEvents())}get resourceId(){return this.componentInstance.accountId||this.componentInstance.businessId||this.componentInstance.paymentId||this.componentInstance.payoutId||this.componentInstance.checkoutId}setUpBasicData(){this.basicData={component_name:this.componentInstance.tagName,component_version:t.version,client_user_agent:navigator.userAgent,client_platform:navigator.userAgent,client_origin:window.location.origin,resource_id:this.resourceId}}trackCustomEvents(){this.eventEmitters=["submit-event","error-event"],this.eventEmitters.forEach((t=>{if("function"==typeof this.componentInstance.addEventListener){const s=s=>this.handleCustomEvent({event_type:t,data:Object.assign(Object.assign({},this.basicData),"error-event"===t&&{error:s.detail})});this.eventListeners.set(t,s),this.componentInstance.addEventListener(t,s)}}))}setupLifecycleTracking(){const t=this.componentInstance.componentDidLoad;this.componentInstance.componentDidLoad=()=>{if(this.service.record({event_type:"init",data:this.basicData}),t)return t.apply(this.componentInstance)}}cleanup(){this.eventListeners.forEach(((t,s)=>{this.componentInstance.removeEventListener(s,t)})),this.eventListeners.clear()}}export{n as J}
1
+ import{p as t}from"./p-DlhPMNzz.js";import{A as s}from"./p-C1x6dkgs.js";import"./p-8fO8CrtQ.js";import"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";const i=s();class e{async record(t){return i.post({endpoint:"analytics",body:t})}}class n{constructor(t){this.eventListeners=new Map,this.handleCustomEvent=async t=>{await this.service.record(t)},window.location.origin.includes("localhost")||window.location.origin.includes("docs.justifi.tech")||(this.service=new e,this.componentInstance=t,this.setUpBasicData(),this.setupLifecycleTracking(),this.trackCustomEvents())}get resourceId(){return this.componentInstance.accountId||this.componentInstance.businessId||this.componentInstance.paymentId||this.componentInstance.payoutId||this.componentInstance.checkoutId}setUpBasicData(){this.basicData={component_name:this.componentInstance.tagName,component_version:t.version,client_user_agent:navigator.userAgent,client_platform:navigator.userAgent,client_origin:window.location.origin,resource_id:this.resourceId}}trackCustomEvents(){this.eventEmitters=["submit-event","error-event"],this.eventEmitters.forEach((t=>{if("function"==typeof this.componentInstance.addEventListener){const s=s=>this.handleCustomEvent({event_type:t,data:Object.assign(Object.assign({},this.basicData),"error-event"===t&&{error:s.detail})});this.eventListeners.set(t,s),this.componentInstance.addEventListener(t,s)}}))}setupLifecycleTracking(){const t=this.componentInstance.componentDidLoad;this.componentInstance.componentDidLoad=()=>{if(this.service.record({event_type:"init",data:this.basicData}),t)return t.apply(this.componentInstance)}}cleanup(){this.eventListeners.forEach(((t,s)=>{this.componentInstance.removeEventListener(s,t)})),this.eventListeners.clear()}}export{n as J}
@@ -1 +1 @@
1
- import{A as e}from"./p-DfL-8Yvt.js";import"./p-AyLerOda.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";const t=e();class s{async fetchDispute(e,s){return t.get({endpoint:`disputes/${e}`,authToken:s})}async updateDisputeResponse(e,s,n){return t.patch({endpoint:`disputes/${e}/response`,body:n,authToken:s})}async submitDisputeResponse(e,s,n){return t.post({endpoint:`disputes/${e}/response`,body:n,authToken:s})}async createDisputeEvidence(e,s,n){return t.put({endpoint:`disputes/${e}/evidence`,body:n,authToken:s})}}var n,i;!function(e){e.nextStep="nextStep",e.previousStep="previousStep",e.cancelDispute="cancelDispute",e.respondToDispute="respondToDispute",e.submit="submit"}(n||(n={})),function(e){e.disputeReason="dispute_reason",e.productOrService="product_or_service",e.customerDetails="customer_details",e.cancellationPolicy="cancellation_policy",e.refundPolicy="refund_policy",e.duplicateCharge="duplicate_charge",e.electronicEvidence="electronic_evidence",e.shippingDetails="shipping_details",e.additionalStatement="additional_statement"}(i||(i={}));export{n as D,s as a}
1
+ import{A as e}from"./p-C1x6dkgs.js";import"./p-8fO8CrtQ.js";import"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";const t=e();class s{async fetchDispute(e,s){return t.get({endpoint:`disputes/${e}`,authToken:s})}async updateDisputeResponse(e,s,n){return t.patch({endpoint:`disputes/${e}/response`,body:n,authToken:s})}async submitDisputeResponse(e,s,n){return t.post({endpoint:`disputes/${e}/response`,body:n,authToken:s})}async createDisputeEvidence(e,s,n){return t.put({endpoint:`disputes/${e}/evidence`,body:n,authToken:s})}}var n,i;!function(e){e.nextStep="nextStep",e.previousStep="previousStep",e.cancelDispute="cancelDispute",e.respondToDispute="respondToDispute",e.submit="submit"}(n||(n={})),function(e){e.disputeReason="dispute_reason",e.productOrService="product_or_service",e.customerDetails="customer_details",e.cancellationPolicy="cancellation_policy",e.refundPolicy="refund_policy",e.duplicateCharge="duplicate_charge",e.electronicEvidence="electronic_evidence",e.shippingDetails="shipping_details",e.additionalStatement="additional_statement"}(i||(i={}));export{n as D,s as a}
@@ -1 +1 @@
1
- const a="font-family",t="background-color",s=`text color ${a}`,n=`text-danger ${s}`,e=`heading ${s}`,o=`heading-1 ${e}`,i=`heading-2 ${e}`,$=`heading-3 ${e}`,d=`heading-4 ${e}`,u=`heading-5 ${e}`,b=`link text ${a}`,l=`button ${s}`,c=`button-primary ${l}`,r=`button-secondary ${l}`,p=`button-danger ${l}`,g=`button-success ${l}`,h=`button-warning ${l}`,f=`button-info ${l}`,k=`button-light ${l}`,m=`button-dark ${l}`,x=`button-link ${l}`,y=`button-outline-primary ${l}`,w=`button-outline-secondary ${l}`,v="button-loading",j=`label ${s}`,q=`input ${s} ${t}`,z=`input-group ${q}`,A=`input-invalid ${q}`,B=`input-disabled ${q}`,C=`input-focused ${q}`,D=`input-invalid-and-focused ${q}`,E="input-radio",F=`input-radio-focused ${E}`,G=`input-radio-checked ${E}`,H=`input-radio-checked-focused ${E}`,I=`input-radio-invalid ${E}`,J="input-checkbox",K=`input-checkbox-invalid ${J}`,L=`input-checkbox-focused ${J}`,M=`input-checkbox-checked ${J}`,N=`input-checkbox-checked-focused ${J}`,O=`input-adornment ${s}`,P=`alert ${s}`,Q=`alert-danger ${P}`,R=`tooltip ${s}`,S=`tooltip-icon ${s}`,T=`tooltip-inner ${s}`,U=`card ${s} ${t}`,V=`table ${s} ${t}`,W=`table-row ${s} ${t}`,X=`table-cell ${s} ${t}`,Y="table-head",Z=`table-head-row ${s} ${t}`,_=`table-head-cell ${X}`,aa="table-foot",ta=`table-foot-row ${s} ${t}`,sa=`table-foot-cell ${X}`,na=`table-cell-even ${X}`,ea=`table-cell-odd ${X}`,oa=a=>a%2?na:ea,ia=`table-empty ${s} ${t}`,$a=`table-error ${s} ${t}`,da=`pagination-button ${l}`,ua=`pagination-button-disabled button-disabled ${l}`,ba=`pagination-button-text ${s}`,la=`pagination-button-icon ${s}`,ca=`pagination-button-icon-next ${la}`,ra=`pagination-button-icon-previous ${la}`,pa="loading-spinner",ga=`badge ${a}`,ha=`${ga} badge-primary`,fa=`${ga} badge-secondary`,ka=`${ga} badge-success`,ma=`${ga} badge-danger`,xa=`${ga} badge-warning`,ya=`${ga} badge-info`,wa=`${ga} badge-light`,va=`${ga} badge-dark`,ja=`dropdown-menu ${s}`,qa=`dropdown-menu-button ${c}`,za=`radio-list-item ${s}`,Aa="skeleton",Ba="image",Ca="billing-form",Da="checkout-summary",Ea="filter-menu",Fa="filter-param";export{g as $,$ as A,Ba as B,x as C,U as D,z as E,K as F,N as G,L as H,M as I,J,da as K,ua as L,ra as M,ba as N,ca as O,I as P,H as Q,G as R,F as S,E as T,w as U,y as V,m as W,k as X,f as Y,h as Z,p as _,Fa as a,r as a0,c as a1,v as a2,D as a3,qa as a4,ja as a5,_ as a6,oa as a7,d as a8,u as a9,V as aa,Y as ab,Z as ac,W as ad,aa as ae,ta as af,sa as ag,ia as ah,$a as ai,X as aj,Q as ak,Ca as al,P as am,R as an,T as ao,S as ap,i as b,Da as c,pa as d,va as e,Ea as f,wa as g,o as h,ya as i,xa as j,ma as k,b as l,ka as m,fa as n,ha as o,ga as p,A as q,za as r,Aa as s,s as t,B as u,C as v,q as w,j as x,O as y,n as z}
1
+ const a="font-family",t="background-color",s=`text color ${a}`,n=`text-danger ${s}`,e=`heading ${s}`,o=`heading-1 ${e}`,i=`heading-2 ${e}`,$=`heading-3 ${e}`,d=`heading-4 ${e}`,u=`heading-5 ${e}`,b=`link text ${a}`,l=`button ${s}`,c=`button-primary ${l}`,r=`button-secondary ${l}`,p=`button-danger ${l}`,g=`button-success ${l}`,h=`button-warning ${l}`,f=`button-info ${l}`,k=`button-light ${l}`,m=`button-dark ${l}`,x=`button-link ${l}`,y=`button-outline-primary ${l}`,w=`button-outline-secondary ${l}`,v="button-loading",j=`label ${s}`,q=`input ${s} ${t}`,z=`input-group ${q}`,A=`input-invalid ${q}`,B=`input-disabled ${q}`,C=`input-focused ${q}`,D=`input-invalid-and-focused ${q}`,E="input-radio",F=`input-radio-focused ${E}`,G=`input-radio-checked ${E}`,H=`input-radio-checked-focused ${E}`,I=`input-radio-invalid ${E}`,J="input-checkbox",K=`input-checkbox-invalid ${J}`,L=`input-checkbox-focused ${J}`,M=`input-checkbox-checked ${J}`,N=`input-checkbox-checked-focused ${J}`,O=`input-adornment ${s}`,P=`alert ${s}`,Q=`alert-danger ${P}`,R=`tooltip ${s}`,S=`tooltip-icon ${s}`,T=`tooltip-inner ${s}`,U=`card ${s} ${t}`,V=`table ${s} ${t}`,W=`table-row ${s} ${t}`,X=`table-cell ${s} ${t}`,Y="table-head",Z=`table-head-row ${s} ${t}`,_=`table-head-cell ${X}`,aa="table-foot",ta=`table-foot-row ${s} ${t}`,sa=`table-foot-cell ${X}`,na=`table-cell-even ${X}`,ea=`table-cell-odd ${X}`,oa=a=>a%2?na:ea,ia=`table-empty ${s} ${t}`,$a=`table-error ${s} ${t}`,da=`pagination-button ${l}`,ua=`pagination-button-disabled button-disabled ${l}`,ba=`pagination-button-text ${s}`,la=`pagination-button-icon ${s}`,ca=`pagination-button-icon-next ${la}`,ra=`pagination-button-icon-previous ${la}`,pa="loading-spinner",ga=`badge ${a}`,ha=`${ga} badge-primary`,fa=`${ga} badge-secondary`,ka=`${ga} badge-success`,ma=`${ga} badge-danger`,xa=`${ga} badge-warning`,ya=`${ga} badge-info`,wa=`${ga} badge-light`,va=`${ga} badge-dark`,ja=`dropdown-menu ${s}`,qa=`dropdown-menu-button ${c}`,za=`radio-list-item ${s}`,Aa="skeleton",Ba="image",Ca="billing-form",Da="checkout-summary",Ea="filter-menu",Fa="filter-param";export{g as $,$ as A,Ba as B,x as C,U as D,z as E,K as F,N as G,L as H,M as I,J,da as K,ua as L,ra as M,ba as N,ca as O,I as P,H as Q,G as R,F as S,E as T,w as U,y as V,m as W,k as X,f as Y,h as Z,p as _,Fa as a,r as a0,c as a1,v as a2,D as a3,qa as a4,ja as a5,_ as a6,oa as a7,d as a8,u as a9,V as aa,Y as ab,Z as ac,W as ad,aa as ae,ta as af,sa as ag,ia as ah,$a as ai,X as aj,Ca as ak,Q as al,P as am,R as an,T as ao,S as ap,i as b,Da as c,pa as d,va as e,Ea as f,wa as g,o as h,ya as i,xa as j,ma as k,b as l,ka as m,fa as n,ha as o,ga as p,A as q,za as r,Aa as s,s as t,B as u,C as v,q as w,j as x,O as y,n as z}
@@ -0,0 +1 @@
1
+ import{c as s}from"./p-DgTOxu8x.js";const t={},a={},o=s((()=>t)),{state:c,on:e}=o,p=s((()=>a)),{state:j}=p,r=()=>Object.assign(Object.assign({},c),j),x=()=>{o.reset()};export{x as c,c as f,r as g,e as o,j as p}
@@ -1 +1 @@
1
- import{w as n,c as o}from"./p-DVJaoI_m.js";import{g as t}from"./p-Ds_P-dB8.js";import{p as a}from"./p-CrTWHVKE.js";const e=()=>{async function e(e){var s,i;const{authToken:r,endpoint:d,method:p,params:u,body:c,signal:h,headers:l}=e;await n();const m=`${o.apiOrigin}/v1/${d}`,f=u?`${m}?${new URLSearchParams(u)}`:m,y=await async function(n){return n?{Authorization:`Bearer ${n}`,"Idempotency-Key":t(),"Content-Type":"application/json","Justifi-Web-Component-Version":a.version}:{"Content-Type":"application/json","Justifi-Web-Component-Version":a.version}}(r),T=Object.assign(Object.assign({},y),l),g=await fetch(f,{method:p,headers:T,body:c,signal:h});if(!g)return void function(n){console.error(`Error fetching from ${n}`)}(f);if(204===g.status)return{};const b=await g.json().catch((()=>({})));if(!g.ok){const n=new Error((null===(s=null==b?void 0:b.error)||void 0===s?void 0:s.message)||("string"==typeof(null==b?void 0:b.error)?b.error:null)||(null==b?void 0:b.message)||`Request failed: ${g.status}`);throw n.code=null===(i=null==b?void 0:b.error)||void 0===i?void 0:i.code,n.status=g.status,n.body=b,n}return b}return{get:async function(n){const{authToken:o,endpoint:t,params:a,signal:s,headers:i}=n;return e({authToken:o,endpoint:t,method:"GET",params:a,signal:s,headers:i})},post:async function(n){const{authToken:o,endpoint:t,body:a,params:s,signal:i,headers:r}=n;return e({authToken:o,endpoint:t,method:"POST",params:s,body:JSON.stringify(a),signal:i,headers:r})},put:async function(n){const{authToken:o,endpoint:t,body:a,params:s,signal:i}=n;return e({authToken:o,endpoint:t,method:"PUT",params:s,body:JSON.stringify(a),signal:i})},patch:async function(n){const{authToken:o,endpoint:t,body:a,params:s,signal:i}=n;return e({authToken:o,endpoint:t,method:"PATCH",params:s,body:JSON.stringify(a),signal:i})},destroy:async function(n){const{authToken:o,endpoint:t,params:a,signal:s}=n;return e({authToken:o,endpoint:t,method:"DELETE",params:a,signal:s})}}};export{e as A}
1
+ import{w as n,c as o}from"./p-B4vLfYnZ.js";import{g as t}from"./p-Ds_P-dB8.js";import{p as a}from"./p-DlhPMNzz.js";const e=()=>{async function e(e){var s,i;const{authToken:r,endpoint:d,method:p,params:u,body:c,signal:h,headers:l}=e;await n();const m=`${o.apiOrigin}/v1/${d}`,f=u?`${m}?${new URLSearchParams(u)}`:m,y=await async function(n){return n?{Authorization:`Bearer ${n}`,"Idempotency-Key":t(),"Content-Type":"application/json","Justifi-Web-Component-Version":a.version}:{"Content-Type":"application/json","Justifi-Web-Component-Version":a.version}}(r),T=Object.assign(Object.assign({},y),l),g=await fetch(f,{method:p,headers:T,body:c,signal:h});if(!g)return void function(n){console.error(`Error fetching from ${n}`)}(f);if(204===g.status)return{};const b=await g.json().catch((()=>({})));if(!g.ok){const n=new Error((null===(s=null==b?void 0:b.error)||void 0===s?void 0:s.message)||("string"==typeof(null==b?void 0:b.error)?b.error:null)||(null==b?void 0:b.message)||`Request failed: ${g.status}`);throw n.code=null===(i=null==b?void 0:b.error)||void 0===i?void 0:i.code,n.status=g.status,n.body=b,n}return b}return{get:async function(n){const{authToken:o,endpoint:t,params:a,signal:s,headers:i}=n;return e({authToken:o,endpoint:t,method:"GET",params:a,signal:s,headers:i})},post:async function(n){const{authToken:o,endpoint:t,body:a,params:s,signal:i,headers:r}=n;return e({authToken:o,endpoint:t,method:"POST",params:s,body:JSON.stringify(a),signal:i,headers:r})},put:async function(n){const{authToken:o,endpoint:t,body:a,params:s,signal:i}=n;return e({authToken:o,endpoint:t,method:"PUT",params:s,body:JSON.stringify(a),signal:i})},patch:async function(n){const{authToken:o,endpoint:t,body:a,params:s,signal:i}=n;return e({authToken:o,endpoint:t,method:"PATCH",params:s,body:JSON.stringify(a),signal:i})},destroy:async function(n){const{authToken:o,endpoint:t,params:a,signal:s}=n;return e({authToken:o,endpoint:t,method:"DELETE",params:a,signal:s})}}};export{e as A}
@@ -0,0 +1 @@
1
+ import{c as s}from"./p-DgTOxu8x.js";const t={},a={},o=s((()=>t)),{state:c,on:e}=o,p=s((()=>a)),{state:j}=p,r=()=>Object.assign(Object.assign({},c),j),x=()=>{o.reset()};export{x as c,c as f,r as g,e as o,j as p}
@@ -0,0 +1 @@
1
+ import{c as s}from"./p-DgTOxu8x.js";const t={},a={},o=s((()=>t)),{state:c,on:e}=o,p=s((()=>a)),{state:j}=p,r=()=>Object.assign(Object.assign({},c),j),x=()=>{o.reset()};export{x as c,c as f,r as g,e as o,j as p}
@@ -0,0 +1 @@
1
+ import{h as r}from"./p-CV0Pyo1O.js";import{z as t}from"./p-Bu7gdOaV.js";const o=o=>{const{errorText:e,name:s}=o;return e?r("small",{class:"form-text text-danger",id:`form-error-text-${s}`,part:t},e):null};export{o as F}
@@ -0,0 +1 @@
1
+ import{B as r}from"./p-DaDqgDrb.js";import{C as o}from"./p-8fO8CrtQ.js";import{g as s,a as e}from"./p-D1H6VUbM.js";const t=({id:t,authToken:a,service:i})=>async({onSuccess:n,onError:c,final:f})=>{var l;try{const f=await i.fetchBusiness(t,a);if(f.error){return c({error:e(f.error),code:s(null===(l=f.error)||void 0===l?void 0:l.code),severity:o.ERROR})}n({business:new r(f.data)})}catch(r){const e=s(null==r?void 0:r.code);return c({error:r.message||r,code:e,severity:o.ERROR})}finally{f()}};export{t as m}
@@ -1 +1 @@
1
- import{h as a}from"./p-CV0Pyo1O.js";import{U as s,V as n,C as r,W as i,X as t,Y as o,Z as e,_ as c,$ as l,a0 as d,a1 as p,a2 as u}from"./p-CPKMvyV_.js";const b=(b,f)=>{const{variant:m,isLoading:v,className:y,class:j,clickHandler:g}=b,O=function(a,s){var n={};for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&s.indexOf(r)<0&&(n[r]=a[r]);if(null!=a&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(a);i<r.length;i++)s.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(a,r[i])&&(n[r[i]]=a[r[i]])}return n}(b,["variant","isLoading","className","class","clickHandler"]),$=y||j||"";return a("button",Object.assign({class:`btn btn-${m}${$?` ${$}`:""}`,onClick:g,part:`${{primary:p,secondary:d,success:l,danger:c,warning:e,info:o,light:t,dark:i,link:r,"outline-primary":n,"outline-secondary":s}[m]} ${v?u:""}`},O),v?a("div",{class:"spinner-border spinner-border-sm",role:"status",part:"button-spinner"},a("span",{class:"visually-hidden"},"Loading...")):f)};export{b as B}
1
+ import{h as a}from"./p-CV0Pyo1O.js";import{U as s,V as n,C as r,W as i,X as t,Y as o,Z as e,_ as c,$ as l,a0 as d,a1 as p,a2 as u}from"./p-Bu7gdOaV.js";const b=(b,f)=>{const{variant:m,isLoading:g,className:j,class:v,clickHandler:y}=b,O=function(a,s){var n={};for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&s.indexOf(r)<0&&(n[r]=a[r]);if(null!=a&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(a);i<r.length;i++)s.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(a,r[i])&&(n[r[i]]=a[r[i]])}return n}(b,["variant","isLoading","className","class","clickHandler"]),$=j||v||"";return a("button",Object.assign({class:`btn btn-${m}${$?` ${$}`:""}`,onClick:y,part:`${{primary:p,secondary:d,success:l,danger:c,warning:e,info:o,light:t,dark:i,link:r,"outline-primary":n,"outline-secondary":s}[m]} ${g?u:""}`},O),g?a("div",{class:"spinner-border spinner-border-sm",role:"status",part:"button-spinner"},a("span",{class:"visually-hidden"},"Loading...")):f)};export{b as B}
@@ -0,0 +1 @@
1
+ import{h as o}from"./p-CV0Pyo1O.js";import{h as r}from"./p-Bu7gdOaV.js";const s=s=>o("h1",{class:`header-1 ${null==s?void 0:s.class}`,part:r},s.text);export{s as H}
@@ -0,0 +1 @@
1
+ import"./p-B4vLfYnZ.js";import"./p-HXpYMWUU.js";import{e as r,C as o}from"./p-8fO8CrtQ.js";import"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";import{g as s,a as e}from"./p-D1H6VUbM.js";const t=({id:t,authToken:i,service:a})=>async({onSuccess:p,onError:n,final:c})=>{var m;try{const c=await a.fetchPayment(t,i);if(c.error){n({error:e(c.error),code:s(null===(m=c.error)||void 0===m?void 0:m.code),severity:o.ERROR})}else p({payment:new r(c.data)})}catch(r){const t=s(null==r?void 0:r.code);n({error:e(r),code:t,severity:o.ERROR})}finally{c()}};export{t as m}
@@ -1 +1 @@
1
- import{S as e}from"./p-BcNb9bVO.js";const a=[{label:"Choose province",value:""},{label:"Alberta",value:"AB"},{label:"British Columbia",value:"BC"},{label:"Manitoba",value:"MB"},{label:"New Brunswick",value:"NB"},{label:"Newfoundland and Labrador",value:"NL"},{label:"Northwest Territories",value:"NT"},{label:"Nova Scotia",value:"NS"},{label:"Nunavut",value:"NU"},{label:"Ontario",value:"ON"},{label:"Prince Edward Island",value:"PE"},{label:"Quebec",value:"QC"},{label:"Saskatchewan",value:"SK"},{label:"Yukon",value:"YT"}],l={USA:{stateLabel:"State",postalLabel:"Zip Code",idNumberLabel:"SSN",idNumberLabelOptional:"SSN (optional)",identityHelpText:"Enter your full Social Security Number. It is required for Federal OFAC check.",taxIdLabel:"Tax ID (EIN or SSN)",taxIdLabelOptional:"",taxIdHelpText:"Employer Identification Numbers (EINs) are nine digits. The federal tax identification number/EIN issued to you by the IRS. It can be found on your tax returns. Enter value without dashes."},CAN:{stateLabel:"Province / State",postalLabel:"Postal / Zip Code",idNumberLabel:"SIN",idNumberLabelOptional:"SIN (optional)",identityHelpText:"Enter your full Social Insurance Number.",taxIdLabel:"Business Number (BN)",taxIdLabelOptional:"Business Number (BN) (optional)",taxIdHelpText:"Business Numbers (BN) are nine digits. Enter value without spaces or dashes."}},t=[{label:"Choose province / state",value:""},...a.filter((e=>""!==e.value)),...e.filter((e=>""!==e.value))],i={USA:{stateOptions:e},CAN:{stateOptions:t}},o={USA:{postalRegex:/^[0-9]{5}(-[0-9]{4})?$/,identityDigits:9,taxIdDigits:9},CAN:{postalRegex:/^([A-Za-z]\d[A-Za-z][ -]?\d[A-Za-z]\d|[0-9]{5}(-[0-9]{4})?)$/,identityDigits:9,taxIdDigits:9}};export{a as P,o as a,i as b,l as c}
1
+ import{S as e}from"./p-DaDqgDrb.js";const a=[{label:"Choose province",value:""},{label:"Alberta",value:"AB"},{label:"British Columbia",value:"BC"},{label:"Manitoba",value:"MB"},{label:"New Brunswick",value:"NB"},{label:"Newfoundland and Labrador",value:"NL"},{label:"Northwest Territories",value:"NT"},{label:"Nova Scotia",value:"NS"},{label:"Nunavut",value:"NU"},{label:"Ontario",value:"ON"},{label:"Prince Edward Island",value:"PE"},{label:"Quebec",value:"QC"},{label:"Saskatchewan",value:"SK"},{label:"Yukon",value:"YT"}],l={USA:{stateLabel:"State",postalLabel:"Zip Code",idNumberLabel:"SSN",idNumberLabelOptional:"SSN (optional)",identityHelpText:"Enter your full Social Security Number. It is required for Federal OFAC check.",taxIdLabel:"Tax ID (EIN or SSN)",taxIdLabelOptional:"",taxIdHelpText:"Employer Identification Numbers (EINs) are nine digits. The federal tax identification number/EIN issued to you by the IRS. It can be found on your tax returns. Enter value without dashes."},CAN:{stateLabel:"Province / State",postalLabel:"Postal / Zip Code",idNumberLabel:"SIN",idNumberLabelOptional:"SIN (optional)",identityHelpText:"Enter your full Social Insurance Number.",taxIdLabel:"Business Number (BN)",taxIdLabelOptional:"Business Number (BN) (optional)",taxIdHelpText:"Business Numbers (BN) are nine digits. Enter value without spaces or dashes."}},t=[{label:"Choose province / state",value:""},...a.filter((e=>""!==e.value)),...e.filter((e=>""!==e.value))],i={USA:{stateOptions:e},CAN:{stateOptions:t}},o={USA:{postalRegex:/^[0-9]{5}(-[0-9]{4})?$/,identityDigits:9,taxIdDigits:9},CAN:{postalRegex:/^([A-Za-z]\d[A-Za-z][ -]?\d[A-Za-z]\d|[0-9]{5}(-[0-9]{4})?)$/,identityDigits:9,taxIdDigits:9}};export{a as P,o as a,i as b,l as c}
@@ -0,0 +1 @@
1
+ import{c as e,a as s}from"./p-D9sqTVmd.js";import{m as t,d as n,i as a,b as i,a as r,p as o,e as l,w as _,c,t as d,o as u,f as m,r as p,g as b,h,l as E,j as f,k as g,n as w,s as v,q as y,u as $,v as x,x as S,y as j}from"./p-Do9dxNjh.js";import{C as D}from"./p-DaDqgDrb.js";import{c as q}from"./p-CawcnSoV.js";const C=s=>{const t=e({legal_name:c.required("Enter legal name"),website_url:_.required("Enter business website url"),email:l.required("Enter business email"),phone:o.required("Enter phone number"),doing_business_as:r.nullable(),classification:i.required("Select business classification"),industry:a.required("Enter a business industry"),date_of_incorporation:n.required("Enter date of registration")}),u=e({legal_name:c.required("Enter legal name"),website_url:_.nullable(),email:l.nullable(),phone:o.nullable(),doing_business_as:r.nullable(),classification:i.nullable(),industry:a.nullable(),tax_id:d.nullable(),date_of_incorporation:n.nullable()});return s?u:t},V=n=>C(n).concat(e({classification:s().required("Select business classification"),tax_id:t(D.USA).when("tax_id_last4",{is:e=>!e,then:e=>e.required(`Enter valid ${q.USA.taxIdLabel} without dashes`),otherwise:e=>e.nullable()})})),k=n=>C(n).concat(e({classification:s().required("Select business classification"),tax_id:t(D.CAN).when("tax_id_last4",{is:e=>!e,then:e=>e.notRequired().nullable(),otherwise:e=>e.nullable()})})),N=s=>{const t=e({business_revenue:p.required("Enter business revenue"),business_payment_volume:b.required("Enter business payment volume"),business_average_transaction_amount:p.required("Enter average transaction amount"),business_when_service_received:m.required("Select when service is received"),business_other_payment_details:u.nullable()}),n=e({business_revenue:p.nullable(),business_payment_volume:b.nullable(),business_average_transaction_amount:p.nullable(),business_when_service_received:m.nullable(),business_other_payment_details:u.nullable()});return s?n:t},T=t=>e(t?{line1:f.nullable(),line2:E.nullable(),city:h.nullable(),state:s().nullable(),postal_code:s().nullable()}:{line1:f.required("Enter street address"),line2:E.nullable(),city:h.required("Enter city"),state:s().required("Select state"),postal_code:g(D.USA).required("Enter postal code")}),z=t=>e(t?{line1:f.nullable(),line2:E.nullable(),city:h.nullable(),state:s().nullable(),postal_code:s().nullable()}:{line1:f.required("Enter street address"),line2:E.nullable(),city:h.required("Enter city"),state:s().required("Select province or state"),postal_code:g(D.CAN).required("Enter postal code")}),A={[D.USA]:T,[D.CAN]:z},B=(t,n)=>n?(t=>e({name:x.required(`Enter ${t} name`),title:$.nullable(),email:l.nullable(),phone:o.nullable(),dob_full:y(t).nullable(),ssn_last4:s().nullable(),identification_number:v.nullable(),ownership_percentage:w.nullable(),address:T(!0)}))(t):(t=>e({name:x.required(`Enter ${t} name`),title:$.required(`Enter ${t} title`),email:l.required(`Enter ${t} email`),phone:o.required("Enter phone number"),dob_full:y(t).required("Enter date of birth"),ssn_last4:s().nullable(),identification_number:v,ownership_percentage:"owner"===t?S(25).required("Enter ownership percentage"):w.nullable(),address:T(!1)}))(t),F=(t,n)=>n?(t=>e({name:x.required(`Enter ${t} name`),title:$.nullable(),email:l.nullable(),phone:o.nullable(),dob_full:y(t).nullable(),ssn_last4:s().nullable(),identification_number:j(D.CAN).nullable(),ownership_percentage:w.nullable(),address:z(!0)}))(t):(t=>e({name:x.required(`Enter ${t} name`),title:$.required(`Enter ${t} title`),email:l.required(`Enter ${t} email`),phone:o.required("Enter phone number"),dob_full:y(t).required("Enter date of birth"),ssn_last4:s().nullable(),identification_number:j(D.CAN).nullable(),ownership_percentage:"owner"===t?S(25).required("Enter ownership percentage"):w.nullable(),address:z(!1)}))(t),G={[D.USA]:B,[D.CAN]:F};export{N as a,V as b,T as c,k as d,F as e,z as f,G as g,A as h,B as i}
@@ -1 +1 @@
1
- import{A as t}from"./p-DfL-8Yvt.js";import"./p-AyLerOda.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";const n=t();class e{async fetchBusiness(t,e){return n.get({endpoint:`entities/business/${t}`,authToken:e})}async patchBusiness(t,e,s){return n.patch({endpoint:`entities/business/${e}`,body:s,authToken:t})}}class s{async fetchIdentity(t,e){return n.get({endpoint:`entities/identity/${t}`,authToken:e})}async patchIdentity(t,e,s){return n.patch({endpoint:`entities/identity/${e}`,body:s,authToken:t})}async postIdentity(t,e){return n.post({endpoint:"entities/identity",body:e,authToken:t})}}class i{async postBankAccount(t,e){return n.post({endpoint:"entities/bank_accounts",body:e,authToken:t})}}class o{async postDocumentRecord(t,e){return n.post({endpoint:"entities/document",body:e,authToken:t})}}export{e as B,o as D,s as I,i as a}
1
+ import{A as t}from"./p-C1x6dkgs.js";import"./p-8fO8CrtQ.js";import"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";const n=t();class e{async fetchBusiness(t,e){return n.get({endpoint:`entities/business/${t}`,authToken:e})}async patchBusiness(t,e,s){return n.patch({endpoint:`entities/business/${e}`,body:s,authToken:t})}}class s{async fetchIdentity(t,e){return n.get({endpoint:`entities/identity/${t}`,authToken:e})}async patchIdentity(t,e,s){return n.patch({endpoint:`entities/identity/${e}`,body:s,authToken:t})}async postIdentity(t,e){return n.post({endpoint:"entities/identity",body:e,authToken:t})}}class i{async postBankAccount(t,e){return n.post({endpoint:"entities/bank_accounts",body:e,authToken:t})}}class o{async postDocumentRecord(t,e){return n.post({endpoint:"entities/document",body:e,authToken:t})}}export{e as B,o as D,s as I,i as a}
@@ -0,0 +1 @@
1
+ import{A as n}from"./p-C1x6dkgs.js";import"./p-8fO8CrtQ.js";import"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";const t=n();class i{async getLinkToken(n,i,a,e){return t.post({endpoint:`plaid/${i}/link`,body:{checkout_id:a},authToken:n,signal:e})}async getLinkTokenForVerification(n,i,a){return t.post({endpoint:`entities/plaid/${i}/link_token`,body:{},authToken:n,signal:a})}async getBankAccountData(n,i,a){return t.get({endpoint:`entities/plaid/${i}/bank_account`,authToken:n,signal:a})}async postPlaidVerifiedBankAccountData(n,i,a,e){return t.post({endpoint:`entities/plaid/${i}/bank_account`,body:a,authToken:n,signal:e})}async tokenizeBankAccount(n,i,a,e,o,s){const c=`plaid/${i}/tokenize`,k={public_token:a};return e&&(k.link_token_id=e),o&&(k.payment_method_group_id=o),t.post({endpoint:c,body:k,authToken:n,signal:s})}}export{i as P}
@@ -1 +1 @@
1
- import{C as t}from"./p-AyLerOda.js";import{g as a,a as e}from"./p-CXZRiaUw.js";import{h as r}from"./p-CV0Pyo1O.js";import{B as n,a as i}from"./p-CHw7tICr.js";const o=({authToken:r,service:n})=>async({payoutId:i,onError:o})=>{try{const{data:t}=await n.fetchCSV(i,r),a=document.createElement("a");a.href=t.csv_url,a.click()}catch(r){o({error:e(r),code:a(null==r?void 0:r.code),severity:t.ERROR})}},d=t=>r(i,Object.assign({},{canceled:{variant:n.DANGER,title:"Transfer to your bank account failed",text:"Canceled"},failed:{variant:n.DANGER,title:"Transfer to your bank account failed",text:"Failed"},forwarded:{variant:n.SECONDARY,title:"This payout initially failed; the funds have been forwarded to your next successful payout",text:"Forwarded"},in_transit:{variant:n.PRIMARY,title:"Transfer to your bank account has been initiated",text:"In Transit"},paid:{variant:n.SUCCESS,title:"Successfully deposited into your bank account",text:"Paid"},pending:{variant:n.PRIMARY,title:"Batched and scheduled to be transferred",text:"Pending"},scheduled:{variant:n.PRIMARY,title:"Batched and scheduled to be transferred",text:"Scheduled"},withdrawn:{variant:n.SUCCESS,title:"Negative payout balance successfully withdrawn from your bank account",text:"Withdrawn"}}[t]));export{d as M,o as m}
1
+ import{C as t}from"./p-8fO8CrtQ.js";import{g as a,a as e}from"./p-D1H6VUbM.js";import{h as r}from"./p-CV0Pyo1O.js";import{B as n,a as i}from"./p-Dz8KJn2G.js";const o=({authToken:r,service:n})=>async({payoutId:i,onError:o})=>{try{const{data:t}=await n.fetchCSV(i,r),a=document.createElement("a");a.href=t.csv_url,a.click()}catch(r){o({error:e(r),code:a(null==r?void 0:r.code),severity:t.ERROR})}},d=t=>r(i,Object.assign({},{canceled:{variant:n.DANGER,title:"Transfer to your bank account failed",text:"Canceled"},failed:{variant:n.DANGER,title:"Transfer to your bank account failed",text:"Failed"},forwarded:{variant:n.SECONDARY,title:"This payout initially failed; the funds have been forwarded to your next successful payout",text:"Forwarded"},in_transit:{variant:n.PRIMARY,title:"Transfer to your bank account has been initiated",text:"In Transit"},paid:{variant:n.SUCCESS,title:"Successfully deposited into your bank account",text:"Paid"},pending:{variant:n.PRIMARY,title:"Batched and scheduled to be transferred",text:"Pending"},scheduled:{variant:n.PRIMARY,title:"Batched and scheduled to be transferred",text:"Scheduled"},withdrawn:{variant:n.SUCCESS,title:"Negative payout balance successfully withdrawn from your bank account",text:"Withdrawn"}}[t]));export{d as M,o as m}
@@ -0,0 +1 @@
1
+ import{A as t}from"./p-C1x6dkgs.js";import"./p-8fO8CrtQ.js";import"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";const e=t();class o{async fetchCheckout(t,o){return e.get({endpoint:`checkouts/${o}`,authToken:t})}async fetchCheckouts(t,o,c){return e.get({endpoint:"checkouts",params:c,headers:{Account:t},authToken:o})}async complete(t,o,c){const s=`checkouts/${o}/complete`,n={payment_mode:c.payment_mode};return c.payment_token&&(n.payment_token=c.payment_token),e.post({endpoint:s,body:n,authToken:t})}}export{o as C}
@@ -0,0 +1 @@
1
+ import{b as t}from"./p-8fO8CrtQ.js";const r=t=>"string"==typeof t?t:t.message,a=r=>{switch(r){case"not_authenticated":return t.NOT_AUTHENTICATED;case"invalid_parameter":return t.INVALID_PARAMETER;default:return t.FETCH_ERROR}};export{r as a,a as g}
@@ -0,0 +1 @@
1
+ import{A as r}from"./p-C1x6dkgs.js";import{S as o,C as s}from"./p-8fO8CrtQ.js";import"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";import"./p-B4vLfYnZ.js";import"./p-HXpYMWUU.js";import{g as t,a as n}from"./p-D1H6VUbM.js";const c=r();class a{async fetchSubAccounts(r,o,s){return c.get({authToken:o,endpoint:"sub_accounts",params:s,headers:{Account:r}})}}const e=({primaryAccountId:r,authToken:c,service:a})=>async({params:e,onSuccess:p,onError:i})=>{var u,m;try{const d=await a.fetchSubAccounts(r,c,e);if(d.error){return i({error:n(d.error),code:t(null===(m=d.error)||void 0===m?void 0:m.code),severity:s.ERROR})}{const r=Object.assign({},d.page_info);p({subAccounts:(null===(u=d.data)||void 0===u?void 0:u.map((r=>new o(r))))||[],pagingInfo:r})}}catch(r){const o=t(null==r?void 0:r.code);return i({error:r.message||r,code:o,severity:s.ERROR})}};export{a as S,e as m}
@@ -0,0 +1 @@
1
+ import{A as t}from"./p-C1x6dkgs.js";import"./p-8fO8CrtQ.js";import"./p-CLHwhyvu.js";import"./p-DaDqgDrb.js";const a=t();class n{async fetchPayouts(t,n,s){return a.get({authToken:n,endpoint:`account/${t}/payouts`,params:s})}async fetchPayout(t,n){return a.get({authToken:n,endpoint:`payouts/${t}`})}async fetchCSV(t,n){return a.get({authToken:n,endpoint:`reports/payouts/${t}`})}async fetchPayoutTransactions(t,n,s){return a.get({authToken:n,endpoint:"balance_transactions",params:s,headers:{"sub-account":t}})}}export{n as P}
@@ -0,0 +1 @@
1
+ import{C as r}from"./p-8fO8CrtQ.js";import{g as o,a as e}from"./p-D1H6VUbM.js";const n=({authToken:n,businessId:i,service:t})=>async({onSuccess:s,onError:a,final:c=()=>{}})=>{var l;try{const c=await t.fetchBusiness(i,n);if(c.error){return a({error:e(c.error),code:o(null===(l=c.error)||void 0===l?void 0:l.code),severity:r.ERROR})}s(c)}catch(e){const n=o(null==e?void 0:e.code);return a({error:e.message||e,code:n,severity:r.ERROR})}finally{c()}},i=({authToken:n,businessId:i,service:t})=>async({payload:s,onSuccess:a,onError:c,final:l=()=>{}})=>{var v;try{const l=await t.patchBusiness(n,i,s);if(l.error){return c({error:e(l.error),code:o(null===(v=l.error)||void 0===v?void 0:v.code),severity:r.ERROR,rawError:l.error})}a(l)}catch(e){const n=o(null==e?void 0:e.code);return c({error:e.message||e,code:n,severity:r.ERROR,rawError:e})}finally{l()}},t=({authToken:n,businessId:i,product:t,service:s})=>async({onSuccess:a,onError:c})=>{var l,v,d,u;try{const y=await s.postProvisioning(n,i,t);if(!(null==y?void 0:y.data)||y.error){const n=null!==(d=null!==(l=null==y?void 0:y.error)&&void 0!==l?l:null===(v=null==y?void 0:y.errors)||void 0===v?void 0:v[0])&&void 0!==d?d:"Provisioning request failed";return c({error:e(n),code:o(null===(u=null==y?void 0:y.error)||void 0===u?void 0:u.code),severity:r.ERROR})}a(y)}catch(e){const n=o(null==e?void 0:e.code);return c({error:e.message||e,code:n,severity:r.ERROR})}},s=({authToken:n,identityId:i,service:t})=>async({onSuccess:s,onError:a,final:c=()=>{}})=>{var l;try{const c=await t.fetchIdentity(i,n);if(c.error){return a({error:e(c.error),code:o(null===(l=c.error)||void 0===l?void 0:l.code),severity:r.ERROR})}s(c)}catch(e){const n=o(null==e?void 0:e.code);return a({error:e.message||e,code:n,severity:r.ERROR})}finally{c()}},a=({authToken:n,identityId:i,service:t})=>async({payload:s,onSuccess:a,onError:c,final:l=()=>{}})=>{var v;try{const l=await t.patchIdentity(n,i,s);if(l.error){return c({error:e(l.error),code:o(null===(v=l.error)||void 0===v?void 0:v.code),severity:r.ERROR})}a(l)}catch(e){const n=o(null==e?void 0:e.code);return c({error:e.message||e,code:n,severity:r.ERROR})}finally{l()}},c=({authToken:n,service:i})=>async({payload:t,onSuccess:s,onError:a,final:c=()=>{}})=>{var l;try{const c=await i.postIdentity(n,t);if(c.error){return a({error:e(c.error),code:o(null===(l=c.error)||void 0===l?void 0:l.code),severity:r.ERROR})}s(c)}catch(e){const n=o(null==e?void 0:e.code);return a({error:e.message||e,code:n,severity:r.ERROR})}finally{c()}},l=({authToken:n,service:i})=>async({payload:t,onSuccess:s,onError:a,final:c=()=>{}})=>{var l;try{const c=await i.postBankAccount(n,t);if(c.error){return a({error:e(c.error),code:o(null===(l=c.error)||void 0===l?void 0:l.code),severity:r.ERROR})}s(c)}catch(e){const n=o(null==e?void 0:e.code);return a({error:e.message||e,code:n,severity:r.ERROR})}finally{c()}},v=({authToken:n,service:i})=>async({payload:t,onSuccess:s,onError:a,final:c=()=>{}})=>{var l;try{const c=await i.postDocumentRecord(n,t);if(c.error){return a({error:e(c.error),code:o(null===(l=c.error)||void 0===l?void 0:l.code),severity:r.ERROR})}s(c)}catch(e){const n=o(null==e?void 0:e.code);return a({error:e.message||e,code:n,severity:r.ERROR})}finally{c()}};export{i as a,t as b,l as c,v as d,s as e,a as f,c as g,n as m}
@@ -0,0 +1 @@
1
+ import{d as b}from"./p-DaDqgDrb.js";const t=(b,t)=>{b.setValues(Object.assign(Object.assign({},b.values.getValue()),t))},a=(b,a)=>{t(b,{address:Object.assign(Object.assign({},b.values.getValue().address),a)})},e=(a,e)=>{const o=b(a.detail);t(e,Object.assign(Object.assign({},e.values.getValue()),{dob_day:o.dob_day,dob_month:o.dob_month,dob_year:o.dob_year}))};export{a,e as b,t as u}
@@ -0,0 +1 @@
1
+ import{c as e}from"./p-DgTOxu8x.js";import{P as n}from"./p-DkoufM1t.js";const t={accountId:"",authToken:"",billingFormFields:{address_postal_code:""},bnplEnabled:!1,isSubmitting:!1,isWalletProcessing:!1,applePayEnabled:!1,googlePayEnabled:!1,achPaymentsEnabled:!1,insuranceEnabled:!1,bnplProviderApiVersion:"",bnplProviderCheckoutUrl:"",bnplProviderClientId:"",bnplProviderMode:"",checkoutId:"",checkoutLoaded:!1,checkoutMode:null,bankAccountVerification:void 0,disableBankAccount:!1,disableCreditCard:!1,disablePaymentMethodGroup:!1,paymentAmount:0,paymentCurrency:"USD",paymentDescription:"",paymentMethodGroupId:void 0,paymentMethods:[],paymentToken:void 0,savePaymentMethod:!1,selectedPaymentMethod:void 0,totalAmount:0,plaidPublicToken:void 0,plaidLinkTokenId:void 0},{state:o,onChange:a}=e(t);function d(){var e;const t=[],a=!o.checkoutLoaded||o.achPaymentsEnabled;if(!o.disablePaymentMethodGroup&&(null===(e=o.paymentMethods)||void 0===e?void 0:e.length)){const e=o.paymentMethods.some((e=>e.type===n.SAVED_CARD)),d=o.paymentMethods.some((e=>e.type===n.SAVED_BANK_ACCOUNT));e&&!o.disableCreditCard&&t.push(n.SAVED_CARD),d&&!o.disableBankAccount&&a&&t.push(n.SAVED_BANK_ACCOUNT)}return o.disableCreditCard||t.push(n.NEW_CARD),!o.disableBankAccount&&a&&t.push(n.NEW_BANK_ACCOUNT),o.bnplEnabled&&t.push(n.SEZZLE),o.applePayEnabled&&t.push(n.APPLE_PAY),o.googlePayEnabled&&t.push(n.GOOGLE_PAY),!0===o.bankAccountVerification&&!o.disableBankAccount&&a&&t.push(n.PLAID),t}function i(){var e;return{selectedPaymentMethod:o.selectedPaymentMethod,paymentAmount:o.paymentAmount,totalAmount:o.totalAmount,paymentCurrency:o.paymentCurrency,paymentDescription:o.paymentDescription,savedPaymentMethods:o.paymentMethods,savePaymentMethod:o.savePaymentMethod,bnplEnabled:o.bnplEnabled,applePayEnabled:o.applePayEnabled,insuranceEnabled:o.insuranceEnabled,disableBankAccount:o.disableBankAccount,disableCreditCard:o.disableCreditCard,disablePaymentMethodGroup:o.disablePaymentMethodGroup,paymentToken:null!==(e=o.paymentToken)&&void 0!==e?e:void 0}}function l(e){let n=!1,o=!0;const d=Object.keys(t).map((t=>a(t,(()=>{!n&&o&&(n=!0,queueMicrotask((()=>{n=!1,o&&e()})))}))));return()=>{o=!1,d.forEach((e=>e()))}}Object.keys(t).forEach((e=>{a(e,(n=>{o[e]=n}))}));export{l as a,i as b,o as c,d as g,a as o}
@@ -0,0 +1 @@
1
+ import{c as s}from"./p-DgTOxu8x.js";const t={},a={},o=s((()=>t)),{state:c,on:e}=o,p=s((()=>a)),{state:j}=p,r=()=>Object.assign(Object.assign({},c),j),x=()=>{o.reset()};export{x as c,c as f,r as g,e as o,j as p}
@@ -1 +1 @@
1
- import{h as t}from"./p-CV0Pyo1O.js";import{aa as a,ab as s,ac as e,ad as r,ae as l,af as c,ag as o,ah as n,ai as p,aj as i}from"./p-CPKMvyV_.js";import{S as b}from"./p-CqiVXthx.js";const u=(a,s)=>t("div",Object.assign({class:"table-wrapper",part:"table-wrapper"},a),s),d=(s,e)=>t("table",Object.assign({class:"table table-hover",part:a},s),e),h=(a,s)=>t("tbody",Object.assign({class:"table-body"},a),s),j=(a,s)=>t("tr",Object.assign({part:r},a),s),m=(a,e)=>t("thead",Object.assign({class:"table-head sticky-top",part:s},a),e),g=(a,s)=>t("tr",Object.assign({class:"table-light text-nowrap",part:e},a),s),y=(a,s)=>t("tfoot",Object.assign({class:"sticky-bottom",part:l},a),s),O=(a,s)=>t("tr",Object.assign({class:"table-light align-middle",part:c},a),s),x=(a,s)=>t("td",Object.assign({part:o},a),s),S=a=>{const{columnSpan:s,isEmpty:e}=a;return s&&e?t("tr",null,t("td",{class:"empty-state",part:n,colSpan:s,style:{textAlign:"center"}},"No results")):null},f=a=>{const{columnSpan:s,errorMessage:e}=a;return s&&e?t("tr",null,t("td",{class:"error-state",part:p,colSpan:s,"data-test-id":"table-error-state",style:{textAlign:"center"}},"An unexpected error occurred: ",e)):null},w=a=>{const{columnSpan:s,isLoading:e}=a;return s&&e?t("tr",null,t("td",{class:"loading-state",part:i,colSpan:s,style:{textAlign:"center"}},t(b,null))):null};class A{get columnData(){return this.columnKeys.map((t=>this.tableColumns[t]()))}get rowData(){return this.collection.map(((t,a)=>this.columnKeys.map((s=>this.tableCells[s](t,a)))))}set collectionData(t){this.collection=t}constructor(t,a,s,e){this.columnKeys=a.split(","),this.collection=t,this.tableColumns=s,this.tableCells=e}}export{A as T,u as a,d as b,m as c,g as d,h as e,w as f,S as g,f as h,j as i,y as j,O as k,x as l}
1
+ import{h as t}from"./p-CV0Pyo1O.js";import{aa as a,ab as s,ac as e,ad as r,ae as l,af as c,ag as o,ah as n,ai as p,aj as i}from"./p-Bu7gdOaV.js";import{S as b}from"./p-MPer3Rw7.js";const u=(a,s)=>t("div",Object.assign({class:"table-wrapper",part:"table-wrapper"},a),s),d=(s,e)=>t("table",Object.assign({class:"table table-hover",part:a},s),e),h=(a,s)=>t("tbody",Object.assign({class:"table-body"},a),s),g=(a,s)=>t("tr",Object.assign({part:r},a),s),j=(a,e)=>t("thead",Object.assign({class:"table-head sticky-top",part:s},a),e),m=(a,s)=>t("tr",Object.assign({class:"table-light text-nowrap",part:e},a),s),O=(a,s)=>t("tfoot",Object.assign({class:"sticky-bottom",part:l},a),s),y=(a,s)=>t("tr",Object.assign({class:"table-light align-middle",part:c},a),s),S=(a,s)=>t("td",Object.assign({part:o},a),s),f=a=>{const{columnSpan:s,isEmpty:e}=a;return s&&e?t("tr",null,t("td",{class:"empty-state",part:n,colSpan:s,style:{textAlign:"center"}},"No results")):null},x=a=>{const{columnSpan:s,errorMessage:e}=a;return s&&e?t("tr",null,t("td",{class:"error-state",part:p,colSpan:s,"data-test-id":"table-error-state",style:{textAlign:"center"}},"An unexpected error occurred: ",e)):null},w=a=>{const{columnSpan:s,isLoading:e}=a;return s&&e?t("tr",null,t("td",{class:"loading-state",part:i,colSpan:s,style:{textAlign:"center"}},t(b,null))):null};class A{get columnData(){return this.columnKeys.map((t=>this.tableColumns[t]()))}get rowData(){return this.collection.map(((t,a)=>this.columnKeys.map((s=>this.tableCells[s](t,a)))))}set collectionData(t){this.collection=t}constructor(t,a,s,e){this.columnKeys=a.split(","),this.collection=t,this.tableColumns=s,this.tableCells=e}}export{A as T,u as a,d as b,j as c,m as d,h as e,w as f,f as g,x as h,g as i,O as j,y as k,S as l}